diff --git a/assets/fonts.css b/assets/fonts.css deleted file mode 100644 index a18d7c0..0000000 --- a/assets/fonts.css +++ /dev/null @@ -1,126 +0,0 @@ -@import url('https://fonts.googleapis.com/css2?family=Bitter:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap'); -@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap'); -@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap'); -@import url('https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;500;600;700&display=swap'); - -@font-face { - font-family: 'TT Hoves'; - font-weight: normal; - font-style: normal; - src: local('TT Hoves'), - url('./fonts/TypeType - TT Hoves Regular.ttf') format('truetype'), - url('./fonts/TTHoves-Regular/font.woff') format("woff"), - url('./fonts/TTHoves-Regular/font.woff2') format("woff2"), - url('https://cori-risi-apps.s3.amazonaws.com/fonts/TypeType - TT Hoves Regular.ttf') format('truetype'), - url('https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Regular/font.woff') format("woff"), - url('https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Regular/font.woff2') format("woff2"); -} - -@font-face { - font-family: 'TT Hoves Bold'; - font-weight: bold; - font-style: normal; - src: local('TT Hoves'), - url('./fonts/TypeType - TT Hoves Bold.ttf') format('truetype'), - url('./fonts/TTHoves-Bold/font.woff') format("woff"), - url('./fonts/TTHoves-Bold/font.woff2') format("woff2"), - url('https://cori-risi-apps.s3.amazonaws.com/fonts/TypeType - TT Hoves Bold.ttf') format('truetype'), - url('https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Bold/font.woff') format("woff"), - url('https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Bold/font.woff2') format("woff2"); -} - -@font-face { - font-family: 'TT Hoves Medium'; - font-weight: 500; - font-style: normal; - src: local('TT Hoves'), - url('./fonts/TypeType - TT Hoves Medium.ttf') format('truetype'), - url('./fonts/TTHoves-Medium/font.woff') format("woff"), - url('./fonts/TTHoves-Medium/font.woff2') format("woff2"), - url('https://cori-risi-apps.s3.amazonaws.com/fonts/TypeType - TT Hoves Medium.ttf') format('truetype'), - url('https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Medium/font.woff') format("woff"), - url('https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Medium/font.woff2') format("woff2"); -} - -@font-face { - font-family: 'TT Hoves Italic'; - font-weight: normal; - font-style: italic; - src: local('TT Hoves'), - url('./fonts/TypeType - TT Hoves Italic.ttf') format('truetype'), - url('./fonts/TTHoves-Italic/font.woff') format("woff"), - url('./fonts/TTHoves-Italic/font.woff2') format("woff2"), - url('https://cori-risi-apps.s3.amazonaws.com/fonts/TypeType - TT Hoves Italic.ttf') format('truetype'), - url('https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Italic/font.woff') format("woff"), - url('https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Italic/font.woff2') format("woff2"); -} - - -/* Typography -–––––––––––––––––––––––––––––––––––––––––––––––––– */ - -/* default */ -html, body { - font-family: "Montserrat", "Bitter", serif; -} - -h1, h2, h3, h4, h5, h6 { - font-weight: 400; - font-family: "Montserrat", "TT Hoves", sans-serif; -} - -h1, h2, h6 { - font-family: "Montserrat", "TT Hoves Bold", "TT Hoves", sans-serif; - font-weight: 700; -} - -h3 { - font-family: "Montserrat", "TT Hoves Medium", "TT Hoves", "Bitter", serif; - font-weight: 400; -} - -h4, h5 { - font-family: "Montserrat", "TT Hoves Medium", "TT Hoves", sans-serif; - font-weight: 500; -} - -h1 { font-size: 3.2em; line-height: 1.16; } -h2 { font-size: 2.4em; line-height: 1.25; } -h3 { font-size: 1.8em; line-height: 1.3; } -h4 { font-size: 1.5em; line-height: 1.3; } -h5 { font-size: 1.2em; line-height: 1.3; } -h6 { font-size: .76em; line-height: 1.35; } - -/* Larger than phablet */ -@media (min-width: 550px) { - h1 { font-size: 2.8em; } - h2 { font-size: 2.3em; } - h3 { font-size: 1.8em; } - h4 { font-size: 1.5em; } - h5 { font-size: 1.2em; } - h6 { font-size: 1.0em; } -} - -p { - font-family: "Bitter", serif; - font-size: 1em; - line-height: 1.7; -} - -a { - font-family: "Bitter", serif; - font-size: 1em; - font-weight: normal; - line-height: 1.7; - text-decoration: underline; -} - -a:hover { - text-decoration: underline; - cursor: pointer; -} - -.nav-item a, .sidebar-item a { - font-family: "Montserrat", "TT Hoves", sans-serif; - font-weight: normal; -} diff --git a/assets/index-0b9b7d26.js b/assets/index-0b9b7d26.js new file mode 100644 index 0000000..7145046 --- /dev/null +++ b/assets/index-0b9b7d26.js @@ -0,0 +1,1396 @@ +function LP(e,n){for(var l=0;lh[m]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const m of document.querySelectorAll('link[rel="modulepreload"]'))h(m);new MutationObserver(m=>{for(const v of m)if(v.type==="childList")for(const E of v.addedNodes)E.tagName==="LINK"&&E.rel==="modulepreload"&&h(E)}).observe(document,{childList:!0,subtree:!0});function l(m){const v={};return m.integrity&&(v.integrity=m.integrity),m.referrerPolicy&&(v.referrerPolicy=m.referrerPolicy),m.crossOrigin==="use-credentials"?v.credentials="include":m.crossOrigin==="anonymous"?v.credentials="omit":v.credentials="same-origin",v}function h(m){if(m.ep)return;m.ep=!0;const v=l(m);fetch(m.href,v)}})();var Go=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function g1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function XT(e){if(e.__esModule)return e;var n=e.default;if(typeof n=="function"){var l=function h(){return this instanceof h?Reflect.construct(n,arguments,this.constructor):n.apply(this,arguments)};l.prototype=n.prototype}else l={};return Object.defineProperty(l,"__esModule",{value:!0}),Object.keys(e).forEach(function(h){var m=Object.getOwnPropertyDescriptor(e,h);Object.defineProperty(l,h,m.get?m:{enumerable:!0,get:function(){return e[h]}})}),l}var KT={exports:{}},Yt={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Yp=Symbol.for("react.element"),RP=Symbol.for("react.portal"),DP=Symbol.for("react.fragment"),OP=Symbol.for("react.strict_mode"),BP=Symbol.for("react.profiler"),FP=Symbol.for("react.provider"),NP=Symbol.for("react.context"),UP=Symbol.for("react.forward_ref"),jP=Symbol.for("react.suspense"),VP=Symbol.for("react.memo"),$P=Symbol.for("react.lazy"),v2=Symbol.iterator;function GP(e){return e===null||typeof e!="object"?null:(e=v2&&e[v2]||e["@@iterator"],typeof e=="function"?e:null)}var YT={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},JT=Object.assign,QT={};function hh(e,n,l){this.props=e,this.context=n,this.refs=QT,this.updater=l||YT}hh.prototype.isReactComponent={};hh.prototype.setState=function(e,n){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,n,"setState")};hh.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function eS(){}eS.prototype=hh.prototype;function _1(e,n,l){this.props=e,this.context=n,this.refs=QT,this.updater=l||YT}var y1=_1.prototype=new eS;y1.constructor=_1;JT(y1,hh.prototype);y1.isPureReactComponent=!0;var x2=Array.isArray,tS=Object.prototype.hasOwnProperty,v1={current:null},nS={key:!0,ref:!0,__self:!0,__source:!0};function rS(e,n,l){var h,m={},v=null,E=null;if(n!=null)for(h in n.ref!==void 0&&(E=n.ref),n.key!==void 0&&(v=""+n.key),n)tS.call(n,h)&&!nS.hasOwnProperty(h)&&(m[h]=n[h]);var s=arguments.length-2;if(s===1)m.children=l;else if(1>>1,dn=Je[Bt];if(0>>1;Btm(ii,xt))arm(br,ii)?(Je[Bt]=br,Je[ar]=xt,Bt=ar):(Je[Bt]=ii,Je[sr]=xt,Bt=sr);else if(arm(br,xt))Je[Bt]=br,Je[ar]=xt,Bt=ar;else break e}}return Tt}function m(Je,Tt){var xt=Je.sortIndex-Tt.sortIndex;return xt!==0?xt:Je.id-Tt.id}if(typeof performance=="object"&&typeof performance.now=="function"){var v=performance;e.unstable_now=function(){return v.now()}}else{var E=Date,s=E.now();e.unstable_now=function(){return E.now()-s}}var k=[],D=[],V=1,G=null,J=3,ve=!1,ae=!1,me=!1,Ce=typeof setTimeout=="function"?setTimeout:null,ie=typeof clearTimeout=="function"?clearTimeout:null,te=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function le(Je){for(var Tt=l(D);Tt!==null;){if(Tt.callback===null)h(D);else if(Tt.startTime<=Je)h(D),Tt.sortIndex=Tt.expirationTime,n(k,Tt);else break;Tt=l(D)}}function ze(Je){if(me=!1,le(Je),!ae)if(l(k)!==null)ae=!0,Li(Oe);else{var Tt=l(D);Tt!==null&&Ki(ze,Tt.startTime-Je)}}function Oe(Je,Tt){ae=!1,me&&(me=!1,ie(ht),ht=-1),ve=!0;var xt=J;try{for(le(Tt),G=l(k);G!==null&&(!(G.expirationTime>Tt)||Je&&!wr());){var Bt=G.callback;if(typeof Bt=="function"){G.callback=null,J=G.priorityLevel;var dn=Bt(G.expirationTime<=Tt);Tt=e.unstable_now(),typeof dn=="function"?G.callback=dn:G===l(k)&&h(k),le(Tt)}else h(k);G=l(k)}if(G!==null)var vn=!0;else{var sr=l(D);sr!==null&&Ki(ze,sr.startTime-Tt),vn=!1}return vn}finally{G=null,J=xt,ve=!1}}var Ke=!1,He=null,ht=-1,Ve=5,jt=-1;function wr(){return!(e.unstable_now()-jtJe||125Bt?(Je.sortIndex=xt,n(D,Je),l(k)===null&&Je===l(D)&&(me?(ie(ht),ht=-1):me=!0,Ki(ze,xt-Bt))):(Je.sortIndex=dn,n(k,Je),ae||ve||(ae=!0,Li(Oe))),Je},e.unstable_shouldYield=wr,e.unstable_wrapCallback=function(Je){var Tt=J;return function(){var xt=J;J=Tt;try{return Je.apply(this,arguments)}finally{J=xt}}}})(aS);sS.exports=aS;var XP=sS.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var KP=ut,Zi=XP;function it(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,l=1;l"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),cv=Object.prototype.hasOwnProperty,YP=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,b2={},E2={};function JP(e){return cv.call(E2,e)?!0:cv.call(b2,e)?!1:YP.test(e)?E2[e]=!0:(b2[e]=!0,!1)}function QP(e,n,l,h){if(l!==null&&l.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return h?!1:l!==null?!l.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function ez(e,n,l,h){if(n===null||typeof n>"u"||QP(e,n,l,h))return!0;if(h)return!1;if(l!==null)switch(l.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function di(e,n,l,h,m,v,E){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=h,this.attributeNamespace=m,this.mustUseProperty=l,this.propertyName=e,this.type=n,this.sanitizeURL=v,this.removeEmptyString=E}var jr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){jr[e]=new di(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];jr[n]=new di(n,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){jr[e]=new di(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){jr[e]=new di(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){jr[e]=new di(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){jr[e]=new di(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){jr[e]=new di(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){jr[e]=new di(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){jr[e]=new di(e,5,!1,e.toLowerCase(),null,!1,!1)});var w1=/[\-:]([a-z])/g;function b1(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var n=e.replace(w1,b1);jr[n]=new di(n,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(w1,b1);jr[n]=new di(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(w1,b1);jr[n]=new di(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){jr[e]=new di(e,1,!1,e.toLowerCase(),null,!1,!1)});jr.xlinkHref=new di("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){jr[e]=new di(e,1,!1,e.toLowerCase(),null,!0,!0)});function E1(e,n,l,h){var m=jr.hasOwnProperty(n)?jr[n]:null;(m!==null?m.type!==0:h||!(2s||m[E]!==v[s]){var k=` +`+m[E].replace(" at new "," at ");return e.displayName&&k.includes("")&&(k=k.replace("",e.displayName)),k}while(1<=E&&0<=s);break}}}finally{A0=!1,Error.prepareStackTrace=l}return(e=e?e.displayName||e.name:"")?up(e):""}function tz(e){switch(e.tag){case 5:return up(e.type);case 16:return up("Lazy");case 13:return up("Suspense");case 19:return up("SuspenseList");case 0:case 2:case 15:return e=C0(e.type,!1),e;case 11:return e=C0(e.type.render,!1),e;case 1:return e=C0(e.type,!0),e;default:return""}}function pv(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Lu:return"Fragment";case zu:return"Portal";case uv:return"Profiler";case T1:return"StrictMode";case hv:return"Suspense";case dv:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case uS:return(e.displayName||"Context")+".Consumer";case cS:return(e._context.displayName||"Context")+".Provider";case S1:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case A1:return n=e.displayName||null,n!==null?n:pv(e.type)||"Memo";case Ga:n=e._payload,e=e._init;try{return pv(e(n))}catch{}}return null}function nz(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return pv(n);case 8:return n===T1?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function sl(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function dS(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function rz(e){var n=dS(e)?"checked":"value",l=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),h=""+e[n];if(!e.hasOwnProperty(n)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var m=l.get,v=l.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return m.call(this)},set:function(E){h=""+E,v.call(this,E)}}),Object.defineProperty(e,n,{enumerable:l.enumerable}),{getValue:function(){return h},setValue:function(E){h=""+E},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Dm(e){e._valueTracker||(e._valueTracker=rz(e))}function pS(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var l=n.getValue(),h="";return e&&(h=dS(e)?e.checked?"true":"false":e.value),e=h,e!==l?(n.setValue(e),!0):!1}function Sg(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function fv(e,n){var l=n.checked;return Qn({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:l??e._wrapperState.initialChecked})}function S2(e,n){var l=n.defaultValue==null?"":n.defaultValue,h=n.checked!=null?n.checked:n.defaultChecked;l=sl(n.value!=null?n.value:l),e._wrapperState={initialChecked:h,initialValue:l,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function fS(e,n){n=n.checked,n!=null&&E1(e,"checked",n,!1)}function mv(e,n){fS(e,n);var l=sl(n.value),h=n.type;if(l!=null)h==="number"?(l===0&&e.value===""||e.value!=l)&&(e.value=""+l):e.value!==""+l&&(e.value=""+l);else if(h==="submit"||h==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?gv(e,n.type,l):n.hasOwnProperty("defaultValue")&&gv(e,n.type,sl(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function A2(e,n,l){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var h=n.type;if(!(h!=="submit"&&h!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+e._wrapperState.initialValue,l||n===e.value||(e.value=n),e.defaultValue=n}l=e.name,l!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,l!==""&&(e.name=l)}function gv(e,n,l){(n!=="number"||Sg(e.ownerDocument)!==e)&&(l==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+l&&(e.defaultValue=""+l))}var hp=Array.isArray;function qu(e,n,l,h){if(e=e.options,n){n={};for(var m=0;m"+n.valueOf().toString()+"",n=Om.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function Ap(e,n){if(n){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=n;return}}e.textContent=n}var fp={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},iz=["Webkit","ms","Moz","O"];Object.keys(fp).forEach(function(e){iz.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),fp[n]=fp[e]})});function yS(e,n,l){return n==null||typeof n=="boolean"||n===""?"":l||typeof n!="number"||n===0||fp.hasOwnProperty(e)&&fp[e]?(""+n).trim():n+"px"}function vS(e,n){e=e.style;for(var l in n)if(n.hasOwnProperty(l)){var h=l.indexOf("--")===0,m=yS(l,n[l],h);l==="float"&&(l="cssFloat"),h?e.setProperty(l,m):e[l]=m}}var oz=Qn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function vv(e,n){if(n){if(oz[e]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(it(137,e));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(it(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(it(61))}if(n.style!=null&&typeof n.style!="object")throw Error(it(62))}}function xv(e,n){if(e.indexOf("-")===-1)return typeof n.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var wv=null;function C1(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var bv=null,Wu=null,Zu=null;function k2(e){if(e=ef(e)){if(typeof bv!="function")throw Error(it(280));var n=e.stateNode;n&&(n=h_(n),bv(e.stateNode,e.type,n))}}function xS(e){Wu?Zu?Zu.push(e):Zu=[e]:Wu=e}function wS(){if(Wu){var e=Wu,n=Zu;if(Zu=Wu=null,k2(e),n)for(e=0;e>>=0,e===0?32:31-(gz(e)/_z|0)|0}var Bm=64,Fm=4194304;function dp(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function kg(e,n){var l=e.pendingLanes;if(l===0)return 0;var h=0,m=e.suspendedLanes,v=e.pingedLanes,E=l&268435455;if(E!==0){var s=E&~m;s!==0?h=dp(s):(v&=E,v!==0&&(h=dp(v)))}else E=l&~m,E!==0?h=dp(E):v!==0&&(h=dp(v));if(h===0)return 0;if(n!==0&&n!==h&&!(n&m)&&(m=h&-h,v=n&-n,m>=v||m===16&&(v&4194240)!==0))return n;if(h&4&&(h|=l&16),n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=h;0l;l++)n.push(e);return n}function Jp(e,n,l){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-qo(n),e[n]=l}function wz(e,n){var l=e.pendingLanes&~n;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=n,e.mutableReadLanes&=n,e.entangledLanes&=n,n=e.entanglements;var h=e.eventTimes;for(e=e.expirationTimes;0=gp),F2=String.fromCharCode(32),N2=!1;function jS(e,n){switch(e){case"keyup":return Xz.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function VS(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ru=!1;function Yz(e,n){switch(e){case"compositionend":return VS(n);case"keypress":return n.which!==32?null:(N2=!0,F2);case"textInput":return e=n.data,e===F2&&N2?null:e;default:return null}}function Jz(e,n){if(Ru)return e==="compositionend"||!D1&&jS(e,n)?(e=NS(),ag=z1=Ha=null,Ru=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1=n)return{node:l,offset:n-e};e=h}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=$2(l)}}function WS(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?WS(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function ZS(){for(var e=window,n=Sg();n instanceof e.HTMLIFrameElement;){try{var l=typeof n.contentWindow.location.href=="string"}catch{l=!1}if(l)e=n.contentWindow;else break;n=Sg(e.document)}return n}function O1(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}function aL(e){var n=ZS(),l=e.focusedElem,h=e.selectionRange;if(n!==l&&l&&l.ownerDocument&&WS(l.ownerDocument.documentElement,l)){if(h!==null&&O1(l)){if(n=h.start,e=h.end,e===void 0&&(e=n),"selectionStart"in l)l.selectionStart=n,l.selectionEnd=Math.min(e,l.value.length);else if(e=(n=l.ownerDocument||document)&&n.defaultView||window,e.getSelection){e=e.getSelection();var m=l.textContent.length,v=Math.min(h.start,m);h=h.end===void 0?v:Math.min(h.end,m),!e.extend&&v>h&&(m=h,h=v,v=m),m=G2(l,v);var E=G2(l,h);m&&E&&(e.rangeCount!==1||e.anchorNode!==m.node||e.anchorOffset!==m.offset||e.focusNode!==E.node||e.focusOffset!==E.offset)&&(n=n.createRange(),n.setStart(m.node,m.offset),e.removeAllRanges(),v>h?(e.addRange(n),e.extend(E.node,E.offset)):(n.setEnd(E.node,E.offset),e.addRange(n)))}}for(n=[],e=l;e=e.parentNode;)e.nodeType===1&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l=document.documentMode,Du=null,Iv=null,yp=null,kv=!1;function q2(e,n,l){var h=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;kv||Du==null||Du!==Sg(h)||(h=Du,"selectionStart"in h&&O1(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),yp&&zp(yp,h)||(yp=h,h=zg(Iv,"onSelect"),0Fu||(e.current=Dv[Fu],Dv[Fu]=null,Fu--)}function Pn(e,n){Fu++,Dv[Fu]=e.current,e.current=n}var al={},ni=hl(al),Ci=hl(!1),mc=al;function nh(e,n){var l=e.type.contextTypes;if(!l)return al;var h=e.stateNode;if(h&&h.__reactInternalMemoizedUnmaskedChildContext===n)return h.__reactInternalMemoizedMaskedChildContext;var m={},v;for(v in l)m[v]=n[v];return h&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=m),m}function Ii(e){return e=e.childContextTypes,e!=null}function Rg(){On(Ci),On(ni)}function J2(e,n,l){if(ni.current!==al)throw Error(it(168));Pn(ni,n),Pn(Ci,l)}function nA(e,n,l){var h=e.stateNode;if(n=n.childContextTypes,typeof h.getChildContext!="function")return l;h=h.getChildContext();for(var m in h)if(!(m in n))throw Error(it(108,nz(e)||"Unknown",m));return Qn({},l,h)}function Dg(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||al,mc=ni.current,Pn(ni,e),Pn(Ci,Ci.current),!0}function Q2(e,n,l){var h=e.stateNode;if(!h)throw Error(it(169));l?(e=nA(e,n,mc),h.__reactInternalMemoizedMergedChildContext=e,On(Ci),On(ni),Pn(ni,e)):On(Ci),Pn(Ci,l)}var Hs=null,d_=!1,j0=!1;function rA(e){Hs===null?Hs=[e]:Hs.push(e)}function vL(e){d_=!0,rA(e)}function dl(){if(!j0&&Hs!==null){j0=!0;var e=0,n=Tn;try{var l=Hs;for(Tn=1;e>=E,m-=E,Ys=1<<32-qo(n)+m|l<ht?(Ve=He,He=null):Ve=He.sibling;var jt=J(ie,He,le[ht],ze);if(jt===null){He===null&&(He=Ve);break}e&&He&&jt.alternate===null&&n(ie,He),te=v(jt,te,ht),Ke===null?Oe=jt:Ke.sibling=jt,Ke=jt,He=Ve}if(ht===le.length)return l(ie,He),jn&&sc(ie,ht),Oe;if(He===null){for(;htht?(Ve=He,He=null):Ve=He.sibling;var wr=J(ie,He,jt.value,ze);if(wr===null){He===null&&(He=Ve);break}e&&He&&wr.alternate===null&&n(ie,He),te=v(wr,te,ht),Ke===null?Oe=wr:Ke.sibling=wr,Ke=wr,He=Ve}if(jt.done)return l(ie,He),jn&&sc(ie,ht),Oe;if(He===null){for(;!jt.done;ht++,jt=le.next())jt=G(ie,jt.value,ze),jt!==null&&(te=v(jt,te,ht),Ke===null?Oe=jt:Ke.sibling=jt,Ke=jt);return jn&&sc(ie,ht),Oe}for(He=h(ie,He);!jt.done;ht++,jt=le.next())jt=ve(He,ie,ht,jt.value,ze),jt!==null&&(e&&jt.alternate!==null&&He.delete(jt.key===null?ht:jt.key),te=v(jt,te,ht),Ke===null?Oe=jt:Ke.sibling=jt,Ke=jt);return e&&He.forEach(function(St){return n(ie,St)}),jn&&sc(ie,ht),Oe}function Ce(ie,te,le,ze){if(typeof le=="object"&&le!==null&&le.type===Lu&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case Rm:e:{for(var Oe=le.key,Ke=te;Ke!==null;){if(Ke.key===Oe){if(Oe=le.type,Oe===Lu){if(Ke.tag===7){l(ie,Ke.sibling),te=m(Ke,le.props.children),te.return=ie,ie=te;break e}}else if(Ke.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===Ga&&nE(Oe)===Ke.type){l(ie,Ke.sibling),te=m(Ke,le.props),te.ref=rp(ie,Ke,le),te.return=ie,ie=te;break e}l(ie,Ke);break}else n(ie,Ke);Ke=Ke.sibling}le.type===Lu?(te=fc(le.props.children,ie.mode,ze,le.key),te.return=ie,ie=te):(ze=mg(le.type,le.key,le.props,null,ie.mode,ze),ze.ref=rp(ie,te,le),ze.return=ie,ie=ze)}return E(ie);case zu:e:{for(Ke=le.key;te!==null;){if(te.key===Ke)if(te.tag===4&&te.stateNode.containerInfo===le.containerInfo&&te.stateNode.implementation===le.implementation){l(ie,te.sibling),te=m(te,le.children||[]),te.return=ie,ie=te;break e}else{l(ie,te);break}else n(ie,te);te=te.sibling}te=X0(le,ie.mode,ze),te.return=ie,ie=te}return E(ie);case Ga:return Ke=le._init,Ce(ie,te,Ke(le._payload),ze)}if(hp(le))return ae(ie,te,le,ze);if(Jd(le))return me(ie,te,le,ze);qm(ie,le)}return typeof le=="string"&&le!==""||typeof le=="number"?(le=""+le,te!==null&&te.tag===6?(l(ie,te.sibling),te=m(te,le),te.return=ie,ie=te):(l(ie,te),te=H0(le,ie.mode,ze),te.return=ie,ie=te),E(ie)):l(ie,te)}return Ce}var ih=aA(!0),lA=aA(!1),Fg=hl(null),Ng=null,ju=null,U1=null;function j1(){U1=ju=Ng=null}function V1(e){var n=Fg.current;On(Fg),e._currentValue=n}function Fv(e,n,l){for(;e!==null;){var h=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,h!==null&&(h.childLanes|=n)):h!==null&&(h.childLanes&n)!==n&&(h.childLanes|=n),e===l)break;e=e.return}}function Xu(e,n){Ng=e,U1=ju=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&n&&(Ai=!0),e.firstContext=null)}function mo(e){var n=e._currentValue;if(U1!==e)if(e={context:e,memoizedValue:n,next:null},ju===null){if(Ng===null)throw Error(it(308));ju=e,Ng.dependencies={lanes:0,firstContext:e}}else ju=ju.next=e;return n}var uc=null;function $1(e){uc===null?uc=[e]:uc.push(e)}function cA(e,n,l,h){var m=n.interleaved;return m===null?(l.next=l,$1(n)):(l.next=m.next,m.next=l),n.interleaved=l,ra(e,h)}function ra(e,n){e.lanes|=n;var l=e.alternate;for(l!==null&&(l.lanes|=n),l=e,e=e.return;e!==null;)e.childLanes|=n,l=e.alternate,l!==null&&(l.childLanes|=n),l=e,e=e.return;return l.tag===3?l.stateNode:null}var qa=!1;function G1(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function uA(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Qs(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function tl(e,n,l){var h=e.updateQueue;if(h===null)return null;if(h=h.shared,nn&2){var m=h.pending;return m===null?n.next=n:(n.next=m.next,m.next=n),h.pending=n,ra(e,l)}return m=h.interleaved,m===null?(n.next=n,$1(h)):(n.next=m.next,m.next=n),h.interleaved=n,ra(e,l)}function cg(e,n,l){if(n=n.updateQueue,n!==null&&(n=n.shared,(l&4194240)!==0)){var h=n.lanes;h&=e.pendingLanes,l|=h,n.lanes=l,k1(e,l)}}function rE(e,n){var l=e.updateQueue,h=e.alternate;if(h!==null&&(h=h.updateQueue,l===h)){var m=null,v=null;if(l=l.firstBaseUpdate,l!==null){do{var E={eventTime:l.eventTime,lane:l.lane,tag:l.tag,payload:l.payload,callback:l.callback,next:null};v===null?m=v=E:v=v.next=E,l=l.next}while(l!==null);v===null?m=v=n:v=v.next=n}else m=v=n;l={baseState:h.baseState,firstBaseUpdate:m,lastBaseUpdate:v,shared:h.shared,effects:h.effects},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=n:e.next=n,l.lastBaseUpdate=n}function Ug(e,n,l,h){var m=e.updateQueue;qa=!1;var v=m.firstBaseUpdate,E=m.lastBaseUpdate,s=m.shared.pending;if(s!==null){m.shared.pending=null;var k=s,D=k.next;k.next=null,E===null?v=D:E.next=D,E=k;var V=e.alternate;V!==null&&(V=V.updateQueue,s=V.lastBaseUpdate,s!==E&&(s===null?V.firstBaseUpdate=D:s.next=D,V.lastBaseUpdate=k))}if(v!==null){var G=m.baseState;E=0,V=D=k=null,s=v;do{var J=s.lane,ve=s.eventTime;if((h&J)===J){V!==null&&(V=V.next={eventTime:ve,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var ae=e,me=s;switch(J=n,ve=l,me.tag){case 1:if(ae=me.payload,typeof ae=="function"){G=ae.call(ve,G,J);break e}G=ae;break e;case 3:ae.flags=ae.flags&-65537|128;case 0:if(ae=me.payload,J=typeof ae=="function"?ae.call(ve,G,J):ae,J==null)break e;G=Qn({},G,J);break e;case 2:qa=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,J=m.effects,J===null?m.effects=[s]:J.push(s))}else ve={eventTime:ve,lane:J,tag:s.tag,payload:s.payload,callback:s.callback,next:null},V===null?(D=V=ve,k=G):V=V.next=ve,E|=J;if(s=s.next,s===null){if(s=m.shared.pending,s===null)break;J=s,s=J.next,J.next=null,m.lastBaseUpdate=J,m.shared.pending=null}}while(1);if(V===null&&(k=G),m.baseState=k,m.firstBaseUpdate=D,m.lastBaseUpdate=V,n=m.shared.interleaved,n!==null){m=n;do E|=m.lane,m=m.next;while(m!==n)}else v===null&&(m.shared.lanes=0);yc|=E,e.lanes=E,e.memoizedState=G}}function iE(e,n,l){if(e=n.effects,n.effects=null,e!==null)for(n=0;nl?l:4,e(!0);var h=$0.transition;$0.transition={};try{e(!1),n()}finally{Tn=l,$0.transition=h}}function CA(){return go().memoizedState}function EL(e,n,l){var h=rl(e);if(l={lane:h,action:l,hasEagerState:!1,eagerState:null,next:null},IA(e))kA(n,l);else if(l=cA(e,n,l,h),l!==null){var m=ui();Wo(l,e,h,m),MA(l,n,h)}}function TL(e,n,l){var h=rl(e),m={lane:h,action:l,hasEagerState:!1,eagerState:null,next:null};if(IA(e))kA(n,m);else{var v=e.alternate;if(e.lanes===0&&(v===null||v.lanes===0)&&(v=n.lastRenderedReducer,v!==null))try{var E=n.lastRenderedState,s=v(E,l);if(m.hasEagerState=!0,m.eagerState=s,Xo(s,E)){var k=n.interleaved;k===null?(m.next=m,$1(n)):(m.next=k.next,k.next=m),n.interleaved=m;return}}catch{}finally{}l=cA(e,n,m,h),l!==null&&(m=ui(),Wo(l,e,h,m),MA(l,n,h))}}function IA(e){var n=e.alternate;return e===Jn||n!==null&&n===Jn}function kA(e,n){vp=Vg=!0;var l=e.pending;l===null?n.next=n:(n.next=l.next,l.next=n),e.pending=n}function MA(e,n,l){if(l&4194240){var h=n.lanes;h&=e.pendingLanes,l|=h,n.lanes=l,k1(e,l)}}var $g={readContext:mo,useCallback:Jr,useContext:Jr,useEffect:Jr,useImperativeHandle:Jr,useInsertionEffect:Jr,useLayoutEffect:Jr,useMemo:Jr,useReducer:Jr,useRef:Jr,useState:Jr,useDebugValue:Jr,useDeferredValue:Jr,useTransition:Jr,useMutableSource:Jr,useSyncExternalStore:Jr,useId:Jr,unstable_isNewReconciler:!1},SL={readContext:mo,useCallback:function(e,n){return gs().memoizedState=[e,n===void 0?null:n],e},useContext:mo,useEffect:sE,useImperativeHandle:function(e,n,l){return l=l!=null?l.concat([e]):null,hg(4194308,4,bA.bind(null,n,e),l)},useLayoutEffect:function(e,n){return hg(4194308,4,e,n)},useInsertionEffect:function(e,n){return hg(4,2,e,n)},useMemo:function(e,n){var l=gs();return n=n===void 0?null:n,e=e(),l.memoizedState=[e,n],e},useReducer:function(e,n,l){var h=gs();return n=l!==void 0?l(n):n,h.memoizedState=h.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},h.queue=e,e=e.dispatch=EL.bind(null,Jn,e),[h.memoizedState,e]},useRef:function(e){var n=gs();return e={current:e},n.memoizedState=e},useState:oE,useDebugValue:J1,useDeferredValue:function(e){return gs().memoizedState=e},useTransition:function(){var e=oE(!1),n=e[0];return e=bL.bind(null,e[1]),gs().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,l){var h=Jn,m=gs();if(jn){if(l===void 0)throw Error(it(407));l=l()}else{if(l=n(),Rr===null)throw Error(it(349));_c&30||fA(h,n,l)}m.memoizedState=l;var v={value:l,getSnapshot:n};return m.queue=v,sE(gA.bind(null,h,v,e),[e]),h.flags|=2048,Up(9,mA.bind(null,h,v,l,n),void 0,null),l},useId:function(){var e=gs(),n=Rr.identifierPrefix;if(jn){var l=Js,h=Ys;l=(h&~(1<<32-qo(h)-1)).toString(32)+l,n=":"+n+"R"+l,l=Fp++,0<\/script>",e=e.removeChild(e.firstChild)):typeof h.is=="string"?e=E.createElement(l,{is:h.is}):(e=E.createElement(l),l==="select"&&(E=e,h.multiple?E.multiple=!0:h.size&&(E.size=h.size))):e=E.createElementNS(e,l),e[ys]=n,e[Dp]=h,UA(e,n,!1,!1),n.stateNode=e;e:{switch(E=xv(l,h),l){case"dialog":Dn("cancel",e),Dn("close",e),m=h;break;case"iframe":case"object":case"embed":Dn("load",e),m=h;break;case"video":case"audio":for(m=0;mah&&(n.flags|=128,h=!0,ip(v,!1),n.lanes=4194304)}else{if(!h)if(e=jg(E),e!==null){if(n.flags|=128,h=!0,l=e.updateQueue,l!==null&&(n.updateQueue=l,n.flags|=4),ip(v,!0),v.tail===null&&v.tailMode==="hidden"&&!E.alternate&&!jn)return Qr(n),null}else 2*lr()-v.renderingStartTime>ah&&l!==1073741824&&(n.flags|=128,h=!0,ip(v,!1),n.lanes=4194304);v.isBackwards?(E.sibling=n.child,n.child=E):(l=v.last,l!==null?l.sibling=E:n.child=E,v.last=E)}return v.tail!==null?(n=v.tail,v.rendering=n,v.tail=n.sibling,v.renderingStartTime=lr(),n.sibling=null,l=Yn.current,Pn(Yn,h?l&1|2:l&1),n):(Qr(n),null);case 22:case 23:return ix(),h=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==h&&(n.flags|=8192),h&&n.mode&1?ji&1073741824&&(Qr(n),n.subtreeFlags&6&&(n.flags|=8192)):Qr(n),null;case 24:return null;case 25:return null}throw Error(it(156,n.tag))}function LL(e,n){switch(F1(n),n.tag){case 1:return Ii(n.type)&&Rg(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return oh(),On(Ci),On(ni),Z1(),e=n.flags,e&65536&&!(e&128)?(n.flags=e&-65537|128,n):null;case 5:return W1(n),null;case 13:if(On(Yn),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(it(340));rh()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return On(Yn),null;case 4:return oh(),null;case 10:return V1(n.type._context),null;case 22:case 23:return ix(),null;case 24:return null;default:return null}}var Zm=!1,ti=!1,RL=typeof WeakSet=="function"?WeakSet:Set,yt=null;function Vu(e,n){var l=e.ref;if(l!==null)if(typeof l=="function")try{l(null)}catch(h){or(e,n,h)}else l.current=null}function Zv(e,n,l){try{l()}catch(h){or(e,n,h)}}var _E=!1;function DL(e,n){if(Mv=Mg,e=ZS(),O1(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var h=l.getSelection&&l.getSelection();if(h&&h.rangeCount!==0){l=h.anchorNode;var m=h.anchorOffset,v=h.focusNode;h=h.focusOffset;try{l.nodeType,v.nodeType}catch{l=null;break e}var E=0,s=-1,k=-1,D=0,V=0,G=e,J=null;t:for(;;){for(var ve;G!==l||m!==0&&G.nodeType!==3||(s=E+m),G!==v||h!==0&&G.nodeType!==3||(k=E+h),G.nodeType===3&&(E+=G.nodeValue.length),(ve=G.firstChild)!==null;)J=G,G=ve;for(;;){if(G===e)break t;if(J===l&&++D===m&&(s=E),J===v&&++V===h&&(k=E),(ve=G.nextSibling)!==null)break;G=J,J=G.parentNode}G=ve}l=s===-1||k===-1?null:{start:s,end:k}}else l=null}l=l||{start:0,end:0}}else l=null;for(Pv={focusedElem:e,selectionRange:l},Mg=!1,yt=n;yt!==null;)if(n=yt,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,yt=e;else for(;yt!==null;){n=yt;try{var ae=n.alternate;if(n.flags&1024)switch(n.tag){case 0:case 11:case 15:break;case 1:if(ae!==null){var me=ae.memoizedProps,Ce=ae.memoizedState,ie=n.stateNode,te=ie.getSnapshotBeforeUpdate(n.elementType===n.type?me:jo(n.type,me),Ce);ie.__reactInternalSnapshotBeforeUpdate=te}break;case 3:var le=n.stateNode.containerInfo;le.nodeType===1?le.textContent="":le.nodeType===9&&le.documentElement&&le.removeChild(le.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(it(163))}}catch(ze){or(n,n.return,ze)}if(e=n.sibling,e!==null){e.return=n.return,yt=e;break}yt=n.return}return ae=_E,_E=!1,ae}function xp(e,n,l){var h=n.updateQueue;if(h=h!==null?h.lastEffect:null,h!==null){var m=h=h.next;do{if((m.tag&e)===e){var v=m.destroy;m.destroy=void 0,v!==void 0&&Zv(n,l,v)}m=m.next}while(m!==h)}}function m_(e,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var l=n=n.next;do{if((l.tag&e)===e){var h=l.create;l.destroy=h()}l=l.next}while(l!==n)}}function Hv(e){var n=e.ref;if(n!==null){var l=e.stateNode;switch(e.tag){case 5:e=l;break;default:e=l}typeof n=="function"?n(e):n.current=e}}function $A(e){var n=e.alternate;n!==null&&(e.alternate=null,$A(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[ys],delete n[Dp],delete n[Rv],delete n[_L],delete n[yL])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function GA(e){return e.tag===5||e.tag===3||e.tag===4}function yE(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||GA(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Xv(e,n,l){var h=e.tag;if(h===5||h===6)e=e.stateNode,n?l.nodeType===8?l.parentNode.insertBefore(e,n):l.insertBefore(e,n):(l.nodeType===8?(n=l.parentNode,n.insertBefore(e,l)):(n=l,n.appendChild(e)),l=l._reactRootContainer,l!=null||n.onclick!==null||(n.onclick=Lg));else if(h!==4&&(e=e.child,e!==null))for(Xv(e,n,l),e=e.sibling;e!==null;)Xv(e,n,l),e=e.sibling}function Kv(e,n,l){var h=e.tag;if(h===5||h===6)e=e.stateNode,n?l.insertBefore(e,n):l.appendChild(e);else if(h!==4&&(e=e.child,e!==null))for(Kv(e,n,l),e=e.sibling;e!==null;)Kv(e,n,l),e=e.sibling}var Fr=null,Vo=!1;function ja(e,n,l){for(l=l.child;l!==null;)qA(e,n,l),l=l.sibling}function qA(e,n,l){if(vs&&typeof vs.onCommitFiberUnmount=="function")try{vs.onCommitFiberUnmount(a_,l)}catch{}switch(l.tag){case 5:ti||Vu(l,n);case 6:var h=Fr,m=Vo;Fr=null,ja(e,n,l),Fr=h,Vo=m,Fr!==null&&(Vo?(e=Fr,l=l.stateNode,e.nodeType===8?e.parentNode.removeChild(l):e.removeChild(l)):Fr.removeChild(l.stateNode));break;case 18:Fr!==null&&(Vo?(e=Fr,l=l.stateNode,e.nodeType===8?U0(e.parentNode,l):e.nodeType===1&&U0(e,l),Mp(e)):U0(Fr,l.stateNode));break;case 4:h=Fr,m=Vo,Fr=l.stateNode.containerInfo,Vo=!0,ja(e,n,l),Fr=h,Vo=m;break;case 0:case 11:case 14:case 15:if(!ti&&(h=l.updateQueue,h!==null&&(h=h.lastEffect,h!==null))){m=h=h.next;do{var v=m,E=v.destroy;v=v.tag,E!==void 0&&(v&2||v&4)&&Zv(l,n,E),m=m.next}while(m!==h)}ja(e,n,l);break;case 1:if(!ti&&(Vu(l,n),h=l.stateNode,typeof h.componentWillUnmount=="function"))try{h.props=l.memoizedProps,h.state=l.memoizedState,h.componentWillUnmount()}catch(s){or(l,n,s)}ja(e,n,l);break;case 21:ja(e,n,l);break;case 22:l.mode&1?(ti=(h=ti)||l.memoizedState!==null,ja(e,n,l),ti=h):ja(e,n,l);break;default:ja(e,n,l)}}function vE(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var l=e.stateNode;l===null&&(l=e.stateNode=new RL),n.forEach(function(h){var m=GL.bind(null,e,h);l.has(h)||(l.add(h),h.then(m,m))})}}function Uo(e,n){var l=n.deletions;if(l!==null)for(var h=0;hm&&(m=E),h&=~v}if(h=m,h=lr()-h,h=(120>h?120:480>h?480:1080>h?1080:1920>h?1920:3e3>h?3e3:4320>h?4320:1960*BL(h/1960))-h,10e?16:e,Xa===null)var h=!1;else{if(e=Xa,Xa=null,Wg=0,nn&6)throw Error(it(331));var m=nn;for(nn|=4,yt=e.current;yt!==null;){var v=yt,E=v.child;if(yt.flags&16){var s=v.deletions;if(s!==null){for(var k=0;klr()-nx?pc(e,0):tx|=l),ki(e,n)}function QA(e,n){n===0&&(e.mode&1?(n=Fm,Fm<<=1,!(Fm&130023424)&&(Fm=4194304)):n=1);var l=ui();e=ra(e,n),e!==null&&(Jp(e,n,l),ki(e,l))}function $L(e){var n=e.memoizedState,l=0;n!==null&&(l=n.retryLane),QA(e,l)}function GL(e,n){var l=0;switch(e.tag){case 13:var h=e.stateNode,m=e.memoizedState;m!==null&&(l=m.retryLane);break;case 19:h=e.stateNode;break;default:throw Error(it(314))}h!==null&&h.delete(n),QA(e,l)}var eC;eC=function(e,n,l){if(e!==null)if(e.memoizedProps!==n.pendingProps||Ci.current)Ai=!0;else{if(!(e.lanes&l)&&!(n.flags&128))return Ai=!1,PL(e,n,l);Ai=!!(e.flags&131072)}else Ai=!1,jn&&n.flags&1048576&&iA(n,Bg,n.index);switch(n.lanes=0,n.tag){case 2:var h=n.type;dg(e,n),e=n.pendingProps;var m=nh(n,ni.current);Xu(n,l),m=X1(null,n,h,e,m,l);var v=K1();return n.flags|=1,typeof m=="object"&&m!==null&&typeof m.render=="function"&&m.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,Ii(h)?(v=!0,Dg(n)):v=!1,n.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,G1(n),m.updater=f_,n.stateNode=m,m._reactInternals=n,Uv(n,h,e,l),n=$v(null,n,h,!0,v,l)):(n.tag=0,jn&&v&&B1(n),ci(null,n,m,l),n=n.child),n;case 16:h=n.elementType;e:{switch(dg(e,n),e=n.pendingProps,m=h._init,h=m(h._payload),n.type=h,m=n.tag=WL(h),e=jo(h,e),m){case 0:n=Vv(null,n,h,e,l);break e;case 1:n=fE(null,n,h,e,l);break e;case 11:n=dE(null,n,h,e,l);break e;case 14:n=pE(null,n,h,jo(h.type,e),l);break e}throw Error(it(306,h,""))}return n;case 0:return h=n.type,m=n.pendingProps,m=n.elementType===h?m:jo(h,m),Vv(e,n,h,m,l);case 1:return h=n.type,m=n.pendingProps,m=n.elementType===h?m:jo(h,m),fE(e,n,h,m,l);case 3:e:{if(BA(n),e===null)throw Error(it(387));h=n.pendingProps,v=n.memoizedState,m=v.element,uA(e,n),Ug(n,h,null,l);var E=n.memoizedState;if(h=E.element,v.isDehydrated)if(v={element:h,isDehydrated:!1,cache:E.cache,pendingSuspenseBoundaries:E.pendingSuspenseBoundaries,transitions:E.transitions},n.updateQueue.baseState=v,n.memoizedState=v,n.flags&256){m=sh(Error(it(423)),n),n=mE(e,n,h,l,m);break e}else if(h!==m){m=sh(Error(it(424)),n),n=mE(e,n,h,l,m);break e}else for($i=el(n.stateNode.containerInfo.firstChild),Gi=n,jn=!0,$o=null,l=lA(n,null,h,l),n.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(rh(),h===m){n=ia(e,n,l);break e}ci(e,n,h,l)}n=n.child}return n;case 5:return hA(n),e===null&&Bv(n),h=n.type,m=n.pendingProps,v=e!==null?e.memoizedProps:null,E=m.children,zv(h,m)?E=null:v!==null&&zv(h,v)&&(n.flags|=32),OA(e,n),ci(e,n,E,l),n.child;case 6:return e===null&&Bv(n),null;case 13:return FA(e,n,l);case 4:return q1(n,n.stateNode.containerInfo),h=n.pendingProps,e===null?n.child=ih(n,null,h,l):ci(e,n,h,l),n.child;case 11:return h=n.type,m=n.pendingProps,m=n.elementType===h?m:jo(h,m),dE(e,n,h,m,l);case 7:return ci(e,n,n.pendingProps,l),n.child;case 8:return ci(e,n,n.pendingProps.children,l),n.child;case 12:return ci(e,n,n.pendingProps.children,l),n.child;case 10:e:{if(h=n.type._context,m=n.pendingProps,v=n.memoizedProps,E=m.value,Pn(Fg,h._currentValue),h._currentValue=E,v!==null)if(Xo(v.value,E)){if(v.children===m.children&&!Ci.current){n=ia(e,n,l);break e}}else for(v=n.child,v!==null&&(v.return=n);v!==null;){var s=v.dependencies;if(s!==null){E=v.child;for(var k=s.firstContext;k!==null;){if(k.context===h){if(v.tag===1){k=Qs(-1,l&-l),k.tag=2;var D=v.updateQueue;if(D!==null){D=D.shared;var V=D.pending;V===null?k.next=k:(k.next=V.next,V.next=k),D.pending=k}}v.lanes|=l,k=v.alternate,k!==null&&(k.lanes|=l),Fv(v.return,l,n),s.lanes|=l;break}k=k.next}}else if(v.tag===10)E=v.type===n.type?null:v.child;else if(v.tag===18){if(E=v.return,E===null)throw Error(it(341));E.lanes|=l,s=E.alternate,s!==null&&(s.lanes|=l),Fv(E,l,n),E=v.sibling}else E=v.child;if(E!==null)E.return=v;else for(E=v;E!==null;){if(E===n){E=null;break}if(v=E.sibling,v!==null){v.return=E.return,E=v;break}E=E.return}v=E}ci(e,n,m.children,l),n=n.child}return n;case 9:return m=n.type,h=n.pendingProps.children,Xu(n,l),m=mo(m),h=h(m),n.flags|=1,ci(e,n,h,l),n.child;case 14:return h=n.type,m=jo(h,n.pendingProps),m=jo(h.type,m),pE(e,n,h,m,l);case 15:return RA(e,n,n.type,n.pendingProps,l);case 17:return h=n.type,m=n.pendingProps,m=n.elementType===h?m:jo(h,m),dg(e,n),n.tag=1,Ii(h)?(e=!0,Dg(n)):e=!1,Xu(n,l),PA(n,h,m),Uv(n,h,m,l),$v(null,n,h,!0,e,l);case 19:return NA(e,n,l);case 22:return DA(e,n,l)}throw Error(it(156,n.tag))};function tC(e,n){return IS(e,n)}function qL(e,n,l,h){this.tag=e,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function po(e,n,l,h){return new qL(e,n,l,h)}function sx(e){return e=e.prototype,!(!e||!e.isReactComponent)}function WL(e){if(typeof e=="function")return sx(e)?1:0;if(e!=null){if(e=e.$$typeof,e===S1)return 11;if(e===A1)return 14}return 2}function il(e,n){var l=e.alternate;return l===null?(l=po(e.tag,n,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=n,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&14680064,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,n=e.dependencies,l.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l}function mg(e,n,l,h,m,v){var E=2;if(h=e,typeof e=="function")sx(e)&&(E=1);else if(typeof e=="string")E=5;else e:switch(e){case Lu:return fc(l.children,m,v,n);case T1:E=8,m|=8;break;case uv:return e=po(12,l,n,m|2),e.elementType=uv,e.lanes=v,e;case hv:return e=po(13,l,n,m),e.elementType=hv,e.lanes=v,e;case dv:return e=po(19,l,n,m),e.elementType=dv,e.lanes=v,e;case hS:return __(l,m,v,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case cS:E=10;break e;case uS:E=9;break e;case S1:E=11;break e;case A1:E=14;break e;case Ga:E=16,h=null;break e}throw Error(it(130,e==null?e:typeof e,""))}return n=po(E,l,n,m),n.elementType=e,n.type=h,n.lanes=v,n}function fc(e,n,l,h){return e=po(7,e,h,n),e.lanes=l,e}function __(e,n,l,h){return e=po(22,e,h,n),e.elementType=hS,e.lanes=l,e.stateNode={isHidden:!1},e}function H0(e,n,l){return e=po(6,e,null,n),e.lanes=l,e}function X0(e,n,l){return n=po(4,e.children!==null?e.children:[],e.key,n),n.lanes=l,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function ZL(e,n,l,h,m){this.tag=n,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=k0(0),this.expirationTimes=k0(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=k0(0),this.identifierPrefix=h,this.onRecoverableError=m,this.mutableSourceEagerHydrationData=null}function ax(e,n,l,h,m,v,E,s,k){return e=new ZL(e,n,l,s,k),n===1?(n=1,v===!0&&(n|=8)):n=0,v=po(3,null,null,n),e.current=v,v.stateNode=e,v.memoizedState={element:h,isDehydrated:l,cache:null,transitions:null,pendingSuspenseBoundaries:null},G1(v),e}function HL(e,n,l){var h=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(oC)}catch(e){console.error(e)}}oC(),oS.exports=Hi;var hx=oS.exports,sC,CE=hx;sC=CE.createRoot,CE.hydrateRoot;const QL="Logging",eR="NoHubcallbackProvidedException";var Ui;(function(e){e.DEBUG="DEBUG",e.ERROR="ERROR",e.INFO="INFO",e.WARN="WARN",e.VERBOSE="VERBOSE",e.NONE="NONE"})(Ui||(Ui={}));const IE={VERBOSE:1,DEBUG:2,INFO:3,WARN:4,ERROR:5,NONE:6};class Zo{constructor(n,l=Ui.WARN){this.name=n,this.level=l,this._pluggables=[]}_padding(n){return n<10?"0"+n:""+n}_ts(){const n=new Date;return[this._padding(n.getMinutes()),this._padding(n.getSeconds())].join(":")+"."+n.getMilliseconds()}configure(n){return n?(this._config=n,this._config):this._config}_log(n,...l){let h=this.level;Zo.LOG_LEVEL&&(h=Zo.LOG_LEVEL),typeof window<"u"&&window.LOG_LEVEL&&(h=window.LOG_LEVEL);const m=IE[h];if(!(IE[n]>=m))return;let E=console.log.bind(console);n===Ui.ERROR&&console.error&&(E=console.error.bind(console)),n===Ui.WARN&&console.warn&&(E=console.warn.bind(console)),Zo.BIND_ALL_LOG_LEVELS&&(n===Ui.INFO&&console.info&&(E=console.info.bind(console)),n===Ui.DEBUG&&console.debug&&(E=console.debug.bind(console)));const s=`[${n}] ${this._ts()} ${this.name}`;let k="";if(l.length===1&&typeof l[0]=="string")k=`${s} - ${l[0]}`,E(k);else if(l.length===1)k=`${s} ${l[0]}`,E(s,l[0]);else if(typeof l[0]=="string"){let D=l.slice(1);D.length===1&&(D=D[0]),k=`${s} - ${l[0]} ${D}`,E(`${s} - ${l[0]}`,D)}else k=`${s} ${l}`,E(s,l);for(const D of this._pluggables){const V={message:k,timestamp:Date.now()};D.pushLogs([V])}}log(...n){this._log(Ui.INFO,...n)}info(...n){this._log(Ui.INFO,...n)}warn(...n){this._log(Ui.WARN,...n)}error(...n){this._log(Ui.ERROR,...n)}debug(...n){this._log(Ui.DEBUG,...n)}verbose(...n){this._log(Ui.VERBOSE,...n)}addPluggable(n){n&&n.getCategoryName()===QL&&(this._pluggables.push(n),n.configure(this._config))}listPluggables(){return this._pluggables}}Zo.LOG_LEVEL=null;Zo.BIND_ALL_LOG_LEVELS=!1;class bs extends Error{constructor({message:n,name:l,recoverySuggestion:h,underlyingError:m}){super(n),this.name=l,this.underlyingError=m,this.recoverySuggestion=h,this.constructor=bs,Object.setPrototypeOf(this,bs.prototype)}}var Vp;(function(e){e.NoEndpointId="NoEndpointId",e.PlatformNotSupported="PlatformNotSupported",e.Unknown="Unknown",e.NetworkError="NetworkError"})(Vp||(Vp={}));const aC=(e,n=bs)=>(l,h,m)=>{const{message:v,recoverySuggestion:E}=e[h];if(!l)throw new n({name:h,message:m?`${v} ${m}`:v,recoverySuggestion:E})},Xg=typeof Symbol<"u"?Symbol("amplify_default"):"@@amplify_default",sp=new Zo("Hub");class tR{constructor(n){this.listeners=new Map,this.protectedChannels=["core","auth","api","analytics","interactions","pubsub","storage","ui","xr"],this.name=n}_remove(n,l){const h=this.listeners.get(n);if(!h){sp.warn(`No listeners for ${n}`);return}this.listeners.set(n,[...h.filter(({callback:m})=>m!==l)])}dispatch(n,l,h,m){typeof n=="string"&&this.protectedChannels.indexOf(n)>-1&&(m===Xg||sp.warn(`WARNING: ${n} is protected and dispatching on it can have unintended consequences`));const v={channel:n,payload:{...l},source:h,patternInfo:[]};try{this._toListeners(v)}catch(E){sp.error(E)}}listen(n,l,h="noname"){let m;if(typeof l!="function")throw new bs({name:eR,message:"No callback supplied to Hub"});m=l;let v=this.listeners.get(n);return v||(v=[],this.listeners.set(n,v)),v.push({name:h,callback:m}),()=>{this._remove(n,m)}}_toListeners(n){const{channel:l,payload:h}=n,m=this.listeners.get(l);m&&m.forEach(v=>{sp.debug(`Dispatching to ${l} with `,h);try{v.callback(n)}catch(E){sp.error(E)}})}}const t1=new tR("__default__"),nR=()=>{if(typeof window<"u"&&typeof window.atob=="function")return window.atob;if(typeof atob=="function")return atob;throw new bs({name:"Base64EncoderError",message:"Cannot resolve the `atob` function from the environment."})},rR={convert(e){return nR()(e)}};var Xs;(function(e){e.AuthTokenConfigException="AuthTokenConfigException",e.AuthUserPoolAndIdentityPoolException="AuthUserPoolAndIdentityPoolException",e.AuthUserPoolException="AuthUserPoolException",e.InvalidIdentityPoolIdException="InvalidIdentityPoolIdException",e.OAuthNotConfigureException="OAuthNotConfigureException"})(Xs||(Xs={}));const iR={[Xs.AuthTokenConfigException]:{message:"Auth Token Provider not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app."},[Xs.AuthUserPoolAndIdentityPoolException]:{message:"Auth UserPool or IdentityPool not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app with UserPoolId and IdentityPoolId."},[Xs.AuthUserPoolException]:{message:"Auth UserPool not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app with userPoolId and userPoolClientId."},[Xs.InvalidIdentityPoolIdException]:{message:"Invalid identity pool id provided.",recoverySuggestion:"Make sure a valid identityPoolId is given in the config."},[Xs.OAuthNotConfigureException]:{message:"oauth param not configured.",recoverySuggestion:"Make sure to call Amplify.configure with oauth parameter in your app."}},lC=aC(iR);function Ti(e){let n=!0;e?n=!!e.userPoolId&&!!e.userPoolClientId:n=!1,lC(n,Xs.AuthUserPoolException)}function gg(e){const n=!!(e!=null&&e.identityPoolId);lC(n,Xs.InvalidIdentityPoolIdException)}function $p(e){const n=e.split(".");if(n.length!==3)throw new Error("Invalid token");try{const h=n[1].replace(/-/g,"+").replace(/_/g,"/"),m=decodeURIComponent(rR.convert(h).split("").map(E=>`%${`00${E.charCodeAt(0).toString(16)}`.slice(-2)}`).join("")),v=JSON.parse(m);return{toString:()=>e,payload:v}}catch{throw new Error("Invalid token payload")}}const cC=e=>{const n=Reflect.ownKeys(e);for(const l of n){const h=e[l];(h&&typeof h=="object"||typeof h=="function")&&cC(h)}return Object.freeze(e)},oR=new Zo("parseAWSExports"),sR={API_KEY:"apiKey",AWS_IAM:"iam",AMAZON_COGNITO_USER_POOLS:"userPool",OPENID_CONNECT:"oidc",NONE:"none",AWS_LAMBDA:"lambda",LAMBDA:"lambda"},aR=(e={})=>{var sr,ii,ar,br,Es,Yi;if(!Object.prototype.hasOwnProperty.call(e,"aws_project_region"))throw new bs({name:"InvalidParameterException",message:"Invalid config parameter.",recoverySuggestion:"Ensure passing the config object imported from `amplifyconfiguration.json`."});const{aws_appsync_apiKey:n,aws_appsync_authenticationType:l,aws_appsync_graphqlEndpoint:h,aws_appsync_region:m,aws_bots_config:v,aws_cognito_identity_pool_id:E,aws_cognito_sign_up_verification_method:s,aws_cognito_mfa_configuration:k,aws_cognito_mfa_types:D,aws_cognito_password_protection_settings:V,aws_cognito_verification_mechanisms:G,aws_cognito_signup_attributes:J,aws_cognito_social_providers:ve,aws_cognito_username_attributes:ae,aws_mandatory_sign_in:me,aws_mobile_analytics_app_id:Ce,aws_mobile_analytics_app_region:ie,aws_user_files_s3_bucket:te,aws_user_files_s3_bucket_region:le,aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing:ze,aws_user_pools_id:Oe,aws_user_pools_web_client_id:Ke,geo:He,oauth:ht,predictions:Ve,aws_cloud_logic_custom:jt,Notifications:wr,modelIntrospection:St}=e,Vt={};Ce&&(Vt.Analytics={Pinpoint:{appId:Ce,region:ie}});const{InAppMessaging:Vr,Push:$r}=wr??{};if(Vr!=null&&Vr.AWSPinpoint||$r!=null&&$r.AWSPinpoint){if(Vr!=null&&Vr.AWSPinpoint){const{appId:xn,region:kt}=Vr.AWSPinpoint;Vt.Notifications={InAppMessaging:{Pinpoint:{appId:xn,region:kt}}}}if($r!=null&&$r.AWSPinpoint){const{appId:xn,region:kt}=$r.AWSPinpoint;Vt.Notifications={...Vt.Notifications,PushNotification:{Pinpoint:{appId:xn,region:kt}}}}}if(Array.isArray(v)&&(Vt.Interactions={LexV1:Object.fromEntries(v.map(xn=>[xn.name,xn]))}),h){const xn=sR[l];xn||oR.debug(`Invalid authentication type ${l}. Falling back to IAM.`),Vt.API={GraphQL:{endpoint:h,apiKey:n,region:m,defaultAuthMode:xn??"iam"}},St&&(Vt.API.GraphQL.modelIntrospection=St)}const Li=k?{status:k&&k.toLowerCase(),totpEnabled:(D==null?void 0:D.includes("TOTP"))??!1,smsEnabled:(D==null?void 0:D.includes("SMS"))??!1}:void 0,Ki=V?{minLength:V.passwordPolicyMinLength,requireLowercase:((sr=V.passwordPolicyCharacters)==null?void 0:sr.includes("REQUIRES_LOWERCASE"))??!1,requireUppercase:((ii=V.passwordPolicyCharacters)==null?void 0:ii.includes("REQUIRES_UPPERCASE"))??!1,requireNumbers:((ar=V.passwordPolicyCharacters)==null?void 0:ar.includes("REQUIRES_NUMBERS"))??!1,requireSpecialCharacters:((br=V.passwordPolicyCharacters)==null?void 0:br.includes("REQUIRES_SYMBOLS"))??!1}:void 0,Tt=Array.from(new Set([...G??[],...J??[]])).reduce((xn,kt)=>({...xn,[kt.toLowerCase()]:{required:!0}}),{}),xt=(ae==null?void 0:ae.includes("EMAIL"))??!1,Bt=(ae==null?void 0:ae.includes("PHONE_NUMBER"))??!1;(E||Oe)&&(Vt.Auth={Cognito:{identityPoolId:E,allowGuestAccess:me!=="enable",signUpVerificationMethod:s,userAttributes:Tt,userPoolClientId:Ke,userPoolId:Oe,mfa:Li,passwordFormat:Ki,loginWith:{username:!(xt||Bt),email:xt,phone:Bt}}});const dn=ht?Object.keys(ht).length>0:!1,vn=ve?ve.length>0:!1;if(Vt.Auth&&dn&&(Vt.Auth.Cognito.loginWith={...Vt.Auth.Cognito.loginWith,oauth:{...lR(ht),...vn&&{providers:cR(ve)}}}),te&&(Vt.Storage={S3:{bucket:te,region:le,dangerouslyConnectToHttpEndpointForTesting:ze}}),He){const{amazon_location_service:xn}=He;Vt.Geo={LocationService:{maps:xn.maps,geofenceCollections:xn.geofenceCollections,searchIndices:xn.search_indices,region:xn.region}}}if(jt&&(Vt.API={...Vt.API,REST:jt.reduce((xn,kt)=>{const{name:Yo,endpoint:Dr,region:Jo,service:wn}=kt;return{...xn,[Yo]:{endpoint:Dr,...wn?{service:wn}:void 0,...Jo?{region:Jo}:void 0}}},{})}),Ve){const{VoiceId:xn}=((Yi=(Es=Ve==null?void 0:Ve.convert)==null?void 0:Es.speechGenerator)==null?void 0:Yi.defaults)??{};Vt.Predictions=xn?{...Ve,convert:{...Ve.convert,speechGenerator:{...Ve.convert.speechGenerator,defaults:{voiceId:xn}}}}:Ve}return Vt},kE=e=>(e==null?void 0:e.split(","))??[],lR=({domain:e,scope:n,redirectSignIn:l,redirectSignOut:h,responseType:m})=>({domain:e,scopes:n,redirectSignIn:kE(l),redirectSignOut:kE(h),responseType:m}),cR=e=>e.map(n=>{const l=n.toLowerCase();return l.charAt(0).toUpperCase()+l.slice(1)}),uR=Symbol("oauth-listener");function hR(e){const{version:n}=e;return n?n.startsWith("1"):!1}function dR(e){if(!e)return;const{bucket_name:n,aws_region:l,buckets:h}=e;return{S3:{bucket:n,region:l,buckets:h&&ER(h)}}}function pR(e){if(!e)return;const{user_pool_id:n,user_pool_client_id:l,identity_pool_id:h,password_policy:m,mfa_configuration:v,mfa_methods:E,unauthenticated_identities_enabled:s,oauth:k,username_attributes:D,standard_required_attributes:V}=e,G={Cognito:{userPoolId:n,userPoolClientId:l}};return h&&(G.Cognito={...G.Cognito,identityPoolId:h}),m&&(G.Cognito.passwordFormat={requireLowercase:m.require_lowercase,requireNumbers:m.require_numbers,requireUppercase:m.require_uppercase,requireSpecialCharacters:m.require_symbols,minLength:m.min_length??6}),v&&(G.Cognito.mfa={status:bR(v),smsEnabled:E==null?void 0:E.includes("SMS"),totpEnabled:E==null?void 0:E.includes("TOTP")}),s&&(G.Cognito.allowGuestAccess=s),k&&(G.Cognito.loginWith={oauth:{domain:k.domain,redirectSignIn:k.redirect_sign_in_uri,redirectSignOut:k.redirect_sign_out_uri,responseType:k.response_type==="token"?"token":"code",scopes:k.scopes,providers:wR(k.identity_providers)}}),D&&(G.Cognito.loginWith={...G.Cognito.loginWith,email:D.includes("email"),phone:D.includes("phone_number"),username:D.includes("username")}),V&&(G.Cognito.userAttributes=V.reduce((J,ve)=>({...J,[ve]:{required:!0}}),{})),G}function fR(e){if(!(e!=null&&e.amazon_pinpoint))return;const{amazon_pinpoint:n}=e;return{Pinpoint:{appId:n.app_id,region:n.aws_region}}}function mR(e){if(!e)return;const{aws_region:n,geofence_collections:l,maps:h,search_indices:m}=e;return{LocationService:{region:n,searchIndices:m,geofenceCollections:l,maps:h}}}function gR(e){if(!e)return;const{aws_region:n,default_authorization_type:l,url:h,api_key:m,model_introspection:v}=e;return{GraphQL:{endpoint:h,defaultAuthMode:xR(l),region:n,apiKey:m,modelIntrospection:v}}}function _R(e){if(!e)return;const{aws_region:n,channels:l,amazon_pinpoint_app_id:h}=e,m=l.includes("IN_APP_MESSAGING"),v=l.includes("APNS")||l.includes("FCM");if(!(m||v))return;const E={};return m&&(E.InAppMessaging={Pinpoint:{appId:h,region:n}}),v&&(E.PushNotification={Pinpoint:{appId:h,region:n}}),E}function yR(e){const n={};return e.storage&&(n.Storage=dR(e.storage)),e.auth&&(n.Auth=pR(e.auth)),e.analytics&&(n.Analytics=fR(e.analytics)),e.geo&&(n.Geo=mR(e.geo)),e.data&&(n.API=gR(e.data)),e.notifications&&(n.Notifications=_R(e.notifications)),n}const vR={AMAZON_COGNITO_USER_POOLS:"userPool",API_KEY:"apiKey",AWS_IAM:"iam",AWS_LAMBDA:"lambda",OPENID_CONNECT:"oidc"};function xR(e){return vR[e]}const ME={GOOGLE:"Google",LOGIN_WITH_AMAZON:"Amazon",FACEBOOK:"Facebook",SIGN_IN_WITH_APPLE:"Apple"};function wR(e=[]){return e.reduce((n,l)=>(ME[l]!==void 0&&n.push(ME[l]),n),[])}function bR(e){return e==="OPTIONAL"?"optional":e==="REQUIRED"?"on":"off"}function ER(e){const n={};return e.forEach(({name:l,bucket_name:h,aws_region:m})=>{if(l in n)throw new Error(`Duplicate friendly name found: ${l}. Name must be unique.`);n[l]={bucketName:h,region:m}}),n}const uC=e=>Object.keys(e).some(n=>n.startsWith("aws_"))?aR(e):hR(e)?yR(e):e;function PE({expiresAt:e,clockDrift:n}){return Date.now()+n>e}class TR{configure(n,l){this.authConfig=n,this.authOptions=l}async fetchAuthSession(n={}){var v,E,s,k,D,V;let l,h;const m=await this.getTokens(n);return m?(h=(E=(v=m.accessToken)==null?void 0:v.payload)==null?void 0:E.sub,l=await((k=(s=this.authOptions)==null?void 0:s.credentialsProvider)==null?void 0:k.getCredentialsAndIdentityId({authConfig:this.authConfig,tokens:m,authenticated:!0,forceRefresh:n.forceRefresh}))):l=await((V=(D=this.authOptions)==null?void 0:D.credentialsProvider)==null?void 0:V.getCredentialsAndIdentityId({authConfig:this.authConfig,authenticated:!1,forceRefresh:n.forceRefresh})),{tokens:m,credentials:l==null?void 0:l.credentials,identityId:l==null?void 0:l.identityId,userSub:h}}async clearCredentials(){var n,l;await((l=(n=this.authOptions)==null?void 0:n.credentialsProvider)==null?void 0:l.clearCredentialsAndIdentityId())}async getTokens(n){var l,h;return await((h=(l=this.authOptions)==null?void 0:l.tokenProvider)==null?void 0:h.getTokens(n))??void 0}}const SR=e=>new TextEncoder().encode(e);typeof Buffer<"u"&&Buffer.from;for(let e=0;e<256;e++){let n=e.toString(16).toLowerCase();n.length===1&&(n=`0${n}`)}var _r;(function(e){e.WebUnknown="0",e.React="1",e.NextJs="2",e.Angular="3",e.VueJs="4",e.Nuxt="5",e.Svelte="6",e.ServerSideUnknown="100",e.ReactSSR="101",e.NextJsSSR="102",e.AngularSSR="103",e.VueJsSSR="104",e.NuxtSSR="105",e.SvelteSSR="106",e.ReactNative="201",e.Expo="202"})(_r||(_r={}));var zE;(function(e){e.API="api",e.Auth="auth",e.Analytics="analytics",e.DataStore="datastore",e.Geo="geo",e.InAppMessaging="inappmessaging",e.Interactions="interactions",e.Predictions="predictions",e.PubSub="pubsub",e.PushNotification="pushnotification",e.Storage="storage"})(zE||(zE={}));var LE;(function(e){e.Record="1",e.IdentifyUser="2"})(LE||(LE={}));var RE;(function(e){e.GraphQl="1",e.Get="2",e.Post="3",e.Put="4",e.Patch="5",e.Del="6",e.Head="7"})(RE||(RE={}));var DE;(function(e){e.SignUp="1",e.ConfirmSignUp="2",e.ResendSignUpCode="3",e.SignIn="4",e.FetchMFAPreference="6",e.UpdateMFAPreference="7",e.SetUpTOTP="10",e.VerifyTOTPSetup="11",e.ConfirmSignIn="12",e.DeleteUserAttributes="15",e.DeleteUser="16",e.UpdateUserAttributes="17",e.FetchUserAttributes="18",e.ConfirmUserAttribute="22",e.SignOut="26",e.UpdatePassword="27",e.ResetPassword="28",e.ConfirmResetPassword="29",e.FederatedSignIn="30",e.RememberDevice="32",e.ForgetDevice="33",e.FetchDevices="34",e.SendUserAttributeVerificationCode="35",e.SignInWithRedirect="36"})(DE||(DE={}));var OE;(function(e){e.Subscribe="1",e.GraphQl="2"})(OE||(OE={}));var BE;(function(e){e.SearchByText="0",e.SearchByCoordinates="1",e.SearchForSuggestions="2",e.SearchByPlaceId="3",e.SaveGeofences="4",e.GetGeofence="5",e.ListGeofences="6",e.DeleteGeofences="7"})(BE||(BE={}));var FE;(function(e){e.SyncMessages="1",e.IdentifyUser="2",e.NotifyMessageInteraction="3"})(FE||(FE={}));var NE;(function(e){e.None="0"})(NE||(NE={}));var UE;(function(e){e.Convert="1",e.Identify="2",e.Interpret="3"})(UE||(UE={}));var jE;(function(e){e.Subscribe="1"})(jE||(jE={}));var VE;(function(e){e.InitializePushNotifications="1",e.IdentifyUser="2"})(VE||(VE={}));var $E;(function(e){e.UploadData="1",e.DownloadData="2",e.List="3",e.Copy="4",e.Remove="5",e.GetProperties="6",e.GetUrl="7"})($E||($E={}));const b_=()=>typeof global<"u",fh=()=>typeof window<"u",hC=()=>typeof document<"u",dx=()=>typeof process<"u",Gp=(e,n)=>!!Object.keys(e).find(l=>l.startsWith(n));function AR(){const e=h=>h.startsWith("_react")||h.startsWith("__react"),n=h=>Object.keys(h).find(e),l=()=>Array.from(document.querySelectorAll("[id]"));return hC()&&l().some(n)}function CR(){return dx()&&typeof process.env<"u"&&!!Object.keys(process.env).find(e=>e.includes("react"))}function IR(){return fh()&&Gp(window,"__VUE")}function kR(){return b_()&&Gp(global,"__VUE")}function MR(){return fh()&&Gp(window,"__SVELTE")}function PR(){return dx()&&typeof process.env<"u"&&!!Object.keys(process.env).find(e=>e.includes("svelte"))}function zR(){return fh()&&window.next&&typeof window.next=="object"}function LR(){return b_()&&(Gp(global,"__next")||Gp(global,"__NEXT"))}function RR(){return fh()&&(window.__NUXT__!==void 0||window.$nuxt!==void 0)}function DR(){return b_()&&typeof global.__NUXT_PATHS__<"u"}function OR(){const e=!!(hC()&&document.querySelector("[ng-version]")),n=!!(fh()&&typeof window.ng<"u");return e||n}function BR(){var e;return dx()&&typeof process.env=="object"&&((e={}.npm_lifecycle_script)==null?void 0:e.startsWith("ng "))||!1}function FR(){return typeof navigator<"u"&&typeof navigator.product<"u"&&navigator.product==="ReactNative"}function NR(){return b_()&&typeof global.expo<"u"}function UR(){return fh()}const jR=[{platform:_r.Expo,detectionMethod:NR},{platform:_r.ReactNative,detectionMethod:FR},{platform:_r.NextJs,detectionMethod:zR},{platform:_r.Nuxt,detectionMethod:RR},{platform:_r.Angular,detectionMethod:OR},{platform:_r.React,detectionMethod:AR},{platform:_r.VueJs,detectionMethod:IR},{platform:_r.Svelte,detectionMethod:MR},{platform:_r.WebUnknown,detectionMethod:UR},{platform:_r.NextJsSSR,detectionMethod:LR},{platform:_r.NuxtSSR,detectionMethod:DR},{platform:_r.ReactSSR,detectionMethod:CR},{platform:_r.VueJsSSR,detectionMethod:kR},{platform:_r.AngularSSR,detectionMethod:BR},{platform:_r.SvelteSSR,detectionMethod:PR}];function VR(){var e;return((e=jR.find(n=>n.detectionMethod()))==null?void 0:e.platform)||_r.ServerSideUnknown}const $R=()=>typeof window<"u"&&typeof window.document<"u";class GR{constructor(){this.oAuthListener=void 0,this.resourcesConfig={},this.libraryOptions={},this.Auth=new TR}configure(n,l){const h=uC(n);this.resourcesConfig=h,l&&(this.libraryOptions=l),this.resourcesConfig=cC(this.resourcesConfig),this.Auth.configure(this.resourcesConfig.Auth,this.libraryOptions.Auth),t1.dispatch("core",{event:"configure",data:this.resourcesConfig},"Configure",Xg),this.notifyOAuthListener()}getConfig(){return this.resourcesConfig}[uR](n){var l,h,m;(h=(l=this.resourcesConfig.Auth)==null?void 0:l.Cognito.loginWith)!=null&&h.oauth?n((m=this.resourcesConfig.Auth)==null?void 0:m.Cognito):this.oAuthListener=n}notifyOAuthListener(){var n,l,h;!((l=(n=this.resourcesConfig.Auth)==null?void 0:n.Cognito.loginWith)!=null&&l.oauth)||!this.oAuthListener||(this.oAuthListener((h=this.resourcesConfig.Auth)==null?void 0:h.Cognito),this.oAuthListener=void 0)}}const Ws=new GR,E_=e=>{const{headers:n,statusCode:l}=e;return{...qR(e)?e.$metadata:{},httpStatusCode:l,requestId:n["x-amzn-requestid"]??n["x-amzn-request-id"]??n["x-amz-request-id"],extendedRequestId:n["x-amz-id-2"],cfId:n["x-amz-cf-id"]}},qR=e=>typeof(e==null?void 0:e.$metadata)=="object",nf=async e=>{if(!e||e.statusCode<300)return;const n=await T_(e),h=(E=>{const[s]=E.toString().split(/[,:]+/);return s.includes("#")?s.split("#")[1]:s})(e.headers["x-amzn-errortype"]??n.code??n.__type??"UnknownError"),m=n.message??n.Message??"Unknown error",v=new Error(m);return Object.assign(v,{name:h,$metadata:E_(e)})},T_=async e=>{if(!e.body)throw new Error("Missing response payload");const n=await e.body.json();return Object.assign(n,{$metadata:E_(e)})},px=(e,n,l,h)=>async(m,v)=>{const E={...h,...m},s=await E.endpointResolver(E,v),k=await n(v,s),D=await e(k,{...E});return l(D)},dC={id:"aws",outputs:{dnsSuffix:"amazonaws.com"},regionRegex:"^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$",regions:["aws-global"]},WR={partitions:[dC,{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn"},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:["aws-cn-global"]}]},pC=e=>{const{partitions:n}=WR;for(const{regions:l,outputs:h,regionRegex:m}of n){const v=new RegExp(m);if(l.includes(e)||v.test(e))return h.dnsSuffix}return dC.outputs.dnsSuffix},ZR=3,HR=({maxAttempts:e=ZR,retryDecider:n,computeDelay:l,abortSignal:h})=>{if(e<1)throw new Error("maxAttempts must be greater than 0");return(m,v)=>async function(s){let k,D=v.attemptsCount??0,V;const G=()=>{if(V)return GE(V,D),V;throw GE(k,D),k};for(;!(h!=null&&h.aborted)&&DD?v.attemptsCount??0:D+1,v.attemptsCount=D,await n(V,k)){if(!(h!=null&&h.aborted)&&D{if(n!=null&&n.aborted)return Promise.resolve();let l,h;const m=new Promise(v=>{h=v,l=setTimeout(v,e)});return n==null||n.addEventListener("abort",function v(E){clearTimeout(l),n==null||n.removeEventListener("abort",v),h()}),m},GE=(e,n)=>{Object.prototype.toString.call(e)==="[object Object]"&&(e.$metadata={...e.$metadata??{},attempts:n})},KR=({userAgentHeader:e="x-amz-user-agent",userAgentValue:n=""})=>l=>async function(m){if(n.trim().length===0)return await l(m);{const v=e.toLowerCase();return m.headers[v]=m.headers[v]?`${m.headers[v]} ${n}`:n,await l(m)}},fx=(e,n)=>(l,h)=>{const m={};let v=E=>e(E,h);for(let E=n.length-1;E>=0;E--){const s=n[E];v=s(h)(v,m)}return v(l)},K0=e=>{let n;return()=>(n||(n=e()),n)},YR=e=>!["HEAD","GET","DELETE"].includes(e.toUpperCase()),JR=async({url:e,method:n,headers:l,body:h},{abortSignal:m,cache:v,withCrossDomainCredentials:E})=>{var G;let s;try{s=await fetch(e,{method:n,headers:l,body:YR(n)?h:void 0,signal:m,cache:v,credentials:E?"include":"same-origin"})}catch(J){throw J instanceof TypeError?new bs({name:Vp.NetworkError,message:"A network error has occurred.",underlyingError:J}):J}const k={};(G=s.headers)==null||G.forEach((J,ve)=>{k[ve.toLowerCase()]=J});const D={statusCode:s.status,headers:k,body:null},V=Object.assign(s.body??{},{text:K0(()=>s.text()),blob:K0(()=>s.blob()),json:K0(()=>s.json())});return{...D,body:V}},fC=fx(JR,[KR,HR]),QR=5*60*1e3;function e3(e=QR){return h=>{const m=2**h*100+100*Math.random();return m>e?!1:m}}const qE=5*60*1e3,mC=e=>{const l=e3(qE)(e);return l===!1?qE:l},t3=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch","BadRequestException"],n3=e=>!!e&&t3.includes(e),gC=e=>async(n,l)=>{const h=l??await e(n)??void 0,m=(h==null?void 0:h.code)||(h==null?void 0:h.name),v=n==null?void 0:n.statusCode;return s3(l)||o3(v,m)||n3(m)||a3(v,m)},r3=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException"],i3=["TimeoutError","RequestTimeout","RequestTimeoutException"],o3=(e,n)=>e===429||!!n&&r3.includes(n),s3=e=>(e==null?void 0:e.name)==="Network error",a3=(e,n)=>!!e&&[500,502,503,504].includes(e)||!!n&&i3.includes(n),n1=URL,l3="6.6.0";let Ep;const _g=[];let Kg=!1;const c3=10,u3=10,h3=1e3,_C=()=>{var e;if(!Ep){if(Ep=VR(),Kg)for(;_g.length;)(e=_g.pop())==null||e();else _g.forEach(n=>{n()});WE(_r.ServerSideUnknown,c3),WE(_r.WebUnknown,u3)}return Ep},d3=e=>{Kg||_g.push(e)};function p3(){Ep=void 0}function WE(e,n){Ep===e&&!Kg&&setTimeout(()=>{p3(),Kg=!0,setTimeout(_C,h3)},n)}const f3={},m3=(e,n)=>{var l,h;return(h=(l=f3[e])==null?void 0:l[n])==null?void 0:h.additionalDetails},g3="aws-amplify",_3=({category:e,action:n}={})=>{const l=[[g3,l3]];if(e&&l.push([e,n]),l.push(["framework",_C()]),e&&n){const h=m3(e,n);h&&h.forEach(m=>{l.push(m)})}return l},mx=e=>_3(e).map(([h,m])=>h&&m?`${h}/${m}`:h).join(" "),y3="cognito-identity",v3=({region:e})=>({url:new n1(`https://cognito-identity.${e}.${pC(e)}`)}),x3=()=>e=>async function(l){return l.headers["cache-control"]="no-store",e(l)},yC=fx(fC,[x3]),gx={service:y3,endpointResolver:v3,retryDecider:gC(nf),computeDelay:mC,userAgentValue:mx(),cache:"no-store"};d3(()=>{gx.userAgentValue=mx()});const vC=e=>({"content-type":"application/x-amz-json-1.1","x-amz-target":`AWSCognitoIdentityService.${e}`}),xC=({url:e},n,l)=>({headers:n,url:e,body:l,method:"POST"}),w3=(e,n)=>{const l=vC("GetId"),h=JSON.stringify(e);return xC(n,l,h)},b3=async e=>{if(e.statusCode>=300)throw await nf(e);return{IdentityId:(await T_(e)).IdentityId,$metadata:E_(e)}},E3=px(yC,w3,b3,gx),T3=(e,n)=>{const l=vC("GetCredentialsForIdentity"),h=JSON.stringify(e);return xC(n,l,h)},S3=async e=>{if(e.statusCode>=300)throw await nf(e);{const n=await T_(e);return{IdentityId:n.IdentityId,Credentials:A3(n.Credentials),$metadata:E_(e)}}},A3=({AccessKeyId:e,SecretKey:n,SessionToken:l,Expiration:h}={})=>({AccessKeyId:e,SecretKey:n,SessionToken:l,Expiration:h&&new Date(h*1e3)}),ZE=px(yC,T3,S3,gx);class Km extends bs{constructor(){super({name:Vp.PlatformNotSupported,message:"Function not supported on current platform"})}}class wC{constructor(n){this.storage=n}async setItem(n,l){if(!this.storage)throw new Km;this.storage.setItem(n,l)}async getItem(n){if(!this.storage)throw new Km;return this.storage.getItem(n)}async removeItem(n){if(!this.storage)throw new Km;this.storage.removeItem(n)}async clear(){if(!this.storage)throw new Km;this.storage.clear()}}class bC{constructor(){this.storage=new Map}get length(){return this.storage.size}key(n){return n>this.length-1?null:Array.from(this.storage.keys())[n]}setItem(n,l){this.storage.set(n,l)}getItem(n){return this.storage.get(n)??null}removeItem(n){this.storage.delete(n)}clear(){this.storage.clear()}}const C3=()=>typeof window<"u"&&window.localStorage?window.localStorage:new bC,I3=()=>typeof window<"u"&&window.sessionStorage?window.sessionStorage:new bC;class k3 extends wC{constructor(){super(C3())}}class M3 extends wC{constructor(){super(I3())}}/*! js-cookie v3.0.5 | MIT */function Ym(e){for(var n=1;n"u")){E=Ym({},n,E),typeof E.expires=="number"&&(E.expires=new Date(Date.now()+E.expires*864e5)),E.expires&&(E.expires=E.expires.toUTCString()),m=encodeURIComponent(m).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var k in E)E[k]&&(s+="; "+k,E[k]!==!0&&(s+="="+E[k].split(";")[0]));return document.cookie=m+"="+e.write(v,m)+s}}function h(m){if(!(typeof document>"u"||arguments.length&&!m)){for(var v=document.cookie?document.cookie.split("; "):[],E={},s=0;sthis.removeItem(h));await Promise.all(l)}getData(){return{path:this.path,expires:this.expires,domain:this.domain,secure:this.secure,...this.sameSite&&{sameSite:this.sameSite}}}}const qp=new k3;new M3;const z3=e=>{let n;return async(...l)=>n||(n=new Promise((h,m)=>{e(...l).then(v=>{h(v)}).catch(v=>{m(v)}).finally(()=>{n=void 0})}),n)};class er extends bs{constructor(n){super(n),this.constructor=er,Object.setPrototypeOf(this,er.prototype)}}function EC(e){if(!e||e.name==="Error"||e instanceof TypeError)throw new er({name:Vp.Unknown,message:"An unknown error has occurred.",underlyingError:e})}const TC="cognito-idp",L3=({region:e})=>{var m;const n=(m=Ws.getConfig().Auth)==null?void 0:m.Cognito,l=n==null?void 0:n.userPoolEndpoint,h=new n1(`https://${TC}.${e}.${pC(e)}`);return{url:l?new n1(l):h}},R3=()=>(e,n)=>async function(h){return h.headers["cache-control"]="no-store",e(h)},D3=fx(fC,[R3]),O3={service:TC,endpointResolver:L3,retryDecider:gC(nf),computeDelay:mC,userAgentValue:mx(),cache:"no-store"},B3=e=>({"content-type":"application/x-amz-json-1.1","x-amz-target":`AWSCognitoIdentityProviderService.${e}`}),F3=({url:e},n,l)=>({headers:n,url:e,body:l,method:"POST"}),N3=e=>(n,l)=>{const h=B3(e),m=JSON.stringify(n);return F3(l,h,m)},U3=()=>async e=>{if(e.statusCode>=300){const n=await nf(e);throw EC(n),new er({name:n.name,message:n.message})}else return await T_(e)},j3=px(D3,N3("InitiateAuth"),U3(),O3);function V3(e){const n=e==null?void 0:e.split("_")[0];if(!e||e.indexOf("_")<0||!n||typeof n!="string")throw new er({name:"InvalidUserPoolId",message:"Invalid user pool id provided."});return n}function i1(e){if(!e||!e.includes(":"))throw new er({name:"InvalidIdentityPoolIdException",message:"Invalid identity pool id provided.",recoverySuggestion:"Make sure a valid identityPoolId is given in the config."});return e.split(":")[0]}const SC="UserUnAuthenticatedException",$3="InvalidRedirectException",G3="InvalidAppSchemeException",q3="InvalidPreferredRedirectUrlException";new er({name:$3,message:"signInRedirect or signOutRedirect had an invalid format or was not found.",recoverySuggestion:"Please make sure the signIn/Out redirect in your oauth config is valid."});new er({name:G3,message:"A valid non-http app scheme was not found in the config.",recoverySuggestion:"Please make sure a valid custom app scheme is present in the config."});new er({name:q3,message:"The given preferredRedirectUrl does not match any items in the redirectSignOutUrls array from the config.",recoverySuggestion:"Please make sure a matching preferredRedirectUrl is provided."});const W3="InvalidOriginException";new er({name:W3,message:"redirect is coming from a different origin. The oauth flow needs to be initiated from the same origin",recoverySuggestion:"Please call signInWithRedirect from the same origin."});const Z3="TokenRefreshException";function H3(e){if(!e||!e.idToken)throw new er({name:SC,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."})}const X3=new er({name:Z3,message:`Token refresh is not supported when authenticated with the 'implicit grant' (token) oauth flow. + Please change your oauth configuration to use 'code grant' flow.`,recoverySuggestion:`Please logout and change your Amplify configuration to use "code grant" flow. + E.g { responseType: 'code' }`}),K3=new er({name:SC,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."});function Y3(e){if(eD(e))throw X3;if(!Q3(e))throw K3}const J3={inflightOAuth:"inflightOAuth",oauthSignIn:"oauthSignIn",oauthPKCE:"oauthPKCE",oauthState:"oauthState"};function AC(e){return(e==null?void 0:e.accessToken)||(e==null?void 0:e.idToken)}function Q3(e){return AC(e)&&(e==null?void 0:e.refreshToken)}function eD(e){return AC(e)&&!(e!=null&&e.refreshToken)}function tD({username:e,userPoolId:n,userPoolClientId:l}){if(typeof window>"u")return;const h=window.AmazonCognitoAdvancedSecurityData;if(typeof h>"u")return;const m=h.getData(e,n,l);return m?{EncodedData:m}:{}}const nD=async({tokens:e,authConfig:n,username:l})=>{var J,ve;Ti(n==null?void 0:n.Cognito);const h=V3(n.Cognito.userPoolId);Y3(e);const m=e.refreshToken,v={REFRESH_TOKEN:m};(J=e.deviceMetadata)!=null&&J.deviceKey&&(v.DEVICE_KEY=e.deviceMetadata.deviceKey);const E=tD({username:l,userPoolId:n.Cognito.userPoolId,userPoolClientId:n.Cognito.userPoolClientId}),{AuthenticationResult:s}=await j3({region:h},{ClientId:(ve=n==null?void 0:n.Cognito)==null?void 0:ve.userPoolClientId,AuthFlow:"REFRESH_TOKEN_AUTH",AuthParameters:v,UserContextData:E}),k=$p((s==null?void 0:s.AccessToken)??""),D=s!=null&&s.IdToken?$p(s.IdToken):void 0,{iat:V}=k.payload;if(!V)throw new er({name:"iatNotFoundException",message:"iat not found in access token"});const G=V*1e3-new Date().getTime();return{accessToken:k,idToken:D,clockDrift:G,refreshToken:m,username:l}},rD=z3(nD),iD={accessToken:"accessToken",idToken:"idToken",oidcProvider:"oidcProvider",clockDrift:"clockDrift",refreshToken:"refreshToken",deviceKey:"deviceKey",randomPasswordKey:"randomPasswordKey",deviceGroupKey:"deviceGroupKey",signInDetails:"signInDetails",oauthMetadata:"oauthMetadata"};var Yg;(function(e){e.InvalidAuthTokens="InvalidAuthTokens"})(Yg||(Yg={}));const oD={[Yg.InvalidAuthTokens]:{message:"Invalid tokens.",recoverySuggestion:"Make sure the tokens are valid."}},sD=aC(oD);class aD{constructor(){this.name="CognitoIdentityServiceProvider"}getKeyValueStorage(){if(!this.keyValueStorage)throw new er({name:"KeyValueStorageNotFoundException",message:"KeyValueStorage was not found in TokenStore"});return this.keyValueStorage}setKeyValueStorage(n){this.keyValueStorage=n}setAuthConfig(n){this.authConfig=n}async loadTokens(){try{const n=await this.getAuthKeys(),l=await this.getKeyValueStorage().getItem(n.accessToken);if(!l)throw new er({name:"NoSessionFoundException",message:"Auth session was not found. Make sure to call signIn."});const h=$p(l),m=await this.getKeyValueStorage().getItem(n.idToken),v=m?$p(m):void 0,E=await this.getKeyValueStorage().getItem(n.refreshToken)??void 0,s=await this.getKeyValueStorage().getItem(n.clockDrift)??"0",k=Number.parseInt(s),D=await this.getKeyValueStorage().getItem(n.signInDetails),V={accessToken:h,idToken:v,refreshToken:E,deviceMetadata:await this.getDeviceMetadata()??void 0,clockDrift:k,username:await this.getLastAuthUser()};return D&&(V.signInDetails=JSON.parse(D)),V}catch{return null}}async storeTokens(n){sD(n!==void 0,Yg.InvalidAuthTokens),await this.clearTokens();const l=n.username;await this.getKeyValueStorage().setItem(this.getLastAuthUserKey(),l);const h=await this.getAuthKeys();await this.getKeyValueStorage().setItem(h.accessToken,n.accessToken.toString()),n.idToken&&await this.getKeyValueStorage().setItem(h.idToken,n.idToken.toString()),n.refreshToken&&await this.getKeyValueStorage().setItem(h.refreshToken,n.refreshToken),n.deviceMetadata&&(n.deviceMetadata.deviceKey&&await this.getKeyValueStorage().setItem(h.deviceKey,n.deviceMetadata.deviceKey),n.deviceMetadata.deviceGroupKey&&await this.getKeyValueStorage().setItem(h.deviceGroupKey,n.deviceMetadata.deviceGroupKey),await this.getKeyValueStorage().setItem(h.randomPasswordKey,n.deviceMetadata.randomPassword)),n.signInDetails&&await this.getKeyValueStorage().setItem(h.signInDetails,JSON.stringify(n.signInDetails)),await this.getKeyValueStorage().setItem(h.clockDrift,`${n.clockDrift}`)}async clearTokens(){const n=await this.getAuthKeys();await Promise.all([this.getKeyValueStorage().removeItem(n.accessToken),this.getKeyValueStorage().removeItem(n.idToken),this.getKeyValueStorage().removeItem(n.clockDrift),this.getKeyValueStorage().removeItem(n.refreshToken),this.getKeyValueStorage().removeItem(n.signInDetails),this.getKeyValueStorage().removeItem(this.getLastAuthUserKey()),this.getKeyValueStorage().removeItem(n.oauthMetadata)])}async getDeviceMetadata(n){const l=await this.getAuthKeys(n),h=await this.getKeyValueStorage().getItem(l.deviceKey),m=await this.getKeyValueStorage().getItem(l.deviceGroupKey),v=await this.getKeyValueStorage().getItem(l.randomPasswordKey);return v&&m&&h?{deviceKey:h,deviceGroupKey:m,randomPassword:v}:null}async clearDeviceMetadata(n){const l=await this.getAuthKeys(n);await Promise.all([this.getKeyValueStorage().removeItem(l.deviceKey),this.getKeyValueStorage().removeItem(l.deviceGroupKey),this.getKeyValueStorage().removeItem(l.randomPasswordKey)])}async getAuthKeys(n){var h;Ti((h=this.authConfig)==null?void 0:h.Cognito);const l=n??await this.getLastAuthUser();return lD(this.name,`${this.authConfig.Cognito.userPoolClientId}.${l}`)}getLastAuthUserKey(){var l;Ti((l=this.authConfig)==null?void 0:l.Cognito);const n=this.authConfig.Cognito.userPoolClientId;return`${this.name}.${n}.LastAuthUser`}async getLastAuthUser(){return await this.getKeyValueStorage().getItem(this.getLastAuthUserKey())??"username"}async setOAuthMetadata(n){const{oauthMetadata:l}=await this.getAuthKeys();await this.getKeyValueStorage().setItem(l,JSON.stringify(n))}async getOAuthMetadata(){const{oauthMetadata:n}=await this.getAuthKeys(),l=await this.getKeyValueStorage().getItem(n);return l&&JSON.parse(l)}}const lD=(e,n)=>_x(iD)(`${e}`,n);function _x(e){const n=Object.values({...e});return(l,h)=>n.reduce((m,v)=>({...m,[v]:`${l}.${h}.${v}`}),{})}const XE="amplify-signin-with-hostedUI",fs="CognitoIdentityServiceProvider";class cD{constructor(n){this.keyValueStorage=n}async clearOAuthInflightData(){Ti(this.cognitoConfig);const n=ms(fs,this.cognitoConfig.userPoolClientId);await Promise.all([this.keyValueStorage.removeItem(n.inflightOAuth),this.keyValueStorage.removeItem(n.oauthPKCE),this.keyValueStorage.removeItem(n.oauthState)])}async clearOAuthData(){Ti(this.cognitoConfig);const n=ms(fs,this.cognitoConfig.userPoolClientId);return await this.clearOAuthInflightData(),await this.keyValueStorage.removeItem(XE),this.keyValueStorage.removeItem(n.oauthSignIn)}loadOAuthState(){Ti(this.cognitoConfig);const n=ms(fs,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.getItem(n.oauthState)}storeOAuthState(n){Ti(this.cognitoConfig);const l=ms(fs,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.setItem(l.oauthState,n)}loadPKCE(){Ti(this.cognitoConfig);const n=ms(fs,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.getItem(n.oauthPKCE)}storePKCE(n){Ti(this.cognitoConfig);const l=ms(fs,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.setItem(l.oauthPKCE,n)}setAuthConfig(n){this.cognitoConfig=n}async loadOAuthInFlight(){Ti(this.cognitoConfig);const n=ms(fs,this.cognitoConfig.userPoolClientId);return await this.keyValueStorage.getItem(n.inflightOAuth)==="true"}async storeOAuthInFlight(n){Ti(this.cognitoConfig);const l=ms(fs,this.cognitoConfig.userPoolClientId);await this.keyValueStorage.setItem(l.inflightOAuth,`${n}`)}async loadOAuthSignIn(){var v;Ti(this.cognitoConfig);const n=ms(fs,this.cognitoConfig.userPoolClientId),l=await this.keyValueStorage.getItem(XE),[h,m]=((v=await this.keyValueStorage.getItem(n.oauthSignIn))==null?void 0:v.split(","))??[];return{isOAuthSignIn:h==="true"||l==="true",preferPrivateSession:m==="true"}}async storeOAuthSignIn(n,l=!1){Ti(this.cognitoConfig);const h=ms(fs,this.cognitoConfig.userPoolClientId);await this.keyValueStorage.setItem(h.oauthSignIn,`${n},${l}`)}}const ms=(e,n)=>_x(J3)(e,n),KE=new cD(qp),uD=[],hD=e=>{uD.push(e)};class dD{constructor(){this.waitForInflightOAuth=$R()?async()=>{if(await KE.loadOAuthInFlight())return this.inflightPromise?this.inflightPromise:(this.inflightPromise=new Promise((n,l)=>{hD(n)}),this.inflightPromise)}:async()=>{}}setAuthConfig(n){KE.setAuthConfig(n.Cognito),this.authConfig=n}setTokenRefresher(n){this.tokenRefresher=n}setAuthTokenStore(n){this.tokenStore=n}getTokenStore(){if(!this.tokenStore)throw new er({name:"EmptyTokenStoreException",message:"TokenStore not set"});return this.tokenStore}getTokenRefresher(){if(!this.tokenRefresher)throw new er({name:"EmptyTokenRefresherException",message:"TokenRefresher not set"});return this.tokenRefresher}async getTokens(n){var E,s,k,D,V;let l;try{Ti((E=this.authConfig)==null?void 0:E.Cognito)}catch{return null}await this.waitForInflightOAuth(),this.inflightPromise=void 0,l=await this.getTokenStore().loadTokens();const h=await this.getTokenStore().getLastAuthUser();if(l===null)return null;const m=!!(l!=null&&l.idToken)&&PE({expiresAt:(((k=(s=l.idToken)==null?void 0:s.payload)==null?void 0:k.exp)??0)*1e3,clockDrift:l.clockDrift??0}),v=PE({expiresAt:(((V=(D=l.accessToken)==null?void 0:D.payload)==null?void 0:V.exp)??0)*1e3,clockDrift:l.clockDrift??0});return(n!=null&&n.forceRefresh||m||v)&&(l=await this.refreshTokens({tokens:l,username:h}),l===null)?null:{accessToken:l==null?void 0:l.accessToken,idToken:l==null?void 0:l.idToken,signInDetails:l==null?void 0:l.signInDetails}}async refreshTokens({tokens:n,username:l}){try{const{signInDetails:h}=n,m=await this.getTokenRefresher()({tokens:n,authConfig:this.authConfig,username:l});return m.signInDetails=h,await this.setTokens({tokens:m}),t1.dispatch("auth",{event:"tokenRefresh"},"Auth",Xg),m}catch(h){return this.handleErrors(h)}}handleErrors(n){if(EC(n),n.message!=="Network error"&&this.clearTokens(),t1.dispatch("auth",{event:"tokenRefresh_failure",data:{error:n}},"Auth",Xg),n.name.startsWith("NotAuthorizedException"))return null;throw n}async setTokens({tokens:n}){return this.getTokenStore().storeTokens(n)}async clearTokens(){return this.getTokenStore().clearTokens()}getDeviceMetadata(n){return this.getTokenStore().getDeviceMetadata(n)}clearDeviceMetadata(n){return this.getTokenStore().clearDeviceMetadata(n)}setOAuthMetadata(n){return this.getTokenStore().setOAuthMetadata(n)}getOAuthMetadata(){return this.getTokenStore().getOAuthMetadata()}}class pD{constructor(){this.authTokenStore=new aD,this.authTokenStore.setKeyValueStorage(qp),this.tokenOrchestrator=new dD,this.tokenOrchestrator.setAuthTokenStore(this.authTokenStore),this.tokenOrchestrator.setTokenRefresher(rD)}getTokens({forceRefresh:n}={forceRefresh:!1}){return this.tokenOrchestrator.getTokens({forceRefresh:n})}setKeyValueStorage(n){this.authTokenStore.setKeyValueStorage(n)}setAuthConfig(n){this.authTokenStore.setAuthConfig(n),this.tokenOrchestrator.setAuthConfig(n)}}const Qm=new pD,fD={identityId:"identityId"},mD=new Zo("DefaultIdentityIdStore");class gD{setAuthConfig(n){gg(n.Cognito),this.authConfig=n,this._authKeys=_D("Cognito",n.Cognito.identityPoolId)}constructor(n){this._authKeys={},this.keyValueStorage=n}async loadIdentityId(){var n;gg((n=this.authConfig)==null?void 0:n.Cognito);try{if(this._primaryIdentityId)return{id:this._primaryIdentityId,type:"primary"};{const l=await this.keyValueStorage.getItem(this._authKeys.identityId);return l?{id:l,type:"guest"}:null}}catch(l){return mD.log("Error getting stored IdentityId.",l),null}}async storeIdentityId(n){var l;gg((l=this.authConfig)==null?void 0:l.Cognito),n.type==="guest"?(this.keyValueStorage.setItem(this._authKeys.identityId,n.id),this._primaryIdentityId=void 0):(this._primaryIdentityId=n.id,this.keyValueStorage.removeItem(this._authKeys.identityId))}async clearIdentityId(){this._primaryIdentityId=void 0,await this.keyValueStorage.removeItem(this._authKeys.identityId)}}const _D=(e,n)=>_x(fD)(`com.amplify.${e}`,n);function CC(e){const n=$p(e).payload.iss,l={};if(!n)throw new er({name:"InvalidIdTokenException",message:"Invalid Idtoken."});const h=n.replace(/(^\w+:|^)\/\//,"");return l[h]=e,l}const yD=new Zo("CognitoIdentityIdProvider");async function vD({tokens:e,authConfig:n,identityIdStore:l}){l.setAuthConfig({Cognito:n});let h=await l.loadIdentityId();if(e){if(h&&h.type==="primary")return h.id;{const m=e.idToken?CC(e.idToken.toString()):{},v=await YE(m,n);h&&h.id===v&&yD.debug(`The guest identity ${h.id} has become the primary identity.`),h={id:v,type:"primary"}}}else{if(h&&h.type==="guest")return h.id;h={id:await YE({},n),type:"guest"}}return l.storeIdentityId(h),h.id}async function YE(e,n){const l=n==null?void 0:n.identityPoolId,h=i1(l),m=(await E3({region:h},{IdentityPoolId:l,Logins:e})).IdentityId;if(!m)throw new er({name:"GetIdResponseException",message:"Received undefined response from getId operation",recoverySuggestion:"Make sure to pass a valid identityPoolId in the configuration."});return m}const eg=new Zo("CognitoCredentialsProvider"),JE=50*60*1e3;class xD{constructor(n){this._nextCredentialsRefresh=0,this._identityIdStore=n}async clearCredentialsAndIdentityId(){eg.debug("Clearing out credentials and identityId"),this._credentialsAndIdentityId=void 0,await this._identityIdStore.clearIdentityId()}async clearCredentials(){eg.debug("Clearing out in-memory credentials"),this._credentialsAndIdentityId=void 0}async getCredentialsAndIdentityId(n){const l=n.authenticated,{tokens:h}=n,{authConfig:m}=n;try{gg(m==null?void 0:m.Cognito)}catch{return}if(!l&&!m.Cognito.allowGuestAccess)return;const{forceRefresh:v}=n,E=this.hasTokenChanged(h),s=await vD({tokens:h,authConfig:m.Cognito,identityIdStore:this._identityIdStore});return(v||E)&&this.clearCredentials(),l?(H3(h),this.credsForOIDCTokens(m.Cognito,h,s)):this.getGuestCredentials(s,m.Cognito)}async getGuestCredentials(n,l){if(this._credentialsAndIdentityId&&!this.isPastTTL()&&this._credentialsAndIdentityId.isAuthenticatedCreds===!1)return eg.info("returning stored credentials as they neither past TTL nor expired."),this._credentialsAndIdentityId;this.clearCredentials();const h=i1(l.identityPoolId),m=await ZE({region:h},{IdentityId:n});if(m.Credentials&&m.Credentials.AccessKeyId&&m.Credentials.SecretKey){this._nextCredentialsRefresh=new Date().getTime()+JE;const v={credentials:{accessKeyId:m.Credentials.AccessKeyId,secretAccessKey:m.Credentials.SecretKey,sessionToken:m.Credentials.SessionToken,expiration:m.Credentials.Expiration},identityId:n},E=m.IdentityId;return E&&(v.identityId=E,this._identityIdStore.storeIdentityId({id:E,type:"guest"})),this._credentialsAndIdentityId={...v,isAuthenticatedCreds:!1},v}else throw new er({name:"CredentialsNotFoundException",message:"Cognito did not respond with either Credentials, AccessKeyId or SecretKey."})}async credsForOIDCTokens(n,l,h){var s;if(this._credentialsAndIdentityId&&!this.isPastTTL()&&this._credentialsAndIdentityId.isAuthenticatedCreds===!0)return eg.debug("returning stored credentials as they neither past TTL nor expired."),this._credentialsAndIdentityId;this.clearCredentials();const m=l.idToken?CC(l.idToken.toString()):{},v=i1(n.identityPoolId),E=await ZE({region:v},{IdentityId:h,Logins:m});if(E.Credentials&&E.Credentials.AccessKeyId&&E.Credentials.SecretKey){const k={credentials:{accessKeyId:E.Credentials.AccessKeyId,secretAccessKey:E.Credentials.SecretKey,sessionToken:E.Credentials.SessionToken,expiration:E.Credentials.Expiration},identityId:h};this._credentialsAndIdentityId={...k,isAuthenticatedCreds:!0,associatedIdToken:(s=l.idToken)==null?void 0:s.toString()},this._nextCredentialsRefresh=new Date().getTime()+JE;const D=E.IdentityId;return D&&(k.identityId=D,this._identityIdStore.storeIdentityId({id:D,type:"primary"})),k}else throw new er({name:"CredentialsException",message:"Cognito did not respond with either Credentials, AccessKeyId or SecretKey."})}isPastTTL(){return this._nextCredentialsRefresh===void 0?!0:this._nextCredentialsRefresh<=Date.now()}hasTokenChanged(n){var l,h;return!!n&&!!((l=this._credentialsAndIdentityId)!=null&&l.associatedIdToken)&&((h=n.idToken)==null?void 0:h.toString())!==this._credentialsAndIdentityId.associatedIdToken}}const wD=new xD(new gD(qp)),bD={configure(e,n){const l=uC(e);if(!l.Auth){Ws.configure(l,n);return}if(n!=null&&n.Auth){Ws.configure(l,n);return}if(!Ws.libraryOptions.Auth){Qm.setAuthConfig(l.Auth),Qm.setKeyValueStorage(n!=null&&n.ssr?new HE({sameSite:"lax"}):qp),Ws.configure(l,{...n,Auth:{tokenProvider:Qm,credentialsProvider:wD}});return}if(n){n.ssr!==void 0&&Qm.setKeyValueStorage(n.ssr?new HE({sameSite:"lax"}):qp),Ws.configure(l,{Auth:Ws.libraryOptions.Auth,...n});return}Ws.configure(l)},getConfig(){return Ws.getConfig()}};/* + * Frontend UI component library for the CORI Data API + * {@link https://github.com/ruralinnovation/cori.data.api} + * @copyright Rural Innovation Strategies, Inc. + * @license ISC + */var ED={oauth:{domain:"authcori.auth.us-east-1.amazoncognito.com"}},TD="us-east-1",SD="us-east-1_QeA4600FA",AD="5eusi16g0o2q1g1rr5ehgudodm",CD="authcori.auth.us-east-1.amazoncognito.com",ID="us-east-1",kD="us-east-1:2194a76a-fa3d-4c33-999e-e3c4b2b049ee",MD=["EMAIL"],PD=["EMAIL","OPENID"],zD=["EMAIL","OPENID"],LD={passwordPolicyMinLength:8,passwordPolicyCharacters:["REQUIRES_NUMBERS","REQUIRES_LOWERCASE","REQUIRES_UPPERCASE","REQUIRES_SYMBOLS"]},RD="https://bdkxhfgus5dztobic7gvn5ymue.appsync-api.us-east-1.amazonaws.com/graphql",DD="us-east-1",OD="da2-yexc3mow25fc3amaendi4vscuq",BD="API_KEY",FD="AMAZON_COGNITO_USER_POOLS,AWS_IAM",ND={version:1,models:{Todo:{name:"Todo",fields:{id:{name:"id",isArray:!1,type:"ID",isRequired:!0,attributes:[]},content:{name:"content",isArray:!1,type:"String",isRequired:!1,attributes:[]},owner:{name:"owner",isArray:!1,type:"String",isRequired:!1,attributes:[]},createdAt:{name:"createdAt",isArray:!1,type:"AWSDateTime",isRequired:!0,attributes:[]},updatedAt:{name:"updatedAt",isArray:!1,type:"AWSDateTime",isRequired:!0,attributes:[]}},syncable:!0,pluralName:"Todos",attributes:[{type:"model",properties:{}},{type:"key",properties:{fields:["id"]}},{type:"auth",properties:{rules:[{provider:"userPools",ownerField:"owner",allow:"owner",identityClaim:"cognito:username",operations:["create","update","delete","read"]},{allow:"public",operations:["read"]}]}}],primaryKeyInfo:{isCustomPrimaryKey:!1,primaryKeyFieldName:"id",sortKeyFieldNames:[]}}},enums:{},nonModels:{}},UD={Auth:ED,aws_project_region:TD,aws_user_pools_id:SD,aws_user_pools_web_client_id:AD,aws_cognito_domain:CD,aws_cognito_region:ID,aws_cognito_identity_pool_id:kD,aws_cognito_signup_attributes:MD,aws_cognito_username_attributes:PD,aws_cognito_verification_mechanisms:zD,aws_cognito_password_protection_settings:LD,aws_appsync_graphqlEndpoint:RD,aws_appsync_region:DD,aws_appsync_apiKey:OD,aws_appsync_authenticationType:BD,aws_appsync_additionalAuthenticationTypes:FD,modelIntrospection:ND};/* + * Frontend UI component library for the CORI Data API + * {@link https://github.com/ruralinnovation/cori.data.api} + * @copyright Rural Innovation Strategies, Inc. + * @license ISC + */bD.configure(UD);const jD={domain:void 0,region:void 0,identityPoolId:void 0,userPoolId:void 0,userPoolClientId:void 0};ut.createContext(jD);function IC(e,n){return function(){return e.apply(n,arguments)}}const{toString:VD}=Object.prototype,{getPrototypeOf:yx}=Object,S_=(e=>n=>{const l=VD.call(n);return e[l]||(e[l]=l.slice(8,-1).toLowerCase())})(Object.create(null)),Ko=e=>(e=e.toLowerCase(),n=>S_(n)===e),A_=e=>n=>typeof n===e,{isArray:mh}=Array,Wp=A_("undefined");function $D(e){return e!==null&&!Wp(e)&&e.constructor!==null&&!Wp(e.constructor)&&qi(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const kC=Ko("ArrayBuffer");function GD(e){let n;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?n=ArrayBuffer.isView(e):n=e&&e.buffer&&kC(e.buffer),n}const qD=A_("string"),qi=A_("function"),MC=A_("number"),C_=e=>e!==null&&typeof e=="object",WD=e=>e===!0||e===!1,yg=e=>{if(S_(e)!=="object")return!1;const n=yx(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},ZD=Ko("Date"),HD=Ko("File"),XD=Ko("Blob"),KD=Ko("FileList"),YD=e=>C_(e)&&qi(e.pipe),JD=e=>{let n;return e&&(typeof FormData=="function"&&e instanceof FormData||qi(e.append)&&((n=S_(e))==="formdata"||n==="object"&&qi(e.toString)&&e.toString()==="[object FormData]"))},QD=Ko("URLSearchParams"),[e5,t5,n5,r5]=["ReadableStream","Request","Response","Headers"].map(Ko),i5=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function rf(e,n,{allOwnKeys:l=!1}={}){if(e===null||typeof e>"u")return;let h,m;if(typeof e!="object"&&(e=[e]),mh(e))for(h=0,m=e.length;h0;)if(m=l[h],n===m.toLowerCase())return m;return null}const dc=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),zC=e=>!Wp(e)&&e!==dc;function o1(){const{caseless:e}=zC(this)&&this||{},n={},l=(h,m)=>{const v=e&&PC(n,m)||m;yg(n[v])&&yg(h)?n[v]=o1(n[v],h):yg(h)?n[v]=o1({},h):mh(h)?n[v]=h.slice():n[v]=h};for(let h=0,m=arguments.length;h(rf(n,(m,v)=>{l&&qi(m)?e[v]=IC(m,l):e[v]=m},{allOwnKeys:h}),e),s5=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),a5=(e,n,l,h)=>{e.prototype=Object.create(n.prototype,h),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:n.prototype}),l&&Object.assign(e.prototype,l)},l5=(e,n,l,h)=>{let m,v,E;const s={};if(n=n||{},e==null)return n;do{for(m=Object.getOwnPropertyNames(e),v=m.length;v-- >0;)E=m[v],(!h||h(E,e,n))&&!s[E]&&(n[E]=e[E],s[E]=!0);e=l!==!1&&yx(e)}while(e&&(!l||l(e,n))&&e!==Object.prototype);return n},c5=(e,n,l)=>{e=String(e),(l===void 0||l>e.length)&&(l=e.length),l-=n.length;const h=e.indexOf(n,l);return h!==-1&&h===l},u5=e=>{if(!e)return null;if(mh(e))return e;let n=e.length;if(!MC(n))return null;const l=new Array(n);for(;n-- >0;)l[n]=e[n];return l},h5=(e=>n=>e&&n instanceof e)(typeof Uint8Array<"u"&&yx(Uint8Array)),d5=(e,n)=>{const h=(e&&e[Symbol.iterator]).call(e);let m;for(;(m=h.next())&&!m.done;){const v=m.value;n.call(e,v[0],v[1])}},p5=(e,n)=>{let l;const h=[];for(;(l=e.exec(n))!==null;)h.push(l);return h},f5=Ko("HTMLFormElement"),m5=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(l,h,m){return h.toUpperCase()+m}),QE=(({hasOwnProperty:e})=>(n,l)=>e.call(n,l))(Object.prototype),g5=Ko("RegExp"),LC=(e,n)=>{const l=Object.getOwnPropertyDescriptors(e),h={};rf(l,(m,v)=>{let E;(E=n(m,v,e))!==!1&&(h[v]=E||m)}),Object.defineProperties(e,h)},_5=e=>{LC(e,(n,l)=>{if(qi(e)&&["arguments","caller","callee"].indexOf(l)!==-1)return!1;const h=e[l];if(qi(h)){if(n.enumerable=!1,"writable"in n){n.writable=!1;return}n.set||(n.set=()=>{throw Error("Can not rewrite read-only method '"+l+"'")})}})},y5=(e,n)=>{const l={},h=m=>{m.forEach(v=>{l[v]=!0})};return mh(e)?h(e):h(String(e).split(n)),l},v5=()=>{},x5=(e,n)=>e!=null&&Number.isFinite(e=+e)?e:n,Y0="abcdefghijklmnopqrstuvwxyz",eT="0123456789",RC={DIGIT:eT,ALPHA:Y0,ALPHA_DIGIT:Y0+Y0.toUpperCase()+eT},w5=(e=16,n=RC.ALPHA_DIGIT)=>{let l="";const{length:h}=n;for(;e--;)l+=n[Math.random()*h|0];return l};function b5(e){return!!(e&&qi(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const E5=e=>{const n=new Array(10),l=(h,m)=>{if(C_(h)){if(n.indexOf(h)>=0)return;if(!("toJSON"in h)){n[m]=h;const v=mh(h)?[]:{};return rf(h,(E,s)=>{const k=l(E,m+1);!Wp(k)&&(v[s]=k)}),n[m]=void 0,v}}return h};return l(e,0)},T5=Ko("AsyncFunction"),S5=e=>e&&(C_(e)||qi(e))&&qi(e.then)&&qi(e.catch),DC=((e,n)=>e?setImmediate:n?((l,h)=>(dc.addEventListener("message",({source:m,data:v})=>{m===dc&&v===l&&h.length&&h.shift()()},!1),m=>{h.push(m),dc.postMessage(l,"*")}))(`axios@${Math.random()}`,[]):l=>setTimeout(l))(typeof setImmediate=="function",qi(dc.postMessage)),A5=typeof queueMicrotask<"u"?queueMicrotask.bind(dc):typeof process<"u"&&process.nextTick||DC,Ne={isArray:mh,isArrayBuffer:kC,isBuffer:$D,isFormData:JD,isArrayBufferView:GD,isString:qD,isNumber:MC,isBoolean:WD,isObject:C_,isPlainObject:yg,isReadableStream:e5,isRequest:t5,isResponse:n5,isHeaders:r5,isUndefined:Wp,isDate:ZD,isFile:HD,isBlob:XD,isRegExp:g5,isFunction:qi,isStream:YD,isURLSearchParams:QD,isTypedArray:h5,isFileList:KD,forEach:rf,merge:o1,extend:o5,trim:i5,stripBOM:s5,inherits:a5,toFlatObject:l5,kindOf:S_,kindOfTest:Ko,endsWith:c5,toArray:u5,forEachEntry:d5,matchAll:p5,isHTMLForm:f5,hasOwnProperty:QE,hasOwnProp:QE,reduceDescriptors:LC,freezeMethods:_5,toObjectSet:y5,toCamelCase:m5,noop:v5,toFiniteNumber:x5,findKey:PC,global:dc,isContextDefined:zC,ALPHABET:RC,generateString:w5,isSpecCompliantForm:b5,toJSONObject:E5,isAsyncFn:T5,isThenable:S5,setImmediate:DC,asap:A5};function qt(e,n,l,h,m){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",n&&(this.code=n),l&&(this.config=l),h&&(this.request=h),m&&(this.response=m,this.status=m.status?m.status:null)}Ne.inherits(qt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Ne.toJSONObject(this.config),code:this.code,status:this.status}}});const OC=qt.prototype,BC={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{BC[e]={value:e}});Object.defineProperties(qt,BC);Object.defineProperty(OC,"isAxiosError",{value:!0});qt.from=(e,n,l,h,m,v)=>{const E=Object.create(OC);return Ne.toFlatObject(e,E,function(k){return k!==Error.prototype},s=>s!=="isAxiosError"),qt.call(E,e.message,n,l,h,m),E.cause=e,E.name=e.name,v&&Object.assign(E,v),E};const C5=null;function s1(e){return Ne.isPlainObject(e)||Ne.isArray(e)}function FC(e){return Ne.endsWith(e,"[]")?e.slice(0,-2):e}function tT(e,n,l){return e?e.concat(n).map(function(m,v){return m=FC(m),!l&&v?"["+m+"]":m}).join(l?".":""):n}function I5(e){return Ne.isArray(e)&&!e.some(s1)}const k5=Ne.toFlatObject(Ne,{},null,function(n){return/^is[A-Z]/.test(n)});function I_(e,n,l){if(!Ne.isObject(e))throw new TypeError("target must be an object");n=n||new FormData,l=Ne.toFlatObject(l,{metaTokens:!0,dots:!1,indexes:!1},!1,function(me,Ce){return!Ne.isUndefined(Ce[me])});const h=l.metaTokens,m=l.visitor||V,v=l.dots,E=l.indexes,k=(l.Blob||typeof Blob<"u"&&Blob)&&Ne.isSpecCompliantForm(n);if(!Ne.isFunction(m))throw new TypeError("visitor must be a function");function D(ae){if(ae===null)return"";if(Ne.isDate(ae))return ae.toISOString();if(!k&&Ne.isBlob(ae))throw new qt("Blob is not supported. Use a Buffer instead.");return Ne.isArrayBuffer(ae)||Ne.isTypedArray(ae)?k&&typeof Blob=="function"?new Blob([ae]):Buffer.from(ae):ae}function V(ae,me,Ce){let ie=ae;if(ae&&!Ce&&typeof ae=="object"){if(Ne.endsWith(me,"{}"))me=h?me:me.slice(0,-2),ae=JSON.stringify(ae);else if(Ne.isArray(ae)&&I5(ae)||(Ne.isFileList(ae)||Ne.endsWith(me,"[]"))&&(ie=Ne.toArray(ae)))return me=FC(me),ie.forEach(function(le,ze){!(Ne.isUndefined(le)||le===null)&&n.append(E===!0?tT([me],ze,v):E===null?me:me+"[]",D(le))}),!1}return s1(ae)?!0:(n.append(tT(Ce,me,v),D(ae)),!1)}const G=[],J=Object.assign(k5,{defaultVisitor:V,convertValue:D,isVisitable:s1});function ve(ae,me){if(!Ne.isUndefined(ae)){if(G.indexOf(ae)!==-1)throw Error("Circular reference detected in "+me.join("."));G.push(ae),Ne.forEach(ae,function(ie,te){(!(Ne.isUndefined(ie)||ie===null)&&m.call(n,ie,Ne.isString(te)?te.trim():te,me,J))===!0&&ve(ie,me?me.concat(te):[te])}),G.pop()}}if(!Ne.isObject(e))throw new TypeError("data must be an object");return ve(e),n}function nT(e){const n={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(h){return n[h]})}function vx(e,n){this._pairs=[],e&&I_(e,this,n)}const NC=vx.prototype;NC.append=function(n,l){this._pairs.push([n,l])};NC.toString=function(n){const l=n?function(h){return n.call(this,h,nT)}:nT;return this._pairs.map(function(m){return l(m[0])+"="+l(m[1])},"").join("&")};function M5(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function UC(e,n,l){if(!n)return e;const h=l&&l.encode||M5,m=l&&l.serialize;let v;if(m?v=m(n,l):v=Ne.isURLSearchParams(n)?n.toString():new vx(n,l).toString(h),v){const E=e.indexOf("#");E!==-1&&(e=e.slice(0,E)),e+=(e.indexOf("?")===-1?"?":"&")+v}return e}class P5{constructor(){this.handlers=[]}use(n,l,h){return this.handlers.push({fulfilled:n,rejected:l,synchronous:h?h.synchronous:!1,runWhen:h?h.runWhen:null}),this.handlers.length-1}eject(n){this.handlers[n]&&(this.handlers[n]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(n){Ne.forEach(this.handlers,function(h){h!==null&&n(h)})}}const rT=P5,jC={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},z5=typeof URLSearchParams<"u"?URLSearchParams:vx,L5=typeof FormData<"u"?FormData:null,R5=typeof Blob<"u"?Blob:null,D5={isBrowser:!0,classes:{URLSearchParams:z5,FormData:L5,Blob:R5},protocols:["http","https","file","blob","url","data"]},xx=typeof window<"u"&&typeof document<"u",a1=typeof navigator=="object"&&navigator||void 0,O5=xx&&(!a1||["ReactNative","NativeScript","NS"].indexOf(a1.product)<0),B5=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),F5=xx&&window.location.href||"http://localhost",N5=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:xx,hasStandardBrowserEnv:O5,hasStandardBrowserWebWorkerEnv:B5,navigator:a1,origin:F5},Symbol.toStringTag,{value:"Module"})),Mi={...N5,...D5};function U5(e,n){return I_(e,new Mi.classes.URLSearchParams,Object.assign({visitor:function(l,h,m,v){return Mi.isNode&&Ne.isBuffer(l)?(this.append(h,l.toString("base64")),!1):v.defaultVisitor.apply(this,arguments)}},n))}function j5(e){return Ne.matchAll(/\w+|\[(\w*)]/g,e).map(n=>n[0]==="[]"?"":n[1]||n[0])}function V5(e){const n={},l=Object.keys(e);let h;const m=l.length;let v;for(h=0;h=l.length;return E=!E&&Ne.isArray(m)?m.length:E,k?(Ne.hasOwnProp(m,E)?m[E]=[m[E],h]:m[E]=h,!s):((!m[E]||!Ne.isObject(m[E]))&&(m[E]=[]),n(l,h,m[E],v)&&Ne.isArray(m[E])&&(m[E]=V5(m[E])),!s)}if(Ne.isFormData(e)&&Ne.isFunction(e.entries)){const l={};return Ne.forEachEntry(e,(h,m)=>{n(j5(h),m,l,0)}),l}return null}function $5(e,n,l){if(Ne.isString(e))try{return(n||JSON.parse)(e),Ne.trim(e)}catch(h){if(h.name!=="SyntaxError")throw h}return(l||JSON.stringify)(e)}const wx={transitional:jC,adapter:["xhr","http","fetch"],transformRequest:[function(n,l){const h=l.getContentType()||"",m=h.indexOf("application/json")>-1,v=Ne.isObject(n);if(v&&Ne.isHTMLForm(n)&&(n=new FormData(n)),Ne.isFormData(n))return m?JSON.stringify(VC(n)):n;if(Ne.isArrayBuffer(n)||Ne.isBuffer(n)||Ne.isStream(n)||Ne.isFile(n)||Ne.isBlob(n)||Ne.isReadableStream(n))return n;if(Ne.isArrayBufferView(n))return n.buffer;if(Ne.isURLSearchParams(n))return l.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),n.toString();let s;if(v){if(h.indexOf("application/x-www-form-urlencoded")>-1)return U5(n,this.formSerializer).toString();if((s=Ne.isFileList(n))||h.indexOf("multipart/form-data")>-1){const k=this.env&&this.env.FormData;return I_(s?{"files[]":n}:n,k&&new k,this.formSerializer)}}return v||m?(l.setContentType("application/json",!1),$5(n)):n}],transformResponse:[function(n){const l=this.transitional||wx.transitional,h=l&&l.forcedJSONParsing,m=this.responseType==="json";if(Ne.isResponse(n)||Ne.isReadableStream(n))return n;if(n&&Ne.isString(n)&&(h&&!this.responseType||m)){const E=!(l&&l.silentJSONParsing)&&m;try{return JSON.parse(n)}catch(s){if(E)throw s.name==="SyntaxError"?qt.from(s,qt.ERR_BAD_RESPONSE,this,null,this.response):s}}return n}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Mi.classes.FormData,Blob:Mi.classes.Blob},validateStatus:function(n){return n>=200&&n<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Ne.forEach(["delete","get","head","post","put","patch"],e=>{wx.headers[e]={}});const bx=wx,G5=Ne.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),q5=e=>{const n={};let l,h,m;return e&&e.split(` +`).forEach(function(E){m=E.indexOf(":"),l=E.substring(0,m).trim().toLowerCase(),h=E.substring(m+1).trim(),!(!l||n[l]&&G5[l])&&(l==="set-cookie"?n[l]?n[l].push(h):n[l]=[h]:n[l]=n[l]?n[l]+", "+h:h)}),n},iT=Symbol("internals");function ap(e){return e&&String(e).trim().toLowerCase()}function vg(e){return e===!1||e==null?e:Ne.isArray(e)?e.map(vg):String(e)}function W5(e){const n=Object.create(null),l=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let h;for(;h=l.exec(e);)n[h[1]]=h[2];return n}const Z5=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function J0(e,n,l,h,m){if(Ne.isFunction(h))return h.call(this,n,l);if(m&&(n=l),!!Ne.isString(n)){if(Ne.isString(h))return n.indexOf(h)!==-1;if(Ne.isRegExp(h))return h.test(n)}}function H5(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(n,l,h)=>l.toUpperCase()+h)}function X5(e,n){const l=Ne.toCamelCase(" "+n);["get","set","has"].forEach(h=>{Object.defineProperty(e,h+l,{value:function(m,v,E){return this[h].call(this,n,m,v,E)},configurable:!0})})}class k_{constructor(n){n&&this.set(n)}set(n,l,h){const m=this;function v(s,k,D){const V=ap(k);if(!V)throw new Error("header name must be a non-empty string");const G=Ne.findKey(m,V);(!G||m[G]===void 0||D===!0||D===void 0&&m[G]!==!1)&&(m[G||k]=vg(s))}const E=(s,k)=>Ne.forEach(s,(D,V)=>v(D,V,k));if(Ne.isPlainObject(n)||n instanceof this.constructor)E(n,l);else if(Ne.isString(n)&&(n=n.trim())&&!Z5(n))E(q5(n),l);else if(Ne.isHeaders(n))for(const[s,k]of n.entries())v(k,s,h);else n!=null&&v(l,n,h);return this}get(n,l){if(n=ap(n),n){const h=Ne.findKey(this,n);if(h){const m=this[h];if(!l)return m;if(l===!0)return W5(m);if(Ne.isFunction(l))return l.call(this,m,h);if(Ne.isRegExp(l))return l.exec(m);throw new TypeError("parser must be boolean|regexp|function")}}}has(n,l){if(n=ap(n),n){const h=Ne.findKey(this,n);return!!(h&&this[h]!==void 0&&(!l||J0(this,this[h],h,l)))}return!1}delete(n,l){const h=this;let m=!1;function v(E){if(E=ap(E),E){const s=Ne.findKey(h,E);s&&(!l||J0(h,h[s],s,l))&&(delete h[s],m=!0)}}return Ne.isArray(n)?n.forEach(v):v(n),m}clear(n){const l=Object.keys(this);let h=l.length,m=!1;for(;h--;){const v=l[h];(!n||J0(this,this[v],v,n,!0))&&(delete this[v],m=!0)}return m}normalize(n){const l=this,h={};return Ne.forEach(this,(m,v)=>{const E=Ne.findKey(h,v);if(E){l[E]=vg(m),delete l[v];return}const s=n?H5(v):String(v).trim();s!==v&&delete l[v],l[s]=vg(m),h[s]=!0}),this}concat(...n){return this.constructor.concat(this,...n)}toJSON(n){const l=Object.create(null);return Ne.forEach(this,(h,m)=>{h!=null&&h!==!1&&(l[m]=n&&Ne.isArray(h)?h.join(", "):h)}),l}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([n,l])=>n+": "+l).join(` +`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(n){return n instanceof this?n:new this(n)}static concat(n,...l){const h=new this(n);return l.forEach(m=>h.set(m)),h}static accessor(n){const h=(this[iT]=this[iT]={accessors:{}}).accessors,m=this.prototype;function v(E){const s=ap(E);h[s]||(X5(m,E),h[s]=!0)}return Ne.isArray(n)?n.forEach(v):v(n),this}}k_.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Ne.reduceDescriptors(k_.prototype,({value:e},n)=>{let l=n[0].toUpperCase()+n.slice(1);return{get:()=>e,set(h){this[l]=h}}});Ne.freezeMethods(k_);const Ho=k_;function Q0(e,n){const l=this||bx,h=n||l,m=Ho.from(h.headers);let v=h.data;return Ne.forEach(e,function(s){v=s.call(l,v,m.normalize(),n?n.status:void 0)}),m.normalize(),v}function $C(e){return!!(e&&e.__CANCEL__)}function gh(e,n,l){qt.call(this,e??"canceled",qt.ERR_CANCELED,n,l),this.name="CanceledError"}Ne.inherits(gh,qt,{__CANCEL__:!0});function GC(e,n,l){const h=l.config.validateStatus;!l.status||!h||h(l.status)?e(l):n(new qt("Request failed with status code "+l.status,[qt.ERR_BAD_REQUEST,qt.ERR_BAD_RESPONSE][Math.floor(l.status/100)-4],l.config,l.request,l))}function K5(e){const n=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return n&&n[1]||""}function Y5(e,n){e=e||10;const l=new Array(e),h=new Array(e);let m=0,v=0,E;return n=n!==void 0?n:1e3,function(k){const D=Date.now(),V=h[v];E||(E=D),l[m]=k,h[m]=D;let G=v,J=0;for(;G!==m;)J+=l[G++],G=G%e;if(m=(m+1)%e,m===v&&(v=(v+1)%e),D-E{l=V,m=null,v&&(clearTimeout(v),v=null),e.apply(null,D)};return[(...D)=>{const V=Date.now(),G=V-l;G>=h?E(D,V):(m=D,v||(v=setTimeout(()=>{v=null,E(m)},h-G)))},()=>m&&E(m)]}const Jg=(e,n,l=3)=>{let h=0;const m=Y5(50,250);return J5(v=>{const E=v.loaded,s=v.lengthComputable?v.total:void 0,k=E-h,D=m(k),V=E<=s;h=E;const G={loaded:E,total:s,progress:s?E/s:void 0,bytes:k,rate:D||void 0,estimated:D&&s&&V?(s-E)/D:void 0,event:v,lengthComputable:s!=null,[n?"download":"upload"]:!0};e(G)},l)},oT=(e,n)=>{const l=e!=null;return[h=>n[0]({lengthComputable:l,total:e,loaded:h}),n[1]]},sT=e=>(...n)=>Ne.asap(()=>e(...n)),Q5=Mi.hasStandardBrowserEnv?function(){const n=Mi.navigator&&/(msie|trident)/i.test(Mi.navigator.userAgent),l=document.createElement("a");let h;function m(v){let E=v;return n&&(l.setAttribute("href",E),E=l.href),l.setAttribute("href",E),{href:l.href,protocol:l.protocol?l.protocol.replace(/:$/,""):"",host:l.host,search:l.search?l.search.replace(/^\?/,""):"",hash:l.hash?l.hash.replace(/^#/,""):"",hostname:l.hostname,port:l.port,pathname:l.pathname.charAt(0)==="/"?l.pathname:"/"+l.pathname}}return h=m(window.location.href),function(E){const s=Ne.isString(E)?m(E):E;return s.protocol===h.protocol&&s.host===h.host}}():function(){return function(){return!0}}(),eO=Mi.hasStandardBrowserEnv?{write(e,n,l,h,m,v){const E=[e+"="+encodeURIComponent(n)];Ne.isNumber(l)&&E.push("expires="+new Date(l).toGMTString()),Ne.isString(h)&&E.push("path="+h),Ne.isString(m)&&E.push("domain="+m),v===!0&&E.push("secure"),document.cookie=E.join("; ")},read(e){const n=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function tO(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function nO(e,n){return n?e.replace(/\/?\/$/,"")+"/"+n.replace(/^\/+/,""):e}function qC(e,n){return e&&!tO(n)?nO(e,n):n}const aT=e=>e instanceof Ho?{...e}:e;function xc(e,n){n=n||{};const l={};function h(D,V,G){return Ne.isPlainObject(D)&&Ne.isPlainObject(V)?Ne.merge.call({caseless:G},D,V):Ne.isPlainObject(V)?Ne.merge({},V):Ne.isArray(V)?V.slice():V}function m(D,V,G){if(Ne.isUndefined(V)){if(!Ne.isUndefined(D))return h(void 0,D,G)}else return h(D,V,G)}function v(D,V){if(!Ne.isUndefined(V))return h(void 0,V)}function E(D,V){if(Ne.isUndefined(V)){if(!Ne.isUndefined(D))return h(void 0,D)}else return h(void 0,V)}function s(D,V,G){if(G in n)return h(D,V);if(G in e)return h(void 0,D)}const k={url:v,method:v,data:v,baseURL:E,transformRequest:E,transformResponse:E,paramsSerializer:E,timeout:E,timeoutMessage:E,withCredentials:E,withXSRFToken:E,adapter:E,responseType:E,xsrfCookieName:E,xsrfHeaderName:E,onUploadProgress:E,onDownloadProgress:E,decompress:E,maxContentLength:E,maxBodyLength:E,beforeRedirect:E,transport:E,httpAgent:E,httpsAgent:E,cancelToken:E,socketPath:E,responseEncoding:E,validateStatus:s,headers:(D,V)=>m(aT(D),aT(V),!0)};return Ne.forEach(Object.keys(Object.assign({},e,n)),function(V){const G=k[V]||m,J=G(e[V],n[V],V);Ne.isUndefined(J)&&G!==s||(l[V]=J)}),l}const WC=e=>{const n=xc({},e);let{data:l,withXSRFToken:h,xsrfHeaderName:m,xsrfCookieName:v,headers:E,auth:s}=n;n.headers=E=Ho.from(E),n.url=UC(qC(n.baseURL,n.url),e.params,e.paramsSerializer),s&&E.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):"")));let k;if(Ne.isFormData(l)){if(Mi.hasStandardBrowserEnv||Mi.hasStandardBrowserWebWorkerEnv)E.setContentType(void 0);else if((k=E.getContentType())!==!1){const[D,...V]=k?k.split(";").map(G=>G.trim()).filter(Boolean):[];E.setContentType([D||"multipart/form-data",...V].join("; "))}}if(Mi.hasStandardBrowserEnv&&(h&&Ne.isFunction(h)&&(h=h(n)),h||h!==!1&&Q5(n.url))){const D=m&&v&&eO.read(v);D&&E.set(m,D)}return n},rO=typeof XMLHttpRequest<"u",iO=rO&&function(e){return new Promise(function(l,h){const m=WC(e);let v=m.data;const E=Ho.from(m.headers).normalize();let{responseType:s,onUploadProgress:k,onDownloadProgress:D}=m,V,G,J,ve,ae;function me(){ve&&ve(),ae&&ae(),m.cancelToken&&m.cancelToken.unsubscribe(V),m.signal&&m.signal.removeEventListener("abort",V)}let Ce=new XMLHttpRequest;Ce.open(m.method.toUpperCase(),m.url,!0),Ce.timeout=m.timeout;function ie(){if(!Ce)return;const le=Ho.from("getAllResponseHeaders"in Ce&&Ce.getAllResponseHeaders()),Oe={data:!s||s==="text"||s==="json"?Ce.responseText:Ce.response,status:Ce.status,statusText:Ce.statusText,headers:le,config:e,request:Ce};GC(function(He){l(He),me()},function(He){h(He),me()},Oe),Ce=null}"onloadend"in Ce?Ce.onloadend=ie:Ce.onreadystatechange=function(){!Ce||Ce.readyState!==4||Ce.status===0&&!(Ce.responseURL&&Ce.responseURL.indexOf("file:")===0)||setTimeout(ie)},Ce.onabort=function(){Ce&&(h(new qt("Request aborted",qt.ECONNABORTED,e,Ce)),Ce=null)},Ce.onerror=function(){h(new qt("Network Error",qt.ERR_NETWORK,e,Ce)),Ce=null},Ce.ontimeout=function(){let ze=m.timeout?"timeout of "+m.timeout+"ms exceeded":"timeout exceeded";const Oe=m.transitional||jC;m.timeoutErrorMessage&&(ze=m.timeoutErrorMessage),h(new qt(ze,Oe.clarifyTimeoutError?qt.ETIMEDOUT:qt.ECONNABORTED,e,Ce)),Ce=null},v===void 0&&E.setContentType(null),"setRequestHeader"in Ce&&Ne.forEach(E.toJSON(),function(ze,Oe){Ce.setRequestHeader(Oe,ze)}),Ne.isUndefined(m.withCredentials)||(Ce.withCredentials=!!m.withCredentials),s&&s!=="json"&&(Ce.responseType=m.responseType),D&&([J,ae]=Jg(D,!0),Ce.addEventListener("progress",J)),k&&Ce.upload&&([G,ve]=Jg(k),Ce.upload.addEventListener("progress",G),Ce.upload.addEventListener("loadend",ve)),(m.cancelToken||m.signal)&&(V=le=>{Ce&&(h(!le||le.type?new gh(null,e,Ce):le),Ce.abort(),Ce=null)},m.cancelToken&&m.cancelToken.subscribe(V),m.signal&&(m.signal.aborted?V():m.signal.addEventListener("abort",V)));const te=K5(m.url);if(te&&Mi.protocols.indexOf(te)===-1){h(new qt("Unsupported protocol "+te+":",qt.ERR_BAD_REQUEST,e));return}Ce.send(v||null)})},oO=(e,n)=>{const{length:l}=e=e?e.filter(Boolean):[];if(n||l){let h=new AbortController,m;const v=function(D){if(!m){m=!0,s();const V=D instanceof Error?D:this.reason;h.abort(V instanceof qt?V:new gh(V instanceof Error?V.message:V))}};let E=n&&setTimeout(()=>{E=null,v(new qt(`timeout ${n} of ms exceeded`,qt.ETIMEDOUT))},n);const s=()=>{e&&(E&&clearTimeout(E),E=null,e.forEach(D=>{D.unsubscribe?D.unsubscribe(v):D.removeEventListener("abort",v)}),e=null)};e.forEach(D=>D.addEventListener("abort",v));const{signal:k}=h;return k.unsubscribe=()=>Ne.asap(s),k}},sO=oO,aO=function*(e,n){let l=e.byteLength;if(!n||l{const m=lO(e,n);let v=0,E,s=k=>{E||(E=!0,h&&h(k))};return new ReadableStream({async pull(k){try{const{done:D,value:V}=await m.next();if(D){s(),k.close();return}let G=V.byteLength;if(l){let J=v+=G;l(J)}k.enqueue(new Uint8Array(V))}catch(D){throw s(D),D}},cancel(k){return s(k),m.return()}},{highWaterMark:2})},M_=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",ZC=M_&&typeof ReadableStream=="function",uO=M_&&(typeof TextEncoder=="function"?(e=>n=>e.encode(n))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),HC=(e,...n)=>{try{return!!e(...n)}catch{return!1}},hO=ZC&&HC(()=>{let e=!1;const n=new Request(Mi.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!n}),cT=64*1024,l1=ZC&&HC(()=>Ne.isReadableStream(new Response("").body)),Qg={stream:l1&&(e=>e.body)};M_&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(n=>{!Qg[n]&&(Qg[n]=Ne.isFunction(e[n])?l=>l[n]():(l,h)=>{throw new qt(`Response type '${n}' is not supported`,qt.ERR_NOT_SUPPORT,h)})})})(new Response);const dO=async e=>{if(e==null)return 0;if(Ne.isBlob(e))return e.size;if(Ne.isSpecCompliantForm(e))return(await new Request(Mi.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(Ne.isArrayBufferView(e)||Ne.isArrayBuffer(e))return e.byteLength;if(Ne.isURLSearchParams(e)&&(e=e+""),Ne.isString(e))return(await uO(e)).byteLength},pO=async(e,n)=>{const l=Ne.toFiniteNumber(e.getContentLength());return l??dO(n)},fO=M_&&(async e=>{let{url:n,method:l,data:h,signal:m,cancelToken:v,timeout:E,onDownloadProgress:s,onUploadProgress:k,responseType:D,headers:V,withCredentials:G="same-origin",fetchOptions:J}=WC(e);D=D?(D+"").toLowerCase():"text";let ve=sO([m,v&&v.toAbortSignal()],E),ae;const me=ve&&ve.unsubscribe&&(()=>{ve.unsubscribe()});let Ce;try{if(k&&hO&&l!=="get"&&l!=="head"&&(Ce=await pO(V,h))!==0){let Oe=new Request(n,{method:"POST",body:h,duplex:"half"}),Ke;if(Ne.isFormData(h)&&(Ke=Oe.headers.get("content-type"))&&V.setContentType(Ke),Oe.body){const[He,ht]=oT(Ce,Jg(sT(k)));h=lT(Oe.body,cT,He,ht)}}Ne.isString(G)||(G=G?"include":"omit");const ie="credentials"in Request.prototype;ae=new Request(n,{...J,signal:ve,method:l.toUpperCase(),headers:V.normalize().toJSON(),body:h,duplex:"half",credentials:ie?G:void 0});let te=await fetch(ae);const le=l1&&(D==="stream"||D==="response");if(l1&&(s||le&&me)){const Oe={};["status","statusText","headers"].forEach(Ve=>{Oe[Ve]=te[Ve]});const Ke=Ne.toFiniteNumber(te.headers.get("content-length")),[He,ht]=s&&oT(Ke,Jg(sT(s),!0))||[];te=new Response(lT(te.body,cT,He,()=>{ht&&ht(),me&&me()}),Oe)}D=D||"text";let ze=await Qg[Ne.findKey(Qg,D)||"text"](te,e);return!le&&me&&me(),await new Promise((Oe,Ke)=>{GC(Oe,Ke,{data:ze,headers:Ho.from(te.headers),status:te.status,statusText:te.statusText,config:e,request:ae})})}catch(ie){throw me&&me(),ie&&ie.name==="TypeError"&&/fetch/i.test(ie.message)?Object.assign(new qt("Network Error",qt.ERR_NETWORK,e,ae),{cause:ie.cause||ie}):qt.from(ie,ie&&ie.code,e,ae)}}),c1={http:C5,xhr:iO,fetch:fO};Ne.forEach(c1,(e,n)=>{if(e){try{Object.defineProperty(e,"name",{value:n})}catch{}Object.defineProperty(e,"adapterName",{value:n})}});const uT=e=>`- ${e}`,mO=e=>Ne.isFunction(e)||e===null||e===!1,XC={getAdapter:e=>{e=Ne.isArray(e)?e:[e];const{length:n}=e;let l,h;const m={};for(let v=0;v`adapter ${s} `+(k===!1?"is not supported by the environment":"is not available in the build"));let E=n?v.length>1?`since : +`+v.map(uT).join(` +`):" "+uT(v[0]):"as no adapter specified";throw new qt("There is no suitable adapter to dispatch the request "+E,"ERR_NOT_SUPPORT")}return h},adapters:c1};function ev(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new gh(null,e)}function hT(e){return ev(e),e.headers=Ho.from(e.headers),e.data=Q0.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),XC.getAdapter(e.adapter||bx.adapter)(e).then(function(h){return ev(e),h.data=Q0.call(e,e.transformResponse,h),h.headers=Ho.from(h.headers),h},function(h){return $C(h)||(ev(e),h&&h.response&&(h.response.data=Q0.call(e,e.transformResponse,h.response),h.response.headers=Ho.from(h.response.headers))),Promise.reject(h)})}const KC="1.7.7",Ex={};["object","boolean","number","function","string","symbol"].forEach((e,n)=>{Ex[e]=function(h){return typeof h===e||"a"+(n<1?"n ":" ")+e}});const dT={};Ex.transitional=function(n,l,h){function m(v,E){return"[Axios v"+KC+"] Transitional option '"+v+"'"+E+(h?". "+h:"")}return(v,E,s)=>{if(n===!1)throw new qt(m(E," has been removed"+(l?" in "+l:"")),qt.ERR_DEPRECATED);return l&&!dT[E]&&(dT[E]=!0,console.warn(m(E," has been deprecated since v"+l+" and will be removed in the near future"))),n?n(v,E,s):!0}};function gO(e,n,l){if(typeof e!="object")throw new qt("options must be an object",qt.ERR_BAD_OPTION_VALUE);const h=Object.keys(e);let m=h.length;for(;m-- >0;){const v=h[m],E=n[v];if(E){const s=e[v],k=s===void 0||E(s,v,e);if(k!==!0)throw new qt("option "+v+" must be "+k,qt.ERR_BAD_OPTION_VALUE);continue}if(l!==!0)throw new qt("Unknown option "+v,qt.ERR_BAD_OPTION)}}const u1={assertOptions:gO,validators:Ex},Va=u1.validators;class e_{constructor(n){this.defaults=n,this.interceptors={request:new rT,response:new rT}}async request(n,l){try{return await this._request(n,l)}catch(h){if(h instanceof Error){let m;Error.captureStackTrace?Error.captureStackTrace(m={}):m=new Error;const v=m.stack?m.stack.replace(/^.+\n/,""):"";try{h.stack?v&&!String(h.stack).endsWith(v.replace(/^.+\n.+\n/,""))&&(h.stack+=` +`+v):h.stack=v}catch{}}throw h}}_request(n,l){typeof n=="string"?(l=l||{},l.url=n):l=n||{},l=xc(this.defaults,l);const{transitional:h,paramsSerializer:m,headers:v}=l;h!==void 0&&u1.assertOptions(h,{silentJSONParsing:Va.transitional(Va.boolean),forcedJSONParsing:Va.transitional(Va.boolean),clarifyTimeoutError:Va.transitional(Va.boolean)},!1),m!=null&&(Ne.isFunction(m)?l.paramsSerializer={serialize:m}:u1.assertOptions(m,{encode:Va.function,serialize:Va.function},!0)),l.method=(l.method||this.defaults.method||"get").toLowerCase();let E=v&&Ne.merge(v.common,v[l.method]);v&&Ne.forEach(["delete","get","head","post","put","patch","common"],ae=>{delete v[ae]}),l.headers=Ho.concat(E,v);const s=[];let k=!0;this.interceptors.request.forEach(function(me){typeof me.runWhen=="function"&&me.runWhen(l)===!1||(k=k&&me.synchronous,s.unshift(me.fulfilled,me.rejected))});const D=[];this.interceptors.response.forEach(function(me){D.push(me.fulfilled,me.rejected)});let V,G=0,J;if(!k){const ae=[hT.bind(this),void 0];for(ae.unshift.apply(ae,s),ae.push.apply(ae,D),J=ae.length,V=Promise.resolve(l);G{if(!h._listeners)return;let v=h._listeners.length;for(;v-- >0;)h._listeners[v](m);h._listeners=null}),this.promise.then=m=>{let v;const E=new Promise(s=>{h.subscribe(s),v=s}).then(m);return E.cancel=function(){h.unsubscribe(v)},E},n(function(v,E,s){h.reason||(h.reason=new gh(v,E,s),l(h.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(n){if(this.reason){n(this.reason);return}this._listeners?this._listeners.push(n):this._listeners=[n]}unsubscribe(n){if(!this._listeners)return;const l=this._listeners.indexOf(n);l!==-1&&this._listeners.splice(l,1)}toAbortSignal(){const n=new AbortController,l=h=>{n.abort(h)};return this.subscribe(l),n.signal.unsubscribe=()=>this.unsubscribe(l),n.signal}static source(){let n;return{token:new Tx(function(m){n=m}),cancel:n}}}const _O=Tx;function yO(e){return function(l){return e.apply(null,l)}}function vO(e){return Ne.isObject(e)&&e.isAxiosError===!0}const h1={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(h1).forEach(([e,n])=>{h1[n]=e});const xO=h1;function YC(e){const n=new xg(e),l=IC(xg.prototype.request,n);return Ne.extend(l,xg.prototype,n,{allOwnKeys:!0}),Ne.extend(l,n,null,{allOwnKeys:!0}),l.create=function(m){return YC(xc(e,m))},l}const xr=YC(bx);xr.Axios=xg;xr.CanceledError=gh;xr.CancelToken=_O;xr.isCancel=$C;xr.VERSION=KC;xr.toFormData=I_;xr.AxiosError=qt;xr.Cancel=xr.CanceledError;xr.all=function(n){return Promise.all(n)};xr.spread=yO;xr.isAxiosError=vO;xr.mergeConfig=xc;xr.AxiosHeaders=Ho;xr.formToJSON=e=>VC(Ne.isHTMLForm(e)?new FormData(e):e);xr.getAdapter=XC.getAdapter;xr.HttpStatusCode=xO;xr.default=xr;const wO=xr;/* + * Frontend UI component library for the CORI Data API + * {@link https://github.com/ruralinnovation/cori.data.api} + * @copyright Rural Innovation Strategies, Inc. + * @license ISC + */const Gu="https://cori-data-api.ruralinnovation.us/",d1=wO.create({baseURL:Gu,headers:{"Content-Type":"application/json"}}),tv={},JC={apiClient:d1,authenticated:!1,authenticated_user:null,autoSignOut:null,baseURL:Gu,token:null,data:{get:()=>tv,set:e=>{for(const n in e)e.hasOwnProperty[n]&&(tv[n]=e)}},setData:e=>{for(const n in e)e.hasOwnProperty[n]&&(tv[n]=e)}},QC=ut.createContext(JC);let tg=!1,pT=!1;function bO(e){const[n,l]=ut.useState(Object.assign(Object.assign({},JC),{baseURL:e.baseURL?e.baseURL:Gu,setData:h}));function h(m){const v=n;l(Object.assign(Object.assign({},v),{data:Object.assign(Object.assign({},v.data),m),setData:h}))}return e.baseURL&&e.baseURL.length>0&&d1.interceptors.request.use(m=>(m.baseURL=e.baseURL,console.log("API baseURL updated:",m.baseURL),m),m=>Promise.reject(m)),ut.useEffect(()=>{if(l(Object.assign(Object.assign({},n),{autoSignOut:e.signOut&&typeof e.signOut=="function"?()=>{const{signOut:m}=e;m(),window.alert("Please refresh this session by clicking the browser's reload button!"),window.location=window.location.protocol+"//"+window.location.host+window.location.pathname}:null,baseURL:e.baseURL?e.baseURL:Gu})),e.fetchAuthSession){const{fetchAuthSession:m}=e;m().then(E=>{if(!tg){const s=E.tokens;if(console.log("API tokens:",s),s&&s.hasOwnProperty("idToken")&&(tg=!0,console.log("API Session is authenticated:",tg),console.log("API Session config:",E),console.log("idToken:",s.idToken),d1.interceptors.request.use(k=>{const D=s.idToken;return D&&(k.headers.Authorization=`Bearer ${D}`),e.baseURL&&(k.baseURL=e.baseURL),k},k=>Promise.reject(k)),l(Object.assign(Object.assign({},n),{authenticated:!0,autoSignOut:e.signOut&&typeof e.signOut=="function"?()=>{const{signOut:k}=e;k(),window.alert("Please refresh this session by clicking the browser's reload button!"),window.location=window.location.protocol+"//"+window.location.host+window.location.pathname}:null,baseURL:e.baseURL||Gu,token:s.idToken})),e.getCurrentUser)){const{getCurrentUser:k}=e;k().then(V=>{pT||(pT=!0,console.log("API User is authenticated:",tg),console.log("API User:",V),console.log("API User type:",V.constructor.name),l(Object.assign(Object.assign({},n),{authenticated:!0,authenticated_user:V,autoSignOut:e.signOut&&typeof e.signOut=="function"?()=>{const{signOut:G}=e;G(),window.alert("Please refresh this session by clicking the browser's reload button!"),window.location=window.location.protocol+"//"+window.location.host+window.location.pathname}:null,baseURL:e.baseURL||Gu,token:s.idToken})))})}}})}},[]),T0.createElement(T0.Fragment,null,T0.createElement(QC.Provider,{value:n},e.children))}const EO="modulepreload",TO=function(e){return"/"+e},fT={},SO=function(n,l,h){if(!l||l.length===0)return n();const m=document.getElementsByTagName("link");return Promise.all(l.map(v=>{if(v=TO(v),v in fT)return;fT[v]=!0;const E=v.endsWith(".css"),s=E?'[rel="stylesheet"]':"";if(!!h)for(let V=m.length-1;V>=0;V--){const G=m[V];if(G.href===v&&(!E||G.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${v}"]${s}`))return;const D=document.createElement("link");if(D.rel=E?"stylesheet":EO,E||(D.as="script",D.crossOrigin=""),D.href=v,document.head.appendChild(D),E)return new Promise((V,G)=>{D.addEventListener("load",V),D.addEventListener("error",()=>G(new Error(`Unable to preload CSS for ${v}`)))})})).then(()=>n()).catch(v=>{const E=new Event("vite:preloadError",{cancelable:!0});if(E.payload=v,window.dispatchEvent(E),!E.defaultPrevented)throw v})},AO=ut.createContext(null);function CO(e,n){const l=Array.isArray(e)?e[0]:e?e.x:0,h=Array.isArray(e)?e[1]:e?e.y:0,m=Array.isArray(n)?n[0]:n?n.x:0,v=Array.isArray(n)?n[1]:n?n.y:0;return l===m&&h===v}function Ks(e,n){if(e===n)return!0;if(!e||!n)return!1;if(Array.isArray(e)){if(!Array.isArray(n)||e.length!==n.length)return!1;for(let l=0;l{let m=null;"interactive"in h&&(m=Object.assign({},h),delete m.interactive);const v=n[h.ref];if(v){m=m||Object.assign({},h),delete m.ref;for(const E of kO)E in v&&(m[E]=v[E])}return m||h});return{...e,layers:l}}const vT={version:8,sources:{},layers:[]},xT={mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",click:"onClick",dblclick:"onDblClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mouseout:"onMouseOut",contextmenu:"onContextMenu",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",touchcancel:"onTouchCancel"},nv={movestart:"onMoveStart",move:"onMove",moveend:"onMoveEnd",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",zoomstart:"onZoomStart",zoom:"onZoom",zoomend:"onZoomEnd",rotatestart:"onRotateStart",rotate:"onRotate",rotateend:"onRotateEnd",pitchstart:"onPitchStart",pitch:"onPitch",pitchend:"onPitchEnd"},wT={wheel:"onWheel",boxzoomstart:"onBoxZoomStart",boxzoomend:"onBoxZoomEnd",boxzoomcancel:"onBoxZoomCancel",resize:"onResize",load:"onLoad",render:"onRender",idle:"onIdle",remove:"onRemove",data:"onData",styledata:"onStyleData",sourcedata:"onSourceData",error:"onError"},MO=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],PO=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class lh{constructor(n,l,h){this._map=null,this._internalUpdate=!1,this._inRender=!1,this._hoveredFeatures=null,this._deferredEvents={move:!1,zoom:!1,pitch:!1,rotate:!1},this._onEvent=m=>{const v=this.props[wT[m.type]];v?v(m):m.type==="error"&&console.error(m.error)},this._onPointerEvent=m=>{(m.type==="mousemove"||m.type==="mouseout")&&this._updateHover(m);const v=this.props[xT[m.type]];v&&(this.props.interactiveLayerIds&&m.type!=="mouseover"&&m.type!=="mouseout"&&(m.features=this._hoveredFeatures||this._queryRenderedFeatures(m.point)),v(m),delete m.features)},this._onCameraEvent=m=>{if(!this._internalUpdate){const v=this.props[nv[m.type]];v&&v(m)}m.type in this._deferredEvents&&(this._deferredEvents[m.type]=!1)},this._MapClass=n,this.props=l,this._initialize(h)}get map(){return this._map}get transform(){return this._renderTransform}setProps(n){const l=this.props;this.props=n;const h=this._updateSettings(n,l);h&&this._createShadowTransform(this._map);const m=this._updateSize(n),v=this._updateViewState(n,!0);this._updateStyle(n,l),this._updateStyleComponents(n,l),this._updateHandlers(n,l),(h||m||v&&!this._map.isMoving())&&this.redraw()}static reuse(n,l){const h=lh.savedMaps.pop();if(!h)return null;const m=h.map,v=m.getContainer();for(l.className=v.className;v.childNodes.length>0;)l.appendChild(v.childNodes[0]);m._container=l;const E=m._resizeObserver;E&&(E.disconnect(),E.observe(l)),h.setProps({...n,styleDiffing:!1}),m.resize();const{initialViewState:s}=n;return s&&(s.bounds?m.fitBounds(s.bounds,{...s.fitBoundsOptions,duration:0}):h._updateViewState(s,!1)),m.isStyleLoaded()?m.fire("load"):m.once("styledata",()=>m.fire("load")),m._update(),h}_initialize(n){const{props:l}=this,{mapStyle:h=vT}=l,m={...l,...l.initialViewState,accessToken:l.mapboxAccessToken||zO()||null,container:n,style:yT(h)},v=m.initialViewState||m.viewState||m;if(Object.assign(m,{center:[v.longitude||0,v.latitude||0],zoom:v.zoom||0,pitch:v.pitch||0,bearing:v.bearing||0}),l.gl){const V=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=V,l.gl)}const E=new this._MapClass(m);v.padding&&E.setPadding(v.padding),l.cursor&&(E.getCanvas().style.cursor=l.cursor),this._createShadowTransform(E);const s=E._render;E._render=V=>{this._inRender=!0,s.call(E,V),this._inRender=!1};const k=E._renderTaskQueue.run;E._renderTaskQueue.run=V=>{k.call(E._renderTaskQueue,V),this._onBeforeRepaint()},E.on("render",()=>this._onAfterRepaint());const D=E.fire;E.fire=this._fireEvent.bind(this,D),E.on("resize",()=>{this._renderTransform.resize(E.transform.width,E.transform.height)}),E.on("styledata",()=>{this._updateStyleComponents(this.props,{}),mT(E.transform,this._renderTransform)}),E.on("sourcedata",()=>this._updateStyleComponents(this.props,{}));for(const V in xT)E.on(V,this._onPointerEvent);for(const V in nv)E.on(V,this._onCameraEvent);for(const V in wT)E.on(V,this._onEvent);this._map=E}recycle(){const l=this.map.getContainer().querySelector("[mapboxgl-children]");l==null||l.remove(),lh.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const n=this._map;!this._inRender&&n.style&&(n._frame&&(n._frame.cancel(),n._frame=null),n._render())}_createShadowTransform(n){const l=IO(n.transform);n.painter.transform=l,this._renderTransform=l}_updateSize(n){const{viewState:l}=n;if(l){const h=this._map;if(l.width!==h.transform.width||l.height!==h.transform.height)return h.resize(),!0}return!1}_updateViewState(n,l){if(this._internalUpdate)return!1;const h=this._map,m=this._renderTransform,{zoom:v,pitch:E,bearing:s}=m,k=h.isMoving();k&&(m.cameraElevationReference="sea");const D=_T(m,{...gT(h.transform),...n});if(k&&(m.cameraElevationReference="ground"),D&&l){const V=this._deferredEvents;V.move=!0,V.zoom||(V.zoom=v!==m.zoom),V.rotate||(V.rotate=s!==m.bearing),V.pitch||(V.pitch=E!==m.pitch)}return k||_T(h.transform,n),D}_updateSettings(n,l){const h=this._map;let m=!1;for(const v of MO)if(v in n&&!Ks(n[v],l[v])){m=!0;const E=h[`set${v[0].toUpperCase()}${v.slice(1)}`];E==null||E.call(h,n[v])}return m}_updateStyle(n,l){if(n.cursor!==l.cursor&&(this._map.getCanvas().style.cursor=n.cursor||""),n.mapStyle!==l.mapStyle){const{mapStyle:h=vT,styleDiffing:m=!0}=n,v={diff:m};return"localIdeographFontFamily"in n&&(v.localIdeographFontFamily=n.localIdeographFontFamily),this._map.setStyle(yT(h),v),!0}return!1}_updateStyleComponents(n,l){const h=this._map;let m=!1;return h.isStyleLoaded()&&("light"in n&&h.setLight&&!Ks(n.light,l.light)&&(m=!0,h.setLight(n.light)),"fog"in n&&h.setFog&&!Ks(n.fog,l.fog)&&(m=!0,h.setFog(n.fog)),"terrain"in n&&h.setTerrain&&!Ks(n.terrain,l.terrain)&&(!n.terrain||h.getSource(n.terrain.source))&&(m=!0,h.setTerrain(n.terrain))),m}_updateHandlers(n,l){var h,m;const v=this._map;let E=!1;for(const s of PO){const k=(h=n[s])!==null&&h!==void 0?h:!0,D=(m=l[s])!==null&&m!==void 0?m:!0;Ks(k,D)||(E=!0,k?v[s].enable(k):v[s].disable())}return E}_queryRenderedFeatures(n){const l=this._map,h=l.transform,{interactiveLayerIds:m=[]}=this.props;try{return l.transform=this._renderTransform,l.queryRenderedFeatures(n,{layers:m.filter(l.getLayer.bind(l))})}catch{return[]}finally{l.transform=h}}_updateHover(n){var l;const{props:h}=this;if(h.interactiveLayerIds&&(h.onMouseMove||h.onMouseEnter||h.onMouseLeave)){const v=n.type,E=((l=this._hoveredFeatures)===null||l===void 0?void 0:l.length)>0,s=this._queryRenderedFeatures(n.point),k=s.length>0;!k&&E&&(n.type="mouseleave",this._onPointerEvent(n)),this._hoveredFeatures=s,k&&!E&&(n.type="mouseenter",this._onPointerEvent(n)),n.type=v}else this._hoveredFeatures=null}_fireEvent(n,l,h){const m=this._map,v=m.transform,E=typeof l=="string"?l:l.type;return E==="move"&&this._updateViewState(this.props,!1),E in nv&&(typeof l=="object"&&(l.viewState=gT(v)),this._map.isMoving())?(m.transform=this._renderTransform,n.call(m,l,h),m.transform=v,m):(n.call(m,l,h),m)}_onBeforeRepaint(){const n=this._map;this._internalUpdate=!0;for(const h in this._deferredEvents)this._deferredEvents[h]&&n.fire(h);this._internalUpdate=!1;const l=this._map.transform;n.transform=this._renderTransform,this._onAfterRepaint=()=>{mT(this._renderTransform,l),n.transform=l}}}lh.savedMaps=[];function zO(){let e=null;if(typeof location<"u"){const n=/access_token=([^&\/]*)/.exec(location.search);e=n&&n[1]}try{e=e||void 0}catch{}try{e=e||{}.REACT_APP_MAPBOX_ACCESS_TOKEN}catch{}return e}const LO=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function RO(e){if(!e)return null;const n=e.map,l={getMap:()=>n,getCenter:()=>e.transform.center,getZoom:()=>e.transform.zoom,getBearing:()=>e.transform.bearing,getPitch:()=>e.transform.pitch,getPadding:()=>e.transform.padding,getBounds:()=>e.transform.getBounds(),project:h=>{const m=n.transform;n.transform=e.transform;const v=n.project(h);return n.transform=m,v},unproject:h=>{const m=n.transform;n.transform=e.transform;const v=n.unproject(h);return n.transform=m,v},queryTerrainElevation:(h,m)=>{const v=n.transform;n.transform=e.transform;const E=n.queryTerrainElevation(h,m);return n.transform=v,E},queryRenderedFeatures:(h,m)=>{const v=n.transform;n.transform=e.transform;const E=n.queryRenderedFeatures(h,m);return n.transform=v,E}};for(const h of DO(n))!(h in l)&&!LO.includes(h)&&(l[h]=n[h].bind(n));return l}function DO(e){const n=new Set;let l=e;for(;l;){for(const h of Object.getOwnPropertyNames(l))h[0]!=="_"&&typeof e[h]=="function"&&h!=="fire"&&h!=="setEventedParent"&&n.add(h);l=Object.getPrototypeOf(l)}return Array.from(n)}const OO=typeof document<"u"?ut.useLayoutEffect:ut.useEffect,BO=["baseApiUrl","maxParallelImageRequests","workerClass","workerCount","workerUrl"];function FO(e,n){for(const h of BO)h in n&&(e[h]=n[h]);const{RTLTextPlugin:l="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js"}=n;l&&e.getRTLTextPluginStatus&&e.getRTLTextPluginStatus()==="unavailable"&&e.setRTLTextPlugin(l,h=>{h&&console.error(h)},!0)}const P_=ut.createContext(null);function NO(e,n,l){const h=ut.useContext(AO),[m,v]=ut.useState(null),E=ut.useRef(),{current:s}=ut.useRef({mapLib:null,map:null});ut.useEffect(()=>{const V=e.mapLib;let G=!0,J;return Promise.resolve(V||l).then(ve=>{if(!G)return;if(!ve)throw new Error("Invalid mapLib");const ae="Map"in ve?ve:ve.default;if(!ae.Map)throw new Error("Invalid mapLib");if(FO(ae,e),!ae.supported||ae.supported(e))e.reuseMaps&&(J=lh.reuse(e,E.current)),J||(J=new lh(ae.Map,e,E.current)),s.map=RO(J),s.mapLib=ae,v(J),h==null||h.onMapMount(s.map,e.id);else throw new Error("Map is not supported by this browser")}).catch(ve=>{const{onError:ae}=e;ae?ae({type:"error",target:null,originalEvent:null,error:ve}):console.error(ve)}),()=>{G=!1,J&&(h==null||h.onMapUnmount(e.id),e.reuseMaps?J.recycle():J.destroy())}},[]),OO(()=>{m&&m.setProps(e)}),ut.useImperativeHandle(n,()=>s.map,[m]);const k=ut.useMemo(()=>({position:"relative",width:"100%",height:"100%",...e.style}),[e.style]),D={height:"100%"};return ut.createElement("div",{id:e.id,ref:E,style:k},m&&ut.createElement(P_.Provider,{value:s},ut.createElement("div",{"mapboxgl-children":"",style:D},e.children)))}const UO=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function Ec(e,n){if(!e||!n)return;const l=e.style;for(const h in n){const m=n[h];Number.isFinite(m)&&!UO.test(h)?l[h]=`${m}px`:l[h]=m}}function jO(e,n){const{map:l,mapLib:h}=ut.useContext(P_),m=ut.useRef({props:e});m.current.props=e;const v=ut.useMemo(()=>{let me=!1;ut.Children.forEach(e.children,te=>{te&&(me=!0)});const Ce={...e,element:me?document.createElement("div"):null},ie=new h.Marker(Ce);return ie.setLngLat([e.longitude,e.latitude]),ie.getElement().addEventListener("click",te=>{var le,ze;(ze=(le=m.current.props).onClick)===null||ze===void 0||ze.call(le,{type:"click",target:ie,originalEvent:te})}),ie.on("dragstart",te=>{var le,ze;const Oe=te;Oe.lngLat=v.getLngLat(),(ze=(le=m.current.props).onDragStart)===null||ze===void 0||ze.call(le,Oe)}),ie.on("drag",te=>{var le,ze;const Oe=te;Oe.lngLat=v.getLngLat(),(ze=(le=m.current.props).onDrag)===null||ze===void 0||ze.call(le,Oe)}),ie.on("dragend",te=>{var le,ze;const Oe=te;Oe.lngLat=v.getLngLat(),(ze=(le=m.current.props).onDragEnd)===null||ze===void 0||ze.call(le,Oe)}),ie},[]);ut.useEffect(()=>(v.addTo(l.getMap()),()=>{v.remove()}),[]);const{longitude:E,latitude:s,offset:k,style:D,draggable:V=!1,popup:G=null,rotation:J=0,rotationAlignment:ve="auto",pitchAlignment:ae="auto"}=e;return ut.useEffect(()=>{Ec(v.getElement(),D)},[D]),ut.useImperativeHandle(n,()=>v,[]),(v.getLngLat().lng!==E||v.getLngLat().lat!==s)&&v.setLngLat([E,s]),k&&!CO(v.getOffset(),k)&&v.setOffset(k),v.isDraggable()!==V&&v.setDraggable(V),v.getRotation()!==J&&v.setRotation(J),v.getRotationAlignment()!==ve&&v.setRotationAlignment(ve),v.getPitchAlignment()!==ae&&v.setPitchAlignment(ae),v.getPopup()!==G&&v.setPopup(G),hx.createPortal(e.children,v.getElement())}const VO=ut.memo(ut.forwardRef(jO));function bT(e){return new Set(e?e.trim().split(/\s+/):[])}function $O(e,n){const{map:l,mapLib:h}=ut.useContext(P_),m=ut.useMemo(()=>document.createElement("div"),[]),v=ut.useRef({props:e});v.current.props=e;const E=ut.useMemo(()=>{const s={...e},k=new h.Popup(s);return k.setLngLat([e.longitude,e.latitude]),k.once("open",D=>{var V,G;(G=(V=v.current.props).onOpen)===null||G===void 0||G.call(V,D)}),k},[]);if(ut.useEffect(()=>{const s=k=>{var D,V;(V=(D=v.current.props).onClose)===null||V===void 0||V.call(D,k)};return E.on("close",s),E.setDOMContent(m).addTo(l.getMap()),()=>{E.off("close",s),E.isOpen()&&E.remove()}},[]),ut.useEffect(()=>{Ec(E.getElement(),e.style)},[e.style]),ut.useImperativeHandle(n,()=>E,[]),E.isOpen()&&((E.getLngLat().lng!==e.longitude||E.getLngLat().lat!==e.latitude)&&E.setLngLat([e.longitude,e.latitude]),e.offset&&!Ks(E.options.offset,e.offset)&&E.setOffset(e.offset),(E.options.anchor!==e.anchor||E.options.maxWidth!==e.maxWidth)&&(E.options.anchor=e.anchor,E.setMaxWidth(e.maxWidth)),E.options.className!==e.className)){const s=bT(E.options.className),k=bT(e.className);for(const D of s)k.has(D)||E.removeClassName(D);for(const D of k)s.has(D)||E.addClassName(D);E.options.className=e.className}return hx.createPortal(e.children,m)}ut.memo(ut.forwardRef($O));function _h(e,n,l,h){const m=ut.useContext(P_),v=ut.useMemo(()=>e(m),[]);return ut.useEffect(()=>{const E=h||l||n,s=typeof n=="function"&&typeof l=="function"?n:null,k=typeof l=="function"?l:typeof n=="function"?n:null,{map:D}=m;return D.hasControl(v)||(D.addControl(v,E==null?void 0:E.position),s&&s(m)),()=>{k&&k(m),D.hasControl(v)&&D.removeControl(v)}},[]),v}function GO(e){const n=_h(({mapLib:l})=>new l.AttributionControl(e),{position:e.position});return ut.useEffect(()=>{Ec(n._container,e.style)},[e.style]),null}ut.memo(GO);function qO(e){const n=_h(({mapLib:l})=>new l.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return ut.useEffect(()=>{Ec(n._controlContainer,e.style)},[e.style]),null}ut.memo(qO);function WO(e,n){const l=ut.useRef({props:e}),h=_h(({mapLib:m})=>{const v=new m.GeolocateControl(e),E=v._setupUI;return v._setupUI=s=>{v._container.hasChildNodes()||E(s)},v.on("geolocate",s=>{var k,D;(D=(k=l.current.props).onGeolocate)===null||D===void 0||D.call(k,s)}),v.on("error",s=>{var k,D;(D=(k=l.current.props).onError)===null||D===void 0||D.call(k,s)}),v.on("outofmaxbounds",s=>{var k,D;(D=(k=l.current.props).onOutOfMaxBounds)===null||D===void 0||D.call(k,s)}),v.on("trackuserlocationstart",s=>{var k,D;(D=(k=l.current.props).onTrackUserLocationStart)===null||D===void 0||D.call(k,s)}),v.on("trackuserlocationend",s=>{var k,D;(D=(k=l.current.props).onTrackUserLocationEnd)===null||D===void 0||D.call(k,s)}),v},{position:e.position});return l.current.props=e,ut.useImperativeHandle(n,()=>h,[]),ut.useEffect(()=>{Ec(h._container,e.style)},[e.style]),null}const ZO=ut.memo(ut.forwardRef(WO));function HO(e){const n=_h(({mapLib:l})=>new l.NavigationControl(e),{position:e.position});return ut.useEffect(()=>{Ec(n._container,e.style)},[e.style]),null}const XO=ut.memo(HO);function KO(e){const n=_h(({mapLib:v})=>new v.ScaleControl(e),{position:e.position}),l=ut.useRef(e),h=l.current;l.current=e;const{style:m}=e;return e.maxWidth!==void 0&&e.maxWidth!==h.maxWidth&&(n.options.maxWidth=e.maxWidth),e.unit!==void 0&&e.unit!==h.unit&&n.setUnit(e.unit),ut.useEffect(()=>{Ec(n._container,m)},[m]),null}const YO=ut.memo(KO),JO=SO(()=>Promise.resolve().then(()=>SU),void 0),QO=(()=>ut.forwardRef(function(n,l){return NO(n,l,JO)}))(),eI=VO,e4=XO,t4=ZO,n4=YO;var yh=i4,r4=Object.prototype.hasOwnProperty;function i4(){for(var e={},n=0;n-1};ri.prototype.value=function(e){if(this.selected=e,this.el.value=this.getItemValue(e),document.createEvent){var n=document.createEvent("HTMLEvents");n.initEvent("change",!0,!1),this.el.dispatchEvent(n)}else this.el.fireEvent("onchange")};ri.prototype.getCandidates=function(e){var n={pre:"",post:"",extract:(function(h){return this.getItemValue(h)}).bind(this)},l;this.options.filter?(l=l4.filter(this.query,this.data,n),l=l.map((function(h){return{original:h.original,string:this.render(h.original,h.string)}}).bind(this))):l=this.data.map((function(h){var m=this.render(h);return{original:h,string:m}}).bind(this)),e(l)};ri.prototype.getItemValue=function(e){return e};ri.prototype.render=function(e,n){if(n)return n;for(var l=e.original?this.getItemValue(e.original):this.getItemValue(e),h=this.normalize(l),m=h.lastIndexOf(this.query);m>-1;){var v=m+this.query.length;l=l.slice(0,m)+""+l.slice(m,v)+""+l.slice(v),m=h.slice(0,m).lastIndexOf(this.query)}return l};ri.prototype.renderError=function(e){this.list.drawError(e)};var u4=ri,nI=u4,h4=nI;typeof window<"u"&&(window.Suggestions=nI);var d4="Expected a function",ET=0/0,p4="[object Symbol]",f4=/^\s+|\s+$/g,m4=/^[-+]0x[0-9a-f]+$/i,g4=/^0b[01]+$/i,_4=/^0o[0-7]+$/i,y4=parseInt,v4=typeof Go=="object"&&Go&&Go.Object===Object&&Go,x4=typeof self=="object"&&self&&self.Object===Object&&self,w4=v4||x4||Function("return this")(),b4=Object.prototype,E4=b4.toString,T4=Math.max,S4=Math.min,rv=function(){return w4.Date.now()};function A4(e,n,l){var h,m,v,E,s,k,D=0,V=!1,G=!1,J=!0;if(typeof e!="function")throw new TypeError(d4);n=TT(n)||0,p1(l)&&(V=!!l.leading,G="maxWait"in l,v=G?T4(TT(l.maxWait)||0,n):v,J="trailing"in l?!!l.trailing:J);function ve(Ke){var He=h,ht=m;return h=m=void 0,D=Ke,E=e.apply(ht,He),E}function ae(Ke){return D=Ke,s=setTimeout(ie,n),V?ve(Ke):E}function me(Ke){var He=Ke-k,ht=Ke-D,Ve=n-He;return G?S4(Ve,v-ht):Ve}function Ce(Ke){var He=Ke-k,ht=Ke-D;return k===void 0||He>=n||He<0||G&&ht>=v}function ie(){var Ke=rv();if(Ce(Ke))return te(Ke);s=setTimeout(ie,me(Ke))}function te(Ke){return s=void 0,J&&h?ve(Ke):(h=m=void 0,E)}function le(){s!==void 0&&clearTimeout(s),D=0,h=k=m=s=void 0}function ze(){return s===void 0?E:te(rv())}function Oe(){var Ke=rv(),He=Ce(Ke);if(h=arguments,m=this,k=Ke,He){if(s===void 0)return ae(k);if(G)return s=setTimeout(ie,n),ve(k)}return s===void 0&&(s=setTimeout(ie,n)),E}return Oe.cancel=le,Oe.flush=ze,Oe}function p1(e){var n=typeof e;return!!e&&(n=="object"||n=="function")}function C4(e){return!!e&&typeof e=="object"}function I4(e){return typeof e=="symbol"||C4(e)&&E4.call(e)==p4}function TT(e){if(typeof e=="number")return e;if(I4(e))return ET;if(p1(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=p1(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=e.replace(f4,"");var l=g4.test(e);return l||_4.test(e)?y4(e.slice(2),l?2:8):m4.test(e)?ET:+e}var k4=A4,Sx={exports:{}},Yu=typeof Reflect=="object"?Reflect:null,ST=Yu&&typeof Yu.apply=="function"?Yu.apply:function(n,l,h){return Function.prototype.apply.call(n,l,h)},wg;Yu&&typeof Yu.ownKeys=="function"?wg=Yu.ownKeys:Object.getOwnPropertySymbols?wg=function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:wg=function(n){return Object.getOwnPropertyNames(n)};function M4(e){console&&console.warn&&console.warn(e)}var rI=Number.isNaN||function(n){return n!==n};function Cn(){Cn.init.call(this)}Sx.exports=Cn;Sx.exports.once=R4;Cn.EventEmitter=Cn;Cn.prototype._events=void 0;Cn.prototype._eventsCount=0;Cn.prototype._maxListeners=void 0;var AT=10;function z_(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(Cn,"defaultMaxListeners",{enumerable:!0,get:function(){return AT},set:function(e){if(typeof e!="number"||e<0||rI(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");AT=e}});Cn.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};Cn.prototype.setMaxListeners=function(n){if(typeof n!="number"||n<0||rI(n))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+n+".");return this._maxListeners=n,this};function iI(e){return e._maxListeners===void 0?Cn.defaultMaxListeners:e._maxListeners}Cn.prototype.getMaxListeners=function(){return iI(this)};Cn.prototype.emit=function(n){for(var l=[],h=1;h0&&(E=l[0]),E instanceof Error)throw E;var s=new Error("Unhandled error."+(E?" ("+E.message+")":""));throw s.context=E,s}var k=v[n];if(k===void 0)return!1;if(typeof k=="function")ST(k,this,l);else for(var D=k.length,V=cI(k,D),h=0;h0&&E.length>m&&!E.warned){E.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+E.length+" "+String(n)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=n,s.count=E.length,M4(s)}return e}Cn.prototype.addListener=function(n,l){return oI(this,n,l,!1)};Cn.prototype.on=Cn.prototype.addListener;Cn.prototype.prependListener=function(n,l){return oI(this,n,l,!0)};function P4(){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 sI(e,n,l){var h={fired:!1,wrapFn:void 0,target:e,type:n,listener:l},m=P4.bind(h);return m.listener=l,h.wrapFn=m,m}Cn.prototype.once=function(n,l){return z_(l),this.on(n,sI(this,n,l)),this};Cn.prototype.prependOnceListener=function(n,l){return z_(l),this.prependListener(n,sI(this,n,l)),this};Cn.prototype.removeListener=function(n,l){var h,m,v,E,s;if(z_(l),m=this._events,m===void 0)return this;if(h=m[n],h===void 0)return this;if(h===l||h.listener===l)--this._eventsCount===0?this._events=Object.create(null):(delete m[n],m.removeListener&&this.emit("removeListener",n,h.listener||l));else if(typeof h!="function"){for(v=-1,E=h.length-1;E>=0;E--)if(h[E]===l||h[E].listener===l){s=h[E].listener,v=E;break}if(v<0)return this;v===0?h.shift():z4(h,v),h.length===1&&(m[n]=h[0]),m.removeListener!==void 0&&this.emit("removeListener",n,s||l)}return this};Cn.prototype.off=Cn.prototype.removeListener;Cn.prototype.removeAllListeners=function(n){var l,h,m;if(h=this._events,h===void 0)return this;if(h.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):h[n]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete h[n]),this;if(arguments.length===0){var v=Object.keys(h),E;for(m=0;m=0;m--)this.removeListener(n,l[m]);return this};function aI(e,n,l){var h=e._events;if(h===void 0)return[];var m=h[n];return m===void 0?[]:typeof m=="function"?l?[m.listener||m]:[m]:l?L4(m):cI(m,m.length)}Cn.prototype.listeners=function(n){return aI(this,n,!0)};Cn.prototype.rawListeners=function(n){return aI(this,n,!1)};Cn.listenerCount=function(e,n){return typeof e.listenerCount=="function"?e.listenerCount(n):lI.call(e,n)};Cn.prototype.listenerCount=lI;function lI(e){var n=this._events;if(n!==void 0){var l=n[e];if(typeof l=="function")return 1;if(l!==void 0)return l.length}return 0}Cn.prototype.eventNames=function(){return this._eventsCount>0?wg(this._events):[]};function cI(e,n){for(var l=new Array(n),h=0;h]*)>(.*)/);if(!n)return null;var l=n[1],h=n[2].split(";"),m=null,v=h.reduce(function(E,s){var k=F4(s);return k?k.key==="rel"?(m||(m=k.value),E):(E[k.key]=k.value,E):E},{});return m?{url:l,rel:m,params:v}:null}function U4(e){return e?e.split(/,\s*=400){var E=new IT({request:e,body:n.response,statusCode:n.status});h(E);return}l(n)};var v=e.body;typeof v=="string"?n.send(v):v?n.send(JSON.stringify(v)):m?n.send(m):n.send(),t_[e.id]=n}).then(function(l){return J4(e,l)})}function dI(e,n){var l=e.url(n),h=new window.XMLHttpRequest;return h.open(e.method,l),Object.keys(e.headers).forEach(function(m){h.setRequestHeader(m,e.headers[m])}),h}function Q4(e){return Promise.resolve().then(function(){var n=dI(e,e.client.accessToken);return hI(e,n)})}var eB={browserAbort:Y4,sendRequestXhr:hI,browserSend:Q4,createRequestXhr:dI},n_={exports:{}};/*! http://mths.be/base64 v0.1.0 by @mathias | MIT license */n_.exports;(function(e,n){(function(l){var h=n,m=e&&e.exports==h&&e,v=typeof Go=="object"&&Go;(v.global===v||v.window===v)&&(l=v);var E=function(ae){this.message=ae};E.prototype=new Error,E.prototype.name="InvalidCharacterError";var s=function(ae){throw new E(ae)},k="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",D=/[\t\n\f\r ]/g,V=function(ae){ae=String(ae).replace(D,"");var me=ae.length;me%4==0&&(ae=ae.replace(/==?$/,""),me=ae.length),(me%4==1||/[^+a-zA-Z0-9/]/.test(ae))&&s("Invalid character: the string to be decoded is not correctly encoded.");for(var Ce=0,ie,te,le="",ze=-1;++ze>(-2*Ce&6)));return le},G=function(ae){ae=String(ae),/[^\0-\xFF]/.test(ae)&&s("The string to be encoded contains characters outside of the Latin1 range.");for(var me=ae.length%3,Ce="",ie=-1,te,le,ze,Oe,Ke=ae.length-me;++ie>18&63)+k.charAt(Oe>>12&63)+k.charAt(Oe>>6&63)+k.charAt(Oe&63);return me==2?(te=ae.charCodeAt(ie)<<8,le=ae.charCodeAt(++ie),Oe=te+le,Ce+=k.charAt(Oe>>10)+k.charAt(Oe>>4&63)+k.charAt(Oe<<2&63)+"="):me==1&&(Oe=ae.charCodeAt(ie),Ce+=k.charAt(Oe>>2)+k.charAt(Oe<<4&63)+"=="),Ce},J={encode:G,decode:V,version:"0.1.0"};if(h&&!h.nodeType)if(m)m.exports=J;else for(var ve in J)J.hasOwnProperty(ve)&&(h[ve]=J[ve]);else l.base64=J})(Go)})(n_,n_.exports);var tB=n_.exports,nB=tB,ov={};function rB(e){if(ov[e])return ov[e];var n=e.split("."),l=n[0],h=n[1];if(!h)throw new Error("Invalid token");var m=iB(h),v={usage:l,user:m.u};return oc(m,"a")&&(v.authorization=m.a),oc(m,"exp")&&(v.expires=m.exp*1e3),oc(m,"iat")&&(v.created=m.iat*1e3),oc(m,"scopes")&&(v.scopes=m.scopes),oc(m,"client")&&(v.client=m.client),oc(m,"ll")&&(v.lastLogin=m.ll),oc(m,"iu")&&(v.impersonator=m.iu),ov[e]=v,v}function iB(e){try{return JSON.parse(nB.decode(e))}catch{throw new Error("Invalid token")}}function oc(e,n){return Object.prototype.hasOwnProperty.call(e,n)}var pI=rB,fI={exports:{}};(function(e){var n=Object.prototype.hasOwnProperty,l="~";function h(){}Object.create&&(h.prototype=Object.create(null),new h().__proto__||(l=!1));function m(k,D,V){this.fn=k,this.context=D,this.once=V||!1}function v(k,D,V,G,J){if(typeof V!="function")throw new TypeError("The listener must be a function");var ve=new m(V,G||k,J),ae=l?l+D:D;return k._events[ae]?k._events[ae].fn?k._events[ae]=[k._events[ae],ve]:k._events[ae].push(ve):(k._events[ae]=ve,k._eventsCount++),k}function E(k,D){--k._eventsCount===0?k._events=new h:delete k._events[D]}function s(){this._events=new h,this._eventsCount=0}s.prototype.eventNames=function(){var D=[],V,G;if(this._eventsCount===0)return D;for(G in V=this._events)n.call(V,G)&&D.push(l?G.slice(1):G);return Object.getOwnPropertySymbols?D.concat(Object.getOwnPropertySymbols(V)):D},s.prototype.listeners=function(D){var V=l?l+D:D,G=this._events[V];if(!G)return[];if(G.fn)return[G.fn];for(var J=0,ve=G.length,ae=new Array(ve);Jv.length?E:v})}};zn.equal=function(n){return function(h){if(h!==n)return JSON.stringify(n)}};zn.oneOf=function(){var n=Array.isArray(arguments[0])?arguments[0]:Array.prototype.slice.call(arguments),l=n.map(function(h){return zn.equal(h)});return zn.oneOfType.apply(this,l)};zn.range=function(n){var l=n[0],h=n[1];return function(v){var E=cl(zn.number,v);if(E||vh)return"number between "+l+" & "+h+" (inclusive)"}};zn.any=function(){};zn.boolean=function(n){if(typeof n!="boolean")return"boolean"};zn.number=function(n){if(typeof n!="number")return"number"};zn.plainArray=function(n){if(!Array.isArray(n))return"array"};zn.plainObject=function(n){if(!EB(n))return"object"};zn.string=function(n){if(typeof n!="string")return"string"};zn.func=function(n){if(typeof n!="function")return"function"};function cl(e,n){if(!(n==null&&!e.hasOwnProperty("__required"))){var l=e(n);if(l)return Array.isArray(l)?l:[l]}}function Ix(e,n){var l=e.length,h=e[l-1],m=e.slice(0,l-1);return m.length===0&&(m=[bI]),n=TB(n,{path:m}),typeof h=="function"?h(n):TI(n,AB(h))}function SB(e){return e.length<2?e[0]:e.length===2?e.join(" or "):e.slice(0,-1).join(", ")+", or "+e.slice(-1)}function AB(e){return"must be "+CB(e)+"."}function CB(e){return/^an? /.test(e)?e:/^[aeiou]/i.test(e)?"an "+e:/^[a-z]/i.test(e)?"a "+e:e}function TI(e,n){var l=SI(e.path),h=e.path.join(".")+" "+n,m=l?"Item at position ":"";return m+h}function SI(e){return typeof e[e.length-1]=="number"||typeof e[0]=="number"}function IB(e){return Object.keys(e||{}).map(function(n){return{key:n,value:e[n]}})}zn.validate=cl;zn.processMessage=Ix;var kB=zn,MB=yh,Ju=kB;function PB(e){if(typeof window<"u")return e instanceof Go.Blob||e instanceof Go.ArrayBuffer?void 0:"Blob or ArrayBuffer";if(!(typeof e=="string"||e.pipe!==void 0))return"Filename or Readable stream"}function zB(e,n){return Ju.assert(Ju.strictShape(e),n)}function LB(e){var n="date";if(typeof e=="boolean")return n;try{var l=new Date(e);if(l.getTime&&isNaN(l.getTime()))return n}catch{return n}}function RB(e){return Ju.tuple(Ju.number,Ju.number)(e)}var DB=MB(Ju,{file:PB,date:LB,coordinates:RB,assertShape:zB});function OB(e,n){var l=function(h,m){return n.indexOf(h)!==-1&&m!==void 0};return typeof n=="function"&&(l=n),Object.keys(e).filter(function(h){return l(h,e[h])}).reduce(function(h,m){return h[m]=e[m],h},{})}var BB=OB;function FB(e,n){return Object.keys(e).reduce(function(l,h){return l[h]=n(h,e[h]),l},{})}var NB=FB,UB=NB;function jB(e){return UB(e,function(n,l){return typeof l=="boolean"?JSON.stringify(l):l})}var VB=jB,$B=yI,GB=wI;function qB(e){return function(n){var l;$B.prototype.isPrototypeOf(n)?l=n:l=GB(n);var h=Object.create(e);return h.client=l,h}}var WB=qB,AI=yh,tn=DB,r_=BB,CI=VB,ZB=WB,kx={},II=["country","region","postcode","district","place","locality","neighborhood","address","poi","poi.landmark"];kx.forwardGeocode=function(e){tn.assertShape({query:tn.required(tn.string),mode:tn.oneOf("mapbox.places","mapbox.places-permanent"),countries:tn.arrayOf(tn.string),proximity:tn.oneOf(tn.coordinates,"ip"),types:tn.arrayOf(tn.oneOf(II)),autocomplete:tn.boolean,bbox:tn.arrayOf(tn.number),limit:tn.number,language:tn.arrayOf(tn.string),routing:tn.boolean,fuzzyMatch:tn.boolean,worldview:tn.string})(e),e.mode=e.mode||"mapbox.places";var n=CI(AI({country:e.countries},r_(e,["proximity","types","autocomplete","bbox","limit","language","routing","fuzzyMatch","worldview"])));return this.client.createRequest({method:"GET",path:"/geocoding/v5/:mode/:query.json",params:r_(e,["mode","query"]),query:n})};kx.reverseGeocode=function(e){tn.assertShape({query:tn.required(tn.coordinates),mode:tn.oneOf("mapbox.places","mapbox.places-permanent"),countries:tn.arrayOf(tn.string),types:tn.arrayOf(tn.oneOf(II)),bbox:tn.arrayOf(tn.number),limit:tn.number,language:tn.arrayOf(tn.string),reverseMode:tn.oneOf("distance","score"),routing:tn.boolean,worldview:tn.string})(e),e.mode=e.mode||"mapbox.places";var n=CI(AI({country:e.countries},r_(e,["country","types","bbox","limit","language","reverseMode","routing","worldview"])));return this.client.createRequest({method:"GET",path:"/geocoding/v5/:mode/:query.json",params:r_(e,["mode","query"]),query:n})};var HB=ZB(kx),XB=self.crypto||self.msCrypto,Mx="-_",ol=36;for(;ol--;)Mx+=ol.toString(36);ol=36;for(;ol---10;)Mx+=ol.toString(36).toUpperCase();var KB=function(e){var n="",l=XB.getRandomValues(new Uint8Array(e||21));for(ol=e||21;ol--;)n+=Mx[l[ol]&63];return n},YB=KB;function kI(e){this.origin=e.origin||"https://api.mapbox.com",this.endpoint="events/v2",this.access_token=e.accessToken,this.version="0.2.0",this.sessionID=this.generateSessionID(),this.userAgent=this.getUserAgent(),this.options=e,this.send=this.send.bind(this),this.countries=e.countries?e.countries.split(","):null,this.types=e.types?e.types.split(","):null,this.bbox=e.bbox?e.bbox:null,this.language=e.language?e.language.split(","):null,this.limit=e.limit?+e.limit:null,this.locale=navigator.language||null,this.enableEventLogging=this.shouldEnableLogging(e),this.eventQueue=new Array,this.flushInterval=e.flushInterval||1e3,this.maxQueueSize=e.maxQueueSize||100,this.timer=this.flushInterval?setTimeout(this.flush.bind(this),this.flushInterval):null,this.lastSentInput="",this.lastSentIndex=0}kI.prototype={select:function(e,n){var l=this.getSelectedIndex(e,n),h=this.getEventPayload("search.select",n);if(h.resultIndex=l,h.resultPlaceName=e.place_name,h.resultId=e.id,!(l===this.lastSentIndex&&h.queryString===this.lastSentInput||l==-1)&&(this.lastSentIndex=l,this.lastSentInput=h.queryString,!!h.queryString))return this.push(h)},start:function(e){var n=this.getEventPayload("search.start",e);if(n.queryString)return this.push(n)},keyevent:function(e,n){if(e.key&&!(e.metaKey||[9,27,37,39,13,38,40].indexOf(e.keyCode)!==-1)){var l=this.getEventPayload("search.keystroke",n);if(l.lastAction=e.key,!!l.queryString)return this.push(l)}},send:function(e,n){if(!this.enableEventLogging)return n?n():void 0;var l=this.getRequestOptions(e);this.request(l,(function(h){if(h)return this.handleError(h,n);if(n)return n()}).bind(this))},getRequestOptions:function(e){Array.isArray(e)||(e=[e]);var n={method:"POST",host:this.origin,path:this.endpoint+"?access_token="+this.access_token,headers:{"Content-Type":"application/json"},body:JSON.stringify(e)};return n},getEventPayload:function(e,n){var l;n.options.proximity?l=[n.options.proximity.longitude,n.options.proximity.latitude]:l=null;var h=n._map?n._map.getZoom():void 0,m={event:e,created:+new Date,sessionIdentifier:this.sessionID,country:this.countries,userAgent:this.userAgent,language:this.language,bbox:this.bbox,types:this.types,endpoint:"mapbox.places",autocomplete:n.options.autocomplete,fuzzyMatch:n.options.fuzzyMatch,proximity:l,limit:n.options.limit,routing:n.options.routing,worldview:n.options.worldview,mapZoom:h,keyboardLocale:this.locale};return e==="search.select"?m.queryString=n.inputString:e!="search.select"&&n._inputEl?m.queryString=n._inputEl.value:m.queryString=n.inputString,m},request:function(e,n){var l=new XMLHttpRequest;l.onreadystatechange=function(){if(this.readyState==4)return this.status==204?n(null):n(this.statusText)},l.open(e.method,e.host+"/"+e.path,!0);for(var h in e.headers){var m=e.headers[h];l.setRequestHeader(h,m)}l.send(e.body)},handleError:function(e,n){if(n)return n(e)},generateSessionID:function(){return YB()},getUserAgent:function(){return"mapbox-gl-geocoder."+this.version+"."+navigator.userAgent},getSelectedIndex:function(e,n){if(n._typeahead){var l=n._typeahead.data,h=e.id,m=l.map(function(E){return E.id}),v=m.indexOf(h);return v}},shouldEnableLogging:function(e){return!(e.enableEventLogging===!1||e.origin&&e.origin.indexOf("api.mapbox.com")==-1||e.localGeocoder||e.filter)},flush:function(){this.eventQueue.length>0&&(this.send(this.eventQueue),this.eventQueue=new Array),this.timer&&clearTimeout(this.timer),this.flushInterval&&(this.timer=setTimeout(this.flush.bind(this),this.flushInterval))},push:function(e,n){this.eventQueue.push(e),(this.eventQueue.length>=this.maxQueueSize||n)&&this.flush()},remove:function(){this.flush()}};var JB=kI,QB={de:"Suche",it:"Ricerca",en:"Search",nl:"Zoeken",fr:"Chercher",ca:"Cerca",he:"לחפש",ja:"サーチ",lv:"Meklēt",pt:"Procurar",sr:"Претрага",zh:"搜索",cs:"Vyhledávání",hu:"Keresés",ka:"ძიება",nb:"Søke",sk:"Vyhľadávanie",th:"ค้นหา",fi:"Hae",is:"Leita",ko:"수색",pl:"Szukaj",sl:"Iskanje",fa:"جستجو",ru:"Поиск"},eF={placeholder:QB},MI={exports:{}};(function(e){(function(n,l,h){e.exports?e.exports=h():n[l]=h()})(Go,"subtag",function(){var n="",l=/^([a-zA-Z]{2,3})(?:[_-]+([a-zA-Z]{3})(?=$|[_-]+))?(?:[_-]+([a-zA-Z]{4})(?=$|[_-]+))?(?:[_-]+([a-zA-Z]{2}|[0-9]{3})(?=$|[_-]+))?/;function h(k){return k.match(l)||[]}function m(k){return h(k).filter(function(D,V){return D&&V})}function v(k){return k=h(k),{language:k[1]||n,extlang:k[2]||n,script:k[3]||n,region:k[4]||n}}function E(k,D,V){Object.defineProperty(k,D,{value:V,enumerable:!0})}function s(k,D,V){function G(J){return h(J)[k]||n}E(G,"pattern",D),E(v,V,G)}return s(1,/^[a-zA-Z]{2,3}$/,"language"),s(2,/^[a-zA-Z]{3}$/,"extlang"),s(3,/^[a-zA-Z]{4}$/,"script"),s(4,/^[a-zA-Z]{2}$|^[0-9]{3}$/,"region"),E(v,"split",m),v})})(MI);var tF=MI.exports,nF=h4,rF=k4,lc=yh,iF=O4.EventEmitter,PT=B4,zT=xB,LT=HB,oF=JB,sF=eF,aF=tF;const $a={FORWARD:0,LOCAL:1,REVERSE:2};function PI(e){this._eventEmitter=new iF,this.options=lc({},this.options,e),this.inputString="",this.fresh=!0,this.lastSelected=null}PI.prototype={options:{zoom:16,flyTo:!0,trackProximity:!0,minLength:2,reverseGeocode:!1,limit:5,origin:"https://api.mapbox.com",enableEventLogging:!0,marker:!0,mapboxgl:null,collapsed:!1,clearAndBlurOnEsc:!1,clearOnBlur:!1,getItemValue:function(e){return e.place_name},render:function(e){var n=e.place_name.split(",");return'
'+n[0]+'
'+n.splice(1,n.length).join(",")+"
"}},addTo:function(e){function n(l,h){if(!document.body.contains(h))throw new Error("Element provided to #addTo() exists, but is not in the DOM");const m=l.onAdd();h.appendChild(m)}if(e._controlContainer)e.addControl(this);else if(e instanceof HTMLElement)n(this,e);else if(typeof e=="string"){const l=document.querySelectorAll(e);if(l.length===0)throw new Error("Element ",e,"not found.");if(l.length>1)throw new Error("Geocoder can only be added to a single html element");n(this,l[0])}else throw new Error("Error: addTo must be a mapbox-gl-js map, an html element, or a CSS selector query for a single html element")},onAdd:function(e){if(e&&typeof e!="string"&&(this._map=e),this.setLanguage(),this.options.localGeocoderOnly||(this.geocoderService=LT(zT({accessToken:this.options.accessToken,origin:this.options.origin}))),this.options.localGeocoderOnly&&!this.options.localGeocoder)throw new Error("A localGeocoder function must be specified to use localGeocoderOnly mode");this.eventManager=new oF(this.options),this._onChange=this._onChange.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onPaste=this._onPaste.bind(this),this._onBlur=this._onBlur.bind(this),this._showButton=this._showButton.bind(this),this._hideButton=this._hideButton.bind(this),this._onQueryResult=this._onQueryResult.bind(this),this.clear=this.clear.bind(this),this._updateProximity=this._updateProximity.bind(this),this._collapse=this._collapse.bind(this),this._unCollapse=this._unCollapse.bind(this),this._clear=this._clear.bind(this),this._clearOnBlur=this._clearOnBlur.bind(this);var n=this.container=document.createElement("div");n.className="mapboxgl-ctrl-geocoder mapboxgl-ctrl";var l=this.createIcon("search",'');this._inputEl=document.createElement("input"),this._inputEl.type="text",this._inputEl.className="mapboxgl-ctrl-geocoder--input",this.setPlaceholder(),this.options.collapsed&&(this._collapse(),this.container.addEventListener("mouseenter",this._unCollapse),this.container.addEventListener("mouseleave",this._collapse),this._inputEl.addEventListener("focus",this._unCollapse)),(this.options.collapsed||this.options.clearOnBlur)&&this._inputEl.addEventListener("blur",this._onBlur),this._inputEl.addEventListener("keydown",rF(this._onKeyDown,200)),this._inputEl.addEventListener("paste",this._onPaste),this._inputEl.addEventListener("change",this._onChange),this.container.addEventListener("mouseenter",this._showButton),this.container.addEventListener("mouseleave",this._hideButton),this._inputEl.addEventListener("keyup",(function(v){this.eventManager.keyevent(v,this)}).bind(this));var h=document.createElement("div");h.classList.add("mapboxgl-ctrl-geocoder--pin-right"),this._clearEl=document.createElement("button"),this._clearEl.setAttribute("aria-label","Clear"),this._clearEl.addEventListener("click",this.clear),this._clearEl.className="mapboxgl-ctrl-geocoder--button";var m=this.createIcon("close",'');return this._clearEl.appendChild(m),this._loadingEl=this.createIcon("loading",''),h.appendChild(this._clearEl),h.appendChild(this._loadingEl),n.appendChild(l),n.appendChild(this._inputEl),n.appendChild(h),this._typeahead=new nF(this._inputEl,[],{filter:!1,minLength:this.options.minLength,limit:this.options.limit}),this.setRenderFunction(this.options.render),this._typeahead.getItemValue=this.options.getItemValue,this.mapMarker=null,this._handleMarker=this._handleMarker.bind(this),this._map&&(this.options.trackProximity&&(this._updateProximity(),this._map.on("moveend",this._updateProximity)),this._mapboxgl=this.options.mapboxgl,!this._mapboxgl&&this.options.marker&&(console.error("No mapboxgl detected in options. Map markers are disabled. Please set options.mapboxgl."),this.options.marker=!1)),n},createIcon:function(e,n){var l=document.createElementNS("http://www.w3.org/2000/svg","svg");if(l.setAttribute("class","mapboxgl-ctrl-geocoder--icon mapboxgl-ctrl-geocoder--icon-"+e),l.setAttribute("viewBox","0 0 18 18"),l.setAttribute("xml:space","preserve"),l.setAttribute("width",18),l.setAttribute("height",18),"innerHTML"in l)l.innerHTML=n;else{var h=document.createElement("div");h.innerHTML=""+n.valueOf().toString()+"";var m=h.firstChild,v=m.firstChild;l.appendChild(v)}return l},onRemove:function(){return this.container.parentNode.removeChild(this.container),this.options.trackProximity&&this._map&&this._map.off("moveend",this._updateProximity),this._removeMarker(),this._map=null,this},_onPaste:function(e){var n=(e.clipboardData||window.clipboardData).getData("text");n.length>=this.options.minLength&&this._geocode(n)},_onKeyDown:function(e){var n=27,l=9;if(e.keyCode===n&&this.options.clearAndBlurOnEsc)return this._clear(e),this._inputEl.blur();var h=e.target&&e.target.shadowRoot?e.target.shadowRoot.activeElement:e.target,m=h?h.value:"";if(!m)return this.fresh=!0,e.keyCode!==l&&this.clear(e),this._clearEl.style.display="none";e.metaKey||[l,n,37,39,13,38,40].indexOf(e.keyCode)!==-1||h.value.length>=this.options.minLength&&this._geocode(h.value)},_showButton:function(){this._typeahead.selected&&(this._clearEl.style.display="block")},_hideButton:function(){this._typeahead.selected&&(this._clearEl.style.display="none")},_onBlur:function(e){this.options.clearOnBlur&&this._clearOnBlur(e),this.options.collapsed&&this._collapse()},_onChange:function(){var e=this._typeahead.selected;if(e&&JSON.stringify(e)!==this.lastSelected){if(this._clearEl.style.display="none",this.options.flyTo){var n;if(e.properties&&PT[e.properties.short_code])n=lc({},this.options.flyTo),this._map&&this._map.fitBounds(PT[e.properties.short_code].bbox,n);else if(e.bbox){var l=e.bbox;n=lc({},this.options.flyTo),this._map&&this._map.fitBounds([[l[0],l[1]],[l[2],l[3]]],n)}else{var h={zoom:this.options.zoom};n=lc({},h,this.options.flyTo),e.center?n.center=e.center:e.geometry&&e.geometry.type&&e.geometry.type==="Point"&&e.geometry.coordinates&&(n.center=e.geometry.coordinates),this._map&&this._map.flyTo(n)}}this.options.marker&&this._mapboxgl&&this._handleMarker(e),this._inputEl.focus(),this._inputEl.scrollLeft=0,this._inputEl.setSelectionRange(0,0),this.lastSelected=JSON.stringify(e),this._eventEmitter.emit("result",{result:e}),this.eventManager.select(e,this)}},_requestType:function(e,n){var l;const h=/^[ ]*(-?\d+\.?\d*)[, ]+(-?\d+\.?\d*)[ ]*$/;return e.localGeocoderOnly?l=$a.LOCAL:e.reverseGeocode&&h.test(n)?l=$a.REVERSE:l=$a.FORWARD,l},_setupConfig:function(e,n){const l=["bbox","limit","proximity","countries","types","language","reverseMode","mode","autocomplete","fuzzyMatch","routing","worldview"],h=/[\s,]+/;var m=this,v=l.reduce(function(s,k){if(m.options[k]===void 0||m.options[k]===null)return s;["countries","types","language"].indexOf(k)>-1?s[k]=m.options[k].split(h):s[k]=m.options[k];const D=typeof m.options[k].longitude=="number"&&typeof m.options[k].latitude=="number";if(k==="proximity"&&D){const V=m.options[k].longitude,G=m.options[k].latitude;s[k]=[V,G]}return s},{});switch(e){case $a.REVERSE:{var E=n.split(h).map(function(s){return parseFloat(s,10)}).reverse();v.types&&v.types[0],v=lc(v,{query:E,limit:1}),["proximity","autocomplete","fuzzyMatch","bbox"].forEach(function(s){s in v&&delete v[s]})}break;case $a.FORWARD:/^[ ]*(-?\d+\.?\d*)[, ]+(-?\d+\.?\d*)*[ ]*$/.test(n)&&(n=n.replace(/,/g," ")),v=lc(v,{query:n});break}return v},_geocode:function(e){this.inputString=e,this._loadingEl.style.display="block",this._eventEmitter.emit("loading",{query:e});const n=this._requestType(this.options,e),l=this._setupConfig(n,e);var h;switch(n){case $a.LOCAL:h=Promise.resolve();break;case $a.FORWARD:h=this.geocoderService.forwardGeocode(l).send();break;case $a.REVERSE:h=this.geocoderService.reverseGeocode(l).send();break}var m=this.options.localGeocoder?this.options.localGeocoder(e)||[]:[],v=[],E=null;return h.catch((function(s){E=s}).bind(this)).then((function(s){this._loadingEl.style.display="none";var k={};return s?s.statusCode=="200"&&(k=s.body,k.request=s.request,k.headers=s.headers):k={type:"FeatureCollection",features:[]},k.config=l,this.fresh&&(this.eventManager.start(this),this.fresh=!1),k.features=k.features?m.concat(k.features):m,this.options.externalGeocoder?(v=this.options.externalGeocoder(e,k.features)||[],v.then(function(D){return k.features=k.features?D.concat(k.features):D,k},function(){return k})):k}).bind(this)).then((function(s){if(E)throw E;this.options.filter&&s.features.length&&(s.features=s.features.filter(this.options.filter)),s.features.length?(this._clearEl.style.display="block",this._eventEmitter.emit("results",s),this._typeahead.update(s.features)):(this._clearEl.style.display="none",this._typeahead.selected=null,this._renderNoResults(),this._eventEmitter.emit("results",s))}).bind(this)).catch((function(s){this._loadingEl.style.display="none",m.length&&this.options.localGeocoder||v.length&&this.options.externalGeocoder?(this._clearEl.style.display="block",this._typeahead.update(m)):(this._clearEl.style.display="none",this._typeahead.selected=null,this._renderError()),this._eventEmitter.emit("results",{features:m}),this._eventEmitter.emit("error",{error:s})}).bind(this)),h},_clear:function(e){e&&e.preventDefault(),this._inputEl.value="",this._typeahead.selected=null,this._typeahead.clear(),this._onChange(),this._clearEl.style.display="none",this._removeMarker(),this.lastSelected=null,this._eventEmitter.emit("clear"),this.fresh=!0},clear:function(e){this._clear(e),this._inputEl.focus()},_clearOnBlur:function(e){var n=this;e.relatedTarget&&n._clear(e)},_onQueryResult:function(e){var n=e.body;if(n.features.length){var l=n.features[0];this._typeahead.selected=l,this._inputEl.value=l.place_name,this._onChange()}},_updateProximity:function(){if(this._map)if(this._map.getZoom()>9){var e=this._map.getCenter().wrap();this.setProximity({longitude:e.lng,latitude:e.lat})}else this.setProximity(null)},_collapse:function(){!this._inputEl.value&&this._inputEl!==document.activeElement&&this.container.classList.add("mapboxgl-ctrl-geocoder--collapsed")},_unCollapse:function(){this.container.classList.remove("mapboxgl-ctrl-geocoder--collapsed")},query:function(e){return this._geocode(e).then(this._onQueryResult),this},_renderError:function(){var e="
There was an error reaching the server
";this._renderMessage(e)},_renderNoResults:function(){var e="
No results found
";this._renderMessage(e)},_renderMessage:function(e){this._typeahead.update([]),this._typeahead.selected=null,this._typeahead.clear(),this._typeahead.renderError(e)},_getPlaceholderText:function(){if(this.options.placeholder)return this.options.placeholder;if(this.options.language){var e=this.options.language.split(",")[0],n=aF.language(e),l=sF.placeholder[n];if(l)return l}return"Search"},setInput:function(e){return this._inputEl.value=e,this._typeahead.selected=null,this._typeahead.clear(),e.length>=this.options.minLength&&this._geocode(e),this},setProximity:function(e){return this.options.proximity=e,this},getProximity:function(){return this.options.proximity},setRenderFunction:function(e){return e&&typeof e=="function"&&(this._typeahead.render=e),this},getRenderFunction:function(){return this._typeahead.render},setLanguage:function(e){var n=navigator.language||navigator.userLanguage||navigator.browserLanguage;return this.options.language=e||this.options.language||n,this},getLanguage:function(){return this.options.language},getZoom:function(){return this.options.zoom},setZoom:function(e){return this.options.zoom=e,this},getFlyTo:function(){return this.options.flyTo},setFlyTo:function(e){return this.options.flyTo=e,this},getPlaceholder:function(){return this.options.placeholder},setPlaceholder:function(e){return this.placeholder=e||this._getPlaceholderText(),this._inputEl.placeholder=this.placeholder,this._inputEl.setAttribute("aria-label",this.placeholder),this},getBbox:function(){return this.options.bbox},setBbox:function(e){return this.options.bbox=e,this},getCountries:function(){return this.options.countries},setCountries:function(e){return this.options.countries=e,this},getTypes:function(){return this.options.types},setTypes:function(e){return this.options.types=e,this},getMinLength:function(){return this.options.minLength},setMinLength:function(e){return this.options.minLength=e,this._typeahead&&(this._typeahead.options.minLength=e),this},getLimit:function(){return this.options.limit},setLimit:function(e){return this.options.limit=e,this._typeahead&&(this._typeahead.options.limit=e),this},getFilter:function(){return this.options.filter},setFilter:function(e){return this.options.filter=e,this},setOrigin:function(e){return this.options.origin=e,this.geocoderService=LT(zT({accessToken:this.options.accessToken,origin:this.options.origin})),this},getOrigin:function(){return this.options.origin},setAutocomplete:function(e){return this.options.autocomplete=e,this},getAutocomplete:function(){return this.options.autocomplete},setFuzzyMatch:function(e){return this.options.fuzzyMatch=e,this},getFuzzyMatch:function(){return this.options.fuzzyMatch},setRouting:function(e){return this.options.routing=e,this},getRouting:function(){return this.options.routing},setWorldview:function(e){return this.options.worldview=e,this},getWorldview:function(){return this.options.worldview},_handleMarker:function(e){if(this._map){this._removeMarker();var n={color:"#4668F2"},l=lc({},n,this.options.marker);return this.mapMarker=new this._mapboxgl.Marker(l),e.center?this.mapMarker.setLngLat(e.center).addTo(this._map):e.geometry&&e.geometry.type&&e.geometry.type==="Point"&&e.geometry.coordinates&&this.mapMarker.setLngLat(e.geometry.coordinates).addTo(this._map),this}},_removeMarker:function(){this.mapMarker&&(this.mapMarker.remove(),this.mapMarker=null)},on:function(e,n){return this._eventEmitter.on(e,n),this},off:function(e,n){return this._eventEmitter.removeListener(e,n),this.eventManager.remove(),this}};var lF=PI;const cF=g1(lF);/* + * Frontend UI component library for the CORI Data API + * {@link https://github.com/ruralinnovation/cori.data.api} + * @copyright Rural Innovation Strategies, Inc. + * @license ISC + */function uF(e){const[n,l]=ut.useState(null),h=Object.assign({},e),m=_h(()=>{const v=new cF(Object.assign(Object.assign({},h),{marker:n||!1,accessToken:h.mapboxAccessToken}));return h.onLoading&&v.on("loading",h.onLoading),h.onResults&&v.on("results",h.onResults),h.onResult&&v.on("result",E=>{var s;h.onResult!==void 0&&h.onResult(E);const{result:k}=E,D=k&&(k.center||((s=k.geometry)===null||s===void 0?void 0:s.type)==="Point"&&k.geometry.coordinates);if(D&&h.marker){const V=typeof h.marker=="object"?h.marker:{};l(ut.createElement(eI,Object.assign({},V,{longitude:D[0],latitude:D[1]})))}else l(null)}),h.onError&&v.on("error",h.onError),v},{position:h.position});return m.hasOwnProperty("_map")&&m._map&&(m.getProximity()!==h.proximity&&h.proximity!==void 0&&m.setProximity(h.proximity),m.getRenderFunction()!==h.render&&h.render!==void 0&&m.setRenderFunction(h.render),m.getLanguage()!==h.language&&h.language!==void 0&&m.setLanguage(h.language),m.getZoom()!==h.zoom&&h.zoom!==void 0&&m.setZoom(h.zoom),m.getFlyTo()!==h.flyTo&&h.flyTo!==void 0&&m.setFlyTo(h.flyTo),m.getPlaceholder()!==h.placeholder&&h.placeholder!==void 0&&m.setPlaceholder(h.placeholder),m.getCountries()!==h.countries&&h.countries!==void 0&&m.setCountries(h.countries),m.getTypes()!==h.types&&h.types!==void 0&&m.setTypes(h.types),m.getMinLength()!==h.minLength&&h.minLength!==void 0&&m.setMinLength(h.minLength),m.getLimit()!==h.limit&&h.limit!==void 0&&m.setLimit(h.limit),m.getFilter()!==h.filter&&h.filter!==void 0&&m.setFilter(h.filter),m.getOrigin()!==h.origin&&h.origin!==void 0&&m.setOrigin(h.origin),m.getAutocomplete()!==h.autocomplete&&h.autocomplete!==void 0&&m.setAutocomplete(h.autocomplete),m.getFuzzyMatch()!==h.fuzzyMatch&&h.fuzzyMatch!==void 0&&m.setFuzzyMatch(h.fuzzyMatch),m.getRouting()!==h.routing&&h.routing!==void 0&&m.setRouting(h.routing),m.getWorldview()!==h.worldview&&h.worldview!==void 0&&m.setWorldview(h.worldview)),n}/* + * Frontend UI component library for the CORI Data API + * {@link https://github.com/ruralinnovation/cori.data.api} + * @copyright Rural Innovation Strategies, Inc. + * @license ISC + */var hF=8,dF="LIVE - CORI light basemap - county labels",pF={"mapbox:type":"default","mapbox:origin":"light-v10","mapbox:autocomposite":!0,"mapbox:groups":{"1444855769305.6016":{name:"Tunnels",collapsed:!0},"1444855786460.0557":{name:"Roads",collapsed:!0},"1444855799204.86":{name:"Bridges",collapsed:!0},"1444934295202.7542":{name:"Admin boundaries",collapsed:!1}},"mapbox:sdk-support":{js:"0.54.0",android:"7.4.0",ios:"4.10.0"},"mapbox:uiParadigm":"layers","mapbox:thumb":"data:image/webp;base64,UklGRmAJAABXRUJQVlA4TFQJAAAvO8AOAPX4drZtmWTXts7/wMzUqCCLGZOCMjCzbfx/1jFYYr9m+zeF5Gqx8bj3bozqqoouhWLj6dCYQqn+K1W6Vb1HB+Nn+HqXMatDQowkSVJTM/xwkv+mwu1OF8S2kRxJ7PyjfbMzs6a7+j8Be9jFwDSO7Za6ajtXwy/CHsEeYqSRsWzFQAbkSKlndkzfLGcN0zHLlJYZyNmbaOFmTdM0apq3d+t5Y906dr68rJ16zskdY1kaCWdraPJQE8CKlJazrjk+nrVM2/y0Q8ZpQtFux7BmD3bG8fxnncEJvUfnnPObbeMBsKIKWwJLA5PS8njL3DLP4CPmpnkG4+PxuFaBT22n9wiwUuTNx93WpXE+s4bmwJJyWCFwVAX3SJuMZ8fb5ic/uYKb5qc/HY+XqSvlgEmPIYI91BF5/X6fOW3Hpn0x7BGCGMgOIUVMAPdLSmn8xk/+ddM0zT/NUlqmDDhHT0NSj4pzfDEiNh53M7rOC/ElKUxkESgctcF75jilNBuP35gtU2kUjLo1fQicFbF5v7lCb488VM7WALsaKYd2zVFMDJBTSmn50/F4uY8oH9g2dlja+Pv3HebWDpZz2CAZV8BymTpIaTYb/3SZ9qXU6tvEuVU4hpI2Xye6NVcGNl5gQmAtIFJK47Qcj4/vYUcXT2V/e+hiR0dKjfeJAXNqGGNjZyGHYGhSSrPZcjkbH+83Acwe6dm7BBtfXc6umi7y9rHj4OwwIMkKSw5gmVJqm/FsNhvPlmlc+PcAb+MGLpNvvzvdHEb//8OovHFcQ+Yq/v9FAAPYcsiPFeA6pdTGbLkcz8YpXVyWKaW1nwkYRs7diBfOOr8KN/XMr5rQ0a5ZP9bB2pgIyCgcIBlYpJT6JqXl+HicUjv5Y0rp+jbBBm1ktlJfyo4HjVCu55uvNWTWNgGEcRjHAhvXJeOfjmep/JFd4HvbAxzyF3Odt55noJNjJLBCyEgTLJk6peO0PB7PlmVLsAG10hVYoHr+7tb9Xnc+Gq9LkmUp5EAAOaWOWc5mhcmkYAH+9Y69oGxQ5rm+/blu2ZcnO8ieP+xiF/UnHn5CsSdvpGRwWo4fz5bj8QTIKdUqxA4DhjDSXN3bt/Ha18gPbdnClr2jx9/+C/GJd2vFG1e2C6uWywDw0KQAUNdOEHYNtdW/9Ppr//pCNFKyMNiw+I5lm+I8GpNlnQuACwNyDES2sNDdYzNgTqQqy4CycbYlyn/fGMJR56jXN5Bxl/k8lnLsCjmL/zgc0lfHoSnKIiaEXOZssAXrI0t7EE3HQLYenf4V9p3x7Le+duJxX2Uu4IN6w2A8AvZRYLMfBfv7gOs6f/4Qh9THjV3bkxx+9L5vzc/c983rz+06z4+BKDFWCKySTMgGEOW5ydRzy6pCJj76rcn68b9LrtNns3fqsW0A+cjYLlkRkjH3+nFcfyKbqtCX7v4vzs98Z5ulUMGaHrGvbYdldC/acUDMI+ogY9183D4xWa0atXp1Br1lYw5HKnGOiHB2CO/nHtr6vCTlx0cmz3Gsv3eHObHhVctqJNe877Ab7FbtEc2e1A6XKBS5tkS5X360Y9aVjhVZn9gJGwSNx7N9/c6ZCgLgO3R6exWZUku4tlww9q0U0NLnbVRPI7tw57hOOqLMqjr1TIaJXRYSZIVsii+vgOg4skLzlWTD3c//qfA+yp242/sFnDDP4So+huswWBjmlsucf4/xnfEEj8BG783+2+m1R/Cwpne5evS5sQcLGVuteLpeZ7t/G9xbff0Z2zLAfWyKHbTUtLDN0QHWoN5OvctX2717l9Pva6cXffKx4bCViTpG+tVNnNTa5To8WwdB2UMAAw2Zon5/ALs1zbroWo0Y4X6velAf1fMDOyYxtTE8CTd9B3XbZaOa7TodvmY9vT4jvkIrjFmfqvz74xFhs1bO88CeoLNJpRweGiaO6s0RMyD5SJu+O73drb1VV6tOo9aXe3UGdR4CQ54G9w7T69Pt06SzDDx8Hqf1kXqv+rVsSi2rSZ6bubRsjXZYAOrTBwatmpl3mvaI2tXLv/+bbsw9QFv16qXf50bdXd7OZbV7/XOnV6/3p9ml79Y1ZDzSwgXLPLmji9aluLFNAQ9oAxZdfaknii934lsv8XK2bcAjuF9Pr6/O5W/1a0BhTB523M/AWetlA3tmaFOmXUO5w1i2AQLY0+L3n6c4MEOlxchsfJZ6hhtxcSoAnriA7AlgABsJMGZOcfFHk+sMho1j6TdNfOzUi6rwNkXLqsFl2GDLMjmA36dexbYL3nzu+M2J8ZIFfPpBwZZCtilmwEVh+P79qDeifhpzKNl4Pvdv2mupHWSAAUPx+47wnrFx4b4NBocBs4uqJf0XpTady3fw3Mhy/nZW2/5EGHBYVRgb3IEpWqZ0BlsZA7aFW5fuMyencAAHhvuQ8ye+/fD/fvUw4/vvtso8oiDLYLhPX08oOgYl4u6xhubkBMIc/hqo+UQYYmWxr3MIq5CJN2mq5wDKOdew+XfldefSRoX6NZKV69dHAMXLeD/AddTuqU85SNTfH1s4fAR07k8ekrXJlWXqeDtMNhXYR0F5VQKOHGHxcnyJ79kMC/ousDIHp7Zm2CMaCsbK1psuubIKWlaZrZyzye1oO4cmYwCZty45t7eYTIB/AiMHWlV+U9yrjE3k/E/yv9chv6lqOrXQ2oyrr1lzZ8DyAuNQR28WDBhTqMAR7/7MEACWb5ubKeJ7VUxdW8haAAK7otSADZji39Rd2pUKxPyjO8HTp+AHDmFccMG5BLBsF7xYrOIWzjJtvVtw/sKHF/sLgL9vCYxs4YKHZh8Zm1U1nZqa/PTXBuwdMiLP7OLgrULXSAaBsYRs38GW/rtgyWyMlV9EMSMdAKtGqu7Td3BzPBgxAOrjqKZ0wj16DETYvrZc31VRqj24OoBzp4u7vpT7zvk4OqBEuT4seAG4DFeWbLQ+9ZJclv13AxI8+yvIA/qFKR+AwSIfCVAFYJdAoG99F0uAASJ+7Xi5EzjuZk6s0hOYTLCZqwIsl4NhOjk0QLgQkevcYqaLo5VxjzyzJ/ltOJTB8wgDqICNVX3/cUwBt5OcFdkG/4OAbDbok6v49AOAgnrQJKaTmMi5qmKxcLBaev4vkeePDFjAp+cUg2cm51YN1WMoN56HKE4rgx0vnz19+Fc/ub79ZLILKw5pa4UxHOSSqQE="},fF=[-72.26808525539167,43.37747275058169],mF=10.873762090608595,gF=0,_F=2,yF={composite:{url:"mapbox://mapbox.mapbox-terrain-v2,mapbox.mapbox-streets-v8,ruralinno.2pv0vm2z,ruralinno.3v9y79ly,ruralinno.5639ssfg,ruralinno.c504wkuy,ruralinno.7stpbs93,ruralinno.cwz2k5qc,ruralinno.1joudpqe",type:"vector"}},vF="mapbox://sprites/ruralinno/cl010e7b7001p15pe3l0306hv/68n9slz9mfbus83an19oqbf32",xF="mapbox://fonts/ruralinno/{fontstack}/{range}.pbf",wF=[{id:"land",type:"background",layout:{},paint:{"background-color":"hsl(55, 0%, 100%)"}},{id:"landcover",type:"fill",source:"composite","source-layer":"landcover",maxzoom:7,layout:{},paint:{"fill-color":"hsl(0, 0%, 100%)","fill-opacity":["interpolate",["exponential",1.5],["zoom"],2,.1,7,0],"fill-antialias":!1}},{id:"national-park",type:"fill",source:"composite","source-layer":"landuse_overlay",minzoom:5,filter:["==",["get","class"],"national_park"],layout:{},paint:{"fill-color":"hsla(150, 6%, 93%, 0.63)","fill-opacity":["interpolate",["linear"],["zoom"],5,0,6,.5]}},{id:"landuse",type:"fill",source:"composite","source-layer":"landuse",minzoom:5,filter:["match",["get","class"],["park","airport","glacier","pitch","sand"],!0,!1],layout:{},paint:{"fill-opacity":["interpolate",["linear"],["zoom"],5,0,6,["match",["get","class"],"glacier",.5,1]],"fill-color":"hsl(150, 0%, 100%)"}},{id:"water-shadow",type:"fill",source:"composite","source-layer":"water",layout:{},paint:{"fill-translate-anchor":"viewport","fill-translate":["interpolate",["exponential",1.2],["zoom"],7,["literal",[0,0]],16,["literal",[-1,-1]]],"fill-color":"hsl(185, 7%, 73%)"}},{id:"waterway",type:"line",source:"composite","source-layer":"waterway",minzoom:8,layout:{"line-cap":["step",["zoom"],"butt",11,"round"],"line-join":"round"},paint:{"line-color":"hsl(187, 9%, 81%)","line-width":["interpolate",["exponential",1.3],["zoom"],9,["match",["get","class"],["canal","river"],.1,0],20,["match",["get","class"],["canal","river"],8,3]],"line-opacity":["interpolate",["linear"],["zoom"],8,0,8.5,1]}},{id:"water",type:"fill",source:"composite","source-layer":"water",layout:{},paint:{"fill-color":"#cad2d3","fill-opacity":.5}},{id:"hillshade",type:"fill",source:"composite","source-layer":"hillshade",minzoom:6,layout:{},paint:{"fill-color":["match",["get","class"],"shadow","hsl(0, 0%, 35%)","hsl(0, 0%, 100%)"],"fill-opacity":["interpolate",["linear"],["zoom"],12,["match",["get","level"],[67,56],.02,[89,78],.01,.015],15,0]}},{id:"land-structure-polygon",type:"fill",source:"composite","source-layer":"structure",minzoom:21.1,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","class"],"land"]],layout:{},paint:{"fill-color":"hsl(156, 20%, 95%)"}},{id:"land-structure-line",type:"line",source:"composite","source-layer":"structure",minzoom:13,filter:["all",["==",["geometry-type"],"LineString"],["==",["get","class"],"land"]],layout:{"line-cap":"round"},paint:{"line-width":["interpolate",["exponential",1.99],["zoom"],14,.75,20,40],"line-color":"hsl(156, 20%, 95%)"}},{id:"aeroway-polygon",type:"fill",source:"composite","source-layer":"aeroway",minzoom:11,filter:["all",["==",["geometry-type"],"Polygon"],["match",["get","type"],["runway","taxiway","helipad"],!0,!1]],layout:{},paint:{"fill-opacity":["interpolate",["linear"],["zoom"],11,0,11.5,1],"fill-color":"hsl(0, 0%, 97%)"}},{id:"aeroway-line",type:"line",source:"composite","source-layer":"aeroway",minzoom:9,filter:["==",["geometry-type"],"LineString"],layout:{},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],9,["match",["get","type"],"runway",1,.5],18,["match",["get","type"],"runway",80,20]],"line-color":"hsl(0, 0%, 97%)"}},{id:"building-outline",type:"line",source:"composite","source-layer":"building",minzoom:15,filter:["all",["!=",["get","type"],"building:part"],["==",["get","underground"],"false"]],layout:{},paint:{"line-color":"hsl(55, 3%, 87%)","line-width":["interpolate",["exponential",1.5],["zoom"],15,.75,20,3],"line-opacity":["interpolate",["linear"],["zoom"],15,0,16,1]}},{id:"building",type:"fill",source:"composite","source-layer":"building",minzoom:15,filter:["all",["!=",["get","type"],"building:part"],["==",["get","underground"],"false"]],layout:{},paint:{"fill-outline-color":"hsl(55, 3%, 87%)","fill-opacity":["interpolate",["linear"],["zoom"],15,0,16,1],"fill-color":"hsl(55, 5%, 91%)"}},{id:"tunnel-street-minor-low",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["step",["zoom"],["match",["get","class"],["street","street_limited","track","primary_link"],!0,!1],14,["match",["get","class"],["street","street_limited","track","primary_link","secondary_link","tertiary_link","service"],!0,!1]],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,["match",["get","class"],["street","street_limited","primary_link"],2,"track",1,.5],18,["match",["get","class"],["street","street_limited","primary_link"],18,12]],"line-color":"hsl(185, 7%, 88%)","line-opacity":["step",["zoom"],1,14,0]}},{id:"tunnel-street-minor-case",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["step",["zoom"],["match",["get","class"],["street","street_limited","track","primary_link"],!0,!1],14,["match",["get","class"],["street","street_limited","track","primary_link","secondary_link","tertiary_link","service"],!0,!1]],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.75,20,2],"line-color":"hsl(185, 12%, 89%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,["match",["get","class"],["street","street_limited","primary_link"],2,"track",1,.5],18,["match",["get","class"],["street","street_limited","primary_link"],18,12]],"line-opacity":["step",["zoom"],0,14,1],"line-dasharray":[3,3]}},{id:"tunnel-primary-secondary-tertiary-case",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["match",["get","class"],["primary","secondary","tertiary"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],10,["match",["get","class"],"primary",1,.75],18,2],"line-color":"hsl(185, 12%, 89%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],5,["match",["get","class"],"primary",.75,.1],18,["match",["get","class"],"primary",32,26]],"line-dasharray":[3,3]}},{id:"tunnel-major-link-case",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["match",["get","class"],["motorway_link","trunk_link"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.75,20,2],"line-color":"hsl(185, 12%, 89%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-dasharray":[3,3]}},{id:"tunnel-motorway-trunk-case",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["match",["get","class"],["motorway","trunk"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],10,1,18,2],"line-color":"hsl(185, 12%, 89%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32],"line-dasharray":[3,3]}},{id:"tunnel-construction",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:14,filter:["all",["==",["get","structure"],"tunnel"],["==",["get","class"],"construction"],["==",["geometry-type"],"LineString"]],layout:{},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,2,18,18],"line-color":"hsl(187, 7%, 88%)","line-dasharray":["step",["zoom"],["literal",[.4,.8]],15,["literal",[.3,.6]],16,["literal",[.2,.3]],17,["literal",[.2,.25]],18,["literal",[.15,.15]]]}},{id:"tunnel-path",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["==",["get","class"],"path"],["!=",["get","type"],"steps"],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],15,1,18,4],"line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.75,1]],16,["literal",[1,.75]],17,["literal",[1,.5]]],"line-color":"hsl(0, 0%, 85%)"}},{id:"tunnel-steps",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:14,filter:["all",["==",["get","structure"],"tunnel"],["==",["get","class"],"steps"],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],15,1,16,1.6,18,6],"line-color":"hsl(0, 0%, 85%)","line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.75,1]],16,["literal",[1,.75]],17,["literal",[.3,.3]]]}},{id:"tunnel-major-link",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["match",["get","class"],["motorway_link","trunk_link"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-color":"hsl(187, 7%, 88%)"}},{id:"tunnel-pedestrian",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["==",["get","class"],"pedestrian"],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,.5,18,12],"line-color":"hsl(187, 7%, 88%)","line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.5,.4]],16,["literal",[1,.2]]]}},{id:"tunnel-street-minor",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["step",["zoom"],["match",["get","class"],["street","street_limited","track","primary_link"],!0,!1],14,["match",["get","class"],["street","street_limited","track","primary_link","secondary_link","tertiary_link","service"],!0,!1]],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,["match",["get","class"],["street","street_limited","primary_link"],2,"track",1,.5],18,["match",["get","class"],["street","street_limited","primary_link"],18,12]],"line-color":"hsl(187, 7%, 88%)","line-opacity":["step",["zoom"],0,14,1]}},{id:"tunnel-primary-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["match",["get","class"],["primary","secondary","tertiary"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],5,["match",["get","class"],"primary",.75,.1],18,["match",["get","class"],"primary",32,26]],"line-color":"hsl(187, 7%, 88%)"}},{id:"tunnel-motorway-trunk",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["match",["get","class"],["motorway","trunk"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32],"line-color":"hsl(187, 7%, 88%)"}},{id:"road-pedestrian-case",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:12,filter:["all",["==",["get","class"],"pedestrian"],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,2,18,14.5],"line-color":"hsl(156, 12%, 92%)","line-opacity":["step",["zoom"],0,14,1]}},{id:"road-minor-low",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["step",["zoom"],["==",["get","class"],"track"],14,["match",["get","class"],["track","secondary_link","tertiary_link","service"],!0,!1]],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,["match",["get","class"],"track",1,.5],18,12],"line-color":"hsl(0, 0%, 100%)","line-opacity":["step",["zoom"],1,14,0]}},{id:"road-street-low",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:11,filter:["all",["match",["get","class"],["street","street_limited","primary_link"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-color":"hsl(0, 0%, 100%)","line-opacity":["step",["zoom"],1,14,0]}},{id:"road-minor-case",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["step",["zoom"],["==",["get","class"],"track"],14,["match",["get","class"],["track","secondary_link","tertiary_link","service"],!0,!1]],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.75,20,2],"line-color":"hsl(156, 12%, 92%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],14,["match",["get","class"],"track",1,.5],18,12],"line-opacity":["step",["zoom"],0,14,1]}},{id:"road-street-case",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:11,filter:["all",["match",["get","class"],["street","street_limited","primary_link"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.75,20,2],"line-color":"hsl(156, 12%, 92%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-opacity":["step",["zoom"],0,14,1]}},{id:"road-secondary-tertiary-case",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:9.3,filter:["all",["match",["get","class"],["secondary","tertiary"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],10,.75,18,2],"line-color":"hsl(156, 12%, 92%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],5,.1,18,26]}},{id:"road-primary-case",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:9.9,filter:["all",["==",["get","class"],"primary"],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],10,1,18,2],"line-color":"hsl(156, 12%, 92%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32]}},{id:"road-major-link-case",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:10,filter:["all",["match",["get","class"],["motorway_link","trunk_link"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.75,20,2],"line-color":"hsl(156, 12%, 92%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-opacity":["step",["zoom"],0,11,1]}},{id:"road-motorway-trunk-case",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:8.5,filter:["all",["match",["get","class"],["motorway","trunk"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],10,1,18,2],"line-color":"hsl(156, 12%, 92%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32],"line-opacity":["step",["zoom"],["match",["get","class"],"motorway",1,0],6,1]}},{id:"road-construction",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:14,filter:["all",["==",["get","class"],"construction"],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,2,18,18],"line-color":"hsl(0, 0%, 100%)","line-dasharray":["step",["zoom"],["literal",[.4,.8]],15,["literal",[.3,.6]],16,["literal",[.2,.3]],17,["literal",[.2,.25]],18,["literal",[.15,.15]]]}},{id:"road-path",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:12,filter:["all",["==",["get","class"],"path"],["step",["zoom"],["!",["match",["get","type"],["steps","sidewalk","crossing"],!0,!1]],16,["!=",["get","type"],"steps"]],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],13,.5,14,1,15,1,18,4],"line-color":"hsl(0, 0%, 100%)","line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.75,1]],16,["literal",[1,.75]],17,["literal",[1,.5]]]}},{id:"road-steps",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:14,filter:["all",["==",["get","type"],"steps"],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],15,1,16,1.6,18,6],"line-color":"hsl(0, 0%, 100%)","line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.75,1]],16,["literal",[1,.75]],17,["literal",[.3,.3]]]}},{id:"road-major-link",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:10,filter:["all",["match",["get","class"],["motorway_link","trunk_link"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-color":"hsl(0, 0%, 100%)"}},{id:"road-pedestrian",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:12,filter:["all",["==",["get","class"],"pedestrian"],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,.5,18,12],"line-color":"hsl(0, 0%, 100%)","line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.5,.4]],16,["literal",[1,.2]]]}},{id:"road-minor",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["step",["zoom"],["==",["get","class"],"track"],14,["match",["get","class"],["track","secondary_link","tertiary_link","service"],!0,!1]],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,["match",["get","class"],"track",1,.5],18,12],"line-color":"hsl(0, 0%, 100%)","line-opacity":["step",["zoom"],0,14,1]}},{id:"road-street",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:11,filter:["all",["match",["get","class"],["street","street_limited","primary_link"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-color":"hsl(0, 0%, 100%)","line-opacity":["step",["zoom"],0,14,1]}},{id:"road-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",filter:["all",["match",["get","class"],["secondary","tertiary"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],5,.1,18,22],"line-color":"hsl(0, 0%, 100%)"}},{id:"road-primary",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:9,filter:["all",["==",["get","class"],"primary"],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round","line-cap":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32],"line-color":"#f6eac1","line-opacity":["interpolate",["linear"],["zoom"],6,0,8,["match",["get","class"],["trunk"],.2,0],16,["match",["get","class"],["trunk"],1,.81]]}},{id:"road-motorway-trunk",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:8,filter:["all",["match",["get","class"],["motorway","trunk"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],5,.5,18,32],"line-color":["match",["get","class"],["motorway"],"hsl(26, 100%, 68%)","#f2d163"],"line-opacity":["interpolate",["linear"],["zoom"],6,["match",["get","class"],["trunk"],.3,0],8,.4,18,.7]}},{id:"road-rail",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["match",["get","class"],["major_rail","minor_rail"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,.5,20,1],"line-color":"hsl(156, 12%, 92%)"}},{id:"bridge-pedestrian-case",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["==",["get","class"],"pedestrian"],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,2,18,14.5],"line-opacity":["step",["zoom"],0,14,1],"line-color":"hsl(156, 12%, 92%)"}},{id:"bridge-street-minor-low",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["step",["zoom"],["match",["get","class"],["street","street_limited","track","primary_link"],!0,!1],14,["match",["get","class"],["street","street_limited","track","primary_link","secondary_link","tertiary_link","service"],!0,!1]],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,["match",["get","class"],["street","street_limited","primary_link"],2,"track",1,.5],18,["match",["get","class"],["street","street_limited","primary_link"],18,12]],"line-color":"hsl(0, 0%, 100%)","line-opacity":["step",["zoom"],1,14,0]}},{id:"bridge-street-minor-case",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["step",["zoom"],["match",["get","class"],["street","street_limited","track","primary_link"],!0,!1],14,["match",["get","class"],["street","street_limited","track","primary_link","secondary_link","tertiary_link","service"],!0,!1]],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.75,20,2],"line-opacity":["step",["zoom"],0,14,1],"line-gap-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,["match",["get","class"],["street","street_limited","primary_link"],2,"track",1,.5],18,["match",["get","class"],["street","street_limited","primary_link"],18,12]],"line-color":"hsl(156, 12%, 92%)"}},{id:"bridge-primary-secondary-tertiary-case",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["match",["get","class"],["primary","secondary","tertiary"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],10,["match",["get","class"],"primary",1,.75],18,2],"line-opacity":["step",["zoom"],0,10,1],"line-gap-width":["interpolate",["exponential",1.5],["zoom"],5,["match",["get","class"],"primary",.75,.1],18,["match",["get","class"],"primary",32,26]],"line-color":"hsl(156, 12%, 92%)"}},{id:"bridge-major-link-case",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["match",["get","class"],["motorway_link","trunk_link"],!0,!1],["<=",["get","layer"],1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.75,20,2],"line-gap-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-color":"hsl(156, 12%, 92%)"}},{id:"bridge-motorway-trunk-case",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["match",["get","class"],["motorway","trunk"],!0,!1],["<=",["get","layer"],1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],10,1,18,2],"line-gap-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32],"line-color":"hsl(156, 12%, 92%)"}},{id:"bridge-construction",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:14,filter:["all",["==",["get","structure"],"bridge"],["==",["get","class"],"construction"],["==",["geometry-type"],"LineString"]],layout:{},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,2,18,18],"line-dasharray":["step",["zoom"],["literal",[.4,.8]],15,["literal",[.3,.6]],16,["literal",[.2,.3]],17,["literal",[.2,.25]],18,["literal",[.15,.15]]],"line-color":"hsl(156, 0%, 100%)"}},{id:"bridge-path",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["==",["get","class"],"path"],["!=",["get","type"],"steps"],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],15,1,18,4],"line-color":"hsl(0, 0%, 100%)","line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.75,1]],16,["literal",[1,.75]],17,["literal",[1,.5]]]}},{id:"bridge-steps",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:14,filter:["all",["==",["get","type"],"steps"],["==",["get","structure"],"bridge"],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],15,1,16,1.6,18,6],"line-color":"hsl(0, 0%, 100%)","line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.75,1]],16,["literal",[1,.75]],17,["literal",[.3,.3]]]}},{id:"bridge-major-link",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["match",["get","class"],["motorway_link","trunk_link"],!0,!1],["<=",["get","layer"],1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-color":"hsl(0, 0%, 100%)"}},{id:"bridge-pedestrian",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["==",["get","class"],"pedestrian"],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,.5,18,12],"line-color":"hsl(0, 0%, 100%)","line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.5,.4]],16,["literal",[1,.2]]]}},{id:"bridge-street-minor",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["step",["zoom"],["match",["get","class"],["street","street_limited","track","primary_link"],!0,!1],14,["match",["get","class"],["street","street_limited","track","primary_link","secondary_link","tertiary_link","service"],!0,!1]],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,["match",["get","class"],["street","street_limited","primary_link"],2,"track",1,.5],18,["match",["get","class"],["street","street_limited","primary_link"],18,12]],"line-color":"hsl(0, 0%, 100%)","line-opacity":["step",["zoom"],0,14,1]}},{id:"bridge-primary-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["match",["get","class"],["primary","secondary","tertiary"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],5,["match",["get","class"],"primary",.75,.1],18,["match",["get","class"],"primary",32,26]],"line-color":"hsl(0, 0%, 100%)"}},{id:"bridge-motorway-trunk",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["match",["get","class"],["motorway","trunk"],!0,!1],["<=",["get","layer"],1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32],"line-color":"hsl(0, 0%, 100%)"}},{id:"bridge-rail",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["match",["get","class"],["major_rail","minor_rail"],!0,!1]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,.5,20,1],"line-color":"hsl(156, 12%, 92%)"}},{id:"bridge-major-link-2-case",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],[">=",["get","layer"],2],["match",["get","class"],["motorway_link","trunk_link"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.75,20,2],"line-color":"hsl(156, 12%, 92%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18]}},{id:"bridge-motorway-trunk-2-case",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],[">=",["get","layer"],2],["match",["get","class"],["motorway","trunk"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],10,1,18,2],"line-color":"hsl(156, 12%, 92%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32]}},{id:"bridge-major-link-2",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],[">=",["get","layer"],2],["match",["get","class"],["motorway_link","trunk_link"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-color":"hsl(0, 0%, 100%)"}},{id:"bridge-motorway-trunk-2",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],[">=",["get","layer"],2],["match",["get","class"],["motorway","trunk"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32],"line-color":"hsl(0, 0%, 100%)"}},{id:"admin-1-boundary-bg",type:"line",metadata:{"mapbox:group":"1444934295202.7542"},source:"composite","source-layer":"admin",filter:["all",["==",["get","admin_level"],1],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","US"],!0,!1]],layout:{"line-join":"bevel"},paint:{"line-blur":["interpolate",["linear"],["zoom"],3,0,8,3],"line-width":["interpolate",["linear"],["zoom"],7,3.75,12,5.5],"line-opacity":["interpolate",["linear"],["zoom"],7,0,8,.75],"line-dasharray":[1,0],"line-translate":[0,0],"line-color":"hsl(0, 0%, 84%)"}},{id:"admin-0-boundary-bg",type:"line",metadata:{"mapbox:group":"1444934295202.7542"},source:"composite","source-layer":"admin",minzoom:1,filter:["all",["==",["get","admin_level"],0],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","US"],!0,!1]],paint:{"line-width":["interpolate",["linear"],["zoom"],3,3.5,10,8],"line-color":"hsl(0, 0%, 84%)","line-opacity":["interpolate",["linear"],["zoom"],3,0,4,.5],"line-translate":[0,0],"line-blur":["interpolate",["linear"],["zoom"],3,0,10,2]}},{id:"admin-1-boundary",type:"line",metadata:{"mapbox:group":"1444934295202.7542"},source:"composite","source-layer":"admin",filter:["all",["==",["get","admin_level"],1],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","US"],!0,!1]],layout:{"line-join":"round","line-cap":"round"},paint:{"line-width":["interpolate",["linear"],["zoom"],7,.75,12,1.5],"line-opacity":["interpolate",["linear"],["zoom"],2,0,3,1],"line-color":["interpolate",["linear"],["zoom"],3,"hsl(0, 0%, 80%)",7,"hsl(0, 0%, 70%)"]}},{id:"admin-0-boundary",type:"line",metadata:{"mapbox:group":"1444934295202.7542"},source:"composite","source-layer":"admin",minzoom:1,filter:["all",["==",["get","admin_level"],0],["==",["get","disputed"],"false"],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","US"],!0,!1]],layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 62%)","line-width":["interpolate",["linear"],["zoom"],3,.5,10,2]}},{id:"admin-0-boundary-disputed",type:"line",metadata:{"mapbox:group":"1444934295202.7542"},source:"composite","source-layer":"admin",minzoom:1,filter:["all",["==",["get","disputed"],"true"],["==",["get","admin_level"],0],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","US"],!0,!1]],layout:{"line-join":"round"},paint:{"line-dasharray":[1.5,1.5],"line-color":"hsl(0, 0%, 62%)","line-width":["interpolate",["linear"],["zoom"],3,.5,10,2]}},{id:"county_border",type:"line",metadata:{"mapbox:group":"1444934295202.7542"},source:"composite","source-layer":"attr_county_labels_pg-155yvu",minzoom:6,maxzoom:12,paint:{"line-width":["interpolate",["linear"],["zoom"],5,.5,9,1.7,18,2],"line-color":"hsl(0, 0%, 59%)","line-opacity":["interpolate",["linear"],["zoom"],5,.2,9,.5,18,1]}},{id:"cousub_border",type:"line",source:"composite","source-layer":"attr_cousub_labels_less_pl-9lemol",minzoom:8,maxzoom:14,layout:{},paint:{"line-color":"hsl(0, 3%, 38%)","line-width":["interpolate",["linear"],["zoom"],0,1,6,1,22,1],"line-opacity":["interpolate",["linear"],["zoom"],7,.1,18,.2]}},{id:"place_border",type:"line",source:"composite","source-layer":"attr_place_labels_less_pl-0n1bxr",minzoom:8,maxzoom:14,paint:{"line-color":"hsla(0, 0%, 58%, 0.62)","line-dasharray":[3,2]}},{id:"road-label",type:"symbol",source:"composite","source-layer":"road",minzoom:10,filter:["step",["zoom"],["match",["get","class"],["motorway","trunk","primary","secondary","tertiary"],!0,!1],12,["match",["get","class"],["motorway","trunk","primary","secondary","tertiary","pedestrian","street","street_limited"],!0,!1],15,["match",["get","class"],["ferry","golf","path"],!1,!0]],layout:{"text-size":["interpolate",["linear"],["zoom"],10,["match",["get","class"],["motorway","trunk","primary","secondary","tertiary"],10,["motorway_link","trunk_link","primary_link","secondary_link","tertiary_link","pedestrian","street","street_limited"],9,6.5],18,["match",["get","class"],["motorway","trunk","primary","secondary","tertiary"],16,["motorway_link","trunk_link","primary_link","secondary_link","tertiary_link","pedestrian","street","street_limited"],14,13]],"text-max-angle":30,"text-font":["DIN Offc Pro Regular","Arial Unicode MS Regular"],"symbol-placement":"line","text-padding":1,"text-rotation-alignment":"map","text-pitch-alignment":"viewport","text-field":["coalesce",["get","name_en"],["get","name"]],"text-letter-spacing":.01},paint:{"text-color":"hsl(0, 0%, 42%)","text-halo-color":["match",["get","class"],["motorway","trunk"],"hsla(0, 0%, 100%, 0.75)","hsl(0, 0%, 100%)"],"text-halo-blur":1,"text-halo-width":.1}},{id:"waterway-label",type:"symbol",source:"composite","source-layer":"natural_label",minzoom:13,filter:["all",["match",["get","class"],["canal","river","stream"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"text-font":["DIN Offc Pro Italic","Arial Unicode MS Regular"],"text-max-angle":30,"symbol-spacing":["interpolate",["linear",1],["zoom"],15,250,17,400],"text-size":["interpolate",["linear"],["zoom"],13,12,18,16],"symbol-placement":"line","text-pitch-alignment":"viewport","text-field":["coalesce",["get","name_en"],["get","name"]]},paint:{"text-color":"hsl(187, 7%, 51%)"}},{id:"natural-line-label",type:"symbol",source:"composite","source-layer":"natural_label",minzoom:4,filter:["all",["match",["get","class"],["glacier","landform"],!0,!1],["==",["geometry-type"],"LineString"],["<=",["get","filterrank"],1]],layout:{"text-size":["step",["zoom"],["step",["get","sizerank"],18,5,12],17,["step",["get","sizerank"],18,13,12]],"text-max-angle":30,"text-field":["coalesce",["get","name_en"],["get","name"]],"text-font":["DIN Offc Pro Medium","Arial Unicode MS Regular"],"symbol-placement":"line-center","text-pitch-alignment":"viewport"},paint:{"text-halo-width":.5,"text-halo-color":"hsl(0, 0%, 100%)","text-halo-blur":.5,"text-color":"hsl(0, 0%, 42%)"}},{id:"natural-point-label",type:"symbol",source:"composite","source-layer":"natural_label",minzoom:4,filter:["all",["match",["get","class"],["dock","glacier","landform","water_feature","wetland"],!0,!1],["==",["geometry-type"],"Point"],["<=",["get","filterrank"],1]],layout:{"text-size":["step",["zoom"],["step",["get","sizerank"],18,5,12],17,["step",["get","sizerank"],18,13,12]],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-font":["DIN Offc Pro Medium","Arial Unicode MS Regular"],"text-offset":["literal",[0,0]]},paint:{"text-color":"hsl(0, 0%, 42%)","text-halo-color":"hsl(0, 0%, 100%)","text-halo-width":.5,"text-halo-blur":.5}},{id:"water-line-label",type:"symbol",source:"composite","source-layer":"natural_label",filter:["all",["match",["get","class"],["bay","ocean","reservoir","sea","water"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"text-size":["interpolate",["linear"],["zoom"],7,["step",["get","sizerank"],24,6,18,12,12],10,["step",["get","sizerank"],18,9,12],18,["step",["get","sizerank"],18,9,16]],"text-max-angle":30,"text-letter-spacing":["match",["get","class"],"ocean",.25,["sea","bay"],.15,0],"text-font":["DIN Offc Pro Italic","Arial Unicode MS Regular"],"symbol-placement":"line-center","text-pitch-alignment":"viewport","text-field":["coalesce",["get","name_en"],["get","name"]]},paint:{"text-color":"hsl(187, 7%, 51%)"}},{id:"water-point-label",type:"symbol",source:"composite","source-layer":"natural_label",filter:["all",["match",["get","class"],["bay","ocean","reservoir","sea","water"],!0,!1],["==",["geometry-type"],"Point"]],layout:{"text-line-height":1.3,"text-size":["interpolate",["linear"],["zoom"],7,["step",["get","sizerank"],24,6,18,12,12],10,["step",["get","sizerank"],18,9,12]],"text-font":["DIN Offc Pro Italic","Arial Unicode MS Regular"],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-letter-spacing":["match",["get","class"],"ocean",.25,["bay","sea"],.15,.01],"text-max-width":["match",["get","class"],"ocean",4,"sea",5,["bay","water"],7,10]},paint:{"text-color":"hsl(187, 7%, 51%)"}},{id:"poi-label",type:"symbol",source:"composite","source-layer":"poi_label",minzoom:6,filter:["<=",["get","filterrank"],1],layout:{"text-size":["step",["zoom"],["step",["get","sizerank"],18,5,12],17,["step",["get","sizerank"],18,13,12]],"text-font":["DIN Offc Pro Medium","Arial Unicode MS Regular"],"text-field":["coalesce",["get","name_en"],["get","name"]]},paint:{"text-halo-color":"hsl(0, 0%, 100%)","text-halo-width":.1,"text-halo-blur":.5,"text-color":["step",["zoom"],["step",["get","sizerank"],"hsl(0, 0%, 66%)",5,"hsl(230, 0%, 56%)"],17,["step",["get","sizerank"],"hsl(0, 0%, 66%)",13,"hsl(0, 0%, 56%)"]]}},{id:"airport-label",type:"symbol",source:"composite","source-layer":"airport_label",minzoom:8,layout:{"text-line-height":1.1,"text-size":["step",["get","sizerank"],18,9,12],"icon-image":["step",["get","sizerank"],["concat",["get","maki"],"-15"],9,["concat",["get","maki"],"-11"]],"text-font":["DIN Offc Pro Medium","Arial Unicode MS Regular"],visibility:"none","text-offset":[0,.75],"text-rotation-alignment":"viewport","text-anchor":"top","text-field":["step",["get","sizerank"],["coalesce",["get","name_en"],["get","name"]],15,["get","ref"]],"text-letter-spacing":.01,"text-max-width":9},paint:{"text-color":"hsla(0, 0%, 42%, 0)","text-halo-color":"hsl(0, 0%, 100%)","text-halo-width":1,"text-opacity":0}},{id:"settlement-subdivision-label",type:"symbol",source:"composite","source-layer":"place_label",minzoom:10,maxzoom:15,filter:["all",["==",["get","class"],"settlement_subdivision"],["<=",["get","filterrank"],4]],layout:{"text-field":["coalesce",["get","name_en"],["get","name"]],"text-transform":"uppercase","text-font":["DIN Offc Pro Regular","Arial Unicode MS Regular"],"text-letter-spacing":["match",["get","type"],"suburb",.15,.1],"text-max-width":7,"text-padding":3,"text-size":["interpolate",["cubic-bezier",.5,0,1,1],["zoom"],11,["match",["get","type"],"suburb",11,10.5],15,["match",["get","type"],"suburb",17,16]],visibility:"none"},paint:{"text-halo-color":"hsl(0, 0%, 100%)","text-color":"hsl(0, 0%, 62%)","text-halo-blur":.5,"text-halo-width":.1}},{id:"state-label",type:"symbol",source:"composite","source-layer":"place_label",minzoom:3,maxzoom:9,filter:["==",["get","class"],"state"],layout:{"text-size":["interpolate",["cubic-bezier",.85,.7,.65,1],["zoom"],4,["step",["get","symbolrank"],10,6,9.5,7,9],9,["step",["get","symbolrank"],24,6,18,7,14]],"text-transform":"uppercase","text-font":["DIN Offc Pro Bold","Arial Unicode MS Bold"],"text-field":["step",["zoom"],["step",["get","symbolrank"],["coalesce",["get","name_en"],["get","name"]],5,["coalesce",["get","abbr"],["get","name_en"],["get","name"]]],5,["coalesce",["get","name_en"],["get","name"]]],"text-letter-spacing":.15,"text-max-width":6},paint:{"text-halo-color":"hsl(0, 0%, 100%)","text-color":"hsl(0, 0%, 66%)","text-halo-width":.1}},{id:"county_label",type:"symbol",source:"composite","source-layer":"attr_county_labels-5i5o0f",minzoom:7.5,maxzoom:14,layout:{"text-field":["step",["zoom"],["upcase",["to-string",["get","name"]]],6,["upcase",["to-string",["get","name"]]],10,["upcase",["to-string",["get","namelsad"]]],22,["upcase",["to-string",["get","namelsad"]]]],"text-font":["step",["zoom"],["literal",["Open Sans Regular","Arial Unicode MS Regular"]],6,["literal",["Montserrat Medium","Arial Unicode MS Regular"]],8,["literal",["Montserrat Medium","Arial Unicode MS Regular"]],11,["literal",["Montserrat Medium","Arial Unicode MS Regular"]],22,["literal",["Montserrat Medium","Arial Unicode MS Regular"]]],"text-size":["interpolate",["linear"],["zoom"],0,0,6,6,6.5,10,7.5,14,9,30,11,75,14,85],"text-allow-overlap":["step",["zoom"],!1,5,!1,10,!1,11,!0],"text-max-width":5,"text-ignore-placement":["step",["zoom"],!1,6,!1,9,!0,12,!0,22,!0]},paint:{"text-color":"hsl(0, 0%, 48%)","text-opacity":["interpolate",["linear"],["zoom"],6.49999,1,6.5,.7,8,.3,11,.1,16,.05]}},{id:"cousub_label",type:"symbol",source:"composite","source-layer":"attr_cousub_labels_plus_pt-0kx5lj",minzoom:9,layout:{"text-field":["upcase",["get","display_name"]],"text-size":["interpolate",["linear"],["zoom"],7.9,0,8,8,9,10,14,30],"text-max-width":5,"text-line-height":1.1,visibility:"none"},paint:{"text-color":"hsla(0, 0%, 31%, 0.76)","text-halo-width":10,"text-halo-color":"hsl(0, 0%, 100%)"}},{id:"place-label new",type:"symbol",source:"composite","source-layer":"rural_places-4rf4i9",minzoom:9,filter:["match",["get","census_boundary_year"],[2020],!0,!1],layout:{"text-line-height":1.1,"text-size":["interpolate",["cubic-bezier",.2,0,.9,1],["zoom"],3,["step",["get","symbolrank"],12,9,11,10,10.5,12,9.5,14,8.5,16,6.5,17,4],15,["step",["get","symbolrank"],28,9,26,10,23,11,21,12,20,13,19,15,17]],"icon-image":["case",["==",["get","capital"],2],"border-dot-13",["step",["get","symbolrank"],"dot-11",9,"dot-10",11,"dot-9"]],"text-font":["Montserrat Medium","Arial Unicode MS Regular"],"text-justify":["step",["zoom"],["match",["get","text_anchor"],["left","bottom-left","top-left"],"left",["right","bottom-right","top-right"],"right","center"],8,"center"],visibility:"none","text-offset":["step",["zoom"],["match",["get","capital"],2,["match",["get","text_anchor"],"bottom",["literal",[0,-.3]],"bottom-left",["literal",[.3,-.1]],"left",["literal",[.45,.1]],"top-left",["literal",[.3,.1]],"top",["literal",[0,.3]],"top-right",["literal",[-.3,.1]],"right",["literal",[-.45,0]],"bottom-right",["literal",[-.3,-.1]],["literal",[0,-.3]]],["match",["get","text_anchor"],"bottom",["literal",[0,-.25]],"bottom-left",["literal",[.2,-.05]],"left",["literal",[.4,.05]],"top-left",["literal",[.2,.05]],"top",["literal",[0,.25]],"top-right",["literal",[-.2,.05]],"right",["literal",[-.4,.05]],"bottom-right",["literal",[-.2,-.05]],["literal",[0,-.25]]]],8,["literal",[0,0]]],"text-anchor":["step",["zoom"],["get","text_anchor"],8,"center"],"text-field":["coalesce",["get","NAME"]],"text-max-width":7},paint:{"text-color":["step",["get","symbolrank"],"hsl(0, 2%, 61%)",11,"hsl(0, 1%, 68%)",16,"hsl(0, 1%, 75%)"],"text-halo-color":"hsl(0, 0%, 100%)","icon-opacity":["step",["zoom"],1,8,0],"text-halo-blur":1,"text-halo-width":.1}},{id:"settlement-label",type:"symbol",source:"composite","source-layer":"place_label",maxzoom:10.76,filter:["all",["<=",["get","filterrank"],3],["==",["get","class"],"settlement"],["step",["zoom"],!0,12,[">=",["get","symbolrank"],11],13,[">=",["get","symbolrank"],12]]],layout:{"text-line-height":1.1,"text-size":["interpolate",["cubic-bezier",.2,0,.9,1],["zoom"],3,["step",["get","symbolrank"],12,9,11,10,10.5,12,9.5,14,8.5,16,6.5,17,4],15,["step",["get","symbolrank"],28,9,26,10,23,11,21,12,20,13,19,15,17]],"icon-image":["case",["==",["get","capital"],2],"border-dot-13",["step",["get","symbolrank"],"dot-11",9,"dot-10",11,"dot-9"]],"text-font":["step",["zoom"],["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]],8,["step",["get","symbolrank"],["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]],11,["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]]],10,["step",["get","symbolrank"],["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]],12,["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]]],11,["step",["get","symbolrank"],["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]],13,["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]]],12,["step",["get","symbolrank"],["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]],15,["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]]],13,["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]]],"text-justify":["step",["zoom"],["match",["get","text_anchor"],["left","bottom-left","top-left"],"left",["right","bottom-right","top-right"],"right","center"],8,"center"],"text-offset":["step",["zoom"],["match",["get","capital"],2,["match",["get","text_anchor"],"bottom",["literal",[0,-.3]],"bottom-left",["literal",[.3,-.1]],"left",["literal",[.45,.1]],"top-left",["literal",[.3,.1]],"top",["literal",[0,.3]],"top-right",["literal",[-.3,.1]],"right",["literal",[-.45,0]],"bottom-right",["literal",[-.3,-.1]],["literal",[0,-.3]]],["match",["get","text_anchor"],"bottom",["literal",[0,-.25]],"bottom-left",["literal",[.2,-.05]],"left",["literal",[.4,.05]],"top-left",["literal",[.2,.05]],"top",["literal",[0,.25]],"top-right",["literal",[-.2,.05]],"right",["literal",[-.4,.05]],"bottom-right",["literal",[-.2,-.05]],["literal",[0,-.25]]]],8,["literal",[0,0]]],"text-anchor":["step",["zoom"],["get","text_anchor"],8,"center"],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-max-width":7},paint:{"text-color":["step",["get","symbolrank"],"hsl(0, 0%, 42%)",11,"hsl(0, 0%, 55%)",16,"hsl(0, 0%, 62%)"],"text-halo-color":"hsl(0, 0%, 100%)","icon-opacity":["step",["zoom"],1,8,0],"text-halo-blur":1,"text-halo-width":.1}},{id:"wwb2s-places_lat_lon",type:"symbol",source:"composite","source-layer":"places_lat_lon-awryh9",minzoom:10.75,maxzoom:20,filter:["all",[">=",["get","pop"],101],[">",["get","pct_rural"],0],["step",["zoom"],!0,13,[">=",["get","symbolrank"],11],14,[">=",["get","symbolrank"],13]]],layout:{"text-line-height":1.1,"text-size":["step",["get","symbolrank"],20,9,18,10,16,11,14,12,12],"icon-image":["case",["==",["get","capital"],2],"border-dot-13",["step",["get","symbolrank"],"dot-11",9,"dot-10",11,"dot-9"]],"text-font":["step",["zoom"],["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]],8,["step",["get","symbolrank"],["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]],11,["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]]],10,["step",["get","symbolrank"],["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]],12,["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]]],11,["step",["get","symbolrank"],["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]],13,["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]]],12,["step",["get","symbolrank"],["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]],15,["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]]],13,["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]]],"text-justify":["step",["zoom"],["match",["get","text_anchor"],["left","bottom-left","top-left"],"left",["right","bottom-right","top-right"],"right","center"],8,"center"],"text-offset":["step",["zoom"],["match",["get","capital"],2,["match",["get","text_anchor"],"bottom",["literal",[0,-.3]],"bottom-left",["literal",[.3,-.1]],"left",["literal",[.45,.1]],"top-left",["literal",[.3,.1]],"top",["literal",[0,.3]],"top-right",["literal",[-.3,.1]],"right",["literal",[-.45,0]],"bottom-right",["literal",[-.3,-.1]],["literal",[0,-.3]]],["match",["get","text_anchor"],"bottom",["literal",[0,-.25]],"bottom-left",["literal",[.2,-.05]],"left",["literal",[.4,.05]],"top-left",["literal",[.2,.05]],"top",["literal",[0,.25]],"top-right",["literal",[-.2,.05]],"right",["literal",[-.4,.05]],"bottom-right",["literal",[-.2,-.05]],["literal",[0,-.25]]]],8,["literal",[0,0]]],"text-anchor":["step",["zoom"],["get","text_anchor"],8,"center"],"text-field":["coalesce",["get","NAME"],["get","name"]],"text-max-width":7},paint:{"text-halo-color":"hsl(0, 0%, 100%)","icon-opacity":["step",["zoom"],1,8,0],"text-halo-blur":1,"text-halo-width":.1,"text-color":["interpolate",["linear"],["zoom"],0,"hsl(0, 0%, 62%)",22,"#000000"],"text-opacity":["interpolate",["linear"],["zoom"],7,0,9,.97,22,1]}},{id:"custom-pattern",type:"fill",source:"composite","source-layer":"attr_county_labels_pg-155yvu",minzoom:6,layout:{visibility:"none"},paint:{"fill-color":"hsla(303, 73%, 74%, 0.66)","fill-pattern":"stripe-4"}}],bF="2022-02-24T13:16:14.872Z",EF="2024-07-11T16:18:50.102Z",TF="cl010e7b7001p15pe3l0306hv",SF="ruralinno",AF="private",CF=!1,IF={version:hF,name:dF,metadata:pF,center:fF,zoom:mF,bearing:gF,pitch:_F,sources:yF,sprite:vF,glyphs:xF,layers:wF,created:bF,modified:EF,id:TF,owner:SF,visibility:AF,protected:!1,draft:CF};/* + * Frontend UI component library for the CORI Data API + * {@link https://github.com/ruralinnovation/cori.data.api} + * @copyright Rural Innovation Strategies, Inc. + * @license ISC + */Object.assign({},IF);function Zp(e){let n="https://mui.com/production-error/?code="+e;for(let l=1;l0?Nr(vh,--Pi):0,uh--,yr===10&&(uh=1,D_--),yr}function Wi(){return yr=Pi2||Xp(yr)>3?"":" "}function GF(e,n){for(;--n&&Wi()&&!(yr<48||yr>102||yr>57&&yr<65||yr>70&&yr<97););return of(e,bg()+(n<6&&ws()==32&&Wi()==32))}function m1(e){for(;Wi();)switch(yr){case e:return Pi;case 34:case 39:e!==34&&e!==39&&m1(yr);break;case 40:e===41&&m1(e);break;case 92:Wi();break}return Pi}function qF(e,n){for(;Wi()&&e+yr!==47+10;)if(e+yr===42+42&&ws()===47)break;return"/*"+of(n,Pi-1)+"*"+R_(e===47?e:Wi())}function WF(e){for(;!Xp(ws());)Wi();return of(e,Pi)}function ZF(e){return BI(Tg("",null,null,null,[""],e=OI(e),0,[0],e))}function Tg(e,n,l,h,m,v,E,s,k){for(var D=0,V=0,G=E,J=0,ve=0,ae=0,me=1,Ce=1,ie=1,te=0,le="",ze=m,Oe=v,Ke=h,He=le;Ce;)switch(ae=te,te=Wi()){case 40:if(ae!=108&&Nr(He,G-1)==58){f1(He+=yn(Eg(te),"&","&\f"),"&\f")!=-1&&(ie=-1);break}case 34:case 39:case 91:He+=Eg(te);break;case 9:case 10:case 13:case 32:He+=$F(ae);break;case 92:He+=GF(bg()-1,7);continue;case 47:switch(ws()){case 42:case 47:rg(HF(qF(Wi(),bg()),n,l),k);break;default:He+="/"}break;case 123*me:s[D++]=_s(He)*ie;case 125*me:case 59:case 0:switch(te){case 0:case 125:Ce=0;case 59+V:ie==-1&&(He=yn(He,/\f/g,"")),ve>0&&_s(He)-G&&rg(ve>32?OT(He+";",h,l,G-1):OT(yn(He," ","")+";",h,l,G-2),k);break;case 59:He+=";";default:if(rg(Ke=DT(He,n,l,D,V,m,s,le,ze=[],Oe=[],G),v),te===123)if(V===0)Tg(He,n,Ke,Ke,ze,v,G,s,Oe);else switch(J===99&&Nr(He,3)===110?100:J){case 100:case 108:case 109:case 115:Tg(e,Ke,Ke,h&&rg(DT(e,Ke,Ke,0,0,m,s,le,m,ze=[],G),Oe),m,Oe,G,s,h?ze:Oe);break;default:Tg(He,Ke,Ke,Ke,[""],Oe,0,s,Oe)}}D=V=ve=0,me=ie=1,le=He="",G=E;break;case 58:G=1+_s(He),ve=ae;default:if(me<1){if(te==123)--me;else if(te==125&&me++==0&&VF()==125)continue}switch(He+=R_(te),te*me){case 38:ie=V>0?1:(He+="\f",-1);break;case 44:s[D++]=(_s(He)-1)*ie,ie=1;break;case 64:ws()===45&&(He+=Eg(Wi())),J=ws(),V=G=_s(le=He+=WF(bg())),te++;break;case 45:ae===45&&_s(He)==2&&(me=0)}}return v}function DT(e,n,l,h,m,v,E,s,k,D,V){for(var G=m-1,J=m===0?v:[""],ve=Lx(J),ae=0,me=0,Ce=0;ae0?J[ie]+" "+te:yn(te,/&\f/g,J[ie])))&&(k[Ce++]=le);return O_(e,n,l,m===0?Px:s,k,D,V)}function HF(e,n,l){return O_(e,n,l,zI,R_(jF()),Hp(e,2,-2),0)}function OT(e,n,l,h){return O_(e,n,l,zx,Hp(e,0,h),Hp(e,h+1,-1),h)}function Qu(e,n){for(var l="",h=Lx(e),m=0;m6)switch(Nr(e,n+1)){case 109:if(Nr(e,n+4)!==45)break;case 102:return yn(e,/(.+:)(.+)-([^]+)/,"$1"+_n+"$2-$3$1"+i_+(Nr(e,n+3)==108?"$3":"$2-$3"))+e;case 115:return~f1(e,"stretch")?FI(yn(e,"stretch","fill-available"),n)+e:e}break;case 4949:if(Nr(e,n+1)!==115)break;case 6444:switch(Nr(e,_s(e)-3-(~f1(e,"!important")&&10))){case 107:return yn(e,":",":"+_n)+e;case 101:return yn(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+_n+(Nr(e,14)===45?"inline-":"")+"box$3$1"+_n+"$2$3$1"+ei+"$2box$3")+e}break;case 5936:switch(Nr(e,n+11)){case 114:return _n+e+ei+yn(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return _n+e+ei+yn(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return _n+e+ei+yn(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return _n+e+ei+e+e}return e}var r6=function(n,l,h,m){if(n.length>-1&&!n.return)switch(n.type){case zx:n.return=FI(n.value,n.length);break;case LI:return Qu([lp(n,{value:yn(n.value,"@","@"+_n)})],m);case Px:if(n.length)return UF(n.props,function(v){switch(NF(v,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Qu([lp(n,{props:[yn(v,/:(read-\w+)/,":"+i_+"$1")]})],m);case"::placeholder":return Qu([lp(n,{props:[yn(v,/:(plac\w+)/,":"+_n+"input-$1")]}),lp(n,{props:[yn(v,/:(plac\w+)/,":"+i_+"$1")]}),lp(n,{props:[yn(v,/:(plac\w+)/,ei+"input-$1")]})],m)}return""})}},i6=[r6],o6=function(n){var l=n.key;if(l==="css"){var h=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(h,function(me){var Ce=me.getAttribute("data-emotion");Ce.indexOf(" ")!==-1&&(document.head.appendChild(me),me.setAttribute("data-s",""))})}var m=n.stylisPlugins||i6,v={},E,s=[];E=n.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+l+' "]'),function(me){for(var Ce=me.getAttribute("data-emotion").split(" "),ie=1;ie{n[l]=VI(e[l])}),n}function ea(e,n,l={clone:!0}){const h=l.clone?Bn({},e):e;return Pu(e)&&Pu(n)&&Object.keys(n).forEach(m=>{Pu(n[m])&&Object.prototype.hasOwnProperty.call(e,m)&&Pu(e[m])?h[m]=ea(e[m],n[m],l):l.clone?h[m]=Pu(n[m])?VI(n[m]):n[m]:h[m]=n[m]}),h}const p6=["values","unit","step"],f6=e=>{const n=Object.keys(e).map(l=>({key:l,val:e[l]}))||[];return n.sort((l,h)=>l.val-h.val),n.reduce((l,h)=>Bn({},l,{[h.key]:h.val}),{})};function m6(e){const{values:n={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:l="px",step:h=5}=e,m=pl(e,p6),v=f6(n),E=Object.keys(v);function s(J){return`@media (min-width:${typeof n[J]=="number"?n[J]:J}${l})`}function k(J){return`@media (max-width:${(typeof n[J]=="number"?n[J]:J)-h/100}${l})`}function D(J,ve){const ae=E.indexOf(ve);return`@media (min-width:${typeof n[J]=="number"?n[J]:J}${l}) and (max-width:${(ae!==-1&&typeof n[E[ae]]=="number"?n[E[ae]]:ve)-h/100}${l})`}function V(J){return E.indexOf(J)+1`@media (min-width:${Rx[e]}px)`};function oa(e,n,l){const h=e.theme||{};if(Array.isArray(n)){const v=h.breakpoints||FT;return n.reduce((E,s,k)=>(E[v.up(v.keys[k])]=l(n[k]),E),{})}if(typeof n=="object"){const v=h.breakpoints||FT;return Object.keys(n).reduce((E,s)=>{if(Object.keys(v.values||Rx).indexOf(s)!==-1){const k=v.up(s);E[k]=l(n[s],s)}else{const k=s;E[k]=n[k]}return E},{})}return l(n)}function y6(e={}){var n;return((n=e.keys)==null?void 0:n.reduce((h,m)=>{const v=e.up(m);return h[v]={},h},{}))||{}}function v6(e,n){return e.reduce((l,h)=>{const m=l[h];return(!m||Object.keys(m).length===0)&&delete l[h],l},n)}function $I(e){if(typeof e!="string")throw new Error(Zp(7));return e.charAt(0).toUpperCase()+e.slice(1)}function F_(e,n,l=!0){if(!n||typeof n!="string")return null;if(e&&e.vars&&l){const h=`vars.${n}`.split(".").reduce((m,v)=>m&&m[v]?m[v]:null,e);if(h!=null)return h}return n.split(".").reduce((h,m)=>h&&h[m]!=null?h[m]:null,e)}function o_(e,n,l,h=l){let m;return typeof e=="function"?m=e(l):Array.isArray(e)?m=e[l]||h:m=F_(e,l)||h,n&&(m=n(m,h,e)),m}function cr(e){const{prop:n,cssProperty:l=e.prop,themeKey:h,transform:m}=e,v=E=>{if(E[n]==null)return null;const s=E[n],k=E.theme,D=F_(k,h)||{};return oa(E,s,G=>{let J=o_(D,m,G);return G===J&&typeof G=="string"&&(J=o_(D,m,`${n}${G==="default"?"":$I(G)}`,G)),l===!1?J:{[l]:J}})};return v.propTypes={},v.filterProps=[n],v}function x6(e){const n={};return l=>(n[l]===void 0&&(n[l]=e(l)),n[l])}const w6={m:"margin",p:"padding"},b6={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},NT={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},E6=x6(e=>{if(e.length>2)if(NT[e])e=NT[e];else return[e];const[n,l]=e.split(""),h=w6[n],m=b6[l]||"";return Array.isArray(m)?m.map(v=>h+v):[h+m]}),Dx=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Ox=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...Dx,...Ox];function sf(e,n,l,h){var m;const v=(m=F_(e,n,!1))!=null?m:l;return typeof v=="number"?E=>typeof E=="string"?E:v*E:Array.isArray(v)?E=>typeof E=="string"?E:v[E]:typeof v=="function"?v:()=>{}}function GI(e){return sf(e,"spacing",8)}function af(e,n){if(typeof n=="string"||n==null)return n;const l=Math.abs(n),h=e(l);return n>=0?h:typeof h=="number"?-h:`-${h}`}function T6(e,n){return l=>e.reduce((h,m)=>(h[m]=af(n,l),h),{})}function S6(e,n,l,h){if(n.indexOf(l)===-1)return null;const m=E6(l),v=T6(m,h),E=e[l];return oa(e,E,v)}function qI(e,n){const l=GI(e.theme);return Object.keys(e).map(h=>S6(e,n,h,l)).reduce(Tp,{})}function rr(e){return qI(e,Dx)}rr.propTypes={};rr.filterProps=Dx;function ir(e){return qI(e,Ox)}ir.propTypes={};ir.filterProps=Ox;function A6(e=8){if(e.mui)return e;const n=GI({spacing:e}),l=(...h)=>(h.length===0?[1]:h).map(v=>{const E=n(v);return typeof E=="number"?`${E}px`:E}).join(" ");return l.mui=!0,l}function N_(...e){const n=e.reduce((h,m)=>(m.filterProps.forEach(v=>{h[v]=m}),h),{}),l=h=>Object.keys(h).reduce((m,v)=>n[v]?Tp(m,n[v](h)):m,{});return l.propTypes={},l.filterProps=e.reduce((h,m)=>h.concat(m.filterProps),[]),l}function ho(e){return typeof e!="number"?e:`${e}px solid`}function yo(e,n){return cr({prop:e,themeKey:"borders",transform:n})}const C6=yo("border",ho),I6=yo("borderTop",ho),k6=yo("borderRight",ho),M6=yo("borderBottom",ho),P6=yo("borderLeft",ho),z6=yo("borderColor"),L6=yo("borderTopColor"),R6=yo("borderRightColor"),D6=yo("borderBottomColor"),O6=yo("borderLeftColor"),B6=yo("outline",ho),F6=yo("outlineColor"),U_=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const n=sf(e.theme,"shape.borderRadius",4),l=h=>({borderRadius:af(n,h)});return oa(e,e.borderRadius,l)}return null};U_.propTypes={};U_.filterProps=["borderRadius"];N_(C6,I6,k6,M6,P6,z6,L6,R6,D6,O6,U_,B6,F6);const j_=e=>{if(e.gap!==void 0&&e.gap!==null){const n=sf(e.theme,"spacing",8),l=h=>({gap:af(n,h)});return oa(e,e.gap,l)}return null};j_.propTypes={};j_.filterProps=["gap"];const V_=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const n=sf(e.theme,"spacing",8),l=h=>({columnGap:af(n,h)});return oa(e,e.columnGap,l)}return null};V_.propTypes={};V_.filterProps=["columnGap"];const $_=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const n=sf(e.theme,"spacing",8),l=h=>({rowGap:af(n,h)});return oa(e,e.rowGap,l)}return null};$_.propTypes={};$_.filterProps=["rowGap"];const N6=cr({prop:"gridColumn"}),U6=cr({prop:"gridRow"}),j6=cr({prop:"gridAutoFlow"}),V6=cr({prop:"gridAutoColumns"}),$6=cr({prop:"gridAutoRows"}),G6=cr({prop:"gridTemplateColumns"}),q6=cr({prop:"gridTemplateRows"}),W6=cr({prop:"gridTemplateAreas"}),Z6=cr({prop:"gridArea"});N_(j_,V_,$_,N6,U6,j6,V6,$6,G6,q6,W6,Z6);function eh(e,n){return n==="grey"?n:e}const H6=cr({prop:"color",themeKey:"palette",transform:eh}),X6=cr({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:eh}),K6=cr({prop:"backgroundColor",themeKey:"palette",transform:eh});N_(H6,X6,K6);function Vi(e){return e<=1&&e!==0?`${e*100}%`:e}const Y6=cr({prop:"width",transform:Vi}),Bx=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const n=l=>{var h,m;const v=((h=e.theme)==null||(h=h.breakpoints)==null||(h=h.values)==null?void 0:h[l])||Rx[l];return v?((m=e.theme)==null||(m=m.breakpoints)==null?void 0:m.unit)!=="px"?{maxWidth:`${v}${e.theme.breakpoints.unit}`}:{maxWidth:v}:{maxWidth:Vi(l)}};return oa(e,e.maxWidth,n)}return null};Bx.filterProps=["maxWidth"];const J6=cr({prop:"minWidth",transform:Vi}),Q6=cr({prop:"height",transform:Vi}),eN=cr({prop:"maxHeight",transform:Vi}),tN=cr({prop:"minHeight",transform:Vi});cr({prop:"size",cssProperty:"width",transform:Vi});cr({prop:"size",cssProperty:"height",transform:Vi});const nN=cr({prop:"boxSizing"});N_(Y6,Bx,J6,Q6,eN,tN,nN);const rN={border:{themeKey:"borders",transform:ho},borderTop:{themeKey:"borders",transform:ho},borderRight:{themeKey:"borders",transform:ho},borderBottom:{themeKey:"borders",transform:ho},borderLeft:{themeKey:"borders",transform:ho},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:ho},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:U_},color:{themeKey:"palette",transform:eh},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:eh},backgroundColor:{themeKey:"palette",transform:eh},p:{style:ir},pt:{style:ir},pr:{style:ir},pb:{style:ir},pl:{style:ir},px:{style:ir},py:{style:ir},padding:{style:ir},paddingTop:{style:ir},paddingRight:{style:ir},paddingBottom:{style:ir},paddingLeft:{style:ir},paddingX:{style:ir},paddingY:{style:ir},paddingInline:{style:ir},paddingInlineStart:{style:ir},paddingInlineEnd:{style:ir},paddingBlock:{style:ir},paddingBlockStart:{style:ir},paddingBlockEnd:{style:ir},m:{style:rr},mt:{style:rr},mr:{style:rr},mb:{style:rr},ml:{style:rr},mx:{style:rr},my:{style:rr},margin:{style:rr},marginTop:{style:rr},marginRight:{style:rr},marginBottom:{style:rr},marginLeft:{style:rr},marginX:{style:rr},marginY:{style:rr},marginInline:{style:rr},marginInlineStart:{style:rr},marginInlineEnd:{style:rr},marginBlock:{style:rr},marginBlockStart:{style:rr},marginBlockEnd:{style:rr},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:j_},rowGap:{style:$_},columnGap:{style:V_},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Vi},maxWidth:{style:Bx},minWidth:{transform:Vi},height:{transform:Vi},maxHeight:{transform:Vi},minHeight:{transform:Vi},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}},Fx=rN;function iN(...e){const n=e.reduce((h,m)=>h.concat(Object.keys(m)),[]),l=new Set(n);return e.every(h=>l.size===Object.keys(h).length)}function oN(e,n){return typeof e=="function"?e(n):e}function sN(){function e(l,h,m,v){const E={[l]:h,theme:m},s=v[l];if(!s)return{[l]:h};const{cssProperty:k=l,themeKey:D,transform:V,style:G}=s;if(h==null)return null;if(D==="typography"&&h==="inherit")return{[l]:h};const J=F_(m,D)||{};return G?G(E):oa(E,h,ae=>{let me=o_(J,V,ae);return ae===me&&typeof ae=="string"&&(me=o_(J,V,`${l}${ae==="default"?"":$I(ae)}`,ae)),k===!1?me:{[k]:me}})}function n(l){var h;const{sx:m,theme:v={}}=l||{};if(!m)return null;const E=(h=v.unstable_sxConfig)!=null?h:Fx;function s(k){let D=k;if(typeof k=="function")D=k(v);else if(typeof k!="object")return k;if(!D)return null;const V=y6(v.breakpoints),G=Object.keys(V);let J=V;return Object.keys(D).forEach(ve=>{const ae=oN(D[ve],v);if(ae!=null)if(typeof ae=="object")if(E[ve])J=Tp(J,e(ve,ae,v,E));else{const me=oa({theme:v},ae,Ce=>({[ve]:Ce}));iN(me,ae)?J[ve]=n({sx:ae,theme:v}):J=Tp(J,me)}else J=Tp(J,e(ve,ae,v,E))}),v6(G,J)}return Array.isArray(m)?m.map(s):s(m)}return n}const WI=sN();WI.filterProps=["sx"];const ZI=WI;function aN(e,n){const l=this;return l.vars&&typeof l.getColorSchemeSelector=="function"?{[l.getColorSchemeSelector(e).replace(/(\[[^\]]+\])/,"*:where($1)")]:n}:l.palette.mode===e?n:{}}const lN=["breakpoints","palette","spacing","shape"];function cN(e={},...n){const{breakpoints:l={},palette:h={},spacing:m,shape:v={}}=e,E=pl(e,lN),s=m6(l),k=A6(m);let D=ea({breakpoints:s,direction:"ltr",components:{},palette:Bn({mode:"light"},h),spacing:k,shape:Bn({},_6,v)},E);return D.applyStyles=aN,D=n.reduce((V,G)=>ea(V,G),D),D.unstable_sxConfig=Bn({},Fx,E==null?void 0:E.unstable_sxConfig),D.unstable_sx=function(G){return ZI({sx:G,theme:this})},D}function uN(e){return Object.keys(e).length===0}function hN(e=null){const n=ut.useContext(NI);return!n||uN(n)?e:n}function dN(e,n=Number.MIN_SAFE_INTEGER,l=Number.MAX_SAFE_INTEGER){return Math.max(n,Math.min(e,l))}const pN=Object.freeze(Object.defineProperty({__proto__:null,default:dN},Symbol.toStringTag,{value:"Module"})),fN=ut.createContext(null),HI=fN;function XI(){return ut.useContext(HI)}const mN=typeof Symbol=="function"&&Symbol.for,gN=mN?Symbol.for("mui.nested"):"__THEME_NESTED__";function _N(e,n){return typeof n=="function"?n(e):Bn({},e,n)}function yN(e){const{children:n,theme:l}=e,h=XI(),m=ut.useMemo(()=>{const v=h===null?l:_N(h,l);return v!=null&&(v[gN]=h!==null),v},[l,h]);return Ka.jsx(HI.Provider,{value:m,children:n})}const vN=["value"],xN=ut.createContext();function wN(e){let{value:n}=e,l=pl(e,vN);return Ka.jsx(xN.Provider,Bn({value:n??!0},l))}const bN=ut.createContext(void 0);function EN({value:e,children:n}){return Ka.jsx(bN.Provider,{value:e,children:n})}const UT={};function jT(e,n,l,h=!1){return ut.useMemo(()=>{const m=e&&n[e]||n;if(typeof l=="function"){const v=l(m),E=e?Bn({},n,{[e]:v}):v;return h?()=>E:E}return e?Bn({},n,{[e]:l}):Bn({},n,l)},[e,n,l,h])}function TN(e){const{children:n,theme:l,themeId:h}=e,m=hN(UT),v=XI()||UT,E=jT(h,m,l),s=jT(h,v,l,!0),k=E.direction==="rtl";return Ka.jsx(yN,{theme:s,children:Ka.jsx(NI.Provider,{value:E,children:Ka.jsx(wN,{value:k,children:Ka.jsx(EN,{value:E==null?void 0:E.components,children:n})})})})}function SN(e,n){return Bn({toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}}},n)}var ur={},KI={exports:{}};(function(e){function n(l){return l&&l.__esModule?l:{default:l}}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(KI);var AN=KI.exports;const CN=XT(kF),IN=XT(pN);var YI=AN;Object.defineProperty(ur,"__esModule",{value:!0});ur.alpha=tk;ur.blend=jN;ur.colorChannel=void 0;var kN=ur.darken=Ux;ur.decomposeColor=_o;ur.emphasize=nk;var MN=ur.getContrastRatio=ON;ur.getLuminance=s_;ur.hexToRgb=JI;ur.hslToRgb=ek;var PN=ur.lighten=jx;ur.private_safeAlpha=BN;ur.private_safeColorChannel=void 0;ur.private_safeDarken=FN;ur.private_safeEmphasize=UN;ur.private_safeLighten=NN;ur.recomposeColor=xh;ur.rgbToHex=DN;var VT=YI(CN),zN=YI(IN);function Nx(e,n=0,l=1){return(0,zN.default)(e,n,l)}function JI(e){e=e.slice(1);const n=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let l=e.match(n);return l&&l[0].length===1&&(l=l.map(h=>h+h)),l?`rgb${l.length===4?"a":""}(${l.map((h,m)=>m<3?parseInt(h,16):Math.round(parseInt(h,16)/255*1e3)/1e3).join(", ")})`:""}function LN(e){const n=e.toString(16);return n.length===1?`0${n}`:n}function _o(e){if(e.type)return e;if(e.charAt(0)==="#")return _o(JI(e));const n=e.indexOf("("),l=e.substring(0,n);if(["rgb","rgba","hsl","hsla","color"].indexOf(l)===-1)throw new Error((0,VT.default)(9,e));let h=e.substring(n+1,e.length-1),m;if(l==="color"){if(h=h.split(" "),m=h.shift(),h.length===4&&h[3].charAt(0)==="/"&&(h[3]=h[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(m)===-1)throw new Error((0,VT.default)(10,m))}else h=h.split(",");return h=h.map(v=>parseFloat(v)),{type:l,values:h,colorSpace:m}}const QI=e=>{const n=_o(e);return n.values.slice(0,3).map((l,h)=>n.type.indexOf("hsl")!==-1&&h!==0?`${l}%`:l).join(" ")};ur.colorChannel=QI;const RN=(e,n)=>{try{return QI(e)}catch{return e}};ur.private_safeColorChannel=RN;function xh(e){const{type:n,colorSpace:l}=e;let{values:h}=e;return n.indexOf("rgb")!==-1?h=h.map((m,v)=>v<3?parseInt(m,10):m):n.indexOf("hsl")!==-1&&(h[1]=`${h[1]}%`,h[2]=`${h[2]}%`),n.indexOf("color")!==-1?h=`${l} ${h.join(" ")}`:h=`${h.join(", ")}`,`${n}(${h})`}function DN(e){if(e.indexOf("#")===0)return e;const{values:n}=_o(e);return`#${n.map((l,h)=>LN(h===3?Math.round(255*l):l)).join("")}`}function ek(e){e=_o(e);const{values:n}=e,l=n[0],h=n[1]/100,m=n[2]/100,v=h*Math.min(m,1-m),E=(D,V=(D+l/30)%12)=>m-v*Math.max(Math.min(V-3,9-V,1),-1);let s="rgb";const k=[Math.round(E(0)*255),Math.round(E(8)*255),Math.round(E(4)*255)];return e.type==="hsla"&&(s+="a",k.push(n[3])),xh({type:s,values:k})}function s_(e){e=_o(e);let n=e.type==="hsl"||e.type==="hsla"?_o(ek(e)).values:e.values;return n=n.map(l=>(e.type!=="color"&&(l/=255),l<=.03928?l/12.92:((l+.055)/1.055)**2.4)),Number((.2126*n[0]+.7152*n[1]+.0722*n[2]).toFixed(3))}function ON(e,n){const l=s_(e),h=s_(n);return(Math.max(l,h)+.05)/(Math.min(l,h)+.05)}function tk(e,n){return e=_o(e),n=Nx(n),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${n}`:e.values[3]=n,xh(e)}function BN(e,n,l){try{return tk(e,n)}catch{return e}}function Ux(e,n){if(e=_o(e),n=Nx(n),e.type.indexOf("hsl")!==-1)e.values[2]*=1-n;else if(e.type.indexOf("rgb")!==-1||e.type.indexOf("color")!==-1)for(let l=0;l<3;l+=1)e.values[l]*=1-n;return xh(e)}function FN(e,n,l){try{return Ux(e,n)}catch{return e}}function jx(e,n){if(e=_o(e),n=Nx(n),e.type.indexOf("hsl")!==-1)e.values[2]+=(100-e.values[2])*n;else if(e.type.indexOf("rgb")!==-1)for(let l=0;l<3;l+=1)e.values[l]+=(255-e.values[l])*n;else if(e.type.indexOf("color")!==-1)for(let l=0;l<3;l+=1)e.values[l]+=(1-e.values[l])*n;return xh(e)}function NN(e,n,l){try{return jx(e,n)}catch{return e}}function nk(e,n=.15){return s_(e)>.5?Ux(e,n):jx(e,n)}function UN(e,n,l){try{return nk(e,n)}catch{return e}}function jN(e,n,l,h=1){const m=(k,D)=>Math.round((k**(1/h)*(1-l)+D**(1/h)*l)**h),v=_o(e),E=_o(n),s=[m(v.values[0],E.values[0]),m(v.values[1],E.values[1]),m(v.values[2],E.values[2])];return xh({type:"rgb",values:s})}const VN={black:"#000",white:"#fff"},Kp=VN,$N={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},GN=$N,qN={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},Au=qN,WN={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},Cu=WN,ZN={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},cp=ZN,HN={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},Iu=HN,XN={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},ku=XN,KN={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},Mu=KN,YN=["mode","contrastThreshold","tonalOffset"],$T={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:Kp.white,default:Kp.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},av={text:{primary:Kp.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:Kp.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function GT(e,n,l,h){const m=h.light||h,v=h.dark||h*1.5;e[n]||(e.hasOwnProperty(l)?e[n]=e[l]:n==="light"?e.light=PN(e.main,m):n==="dark"&&(e.dark=kN(e.main,v)))}function JN(e="light"){return e==="dark"?{main:Iu[200],light:Iu[50],dark:Iu[400]}:{main:Iu[700],light:Iu[400],dark:Iu[800]}}function QN(e="light"){return e==="dark"?{main:Au[200],light:Au[50],dark:Au[400]}:{main:Au[500],light:Au[300],dark:Au[700]}}function eU(e="light"){return e==="dark"?{main:Cu[500],light:Cu[300],dark:Cu[700]}:{main:Cu[700],light:Cu[400],dark:Cu[800]}}function tU(e="light"){return e==="dark"?{main:ku[400],light:ku[300],dark:ku[700]}:{main:ku[700],light:ku[500],dark:ku[900]}}function nU(e="light"){return e==="dark"?{main:Mu[400],light:Mu[300],dark:Mu[700]}:{main:Mu[800],light:Mu[500],dark:Mu[900]}}function rU(e="light"){return e==="dark"?{main:cp[400],light:cp[300],dark:cp[700]}:{main:"#ed6c02",light:cp[500],dark:cp[900]}}function iU(e){const{mode:n="light",contrastThreshold:l=3,tonalOffset:h=.2}=e,m=pl(e,YN),v=e.primary||JN(n),E=e.secondary||QN(n),s=e.error||eU(n),k=e.info||tU(n),D=e.success||nU(n),V=e.warning||rU(n);function G(me){return MN(me,av.text.primary)>=l?av.text.primary:$T.text.primary}const J=({color:me,name:Ce,mainShade:ie=500,lightShade:te=300,darkShade:le=700})=>{if(me=Bn({},me),!me.main&&me[ie]&&(me.main=me[ie]),!me.hasOwnProperty("main"))throw new Error(Zp(11,Ce?` (${Ce})`:"",ie));if(typeof me.main!="string")throw new Error(Zp(12,Ce?` (${Ce})`:"",JSON.stringify(me.main)));return GT(me,"light",te,h),GT(me,"dark",le,h),me.contrastText||(me.contrastText=G(me.main)),me},ve={dark:av,light:$T};return ea(Bn({common:Bn({},Kp),mode:n,primary:J({color:v,name:"primary"}),secondary:J({color:E,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:J({color:s,name:"error"}),warning:J({color:V,name:"warning"}),info:J({color:k,name:"info"}),success:J({color:D,name:"success"}),grey:GN,contrastThreshold:l,getContrastText:G,augmentColor:J,tonalOffset:h},ve[n]),m)}const oU=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function sU(e){return Math.round(e*1e5)/1e5}const qT={textTransform:"uppercase"},WT='"Roboto", "Helvetica", "Arial", sans-serif';function aU(e,n){const l=typeof n=="function"?n(e):n,{fontFamily:h=WT,fontSize:m=14,fontWeightLight:v=300,fontWeightRegular:E=400,fontWeightMedium:s=500,fontWeightBold:k=700,htmlFontSize:D=16,allVariants:V,pxToRem:G}=l,J=pl(l,oU),ve=m/14,ae=G||(ie=>`${ie/D*ve}rem`),me=(ie,te,le,ze,Oe)=>Bn({fontFamily:h,fontWeight:ie,fontSize:ae(te),lineHeight:le},h===WT?{letterSpacing:`${sU(ze/te)}em`}:{},Oe,V),Ce={h1:me(v,96,1.167,-1.5),h2:me(v,60,1.2,-.5),h3:me(E,48,1.167,0),h4:me(E,34,1.235,.25),h5:me(E,24,1.334,0),h6:me(s,20,1.6,.15),subtitle1:me(E,16,1.75,.15),subtitle2:me(s,14,1.57,.1),body1:me(E,16,1.5,.15),body2:me(E,14,1.43,.15),button:me(s,14,1.75,.4,qT),caption:me(E,12,1.66,.4),overline:me(E,12,2.66,1,qT),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return ea(Bn({htmlFontSize:D,pxToRem:ae,fontFamily:h,fontSize:m,fontWeightLight:v,fontWeightRegular:E,fontWeightMedium:s,fontWeightBold:k},Ce),J,{clone:!1})}const lU=.2,cU=.14,uU=.12;function Un(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${lU})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${cU})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${uU})`].join(",")}const hU=["none",Un(0,2,1,-1,0,1,1,0,0,1,3,0),Un(0,3,1,-2,0,2,2,0,0,1,5,0),Un(0,3,3,-2,0,3,4,0,0,1,8,0),Un(0,2,4,-1,0,4,5,0,0,1,10,0),Un(0,3,5,-1,0,5,8,0,0,1,14,0),Un(0,3,5,-1,0,6,10,0,0,1,18,0),Un(0,4,5,-2,0,7,10,1,0,2,16,1),Un(0,5,5,-3,0,8,10,1,0,3,14,2),Un(0,5,6,-3,0,9,12,1,0,3,16,2),Un(0,6,6,-3,0,10,14,1,0,4,18,3),Un(0,6,7,-4,0,11,15,1,0,4,20,3),Un(0,7,8,-4,0,12,17,2,0,5,22,4),Un(0,7,8,-4,0,13,19,2,0,5,24,4),Un(0,7,9,-4,0,14,21,2,0,5,26,4),Un(0,8,9,-5,0,15,22,2,0,6,28,5),Un(0,8,10,-5,0,16,24,2,0,6,30,5),Un(0,8,11,-5,0,17,26,2,0,6,32,5),Un(0,9,11,-5,0,18,28,2,0,7,34,6),Un(0,9,12,-6,0,19,29,2,0,7,36,6),Un(0,10,13,-6,0,20,31,3,0,8,38,7),Un(0,10,13,-6,0,21,33,3,0,8,40,7),Un(0,10,14,-6,0,22,35,3,0,8,42,7),Un(0,11,14,-7,0,23,36,3,0,9,44,8),Un(0,11,15,-7,0,24,38,3,0,9,46,8)],dU=hU,pU=["duration","easing","delay"],fU={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},mU={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function ZT(e){return`${Math.round(e)}ms`}function gU(e){if(!e)return 0;const n=e/36;return Math.round((4+15*n**.25+n/5)*10)}function _U(e){const n=Bn({},fU,e.easing),l=Bn({},mU,e.duration);return Bn({getAutoHeightDuration:gU,create:(m=["all"],v={})=>{const{duration:E=l.standard,easing:s=n.easeInOut,delay:k=0}=v;return pl(v,pU),(Array.isArray(m)?m:[m]).map(D=>`${D} ${typeof E=="string"?E:ZT(E)} ${s} ${typeof k=="string"?k:ZT(k)}`).join(",")}},e,{easing:n,duration:l})}const yU={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},vU=yU,xU=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function wU(e={},...n){const{mixins:l={},palette:h={},transitions:m={},typography:v={}}=e,E=pl(e,xU);if(e.vars)throw new Error(Zp(18));const s=iU(h),k=cN(e);let D=ea(k,{mixins:SN(k.breakpoints,l),palette:s,shadows:dU.slice(),typography:aU(s,v),transitions:_U(m),zIndex:Bn({},vU)});return D=ea(D,E),D=n.reduce((V,G)=>ea(V,G),D),D.unstable_sxConfig=Bn({},Fx,E==null?void 0:E.unstable_sxConfig),D.unstable_sx=function(G){return ZI({sx:G,theme:this})},D}const bU=["theme"];function EU(e){let{theme:n}=e,l=pl(e,bU);const h=n[RT];return Ka.jsx(TN,Bn({},l,{themeId:h?RT:void 0,theme:h||n}))}var rk={exports:{}};(function(e,n){(function(l,h){e.exports=h()})(Go,function(){var l,h,m;function v(s,k){if(!l)l=k;else if(!h)h=k;else{var D="self.onerror = function() { console.error('An error occurred while parsing the WebWorker bundle. This is most likely due to improper transpilation by Babel; please see https://docs.mapbox.com/mapbox-gl-js/guides/install/#transpiling'); }; var sharedChunk = {}; ("+l+")(sharedChunk); ("+h+")(sharedChunk); self.onerror = null;",V={};l(V),m=k(V),typeof window<"u"&&window&&window.URL&&window.URL.createObjectURL&&(m.workerUrl=window.URL.createObjectURL(new Blob([D],{type:"text/javascript"})))}}v(["exports"],function(s){var k=typeof self<"u"?self:{},D="2.15.0";let V;const G={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){if(V==null){const r=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;try{V={}.API_URL_REGEX!=null?new RegExp({}.API_URL_REGEX):r}catch{V=r}}return V},get API_TILEJSON_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/v[0-9]*\/.*\.json.*$)/i},get API_SPRITE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*\/sprite.*\..*$)/i},get API_FONTS_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/fonts\/v[0-9]*\/)(.*\.pbf.*$)/i},get API_STYLE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*$)/i},get API_CDN_URL_REGEX(){return/^((https?:)?\/\/)?api\.mapbox\.c(n|om)(\/mapbox-gl-js\/)(.*$)/i},get EVENTS_URL(){if(!G.API_URL)return null;try{const r=new URL(G.API_URL);return r.hostname==="api.mapbox.cn"?"https://events.mapbox.cn/events/v2":r.hostname==="api.mapbox.com"?"https://events.mapbox.com/events/v2":null}catch{return null}},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},J={supported:!1,testSupport:function(r){!me&&ae&&(Ce?ie(r):ve=r)}};let ve,ae,me=!1,Ce=!1;function ie(r){const t=r.createTexture();r.bindTexture(r.TEXTURE_2D,t);try{if(r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,ae),r.isContextLost())return;J.supported=!0}catch{}r.deleteTexture(t),me=!0}k.document&&(ae=k.document.createElement("img"),ae.onload=function(){ve&&ie(ve),ve=null,Ce=!0},ae.onerror=function(){me=!0,ve=null},ae.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const te="01";function le(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var ze=Oe;function Oe(r,t,i,a){this.cx=3*r,this.bx=3*(i-r)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(a-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=r,this.p1y=t,this.p2x=i,this.p2y=a}Oe.prototype={sampleCurveX:function(r){return((this.ax*r+this.bx)*r+this.cx)*r},sampleCurveY:function(r){return((this.ay*r+this.by)*r+this.cy)*r},sampleCurveDerivativeX:function(r){return(3*this.ax*r+2*this.bx)*r+this.cx},solveCurveX:function(r,t){if(t===void 0&&(t=1e-6),r<0)return 0;if(r>1)return 1;for(var i=r,a=0;a<8;a++){var u=this.sampleCurveX(i)-r;if(Math.abs(u)u?g=i:y=i,i=.5*(y-g)+g;return i},solve:function(r,t){return this.sampleCurveY(this.solveCurveX(r,t))}};var Ke=le(ze),He=ht;function ht(r,t){this.x=r,this.y=t}ht.prototype={clone:function(){return new ht(this.x,this.y)},add:function(r){return this.clone()._add(r)},sub:function(r){return this.clone()._sub(r)},multByPoint:function(r){return this.clone()._multByPoint(r)},divByPoint:function(r){return this.clone()._divByPoint(r)},mult:function(r){return this.clone()._mult(r)},div:function(r){return this.clone()._div(r)},rotate:function(r){return this.clone()._rotate(r)},rotateAround:function(r,t){return this.clone()._rotateAround(r,t)},matMult:function(r){return this.clone()._matMult(r)},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(r){return this.x===r.x&&this.y===r.y},dist:function(r){return Math.sqrt(this.distSqr(r))},distSqr:function(r){var t=r.x-this.x,i=r.y-this.y;return t*t+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(r){return Math.atan2(this.y-r.y,this.x-r.x)},angleWith:function(r){return this.angleWithSep(r.x,r.y)},angleWithSep:function(r,t){return Math.atan2(this.x*t-this.y*r,this.x*r+this.y*t)},_matMult:function(r){var t=r[2]*this.x+r[3]*this.y;return this.x=r[0]*this.x+r[1]*this.y,this.y=t,this},_add:function(r){return this.x+=r.x,this.y+=r.y,this},_sub:function(r){return this.x-=r.x,this.y-=r.y,this},_mult:function(r){return this.x*=r,this.y*=r,this},_div:function(r){return this.x/=r,this.y/=r,this},_multByPoint:function(r){return this.x*=r.x,this.y*=r.y,this},_divByPoint:function(r){return this.x/=r.x,this.y/=r.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var r=this.y;return this.y=this.x,this.x=-r,this},_rotate:function(r){var t=Math.cos(r),i=Math.sin(r),a=i*this.x+t*this.y;return this.x=t*this.x-i*this.y,this.y=a,this},_rotateAround:function(r,t){var i=Math.cos(r),a=Math.sin(r),u=t.y+a*(this.x-t.x)+i*(this.y-t.y);return this.x=t.x+i*(this.x-t.x)-a*(this.y-t.y),this.y=u,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},ht.convert=function(r){return r instanceof ht?r:Array.isArray(r)?new ht(r[0],r[1]):r};var Ve=le(He);const jt=Math.PI/180,wr=180/Math.PI;function St(r){return r*jt}function Vt(r){return r*wr}const Vr=[[0,0],[1,0],[1,1],[0,1]];function $r(r){if(r<=0)return 0;if(r>=1)return 1;const t=r*r,i=t*r;return 4*(r<.5?i:3*(r-t)+i-.75)}function Li(r,t,i,a){const u=new Ke(r,t,i,a);return function(p){return u.solve(p)}}const Ki=Li(.25,.1,.25,1);function Je(r,t,i){return Math.min(i,Math.max(t,r))}function Tt(r,t,i){return(i=Je((i-r)/(t-r),0,1))*i*(3-2*i)}function xt(r,t,i){const a=i-t,u=((r-t)%a+a)%a+t;return u===t?i:u}function Bt(r,t,i){if(!r.length)return i(null,[]);let a=r.length;const u=new Array(r.length);let p=null;r.forEach((g,y)=>{t(g,(w,b)=>{w&&(p=w),u[y]=b,--a==0&&i(p,u)})})}function dn(r){const t=[];for(const i in r)t.push(r[i]);return t}function vn(r,...t){for(const i of t)for(const a in i)r[a]=i[a];return r}let sr=1;function ii(){return sr++}function ar(){return function r(t){return t?(t^Math.random()*(16>>t/4)).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,r)}()}function br(r){return r<=1?1:Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function Es(r){return!!r&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(r)}function Yi(r,t){r.forEach(i=>{t[i]&&(t[i]=t[i].bind(t))})}function xn(r,t){return r.indexOf(t,r.length-t.length)!==-1}function kt(r,t,i){const a={};for(const u in r)a[u]=t.call(i||this,r[u],u,r);return a}function Yo(r,t,i){const a={};for(const u in r)t.call(i||this,r[u],u,r)&&(a[u]=r[u]);return a}function Dr(r){return Array.isArray(r)?r.map(Dr):typeof r=="object"&&r?kt(r,Dr):r}const Jo={};function wn(r){Jo[r]||(typeof console<"u"&&console.warn(r),Jo[r]=!0)}function pi(r,t,i){return(i.y-r.y)*(t.x-r.x)>(t.y-r.y)*(i.x-r.x)}function Tc(r){let t=0;for(let i,a,u=0,p=r.length,g=p-1;u@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(i,a,u,p)=>{const g=u||p;return t[a]=!g||g.toLowerCase(),""}),t["max-age"]){const i=parseInt(t["max-age"],10);isNaN(i)?delete t["max-age"]:t["max-age"]=i}return t}let fl=null;function aa(r){if(fl==null){const t=r.navigator?r.navigator.userAgent:null;fl=!!r.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return fl}function ml(r){try{const t=k[r];return t.setItem("_mapbox_test_",1),t.removeItem("_mapbox_test_"),!0}catch{return!1}}function Qo(r,t){return[r[4*t],r[4*t+1],r[4*t+2],r[4*t+3]]}const la="mapbox-tiles";let Sc=500,Ac=50,fi,es;function gl(){try{return k.caches}catch{}}function Ts(){gl()&&!fi&&(fi=k.caches.open(la))}function ca(r){const t=r.indexOf("?");if(t<0)return r;const i=function(u){const p=u.indexOf("?");return p>0?u.slice(p+1).split("&"):[]}(r),a=i.filter(u=>{const p=u.split("=");return p[0]==="language"||p[0]==="worldview"});return a.length?`${r.slice(0,t)}?${a.join("&")}`:r.slice(0,t)}let _l=1/0;const Ss={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(Ss);class ts extends Error{constructor(t,i,a){i===401&&be(a)&&(t+=": you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes"),super(t),this.status=i,this.url=a}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}const As=vo()?()=>self.worker&&self.worker.referrer:()=>(k.location.protocol==="blob:"?k.parent:k).location.href,Cs=function(r,t){if(!(/^file:/.test(i=r.url)||/^file:/.test(As())&&!/^\w+:/.test(i))){if(k.fetch&&k.Request&&k.AbortController&&k.Request.prototype.hasOwnProperty("signal"))return function(a,u){const p=new k.AbortController,g=new k.Request(a.url,{method:a.method||"GET",body:a.body,credentials:a.credentials,headers:a.headers,referrer:As(),referrerPolicy:a.referrerPolicy,signal:p.signal});let y=!1,w=!1;const b=(A=g.url).indexOf("sku=")>0&&be(A);var A;a.type==="json"&&g.headers.set("Accept","application/json");const I=(L,R,F)=>{if(w)return;if(L&&L.message!=="SecurityError"&&wn(L.toString()),R&&F)return M(R);const $=Date.now();k.fetch(g).then(K=>{if(K.ok){const se=b?K.clone():null;return M(K,se,$)}return u(new ts(K.statusText,K.status,a.url))}).catch(K=>{K.name!=="AbortError"&&u(new Error(`${K.message} ${a.url}`))})},M=(L,R,F)=>{(a.type==="arrayBuffer"?L.arrayBuffer():a.type==="json"?L.json():L.text()).then($=>{w||(R&&F&&function(K,se,Y){if(Ts(),!fi)return;const re={status:se.status,statusText:se.statusText,headers:new k.Headers};se.headers.forEach((Ie,Te)=>re.headers.set(Te,Ie));const ue=oi(se.headers.get("Cache-Control")||"");if(ue["no-store"])return;ue["max-age"]&&re.headers.set("Expires",new Date(Y+1e3*ue["max-age"]).toUTCString());const ce=re.headers.get("Expires");ce&&(new Date(ce).getTime()-Y<42e4||function(Ie,Te){if(es===void 0)try{new Response(new ReadableStream),es=!0}catch{es=!1}es?Te(Ie.body):Ie.blob().then(Te)}(se,Ie=>{const Te=new k.Response(Ie,re);Ts(),fi&&fi.then(De=>De.put(ca(K.url),Te)).catch(De=>wn(De.message))}))}(g,R,F),y=!0,u(null,$,L.headers.get("Cache-Control"),L.headers.get("Expires")))}).catch($=>{w||u(new Error($.message))})};return b?function(L,R){if(Ts(),!fi)return R(null);const F=ca(L.url);fi.then($=>{$.match(F).then(K=>{const se=function(Y){if(!Y)return!1;const re=new Date(Y.headers.get("Expires")||0),ue=oi(Y.headers.get("Cache-Control")||"");return re>Date.now()&&!ue["no-cache"]}(K);$.delete(F),se&&$.put(F,K.clone()),R(null,K,se)}).catch(R)}).catch(R)}(g,I):I(null,null),{cancel:()=>{w=!0,y||p.abort()}}}(r,t);if(vo()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",r,t,void 0,!0)}var i;return function(a,u){const p=new k.XMLHttpRequest;p.open(a.method||"GET",a.url,!0),a.type==="arrayBuffer"&&(p.responseType="arraybuffer");for(const g in a.headers)p.setRequestHeader(g,a.headers[g]);return a.type==="json"&&(p.responseType="text",p.setRequestHeader("Accept","application/json")),p.withCredentials=a.credentials==="include",p.onerror=()=>{u(new Error(p.statusText))},p.onload=()=>{if((p.status>=200&&p.status<300||p.status===0)&&p.response!==null){let g=p.response;if(a.type==="json")try{g=JSON.parse(p.response)}catch(y){return u(y)}u(null,g,p.getResponseHeader("Cache-Control"),p.getResponseHeader("Expires"))}else u(new ts(p.statusText,p.status,a.url))},p.send(a.body),{cancel:()=>p.abort()}}(r,t)},ua=function(r,t){return Cs(vn(r,{type:"arrayBuffer"}),t)};function Cc(r){const t=k.document.createElement("a");return t.href=r,t.protocol===k.document.location.protocol&&t.host===k.document.location.host}const oe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let N,U;N=[],U=0;const ne=function(r,t){if(J.supported&&(r.headers||(r.headers={}),r.headers.accept="image/webp,*/*"),U>=G.MAX_PARALLEL_IMAGE_REQUESTS){const p={requestParameters:r,callback:t,cancelled:!1,cancel(){this.cancelled=!0}};return N.push(p),p}U++;let i=!1;const a=()=>{if(!i)for(i=!0,U--;N.length&&U{a(),p?t(p):g&&(k.createImageBitmap?function(b,A){const I=new k.Blob([new Uint8Array(b)],{type:"image/png"});k.createImageBitmap(I).then(M=>{A(null,M)}).catch(M=>{A(new Error(`Could not load image because of ${M.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})}(g,(b,A)=>t(b,A,y,w)):function(b,A){const I=new k.Image,M=k.URL;I.onload=()=>{A(null,I),M.revokeObjectURL(I.src),I.onload=null,k.requestAnimationFrame(()=>{I.src=oe})},I.onerror=()=>A(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 L=new k.Blob([new Uint8Array(b)],{type:"image/png"});I.src=b.byteLength?M.createObjectURL(L):oe}(g,(b,A)=>t(b,A,y,w)))});return{cancel:()=>{u.cancel(),a()}}},he="NO_ACCESS_TOKEN";function _e(r){return r.indexOf("mapbox:")===0}function be(r){return G.API_URL_REGEX.test(r)}function we(r){return G.API_CDN_URL_REGEX.test(r)}function ge(r){return G.API_STYLE_REGEX.test(r)&&!Pe(r)}function Pe(r){return G.API_SPRITE_REGEX.test(r)}const nt=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function rt(r){const t=r.match(nt);if(!t)throw new Error("Unable to parse URL object");return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]}}function Qe(r){const t=r.params.length?`?${r.params.join("&")}`:"";return`${r.protocol}://${r.authority}${r.path}${t}`}const Mt="mapbox.eventData";function Rt(r){if(!r)return null;const t=r.split(".");if(!t||t.length!==3)return null;try{return JSON.parse(decodeURIComponent(k.atob(t[1]).split("").map(i=>"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)).join("")))}catch{return null}}class Pt{constructor(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null}getStorageKey(t){const i=Rt(G.ACCESS_TOKEN);let a="";return a=i&&i.u?k.btoa(encodeURIComponent(i.u).replace(/%([0-9A-F]{2})/g,(u,p)=>String.fromCharCode(+("0x"+p)))):G.ACCESS_TOKEN||"",t?`${Mt}.${t}:${a}`:`${Mt}:${a}`}fetchEventData(){const t=ml("localStorage"),i=this.getStorageKey(),a=this.getStorageKey("uuid");if(t)try{const u=k.localStorage.getItem(i);u&&(this.eventData=JSON.parse(u));const p=k.localStorage.getItem(a);p&&(this.anonId=p)}catch{wn("Unable to read from LocalStorage")}}saveEventData(){const t=ml("localStorage"),i=this.getStorageKey(),a=this.getStorageKey("uuid");if(t)try{k.localStorage.setItem(a,this.anonId),Object.keys(this.eventData).length>=1&&k.localStorage.setItem(i,JSON.stringify(this.eventData))}catch{wn("Unable to write to LocalStorage")}}processRequests(t){}postEvent(t,i,a,u){if(!G.EVENTS_URL)return;const p=rt(G.EVENTS_URL);p.params.push(`access_token=${u||G.ACCESS_TOKEN||""}`);const g={event:this.type,created:new Date(t).toISOString()},y=i?vn(g,i):g,w={url:Qe(p),headers:{"Content-Type":"text/plain"},body:JSON.stringify([y])};this.pendingRequest=function(b,A){return Cs(vn(b,{method:"POST"}),A)}(w,b=>{this.pendingRequest=null,a(b),this.saveEventData(),this.processRequests(u)})}queueRequest(t,i){this.queue.push(t),this.processRequests(i)}}const Dt=new class extends Pt{constructor(r){super("appUserTurnstile"),this._customAccessToken=r}postTurnstileEvent(r,t){G.EVENTS_URL&&G.ACCESS_TOKEN&&Array.isArray(r)&&r.some(i=>_e(i)||be(i))&&this.queueRequest(Date.now(),t)}processRequests(r){if(this.pendingRequest||this.queue.length===0)return;this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const t=Rt(G.ACCESS_TOKEN),i=t?t.u:G.ACCESS_TOKEN;let a=i!==this.eventData.tokenU;Es(this.anonId)||(this.anonId=ar(),a=!0);const u=this.queue.shift();if(this.eventData.lastSuccess){const p=new Date(this.eventData.lastSuccess),g=new Date(u),y=(u-this.eventData.lastSuccess)/864e5;a=a||y>=1||y<-1||p.getDate()!==g.getDate()}else a=!0;a?this.postEvent(u,{sdkIdentifier:"mapbox-gl-js",sdkVersion:D,skuId:te,"enabled.telemetry":!1,userId:this.anonId},p=>{p||(this.eventData.lastSuccess=u,this.eventData.tokenU=i)},r):this.processRequests()}},Gt=Dt.postTurnstileEvent.bind(Dt),In=new class extends Pt{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(r,t,i,a){this.skuToken=t,this.errorCb=a,G.EVENTS_URL&&(i||G.ACCESS_TOKEN?this.queueRequest({id:r,timestamp:Date.now()},i):this.errorCb(new Error(he)))}processRequests(r){if(this.pendingRequest||this.queue.length===0)return;const{id:t,timestamp:i}=this.queue.shift();t&&this.success[t]||(this.anonId||this.fetchEventData(),Es(this.anonId)||(this.anonId=ar()),this.postEvent(i,{sdkIdentifier:"mapbox-gl-js",sdkVersion:D,skuId:te,skuToken:this.skuToken,userId:this.anonId},a=>{a?this.errorCb(a):t&&(this.success[t]=!0)},r))}},Vn=In.postMapLoadEvent.bind(In),Ir=new class extends Pt{constructor(){super("gljs.performance")}postPerformanceEvent(r,t){G.EVENTS_URL&&(r||G.ACCESS_TOKEN)&&this.queueRequest({timestamp:Date.now(),performanceData:t},r)}processRequests(r){if(this.pendingRequest||this.queue.length===0)return;const{timestamp:t,performanceData:i}=this.queue.shift(),a=function(u){const p=k.performance.getEntriesByType("resource"),g=k.performance.getEntriesByType("mark"),y=function(M){const L={};if(M){for(const R in M)if(R!=="other")for(const F of M[R]){const $=`${R}ResolveRangeMin`,K=`${R}ResolveRangeMax`,se=`${R}RequestCount`,Y=`${R}RequestCachedCount`;L[$]=Math.min(L[$]||1/0,F.startTime),L[K]=Math.max(L[K]||-1/0,F.responseEnd);const re=ue=>{L[ue]===void 0&&(L[ue]=0),++L[ue]};F.transferSize!==void 0&&F.transferSize===0&&re(Y),re(se)}}return L}(function(M,L){const R={};if(M)for(const F of M){const $=L(F);R[$]===void 0&&(R[$]=[]),R[$].push(F)}return R}(p,lf)),w=k.devicePixelRatio,b=k.navigator.connection||k.navigator.mozConnection||k.navigator.webkitConnection,A={counters:[],metadata:[],attributes:[]},I=(M,L,R)=>{R!=null&&M.push({name:L,value:R.toString()})};for(const M in y)I(A.counters,M,y[M]);if(u.interactionRange[0]!==1/0&&u.interactionRange[1]!==-1/0&&(I(A.counters,"interactionRangeMin",u.interactionRange[0]),I(A.counters,"interactionRangeMax",u.interactionRange[1])),g)for(const M of Object.keys(ha)){const L=ha[M],R=g.find(F=>F.name===L);R&&I(A.counters,L,R.startTime)}return I(A.counters,"visibilityHidden",u.visibilityHidden),I(A.attributes,"style",function(M){if(M)for(const L of M){const R=L.name.split("?")[0];if(ge(R)){const F=R.split("/").slice(-2);if(F.length===2)return`mapbox://styles/${F[0]}/${F[1]}`}}}(p)),I(A.attributes,"terrainEnabled",u.terrainEnabled?"true":"false"),I(A.attributes,"fogEnabled",u.fogEnabled?"true":"false"),I(A.attributes,"projection",u.projection),I(A.attributes,"zoom",u.zoom),I(A.metadata,"devicePixelRatio",w),I(A.metadata,"connectionEffectiveType",b?b.effectiveType:void 0),I(A.metadata,"navigatorUserAgent",k.navigator.userAgent),I(A.metadata,"screenWidth",k.screen.width),I(A.metadata,"screenHeight",k.screen.height),I(A.metadata,"windowWidth",k.innerWidth),I(A.metadata,"windowHeight",k.innerHeight),I(A.metadata,"mapWidth",u.width/w),I(A.metadata,"mapHeight",u.height/w),I(A.metadata,"webglRenderer",u.renderer),I(A.metadata,"webglVendor",u.vendor),I(A.metadata,"sdkVersion",D),I(A.metadata,"sdkIdentifier","mapbox-gl-js"),A}(i);for(const u of a.metadata);for(const u of a.counters);for(const u of a.attributes);this.postEvent(t,a,()=>{},r)}},tr=Ir.postPerformanceEvent.bind(Ir),Ji=new class extends Pt{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(r,t,i,a){if(!G.API_URL||!G.SESSION_PATH)return;const u=rt(G.API_URL+G.SESSION_PATH);u.params.push(`sku=${t||""}`),u.params.push(`access_token=${a||G.ACCESS_TOKEN||""}`);const p={url:Qe(u),headers:{"Content-Type":"text/plain"}};this.pendingRequest=function(g,y){return Cs(vn(g,{method:"GET"}),y)}(p,g=>{this.pendingRequest=null,i(g),this.saveEventData(),this.processRequests(a)})}getSessionAPI(r,t,i,a){this.skuToken=t,this.errorCb=a,G.SESSION_PATH&&G.API_URL&&(i||G.ACCESS_TOKEN?this.queueRequest({id:r,timestamp:Date.now()},i):this.errorCb(new Error(he)))}processRequests(r){if(this.pendingRequest||this.queue.length===0)return;const{id:t,timestamp:i}=this.queue.shift();t&&this.success[t]||this.getSession(i,this.skuToken,a=>{a?this.errorCb(a):t&&(this.success[t]=!0)},r)}},hr=Ji.getSessionAPI.bind(Ji),Or=new Set,ha={create:"create",load:"load",fullLoad:"fullLoad"},G_={mark(r){k.performance.mark(r)},measure(r,t,i){k.performance.measure(r,t,i)}};function lf(r){const t=r.name.split("?")[0];return we(t)&&t.includes("mapbox-gl.js")?"javascript":we(t)&&t.includes("mapbox-gl.css")?"css":function(i){return G.API_FONTS_REGEX.test(i)}(t)?"fontRange":Pe(t)?"sprite":ge(t)?"style":function(i){return G.API_TILEJSON_REGEX.test(i)}(t)?"tilejson":"other"}const Jt=k.performance;function wh(r){const t=r?r.url.toString():void 0;return Jt.getEntriesByName(t)}let yl,bh,Ic,Qi;const xo={now:()=>Ic!==void 0?Ic:k.performance.now(),setNow(r){Ic=r},restoreNow(){Ic=void 0},frame(r){const t=k.requestAnimationFrame(r);return{cancel:()=>k.cancelAnimationFrame(t)}},getImageData(r,t=0){const{width:i,height:a}=r;Qi||(Qi=k.document.createElement("canvas"));const u=Qi.getContext("2d",{willReadFrequently:!0});if(!u)throw new Error("failed to create canvas 2d context");return(i>Qi.width||a>Qi.height)&&(Qi.width=i,Qi.height=a),u.clearRect(-t,-t,i+2*t,a+2*t),u.drawImage(r,0,0,i,a),u.getImageData(-t,-t,i+2*t,a+2*t)},resolveURL:r=>(yl||(yl=k.document.createElement("a")),yl.href=r,yl.href),get devicePixelRatio(){return k.devicePixelRatio},get prefersReducedMotion(){return!!k.matchMedia&&(bh==null&&(bh=k.matchMedia("(prefers-reduced-motion: reduce)")),bh.matches)}};function Eh(r,t,i){i[r]&&i[r].indexOf(t)!==-1||(i[r]=i[r]||[],i[r].push(t))}function Th(r,t,i){if(i&&i[r]){const a=i[r].indexOf(t);a!==-1&&i[r].splice(a,1)}}class Is{constructor(t,i={}){vn(this,i),this.type=t}}class wo extends Is{constructor(t,i={}){super("error",vn({error:t},i))}}class vl{on(t,i){return this._listeners=this._listeners||{},Eh(t,i,this._listeners),this}off(t,i){return Th(t,i,this._listeners),Th(t,i,this._oneTimeListeners),this}once(t,i){return i?(this._oneTimeListeners=this._oneTimeListeners||{},Eh(t,i,this._oneTimeListeners),this):new Promise(a=>this.once(t,a))}fire(t,i){typeof t=="string"&&(t=new Is(t,i||{}));const a=t.type;if(this.listens(a)){t.target=this;const u=this._listeners&&this._listeners[a]?this._listeners[a].slice():[];for(const y of u)y.call(this,t);const p=this._oneTimeListeners&&this._oneTimeListeners[a]?this._oneTimeListeners[a].slice():[];for(const y of p)Th(a,y,this._oneTimeListeners),y.call(this,t);const g=this._eventedParent;g&&(vn(t,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),g.fire(t))}else t instanceof wo&&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,i){return this._eventedParent=t,this._eventedParentData=i,this}}var Re=JSON.parse('{"$version":8,"$root":{"version":{"required":true,"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"},"terrain":{"type":"terrain"},"fog":{"type":"fog"},"sources":{"required":true,"type":"sources"},"sprite":{"type":"string"},"glyphs":{"type":"string"},"transition":{"type":"transition"},"projection":{"type":"projection"},"layers":{"required":true,"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":true,"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":{}},"default":"xyz"},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"attribution":{"type":"string"},"promoteId":{"type":"promoteId"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster":{"type":{"required":true,"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":false},"*":{"type":"*"}},"source_raster_dem":{"type":{"required":true,"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":{}},"default":"mapbox"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_geojson":{"type":{"required":true,"type":"enum","values":{"geojson":{}}},"data":{"type":"*"},"maxzoom":{"type":"number","default":18},"attribution":{"type":"string"},"buffer":{"type":"number","default":128,"maximum":512,"minimum":0},"filter":{"type":"*"},"tolerance":{"type":"number","default":0.375},"cluster":{"type":"boolean","default":false},"clusterRadius":{"type":"number","default":50,"minimum":0},"clusterMaxZoom":{"type":"number"},"clusterMinPoints":{"type":"number"},"clusterProperties":{"type":"*"},"lineMetrics":{"type":"boolean","default":false},"generateId":{"type":"boolean","default":false},"promoteId":{"type":"promoteId"}},"source_video":{"type":{"required":true,"type":"enum","values":{"video":{}}},"urls":{"required":true,"type":"array","value":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_image":{"type":{"required":true,"type":"enum","values":{"image":{}}},"url":{"required":true,"type":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"layer":{"id":{"type":"string","required":true},"type":{"type":"enum","values":{"fill":{},"line":{},"symbol":{},"circle":{},"heatmap":{},"fill-extrusion":{},"raster":{},"hillshade":{},"background":{},"sky":{}},"required":true},"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_sky"],"layout_background":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_sky":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_fill":{"fill-sort-key":{"type":"number","expression":{"interpolated":false,"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":false,"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"},"fill-extrusion-edge-radius":{"type":"number","private":true,"default":0,"minimum":0,"maximum":1,"property-type":"constant"}},"layout_line":{"line-cap":{"type":"enum","values":{"butt":{},"round":{},"square":{}},"default":"butt","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-join":{"type":"enum","values":{"bevel":{},"round":{},"miter":{}},"default":"miter","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{"type":"number","default":2,"requires":[{"line-join":"miter"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-round-limit":{"type":"number","default":1.05,"requires":[{"line-join":"round"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-sort-key":{"type":"number","expression":{"interpolated":false,"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":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-spacing":{"type":"number","default":250,"minimum":1,"units":"pixels","requires":[{"symbol-placement":"line"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{"type":"boolean","default":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{"type":"enum","values":{"auto":{},"viewport-y":{},"source":{}},"default":"auto","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{"type":"boolean","default":false,"requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{"type":"boolean","default":false,"requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-optional":{"type":"boolean","default":false,"requires":["icon-image","text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"],"expression":{"interpolated":false,"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":true,"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":false,"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":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-image":{"type":"resolvedImage","tokens":true,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{"type":"number","default":0,"period":360,"units":"degrees","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{"type":"boolean","default":false,"requires":["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-offset":{"type":"array","value":"number","length":2,"default":[0,0],"requires":["icon-image"],"expression":{"interpolated":true,"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":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-field":{"type":"formatted","default":"","tokens":true,"expression":{"interpolated":false,"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":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size":{"type":"number","default":16,"minimum":0,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{"type":"number","default":10,"minimum":0,"units":"ems","requires":["text-field",{"symbol-placement":["point"]}],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{"type":"number","default":1.2,"units":"ems","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{"type":"number","default":0,"units":"ems","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-justify":{"type":"enum","values":{"auto":{},"left":{},"center":{},"right":{}},"default":"center","requires":["text-field"],"expression":{"interpolated":false,"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":true,"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":false,"parameters":["zoom"]},"property-type":"data-constant"},"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":false,"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":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-writing-mode":{"type":"array","value":"enum","values":{"horizontal":{},"vertical":{}},"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotate":{"type":"number","default":0,"period":360,"units":"degrees","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-keep-upright":{"type":"boolean","default":true,"requires":["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-transform":{"type":"enum","values":{"none":{},"uppercase":{},"lowercase":{}},"default":"none","requires":["text-field"],"expression":{"interpolated":false,"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":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{"type":"boolean","default":false,"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{"type":"boolean","default":false,"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-optional":{"type":"boolean","default":false,"requires":["text-field","icon-image"],"expression":{"interpolated":false,"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_symbol":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature","pitch","distance-from-center"]}},"filter_fill":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_line":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_circle":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_fill-extrusion":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_heatmap":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_operator":{"type":"enum","values":{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},"in":{},"!in":{},"all":{},"any":{},"none":{},"has":{},"!has":{},"within":{}}},"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":false}},"function_stop":{"type":"array","minimum":0,"maximum":24,"value":["number","color"],"length":2},"expression":{"type":"array","value":"*","minimum":1},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"high-color":{"type":"color","property-type":"data-constant","default":"#245cdf","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"space-color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"horizon-blend":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,0.2,7,0.1],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"star-intensity":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],5,0.35,6,0],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":{},"viewport":{}},"property-type":"data-constant","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"projection":{"name":{"type":"enum","values":{"albers":{},"equalEarth":{},"equirectangular":{},"lambertConformalConic":{},"mercator":{},"naturalEarth":{},"winkelTripel":{},"globe":{}},"default":"mercator","required":true},"center":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-180,-90],"maximum":[180,90],"transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]},"parallels":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-90,-90],"maximum":[90,90],"transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]}},"terrain":{"source":{"type":"string","required":true},"exaggeration":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1000,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"requires":["source"]}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"fill-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{"type":"color","transition":true,"requires":[{"!":"fill-pattern"},{"fill-antialias":true}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["fill-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"fill-extrusion-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["fill-extrusion-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"units":"meters","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"units":"meters","transition":true,"requires":["fill-extrusion-height"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant","type":"number","private":true,"default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant","type":"number","private":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"requires":["fill-extrusion-edge-radius"]},"fill-extrusion-rounded-roof":{"type":"boolean","default":true,"requires":["fill-extrusion-edge-radius"],"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_line":{"line-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"line-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["line-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"line-width":{"type":"number","default":1,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{"type":"array","value":"number","minimum":0,"transition":false,"units":"line widths","requires":[{"!":"line-pattern"}],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{"type":"color","transition":false,"requires":[{"!":"line-pattern"},{"source":"geojson","has":{"lineMetrics":true}}],"expression":{"interpolated":true,"parameters":["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{"type":"array","value":"number","length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"transition":false,"requires":[{"source":"geojson","has":{"lineMetrics":true}}],"property-type":"constant"}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["circle-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{}},"default":"viewport","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"transition":false,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"heatmap-color":{"type":"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"transition":false,"expression":{"interpolated":true,"parameters":["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_symbol":{"icon-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{"type":"color","default":"#000000","transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["icon-image","icon-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{"type":"color","default":"#000000","transition":true,"overridable":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["text-field","text-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_raster":{"raster-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{"type":"number","default":0,"period":360,"transition":true,"units":"degrees","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-resampling":{"type":"enum","values":{"linear":{},"nearest":{}},"default":"linear","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"transition":false,"units":"milliseconds","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"transition":false,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"viewport","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{"type":"number","default":0.5,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_background":{"background-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"background-pattern"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":{},"atmosphere":{}},"default":"atmosphere","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"requires":[{"sky-type":"atmosphere"}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{"type":"number","requires":[{"sky-type":"atmosphere"}],"default":10,"minimum":0,"maximum":100,"transition":false,"property-type":"data-constant"},"sky-gradient-center":{"type":"array","requires":[{"sky-type":"gradient"}],"value":"number","default":[0,0],"length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{"type":"number","requires":[{"sky-type":"gradient"}],"default":90,"minimum":0,"maximum":180,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"transition":false,"requires":[{"sky-type":"gradient"}],"expression":{"interpolated":true,"parameters":["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-atmosphere-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"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"},"color-ramp":{"type":"property-type"},"data-constant":{"type":"property-type"},"constant":{"type":"property-type"}},"promoteId":{"*":{"type":"string"}}}');function bo(r,...t){for(const i of t)for(const a in i)r[a]=i[a];return r}function $n(r){return r instanceof Number||r instanceof String||r instanceof Boolean?r.valueOf():r}function dr(r){if(Array.isArray(r))return r.map(dr);if(r instanceof Object&&!(r instanceof Number||r instanceof String||r instanceof Boolean)){const t={};for(const i in r)t[i]=dr(r[i]);return t}return $n(r)}class cf extends Error{constructor(t,i){super(i),this.message=i,this.key=t}}var eo=cf;class Sh{constructor(t,i=[]){this.parent=t,this.bindings={};for(const[a,u]of i)this.bindings[a]=u}concat(t){return new Sh(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)}}var uf=Sh;const da={kind:"null"},lt={kind:"number"},$t={kind:"string"},Ft={kind:"boolean"},si={kind:"color"},Ri={kind:"object"},Nt={kind:"value"},ai={kind:"collator"},xl={kind:"formatted"},ks={kind:"resolvedImage"};function mi(r,t){return{kind:"array",itemType:r,N:t}}function Sn(r){if(r.kind==="array"){const t=Sn(r.itemType);return typeof r.N=="number"?`array<${t}, ${r.N}>`:r.itemType.kind==="value"?"array":`array<${t}>`}return r.kind}const hf=[da,lt,$t,Ft,si,xl,Ri,mi(Nt),ks];function Eo(r,t){if(t.kind==="error")return null;if(r.kind==="array"){if(t.kind==="array"&&(t.N===0&&t.itemType.kind==="value"||!Eo(r.itemType,t.itemType))&&(typeof r.N!="number"||r.N===t.N))return null}else{if(r.kind===t.kind)return null;if(r.kind==="value"){for(const i of hf)if(!Eo(i,t))return null}}return`Expected ${Sn(r)} but found ${Sn(t)} instead.`}function wl(r,t){return t.some(i=>i.kind===r.kind)}function bl(r,t){return t.some(i=>i==="null"?r===null:i==="array"?Array.isArray(r):i==="object"?r&&!Array.isArray(r)&&typeof r=="object":i===typeof r)}var Ah,df={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function El(r){return(r=Math.round(r))<0?0:r>255?255:r}function Tl(r){return El(r[r.length-1]==="%"?parseFloat(r)/100*255:parseInt(r))}function kc(r){return(t=r[r.length-1]==="%"?parseFloat(r)/100:parseFloat(r))<0?0:t>1?1:t;var t}function pa(r,t,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?r+(t-r)*i*6:2*i<1?t:3*i<2?r+(t-r)*(2/3-i)*6:r}try{Ah={}.parseCSSColor=function(r){var t,i=r.replace(/ /g,"").toLowerCase();if(i in df)return df[i].slice();if(i[0]==="#")return i.length===4?(t=parseInt(i.substr(1),16))>=0&&t<=4095?[(3840&t)>>4|(3840&t)>>8,240&t|(240&t)>>4,15&t|(15&t)<<4,1]:null:i.length===7&&(t=parseInt(i.substr(1),16))>=0&&t<=16777215?[(16711680&t)>>16,(65280&t)>>8,255&t,1]:null;var a=i.indexOf("("),u=i.indexOf(")");if(a!==-1&&u+1===i.length){var p=i.substr(0,a),g=i.substr(a+1,u-(a+1)).split(","),y=1;switch(p){case"rgba":if(g.length!==4)return null;y=kc(g.pop());case"rgb":return g.length!==3?null:[Tl(g[0]),Tl(g[1]),Tl(g[2]),y];case"hsla":if(g.length!==4)return null;y=kc(g.pop());case"hsl":if(g.length!==3)return null;var w=(parseFloat(g[0])%360+360)%360/360,b=kc(g[1]),A=kc(g[2]),I=A<=.5?A*(b+1):A+b-A*b,M=2*A-I;return[El(255*pa(M,I,w+1/3)),El(255*pa(M,I,w)),El(255*pa(M,I,w-1/3)),y];default:return null}}return null}}catch{}class Gr{constructor(t,i,a,u=1){this.r=t,this.g=i,this.b=a,this.a=u}static parse(t){if(!t)return;if(t instanceof Gr)return t;if(typeof t!="string")return;const i=Ah(t);return i?new Gr(i[0]/255*i[3],i[1]/255*i[3],i[2]/255*i[3],i[3]):void 0}toString(){const[t,i,a,u]=this.toArray();return`rgba(${Math.round(t)},${Math.round(i)},${Math.round(a)},${u})`}toArray(){const{r:t,g:i,b:a,a:u}=this;return u===0?[0,0,0,0]:[255*t/u,255*i/u,255*a/u,u]}toArray01(){const{r:t,g:i,b:a,a:u}=this;return u===0?[0,0,0,0]:[t/u,i/u,a/u,u]}toArray01PremultipliedAlpha(){const{r:t,g:i,b:a,a:u}=this;return[t,i,a,u]}}Gr.black=new Gr(0,0,0,1),Gr.white=new Gr(1,1,1,1),Gr.transparent=new Gr(0,0,0,0),Gr.red=new Gr(1,0,0,1),Gr.blue=new Gr(0,0,1,1);var Fn=Gr;class Ch{constructor(t,i,a){this.sensitivity=t?i?"variant":"case":i?"accent":"base",this.locale=a,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,i){return this.collator.compare(t,i)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Ih{constructor(t,i,a,u,p){this.text=t.normalize?t.normalize():t,this.image=i,this.scale=a,this.fontStack=u,this.textColor=p}}class qr{constructor(t){this.sections=t}static fromString(t){return new qr([new Ih(t,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(t=>t.text.length!==0||t.image&&t.image.name.length!==0)}static factory(t){return t instanceof qr?t:qr.fromString(t)}toString(){return this.sections.length===0?"":this.sections.map(t=>t.text).join("")}serialize(){const t=["format"];for(const i of this.sections){if(i.image){t.push(["image",i.image.name]);continue}t.push(i.text);const a={};i.fontStack&&(a["text-font"]=["literal",i.fontStack.split(",")]),i.scale&&(a["font-scale"]=i.scale),i.textColor&&(a["text-color"]=["rgba"].concat(i.textColor.toArray())),t.push(a)}return t}}class gi{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new gi({name:t,available:!1}):null}serialize(){return["image",this.name]}}function pf(r,t,i,a){return typeof r=="number"&&r>=0&&r<=255&&typeof t=="number"&&t>=0&&t<=255&&typeof i=="number"&&i>=0&&i<=255?a===void 0||typeof a=="number"&&a>=0&&a<=1?null:`Invalid rgba value [${[r,t,i,a].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof a=="number"?[r,t,i,a]:[r,t,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Sl(r){if(r===null||typeof r=="string"||typeof r=="boolean"||typeof r=="number"||r instanceof Fn||r instanceof Ch||r instanceof qr||r instanceof gi)return!0;if(Array.isArray(r)){for(const t of r)if(!Sl(t))return!1;return!0}if(typeof r=="object"){for(const t in r)if(!Sl(r[t]))return!1;return!0}return!1}function Ln(r){if(r===null)return da;if(typeof r=="string")return $t;if(typeof r=="boolean")return Ft;if(typeof r=="number")return lt;if(r instanceof Fn)return si;if(r instanceof Ch)return ai;if(r instanceof qr)return xl;if(r instanceof gi)return ks;if(Array.isArray(r)){const t=r.length;let i;for(const a of r){const u=Ln(a);if(i){if(i===u)continue;i=Nt;break}i=u}return mi(i||Nt,t)}return Ri}function Al(r){const t=typeof r;return r===null?"":t==="string"||t==="number"||t==="boolean"?String(r):r instanceof Fn||r instanceof qr||r instanceof gi?r.toString():JSON.stringify(r)}class kh{constructor(t,i){this.type=t,this.value=i}static parse(t,i){if(t.length!==2)return i.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!Sl(t[1]))return i.error("invalid value");const a=t[1];let u=Ln(a);const p=i.expectedType;return u.kind!=="array"||u.N!==0||!p||p.kind!=="array"||typeof p.N=="number"&&p.N!==0||(u=p),new kh(u,a)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof Fn?["rgba"].concat(this.value.toArray()):this.value instanceof qr?this.value.serialize():this.value}}var Ms=kh,Er=class{constructor(r){this.name="ExpressionEvaluationError",this.message=r}toJSON(){return this.message}};const Mh={string:$t,number:lt,boolean:Ft,object:Ri};class Ph{constructor(t,i){this.type=t,this.args=i}static parse(t,i){if(t.length<2)return i.error("Expected at least one argument.");let a,u=1;const p=t[0];if(p==="array"){let y,w;if(t.length>2){const b=t[1];if(typeof b!="string"||!(b in Mh)||b==="object")return i.error('The item type argument of "array" must be one of string, number, boolean',1);y=Mh[b],u++}else y=Nt;if(t.length>3){if(t[2]!==null&&(typeof t[2]!="number"||t[2]<0||t[2]!==Math.floor(t[2])))return i.error('The length argument to "array" must be a positive integer literal',2);w=t[2],u++}a=mi(y,w)}else a=Mh[p];const g=[];for(;ut.outputDefined())}serialize(){const t=this.type,i=[t.kind];if(t.kind==="array"){const a=t.itemType;if(a.kind==="string"||a.kind==="number"||a.kind==="boolean"){i.push(a.kind);const u=t.N;(typeof u=="number"||this.args.length>1)&&i.push(u)}}return i.concat(this.args.map(a=>a.serialize()))}}var To=Ph;class ns{constructor(t){this.type=xl,this.sections=t}static parse(t,i){if(t.length<2)return i.error("Expected at least one argument.");const a=t[1];if(!Array.isArray(a)&&typeof a=="object")return i.error("First argument must be an image or text section.");const u=[];let p=!1;for(let g=1;g<=t.length-1;++g){const y=t[g];if(p&&typeof y=="object"&&!Array.isArray(y)){p=!1;let w=null;if(y["font-scale"]&&(w=i.parse(y["font-scale"],1,lt),!w))return null;let b=null;if(y["text-font"]&&(b=i.parse(y["text-font"],1,mi($t)),!b))return null;let A=null;if(y["text-color"]&&(A=i.parse(y["text-color"],1,si),!A))return null;const I=u[u.length-1];I.scale=w,I.font=b,I.textColor=A}else{const w=i.parse(t[g],1,Nt);if(!w)return null;const b=w.type.kind;if(b!=="string"&&b!=="value"&&b!=="null"&&b!=="resolvedImage")return i.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");p=!0,u.push({content:w,scale:null,font:null,textColor:null})}}return new ns(u)}evaluate(t){return new qr(this.sections.map(i=>{const a=i.content.evaluate(t);return Ln(a)===ks?new Ih("",a,null,null,null):new Ih(Al(a),null,i.scale?i.scale.evaluate(t):null,i.font?i.font.evaluate(t).join(","):null,i.textColor?i.textColor.evaluate(t):null)}))}eachChild(t){for(const i of this.sections)t(i.content),i.scale&&t(i.scale),i.font&&t(i.font),i.textColor&&t(i.textColor)}outputDefined(){return!1}serialize(){const t=["format"];for(const i of this.sections){t.push(i.content.serialize());const a={};i.scale&&(a["font-scale"]=i.scale.serialize()),i.font&&(a["text-font"]=i.font.serialize()),i.textColor&&(a["text-color"]=i.textColor.serialize()),t.push(a)}return t}}class Mc{constructor(t){this.type=ks,this.input=t}static parse(t,i){if(t.length!==2)return i.error("Expected two arguments.");const a=i.parse(t[1],1,$t);return a?new Mc(a):i.error("No image name provided.")}evaluate(t){const i=this.input.evaluate(t),a=gi.fromString(i);return a&&t.availableImages&&(a.available=t.availableImages.indexOf(i)>-1),a}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const q_={"to-boolean":Ft,"to-color":si,"to-number":lt,"to-string":$t};class zh{constructor(t,i){this.type=t,this.args=i}static parse(t,i){if(t.length<2)return i.error("Expected at least one argument.");const a=t[0];if((a==="to-boolean"||a==="to-string")&&t.length!==2)return i.error("Expected one argument.");const u=q_[a],p=[];for(let g=1;g4?`Invalid rbga value ${JSON.stringify(i)}: expected an array containing either three or four numeric values.`:pf(i[0],i[1],i[2],i[3]),!a))return new Fn(i[0]/255,i[1]/255,i[2]/255,i[3])}throw new Er(a||`Could not parse color from value '${typeof i=="string"?i:String(JSON.stringify(i))}'`)}if(this.type.kind==="number"){let i=null;for(const a of this.args){if(i=a.evaluate(t),i===null)return 0;const u=Number(i);if(!isNaN(u))return u}throw new Er(`Could not convert ${JSON.stringify(i)} to number.`)}return this.type.kind==="formatted"?qr.fromString(Al(this.args[0].evaluate(t))):this.type.kind==="resolvedImage"?gi.fromString(Al(this.args[0].evaluate(t))):Al(this.args[0].evaluate(t))}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}serialize(){if(this.type.kind==="formatted")return new ns([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new Mc(this.args[0]).serialize();const t=[`to-${this.type.kind}`];return this.eachChild(i=>{t.push(i.serialize())}),t}}var fa=zh;const to=["Unknown","Point","LineString","Polygon"];var Lh=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null}id(){return this.feature&&this.feature.id!==void 0?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?to[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||{}}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const r=this.featureDistanceData.center,t=this.featureDistanceData.scale,{x:i,y:a}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(i*t-r[0])+this.featureDistanceData.bearing[1]*(a*t-r[1])}return 0}parseColor(r){let t=this._parseColorCache[r];return t||(t=this._parseColorCache[r]=Fn.parse(r)),t}};class Ps{constructor(t,i,a,u){this.name=t,this.type=i,this._evaluate=a,this.args=u}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map(t=>t.serialize()))}static parse(t,i){const a=t[0],u=Ps.definitions[a];if(!u)return i.error(`Unknown expression "${a}". If you wanted a literal array, use ["literal", [...]].`,0);const p=Array.isArray(u)?u[0]:u.type,g=Array.isArray(u)?[[u[1],u[2]]]:u.overloads,y=g.filter(([b])=>!Array.isArray(b)||b.length===t.length-1);let w=null;for(const[b,A]of y){w=new Nh(i.registry,i.path,null,i.scope);const I=[];let M=!1;for(let L=1;L{return M=I,Array.isArray(M)?`(${M.map(Sn).join(", ")})`:`(${Sn(M.type)}...)`;var M}).join(" | "),A=[];for(let I=1;I=t[2]||r[1]<=t[1]||r[3]>=t[3])}function Il(r,t){const i=(180+r[0])/360,a=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r[1]*Math.PI/360)))/360,u=Math.pow(2,t.z);return[Math.round(i*u*Ao),Math.round(a*u*Ao)]}function ff(r,t,i){const a=r[0]-t[0],u=r[1]-t[1],p=r[0]-i[0],g=r[1]-i[1];return a*g-p*u==0&&a*p<=0&&u*g<=0}function zc(r,t){let i=!1;for(let g=0,y=t.length;g(a=r)[1]!=(p=w[b+1])[1]>a[1]&&a[0]<(p[0]-u[0])*(a[1]-u[1])/(p[1]-u[1])+u[0]&&(i=!i)}}var a,u,p;return i}function Rh(r,t){for(let i=0;i0&&y<0||g<0&&y>0}function ga(r,t,i){for(const b of i)for(let A=0;Ai[2]){const u=.5*a;let p=r[0]-i[0]>u?-a:i[0]-r[0]>u?a:0;p===0&&(p=r[0]-i[2]>u?-a:i[2]-r[0]>u?a:0),r[0]+=p}Pc(t,r)}function gf(r,t,i,a){const u=Math.pow(2,a.z)*Ao,p=[a.x*Ao,a.y*Ao],g=[];if(!r)return g;for(const y of r)for(const w of y){const b=[w.x+p[0],w.y+p[1]];Bh(b,t,i,u),g.push(b)}return g}function Fh(r,t,i,a){const u=Math.pow(2,a.z)*Ao,p=[a.x*Ao,a.y*Ao],g=[];if(!r)return g;for(const w of r){const b=[];for(const A of w){const I=[A.x+p[0],A.y+p[1]];Pc(t,I),b.push(I)}g.push(b)}if(t[2]-t[0]<=u/2){(y=t)[0]=y[1]=1/0,y[2]=y[3]=-1/0;for(const w of g)for(const b of w)Bh(b,t,i,u)}var y;return g}class _a{constructor(t,i){this.type=Ft,this.geojson=t,this.geometries=i}static parse(t,i){if(t.length!==2)return i.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Sl(t[1])){const a=t[1];if(a.type==="FeatureCollection")for(let u=0;u{t&&!ya(i)&&(t=!1)}),t}function Co(r){if(r instanceof So&&r.name==="feature-state")return!1;let t=!0;return r.eachChild(i=>{t&&!Co(i)&&(t=!1)}),t}function zs(r,t){if(r instanceof So&&t.indexOf(r.name)>=0)return!1;let i=!0;return r.eachChild(a=>{i&&!zs(a,t)&&(i=!1)}),i}class Rc{constructor(t,i){this.type=i.type,this.name=t,this.boundExpression=i}static parse(t,i){if(t.length!==2||typeof t[1]!="string")return i.error("'var' expression requires exactly one string literal argument.");const a=t[1];return i.scope.has(a)?new Rc(a,i.scope.get(a)):i.error(`Unknown variable "${a}". Make sure "${a}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}var _f=Rc;class kl{constructor(t,i=[],a,u=new uf,p=[]){this.registry=t,this.path=i,this.key=i.map(g=>`[${g}]`).join(""),this.scope=u,this.errors=p,this.expectedType=a}parse(t,i,a,u,p={}){return i?this.concat(i,a,u)._parse(t,p):this._parse(t,p)}_parse(t,i){function a(u,p,g){return g==="assert"?new To(p,[u]):g==="coerce"?new fa(p,[u]):u}if(t!==null&&typeof t!="string"&&typeof t!="boolean"&&typeof t!="number"||(t=["literal",t]),Array.isArray(t)){if(t.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const u=t[0];if(typeof u!="string")return this.error(`Expression name must be a string, but found ${typeof u} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const p=this.registry[u];if(p){let g=p.parse(t,this);if(!g)return null;if(this.expectedType){const y=this.expectedType,w=g.type;if(y.kind!=="string"&&y.kind!=="number"&&y.kind!=="boolean"&&y.kind!=="object"&&y.kind!=="array"||w.kind!=="value")if(y.kind!=="color"&&y.kind!=="formatted"&&y.kind!=="resolvedImage"||w.kind!=="value"&&w.kind!=="string"){if(this.checkSubtype(y,w))return null}else g=a(g,y,i.typeAnnotation||"coerce");else g=a(g,y,i.typeAnnotation||"assert")}if(!(g instanceof Ms)&&g.type.kind!=="resolvedImage"&&Uh(g)){const y=new Lh;try{g=new Ms(g.type,g.evaluate(y))}catch(w){return this.error(w.message),null}}return g}return this.error(`Unknown expression "${u}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(t===void 0?"'undefined' value invalid. Use null instead.":typeof t=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof t} instead.`)}concat(t,i,a){const u=typeof t=="number"?this.path.concat(t):this.path,p=a?this.scope.concat(a):this.scope;return new kl(this.registry,u,i||null,p,this.errors)}error(t,...i){const a=`${this.key}${i.map(u=>`[${u}]`).join("")}`;this.errors.push(new eo(a,t))}checkSubtype(t,i){const a=Eo(t,i);return a&&this.error(a),a}}var Nh=kl;function Uh(r){if(r instanceof _f)return Uh(r.boundExpression);if(r instanceof So&&r.name==="error"||r instanceof Cl||r instanceof Lc)return!1;const t=r instanceof fa||r instanceof To;let i=!0;return r.eachChild(a=>{i=t?i&&Uh(a):i&&a instanceof Ms}),!!i&&ya(r)&&zs(r,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"])}function Dc(r,t){const i=r.length-1;let a,u,p=0,g=i,y=0;for(;p<=g;)if(y=Math.floor((p+g)/2),a=r[y],u=r[y+1],a<=t){if(y===i||tt))throw new Er("Input is not a number.");g=y-1}return 0}class Oc{constructor(t,i,a){this.type=t,this.input=i,this.labels=[],this.outputs=[];for(const[u,p]of a)this.labels.push(u),this.outputs.push(p)}static parse(t,i){if(t.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return i.error("Expected an even number of arguments.");const a=i.parse(t[1],1,lt);if(!a)return null;const u=[];let p=null;i.expectedType&&i.expectedType.kind!=="value"&&(p=i.expectedType);for(let g=1;g=y)return i.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',b);const I=i.parse(w,A,p);if(!I)return null;p=p||I.type,u.push([y,I])}return new Oc(p,a,u)}evaluate(t){const i=this.labels,a=this.outputs;if(i.length===1)return a[0].evaluate(t);const u=this.input.evaluate(t);if(u<=i[0])return a[0].evaluate(t);const p=i.length;return u>=i[p-1]?a[p-1].evaluate(t):a[Dc(i,u)].evaluate(t)}eachChild(t){t(this.input);for(const i of this.outputs)t(i)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}serialize(){const t=["step",this.input.serialize()];for(let i=0;i0&&t.push(this.labels[i]),t.push(this.outputs[i].serialize());return t}}var jh=Oc;function Wt(r,t,i){return r*(1-i)+t*i}var Ml=Object.freeze({__proto__:null,array:function(r,t,i){return r.map((a,u)=>Wt(a,t[u],i))},color:function(r,t,i){return new Fn(Wt(r.r,t.r,i),Wt(r.g,t.g,i),Wt(r.b,t.b,i),Wt(r.a,t.a,i))},number:Wt});const yf=.95047,Vh=1.08883,vf=4/29,Ls=6/29,$h=3*Ls*Ls,Z_=Ls*Ls*Ls,H_=Math.PI/180,X_=180/Math.PI;function Gh(r){return r>Z_?Math.pow(r,1/3):r/$h+vf}function qh(r){return r>Ls?r*r*r:$h*(r-vf)}function Wh(r){return 255*(r<=.0031308?12.92*r:1.055*Math.pow(r,1/2.4)-.055)}function Bc(r){return(r/=255)<=.04045?r/12.92:Math.pow((r+.055)/1.055,2.4)}function xf(r){const t=Bc(r.r),i=Bc(r.g),a=Bc(r.b),u=Gh((.4124564*t+.3575761*i+.1804375*a)/yf),p=Gh((.2126729*t+.7151522*i+.072175*a)/1);return{l:116*p-16,a:500*(u-p),b:200*(p-Gh((.0193339*t+.119192*i+.9503041*a)/Vh)),alpha:r.a}}function wf(r){let t=(r.l+16)/116,i=isNaN(r.a)?t:t+r.a/500,a=isNaN(r.b)?t:t-r.b/200;return t=1*qh(t),i=yf*qh(i),a=Vh*qh(a),new Fn(Wh(3.2404542*i-1.5371385*t-.4985314*a),Wh(-.969266*i+1.8760108*t+.041556*a),Wh(.0556434*i-.2040259*t+1.0572252*a),r.alpha)}function K_(r,t,i){const a=t-r;return r+i*(a>180||a<-180?a-360*Math.round(a/360):a)}const Pl={forward:xf,reverse:wf,interpolate:function(r,t,i){return{l:Wt(r.l,t.l,i),a:Wt(r.a,t.a,i),b:Wt(r.b,t.b,i),alpha:Wt(r.alpha,t.alpha,i)}}},va={forward:function(r){const{l:t,a:i,b:a}=xf(r),u=Math.atan2(a,i)*X_;return{h:u<0?u+360:u,c:Math.sqrt(i*i+a*a),l:t,alpha:r.a}},reverse:function(r){const t=r.h*H_,i=r.c;return wf({l:r.l,a:Math.cos(t)*i,b:Math.sin(t)*i,alpha:r.alpha})},interpolate:function(r,t,i){return{h:K_(r.h,t.h,i),c:Wt(r.c,t.c,i),l:Wt(r.l,t.l,i),alpha:Wt(r.alpha,t.alpha,i)}}};var Zh=Object.freeze({__proto__:null,hcl:va,lab:Pl});class zl{constructor(t,i,a,u,p){this.type=t,this.operator=i,this.interpolation=a,this.input=u,this.labels=[],this.outputs=[];for(const[g,y]of p)this.labels.push(g),this.outputs.push(y)}static interpolationFactor(t,i,a,u){let p=0;if(t.name==="exponential")p=Hh(i,t.base,a,u);else if(t.name==="linear")p=Hh(i,1,a,u);else if(t.name==="cubic-bezier"){const g=t.controlPoints;p=new Ke(g[0],g[1],g[2],g[3]).solve(Hh(i,1,a,u))}return p}static parse(t,i){let[a,u,p,...g]=t;if(!Array.isArray(u)||u.length===0)return i.error("Expected an interpolation type expression.",1);if(u[0]==="linear")u={name:"linear"};else if(u[0]==="exponential"){const b=u[1];if(typeof b!="number")return i.error("Exponential interpolation requires a numeric base.",1,1);u={name:"exponential",base:b}}else{if(u[0]!=="cubic-bezier")return i.error(`Unknown interpolation type ${String(u[0])}`,1,0);{const b=u.slice(1);if(b.length!==4||b.some(A=>typeof A!="number"||A<0||A>1))return i.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);u={name:"cubic-bezier",controlPoints:b}}}if(t.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return i.error("Expected an even number of arguments.");if(p=i.parse(p,2,lt),!p)return null;const y=[];let w=null;a==="interpolate-hcl"||a==="interpolate-lab"?w=si:i.expectedType&&i.expectedType.kind!=="value"&&(w=i.expectedType);for(let b=0;b=A)return i.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',M);const R=i.parse(I,L,w);if(!R)return null;w=w||R.type,y.push([A,R])}return w.kind==="number"||w.kind==="color"||w.kind==="array"&&w.itemType.kind==="number"&&typeof w.N=="number"?new zl(w,a,u,p,y):i.error(`Type ${Sn(w)} is not interpolatable.`)}evaluate(t){const i=this.labels,a=this.outputs;if(i.length===1)return a[0].evaluate(t);const u=this.input.evaluate(t);if(u<=i[0])return a[0].evaluate(t);const p=i.length;if(u>=i[p-1])return a[p-1].evaluate(t);const g=Dc(i,u),y=zl.interpolationFactor(this.interpolation,u,i[g],i[g+1]),w=a[g].evaluate(t),b=a[g+1].evaluate(t);return this.operator==="interpolate"?Ml[this.type.kind.toLowerCase()](w,b,y):this.operator==="interpolate-hcl"?va.reverse(va.interpolate(va.forward(w),va.forward(b),y)):Pl.reverse(Pl.interpolate(Pl.forward(w),Pl.forward(b),y))}eachChild(t){t(this.input);for(const i of this.outputs)t(i)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}serialize(){let t;t=this.interpolation.name==="linear"?["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const i=[this.operator,t,this.input.serialize()];for(let a=0;aEo(u,y.type));return new Fc(g?Nt:a,p)}evaluate(t){let i,a=null,u=0;for(const p of this.args){if(u++,a=p.evaluate(t),a&&a instanceof gi&&!a.available&&(i||(i=a),a=null,u===this.args.length))return i;if(a!==null)break}return a}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}serialize(){const t=["coalesce"];return this.eachChild(i=>{t.push(i.serialize())}),t}}var Xh=Fc;class Nc{constructor(t,i){this.type=i.type,this.bindings=[].concat(t),this.result=i}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const i of this.bindings)t(i[1]);t(this.result)}static parse(t,i){if(t.length<4)return i.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const a=[];for(let p=1;p=a.length)throw new Er(`Array index out of bounds: ${i} > ${a.length-1}.`);if(i!==Math.floor(i))throw new Er(`Array index must be an integer, but found ${i} instead.`);return a[i]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}var Y_=Kh;class Yh{constructor(t,i){this.type=Ft,this.needle=t,this.haystack=i}static parse(t,i){if(t.length!==3)return i.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const a=i.parse(t[1],1,Nt),u=i.parse(t[2],2,Nt);return a&&u?wl(a.type,[Ft,$t,lt,da,Nt])?new Yh(a,u):i.error(`Expected first argument to be of type boolean, string, number or null, but found ${Sn(a.type)} instead`):null}evaluate(t){const i=this.needle.evaluate(t),a=this.haystack.evaluate(t);if(a==null)return!1;if(!bl(i,["boolean","string","number","null"]))throw new Er(`Expected first argument to be of type boolean, string, number or null, but found ${Sn(Ln(i))} instead.`);if(!bl(a,["string","array"]))throw new Er(`Expected second argument to be of type array or string, but found ${Sn(Ln(a))} instead.`);return a.indexOf(i)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}var Uc=Yh;class Ll{constructor(t,i,a){this.type=lt,this.needle=t,this.haystack=i,this.fromIndex=a}static parse(t,i){if(t.length<=2||t.length>=5)return i.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const a=i.parse(t[1],1,Nt),u=i.parse(t[2],2,Nt);if(!a||!u)return null;if(!wl(a.type,[Ft,$t,lt,da,Nt]))return i.error(`Expected first argument to be of type boolean, string, number or null, but found ${Sn(a.type)} instead`);if(t.length===4){const p=i.parse(t[3],3,lt);return p?new Ll(a,u,p):null}return new Ll(a,u)}evaluate(t){const i=this.needle.evaluate(t),a=this.haystack.evaluate(t);if(!bl(i,["boolean","string","number","null"]))throw new Er(`Expected first argument to be of type boolean, string, number or null, but found ${Sn(Ln(i))} instead.`);if(!bl(a,["string","array"]))throw new Er(`Expected second argument to be of type array or string, but found ${Sn(Ln(a))} instead.`);if(this.fromIndex){const u=this.fromIndex.evaluate(t);return a.indexOf(i,u)}return a.indexOf(i)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}serialize(){if(this.fromIndex!=null&&this.fromIndex!==void 0){const t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}var Ef=Ll;class Jh{constructor(t,i,a,u,p,g){this.inputType=t,this.type=i,this.input=a,this.cases=u,this.outputs=p,this.otherwise=g}static parse(t,i){if(t.length<5)return i.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return i.error("Expected an even number of arguments.");let a,u;i.expectedType&&i.expectedType.kind!=="value"&&(u=i.expectedType);const p={},g=[];for(let b=2;bNumber.MAX_SAFE_INTEGER)return M.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof R=="number"&&Math.floor(R)!==R)return M.error("Numeric branch labels must be integer values.");if(a){if(M.checkSubtype(a,Ln(R)))return null}else a=Ln(R);if(p[String(R)]!==void 0)return M.error("Branch labels must be unique.");p[String(R)]=g.length}const L=i.parse(I,b,u);if(!L)return null;u=u||L.type,g.push(L)}const y=i.parse(t[1],1,Nt);if(!y)return null;const w=i.parse(t[t.length-1],t.length-1,u);return w?y.type.kind!=="value"&&i.concat(1).checkSubtype(a,y.type)?null:new Jh(a,u,y,p,g,w):null}evaluate(t){const i=this.input.evaluate(t);return(Ln(i)===this.inputType&&this.outputs[this.cases[i]]||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()}serialize(){const t=["match",this.input.serialize()],i=Object.keys(this.cases).sort(),a=[],u={};for(const g of i){const y=u[this.cases[g]];y===void 0?(u[this.cases[g]]=a.length,a.push([this.cases[g],[g]])):a[y][1].push(g)}const p=g=>this.inputType.kind==="number"?Number(g):g;for(const[g,y]of a)t.push(y.length===1?p(y[0]):y.map(p)),t.push(this.outputs[g].serialize());return t.push(this.otherwise.serialize()),t}}var J_=Jh;class Qh{constructor(t,i,a){this.type=t,this.branches=i,this.otherwise=a}static parse(t,i){if(t.length<4)return i.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return i.error("Expected an odd number of arguments.");let a;i.expectedType&&i.expectedType.kind!=="value"&&(a=i.expectedType);const u=[];for(let g=1;gi.outputDefined())&&this.otherwise.outputDefined()}serialize(){const t=["case"];return this.eachChild(i=>{t.push(i.serialize())}),t}}var Tf=Qh;class Rl{constructor(t,i,a,u){this.type=t,this.input=i,this.beginIndex=a,this.endIndex=u}static parse(t,i){if(t.length<=2||t.length>=5)return i.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const a=i.parse(t[1],1,Nt),u=i.parse(t[2],2,lt);if(!a||!u)return null;if(!wl(a.type,[mi(Nt),$t,Nt]))return i.error(`Expected first argument to be of type array or string, but found ${Sn(a.type)} instead`);if(t.length===4){const p=i.parse(t[3],3,lt);return p?new Rl(a.type,a,u,p):null}return new Rl(a.type,a,u)}evaluate(t){const i=this.input.evaluate(t),a=this.beginIndex.evaluate(t);if(!bl(i,["string","array"]))throw new Er(`Expected first argument to be of type array or string, but found ${Sn(Ln(i))} instead.`);if(this.endIndex){const u=this.endIndex.evaluate(t);return i.slice(a,u)}return i.slice(a)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}serialize(){if(this.endIndex!=null&&this.endIndex!==void 0){const t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}var Sf=Rl;function jc(r,t){return r==="=="||r==="!="?t.kind==="boolean"||t.kind==="string"||t.kind==="number"||t.kind==="null"||t.kind==="value":t.kind==="string"||t.kind==="number"||t.kind==="value"}function Af(r,t,i,a){return a.compare(t,i)===0}function xa(r,t,i){const a=r!=="=="&&r!=="!=";return class ik{constructor(p,g,y){this.type=Ft,this.lhs=p,this.rhs=g,this.collator=y,this.hasUntypedArgument=p.type.kind==="value"||g.type.kind==="value"}static parse(p,g){if(p.length!==3&&p.length!==4)return g.error("Expected two or three arguments.");const y=p[0];let w=g.parse(p[1],1,Nt);if(!w)return null;if(!jc(y,w.type))return g.concat(1).error(`"${y}" comparisons are not supported for type '${Sn(w.type)}'.`);let b=g.parse(p[2],2,Nt);if(!b)return null;if(!jc(y,b.type))return g.concat(2).error(`"${y}" comparisons are not supported for type '${Sn(b.type)}'.`);if(w.type.kind!==b.type.kind&&w.type.kind!=="value"&&b.type.kind!=="value")return g.error(`Cannot compare types '${Sn(w.type)}' and '${Sn(b.type)}'.`);a&&(w.type.kind==="value"&&b.type.kind!=="value"?w=new To(b.type,[w]):w.type.kind!=="value"&&b.type.kind==="value"&&(b=new To(w.type,[b])));let A=null;if(p.length===4){if(w.type.kind!=="string"&&b.type.kind!=="string"&&w.type.kind!=="value"&&b.type.kind!=="value")return g.error("Cannot use collator to compare non-string types.");if(A=g.parse(p[3],3,ai),!A)return null}return new ik(w,b,A)}evaluate(p){const g=this.lhs.evaluate(p),y=this.rhs.evaluate(p);if(a&&this.hasUntypedArgument){const w=Ln(g),b=Ln(y);if(w.kind!==b.kind||w.kind!=="string"&&w.kind!=="number")throw new Er(`Expected arguments for "${r}" to be (string, string) or (number, number), but found (${w.kind}, ${b.kind}) instead.`)}if(this.collator&&!a&&this.hasUntypedArgument){const w=Ln(g),b=Ln(y);if(w.kind!=="string"||b.kind!=="string")return t(p,g,y)}return this.collator?i(p,g,y,this.collator.evaluate(p)):t(p,g,y)}eachChild(p){p(this.lhs),p(this.rhs),this.collator&&p(this.collator)}outputDefined(){return!0}serialize(){const p=[r];return this.eachChild(g=>{p.push(g.serialize())}),p}}}const Q_=xa("==",function(r,t,i){return t===i},Af),ey=xa("!=",function(r,t,i){return t!==i},function(r,t,i,a){return!Af(0,t,i,a)}),ty=xa("<",function(r,t,i){return t",function(r,t,i){return t>i},function(r,t,i,a){return a.compare(t,i)>0}),ry=xa("<=",function(r,t,i){return t<=i},function(r,t,i,a){return a.compare(t,i)<=0}),Cf=xa(">=",function(r,t,i){return t>=i},function(r,t,i,a){return a.compare(t,i)>=0});class Vc{constructor(t,i,a,u,p,g){this.type=$t,this.number=t,this.locale=i,this.currency=a,this.unit=u,this.minFractionDigits=p,this.maxFractionDigits=g}static parse(t,i){if(t.length!==3)return i.error("Expected two arguments.");const a=i.parse(t[1],1,lt);if(!a)return null;const u=t[2];if(typeof u!="object"||Array.isArray(u))return i.error("NumberFormat options argument must be an object.");let p=null;if(u.locale&&(p=i.parse(u.locale,1,$t),!p))return null;let g=null;if(u.currency&&(g=i.parse(u.currency,1,$t),!g))return null;let y=null;if(u.unit&&(y=i.parse(u.unit,1,$t),!y))return null;let w=null;if(u["min-fraction-digits"]&&(w=i.parse(u["min-fraction-digits"],1,lt),!w))return null;let b=null;return u["max-fraction-digits"]&&(b=i.parse(u["max-fraction-digits"],1,lt),!b)?null:new Vc(a,p,g,y,w,b)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(t):void 0,unit:this.unit?this.unit.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.unit&&t(this.unit),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.unit&&(t.unit=this.unit.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]}}class wa{constructor(t){this.type=lt,this.input=t}static parse(t,i){if(t.length!==2)return i.error(`Expected 1 argument, but found ${t.length-1} instead.`);const a=i.parse(t[1],1);return a?a.type.kind!=="array"&&a.type.kind!=="string"&&a.type.kind!=="value"?i.error(`Expected argument of type string or array, but found ${Sn(a.type)} instead.`):new wa(a):null}evaluate(t){const i=this.input.evaluate(t);if(typeof i=="string"||Array.isArray(i))return i.length;throw new Er(`Expected value to be of type string or array, but found ${Sn(Ln(i))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){const t=["length"];return this.eachChild(i=>{t.push(i.serialize())}),t}}const If={"==":Q_,"!=":ey,">":ny,"<":ty,">=":Cf,"<=":ry,array:To,at:Y_,boolean:To,case:Tf,coalesce:Xh,collator:Cl,format:ns,image:Mc,in:Uc,"index-of":Ef,interpolate:no,"interpolate-hcl":no,"interpolate-lab":no,length:wa,let:bf,literal:Ms,match:J_,number:To,"number-format":Vc,object:To,slice:Sf,step:jh,string:To,"to-boolean":fa,"to-color":fa,"to-number":fa,"to-string":fa,var:_f,within:Lc};function kf(r,[t,i,a,u]){t=t.evaluate(r),i=i.evaluate(r),a=a.evaluate(r);const p=u?u.evaluate(r):1,g=pf(t,i,a,p);if(g)throw new Er(g);return new Fn(t/255*p,i/255*p,a/255*p,p)}function Io(r,t){return r in t}function $c(r,t){const i=t[r];return i===void 0?null:i}function _i(r){return{type:r}}So.register(If,{error:[{kind:"error"},[$t],(r,[t])=>{throw new Er(t.evaluate(r))}],typeof:[$t,[Nt],(r,[t])=>Sn(Ln(t.evaluate(r)))],"to-rgba":[mi(lt,4),[si],(r,[t])=>t.evaluate(r).toArray()],rgb:[si,[lt,lt,lt],kf],rgba:[si,[lt,lt,lt,lt],kf],has:{type:Ft,overloads:[[[$t],(r,[t])=>Io(t.evaluate(r),r.properties())],[[$t,Ri],(r,[t,i])=>Io(t.evaluate(r),i.evaluate(r))]]},get:{type:Nt,overloads:[[[$t],(r,[t])=>$c(t.evaluate(r),r.properties())],[[$t,Ri],(r,[t,i])=>$c(t.evaluate(r),i.evaluate(r))]]},"feature-state":[Nt,[$t],(r,[t])=>$c(t.evaluate(r),r.featureState||{})],properties:[Ri,[],r=>r.properties()],"geometry-type":[$t,[],r=>r.geometryType()],id:[Nt,[],r=>r.id()],zoom:[lt,[],r=>r.globals.zoom],pitch:[lt,[],r=>r.globals.pitch||0],"distance-from-center":[lt,[],r=>r.distanceFromCenter()],"heatmap-density":[lt,[],r=>r.globals.heatmapDensity||0],"line-progress":[lt,[],r=>r.globals.lineProgress||0],"sky-radial-progress":[lt,[],r=>r.globals.skyRadialProgress||0],accumulated:[Nt,[],r=>r.globals.accumulated===void 0?null:r.globals.accumulated],"+":[lt,_i(lt),(r,t)=>{let i=0;for(const a of t)i+=a.evaluate(r);return i}],"*":[lt,_i(lt),(r,t)=>{let i=1;for(const a of t)i*=a.evaluate(r);return i}],"-":{type:lt,overloads:[[[lt,lt],(r,[t,i])=>t.evaluate(r)-i.evaluate(r)],[[lt],(r,[t])=>-t.evaluate(r)]]},"/":[lt,[lt,lt],(r,[t,i])=>t.evaluate(r)/i.evaluate(r)],"%":[lt,[lt,lt],(r,[t,i])=>t.evaluate(r)%i.evaluate(r)],ln2:[lt,[],()=>Math.LN2],pi:[lt,[],()=>Math.PI],e:[lt,[],()=>Math.E],"^":[lt,[lt,lt],(r,[t,i])=>Math.pow(t.evaluate(r),i.evaluate(r))],sqrt:[lt,[lt],(r,[t])=>Math.sqrt(t.evaluate(r))],log10:[lt,[lt],(r,[t])=>Math.log(t.evaluate(r))/Math.LN10],ln:[lt,[lt],(r,[t])=>Math.log(t.evaluate(r))],log2:[lt,[lt],(r,[t])=>Math.log(t.evaluate(r))/Math.LN2],sin:[lt,[lt],(r,[t])=>Math.sin(t.evaluate(r))],cos:[lt,[lt],(r,[t])=>Math.cos(t.evaluate(r))],tan:[lt,[lt],(r,[t])=>Math.tan(t.evaluate(r))],asin:[lt,[lt],(r,[t])=>Math.asin(t.evaluate(r))],acos:[lt,[lt],(r,[t])=>Math.acos(t.evaluate(r))],atan:[lt,[lt],(r,[t])=>Math.atan(t.evaluate(r))],min:[lt,_i(lt),(r,t)=>Math.min(...t.map(i=>i.evaluate(r)))],max:[lt,_i(lt),(r,t)=>Math.max(...t.map(i=>i.evaluate(r)))],abs:[lt,[lt],(r,[t])=>Math.abs(t.evaluate(r))],round:[lt,[lt],(r,[t])=>{const i=t.evaluate(r);return i<0?-Math.round(-i):Math.round(i)}],floor:[lt,[lt],(r,[t])=>Math.floor(t.evaluate(r))],ceil:[lt,[lt],(r,[t])=>Math.ceil(t.evaluate(r))],"filter-==":[Ft,[$t,Nt],(r,[t,i])=>r.properties()[t.value]===i.value],"filter-id-==":[Ft,[Nt],(r,[t])=>r.id()===t.value],"filter-type-==":[Ft,[$t],(r,[t])=>r.geometryType()===t.value],"filter-<":[Ft,[$t,Nt],(r,[t,i])=>{const a=r.properties()[t.value],u=i.value;return typeof a==typeof u&&a{const i=r.id(),a=t.value;return typeof i==typeof a&&i":[Ft,[$t,Nt],(r,[t,i])=>{const a=r.properties()[t.value],u=i.value;return typeof a==typeof u&&a>u}],"filter-id->":[Ft,[Nt],(r,[t])=>{const i=r.id(),a=t.value;return typeof i==typeof a&&i>a}],"filter-<=":[Ft,[$t,Nt],(r,[t,i])=>{const a=r.properties()[t.value],u=i.value;return typeof a==typeof u&&a<=u}],"filter-id-<=":[Ft,[Nt],(r,[t])=>{const i=r.id(),a=t.value;return typeof i==typeof a&&i<=a}],"filter->=":[Ft,[$t,Nt],(r,[t,i])=>{const a=r.properties()[t.value],u=i.value;return typeof a==typeof u&&a>=u}],"filter-id->=":[Ft,[Nt],(r,[t])=>{const i=r.id(),a=t.value;return typeof i==typeof a&&i>=a}],"filter-has":[Ft,[Nt],(r,[t])=>t.value in r.properties()],"filter-has-id":[Ft,[],r=>r.id()!==null&&r.id()!==void 0],"filter-type-in":[Ft,[mi($t)],(r,[t])=>t.value.indexOf(r.geometryType())>=0],"filter-id-in":[Ft,[mi(Nt)],(r,[t])=>t.value.indexOf(r.id())>=0],"filter-in-small":[Ft,[$t,mi(Nt)],(r,[t,i])=>i.value.indexOf(r.properties()[t.value])>=0],"filter-in-large":[Ft,[$t,mi(Nt)],(r,[t,i])=>function(a,u,p,g){for(;p<=g;){const y=p+g>>1;if(u[y]===a)return!0;u[y]>a?g=y-1:p=y+1}return!1}(r.properties()[t.value],i.value,0,i.value.length-1)],all:{type:Ft,overloads:[[[Ft,Ft],(r,[t,i])=>t.evaluate(r)&&i.evaluate(r)],[_i(Ft),(r,t)=>{for(const i of t)if(!i.evaluate(r))return!1;return!0}]]},any:{type:Ft,overloads:[[[Ft,Ft],(r,[t,i])=>t.evaluate(r)||i.evaluate(r)],[_i(Ft),(r,t)=>{for(const i of t)if(i.evaluate(r))return!0;return!1}]]},"!":[Ft,[Ft],(r,[t])=>!t.evaluate(r)],"is-supported-script":[Ft,[$t],(r,[t])=>{const i=r.globals&&r.globals.isSupportedScript;return!i||i(t.evaluate(r))}],upcase:[$t,[$t],(r,[t])=>t.evaluate(r).toUpperCase()],downcase:[$t,[$t],(r,[t])=>t.evaluate(r).toLowerCase()],concat:[$t,_i(Nt),(r,t)=>t.map(i=>Al(i.evaluate(r))).join("")],"resolved-locale":[$t,[ai],(r,[t])=>t.evaluate(r).resolvedLocale()]});var Dl=If;function Mf(r){return{result:"success",value:r}}function Rs(r){return{result:"error",value:r}}function ba(r){return r["property-type"]==="data-driven"}function Gc(r){return!!r.expression&&r.expression.parameters.indexOf("zoom")>-1}function qc(r){return!!r.expression&&r.expression.interpolated}function Zt(r){return r instanceof Number?"number":r instanceof String?"string":r instanceof Boolean?"boolean":Array.isArray(r)?"array":r===null?"null":typeof r}function Ol(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}function Pf(r){return r}function Wc(r,t){const i=t.type==="color",a=r.stops&&typeof r.stops[0][0]=="object",u=a||!(a||r.property!==void 0),p=r.type||(qc(t)?"exponential":"interval");if(i&&((r=bo({},r)).stops&&(r.stops=r.stops.map(b=>[b[0],Fn.parse(b[1])])),r.default=Fn.parse(r.default?r.default:t.default)),r.colorSpace&&r.colorSpace!=="rgb"&&!Zh[r.colorSpace])throw new Error(`Unknown color space: ${r.colorSpace}`);let g,y,w;if(p==="exponential")g=ko;else if(p==="interval")g=Zc;else if(p==="categorical"){g=zf,y=Object.create(null);for(const b of r.stops)y[b[0]]=b[1];w=typeof r.stops[0][0]}else{if(p!=="identity")throw new Error(`Unknown function type "${p}"`);g=Lf}if(a){const b={},A=[];for(let L=0;LL[0]),evaluate:({zoom:L},R)=>ko({stops:I,base:r.base},t,L).evaluate(L,R)}}if(u){const b=p==="exponential"?{name:"exponential",base:r.base!==void 0?r.base:1}:null;return{kind:"camera",interpolationType:b,interpolationFactor:no.interpolationFactor.bind(void 0,b),zoomStops:r.stops.map(A=>A[0]),evaluate:({zoom:A})=>g(r,t,A,y,w)}}return{kind:"source",evaluate(b,A){const I=A&&A.properties?A.properties[r.property]:void 0;return I===void 0?Ea(r.default,t.default):g(r,t,I,y,w)}}}function Ea(r,t,i){return r!==void 0?r:t!==void 0?t:i!==void 0?i:void 0}function zf(r,t,i,a,u){return Ea(typeof i===u?a[i]:void 0,r.default,t.default)}function Zc(r,t,i){if(Zt(i)!=="number")return Ea(r.default,t.default);const a=r.stops.length;if(a===1||i<=r.stops[0][0])return r.stops[0][1];if(i>=r.stops[a-1][0])return r.stops[a-1][1];const u=Dc(r.stops.map(p=>p[0]),i);return r.stops[u][1]}function ko(r,t,i){const a=r.base!==void 0?r.base:1;if(Zt(i)!=="number")return Ea(r.default,t.default);const u=r.stops.length;if(u===1||i<=r.stops[0][0])return r.stops[0][1];if(i>=r.stops[u-1][0])return r.stops[u-1][1];const p=Dc(r.stops.map(A=>A[0]),i),g=function(A,I,M,L){const R=L-M,F=A-M;return R===0?0:I===1?F/R:(Math.pow(I,F)-1)/(Math.pow(I,R)-1)}(i,a,r.stops[p][0],r.stops[p+1][0]),y=r.stops[p][1],w=r.stops[p+1][1];let b=Ml[t.type]||Pf;if(r.colorSpace&&r.colorSpace!=="rgb"){const A=Zh[r.colorSpace];b=(I,M)=>A.reverse(A.interpolate(A.forward(I),A.forward(M),g))}return typeof y.evaluate=="function"?{evaluate(...A){const I=y.evaluate.apply(void 0,A),M=w.evaluate.apply(void 0,A);if(I!==void 0&&M!==void 0)return b(I,M,g)}}:b(y,w,g)}function Lf(r,t,i){return t.type==="color"?i=Fn.parse(i):t.type==="formatted"?i=qr.fromString(i.toString()):t.type==="resolvedImage"?i=gi.fromString(i.toString()):Zt(i)===t.type||t.type==="enum"&&t.values[i]||(i=void 0),Ea(i,r.default,t.default)}class Hc{constructor(t,i){this.expression=t,this._warningHistory={},this._evaluator=new Lh,this._defaultValue=i?function(a){return a.type==="color"&&(Ol(a.default)||Array.isArray(a.default))?new Fn(0,0,0,0):a.type==="color"?Fn.parse(a.default)||null:a.default===void 0?null:a.default}(i):null,this._enumValues=i&&i.type==="enum"?i.values:null}evaluateWithoutErrorHandling(t,i,a,u,p,g,y,w){return this._evaluator.globals=t,this._evaluator.feature=i,this._evaluator.featureState=a,this._evaluator.canonical=u||null,this._evaluator.availableImages=p||null,this._evaluator.formattedSection=g,this._evaluator.featureTileCoord=y||null,this._evaluator.featureDistanceData=w||null,this.expression.evaluate(this._evaluator)}evaluate(t,i,a,u,p,g,y,w){this._evaluator.globals=t,this._evaluator.feature=i||null,this._evaluator.featureState=a||null,this._evaluator.canonical=u||null,this._evaluator.availableImages=p||null,this._evaluator.formattedSection=g||null,this._evaluator.featureTileCoord=y||null,this._evaluator.featureDistanceData=w||null;try{const b=this.expression.evaluate(this._evaluator);if(b==null||typeof b=="number"&&b!=b)return this._defaultValue;if(this._enumValues&&!(b in this._enumValues))throw new Er(`Expected value to be one of ${Object.keys(this._enumValues).map(A=>JSON.stringify(A)).join(", ")}, but found ${JSON.stringify(b)} instead.`);return b}catch(b){return this._warningHistory[b.message]||(this._warningHistory[b.message]=!0,typeof console<"u"&&console.warn(b.message)),this._defaultValue}}}function Ta(r){return Array.isArray(r)&&r.length>0&&typeof r[0]=="string"&&r[0]in Dl}function Sa(r,t){const i=new Nh(Dl,[],t?function(u){const p={color:si,string:$t,number:lt,enum:$t,boolean:Ft,formatted:xl,resolvedImage:ks};return u.type==="array"?mi(p[u.value]||Nt,u.length):p[u.type]}(t):void 0),a=i.parse(r,void 0,void 0,void 0,t&&t.type==="string"?{typeAnnotation:"coerce"}:void 0);return a?Mf(new Hc(a,t)):Rs(i.errors)}class ed{constructor(t,i){this.kind=t,this._styleExpression=i,this.isStateDependent=t!=="constant"&&!Co(i.expression)}evaluateWithoutErrorHandling(t,i,a,u,p,g){return this._styleExpression.evaluateWithoutErrorHandling(t,i,a,u,p,g)}evaluate(t,i,a,u,p,g){return this._styleExpression.evaluate(t,i,a,u,p,g)}}class Bl{constructor(t,i,a,u){this.kind=t,this.zoomStops=a,this._styleExpression=i,this.isStateDependent=t!=="camera"&&!Co(i.expression),this.interpolationType=u}evaluateWithoutErrorHandling(t,i,a,u,p,g){return this._styleExpression.evaluateWithoutErrorHandling(t,i,a,u,p,g)}evaluate(t,i,a,u,p,g){return this._styleExpression.evaluate(t,i,a,u,p,g)}interpolationFactor(t,i,a){return this.interpolationType?no.interpolationFactor(this.interpolationType,t,i,a):0}}function Fl(r,t){if((r=Sa(r,t)).result==="error")return r;const i=r.value.expression,a=ya(i);if(!a&&!ba(t))return Rs([new eo("","data expressions not supported")]);const u=zs(i,["zoom","pitch","distance-from-center"]);if(!u&&!Gc(t))return Rs([new eo("","zoom expressions not supported")]);const p=Kc(i);return p||u?p instanceof eo?Rs([p]):p instanceof no&&!qc(t)?Rs([new eo("",'"interpolate" expressions cannot be used with this property')]):Mf(p?new Bl(a?"camera":"composite",r.value,p.labels,p instanceof no?p.interpolation:void 0):new ed(a?"constant":"source",r.value)):Rs([new eo("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Xc{constructor(t,i){this._parameters=t,this._specification=i,bo(this,Wc(this._parameters,this._specification))}static deserialize(t){return new Xc(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function Kc(r){let t=null;if(r instanceof bf)t=Kc(r.result);else if(r instanceof Xh){for(const i of r.args)if(t=Kc(i),t)break}else(r instanceof jh||r instanceof no)&&r.input instanceof So&&r.input.name==="zoom"&&(t=r);return t instanceof eo||r.eachChild(i=>{const a=Kc(i);a instanceof eo?t=a:!t&&a?t=new eo("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&a&&t!==a&&(t=new eo("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),t}class ct{constructor(t,i,a,u){this.message=(t?`${t}: `:"")+a,u&&(this.identifier=u),i!=null&&i.__line__&&(this.line=i.__line__)}}function Di(r){const t=r.key,i=r.value,a=r.valueSpec||{},u=r.objectElementValidators||{},p=r.style,g=r.styleSpec;let y=[];const w=Zt(i);if(w!=="object")return[new ct(t,i,`object expected, ${w} found`)];for(const b in i){const A=b.split(".")[0];let I;u[A]?I=u[A]:a[A]?I=kr:u["*"]?I=u["*"]:a["*"]&&(I=kr),I?y=y.concat(I({key:(t&&`${t}.`)+b,value:i[b],valueSpec:a[A]||a["*"],style:p,styleSpec:g,object:i,objectKey:b},i)):y.push(new ct(t,i[b],`unknown property "${b}"`))}for(const b in a)u[b]||a[b].required&&a[b].default===void 0&&i[b]===void 0&&y.push(new ct(t,i,`missing required property "${b}"`));return y}function Rf(r){const t=r.value,i=r.valueSpec,a=r.style,u=r.styleSpec,p=r.key,g=r.arrayElementValidator||kr;if(Zt(t)!=="array")return[new ct(p,t,`array expected, ${Zt(t)} found`)];if(i.length&&t.length!==i.length)return[new ct(p,t,`array length ${i.length} expected, length ${t.length} found`)];if(i["min-length"]&&t.lengthp)return[new ct(t,i,`${i} is greater than the maximum value ${p}`)]}return[]}function Ul(r){const t=r.valueSpec,i=$n(r.value.type);let a,u,p,g={};const y=i!=="categorical"&&r.value.property===void 0,w=!y,b=Zt(r.value.stops)==="array"&&Zt(r.value.stops[0])==="array"&&Zt(r.value.stops[0][0])==="object",A=Di({key:r.key,value:r.value,valueSpec:r.styleSpec.function,style:r.style,styleSpec:r.styleSpec,objectElementValidators:{stops:function(L){if(i==="identity")return[new ct(L.key,L.value,'identity function may not have a "stops" property')];let R=[];const F=L.value;return R=R.concat(Rf({key:L.key,value:F,valueSpec:L.valueSpec,style:L.style,styleSpec:L.styleSpec,arrayElementValidator:I})),Zt(F)==="array"&&F.length===0&&R.push(new ct(L.key,F,"array must have at least one stop")),R},default:function(L){return kr({key:L.key,value:L.value,valueSpec:t,style:L.style,styleSpec:L.styleSpec})}}});return i==="identity"&&y&&A.push(new ct(r.key,r.value,'missing required property "property"')),i==="identity"||r.value.stops||A.push(new ct(r.key,r.value,'missing required property "stops"')),i==="exponential"&&r.valueSpec.expression&&!qc(r.valueSpec)&&A.push(new ct(r.key,r.value,"exponential functions not supported")),r.styleSpec.$version>=8&&(w&&!ba(r.valueSpec)?A.push(new ct(r.key,r.value,"property functions not supported")):y&&!Gc(r.valueSpec)&&A.push(new ct(r.key,r.value,"zoom functions not supported"))),i!=="categorical"&&!b||r.value.property!==void 0||A.push(new ct(r.key,r.value,'"property" property is required')),A;function I(L){let R=[];const F=L.value,$=L.key;if(Zt(F)!=="array")return[new ct($,F,`array expected, ${Zt(F)} found`)];if(F.length!==2)return[new ct($,F,`array length 2 expected, length ${F.length} found`)];if(b){if(Zt(F[0])!=="object")return[new ct($,F,`object expected, ${Zt(F[0])} found`)];if(F[0].zoom===void 0)return[new ct($,F,"object stop key must have zoom")];if(F[0].value===void 0)return[new ct($,F,"object stop key must have value")];const K=$n(F[0].zoom);if(typeof K!="number")return[new ct($,F[0].zoom,"stop zoom values must be numbers")];if(p&&p>K)return[new ct($,F[0].zoom,"stop zoom values must appear in ascending order")];K!==p&&(p=K,u=void 0,g={}),R=R.concat(Di({key:`${$}[0]`,value:F[0],valueSpec:{zoom:{}},style:L.style,styleSpec:L.styleSpec,objectElementValidators:{zoom:Nl,value:M}}))}else R=R.concat(M({key:`${$}[0]`,value:F[0],valueSpec:{},style:L.style,styleSpec:L.styleSpec},F));return Ta(dr(F[1]))?R.concat([new ct(`${$}[1]`,F[1],"expressions are not allowed in function stops.")]):R.concat(kr({key:`${$}[1]`,value:F[1],valueSpec:t,style:L.style,styleSpec:L.styleSpec}))}function M(L,R){const F=Zt(L.value),$=$n(L.value),K=L.value!==null?L.value:R;if(a){if(F!==a)return[new ct(L.key,K,`${F} stop domain type must match previous stop domain type ${a}`)]}else a=F;if(F!=="number"&&F!=="string"&&F!=="boolean"&&typeof $!="number"&&typeof $!="string"&&typeof $!="boolean")return[new ct(L.key,K,"stop domain value must be a number, string, or boolean")];if(F!=="number"&&i!=="categorical"){let se=`number expected, ${F} found`;return ba(t)&&i===void 0&&(se+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ct(L.key,K,se)]}return i!=="categorical"||F!=="number"||typeof $=="number"&&isFinite($)&&Math.floor($)===$?i!=="categorical"&&F==="number"&&typeof $=="number"&&typeof u=="number"&&u!==void 0&&$new ct(`${r.key}${a.key}`,r.value,a.message));const i=t.value.expression||t.value._styleExpression.expression;if(r.expressionContext==="property"&&r.propertyKey==="text-font"&&!i.outputDefined())return[new ct(r.key,r.value,`Invalid data expression for "${r.propertyKey}". Output values must be contained as literals within the expression.`)];if(r.expressionContext==="property"&&r.propertyType==="layout"&&!Co(i))return[new ct(r.key,r.value,'"feature-state" data expressions are not supported with layout properties.')];if(r.expressionContext==="filter")return jl(i,r);if(r.expressionContext&&r.expressionContext.indexOf("cluster")===0){if(!zs(i,["zoom","feature-state"]))return[new ct(r.key,r.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(r.expressionContext==="cluster-initial"&&!ya(i))return[new ct(r.key,r.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function jl(r,t){const i=new Set(["zoom","feature-state","pitch","distance-from-center"]);if(t.valueSpec&&t.valueSpec.expression)for(const u of t.valueSpec.expression.parameters)i.delete(u);if(i.size===0)return[];const a=[];return r instanceof So&&i.has(r.name)?[new ct(t.key,t.value,`["${r.name}"] expression is not supported in a filter for a ${t.object.type} layer with id: ${t.object.id}`)]:(r.eachChild(u=>{a.push(...jl(u,t))}),a)}function Yc(r){const t=r.key,i=r.value,a=r.valueSpec,u=[];return Array.isArray(a.values)?a.values.indexOf($n(i))===-1&&u.push(new ct(t,i,`expected one of [${a.values.join(", ")}], ${JSON.stringify(i)} found`)):Object.keys(a.values).indexOf($n(i))===-1&&u.push(new ct(t,i,`expected one of [${Object.keys(a.values).join(", ")}], ${JSON.stringify(i)} found`)),u}function td(r){if(r===!0||r===!1)return!0;if(!Array.isArray(r)||r.length===0)return!1;switch(r[0]){case"has":return r.length>=2&&r[1]!=="$id"&&r[1]!=="$type";case"in":return r.length>=3&&(typeof r[1]!="string"||Array.isArray(r[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return r.length!==3||Array.isArray(r[1])||Array.isArray(r[2]);case"any":case"all":for(const t of r.slice(1))if(!td(t)&&typeof t!="boolean")return!1;return!0;default:return!0}}function Jc(r,t="fill"){if(r==null)return{filter:()=>!0,needGeometry:!1,needFeature:!1};td(r)||(r=Ca(r));const i=r;let a=!0;try{a=function(b){if(!Aa(b))return b;let A=dr(b);return Qc(A),A=Df(A),A}(i)}catch{console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate. +This is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md +and paste the contents of this message in the report. +Thank you! +Filter Expression: +${JSON.stringify(i,null,2)} + `)}const u=Re[`filter_${t}`],p=Sa(a,u);let g=null;if(p.result==="error")throw new Error(p.value.map(b=>`${b.key}: ${b.message}`).join(", "));g=(b,A,I)=>p.value.evaluate(b,A,{},I);let y=null,w=null;if(a!==i){const b=Sa(i,u);if(b.result==="error")throw new Error(b.value.map(A=>`${A.key}: ${A.message}`).join(", "));y=(A,I,M,L,R)=>b.value.evaluate(A,I,{},M,void 0,void 0,L,R),w=!ya(b.value.expression)}return{filter:g,dynamicFilter:y||void 0,needGeometry:Of(a),needFeature:!!w}}function Df(r){if(!Array.isArray(r))return r;const t=function(i){if(nd.has(i[0])){for(let a=1;aDf(i))}function Qc(r){let t=!1;const i=[];if(r[0]==="case"){for(let a=1;a",">=","<","<=","to-boolean"]);function iy(r,t){return rt?1:0}function Of(r){if(!Array.isArray(r))return!1;if(r[0]==="within")return!0;for(let t=1;t"||t==="<="||t===">="?rd(r[1],r[2],t):t==="any"?(i=r.slice(1),["any"].concat(i.map(Ca))):t==="all"?["all"].concat(r.slice(1).map(Ca)):t==="none"?["all"].concat(r.slice(1).map(Ca).map(eu)):t==="in"?id(r[1],r.slice(2)):t==="!in"?eu(id(r[1],r.slice(2))):t==="has"?od(r[1]):t==="!has"?eu(od(r[1])):t!=="within"||r;var i}function rd(r,t,i){switch(r){case"$type":return[`filter-type-${i}`,t];case"$id":return[`filter-id-${i}`,t];default:return[`filter-${i}`,r,t]}}function id(r,t){if(t.length===0)return!1;switch(r){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some(i=>typeof i!=typeof t[0])?["filter-in-large",r,["literal",t.sort(iy)]]:["filter-in-small",r,["literal",t]]}}function od(r){switch(r){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",r]}}function eu(r){return["!",r]}function Vl(r){return td(dr(r.value))?pr(bo({},r,{expressionContext:"filter",valueSpec:r.styleSpec[`filter_${r.layerType||"fill"}`]})):$l(r)}function $l(r){const t=r.value,i=r.key;if(Zt(t)!=="array")return[new ct(i,t,`array expected, ${Zt(t)} found`)];const a=r.styleSpec;let u,p=[];if(t.length<1)return[new ct(i,t,"filter array must have at least 1 element")];switch(p=p.concat(Yc({key:`${i}[0]`,value:t[0],valueSpec:a.filter_operator,style:r.style,styleSpec:r.styleSpec})),$n(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&$n(t[1])==="$type"&&p.push(new ct(i,t,`"$type" cannot be use with operator "${t[0]}"`));case"==":case"!=":t.length!==3&&p.push(new ct(i,t,`filter array for operator "${t[0]}" must have 3 elements`));case"in":case"!in":t.length>=2&&(u=Zt(t[1]),u!=="string"&&p.push(new ct(`${i}[1]`,t[1],`string expected, ${u} found`)));for(let g=2;g{b in i&&t.push(new ct(a,i[b],`"${b}" is prohibited for ref layers`))}),u.layers.forEach(b=>{$n(b.id)===y&&(w=b)}),w?w.ref?t.push(new ct(a,i.ref,"ref cannot reference another ref layer")):g=$n(w.type):typeof y=="string"&&t.push(new ct(a,i.ref,`ref layer "${y}" not found`))}else if(g!=="background"&&g!=="sky")if(i.source){const w=u.sources&&u.sources[i.source],b=w&&$n(w.type);w?b==="vector"&&g==="raster"?t.push(new ct(a,i.source,`layer "${i.id}" requires a raster source`)):b==="raster"&&g!=="raster"?t.push(new ct(a,i.source,`layer "${i.id}" requires a vector source`)):b!=="vector"||i["source-layer"]?b==="raster-dem"&&g!=="hillshade"?t.push(new ct(a,i.source,"raster-dem source can only be used with layer type 'hillshade'.")):g!=="line"||!i.paint||!i.paint["line-gradient"]&&!i.paint["line-trim-offset"]||b==="geojson"&&w.lineMetrics||t.push(new ct(a,i,`layer "${i.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):t.push(new ct(a,i,`layer "${i.id}" must specify a "source-layer"`)):t.push(new ct(a,i.source,`source "${i.source}" not found`))}else t.push(new ct(a,i,'missing required property "source"'));return t=t.concat(Di({key:a,value:i,valueSpec:p.layer,style:r.style,styleSpec:r.styleSpec,objectElementValidators:{"*":()=>[],type:()=>kr({key:`${a}.type`,value:i.type,valueSpec:p.layer.type,style:r.style,styleSpec:r.styleSpec,object:i,objectKey:"type"}),filter:w=>Vl(bo({layerType:g},w)),layout:w=>Di({layer:i,key:w.key,value:w.value,valueSpec:{},style:w.style,styleSpec:w.styleSpec,objectElementValidators:{"*":b=>ad(bo({layerType:g},b))}}),paint:w=>Di({layer:i,key:w.key,value:w.value,valueSpec:{},style:w.style,styleSpec:w.styleSpec,objectElementValidators:{"*":b=>Bf(bo({layerType:g},b))}})}})),t}function rs(r){const t=r.value,i=r.key,a=Zt(t);return a!=="string"?[new ct(i,t,`string expected, ${a} found`)]:[]}const Nf={promoteId:function({key:r,value:t}){if(Zt(t)==="string")return rs({key:r,value:t});{const i=[];for(const a in t)i.push(...rs({key:`${r}.${a}`,value:t[a]}));return i}}};function Uf(r){const t=r.value,i=r.key,a=r.styleSpec,u=r.style;if(!t.type)return[new ct(i,t,'"type" is required')];const p=$n(t.type);let g;switch(p){case"vector":case"raster":case"raster-dem":return g=Di({key:i,value:t,valueSpec:a[`source_${p.replace("-","_")}`],style:r.style,styleSpec:a,objectElementValidators:Nf}),g;case"geojson":if(g=Di({key:i,value:t,valueSpec:a.source_geojson,style:u,styleSpec:a,objectElementValidators:Nf}),t.cluster)for(const y in t.clusterProperties){const[w,b]=t.clusterProperties[y],A=typeof w=="string"?[w,["accumulated"],["get",y]]:w;g.push(...pr({key:`${i}.${y}.map`,value:b,expressionContext:"cluster-map"})),g.push(...pr({key:`${i}.${y}.reduce`,value:A,expressionContext:"cluster-reduce"}))}return g;case"video":return Di({key:i,value:t,valueSpec:a.source_video,style:u,styleSpec:a});case"image":return Di({key:i,value:t,valueSpec:a.source_image,style:u,styleSpec:a});case"canvas":return[new ct(i,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Yc({key:`${i}.type`,value:t.type,valueSpec:{values:oy(a)},style:u,styleSpec:a})}}function oy(r){return r.source.reduce((t,i)=>{const a=r[i];return a.type.type==="enum"&&(t=t.concat(Object.keys(a.type.values))),t},[])}function jf(r){const t=r.value,i=r.styleSpec,a=i.light,u=r.style;let p=[];const g=Zt(t);if(t===void 0)return p;if(g!=="object")return p=p.concat([new ct("light",t,`object expected, ${g} found`)]),p;for(const y in t){const w=y.match(/^(.*)-transition$/);p=p.concat(w&&a[w[1]]&&a[w[1]].transition?kr({key:y,value:t[y],valueSpec:i.transition,style:u,styleSpec:i}):a[y]?kr({key:y,value:t[y],valueSpec:a[y],style:u,styleSpec:i}):[new ct(y,t[y],`unknown property "${y}"`)])}return p}function ld(r){const t=r.value,i=r.key,a=r.style,u=r.styleSpec,p=u.terrain;let g=[];const y=Zt(t);if(t===void 0)return g;if(y!=="object")return g=g.concat([new ct("terrain",t,`object expected, ${y} found`)]),g;for(const w in t){const b=w.match(/^(.*)-transition$/);g=g.concat(b&&p[b[1]]&&p[b[1]].transition?kr({key:w,value:t[w],valueSpec:u.transition,style:a,styleSpec:u}):p[w]?kr({key:w,value:t[w],valueSpec:p[w],style:a,styleSpec:u}):[new ct(w,t[w],`unknown property "${w}"`)])}if(t.source){const w=a.sources&&a.sources[t.source],b=w&&$n(w.type);w?b!=="raster-dem"&&g.push(new ct(i,t.source,`terrain cannot be used with a source of type ${String(b)}, it only be used with a "raster-dem" source type`)):g.push(new ct(i,t.source,`source "${t.source}" not found`))}else g.push(new ct(i,t,'terrain is missing required property "source"'));return g}function Vf(r){const t=r.value,i=r.style,a=r.styleSpec,u=a.fog;let p=[];const g=Zt(t);if(t===void 0)return p;if(g!=="object")return p=p.concat([new ct("fog",t,`object expected, ${g} found`)]),p;for(const y in t){const w=y.match(/^(.*)-transition$/);p=p.concat(w&&u[w[1]]&&u[w[1]].transition?kr({key:y,value:t[y],valueSpec:a.transition,style:i,styleSpec:a}):u[y]?kr({key:y,value:t[y],valueSpec:u[y],style:i,styleSpec:a}):[new ct(y,t[y],`unknown property "${y}"`)])}return p}const $f={"*":()=>[],array:Rf,boolean:function(r){const t=r.value,i=r.key,a=Zt(t);return a!=="boolean"?[new ct(i,t,`boolean expected, ${a} found`)]:[]},number:Nl,color:function(r){const t=r.key,i=r.value,a=Zt(i);return a!=="string"?[new ct(t,i,`color expected, ${a} found`)]:Ah(i)===null?[new ct(t,i,`color expected, "${i}" found`)]:[]},enum:Yc,filter:Vl,function:Ul,layer:Ff,object:Di,source:Uf,light:jf,terrain:ld,fog:Vf,string:rs,formatted:function(r){return rs(r).length===0?[]:pr(r)},resolvedImage:function(r){return rs(r).length===0?[]:pr(r)},projection:function(r){const t=r.value,i=r.styleSpec,a=i.projection,u=r.style;let p=[];const g=Zt(t);if(g==="object")for(const y in t)p=p.concat(kr({key:y,value:t[y],valueSpec:a[y],style:u,styleSpec:i}));else g!=="string"&&(p=p.concat([new ct("projection",t,`object or string expected, ${g} found`)]));return p}};function kr(r){const t=r.value,i=r.valueSpec,a=r.styleSpec;return i.expression&&Ol($n(t))?Ul(r):i.expression&&Ta(dr(t))?pr(r):i.type&&$f[i.type]?$f[i.type](r):Di(bo({},r,{valueSpec:i.type?a[i.type]:i}))}function sy(r){const t=r.value,i=r.key,a=rs(r);return a.length||(t.indexOf("{fontstack}")===-1&&a.push(new ct(i,t,'"glyphs" url must include a "{fontstack}" token')),t.indexOf("{range}")===-1&&a.push(new ct(i,t,'"glyphs" url must include a "{range}" token'))),a}function Gf(r,t=Re){return yi(kr({key:"",value:r,valueSpec:t.$root,styleSpec:t,style:r,objectElementValidators:{glyphs:sy,"*":()=>[]}}))}const ay=r=>yi(Bf(r)),ly=r=>yi(ad(r));function yi(r){return r.slice().sort((t,i)=>t.line&&i.line?t.line-i.line:0)}function qf(r,t){let i=!1;if(t&&t.length)for(const a of t)r.fire(new wo(new Error(a.message))),i=!0;return i}var cy=ro,Oi=3;function ro(r,t,i){var a=this.cells=[];if(r instanceof ArrayBuffer){this.arrayBuffer=r;var u=new Int32Array(this.arrayBuffer);r=u[0],this.d=(t=u[1])+2*(i=u[2]);for(var p=0;p=A[L+0]&&a>=A[L+1])?(g[M]=!0,p.push(b[M])):g[M]=!1}}},ro.prototype._forEachCell=function(r,t,i,a,u,p,g,y){for(var w=this._convertToCellCoord(r),b=this._convertToCellCoord(t),A=this._convertToCellCoord(i),I=this._convertToCellCoord(a),M=w;M<=A;M++)for(var L=b;L<=I;L++){var R=this.d*L+M;if((!y||y(this._convertFromCellCoord(M),this._convertFromCellCoord(L),this._convertFromCellCoord(M+1),this._convertFromCellCoord(L+1)))&&u.call(this,r,t,i,a,R,p,g,y))return}},ro.prototype._convertFromCellCoord=function(r){return(r-this.padding)/this.scale},ro.prototype._convertToCellCoord=function(r){return Math.max(0,Math.min(this.d-1,Math.floor(r*this.scale)+this.padding))},ro.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var r=this.cells,t=Oi+this.cells.length+1+1,i=0,a=0;a=0||(u[p]=Ia(r[p],t)));r instanceof Error&&(u.message=r.message)}if(u.$name)throw new Error("$name property is reserved for worker serialization logic.");return a!=="Object"&&(u.$name=a),u}throw new Error("can't serialize object of type "+typeof r)}function Os(r){if(r==null||typeof r=="boolean"||typeof r=="number"||typeof r=="string"||r instanceof Boolean||r instanceof Number||r instanceof String||r instanceof Date||r instanceof RegExp||cd(r)||ud(r)||ArrayBuffer.isView(r)||r instanceof k.ImageData)return r;if(Array.isArray(r))return r.map(Os);if(typeof r=="object"){const t=r.$name||"Object",{klass:i}=tu[t];if(!i)throw new Error(`can't deserialize unregistered class ${t}`);if(i.deserialize)return i.deserialize(r);const a=Object.create(i.prototype);for(const u of Object.keys(r))u!=="$name"&&(a[u]=Os(r[u]));return a}throw new Error("can't deserialize object of type "+typeof r)}const at={"Latin-1 Supplement":r=>r>=128&&r<=255,Arabic:r=>r>=1536&&r<=1791,"Arabic Supplement":r=>r>=1872&&r<=1919,"Arabic Extended-A":r=>r>=2208&&r<=2303,"Hangul Jamo":r=>r>=4352&&r<=4607,"Unified Canadian Aboriginal Syllabics":r=>r>=5120&&r<=5759,Khmer:r=>r>=6016&&r<=6143,"Unified Canadian Aboriginal Syllabics Extended":r=>r>=6320&&r<=6399,"General Punctuation":r=>r>=8192&&r<=8303,"Letterlike Symbols":r=>r>=8448&&r<=8527,"Number Forms":r=>r>=8528&&r<=8591,"Miscellaneous Technical":r=>r>=8960&&r<=9215,"Control Pictures":r=>r>=9216&&r<=9279,"Optical Character Recognition":r=>r>=9280&&r<=9311,"Enclosed Alphanumerics":r=>r>=9312&&r<=9471,"Geometric Shapes":r=>r>=9632&&r<=9727,"Miscellaneous Symbols":r=>r>=9728&&r<=9983,"Miscellaneous Symbols and Arrows":r=>r>=11008&&r<=11263,"CJK Radicals Supplement":r=>r>=11904&&r<=12031,"Kangxi Radicals":r=>r>=12032&&r<=12255,"Ideographic Description Characters":r=>r>=12272&&r<=12287,"CJK Symbols and Punctuation":r=>r>=12288&&r<=12351,Hiragana:r=>r>=12352&&r<=12447,Katakana:r=>r>=12448&&r<=12543,Bopomofo:r=>r>=12544&&r<=12591,"Hangul Compatibility Jamo":r=>r>=12592&&r<=12687,Kanbun:r=>r>=12688&&r<=12703,"Bopomofo Extended":r=>r>=12704&&r<=12735,"CJK Strokes":r=>r>=12736&&r<=12783,"Katakana Phonetic Extensions":r=>r>=12784&&r<=12799,"Enclosed CJK Letters and Months":r=>r>=12800&&r<=13055,"CJK Compatibility":r=>r>=13056&&r<=13311,"CJK Unified Ideographs Extension A":r=>r>=13312&&r<=19903,"Yijing Hexagram Symbols":r=>r>=19904&&r<=19967,"CJK Unified Ideographs":r=>r>=19968&&r<=40959,"Yi Syllables":r=>r>=40960&&r<=42127,"Yi Radicals":r=>r>=42128&&r<=42191,"Hangul Jamo Extended-A":r=>r>=43360&&r<=43391,"Hangul Syllables":r=>r>=44032&&r<=55215,"Hangul Jamo Extended-B":r=>r>=55216&&r<=55295,"Private Use Area":r=>r>=57344&&r<=63743,"CJK Compatibility Ideographs":r=>r>=63744&&r<=64255,"Arabic Presentation Forms-A":r=>r>=64336&&r<=65023,"Vertical Forms":r=>r>=65040&&r<=65055,"CJK Compatibility Forms":r=>r>=65072&&r<=65103,"Small Form Variants":r=>r>=65104&&r<=65135,"Arabic Presentation Forms-B":r=>r>=65136&&r<=65279,"Halfwidth and Fullwidth Forms":r=>r>=65280&&r<=65519};function hd(r){for(const t of r)if(dd(t.charCodeAt(0)))return!0;return!1}function uy(r){for(const t of r)if(!Wf(t.charCodeAt(0)))return!1;return!0}function Wf(r){return!(at.Arabic(r)||at["Arabic Supplement"](r)||at["Arabic Extended-A"](r)||at["Arabic Presentation Forms-A"](r)||at["Arabic Presentation Forms-B"](r))}function dd(r){return!(r!==746&&r!==747&&(r<4352||!(at["Bopomofo Extended"](r)||at.Bopomofo(r)||at["CJK Compatibility Forms"](r)&&!(r>=65097&&r<=65103)||at["CJK Compatibility Ideographs"](r)||at["CJK Compatibility"](r)||at["CJK Radicals Supplement"](r)||at["CJK Strokes"](r)||!(!at["CJK Symbols and Punctuation"](r)||r>=12296&&r<=12305||r>=12308&&r<=12319||r===12336)||at["CJK Unified Ideographs Extension A"](r)||at["CJK Unified Ideographs"](r)||at["Enclosed CJK Letters and Months"](r)||at["Hangul Compatibility Jamo"](r)||at["Hangul Jamo Extended-A"](r)||at["Hangul Jamo Extended-B"](r)||at["Hangul Jamo"](r)||at["Hangul Syllables"](r)||at.Hiragana(r)||at["Ideographic Description Characters"](r)||at.Kanbun(r)||at["Kangxi Radicals"](r)||at["Katakana Phonetic Extensions"](r)||at.Katakana(r)&&r!==12540||!(!at["Halfwidth and Fullwidth Forms"](r)||r===65288||r===65289||r===65293||r>=65306&&r<=65310||r===65339||r===65341||r===65343||r>=65371&&r<=65503||r===65507||r>=65512&&r<=65519)||!(!at["Small Form Variants"](r)||r>=65112&&r<=65118||r>=65123&&r<=65126)||at["Unified Canadian Aboriginal Syllabics"](r)||at["Unified Canadian Aboriginal Syllabics Extended"](r)||at["Vertical Forms"](r)||at["Yijing Hexagram Symbols"](r)||at["Yi Syllables"](r)||at["Yi Radicals"](r))))}function Zf(r){return!(dd(r)||function(t){return!!(at["Latin-1 Supplement"](t)&&(t===167||t===169||t===174||t===177||t===188||t===189||t===190||t===215||t===247)||at["General Punctuation"](t)&&(t===8214||t===8224||t===8225||t===8240||t===8241||t===8251||t===8252||t===8258||t===8263||t===8264||t===8265||t===8273)||at["Letterlike Symbols"](t)||at["Number Forms"](t)||at["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||t===9003||t>=9085&&t<=9114||t>=9150&&t<=9165||t===9167||t>=9169&&t<=9179||t>=9186&&t<=9215)||at["Control Pictures"](t)&&t!==9251||at["Optical Character Recognition"](t)||at["Enclosed Alphanumerics"](t)||at["Geometric Shapes"](t)||at["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||at["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||at["CJK Symbols and Punctuation"](t)||at.Katakana(t)||at["Private Use Area"](t)||at["CJK Compatibility Forms"](t)||at["Small Form Variants"](t)||at["Halfwidth and Fullwidth Forms"](t)||t===8734||t===8756||t===8757||t>=9984&&t<=10087||t>=10102&&t<=10131||t===65532||t===65533)}(r))}function Hf(r){return r>=1424&&r<=2303||at["Arabic Presentation Forms-A"](r)||at["Arabic Presentation Forms-B"](r)}function hy(r,t){return!(!t&&Hf(r)||r>=2304&&r<=3583||r>=3840&&r<=4255||at.Khmer(r))}function dy(r){for(const t of r)if(Hf(t.charCodeAt(0)))return!0;return!1}const pd="deferred",fd="loading",md="loaded";let ka=null,d="unavailable",o=null;const c=function(r){r&&typeof r=="string"&&r.indexOf("NetworkError")>-1&&(d="error"),ka&&ka(r)};function f(){_.fire(new Is("pluginStateChange",{pluginStatus:d,pluginURL:o}))}const _=new vl,x=function(){return d},T=function(){if(d!==pd||!o)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");d=fd,f(),o&&ua({url:o},r=>{r?c(r):(d=md,f())})},S={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>d===md||S.applyArabicShaping!=null,isLoading:()=>d===fd,setState(r){d=r.pluginStatus,o=r.pluginURL},isParsed:()=>S.applyArabicShaping!=null&&S.processBidirectionalText!=null&&S.processStyledBidirectionalText!=null,getPluginURL:()=>o};class C{constructor(t,i){this.zoom=t,i?(this.now=i.now,this.fadeDuration=i.fadeDuration,this.transition=i.transition,this.pitch=i.pitch):(this.now=0,this.fadeDuration=0,this.transition={},this.pitch=0)}isSupportedScript(t){return function(i,a){for(const u of i)if(!hy(u.charCodeAt(0),a))return!1;return!0}(t,S.isLoaded())}}class z{constructor(t,i){this.property=t,this.value=i,this.expression=function(a,u){if(Ol(a))return new Xc(a,u);if(Ta(a)){const p=Fl(a,u);if(p.result==="error")throw new Error(p.value.map(g=>`${g.key}: ${g.message}`).join(", "));return p.value}{let p=a;return typeof a=="string"&&u.type==="color"&&(p=Fn.parse(a)),{kind:"constant",evaluate:()=>p}}}(i===void 0?t.specification.default:i,t.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(t,i,a){return this.property.possiblyEvaluate(this,t,i,a)}}class P{constructor(t){this.property=t,this.value=new z(t,void 0)}transitioned(t,i){return new j(this.property,this.value,i,vn({},t.transition,this.transition),t.now)}untransitioned(){return new j(this.property,this.value,null,{},0)}}class O{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)}getValue(t){return Dr(this._values[t].value.value)}setValue(t,i){this._values.hasOwnProperty(t)||(this._values[t]=new P(this._values[t].property)),this._values[t].value=new z(this._values[t].property,i===null?void 0:Dr(i))}getTransition(t){return Dr(this._values[t].transition)}setTransition(t,i){this._values.hasOwnProperty(t)||(this._values[t]=new P(this._values[t].property)),this._values[t].transition=Dr(i)||void 0}serialize(){const t={};for(const i of Object.keys(this._values)){const a=this.getValue(i);a!==void 0&&(t[i]=a);const u=this.getTransition(i);u!==void 0&&(t[`${i}-transition`]=u)}return t}transitioned(t,i){const a=new W(this._properties);for(const u of Object.keys(this._values))a._values[u]=this._values[u].transitioned(t,i._values[u]);return a}untransitioned(){const t=new W(this._properties);for(const i of Object.keys(this._values))t._values[i]=this._values[i].untransitioned();return t}}class j{constructor(t,i,a,u,p){const g=u.delay||0,y=u.duration||0;p=p||0,this.property=t,this.value=i,this.begin=p+g,this.end=this.begin+y,t.specification.transition&&(u.delay||u.duration)&&(this.prior=a)}possiblyEvaluate(t,i,a){const u=t.now||0,p=this.value.possiblyEvaluate(t,i,a),g=this.prior;if(g){if(u>this.end)return this.prior=null,p;if(this.value.isDataDriven())return this.prior=null,p;if(uthis.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const i=this.uint8;this._refreshViews(),i&&this.uint8.set(i)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}destroy(){this.int8=this.uint8=this.int16=this.uint16=this.int32=this.uint32=this.float32=null,this.arrayBuffer=null}}function ye(r,t=1){let i=0,a=0;return{members:r.map(u=>{const p=fe[u.type].BYTES_PER_ELEMENT,g=i=Ae(i,Math.max(t,p)),y=u.components||1;return a=Math.max(a,p),i+=p*y,{name:u.name,type:u.type,components:y,offset:g}}),size:Ae(i,Math.max(a,t)),alignment:t}}function Ae(r,t){return Math.ceil(r/t)*t}class We extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i){const a=this.length;return this.resize(a+1),this.emplace(a,t,i)}emplace(t,i,a){const u=2*t;return this.int16[u+0]=i,this.int16[u+1]=a,t}}We.prototype.bytesPerElement=4,dt(We,"StructArrayLayout2i4");class Ee extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,a){const u=this.length;return this.resize(u+1),this.emplace(u,t,i,a)}emplace(t,i,a,u){const p=3*t;return this.int16[p+0]=i,this.int16[p+1]=a,this.int16[p+2]=u,t}}Ee.prototype.bytesPerElement=6,dt(Ee,"StructArrayLayout3i6");class Fe extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,a,u){const p=this.length;return this.resize(p+1),this.emplace(p,t,i,a,u)}emplace(t,i,a,u,p){const g=4*t;return this.int16[g+0]=i,this.int16[g+1]=a,this.int16[g+2]=u,this.int16[g+3]=p,t}}Fe.prototype.bytesPerElement=8,dt(Fe,"StructArrayLayout4i8");class ke extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p,g,y){const w=this.length;return this.resize(w+1),this.emplace(w,t,i,a,u,p,g,y)}emplace(t,i,a,u,p,g,y,w){const b=6*t,A=12*t,I=3*t;return this.int16[b+0]=i,this.int16[b+1]=a,this.uint8[A+4]=u,this.uint8[A+5]=p,this.uint8[A+6]=g,this.uint8[A+7]=y,this.float32[I+2]=w,t}}ke.prototype.bytesPerElement=12,dt(ke,"StructArrayLayout2i4ub1f12");class qe extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a,u){const p=this.length;return this.resize(p+1),this.emplace(p,t,i,a,u)}emplace(t,i,a,u,p){const g=4*t;return this.float32[g+0]=i,this.float32[g+1]=a,this.float32[g+2]=u,this.float32[g+3]=p,t}}qe.prototype.bytesPerElement=16,dt(qe,"StructArrayLayout4f16");class Se extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p){const g=this.length;return this.resize(g+1),this.emplace(g,t,i,a,u,p)}emplace(t,i,a,u,p,g){const y=6*t,w=3*t;return this.uint16[y+0]=i,this.uint16[y+1]=a,this.uint16[y+2]=u,this.uint16[y+3]=p,this.float32[w+2]=g,t}}Se.prototype.bytesPerElement=12,dt(Se,"StructArrayLayout4ui1f12");class Be extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,a,u){const p=this.length;return this.resize(p+1),this.emplace(p,t,i,a,u)}emplace(t,i,a,u,p){const g=4*t;return this.uint16[g+0]=i,this.uint16[g+1]=a,this.uint16[g+2]=u,this.uint16[g+3]=p,t}}Be.prototype.bytesPerElement=8,dt(Be,"StructArrayLayout4ui8");class Xe extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p,g){const y=this.length;return this.resize(y+1),this.emplace(y,t,i,a,u,p,g)}emplace(t,i,a,u,p,g,y){const w=6*t;return this.int16[w+0]=i,this.int16[w+1]=a,this.int16[w+2]=u,this.int16[w+3]=p,this.int16[w+4]=g,this.int16[w+5]=y,t}}Xe.prototype.bytesPerElement=12,dt(Xe,"StructArrayLayout6i12");class $e extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p,g,y,w,b,A,I,M){const L=this.length;return this.resize(L+1),this.emplace(L,t,i,a,u,p,g,y,w,b,A,I,M)}emplace(t,i,a,u,p,g,y,w,b,A,I,M,L){const R=12*t;return this.int16[R+0]=i,this.int16[R+1]=a,this.int16[R+2]=u,this.int16[R+3]=p,this.uint16[R+4]=g,this.uint16[R+5]=y,this.uint16[R+6]=w,this.uint16[R+7]=b,this.int16[R+8]=A,this.int16[R+9]=I,this.int16[R+10]=M,this.int16[R+11]=L,t}}$e.prototype.bytesPerElement=24,dt($e,"StructArrayLayout4i4ui4i24");class Ye extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p,g){const y=this.length;return this.resize(y+1),this.emplace(y,t,i,a,u,p,g)}emplace(t,i,a,u,p,g,y){const w=10*t,b=5*t;return this.int16[w+0]=i,this.int16[w+1]=a,this.int16[w+2]=u,this.float32[b+2]=p,this.float32[b+3]=g,this.float32[b+4]=y,t}}Ye.prototype.bytesPerElement=20,dt(Ye,"StructArrayLayout3i3f20");class gt extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){const i=this.length;return this.resize(i+1),this.emplace(i,t)}emplace(t,i){return this.uint32[1*t+0]=i,t}}gt.prototype.bytesPerElement=4,dt(gt,"StructArrayLayout1ul4");class Et extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p,g,y,w,b,A,I,M,L){const R=this.length;return this.resize(R+1),this.emplace(R,t,i,a,u,p,g,y,w,b,A,I,M,L)}emplace(t,i,a,u,p,g,y,w,b,A,I,M,L,R){const F=20*t,$=10*t;return this.int16[F+0]=i,this.int16[F+1]=a,this.int16[F+2]=u,this.int16[F+3]=p,this.int16[F+4]=g,this.float32[$+3]=y,this.float32[$+4]=w,this.float32[$+5]=b,this.float32[$+6]=A,this.int16[F+14]=I,this.uint32[$+8]=M,this.uint16[F+18]=L,this.uint16[F+19]=R,t}}Et.prototype.bytesPerElement=40,dt(Et,"StructArrayLayout5i4f1i1ul2ui40");class pt extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p,g,y){const w=this.length;return this.resize(w+1),this.emplace(w,t,i,a,u,p,g,y)}emplace(t,i,a,u,p,g,y,w){const b=8*t;return this.int16[b+0]=i,this.int16[b+1]=a,this.int16[b+2]=u,this.int16[b+4]=p,this.int16[b+5]=g,this.int16[b+6]=y,this.int16[b+7]=w,t}}pt.prototype.bytesPerElement=16,dt(pt,"StructArrayLayout3i2i2i16");class wt extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p){const g=this.length;return this.resize(g+1),this.emplace(g,t,i,a,u,p)}emplace(t,i,a,u,p,g){const y=4*t,w=8*t;return this.float32[y+0]=i,this.float32[y+1]=a,this.float32[y+2]=u,this.int16[w+6]=p,this.int16[w+7]=g,t}}wt.prototype.bytesPerElement=16,dt(wt,"StructArrayLayout2f1f2i16");class Ut extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a,u){const p=this.length;return this.resize(p+1),this.emplace(p,t,i,a,u)}emplace(t,i,a,u,p){const g=12*t,y=3*t;return this.uint8[g+0]=i,this.uint8[g+1]=a,this.float32[y+1]=u,this.float32[y+2]=p,t}}Ut.prototype.bytesPerElement=12,dt(Ut,"StructArrayLayout2ub2f12");class Ot extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a){const u=this.length;return this.resize(u+1),this.emplace(u,t,i,a)}emplace(t,i,a,u){const p=3*t;return this.float32[p+0]=i,this.float32[p+1]=a,this.float32[p+2]=u,t}}Ot.prototype.bytesPerElement=12,dt(Ot,"StructArrayLayout3f12");class mt extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,a){const u=this.length;return this.resize(u+1),this.emplace(u,t,i,a)}emplace(t,i,a,u){const p=3*t;return this.uint16[p+0]=i,this.uint16[p+1]=a,this.uint16[p+2]=u,t}}mt.prototype.bytesPerElement=6,dt(mt,"StructArrayLayout3ui6");class en extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p,g,y,w,b,A,I,M,L,R,F,$,K,se,Y,re,ue){const ce=this.length;return this.resize(ce+1),this.emplace(ce,t,i,a,u,p,g,y,w,b,A,I,M,L,R,F,$,K,se,Y,re,ue)}emplace(t,i,a,u,p,g,y,w,b,A,I,M,L,R,F,$,K,se,Y,re,ue,ce){const Ie=30*t,Te=15*t,De=60*t;return this.int16[Ie+0]=i,this.int16[Ie+1]=a,this.int16[Ie+2]=u,this.float32[Te+2]=p,this.float32[Te+3]=g,this.uint16[Ie+8]=y,this.uint16[Ie+9]=w,this.uint32[Te+5]=b,this.uint32[Te+6]=A,this.uint32[Te+7]=I,this.uint16[Ie+16]=M,this.uint16[Ie+17]=L,this.uint16[Ie+18]=R,this.float32[Te+10]=F,this.float32[Te+11]=$,this.uint8[De+48]=K,this.uint8[De+49]=se,this.uint8[De+50]=Y,this.uint32[Te+13]=re,this.int16[Ie+28]=ue,this.uint8[De+58]=ce,t}}en.prototype.bytesPerElement=60,dt(en,"StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60");class rn extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p,g,y,w,b,A,I,M,L,R,F,$,K,se,Y,re,ue,ce,Ie,Te,De,Ze,Me,Ue,je,Ge){const et=this.length;return this.resize(et+1),this.emplace(et,t,i,a,u,p,g,y,w,b,A,I,M,L,R,F,$,K,se,Y,re,ue,ce,Ie,Te,De,Ze,Me,Ue,je,Ge)}emplace(t,i,a,u,p,g,y,w,b,A,I,M,L,R,F,$,K,se,Y,re,ue,ce,Ie,Te,De,Ze,Me,Ue,je,Ge,et){const Le=38*t,ot=19*t;return this.int16[Le+0]=i,this.int16[Le+1]=a,this.int16[Le+2]=u,this.float32[ot+2]=p,this.float32[ot+3]=g,this.int16[Le+8]=y,this.int16[Le+9]=w,this.int16[Le+10]=b,this.int16[Le+11]=A,this.int16[Le+12]=I,this.int16[Le+13]=M,this.uint16[Le+14]=L,this.uint16[Le+15]=R,this.uint16[Le+16]=F,this.uint16[Le+17]=$,this.uint16[Le+18]=K,this.uint16[Le+19]=se,this.uint16[Le+20]=Y,this.uint16[Le+21]=re,this.uint16[Le+22]=ue,this.uint16[Le+23]=ce,this.uint16[Le+24]=Ie,this.uint16[Le+25]=Te,this.uint16[Le+26]=De,this.uint16[Le+27]=Ze,this.uint16[Le+28]=Me,this.uint32[ot+15]=Ue,this.float32[ot+16]=je,this.float32[ot+17]=Ge,this.float32[ot+18]=et,t}}rn.prototype.bytesPerElement=76,dt(rn,"StructArrayLayout3i2f6i15ui1ul3f76");class on extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){const i=this.length;return this.resize(i+1),this.emplace(i,t)}emplace(t,i){return this.float32[1*t+0]=i,t}}on.prototype.bytesPerElement=4,dt(on,"StructArrayLayout1f4");class sn extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p){const g=this.length;return this.resize(g+1),this.emplace(g,t,i,a,u,p)}emplace(t,i,a,u,p,g){const y=5*t;return this.float32[y+0]=i,this.float32[y+1]=a,this.float32[y+2]=u,this.float32[y+3]=p,this.float32[y+4]=g,t}}sn.prototype.bytesPerElement=20,dt(sn,"StructArrayLayout5f20");class Mr extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,a,u){const p=this.length;return this.resize(p+1),this.emplace(p,t,i,a,u)}emplace(t,i,a,u,p){const g=6*t;return this.uint32[3*t+0]=i,this.uint16[g+2]=a,this.uint16[g+3]=u,this.uint16[g+4]=p,t}}Mr.prototype.bytesPerElement=12,dt(Mr,"StructArrayLayout1ul3ui12");class fr extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i){const a=this.length;return this.resize(a+1),this.emplace(a,t,i)}emplace(t,i,a){const u=2*t;return this.uint16[u+0]=i,this.uint16[u+1]=a,t}}fr.prototype.bytesPerElement=4,dt(fr,"StructArrayLayout2ui4");class vi extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){const i=this.length;return this.resize(i+1),this.emplace(i,t)}emplace(t,i){return this.uint16[1*t+0]=i,t}}vi.prototype.bytesPerElement=2,dt(vi,"StructArrayLayout1ui2");class io extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i){const a=this.length;return this.resize(a+1),this.emplace(a,t,i)}emplace(t,i,a){const u=2*t;return this.float32[u+0]=i,this.float32[u+1]=a,t}}io.prototype.bytesPerElement=8,dt(io,"StructArrayLayout2f8");class An extends pe{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.int16[this._pos2+3]}get tileAnchorY(){return this._structArray.int16[this._pos2+4]}get x1(){return this._structArray.float32[this._pos4+3]}get y1(){return this._structArray.float32[this._pos4+4]}get x2(){return this._structArray.float32[this._pos4+5]}get y2(){return this._structArray.float32[this._pos4+6]}get padding(){return this._structArray.int16[this._pos2+14]}get featureIndex(){return this._structArray.uint32[this._pos4+8]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+18]}get bucketIndex(){return this._structArray.uint16[this._pos2+19]}}An.prototype.size=40;class an extends Et{get(t){return new An(this,t)}}dt(an,"CollisionBoxArray");class Xt extends pe{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+8]}get numGlyphs(){return this._structArray.uint16[this._pos2+9]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+5]}get lineStartIndex(){return this._structArray.uint32[this._pos4+6]}get lineLength(){return this._structArray.uint32[this._pos4+7]}get segment(){return this._structArray.uint16[this._pos2+16]}get lowerSize(){return this._structArray.uint16[this._pos2+17]}get upperSize(){return this._structArray.uint16[this._pos2+18]}get lineOffsetX(){return this._structArray.float32[this._pos4+10]}get lineOffsetY(){return this._structArray.float32[this._pos4+11]}get writingMode(){return this._structArray.uint8[this._pos1+48]}get placedOrientation(){return this._structArray.uint8[this._pos1+49]}set placedOrientation(t){this._structArray.uint8[this._pos1+49]=t}get hidden(){return this._structArray.uint8[this._pos1+50]}set hidden(t){this._structArray.uint8[this._pos1+50]=t}get crossTileID(){return this._structArray.uint32[this._pos4+13]}set crossTileID(t){this._structArray.uint32[this._pos4+13]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+28]}get flipState(){return this._structArray.uint8[this._pos1+58]}set flipState(t){this._structArray.uint8[this._pos1+58]=t}}Xt.prototype.size=60;class Gn extends en{get(t){return new Xt(this,t)}}dt(Gn,"PlacedSymbolArray");class Br extends pe{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+8]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+9]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+10]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+11]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+12]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+13]}get key(){return this._structArray.uint16[this._pos2+14]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+17]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+18]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+19]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+20]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+21]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+22]}get featureIndex(){return this._structArray.uint16[this._pos2+23]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+24]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+25]}get numIconVertices(){return this._structArray.uint16[this._pos2+26]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+27]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+28]}get crossTileID(){return this._structArray.uint32[this._pos4+15]}set crossTileID(t){this._structArray.uint32[this._pos4+15]=t}get textOffset0(){return this._structArray.float32[this._pos4+16]}get textOffset1(){return this._structArray.float32[this._pos4+17]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+18]}}Br.prototype.size=76;class En extends rn{get(t){return new Br(this,t)}}dt(En,"SymbolInstanceArray");class Wr extends on{getoffsetX(t){return this.float32[1*t+0]}}dt(Wr,"GlyphOffsetArray");class nu extends We{getx(t){return this.int16[2*t+0]}gety(t){return this.int16[2*t+1]}}dt(nu,"SymbolLineVertexArray");class Bs extends pe{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]}get layoutVertexArrayOffset(){return this._structArray.uint16[this._pos2+4]}}Bs.prototype.size=12;class Gl extends Mr{get(t){return new Bs(this,t)}}dt(Gl,"FeatureIndexArray");class Mo extends fr{geta_centroid_pos0(t){return this.uint16[2*t+0]}geta_centroid_pos1(t){return this.uint16[2*t+1]}}dt(Mo,"FillExtrusionCentroidArray");const is=ye([{name:"a_pattern",components:4,type:"Uint16"},{name:"a_pixel_ratio",components:1,type:"Float32"}]),Fs=ye([{name:"a_dash",components:4,type:"Uint16"}]);var ru={exports:{}},ql={exports:{}};ql.exports=function(r,t){var i,a,u,p,g,y,w,b;for(a=r.length-(i=3&r.length),u=t,g=3432918353,y=461845907,b=0;b>>16)*g&65535)<<16)&4294967295)<<15|w>>>17))*y+(((w>>>16)*y&65535)<<16)&4294967295)<<13|u>>>19))+((5*(u>>>16)&65535)<<16)&4294967295))+((58964+(p>>>16)&65535)<<16);switch(w=0,i){case 3:w^=(255&r.charCodeAt(b+2))<<16;case 2:w^=(255&r.charCodeAt(b+1))<<8;case 1:u^=w=(65535&(w=(w=(65535&(w^=255&r.charCodeAt(b)))*g+(((w>>>16)*g&65535)<<16)&4294967295)<<15|w>>>17))*y+(((w>>>16)*y&65535)<<16)&4294967295}return u^=r.length,u=2246822507*(65535&(u^=u>>>16))+((2246822507*(u>>>16)&65535)<<16)&4294967295,u=3266489909*(65535&(u^=u>>>13))+((3266489909*(u>>>16)&65535)<<16)&4294967295,(u^=u>>>16)>>>0};var gd=ql.exports,$x={exports:{}};$x.exports=function(r,t){for(var i,a=r.length,u=t^a,p=0;a>=4;)i=1540483477*(65535&(i=255&r.charCodeAt(p)|(255&r.charCodeAt(++p))<<8|(255&r.charCodeAt(++p))<<16|(255&r.charCodeAt(++p))<<24))+((1540483477*(i>>>16)&65535)<<16),u=1540483477*(65535&u)+((1540483477*(u>>>16)&65535)<<16)^(i=1540483477*(65535&(i^=i>>>24))+((1540483477*(i>>>16)&65535)<<16)),a-=4,++p;switch(a){case 3:u^=(255&r.charCodeAt(p+2))<<16;case 2:u^=(255&r.charCodeAt(p+1))<<8;case 1:u=1540483477*(65535&(u^=255&r.charCodeAt(p)))+((1540483477*(u>>>16)&65535)<<16)}return u=1540483477*(65535&(u^=u>>>13))+((1540483477*(u>>>16)&65535)<<16),(u^=u>>>15)>>>0};var Gx=gd,ok=$x.exports;ru.exports=Gx,ru.exports.murmur3=Gx,ru.exports.murmur2=ok;var py=le(ru.exports);class Xf{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(t,i,a,u){this.ids.push(qx(t)),this.positions.push(i,a,u)}getPositions(t){const i=qx(t);let a=0,u=this.ids.length-1;for(;a>1;this.ids[g]>=i?u=g:a=g+1}const p=[];for(;this.ids[a]===i;)p.push({index:this.positions[3*a],start:this.positions[3*a+1],end:this.positions[3*a+2]}),a++;return p}static serialize(t,i){const a=new Float64Array(t.ids),u=new Uint32Array(t.positions);return fy(a,u,0,a.length-1),i&&i.push(a.buffer,u.buffer),{ids:a,positions:u}}static deserialize(t){const i=new Xf;return i.ids=t.ids,i.positions=t.positions,i.indexed=!0,i}}function qx(r){const t=+r;return!isNaN(t)&&Number.MIN_SAFE_INTEGER<=t&&t<=Number.MAX_SAFE_INTEGER?t:py(String(r))}function fy(r,t,i,a){for(;i>1];let p=i-1,g=a+1;for(;;){do p++;while(r[p]u);if(p>=g)break;Kf(r,p,g),Kf(t,3*p,3*g),Kf(t,3*p+1,3*g+1),Kf(t,3*p+2,3*g+2)}g-i`u_${u}`),this.type=a}setUniform(t,i,a,u,p){i.set(t,p,u.constantOr(this.value))}getBinding(t,i){return this.type==="color"?new Zx(t):new Yf(t)}}class iu{constructor(t,i){this.uniformNames=i.map(a=>`u_${a}`),this.pattern=null,this.pixelRatio=1}setConstantPatternPositions(t){this.pixelRatio=t.pixelRatio||1,this.pattern=t.tl.concat(t.br)}setUniform(t,i,a,u,p){const g=p==="u_pattern"||p==="u_dash"?this.pattern:p==="u_pixel_ratio"?this.pixelRatio:null;g&&i.set(t,p,g)}getBinding(t,i){return i==="u_pattern"||i==="u_dash"?new Wx(t):new Yf(t)}}class Us{constructor(t,i,a,u){this.expression=t,this.type=a,this.maxValue=0,this.paintVertexAttributes=i.map(p=>({name:`a_${p}`,type:"Float32",components:a==="color"?2:1,offset:0})),this.paintVertexArray=new u}populatePaintArray(t,i,a,u,p,g){const y=this.paintVertexArray.length,w=this.expression.evaluate(new C(0),i,{},p,u,g);this.paintVertexArray.resize(t),this._setPaintValue(y,t,w)}updatePaintArray(t,i,a,u,p){const g=this.expression.evaluate({zoom:0},a,u,void 0,p);this._setPaintValue(t,i,g)}_setPaintValue(t,i,a){if(this.type==="color"){const u=my(a);for(let p=t;p`u_${y}_t`),this.type=a,this.useIntegerZoom=u,this.zoom=p,this.maxValue=0,this.paintVertexAttributes=i.map(y=>({name:`a_${y}`,type:"Float32",components:a==="color"?4:2,offset:0})),this.paintVertexArray=new g}populatePaintArray(t,i,a,u,p,g){const y=this.expression.evaluate(new C(this.zoom),i,{},p,u,g),w=this.expression.evaluate(new C(this.zoom+1),i,{},p,u,g),b=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(b,t,y,w)}updatePaintArray(t,i,a,u,p){const g=this.expression.evaluate({zoom:this.zoom},a,u,void 0,p),y=this.expression.evaluate({zoom:this.zoom+1},a,u,void 0,p);this._setPaintValue(t,i,g,y)}_setPaintValue(t,i,a,u){if(this.type==="color"){const p=my(a),g=my(u);for(let y=t;y!0){this.binders={},this._buffers=[];const u=[];for(const p in t.paint._values){if(!a(p))continue;const g=t.paint.get(p);if(!(g instanceof Z&&ba(g.property.specification)))continue;const y=uk(p,t.type),w=g.value,b=g.property.specification.type,A=!!g.property.useIntegerZoom,I=p==="line-dasharray"||p.endsWith("pattern"),M=p==="line-dasharray"&&t.layout.get("line-cap").value.kind!=="constant";if(w.kind!=="constant"||M)if(w.kind==="source"||M||I){const L=Hx(p,b,"source");this.binders[p]=I?new Ma(w,y,b,L,t.id):new Us(w,y,b,L),u.push(`/a_${p}`)}else{const L=Hx(p,b,"composite");this.binders[p]=new Po(w,y,b,A,i,L),u.push(`/z_${p}`)}else this.binders[p]=I?new iu(w.value,y):new _d(w.value,y,b),u.push(`/u_${p}`)}this.cacheKey=u.sort().join("")}getMaxValue(t){const i=this.binders[t];return i instanceof Us||i instanceof Po?i.maxValue:0}populatePaintArrays(t,i,a,u,p,g){for(const y in this.binders){const w=this.binders[y];(w instanceof Us||w instanceof Po||w instanceof Ma)&&w.populatePaintArray(t,i,a,u,p,g)}}setConstantPatternPositions(t){for(const i in this.binders){const a=this.binders[i];a instanceof iu&&a.setConstantPatternPositions(t)}}updatePaintArrays(t,i,a,u,p,g){let y=!1;for(const w in t){const b=i.getPositions(w);for(const A of b){const I=a.feature(A.index);for(const M in this.binders){const L=this.binders[M];if((L instanceof Us||L instanceof Po||L instanceof Ma)&&L.expression.isStateDependent===!0){const R=u.paint.get(M);L.expression=R.value,L.updatePaintArray(A.start,A.end,I,t[w],p,g),y=!0}}}}return y}defines(){const t=[];for(const i in this.binders){const a=this.binders[i];(a instanceof _d||a instanceof iu)&&t.push(...a.uniformNames.map(u=>`#define HAS_UNIFORM_${u}`))}return t}getBinderAttributes(){const t=[];for(const i in this.binders){const a=this.binders[i];if(a instanceof Us||a instanceof Po||a instanceof Ma)for(let u=0;u!0){this.programConfigurations={};for(const u of t)this.programConfigurations[u.id]=new Pa(u,i,a);this.needsUpload=!1,this._featureMap=new Xf,this._bufferOffset=0}populatePaintArrays(t,i,a,u,p,g,y){for(const w in this.programConfigurations)this.programConfigurations[w].populatePaintArrays(t,i,u,p,g,y);i.id!==void 0&&this._featureMap.add(i.id,a,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,i,a,u,p){for(const g of a)this.needsUpload=this.programConfigurations[g.id].updatePaintArrays(t,this._featureMap,i,g,u,p)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(const i in this.programConfigurations)this.programConfigurations[i].upload(t);this.needsUpload=!1}}destroy(){for(const t in this.programConfigurations)this.programConfigurations[t].destroy()}}const ck={"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","pixel_ratio"],"fill-pattern":["pattern","pixel_ratio"],"fill-extrusion-pattern":["pattern","pixel_ratio"],"line-dasharray":["dash"]};function uk(r,t){return ck[r]||[r.replace(`${t}-`,"").replace(/-/g,"_")]}const hk={"line-pattern":{source:Se,composite:Se},"fill-pattern":{source:Se,composite:Se},"fill-extrusion-pattern":{source:Se,composite:Se},"line-dasharray":{source:Be,composite:Be}},dk={color:{source:io,composite:qe},number:{source:on,composite:io}};function Hx(r,t,i){const a=hk[r];return a&&a[i]||dk[t][i]}dt(_d,"ConstantBinder"),dt(iu,"PatternConstantBinder"),dt(Us,"SourceExpressionBinder"),dt(Ma,"PatternCompositeBinder"),dt(Po,"CompositeExpressionBinder"),dt(Pa,"ProgramConfiguration",{omit:["_buffers"]}),dt(Wl,"ProgramConfigurationSet");const Xx="-transition";class zo extends vl{constructor(t,i){if(super(),this.id=t.id,this.type=t.type,this._featureFilter={filter:()=>!0,needGeometry:!1,needFeature:!1},this._filterCompiled=!1,t.type!=="custom"&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,t.type!=="background"&&t.type!=="sky"&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter),i.layout&&(this._unevaluatedLayout=new H(i.layout)),i.paint)){this._transitionablePaint=new O(i.paint);for(const a in t.paint)this.setPaintProperty(a,t.paint[a],{validate:!1});for(const a in t.layout)this.setLayoutProperty(a,t.layout[a],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new X(i.paint)}}getLayoutProperty(t){return t==="visibility"?this.visibility:this._unevaluatedLayout.getValue(t)}setLayoutProperty(t,i,a={}){i!=null&&this._validate(ly,`layers.${this.id}.layout.${t}`,t,i,a)||(t!=="visibility"?this._unevaluatedLayout.setValue(t,i):this.visibility=i)}getPaintProperty(t){return xn(t,Xx)?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)}setPaintProperty(t,i,a={}){if(i!=null&&this._validate(ay,`layers.${this.id}.paint.${t}`,t,i,a))return!1;if(xn(t,Xx))return this._transitionablePaint.setTransition(t.slice(0,-11),i||void 0),!1;{const u=this._transitionablePaint._values[t],p=u.value.isDataDriven(),g=u.value;this._transitionablePaint.setValue(t,i),this._handleSpecialPaintPropertyUpdate(t);const y=this._transitionablePaint._values[t].value,w=y.isDataDriven(),b=xn(t,"pattern")||t==="line-dasharray";return w||p||b||this._handleOverridablePaintPropertyUpdate(t,g,y)}}_handleSpecialPaintPropertyUpdate(t){}getProgramIds(){return null}getProgramConfiguration(t){return null}_handleOverridablePaintPropertyUpdate(t,i,a){return!1}isHidden(t){return!!(this.minzoom&&t=this.maxzoom)||this.visibility==="none"}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(t,i){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,i)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,i)}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),Yo(t,(i,a)=>!(i===void 0||a==="layout"&&!Object.keys(i).length||a==="paint"&&!Object.keys(i).length))}_validate(t,i,a,u,p={}){return(!p||p.validate!==!1)&&qf(this,t.call(Gf,{key:i,layerType:this.type,objectKey:a,value:u,styleSpec:Re,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isSky(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const t in this.paint._values){const i=this.paint.get(t);if(i instanceof Z&&ba(i.property.specification)&&(i.value.kind==="source"||i.value.kind==="composite")&&i.value.isStateDependent)return!0}return!1}compileFilter(){this._filterCompiled||(this._featureFilter=Jc(this.filter),this._filterCompiled=!0)}invalidateCompiledFilter(){this._filterCompiled=!1}dynamicFilter(){return this._featureFilter.dynamicFilter}dynamicFilterNeedsFeature(){return this._featureFilter.needFeature}}const pk=ye([{name:"a_pos",components:2,type:"Int16"}],4),fk=ye([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]);class qn{constructor(t=[]){this.segments=t}prepareSegment(t,i,a,u){let p=this.segments[this.segments.length-1];return t>qn.MAX_VERTEX_ARRAY_LENGTH&&wn(`Max vertices per segment is ${qn.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}`),(!p||p.vertexLength+t>qn.MAX_VERTEX_ARRAY_LENGTH||p.sortKey!==u)&&(p={vertexOffset:i.length,primitiveOffset:a.length,vertexLength:0,primitiveLength:0},u!==void 0&&(p.sortKey=u),this.segments.push(p)),p}get(){return this.segments}destroy(){for(const t of this.segments)for(const i in t.vaos)t.vaos[i].destroy()}static simpleSegment(t,i,a,u){return new qn([{vertexOffset:t,primitiveOffset:i,vertexLength:a,primitiveLength:u,vaos:{},sortKey:0}])}}qn.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,dt(qn,"SegmentVector");var vt=8192;class za{constructor(t,i){t&&(i?this.setSouthWest(t).setNorthEast(i):t.length===4?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 ln?new ln(t.lng,t.lat):ln.convert(t),this}setSouthWest(t){return this._sw=t instanceof ln?new ln(t.lng,t.lat):ln.convert(t),this}extend(t){const i=this._sw,a=this._ne;let u,p;if(t instanceof ln)u=t,p=t;else{if(!(t instanceof za))return Array.isArray(t)?t.length===4||t.every(Array.isArray)?this.extend(za.convert(t)):this.extend(ln.convert(t)):typeof t=="object"&&t!==null&&t.hasOwnProperty("lat")&&(t.hasOwnProperty("lon")||t.hasOwnProperty("lng"))?this.extend(ln.convert(t)):this;if(u=t._sw,p=t._ne,!u||!p)return this}return i||a?(i.lng=Math.min(u.lng,i.lng),i.lat=Math.min(u.lat,i.lat),a.lng=Math.max(p.lng,a.lng),a.lat=Math.max(p.lat,a.lat)):(this._sw=new ln(u.lng,u.lat),this._ne=new ln(p.lng,p.lat)),this}getCenter(){return new ln((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 ln(this.getWest(),this.getNorth())}getSouthEast(){return new ln(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:a}=ln.convert(t);let u=this._sw.lng<=i&&i<=this._ne.lng;return this._sw.lng>this._ne.lng&&(u=this._sw.lng>=i&&i>=this._ne.lng),this._sw.lat<=a&&a<=this._ne.lat&&u}static convert(t){return!t||t instanceof za?t:new za(t)}}var Jf=1e-6,xi=typeof Float32Array<"u"?Float32Array:Array;function Kx(){var r=new xi(9);return xi!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[5]=0,r[6]=0,r[7]=0),r[0]=1,r[4]=1,r[8]=1,r}function Yx(r,t,i){var a=t[0],u=t[1],p=t[2],g=t[3],y=t[4],w=t[5],b=t[6],A=t[7],I=t[8],M=i[0],L=i[1],R=i[2],F=i[3],$=i[4],K=i[5],se=i[6],Y=i[7],re=i[8];return r[0]=M*a+L*g+R*b,r[1]=M*u+L*y+R*A,r[2]=M*p+L*w+R*I,r[3]=F*a+$*g+K*b,r[4]=F*u+$*y+K*A,r[5]=F*p+$*w+K*I,r[6]=se*a+Y*g+re*b,r[7]=se*u+Y*y+re*A,r[8]=se*p+Y*w+re*I,r}function Lo(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function gy(r,t){var i=t[0],a=t[1],u=t[2],p=t[3],g=t[4],y=t[5],w=t[6],b=t[7],A=t[8],I=t[9],M=t[10],L=t[11],R=t[12],F=t[13],$=t[14],K=t[15],se=i*y-a*g,Y=i*w-u*g,re=i*b-p*g,ue=a*w-u*y,ce=a*b-p*y,Ie=u*b-p*w,Te=A*F-I*R,De=A*$-M*R,Ze=A*K-L*R,Me=I*$-M*F,Ue=I*K-L*F,je=M*K-L*$,Ge=se*je-Y*Ue+re*Me+ue*Ze-ce*De+Ie*Te;return Ge?(r[0]=(y*je-w*Ue+b*Me)*(Ge=1/Ge),r[1]=(u*Ue-a*je-p*Me)*Ge,r[2]=(F*Ie-$*ce+K*ue)*Ge,r[3]=(M*ce-I*Ie-L*ue)*Ge,r[4]=(w*Ze-g*je-b*De)*Ge,r[5]=(i*je-u*Ze+p*De)*Ge,r[6]=($*re-R*Ie-K*Y)*Ge,r[7]=(A*Ie-M*re+L*Y)*Ge,r[8]=(g*Ue-y*Ze+b*Te)*Ge,r[9]=(a*Ze-i*Ue-p*Te)*Ge,r[10]=(R*ce-F*re+K*se)*Ge,r[11]=(I*re-A*ce-L*se)*Ge,r[12]=(y*De-g*Me-w*Te)*Ge,r[13]=(i*Me-a*De+u*Te)*Ge,r[14]=(F*Y-R*ue-$*se)*Ge,r[15]=(A*ue-I*Y+M*se)*Ge,r):null}function Zl(r,t,i){var a=t[0],u=t[1],p=t[2],g=t[3],y=t[4],w=t[5],b=t[6],A=t[7],I=t[8],M=t[9],L=t[10],R=t[11],F=t[12],$=t[13],K=t[14],se=t[15],Y=i[0],re=i[1],ue=i[2],ce=i[3];return r[0]=Y*a+re*y+ue*I+ce*F,r[1]=Y*u+re*w+ue*M+ce*$,r[2]=Y*p+re*b+ue*L+ce*K,r[3]=Y*g+re*A+ue*R+ce*se,r[4]=(Y=i[4])*a+(re=i[5])*y+(ue=i[6])*I+(ce=i[7])*F,r[5]=Y*u+re*w+ue*M+ce*$,r[6]=Y*p+re*b+ue*L+ce*K,r[7]=Y*g+re*A+ue*R+ce*se,r[8]=(Y=i[8])*a+(re=i[9])*y+(ue=i[10])*I+(ce=i[11])*F,r[9]=Y*u+re*w+ue*M+ce*$,r[10]=Y*p+re*b+ue*L+ce*K,r[11]=Y*g+re*A+ue*R+ce*se,r[12]=(Y=i[12])*a+(re=i[13])*y+(ue=i[14])*I+(ce=i[15])*F,r[13]=Y*u+re*w+ue*M+ce*$,r[14]=Y*p+re*b+ue*L+ce*K,r[15]=Y*g+re*A+ue*R+ce*se,r}function yd(r,t,i){var a,u,p,g,y,w,b,A,I,M,L,R,F=i[0],$=i[1],K=i[2];return t===r?(r[12]=t[0]*F+t[4]*$+t[8]*K+t[12],r[13]=t[1]*F+t[5]*$+t[9]*K+t[13],r[14]=t[2]*F+t[6]*$+t[10]*K+t[14],r[15]=t[3]*F+t[7]*$+t[11]*K+t[15]):(u=t[1],p=t[2],g=t[3],y=t[4],w=t[5],b=t[6],A=t[7],I=t[8],M=t[9],L=t[10],R=t[11],r[0]=a=t[0],r[1]=u,r[2]=p,r[3]=g,r[4]=y,r[5]=w,r[6]=b,r[7]=A,r[8]=I,r[9]=M,r[10]=L,r[11]=R,r[12]=a*F+y*$+I*K+t[12],r[13]=u*F+w*$+M*K+t[13],r[14]=p*F+b*$+L*K+t[14],r[15]=g*F+A*$+R*K+t[15]),r}function Hl(r,t,i){var a=i[0],u=i[1],p=i[2];return r[0]=t[0]*a,r[1]=t[1]*a,r[2]=t[2]*a,r[3]=t[3]*a,r[4]=t[4]*u,r[5]=t[5]*u,r[6]=t[6]*u,r[7]=t[7]*u,r[8]=t[8]*p,r[9]=t[9]*p,r[10]=t[10]*p,r[11]=t[11]*p,r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15],r}function _y(r,t,i){var a=Math.sin(i),u=Math.cos(i),p=t[4],g=t[5],y=t[6],w=t[7],b=t[8],A=t[9],I=t[10],M=t[11];return t!==r&&(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r[4]=p*u+b*a,r[5]=g*u+A*a,r[6]=y*u+I*a,r[7]=w*u+M*a,r[8]=b*u-p*a,r[9]=A*u-g*a,r[10]=I*u-y*a,r[11]=M*u-w*a,r}function Qf(r,t,i){var a=Math.sin(i),u=Math.cos(i),p=t[0],g=t[1],y=t[2],w=t[3],b=t[8],A=t[9],I=t[10],M=t[11];return t!==r&&(r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r[0]=p*u-b*a,r[1]=g*u-A*a,r[2]=y*u-I*a,r[3]=w*u-M*a,r[8]=p*a+b*u,r[9]=g*a+A*u,r[10]=y*a+I*u,r[11]=w*a+M*u,r}function Jx(r,t){return r[0]=t[0],r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=t[1],r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=t[2],r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function Qx(r,t,i){var a,u,p,g=i[0],y=i[1],w=i[2],b=Math.hypot(g,y,w);return b0&&(p=1/Math.sqrt(p)),r[0]=t[0]*p,r[1]=t[1]*p,r[2]=t[2]*p,r}function oo(r,t){return r[0]*t[0]+r[1]*t[1]+r[2]*t[2]}function xy(r,t,i){var a=t[0],u=t[1],p=t[2],g=i[0],y=i[1],w=i[2];return r[0]=u*w-p*y,r[1]=p*g-a*w,r[2]=a*y-u*g,r}function Nn(r,t,i){var a=t[0],u=t[1],p=t[2],g=i[3]*a+i[7]*u+i[11]*p+i[15];return r[0]=(i[0]*a+i[4]*u+i[8]*p+i[12])/(g=g||1),r[1]=(i[1]*a+i[5]*u+i[9]*p+i[13])/g,r[2]=(i[2]*a+i[6]*u+i[10]*p+i[14])/g,r}function nw(r,t,i){var a=i[0],u=i[1],p=i[2],g=t[0],y=t[1],w=t[2],b=u*w-p*y,A=p*g-a*w,I=a*y-u*g,M=u*I-p*A,L=p*b-a*I,R=a*A-u*b,F=2*i[3];return A*=F,I*=F,L*=2,R*=2,r[0]=g+(b*=F)+(M*=2),r[1]=y+A+L,r[2]=w+I+R,r}var Ed,Ro=vy,gk=tw,_k=vd;function rw(r,t,i){return r[0]=t[0]*i,r[1]=t[1]*i,r[2]=t[2]*i,r[3]=t[3]*i,r}function iw(r,t){var i=t[0],a=t[1],u=t[2],p=t[3],g=i*i+a*a+u*u+p*p;return g>0&&(g=1/Math.sqrt(g)),r[0]=i*g,r[1]=a*g,r[2]=u*g,r[3]=p*g,r}function Xl(r,t,i){var a=t[0],u=t[1],p=t[2],g=t[3];return r[0]=i[0]*a+i[4]*u+i[8]*p+i[12]*g,r[1]=i[1]*a+i[5]*u+i[9]*p+i[13]*g,r[2]=i[2]*a+i[6]*u+i[10]*p+i[14]*g,r[3]=i[3]*a+i[7]*u+i[11]*p+i[15]*g,r}function ow(){var r=new xi(4);return xi!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r[3]=1,r}function sw(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=1,r}function aw(r,t,i){i*=.5;var a=t[0],u=t[1],p=t[2],g=t[3],y=Math.sin(i),w=Math.cos(i);return r[0]=a*w+g*y,r[1]=u*w+p*y,r[2]=p*w-u*y,r[3]=g*w-a*y,r}function lw(r,t,i){i*=.5;var a=t[0],u=t[1],p=t[2],g=t[3],y=Math.sin(i),w=Math.cos(i);return r[0]=a*w-p*y,r[1]=u*w+g*y,r[2]=p*w+a*y,r[3]=g*w-u*y,r}yy(),Ed=new xi(4),xi!=Float32Array&&(Ed[0]=0,Ed[1]=0,Ed[2]=0,Ed[3]=0);var yk=iw;yy(),ou(1,0,0),ou(0,1,0),ow(),ow(),Kx();const vk=ye([{type:"Float32",name:"a_globe_pos",components:3},{type:"Float32",name:"a_uv",components:2}]),{members:cw}=vk,uw=ye([{name:"a_pos_3",components:3,type:"Int16"}]);var Td=ye([{name:"a_pos",type:"Int16",components:2}]);class wy{constructor(t,i){this.pos=t,this.dir=i}intersectsPlane(t,i,a){const u=oo(i,this.dir);if(Math.abs(u)<1e-6)return!1;const p=((t[0]-this.pos[0])*i[0]+(t[1]-this.pos[1])*i[1]+(t[2]-this.pos[2])*i[2])/u;return a[0]=this.pos[0]+this.dir[0]*p,a[1]=this.pos[1]+this.dir[1]*p,a[2]=this.pos[2]+this.dir[2]*p,!0}closestPointOnSphere(t,i,a){if(function(L,R){var F=L[0],$=L[1],K=L[2],se=R[0],Y=R[1],re=R[2];return Math.abs(F-se)<=Jf*Math.max(1,Math.abs(F),Math.abs(se))&&Math.abs($-Y)<=Jf*Math.max(1,Math.abs($),Math.abs(Y))&&Math.abs(K-re)<=Jf*Math.max(1,Math.abs(K),Math.abs(re))}(this.pos,t)||i===0)return a[0]=a[1]=a[2]=0,!1;const[u,p,g]=this.dir,y=this.pos[0]-t[0],w=this.pos[1]-t[1],b=this.pos[2]-t[2],A=u*u+p*p+g*g,I=2*(y*u+w*p+b*g),M=I*I-4*A*(y*y+w*w+b*b-i*i);if(M<0){const L=Math.max(-I/2,0),R=y+u*L,F=w+p*L,$=b+g*L,K=Math.hypot(R,F,$);return a[0]=R*i/K,a[1]=F*i/K,a[2]=$*i/K,!1}{const L=(-I-Math.sqrt(M))/(2*A);if(L<0){const R=Math.hypot(y,w,b);return a[0]=y*i/R,a[1]=w*i/R,a[2]=b*i/R,!1}return a[0]=y+u*L,a[1]=w+p*L,a[2]=b+g*L,!0}}}class by{constructor(t,i,a,u,p){this.TL=t,this.TR=i,this.BR=a,this.BL=u,this.horizon=p}static fromInvProjectionMatrix(t,i,a){const u=[-1,1,1],p=[1,1,1],g=[1,-1,1],y=[-1,-1,1],w=Nn(u,u,t),b=Nn(p,p,t),A=Nn(g,g,t),I=Nn(y,y,t);return new by(w,b,A,I,i/a)}}class Ey{constructor(t,i){this.points=t,this.planes=i}static fromInvProjectionMatrix(t,i,a,u){const p=Math.pow(2,a),g=[[-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(w=>{const b=Xl([],w,t),A=1/b[3]/i*p;return function(I,M,L){return I[0]=M[0]*L[0],I[1]=M[1]*L[1],I[2]=M[2]*L[2],I[3]=M[3]*L[3],I}(b,b,[A,A,u?1/b[3]:A,A])}),y=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(w=>{const b=Zr([],xy([],Ro([],g[w[0]],g[w[1]]),Ro([],g[w[2]],g[w[1]]))),A=-oo(b,g[w[1]]);return b.concat(A)});return new Ey(g,y)}}class Hr{static fromPoints(t){const i=[1/0,1/0,1/0],a=[-1/0,-1/0,-1/0];for(const u of t)xd(i,i,u),wd(a,a,u);return new Hr(i,a)}static applyTransform(t,i){const a=t.getCorners();for(let u=0;u=0;if(g===0)return 0;g!==i.length&&(a=!1)}if(a)return 2;for(let u=0;u<3;u++){let p=Number.MAX_VALUE,g=-Number.MAX_VALUE;for(let y=0;ythis.max[u]-this.min[u])return 0}return 1}}const Ty=5,hw=6,os=vt/Math.PI/2,xk=16383,Kl=64,Sd=[Kl,32,16],so=-os,ao=os,wk=[new Hr([so,so,so],[ao,ao,ao]),new Hr([so,so,so],[0,0,ao]),new Hr([0,so,so],[ao,0,ao]),new Hr([so,0,so],[0,ao,ao]),new Hr([0,0,so],[ao,ao,ao])];function em(r){return r*os/Id}function dw(r,t,i,a=!0){const u=Bi([],r._camera.position,r.worldSize),p=[t,i,1,1];Xl(p,p,r.pixelMatrixInverse),rw(p,p,1/p[3]);const g=Zr([],Ro([],p,u)),y=r.globeMatrix,w=[y[12],y[13],y[14]],b=Ro([],w,u),A=vd(b),I=Zr([],b),M=r.worldSize/(2*Math.PI),L=oo(I,g),R=Math.asin(M/A);if(R1?null:function(a,u,p,g){const y=Math.sin(p);return a*(Math.sin((1-g)*p)/y)+u*(Math.sin(g*p)/y)}(r.a[t],r.b[t],r.angle,Je(i,0,1))+r.center[t]}function ss(r){if(r.z<=1)return wk[r.z+2*r.y+r.x];const t=Ay(tm(r));return Hr.fromPoints(t)}function Yl(r,t,i){return Bi(r,r,1-i),bd(r,r,t,i)}function pw(r,t){const i=lu(t.zoom);if(i===0)return ss(r);const a=tm(r),u=Ay(a),p=as(a.getWest())*t.worldSize,g=as(a.getEast())*t.worldSize,y=ls(a.getNorth())*t.worldSize,w=ls(a.getSouth())*t.worldSize,b=[p,y,0],A=[g,y,0],I=[p,w,0],M=[g,w,0],L=gy([],t.globeMatrix);return Nn(b,b,L),Nn(A,A,L),Nn(I,I,L),Nn(M,M,L),u[0]=Yl(u[0],I,i),u[1]=Yl(u[1],M,i),u[2]=Yl(u[2],A,i),u[3]=Yl(u[3],b,i),Hr.fromPoints(u)}function fw(r,t,i){for(const a of r)Nn(a,a,t),Bi(a,a,i)}function Ek(r,t,i){const a=t/r.worldSize,u=r.globeMatrix;if(i.z<=1){const Te=ss(i).getCorners();return fw(Te,u,a),Hr.fromPoints(Te)}const p=tm(i),g=Ay(p);fw(g,u,a);const y=Number.MAX_VALUE,w=[-y,-y,-y],b=[y,y,y];if(p.contains(r.center)){for(const Ze of g)xd(b,b,Ze),wd(w,w,Ze);w[2]=0;const Te=r.point,De=[Te.x*a,Te.y*a,0];return xd(b,b,De),wd(w,w,De),new Hr(b,w)}const A=[u[12]*a,u[13]*a,u[14]*a],I=p.getCenter(),M=Je(r.center.lat,-zr,zr),L=Je(I.lat,-zr,zr),R=as(r.center.lng),F=ls(M);let $=R-as(I.lng);const K=F-ls(L);$>.5?$-=1:$<-.5&&($+=1);let se=0;Math.abs($)>Math.abs(K)?se=$>=0?1:3:(se=K>=0?0:2,bd(A,A,[u[4]*a,u[5]*a,u[6]*a],-Math.sin(St(K>=0?p.getSouth():p.getNorth()))*os));const Y=g[se],re=g[(se+1)%4],ue=new bk(Y,re,A),ce=[Sy(ue,0)||Y[0],Sy(ue,1)||Y[1],Sy(ue,2)||Y[2]],Ie=lu(r.zoom);if(Ie>0){const Te=function({x:Ze,y:Me,z:Ue},je,Ge,et,Le){const ot=1/(1<.5?_t=-1:Ct<-.5&&(_t=1),ft=((ft+_t)*je-(et*=je))*Ge+et,st=((st+_t)*je-et)*Ge+et,At=(At*je-(Le*=je))*Ge+Le,tt=(tt*je-Le)*Ge+Le,[[ft,tt,0],[st,tt,0],[st,At,0],[ft,At,0]]}(i,t,r._pixelsPerMercatorPixel,R,F);for(let Ze=0;ZeMath.PI/2*1.01}const yw=St(85),Tk=Math.cos(yw),Sk=Math.sin(yw),Id=63710088e-1,vw=2*Math.PI*Id;class La{constructor(t,i){if(isNaN(t)||isNaN(i))throw new Error(`Invalid LngLat object: (${t}, ${i})`);if(this.lng=+t,this.lat=+i,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new La(xt(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(t){const i=Math.PI/180,a=this.lat*i,u=t.lat*i,p=Math.sin(a)*Math.sin(u)+Math.cos(a)*Math.cos(u)*Math.cos((t.lng-this.lng)*i);return Id*Math.acos(Math.min(p,1))}toBounds(t=0){const i=360*t/40075017,a=i/Math.cos(Math.PI/180*this.lat);return new za(new La(this.lng-a,this.lat-i),new La(this.lng+a,this.lat+i))}toEcef(t){const i=em(t);return au(this.lat,this.lng,os+i)}static convert(t){if(t instanceof La)return t;if(Array.isArray(t)&&(t.length===2||t.length===3))return new La(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&typeof t=="object"&&t!==null)return new La(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: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}var ln=La;function ky(r){return vw*Math.cos(r*Math.PI/180)}function as(r){return(180+r)/360}function ls(r){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360}function Do(r,t){return r/ky(t)}function Fi(r){return 360*r-180}function Pr(r){return 360/Math.PI*Math.atan(Math.exp((180-360*r)*Math.PI/180))-90}function xw(r,t){return r*ky(Pr(t))}const zr=85.051129;function ww(r){return 1/Math.cos(r*Math.PI/180)}class cu{constructor(t,i,a=0){this.x=+t,this.y=+i,this.z=+a}static fromLngLat(t,i=0){const a=ln.convert(t);return new cu(as(a.lng),ls(a.lat),Do(i,a.lat))}toLngLat(){return new ln(Fi(this.x),Pr(this.y))}toAltitude(){return xw(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/vw*ww(Pr(this.y))}}function My(r,t,i,a,u,p,g,y,w){const b=(t+a)/2,A=(i+u)/2,I=new Ve(b,A);y(I),function(M,L,R,F,$,K){const se=R-$,Y=F-K;return Math.abs((F-L)*se-(R-M)*Y)/Math.hypot(se,Y)}(I.x,I.y,p.x,p.y,g.x,g.y)>=w?(My(r,t,i,b,A,p,I,y,w),My(r,b,A,a,u,I,g,y,w)):r.push(g)}function bw(r,t,i){let a=r[0],u=a.x,p=a.y;t(a);const g=[a];for(let y=1;yr.x+1||ar.y+1)&&wn("Geometry exceeds allowed extent, reduce your vector tile buffer size"),r}function Vs(r,t,i){const a=r.loadGeometry(),u=r.extent,p=vt/u;if(t&&i&&i.projection.isReprojectedInTileSpace){const g=1<{const L=Fi((t.x+M.x/u)/g),R=Pr((t.y+M.y/u)/g),F=A.project(L,R);M.x=(F.x*y-w)*u,M.y=(F.y*y-b)*u};for(let M=0;M=u||R.y<0||R.y>=u||(I(R),L.push(R));a[M]=L}}for(const g of a)for(const y of g)Ck(y,p);return a}function Jl(r,t){return{type:r.type,id:r.id,properties:r.properties,geometry:t?Vs(r):[]}}function rm(r,t,i,a,u){r.emplaceBack(2*t+(a+1)/2,2*i+(u+1)/2)}function im(r,t,i){r.emplaceBack(t.x,t.y,t.z,i[0]*16384,i[1]*16384,i[2]*16384)}class Ly{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(i=>i.id),this.index=t.index,this.hasPattern=!1,this.projection=t.projection,this.layoutVertexArray=new We,this.indexArray=new mt,this.segments=new qn,this.programConfigurations=new Wl(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id)}populate(t,i,a,u){const p=this.layers[0],g=[];let y=null;p.type==="circle"&&(y=p.layout.get("circle-sort-key"));for(const{feature:b,id:A,index:I,sourceLayerIndex:M}of t){const L=this.layers[0]._featureFilter.needGeometry,R=Jl(b,L);if(!this.layers[0]._featureFilter.filter(new C(this.zoom),R,a))continue;const F=y?y.evaluate(R,{},a):void 0,$={id:A,properties:b.properties,type:b.type,sourceLayerIndex:M,index:I,geometry:L?R.geometry:Vs(b,a,u),patterns:{},sortKey:F};g.push($)}y&&g.sort((b,A)=>b.sortKey-A.sortKey);let w=null;u.projection.name==="globe"&&(this.globeExtVertexArray=new Xe,w=u.projection);for(const b of g){const{geometry:A,index:I,sourceLayerIndex:M}=b,L=t[I].feature;this.addFeature(b,A,I,i.availableImages,a,w),i.featureIndex.insert(L,A,I,M,this.index)}}update(t,i,a,u){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,i,this.stateDependentLayers,a,u)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,pk.members),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.globeExtVertexArray&&(this.globeExtVertexBuffer=t.createVertexBuffer(this.globeExtVertexArray,fk.members))),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}addFeature(t,i,a,u,p,g){for(const y of i)for(const w of y){const b=w.x,A=w.y;if(b<0||b>=vt||A<0||A>=vt)continue;if(g){const L=g.projectTilePoint(b,A,p),R=g.upVector(p,b,A),F=this.globeExtVertexArray;im(F,L,R),im(F,L,R),im(F,L,R),im(F,L,R)}const I=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),M=I.vertexLength;rm(this.layoutVertexArray,b,A,-1,-1),rm(this.layoutVertexArray,b,A,1,-1),rm(this.layoutVertexArray,b,A,1,1),rm(this.layoutVertexArray,b,A,-1,1),this.indexArray.emplaceBack(M,M+1,M+2),this.indexArray.emplaceBack(M,M+2,M+3),I.vertexLength+=4,I.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,a,{},u,p)}}function Tw(r,t){for(let i=0;i1){if(Ry(r,t))return!0;for(let a=0;a1?i:i.sub(t)._mult(u)._add(t))}function Cw(r,t){let i,a,u,p=!1;for(let g=0;gt.y!=u.y>t.y&&t.x<(u.x-a.x)*(t.y-a.y)/(u.y-a.y)+a.x&&(p=!p)}return p}function Ql(r,t){let i=!1;for(let a=0,u=r.length-1;at.y!=g.y>t.y&&t.x<(g.x-p.x)*(t.y-p.y)/(g.y-p.y)+p.x&&(i=!i)}return i}function Iw(r,t,i,a,u){for(const g of r)if(t<=g.x&&i<=g.y&&a>=g.x&&u>=g.y)return!0;const p=[new Ve(t,i),new Ve(t,u),new Ve(a,u),new Ve(a,i)];if(r.length>2){for(const g of p)if(Ql(r,g))return!0}for(let g=0;gu.x&&t.x>u.x||r.yu.y&&t.y>u.y)return!1;const p=pi(r,t,i[0]);return p!==pi(r,t,i[1])||p!==pi(r,t,i[2])||p!==pi(r,t,i[3])}function uu(r,t,i){const a=t.paint.get(r).value;return a.kind==="constant"?a.value:i.programConfigurations.get(t.id).getMaxValue(r)}function om(r){return Math.sqrt(r[0]*r[0]+r[1]*r[1])}function kw(r,t,i,a,u){if(!t[0]&&!t[1])return r;const p=Ve.convert(t)._mult(u);i==="viewport"&&p._rotate(-a);const g=[];for(let y=0;y0){const Y=i.projection.upVector(b,L.x,L.y);F.x+=Y[0]*A*R,F.y+=Y[1]*A*R,F.z+=Y[2]*A*R}const $=p?L:Rk(F.x,F.y,F.z,a),K=p?r.tilespaceRays.map(Y=>Ok(Y,R)):r.queryGeometry.screenGeometry,se=Xl([],[F.x,F.y,F.z,1],a);if(!g&&p?w*=se[3]/i.cameraToCenterDistance:g&&!p&&(w*=i.cameraToCenterDistance/se[3]),p){const Y=Pr((M.y/vt+b.y)/(1<r.width||u.height>r.height||i.x>r.width-u.width||i.y>r.height-u.height)throw new RangeError("out of range source coordinates for image copy");if(u.width>t.width||u.height>t.height||a.x>t.width-u.width||a.y>t.height-u.height)throw new RangeError("out of range destination coordinates for image copy");const g=r.data,y=t.data;for(let w=0;w{t[r.evaluationKey]=w;const b=r.expression.evaluate(t);u.data[g+y+0]=Math.floor(255*b.r/b.a),u.data[g+y+1]=Math.floor(255*b.g/b.a),u.data[g+y+2]=Math.floor(255*b.b/b.a),u.data[g+y+3]=Math.floor(255*b.a)};if(r.clips)for(let g=0,y=0;g80*i){a=p=r[0],u=g=r[1];for(var R=i;Rp&&(p=y),w>g&&(g=w);b=(b=Math.max(p-a,g-u))!==0?32767/b:0}return kd(M,L,i,a,u,b,0),L}function Ow(r,t,i,a,u){var p,g;if(u===jy(r,t,i,a)>0)for(p=t;p=t;p-=a)g=Nw(p,r[p],r[p+1],g);return g&&am(g,g.next)&&(Pd(g),g=g.next),g}function ec(r,t){if(!r)return r;t||(t=r);var i,a=r;do if(i=!1,a.steiner||!am(a,a.next)&&Wn(a.prev,a,a.next)!==0)a=a.next;else{if(Pd(a),(a=t=a.prev)===a.next)break;i=!0}while(i||a!==t);return t}function kd(r,t,i,a,u,p,g){if(r){!g&&p&&function(A,I,M,L){var R=A;do R.z===0&&(R.z=Ny(R.x,R.y,I,M,L)),R.prevZ=R.prev,R.nextZ=R.next,R=R.next;while(R!==A);R.prevZ.nextZ=null,R.prevZ=null,function(F){var $,K,se,Y,re,ue,ce,Ie,Te=1;do{for(K=F,F=null,re=null,ue=0;K;){for(ue++,se=K,ce=0,$=0;$0||Ie>0&&se;)ce!==0&&(Ie===0||!se||K.z<=se.z)?(Y=K,K=K.nextZ,ce--):(Y=se,se=se.nextZ,Ie--),re?re.nextZ=Y:F=Y,Y.prevZ=re,re=Y;K=se}re.nextZ=null,Te*=2}while(ue>1)}(R)}(r,a,u,p);for(var y,w,b=r;r.prev!==r.next;)if(y=r.prev,w=r.next,p?Vk(r,a,u,p):jk(r))t.push(y.i/i|0),t.push(r.i/i|0),t.push(w.i/i|0),Pd(r),r=w.next,b=w.next;else if((r=w)===b){g?g===1?kd(r=$k(ec(r),t,i),t,i,a,u,p,2):g===2&&Gk(r,t,i,a,u,p):kd(ec(r),t,i,a,u,p,1);break}}}function jk(r){var t=r.prev,i=r,a=r.next;if(Wn(t,i,a)>=0)return!1;for(var u=t.x,p=i.x,g=a.x,y=t.y,w=i.y,b=a.y,A=up?u>g?u:g:p>g?p:g,L=y>w?y>b?y:b:w>b?w:b,R=a.next;R!==t;){if(R.x>=A&&R.x<=M&&R.y>=I&&R.y<=L&&hu(u,y,p,w,g,b,R.x,R.y)&&Wn(R.prev,R,R.next)>=0)return!1;R=R.next}return!0}function Vk(r,t,i,a){var u=r.prev,p=r,g=r.next;if(Wn(u,p,g)>=0)return!1;for(var y=u.x,w=p.x,b=g.x,A=u.y,I=p.y,M=g.y,L=yw?y>b?y:b:w>b?w:b,$=A>I?A>M?A:M:I>M?I:M,K=Ny(L,R,t,i,a),se=Ny(F,$,t,i,a),Y=r.prevZ,re=r.nextZ;Y&&Y.z>=K&&re&&re.z<=se;){if(Y.x>=L&&Y.x<=F&&Y.y>=R&&Y.y<=$&&Y!==u&&Y!==g&&hu(y,A,w,I,b,M,Y.x,Y.y)&&Wn(Y.prev,Y,Y.next)>=0||(Y=Y.prevZ,re.x>=L&&re.x<=F&&re.y>=R&&re.y<=$&&re!==u&&re!==g&&hu(y,A,w,I,b,M,re.x,re.y)&&Wn(re.prev,re,re.next)>=0))return!1;re=re.nextZ}for(;Y&&Y.z>=K;){if(Y.x>=L&&Y.x<=F&&Y.y>=R&&Y.y<=$&&Y!==u&&Y!==g&&hu(y,A,w,I,b,M,Y.x,Y.y)&&Wn(Y.prev,Y,Y.next)>=0)return!1;Y=Y.prevZ}for(;re&&re.z<=se;){if(re.x>=L&&re.x<=F&&re.y>=R&&re.y<=$&&re!==u&&re!==g&&hu(y,A,w,I,b,M,re.x,re.y)&&Wn(re.prev,re,re.next)>=0)return!1;re=re.nextZ}return!0}function $k(r,t,i){var a=r;do{var u=a.prev,p=a.next.next;!am(u,p)&&Bw(u,a,a.next,p)&&Md(u,p)&&Md(p,u)&&(t.push(u.i/i|0),t.push(a.i/i|0),t.push(p.i/i|0),Pd(a),Pd(a.next),a=r=p),a=a.next}while(a!==r);return ec(a)}function Gk(r,t,i,a,u,p){var g=r;do{for(var y=g.next.next;y!==g.prev;){if(g.i!==y.i&&Xk(g,y)){var w=Fw(g,y);return g=ec(g,g.next),w=ec(w,w.next),kd(g,t,i,a,u,p,0),void kd(w,t,i,a,u,p,0)}y=y.next}g=g.next}while(g!==r)}function qk(r,t){return r.x-t.x}function Wk(r,t){var i=function(u,p){var g,y=p,w=u.x,b=u.y,A=-1/0;do{if(b<=y.y&&b>=y.next.y&&y.next.y!==y.y){var I=y.x+(b-y.y)*(y.next.x-y.x)/(y.next.y-y.y);if(I<=w&&I>A&&(A=I,g=y.x=y.x&&y.x>=R&&w!==y.x&&hu(bg.x||y.x===g.x&&Zk(g,y)))&&(g=y,$=M)),y=y.next;while(y!==L);return g}(r,t);if(!i)return t;var a=Fw(i,r);return ec(a,a.next),ec(i,i.next)}function Zk(r,t){return Wn(r.prev,r,t.prev)<0&&Wn(t.next,r,r.next)<0}function Ny(r,t,i,a,u){return(r=1431655765&((r=858993459&((r=252645135&((r=16711935&((r=(r-i)*u|0)|r<<8))|r<<4))|r<<2))|r<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-a)*u|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Hk(r){var t=r,i=r;do(t.x=(r-g)*(p-y)&&(r-g)*(a-y)>=(i-g)*(t-y)&&(i-g)*(p-y)>=(u-g)*(a-y)}function Xk(r,t){return r.next.i!==t.i&&r.prev.i!==t.i&&!function(i,a){var u=i;do{if(u.i!==i.i&&u.next.i!==i.i&&u.i!==a.i&&u.next.i!==a.i&&Bw(u,u.next,i,a))return!0;u=u.next}while(u!==i);return!1}(r,t)&&(Md(r,t)&&Md(t,r)&&function(i,a){var u=i,p=!1,g=(i.x+a.x)/2,y=(i.y+a.y)/2;do u.y>y!=u.next.y>y&&u.next.y!==u.y&&g<(u.next.x-u.x)*(y-u.y)/(u.next.y-u.y)+u.x&&(p=!p),u=u.next;while(u!==i);return p}(r,t)&&(Wn(r.prev,r,t.prev)||Wn(r,t.prev,t))||am(r,t)&&Wn(r.prev,r,r.next)>0&&Wn(t.prev,t,t.next)>0)}function Wn(r,t,i){return(t.y-r.y)*(i.x-t.x)-(t.x-r.x)*(i.y-t.y)}function am(r,t){return r.x===t.x&&r.y===t.y}function Bw(r,t,i,a){var u=cm(Wn(r,t,i)),p=cm(Wn(r,t,a)),g=cm(Wn(i,a,r)),y=cm(Wn(i,a,t));return u!==p&&g!==y||!(u!==0||!lm(r,i,t))||!(p!==0||!lm(r,a,t))||!(g!==0||!lm(i,r,a))||!(y!==0||!lm(i,t,a))}function lm(r,t,i){return t.x<=Math.max(r.x,i.x)&&t.x>=Math.min(r.x,i.x)&&t.y<=Math.max(r.y,i.y)&&t.y>=Math.min(r.y,i.y)}function cm(r){return r>0?1:r<0?-1:0}function Md(r,t){return Wn(r.prev,r,r.next)<0?Wn(r,t,r.next)>=0&&Wn(r,r.prev,t)>=0:Wn(r,t,r.prev)<0||Wn(r,r.next,t)<0}function Fw(r,t){var i=new Uy(r.i,r.x,r.y),a=new Uy(t.i,t.x,t.y),u=r.next,p=t.prev;return r.next=t,t.prev=r,i.next=u,u.prev=i,a.next=i,i.prev=a,p.next=a,a.prev=p,a}function Nw(r,t,i,a){var u=new Uy(r,t,i);return a?(u.next=a.next,u.prev=a,a.next.prev=u,a.next=u):(u.prev=u,u.next=u),u}function Pd(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function Uy(r,t,i){this.i=r,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function jy(r,t,i,a){for(var u=0,p=t,g=i-a;p0&&i.holes.push(a+=r[u-1].length)}return i};var Vy=le(Fy.exports);function Kk(r,t,i,a,u){Uw(r,t,i||0,a||r.length-1,u||Yk)}function Uw(r,t,i,a,u){for(;a>i;){if(a-i>600){var p=a-i+1,g=t-i+1,y=Math.log(p),w=.5*Math.exp(2*y/3),b=.5*Math.sqrt(y*w*(p-w)/p)*(g-p/2<0?-1:1);Uw(r,t,Math.max(i,Math.floor(t-g*w/p+b)),Math.min(a,Math.floor(t+(p-g)*w/p+b)),u)}var A=r[t],I=i,M=a;for(zd(r,i,t),u(r[a],A)>0&&zd(r,i,a);I0;)M--}u(r[i],A)===0?zd(r,i,M):zd(r,++M,a),M<=t&&(i=M+1),t<=M&&(a=M-1)}}function zd(r,t,i){var a=r[t];r[t]=r[i],r[i]=a}function Yk(r,t){return rt?1:0}function $y(r,t){const i=r.length;if(i<=1)return[r];const a=[];let u,p;for(let g=0;g1)for(let g=0;gi.id),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new We,this.indexArray=new mt,this.indexArray2=new fr,this.programConfigurations=new Wl(t.layers,t.zoom),this.segments=new qn,this.segments2=new qn,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id),this.projection=t.projection}populate(t,i,a,u){this.hasPattern=Gy("fill",this.layers,i);const p=this.layers[0].layout.get("fill-sort-key"),g=[];for(const{feature:y,id:w,index:b,sourceLayerIndex:A}of t){const I=this.layers[0]._featureFilter.needGeometry,M=Jl(y,I);if(!this.layers[0]._featureFilter.filter(new C(this.zoom),M,a))continue;const L=p?p.evaluate(M,{},a,i.availableImages):void 0,R={id:w,properties:y.properties,type:y.type,sourceLayerIndex:A,index:b,geometry:I?M.geometry:Vs(y,a,u),patterns:{},sortKey:L};g.push(R)}p&&g.sort((y,w)=>y.sortKey-w.sortKey);for(const y of g){const{geometry:w,index:b,sourceLayerIndex:A}=y;if(this.hasPattern){const I=qy("fill",this.layers,y,this.zoom,i);this.patternFeatures.push(I)}else this.addFeature(y,w,b,a,{},i.availableImages);i.featureIndex.insert(t[b].feature,w,b,A,this.index)}}update(t,i,a,u){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,i,this.stateDependentLayers,a,u)}addFeatures(t,i,a,u,p){for(const g of this.patternFeatures)this.addFeature(g,g.geometry,g.index,i,a,u)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Uk),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,i,a,u,p,g=[]){for(const y of $y(i,500)){let w=0;for(const R of y)w+=R.length;const b=this.segments.prepareSegment(w,this.layoutVertexArray,this.indexArray),A=b.vertexLength,I=[],M=[];for(const R of y){if(R.length===0)continue;R!==y[0]&&M.push(I.length/2);const F=this.segments2.prepareSegment(R.length,this.layoutVertexArray,this.indexArray2),$=F.vertexLength;this.layoutVertexArray.emplaceBack(R[0].x,R[0].y),this.indexArray2.emplaceBack($+R.length-1,$),I.push(R[0].x),I.push(R[0].y);for(let K=1;K>3}if(u--,a===1||a===2)p+=r.readSVarint(),g+=r.readSVarint(),a===1&&(t&&y.push(t),t=[]),t.push(new oM(p,g));else{if(a!==7)throw new Error("unknown command "+a);t&&t.push(t[0].clone())}}return t&&y.push(t),y},du.prototype.bbox=function(){var r=this._pbf;r.pos=this._geometry;for(var t=r.readVarint()+r.pos,i=1,a=0,u=0,p=0,g=1/0,y=-1/0,w=1/0,b=-1/0;r.pos>3}if(a--,i===1||i===2)(u+=r.readSVarint())y&&(y=u),(p+=r.readSVarint())b&&(b=p);else if(i!==7)throw new Error("unknown command "+i)}return[g,w,y,b]},du.prototype.toGeoJSON=function(r,t,i){var a,u,p=this.extent*Math.pow(2,i),g=this.extent*r,y=this.extent*t,w=this.loadGeometry(),b=du.types[this.type];function A(L){for(var R=0;R>3;u=g===1?a.readString():g===2?a.readFloat():g===3?a.readDouble():g===4?a.readVarint64():g===5?a.readVarint():g===6?a.readSVarint():g===7?a.readBoolean():null}return u}(i))}$w.prototype.feature=function(r){if(r<0||r>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[r];var t=this._pbf.readVarint()+this._pbf.pos;return new lM(this._pbf,t,this.extent,this._keys,this._values)};var uM=Vw;function hM(r,t,i){if(r===3){var a=new uM(i,i.readVarint()+i.pos);a.length&&(t[a.name]=a)}}var Wy=hm.VectorTile=function(r,t){this.layers=r.readFields(hM,{},t)},dm=hm.VectorTileFeature=jw;function pm(r,t,i,a){const u=[],p=a===0?(g,y,w,b,A,I)=>{g.push(new Ve(I,w+(I-y)/(b-y)*(A-w)))}:(g,y,w,b,A,I)=>{g.push(new Ve(y+(I-w)/(A-w)*(b-y),I))};for(const g of r){const y=[];for(const w of g){if(w.length<=2)continue;const b=[];for(let M=0;Mt&&p(b,L,R,F,$,t):K>i?se=t&&p(b,L,R,F,$,t),se>i&&K<=i&&p(b,L,R,F,$,i)}let A=w[w.length-1];const I=a===0?A.x:A.y;I>=t&&I<=i&&b.push(A),b.length&&(A=b[b.length-1],b[0].x===A.x&&b[0].y===A.y||b.push(b[0]),y.push(b))}y.length&&u.push(y)}return u}hm.VectorTileLayer=Vw;const dM=dm.types,pM=Math.pow(2,13);function Ld(r,t,i,a,u,p,g,y){r.emplaceBack((t<<1)+g,(i<<1)+p,(Math.floor(a*pM)<<1)+u,Math.round(y))}function Rd(r,t,i){r.emplaceBack(t.x,t.y,t.z,i[0]*16384,i[1]*16384,i[2]*16384)}class Gw{constructor(){this.acc=new Ve(0,0),this.polyCount=[]}startRing(t){this.currentPolyCount={edges:0,top:0},this.polyCount.push(this.currentPolyCount),this.min||(this.min=new Ve(t.x,t.y),this.max=new Ve(t.x,t.y))}append(t,i){this.currentPolyCount.edges++,this.acc._add(t);const a=this.min,u=this.max;t.xu.x&&(u.x=t.x),t.yu.y&&(u.y=t.y),((t.x===0||t.x===vt)&&t.x===i.x)!=((t.y===0||t.y===vt)&&t.y===i.y)&&this.processBorderOverlap(t,i),i.x<0!=t.x<0&&this.addBorderIntersection(0,Wt(i.y,t.y,(0-i.x)/(t.x-i.x))),i.x>vt!=t.x>vt&&this.addBorderIntersection(1,Wt(i.y,t.y,(vt-i.x)/(t.x-i.x))),i.y<0!=t.y<0&&this.addBorderIntersection(2,Wt(i.x,t.x,(0-i.y)/(t.y-i.y))),i.y>vt!=t.y>vt&&this.addBorderIntersection(3,Wt(i.x,t.x,(vt-i.y)/(t.y-i.y)))}addBorderIntersection(t,i){this.borders||(this.borders=[[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE]]);const a=this.borders[t];ia[1]&&(a[1]=i)}processBorderOverlap(t,i){if(t.x===i.x){if(t.y===i.y)return;const a=t.x===0?0:1;this.addBorderIntersection(a,i.y),this.addBorderIntersection(a,t.y)}else{const a=t.y===0?2:3;this.addBorderIntersection(a,i.x),this.addBorderIntersection(a,t.x)}}centroid(){const t=this.polyCount.reduce((i,a)=>i+a.edges,0);return t!==0?this.acc.div(t)._round():new Ve(0,0)}span(){return new Ve(this.max.x-this.min.x,this.max.y-this.min.y)}intersectsCount(){return this.borders.reduce((t,i)=>t+ +(i[0]!==Number.MAX_VALUE),0)}}class Dd{constructor(t){this.zoom=t.zoom,this.canonical=t.canonical,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(i=>i.id),this.index=t.index,this.hasPattern=!1,this.edgeRadius=0,this.projection=t.projection,this.layoutVertexArray=new Fe,this.centroidVertexArray=new Mo,this.indexArray=new mt,this.programConfigurations=new Wl(t.layers,t.zoom),this.segments=new qn,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id),this.enableTerrain=t.enableTerrain}populate(t,i,a,u){this.features=[],this.hasPattern=Gy("fill-extrusion",this.layers,i),this.featuresOnBorder=[],this.borders=[[],[],[],[]],this.borderDoneWithNeighborZ=[-1,-1,-1,-1],this.tileToMeter=function(p){const g=Math.exp(Math.PI*(1-p.y/(1<=0;K--){const se=L[K];(se.length===0||(R=se[0]).every(Y=>Y.x<=0)||R.every(Y=>Y.x>=vt)||R.every(Y=>Y.y<=0)||R.every(Y=>Y.y>=vt))&&L.splice(K,1)}var R;let F;if(A)F=Yw(L,w,u);else{F=[];for(const K of L)F.push({polygon:K,bounds:w})}const $=M?this.edgeRadius:0;for(const{polygon:K,bounds:se}of F){let Y=0,re=0;for(const ce of K)M&&!ce[0].equals(ce[ce.length-1])&&ce.push(ce[0]),re+=M?ce.length-1:ce.length;const ue=this.segments.prepareSegment((M?5:4)*re,this.layoutVertexArray,this.indexArray);if(M){const ce=[],Ie=[];Y=ue.vertexLength;for(const De of K){let Ze,Me;De.length&&De!==K[0]&&Ie.push(ce.length/2),Ze=De[1].sub(De[0])._perp()._unit();for(let Ue=1;Ue4&&Hw(ce[ce.length-2],ce[0],ce[1]),Me=$?fM(ce[ce.length-2],ce[0],ce[1],$):0;Te=ce[1].sub(ce[0])._perp()._unit();let Ue=!0;for(let je=1,Ge=0;je0?1:0,tt=et.dist(Le);if(Ge+tt>32768&&(Ge=0),$){De=ot.sub(Le)._perp()._unit();let It=Ww(et,Le,ot,qw(Te,De),$);isNaN(It)&&(It=0);const bt=Le.sub(et)._unit();et=et.add(bt.mult(Me))._round(),Le=Le.add(bt.mult(-It))._round(),Me=It,Te=De}const _t=ue.vertexLength,Ct=ce.length>4&&Hw(et,Le,ot);let Ht=Xw(Ge,Ze,Ue);if(Ld(this.layoutVertexArray,et.x,et.y,st,At,0,0,Ht),Ld(this.layoutVertexArray,et.x,et.y,st,At,0,1,Ht),Ge+=tt,Ht=Xw(Ge,Ct,!Ue),Ze=Ct,Ld(this.layoutVertexArray,Le.x,Le.y,st,At,0,0,Ht),Ld(this.layoutVertexArray,Le.x,Le.y,st,At,0,1,Ht),ue.vertexLength+=4,this.indexArray.emplaceBack(_t+0,_t+1,_t+2),this.indexArray.emplaceBack(_t+1,_t+3,_t+2),ue.primitiveLength+=2,$){const It=Y+(je===1?ce.length-2:je-2),bt=je===1?Y:It+1;if(this.indexArray.emplaceBack(_t+1,It,_t+3),this.indexArray.emplaceBack(It,bt,_t+3),ue.primitiveLength+=2,Ie===void 0&&(Ie=_t),!Zw(ot,ce[je],se)){const bn=je===ce.length-1?Ie:ue.vertexLength;this.indexArray.emplaceBack(_t+2,_t+3,bn),this.indexArray.emplaceBack(_t+3,bn+1,bn),this.indexArray.emplaceBack(_t+3,bt,bn+1),ue.primitiveLength+=3}Ue=!Ue}if(A){const It=this.layoutVertexExtArray,bt=b.projectTilePoint(et.x,et.y,u),bn=b.projectTilePoint(Le.x,Le.y,u),zt=b.upVector(u,et.x,et.y),Lt=b.upVector(u,Le.x,Le.y);Rd(It,bt,zt),Rd(It,bt,zt),Rd(It,bn,Lt),Rd(It,bn,Lt)}}M&&(Y+=ce.length-1)}}if(I&&I.polyCount.length>0){if(I.borders){I.vertexArrayOffset=this.centroidVertexArray.length;const K=I.borders,se=this.featuresOnBorder.push(I)-1;for(let Y=0;Y<4;Y++)K[Y][0]!==Number.MAX_VALUE&&this.borders[Y].push(se)}this.encodeCentroid(I.borders?void 0:I.centroid(),I)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,a,p,g,u)}sortBorders(){for(let t=0;t<4;t++)this.borders[t].sort((i,a)=>this.featuresOnBorder[i].borders[t][0]-this.featuresOnBorder[a].borders[t][0])}encodeCentroid(t,i,a=!0){let u,p;if(t)if(t.y!==0){const y=i.span()._mult(this.tileToMeter);u=(Math.max(t.x,1)<<3)+Math.min(7,Math.round(y.x/10)),p=(Math.max(t.y,1)<<3)+Math.min(7,Math.round(y.y/10))}else u=Math.ceil(7*(t.x+450)),p=0;else u=0,p=+a;let g=a?this.centroidVertexArray.length:i.vertexArrayOffset;for(const y of i.polyCount){a&&this.centroidVertexArray.resize(this.centroidVertexArray.length+4*y.edges+y.top);for(let w=0;wi[1].x&&t.x>i[1].x||r.yi[1].y&&t.y>i[1].y}function Hw(r,t,i){if(r.x<0||r.x>=vt||t.x<0||t.x>=vt||i.x<0||i.x>=vt)return!1;const a=i.sub(t),u=a.perp(),p=r.sub(t);return(a.x*p.x+a.y*p.y)/Math.sqrt((a.x*a.x+a.y*a.y)*(p.x*p.x+p.y*p.y))>-.866&&u.x*p.x+u.y*p.y<0}function Xw(r,t,i){const a=t?2|r:-3&r;return i?1|a:-2&a}function Kw(){const r=Math.PI/32,t=Math.tan(r),i=Id;return i*Math.sqrt(1+2*t*t)-i}function Yw(r,t,i){const a=1<{for(const Te of ce)R.push({polygon:Te,bounds:Ie})},$=Math.ceil(Math.log2(A)),K=Math.ceil(Math.log2(I)),se=$-K,Y=[];for(let ce=0;ce0?0:1);for(let ce=0;ceIe+1?ue.push({polygons:Ge,bounds:Le,depth:Ie+1}):F(Ge,Le)}if(et.length){const Le=[new Ve(Te===0?je:De.x,Te===1?je:De.y),Ze];Y.length>Ie+1?ue.push({polygons:et,bounds:Le,depth:Ie+1}):F(et,Le)}}return R}(r,t,Math.ceil((p-u)/11.25),Math.ceil((g-y)/11.25),1,(w,b,A)=>{if(w===0)return .5*(b+A);{const I=Pr((i.y+b/vt)/a);return(ls(.5*(Pr((i.y+A/vt)/a)+I))*a-i.y)*vt}})}dt(Dd,"FillExtrusionBucket",{omit:["layers","features"]}),dt(Gw,"PartMetadata");const mM=new ee({"fill-extrusion-edge-radius":new B(Re["layout_fill-extrusion"]["fill-extrusion-edge-radius"])});var gM={paint:new ee({"fill-extrusion-opacity":new B(Re["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new q(Re["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new B(Re["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new B(Re["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new q(Re["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new q(Re["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new q(Re["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new B(Re["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]),"fill-extrusion-ambient-occlusion-intensity":new B(Re["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-intensity"]),"fill-extrusion-ambient-occlusion-radius":new B(Re["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-radius"]),"fill-extrusion-rounded-roof":new B(Re["paint_fill-extrusion"]["fill-extrusion-rounded-roof"])}),layout:mM};function Jw(r,t,i){var a=2*Math.PI*6378137/256/Math.pow(2,i);return[r*a-2*Math.PI*6378137/2,t*a-2*Math.PI*6378137/2]}class fm{constructor(t,i,a){this.z=t,this.x=i,this.y=a,this.key=Od(0,t,t,i,a)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,i){const a=function(p,g,y){var w=Jw(256*p,256*(g=Math.pow(2,y)-g-1),y),b=Jw(256*(p+1),256*(g+1),y);return w[0]+","+w[1]+","+b[0]+","+b[1]}(this.x,this.y,this.z),u=function(p,g,y){let w,b="";for(let A=p;A>0;A--)w=1<this.canonical.z?new Xr(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Xr(t,this.wrap,t,this.canonical.x>>i,this.canonical.y>>i)}calculateScaledKey(t,i=!0){if(this.overscaledZ===t&&i)return this.key;if(t>this.canonical.z)return Od(this.wrap*+i,t,this.canonical.z,this.canonical.x,this.canonical.y);{const a=this.canonical.z-t;return Od(this.wrap*+i,t,t,this.canonical.x>>a,this.canonical.y>>a)}}isChildOf(t){if(t.wrap!==this.wrap)return!1;const i=this.canonical.z-t.canonical.z;return t.overscaledZ===0||t.overscaledZ>i&&t.canonical.y===this.canonical.y>>i}children(t){if(this.overscaledZ>=t)return[new Xr(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const i=this.canonical.z+1,a=2*this.canonical.x,u=2*this.canonical.y;return[new Xr(i,this.wrap,i,a,u),new Xr(i,this.wrap,i,a+1,u),new Xr(i,this.wrap,i,a,u+1),new Xr(i,this.wrap,i,a+1,u+1)]}isLessThan(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.yi.id),this.index=t.index,this.projection=t.projection,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(i=>{this.gradients[i.id]={}}),this.layoutVertexArray=new ke,this.layoutVertexArray2=new qe,this.indexArray=new mt,this.programConfigurations=new Wl(t.layers,t.zoom),this.segments=new qn,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id)}populate(t,i,a,u){this.hasPattern=Gy("line",this.layers,i);const p=this.layers[0].layout.get("line-sort-key"),g=[];for(const{feature:A,id:I,index:M,sourceLayerIndex:L}of t){const R=this.layers[0]._featureFilter.needGeometry,F=Jl(A,R);if(!this.layers[0]._featureFilter.filter(new C(this.zoom),F,a))continue;const $=p?p.evaluate(F,{},a):void 0,K={id:I,properties:A.properties,type:A.type,sourceLayerIndex:L,index:M,geometry:R?F.geometry:Vs(A,a,u),patterns:{},sortKey:$};g.push(K)}p&&g.sort((A,I)=>A.sortKey-I.sortKey);const{lineAtlas:y,featureIndex:w}=i,b=this.addConstantDashes(y);for(const A of g){const{geometry:I,index:M,sourceLayerIndex:L}=A;if(b&&this.addFeatureDashes(A,y),this.hasPattern){const R=qy("line",this.layers,A,this.zoom,i);this.patternFeatures.push(R)}else this.addFeature(A,I,M,a,y.positions,i.availableImages);w.insert(t[M].feature,I,M,L,this.index)}}addConstantDashes(t){let i=!1;for(const a of this.layers){const u=a.paint.get("line-dasharray").value,p=a.layout.get("line-cap").value;if(u.kind!=="constant"||p.kind!=="constant")i=!0;else{const g=p.value,y=u.value;if(!y)continue;t.addDash(y,g)}}return i}addFeatureDashes(t,i){const a=this.zoom;for(const u of this.layers){const p=u.paint.get("line-dasharray").value,g=u.layout.get("line-cap").value;if(p.kind==="constant"&&g.kind==="constant")continue;let y,w;if(p.kind==="constant"){if(y=p.value,!y)continue}else y=p.evaluate({zoom:a},t);w=g.kind==="constant"?g.value:g.evaluate({zoom:a},t),i.addDash(y,w),t.patterns[u.id]=i.getKey(y,w)}}update(t,i,a,u){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,i,this.stateDependentLayers,a,u)}addFeatures(t,i,a,u,p){for(const g of this.patternFeatures)this.addFeature(g,g.geometry,g.index,i,a,u)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,xM)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,yM),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&&t.properties.hasOwnProperty("mapbox_clip_start")&&t.properties.hasOwnProperty("mapbox_clip_end"))return{start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}}addFeature(t,i,a,u,p,g){const y=this.layers[0].layout,w=y.get("line-join").evaluate(t,{}),b=y.get("line-cap").evaluate(t,{}),A=y.get("line-miter-limit"),I=y.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(const M of i)this.addLine(M,t,w,b,A,I);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,a,p,g,u)}addLine(t,i,a,u,p,g){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineSoFar=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let K=0;K=2&&t[w-1].equals(t[w-2]);)w--;let b=0;for(;b0;if(Ie&&K>b){const Me=M.dist(L);if(Me>2*A){const Ue=M.sub(M.sub(L)._mult(A/Me)._round());this.updateDistance(L,Ue),this.addCurrentVertex(Ue,F,0,0,I),L=Ue}}const De=L&&R;let Ze=De?a:y?"butt":u;if(De&&Ze==="round"&&(uep&&(Ze="bevel"),Ze==="bevel"&&(ue>2&&(Ze="flipbevel"),ue100)se=$.mult(-1);else{const Me=ue*F.add($).mag()/F.sub($).mag();se._perp()._mult(Me*(Te?-1:1))}this.addCurrentVertex(M,se,0,0,I),this.addCurrentVertex(M,se.mult(-1),0,0,I)}else if(Ze==="bevel"||Ze==="fakeround"){const Me=-Math.sqrt(ue*ue-1),Ue=Te?Me:0,je=Te?0:Me;if(L&&this.addCurrentVertex(M,F,Ue,je,I),Ze==="fakeround"){const Ge=Math.round(180*ce/Math.PI/20);for(let et=1;et2*A){const Ue=M.add(R.sub(M)._mult(A/Me)._round());this.updateDistance(M,Ue),this.addCurrentVertex(Ue,$,0,0,I),M=Ue}}}}addCurrentVertex(t,i,a,u,p,g=!1){const y=i.y*u-i.x,w=-i.y-i.x*u;this.addHalfVertex(t,i.x+i.y*a,i.y-i.x*a,g,!1,a,p),this.addHalfVertex(t,y,w,g,!0,-u,p)}addHalfVertex({x:t,y:i},a,u,p,g,y,w){this.layoutVertexArray.emplaceBack((t<<1)+(p?1:0),(i<<1)+(g?1:0),Math.round(63*a)+128,Math.round(63*u)+128,1+(y===0?0:y<0?-1:1),0,this.lineSoFar),this.lineClips&&this.layoutVertexArray2.emplaceBack(this.scaledDistance,this.lineClipsArray.length,this.lineClips.start,this.lineClips.end);const b=w.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,b),w.primitiveLength++),g?this.e2=b:this.e1=b}updateScaledDistance(){if(this.lineClips){const t=this.totalDistance/(this.lineClips.end-this.lineClips.start);this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=t*this.lineClips.start+this.distance}else this.lineSoFar=this.distance}updateDistance(t,i){this.distance+=t.dist(i),this.updateScaledDistance()}}dt(mm,"LineBucket",{omit:["layers","patternFeatures"]});const EM=new ee({"line-cap":new q(Re.layout_line["line-cap"]),"line-join":new q(Re.layout_line["line-join"]),"line-miter-limit":new B(Re.layout_line["line-miter-limit"]),"line-round-limit":new B(Re.layout_line["line-round-limit"]),"line-sort-key":new q(Re.layout_line["line-sort-key"])});var nb={paint:new ee({"line-opacity":new q(Re.paint_line["line-opacity"]),"line-color":new q(Re.paint_line["line-color"]),"line-translate":new B(Re.paint_line["line-translate"]),"line-translate-anchor":new B(Re.paint_line["line-translate-anchor"]),"line-width":new q(Re.paint_line["line-width"]),"line-gap-width":new q(Re.paint_line["line-gap-width"]),"line-offset":new q(Re.paint_line["line-offset"]),"line-blur":new q(Re.paint_line["line-blur"]),"line-dasharray":new q(Re.paint_line["line-dasharray"]),"line-pattern":new q(Re.paint_line["line-pattern"]),"line-gradient":new Q(Re.paint_line["line-gradient"]),"line-trim-offset":new B(Re.paint_line["line-trim-offset"])}),layout:EM};const rb=new class extends q{possiblyEvaluate(r,t){return t=new C(Math.floor(t.zoom),{now:t.now,fadeDuration:t.fadeDuration,transition:t.transition}),super.possiblyEvaluate(r,t)}evaluate(r,t,i,a){return t=vn({},t,{zoom:Math.floor(t.zoom)}),super.evaluate(r,t,i,a)}}(nb.paint.properties["line-width"].specification);function ib(r,t){return t>0?t+2*r:r}rb.useIntegerZoom=!0;const TM=ye([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_tex_size",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),SM=ye([{name:"a_globe_anchor",components:3,type:"Int16"},{name:"a_globe_normal",components:3,type:"Float32"}],4),AM=ye([{name:"a_projected_pos",components:4,type:"Float32"}],4);ye([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const CM=ye([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]),IM=ye([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"}]);ye([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"tileAnchorX"},{type:"Int16",name:"tileAnchorY"},{type:"Float32",name:"x1"},{type:"Float32",name:"y1"},{type:"Float32",name:"x2"},{type:"Float32",name:"y2"},{type:"Int16",name:"padding"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const ob=ye([{name:"a_pos",components:3,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),kM=ye([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);ye([{name:"triangle",components:3,type:"Uint16"}]),ye([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{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"},{type:"Uint8",name:"flipState"}]),ye([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{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",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),ye([{type:"Float32",name:"offsetX"}]),ye([{type:"Int16",name:"x"},{type:"Int16",name:"y"}]);var Tr=24;const Oo=128;function Zy(r,t){const{expression:i}=t;if(i.kind==="constant")return{kind:"constant",layoutSize:i.evaluate(new C(r+1))};if(i.kind==="source")return{kind:"source"};{const{zoomStops:a,interpolationType:u}=i;let p=0;for(;p{a.text=function(u,p,g){const y=p.layout.get("text-transform").evaluate(g,{});return y==="uppercase"?u=u.toLocaleUpperCase():y==="lowercase"&&(u=u.toLocaleLowerCase()),S.applyArabicShaping&&(u=S.applyArabicShaping(u)),u}(a.text,t,i)}),r}const Fd={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂","←":"↑","→":"↓"};function zM(r){return r==="︶"||r==="﹈"||r==="︸"||r==="﹄"||r==="﹂"||r==="︾"||r==="︼"||r==="︺"||r==="︘"||r==="﹀"||r==="︐"||r==="︓"||r==="︔"||r==="`"||r===" ̄"||r==="︑"||r==="︒"}function LM(r){return r==="︵"||r==="﹇"||r==="︷"||r==="﹃"||r==="﹁"||r==="︽"||r==="︻"||r==="︹"||r==="︗"||r==="︿"}var sb=pn,ab=function(r,t,i,a,u){var p,g,y=8*u-a-1,w=(1<>1,A=-7,I=i?u-1:0,M=i?-1:1,L=r[t+I];for(I+=M,p=L&(1<<-A)-1,L>>=-A,A+=y;A>0;p=256*p+r[t+I],I+=M,A-=8);for(g=p&(1<<-A)-1,p>>=-A,A+=a;A>0;g=256*g+r[t+I],I+=M,A-=8);if(p===0)p=1-b;else{if(p===w)return g?NaN:1/0*(L?-1:1);g+=Math.pow(2,a),p-=b}return(L?-1:1)*g*Math.pow(2,p-a)},lb=function(r,t,i,a,u,p){var g,y,w,b=8*p-u-1,A=(1<>1,M=u===23?Math.pow(2,-24)-Math.pow(2,-77):0,L=a?0:p-1,R=a?1:-1,F=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(y=isNaN(t)?1:0,g=A):(g=Math.floor(Math.log(t)/Math.LN2),t*(w=Math.pow(2,-g))<1&&(g--,w*=2),(t+=g+I>=1?M/w:M*Math.pow(2,1-I))*w>=2&&(g++,w/=2),g+I>=A?(y=0,g=A):g+I>=1?(y=(t*w-1)*Math.pow(2,u),g+=I):(y=t*Math.pow(2,I-1)*Math.pow(2,u),g=0));u>=8;r[i+L]=255&y,L+=R,y/=256,u-=8);for(g=g<0;r[i+L]=255&g,L+=R,g/=256,b-=8);r[i+L-R]|=128*F};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */function pn(r){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(r)?r:new Uint8Array(r||0),this.pos=0,this.type=0,this.length=this.buf.length}pn.Varint=0,pn.Fixed64=1,pn.Bytes=2,pn.Fixed32=5;var Hy=4294967296,cb=1/Hy,ub=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function Gs(r){return r.type===pn.Bytes?r.readVarint()+r.pos:r.pos+1}function mu(r,t,i){return i?4294967296*t+(r>>>0):4294967296*(t>>>0)+(r>>>0)}function hb(r,t,i){var a=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));i.realloc(a);for(var u=i.pos-1;u>=r;u--)i.buf[u+a]=i.buf[u]}function RM(r,t){for(var i=0;i>>8,r[i+2]=t>>>16,r[i+3]=t>>>24}function db(r,t){return(r[t]|r[t+1]<<8|r[t+2]<<16)+(r[t+3]<<24)}pn.prototype={destroy:function(){this.buf=null},readFields:function(r,t,i){for(i=i||this.length;this.pos>3,p=this.pos;this.type=7&a,r(u,t,this),this.pos===p&&this.skip(a)}return t},readMessage:function(r,t){return this.readFields(r,t,this.readVarint()+this.pos)},readFixed32:function(){var r=_m(this.buf,this.pos);return this.pos+=4,r},readSFixed32:function(){var r=db(this.buf,this.pos);return this.pos+=4,r},readFixed64:function(){var r=_m(this.buf,this.pos)+_m(this.buf,this.pos+4)*Hy;return this.pos+=8,r},readSFixed64:function(){var r=_m(this.buf,this.pos)+db(this.buf,this.pos+4)*Hy;return this.pos+=8,r},readFloat:function(){var r=ab(this.buf,this.pos,!0,23,4);return this.pos+=4,r},readDouble:function(){var r=ab(this.buf,this.pos,!0,52,8);return this.pos+=8,r},readVarint:function(r){var t,i,a=this.buf;return t=127&(i=a[this.pos++]),i<128?t:(t|=(127&(i=a[this.pos++]))<<7,i<128?t:(t|=(127&(i=a[this.pos++]))<<14,i<128?t:(t|=(127&(i=a[this.pos++]))<<21,i<128?t:function(u,p,g){var y,w,b=g.buf;if(y=(112&(w=b[g.pos++]))>>4,w<128||(y|=(127&(w=b[g.pos++]))<<3,w<128)||(y|=(127&(w=b[g.pos++]))<<10,w<128)||(y|=(127&(w=b[g.pos++]))<<17,w<128)||(y|=(127&(w=b[g.pos++]))<<24,w<128)||(y|=(1&(w=b[g.pos++]))<<31,w<128))return mu(u,y,p);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(i=a[this.pos]))<<28,r,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var r=this.readVarint();return r%2==1?(r+1)/-2:r/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var r=this.readVarint()+this.pos,t=this.pos;return this.pos=r,r-t>=12&&ub?function(i,a,u){return ub.decode(i.subarray(a,u))}(this.buf,t,r):function(i,a,u){for(var p="",g=a;g239?4:A>223?3:A>191?2:1;if(g+M>u)break;M===1?A<128&&(I=A):M===2?(192&(y=i[g+1]))==128&&(I=(31&A)<<6|63&y)<=127&&(I=null):M===3?(w=i[g+2],(192&(y=i[g+1]))==128&&(192&w)==128&&((I=(15&A)<<12|(63&y)<<6|63&w)<=2047||I>=55296&&I<=57343)&&(I=null)):M===4&&(w=i[g+2],b=i[g+3],(192&(y=i[g+1]))==128&&(192&w)==128&&(192&b)==128&&((I=(15&A)<<18|(63&y)<<12|(63&w)<<6|63&b)<=65535||I>=1114112)&&(I=null)),I===null?(I=65533,M=1):I>65535&&(I-=65536,p+=String.fromCharCode(I>>>10&1023|55296),I=56320|1023&I),p+=String.fromCharCode(I),g+=M}return p}(this.buf,t,r)},readBytes:function(){var r=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,r);return this.pos=r,t},readPackedVarint:function(r,t){if(this.type!==pn.Bytes)return r.push(this.readVarint(t));var i=Gs(this);for(r=r||[];this.pos127;);else if(t===pn.Bytes)this.pos=this.readVarint()+this.pos;else if(t===pn.Fixed32)this.pos+=4;else{if(t!==pn.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(r,t){this.writeVarint(r<<3|t)},realloc:function(r){for(var t=this.length||16;t268435455||r<0?function(t,i){var a,u;if(t>=0?(a=t%4294967296|0,u=t/4294967296|0):(u=~(-t/4294967296),4294967295^(a=~(-t%4294967296))?a=a+1|0:(a=0,u=u+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");i.realloc(10),function(p,g,y){y.buf[y.pos++]=127&p|128,p>>>=7,y.buf[y.pos++]=127&p|128,p>>>=7,y.buf[y.pos++]=127&p|128,p>>>=7,y.buf[y.pos++]=127&p|128,y.buf[y.pos]=127&(p>>>=7)}(a,0,i),function(p,g){var y=(7&p)<<4;g.buf[g.pos++]|=y|((p>>>=3)?128:0),p&&(g.buf[g.pos++]=127&p|((p>>>=7)?128:0),p&&(g.buf[g.pos++]=127&p|((p>>>=7)?128:0),p&&(g.buf[g.pos++]=127&p|((p>>>=7)?128:0),p&&(g.buf[g.pos++]=127&p|((p>>>=7)?128:0),p&&(g.buf[g.pos++]=127&p)))))}(u,i)}(r,this):(this.realloc(4),this.buf[this.pos++]=127&r|(r>127?128:0),r<=127||(this.buf[this.pos++]=127&(r>>>=7)|(r>127?128:0),r<=127||(this.buf[this.pos++]=127&(r>>>=7)|(r>127?128:0),r<=127||(this.buf[this.pos++]=r>>>7&127))))},writeSVarint:function(r){this.writeVarint(r<0?2*-r-1:2*r)},writeBoolean:function(r){this.writeVarint(!!r)},writeString:function(r){r=String(r),this.realloc(4*r.length),this.pos++;var t=this.pos;this.pos=function(a,u,p){for(var g,y,w=0;w55295&&g<57344){if(!y){g>56319||w+1===u.length?(a[p++]=239,a[p++]=191,a[p++]=189):y=g;continue}if(g<56320){a[p++]=239,a[p++]=191,a[p++]=189,y=g;continue}g=y-55296<<10|g-56320|65536,y=null}else y&&(a[p++]=239,a[p++]=191,a[p++]=189,y=null);g<128?a[p++]=g:(g<2048?a[p++]=g>>6|192:(g<65536?a[p++]=g>>12|224:(a[p++]=g>>18|240,a[p++]=g>>12&63|128),a[p++]=g>>6&63|128),a[p++]=63&g|128)}return p}(this.buf,r,this.pos);var i=this.pos-t;i>=128&&hb(t,i,this),this.pos=t-1,this.writeVarint(i),this.pos+=i},writeFloat:function(r){this.realloc(4),lb(this.buf,r,this.pos,!0,23,4),this.pos+=4},writeDouble:function(r){this.realloc(8),lb(this.buf,r,this.pos,!0,52,8),this.pos+=8},writeBytes:function(r){var t=r.length;this.writeVarint(t),this.realloc(t);for(var i=0;i=128&&hb(i,a,this),this.pos=i-1,this.writeVarint(a),this.pos+=a},writeMessage:function(r,t,i){this.writeTag(r,pn.Bytes),this.writeRawMessage(t,i)},writePackedVarint:function(r,t){t.length&&this.writeMessage(r,RM,t)},writePackedSVarint:function(r,t){t.length&&this.writeMessage(r,DM,t)},writePackedBoolean:function(r,t){t.length&&this.writeMessage(r,FM,t)},writePackedFloat:function(r,t){t.length&&this.writeMessage(r,OM,t)},writePackedDouble:function(r,t){t.length&&this.writeMessage(r,BM,t)},writePackedFixed32:function(r,t){t.length&&this.writeMessage(r,NM,t)},writePackedSFixed32:function(r,t){t.length&&this.writeMessage(r,UM,t)},writePackedFixed64:function(r,t){t.length&&this.writeMessage(r,jM,t)},writePackedSFixed64:function(r,t){t.length&&this.writeMessage(r,VM,t)},writeBytesField:function(r,t){this.writeTag(r,pn.Bytes),this.writeBytes(t)},writeFixed32Field:function(r,t){this.writeTag(r,pn.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(r,t){this.writeTag(r,pn.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(r,t){this.writeTag(r,pn.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(r,t){this.writeTag(r,pn.Fixed64),this.writeSFixed64(t)},writeVarintField:function(r,t){this.writeTag(r,pn.Varint),this.writeVarint(t)},writeSVarintField:function(r,t){this.writeTag(r,pn.Varint),this.writeSVarint(t)},writeStringField:function(r,t){this.writeTag(r,pn.Bytes),this.writeString(t)},writeFloatField:function(r,t){this.writeTag(r,pn.Fixed32),this.writeFloat(t)},writeDoubleField:function(r,t){this.writeTag(r,pn.Fixed64),this.writeDouble(t)},writeBooleanField:function(r,t){this.writeVarintField(r,!!t)}};var ym=le(sb);const Xy=3;function $M(r,t,i){t.glyphs=[],r===1&&i.readMessage(GM,t)}function GM(r,t,i){if(r===3){const{id:a,bitmap:u,width:p,height:g,left:y,top:w,advance:b}=i.readMessage(qM,{});t.glyphs.push({id:a,bitmap:new $s({width:p+2*Xy,height:g+2*Xy},u),metrics:{width:p,height:g,left:y,top:w,advance:b}})}else r===4?t.ascender=i.readSVarint():r===5&&(t.descender=i.readSVarint())}function qM(r,t,i){r===1?t.id=i.readVarint():r===2?t.bitmap=i.readBytes():r===3?t.width=i.readVarint():r===4?t.height=i.readVarint():r===5?t.left=i.readSVarint():r===6?t.top=i.readSVarint():r===7&&(t.advance=i.readVarint())}const pb=Xy;function Ky(r){let t=0,i=0;for(const g of r)t+=g.w*g.h,i=Math.max(i,g.w);r.sort((g,y)=>y.h-g.h);const a=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),i),h:1/0}];let u=0,p=0;for(const g of r)for(let y=a.length-1;y>=0;y--){const w=a[y];if(!(g.w>w.w||g.h>w.h)){if(g.x=w.x,g.y=w.y,p=Math.max(p,g.y+g.h),u=Math.max(u,g.x+g.w),g.w===w.w&&g.h===w.h){const b=a.pop();yt.hasImage(a)),t.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const a in t.updatedImages)this.patchUpdatedImage(this.iconPositions[a],t.getImage(a),i),this.patchUpdatedImage(this.patternPositions[a],t.getImage(a),i)}patchUpdatedImage(t,i,a){if(!t||!i||t.version===i.version)return;t.version=i.version;const[u,p]=t.tl;a.update(i.data,void 0,{x:u,y:p})}}dt(Yy,"ImagePosition"),dt(fb,"ImageAtlas");const Ni={horizontal:1,vertical:2,horizontalOnly:3},mb=-17;class Nd{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(t,i){const a=new Nd;return a.scale=t||1,a.fontStack=i,a}static forImage(t){const i=new Nd;return i.imageName=t,i}}class _u{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(t,i){const a=new _u;for(let u=0;u=0&&a>=t&&vm[this.text.charCodeAt(a)];a--)i--;this.text=this.text.substring(t,i),this.sectionIndex=this.sectionIndex.slice(t,i)}substring(t,i){const a=new _u;return a.text=this.text.substring(t,i),a.sectionIndex=this.sectionIndex.slice(t,i),a.sections=this.sections,a}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((t,i)=>Math.max(t,this.sections[i].scale),0)}addTextSection(t,i){this.text+=t.text,this.sections.push(Nd.forText(t.scale,t.fontStack||i));const a=this.sections.length-1;for(let u=0;u=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Jy(r,t,i,a,u,p,g,y,w,b,A,I,M,L,R){const F=_u.fromFeature(r,u);I===Ni.vertical&&F.verticalizePunctuation(M);let $=[];const K=function(ce,Ie,Te,De,Ze,Me){if(!ce)return[];const Ue=[],je=function(ot,ft,st,At,tt,_t){let Ct=0;for(let Ht=0;Ht=0;let et=0;for(let ot=0;ot0&&No>un&&(un=No)}else{const Yr=Te[nr.fontStack];if(!Yr)continue;Yr[Mn]&&(gn=Yr[Mn]);const gr=Ie[nr.fontStack];if(!gr)continue;const No=gr.glyphs[Mn];if(!No)continue;if(Xn=No.metrics,Kn=Mn!==8203?Tr:0,_t){const Tu=gr.ascender!==void 0?Math.abs(gr.ascender):0,Xd=gr.descender!==void 0?Math.abs(gr.descender):0,Kd=(Tu+Xd)*Kt;kn-i/2;){if(g--,g<0)return!1;y-=r[g].dist(p),p=r[g]}y+=r[g].dist(r[g+1]),g++;const w=[];let b=0;for(;ya;)b-=w.shift().angleDelta;if(b>u)return!1;g++,y+=A.dist(I)}return!0}function Eb(r){let t=0;for(let i=0;ib){const R=(b-w)/L,F=Wt(I.x,M.x,R),$=Wt(I.y,M.y,R),K=new qs(F,$,0,M.angleTo(I),A);return!g||bb(r,K,y,g,t)?K:void 0}w+=L}}function KM(r,t,i,a,u,p,g,y,w){const b=Tb(a,p,g),A=Sb(a,u),I=A*g,M=r[0].x===0||r[0].x===w||r[0].y===0||r[0].y===w;return t-I=0&&re=0&&ue=0&&M+b<=A){const ce=new qs(re,ue,0,se,R);ce._round(),a&&!bb(r,ce,p,a,u)||L.push(ce)}}I+=K}return y||L.length||g||(L=Ab(r,I/2,i,a,u,p,g,!0,w)),L}function Cb(r,t,i,a,u){const p=[];for(let g=0;g=a&&I.x>=a||(A.x>=a?A=new Ve(a,A.y+(a-A.x)/(I.x-A.x)*(I.y-A.y))._round():I.x>=a&&(I=new Ve(a,A.y+(a-A.x)/(I.x-A.x)*(I.y-A.y))._round()),A.y>=u&&I.y>=u||(A.y>=u?A=new Ve(A.x+(u-A.y)/(I.y-A.y)*(I.x-A.x),u)._round():I.y>=u&&(I=new Ve(A.x+(u-A.y)/(I.y-A.y)*(I.x-A.x),u)._round()),w&&A.equals(w[w.length-1])||(w=[A],p.push(w)),w.push(I)))))}}return p}dt(qs,"Anchor");const Ud=1e20;function Ib(r,t,i,a,u,p,g,y,w){for(let b=t;b-1);w++,p[w]=y,g[w]=b,g[w+1]=Ud}for(let y=0,w=0;y{let y=this.entries[u];y||(y=this.entries[u]={glyphs:{},requests:{},ranges:{},ascender:void 0,descender:void 0});let w=y.glyphs[p];if(w!==void 0)return void g(null,{stack:u,id:p,glyph:w});if(w=this._tinySDF(y,u,p),w)return y.glyphs[p]=w,void g(null,{stack:u,id:p,glyph:w});const b=Math.floor(p/256);if(256*b>65535)return void g(new Error("glyphs > 65535 not supported"));if(y.ranges[b])return void g(null,{stack:u,id:p,glyph:w});let A=y.requests[b];A||(A=y.requests[b]=[],yu.loadGlyphRange(u,b,this.url,this.requestManager,(I,M)=>{if(M){y.ascender=M.ascender,y.descender=M.descender;for(const L in M.glyphs)this._doesCharSupportLocalGlyph(+L)||(y.glyphs[+L]=M.glyphs[+L]);y.ranges[b]=!0}for(const L of A)L(I,M);delete y.requests[b]})),A.push((I,M)=>{I?g(I):M&&g(null,{stack:u,id:p,glyph:M.glyphs[p]||null})})},(u,p)=>{if(u)i(u);else if(p){const g={};for(const{stack:y,id:w,glyph:b}of p)g[y]===void 0&&(g[y]={}),g[y].glyphs===void 0&&(g[y].glyphs={}),g[y].glyphs[w]=b&&{id:b.id,bitmap:b.bitmap.clone(),metrics:b.metrics},g[y].ascender=this.entries[y].ascender,g[y].descender=this.entries[y].descender;i(null,g)}})}_doesCharSupportLocalGlyph(t){return this.localGlyphMode!==e0.none&&(this.localGlyphMode===e0.all?!!this.localFontFamily:!!this.localFontFamily&&(at["CJK Unified Ideographs"](t)||at["Hangul Syllables"](t)||at.Hiragana(t)||at.Katakana(t)||at["CJK Symbols and Punctuation"](t)))}_tinySDF(t,i,a){const u=this.localFontFamily;if(!u||!this._doesCharSupportLocalGlyph(a))return;let p=t.tinySDF;if(!p){let F="400";/bold/i.test(i)?F="900":/medium/i.test(i)?F="500":/light/i.test(i)&&(F="200"),p=t.tinySDF=new yu.TinySDF({fontFamily:u,fontWeight:F,fontSize:24*Bo,buffer:3*Bo,radius:8*Bo}),p.fontWeight=F}if(this.localGlyphs[p.fontWeight][a])return this.localGlyphs[p.fontWeight][a];const g=String.fromCharCode(a),{data:y,width:w,height:b,glyphWidth:A,glyphHeight:I,glyphLeft:M,glyphTop:L,glyphAdvance:R}=p.draw(g);return this.localGlyphs[p.fontWeight][a]={id:a,bitmap:new $s({width:w,height:b},y),metrics:{width:A/Bo,height:I/Bo,left:M/Bo,top:L/Bo-27,advance:R/Bo,localGlyph:!0}}}}yu.loadGlyphRange=function(r,t,i,a,u){const p=256*t,g=p+255,y=a.transformRequest(a.normalizeGlyphsURL(i).replace("{fontstack}",r).replace("{range}",`${p}-${g}`),Ss.Glyphs);ua(y,(w,b)=>{if(w)u(w);else if(b){const A={},I=function(M){return new ym(M).readFields($M,{})}(b);for(const M of I.glyphs)A[M.id]=M;u(null,{glyphs:A,ascender:I.ascender,descender:I.descender})}})},yu.TinySDF=class{constructor({fontSize:r=24,buffer:t=3,radius:i=8,cutoff:a=.25,fontFamily:u="sans-serif",fontWeight:p="normal",fontStyle:g="normal"}={}){this.buffer=t,this.cutoff=a,this.radius=i;const y=this.size=r+4*t,w=this._createCanvas(y),b=this.ctx=w.getContext("2d",{willReadFrequently:!0});b.font=`${g} ${p} ${r}px ${u}`,b.textBaseline="alphabetic",b.textAlign="left",b.fillStyle="black",this.gridOuter=new Float64Array(y*y),this.gridInner=new Float64Array(y*y),this.f=new Float64Array(y),this.z=new Float64Array(y+1),this.v=new Uint16Array(y)}_createCanvas(r){const t=document.createElement("canvas");return t.width=t.height=r,t}draw(r){const{width:t,actualBoundingBoxAscent:i,actualBoundingBoxDescent:a,actualBoundingBoxLeft:u,actualBoundingBoxRight:p}=this.ctx.measureText(r),g=Math.ceil(i),y=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(p-u))),w=Math.min(this.size-this.buffer,g+Math.ceil(a)),b=y+2*this.buffer,A=w+2*this.buffer,I=Math.max(b*A,0),M=new Uint8ClampedArray(I),L={data:M,width:b,height:A,glyphWidth:y,glyphHeight:w,glyphTop:g,glyphLeft:0,glyphAdvance:t};if(y===0||w===0)return L;const{ctx:R,buffer:F,gridInner:$,gridOuter:K}=this;R.clearRect(F,F,y,w),R.fillText(r,F,F+g);const se=R.getImageData(F,F,y,w);K.fill(Ud,0,I),$.fill(0,0,I);for(let Y=0;Y0?Ie*Ie:0,$[ce]=Ie<0?Ie*Ie:0}}Ib(K,0,0,b,A,b,this.f,this.v,this.z),Ib($,F,F,y,w,b,this.f,this.v,this.z);for(let Y=0;YMe+Ue[1]-Ue[0],R=I.reduce(L,0),F=M.reduce(L,0),$=y-R,K=w-F;let se=0,Y=R,re=0,ue=F,ce=0,Ie=$,Te=0,De=K;if(p.content&&a){const Me=p.content;se=xm(I,0,Me[0]),re=xm(M,0,Me[1]),Y=xm(I,Me[0],Me[2]),ue=xm(M,Me[1],Me[3]),ce=Me[0]-se,Te=Me[1]-re,Ie=Me[2]-Me[0]-Y,De=Me[3]-Me[1]-ue}const Ze=(Me,Ue,je,Ge)=>{const et=wm(Me.stretch-se,Y,b,r.left),Le=bm(Me.fixed-ce,Ie,Me.stretch,R),ot=wm(Ue.stretch-re,ue,A,r.top),ft=bm(Ue.fixed-Te,De,Ue.stretch,F),st=wm(je.stretch-se,Y,b,r.left),At=bm(je.fixed-ce,Ie,je.stretch,R),tt=wm(Ge.stretch-re,ue,A,r.top),_t=bm(Ge.fixed-Te,De,Ge.stretch,F),Ct=new Ve(et,ot),Ht=new Ve(st,ot),It=new Ve(st,tt),bt=new Ve(et,tt),bn=new Ve(Le/g,ft/g),zt=new Ve(At/g,_t/g),Lt=t*Math.PI/180;if(Lt){const mn=Math.sin(Lt),un=Math.cos(Lt),kn=[un,-mn,mn,un];Ct._matMult(kn),Ht._matMult(kn),bt._matMult(kn),It._matMult(kn)}const cn=Me.stretch+Me.fixed,fn=Ue.stretch+Ue.fixed;return{tl:Ct,tr:Ht,bl:bt,br:It,tex:{x:p.paddedRect.x+vu+cn,y:p.paddedRect.y+vu+fn,w:je.stretch+je.fixed-cn,h:Ge.stretch+Ge.fixed-fn},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:bn,pixelOffsetBR:zt,minFontScaleX:Ie/g/b,minFontScaleY:De/g/A,isSDF:i}};if(a&&(p.stretchX||p.stretchY)){const Me=Pb(I,$,R),Ue=Pb(M,K,F);for(let je=0;je0)for(let a=(this.length>>1)-1;a>=0;a--)this._down(a)}push(t){this.data.push(t),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const t=this.data[0],i=this.data.pop();return this.length--,this.length>0&&(this.data[0]=i,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:i,compare:a}=this,u=i[t];for(;t>0;){const p=t-1>>1,g=i[p];if(a(u,g)>=0)break;i[t]=g,t=p}i[t]=u}_down(t){const{data:i,compare:a}=this,u=this.length>>1,p=i[t];for(;t=0)break;i[t]=y,t=g}i[t]=p}}function QM(r,t){return rt?1:0}function eP(r,t=1,i=!1){let a=1/0,u=1/0,p=-1/0,g=-1/0;const y=r[0];for(let L=0;Lp)&&(p=R.x),(!L||R.y>g)&&(g=R.y)}const w=Math.min(p-a,g-u);let b=w/2;const A=new JM([],tP);if(w===0)return new Ve(a,u);for(let L=a;LI.d||!I.d)&&(I=L,i&&console.log("found best %d after %d probes",Math.round(1e4*L.d)/1e4,M)),L.max-I.d<=t||(b=L.h/2,A.push(new xu(L.p.x-b,L.p.y-b,b,r)),A.push(new xu(L.p.x+b,L.p.y-b,b,r)),A.push(new xu(L.p.x-b,L.p.y+b,b,r)),A.push(new xu(L.p.x+b,L.p.y+b,b,r)),M+=4)}return i&&(console.log(`num probes: ${M}`),console.log(`best distance: ${I.d}`)),I.p}function tP(r,t){return t.max-r.max}class xu{constructor(t,i,a,u){this.p=new Ve(t,i),this.h=a,this.d=function(p,g){let y=!1,w=1/0;for(let b=0;bp.y!=F.y>p.y&&p.x<(F.x-R.x)*(p.y-R.y)/(F.y-R.y)+R.x&&(y=!y),w=Math.min(w,Aw(p,R,F))}}return(y?1:-1)*Math.sqrt(w)}(this.p,u),this.max=this.d+this.h*Math.SQRT2}}const wu=7,t0=Number.POSITIVE_INFINITY,nP=Math.sqrt(2);function zb(r,[t,i]){let a=0,u=0;if(i===t0){t<0&&(t=0);const p=t/nP;switch(r){case"top-right":case"top-left":u=p-wu;break;case"bottom-right":case"bottom-left":u=-p+wu;break;case"bottom":u=-t+wu;break;case"top":u=t-wu}switch(r){case"top-right":case"bottom-right":a=-p;break;case"top-left":case"bottom-left":a=p;break;case"left":a=t;break;case"right":a=-t}}else{switch(t=Math.abs(t),i=Math.abs(i),r){case"top-right":case"top-left":case"top":u=i-wu;break;case"bottom-right":case"bottom-left":case"bottom":u=-i+wu}switch(r){case"top-right":case"bottom-right":case"right":a=-t;break;case"top-left":case"bottom-left":case"left":a=t}}return[a,u]}function rP(r,t,i,a,u,p,g,y,w,b){r.createArrays(),r.tilePixelRatio=vt/(512*r.overscaling),r.compareText={},r.iconsNeedLinear=!1;const A=r.layers[0].layout,I=r.layers[0]._unevaluatedLayout._values,M={};if(r.textSizeData.kind==="composite"){const{minZoom:F,maxZoom:$}=r.textSizeData;M.compositeTextSizes=[I["text-size"].possiblyEvaluate(new C(F),y),I["text-size"].possiblyEvaluate(new C($),y)]}if(r.iconSizeData.kind==="composite"){const{minZoom:F,maxZoom:$}=r.iconSizeData;M.compositeIconSizes=[I["icon-size"].possiblyEvaluate(new C(F),y),I["icon-size"].possiblyEvaluate(new C($),y)]}M.layoutTextSize=I["text-size"].possiblyEvaluate(new C(w+1),y),M.layoutIconSize=I["icon-size"].possiblyEvaluate(new C(w+1),y),M.textMaxSize=I["text-size"].possiblyEvaluate(new C(18),y);const L=A.get("text-rotation-alignment")==="map"&&A.get("symbol-placement")!=="point",R=A.get("text-size");for(const F of r.features){const $=A.get("text-font").evaluate(F,{},y).join(","),K=R.evaluate(F,{},y),se=M.layoutTextSize.evaluate(F,{},y),Y=(M.layoutIconSize.evaluate(F,{},y),{horizontal:{},vertical:void 0}),re=F.text;let ue,ce=[0,0];if(re){const De=re.toString(),Ze=A.get("text-letter-spacing").evaluate(F,{},y)*Tr,Me=A.get("text-line-height").evaluate(F,{},y)*Tr,Ue=uy(De)?Ze:0,je=A.get("text-anchor").evaluate(F,{},y),Ge=A.get("text-variable-anchor");if(!Ge){const st=A.get("text-radial-offset").evaluate(F,{},y);ce=st?zb(je,[st*Tr,t0]):A.get("text-offset").evaluate(F,{},y).map(At=>At*Tr)}let et=L?"center":A.get("text-justify").evaluate(F,{},y);const Le=A.get("symbol-placement")==="point",ot=Le?A.get("text-max-width").evaluate(F,{},y)*Tr:1/0,ft=st=>{r.allowVerticalPlacement&&hd(De)&&(Y.vertical=Jy(re,t,i,u,$,ot,Me,je,st,Ue,ce,Ni.vertical,!0,se,K))};if(!L&&Ge){const st=et==="auto"?Ge.map(tt=>n0(tt)):[et];let At=!1;for(let tt=0;tt=0||!hd(De)){const st=Jy(re,t,i,u,$,ot,Me,je,et,Ue,ce,Ni.horizontal,!1,se,K);st&&(Y.horizontal[et]=st)}ft(Le?"left":et)}}let Ie=!1;if(F.icon&&F.icon.name){const De=a[F.icon.name];De&&(ue=HM(u[F.icon.name],A.get("icon-offset").evaluate(F,{},y),A.get("icon-anchor").evaluate(F,{},y)),Ie=De.sdf,r.sdfIcons===void 0?r.sdfIcons=De.sdf:r.sdfIcons!==De.sdf&&wn("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(De.pixelRatio!==r.pixelRatio||A.get("icon-rotate").constantOr(1)!==0)&&(r.iconsNeedLinear=!0))}const Te=Rb(Y.horizontal)||Y.vertical;r.iconsInText||(r.iconsInText=!!Te&&Te.iconsInText),(Te||ue)&&iP(r,F,Y,ue,a,M,se,0,ce,Ie,g,y,b)}p&&r.generateCollisionDebugBuffers(w,r.collisionBoxArray)}function n0(r){switch(r){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function iP(r,t,i,a,u,p,g,y,w,b,A,I,M){let L=p.textMaxSize.evaluate(t,{},I);L===void 0&&(L=g);const R=r.layers[0].layout,F=R.get("icon-offset").evaluate(t,{},I),$=Rb(i.horizontal)||i.vertical,K=M.name==="globe",se=Tr,Y=g/se,re=r.tilePixelRatio*L/se,ue=(je=r.overscaling,r.zoom>18&&je>2&&(je>>=1),Math.max(vt/(512*je),1)*R.get("symbol-spacing")),ce=R.get("text-padding")*r.tilePixelRatio,Ie=R.get("icon-padding")*r.tilePixelRatio,Te=St(R.get("text-max-angle")),De=R.get("text-rotation-alignment")==="map"&&R.get("symbol-placement")!=="point",Ze=R.get("icon-rotation-alignment")==="map"&&R.get("symbol-placement")!=="point",Me=R.get("symbol-placement"),Ue=ue/2;var je;const Ge=R.get("icon-text-fit");let et;a&&Ge!=="none"&&(r.allowVerticalPlacement&&i.vertical&&(et=wb(a,i.vertical,Ge,R.get("icon-text-fit-padding"),F,Y)),$&&(a=wb(a,$,Ge,R.get("icon-text-fit-padding"),F,Y)));const Le=(ot,ft,st)=>{if(ft.x<0||ft.x>=vt||ft.y<0||ft.y>=vt)return;let At=null;if(K){const{x:tt,y:_t,z:Ct}=M.projectTilePoint(ft.x,ft.y,st);At={anchor:new qs(tt,_t,Ct,0,void 0),up:M.upVector(st,ft.x,ft.y)}}(function(tt,_t,Ct,Ht,It,bt,bn,zt,Lt,cn,fn,mn,un,kn,Rn,Zn,hn,nr,Hn,Mn,Kt,Xn,gn,Kr,Kn){const Sr=tt.addToLineVertexArray(_t,Ht);let mr,Yr,gr,No,Tu,Xd,Kd,p2=0,f2=0,m2=0,g2=0,_0=-1,y0=-1;const ds={};let _2=py("");const rc=Ct?Ct.anchor:_t;let v0=0,x0=0;if(Lt._unevaluatedLayout.getValue("text-radial-offset")===void 0?[v0,x0]=Lt.layout.get("text-offset").evaluate(Kt,{},Kn).map(bi=>bi*Tr):(v0=Lt.layout.get("text-radial-offset").evaluate(Kt,{},Kn)*Tr,x0=t0),tt.allowVerticalPlacement&&It.vertical){const bi=It.vertical;if(Rn)Xd=r0(bi),zt&&(Kd=r0(zt));else{const Ei=Lt.layout.get("text-rotate").evaluate(Kt,{},Kn)+90;gr=Em(cn,rc,_t,fn,mn,un,bi,kn,Ei,Zn),zt&&(No=Em(cn,rc,_t,fn,mn,un,zt,nr,Ei))}}if(bt){const bi=Lt.layout.get("icon-rotate").evaluate(Kt,{},Kn),Ei=Lt.layout.get("icon-text-fit")!=="none",Yd=Mb(bt,bi,gn,Ei),b0=zt?Mb(zt,bi,gn,Ei):void 0;Yr=Em(cn,rc,_t,fn,mn,un,bt,nr,bi),p2=4*Yd.length;const y2=tt.iconSizeData;let ic=null;y2.kind==="source"?(ic=[Oo*Lt.layout.get("icon-size").evaluate(Kt,{},Kn)],ic[0]>Ra&&wn(`${tt.layerIds[0]}: Value for "icon-size" is >= ${jd}. Reduce your "icon-size".`)):y2.kind==="composite"&&(ic=[Oo*Xn.compositeIconSizes[0].evaluate(Kt,{},Kn),Oo*Xn.compositeIconSizes[1].evaluate(Kt,{},Kn)],(ic[0]>Ra||ic[1]>Ra)&&wn(`${tt.layerIds[0]}: Value for "icon-size" is >= ${jd}. Reduce your "icon-size".`)),tt.addSymbols(tt.icon,Yd,ic,Mn,Hn,Kt,!1,Ct,_t,Sr.lineStartIndex,Sr.lineLength,-1,Kr,Kn),_0=tt.icon.placedSymbolArray.length-1,b0&&(f2=4*b0.length,tt.addSymbols(tt.icon,b0,ic,Mn,Hn,Kt,Ni.vertical,Ct,_t,Sr.lineStartIndex,Sr.lineLength,-1,Kr,Kn),y0=tt.icon.placedSymbolArray.length-1)}for(const bi in It.horizontal){const Ei=It.horizontal[bi];mr||(_2=py(Ei.text),Rn?Tu=r0(Ei):mr=Em(cn,rc,_t,fn,mn,un,Ei,kn,Lt.layout.get("text-rotate").evaluate(Kt,{},Kn),Zn));const Yd=Ei.positionedLines.length===1;if(m2+=Lb(tt,Ct,_t,Ei,bn,Lt,Rn,Kt,Zn,Sr,It.vertical?Ni.horizontal:Ni.horizontalOnly,Yd?Object.keys(It.horizontal):[bi],ds,_0,Xn,Kr,Kn),Yd)break}It.vertical&&(g2+=Lb(tt,Ct,_t,It.vertical,bn,Lt,Rn,Kt,Zn,Sr,Ni.vertical,["vertical"],ds,y0,Xn,Kr,Kn));let Ua=-1;const w0=(bi,Ei)=>bi?Math.max(bi,Ei):Ei;Ua=w0(Tu,Ua),Ua=w0(Xd,Ua),Ua=w0(Kd,Ua);const zP=Ua>-1?1:0;tt.glyphOffsetArray.length>=Oa.MAX_GLYPHS&&wn("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Kt.sortKey!==void 0&&tt.addToSortKeyRanges(tt.symbolInstances.length,Kt.sortKey),tt.symbolInstances.emplaceBack(rc.x,rc.y,rc.z,_t.x,_t.y,ds.right>=0?ds.right:-1,ds.center>=0?ds.center:-1,ds.left>=0?ds.left:-1,ds.vertical>=0?ds.vertical:-1,_0,y0,_2,mr!==void 0?mr:tt.collisionBoxArray.length,mr!==void 0?mr+1:tt.collisionBoxArray.length,gr!==void 0?gr:tt.collisionBoxArray.length,gr!==void 0?gr+1:tt.collisionBoxArray.length,Yr!==void 0?Yr:tt.collisionBoxArray.length,Yr!==void 0?Yr+1:tt.collisionBoxArray.length,No||tt.collisionBoxArray.length,No?No+1:tt.collisionBoxArray.length,fn,m2,g2,p2,f2,zP,0,v0,x0,Ua)})(r,ft,At,ot,i,a,u,et,r.layers[0],r.collisionBoxArray,t.index,t.sourceLayerIndex,r.index,ce,De,w,0,Ie,Ze,F,t,p,b,A,I)};if(Me==="line")for(const ot of Cb(t.geometry,0,0,vt,vt)){const ft=KM(ot,ue,Te,i.vertical||$,a,se,re,r.overscaling,vt);for(const st of ft)$&&oP(r,$.text,Ue,st)||Le(ot,st,I)}else if(Me==="line-center"){for(const ot of t.geometry)if(ot.length>1){const ft=XM(ot,Te,i.vertical||$,a,se,re);ft&&Le(ot,ft,I)}}else if(t.type==="Polygon")for(const ot of $y(t.geometry,0)){const ft=eP(ot,16);Le(ot[0],new qs(ft.x,ft.y,0,0,void 0),I)}else if(t.type==="LineString")for(const ot of t.geometry)Le(ot,new qs(ot[0].x,ot[0].y,0,0,void 0),I);else if(t.type==="Point")for(const ot of t.geometry)for(const ft of ot)Le([ft],new qs(ft.x,ft.y,0,0,void 0),I)}const jd=255,Ra=jd*Oo;function Lb(r,t,i,a,u,p,g,y,w,b,A,I,M,L,R,F,$){const K=function(re,ue,ce,Ie,Te,De,Ze,Me){const Ue=[];if(ue.positionedLines.length===0)return Ue;const je=Ie.layout.get("text-rotate").evaluate(De,{})*Math.PI/180,Ge=function(st){const At=st[0],tt=st[1],_t=At*tt;return _t>0?[At,-tt]:_t<0?[-At,tt]:At===0?[tt,At]:[tt,-At]}(ce);let et=Math.abs(ue.top-ue.bottom);for(const st of ue.positionedLines)et-=st.lineOffset;const Le=ue.positionedLines.length,ot=et/Le;let ft=ue.top-ce[1];for(let st=0;stRa&&wn(`${r.layerIds[0]}: Value for "text-size" is >= ${jd}. Reduce your "text-size".`)):se.kind==="composite"&&(Y=[Oo*R.compositeTextSizes[0].evaluate(y,{},$),Oo*R.compositeTextSizes[1].evaluate(y,{},$)],(Y[0]>Ra||Y[1]>Ra)&&wn(`${r.layerIds[0]}: Value for "text-size" is >= ${jd}. Reduce your "text-size".`)),r.addSymbols(r.text,K,Y,w,g,y,A,t,i,b.lineStartIndex,b.lineLength,L,F,$);for(const re of I)M[re]=r.text.placedSymbolArray.length-1;return 4*K.length}function Rb(r){for(const t in r)return r[t];return null}function Em(r,t,i,a,u,p,g,y,w,b){let A=g.top,I=g.bottom,M=g.left,L=g.right;const R=g.collisionPadding;if(R&&(M-=R[0],A-=R[1],L+=R[2],I+=R[3]),w){const F=new Ve(M,A),$=new Ve(L,A),K=new Ve(M,I),se=new Ve(L,I),Y=St(w);let re=new Ve(0,0);b&&(re=new Ve(b[0],b[1])),F._rotateAround(Y,re),$._rotateAround(Y,re),K._rotateAround(Y,re),se._rotateAround(Y,re),M=Math.min(F.x,$.x,K.x,se.x),L=Math.max(F.x,$.x,K.x,se.x),A=Math.min(F.y,$.y,K.y,se.y),I=Math.max(F.y,$.y,K.y,se.y)}return r.emplaceBack(t.x,t.y,t.z,i.x,i.y,M,A,L,I,y,a,u,p),r.length-1}function r0(r){r.collisionPadding&&(r.top-=r.collisionPadding[1],r.bottom+=r.collisionPadding[3]);const t=r.bottom-r.top;return t>0?Math.max(10,t):null}function oP(r,t,i,a){const u=r.compareText;if(t in u){const p=u[t];for(let g=p.length-1;g>=0;g--)if(a.dist(p[g])Y&&(re(ce,Ge,Te,De,Ue,je),re(Ge,Ie,Ue,je,Ze,Me))}re(I,M,a,p,u,p),re(M,L,u,p,u,g),re(L,R,u,g,a,g),re(R,I,a,g,a,p),F-=Y,$-=Y,K+=Y,se+=Y;const ue=1/Math.max(K-F,se-$);return{scale:ue,x:F*ue,y:$*ue,x2:K*ue,y2:se*ue,projection:t}}const sP=Lo(new Float32Array(16));class Da{constructor(t){this.spec=t,this.name=t.name,this.wrap=!1,this.requiresDraping=!1,this.supportsWorldCopies=!1,this.supportsTerrain=!1,this.supportsFog=!1,this.supportsFreeCamera=!1,this.zAxisUnit="meters",this.isReprojectedInTileSpace=!0,this.unsupportedLayers=["custom"],this.center=[0,0],this.range=[3.5,7]}project(t,i){return{x:0,y:0,z:0}}unproject(t,i){return new ln(0,0)}projectTilePoint(t,i,a){return{x:t,y:i,z:0}}locationPoint(t,i,a=!0){return t._coordinatePoint(t.locationCoordinate(i),a)}pixelsPerMeter(t,i){return Do(1,t)*i}pixelSpaceConversion(t,i,a){return 1}farthestPixelDistance(t){return Db(t,t.pixelsPerMeter)}pointCoordinate(t,i,a,u){const p=t.horizonLineFromTop(!1),g=new Ve(i,Math.max(p,a));return t.rayIntersectionCoordinate(t.pointRayIntersection(g,u))}pointCoordinate3D(t,i,a){const u=new Ve(i,a);if(t.elevation)return t.elevation.pointCoordinate(u);{const p=this.pointCoordinate(t,u.x,u.y,0);return[p.x,p.y,p.z]}}isPointAboveHorizon(t,i){if(t.elevation)return!this.pointCoordinate3D(t,i.x,i.y);const a=t.horizonLineFromTop();return i.y0?i<-bu+a&&(i=-bu+a):i>bu-a&&(i=bu-a);const g=p/Math.pow(Sm(i),u);let y=g*Math.sin(u*t),w=p-g*Math.cos(u*t);return y=.5*(y/Math.PI+.5),w=.5*(w/Math.PI+.5),{x:y,y:this.southernCenter?w:1-w,z:0}}unproject(t,i){t=(2*t-.5)*Math.PI,this.southernCenter&&(i=1-i),i=(2*(1-i)-.5)*Math.PI;const{n:a,f:u}=this,p=u-i,g=Math.sign(p),y=Math.sign(a)*Math.sqrt(t*t+p*p);let w=Math.atan2(t,Math.abs(p))*g;p*a<0&&(w-=Math.PI*Math.sign(t)*g);const b=Je(Vt(w/a)+this.center[0],-180,180),A=Je(Vt(2*Math.atan(Math.pow(u/y,1/a))-bu),-zr,zr);return new ln(b,this.southernCenter?-A:A)}}class Ob extends Da{constructor(t){super(t),this.wrap=!0,this.supportsWorldCopies=!0,this.supportsTerrain=!0,this.supportsFog=!0,this.supportsFreeCamera=!0,this.isReprojectedInTileSpace=!1,this.unsupportedLayers=[],this.range=null}project(t,i){return{x:as(t),y:ls(i),z:0}}unproject(t,i){const a=Fi(t),u=Pr(i);return new ln(a,u)}}const Bb=St(zr);class hP extends Da{project(t,i){const a=(i=St(i))*i,u=a*a;return{x:.5*((t=St(t))*(.8707-.131979*a+u*(u*(.003971*a-.001529*u)-.013791))/Math.PI+.5),y:1-.5*(i*(1.007226+a*(.015085+u*(.028874*a-.044475-.005916*u)))/Math.PI+1),z:0}}unproject(t,i){t=(2*t-.5)*Math.PI;let a=i=(2*(1-i)-1)*Math.PI,u=25,p=0,g=a*a;do{g=a*a;const b=g*g;p=(a*(1.007226+g*(.015085+b*(.028874*g-.044475-.005916*b)))-i)/(1.007226+g*(.045255+b*(.259866*g-.311325-.005916*11*b))),a=Je(a-p,-Bb,Bb)}while(Math.abs(p)>1e-6&&--u>0);g=a*a;const y=Je(Vt(t/(.8707+g*(g*(g*g*g*(.003971-.001529*g)-.013791)-.131979))),-180,180),w=Vt(a);return new ln(y,w)}}const Fb=St(zr);class dP extends Da{project(t,i){i=St(i),t=St(t);const a=Math.cos(i),u=2/Math.PI,p=Math.acos(a*Math.cos(t/2)),g=Math.sin(p)/p,y=.5*(t*u+2*a*Math.sin(t/2)/g)||0,w=.5*(i+Math.sin(i)/g)||0;return{x:.5*(y/Math.PI+.5),y:1-.5*(w/Math.PI+1),z:0}}unproject(t,i){let a=t=(2*t-.5)*Math.PI,u=i=(2*(1-i)-1)*Math.PI,p=25;const g=1e-6;let y=0,w=0;do{const b=Math.cos(u),A=Math.sin(u),I=2*A*b,M=A*A,L=b*b,R=Math.cos(a/2),F=Math.sin(a/2),$=2*R*F,K=F*F,se=1-L*R*R,Y=se?1/se:0,re=se?Math.acos(b*R)*Math.sqrt(1/se):0,ue=.5*(2*re*b*F+2*a/Math.PI)-t,ce=.5*(re*A+u)-i,Ie=.5*Y*(L*K+re*b*R*M)+1/Math.PI,Te=Y*($*I/4-re*A*F),De=.125*Y*(I*F-re*A*L*$),Ze=.5*Y*(M*R+re*K*b)+.5,Me=Te*De-Ze*Ie;y=(ce*Te-ue*Ze)/Me,w=(ue*De-ce*Ie)/Me,a=Je(a-y,-Math.PI,Math.PI),u=Je(u-w,-Fb,Fb)}while((Math.abs(y)>g||Math.abs(w)>g)&&--p>0);return new ln(Vt(a),Vt(u))}}class Nb extends Da{constructor(t){super(t),this.center=t.center||[0,0],this.parallels=t.parallels||[0,0],this.cosPhi=Math.max(.01,Math.cos(St(this.parallels[0]))),this.scale=1/(2*Math.max(Math.PI*this.cosPhi,1/this.cosPhi)),this.wrap=!0,this.supportsWorldCopies=!0}project(t,i){const{scale:a,cosPhi:u}=this;return{x:St(t)*u*a+.5,y:-Math.sin(St(i))/u*a+.5,z:0}}unproject(t,i){const{scale:a,cosPhi:u}=this,p=-(i-.5)/a,g=Je(Vt((t-.5)/a)/u,-180,180),y=Math.asin(Je(p*u,-1,1)),w=Je(Vt(y),-zr,zr);return new ln(g,w)}}class pP extends Ob{constructor(t){super(t),this.requiresDraping=!0,this.supportsWorldCopies=!1,this.supportsFog=!0,this.zAxisUnit="pixels",this.unsupportedLayers=["debug"],this.range=[3,5]}projectTilePoint(t,i,a){const u=Ad(t,i,a);return Nn(u,u,Cd(ss(a))),{x:u[0],y:u[1],z:u[2]}}locationPoint(t,i){const a=au(i.lat,i.lng),u=Zr([],a),p=t.elevation?t.elevation.getAtPointOrZero(t.locationCoordinate(i),t._centerAltitude):t._centerAltitude;bd(a,a,u,Do(1,0)*vt*p);const g=Lo(new Float64Array(16));return Zl(g,t.pixelMatrix,t.globeMatrix),Nn(a,a,g),new Ve(a[0],a[1])}pixelsPerMeter(t,i){return Do(1,0)*i}pixelSpaceConversion(t,i,a){const u=Do(1,t)*i,p=Wt(Do(1,45)*i,u,a);return this.pixelsPerMeter(t,i)/p}createTileMatrix(t,i,a){const u=Cy(ss(a.canonical));return Zl(new Float64Array(16),t.globeMatrix,u)}createInversionMatrix(t,i){const{center:a}=t,u=Cd(ss(i));return Qf(u,u,St(a.lng)),_y(u,u,St(a.lat)),Hl(u,u,[t._pixelsPerMercatorPixel,t._pixelsPerMercatorPixel,1]),Float32Array.from(u)}pointCoordinate(t,i,a,u){return dw(t,i,a,!0)||new cu(0,0)}pointCoordinate3D(t,i,a){const u=this.pointCoordinate(t,i,a,0);return[u.x,u.y,u.z]}isPointAboveHorizon(t,i){return!dw(t,i.x,i.y,!1)}farthestPixelDistance(t){const i=function(u,p){const g=u.cameraToCenterDistance,y=u._centerAltitude*p,w=u._camera,b=u._camera.forward(),A=js([],Bi([],b,-g),[0,0,y]),I=u.worldSize/(2*Math.PI),M=[0,0,-I],L=u.width/u.height,R=Math.tan(u.fovAboveCenter),F=Bi([],w.up(),R),$=Bi([],w.right(),R*L),K=Zr([],js([],js([],b,F),$)),se=[];let Y;if(new wy(A,K).closestPointOnSphere(M,I,se)){const re=js([],se,M),ue=Ro([],re,A);Y=Math.cos(u.fovAboveCenter)*vd(ue)}else{const re=Ro([],A,M),ue=Ro([],M,A);Zr(ue,ue);const ce=vd(re)-I;Y=Math.sqrt(ce*(ce+2*I));const Ie=Math.acos(Y/(I+ce))-Math.acos(oo(b,ue));Y*=Math.cos(Ie)}return 1.01*Y}(t,this.pixelsPerMeter(t.center.lat,t.worldSize)),a=lu(t.zoom);if(a>0){const u=Db(t,Do(1,t.center.lat)*t.worldSize),p=t.worldSize/(2*Math.PI),g=Math.max(t.width,t.height)/t.worldSize*Math.PI;return Wt(i,u+p*(1-Math.cos(g)),Math.pow(a,10))}return i}upVector(t,i,a){return Ad(i,a,t,1)}upVectorScale(t){return{metersToTile:em(nm(ss(t)))}}}function Ub(r){const t=r.parallels,i=!!t&&Math.abs(t[0]+t[1])<.01;switch(r.name){case"mercator":return new Ob(r);case"equirectangular":return new cP(r);case"naturalEarth":return new hP(r);case"equalEarth":return new lP(r);case"winkelTripel":return new dP(r);case"albers":return i?new Nb(r):new aP(r);case"lambertConformalConic":return i?new Nb(r):new uP(r);case"globe":return new pP(r)}throw new Error(`Invalid projection name: ${r.name}`)}const fP=dm.types,mP=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Am(r,t,i,a,u,p,g,y,w,b,A,I,M){const L=y?Math.min(Ra,Math.round(y[0])):0,R=y?Math.min(Ra,Math.round(y[1])):0;r.emplaceBack(t,i,Math.round(32*a),Math.round(32*u),p,g,(L<<1)+(w?1:0),R,16*b,16*A,256*I,256*M)}function Cm(r,t,i,a,u,p,g){r.emplaceBack(t,i,a,u,p,g)}function Im(r,t,i,a,u){r.emplaceBack(t,i,a,u),r.emplaceBack(t,i,a,u),r.emplaceBack(t,i,a,u),r.emplaceBack(t,i,a,u)}function gP(r){for(const t of r.sections)if(dy(t.text))return!0;return!1}class i0{constructor(t){this.layoutVertexArray=new $e,this.indexArray=new mt,this.programConfigurations=t,this.segments=new qn,this.dynamicLayoutVertexArray=new qe,this.opacityVertexArray=new gt,this.placedSymbolArray=new Gn,this.globeExtVertexArray=new Ye}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(t,i,a,u){this.isEmpty()||(a&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,TM.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,i),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,AM.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,mP,!0),this.globeExtVertexArray.length>0&&(this.globeExtVertexBuffer=t.createVertexBuffer(this.globeExtVertexArray,SM.members,!0)),this.opacityVertexBuffer.itemSize=1),(a||u)&&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(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}}dt(i0,"SymbolBuffers");class o0{constructor(t,i,a){this.layoutVertexArray=new t,this.layoutAttributes=i,this.indexArray=new a,this.segments=new qn,this.collisionVertexArray=new Ut,this.collisionVertexArrayExt=new Ot}upload(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,CM.members,!0),this.collisionVertexBufferExt=t.createVertexBuffer(this.collisionVertexArrayExt,IM.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy(),this.collisionVertexBufferExt.destroy())}}dt(o0,"CollisionBuffers");class Oa{constructor(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(g=>g.id),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.fullyClipped=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Lo([]),this.placementViewportMatrix=Lo([]);const i=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Zy(this.zoom,i["text-size"]),this.iconSizeData=Zy(this.zoom,i["icon-size"]);const a=this.layers[0].layout,u=a.get("symbol-sort-key"),p=a.get("symbol-z-order");this.canOverlap=a.get("text-allow-overlap")||a.get("icon-allow-overlap")||a.get("text-ignore-placement")||a.get("icon-ignore-placement"),this.sortFeaturesByKey=p!=="viewport-y"&&u.constantOr(1)!==void 0,this.sortFeaturesByY=(p==="viewport-y"||p==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,this.writingModes=a.get("text-writing-mode").map(g=>Ni[g]),this.stateDependentLayerIds=this.layers.filter(g=>g.isStateDependent()).map(g=>g.id),this.sourceID=t.sourceID,this.projection=t.projection}createArrays(){this.text=new i0(new Wl(this.layers,this.zoom,t=>/^text/.test(t))),this.icon=new i0(new Wl(this.layers,this.zoom,t=>/^icon/.test(t))),this.glyphOffsetArray=new Wr,this.lineVertexArray=new nu,this.symbolInstances=new En}calculateGlyphDependencies(t,i,a,u,p){for(let g=0;g0)&&(w.value.kind!=="constant"||w.value.value.length>0),M=A.value.kind!=="constant"||!!A.value.value||Object.keys(A.parameters).length>0,L=g.get("symbol-sort-key");if(this.features=[],!I&&!M)return;const R=i.iconDependencies,F=i.glyphDependencies,$=i.availableImages,K=new C(this.zoom);for(const{feature:se,id:Y,index:re,sourceLayerIndex:ue}of t){const ce=p._featureFilter.needGeometry,Ie=Jl(se,ce);if(!p._featureFilter.filter(K,Ie,a))continue;if(ce||(Ie.geometry=Vs(se,a,u)),y&&se.type!==1&&a.z<=5){const Me=Ie.geometry,Ue=.98078528056,je=(Ge,et)=>oo(Ad(Ge.x,Ge.y,a,1),Ad(et.x,et.y,a,1))=0;for(const je of Te.sections)if(je.image)R[je.image.name]=!0;else{const Ge=hd(Te.toString()),et=je.fontStack||Me,Le=F[et]=F[et]||{};this.calculateGlyphDependencies(je.text,Le,Ue,this.allowVerticalPlacement,Ge)}}}g.get("symbol-placement")==="line"&&(this.features=function(se){const Y={},re={},ue=[];let ce=0;function Ie(Me){ue.push(se[Me]),ce++}function Te(Me,Ue,je){const Ge=re[Me];return delete re[Me],re[Ue]=Ge,ue[Ge].geometry[0].pop(),ue[Ge].geometry[0]=ue[Ge].geometry[0].concat(je[0]),Ge}function De(Me,Ue,je){const Ge=Y[Ue];return delete Y[Ue],Y[Me]=Ge,ue[Ge].geometry[0].shift(),ue[Ge].geometry[0]=je[0].concat(ue[Ge].geometry[0]),Ge}function Ze(Me,Ue,je){const Ge=je?Ue[0][Ue[0].length-1]:Ue[0][0];return`${Me}:${Ge.x}:${Ge.y}`}for(let Me=0;MeMe.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((se,Y)=>se.sortKey-Y.sortKey)}update(t,i,a,u){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,i,this.layers,a,u),this.icon.programConfigurations.updatePaintArrays(t,i,this.layers,a,u))}isEmpty(){return this.symbolInstances.length===0&&!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()}getProjection(){return this.projectionInstance||(this.projectionInstance=Ub(this.projection)),this.projectionInstance}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(t,i){const a=this.lineVertexArray.length;if(t.segment!==void 0)for(const{x:u,y:p}of i)this.lineVertexArray.emplaceBack(u,p);return{lineStartIndex:a,lineLength:this.lineVertexArray.length-a}}addSymbols(t,i,a,u,p,g,y,w,b,A,I,M,L,R){const F=t.indexArray,$=t.layoutVertexArray,K=t.globeExtVertexArray,se=t.segments.prepareSegment(4*i.length,$,F,this.canOverlap?g.sortKey:void 0),Y=this.glyphOffsetArray.length,re=se.vertexLength,ue=this.allowVerticalPlacement&&y===Ni.vertical?Math.PI/2:0,ce=g.text&&g.text.sections;for(let Te=0;Te=0?i.rightJustifiedTextSymbolIndex:i.centerJustifiedTextSymbolIndex>=0?i.centerJustifiedTextSymbolIndex:i.leftJustifiedTextSymbolIndex>=0?i.leftJustifiedTextSymbolIndex:i.verticalPlacedTextSymbolIndex>=0?i.verticalPlacedTextSymbolIndex:u),g=gm(this.textSizeData,t,p)/Tr;return this.tilePixelRatio*g}getSymbolInstanceIconSize(t,i,a){const u=this.icon.placedSymbolArray.get(a),p=gm(this.iconSizeData,t,u);return this.tilePixelRatio*p}_commitDebugCollisionVertexUpdate(t,i,a){t.emplaceBack(i,-a,-a),t.emplaceBack(i,a,-a),t.emplaceBack(i,a,a),t.emplaceBack(i,-a,a)}_updateTextDebugCollisionBoxes(t,i,a,u,p,g){for(let y=u;y0}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,i){const a=t.placedSymbolArray.get(i),u=a.vertexStartIndex+4*a.numGlyphs;for(let p=a.vertexStartIndex;pu[y]-u[w]||p[w]-p[y]),g}addToSortKeyRanges(t,i){const a=this.sortKeyRanges[this.sortKeyRanges.length-1];a&&a.sortKey===i?a.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:i,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 i of this.symbolInstanceIndexes){const a=this.symbolInstances.get(i);this.featureSortOrder.push(a.featureIndex);const{rightJustifiedTextSymbolIndex:u,centerJustifiedTextSymbolIndex:p,leftJustifiedTextSymbolIndex:g,verticalPlacedTextSymbolIndex:y,placedIconSymbolIndex:w,verticalPlacedIconSymbolIndex:b}=a;u>=0&&this.addIndicesForPlacedSymbol(this.text,u),p>=0&&p!==u&&this.addIndicesForPlacedSymbol(this.text,p),g>=0&&g!==p&&g!==u&&this.addIndicesForPlacedSymbol(this.text,g),y>=0&&this.addIndicesForPlacedSymbol(this.text,y),w>=0&&this.addIndicesForPlacedSymbol(this.icon,w),b>=0&&this.addIndicesForPlacedSymbol(this.icon,b)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}dt(Oa,"SymbolBucket",{omit:["layers","collisionBoxArray","features","compareText"]}),Oa.MAX_GLYPHS=65535,Oa.addDynamicAttributes=Im;const _P=new ee({"symbol-placement":new B(Re.layout_symbol["symbol-placement"]),"symbol-spacing":new B(Re.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new B(Re.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new q(Re.layout_symbol["symbol-sort-key"]),"symbol-z-order":new B(Re.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new B(Re.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new B(Re.layout_symbol["icon-ignore-placement"]),"icon-optional":new B(Re.layout_symbol["icon-optional"]),"icon-rotation-alignment":new B(Re.layout_symbol["icon-rotation-alignment"]),"icon-size":new q(Re.layout_symbol["icon-size"]),"icon-text-fit":new B(Re.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new B(Re.layout_symbol["icon-text-fit-padding"]),"icon-image":new q(Re.layout_symbol["icon-image"]),"icon-rotate":new q(Re.layout_symbol["icon-rotate"]),"icon-padding":new B(Re.layout_symbol["icon-padding"]),"icon-keep-upright":new B(Re.layout_symbol["icon-keep-upright"]),"icon-offset":new q(Re.layout_symbol["icon-offset"]),"icon-anchor":new q(Re.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new B(Re.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new B(Re.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new B(Re.layout_symbol["text-rotation-alignment"]),"text-field":new q(Re.layout_symbol["text-field"]),"text-font":new q(Re.layout_symbol["text-font"]),"text-size":new q(Re.layout_symbol["text-size"]),"text-max-width":new q(Re.layout_symbol["text-max-width"]),"text-line-height":new q(Re.layout_symbol["text-line-height"]),"text-letter-spacing":new q(Re.layout_symbol["text-letter-spacing"]),"text-justify":new q(Re.layout_symbol["text-justify"]),"text-radial-offset":new q(Re.layout_symbol["text-radial-offset"]),"text-variable-anchor":new B(Re.layout_symbol["text-variable-anchor"]),"text-anchor":new q(Re.layout_symbol["text-anchor"]),"text-max-angle":new B(Re.layout_symbol["text-max-angle"]),"text-writing-mode":new B(Re.layout_symbol["text-writing-mode"]),"text-rotate":new q(Re.layout_symbol["text-rotate"]),"text-padding":new B(Re.layout_symbol["text-padding"]),"text-keep-upright":new B(Re.layout_symbol["text-keep-upright"]),"text-transform":new q(Re.layout_symbol["text-transform"]),"text-offset":new q(Re.layout_symbol["text-offset"]),"text-allow-overlap":new B(Re.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new B(Re.layout_symbol["text-ignore-placement"]),"text-optional":new B(Re.layout_symbol["text-optional"])});var s0={paint:new ee({"icon-opacity":new q(Re.paint_symbol["icon-opacity"]),"icon-color":new q(Re.paint_symbol["icon-color"]),"icon-halo-color":new q(Re.paint_symbol["icon-halo-color"]),"icon-halo-width":new q(Re.paint_symbol["icon-halo-width"]),"icon-halo-blur":new q(Re.paint_symbol["icon-halo-blur"]),"icon-translate":new B(Re.paint_symbol["icon-translate"]),"icon-translate-anchor":new B(Re.paint_symbol["icon-translate-anchor"]),"text-opacity":new q(Re.paint_symbol["text-opacity"]),"text-color":new q(Re.paint_symbol["text-color"],{runtimeType:si,getOverride:r=>r.textColor,hasOverride:r=>!!r.textColor}),"text-halo-color":new q(Re.paint_symbol["text-halo-color"]),"text-halo-width":new q(Re.paint_symbol["text-halo-width"]),"text-halo-blur":new q(Re.paint_symbol["text-halo-blur"]),"text-translate":new B(Re.paint_symbol["text-translate"]),"text-translate-anchor":new B(Re.paint_symbol["text-translate-anchor"])}),layout:_P};class jb{constructor(t){this.type=t.property.overrides?t.property.overrides.runtimeType:da,this.defaultValue=t}evaluate(t){if(t.formattedSection){const i=this.defaultValue.property.overrides;if(i&&i.hasOverride(t.formattedSection))return i.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}}dt(jb,"FormatSectionOverride",{omit:["defaultValue"]});class km extends zo{constructor(t){super(t,s0)}recalculate(t,i){super.recalculate(t,i),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"));const a=this.layout.get("text-writing-mode");if(a){const u=[];for(const p of a)u.indexOf(p)<0&&u.push(p);this.layout._values["text-writing-mode"]=u}else this.layout._values["text-writing-mode"]=this.layout.get("symbol-placement")==="point"?["horizontal"]:["horizontal","vertical"];this._setPaintOverrides()}getValueAndResolveTokens(t,i,a,u){const p=this.layout.get(t).evaluate(i,{},a,u),g=this._unevaluatedLayout._values[t];return g.isDataDriven()||Ta(g.value)||!p?p:function(y,w){return w.replace(/{([^{}]+)}/g,(b,A)=>A in y?String(y[A]):"")}(i.properties,p)}createBucket(t){return new Oa(t)}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(const t of s0.paint.overridableProperties){if(!km.hasPaintOverride(this.layout,t))continue;const i=this.paint.get(t),a=new jb(i),u=new Hc(a,i.property.specification);let p=null;p=i.value.kind==="constant"||i.value.kind==="source"?new ed("source",u):new Bl("composite",u,i.value.zoomStops,i.value._interpolationType),this.paint._values[t]=new Z(i.property,p,i.parameters)}}_handleOverridablePaintPropertyUpdate(t,i,a){return!(!this.layout||i.isDataDriven()||a.isDataDriven())&&km.hasPaintOverride(this.layout,t)}static hasPaintOverride(t,i){const a=t.get("text-field"),u=s0.paint.properties[i];let p=!1;const g=y=>{for(const w of y)if(u.overrides&&u.overrides.hasOverride(w))return void(p=!0)};if(a.value.kind==="constant"&&a.value.value instanceof qr)g(a.value.value.sections);else if(a.value.kind==="source"){const y=b=>{p||(b instanceof Ms&&Ln(b.value)===xl?g(b.value.sections):b instanceof ns?g(b.sections):b.eachChild(y))},w=a.value;w._styleExpression&&y(w._styleExpression.expression)}return p}getProgramConfiguration(t){return new Pa(this,t)}}var yP={paint:new ee({"background-color":new B(Re.paint_background["background-color"]),"background-pattern":new B(Re.paint_background["background-pattern"]),"background-opacity":new B(Re.paint_background["background-opacity"])})},vP={paint:new ee({"raster-opacity":new B(Re.paint_raster["raster-opacity"]),"raster-hue-rotate":new B(Re.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new B(Re.paint_raster["raster-brightness-min"]),"raster-brightness-max":new B(Re.paint_raster["raster-brightness-max"]),"raster-saturation":new B(Re.paint_raster["raster-saturation"]),"raster-contrast":new B(Re.paint_raster["raster-contrast"]),"raster-resampling":new B(Re.paint_raster["raster-resampling"]),"raster-fade-duration":new B(Re.paint_raster["raster-fade-duration"])})};class xP extends zo{constructor(t){super(t,{}),this.implementation=t}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}isLayerDraped(){return this.implementation.renderToTile!==void 0}shouldRedrape(){return!!this.implementation.shouldRerenderTiles&&this.implementation.shouldRerenderTiles()}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){}onAdd(t){this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)}onRemove(t){this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)}}var wP={paint:new ee({"sky-type":new B(Re.paint_sky["sky-type"]),"sky-atmosphere-sun":new B(Re.paint_sky["sky-atmosphere-sun"]),"sky-atmosphere-sun-intensity":new B(Re.paint_sky["sky-atmosphere-sun-intensity"]),"sky-gradient-center":new B(Re.paint_sky["sky-gradient-center"]),"sky-gradient-radius":new B(Re.paint_sky["sky-gradient-radius"]),"sky-gradient":new Q(Re.paint_sky["sky-gradient"]),"sky-atmosphere-halo-color":new B(Re.paint_sky["sky-atmosphere-halo-color"]),"sky-atmosphere-color":new B(Re.paint_sky["sky-atmosphere-color"]),"sky-opacity":new B(Re.paint_sky["sky-opacity"])})};function a0(r,t,i){const a=[0,0,1],u=sw([]);return lw(u,u,i?-St(r)+Math.PI:St(r)),aw(u,u,-St(t)),nw(a,a,u),Zr(a,a)}const bP={circle:class extends zo{constructor(r){super(r,Lk)}createBucket(r){return new Ly(r)}queryRadius(r){const t=r;return uu("circle-radius",this,t)+uu("circle-stroke-width",this,t)+om(this.paint.get("circle-translate"))}queryIntersectsFeature(r,t,i,a,u,p,g,y){const w=Mw(this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),p.angle,r.pixelToTileUnitsFactor),b=this.paint.get("circle-radius").evaluate(t,i)+this.paint.get("circle-stroke-width").evaluate(t,i);return Pw(r,a,p,g,y,this.paint.get("circle-pitch-alignment")==="map",this.paint.get("circle-pitch-scale")==="map",w,b)}getProgramIds(){return["circle"]}getProgramConfiguration(r){return new Pa(this,r)}},heatmap:class extends zo{createBucket(r){return new Lw(r)}constructor(r){super(r,Bk),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(r){r==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=By({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(r){return uu("heatmap-radius",this,r)}queryIntersectsFeature(r,t,i,a,u,p,g,y){const w=this.paint.get("heatmap-radius").evaluate(t,i);return Pw(r,a,p,g,y,!0,!0,new Ve(0,0),w)}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}getProgramIds(){return["heatmap","heatmapTexture"]}getProgramConfiguration(r){return new Pa(this,r)}},hillshade:class extends zo{constructor(r){super(r,Fk)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}getProgramIds(){return["hillshade","hillshadePrepare"]}},fill:class extends zo{constructor(r){super(r,eM)}getProgramIds(){const r=this.paint.get("fill-pattern"),t=r&&r.constantOr(1),i=[t?"fillPattern":"fill"];return this.paint.get("fill-antialias")&&i.push(t&&!this.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline"),i}getProgramConfiguration(r){return new Pa(this,r)}recalculate(r,t){super.recalculate(r,t);const i=this.paint._values["fill-outline-color"];i.value.kind==="constant"&&i.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(r){return new um(r)}queryRadius(){return om(this.paint.get("fill-translate"))}queryIntersectsFeature(r,t,i,a,u,p){return!r.queryGeometry.isAboveHorizon&&Sw(kw(r.tilespaceGeometry,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),p.angle,r.pixelToTileUnitsFactor),a)}isTileClipped(){return!0}},"fill-extrusion":class extends zo{constructor(r){super(r,gM)}createBucket(r){return new Dd(r)}queryRadius(){return om(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}getProgramIds(){return[this.paint.get("fill-extrusion-pattern").constantOr(1)?"fillExtrusionPattern":"fillExtrusion"]}getProgramConfiguration(r){return new Pa(this,r)}queryIntersectsFeature(r,t,i,a,u,p,g,y,w){const b=Mw(this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),p.angle,r.pixelToTileUnitsFactor),A=this.paint.get("fill-extrusion-height").evaluate(t,i),I=this.paint.get("fill-extrusion-base").evaluate(t,i),M=[0,0],L=y&&p.elevation,R=p.elevation?p.elevation.exaggeration():1,F=r.tile.getBucket(this);if(L&&F instanceof Dd){const re=F.centroidVertexArray,ue=w+1;uere.polygon).flat());const $=L?y:null,[K,se]=function(re,ue,ce,Ie,Te,De,Ze,Me,Ue,je,Ge){return re.projection.name==="globe"?function(et,Le,ot,ft,st,At,tt,_t,Ct,Ht,It){const bt=[],bn=[],zt=et.projection.upVectorScale(It,et.center.lat,et.worldSize).metersToTile,Lt=[0,0,0,1],cn=[0,0,0,1],fn=(un,kn,Rn,Zn)=>{un[0]=kn,un[1]=Rn,un[2]=Zn,un[3]=1},mn=Kw();ot>0&&(ot+=mn),ft+=mn;for(const un of Le){const kn=[],Rn=[];for(const Zn of un){const hn=Zn.x+st.x,nr=Zn.y+st.y,Hn=et.projection.projectTilePoint(hn,nr,It),Mn=et.projection.upVector(It,Zn.x,Zn.y);let Kt=ot,Xn=ft;if(tt){const gn=tb(hn,nr,ot,ft,tt,_t,Ct,Ht);Kt+=gn.base,Xn+=gn.top}ot!==0?fn(Lt,Hn.x+Mn[0]*zt*Kt,Hn.y+Mn[1]*zt*Kt,Hn.z+Mn[2]*zt*Kt):fn(Lt,Hn.x,Hn.y,Hn.z),fn(cn,Hn.x+Mn[0]*zt*Xn,Hn.y+Mn[1]*zt*Xn,Hn.z+Mn[2]*zt*Xn),Nn(Lt,Lt,At),Nn(cn,cn,At),kn.push(new pu(Lt[0],Lt[1],Lt[2])),Rn.push(new pu(cn[0],cn[1],cn[2]))}bt.push(kn),bn.push(Rn)}return[bt,bn]}(re,ue,ce,Ie,Te,De,Ze,Me,Ue,je,Ge):Ze?function(et,Le,ot,ft,st,At,tt,_t,Ct){const Ht=[],It=[],bt=[0,0,0,1];for(const bn of et){const zt=[],Lt=[];for(const cn of bn){const fn=cn.x+ft.x,mn=cn.y+ft.y,un=tb(fn,mn,Le,ot,At,tt,_t,Ct);bt[0]=fn,bt[1]=mn,bt[2]=un.base,bt[3]=1,Xl(bt,bt,st),bt[3]=Math.max(bt[3],1e-5);const kn=new pu(bt[0]/bt[3],bt[1]/bt[3],bt[2]/bt[3]);bt[0]=fn,bt[1]=mn,bt[2]=un.top,bt[3]=1,Xl(bt,bt,st),bt[3]=Math.max(bt[3],1e-5);const Rn=new pu(bt[0]/bt[3],bt[1]/bt[3],bt[2]/bt[3]);zt.push(kn),Lt.push(Rn)}Ht.push(zt),It.push(Lt)}return[Ht,It]}(ue,ce,Ie,Te,De,Ze,Me,Ue,je):function(et,Le,ot,ft,st){const At=[],tt=[],_t=st[8]*Le,Ct=st[9]*Le,Ht=st[10]*Le,It=st[11]*Le,bt=st[8]*ot,bn=st[9]*ot,zt=st[10]*ot,Lt=st[11]*ot;for(const cn of et){const fn=[],mn=[];for(const un of cn){const kn=un.x+ft.x,Rn=un.y+ft.y,Zn=st[0]*kn+st[4]*Rn+st[12],hn=st[1]*kn+st[5]*Rn+st[13],nr=st[2]*kn+st[6]*Rn+st[14],Hn=st[3]*kn+st[7]*Rn+st[15],Mn=Zn+_t,Kt=hn+Ct,Xn=nr+Ht,gn=Math.max(Hn+It,1e-5),Kr=Zn+bt,Kn=hn+bn,Sr=nr+zt,mr=Math.max(Hn+Lt,1e-5);fn.push(new pu(Mn/gn,Kt/gn,Xn/gn)),mn.push(new pu(Kr/mr,Kn/mr,Sr/mr))}At.push(fn),tt.push(mn)}return[At,tt]}(ue,ce,Ie,Te,De)}(p,a,I,A,b,g,$,M,R,p.center.lat,r.tileID.canonical),Y=r.queryGeometry;return function(re,ue,ce){let Ie=1/0;Sw(ce,ue)&&(Ie=eb(ce,ue[0]));for(let Te=0;Te=3){for(let R=0;R{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){this._channel=void 0,this._callback=()=>{}}}class TP{constructor(){this.tasks={},this.taskQueue=[],Yi(["process"],this),this.invoker=new EP(this.process),this.nextId=0}add(t,i){const a=this.nextId++,u=function({type:p,isSymbolTile:g,zoom:y}){return y=y||0,p==="message"?0:p!=="maybePrepare"||g?p!=="parseTile"||g?p==="parseTile"&&g?300-y:p==="maybePrepare"&&g?400-y:500:200-y:100-y}(i);if(u===0){vo();try{t()}finally{}return{cancel:()=>{}}}return this.tasks[a]={fn:t,metadata:i,priority:u,id:a},this.taskQueue.push(a),this.invoker.trigger(),{cancel:()=>{delete this.tasks[a]}}}process(){vo();try{if(this.taskQueue=this.taskQueue.filter(a=>!!this.tasks[a]),!this.taskQueue.length)return;const t=this.pick();if(t===null)return;const i=this.tasks[t];if(delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),!i)return;i.fn()}finally{}}pick(){let t=null,i=1/0;for(let u=0;u>=1)>1;){const b=i+u>>1,A=a+p>>1;1&t?(u=i,p=a,i=g,a=y):(i=u,a=p,u=g,p=y),g=b,y=A}const w=4*r;Ba[w+0]=i,Ba[w+1]=a,Ba[w+2]=u,Ba[w+3]=p}const us=new Uint16Array(2178),Fa=new Uint8Array(1089),Mm=new Uint16Array(1089);function Gb(r){return r===0?-.03125:r===32?.03125:0}var qb=ye([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);const Wb={type:2,extent:vt,loadGeometry:()=>[[new Ve(0,0),new Ve(vt+1,0),new Ve(vt+1,vt+1),new Ve(0,vt+1),new Ve(0,0)]]};class l0{constructor(t,i,a,u,p){this.tileID=t,this.uid=ii(),this.uses=0,this.tileSize=i,this.tileZoom=a,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.isRaster=p,this.expiredRequestCount=0,this.state="loading",u&&u.transform&&(this.projection=u.transform.projection)}registerFadeDuration(t){const i=t+this.timeAdded;ip.getLayer(b)).filter(Boolean);if(w.length!==0){y.layers=w,y.stateDependentLayerIds&&(y.stateDependentLayers=y.stateDependentLayerIds.map(b=>w.filter(A=>A.id===b)[0]));for(const b of w)g[b.id]=y}}return g}(t.buckets,i.style),this.hasSymbolBuckets=!1;for(const u in this.buckets){const p=this.buckets[u];if(p instanceof Oa){if(this.hasSymbolBuckets=!0,!a)break;p.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const u in this.buckets){const p=this.buckets[u];if(p instanceof Oa&&p.hasRTLText){this.hasRTLText=!0,S.isLoading()||S.isLoaded()||x()!=="deferred"||T();break}}this.queryPadding=0;for(const u in this.buckets){const p=this.buckets[u];this.queryPadding=Math.max(this.queryPadding,i.style.getLayer(u).queryRadius(p))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage),t.lineAtlas&&(this.lineAtlas=t.lineAtlas)}else this.collisionBoxArray=new an}unloadVectorData(){if(this.hasData()){for(const t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.lineAtlasTexture&&this.lineAtlasTexture.destroy(),this._tileBoundsBuffer&&(this._tileBoundsBuffer.destroy(),this._tileBoundsIndexBuffer.destroy(),this._tileBoundsSegments.destroy(),this._tileBoundsBuffer=null),this._tileDebugBuffer&&(this._tileDebugBuffer.destroy(),this._tileDebugSegments.destroy(),this._tileDebugBuffer=null),this._tileDebugIndexBuffer&&(this._tileDebugIndexBuffer.destroy(),this._tileDebugIndexBuffer=null),this._globeTileDebugBorderBuffer&&(this._globeTileDebugBorderBuffer.destroy(),this._globeTileDebugBorderBuffer=null),this._tileDebugTextBuffer&&(this._tileDebugTextBuffer.destroy(),this._tileDebugTextSegments.destroy(),this._tileDebugTextIndexBuffer.destroy(),this._tileDebugTextBuffer=null),this._globeTileDebugTextBuffer&&(this._globeTileDebugTextBuffer.destroy(),this._globeTileDebugTextBuffer=null),this.latestFeatureIndex=null,this.state="unloaded"}}getBucket(t){return this.buckets[t.id]}upload(t){for(const a in this.buckets){const u=this.buckets[a];u.uploadPending()&&u.upload(t)}const i=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Wd(t,this.imageAtlas.image,i.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Wd(t,this.glyphAtlasImage,i.ALPHA),this.glyphAtlasImage=null),this.lineAtlas&&!this.lineAtlas.uploaded&&(this.lineAtlasTexture=new Wd(t,this.lineAtlas.image,i.ALPHA),this.lineAtlas.uploaded=!0)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,i,a,u,p,g,y,w){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({tileResult:u,pixelPosMatrix:y,transform:g,params:p,tileTransform:this.tileTransform},t,i,a):{}}querySourceFeatures(t,i){const a=this.latestFeatureIndex;if(!a||!a.rawTileData)return;const u=a.loadVTLayers(),p=i?i.sourceLayer:"",g=u._geojsonTileLayer||u[p];if(!g)return;const y=Jc(i&&i.filter),{z:w,x:b,y:A}=this.tileID.canonical,I={z:w,x:b,y:A};for(let M=0;Ma)u=!1;else if(i)if(this.expirationTime=0;$--){const K=4*$,se=Ba[K+0],Y=Ba[K+1],re=Ba[K+2],ue=Ba[K+3],ce=se+re>>1,Ie=Y+ue>>1,Te=ce+Ie-Y,De=Ie+se-ce,Ze=Y*cs+se,Me=ue*cs+re,Ue=Ie*cs+ce,je=Math.hypot((us[2*Ze+0]+us[2*Me+0])/2-us[2*Ue+0],(us[2*Ze+1]+us[2*Me+1])/2-us[2*Ue+1])>=16;Fa[Ue]=Fa[Ue]||(je?1:0),$<1022&&(Fa[Ue]=Fa[Ue]||Fa[(Y+De>>1)*cs+(se+Te>>1)]||Fa[(ue+De>>1)*cs+(re+Te>>1)])}const I=new Fe,M=new mt;let L=0;function R($,K){const se=K*cs+$;return Mm[se]===0&&(I.emplaceBack(us[2*se+0],us[2*se+1],$*vt/lo,K*vt/lo),Mm[se]=++L),Mm[se]-1}function F($,K,se,Y,re,ue){const ce=$+se>>1,Ie=K+Y>>1;if(Math.abs($-re)+Math.abs(K-ue)>1&&Fa[Ie*cs+ce])F(re,ue,$,K,ce,Ie),F(se,Y,re,ue,ce,Ie);else{const Te=R($,K),De=R(se,Y),Ze=R(re,ue);M.emplaceBack(Te,De,Ze)}}return F(0,0,lo,lo,lo,0),F(lo,lo,0,0,0,lo),{vertices:I,indices:M}}(this.tileID.canonical,i);u=g.vertices,p=g.indices}else{u=new Fe,p=new mt;for(const{x:y,y:w}of a)u.emplaceBack(y,w,0,0);const g=Vy(u.int16,void 0,4);for(let y=0;y0&&(y=gy(new Float64Array(16),i.globeMatrix)),this._makeGlobeTileDebugBorderBuffer(t,u,i,p,y,g),this._makeGlobeTileDebugTextBuffer(t,u,i,p,y,g)}_globePoint(t,i,a,u,p,g,y){let w=Ad(t,i,a);if(g){const b=1<.5?L=-1:M<-.5&&(L=1);let R=(t/vt+a.x)/b+L,F=(i/vt+a.y)/b;R=(R-A)*u._pixelsPerMercatorPixel+A,F=(F-I)*u._pixelsPerMercatorPixel+I;const $=[R*u.worldSize,F*u.worldSize,0];Nn($,$,g),w=Yl(w,$,y)}return Nn(w,w,p)}_makeGlobeTileDebugBorderBuffer(t,i,a,u,p,g){const y=new We,w=new vi,b=new Ee,A=(M,L,R,F,$)=>{const K=(R-M)/($-1),se=(F-L)/($-1),Y=y.length;for(let re=0;re<$;re++){const ue=M+re*K,ce=L+re*se;y.emplaceBack(ue,ce);const Ie=this._globePoint(ue,ce,i,a,u,p,g);b.emplaceBack(Ie[0],Ie[1],Ie[2]),w.emplaceBack(Y+re)}},I=vt;A(0,0,I,0,16),A(I,0,I,I,16),A(I,I,0,I,16),A(0,I,0,0,16),this._tileDebugIndexBuffer=t.createIndexBuffer(w),this._tileDebugBuffer=t.createVertexBuffer(y,Td.members),this._globeTileDebugBorderBuffer=t.createVertexBuffer(b,uw.members),this._tileDebugSegments=qn.simpleSegment(0,0,y.length,w.length)}_makeGlobeTileDebugTextBuffer(t,i,a,u,p,g){const y=vt/4,w=new We,b=new mt,A=new Ee,I=25;b.reserve(32),w.reserve(I),A.reserve(I);const M=(L,R)=>I*L+R;for(let L=0;Lt[g])return null}else{const y=1/a[g];let w=(r[g]-i[g])*y,b=(t[g]-i[g])*y;if(w>b){const A=w;w=b,b=A}if(w>u&&(u=w),bp)return null}return u}function Xb(r,t,i,a,u,p,g,y,w,b,A){const I=a-r,M=u-t,L=p-i,R=g-r,F=y-t,$=w-i,K=A[1]*$-A[2]*F,se=A[2]*R-A[0]*$,Y=A[0]*F-A[1]*R,re=I*K+M*se+L*Y;if(Math.abs(re)<1e-15)return null;const ue=1/re,ce=b[0]-r,Ie=b[1]-t,Te=b[2]-i,De=(ce*K+Ie*se+Te*Y)*ue;if(De<0||De>1)return null;const Ze=Ie*L-Te*M,Me=Te*I-ce*L,Ue=ce*M-Ie*I,je=(A[0]*Ze+A[1]*Me+A[2]*Ue)*ue;return je<0||De+je>1?null:(R*Ze+F*Me+$*Ue)*ue}function Kb(r,t,i){return(r-t)/(i-t)}function Yb(r,t,i,a,u,p,g,y,w){const b=1<{const se=$?1:0,Y=(L+1)*F-se,re=R*F,ue=(R+1)*F-se;K[0]=L*F,K[1]=re,K[2]=Y,K[3]=ue};let I=new Zb(w);const M=[];for(let L=0;L=1;w/=2){const L=y[y.length-1];I=new Zb(w);for(let R=0;R0;){const{idx:R,t:F,nodex:$,nodey:K,depth:se}=L.pop();if(this.leaves[R]){Yb($,K,se,t,i,a,u,I,M);const re=1<=Le[2])return F}continue}let Y=0;for(let re=0;re=b[A[Te]]&&(A.splice(Te,0,re),Ie=!0);Ie||(A[Y]=re),Y++}}for(let re=0;re=this.dim+1||i<-1||i>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(i+1)*this.stride+(t+1)}static pack(t,i){const a=[0,0,0,0],u=Pm.getUnpackVector(i);let p=Math.floor((t+u[3])/u[2]);return a[2]=p%256,p=Math.floor(p/256),a[1]=p%256,p=Math.floor(p/256),a[0]=p,a}getPixels(){return new wi({width:this.stride,height:this.stride},this.pixels)}backfillBorder(t,i,a){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");let u=i*this.dim,p=i*this.dim+this.dim,g=a*this.dim,y=a*this.dim+this.dim;switch(i){case-1:u=p-1;break;case 1:p=u+1}switch(a){case-1:g=y-1;break;case 1:y=g+1}const w=-i*this.dim,b=-a*this.dim;for(let A=g;A{this.remove(t,p)},a)),this.data[u].push(p),this.order.push(u),this.order.length>this.max){const g=this._getAndRemoveByKey(this.order[0]);g&&this.onRemove(g)}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 i=this.data[t].shift();return i.timeout&&clearTimeout(i.timeout),this.data[t].length===0&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),i.value}getByKey(t){const i=this.data[t];return i?i[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,i){if(!this.has(t))return this;const a=t.wrapped().key,u=i===void 0?0:this.data[a].indexOf(i),p=this.data[a][u];return this.data[a].splice(u,1),p.timeout&&clearTimeout(p.timeout),this.data[a].length===0&&delete this.data[a],this.onRemove(p.value),this.order.splice(this.order.indexOf(a),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){const i=this._getAndRemoveByKey(this.order[0]);i&&this.onRemove(i)}return this}filter(t){const i=[];for(const a in this.data)for(const u of this.data[a])t(u.value)||i.push(u);for(const a of i)this.remove(a.value.tileID,a)}}class Eu{constructor(t,i,a){this.func=t,this.mask=i,this.range=a}}Eu.ReadOnly=!1,Eu.ReadWrite=!0,Eu.disabled=new Eu(519,Eu.ReadOnly,[0,1]);const c0=7680;class u0{constructor(t,i,a,u,p,g){this.test=t,this.ref=i,this.mask=a,this.fail=u,this.depthFail=p,this.pass=g}}u0.disabled=new u0({func:519,mask:0},0,0,c0,c0,c0);class hs{constructor(t,i,a){this.blendFunction=t,this.blendColor=i,this.mask=a}}hs.Replace=[1,0],hs.disabled=new hs(hs.Replace,Fn.transparent,[!1,!1,!1,!1]),hs.unblended=new hs(hs.Replace,Fn.transparent,[!0,!0,!0,!0]),hs.alphaBlended=new hs([1,771],Fn.transparent,[!0,!0,!0,!0]);const h0=1029,d0=2305;class Fo{constructor(t,i,a){this.enable=t,this.mode=i,this.frontFace=a}}Fo.disabled=new Fo(!1,h0,d0),Fo.backCCW=new Fo(!0,h0,d0),Fo.backCW=new Fo(!0,h0,2304),Fo.frontCW=new Fo(!0,1028,2304),Fo.frontCCW=new Fo(!0,1028,d0);class nc extends vl{constructor(t,i,a){super(),this.id=t,this._onlySymbols=a,i.on("data",u=>{u.dataType==="source"&&u.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&u.dataType==="source"&&u.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform))}),i.on("error",()=>{this._sourceErrored=!0}),this._source=i,this._tiles={},this._cache=new kP(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._minTileCacheSize=i.minTileCacheSize,this._maxTileCacheSize=i.maxTileCacheSize,this._loadedParentTiles={},this._coveredTiles={},this._state=new AP,this._isRaster=this._source.type==="raster"||this._source.type==="raster-dem"||this._source.type==="custom"&&this._source._dataType==="raster"}onAdd(t){this.map=t,this._minTileCacheSize=this._minTileCacheSize===void 0&&t?t._minTileCacheSize:this._minTileCacheSize,this._maxTileCacheSize=this._maxTileCacheSize===void 0&&t?t._maxTileCacheSize:this._maxTileCacheSize}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(const t in this._tiles){const i=this._tiles[t];if(i.state!=="loaded"&&i.state!=="errored")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)}_loadTile(t,i){return t.isSymbolTile=this._onlySymbols,this._source.loadTile(t,i)}_unloadTile(t){if(this._source.unloadTile)return this._source.unloadTile(t,()=>{})}_abortTile(t){if(this._source.abortTile)return this._source.abortTile(t,()=>{})}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 i in this._tiles){const a=this._tiles[i];a.upload(t),a.prepare(this.map.style.imageManager)}}getIds(){return dn(this._tiles).map(t=>t.tileID).sort(t2).map(t=>t.key)}getRenderableIds(t){const i=[];for(const a in this._tiles)this._isIdRenderable(+a,t)&&i.push(this._tiles[a]);return t?i.sort((a,u)=>{const p=a.tileID,g=u.tileID,y=new Ve(p.canonical.x,p.canonical.y)._rotate(this.transform.angle),w=new Ve(g.canonical.x,g.canonical.y)._rotate(this.transform.angle);return p.overscaledZ-g.overscaledZ||w.y-y.y||w.x-y.x}).map(a=>a.tileID.key):i.map(a=>a.tileID).sort(t2).map(a=>a.key)}hasRenderableParent(t){const i=this.findLoadedParent(t,0);return!!i&&this._isIdRenderable(i.tileID.key)}_isIdRenderable(t,i){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(i||!this._tiles[t].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const t in this._tiles)this._tiles[t].state!=="errored"&&this._reloadTile(+t,"reloading")}}_reloadTile(t,i){const a=this._tiles[t];a&&(a.state!=="loading"&&(a.state=i),this._loadTile(a,this._tileLoaded.bind(this,a,t,i)))}_tileLoaded(t,i,a,u){if(u)if(t.state="errored",u.status!==404)this._source.fire(new wo(u,{tile:t}));else if(this._source.type==="raster-dem"&&this.usedForTerrain&&this.map.painter.terrain){const p=this.map.painter.terrain;this.update(this.transform,p.getScaledDemTileSize(),!0),p.resetTileLookupCache(this.id)}else this.update(this.transform);else t.timeAdded=xo.now(),a==="expired"&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(i,t),this._source.type==="raster-dem"&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),this._source.fire(new Is("data",{dataType:"source",tile:t,coord:t.tileID,sourceCacheId:this.id}))}_backfillDEM(t){const i=this.getRenderableIds();for(let u=0;u1||(Math.abs(g)>1&&(Math.abs(g+w)===1?g+=w:Math.abs(g-w)===1&&(g-=w)),p.dem&&u.dem&&(u.dem.backfillBorder(p.dem,g,y),u.neighboringTiles&&u.neighboringTiles[b]&&(u.neighboringTiles[b].backfilled=!0)))}}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._tiles[t]}_retainLoadedChildren(t,i,a,u){for(const p in this._tiles){let g=this._tiles[p];if(u[p]||!g.hasData()||g.tileID.overscaledZ<=i||g.tileID.overscaledZ>a)continue;let y=g.tileID;for(;g&&g.tileID.overscaledZ>i+1;){const b=g.tileID.scaledTo(g.tileID.overscaledZ-1);g=this._tiles[b.key],g&&g.hasData()&&(y=b)}let w=y;for(;w.overscaledZ>i;)if(w=w.scaledTo(w.overscaledZ-1),t[w.key]){u[y.key]=y;break}}}findLoadedParent(t,i){if(t.key in this._loadedParentTiles){const a=this._loadedParentTiles[t.key];return a&&a.tileID.overscaledZ>=i?a:null}for(let a=t.overscaledZ-1;a>=i;a--){const u=t.scaledTo(a),p=this._getLoadedTile(u);if(p)return p}}_getLoadedTile(t){const i=this._tiles[t.key];return i&&i.hasData()?i:this._cache.getByKey(this._source.reparseOverscaled?t.wrapped().key:t.canonical.key)}updateCacheSize(t,i){i=i||this._source.tileSize;const a=Math.ceil(t.width/i)+1,u=Math.ceil(t.height/i)+1,p=Math.floor(a*u*5),g=typeof this._minTileCacheSize=="number"?Math.max(this._minTileCacheSize,p):p,y=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,g):g;this._cache.setMaxSize(y)}handleWrapJump(t){const i=Math.round((t-(this._prevLng===void 0?t:this._prevLng))/360);if(this._prevLng=t,i){const a={};for(const u in this._tiles){const p=this._tiles[u];p.tileID=p.tileID.unwrapTo(p.tileID.wrap+i),a[p.tileID.key]=p}this._tiles=a;for(const u in this._timers)clearTimeout(this._timers[u]),delete this._timers[u];for(const u in this._tiles)this._setTileReloadTimer(+u,this._tiles[u])}}update(t,i,a){if(this.transform=t,!this._sourceLoaded||this._paused||this.transform.freezeTileCoverage||this.usedForTerrain&&!a)return;let u;this.updateCacheSize(t,i),this.transform.projection.name!=="globe"&&this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?u=t.getVisibleUnwrappedCoordinates(this._source.tileID).map(y=>new Xr(y.canonical.z,y.wrap,y.canonical.z,y.canonical.x,y.canonical.y)):(u=t.coveringTiles({tileSize:i||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!a,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain}),this._source.hasTile&&(u=u.filter(y=>this._source.hasTile(y)))):u=[];const p=this._updateRetainedTiles(u);if(n2(this._source.type)&&u.length!==0){const y={},w={},b=Object.keys(p);for(const I of b){const M=p[I],L=this._tiles[I];if(!L||L.fadeEndTime&&L.fadeEndTime<=xo.now())continue;const R=this.findLoadedParent(M,Math.max(M.overscaledZ-nc.maxOverzooming,this._source.minzoom));R&&(this._addTile(R.tileID),y[R.tileID.key]=R.tileID),w[I]=M}const A=u[u.length-1].overscaledZ;for(const I in this._tiles){const M=this._tiles[I];if(p[I]||!M.hasData())continue;let L=M.tileID;for(;L.overscaledZ>A;){L=L.scaledTo(L.overscaledZ-1);const R=this._tiles[L.key];if(R&&R.hasData()&&w[L.key]){p[I]=M.tileID;break}}}for(const I in y)p[I]||(this._coveredTiles[I]=!0,p[I]=y[I])}for(const y in p)this._tiles[y].clearFadeHold();const g=function(y,w){const b=[];for(const A in y)A in w||b.push(A);return b}(this._tiles,p);for(const y of g){const w=this._tiles[y];w.hasSymbolBuckets&&!w.holdingForFade()?w.setHoldDuration(this.map._fadeDuration):w.hasSymbolBuckets&&!w.symbolFadeFinished()||this._removeTile(+y)}this._updateLoadedParentTileCache(),this._onlySymbols&&this._source.afterUpdate&&this._source.afterUpdate()}releaseSymbolFadeTiles(){for(const t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(+t)}_updateRetainedTiles(t){const i={};if(t.length===0)return i;const a={},u=t.reduce((b,A)=>Math.min(b,A.overscaledZ),1/0),p=t[0].overscaledZ,g=Math.max(p-nc.maxOverzooming,this._source.minzoom),y=Math.max(p+nc.maxUnderzooming,this._source.minzoom),w={};for(const b of t){const A=this._addTile(b);i[b.key]=b,A.hasData()||u=this._source.maxzoom){const M=b.children(this._source.maxzoom)[0],L=this.getTile(M);if(L&&L.hasData()){i[M.key]=M;continue}}else{const M=b.children(this._source.maxzoom);if(i[M[0].key]&&i[M[1].key]&&i[M[2].key]&&i[M[3].key])continue}let I=A.wasRequested();for(let M=b.overscaledZ-1;M>=g;--M){const L=b.scaledTo(M);if(a[L.key]||(a[L.key]=!0,A=this.getTile(L),!A&&I&&(A=this._addTile(L)),A&&(i[L.key]=L,I=A.wasRequested(),A.hasData())))break}}return i}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const t in this._tiles){const i=[];let a,u=this._tiles[t].tileID;for(;u.overscaledZ>0;){if(u.key in this._loadedParentTiles){a=this._loadedParentTiles[u.key];break}i.push(u.key);const p=u.scaledTo(u.overscaledZ-1);if(a=this._getLoadedTile(p),a)break;u=p}for(const p of i)this._loadedParentTiles[p]=a}}_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 a=!!i;if(!a){const u=this.map?this.map.painter:null;i=new l0(t,this._source.tileSize*t.overscaleFactor(),this.transform.tileZoom,u,this._isRaster),this._loadTile(i,this._tileLoaded.bind(this,i,t.key,i.state))}return i?(i.uses++,this._tiles[t.key]=i,a||this._source.fire(new Is("dataloading",{tile:i,coord:i.tileID,dataType:"source"})),i):null}_setTileReloadTimer(t,i){t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);const a=i.getExpiryTimeout();a&&(this._timers[t]=setTimeout(()=>{this._reloadTile(t,"expired"),delete this._timers[t]},a))}_removeTile(t){const i=this._tiles[t];i&&(i.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),i.uses>0||(i.hasData()&&i.state!=="reloading"?this._cache.add(i.tileID,i,i.getExpiryTimeout()):(i.aborted=!0,this._abortTile(i),this._unloadTile(i))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const t in this._tiles)this._removeTile(+t);this._source._clear&&this._source._clear(),this._cache.reset(),this.map&&this.usedForTerrain&&this.map.painter.terrain&&this.map.painter.terrain.resetTileLookupCache(this.id)}tilesIn(t,i,a){const u=[],p=this.transform;if(!p)return u;const g=p.projection.name==="globe",y=as(p.center.lng);for(const w in this._tiles){const b=this._tiles[w];if(a&&b.clearQueryDebugViz(),b.holdingForFade())continue;let A;if(g){const I=b.tileID.canonical;if(I.z===0){const M=[Math.abs(Je(y,...Zd(I,-1))-y),Math.abs(Je(y,...Zd(I,1))-y)];A=[0,2*M.indexOf(Math.min(...M))-1]}else{const M=[Math.abs(Je(y,...Zd(I,-1))-y),Math.abs(Je(y,...Zd(I,0))-y),Math.abs(Je(y,...Zd(I,1))-y)];A=[M.indexOf(Math.min(...M))-1]}}else A=[0];for(const I of A){const M=t.containsTile(b,p,i,I);M&&u.push(M)}}return u}getVisibleCoordinates(t){const i=this.getRenderableIds(t).map(a=>this._tiles[a].tileID);for(const a of i)a.projMatrix=this.transform.calculateProjMatrix(a.toUnwrapped());return i}hasTransition(){if(this._source.hasTransition())return!0;if(n2(this._source.type))for(const t in this._tiles){const i=this._tiles[t];if(i.fadeEndTime!==void 0&&i.fadeEndTime>=xo.now())return!0}return!1}setFeatureState(t,i,a){this._state.updateState(t=t||"_geojsonTileLayer",i,a)}removeFeatureState(t,i,a){this._state.removeFeatureState(t=t||"_geojsonTileLayer",i,a)}getFeatureState(t,i){return this._state.getState(t=t||"_geojsonTileLayer",i)}setDependencies(t,i,a){const u=this._tiles[t];u&&u.setDependencies(i,a)}reloadTilesForDependencies(t,i){for(const a in this._tiles)this._tiles[a].hasDependency(t,i)&&this._reloadTile(+a,"reloading");this._cache.filter(a=>!a.hasDependency(t,i))}_preloadTiles(t,i){if(!this._sourceLoaded){const y=()=>{this._sourceLoaded&&(this._source.off("data",y),this._preloadTiles(t,i))};return void this._source.on("data",y)}const a=new Map,u=Array.isArray(t)?t:[t],p=this.map.painter.terrain,g=this.usedForTerrain&&p?p.getScaledDemTileSize():this._source.tileSize;for(const y of u){const w=y.coveringTiles({tileSize:g,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!this.usedForTerrain,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain});for(const b of w)a.set(b.key,b);this.usedForTerrain&&y.updateElevation(!1)}Bt(Array.from(a.values()),(y,w)=>{const b=new l0(y,this._source.tileSize*y.overscaleFactor(),this.transform.tileZoom,this.map.painter,this._isRaster);this._loadTile(b,A=>{this._source.type==="raster-dem"&&b.dem&&this._backfillDEM(b),w(A,b)})},i)}}function t2(r,t){const i=Math.abs(2*r.wrap)-+(r.wrap<0),a=Math.abs(2*t.wrap)-+(t.wrap<0);return r.overscaledZ-t.overscaledZ||a-i||t.canonical.y-r.canonical.y||t.canonical.x-r.canonical.x}function n2(r){return r==="raster"||r==="image"||r==="video"||r==="custom"}function Zd(r,t){const i=1<=0&&I[3]>=0&&w.insert(y,I[0],I[1],I[2],I[3])}}loadVTLayers(){if(!this.vtLayers){this.vtLayers=new Wy(new ym(this.rawTileData)).layers,this.sourceLayerCoder=new Vb(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]),this.vtFeatures={};for(const t in this.vtLayers)this.vtFeatures[t]=[]}return this.vtLayers}query(t,i,a,u){this.loadVTLayers();const p=t.params||{},g=Jc(p.filter),y=t.tileResult,w=t.transform,b=y.bufferedTilespaceBounds,A=this.grid.query(b.min.x,b.min.y,b.max.x,b.max.y,(R,F,$,K)=>Iw(y.bufferedTilespaceGeometry,R,F,$,K));A.sort(MP);let I=null;w.elevation&&A.length>0&&(I=zm.create(w.elevation,this.tileID));const M={};let L;for(let R=0;R(K||(K=Vs(se,this.tileID.canonical,t.tileTransform)),Y.queryIntersectsFeature(y,se,re,K,this.z,t.transform,t.pixelPosMatrix,I,ue)))}return M}loadMatchingFeature(t,i,a,u,p,g,y,w,b){const{featureIndex:A,bucketIndex:I,sourceLayerIndex:M,layoutVertexArrayOffset:L}=i,R=this.bucketLayerIDs[I];if(u&&!function(se,Y){for(let re=0;re=0)return!0;return!1}(u,R))return;const F=this.sourceLayerCoder.decode(M),$=this.vtLayers[F].feature(A);if(a.needGeometry){const se=Jl($,!0);if(!a.filter(new C(this.tileID.overscaledZ),se,this.tileID.canonical))return}else if(!a.filter(new C(this.tileID.overscaledZ),$))return;const K=this.getId($,F);for(let se=0;se{const y=t instanceof X?t.get(g):null;return y&&y.evaluate?y.evaluate(i,a,u):y})}function MP(r,t){return t-r}dt(r2,"FeatureIndex",{omit:["rawTileData","sourceLayerCoder"]});class o2{constructor(t,i){this.width=t,this.height=i,this.nextRow=0,this.image=new $s({width:t,height:i}),this.positions={},this.uploaded=!1}getDash(t,i){const a=this.getKey(t,i);return this.positions[a]}trim(){const t=this.width,i=this.height=br(this.nextRow);this.image.resize({width:t,height:i})}getKey(t,i){return t.join(",")+i}getDashRanges(t,i,a){const u=[];let p=t.length%2==1?-t[t.length-1]*a:0,g=t[0]*a,y=!0;u.push({left:p,right:g,isDash:y,zeroLength:t[0]===0});let w=t[0];for(let b=1;b1&&(w=t[++y]);const A=Math.abs(b-w.left),I=Math.abs(b-w.right),M=Math.min(A,I);let L;const R=p/a*(u+1);if(w.isDash){const F=u-Math.abs(R);L=Math.sqrt(M*M+F*F)}else L=u-Math.sqrt(M*M+R*R);this.image.data[g+b]=Math.max(0,Math.min(255,L+128))}}}addRegularDash(t,i){for(let w=t.length-1;w>=0;--w){const b=t[w],A=t[w+1];b.zeroLength?t.splice(w,1):A&&A.isDash===b.isDash&&(A.left=b.left,t.splice(w,1))}const a=t[0],u=t[t.length-1];a.isDash===u.isDash&&(a.left=u.left-this.width,u.right=a.right+this.width);const p=this.width*this.nextRow;let g=0,y=t[g];for(let w=0;w1&&(y=t[++g]);const b=Math.abs(w-y.left),A=Math.abs(w-y.right),I=Math.min(b,A);this.image.data[p+w]=Math.max(0,Math.min(255,(y.isDash?I:-I)+i+128))}}addDash(t,i){const a=this.getKey(t,i);if(this.positions[a])return this.positions[a];const u=i==="round",p=u?7:0,g=2*p+1;if(this.nextRow+g>this.height)return wn("LineAtlas out of space"),null;t.length===0&&t.push(1);let y=0;for(let A=0;A=Ue.maxzoom||Ue.visibility!=="none"&&(p0(Me,this.zoom,a),(w[Ue.id]=Ue.createBucket({index:y.bucketLayerIDs.length,layers:Me,zoom:this.zoom,canonical:this.canonical,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:De,sourceID:this.source,enableTerrain:this.enableTerrain,projection:this.projection.spec,availableImages:a})).populate(Ze,A,this.tileID.canonical,this.tileTransform),y.bucketLayerIDs.push(Me.map(je=>je.id)))}}let M,L,R,F;b.trim();const $={type:"maybePrepare",isSymbolTile:this.isSymbolTile,zoom:this.zoom},K=()=>{if(M)return p(M);if(L&&R&&F){const ue=new a2(L),ce=new fb(R,F);for(const Ie in w){const Te=w[Ie];Te instanceof Oa?(p0(Te.layers,this.zoom,a),rP(Te,L,ue.positions,R,ce.iconPositions,this.showCollisionBoxes,a,this.tileID.canonical,this.tileZoom,this.projection)):Te.hasPattern&&(Te instanceof mm||Te instanceof um||Te instanceof Dd)&&(p0(Te.layers,this.zoom,a),Te.addFeatures(A,this.tileID.canonical,ce.patternPositions,a,this.tileTransform))}this.status="done",p(null,{buckets:dn(w).filter(Ie=>!Ie.isEmpty()),featureIndex:y,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:ue.image,lineAtlas:b,imageAtlas:ce,glyphMap:this.returnDependencies?L:null,iconMap:this.returnDependencies?R:null,glyphPositions:this.returnDependencies?ue.positions:null})}},se=kt(A.glyphDependencies,ue=>Object.keys(ue).map(Number));Object.keys(se).length?u.send("getGlyphs",{uid:this.uid,stacks:se},(ue,ce)=>{M||(M=ue,L=ce,K())},void 0,!1,$):L={};const Y=Object.keys(A.iconDependencies);Y.length?u.send("getImages",{icons:Y,source:this.source,tileID:this.tileID,type:"icons"},(ue,ce)=>{M||(M=ue,R=ce,K())},void 0,!1,$):R={};const re=Object.keys(A.patternDependencies);re.length?u.send("getImages",{icons:re,source:this.source,tileID:this.tileID,type:"patterns"},(ue,ce)=>{M||(M=ue,F=ce,K())},void 0,!1,$):F={},K()}}function p0(r,t,i){const a=new C(t);for(const u of r)u.recalculate(a,i)}class l2{constructor(t){this.entries={},this.scheduler=t}request(t,i,a,u){const p=this.entries[t]=this.entries[t]||{callbacks:[]};if(p.result){const[g,y]=p.result;return this.scheduler?this.scheduler.add(()=>{u(g,y)},i):u(g,y),()=>{}}return p.callbacks.push(u),p.cancel||(p.cancel=a((g,y)=>{p.result=[g,y];for(const w of p.callbacks)this.scheduler?this.scheduler.add(()=>{w(g,y)},i):w(g,y);setTimeout(()=>delete this.entries[t],3e3)})),()=>{p.result||(p.callbacks=p.callbacks.filter(g=>g!==u),p.callbacks.length||(p.cancel(),delete this.entries[t]))}}}function c2(r,t,i){const a=JSON.stringify(r.request);return r.data&&(this.deduped.entries[a]={result:[null,r.data]}),this.deduped.request(a,{type:"parseTile",isSymbolTile:r.isSymbolTile,zoom:r.tileZoom},u=>{const p=ua(r.request,(g,y,w,b)=>{g?u(g):y&&u(null,{vectorTile:i?void 0:new Wy(new ym(y)),rawData:y,cacheControl:w,expires:b})});return()=>{p.cancel(),u()}},t)}const u2=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class f0{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[i,a]=new Uint8Array(t,0,2);if(i!==219)throw new Error("Data does not appear to be in a KDBush format.");const u=a>>4;if(u!==1)throw new Error(`Got v${u} data when expected v1.`);const p=u2[15&a];if(!p)throw new Error("Unrecognized array type.");const[g]=new Uint16Array(t,2,1),[y]=new Uint32Array(t,4,1);return new f0(y,g,p,t)}constructor(t,i=64,a=Float64Array,u){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+i,2),65535),this.ArrayType=a,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const p=u2.indexOf(this.ArrayType),g=2*t*this.ArrayType.BYTES_PER_ELEMENT,y=t*this.IndexArrayType.BYTES_PER_ELEMENT,w=(8-y%8)%8;if(p<0)throw new Error(`Unexpected typed array class: ${a}.`);u&&u instanceof ArrayBuffer?(this.data=u,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+y+w,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+g+y+w),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+y+w,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+p]),new Uint16Array(this.data,2,1)[0]=i,new Uint32Array(this.data,4,1)[0]=t)}add(t,i){const a=this._pos>>1;return this.ids[a]=a,this.coords[this._pos++]=t,this.coords[this._pos++]=i,a}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return m0(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,i,a,u){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:p,coords:g,nodeSize:y}=this,w=[0,p.length-1,0],b=[];for(;w.length;){const A=w.pop()||0,I=w.pop()||0,M=w.pop()||0;if(I-M<=y){for(let $=M;$<=I;$++){const K=g[2*$],se=g[2*$+1];K>=t&&K<=a&&se>=i&&se<=u&&b.push(p[$])}continue}const L=M+I>>1,R=g[2*L],F=g[2*L+1];R>=t&&R<=a&&F>=i&&F<=u&&b.push(p[L]),(A===0?t<=R:i<=F)&&(w.push(M),w.push(L-1),w.push(1-A)),(A===0?a>=R:u>=F)&&(w.push(L+1),w.push(I),w.push(1-A))}return b}within(t,i,a){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:u,coords:p,nodeSize:g}=this,y=[0,u.length-1,0],w=[],b=a*a;for(;y.length;){const A=y.pop()||0,I=y.pop()||0,M=y.pop()||0;if(I-M<=g){for(let $=M;$<=I;$++)d2(p[2*$],p[2*$+1],t,i)<=b&&w.push(u[$]);continue}const L=M+I>>1,R=p[2*L],F=p[2*L+1];d2(R,F,t,i)<=b&&w.push(u[L]),(A===0?t-a<=R:i-a<=F)&&(y.push(M),y.push(L-1),y.push(1-A)),(A===0?t+a>=R:i+a>=F)&&(y.push(L+1),y.push(I),y.push(1-A))}return w}}function m0(r,t,i,a,u,p){if(u-a<=i)return;const g=a+u>>1;h2(r,t,g,a,u,p),m0(r,t,i,a,g-1,1-p),m0(r,t,i,g+1,u,1-p)}function h2(r,t,i,a,u,p){for(;u>a;){if(u-a>600){const b=u-a+1,A=i-a+1,I=Math.log(b),M=.5*Math.exp(2*I/3),L=.5*Math.sqrt(I*M*(b-M)/b)*(A-b/2<0?-1:1);h2(r,t,i,Math.max(a,Math.floor(i-A*M/b+L)),Math.min(u,Math.floor(i+(b-A)*M/b+L)),p)}const g=t[2*i+p];let y=a,w=u;for(Hd(r,t,a,i),t[2*u+p]>g&&Hd(r,t,a,u);yg;)w--}t[2*a+p]===g?Hd(r,t,a,w):(w++,Hd(r,t,w,u)),w<=i&&(a=w+1),i<=w&&(u=w-1)}}function Hd(r,t,i,a){g0(r,i,a),g0(t,2*i,2*a),g0(t,2*i+1,2*a+1)}function g0(r,t,i){const a=r[t];r[t]=r[i],r[i]=a}function d2(r,t,i,a){const u=r-i,p=t-a;return u*u+p*p}s.ARRAY_TYPE=xi,s.AUTH_ERR_MSG=he,s.Aabb=Hr,s.Actor=class{constructor(r,t,i){this.target=r,this.parent=t,this.mapId=i,this.callbacks={},this.cancelCallbacks={},Yi(["receive"],this),this.target.addEventListener("message",this.receive,!1),this.globalScope=vo()?r:k,this.scheduler=new TP}send(r,t,i,a,u=!1,p){const g=Math.round(1e18*Math.random()).toString(36).substring(0,10);i&&(i.metadata=p,this.callbacks[g]=i);const y=aa(this.globalScope)?void 0:[];return this.target.postMessage({id:g,type:r,hasCallback:!!i,targetMapId:a,mustQueue:u,sourceMapId:this.mapId,data:Ia(t,y)},y),{cancel:()=>{i&&delete this.callbacks[g],this.target.postMessage({id:g,type:"",targetMapId:a,sourceMapId:this.mapId})}}}receive(r){const t=r.data,i=t.id;if(i&&(!t.targetMapId||this.mapId===t.targetMapId))if(t.type===""){const a=this.cancelCallbacks[i];delete this.cancelCallbacks[i],a&&a.cancel()}else if(t.mustQueue||vo()){const a=this.callbacks[i];this.cancelCallbacks[i]=this.scheduler.add(()=>this.processTask(i,t),a&&a.metadata||{type:"message"})}else this.processTask(i,t)}processTask(r,t){if(t.type===""){const i=this.callbacks[r];delete this.callbacks[r],i&&(t.error?i(Os(t.error)):i(null,Os(t.data)))}else{const i=aa(this.globalScope)?void 0:[],a=t.hasCallback?(p,g)=>{delete this.cancelCallbacks[r],this.target.postMessage({id:r,type:"",sourceMapId:this.mapId,error:p?Ia(p):null,data:Ia(g,i)},i)}:p=>{},u=Os(t.data);if(this.parent[t.type])this.parent[t.type](t.sourceMapId,u,a);else if(this.parent.getWorkerSource){const p=t.type.split(".");this.parent.getWorkerSource(t.sourceMapId,p[0],u.source)[p[1]](u,a)}else a(new Error(`Could not find function ${t.type}`))}}remove(){this.scheduler.remove(),this.target.removeEventListener("message",this.receive,!1)}},s.CanonicalTileID=fm,s.Color=Fn,s.ColorMode=hs,s.CullFaceMode=Fo,s.DEMData=Pm,s.DataConstantProperty=B,s.DedupedRequest=l2,s.DepthMode=Eu,s.EXTENT=vt,s.Elevation=class{isDataAvailableAtPoint(r){const t=this._source();if(this.isUsingMockSource()||!t||r.y<0||r.y>1)return!1;const i=t.getSource().maxzoom,a=1<1)return t;const u=a.getSource().maxzoom,p=1<{const p=this.getAtTileOffset(r,u.x,u.y),g=a.upVector(r.canonical,u.x,u.y);return Bi(g,g,p*a.upVectorScale(r.canonical,t,i).metersToTile),g}}getForTilePoints(r,t,i,a){if(this.isUsingMockSource())return!1;const u=zm.create(this,r,a);return!!u&&(t.forEach(p=>{p[2]=this.exaggeration()*u.getElevationAt(p[0],p[1],i)}),!0)}getMinMaxForTile(r){if(this.isUsingMockSource())return null;const t=this.findDEMTileFor(r);if(!t||!t.dem)return null;const i=t.dem.tree,a=t.tileID,u=1<{let M=b===p-1?b-2:b===0?b:b-1;return M+=I?24575:0,[M,A]};for(let b=0;bthis._skuTokenExpiresAt}transformRequest(r,t){return this._transformRequestFn&&this._transformRequestFn(r,t)||{url:r}}normalizeStyleURL(r,t){if(!_e(r))return r;const i=rt(r);return i.path=`/styles/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||t)}normalizeGlyphsURL(r,t){if(!_e(r))return r;const i=rt(r);return i.path=`/fonts/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||t)}normalizeSourceURL(r,t,i,a){if(!_e(r))return r;const u=rt(r);return u.path=`/v4/${u.authority}.json`,u.params.push("secure"),i&&u.params.push(`language=${i}`),a&&u.params.push(`worldview=${a}`),this._makeAPIURL(u,this._customAccessToken||t)}normalizeSpriteURL(r,t,i,a){const u=rt(r);return _e(r)?(u.path=`/styles/v1${u.path}/sprite${t}${i}`,this._makeAPIURL(u,this._customAccessToken||a)):(u.path+=`${t}${i}`,Qe(u))}normalizeTileURL(r,t,i){if(this._isSkuTokenExpired()&&this._createSkuToken(),r&&!_e(r))return r;const a=rt(r);a.path=a.path.replace(/(\.(png|jpg)\d*)(?=$)/,`${t||i&&a.authority!=="raster"&&i===512?"@2x":""}${J.supported?".webp":"$1"}`),a.authority==="raster"?a.path=`/${G.RASTER_URL_PREFIX}${a.path}`:(a.path=a.path.replace(/^.+\/v4\//,"/"),a.path=`/${G.TILE_URL_VERSION}${a.path}`);const u=this._customAccessToken||function(p){for(const g of p){const y=g.match(/^access_token=(.*)$/);if(y)return y[1]}return null}(a.params)||G.ACCESS_TOKEN;return G.REQUIRE_ACCESS_TOKEN&&u&&this._skuToken&&a.params.push(`sku=${this._skuToken}`),this._makeAPIURL(a,u)}canonicalizeTileURL(r,t){const i=rt(r);if(!i.path.match(/^(\/v4\/|\/raster\/v1\/)/)||!i.path.match(/\.[\w]+$/))return r;let a="mapbox://";i.path.match(/^\/raster\/v1\//)?a+=`raster/${i.path.replace(`/${G.RASTER_URL_PREFIX}/`,"")}`:a+=`tiles/${i.path.replace(`/${G.TILE_URL_VERSION}/`,"")}`;let u=i.params;return t&&(u=u.filter(p=>!p.match(/^access_token=/))),u.length&&(a+=`?${u.join("&")}`),a}canonicalizeTileset(r,t){const i=!!t&&_e(t),a=[];for(const u of r.tiles||[])be(u)?a.push(this.canonicalizeTileURL(u,i)):a.push(u);return a}_makeAPIURL(r,t){const i="See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes",a=rt(G.API_URL);if(r.protocol=a.protocol,r.authority=a.authority,r.protocol==="http"){const u=r.params.indexOf("secure");u>=0&&r.params.splice(u,1)}if(a.path!=="/"&&(r.path=`${a.path}${r.path}`),!G.REQUIRE_ACCESS_TOKEN)return Qe(r);if(t=t||G.ACCESS_TOKEN,!this._silenceAuthErrors){if(!t)throw new Error(`An API access token is required to use Mapbox GL. ${i}`);if(t[0]==="s")throw new Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${i}`)}return r.params=r.params.filter(u=>u.indexOf("access_token")===-1),r.params.push(`access_token=${t||""}`),Qe(r)}},s.ResourceType=Ss,s.SegmentVector=qn,s.SourceCache=nc,s.StencilMode=u0,s.StructArrayLayout1ui2=vi,s.StructArrayLayout2f1f2i16=wt,s.StructArrayLayout2i4=We,s.StructArrayLayout2ui4=fr,s.StructArrayLayout3f12=Ot,s.StructArrayLayout3ui6=mt,s.StructArrayLayout4i8=Fe,s.StructArrayLayout5f20=sn,s.Texture=Wd,s.Tile=l0,s.Transitionable=O,s.Uniform1f=Yf,s.Uniform1i=class extends Ns{constructor(r){super(r),this.current=0}set(r,t,i){this.fetchUniformLocation(r,t)&&this.current!==i&&(this.current=i,this.gl.uniform1i(this.location,i))}},s.Uniform2f=class extends Ns{constructor(r){super(r),this.current=[0,0]}set(r,t,i){this.fetchUniformLocation(r,t)&&(i[0]===this.current[0]&&i[1]===this.current[1]||(this.current=i,this.gl.uniform2f(this.location,i[0],i[1])))}},s.Uniform3f=class extends Ns{constructor(r){super(r),this.current=[0,0,0]}set(r,t,i){this.fetchUniformLocation(r,t)&&(i[0]===this.current[0]&&i[1]===this.current[1]&&i[2]===this.current[2]||(this.current=i,this.gl.uniform3f(this.location,i[0],i[1],i[2])))}},s.Uniform4f=Wx,s.UniformColor=Zx,s.UniformMatrix2f=class extends Ns{constructor(r){super(r),this.current=lk}set(r,t,i){if(this.fetchUniformLocation(r,t)){for(let a=0;a<4;a++)if(i[a]!==this.current[a]){this.current=i,this.gl.uniformMatrix2fv(this.location,!1,i);break}}}},s.UniformMatrix3f=class extends Ns{constructor(r){super(r),this.current=ak}set(r,t,i){if(this.fetchUniformLocation(r,t)){for(let a=0;a<9;a++)if(i[a]!==this.current[a]){this.current=i,this.gl.uniformMatrix3fv(this.location,!1,i);break}}}},s.UniformMatrix4f=class extends Ns{constructor(r){super(r),this.current=sk}set(r,t,i){if(this.fetchUniformLocation(r,t)){if(i[12]!==this.current[12]||i[0]!==this.current[0])return this.current=i,void this.gl.uniformMatrix4fv(this.location,!1,i);for(let a=1;a<16;a++)if(i[a]!==this.current[a]){this.current=i,this.gl.uniformMatrix4fv(this.location,!1,i);break}}}},s.UnwrappedTileID=Qw,s.ValidationError=ct,s.VectorTileFeature=dm,s.VectorTileWorkerSource=class extends vl{constructor(r,t,i,a,u){super(),this.actor=r,this.layerIndex=t,this.availableImages=i,this.loadVectorData=u||c2,this.loading={},this.loaded={},this.deduped=new l2(r.scheduler),this.isSpriteLoaded=a,this.scheduler=r.scheduler}loadTile(r,t){const i=r.uid,a=r&&r.request,u=a&&a.collectResourceTiming,p=this.loading[i]=new PP(r);p.abort=this.loadVectorData(r,(g,y)=>{const w=!this.loading[i];if(delete this.loading[i],w||g||!y)return p.status="done",w||(this.loaded[i]=p),t(g);const b=y.rawData,A={};y.expires&&(A.expires=y.expires),y.cacheControl&&(A.cacheControl=y.cacheControl),p.vectorTile=y.vectorTile||new Wy(new ym(b));const I=()=>{p.parse(p.vectorTile,this.layerIndex,this.availableImages,this.actor,(M,L)=>{if(M||!L)return t(M);const R={};if(u){const F=wh(a);F.length>0&&(R.resourceTiming=JSON.parse(JSON.stringify(F)))}t(null,vn({rawTileData:b.slice(0)},L,A,R))})};this.isSpriteLoaded?I():this.once("isSpriteLoaded",()=>{this.scheduler?this.scheduler.add(I,{type:"parseTile",isSymbolTile:r.isSymbolTile,zoom:r.tileZoom}):I()}),this.loaded=this.loaded||{},this.loaded[i]=p})}reloadTile(r,t){const i=this.loaded,a=r.uid,u=this;if(i&&i[a]){const p=i[a];p.showCollisionBoxes=r.showCollisionBoxes,p.enableTerrain=!!r.enableTerrain,p.projection=r.projection,p.tileTransform=tc(r.tileID.canonical,r.projection);const g=(y,w)=>{const b=p.reloadCallback;b&&(delete p.reloadCallback,p.parse(p.vectorTile,u.layerIndex,this.availableImages,u.actor,b)),t(y,w)};p.status==="parsing"?p.reloadCallback=g:p.status==="done"&&(p.vectorTile?p.parse(p.vectorTile,this.layerIndex,this.availableImages,this.actor,g):g())}}abortTile(r,t){const i=r.uid,a=this.loading[i];a&&(a.abort&&a.abort(),delete this.loading[i]),t()}removeTile(r,t){const i=this.loaded,a=r.uid;i&&i[a]&&delete i[a],t()}},s.WritingMode=Ni,s.ZoomDependentExpression=Bl,s.add=js,s.addDynamicAttributes=Im,s.adjoint=function(r,t){var i=t[0],a=t[1],u=t[2],p=t[3],g=t[4],y=t[5],w=t[6],b=t[7],A=t[8];return r[0]=g*A-y*b,r[1]=u*b-a*A,r[2]=a*y-u*g,r[3]=y*w-p*A,r[4]=i*A-u*w,r[5]=u*p-i*y,r[6]=p*b-g*w,r[7]=a*w-i*b,r[8]=i*g-a*p,r},s.asyncAll=Bt,s.bezier=Li,s.bindAll=Yi,s.boundsAttributes=qb,s.bufferConvexPolygon=function(r,t){const i=[];for(let a=0;aAc&&(r.getActor().send("enforceCacheSizeLimit",Sc),_l=0)},s.calculateGlobeLabelMatrix=function(r,t){const{x:i,y:a}=r.point,u=gw(i,a,r.worldSize/r._pixelsPerMercatorPixel,0,0);return Zl(u,u,Cy(ss(t)))},s.calculateGlobeMatrix=function(r){const{x:t,y:i}=r.point,{lng:a,lat:u}=r._center;return gw(t,i,r.worldSize,a,u)},s.calculateGlobeMercatorMatrix=function(r){const t=r.pixelsPerMeter,i=t/Do(1,r.center.lat),a=Lo(new Float64Array(16));return yd(a,a,[r.point.x,r.point.y,0]),Hl(a,a,[i,i,t]),Float32Array.from(a)},s.circumferenceAtLatitude=ky,s.clamp=Je,s.clearTileCache=function(r){if(!gl())return;const t=k.caches.delete(la);r&&t.catch(r).then(()=>r())},s.clipLine=Cb,s.clone=function(r){var t=new xi(16);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],t},s.clone$1=Dr,s.collisionCircleLayout=kM,s.config=G,s.conjugate=function(r,t){return r[0]=-t[0],r[1]=-t[1],r[2]=-t[2],r[3]=t[3],r},s.create=function(){var r=new xi(16);return xi!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=0,r[12]=0,r[13]=0,r[14]=0),r[0]=1,r[5]=1,r[10]=1,r[15]=1,r},s.create$1=Kx,s.createExpression=Sa,s.createLayout=ye,s.createStyleLayer=function(r){return r.type==="custom"?new xP(r):new bP[r.type](r)},s.cross=xy,s.degToRad=St,s.distance=function(r,t){return Math.hypot(t[0]-r[0],t[1]-r[1],t[2]-r[2])},s.div=function(r,t,i){return r[0]=t[0]/i[0],r[1]=t[1]/i[1],r[2]=t[2]/i[2],r},s.dot=oo,s.earthRadius=Id,s.ease=Ki,s.easeCubicInOut=$r,s.ecefToLatLng=function([r,t,i]){const a=Math.hypot(r,t,i),u=Math.atan2(r,i),p=.5*Math.PI-Math.acos(-t/a);return new ln(Vt(u),Vt(p))},s.emitValidationErrors=qf,s.endsWith=xn,s.enforceCacheSizeLimit=function(r){Ts(),fi&&fi.then(t=>{t.keys().then(i=>{for(let a=0;ap&&(a+=(r[u]-p)*(r[u]-p)),t[u]0){const R=180/a;Yx(L,L,[R/b+1,0,0,0,R/A+1,0,-.5*R/I,.5*R/M,1])}return L[2]=w,L[5]=r.x,L[8]=r.y,L},s.getImage=ne,s.getJSON=function(r,t){return Cs(vn(r,{type:"json"}),t)},s.getLatitudinalLod=function(r){const t=zr-5;r=Je(r,-t,t)/t*90;const i=Math.pow(Math.abs(Math.sin(St(r))),3);return Math.round(i*(Sd.length-1))},s.getMapSessionAPI=hr,s.getPerformanceMeasurement=wh,s.getProjection=Ub,s.getRTLTextPluginStatus=x,s.getReferrer=As,s.getTilePoint=function(r,{x:t,y:i},a=0){return new Ve(((t-a)*r.scale-r.x)*vt,(i*r.scale-r.y)*vt)},s.getTileVec3=function(r,t,i=0){return ou(((t.x-i)*r.scale-r.x)*vt,(t.y*r.scale-r.y)*vt,xw(t.z,t.y))},s.getVideo=function(r,t){const i=k.document.createElement("video");i.muted=!0,i.onloadstart=function(){t(null,i)};for(let a=0;a{}}},s.globeCenterToScreenPoint=function(r){const t=[0,0,0],i=Lo(new Float64Array(16));return Zl(i,r.pixelMatrix,r.globeMatrix),Nn(t,t,i),new Ve(t[0],t[1])},s.globeDenormalizeECEF=Cy,s.globeECEFOrigin=function(r,t){const i=[0,0,0];return Nn(i,i,Cd(ss(t.canonical))),Nn(i,i,r),i},s.globeMetersToEcef=em,s.globeNormalizeECEF=Cd,s.globePixelsToTileUnits=function(r,t){return vt/(512*Math.pow(2,r))*nm(ss(t))},s.globePoleMatrixForTile=function(r,t,i){const a=Lo(new Float64Array(16)),u=(t/(1<0;return a===0&&!u&&!g&&p},s.identity=Lo,s.identity$1=sw,s.invert=gy,s.isFullscreen=function(){return!!k.document.fullscreenElement||!!k.document.webkitFullscreenElement},s.isLngLatBehindGlobe=Iy,s.isMapAuthenticated=function(r){return Or.has(r)},s.isMapboxURL=_e,s.isSafariWithAntialiasingBug=function(r){const t=r.navigator?r.navigator.userAgent:null;return!!aa(r)&&t&&(t.match("Version/15.4")||t.match("Version/15.5")||t.match(/CPU (OS|iPhone OS) (15_4|15_5) like Mac OS X/))},s.latFromMercatorY=Pr,s.latLngToECEF=au,s.len=_k,s.length=vd,s.length$1=function(r){return Math.hypot(r[0],r[1],r[2],r[3])},s.lngFromMercatorX=Fi,s.loadVectorTile=c2,s.makeRequest=Cs,s.mapValue=function(r,t,i,a,u){return Je((r-t)/(i-t)*(u-a)+a,a,u)},s.mercatorScale=ww,s.mercatorXfromLng=as,s.mercatorYfromLat=ls,s.mercatorZfromAltitude=Do,s.mul=mk,s.mul$1=gk,s.multiply=Zl,s.multiply$1=Yx,s.multiply$2=tw,s.nextPowerOfTwo=br,s.normalize=Zr,s.normalize$1=yk,s.normalize$2=iw,s.number=Wt,s.ortho=function(r,t,i,a,u,p,g){var y=1/(t-i),w=1/(a-u),b=1/(p-g);return r[0]=-2*y,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*w,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=2*b,r[11]=0,r[12]=(t+i)*y,r[13]=(u+a)*w,r[14]=(g+p)*b,r[15]=1,r},s.pbf=sb,s.perspective=function(r,t,i,a,u){var p,g=1/Math.tan(t/2);return r[0]=g/i,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=g,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=-1,r[12]=0,r[13]=0,r[15]=0,u!=null&&u!==1/0?(r[10]=(u+a)*(p=1/(a-u)),r[14]=2*u*a*p):(r[10]=-1,r[14]=-2*a),r},s.pick=function(r,t){const i={};for(let a=0;a0&&i[0]<=r.width&&i[1]>0&&i[1]<=r.height&&!Iy(r,new ln(r.center.lat,90)),a[0]>0&&a[0]<=r.width&&a[1]>0&&a[1]<=r.height&&!Iy(r,new ln(r.center.lat,-90))]},s.polygonContainsPoint=Ql,s.polygonIntersectsBox=Iw,s.polygonIntersectsPolygon=Tw,s.polygonizeBounds=function(r,t,i=0,a=!0){const u=new Ve(i,i),p=r.sub(u),g=t.add(u),y=[p,new Ve(g.x,p.y),g,new Ve(p.x,g.y)];return a&&y.push(p.clone()),y},s.posAttributes=Td,s.postMapLoadEvent=Vn,s.postPerformanceEvent=tr,s.postTurnstileEvent=Gt,s.potpack=Ky,s.prevPowerOfTwo=function(r){return r<=1?1:Math.pow(2,Math.floor(Math.log(r)/Math.LN2))},s.radToDeg=Vt,s.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],s.registerForPluginStateChange=function(r){return r({pluginStatus:d,pluginURL:o}),_.on("pluginStateChange",r),r},s.removeAuthState=function(r){Or.delete(r)},s.renderColorRamp=By,s.resample=bw,s.rotateX=_y,s.rotateX$1=aw,s.rotateY=Qf,s.rotateY$1=lw,s.rotateZ=function(r,t,i){var a=Math.sin(i),u=Math.cos(i),p=t[0],g=t[1],y=t[2],w=t[3],b=t[4],A=t[5],I=t[6],M=t[7];return t!==r&&(r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r[0]=p*u+b*a,r[1]=g*u+A*a,r[2]=y*u+I*a,r[3]=w*u+M*a,r[4]=b*u-p*a,r[5]=A*u-g*a,r[6]=I*u-y*a,r[7]=M*u-w*a,r},s.rotateZ$1=function(r,t,i){i*=.5;var a=t[0],u=t[1],p=t[2],g=t[3],y=Math.sin(i),w=Math.cos(i);return r[0]=a*w+u*y,r[1]=u*w-a*y,r[2]=p*w+g*y,r[3]=g*w-p*y,r},s.scale=Hl,s.scale$1=rw,s.scale$2=Bi,s.scaleAndAdd=bd,s.set=function(r,t,i,a){return r[0]=t,r[1]=i,r[2]=a,r},s.setCacheLimits=function(r,t){Sc=r,Ac=t},s.setColumn=function(r,t,i){r[4*t+0]=i[0],r[4*t+1]=i[1],r[4*t+2]=i[2],r[4*t+3]=i[3]},s.setRTLTextPlugin=function(r,t,i=!1){if(d===pd||d===fd||d===md)throw new Error("setRTLTextPlugin cannot be called multiple times.");o=xo.resolveURL(r),d=pd,ka=t,f(),i||T()},s.smoothstep=Tt,s.spec=Re,s.squaredLength=function(r){var t=r[0],i=r[1],a=r[2];return t*t+i*i+a*a},s.storeAuthState=function(r,t){t?Or.add(r):Or.delete(r)},s.sub=Ro,s.subtract=vy,s.symbolSize=MM,s.tileAABB=function(r,t,i,a,u,p,g,y,w){if(w.name==="globe")return Ek(r,t,new fm(i,a,u));const b=tc({z:i,x:a,y:u},w);return new Hr([(p+b.x/b.scale)*t,t*(b.y/b.scale),g],[(p+b.x2/b.scale)*t,t*(b.y2/b.scale),y])},s.tileCornersToBounds=tm,s.tileTransform=tc,s.transformMat3=function(r,t,i){var a=t[0],u=t[1],p=t[2];return r[0]=a*i[0]+u*i[3]+p*i[6],r[1]=a*i[1]+u*i[4]+p*i[7],r[2]=a*i[2]+u*i[5]+p*i[8],r},s.transformMat4=Nn,s.transformMat4$1=Xl,s.transformQuat=nw,s.transitionTileAABBinECEF=pw,s.translate=yd,s.transpose=function(r,t){if(r===t){var i=t[1],a=t[2],u=t[5];r[1]=t[3],r[2]=t[6],r[3]=i,r[5]=t[7],r[6]=a,r[7]=u}else r[0]=t[0],r[1]=t[3],r[2]=t[6],r[3]=t[1],r[4]=t[4],r[5]=t[7],r[6]=t[2],r[7]=t[5],r[8]=t[8];return r},s.triggerPluginCompletionEvent=c,s.uniqueId=ii,s.updateGlobeVertexNormal=function(r,t,i,a,u){const p=5*t+2;r.float32[p+0]=i,r.float32[p+1]=a,r.float32[p+2]=u},s.validateCustomStyleLayer=function(r){const t=[],i=r.id;return i===void 0&&t.push({message:`layers.${i}: missing required property "id"`}),r.render===void 0&&t.push({message:`layers.${i}: missing required method "render"`}),r.renderingMode&&r.renderingMode!=="2d"&&r.renderingMode!=="3d"&&t.push({message:`layers.${i}: property "renderingMode" must be either "2d" or "3d"`}),t},s.validateFilter=r=>yi(Vl(r)),s.validateFog=r=>yi(Vf(r)),s.validateLayer=r=>yi(Ff(r)),s.validateLight=r=>yi(jf(r)),s.validateSource=r=>yi(Uf(r)),s.validateStyle=Gf,s.validateTerrain=r=>yi(ld(r)),s.values=dn,s.vectorTile=hm,s.version=D,s.warnOnce=wn,s.window=k,s.wrap=xt}),v(["./shared"],function(s){function k(oe){if(typeof oe=="number"||typeof oe=="boolean"||typeof oe=="string"||oe==null)return JSON.stringify(oe);if(Array.isArray(oe)){let U="[";for(const ne of oe)U+=`${k(ne)},`;return`${U}]`}let N="{";for(const U of Object.keys(oe).sort())N+=`${U}:${k(oe[U])},`;return`${N}}`}function D(oe){let N="";for(const U of s.refProperties)N+=`/${k(oe[U])}`;return N}class V{constructor(N){this.keyCache={},N&&this.replace(N)}replace(N){this._layerConfigs={},this._layers={},this.update(N,[])}update(N,U){for(const he of N)this._layerConfigs[he.id]=he,(this._layers[he.id]=s.createStyleLayer(he)).compileFilter(),this.keyCache[he.id]&&delete this.keyCache[he.id];for(const he of U)delete this.keyCache[he],delete this._layerConfigs[he],delete this._layers[he];this.familiesBySource={};const ne=function(he,_e){const be={};for(let ge=0;gethis._layers[rt.id]),be=_e[0];if(be.visibility==="none")continue;const we=be.source||"";let ge=this.familiesBySource[we];ge||(ge=this.familiesBySource[we]={});const Pe=be.sourceLayer||"_geojsonTileLayer";let nt=ge[Pe];nt||(nt=ge[Pe]=[]),nt.push(_e)}}}class G{loadTile(N,U){const{uid:ne,encoding:he,rawImageData:_e,padding:be,buildQuadTree:we}=N,ge=s.window.ImageBitmap&&_e instanceof s.window.ImageBitmap?this.getImageData(_e,be):_e;U(null,new s.DEMData(ne,ge,he,be<1,we))}getImageData(N,U){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(N.width,N.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=N.width,this.offscreenCanvas.height=N.height,this.offscreenCanvasContext.drawImage(N,0,0,N.width,N.height);const ne=this.offscreenCanvasContext.getImageData(-U,-U,N.width+2*U,N.height+2*U);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),ne}}function J(oe,N){if(oe.length!==0){ve(oe[0],N);for(var U=1;U=Math.abs(we)?U-ge+we:we-ge+U,U=ge}U+ne>=0!=!!N&&oe.reverse()}var ae=s.getDefaultExportFromCjs(function oe(N,U){var ne,he=N&&N.type;if(he==="FeatureCollection")for(ne=0;ne>31}function Vr(oe,N){for(var U=oe.loadGeometry(),ne=oe.type,he=0,_e=0,be=U.length,we=0;weoe},Je=Math.fround||(Tt=new Float32Array(1),oe=>(Tt[0]=+oe,Tt[0]));var Tt;const xt=3,Bt=5,dn=6;class vn{constructor(N){this.options=Object.assign(Object.create(Ki),N),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(N){const{log:U,minZoom:ne,maxZoom:he}=this.options;U&&console.time("total time");const _e=`prepare ${N.length} points`;U&&console.time(_e),this.points=N;const be=[];for(let ge=0;ge=ne;ge--){const Pe=+Date.now();we=this.trees[ge]=this._createTree(this._cluster(we,ge)),U&&console.log("z%d: %d clusters in %dms",ge,we.numItems,+Date.now()-Pe)}return U&&console.timeEnd("total time"),this}getClusters(N,U){let ne=((N[0]+180)%360+360)%360-180;const he=Math.max(-90,Math.min(90,N[1]));let _e=N[2]===180?180:((N[2]+180)%360+360)%360-180;const be=Math.max(-90,Math.min(90,N[3]));if(N[2]-N[0]>=360)ne=-180,_e=180;else if(ne>_e){const rt=this.getClusters([ne,he,180,be],U),Qe=this.getClusters([-180,he,_e,be],U);return rt.concat(Qe)}const we=this.trees[this._limitZoom(U)],ge=we.range(ar(ne),br(be),ar(_e),br(he)),Pe=we.data,nt=[];for(const rt of ge){const Qe=this.stride*rt;nt.push(Pe[Qe+Bt]>1?sr(Pe,Qe,this.clusterProps):this.points[Pe[Qe+xt]])}return nt}getChildren(N){const U=this._getOriginId(N),ne=this._getOriginZoom(N),he="No cluster with the specified id.",_e=this.trees[ne];if(!_e)throw new Error(he);const be=_e.data;if(U*this.stride>=be.length)throw new Error(he);const we=this.options.radius/(this.options.extent*Math.pow(2,ne-1)),ge=_e.within(be[U*this.stride],be[U*this.stride+1],we),Pe=[];for(const nt of ge){const rt=nt*this.stride;be[rt+4]===N&&Pe.push(be[rt+Bt]>1?sr(be,rt,this.clusterProps):this.points[be[rt+xt]])}if(Pe.length===0)throw new Error(he);return Pe}getLeaves(N,U,ne){const he=[];return this._appendLeaves(he,N,U=U||10,ne=ne||0,0),he}getTile(N,U,ne){const he=this.trees[this._limitZoom(N)],_e=Math.pow(2,N),{extent:be,radius:we}=this.options,ge=we/be,Pe=(ne-ge)/_e,nt=(ne+1+ge)/_e,rt={features:[]};return this._addTileFeatures(he.range((U-ge)/_e,Pe,(U+1+ge)/_e,nt),he.data,U,ne,_e,rt),U===0&&this._addTileFeatures(he.range(1-ge/_e,Pe,1,nt),he.data,_e,ne,_e,rt),U===_e-1&&this._addTileFeatures(he.range(0,Pe,ge/_e,nt),he.data,-1,ne,_e,rt),rt.features.length?rt:null}getClusterExpansionZoom(N){let U=this._getOriginZoom(N)-1;for(;U<=this.options.maxZoom;){const ne=this.getChildren(N);if(U++,ne.length!==1)break;N=ne[0].properties.cluster_id}return U}_appendLeaves(N,U,ne,he,_e){const be=this.getChildren(U);for(const we of be){const ge=we.properties;if(ge&&ge.cluster?_e+ge.point_count<=he?_e+=ge.point_count:_e=this._appendLeaves(N,ge.cluster_id,ne,he,_e):_e1;let nt,rt,Qe;if(Pe)nt=ii(U,ge,this.clusterProps),rt=U[ge],Qe=U[ge+1];else{const Pt=this.points[U[ge+xt]];nt=Pt.properties;const[Dt,Gt]=Pt.geometry.coordinates;rt=ar(Dt),Qe=br(Gt)}const Mt={type:1,geometry:[[Math.round(this.options.extent*(rt*_e-ne)),Math.round(this.options.extent*(Qe*_e-he))]],tags:nt};let Rt;Rt=Pe||this.options.generateId?U[ge+xt]:this.points[U[ge+xt]].id,Rt!==void 0&&(Mt.id=Rt),be.features.push(Mt)}}_limitZoom(N){return Math.max(this.options.minZoom,Math.min(Math.floor(+N),this.options.maxZoom+1))}_cluster(N,U){const{radius:ne,extent:he,reduce:_e,minPoints:be}=this.options,we=ne/(he*Math.pow(2,U)),ge=N.data,Pe=[],nt=this.stride;for(let rt=0;rtU&&(Dt+=ge[In+Bt])}if(Dt>Pt&&Dt>=be){let Gt,In=Qe*Pt,Vn=Mt*Pt,Ir=-1;const tr=((rt/nt|0)<<5)+(U+1)+this.points.length;for(const Ji of Rt){const hr=Ji*nt;if(ge[hr+2]<=U)continue;ge[hr+2]=U;const Or=ge[hr+Bt];In+=ge[hr]*Or,Vn+=ge[hr+1]*Or,ge[hr+4]=tr,_e&&(Gt||(Gt=this._map(ge,rt,!0),Ir=this.clusterProps.length,this.clusterProps.push(Gt)),_e(Gt,this._map(ge,hr)))}ge[rt+4]=tr,Pe.push(In/Dt,Vn/Dt,1/0,tr,-1,Dt),_e&&Pe.push(Ir)}else{for(let Gt=0;Gt1)for(const Gt of Rt){const In=Gt*nt;if(!(ge[In+2]<=U)){ge[In+2]=U;for(let Vn=0;Vn>5}_getOriginZoom(N){return(N-this.points.length)%32}_map(N,U,ne){if(N[U+Bt]>1){const be=this.clusterProps[N[U+dn]];return ne?Object.assign({},be):be}const he=this.points[N[U+xt]].properties,_e=this.options.map(he);return ne&&_e===he?Object.assign({},_e):_e}}function sr(oe,N,U){return{type:"Feature",id:oe[N+xt],properties:ii(oe,N,U),geometry:{type:"Point",coordinates:[(ne=oe[N],360*(ne-.5)),Es(oe[N+1])]}};var ne}function ii(oe,N,U){const ne=oe[N+Bt],he=ne>=1e4?`${Math.round(ne/1e3)}k`:ne>=1e3?Math.round(ne/100)/10+"k":ne,_e=oe[N+dn],be=_e===-1?{}:Object.assign({},U[_e]);return Object.assign(be,{cluster:!0,cluster_id:oe[N+xt],point_count:ne,point_count_abbreviated:he})}function ar(oe){return oe/360+.5}function br(oe){const N=Math.sin(oe*Math.PI/180),U=.5-.25*Math.log((1+N)/(1-N))/Math.PI;return U<0?0:U>1?1:U}function Es(oe){const N=(180-360*oe)*Math.PI/180;return 360*Math.atan(Math.exp(N))/Math.PI-90}function Yi(oe,N,U,ne){for(var he,_e=ne,be=U-N>>1,we=U-N,ge=oe[N],Pe=oe[N+1],nt=oe[U],rt=oe[U+1],Qe=N+3;Qe_e)he=Qe,_e=Mt;else if(Mt===_e){var Rt=Math.abs(Qe-be);Rtne&&(he-N>3&&Yi(oe,N,he,ne),oe[he+2]=_e,U-he>3&&Yi(oe,he,U,ne))}function xn(oe,N,U,ne,he,_e){var be=he-U,we=_e-ne;if(be!==0||we!==0){var ge=((oe-U)*be+(N-ne)*we)/(be*be+we*we);ge>1?(U=he,ne=_e):ge>0&&(U+=be*ge,ne+=we*ge)}return(be=oe-U)*be+(we=N-ne)*we}function kt(oe,N,U,ne){var he={id:oe===void 0?null:oe,type:N,geometry:U,tags:ne,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(_e){var be=_e.geometry,we=_e.type;if(we==="Point"||we==="MultiPoint"||we==="LineString")Yo(_e,be);else if(we==="Polygon"||we==="MultiLineString")for(var ge=0;ge0&&(be+=ne?(he*Pe-ge*_e)/2:Math.sqrt(Math.pow(ge-he,2)+Math.pow(Pe-_e,2))),he=ge,_e=Pe}var nt=N.length-3;N[2]=1,Yi(N,0,nt,U),N[nt+2]=1,N.size=Math.abs(be),N.start=0,N.end=N.size}function pi(oe,N,U,ne){for(var he=0;he1?1:U}function oi(oe,N,U,ne,he,_e,be,we){if(ne/=N,_e>=(U/=N)&&be=ne)return null;for(var ge=[],Pe=0;Pe=U&&Rt=ne)){var Pt=[];if(Qe==="Point"||Qe==="MultiPoint")fl(rt,Pt,U,ne,he);else if(Qe==="LineString")aa(rt,Pt,U,ne,he,!1,we.lineMetrics);else if(Qe==="MultiLineString")Qo(rt,Pt,U,ne,he,!1);else if(Qe==="Polygon")Qo(rt,Pt,U,ne,he,!0);else if(Qe==="MultiPolygon")for(var Dt=0;Dt=U&&be<=ne&&(N.push(oe[_e]),N.push(oe[_e+1]),N.push(oe[_e+2]))}}function aa(oe,N,U,ne,he,_e,be){for(var we,ge,Pe=ml(oe),nt=he===0?Sc:Ac,rt=oe.start,Qe=0;QeU&&(ge=nt(Pe,Mt,Rt,Dt,Gt,U),be&&(Pe.start=rt+we*ge)):In>ne?Vn=U&&(ge=nt(Pe,Mt,Rt,Dt,Gt,U),Ir=!0),Vn>ne&&In<=ne&&(ge=nt(Pe,Mt,Rt,Dt,Gt,ne),Ir=!0),!_e&&Ir&&(be&&(Pe.end=rt+we*ge),N.push(Pe),Pe=ml(oe)),be&&(rt+=we)}var tr=oe.length-3;Mt=oe[tr],Rt=oe[tr+1],Pt=oe[tr+2],(In=he===0?Mt:Rt)>=U&&In<=ne&&la(Pe,Mt,Rt,Pt),tr=Pe.length-3,_e&&tr>=3&&(Pe[tr]!==Pe[0]||Pe[tr+1]!==Pe[1])&&la(Pe,Pe[0],Pe[1],Pe[2]),Pe.length&&N.push(Pe)}function ml(oe){var N=[];return N.size=oe.size,N.start=oe.start,N.end=oe.end,N}function Qo(oe,N,U,ne,he,_e){for(var be=0;bebe.maxX&&(be.maxX=nt),rt>be.maxY&&(be.maxY=rt)}return be}function _l(oe,N,U,ne){var he=N.geometry,_e=N.type,be=[];if(_e==="Point"||_e==="MultiPoint")for(var we=0;we0&&N.size<(he?be:ne))U.numPoints+=N.length/3;else{for(var we=[],ge=0;gebe)&&(U.numSimplified++,we.push(N[ge]),we.push(N[ge+1])),U.numPoints++;he&&function(Pe,nt){for(var rt=0,Qe=0,Mt=Pe.length,Rt=Mt-2;Qe0===nt)for(Qe=0,Mt=Pe.length;Qe24)throw new Error("maxZoom should be in the 0-24 range");if(N.promoteId&&N.generateId)throw new Error("promoteId and generateId cannot be used together.");var ne=function(he,_e){var be=[];if(he.type==="FeatureCollection")for(var we=0;we1&&console.time("creation"),Qe=this.tiles[rt]=ca(oe,N,U,ne,ge),this.tileCoords.push({z:N,x:U,y:ne}),Pe)){Pe>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",N,U,ne,Qe.numFeatures,Qe.numPoints,Qe.numSimplified),console.timeEnd("creation"));var Mt="z"+N;this.stats[Mt]=(this.stats[Mt]||0)+1,this.total++}if(Qe.source=oe,he){if(N===ge.maxZoom||N===he)continue;var Rt=1<1&&console.time("clipping");var Pt,Dt,Gt,In,Vn,Ir,tr=.5*ge.buffer/ge.extent,Ji=.5-tr,hr=.5+tr,Or=1+tr;Pt=Dt=Gt=In=null,Vn=oi(oe,nt,U-tr,U+hr,0,Qe.minX,Qe.maxX,ge),Ir=oi(oe,nt,U+Ji,U+Or,0,Qe.minX,Qe.maxX,ge),oe=null,Vn&&(Pt=oi(Vn,nt,ne-tr,ne+hr,1,Qe.minY,Qe.maxY,ge),Dt=oi(Vn,nt,ne+Ji,ne+Or,1,Qe.minY,Qe.maxY,ge),Vn=null),Ir&&(Gt=oi(Ir,nt,ne-tr,ne+hr,1,Qe.minY,Qe.maxY,ge),In=oi(Ir,nt,ne+Ji,ne+Or,1,Qe.minY,Qe.maxY,ge),Ir=null),Pe>1&&console.timeEnd("clipping"),we.push(Pt||[],N+1,2*U,2*ne),we.push(Dt||[],N+1,2*U,2*ne+1),we.push(Gt||[],N+1,2*U+1,2*ne),we.push(In||[],N+1,2*U+1,2*ne+1)}}},ts.prototype.getTile=function(oe,N,U){var ne=this.options,he=ne.extent,_e=ne.debug;if(oe<0||oe>24)return null;var be=1<1&&console.log("drilling down to z%d-%d-%d",oe,N,U);for(var ge,Pe=oe,nt=N,rt=U;!ge&&Pe>0;)Pe--,nt=Math.floor(nt/2),rt=Math.floor(rt/2),ge=this.tiles[As(Pe,nt,rt)];return ge&&ge.source?(_e>1&&console.log("found parent tile z%d-%d-%d",Pe,nt,rt),_e>1&&console.time("drilling down"),this.splitTile(ge.source,Pe,nt,rt,oe,N,U),_e>1&&console.timeEnd("drilling down"),this.tiles[we]?gl(this.tiles[we],he):null):null};class ua extends s.VectorTileWorkerSource{constructor(N,U,ne,he,_e){super(N,U,ne,he,Cs),_e&&(this.loadGeoJSON=_e)}loadData(N,U){const ne=N&&N.request,he=ne&&ne.collectResourceTiming;this.loadGeoJSON(N,(_e,be)=>{if(_e||!be)return U(_e);if(typeof be!="object")return U(new Error(`Input data given to '${N.source}' is not a valid GeoJSON object.`));{ae(be,!0);try{if(N.filter){const ge=s.createExpression(N.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(ge.result==="error")throw new Error(ge.value.map(nt=>`${nt.key}: ${nt.message}`).join(", "));be={type:"FeatureCollection",features:be.features.filter(nt=>ge.value.evaluate({zoom:0},nt))}}this._geoJSONIndex=N.cluster?new vn(function({superclusterOptions:ge,clusterProperties:Pe}){if(!Pe||!ge)return ge;const nt={},rt={},Qe={accumulated:null,zoom:0},Mt={properties:null},Rt=Object.keys(Pe);for(const Pt of Rt){const[Dt,Gt]=Pe[Pt],In=s.createExpression(Gt),Vn=s.createExpression(typeof Dt=="string"?[Dt,["accumulated"],["get",Pt]]:Dt);nt[Pt]=In.value,rt[Pt]=Vn.value}return ge.map=Pt=>{Mt.properties=Pt;const Dt={};for(const Gt of Rt)Dt[Gt]=nt[Gt].evaluate(Qe,Mt);return Dt},ge.reduce=(Pt,Dt)=>{Mt.properties=Dt;for(const Gt of Rt)Qe.accumulated=Pt[Gt],Pt[Gt]=rt[Gt].evaluate(Qe,Mt)},ge}(N)).load(be.features):function(ge,Pe){return new ts(ge,Pe)}(be,N.geojsonVtOptions)}catch(ge){return U(ge)}this.loaded={};const we={};if(he){const ge=s.getPerformanceMeasurement(ne);ge&&(we.resourceTiming={},we.resourceTiming[N.source]=JSON.parse(JSON.stringify(ge)))}U(null,we)}})}reloadTile(N,U){const ne=this.loaded;return ne&&ne[N.uid]?super.reloadTile(N,U):this.loadTile(N,U)}loadGeoJSON(N,U){if(N.request)s.getJSON(N.request,U);else{if(typeof N.data!="string")return U(new Error(`Input data given to '${N.source}' is not a valid GeoJSON object.`));try{return U(null,JSON.parse(N.data))}catch{return U(new Error(`Input data given to '${N.source}' is not a valid GeoJSON object.`))}}}getClusterExpansionZoom(N,U){try{U(null,this._geoJSONIndex.getClusterExpansionZoom(N.clusterId))}catch(ne){U(ne)}}getClusterChildren(N,U){try{U(null,this._geoJSONIndex.getChildren(N.clusterId))}catch(ne){U(ne)}}getClusterLeaves(N,U){try{U(null,this._geoJSONIndex.getLeaves(N.clusterId,N.limit,N.offset))}catch(ne){U(ne)}}}class Cc{constructor(N){this.self=N,this.actor=new s.Actor(N,this),this.layerIndexes={},this.availableImages={},this.isSpriteLoaded={},this.projections={},this.defaultProjection=s.getProjection({name:"mercator"}),this.workerSourceTypes={vector:s.VectorTileWorkerSource,geojson:ua},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(U,ne)=>{if(this.workerSourceTypes[U])throw new Error(`Worker source with name "${U}" already registered.`);this.workerSourceTypes[U]=ne},this.self.registerRTLTextPlugin=U=>{if(s.plugin.isParsed())throw new Error("RTL text plugin already registered.");s.plugin.applyArabicShaping=U.applyArabicShaping,s.plugin.processBidirectionalText=U.processBidirectionalText,s.plugin.processStyledBidirectionalText=U.processStyledBidirectionalText}}clearCaches(N,U,ne){delete this.layerIndexes[N],delete this.availableImages[N],delete this.workerSources[N],delete this.demWorkerSources[N],ne()}checkIfReady(N,U,ne){ne()}setReferrer(N,U){this.referrer=U}spriteLoaded(N,U){this.isSpriteLoaded[N]=U;for(const ne in this.workerSources[N]){const he=this.workerSources[N][ne];for(const _e in he)he[_e]instanceof s.VectorTileWorkerSource&&(he[_e].isSpriteLoaded=U,he[_e].fire(new s.Event("isSpriteLoaded")))}}setImages(N,U,ne){this.availableImages[N]=U;for(const he in this.workerSources[N]){const _e=this.workerSources[N][he];for(const be in _e)_e[be].availableImages=U}ne()}enableTerrain(N,U,ne){this.terrain=U,ne()}setProjection(N,U){this.projections[N]=s.getProjection(U)}setLayers(N,U,ne){this.getLayerIndex(N).replace(U),ne()}updateLayers(N,U,ne){this.getLayerIndex(N).update(U.layers,U.removedIds),ne()}loadTile(N,U,ne){const he=this.enableTerrain?s.extend({enableTerrain:this.terrain},U):U;he.projection=this.projections[N]||this.defaultProjection,this.getWorkerSource(N,U.type,U.source).loadTile(he,ne)}loadDEMTile(N,U,ne){const he=this.enableTerrain?s.extend({buildQuadTree:this.terrain},U):U;this.getDEMWorkerSource(N,U.source).loadTile(he,ne)}reloadTile(N,U,ne){const he=this.enableTerrain?s.extend({enableTerrain:this.terrain},U):U;he.projection=this.projections[N]||this.defaultProjection,this.getWorkerSource(N,U.type,U.source).reloadTile(he,ne)}abortTile(N,U,ne){this.getWorkerSource(N,U.type,U.source).abortTile(U,ne)}removeTile(N,U,ne){this.getWorkerSource(N,U.type,U.source).removeTile(U,ne)}removeSource(N,U,ne){if(!this.workerSources[N]||!this.workerSources[N][U.type]||!this.workerSources[N][U.type][U.source])return;const he=this.workerSources[N][U.type][U.source];delete this.workerSources[N][U.type][U.source],he.removeSource!==void 0?he.removeSource(U,ne):ne()}loadWorkerSource(N,U,ne){try{this.self.importScripts(U.url),ne()}catch(he){ne(he.toString())}}syncRTLPluginState(N,U,ne){try{s.plugin.setState(U);const he=s.plugin.getPluginURL();if(s.plugin.isLoaded()&&!s.plugin.isParsed()&&he!=null){this.self.importScripts(he);const _e=s.plugin.isParsed();ne(_e?void 0:new Error(`RTL Text Plugin failed to import scripts from ${he}`),_e)}}catch(he){ne(he.toString())}}getAvailableImages(N){let U=this.availableImages[N];return U||(U=[]),U}getLayerIndex(N){let U=this.layerIndexes[N];return U||(U=this.layerIndexes[N]=new V),U}getWorkerSource(N,U,ne){if(this.workerSources[N]||(this.workerSources[N]={}),this.workerSources[N][U]||(this.workerSources[N][U]={}),!this.workerSources[N][U][ne]){const he={send:(_e,be,we,ge,Pe,nt)=>{this.actor.send(_e,be,we,N,Pe,nt)},scheduler:this.actor.scheduler};this.workerSources[N][U][ne]=new this.workerSourceTypes[U](he,this.getLayerIndex(N),this.getAvailableImages(N),this.isSpriteLoaded[N])}return this.workerSources[N][U][ne]}getDEMWorkerSource(N,U){return this.demWorkerSources[N]||(this.demWorkerSources[N]={}),this.demWorkerSources[N][U]||(this.demWorkerSources[N][U]=new G),this.demWorkerSources[N][U]}enforceCacheSizeLimit(N,U){s.enforceCacheSizeLimit(U)}getWorkerPerformanceMetrics(N,U,ne){ne(void 0,void 0)}}return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&(self.worker=new Cc(self)),Cc}),v(["./shared"],function(s){function k(d,o){if(Array.isArray(d)){if(!Array.isArray(o)||d.length!==o.length)return!1;for(let c=0;c"u"||typeof document>"u"?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var f,_,x=new Blob([""],{type:"text/javascript"}),T=URL.createObjectURL(x);try{_=new Worker(T),f=!0}catch{f=!1}return _&&_.terminate(),URL.revokeObjectURL(T),f}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var f=document.createElement("canvas");f.width=f.height=1;var _=f.getContext("2d");if(!_)return!1;var x=_.getImageData(0,0,1,1);return x&&x.width===f.width}()?(G[c=o&&o.failIfMajorPerformanceCaveat]===void 0&&(G[c]=function(f){var _,x=function(T){var S=document.createElement("canvas"),C=Object.create(V.webGLContextAttributes);return C.failIfMajorPerformanceCaveat=T,S.getContext("webgl",C)||S.getContext("experimental-webgl",C)}(f);if(!x)return!1;try{_=x.createShader(x.VERTEX_SHADER)}catch{return!1}return!(!_||x.isContextLost())&&(x.shaderSource(_,"void main() {}"),x.compileShader(_),x.getShaderParameter(_,x.COMPILE_STATUS)===!0)}(c)),G[c]?document.documentMode?"insufficient ECMAScript 6 support":void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var c}(d)}var G={};function J(d,o,c){const f=s.window.document.createElement(d);return o!==void 0&&(f.className=o),c&&c.appendChild(f),f}function ve(d,o,c){const f=s.window.document.createElementNS("http://www.w3.org/2000/svg",d);for(const _ of Object.keys(o))f.setAttributeNS(null,_,o[_]);return c&&c.appendChild(f),f}V.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};const ae=s.window.document&&s.window.document.documentElement.style,me=ae&&ae.userSelect!==void 0?"userSelect":"WebkitUserSelect";let Ce;function ie(){ae&&me&&(Ce=ae[me],ae[me]="none")}function te(){ae&&me&&(ae[me]=Ce)}function le(d){d.preventDefault(),d.stopPropagation(),s.window.removeEventListener("click",le,!0)}function ze(){s.window.addEventListener("click",le,!0),s.window.setTimeout(()=>{s.window.removeEventListener("click",le,!0)},0)}function Oe(d,o){const c=d.getBoundingClientRect();return ht(d,c,o)}function Ke(d,o){const c=d.getBoundingClientRect(),f=[];for(let _=0;_=0?0:d.button}function ht(d,o,c){const f=d.offsetWidth===o.width?1:d.offsetWidth/o.width;return new s.Point((c.clientX-o.left)*f,(c.clientY-o.top)*f)}function Ve(d,o){var c=o[0],f=o[1],_=o[2],x=o[3],T=c*x-_*f;return T?(d[0]=x*(T=1/T),d[1]=-f*T,d[2]=-_*T,d[3]=c*T,d):null}function jt(d){const{userImage:o}=d;return!!(o&&o.render&&o.render())&&(d.data.replace(new Uint8Array(o.data.buffer)),!0)}class wr extends s.Evented{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new s.RGBAImage({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(o){if(this.loaded!==o&&(this.loaded=o,o)){for(const{ids:c,callback:f}of this.requestors)this._notify(c,f);this.requestors=[]}}hasImage(o){return!!this.getImage(o)}getImage(o){return this.images[o]}addImage(o,c){this._validate(o,c)&&(this.images[o]=c)}_validate(o,c){let f=!0;return this._validateStretch(c.stretchX,c.data&&c.data.width)||(this.fire(new s.ErrorEvent(new Error(`Image "${o}" has invalid "stretchX" value`))),f=!1),this._validateStretch(c.stretchY,c.data&&c.data.height)||(this.fire(new s.ErrorEvent(new Error(`Image "${o}" has invalid "stretchY" value`))),f=!1),this._validateContent(c.content,c)||(this.fire(new s.ErrorEvent(new Error(`Image "${o}" has invalid "content" value`))),f=!1),f}_validateStretch(o,c){if(!o)return!0;let f=0;for(const _ of o){if(_[0]{this.ready=!0})}broadcast(o,c,f){s.asyncAll(this.actors,(_,x)=>{_.send(o,c,x)},f=f||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach(o=>{o.remove()}),this.actors=[],this.workerPool.release(this.id)}}function Bt(d,o,c){return o*(s.EXTENT/(d.tileSize*Math.pow(2,c-d.tileID.overscaledZ)))}xt.Actor=s.Actor;class dn{constructor(o,c,f,_){this.screenBounds=o,this.cameraPoint=c,this._screenRaycastCache={},this._cameraRaycastCache={},this.isAboveHorizon=f,this.screenGeometry=this.bufferedScreenGeometry(0),this.screenGeometryMercator=this._bufferedScreenMercator(0,_)}static createFromScreenPoints(o,c){let f,_;if(o instanceof s.Point||typeof o[0]=="number"){const x=s.Point.convert(o);f=[x],_=c.isPointAboveHorizon(x)}else{const x=s.Point.convert(o[0]),T=s.Point.convert(o[1]);f=[x,T],_=s.polygonizeBounds(x,T).every(S=>c.isPointAboveHorizon(S))}return new dn(f,c.getCameraPoint(),_,c)}isPointQuery(){return this.screenBounds.length===1}bufferedScreenGeometry(o){return s.polygonizeBounds(this.screenBounds[0],this.screenBounds.length===1?this.screenBounds[0]:this.screenBounds[1],o)}bufferedCameraGeometry(o){const c=this.screenBounds[0],f=this.screenBounds.length===1?this.screenBounds[0].add(new s.Point(1,1)):this.screenBounds[1],_=s.polygonizeBounds(c,f,0,!1);return this.cameraPoint.y>f.y&&(this.cameraPoint.x>c.x&&this.cameraPoint.x=f.x?_[2]=this.cameraPoint:this.cameraPoint.x<=c.x&&(_[3]=this.cameraPoint)),s.bufferConvexPolygon(_,o)}bufferedCameraGeometryGlobe(o){const c=this.screenBounds[0],f=this.screenBounds.length===1?this.screenBounds[0].add(new s.Point(1,1)):this.screenBounds[1],_=s.polygonizeBounds(c,f,o),x=this.cameraPoint.clone();switch(3*((x.y>c.y)+(x.y>f.y))+((x.x>c.x)+(x.x>f.x))){case 0:_[0]=x,_[4]=x.clone();break;case 1:_.splice(1,0,x);break;case 2:_[1]=x;break;case 3:_.splice(4,0,x);break;case 5:_.splice(2,0,x);break;case 6:_[3]=x;break;case 7:_.splice(3,0,x);break;case 8:_[2]=x}return _}containsTile(o,c,f,_=0){const x=o.queryPadding/c._pixelsPerMercatorPixel+1,T=f?this._bufferedCameraMercator(x,c):this._bufferedScreenMercator(x,c);let S=o.tileID.wrap+(T.unwrapped?_:0);const C=T.polygon.map(X=>s.getTilePoint(o.tileTransform,X,S));if(!s.polygonIntersectsBox(C,0,0,s.EXTENT,s.EXTENT))return;S=o.tileID.wrap+(this.screenGeometryMercator.unwrapped?_:0);const z=this.screenGeometryMercator.polygon.map(X=>s.getTileVec3(o.tileTransform,X,S)),P=z.map(X=>new s.Point(X[0],X[1])),O=c.getFreeCameraOptions().position||new s.MercatorCoordinate(0,0,0),j=s.getTileVec3(o.tileTransform,O,S),W=z.map(X=>{const B=s.sub(X,X,j);return s.normalize(B,B),new s.Ray(j,B)}),H=Bt(o,1,c.zoom)*c._pixelsPerMercatorPixel;return{queryGeometry:this,tilespaceGeometry:P,tilespaceRays:W,bufferedTilespaceGeometry:C,bufferedTilespaceBounds:(Z=s.getBounds(C),Z.min.x=s.clamp(Z.min.x,0,s.EXTENT),Z.min.y=s.clamp(Z.min.y,0,s.EXTENT),Z.max.x=s.clamp(Z.max.x,0,s.EXTENT),Z.max.y=s.clamp(Z.max.y,0,s.EXTENT),Z),tile:o,tileID:o.tileID,pixelToTileUnitsFactor:H};var Z}_bufferedScreenMercator(o,c){const f=ii(o);if(this._screenRaycastCache[f])return this._screenRaycastCache[f];{let _;return _=c.projection.name==="globe"?this._projectAndResample(this.bufferedScreenGeometry(o),c):{polygon:this.bufferedScreenGeometry(o).map(x=>c.pointCoordinate3D(x)),unwrapped:!0},this._screenRaycastCache[f]=_,_}}_bufferedCameraMercator(o,c){const f=ii(o);if(this._cameraRaycastCache[f])return this._cameraRaycastCache[f];{let _;return _=c.projection.name==="globe"?this._projectAndResample(this.bufferedCameraGeometryGlobe(o),c):{polygon:this.bufferedCameraGeometry(o).map(x=>c.pointCoordinate3D(x)),unwrapped:!0},this._cameraRaycastCache[f]=_,_}}_projectAndResample(o,c){const f=function(x,T){const S=s.multiply([],T.pixelMatrix,T.globeMatrix),C=[0,-s.GLOBE_RADIUS,0,1],z=[0,s.GLOBE_RADIUS,0,1],P=[0,0,0,1];s.transformMat4$1(C,C,S),s.transformMat4$1(z,z,S),s.transformMat4$1(P,P,S);const O=new s.Point(C[0]/C[3],C[1]/C[3]),j=new s.Point(z[0]/z[3],z[1]/z[3]),W=s.polygonContainsPoint(x,O)&&C[3]1?vn(x.slice(0,X),T):[],Q=Xnew s.Point(sr(pe.x),pe.y)),Q=Q.map(pe=>new s.Point(sr(pe.x),pe.y));const ee=[...q];ee.length===0&&ee.push(Q[Q.length-1]);const de=s.number(ee[ee.length-1].y,(Q.length===0?q[0]:Q[0]).y,B);let fe;return fe=W?[new s.Point(0,de),new s.Point(0,0),new s.Point(1,0),new s.Point(1,de)]:[new s.Point(1,de),new s.Point(1,1),new s.Point(0,1),new s.Point(0,de)],ee.push(...fe),Q.length===0?ee.push(q[0]):ee.push(...Q),{polygon:ee.map(pe=>new s.MercatorCoordinate(pe.x,pe.y)),unwrapped:!1}}(o,c);if(f)return f;const _=function(x,T){let S=!1,C=-1/0,z=0;for(let O=0;OC&&(C=x[O].x,z=O);for(let O=0;O.5&&(W.x{O.x-=1}),{polygon:x,unwrapped:S}}(vn(o,c).map(x=>new s.Point(sr(x.x),x.y)),c);return{polygon:_.polygon.map(x=>new s.MercatorCoordinate(x.x,x.y)),unwrapped:_.unwrapped}}}function vn(d,o){return s.resample(d,c=>{const f=o.pointCoordinate3D(c);c.x=f.x,c.y=f.y},1/256)}function sr(d){return d<0?1+d%1:d%1}function ii(d){return 100*d|0}function ar(d,o,c,f,_){const x=function(T,S){if(T)return _(T);if(S){d.url&&S.tiles&&d.tiles&&delete d.tiles;const C=s.pick(s.extend(S,d),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);S.vector_layers&&(C.vectorLayers=S.vector_layers,C.vectorLayerIds=C.vectorLayers.map(z=>z.id)),C.tiles=o.canonicalizeTileset(C,d.url),_(null,C)}};return d.url?s.getJSON(o.transformRequest(o.normalizeSourceURL(d.url,null,c,f),s.ResourceType.Source),x):s.exported.frame(()=>x(null,d))}class br{constructor(o,c,f){this.bounds=s.LngLatBounds.convert(this.validateBounds(o)),this.minzoom=c||0,this.maxzoom=f||24}validateBounds(o){return Array.isArray(o)&&o.length===4?[Math.max(-180,o[0]),Math.max(-90,o[1]),Math.min(180,o[2]),Math.min(90,o[3])]:[-180,-90,180,90]}contains(o){const c=Math.pow(2,o.z),f=Math.floor(s.mercatorXfromLng(this.bounds.getWest())*c),_=Math.floor(s.mercatorYfromLat(this.bounds.getNorth())*c),x=Math.ceil(s.mercatorXfromLng(this.bounds.getEast())*c),T=Math.ceil(s.mercatorYfromLat(this.bounds.getSouth())*c);return o.x>=f&&o.x=_&&o.y{this._tileJSONRequest=null,this._loaded=!0,_?(c&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${c}`),f&&f.length!==2&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${f}`),this.fire(new s.ErrorEvent(_))):x&&(s.extend(this,x),x.bounds&&(this.tileBounds=new br(x.bounds,this.minzoom,this.maxzoom)),s.postTurnstileEvent(x.tiles,this.map._requestManager._customAccessToken),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"}))),o&&o(_)})}loaded(){return this._loaded}hasTile(o){return!this.tileBounds||this.tileBounds.contains(o.canonical)}onAdd(o){this.map=o,this.load()}reload(){this.cancelTileJSONRequest(),this.load(()=>this.map.style._clearSource(this.id))}setTiles(o){return this._options.tiles=o,this.reload(),this}setUrl(o){return this.url=o,this._options.url=o,this.reload(),this}onRemove(){this.cancelTileJSONRequest()}serialize(){return s.extend({},this._options)}loadTile(o,c){const f=this.map._requestManager.normalizeTileURL(o.tileID.canonical.url(this.tiles,this.scheme)),_={request:this.map._requestManager.transformRequest(f,s.ResourceType.Tile),data:void 0,uid:o.uid,tileID:o.tileID,tileZoom:o.tileZoom,zoom:o.tileID.overscaledZ,tileSize:this.tileSize*o.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:s.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,isSymbolTile:o.isSymbolTile};if(_.request.collectResourceTiming=this._collectResourceTiming,o.actor&&o.state!=="expired")o.state==="loading"?o.reloadCallback=c:o.request=o.actor.send("reloadTile",_,x.bind(this));else if(o.actor=this._tileWorkers[f]=this._tileWorkers[f]||this.dispatcher.getActor(),this.dispatcher.ready)o.request=o.actor.send("loadTile",_,x.bind(this),void 0,!0);else{const T=s.loadVectorTile.call({deduped:this._deduped},_,(S,C)=>{S||!C?x.call(this,S):(_.data={cacheControl:C.cacheControl,expires:C.expires,rawData:C.rawData.slice(0)},o.actor&&o.actor.send("loadTile",_,x.bind(this),void 0,!0))},!0);o.request={cancel:T}}function x(T,S){return delete o.request,o.aborted?c(null):T&&T.status!==404?c(T):(S&&S.resourceTiming&&(o.resourceTiming=S.resourceTiming),this.map._refreshExpiredTiles&&S&&o.setExpiryData(S),o.loadVectorData(S,this.map.painter),s.cacheEntryPossiblyAdded(this.dispatcher),c(null),void(o.reloadCallback&&(this.loadTile(o,o.reloadCallback),o.reloadCallback=null)))}}abortTile(o){o.request&&(o.request.cancel(),delete o.request),o.actor&&o.actor.send("abortTile",{uid:o.uid,type:this.type,source:this.id})}unloadTile(o){o.unloadVectorData(),o.actor&&o.actor.send("removeTile",{uid:o.uid,type:this.type,source:this.id})}hasTransition(){return!1}afterUpdate(){this._tileWorkers={}}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}class Qe extends s.Evented{constructor(o,c,f,_){super(),this.id=o,this.dispatcher=f,this.setEventedParent(_),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=s.extend({type:"raster"},c),s.extend(this,s.pick(c,["url","scheme","tileSize"]))}load(o){this._loaded=!1,this.fire(new s.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=ar(this._options,this.map._requestManager,null,null,(c,f)=>{this._tileJSONRequest=null,this._loaded=!0,c?this.fire(new s.ErrorEvent(c)):f&&(s.extend(this,f),f.bounds&&(this.tileBounds=new br(f.bounds,this.minzoom,this.maxzoom)),s.postTurnstileEvent(f.tiles),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"}))),o&&o(c)})}loaded(){return this._loaded}onAdd(o){this.map=o,this.load()}reload(){this.cancelTileJSONRequest(),this.load(()=>this.map.style._clearSource(this.id))}setTiles(o){return this._options.tiles=o,this.reload(),this}setUrl(o){return this.url=o,this._options.url=o,this.reload(),this}onRemove(){this.cancelTileJSONRequest()}serialize(){return s.extend({},this._options)}hasTile(o){return!this.tileBounds||this.tileBounds.contains(o.canonical)}loadTile(o,c){const f=s.exported.devicePixelRatio>=2,_=this.map._requestManager.normalizeTileURL(o.tileID.canonical.url(this.tiles,this.scheme),f,this.tileSize);o.request=s.getImage(this.map._requestManager.transformRequest(_,s.ResourceType.Tile),(x,T,S,C)=>(delete o.request,o.aborted?(o.state="unloaded",c(null)):x?(o.state="errored",c(x)):T?(this.map._refreshExpiredTiles&&o.setExpiryData({cacheControl:S,expires:C}),o.setTexture(T,this.map.painter),o.state="loaded",s.cacheEntryPossiblyAdded(this.dispatcher),void c(null)):c(null)))}static loadTileData(o,c,f){o.setTexture(c,f)}static unloadTileData(o,c){o.texture&&c.saveTileTexture(o.texture)}abortTile(o,c){o.request&&(o.request.cancel(),delete o.request),c()}unloadTile(o,c){o.texture&&this.map.painter.saveTileTexture(o.texture),c()}hasTransition(){return!1}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}function Mt(d,o,c,f,_,x,T,S){const C=[d,c,_,o,f,x,1,1,1],z=[T,S,1],P=s.adjoint([],C),[O,j,W]=s.transformMat3(z,z,s.transpose(P,P));return s.multiply$1(C,[O,0,0,0,j,0,0,0,W],C)}class Rt extends s.Evented{constructor(o,c,f,_){super(),this.id=o,this.dispatcher=f,this.coordinates=c.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(_),this.options=c,this._dirty=!1}load(o,c){this._loaded=c||!1,this.fire(new s.Event("dataloading",{dataType:"source"})),this.url=this.options.url,this._imageRequest=s.getImage(this.map._requestManager.transformRequest(this.url,s.ResourceType.Image),(f,_)=>{if(this._imageRequest=null,this._loaded=!0,f)this.fire(new s.ErrorEvent(f));else if(_){const{HTMLImageElement:x}=s.window;this.image=_ instanceof x?s.exported.getImageData(_):_,this._dirty=!0,this.width=this.image.width,this.height=this.image.height,o&&(this.coordinates=o),this._finishLoading()}})}loaded(){return this._loaded}updateImage(o){return this.image&&o.url?(this._imageRequest&&o.url!==this.options.url&&(this._imageRequest.cancel(),this._imageRequest=null),this.options.url=o.url,this.load(o.coordinates,this._loaded),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(o){this.map=o,this.load()}onRemove(){this._imageRequest&&(this._imageRequest.cancel(),this._imageRequest=null),this.texture&&this.texture.destroy()}setCoordinates(o){this.coordinates=o,this._boundsArray=void 0;const c=o.map(s.MercatorCoordinate.fromLngLat);return this.tileID=function(f){let _=1/0,x=1/0,T=-1/0,S=-1/0;for(const O of f)_=Math.min(_,O.x),x=Math.min(x,O.y),T=Math.max(T,O.x),S=Math.max(S,O.y);const C=Math.max(T-_,S-x),z=Math.max(0,Math.floor(-Math.log(C)/Math.LN2)),P=Math.pow(2,z);return new s.CanonicalTileID(z,Math.floor((_+T)/2*P),Math.floor((x+S)/2*P))}(c),this.minzoom=this.maxzoom=this.tileID.z,this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"})),this}_clear(){this._boundsArray=void 0}_prepareData(o){for(const C in this.tiles){const z=this.tiles[C];z.state!=="loaded"&&(z.state="loaded",z.texture=this.texture)}if(this._boundsArray)return;const c=s.tileTransform(this.tileID,this.map.transform.projection),[f,_,x,T]=this.coordinates.map(C=>{const z=c.projection.project(C[0],C[1]);return s.getTilePoint(c,z)._round()});this.perspectiveTransform=function(C,z,P,O,j,W,H,Z,X,B){const q=Mt(0,0,C,0,0,z,C,z),Q=Mt(P,O,j,W,H,Z,X,B);return s.multiply$1(Q,s.adjoint(q,q),Q),[Q[6]/Q[8]*C/s.EXTENT,Q[7]/Q[8]*z/s.EXTENT]}(this.width,this.height,f.x,f.y,_.x,_.y,T.x,T.y,x.x,x.y);const S=this._boundsArray=new s.StructArrayLayout4i8;S.emplaceBack(f.x,f.y,0,0),S.emplaceBack(_.x,_.y,s.EXTENT,0),S.emplaceBack(T.x,T.y,0,s.EXTENT),S.emplaceBack(x.x,x.y,s.EXTENT,s.EXTENT),this.boundsBuffer&&this.boundsBuffer.destroy(),this.boundsBuffer=o.createVertexBuffer(S,s.boundsAttributes.members),this.boundsSegments=s.SegmentVector.simpleSegment(0,0,4,2)}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const o=this.map.painter.context,c=o.gl;this._dirty&&(this.texture?this.texture.update(this.image):(this.texture=new s.Texture(o,this.image,c.RGBA),this.texture.bind(c.LINEAR,c.CLAMP_TO_EDGE)),this._dirty=!1),this._prepareData(o)}loadTile(o,c){this.tileID&&this.tileID.equals(o.tileID.canonical)?(this.tiles[String(o.tileID.wrap)]=o,o.buckets={},c(null)):(o.state="errored",c(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}const Pt={vector:rt,raster:Qe,"raster-dem":class extends Qe{constructor(d,o,c,f){super(d,o,c,f),this.type="raster-dem",this.maxzoom=22,this._options=s.extend({type:"raster-dem"},o),this.encoding=o.encoding||"mapbox"}loadTile(d,o){const c=this.map._requestManager.normalizeTileURL(d.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize);function f(_,x){_&&(d.state="errored",o(_)),x&&(d.dem=x,d.dem.onDeserialize(),d.needsHillshadePrepare=!0,d.needsDEMTextureUpload=!0,d.state="loaded",o(null))}d.request=s.getImage(this.map._requestManager.transformRequest(c,s.ResourceType.Tile),(function(_,x,T,S){if(delete d.request,d.aborted)d.state="unloaded",o(null);else if(_)d.state="errored",o(_);else if(x){this.map._refreshExpiredTiles&&d.setExpiryData({cacheControl:T,expires:S});const C=s.window.ImageBitmap&&x instanceof s.window.ImageBitmap&&(ca==null&&(ca=s.window.OffscreenCanvas&&new s.window.OffscreenCanvas(1,1).getContext("2d")&&typeof s.window.createImageBitmap=="function"),ca),z=1-(x.width-s.prevPowerOfTwo(x.width))/2;z<1||d.neighboringTiles||(d.neighboringTiles=this._getNeighboringTiles(d.tileID));const P=C?x:s.exported.getImageData(x,z),O={uid:d.uid,coord:d.tileID,source:this.id,rawImageData:P,encoding:this.encoding,padding:z};d.actor&&d.state!=="expired"||(d.actor=this.dispatcher.getActor(),d.actor.send("loadDEMTile",O,f.bind(this),void 0,!0))}}).bind(this))}_getNeighboringTiles(d){const o=d.canonical,c=Math.pow(2,o.z),f=(o.x-1+c)%c,_=o.x===0?d.wrap-1:d.wrap,x=(o.x+1+c)%c,T=o.x+1===c?d.wrap+1:d.wrap,S={};return S[new s.OverscaledTileID(d.overscaledZ,_,o.z,f,o.y).key]={backfilled:!1},S[new s.OverscaledTileID(d.overscaledZ,T,o.z,x,o.y).key]={backfilled:!1},o.y>0&&(S[new s.OverscaledTileID(d.overscaledZ,_,o.z,f,o.y-1).key]={backfilled:!1},S[new s.OverscaledTileID(d.overscaledZ,d.wrap,o.z,o.x,o.y-1).key]={backfilled:!1},S[new s.OverscaledTileID(d.overscaledZ,T,o.z,x,o.y-1).key]={backfilled:!1}),o.y+1{if(this._loaded=!0,this._pendingLoad=null,c)this.fire(new s.ErrorEvent(c));else{const _={dataType:"source",sourceDataType:this._metadataFired?"content":"metadata"};this._collectResourceTiming&&f&&f.resourceTiming&&f.resourceTiming[this.id]&&(_.resourceTiming=f.resourceTiming[this.id]),this.fire(new s.Event("data",_)),this._metadataFired=!0}this._coalesce&&(this._updateWorkerData(),this._coalesce=!1)})}loaded(){return this._loaded}loadTile(d,o){const c=d.actor?"reloadTile":"loadTile";d.actor=this.actor,d.request=this.actor.send(c,{type:this.type,uid:d.uid,tileID:d.tileID,tileZoom:d.tileZoom,zoom:d.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:s.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(f,_)=>(delete d.request,d.unloadVectorData(),d.aborted?o(null):f?o(f):(d.loadVectorData(_,this.map.painter,c==="reloadTile"),o(null))),void 0,c==="loadTile")}abortTile(d){d.request&&(d.request.cancel(),delete d.request),d.aborted=!0}unloadTile(d){d.unloadVectorData(),this.actor.send("removeTile",{uid:d.uid,type:this.type,source:this.id})}onRemove(){this._pendingLoad&&this._pendingLoad.cancel()}serialize(){return s.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}},video:class extends Rt{constructor(d,o,c,f){super(d,o,c,f),this.roundZoom=!0,this.type="video",this.options=o}load(){this._loaded=!1;const d=this.options;this.urls=[];for(const o of d.urls)this.urls.push(this.map._requestManager.transformRequest(o,s.ResourceType.Source).url);s.getVideo(this.urls,(o,c)=>{this._loaded=!0,o?this.fire(new s.ErrorEvent(o)):c&&(this.video=c,this.video.loop=!0,this.video.setAttribute("playsinline",""),this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(d){if(this.video){const o=this.video.seekable;do.end(0)?this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${this.id}`,null,`Playback for this video can be set only between the ${o.start(0)} and ${o.end(0)}-second mark.`))):this.video.currentTime=d}}getVideo(){return this.video}onAdd(d){this.map||(this.map=d,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const d=this.map.painter.context,o=d.gl;this.texture?this.video.paused||(this.texture.bind(o.LINEAR,o.CLAMP_TO_EDGE),o.texSubImage2D(o.TEXTURE_2D,0,0,0,o.RGBA,o.UNSIGNED_BYTE,this.video)):(this.texture=new s.Texture(d,this.video,o.RGBA),this.texture.bind(o.LINEAR,o.CLAMP_TO_EDGE),this.width=this.video.videoWidth,this.height=this.video.videoHeight),this._prepareData(d)}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},image:Rt,canvas:class extends Rt{constructor(d,o,c,f){super(d,o,c,f),o.coordinates?Array.isArray(o.coordinates)&&o.coordinates.length===4&&!o.coordinates.some(_=>!Array.isArray(_)||_.length!==2||_.some(x=>typeof x!="number"))||this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${d}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${d}`,null,'missing required property "coordinates"'))),o.animate&&typeof o.animate!="boolean"&&this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${d}`,null,'optional "animate" property must be a boolean value'))),o.canvas?typeof o.canvas=="string"||o.canvas instanceof s.window.HTMLCanvasElement||this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${d}`,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 s.ErrorEvent(new s.ValidationError(`sources.${d}`,null,'missing required property "canvas"'))),this.options=o,this.animate=o.animate===void 0||o.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof s.window.HTMLCanvasElement?this.options.canvas:s.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new s.ErrorEvent(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(d){this.map=d,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let d=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,d=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,d=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const o=this.map.painter.context;this.texture?(d||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new s.Texture(o,this.canvas,o.gl.RGBA,{premultiply:!0}),this._prepareData(o)}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const d of[this.canvas.width,this.canvas.height])if(isNaN(d)||d<=0)return!0;return!1}},custom:class extends s.Evented{constructor(d,o,c,f){super(),this.id=d,this.type="custom",this._dataType="raster",this._dispatcher=c,this._implementation=o,this.setEventedParent(f),this.scheme="xyz",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this._loaded=!1,this.roundZoom=!0,this._implementation||this.fire(new s.ErrorEvent(new Error(`Missing implementation for ${this.id} custom source`))),this._implementation.loadTile||this.fire(new s.ErrorEvent(new Error(`Missing loadTile implementation for ${this.id} custom source`))),this._implementation.bounds&&(this.tileBounds=new br(this._implementation.bounds,this.minzoom,this.maxzoom)),o.update=this._update.bind(this),o.clearTiles=this._clearTiles.bind(this),o.coveringTiles=this._coveringTiles.bind(this),s.extend(this,s.pick(o,["dataType","scheme","minzoom","maxzoom","tileSize","attribution","minTileCacheSize","maxTileCacheSize"]))}serialize(){return s.pick(this,["type","scheme","minzoom","maxzoom","tileSize","attribution"])}load(){this._loaded=!0,this.fire(new s.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"}))}loaded(){return this._loaded}onAdd(d){this._map=d,this._loaded=!1,this.fire(new s.Event("dataloading",{dataType:"source"})),this._implementation.onAdd&&this._implementation.onAdd(d),this.load()}onRemove(d){this._implementation.onRemove&&this._implementation.onRemove(d)}hasTile(d){if(this._implementation.hasTile){const{x:o,y:c,z:f}=d.canonical;return this._implementation.hasTile({x:o,y:c,z:f})}return!this.tileBounds||this.tileBounds.contains(d.canonical)}loadTile(d,o){const{x:c,y:f,z:_}=d.tileID.canonical,x=new s.window.AbortController;d.request=Promise.resolve(this._implementation.loadTile({x:c,y:f,z:_},{signal:x.signal})).then((function(T){return delete d.request,d.aborted?(d.state="unloaded",o(null)):T===void 0?(d.state="errored",o(null)):T===null?(this.loadTileData(d,{width:this.tileSize,height:this.tileSize,data:null}),d.state="loaded",o(null)):function(S){return S instanceof s.window.ImageData||S instanceof s.window.HTMLCanvasElement||S instanceof s.window.ImageBitmap||S instanceof s.window.HTMLImageElement}(T)?(this.loadTileData(d,T),d.state="loaded",void o(null)):(d.state="errored",o(new Error(`Can't infer data type for ${this.id}, only raster data supported at the moment`)))}).bind(this)).catch(T=>{T.code!==20&&(d.state="errored",o(T))}),d.request.cancel=()=>x.abort()}loadTileData(d,o){Qe.loadTileData(d,o,this._map.painter)}unloadTileData(d){Qe.unloadTileData(d,this._map.painter)}unloadTile(d,o){if(this.unloadTileData(d),this._implementation.unloadTile){const{x:c,y:f,z:_}=d.tileID.canonical;this._implementation.unloadTile({x:c,y:f,z:_})}o()}abortTile(d,o){d.request&&d.request.cancel&&(d.request.cancel(),delete d.request),o()}hasTransition(){return!1}_coveringTiles(){return this._map.transform.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,roundZoom:this.roundZoom}).map(d=>({x:d.canonical.x,y:d.canonical.y,z:d.canonical.z}))}_clearTiles(){this._map.style._clearSource(this.id)}_update(){this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"}))}}},Dt=function(d,o,c,f){const _=new Pt[o.type](d,o,c,f);if(_.id!==d)throw new Error(`Expected Source id to be ${d} instead of ${_.id}`);return s.bindAll(["load","abort","unload","serialize","prepare"],_),_};function Gt(d,o){const c=s.identity([]);return s.scale(c,c,[.5*d.width,.5*-d.height,1]),s.translate(c,c,[1,-1,0]),s.multiply(c,c,d.calculateProjMatrix(o.toUnwrapped())),Float32Array.from(c)}function In(d,o,c,f,_,x,T,S=!1){const C=d.tilesIn(f,T,S);C.sort(Ir);const z=[];for(const O of C)z.push({wrappedTileID:O.tile.tileID.wrapped().key,queryResults:O.tile.queryRenderedFeatures(o,c,d._state,O,_,x,Gt(d.transform,O.tile.tileID),S)});const P=function(O){const j={},W={};for(const H of O){const Z=H.queryResults,X=H.wrappedTileID,B=W[X]=W[X]||{};for(const q in Z){const Q=Z[q],ee=B[q]=B[q]||{},de=j[q]=j[q]||[];for(const fe of Q)ee[fe.featureIndex]||(ee[fe.featureIndex]=!0,de.push(fe))}}return j}(z);for(const O in P)P[O].forEach(j=>{const W=j.feature,H=W.layer;H&&H.type!=="background"&&H.type!=="sky"&&(W.source=H.source,H["source-layer"]&&(W.sourceLayer=H["source-layer"]),W.state=W.id!==void 0?d.getFeatureState(H["source-layer"],W.id):{})});return P}function Vn(d,o){const c=d.getRenderableIds().map(x=>d.getTileByID(x)),f=[],_={};for(let x=0;x{c.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[Ji]}numActive(){return Object.keys(this.active).length}}let Or;function ha(){return Or||(Or=new hr),Or}function G_(d,o){const c={};for(const f in d)f!=="ref"&&(c[f]=d[f]);return s.refProperties.forEach(f=>{f in o&&(c[f]=o[f])}),c}function lf(d){d=d.slice();const o=Object.create(null);for(let c=0;c0?(_-T)/S:0;return this.points[x].mult(1-C).add(this.points[c].mult(C))}}class Is{constructor(o,c,f){const _=this.boxCells=[],x=this.circleCells=[];this.xCellCount=Math.ceil(o/f),this.yCellCount=Math.ceil(c/f);for(let T=0;Tthis.width||_<0||c>this.height)return!x&&[];const S=[];if(o<=0&&c<=0&&this.width<=f&&this.height<=_){if(x)return!0;for(let C=0;C0:S}_queryCircle(o,c,f,_,x){const T=o-f,S=o+f,C=c-f,z=c+f;if(S<0||T>this.width||z<0||C>this.height)return!_&&[];const P=[];return this._forEachCell(T,C,S,z,this._queryCellCircle,P,{hitTest:_,circle:{x:o,y:c,radius:f},seenUids:{box:{},circle:{}}},x),_?P.length>0:P}query(o,c,f,_,x){return this._query(o,c,f,_,!1,x)}hitTest(o,c,f,_,x){return this._query(o,c,f,_,!0,x)}hitTestCircle(o,c,f,_){return this._queryCircle(o,c,f,!0,_)}_queryCell(o,c,f,_,x,T,S,C){const z=S.seenUids,P=this.boxCells[x];if(P!==null){const j=this.bboxes;for(const W of P)if(!z.box[W]){z.box[W]=!0;const H=4*W;if(o<=j[H+2]&&c<=j[H+3]&&f>=j[H+0]&&_>=j[H+1]&&(!C||C(this.boxKeys[W]))){if(S.hitTest)return T.push(!0),!0;T.push({key:this.boxKeys[W],x1:j[H],y1:j[H+1],x2:j[H+2],y2:j[H+3]})}}}const O=this.circleCells[x];if(O!==null){const j=this.circles;for(const W of O)if(!z.circle[W]){z.circle[W]=!0;const H=3*W;if(this._circleAndRectCollide(j[H],j[H+1],j[H+2],o,c,f,_)&&(!C||C(this.circleKeys[W]))){if(S.hitTest)return T.push(!0),!0;{const Z=j[H],X=j[H+1],B=j[H+2];T.push({key:this.circleKeys[W],x1:Z-B,y1:X-B,x2:Z+B,y2:X+B})}}}}}_queryCellCircle(o,c,f,_,x,T,S,C){const z=S.circle,P=S.seenUids,O=this.boxCells[x];if(O!==null){const W=this.bboxes;for(const H of O)if(!P.box[H]){P.box[H]=!0;const Z=4*H;if(this._circleAndRectCollide(z.x,z.y,z.radius,W[Z+0],W[Z+1],W[Z+2],W[Z+3])&&(!C||C(this.boxKeys[H])))return T.push(!0),!0}}const j=this.circleCells[x];if(j!==null){const W=this.circles;for(const H of j)if(!P.circle[H]){P.circle[H]=!0;const Z=3*H;if(this._circlesCollide(W[Z],W[Z+1],W[Z+2],z.x,z.y,z.radius)&&(!C||C(this.circleKeys[H])))return T.push(!0),!0}}}_forEachCell(o,c,f,_,x,T,S,C){const z=this._convertToXCellCoord(o),P=this._convertToYCellCoord(c),O=this._convertToXCellCoord(f),j=this._convertToYCellCoord(_);for(let W=z;W<=O;W++)for(let H=P;H<=j;H++)if(x.call(this,o,c,f,_,this.xCellCount*H+W,T,S,C))return}_convertToXCellCoord(o){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(o*this.xScale)))}_convertToYCellCoord(o){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(o*this.yScale)))}_circlesCollide(o,c,f,_,x,T){const S=_-o,C=x-c,z=f+T;return z*z>S*S+C*C}_circleAndRectCollide(o,c,f,_,x,T,S){const C=(T-_)/2,z=Math.abs(o-(_+C));if(z>C+f)return!1;const P=(S-x)/2,O=Math.abs(c-(x+P));if(O>P+f)return!1;if(z<=C||O<=P)return!0;const j=z-C,W=O-P;return j*j+W*W<=f*f}}const wo={unknown:0,flipRequired:1,flipNotRequired:2},vl=Math.tan(85*Math.PI/180);function Re(d,o,c,f,_,x,T){const S=s.create();if(c)if(x.name==="globe"){const C=s.calculateGlobeLabelMatrix(_,o);s.multiply(S,S,C)}else{const C=Ve([],T);S[0]=C[0],S[1]=C[1],S[4]=C[2],S[5]=C[3],f||s.rotateZ(S,S,_.angle)}else s.multiply(S,_.labelPlaneMatrix,d);return S}function bo(d,o,c,f,_,x,T){const S=Re(d,o,c,f,_,x,T);return x.name==="globe"&&c||(S[2]=S[6]=S[10]=S[14]=0),S}function $n(d,o,c,f,_,x,T){if(c){if(x.name==="globe"){const S=Re(d,o,c,f,_,x,T);return s.invert(S,S),s.multiply(S,d,S),S}{const S=s.clone(d),C=s.identity([]);return C[0]=T[0],C[1]=T[1],C[4]=T[2],C[5]=T[3],s.multiply(S,S,C),f||s.rotateZ(S,S,-_.angle),S}}return _.glCoordMatrix}function dr(d,o,c,f){const _=[d,o,c,1];c?s.transformMat4$1(_,_,f):Nt(_,_,f);const x=_[3];return _[0]/=x,_[1]/=x,_[2]/=x,_}function cf(d,o){return Math.min(.5+d/o*.5,1.5)}function eo(d,o){const c=d[0]/d[3],f=d[1]/d[3];return c>=-o[0]&&c<=o[0]&&f>=-o[1]&&f<=o[1]}function Sh(d,o,c,f,_,x,T,S,C,z){const P=c.transform,O=f?d.textSizeData:d.iconSizeData,j=s.evaluateSizeForZoom(O,c.transform.zoom),W=P.projection.name==="globe",H=[256/c.width*2+1,256/c.height*2+1],Z=f?d.text.dynamicLayoutVertexArray:d.icon.dynamicLayoutVertexArray;Z.clear();let X=null;W&&(X=f?d.text.globeExtVertexArray:d.icon.globeExtVertexArray);const B=d.lineVertexArray,q=f?d.text.placedSymbolArray:d.icon.placedSymbolArray,Q=c.transform.width/c.transform.height;let ee,de=!1;for(let fe=0;feMath.abs(c)?{useVertical:!0}:d===s.WritingMode.vertical?f>0?{needsFlipping:!0}:null:o!==wo.unknown&&function(_,x){return _===0||Math.abs(x/_)>vl}(c,f)?o===wo.flipRequired?{needsFlipping:!0}:null:c<0?{needsFlipping:!0}:null}function lt(d,o,c,f,_,x,T,S,C,z,P,O,j,W,H,Z,X,B,q){const Q=o/24,ee=d.lineOffsetX*Q,de=d.lineOffsetY*Q,{lineStartIndex:fe,glyphStartIndex:pe,numGlyphs:xe,segment:ye,writingMode:Ae,flipState:We}=d,Ee=fe+d.lineLength,Fe=ke=>{if(P){const[Xe,$e,Ye]=ke.up,gt=z.length;s.updateGlobeVertexNormal(P,gt+0,Xe,$e,Ye),s.updateGlobeVertexNormal(P,gt+1,Xe,$e,Ye),s.updateGlobeVertexNormal(P,gt+2,Xe,$e,Ye),s.updateGlobeVertexNormal(P,gt+3,Xe,$e,Ye)}const[qe,Se,Be]=ke.point;s.addDynamicAttributes(z,qe,Se,Be,ke.angle)};if(xe>1){const ke=uf(Q,S,ee,de,c,O,j,d,C,x,W,Z,!1,X,B,q);if(!ke)return{notEnoughRoom:!0};if(f&&!c){let[qe,Se,Be]=ke.first.point,[Xe,$e,Ye]=ke.last.point;[qe,Se]=dr(qe,Se,Be,T),[Xe,$e]=dr(Xe,$e,Ye,T);const gt=da(Ae,We,(Xe-qe)*H,$e-Se);if(d.flipState=gt&>.needsFlipping?wo.flipRequired:wo.flipNotRequired,gt)return gt}Fe(ke.first);for(let qe=pe+1;qe0?Xe:Ft(j,Be,qe,1,_,void 0,X,B.canonical),Ye=da(Ae,We,($e[0]-qe[0])*H,$e[1]-qe[1]);if(d.flipState=Ye&&Ye.needsFlipping?wo.flipRequired:wo.flipNotRequired,Ye)return Ye}const ke=si(Q*S.getoffsetX(pe),ee,de,c,O,j,ye,fe,Ee,C,x,W,Z,!1,!1,X,B,q);if(!ke)return{notEnoughRoom:!0};Fe(ke)}return{}}function $t(d,o,c,f,_){const{x,y:T,z:S}=f.projectTilePoint(d.x,d.y,o);if(!_)return dr(x,T,S,c);const[C,z,P]=_(d);return dr(x+C,T+z,S+P,c)}function Ft(d,o,c,f,_,x,T,S){const C=$t(d.sub(o)._unit()._add(d),S,_,T,x);return s.sub(C,c,C),s.normalize(C,C),s.scaleAndAdd(C,c,C,f)}function si(d,o,c,f,_,x,T,S,C,z,P,O,j,W,H,Z,X,B){const q=f?d-o:d+o;let Q=q>0?1:-1,ee=0;f&&(Q*=-1,ee=Math.PI),Q<0&&(ee+=Math.PI);let de=S+T+(Q>0?0:1)|0,fe=_,pe=_,xe=0,ye=0;const Ae=Math.abs(q),We=[],Ee=[];let Fe=x,ke=Fe;const qe=()=>Ft(ke,Fe,pe,Ae-xe+1,P,j,Z,X.canonical);for(;xe+ye<=Ae;){if(de+=Q,de=C)return null;if(pe=fe,ke=Fe,We.push(pe),W&&Ee.push(ke),Fe=new s.Point(z.getx(de),z.gety(de)),fe=O[de],!fe){const wt=$t(Fe,X.canonical,P,Z,j);fe=wt[3]>0?O[de]=wt:qe()}xe+=ye,ye=s.distance(pe,fe)}H&&j&&(O[de]&&(fe=qe(),ye=s.distance(pe,fe)),O[de]=fe);const Se=(Ae-xe)/ye,Be=Fe.sub(ke)._mult(Se)._add(ke),Xe=s.sub([],fe,pe),$e=s.scaleAndAdd([],pe,Xe,Se);let Ye=[0,0,1],gt=Xe[0],Et=Xe[1];if(B&&(Ye=Z.upVector(X.canonical,Be.x,Be.y),Ye[0]!==0||Ye[1]!==0||Ye[2]!==1)){const wt=[Ye[2],0,-Ye[0]],Ut=s.cross([],Ye,wt);s.normalize(wt,wt),s.normalize(Ut,Ut),gt=s.dot(Xe,wt),Et=s.dot(Xe,Ut)}if(c){const wt=s.cross([],Ye,Xe);s.normalize(wt,wt),s.scaleAndAdd($e,$e,wt,c*Q)}const pt=ee+Math.atan2(Et,gt);return We.push($e),W&&Ee.push(Be),{point:$e,angle:pt,path:We,tilePath:Ee,up:Ye}}function Ri(d,o){const c=o.length,f=c+4*d;o.resize(f),o.float32.fill(-1/0,4*c,4*f)}function Nt(d,o,c){const f=o[0],_=o[1];return d[0]=c[0]*f+c[4]*_+c[12],d[1]=c[1]*f+c[5]*_+c[13],d[3]=c[3]*f+c[7]*_+c[15],d}const ai=100;class xl{constructor(o,c,f=new Is(o.width+200,o.height+200,25),_=new Is(o.width+200,o.height+200,25)){this.transform=o,this.grid=f,this.ignoredGrid=_,this.pitchfactor=Math.cos(o._pitch)*o.cameraToCenterDistance,this.screenRightBoundary=o.width+ai,this.screenBottomBoundary=o.height+ai,this.gridRightBoundary=o.width+200,this.gridBottomBoundary=o.height+200,this.fogState=c}placeCollisionBox(o,c,f,_,x,T,S,C){let z=f.projectedAnchorX,P=f.projectedAnchorY,O=f.projectedAnchorZ;const j=f.elevation,W=f.tileID,H=o.getProjection();if(j&&W){const[fe,pe,xe]=H.upVector(W.canonical,f.tileAnchorX,f.tileAnchorY),ye=H.upVectorScale(W.canonical,this.transform.center.lat,this.transform.worldSize).metersToTile;z+=fe*j*ye,P+=pe*j*ye,O+=xe*j*ye}const Z=this.projectAndGetPerspectiveRatio(S,z,P,O,f.tileID,H.name==="globe"||!!j||this.transform.pitch>0,H),X=T*Z.perspectiveRatio,B=(f.x1*c+_.x-f.padding)*X+Z.point.x,q=(f.y1*c+_.y-f.padding)*X+Z.point.y,Q=(f.x2*c+_.x+f.padding)*X+Z.point.x,ee=(f.y2*c+_.y+f.padding)*X+Z.point.y,de=Z.perspectiveRatio<=.55||Z.occluded;return!this.isInsideGrid(B,q,Q,ee)||!x&&this.grid.hitTest(B,q,Q,ee,C)||de?{box:[],offscreen:!1,occluded:Z.occluded}:{box:[B,q,Q,ee],offscreen:this.isOffscreen(B,q,Q,ee),occluded:!1}}placeCollisionCircles(o,c,f,_,x,T,S,C,z,P,O,j,W,H,Z){const X=[],B=this.transform.elevation,q=o.getProjection(),Q=B?B.getAtTileOffsetFunc(Z,this.transform.center.lat,this.transform.worldSize,q):null,ee=new s.Point(f.tileAnchorX,f.tileAnchorY);let{x:de,y:fe,z:pe}=q.projectTilePoint(ee.x,ee.y,Z.canonical);if(Q){const[Be,Xe,$e]=Q(ee);de+=Be,fe+=Xe,pe+=$e}const xe=q.name==="globe",ye=this.projectAndGetPerspectiveRatio(S,de,fe,pe,Z,xe||!!B||this.transform.pitch>0,q),{perspectiveRatio:Ae}=ye,We=(O?T/Ae:T*Ae)/s.ONE_EM,Ee=dr(de,fe,pe,C),Fe=ye.signedDistanceFromCamera>0?uf(We,x,f.lineOffsetX*We,f.lineOffsetY*We,!1,Ee,ee,f,_,C,{},B&&!O?Q:null,O&&!!B,q,Z,O):null;let ke=!1,qe=!1,Se=!0;if(Fe&&!ye.occluded){const Be=.5*W*Ae+H,Xe=new s.Point(-100,-100),$e=new s.Point(this.screenRightBoundary,this.screenBottomBoundary),Ye=new Th,{first:gt,last:Et}=Fe,pt=gt.path.length;let wt=[];for(let mt=pt-1;mt>=1;mt--)wt.push(gt.path[mt]);for(let mt=1;mt(Q&&!xe&&(rn=Q(onmt[3]<=0)&&(wt=[]));let Ot=[];if(wt.length>0){let mt=1/0,en=-1/0,rn=1/0,on=-1/0;for(const sn of wt)mt=Math.min(mt,sn[0]),rn=Math.min(rn,sn[1]),en=Math.max(en,sn[0]),on=Math.max(on,sn[1]);en>=Xe.x&&mt<=$e.x&&on>=Xe.y&&rn<=$e.y&&(Ot=[wt.map(sn=>new s.Point(sn[0],sn[1]))],(mt$e.x||rn$e.y)&&(Ot=s.clipLine(Ot,Xe.x,Xe.y,$e.x,$e.y)))}for(const mt of Ot){Ye.reset(mt,.25*Be);let en=0;en=Ye.length<=.5*Be?1:Math.ceil(Ye.paddedLength/Ut)+1;for(let rn=0;rn0?(s.transformMat4$1(C,C,o),this.fogState&&x&&S.name!=="globe"&&(z=function(j,W,H,Z,X,B){const q=B.calculateFogTileMatrix(X),Q=[W,H,Z];return s.transformMat4(Q,Q,q),Li(j,Q,B.pitch,B._fov)}(this.fogState,c,f,_,x.toUnwrapped(),this.transform)>.9)):Nt(C,C,o);const P=C[3];return{point:new s.Point((C[0]/P+1)/2*this.transform.width+ai,(-C[1]/P+1)/2*this.transform.height+ai),perspectiveRatio:Math.min(.5+this.transform.getCameraToCenterDistance(S)/P*.5,1.5),signedDistanceFromCamera:P,occluded:T&&C[2]>P||z}}isOffscreen(o,c,f,_){return f=this.screenRightBoundary||_this.screenBottomBoundary}isInsideGrid(o,c,f,_){return f>=0&&o=0&&cf.collisionGroupID===c}}return this.collisionGroups[o]}}function El(d,o,c,f,_){const{horizontalAlign:x,verticalAlign:T}=s.getAnchorAlignment(d),S=-(x-.5)*o,C=-(T-.5)*c,z=s.evaluateVariableOffset(d,f);return new s.Point(S+z[0]*_,C+z[1]*_)}function Tl(d,o,c,f,_){const x=new s.Point(d,o);return c&&x._rotate(f?_:-_),x}class kc{constructor(o,c,f,_,x){this.transform=o.clone(),this.projection=o.projection.name,this.collisionIndex=new xl(this.transform,x),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=c,this.retainedQueryData={},this.collisionGroups=new df(f),this.collisionCircleArrays={},this.prevPlacement=_,_&&(_.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(o,c,f,_){const x=f.getBucket(c),T=f.latestFeatureIndex;if(!x||!T||c.id!==x.layerIds[0])return;const S=x.layers[0].layout,C=f.collisionBoxArray,z=Math.pow(2,this.transform.zoom-f.tileID.overscaledZ),P=f.tileSize/s.EXTENT,O=f.tileID.toUnwrapped();this.transform.setProjection(x.projection);const j=(W=f.tileID,H=x.getProjection(),Z=this.transform,H.name===this.projection?Z.calculateProjMatrix(W.toUnwrapped()):ks(Z,H,W));var W,H,Z;const X=S.get("text-pitch-alignment")==="map",B=S.get("text-rotation-alignment")==="map";c.compileFilter();const q=c.dynamicFilter(),Q=c.dynamicFilterNeedsFeature(),ee=this.transform.calculatePixelsToTileUnitsMatrix(f),de=bo(j,f.tileID.canonical,X,B,this.transform,x.getProjection(),ee);let fe=null;if(X){const ye=$n(j,f.tileID.canonical,X,B,this.transform,x.getProjection(),ee);fe=s.multiply([],this.transform.labelPlaneMatrix,ye)}let pe=null;q&&f.latestFeatureIndex&&(pe={unwrappedTileID:O,dynamicFilter:q,dynamicFilterNeedsFeature:Q,featureIndex:f.latestFeatureIndex}),this.retainedQueryData[x.bucketInstanceId]=new Ah(x.bucketInstanceId,T,x.sourceLayerIndex,x.index,f.tileID);const xe={bucket:x,layout:S,posMatrix:j,textLabelPlaneMatrix:de,labelToScreenMatrix:fe,clippingData:pe,scale:z,textPixelRatio:P,holdingForFade:f.holdingForFade(),collisionBoxArray:C,partiallyEvaluatedTextSize:s.evaluateSizeForZoom(x.textSizeData,this.transform.zoom),partiallyEvaluatedIconSize:s.evaluateSizeForZoom(x.iconSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(x.sourceID)};if(_)for(const ye of x.sortKeyRanges){const{sortKey:Ae,symbolInstanceStart:We,symbolInstanceEnd:Ee}=ye;o.push({sortKey:Ae,symbolInstanceStart:We,symbolInstanceEnd:Ee,parameters:xe})}else o.push({symbolInstanceStart:0,symbolInstanceEnd:x.symbolInstances.length,parameters:xe})}attemptAnchorPlacement(o,c,f,_,x,T,S,C,z,P,O,j,W,H,Z,X,B,q){const{textOffset0:Q,textOffset1:ee,crossTileID:de}=j,fe=[Q,ee],pe=El(o,f,_,fe,x),xe=this.collisionIndex.placeCollisionBox(H,x,c,Tl(pe.x,pe.y,T,S,this.transform.angle),O,C,z,P.predicate);if(X){const ye=H.getSymbolInstanceIconSize(q,this.transform.zoom,j.placedIconSymbolIndex);if(this.collisionIndex.placeCollisionBox(H,ye,X,Tl(pe.x,pe.y,T,S,this.transform.angle),O,C,z,P.predicate).box.length===0)return}if(xe.box.length>0){let ye;return this.prevPlacement&&this.prevPlacement.variableOffsets[de]&&this.prevPlacement.placements[de]&&this.prevPlacement.placements[de].text&&(ye=this.prevPlacement.variableOffsets[de].anchor),this.variableOffsets[de]={textOffset:fe,width:f,height:_,anchor:o,textScale:x,prevAnchor:ye},this.markUsedJustification(H,o,j,Z),H.allowVerticalPlacement&&(this.markUsedOrientation(H,Z,j),this.placedOrientations[de]=Z),{shift:pe,placedGlyphBoxes:xe}}}placeLayerBucketPart(o,c,f,_){const{bucket:x,layout:T,posMatrix:S,textLabelPlaneMatrix:C,labelToScreenMatrix:z,clippingData:P,textPixelRatio:O,holdingForFade:j,collisionBoxArray:W,partiallyEvaluatedTextSize:H,partiallyEvaluatedIconSize:Z,collisionGroup:X}=o.parameters,B=T.get("text-optional"),q=T.get("icon-optional"),Q=T.get("text-allow-overlap"),ee=T.get("icon-allow-overlap"),de=T.get("text-rotation-alignment")==="map",fe=T.get("text-pitch-alignment")==="map",pe=T.get("icon-text-fit")!=="none",xe=T.get("symbol-z-order")==="viewport-y";this.transform.setProjection(x.projection);let ye=Q&&(ee||!x.hasIconData()||q),Ae=ee&&(Q||!x.hasTextData()||B);!x.collisionArrays&&W&&x.deserializeCollisionBoxes(W),f&&_&&x.updateCollisionDebugBuffers(this.transform.zoom,W);const We=(Ee,Fe,ke)=>{const{crossTileID:qe,numVerticalGlyphVertices:Se}=Ee;if(P){const An={zoom:this.transform.zoom,pitch:this.transform.pitch};let an=null;if(P.dynamicFilterNeedsFeature){const Xt=this.retainedQueryData[x.bucketInstanceId];an=P.featureIndex.loadFeature({featureIndex:Ee.featureIndex,bucketIndex:Xt.bucketIndex,sourceLayerIndex:Xt.sourceLayerIndex,layoutVertexArrayOffset:0})}if(!(0,P.dynamicFilter)(An,an,this.retainedQueryData[x.bucketInstanceId].tileID.canonical,new s.Point(Ee.tileAnchorX,Ee.tileAnchorY),this.transform.calculateDistanceTileData(P.unwrappedTileID)))return this.placements[qe]=new wl(!1,!1,!1,!0),void c.add(qe)}if(c.has(qe))return;if(j)return void(this.placements[qe]=new wl(!1,!1,!1));let Be=!1,Xe=!1,$e=!0,Ye=!1,gt=!1,Et=null,pt={box:null,offscreen:null,occluded:null},wt={box:null,offscreen:null,occluded:null},Ut=null,Ot=null,mt=null,en=0,rn=0,on=0;ke.textFeatureIndex?en=ke.textFeatureIndex:Ee.useRuntimeCollisionCircles&&(en=Ee.featureIndex),ke.verticalTextFeatureIndex&&(rn=ke.verticalTextFeatureIndex);const sn=An=>{An.tileID=this.retainedQueryData[x.bucketInstanceId].tileID;const an=this.transform.elevation;(an||An.elevation)&&(An.elevation=an?an.getAtTileOffset(An.tileID,An.tileAnchorX,An.tileAnchorY):0)},Mr=ke.textBox;if(Mr){sn(Mr);const An=Xt=>{let Gn=s.WritingMode.horizontal;if(x.allowVerticalPlacement&&!Xt&&this.prevPlacement){const Br=this.prevPlacement.placedOrientations[qe];Br&&(this.placedOrientations[qe]=Br,Gn=Br,this.markUsedOrientation(x,Gn,Ee))}return Gn},an=(Xt,Gn)=>{if(x.allowVerticalPlacement&&Se>0&&ke.verticalTextBox){for(const Br of x.writingModes)if(Br===s.WritingMode.vertical?(pt=Gn(),wt=pt):pt=Xt(),pt&&pt.box&&pt.box.length)break}else pt=Xt()};if(T.get("text-variable-anchor")){let Xt=T.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[qe]){const En=this.prevPlacement.variableOffsets[qe];Xt.indexOf(En.anchor)>0&&(Xt=Xt.filter(Wr=>Wr!==En.anchor),Xt.unshift(En.anchor))}const Gn=(En,Wr,nu)=>{const Bs=x.getSymbolInstanceTextSize(H,Ee,this.transform.zoom,Fe),Gl=(En.x2-En.x1)*Bs+2*En.padding,Mo=(En.y2-En.y1)*Bs+2*En.padding,is=pe&&!ee?Wr:null;is&&sn(is);let Fs={box:[],offscreen:!1,occluded:!1};const ru=Q?2*Xt.length:Xt.length;for(let ql=0;ql=Xt.length,Ee,Fe,x,nu,is,H,Z);if(gd&&(Fs=gd.placedGlyphBoxes,Fs&&Fs.box&&Fs.box.length)){Be=!0,Et=gd.shift;break}}return Fs};an(()=>Gn(Mr,ke.iconBox,s.WritingMode.horizontal),()=>{const En=ke.verticalTextBox;return En&&sn(En),x.allowVerticalPlacement&&!(pt&&pt.box&&pt.box.length)&&Se>0&&En?Gn(En,ke.verticalIconBox,s.WritingMode.vertical):{box:null,offscreen:null,occluded:null}}),pt&&(Be=pt.box,$e=pt.offscreen,Ye=pt.occluded);const Br=An(!(!pt||!pt.box));if(!Be&&this.prevPlacement){const En=this.prevPlacement.variableOffsets[qe];En&&(this.variableOffsets[qe]=En,this.markUsedJustification(x,En.anchor,Ee,Br))}}else{const Xt=(Gn,Br)=>{const En=x.getSymbolInstanceTextSize(H,Ee,this.transform.zoom,Fe),Wr=this.collisionIndex.placeCollisionBox(x,En,Gn,new s.Point(0,0),Q,O,S,X.predicate);return Wr&&Wr.box&&Wr.box.length&&(this.markUsedOrientation(x,Br,Ee),this.placedOrientations[qe]=Br),Wr};an(()=>Xt(Mr,s.WritingMode.horizontal),()=>{const Gn=ke.verticalTextBox;return x.allowVerticalPlacement&&Se>0&&Gn?(sn(Gn),Xt(Gn,s.WritingMode.vertical)):{box:null,offscreen:null,occluded:null}}),An(!!(pt&&pt.box&&pt.box.length))}}if(Ut=pt,Be=Ut&&Ut.box&&Ut.box.length>0,$e=Ut&&Ut.offscreen,Ye=Ut&&Ut.occluded,Ee.useRuntimeCollisionCircles){const An=x.text.placedSymbolArray.get(Ee.centerJustifiedTextSymbolIndex>=0?Ee.centerJustifiedTextSymbolIndex:Ee.verticalPlacedTextSymbolIndex),an=s.evaluateSizeForFeature(x.textSizeData,H,An),Xt=T.get("text-padding");Ot=this.collisionIndex.placeCollisionCircles(x,Q,An,x.lineVertexArray,x.glyphOffsetArray,an,S,C,z,f,fe,X.predicate,Ee.collisionCircleDiameter*an/s.ONE_EM,Xt,this.retainedQueryData[x.bucketInstanceId].tileID),Be=Q||Ot.circles.length>0&&!Ot.collisionDetected,$e=$e&&Ot.offscreen,Ye=Ot.occluded}if(ke.iconFeatureIndex&&(on=ke.iconFeatureIndex),ke.iconBox){const An=an=>{sn(an);const Xt=pe&&Et?Tl(Et.x,Et.y,de,fe,this.transform.angle):new s.Point(0,0),Gn=x.getSymbolInstanceIconSize(Z,this.transform.zoom,Ee.placedIconSymbolIndex);return this.collisionIndex.placeCollisionBox(x,Gn,an,Xt,ee,O,S,X.predicate)};wt&&wt.box&&wt.box.length&&ke.verticalIconBox?(mt=An(ke.verticalIconBox),Xe=mt.box.length>0):(mt=An(ke.iconBox),Xe=mt.box.length>0),$e=$e&&mt.offscreen,gt=mt.occluded}const fr=B||Ee.numHorizontalGlyphVertices===0&&Se===0,vi=q||Ee.numIconVertices===0;if(fr||vi?vi?fr||(Xe=Xe&&Be):Be=Xe&&Be:Xe=Be=Xe&&Be,Be&&Ut&&Ut.box&&this.collisionIndex.insertCollisionBox(Ut.box,T.get("text-ignore-placement"),x.bucketInstanceId,wt&&wt.box&&rn?rn:en,X.ID),Xe&&mt&&this.collisionIndex.insertCollisionBox(mt.box,T.get("icon-ignore-placement"),x.bucketInstanceId,on,X.ID),Ot&&(Be&&this.collisionIndex.insertCollisionCircles(Ot.circles,T.get("text-ignore-placement"),x.bucketInstanceId,en,X.ID),f)){const An=x.bucketInstanceId;let an=this.collisionCircleArrays[An];an===void 0&&(an=this.collisionCircleArrays[An]=new bl);for(let Xt=0;Xt=0;--Fe){const ke=Ee[Fe];We(x.symbolInstances.get(ke),ke,x.collisionArrays[ke])}}else for(let Ee=o.symbolInstanceStart;Ee=0&&(o.text.placedSymbolArray.get(x).crossTileID=O>=0&&x!==O?0:z),T>=0&&(o.text.placedSymbolArray.get(T).crossTileID=O>=0&&T!==O?0:z),S>=0&&(o.text.placedSymbolArray.get(S).crossTileID=O>=0&&S!==O?0:z),C>=0&&(o.text.placedSymbolArray.get(C).crossTileID=O>=0&&C!==O?0:z)}markUsedOrientation(o,c,f){const _=c===s.WritingMode.horizontal||c===s.WritingMode.horizontalOnly?c:0,x=c===s.WritingMode.vertical?c:0,{leftJustifiedTextSymbolIndex:T,centerJustifiedTextSymbolIndex:S,rightJustifiedTextSymbolIndex:C,verticalPlacedTextSymbolIndex:z}=f,P=o.text.placedSymbolArray;T>=0&&(P.get(T).placedOrientation=_),S>=0&&(P.get(S).placedOrientation=_),C>=0&&(P.get(C).placedOrientation=_),z>=0&&(P.get(z).placedOrientation=x)}commit(o){this.commitTime=o,this.zoomAtLastRecencyCheck=this.transform.zoom;const c=this.prevPlacement;let f=!1;this.prevZoomAdjustment=c?c.zoomAdjustment(this.transform.zoom):0;const _=c?c.symbolFadeChange(o):1,x=c?c.opacities:{},T=c?c.variableOffsets:{},S=c?c.placedOrientations:{};for(const C in this.placements){const z=this.placements[C],P=x[C];P?(this.opacities[C]=new Eo(P,_,z.text,z.icon,null,z.clipped),f=f||z.text!==P.text.placed||z.icon!==P.icon.placed):(this.opacities[C]=new Eo(null,_,z.text,z.icon,z.skipFade,z.clipped),f=f||z.text||z.icon)}for(const C in x){const z=x[C];if(!this.opacities[C]){const P=new Eo(z,_,!1,!1);P.isHidden()||(this.opacities[C]=P,f=f||z.text.placed||z.icon.placed)}}for(const C in T)this.variableOffsets[C]||!this.opacities[C]||this.opacities[C].isHidden()||(this.variableOffsets[C]=T[C]);for(const C in S)this.placedOrientations[C]||!this.opacities[C]||this.opacities[C].isHidden()||(this.placedOrientations[C]=S[C]);f?this.lastPlacementChangeTime=o:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=c?c.lastPlacementChangeTime:o)}updateLayerOpacities(o,c){const f=new Set;for(const _ of c){const x=_.getBucket(o);x&&_.latestFeatureIndex&&o.id===x.layerIds[0]&&this.updateBucketOpacities(x,f,_.collisionBoxArray)}}updateBucketOpacities(o,c,f){o.hasTextData()&&o.text.opacityVertexArray.clear(),o.hasIconData()&&o.icon.opacityVertexArray.clear(),o.hasIconCollisionBoxData()&&o.iconCollisionBox.collisionVertexArray.clear(),o.hasTextCollisionBoxData()&&o.textCollisionBox.collisionVertexArray.clear();const _=o.layers[0].layout,x=!!o.layers[0].dynamicFilter(),T=new Eo(null,0,!1,!1,!0),S=_.get("text-allow-overlap"),C=_.get("icon-allow-overlap"),z=_.get("text-variable-anchor"),P=_.get("text-rotation-alignment")==="map",O=_.get("text-pitch-alignment")==="map",j=_.get("icon-text-fit")!=="none",W=new Eo(null,0,S&&(C||!o.hasIconData()||_.get("icon-optional")),C&&(S||!o.hasTextData()||_.get("text-optional")),!0);!o.collisionArrays&&f&&(o.hasIconCollisionBoxData()||o.hasTextCollisionBoxData())&&o.deserializeCollisionBoxes(f);const H=(X,B,q)=>{for(let Q=0;Q0||Q>0,ye=de>0,Ae=this.placedOrientations[ee],We=Ae===s.WritingMode.vertical,Ee=Ae===s.WritingMode.horizontal||Ae===s.WritingMode.horizontalOnly;if(!xe&&!ye||pe.isHidden()||Z++,xe){const Fe=Sl(pe.text);H(o.text,q,We?Ln:Fe),H(o.text,Q,Ee?Ln:Fe);const ke=pe.text.isHidden(),{leftJustifiedTextSymbolIndex:qe,centerJustifiedTextSymbolIndex:Se,rightJustifiedTextSymbolIndex:Be,verticalPlacedTextSymbolIndex:Xe}=B,$e=o.text.placedSymbolArray,Ye=ke||We?1:0;qe>=0&&($e.get(qe).hidden=Ye),Se>=0&&($e.get(Se).hidden=Ye),Be>=0&&($e.get(Be).hidden=Ye),Xe>=0&&($e.get(Xe).hidden=ke||Ee?1:0);const gt=this.variableOffsets[ee];gt&&this.markUsedJustification(o,gt.anchor,B,Ae);const Et=this.placedOrientations[ee];Et&&(this.markUsedJustification(o,"left",B,Et),this.markUsedOrientation(o,Et,B))}if(ye){const Fe=Sl(pe.icon),{placedIconSymbolIndex:ke,verticalPlacedIconSymbolIndex:qe}=B,Se=o.icon.placedSymbolArray,Be=pe.icon.isHidden()?1:0;ke>=0&&(H(o.icon,de,We?Ln:Fe),Se.get(ke).hidden=Be),qe>=0&&(H(o.icon,B.numVerticalIconVertices,Ee?Ln:Fe),Se.get(qe).hidden=Be)}if(o.hasIconCollisionBoxData()||o.hasTextCollisionBoxData()){const Fe=o.collisionArrays[X];if(Fe){let ke=new s.Point(0,0),qe=!0;if(Fe.textBox||Fe.verticalTextBox){if(z){const Be=this.variableOffsets[ee];Be?(ke=El(Be.anchor,Be.width,Be.height,Be.textOffset,Be.textScale),P&&ke._rotate(O?this.transform.angle:-this.transform.angle)):qe=!1}x&&(qe=!pe.clipped),Fe.textBox&&pa(o.textCollisionBox.collisionVertexArray,pe.text.placed,!qe||We,ke.x,ke.y),Fe.verticalTextBox&&pa(o.textCollisionBox.collisionVertexArray,pe.text.placed,!qe||Ee,ke.x,ke.y)}const Se=qe&&!!(!Ee&&Fe.verticalIconBox);Fe.iconBox&&pa(o.iconCollisionBox.collisionVertexArray,pe.icon.placed,Se,j?ke.x:0,j?ke.y:0),Fe.verticalIconBox&&pa(o.iconCollisionBox.collisionVertexArray,pe.icon.placed,!Se,j?ke.x:0,j?ke.y:0)}}}if(o.fullyClipped=Z===0,o.sortFeatures(this.transform.angle),this.retainedQueryData[o.bucketInstanceId]&&(this.retainedQueryData[o.bucketInstanceId].featureSortOrder=o.featureSortOrder),o.hasTextData()&&o.text.opacityVertexBuffer&&o.text.opacityVertexBuffer.updateData(o.text.opacityVertexArray),o.hasIconData()&&o.icon.opacityVertexBuffer&&o.icon.opacityVertexBuffer.updateData(o.icon.opacityVertexArray),o.hasIconCollisionBoxData()&&o.iconCollisionBox.collisionVertexBuffer&&o.iconCollisionBox.collisionVertexBuffer.updateData(o.iconCollisionBox.collisionVertexArray),o.hasTextCollisionBoxData()&&o.textCollisionBox.collisionVertexBuffer&&o.textCollisionBox.collisionVertexBuffer.updateData(o.textCollisionBox.collisionVertexArray),o.bucketInstanceId in this.collisionCircleArrays){const X=this.collisionCircleArrays[o.bucketInstanceId];o.placementInvProjMatrix=X.invProjMatrix,o.placementViewportMatrix=X.viewportMatrix,o.collisionCircleArray=X.circles,delete this.collisionCircleArrays[o.bucketInstanceId]}}symbolFadeChange(o){return this.fadeDuration===0?1:(o-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(o){return Math.max(0,(this.transform.zoom-o)/1.5)}hasTransitions(o){return this.stale||o-this.lastPlacementChangeTimeo}setStale(){this.stale=!0}}function pa(d,o,c,f,_){d.emplaceBack(o?1:0,c?1:0,f||0,_||0),d.emplaceBack(o?1:0,c?1:0,f||0,_||0),d.emplaceBack(o?1:0,c?1:0,f||0,_||0),d.emplaceBack(o?1:0,c?1:0,f||0,_||0)}const Gr=Math.pow(2,25),Fn=Math.pow(2,24),Ch=Math.pow(2,17),Ih=Math.pow(2,16),qr=Math.pow(2,9),gi=Math.pow(2,8),pf=Math.pow(2,1);function Sl(d){if(d.opacity===0&&!d.placed)return 0;if(d.opacity===1&&d.placed)return 4294967295;const o=d.placed?1:0,c=Math.floor(127*d.opacity);return c*Gr+o*Fn+c*Ch+o*Ih+c*qr+o*gi+c*pf+o}const Ln=0;class Al{constructor(o){this._sortAcrossTiles=o.layout.get("symbol-z-order")!=="viewport-y"&&o.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs=new Set,this._bucketParts=[]}continuePlacement(o,c,f,_,x){const T=this._bucketParts;for(;this._currentTileIndexS.sortKey-C.sortKey));this._currentPartIndex{const T=s.exported.now()-_;return!this._forceFullPlacement&&T>2};for(;this._currentPlacementIndex>=0;){const T=c[o[this._currentPlacementIndex]],S=this.placement.collisionIndex.transform.zoom;if(T.type==="symbol"&&(!T.minzoom||T.minzoom<=S)&&(!T.maxzoom||T.maxzoom>S)){if(this._inProgressLayer||(this._inProgressLayer=new Al(T)),this._inProgressLayer.continuePlacement(f[T.source],this.placement,this._showCollisionBoxes,T,x))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(o){return this.placement.commit(o),this.placement}}const Ms=512/s.EXTENT/2;class Er{constructor(o,c,f){this.tileID=o,this.bucketInstanceId=f,this.index=new s.KDBush(c.length,16,Int32Array),this.keys=[],this.crossTileIDs=[];const _=o.canonical.x*s.EXTENT,x=o.canonical.y*s.EXTENT;for(let T=0;To.overscaledZ)for(const S in T){const C=T[S];C.tileID.isChildOf(o)&&C.findMatches(c.symbolInstances,o,_)}else{const S=T[o.scaledTo(Number(x)).key];S&&S.findMatches(c.symbolInstances,o,_)}}for(let x=0;x{c[f]=!0});for(const f in this.layerIndexes)c[f]||delete this.layerIndexes[f]}}const ns=(d,o)=>s.emitValidationErrors(d,o&&o.filter(c=>c.identifier!=="source.canvas")),Mc=s.pick(Jt,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setTerrain","setFog","setProjection"]),q_=s.pick(Jt,["setCenter","setZoom","setBearing","setPitch"]),zh={version:8,layers:[],sources:{}},fa={fill:!0,line:!0,background:!0,hillshade:!0,raster:!0};class to extends s.Evented{constructor(o,c={}){super(),this.map=o,this.dispatcher=new xt(ha(),this),this.imageManager=new wr,this.imageManager.setEventedParent(this),this.glyphManager=new s.GlyphManager(o._requestManager,c.localFontFamily?s.LocalGlyphMode.all:c.localIdeographFontFamily?s.LocalGlyphMode.ideographs:s.LocalGlyphMode.none,c.localFontFamily||c.localIdeographFontFamily),this.crossTileSymbolIndex=new To,this._layers={},this._num3DLayers=0,this._numSymbolLayers=0,this._numCircleLayers=0,this._serializedLayers={},this._sourceCaches={},this._otherSourceCaches={},this._symbolSourceCaches={},this._loaded=!1,this._availableImages=[],this._order=[],this._drapedFirstOrder=[],this._markersNeedUpdate=!1,this._resetUpdates(),this.dispatcher.broadcast("setReferrer",s.getReferrer());const f=this;this._rtlTextPluginCallback=to.registerForPluginStateChange(_=>{f.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:_.pluginStatus,pluginURL:_.pluginURL},(x,T)=>{if(s.triggerPluginCompletionEvent(x),T&&T.every(S=>S))for(const S in f._sourceCaches){const C=f._sourceCaches[S],z=C.getSource().type;z!=="vector"&&z!=="geojson"||C.reload()}})}),this.on("data",_=>{if(_.dataType!=="source"||_.sourceDataType!=="metadata")return;const x=this.getSource(_.sourceId);if(x&&x.vectorLayerIds)for(const T in this._layers){const S=this._layers[T];S.source===x.id&&this._validateLayer(S)}})}loadURL(o,c={}){this.fire(new s.Event("dataloading",{dataType:"style"}));const f=typeof c.validate=="boolean"?c.validate:!s.isMapboxURL(o);o=this.map._requestManager.normalizeStyleURL(o,c.accessToken);const _=this.map._requestManager.transformRequest(o,s.ResourceType.Style);this._request=s.getJSON(_,(x,T)=>{this._request=null,x?this.fire(new s.ErrorEvent(x)):T&&this._load(T,f)})}loadJSON(o,c={}){this.fire(new s.Event("dataloading",{dataType:"style"})),this._request=s.exported.frame(()=>{this._request=null,this._load(o,c.validate!==!1)})}loadEmpty(){this.fire(new s.Event("dataloading",{dataType:"style"})),this._load(zh,!1)}_updateLayerCount(o,c){const f=c?1:-1;o.is3D()&&(this._num3DLayers+=f),o.type==="circle"&&(this._numCircleLayers+=f),o.type==="symbol"&&(this._numSymbolLayers+=f)}_load(o,c){if(c&&ns(this,s.validateStyle(o)))return;this._loaded=!0,this.stylesheet=s.clone$1(o),this._updateMapProjection();for(const _ in o.sources)this.addSource(_,o.sources[_],{validate:!1});this._changed=!1,o.sprite?this._loadSprite(o.sprite):(this.imageManager.setLoaded(!0),this.dispatcher.broadcast("spriteLoaded",!0)),this.glyphManager.setURL(o.glyphs);const f=lf(this.stylesheet.layers);this._order=f.map(_=>_.id),this._layers={},this._serializedLayers={};for(const _ of f){const x=s.createStyleLayer(_);x.setEventedParent(this,{layer:{id:x.id}}),this._layers[x.id]=x,this._serializedLayers[x.id]=x.serialize(),this._updateLayerCount(x,!0)}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new Vt(this.stylesheet.light),this.stylesheet.terrain&&!this.terrainSetForDrapingOnly()&&this._createTerrain(this.stylesheet.terrain,1),this.stylesheet.fog&&this._createFog(this.stylesheet.fog),this._updateDrapeFirstLayers(),this.fire(new s.Event("data",{dataType:"style"})),this.fire(new s.Event("style.load"))}terrainSetForDrapingOnly(){return!!this.terrain&&this.terrain.drapeRenderMode===0}setProjection(o){o?this.stylesheet.projection=o:delete this.stylesheet.projection,this._updateMapProjection()}applyProjectionUpdate(){this._loaded&&(this.dispatcher.broadcast("setProjection",this.map.transform.projectionOptions),this.map.transform.projection.requiresDraping?this.getTerrain()||this.stylesheet.terrain||this.setTerrainForDraping():this.terrainSetForDrapingOnly()&&this.setTerrain(null))}_updateMapProjection(){this.map._useExplicitProjection?this.applyProjectionUpdate():this.map._prioritizeAndUpdateProjection(null,this.stylesheet.projection)}_loadSprite(o){this._spriteRequest=function(c,f,_){let x,T,S;const C=s.exported.devicePixelRatio>1?"@2x":"";let z=s.getJSON(f.transformRequest(f.normalizeSpriteURL(c,C,".json"),s.ResourceType.SpriteJSON),(j,W)=>{z=null,S||(S=j,x=W,O())}),P=s.getImage(f.transformRequest(f.normalizeSpriteURL(c,C,".png"),s.ResourceType.SpriteImage),(j,W)=>{P=null,S||(S=j,T=W,O())});function O(){if(S)_(S);else if(x&&T){const j=s.exported.getImageData(T),W={};for(const H in x){const{width:Z,height:X,x:B,y:q,sdf:Q,pixelRatio:ee,stretchX:de,stretchY:fe,content:pe}=x[H],xe=new s.RGBAImage({width:Z,height:X});s.RGBAImage.copy(j,xe,{x:B,y:q},{x:0,y:0},{width:Z,height:X}),W[H]={data:xe,pixelRatio:ee,sdf:Q,stretchX:de,stretchY:fe,content:pe}}_(null,W)}}return{cancel(){z&&(z.cancel(),z=null),P&&(P.cancel(),P=null)}}}(o,this.map._requestManager,(c,f)=>{if(this._spriteRequest=null,c)this.fire(new s.ErrorEvent(c));else if(f)for(const _ in f)this.imageManager.addImage(_,f[_]);this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),this.dispatcher.broadcast("setImages",this._availableImages),this.dispatcher.broadcast("spriteLoaded",!0),this.fire(new s.Event("data",{dataType:"style"}))})}_validateLayer(o){const c=this.getSource(o.source);if(!c)return;const f=o.sourceLayer;f&&(c.type==="geojson"||c.vectorLayerIds&&c.vectorLayerIds.indexOf(f)===-1)&&this.fire(new s.ErrorEvent(new Error(`Source layer "${f}" does not exist on source "${c.id}" as specified by style layer "${o.id}"`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const o in this._sourceCaches)if(!this._sourceCaches[o].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeLayers(o){const c=[];for(const f of o){const _=this._layers[f];_.type!=="custom"&&c.push(_.serialize())}return c}hasTransitions(){if(this.light&&this.light.hasTransition()||this.fog&&this.fog.hasTransition())return!0;for(const o in this._sourceCaches)if(this._sourceCaches[o].hasTransition())return!0;for(const o in this._layers)if(this._layers[o].hasTransition())return!0;return!1}get order(){return this.map._optimizeForTerrain&&this.terrain?this._drapedFirstOrder:this._order}isLayerDraped(o){return!!this.terrain&&(typeof o.isLayerDraped=="function"?o.isLayerDraped():fa[o.type])}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading")}update(o){if(!this._loaded)return;const c=this._changed;if(this._changed){const _=Object.keys(this._updatedLayers),x=Object.keys(this._removedLayers);(_.length||x.length)&&this._updateWorkerLayers(_,x);for(const T in this._updatedSources){const S=this._updatedSources[T];S==="reload"?this._reloadSource(T):S==="clear"&&this._clearSource(T)}this._updateTilesForChangedImages();for(const T in this._updatedPaintProps)this._layers[T].updateTransitions(o);this.light.updateTransitions(o),this.fog&&this.fog.updateTransitions(o),this._resetUpdates()}const f={};for(const _ in this._sourceCaches){const x=this._sourceCaches[_];f[_]=x.used,x.used=!1}for(const _ of this._order){const x=this._layers[_];if(x.recalculate(o,this._availableImages),!x.isHidden(o.zoom)){const S=this._getLayerSourceCache(x);S&&(S.used=!0)}const T=this.map.painter;if(T){const S=x.getProgramIds();if(!S)continue;const C=x.getProgramConfiguration(o.zoom);for(const z of S)T.useProgram(z,C)}}for(const _ in f){const x=this._sourceCaches[_];f[_]!==x.used&&x.getSource().fire(new s.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:x.getSource().id}))}this.light.recalculate(o),this.terrain&&this.terrain.recalculate(o),this.fog&&this.fog.recalculate(o),this.z=o.zoom,this._markersNeedUpdate&&(this._updateMarkersOpacity(),this._markersNeedUpdate=!1),c&&this.fire(new s.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){const o=Object.keys(this._changedImages);if(o.length){for(const c in this._sourceCaches)this._sourceCaches[c].reloadTilesForDependencies(["icons","patterns"],o);this._changedImages={}}}_updateWorkerLayers(o,c){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(o),removedIds:c})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}}setState(o){if(this._checkLoaded(),ns(this,s.validateStyle(o)))return!1;(o=s.clone$1(o)).layers=lf(o.layers);const c=function(_,x){if(!_)return[{command:Jt.setStyle,args:[x]}];let T=[];try{if(!k(_.version,x.version))return[{command:Jt.setStyle,args:[x]}];k(_.center,x.center)||T.push({command:Jt.setCenter,args:[x.center]}),k(_.zoom,x.zoom)||T.push({command:Jt.setZoom,args:[x.zoom]}),k(_.bearing,x.bearing)||T.push({command:Jt.setBearing,args:[x.bearing]}),k(_.pitch,x.pitch)||T.push({command:Jt.setPitch,args:[x.pitch]}),k(_.sprite,x.sprite)||T.push({command:Jt.setSprite,args:[x.sprite]}),k(_.glyphs,x.glyphs)||T.push({command:Jt.setGlyphs,args:[x.glyphs]}),k(_.transition,x.transition)||T.push({command:Jt.setTransition,args:[x.transition]}),k(_.light,x.light)||T.push({command:Jt.setLight,args:[x.light]}),k(_.fog,x.fog)||T.push({command:Jt.setFog,args:[x.fog]}),k(_.projection,x.projection)||T.push({command:Jt.setProjection,args:[x.projection]});const S={},C=[];(function(O,j,W,H){let Z;for(Z in j=j||{},O=O||{})O.hasOwnProperty(Z)&&(j.hasOwnProperty(Z)||yl(Z,W,H));for(Z in j){if(!j.hasOwnProperty(Z))continue;const X=j[Z];O.hasOwnProperty(Z)?k(O[Z],X)||(O[Z].type==="geojson"&&X.type==="geojson"&&Ic(O,j,Z)?W.push({command:Jt.setGeoJSONSourceData,args:[Z,X.data]}):bh(Z,j,W,H)):wh(Z,j,W)}})(_.sources,x.sources,C,S);const z=[];_.layers&&_.layers.forEach(O=>{O.source&&S[O.source]?T.push({command:Jt.removeLayer,args:[O.id]}):z.push(O)});let P=_.terrain;P&&S[P.source]&&(T.push({command:Jt.setTerrain,args:[void 0]}),P=void 0),T=T.concat(C),k(P,x.terrain)||T.push({command:Jt.setTerrain,args:[x.terrain]}),function(O,j,W){j=j||[];const H=(O=O||[]).map(xo),Z=j.map(xo),X=O.reduce(Eh,{}),B=j.reduce(Eh,{}),q=H.slice(),Q=Object.create(null);let ee,de,fe,pe,xe,ye,Ae;for(ee=0,de=0;ee!(_.command in q_));if(c.length===0)return!1;const f=c.filter(_=>!(_.command in Mc));if(f.length>0)throw new Error(`Unimplemented: ${f.map(_=>_.command).join(", ")}.`);return c.forEach(_=>{_.command!=="setTransition"&&_.command!=="setProjection"&&this[_.command].apply(this,_.args)}),this.stylesheet=o,this._updateMapProjection(),!0}addImage(o,c){return this.getImage(o)?this.fire(new s.ErrorEvent(new Error("An image with this name already exists."))):(this.imageManager.addImage(o,c),this._afterImageUpdated(o),this)}updateImage(o,c){this.imageManager.updateImage(o,c)}getImage(o){return this.imageManager.getImage(o)}removeImage(o){return this.getImage(o)?(this.imageManager.removeImage(o),this._afterImageUpdated(o),this):this.fire(new s.ErrorEvent(new Error("No image with this name exists.")))}_afterImageUpdated(o){this._availableImages=this.imageManager.listImages(),this._changedImages[o]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new s.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this._availableImages.slice()}addSource(o,c,f={}){if(this._checkLoaded(),this.getSource(o)!==void 0)throw new Error("There is already a source with this ID");if(!c.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(c).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(c.type)>=0&&this._validate(s.validateSource,`sources.${o}`,c,null,f))return;this.map&&this.map._collectResourceTiming&&(c.collectResourceTiming=!0);const _=Dt(o,c,this.dispatcher,this);_.setEventedParent(this,()=>({isSourceLoaded:this._isSourceCacheLoaded(o),source:_.serialize(),sourceId:o}));const x=T=>{const S=(T?"symbol:":"other:")+o,C=this._sourceCaches[S]=new s.SourceCache(S,_,T);(T?this._symbolSourceCaches:this._otherSourceCaches)[o]=C,C.style=this,C.onAdd(this.map)};x(!1),c.type!=="vector"&&c.type!=="geojson"||x(!0),_.onAdd&&_.onAdd(this.map),this._changed=!0}removeSource(o){this._checkLoaded();const c=this.getSource(o);if(!c)throw new Error("There is no source with this ID");for(const _ in this._layers)if(this._layers[_].source===o)return this.fire(new s.ErrorEvent(new Error(`Source "${o}" cannot be removed while layer "${_}" is using it.`)));if(this.terrain&&this.terrain.get().source===o)return this.fire(new s.ErrorEvent(new Error(`Source "${o}" cannot be removed while terrain is using it.`)));const f=this._getSourceCaches(o);for(const _ of f)delete this._sourceCaches[_.id],delete this._updatedSources[_.id],_.fire(new s.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:_.getSource().id})),_.setEventedParent(null),_.clearTiles();return delete this._otherSourceCaches[o],delete this._symbolSourceCaches[o],c.setEventedParent(null),c.onRemove&&c.onRemove(this.map),this._changed=!0,this}setGeoJSONSourceData(o,c){this._checkLoaded(),this.getSource(o).setData(c),this._changed=!0}getSource(o){const c=this._getSourceCache(o);return c&&c.getSource()}_getSources(){const o=[];for(const c in this._otherSourceCaches){const f=this._getSourceCache(c);f&&o.push(f.getSource())}return o}addLayer(o,c,f={}){this._checkLoaded();const _=o.id;if(this.getLayer(_))return void this.fire(new s.ErrorEvent(new Error(`Layer with id "${_}" already exists on this map`)));let x;if(o.type==="custom"){if(ns(this,s.validateCustomStyleLayer(o)))return;x=s.createStyleLayer(o)}else{if(typeof o.source=="object"&&(this.addSource(_,o.source),o=s.clone$1(o),o=s.extend(o,{source:_})),this._validate(s.validateLayer,`layers.${_}`,o,{arrayIndex:-1},f))return;x=s.createStyleLayer(o),this._validateLayer(x),x.setEventedParent(this,{layer:{id:_}}),this._serializedLayers[x.id]=x.serialize(),this._updateLayerCount(x,!0)}const T=c?this._order.indexOf(c):this._order.length;if(c&&T===-1)return void this.fire(new s.ErrorEvent(new Error(`Layer with id "${c}" does not exist on this map.`)));this._order.splice(T,0,_),this._layerOrderChanged=!0,this._layers[_]=x;const S=this._getLayerSourceCache(x);if(this._removedLayers[_]&&x.source&&S&&x.type!=="custom"){const C=this._removedLayers[_];delete this._removedLayers[_],C.type!==x.type?this._updatedSources[x.source]="clear":(this._updatedSources[x.source]="reload",S.pause())}this._updateLayer(x),x.onAdd&&x.onAdd(this.map),this._updateDrapeFirstLayers()}moveLayer(o,c){if(this._checkLoaded(),this._changed=!0,!this._layers[o])return void this.fire(new s.ErrorEvent(new Error(`The layer '${o}' does not exist in the map's style and cannot be moved.`)));if(o===c)return;const f=this._order.indexOf(o);this._order.splice(f,1);const _=c?this._order.indexOf(c):this._order.length;c&&_===-1?this.fire(new s.ErrorEvent(new Error(`Layer with id "${c}" does not exist on this map.`))):(this._order.splice(_,0,o),this._layerOrderChanged=!0,this._updateDrapeFirstLayers())}removeLayer(o){this._checkLoaded();const c=this._layers[o];if(!c)return void this.fire(new s.ErrorEvent(new Error(`The layer '${o}' does not exist in the map's style and cannot be removed.`)));c.setEventedParent(null),this._updateLayerCount(c,!1);const f=this._order.indexOf(o);this._order.splice(f,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[o]=c,delete this._layers[o],delete this._serializedLayers[o],delete this._updatedLayers[o],delete this._updatedPaintProps[o],c.onRemove&&c.onRemove(this.map),this._updateDrapeFirstLayers()}getLayer(o){return this._layers[o]}hasLayer(o){return o in this._layers}hasLayerType(o){for(const c in this._layers)if(this._layers[c].type===o)return!0;return!1}setLayerZoomRange(o,c,f){this._checkLoaded();const _=this.getLayer(o);_?_.minzoom===c&&_.maxzoom===f||(c!=null&&(_.minzoom=c),f!=null&&(_.maxzoom=f),this._updateLayer(_)):this.fire(new s.ErrorEvent(new Error(`The layer '${o}' does not exist in the map's style and cannot have zoom extent.`)))}setFilter(o,c,f={}){this._checkLoaded();const _=this.getLayer(o);if(_){if(!k(_.filter,c))return c==null?(_.filter=void 0,void this._updateLayer(_)):void(this._validate(s.validateFilter,`layers.${_.id}.filter`,c,{layerType:_.type},f)||(_.filter=s.clone$1(c),this._updateLayer(_)))}else this.fire(new s.ErrorEvent(new Error(`The layer '${o}' does not exist in the map's style and cannot be filtered.`)))}getFilter(o){const c=this.getLayer(o);return c&&s.clone$1(c.filter)}setLayoutProperty(o,c,f,_={}){this._checkLoaded();const x=this.getLayer(o);x?k(x.getLayoutProperty(c),f)||(x.setLayoutProperty(c,f,_),this._updateLayer(x)):this.fire(new s.ErrorEvent(new Error(`The layer '${o}' does not exist in the map's style and cannot be styled.`)))}getLayoutProperty(o,c){const f=this.getLayer(o);if(f)return f.getLayoutProperty(c);this.fire(new s.ErrorEvent(new Error(`The layer '${o}' does not exist in the map's style.`)))}setPaintProperty(o,c,f,_={}){this._checkLoaded();const x=this.getLayer(o);x?k(x.getPaintProperty(c),f)||(x.setPaintProperty(c,f,_)&&this._updateLayer(x),this._changed=!0,this._updatedPaintProps[o]=!0):this.fire(new s.ErrorEvent(new Error(`The layer '${o}' does not exist in the map's style and cannot be styled.`)))}getPaintProperty(o,c){const f=this.getLayer(o);return f&&f.getPaintProperty(c)}setFeatureState(o,c){this._checkLoaded();const f=o.source,_=o.sourceLayer,x=this.getSource(f);if(!x)return void this.fire(new s.ErrorEvent(new Error(`The source '${f}' does not exist in the map's style.`)));const T=x.type;if(T==="geojson"&&_)return void this.fire(new s.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));if(T==="vector"&&!_)return void this.fire(new s.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));o.id===void 0&&this.fire(new s.ErrorEvent(new Error("The feature id parameter must be provided.")));const S=this._getSourceCaches(f);for(const C of S)C.setFeatureState(_,o.id,c)}removeFeatureState(o,c){this._checkLoaded();const f=o.source,_=this.getSource(f);if(!_)return void this.fire(new s.ErrorEvent(new Error(`The source '${f}' does not exist in the map's style.`)));const x=_.type,T=x==="vector"?o.sourceLayer:void 0;if(x==="vector"&&!T)return void this.fire(new s.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));if(c&&typeof o.id!="string"&&typeof o.id!="number")return void this.fire(new s.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));const S=this._getSourceCaches(f);for(const C of S)C.removeFeatureState(T,o.id,c)}getFeatureState(o){this._checkLoaded();const c=o.source,f=o.sourceLayer,_=this.getSource(c);if(_){if(_.type!=="vector"||f)return o.id===void 0&&this.fire(new s.ErrorEvent(new Error("The feature id parameter must be provided."))),this._getSourceCaches(c)[0].getFeatureState(f,o.id);this.fire(new s.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new s.ErrorEvent(new Error(`The source '${c}' does not exist in the map's style.`)))}getTransition(){return s.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){const o={};for(const c in this._sourceCaches){const f=this._sourceCaches[c].getSource();o[f.id]||(o[f.id]=f.serialize())}return s.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,terrain:this.getTerrain()||void 0,fog:this.stylesheet.fog,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,projection:this.stylesheet.projection,sources:o,layers:this._serializeLayers(this._order)},c=>c!==void 0)}_updateLayer(o){this._updatedLayers[o.id]=!0;const c=this._getLayerSourceCache(o);o.source&&!this._updatedSources[o.source]&&c&&c.getSource().type!=="raster"&&(this._updatedSources[o.source]="reload",c.pause()),this._changed=!0,o.invalidateCompiledFilter()}_flattenAndSortRenderedFeatures(o){const c=T=>this._layers[T].type==="fill-extrusion",f={},_=[];for(let T=this._order.length-1;T>=0;T--){const S=this._order[T];if(c(S)){f[S]=T;for(const C of o){const z=C[S];if(z)for(const P of z)_.push(P)}}}_.sort((T,S)=>S.intersectionZ-T.intersectionZ);const x=[];for(let T=this._order.length-1;T>=0;T--){const S=this._order[T];if(c(S))for(let C=_.length-1;C>=0;C--){const z=_[C].feature;if(f[z.layer.id]{const z=this.getLayer(C);return z&&z.is3D()}):this.has3DLayers(),S=dn.createFromScreenPoints(o,f);for(const C in this._sourceCaches){const z=this._sourceCaches[C].getSource().id;c.layers&&!_[z]||x.push(In(this._sourceCaches[C],this._layers,this._serializedLayers,S,c,f,T,!!this.map._showQueryGeometry))}return this.placement&&x.push(function(C,z,P,O,j,W,H){const Z={},X=W.queryRenderedSymbols(O),B=[];for(const q of Object.keys(X).map(Number))B.push(H[q]);B.sort(Ir);for(const q of B){const Q=q.featureIndex.lookupSymbolFeatures(X[q.bucketInstanceId],z,q.bucketIndex,q.sourceLayerIndex,j.filter,j.layers,j.availableImages,C);for(const ee in Q){const de=Z[ee]=Z[ee]||[],fe=Q[ee];fe.sort((pe,xe)=>{const ye=q.featureSortOrder;if(ye){const Ae=ye.indexOf(pe.featureIndex);return ye.indexOf(xe.featureIndex)-Ae}return xe.featureIndex-pe.featureIndex});for(const pe of fe)de.push(pe)}}for(const q in Z)Z[q].forEach(Q=>{const ee=Q.feature,de=P(C[q]);if(!de)return;const fe=de.getFeatureState(ee.layer["source-layer"],ee.id);ee.source=ee.layer.source,ee.layer["source-layer"]&&(ee.sourceLayer=ee.layer["source-layer"]),ee.state=fe});return Z}(this._layers,this._serializedLayers,this._getLayerSourceCache.bind(this),S.screenGeometry,c,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(x)}querySourceFeatures(o,c){c&&c.filter&&this._validate(s.validateFilter,"querySourceFeatures.filter",c.filter,null,c);const f=this._getSourceCaches(o);let _=[];for(const x of f)_=_.concat(Vn(x,c));return _}addSourceType(o,c,f){return to.getSourceType(o)?f(new Error(`A source type called "${o}" already exists.`)):(to.setSourceType(o,c),c.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:o,url:c.workerSourceURL},f):f(null,null))}getLight(){return this.light.getLight()}setLight(o,c={}){this._checkLoaded();const f=this.light.getLight();let _=!1;for(const T in o)if(!k(o[T],f[T])){_=!0;break}if(!_)return;const x=this._setTransitionParameters({duration:300,delay:0});this.light.setLight(o,c),this.light.updateTransitions(x)}getTerrain(){return this.terrain&&this.terrain.drapeRenderMode===1?this.terrain.get():null}setTerrainForDraping(){this.setTerrain({source:"",exaggeration:0},0)}setTerrain(o,c=1){if(this._checkLoaded(),!o)return delete this.terrain,delete this.stylesheet.terrain,this.dispatcher.broadcast("enableTerrain",!1),this._force3DLayerUpdate(),void(this._markersNeedUpdate=!0);let f=o;if(c===1){if(typeof f.source=="object"){const _="terrain-dem-src";this.addSource(_,f.source),f=s.clone$1(f),f=s.extend(f,{source:_})}if(this._validate(s.validateTerrain,"terrain",f))return}if(!this.terrain||this.terrain&&c!==this.terrain.drapeRenderMode){if(!f)return;this._createTerrain(f,c)}else{const _=this.terrain,x=_.get();for(const T of Object.keys(s.spec.terrain))!f.hasOwnProperty(T)&&s.spec.terrain[T].default&&(f[T]=s.spec.terrain[T].default);for(const T in f)if(!k(f[T],x[T])){_.set(f),this.stylesheet.terrain=f;const S=this._setTransitionParameters({duration:0});_.updateTransitions(S);break}}this._updateDrapeFirstLayers(),this._markersNeedUpdate=!0}_createFog(o){const c=this.fog=new Tt(o,this.map.transform);this.stylesheet.fog=o;const f=this._setTransitionParameters({duration:0});c.updateTransitions(f)}_updateMarkersOpacity(){this.map._markers.length!==0&&this.map._requestDomTask(()=>{for(const o of this.map._markers)o._evaluateOpacity()})}getFog(){return this.fog?this.fog.get():null}setFog(o){if(this._checkLoaded(),!o)return delete this.fog,delete this.stylesheet.fog,void(this._markersNeedUpdate=!0);if(this.fog){const c=this.fog,f=c.get();Object.keys(o).length===0&&c.set(o);for(const _ in o)if(!k(o[_],f[_])){c.set(o),this.stylesheet.fog=o;const x=this._setTransitionParameters({duration:0});c.updateTransitions(x);break}}else this._createFog(o);this._markersNeedUpdate=!0}_setTransitionParameters(o){return{now:s.exported.now(),transition:s.extend(o,this.stylesheet.transition)}}_updateDrapeFirstLayers(){if(!this.map._optimizeForTerrain||!this.terrain)return;const o=this._order.filter(f=>this.isLayerDraped(this._layers[f])),c=this._order.filter(f=>!this.isLayerDraped(this._layers[f]));this._drapedFirstOrder=[],this._drapedFirstOrder.push(...o),this._drapedFirstOrder.push(...c)}_createTerrain(o,c){const f=this.terrain=new $r(o,c);this.stylesheet.terrain=o,this.dispatcher.broadcast("enableTerrain",!this.terrainSetForDrapingOnly()),this._force3DLayerUpdate();const _=this._setTransitionParameters({duration:0});f.updateTransitions(_)}_force3DLayerUpdate(){for(const o in this._layers){const c=this._layers[o];c.type==="fill-extrusion"&&this._updateLayer(c)}}_forceSymbolLayerUpdate(){for(const o in this._layers){const c=this._layers[o];c.type==="symbol"&&this._updateLayer(c)}}_validate(o,c,f,_,x={}){return(!x||x.validate!==!1)&&ns(this,o.call(s.validateStyle,s.extend({key:c,style:this.serialize(),value:f,styleSpec:s.spec},_)))}_remove(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),s.evented.off("pluginStateChange",this._rtlTextPluginCallback);for(const o in this._layers)this._layers[o].setEventedParent(null);for(const o in this._sourceCaches)this._sourceCaches[o].clearTiles(),this._sourceCaches[o].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()}_clearSource(o){const c=this._getSourceCaches(o);for(const f of c)f.clearTiles()}_reloadSource(o){const c=this._getSourceCaches(o);for(const f of c)f.resume(),f.reload()}_reloadSources(){for(const o of this._getSources())o.reload&&o.reload()}_updateSources(o){for(const c in this._sourceCaches)this._sourceCaches[c].update(o)}_generateCollisionBoxes(){for(const o in this._sourceCaches){const c=this._sourceCaches[o];c.resume(),c.reload()}}_updatePlacement(o,c,f,_,x=!1){let T=!1,S=!1;const C={};for(const z of this._order){const P=this._layers[z];if(P.type!=="symbol")continue;if(!C[P.source]){const j=this._getLayerSourceCache(P);if(!j)continue;C[P.source]=j.getRenderableIds(!0).map(W=>j.getTileByID(W)).sort((W,H)=>H.tileID.overscaledZ-W.tileID.overscaledZ||(W.tileID.isLessThan(H.tileID)?-1:1))}const O=this.crossTileSymbolIndex.addLayer(P,C[P.source],o.center.lng,o.projection);T=T||O}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),x=x||this._layerOrderChanged||f===0,this._layerOrderChanged&&this.fire(new s.Event("neworder")),(x||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(s.exported.now(),o.zoom))&&(this.pauseablePlacement=new kh(o,this._order,x,c,f,_,this.placement,this.fog&&o.projection.supportsFog?this.fog.state:null),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,C),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(s.exported.now()),S=!0),T&&this.pauseablePlacement.placement.setStale()),S||T)for(const z of this._order){const P=this._layers[z];P.type==="symbol"&&this.placement.updateLayerOpacities(P,C[P.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(s.exported.now())}_releaseSymbolFadeTiles(){for(const o in this._sourceCaches)this._sourceCaches[o].releaseSymbolFadeTiles()}getImages(o,c,f){this.imageManager.getImages(c.icons,f),this._updateTilesForChangedImages();const _=x=>{x&&x.setDependencies(c.tileID.key,c.type,c.icons)};_(this._otherSourceCaches[c.source]),_(this._symbolSourceCaches[c.source])}getGlyphs(o,c,f){this.glyphManager.getGlyphs(c.stacks,f)}getResource(o,c,f){return s.makeRequest(c,f)}_getSourceCache(o){return this._otherSourceCaches[o]}_getLayerSourceCache(o){return o.type==="symbol"?this._symbolSourceCaches[o.source]:this._otherSourceCaches[o.source]}_getSourceCaches(o){const c=[];return this._otherSourceCaches[o]&&c.push(this._otherSourceCaches[o]),this._symbolSourceCaches[o]&&c.push(this._symbolSourceCaches[o]),c}_isSourceCacheLoaded(o){const c=this._getSourceCaches(o);return c.length===0?(this.fire(new s.ErrorEvent(new Error(`There is no source with ID '${o}'`))),!1):c.every(f=>f.loaded())}has3DLayers(){return this._num3DLayers>0}hasSymbolLayers(){return this._numSymbolLayers>0}hasCircleLayers(){return this._numCircleLayers>0}_clearWorkerCaches(){this.dispatcher.broadcast("clearCaches")}destroy(){this._clearWorkerCaches(),this.terrainSetForDrapingOnly()&&(delete this.terrain,delete this.stylesheet.terrain)}}to.getSourceType=function(d){return Pt[d]},to.setSourceType=function(d,o){Pt[d]=o},to.registerForPluginStateChange=s.registerForPluginStateChange;var Lh=` +#define EPSILON 0.0000001 +#define PI 3.141592653589793 +#define EXTENT 8192.0 +#define HALF_PI PI/2.0 +#define QUARTER_PI PI/4.0 +#define RAD_TO_DEG 180.0/PI +#define DEG_TO_RAD PI/180.0 +#define GLOBE_RADIUS EXTENT/PI/2.0`,Ps="attribute highp vec3 a_pos_3f;uniform lowp mat4 u_matrix;varying highp vec3 v_uv;void main() {const mat3 half_neg_pi_around_x=mat3(1.0,0.0, 0.0,0.0,0.0,-1.0,0.0,1.0, 0.0);v_uv=half_neg_pi_around_x*a_pos_3f;vec4 pos=u_matrix*vec4(a_pos_3f,1.0);gl_Position=pos.xyww;}",So=` +#define ELEVATION_SCALE 7.0 +#define ELEVATION_OFFSET 450.0 +#ifdef PROJECTION_GLOBE_VIEW +uniform vec3 u_tile_tl_up;uniform vec3 u_tile_tr_up;uniform vec3 u_tile_br_up;uniform vec3 u_tile_bl_up;uniform float u_tile_up_scale;vec3 elevationVector(vec2 pos) {vec2 uv=pos/EXTENT;vec3 up=normalize(mix( +mix(u_tile_tl_up,u_tile_tr_up,uv.xxx),mix(u_tile_bl_up,u_tile_br_up,uv.xxx),uv.yyy));return up*u_tile_up_scale;} +#else +vec3 elevationVector(vec2 pos) { return vec3(0,0,1); } +#endif +const float skirtOffset=24575.0;vec3 decomposeToPosAndSkirt(vec2 posWithComposedSkirt) +{float skirt=float(posWithComposedSkirt.x >=skirtOffset);vec2 pos=posWithComposedSkirt-vec2(skirt*skirtOffset,0.0);return vec3(pos,skirt);} +#ifdef TERRAIN +#ifdef TERRAIN_DEM_FLOAT_FORMAT +uniform highp sampler2D u_dem;uniform highp sampler2D u_dem_prev; +#else +uniform sampler2D u_dem;uniform sampler2D u_dem_prev; +#endif +uniform vec4 u_dem_unpack;uniform vec2 u_dem_tl;uniform vec2 u_dem_tl_prev;uniform float u_dem_scale;uniform float u_dem_scale_prev;uniform float u_dem_size;uniform float u_dem_lerp;uniform float u_exaggeration;uniform float u_meter_to_dem;uniform mat4 u_label_plane_matrix_inv;uniform sampler2D u_depth;uniform vec2 u_depth_size_inv;vec4 tileUvToDemSample(vec2 uv,float dem_size,float dem_scale,vec2 dem_tl) {vec2 pos=dem_size*(uv*dem_scale+dem_tl)+1.0;vec2 f=fract(pos);return vec4((pos-f+0.5)/(dem_size+2.0),f);}float decodeElevation(vec4 v) {return dot(vec4(v.xyz*255.0,-1.0),u_dem_unpack);}float currentElevation(vec2 apos) { +#ifdef TERRAIN_DEM_FLOAT_FORMAT +vec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale+u_dem_tl)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture2D(u_dem,pos).a; +#else +float dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale,u_dem_tl);vec2 pos=r.xy;vec2 f=r.zw;float tl=decodeElevation(texture2D(u_dem,pos)); +#ifdef TERRAIN_DEM_NEAREST_FILTER +return u_exaggeration*tl; +#endif +float tr=decodeElevation(texture2D(u_dem,pos+vec2(dd,0.0)));float bl=decodeElevation(texture2D(u_dem,pos+vec2(0.0,dd)));float br=decodeElevation(texture2D(u_dem,pos+vec2(dd,dd)));return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y); +#endif +}float prevElevation(vec2 apos) { +#ifdef TERRAIN_DEM_FLOAT_FORMAT +vec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale_prev+u_dem_tl_prev)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture2D(u_dem_prev,pos).a; +#else +float dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale_prev,u_dem_tl_prev);vec2 pos=r.xy;vec2 f=r.zw;float tl=decodeElevation(texture2D(u_dem_prev,pos));float tr=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,0.0)));float bl=decodeElevation(texture2D(u_dem_prev,pos+vec2(0.0,dd)));float br=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,dd)));return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y); +#endif +} +#ifdef TERRAIN_VERTEX_MORPHING +float elevation(vec2 apos) { +#ifdef ZERO_EXAGGERATION +return 0.0; +#endif +float nextElevation=currentElevation(apos);float prevElevation=prevElevation(apos);return mix(prevElevation,nextElevation,u_dem_lerp);} +#else +float elevation(vec2 apos) { +#ifdef ZERO_EXAGGERATION +return 0.0; +#endif +return currentElevation(apos);} +#endif +highp float unpack_depth(highp vec4 rgba_depth) +{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}bool isOccluded(vec4 frag) {vec3 coord=frag.xyz/frag.w;float depth=unpack_depth(texture2D(u_depth,(coord.xy+1.0)*0.5));return coord.z > depth+0.0005;}float occlusionFade(vec4 frag) {vec3 coord=frag.xyz/frag.w;vec3 df=vec3(5.0*u_depth_size_inv,0.0);vec2 uv=0.5*coord.xy+0.5;vec4 depth=vec4( +unpack_depth(texture2D(u_depth,uv-df.xz)),unpack_depth(texture2D(u_depth,uv+df.xz)),unpack_depth(texture2D(u_depth,uv-df.zy)),unpack_depth(texture2D(u_depth,uv+df.zy)) +);return dot(vec4(0.25),vec4(1.0)-clamp(300.0*(vec4(coord.z-0.001)-depth),0.0,1.0));}vec4 fourSample(vec2 pos,vec2 off) { +#ifdef TERRAIN_DEM_FLOAT_FORMAT +float tl=texture2D(u_dem,pos).a;float tr=texture2D(u_dem,pos+vec2(off.x,0.0)).a;float bl=texture2D(u_dem,pos+vec2(0.0,off.y)).a;float br=texture2D(u_dem,pos+off).a; +#else +vec4 demtl=vec4(texture2D(u_dem,pos).xyz*255.0,-1.0);float tl=dot(demtl,u_dem_unpack);vec4 demtr=vec4(texture2D(u_dem,pos+vec2(off.x,0.0)).xyz*255.0,-1.0);float tr=dot(demtr,u_dem_unpack);vec4 dembl=vec4(texture2D(u_dem,pos+vec2(0.0,off.y)).xyz*255.0,-1.0);float bl=dot(dembl,u_dem_unpack);vec4 dembr=vec4(texture2D(u_dem,pos+off).xyz*255.0,-1.0);float br=dot(dembr,u_dem_unpack); +#endif +return vec4(tl,tr,bl,br);}float flatElevation(vec2 pack) {vec2 apos=floor(pack/8.0);vec2 span=10.0*(pack-apos*8.0);vec2 uvTex=(apos-vec2(1.0,1.0))/8190.0;float size=u_dem_size+2.0;float dd=1.0/size;vec2 pos=u_dem_size*(uvTex*u_dem_scale+u_dem_tl)+1.0;vec2 f=fract(pos);pos=(pos-f+0.5)*dd;vec4 h=fourSample(pos,vec2(dd));float z=mix(mix(h.x,h.y,f.x),mix(h.z,h.w,f.x),f.y);vec2 w=floor(0.5*(span*u_meter_to_dem-1.0));vec2 d=dd*w;h=fourSample(pos-d,2.0*d+vec2(dd));vec4 diff=abs(h.xzxy-h.ywzw);vec2 slope=min(vec2(0.25),u_meter_to_dem*0.5*(diff.xz+diff.yw)/(2.0*w+vec2(1.0)));vec2 fix=slope*span;float base=z+max(fix.x,fix.y);return u_exaggeration*base;}float elevationFromUint16(float word) {return u_exaggeration*(word/ELEVATION_SCALE-ELEVATION_OFFSET);} +#else +float elevation(vec2 pos) { return 0.0; }bool isOccluded(vec4 frag) { return false; }float occlusionFade(vec4 frag) { return 1.0; } +#endif`,Cl=`#ifdef FOG +uniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump mat4 u_fog_matrix;varying vec3 v_fog_pos;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}vec3 fog_position(vec3 pos) {return (u_fog_matrix*vec4(pos,1.0)).xyz;}vec3 fog_position(vec2 pos) {return fog_position(vec3(pos,0.0));}float fog(vec3 pos) {float depth=length(pos);float opacity=fog_opacity(fog_range(depth));return opacity*fog_horizon_blending(pos/depth);} +#endif`,Ao=`#ifdef FOG +uniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump float u_fog_temporal_offset;varying vec3 v_fog_pos;uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform highp vec2 u_viewport;uniform float u_globe_transition;uniform int u_is_globe;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}float globe_glow_progress() {highp vec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix( +mix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);highp vec3 dir=normalize(ray_dir);highp vec3 closest_point=dot(u_globe_pos,dir)*dir;highp float sdf=length(closest_point-u_globe_pos)/u_globe_radius;return sdf+PI*0.5;}float fog_opacity(vec3 pos) {float depth=length(pos);return fog_opacity(fog_range(depth));}vec3 fog_apply(vec3 color,vec3 pos) {float depth=length(pos);float opacity;if (u_is_globe==1) {float glow_progress=globe_glow_progress();float t=mix(glow_progress,depth,u_globe_transition);opacity=fog_opacity(fog_range(t));} else {opacity=fog_opacity(fog_range(depth));opacity*=fog_horizon_blending(pos/depth);}return mix(color,u_fog_color.rgb,opacity);}vec4 fog_apply_from_vert(vec4 color,float fog_opac) {float alpha=EPSILON+color.a;color.rgb=mix(color.rgb/alpha,u_fog_color.rgb,fog_opac)*alpha;return color;}vec3 fog_apply_sky_gradient(vec3 camera_ray,vec3 sky_color) {float horizon_blend=fog_horizon_blending(normalize(camera_ray));return mix(sky_color,u_fog_color.rgb,horizon_blend);}vec4 fog_apply_premultiplied(vec4 color,vec3 pos) {float alpha=EPSILON+color.a;color.rgb=fog_apply(color.rgb/alpha,pos)*alpha;return color;}vec3 fog_dither(vec3 color) {vec2 dither_seed=gl_FragCoord.xy+u_fog_temporal_offset;return dither(color,dither_seed);}vec4 fog_dither(vec4 color) {return vec4(fog_dither(color.rgb),color.a);} +#endif`;let Pc={},ma={};const Il=[];ga(Lh,Il),ga(So,Il),ga(Cl,Il),ga(Ao,Il),Pc=Qt("",So),ma=Qt(Ao,Cl);const ff=Qt(` +#if __VERSION__ >=300 +#define varying in +#define gl_FragColor glFragColor +#define texture2D texture +#define textureCube texture +out vec4 glFragColor; +#endif +highp vec3 hash(highp vec2 p) {highp vec3 p3=fract(p.xyx*vec3(443.8975,397.2973,491.1871));p3+=dot(p3,p3.yxz+19.19);return fract((p3.xxy+p3.yzz)*p3.zyx);}vec3 dither(vec3 color,highp vec2 seed) {vec3 rnd=hash(seed)+hash(seed+0.59374)-0.5;return color+rnd/255.0;}highp float unpack_depth(highp vec4 rgba_depth) +{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}highp vec4 pack_depth(highp float ndc_z) {highp float depth=ndc_z*0.5+0.5;const highp vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);const highp vec4 bit_mask =vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);highp vec4 res=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;}`,` +#if __VERSION__ >=300 +#define attribute in +#define varying out +#define texture2D texture +#endif +float wrap(float n,float min,float max) {float d=max-min;float w=mod(mod(n-min,d)+d,d)+min;return (w==min) ? max : w;} +#ifdef PROJECTION_GLOBE_VIEW +vec3 mercator_tile_position(mat4 matrix,vec2 tile_anchor,vec3 tile_id,vec2 mercator_center) { +#ifndef PROJECTED_POS_ON_VIEWPORT +float tiles=tile_id.z;vec2 mercator=(tile_anchor/EXTENT+tile_id.xy)/tiles;mercator-=mercator_center;mercator.x=wrap(mercator.x,-0.5,0.5);vec4 mercator_tile=vec4(mercator.xy*EXTENT,EXTENT/(2.0*PI),1.0);mercator_tile=matrix*mercator_tile;return mercator_tile.xyz; +#else +return vec3(0.0); +#endif +}vec3 mix_globe_mercator(vec3 globe,vec3 mercator,float t) {return mix(globe,mercator,t);}mat3 globe_mercator_surface_vectors(vec3 pos_normal,vec3 up_dir,float zoom_transition) {vec3 normal=zoom_transition==0.0 ? pos_normal : normalize(mix(pos_normal,up_dir,zoom_transition));vec3 xAxis=normalize(vec3(normal.z,0.0,-normal.x));vec3 yAxis=normalize(cross(normal,xAxis));return mat3(xAxis,yAxis,normal);} +#endif +vec2 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 +);}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;}const vec4 AWAY=vec4(-1000.0,-1000.0,-1000.0,1);//Normalized device coordinate that is not rendered.`),zc=Lh,Rh=` +#ifdef GL_ES +precision mediump float; +#else + +#if !defined(lowp) +#define lowp +#endif + +#if !defined(mediump) +#define mediump +#endif + +#if !defined(highp) +#define highp +#endif + +#endif`;var Dh={background:Qt(`uniform vec4 u_color;uniform float u_opacity; +#ifdef LIGHTING_3D_MODE +varying vec4 v_color; +#endif +void main() {vec4 out_color; +#ifdef LIGHTING_3D_MODE +out_color=v_color; +#else +out_color=u_color; +#endif +#ifdef FOG +out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); +#endif +gl_FragColor=out_color*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec2 a_pos;uniform mat4 u_matrix; +#ifdef LIGHTING_3D_MODE +uniform vec4 u_color;varying vec4 v_color; +#endif +void main() {gl_Position=u_matrix*vec4(a_pos,0,1); +#ifdef LIGHTING_3D_MODE +v_color=apply_lighting(u_color); +#endif +#ifdef FOG +v_fog_pos=fog_position(a_pos); +#endif +}`),backgroundPattern:Qt(`uniform vec2 u_pattern_tl;uniform vec2 u_pattern_br;uniform vec2 u_texsize;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos;void main() {vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(u_pattern_tl/u_texsize,u_pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos); +#ifdef LIGHTING_3D_MODE +out_color=apply_lighting(out_color); +#endif +#ifdef FOG +out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); +#endif +gl_FragColor=out_color*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_pattern_size;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_pattern_size,u_tile_units_to_pixels,a_pos); +#ifdef FOG +v_fog_pos=fog_position(a_pos); +#endif +}`),circle:Qt(`varying vec3 v_data;varying float v_visibility; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define mediump float radius +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define highp vec4 stroke_color +#pragma mapbox: define mediump float stroke_width +#pragma mapbox: define lowp float stroke_opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize mediump float radius +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize highp vec4 stroke_color +#pragma mapbox: initialize mediump float stroke_width +#pragma mapbox: initialize lowp float stroke_opacity +vec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);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) +);vec4 out_color=mix(color*opacity,stroke_color*stroke_opacity,color_t); +#ifdef LIGHTING_3D_MODE +out_color=apply_lighting(out_color); +#endif +#ifdef FOG +out_color=fog_apply_premultiplied(out_color,v_fog_pos); +#endif +gl_FragColor=out_color*(v_visibility*opacity_t); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`#define NUM_VISIBILITY_RINGS 2 +#define INV_SQRT2 0.70710678 +#define ELEVATION_BIAS 0.0001 +#define NUM_SAMPLES_PER_RING 16 +uniform mat4 u_matrix;uniform mat2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos; +#ifdef PROJECTION_GLOBE_VIEW +attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir; +#endif +varying vec3 v_data;varying float v_visibility; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define mediump float radius +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define highp vec4 stroke_color +#pragma mapbox: define mediump float stroke_width +#pragma mapbox: define lowp float stroke_opacity +vec2 calc_offset(vec2 extrusion,float radius,float stroke_width, float view_scale) {return extrusion*(radius+stroke_width)*u_extrude_scale*view_scale;}float cantilevered_elevation(vec2 pos,float radius,float stroke_width,float view_scale) {vec2 c1=pos+calc_offset(vec2(-1,-1),radius,stroke_width,view_scale);vec2 c2=pos+calc_offset(vec2(1,-1),radius,stroke_width,view_scale);vec2 c3=pos+calc_offset(vec2(1,1),radius,stroke_width,view_scale);vec2 c4=pos+calc_offset(vec2(-1,1),radius,stroke_width,view_scale);float h1=elevation(c1)+ELEVATION_BIAS;float h2=elevation(c2)+ELEVATION_BIAS;float h3=elevation(c3)+ELEVATION_BIAS;float h4=elevation(c4)+ELEVATION_BIAS;return max(h4,max(h3,max(h1,h2)));}float circle_elevation(vec2 pos) { +#if defined(TERRAIN) +return elevation(pos)+ELEVATION_BIAS; +#else +return 0.0; +#endif +}vec4 project_vertex(vec2 extrusion,vec4 world_center,vec4 projected_center,float radius,float stroke_width, float view_scale,mat3 surface_vectors) {vec2 sample_offset=calc_offset(extrusion,radius,stroke_width,view_scale); +#ifdef PITCH_WITH_MAP +#ifdef PROJECTION_GLOBE_VIEW +return u_matrix*( world_center+vec4(sample_offset.x*surface_vectors[0]+sample_offset.y*surface_vectors[1],0) ); +#else +return u_matrix*( world_center+vec4(sample_offset,0,0) ); +#endif +#else +return projected_center+vec4(sample_offset,0,0); +#endif +}float get_sample_step() { +#ifdef PITCH_WITH_MAP +return 2.0*PI/float(NUM_SAMPLES_PER_RING); +#else +return PI/float(NUM_SAMPLES_PER_RING); +#endif +}void main(void) { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize mediump float radius +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize highp vec4 stroke_color +#pragma mapbox: initialize mediump float stroke_width +#pragma mapbox: initialize lowp float stroke_opacity +vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);vec4 world_center;mat3 surface_vectors; +#ifdef PROJECTION_GLOBE_VIEW +vec3 pos_normal_3=a_pos_normal_3/16384.0;surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(circle_center)*circle_elevation(circle_center);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*circle_elevation(circle_center);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,circle_center,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;vec3 pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);world_center=vec4(pos,1); +#else +surface_vectors=mat3(1.0);float height=circle_elevation(circle_center);world_center=vec4(circle_center,height,1); +#endif +vec4 projected_center=u_matrix*world_center;float view_scale=0.0; +#ifdef PITCH_WITH_MAP +#ifdef SCALE_WITH_MAP +view_scale=1.0; +#else +view_scale=projected_center.w/u_camera_to_center_distance; +#endif +#else +#ifdef SCALE_WITH_MAP +view_scale=u_camera_to_center_distance; +#else +view_scale=projected_center.w; +#endif +#endif +gl_Position=project_vertex(extrude,world_center,projected_center,radius,stroke_width,view_scale,surface_vectors);float visibility=0.0; +#ifdef TERRAIN +float step=get_sample_step();vec4 occlusion_world_center;vec4 occlusion_projected_center; +#ifdef PITCH_WITH_MAP +float cantilevered_height=cantilevered_elevation(circle_center,radius,stroke_width,view_scale);occlusion_world_center=vec4(circle_center,cantilevered_height,1);occlusion_projected_center=u_matrix*occlusion_world_center; +#else +occlusion_world_center=world_center;occlusion_projected_center=projected_center; +#endif +for(int ring=0; ring < NUM_VISIBILITY_RINGS; ring++) {float scale=(float(ring)+1.0)/float(NUM_VISIBILITY_RINGS);for(int i=0; i < NUM_SAMPLES_PER_RING; i++) {vec2 extrusion=vec2(cos(step*float(i)),-sin(step*float(i)))*scale;vec4 frag_pos=project_vertex(extrusion,occlusion_world_center,occlusion_projected_center,radius,stroke_width,view_scale,surface_vectors);visibility+=float(!isOccluded(frag_pos));}}visibility/=float(NUM_VISIBILITY_RINGS)*float(NUM_SAMPLES_PER_RING); +#else +visibility=1.0; +#endif +#ifdef PROJECTION_GLOBE_VIEW +visibility=1.0; +#endif +v_visibility=visibility;lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur); +#ifdef FOG +v_fog_pos=fog_position(world_center.xyz); +#endif +}`),clippingMask:Qt("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:Qt(`uniform highp float u_intensity;varying vec2 v_extrude; +#pragma mapbox: define highp float weight +#define GAUSS_COEF 0.3989422804014327 +void main() { +#pragma mapbox: initialize highp float weight +float 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); +#ifdef FOG +if (u_is_globe==0) {gl_FragColor.r*=pow(1.0-fog_opacity(v_fog_pos),2.0);} +#endif +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos; +#ifdef PROJECTION_GLOBE_VIEW +attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir; +#endif +varying vec2 v_extrude; +#pragma mapbox: define highp float weight +#pragma mapbox: define mediump float radius +const highp float ZERO=1.0/255.0/16.0; +#define GAUSS_COEF 0.3989422804014327 +void main(void) { +#pragma mapbox: initialize highp float weight +#pragma mapbox: initialize mediump float radius +vec2 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;vec2 tilePos=floor(a_pos*0.5);vec3 pos; +#ifdef PROJECTION_GLOBE_VIEW +vec3 pos_normal_3=a_pos_normal_3/16384.0;mat3 surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(tilePos)*elevation(tilePos);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*elevation(tilePos);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,tilePos,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition); +#else +pos=vec3(tilePos+extrude,elevation(tilePos)); +#endif +gl_Position=u_matrix*vec4(pos,1); +#ifdef FOG +v_fog_pos=fog_position(pos); +#endif +}`),heatmapTexture:Qt(`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; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(0.0); +#endif +}`,"attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=a_pos*0.5+0.5;}"),collisionBox:Qt("varying float v_placed;varying float v_notUsed;void main() {vec4 red =vec4(1.0,0.0,0.0,1.0);vec4 blue=vec4(0.0,0.0,1.0,0.5);gl_FragColor =mix(red,blue,step(0.5,v_placed))*0.5;gl_FragColor*=mix(1.0,0.1,step(0.5,v_notUsed));}",`attribute vec3 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;attribute float a_size_scale;attribute vec2 a_padding;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_pos+elevationVector(a_anchor_pos)*elevation(a_anchor_pos),1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp( +0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,1.5);gl_Position=projectedPoint;gl_Position.xy+=(a_extrude*a_size_scale+a_shift+a_padding)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}`),collisionCircle:Qt("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_2f;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_2f;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:Qt("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; +#ifdef PROJECTION_GLOBE_VIEW +attribute vec3 a_pos_3; +#endif +varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {float h=elevation(a_pos);v_uv=a_pos/8192.0; +#ifdef PROJECTION_GLOBE_VIEW +gl_Position=u_matrix*vec4(a_pos_3+elevationVector(a_pos)*h,1); +#else +gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,h,1); +#endif +}`),fill:Qt(`#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float opacity +vec4 out_color=color; +#ifdef LIGHTING_3D_MODE +out_color=apply_lighting(out_color); +#endif +#ifdef FOG +out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); +#endif +gl_FragColor=out_color*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec2 a_pos;uniform mat4 u_matrix; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float opacity +gl_Position=u_matrix*vec4(a_pos,0,1); +#ifdef FOG +v_fog_pos=fog_position(a_pos); +#endif +}`),fillOutline:Qt(`varying vec2 v_pos; +#pragma mapbox: define highp vec4 outline_color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 outline_color +#pragma mapbox: initialize lowp float opacity +float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=outline_color; +#ifdef LIGHTING_3D_MODE +out_color=apply_lighting(out_color); +#endif +#ifdef FOG +out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); +#endif +gl_FragColor=out_color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos; +#pragma mapbox: define highp vec4 outline_color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 outline_color +#pragma mapbox: initialize lowp float opacity +gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world; +#ifdef FOG +v_fog_pos=fog_position(a_pos); +#endif +}`),fillOutlinePattern:Qt(`uniform vec2 u_texsize;uniform sampler2D u_image;varying vec2 v_pos;varying vec2 v_pos_world; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern +vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);float dist=length(v_pos_world-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=texture2D(u_image,pos); +#ifdef LIGHTING_3D_MODE +out_color=apply_lighting(out_color); +#endif +#ifdef FOG +out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); +#endif +gl_FragColor=out_color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;varying vec2 v_pos_world; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern +#pragma mapbox: define lowp float pixel_ratio +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern +#pragma mapbox: initialize lowp float pixel_ratio +vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);v_pos_world=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world; +#ifdef FOG +v_fog_pos=fog_position(a_pos); +#endif +}`),fillPattern:Qt(`uniform vec2 u_texsize;uniform sampler2D u_image;varying vec2 v_pos; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern +vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos); +#ifdef LIGHTING_3D_MODE +out_color=apply_lighting(out_color); +#endif +#ifdef FOG +out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); +#endif +gl_FragColor=out_color*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern +#pragma mapbox: define lowp float pixel_ratio +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern +#pragma mapbox: initialize lowp float pixel_ratio +vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos); +#ifdef FOG +v_fog_pos=fog_position(a_pos); +#endif +}`),fillExtrusion:Qt(`varying vec4 v_color; +#ifdef RENDER_SHADOWS +varying highp vec4 v_pos_light_view_0;varying highp vec4 v_pos_light_view_1;varying float v_depth; +#endif +#ifdef FAUX_AO +uniform lowp vec2 u_ao;varying vec3 v_ao; +#endif +#ifdef ZERO_ROOF_RADIUS +varying vec4 v_roof_color; +#endif +#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) +varying highp vec3 v_normal; +#endif +void main() { +#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) +vec3 normal=v_normal; +#endif +float z;vec4 color; +#ifdef ZERO_ROOF_RADIUS +z=float(normal.z > 0.00001);color=mix(v_color,v_roof_color,z); +#else +color=v_color; +#endif +#ifdef FAUX_AO +float intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x; +#ifdef ZERO_ROOF_RADIUS +concave*=(1.0-z); +#endif +float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);color.rgb=color.rgb*shade; +#endif +#ifdef RENDER_SHADOWS +#ifdef ZERO_ROOF_RADIUS +normal=mix(normal,vec3(0.0,0.0,1.0),z); +#endif +color.xyz=shadowed_color_normal(color.xyz,normalize(normal),v_pos_light_view_0,v_pos_light_view_1,v_depth); +#endif +#ifdef FOG +color=fog_dither(fog_apply_premultiplied(color,v_fog_pos)); +#endif +gl_FragColor=color; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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;uniform float u_edge_radius;attribute vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos; +#ifdef PROJECTION_GLOBE_VIEW +attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift; +#endif +varying vec4 v_color; +#ifdef RENDER_SHADOWS +uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;varying highp vec4 v_pos_light_view_0;varying highp vec4 v_pos_light_view_1;varying float v_depth; +#endif +#ifdef ZERO_ROOF_RADIUS +varying vec4 v_roof_color; +#endif +#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) +varying highp vec3 v_normal; +#endif +#ifdef FAUX_AO +uniform lowp vec2 u_ao;varying vec3 v_ao; +#endif +#pragma mapbox: define highp float base +#pragma mapbox: define highp float height +#pragma mapbox: define highp vec4 color +void main() { +#pragma mapbox: initialize highp float base +#pragma mapbox: initialize highp float height +#pragma mapbox: initialize highp vec4 color +vec4 pos_nx=floor(a_pos_normal_ed*0.5);vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0)); +#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) +v_normal=normal; +#endif +base=max(0.0,base);height=max(0.0,top_up_ny.y==0.0 && top_up_ny.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0); +#if defined(HAS_CENTROID) || defined(TERRAIN) +centroid_pos=a_centroid_pos; +#endif +float ele=0.0;float h=0.0;float c_ele;vec3 pos; +#ifdef TERRAIN +bool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);pos=vec3(pos_nx.xy,h); +#else +h=t > 0.0 ? height : base;pos=vec3(pos_nx.xy,h); +#endif +#ifdef PROJECTION_GLOBE_VIEW +float lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*h);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,pos.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*pos.z;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition); +#endif +float hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(pos,1),AWAY,hidden); +#ifdef RENDER_SHADOWS +v_pos_light_view_0=u_light_matrix_0*vec4(pos,1);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1);v_depth=gl_Position.w; +#endif +float NdotL=0.0;float colorvalue=0.0; +#ifdef LIGHTING_3D_MODE +NdotL=calculate_NdotL(normal); +#else +colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),NdotL); +#endif +if (normal.y !=0.0) {float r=0.84; +#ifndef LIGHTING_3D_MODE +r=mix(0.7,0.98,1.0-u_lightintensity); +#endif +NdotL*=( +(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}v_color=vec4(0.0,0.0,0.0,1.0); +#ifdef FAUX_AO +float concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height; +#ifdef TERRAIN +top_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height); +#endif +v_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]); +#ifdef PROJECTION_GLOBE_VIEW +top_height+=u_height_lift; +#endif +gl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w; +#endif +#ifdef LIGHTING_3D_MODE +v_color=apply_lighting(color,NdotL); +#else +v_color.rgb+=clamp(color.rgb*NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0)); +#endif +v_color*=u_opacity; +#ifdef ZERO_ROOF_RADIUS +v_roof_color=vec4(0.0,0.0,0.0,1.0); +#ifdef LIGHTING_3D_MODE +v_roof_color=apply_lighting(color,calculate_NdotL(vec3(0.0,0.0,1.0))); +#else +float roofNdotL=clamp(u_lightpos.z,0.0,1.0);roofNdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),roofNdotL);v_roof_color.rgb+=clamp(color.rgb*roofNdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0)); +#endif +v_roof_color*=u_opacity; +#endif +#ifdef FOG +v_fog_pos=fog_position(pos); +#endif +}`),fillExtrusionPattern:Qt(`uniform vec2 u_texsize;uniform sampler2D u_image; +#ifdef FAUX_AO +uniform lowp vec2 u_ao;varying vec3 v_ao; +#endif +#ifdef LIGHTING_3D_MODE +varying float v_NdotL; +#endif +varying vec2 v_pos;varying vec4 v_lighting;uniform lowp float u_opacity; +#pragma mapbox: define lowp float base +#pragma mapbox: define lowp float height +#pragma mapbox: define lowp vec4 pattern +#pragma mapbox: define lowp float pixel_ratio +void main() { +#pragma mapbox: initialize lowp float base +#pragma mapbox: initialize lowp float height +#pragma mapbox: initialize mediump vec4 pattern +#pragma mapbox: initialize lowp float pixel_ratio +vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos); +#ifdef LIGHTING_3D_MODE +out_color=apply_lighting(out_color,v_NdotL)*u_opacity; +#else +out_color=out_color*v_lighting; +#endif +#ifdef FAUX_AO +float intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);out_color.rgb=out_color.rgb*shade; +#endif +#ifdef FOG +out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); +#endif +gl_FragColor=out_color; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform float u_tile_units_to_pixels;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 vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos; +#ifdef PROJECTION_GLOBE_VIEW +attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift; +#endif +varying vec2 v_pos;varying vec4 v_lighting; +#ifdef FAUX_AO +uniform lowp vec2 u_ao;varying vec3 v_ao; +#endif +#ifdef LIGHTING_3D_MODE +varying float v_NdotL; +#endif +#pragma mapbox: define lowp float base +#pragma mapbox: define lowp float height +#pragma mapbox: define lowp vec4 pattern +#pragma mapbox: define lowp float pixel_ratio +void main() { +#pragma mapbox: initialize lowp float base +#pragma mapbox: initialize lowp float height +#pragma mapbox: initialize mediump vec4 pattern +#pragma mapbox: initialize lowp float pixel_ratio +vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec4 pos_nx=floor(a_pos_normal_ed*0.5);mediump vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;mediump vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));float edgedistance=a_pos_normal_ed.w;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;base=max(0.0,base);height=max(0.0,height);float t=top_up_ny.x;float z=t > 0.0 ? height : base;vec2 centroid_pos=vec2(0.0); +#if defined(HAS_CENTROID) || defined(TERRAIN) +centroid_pos=a_centroid_pos; +#endif +float ele=0.0;float h=z;vec3 p;float c_ele; +#ifdef TERRAIN +bool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);p=vec3(pos_nx.xy,h); +#else +p=vec3(pos_nx.xy,z); +#endif +#ifdef PROJECTION_GLOBE_VIEW +float lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*(p.z+lift));vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,p.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*p.z;p=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition); +#endif +float hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(p,1),AWAY,hidden);vec2 pos=normal.z==1.0 +? pos_nx.xy +: vec2(edgedistance,z*u_height_factor);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float NdotL=0.0; +#ifdef LIGHTING_3D_MODE +NdotL=calculate_NdotL(normal); +#else +NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),NdotL); +#endif +if (normal.y !=0.0) {float r=0.84; +#ifndef LIGHTING_3D_MODE +r=mix(0.7,0.98,1.0-u_lightintensity); +#endif +NdotL*=( +(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));} +#ifdef FAUX_AO +float concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height; +#ifdef TERRAIN +top_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height); +#endif +v_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]); +#ifdef PROJECTION_GLOBE_VIEW +top_height+=u_height_lift; +#endif +gl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w; +#endif +#ifdef LIGHTING_3D_MODE +v_NdotL=NdotL; +#else +v_lighting.rgb+=clamp(NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity; +#endif +#ifdef FOG +v_fog_pos=fog_position(p); +#endif +}`),hillshadePrepare:Qt(`#ifdef GL_ES +precision highp float; +#endif +uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord) { +#ifdef TERRAIN_DEM_FLOAT_FORMAT +return texture2D(u_image,coord).a/4.0; +#else +vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0; +#endif +}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y));float b=getElevation(v_pos+vec2(0,-epsilon.y));float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y));float d=getElevation(v_pos+vec2(-epsilon.x,0));float e=getElevation(v_pos+vec2(epsilon.x,0));float f=getElevation(v_pos+vec2(-epsilon.x,epsilon.y));float g=getElevation(v_pos+vec2(0,epsilon.y));float h=getElevation(v_pos+vec2(epsilon.x,epsilon.y));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+e+e+h)-(a+d+d+f),(f+g+g+h)-(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); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"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:Qt(`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;void 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; +#ifdef LIGHTING_3D_MODE +gl_FragColor=apply_lighting(gl_FragColor); +#endif +#ifdef FOG +gl_FragColor=fog_dither(fog_apply_premultiplied(gl_FragColor,v_fog_pos)); +#endif +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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; +#ifdef FOG +v_fog_pos=fog_position(a_pos); +#endif +}`),line:Qt(`uniform lowp float u_device_pixel_ratio;uniform float u_alpha_discard_threshold;uniform highp vec2 u_trim_offset;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec4 v_uv; +#ifdef RENDER_LINE_DASH +uniform sampler2D u_dash_image;varying vec2 v_tex; +#endif +#ifdef RENDER_LINE_GRADIENT +uniform sampler2D u_gradient_image; +#endif +uniform float u_border_width;uniform vec4 u_border_color;float luminance(vec3 c) {return (c.r+c.r+c.b+c.g+c.g+c.g)*0.1667;} +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float floorwidth +#pragma mapbox: define lowp vec4 dash +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +float linearstep(float edge0,float edge1,float x) {return clamp((x-edge0)/(edge1-edge0),0.0,1.0);}void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float floorwidth +#pragma mapbox: initialize lowp vec4 dash +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +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); +#ifdef RENDER_LINE_DASH +float sdfdist=texture2D(u_dash_image,v_tex).a;float sdfgamma=1.0/(2.0*u_device_pixel_ratio)/dash.z;alpha*=linearstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist); +#endif +highp vec4 out_color; +#ifdef RENDER_LINE_GRADIENT +out_color=texture2D(u_gradient_image,v_uv.xy); +#else +out_color=color; +#endif +float trimmed=1.0; +#ifdef RENDER_LINE_TRIM_OFFSET +highp float start=v_uv[2];highp float end=v_uv[3];highp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=(start+(v_uv.x)*(end-start));if (trim_end > trim_start) {if (line_progress <=trim_end && line_progress >=trim_start) {out_color=vec4(0,0,0,0);trimmed=0.0;}} +#endif +#ifdef LIGHTING_3D_MODE +out_color=apply_lighting(out_color); +#endif +#ifdef FOG +out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); +#endif +#ifdef RENDER_LINE_ALPHA_DISCARD +if (alpha < u_alpha_discard_threshold) {discard;} +#endif +#ifdef RENDER_LINE_BORDER +float edgeBlur=(u_border_width+1.0/u_device_pixel_ratio);float alpha2=clamp(min(dist-(v_width2.t-edgeBlur),v_width2.s-dist)/edgeBlur,0.0,1.0);if (alpha2 < 1.) {float smoothAlpha=smoothstep(0.6,1.0,alpha2); +#ifdef RENDER_LINE_BORDER_AUTO +float Y=(out_color.a > 0.01) ? luminance(out_color.rgb/out_color.a) : 1.;float adjustment=(Y > 0.) ? 0.5/Y : 0.45;if (out_color.a > 0.25 && Y < 0.25) {vec3 borderColor=(Y > 0.) ? out_color.rgb : vec3(1,1,1)*out_color.a;out_color.rgb=out_color.rgb+borderColor*(adjustment*(1.0-smoothAlpha));} else {out_color.rgb*=(0.6 +0.4*smoothAlpha);} +#else +out_color.rgb=mix(u_border_color.rgb*u_border_color.a*trimmed,out_color.rgb,smoothAlpha); +#endif +} +#endif +gl_FragColor=out_color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define EXTRUDE_SCALE 0.015873016 +attribute vec2 a_pos_normal;attribute vec4 a_data; +#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET) +attribute highp vec4 a_packed; +#endif +#ifdef RENDER_LINE_DASH +attribute float a_linesofar; +#endif +uniform mat4 u_matrix;uniform mat2 u_pixels_to_tile_units;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 vec4 v_uv; +#ifdef RENDER_LINE_DASH +uniform vec2 u_texsize;uniform float u_tile_units_to_pixels;varying vec2 v_tex; +#endif +#ifdef RENDER_LINE_GRADIENT +uniform float u_image_height; +#endif +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float floorwidth +#pragma mapbox: define lowp vec4 dash +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float floorwidth +#pragma mapbox: initialize lowp vec4 dash +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float width +float 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;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*EXTRUDE_SCALE;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*EXTRUDE_SCALE*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist*u_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude; +#ifndef RENDER_TO_TEXTURE +float 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; +#else +v_gamma_scale=1.0; +#endif +#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET) +float a_uv_x=a_packed[0];float a_split_index=a_packed[1];highp float a_clip_start=a_packed[2];highp float a_clip_end=a_packed[3]; +#ifdef RENDER_LINE_GRADIENT +highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec4(a_uv_x,a_split_index*texel_height-half_texel_height,a_clip_start,a_clip_end); +#else +v_uv=vec4(a_uv_x,0.0,a_clip_start,a_clip_end); +#endif +#endif +#ifdef RENDER_LINE_DASH +float scale=dash.z==0.0 ? 0.0 : u_tile_units_to_pixels/dash.z;float height=dash.y;v_tex=vec2(a_linesofar*scale/floorwidth,(-normal.y*height+dash.x+0.5)/u_texsize.y); +#endif +v_width2=vec2(outset,inset); +#ifdef FOG +v_fog_pos=fog_position(pos); +#endif +}`),linePattern:Qt(`uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_tile_units_to_pixels;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; +#pragma mapbox: define lowp vec4 pattern +#pragma mapbox: define lowp float pixel_ratio +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize mediump vec4 pattern +#pragma mapbox: initialize lowp float pixel_ratio +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;vec2 pattern_size=vec2(display_size.x/u_tile_units_to_pixels,display_size.y);float aspect=display_size.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=mod(v_linesofar/pattern_size.x*aspect,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(x,y));vec4 color=texture2D(u_image,pos); +#ifdef LIGHTING_3D_MODE +color=apply_lighting(color); +#endif +#ifdef FOG +color=fog_dither(fog_apply_premultiplied(color,v_fog_pos)); +#endif +gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_linesofar;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mat2 u_pixels_to_tile_units;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; +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +#pragma mapbox: define lowp vec4 pattern +#pragma mapbox: define lowp float pixel_ratio +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +#pragma mapbox: initialize mediump vec4 pattern +#pragma mapbox: initialize lowp float pixel_ratio +float 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;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_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude; +#ifndef RENDER_TO_TEXTURE +float 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; +#else +v_gamma_scale=1.0; +#endif +v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth; +#ifdef FOG +v_fog_pos=fog_position(pos); +#endif +}`),raster:Qt(`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);vec3 out_color=mix(u_high_vec,u_low_vec,rgb); +#ifdef LIGHTING_3D_MODE +out_color=apply_lighting(out_color); +#endif +#ifdef FOG +out_color=fog_dither(fog_apply(out_color,v_fog_pos)); +#endif +gl_FragColor=vec4(out_color*color.a,color.a); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform vec2 u_perspective_transform;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {float w=1.0+dot(a_texture_pos,u_perspective_transform);gl_Position=u_matrix*vec4(a_pos*w,0,w);v_pos0=a_texture_pos/8192.0;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent; +#ifdef FOG +v_fog_pos=fog_position(a_pos); +#endif +}`),symbolIcon:Qt(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize lowp float opacity +lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_pixeloffset;attribute vec4 a_projected_pos;attribute float a_fade_opacity; +#ifdef PROJECTION_GLOBE_VIEW +attribute vec3 a_globe_anchor;attribute vec3 a_globe_normal; +#endif +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 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 vec3 u_up_vector; +#ifdef PROJECTION_GLOBE_VIEW +uniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix; +#endif +varying vec2 v_tex;varying float v_fade_opacity; +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize lowp float opacity +vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_min_font_scale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[3];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 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos; +#ifdef PROJECTION_GLOBE_VIEW +mercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0; +#else +world_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0; +#endif +vec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ? +camera_to_anchor_distance/u_camera_to_center_distance : +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp( +0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjected_point; +#ifdef PROJECTION_GLOBE_VIEW +vec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetProjected_point=u_matrix*vec4(a_globe_anchor+displacement,1); +#else +offsetProjected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1); +#endif +vec2 a=projected_point.xy/projected_point.w;vec2 b=offsetProjected_point.xy/offsetProjected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos; +#ifdef PROJECTION_GLOBE_VIEW +vec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0); +#else +projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0); +#endif +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);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*max(a_min_font_scale,font_scale)+a_pxoffset/16.0); +#ifdef TERRAIN +#ifdef PITCH_WITH_MAP_TERRAIN +vec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy); +#endif +#endif +float occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade; +#ifdef PROJECTION_GLOBE_VIEW +vec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); +#else +gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); +#endif +float projection_transition_fade=1.0; +#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW) +projection_transition_fade=1.0-step(EPSILON,u_zoom_transition); +#endif +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;v_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change))*projection_transition_fade;}`),symbolSDF:Qt(`#define SDF_PX 8.0 +uniform 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; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +float 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 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); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_pixeloffset;attribute vec4 a_projected_pos;attribute float a_fade_opacity; +#ifdef PROJECTION_GLOBE_VIEW +attribute vec3 a_globe_anchor;attribute vec3 a_globe_normal; +#endif +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_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 vec3 u_up_vector; +#ifdef PROJECTION_GLOBE_VIEW +uniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix; +#endif +varying vec2 v_data0;varying vec3 v_data1; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[3];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 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos; +#ifdef PROJECTION_GLOBE_VIEW +mercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0; +#else +world_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0; +#endif +vec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ? +camera_to_anchor_distance/u_camera_to_center_distance : +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp( +0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetprojected_point; +#ifdef PROJECTION_GLOBE_VIEW +vec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetprojected_point=u_matrix*vec4(a_globe_anchor+displacement,1); +#else +offsetprojected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1); +#endif +vec2 a=projected_point.xy/projected_point.w;vec2 b=offsetprojected_point.xy/offsetprojected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos; +#ifdef PROJECTION_GLOBE_VIEW +vec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0); +#else +projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0); +#endif +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);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset); +#ifdef TERRAIN +#ifdef PITCH_WITH_MAP_TERRAIN +vec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy); +#endif +#endif +float occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade; +#ifdef PROJECTION_GLOBE_VIEW +vec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); +#else +gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); +#endif +float gamma_scale=gl_Position.w;float projection_transition_fade=1.0; +#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW) +projection_transition_fade=1.0-step(EPSILON,u_zoom_transition); +#endif +vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity*projection_transition_fade);}`),symbolTextAndIcon:Qt(`#define SDF_PX 8.0 +#define SDF 1.0 +#define ICON 0.0 +uniform 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; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +float 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; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +return;}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); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_projected_pos;attribute float a_fade_opacity; +#ifdef PROJECTION_GLOBE_VIEW +attribute vec3 a_globe_anchor;attribute vec3 a_globe_normal; +#endif +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_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 vec3 u_up_vector;uniform vec2 u_texsize_icon; +#ifdef PROJECTION_GLOBE_VIEW +uniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix; +#endif +varying vec4 v_data0;varying vec4 v_data1; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[3];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 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos; +#ifdef PROJECTION_GLOBE_VIEW +mercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0; +#else +world_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0; +#endif +vec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ? +camera_to_anchor_distance/u_camera_to_center_distance : +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp( +0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offset_projected_point=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projected_point.xy/projected_point.w;vec2 b=offset_projected_point.xy/offset_projected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos; +#ifdef PROJECTION_GLOBE_VIEW +vec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0); +#else +projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0); +#endif +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);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*font_scale); +#ifdef TERRAIN +#ifdef PITCH_WITH_MAP_TERRAIN +vec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy); +#endif +#endif +float occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade; +#ifdef PROJECTION_GLOBE_VIEW +vec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); +#else +gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); +#endif +float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));float projection_transition_fade=1.0; +#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW) +projection_transition_fade=1.0-step(EPSILON,u_zoom_transition); +#endif +v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity*projection_transition_fade,is_sdf);}`),terrainRaster:Qt(`uniform sampler2D u_image0;varying vec2 v_pos0; +#ifdef FOG +varying float v_fog_opacity; +#endif +#ifdef RENDER_SHADOWS +varying vec4 v_pos_light_view_0;varying vec4 v_pos_light_view_1;varying float v_depth; +#endif +void main() {vec4 color=texture2D(u_image0,v_pos0); +#ifdef RENDER_SHADOWS +color.xyz=shadowed_color(color.xyz,v_pos_light_view_0,v_pos_light_view_1,v_depth); +#endif +#ifdef FOG +#ifdef ZERO_EXAGGERATION +color=fog_dither(fog_apply_premultiplied(color,v_fog_pos)); +#else +color=fog_dither(fog_apply_from_vert(color,v_fog_opacity)); +#endif +#endif +gl_FragColor=color; +#ifdef TERRAIN_WIREFRAME +gl_FragColor=vec4(1.0,0.0,0.0,0.8); +#endif +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform float u_skirt_height;attribute vec2 a_pos;varying vec2 v_pos0; +#ifdef FOG +varying float v_fog_opacity; +#endif +#ifdef RENDER_SHADOWS +uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;varying vec4 v_pos_light_view_0;varying vec4 v_pos_light_view_1;varying float v_depth; +#endif +const float wireframeOffset=0.00015;void main() {vec3 decomposedPosAndSkirt=decomposeToPosAndSkirt(a_pos);float skirt=decomposedPosAndSkirt.z;vec2 decodedPos=decomposedPosAndSkirt.xy;float elevation=elevation(decodedPos)-skirt*u_skirt_height; +#ifdef TERRAIN_WIREFRAME +elevation+=wireframeOffset; +#endif +v_pos0=decodedPos/8192.0;gl_Position=u_matrix*vec4(decodedPos,elevation,1.0); +#ifdef FOG +#ifdef ZERO_EXAGGERATION +v_fog_pos=fog_position(decodedPos); +#else +v_fog_opacity=fog(fog_position(vec3(decodedPos,elevation))); +#endif +#endif +#ifdef RENDER_SHADOWS +vec3 pos=vec3(decodedPos,elevation);v_pos_light_view_0=u_light_matrix_0*vec4(pos,1.);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1.);v_depth=gl_Position.w; +#endif +}`),terrainDepth:Qt(`#ifdef GL_ES +precision highp float; +#endif +varying float v_depth;void main() {gl_FragColor=pack_depth(v_depth);}`,"uniform mat4 u_matrix;attribute vec2 a_pos;varying float v_depth;void main() {float elevation=elevation(a_pos);gl_Position=u_matrix*vec4(a_pos,elevation,1.0);v_depth=gl_Position.z/gl_Position.w;}"),skybox:Qt(` +varying lowp vec3 v_uv;uniform lowp samplerCube u_cubemap;uniform lowp float u_opacity;uniform highp float u_temporal_offset;uniform highp vec3 u_sun_direction;float sun_disk(highp vec3 ray_direction,highp vec3 sun_direction) {highp float cos_angle=dot(normalize(ray_direction),sun_direction);const highp float cos_sun_angular_diameter=0.99996192306;const highp float smoothstep_delta=1e-5;return smoothstep( +cos_sun_angular_diameter-smoothstep_delta,cos_sun_angular_diameter+smoothstep_delta,cos_angle);}float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec3 uv=v_uv;const float y_bias=0.015;uv.y+=y_bias;uv.y=pow(abs(uv.y),1.0/5.0);uv.y=map(uv.y,0.0,1.0,-1.0,1.0);vec3 sky_color=textureCube(u_cubemap,uv).rgb; +#ifdef FOG +sky_color=fog_apply_sky_gradient(v_uv.xzy,sky_color); +#endif +sky_color.rgb=dither(sky_color.rgb,gl_FragCoord.xy+u_temporal_offset);sky_color+=0.1*sun_disk(v_uv,u_sun_direction);gl_FragColor=vec4(sky_color*u_opacity,u_opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,Ps),skyboxGradient:Qt(`varying highp vec3 v_uv;uniform lowp sampler2D u_color_ramp;uniform highp vec3 u_center_direction;uniform lowp float u_radius;uniform lowp float u_opacity;uniform highp float u_temporal_offset;void main() {float progress=acos(dot(normalize(v_uv),u_center_direction))/u_radius;vec4 color=texture2D(u_color_ramp,vec2(progress,0.5)); +#ifdef FOG +color.rgb=fog_apply_sky_gradient(v_uv.xzy,color.rgb/color.a)*color.a; +#endif +color*=u_opacity;color.rgb=dither(color.rgb,gl_FragCoord.xy+u_temporal_offset);gl_FragColor=color; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,Ps),skyboxCapture:Qt(` +varying highp vec3 v_position;uniform highp float u_sun_intensity;uniform highp float u_luminance;uniform lowp vec3 u_sun_direction;uniform highp vec4 u_color_tint_r;uniform highp vec4 u_color_tint_m; +#ifdef GL_ES +precision highp float; +#endif +#define BETA_R vec3(5.5e-6,13.0e-6,22.4e-6) +#define BETA_M vec3(21e-6,21e-6,21e-6) +#define MIE_G 0.76 +#define DENSITY_HEIGHT_SCALE_R 8000.0 +#define DENSITY_HEIGHT_SCALE_M 1200.0 +#define PLANET_RADIUS 6360e3 +#define ATMOSPHERE_RADIUS 6420e3 +#define SAMPLE_STEPS 10 +#define DENSITY_STEPS 4 +float ray_sphere_exit(vec3 orig,vec3 dir,float radius) {float a=dot(dir,dir);float b=2.0*dot(dir,orig);float c=dot(orig,orig)-radius*radius;float d=sqrt(b*b-4.0*a*c);return (-b+d)/(2.0*a);}vec3 extinction(vec2 density) {return exp(-vec3(BETA_R*u_color_tint_r.a*density.x+BETA_M*u_color_tint_m.a*density.y));}vec2 local_density(vec3 point) {float height=max(length(point)-PLANET_RADIUS,0.0);float exp_r=exp(-height/DENSITY_HEIGHT_SCALE_R);float exp_m=exp(-height/DENSITY_HEIGHT_SCALE_M);return vec2(exp_r,exp_m);}float phase_ray(float cos_angle) {return (3.0/(16.0*PI))*(1.0+cos_angle*cos_angle);}float phase_mie(float cos_angle) {return (3.0/(8.0*PI))*((1.0-MIE_G*MIE_G)*(1.0+cos_angle*cos_angle))/((2.0+MIE_G*MIE_G)*pow(1.0+MIE_G*MIE_G-2.0*MIE_G*cos_angle,1.5));}vec2 density_to_atmosphere(vec3 point,vec3 light_dir) {float ray_len=ray_sphere_exit(point,light_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(DENSITY_STEPS);vec2 density_point_to_atmosphere=vec2(0.0);for (int i=0; i < DENSITY_STEPS;++i) {vec3 point_on_ray=point+light_dir*((float(i)+0.5)*step_len);density_point_to_atmosphere+=local_density(point_on_ray)*step_len;;}return density_point_to_atmosphere;}vec3 atmosphere(vec3 ray_dir,vec3 sun_direction,float sun_intensity) {vec2 density_orig_to_point=vec2(0.0);vec3 scatter_r=vec3(0.0);vec3 scatter_m=vec3(0.0);vec3 origin=vec3(0.0,PLANET_RADIUS,0.0);float ray_len=ray_sphere_exit(origin,ray_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(SAMPLE_STEPS);for (int i=0; i < SAMPLE_STEPS;++i) {vec3 point_on_ray=origin+ray_dir*((float(i)+0.5)*step_len);vec2 density=local_density(point_on_ray)*step_len;density_orig_to_point+=density;vec2 density_point_to_atmosphere=density_to_atmosphere(point_on_ray,sun_direction);vec2 density_orig_to_atmosphere=density_orig_to_point+density_point_to_atmosphere;vec3 extinction=extinction(density_orig_to_atmosphere);scatter_r+=density.x*extinction;scatter_m+=density.y*extinction;}float cos_angle=dot(ray_dir,sun_direction);float phase_r=phase_ray(cos_angle);float phase_m=phase_mie(cos_angle);vec3 beta_r=BETA_R*u_color_tint_r.rgb*u_color_tint_r.a;vec3 beta_m=BETA_M*u_color_tint_m.rgb*u_color_tint_m.a;return (scatter_r*phase_r*beta_r+scatter_m*phase_m*beta_m)*sun_intensity;}const float A=0.15;const float B=0.50;const float C=0.10;const float D=0.20;const float E=0.02;const float F=0.30;vec3 uncharted2_tonemap(vec3 x) {return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;}void main() {vec3 ray_direction=v_position;ray_direction.y=pow(ray_direction.y,5.0);const float y_bias=0.015;ray_direction.y+=y_bias;vec3 color=atmosphere(normalize(ray_direction),u_sun_direction,u_sun_intensity);float white_scale=1.0748724675633854;color=uncharted2_tonemap((log2(2.0/pow(u_luminance,4.0)))*color)*white_scale;gl_FragColor=vec4(color,1.0);}`,"attribute highp vec3 a_pos_3f;uniform mat3 u_matrix_3f;varying highp vec3 v_position;float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec4 pos=vec4(u_matrix_3f*a_pos_3f,1.0);v_position=pos.xyz;v_position.y*=-1.0;v_position.y=map(v_position.y,-1.0,1.0,0.0,1.0);gl_Position=vec4(a_pos_3f.xy,0.0,1.0);}"),globeRaster:Qt(`uniform sampler2D u_image0;varying vec2 v_pos0; +#ifndef FOG +uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform vec2 u_viewport; +#endif +void main() {vec4 color; +#ifdef CUSTOM_ANTIALIASING +vec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix( +mix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);vec3 dir=normalize(ray_dir);vec3 closest_point=dot(u_globe_pos,dir)*dir;float norm_dist_from_center=1.0-length(closest_point-u_globe_pos)/u_globe_radius;const float antialias_pixel=2.0;float antialias_factor=antialias_pixel*fwidth(norm_dist_from_center);float antialias=smoothstep(0.0,antialias_factor,norm_dist_from_center);vec4 raster=texture2D(u_image0,v_pos0);color=vec4(raster.rgb*antialias,raster.a*antialias); +#else +color=texture2D(u_image0,v_pos0); +#endif +#ifdef FOG +color=fog_dither(fog_apply_premultiplied(color,v_fog_pos)); +#endif +gl_FragColor=color; +#ifdef TERRAIN_WIREFRAME +gl_FragColor=vec4(1.0,0.0,0.0,0.8); +#endif +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_proj_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform float u_zoom_transition;uniform vec2 u_merc_center;uniform mat3 u_grid_matrix;uniform float u_skirt_height; +#ifdef GLOBE_POLES +attribute vec3 a_globe_pos;attribute vec2 a_uv; +#else +attribute vec2 a_pos; +#endif +varying vec2 v_pos0;const float wireframeOffset=1e3;float mercatorXfromLng(float lng) {return (180.0+lng)/360.0;}float mercatorYfromLat(float lat) {return (180.0-(RAD_TO_DEG*log(tan(QUARTER_PI+lat/2.0*DEG_TO_RAD))))/360.0;}vec3 latLngToECEF(vec2 latLng) {latLng=DEG_TO_RAD*latLng;float cosLat=cos(latLng[0]);float sinLat=sin(latLng[0]);float cosLng=cos(latLng[1]);float sinLng=sin(latLng[1]);float sx=cosLat*sinLng*GLOBE_RADIUS;float sy=-sinLat*GLOBE_RADIUS;float sz=cosLat*cosLng*GLOBE_RADIUS;return vec3(sx,sy,sz);}void main() { +#ifdef GLOBE_POLES +vec3 globe_pos=a_globe_pos;vec2 uv=a_uv; +#else +float tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];vec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float uvY=mercatorY*tiles-idy;float mercatorX=mercatorXfromLng(latLng[1]);float uvX=mercatorX*tiles-idx;vec3 globe_pos=latLngToECEF(latLng.xy);vec2 merc_pos=vec2(mercatorX,mercatorY);vec2 uv=vec2(uvX,uvY); +#endif +v_pos0=uv;vec2 tile_pos=uv*EXTENT;vec3 globe_derived_up_vector=normalize(globe_pos)*u_tile_up_scale; +#ifdef GLOBE_POLES +vec3 up_vector=globe_derived_up_vector; +#else +vec3 up_vector=elevationVector(tile_pos); +#endif +float height=elevation(tile_pos); +#ifdef TERRAIN_WIREFRAME +height+=wireframeOffset; +#endif +globe_pos+=up_vector*height; +#ifndef GLOBE_POLES +globe_pos-=globe_derived_up_vector*u_skirt_height*decomposed_pos_and_skirt.z; +#endif +#ifdef GLOBE_POLES +vec4 interpolated_pos=u_globe_matrix*vec4(globe_pos,1.0); +#else +vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {merc_world_pos=vec4(merc_pos,height-u_skirt_height*decomposed_pos_and_skirt.z,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition),1.0); +#endif +gl_Position=u_proj_matrix*interpolated_pos; +#ifdef FOG +v_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz); +#endif +}`),globeAtmosphere:Qt(`uniform float u_transition;uniform highp float u_fadeout_range;uniform highp float u_temporal_offset;uniform vec3 u_start_color;uniform vec4 u_color;uniform vec4 u_space_color;uniform vec4 u_high_color;uniform float u_star_intensity;uniform float u_star_size;uniform float u_star_density;uniform float u_horizon_angle;uniform mat4 u_rotation_matrix;varying highp vec3 v_ray_dir;varying highp vec3 v_horizon_dir;highp float random(highp vec3 p) {p=fract(p*vec3(23.2342,97.1231,91.2342));p+=dot(p.zxy,p.yxz+123.1234);return fract(p.x*p.y);}float stars(vec3 p,float scale,vec2 offset) {vec2 uv_scale=(u_viewport/u_star_size)*scale;vec3 position=vec3(p.xy*uv_scale+offset*u_viewport,p.z);vec3 q=fract(position)-0.5;vec3 id=floor(position);float random_visibility=step(random(id),u_star_density);float circle=smoothstep(0.5+u_star_intensity,0.5,length(q));return circle*random_visibility;}void main() {highp vec3 dir=normalize(v_ray_dir);float globe_pos_dot_dir; +#ifdef PROJECTION_GLOBE_VIEW +globe_pos_dot_dir=dot(u_globe_pos,dir);highp vec3 closest_point_forward=abs(globe_pos_dot_dir)*dir;float norm_dist_from_center=length(closest_point_forward-u_globe_pos)/u_globe_radius;if (norm_dist_from_center < 0.98) {discard;return;} +#endif +highp vec3 horizon_dir=normalize(v_horizon_dir);float horizon_angle_mercator=dir.y < horizon_dir.y ? +0.0 : max(acos(dot(dir,horizon_dir)),0.0);float horizon_angle; +#ifdef PROJECTION_GLOBE_VIEW +highp vec3 closest_point=globe_pos_dot_dir*dir;float closest_point_to_center=length(closest_point-u_globe_pos);float theta=asin(clamp(closest_point_to_center/length(u_globe_pos),-1.0,1.0));horizon_angle=globe_pos_dot_dir < 0.0 ? +PI-theta-u_horizon_angle : theta-u_horizon_angle;float angle_t=pow(u_transition,10.0);horizon_angle=mix(horizon_angle,horizon_angle_mercator,angle_t); +#else +horizon_angle=horizon_angle_mercator; +#endif +horizon_angle/=PI;float t=exp(-horizon_angle/u_fadeout_range);float alpha_0=u_color.a;float alpha_1=u_high_color.a;float alpha_2=u_space_color.a;vec3 color_stop_0=u_color.rgb;vec3 color_stop_1=u_high_color.rgb;vec3 color_stop_2=u_space_color.rgb;vec3 c0=mix(color_stop_2,color_stop_1,alpha_1);vec3 c1=mix(c0,color_stop_0,alpha_0);vec3 c2=mix(c0,c1,t);vec3 c =mix(color_stop_2,c2,t);float a0=mix(alpha_2,1.0,alpha_1);float a1=mix(a0,1.0,alpha_0);float a2=mix(a0,a1,t);float a =mix(alpha_2,a2,t);vec2 uv=gl_FragCoord.xy/u_viewport-0.5;float aspect_ratio=u_viewport.x/u_viewport.y;vec4 uv_dir=vec4(normalize(vec3(uv.x*aspect_ratio,uv.y,1.0)),1.0);uv_dir=u_rotation_matrix*uv_dir;vec3 n=abs(uv_dir.xyz);vec2 uv_remap=(n.x > n.y && n.x > n.z) ? uv_dir.yz/uv_dir.x: +(n.y > n.x && n.y > n.z) ? uv_dir.zx/uv_dir.y: +uv_dir.xy/uv_dir.z;uv_remap.x/=aspect_ratio;vec3 D=vec3(uv_remap,1.0);highp float star_field=0.0;if (u_star_intensity > 0.0) {star_field+=stars(D,1.2,vec2(0.0,0.0));star_field+=stars(D,1.0,vec2(1.0,0.0));star_field+=stars(D,0.8,vec2(0.0,1.0));star_field+=stars(D,0.6,vec2(1.0,1.0));star_field*=(1.0-pow(t,0.25+(1.0-u_high_color.a)*0.75));c+=star_field*alpha_2;}c=dither(c,gl_FragCoord.xy+u_temporal_offset);gl_FragColor=vec4(c,a);}`,`attribute vec3 a_pos;attribute vec2 a_uv;uniform vec3 u_frustum_tl;uniform vec3 u_frustum_tr;uniform vec3 u_frustum_br;uniform vec3 u_frustum_bl;uniform float u_horizon;varying highp vec3 v_ray_dir;varying highp vec3 v_horizon_dir;void main() {v_ray_dir=mix( +mix(u_frustum_tl,u_frustum_tr,a_uv.x),mix(u_frustum_bl,u_frustum_br,a_uv.x),a_uv.y);v_horizon_dir=mix( +mix(u_frustum_tl,u_frustum_bl,u_horizon),mix(u_frustum_tr,u_frustum_br,u_horizon),a_uv.x);gl_Position=vec4(a_pos,1.0);}`)};function ga(d,o){const c=d.replace(/\s*\/\/[^\n]*\n/g,` +`).split(` +`);for(let f of c)if(f=f.trim(),f[0]==="#"&&f.includes("if")&&!f.includes("endif")){f=f.replace("#","").replace(/ifdef|ifndef|elif|if/g,"").replace(/!|defined|\(|\)|\|\||&&/g,"").replace(/\s+/g," ").trim();const _=f.split(" ");for(const x of _)o.includes(x)||o.push(x)}}function Qt(d,o){const c=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,f=o.match(/attribute (highp |mediump |lowp )?([\w]+) ([\w]+)/g),_={},x=[...Il];return ga(d,x),ga(o,x),{fragmentSource:d=d.replace(c,(T,S,C,z,P)=>(_[P]=!0,S==="define"?` +#ifndef HAS_UNIFORM_u_${P} +varying ${C} ${z} ${P}; +#else +uniform ${C} ${z} u_${P}; +#endif +`:` +#ifdef HAS_UNIFORM_u_${P} + ${C} ${z} ${P} = u_${P}; +#endif +`)),vertexSource:o=o.replace(c,(T,S,C,z,P)=>{const O=z==="float"?"vec2":"vec4",j=P.match(/color/)?"color":O;return _[P]?S==="define"?` +#ifndef HAS_UNIFORM_u_${P} +uniform lowp float u_${P}_t; +attribute ${C} ${O} a_${P}; +varying ${C} ${z} ${P}; +#else +uniform ${C} ${z} u_${P}; +#endif +`:j==="vec4"?` +#ifndef HAS_UNIFORM_u_${P} + ${P} = a_${P}; +#else + ${C} ${z} ${P} = u_${P}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${P} + ${P} = unpack_mix_${j}(a_${P}, u_${P}_t); +#else + ${C} ${z} ${P} = u_${P}; +#endif +`:S==="define"?` +#ifndef HAS_UNIFORM_u_${P} +uniform lowp float u_${P}_t; +attribute ${C} ${O} a_${P}; +#else +uniform ${C} ${z} u_${P}; +#endif +`:j==="vec4"?` +#ifndef HAS_UNIFORM_u_${P} + ${C} ${z} ${P} = a_${P}; +#else + ${C} ${z} ${P} = u_${P}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${P} + ${C} ${z} ${P} = unpack_mix_${j}(a_${P}, u_${P}_t); +#else + ${C} ${z} ${P} = u_${P}; +#endif +`}),staticAttributes:f,usedDefines:x}}class W_{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffers=[],this.vao=null}bind(o,c,f,_,x,T,S){this.context=o;let C=this.boundPaintVertexBuffers.length!==_.length;for(let P=0;!C&&P<_.length;P++)this.boundPaintVertexBuffers[P]!==_[P]&&(C=!0);let z=this.boundDynamicVertexBuffers.length!==S.length;for(let P=0;!z&&P{const Q=B.paint.get("hillshade-shadow-color"),ee=B.paint.get("hillshade-highlight-color"),de=B.paint.get("hillshade-accent-color");let fe=B.paint.get("hillshade-illumination-direction")*(Math.PI/180);B.paint.get("hillshade-illumination-anchor")==="viewport"&&(fe-=Z.transform.angle);const pe=!Z.options.moving;return{u_matrix:q||Z.transform.calculateProjMatrix(X.tileID.toUnwrapped(),pe),u_image:0,u_latrange:Oh(0,X.tileID),u_light:[B.paint.get("hillshade-exaggeration"),fe],u_shadow:Q,u_highlight:ee,u_accent:de}})(d,c,f,d.terrain?o.projMatrix:null);d.prepareDrawProgram(S,P,o.toUnwrapped());const{tileBoundsBuffer:j,tileBoundsIndexBuffer:W,tileBoundsSegments:H}=d.getTileBoundsBuffers(c);P.draw(S,C.TRIANGLES,_,x,T,s.CullFaceMode.disabled,O,f.id,j,W,H)}function Bh(d,o,c){if(!o.needsDEMTextureUpload)return;const f=d.context,_=f.gl;f.pixelStoreUnpackPremultiplyAlpha.set(!1),o.demTexture=o.demTexture||d.getTileTexture(c.stride);const x=c.getPixels();o.demTexture?o.demTexture.update(x,{premultiply:!1}):o.demTexture=new s.Texture(f,x,_.RGBA,{premultiply:!1}),o.needsDEMTextureUpload=!1}function gf(d,o,c,f,_,x){const T=d.context,S=T.gl;if(!o.dem)return;const C=o.dem;if(T.activeTexture.set(S.TEXTURE1),Bh(d,o,C),!o.demTexture)return;o.demTexture.bind(S.NEAREST,S.CLAMP_TO_EDGE);const z=C.dim;T.activeTexture.set(S.TEXTURE0);let P=o.fbo;if(!P){const H=new s.Texture(T,{width:z,height:z,data:null},S.RGBA);H.bind(S.LINEAR,S.CLAMP_TO_EDGE),P=o.fbo=T.createFramebuffer(z,z,!0),P.colorAttachment.set(H.texture)}T.bindFramebuffer.set(P.framebuffer),T.viewport.set([0,0,z,z]);const{tileBoundsBuffer:O,tileBoundsIndexBuffer:j,tileBoundsSegments:W}=d.getMercatorTileBoundsBuffers();d.useProgram("hillshadePrepare").draw(T,S.TRIANGLES,f,_,x,s.CullFaceMode.disabled,((H,Z)=>{const X=Z.stride,B=s.create();return s.ortho(B,0,s.EXTENT,-s.EXTENT,0,0,1),s.translate(B,B,[0,-s.EXTENT,0]),{u_matrix:B,u_image:1,u_dimension:[X,X],u_zoom:H.overscaledZ,u_unpack:Z.unpackVector}})(o.tileID,C),c.id,O,j,W),o.needsHillshadePrepare=!1}const Fh=d=>({u_matrix:new s.UniformMatrix4f(d),u_image0:new s.Uniform1i(d),u_skirt_height:new s.Uniform1f(d)}),_a=(d,o)=>({u_matrix:d,u_image0:0,u_skirt_height:o}),Lc=(d,o,c,f,_,x,T,S,C,z,P,O,j,W,H)=>({u_proj_matrix:Float32Array.from(d),u_globe_matrix:o,u_normalize_matrix:Float32Array.from(f),u_merc_matrix:c,u_zoom_transition:_,u_merc_center:x,u_image0:0,u_frustum_tl:T,u_frustum_tr:S,u_frustum_br:C,u_frustum_bl:z,u_globe_pos:P,u_globe_radius:O,u_viewport:j,u_grid_matrix:H?Float32Array.from(H):new Float32Array(9),u_skirt_height:W});function ya(d,o){return d!=null&&o!=null&&!(!d.hasData()||!o.hasData())&&d.demTexture!=null&&o.demTexture!=null&&d.tileID.key!==o.tileID.key}const Co=new class{constructor(){this.operations={}}newMorphing(d,o,c,f,_){if(d in this.operations){const x=this.operations[d];x.to.tileID.key!==c.tileID.key&&(x.queued=c)}else this.operations[d]={startTime:f,phase:0,duration:_,from:o,to:c,queued:null}}getMorphValuesForProxy(d){if(!(d in this.operations))return null;const o=this.operations[d];return{from:o.from,to:o.to,phase:o.phase}}update(d){for(const o in this.operations){const c=this.operations[o];for(c.phase=(d-c.startTime)/c.duration;c.phase>=1||!this._validOp(c);)if(!this._nextOp(c,d)){delete this.operations[o];break}}}_nextOp(d,o){return!!d.queued&&(d.from=d.to,d.to=d.queued,d.queued=null,d.phase=0,d.startTime=o,!0)}_validOp(d){return d.from.hasData()&&d.to.hasData()}},zs={0:null,1:"TERRAIN_VERTEX_MORPHING",2:"TERRAIN_WIREFRAME"};function Rc(d){return 6*Math.pow(1.5,22-d)}function _f(d,o){const c=1<({u_matrix:d});function Nh(d,o,c,f,_){if(_>0){const x=s.exported.now(),T=(x-d.timeAdded)/_,S=o?(x-o.timeAdded)/_:-1,C=c.getSource(),z=f.coveringZoomLevel({tileSize:C.tileSize,roundZoom:C.roundZoom}),P=!o||Math.abs(o.tileID.overscaledZ-z)>Math.abs(d.tileID.overscaledZ-z),O=P&&d.refreshedUponExpiration?1:s.clamp(P?T:1-S,0,1);return d.refreshedUponExpiration&&T>=1&&(d.refreshedUponExpiration=!1),o?{opacity:1,mix:1-O}:{opacity:O,mix:0}}return{opacity:1,mix:0}}class Uh extends s.SourceCache{constructor(o){const c={type:"raster-dem",maxzoom:o.transform.maxZoom},f=new xt(ha(),null),_=Dt("mock-dem",c,f,o.style);super("mock-dem",_,!1),_.setEventedParent(this),this._sourceLoaded=!0}_loadTile(o,c){o.state="loaded",c(null)}}class Dc extends s.SourceCache{constructor(o){const c=Dt("proxy",{type:"geojson",maxzoom:o.transform.maxZoom},new xt(ha(),null),o.style);super("proxy",c,!1),c.setEventedParent(this),this.map=this.getSource().map=o,this.used=this._sourceLoaded=!0,this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}update(o,c,f){if(o.freezeTileCoverage)return;this.transform=o;const _=o.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}).reduce((x,T)=>{if(x[T.key]="",!this._tiles[T.key]){const S=new s.Tile(T,this._source.tileSize*T.overscaleFactor(),o.tileZoom);S.state="loaded",this._tiles[T.key]=S}return x},{});for(const x in this._tiles)x in _||(this.freeFBO(x),this._tiles[x].unloadVectorData(),delete this._tiles[x])}freeFBO(o){const c=this.proxyCachedFBO[o];if(c!==void 0){const f=Object.values(c);this.renderCachePool.push(...f),delete this.proxyCachedFBO[o]}}deallocRenderCache(){this.renderCache.forEach(o=>o.fb.destroy()),this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}}class Oc extends s.OverscaledTileID{constructor(o,c,f){super(o.overscaledZ,o.wrap,o.canonical.z,o.canonical.x,o.canonical.y),this.proxyTileKey=c,this.projMatrix=f}}class jh extends s.Elevation{constructor(o,c){super(),this.painter=o,this.terrainTileForTile={},this.prevTerrainTileForTile={};const[f,_,x]=function(C){const z=new s.StructArrayLayout2i4,P=new s.StructArrayLayout3ui6,O=131;z.reserve(17161),P.reserve(33800);const j=s.EXTENT/128,W=s.EXTENT+j/2,H=W+j;for(let X=-j;XW||X<0||X>W?24575:0,Q=s.clamp(Math.round(B),0,s.EXTENT),ee=s.clamp(Math.round(X),0,s.EXTENT);z.emplaceBack(Q+q,ee)}const Z=(X,B)=>{const q=B*O+X;P.emplaceBack(q+1,q,q+O),P.emplaceBack(q+O,q+O+1,q+1)};for(let X=1;X<129;X++)for(let B=1;B<129;B++)Z(B,X);return[0,129].forEach(X=>{for(let B=0;B<130;B++)Z(B,X),Z(X,B)}),[z,P,32768]}(),T=o.context;this.gridBuffer=T.createVertexBuffer(f,s.posAttributes.members),this.gridIndexBuffer=T.createIndexBuffer(_),this.gridSegments=s.SegmentVector.simpleSegment(0,0,f.length,_.length),this.gridNoSkirtSegments=s.SegmentVector.simpleSegment(0,0,f.length,x),this.proxyCoords=[],this.proxiedCoords={},this._visibleDemTiles=[],this._drapedRenderBatches=[],this._sourceTilesOverlap={},this.proxySourceCache=new Dc(c.map),this.orthoMatrix=s.create(),s.ortho(this.orthoMatrix,this.painter.transform.projection.name==="globe"?.015:0,s.EXTENT,0,s.EXTENT,0,1);const S=T.gl;this._overlapStencilMode=new s.StencilMode({func:S.GEQUAL,mask:255},0,255,S.KEEP,S.KEEP,S.REPLACE),this._previousZoom=o.transform.zoom,this.pool=[],this._findCoveringTileCache={},this._tilesDirty={},this.style=c,this._useVertexMorphing=!0,this._exaggeration=1,this._mockSourceCache=new Uh(c.map)}set style(o){o.on("data",this._onStyleDataEvent.bind(this)),o.on("neworder",this._checkRenderCacheEfficiency.bind(this)),this._style=o,this._checkRenderCacheEfficiency(),this._style.map.on("moveend",()=>{this._clearLineLayersFromRenderCache()})}update(o,c,f){if(o&&o.terrain){this._style!==o&&(this.style=o),this.enabled=!0;const _=o.terrain.properties;this.sourceCache=o.terrain.drapeRenderMode===0?this._mockSourceCache:o._getSourceCache(_.get("source")),this._exaggeration=_.get("exaggeration");const x=()=>{this.sourceCache.used&&s.warnOnce(`Raster DEM source '${this.sourceCache.id}' is used both for terrain and as layer source. +This leads to lower resolution of hillshade. For full hillshade resolution but higher memory consumption, define another raster DEM source.`);const T=this.getScaledDemTileSize();this.sourceCache.update(c,T,!0),this.resetTileLookupCache(this.sourceCache.id)};this.sourceCache.usedForTerrain||(this.resetTileLookupCache(this.sourceCache.id),this.sourceCache.usedForTerrain=!0,x(),this._initializing=!0),x(),c.updateElevation(!0,f),this.resetTileLookupCache(this.proxySourceCache.id),this.proxySourceCache.update(c),this._emptyDEMTextureDirty=!0}else this._disable()}resetTileLookupCache(o){this._findCoveringTileCache[o]={}}getScaledDemTileSize(){return this.sourceCache.getSource().tileSize/128*this.proxySourceCache.getSource().tileSize}_checkRenderCacheEfficiency(){const o=this.renderCacheEfficiency(this._style);this._style.map._optimizeForTerrain||o.efficiency!==100&&s.warnOnce(`Terrain render cache efficiency is not optimal (${o.efficiency}%) and performance + may be affected negatively, consider placing all background, fill and line layers before layer + with id '${o.firstUndrapedLayer}' or create a map using optimizeForTerrain: true option.`)}_onStyleDataEvent(o){o.coord&&o.dataType==="source"?this._clearRenderCacheForTile(o.sourceCacheId,o.coord):o.dataType==="style"&&(this._invalidateRenderCache=!0)}_disable(){if(this.enabled&&(this.enabled=!1,this._sharedDepthStencil=void 0,this.proxySourceCache.deallocRenderCache(),this._style))for(const o in this._style._sourceCaches)this._style._sourceCaches[o].usedForTerrain=!1}destroy(){this._disable(),this._emptyDEMTexture&&this._emptyDEMTexture.destroy(),this._emptyDepthBufferTexture&&this._emptyDepthBufferTexture.destroy(),this.pool.forEach(o=>o.fb.destroy()),this.pool=[],this._depthFBO&&(this._depthFBO.destroy(),this._depthFBO=void 0,this._depthTexture=void 0)}_source(){return this.enabled?this.sourceCache:null}isUsingMockSource(){return this.sourceCache===this._mockSourceCache}exaggeration(){return this._exaggeration}get visibleDemTiles(){return this._visibleDemTiles}get drapeBufferSize(){const o=2*this.proxySourceCache.getSource().tileSize;return[o,o]}set useVertexMorphing(o){this._useVertexMorphing=o}updateTileBinding(o){if(!this.enabled)return;this.prevTerrainTileForTile=this.terrainTileForTile;const c=this.proxySourceCache,f=this.painter.transform;this._initializing&&(this._initializing=f._centerAltitude===0&&this.getAtPointOrZero(s.MercatorCoordinate.fromLngLat(f.center),-1)===-1,this._emptyDEMTextureDirty=!this._initializing);const _=this.proxyCoords=c.getIds().map(C=>{const z=c.getTileByID(C).tileID;return z.projMatrix=f.calculateProjMatrix(z.toUnwrapped()),z});(function(C,z){const P=z.transform.pointCoordinate(z.transform.getCameraPoint()),O=new s.Point(P.x,P.y);C.sort((j,W)=>{if(W.overscaledZ-j.overscaledZ)return W.overscaledZ-j.overscaledZ;const H=new s.Point(j.canonical.x+(1<{this.proxyToSource[C.key]={}}),this.terrainTileForTile={};const T=this._style._sourceCaches;for(const C in T){const z=T[C];if(!z.used||(z!==this.sourceCache&&this.resetTileLookupCache(z.id),this._setupProxiedCoordsForOrtho(z,o[C],x),z.usedForTerrain))continue;const P=o[C];z.getSource().reparseOverscaled&&this._assignTerrainTiles(P)}this.proxiedCoords[c.id]=_.map(C=>new Oc(C,C.key,this.orthoMatrix)),this._assignTerrainTiles(_),this._prepareDEMTextures(),this._setupDrapedRenderBatches(),this._initFBOPool(),this._setupRenderCache(x),this.renderingToTexture=!1,this._updateTimestamp=s.exported.now();const S={};this._visibleDemTiles=[];for(const C of this.proxyCoords){const z=this.terrainTileForTile[C.key];if(!z)continue;const P=z.tileID.key;P in S||(this._visibleDemTiles.push(z),S[P]=P)}}_assignTerrainTiles(o){this._initializing||o.forEach(c=>{if(this.terrainTileForTile[c.key])return;const f=this._findTileCoveringTileID(c,this.sourceCache);f&&(this.terrainTileForTile[c.key]=f)})}_prepareDEMTextures(){const o=this.painter.context,c=o.gl;for(const f in this.terrainTileForTile){const _=this.terrainTileForTile[f],x=_.dem;!x||_.demTexture&&!_.needsDEMTextureUpload||(o.activeTexture.set(c.TEXTURE1),Bh(this.painter,_,x))}}_prepareDemTileUniforms(o,c,f,_){if(!c||c.demTexture==null)return!1;const x=o.tileID.canonical,T=Math.pow(2,c.tileID.canonical.z-x.z),S=_||"";return f[`u_dem_tl${S}`]=[x.x*T%1,x.y*T%1],f[`u_dem_scale${S}`]=T,!0}get emptyDEMTexture(){return!this._emptyDEMTextureDirty&&this._emptyDEMTexture?this._emptyDEMTexture:this._updateEmptyDEMTexture()}get emptyDepthBufferTexture(){const o=this.painter.context,c=o.gl;if(!this._emptyDepthBufferTexture){const f=new s.RGBAImage({width:1,height:1},Uint8Array.of(255,255,255,255));this._emptyDepthBufferTexture=new s.Texture(o,f,c.RGBA,{premultiply:!1})}return this._emptyDepthBufferTexture}_getLoadedAreaMinimum(){let o=0;const c=this._visibleDemTiles.reduce((f,_)=>{if(!_.dem)return f;const x=_.dem.tree.minimums[0];return x>0&&o++,f+x},0);return o?c/o:0}_updateEmptyDEMTexture(){const o=this.painter.context,c=o.gl;o.activeTexture.set(c.TEXTURE2);const f=this._getLoadedAreaMinimum(),_=new s.RGBAImage({width:1,height:1},new Uint8Array(s.DEMData.pack(f,this.sourceCache.getSource().encoding)));this._emptyDEMTextureDirty=!1;let x=this._emptyDEMTexture;return x?x.update(_,{premultiply:!1}):x=this._emptyDEMTexture=new s.Texture(o,_,c.RGBA,{premultiply:!1}),x}setupElevationDraw(o,c,f){const _=this.painter.context,x=_.gl,T=(S=this.sourceCache.getSource().encoding,{u_dem:2,u_dem_prev:4,u_dem_unpack:s.DEMData.getUnpackVector(S),u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_exaggeration:0});var S;T.u_dem_size=this.sourceCache.getSource().tileSize,T.u_exaggeration=this.exaggeration();let C=null,z=null,P=1;if(f&&f.morphing&&this._useVertexMorphing){const O=f.morphing.srcDemTile,j=f.morphing.dstDemTile;P=f.morphing.phase,O&&j&&(this._prepareDemTileUniforms(o,O,T,"_prev")&&(z=O),this._prepareDemTileUniforms(o,j,T)&&(C=j))}if(z&&C?(_.activeTexture.set(x.TEXTURE2),C.demTexture.bind(x.NEAREST,x.CLAMP_TO_EDGE,x.NEAREST),_.activeTexture.set(x.TEXTURE4),z.demTexture.bind(x.NEAREST,x.CLAMP_TO_EDGE,x.NEAREST),T.u_dem_lerp=P):(C=this.terrainTileForTile[o.tileID.key],_.activeTexture.set(x.TEXTURE2),(this._prepareDemTileUniforms(o,C,T)?C.demTexture:this.emptyDEMTexture).bind(x.NEAREST,x.CLAMP_TO_EDGE)),_.activeTexture.set(x.TEXTURE3),f&&f.useDepthForOcclusion?(this._depthTexture&&this._depthTexture.bind(x.NEAREST,x.CLAMP_TO_EDGE),this._depthFBO&&(T.u_depth_size_inv=[1/this._depthFBO.width,1/this._depthFBO.height])):(this.emptyDepthBufferTexture.bind(x.NEAREST,x.CLAMP_TO_EDGE),T.u_depth_size_inv=[1,1]),f&&f.useMeterToDem&&C){const O=(1<{if(B===qe)return;const Be=[zs[qe],"PROJECTION_GLOBE_VIEW"];ee&&Be.push("CUSTOM_ANTIALIASING"),Se&&Be.push(zs[q]),X=z.useProgram("globeRaster",null,Be),B=qe},fe=z.colorModeForRenderPass(),pe=new s.DepthMode(Z.LEQUAL,s.DepthMode.ReadWrite,z.depthRangeFor3D);Co.update(W);const xe=s.calculateGlobeMercatorMatrix(Q),ye=[s.mercatorXfromLng(Q.center.lng),s.mercatorYfromLat(Q.center.lat)],Ae=q?[!1,!0]:[!1],We=z.globeSharedBuffers,Ee=[Q.width*s.exported.devicePixelRatio,Q.height*s.exported.devicePixelRatio],Fe=Float32Array.from(Q.globeMatrix),ke={useDenormalizedUpVectorScale:!0};if(Ae.forEach(qe=>{const Se=z.transform,Be=Rc(Se.zoom)*P.exaggeration();B=-1;const Xe=qe?Z.LINES:Z.TRIANGLES;for(const $e of j){const Ye=O.getTile($e),gt=s.StencilMode.disabled,Et=P.prevTerrainTileForTile[$e.key],pt=P.terrainTileForTile[$e.key];ya(Et,pt)&&Co.newMorphing($e.key,Et,pt,W,250),H.activeTexture.set(Z.TEXTURE0),Ye.texture.bind(Z.LINEAR,Z.CLAMP_TO_EDGE);const wt=Co.getMorphValuesForProxy($e.key),Ut=wt?1:0;wt&&s.extend$1(ke,{morphing:{srcDemTile:wt.from,dstDemTile:wt.to,phase:s.easeCubicInOut(wt.phase)}});const Ot=s.tileCornersToBounds($e.canonical),mt=s.getLatitudinalLod(Ot.getCenter().lat),en=s.getGridMatrix($e.canonical,Ot,mt,Se.worldSize/Se._pixelsPerMercatorPixel),rn=s.globeNormalizeECEF(s.globeTileBounds($e.canonical)),on=Lc(Se.projMatrix,Fe,xe,rn,s.globeToMercatorTransition(Se.zoom),ye,Se.frustumCorners.TL,Se.frustumCorners.TR,Se.frustumCorners.BR,Se.frustumCorners.BL,Se.globeCenterInViewSpace,Se.globeRadius,Ee,Be,en);if(de(Ut,qe),P.setupElevationDraw(Ye,X,ke),z.prepareDrawProgram(H,X,$e.toUnwrapped()),We){const[sn,Mr,fr]=qe?We.getWirefameBuffers(z.context,mt):We.getGridBuffers(mt,Be!==0);X.draw(H,Xe,pe,gt,fe,s.CullFaceMode.backCCW,on,"globe_raster",sn,Mr,fr)}}}),We){const qe=["GLOBE_POLES","PROJECTION_GLOBE_VIEW"];ee&&qe.push("CUSTOM_ANTIALIASING"),X=z.useProgram("globeRaster",null,qe);for(const Se of j){const{x:Be,y:Xe,z:$e}=Se.canonical,Ye=Xe===0,gt=Xe===(1<<$e)-1,[Et,pt,wt,Ut]=We.getPoleBuffers($e);if(Ut&&(Ye||gt)){const Ot=O.getTile(Se);H.activeTexture.set(Z.TEXTURE0),Ot.texture.bind(Z.LINEAR,Z.CLAMP_TO_EDGE);let mt=s.globePoleMatrixForTile($e,Be,Q);const en=s.globeNormalizeECEF(s.globeTileBounds(Se.canonical)),rn=(on,sn)=>on.draw(H,Z.TRIANGLES,pe,s.StencilMode.disabled,fe,s.CullFaceMode.disabled,Lc(Q.projMatrix,mt,mt,en,0,ye,Q.frustumCorners.TL,Q.frustumCorners.TR,Q.frustumCorners.BR,Q.frustumCorners.BL,Q.globeCenterInViewSpace,Q.globeRadius,Ee,0),"globe_pole_raster",sn,wt,Ut);P.setupElevationDraw(Ot,X,ke),z.prepareDrawProgram(H,X,Se.toUnwrapped()),Ye&&rn(X,Et),gt&&(mt=s.scale(s.create(),mt,[1,-1,1]),rn(X,pt))}}}})(_,x,T,S,C);else{const z=_.context,P=z.gl;let O,j;const W=_.options.showTerrainWireframe?2:0,H=(Q,ee)=>{if(j===Q)return;const de=[zs[Q]];ee&&de.push(zs[W]),O=_.useProgram("terrainRaster",null,de),j=Q},Z=_.colorModeForRenderPass(),X=new s.DepthMode(P.LEQUAL,s.DepthMode.ReadWrite,_.depthRangeFor3D);Co.update(C);const B=_.transform,q=Rc(B.zoom)*x.exaggeration();(W?[!1,!0]:[!1]).forEach(Q=>{j=-1;const ee=Q?P.LINES:P.TRIANGLES,[de,fe]=Q?x.getWirefameBuffer():[x.gridIndexBuffer,x.gridSegments];for(const pe of S){const xe=T.getTile(pe),ye=s.StencilMode.disabled,Ae=x.prevTerrainTileForTile[pe.key],We=x.terrainTileForTile[pe.key];ya(Ae,We)&&Co.newMorphing(pe.key,Ae,We,C,250),z.activeTexture.set(P.TEXTURE0),xe.texture.bind(P.LINEAR,P.CLAMP_TO_EDGE,P.LINEAR_MIPMAP_NEAREST);const Ee=Co.getMorphValuesForProxy(pe.key),Fe=Ee?1:0;let ke;Ee&&(ke={morphing:{srcDemTile:Ee.from,dstDemTile:Ee.to,phase:s.easeCubicInOut(Ee.phase)}});const qe=_a(pe.projMatrix,_f(pe.canonical,B.renderWorldCopies)?q/10:q);H(Fe,Q),x.setupElevationDraw(xe,O,ke),_.prepareDrawProgram(z,O,pe.toUnwrapped()),O.draw(z,ee,X,ye,Z,s.CullFaceMode.backCCW,qe,"terrain_raster",x.gridBuffer,de,fe)}})}}(c,this,this.proxySourceCache,o,this._updateTimestamp),this.renderingToTexture=!0,c.gpuTimingDeferredRenderEnd(),o.splice(0,o.length))}renderBatch(o){if(this._drapedRenderBatches.length===0)return o+1;this.renderingToTexture=!0;const c=this.painter,f=this.painter.context,_=this.proxySourceCache,x=this.proxiedCoords[_.id],T=this._drapedRenderBatches.shift(),S=[],C=c.style.order;let z=0;for(const P of x){const O=_.getTileByID(P.proxyTileKey),j=_.proxyCachedFBO[P.key]?_.proxyCachedFBO[P.key][o]:void 0,W=j!==void 0?_.renderCache[j]:this.pool[z++],H=j!==void 0;if(O.texture=W.tex,H&&!W.dirty){S.push(O.tileID);continue}let Z;f.bindFramebuffer.set(W.fb.framebuffer),this.renderedToTile=!1,W.dirty&&(f.clear({color:s.Color.transparent,stencil:0}),W.dirty=!1);for(let X=T.start;X<=T.end;++X){const B=c.style._layers[C[X]];if(B.isHidden(c.transform.zoom))continue;const q=c.style._getLayerSourceCache(B),Q=q?this.proxyToSource[P.key][q.id]:[P];if(!Q)continue;const ee=Q;f.viewport.set([0,0,W.fb.width,W.fb.height]),Z!==(q?q.id:null)&&(this._setupStencil(W,Q,B,q),Z=q?q.id:null),c.renderLayer(c,q,B,ee)}this.renderedToTile?(W.dirty=!0,S.push(O.tileID)):H||--z,z===5&&(z=0,this.renderToBackBuffer(S))}return this.renderToBackBuffer(S),this.renderingToTexture=!1,f.bindFramebuffer.set(null),f.viewport.set([0,0,c.width,c.height]),T.end+1}postRender(){}renderCacheEfficiency(o){const c=o.order.length;if(c===0)return{efficiency:100};let f,_=0,x=0,T=!1;for(let S=0;Sc.dem).forEach(c=>{o=Math.min(o,c.dem.tree.minimums[0])}),o===0?o:(o-30)*this._exaggeration}raycast(o,c,f){if(!this._visibleDemTiles)return null;const _=this._visibleDemTiles.filter(x=>x.dem).map(x=>{const T=x.tileID,S=1<(x.t!==null?x.t:Number.MAX_VALUE)-(T.t!==null?T.t:Number.MAX_VALUE));for(const x of _){if(x.t==null)return null;const T=x.tile.dem.tree.raycast(x.minx,x.miny,x.maxx,x.maxy,o,c,f);if(T!=null)return T}return null}_createFBO(){const o=this.painter.context,c=o.gl,f=this.drapeBufferSize;o.activeTexture.set(c.TEXTURE0);const _=new s.Texture(o,{width:f[0],height:f[1],data:null},c.RGBA);_.bind(c.LINEAR,c.CLAMP_TO_EDGE);const x=o.createFramebuffer(f[0],f[1],!1);return x.colorAttachment.set(_.texture),x.depthAttachment=new ge(o,x.framebuffer),this._sharedDepthStencil===void 0?(this._sharedDepthStencil=o.createRenderbuffer(o.gl.DEPTH_STENCIL,f[0],f[1]),this._stencilRef=0,x.depthAttachment.set(this._sharedDepthStencil),o.clear({stencil:0})):x.depthAttachment.set(this._sharedDepthStencil),o.extTextureFilterAnisotropic&&!o.extTextureFilterAnisotropicForceOff&&c.texParameterf(c.TEXTURE_2D,o.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,o.extTextureFilterAnisotropicMax),{fb:x,tex:_,dirty:!1}}_initFBOPool(){for(;this.pool.length{const c=this._style._layers[o],f=c.isHidden(this.painter.transform.zoom);return c.type==="custom"?!f&&c.shouldRedrape():!f&&c.hasTransition()})}_clearLineLayersFromRenderCache(){let o=!1;for(const f of this._style._getSources())if(f instanceof rt){o=!0;break}if(!o)return;const c={};for(let f=0;fc.renderCachePool.length){const T=Object.values(c.proxyCachedFBO);c.proxyCachedFBO={};for(let S=0;S=0;T--){const S=f[T];if(c.getTileByID(S.key),c.proxyCachedFBO[S.key]!==void 0){const C=o[S.key],z=this.proxyToSource[S.key];let P=0;for(const O in z){const j=z[O],W=C[O];if(!W||W.length!==j.length||j.some((H,Z)=>H!==W[Z]||_[O]&&_[O].hasOwnProperty(H.key))){P=-1;break}++P}for(const O in c.proxyCachedFBO[S.key])c.renderCache[c.proxyCachedFBO[S.key][O]].dirty=P<0||P!==Object.values(C).length}}const x=[...this._drapedRenderBatches];x.sort((T,S)=>S.end-S.start-(T.end-T.start));for(const T of x)for(const S of f){if(c.proxyCachedFBO[S.key])continue;let C=c.renderCachePool.pop();C===void 0&&c.renderCache.length<50&&(C=c.renderCache.length,c.renderCache.push(this._createFBO())),C!==void 0&&(c.proxyCachedFBO[S.key]={},c.proxyCachedFBO[S.key][T.start]=C,c.renderCache[C].dirty=!0)}this._tilesDirty={}}_setupStencil(o,c,f,_){if(!_||!this._sourceTilesOverlap[_.id])return void(this._overlapStencilType&&(this._overlapStencilType=!1));const x=this.painter.context,T=x.gl;if(c.length<=1)return void(this._overlapStencilType=!1);let S;if(f.isTileClipped())S=c.length,this._overlapStencilMode.test={func:T.EQUAL,mask:255},this._overlapStencilType="Clip";else{if(!(c[0].overscaledZ>c[c.length-1].overscaledZ))return void(this._overlapStencilType=!1);S=1,this._overlapStencilMode.test={func:T.GREATER,mask:255},this._overlapStencilType="Mask"}this._stencilRef+S>255&&(x.clear({stencil:0}),this._stencilRef=0),this._stencilRef+=S,this._overlapStencilMode.ref=this._stencilRef,f.isTileClipped()&&this._renderTileClippingMasks(c,this._overlapStencilMode.ref)}clipOrMaskOverlapStencilType(){return this._overlapStencilType==="Clip"||this._overlapStencilType==="Mask"}stencilModeForRTTOverlap(o){return this.renderingToTexture&&this._overlapStencilType?(this._overlapStencilType==="Clip"&&(this._overlapStencilMode.ref=this.painter._tileClippingMaskIDs[o.key]),this._overlapStencilMode):s.StencilMode.disabled}_renderTileClippingMasks(o,c){const f=this.painter,_=this.painter.context,x=_.gl;f._tileClippingMaskIDs={},_.setColorMode(s.ColorMode.disabled),_.setDepthMode(s.DepthMode.disabled);const T=f.useProgram("clippingMask");for(const S of o){const C=f._tileClippingMaskIDs[S.key]=--c;T.draw(_,x.TRIANGLES,s.DepthMode.disabled,new s.StencilMode({func:x.ALWAYS,mask:0},C,255,x.KEEP,x.KEEP,x.REPLACE),s.ColorMode.disabled,s.CullFaceMode.disabled,kl(S.projMatrix),"$clipping",f.tileExtentBuffer,f.quadTriangleIndexBuffer,f.tileExtentSegments)}}pointCoordinate(o){const c=this.painter.transform;if(o.x<0||o.x>c.width||o.y<0||o.y>c.height)return null;const f=[o.x,o.y,1,1];s.transformMat4$1(f,f,c.pixelMatrixInverse),s.scale$1(f,f,1/f[3]),f[0]/=c.worldSize,f[1]/=c.worldSize;const _=c._camera.position,x=s.mercatorZfromAltitude(1,c.center.lat),T=[_[0],_[1],_[2]/x,0],S=s.subtract([],f.slice(0,3),T);s.normalize(S,S);const C=this.raycast(T,S,this._exaggeration);return C!==null&&C?(s.scaleAndAdd(T,T,S,C),T[3]=T[2],T[2]*=x,T):null}drawDepth(){const o=this.painter,c=o.context,f=this.proxySourceCache,_=Math.ceil(o.width),x=Math.ceil(o.height);if(!this._depthFBO||this._depthFBO.width===_&&this._depthFBO.height===x||(this._depthFBO.destroy(),this._depthFBO=void 0,this._depthTexture=void 0),!this._depthFBO){const T=c.gl,S=c.createFramebuffer(_,x,!0);c.activeTexture.set(T.TEXTURE0);const C=new s.Texture(c,{width:_,height:x,data:null},T.RGBA);C.bind(T.NEAREST,T.CLAMP_TO_EDGE),S.colorAttachment.set(C.texture);const z=c.createRenderbuffer(c.gl.DEPTH_COMPONENT16,_,x);S.depthAttachment.set(z),this._depthFBO=S,this._depthTexture=C}c.bindFramebuffer.set(this._depthFBO.framebuffer),c.viewport.set([0,0,_,x]),function(T,S,C,z){if(T.transform.projection.name==="globe")return;const P=T.context,O=P.gl;P.clear({depth:1});const j=T.useProgram("terrainDepth"),W=new s.DepthMode(O.LESS,s.DepthMode.ReadWrite,T.depthRangeFor3D);for(const H of z){const Z=C.getTile(H),X=_a(H.projMatrix,0);S.setupElevationDraw(Z,j),j.draw(P,O.TRIANGLES,W,s.StencilMode.disabled,s.ColorMode.unblended,s.CullFaceMode.backCCW,X,"terrain_depth",S.gridBuffer,S.gridIndexBuffer,S.gridNoSkirtSegments)}}(o,this,f,this.proxyCoords)}_setupProxiedCoordsForOrtho(o,c,f){if(o.getSource()instanceof Rt)return this._setupProxiedCoordsForImageSource(o,c,f);this._findCoveringTileCache[o.id]=this._findCoveringTileCache[o.id]||{};const _=this.proxiedCoords[o.id]=[],x=this.proxyCoords;for(let S=0;S(P.min.x=Math.min(P.min.x,O.x-S.x),P.min.y=Math.min(P.min.y,O.y-S.y),P.max.x=Math.max(P.max.x,O.x-S.x),P.max.y=Math.max(P.max.y,O.y-S.y),P),{min:new s.Point(Number.MAX_VALUE,Number.MAX_VALUE),max:new s.Point(-Number.MAX_VALUE,-Number.MAX_VALUE)}),z=(P,O)=>{const j=P.wrap+P.canonical.x/(1<Z+C.max.x||W+HX+C.max.y};for(let P=0;PT.key===c.tileID.key);if(x)return x}if(c.tileID.key!==o.key){const x=o.canonical.z-c.tileID.canonical.z;let T,S,C;_=s.create();const z=c.tileID.wrap-o.wrap<0?(T=s.EXTENT>>x,S=T*((c.tileID.canonical.x<=O){const j=o.canonical.z-O;c.getSource().reparseOverscaled?(S=Math.max(o.canonical.z+2,c.transform.tileZoom),T=new s.OverscaledTileID(S,o.wrap,O,o.canonical.x>>j,o.canonical.y>>j)):j!==0&&(S=O,T=new s.OverscaledTileID(S,o.wrap,O,o.canonical.x>>j,o.canonical.y>>j))}T.key!==o.key&&(z.push(T.key),f=c.getTile(T))}const P=O=>{z.forEach(j=>{_[j]=O}),z.length=0};for(S-=1;S>=C&&(!f||!f.hasData());S--){f&&P(f.tileID.key);const O=T.calculateScaledKey(S);if(f=c.getTileByID(O),f&&f.hasData())break;const j=_[O];if(j===null)break;j===void 0?z.push(O):f=c.getTileByID(j)}return P(f?f.tileID.key:null),f&&f.hasData()?f:null}findDEMTileFor(o){return this.enabled?this._findTileCoveringTileID(o,this.sourceCache):null}prepareDrawTile(){this.renderedToTile=!0}_clearRenderCacheForTile(o,c){let f=this._tilesDirty[o];f||(f=this._tilesDirty[o]={}),f[c.key]=!0}getWirefameBuffer(){if(!this.wireframeSegments){const o=function(c){let f=0;const _=new s.StructArrayLayout2ui4,x=131;for(let T=1;T<129;T++){for(let S=1;S<129;S++)f=T*x+S,_.emplaceBack(f,f+1),_.emplaceBack(f,f+x),_.emplaceBack(f+1,f+x),T===128&&_.emplaceBack(f+x,f+x+1);_.emplaceBack(f+1,f+1+x)}return _}();this.wireframeIndexBuffer=this.painter.context.createIndexBuffer(o),this.wireframeSegments=s.SegmentVector.simpleSegment(0,0,this.gridBuffer.length,o.length)}return[this.wireframeIndexBuffer,this.wireframeSegments]}}class Wt{static cacheKey(o,c,f,_){let x=`${c}${_?_.cacheKey:""}`;for(const T of f)o.usedDefines.includes(T)&&(x+=`/${T}`);return x}constructor(o,c,f,_,x,T){const S=o.gl;this.program=S.createProgram();const C=function(B){const q=[];for(let Q=0;Q`#define ${B}`));const j=o.isWebGL2?`#version 300 es +`:"",W=j+O.concat(o.extStandardDerivatives&&j.length===0?`#extension GL_OES_standard_derivatives : enable +`.concat(Rh):Rh,Rh,zc,ff.fragmentSource,ma.fragmentSource,f.fragmentSource).join(` +`),H=j+O.concat(` +#ifdef GL_ES +precision highp float; +#else + +#if !defined(lowp) +#define lowp +#endif + +#if !defined(mediump) +#define mediump +#endif + +#if !defined(highp) +#define highp +#endif + +#endif`,zc,ff.vertexSource,ma.vertexSource,Pc.vertexSource,f.vertexSource).join(` +`),Z=S.createShader(S.FRAGMENT_SHADER);if(S.isContextLost())return void(this.failedToCreate=!0);S.shaderSource(Z,W),S.compileShader(Z),S.attachShader(this.program,Z);const X=S.createShader(S.VERTEX_SHADER);if(S.isContextLost())this.failedToCreate=!0;else{S.shaderSource(X,H),S.compileShader(X),S.attachShader(this.program,X),this.attributes={},this.numAttributes=P.length;for(let B=0;B({u_dem:new s.Uniform1i(B),u_dem_prev:new s.Uniform1i(B),u_dem_unpack:new s.Uniform4f(B),u_dem_tl:new s.Uniform2f(B),u_dem_scale:new s.Uniform1f(B),u_dem_tl_prev:new s.Uniform2f(B),u_dem_scale_prev:new s.Uniform1f(B),u_dem_size:new s.Uniform1f(B),u_dem_lerp:new s.Uniform1f(B),u_exaggeration:new s.Uniform1f(B),u_depth:new s.Uniform1i(B),u_depth_size_inv:new s.Uniform2f(B),u_meter_to_dem:new s.Uniform1f(B),u_label_plane_matrix_inv:new s.UniformMatrix4f(B)}))(o)),T.includes("GLOBE")&&(this.globeUniforms=(B=>({u_tile_tl_up:new s.Uniform3f(B),u_tile_tr_up:new s.Uniform3f(B),u_tile_br_up:new s.Uniform3f(B),u_tile_bl_up:new s.Uniform3f(B),u_tile_up_scale:new s.Uniform1f(B)}))(o)),T.includes("FOG")&&(this.fogUniforms=(B=>({u_fog_matrix:new s.UniformMatrix4f(B),u_fog_range:new s.Uniform2f(B),u_fog_color:new s.Uniform4f(B),u_fog_horizon_blend:new s.Uniform1f(B),u_fog_temporal_offset:new s.Uniform1f(B),u_frustum_tl:new s.Uniform3f(B),u_frustum_tr:new s.Uniform3f(B),u_frustum_br:new s.Uniform3f(B),u_frustum_bl:new s.Uniform3f(B),u_globe_pos:new s.Uniform3f(B),u_globe_radius:new s.Uniform1f(B),u_globe_transition:new s.Uniform1f(B),u_is_globe:new s.Uniform1i(B),u_viewport:new s.Uniform2f(B)}))(o))}}setTerrainUniformValues(o,c){if(!this.terrainUniforms)return;const f=this.terrainUniforms;if(!this.failedToCreate){o.program.set(this.program);for(const _ in c)f[_]&&f[_].set(this.program,_,c[_])}}setGlobeUniformValues(o,c){if(!this.globeUniforms)return;const f=this.globeUniforms;if(!this.failedToCreate){o.program.set(this.program);for(const _ in c)f[_]&&f[_].set(this.program,_,c[_])}}setFogUniformValues(o,c){if(!this.fogUniforms)return;const f=this.fogUniforms;if(!this.failedToCreate){o.program.set(this.program);for(const _ in c)f[_].set(this.program,_,c[_])}}draw(o,c,f,_,x,T,S,C,z,P,O,j,W,H,Z){const X=o.gl;if(this.failedToCreate)return;o.program.set(this.program),o.setDepthMode(f),o.setStencilMode(_),o.setColorMode(x),o.setCullFace(T);for(const q of Object.keys(this.fixedUniforms))this.fixedUniforms[q].set(this.program,q,S[q]);H&&H.setUniforms(this.program,o,this.binderUniforms,j,{zoom:W});const B={[X.LINES]:2,[X.TRIANGLES]:3,[X.LINE_STRIP]:1}[c];for(const q of O.get()){const Q=q.vaos||(q.vaos={});(Q[C]||(Q[C]=new W_)).bind(o,this,z,H?H.getPaintVertexBuffers():[],P,q.vertexOffset,Z||[]),X.drawElements(c,q.primitiveLength*B,X.UNSIGNED_SHORT,q.primitiveOffset*B*2)}}}function Ml(d,o){const c=Math.pow(2,o.tileID.overscaledZ),f=o.tileSize*Math.pow(2,d.transform.tileZoom)/c,_=f*(o.tileID.canonical.x+o.tileID.wrap*c),x=f*o.tileID.canonical.y;return{u_image:0,u_texsize:o.imageAtlasTexture.size,u_tile_units_to_pixels:1/Bt(o,1,d.transform.tileZoom),u_pixel_coord_upper:[_>>16,x>>16],u_pixel_coord_lower:[65535&_,65535&x]}}const yf=s.create(),Vh=(d,o,c,f,_,x,T,S,C,z,P)=>{const O=o.style.light,j=O.properties.get("position"),W=[j.x,j.y,j.z],H=s.create$1();O.properties.get("anchor")==="viewport"&&(s.fromRotation(H,-o.transform.angle),s.transformMat3(W,W,H));const Z=O.properties.get("color"),X=o.transform,B={u_matrix:d,u_lightpos:W,u_lightintensity:O.properties.get("intensity"),u_lightcolor:[Z.r,Z.g,Z.b],u_vertical_gradient:+c,u_opacity:f,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:yf,u_merc_center:[0,0],u_up_dir:[0,0,0],u_height_lift:0,u_ao:_,u_edge_radius:x};return X.projection.name==="globe"&&(B.u_tile_id=[T.canonical.x,T.canonical.y,1<{const j=Vh(d,o,c,f,_,x,T,C,z,P,O),W={u_height_factor:-Math.pow(2,T.overscaledZ)/S.tileSize/8};return s.extend(j,Ml(o,S),W)},Ls=d=>({u_matrix:d}),$h=(d,o,c)=>s.extend(Ls(d),Ml(o,c)),Z_=(d,o)=>({u_matrix:d,u_world:o}),H_=(d,o,c,f)=>s.extend($h(d,o,c),{u_world:f}),X_=s.create(),Gh=(d,o,c,f,_,x)=>{const T=d.transform,S=T.projection.name==="globe";let C;if(x.paint.get("circle-pitch-alignment")==="map")if(S){const P=s.globePixelsToTileUnits(T.zoom,o.canonical)*T._pixelsPerMercatorPixel;C=Float32Array.from([P,0,0,P])}else C=T.calculatePixelsToTileUnitsMatrix(c);else C=new Float32Array([T.pixelsToGLUnits[0],0,0,T.pixelsToGLUnits[1]]);const z={u_camera_to_center_distance:T.cameraToCenterDistance,u_matrix:d.translatePosMatrix(o.projMatrix,c,x.paint.get("circle-translate"),x.paint.get("circle-translate-anchor")),u_device_pixel_ratio:s.exported.devicePixelRatio,u_extrude_scale:C,u_inv_rot_matrix:X_,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(S){z.u_inv_rot_matrix=f,z.u_merc_center=_,z.u_tile_id=[o.canonical.x,o.canonical.y,1<{const o=[];return d.paint.get("circle-pitch-alignment")==="map"&&o.push("PITCH_WITH_MAP"),d.paint.get("circle-pitch-scale")==="map"&&o.push("SCALE_WITH_MAP"),o},Wh=(d,o,c,f)=>{const _=s.EXTENT/c.tileSize;return{u_matrix:d,u_camera_to_center_distance:o.getCameraToCenterDistance(f),u_extrude_scale:[o.pixelsToGLUnits[0]/_,o.pixelsToGLUnits[1]/_]}},Bc=(d,o,c=1)=>({u_matrix:d,u_color:o,u_overlay:0,u_overlay_scale:c}),xf=s.create(),wf=(d,o,c,f,_,x,T)=>{const S=d.transform,C=S.projection.name==="globe",z=C?s.globePixelsToTileUnits(S.zoom,o.canonical)*S._pixelsPerMercatorPixel:Bt(c,1,x),P={u_matrix:o.projMatrix,u_extrude_scale:z,u_intensity:T,u_inv_rot_matrix:xf,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(C){P.u_inv_rot_matrix=f,P.u_merc_center=_,P.u_tile_id=[o.canonical.x,o.canonical.y,1<{const S=d.transform,C=S.calculatePixelsToTileUnitsMatrix(o);return{u_matrix:Zh(d,o,c,f),u_pixels_to_tile_units:C,u_device_pixel_ratio:x,u_units_to_pixels:[1/S.pixelsToGLUnits[0],1/S.pixelsToGLUnits[1]],u_dash_image:0,u_gradient_image:1,u_image_height:_,u_texsize:zl(c)?o.lineAtlasTexture.size:[0,0],u_tile_units_to_pixels:va(o,d.transform),u_alpha_discard_threshold:0,u_trim_offset:T}},Pl=(d,o,c,f,_)=>{const x=d.transform;return{u_matrix:Zh(d,o,c,f),u_texsize:o.imageAtlasTexture.size,u_pixels_to_tile_units:x.calculatePixelsToTileUnitsMatrix(o),u_device_pixel_ratio:_,u_image:0,u_tile_units_to_pixels:va(o,x),u_units_to_pixels:[1/x.pixelsToGLUnits[0],1/x.pixelsToGLUnits[1]],u_alpha_discard_threshold:0}};function va(d,o){return 1/Bt(d,1,o.tileZoom)}function Zh(d,o,c,f){return d.translatePosMatrix(f||o.tileID.projMatrix,o,c.paint.get("line-translate"),c.paint.get("line-translate-anchor"))}function zl(d){const o=d.paint.get("line-dasharray").value;return o.value||o.kind!=="constant"}const Hh=(d,o,c,f,_,x)=>{return{u_matrix:d,u_tl_parent:o,u_scale_parent:c,u_fade_t:f.mix,u_opacity:f.opacity*_.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:_.paint.get("raster-brightness-min"),u_brightness_high:_.paint.get("raster-brightness-max"),u_saturation_factor:(S=_.paint.get("raster-saturation"),S>0?1-1/(1.001-S):-S),u_contrast_factor:(T=_.paint.get("raster-contrast"),T>0?1/(1-T):1+T),u_spin_weights:no(_.paint.get("raster-hue-rotate")),u_perspective_transform:x};var T,S};function no(d){d*=Math.PI/180;const o=Math.sin(d),c=Math.cos(d);return[(2*c+1)/3,(-Math.sqrt(3)*o-c+1)/3,(Math.sqrt(3)*o-c+1)/3]}const Fc=s.create(),Xh=(d,o,c,f,_,x,T,S,C,z,P,O,j,W,H,Z)=>{const X=_.transform,B={u_is_size_zoom_constant:+(d==="constant"||d==="source"),u_is_size_feature_constant:+(d==="constant"||d==="camera"),u_size_t:o?o.uSizeT:0,u_size:o?o.uSize:0,u_camera_to_center_distance:X.cameraToCenterDistance,u_rotate_symbol:+c,u_aspect_ratio:X.width/X.height,u_fade_change:_.options.fadeDuration?_.symbolFadeChange:1,u_matrix:x,u_label_plane_matrix:T,u_coord_matrix:S,u_is_text:+C,u_pitch_with_map:+f,u_texsize:z,u_texture:0,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:Fc,u_merc_center:[0,0],u_camera_forward:[0,0,0],u_ecef_origin:[0,0,0],u_tile_matrix:Fc,u_up_vector:[0,-1,0]};return Z.name==="globe"&&(B.u_tile_id=[P.canonical.x,P.canonical.y,1<s.extend(Xh(d,o,c,f,_,x,T,S,C,z,O,j,W,H,Z,X),{u_gamma_scale:f?_.transform.cameraToCenterDistance*Math.cos(_.terrain?0:_.transform._pitch):1,u_device_pixel_ratio:s.exported.devicePixelRatio,u_is_halo:+P}),bf=(d,o,c,f,_,x,T,S,C,z,P,O,j,W,H,Z)=>s.extend(Nc(d,o,c,f,_,x,T,S,!0,C,!0,P,O,j,W,H,Z),{u_texsize_icon:z,u_texture_icon:1}),Kh=(d,o,c)=>({u_matrix:d,u_opacity:o,u_color:c}),Y_=(d,o,c,f,_)=>s.extend(function(x,T,S){const C=T.imageManager.getPattern(x.toString()),{width:z,height:P}=T.imageManager.getPixelSize(),O=Math.pow(2,S.tileID.overscaledZ),j=S.tileSize*Math.pow(2,T.transform.tileZoom)/O,W=j*(S.tileID.canonical.x+S.tileID.wrap*O),H=j*S.tileID.canonical.y;return{u_image:0,u_pattern_tl:C.tl,u_pattern_br:C.br,u_texsize:[z,P],u_pattern_size:C.displaySize,u_tile_units_to_pixels:1/Bt(S,1,T.transform.tileZoom),u_pixel_coord_upper:[W>>16,H>>16],u_pixel_coord_lower:[65535&W,65535&H]}}(f,c,_),{u_matrix:d,u_opacity:o}),Yh={fillExtrusion:d=>({u_matrix:new s.UniformMatrix4f(d),u_lightpos:new s.Uniform3f(d),u_lightintensity:new s.Uniform1f(d),u_lightcolor:new s.Uniform3f(d),u_vertical_gradient:new s.Uniform1f(d),u_opacity:new s.Uniform1f(d),u_edge_radius:new s.Uniform1f(d),u_ao:new s.Uniform2f(d),u_tile_id:new s.Uniform3f(d),u_zoom_transition:new s.Uniform1f(d),u_inv_rot_matrix:new s.UniformMatrix4f(d),u_merc_center:new s.Uniform2f(d),u_up_dir:new s.Uniform3f(d),u_height_lift:new s.Uniform1f(d)}),fillExtrusionPattern:d=>({u_matrix:new s.UniformMatrix4f(d),u_lightpos:new s.Uniform3f(d),u_lightintensity:new s.Uniform1f(d),u_lightcolor:new s.Uniform3f(d),u_vertical_gradient:new s.Uniform1f(d),u_height_factor:new s.Uniform1f(d),u_edge_radius:new s.Uniform1f(d),u_ao:new s.Uniform2f(d),u_tile_id:new s.Uniform3f(d),u_zoom_transition:new s.Uniform1f(d),u_inv_rot_matrix:new s.UniformMatrix4f(d),u_merc_center:new s.Uniform2f(d),u_up_dir:new s.Uniform3f(d),u_height_lift:new s.Uniform1f(d),u_image:new s.Uniform1i(d),u_texsize:new s.Uniform2f(d),u_pixel_coord_upper:new s.Uniform2f(d),u_pixel_coord_lower:new s.Uniform2f(d),u_tile_units_to_pixels:new s.Uniform1f(d),u_opacity:new s.Uniform1f(d)}),fill:d=>({u_matrix:new s.UniformMatrix4f(d)}),fillPattern:d=>({u_matrix:new s.UniformMatrix4f(d),u_image:new s.Uniform1i(d),u_texsize:new s.Uniform2f(d),u_pixel_coord_upper:new s.Uniform2f(d),u_pixel_coord_lower:new s.Uniform2f(d),u_tile_units_to_pixels:new s.Uniform1f(d)}),fillOutline:d=>({u_matrix:new s.UniformMatrix4f(d),u_world:new s.Uniform2f(d)}),fillOutlinePattern:d=>({u_matrix:new s.UniformMatrix4f(d),u_world:new s.Uniform2f(d),u_image:new s.Uniform1i(d),u_texsize:new s.Uniform2f(d),u_pixel_coord_upper:new s.Uniform2f(d),u_pixel_coord_lower:new s.Uniform2f(d),u_tile_units_to_pixels:new s.Uniform1f(d)}),circle:d=>({u_camera_to_center_distance:new s.Uniform1f(d),u_extrude_scale:new s.UniformMatrix2f(d),u_device_pixel_ratio:new s.Uniform1f(d),u_matrix:new s.UniformMatrix4f(d),u_inv_rot_matrix:new s.UniformMatrix4f(d),u_merc_center:new s.Uniform2f(d),u_tile_id:new s.Uniform3f(d),u_zoom_transition:new s.Uniform1f(d),u_up_dir:new s.Uniform3f(d)}),collisionBox:d=>({u_matrix:new s.UniformMatrix4f(d),u_camera_to_center_distance:new s.Uniform1f(d),u_extrude_scale:new s.Uniform2f(d)}),collisionCircle:d=>({u_matrix:new s.UniformMatrix4f(d),u_inv_matrix:new s.UniformMatrix4f(d),u_camera_to_center_distance:new s.Uniform1f(d),u_viewport_size:new s.Uniform2f(d)}),debug:d=>({u_color:new s.UniformColor(d),u_matrix:new s.UniformMatrix4f(d),u_overlay:new s.Uniform1i(d),u_overlay_scale:new s.Uniform1f(d)}),clippingMask:d=>({u_matrix:new s.UniformMatrix4f(d)}),heatmap:d=>({u_extrude_scale:new s.Uniform1f(d),u_intensity:new s.Uniform1f(d),u_matrix:new s.UniformMatrix4f(d),u_inv_rot_matrix:new s.UniformMatrix4f(d),u_merc_center:new s.Uniform2f(d),u_tile_id:new s.Uniform3f(d),u_zoom_transition:new s.Uniform1f(d),u_up_dir:new s.Uniform3f(d)}),heatmapTexture:d=>({u_image:new s.Uniform1i(d),u_color_ramp:new s.Uniform1i(d),u_opacity:new s.Uniform1f(d)}),hillshade:d=>({u_matrix:new s.UniformMatrix4f(d),u_image:new s.Uniform1i(d),u_latrange:new s.Uniform2f(d),u_light:new s.Uniform2f(d),u_shadow:new s.UniformColor(d),u_highlight:new s.UniformColor(d),u_accent:new s.UniformColor(d)}),hillshadePrepare:d=>({u_matrix:new s.UniformMatrix4f(d),u_image:new s.Uniform1i(d),u_dimension:new s.Uniform2f(d),u_zoom:new s.Uniform1f(d),u_unpack:new s.Uniform4f(d)}),line:d=>({u_matrix:new s.UniformMatrix4f(d),u_pixels_to_tile_units:new s.UniformMatrix2f(d),u_device_pixel_ratio:new s.Uniform1f(d),u_units_to_pixels:new s.Uniform2f(d),u_dash_image:new s.Uniform1i(d),u_gradient_image:new s.Uniform1i(d),u_image_height:new s.Uniform1f(d),u_texsize:new s.Uniform2f(d),u_tile_units_to_pixels:new s.Uniform1f(d),u_alpha_discard_threshold:new s.Uniform1f(d),u_trim_offset:new s.Uniform2f(d)}),linePattern:d=>({u_matrix:new s.UniformMatrix4f(d),u_texsize:new s.Uniform2f(d),u_pixels_to_tile_units:new s.UniformMatrix2f(d),u_device_pixel_ratio:new s.Uniform1f(d),u_image:new s.Uniform1i(d),u_units_to_pixels:new s.Uniform2f(d),u_tile_units_to_pixels:new s.Uniform1f(d),u_alpha_discard_threshold:new s.Uniform1f(d)}),raster:d=>({u_matrix:new s.UniformMatrix4f(d),u_tl_parent:new s.Uniform2f(d),u_scale_parent:new s.Uniform1f(d),u_fade_t:new s.Uniform1f(d),u_opacity:new s.Uniform1f(d),u_image0:new s.Uniform1i(d),u_image1:new s.Uniform1i(d),u_brightness_low:new s.Uniform1f(d),u_brightness_high:new s.Uniform1f(d),u_saturation_factor:new s.Uniform1f(d),u_contrast_factor:new s.Uniform1f(d),u_spin_weights:new s.Uniform3f(d),u_perspective_transform:new s.Uniform2f(d)}),symbolIcon:d=>({u_is_size_zoom_constant:new s.Uniform1i(d),u_is_size_feature_constant:new s.Uniform1i(d),u_size_t:new s.Uniform1f(d),u_size:new s.Uniform1f(d),u_camera_to_center_distance:new s.Uniform1f(d),u_rotate_symbol:new s.Uniform1i(d),u_aspect_ratio:new s.Uniform1f(d),u_fade_change:new s.Uniform1f(d),u_matrix:new s.UniformMatrix4f(d),u_label_plane_matrix:new s.UniformMatrix4f(d),u_coord_matrix:new s.UniformMatrix4f(d),u_is_text:new s.Uniform1i(d),u_pitch_with_map:new s.Uniform1i(d),u_texsize:new s.Uniform2f(d),u_tile_id:new s.Uniform3f(d),u_zoom_transition:new s.Uniform1f(d),u_inv_rot_matrix:new s.UniformMatrix4f(d),u_merc_center:new s.Uniform2f(d),u_camera_forward:new s.Uniform3f(d),u_tile_matrix:new s.UniformMatrix4f(d),u_up_vector:new s.Uniform3f(d),u_ecef_origin:new s.Uniform3f(d),u_texture:new s.Uniform1i(d)}),symbolSDF:d=>({u_is_size_zoom_constant:new s.Uniform1i(d),u_is_size_feature_constant:new s.Uniform1i(d),u_size_t:new s.Uniform1f(d),u_size:new s.Uniform1f(d),u_camera_to_center_distance:new s.Uniform1f(d),u_rotate_symbol:new s.Uniform1i(d),u_aspect_ratio:new s.Uniform1f(d),u_fade_change:new s.Uniform1f(d),u_matrix:new s.UniformMatrix4f(d),u_label_plane_matrix:new s.UniformMatrix4f(d),u_coord_matrix:new s.UniformMatrix4f(d),u_is_text:new s.Uniform1i(d),u_pitch_with_map:new s.Uniform1i(d),u_texsize:new s.Uniform2f(d),u_texture:new s.Uniform1i(d),u_gamma_scale:new s.Uniform1f(d),u_device_pixel_ratio:new s.Uniform1f(d),u_tile_id:new s.Uniform3f(d),u_zoom_transition:new s.Uniform1f(d),u_inv_rot_matrix:new s.UniformMatrix4f(d),u_merc_center:new s.Uniform2f(d),u_camera_forward:new s.Uniform3f(d),u_tile_matrix:new s.UniformMatrix4f(d),u_up_vector:new s.Uniform3f(d),u_ecef_origin:new s.Uniform3f(d),u_is_halo:new s.Uniform1i(d)}),symbolTextAndIcon:d=>({u_is_size_zoom_constant:new s.Uniform1i(d),u_is_size_feature_constant:new s.Uniform1i(d),u_size_t:new s.Uniform1f(d),u_size:new s.Uniform1f(d),u_camera_to_center_distance:new s.Uniform1f(d),u_rotate_symbol:new s.Uniform1i(d),u_aspect_ratio:new s.Uniform1f(d),u_fade_change:new s.Uniform1f(d),u_matrix:new s.UniformMatrix4f(d),u_label_plane_matrix:new s.UniformMatrix4f(d),u_coord_matrix:new s.UniformMatrix4f(d),u_is_text:new s.Uniform1i(d),u_pitch_with_map:new s.Uniform1i(d),u_texsize:new s.Uniform2f(d),u_texsize_icon:new s.Uniform2f(d),u_texture:new s.Uniform1i(d),u_texture_icon:new s.Uniform1i(d),u_gamma_scale:new s.Uniform1f(d),u_device_pixel_ratio:new s.Uniform1f(d),u_is_halo:new s.Uniform1i(d)}),background:d=>({u_matrix:new s.UniformMatrix4f(d),u_opacity:new s.Uniform1f(d),u_color:new s.UniformColor(d)}),backgroundPattern:d=>({u_matrix:new s.UniformMatrix4f(d),u_opacity:new s.Uniform1f(d),u_image:new s.Uniform1i(d),u_pattern_tl:new s.Uniform2f(d),u_pattern_br:new s.Uniform2f(d),u_texsize:new s.Uniform2f(d),u_pattern_size:new s.Uniform2f(d),u_pixel_coord_upper:new s.Uniform2f(d),u_pixel_coord_lower:new s.Uniform2f(d),u_tile_units_to_pixels:new s.Uniform1f(d)}),terrainRaster:Fh,terrainDepth:Fh,skybox:d=>({u_matrix:new s.UniformMatrix4f(d),u_sun_direction:new s.Uniform3f(d),u_cubemap:new s.Uniform1i(d),u_opacity:new s.Uniform1f(d),u_temporal_offset:new s.Uniform1f(d)}),skyboxGradient:d=>({u_matrix:new s.UniformMatrix4f(d),u_color_ramp:new s.Uniform1i(d),u_center_direction:new s.Uniform3f(d),u_radius:new s.Uniform1f(d),u_opacity:new s.Uniform1f(d),u_temporal_offset:new s.Uniform1f(d)}),skyboxCapture:d=>({u_matrix_3f:new s.UniformMatrix3f(d),u_sun_direction:new s.Uniform3f(d),u_sun_intensity:new s.Uniform1f(d),u_color_tint_r:new s.Uniform4f(d),u_color_tint_m:new s.Uniform4f(d),u_luminance:new s.Uniform1f(d)}),globeRaster:d=>({u_proj_matrix:new s.UniformMatrix4f(d),u_globe_matrix:new s.UniformMatrix4f(d),u_normalize_matrix:new s.UniformMatrix4f(d),u_merc_matrix:new s.UniformMatrix4f(d),u_zoom_transition:new s.Uniform1f(d),u_merc_center:new s.Uniform2f(d),u_image0:new s.Uniform1i(d),u_grid_matrix:new s.UniformMatrix3f(d),u_skirt_height:new s.Uniform1f(d),u_frustum_tl:new s.Uniform3f(d),u_frustum_tr:new s.Uniform3f(d),u_frustum_br:new s.Uniform3f(d),u_frustum_bl:new s.Uniform3f(d),u_globe_pos:new s.Uniform3f(d),u_globe_radius:new s.Uniform1f(d),u_viewport:new s.Uniform2f(d)}),globeAtmosphere:d=>({u_frustum_tl:new s.Uniform3f(d),u_frustum_tr:new s.Uniform3f(d),u_frustum_br:new s.Uniform3f(d),u_frustum_bl:new s.Uniform3f(d),u_horizon:new s.Uniform1f(d),u_transition:new s.Uniform1f(d),u_fadeout_range:new s.Uniform1f(d),u_color:new s.Uniform4f(d),u_high_color:new s.Uniform4f(d),u_space_color:new s.Uniform4f(d),u_star_intensity:new s.Uniform1f(d),u_star_density:new s.Uniform1f(d),u_star_size:new s.Uniform1f(d),u_temporal_offset:new s.Uniform1f(d),u_horizon_angle:new s.Uniform1f(d),u_rotation_matrix:new s.UniformMatrix4f(d)})};let Uc;function Ll(d,o,c,f,_,x,T){const S=d.context,C=S.gl,z=d.transform,P=d.useProgram("collisionBox"),O=[];let j=0,W=0;for(let ee=0;ee0){const Ee=s.create(),Fe=ye;s.mul(Ee,pe.placementInvProjMatrix,z.glCoordMatrix),s.mul(Ee,Ee,pe.placementViewportMatrix),O.push({circleArray:We,circleOffset:W,transform:Fe,invTransform:Ee,projection:pe.getProjection()}),j+=We.length/4,W=j}Ae&&(d.terrain&&d.terrain.setupElevationDraw(fe,P),P.draw(S,C.LINES,s.DepthMode.disabled,s.StencilMode.disabled,d.colorModeForRenderPass(),s.CullFaceMode.disabled,Wh(ye,z,fe,pe.getProjection()),c.id,Ae.layoutVertexBuffer,Ae.indexBuffer,Ae.segments,null,z.zoom,null,[Ae.collisionVertexBuffer,Ae.collisionVertexBufferExt]))}if(!T||!O.length)return;const H=d.useProgram("collisionCircle"),Z=new s.StructArrayLayout2f1f2i16;Z.resize(4*j),Z._trim();let X=0;for(const ee of O)for(let de=0;de=0&&(H[ee.associatedIconIndex]={x:Ee,y:Fe,z:ke,angle:$e})}else Ri(pe,j)}if(P){W.clear();const Q=d.icon.placedSymbolArray;for(let ee=0;eeEe.sortKey-Fe.sortKey);for(const Ee of ye){const Fe=Ee.state;if(d.terrain&&d.terrain.setupElevationDraw(Fe.tile,Fe.program,{useDepthForOcclusion:!xe,labelPlaneMatrixInv:Fe.labelPlaneMatrixInv}),j.activeTexture.set(W.TEXTURE0),Fe.atlasTexture.bind(Fe.atlasInterpolation,W.CLAMP_TO_EDGE),Fe.atlasTextureIcon&&(j.activeTexture.set(W.TEXTURE1),Fe.atlasTextureIcon&&Fe.atlasTextureIcon.bind(Fe.atlasInterpolationIcon,W.CLAMP_TO_EDGE)),Fe.isSDF){const ke=Fe.uniformValues;Fe.hasHalo&&(ke.u_is_halo=1,Rl(Fe.buffers,Ee.segments,c,d,Fe.program,de,P,O,ke)),ke.u_is_halo=0}Rl(Fe.buffers,Ee.segments,c,d,Fe.program,de,P,O,Fe.uniformValues)}}function Rl(d,o,c,f,_,x,T,S,C){const z=f.context,P=[d.dynamicLayoutVertexBuffer,d.opacityVertexBuffer,d.globeExtVertexBuffer];_.draw(z,z.gl.TRIANGLES,x,T,S,s.CullFaceMode.disabled,C,c.id,d.layoutVertexBuffer,d.indexBuffer,o,c.paint,f.transform.zoom,d.programConfigurations.get(c.id),P)}function Sf(d,o,c,f,_,x,T){const S=d.context.gl,C=c.paint.get("fill-pattern"),z=C&&C.constantOr(1);let P,O,j,W,H;T?(O=z&&!c.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",P=S.LINES):(O=z?"fillPattern":"fill",P=S.TRIANGLES);for(const Z of f){const X=o.getTile(Z);if(z&&!X.patternsLoaded())continue;const B=X.getBucket(c);if(!B)continue;d.prepareDrawTile();const q=B.programConfigurations.get(c.id),Q=d.useProgram(O,q);z&&(d.context.activeTexture.set(S.TEXTURE0),X.imageAtlasTexture.bind(S.LINEAR,S.CLAMP_TO_EDGE),q.updatePaintBuffers());const ee=C.constantOr(null);if(ee&&X.imageAtlas){const fe=X.imageAtlas.patternPositions[ee.toString()];fe&&q.setConstantPatternPositions(fe)}const de=d.translatePosMatrix(Z.projMatrix,X,c.paint.get("fill-translate"),c.paint.get("fill-translate-anchor"));if(T){W=B.indexBuffer2,H=B.segments2;const fe=d.terrain&&d.terrain.renderingToTexture?d.terrain.drapeBufferSize:[S.drawingBufferWidth,S.drawingBufferHeight];j=O==="fillOutlinePattern"&&z?H_(de,d,X,fe):Z_(de,fe)}else W=B.indexBuffer,H=B.segments,j=z?$h(de,d,X):Ls(de);d.prepareDrawProgram(d.context,Q,Z.toUnwrapped()),Q.draw(d.context,P,_,d.stencilModeForClipping(Z),x,s.CullFaceMode.disabled,j,c.id,B.layoutVertexBuffer,W,H,c.paint,d.transform.zoom,q)}}function jc(d,o,c,f,_,x,T){const S=d.context,C=S.gl,z=d.transform,P=c.paint.get("fill-extrusion-pattern"),O=P.constantOr(1),j=c.paint.get("fill-extrusion-opacity"),W=[c.paint.get("fill-extrusion-ambient-occlusion-intensity"),c.paint.get("fill-extrusion-ambient-occlusion-radius")],H=c.layout.get("fill-extrusion-edge-radius"),Z=H>0&&!c.paint.get("fill-extrusion-rounded-roof"),X=Z?0:H,B=z.projection.name==="globe"?s.fillExtrusionHeightLift():0,q=z.projection.name==="globe",Q=q?s.globeToMercatorTransition(z.zoom):0,ee=[s.mercatorXfromLng(z.center.lng),s.mercatorYfromLat(z.center.lat)],de=[];q&&de.push("PROJECTION_GLOBE_VIEW"),W[0]>0&&de.push("FAUX_AO"),Z&&de.push("ZERO_ROOF_RADIUS");for(const fe of f){const pe=o.getTile(fe),xe=pe.getBucket(c);if(!xe||xe.projection.name!==z.projection.name)continue;const ye=xe.programConfigurations.get(c.id),Ae=d.useProgram(O?"fillExtrusionPattern":"fillExtrusion",ye,de);if(d.terrain){const Be=d.terrain;if(d.style.terrainSetForDrapingOnly())Be.setupElevationDraw(pe,Ae,{useMeterToDem:!0});else{if(!xe.enableTerrain)continue;if(Be.setupElevationDraw(pe,Ae,{useMeterToDem:!0}),Af(S,o,fe,xe,c,Be),!xe.centroidVertexBuffer){const Xe=Ae.attributes.a_centroid_pos;Xe!==void 0&&C.vertexAttrib2f(Xe,0,0)}}}O&&(d.context.activeTexture.set(C.TEXTURE0),pe.imageAtlasTexture.bind(C.LINEAR,C.CLAMP_TO_EDGE),ye.updatePaintBuffers());const We=P.constantOr(null);if(We&&pe.imageAtlas){const Be=pe.imageAtlas.patternPositions[We.toString()];Be&&ye.setConstantPatternPositions(Be)}const Ee=d.translatePosMatrix(fe.projMatrix,pe,c.paint.get("fill-extrusion-translate"),c.paint.get("fill-extrusion-translate-anchor")),Fe=z.projection.createInversionMatrix(z,fe.canonical),ke=c.paint.get("fill-extrusion-vertical-gradient"),qe=O?vf(Ee,d,ke,j,W,X,fe,pe,B,Q,ee,Fe):Vh(Ee,d,ke,j,W,X,fe,B,Q,ee,Fe);d.prepareDrawProgram(S,Ae,fe.toUnwrapped());const Se=[];d.terrain&&Se.push(xe.centroidVertexBuffer),q&&Se.push(xe.layoutVertexExtBuffer),Ae.draw(S,S.gl.TRIANGLES,_,x,T,s.CullFaceMode.backCCW,qe,c.id,xe.layoutVertexBuffer,xe.indexBuffer,xe.segments,c.paint,d.transform.zoom,ye,Se)}}function Af(d,o,c,f,_,x){const T=[B=>{let q=B.canonical.x-1,Q=B.wrap;return q<0&&(q=(1<{let q=B.canonical.x+1,Q=B.wrap;return q===1<new s.OverscaledTileID(B.overscaledZ,B.wrap,B.canonical.z,B.canonical.x,(B.canonical.y===0?1<new s.OverscaledTileID(B.overscaledZ,B.wrap,B.canonical.z,B.canonical.x,B.canonical.y===(1<{const q=o.getSource().minzoom,Q=de=>{const fe=o.getTileByID(de);if(fe&&fe.hasData())return fe.getBucket(_)},ee=[0,-1,1];for(const de of ee){if(B.overscaledZ+de(C[0]=Math.min(B.min.y,q.min.y),C[1]=Math.max(B.max.y,q.max.y),C[2]=s.EXTENT-q.min.x>B.max.x?q.min.x-s.EXTENT:B.max.x,C),P=(B,q)=>(C[0]=Math.min(B.min.x,q.min.x),C[1]=Math.max(B.max.x,q.max.x),C[2]=s.EXTENT-q.min.y>B.max.y?q.min.y-s.EXTENT:B.max.y,C),O=[(B,q)=>z(B,q),(B,q)=>z(q,B),(B,q)=>P(B,q),(B,q)=>P(q,B)],j=new s.Point(0,0);let W,H,Z;const X=(B,q,Q,ee,de)=>{const fe=[[ee?Q:B,ee?B:Q,0],[ee?Q:q,ee?q:Q,0]],pe=de<0?s.EXTENT+de:de,xe=[ee?pe:(B+q)/2,ee?(B+q)/2:pe,0];return Q===0&&de<0||Q!==0&&de>0?x.getForTilePoints(Z,[xe],!0,H):fe.push(xe),x.getForTilePoints(c,fe,!0,W),Math.max(fe[0][2],fe[1][2],xe[2])/x.exaggeration()};for(let B=0;B<4;B++){const q=(B<2?1:5)-B,Q=f.borders[B];if(Q.length===0)continue;const ee=Z=T[B](c),de=S(ee);if(!(de&&de instanceof s.FillExtrusionBucket&&de.enableTerrain)||f.borderDoneWithNeighborZ[B]===de.canonical.z&&de.borderDoneWithNeighborZ[q]===f.canonical.z||(H=x.findDEMTileFor(ee),!H||!H.dem))continue;if(!W){const ye=x.findDEMTileFor(c);if(!ye||!ye.dem)return;W=ye}const fe=de.borders[q];let pe=0;const xe=de.borderDoneWithNeighborZ[q]!==f.canonical.z;if(f.canonical.z===de.canonical.z){for(let ye=0;yeWe[0]+3));)xe&&de.encodeCentroid(void 0,Ee,!1),pe++;if(Ee&&peWe[1]-3)&&(ke++,++pe!==fe.length);)Ee=de.featuresOnBorder[fe[pe]];if(Ee=de.featuresOnBorder[fe[Fe]],Ae.intersectsCount()>1||Ee.intersectsCount()>1||ke!==1){ke!==1&&(pe=Fe),f.encodeCentroid(void 0,Ae,!1),xe&&de.encodeCentroid(void 0,Ee,!1);continue}const qe=O[B](Ae,Ee),Se=B%2?s.EXTENT-1:0;j.x=X(qe[0],Math.min(s.EXTENT-1,qe[1]),Se,B<2,qe[2]),j.y=0,f.encodeCentroid(j,Ae,!1),xe&&de.encodeCentroid(j,Ee,!1)}else f.encodeCentroid(void 0,Ae,!1)}f.borderDoneWithNeighborZ[B]=de.canonical.z,f.needsCentroidUpdate=!0,xe&&(de.borderDoneWithNeighborZ[q]=f.canonical.z,de.needsCentroidUpdate=!0)}else{for(const ye of Q)f.encodeCentroid(void 0,f.featuresOnBorder[ye],!1);if(xe){for(const ye of fe)de.encodeCentroid(void 0,de.featuresOnBorder[ye],!1);de.borderDoneWithNeighborZ[q]=f.canonical.z,de.needsCentroidUpdate=!0}f.borderDoneWithNeighborZ[B]=de.canonical.z,f.needsCentroidUpdate=!0}}(f.needsCentroidUpdate||!f.centroidVertexBuffer&&f.centroidVertexArray.length!==0)&&f.uploadCentroid(d)}const xa=new s.Color(1,0,0,1),Q_=new s.Color(0,1,0,1),ey=new s.Color(0,0,1,1),ty=new s.Color(1,0,1,1),ny=new s.Color(0,1,1,1);function ry(d,o,c){const f=d.context,_=d.transform,x=f.gl,T=_.projection.name==="globe",S=T?["PROJECTION_GLOBE_VIEW"]:null;let C=c.projMatrix;if(T&&s.globeToMercatorTransition(_.zoom)>0){const Ae=s.transitionTileAABBinECEF(c.canonical,_),We=s.globeDenormalizeECEF(Ae);C=s.multiply(new Float32Array(16),_.globeMatrix,We),s.multiply(C,_.projMatrix,C)}const z=d.useProgram("debug",null,S),P=o.getTileByID(c.key);d.terrain&&d.terrain.setupElevationDraw(P,z);const O=s.DepthMode.disabled,j=s.StencilMode.disabled,W=d.colorModeForRenderPass(),H="$debug";f.activeTexture.set(x.TEXTURE0),d.emptyTexture.bind(x.LINEAR,x.CLAMP_TO_EDGE),T?P._makeGlobeTileDebugBuffers(d.context,_):P._makeDebugTileBoundsBuffers(d.context,_.projection);const Z=P._tileDebugBuffer||d.debugBuffer,X=P._tileDebugIndexBuffer||d.debugIndexBuffer,B=P._tileDebugSegments||d.debugSegments;z.draw(f,x.LINE_STRIP,O,j,W,s.CullFaceMode.disabled,Bc(C,s.Color.red),H,Z,X,B,null,null,null,[P._globeTileDebugBorderBuffer]);const q=P.latestRawTileData,Q=Math.floor((q&&q.byteLength||0)/1024),ee=o.getTile(c).tileSize,de=512/Math.min(ee,512)*(c.overscaledZ/_.zoom)*.5;let fe=c.canonical.toString();c.overscaledZ!==c.canonical.z&&(fe+=` => ${c.overscaledZ}`),fe+=` ${Q}kb`,function(Ae,We){Ae.initDebugOverlayCanvas();const Ee=Ae.debugOverlayCanvas,Fe=Ae.context.gl,ke=Ae.debugOverlayCanvas.getContext("2d");ke.clearRect(0,0,Ee.width,Ee.height),ke.shadowColor="white",ke.shadowBlur=2,ke.lineWidth=1.5,ke.strokeStyle="white",ke.textBaseline="top",ke.font="bold 36px Open Sans, sans-serif",ke.fillText(We,5,5),ke.strokeText(We,5,5),Ae.debugOverlayTexture.update(Ee),Ae.debugOverlayTexture.bind(Fe.LINEAR,Fe.CLAMP_TO_EDGE)}(d,fe);const pe=P._tileDebugTextBuffer||d.debugBuffer,xe=P._tileDebugTextIndexBuffer||d.quadTriangleIndexBuffer,ye=P._tileDebugTextSegments||d.debugSegments;z.draw(f,x.TRIANGLES,O,j,s.ColorMode.alphaBlended,s.CullFaceMode.disabled,Bc(C,s.Color.transparent,de),H,pe,xe,ye,null,null,null,[P._globeTileDebugTextBuffer])}function Cf(d,o,c,f){wa(d,0,o+c/2,d.transform.width,c,f)}function Vc(d,o,c,f){wa(d,o-c/2,0,c,d.transform.height,f)}function wa(d,o,c,f,_,x){const T=d.context,S=T.gl;S.enable(S.SCISSOR_TEST),S.scissor(o*s.exported.devicePixelRatio,c*s.exported.devicePixelRatio,f*s.exported.devicePixelRatio,_*s.exported.devicePixelRatio),T.clear({color:x}),S.disable(S.SCISSOR_TEST)}const If=s.createLayout([{name:"a_pos_3f",components:3,type:"Float32"}]),{members:kf}=If;function Io(d,o,c,f){d.emplaceBack(o,c,f)}class $c{constructor(o){this.vertexArray=new s.StructArrayLayout3f12,this.indices=new s.StructArrayLayout3ui6,Io(this.vertexArray,-1,-1,1),Io(this.vertexArray,1,-1,1),Io(this.vertexArray,-1,1,1),Io(this.vertexArray,1,1,1),Io(this.vertexArray,-1,-1,-1),Io(this.vertexArray,1,-1,-1),Io(this.vertexArray,-1,1,-1),Io(this.vertexArray,1,1,-1),this.indices.emplaceBack(5,1,3),this.indices.emplaceBack(3,7,5),this.indices.emplaceBack(6,2,0),this.indices.emplaceBack(0,4,6),this.indices.emplaceBack(2,6,7),this.indices.emplaceBack(7,3,2),this.indices.emplaceBack(5,4,0),this.indices.emplaceBack(0,1,5),this.indices.emplaceBack(0,2,3),this.indices.emplaceBack(3,1,0),this.indices.emplaceBack(7,6,4),this.indices.emplaceBack(4,5,7),this.vertexBuffer=o.createVertexBuffer(this.vertexArray,kf),this.indexBuffer=o.createIndexBuffer(this.indices),this.segment=s.SegmentVector.simpleSegment(0,0,36,12)}}function _i(d,o,c,f,_,x){const T=d.gl,S=o.paint.get("sky-atmosphere-color"),C=o.paint.get("sky-atmosphere-halo-color"),z=o.paint.get("sky-atmosphere-sun-intensity"),P=((O,j,W,H,Z)=>({u_matrix_3f:O,u_sun_direction:j,u_sun_intensity:W,u_color_tint_r:[H.r,H.g,H.b,H.a],u_color_tint_m:[Z.r,Z.g,Z.b,Z.a],u_luminance:5e-5}))(s.fromMat4(s.create$1(),f),_,z,S,C);T.framebufferTexture2D(T.FRAMEBUFFER,T.COLOR_ATTACHMENT0,T.TEXTURE_CUBE_MAP_POSITIVE_X+x,o.skyboxTexture,0),c.draw(d,T.TRIANGLES,s.DepthMode.disabled,s.StencilMode.disabled,s.ColorMode.unblended,s.CullFaceMode.frontCW,P,"skyboxCapture",o.skyboxGeometry.vertexBuffer,o.skyboxGeometry.indexBuffer,o.skyboxGeometry.segment)}const Dl=s.createLayout([{type:"Float32",name:"a_pos",components:3},{type:"Float32",name:"a_uv",components:2}]);class Mf{constructor(o){const c=new s.StructArrayLayout5f20;c.emplaceBack(-1,1,1,0,0),c.emplaceBack(1,1,1,1,0),c.emplaceBack(1,-1,1,1,1),c.emplaceBack(-1,-1,1,0,1);const f=new s.StructArrayLayout3ui6;f.emplaceBack(0,1,2),f.emplaceBack(2,3,0),this.vertexBuffer=o.createVertexBuffer(c,Dl.members),this.indexBuffer=o.createIndexBuffer(f),this.segments=s.SegmentVector.simpleSegment(0,0,4,2)}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy()}}const Rs={symbol:function(d,o,c,f,_){if(d.renderPass!=="translucent")return;const x=s.StencilMode.disabled,T=d.colorModeForRenderPass();c.layout.get("text-variable-anchor")&&function(S,C,z,P,O,j,W){const H=C.transform,Z=O==="map",X=j==="map";for(const B of S){const q=P.getTile(B),Q=q.getBucket(z);if(!Q||!Q.text||!Q.text.segments.get().length)continue;const ee=s.evaluateSizeForZoom(Q.textSizeData,H.zoom),de=Sn(B,Q.getProjection(),H),fe=H.calculatePixelsToTileUnitsMatrix(q),pe=Re(de,q.tileID.canonical,X,Z,H,Q.getProjection(),fe),xe=z.layout.get("icon-text-fit")!=="none"&&Q.hasIconData();if(ee){const ye=Math.pow(2,H.zoom-q.tileID.overscaledZ);J_(Q,Z,X,W,s.symbolSize,H,pe,B,ye,ee,xe)}}}(f,d,c,o,c.layout.get("text-rotation-alignment"),c.layout.get("text-pitch-alignment"),_),c.paint.get("icon-opacity").constantOr(1)!==0&&Tf(d,o,c,f,!1,c.paint.get("icon-translate"),c.paint.get("icon-translate-anchor"),c.layout.get("icon-rotation-alignment"),c.layout.get("icon-pitch-alignment"),c.layout.get("icon-keep-upright"),x,T),c.paint.get("text-opacity").constantOr(1)!==0&&Tf(d,o,c,f,!0,c.paint.get("text-translate"),c.paint.get("text-translate-anchor"),c.layout.get("text-rotation-alignment"),c.layout.get("text-pitch-alignment"),c.layout.get("text-keep-upright"),x,T),o.map.showCollisionBoxes&&(Ll(d,o,c,f,c.paint.get("text-translate"),c.paint.get("text-translate-anchor"),!0),Ll(d,o,c,f,c.paint.get("icon-translate"),c.paint.get("icon-translate-anchor"),!1))},circle:function(d,o,c,f){if(d.renderPass!=="translucent")return;const _=c.paint.get("circle-opacity"),x=c.paint.get("circle-stroke-width"),T=c.paint.get("circle-stroke-opacity"),S=c.layout.get("circle-sort-key").constantOr(1)!==void 0;if(_.constantOr(1)===0&&(x.constantOr(1)===0||T.constantOr(1)===0))return;const C=d.context,z=C.gl,P=d.transform,O=d.depthModeForSublayer(0,s.DepthMode.ReadOnly),j=s.StencilMode.disabled,W=d.colorModeForRenderPass(),H=P.projection.name==="globe",Z=[s.mercatorXfromLng(P.center.lng),s.mercatorYfromLat(P.center.lat)],X=[];for(let q=0;qq.sortKey-Q.sortKey);const B={useDepthForOcclusion:!H};for(const q of X){const{programConfiguration:Q,program:ee,layoutVertexBuffer:de,globeExtVertexBuffer:fe,indexBuffer:pe,uniformValues:xe,tile:ye}=q.state,Ae=q.segments;d.terrain&&d.terrain.setupElevationDraw(ye,ee,B),d.prepareDrawProgram(C,ee,ye.tileID.toUnwrapped()),ee.draw(C,z.TRIANGLES,O,j,W,s.CullFaceMode.disabled,xe,c.id,de,pe,Ae,c.paint,P.zoom,Q,[fe])}},heatmap:function(d,o,c,f){if(c.paint.get("heatmap-opacity")!==0)if(d.renderPass==="offscreen"){const _=d.context,x=_.gl,T=s.StencilMode.disabled,S=new s.ColorMode([x.ONE,x.ONE],s.Color.transparent,[!0,!0,!0,!0]);(function(W,H,Z,X){const B=W.gl,q=H.width*X,Q=H.height*X;W.activeTexture.set(B.TEXTURE1),W.viewport.set([0,0,q,Q]);let ee=Z.heatmapFbo;if(!ee||ee&&(ee.width!==q||ee.height!==Q)){ee&&ee.destroy();const de=B.createTexture();B.bindTexture(B.TEXTURE_2D,de),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_WRAP_S,B.CLAMP_TO_EDGE),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_WRAP_T,B.CLAMP_TO_EDGE),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_MIN_FILTER,B.LINEAR),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_MAG_FILTER,B.LINEAR),ee=Z.heatmapFbo=W.createFramebuffer(q,Q,!1),function(fe,pe,xe,ye,Ae,We){const Ee=fe.gl;Ee.texImage2D(Ee.TEXTURE_2D,0,fe.isWebGL2&&fe.extRenderToTextureHalfFloat?Ee.RGBA16F:Ee.RGBA,Ae,We,0,Ee.RGBA,fe.extRenderToTextureHalfFloat?fe.isWebGL2?Ee.HALF_FLOAT:fe.extTextureHalfFloat.HALF_FLOAT_OES:Ee.UNSIGNED_BYTE,null),ye.colorAttachment.set(xe)}(W,0,de,ee,q,Q)}else B.bindTexture(B.TEXTURE_2D,ee.colorAttachment.get()),W.bindFramebuffer.set(ee.framebuffer)})(_,d,c,d.transform.projection.name==="globe"?.5:.25),_.clear({color:s.Color.transparent});const C=d.transform,z=C.projection.name==="globe",P=z?["PROJECTION_GLOBE_VIEW"]:null,O=z?s.CullFaceMode.frontCCW:s.CullFaceMode.disabled,j=[s.mercatorXfromLng(C.center.lng),s.mercatorYfromLat(C.center.lat)];for(let W=0;W({u_image:0,u_color_ramp:1,u_opacity:O.paint.get("heatmap-opacity")}))(0,x),x.id,_.viewportBuffer,_.quadTriangleIndexBuffer,_.viewportSegments,x.paint,_.transform.zoom)}(d,c))},line:function(d,o,c,f){if(d.renderPass!=="translucent")return;const _=c.paint.get("line-opacity"),x=c.paint.get("line-width");if(_.constantOr(1)===0||x.constantOr(1)===0)return;const T=d.depthModeForSublayer(0,s.DepthMode.ReadOnly),S=d.colorModeForRenderPass(),C=d.terrain&&d.terrain.renderingToTexture?1:s.exported.devicePixelRatio,z=c.paint.get("line-dasharray"),P=z.constantOr(1),O=c.layout.get("line-cap"),j=c.paint.get("line-pattern"),W=j.constantOr(1),H=c.paint.get("line-gradient"),Z=W?"linePattern":"line",X=d.context,B=X.gl,q=(ee=>{const de=[];zl(ee)&&de.push("RENDER_LINE_DASH"),ee.paint.get("line-gradient")&&de.push("RENDER_LINE_GRADIENT");const fe=ee.paint.get("line-trim-offset");fe[0]===0&&fe[1]===0||de.push("RENDER_LINE_TRIM_OFFSET");const pe=ee.paint.get("line-pattern").constantOr(1),xe=ee.paint.get("line-opacity").constantOr(1)!==1;return!pe&&xe&&de.push("RENDER_LINE_ALPHA_DISCARD"),de})(c);let Q=q.includes("RENDER_LINE_ALPHA_DISCARD");d.terrain&&d.terrain.clipOrMaskOverlapStencilType()&&(Q=!1);for(const ee of f){const de=o.getTile(ee);if(W&&!de.patternsLoaded())continue;const fe=de.getBucket(c);if(!fe)continue;d.prepareDrawTile();const pe=fe.programConfigurations.get(c.id),xe=d.useProgram(Z,pe,q),ye=j.constantOr(null);if(ye&&de.imageAtlas){const Be=de.imageAtlas.patternPositions[ye.toString()];Be&&pe.setConstantPatternPositions(Be)}const Ae=z.constantOr(null),We=O.constantOr(null);if(!W&&Ae&&We&&de.lineAtlas){const Be=de.lineAtlas.getDash(Ae,We);Be&&pe.setConstantPatternPositions(Be)}let[Ee,Fe]=c.paint.get("line-trim-offset");(We==="round"||We==="square")&&Ee!==Fe&&(Ee===0&&(Ee-=1),Fe===1&&(Fe+=1));const ke=d.terrain?ee.projMatrix:null,qe=W?Pl(d,de,c,ke,C):K_(d,de,c,ke,fe.lineClipsArray.length,C,[Ee,Fe]);if(H){const Be=fe.gradients[c.id];let Xe=Be.texture;if(c.gradientVersion!==Be.version){let $e=256;if(c.stepInterpolant){const Ye=o.getSource().maxzoom,gt=ee.canonical.z===Ye?Math.ceil(1<{xe.draw(X,B.TRIANGLES,T,Be,S,s.CullFaceMode.disabled,qe,c.id,fe.layoutVertexBuffer,fe.indexBuffer,fe.segments,c.paint,d.transform.zoom,pe,[fe.layoutVertexBuffer2])};if(Q){const Be=d.stencilModeForClipping(ee).ref;Be===0&&d.terrain&&X.clear({stencil:0});const Xe={func:B.EQUAL,mask:255};qe.u_alpha_discard_threshold=.8,Se(new s.StencilMode(Xe,Be,255,B.KEEP,B.KEEP,B.INVERT)),qe.u_alpha_discard_threshold=0,Se(new s.StencilMode(Xe,Be,255,B.KEEP,B.KEEP,B.KEEP))}else Se(d.stencilModeForClipping(ee))}Q&&(d.resetStencilClippingMasks(),d.terrain&&X.clear({stencil:0}))},fill:function(d,o,c,f){const _=c.paint.get("fill-color"),x=c.paint.get("fill-opacity");if(x.constantOr(1)===0)return;const T=d.colorModeForRenderPass(),S=c.paint.get("fill-pattern"),C=d.opaquePassEnabledForLayer()&&!S.constantOr(1)&&_.constantOr(s.Color.transparent).a===1&&x.constantOr(0)===1?"opaque":"translucent";if(d.renderPass===C){const z=d.depthModeForSublayer(1,d.renderPass==="opaque"?s.DepthMode.ReadWrite:s.DepthMode.ReadOnly);Sf(d,o,c,f,z,T,!1)}if(d.renderPass==="translucent"&&c.paint.get("fill-antialias")){const z=d.depthModeForSublayer(c.getPaintProperty("fill-outline-color")?2:0,s.DepthMode.ReadOnly);Sf(d,o,c,f,z,T,!0)}},"fill-extrusion":function(d,o,c,f){const _=c.paint.get("fill-extrusion-opacity");if(_!==0&&d.renderPass==="translucent"){const x=new s.DepthMode(d.context.gl.LEQUAL,s.DepthMode.ReadWrite,d.depthRangeFor3D);if(_!==1||c.paint.get("fill-extrusion-pattern").constantOr(1))jc(d,o,c,f,x,s.StencilMode.disabled,s.ColorMode.disabled),jc(d,o,c,f,x,d.stencilModeFor3D(),d.colorModeForRenderPass()),d.resetStencilClippingMasks();else{const T=d.colorModeForRenderPass();jc(d,o,c,f,x,s.StencilMode.disabled,T)}}},hillshade:function(d,o,c,f){if(d.renderPass!=="offscreen"&&d.renderPass!=="translucent")return;const _=d.context,x=d.depthModeForSublayer(0,s.DepthMode.ReadOnly),T=d.colorModeForRenderPass(),S=d.terrain&&d.terrain.renderingToTexture,[C,z]=d.renderPass!=="translucent"||S?[{},f]:d.stencilConfigForOverlap(f);for(const P of z){const O=o.getTile(P);if(O.needsHillshadePrepare&&d.renderPass==="offscreen")gf(d,O,c,x,s.StencilMode.disabled,T);else if(d.renderPass==="translucent"){const j=S&&d.terrain?d.terrain.stencilModeForRTTOverlap(P):C[P.overscaledZ];mf(d,P,O,c,x,j,T)}}_.viewport.set([0,0,d.width,d.height]),d.resetStencilClippingMasks()},raster:function(d,o,c,f,_,x){if(d.renderPass!=="translucent"||c.paint.get("raster-opacity")===0||!f.length)return;const T=d.context,S=T.gl,C=o.getSource(),z=d.useProgram("raster"),P=d.colorModeForRenderPass(),O=d.terrain&&d.terrain.renderingToTexture,[j,W]=C instanceof Rt||O?[{},f]:d.stencilConfigForOverlap(f),H=W[W.length-1].overscaledZ,Z=!d.options.moving;for(const X of W){const B=O?s.DepthMode.disabled:d.depthModeForSublayer(X.overscaledZ-H,c.paint.get("raster-opacity")===1?s.DepthMode.ReadWrite:s.DepthMode.ReadOnly,S.LESS),q=X.toUnwrapped(),Q=o.getTile(X);if(O&&(!Q||!Q.hasData()))continue;const ee=O?X.projMatrix:d.transform.calculateProjMatrix(q,Z),de=d.terrain&&O?d.terrain.stencilModeForRTTOverlap(X):j[X.overscaledZ],fe=x?0:c.paint.get("raster-fade-duration");Q.registerFadeDuration(fe);const pe=o.findLoadedParent(X,0),xe=Nh(Q,pe,o,d.transform,fe);let ye,Ae;d.terrain&&d.terrain.prepareDrawTile();const We=c.paint.get("raster-resampling")==="nearest"?S.NEAREST:S.LINEAR;T.activeTexture.set(S.TEXTURE0),Q.texture.bind(We,S.CLAMP_TO_EDGE),T.activeTexture.set(S.TEXTURE1),pe?(pe.texture.bind(We,S.CLAMP_TO_EDGE),ye=Math.pow(2,pe.tileID.overscaledZ-Q.tileID.overscaledZ),Ae=[Q.tileID.canonical.x*ye%1,Q.tileID.canonical.y*ye%1]):Q.texture.bind(We,S.CLAMP_TO_EDGE),Q.texture.useMipmap&&T.extTextureFilterAnisotropic&&d.transform.pitch>20&&S.texParameterf(S.TEXTURE_2D,T.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,T.extTextureFilterAnisotropicMax);const Ee=Hh(ee,Ae||[0,0],ye||1,xe,c,C instanceof Rt?C.perspectiveTransform:[0,0]);if(d.prepareDrawProgram(T,z,q),C instanceof Rt)C.boundsBuffer&&C.boundsSegments&&z.draw(T,S.TRIANGLES,B,s.StencilMode.disabled,P,s.CullFaceMode.disabled,Ee,c.id,C.boundsBuffer,d.quadTriangleIndexBuffer,C.boundsSegments);else{const{tileBoundsBuffer:Fe,tileBoundsIndexBuffer:ke,tileBoundsSegments:qe}=d.getTileBoundsBuffers(Q);z.draw(T,S.TRIANGLES,B,de,P,s.CullFaceMode.disabled,Ee,c.id,Fe,ke,qe)}}d.resetStencilClippingMasks()},background:function(d,o,c,f){const _=c.paint.get("background-color"),x=c.paint.get("background-opacity");if(x===0)return;const T=d.context,S=T.gl,C=d.transform,z=C.tileSize,P=c.paint.get("background-pattern");if(d.isPatternMissing(P))return;const O=!P&&_.a===1&&x===1&&d.opaquePassEnabledForLayer()?"opaque":"translucent";if(d.renderPass!==O)return;const j=s.StencilMode.disabled,W=d.depthModeForSublayer(0,O==="opaque"?s.DepthMode.ReadWrite:s.DepthMode.ReadOnly),H=d.colorModeForRenderPass(),Z=d.useProgram(P?"backgroundPattern":"background");let X,B=f;B||(X=d.getBackgroundTiles(),B=Object.values(X).map(q=>q.tileID)),P&&(T.activeTexture.set(S.TEXTURE0),d.imageManager.bind(d.context));for(const q of B){const Q=q.toUnwrapped(),ee=f?q.projMatrix:d.transform.calculateProjMatrix(Q);d.prepareDrawTile();const de=o?o.getTile(q):X?X[q.key]:new s.Tile(q,z,C.zoom,d),fe=P?Y_(ee,x,d,P,{tileID:q,tileSize:z}):Kh(ee,x,_);d.prepareDrawProgram(T,Z,Q);const{tileBoundsBuffer:pe,tileBoundsIndexBuffer:xe,tileBoundsSegments:ye}=d.getTileBoundsBuffers(de);Z.draw(T,S.TRIANGLES,W,j,H,s.CullFaceMode.disabled,fe,c.id,pe,xe,ye)}},sky:function(d,o,c){const f=d.transform,_=f.projection.name==="mercator"||f.projection.name==="globe"?1:s.smoothstep(7,8,f.zoom),x=c.paint.get("sky-opacity")*_;if(x===0)return;const T=d.context,S=c.paint.get("sky-type"),C=new s.DepthMode(T.gl.LEQUAL,s.DepthMode.ReadOnly,[0,1]),z=d.frameCounter/1e3%1;S==="atmosphere"?d.renderPass==="offscreen"?c.needsSkyboxCapture(d)&&(function(P,O,j,W){const H=P.context,Z=H.gl;let X=O.skyboxFbo;if(!X){X=O.skyboxFbo=H.createFramebuffer(32,32,!1),O.skyboxGeometry=new $c(H),O.skyboxTexture=H.gl.createTexture(),Z.bindTexture(Z.TEXTURE_CUBE_MAP,O.skyboxTexture),Z.texParameteri(Z.TEXTURE_CUBE_MAP,Z.TEXTURE_WRAP_S,Z.CLAMP_TO_EDGE),Z.texParameteri(Z.TEXTURE_CUBE_MAP,Z.TEXTURE_WRAP_T,Z.CLAMP_TO_EDGE),Z.texParameteri(Z.TEXTURE_CUBE_MAP,Z.TEXTURE_MIN_FILTER,Z.LINEAR),Z.texParameteri(Z.TEXTURE_CUBE_MAP,Z.TEXTURE_MAG_FILTER,Z.LINEAR);for(let ee=0;ee<6;++ee)Z.texImage2D(Z.TEXTURE_CUBE_MAP_POSITIVE_X+ee,0,Z.RGBA,32,32,0,Z.RGBA,Z.UNSIGNED_BYTE,null)}H.bindFramebuffer.set(X.framebuffer),H.viewport.set([0,0,32,32]);const B=O.getCenter(P,!0),q=P.useProgram("skyboxCapture"),Q=new Float64Array(16);s.identity(Q),s.rotateY(Q,Q,.5*-Math.PI),_i(H,O,q,Q,B,0),s.identity(Q),s.rotateY(Q,Q,.5*Math.PI),_i(H,O,q,Q,B,1),s.identity(Q),s.rotateX(Q,Q,.5*-Math.PI),_i(H,O,q,Q,B,2),s.identity(Q),s.rotateX(Q,Q,.5*Math.PI),_i(H,O,q,Q,B,3),s.identity(Q),_i(H,O,q,Q,B,4),s.identity(Q),s.rotateY(Q,Q,Math.PI),_i(H,O,q,Q,B,5),H.viewport.set([0,0,P.width,P.height])}(d,c),c.markSkyboxValid(d)):d.renderPass==="sky"&&function(P,O,j,W,H){const Z=P.context,X=Z.gl,B=P.transform,q=P.useProgram("skybox");Z.activeTexture.set(X.TEXTURE0),X.bindTexture(X.TEXTURE_CUBE_MAP,O.skyboxTexture);const Q=((ee,de,fe,pe,xe)=>({u_matrix:ee,u_sun_direction:de,u_cubemap:0,u_opacity:pe,u_temporal_offset:xe}))(B.skyboxMatrix,O.getCenter(P,!1),0,W,H);P.prepareDrawProgram(Z,q),q.draw(Z,X.TRIANGLES,j,s.StencilMode.disabled,P.colorModeForRenderPass(),s.CullFaceMode.backCW,Q,"skybox",O.skyboxGeometry.vertexBuffer,O.skyboxGeometry.indexBuffer,O.skyboxGeometry.segment)}(d,c,C,x,z):S==="gradient"&&d.renderPass==="sky"&&function(P,O,j,W,H){const Z=P.context,X=Z.gl,B=P.transform,q=P.useProgram("skyboxGradient");O.skyboxGeometry||(O.skyboxGeometry=new $c(Z)),Z.activeTexture.set(X.TEXTURE0);let Q=O.colorRampTexture;Q||(Q=O.colorRampTexture=new s.Texture(Z,O.colorRamp,X.RGBA)),Q.bind(X.LINEAR,X.CLAMP_TO_EDGE);const ee=((de,fe,pe,xe,ye)=>({u_matrix:de,u_color_ramp:0,u_center_direction:fe,u_radius:s.degToRad(pe),u_opacity:xe,u_temporal_offset:ye}))(B.skyboxMatrix,O.getCenter(P,!1),O.paint.get("sky-gradient-radius"),W,H);P.prepareDrawProgram(Z,q),q.draw(Z,X.TRIANGLES,j,s.StencilMode.disabled,P.colorModeForRenderPass(),s.CullFaceMode.backCW,ee,"skyboxGradient",O.skyboxGeometry.vertexBuffer,O.skyboxGeometry.indexBuffer,O.skyboxGeometry.segment)}(d,c,C,x,z)},debug:function(d,o,c){for(let f=0;f_)return void(this.transform.fogCullDistSq=null);const x=f+.78*(_-f);this.transform.fogCullDistSq=x*x}get terrain(){return this.transform._terrainEnabled()&&this._terrain&&this._terrain.enabled?this._terrain:null}resize(o,c){if(this.width=o*s.exported.devicePixelRatio,this.height=c*s.exported.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const f of this.style.order)this.style._layers[f].resize()}setup(){const o=this.context,c=new s.StructArrayLayout2i4;c.emplaceBack(0,0),c.emplaceBack(s.EXTENT,0),c.emplaceBack(0,s.EXTENT),c.emplaceBack(s.EXTENT,s.EXTENT),this.tileExtentBuffer=o.createVertexBuffer(c,s.posAttributes.members),this.tileExtentSegments=s.SegmentVector.simpleSegment(0,0,4,2);const f=new s.StructArrayLayout2i4;f.emplaceBack(0,0),f.emplaceBack(s.EXTENT,0),f.emplaceBack(0,s.EXTENT),f.emplaceBack(s.EXTENT,s.EXTENT),this.debugBuffer=o.createVertexBuffer(f,s.posAttributes.members),this.debugSegments=s.SegmentVector.simpleSegment(0,0,4,5);const _=new s.StructArrayLayout2i4;_.emplaceBack(-1,-1),_.emplaceBack(1,-1),_.emplaceBack(-1,1),_.emplaceBack(1,1),this.viewportBuffer=o.createVertexBuffer(_,s.posAttributes.members),this.viewportSegments=s.SegmentVector.simpleSegment(0,0,4,2);const x=new s.StructArrayLayout4i8;x.emplaceBack(0,0,0,0),x.emplaceBack(s.EXTENT,0,s.EXTENT,0),x.emplaceBack(0,s.EXTENT,0,s.EXTENT),x.emplaceBack(s.EXTENT,s.EXTENT,s.EXTENT,s.EXTENT),this.mercatorBoundsBuffer=o.createVertexBuffer(x,s.boundsAttributes.members),this.mercatorBoundsSegments=s.SegmentVector.simpleSegment(0,0,4,2);const T=new s.StructArrayLayout3ui6;T.emplaceBack(0,1,2),T.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=o.createIndexBuffer(T);const S=new s.StructArrayLayout1ui2;for(const z of[0,1,3,2,0])S.emplaceBack(z);this.debugIndexBuffer=o.createIndexBuffer(S),this.emptyTexture=new s.Texture(o,new s.RGBAImage({width:1,height:1},Uint8Array.of(0,0,0,0)),o.gl.RGBA),this.identityMat=s.create();const C=this.context.gl;this.stencilClearMode=new s.StencilMode({func:C.ALWAYS,mask:0},0,255,C.ZERO,C.ZERO,C.ZERO),this.loadTimeStamps.push(s.window.performance.now()),this.atmosphereBuffer=new Mf(this.context)}getMercatorTileBoundsBuffers(){return{tileBoundsBuffer:this.mercatorBoundsBuffer,tileBoundsIndexBuffer:this.quadTriangleIndexBuffer,tileBoundsSegments:this.mercatorBoundsSegments}}getTileBoundsBuffers(o){return o._makeTileBoundsBuffers(this.context,this.transform.projection),o._tileBoundsBuffer?{tileBoundsBuffer:o._tileBoundsBuffer,tileBoundsIndexBuffer:o._tileBoundsIndexBuffer,tileBoundsSegments:o._tileBoundsSegments}:this.getMercatorTileBoundsBuffers()}clearStencil(){const o=this.context,c=o.gl;this.nextStencilID=1,this.currentStencilSource=void 0,this._tileClippingMaskIDs={},this.useProgram("clippingMask").draw(o,c.TRIANGLES,s.DepthMode.disabled,this.stencilClearMode,s.ColorMode.disabled,s.CullFaceMode.disabled,kl(this.identityMat),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}resetStencilClippingMasks(){this.terrain||(this.currentStencilSource=void 0,this._tileClippingMaskIDs={})}_renderTileClippingMasks(o,c,f){if(!c||this.currentStencilSource===c.id||!o.isTileClipped()||!f||f.length===0)return;if(this._tileClippingMaskIDs&&!this.terrain){let S=!1;for(const C of f)if(this._tileClippingMaskIDs[C.key]===void 0){S=!0;break}if(!S)return}this.currentStencilSource=c.id;const _=this.context,x=_.gl;this.nextStencilID+f.length>256&&this.clearStencil(),_.setColorMode(s.ColorMode.disabled),_.setDepthMode(s.DepthMode.disabled);const T=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const S of f){const C=c.getTile(S),z=this._tileClippingMaskIDs[S.key]=this.nextStencilID++,{tileBoundsBuffer:P,tileBoundsIndexBuffer:O,tileBoundsSegments:j}=this.getTileBoundsBuffers(C);T.draw(_,x.TRIANGLES,s.DepthMode.disabled,new s.StencilMode({func:x.ALWAYS,mask:0},z,255,x.KEEP,x.KEEP,x.REPLACE),s.ColorMode.disabled,s.CullFaceMode.disabled,kl(S.projMatrix),"$clipping",P,O,j)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const o=this.nextStencilID++,c=this.context.gl;return new s.StencilMode({func:c.NOTEQUAL,mask:255},o,255,c.KEEP,c.KEEP,c.REPLACE)}stencilModeForClipping(o){if(this.terrain)return this.terrain.stencilModeForRTTOverlap(o);const c=this.context.gl;return new s.StencilMode({func:c.EQUAL,mask:255},this._tileClippingMaskIDs[o.key],0,c.KEEP,c.KEEP,c.REPLACE)}stencilConfigForOverlap(o){const c=this.context.gl,f=o.sort((T,S)=>S.overscaledZ-T.overscaledZ),_=f[f.length-1].overscaledZ,x=f[0].overscaledZ-_+1;if(x>1){this.currentStencilSource=void 0,this.nextStencilID+x>256&&this.clearStencil();const T={};for(let S=0;S=0;this.currentLayer--){const z=this.style._layers[f[this.currentLayer]],P=o._getLayerSourceCache(z);if(z.isSky())continue;const O=P?T[P.id]:void 0;this._renderTileClippingMasks(z,P,O),this.renderLayer(this,P,z,O)}if(this.style.fog&&this.transform.projection.supportsFog&&function(z,P){const O=z.context,j=O.gl,W=z.transform,H=new s.DepthMode(j.LEQUAL,s.DepthMode.ReadOnly,[0,1]),Z=z.useProgram("globeAtmosphere",null,W.projection.name==="globe"?["PROJECTION_GLOBE_VIEW","FOG"]:["FOG"]),X=s.globeToMercatorTransition(W.zoom),B=P.properties.get("color").toArray01(),q=P.properties.get("high-color").toArray01(),Q=P.properties.get("space-color").toArray01PremultipliedAlpha(),ee=s.identity$1([]);s.rotateY$1(ee,ee,-s.degToRad(W._center.lng)),s.rotateX$1(ee,ee,s.degToRad(W._center.lat)),s.rotateZ$1(ee,ee,W.angle),s.rotateX$1(ee,ee,-W._pitch);const de=s.fromQuat(new Float32Array(16),ee),fe=s.mapValue(P.properties.get("star-intensity"),0,1,0,.25),pe=5e-4,xe=s.mapValue(P.properties.get("horizon-blend"),0,1,pe,.25),ye=s.globeUseCustomAntiAliasing(z,O,W)&&xe===pe?W.worldSize/(2*Math.PI*1.025)-1:W.globeRadius,Ae=z.frameCounter/1e3%1,We=s.length(W.globeCenterInViewSpace),Ee=Math.sqrt(Math.pow(We,2)-Math.pow(ye,2)),Fe=Math.acos(Ee/We),ke=((Se,Be,Xe,$e,Ye,gt,Et,pt,wt,Ut,Ot,mt,en,rn)=>({u_frustum_tl:Se,u_frustum_tr:Be,u_frustum_br:Xe,u_frustum_bl:$e,u_horizon:Ye,u_transition:gt,u_fadeout_range:Et,u_color:pt,u_high_color:wt,u_space_color:Ut,u_star_intensity:Ot,u_star_size:5*s.exported.devicePixelRatio,u_star_density:0,u_temporal_offset:mt,u_horizon_angle:en,u_rotation_matrix:rn}))(W.frustumCorners.TL,W.frustumCorners.TR,W.frustumCorners.BR,W.frustumCorners.BL,W.frustumCorners.horizon,X,xe,B,q,Q,fe,Ae,Fe,de);z.prepareDrawProgram(O,Z);const qe=z.atmosphereBuffer;qe&&Z.draw(O,j.TRIANGLES,H,s.StencilMode.disabled,s.ColorMode.alphaBlended,s.CullFaceMode.backCW,ke,"skybox",qe.vertexBuffer,qe.indexBuffer,qe.segments)}(this,this.style.fog),this.renderPass="sky",(s.globeToMercatorTransition(this.transform.zoom)>0||this.transform.projection.name!=="globe")&&this.transform.isHorizonVisible())for(this.currentLayer=0;this.currentLayer{const O=o._getLayerSourceCache(P);O&&!P.isHidden(this.transform.zoom)&&(!z||z.getSource().maxzoom0?c.pop():null}isPatternMissing(o){return o===null||o!==void 0&&!this.imageManager.getPattern(o.toString())}terrainRenderModeElevated(){return this.style&&!!this.style.getTerrain()&&!!this.terrain&&!this.terrain.renderingToTexture}currentGlobalDefines(){const o=this.terrain&&this.terrain.renderingToTexture,c=this.terrain&&this.terrain.exaggeration()===0,f=this.style&&this.style.fog,_=[];return this.terrainRenderModeElevated()&&_.push("TERRAIN"),this.transform.projection.name==="globe"&&_.push("GLOBE"),c&&_.push("ZERO_EXAGGERATION"),f&&!o&&f.getOpacity(this.transform.pitch)!==0&&_.push("FOG"),o&&_.push("RENDER_TO_TEXTURE"),this._showOverdrawInspector&&_.push("OVERDRAW_INSPECTOR"),_}useProgram(o,c,f){this.cache=this.cache||{};const _=f||[],x=this.currentGlobalDefines().concat(_),T=Wt.cacheKey(Dh[o],o,x,c);return this.cache[T]||(this.cache[T]=new Wt(this.context,o,Dh[o],c,Yh[o],x)),this.cache[T]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.frontFace.setDefault(),this.context.cullFaceSide.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const o=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(o.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=s.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new s.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this._terrain&&this._terrain.destroy(),this.globeSharedBuffers&&this.globeSharedBuffers.destroy(),this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.atmosphereBuffer&&this.atmosphereBuffer.destroy()}prepareDrawTile(){this.terrain&&this.terrain.prepareDrawTile()}prepareDrawProgram(o,c,f){if(this.terrain&&this.terrain.renderingToTexture)return;const _=this.style.fog;if(_){const x=_.getOpacity(this.transform.pitch),T=((S,C,z,P,O,j,W,H,Z,X,B)=>{const q=S.transform,Q=C.properties.get("color").toArray01();Q[3]=P;const ee=S.frameCounter/1e3%1;return{u_fog_matrix:z?q.calculateFogTileMatrix(z):S.identityMat,u_fog_range:C.getFovAdjustedRange(q._fov),u_fog_color:Q,u_fog_horizon_blend:C.properties.get("horizon-blend"),u_fog_temporal_offset:ee,u_frustum_tl:O,u_frustum_tr:j,u_frustum_br:W,u_frustum_bl:H,u_globe_pos:Z,u_globe_radius:X,u_viewport:B,u_globe_transition:s.globeToMercatorTransition(q.zoom),u_is_globe:+(q.projection.name==="globe")}})(this,_,f,x,this.transform.frustumCorners.TL,this.transform.frustumCorners.TR,this.transform.frustumCorners.BR,this.transform.frustumCorners.BL,this.transform.globeCenterInViewSpace,this.transform.globeRadius,[this.transform.width*s.exported.devicePixelRatio,this.transform.height*s.exported.devicePixelRatio]);c.setFogUniformValues(o,T)}}setTileLoadedFlag(o){this.tileLoaded=o}saveCanvasCopy(){const o=this.canvasCopy();o&&(this.frameCopies.push(o),this.tileLoaded=!1)}canvasCopy(){const o=this.context.gl,c=o.createTexture();return o.bindTexture(o.TEXTURE_2D,c),o.copyTexImage2D(o.TEXTURE_2D,0,o.RGBA,0,0,o.drawingBufferWidth,o.drawingBufferHeight,0),c}getCanvasCopiesAndTimestamps(){return{canvasCopies:this.frameCopies,timeStamps:this.loadTimeStamps}}averageElevationNeedsEasing(){if(!this.transform._elevation)return!1;const o=this.style&&this.style.fog;return!!o&&o.getOpacity(this.transform.pitch)!==0}getBackgroundTiles(){const o=this._backgroundTiles,c=this._backgroundTiles={},f=this.transform.coveringTiles({tileSize:512});for(const _ of f)c[_.key]=o[_.key]||new s.Tile(_,512,this.transform.tileZoom,this);return c}clearBackgroundTiles(){this._backgroundTiles={}}}class Gc{constructor(o=0,c=0,f=0,_=0){if(isNaN(o)||o<0||isNaN(c)||c<0||isNaN(f)||f<0||isNaN(_)||_<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=o,this.bottom=c,this.left=f,this.right=_}interpolate(o,c,f){return c.top!=null&&o.top!=null&&(this.top=s.number(o.top,c.top,f)),c.bottom!=null&&o.bottom!=null&&(this.bottom=s.number(o.bottom,c.bottom,f)),c.left!=null&&o.left!=null&&(this.left=s.number(o.left,c.left,f)),c.right!=null&&o.right!=null&&(this.right=s.number(o.right,c.right,f)),this}getCenter(o,c){const f=s.clamp((this.left+o-this.right)/2,0,o),_=s.clamp((this.top+c-this.bottom)/2,0,c);return new s.Point(f,_)}equals(o){return this.top===o.top&&this.bottom===o.bottom&&this.left===o.left&&this.right===o.right}clone(){return new Gc(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function qc(d,o){const c=s.getColumn(d,3);s.fromQuat(d,o),s.setColumn(d,3,c)}function Zt(d,o){const c=s.identity$1([]);return s.rotateZ$1(c,c,-o),s.rotateX$1(c,c,-d),c}function Ol(d,o){const c=[d[0],d[1],0],f=[o[0],o[1],0];if(s.length(c)>=1e-15){const T=s.normalize([],c);s.scale$2(f,T,s.dot(f,T)),o[0]=f[0],o[1]=f[1]}const _=s.cross([],o,d);if(s.len(_)<1e-15)return null;const x=Math.atan2(-_[1],_[0]);return Zt(Math.atan2(Math.sqrt(d[0]*d[0]+d[1]*d[1]),-d[2]),x)}class Pf{constructor(o,c){this.position=o,this.orientation=c}get position(){return this._position}set position(o){if(o){const c=o instanceof s.MercatorCoordinate?o:new s.MercatorCoordinate(o[0],o[1],o[2]);this._renderWorldCopies&&(c.x=s.wrap(c.x,0,1)),this._position=c}else this._position=null}lookAtPoint(o,c){if(this.orientation=null,!this.position)return;const f=this.position,_=this._elevation?this._elevation.getAtPointOrZero(s.MercatorCoordinate.fromLngLat(o)):0,x=s.MercatorCoordinate.fromLngLat(o,_),T=[x.x-f.x,x.y-f.y,x.z-f.z];c||(c=[0,0,1]),c[2]=Math.abs(c[2]),this.orientation=Ol(T,c)}setPitchBearing(o,c){this.orientation=Zt(s.degToRad(o),s.degToRad(-c))}}class Wc{constructor(o,c){this._transform=s.identity([]),this.orientation=c,this.position=o}get mercatorPosition(){const o=this.position;return new s.MercatorCoordinate(o[0],o[1],o[2])}get position(){const o=s.getColumn(this._transform,3);return[o[0],o[1],o[2]]}set position(o){var c;o&&s.setColumn(this._transform,3,[(c=o)[0],c[1],c[2],1])}get orientation(){return this._orientation}set orientation(o){this._orientation=o||s.identity$1([]),o&&qc(this._transform,this._orientation)}getPitchBearing(){const o=this.forward(),c=this.right();return{bearing:Math.atan2(-c[1],c[0]),pitch:Math.atan2(Math.sqrt(o[0]*o[0]+o[1]*o[1]),-o[2])}}setPitchBearing(o,c){this._orientation=Zt(o,c),qc(this._transform,this._orientation)}forward(){const o=s.getColumn(this._transform,2);return[-o[0],-o[1],-o[2]]}up(){const o=s.getColumn(this._transform,1);return[-o[0],-o[1],-o[2]]}right(){const o=s.getColumn(this._transform,0);return[o[0],o[1],o[2]]}getCameraToWorld(o,c){const f=new Float64Array(16);return s.invert(f,this.getWorldToCamera(o,c)),f}getWorldToCameraPosition(o,c,f){const _=this.position;s.scale$2(_,_,-o);const x=new Float64Array(16);return s.fromScaling(x,[f,f,f]),s.translate(x,x,_),x[10]*=c,x}getWorldToCamera(o,c){const f=new Float64Array(16),_=new Float64Array(4),x=this.position;return s.conjugate(_,this._orientation),s.scale$2(x,x,-o),s.fromQuat(f,_),s.translate(f,f,x),f[1]*=-1,f[5]*=-1,f[9]*=-1,f[13]*=-1,f[8]*=c,f[9]*=c,f[10]*=c,f[11]*=c,f}getCameraToClipPerspective(o,c,f,_){const x=new Float64Array(16);return s.perspective(x,o,c,f,_),x}getDistanceToElevation(o,c=!1){const f=o===0?0:s.mercatorZfromAltitude(o,c?s.latFromMercatorY(this.position[1]):this.position[1]),_=this.forward();return(f-this.position[2])/_[2]}clone(){return new Wc([...this.position],[...this.orientation])}}function Ea(d,o){const c=Zc(d.projection,d.zoom,d.width,d.height),f=function(x,T,S,C,z){const P=new s.LngLat(S.lng-180*ko,S.lat),O=new s.LngLat(S.lng+180*ko,S.lat),j=x.project(P.lng,P.lat),W=x.project(O.lng,O.lat),H=-Math.atan2(W.y-j.y,W.x-j.x),Z=s.MercatorCoordinate.fromLngLat(S);Z.y=s.clamp(Z.y,-1+ko,1-ko);const X=Z.toLngLat(),B=x.project(X.lng,X.lat),q=s.MercatorCoordinate.fromLngLat(X);q.x+=ko;const Q=q.toLngLat(),ee=x.project(Q.lng,Q.lat),de=Hc(ee.x-B.x,ee.y-B.y,H),fe=s.MercatorCoordinate.fromLngLat(X);fe.y+=ko;const pe=fe.toLngLat(),xe=x.project(pe.lng,pe.lat),ye=Hc(xe.x-B.x,xe.y-B.y,H),Ae=Math.abs(de.x)/Math.abs(ye.y),We=s.identity([]);s.rotateZ(We,We,-H*(1-(z?0:C)));const Ee=s.identity([]);return s.scale(Ee,Ee,[1,1-(1-Ae)*C,1]),Ee[4]=-ye.x/ye.y*C,s.rotateZ(Ee,Ee,H),s.multiply(Ee,We,Ee),Ee}(d.projection,0,d.center,c,o),_=zf(d);return s.scale(f,f,[_,_,1]),f}function zf(d){const o=d.projection,c=Zc(d.projection,d.zoom,d.width,d.height),f=Lf(o,d.center),_=Lf(o,s.LngLat.convert(o.center));return Math.pow(2,f*c+(1-c)*_)}function Zc(d,o,c,f,_=1/0){const x=d.range;if(!x)return 0;const T=Math.min(_,Math.max(c,f)),S=Math.log(T/1024)/Math.LN2;return s.smoothstep(x[0]+S,x[1]+S,o)}const ko=1/4e4;function Lf(d,o){const c=s.clamp(o.lat,-s.MAX_MERCATOR_LATITUDE,s.MAX_MERCATOR_LATITUDE),f=new s.LngLat(o.lng-180*ko,c),_=new s.LngLat(o.lng+180*ko,c),x=d.project(f.lng,c),T=d.project(_.lng,c),S=s.MercatorCoordinate.fromLngLat(f),C=s.MercatorCoordinate.fromLngLat(_),z=T.x-x.x,P=T.y-x.y,O=C.x-S.x,j=C.y-S.y,W=Math.sqrt((O*O+j*j)/(z*z+P*P));return Math.log(W)/Math.LN2}function Hc(d,o,c){const f=Math.cos(c),_=Math.sin(c);return{x:d*f-o*_,y:d*_+o*f}}class Ta{constructor(o,c,f,_,x,T,S){this.tileSize=512,this._renderWorldCopies=x===void 0||x,this._minZoom=o||0,this._maxZoom=c||22,this._minPitch=f??0,this._maxPitch=_??60,this.setProjection(T),this.setMaxBounds(S),this.width=0,this.height=0,this._center=new s.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._nearZ=0,this._farZ=0,this._unmodified=!0,this._edgeInsets=new Gc,this._projMatrixCache={},this._alignedProjMatrixCache={},this._fogTileMatrixCache={},this._distanceTileDataCache={},this._camera=new Wc,this._centerAltitude=0,this._averageElevation=0,this.cameraElevationReference="ground",this._pixelsPerMercatorPixel=1,this.globeRadius=0,this.globeCenterInViewSpace=[0,0,0],this._horizonShift=.1}clone(){const o=new Ta(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies,this.getProjection());return o._elevation=this._elevation,o._centerAltitude=this._centerAltitude,o._centerAltitudeValidForExaggeration=this._centerAltitudeValidForExaggeration,o.tileSize=this.tileSize,o.mercatorFromTransition=this.mercatorFromTransition,o.width=this.width,o.height=this.height,o.cameraElevationReference=this.cameraElevationReference,o._center=this._center,o._setZoom(this.zoom),o._seaLevelZoom=this._seaLevelZoom,o.angle=this.angle,o._fov=this._fov,o._pitch=this._pitch,o._nearZ=this._nearZ,o._farZ=this._farZ,o._averageElevation=this._averageElevation,o._unmodified=this._unmodified,o._edgeInsets=this._edgeInsets.clone(),o._camera=this._camera.clone(),o._calcMatrices(),o.freezeTileCoverage=this.freezeTileCoverage,o.frustumCorners=this.frustumCorners,o}get elevation(){return this._elevation}set elevation(o){this._elevation!==o&&(this._elevation=o,this._updateCameraOnTerrain(),this._calcMatrices())}updateElevation(o,c=!1){const f=this._elevation&&this._elevation.exaggeration()!==this._centerAltitudeValidForExaggeration;(this._seaLevelZoom==null||f)&&this._updateCameraOnTerrain(),(o||f)&&this._constrainCamera(c),this._calcMatrices()}getProjection(){return s.pick(this.projection,["name","center","parallels"])}setProjection(o){this.projectionOptions=o||{name:"mercator"};const c=this.projection?this.getProjection():void 0;this.projection=s.getProjection(this.projectionOptions);const f=!k(c,this.getProjection());return f&&this._calcMatrices(),this.mercatorFromTransition=!1,f}setMercatorFromTransition(){const o=this.projection.name;this.mercatorFromTransition=!0,this.projectionOptions={name:"mercator"},this.projection=s.getProjection({name:"mercator"});const c=o!==this.projection.name;return c&&this._calcMatrices(),c}get minZoom(){return this._minZoom}set minZoom(o){this._minZoom!==o&&(this._minZoom=o,this.zoom=Math.max(this.zoom,o))}get maxZoom(){return this._maxZoom}set maxZoom(o){this._maxZoom!==o&&(this._maxZoom=o,this.zoom=Math.min(this.zoom,o))}get minPitch(){return this._minPitch}set minPitch(o){this._minPitch!==o&&(this._minPitch=o,this.pitch=Math.max(this.pitch,o))}get maxPitch(){return this._maxPitch}set maxPitch(o){this._maxPitch!==o&&(this._maxPitch=o,this.pitch=Math.min(this.pitch,o))}get renderWorldCopies(){return this._renderWorldCopies&&this.projection.supportsWorldCopies===!0}set renderWorldCopies(o){o===void 0?o=!0:o===null&&(o=!1),this._renderWorldCopies=o}get worldSize(){return this.tileSize*this.scale}get cameraWorldSizeForFog(){const o=Math.max(this._camera.getDistanceToElevation(this._averageElevation),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(o))}get cameraWorldSize(){const o=Math.max(this._camera.getDistanceToElevation(this._averageElevation,!0),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(o))}get pixelsPerMeter(){return this.projection.pixelsPerMeter(this.center.lat,this.worldSize)}get cameraPixelsPerMeter(){return s.mercatorZfromAltitude(this.center.lat,this.cameraWorldSizeForFog)}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new s.Point(this.width,this.height)}get bearing(){return s.wrap(this.rotation,-180,180)}set bearing(o){this.rotation=o}get rotation(){return-this.angle/Math.PI*180}set rotation(o){const c=-o*Math.PI/180;var f;this.angle!==c&&(this._unmodified=!1,this.angle=c,this._calcMatrices(),this.rotationMatrix=(f=new s.ARRAY_TYPE(4),s.ARRAY_TYPE!=Float32Array&&(f[1]=0,f[2]=0),f[0]=1,f[3]=1,f),function(_,x,T){var S=x[0],C=x[1],z=x[2],P=x[3],O=Math.sin(T),j=Math.cos(T);_[0]=S*j+z*O,_[1]=C*j+P*O,_[2]=S*-O+z*j,_[3]=C*-O+P*j}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(o){const c=s.clamp(o,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==c&&(this._unmodified=!1,this._pitch=c,this._calcMatrices())}get aspect(){return this.width/this.height}get fov(){return this._fov/Math.PI*180}get fovX(){return this._fov}get fovY(){const o=1/Math.tan(.5*this.fovX);return 2*Math.atan(1/this.aspect/o)}set fov(o){o=Math.max(.01,Math.min(60,o)),this._fov!==o&&(this._unmodified=!1,this._fov=s.degToRad(o),this._calcMatrices())}get averageElevation(){return this._averageElevation}set averageElevation(o){this._averageElevation=o,this._calcFogMatrices(),this._distanceTileDataCache={}}get zoom(){return this._zoom}set zoom(o){const c=Math.min(Math.max(o,this.minZoom),this.maxZoom);this._zoom!==c&&(this._unmodified=!1,this._setZoom(c),this._updateSeaLevelZoom(),this._constrain(),this._calcMatrices())}_setZoom(o){this._zoom=o,this.scale=this.zoomScale(o),this.tileZoom=Math.floor(o),this.zoomFraction=o-this.tileZoom}_updateCameraOnTerrain(){if(!this._elevation||!this._elevation.isDataAvailableAtPoint(this.locationCoordinate(this.center)))return this._centerAltitude=0,this._seaLevelZoom=null,void(this._centerAltitudeValidForExaggeration=void 0);const o=this._elevation;this._centerAltitude=o.getAtPointOrZero(this.locationCoordinate(this.center)),this._centerAltitudeValidForExaggeration=o.exaggeration(),this._updateSeaLevelZoom()}_updateSeaLevelZoom(){this._centerAltitudeValidForExaggeration!==void 0&&(this._seaLevelZoom=this._zoomFromMercatorZ((this.pixelsPerMeter*this._centerAltitude+this.cameraToCenterDistance)/this.worldSize))}sampleAverageElevation(){if(!this._elevation)return 0;const o=this._elevation,c=[[.5,.2],[.3,.5],[.5,.5],[.7,.5],[.5,.8]],f=this.horizonLineFromTop();let _=0,x=0;for(let T=0;To.maxzoom&&(c=o.maxzoom);const T=this.locationCoordinate(this.center),S=this.center.lat,C=1<{const Xe=new s.MercatorCoordinate(Se.x+25e-6,Se.y,Se.z),$e=new s.MercatorCoordinate(Se.x,Se.y+25e-6,Se.z),Ye=Se.toLngLat(),gt=Xe.toLngLat(),Et=$e.toLngLat(),pt=this.locationCoordinate(Ye),wt=this.locationCoordinate(gt),Ut=this.locationCoordinate(Et),Ot=Math.hypot(wt.x-pt.x,wt.y-pt.y),mt=Math.hypot(Ut.x-pt.x,Ut.y-pt.y);return Math.sqrt(Ot*mt)*de/25e-6},pe=Se=>{const Be=Q,Xe=ee;return{aabb:s.tileAABB(this,C,0,0,0,Se,Xe,Be,this.projection),zoom:0,x:0,y:0,minZ:Xe,maxZ:Be,wrap:Se,fullyVisible:!1}},xe=[];let ye=[];const Ae=c,We=o.reparseOverscaled?f:c,Ee=Se=>Se*Se,Fe=Ee((Z-this._centerAltitude)*H),ke=Se=>{if(!this._elevation||!Se.tileID||!x)return;const Be=this._elevation.getMinMaxForTile(Se.tileID),Xe=Se.aabb;Be?(Xe.min[2]=Be.min,Xe.max[2]=Be.max,Xe.center[2]=(Xe.min[2]+Xe.max[2])/2):(Se.shouldSplit=qe(Se),Se.shouldSplit||(Xe.min[2]=Xe.max[2]=Xe.center[2]=this._centerAltitude))},qe=Se=>{if(Se.zoom=.9)return!0}else if(_&&($e=Ee(Se.aabb.distanceZ(X)*H)),this.projection.isReprojectedInTileSpace&&f<=5){const pt=Math.pow(2,Se.zoom),wt=fe(new s.MercatorCoordinate((Se.x+.5)/pt,(Se.y+.5)/pt));Ye=wt>.85?1:wt}const gt=Be*Be+Xe*Xe+$e,Et=Ee((1<{if(wt*Ee(.707)0;){const Se=xe.pop(),Be=Se.x,Xe=Se.y;let $e=Se.fullyVisible;if(!$e){const Ye=Se.aabb.intersects(j);if(Ye===0)continue;$e=Ye===2}if(Se.zoom!==Ae&&qe(Se))for(let Ye=0;Ye<4;Ye++){const gt=(Be<<1)+Ye%2,Et=(Xe<<1)+(Ye>>1),pt={aabb:x?Se.aabb.quadrant(Ye):s.tileAABB(this,C,Se.zoom+1,gt,Et,Se.wrap,Se.minZ,Se.maxZ,this.projection),zoom:Se.zoom+1,x:gt,y:Et,wrap:Se.wrap,fullyVisible:$e,tileID:void 0,shouldSplit:void 0,minZ:Se.minZ,maxZ:Se.maxZ};_&&!P&&(pt.tileID=new s.OverscaledTileID(Se.zoom+1===Ae?We:Se.zoom+1,Se.wrap,Se.zoom+1,gt,Et),ke(pt)),xe.push(pt)}else{const Ye=Se.zoom===Ae?We:Se.zoom;if(o.minzoom&&o.minzoom>Ye)continue;const gt=z[0]-(.5+Be+(Se.wrap<{const $e=[0,0,0,1],Ye=[s.EXTENT,s.EXTENT,0,1],gt=this.calculateFogTileMatrix(Xe.tileID.toUnwrapped());s.transformMat4$1($e,$e,gt),s.transformMat4$1(Ye,Ye,gt);const Et=s.getAABBPointSquareDist($e,Ye);if(Et===0)return!0;let pt=!1;const wt=this._elevation;if(wt&&Et>Se&&Be!==0){const Ut=this.calculateProjMatrix(Xe.tileID.toUnwrapped());let Ot;o.isTerrainDEM||(Ot=wt.getMinMaxForTile(Xe.tileID)),Ot||(Ot={min:ee,max:Q});const mt=s.furthestTileCorner(this.rotation),en=[mt[0]*s.EXTENT,mt[1]*s.EXTENT,Ot.max];s.transformMat4(en,en,Ut),pt=(1-en[1])*this.height*.5Se.distanceSq-Be.distanceSq).map(Se=>Se.tileID)}resize(o,c){this.width=o,this.height=c,this.pixelsToGLUnits=[2/o,-2/c],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(o){return Math.pow(2,o)}scaleZoom(o){return Math.log(o)/Math.LN2}project(o){const c=s.clamp(o.lat,-s.MAX_MERCATOR_LATITUDE,s.MAX_MERCATOR_LATITUDE),f=this.projection.project(o.lng,c);return new s.Point(f.x*this.worldSize,f.y*this.worldSize)}unproject(o){return this.projection.unproject(o.x/this.worldSize,o.y/this.worldSize)}get point(){return this.project(this.center)}get pointMerc(){return this.point._div(this.worldSize)}get pixelsPerMeterRatio(){return this.pixelsPerMeter/s.mercatorZfromAltitude(1,this.center.lat)/this.worldSize}setLocationAtPoint(o,c){let f,_;const x=this.centerPoint;if(this.projection.name==="globe"){const S=this.worldSize;f=(c.x-x.x)/S,_=(c.y-x.y)/S}else{const S=this.pointCoordinate(c),C=this.pointCoordinate(x);f=S.x-C.x,_=S.y-C.y}const T=this.locationCoordinate(o);this.setLocation(new s.MercatorCoordinate(T.x-f,T.y-_))}setLocation(o){this.center=this.coordinateLocation(o),this.projection.wrap&&(this.center=this.center.wrap())}locationPoint(o){return this.projection.locationPoint(this,o)}locationPoint3D(o){return this.projection.locationPoint(this,o,!0)}pointLocation(o){return this.coordinateLocation(this.pointCoordinate(o))}pointLocation3D(o){return this.coordinateLocation(this.pointCoordinate3D(o))}locationCoordinate(o,c){const f=c?s.mercatorZfromAltitude(c,o.lat):void 0,_=this.projection.project(o.lng,o.lat);return new s.MercatorCoordinate(_.x,_.y,f)}coordinateLocation(o){return this.projection.unproject(o.x,o.y)}pointRayIntersection(o,c){const f=c??this._centerAltitude,_=[o.x,o.y,0,1],x=[o.x,o.y,1,1];s.transformMat4$1(_,_,this.pixelMatrixInverse),s.transformMat4$1(x,x,this.pixelMatrixInverse);const T=x[3];s.scale$1(_,_,1/_[3]),s.scale$1(x,x,1/T);const S=_[2],C=x[2];return{p0:_,p1:x,t:S===C?0:(f-S)/(C-S)}}screenPointToMercatorRay(o){const c=[o.x,o.y,0,1],f=[o.x,o.y,1,1];return s.transformMat4$1(c,c,this.pixelMatrixInverse),s.transformMat4$1(f,f,this.pixelMatrixInverse),s.scale$1(c,c,1/c[3]),s.scale$1(f,f,1/f[3]),c[2]=s.mercatorZfromAltitude(c[2],this._center.lat)*this.worldSize,f[2]=s.mercatorZfromAltitude(f[2],this._center.lat)*this.worldSize,s.scale$1(c,c,1/this.worldSize),s.scale$1(f,f,1/this.worldSize),new s.Ray([c[0],c[1],c[2]],s.normalize([],s.sub([],f,c)))}rayIntersectionCoordinate(o){const{p0:c,p1:f,t:_}=o,x=s.mercatorZfromAltitude(c[2],this._center.lat),T=s.mercatorZfromAltitude(f[2],this._center.lat);return new s.MercatorCoordinate(s.number(c[0],f[0],_)/this.worldSize,s.number(c[1],f[1],_)/this.worldSize,s.number(x,T,_))}pointCoordinate(o,c=this._centerAltitude){return this.projection.pointCoordinate(this,o.x,o.y,c)}pointCoordinate3D(o){if(!this.elevation)return this.pointCoordinate(o);let c=this.projection.pointCoordinate3D(this,o.x,o.y);if(c)return new s.MercatorCoordinate(c[0],c[1],c[2]);let f=0,_=this.horizonLineFromTop();if(o.y>_)return this.pointCoordinate(o);const x=.02*_,T=o.clone();for(let S=0;S<10&&_-f>x;S++){T.y=s.number(f,_,.66);const C=this.projection.pointCoordinate3D(this,T.x,T.y);C?(_=T.y,c=C):f=T.y}return c?new s.MercatorCoordinate(c[0],c[1],c[2]):this.pointCoordinate(o)}isPointAboveHorizon(o){return this.projection.isPointAboveHorizon(this,o)}isPointOnSurface(o){if(o.y<0||o.y>this.height||o.x<0||o.x>this.width)return!1;if(this.elevation||this.zoom>=s.GLOBE_ZOOM_THRESHOLD_MAX)return!this.isPointAboveHorizon(o);const c=this.pointCoordinate(o);return c.y>=0&&c.y<=1}_coordinatePoint(o,c){const f=c&&this.elevation?this.elevation.getAtPointOrZero(o,this._centerAltitude):this._centerAltitude,_=[o.x*this.worldSize,o.y*this.worldSize,f+o.toAltitude(),1];return s.transformMat4$1(_,_,this.pixelMatrix),_[3]>0?new s.Point(_[0]/_[3],_[1]/_[3]):new s.Point(Number.MAX_VALUE,Number.MAX_VALUE)}_getBoundsNonRectangular(){const{top:o,left:c}=this._edgeInsets,f=this.height-this._edgeInsets.bottom,_=this.width-this._edgeInsets.right,x=this.pointLocation3D(new s.Point(c,o)),T=this.pointLocation3D(new s.Point(_,o)),S=this.pointLocation3D(new s.Point(_,f)),C=this.pointLocation3D(new s.Point(c,f));let z=Math.min(x.lng,T.lng,S.lng,C.lng),P=Math.max(x.lng,T.lng,S.lng,C.lng),O=Math.min(x.lat,T.lat,S.lat,C.lat),j=Math.max(x.lat,T.lat,S.lat,C.lat);const W=Math.pow(2,-this.zoom)/16*270,H=this.projection.name==="globe"?1:4,Z=(X,B,q,Q,ee)=>{const de=(X+q)/2,fe=(B+Q)/2,pe=new s.Point(de,fe),{lng:xe,lat:ye}=this.pointLocation3D(pe),Ae=Math.max(0,z-xe,O-ye,xe-P,ye-j);z=Math.min(z,xe),P=Math.max(P,xe),O=Math.min(O,ye),j=Math.max(j,ye),(eeW)&&(Z(X,B,de,fe,ee+1),Z(de,fe,q,Q,ee+1))};if(Z(c,o,_,o,1),Z(_,o,_,f,1),Z(_,f,c,f,1),Z(c,f,c,o,1),this.projection.name==="globe"){const[X,B]=s.polesInViewport(this);X?(j=90,P=180,z=-180):B&&(O=-90,P=180,z=-180)}return new s.LngLatBounds(new s.LngLat(z,O),new s.LngLat(P,j))}_getBoundsRectangular(o,c){const{top:f,left:_}=this._edgeInsets,x=this.height-this._edgeInsets.bottom,T=this.width-this._edgeInsets.right,S=new s.Point(_,f),C=new s.Point(T,f),z=new s.Point(T,x),P=new s.Point(_,x);let O=this.pointCoordinate(S,o),j=this.pointCoordinate(C,o);const W=this.pointCoordinate(z,c),H=this.pointCoordinate(P,c),Z=(X,B)=>(B.y-X.y)/(B.x-X.x);return O.y>1&&j.y>=0?O=new s.MercatorCoordinate((1-H.y)/Z(H,O)+H.x,1):O.y<0&&j.y<=1&&(O=new s.MercatorCoordinate(-H.y/Z(H,O)+H.x,0)),j.y>1&&O.y>=0?j=new s.MercatorCoordinate((1-W.y)/Z(W,j)+W.x,1):j.y<0&&O.y<=1&&(j=new s.MercatorCoordinate(-W.y/Z(W,j)+W.x,0)),new s.LngLatBounds().extend(this.coordinateLocation(O)).extend(this.coordinateLocation(j)).extend(this.coordinateLocation(H)).extend(this.coordinateLocation(W))}_getBoundsRectangularTerrain(){const o=this.elevation;if(!o.visibleDemTiles.length||o.isUsingMockSource())return this._getBoundsRectangular(0,0);const c=o.visibleDemTiles.reduce((f,_)=>{if(_.dem){const x=_.dem.tree;f.min=Math.min(f.min,x.minimums[0]),f.max=Math.max(f.max,x.maximums[0])}return f},{min:Number.MAX_VALUE,max:0});return this._getBoundsRectangular(c.min*o.exaggeration(),c.max*o.exaggeration())}getBounds(){return this.projection.name==="mercator"||this.projection.name==="equirectangular"?this._terrainEnabled()?this._getBoundsRectangularTerrain():this._getBoundsRectangular(0,0):this._getBoundsNonRectangular()}horizonLineFromTop(o=!0){const c=this.height/2/Math.tan(this._fov/2)/Math.tan(Math.max(this._pitch,.1))+this.centerOffset.y,f=this.height/2-c*(1-this._horizonShift);return o?Math.max(0,f):f}getMaxBounds(){return this.maxBounds}setMaxBounds(o){this.maxBounds=o,this.minLat=-s.MAX_MERCATOR_LATITUDE,this.maxLat=s.MAX_MERCATOR_LATITUDE,this.minLng=-180,this.maxLng=180,o&&(this.minLat=o.getSouth(),this.maxLat=o.getNorth(),this.minLng=o.getWest(),this.maxLng=o.getEast(),this.maxLngO&&(S=O-z),O-PW&&(T=W-C),W-j.5?Q-1:Q,ee>.5?ee-1:ee,0]),this.alignedProjMatrix=de,S=s.create(),s.scale(S,S,[this.width/2,-this.height/2,1]),s.translate(S,S,[1,-1,0]),this.labelPlaneMatrix=S,S=s.create(),s.scale(S,S,[1,-1,1]),s.translate(S,S,[-1,-1,0]),s.scale(S,S,[2/this.width,2/this.height,1]),this.glCoordMatrix=S,this.pixelMatrix=s.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),this._calcFogMatrices(),this._distanceTileDataCache={},S=s.invert(new Float64Array(16),this.pixelMatrix),!S)throw new Error("failed to invert matrix");if(this.pixelMatrixInverse=S,this.projection.name==="globe"||this.mercatorFromTransition){this.globeMatrix=s.calculateGlobeMatrix(this);const fe=[this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]];this.globeCenterInViewSpace=s.transformMat4(fe,fe,x),this.globeRadius=this.worldSize/2/Math.PI-1}else this.globeMatrix=S;this._projMatrixCache={},this._alignedProjMatrixCache={},this._pixelsToTileUnitsCache={}}_calcFogMatrices(){this._fogTileMatrixCache={};const o=this.cameraWorldSizeForFog,c=this.cameraPixelsPerMeter,f=this._camera.position,_=1/this.height/this._pixelsPerMercatorPixel,x=[o,o,c];s.scale$2(x,x,_),s.scale$2(f,f,-1),s.multiply$2(f,f,x);const T=s.create();s.translate(T,T,f),s.scale(T,T,x),this.mercatorFogMatrix=T,this.worldToFogMatrix=this._camera.getWorldToCameraPosition(o,c,_)}_computeCameraPosition(o){const c=(o=o||this.pixelsPerMeter)/this.pixelsPerMeter,f=this._camera.forward(),_=this.point,x=this._mercatorZfromZoom(this._seaLevelZoom?this._seaLevelZoom:this._zoom)*c-o/this.worldSize*this._centerAltitude;return[_.x/this.worldSize-f[0]*x,_.y/this.worldSize-f[1]*x,o/this.worldSize*this._centerAltitude-f[2]*x]}_updateCameraState(){this.height&&(this._camera.setPitchBearing(this._pitch,this.angle),this._camera.position=this._computeCameraPosition())}_translateCameraConstrained(o){const c=this._maxCameraBoundsDistance()*Math.cos(this._pitch),f=this._camera.position[2],_=o[2];let x=1;this.projection.wrap&&(this.center=this.center.wrap()),_>0&&(x=Math.min((c-f)/_,1)),this._camera.position=s.scaleAndAdd([],this._camera.position,o,x),this._updateStateFromCamera()}_updateStateFromCamera(){const o=this._camera.position,c=this._camera.forward(),{pitch:f,bearing:_}=this._camera.getPitchBearing(),x=s.mercatorZfromAltitude(this._centerAltitude,this.center.lat)*this._pixelsPerMercatorPixel,T=this._mercatorZfromZoom(this._maxZoom)*Math.cos(s.degToRad(this._maxPitch)),S=Math.max((o[2]-x)/Math.cos(f),T),C=this._zoomFromMercatorZ(S);s.scaleAndAdd(o,o,c,S),this._pitch=s.clamp(f,s.degToRad(this.minPitch),s.degToRad(this.maxPitch)),this.angle=s.wrap(_,-Math.PI,Math.PI),this._setZoom(s.clamp(C,this._minZoom,this._maxZoom)),this._updateSeaLevelZoom(),this._center=this.coordinateLocation(new s.MercatorCoordinate(o[0],o[1],o[2])),this._unmodified=!1,this._constrain(),this._calcMatrices()}_worldSizeFromZoom(o){return Math.pow(2,o)*this.tileSize}_mercatorZfromZoom(o){return this.cameraToCenterDistance/this._worldSizeFromZoom(o)}_minimumHeightOverTerrain(){const o=Math.min((this._seaLevelZoom!=null?this._seaLevelZoom:this._zoom)+4,this._maxZoom);return this._mercatorZfromZoom(o)}_zoomFromMercatorZ(o){return this.scaleZoom(this.cameraToCenterDistance/(o*this.tileSize))}zoomFromMercatorZAdjusted(o){let c=0,f=s.GLOBE_ZOOM_THRESHOLD_MAX,_=0,x=1/0;for(;f-c>1e-6&&f>c;){const T=c+.5*(f-c),S=this.tileSize*Math.pow(2,T),C=this.getCameraToCenterDistance(this.projection,T,S),z=this.scaleZoom(C/(o*this.tileSize)),P=Math.abs(T-z);Pz||j.y>1)return!0}return!1}isHorizonVisible(){return this.pitch+s.radToDeg(this.fovAboveCenter)>88||this.anyCornerOffEdge(new s.Point(0,0),new s.Point(this.width,this.height))}zoomDeltaToMovement(o,c){const f=s.length(s.sub([],this._camera.position,o)),_=this._zoomFromMercatorZ(f)+c;return f-this._mercatorZfromZoom(_)}getCameraPoint(){if(this.projection.name==="globe"){const o=function([c,f,_],x){const T=[c,f,_,1];s.transformMat4$1(T,T,x);const S=T[3]=Math.max(T[3],1e-6);return T[0]/=S,T[1]/=S,T[2]/=S,T}([this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]],this.pixelMatrix);return new s.Point(o[0],o[1])}{const o=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new s.Point(0,o))}}getCameraToCenterDistance(o,c=this.zoom,f=this.worldSize){const _=Zc(o,c,this.width,this.height,1024),x=o.pixelSpaceConversion(this.center.lat,f,_);return .5/Math.tan(.5*this._fov)*this.height*x}getWorldToCameraMatrix(){const o=this._camera.getWorldToCamera(this.worldSize,this.projection.zAxisUnit==="meters"?this.pixelsPerMeter:1);return this.projection.name==="globe"&&s.multiply(o,o,this.globeMatrix),o}}function Sa(d,o){let c=!1,f=null;const _=()=>{f=null,c&&(d(),f=setTimeout(_,o),c=!1)};return()=>(c=!0,f||_(),f)}class ed{constructor(o){this._hashName=o&&encodeURIComponent(o),s.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=Sa(this._updateHashUnthrottled.bind(this),300)}addTo(o){return this._map=o,s.window.addEventListener("hashchange",this._onHashChange,!1),o.on("moveend",this._updateHash),this}remove(){return this._map?(this._map.off("moveend",this._updateHash),s.window.removeEventListener("hashchange",this._onHashChange,!1),clearTimeout(this._updateHash()),this._map=void 0,this):this}getHashString(){const o=this._map;if(!o)return"";const c=Bl(o);if(this._hashName){const f=this._hashName;let _=!1;const x=s.window.location.hash.slice(1).split("&").map(T=>{const S=T.split("=")[0];return S===f?(_=!0,`${S}=${c}`):T}).filter(T=>T);return _||x.push(`${f}=${c}`),`#${x.join("&")}`}return`#${c}`}_getCurrentHash(){const o=s.window.location.hash.replace("#","");if(this._hashName){let c;return o.split("&").map(f=>f.split("=")).forEach(f=>{f[0]===this._hashName&&(c=f)}),(c&&c[1]||"").split("/")}return o.split("/")}_onHashChange(){const o=this._map;if(!o)return!1;const c=this._getCurrentHash();if(c.length>=3&&!c.some(f=>isNaN(f))){const f=o.dragRotate.isEnabled()&&o.touchZoomRotate.isEnabled()?+(c[3]||0):o.getBearing();return o.jumpTo({center:[+c[2],+c[1]],zoom:+c[0],bearing:f,pitch:+(c[4]||0)}),!0}return!1}_updateHashUnthrottled(){const o=s.window.location.href.replace(/(#.+)?$/,this.getHashString());s.window.history.replaceState(s.window.history.state,null,o)}}function Bl(d,o){const c=d.getCenter(),f=Math.round(100*d.getZoom())/100,_=Math.ceil((f*Math.LN2+Math.log(512/360/.5))/Math.LN10),x=Math.pow(10,_),T=Math.round(c.lng*x)/x,S=Math.round(c.lat*x)/x,C=d.getBearing(),z=d.getPitch();let P=o?`/${T}/${S}/${f}`:`${f}/${S}/${T}`;return(C||z)&&(P+="/"+Math.round(10*C)/10),z&&(P+=`/${Math.round(z)}`),P}const Fl={linearity:.3,easing:s.bezier(0,0,.3,1)},Xc=s.extend({deceleration:2500,maxSpeed:1400},Fl),Kc=s.extend({deceleration:20,maxSpeed:1400},Fl),ct=s.extend({deceleration:1e3,maxSpeed:360},Fl),Di=s.extend({deceleration:1e3,maxSpeed:90},Fl);class Rf{constructor(o){this._map=o,this.clear()}clear(){this._inertiaBuffer=[]}record(o){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:s.exported.now(),settings:o})}_drainInertiaBuffer(){const o=this._inertiaBuffer,c=s.exported.now();for(;o.length>0&&c-o[0].time>160;)o.shift()}_onMoveEnd(o){if(this._map._prefersReducedMotion()||(this._drainInertiaBuffer(),this._inertiaBuffer.length<2))return;const c={zoom:0,bearing:0,pitch:0,pan:new s.Point(0,0),pinchAround:void 0,around:void 0};for(const{settings:x}of this._inertiaBuffer)c.zoom+=x.zoomDelta||0,c.bearing+=x.bearingDelta||0,c.pitch+=x.pitchDelta||0,x.panDelta&&c.pan._add(x.panDelta),x.around&&(c.around=x.around),x.pinchAround&&(c.pinchAround=x.pinchAround);const f=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,_={};if(c.pan.mag()){const x=Ul(c.pan.mag(),f,s.extend({},Xc,o||{}));_.offset=c.pan.mult(x.amount/c.pan.mag()),_.center=this._map.transform.center,Nl(_,x)}if(c.zoom){const x=Ul(c.zoom,f,Kc);_.zoom=this._map.transform.zoom+x.amount,Nl(_,x)}if(c.bearing){const x=Ul(c.bearing,f,ct);_.bearing=this._map.transform.bearing+s.clamp(x.amount,-179,179),Nl(_,x)}if(c.pitch){const x=Ul(c.pitch,f,Di);_.pitch=this._map.transform.pitch+x.amount,Nl(_,x)}if(_.zoom||_.bearing){const x=c.pinchAround===void 0?c.around:c.pinchAround;_.around=x?this._map.unproject(x):this._map.getCenter()}return this.clear(),_.noMoveStart=!0,_}}function Nl(d,o){(!d.duration||d.durationc.unproject(C)),S=x.reduce((C,z,P,O)=>C.add(z.div(O.length)),new s.Point(0,0));super(o,{points:x,point:S,lngLats:T,lngLat:c.unproject(S),originalEvent:f}),this._defaultPrevented=!1}}class Yc extends s.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(o,c,f){super(o,{originalEvent:f}),this._defaultPrevented=!1}}class td{constructor(o,c){this._map=o,this._clickTolerance=c.clickTolerance}reset(){this._mousedownPos=void 0}wheel(o){return this._firePreventable(new Yc(o.type,this._map,o))}mousedown(o,c){return this._mousedownPos=c,this._firePreventable(new pr(o.type,this._map,o))}mouseup(o){this._map.fire(new pr(o.type,this._map,o))}preclick(o){const c=s.extend({},o);c.type="preclick",this._map.fire(new pr(c.type,this._map,c))}click(o,c){this._mousedownPos&&this._mousedownPos.dist(c)>=this._clickTolerance||(this.preclick(o),this._map.fire(new pr(o.type,this._map,o)))}dblclick(o){return this._firePreventable(new pr(o.type,this._map,o))}mouseover(o){this._map.fire(new pr(o.type,this._map,o))}mouseout(o){this._map.fire(new pr(o.type,this._map,o))}touchstart(o){return this._firePreventable(new jl(o.type,this._map,o))}touchmove(o){this._map.fire(new jl(o.type,this._map,o))}touchend(o){this._map.fire(new jl(o.type,this._map,o))}touchcancel(o){this._map.fire(new jl(o.type,this._map,o))}_firePreventable(o){if(this._map.fire(o),o.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Jc{constructor(o){this._map=o}reset(){this._delayContextMenu=!1,this._contextMenuEvent=void 0}mousemove(o){this._map.fire(new pr(o.type,this._map,o))}mousedown(){this._delayContextMenu=!0}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new pr("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(o){this._delayContextMenu?this._contextMenuEvent=o:this._map.fire(new pr(o.type,this._map,o)),this._map.listens("contextmenu")&&o.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Df{constructor(o,c){this._map=o,this._el=o.getCanvasContainer(),this._container=o.getContainer(),this._clickTolerance=c.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(o,c){this.isEnabled()&&o.shiftKey&&o.button===0&&(ie(),this._startPos=this._lastPos=c,this._active=!0)}mousemoveWindow(o,c){if(!this._active)return;const f=c,_=this._startPos,x=this._lastPos;if(!_||!x||x.equals(f)||!this._box&&f.dist(_){this._box&&(this._box.style.transform=`translate(${T}px,${C}px)`,this._box.style.width=S-T+"px",this._box.style.height=z-C+"px")})}mouseupWindow(o,c){if(!this._active)return;const f=this._startPos,_=c;if(f&&o.button===0){if(this.reset(),ze(),f.x!==_.x||f.y!==_.y)return this._map.fire(new s.Event("boxzoomend",{originalEvent:o})),{cameraAnimation:x=>x.fitScreenCoordinates(f,_,this._map.getBearing(),{linear:!1})};this._fireEvent("boxzoomcancel",o)}}keydown(o){this._active&&o.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",o))}blur(){this.reset()}reset(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.remove(),this._box=null),te(),delete this._startPos,delete this._lastPos}_fireEvent(o,c){return this._map.fire(new s.Event(o,{originalEvent:c}))}}function Qc(d,o){const c={};for(let f=0;fthis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===0&&(this.startTime=o.timeStamp),f.length===this.numTouches&&(this.centroid=function(_){const x=new s.Point(0,0);for(const T of _)x._add(T);return x.div(_.length)}(c),this.touches=Qc(f,c)))}touchmove(o,c,f){if(this.aborted||!this.centroid)return;const _=Qc(f,c);for(const x in this.touches){const T=_[x];(!T||T.dist(this.touches[x])>30)&&(this.aborted=!0)}}touchend(o,c,f){if((!this.centroid||o.timeStamp-this.startTime>500)&&(this.aborted=!0),f.length===0){const _=!this.aborted&&this.centroid;if(this.reset(),_)return _}}}class nd{constructor(o){this.singleTap=new Aa(o),this.numTaps=o.numTaps,this.reset()}reset(){this.lastTime=1/0,this.lastTap=void 0,this.count=0,this.singleTap.reset()}touchstart(o,c,f){this.singleTap.touchstart(o,c,f)}touchmove(o,c,f){this.singleTap.touchmove(o,c,f)}touchend(o,c,f){const _=this.singleTap.touchend(o,c,f);if(_){const x=o.timeStamp-this.lastTime<500,T=!this.lastTap||this.lastTap.dist(_)<30;if(x&&T||this.reset(),this.count++,this.lastTime=o.timeStamp,this.lastTap=_,this.count===this.numTaps)return this.reset(),_}}}class iy{constructor(){this._zoomIn=new nd({numTouches:1,numTaps:2}),this._zoomOut=new nd({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(o,c,f){this._zoomIn.touchstart(o,c,f),this._zoomOut.touchstart(o,c,f)}touchmove(o,c,f){this._zoomIn.touchmove(o,c,f),this._zoomOut.touchmove(o,c,f)}touchend(o,c,f){const _=this._zoomIn.touchend(o,c,f),x=this._zoomOut.touchend(o,c,f);return _?(this._active=!0,o.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:T=>T.easeTo({duration:300,zoom:T.getZoom()+1,around:T.unproject(_)},{originalEvent:o})}):x?(this._active=!0,o.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:T=>T.easeTo({duration:300,zoom:T.getZoom()-1,around:T.unproject(x)},{originalEvent:o})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}const Of={0:1,2:2};class Ca{constructor(o){this.reset(),this._clickTolerance=o.clickTolerance||1}blur(){this.reset()}reset(){this._active=!1,this._moved=!1,this._lastPoint=void 0,this._eventButton=void 0}_correctButton(o,c){return!1}_move(o,c){return{}}mousedown(o,c){if(this._lastPoint)return;const f=He(o);this._correctButton(o,f)&&(this._lastPoint=c,this._eventButton=f)}mousemoveWindow(o,c){const f=this._lastPoint;if(f){if(o.preventDefault(),this._eventButton!=null&&function(_,x){const T=Of[x];return _.buttons===void 0||(_.buttons&T)!==T}(o,this._eventButton))this.reset();else if(this._moved||!(c.dist(f)0&&(this._active=!0);const _=Qc(f,c),x=new s.Point(0,0),T=new s.Point(0,0);let S=0;for(const z in _){const P=_[z],O=this._touches[z];O&&(x._add(P),T._add(P.sub(O)),S++,_[z]=P)}if(this._touches=_,S{this._alertContainer.classList.remove("mapboxgl-touch-pan-blocker-show"),this._alertContainer.setAttribute("role","null")},500)}}class Vl{constructor(){this.reset()}reset(){this._active=!1,this._firstTwoTouches=void 0}_start(o){}_move(o,c,f){return{}}touchstart(o,c,f){this._firstTwoTouches||f.length<2||(this._firstTwoTouches=[f[0].identifier,f[1].identifier],this._start([c[0],c[1]]))}touchmove(o,c,f){const _=this._firstTwoTouches;if(!_)return;o.preventDefault();const[x,T]=_,S=$l(f,c,x),C=$l(f,c,T);if(!S||!C)return;const z=this._aroundCenter?null:S.add(C).div(2);return this._move([S,C],z,o)}touchend(o,c,f){if(!this._firstTwoTouches)return;const[_,x]=this._firstTwoTouches,T=$l(f,c,_),S=$l(f,c,x);T&&S||(this._active&&ze(),this.reset())}touchcancel(){this.reset()}enable(o){this._enabled=!0,this._aroundCenter=!!o&&o.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function $l(d,o,c){for(let f=0;fMath.abs(d.x)}class Nf extends Vl{constructor(o){super(),this._map=o}reset(){super.reset(),this._valid=void 0,this._firstMove=void 0,this._lastPoints=void 0}_start(o){this._lastPoints=o,rs(o[0].sub(o[1]))&&(this._valid=!1)}_move(o,c,f){const _=this._lastPoints;if(!_)return;const x=o[0].sub(_[0]),T=o[1].sub(_[1]);return this._map._cooperativeGestures&&!s.isFullscreen()&&f.touches.length<3||(this._valid=this.gestureBeginsVertically(x,T,f.timeStamp),!this._valid)?void 0:(this._lastPoints=o,this._active=!0,{pitchDelta:(x.y+T.y)/2*-.5})}gestureBeginsVertically(o,c,f){if(this._valid!==void 0)return this._valid;const _=o.mag()>=2,x=c.mag()>=2;if(!_&&!x)return;if(!_||!x)return this._firstMove==null&&(this._firstMove=f),f-this._firstMove<100&&void 0;const T=o.y>0==c.y>0;return rs(o)&&rs(c)&&T}}const Uf={panStep:100,bearingStep:15,pitchStep:10};class oy{constructor(){const o=Uf;this._panStep=o.panStep,this._bearingStep=o.bearingStep,this._pitchStep=o.pitchStep,this._rotationDisabled=!1}blur(){this.reset()}reset(){this._active=!1}keydown(o){if(o.altKey||o.ctrlKey||o.metaKey)return;let c=0,f=0,_=0,x=0,T=0;switch(o.keyCode){case 61:case 107:case 171:case 187:c=1;break;case 189:case 109:case 173:c=-1;break;case 37:o.shiftKey?f=-1:(o.preventDefault(),x=-1);break;case 39:o.shiftKey?f=1:(o.preventDefault(),x=1);break;case 38:o.shiftKey?_=1:(o.preventDefault(),T=-1);break;case 40:o.shiftKey?_=-1:(o.preventDefault(),T=1);break;default:return}return this._rotationDisabled&&(f=0,_=0),{cameraAnimation:S=>{const C=S.getZoom();S.easeTo({duration:300,easeId:"keyboardHandler",easing:jf,zoom:c?Math.round(C)+c*(o.shiftKey?2:1):C,bearing:S.getBearing()+f*this._bearingStep,pitch:S.getPitch()+_*this._pitchStep,offset:[-x*this._panStep,-T*this._panStep],center:S.getCenter()},{originalEvent:o})}}}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 jf(d){return d*(2-d)}const ld=4.000244140625;class Vf{constructor(o,c){this._map=o,this._el=o.getCanvasContainer(),this._handler=c,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,s.bindAll(["_onTimeout","_addScrollZoomBlocker","_showBlockerAlert"],this)}setZoomRate(o){this._defaultZoomRate=o}setWheelZoomRate(o){this._wheelZoomRate=o}isEnabled(){return!!this._enabled}isActive(){return this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(o){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!o&&o.around==="center",this._map._cooperativeGestures&&this._addScrollZoomBlocker())}disable(){this.isEnabled()&&(this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove()))}wheel(o){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!(o.ctrlKey||o.metaKey||this.isZooming()||s.isFullscreen()))return void this._showBlockerAlert();this._alertContainer.style.visibility!=="hidden"&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}let c=o.deltaMode===s.window.WheelEvent.DOM_DELTA_LINE?40*o.deltaY:o.deltaY;const f=s.exported.now(),_=f-(this._lastWheelEventTime||0);this._lastWheelEventTime=f,c!==0&&c%ld==0?this._type="wheel":c!==0&&Math.abs(c)<4?this._type="trackpad":_>400?(this._type=null,this._lastValue=c,this._timeout=setTimeout(this._onTimeout,40,o)):this._type||(this._type=Math.abs(_*c)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,c+=this._lastValue)),o.shiftKey&&c&&(c/=4),this._type&&(this._lastWheelEvent=o,this._delta-=c,this._active||this._start(o)),o.preventDefault()}_onTimeout(o){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(o)}_start(o){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 c=Oe(this._el,o);this._aroundPoint=this._aroundCenter?this._map.transform.centerPoint:c,this._aroundCoord=this._map.transform.pointCoordinate3D(this._aroundPoint),this._targetZoom=void 0,this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const o=this._map.transform;this._type==="wheel"&&o.projection.wrap&&(o._center.lng>=180||o._center.lng<=-180)&&(this._prevEase=null,this._easing=null,this._lastWheelEvent=null,this._lastWheelEventTime=0);const c=()=>o._terrainEnabled()&&this._aroundCoord?o.computeZoomRelativeTo(this._aroundCoord):o.zoom;if(this._delta!==0){const C=this._type==="wheel"&&Math.abs(this._delta)>ld?this._wheelZoomRate:this._defaultZoomRate;let z=2/(1+Math.exp(-Math.abs(this._delta*C)));this._delta<0&&z!==0&&(z=1/z);const P=c(),O=Math.pow(2,P),j=typeof this._targetZoom=="number"?o.zoomScale(this._targetZoom):O;this._targetZoom=Math.min(o.maxZoom,Math.max(o.minZoom,o.scaleZoom(j*z))),this._type==="wheel"&&(this._startZoom=P,this._easing=this._smoothOutEasing(200)),this._delta=0}const f=typeof this._targetZoom=="number"?this._targetZoom:c(),_=this._startZoom,x=this._easing;let T,S=!1;if(this._type==="wheel"&&_&&x){const C=Math.min((s.exported.now()-this._lastWheelEventTime)/200,1),z=x(C);T=s.number(_,f,z),C<1?this._frameId||(this._frameId=!0):S=!0}else T=f,S=!0;return this._active=!0,S&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!S,zoomDelta:T-c(),around:this._aroundPoint,aroundCoord:this._aroundCoord,originalEvent:this._lastWheelEvent}}_smoothOutEasing(o){let c=s.ease;if(this._prevEase){const f=this._prevEase,_=(s.exported.now()-f.start)/f.duration,x=f.easing(_+.01)-f.easing(_),T=.27/Math.sqrt(x*x+1e-4)*.01,S=Math.sqrt(.0729-T*T);c=s.bezier(T,S,.25,1)}return this._prevEase={start:s.exported.now(),duration:o,easing:c},c}blur(){this.reset()}reset(){this._active=!1}_addScrollZoomBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=J("div","mapboxgl-scroll-zoom-blocker",this._map._container),this._alertContainer.textContent=/(Mac|iPad)/i.test(s.window.navigator.userAgent)?this._map._getUIString("ScrollZoomBlocker.CmdMessage"):this._map._getUIString("ScrollZoomBlocker.CtrlMessage"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=setTimeout(()=>{this._alertContainer.classList.remove("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","null")},200)}}class $f{constructor(o,c){this._clickZoom=o,this._tapZoom=c}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 kr{constructor(){this.reset()}reset(){this._active=!1}blur(){this.reset()}dblclick(o,c){return o.preventDefault(),{cameraAnimation:f=>{f.easeTo({duration:300,zoom:f.getZoom()+(o.shiftKey?-1:1),around:f.unproject(c)},{originalEvent:o})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class sy{constructor(){this._tap=new nd({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,this._swipePoint=void 0,this._swipeTouch=0,this._tapTime=0,this._tap.reset()}touchstart(o,c,f){this._swipePoint||(this._tapTime&&o.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?f.length>0&&(this._swipePoint=c[0],this._swipeTouch=f[0].identifier):this._tap.touchstart(o,c,f))}touchmove(o,c,f){if(this._tapTime){if(this._swipePoint){if(f[0].identifier!==this._swipeTouch)return;const _=c[0],x=_.y-this._swipePoint.y;return this._swipePoint=_,o.preventDefault(),this._active=!0,{zoomDelta:x/128}}}else this._tap.touchmove(o,c,f)}touchend(o,c,f){this._tapTime?this._swipePoint&&f.length===0&&this.reset():this._tap.touchend(o,c,f)&&(this._tapTime=o.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Gf{constructor(o,c,f){this._el=o,this._mousePan=c,this._touchPan=f}enable(o){this._inertiaOptions=o||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class ay{constructor(o,c,f){this._pitchWithRotate=o.pitchWithRotate,this._mouseRotate=c,this._mousePitch=f}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 ly{constructor(o,c,f,_){this._el=o,this._touchZoom=c,this._touchRotate=f,this._tapDragZoom=_,this._rotationDisabled=!1,this._enabled=!0}enable(o){this._touchZoom.enable(o),this._rotationDisabled||this._touchRotate.enable(o),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-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()}}const yi=d=>d.zoom||d.drag||d.pitch||d.rotate;class qf extends s.Event{}class cy{constructor(){this.constants=[1,1,.01],this.radius=0}setup(o,c){const f=s.sub([],c,o);this.radius=s.length(f[2]<0?s.div([],f,this.constants):[f[0],f[1],0])}projectRay(o){s.div(o,o,this.constants),s.normalize(o,o),s.mul$1(o,o,this.constants);const c=s.scale$2([],o,this.radius);if(c[2]>0){const f=s.scale$2([],[0,0,1],s.dot(c,[0,0,1])),_=s.scale$2([],s.normalize([],[c[0],c[1],0]),this.radius),x=s.add([],c,s.scale$2([],s.sub([],s.add([],_,f),c),2));c[0]=x[0],c[1]=x[1]}return c}}function Oi(d){return d.panDelta&&d.panDelta.mag()||d.zoomDelta||d.bearingDelta||d.pitchDelta}class ro{constructor(o,c){this._map=o,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Rf(o),this._bearingSnap=c.bearingSnap,this._previousActiveHandlers={},this._trackingEllipsoid=new cy,this._dragOrigin=null,this._eventsInProgress={},this._addDefaultHandlers(c),s.bindAll(["handleEvent","handleWindowEvent"],this);const f=this._el;this._listeners=[[f,"touchstart",{passive:!0}],[f,"touchmove",{passive:!1}],[f,"touchend",void 0],[f,"touchcancel",void 0],[f,"mousedown",void 0],[f,"mousemove",void 0],[f,"mouseup",void 0],[s.window.document,"mousemove",{capture:!0}],[s.window.document,"mouseup",void 0],[f,"mouseover",void 0],[f,"mouseout",void 0],[f,"dblclick",void 0],[f,"click",void 0],[f,"keydown",{capture:!1}],[f,"keyup",void 0],[f,"wheel",{passive:!1}],[f,"contextmenu",void 0],[s.window,"blur",void 0]];for(const[_,x,T]of this._listeners)_.addEventListener(x,_===s.window.document?this.handleWindowEvent:this.handleEvent,T)}destroy(){for(const[o,c,f]of this._listeners)o.removeEventListener(c,o===s.window.document?this.handleWindowEvent:this.handleEvent,f)}_addDefaultHandlers(o){const c=this._map,f=c.getCanvasContainer();this._add("mapEvent",new td(c,o));const _=c.boxZoom=new Df(c,o);this._add("boxZoom",_);const x=new iy,T=new kr;c.doubleClickZoom=new $f(T,x),this._add("tapZoom",x),this._add("clickZoom",T);const S=new sy;this._add("tapDragZoom",S);const C=c.touchPitch=new Nf(c);this._add("touchPitch",C);const z=new id(o),P=new od(o);c.dragRotate=new ay(o,z,P),this._add("mouseRotate",z,["mousePitch"]),this._add("mousePitch",P,["mouseRotate"]);const O=new rd(o),j=new eu(c,o);c.dragPan=new Gf(f,O,j),this._add("mousePan",O),this._add("touchPan",j,["touchZoom","touchRotate"]);const W=new Ff,H=new Bf;c.touchZoomRotate=new ly(f,H,W,S),this._add("touchRotate",W,["touchPan","touchZoom"]),this._add("touchZoom",H,["touchPan","touchRotate"]),this._add("blockableMapEvent",new Jc(c));const Z=c.scrollZoom=new Vf(c,this);this._add("scrollZoom",Z,["mousePan"]);const X=c.keyboard=new oy;this._add("keyboard",X);for(const B of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])o.interactive&&o[B]&&c[B].enable(o[B])}_add(o,c,f){this._handlers.push({handlerName:o,handler:c,allowed:f}),this._handlersById[o]=c}stop(o){if(!this._updatingCamera){for(const{handler:c}of this._handlers)c.reset();this._inertia.clear(),this._fireEvents({},{},o),this._changes=[]}}isActive(){for(const{handler:o}of this._handlers)if(o.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!yi(this._eventsInProgress)||this.isZooming()}_isDragging(){return!!this._eventsInProgress.drag}_blockedByActive(o,c,f){for(const _ in o)if(_!==f&&(!c||c.indexOf(_)<0))return!0;return!1}handleWindowEvent(o){this.handleEvent(o,`${o.type}Window`)}_getMapTouches(o){const c=[];for(const f of o)this._el.contains(f.target)&&c.push(f);return c}handleEvent(o,c){this._updatingCamera=!0;const f=o.type==="renderFrame",_=f?void 0:o,x={needsRenderFrame:!1},T={},S={},C=o.touches?this._getMapTouches(o.touches):void 0,z=C?Ke(this._el,C):f?void 0:Oe(this._el,o);for(const{handlerName:j,handler:W,allowed:H}of this._handlers){if(!W.isEnabled())continue;let Z;this._blockedByActive(S,H,j)?W.reset():W[c||o.type]&&(Z=W[c||o.type](o,z,C),this.mergeHandlerResult(x,T,Z,j,_),Z&&Z.needsRenderFrame&&this._triggerRenderFrame()),(Z||W.isActive())&&(S[j]=W)}const P={};for(const j in this._previousActiveHandlers)S[j]||(P[j]=_);this._previousActiveHandlers=S,(Object.keys(P).length||Oi(x))&&(this._changes.push([x,T,P]),this._triggerRenderFrame()),(Object.keys(S).length||Oi(x))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:O}=x;O&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],O(this._map))}mergeHandlerResult(o,c,f,_,x){if(!f)return;s.extend(o,f);const T={handlerName:_,originalEvent:f.originalEvent||x};f.zoomDelta!==void 0&&(c.zoom=T),f.panDelta!==void 0&&(c.drag=T),f.pitchDelta!==void 0&&(c.pitch=T),f.bearingDelta!==void 0&&(c.rotate=T)}_applyChanges(){const o={},c={},f={};for(const[_,x,T]of this._changes)_.panDelta&&(o.panDelta=(o.panDelta||new s.Point(0,0))._add(_.panDelta)),_.zoomDelta&&(o.zoomDelta=(o.zoomDelta||0)+_.zoomDelta),_.bearingDelta&&(o.bearingDelta=(o.bearingDelta||0)+_.bearingDelta),_.pitchDelta&&(o.pitchDelta=(o.pitchDelta||0)+_.pitchDelta),_.around!==void 0&&(o.around=_.around),_.aroundCoord!==void 0&&(o.aroundCoord=_.aroundCoord),_.pinchAround!==void 0&&(o.pinchAround=_.pinchAround),_.noInertia&&(o.noInertia=_.noInertia),s.extend(c,x),s.extend(f,T);this._updateMapTransform(o,c,f),this._changes=[]}_updateMapTransform(o,c,f){const _=this._map,x=_.transform,T=q=>[q.x,q.y,q.z];if((q=>{const Q=this._eventsInProgress.drag;return Q&&!this._handlersById[Q.handlerName].isActive()})()&&!Oi(o)){const q=x.zoom;x.cameraElevationReference="sea",x.recenterOnTerrain(),x.cameraElevationReference="ground",q!==x.zoom&&this._map._update(!0)}if(x._isCameraConstrained&&_._stop(!0),!Oi(o))return void this._fireEvents(c,f,!0);let{panDelta:S,zoomDelta:C,bearingDelta:z,pitchDelta:P,around:O,aroundCoord:j,pinchAround:W}=o;x._isCameraConstrained&&(C>0&&(C=0),x._isCameraConstrained=!1),W!==void 0&&(O=W),(C||(q=>c[q]&&!this._eventsInProgress[q])("drag"))&&O&&(this._dragOrigin=T(x.pointCoordinate3D(O)),this._trackingEllipsoid.setup(x._camera.position,this._dragOrigin)),x.cameraElevationReference="sea",_._stop(!0),O=O||_.transform.centerPoint,z&&(x.bearing+=z),P&&(x.pitch+=P),x._updateCameraState();const H=[0,0,0];if(S)if(x.projection.name==="mercator"){const q=this._trackingEllipsoid.projectRay(x.screenPointToMercatorRay(O).dir),Q=this._trackingEllipsoid.projectRay(x.screenPointToMercatorRay(O.sub(S)).dir);H[0]=Q[0]-q[0],H[1]=Q[1]-q[1]}else{const q=x.pointCoordinate(O);if(x.projection.name==="globe"){S=S.rotate(-x.angle);const Q=x._pixelsPerMercatorPixel/x.worldSize;H[0]=-S.x*s.mercatorScale(s.latFromMercatorY(q.y))*Q,H[1]=-S.y*s.mercatorScale(x.center.lat)*Q}else{const Q=x.pointCoordinate(O.sub(S));q&&Q&&(H[0]=Q.x-q.x,H[1]=Q.y-q.y)}}const Z=x.zoom,X=[0,0,0];if(C){const q=T(j||x.pointCoordinate3D(O)),Q={dir:s.normalize([],s.sub([],q,x._camera.position))};if(Q.dir[2]<0){const ee=x.zoomDeltaToMovement(q,C);s.scale$2(X,Q.dir,ee)}}const B=s.add(H,H,X);x._translateCameraConstrained(B),C&&Math.abs(x.zoom-Z)>1e-4&&x.recenterOnTerrain(),x.cameraElevationReference="ground",this._map._update(),o.noInertia||this._inertia.record(o),this._fireEvents(c,f,!0)}_fireEvents(o,c,f){const _=yi(this._eventsInProgress),x=yi(o),T={};for(const P in o){const{originalEvent:O}=o[P];this._eventsInProgress[P]||(T[`${P}start`]=O),this._eventsInProgress[P]=o[P]}!_&&x&&this._fireEvent("movestart",x.originalEvent);for(const P in T)this._fireEvent(P,T[P]);x&&this._fireEvent("move",x.originalEvent);for(const P in o){const{originalEvent:O}=o[P];this._fireEvent(P,O)}const S={};let C;for(const P in this._eventsInProgress){const{handlerName:O,originalEvent:j}=this._eventsInProgress[P];this._handlersById[O].isActive()||(delete this._eventsInProgress[P],C=c[O]||j,S[`${P}end`]=C)}for(const P in S)this._fireEvent(P,S[P]);const z=yi(this._eventsInProgress);if(f&&(_||x)&&!z){this._updatingCamera=!0;const P=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),O=j=>j!==0&&-this._bearingSnap{this._frameId=void 0,this.handleEvent(new qf("renderFrame",{timeStamp:o})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}const Ds="map.setFreeCameraOptions(...) and map.getFreeCameraOptions() are not yet supported for non-mercator projections.";class tu extends s.Evented{constructor(o,c){super(),this._moving=!1,this._zooming=!1,this.transform=o,this._bearingSnap=c.bearingSnap,this._respectPrefersReducedMotion=c.respectPrefersReducedMotion!==!1,s.bindAll(["_renderFrameCallback"],this)}getCenter(){return new s.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(o,c){return this.jumpTo({center:o},c)}panBy(o,c,f){return o=s.Point.convert(o).mult(-1),this.panTo(this.transform.center,s.extend({offset:o},c),f)}panTo(o,c,f){return this.easeTo(s.extend({center:o},c),f)}getZoom(){return this.transform.zoom}setZoom(o,c){return this.jumpTo({zoom:o},c),this}zoomTo(o,c,f){return this.easeTo(s.extend({zoom:o},c),f)}zoomIn(o,c){return this.zoomTo(this.getZoom()+1,o,c),this}zoomOut(o,c){return this.zoomTo(this.getZoom()-1,o,c),this}getBearing(){return this.transform.bearing}setBearing(o,c){return this.jumpTo({bearing:o},c),this}getPadding(){return this.transform.padding}setPadding(o,c){return this.jumpTo({padding:o},c),this}rotateTo(o,c,f){return this.easeTo(s.extend({bearing:o},c),f)}resetNorth(o,c){return this.rotateTo(0,s.extend({duration:1e3},o),c),this}resetNorthPitch(o,c){return this.easeTo(s.extend({bearing:0,pitch:0,duration:1e3},o),c),this}snapToNorth(o,c){return Math.abs(this.getBearing())o.aspect?f/(2*Math.tan(.5*o.fovX)*o.aspect):_/(2*Math.tan(.5*o.fovY)*o.aspect)}_cameraForBoundsOnGlobe(o,c,f,_,x,T){const S=o.clone(),C=this._extendCameraOptions(T);S.bearing=_,S.pitch=x;const z=s.LngLat.convert(c),P=s.LngLat.convert(f),O=.5*(z.lat+P.lat),j=.5*(z.lng+P.lng),W=s.latLngToECEF(O,j),H=s.normalize([],W),Z=s.normalize([],s.cross([],H,[0,1,0])),X=s.cross([],Z,H),B=[Z[0],Z[1],Z[2],0,X[0],X[1],X[2],0,H[0],H[1],H[2],0,0,0,0,1],q=[W,s.latLngToECEF(z.lat,z.lng),s.latLngToECEF(P.lat,z.lng),s.latLngToECEF(P.lat,P.lng),s.latLngToECEF(z.lat,P.lng),s.latLngToECEF(O,z.lng),s.latLngToECEF(O,P.lng),s.latLngToECEF(z.lat,j),s.latLngToECEF(P.lat,j)];let Q=s.Aabb.fromPoints(q.map($e=>[s.dot(Z,$e),s.dot(X,$e),s.dot(H,$e)]));const ee=s.transformMat4([],Q.center,B);s.squaredLength(ee)===0&&s.set(ee,0,0,1),s.normalize(ee,ee),s.scale$2(ee,ee,s.GLOBE_RADIUS),S.center=s.ecefToLatLng(ee);const de=S.getWorldToCameraMatrix(),fe=s.invert(new Float64Array(16),de);Q=s.Aabb.applyTransform(Q,s.multiply([],de,B)),s.transformMat4(ee,ee,de);const pe=.5*(Q.max[2]-Q.min[2]),xe=this._minimumAABBFrustumDistance(S,Q),ye=s.scale$2([],[0,0,1],pe),Ae=s.add(ye,ee,ye),We=xe+(S.pitch===0?0:s.distance(ee,Ae)),Ee=S.globeCenterInViewSpace,Fe=s.sub([],ee,[Ee[0],Ee[1],Ee[2]]);s.normalize(Fe,Fe),s.scale$2(Fe,Fe,We);const ke=s.add([],ee,Fe);s.transformMat4(ke,ke,fe);const qe=s.earthRadius/s.GLOBE_RADIUS,Se=s.length(ke),Be=s.mercatorZfromAltitude(Math.max(Se*qe-s.earthRadius,Number.EPSILON),0),Xe=Math.min(S.zoomFromMercatorZAdjusted(Be),C.maxZoom);return Xe>.5*(s.GLOBE_ZOOM_THRESHOLD_MIN+s.GLOBE_ZOOM_THRESHOLD_MAX)?(S.setProjection({name:"mercator"}),S.zoom=Xe,this._cameraForBounds(S,c,f,_,x,T)):{center:S.center,zoom:Xe,bearing:_,pitch:x}}queryTerrainElevation(o,c){const f=this.transform.elevation;return f?(c=s.extend({},{exaggerated:!0},c),f.getAtPoint(s.MercatorCoordinate.fromLngLat(o),null,c.exaggerated)):null}_cameraForBounds(o,c,f,_,x,T){if(o.projection.name==="globe")return this._cameraForBoundsOnGlobe(o,c,f,_,x,T);const S=o.clone(),C=this._extendCameraOptions(T),z=S.padding;S.bearing=_,S.pitch=x;const P=s.LngLat.convert(c),O=s.LngLat.convert(f),j=new s.LngLat(P.lng,O.lat),W=new s.LngLat(O.lng,P.lat),H=S.project(P),Z=S.project(O),X=this.queryTerrainElevation(P),B=this.queryTerrainElevation(O),q=this.queryTerrainElevation(j),Q=this.queryTerrainElevation(W),ee=[[H.x,H.y,Math.min(X||0,B||0,q||0,Q||0)],[Z.x,Z.y,Math.max(X||0,B||0,q||0,Q||0)]];let de=s.Aabb.fromPoints(ee);const fe=S.getWorldToCameraMatrix(),pe=s.invert(new Float64Array(16),fe);de=s.Aabb.applyTransform(de,fe);const xe=s.sub([],de.max,de.min),ye=z.left||0,Ae=z.right||0,We=z.bottom||0,Ee=z.top||0,{left:Fe,right:ke,top:qe,bottom:Se}=C.padding,Be=.5*(ye+Ae),Xe=.5*(Ee+We),$e=Math.min(S.scaleZoom(S.scale*Math.min((S.width-(ye+Ae+Fe+ke))/xe[0],(S.height-(We+Ee+Se+qe))/xe[1])),C.maxZoom),Ye=S.scale/S.zoomScale($e);de=new s.Aabb([de.min[0]-(Fe+Be)*Ye,de.min[1]-(Se+Xe)*Ye,de.min[2]],[de.max[0]+(ke+Be)*Ye,de.max[1]+(qe+Xe)*Ye,de.max[2]]);const gt=.5*xe[2],Et=this._minimumAABBFrustumDistance(S,de),pt=[0,0,1,0];s.transformMat4$1(pt,pt,fe),s.normalize$2(pt,pt);const wt=s.scale$2([],pt,Et+gt),Ut=s.add([],de.center,wt),Ot=(typeof C.offset.x=="number"&&typeof C.offset.y=="number"?new s.Point(C.offset.x,C.offset.y):s.Point.convert(C.offset)).rotate(-s.degToRad(_));de.center[0]-=Ot.x*Ye,de.center[1]+=Ot.y*Ye,s.transformMat4(de.center,de.center,pe),s.transformMat4(Ut,Ut,pe);const mt=[de.center[0],de.center[1],Ut[2]*S.pixelsPerMeter];s.scale$2(mt,mt,1/S.worldSize);const en=s.lngFromMercatorX(mt[0]),rn=s.latFromMercatorY(mt[1]),on=Math.min(S._zoomFromMercatorZ(mt[2]),C.maxZoom),sn=new s.LngLat(en,rn);return S.mercatorFromTransition&&on<.5*(s.GLOBE_ZOOM_THRESHOLD_MIN+s.GLOBE_ZOOM_THRESHOLD_MAX)?(S.setProjection({name:"globe"}),S.zoom=on,this._cameraForBounds(S,c,f,_,x,T)):{center:sn,zoom:on,bearing:_,pitch:x}}fitBounds(o,c,f){const _=this.cameraForBounds(o,c);return this._fitInternal(_,c,f)}fitScreenCoordinates(o,c,f,_,x){const T=s.Point.convert(o),S=s.Point.convert(c),C=new s.Point(Math.min(T.x,S.x),Math.min(T.y,S.y)),z=new s.Point(Math.max(T.x,S.x),Math.max(T.y,S.y));if(this.transform.projection.name==="mercator"&&this.transform.anyCornerOffEdge(T,S))return this;const P=this.transform.pointLocation3D(C),O=this.transform.pointLocation3D(z),j=this.transform.pointLocation3D(new s.Point(C.x,z.y)),W=this.transform.pointLocation3D(new s.Point(z.x,C.y)),H=[Math.min(P.lng,O.lng,j.lng,W.lng),Math.min(P.lat,O.lat,j.lat,W.lat)],Z=[Math.max(P.lng,O.lng,j.lng,W.lng),Math.max(P.lat,O.lat,j.lat,W.lat)],X=_&&_.pitch?_.pitch:this.getPitch(),B=this._cameraForBounds(this.transform,H,Z,f,X,_);return this._fitInternal(B,_,x)}_fitInternal(o,c,f){return o?(delete(c=s.extend(o,c)).padding,c.linear?this.easeTo(c,f):this.flyTo(c,f)):this}jumpTo(o,c){this.stop();const f=o.preloadOnly?this.transform.clone():this.transform;let _=!1,x=!1,T=!1;return"zoom"in o&&f.zoom!==+o.zoom&&(_=!0,f.zoom=+o.zoom),o.center!==void 0&&(f.center=s.LngLat.convert(o.center)),"bearing"in o&&f.bearing!==+o.bearing&&(x=!0,f.bearing=+o.bearing),"pitch"in o&&f.pitch!==+o.pitch&&(T=!0,f.pitch=+o.pitch),o.padding==null||f.isPaddingEqual(o.padding)||(f.padding=o.padding),o.preloadOnly?(this._preloadTiles(f),this):(this.fire(new s.Event("movestart",c)).fire(new s.Event("move",c)),_&&this.fire(new s.Event("zoomstart",c)).fire(new s.Event("zoom",c)).fire(new s.Event("zoomend",c)),x&&this.fire(new s.Event("rotatestart",c)).fire(new s.Event("rotate",c)).fire(new s.Event("rotateend",c)),T&&this.fire(new s.Event("pitchstart",c)).fire(new s.Event("pitch",c)).fire(new s.Event("pitchend",c)),this.fire(new s.Event("moveend",c)))}getFreeCameraOptions(){return this.transform.projection.supportsFreeCamera||s.warnOnce(Ds),this.transform.getFreeCameraOptions()}setFreeCameraOptions(o,c){const f=this.transform;if(!f.projection.supportsFreeCamera)return s.warnOnce(Ds),this;this.stop();const _=f.zoom,x=f.pitch,T=f.bearing;f.setFreeCameraOptions(o);const S=_!==f.zoom,C=x!==f.pitch,z=T!==f.bearing;return this.fire(new s.Event("movestart",c)).fire(new s.Event("move",c)),S&&this.fire(new s.Event("zoomstart",c)).fire(new s.Event("zoom",c)).fire(new s.Event("zoomend",c)),z&&this.fire(new s.Event("rotatestart",c)).fire(new s.Event("rotate",c)).fire(new s.Event("rotateend",c)),C&&this.fire(new s.Event("pitchstart",c)).fire(new s.Event("pitch",c)).fire(new s.Event("pitchend",c)),this.fire(new s.Event("moveend",c)),this}easeTo(o,c){this._stop(!1,o.easeId),((o=s.extend({offset:[0,0],duration:500,easing:s.ease},o)).animate===!1||this._prefersReducedMotion(o))&&(o.duration=0);const f=this.transform,_=this.getZoom(),x=this.getBearing(),T=this.getPitch(),S=this.getPadding(),C="zoom"in o?+o.zoom:_,z="bearing"in o?this._normalizeBearing(o.bearing,x):x,P="pitch"in o?+o.pitch:T,O="padding"in o?o.padding:f.padding,j=s.Point.convert(o.offset);let W,H,Z;if(f.projection.name==="globe"){const ye=s.MercatorCoordinate.fromLngLat(f.center),Ae=j.rotate(-f.angle);ye.x+=Ae.x/f.worldSize,ye.y+=Ae.y/f.worldSize;const We=ye.toLngLat(),Ee=s.LngLat.convert(o.center||We);this._normalizeCenter(Ee),W=f.centerPoint.add(Ae),H=new s.Point(ye.x,ye.y).mult(f.worldSize),Z=new s.Point(s.mercatorXfromLng(Ee.lng),s.mercatorYfromLat(Ee.lat)).mult(f.worldSize).sub(H)}else{W=f.centerPoint.add(j);const ye=f.pointLocation(W),Ae=s.LngLat.convert(o.center||ye);this._normalizeCenter(Ae),H=f.project(ye),Z=f.project(Ae).sub(H)}const X=f.zoomScale(C-_);let B,q;o.around&&(B=s.LngLat.convert(o.around),q=f.locationPoint(B));const Q=this._zooming||C!==_,ee=this._rotating||x!==z,de=this._pitching||P!==T,fe=!f.isPaddingEqual(O),pe=ye=>Ae=>{if(Q&&(ye.zoom=s.number(_,C,Ae)),ee&&(ye.bearing=s.number(x,z,Ae)),de&&(ye.pitch=s.number(T,P,Ae)),fe&&(ye.interpolatePadding(S,O,Ae),W=ye.centerPoint.add(j)),B)ye.setLocationAtPoint(B,q);else{const We=ye.zoomScale(ye.zoom-_),Ee=C>_?Math.min(2,X):Math.max(.5,X),Fe=Math.pow(Ee,1-Ae),ke=ye.unproject(H.add(Z.mult(Ae*Fe)).mult(We));ye.setLocationAtPoint(ye.renderWorldCopies?ke.wrap():ke,W)}return o.preloadOnly||this._fireMoveEvents(c),ye};if(o.preloadOnly){const ye=this._emulate(pe,o.duration,f);return this._preloadTiles(ye),this}const xe={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=Q,this._rotating=ee,this._pitching=de,this._padding=fe,this._easeId=o.easeId,this._prepareEase(c,o.noMoveStart,xe),this._ease(pe(f),ye=>{f.recenterOnTerrain(),this._afterEase(c,ye)},o),this}_prepareEase(o,c,f={}){this._moving=!0,this.transform.cameraElevationReference="sea",c||f.moving||this.fire(new s.Event("movestart",o)),this._zooming&&!f.zooming&&this.fire(new s.Event("zoomstart",o)),this._rotating&&!f.rotating&&this.fire(new s.Event("rotatestart",o)),this._pitching&&!f.pitching&&this.fire(new s.Event("pitchstart",o))}_fireMoveEvents(o){this.fire(new s.Event("move",o)),this._zooming&&this.fire(new s.Event("zoom",o)),this._rotating&&this.fire(new s.Event("rotate",o)),this._pitching&&this.fire(new s.Event("pitch",o))}_afterEase(o,c){if(this._easeId&&c&&this._easeId===c)return;this._easeId=void 0,this.transform.cameraElevationReference="ground";const f=this._zooming,_=this._rotating,x=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,f&&this.fire(new s.Event("zoomend",o)),_&&this.fire(new s.Event("rotateend",o)),x&&this.fire(new s.Event("pitchend",o)),this.fire(new s.Event("moveend",o))}flyTo(o,c){if(this._prefersReducedMotion(o)){const $e=s.pick(o,["center","zoom","bearing","pitch","around"]);return this.jumpTo($e,c)}this.stop(),o=s.extend({offset:[0,0],speed:1.2,curve:1.42,easing:s.ease},o);const f=this.transform,_=this.getZoom(),x=this.getBearing(),T=this.getPitch(),S=this.getPadding(),C="zoom"in o?s.clamp(+o.zoom,f.minZoom,f.maxZoom):_,z="bearing"in o?this._normalizeBearing(o.bearing,x):x,P="pitch"in o?+o.pitch:T,O="padding"in o?o.padding:f.padding,j=f.zoomScale(C-_),W=s.Point.convert(o.offset);let H=f.centerPoint.add(W);const Z=f.pointLocation(H),X=s.LngLat.convert(o.center||Z);this._normalizeCenter(X);const B=f.project(Z),q=f.project(X).sub(B);let Q=o.curve;const ee=Math.max(f.width,f.height),de=ee/j,fe=q.mag();if("minZoom"in o){const $e=s.clamp(Math.min(o.minZoom,_,C),f.minZoom,f.maxZoom),Ye=ee/f.zoomScale($e-_);Q=Math.sqrt(Ye/fe*2)}const pe=Q*Q;function xe($e){const Ye=(de*de-ee*ee+($e?-1:1)*pe*pe*fe*fe)/(2*($e?de:ee)*pe*fe);return Math.log(Math.sqrt(Ye*Ye+1)-Ye)}function ye($e){return(Math.exp($e)-Math.exp(-$e))/2}function Ae($e){return(Math.exp($e)+Math.exp(-$e))/2}const We=xe(0);let Ee=function($e){return Ae(We)/Ae(We+Q*$e)},Fe=function($e){return ee*((Ae(We)*(ye(Ye=We+Q*$e)/Ae(Ye))-ye(We))/pe)/fe;var Ye},ke=(xe(1)-We)/Q;if(Math.abs(fe)<1e-6||!isFinite(ke)){if(Math.abs(ee-de)<1e-6)return this.easeTo(o,c);const $e=deo.maxDuration&&(o.duration=0);const qe=x!==z,Se=P!==T,Be=!f.isPaddingEqual(O),Xe=$e=>Ye=>{const gt=Ye*ke,Et=1/Ee(gt);$e.zoom=Ye===1?C:_+$e.scaleZoom(Et),qe&&($e.bearing=s.number(x,z,Ye)),Se&&($e.pitch=s.number(T,P,Ye)),Be&&($e.interpolatePadding(S,O,Ye),H=$e.centerPoint.add(W));const pt=Ye===1?X:$e.unproject(B.add(q.mult(Fe(gt))).mult(Et));return $e.setLocationAtPoint($e.renderWorldCopies?pt.wrap():pt,H),$e._updateCameraOnTerrain(),o.preloadOnly||this._fireMoveEvents(c),$e};if(o.preloadOnly){const $e=this._emulate(Xe,o.duration,f);return this._preloadTiles($e),this}return this._zooming=!0,this._rotating=qe,this._pitching=Se,this._padding=Be,this._prepareEase(c,!1),this._ease(Xe(f),()=>this._afterEase(c),o),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(o,c){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),this._easeFrameId=void 0,this._onEaseFrame=void 0),this._onEaseEnd){const f=this._onEaseEnd;this._onEaseEnd=void 0,f.call(this,c)}if(!o){const f=this.handlers;f&&f.stop(!1)}return this}_ease(o,c,f){f.animate===!1||f.duration===0?(o(1),c()):(this._easeStart=s.exported.now(),this._easeOptions=f,this._onEaseFrame=o,this._onEaseEnd=c,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const o=Math.min((s.exported.now()-this._easeStart)/this._easeOptions.duration,1),c=this._onEaseFrame;c&&c(this._easeOptions.easing(o)),o<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(o,c){o=s.wrap(o,-180,180);const f=Math.abs(o-c);return Math.abs(o-360-c)180?-360:f<-180?360:0}_prefersReducedMotion(o){return this._respectPrefersReducedMotion&&s.exported.prefersReducedMotion&&!(o&&o.essential)}_emulate(o,c,f){const _=Math.ceil(15*c/1e3),x=[],T=o(f.clone());for(let S=0;S<=_;S++){const C=T(S/_);x.push(C.clone())}return x}}class dt{constructor(o={}){this.options=o,s.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)}getDefaultPosition(){return"bottom-right"}onAdd(o){const c=this.options&&this.options.compact;return this._map=o,this._container=J("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=J("button","mapboxgl-ctrl-attrib-button",this._container),J("span","mapboxgl-ctrl-icon",this._compactButton).setAttribute("aria-hidden","true"),this._compactButton.type="button",this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=J("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),c&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),c===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0}_setElementTitle(o,c){const f=this._map._getUIString(`AttributionControl.${c}`);o.setAttribute("aria-label",f),o.removeAttribute("title"),o.firstElementChild&&o.firstElementChild.setAttribute("title",f)}_toggleAttribution(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","true"))}_updateEditLink(){let o=this._editLink;o||(o=this._editLink=this._container.querySelector(".mapbox-improve-map"));const c=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||s.config.ACCESS_TOKEN}];if(o){const f=c.reduce((_,x,T)=>(x.value&&(_+=`${x.key}=${x.value}${T_.length-x.length),o=o.filter((_,x)=>{for(let T=x+1;T=0)return!1;return!0}),this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?o=[...this.options.customAttribution,...o]:o.unshift(this.options.customAttribution));const f=o.join(" | ");f!==this._attribHTML&&(this._attribHTML=f,o.length?(this._innerContainer.innerHTML=f,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")}}class cd{constructor(){s.bindAll(["_updateLogo","_updateCompact"],this)}onAdd(o){this._map=o,this._container=J("div","mapboxgl-ctrl");const c=J("a","mapboxgl-ctrl-logo");return c.target="_blank",c.rel="noopener nofollow",c.href="https://www.mapbox.com/",c.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),c.setAttribute("rel","noopener nofollow"),this._container.appendChild(c),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)}getDefaultPosition(){return"bottom-left"}_updateLogo(o){o&&o.sourceDataType!=="metadata"||(this._container.style.display=this._logoRequired()?"block":"none")}_logoRequired(){if(!this._map.style)return!0;const o=this._map.style._sourceCaches;if(Object.entries(o).length===0)return!0;for(const c in o){const f=o[c].getSource();if(f.hasOwnProperty("mapbox_logo")&&!f.mapbox_logo)return!1}return!0}_updateCompact(){const o=this._container.children;if(o.length){const c=o[0];this._map.getCanvasContainer().offsetWidth<250?c.classList.add("mapboxgl-compact"):c.classList.remove("mapboxgl-compact")}}}class ud{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(o){const c=++this._id;return this._queue.push({callback:o,id:c,cancelled:!1}),c}remove(o){const c=this._currentlyRunning,f=c?this._queue.concat(c):this._queue;for(const _ of f)if(_.id===o)return void(_.cancelled=!0)}run(o=0){const c=this._currentlyRunning=this._queue;this._queue=[];for(const f of c)if(!f.cancelled&&(f.callback(o),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}function Ia(d,o,c){if(d=new s.LngLat(d.lng,d.lat),o){const f=new s.LngLat(d.lng-360,d.lat),_=new s.LngLat(d.lng+360,d.lat),x=360*Math.ceil(Math.abs(d.lng-c.center.lng)/360),T=c.locationPoint(d).distSqr(o),S=o.x<0||o.y<0||o.x>c.width||o.y>c.height;c.locationPoint(f).distSqr(o)180;){const f=c.locationPoint(d);if(f.x>=0&&f.y>=0&&f.x<=c.width&&f.y<=c.height)break;d.lng>c.center.lng?d.lng-=360:d.lng+=360}return d}const Os={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%)"};class at extends s.Evented{constructor(o,c){if(super(),(o instanceof s.window.HTMLElement||c)&&(o=s.extend({element:o},c)),s.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress","_clearFadeTimer"],this),this._anchor=o&&o.anchor||"center",this._color=o&&o.color||"#3FB1CE",this._scale=o&&o.scale||1,this._draggable=o&&o.draggable||!1,this._clickTolerance=o&&o.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=o&&o.rotation||0,this._rotationAlignment=o&&o.rotationAlignment||"auto",this._pitchAlignment=o&&o.pitchAlignment&&o.pitchAlignment||"auto",this._updateMoving=()=>this._update(!0),this._occludedOpacity=o&&o.occludedOpacity||.2,o&&o.element)this._element=o.element,this._offset=s.Point.convert(o&&o.offset||[0,0]);else{this._defaultMarker=!0,this._element=J("div");const _=41,x=27,T=ve("svg",{display:"block",height:_*this._scale+"px",width:x*this._scale+"px",viewBox:`0 0 ${x} ${_}`},this._element),S=ve("radialGradient",{id:"shadowGradient"},ve("defs",{},T));ve("stop",{offset:"10%","stop-opacity":.4},S),ve("stop",{offset:"100%","stop-opacity":.05},S),ve("ellipse",{cx:13.5,cy:34.8,rx:10.5,ry:5.25,fill:"url(#shadowGradient)"},T),ve("path",{fill:this._color,d:"M27,13.5C27,19.07 20.25,27 14.75,34.5C14.02,35.5 12.98,35.5 12.25,34.5C6.75,27 0,19.22 0,13.5C0,6.04 6.04,0 13.5,0C20.96,0 27,6.04 27,13.5Z"},T),ve("path",{opacity:.25,d:"M13.5,0C6.04,0 0,6.04 0,13.5C0,19.22 6.75,27 12.25,34.5C13,35.52 14.02,35.5 14.75,34.5C20.25,27 27,19.07 27,13.5C27,6.04 20.96,0 13.5,0ZM13.5,1C20.42,1 26,6.58 26,13.5C26,15.9 24.5,19.18 22.22,22.74C19.95,26.3 16.71,30.14 13.94,33.91C13.74,34.18 13.61,34.32 13.5,34.44C13.39,34.32 13.26,34.18 13.06,33.91C10.28,30.13 7.41,26.31 5.02,22.77C2.62,19.23 1,15.95 1,13.5C1,6.58 6.58,1 13.5,1Z"},T),ve("circle",{fill:"white",cx:13.5,cy:13.5,r:5.5},T),this._offset=s.Point.convert(o&&o.offset||[0,-14])}this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label","Map marker"),this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",_=>{_.preventDefault()}),this._element.addEventListener("mousedown",_=>{_.preventDefault()});const f=this._element.classList;for(const _ in Os)f.remove(`mapboxgl-marker-anchor-${_}`);f.add(`mapboxgl-marker-anchor-${this._anchor}`),this._popup=null}addTo(o){return o===this._map||(this.remove(),this._map=o,o.getCanvasContainer().appendChild(this._element),o.on("move",this._updateMoving),o.on("moveend",this._update),o.on("remove",this._clearFadeTimer),o._addMarker(this),this.setDraggable(this._draggable),this._update(),o.on("click",this._onMapClick)),this}remove(){const o=this._map;return o&&(o.off("click",this._onMapClick),o.off("move",this._updateMoving),o.off("moveend",this._update),o.off("mousedown",this._addDragHandler),o.off("touchstart",this._addDragHandler),o.off("mouseup",this._onUp),o.off("touchend",this._onUp),o.off("mousemove",this._onMove),o.off("touchmove",this._onMove),o.off("remove",this._clearFadeTimer),o._removeMarker(this),this._map=void 0),this._clearFadeTimer(),this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(o){return this._lngLat=s.LngLat.convert(o),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(!0),this}getElement(){return this._element}setPopup(o){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeAttribute("role"),this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),o){if(!("offset"in o.options)){const _=Math.sqrt(Math.pow(13.5,2)/2);o.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[_,-1*(38.1-13.5+_)],"bottom-right":[-_,-1*(38.1-13.5+_)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=o,o._marker=this,this._lngLat&&this._popup.setLngLat(this._lngLat),this._element.setAttribute("role","button"),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress),this._element.setAttribute("aria-expanded","false")}return this}_onKeyPress(o){const c=o.code,f=o.charCode||o.keyCode;c!=="Space"&&c!=="Enter"&&f!==32&&f!==13||this.togglePopup()}_onMapClick(o){const c=o.originalEvent.target,f=this._element;this._popup&&(c===f||f.contains(c))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const o=this._popup;return o?(o.isOpen()?(o.remove(),this._element.setAttribute("aria-expanded","false")):this._map&&(o.addTo(this._map),this._element.setAttribute("aria-expanded","true")),this):this}_behindTerrain(){const o=this._map,c=this._pos;if(!o||!c)return!1;const f=o.unproject(c),_=o.getFreeCameraOptions();if(!_.position)return!1;const x=_.position.toLngLat();return x.distanceTo(f)<.9*x.distanceTo(this._lngLat)}_evaluateOpacity(){const o=this._map;if(!o)return;const c=this._pos;if(!c||c.x<0||c.x>o.transform.width||c.y<0||c.y>o.transform.height)return void this._clearFadeTimer();const f=o.unproject(c);let _;o._showingGlobe()&&s.isLngLatBehindGlobe(o.transform,this._lngLat)?_=0:(_=1-o._queryFogOpacity(f),o.transform._terrainEnabled()&&o.getTerrain()&&this._behindTerrain()&&(_*=this._occludedOpacity)),this._element.style.opacity=`${_}`,this._element.style.pointerEvents=_>0?"auto":"none",this._popup&&this._popup._setOpacity(_),this._fadeTimer=null}_clearFadeTimer(){this._fadeTimer&&(clearTimeout(this._fadeTimer),this._fadeTimer=null)}_updateDOM(){const o=this._pos;if(!o||!this._map)return;const c=this._offset.mult(this._scale);this._element.style.transform=` + translate(${o.x}px,${o.y}px) + ${Os[this._anchor]} + ${this._calculateXYTransform()} ${this._calculateZTransform()} + translate(${c.x}px,${c.y}px) + `}_calculateXYTransform(){const o=this._pos,c=this._map,f=this.getPitchAlignment();if(!c||!o||f!=="map")return"";if(!c._showingGlobe()){const C=c.getPitch();return C?`rotateX(${C}deg)`:""}const _=s.radToDeg(s.globeTiltAtLngLat(c.transform,this._lngLat)),x=o.sub(s.globeCenterToScreenPoint(c.transform)),T=Math.abs(x.x)+Math.abs(x.y);if(T===0)return"";const S=_/T;return`rotateX(${-x.y*S}deg) rotateY(${x.x*S}deg)`}_calculateZTransform(){const o=this._pos,c=this._map;if(!c||!o)return"";let f=0;const _=this.getRotationAlignment();if(_==="map")if(c._showingGlobe()){const x=c.project(new s.LngLat(this._lngLat.lng,this._lngLat.lat+.001)),T=c.project(new s.LngLat(this._lngLat.lng,this._lngLat.lat-.001)).sub(x);f=s.radToDeg(Math.atan2(T.y,T.x))-90}else f=-c.getBearing();else if(_==="horizon"){const x=s.smoothstep(4,6,c.getZoom()),T=s.globeCenterToScreenPoint(c.transform);T.y+=x*c.transform.height;const S=o.sub(T),C=s.radToDeg(Math.atan2(S.y,S.x));f=(C>90?C-270:C+90)*(1-x)}return f+=this._rotation,f?`rotateZ(${f}deg)`:""}_update(o){s.window.cancelAnimationFrame(this._updateFrameId);const c=this._map;c&&(c.transform.renderWorldCopies&&(this._lngLat=Ia(this._lngLat,this._pos,c.transform)),this._pos=c.project(this._lngLat),o===!0?this._updateFrameId=s.window.requestAnimationFrame(()=>{this._element&&this._pos&&this._anchor&&(this._pos=this._pos.round(),this._updateDOM())}):this._pos=this._pos.round(),c._requestDomTask(()=>{this._map&&(this._element&&this._pos&&this._anchor&&this._updateDOM(),(c._showingGlobe()||c.getTerrain()||c.getFog())&&!this._fadeTimer&&(this._fadeTimer=setTimeout(this._evaluateOpacity.bind(this),60)))}))}getOffset(){return this._offset}setOffset(o){return this._offset=s.Point.convert(o),this._update(),this}_onMove(o){const c=this._map;if(!c)return;const f=this._pointerdownPos,_=this._positionDelta;if(f&&_){if(!this._isDragging){const x=this._clickTolerance||c._clickTolerance;if(o.point.dist(f)=this._endTime)return this._end;const c=s.easeCubicInOut((o-this._startTime)/(this._endTime-this._startTime));return this._start*(1-c)+this._end*c}isEasing(o){return o>=this._startTime&&o<=this._endTime}jumpTo(o){this._startTime=-1/0,this._endTime=-1/0,this._start=o,this._end=o}easeTo(o,c,f){this._start=this.getValue(c),this._end=o,this._startTime=c,this._endTime=c+f}}const Zf={"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":"Mapbox logo","Map.Title":"Map","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScrollZoomBlocker.CtrlMessage":"Use ctrl + scroll to zoom the map","ScrollZoomBlocker.CmdMessage":"Use ⌘ + scroll to zoom the map","TouchPanBlocker.Message":"Use two fingers to move the map"},Hf={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:85,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,performanceMetricsCollection:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,optimizeForTerrain:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,minTileCacheSize:null,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",localFontFamily:null,transformRequest:null,accessToken:null,fadeDuration:300,respectPrefersReducedMotion:!0,crossSourceCollisions:!0},hy={showCompass:!0,showZoom:!0,visualizePitch:!1};class dy{constructor(o,c,f=!1){this._clickTolerance=10,this.element=c,this.mouseRotate=new id({clickTolerance:o.dragRotate._mouseRotate._clickTolerance}),this.map=o,f&&(this.mousePitch=new od({clickTolerance:o.dragRotate._mousePitch._clickTolerance})),s.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),c.addEventListener("mousedown",this.mousedown),c.addEventListener("touchstart",this.touchstart,{passive:!1}),c.addEventListener("touchmove",this.touchmove),c.addEventListener("touchend",this.touchend),c.addEventListener("touchcancel",this.reset)}down(o,c){this.mouseRotate.mousedown(o,c),this.mousePitch&&this.mousePitch.mousedown(o,c),ie()}move(o,c){const f=this.map,_=this.mouseRotate.mousemoveWindow(o,c),x=_&&_.bearingDelta;if(x&&f.setBearing(f.getBearing()+x),this.mousePitch){const T=this.mousePitch.mousemoveWindow(o,c),S=T&&T.pitchDelta;S&&f.setPitch(f.getPitch()+S)}}off(){const o=this.element;o.removeEventListener("mousedown",this.mousedown),o.removeEventListener("touchstart",this.touchstart,{passive:!1}),o.removeEventListener("touchmove",this.touchmove),o.removeEventListener("touchend",this.touchend),o.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){te(),s.window.removeEventListener("mousemove",this.mousemove),s.window.removeEventListener("mouseup",this.mouseup)}mousedown(o){this.down(s.extend({},o,{ctrlKey:!0,preventDefault:()=>o.preventDefault()}),Oe(this.element,o)),s.window.addEventListener("mousemove",this.mousemove),s.window.addEventListener("mouseup",this.mouseup)}mousemove(o){this.move(o,Oe(this.element,o))}mouseup(o){this.mouseRotate.mouseupWindow(o),this.mousePitch&&this.mousePitch.mouseupWindow(o),this.offTemp()}touchstart(o){o.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=Ke(this.element,o.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>o.preventDefault()},this._startPos))}touchmove(o){o.targetTouches.length!==1?this.reset():(this._lastPos=Ke(this.element,o.targetTouches)[0],this.move({preventDefault:()=>o.preventDefault()},this._lastPos))}touchend(o){o.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)d.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(d.minPitch!=null&&d.maxPitch!=null&&d.minPitch>d.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(d.minPitch!=null&&d.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(d.maxPitch!=null&&d.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(d.antialias&&s.isSafariWithAntialiasingBug(s.window)&&(d.antialias=!1,s.warnOnce("Antialiasing is disabled for this WebGL context to avoid browser bug: https://github.com/mapbox/mapbox-gl-js/issues/11609")),super(new Ta(d.minZoom,d.maxZoom,d.minPitch,d.maxPitch,d.renderWorldCopies),d),this._interactive=d.interactive,this._minTileCacheSize=d.minTileCacheSize,this._maxTileCacheSize=d.maxTileCacheSize,this._failIfMajorPerformanceCaveat=d.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=d.preserveDrawingBuffer,this._antialias=d.antialias,this._useWebGL2=d.useWebGL2,this._trackResize=d.trackResize,this._bearingSnap=d.bearingSnap,this._refreshExpiredTiles=d.refreshExpiredTiles,this._fadeDuration=d.fadeDuration,this._isInitialLoad=!0,this._crossSourceCollisions=d.crossSourceCollisions,this._collectResourceTiming=d.collectResourceTiming,this._optimizeForTerrain=d.optimizeForTerrain,this._language=this._parseLanguage(d.language),this._worldview=d.worldview,this._renderTaskQueue=new ud,this._domRenderTaskQueue=new ud,this._controls=[],this._markers=[],this._popups=[],this._mapId=s.uniqueId(),this._locale=s.extend({},Zf,d.locale),this._clickTolerance=d.clickTolerance,this._cooperativeGestures=d.cooperativeGestures,this._performanceMetricsCollection=d.performanceMetricsCollection,this._containerWidth=0,this._containerHeight=0,this._averageElevationLastSampledAt=-1/0,this._averageElevationExaggeration=0,this._averageElevation=new dd(0),this._interactionRange=[1/0,-1/0],this._visibilityHidden=0,this._useExplicitProjection=!1,this._requestManager=new s.RequestManager(d.transformRequest,d.accessToken,d.testMode),this._silenceAuthErrors=!!d.testMode,typeof d.container=="string"){if(this._container=s.window.document.getElementById(d.container),!this._container)throw new Error(`Container '${d.container}' not found.`)}else{if(!(d.container instanceof s.window.HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=d.container}if(this._container.childNodes.length>0&&s.warnOnce("The map container element should be empty, otherwise the map's interactivity will be negatively impacted. If you want to display a message when WebGL is not supported, use the Mapbox GL Supported plugin instead."),d.maxBounds&&this.setMaxBounds(d.maxBounds),s.bindAll(["_onWindowOnline","_onWindowResize","_onVisibilityChange","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),s.window!==void 0&&(s.window.addEventListener("online",this._onWindowOnline,!1),s.window.addEventListener("resize",this._onWindowResize,!1),s.window.addEventListener("orientationchange",this._onWindowResize,!1),s.window.addEventListener("webkitfullscreenchange",this._onWindowResize,!1),s.window.addEventListener("visibilitychange",this._onVisibilityChange,!1)),this.handlers=new ro(this,d),this._localFontFamily=d.localFontFamily,this._localIdeographFontFamily=d.localIdeographFontFamily,d.style&&this.setStyle(d.style,{localFontFamily:this._localFontFamily,localIdeographFontFamily:this._localIdeographFontFamily}),d.projection&&this.setProjection(d.projection),this._hash=d.hash&&new ed(typeof d.hash=="string"&&d.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:d.center,zoom:d.zoom,bearing:d.bearing,pitch:d.pitch}),d.bounds&&(this.resize(),this.fitBounds(d.bounds,s.extend({},d.fitBoundsOptions,{duration:0})))),this.resize(),d.attributionControl&&this.addControl(new dt({customAttribution:d.customAttribution})),this._logoControl=new cd,this.addControl(this._logoControl,d.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",o=>{this._update(o.dataType==="style"),this.fire(new s.Event(`${o.dataType}data`,o))}),this.on("dataloading",o=>{this.fire(new s.Event(`${o.dataType}dataloading`,o))})}_getMapId(){return this._mapId}addControl(d,o){if(o===void 0&&(o=d.getDefaultPosition?d.getDefaultPosition():"top-right"),!d||!d.onAdd)return this.fire(new s.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const c=d.onAdd(this);this._controls.push(d);const f=this._controlPositions[o];return o.indexOf("bottom")!==-1?f.insertBefore(c,f.firstChild):f.appendChild(c),this}removeControl(d){if(!d||!d.onRemove)return this.fire(new s.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const o=this._controls.indexOf(d);return o>-1&&this._controls.splice(o,1),d.onRemove(this),this}hasControl(d){return this._controls.indexOf(d)>-1}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}resize(d){if(this._updateContainerDimensions(),this._containerWidth===this.transform.width&&this._containerHeight===this.transform.height)return this;this._resizeCanvas(this._containerWidth,this._containerHeight),this.transform.resize(this._containerWidth,this._containerHeight),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight));const o=!this._moving;return o&&this.fire(new s.Event("movestart",d)).fire(new s.Event("move",d)),this.fire(new s.Event("resize",d)),o&&this.fire(new s.Event("moveend",d)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()||null}setMaxBounds(d){return this.transform.setMaxBounds(s.LngLatBounds.convert(d)),this._update()}setMinZoom(d){if((d=d??-2)>=-2&&d<=this.transform.maxZoom)return this.transform.minZoom=d,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=d,this._update(),this.getZoom()>d?this.setZoom(d):this.fire(new s.Event("zoomstart")).fire(new s.Event("zoom")).fire(new s.Event("zoomend")),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(d){if((d=d??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(d>=0&&d<=this.transform.maxPitch)return this.transform.minPitch=d,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(d>=this.transform.minPitch)return this.transform.maxPitch=d,this._update(),this.getPitch()>d?this.setPitch(d):this.fire(new s.Event("pitchstart")).fire(new s.Event("pitch")).fire(new s.Event("pitchend")),this;throw new Error("maxPitch must be greater than or equal to minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(d){return this.transform.renderWorldCopies=d,this.transform.renderWorldCopies||this._forceMarkerAndPopupUpdate(!0),this._update()}getLanguage(){return this._language}_parseLanguage(d){return d==="auto"?s.window.navigator.language:Array.isArray(d)?d.length===0?void 0:d.map(o=>o==="auto"?s.window.navigator.language:o):d}setLanguage(d){const o=this._parseLanguage(d);if(!this.style||o===this._language)return this;this._language=o,this.style._reloadSources();for(const c of this._controls)c._setLanguage&&c._setLanguage(this._language);return this}getWorldview(){return this._worldview}setWorldview(d){return this.style&&d!==this._worldview?(this._worldview=d,this.style._reloadSources(),this):this}getProjection(){return this.transform.mercatorFromTransition?{name:"globe",center:[0,0]}:this.transform.getProjection()}_showingGlobe(){return this.transform.projection.name==="globe"}setProjection(d){return this._lazyInitEmptyStyle(),d?typeof d=="string"&&(d={name:d}):d=null,this._useExplicitProjection=!!d,this._prioritizeAndUpdateProjection(d,this.style.stylesheet?this.style.stylesheet.projection:null)}_updateProjectionTransition(){if(this.getProjection().name!=="globe")return;const d=this.transform,o=d.projection.name;let c;o==="globe"&&d.zoom>=s.GLOBE_ZOOM_THRESHOLD_MAX?(d.setMercatorFromTransition(),c=!0):o==="mercator"&&d.zoom=s.GLOBE_ZOOM_THRESHOLD_MAX?this.transform.setMercatorFromTransition():this.transform.setProjection(d),this.style.applyProjectionUpdate(),o){this.painter.clearBackgroundTiles();for(const c in this.style._sourceCaches)this.style._sourceCaches[c].clearTiles();this._update(!0),this._forceMarkerAndPopupUpdate(!0)}return this}project(d){return this.transform.locationPoint3D(s.LngLat.convert(d))}unproject(d){return this.transform.pointLocation3D(s.Point.convert(d))}isMoving(){return this._moving||this.handlers&&this.handlers.isMoving()||!1}isZooming(){return this._zooming||this.handlers&&this.handlers.isZooming()||!1}isRotating(){return this._rotating||this.handlers&&this.handlers.isRotating()||!1}_isDragging(){return this.handlers&&this.handlers._isDragging()||!1}_createDelegatedListener(d,o,c){if(d==="mouseenter"||d==="mouseover"){let f=!1;const _=T=>{const S=o.filter(z=>this.getLayer(z)),C=S.length?this.queryRenderedFeatures(T.point,{layers:S}):[];C.length?f||(f=!0,c.call(this,new pr(d,this,T.originalEvent,{features:C}))):f=!1},x=()=>{f=!1};return{layers:new Set(o),listener:c,delegates:{mousemove:_,mouseout:x}}}if(d==="mouseleave"||d==="mouseout"){let f=!1;const _=T=>{const S=o.filter(C=>this.getLayer(C));(S.length?this.queryRenderedFeatures(T.point,{layers:S}):[]).length?f=!0:f&&(f=!1,c.call(this,new pr(d,this,T.originalEvent)))},x=T=>{f&&(f=!1,c.call(this,new pr(d,this,T.originalEvent)))};return{layers:new Set(o),listener:c,delegates:{mousemove:_,mouseout:x}}}{const f=_=>{const x=o.filter(S=>this.getLayer(S)),T=x.length?this.queryRenderedFeatures(_.point,{layers:x}):[];T.length&&(_.features=T,c.call(this,_),delete _.features)};return{layers:new Set(o),listener:c,delegates:{[d]:f}}}}on(d,o,c){if(c===void 0)return super.on(d,o);Array.isArray(o)||(o=[o]);const f=this._createDelegatedListener(d,o,c);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[d]=this._delegatedListeners[d]||[],this._delegatedListeners[d].push(f);for(const _ in f.delegates)this.on(_,f.delegates[_]);return this}once(d,o,c){if(c===void 0)return super.once(d,o);Array.isArray(o)||(o=[o]);const f=this._createDelegatedListener(d,o,c);for(const _ in f.delegates)this.once(_,f.delegates[_]);return this}off(d,o,c){if(c===void 0)return super.off(d,o);o=new Set(Array.isArray(o)?o:[o]);const f=(x,T)=>{if(x.size!==T.size)return!1;for(const S of x)if(!T.has(S))return!1;return!0},_=this._delegatedListeners?this._delegatedListeners[d]:void 0;return _&&(x=>{for(let T=0;T{_?this.fire(new s.ErrorEvent(_)):x&&this._updateDiff(x,o)})}else typeof d=="object"&&this._updateDiff(d,o)}_updateDiff(d,o){try{this.style.setState(d)&&this._update(!0)}catch(c){s.warnOnce(`Unable to perform style diff: ${c.message||c.error||c}. Rebuilding the style from scratch.`),this._updateStyle(d,o)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():(s.warnOnce("There is no style added to the map."),!1)}addSource(d,o){return this._lazyInitEmptyStyle(),this.style.addSource(d,o),this._update(!0)}isSourceLoaded(d){return!!this.style&&this.style._isSourceCacheLoaded(d)}areTilesLoaded(){const d=this.style&&this.style._sourceCaches;for(const o in d){const c=d[o]._tiles;for(const f in c){const _=c[f];if(_.state!=="loaded"&&_.state!=="errored")return!1}}return!0}addSourceType(d,o,c){this._lazyInitEmptyStyle(),this.style.addSourceType(d,o,c)}removeSource(d){return this.style.removeSource(d),this._updateTerrain(),this._update(!0)}getSource(d){return this.style.getSource(d)}addImage(d,o,{pixelRatio:c=1,sdf:f=!1,stretchX:_,stretchY:x,content:T}={}){if(this._lazyInitEmptyStyle(),o instanceof s.window.HTMLImageElement||s.window.ImageBitmap&&o instanceof s.window.ImageBitmap){const{width:S,height:C,data:z}=s.exported.getImageData(o);this.style.addImage(d,{data:new s.RGBAImage({width:S,height:C},z),pixelRatio:c,stretchX:_,stretchY:x,content:T,sdf:f,version:0})}else if(o.width===void 0||o.height===void 0)this.fire(new s.ErrorEvent(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`")));else{const{width:S,height:C}=o,z=o;this.style.addImage(d,{data:new s.RGBAImage({width:S,height:C},new Uint8Array(z.data)),pixelRatio:c,stretchX:_,stretchY:x,content:T,sdf:f,version:0,userImage:z}),z.onAdd&&z.onAdd(this,d)}}updateImage(d,o){const c=this.style.getImage(d);if(!c)return void this.fire(new s.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const f=o instanceof s.window.HTMLImageElement||s.window.ImageBitmap&&o instanceof s.window.ImageBitmap?s.exported.getImageData(o):o,{width:_,height:x}=f;_!==void 0&&x!==void 0?_===c.data.width&&x===c.data.height?(c.data.replace(f.data,!(o instanceof s.window.HTMLImageElement||s.window.ImageBitmap&&o instanceof s.window.ImageBitmap)),this.style.updateImage(d,c)):this.fire(new s.ErrorEvent(new Error(`The width and height of the updated image (${_}, ${x}) + must be that same as the previous version of the image + (${c.data.width}, ${c.data.height})`))):this.fire(new s.ErrorEvent(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`")))}hasImage(d){return d?!!this.style.getImage(d):(this.fire(new s.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(d){this.style.removeImage(d)}loadImage(d,o){s.getImage(this._requestManager.transformRequest(d,s.ResourceType.Image),(c,f)=>{o(c,f instanceof s.window.HTMLImageElement?s.exported.getImageData(f):f)})}listImages(){return this.style.listImages()}addLayer(d,o){return this._lazyInitEmptyStyle(),this.style.addLayer(d,o),this._update(!0)}moveLayer(d,o){return this.style.moveLayer(d,o),this._update(!0)}removeLayer(d){return this.style.removeLayer(d),this._update(!0)}getLayer(d){return this.style.getLayer(d)}setLayerZoomRange(d,o,c){return this.style.setLayerZoomRange(d,o,c),this._update(!0)}setFilter(d,o,c={}){return this.style.setFilter(d,o,c),this._update(!0)}getFilter(d){return this.style.getFilter(d)}setPaintProperty(d,o,c,f={}){return this.style.setPaintProperty(d,o,c,f),this._update(!0)}getPaintProperty(d,o){return this.style.getPaintProperty(d,o)}setLayoutProperty(d,o,c,f={}){return this.style.setLayoutProperty(d,o,c,f),this._update(!0)}getLayoutProperty(d,o){return this.style.getLayoutProperty(d,o)}setLight(d,o={}){return this._lazyInitEmptyStyle(),this.style.setLight(d,o),this._update(!0)}getLight(){return this.style.getLight()}setTerrain(d){return this._lazyInitEmptyStyle(),!d&&this.transform.projection.requiresDraping?this.style.setTerrainForDraping():this.style.setTerrain(d),this._averageElevationLastSampledAt=-1/0,this._update(!0)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(d){return this._lazyInitEmptyStyle(),this.style.setFog(d),this._update(!0)}getFog(){return this.style?this.style.getFog():null}_queryFogOpacity(d){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(s.LngLat.convert(d),this.transform):0}setFeatureState(d,o){return this.style.setFeatureState(d,o),this._update()}removeFeatureState(d,o){return this.style.removeFeatureState(d,o),this._update()}getFeatureState(d){return this.style.getFeatureState(d)}_updateContainerDimensions(){if(!this._container)return;const d=this._container.getBoundingClientRect().width||400,o=this._container.getBoundingClientRect().height||300;let c,f,_,x=this._container;for(;x&&(!f||!_);){const T=s.window.getComputedStyle(x).transform;T&&T!=="none"&&(c=T.match(/matrix.*\((.+)\)/)[1].split(", "),c[0]&&c[0]!=="0"&&c[0]!=="1"&&(f=c[0]),c[3]&&c[3]!=="0"&&c[3]!=="1"&&(_=c[3])),x=x.parentElement}this._containerWidth=f?Math.abs(d/f):d,this._containerHeight=_?Math.abs(o/_):o}_detectMissingCSS(){s.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")!=="rgb(250, 128, 114)"&&s.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")}_setupContainer(){const d=this._container;d.classList.add("mapboxgl-map"),(this._missingCSSCanary=J("div","mapboxgl-canary",d)).style.visibility="hidden",this._detectMissingCSS();const o=this._canvasContainer=J("div","mapboxgl-canvas-container",d);this._interactive&&o.classList.add("mapboxgl-interactive"),this._canvas=J("canvas","mapboxgl-canvas",o),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region"),this._updateContainerDimensions(),this._resizeCanvas(this._containerWidth,this._containerHeight);const c=this._controlContainer=J("div","mapboxgl-control-container",d),f=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(_=>{f[_]=J("div",`mapboxgl-ctrl-${_}`,c)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(d,o){const c=s.exported.devicePixelRatio||1;this._canvas.width=c*Math.ceil(d),this._canvas.height=c*Math.ceil(o),this._canvas.style.width=`${d}px`,this._canvas.style.height=`${o}px`}_addMarker(d){this._markers.push(d)}_removeMarker(d){const o=this._markers.indexOf(d);o!==-1&&this._markers.splice(o,1)}_addPopup(d){this._popups.push(d)}_removePopup(d){const o=this._popups.indexOf(d);o!==-1&&this._popups.splice(o,1)}_setupPainter(){const d=s.extend({},D.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),o=this._useWebGL2&&this._canvas.getContext("webgl2",d),c=o||this._canvas.getContext("webgl",d)||this._canvas.getContext("experimental-webgl",d);c?(this._useWebGL2&&!o&&s.warnOnce("Failed to create WebGL 2 context. Using WebGL 1."),s.storeAuthState(c,!0),this.painter=new ba(c,this.transform,!!o),this.on("data",f=>{f.dataType==="source"&&this.painter.setTileLoadedFlag(!0)}),s.exported$1.testSupport(c)):this.fire(new s.ErrorEvent(new Error("Failed to initialize WebGL")))}_contextLost(d){d.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new s.Event("webglcontextlost",{originalEvent:d}))}_contextRestored(d){this._setupPainter(),this.resize(),this._update(),this.fire(new s.Event("webglcontextrestored",{originalEvent:d}))}_onMapScroll(d){if(d.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(d){return this.style?(this._styleDirty=this._styleDirty||d,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(d){return this._update(),this._renderTaskQueue.add(d)}_cancelRenderFrame(d){this._renderTaskQueue.remove(d)}_requestDomTask(d){!this.loaded()||this.loaded()&&!this.isMoving()?d():this._domRenderTaskQueue.add(d)}_render(d){let o;const c=this.painter.context.extTimerQuery,f=s.exported.now();if(this.listens("gpu-timing-frame")&&(o=c.createQueryEXT(),c.beginQueryEXT(c.TIME_ELAPSED_EXT,o)),this.painter.context.setDirty(),this.painter.setBaseState(),(this.isMoving()||this.isRotating()||this.isZooming())&&(this._interactionRange[0]=Math.min(this._interactionRange[0],s.window.performance.now()),this._interactionRange[1]=Math.max(this._interactionRange[1],s.window.performance.now())),this._renderTaskQueue.run(d),this._domRenderTaskQueue.run(d),this._removed)return;this._updateProjectionTransition();const _=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;const S=this.transform.zoom,C=this.transform.pitch,z=s.exported.now(),P=new s.EvaluationParameters(S,{now:z,fadeDuration:_,pitch:C,transition:this.style.getTransition()});this.style.update(P)}this.style&&this.style.fog&&this.style.fog.hasTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0);let x=!1;if(this.style&&this._sourcesDirty?(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),x=this._updateAverageElevation(f),this.style._updateSources(this.transform),this._forceMarkerAndPopupUpdate()):x=this._updateAverageElevation(f),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,_,this._crossSourceCollisions),this.style&&this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showTerrainWireframe:this.showTerrainWireframe,showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,showTileAABBs:this.showTileAABBs,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:_,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),gpuTimingDeferredRender:!!this.listens("gpu-timing-deferred-render"),speedIndexTiming:this.speedIndexTiming}),this.fire(new s.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new s.Event("load"))),this.style&&this.style.hasTransitions()&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),o){const S=s.exported.now()-f;c.endQueryEXT(c.TIME_ELAPSED_EXT,o),setTimeout(()=>{const C=c.getQueryObjectEXT(o,c.QUERY_RESULT_EXT)/1e6;c.deleteQueryEXT(o),this.fire(new s.Event("gpu-timing-frame",{cpuTime:S,gpuTime:C})),s.window.performance.mark("frame-gpu",{startTime:f,detail:{gpuTime:C}})},50)}if(this.listens("gpu-timing-layer")){const S=this.painter.collectGpuTimers();setTimeout(()=>{const C=this.painter.queryGpuTimers(S);this.fire(new s.Event("gpu-timing-layer",{layerTimes:C}))},50)}if(this.listens("gpu-timing-deferred-render")){const S=this.painter.collectDeferredRenderGpuQueries();setTimeout(()=>{const C=this.painter.queryGpuTimeDeferredRender(S);this.fire(new s.Event("gpu-timing-deferred-render",{gpuTime:C}))},50)}const T=this._sourcesDirty||this._styleDirty||this._placementDirty||x;if(T||this._repaint)this.triggerRepaint();else{const S=!this.isMoving()&&this.loaded();if(S&&(x=this._updateAverageElevation(f,!0)),x)this.triggerRepaint();else if(this._triggerFrame(!1),S&&(this.fire(new s.Event("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){const C=this._calculateSpeedIndex();this.fire(new s.Event("speedindexcompleted",{speedIndex:C})),this.speedIndexTiming=!1}}!this._loaded||this._fullyLoaded||T||(this._fullyLoaded=!0,s.LivePerformanceUtils.mark(s.PerformanceMarkers.fullLoad),this._performanceMetricsCollection&&s.postPerformanceEvent(this._requestManager._customAccessToken,{width:this.painter.width,height:this.painter.height,interactionRange:this._interactionRange,visibilityHidden:this._visibilityHidden,terrainEnabled:!!this.painter.style.getTerrain(),fogEnabled:!!this.painter.style.getFog(),projection:this.getProjection().name,zoom:this.transform.zoom,renderer:this.painter.context.renderer,vendor:this.painter.context.vendor}),this._authenticate())}_forceMarkerAndPopupUpdate(d){for(const o of this._markers)d&&!this.getRenderWorldCopies()&&(o._lngLat=o._lngLat.wrap()),o._update();for(const o of this._popups)!d||this.getRenderWorldCopies()||o._trackPointer||(o._lngLat=o._lngLat.wrap()),o._update()}_updateAverageElevation(d,o=!1){const c=f=>(this.transform.averageElevation=f,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return this.transform.averageElevation!==0&&c(0);if((o||d-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(d)){const f=this.transform.averageElevation;let _=this.transform.sampleAverageElevation(),x=!1;this.transform.elevation&&(x=this.transform.elevation.exaggeration()!==this._averageElevationExaggeration,this._averageElevationExaggeration=this.transform.elevation.exaggeration()),isNaN(_)?_=0:this._averageElevationLastSampledAt=d;const T=Math.abs(f-_);if(T>1){if(this._isInitialLoad||x)return this._averageElevation.jumpTo(_),c(_);this._averageElevation.easeTo(_,d,300)}else if(T>1e-4)return this._averageElevation.jumpTo(_),c(_)}return!!this._averageElevation.isEasing(d)&&c(this._averageElevation.getValue(d))}_authenticate(){s.getMapSessionAPI(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,d=>{if(d&&(d.message===s.AUTH_ERR_MSG||d.status===401)){const o=this.painter.context.gl;s.storeAuthState(o,!1),this._logoControl instanceof cd&&this._logoControl._updateLogo(),o&&o.clear(o.DEPTH_BUFFER_BIT|o.COLOR_BUFFER_BIT|o.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new s.ErrorEvent(new Error("A valid Mapbox access token is required to use Mapbox GL JS. To create an account or a new access token, visit https://account.mapbox.com/")))}}),s.postMapLoadEvent(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,()=>{})}_updateTerrain(){const d=this._isDragging();this.painter.updateTerrain(this.style,d)}_calculateSpeedIndex(){const d=this.painter.canvasCopy(),o=this.painter.getCanvasCopiesAndTimestamps();o.timeStamps.push(performance.now());const c=this.painter.context.gl,f=c.createFramebuffer();function _(x){c.framebufferTexture2D(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,c.TEXTURE_2D,x,0);const T=new Uint8Array(c.drawingBufferWidth*c.drawingBufferHeight*4);return c.readPixels(0,0,c.drawingBufferWidth,c.drawingBufferHeight,c.RGBA,c.UNSIGNED_BYTE,T),T}return c.bindFramebuffer(c.FRAMEBUFFER,f),this._canvasPixelComparison(_(d),o.canvasCopies.map(_),o.timeStamps)}_canvasPixelComparison(d,o,c){let f=c[1]-c[0];const _=d.length/4;for(let x=0;x{const c=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,c&&this._render(o)}))}_preloadTiles(d){const o=this.style?Object.values(this.style._sourceCaches):[];return s.asyncAll(o,(c,f)=>c._preloadTiles(d,f),()=>{this.triggerRepaint()}),this}_onWindowOnline(){this._update()}_onWindowResize(d){this._trackResize&&this.resize({originalEvent:d})._update()}_onVisibilityChange(){s.window.document.visibilityState==="hidden"&&this._visibilityHidden++}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(d){this._showTileBoundaries!==d&&(this._showTileBoundaries=d,this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(d){this._showTerrainWireframe!==d&&(this._showTerrainWireframe=d,this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(d){this._speedIndexTiming!==d&&(this._speedIndexTiming=d,this._update())}get showPadding(){return!!this._showPadding}set showPadding(d){this._showPadding!==d&&(this._showPadding=d,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(d){this._showCollisionBoxes!==d&&(this._showCollisionBoxes=d,d?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(d){this._showOverdrawInspector!==d&&(this._showOverdrawInspector=d,this._update())}get repaint(){return!!this._repaint}set repaint(d){this._repaint!==d&&(this._repaint=d,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(d){this._vertices=d,this._update()}get showTileAABBs(){return!!this._showTileAABBs}set showTileAABBs(d){this._showTileAABBs!==d&&(this._showTileAABBs=d,d&&this._update())}_setCacheLimits(d,o){s.setCacheLimits(d,o)}get version(){return s.version}},NavigationControl:class{constructor(d){this.options=s.extend({},hy,d),this._container=J("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",o=>o.preventDefault()),this.options.showZoom&&(s.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",o=>{this._map&&this._map.zoomIn({},{originalEvent:o})}),J("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",o=>{this._map&&this._map.zoomOut({},{originalEvent:o})}),J("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(s.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",o=>{const c=this._map;c&&(this.options.visualizePitch?c.resetNorthPitch({},{originalEvent:o}):c.resetNorth({},{originalEvent:o}))}),this._compassIcon=J("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const d=this._map;if(!d)return;const o=d.getZoom(),c=o===d.getMaxZoom(),f=o===d.getMinZoom();this._zoomInButton.disabled=c,this._zoomOutButton.disabled=f,this._zoomInButton.setAttribute("aria-disabled",c.toString()),this._zoomOutButton.setAttribute("aria-disabled",f.toString())}_rotateCompassArrow(){const d=this._map;if(!d)return;const o=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(d.transform.pitch*(Math.PI/180)),.5)}) rotateX(${d.transform.pitch}deg) rotateZ(${d.transform.angle*(180/Math.PI)}deg)`:`rotate(${d.transform.angle*(180/Math.PI)}deg)`;d._requestDomTask(()=>{this._compassIcon&&(this._compassIcon.style.transform=o)})}onAdd(d){return this._map=d,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),d.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&d.on("pitch",this._rotateCompassArrow),d.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new dy(d,this._compass,this.options.visualizePitch)),this._container}onRemove(){const d=this._map;d&&(this._container.remove(),this.options.showZoom&&d.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&d.off("pitch",this._rotateCompassArrow),d.off("rotate",this._rotateCompassArrow),this._handler&&this._handler.off(),this._handler=void 0),this._map=void 0)}_createButton(d,o){const c=J("button",d,this._container);return c.type="button",c.addEventListener("click",o),c}_setButtonTitle(d,o){if(!this._map)return;const c=this._map._getUIString(`NavigationControl.${o}`);d.setAttribute("aria-label",c),d.firstElementChild&&d.firstElementChild.setAttribute("title",c)}},GeolocateControl:class extends s.Evented{constructor(d){super(),this.options=s.extend({geolocation:s.window.navigator.geolocation},pd,d),s.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation","_onDeviceOrientation"],this),this._updateMarkerRotationThrottled=Sa(this._updateMarkerRotation,20),this._numberOfWatches=0}onAdd(d){return this._map=d,this._container=J("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkGeolocationSupport(this._setupUI),this._container}onRemove(){this._geolocationWatchID!==void 0&&(this.options.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("zoom",this._onZoom),this._map=void 0,this._numberOfWatches=0,this._noTimeout=!1}_checkGeolocationSupport(d){const o=(c=!!this.options.geolocation)=>{this._supportsGeolocation=c,d(c)};this._supportsGeolocation!==void 0?d(this._supportsGeolocation):s.window.navigator.permissions!==void 0?s.window.navigator.permissions.query({name:"geolocation"}).then(c=>o(c.state!=="denied")).catch(()=>o()):o()}_isOutOfMapMaxBounds(d){const o=this._map.getMaxBounds(),c=d.coords;return!!o&&(c.longitudeo.getEast()||c.latitudeo.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}}_onSuccess(d){if(this._map){if(this._isOutOfMapMaxBounds(d))return this._setErrorState(),this.fire(new s.Event("outofmaxbounds",d)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=d,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(d),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(d),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new s.Event("geolocate",d)),this._finish()}}_updateCamera(d){const o=new s.LngLat(d.coords.longitude,d.coords.latitude),c=d.coords.accuracy,f=this._map.getBearing(),_=s.extend({bearing:f},this.options.fitBoundsOptions);this._map.fitBounds(o.toBounds(c),_,{geolocateSource:!0})}_updateMarker(d){if(d){const o=new s.LngLat(d.coords.longitude,d.coords.latitude);this._accuracyCircleMarker.setLngLat(o).addTo(this._map),this._userLocationDotMarker.setLngLat(o).addTo(this._map),this._accuracy=d.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const d=this._map.transform,o=s.mercatorZfromAltitude(1,d._center.lat)*d.worldSize,c=Math.ceil(2*this._accuracy*o);this._circleElement.style.width=`${c}px`,this._circleElement.style.height=`${c}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_updateMarkerRotation(){this._userLocationDotMarker&&typeof this._heading=="number"?(this._userLocationDotMarker.setRotation(this._heading),this._dotElement.classList.add("mapboxgl-user-location-show-heading")):(this._dotElement.classList.remove("mapboxgl-user-location-show-heading"),this._userLocationDotMarker.setRotation(0))}_onError(d){if(this._map){if(this.options.trackUserLocation)if(d.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const o=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.setAttribute("aria-label",o),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",o),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(d.code===3&&this._noTimeout)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new s.Event("error",d)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(d){if(this._map!==void 0){if(this._container.addEventListener("contextmenu",o=>o.preventDefault()),this._geolocateButton=J("button","mapboxgl-ctrl-geolocate",this._container),J("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",d===!1){s.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");const o=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.setAttribute("aria-label",o),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",o)}else{const o=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.setAttribute("aria-label",o),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",o)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=J("div","mapboxgl-user-location"),this._dotElement.appendChild(J("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(J("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new at({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=J("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new at({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",o=>{o.geolocateSource||this._watchState!=="ACTIVE_LOCK"||o.originalEvent&&o.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this.fire(new s.Event("trackuserlocationend")))})}}_onDeviceOrientation(d){this._userLocationDotMarker&&(d.webkitCompassHeading?this._heading=d.webkitCompassHeading:d.absolute===!0&&(this._heading=-1*d.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return s.warnOnce("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 s.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._numberOfWatches--,this._noTimeout=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new s.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new s.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let d;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._numberOfWatches++,this._numberOfWatches>1?(d={maximumAge:6e5,timeout:0},this._noTimeout=!0):(d=this.options.positionOptions,this._noTimeout=!1),this._geolocationWatchID=this.options.geolocation.watchPosition(this._onSuccess,this._onError,d),this.options.showUserHeading&&this._addDeviceOrientationListener()}}else this.options.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_addDeviceOrientationListener(){const d=()=>{s.window.addEventListener("ondeviceorientationabsolute"in s.window?"deviceorientationabsolute":"deviceorientation",this._onDeviceOrientation)};s.window.DeviceMotionEvent!==void 0&&typeof s.window.DeviceMotionEvent.requestPermission=="function"?DeviceOrientationEvent.requestPermission().then(o=>{o==="granted"&&d()}).catch(console.error):d()}_clearWatch(){this.options.geolocation.clearWatch(this._geolocationWatchID),s.window.removeEventListener("deviceorientation",this._onDeviceOrientation),s.window.removeEventListener("deviceorientationabsolute",this._onDeviceOrientation),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:dt,ScaleControl:class{constructor(d){this.options=s.extend({},fd,d),this._isNumberFormatSupported=function(){try{return new Intl.NumberFormat("en",{style:"unit",unitDisplay:"short",unit:"meter"}),!0}catch{return!1}}(),s.bindAll(["_update","_setScale","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_update(){const d=this.options.maxWidth||100,o=this._map,c=o._containerHeight/2,f=o._containerWidth/2-d/2,_=o.unproject([f,c]),x=o.unproject([f+d,c]),T=_.distanceTo(x);if(this.options.unit==="imperial"){const S=3.2808*T;S>5280?this._setScale(d,S/5280,"mile"):this._setScale(d,S,"foot")}else this.options.unit==="nautical"?this._setScale(d,T/1852,"nautical-mile"):T>=1e3?this._setScale(d,T/1e3,"kilometer"):this._setScale(d,T,"meter")}_setScale(d,o,c){this._map._requestDomTask(()=>{const f=function(x){const T=Math.pow(10,`${Math.floor(x)}`.length-1);let S=x/T;return S=S>=10?10:S>=5?5:S>=3?3:S>=2?2:S>=1?1:function(C){const z=Math.pow(10,Math.ceil(-Math.log(C)/Math.LN10));return Math.round(C*z)/z}(S),T*S}(o),_=f/o;this._container.innerHTML=this._isNumberFormatSupported&&c!=="nautical-mile"?new Intl.NumberFormat(this._language,{style:"unit",unitDisplay:"short",unit:c}).format(f):`${f} ${md[c]}`,this._container.style.width=d*_+"px"})}onAdd(d){return this._map=d,this._language=d.getLanguage(),this._container=J("div","mapboxgl-ctrl mapboxgl-ctrl-scale",d.getContainer()),this._container.dir="auto",this._map.on("move",this._update),this._update(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._update),this._map=void 0}_setLanguage(d){this._language=d,this._update()}setUnit(d){this.options.unit=d,this._update()}},FullscreenControl:class{constructor(d){this._fullscreen=!1,d&&d.container&&(d.container instanceof s.window.HTMLElement?this._container=d.container:s.warnOnce("Full screen control 'container' must be a DOM element.")),s.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in s.window.document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in s.window.document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(d){return this._map=d,this._container||(this._container=this._map.getContainer()),this._controlContainer=J("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",s.warnOnce("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,s.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!s.window.document.fullscreenEnabled&&!s.window.document.webkitFullscreenEnabled)}_setupUI(){const d=this._fullscreenButton=J("button","mapboxgl-ctrl-fullscreen",this._controlContainer);J("span","mapboxgl-ctrl-icon",d).setAttribute("aria-hidden","true"),d.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),s.window.document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const d=this._getTitle();this._fullscreenButton.setAttribute("aria-label",d),this._fullscreenButton.firstElementChild&&this._fullscreenButton.firstElementChild.setAttribute("title",d)}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(s.window.document.fullscreenElement||s.window.document.webkitFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?s.window.document.exitFullscreen?s.window.document.exitFullscreen():s.window.document.webkitCancelFullScreen&&s.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},Popup:class extends s.Evented{constructor(d){super(),this.options=s.extend(Object.create(hd),d),s.bindAll(["_update","_onClose","remove","_onMouseEvent"],this),this._classList=new Set(d&&d.className?d.className.trim().split(/\s+/):[])}addTo(d){return this._map&&this.remove(),this._map=d,this.options.closeOnClick&&d.on("preclick",this._onClose),this.options.closeOnMove&&d.on("move",this._onClose),d.on("remove",this.remove),this._update(),d._addPopup(this),this._focusFirstElement(),this._trackPointer?(d.on("mousemove",this._onMouseEvent),d.on("mouseup",this._onMouseEvent),d._canvasContainer.classList.add("mapboxgl-track-pointer")):d.on("move",this._update),this.fire(new s.Event("open")),this}isOpen(){return!!this._map}remove(){this._content&&this._content.remove(),this._container&&(this._container.remove(),this._container=void 0);const d=this._map;return d&&(d.off("move",this._update),d.off("move",this._onClose),d.off("preclick",this._onClose),d.off("click",this._onClose),d.off("remove",this.remove),d.off("mousemove",this._onMouseEvent),d.off("mouseup",this._onMouseEvent),d.off("drag",this._onMouseEvent),d._canvasContainer&&d._canvasContainer.classList.remove("mapboxgl-track-pointer"),d._removePopup(this),this._map=void 0),this.fire(new s.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(d){this._lngLat=s.LngLat.convert(d),this._pos=null,this._trackPointer=!1,this._update();const o=this._map;return o&&(o.on("move",this._update),o.off("mousemove",this._onMouseEvent),o._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}trackPointer(){this._trackPointer=!0,this._pos=null,this._update();const d=this._map;return d&&(d.off("move",this._update),d.on("mousemove",this._onMouseEvent),d.on("drag",this._onMouseEvent),d._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(d){return this.setDOMContent(s.window.document.createTextNode(d))}setHTML(d){const o=s.window.document.createDocumentFragment(),c=s.window.document.createElement("body");let f;for(c.innerHTML=d;f=c.firstChild,f;)o.appendChild(f);return this.setDOMContent(o)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(d){return this.options.maxWidth=d,this._update(),this}setDOMContent(d){let o=this._content;if(o)for(;o.hasChildNodes();)o.firstChild&&o.removeChild(o.firstChild);else o=this._content=J("div","mapboxgl-popup-content",this._container||void 0);if(o.appendChild(d),this.options.closeButton){const c=this._closeButton=J("button","mapboxgl-popup-close-button",o);c.type="button",c.setAttribute("aria-label","Close popup"),c.setAttribute("aria-hidden","true"),c.innerHTML="×",c.addEventListener("click",this._onClose)}return this._update(),this._focusFirstElement(),this}addClassName(d){return this._classList.add(d),this._updateClassList(),this}removeClassName(d){return this._classList.delete(d),this._updateClassList(),this}setOffset(d){return this.options.offset=d,this._update(),this}toggleClassName(d){let o;return this._classList.delete(d)?o=!1:(this._classList.add(d),o=!0),this._updateClassList(),o}_onMouseEvent(d){this._update(d.point)}_getAnchor(d){if(this.options.anchor)return this.options.anchor;const o=this._map,c=this._container,f=this._pos;if(!o||!c||!f)return"bottom";const _=c.offsetWidth,x=c.offsetHeight,T=f.x<_/2,S=f.x>o.transform.width-_/2;if(f.y+do.transform.height-x){if(T)return"bottom-left";if(S)return"bottom-right"}return T?"left":S?"right":"bottom"}_updateClassList(){const d=this._container;if(!d)return;const o=[...this._classList];o.push("mapboxgl-popup"),this._anchor&&o.push(`mapboxgl-popup-anchor-${this._anchor}`),this._trackPointer&&o.push("mapboxgl-popup-track-pointer"),d.className=o.join(" ")}_update(d){const o=this._map,c=this._content;if(!o||!this._lngLat&&!this._trackPointer||!c)return;let f=this._container;if(f||(f=this._container=J("div","mapboxgl-popup",o.getContainer()),this._tip=J("div","mapboxgl-popup-tip",f),f.appendChild(c)),this.options.maxWidth&&f.style.maxWidth!==this.options.maxWidth&&(f.style.maxWidth=this.options.maxWidth),o.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Ia(this._lngLat,this._pos,o.transform)),!this._trackPointer||d){const _=this._pos=this._trackPointer&&d?d:o.project(this._lngLat),x=Wf(this.options.offset),T=this._anchor=this._getAnchor(x.y),S=Wf(this.options.offset,T),C=_.add(S).round();o._requestDomTask(()=>{this._container&&T&&(this._container.style.transform=`${Os[T]} translate(${C.x}px,${C.y}px)`)})}if(!this._marker&&o._showingGlobe()){const _=s.isLngLatBehindGlobe(o.transform,this._lngLat)?0:1;this._setOpacity(_)}this._updateClassList()}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const d=this._container.querySelector(uy);d&&d.focus()}_onClose(){this.remove()}_setOpacity(d){this._container&&(this._container.style.opacity=`${d}`),this._content&&(this._content.style.pointerEvents=d?"auto":"none")}},Marker:at,Style:to,LngLat:s.LngLat,LngLatBounds:s.LngLatBounds,Point:s.Point,MercatorCoordinate:s.MercatorCoordinate,FreeCameraOptions:Pf,Evented:s.Evented,config:s.config,prewarm:function(){ha().acquire(Ji)},clearPrewarmedResources:function(){const d=Or;d&&(d.isPreloaded()&&d.numActive()===1?(d.release(Ji),Or=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()"))},get accessToken(){return s.config.ACCESS_TOKEN},set accessToken(d){s.config.ACCESS_TOKEN=d},get baseApiUrl(){return s.config.API_URL},set baseApiUrl(d){s.config.API_URL=d},get workerCount(){return hr.workerCount},set workerCount(d){hr.workerCount=d},get maxParallelImageRequests(){return s.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(d){s.config.MAX_PARALLEL_IMAGE_REQUESTS=d},clearStorage(d){s.clearTileCache(d)},workerUrl:"",workerClass:null,setNow:s.exported.setNow,restoreNow:s.exported.restoreNow};return ka});var E=m;return E})})(rk);var Vx=rk.exports;const TU=g1(Vx),SU=LP({__proto__:null,default:TU},[Vx]);const lv="pk.eyJ1IjoicnVyYWxpbm5vIiwiYSI6ImNqeHl0cW0xODBlMm0zY2x0dXltYzRuazUifQ.zZBovoCHzLIW0wCZveEKzA",HT="/examples/who-wins-b2s/rural_places_5000_plus.json",AU=wU({typography:{fontFamily:"Montserrat"},palette:{primary:{main:"#00835D",light:"#A3E2B5",dark:"#26535C",contrastText:"white"}}});function CU(){var m;const e=ut.useContext(QC),n=ut.useRef(null),l=ut.useMemo(()=>new Vx.Popup().setText("Hello world!"),[]);ut.useCallback(()=>{var v;(v=n.current)==null||v.togglePopup()},[]);let h=!1;return ut.useEffect(()=>{if(e&&!e.data.hasOwnProperty("placeData")&&!h){console.log("Initial place data fetch..."),console.log(HT),h=!0;const v=window.document.getElementById("info-wrapper");v!==null&&(v.style.opacity="1.0",v.style.position="absolute",v.style.background=`rgba(46, 60, 67, 0.5) url('${e.baseURL}/images/loading.gif') no-repeat fixed center`,v.style.backgroundSize="20px"),e.setData({...(e==null?void 0:e.data)||{},placeData:null}),e==null||e.apiClient.get(HT).then(E=>{E&&E.hasOwnProperty("data")&&(console.log("Data result:",E.data.features),e.setData({...e.data,placeData:E.data.features}),h=!1,v!==null&&(v.style.opacity="0.0",v.style.pointerEvents="none",setTimeout(()=>{v.style.background="transparent"},533)))}).catch(E=>{console.error("Error fetching data:",E),h=!1,v!==null&&(v.style.opacity="0.0",v.style.pointerEvents="none",setTimeout(()=>{v.style.background="transparent"},533))})}},[e==null?void 0:e.data]),ut.createElement(EU,{theme:AU},ut.createElement("div",{className:"slippy-map"},ut.createElement(QO,{mapboxAccessToken:lv,initialViewState:{latitude:40,longitude:-100,pitch:45,zoom:3.5},style:{width:600,height:400},mapStyle:`https://api.mapbox.com/styles/v1/ruralinno/cl010e7b7001p15pe3l0306hv?access_token=${lv}`},!!(e!=null&&e.data)&&!!((m=e==null?void 0:e.data)!=null&&m.placeData)&&e.data.placeData.length>0&&!!n&&typeof n!==void 0&&ut.createElement(eI,{longitude:-122.4,latitude:37.8,color:"red",popup:l,ref:n}),ut.createElement(uF,{mapboxAccessToken:lv,position:"top-right"}),ut.createElement(t4,{position:"top-right"}),ut.createElement(e4,{position:"top-right"}),ut.createElement(n4,{position:"bottom-left",unit:"imperial"}))),ut.createElement("div",{id:"info-wrapper",style:{pointerEvents:"none",position:"absolute",top:0,minWidth:"100vw",minHeight:"100vh",transition:"opacity 5.05s ease-in-out 0.025s",opacity:"initial",background:"transparent",backgroundSize:"20px",zIndex:100}}))}const IU="https://cori-risi-apps.s3.amazonaws.com";function kU(e){sC(e).render(ut.createElement(ut.StrictMode,null,ut.createElement(bO,{baseURL:IU},ut.createElement(CU,null))))}kU(document.getElementById("app")); diff --git a/assets/index-27cfc78e.js b/assets/index-27cfc78e.js deleted file mode 100644 index d5a4954..0000000 --- a/assets/index-27cfc78e.js +++ /dev/null @@ -1,32 +0,0 @@ -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(l){if(l.ep)return;l.ep=!0;const o=n(l);fetch(l.href,o)}})();var rs={exports:{}},T={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Gn=Symbol.for("react.element"),hc=Symbol.for("react.portal"),vc=Symbol.for("react.fragment"),yc=Symbol.for("react.strict_mode"),gc=Symbol.for("react.profiler"),wc=Symbol.for("react.provider"),Sc=Symbol.for("react.context"),kc=Symbol.for("react.forward_ref"),Ec=Symbol.for("react.suspense"),_c=Symbol.for("react.memo"),Cc=Symbol.for("react.lazy"),Ui=Symbol.iterator;function xc(e){return e===null||typeof e!="object"?null:(e=Ui&&e[Ui]||e["@@iterator"],typeof e=="function"?e:null)}var ls={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},os=Object.assign,is={};function un(e,t,n){this.props=e,this.context=t,this.refs=is,this.updater=n||ls}un.prototype.isReactComponent={};un.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};un.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function us(){}us.prototype=un.prototype;function Bo(e,t,n){this.props=e,this.context=t,this.refs=is,this.updater=n||ls}var Ho=Bo.prototype=new us;Ho.constructor=Bo;os(Ho,un.prototype);Ho.isPureReactComponent=!0;var Ai=Array.isArray,ss=Object.prototype.hasOwnProperty,Wo={current:null},as={key:!0,ref:!0,__self:!0,__source:!0};function cs(e,t,n){var r,l={},o=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(o=""+t.key),t)ss.call(t,r)&&!as.hasOwnProperty(r)&&(l[r]=t[r]);var u=arguments.length-2;if(u===1)l.children=n;else if(1>>1,X=_[W];if(0>>1;Wl(kl,L))ytl(rr,kl)?(_[W]=rr,_[yt]=L,W=yt):(_[W]=kl,_[vt]=L,W=vt);else if(ytl(rr,L))_[W]=rr,_[yt]=L,W=yt;else break e}}return N}function l(_,N){var L=_.sortIndex-N.sortIndex;return L!==0?L:_.id-N.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,u=i.now();e.unstable_now=function(){return i.now()-u}}var s=[],a=[],p=1,h=null,m=3,g=!1,w=!1,k=!1,D=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,c=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function d(_){for(var N=n(a);N!==null;){if(N.callback===null)r(a);else if(N.startTime<=_)r(a),N.sortIndex=N.expirationTime,t(s,N);else break;N=n(a)}}function v(_){if(k=!1,d(_),!w)if(n(s)!==null)w=!0,wl(S);else{var N=n(a);N!==null&&Sl(v,N.startTime-_)}}function S(_,N){w=!1,k&&(k=!1,f(z),z=-1),g=!0;var L=m;try{for(d(N),h=n(s);h!==null&&(!(h.expirationTime>N)||_&&!Pe());){var W=h.callback;if(typeof W=="function"){h.callback=null,m=h.priorityLevel;var X=W(h.expirationTime<=N);N=e.unstable_now(),typeof X=="function"?h.callback=X:h===n(s)&&r(s),d(N)}else r(s);h=n(s)}if(h!==null)var nr=!0;else{var vt=n(a);vt!==null&&Sl(v,vt.startTime-N),nr=!1}return nr}finally{h=null,m=L,g=!1}}var x=!1,P=null,z=-1,H=5,R=-1;function Pe(){return!(e.unstable_now()-R_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):H=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return n(s)},e.unstable_next=function(_){switch(m){case 1:case 2:case 3:var N=3;break;default:N=m}var L=m;m=N;try{return _()}finally{m=L}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(_,N){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var L=m;m=_;try{return N()}finally{m=L}},e.unstable_scheduleCallback=function(_,N,L){var W=e.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0W?(_.sortIndex=L,t(a,_),n(s)===null&&_===n(a)&&(k?(f(z),z=-1):k=!0,Sl(v,L-W))):(_.sortIndex=X,t(s,_),w||g||(w=!0,wl(S))),_},e.unstable_shouldYield=Pe,e.unstable_wrapCallback=function(_){var N=m;return function(){var L=m;m=N;try{return _.apply(this,arguments)}finally{m=L}}}})(ms);ps.exports=ms;var Tc=ps.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Rc=C,ye=Tc;function y(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Xl=Object.prototype.hasOwnProperty,Mc=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Vi={},Bi={};function Oc(e){return Xl.call(Bi,e)?!0:Xl.call(Vi,e)?!1:Mc.test(e)?Bi[e]=!0:(Vi[e]=!0,!1)}function Dc(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Fc(e,t,n,r){if(t===null||typeof t>"u"||Dc(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function se(e,t,n,r,l,o,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=i}var ee={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ee[e]=new se(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ee[t]=new se(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ee[e]=new se(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ee[e]=new se(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ee[e]=new se(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ee[e]=new se(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ee[e]=new se(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ee[e]=new se(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ee[e]=new se(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ko=/[\-:]([a-z])/g;function Yo(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Ko,Yo);ee[t]=new se(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Ko,Yo);ee[t]=new se(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Ko,Yo);ee[t]=new se(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ee[e]=new se(e,1,!1,e.toLowerCase(),null,!1,!1)});ee.xlinkHref=new se("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ee[e]=new se(e,1,!1,e.toLowerCase(),null,!0,!0)});function Zo(e,t,n,r){var l=ee.hasOwnProperty(t)?ee[t]:null;(l!==null?l.type!==0:r||!(2u||l[i]!==o[u]){var s=` -`+l[i].replace(" at new "," at ");return e.displayName&&s.includes("")&&(s=s.replace("",e.displayName)),s}while(1<=i&&0<=u);break}}}finally{Cl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Sn(e):""}function Ic(e){switch(e.tag){case 5:return Sn(e.type);case 16:return Sn("Lazy");case 13:return Sn("Suspense");case 19:return Sn("SuspenseList");case 0:case 2:case 15:return e=xl(e.type,!1),e;case 11:return e=xl(e.type.render,!1),e;case 1:return e=xl(e.type,!0),e;default:return""}}function bl(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ft:return"Fragment";case Dt:return"Portal";case Gl:return"Profiler";case Xo:return"StrictMode";case Jl:return"Suspense";case ql:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ys:return(e.displayName||"Context")+".Consumer";case vs:return(e._context.displayName||"Context")+".Provider";case Go:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Jo:return t=e.displayName||null,t!==null?t:bl(e.type)||"Memo";case Je:t=e._payload,e=e._init;try{return bl(e(t))}catch{}}return null}function jc(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return bl(t);case 8:return t===Xo?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ft(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ws(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Uc(e){var t=ws(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(i){r=""+i,o.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ir(e){e._valueTracker||(e._valueTracker=Uc(e))}function Ss(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ws(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Or(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function eo(e,t){var n=t.checked;return V({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Wi(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ft(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function ks(e,t){t=t.checked,t!=null&&Zo(e,"checked",t,!1)}function to(e,t){ks(e,t);var n=ft(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?no(e,t.type,n):t.hasOwnProperty("defaultValue")&&no(e,t.type,ft(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Qi(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function no(e,t,n){(t!=="number"||Or(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var kn=Array.isArray;function Kt(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=ur.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Dn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Cn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ac=["Webkit","ms","Moz","O"];Object.keys(Cn).forEach(function(e){Ac.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Cn[t]=Cn[e]})});function xs(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Cn.hasOwnProperty(e)&&Cn[e]?(""+t).trim():t+"px"}function Ps(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=xs(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var $c=V({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function oo(e,t){if(t){if($c[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(y(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(y(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(y(61))}if(t.style!=null&&typeof t.style!="object")throw Error(y(62))}}function io(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var uo=null;function qo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var so=null,Yt=null,Zt=null;function Zi(e){if(e=bn(e)){if(typeof so!="function")throw Error(y(280));var t=e.stateNode;t&&(t=ul(t),so(e.stateNode,e.type,t))}}function zs(e){Yt?Zt?Zt.push(e):Zt=[e]:Yt=e}function Ns(){if(Yt){var e=Yt,t=Zt;if(Zt=Yt=null,Zi(e),t)for(e=0;e>>=0,e===0?32:31-(Jc(e)/qc|0)|0}var sr=64,ar=4194304;function En(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function jr(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,o=e.pingedLanes,i=n&268435455;if(i!==0){var u=i&~l;u!==0?r=En(u):(o&=i,o!==0&&(r=En(o)))}else i=n&~l,i!==0?r=En(i):o!==0&&(r=En(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,o=t&-t,l>=o||l===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Jn(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Re(t),e[t]=n}function nf(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Pn),ru=String.fromCharCode(32),lu=!1;function Zs(e,t){switch(e){case"keyup":return Rf.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xs(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var It=!1;function Of(e,t){switch(e){case"compositionend":return Xs(t);case"keypress":return t.which!==32?null:(lu=!0,ru);case"textInput":return e=t.data,e===ru&&lu?null:e;default:return null}}function Df(e,t){if(It)return e==="compositionend"||!ii&&Zs(e,t)?(e=Ks(),Cr=ri=tt=null,It=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=su(n)}}function bs(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?bs(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ea(){for(var e=window,t=Or();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Or(e.document)}return t}function ui(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Hf(e){var t=ea(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&bs(n.ownerDocument.documentElement,n)){if(r!==null&&ui(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,o=Math.min(r.start,l);r=r.end===void 0?o:Math.min(r.end,l),!e.extend&&o>r&&(l=r,r=o,o=l),l=au(n,o);var i=au(n,r);l&&i&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,jt=null,ho=null,Nn=null,vo=!1;function cu(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;vo||jt==null||jt!==Or(r)||(r=jt,"selectionStart"in r&&ui(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Nn&&$n(Nn,r)||(Nn=r,r=$r(ho,"onSelect"),0$t||(e.current=Eo[$t],Eo[$t]=null,$t--)}function F(e,t){$t++,Eo[$t]=e.current,e.current=t}var dt={},le=mt(dt),fe=mt(!1),xt=dt;function bt(e,t){var n=e.type.contextTypes;if(!n)return dt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},o;for(o in n)l[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function de(e){return e=e.childContextTypes,e!=null}function Br(){j(fe),j(le)}function yu(e,t,n){if(le.current!==dt)throw Error(y(168));F(le,t),F(fe,n)}function aa(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(y(108,jc(e)||"Unknown",l));return V({},n,r)}function Hr(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||dt,xt=le.current,F(le,e),F(fe,fe.current),!0}function gu(e,t,n){var r=e.stateNode;if(!r)throw Error(y(169));n?(e=aa(e,t,xt),r.__reactInternalMemoizedMergedChildContext=e,j(fe),j(le),F(le,e)):j(fe),F(fe,n)}var $e=null,sl=!1,Al=!1;function ca(e){$e===null?$e=[e]:$e.push(e)}function td(e){sl=!0,ca(e)}function ht(){if(!Al&&$e!==null){Al=!0;var e=0,t=O;try{var n=$e;for(O=1;e>=i,l-=i,Be=1<<32-Re(t)+l|n<z?(H=P,P=null):H=P.sibling;var R=m(f,P,d[z],v);if(R===null){P===null&&(P=H);break}e&&P&&R.alternate===null&&t(f,P),c=o(R,c,z),x===null?S=R:x.sibling=R,x=R,P=H}if(z===d.length)return n(f,P),U&>(f,z),S;if(P===null){for(;zz?(H=P,P=null):H=P.sibling;var Pe=m(f,P,R.value,v);if(Pe===null){P===null&&(P=H);break}e&&P&&Pe.alternate===null&&t(f,P),c=o(Pe,c,z),x===null?S=Pe:x.sibling=Pe,x=Pe,P=H}if(R.done)return n(f,P),U&>(f,z),S;if(P===null){for(;!R.done;z++,R=d.next())R=h(f,R.value,v),R!==null&&(c=o(R,c,z),x===null?S=R:x.sibling=R,x=R);return U&>(f,z),S}for(P=r(f,P);!R.done;z++,R=d.next())R=g(P,f,z,R.value,v),R!==null&&(e&&R.alternate!==null&&P.delete(R.key===null?z:R.key),c=o(R,c,z),x===null?S=R:x.sibling=R,x=R);return e&&P.forEach(function(cn){return t(f,cn)}),U&>(f,z),S}function D(f,c,d,v){if(typeof d=="object"&&d!==null&&d.type===Ft&&d.key===null&&(d=d.props.children),typeof d=="object"&&d!==null){switch(d.$$typeof){case or:e:{for(var S=d.key,x=c;x!==null;){if(x.key===S){if(S=d.type,S===Ft){if(x.tag===7){n(f,x.sibling),c=l(x,d.props.children),c.return=f,f=c;break e}}else if(x.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Je&&ku(S)===x.type){n(f,x.sibling),c=l(x,d.props),c.ref=yn(f,x,d),c.return=f,f=c;break e}n(f,x);break}else t(f,x);x=x.sibling}d.type===Ft?(c=Ct(d.props.children,f.mode,v,d.key),c.return=f,f=c):(v=Mr(d.type,d.key,d.props,null,f.mode,v),v.ref=yn(f,c,d),v.return=f,f=v)}return i(f);case Dt:e:{for(x=d.key;c!==null;){if(c.key===x)if(c.tag===4&&c.stateNode.containerInfo===d.containerInfo&&c.stateNode.implementation===d.implementation){n(f,c.sibling),c=l(c,d.children||[]),c.return=f,f=c;break e}else{n(f,c);break}else t(f,c);c=c.sibling}c=Yl(d,f.mode,v),c.return=f,f=c}return i(f);case Je:return x=d._init,D(f,c,x(d._payload),v)}if(kn(d))return w(f,c,d,v);if(dn(d))return k(f,c,d,v);vr(f,d)}return typeof d=="string"&&d!==""||typeof d=="number"?(d=""+d,c!==null&&c.tag===6?(n(f,c.sibling),c=l(c,d),c.return=f,f=c):(n(f,c),c=Kl(d,f.mode,v),c.return=f,f=c),i(f)):n(f,c)}return D}var tn=ma(!0),ha=ma(!1),Kr=mt(null),Yr=null,Ht=null,fi=null;function di(){fi=Ht=Yr=null}function pi(e){var t=Kr.current;j(Kr),e._currentValue=t}function xo(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Gt(e,t){Yr=e,fi=Ht=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ce=!0),e.firstContext=null)}function Ce(e){var t=e._currentValue;if(fi!==e)if(e={context:e,memoizedValue:t,next:null},Ht===null){if(Yr===null)throw Error(y(308));Ht=e,Yr.dependencies={lanes:0,firstContext:e}}else Ht=Ht.next=e;return t}var kt=null;function mi(e){kt===null?kt=[e]:kt.push(e)}function va(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,mi(t)):(n.next=l.next,l.next=n),t.interleaved=n,Ye(e,r)}function Ye(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var qe=!1;function hi(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ya(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function We(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ut(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,M&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,Ye(e,n)}return l=r.interleaved,l===null?(t.next=t,mi(r)):(t.next=l.next,l.next=t),r.interleaved=t,Ye(e,n)}function Pr(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ei(e,n)}}function Eu(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?l=o=i:o=o.next=i,n=n.next}while(n!==null);o===null?l=o=t:o=o.next=t}else l=o=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Zr(e,t,n,r){var l=e.updateQueue;qe=!1;var o=l.firstBaseUpdate,i=l.lastBaseUpdate,u=l.shared.pending;if(u!==null){l.shared.pending=null;var s=u,a=s.next;s.next=null,i===null?o=a:i.next=a,i=s;var p=e.alternate;p!==null&&(p=p.updateQueue,u=p.lastBaseUpdate,u!==i&&(u===null?p.firstBaseUpdate=a:u.next=a,p.lastBaseUpdate=s))}if(o!==null){var h=l.baseState;i=0,p=a=s=null,u=o;do{var m=u.lane,g=u.eventTime;if((r&m)===m){p!==null&&(p=p.next={eventTime:g,lane:0,tag:u.tag,payload:u.payload,callback:u.callback,next:null});e:{var w=e,k=u;switch(m=t,g=n,k.tag){case 1:if(w=k.payload,typeof w=="function"){h=w.call(g,h,m);break e}h=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=k.payload,m=typeof w=="function"?w.call(g,h,m):w,m==null)break e;h=V({},h,m);break e;case 2:qe=!0}}u.callback!==null&&u.lane!==0&&(e.flags|=64,m=l.effects,m===null?l.effects=[u]:m.push(u))}else g={eventTime:g,lane:m,tag:u.tag,payload:u.payload,callback:u.callback,next:null},p===null?(a=p=g,s=h):p=p.next=g,i|=m;if(u=u.next,u===null){if(u=l.shared.pending,u===null)break;m=u,u=m.next,m.next=null,l.lastBaseUpdate=m,l.shared.pending=null}}while(1);if(p===null&&(s=h),l.baseState=s,l.firstBaseUpdate=a,l.lastBaseUpdate=p,t=l.shared.interleaved,t!==null){l=t;do i|=l.lane,l=l.next;while(l!==t)}else o===null&&(l.shared.lanes=0);Nt|=i,e.lanes=i,e.memoizedState=h}}function _u(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Vl.transition;Vl.transition={};try{e(!1),t()}finally{O=n,Vl.transition=r}}function Da(){return xe().memoizedState}function od(e,t,n){var r=at(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Fa(e))Ia(t,n);else if(n=va(e,t,n,r),n!==null){var l=ie();Me(n,e,r,l),ja(n,t,r)}}function id(e,t,n){var r=at(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Fa(e))Ia(t,l);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var i=t.lastRenderedState,u=o(i,n);if(l.hasEagerState=!0,l.eagerState=u,Oe(u,i)){var s=t.interleaved;s===null?(l.next=l,mi(t)):(l.next=s.next,s.next=l),t.interleaved=l;return}}catch{}finally{}n=va(e,t,l,r),n!==null&&(l=ie(),Me(n,e,r,l),ja(n,t,r))}}function Fa(e){var t=e.alternate;return e===$||t!==null&&t===$}function Ia(e,t){Ln=Gr=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ja(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ei(e,n)}}var Jr={readContext:Ce,useCallback:te,useContext:te,useEffect:te,useImperativeHandle:te,useInsertionEffect:te,useLayoutEffect:te,useMemo:te,useReducer:te,useRef:te,useState:te,useDebugValue:te,useDeferredValue:te,useTransition:te,useMutableSource:te,useSyncExternalStore:te,useId:te,unstable_isNewReconciler:!1},ud={readContext:Ce,useCallback:function(e,t){return Fe().memoizedState=[e,t===void 0?null:t],e},useContext:Ce,useEffect:xu,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Nr(4194308,4,La.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Nr(4194308,4,e,t)},useInsertionEffect:function(e,t){return Nr(4,2,e,t)},useMemo:function(e,t){var n=Fe();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Fe();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=od.bind(null,$,e),[r.memoizedState,e]},useRef:function(e){var t=Fe();return e={current:e},t.memoizedState=e},useState:Cu,useDebugValue:_i,useDeferredValue:function(e){return Fe().memoizedState=e},useTransition:function(){var e=Cu(!1),t=e[0];return e=ld.bind(null,e[1]),Fe().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=$,l=Fe();if(U){if(n===void 0)throw Error(y(407));n=n()}else{if(n=t(),J===null)throw Error(y(349));zt&30||ka(r,t,n)}l.memoizedState=n;var o={value:n,getSnapshot:t};return l.queue=o,xu(_a.bind(null,r,o,e),[e]),r.flags|=2048,Zn(9,Ea.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Fe(),t=J.identifierPrefix;if(U){var n=He,r=Be;n=(r&~(1<<32-Re(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Kn++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[Ie]=t,e[Hn]=r,Ya(e,t,!1,!1),t.stateNode=e;e:{switch(i=io(n,r),n){case"dialog":I("cancel",e),I("close",e),l=r;break;case"iframe":case"object":case"embed":I("load",e),l=r;break;case"video":case"audio":for(l=0;l<_n.length;l++)I(_n[l],e);l=r;break;case"source":I("error",e),l=r;break;case"img":case"image":case"link":I("error",e),I("load",e),l=r;break;case"details":I("toggle",e),l=r;break;case"input":Wi(e,r),l=eo(e,r),I("invalid",e);break;case"option":l=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},l=V({},r,{value:void 0}),I("invalid",e);break;case"textarea":Ki(e,r),l=ro(e,r),I("invalid",e);break;default:l=r}oo(n,l),u=l;for(o in u)if(u.hasOwnProperty(o)){var s=u[o];o==="style"?Ps(e,s):o==="dangerouslySetInnerHTML"?(s=s?s.__html:void 0,s!=null&&Cs(e,s)):o==="children"?typeof s=="string"?(n!=="textarea"||s!=="")&&Dn(e,s):typeof s=="number"&&Dn(e,""+s):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(On.hasOwnProperty(o)?s!=null&&o==="onScroll"&&I("scroll",e):s!=null&&Zo(e,o,s,i))}switch(n){case"input":ir(e),Qi(e,r,!1);break;case"textarea":ir(e),Yi(e);break;case"option":r.value!=null&&e.setAttribute("value",""+ft(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?Kt(e,!!r.multiple,o,!1):r.defaultValue!=null&&Kt(e,!!r.multiple,r.defaultValue,!0);break;default:typeof l.onClick=="function"&&(e.onclick=Vr)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return ne(t),null;case 6:if(e&&t.stateNode!=null)Xa(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(y(166));if(n=Et(Qn.current),Et(Ue.current),hr(t)){if(r=t.stateNode,n=t.memoizedProps,r[Ie]=t,(o=r.nodeValue!==n)&&(e=ve,e!==null))switch(e.tag){case 3:mr(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&mr(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Ie]=t,t.stateNode=r}return ne(t),null;case 13:if(j(A),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(U&&he!==null&&t.mode&1&&!(t.flags&128))pa(),en(),t.flags|=98560,o=!1;else if(o=hr(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(y(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(y(317));o[Ie]=t}else en(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ne(t),o=!1}else Te!==null&&(Vo(Te),Te=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||A.current&1?Z===0&&(Z=3):Ti())),t.updateQueue!==null&&(t.flags|=4),ne(t),null);case 4:return nn(),Oo(e,t),e===null&&Vn(t.stateNode.containerInfo),ne(t),null;case 10:return pi(t.type._context),ne(t),null;case 17:return de(t.type)&&Br(),ne(t),null;case 19:if(j(A),o=t.memoizedState,o===null)return ne(t),null;if(r=(t.flags&128)!==0,i=o.rendering,i===null)if(r)gn(o,!1);else{if(Z!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=Xr(e),i!==null){for(t.flags|=128,gn(o,!1),r=i.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,i=o.alternate,i===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=i.childLanes,o.lanes=i.lanes,o.child=i.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=i.memoizedProps,o.memoizedState=i.memoizedState,o.updateQueue=i.updateQueue,o.type=i.type,e=i.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return F(A,A.current&1|2),t.child}e=e.sibling}o.tail!==null&&Q()>ln&&(t.flags|=128,r=!0,gn(o,!1),t.lanes=4194304)}else{if(!r)if(e=Xr(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),gn(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!U)return ne(t),null}else 2*Q()-o.renderingStartTime>ln&&n!==1073741824&&(t.flags|=128,r=!0,gn(o,!1),t.lanes=4194304);o.isBackwards?(i.sibling=t.child,t.child=i):(n=o.last,n!==null?n.sibling=i:t.child=i,o.last=i)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Q(),t.sibling=null,n=A.current,F(A,r?n&1|2:n&1),t):(ne(t),null);case 22:case 23:return Li(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?me&1073741824&&(ne(t),t.subtreeFlags&6&&(t.flags|=8192)):ne(t),null;case 24:return null;case 25:return null}throw Error(y(156,t.tag))}function hd(e,t){switch(ai(t),t.tag){case 1:return de(t.type)&&Br(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return nn(),j(fe),j(le),gi(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return yi(t),null;case 13:if(j(A),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(y(340));en()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return j(A),null;case 4:return nn(),null;case 10:return pi(t.type._context),null;case 22:case 23:return Li(),null;case 24:return null;default:return null}}var gr=!1,re=!1,vd=typeof WeakSet=="function"?WeakSet:Set,E=null;function Wt(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){B(e,t,r)}else n.current=null}function Do(e,t,n){try{n()}catch(r){B(e,t,r)}}var Iu=!1;function yd(e,t){if(yo=Ur,e=ea(),ui(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var i=0,u=-1,s=-1,a=0,p=0,h=e,m=null;t:for(;;){for(var g;h!==n||l!==0&&h.nodeType!==3||(u=i+l),h!==o||r!==0&&h.nodeType!==3||(s=i+r),h.nodeType===3&&(i+=h.nodeValue.length),(g=h.firstChild)!==null;)m=h,h=g;for(;;){if(h===e)break t;if(m===n&&++a===l&&(u=i),m===o&&++p===r&&(s=i),(g=h.nextSibling)!==null)break;h=m,m=h.parentNode}h=g}n=u===-1||s===-1?null:{start:u,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(go={focusedElem:e,selectionRange:n},Ur=!1,E=t;E!==null;)if(t=E,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,E=e;else for(;E!==null;){t=E;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var k=w.memoizedProps,D=w.memoizedState,f=t.stateNode,c=f.getSnapshotBeforeUpdate(t.elementType===t.type?k:Ne(t.type,k),D);f.__reactInternalSnapshotBeforeUpdate=c}break;case 3:var d=t.stateNode.containerInfo;d.nodeType===1?d.textContent="":d.nodeType===9&&d.documentElement&&d.removeChild(d.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(y(163))}}catch(v){B(t,t.return,v)}if(e=t.sibling,e!==null){e.return=t.return,E=e;break}E=t.return}return w=Iu,Iu=!1,w}function Tn(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var o=l.destroy;l.destroy=void 0,o!==void 0&&Do(t,n,o)}l=l.next}while(l!==r)}}function fl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Fo(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Ga(e){var t=e.alternate;t!==null&&(e.alternate=null,Ga(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ie],delete t[Hn],delete t[ko],delete t[bf],delete t[ed])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Ja(e){return e.tag===5||e.tag===3||e.tag===4}function ju(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ja(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Io(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Vr));else if(r!==4&&(e=e.child,e!==null))for(Io(e,t,n),e=e.sibling;e!==null;)Io(e,t,n),e=e.sibling}function jo(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(jo(e,t,n),e=e.sibling;e!==null;)jo(e,t,n),e=e.sibling}var q=null,Le=!1;function Ge(e,t,n){for(n=n.child;n!==null;)qa(e,t,n),n=n.sibling}function qa(e,t,n){if(je&&typeof je.onCommitFiberUnmount=="function")try{je.onCommitFiberUnmount(rl,n)}catch{}switch(n.tag){case 5:re||Wt(n,t);case 6:var r=q,l=Le;q=null,Ge(e,t,n),q=r,Le=l,q!==null&&(Le?(e=q,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):q.removeChild(n.stateNode));break;case 18:q!==null&&(Le?(e=q,n=n.stateNode,e.nodeType===8?Ul(e.parentNode,n):e.nodeType===1&&Ul(e,n),Un(e)):Ul(q,n.stateNode));break;case 4:r=q,l=Le,q=n.stateNode.containerInfo,Le=!0,Ge(e,t,n),q=r,Le=l;break;case 0:case 11:case 14:case 15:if(!re&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var o=l,i=o.destroy;o=o.tag,i!==void 0&&(o&2||o&4)&&Do(n,t,i),l=l.next}while(l!==r)}Ge(e,t,n);break;case 1:if(!re&&(Wt(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(u){B(n,t,u)}Ge(e,t,n);break;case 21:Ge(e,t,n);break;case 22:n.mode&1?(re=(r=re)||n.memoizedState!==null,Ge(e,t,n),re=r):Ge(e,t,n);break;default:Ge(e,t,n)}}function Uu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new vd),t.forEach(function(r){var l=Pd.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function ze(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=i),r&=~o}if(r=l,r=Q()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*wd(r/1960))-r,10e?16:e,nt===null)var r=!1;else{if(e=nt,nt=null,el=0,M&6)throw Error(y(331));var l=M;for(M|=4,E=e.current;E!==null;){var o=E,i=o.child;if(E.flags&16){var u=o.deletions;if(u!==null){for(var s=0;sQ()-zi?_t(e,0):Pi|=n),pe(e,t)}function ic(e,t){t===0&&(e.mode&1?(t=ar,ar<<=1,!(ar&130023424)&&(ar=4194304)):t=1);var n=ie();e=Ye(e,t),e!==null&&(Jn(e,t,n),pe(e,n))}function xd(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ic(e,n)}function Pd(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(y(314))}r!==null&&r.delete(t),ic(e,n)}var uc;uc=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||fe.current)ce=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ce=!1,pd(e,t,n);ce=!!(e.flags&131072)}else ce=!1,U&&t.flags&1048576&&fa(t,Qr,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Lr(e,t),e=t.pendingProps;var l=bt(t,le.current);Gt(t,n),l=Si(null,t,r,e,l,n);var o=ki();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,de(r)?(o=!0,Hr(t)):o=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,hi(t),l.updater=cl,t.stateNode=l,l._reactInternals=t,zo(t,r,e,n),t=To(null,t,r,!0,o,n)):(t.tag=0,U&&o&&si(t),oe(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Lr(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Nd(r),e=Ne(r,e),l){case 0:t=Lo(null,t,r,e,n);break e;case 1:t=Ou(null,t,r,e,n);break e;case 11:t=Ru(null,t,r,e,n);break e;case 14:t=Mu(null,t,r,Ne(r.type,e),n);break e}throw Error(y(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ne(r,l),Lo(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ne(r,l),Ou(e,t,r,l,n);case 3:e:{if(Wa(t),e===null)throw Error(y(387));r=t.pendingProps,o=t.memoizedState,l=o.element,ya(e,t),Zr(t,r,null,n);var i=t.memoizedState;if(r=i.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){l=rn(Error(y(423)),t),t=Du(e,t,r,n,l);break e}else if(r!==l){l=rn(Error(y(424)),t),t=Du(e,t,r,n,l);break e}else for(he=it(t.stateNode.containerInfo.firstChild),ve=t,U=!0,Te=null,n=ha(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(en(),r===l){t=Ze(e,t,n);break e}oe(e,t,r,n)}t=t.child}return t;case 5:return ga(t),e===null&&Co(t),r=t.type,l=t.pendingProps,o=e!==null?e.memoizedProps:null,i=l.children,wo(r,l)?i=null:o!==null&&wo(r,o)&&(t.flags|=32),Ha(e,t),oe(e,t,i,n),t.child;case 6:return e===null&&Co(t),null;case 13:return Qa(e,t,n);case 4:return vi(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=tn(t,null,r,n):oe(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ne(r,l),Ru(e,t,r,l,n);case 7:return oe(e,t,t.pendingProps,n),t.child;case 8:return oe(e,t,t.pendingProps.children,n),t.child;case 12:return oe(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,o=t.memoizedProps,i=l.value,F(Kr,r._currentValue),r._currentValue=i,o!==null)if(Oe(o.value,i)){if(o.children===l.children&&!fe.current){t=Ze(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var u=o.dependencies;if(u!==null){i=o.child;for(var s=u.firstContext;s!==null;){if(s.context===r){if(o.tag===1){s=We(-1,n&-n),s.tag=2;var a=o.updateQueue;if(a!==null){a=a.shared;var p=a.pending;p===null?s.next=s:(s.next=p.next,p.next=s),a.pending=s}}o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),xo(o.return,n,t),u.lanes|=n;break}s=s.next}}else if(o.tag===10)i=o.type===t.type?null:o.child;else if(o.tag===18){if(i=o.return,i===null)throw Error(y(341));i.lanes|=n,u=i.alternate,u!==null&&(u.lanes|=n),xo(i,n,t),i=o.sibling}else i=o.child;if(i!==null)i.return=o;else for(i=o;i!==null;){if(i===t){i=null;break}if(o=i.sibling,o!==null){o.return=i.return,i=o;break}i=i.return}o=i}oe(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,Gt(t,n),l=Ce(l),r=r(l),t.flags|=1,oe(e,t,r,n),t.child;case 14:return r=t.type,l=Ne(r,t.pendingProps),l=Ne(r.type,l),Mu(e,t,r,l,n);case 15:return Va(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ne(r,l),Lr(e,t),t.tag=1,de(r)?(e=!0,Hr(t)):e=!1,Gt(t,n),Ua(t,r,l),zo(t,r,l,n),To(null,t,r,!0,e,n);case 19:return Ka(e,t,n);case 22:return Ba(e,t,n)}throw Error(y(156,t.tag))};function sc(e,t){return Fs(e,t)}function zd(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ee(e,t,n,r){return new zd(e,t,n,r)}function Ri(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Nd(e){if(typeof e=="function")return Ri(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Go)return 11;if(e===Jo)return 14}return 2}function ct(e,t){var n=e.alternate;return n===null?(n=Ee(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Mr(e,t,n,r,l,o){var i=2;if(r=e,typeof e=="function")Ri(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Ft:return Ct(n.children,l,o,t);case Xo:i=8,l|=8;break;case Gl:return e=Ee(12,n,t,l|2),e.elementType=Gl,e.lanes=o,e;case Jl:return e=Ee(13,n,t,l),e.elementType=Jl,e.lanes=o,e;case ql:return e=Ee(19,n,t,l),e.elementType=ql,e.lanes=o,e;case gs:return pl(n,l,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case vs:i=10;break e;case ys:i=9;break e;case Go:i=11;break e;case Jo:i=14;break e;case Je:i=16,r=null;break e}throw Error(y(130,e==null?e:typeof e,""))}return t=Ee(i,n,t,l),t.elementType=e,t.type=r,t.lanes=o,t}function Ct(e,t,n,r){return e=Ee(7,e,r,t),e.lanes=n,e}function pl(e,t,n,r){return e=Ee(22,e,r,t),e.elementType=gs,e.lanes=n,e.stateNode={isHidden:!1},e}function Kl(e,t,n){return e=Ee(6,e,null,t),e.lanes=n,e}function Yl(e,t,n){return t=Ee(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Ld(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=zl(0),this.expirationTimes=zl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zl(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function Mi(e,t,n,r,l,o,i,u,s){return e=new Ld(e,t,n,u,s),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Ee(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},hi(o),e}function Td(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(dc)}catch(e){console.error(e)}}dc(),ds.exports=ge;var Ii=ds.exports,pc,Ku=Ii;pc=Ku.createRoot,Ku.hydrateRoot;const Fd="modulepreload",Id=function(e){return"/"+e},Yu={},jd=function(t,n,r){if(!n||n.length===0)return t();const l=document.getElementsByTagName("link");return Promise.all(n.map(o=>{if(o=Id(o),o in Yu)return;Yu[o]=!0;const i=o.endsWith(".css"),u=i?'[rel="stylesheet"]':"";if(!!r)for(let p=l.length-1;p>=0;p--){const h=l[p];if(h.href===o&&(!i||h.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${u}`))return;const a=document.createElement("link");if(a.rel=i?"stylesheet":Fd,i||(a.as="script",a.crossOrigin=""),a.href=o,document.head.appendChild(a),i)return new Promise((p,h)=>{a.addEventListener("load",p),a.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${o}`)))})})).then(()=>t()).catch(o=>{const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=o,window.dispatchEvent(i),!i.defaultPrevented)throw o})},Ud=C.createContext(null);function Ad(e,t){const n=Array.isArray(e)?e[0]:e?e.x:0,r=Array.isArray(e)?e[1]:e?e.y:0,l=Array.isArray(t)?t[0]:t?t.x:0,o=Array.isArray(t)?t[1]:t?t.y:0;return n===l&&r===o}function Ve(e,t){if(e===t)return!0;if(!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n{let l=null;"interactive"in r&&(l=Object.assign({},r),delete l.interactive);const o=t[r.ref];if(o){l=l||Object.assign({},r),delete l.ref;for(const i of Vd)i in o&&(l[i]=o[i])}return l||r});return{...e,layers:n}}const qu={version:8,sources:{},layers:[]},bu={mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",click:"onClick",dblclick:"onDblClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mouseout:"onMouseOut",contextmenu:"onContextMenu",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",touchcancel:"onTouchCancel"},Zl={movestart:"onMoveStart",move:"onMove",moveend:"onMoveEnd",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",zoomstart:"onZoomStart",zoom:"onZoom",zoomend:"onZoomEnd",rotatestart:"onRotateStart",rotate:"onRotate",rotateend:"onRotateEnd",pitchstart:"onPitchStart",pitch:"onPitch",pitchend:"onPitchEnd"},es={wheel:"onWheel",boxzoomstart:"onBoxZoomStart",boxzoomend:"onBoxZoomEnd",boxzoomcancel:"onBoxZoomCancel",resize:"onResize",load:"onLoad",render:"onRender",idle:"onIdle",remove:"onRemove",data:"onData",styledata:"onStyleData",sourcedata:"onSourceData",error:"onError"},Bd=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],Hd=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class on{constructor(t,n,r){this._map=null,this._internalUpdate=!1,this._inRender=!1,this._hoveredFeatures=null,this._deferredEvents={move:!1,zoom:!1,pitch:!1,rotate:!1},this._onEvent=l=>{const o=this.props[es[l.type]];o?o(l):l.type==="error"&&console.error(l.error)},this._onPointerEvent=l=>{(l.type==="mousemove"||l.type==="mouseout")&&this._updateHover(l);const o=this.props[bu[l.type]];o&&(this.props.interactiveLayerIds&&l.type!=="mouseover"&&l.type!=="mouseout"&&(l.features=this._hoveredFeatures||this._queryRenderedFeatures(l.point)),o(l),delete l.features)},this._onCameraEvent=l=>{if(!this._internalUpdate){const o=this.props[Zl[l.type]];o&&o(l)}l.type in this._deferredEvents&&(this._deferredEvents[l.type]=!1)},this._MapClass=t,this.props=n,this._initialize(r)}get map(){return this._map}get transform(){return this._renderTransform}setProps(t){const n=this.props;this.props=t;const r=this._updateSettings(t,n);r&&this._createShadowTransform(this._map);const l=this._updateSize(t),o=this._updateViewState(t,!0);this._updateStyle(t,n),this._updateStyleComponents(t,n),this._updateHandlers(t,n),(r||l||o&&!this._map.isMoving())&&this.redraw()}static reuse(t,n){const r=on.savedMaps.pop();if(!r)return null;const l=r.map,o=l.getContainer();for(n.className=o.className;o.childNodes.length>0;)n.appendChild(o.childNodes[0]);l._container=n;const i=l._resizeObserver;i&&(i.disconnect(),i.observe(n)),r.setProps({...t,styleDiffing:!1}),l.resize();const{initialViewState:u}=t;return u&&(u.bounds?l.fitBounds(u.bounds,{...u.fitBoundsOptions,duration:0}):r._updateViewState(u,!1)),l.isStyleLoaded()?l.fire("load"):l.once("styledata",()=>l.fire("load")),l._update(),r}_initialize(t){const{props:n}=this,{mapStyle:r=qu}=n,l={...n,...n.initialViewState,accessToken:n.mapboxAccessToken||Wd()||null,container:t,style:Ju(r)},o=l.initialViewState||l.viewState||l;if(Object.assign(l,{center:[o.longitude||0,o.latitude||0],zoom:o.zoom||0,pitch:o.pitch||0,bearing:o.bearing||0}),n.gl){const p=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=p,n.gl)}const i=new this._MapClass(l);o.padding&&i.setPadding(o.padding),n.cursor&&(i.getCanvas().style.cursor=n.cursor),this._createShadowTransform(i);const u=i._render;i._render=p=>{this._inRender=!0,u.call(i,p),this._inRender=!1};const s=i._renderTaskQueue.run;i._renderTaskQueue.run=p=>{s.call(i._renderTaskQueue,p),this._onBeforeRepaint()},i.on("render",()=>this._onAfterRepaint());const a=i.fire;i.fire=this._fireEvent.bind(this,a),i.on("resize",()=>{this._renderTransform.resize(i.transform.width,i.transform.height)}),i.on("styledata",()=>{this._updateStyleComponents(this.props,{}),Zu(i.transform,this._renderTransform)}),i.on("sourcedata",()=>this._updateStyleComponents(this.props,{}));for(const p in bu)i.on(p,this._onPointerEvent);for(const p in Zl)i.on(p,this._onCameraEvent);for(const p in es)i.on(p,this._onEvent);this._map=i}recycle(){const n=this.map.getContainer().querySelector("[mapboxgl-children]");n==null||n.remove(),on.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const t=this._map;!this._inRender&&t.style&&(t._frame&&(t._frame.cancel(),t._frame=null),t._render())}_createShadowTransform(t){const n=$d(t.transform);t.painter.transform=n,this._renderTransform=n}_updateSize(t){const{viewState:n}=t;if(n){const r=this._map;if(n.width!==r.transform.width||n.height!==r.transform.height)return r.resize(),!0}return!1}_updateViewState(t,n){if(this._internalUpdate)return!1;const r=this._map,l=this._renderTransform,{zoom:o,pitch:i,bearing:u}=l,s=r.isMoving();s&&(l.cameraElevationReference="sea");const a=Gu(l,{...Xu(r.transform),...t});if(s&&(l.cameraElevationReference="ground"),a&&n){const p=this._deferredEvents;p.move=!0,p.zoom||(p.zoom=o!==l.zoom),p.rotate||(p.rotate=u!==l.bearing),p.pitch||(p.pitch=i!==l.pitch)}return s||Gu(r.transform,t),a}_updateSettings(t,n){const r=this._map;let l=!1;for(const o of Bd)if(o in t&&!Ve(t[o],n[o])){l=!0;const i=r[`set${o[0].toUpperCase()}${o.slice(1)}`];i==null||i.call(r,t[o])}return l}_updateStyle(t,n){if(t.cursor!==n.cursor&&(this._map.getCanvas().style.cursor=t.cursor||""),t.mapStyle!==n.mapStyle){const{mapStyle:r=qu,styleDiffing:l=!0}=t,o={diff:l};return"localIdeographFontFamily"in t&&(o.localIdeographFontFamily=t.localIdeographFontFamily),this._map.setStyle(Ju(r),o),!0}return!1}_updateStyleComponents(t,n){const r=this._map;let l=!1;return r.isStyleLoaded()&&("light"in t&&r.setLight&&!Ve(t.light,n.light)&&(l=!0,r.setLight(t.light)),"fog"in t&&r.setFog&&!Ve(t.fog,n.fog)&&(l=!0,r.setFog(t.fog)),"terrain"in t&&r.setTerrain&&!Ve(t.terrain,n.terrain)&&(!t.terrain||r.getSource(t.terrain.source))&&(l=!0,r.setTerrain(t.terrain))),l}_updateHandlers(t,n){var r,l;const o=this._map;let i=!1;for(const u of Hd){const s=(r=t[u])!==null&&r!==void 0?r:!0,a=(l=n[u])!==null&&l!==void 0?l:!0;Ve(s,a)||(i=!0,s?o[u].enable(s):o[u].disable())}return i}_queryRenderedFeatures(t){const n=this._map,r=n.transform,{interactiveLayerIds:l=[]}=this.props;try{return n.transform=this._renderTransform,n.queryRenderedFeatures(t,{layers:l.filter(n.getLayer.bind(n))})}catch{return[]}finally{n.transform=r}}_updateHover(t){var n;const{props:r}=this;if(r.interactiveLayerIds&&(r.onMouseMove||r.onMouseEnter||r.onMouseLeave)){const o=t.type,i=((n=this._hoveredFeatures)===null||n===void 0?void 0:n.length)>0,u=this._queryRenderedFeatures(t.point),s=u.length>0;!s&&i&&(t.type="mouseleave",this._onPointerEvent(t)),this._hoveredFeatures=u,s&&!i&&(t.type="mouseenter",this._onPointerEvent(t)),t.type=o}else this._hoveredFeatures=null}_fireEvent(t,n,r){const l=this._map,o=l.transform,i=typeof n=="string"?n:n.type;return i==="move"&&this._updateViewState(this.props,!1),i in Zl&&(typeof n=="object"&&(n.viewState=Xu(o)),this._map.isMoving())?(l.transform=this._renderTransform,t.call(l,n,r),l.transform=o,l):(t.call(l,n,r),l)}_onBeforeRepaint(){const t=this._map;this._internalUpdate=!0;for(const r in this._deferredEvents)this._deferredEvents[r]&&t.fire(r);this._internalUpdate=!1;const n=this._map.transform;t.transform=this._renderTransform,this._onAfterRepaint=()=>{Zu(this._renderTransform,n),t.transform=n}}}on.savedMaps=[];function Wd(){let e=null;if(typeof location<"u"){const t=/access_token=([^&\/]*)/.exec(location.search);e=t&&t[1]}try{e=e||void 0}catch{}try{e=e||{}.REACT_APP_MAPBOX_ACCESS_TOKEN}catch{}return e}const Qd=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function Kd(e){if(!e)return null;const t=e.map,n={getMap:()=>t,getCenter:()=>e.transform.center,getZoom:()=>e.transform.zoom,getBearing:()=>e.transform.bearing,getPitch:()=>e.transform.pitch,getPadding:()=>e.transform.padding,getBounds:()=>e.transform.getBounds(),project:r=>{const l=t.transform;t.transform=e.transform;const o=t.project(r);return t.transform=l,o},unproject:r=>{const l=t.transform;t.transform=e.transform;const o=t.unproject(r);return t.transform=l,o},queryTerrainElevation:(r,l)=>{const o=t.transform;t.transform=e.transform;const i=t.queryTerrainElevation(r,l);return t.transform=o,i},queryRenderedFeatures:(r,l)=>{const o=t.transform;t.transform=e.transform;const i=t.queryRenderedFeatures(r,l);return t.transform=o,i}};for(const r of Yd(t))!(r in n)&&!Qd.includes(r)&&(n[r]=t[r].bind(t));return n}function Yd(e){const t=new Set;let n=e;for(;n;){for(const r of Object.getOwnPropertyNames(n))r[0]!=="_"&&typeof e[r]=="function"&&r!=="fire"&&r!=="setEventedParent"&&t.add(r);n=Object.getPrototypeOf(n)}return Array.from(t)}const Zd=typeof document<"u"?C.useLayoutEffect:C.useEffect,Xd=["baseApiUrl","maxParallelImageRequests","workerClass","workerCount","workerUrl"];function Gd(e,t){for(const r of Xd)r in t&&(e[r]=t[r]);const{RTLTextPlugin:n="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js"}=t;n&&e.getRTLTextPluginStatus&&e.getRTLTextPluginStatus()==="unavailable"&&e.setRTLTextPlugin(n,r=>{r&&console.error(r)},!0)}const gl=C.createContext(null);function Jd(e,t,n){const r=C.useContext(Ud),[l,o]=C.useState(null),i=C.useRef(),{current:u}=C.useRef({mapLib:null,map:null});C.useEffect(()=>{const p=e.mapLib;let h=!0,m;return Promise.resolve(p||n).then(g=>{if(!h)return;if(!g)throw new Error("Invalid mapLib");const w="Map"in g?g:g.default;if(!w.Map)throw new Error("Invalid mapLib");if(Gd(w,e),!w.supported||w.supported(e))e.reuseMaps&&(m=on.reuse(e,i.current)),m||(m=new on(w.Map,e,i.current)),u.map=Kd(m),u.mapLib=w,o(m),r==null||r.onMapMount(u.map,e.id);else throw new Error("Map is not supported by this browser")}).catch(g=>{const{onError:w}=e;w?w({type:"error",target:null,originalEvent:null,error:g}):console.error(g)}),()=>{h=!1,m&&(r==null||r.onMapUnmount(e.id),e.reuseMaps?m.recycle():m.destroy())}},[]),Zd(()=>{l&&l.setProps(e)}),C.useImperativeHandle(t,()=>u.map,[l]);const s=C.useMemo(()=>({position:"relative",width:"100%",height:"100%",...e.style}),[e.style]),a={height:"100%"};return C.createElement("div",{id:e.id,ref:i,style:s},l&&C.createElement(gl.Provider,{value:u},C.createElement("div",{"mapboxgl-children":"",style:a},e.children)))}const qd=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function Mt(e,t){if(!e||!t)return;const n=e.style;for(const r in t){const l=t[r];Number.isFinite(l)&&!qd.test(r)?n[r]=`${l}px`:n[r]=l}}function bd(e,t){const{map:n,mapLib:r}=C.useContext(gl),l=C.useRef({props:e});l.current.props=e;const o=C.useMemo(()=>{let k=!1;C.Children.forEach(e.children,c=>{c&&(k=!0)});const D={...e,element:k?document.createElement("div"):null},f=new r.Marker(D);return f.setLngLat([e.longitude,e.latitude]),f.getElement().addEventListener("click",c=>{var d,v;(v=(d=l.current.props).onClick)===null||v===void 0||v.call(d,{type:"click",target:f,originalEvent:c})}),f.on("dragstart",c=>{var d,v;const S=c;S.lngLat=o.getLngLat(),(v=(d=l.current.props).onDragStart)===null||v===void 0||v.call(d,S)}),f.on("drag",c=>{var d,v;const S=c;S.lngLat=o.getLngLat(),(v=(d=l.current.props).onDrag)===null||v===void 0||v.call(d,S)}),f.on("dragend",c=>{var d,v;const S=c;S.lngLat=o.getLngLat(),(v=(d=l.current.props).onDragEnd)===null||v===void 0||v.call(d,S)}),f},[]);C.useEffect(()=>(o.addTo(n.getMap()),()=>{o.remove()}),[]);const{longitude:i,latitude:u,offset:s,style:a,draggable:p=!1,popup:h=null,rotation:m=0,rotationAlignment:g="auto",pitchAlignment:w="auto"}=e;return C.useEffect(()=>{Mt(o.getElement(),a)},[a]),C.useImperativeHandle(t,()=>o,[]),(o.getLngLat().lng!==i||o.getLngLat().lat!==u)&&o.setLngLat([i,u]),s&&!Ad(o.getOffset(),s)&&o.setOffset(s),o.isDraggable()!==p&&o.setDraggable(p),o.getRotation()!==m&&o.setRotation(m),o.getRotationAlignment()!==g&&o.setRotationAlignment(g),o.getPitchAlignment()!==w&&o.setPitchAlignment(w),o.getPopup()!==h&&o.setPopup(h),Ii.createPortal(e.children,o.getElement())}C.memo(C.forwardRef(bd));function ts(e){return new Set(e?e.trim().split(/\s+/):[])}function ep(e,t){const{map:n,mapLib:r}=C.useContext(gl),l=C.useMemo(()=>document.createElement("div"),[]),o=C.useRef({props:e});o.current.props=e;const i=C.useMemo(()=>{const u={...e},s=new r.Popup(u);return s.setLngLat([e.longitude,e.latitude]),s.once("open",a=>{var p,h;(h=(p=o.current.props).onOpen)===null||h===void 0||h.call(p,a)}),s},[]);if(C.useEffect(()=>{const u=s=>{var a,p;(p=(a=o.current.props).onClose)===null||p===void 0||p.call(a,s)};return i.on("close",u),i.setDOMContent(l).addTo(n.getMap()),()=>{i.off("close",u),i.isOpen()&&i.remove()}},[]),C.useEffect(()=>{Mt(i.getElement(),e.style)},[e.style]),C.useImperativeHandle(t,()=>i,[]),i.isOpen()&&((i.getLngLat().lng!==e.longitude||i.getLngLat().lat!==e.latitude)&&i.setLngLat([e.longitude,e.latitude]),e.offset&&!Ve(i.options.offset,e.offset)&&i.setOffset(e.offset),(i.options.anchor!==e.anchor||i.options.maxWidth!==e.maxWidth)&&(i.options.anchor=e.anchor,i.setMaxWidth(e.maxWidth)),i.options.className!==e.className)){const u=ts(i.options.className),s=ts(e.className);for(const a of u)s.has(a)||i.removeClassName(a);for(const a of s)u.has(a)||i.addClassName(a);i.options.className=e.className}return Ii.createPortal(e.children,l)}C.memo(C.forwardRef(ep));function tr(e,t,n,r){const l=C.useContext(gl),o=C.useMemo(()=>e(l),[]);return C.useEffect(()=>{const i=r||n||t,u=typeof t=="function"&&typeof n=="function"?t:null,s=typeof n=="function"?n:typeof t=="function"?t:null,{map:a}=l;return a.hasControl(o)||(a.addControl(o,i==null?void 0:i.position),u&&u(l)),()=>{s&&s(l),a.hasControl(o)&&a.removeControl(o)}},[]),o}function tp(e){const t=tr(({mapLib:n})=>new n.AttributionControl(e),{position:e.position});return C.useEffect(()=>{Mt(t._container,e.style)},[e.style]),null}C.memo(tp);function np(e){const t=tr(({mapLib:n})=>new n.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return C.useEffect(()=>{Mt(t._controlContainer,e.style)},[e.style]),null}C.memo(np);function rp(e,t){const n=C.useRef({props:e}),r=tr(({mapLib:l})=>{const o=new l.GeolocateControl(e),i=o._setupUI;return o._setupUI=u=>{o._container.hasChildNodes()||i(u)},o.on("geolocate",u=>{var s,a;(a=(s=n.current.props).onGeolocate)===null||a===void 0||a.call(s,u)}),o.on("error",u=>{var s,a;(a=(s=n.current.props).onError)===null||a===void 0||a.call(s,u)}),o.on("outofmaxbounds",u=>{var s,a;(a=(s=n.current.props).onOutOfMaxBounds)===null||a===void 0||a.call(s,u)}),o.on("trackuserlocationstart",u=>{var s,a;(a=(s=n.current.props).onTrackUserLocationStart)===null||a===void 0||a.call(s,u)}),o.on("trackuserlocationend",u=>{var s,a;(a=(s=n.current.props).onTrackUserLocationEnd)===null||a===void 0||a.call(s,u)}),o},{position:e.position});return n.current.props=e,C.useImperativeHandle(t,()=>r,[]),C.useEffect(()=>{Mt(r._container,e.style)},[e.style]),null}const lp=C.memo(C.forwardRef(rp));function op(e){const t=tr(({mapLib:n})=>new n.NavigationControl(e),{position:e.position});return C.useEffect(()=>{Mt(t._container,e.style)},[e.style]),null}const ip=C.memo(op);function up(e){const t=tr(({mapLib:o})=>new o.ScaleControl(e),{position:e.position}),n=C.useRef(e),r=n.current;n.current=e;const{style:l}=e;return e.maxWidth!==void 0&&e.maxWidth!==r.maxWidth&&(t.options.maxWidth=e.maxWidth),e.unit!==void 0&&e.unit!==r.unit&&t.setUnit(e.unit),C.useEffect(()=>{Mt(t._container,l)},[l]),null}const sp=C.memo(up),ap=jd(()=>import("./mapbox-gl-87c162e0.js").then(e=>e.m),[]),cp=(()=>C.forwardRef(function(t,n){return Jd(t,n,ap)}))(),fp=ip,dp=lp,pp=sp,mp={"slippy-map":"_slippy-map_1sfxu_2"};const ns="pk.eyJ1IjoicnVyYWxpbm5vIiwiYSI6ImNqeHl0cW0xODBlMm0zY2x0dXltYzRuazUifQ.zZBovoCHzLIW0wCZveEKzA";function hp(){return console.log("Re-rendering App component with MAPBOX_TOKEN: ",ns),C.createElement(C.Fragment,null,C.createElement("div",{className:mp["slippy-map"]},C.createElement(cp,{mapboxAccessToken:ns,mapStyle:"mapbox://styles/mapbox/light-v9",initialViewState:{latitude:39,longitude:-97.5,pitch:45,zoom:4.15},onMove:e=>{}},C.createElement(dp,{position:"top-right"}),C.createElement(fp,{position:"top-right"}),C.createElement(pp,{position:"bottom-left",unit:"imperial"}))))}function vp(e){pc(e).render(C.createElement(C.StrictMode,null,C.createElement(hp,null)))}vp(document.getElementById("app")); diff --git a/assets/index-732dca48.css b/assets/index-732dca48.css deleted file mode 100644 index 95fa18c..0000000 --- a/assets/index-732dca48.css +++ /dev/null @@ -1 +0,0 @@ -@import"https://fonts.googleapis.com/css2?family=Bitter:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap";@import"https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap";@import"https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap";@import"https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;500;600;700&display=swap";*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:theme("borderColor.DEFAULT",currentColor)}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:theme("fontFamily.sans",ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:theme("fontFamily.sans[1].fontFeatureSettings",normal);font-variation-settings:theme("fontFamily.sans[1].fontVariationSettings",normal)}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}code,kbd,samp,pre{font-family:theme("fontFamily.mono",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-size:1em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}::-webkit-search-decoration{-webkit-appearance:none}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1;color:theme("colors.gray.400",#9ca3af)}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}@font-face{font-family:TT Hoves;font-weight:400;font-style:normal;src:local("TT Hoves"),url("https://cori-risi-apps.s3.amazonaws.com/fonts/TypeType - TT Hoves Regular.ttf") format("truetype"),url(https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Regular/font.woff) format("woff"),url(https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Regular/font.woff2) format("woff2")}@font-face{font-family:TT Hoves Bold;font-weight:700;font-style:normal;src:local("TT Hoves"),url("https://cori-risi-apps.s3.amazonaws.com/fonts/TypeType - TT Hoves Bold.ttf") format("truetype"),url(https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Bold/font.woff) format("woff"),url(https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Bold/font.woff2) format("woff2")}@font-face{font-family:TT Hoves Medium;font-weight:500;font-style:normal;src:local("TT Hoves"),url("https://cori-risi-apps.s3.amazonaws.com/fonts/TypeType - TT Hoves Medium.ttf") format("truetype"),url(https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Medium/font.woff) format("woff"),url(https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Medium/font.woff2) format("woff2")}@font-face{font-family:TT Hoves Italic;font-weight:400;font-style:italic;src:local("TT Hoves"),url("https://cori-risi-apps.s3.amazonaws.com/fonts/TypeType - TT Hoves Italic.ttf") format("truetype"),url(https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Italic/font.woff) format("woff"),url(https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Italic/font.woff2) format("woff2")}html,body{font-family:Montserrat,Bitter,serif}h1,h2,h3,h4,h5,h6{font-weight:400;font-family:Montserrat,TT Hoves,sans-serif}h1,h2,h6{font-family:Montserrat,TT Hoves Bold,TT Hoves,sans-serif;font-weight:700}h3{font-family:Montserrat,TT Hoves Medium,TT Hoves,Bitter,serif;font-weight:400}h4,h5{font-family:Montserrat,TT Hoves Medium,TT Hoves,sans-serif;font-weight:500}h1{font-size:3.2em;line-height:1.16}h2{font-size:2.4em;line-height:1.25}h3{font-size:1.8em;line-height:1.3}h4{font-size:1.5em;line-height:1.3}h5{font-size:1.2em;line-height:1.3}h6{font-size:.76em;line-height:1.35}@media (min-width: 550px){h1{font-size:2.8em}h2{font-size:2.3em}h3{font-size:1.8em}h4{font-size:1.5em}h5{font-size:1.2em}h6{font-size:1em}}p{font-family:Bitter,serif;font-size:1em;line-height:1.7}a{font-family:Bitter,serif;font-size:1em;font-weight:400;line-height:1.7;text-decoration:underline}a:hover{text-decoration:underline;cursor:pointer}.nav-item a,.sidebar-item a{font-family:Montserrat,TT Hoves,sans-serif;font-weight:400}body{margin:0;font-family:Bitter,Montserrat,serif}#map{width:100%;height:100%;z-index:1}#map * .mapboxgl-ctrl{font-family:Bitter,serif}.control-panel{position:absolute;top:0;left:0;max-width:320px;background:#fff;box-shadow:0 2px 4px #0000004d;padding:12px 24px;margin:20px;font-size:13px;line-height:2;color:#6b6b76;text-transform:uppercase;outline:none;z-index:2}._slippy-map_1sfxu_2{position:relative;width:100%;height:100%;overflow:hidden}._slippy-map_1sfxu_2>*{overflow:hidden}.mapboxgl-map{-webkit-tap-highlight-color:rgb(0 0 0/0);font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative}.mapboxgl-canvas{left:0;position:absolute;top:0}.mapboxgl-map:-webkit-full-screen{height:100%;width:100%}.mapboxgl-canary{background-color:salmon}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass{cursor:grab;-webkit-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active{cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas{touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:none}.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.mapboxgl-ctrl-top-left{left:0;top:0}.mapboxgl-ctrl-top-right{right:0;top:0}.mapboxgl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-bottom-right{bottom:0;right:0}.mapboxgl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{float:left;margin:10px 0 0 10px}.mapboxgl-ctrl-top-right .mapboxgl-ctrl{float:right;margin:10px 10px 0 0}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl{float:left;margin:0 0 10px 10px}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl{float:right;margin:0 10px 10px 0}.mapboxgl-ctrl-group{background:#fff;border-radius:4px}.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px #0000001a}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.mapboxgl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;overflow:hidden;padding:0;width:29px}.mapboxgl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon{background-color:transparent}.mapboxgl-ctrl-group button+button{border-top:1px solid ButtonText}}.mapboxgl-ctrl-attrib-button:focus,.mapboxgl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon{opacity:.25}.mapboxgl-ctrl-group button:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:only-child{border-radius:inherit}.mapboxgl-ctrl button:not(:disabled):hover{background-color:#0000000d}.mapboxgl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23999'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon{animation:mapboxgl-spin 2s linear infinite}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23000'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}}@keyframes mapboxgl-spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='0.3' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='0.9' fill='%23fff'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.mapboxgl-ctrl-logo.mapboxgl-compact{width:23px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='1' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='1' fill='%23fff'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='1' stroke='%23fff' stroke-width='3' fill='%23fff'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='1' fill='%23000'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib{background-color:#ffffff80;margin:0;padding:0 5px}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact{background-color:#fff;border-radius:12px;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib-button{background-color:#ffffff80;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-top-left .mapboxgl-ctrl-attrib-button{left:0}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-inner{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-button{background-color:#0000000d}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{right:0;top:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{left:0;top:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.mapboxgl-ctrl-attrib a{color:#000000bf;text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-ctrl-attrib .mapbox-improve-map{font-weight:700;margin-left:2px}.mapboxgl-attrib-empty{display:none}.mapboxgl-ctrl-scale{background-color:#ffffffbf;border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px;white-space:nowrap}.mapboxgl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right{flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right{flex-direction:column-reverse}.mapboxgl-popup-anchor-left{flex-direction:row}.mapboxgl-popup-anchor-right{flex-direction:row-reverse}.mapboxgl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.mapboxgl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.mapboxgl-popup-close-button:hover{background-color:#0000000d}.mapboxgl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px #0000001a;padding:10px 10px 15px;pointer-events:auto;position:relative}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer{display:none}.mapboxgl-marker{left:0;opacity:1;position:absolute;top:0;transition:opacity .2s;will-change:transform}.mapboxgl-user-location-dot,.mapboxgl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.mapboxgl-user-location-dot:before{animation:mapboxgl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.mapboxgl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px #00000059;box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading{height:0;width:0}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:after,.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:before{border-bottom:7.5px solid #4aa1eb;content:"";position:absolute}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:before{border-left:7.5px solid transparent;transform:translateY(-28px) skewY(-20deg)}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:after{border-right:7.5px solid transparent;transform:translate(7.5px,-28px) skewY(20deg)}@keyframes mapboxgl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.mapboxgl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}@media print{.mapbox-improve-map{display:none}}.mapboxgl-scroll-zoom-blocker,.mapboxgl-touch-pan-blocker{align-items:center;background:rgba(0,0,0,.7);color:#fff;display:flex;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif;height:100%;justify-content:center;left:0;opacity:0;pointer-events:none;position:absolute;text-align:center;top:0;transition:opacity .75s ease-in-out;transition-delay:1s;width:100%}.mapboxgl-scroll-zoom-blocker-show,.mapboxgl-touch-pan-blocker-show{opacity:1;transition:opacity .1s ease-in-out}.mapboxgl-canvas-container.mapboxgl-touch-pan-blocker-override.mapboxgl-scrollable-page,.mapboxgl-canvas-container.mapboxgl-touch-pan-blocker-override.mapboxgl-scrollable-page .mapboxgl-canvas{touch-action:pan-x pan-y}/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none} diff --git a/assets/index-b3a314fc.css b/assets/index-b3a314fc.css new file mode 100644 index 0000000..7734cba --- /dev/null +++ b/assets/index-b3a314fc.css @@ -0,0 +1 @@ +.mapboxgl-map{-webkit-tap-highlight-color:rgb(0 0 0/0);font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative}.mapboxgl-canvas{left:0;position:absolute;top:0}.mapboxgl-map:-webkit-full-screen{height:100%;width:100%}.mapboxgl-canary{background-color:salmon}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass{cursor:grab;-webkit-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active{cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas{touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:none}.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.mapboxgl-ctrl-top-left{left:0;top:0}.mapboxgl-ctrl-top-right{right:0;top:0}.mapboxgl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-bottom-right{bottom:0;right:0}.mapboxgl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{float:left;margin:10px 0 0 10px}.mapboxgl-ctrl-top-right .mapboxgl-ctrl{float:right;margin:10px 10px 0 0}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl{float:left;margin:0 0 10px 10px}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl{float:right;margin:0 10px 10px 0}.mapboxgl-ctrl-group{background:#fff;border-radius:4px}.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px #0000001a}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.mapboxgl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;overflow:hidden;padding:0;width:29px}.mapboxgl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon{background-color:transparent}.mapboxgl-ctrl-group button+button{border-top:1px solid ButtonText}}.mapboxgl-ctrl-attrib-button:focus,.mapboxgl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon{opacity:.25}.mapboxgl-ctrl-group button:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:only-child{border-radius:inherit}.mapboxgl-ctrl button:not(:disabled):hover{background-color:#0000000d}.mapboxgl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23999'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon{animation:mapboxgl-spin 2s linear infinite}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23000'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}}@keyframes mapboxgl-spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='0.3' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='0.9' fill='%23fff'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.mapboxgl-ctrl-logo.mapboxgl-compact{width:23px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='1' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='1' fill='%23fff'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='1' stroke='%23fff' stroke-width='3' fill='%23fff'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='1' fill='%23000'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib{background-color:#ffffff80;margin:0;padding:0 5px}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact{background-color:#fff;border-radius:12px;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib-button{background-color:#ffffff80;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-top-left .mapboxgl-ctrl-attrib-button{left:0}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-inner{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-button{background-color:#0000000d}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{right:0;top:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{left:0;top:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.mapboxgl-ctrl-attrib a{color:#000000bf;text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-ctrl-attrib .mapbox-improve-map{font-weight:700;margin-left:2px}.mapboxgl-attrib-empty{display:none}.mapboxgl-ctrl-scale{background-color:#ffffffbf;border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px;white-space:nowrap}.mapboxgl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right{flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right{flex-direction:column-reverse}.mapboxgl-popup-anchor-left{flex-direction:row}.mapboxgl-popup-anchor-right{flex-direction:row-reverse}.mapboxgl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.mapboxgl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.mapboxgl-popup-close-button:hover{background-color:#0000000d}.mapboxgl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px #0000001a;padding:10px 10px 15px;pointer-events:auto;position:relative}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer{display:none}.mapboxgl-marker{left:0;opacity:1;position:absolute;top:0;transition:opacity .2s;will-change:transform}.mapboxgl-user-location-dot,.mapboxgl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.mapboxgl-user-location-dot:before{animation:mapboxgl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.mapboxgl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px #00000059;box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading{height:0;width:0}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:after,.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:before{border-bottom:7.5px solid #4aa1eb;content:"";position:absolute}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:before{border-left:7.5px solid transparent;transform:translateY(-28px) skewY(-20deg)}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:after{border-right:7.5px solid transparent;transform:translate(7.5px,-28px) skewY(20deg)}@keyframes mapboxgl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.mapboxgl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}@media print{.mapbox-improve-map{display:none}}.mapboxgl-scroll-zoom-blocker,.mapboxgl-touch-pan-blocker{align-items:center;background:rgba(0,0,0,.7);color:#fff;display:flex;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif;height:100%;justify-content:center;left:0;opacity:0;pointer-events:none;position:absolute;text-align:center;top:0;transition:opacity .75s ease-in-out;transition-delay:1s;width:100%}.mapboxgl-scroll-zoom-blocker-show,.mapboxgl-touch-pan-blocker-show{opacity:1;transition:opacity .1s ease-in-out}.mapboxgl-canvas-container.mapboxgl-touch-pan-blocker-override.mapboxgl-scrollable-page,.mapboxgl-canvas-container.mapboxgl-touch-pan-blocker-override.mapboxgl-scrollable-page .mapboxgl-canvas{touch-action:pan-x pan-y}:root,[data-amplify-theme]{--amplify-components-button-link-color: #ffffff;--amplify-components-button-link-loading-background-color: #2c3e50;--amplify-components-button-link-loading-border-color: #1a242f;--amplify-components-button-link-disabled-background-color: #2c3e50;--amplify-components-button-link-disabled-border-color: #1a242f;--amplify-components-button-link-active-border-color: #1a242f;--amplify-components-button-link-focus-border-color: #1a242f;--amplify-components-button-link-hover-border-color: #1a242f;--amplify-components-button-link-border-color: #1a242f;--amplify-components-button-link-background-color: #2c3e50;--amplify-components-button-menu-background-color: #2c3e50;--amplify-components-button-primary-background-color: #2c3e50;--amplify-components-button-primary-active-background-color: #1a242f;--amplify-components-button-primary-active-border-color: #1a242f;--amplify-components-button-primary-focus-background-color: #1a242f;--amplify-components-button-primary-focus-border-color: #1a242f;--amplify-components-button-primary-hover-background-color: #1a242f;--amplify-components-button-primary-hover-border-color: #1a242f;--amplify-components-button-primary-loading-border-color: #1a242f;--amplify-components-button-primary-disabled-border-color: #1a242f;--amplify-components-button-primary-border-color: #1a242f;--amplify-components-button-disabled-background-color: #2c3e50;--amplify-components-button-loading-background-color: #2c3e50;--amplify-components-tabs-item-active-color: #18bc9c;--amplify-components-tabs-item-border-style: 4px solid #2c3e50;--amplify-components-tabs-item-active-border-color: #2c3e50}[data-amplify-theme=default-theme] [data-amplify-authenticator] [data-amplify-router]{background-color:var(--amplify-components-authenticator-router-background-color);box-shadow:var(--amplify-components-authenticator-router-box-shadow);border-color:transparent}.ApiContextProvider_amplify-button--primary__x3TB9{border-width:var(--amplify-components-button-primary-border-width);background-color:var(--amplify-components-button-primary-background-color);border-color:var(--amplify-components-button-primary-border-color);color:var(--amplify-components-button-primary-color);--amplify-internal-button-disabled-border-color: var( --amplify-components-button-primary-disabled-border-color );--amplify-internal-button-disabled-background-color: var( --amplify-components-button-primary-disabled-background-color );--amplify-internal-button-disabled-color: var( --amplify-components-button-primary-disabled-color );--amplify-internal-button-loading-background-color: var( --amplify-components-button-primary-loading-background-color );--amplify-internal-button-loading-border-color: var( --amplify-components-button-primary-loading-border-color );--amplify-internal-button-loading-color: var( --amplify-components-button-primary-loading-color )}.ApiContextProvider_amplify-button--primary__x3TB9:hover{background-color:var(--amplify-components-button-primary-hover-background-color);border-color:var(--amplify-components-button-primary-hover-border-color);color:var(--amplify-components-button-primary-hover-color)}.ApiContextProvider_amplify-button--primary__x3TB9:focus{background-color:var(--amplify-components-button-primary-focus-background-color);border-color:var(--amplify-components-button-primary-focus-border-color);color:var(--amplify-components-button-primary-focus-color);box-shadow:var(--amplify-components-button-primary-focus-box-shadow)}.ApiContextProvider_amplify-button--primary__x3TB9:active{background-color:var(--amplify-components-button-primary-active-background-color);border-color:var(--amplify-components-button-primary-active-border-color);color:var(--amplify-components-button-primary-active-color)}.ApiContextProvider_amplify-tabs-item__-6nTX[data-state=active]{color:var(--amplify-components-tabs-item-active-color);border-color:var(--amplify-components-tabs-item-active-border-color);background-color:var(--amplify-components-tabs-item-active-background-color);transition-property:none}.ApiContextProvider_amplify-input__ycAUW.ApiContextProvider_amplify-field-group__control__cRTcr{text-align:left}.CategoricalLegend-module_categorical-legend__KiFcS{display:flex;flex-wrap:wrap;margin:1.5rem 0px}.CategoricalLegend-module_categorical-legend__KiFcS .CategoricalLegend-module_entry__4zxZU{display:flex;justify-content:space-around;margin:0 20px 5px 0}.CategoricalLegend-module_categorical-legend__KiFcS .CategoricalLegend-module_entry__4zxZU .CategoricalLegend-module_key__1Hgb-{height:1rem;width:1rem;opacity:.9}.CategoricalLegend-module_categorical-legend__KiFcS .CategoricalLegend-module_entry__4zxZU p{line-height:1rem;font-size:1rem;margin:0 0 0 6px}.HoverInfo-module_tooltip__3wVpX{width:320px;border:1px solid black;background-color:#fff;padding:10px;position:absolute;z-index:10;pointer-events:none}.HoverInfo-module_tooltip__3wVpX h3{margin:.5rem 0rem}.HoverInfo-module_tooltip__3wVpX .HoverInfo-module_details__4eyQ7{margin:.1rem 0rem;line-height:1.6}.HoverInfo-module_tooltip__3wVpX .HoverInfo-module_prop-score__DKjwo{font-weight:400;margin:0}.slippy-map{position:relative;width:100vw;height:100vh}.slippy-map>*{overflow:hidden}.slippy-map>.mapboxgl-map{width:100%!important;height:100%!important}.tooltip{width:320px;border:1px solid black;background-color:#fff;padding:10px;position:absolute;z-index:10;pointer-events:none}.tooltip h3{margin:.5rem 0rem}.tooltip .details{margin:.1rem 0rem;line-height:1.6}.tooltip .prop-score{font-weight:400;margin:0}.tooltip .click-prompt{font-style:italic;font-weight:600;margin-top:5px}.tooltip p{margin:0}/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body{font-family:Montserrat,Arial,Helvetica,sans-serif;overflow:none}h1{font-size:2rem}h2{font-size:1.8rem}h3{font-size:1.6rem}h4{font-size:1.4rem}h5{font-size:1.2rem}h6{font-size:1rem}h1,h2,h3,h4,h5,h6{font-family:Montserrat,Arial,Helvetica,sans-serif;margin-top:.5em;margin-bottom:.5em}p,a{font-family:Montserrat,Arial,Helvetica,sans-serif;line-height:1.4}a{margin-top:0;margin-bottom:0;color:#00835d;text-decoration:underline;font-weight:700}a:hover{text-decoration:underline;cursor:pointer}#map{display:flex} diff --git a/assets/mapbox-gl-87c162e0.js b/assets/mapbox-gl-87c162e0.js deleted file mode 100644 index 78e444f..0000000 --- a/assets/mapbox-gl-87c162e0.js +++ /dev/null @@ -1,1318 +0,0 @@ -function mg(gr,Mh){for(var ln=0;lnyr[cn]})}}}return Object.freeze(Object.defineProperty(gr,Symbol.toStringTag,{value:"Module"}))}var _g=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function gg(gr){return gr&&gr.__esModule&&Object.prototype.hasOwnProperty.call(gr,"default")?gr.default:gr}var Of={exports:{}};(function(gr,Mh){(function(ln,yr){gr.exports=yr()})(_g,function(){var ln,yr,cn;function wo(a,Se){if(!ln)ln=Se;else if(!yr)yr=Se;else{var xr="self.onerror = function() { console.error('An error occurred while parsing the WebWorker bundle. This is most likely due to improper transpilation by Babel; please see https://docs.mapbox.com/mapbox-gl-js/guides/install/#transpiling'); }; var sharedChunk = {}; ("+ln+")(sharedChunk); ("+yr+")(sharedChunk); self.onerror = null;",Ki={};ln(Ki),cn=Se(Ki),typeof window<"u"&&window&&window.URL&&window.URL.createObjectURL&&(cn.workerUrl=window.URL.createObjectURL(new Blob([xr],{type:"text/javascript"})))}}wo(["exports"],function(a){var Se=typeof self<"u"?self:{},xr="2.15.0";let Ki;const it={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){if(Ki==null){const t=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;try{Ki={}.API_URL_REGEX!=null?new RegExp({}.API_URL_REGEX):t}catch{Ki=t}}return Ki},get API_TILEJSON_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/v[0-9]*\/.*\.json.*$)/i},get API_SPRITE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*\/sprite.*\..*$)/i},get API_FONTS_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/fonts\/v[0-9]*\/)(.*\.pbf.*$)/i},get API_STYLE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*$)/i},get API_CDN_URL_REGEX(){return/^((https?:)?\/\/)?api\.mapbox\.c(n|om)(\/mapbox-gl-js\/)(.*$)/i},get EVENTS_URL(){if(!it.API_URL)return null;try{const t=new URL(it.API_URL);return t.hostname==="api.mapbox.cn"?"https://events.mapbox.cn/events/v2":t.hostname==="api.mapbox.com"?"https://events.mapbox.com/events/v2":null}catch{return null}},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},ht={supported:!1,testSupport:function(t){!vr&&Si&&(br?To(t):gi=t)}};let gi,Si,vr=!1,br=!1;function To(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,Si),t.isContextLost())return;ht.supported=!0}catch{}t.deleteTexture(e),vr=!0}Se.document&&(Si=Se.document.createElement("img"),Si.onload=function(){gi&&To(gi),gi=null,br=!0},Si.onerror=function(){vr=!0,gi=null},Si.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const Rn="01";function Yi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Bn=Ji;function Ji(t,e,i,n){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*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=e,this.p2x=i,this.p2y=n}Ji.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(e===void 0&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var i=t,n=0;n<8;n++){var s=this.sampleCurveX(i)-t;if(Math.abs(s)s?u=i:p=i,i=.5*(p-u)+u;return i},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}};var hn=Yi(Bn),un=Qi;function Qi(t,e){this.x=t,this.y=e}Qi.prototype={clone:function(){return new Qi(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),n=i*this.x+e*this.y;return this.x=e*this.x-i*this.y,this.y=n,this},_rotateAround:function(t,e){var i=Math.cos(t),n=Math.sin(t),s=e.y+n*(this.x-e.x)+i*(this.y-e.y);return this.x=e.x+i*(this.x-e.x)-n*(this.y-e.y),this.y=s,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Qi.convert=function(t){return t instanceof Qi?t:Array.isArray(t)?new Qi(t[0],t[1]):t};var Le=Yi(un);const ba=Math.PI/180,wa=180/Math.PI;function dt(t){return t*ba}function si(t){return t*wa}const Ta=[[0,0],[1,0],[1,1],[0,1]];function gs(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)}function Eo(t,e,i,n){const s=new hn(t,e,i,n);return function(c){return s.solve(c)}}const ys=Eo(.25,.1,.25,1);function ct(t,e,i){return Math.min(i,Math.max(e,t))}function On(t,e,i){return(i=ct((i-t)/(e-t),0,1))*i*(3-2*i)}function oi(t,e,i){const n=i-e,s=((t-e)%n+n)%n+e;return s===e?i:s}function ai(t,e,i){if(!t.length)return i(null,[]);let n=t.length;const s=new Array(t.length);let c=null;t.forEach((u,p)=>{e(u,(m,_)=>{m&&(c=m),s[p]=_,--n==0&&i(c,s)})})}function $r(t){const e=[];for(const i in t)e.push(t[i]);return e}function Wt(t,...e){for(const i of e)for(const n in i)t[n]=i[n];return t}let Zr=1;function Fn(){return Zr++}function qr(){return function t(e){return e?(e^Math.random()*(16>>e/4)).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function wr(t){return t<=1?1:Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function xs(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function dn(t,e){t.forEach(i=>{e[i]&&(e[i]=e[i].bind(e))})}function Un(t,e){return t.indexOf(e,t.length-e.length)!==-1}function pt(t,e,i){const n={};for(const s in t)n[s]=e.call(i||this,t[s],s,t);return n}function Vn(t,e,i){const n={};for(const s in t)e.call(i||this,t[s],s,t)&&(n[s]=t[s]);return n}function Li(t){return Array.isArray(t)?t.map(Li):typeof t=="object"&&t?pt(t,Li):t}const So={};function Ut(t){So[t]||(typeof console<"u"&&console.warn(t),So[t]=!0)}function Ui(t,e,i){return(i.y-t.y)*(e.x-t.x)>(e.y-t.y)*(i.x-t.x)}function vs(t){let e=0;for(let i,n,s=0,c=t.length,u=c-1;s@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(i,n,s,c)=>{const u=s||c;return e[n]=!u||u.toLowerCase(),""}),e["max-age"]){const i=parseInt(e["max-age"],10);isNaN(i)?delete e["max-age"]:e["max-age"]=i}return e}let Mo=null;function Nn(t){if(Mo==null){const e=t.navigator?t.navigator.userAgent:null;Mo=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return Mo}function Ao(t){try{const e=Se[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch{return!1}}function Wr(t,e){return[t[4*e],t[4*e+1],t[4*e+2],t[4*e+3]]}const jn="mapbox-tiles";let bs=500,ws=50,Vi,Xr;function Io(){try{return Se.caches}catch{}}function pn(){Io()&&!Vi&&(Vi=Se.caches.open(jn))}function Gn(t){const e=t.indexOf("?");if(e<0)return t;const i=function(s){const c=s.indexOf("?");return c>0?s.slice(c+1).split("&"):[]}(t),n=i.filter(s=>{const c=s.split("=");return c[0]==="language"||c[0]==="worldview"});return n.length?`${t.slice(0,e)}?${n.join("&")}`:t.slice(0,e)}let Co=1/0;const fn={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(fn);class Hr extends Error{constructor(e,i,n){i===401&&ne(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes"),super(e),this.status=i,this.url=n}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}const mn=Tr()?()=>self.worker&&self.worker.referrer:()=>(Se.location.protocol==="blob:"?Se.parent:Se).location.href,_n=function(t,e){if(!(/^file:/.test(i=t.url)||/^file:/.test(mn())&&!/^\w+:/.test(i))){if(Se.fetch&&Se.Request&&Se.AbortController&&Se.Request.prototype.hasOwnProperty("signal"))return function(n,s){const c=new Se.AbortController,u=new Se.Request(n.url,{method:n.method||"GET",body:n.body,credentials:n.credentials,headers:n.headers,referrer:mn(),referrerPolicy:n.referrerPolicy,signal:c.signal});let p=!1,m=!1;const _=(x=u.url).indexOf("sku=")>0&&ne(x);var x;n.type==="json"&&u.headers.set("Accept","application/json");const b=(S,M,C)=>{if(m)return;if(S&&S.message!=="SecurityError"&&Ut(S.toString()),M&&C)return w(M);const D=Date.now();Se.fetch(u).then(U=>{if(U.ok){const q=_?U.clone():null;return w(U,q,D)}return s(new Hr(U.statusText,U.status,n.url))}).catch(U=>{U.name!=="AbortError"&&s(new Error(`${U.message} ${n.url}`))})},w=(S,M,C)=>{(n.type==="arrayBuffer"?S.arrayBuffer():n.type==="json"?S.json():S.text()).then(D=>{m||(M&&C&&function(U,q,V){if(pn(),!Vi)return;const $={status:q.status,statusText:q.statusText,headers:new Se.Headers};q.headers.forEach((ce,se)=>$.headers.set(se,ce));const X=Ri(q.headers.get("Cache-Control")||"");if(X["no-store"])return;X["max-age"]&&$.headers.set("Expires",new Date(V+1e3*X["max-age"]).toUTCString());const W=$.headers.get("Expires");W&&(new Date(W).getTime()-V<42e4||function(ce,se){if(Xr===void 0)try{new Response(new ReadableStream),Xr=!0}catch{Xr=!1}Xr?se(ce.body):ce.blob().then(se)}(q,ce=>{const se=new Se.Response(ce,$);pn(),Vi&&Vi.then(me=>me.put(Gn(U.url),se)).catch(me=>Ut(me.message))}))}(u,M,C),p=!0,s(null,D,S.headers.get("Cache-Control"),S.headers.get("Expires")))}).catch(D=>{m||s(new Error(D.message))})};return _?function(S,M){if(pn(),!Vi)return M(null);const C=Gn(S.url);Vi.then(D=>{D.match(C).then(U=>{const q=function(V){if(!V)return!1;const $=new Date(V.headers.get("Expires")||0),X=Ri(V.headers.get("Cache-Control")||"");return $>Date.now()&&!X["no-cache"]}(U);D.delete(C),q&&D.put(C,U.clone()),M(null,U,q)}).catch(M)}).catch(M)}(u,b):b(null,null),{cancel:()=>{m=!0,p||c.abort()}}}(t,e);if(Tr()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var i;return function(n,s){const c=new Se.XMLHttpRequest;c.open(n.method||"GET",n.url,!0),n.type==="arrayBuffer"&&(c.responseType="arraybuffer");for(const u in n.headers)c.setRequestHeader(u,n.headers[u]);return n.type==="json"&&(c.responseType="text",c.setRequestHeader("Accept","application/json")),c.withCredentials=n.credentials==="include",c.onerror=()=>{s(new Error(c.statusText))},c.onload=()=>{if((c.status>=200&&c.status<300||c.status===0)&&c.response!==null){let u=c.response;if(n.type==="json")try{u=JSON.parse(c.response)}catch(p){return s(p)}s(null,u,c.getResponseHeader("Cache-Control"),c.getResponseHeader("Expires"))}else s(new Hr(c.statusText,c.status,n.url))},c.send(n.body),{cancel:()=>c.abort()}}(t,e)},$n=function(t,e){return _n(Wt(t,{type:"arrayBuffer"}),e)};function Ts(t){const e=Se.document.createElement("a");return e.href=t,e.protocol===Se.document.location.protocol&&e.host===Se.document.location.host}const Z="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let z,P;z=[],P=0;const G=function(t,e){if(ht.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),P>=it.MAX_PARALLEL_IMAGE_REQUESTS){const c={requestParameters:t,callback:e,cancelled:!1,cancel(){this.cancelled=!0}};return z.push(c),c}P++;let i=!1;const n=()=>{if(!i)for(i=!0,P--;z.length&&P{n(),c?e(c):u&&(Se.createImageBitmap?function(_,x){const b=new Se.Blob([new Uint8Array(_)],{type:"image/png"});Se.createImageBitmap(b).then(w=>{x(null,w)}).catch(w=>{x(new Error(`Could not load image because of ${w.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})}(u,(_,x)=>e(_,x,p,m)):function(_,x){const b=new Se.Image,w=Se.URL;b.onload=()=>{x(null,b),w.revokeObjectURL(b.src),b.onload=null,Se.requestAnimationFrame(()=>{b.src=Z})},b.onerror=()=>x(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 S=new Se.Blob([new Uint8Array(_)],{type:"image/png"});b.src=_.byteLength?w.createObjectURL(S):Z}(u,(_,x)=>e(_,x,p,m)))});return{cancel:()=>{s.cancel(),n()}}},H="NO_ACCESS_TOKEN";function ee(t){return t.indexOf("mapbox:")===0}function ne(t){return it.API_URL_REGEX.test(t)}function re(t){return it.API_CDN_URL_REGEX.test(t)}function Q(t){return it.API_STYLE_REGEX.test(t)&&!de(t)}function de(t){return it.API_SPRITE_REGEX.test(t)}const Pe=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function ke(t){const e=t.match(Pe);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function Ie(t){const e=t.params.length?`?${t.params.join("&")}`:"";return`${t.protocol}://${t.authority}${t.path}${e}`}const Je="mapbox.eventData";function rt(t){if(!t)return null;const e=t.split(".");if(!e||e.length!==3)return null;try{return JSON.parse(decodeURIComponent(Se.atob(e[1]).split("").map(i=>"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)).join("")))}catch{return null}}class Qe{constructor(e){this.type=e,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null}getStorageKey(e){const i=rt(it.ACCESS_TOKEN);let n="";return n=i&&i.u?Se.btoa(encodeURIComponent(i.u).replace(/%([0-9A-F]{2})/g,(s,c)=>String.fromCharCode(+("0x"+c)))):it.ACCESS_TOKEN||"",e?`${Je}.${e}:${n}`:`${Je}:${n}`}fetchEventData(){const e=Ao("localStorage"),i=this.getStorageKey(),n=this.getStorageKey("uuid");if(e)try{const s=Se.localStorage.getItem(i);s&&(this.eventData=JSON.parse(s));const c=Se.localStorage.getItem(n);c&&(this.anonId=c)}catch{Ut("Unable to read from LocalStorage")}}saveEventData(){const e=Ao("localStorage"),i=this.getStorageKey(),n=this.getStorageKey("uuid");if(e)try{Se.localStorage.setItem(n,this.anonId),Object.keys(this.eventData).length>=1&&Se.localStorage.setItem(i,JSON.stringify(this.eventData))}catch{Ut("Unable to write to LocalStorage")}}processRequests(e){}postEvent(e,i,n,s){if(!it.EVENTS_URL)return;const c=ke(it.EVENTS_URL);c.params.push(`access_token=${s||it.ACCESS_TOKEN||""}`);const u={event:this.type,created:new Date(e).toISOString()},p=i?Wt(u,i):u,m={url:Ie(c),headers:{"Content-Type":"text/plain"},body:JSON.stringify([p])};this.pendingRequest=function(_,x){return _n(Wt(_,{method:"POST"}),x)}(m,_=>{this.pendingRequest=null,n(_),this.saveEventData(),this.processRequests(s)})}queueRequest(e,i){this.queue.push(e),this.processRequests(i)}}const nt=new class extends Qe{constructor(t){super("appUserTurnstile"),this._customAccessToken=t}postTurnstileEvent(t,e){it.EVENTS_URL&&it.ACCESS_TOKEN&&Array.isArray(t)&&t.some(i=>ee(i)||ne(i))&&this.queueRequest(Date.now(),e)}processRequests(t){if(this.pendingRequest||this.queue.length===0)return;this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const e=rt(it.ACCESS_TOKEN),i=e?e.u:it.ACCESS_TOKEN;let n=i!==this.eventData.tokenU;xs(this.anonId)||(this.anonId=qr(),n=!0);const s=this.queue.shift();if(this.eventData.lastSuccess){const c=new Date(this.eventData.lastSuccess),u=new Date(s),p=(s-this.eventData.lastSuccess)/864e5;n=n||p>=1||p<-1||c.getDate()!==u.getDate()}else n=!0;n?this.postEvent(s,{sdkIdentifier:"mapbox-gl-js",sdkVersion:xr,skuId:Rn,"enabled.telemetry":!1,userId:this.anonId},c=>{c||(this.eventData.lastSuccess=s,this.eventData.tokenU=i)},t):this.processRequests()}},ft=nt.postTurnstileEvent.bind(nt),Vt=new class extends Qe{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(t,e,i,n){this.skuToken=e,this.errorCb=n,it.EVENTS_URL&&(i||it.ACCESS_TOKEN?this.queueRequest({id:t,timestamp:Date.now()},i):this.errorCb(new Error(H)))}processRequests(t){if(this.pendingRequest||this.queue.length===0)return;const{id:e,timestamp:i}=this.queue.shift();e&&this.success[e]||(this.anonId||this.fetchEventData(),xs(this.anonId)||(this.anonId=qr()),this.postEvent(i,{sdkIdentifier:"mapbox-gl-js",sdkVersion:xr,skuId:Rn,skuToken:this.skuToken,userId:this.anonId},n=>{n?this.errorCb(n):e&&(this.success[e]=!0)},t))}},Xt=Vt.postMapLoadEvent.bind(Vt),yi=new class extends Qe{constructor(){super("gljs.performance")}postPerformanceEvent(t,e){it.EVENTS_URL&&(t||it.ACCESS_TOKEN)&&this.queueRequest({timestamp:Date.now(),performanceData:e},t)}processRequests(t){if(this.pendingRequest||this.queue.length===0)return;const{timestamp:e,performanceData:i}=this.queue.shift(),n=function(s){const c=Se.performance.getEntriesByType("resource"),u=Se.performance.getEntriesByType("mark"),p=function(w){const S={};if(w){for(const M in w)if(M!=="other")for(const C of w[M]){const D=`${M}ResolveRangeMin`,U=`${M}ResolveRangeMax`,q=`${M}RequestCount`,V=`${M}RequestCachedCount`;S[D]=Math.min(S[D]||1/0,C.startTime),S[U]=Math.max(S[U]||-1/0,C.responseEnd);const $=X=>{S[X]===void 0&&(S[X]=0),++S[X]};C.transferSize!==void 0&&C.transferSize===0&&$(V),$(q)}}return S}(function(w,S){const M={};if(w)for(const C of w){const D=S(C);M[D]===void 0&&(M[D]=[]),M[D].push(C)}return M}(c,tc)),m=Se.devicePixelRatio,_=Se.navigator.connection||Se.navigator.mozConnection||Se.navigator.webkitConnection,x={counters:[],metadata:[],attributes:[]},b=(w,S,M)=>{M!=null&&w.push({name:S,value:M.toString()})};for(const w in p)b(x.counters,w,p[w]);if(s.interactionRange[0]!==1/0&&s.interactionRange[1]!==-1/0&&(b(x.counters,"interactionRangeMin",s.interactionRange[0]),b(x.counters,"interactionRangeMax",s.interactionRange[1])),u)for(const w of Object.keys(Zn)){const S=Zn[w],M=u.find(C=>C.name===S);M&&b(x.counters,S,M.startTime)}return b(x.counters,"visibilityHidden",s.visibilityHidden),b(x.attributes,"style",function(w){if(w)for(const S of w){const M=S.name.split("?")[0];if(Q(M)){const C=M.split("/").slice(-2);if(C.length===2)return`mapbox://styles/${C[0]}/${C[1]}`}}}(c)),b(x.attributes,"terrainEnabled",s.terrainEnabled?"true":"false"),b(x.attributes,"fogEnabled",s.fogEnabled?"true":"false"),b(x.attributes,"projection",s.projection),b(x.attributes,"zoom",s.zoom),b(x.metadata,"devicePixelRatio",m),b(x.metadata,"connectionEffectiveType",_?_.effectiveType:void 0),b(x.metadata,"navigatorUserAgent",Se.navigator.userAgent),b(x.metadata,"screenWidth",Se.screen.width),b(x.metadata,"screenHeight",Se.screen.height),b(x.metadata,"windowWidth",Se.innerWidth),b(x.metadata,"windowHeight",Se.innerHeight),b(x.metadata,"mapWidth",s.width/m),b(x.metadata,"mapHeight",s.height/m),b(x.metadata,"webglRenderer",s.renderer),b(x.metadata,"webglVendor",s.vendor),b(x.metadata,"sdkVersion",xr),b(x.metadata,"sdkIdentifier","mapbox-gl-js"),x}(i);for(const s of n.metadata);for(const s of n.counters);for(const s of n.attributes);this.postEvent(e,n,()=>{},t)}},ri=yi.postPerformanceEvent.bind(yi),sr=new class extends Qe{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(t,e,i,n){if(!it.API_URL||!it.SESSION_PATH)return;const s=ke(it.API_URL+it.SESSION_PATH);s.params.push(`sku=${e||""}`),s.params.push(`access_token=${n||it.ACCESS_TOKEN||""}`);const c={url:Ie(s),headers:{"Content-Type":"text/plain"}};this.pendingRequest=function(u,p){return _n(Wt(u,{method:"GET"}),p)}(c,u=>{this.pendingRequest=null,i(u),this.saveEventData(),this.processRequests(n)})}getSessionAPI(t,e,i,n){this.skuToken=e,this.errorCb=n,it.SESSION_PATH&&it.API_URL&&(i||it.ACCESS_TOKEN?this.queueRequest({id:t,timestamp:Date.now()},i):this.errorCb(new Error(H)))}processRequests(t){if(this.pendingRequest||this.queue.length===0)return;const{id:e,timestamp:i}=this.queue.shift();e&&this.success[e]||this.getSession(i,this.skuToken,n=>{n?this.errorCb(n):e&&(this.success[e]=!0)},t)}},li=sr.getSessionAPI.bind(sr),Ti=new Set,Zn={create:"create",load:"load",fullLoad:"fullLoad"},Ah={mark(t){Se.performance.mark(t)},measure(t,e,i){Se.performance.measure(t,e,i)}};function tc(t){const e=t.name.split("?")[0];return re(e)&&e.includes("mapbox-gl.js")?"javascript":re(e)&&e.includes("mapbox-gl.css")?"css":function(i){return it.API_FONTS_REGEX.test(i)}(e)?"fontRange":de(e)?"sprite":Q(e)?"style":function(i){return it.API_TILEJSON_REGEX.test(i)}(e)?"tilejson":"other"}const vt=Se.performance;function Ea(t){const e=t?t.url.toString():void 0;return vt.getEntriesByName(e)}let zo,Sa,Es,ar;const Er={now:()=>Es!==void 0?Es:Se.performance.now(),setNow(t){Es=t},restoreNow(){Es=void 0},frame(t){const e=Se.requestAnimationFrame(t);return{cancel:()=>Se.cancelAnimationFrame(e)}},getImageData(t,e=0){const{width:i,height:n}=t;ar||(ar=Se.document.createElement("canvas"));const s=ar.getContext("2d",{willReadFrequently:!0});if(!s)throw new Error("failed to create canvas 2d context");return(i>ar.width||n>ar.height)&&(ar.width=i,ar.height=n),s.clearRect(-e,-e,i+2*e,n+2*e),s.drawImage(t,0,0,i,n),s.getImageData(-e,-e,i+2*e,n+2*e)},resolveURL:t=>(zo||(zo=Se.document.createElement("a")),zo.href=t,zo.href),get devicePixelRatio(){return Se.devicePixelRatio},get prefersReducedMotion(){return!!Se.matchMedia&&(Sa==null&&(Sa=Se.matchMedia("(prefers-reduced-motion: reduce)")),Sa.matches)}};function Ma(t,e,i){i[t]&&i[t].indexOf(e)!==-1||(i[t]=i[t]||[],i[t].push(e))}function Aa(t,e,i){if(i&&i[t]){const n=i[t].indexOf(e);n!==-1&&i[t].splice(n,1)}}class gn{constructor(e,i={}){Wt(this,i),this.type=e}}class Sr extends gn{constructor(e,i={}){super("error",Wt({error:e},i))}}class Po{on(e,i){return this._listeners=this._listeners||{},Ma(e,i,this._listeners),this}off(e,i){return Aa(e,i,this._listeners),Aa(e,i,this._oneTimeListeners),this}once(e,i){return i?(this._oneTimeListeners=this._oneTimeListeners||{},Ma(e,i,this._oneTimeListeners),this):new Promise(n=>this.once(e,n))}fire(e,i){typeof e=="string"&&(e=new gn(e,i||{}));const n=e.type;if(this.listens(n)){e.target=this;const s=this._listeners&&this._listeners[n]?this._listeners[n].slice():[];for(const p of s)p.call(this,e);const c=this._oneTimeListeners&&this._oneTimeListeners[n]?this._oneTimeListeners[n].slice():[];for(const p of c)Aa(n,p,this._oneTimeListeners),p.call(this,e);const u=this._eventedParent;u&&(Wt(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),u.fire(e))}else e instanceof Sr&&console.error(e.error);return this}listens(e){return!!(this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e))}setEventedParent(e,i){return this._eventedParent=e,this._eventedParentData=i,this}}var fe=JSON.parse('{"$version":8,"$root":{"version":{"required":true,"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"},"terrain":{"type":"terrain"},"fog":{"type":"fog"},"sources":{"required":true,"type":"sources"},"sprite":{"type":"string"},"glyphs":{"type":"string"},"transition":{"type":"transition"},"projection":{"type":"projection"},"layers":{"required":true,"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":true,"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":{}},"default":"xyz"},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"attribution":{"type":"string"},"promoteId":{"type":"promoteId"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster":{"type":{"required":true,"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":false},"*":{"type":"*"}},"source_raster_dem":{"type":{"required":true,"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":{}},"default":"mapbox"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_geojson":{"type":{"required":true,"type":"enum","values":{"geojson":{}}},"data":{"type":"*"},"maxzoom":{"type":"number","default":18},"attribution":{"type":"string"},"buffer":{"type":"number","default":128,"maximum":512,"minimum":0},"filter":{"type":"*"},"tolerance":{"type":"number","default":0.375},"cluster":{"type":"boolean","default":false},"clusterRadius":{"type":"number","default":50,"minimum":0},"clusterMaxZoom":{"type":"number"},"clusterMinPoints":{"type":"number"},"clusterProperties":{"type":"*"},"lineMetrics":{"type":"boolean","default":false},"generateId":{"type":"boolean","default":false},"promoteId":{"type":"promoteId"}},"source_video":{"type":{"required":true,"type":"enum","values":{"video":{}}},"urls":{"required":true,"type":"array","value":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_image":{"type":{"required":true,"type":"enum","values":{"image":{}}},"url":{"required":true,"type":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"layer":{"id":{"type":"string","required":true},"type":{"type":"enum","values":{"fill":{},"line":{},"symbol":{},"circle":{},"heatmap":{},"fill-extrusion":{},"raster":{},"hillshade":{},"background":{},"sky":{}},"required":true},"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_sky"],"layout_background":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_sky":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_fill":{"fill-sort-key":{"type":"number","expression":{"interpolated":false,"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":false,"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"},"fill-extrusion-edge-radius":{"type":"number","private":true,"default":0,"minimum":0,"maximum":1,"property-type":"constant"}},"layout_line":{"line-cap":{"type":"enum","values":{"butt":{},"round":{},"square":{}},"default":"butt","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-join":{"type":"enum","values":{"bevel":{},"round":{},"miter":{}},"default":"miter","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{"type":"number","default":2,"requires":[{"line-join":"miter"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-round-limit":{"type":"number","default":1.05,"requires":[{"line-join":"round"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-sort-key":{"type":"number","expression":{"interpolated":false,"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":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-spacing":{"type":"number","default":250,"minimum":1,"units":"pixels","requires":[{"symbol-placement":"line"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{"type":"boolean","default":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{"type":"enum","values":{"auto":{},"viewport-y":{},"source":{}},"default":"auto","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{"type":"boolean","default":false,"requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{"type":"boolean","default":false,"requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-optional":{"type":"boolean","default":false,"requires":["icon-image","text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"],"expression":{"interpolated":false,"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":true,"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":false,"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":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-image":{"type":"resolvedImage","tokens":true,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{"type":"number","default":0,"period":360,"units":"degrees","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{"type":"boolean","default":false,"requires":["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-offset":{"type":"array","value":"number","length":2,"default":[0,0],"requires":["icon-image"],"expression":{"interpolated":true,"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":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-field":{"type":"formatted","default":"","tokens":true,"expression":{"interpolated":false,"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":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size":{"type":"number","default":16,"minimum":0,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{"type":"number","default":10,"minimum":0,"units":"ems","requires":["text-field",{"symbol-placement":["point"]}],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{"type":"number","default":1.2,"units":"ems","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{"type":"number","default":0,"units":"ems","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-justify":{"type":"enum","values":{"auto":{},"left":{},"center":{},"right":{}},"default":"center","requires":["text-field"],"expression":{"interpolated":false,"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":true,"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":false,"parameters":["zoom"]},"property-type":"data-constant"},"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":false,"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":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-writing-mode":{"type":"array","value":"enum","values":{"horizontal":{},"vertical":{}},"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotate":{"type":"number","default":0,"period":360,"units":"degrees","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-keep-upright":{"type":"boolean","default":true,"requires":["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-transform":{"type":"enum","values":{"none":{},"uppercase":{},"lowercase":{}},"default":"none","requires":["text-field"],"expression":{"interpolated":false,"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":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{"type":"boolean","default":false,"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{"type":"boolean","default":false,"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-optional":{"type":"boolean","default":false,"requires":["text-field","icon-image"],"expression":{"interpolated":false,"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_symbol":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature","pitch","distance-from-center"]}},"filter_fill":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_line":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_circle":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_fill-extrusion":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_heatmap":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_operator":{"type":"enum","values":{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},"in":{},"!in":{},"all":{},"any":{},"none":{},"has":{},"!has":{},"within":{}}},"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":false}},"function_stop":{"type":"array","minimum":0,"maximum":24,"value":["number","color"],"length":2},"expression":{"type":"array","value":"*","minimum":1},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"high-color":{"type":"color","property-type":"data-constant","default":"#245cdf","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"space-color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"horizon-blend":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,0.2,7,0.1],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"star-intensity":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],5,0.35,6,0],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":{},"viewport":{}},"property-type":"data-constant","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"projection":{"name":{"type":"enum","values":{"albers":{},"equalEarth":{},"equirectangular":{},"lambertConformalConic":{},"mercator":{},"naturalEarth":{},"winkelTripel":{},"globe":{}},"default":"mercator","required":true},"center":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-180,-90],"maximum":[180,90],"transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]},"parallels":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-90,-90],"maximum":[90,90],"transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]}},"terrain":{"source":{"type":"string","required":true},"exaggeration":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1000,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"requires":["source"]}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"fill-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{"type":"color","transition":true,"requires":[{"!":"fill-pattern"},{"fill-antialias":true}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["fill-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"fill-extrusion-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["fill-extrusion-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"units":"meters","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"units":"meters","transition":true,"requires":["fill-extrusion-height"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant","type":"number","private":true,"default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant","type":"number","private":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"requires":["fill-extrusion-edge-radius"]},"fill-extrusion-rounded-roof":{"type":"boolean","default":true,"requires":["fill-extrusion-edge-radius"],"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_line":{"line-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"line-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["line-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"line-width":{"type":"number","default":1,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{"type":"array","value":"number","minimum":0,"transition":false,"units":"line widths","requires":[{"!":"line-pattern"}],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{"type":"color","transition":false,"requires":[{"!":"line-pattern"},{"source":"geojson","has":{"lineMetrics":true}}],"expression":{"interpolated":true,"parameters":["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{"type":"array","value":"number","length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"transition":false,"requires":[{"source":"geojson","has":{"lineMetrics":true}}],"property-type":"constant"}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["circle-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{}},"default":"viewport","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"transition":false,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"heatmap-color":{"type":"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"transition":false,"expression":{"interpolated":true,"parameters":["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_symbol":{"icon-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{"type":"color","default":"#000000","transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["icon-image","icon-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{"type":"color","default":"#000000","transition":true,"overridable":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["text-field","text-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_raster":{"raster-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{"type":"number","default":0,"period":360,"transition":true,"units":"degrees","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-resampling":{"type":"enum","values":{"linear":{},"nearest":{}},"default":"linear","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"transition":false,"units":"milliseconds","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"transition":false,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"viewport","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{"type":"number","default":0.5,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_background":{"background-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"background-pattern"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":{},"atmosphere":{}},"default":"atmosphere","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"requires":[{"sky-type":"atmosphere"}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{"type":"number","requires":[{"sky-type":"atmosphere"}],"default":10,"minimum":0,"maximum":100,"transition":false,"property-type":"data-constant"},"sky-gradient-center":{"type":"array","requires":[{"sky-type":"gradient"}],"value":"number","default":[0,0],"length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{"type":"number","requires":[{"sky-type":"gradient"}],"default":90,"minimum":0,"maximum":180,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"transition":false,"requires":[{"sky-type":"gradient"}],"expression":{"interpolated":true,"parameters":["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-atmosphere-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"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"},"color-ramp":{"type":"property-type"},"data-constant":{"type":"property-type"},"constant":{"type":"property-type"}},"promoteId":{"*":{"type":"string"}}}');function Mr(t,...e){for(const i of e)for(const n in i)t[n]=i[n];return t}function Ht(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function ci(t){if(Array.isArray(t))return t.map(ci);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){const e={};for(const i in t)e[i]=ci(t[i]);return e}return Ht(t)}class ic extends Error{constructor(e,i){super(i),this.message=i,this.key=e}}var lr=ic;class Ia{constructor(e,i=[]){this.parent=e,this.bindings={};for(const[n,s]of i)this.bindings[n]=s}concat(e){return new Ia(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}var rc=Ia;const qn={kind:"null"},Oe={kind:"number"},ut={kind:"string"},st={kind:"boolean"},Bi={kind:"color"},er={kind:"object"},at={kind:"value"},Oi={kind:"collator"},ko={kind:"formatted"},yn={kind:"resolvedImage"};function Ni(t,e){return{kind:"array",itemType:t,N:e}}function Ot(t){if(t.kind==="array"){const e=Ot(t.itemType);return typeof t.N=="number"?`array<${e}, ${t.N}>`:t.itemType.kind==="value"?"array":`array<${e}>`}return t.kind}const nc=[qn,Oe,ut,st,Bi,ko,er,Ni(at),yn];function Ar(t,e){if(e.kind==="error")return null;if(t.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!Ar(t.itemType,e.itemType))&&(typeof t.N!="number"||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if(t.kind==="value"){for(const i of nc)if(!Ar(i,e))return null}}return`Expected ${Ot(t)} but found ${Ot(e)} instead.`}function Do(t,e){return e.some(i=>i.kind===t.kind)}function Lo(t,e){return e.some(i=>i==="null"?t===null:i==="array"?Array.isArray(t):i==="object"?t&&!Array.isArray(t)&&typeof t=="object":i===typeof t)}var Ca,oc={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Ro(t){return(t=Math.round(t))<0?0:t>255?255:t}function Bo(t){return Ro(t[t.length-1]==="%"?parseFloat(t)/100*255:parseInt(t))}function Ss(t){return(e=t[t.length-1]==="%"?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e}function Wn(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}try{Ca={}.parseCSSColor=function(t){var e,i=t.replace(/ /g,"").toLowerCase();if(i in oc)return oc[i].slice();if(i[0]==="#")return i.length===4?(e=parseInt(i.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:i.length===7&&(e=parseInt(i.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var n=i.indexOf("("),s=i.indexOf(")");if(n!==-1&&s+1===i.length){var c=i.substr(0,n),u=i.substr(n+1,s-(n+1)).split(","),p=1;switch(c){case"rgba":if(u.length!==4)return null;p=Ss(u.pop());case"rgb":return u.length!==3?null:[Bo(u[0]),Bo(u[1]),Bo(u[2]),p];case"hsla":if(u.length!==4)return null;p=Ss(u.pop());case"hsl":if(u.length!==3)return null;var m=(parseFloat(u[0])%360+360)%360/360,_=Ss(u[1]),x=Ss(u[2]),b=x<=.5?x*(_+1):x+_-x*_,w=2*x-b;return[Ro(255*Wn(w,b,m+1/3)),Ro(255*Wn(w,b,m)),Ro(255*Wn(w,b,m-1/3)),p];default:return null}}return null}}catch{}class Mi{constructor(e,i,n,s=1){this.r=e,this.g=i,this.b=n,this.a=s}static parse(e){if(!e)return;if(e instanceof Mi)return e;if(typeof e!="string")return;const i=Ca(e);return i?new Mi(i[0]/255*i[3],i[1]/255*i[3],i[2]/255*i[3],i[3]):void 0}toString(){const[e,i,n,s]=this.toArray();return`rgba(${Math.round(e)},${Math.round(i)},${Math.round(n)},${s})`}toArray(){const{r:e,g:i,b:n,a:s}=this;return s===0?[0,0,0,0]:[255*e/s,255*i/s,255*n/s,s]}toArray01(){const{r:e,g:i,b:n,a:s}=this;return s===0?[0,0,0,0]:[e/s,i/s,n/s,s]}toArray01PremultipliedAlpha(){const{r:e,g:i,b:n,a:s}=this;return[e,i,n,s]}}Mi.black=new Mi(0,0,0,1),Mi.white=new Mi(1,1,1,1),Mi.transparent=new Mi(0,0,0,0),Mi.red=new Mi(1,0,0,1),Mi.blue=new Mi(0,0,1,1);var Zt=Mi;class za{constructor(e,i,n){this.sensitivity=e?i?"variant":"case":i?"accent":"base",this.locale=n,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,i){return this.collator.compare(e,i)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Pa{constructor(e,i,n,s,c){this.text=e.normalize?e.normalize():e,this.image=i,this.scale=n,this.fontStack=s,this.textColor=c}}class Ai{constructor(e){this.sections=e}static fromString(e){return new Ai([new Pa(e,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof Ai?e:Ai.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}serialize(){const e=["format"];for(const i of this.sections){if(i.image){e.push(["image",i.image.name]);continue}e.push(i.text);const n={};i.fontStack&&(n["text-font"]=["literal",i.fontStack.split(",")]),i.scale&&(n["font-scale"]=i.scale),i.textColor&&(n["text-color"]=["rgba"].concat(i.textColor.toArray())),e.push(n)}return e}}class ji{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new ji({name:e,available:!1}):null}serialize(){return["image",this.name]}}function sc(t,e,i,n){return typeof t=="number"&&t>=0&&t<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof i=="number"&&i>=0&&i<=255?n===void 0||typeof n=="number"&&n>=0&&n<=1?null:`Invalid rgba value [${[t,e,i,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof n=="number"?[t,e,i,n]:[t,e,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Oo(t){if(t===null||typeof t=="string"||typeof t=="boolean"||typeof t=="number"||t instanceof Zt||t instanceof za||t instanceof Ai||t instanceof ji)return!0;if(Array.isArray(t)){for(const e of t)if(!Oo(e))return!1;return!0}if(typeof t=="object"){for(const e in t)if(!Oo(t[e]))return!1;return!0}return!1}function Gt(t){if(t===null)return qn;if(typeof t=="string")return ut;if(typeof t=="boolean")return st;if(typeof t=="number")return Oe;if(t instanceof Zt)return Bi;if(t instanceof za)return Oi;if(t instanceof Ai)return ko;if(t instanceof ji)return yn;if(Array.isArray(t)){const e=t.length;let i;for(const n of t){const s=Gt(n);if(i){if(i===s)continue;i=at;break}i=s}return Ni(i||at,e)}return er}function Fo(t){const e=typeof t;return t===null?"":e==="string"||e==="number"||e==="boolean"?String(t):t instanceof Zt||t instanceof Ai||t instanceof ji?t.toString():JSON.stringify(t)}class ka{constructor(e,i){this.type=e,this.value=i}static parse(e,i){if(e.length!==2)return i.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!Oo(e[1]))return i.error("invalid value");const n=e[1];let s=Gt(n);const c=i.expectedType;return s.kind!=="array"||s.N!==0||!c||c.kind!=="array"||typeof c.N=="number"&&c.N!==0||(s=c),new ka(s,n)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof Zt?["rgba"].concat(this.value.toArray()):this.value instanceof Ai?this.value.serialize():this.value}}var xn=ka,fi=class{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}};const Da={string:ut,number:Oe,boolean:st,object:er};class La{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");let n,s=1;const c=e[0];if(c==="array"){let p,m;if(e.length>2){const _=e[1];if(typeof _!="string"||!(_ in Da)||_==="object")return i.error('The item type argument of "array" must be one of string, number, boolean',1);p=Da[_],s++}else p=at;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return i.error('The length argument to "array" must be a positive integer literal',2);m=e[2],s++}n=Ni(p,m)}else n=Da[c];const u=[];for(;se.outputDefined())}serialize(){const e=this.type,i=[e.kind];if(e.kind==="array"){const n=e.itemType;if(n.kind==="string"||n.kind==="number"||n.kind==="boolean"){i.push(n.kind);const s=e.N;(typeof s=="number"||this.args.length>1)&&i.push(s)}}return i.concat(this.args.map(n=>n.serialize()))}}var Ir=La;class Kr{constructor(e){this.type=ko,this.sections=e}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");const n=e[1];if(!Array.isArray(n)&&typeof n=="object")return i.error("First argument must be an image or text section.");const s=[];let c=!1;for(let u=1;u<=e.length-1;++u){const p=e[u];if(c&&typeof p=="object"&&!Array.isArray(p)){c=!1;let m=null;if(p["font-scale"]&&(m=i.parse(p["font-scale"],1,Oe),!m))return null;let _=null;if(p["text-font"]&&(_=i.parse(p["text-font"],1,Ni(ut)),!_))return null;let x=null;if(p["text-color"]&&(x=i.parse(p["text-color"],1,Bi),!x))return null;const b=s[s.length-1];b.scale=m,b.font=_,b.textColor=x}else{const m=i.parse(e[u],1,at);if(!m)return null;const _=m.type.kind;if(_!=="string"&&_!=="value"&&_!=="null"&&_!=="resolvedImage")return i.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");c=!0,s.push({content:m,scale:null,font:null,textColor:null})}}return new Kr(s)}evaluate(e){return new Ai(this.sections.map(i=>{const n=i.content.evaluate(e);return Gt(n)===yn?new Pa("",n,null,null,null):new Pa(Fo(n),null,i.scale?i.scale.evaluate(e):null,i.font?i.font.evaluate(e).join(","):null,i.textColor?i.textColor.evaluate(e):null)}))}eachChild(e){for(const i of this.sections)e(i.content),i.scale&&e(i.scale),i.font&&e(i.font),i.textColor&&e(i.textColor)}outputDefined(){return!1}serialize(){const e=["format"];for(const i of this.sections){e.push(i.content.serialize());const n={};i.scale&&(n["font-scale"]=i.scale.serialize()),i.font&&(n["text-font"]=i.font.serialize()),i.textColor&&(n["text-color"]=i.textColor.serialize()),e.push(n)}return e}}class Ms{constructor(e){this.type=yn,this.input=e}static parse(e,i){if(e.length!==2)return i.error("Expected two arguments.");const n=i.parse(e[1],1,ut);return n?new Ms(n):i.error("No image name provided.")}evaluate(e){const i=this.input.evaluate(e),n=ji.fromString(i);return n&&e.availableImages&&(n.available=e.availableImages.indexOf(i)>-1),n}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const Ih={"to-boolean":st,"to-color":Bi,"to-number":Oe,"to-string":ut};class Ra{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");const n=e[0];if((n==="to-boolean"||n==="to-string")&&e.length!==2)return i.error("Expected one argument.");const s=Ih[n],c=[];for(let u=1;u4?`Invalid rbga value ${JSON.stringify(i)}: expected an array containing either three or four numeric values.`:sc(i[0],i[1],i[2],i[3]),!n))return new Zt(i[0]/255,i[1]/255,i[2]/255,i[3])}throw new fi(n||`Could not parse color from value '${typeof i=="string"?i:String(JSON.stringify(i))}'`)}if(this.type.kind==="number"){let i=null;for(const n of this.args){if(i=n.evaluate(e),i===null)return 0;const s=Number(i);if(!isNaN(s))return s}throw new fi(`Could not convert ${JSON.stringify(i)} to number.`)}return this.type.kind==="formatted"?Ai.fromString(Fo(this.args[0].evaluate(e))):this.type.kind==="resolvedImage"?ji.fromString(Fo(this.args[0].evaluate(e))):Fo(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){if(this.type.kind==="formatted")return new Kr([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new Ms(this.args[0]).serialize();const e=[`to-${this.type.kind}`];return this.eachChild(i=>{e.push(i.serialize())}),e}}var Xn=Ra;const cr=["Unknown","Point","LineString","Polygon"];var Ba=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null}id(){return this.feature&&this.feature.id!==void 0?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?cr[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||{}}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const t=this.featureDistanceData.center,e=this.featureDistanceData.scale,{x:i,y:n}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(i*e-t[0])+this.featureDistanceData.bearing[1]*(n*e-t[1])}return 0}parseColor(t){let e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=Zt.parse(t)),e}};class vn{constructor(e,i,n,s){this.name=e,this.type=i,this._evaluate=n,this.args=s}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map(e=>e.serialize()))}static parse(e,i){const n=e[0],s=vn.definitions[n];if(!s)return i.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0);const c=Array.isArray(s)?s[0]:s.type,u=Array.isArray(s)?[[s[1],s[2]]]:s.overloads,p=u.filter(([_])=>!Array.isArray(_)||_.length===e.length-1);let m=null;for(const[_,x]of p){m=new ja(i.registry,i.path,null,i.scope);const b=[];let w=!1;for(let S=1;S{return w=b,Array.isArray(w)?`(${w.map(Ot).join(", ")})`:`(${Ot(w.type)}...)`;var w}).join(" | "),x=[];for(let b=1;b=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Vo(t,e){const i=(180+t[0])/360,n=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,s=Math.pow(2,e.z);return[Math.round(i*s*zr),Math.round(n*s*zr)]}function ac(t,e,i){const n=t[0]-e[0],s=t[1]-e[1],c=t[0]-i[0],u=t[1]-i[1];return n*u-c*s==0&&n*c<=0&&s*u<=0}function Is(t,e){let i=!1;for(let u=0,p=e.length;u(n=t)[1]!=(c=m[_+1])[1]>n[1]&&n[0]<(c[0]-s[0])*(n[1]-s[1])/(c[1]-s[1])+s[0]&&(i=!i)}}var n,s,c;return i}function Oa(t,e){for(let i=0;i0&&p<0||u<0&&p>0}function Kn(t,e,i){for(const _ of i)for(let x=0;x<_.length-1;++x)if((p=[(u=_[x+1])[0]-(c=_[x])[0],u[1]-c[1]])[0]*(m=[(s=e)[0]-(n=t)[0],s[1]-n[1]])[1]-p[1]*m[0]!=0&&Fa(n,s,c,u)&&Fa(c,u,n,s))return!0;var n,s,c,u,p,m;return!1}function bt(t,e){for(let i=0;ii[2]){const s=.5*n;let c=t[0]-i[0]>s?-n:i[0]-t[0]>s?n:0;c===0&&(c=t[0]-i[2]>s?-n:i[2]-t[0]>s?n:0),t[0]+=c}As(e,t)}function cc(t,e,i,n){const s=Math.pow(2,n.z)*zr,c=[n.x*zr,n.y*zr],u=[];if(!t)return u;for(const p of t)for(const m of p){const _=[m.x+c[0],m.y+c[1]];Va(_,e,i,s),u.push(_)}return u}function Na(t,e,i,n){const s=Math.pow(2,n.z)*zr,c=[n.x*zr,n.y*zr],u=[];if(!t)return u;for(const m of t){const _=[];for(const x of m){const b=[x.x+c[0],x.y+c[1]];As(e,b),_.push(b)}u.push(_)}if(e[2]-e[0]<=s/2){(p=e)[0]=p[1]=1/0,p[2]=p[3]=-1/0;for(const m of u)for(const _ of m)Va(_,e,i,s)}var p;return u}class Yn{constructor(e,i){this.type=st,this.geojson=e,this.geometries=i}static parse(e,i){if(e.length!==2)return i.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Oo(e[1])){const n=e[1];if(n.type==="FeatureCollection")for(let s=0;s{e&&!Jn(i)&&(e=!1)}),e}function Pr(t){if(t instanceof Cr&&t.name==="feature-state")return!1;let e=!0;return t.eachChild(i=>{e&&!Pr(i)&&(e=!1)}),e}function bn(t,e){if(t instanceof Cr&&e.indexOf(t.name)>=0)return!1;let i=!0;return t.eachChild(n=>{i&&!bn(n,e)&&(i=!1)}),i}class zs{constructor(e,i){this.type=i.type,this.name=e,this.boundExpression=i}static parse(e,i){if(e.length!==2||typeof e[1]!="string")return i.error("'var' expression requires exactly one string literal argument.");const n=e[1];return i.scope.has(n)?new zs(n,i.scope.get(n)):i.error(`Unknown variable "${n}". Make sure "${n}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}var hc=zs;class No{constructor(e,i=[],n,s=new rc,c=[]){this.registry=e,this.path=i,this.key=i.map(u=>`[${u}]`).join(""),this.scope=s,this.errors=c,this.expectedType=n}parse(e,i,n,s,c={}){return i?this.concat(i,n,s)._parse(e,c):this._parse(e,c)}_parse(e,i){function n(s,c,u){return u==="assert"?new Ir(c,[s]):u==="coerce"?new Xn(c,[s]):s}if(e!==null&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"||(e=["literal",e]),Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const s=e[0];if(typeof s!="string")return this.error(`Expression name must be a string, but found ${typeof s} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const c=this.registry[s];if(c){let u=c.parse(e,this);if(!u)return null;if(this.expectedType){const p=this.expectedType,m=u.type;if(p.kind!=="string"&&p.kind!=="number"&&p.kind!=="boolean"&&p.kind!=="object"&&p.kind!=="array"||m.kind!=="value")if(p.kind!=="color"&&p.kind!=="formatted"&&p.kind!=="resolvedImage"||m.kind!=="value"&&m.kind!=="string"){if(this.checkSubtype(p,m))return null}else u=n(u,p,i.typeAnnotation||"coerce");else u=n(u,p,i.typeAnnotation||"assert")}if(!(u instanceof xn)&&u.type.kind!=="resolvedImage"&&Ga(u)){const p=new Ba;try{u=new xn(u.type,u.evaluate(p))}catch(m){return this.error(m.message),null}}return u}return this.error(`Unknown expression "${s}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(e===void 0?"'undefined' value invalid. Use null instead.":typeof e=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,i,n){const s=typeof e=="number"?this.path.concat(e):this.path,c=n?this.scope.concat(n):this.scope;return new No(this.registry,s,i||null,c,this.errors)}error(e,...i){const n=`${this.key}${i.map(s=>`[${s}]`).join("")}`;this.errors.push(new lr(n,e))}checkSubtype(e,i){const n=Ar(e,i);return n&&this.error(n),n}}var ja=No;function Ga(t){if(t instanceof hc)return Ga(t.boundExpression);if(t instanceof Cr&&t.name==="error"||t instanceof Uo||t instanceof Cs)return!1;const e=t instanceof Xn||t instanceof Ir;let i=!0;return t.eachChild(n=>{i=e?i&&Ga(n):i&&n instanceof xn}),!!i&&Jn(t)&&bn(t,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"])}function Ps(t,e){const i=t.length-1;let n,s,c=0,u=i,p=0;for(;c<=u;)if(p=Math.floor((c+u)/2),n=t[p],s=t[p+1],n<=e){if(p===i||ee))throw new fi("Input is not a number.");u=p-1}return 0}class ks{constructor(e,i,n){this.type=e,this.input=i,this.labels=[],this.outputs=[];for(const[s,c]of n)this.labels.push(s),this.outputs.push(c)}static parse(e,i){if(e.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return i.error("Expected an even number of arguments.");const n=i.parse(e[1],1,Oe);if(!n)return null;const s=[];let c=null;i.expectedType&&i.expectedType.kind!=="value"&&(c=i.expectedType);for(let u=1;u=p)return i.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',_);const b=i.parse(m,x,c);if(!b)return null;c=c||b.type,s.push([p,b])}return new ks(c,n,s)}evaluate(e){const i=this.labels,n=this.outputs;if(i.length===1)return n[0].evaluate(e);const s=this.input.evaluate(e);if(s<=i[0])return n[0].evaluate(e);const c=i.length;return s>=i[c-1]?n[c-1].evaluate(e):n[Ps(i,s)].evaluate(e)}eachChild(e){e(this.input);for(const i of this.outputs)e(i)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}serialize(){const e=["step",this.input.serialize()];for(let i=0;i0&&e.push(this.labels[i]),e.push(this.outputs[i].serialize());return e}}var $a=ks;function mt(t,e,i){return t*(1-i)+e*i}var jo=Object.freeze({__proto__:null,array:function(t,e,i){return t.map((n,s)=>mt(n,e[s],i))},color:function(t,e,i){return new Zt(mt(t.r,e.r,i),mt(t.g,e.g,i),mt(t.b,e.b,i),mt(t.a,e.a,i))},number:mt});const uc=.95047,Za=1.08883,dc=4/29,wn=6/29,qa=3*wn*wn,zh=wn*wn*wn,Ph=Math.PI/180,kh=180/Math.PI;function Wa(t){return t>zh?Math.pow(t,1/3):t/qa+dc}function Xa(t){return t>wn?t*t*t:qa*(t-dc)}function Ha(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Ds(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function pc(t){const e=Ds(t.r),i=Ds(t.g),n=Ds(t.b),s=Wa((.4124564*e+.3575761*i+.1804375*n)/uc),c=Wa((.2126729*e+.7151522*i+.072175*n)/1);return{l:116*c-16,a:500*(s-c),b:200*(c-Wa((.0193339*e+.119192*i+.9503041*n)/Za)),alpha:t.a}}function fc(t){let e=(t.l+16)/116,i=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*Xa(e),i=uc*Xa(i),n=Za*Xa(n),new Zt(Ha(3.2404542*i-1.5371385*e-.4985314*n),Ha(-.969266*i+1.8760108*e+.041556*n),Ha(.0556434*i-.2040259*e+1.0572252*n),t.alpha)}function Dh(t,e,i){const n=e-t;return t+i*(n>180||n<-180?n-360*Math.round(n/360):n)}const Go={forward:pc,reverse:fc,interpolate:function(t,e,i){return{l:mt(t.l,e.l,i),a:mt(t.a,e.a,i),b:mt(t.b,e.b,i),alpha:mt(t.alpha,e.alpha,i)}}},Qn={forward:function(t){const{l:e,a:i,b:n}=pc(t),s=Math.atan2(n,i)*kh;return{h:s<0?s+360:s,c:Math.sqrt(i*i+n*n),l:e,alpha:t.a}},reverse:function(t){const e=t.h*Ph,i=t.c;return fc({l:t.l,a:Math.cos(e)*i,b:Math.sin(e)*i,alpha:t.alpha})},interpolate:function(t,e,i){return{h:Dh(t.h,e.h,i),c:mt(t.c,e.c,i),l:mt(t.l,e.l,i),alpha:mt(t.alpha,e.alpha,i)}}};var Ka=Object.freeze({__proto__:null,hcl:Qn,lab:Go});class $o{constructor(e,i,n,s,c){this.type=e,this.operator=i,this.interpolation=n,this.input=s,this.labels=[],this.outputs=[];for(const[u,p]of c)this.labels.push(u),this.outputs.push(p)}static interpolationFactor(e,i,n,s){let c=0;if(e.name==="exponential")c=Ya(i,e.base,n,s);else if(e.name==="linear")c=Ya(i,1,n,s);else if(e.name==="cubic-bezier"){const u=e.controlPoints;c=new hn(u[0],u[1],u[2],u[3]).solve(Ya(i,1,n,s))}return c}static parse(e,i){let[n,s,c,...u]=e;if(!Array.isArray(s)||s.length===0)return i.error("Expected an interpolation type expression.",1);if(s[0]==="linear")s={name:"linear"};else if(s[0]==="exponential"){const _=s[1];if(typeof _!="number")return i.error("Exponential interpolation requires a numeric base.",1,1);s={name:"exponential",base:_}}else{if(s[0]!=="cubic-bezier")return i.error(`Unknown interpolation type ${String(s[0])}`,1,0);{const _=s.slice(1);if(_.length!==4||_.some(x=>typeof x!="number"||x<0||x>1))return i.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);s={name:"cubic-bezier",controlPoints:_}}}if(e.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return i.error("Expected an even number of arguments.");if(c=i.parse(c,2,Oe),!c)return null;const p=[];let m=null;n==="interpolate-hcl"||n==="interpolate-lab"?m=Bi:i.expectedType&&i.expectedType.kind!=="value"&&(m=i.expectedType);for(let _=0;_=x)return i.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',w);const M=i.parse(b,S,m);if(!M)return null;m=m||M.type,p.push([x,M])}return m.kind==="number"||m.kind==="color"||m.kind==="array"&&m.itemType.kind==="number"&&typeof m.N=="number"?new $o(m,n,s,c,p):i.error(`Type ${Ot(m)} is not interpolatable.`)}evaluate(e){const i=this.labels,n=this.outputs;if(i.length===1)return n[0].evaluate(e);const s=this.input.evaluate(e);if(s<=i[0])return n[0].evaluate(e);const c=i.length;if(s>=i[c-1])return n[c-1].evaluate(e);const u=Ps(i,s),p=$o.interpolationFactor(this.interpolation,s,i[u],i[u+1]),m=n[u].evaluate(e),_=n[u+1].evaluate(e);return this.operator==="interpolate"?jo[this.type.kind.toLowerCase()](m,_,p):this.operator==="interpolate-hcl"?Qn.reverse(Qn.interpolate(Qn.forward(m),Qn.forward(_),p)):Go.reverse(Go.interpolate(Go.forward(m),Go.forward(_),p))}eachChild(e){e(this.input);for(const i of this.outputs)e(i)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}serialize(){let e;e=this.interpolation.name==="linear"?["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const i=[this.operator,e,this.input.serialize()];for(let n=0;nAr(s,p.type));return new Ls(u?at:n,c)}evaluate(e){let i,n=null,s=0;for(const c of this.args){if(s++,n=c.evaluate(e),n&&n instanceof ji&&!n.available&&(i||(i=n),n=null,s===this.args.length))return i;if(n!==null)break}return n}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){const e=["coalesce"];return this.eachChild(i=>{e.push(i.serialize())}),e}}var Ja=Ls;class Rs{constructor(e,i){this.type=i.type,this.bindings=[].concat(e),this.result=i}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const i of this.bindings)e(i[1]);e(this.result)}static parse(e,i){if(e.length<4)return i.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const n=[];for(let c=1;c=n.length)throw new fi(`Array index out of bounds: ${i} > ${n.length-1}.`);if(i!==Math.floor(i))throw new fi(`Array index must be an integer, but found ${i} instead.`);return n[i]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}var Lh=Qa;class el{constructor(e,i){this.type=st,this.needle=e,this.haystack=i}static parse(e,i){if(e.length!==3)return i.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const n=i.parse(e[1],1,at),s=i.parse(e[2],2,at);return n&&s?Do(n.type,[st,ut,Oe,qn,at])?new el(n,s):i.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ot(n.type)} instead`):null}evaluate(e){const i=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(n==null)return!1;if(!Lo(i,["boolean","string","number","null"]))throw new fi(`Expected first argument to be of type boolean, string, number or null, but found ${Ot(Gt(i))} instead.`);if(!Lo(n,["string","array"]))throw new fi(`Expected second argument to be of type array or string, but found ${Ot(Gt(n))} instead.`);return n.indexOf(i)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}var Bs=el;class Zo{constructor(e,i,n){this.type=Oe,this.needle=e,this.haystack=i,this.fromIndex=n}static parse(e,i){if(e.length<=2||e.length>=5)return i.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const n=i.parse(e[1],1,at),s=i.parse(e[2],2,at);if(!n||!s)return null;if(!Do(n.type,[st,ut,Oe,qn,at]))return i.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ot(n.type)} instead`);if(e.length===4){const c=i.parse(e[3],3,Oe);return c?new Zo(n,s,c):null}return new Zo(n,s)}evaluate(e){const i=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!Lo(i,["boolean","string","number","null"]))throw new fi(`Expected first argument to be of type boolean, string, number or null, but found ${Ot(Gt(i))} instead.`);if(!Lo(n,["string","array"]))throw new fi(`Expected second argument to be of type array or string, but found ${Ot(Gt(n))} instead.`);if(this.fromIndex){const s=this.fromIndex.evaluate(e);return n.indexOf(i,s)}return n.indexOf(i)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}serialize(){if(this.fromIndex!=null&&this.fromIndex!==void 0){const e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}var _c=Zo;class tl{constructor(e,i,n,s,c,u){this.inputType=e,this.type=i,this.input=n,this.cases=s,this.outputs=c,this.otherwise=u}static parse(e,i){if(e.length<5)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return i.error("Expected an even number of arguments.");let n,s;i.expectedType&&i.expectedType.kind!=="value"&&(s=i.expectedType);const c={},u=[];for(let _=2;_Number.MAX_SAFE_INTEGER)return w.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof M=="number"&&Math.floor(M)!==M)return w.error("Numeric branch labels must be integer values.");if(n){if(w.checkSubtype(n,Gt(M)))return null}else n=Gt(M);if(c[String(M)]!==void 0)return w.error("Branch labels must be unique.");c[String(M)]=u.length}const S=i.parse(b,_,s);if(!S)return null;s=s||S.type,u.push(S)}const p=i.parse(e[1],1,at);if(!p)return null;const m=i.parse(e[e.length-1],e.length-1,s);return m?p.type.kind!=="value"&&i.concat(1).checkSubtype(n,p.type)?null:new tl(n,s,p,c,u,m):null}evaluate(e){const i=this.input.evaluate(e);return(Gt(i)===this.inputType&&this.outputs[this.cases[i]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}serialize(){const e=["match",this.input.serialize()],i=Object.keys(this.cases).sort(),n=[],s={};for(const u of i){const p=s[this.cases[u]];p===void 0?(s[this.cases[u]]=n.length,n.push([this.cases[u],[u]])):n[p][1].push(u)}const c=u=>this.inputType.kind==="number"?Number(u):u;for(const[u,p]of n)e.push(p.length===1?c(p[0]):p.map(c)),e.push(this.outputs[u].serialize());return e.push(this.otherwise.serialize()),e}}var Rh=tl;class il{constructor(e,i,n){this.type=e,this.branches=i,this.otherwise=n}static parse(e,i){if(e.length<4)return i.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return i.error("Expected an odd number of arguments.");let n;i.expectedType&&i.expectedType.kind!=="value"&&(n=i.expectedType);const s=[];for(let u=1;ui.outputDefined())&&this.otherwise.outputDefined()}serialize(){const e=["case"];return this.eachChild(i=>{e.push(i.serialize())}),e}}var gc=il;class qo{constructor(e,i,n,s){this.type=e,this.input=i,this.beginIndex=n,this.endIndex=s}static parse(e,i){if(e.length<=2||e.length>=5)return i.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const n=i.parse(e[1],1,at),s=i.parse(e[2],2,Oe);if(!n||!s)return null;if(!Do(n.type,[Ni(at),ut,at]))return i.error(`Expected first argument to be of type array or string, but found ${Ot(n.type)} instead`);if(e.length===4){const c=i.parse(e[3],3,Oe);return c?new qo(n.type,n,s,c):null}return new qo(n.type,n,s)}evaluate(e){const i=this.input.evaluate(e),n=this.beginIndex.evaluate(e);if(!Lo(i,["string","array"]))throw new fi(`Expected first argument to be of type array or string, but found ${Ot(Gt(i))} instead.`);if(this.endIndex){const s=this.endIndex.evaluate(e);return i.slice(n,s)}return i.slice(n)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}serialize(){if(this.endIndex!=null&&this.endIndex!==void 0){const e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}var yc=qo;function Os(t,e){return t==="=="||t==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function xc(t,e,i,n){return n.compare(e,i)===0}function eo(t,e,i){const n=t!=="=="&&t!=="!=";return class Ff{constructor(c,u,p){this.type=st,this.lhs=c,this.rhs=u,this.collator=p,this.hasUntypedArgument=c.type.kind==="value"||u.type.kind==="value"}static parse(c,u){if(c.length!==3&&c.length!==4)return u.error("Expected two or three arguments.");const p=c[0];let m=u.parse(c[1],1,at);if(!m)return null;if(!Os(p,m.type))return u.concat(1).error(`"${p}" comparisons are not supported for type '${Ot(m.type)}'.`);let _=u.parse(c[2],2,at);if(!_)return null;if(!Os(p,_.type))return u.concat(2).error(`"${p}" comparisons are not supported for type '${Ot(_.type)}'.`);if(m.type.kind!==_.type.kind&&m.type.kind!=="value"&&_.type.kind!=="value")return u.error(`Cannot compare types '${Ot(m.type)}' and '${Ot(_.type)}'.`);n&&(m.type.kind==="value"&&_.type.kind!=="value"?m=new Ir(_.type,[m]):m.type.kind!=="value"&&_.type.kind==="value"&&(_=new Ir(m.type,[_])));let x=null;if(c.length===4){if(m.type.kind!=="string"&&_.type.kind!=="string"&&m.type.kind!=="value"&&_.type.kind!=="value")return u.error("Cannot use collator to compare non-string types.");if(x=u.parse(c[3],3,Oi),!x)return null}return new Ff(m,_,x)}evaluate(c){const u=this.lhs.evaluate(c),p=this.rhs.evaluate(c);if(n&&this.hasUntypedArgument){const m=Gt(u),_=Gt(p);if(m.kind!==_.kind||m.kind!=="string"&&m.kind!=="number")throw new fi(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${m.kind}, ${_.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const m=Gt(u),_=Gt(p);if(m.kind!=="string"||_.kind!=="string")return e(c,u,p)}return this.collator?i(c,u,p,this.collator.evaluate(c)):e(c,u,p)}eachChild(c){c(this.lhs),c(this.rhs),this.collator&&c(this.collator)}outputDefined(){return!0}serialize(){const c=[t];return this.eachChild(u=>{c.push(u.serialize())}),c}}}const Bh=eo("==",function(t,e,i){return e===i},xc),Oh=eo("!=",function(t,e,i){return e!==i},function(t,e,i,n){return!xc(0,e,i,n)}),Fh=eo("<",function(t,e,i){return e",function(t,e,i){return e>i},function(t,e,i,n){return n.compare(e,i)>0}),Vh=eo("<=",function(t,e,i){return e<=i},function(t,e,i,n){return n.compare(e,i)<=0}),vc=eo(">=",function(t,e,i){return e>=i},function(t,e,i,n){return n.compare(e,i)>=0});class Fs{constructor(e,i,n,s,c,u){this.type=ut,this.number=e,this.locale=i,this.currency=n,this.unit=s,this.minFractionDigits=c,this.maxFractionDigits=u}static parse(e,i){if(e.length!==3)return i.error("Expected two arguments.");const n=i.parse(e[1],1,Oe);if(!n)return null;const s=e[2];if(typeof s!="object"||Array.isArray(s))return i.error("NumberFormat options argument must be an object.");let c=null;if(s.locale&&(c=i.parse(s.locale,1,ut),!c))return null;let u=null;if(s.currency&&(u=i.parse(s.currency,1,ut),!u))return null;let p=null;if(s.unit&&(p=i.parse(s.unit,1,ut),!p))return null;let m=null;if(s["min-fraction-digits"]&&(m=i.parse(s["min-fraction-digits"],1,Oe),!m))return null;let _=null;return s["max-fraction-digits"]&&(_=i.parse(s["max-fraction-digits"],1,Oe),!_)?null:new Fs(n,c,u,p,m,_)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.unit&&(e.unit=this.unit.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]}}class to{constructor(e){this.type=Oe,this.input=e}static parse(e,i){if(e.length!==2)return i.error(`Expected 1 argument, but found ${e.length-1} instead.`);const n=i.parse(e[1],1);return n?n.type.kind!=="array"&&n.type.kind!=="string"&&n.type.kind!=="value"?i.error(`Expected argument of type string or array, but found ${Ot(n.type)} instead.`):new to(n):null}evaluate(e){const i=this.input.evaluate(e);if(typeof i=="string"||Array.isArray(i))return i.length;throw new fi(`Expected value to be of type string or array, but found ${Ot(Gt(i))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){const e=["length"];return this.eachChild(i=>{e.push(i.serialize())}),e}}const bc={"==":Bh,"!=":Oh,">":Uh,"<":Fh,">=":vc,"<=":Vh,array:Ir,at:Lh,boolean:Ir,case:gc,coalesce:Ja,collator:Uo,format:Kr,image:Ms,in:Bs,"index-of":_c,interpolate:hr,"interpolate-hcl":hr,"interpolate-lab":hr,length:to,let:mc,literal:xn,match:Rh,number:Ir,"number-format":Fs,object:Ir,slice:yc,step:$a,string:Ir,"to-boolean":Xn,"to-color":Xn,"to-number":Xn,"to-string":Xn,var:hc,within:Cs};function wc(t,[e,i,n,s]){e=e.evaluate(t),i=i.evaluate(t),n=n.evaluate(t);const c=s?s.evaluate(t):1,u=sc(e,i,n,c);if(u)throw new fi(u);return new Zt(e/255*c,i/255*c,n/255*c,c)}function kr(t,e){return t in e}function Us(t,e){const i=e[t];return i===void 0?null:i}function Gi(t){return{type:t}}Cr.register(bc,{error:[{kind:"error"},[ut],(t,[e])=>{throw new fi(e.evaluate(t))}],typeof:[ut,[at],(t,[e])=>Ot(Gt(e.evaluate(t)))],"to-rgba":[Ni(Oe,4),[Bi],(t,[e])=>e.evaluate(t).toArray()],rgb:[Bi,[Oe,Oe,Oe],wc],rgba:[Bi,[Oe,Oe,Oe,Oe],wc],has:{type:st,overloads:[[[ut],(t,[e])=>kr(e.evaluate(t),t.properties())],[[ut,er],(t,[e,i])=>kr(e.evaluate(t),i.evaluate(t))]]},get:{type:at,overloads:[[[ut],(t,[e])=>Us(e.evaluate(t),t.properties())],[[ut,er],(t,[e,i])=>Us(e.evaluate(t),i.evaluate(t))]]},"feature-state":[at,[ut],(t,[e])=>Us(e.evaluate(t),t.featureState||{})],properties:[er,[],t=>t.properties()],"geometry-type":[ut,[],t=>t.geometryType()],id:[at,[],t=>t.id()],zoom:[Oe,[],t=>t.globals.zoom],pitch:[Oe,[],t=>t.globals.pitch||0],"distance-from-center":[Oe,[],t=>t.distanceFromCenter()],"heatmap-density":[Oe,[],t=>t.globals.heatmapDensity||0],"line-progress":[Oe,[],t=>t.globals.lineProgress||0],"sky-radial-progress":[Oe,[],t=>t.globals.skyRadialProgress||0],accumulated:[at,[],t=>t.globals.accumulated===void 0?null:t.globals.accumulated],"+":[Oe,Gi(Oe),(t,e)=>{let i=0;for(const n of e)i+=n.evaluate(t);return i}],"*":[Oe,Gi(Oe),(t,e)=>{let i=1;for(const n of e)i*=n.evaluate(t);return i}],"-":{type:Oe,overloads:[[[Oe,Oe],(t,[e,i])=>e.evaluate(t)-i.evaluate(t)],[[Oe],(t,[e])=>-e.evaluate(t)]]},"/":[Oe,[Oe,Oe],(t,[e,i])=>e.evaluate(t)/i.evaluate(t)],"%":[Oe,[Oe,Oe],(t,[e,i])=>e.evaluate(t)%i.evaluate(t)],ln2:[Oe,[],()=>Math.LN2],pi:[Oe,[],()=>Math.PI],e:[Oe,[],()=>Math.E],"^":[Oe,[Oe,Oe],(t,[e,i])=>Math.pow(e.evaluate(t),i.evaluate(t))],sqrt:[Oe,[Oe],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[Oe,[Oe],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[Oe,[Oe],(t,[e])=>Math.log(e.evaluate(t))],log2:[Oe,[Oe],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[Oe,[Oe],(t,[e])=>Math.sin(e.evaluate(t))],cos:[Oe,[Oe],(t,[e])=>Math.cos(e.evaluate(t))],tan:[Oe,[Oe],(t,[e])=>Math.tan(e.evaluate(t))],asin:[Oe,[Oe],(t,[e])=>Math.asin(e.evaluate(t))],acos:[Oe,[Oe],(t,[e])=>Math.acos(e.evaluate(t))],atan:[Oe,[Oe],(t,[e])=>Math.atan(e.evaluate(t))],min:[Oe,Gi(Oe),(t,e)=>Math.min(...e.map(i=>i.evaluate(t)))],max:[Oe,Gi(Oe),(t,e)=>Math.max(...e.map(i=>i.evaluate(t)))],abs:[Oe,[Oe],(t,[e])=>Math.abs(e.evaluate(t))],round:[Oe,[Oe],(t,[e])=>{const i=e.evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[Oe,[Oe],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[Oe,[Oe],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[st,[ut,at],(t,[e,i])=>t.properties()[e.value]===i.value],"filter-id-==":[st,[at],(t,[e])=>t.id()===e.value],"filter-type-==":[st,[ut],(t,[e])=>t.geometryType()===e.value],"filter-<":[st,[ut,at],(t,[e,i])=>{const n=t.properties()[e.value],s=i.value;return typeof n==typeof s&&n{const i=t.id(),n=e.value;return typeof i==typeof n&&i":[st,[ut,at],(t,[e,i])=>{const n=t.properties()[e.value],s=i.value;return typeof n==typeof s&&n>s}],"filter-id->":[st,[at],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i>n}],"filter-<=":[st,[ut,at],(t,[e,i])=>{const n=t.properties()[e.value],s=i.value;return typeof n==typeof s&&n<=s}],"filter-id-<=":[st,[at],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i<=n}],"filter->=":[st,[ut,at],(t,[e,i])=>{const n=t.properties()[e.value],s=i.value;return typeof n==typeof s&&n>=s}],"filter-id->=":[st,[at],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i>=n}],"filter-has":[st,[at],(t,[e])=>e.value in t.properties()],"filter-has-id":[st,[],t=>t.id()!==null&&t.id()!==void 0],"filter-type-in":[st,[Ni(ut)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[st,[Ni(at)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[st,[ut,Ni(at)],(t,[e,i])=>i.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[st,[ut,Ni(at)],(t,[e,i])=>function(n,s,c,u){for(;c<=u;){const p=c+u>>1;if(s[p]===n)return!0;s[p]>n?u=p-1:c=p+1}return!1}(t.properties()[e.value],i.value,0,i.value.length-1)],all:{type:st,overloads:[[[st,st],(t,[e,i])=>e.evaluate(t)&&i.evaluate(t)],[Gi(st),(t,e)=>{for(const i of e)if(!i.evaluate(t))return!1;return!0}]]},any:{type:st,overloads:[[[st,st],(t,[e,i])=>e.evaluate(t)||i.evaluate(t)],[Gi(st),(t,e)=>{for(const i of e)if(i.evaluate(t))return!0;return!1}]]},"!":[st,[st],(t,[e])=>!e.evaluate(t)],"is-supported-script":[st,[ut],(t,[e])=>{const i=t.globals&&t.globals.isSupportedScript;return!i||i(e.evaluate(t))}],upcase:[ut,[ut],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[ut,[ut],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[ut,Gi(at),(t,e)=>e.map(i=>Fo(i.evaluate(t))).join("")],"resolved-locale":[ut,[Oi],(t,[e])=>e.evaluate(t).resolvedLocale()]});var Wo=bc;function Tc(t){return{result:"success",value:t}}function Tn(t){return{result:"error",value:t}}function io(t){return t["property-type"]==="data-driven"}function Vs(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Ns(t){return!!t.expression&&t.expression.interpolated}function _t(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":t===null?"null":typeof t}function Xo(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Ec(t){return t}function js(t,e){const i=e.type==="color",n=t.stops&&typeof t.stops[0][0]=="object",s=n||!(n||t.property!==void 0),c=t.type||(Ns(e)?"exponential":"interval");if(i&&((t=Mr({},t)).stops&&(t.stops=t.stops.map(_=>[_[0],Zt.parse(_[1])])),t.default=Zt.parse(t.default?t.default:e.default)),t.colorSpace&&t.colorSpace!=="rgb"&&!Ka[t.colorSpace])throw new Error(`Unknown color space: ${t.colorSpace}`);let u,p,m;if(c==="exponential")u=Dr;else if(c==="interval")u=Gs;else if(c==="categorical"){u=Sc,p=Object.create(null);for(const _ of t.stops)p[_[0]]=_[1];m=typeof t.stops[0][0]}else{if(c!=="identity")throw new Error(`Unknown function type "${c}"`);u=Mc}if(n){const _={},x=[];for(let S=0;SS[0]),evaluate:({zoom:S},M)=>Dr({stops:b,base:t.base},e,S).evaluate(S,M)}}if(s){const _=c==="exponential"?{name:"exponential",base:t.base!==void 0?t.base:1}:null;return{kind:"camera",interpolationType:_,interpolationFactor:hr.interpolationFactor.bind(void 0,_),zoomStops:t.stops.map(x=>x[0]),evaluate:({zoom:x})=>u(t,e,x,p,m)}}return{kind:"source",evaluate(_,x){const b=x&&x.properties?x.properties[t.property]:void 0;return b===void 0?ro(t.default,e.default):u(t,e,b,p,m)}}}function ro(t,e,i){return t!==void 0?t:e!==void 0?e:i!==void 0?i:void 0}function Sc(t,e,i,n,s){return ro(typeof i===s?n[i]:void 0,t.default,e.default)}function Gs(t,e,i){if(_t(i)!=="number")return ro(t.default,e.default);const n=t.stops.length;if(n===1||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=Ps(t.stops.map(c=>c[0]),i);return t.stops[s][1]}function Dr(t,e,i){const n=t.base!==void 0?t.base:1;if(_t(i)!=="number")return ro(t.default,e.default);const s=t.stops.length;if(s===1||i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[s-1][0])return t.stops[s-1][1];const c=Ps(t.stops.map(x=>x[0]),i),u=function(x,b,w,S){const M=S-w,C=x-w;return M===0?0:b===1?C/M:(Math.pow(b,C)-1)/(Math.pow(b,M)-1)}(i,n,t.stops[c][0],t.stops[c+1][0]),p=t.stops[c][1],m=t.stops[c+1][1];let _=jo[e.type]||Ec;if(t.colorSpace&&t.colorSpace!=="rgb"){const x=Ka[t.colorSpace];_=(b,w)=>x.reverse(x.interpolate(x.forward(b),x.forward(w),u))}return typeof p.evaluate=="function"?{evaluate(...x){const b=p.evaluate.apply(void 0,x),w=m.evaluate.apply(void 0,x);if(b!==void 0&&w!==void 0)return _(b,w,u)}}:_(p,m,u)}function Mc(t,e,i){return e.type==="color"?i=Zt.parse(i):e.type==="formatted"?i=Ai.fromString(i.toString()):e.type==="resolvedImage"?i=ji.fromString(i.toString()):_t(i)===e.type||e.type==="enum"&&e.values[i]||(i=void 0),ro(i,t.default,e.default)}class $s{constructor(e,i){this.expression=e,this._warningHistory={},this._evaluator=new Ba,this._defaultValue=i?function(n){return n.type==="color"&&(Xo(n.default)||Array.isArray(n.default))?new Zt(0,0,0,0):n.type==="color"?Zt.parse(n.default)||null:n.default===void 0?null:n.default}(i):null,this._enumValues=i&&i.type==="enum"?i.values:null}evaluateWithoutErrorHandling(e,i,n,s,c,u,p,m){return this._evaluator.globals=e,this._evaluator.feature=i,this._evaluator.featureState=n,this._evaluator.canonical=s||null,this._evaluator.availableImages=c||null,this._evaluator.formattedSection=u,this._evaluator.featureTileCoord=p||null,this._evaluator.featureDistanceData=m||null,this.expression.evaluate(this._evaluator)}evaluate(e,i,n,s,c,u,p,m){this._evaluator.globals=e,this._evaluator.feature=i||null,this._evaluator.featureState=n||null,this._evaluator.canonical=s||null,this._evaluator.availableImages=c||null,this._evaluator.formattedSection=u||null,this._evaluator.featureTileCoord=p||null,this._evaluator.featureDistanceData=m||null;try{const _=this.expression.evaluate(this._evaluator);if(_==null||typeof _=="number"&&_!=_)return this._defaultValue;if(this._enumValues&&!(_ in this._enumValues))throw new fi(`Expected value to be one of ${Object.keys(this._enumValues).map(x=>JSON.stringify(x)).join(", ")}, but found ${JSON.stringify(_)} instead.`);return _}catch(_){return this._warningHistory[_.message]||(this._warningHistory[_.message]=!0,typeof console<"u"&&console.warn(_.message)),this._defaultValue}}}function no(t){return Array.isArray(t)&&t.length>0&&typeof t[0]=="string"&&t[0]in Wo}function oo(t,e){const i=new ja(Wo,[],e?function(s){const c={color:Bi,string:ut,number:Oe,enum:ut,boolean:st,formatted:ko,resolvedImage:yn};return s.type==="array"?Ni(c[s.value]||at,s.length):c[s.type]}(e):void 0),n=i.parse(t,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return n?Tc(new $s(n,e)):Tn(i.errors)}class rl{constructor(e,i){this.kind=e,this._styleExpression=i,this.isStateDependent=e!=="constant"&&!Pr(i.expression)}evaluateWithoutErrorHandling(e,i,n,s,c,u){return this._styleExpression.evaluateWithoutErrorHandling(e,i,n,s,c,u)}evaluate(e,i,n,s,c,u){return this._styleExpression.evaluate(e,i,n,s,c,u)}}class Ho{constructor(e,i,n,s){this.kind=e,this.zoomStops=n,this._styleExpression=i,this.isStateDependent=e!=="camera"&&!Pr(i.expression),this.interpolationType=s}evaluateWithoutErrorHandling(e,i,n,s,c,u){return this._styleExpression.evaluateWithoutErrorHandling(e,i,n,s,c,u)}evaluate(e,i,n,s,c,u){return this._styleExpression.evaluate(e,i,n,s,c,u)}interpolationFactor(e,i,n){return this.interpolationType?hr.interpolationFactor(this.interpolationType,e,i,n):0}}function Ko(t,e){if((t=oo(t,e)).result==="error")return t;const i=t.value.expression,n=Jn(i);if(!n&&!io(e))return Tn([new lr("","data expressions not supported")]);const s=bn(i,["zoom","pitch","distance-from-center"]);if(!s&&!Vs(e))return Tn([new lr("","zoom expressions not supported")]);const c=qs(i);return c||s?c instanceof lr?Tn([c]):c instanceof hr&&!Ns(e)?Tn([new lr("",'"interpolate" expressions cannot be used with this property')]):Tc(c?new Ho(n?"camera":"composite",t.value,c.labels,c instanceof hr?c.interpolation:void 0):new rl(n?"constant":"source",t.value)):Tn([new lr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Zs{constructor(e,i){this._parameters=e,this._specification=i,Mr(this,js(this._parameters,this._specification))}static deserialize(e){return new Zs(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function qs(t){let e=null;if(t instanceof mc)e=qs(t.result);else if(t instanceof Ja){for(const i of t.args)if(e=qs(i),e)break}else(t instanceof $a||t instanceof hr)&&t.input instanceof Cr&&t.input.name==="zoom"&&(e=t);return e instanceof lr||t.eachChild(i=>{const n=qs(i);n instanceof lr?e=n:!e&&n?e=new lr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&n&&e!==n&&(e=new lr("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}class Fe{constructor(e,i,n,s){this.message=(e?`${e}: `:"")+n,s&&(this.identifier=s),i!=null&&i.__line__&&(this.line=i.__line__)}}function tr(t){const e=t.key,i=t.value,n=t.valueSpec||{},s=t.objectElementValidators||{},c=t.style,u=t.styleSpec;let p=[];const m=_t(i);if(m!=="object")return[new Fe(e,i,`object expected, ${m} found`)];for(const _ in i){const x=_.split(".")[0];let b;s[x]?b=s[x]:n[x]?b=xi:s["*"]?b=s["*"]:n["*"]&&(b=xi),b?p=p.concat(b({key:(e&&`${e}.`)+_,value:i[_],valueSpec:n[x]||n["*"],style:c,styleSpec:u,object:i,objectKey:_},i)):p.push(new Fe(e,i[_],`unknown property "${_}"`))}for(const _ in n)s[_]||n[_].required&&n[_].default===void 0&&i[_]===void 0&&p.push(new Fe(e,i,`missing required property "${_}"`));return p}function Ac(t){const e=t.value,i=t.valueSpec,n=t.style,s=t.styleSpec,c=t.key,u=t.arrayElementValidator||xi;if(_t(e)!=="array")return[new Fe(c,e,`array expected, ${_t(e)} found`)];if(i.length&&e.length!==i.length)return[new Fe(c,e,`array length ${i.length} expected, length ${e.length} found`)];if(i["min-length"]&&e.lengthc)return[new Fe(e,i,`${i} is greater than the maximum value ${c}`)]}return[]}function Jo(t){const e=t.valueSpec,i=Ht(t.value.type);let n,s,c,u={};const p=i!=="categorical"&&t.value.property===void 0,m=!p,_=_t(t.value.stops)==="array"&&_t(t.value.stops[0])==="array"&&_t(t.value.stops[0][0])==="object",x=tr({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(S){if(i==="identity")return[new Fe(S.key,S.value,'identity function may not have a "stops" property')];let M=[];const C=S.value;return M=M.concat(Ac({key:S.key,value:C,valueSpec:S.valueSpec,style:S.style,styleSpec:S.styleSpec,arrayElementValidator:b})),_t(C)==="array"&&C.length===0&&M.push(new Fe(S.key,C,"array must have at least one stop")),M},default:function(S){return xi({key:S.key,value:S.value,valueSpec:e,style:S.style,styleSpec:S.styleSpec})}}});return i==="identity"&&p&&x.push(new Fe(t.key,t.value,'missing required property "property"')),i==="identity"||t.value.stops||x.push(new Fe(t.key,t.value,'missing required property "stops"')),i==="exponential"&&t.valueSpec.expression&&!Ns(t.valueSpec)&&x.push(new Fe(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(m&&!io(t.valueSpec)?x.push(new Fe(t.key,t.value,"property functions not supported")):p&&!Vs(t.valueSpec)&&x.push(new Fe(t.key,t.value,"zoom functions not supported"))),i!=="categorical"&&!_||t.value.property!==void 0||x.push(new Fe(t.key,t.value,'"property" property is required')),x;function b(S){let M=[];const C=S.value,D=S.key;if(_t(C)!=="array")return[new Fe(D,C,`array expected, ${_t(C)} found`)];if(C.length!==2)return[new Fe(D,C,`array length 2 expected, length ${C.length} found`)];if(_){if(_t(C[0])!=="object")return[new Fe(D,C,`object expected, ${_t(C[0])} found`)];if(C[0].zoom===void 0)return[new Fe(D,C,"object stop key must have zoom")];if(C[0].value===void 0)return[new Fe(D,C,"object stop key must have value")];const U=Ht(C[0].zoom);if(typeof U!="number")return[new Fe(D,C[0].zoom,"stop zoom values must be numbers")];if(c&&c>U)return[new Fe(D,C[0].zoom,"stop zoom values must appear in ascending order")];U!==c&&(c=U,s=void 0,u={}),M=M.concat(tr({key:`${D}[0]`,value:C[0],valueSpec:{zoom:{}},style:S.style,styleSpec:S.styleSpec,objectElementValidators:{zoom:Yo,value:w}}))}else M=M.concat(w({key:`${D}[0]`,value:C[0],valueSpec:{},style:S.style,styleSpec:S.styleSpec},C));return no(ci(C[1]))?M.concat([new Fe(`${D}[1]`,C[1],"expressions are not allowed in function stops.")]):M.concat(xi({key:`${D}[1]`,value:C[1],valueSpec:e,style:S.style,styleSpec:S.styleSpec}))}function w(S,M){const C=_t(S.value),D=Ht(S.value),U=S.value!==null?S.value:M;if(n){if(C!==n)return[new Fe(S.key,U,`${C} stop domain type must match previous stop domain type ${n}`)]}else n=C;if(C!=="number"&&C!=="string"&&C!=="boolean"&&typeof D!="number"&&typeof D!="string"&&typeof D!="boolean")return[new Fe(S.key,U,"stop domain value must be a number, string, or boolean")];if(C!=="number"&&i!=="categorical"){let q=`number expected, ${C} found`;return io(e)&&i===void 0&&(q+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Fe(S.key,U,q)]}return i!=="categorical"||C!=="number"||typeof D=="number"&&isFinite(D)&&Math.floor(D)===D?i!=="categorical"&&C==="number"&&typeof D=="number"&&typeof s=="number"&&s!==void 0&&Dnew Fe(`${t.key}${n.key}`,t.value,n.message));const i=e.value.expression||e.value._styleExpression.expression;if(t.expressionContext==="property"&&t.propertyKey==="text-font"&&!i.outputDefined())return[new Fe(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if(t.expressionContext==="property"&&t.propertyType==="layout"&&!Pr(i))return[new Fe(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if(t.expressionContext==="filter")return Qo(i,t);if(t.expressionContext&&t.expressionContext.indexOf("cluster")===0){if(!bn(i,["zoom","feature-state"]))return[new Fe(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(t.expressionContext==="cluster-initial"&&!Jn(i))return[new Fe(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Qo(t,e){const i=new Set(["zoom","feature-state","pitch","distance-from-center"]);if(e.valueSpec&&e.valueSpec.expression)for(const s of e.valueSpec.expression.parameters)i.delete(s);if(i.size===0)return[];const n=[];return t instanceof Cr&&i.has(t.name)?[new Fe(e.key,e.value,`["${t.name}"] expression is not supported in a filter for a ${e.object.type} layer with id: ${e.object.id}`)]:(t.eachChild(s=>{n.push(...Qo(s,e))}),n)}function Ws(t){const e=t.key,i=t.value,n=t.valueSpec,s=[];return Array.isArray(n.values)?n.values.indexOf(Ht(i))===-1&&s.push(new Fe(e,i,`expected one of [${n.values.join(", ")}], ${JSON.stringify(i)} found`)):Object.keys(n.values).indexOf(Ht(i))===-1&&s.push(new Fe(e,i,`expected one of [${Object.keys(n.values).join(", ")}], ${JSON.stringify(i)} found`)),s}function nl(t){if(t===!0||t===!1)return!0;if(!Array.isArray(t)||t.length===0)return!1;switch(t[0]){case"has":return t.length>=2&&t[1]!=="$id"&&t[1]!=="$type";case"in":return t.length>=3&&(typeof t[1]!="string"||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return t.length!==3||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(const e of t.slice(1))if(!nl(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}function Xs(t,e="fill"){if(t==null)return{filter:()=>!0,needGeometry:!1,needFeature:!1};nl(t)||(t=ao(t));const i=t;let n=!0;try{n=function(_){if(!so(_))return _;let x=ci(_);return Hs(x),x=Ic(x),x}(i)}catch{console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate. -This is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md -and paste the contents of this message in the report. -Thank you! -Filter Expression: -${JSON.stringify(i,null,2)} - `)}const s=fe[`filter_${e}`],c=oo(n,s);let u=null;if(c.result==="error")throw new Error(c.value.map(_=>`${_.key}: ${_.message}`).join(", "));u=(_,x,b)=>c.value.evaluate(_,x,{},b);let p=null,m=null;if(n!==i){const _=oo(i,s);if(_.result==="error")throw new Error(_.value.map(x=>`${x.key}: ${x.message}`).join(", "));p=(x,b,w,S,M)=>_.value.evaluate(x,b,{},w,void 0,void 0,S,M),m=!Jn(_.value.expression)}return{filter:u,dynamicFilter:p||void 0,needGeometry:Cc(n),needFeature:!!m}}function Ic(t){if(!Array.isArray(t))return t;const e=function(i){if(ol.has(i[0])){for(let n=1;nIc(i))}function Hs(t){let e=!1;const i=[];if(t[0]==="case"){for(let n=1;n",">=","<","<=","to-boolean"]);function Nh(t,e){return te?1:0}function Cc(t){if(!Array.isArray(t))return!1;if(t[0]==="within")return!0;for(let e=1;e"||e==="<="||e===">="?sl(t[1],t[2],e):e==="any"?(i=t.slice(1),["any"].concat(i.map(ao))):e==="all"?["all"].concat(t.slice(1).map(ao)):e==="none"?["all"].concat(t.slice(1).map(ao).map(Ks)):e==="in"?al(t[1],t.slice(2)):e==="!in"?Ks(al(t[1],t.slice(2))):e==="has"?ll(t[1]):e==="!has"?Ks(ll(t[1])):e!=="within"||t;var i}function sl(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 al(t,e){if(e.length===0)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(i=>typeof i!=typeof e[0])?["filter-in-large",t,["literal",e.sort(Nh)]]:["filter-in-small",t,["literal",e]]}}function ll(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Ks(t){return["!",t]}function es(t){return nl(ci(t.value))?hi(Mr({},t,{expressionContext:"filter",valueSpec:t.styleSpec[`filter_${t.layerType||"fill"}`]})):ts(t)}function ts(t){const e=t.value,i=t.key;if(_t(e)!=="array")return[new Fe(i,e,`array expected, ${_t(e)} found`)];const n=t.styleSpec;let s,c=[];if(e.length<1)return[new Fe(i,e,"filter array must have at least 1 element")];switch(c=c.concat(Ws({key:`${i}[0]`,value:e[0],valueSpec:n.filter_operator,style:t.style,styleSpec:t.styleSpec})),Ht(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&Ht(e[1])==="$type"&&c.push(new Fe(i,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&c.push(new Fe(i,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(s=_t(e[1]),s!=="string"&&c.push(new Fe(`${i}[1]`,e[1],`string expected, ${s} found`)));for(let u=2;u{_ in i&&e.push(new Fe(n,i[_],`"${_}" is prohibited for ref layers`))}),s.layers.forEach(_=>{Ht(_.id)===p&&(m=_)}),m?m.ref?e.push(new Fe(n,i.ref,"ref cannot reference another ref layer")):u=Ht(m.type):typeof p=="string"&&e.push(new Fe(n,i.ref,`ref layer "${p}" not found`))}else if(u!=="background"&&u!=="sky")if(i.source){const m=s.sources&&s.sources[i.source],_=m&&Ht(m.type);m?_==="vector"&&u==="raster"?e.push(new Fe(n,i.source,`layer "${i.id}" requires a raster source`)):_==="raster"&&u!=="raster"?e.push(new Fe(n,i.source,`layer "${i.id}" requires a vector source`)):_!=="vector"||i["source-layer"]?_==="raster-dem"&&u!=="hillshade"?e.push(new Fe(n,i.source,"raster-dem source can only be used with layer type 'hillshade'.")):u!=="line"||!i.paint||!i.paint["line-gradient"]&&!i.paint["line-trim-offset"]||_==="geojson"&&m.lineMetrics||e.push(new Fe(n,i,`layer "${i.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new Fe(n,i,`layer "${i.id}" must specify a "source-layer"`)):e.push(new Fe(n,i.source,`source "${i.source}" not found`))}else e.push(new Fe(n,i,'missing required property "source"'));return e=e.concat(tr({key:n,value:i,valueSpec:c.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":()=>[],type:()=>xi({key:`${n}.type`,value:i.type,valueSpec:c.layer.type,style:t.style,styleSpec:t.styleSpec,object:i,objectKey:"type"}),filter:m=>es(Mr({layerType:u},m)),layout:m=>tr({layer:i,key:m.key,value:m.value,valueSpec:{},style:m.style,styleSpec:m.styleSpec,objectElementValidators:{"*":_=>hl(Mr({layerType:u},_))}}),paint:m=>tr({layer:i,key:m.key,value:m.value,valueSpec:{},style:m.style,styleSpec:m.styleSpec,objectElementValidators:{"*":_=>zc(Mr({layerType:u},_))}})}})),e}function Yr(t){const e=t.value,i=t.key,n=_t(e);return n!=="string"?[new Fe(i,e,`string expected, ${n} found`)]:[]}const kc={promoteId:function({key:t,value:e}){if(_t(e)==="string")return Yr({key:t,value:e});{const i=[];for(const n in e)i.push(...Yr({key:`${t}.${n}`,value:e[n]}));return i}}};function Dc(t){const e=t.value,i=t.key,n=t.styleSpec,s=t.style;if(!e.type)return[new Fe(i,e,'"type" is required')];const c=Ht(e.type);let u;switch(c){case"vector":case"raster":case"raster-dem":return u=tr({key:i,value:e,valueSpec:n[`source_${c.replace("-","_")}`],style:t.style,styleSpec:n,objectElementValidators:kc}),u;case"geojson":if(u=tr({key:i,value:e,valueSpec:n.source_geojson,style:s,styleSpec:n,objectElementValidators:kc}),e.cluster)for(const p in e.clusterProperties){const[m,_]=e.clusterProperties[p],x=typeof m=="string"?[m,["accumulated"],["get",p]]:m;u.push(...hi({key:`${i}.${p}.map`,value:_,expressionContext:"cluster-map"})),u.push(...hi({key:`${i}.${p}.reduce`,value:x,expressionContext:"cluster-reduce"}))}return u;case"video":return tr({key:i,value:e,valueSpec:n.source_video,style:s,styleSpec:n});case"image":return tr({key:i,value:e,valueSpec:n.source_image,style:s,styleSpec:n});case"canvas":return[new Fe(i,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Ws({key:`${i}.type`,value:e.type,valueSpec:{values:jh(n)},style:s,styleSpec:n})}}function jh(t){return t.source.reduce((e,i)=>{const n=t[i];return n.type.type==="enum"&&(e=e.concat(Object.keys(n.type.values))),e},[])}function Lc(t){const e=t.value,i=t.styleSpec,n=i.light,s=t.style;let c=[];const u=_t(e);if(e===void 0)return c;if(u!=="object")return c=c.concat([new Fe("light",e,`object expected, ${u} found`)]),c;for(const p in e){const m=p.match(/^(.*)-transition$/);c=c.concat(m&&n[m[1]]&&n[m[1]].transition?xi({key:p,value:e[p],valueSpec:i.transition,style:s,styleSpec:i}):n[p]?xi({key:p,value:e[p],valueSpec:n[p],style:s,styleSpec:i}):[new Fe(p,e[p],`unknown property "${p}"`)])}return c}function ul(t){const e=t.value,i=t.key,n=t.style,s=t.styleSpec,c=s.terrain;let u=[];const p=_t(e);if(e===void 0)return u;if(p!=="object")return u=u.concat([new Fe("terrain",e,`object expected, ${p} found`)]),u;for(const m in e){const _=m.match(/^(.*)-transition$/);u=u.concat(_&&c[_[1]]&&c[_[1]].transition?xi({key:m,value:e[m],valueSpec:s.transition,style:n,styleSpec:s}):c[m]?xi({key:m,value:e[m],valueSpec:c[m],style:n,styleSpec:s}):[new Fe(m,e[m],`unknown property "${m}"`)])}if(e.source){const m=n.sources&&n.sources[e.source],_=m&&Ht(m.type);m?_!=="raster-dem"&&u.push(new Fe(i,e.source,`terrain cannot be used with a source of type ${String(_)}, it only be used with a "raster-dem" source type`)):u.push(new Fe(i,e.source,`source "${e.source}" not found`))}else u.push(new Fe(i,e,'terrain is missing required property "source"'));return u}function Rc(t){const e=t.value,i=t.style,n=t.styleSpec,s=n.fog;let c=[];const u=_t(e);if(e===void 0)return c;if(u!=="object")return c=c.concat([new Fe("fog",e,`object expected, ${u} found`)]),c;for(const p in e){const m=p.match(/^(.*)-transition$/);c=c.concat(m&&s[m[1]]&&s[m[1]].transition?xi({key:p,value:e[p],valueSpec:n.transition,style:i,styleSpec:n}):s[p]?xi({key:p,value:e[p],valueSpec:s[p],style:i,styleSpec:n}):[new Fe(p,e[p],`unknown property "${p}"`)])}return c}const Bc={"*":()=>[],array:Ac,boolean:function(t){const e=t.value,i=t.key,n=_t(e);return n!=="boolean"?[new Fe(i,e,`boolean expected, ${n} found`)]:[]},number:Yo,color:function(t){const e=t.key,i=t.value,n=_t(i);return n!=="string"?[new Fe(e,i,`color expected, ${n} found`)]:Ca(i)===null?[new Fe(e,i,`color expected, "${i}" found`)]:[]},enum:Ws,filter:es,function:Jo,layer:Pc,object:tr,source:Dc,light:Lc,terrain:ul,fog:Rc,string:Yr,formatted:function(t){return Yr(t).length===0?[]:hi(t)},resolvedImage:function(t){return Yr(t).length===0?[]:hi(t)},projection:function(t){const e=t.value,i=t.styleSpec,n=i.projection,s=t.style;let c=[];const u=_t(e);if(u==="object")for(const p in e)c=c.concat(xi({key:p,value:e[p],valueSpec:n[p],style:s,styleSpec:i}));else u!=="string"&&(c=c.concat([new Fe("projection",e,`object or string expected, ${u} found`)]));return c}};function xi(t){const e=t.value,i=t.valueSpec,n=t.styleSpec;return i.expression&&Xo(Ht(e))?Jo(t):i.expression&&no(ci(e))?hi(t):i.type&&Bc[i.type]?Bc[i.type](t):tr(Mr({},t,{valueSpec:i.type?n[i.type]:i}))}function Gh(t){const e=t.value,i=t.key,n=Yr(t);return n.length||(e.indexOf("{fontstack}")===-1&&n.push(new Fe(i,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&n.push(new Fe(i,e,'"glyphs" url must include a "{range}" token'))),n}function Oc(t,e=fe){return $i(xi({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:Gh,"*":()=>[]}}))}const $h=t=>$i(zc(t)),Zh=t=>$i(hl(t));function $i(t){return t.slice().sort((e,i)=>e.line&&i.line?e.line-i.line:0)}function Fc(t,e){let i=!1;if(e&&e.length)for(const n of e)t.fire(new Sr(new Error(n.message))),i=!0;return i}var qh=ur,ir=3;function ur(t,e,i){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var s=new Int32Array(this.arrayBuffer);t=s[0],this.d=(e=s[1])+2*(i=s[2]);for(var c=0;c=x[S+0]&&n>=x[S+1])?(u[w]=!0,c.push(_[w])):u[w]=!1}}},ur.prototype._forEachCell=function(t,e,i,n,s,c,u,p){for(var m=this._convertToCellCoord(t),_=this._convertToCellCoord(e),x=this._convertToCellCoord(i),b=this._convertToCellCoord(n),w=m;w<=x;w++)for(var S=_;S<=b;S++){var M=this.d*S+w;if((!p||p(this._convertFromCellCoord(w),this._convertFromCellCoord(S),this._convertFromCellCoord(w+1),this._convertFromCellCoord(S+1)))&&s.call(this,t,e,i,n,M,c,u,p))return}},ur.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},ur.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},ur.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=ir+this.cells.length+1+1,i=0,n=0;n=0||(s[c]=lo(t[c],e)));t instanceof Error&&(s.message=t.message)}if(s.$name)throw new Error("$name property is reserved for worker serialization logic.");return n!=="Object"&&(s.$name=n),s}throw new Error("can't serialize object of type "+typeof t)}function Sn(t){if(t==null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||dl(t)||pl(t)||ArrayBuffer.isView(t)||t instanceof Se.ImageData)return t;if(Array.isArray(t))return t.map(Sn);if(typeof t=="object"){const e=t.$name||"Object",{klass:i}=Ys[e];if(!i)throw new Error(`can't deserialize unregistered class ${e}`);if(i.deserialize)return i.deserialize(t);const n=Object.create(i.prototype);for(const s of Object.keys(t))s!=="$name"&&(n[s]=Sn(t[s]));return n}throw new Error("can't deserialize object of type "+typeof t)}const Be={"Latin-1 Supplement":t=>t>=128&&t<=255,Arabic:t=>t>=1536&&t<=1791,"Arabic Supplement":t=>t>=1872&&t<=1919,"Arabic Extended-A":t=>t>=2208&&t<=2303,"Hangul Jamo":t=>t>=4352&&t<=4607,"Unified Canadian Aboriginal Syllabics":t=>t>=5120&&t<=5759,Khmer:t=>t>=6016&&t<=6143,"Unified Canadian Aboriginal Syllabics Extended":t=>t>=6320&&t<=6399,"General Punctuation":t=>t>=8192&&t<=8303,"Letterlike Symbols":t=>t>=8448&&t<=8527,"Number Forms":t=>t>=8528&&t<=8591,"Miscellaneous Technical":t=>t>=8960&&t<=9215,"Control Pictures":t=>t>=9216&&t<=9279,"Optical Character Recognition":t=>t>=9280&&t<=9311,"Enclosed Alphanumerics":t=>t>=9312&&t<=9471,"Geometric Shapes":t=>t>=9632&&t<=9727,"Miscellaneous Symbols":t=>t>=9728&&t<=9983,"Miscellaneous Symbols and Arrows":t=>t>=11008&&t<=11263,"CJK Radicals Supplement":t=>t>=11904&&t<=12031,"Kangxi Radicals":t=>t>=12032&&t<=12255,"Ideographic Description Characters":t=>t>=12272&&t<=12287,"CJK Symbols and Punctuation":t=>t>=12288&&t<=12351,Hiragana:t=>t>=12352&&t<=12447,Katakana:t=>t>=12448&&t<=12543,Bopomofo:t=>t>=12544&&t<=12591,"Hangul Compatibility Jamo":t=>t>=12592&&t<=12687,Kanbun:t=>t>=12688&&t<=12703,"Bopomofo Extended":t=>t>=12704&&t<=12735,"CJK Strokes":t=>t>=12736&&t<=12783,"Katakana Phonetic Extensions":t=>t>=12784&&t<=12799,"Enclosed CJK Letters and Months":t=>t>=12800&&t<=13055,"CJK Compatibility":t=>t>=13056&&t<=13311,"CJK Unified Ideographs Extension A":t=>t>=13312&&t<=19903,"Yijing Hexagram Symbols":t=>t>=19904&&t<=19967,"CJK Unified Ideographs":t=>t>=19968&&t<=40959,"Yi Syllables":t=>t>=40960&&t<=42127,"Yi Radicals":t=>t>=42128&&t<=42191,"Hangul Jamo Extended-A":t=>t>=43360&&t<=43391,"Hangul Syllables":t=>t>=44032&&t<=55215,"Hangul Jamo Extended-B":t=>t>=55216&&t<=55295,"Private Use Area":t=>t>=57344&&t<=63743,"CJK Compatibility Ideographs":t=>t>=63744&&t<=64255,"Arabic Presentation Forms-A":t=>t>=64336&&t<=65023,"Vertical Forms":t=>t>=65040&&t<=65055,"CJK Compatibility Forms":t=>t>=65072&&t<=65103,"Small Form Variants":t=>t>=65104&&t<=65135,"Arabic Presentation Forms-B":t=>t>=65136&&t<=65279,"Halfwidth and Fullwidth Forms":t=>t>=65280&&t<=65519};function fl(t){for(const e of t)if(ml(e.charCodeAt(0)))return!0;return!1}function Wh(t){for(const e of t)if(!Uc(e.charCodeAt(0)))return!1;return!0}function Uc(t){return!(Be.Arabic(t)||Be["Arabic Supplement"](t)||Be["Arabic Extended-A"](t)||Be["Arabic Presentation Forms-A"](t)||Be["Arabic Presentation Forms-B"](t))}function ml(t){return!(t!==746&&t!==747&&(t<4352||!(Be["Bopomofo Extended"](t)||Be.Bopomofo(t)||Be["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||Be["CJK Compatibility Ideographs"](t)||Be["CJK Compatibility"](t)||Be["CJK Radicals Supplement"](t)||Be["CJK Strokes"](t)||!(!Be["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||t===12336)||Be["CJK Unified Ideographs Extension A"](t)||Be["CJK Unified Ideographs"](t)||Be["Enclosed CJK Letters and Months"](t)||Be["Hangul Compatibility Jamo"](t)||Be["Hangul Jamo Extended-A"](t)||Be["Hangul Jamo Extended-B"](t)||Be["Hangul Jamo"](t)||Be["Hangul Syllables"](t)||Be.Hiragana(t)||Be["Ideographic Description Characters"](t)||Be.Kanbun(t)||Be["Kangxi Radicals"](t)||Be["Katakana Phonetic Extensions"](t)||Be.Katakana(t)&&t!==12540||!(!Be["Halfwidth and Fullwidth Forms"](t)||t===65288||t===65289||t===65293||t>=65306&&t<=65310||t===65339||t===65341||t===65343||t>=65371&&t<=65503||t===65507||t>=65512&&t<=65519)||!(!Be["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||Be["Unified Canadian Aboriginal Syllabics"](t)||Be["Unified Canadian Aboriginal Syllabics Extended"](t)||Be["Vertical Forms"](t)||Be["Yijing Hexagram Symbols"](t)||Be["Yi Syllables"](t)||Be["Yi Radicals"](t))))}function Vc(t){return!(ml(t)||function(e){return!!(Be["Latin-1 Supplement"](e)&&(e===167||e===169||e===174||e===177||e===188||e===189||e===190||e===215||e===247)||Be["General Punctuation"](e)&&(e===8214||e===8224||e===8225||e===8240||e===8241||e===8251||e===8252||e===8258||e===8263||e===8264||e===8265||e===8273)||Be["Letterlike Symbols"](e)||Be["Number Forms"](e)||Be["Miscellaneous Technical"](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||e===9003||e>=9085&&e<=9114||e>=9150&&e<=9165||e===9167||e>=9169&&e<=9179||e>=9186&&e<=9215)||Be["Control Pictures"](e)&&e!==9251||Be["Optical Character Recognition"](e)||Be["Enclosed Alphanumerics"](e)||Be["Geometric Shapes"](e)||Be["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||Be["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||Be["CJK Symbols and Punctuation"](e)||Be.Katakana(e)||Be["Private Use Area"](e)||Be["CJK Compatibility Forms"](e)||Be["Small Form Variants"](e)||Be["Halfwidth and Fullwidth Forms"](e)||e===8734||e===8756||e===8757||e>=9984&&e<=10087||e>=10102&&e<=10131||e===65532||e===65533)}(t))}function Nc(t){return t>=1424&&t<=2303||Be["Arabic Presentation Forms-A"](t)||Be["Arabic Presentation Forms-B"](t)}function Xh(t,e){return!(!e&&Nc(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||Be.Khmer(t))}function Hh(t){for(const e of t)if(Nc(e.charCodeAt(0)))return!0;return!1}const _l="deferred",gl="loading",yl="loaded";let co=null,l="unavailable",r=null;const o=function(t){t&&typeof t=="string"&&t.indexOf("NetworkError")>-1&&(l="error"),co&&co(t)};function h(){d.fire(new gn("pluginStateChange",{pluginStatus:l,pluginURL:r}))}const d=new Po,f=function(){return l},g=function(){if(l!==_l||!r)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");l=gl,h(),r&&$n({url:r},t=>{t?o(t):(l=yl,h())})},y={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>l===yl||y.applyArabicShaping!=null,isLoading:()=>l===gl,setState(t){l=t.pluginStatus,r=t.pluginURL},isParsed:()=>y.applyArabicShaping!=null&&y.processBidirectionalText!=null&&y.processStyledBidirectionalText!=null,getPluginURL:()=>r};class v{constructor(e,i){this.zoom=e,i?(this.now=i.now,this.fadeDuration=i.fadeDuration,this.transition=i.transition,this.pitch=i.pitch):(this.now=0,this.fadeDuration=0,this.transition={},this.pitch=0)}isSupportedScript(e){return function(i,n){for(const s of i)if(!Xh(s.charCodeAt(0),n))return!1;return!0}(e,y.isLoaded())}}class E{constructor(e,i){this.property=e,this.value=i,this.expression=function(n,s){if(Xo(n))return new Zs(n,s);if(no(n)){const c=Ko(n,s);if(c.result==="error")throw new Error(c.value.map(u=>`${u.key}: ${u.message}`).join(", "));return c.value}{let c=n;return typeof n=="string"&&s.type==="color"&&(c=Zt.parse(n)),{kind:"constant",evaluate:()=>c}}}(i===void 0?e.specification.default:i,e.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(e,i,n){return this.property.possiblyEvaluate(this,e,i,n)}}class T{constructor(e){this.property=e,this.value=new E(e,void 0)}transitioned(e,i){return new k(this.property,this.value,i,Wt({},e.transition,this.transition),e.now)}untransitioned(){return new k(this.property,this.value,null,{},0)}}class A{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return Li(this._values[e].value.value)}setValue(e,i){this._values.hasOwnProperty(e)||(this._values[e]=new T(this._values[e].property)),this._values[e].value=new E(this._values[e].property,i===null?void 0:Li(i))}getTransition(e){return Li(this._values[e].transition)}setTransition(e,i){this._values.hasOwnProperty(e)||(this._values[e]=new T(this._values[e].property)),this._values[e].transition=Li(i)||void 0}serialize(){const e={};for(const i of Object.keys(this._values)){const n=this.getValue(i);n!==void 0&&(e[i]=n);const s=this.getTransition(i);s!==void 0&&(e[`${i}-transition`]=s)}return e}transitioned(e,i){const n=new R(this._properties);for(const s of Object.keys(this._values))n._values[s]=this._values[s].transitioned(e,i._values[s]);return n}untransitioned(){const e=new R(this._properties);for(const i of Object.keys(this._values))e._values[i]=this._values[i].untransitioned();return e}}class k{constructor(e,i,n,s,c){const u=s.delay||0,p=s.duration||0;c=c||0,this.property=e,this.value=i,this.begin=c+u,this.end=this.begin+p,e.specification.transition&&(s.delay||s.duration)&&(this.prior=n)}possiblyEvaluate(e,i,n){const s=e.now||0,c=this.value.possiblyEvaluate(e,i,n),u=this.prior;if(u){if(s>this.end)return this.prior=null,c;if(this.value.isDataDriven())return this.prior=null,c;if(sthis.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const i=this.uint8;this._refreshViews(),i&&this.uint8.set(i)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}destroy(){this.int8=this.uint8=this.int16=this.uint16=this.int32=this.uint32=this.float32=null,this.arrayBuffer=null}}function te(t,e=1){let i=0,n=0;return{members:t.map(s=>{const c=J[s.type].BYTES_PER_ELEMENT,u=i=le(i,Math.max(e,c)),p=s.components||1;return n=Math.max(n,c),i+=c*p,{name:s.name,type:s.type,components:p,offset:u}}),size:le(i,Math.max(n,e)),alignment:e}}function le(t,e){return Math.ceil(t/e)*e}class Te extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,i)}emplace(e,i,n){const s=2*e;return this.int16[s+0]=i,this.int16[s+1]=n,e}}Te.prototype.bytesPerElement=4,Ue(Te,"StructArrayLayout2i4");class oe extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,n){const s=this.length;return this.resize(s+1),this.emplace(s,e,i,n)}emplace(e,i,n,s){const c=3*e;return this.int16[c+0]=i,this.int16[c+1]=n,this.int16[c+2]=s,e}}oe.prototype.bytesPerElement=6,Ue(oe,"StructArrayLayout3i6");class ge extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,n,s){const c=this.length;return this.resize(c+1),this.emplace(c,e,i,n,s)}emplace(e,i,n,s,c){const u=4*e;return this.int16[u+0]=i,this.int16[u+1]=n,this.int16[u+2]=s,this.int16[u+3]=c,e}}ge.prototype.bytesPerElement=8,Ue(ge,"StructArrayLayout4i8");class he extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c,u,p){const m=this.length;return this.resize(m+1),this.emplace(m,e,i,n,s,c,u,p)}emplace(e,i,n,s,c,u,p,m){const _=6*e,x=12*e,b=3*e;return this.int16[_+0]=i,this.int16[_+1]=n,this.uint8[x+4]=s,this.uint8[x+5]=c,this.uint8[x+6]=u,this.uint8[x+7]=p,this.float32[b+2]=m,e}}he.prototype.bytesPerElement=12,Ue(he,"StructArrayLayout2i4ub1f12");class we extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,n,s){const c=this.length;return this.resize(c+1),this.emplace(c,e,i,n,s)}emplace(e,i,n,s,c){const u=4*e;return this.float32[u+0]=i,this.float32[u+1]=n,this.float32[u+2]=s,this.float32[u+3]=c,e}}we.prototype.bytesPerElement=16,Ue(we,"StructArrayLayout4f16");class ae extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c){const u=this.length;return this.resize(u+1),this.emplace(u,e,i,n,s,c)}emplace(e,i,n,s,c,u){const p=6*e,m=3*e;return this.uint16[p+0]=i,this.uint16[p+1]=n,this.uint16[p+2]=s,this.uint16[p+3]=c,this.float32[m+2]=u,e}}ae.prototype.bytesPerElement=12,Ue(ae,"StructArrayLayout4ui1f12");class _e extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,n,s){const c=this.length;return this.resize(c+1),this.emplace(c,e,i,n,s)}emplace(e,i,n,s,c){const u=4*e;return this.uint16[u+0]=i,this.uint16[u+1]=n,this.uint16[u+2]=s,this.uint16[u+3]=c,e}}_e.prototype.bytesPerElement=8,Ue(_e,"StructArrayLayout4ui8");class Me extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c,u){const p=this.length;return this.resize(p+1),this.emplace(p,e,i,n,s,c,u)}emplace(e,i,n,s,c,u,p){const m=6*e;return this.int16[m+0]=i,this.int16[m+1]=n,this.int16[m+2]=s,this.int16[m+3]=c,this.int16[m+4]=u,this.int16[m+5]=p,e}}Me.prototype.bytesPerElement=12,Ue(Me,"StructArrayLayout6i12");class ve extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c,u,p,m,_,x,b,w){const S=this.length;return this.resize(S+1),this.emplace(S,e,i,n,s,c,u,p,m,_,x,b,w)}emplace(e,i,n,s,c,u,p,m,_,x,b,w,S){const M=12*e;return this.int16[M+0]=i,this.int16[M+1]=n,this.int16[M+2]=s,this.int16[M+3]=c,this.uint16[M+4]=u,this.uint16[M+5]=p,this.uint16[M+6]=m,this.uint16[M+7]=_,this.int16[M+8]=x,this.int16[M+9]=b,this.int16[M+10]=w,this.int16[M+11]=S,e}}ve.prototype.bytesPerElement=24,Ue(ve,"StructArrayLayout4i4ui4i24");class Ae extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c,u){const p=this.length;return this.resize(p+1),this.emplace(p,e,i,n,s,c,u)}emplace(e,i,n,s,c,u,p){const m=10*e,_=5*e;return this.int16[m+0]=i,this.int16[m+1]=n,this.int16[m+2]=s,this.float32[_+2]=c,this.float32[_+3]=u,this.float32[_+4]=p,e}}Ae.prototype.bytesPerElement=20,Ue(Ae,"StructArrayLayout3i3f20");class Ge extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.uint32[1*e+0]=i,e}}Ge.prototype.bytesPerElement=4,Ue(Ge,"StructArrayLayout1ul4");class Xe extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c,u,p,m,_,x,b,w,S){const M=this.length;return this.resize(M+1),this.emplace(M,e,i,n,s,c,u,p,m,_,x,b,w,S)}emplace(e,i,n,s,c,u,p,m,_,x,b,w,S,M){const C=20*e,D=10*e;return this.int16[C+0]=i,this.int16[C+1]=n,this.int16[C+2]=s,this.int16[C+3]=c,this.int16[C+4]=u,this.float32[D+3]=p,this.float32[D+4]=m,this.float32[D+5]=_,this.float32[D+6]=x,this.int16[C+14]=b,this.uint32[D+8]=w,this.uint16[C+18]=S,this.uint16[C+19]=M,e}}Xe.prototype.bytesPerElement=40,Ue(Xe,"StructArrayLayout5i4f1i1ul2ui40");class Ve extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c,u,p){const m=this.length;return this.resize(m+1),this.emplace(m,e,i,n,s,c,u,p)}emplace(e,i,n,s,c,u,p,m){const _=8*e;return this.int16[_+0]=i,this.int16[_+1]=n,this.int16[_+2]=s,this.int16[_+4]=c,this.int16[_+5]=u,this.int16[_+6]=p,this.int16[_+7]=m,e}}Ve.prototype.bytesPerElement=16,Ue(Ve,"StructArrayLayout3i2i2i16");class qe extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c){const u=this.length;return this.resize(u+1),this.emplace(u,e,i,n,s,c)}emplace(e,i,n,s,c,u){const p=4*e,m=8*e;return this.float32[p+0]=i,this.float32[p+1]=n,this.float32[p+2]=s,this.int16[m+6]=c,this.int16[m+7]=u,e}}qe.prototype.bytesPerElement=16,Ue(qe,"StructArrayLayout2f1f2i16");class lt extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,n,s){const c=this.length;return this.resize(c+1),this.emplace(c,e,i,n,s)}emplace(e,i,n,s,c){const u=12*e,p=3*e;return this.uint8[u+0]=i,this.uint8[u+1]=n,this.float32[p+1]=s,this.float32[p+2]=c,e}}lt.prototype.bytesPerElement=12,Ue(lt,"StructArrayLayout2ub2f12");class ot extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,n){const s=this.length;return this.resize(s+1),this.emplace(s,e,i,n)}emplace(e,i,n,s){const c=3*e;return this.float32[c+0]=i,this.float32[c+1]=n,this.float32[c+2]=s,e}}ot.prototype.bytesPerElement=12,Ue(ot,"StructArrayLayout3f12");class je extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,n){const s=this.length;return this.resize(s+1),this.emplace(s,e,i,n)}emplace(e,i,n,s){const c=3*e;return this.uint16[c+0]=i,this.uint16[c+1]=n,this.uint16[c+2]=s,e}}je.prototype.bytesPerElement=6,Ue(je,"StructArrayLayout3ui6");class wt extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c,u,p,m,_,x,b,w,S,M,C,D,U,q,V,$,X){const W=this.length;return this.resize(W+1),this.emplace(W,e,i,n,s,c,u,p,m,_,x,b,w,S,M,C,D,U,q,V,$,X)}emplace(e,i,n,s,c,u,p,m,_,x,b,w,S,M,C,D,U,q,V,$,X,W){const ce=30*e,se=15*e,me=60*e;return this.int16[ce+0]=i,this.int16[ce+1]=n,this.int16[ce+2]=s,this.float32[se+2]=c,this.float32[se+3]=u,this.uint16[ce+8]=p,this.uint16[ce+9]=m,this.uint32[se+5]=_,this.uint32[se+6]=x,this.uint32[se+7]=b,this.uint16[ce+16]=w,this.uint16[ce+17]=S,this.uint16[ce+18]=M,this.float32[se+10]=C,this.float32[se+11]=D,this.uint8[me+48]=U,this.uint8[me+49]=q,this.uint8[me+50]=V,this.uint32[se+13]=$,this.int16[ce+28]=X,this.uint8[me+58]=W,e}}wt.prototype.bytesPerElement=60,Ue(wt,"StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60");class Tt extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c,u,p,m,_,x,b,w,S,M,C,D,U,q,V,$,X,W,ce,se,me,Ee,ue,ye,xe,be){const Ce=this.length;return this.resize(Ce+1),this.emplace(Ce,e,i,n,s,c,u,p,m,_,x,b,w,S,M,C,D,U,q,V,$,X,W,ce,se,me,Ee,ue,ye,xe,be)}emplace(e,i,n,s,c,u,p,m,_,x,b,w,S,M,C,D,U,q,V,$,X,W,ce,se,me,Ee,ue,ye,xe,be,Ce){const pe=38*e,De=19*e;return this.int16[pe+0]=i,this.int16[pe+1]=n,this.int16[pe+2]=s,this.float32[De+2]=c,this.float32[De+3]=u,this.int16[pe+8]=p,this.int16[pe+9]=m,this.int16[pe+10]=_,this.int16[pe+11]=x,this.int16[pe+12]=b,this.int16[pe+13]=w,this.uint16[pe+14]=S,this.uint16[pe+15]=M,this.uint16[pe+16]=C,this.uint16[pe+17]=D,this.uint16[pe+18]=U,this.uint16[pe+19]=q,this.uint16[pe+20]=V,this.uint16[pe+21]=$,this.uint16[pe+22]=X,this.uint16[pe+23]=W,this.uint16[pe+24]=ce,this.uint16[pe+25]=se,this.uint16[pe+26]=me,this.uint16[pe+27]=Ee,this.uint16[pe+28]=ue,this.uint32[De+15]=ye,this.float32[De+16]=xe,this.float32[De+17]=be,this.float32[De+18]=Ce,e}}Tt.prototype.bytesPerElement=76,Ue(Tt,"StructArrayLayout3i2f6i15ui1ul3f76");class Et extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.float32[1*e+0]=i,e}}Et.prototype.bytesPerElement=4,Ue(Et,"StructArrayLayout1f4");class St extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c){const u=this.length;return this.resize(u+1),this.emplace(u,e,i,n,s,c)}emplace(e,i,n,s,c,u){const p=5*e;return this.float32[p+0]=i,this.float32[p+1]=n,this.float32[p+2]=s,this.float32[p+3]=c,this.float32[p+4]=u,e}}St.prototype.bytesPerElement=20,Ue(St,"StructArrayLayout5f20");class vi extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,n,s){const c=this.length;return this.resize(c+1),this.emplace(c,e,i,n,s)}emplace(e,i,n,s,c){const u=6*e;return this.uint32[3*e+0]=i,this.uint16[u+2]=n,this.uint16[u+3]=s,this.uint16[u+4]=c,e}}vi.prototype.bytesPerElement=12,Ue(vi,"StructArrayLayout1ul3ui12");class ui extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,i)}emplace(e,i,n){const s=2*e;return this.uint16[s+0]=i,this.uint16[s+1]=n,e}}ui.prototype.bytesPerElement=4,Ue(ui,"StructArrayLayout2ui4");class Zi extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.uint16[1*e+0]=i,e}}Zi.prototype.bytesPerElement=2,Ue(Zi,"StructArrayLayout1ui2");class dr extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,i)}emplace(e,i,n){const s=2*e;return this.float32[s+0]=i,this.float32[s+1]=n,e}}dr.prototype.bytesPerElement=8,Ue(dr,"StructArrayLayout2f8");class Ft extends Y{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.int16[this._pos2+3]}get tileAnchorY(){return this._structArray.int16[this._pos2+4]}get x1(){return this._structArray.float32[this._pos4+3]}get y1(){return this._structArray.float32[this._pos4+4]}get x2(){return this._structArray.float32[this._pos4+5]}get y2(){return this._structArray.float32[this._pos4+6]}get padding(){return this._structArray.int16[this._pos2+14]}get featureIndex(){return this._structArray.uint32[this._pos4+8]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+18]}get bucketIndex(){return this._structArray.uint16[this._pos2+19]}}Ft.prototype.size=40;class Mt extends Xe{get(e){return new Ft(this,e)}}Ue(Mt,"CollisionBoxArray");class yt extends Y{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+8]}get numGlyphs(){return this._structArray.uint16[this._pos2+9]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+5]}get lineStartIndex(){return this._structArray.uint32[this._pos4+6]}get lineLength(){return this._structArray.uint32[this._pos4+7]}get segment(){return this._structArray.uint16[this._pos2+16]}get lowerSize(){return this._structArray.uint16[this._pos2+17]}get upperSize(){return this._structArray.uint16[this._pos2+18]}get lineOffsetX(){return this._structArray.float32[this._pos4+10]}get lineOffsetY(){return this._structArray.float32[this._pos4+11]}get writingMode(){return this._structArray.uint8[this._pos1+48]}get placedOrientation(){return this._structArray.uint8[this._pos1+49]}set placedOrientation(e){this._structArray.uint8[this._pos1+49]=e}get hidden(){return this._structArray.uint8[this._pos1+50]}set hidden(e){this._structArray.uint8[this._pos1+50]=e}get crossTileID(){return this._structArray.uint32[this._pos4+13]}set crossTileID(e){this._structArray.uint32[this._pos4+13]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+28]}get flipState(){return this._structArray.uint8[this._pos1+58]}set flipState(e){this._structArray.uint8[this._pos1+58]=e}}yt.prototype.size=60;class Kt extends wt{get(e){return new yt(this,e)}}Ue(Kt,"PlacedSymbolArray");class Ei extends Y{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+8]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+9]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+10]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+11]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+12]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+13]}get key(){return this._structArray.uint16[this._pos2+14]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+17]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+18]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+19]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+20]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+21]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+22]}get featureIndex(){return this._structArray.uint16[this._pos2+23]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+24]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+25]}get numIconVertices(){return this._structArray.uint16[this._pos2+26]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+27]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+28]}get crossTileID(){return this._structArray.uint32[this._pos4+15]}set crossTileID(e){this._structArray.uint32[this._pos4+15]=e}get textOffset0(){return this._structArray.float32[this._pos4+16]}get textOffset1(){return this._structArray.float32[this._pos4+17]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+18]}}Ei.prototype.size=76;class Bt extends Tt{get(e){return new Ei(this,e)}}Ue(Bt,"SymbolInstanceArray");class Ii extends Et{getoffsetX(e){return this.float32[1*e+0]}}Ue(Ii,"GlyphOffsetArray");class Js extends Te{getx(e){return this.int16[2*e+0]}gety(e){return this.int16[2*e+1]}}Ue(Js,"SymbolLineVertexArray");class Mn extends Y{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]}get layoutVertexArrayOffset(){return this._structArray.uint16[this._pos2+4]}}Mn.prototype.size=12;class is extends vi{get(e){return new Mn(this,e)}}Ue(is,"FeatureIndexArray");class Lr extends ui{geta_centroid_pos0(e){return this.uint16[2*e+0]}geta_centroid_pos1(e){return this.uint16[2*e+1]}}Ue(Lr,"FillExtrusionCentroidArray");const Jr=te([{name:"a_pattern",components:4,type:"Uint16"},{name:"a_pixel_ratio",components:1,type:"Float32"}]),An=te([{name:"a_dash",components:4,type:"Uint16"}]);var Qs={exports:{}},rs={exports:{}};rs.exports=function(t,e){var i,n,s,c,u,p,m,_;for(n=t.length-(i=3&t.length),s=e,u=3432918353,p=461845907,_=0;_>>16)*u&65535)<<16)&4294967295)<<15|m>>>17))*p+(((m>>>16)*p&65535)<<16)&4294967295)<<13|s>>>19))+((5*(s>>>16)&65535)<<16)&4294967295))+((58964+(c>>>16)&65535)<<16);switch(m=0,i){case 3:m^=(255&t.charCodeAt(_+2))<<16;case 2:m^=(255&t.charCodeAt(_+1))<<8;case 1:s^=m=(65535&(m=(m=(65535&(m^=255&t.charCodeAt(_)))*u+(((m>>>16)*u&65535)<<16)&4294967295)<<15|m>>>17))*p+(((m>>>16)*p&65535)<<16)&4294967295}return s^=t.length,s=2246822507*(65535&(s^=s>>>16))+((2246822507*(s>>>16)&65535)<<16)&4294967295,s=3266489909*(65535&(s^=s>>>13))+((3266489909*(s>>>16)&65535)<<16)&4294967295,(s^=s>>>16)>>>0};var xl=rs.exports,sd={exports:{}};sd.exports=function(t,e){for(var i,n=t.length,s=e^n,c=0;n>=4;)i=1540483477*(65535&(i=255&t.charCodeAt(c)|(255&t.charCodeAt(++c))<<8|(255&t.charCodeAt(++c))<<16|(255&t.charCodeAt(++c))<<24))+((1540483477*(i>>>16)&65535)<<16),s=1540483477*(65535&s)+((1540483477*(s>>>16)&65535)<<16)^(i=1540483477*(65535&(i^=i>>>24))+((1540483477*(i>>>16)&65535)<<16)),n-=4,++c;switch(n){case 3:s^=(255&t.charCodeAt(c+2))<<16;case 2:s^=(255&t.charCodeAt(c+1))<<8;case 1:s=1540483477*(65535&(s^=255&t.charCodeAt(c)))+((1540483477*(s>>>16)&65535)<<16)}return s=1540483477*(65535&(s^=s>>>13))+((1540483477*(s>>>16)&65535)<<16),(s^=s>>>15)>>>0};var ad=xl,Nf=sd.exports;Qs.exports=ad,Qs.exports.murmur3=ad,Qs.exports.murmur2=Nf;var Kh=Yi(Qs.exports);class jc{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,i,n,s){this.ids.push(ld(e)),this.positions.push(i,n,s)}getPositions(e){const i=ld(e);let n=0,s=this.ids.length-1;for(;n>1;this.ids[u]>=i?s=u:n=u+1}const c=[];for(;this.ids[n]===i;)c.push({index:this.positions[3*n],start:this.positions[3*n+1],end:this.positions[3*n+2]}),n++;return c}static serialize(e,i){const n=new Float64Array(e.ids),s=new Uint32Array(e.positions);return Yh(n,s,0,n.length-1),i&&i.push(n.buffer,s.buffer),{ids:n,positions:s}}static deserialize(e){const i=new jc;return i.ids=e.ids,i.positions=e.positions,i.indexed=!0,i}}function ld(t){const e=+t;return!isNaN(e)&&Number.MIN_SAFE_INTEGER<=e&&e<=Number.MAX_SAFE_INTEGER?e:Kh(String(t))}function Yh(t,e,i,n){for(;i>1];let c=i-1,u=n+1;for(;;){do c++;while(t[c]s);if(c>=u)break;Gc(t,c,u),Gc(e,3*c,3*u),Gc(e,3*c+1,3*u+1),Gc(e,3*c+2,3*u+2)}u-i`u_${s}`),this.type=n}setUniform(e,i,n,s,c){i.set(e,c,s.constantOr(this.value))}getBinding(e,i){return this.type==="color"?new hd(e):new $c(e)}}class ea{constructor(e,i){this.uniformNames=i.map(n=>`u_${n}`),this.pattern=null,this.pixelRatio=1}setConstantPatternPositions(e){this.pixelRatio=e.pixelRatio||1,this.pattern=e.tl.concat(e.br)}setUniform(e,i,n,s,c){const u=c==="u_pattern"||c==="u_dash"?this.pattern:c==="u_pixel_ratio"?this.pixelRatio:null;u&&i.set(e,c,u)}getBinding(e,i){return i==="u_pattern"||i==="u_dash"?new cd(e):new $c(e)}}class Cn{constructor(e,i,n,s){this.expression=e,this.type=n,this.maxValue=0,this.paintVertexAttributes=i.map(c=>({name:`a_${c}`,type:"Float32",components:n==="color"?2:1,offset:0})),this.paintVertexArray=new s}populatePaintArray(e,i,n,s,c,u){const p=this.paintVertexArray.length,m=this.expression.evaluate(new v(0),i,{},c,s,u);this.paintVertexArray.resize(e),this._setPaintValue(p,e,m)}updatePaintArray(e,i,n,s,c){const u=this.expression.evaluate({zoom:0},n,s,void 0,c);this._setPaintValue(e,i,u)}_setPaintValue(e,i,n){if(this.type==="color"){const s=Jh(n);for(let c=e;c`u_${p}_t`),this.type=n,this.useIntegerZoom=s,this.zoom=c,this.maxValue=0,this.paintVertexAttributes=i.map(p=>({name:`a_${p}`,type:"Float32",components:n==="color"?4:2,offset:0})),this.paintVertexArray=new u}populatePaintArray(e,i,n,s,c,u){const p=this.expression.evaluate(new v(this.zoom),i,{},c,s,u),m=this.expression.evaluate(new v(this.zoom+1),i,{},c,s,u),_=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(_,e,p,m)}updatePaintArray(e,i,n,s,c){const u=this.expression.evaluate({zoom:this.zoom},n,s,void 0,c),p=this.expression.evaluate({zoom:this.zoom+1},n,s,void 0,c);this._setPaintValue(e,i,u,p)}_setPaintValue(e,i,n,s){if(this.type==="color"){const c=Jh(n),u=Jh(s);for(let p=e;p!0){this.binders={},this._buffers=[];const s=[];for(const c in e.paint._values){if(!n(c))continue;const u=e.paint.get(c);if(!(u instanceof B&&io(u.property.specification)))continue;const p=qf(c,e.type),m=u.value,_=u.property.specification.type,x=!!u.property.useIntegerZoom,b=c==="line-dasharray"||c.endsWith("pattern"),w=c==="line-dasharray"&&e.layout.get("line-cap").value.kind!=="constant";if(m.kind!=="constant"||w)if(m.kind==="source"||w||b){const S=ud(c,_,"source");this.binders[c]=b?new ho(m,p,_,S,e.id):new Cn(m,p,_,S),s.push(`/a_${c}`)}else{const S=ud(c,_,"composite");this.binders[c]=new Rr(m,p,_,x,i,S),s.push(`/z_${c}`)}else this.binders[c]=b?new ea(m.value,p):new vl(m.value,p,_),s.push(`/u_${c}`)}this.cacheKey=s.sort().join("")}getMaxValue(e){const i=this.binders[e];return i instanceof Cn||i instanceof Rr?i.maxValue:0}populatePaintArrays(e,i,n,s,c,u){for(const p in this.binders){const m=this.binders[p];(m instanceof Cn||m instanceof Rr||m instanceof ho)&&m.populatePaintArray(e,i,n,s,c,u)}}setConstantPatternPositions(e){for(const i in this.binders){const n=this.binders[i];n instanceof ea&&n.setConstantPatternPositions(e)}}updatePaintArrays(e,i,n,s,c,u){let p=!1;for(const m in e){const _=i.getPositions(m);for(const x of _){const b=n.feature(x.index);for(const w in this.binders){const S=this.binders[w];if((S instanceof Cn||S instanceof Rr||S instanceof ho)&&S.expression.isStateDependent===!0){const M=s.paint.get(w);S.expression=M.value,S.updatePaintArray(x.start,x.end,b,e[m],c,u),p=!0}}}}return p}defines(){const e=[];for(const i in this.binders){const n=this.binders[i];(n instanceof vl||n instanceof ea)&&e.push(...n.uniformNames.map(s=>`#define HAS_UNIFORM_${s}`))}return e}getBinderAttributes(){const e=[];for(const i in this.binders){const n=this.binders[i];if(n instanceof Cn||n instanceof Rr||n instanceof ho)for(let s=0;s!0){this.programConfigurations={};for(const s of e)this.programConfigurations[s.id]=new uo(s,i,n);this.needsUpload=!1,this._featureMap=new jc,this._bufferOffset=0}populatePaintArrays(e,i,n,s,c,u,p){for(const m in this.programConfigurations)this.programConfigurations[m].populatePaintArrays(e,i,s,c,u,p);i.id!==void 0&&this._featureMap.add(i.id,n,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,i,n,s,c){for(const u of n)this.needsUpload=this.programConfigurations[u.id].updatePaintArrays(e,this._featureMap,i,u,s,c)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const i in this.programConfigurations)this.programConfigurations[i].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}const Zf={"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","pixel_ratio"],"fill-pattern":["pattern","pixel_ratio"],"fill-extrusion-pattern":["pattern","pixel_ratio"],"line-dasharray":["dash"]};function qf(t,e){return Zf[t]||[t.replace(`${e}-`,"").replace(/-/g,"_")]}const Wf={"line-pattern":{source:ae,composite:ae},"fill-pattern":{source:ae,composite:ae},"fill-extrusion-pattern":{source:ae,composite:ae},"line-dasharray":{source:_e,composite:_e}},Xf={color:{source:dr,composite:we},number:{source:Et,composite:dr}};function ud(t,e,i){const n=Wf[t];return n&&n[i]||Xf[e][i]}Ue(vl,"ConstantBinder"),Ue(ea,"PatternConstantBinder"),Ue(Cn,"SourceExpressionBinder"),Ue(ho,"PatternCompositeBinder"),Ue(Rr,"CompositeExpressionBinder"),Ue(uo,"ProgramConfiguration",{omit:["_buffers"]}),Ue(ns,"ProgramConfigurationSet");const dd="-transition";class Br extends Po{constructor(e,i){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:()=>!0,needGeometry:!1,needFeature:!1},this._filterCompiled=!1,e.type!=="custom"&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type!=="background"&&e.type!=="sky"&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),i.layout&&(this._unevaluatedLayout=new O(i.layout)),i.paint)){this._transitionablePaint=new A(i.paint);for(const n in e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(const n in e.layout)this.setLayoutProperty(n,e.layout[n],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new F(i.paint)}}getLayoutProperty(e){return e==="visibility"?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,i,n={}){i!=null&&this._validate(Zh,`layers.${this.id}.layout.${e}`,e,i,n)||(e!=="visibility"?this._unevaluatedLayout.setValue(e,i):this.visibility=i)}getPaintProperty(e){return Un(e,dd)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,i,n={}){if(i!=null&&this._validate($h,`layers.${this.id}.paint.${e}`,e,i,n))return!1;if(Un(e,dd))return this._transitionablePaint.setTransition(e.slice(0,-11),i||void 0),!1;{const s=this._transitionablePaint._values[e],c=s.value.isDataDriven(),u=s.value;this._transitionablePaint.setValue(e,i),this._handleSpecialPaintPropertyUpdate(e);const p=this._transitionablePaint._values[e].value,m=p.isDataDriven(),_=Un(e,"pattern")||e==="line-dasharray";return m||c||_||this._handleOverridablePaintPropertyUpdate(e,u,p)}}_handleSpecialPaintPropertyUpdate(e){}getProgramIds(){return null}getProgramConfiguration(e){return null}_handleOverridablePaintPropertyUpdate(e,i,n){return!1}isHidden(e){return!!(this.minzoom&&e=this.maxzoom)||this.visibility==="none"}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,i){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,i)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,i)}serialize(){const e={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&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),Vn(e,(i,n)=>!(i===void 0||n==="layout"&&!Object.keys(i).length||n==="paint"&&!Object.keys(i).length))}_validate(e,i,n,s,c={}){return(!c||c.validate!==!1)&&Fc(this,e.call(Oc,{key:i,layerType:this.type,objectKey:n,value:s,styleSpec:fe,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isSky(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const e in this.paint._values){const i=this.paint.get(e);if(i instanceof B&&io(i.property.specification)&&(i.value.kind==="source"||i.value.kind==="composite")&&i.value.isStateDependent)return!0}return!1}compileFilter(){this._filterCompiled||(this._featureFilter=Xs(this.filter),this._filterCompiled=!0)}invalidateCompiledFilter(){this._filterCompiled=!1}dynamicFilter(){return this._featureFilter.dynamicFilter}dynamicFilterNeedsFeature(){return this._featureFilter.needFeature}}const Hf=te([{name:"a_pos",components:2,type:"Int16"}],4),Kf=te([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]);class Yt{constructor(e=[]){this.segments=e}prepareSegment(e,i,n,s){let c=this.segments[this.segments.length-1];return e>Yt.MAX_VERTEX_ARRAY_LENGTH&&Ut(`Max vertices per segment is ${Yt.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!c||c.vertexLength+e>Yt.MAX_VERTEX_ARRAY_LENGTH||c.sortKey!==s)&&(c={vertexOffset:i.length,primitiveOffset:n.length,vertexLength:0,primitiveLength:0},s!==void 0&&(c.sortKey=s),this.segments.push(c)),c}get(){return this.segments}destroy(){for(const e of this.segments)for(const i in e.vaos)e.vaos[i].destroy()}static simpleSegment(e,i,n,s){return new Yt([{vertexOffset:e,primitiveOffset:i,vertexLength:n,primitiveLength:s,vaos:{},sortKey:0}])}}Yt.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Ue(Yt,"SegmentVector");var Ze=8192;class po{constructor(e,i){e&&(i?this.setSouthWest(e).setNorthEast(i):e.length===4?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))}setNorthEast(e){return this._ne=e instanceof At?new At(e.lng,e.lat):At.convert(e),this}setSouthWest(e){return this._sw=e instanceof At?new At(e.lng,e.lat):At.convert(e),this}extend(e){const i=this._sw,n=this._ne;let s,c;if(e instanceof At)s=e,c=e;else{if(!(e instanceof po))return Array.isArray(e)?e.length===4||e.every(Array.isArray)?this.extend(po.convert(e)):this.extend(At.convert(e)):typeof e=="object"&&e!==null&&e.hasOwnProperty("lat")&&(e.hasOwnProperty("lon")||e.hasOwnProperty("lng"))?this.extend(At.convert(e)):this;if(s=e._sw,c=e._ne,!s||!c)return this}return i||n?(i.lng=Math.min(s.lng,i.lng),i.lat=Math.min(s.lat,i.lat),n.lng=Math.max(c.lng,n.lng),n.lat=Math.max(c.lat,n.lat)):(this._sw=new At(s.lng,s.lat),this._ne=new At(c.lng,c.lat)),this}getCenter(){return new At((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 At(this.getWest(),this.getNorth())}getSouthEast(){return new At(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(e){const{lng:i,lat:n}=At.convert(e);let s=this._sw.lng<=i&&i<=this._ne.lng;return this._sw.lng>this._ne.lng&&(s=this._sw.lng>=i&&i>=this._ne.lng),this._sw.lat<=n&&n<=this._ne.lat&&s}static convert(e){return!e||e instanceof po?e:new po(e)}}var Zc=1e-6,qi=typeof Float32Array<"u"?Float32Array:Array;function pd(){var t=new qi(9);return qi!=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}function fd(t,e,i){var n=e[0],s=e[1],c=e[2],u=e[3],p=e[4],m=e[5],_=e[6],x=e[7],b=e[8],w=i[0],S=i[1],M=i[2],C=i[3],D=i[4],U=i[5],q=i[6],V=i[7],$=i[8];return t[0]=w*n+S*u+M*_,t[1]=w*s+S*p+M*x,t[2]=w*c+S*m+M*b,t[3]=C*n+D*u+U*_,t[4]=C*s+D*p+U*x,t[5]=C*c+D*m+U*b,t[6]=q*n+V*u+$*_,t[7]=q*s+V*p+$*x,t[8]=q*c+V*m+$*b,t}function Or(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 Qh(t,e){var i=e[0],n=e[1],s=e[2],c=e[3],u=e[4],p=e[5],m=e[6],_=e[7],x=e[8],b=e[9],w=e[10],S=e[11],M=e[12],C=e[13],D=e[14],U=e[15],q=i*p-n*u,V=i*m-s*u,$=i*_-c*u,X=n*m-s*p,W=n*_-c*p,ce=s*_-c*m,se=x*C-b*M,me=x*D-w*M,Ee=x*U-S*M,ue=b*D-w*C,ye=b*U-S*C,xe=w*U-S*D,be=q*xe-V*ye+$*ue+X*Ee-W*me+ce*se;return be?(t[0]=(p*xe-m*ye+_*ue)*(be=1/be),t[1]=(s*ye-n*xe-c*ue)*be,t[2]=(C*ce-D*W+U*X)*be,t[3]=(w*W-b*ce-S*X)*be,t[4]=(m*Ee-u*xe-_*me)*be,t[5]=(i*xe-s*Ee+c*me)*be,t[6]=(D*$-M*ce-U*V)*be,t[7]=(x*ce-w*$+S*V)*be,t[8]=(u*ye-p*Ee+_*se)*be,t[9]=(n*Ee-i*ye-c*se)*be,t[10]=(M*W-C*$+U*q)*be,t[11]=(b*$-x*W-S*q)*be,t[12]=(p*me-u*ue-m*se)*be,t[13]=(i*ue-n*me+s*se)*be,t[14]=(C*V-M*X-D*q)*be,t[15]=(x*X-b*V+w*q)*be,t):null}function os(t,e,i){var n=e[0],s=e[1],c=e[2],u=e[3],p=e[4],m=e[5],_=e[6],x=e[7],b=e[8],w=e[9],S=e[10],M=e[11],C=e[12],D=e[13],U=e[14],q=e[15],V=i[0],$=i[1],X=i[2],W=i[3];return t[0]=V*n+$*p+X*b+W*C,t[1]=V*s+$*m+X*w+W*D,t[2]=V*c+$*_+X*S+W*U,t[3]=V*u+$*x+X*M+W*q,t[4]=(V=i[4])*n+($=i[5])*p+(X=i[6])*b+(W=i[7])*C,t[5]=V*s+$*m+X*w+W*D,t[6]=V*c+$*_+X*S+W*U,t[7]=V*u+$*x+X*M+W*q,t[8]=(V=i[8])*n+($=i[9])*p+(X=i[10])*b+(W=i[11])*C,t[9]=V*s+$*m+X*w+W*D,t[10]=V*c+$*_+X*S+W*U,t[11]=V*u+$*x+X*M+W*q,t[12]=(V=i[12])*n+($=i[13])*p+(X=i[14])*b+(W=i[15])*C,t[13]=V*s+$*m+X*w+W*D,t[14]=V*c+$*_+X*S+W*U,t[15]=V*u+$*x+X*M+W*q,t}function bl(t,e,i){var n,s,c,u,p,m,_,x,b,w,S,M,C=i[0],D=i[1],U=i[2];return e===t?(t[12]=e[0]*C+e[4]*D+e[8]*U+e[12],t[13]=e[1]*C+e[5]*D+e[9]*U+e[13],t[14]=e[2]*C+e[6]*D+e[10]*U+e[14],t[15]=e[3]*C+e[7]*D+e[11]*U+e[15]):(s=e[1],c=e[2],u=e[3],p=e[4],m=e[5],_=e[6],x=e[7],b=e[8],w=e[9],S=e[10],M=e[11],t[0]=n=e[0],t[1]=s,t[2]=c,t[3]=u,t[4]=p,t[5]=m,t[6]=_,t[7]=x,t[8]=b,t[9]=w,t[10]=S,t[11]=M,t[12]=n*C+p*D+b*U+e[12],t[13]=s*C+m*D+w*U+e[13],t[14]=c*C+_*D+S*U+e[14],t[15]=u*C+x*D+M*U+e[15]),t}function ss(t,e,i){var n=i[0],s=i[1],c=i[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*s,t[5]=e[5]*s,t[6]=e[6]*s,t[7]=e[7]*s,t[8]=e[8]*c,t[9]=e[9]*c,t[10]=e[10]*c,t[11]=e[11]*c,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function eu(t,e,i){var n=Math.sin(i),s=Math.cos(i),c=e[4],u=e[5],p=e[6],m=e[7],_=e[8],x=e[9],b=e[10],w=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]=c*s+_*n,t[5]=u*s+x*n,t[6]=p*s+b*n,t[7]=m*s+w*n,t[8]=_*s-c*n,t[9]=x*s-u*n,t[10]=b*s-p*n,t[11]=w*s-m*n,t}function qc(t,e,i){var n=Math.sin(i),s=Math.cos(i),c=e[0],u=e[1],p=e[2],m=e[3],_=e[8],x=e[9],b=e[10],w=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=c*s-_*n,t[1]=u*s-x*n,t[2]=p*s-b*n,t[3]=m*s-w*n,t[8]=c*n+_*s,t[9]=u*n+x*s,t[10]=p*n+b*s,t[11]=m*n+w*s,t}function md(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}function _d(t,e,i){var n,s,c,u=i[0],p=i[1],m=i[2],_=Math.hypot(u,p,m);return _0&&(c=1/Math.sqrt(c)),t[0]=e[0]*c,t[1]=e[1]*c,t[2]=e[2]*c,t}function pr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ru(t,e,i){var n=e[0],s=e[1],c=e[2],u=i[0],p=i[1],m=i[2];return t[0]=s*m-c*p,t[1]=c*u-n*m,t[2]=n*p-s*u,t}function qt(t,e,i){var n=e[0],s=e[1],c=e[2],u=i[3]*n+i[7]*s+i[11]*c+i[15];return t[0]=(i[0]*n+i[4]*s+i[8]*c+i[12])/(u=u||1),t[1]=(i[1]*n+i[5]*s+i[9]*c+i[13])/u,t[2]=(i[2]*n+i[6]*s+i[10]*c+i[14])/u,t}function xd(t,e,i){var n=i[0],s=i[1],c=i[2],u=e[0],p=e[1],m=e[2],_=s*m-c*p,x=c*u-n*m,b=n*p-s*u,w=s*b-c*x,S=c*_-n*b,M=n*x-s*_,C=2*i[3];return x*=C,b*=C,S*=2,M*=2,t[0]=u+(_*=C)+(w*=2),t[1]=p+x+S,t[2]=m+b+M,t}var Ml,Fr=iu,Jf=yd,Qf=wl;function vd(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t}function bd(t,e){var i=e[0],n=e[1],s=e[2],c=e[3],u=i*i+n*n+s*s+c*c;return u>0&&(u=1/Math.sqrt(u)),t[0]=i*u,t[1]=n*u,t[2]=s*u,t[3]=c*u,t}function as(t,e,i){var n=e[0],s=e[1],c=e[2],u=e[3];return t[0]=i[0]*n+i[4]*s+i[8]*c+i[12]*u,t[1]=i[1]*n+i[5]*s+i[9]*c+i[13]*u,t[2]=i[2]*n+i[6]*s+i[10]*c+i[14]*u,t[3]=i[3]*n+i[7]*s+i[11]*c+i[15]*u,t}function wd(){var t=new qi(4);return qi!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Td(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function Ed(t,e,i){i*=.5;var n=e[0],s=e[1],c=e[2],u=e[3],p=Math.sin(i),m=Math.cos(i);return t[0]=n*m+u*p,t[1]=s*m+c*p,t[2]=c*m-s*p,t[3]=u*m-n*p,t}function Sd(t,e,i){i*=.5;var n=e[0],s=e[1],c=e[2],u=e[3],p=Math.sin(i),m=Math.cos(i);return t[0]=n*m-c*p,t[1]=s*m+u*p,t[2]=c*m+n*p,t[3]=u*m-s*p,t}tu(),Ml=new qi(4),qi!=Float32Array&&(Ml[0]=0,Ml[1]=0,Ml[2]=0,Ml[3]=0);var em=bd;tu(),ta(1,0,0),ta(0,1,0),wd(),wd(),pd();const tm=te([{type:"Float32",name:"a_globe_pos",components:3},{type:"Float32",name:"a_uv",components:2}]),{members:Md}=tm,Ad=te([{name:"a_pos_3",components:3,type:"Int16"}]);var Al=te([{name:"a_pos",type:"Int16",components:2}]);class nu{constructor(e,i){this.pos=e,this.dir=i}intersectsPlane(e,i,n){const s=pr(i,this.dir);if(Math.abs(s)<1e-6)return!1;const c=((e[0]-this.pos[0])*i[0]+(e[1]-this.pos[1])*i[1]+(e[2]-this.pos[2])*i[2])/s;return n[0]=this.pos[0]+this.dir[0]*c,n[1]=this.pos[1]+this.dir[1]*c,n[2]=this.pos[2]+this.dir[2]*c,!0}closestPointOnSphere(e,i,n){if(function(S,M){var C=S[0],D=S[1],U=S[2],q=M[0],V=M[1],$=M[2];return Math.abs(C-q)<=Zc*Math.max(1,Math.abs(C),Math.abs(q))&&Math.abs(D-V)<=Zc*Math.max(1,Math.abs(D),Math.abs(V))&&Math.abs(U-$)<=Zc*Math.max(1,Math.abs(U),Math.abs($))}(this.pos,e)||i===0)return n[0]=n[1]=n[2]=0,!1;const[s,c,u]=this.dir,p=this.pos[0]-e[0],m=this.pos[1]-e[1],_=this.pos[2]-e[2],x=s*s+c*c+u*u,b=2*(p*s+m*c+_*u),w=b*b-4*x*(p*p+m*m+_*_-i*i);if(w<0){const S=Math.max(-b/2,0),M=p+s*S,C=m+c*S,D=_+u*S,U=Math.hypot(M,C,D);return n[0]=M*i/U,n[1]=C*i/U,n[2]=D*i/U,!1}{const S=(-b-Math.sqrt(w))/(2*x);if(S<0){const M=Math.hypot(p,m,_);return n[0]=p*i/M,n[1]=m*i/M,n[2]=_*i/M,!1}return n[0]=p+s*S,n[1]=m+c*S,n[2]=_+u*S,!0}}}class ou{constructor(e,i,n,s,c){this.TL=e,this.TR=i,this.BR=n,this.BL=s,this.horizon=c}static fromInvProjectionMatrix(e,i,n){const s=[-1,1,1],c=[1,1,1],u=[1,-1,1],p=[-1,-1,1],m=qt(s,s,e),_=qt(c,c,e),x=qt(u,u,e),b=qt(p,p,e);return new ou(m,_,x,b,i/n)}}class su{constructor(e,i){this.points=e,this.planes=i}static fromInvProjectionMatrix(e,i,n,s){const c=Math.pow(2,n),u=[[-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(m=>{const _=as([],m,e),x=1/_[3]/i*c;return function(b,w,S){return b[0]=w[0]*S[0],b[1]=w[1]*S[1],b[2]=w[2]*S[2],b[3]=w[3]*S[3],b}(_,_,[x,x,s?1/_[3]:x,x])}),p=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(m=>{const _=Ci([],ru([],Fr([],u[m[0]],u[m[1]]),Fr([],u[m[2]],u[m[1]]))),x=-pr(_,u[m[1]]);return _.concat(x)});return new su(u,p)}}class zi{static fromPoints(e){const i=[1/0,1/0,1/0],n=[-1/0,-1/0,-1/0];for(const s of e)Tl(i,i,s),El(n,n,s);return new zi(i,n)}static applyTransform(e,i){const n=e.getCorners();for(let s=0;s=0;if(u===0)return 0;u!==i.length&&(n=!1)}if(n)return 2;for(let s=0;s<3;s++){let c=Number.MAX_VALUE,u=-Number.MAX_VALUE;for(let p=0;pthis.max[s]-this.min[s])return 0}return 1}}const au=5,Id=6,Qr=Ze/Math.PI/2,im=16383,ls=64,Il=[ls,32,16],fr=-Qr,mr=Qr,rm=[new zi([fr,fr,fr],[mr,mr,mr]),new zi([fr,fr,fr],[0,0,mr]),new zi([0,fr,fr],[mr,0,mr]),new zi([fr,0,fr],[0,mr,mr]),new zi([0,0,fr],[mr,mr,mr])];function Wc(t){return t*Qr/Pl}function Cd(t,e,i,n=!0){const s=rr([],t._camera.position,t.worldSize),c=[e,i,1,1];as(c,c,t.pixelMatrixInverse),vd(c,c,1/c[3]);const u=Ci([],Fr([],c,s)),p=t.globeMatrix,m=[p[12],p[13],p[14]],_=Fr([],m,s),x=wl(_),b=Ci([],_),w=t.worldSize/(2*Math.PI),S=pr(b,u),M=Math.asin(w/x);if(M1?null:function(n,s,c,u){const p=Math.sin(c);return n*(Math.sin((1-u)*c)/p)+s*(Math.sin(u*c)/p)}(t.a[e],t.b[e],t.angle,ct(i,0,1))+t.center[e]}function en(t){if(t.z<=1)return rm[t.z+2*t.y+t.x];const e=cu(Xc(t));return zi.fromPoints(e)}function cs(t,e,i){return rr(t,t,1-i),Sl(t,t,e,i)}function zd(t,e){const i=na(e.zoom);if(i===0)return en(t);const n=Xc(t),s=cu(n),c=tn(n.getWest())*e.worldSize,u=tn(n.getEast())*e.worldSize,p=rn(n.getNorth())*e.worldSize,m=rn(n.getSouth())*e.worldSize,_=[c,p,0],x=[u,p,0],b=[c,m,0],w=[u,m,0],S=Qh([],e.globeMatrix);return qt(_,_,S),qt(x,x,S),qt(b,b,S),qt(w,w,S),s[0]=cs(s[0],b,i),s[1]=cs(s[1],w,i),s[2]=cs(s[2],x,i),s[3]=cs(s[3],_,i),zi.fromPoints(s)}function Pd(t,e,i){for(const n of t)qt(n,n,e),rr(n,n,i)}function om(t,e,i){const n=e/t.worldSize,s=t.globeMatrix;if(i.z<=1){const se=en(i).getCorners();return Pd(se,s,n),zi.fromPoints(se)}const c=Xc(i),u=cu(c);Pd(u,s,n);const p=Number.MAX_VALUE,m=[-p,-p,-p],_=[p,p,p];if(c.contains(t.center)){for(const Ee of u)Tl(_,_,Ee),El(m,m,Ee);m[2]=0;const se=t.point,me=[se.x*n,se.y*n,0];return Tl(_,_,me),El(m,m,me),new zi(_,m)}const x=[s[12]*n,s[13]*n,s[14]*n],b=c.getCenter(),w=ct(t.center.lat,-wi,wi),S=ct(b.lat,-wi,wi),M=tn(t.center.lng),C=rn(w);let D=M-tn(b.lng);const U=C-rn(S);D>.5?D-=1:D<-.5&&(D+=1);let q=0;Math.abs(D)>Math.abs(U)?q=D>=0?1:3:(q=U>=0?0:2,Sl(x,x,[s[4]*n,s[5]*n,s[6]*n],-Math.sin(dt(U>=0?c.getSouth():c.getNorth()))*Qr));const V=u[q],$=u[(q+1)%4],X=new nm(V,$,x),W=[lu(X,0)||V[0],lu(X,1)||V[1],lu(X,2)||V[2]],ce=na(t.zoom);if(ce>0){const se=function({x:Ee,y:ue,z:ye},xe,be,Ce,pe){const De=1/(1<.5?$e=-1:Ke<-.5&&($e=1),Ne=((Ne+$e)*xe-(Ce*=xe))*be+Ce,Re=((Re+$e)*xe-Ce)*be+Ce,He=(He*xe-(pe*=xe))*be+pe,ze=(ze*xe-pe)*be+pe,[[Ne,ze,0],[Re,ze,0],[Re,He,0],[Ne,He,0]]}(i,e,t._pixelsPerMercatorPixel,M,C);for(let Ee=0;EeMath.PI/2*1.01}const Rd=dt(85),sm=Math.cos(Rd),am=Math.sin(Rd),Pl=63710088e-1,Bd=2*Math.PI*Pl;class fo{constructor(e,i){if(isNaN(e)||isNaN(i))throw new Error(`Invalid LngLat object: (${e}, ${i})`);if(this.lng=+e,this.lat=+i,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new fo(oi(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const i=Math.PI/180,n=this.lat*i,s=e.lat*i,c=Math.sin(n)*Math.sin(s)+Math.cos(n)*Math.cos(s)*Math.cos((e.lng-this.lng)*i);return Pl*Math.acos(Math.min(c,1))}toBounds(e=0){const i=360*e/40075017,n=i/Math.cos(Math.PI/180*this.lat);return new po(new fo(this.lng-n,this.lat-i),new fo(this.lng+n,this.lat+i))}toEcef(e){const i=Wc(e);return ra(this.lat,this.lng,Qr+i)}static convert(e){if(e instanceof fo)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new fo(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new fo(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}var At=fo;function du(t){return Bd*Math.cos(t*Math.PI/180)}function tn(t){return(180+t)/360}function rn(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Ur(t,e){return t/du(e)}function nr(t){return 360*t-180}function bi(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}function Od(t,e){return t*du(bi(e))}const wi=85.051129;function Fd(t){return 1/Math.cos(t*Math.PI/180)}class oa{constructor(e,i,n=0){this.x=+e,this.y=+i,this.z=+n}static fromLngLat(e,i=0){const n=At.convert(e);return new oa(tn(n.lng),rn(n.lat),Ur(i,n.lat))}toLngLat(){return new At(nr(this.x),bi(this.y))}toAltitude(){return Od(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/Bd*Fd(bi(this.y))}}function pu(t,e,i,n,s,c,u,p,m){const _=(e+n)/2,x=(i+s)/2,b=new Le(_,x);p(b),function(w,S,M,C,D,U){const q=M-D,V=C-U;return Math.abs((C-S)*q-(M-w)*V)/Math.hypot(q,V)}(b.x,b.y,c.x,c.y,u.x,u.y)>=m?(pu(t,e,i,_,x,c,b,p,m),pu(t,_,x,n,s,b,u,p,m)):t.push(u)}function Ud(t,e,i){let n=t[0],s=n.x,c=n.y;e(n);const u=[n];for(let p=1;pt.x+1||nt.y+1)&&Ut("Geometry exceeds allowed extent, reduce your vector tile buffer size"),t}function Pn(t,e,i){const n=t.loadGeometry(),s=t.extent,c=Ze/s;if(e&&i&&i.projection.isReprojectedInTileSpace){const u=1<{const S=nr((e.x+w.x/s)/u),M=bi((e.y+w.y/s)/u),C=x.project(S,M);w.x=(C.x*p-m)*s,w.y=(C.y*p-_)*s};for(let w=0;w=s||M.y<0||M.y>=s||(b(M),S.push(M));n[w]=S}}for(const u of n)for(const p of u)cm(p,c);return n}function hs(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?Pn(t):[]}}function Kc(t,e,i,n,s){t.emplaceBack(2*e+(n+1)/2,2*i+(s+1)/2)}function Yc(t,e,i){t.emplaceBack(e.x,e.y,e.z,i[0]*16384,i[1]*16384,i[2]*16384)}class _u{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(i=>i.id),this.index=e.index,this.hasPattern=!1,this.projection=e.projection,this.layoutVertexArray=new Te,this.indexArray=new je,this.segments=new Yt,this.programConfigurations=new ns(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id)}populate(e,i,n,s){const c=this.layers[0],u=[];let p=null;c.type==="circle"&&(p=c.layout.get("circle-sort-key"));for(const{feature:_,id:x,index:b,sourceLayerIndex:w}of e){const S=this.layers[0]._featureFilter.needGeometry,M=hs(_,S);if(!this.layers[0]._featureFilter.filter(new v(this.zoom),M,n))continue;const C=p?p.evaluate(M,{},n):void 0,D={id:x,properties:_.properties,type:_.type,sourceLayerIndex:w,index:b,geometry:S?M.geometry:Pn(_,n,s),patterns:{},sortKey:C};u.push(D)}p&&u.sort((_,x)=>_.sortKey-x.sortKey);let m=null;s.projection.name==="globe"&&(this.globeExtVertexArray=new Me,m=s.projection);for(const _ of u){const{geometry:x,index:b,sourceLayerIndex:w}=_,S=e[b].feature;this.addFeature(_,x,b,i.availableImages,n,m),i.featureIndex.insert(S,x,b,w,this.index)}}update(e,i,n,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,n,s)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Hf.members),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.globeExtVertexArray&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,Kf.members))),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}addFeature(e,i,n,s,c,u){for(const p of i)for(const m of p){const _=m.x,x=m.y;if(_<0||_>=Ze||x<0||x>=Ze)continue;if(u){const S=u.projectTilePoint(_,x,c),M=u.upVector(c,_,x),C=this.globeExtVertexArray;Yc(C,S,M),Yc(C,S,M),Yc(C,S,M),Yc(C,S,M)}const b=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),w=b.vertexLength;Kc(this.layoutVertexArray,_,x,-1,-1),Kc(this.layoutVertexArray,_,x,1,-1),Kc(this.layoutVertexArray,_,x,1,1),Kc(this.layoutVertexArray,_,x,-1,1),this.indexArray.emplaceBack(w,w+1,w+2),this.indexArray.emplaceBack(w,w+2,w+3),b.vertexLength+=4,b.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,{},s,c)}}function Nd(t,e){for(let i=0;i1){if(gu(t,e))return!0;for(let n=0;n1?i:i.sub(e)._mult(s)._add(e))}function $d(t,e){let i,n,s,c=!1;for(let u=0;ue.y!=s.y>e.y&&e.x<(s.x-n.x)*(e.y-n.y)/(s.y-n.y)+n.x&&(c=!c)}return c}function us(t,e){let i=!1;for(let n=0,s=t.length-1;ne.y!=u.y>e.y&&e.x<(u.x-c.x)*(e.y-c.y)/(u.y-c.y)+c.x&&(i=!i)}return i}function Zd(t,e,i,n,s){for(const u of t)if(e<=u.x&&i<=u.y&&n>=u.x&&s>=u.y)return!0;const c=[new Le(e,i),new Le(e,s),new Le(n,s),new Le(n,i)];if(t.length>2){for(const u of c)if(us(t,u))return!0}for(let u=0;us.x&&e.x>s.x||t.ys.y&&e.y>s.y)return!1;const c=Ui(t,e,i[0]);return c!==Ui(t,e,i[1])||c!==Ui(t,e,i[2])||c!==Ui(t,e,i[3])}function sa(t,e,i){const n=e.paint.get(t).value;return n.kind==="constant"?n.value:i.programConfigurations.get(e.id).getMaxValue(t)}function Jc(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function qd(t,e,i,n,s){if(!e[0]&&!e[1])return t;const c=Le.convert(e)._mult(s);i==="viewport"&&c._rotate(-n);const u=[];for(let p=0;p0){const V=i.projection.upVector(_,S.x,S.y);C.x+=V[0]*x*M,C.y+=V[1]*x*M,C.z+=V[2]*x*M}const D=c?S:_m(C.x,C.y,C.z,n),U=c?t.tilespaceRays.map(V=>ym(V,M)):t.queryGeometry.screenGeometry,q=as([],[C.x,C.y,C.z,1],n);if(!u&&c?m*=q[3]/i.cameraToCenterDistance:u&&!c&&(m*=i.cameraToCenterDistance/q[3]),c){const V=bi((w.y/Ze+_.y)/(1<<_.z));m/=i.projection.pixelsPerMeter(V,1)/Ur(1,V)}if(hm(U,D,m))return!0}return!1}function _m(t,e,i,n){const s=as([],[t,e,i,1],n);return new Le(s[0]/s[3],s[1]/s[3])}const Hd=ta(0,0,0),gm=ta(0,0,1);function ym(t,e){const i=tu();return Hd[2]=e,t.intersectsPlane(Hd,gm,i),new Le(i[0],i[1])}class Kd extends _u{}function Yd(t,{width:e,height:i},n,s){if(s){if(s instanceof Uint8ClampedArray)s=new Uint8Array(s.buffer);else if(s.length!==e*i*n)throw new RangeError("mismatched image size")}else s=new Uint8Array(e*i*n);return t.width=e,t.height=i,t.data=s,t}function Jd(t,e,i){const{width:n,height:s}=e;n===t.width&&s===t.height||(xu(t,e,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,n),height:Math.min(t.height,s)},i),t.width=n,t.height=s,t.data=e.data)}function xu(t,e,i,n,s,c){if(s.width===0||s.height===0)return e;if(s.width>t.width||s.height>t.height||i.x>t.width-s.width||i.y>t.height-s.height)throw new RangeError("out of range source coordinates for image copy");if(s.width>e.width||s.height>e.height||n.x>e.width-s.width||n.y>e.height-s.height)throw new RangeError("out of range destination coordinates for image copy");const u=t.data,p=e.data;for(let m=0;m{e[t.evaluationKey]=m;const _=t.expression.evaluate(e);s.data[u+p+0]=Math.floor(255*_.r/_.a),s.data[u+p+1]=Math.floor(255*_.g/_.a),s.data[u+p+2]=Math.floor(255*_.b/_.a),s.data[u+p+3]=Math.floor(255*_.a)};if(t.clips)for(let u=0,p=0;u80*i){n=c=t[0],s=u=t[1];for(var M=i;Mc&&(c=p),m>u&&(u=m);_=(_=Math.max(c-n,u-s))!==0?32767/_:0}return kl(w,S,i,n,s,_,0),S}function Qd(t,e,i,n,s){var c,u;if(s===Eu(t,e,i,n)>0)for(c=e;c=e;c-=n)u=ip(c,t[c],t[c+1],u);return u&&eh(u,u.next)&&(Ll(u),u=u.next),u}function ds(t,e){if(!t)return t;e||(e=t);var i,n=t;do if(i=!1,n.steiner||!eh(n,n.next)&&Jt(n.prev,n,n.next)!==0)n=n.next;else{if(Ll(n),(n=e=n.prev)===n.next)break;i=!0}while(i||n!==e);return e}function kl(t,e,i,n,s,c,u){if(t){!u&&c&&function(x,b,w,S){var M=x;do M.z===0&&(M.z=wu(M.x,M.y,b,w,S)),M.prevZ=M.prev,M.nextZ=M.next,M=M.next;while(M!==x);M.prevZ.nextZ=null,M.prevZ=null,function(C){var D,U,q,V,$,X,W,ce,se=1;do{for(U=C,C=null,$=null,X=0;U;){for(X++,q=U,W=0,D=0;D0||ce>0&&q;)W!==0&&(ce===0||!q||U.z<=q.z)?(V=U,U=U.nextZ,W--):(V=q,q=q.nextZ,ce--),$?$.nextZ=V:C=V,V.prevZ=$,$=V;U=q}$.nextZ=null,se*=2}while(X>1)}(M)}(t,n,s,c);for(var p,m,_=t;t.prev!==t.next;)if(p=t.prev,m=t.next,c?Em(t,n,s,c):Tm(t))e.push(p.i/i|0),e.push(t.i/i|0),e.push(m.i/i|0),Ll(t),t=m.next,_=m.next;else if((t=m)===_){u?u===1?kl(t=Sm(ds(t),e,i),e,i,n,s,c,2):u===2&&Mm(t,e,i,n,s,c):kl(ds(t),e,i,n,s,c,1);break}}}function Tm(t){var e=t.prev,i=t,n=t.next;if(Jt(e,i,n)>=0)return!1;for(var s=e.x,c=i.x,u=n.x,p=e.y,m=i.y,_=n.y,x=sc?s>u?s:u:c>u?c:u,S=p>m?p>_?p:_:m>_?m:_,M=n.next;M!==e;){if(M.x>=x&&M.x<=w&&M.y>=b&&M.y<=S&&aa(s,p,c,m,u,_,M.x,M.y)&&Jt(M.prev,M,M.next)>=0)return!1;M=M.next}return!0}function Em(t,e,i,n){var s=t.prev,c=t,u=t.next;if(Jt(s,c,u)>=0)return!1;for(var p=s.x,m=c.x,_=u.x,x=s.y,b=c.y,w=u.y,S=pm?p>_?p:_:m>_?m:_,D=x>b?x>w?x:w:b>w?b:w,U=wu(S,M,e,i,n),q=wu(C,D,e,i,n),V=t.prevZ,$=t.nextZ;V&&V.z>=U&&$&&$.z<=q;){if(V.x>=S&&V.x<=C&&V.y>=M&&V.y<=D&&V!==s&&V!==u&&aa(p,x,m,b,_,w,V.x,V.y)&&Jt(V.prev,V,V.next)>=0||(V=V.prevZ,$.x>=S&&$.x<=C&&$.y>=M&&$.y<=D&&$!==s&&$!==u&&aa(p,x,m,b,_,w,$.x,$.y)&&Jt($.prev,$,$.next)>=0))return!1;$=$.nextZ}for(;V&&V.z>=U;){if(V.x>=S&&V.x<=C&&V.y>=M&&V.y<=D&&V!==s&&V!==u&&aa(p,x,m,b,_,w,V.x,V.y)&&Jt(V.prev,V,V.next)>=0)return!1;V=V.prevZ}for(;$&&$.z<=q;){if($.x>=S&&$.x<=C&&$.y>=M&&$.y<=D&&$!==s&&$!==u&&aa(p,x,m,b,_,w,$.x,$.y)&&Jt($.prev,$,$.next)>=0)return!1;$=$.nextZ}return!0}function Sm(t,e,i){var n=t;do{var s=n.prev,c=n.next.next;!eh(s,c)&&ep(s,n,n.next,c)&&Dl(s,c)&&Dl(c,s)&&(e.push(s.i/i|0),e.push(n.i/i|0),e.push(c.i/i|0),Ll(n),Ll(n.next),n=t=c),n=n.next}while(n!==t);return ds(n)}function Mm(t,e,i,n,s,c){var u=t;do{for(var p=u.next.next;p!==u.prev;){if(u.i!==p.i&&Pm(u,p)){var m=tp(u,p);return u=ds(u,u.next),m=ds(m,m.next),kl(u,e,i,n,s,c,0),void kl(m,e,i,n,s,c,0)}p=p.next}u=u.next}while(u!==t)}function Am(t,e){return t.x-e.x}function Im(t,e){var i=function(s,c){var u,p=c,m=s.x,_=s.y,x=-1/0;do{if(_<=p.y&&_>=p.next.y&&p.next.y!==p.y){var b=p.x+(_-p.y)*(p.next.x-p.x)/(p.next.y-p.y);if(b<=m&&b>x&&(x=b,u=p.x=p.x&&p.x>=M&&m!==p.x&&aa(_u.x||p.x===u.x&&Cm(u,p)))&&(u=p,D=w)),p=p.next;while(p!==S);return u}(t,e);if(!i)return e;var n=tp(i,t);return ds(n,n.next),ds(i,i.next)}function Cm(t,e){return Jt(t.prev,t,e.prev)<0&&Jt(e.next,t,t.next)<0}function wu(t,e,i,n,s){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*s|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*s|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function zm(t){var e=t,i=t;do(e.x=(t-u)*(c-p)&&(t-u)*(n-p)>=(i-u)*(e-p)&&(i-u)*(c-p)>=(s-u)*(n-p)}function Pm(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(i,n){var s=i;do{if(s.i!==i.i&&s.next.i!==i.i&&s.i!==n.i&&s.next.i!==n.i&&ep(s,s.next,i,n))return!0;s=s.next}while(s!==i);return!1}(t,e)&&(Dl(t,e)&&Dl(e,t)&&function(i,n){var s=i,c=!1,u=(i.x+n.x)/2,p=(i.y+n.y)/2;do s.y>p!=s.next.y>p&&s.next.y!==s.y&&u<(s.next.x-s.x)*(p-s.y)/(s.next.y-s.y)+s.x&&(c=!c),s=s.next;while(s!==i);return c}(t,e)&&(Jt(t.prev,t,e.prev)||Jt(t,e.prev,e))||eh(t,e)&&Jt(t.prev,t,t.next)>0&&Jt(e.prev,e,e.next)>0)}function Jt(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function eh(t,e){return t.x===e.x&&t.y===e.y}function ep(t,e,i,n){var s=ih(Jt(t,e,i)),c=ih(Jt(t,e,n)),u=ih(Jt(i,n,t)),p=ih(Jt(i,n,e));return s!==c&&u!==p||!(s!==0||!th(t,i,e))||!(c!==0||!th(t,n,e))||!(u!==0||!th(i,t,n))||!(p!==0||!th(i,e,n))}function th(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 ih(t){return t>0?1:t<0?-1:0}function Dl(t,e){return Jt(t.prev,t,t.next)<0?Jt(t,e,t.next)>=0&&Jt(t,t.prev,e)>=0:Jt(t,e,t.prev)<0||Jt(t,t.next,e)<0}function tp(t,e){var i=new Tu(t.i,t.x,t.y),n=new Tu(e.i,e.x,e.y),s=t.next,c=e.prev;return t.next=e,e.prev=t,i.next=s,s.prev=i,n.next=i,i.prev=n,c.next=n,n.prev=c,n}function ip(t,e,i,n){var s=new Tu(t,e,i);return n?(s.next=n.next,s.prev=n,n.next.prev=s,n.next=s):(s.prev=s,s.next=s),s}function Ll(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 Tu(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Eu(t,e,i,n){for(var s=0,c=e,u=i-n;c0&&i.holes.push(n+=t[s-1].length)}return i};var Su=Yi(bu.exports);function km(t,e,i,n,s){rp(t,e,i||0,n||t.length-1,s||Dm)}function rp(t,e,i,n,s){for(;n>i;){if(n-i>600){var c=n-i+1,u=e-i+1,p=Math.log(c),m=.5*Math.exp(2*p/3),_=.5*Math.sqrt(p*m*(c-m)/c)*(u-c/2<0?-1:1);rp(t,e,Math.max(i,Math.floor(e-u*m/c+_)),Math.min(n,Math.floor(e+(c-u)*m/c+_)),s)}var x=t[e],b=i,w=n;for(Rl(t,i,e),s(t[n],x)>0&&Rl(t,i,n);b0;)w--}s(t[i],x)===0?Rl(t,i,w):Rl(t,++w,n),w<=e&&(i=w+1),e<=w&&(n=w-1)}}function Rl(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function Dm(t,e){return te?1:0}function Mu(t,e){const i=t.length;if(i<=1)return[t];const n=[];let s,c;for(let u=0;u1)for(let u=0;ui.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Te,this.indexArray=new je,this.indexArray2=new ui,this.programConfigurations=new ns(e.layers,e.zoom),this.segments=new Yt,this.segments2=new Yt,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id),this.projection=e.projection}populate(e,i,n,s){this.hasPattern=Au("fill",this.layers,i);const c=this.layers[0].layout.get("fill-sort-key"),u=[];for(const{feature:p,id:m,index:_,sourceLayerIndex:x}of e){const b=this.layers[0]._featureFilter.needGeometry,w=hs(p,b);if(!this.layers[0]._featureFilter.filter(new v(this.zoom),w,n))continue;const S=c?c.evaluate(w,{},n,i.availableImages):void 0,M={id:m,properties:p.properties,type:p.type,sourceLayerIndex:x,index:_,geometry:b?w.geometry:Pn(p,n,s),patterns:{},sortKey:S};u.push(M)}c&&u.sort((p,m)=>p.sortKey-m.sortKey);for(const p of u){const{geometry:m,index:_,sourceLayerIndex:x}=p;if(this.hasPattern){const b=Iu("fill",this.layers,p,this.zoom,i);this.patternFeatures.push(b)}else this.addFeature(p,m,_,n,{},i.availableImages);i.featureIndex.insert(e[_].feature,m,_,x,this.index)}}update(e,i,n,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,n,s)}addFeatures(e,i,n,s,c){for(const u of this.patternFeatures)this.addFeature(u,u.geometry,u.index,i,n,s)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,wm),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),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(e,i,n,s,c,u=[]){for(const p of Mu(i,500)){let m=0;for(const M of p)m+=M.length;const _=this.segments.prepareSegment(m,this.layoutVertexArray,this.indexArray),x=_.vertexLength,b=[],w=[];for(const M of p){if(M.length===0)continue;M!==p[0]&&w.push(b.length/2);const C=this.segments2.prepareSegment(M.length,this.layoutVertexArray,this.indexArray2),D=C.vertexLength;this.layoutVertexArray.emplaceBack(M[0].x,M[0].y),this.indexArray2.emplaceBack(D+M.length-1,D),b.push(M[0].x),b.push(M[0].y);for(let U=1;U>3}if(s--,n===1||n===2)c+=t.readSVarint(),u+=t.readSVarint(),n===1&&(e&&p.push(e),e=[]),e.push(new Nm(c,u));else{if(n!==7)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&p.push(e),p},la.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,i=1,n=0,s=0,c=0,u=1/0,p=-1/0,m=1/0,_=-1/0;t.pos>3}if(n--,i===1||i===2)(s+=t.readSVarint())p&&(p=s),(c+=t.readSVarint())_&&(_=c);else if(i!==7)throw new Error("unknown command "+i)}return[u,m,p,_]},la.prototype.toGeoJSON=function(t,e,i){var n,s,c=this.extent*Math.pow(2,i),u=this.extent*t,p=this.extent*e,m=this.loadGeometry(),_=la.types[this.type];function x(S){for(var M=0;M>3;s=u===1?n.readString():u===2?n.readFloat():u===3?n.readDouble():u===4?n.readVarint64():u===5?n.readVarint():u===6?n.readSVarint():u===7?n.readBoolean():null}return s}(i))}sp.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 $m(this._pbf,e,this.extent,this._keys,this._values)};var qm=op;function Wm(t,e,i){if(t===3){var n=new qm(i,i.readVarint()+i.pos);n.length&&(e[n.name]=n)}}var Cu=nh.VectorTile=function(t,e){this.layers=t.readFields(Wm,{},e)},oh=nh.VectorTileFeature=np;function sh(t,e,i,n){const s=[],c=n===0?(u,p,m,_,x,b)=>{u.push(new Le(b,m+(b-p)/(_-p)*(x-m)))}:(u,p,m,_,x,b)=>{u.push(new Le(p+(b-m)/(x-m)*(_-p),b))};for(const u of t){const p=[];for(const m of u){if(m.length<=2)continue;const _=[];for(let w=0;we&&c(_,S,M,C,D,e):U>i?q=e&&c(_,S,M,C,D,e),q>i&&U<=i&&c(_,S,M,C,D,i)}let x=m[m.length-1];const b=n===0?x.x:x.y;b>=e&&b<=i&&_.push(x),_.length&&(x=_[_.length-1],_[0].x===x.x&&_[0].y===x.y||_.push(_[0]),p.push(_))}p.length&&s.push(p)}return s}nh.VectorTileLayer=op;const Xm=oh.types,Hm=Math.pow(2,13);function Bl(t,e,i,n,s,c,u,p){t.emplaceBack((e<<1)+u,(i<<1)+c,(Math.floor(n*Hm)<<1)+s,Math.round(p))}function Ol(t,e,i){t.emplaceBack(e.x,e.y,e.z,i[0]*16384,i[1]*16384,i[2]*16384)}class ap{constructor(){this.acc=new Le(0,0),this.polyCount=[]}startRing(e){this.currentPolyCount={edges:0,top:0},this.polyCount.push(this.currentPolyCount),this.min||(this.min=new Le(e.x,e.y),this.max=new Le(e.x,e.y))}append(e,i){this.currentPolyCount.edges++,this.acc._add(e);const n=this.min,s=this.max;e.xs.x&&(s.x=e.x),e.ys.y&&(s.y=e.y),((e.x===0||e.x===Ze)&&e.x===i.x)!=((e.y===0||e.y===Ze)&&e.y===i.y)&&this.processBorderOverlap(e,i),i.x<0!=e.x<0&&this.addBorderIntersection(0,mt(i.y,e.y,(0-i.x)/(e.x-i.x))),i.x>Ze!=e.x>Ze&&this.addBorderIntersection(1,mt(i.y,e.y,(Ze-i.x)/(e.x-i.x))),i.y<0!=e.y<0&&this.addBorderIntersection(2,mt(i.x,e.x,(0-i.y)/(e.y-i.y))),i.y>Ze!=e.y>Ze&&this.addBorderIntersection(3,mt(i.x,e.x,(Ze-i.y)/(e.y-i.y)))}addBorderIntersection(e,i){this.borders||(this.borders=[[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE]]);const n=this.borders[e];in[1]&&(n[1]=i)}processBorderOverlap(e,i){if(e.x===i.x){if(e.y===i.y)return;const n=e.x===0?0:1;this.addBorderIntersection(n,i.y),this.addBorderIntersection(n,e.y)}else{const n=e.y===0?2:3;this.addBorderIntersection(n,i.x),this.addBorderIntersection(n,e.x)}}centroid(){const e=this.polyCount.reduce((i,n)=>i+n.edges,0);return e!==0?this.acc.div(e)._round():new Le(0,0)}span(){return new Le(this.max.x-this.min.x,this.max.y-this.min.y)}intersectsCount(){return this.borders.reduce((e,i)=>e+ +(i[0]!==Number.MAX_VALUE),0)}}class Fl{constructor(e){this.zoom=e.zoom,this.canonical=e.canonical,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(i=>i.id),this.index=e.index,this.hasPattern=!1,this.edgeRadius=0,this.projection=e.projection,this.layoutVertexArray=new ge,this.centroidVertexArray=new Lr,this.indexArray=new je,this.programConfigurations=new ns(e.layers,e.zoom),this.segments=new Yt,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id),this.enableTerrain=e.enableTerrain}populate(e,i,n,s){this.features=[],this.hasPattern=Au("fill-extrusion",this.layers,i),this.featuresOnBorder=[],this.borders=[[],[],[],[]],this.borderDoneWithNeighborZ=[-1,-1,-1,-1],this.tileToMeter=function(c){const u=Math.exp(Math.PI*(1-c.y/(1<=0;U--){const q=S[U];(q.length===0||(M=q[0]).every(V=>V.x<=0)||M.every(V=>V.x>=Ze)||M.every(V=>V.y<=0)||M.every(V=>V.y>=Ze))&&S.splice(U,1)}var M;let C;if(x)C=fp(S,m,s);else{C=[];for(const U of S)C.push({polygon:U,bounds:m})}const D=w?this.edgeRadius:0;for(const{polygon:U,bounds:q}of C){let V=0,$=0;for(const W of U)w&&!W[0].equals(W[W.length-1])&&W.push(W[0]),$+=w?W.length-1:W.length;const X=this.segments.prepareSegment((w?5:4)*$,this.layoutVertexArray,this.indexArray);if(w){const W=[],ce=[];V=X.vertexLength;for(const me of U){let Ee,ue;me.length&&me!==U[0]&&ce.push(W.length/2),Ee=me[1].sub(me[0])._perp()._unit();for(let ye=1;ye4&&up(W[W.length-2],W[0],W[1]),ue=D?Km(W[W.length-2],W[0],W[1],D):0;se=W[1].sub(W[0])._perp()._unit();let ye=!0;for(let xe=1,be=0;xe0?1:0,ze=Ce.dist(pe);if(be+ze>32768&&(be=0),D){me=De.sub(pe)._perp()._unit();let Ye=cp(Ce,pe,De,lp(se,me),D);isNaN(Ye)&&(Ye=0);const We=pe.sub(Ce)._unit();Ce=Ce.add(We.mult(ue))._round(),pe=pe.add(We.mult(-Ye))._round(),ue=Ye,se=me}const $e=X.vertexLength,Ke=W.length>4&&up(Ce,pe,De);let gt=dp(be,Ee,ye);if(Bl(this.layoutVertexArray,Ce.x,Ce.y,Re,He,0,0,gt),Bl(this.layoutVertexArray,Ce.x,Ce.y,Re,He,0,1,gt),be+=ze,gt=dp(be,Ke,!ye),Ee=Ke,Bl(this.layoutVertexArray,pe.x,pe.y,Re,He,0,0,gt),Bl(this.layoutVertexArray,pe.x,pe.y,Re,He,0,1,gt),X.vertexLength+=4,this.indexArray.emplaceBack($e+0,$e+1,$e+2),this.indexArray.emplaceBack($e+1,$e+3,$e+2),X.primitiveLength+=2,D){const Ye=V+(xe===1?W.length-2:xe-2),We=xe===1?V:Ye+1;if(this.indexArray.emplaceBack($e+1,Ye,$e+3),this.indexArray.emplaceBack(Ye,We,$e+3),X.primitiveLength+=2,ce===void 0&&(ce=$e),!hp(De,W[xe],q)){const Rt=xe===W.length-1?ce:X.vertexLength;this.indexArray.emplaceBack($e+2,$e+3,Rt),this.indexArray.emplaceBack($e+3,Rt+1,Rt),this.indexArray.emplaceBack($e+3,We,Rt+1),X.primitiveLength+=3}ye=!ye}if(x){const Ye=this.layoutVertexExtArray,We=_.projectTilePoint(Ce.x,Ce.y,s),Rt=_.projectTilePoint(pe.x,pe.y,s),et=_.upVector(s,Ce.x,Ce.y),tt=_.upVector(s,pe.x,pe.y);Ol(Ye,We,et),Ol(Ye,We,et),Ol(Ye,Rt,tt),Ol(Ye,Rt,tt)}}w&&(V+=W.length-1)}}if(b&&b.polyCount.length>0){if(b.borders){b.vertexArrayOffset=this.centroidVertexArray.length;const U=b.borders,q=this.featuresOnBorder.push(b)-1;for(let V=0;V<4;V++)U[V][0]!==Number.MAX_VALUE&&this.borders[V].push(q)}this.encodeCentroid(b.borders?void 0:b.centroid(),b)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,c,u,s)}sortBorders(){for(let e=0;e<4;e++)this.borders[e].sort((i,n)=>this.featuresOnBorder[i].borders[e][0]-this.featuresOnBorder[n].borders[e][0])}encodeCentroid(e,i,n=!0){let s,c;if(e)if(e.y!==0){const p=i.span()._mult(this.tileToMeter);s=(Math.max(e.x,1)<<3)+Math.min(7,Math.round(p.x/10)),c=(Math.max(e.y,1)<<3)+Math.min(7,Math.round(p.y/10))}else s=Math.ceil(7*(e.x+450)),c=0;else s=0,c=+n;let u=n?this.centroidVertexArray.length:i.vertexArrayOffset;for(const p of i.polyCount){n&&this.centroidVertexArray.resize(this.centroidVertexArray.length+4*p.edges+p.top);for(let m=0;mi[1].x&&e.x>i[1].x||t.yi[1].y&&e.y>i[1].y}function up(t,e,i){if(t.x<0||t.x>=Ze||e.x<0||e.x>=Ze||i.x<0||i.x>=Ze)return!1;const n=i.sub(e),s=n.perp(),c=t.sub(e);return(n.x*c.x+n.y*c.y)/Math.sqrt((n.x*n.x+n.y*n.y)*(c.x*c.x+c.y*c.y))>-.866&&s.x*c.x+s.y*c.y<0}function dp(t,e,i){const n=e?2|t:-3&t;return i?1|n:-2&n}function pp(){const t=Math.PI/32,e=Math.tan(t),i=Pl;return i*Math.sqrt(1+2*e*e)-i}function fp(t,e,i){const n=1<{for(const se of W)M.push({polygon:se,bounds:ce})},D=Math.ceil(Math.log2(x)),U=Math.ceil(Math.log2(b)),q=D-U,V=[];for(let W=0;W0?0:1);for(let W=0;Wce+1?X.push({polygons:be,bounds:pe,depth:ce+1}):C(be,pe)}if(Ce.length){const pe=[new Le(se===0?xe:me.x,se===1?xe:me.y),Ee];V.length>ce+1?X.push({polygons:Ce,bounds:pe,depth:ce+1}):C(Ce,pe)}}return M}(t,e,Math.ceil((c-s)/11.25),Math.ceil((u-p)/11.25),1,(m,_,x)=>{if(m===0)return .5*(_+x);{const b=bi((i.y+_/Ze)/n);return(rn(.5*(bi((i.y+x/Ze)/n)+b))*n-i.y)*Ze}})}Ue(Fl,"FillExtrusionBucket",{omit:["layers","features"]}),Ue(ap,"PartMetadata");const Ym=new j({"fill-extrusion-edge-radius":new I(fe["layout_fill-extrusion"]["fill-extrusion-edge-radius"])});var Jm={paint:new j({"fill-extrusion-opacity":new I(fe["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new L(fe["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new I(fe["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new I(fe["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new L(fe["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new L(fe["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new L(fe["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new I(fe["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]),"fill-extrusion-ambient-occlusion-intensity":new I(fe["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-intensity"]),"fill-extrusion-ambient-occlusion-radius":new I(fe["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-radius"]),"fill-extrusion-rounded-roof":new I(fe["paint_fill-extrusion"]["fill-extrusion-rounded-roof"])}),layout:Ym};function mp(t,e,i){var n=2*Math.PI*6378137/256/Math.pow(2,i);return[t*n-2*Math.PI*6378137/2,e*n-2*Math.PI*6378137/2]}class ah{constructor(e,i,n){this.z=e,this.x=i,this.y=n,this.key=Ul(0,e,e,i,n)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,i){const n=function(c,u,p){var m=mp(256*c,256*(u=Math.pow(2,p)-u-1),p),_=mp(256*(c+1),256*(u+1),p);return m[0]+","+m[1]+","+_[0]+","+_[1]}(this.x,this.y,this.z),s=function(c,u,p){let m,_="";for(let x=c;x>0;x--)m=1<this.canonical.z?new Pi(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Pi(e,this.wrap,e,this.canonical.x>>i,this.canonical.y>>i)}calculateScaledKey(e,i=!0){if(this.overscaledZ===e&&i)return this.key;if(e>this.canonical.z)return Ul(this.wrap*+i,e,this.canonical.z,this.canonical.x,this.canonical.y);{const n=this.canonical.z-e;return Ul(this.wrap*+i,e,e,this.canonical.x>>n,this.canonical.y>>n)}}isChildOf(e){if(e.wrap!==this.wrap)return!1;const i=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ>i&&e.canonical.y===this.canonical.y>>i}children(e){if(this.overscaledZ>=e)return[new Pi(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const i=this.canonical.z+1,n=2*this.canonical.x,s=2*this.canonical.y;return[new Pi(i,this.wrap,i,n,s),new Pi(i,this.wrap,i,n+1,s),new Pi(i,this.wrap,i,n,s+1),new Pi(i,this.wrap,i,n+1,s+1)]}isLessThan(e){return this.wrape.wrap)&&(this.overscaledZe.overscaledZ)&&(this.canonical.xe.canonical.x)&&this.canonical.yi.id),this.index=e.index,this.projection=e.projection,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(i=>{this.gradients[i.id]={}}),this.layoutVertexArray=new he,this.layoutVertexArray2=new we,this.indexArray=new je,this.programConfigurations=new ns(e.layers,e.zoom),this.segments=new Yt,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id)}populate(e,i,n,s){this.hasPattern=Au("line",this.layers,i);const c=this.layers[0].layout.get("line-sort-key"),u=[];for(const{feature:x,id:b,index:w,sourceLayerIndex:S}of e){const M=this.layers[0]._featureFilter.needGeometry,C=hs(x,M);if(!this.layers[0]._featureFilter.filter(new v(this.zoom),C,n))continue;const D=c?c.evaluate(C,{},n):void 0,U={id:b,properties:x.properties,type:x.type,sourceLayerIndex:S,index:w,geometry:M?C.geometry:Pn(x,n,s),patterns:{},sortKey:D};u.push(U)}c&&u.sort((x,b)=>x.sortKey-b.sortKey);const{lineAtlas:p,featureIndex:m}=i,_=this.addConstantDashes(p);for(const x of u){const{geometry:b,index:w,sourceLayerIndex:S}=x;if(_&&this.addFeatureDashes(x,p),this.hasPattern){const M=Iu("line",this.layers,x,this.zoom,i);this.patternFeatures.push(M)}else this.addFeature(x,b,w,n,p.positions,i.availableImages);m.insert(e[w].feature,b,w,S,this.index)}}addConstantDashes(e){let i=!1;for(const n of this.layers){const s=n.paint.get("line-dasharray").value,c=n.layout.get("line-cap").value;if(s.kind!=="constant"||c.kind!=="constant")i=!0;else{const u=c.value,p=s.value;if(!p)continue;e.addDash(p,u)}}return i}addFeatureDashes(e,i){const n=this.zoom;for(const s of this.layers){const c=s.paint.get("line-dasharray").value,u=s.layout.get("line-cap").value;if(c.kind==="constant"&&u.kind==="constant")continue;let p,m;if(c.kind==="constant"){if(p=c.value,!p)continue}else p=c.evaluate({zoom:n},e);m=u.kind==="constant"?u.value:u.evaluate({zoom:n},e),i.addDash(p,m),e.patterns[s.id]=i.getKey(p,m)}}update(e,i,n,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,n,s)}addFeatures(e,i,n,s,c){for(const u of this.patternFeatures)this.addFeature(u,u.geometry,u.index,i,n,s)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,i_)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,e_),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,i,n,s,c,u){const p=this.layers[0].layout,m=p.get("line-join").evaluate(e,{}),_=p.get("line-cap").evaluate(e,{}),x=p.get("line-miter-limit"),b=p.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const w of i)this.addLine(w,e,m,_,x,b);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,c,u,s)}addLine(e,i,n,s,c,u){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineSoFar=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let U=0;U=2&&e[m-1].equals(e[m-2]);)m--;let _=0;for(;_0;if(ce&&U>_){const ue=w.dist(S);if(ue>2*x){const ye=w.sub(w.sub(S)._mult(x/ue)._round());this.updateDistance(S,ye),this.addCurrentVertex(ye,C,0,0,b),S=ye}}const me=S&&M;let Ee=me?n:p?"butt":s;if(me&&Ee==="round"&&(Xc&&(Ee="bevel"),Ee==="bevel"&&(X>2&&(Ee="flipbevel"),X100)q=D.mult(-1);else{const ue=X*C.add(D).mag()/C.sub(D).mag();q._perp()._mult(ue*(se?-1:1))}this.addCurrentVertex(w,q,0,0,b),this.addCurrentVertex(w,q.mult(-1),0,0,b)}else if(Ee==="bevel"||Ee==="fakeround"){const ue=-Math.sqrt(X*X-1),ye=se?ue:0,xe=se?0:ue;if(S&&this.addCurrentVertex(w,C,ye,xe,b),Ee==="fakeround"){const be=Math.round(180*W/Math.PI/20);for(let Ce=1;Ce2*x){const ye=w.add(M.sub(w)._mult(x/ue)._round());this.updateDistance(w,ye),this.addCurrentVertex(ye,D,0,0,b),w=ye}}}}addCurrentVertex(e,i,n,s,c,u=!1){const p=i.y*s-i.x,m=-i.y-i.x*s;this.addHalfVertex(e,i.x+i.y*n,i.y-i.x*n,u,!1,n,c),this.addHalfVertex(e,p,m,u,!0,-s,c)}addHalfVertex({x:e,y:i},n,s,c,u,p,m){this.layoutVertexArray.emplaceBack((e<<1)+(c?1:0),(i<<1)+(u?1:0),Math.round(63*n)+128,Math.round(63*s)+128,1+(p===0?0:p<0?-1:1),0,this.lineSoFar),this.lineClips&&this.layoutVertexArray2.emplaceBack(this.scaledDistance,this.lineClipsArray.length,this.lineClips.start,this.lineClips.end);const _=m.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,_),m.primitiveLength++),u?this.e2=_:this.e1=_}updateScaledDistance(){if(this.lineClips){const e=this.totalDistance/(this.lineClips.end-this.lineClips.start);this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=e*this.lineClips.start+this.distance}else this.lineSoFar=this.distance}updateDistance(e,i){this.distance+=e.dist(i),this.updateScaledDistance()}}Ue(lh,"LineBucket",{omit:["layers","patternFeatures"]});const o_=new j({"line-cap":new L(fe.layout_line["line-cap"]),"line-join":new L(fe.layout_line["line-join"]),"line-miter-limit":new I(fe.layout_line["line-miter-limit"]),"line-round-limit":new I(fe.layout_line["line-round-limit"]),"line-sort-key":new L(fe.layout_line["line-sort-key"])});var xp={paint:new j({"line-opacity":new L(fe.paint_line["line-opacity"]),"line-color":new L(fe.paint_line["line-color"]),"line-translate":new I(fe.paint_line["line-translate"]),"line-translate-anchor":new I(fe.paint_line["line-translate-anchor"]),"line-width":new L(fe.paint_line["line-width"]),"line-gap-width":new L(fe.paint_line["line-gap-width"]),"line-offset":new L(fe.paint_line["line-offset"]),"line-blur":new L(fe.paint_line["line-blur"]),"line-dasharray":new L(fe.paint_line["line-dasharray"]),"line-pattern":new L(fe.paint_line["line-pattern"]),"line-gradient":new N(fe.paint_line["line-gradient"]),"line-trim-offset":new I(fe.paint_line["line-trim-offset"])}),layout:o_};const vp=new class extends L{possiblyEvaluate(t,e){return e=new v(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,transition:e.transition}),super.possiblyEvaluate(t,e)}evaluate(t,e,i,n){return e=Wt({},e,{zoom:Math.floor(e.zoom)}),super.evaluate(t,e,i,n)}}(xp.paint.properties["line-width"].specification);function bp(t,e){return e>0?e+2*t:t}vp.useIntegerZoom=!0;const s_=te([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_tex_size",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),a_=te([{name:"a_globe_anchor",components:3,type:"Int16"},{name:"a_globe_normal",components:3,type:"Float32"}],4),l_=te([{name:"a_projected_pos",components:4,type:"Float32"}],4);te([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const c_=te([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]),h_=te([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"}]);te([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"tileAnchorX"},{type:"Int16",name:"tileAnchorY"},{type:"Float32",name:"x1"},{type:"Float32",name:"y1"},{type:"Float32",name:"x2"},{type:"Float32",name:"y2"},{type:"Int16",name:"padding"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const wp=te([{name:"a_pos",components:3,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),u_=te([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);te([{name:"triangle",components:3,type:"Uint16"}]),te([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{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"},{type:"Uint8",name:"flipState"}]),te([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{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",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),te([{type:"Float32",name:"offsetX"}]),te([{type:"Int16",name:"x"},{type:"Int16",name:"y"}]);var mi=24;const Vr=128;function zu(t,e){const{expression:i}=e;if(i.kind==="constant")return{kind:"constant",layoutSize:i.evaluate(new v(t+1))};if(i.kind==="source")return{kind:"source"};{const{zoomStops:n,interpolationType:s}=i;let c=0;for(;c{n.text=function(s,c,u){const p=c.layout.get("text-transform").evaluate(u,{});return p==="uppercase"?s=s.toLocaleUpperCase():p==="lowercase"&&(s=s.toLocaleLowerCase()),y.applyArabicShaping&&(s=y.applyArabicShaping(s)),s}(n.text,e,i)}),t}const Nl={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂","←":"↑","→":"↓"};function f_(t){return t==="︶"||t==="﹈"||t==="︸"||t==="﹄"||t==="﹂"||t==="︾"||t==="︼"||t==="︺"||t==="︘"||t==="﹀"||t==="︐"||t==="︓"||t==="︔"||t==="`"||t===" ̄"||t==="︑"||t==="︒"}function m_(t){return t==="︵"||t==="﹇"||t==="︷"||t==="﹃"||t==="﹁"||t==="︽"||t==="︻"||t==="︹"||t==="︗"||t==="︿"}var Tp=Pt,Ep=function(t,e,i,n,s){var c,u,p=8*s-n-1,m=(1<>1,x=-7,b=i?s-1:0,w=i?-1:1,S=t[e+b];for(b+=w,c=S&(1<<-x)-1,S>>=-x,x+=p;x>0;c=256*c+t[e+b],b+=w,x-=8);for(u=c&(1<<-x)-1,c>>=-x,x+=n;x>0;u=256*u+t[e+b],b+=w,x-=8);if(c===0)c=1-_;else{if(c===m)return u?NaN:1/0*(S?-1:1);u+=Math.pow(2,n),c-=_}return(S?-1:1)*u*Math.pow(2,c-n)},Sp=function(t,e,i,n,s,c){var u,p,m,_=8*c-s-1,x=(1<<_)-1,b=x>>1,w=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=n?0:c-1,M=n?1:-1,C=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(p=isNaN(e)?1:0,u=x):(u=Math.floor(Math.log(e)/Math.LN2),e*(m=Math.pow(2,-u))<1&&(u--,m*=2),(e+=u+b>=1?w/m:w*Math.pow(2,1-b))*m>=2&&(u++,m/=2),u+b>=x?(p=0,u=x):u+b>=1?(p=(e*m-1)*Math.pow(2,s),u+=b):(p=e*Math.pow(2,b-1)*Math.pow(2,s),u=0));s>=8;t[i+S]=255&p,S+=M,p/=256,s-=8);for(u=u<0;t[i+S]=255&u,S+=M,u/=256,_-=8);t[i+S-M]|=128*C};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */function Pt(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Pt.Varint=0,Pt.Fixed64=1,Pt.Bytes=2,Pt.Fixed32=5;var Pu=4294967296,Mp=1/Pu,Ap=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function Dn(t){return t.type===Pt.Bytes?t.readVarint()+t.pos:t.pos+1}function ua(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Ip(t,e,i){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(n);for(var s=i.pos-1;s>=t;s--)i.buf[s+n]=i.buf[s]}function __(t,e){for(var i=0;i>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function Cp(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}Pt.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos>3,c=this.pos;this.type=7&n,t(s,e,this),this.pos===c&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=hh(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Cp(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=hh(this.buf,this.pos)+hh(this.buf,this.pos+4)*Pu;return this.pos+=8,t},readSFixed64:function(){var t=hh(this.buf,this.pos)+Cp(this.buf,this.pos+4)*Pu;return this.pos+=8,t},readFloat:function(){var t=Ep(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Ep(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,n=this.buf;return e=127&(i=n[this.pos++]),i<128?e:(e|=(127&(i=n[this.pos++]))<<7,i<128?e:(e|=(127&(i=n[this.pos++]))<<14,i<128?e:(e|=(127&(i=n[this.pos++]))<<21,i<128?e:function(s,c,u){var p,m,_=u.buf;if(p=(112&(m=_[u.pos++]))>>4,m<128||(p|=(127&(m=_[u.pos++]))<<3,m<128)||(p|=(127&(m=_[u.pos++]))<<10,m<128)||(p|=(127&(m=_[u.pos++]))<<17,m<128)||(p|=(127&(m=_[u.pos++]))<<24,m<128)||(p|=(1&(m=_[u.pos++]))<<31,m<128))return ua(s,p,c);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&Ap?function(i,n,s){return Ap.decode(i.subarray(n,s))}(this.buf,e,t):function(i,n,s){for(var c="",u=n;u239?4:x>223?3:x>191?2:1;if(u+w>s)break;w===1?x<128&&(b=x):w===2?(192&(p=i[u+1]))==128&&(b=(31&x)<<6|63&p)<=127&&(b=null):w===3?(m=i[u+2],(192&(p=i[u+1]))==128&&(192&m)==128&&((b=(15&x)<<12|(63&p)<<6|63&m)<=2047||b>=55296&&b<=57343)&&(b=null)):w===4&&(m=i[u+2],_=i[u+3],(192&(p=i[u+1]))==128&&(192&m)==128&&(192&_)==128&&((b=(15&x)<<18|(63&p)<<12|(63&m)<<6|63&_)<=65535||b>=1114112)&&(b=null)),b===null?(b=65533,w=1):b>65535&&(b-=65536,c+=String.fromCharCode(b>>>10&1023|55296),b=56320|1023&b),c+=String.fromCharCode(b),u+=w}return c}(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!==Pt.Bytes)return t.push(this.readVarint(e));var i=Dn(this);for(t=t||[];this.pos127;);else if(e===Pt.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Pt.Fixed32)this.pos+=4;else{if(e!==Pt.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;e268435455||t<0?function(e,i){var n,s;if(e>=0?(n=e%4294967296|0,s=e/4294967296|0):(s=~(-e/4294967296),4294967295^(n=~(-e%4294967296))?n=n+1|0:(n=0,s=s+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");i.realloc(10),function(c,u,p){p.buf[p.pos++]=127&c|128,c>>>=7,p.buf[p.pos++]=127&c|128,c>>>=7,p.buf[p.pos++]=127&c|128,c>>>=7,p.buf[p.pos++]=127&c|128,p.buf[p.pos]=127&(c>>>=7)}(n,0,i),function(c,u){var p=(7&c)<<4;u.buf[u.pos++]|=p|((c>>>=3)?128:0),c&&(u.buf[u.pos++]=127&c|((c>>>=7)?128:0),c&&(u.buf[u.pos++]=127&c|((c>>>=7)?128:0),c&&(u.buf[u.pos++]=127&c|((c>>>=7)?128:0),c&&(u.buf[u.pos++]=127&c|((c>>>=7)?128:0),c&&(u.buf[u.pos++]=127&c)))))}(s,i)}(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(!!t)},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(n,s,c){for(var u,p,m=0;m55295&&u<57344){if(!p){u>56319||m+1===s.length?(n[c++]=239,n[c++]=191,n[c++]=189):p=u;continue}if(u<56320){n[c++]=239,n[c++]=191,n[c++]=189,p=u;continue}u=p-55296<<10|u-56320|65536,p=null}else p&&(n[c++]=239,n[c++]=191,n[c++]=189,p=null);u<128?n[c++]=u:(u<2048?n[c++]=u>>6|192:(u<65536?n[c++]=u>>12|224:(n[c++]=u>>18|240,n[c++]=u>>12&63|128),n[c++]=u>>6&63|128),n[c++]=63&u|128)}return c}(this.buf,t,this.pos);var i=this.pos-e;i>=128&&Ip(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),Sp(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Sp(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=128&&Ip(i,n,this),this.pos=i-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,i){this.writeTag(t,Pt.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,__,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,g_,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,v_,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,y_,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,x_,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,b_,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,w_,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,T_,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,E_,e)},writeBytesField:function(t,e){this.writeTag(t,Pt.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Pt.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Pt.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Pt.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Pt.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Pt.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Pt.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Pt.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Pt.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Pt.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,!!e)}};var uh=Yi(Tp);const ku=3;function S_(t,e,i){e.glyphs=[],t===1&&i.readMessage(M_,e)}function M_(t,e,i){if(t===3){const{id:n,bitmap:s,width:c,height:u,left:p,top:m,advance:_}=i.readMessage(A_,{});e.glyphs.push({id:n,bitmap:new kn({width:c+2*ku,height:u+2*ku},s),metrics:{width:c,height:u,left:p,top:m,advance:_}})}else t===4?e.ascender=i.readSVarint():t===5&&(e.descender=i.readSVarint())}function A_(t,e,i){t===1?e.id=i.readVarint():t===2?e.bitmap=i.readBytes():t===3?e.width=i.readVarint():t===4?e.height=i.readVarint():t===5?e.left=i.readSVarint():t===6?e.top=i.readSVarint():t===7&&(e.advance=i.readVarint())}const zp=ku;function Du(t){let e=0,i=0;for(const u of t)e+=u.w*u.h,i=Math.max(i,u.w);t.sort((u,p)=>p.h-u.h);const n=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),i),h:1/0}];let s=0,c=0;for(const u of t)for(let p=n.length-1;p>=0;p--){const m=n[p];if(!(u.w>m.w||u.h>m.h)){if(u.x=m.x,u.y=m.y,c=Math.max(c,u.y+u.h),s=Math.max(s,u.x+u.w),u.w===m.w&&u.h===m.h){const _=n.pop();pe.hasImage(n)),e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const n in e.updatedImages)this.patchUpdatedImage(this.iconPositions[n],e.getImage(n),i),this.patchUpdatedImage(this.patternPositions[n],e.getImage(n),i)}patchUpdatedImage(e,i,n){if(!e||!i||e.version===i.version)return;e.version=i.version;const[s,c]=e.tl;n.update(i.data,void 0,{x:s,y:c})}}Ue(Lu,"ImagePosition"),Ue(Pp,"ImageAtlas");const or={horizontal:1,vertical:2,horizontalOnly:3},kp=-17;class jl{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(e,i){const n=new jl;return n.scale=e||1,n.fontStack=i,n}static forImage(e){const i=new jl;return i.imageName=e,i}}class pa{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,i){const n=new pa;for(let s=0;s=0&&n>=e&&dh[this.text.charCodeAt(n)];n--)i--;this.text=this.text.substring(e,i),this.sectionIndex=this.sectionIndex.slice(e,i)}substring(e,i){const n=new pa;return n.text=this.text.substring(e,i),n.sectionIndex=this.sectionIndex.slice(e,i),n.sections=this.sections,n}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,i)=>Math.max(e,this.sections[i].scale),0)}addTextSection(e,i){this.text+=e.text,this.sections.push(jl.forText(e.scale,e.fontStack||i));const n=this.sections.length-1;for(let s=0;s=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Ru(t,e,i,n,s,c,u,p,m,_,x,b,w,S,M){const C=pa.fromFeature(t,s);b===or.vertical&&C.verticalizePunctuation(w);let D=[];const U=function(W,ce,se,me,Ee,ue){if(!W)return[];const ye=[],xe=function(De,Ne,Re,He,ze,$e){let Ke=0;for(let gt=0;gt=0;let Ce=0;for(let De=0;De0&&Gr>Ct&&(Ct=Gr)}else{const Di=se[ni.fontStack];if(!Di)continue;Di[jt]&&(Lt=Di[jt]);const pi=ce[ni.fontStack];if(!pi)continue;const Gr=pi.glyphs[jt];if(!Gr)continue;if(ti=Gr.metrics,ii=jt!==8203?mi:0,$e){const va=pi.ascender!==void 0?Math.abs(pi.ascender):0,Jl=pi.descender!==void 0?Math.abs(pi.descender):0,Ql=(va+Jl)*xt;Nt-i/2;){if(u--,u<0)return!1;p-=t[u].dist(c),c=t[u]}p+=t[u].dist(t[u+1]),u++;const m=[];let _=0;for(;pn;)_-=m.shift().angleDelta;if(_>s)return!1;u++,p+=x.dist(b)}return!0}function Vp(t){let e=0;for(let i=0;i_){const M=(_-m)/S,C=mt(b.x,w.x,M),D=mt(b.y,w.y,M),U=new Ln(C,D,0,w.angleTo(b),x);return!u||Up(t,U,p,u,e)?U:void 0}m+=S}}function k_(t,e,i,n,s,c,u,p,m){const _=Np(n,c,u),x=jp(n,s),b=x*u,w=t[0].x===0||t[0].x===m||t[0].y===0||t[0].y===m;return e-b=0&&$=0&&X=0&&w+_<=x){const W=new Ln($,X,0,q,M);W._round(),n&&!Up(t,W,c,n,s)||S.push(W)}}b+=U}return p||S.length||u||(S=Gp(t,b/2,i,n,s,c,u,!0,m)),S}function $p(t,e,i,n,s){const c=[];for(let u=0;u=n&&b.x>=n||(x.x>=n?x=new Le(n,x.y+(n-x.x)/(b.x-x.x)*(b.y-x.y))._round():b.x>=n&&(b=new Le(n,x.y+(n-x.x)/(b.x-x.x)*(b.y-x.y))._round()),x.y>=s&&b.y>=s||(x.y>=s?x=new Le(x.x+(s-x.y)/(b.y-x.y)*(b.x-x.x),s)._round():b.y>=s&&(b=new Le(x.x+(s-x.y)/(b.y-x.y)*(b.x-x.x),s)._round()),m&&x.equals(m[m.length-1])||(m=[x],c.push(m)),m.push(b)))))}}return c}Ue(Ln,"Anchor");const Gl=1e20;function Zp(t,e,i,n,s,c,u,p,m){for(let _=e;_-1);m++,c[m]=p,u[m]=_,u[m+1]=Gl}for(let p=0,m=0;p{let p=this.entries[s];p||(p=this.entries[s]={glyphs:{},requests:{},ranges:{},ascender:void 0,descender:void 0});let m=p.glyphs[c];if(m!==void 0)return void u(null,{stack:s,id:c,glyph:m});if(m=this._tinySDF(p,s,c),m)return p.glyphs[c]=m,void u(null,{stack:s,id:c,glyph:m});const _=Math.floor(c/256);if(256*_>65535)return void u(new Error("glyphs > 65535 not supported"));if(p.ranges[_])return void u(null,{stack:s,id:c,glyph:m});let x=p.requests[_];x||(x=p.requests[_]=[],fa.loadGlyphRange(s,_,this.url,this.requestManager,(b,w)=>{if(w){p.ascender=w.ascender,p.descender=w.descender;for(const S in w.glyphs)this._doesCharSupportLocalGlyph(+S)||(p.glyphs[+S]=w.glyphs[+S]);p.ranges[_]=!0}for(const S of x)S(b,w);delete p.requests[_]})),x.push((b,w)=>{b?u(b):w&&u(null,{stack:s,id:c,glyph:w.glyphs[c]||null})})},(s,c)=>{if(s)i(s);else if(c){const u={};for(const{stack:p,id:m,glyph:_}of c)u[p]===void 0&&(u[p]={}),u[p].glyphs===void 0&&(u[p].glyphs={}),u[p].glyphs[m]=_&&{id:_.id,bitmap:_.bitmap.clone(),metrics:_.metrics},u[p].ascender=this.entries[p].ascender,u[p].descender=this.entries[p].descender;i(null,u)}})}_doesCharSupportLocalGlyph(e){return this.localGlyphMode!==Ou.none&&(this.localGlyphMode===Ou.all?!!this.localFontFamily:!!this.localFontFamily&&(Be["CJK Unified Ideographs"](e)||Be["Hangul Syllables"](e)||Be.Hiragana(e)||Be.Katakana(e)||Be["CJK Symbols and Punctuation"](e)))}_tinySDF(e,i,n){const s=this.localFontFamily;if(!s||!this._doesCharSupportLocalGlyph(n))return;let c=e.tinySDF;if(!c){let C="400";/bold/i.test(i)?C="900":/medium/i.test(i)?C="500":/light/i.test(i)&&(C="200"),c=e.tinySDF=new fa.TinySDF({fontFamily:s,fontWeight:C,fontSize:24*Nr,buffer:3*Nr,radius:8*Nr}),c.fontWeight=C}if(this.localGlyphs[c.fontWeight][n])return this.localGlyphs[c.fontWeight][n];const u=String.fromCharCode(n),{data:p,width:m,height:_,glyphWidth:x,glyphHeight:b,glyphLeft:w,glyphTop:S,glyphAdvance:M}=c.draw(u);return this.localGlyphs[c.fontWeight][n]={id:n,bitmap:new kn({width:m,height:_},p),metrics:{width:x/Nr,height:b/Nr,left:w/Nr,top:S/Nr-27,advance:M/Nr,localGlyph:!0}}}}fa.loadGlyphRange=function(t,e,i,n,s){const c=256*e,u=c+255,p=n.transformRequest(n.normalizeGlyphsURL(i).replace("{fontstack}",t).replace("{range}",`${c}-${u}`),fn.Glyphs);$n(p,(m,_)=>{if(m)s(m);else if(_){const x={},b=function(w){return new uh(w).readFields(S_,{})}(_);for(const w of b.glyphs)x[w.id]=w;s(null,{glyphs:x,ascender:b.ascender,descender:b.descender})}})},fa.TinySDF=class{constructor({fontSize:t=24,buffer:e=3,radius:i=8,cutoff:n=.25,fontFamily:s="sans-serif",fontWeight:c="normal",fontStyle:u="normal"}={}){this.buffer=e,this.cutoff=n,this.radius=i;const p=this.size=t+4*e,m=this._createCanvas(p),_=this.ctx=m.getContext("2d",{willReadFrequently:!0});_.font=`${u} ${c} ${t}px ${s}`,_.textBaseline="alphabetic",_.textAlign="left",_.fillStyle="black",this.gridOuter=new Float64Array(p*p),this.gridInner=new Float64Array(p*p),this.f=new Float64Array(p),this.z=new Float64Array(p+1),this.v=new Uint16Array(p)}_createCanvas(t){const e=document.createElement("canvas");return e.width=e.height=t,e}draw(t){const{width:e,actualBoundingBoxAscent:i,actualBoundingBoxDescent:n,actualBoundingBoxLeft:s,actualBoundingBoxRight:c}=this.ctx.measureText(t),u=Math.ceil(i),p=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(c-s))),m=Math.min(this.size-this.buffer,u+Math.ceil(n)),_=p+2*this.buffer,x=m+2*this.buffer,b=Math.max(_*x,0),w=new Uint8ClampedArray(b),S={data:w,width:_,height:x,glyphWidth:p,glyphHeight:m,glyphTop:u,glyphLeft:0,glyphAdvance:e};if(p===0||m===0)return S;const{ctx:M,buffer:C,gridInner:D,gridOuter:U}=this;M.clearRect(C,C,p,m),M.fillText(t,C,C+u);const q=M.getImageData(C,C,p,m);U.fill(Gl,0,b),D.fill(0,0,b);for(let V=0;V0?ce*ce:0,D[W]=ce<0?ce*ce:0}}Zp(U,0,0,_,x,_,this.f,this.v,this.z),Zp(D,C,C,p,m,_,this.f,this.v,this.z);for(let V=0;Vue+ye[1]-ye[0],M=b.reduce(S,0),C=w.reduce(S,0),D=p-M,U=m-C;let q=0,V=M,$=0,X=C,W=0,ce=D,se=0,me=U;if(c.content&&n){const ue=c.content;q=ph(b,0,ue[0]),$=ph(w,0,ue[1]),V=ph(b,ue[0],ue[2]),X=ph(w,ue[1],ue[3]),W=ue[0]-q,se=ue[1]-$,ce=ue[2]-ue[0]-V,me=ue[3]-ue[1]-X}const Ee=(ue,ye,xe,be)=>{const Ce=fh(ue.stretch-q,V,_,t.left),pe=mh(ue.fixed-W,ce,ue.stretch,M),De=fh(ye.stretch-$,X,x,t.top),Ne=mh(ye.fixed-se,me,ye.stretch,C),Re=fh(xe.stretch-q,V,_,t.left),He=mh(xe.fixed-W,ce,xe.stretch,M),ze=fh(be.stretch-$,X,x,t.top),$e=mh(be.fixed-se,me,be.stretch,C),Ke=new Le(Ce,De),gt=new Le(Re,De),Ye=new Le(Re,ze),We=new Le(Ce,ze),Rt=new Le(pe/u,Ne/u),et=new Le(He/u,$e/u),tt=e*Math.PI/180;if(tt){const Dt=Math.sin(tt),Ct=Math.cos(tt),Nt=[Ct,-Dt,Dt,Ct];Ke._matMult(Nt),gt._matMult(Nt),We._matMult(Nt),Ye._matMult(Nt)}const It=ue.stretch+ue.fixed,kt=ye.stretch+ye.fixed;return{tl:Ke,tr:gt,bl:We,br:Ye,tex:{x:c.paddedRect.x+ma+It,y:c.paddedRect.y+ma+kt,w:xe.stretch+xe.fixed-It,h:be.stretch+be.fixed-kt},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Rt,pixelOffsetBR:et,minFontScaleX:ce/u/_,minFontScaleY:me/u/x,isSDF:i}};if(n&&(c.stretchX||c.stretchY)){const ue=Xp(b,D,M),ye=Xp(w,U,C);for(let xe=0;xe0)for(let n=(this.length>>1)-1;n>=0;n--)this._down(n)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const e=this.data[0],i=this.data.pop();return this.length--,this.length>0&&(this.data[0]=i,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:i,compare:n}=this,s=i[e];for(;e>0;){const c=e-1>>1,u=i[c];if(n(s,u)>=0)break;i[e]=u,e=c}i[e]=s}_down(e){const{data:i,compare:n}=this,s=this.length>>1,c=i[e];for(;e=0)break;i[e]=p,e=u}i[e]=c}}function R_(t,e){return te?1:0}function B_(t,e=1,i=!1){let n=1/0,s=1/0,c=-1/0,u=-1/0;const p=t[0];for(let S=0;Sc)&&(c=M.x),(!S||M.y>u)&&(u=M.y)}const m=Math.min(c-n,u-s);let _=m/2;const x=new L_([],O_);if(m===0)return new Le(n,s);for(let S=n;Sb.d||!b.d)&&(b=S,i&&console.log("found best %d after %d probes",Math.round(1e4*S.d)/1e4,w)),S.max-b.d<=e||(_=S.h/2,x.push(new _a(S.p.x-_,S.p.y-_,_,t)),x.push(new _a(S.p.x+_,S.p.y-_,_,t)),x.push(new _a(S.p.x-_,S.p.y+_,_,t)),x.push(new _a(S.p.x+_,S.p.y+_,_,t)),w+=4)}return i&&(console.log(`num probes: ${w}`),console.log(`best distance: ${b.d}`)),b.p}function O_(t,e){return e.max-t.max}class _a{constructor(e,i,n,s){this.p=new Le(e,i),this.h=n,this.d=function(c,u){let p=!1,m=1/0;for(let _=0;_c.y!=C.y>c.y&&c.x<(C.x-M.x)*(c.y-M.y)/(C.y-M.y)+M.x&&(p=!p),m=Math.min(m,Gd(c,M,C))}}return(p?1:-1)*Math.sqrt(m)}(this.p,s),this.max=this.d+this.h*Math.SQRT2}}const ga=7,Fu=Number.POSITIVE_INFINITY,F_=Math.sqrt(2);function Hp(t,[e,i]){let n=0,s=0;if(i===Fu){e<0&&(e=0);const c=e/F_;switch(t){case"top-right":case"top-left":s=c-ga;break;case"bottom-right":case"bottom-left":s=-c+ga;break;case"bottom":s=-e+ga;break;case"top":s=e-ga}switch(t){case"top-right":case"bottom-right":n=-c;break;case"top-left":case"bottom-left":n=c;break;case"left":n=e;break;case"right":n=-e}}else{switch(e=Math.abs(e),i=Math.abs(i),t){case"top-right":case"top-left":case"top":s=i-ga;break;case"bottom-right":case"bottom-left":case"bottom":s=-i+ga}switch(t){case"top-right":case"bottom-right":case"right":n=-e;break;case"top-left":case"bottom-left":case"left":n=e}}return[n,s]}function U_(t,e,i,n,s,c,u,p,m,_){t.createArrays(),t.tilePixelRatio=Ze/(512*t.overscaling),t.compareText={},t.iconsNeedLinear=!1;const x=t.layers[0].layout,b=t.layers[0]._unevaluatedLayout._values,w={};if(t.textSizeData.kind==="composite"){const{minZoom:C,maxZoom:D}=t.textSizeData;w.compositeTextSizes=[b["text-size"].possiblyEvaluate(new v(C),p),b["text-size"].possiblyEvaluate(new v(D),p)]}if(t.iconSizeData.kind==="composite"){const{minZoom:C,maxZoom:D}=t.iconSizeData;w.compositeIconSizes=[b["icon-size"].possiblyEvaluate(new v(C),p),b["icon-size"].possiblyEvaluate(new v(D),p)]}w.layoutTextSize=b["text-size"].possiblyEvaluate(new v(m+1),p),w.layoutIconSize=b["icon-size"].possiblyEvaluate(new v(m+1),p),w.textMaxSize=b["text-size"].possiblyEvaluate(new v(18),p);const S=x.get("text-rotation-alignment")==="map"&&x.get("symbol-placement")!=="point",M=x.get("text-size");for(const C of t.features){const D=x.get("text-font").evaluate(C,{},p).join(","),U=M.evaluate(C,{},p),q=w.layoutTextSize.evaluate(C,{},p),V=(w.layoutIconSize.evaluate(C,{},p),{horizontal:{},vertical:void 0}),$=C.text;let X,W=[0,0];if($){const me=$.toString(),Ee=x.get("text-letter-spacing").evaluate(C,{},p)*mi,ue=x.get("text-line-height").evaluate(C,{},p)*mi,ye=Wh(me)?Ee:0,xe=x.get("text-anchor").evaluate(C,{},p),be=x.get("text-variable-anchor");if(!be){const Re=x.get("text-radial-offset").evaluate(C,{},p);W=Re?Hp(xe,[Re*mi,Fu]):x.get("text-offset").evaluate(C,{},p).map(He=>He*mi)}let Ce=S?"center":x.get("text-justify").evaluate(C,{},p);const pe=x.get("symbol-placement")==="point",De=pe?x.get("text-max-width").evaluate(C,{},p)*mi:1/0,Ne=Re=>{t.allowVerticalPlacement&&fl(me)&&(V.vertical=Ru($,e,i,s,D,De,ue,xe,Re,ye,W,or.vertical,!0,q,U))};if(!S&&be){const Re=Ce==="auto"?be.map(ze=>Uu(ze)):[Ce];let He=!1;for(let ze=0;ze=0||!fl(me)){const Re=Ru($,e,i,s,D,De,ue,xe,Ce,ye,W,or.horizontal,!1,q,U);Re&&(V.horizontal[Ce]=Re)}Ne(pe?"left":Ce)}}let ce=!1;if(C.icon&&C.icon.name){const me=n[C.icon.name];me&&(X=z_(s[C.icon.name],x.get("icon-offset").evaluate(C,{},p),x.get("icon-anchor").evaluate(C,{},p)),ce=me.sdf,t.sdfIcons===void 0?t.sdfIcons=me.sdf:t.sdfIcons!==me.sdf&&Ut("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(me.pixelRatio!==t.pixelRatio||x.get("icon-rotate").constantOr(1)!==0)&&(t.iconsNeedLinear=!0))}const se=Yp(V.horizontal)||V.vertical;t.iconsInText||(t.iconsInText=!!se&&se.iconsInText),(se||X)&&V_(t,C,V,X,n,w,q,0,W,ce,u,p,_)}c&&t.generateCollisionDebugBuffers(m,t.collisionBoxArray)}function Uu(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 V_(t,e,i,n,s,c,u,p,m,_,x,b,w){let S=c.textMaxSize.evaluate(e,{},b);S===void 0&&(S=u);const M=t.layers[0].layout,C=M.get("icon-offset").evaluate(e,{},b),D=Yp(i.horizontal)||i.vertical,U=w.name==="globe",q=mi,V=u/q,$=t.tilePixelRatio*S/q,X=(xe=t.overscaling,t.zoom>18&&xe>2&&(xe>>=1),Math.max(Ze/(512*xe),1)*M.get("symbol-spacing")),W=M.get("text-padding")*t.tilePixelRatio,ce=M.get("icon-padding")*t.tilePixelRatio,se=dt(M.get("text-max-angle")),me=M.get("text-rotation-alignment")==="map"&&M.get("symbol-placement")!=="point",Ee=M.get("icon-rotation-alignment")==="map"&&M.get("symbol-placement")!=="point",ue=M.get("symbol-placement"),ye=X/2;var xe;const be=M.get("icon-text-fit");let Ce;n&&be!=="none"&&(t.allowVerticalPlacement&&i.vertical&&(Ce=Fp(n,i.vertical,be,M.get("icon-text-fit-padding"),C,V)),D&&(n=Fp(n,D,be,M.get("icon-text-fit-padding"),C,V)));const pe=(De,Ne,Re)=>{if(Ne.x<0||Ne.x>=Ze||Ne.y<0||Ne.y>=Ze)return;let He=null;if(U){const{x:ze,y:$e,z:Ke}=w.projectTilePoint(Ne.x,Ne.y,Re);He={anchor:new Ln(ze,$e,Ke,0,void 0),up:w.upVector(Re,Ne.x,Ne.y)}}(function(ze,$e,Ke,gt,Ye,We,Rt,et,tt,It,kt,Dt,Ct,Nt,$t,Qt,zt,ni,ei,jt,xt,ti,Lt,ki,ii){const _i=ze.addToLineVertexArray($e,gt);let di,Di,pi,Gr,va,Jl,Ql,Pf=0,kf=0,Df=0,Lf=0,ed=-1,td=-1;const an={};let Rf=Kh("");const ms=Ke?Ke.anchor:$e;let id=0,rd=0;if(tt._unevaluatedLayout.getValue("text-radial-offset")===void 0?[id,rd]=tt.layout.get("text-offset").evaluate(xt,{},ii).map(Xi=>Xi*mi):(id=tt.layout.get("text-radial-offset").evaluate(xt,{},ii)*mi,rd=Fu),ze.allowVerticalPlacement&&Ye.vertical){const Xi=Ye.vertical;if($t)Jl=Vu(Xi),et&&(Ql=Vu(et));else{const Hi=tt.layout.get("text-rotate").evaluate(xt,{},ii)+90;pi=_h(It,ms,$e,kt,Dt,Ct,Xi,Nt,Hi,Qt),et&&(Gr=_h(It,ms,$e,kt,Dt,Ct,et,ni,Hi))}}if(We){const Xi=tt.layout.get("icon-rotate").evaluate(xt,{},ii),Hi=tt.layout.get("icon-text-fit")!=="none",ec=Wp(We,Xi,Lt,Hi),od=et?Wp(et,Xi,Lt,Hi):void 0;Di=_h(It,ms,$e,kt,Dt,Ct,We,ni,Xi),Pf=4*ec.length;const Bf=ze.iconSizeData;let _s=null;Bf.kind==="source"?(_s=[Vr*tt.layout.get("icon-size").evaluate(xt,{},ii)],_s[0]>mo&&Ut(`${ze.layerIds[0]}: Value for "icon-size" is >= ${$l}. Reduce your "icon-size".`)):Bf.kind==="composite"&&(_s=[Vr*ti.compositeIconSizes[0].evaluate(xt,{},ii),Vr*ti.compositeIconSizes[1].evaluate(xt,{},ii)],(_s[0]>mo||_s[1]>mo)&&Ut(`${ze.layerIds[0]}: Value for "icon-size" is >= ${$l}. Reduce your "icon-size".`)),ze.addSymbols(ze.icon,ec,_s,jt,ei,xt,!1,Ke,$e,_i.lineStartIndex,_i.lineLength,-1,ki,ii),ed=ze.icon.placedSymbolArray.length-1,od&&(kf=4*od.length,ze.addSymbols(ze.icon,od,_s,jt,ei,xt,or.vertical,Ke,$e,_i.lineStartIndex,_i.lineLength,-1,ki,ii),td=ze.icon.placedSymbolArray.length-1)}for(const Xi in Ye.horizontal){const Hi=Ye.horizontal[Xi];di||(Rf=Kh(Hi.text),$t?va=Vu(Hi):di=_h(It,ms,$e,kt,Dt,Ct,Hi,Nt,tt.layout.get("text-rotate").evaluate(xt,{},ii),Qt));const ec=Hi.positionedLines.length===1;if(Df+=Kp(ze,Ke,$e,Hi,Rt,tt,$t,xt,Qt,_i,Ye.vertical?or.horizontal:or.horizontalOnly,ec?Object.keys(Ye.horizontal):[Xi],an,ed,ti,ki,ii),ec)break}Ye.vertical&&(Lf+=Kp(ze,Ke,$e,Ye.vertical,Rt,tt,$t,xt,Qt,_i,or.vertical,["vertical"],an,td,ti,ki,ii));let bo=-1;const nd=(Xi,Hi)=>Xi?Math.max(Xi,Hi):Hi;bo=nd(va,bo),bo=nd(Jl,bo),bo=nd(Ql,bo);const fg=bo>-1?1:0;ze.glyphOffsetArray.length>=go.MAX_GLYPHS&&Ut("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),xt.sortKey!==void 0&&ze.addToSortKeyRanges(ze.symbolInstances.length,xt.sortKey),ze.symbolInstances.emplaceBack(ms.x,ms.y,ms.z,$e.x,$e.y,an.right>=0?an.right:-1,an.center>=0?an.center:-1,an.left>=0?an.left:-1,an.vertical>=0?an.vertical:-1,ed,td,Rf,di!==void 0?di:ze.collisionBoxArray.length,di!==void 0?di+1:ze.collisionBoxArray.length,pi!==void 0?pi:ze.collisionBoxArray.length,pi!==void 0?pi+1:ze.collisionBoxArray.length,Di!==void 0?Di:ze.collisionBoxArray.length,Di!==void 0?Di+1:ze.collisionBoxArray.length,Gr||ze.collisionBoxArray.length,Gr?Gr+1:ze.collisionBoxArray.length,kt,Df,Lf,Pf,kf,fg,0,id,rd,bo)})(t,Ne,He,De,i,n,s,Ce,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,W,me,m,0,ce,Ee,C,e,c,_,x,b)};if(ue==="line")for(const De of $p(e.geometry,0,0,Ze,Ze)){const Ne=k_(De,X,se,i.vertical||D,n,q,$,t.overscaling,Ze);for(const Re of Ne)D&&N_(t,D.text,ye,Re)||pe(De,Re,b)}else if(ue==="line-center"){for(const De of e.geometry)if(De.length>1){const Ne=P_(De,se,i.vertical||D,n,q,$);Ne&&pe(De,Ne,b)}}else if(e.type==="Polygon")for(const De of Mu(e.geometry,0)){const Ne=B_(De,16);pe(De[0],new Ln(Ne.x,Ne.y,0,0,void 0),b)}else if(e.type==="LineString")for(const De of e.geometry)pe(De,new Ln(De[0].x,De[0].y,0,0,void 0),b);else if(e.type==="Point")for(const De of e.geometry)for(const Ne of De)pe([Ne],new Ln(Ne.x,Ne.y,0,0,void 0),b)}const $l=255,mo=$l*Vr;function Kp(t,e,i,n,s,c,u,p,m,_,x,b,w,S,M,C,D){const U=function($,X,W,ce,se,me,Ee,ue){const ye=[];if(X.positionedLines.length===0)return ye;const xe=ce.layout.get("text-rotate").evaluate(me,{})*Math.PI/180,be=function(Re){const He=Re[0],ze=Re[1],$e=He*ze;return $e>0?[He,-ze]:$e<0?[-He,ze]:He===0?[ze,He]:[ze,-He]}(W);let Ce=Math.abs(X.top-X.bottom);for(const Re of X.positionedLines)Ce-=Re.lineOffset;const pe=X.positionedLines.length,De=Ce/pe;let Ne=X.top-W[1];for(let Re=0;Remo&&Ut(`${t.layerIds[0]}: Value for "text-size" is >= ${$l}. Reduce your "text-size".`)):q.kind==="composite"&&(V=[Vr*M.compositeTextSizes[0].evaluate(p,{},D),Vr*M.compositeTextSizes[1].evaluate(p,{},D)],(V[0]>mo||V[1]>mo)&&Ut(`${t.layerIds[0]}: Value for "text-size" is >= ${$l}. Reduce your "text-size".`)),t.addSymbols(t.text,U,V,m,u,p,x,e,i,_.lineStartIndex,_.lineLength,S,C,D);for(const $ of b)w[$]=t.text.placedSymbolArray.length-1;return 4*U.length}function Yp(t){for(const e in t)return t[e];return null}function _h(t,e,i,n,s,c,u,p,m,_){let x=u.top,b=u.bottom,w=u.left,S=u.right;const M=u.collisionPadding;if(M&&(w-=M[0],x-=M[1],S+=M[2],b+=M[3]),m){const C=new Le(w,x),D=new Le(S,x),U=new Le(w,b),q=new Le(S,b),V=dt(m);let $=new Le(0,0);_&&($=new Le(_[0],_[1])),C._rotateAround(V,$),D._rotateAround(V,$),U._rotateAround(V,$),q._rotateAround(V,$),w=Math.min(C.x,D.x,U.x,q.x),S=Math.max(C.x,D.x,U.x,q.x),x=Math.min(C.y,D.y,U.y,q.y),b=Math.max(C.y,D.y,U.y,q.y)}return t.emplaceBack(e.x,e.y,e.z,i.x,i.y,w,x,S,b,p,n,s,c),t.length-1}function Vu(t){t.collisionPadding&&(t.top-=t.collisionPadding[1],t.bottom+=t.collisionPadding[3]);const e=t.bottom-t.top;return e>0?Math.max(10,e):null}function N_(t,e,i,n){const s=t.compareText;if(e in s){const c=s[e];for(let u=c.length-1;u>=0;u--)if(n.dist(c[u])V&&($(W,be,se,me,ye,xe),$(be,ce,ye,xe,Ee,ue))}$(b,w,n,c,s,c),$(w,S,s,c,s,u),$(S,M,s,u,n,u),$(M,b,n,u,n,c),C-=V,D-=V,U+=V,q+=V;const X=1/Math.max(U-C,q-D);return{scale:X,x:C*X,y:D*X,x2:U*X,y2:q*X,projection:e}}const j_=Or(new Float32Array(16));class _o{constructor(e){this.spec=e,this.name=e.name,this.wrap=!1,this.requiresDraping=!1,this.supportsWorldCopies=!1,this.supportsTerrain=!1,this.supportsFog=!1,this.supportsFreeCamera=!1,this.zAxisUnit="meters",this.isReprojectedInTileSpace=!0,this.unsupportedLayers=["custom"],this.center=[0,0],this.range=[3.5,7]}project(e,i){return{x:0,y:0,z:0}}unproject(e,i){return new At(0,0)}projectTilePoint(e,i,n){return{x:e,y:i,z:0}}locationPoint(e,i,n=!0){return e._coordinatePoint(e.locationCoordinate(i),n)}pixelsPerMeter(e,i){return Ur(1,e)*i}pixelSpaceConversion(e,i,n){return 1}farthestPixelDistance(e){return Jp(e,e.pixelsPerMeter)}pointCoordinate(e,i,n,s){const c=e.horizonLineFromTop(!1),u=new Le(i,Math.max(c,n));return e.rayIntersectionCoordinate(e.pointRayIntersection(u,s))}pointCoordinate3D(e,i,n){const s=new Le(i,n);if(e.elevation)return e.elevation.pointCoordinate(s);{const c=this.pointCoordinate(e,s.x,s.y,0);return[c.x,c.y,c.z]}}isPointAboveHorizon(e,i){if(e.elevation)return!this.pointCoordinate3D(e,i.x,i.y);const n=e.horizonLineFromTop();return i.y0?i<-ya+n&&(i=-ya+n):i>ya-n&&(i=ya-n);const u=c/Math.pow(yh(i),s);let p=u*Math.sin(s*e),m=c-u*Math.cos(s*e);return p=.5*(p/Math.PI+.5),m=.5*(m/Math.PI+.5),{x:p,y:this.southernCenter?m:1-m,z:0}}unproject(e,i){e=(2*e-.5)*Math.PI,this.southernCenter&&(i=1-i),i=(2*(1-i)-.5)*Math.PI;const{n,f:s}=this,c=s-i,u=Math.sign(c),p=Math.sign(n)*Math.sqrt(e*e+c*c);let m=Math.atan2(e,Math.abs(c))*u;c*n<0&&(m-=Math.PI*Math.sign(e)*u);const _=ct(si(m/n)+this.center[0],-180,180),x=ct(si(2*Math.atan(Math.pow(s/p,1/n))-ya),-wi,wi);return new At(_,this.southernCenter?-x:x)}}class Qp extends _o{constructor(e){super(e),this.wrap=!0,this.supportsWorldCopies=!0,this.supportsTerrain=!0,this.supportsFog=!0,this.supportsFreeCamera=!0,this.isReprojectedInTileSpace=!1,this.unsupportedLayers=[],this.range=null}project(e,i){return{x:tn(e),y:rn(i),z:0}}unproject(e,i){const n=nr(e),s=bi(i);return new At(n,s)}}const ef=dt(wi);class W_ extends _o{project(e,i){const n=(i=dt(i))*i,s=n*n;return{x:.5*((e=dt(e))*(.8707-.131979*n+s*(s*(.003971*n-.001529*s)-.013791))/Math.PI+.5),y:1-.5*(i*(1.007226+n*(.015085+s*(.028874*n-.044475-.005916*s)))/Math.PI+1),z:0}}unproject(e,i){e=(2*e-.5)*Math.PI;let n=i=(2*(1-i)-1)*Math.PI,s=25,c=0,u=n*n;do{u=n*n;const _=u*u;c=(n*(1.007226+u*(.015085+_*(.028874*u-.044475-.005916*_)))-i)/(1.007226+u*(.045255+_*(.259866*u-.311325-.005916*11*_))),n=ct(n-c,-ef,ef)}while(Math.abs(c)>1e-6&&--s>0);u=n*n;const p=ct(si(e/(.8707+u*(u*(u*u*u*(.003971-.001529*u)-.013791)-.131979))),-180,180),m=si(n);return new At(p,m)}}const tf=dt(wi);class X_ extends _o{project(e,i){i=dt(i),e=dt(e);const n=Math.cos(i),s=2/Math.PI,c=Math.acos(n*Math.cos(e/2)),u=Math.sin(c)/c,p=.5*(e*s+2*n*Math.sin(e/2)/u)||0,m=.5*(i+Math.sin(i)/u)||0;return{x:.5*(p/Math.PI+.5),y:1-.5*(m/Math.PI+1),z:0}}unproject(e,i){let n=e=(2*e-.5)*Math.PI,s=i=(2*(1-i)-1)*Math.PI,c=25;const u=1e-6;let p=0,m=0;do{const _=Math.cos(s),x=Math.sin(s),b=2*x*_,w=x*x,S=_*_,M=Math.cos(n/2),C=Math.sin(n/2),D=2*M*C,U=C*C,q=1-S*M*M,V=q?1/q:0,$=q?Math.acos(_*M)*Math.sqrt(1/q):0,X=.5*(2*$*_*C+2*n/Math.PI)-e,W=.5*($*x+s)-i,ce=.5*V*(S*U+$*_*M*w)+1/Math.PI,se=V*(D*b/4-$*x*C),me=.125*V*(b*C-$*x*S*D),Ee=.5*V*(w*M+$*U*_)+.5,ue=se*me-Ee*ce;p=(W*se-X*Ee)/ue,m=(X*me-W*ce)/ue,n=ct(n-p,-Math.PI,Math.PI),s=ct(s-m,-tf,tf)}while((Math.abs(p)>u||Math.abs(m)>u)&&--c>0);return new At(si(n),si(s))}}class rf extends _o{constructor(e){super(e),this.center=e.center||[0,0],this.parallels=e.parallels||[0,0],this.cosPhi=Math.max(.01,Math.cos(dt(this.parallels[0]))),this.scale=1/(2*Math.max(Math.PI*this.cosPhi,1/this.cosPhi)),this.wrap=!0,this.supportsWorldCopies=!0}project(e,i){const{scale:n,cosPhi:s}=this;return{x:dt(e)*s*n+.5,y:-Math.sin(dt(i))/s*n+.5,z:0}}unproject(e,i){const{scale:n,cosPhi:s}=this,c=-(i-.5)/n,u=ct(si((e-.5)/n)/s,-180,180),p=Math.asin(ct(c*s,-1,1)),m=ct(si(p),-wi,wi);return new At(u,m)}}class H_ extends Qp{constructor(e){super(e),this.requiresDraping=!0,this.supportsWorldCopies=!1,this.supportsFog=!0,this.zAxisUnit="pixels",this.unsupportedLayers=["debug"],this.range=[3,5]}projectTilePoint(e,i,n){const s=Cl(e,i,n);return qt(s,s,zl(en(n))),{x:s[0],y:s[1],z:s[2]}}locationPoint(e,i){const n=ra(i.lat,i.lng),s=Ci([],n),c=e.elevation?e.elevation.getAtPointOrZero(e.locationCoordinate(i),e._centerAltitude):e._centerAltitude;Sl(n,n,s,Ur(1,0)*Ze*c);const u=Or(new Float64Array(16));return os(u,e.pixelMatrix,e.globeMatrix),qt(n,n,u),new Le(n[0],n[1])}pixelsPerMeter(e,i){return Ur(1,0)*i}pixelSpaceConversion(e,i,n){const s=Ur(1,e)*i,c=mt(Ur(1,45)*i,s,n);return this.pixelsPerMeter(e,i)/c}createTileMatrix(e,i,n){const s=hu(en(n.canonical));return os(new Float64Array(16),e.globeMatrix,s)}createInversionMatrix(e,i){const{center:n}=e,s=zl(en(i));return qc(s,s,dt(n.lng)),eu(s,s,dt(n.lat)),ss(s,s,[e._pixelsPerMercatorPixel,e._pixelsPerMercatorPixel,1]),Float32Array.from(s)}pointCoordinate(e,i,n,s){return Cd(e,i,n,!0)||new oa(0,0)}pointCoordinate3D(e,i,n){const s=this.pointCoordinate(e,i,n,0);return[s.x,s.y,s.z]}isPointAboveHorizon(e,i){return!Cd(e,i.x,i.y,!1)}farthestPixelDistance(e){const i=function(s,c){const u=s.cameraToCenterDistance,p=s._centerAltitude*c,m=s._camera,_=s._camera.forward(),x=zn([],rr([],_,-u),[0,0,p]),b=s.worldSize/(2*Math.PI),w=[0,0,-b],S=s.width/s.height,M=Math.tan(s.fovAboveCenter),C=rr([],m.up(),M),D=rr([],m.right(),M*S),U=Ci([],zn([],zn([],_,C),D)),q=[];let V;if(new nu(x,U).closestPointOnSphere(w,b,q)){const $=zn([],q,w),X=Fr([],$,x);V=Math.cos(s.fovAboveCenter)*wl(X)}else{const $=Fr([],x,w),X=Fr([],w,x);Ci(X,X);const W=wl($)-b;V=Math.sqrt(W*(W+2*b));const ce=Math.acos(V/(b+W))-Math.acos(pr(_,X));V*=Math.cos(ce)}return 1.01*V}(e,this.pixelsPerMeter(e.center.lat,e.worldSize)),n=na(e.zoom);if(n>0){const s=Jp(e,Ur(1,e.center.lat)*e.worldSize),c=e.worldSize/(2*Math.PI),u=Math.max(e.width,e.height)/e.worldSize*Math.PI;return mt(i,s+c*(1-Math.cos(u)),Math.pow(n,10))}return i}upVector(e,i,n){return Cl(i,n,e,1)}upVectorScale(e){return{metersToTile:Wc(Hc(en(e)))}}}function nf(t){const e=t.parallels,i=!!e&&Math.abs(e[0]+e[1])<.01;switch(t.name){case"mercator":return new Qp(t);case"equirectangular":return new Z_(t);case"naturalEarth":return new W_(t);case"equalEarth":return new $_(t);case"winkelTripel":return new X_(t);case"albers":return i?new rf(t):new G_(t);case"lambertConformalConic":return i?new rf(t):new q_(t);case"globe":return new H_(t)}throw new Error(`Invalid projection name: ${t.name}`)}const K_=oh.types,Y_=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function xh(t,e,i,n,s,c,u,p,m,_,x,b,w){const S=p?Math.min(mo,Math.round(p[0])):0,M=p?Math.min(mo,Math.round(p[1])):0;t.emplaceBack(e,i,Math.round(32*n),Math.round(32*s),c,u,(S<<1)+(m?1:0),M,16*_,16*x,256*b,256*w)}function vh(t,e,i,n,s,c,u){t.emplaceBack(e,i,n,s,c,u)}function bh(t,e,i,n,s){t.emplaceBack(e,i,n,s),t.emplaceBack(e,i,n,s),t.emplaceBack(e,i,n,s),t.emplaceBack(e,i,n,s)}function J_(t){for(const e of t.sections)if(Hh(e.text))return!0;return!1}class Nu{constructor(e){this.layoutVertexArray=new ve,this.indexArray=new je,this.programConfigurations=e,this.segments=new Yt,this.dynamicLayoutVertexArray=new we,this.opacityVertexArray=new Ge,this.placedSymbolArray=new Kt,this.globeExtVertexArray=new Ae}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(e,i,n,s){this.isEmpty()||(n&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,s_.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,i),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,l_.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,Y_,!0),this.globeExtVertexArray.length>0&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,a_.members,!0)),this.opacityVertexBuffer.itemSize=1),(n||s)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}}Ue(Nu,"SymbolBuffers");class ju{constructor(e,i,n){this.layoutVertexArray=new e,this.layoutAttributes=i,this.indexArray=new n,this.segments=new Yt,this.collisionVertexArray=new lt,this.collisionVertexArrayExt=new ot}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,c_.members,!0),this.collisionVertexBufferExt=e.createVertexBuffer(this.collisionVertexArrayExt,h_.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy(),this.collisionVertexBufferExt.destroy())}}Ue(ju,"CollisionBuffers");class go{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(u=>u.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.fullyClipped=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Or([]),this.placementViewportMatrix=Or([]);const i=this.layers[0]._unevaluatedLayout._values;this.textSizeData=zu(this.zoom,i["text-size"]),this.iconSizeData=zu(this.zoom,i["icon-size"]);const n=this.layers[0].layout,s=n.get("symbol-sort-key"),c=n.get("symbol-z-order");this.canOverlap=n.get("text-allow-overlap")||n.get("icon-allow-overlap")||n.get("text-ignore-placement")||n.get("icon-ignore-placement"),this.sortFeaturesByKey=c!=="viewport-y"&&s.constantOr(1)!==void 0,this.sortFeaturesByY=(c==="viewport-y"||c==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,this.writingModes=n.get("text-writing-mode").map(u=>or[u]),this.stateDependentLayerIds=this.layers.filter(u=>u.isStateDependent()).map(u=>u.id),this.sourceID=e.sourceID,this.projection=e.projection}createArrays(){this.text=new Nu(new ns(this.layers,this.zoom,e=>/^text/.test(e))),this.icon=new Nu(new ns(this.layers,this.zoom,e=>/^icon/.test(e))),this.glyphOffsetArray=new Ii,this.lineVertexArray=new Js,this.symbolInstances=new Bt}calculateGlyphDependencies(e,i,n,s,c){for(let u=0;u0)&&(m.value.kind!=="constant"||m.value.value.length>0),w=x.value.kind!=="constant"||!!x.value.value||Object.keys(x.parameters).length>0,S=u.get("symbol-sort-key");if(this.features=[],!b&&!w)return;const M=i.iconDependencies,C=i.glyphDependencies,D=i.availableImages,U=new v(this.zoom);for(const{feature:q,id:V,index:$,sourceLayerIndex:X}of e){const W=c._featureFilter.needGeometry,ce=hs(q,W);if(!c._featureFilter.filter(U,ce,n))continue;if(W||(ce.geometry=Pn(q,n,s)),p&&q.type!==1&&n.z<=5){const ue=ce.geometry,ye=.98078528056,xe=(be,Ce)=>pr(Cl(be.x,be.y,n,1),Cl(Ce.x,Ce.y,n,1))=0;for(const xe of se.sections)if(xe.image)M[xe.image.name]=!0;else{const be=fl(se.toString()),Ce=xe.fontStack||ue,pe=C[Ce]=C[Ce]||{};this.calculateGlyphDependencies(xe.text,pe,ye,this.allowVerticalPlacement,be)}}}u.get("symbol-placement")==="line"&&(this.features=function(q){const V={},$={},X=[];let W=0;function ce(ue){X.push(q[ue]),W++}function se(ue,ye,xe){const be=$[ue];return delete $[ue],$[ye]=be,X[be].geometry[0].pop(),X[be].geometry[0]=X[be].geometry[0].concat(xe[0]),be}function me(ue,ye,xe){const be=V[ye];return delete V[ye],V[ue]=be,X[be].geometry[0].shift(),X[be].geometry[0]=xe[0].concat(X[be].geometry[0]),be}function Ee(ue,ye,xe){const be=xe?ye[0][ye[0].length-1]:ye[0][0];return`${ue}:${be.x}:${be.y}`}for(let ue=0;ueue.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((q,V)=>q.sortKey-V.sortKey)}update(e,i,n,s){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,i,this.layers,n,s),this.icon.programConfigurations.updatePaintArrays(e,i,this.layers,n,s))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}getProjection(){return this.projectionInstance||(this.projectionInstance=nf(this.projection)),this.projectionInstance}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,i){const n=this.lineVertexArray.length;if(e.segment!==void 0)for(const{x:s,y:c}of i)this.lineVertexArray.emplaceBack(s,c);return{lineStartIndex:n,lineLength:this.lineVertexArray.length-n}}addSymbols(e,i,n,s,c,u,p,m,_,x,b,w,S,M){const C=e.indexArray,D=e.layoutVertexArray,U=e.globeExtVertexArray,q=e.segments.prepareSegment(4*i.length,D,C,this.canOverlap?u.sortKey:void 0),V=this.glyphOffsetArray.length,$=q.vertexLength,X=this.allowVerticalPlacement&&p===or.vertical?Math.PI/2:0,W=u.text&&u.text.sections;for(let se=0;se=0?i.rightJustifiedTextSymbolIndex:i.centerJustifiedTextSymbolIndex>=0?i.centerJustifiedTextSymbolIndex:i.leftJustifiedTextSymbolIndex>=0?i.leftJustifiedTextSymbolIndex:i.verticalPlacedTextSymbolIndex>=0?i.verticalPlacedTextSymbolIndex:s),u=ch(this.textSizeData,e,c)/mi;return this.tilePixelRatio*u}getSymbolInstanceIconSize(e,i,n){const s=this.icon.placedSymbolArray.get(n),c=ch(this.iconSizeData,e,s);return this.tilePixelRatio*c}_commitDebugCollisionVertexUpdate(e,i,n){e.emplaceBack(i,-n,-n),e.emplaceBack(i,n,-n),e.emplaceBack(i,n,n),e.emplaceBack(i,-n,n)}_updateTextDebugCollisionBoxes(e,i,n,s,c,u){for(let p=s;p0}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(e,i){const n=e.placedSymbolArray.get(i),s=n.vertexStartIndex+4*n.numGlyphs;for(let c=n.vertexStartIndex;cs[p]-s[m]||c[m]-c[p]),u}addToSortKeyRanges(e,i){const n=this.sortKeyRanges[this.sortKeyRanges.length-1];n&&n.sortKey===i?n.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:i,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const i of this.symbolInstanceIndexes){const n=this.symbolInstances.get(i);this.featureSortOrder.push(n.featureIndex);const{rightJustifiedTextSymbolIndex:s,centerJustifiedTextSymbolIndex:c,leftJustifiedTextSymbolIndex:u,verticalPlacedTextSymbolIndex:p,placedIconSymbolIndex:m,verticalPlacedIconSymbolIndex:_}=n;s>=0&&this.addIndicesForPlacedSymbol(this.text,s),c>=0&&c!==s&&this.addIndicesForPlacedSymbol(this.text,c),u>=0&&u!==c&&u!==s&&this.addIndicesForPlacedSymbol(this.text,u),p>=0&&this.addIndicesForPlacedSymbol(this.text,p),m>=0&&this.addIndicesForPlacedSymbol(this.icon,m),_>=0&&this.addIndicesForPlacedSymbol(this.icon,_)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}Ue(go,"SymbolBucket",{omit:["layers","collisionBoxArray","features","compareText"]}),go.MAX_GLYPHS=65535,go.addDynamicAttributes=bh;const Q_=new j({"symbol-placement":new I(fe.layout_symbol["symbol-placement"]),"symbol-spacing":new I(fe.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new I(fe.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new L(fe.layout_symbol["symbol-sort-key"]),"symbol-z-order":new I(fe.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new I(fe.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new I(fe.layout_symbol["icon-ignore-placement"]),"icon-optional":new I(fe.layout_symbol["icon-optional"]),"icon-rotation-alignment":new I(fe.layout_symbol["icon-rotation-alignment"]),"icon-size":new L(fe.layout_symbol["icon-size"]),"icon-text-fit":new I(fe.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new I(fe.layout_symbol["icon-text-fit-padding"]),"icon-image":new L(fe.layout_symbol["icon-image"]),"icon-rotate":new L(fe.layout_symbol["icon-rotate"]),"icon-padding":new I(fe.layout_symbol["icon-padding"]),"icon-keep-upright":new I(fe.layout_symbol["icon-keep-upright"]),"icon-offset":new L(fe.layout_symbol["icon-offset"]),"icon-anchor":new L(fe.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new I(fe.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new I(fe.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new I(fe.layout_symbol["text-rotation-alignment"]),"text-field":new L(fe.layout_symbol["text-field"]),"text-font":new L(fe.layout_symbol["text-font"]),"text-size":new L(fe.layout_symbol["text-size"]),"text-max-width":new L(fe.layout_symbol["text-max-width"]),"text-line-height":new L(fe.layout_symbol["text-line-height"]),"text-letter-spacing":new L(fe.layout_symbol["text-letter-spacing"]),"text-justify":new L(fe.layout_symbol["text-justify"]),"text-radial-offset":new L(fe.layout_symbol["text-radial-offset"]),"text-variable-anchor":new I(fe.layout_symbol["text-variable-anchor"]),"text-anchor":new L(fe.layout_symbol["text-anchor"]),"text-max-angle":new I(fe.layout_symbol["text-max-angle"]),"text-writing-mode":new I(fe.layout_symbol["text-writing-mode"]),"text-rotate":new L(fe.layout_symbol["text-rotate"]),"text-padding":new I(fe.layout_symbol["text-padding"]),"text-keep-upright":new I(fe.layout_symbol["text-keep-upright"]),"text-transform":new L(fe.layout_symbol["text-transform"]),"text-offset":new L(fe.layout_symbol["text-offset"]),"text-allow-overlap":new I(fe.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new I(fe.layout_symbol["text-ignore-placement"]),"text-optional":new I(fe.layout_symbol["text-optional"])});var Gu={paint:new j({"icon-opacity":new L(fe.paint_symbol["icon-opacity"]),"icon-color":new L(fe.paint_symbol["icon-color"]),"icon-halo-color":new L(fe.paint_symbol["icon-halo-color"]),"icon-halo-width":new L(fe.paint_symbol["icon-halo-width"]),"icon-halo-blur":new L(fe.paint_symbol["icon-halo-blur"]),"icon-translate":new I(fe.paint_symbol["icon-translate"]),"icon-translate-anchor":new I(fe.paint_symbol["icon-translate-anchor"]),"text-opacity":new L(fe.paint_symbol["text-opacity"]),"text-color":new L(fe.paint_symbol["text-color"],{runtimeType:Bi,getOverride:t=>t.textColor,hasOverride:t=>!!t.textColor}),"text-halo-color":new L(fe.paint_symbol["text-halo-color"]),"text-halo-width":new L(fe.paint_symbol["text-halo-width"]),"text-halo-blur":new L(fe.paint_symbol["text-halo-blur"]),"text-translate":new I(fe.paint_symbol["text-translate"]),"text-translate-anchor":new I(fe.paint_symbol["text-translate-anchor"])}),layout:Q_};class of{constructor(e){this.type=e.property.overrides?e.property.overrides.runtimeType:qn,this.defaultValue=e}evaluate(e){if(e.formattedSection){const i=this.defaultValue.property.overrides;if(i&&i.hasOverride(e.formattedSection))return i.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Ue(of,"FormatSectionOverride",{omit:["defaultValue"]});class wh extends Br{constructor(e){super(e,Gu)}recalculate(e,i){super.recalculate(e,i),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"));const n=this.layout.get("text-writing-mode");if(n){const s=[];for(const c of n)s.indexOf(c)<0&&s.push(c);this.layout._values["text-writing-mode"]=s}else this.layout._values["text-writing-mode"]=this.layout.get("symbol-placement")==="point"?["horizontal"]:["horizontal","vertical"];this._setPaintOverrides()}getValueAndResolveTokens(e,i,n,s){const c=this.layout.get(e).evaluate(i,{},n,s),u=this._unevaluatedLayout._values[e];return u.isDataDriven()||no(u.value)||!c?c:function(p,m){return m.replace(/{([^{}]+)}/g,(_,x)=>x in p?String(p[x]):"")}(i.properties,c)}createBucket(e){return new go(e)}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(const e of Gu.paint.overridableProperties){if(!wh.hasPaintOverride(this.layout,e))continue;const i=this.paint.get(e),n=new of(i),s=new $s(n,i.property.specification);let c=null;c=i.value.kind==="constant"||i.value.kind==="source"?new rl("source",s):new Ho("composite",s,i.value.zoomStops,i.value._interpolationType),this.paint._values[e]=new B(i.property,c,i.parameters)}}_handleOverridablePaintPropertyUpdate(e,i,n){return!(!this.layout||i.isDataDriven()||n.isDataDriven())&&wh.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,i){const n=e.get("text-field"),s=Gu.paint.properties[i];let c=!1;const u=p=>{for(const m of p)if(s.overrides&&s.overrides.hasOverride(m))return void(c=!0)};if(n.value.kind==="constant"&&n.value.value instanceof Ai)u(n.value.value.sections);else if(n.value.kind==="source"){const p=_=>{c||(_ instanceof xn&&Gt(_.value)===ko?u(_.value.sections):_ instanceof Kr?u(_.sections):_.eachChild(p))},m=n.value;m._styleExpression&&p(m._styleExpression.expression)}return c}getProgramConfiguration(e){return new uo(this,e)}}var eg={paint:new j({"background-color":new I(fe.paint_background["background-color"]),"background-pattern":new I(fe.paint_background["background-pattern"]),"background-opacity":new I(fe.paint_background["background-opacity"])})},tg={paint:new j({"raster-opacity":new I(fe.paint_raster["raster-opacity"]),"raster-hue-rotate":new I(fe.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new I(fe.paint_raster["raster-brightness-min"]),"raster-brightness-max":new I(fe.paint_raster["raster-brightness-max"]),"raster-saturation":new I(fe.paint_raster["raster-saturation"]),"raster-contrast":new I(fe.paint_raster["raster-contrast"]),"raster-resampling":new I(fe.paint_raster["raster-resampling"]),"raster-fade-duration":new I(fe.paint_raster["raster-fade-duration"])})};class ig extends Br{constructor(e){super(e,{}),this.implementation=e}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}isLayerDraped(){return this.implementation.renderToTile!==void 0}shouldRedrape(){return!!this.implementation.shouldRerenderTiles&&this.implementation.shouldRerenderTiles()}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){}onAdd(e){this.implementation.onAdd&&this.implementation.onAdd(e,e.painter.context.gl)}onRemove(e){this.implementation.onRemove&&this.implementation.onRemove(e,e.painter.context.gl)}}var rg={paint:new j({"sky-type":new I(fe.paint_sky["sky-type"]),"sky-atmosphere-sun":new I(fe.paint_sky["sky-atmosphere-sun"]),"sky-atmosphere-sun-intensity":new I(fe.paint_sky["sky-atmosphere-sun-intensity"]),"sky-gradient-center":new I(fe.paint_sky["sky-gradient-center"]),"sky-gradient-radius":new I(fe.paint_sky["sky-gradient-radius"]),"sky-gradient":new N(fe.paint_sky["sky-gradient"]),"sky-atmosphere-halo-color":new I(fe.paint_sky["sky-atmosphere-halo-color"]),"sky-atmosphere-color":new I(fe.paint_sky["sky-atmosphere-color"]),"sky-opacity":new I(fe.paint_sky["sky-opacity"])})};function $u(t,e,i){const n=[0,0,1],s=Td([]);return Sd(s,s,i?-dt(t)+Math.PI:dt(t)),Ed(s,s,-dt(e)),xd(n,n,s),Ci(n,n)}const ng={circle:class extends Br{constructor(t){super(t,mm)}createBucket(t){return new _u(t)}queryRadius(t){const e=t;return sa("circle-radius",this,e)+sa("circle-stroke-width",this,e)+Jc(this.paint.get("circle-translate"))}queryIntersectsFeature(t,e,i,n,s,c,u,p){const m=Wd(this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),c.angle,t.pixelToTileUnitsFactor),_=this.paint.get("circle-radius").evaluate(e,i)+this.paint.get("circle-stroke-width").evaluate(e,i);return Xd(t,n,c,u,p,this.paint.get("circle-pitch-alignment")==="map",this.paint.get("circle-pitch-scale")==="map",m,_)}getProgramIds(){return["circle"]}getProgramConfiguration(t){return new uo(this,t)}},heatmap:class extends Br{createBucket(t){return new Kd(t)}constructor(t){super(t,xm),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){t==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=vu({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(t){return sa("heatmap-radius",this,t)}queryIntersectsFeature(t,e,i,n,s,c,u,p){const m=this.paint.get("heatmap-radius").evaluate(e,i);return Xd(t,n,c,u,p,!0,!0,new Le(0,0),m)}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}getProgramIds(){return["heatmap","heatmapTexture"]}getProgramConfiguration(t){return new uo(this,t)}},hillshade:class extends Br{constructor(t){super(t,vm)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}getProgramIds(){return["hillshade","hillshadePrepare"]}},fill:class extends Br{constructor(t){super(t,Bm)}getProgramIds(){const t=this.paint.get("fill-pattern"),e=t&&t.constantOr(1),i=[e?"fillPattern":"fill"];return this.paint.get("fill-antialias")&&i.push(e&&!this.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline"),i}getProgramConfiguration(t){return new uo(this,t)}recalculate(t,e){super.recalculate(t,e);const i=this.paint._values["fill-outline-color"];i.value.kind==="constant"&&i.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(t){return new rh(t)}queryRadius(){return Jc(this.paint.get("fill-translate"))}queryIntersectsFeature(t,e,i,n,s,c){return!t.queryGeometry.isAboveHorizon&&jd(qd(t.tilespaceGeometry,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),c.angle,t.pixelToTileUnitsFactor),n)}isTileClipped(){return!0}},"fill-extrusion":class extends Br{constructor(t){super(t,Jm)}createBucket(t){return new Fl(t)}queryRadius(){return Jc(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}getProgramIds(){return[this.paint.get("fill-extrusion-pattern").constantOr(1)?"fillExtrusionPattern":"fillExtrusion"]}getProgramConfiguration(t){return new uo(this,t)}queryIntersectsFeature(t,e,i,n,s,c,u,p,m){const _=Wd(this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),c.angle,t.pixelToTileUnitsFactor),x=this.paint.get("fill-extrusion-height").evaluate(e,i),b=this.paint.get("fill-extrusion-base").evaluate(e,i),w=[0,0],S=p&&c.elevation,M=c.elevation?c.elevation.exaggeration():1,C=t.tile.getBucket(this);if(S&&C instanceof Fl){const $=C.centroidVertexArray,X=m+1;X<$.length&&(w[0]=$.geta_centroid_pos0(X),w[1]=$.geta_centroid_pos1(X))}if(w[0]===0&&w[1]===1)return!1;c.projection.name==="globe"&&(n=fp([n],[new Le(0,0),new Le(Ze,Ze)],t.tileID.canonical).map($=>$.polygon).flat());const D=S?p:null,[U,q]=function($,X,W,ce,se,me,Ee,ue,ye,xe,be){return $.projection.name==="globe"?function(Ce,pe,De,Ne,Re,He,ze,$e,Ke,gt,Ye){const We=[],Rt=[],et=Ce.projection.upVectorScale(Ye,Ce.center.lat,Ce.worldSize).metersToTile,tt=[0,0,0,1],It=[0,0,0,1],kt=(Ct,Nt,$t,Qt)=>{Ct[0]=Nt,Ct[1]=$t,Ct[2]=Qt,Ct[3]=1},Dt=pp();De>0&&(De+=Dt),Ne+=Dt;for(const Ct of pe){const Nt=[],$t=[];for(const Qt of Ct){const zt=Qt.x+Re.x,ni=Qt.y+Re.y,ei=Ce.projection.projectTilePoint(zt,ni,Ye),jt=Ce.projection.upVector(Ye,Qt.x,Qt.y);let xt=De,ti=Ne;if(ze){const Lt=yp(zt,ni,De,Ne,ze,$e,Ke,gt);xt+=Lt.base,ti+=Lt.top}De!==0?kt(tt,ei.x+jt[0]*et*xt,ei.y+jt[1]*et*xt,ei.z+jt[2]*et*xt):kt(tt,ei.x,ei.y,ei.z),kt(It,ei.x+jt[0]*et*ti,ei.y+jt[1]*et*ti,ei.z+jt[2]*et*ti),qt(tt,tt,He),qt(It,It,He),Nt.push(new ca(tt[0],tt[1],tt[2])),$t.push(new ca(It[0],It[1],It[2]))}We.push(Nt),Rt.push($t)}return[We,Rt]}($,X,W,ce,se,me,Ee,ue,ye,xe,be):Ee?function(Ce,pe,De,Ne,Re,He,ze,$e,Ke){const gt=[],Ye=[],We=[0,0,0,1];for(const Rt of Ce){const et=[],tt=[];for(const It of Rt){const kt=It.x+Ne.x,Dt=It.y+Ne.y,Ct=yp(kt,Dt,pe,De,He,ze,$e,Ke);We[0]=kt,We[1]=Dt,We[2]=Ct.base,We[3]=1,as(We,We,Re),We[3]=Math.max(We[3],1e-5);const Nt=new ca(We[0]/We[3],We[1]/We[3],We[2]/We[3]);We[0]=kt,We[1]=Dt,We[2]=Ct.top,We[3]=1,as(We,We,Re),We[3]=Math.max(We[3],1e-5);const $t=new ca(We[0]/We[3],We[1]/We[3],We[2]/We[3]);et.push(Nt),tt.push($t)}gt.push(et),Ye.push(tt)}return[gt,Ye]}(X,W,ce,se,me,Ee,ue,ye,xe):function(Ce,pe,De,Ne,Re){const He=[],ze=[],$e=Re[8]*pe,Ke=Re[9]*pe,gt=Re[10]*pe,Ye=Re[11]*pe,We=Re[8]*De,Rt=Re[9]*De,et=Re[10]*De,tt=Re[11]*De;for(const It of Ce){const kt=[],Dt=[];for(const Ct of It){const Nt=Ct.x+Ne.x,$t=Ct.y+Ne.y,Qt=Re[0]*Nt+Re[4]*$t+Re[12],zt=Re[1]*Nt+Re[5]*$t+Re[13],ni=Re[2]*Nt+Re[6]*$t+Re[14],ei=Re[3]*Nt+Re[7]*$t+Re[15],jt=Qt+$e,xt=zt+Ke,ti=ni+gt,Lt=Math.max(ei+Ye,1e-5),ki=Qt+We,ii=zt+Rt,_i=ni+et,di=Math.max(ei+tt,1e-5);kt.push(new ca(jt/Lt,xt/Lt,ti/Lt)),Dt.push(new ca(ki/di,ii/di,_i/di))}He.push(kt),ze.push(Dt)}return[He,ze]}(X,W,ce,se,me)}(c,n,b,x,_,u,D,w,M,c.center.lat,t.tileID.canonical),V=t.queryGeometry;return function($,X,W){let ce=1/0;jd(W,X)&&(ce=gp(W,X[0]));for(let se=0;se=3){for(let M=0;M{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){this._channel=void 0,this._callback=()=>{}}}class sg{constructor(){this.tasks={},this.taskQueue=[],dn(["process"],this),this.invoker=new og(this.process),this.nextId=0}add(e,i){const n=this.nextId++,s=function({type:c,isSymbolTile:u,zoom:p}){return p=p||0,c==="message"?0:c!=="maybePrepare"||u?c!=="parseTile"||u?c==="parseTile"&&u?300-p:c==="maybePrepare"&&u?400-p:500:200-p:100-p}(i);if(s===0){Tr();try{e()}finally{}return{cancel:()=>{}}}return this.tasks[n]={fn:e,metadata:i,priority:s,id:n},this.taskQueue.push(n),this.invoker.trigger(),{cancel:()=>{delete this.tasks[n]}}}process(){Tr();try{if(this.taskQueue=this.taskQueue.filter(n=>!!this.tasks[n]),!this.taskQueue.length)return;const e=this.pick();if(e===null)return;const i=this.tasks[e];if(delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),!i)return;i.fn()}finally{}}pick(){let e=null,i=1/0;for(let s=0;s>=1)>1;){const _=i+s>>1,x=n+c>>1;1&e?(s=i,c=n,i=u,n=p):(i=s,n=c,s=u,c=p),u=_,p=x}const m=4*t;yo[m+0]=i,yo[m+1]=n,yo[m+2]=s,yo[m+3]=c}const on=new Uint16Array(2178),xo=new Uint8Array(1089),Th=new Uint16Array(1089);function lf(t){return t===0?-.03125:t===32?.03125:0}var cf=te([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);const hf={type:2,extent:Ze,loadGeometry:()=>[[new Le(0,0),new Le(Ze+1,0),new Le(Ze+1,Ze+1),new Le(0,Ze+1),new Le(0,0)]]};class Zu{constructor(e,i,n,s,c){this.tileID=e,this.uid=Fn(),this.uses=0,this.tileSize=i,this.tileZoom=n,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.isRaster=c,this.expiredRequestCount=0,this.state="loading",s&&s.transform&&(this.projection=s.transform.projection)}registerFadeDuration(e){const i=e+this.timeAdded;ic.getLayer(_)).filter(Boolean);if(m.length!==0){p.layers=m,p.stateDependentLayerIds&&(p.stateDependentLayers=p.stateDependentLayerIds.map(_=>m.filter(x=>x.id===_)[0]));for(const _ of m)u[_.id]=p}}return u}(e.buckets,i.style),this.hasSymbolBuckets=!1;for(const s in this.buckets){const c=this.buckets[s];if(c instanceof go){if(this.hasSymbolBuckets=!0,!n)break;c.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const s in this.buckets){const c=this.buckets[s];if(c instanceof go&&c.hasRTLText){this.hasRTLText=!0,y.isLoading()||y.isLoaded()||f()!=="deferred"||g();break}}this.queryPadding=0;for(const s in this.buckets){const c=this.buckets[s];this.queryPadding=Math.max(this.queryPadding,i.style.getLayer(s).queryRadius(c))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage),e.lineAtlas&&(this.lineAtlas=e.lineAtlas)}else this.collisionBoxArray=new Mt}unloadVectorData(){if(this.hasData()){for(const e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.lineAtlasTexture&&this.lineAtlasTexture.destroy(),this._tileBoundsBuffer&&(this._tileBoundsBuffer.destroy(),this._tileBoundsIndexBuffer.destroy(),this._tileBoundsSegments.destroy(),this._tileBoundsBuffer=null),this._tileDebugBuffer&&(this._tileDebugBuffer.destroy(),this._tileDebugSegments.destroy(),this._tileDebugBuffer=null),this._tileDebugIndexBuffer&&(this._tileDebugIndexBuffer.destroy(),this._tileDebugIndexBuffer=null),this._globeTileDebugBorderBuffer&&(this._globeTileDebugBorderBuffer.destroy(),this._globeTileDebugBorderBuffer=null),this._tileDebugTextBuffer&&(this._tileDebugTextBuffer.destroy(),this._tileDebugTextSegments.destroy(),this._tileDebugTextIndexBuffer.destroy(),this._tileDebugTextBuffer=null),this._globeTileDebugTextBuffer&&(this._globeTileDebugTextBuffer.destroy(),this._globeTileDebugTextBuffer=null),this.latestFeatureIndex=null,this.state="unloaded"}}getBucket(e){return this.buckets[e.id]}upload(e){for(const n in this.buckets){const s=this.buckets[n];s.uploadPending()&&s.upload(e)}const i=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Hl(e,this.imageAtlas.image,i.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Hl(e,this.glyphAtlasImage,i.ALPHA),this.glyphAtlasImage=null),this.lineAtlas&&!this.lineAtlas.uploaded&&(this.lineAtlasTexture=new Hl(e,this.lineAtlas.image,i.ALPHA),this.lineAtlas.uploaded=!0)}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,i,n,s,c,u,p,m){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({tileResult:s,pixelPosMatrix:p,transform:u,params:c,tileTransform:this.tileTransform},e,i,n):{}}querySourceFeatures(e,i){const n=this.latestFeatureIndex;if(!n||!n.rawTileData)return;const s=n.loadVTLayers(),c=i?i.sourceLayer:"",u=s._geojsonTileLayer||s[c];if(!u)return;const p=Xs(i&&i.filter),{z:m,x:_,y:x}=this.tileID.canonical,b={z:m,x:_,y:x};for(let w=0;wn)s=!1;else if(i)if(this.expirationTime=0;D--){const U=4*D,q=yo[U+0],V=yo[U+1],$=yo[U+2],X=yo[U+3],W=q+$>>1,ce=V+X>>1,se=W+ce-V,me=ce+q-W,Ee=V*nn+q,ue=X*nn+$,ye=ce*nn+W,xe=Math.hypot((on[2*Ee+0]+on[2*ue+0])/2-on[2*ye+0],(on[2*Ee+1]+on[2*ue+1])/2-on[2*ye+1])>=16;xo[ye]=xo[ye]||(xe?1:0),D<1022&&(xo[ye]=xo[ye]||xo[(V+me>>1)*nn+(q+se>>1)]||xo[(X+me>>1)*nn+($+se>>1)])}const b=new ge,w=new je;let S=0;function M(D,U){const q=U*nn+D;return Th[q]===0&&(b.emplaceBack(on[2*q+0],on[2*q+1],D*Ze/_r,U*Ze/_r),Th[q]=++S),Th[q]-1}function C(D,U,q,V,$,X){const W=D+q>>1,ce=U+V>>1;if(Math.abs(D-$)+Math.abs(U-X)>1&&xo[ce*nn+W])C($,X,D,U,W,ce),C(q,V,$,X,W,ce);else{const se=M(D,U),me=M(q,V),Ee=M($,X);w.emplaceBack(se,me,Ee)}}return C(0,0,_r,_r,_r,0),C(_r,_r,0,0,0,_r),{vertices:b,indices:w}}(this.tileID.canonical,i);s=u.vertices,c=u.indices}else{s=new ge,c=new je;for(const{x:p,y:m}of n)s.emplaceBack(p,m,0,0);const u=Su(s.int16,void 0,4);for(let p=0;p0&&(p=Qh(new Float64Array(16),i.globeMatrix)),this._makeGlobeTileDebugBorderBuffer(e,s,i,c,p,u),this._makeGlobeTileDebugTextBuffer(e,s,i,c,p,u)}_globePoint(e,i,n,s,c,u,p){let m=Cl(e,i,n);if(u){const _=1<.5?S=-1:w<-.5&&(S=1);let M=(e/Ze+n.x)/_+S,C=(i/Ze+n.y)/_;M=(M-x)*s._pixelsPerMercatorPixel+x,C=(C-b)*s._pixelsPerMercatorPixel+b;const D=[M*s.worldSize,C*s.worldSize,0];qt(D,D,u),m=cs(m,D,p)}return qt(m,m,c)}_makeGlobeTileDebugBorderBuffer(e,i,n,s,c,u){const p=new Te,m=new Zi,_=new oe,x=(w,S,M,C,D)=>{const U=(M-w)/(D-1),q=(C-S)/(D-1),V=p.length;for(let $=0;$b*S+M;for(let S=0;Se[u])return null}else{const p=1/n[u];let m=(t[u]-i[u])*p,_=(e[u]-i[u])*p;if(m>_){const x=m;m=_,_=x}if(m>s&&(s=m),_c)return null}return s}function pf(t,e,i,n,s,c,u,p,m,_,x){const b=n-t,w=s-e,S=c-i,M=u-t,C=p-e,D=m-i,U=x[1]*D-x[2]*C,q=x[2]*M-x[0]*D,V=x[0]*C-x[1]*M,$=b*U+w*q+S*V;if(Math.abs($)<1e-15)return null;const X=1/$,W=_[0]-t,ce=_[1]-e,se=_[2]-i,me=(W*U+ce*q+se*V)*X;if(me<0||me>1)return null;const Ee=ce*S-se*w,ue=se*b-W*S,ye=W*w-ce*b,xe=(x[0]*Ee+x[1]*ue+x[2]*ye)*X;return xe<0||me+xe>1?null:(M*Ee+C*ue+D*ye)*X}function ff(t,e,i){return(t-e)/(i-e)}function mf(t,e,i,n,s,c,u,p,m){const _=1<{const q=D?1:0,V=(S+1)*C-q,$=M*C,X=(M+1)*C-q;U[0]=S*C,U[1]=$,U[2]=V,U[3]=X};let b=new uf(m);const w=[];for(let S=0;S=1;m/=2){const S=p[p.length-1];b=new uf(m);for(let M=0;M0;){const{idx:M,t:C,nodex:D,nodey:U,depth:q}=S.pop();if(this.leaves[M]){mf(D,U,q,e,i,n,s,b,w);const $=1<=pe[2])return C}continue}let V=0;for(let $=0;$=_[x[se]]&&(x.splice(se,0,$),ce=!0);ce||(x[V]=$),V++}}for(let $=0;$=this.dim+1||i<-1||i>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(i+1)*this.stride+(e+1)}static pack(e,i){const n=[0,0,0,0],s=Eh.getUnpackVector(i);let c=Math.floor((e+s[3])/s[2]);return n[2]=c%256,c=Math.floor(c/256),n[1]=c%256,c=Math.floor(c/256),n[0]=c,n}getPixels(){return new Wi({width:this.stride,height:this.stride},this.pixels)}backfillBorder(e,i,n){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let s=i*this.dim,c=i*this.dim+this.dim,u=n*this.dim,p=n*this.dim+this.dim;switch(i){case-1:s=c-1;break;case 1:c=s+1}switch(n){case-1:u=p-1;break;case 1:p=u+1}const m=-i*this.dim,_=-n*this.dim;for(let x=u;x{this.remove(e,c)},n)),this.data[s].push(c),this.order.push(s),this.order.length>this.max){const u=this._getAndRemoveByKey(this.order[0]);u&&this.onRemove(u)}return this}has(e){return e.wrapped().key in this.data}getAndRemove(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}_getAndRemoveByKey(e){const i=this.data[e].shift();return i.timeout&&clearTimeout(i.timeout),this.data[e].length===0&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),i.value}getByKey(e){const i=this.data[e];return i?i[0].value:null}get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,i){if(!this.has(e))return this;const n=e.wrapped().key,s=i===void 0?0:this.data[n].indexOf(i),c=this.data[n][s];return this.data[n].splice(s,1),c.timeout&&clearTimeout(c.timeout),this.data[n].length===0&&delete this.data[n],this.onRemove(c.value),this.order.splice(this.order.indexOf(n),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){const i=this._getAndRemoveByKey(this.order[0]);i&&this.onRemove(i)}return this}filter(e){const i=[];for(const n in this.data)for(const s of this.data[n])e(s.value)||i.push(s);for(const n of i)this.remove(n.value.tileID,n)}}class xa{constructor(e,i,n){this.func=e,this.mask=i,this.range=n}}xa.ReadOnly=!1,xa.ReadWrite=!0,xa.disabled=new xa(519,xa.ReadOnly,[0,1]);const qu=7680;class Wu{constructor(e,i,n,s,c,u){this.test=e,this.ref=i,this.mask=n,this.fail=s,this.depthFail=c,this.pass=u}}Wu.disabled=new Wu({func:519,mask:0},0,0,qu,qu,qu);class sn{constructor(e,i,n){this.blendFunction=e,this.blendColor=i,this.mask=n}}sn.Replace=[1,0],sn.disabled=new sn(sn.Replace,Zt.transparent,[!1,!1,!1,!1]),sn.unblended=new sn(sn.Replace,Zt.transparent,[!0,!0,!0,!0]),sn.alphaBlended=new sn([1,771],Zt.transparent,[!0,!0,!0,!0]);const Xu=1029,Hu=2305;class jr{constructor(e,i,n){this.enable=e,this.mode=i,this.frontFace=n}}jr.disabled=new jr(!1,Xu,Hu),jr.backCCW=new jr(!0,Xu,Hu),jr.backCW=new jr(!0,Xu,2304),jr.frontCW=new jr(!0,1028,2304),jr.frontCCW=new jr(!0,1028,Hu);class fs extends Po{constructor(e,i,n){super(),this.id=e,this._onlySymbols=n,i.on("data",s=>{s.dataType==="source"&&s.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&s.dataType==="source"&&s.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform))}),i.on("error",()=>{this._sourceErrored=!0}),this._source=i,this._tiles={},this._cache=new ug(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._minTileCacheSize=i.minTileCacheSize,this._maxTileCacheSize=i.maxTileCacheSize,this._loadedParentTiles={},this._coveredTiles={},this._state=new lg,this._isRaster=this._source.type==="raster"||this._source.type==="raster-dem"||this._source.type==="custom"&&this._source._dataType==="raster"}onAdd(e){this.map=e,this._minTileCacheSize=this._minTileCacheSize===void 0&&e?e._minTileCacheSize:this._minTileCacheSize,this._maxTileCacheSize=this._maxTileCacheSize===void 0&&e?e._maxTileCacheSize:this._maxTileCacheSize}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(const e in this._tiles){const i=this._tiles[e];if(i.state!=="loaded"&&i.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform)}_loadTile(e,i){return e.isSymbolTile=this._onlySymbols,this._source.loadTile(e,i)}_unloadTile(e){if(this._source.unloadTile)return this._source.unloadTile(e,()=>{})}_abortTile(e){if(this._source.abortTile)return this._source.abortTile(e,()=>{})}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const i in this._tiles){const n=this._tiles[i];n.upload(e),n.prepare(this.map.style.imageManager)}}getIds(){return $r(this._tiles).map(e=>e.tileID).sort(xf).map(e=>e.key)}getRenderableIds(e){const i=[];for(const n in this._tiles)this._isIdRenderable(+n,e)&&i.push(this._tiles[n]);return e?i.sort((n,s)=>{const c=n.tileID,u=s.tileID,p=new Le(c.canonical.x,c.canonical.y)._rotate(this.transform.angle),m=new Le(u.canonical.x,u.canonical.y)._rotate(this.transform.angle);return c.overscaledZ-u.overscaledZ||m.y-p.y||m.x-p.x}).map(n=>n.tileID.key):i.map(n=>n.tileID).sort(xf).map(n=>n.key)}hasRenderableParent(e){const i=this.findLoadedParent(e,0);return!!i&&this._isIdRenderable(i.tileID.key)}_isIdRenderable(e,i){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(i||!this._tiles[e].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const e in this._tiles)this._tiles[e].state!=="errored"&&this._reloadTile(+e,"reloading")}}_reloadTile(e,i){const n=this._tiles[e];n&&(n.state!=="loading"&&(n.state=i),this._loadTile(n,this._tileLoaded.bind(this,n,e,i)))}_tileLoaded(e,i,n,s){if(s)if(e.state="errored",s.status!==404)this._source.fire(new Sr(s,{tile:e}));else if(this._source.type==="raster-dem"&&this.usedForTerrain&&this.map.painter.terrain){const c=this.map.painter.terrain;this.update(this.transform,c.getScaledDemTileSize(),!0),c.resetTileLookupCache(this.id)}else this.update(this.transform);else e.timeAdded=Er.now(),n==="expired"&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(i,e),this._source.type==="raster-dem"&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),this._source.fire(new gn("data",{dataType:"source",tile:e,coord:e.tileID,sourceCacheId:this.id}))}_backfillDEM(e){const i=this.getRenderableIds();for(let s=0;s1||(Math.abs(u)>1&&(Math.abs(u+m)===1?u+=m:Math.abs(u-m)===1&&(u-=m)),c.dem&&s.dem&&(s.dem.backfillBorder(c.dem,u,p),s.neighboringTiles&&s.neighboringTiles[_]&&(s.neighboringTiles[_].backfilled=!0)))}}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._tiles[e]}_retainLoadedChildren(e,i,n,s){for(const c in this._tiles){let u=this._tiles[c];if(s[c]||!u.hasData()||u.tileID.overscaledZ<=i||u.tileID.overscaledZ>n)continue;let p=u.tileID;for(;u&&u.tileID.overscaledZ>i+1;){const _=u.tileID.scaledTo(u.tileID.overscaledZ-1);u=this._tiles[_.key],u&&u.hasData()&&(p=_)}let m=p;for(;m.overscaledZ>i;)if(m=m.scaledTo(m.overscaledZ-1),e[m.key]){s[p.key]=p;break}}}findLoadedParent(e,i){if(e.key in this._loadedParentTiles){const n=this._loadedParentTiles[e.key];return n&&n.tileID.overscaledZ>=i?n:null}for(let n=e.overscaledZ-1;n>=i;n--){const s=e.scaledTo(n),c=this._getLoadedTile(s);if(c)return c}}_getLoadedTile(e){const i=this._tiles[e.key];return i&&i.hasData()?i:this._cache.getByKey(this._source.reparseOverscaled?e.wrapped().key:e.canonical.key)}updateCacheSize(e,i){i=i||this._source.tileSize;const n=Math.ceil(e.width/i)+1,s=Math.ceil(e.height/i)+1,c=Math.floor(n*s*5),u=typeof this._minTileCacheSize=="number"?Math.max(this._minTileCacheSize,c):c,p=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,u):u;this._cache.setMaxSize(p)}handleWrapJump(e){const i=Math.round((e-(this._prevLng===void 0?e:this._prevLng))/360);if(this._prevLng=e,i){const n={};for(const s in this._tiles){const c=this._tiles[s];c.tileID=c.tileID.unwrapTo(c.tileID.wrap+i),n[c.tileID.key]=c}this._tiles=n;for(const s in this._timers)clearTimeout(this._timers[s]),delete this._timers[s];for(const s in this._tiles)this._setTileReloadTimer(+s,this._tiles[s])}}update(e,i,n){if(this.transform=e,!this._sourceLoaded||this._paused||this.transform.freezeTileCoverage||this.usedForTerrain&&!n)return;let s;this.updateCacheSize(e,i),this.transform.projection.name!=="globe"&&this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?s=e.getVisibleUnwrappedCoordinates(this._source.tileID).map(p=>new Pi(p.canonical.z,p.wrap,p.canonical.z,p.canonical.x,p.canonical.y)):(s=e.coveringTiles({tileSize:i||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!n,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain}),this._source.hasTile&&(s=s.filter(p=>this._source.hasTile(p)))):s=[];const c=this._updateRetainedTiles(s);if(vf(this._source.type)&&s.length!==0){const p={},m={},_=Object.keys(c);for(const b of _){const w=c[b],S=this._tiles[b];if(!S||S.fadeEndTime&&S.fadeEndTime<=Er.now())continue;const M=this.findLoadedParent(w,Math.max(w.overscaledZ-fs.maxOverzooming,this._source.minzoom));M&&(this._addTile(M.tileID),p[M.tileID.key]=M.tileID),m[b]=w}const x=s[s.length-1].overscaledZ;for(const b in this._tiles){const w=this._tiles[b];if(c[b]||!w.hasData())continue;let S=w.tileID;for(;S.overscaledZ>x;){S=S.scaledTo(S.overscaledZ-1);const M=this._tiles[S.key];if(M&&M.hasData()&&m[S.key]){c[b]=w.tileID;break}}}for(const b in p)c[b]||(this._coveredTiles[b]=!0,c[b]=p[b])}for(const p in c)this._tiles[p].clearFadeHold();const u=function(p,m){const _=[];for(const x in p)x in m||_.push(x);return _}(this._tiles,c);for(const p of u){const m=this._tiles[p];m.hasSymbolBuckets&&!m.holdingForFade()?m.setHoldDuration(this.map._fadeDuration):m.hasSymbolBuckets&&!m.symbolFadeFinished()||this._removeTile(+p)}this._updateLoadedParentTileCache(),this._onlySymbols&&this._source.afterUpdate&&this._source.afterUpdate()}releaseSymbolFadeTiles(){for(const e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(+e)}_updateRetainedTiles(e){const i={};if(e.length===0)return i;const n={},s=e.reduce((_,x)=>Math.min(_,x.overscaledZ),1/0),c=e[0].overscaledZ,u=Math.max(c-fs.maxOverzooming,this._source.minzoom),p=Math.max(c+fs.maxUnderzooming,this._source.minzoom),m={};for(const _ of e){const x=this._addTile(_);i[_.key]=_,x.hasData()||s=this._source.maxzoom){const w=_.children(this._source.maxzoom)[0],S=this.getTile(w);if(S&&S.hasData()){i[w.key]=w;continue}}else{const w=_.children(this._source.maxzoom);if(i[w[0].key]&&i[w[1].key]&&i[w[2].key]&&i[w[3].key])continue}let b=x.wasRequested();for(let w=_.overscaledZ-1;w>=u;--w){const S=_.scaledTo(w);if(n[S.key]||(n[S.key]=!0,x=this.getTile(S),!x&&b&&(x=this._addTile(S)),x&&(i[S.key]=S,b=x.wasRequested(),x.hasData())))break}}return i}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const e in this._tiles){const i=[];let n,s=this._tiles[e].tileID;for(;s.overscaledZ>0;){if(s.key in this._loadedParentTiles){n=this._loadedParentTiles[s.key];break}i.push(s.key);const c=s.scaledTo(s.overscaledZ-1);if(n=this._getLoadedTile(c),n)break;s=c}for(const c of i)this._loadedParentTiles[c]=n}}_addTile(e){let i=this._tiles[e.key];if(i)return i;i=this._cache.getAndRemove(e),i&&(this._setTileReloadTimer(e.key,i),i.tileID=e,this._state.initializeTileState(i,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,i)));const n=!!i;if(!n){const s=this.map?this.map.painter:null;i=new Zu(e,this._source.tileSize*e.overscaleFactor(),this.transform.tileZoom,s,this._isRaster),this._loadTile(i,this._tileLoaded.bind(this,i,e.key,i.state))}return i?(i.uses++,this._tiles[e.key]=i,n||this._source.fire(new gn("dataloading",{tile:i,coord:i.tileID,dataType:"source"})),i):null}_setTileReloadTimer(e,i){e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);const n=i.getExpiryTimeout();n&&(this._timers[e]=setTimeout(()=>{this._reloadTile(e,"expired"),delete this._timers[e]},n))}_removeTile(e){const i=this._tiles[e];i&&(i.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),i.uses>0||(i.hasData()&&i.state!=="reloading"?this._cache.add(i.tileID,i,i.getExpiryTimeout()):(i.aborted=!0,this._abortTile(i),this._unloadTile(i))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const e in this._tiles)this._removeTile(+e);this._source._clear&&this._source._clear(),this._cache.reset(),this.map&&this.usedForTerrain&&this.map.painter.terrain&&this.map.painter.terrain.resetTileLookupCache(this.id)}tilesIn(e,i,n){const s=[],c=this.transform;if(!c)return s;const u=c.projection.name==="globe",p=tn(c.center.lng);for(const m in this._tiles){const _=this._tiles[m];if(n&&_.clearQueryDebugViz(),_.holdingForFade())continue;let x;if(u){const b=_.tileID.canonical;if(b.z===0){const w=[Math.abs(ct(p,...Kl(b,-1))-p),Math.abs(ct(p,...Kl(b,1))-p)];x=[0,2*w.indexOf(Math.min(...w))-1]}else{const w=[Math.abs(ct(p,...Kl(b,-1))-p),Math.abs(ct(p,...Kl(b,0))-p),Math.abs(ct(p,...Kl(b,1))-p)];x=[w.indexOf(Math.min(...w))-1]}}else x=[0];for(const b of x){const w=e.containsTile(_,c,i,b);w&&s.push(w)}}return s}getVisibleCoordinates(e){const i=this.getRenderableIds(e).map(n=>this._tiles[n].tileID);for(const n of i)n.projMatrix=this.transform.calculateProjMatrix(n.toUnwrapped());return i}hasTransition(){if(this._source.hasTransition())return!0;if(vf(this._source.type))for(const e in this._tiles){const i=this._tiles[e];if(i.fadeEndTime!==void 0&&i.fadeEndTime>=Er.now())return!0}return!1}setFeatureState(e,i,n){this._state.updateState(e=e||"_geojsonTileLayer",i,n)}removeFeatureState(e,i,n){this._state.removeFeatureState(e=e||"_geojsonTileLayer",i,n)}getFeatureState(e,i){return this._state.getState(e=e||"_geojsonTileLayer",i)}setDependencies(e,i,n){const s=this._tiles[e];s&&s.setDependencies(i,n)}reloadTilesForDependencies(e,i){for(const n in this._tiles)this._tiles[n].hasDependency(e,i)&&this._reloadTile(+n,"reloading");this._cache.filter(n=>!n.hasDependency(e,i))}_preloadTiles(e,i){if(!this._sourceLoaded){const p=()=>{this._sourceLoaded&&(this._source.off("data",p),this._preloadTiles(e,i))};return void this._source.on("data",p)}const n=new Map,s=Array.isArray(e)?e:[e],c=this.map.painter.terrain,u=this.usedForTerrain&&c?c.getScaledDemTileSize():this._source.tileSize;for(const p of s){const m=p.coveringTiles({tileSize:u,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!this.usedForTerrain,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain});for(const _ of m)n.set(_.key,_);this.usedForTerrain&&p.updateElevation(!1)}ai(Array.from(n.values()),(p,m)=>{const _=new Zu(p,this._source.tileSize*p.overscaleFactor(),this.transform.tileZoom,this.map.painter,this._isRaster);this._loadTile(_,x=>{this._source.type==="raster-dem"&&_.dem&&this._backfillDEM(_),m(x,_)})},i)}}function xf(t,e){const i=Math.abs(2*t.wrap)-+(t.wrap<0),n=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||n-i||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function vf(t){return t==="raster"||t==="image"||t==="video"||t==="custom"}function Kl(t,e){const i=1<=0&&b[3]>=0&&m.insert(p,b[0],b[1],b[2],b[3])}}loadVTLayers(){if(!this.vtLayers){this.vtLayers=new Cu(new uh(this.rawTileData)).layers,this.sourceLayerCoder=new sf(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]),this.vtFeatures={};for(const e in this.vtLayers)this.vtFeatures[e]=[]}return this.vtLayers}query(e,i,n,s){this.loadVTLayers();const c=e.params||{},u=Xs(c.filter),p=e.tileResult,m=e.transform,_=p.bufferedTilespaceBounds,x=this.grid.query(_.min.x,_.min.y,_.max.x,_.max.y,(M,C,D,U)=>Zd(p.bufferedTilespaceGeometry,M,C,D,U));x.sort(dg);let b=null;m.elevation&&x.length>0&&(b=Sh.create(m.elevation,this.tileID));const w={};let S;for(let M=0;M(U||(U=Pn(q,this.tileID.canonical,e.tileTransform)),V.queryIntersectsFeature(p,q,$,U,this.z,e.transform,e.pixelPosMatrix,b,X)))}return w}loadMatchingFeature(e,i,n,s,c,u,p,m,_){const{featureIndex:x,bucketIndex:b,sourceLayerIndex:w,layoutVertexArrayOffset:S}=i,M=this.bucketLayerIDs[b];if(s&&!function(q,V){for(let $=0;$=0)return!0;return!1}(s,M))return;const C=this.sourceLayerCoder.decode(w),D=this.vtLayers[C].feature(x);if(n.needGeometry){const q=hs(D,!0);if(!n.filter(new v(this.tileID.overscaledZ),q,this.tileID.canonical))return}else if(!n.filter(new v(this.tileID.overscaledZ),D))return;const U=this.getId(D,C);for(let q=0;q{const p=e instanceof F?e.get(u):null;return p&&p.evaluate?p.evaluate(i,n,s):p})}function dg(t,e){return e-t}Ue(bf,"FeatureIndex",{omit:["rawTileData","sourceLayerCoder"]});class Tf{constructor(e,i){this.width=e,this.height=i,this.nextRow=0,this.image=new kn({width:e,height:i}),this.positions={},this.uploaded=!1}getDash(e,i){const n=this.getKey(e,i);return this.positions[n]}trim(){const e=this.width,i=this.height=wr(this.nextRow);this.image.resize({width:e,height:i})}getKey(e,i){return e.join(",")+i}getDashRanges(e,i,n){const s=[];let c=e.length%2==1?-e[e.length-1]*n:0,u=e[0]*n,p=!0;s.push({left:c,right:u,isDash:p,zeroLength:e[0]===0});let m=e[0];for(let _=1;_1&&(m=e[++p]);const x=Math.abs(_-m.left),b=Math.abs(_-m.right),w=Math.min(x,b);let S;const M=c/n*(s+1);if(m.isDash){const C=s-Math.abs(M);S=Math.sqrt(w*w+C*C)}else S=s-Math.sqrt(w*w+M*M);this.image.data[u+_]=Math.max(0,Math.min(255,S+128))}}}addRegularDash(e,i){for(let m=e.length-1;m>=0;--m){const _=e[m],x=e[m+1];_.zeroLength?e.splice(m,1):x&&x.isDash===_.isDash&&(x.left=_.left,e.splice(m,1))}const n=e[0],s=e[e.length-1];n.isDash===s.isDash&&(n.left=s.left-this.width,s.right=n.right+this.width);const c=this.width*this.nextRow;let u=0,p=e[u];for(let m=0;m1&&(p=e[++u]);const _=Math.abs(m-p.left),x=Math.abs(m-p.right),b=Math.min(_,x);this.image.data[c+m]=Math.max(0,Math.min(255,(p.isDash?b:-b)+i+128))}}addDash(e,i){const n=this.getKey(e,i);if(this.positions[n])return this.positions[n];const s=i==="round",c=s?7:0,u=2*c+1;if(this.nextRow+u>this.height)return Ut("LineAtlas out of space"),null;e.length===0&&e.push(1);let p=0;for(let x=0;x=ye.maxzoom||ye.visibility!=="none"&&(Ku(ue,this.zoom,n),(m[ye.id]=ye.createBucket({index:p.bucketLayerIDs.length,layers:ue,zoom:this.zoom,canonical:this.canonical,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:me,sourceID:this.source,enableTerrain:this.enableTerrain,projection:this.projection.spec,availableImages:n})).populate(Ee,x,this.tileID.canonical,this.tileTransform),p.bucketLayerIDs.push(ue.map(xe=>xe.id)))}}let w,S,M,C;_.trim();const D={type:"maybePrepare",isSymbolTile:this.isSymbolTile,zoom:this.zoom},U=()=>{if(w)return c(w);if(S&&M&&C){const X=new Sf(S),W=new Pp(M,C);for(const ce in m){const se=m[ce];se instanceof go?(Ku(se.layers,this.zoom,n),U_(se,S,X.positions,M,W.iconPositions,this.showCollisionBoxes,n,this.tileID.canonical,this.tileZoom,this.projection)):se.hasPattern&&(se instanceof lh||se instanceof rh||se instanceof Fl)&&(Ku(se.layers,this.zoom,n),se.addFeatures(x,this.tileID.canonical,W.patternPositions,n,this.tileTransform))}this.status="done",c(null,{buckets:$r(m).filter(ce=>!ce.isEmpty()),featureIndex:p,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:X.image,lineAtlas:_,imageAtlas:W,glyphMap:this.returnDependencies?S:null,iconMap:this.returnDependencies?M:null,glyphPositions:this.returnDependencies?X.positions:null})}},q=pt(x.glyphDependencies,X=>Object.keys(X).map(Number));Object.keys(q).length?s.send("getGlyphs",{uid:this.uid,stacks:q},(X,W)=>{w||(w=X,S=W,U())},void 0,!1,D):S={};const V=Object.keys(x.iconDependencies);V.length?s.send("getImages",{icons:V,source:this.source,tileID:this.tileID,type:"icons"},(X,W)=>{w||(w=X,M=W,U())},void 0,!1,D):M={};const $=Object.keys(x.patternDependencies);$.length?s.send("getImages",{icons:$,source:this.source,tileID:this.tileID,type:"patterns"},(X,W)=>{w||(w=X,C=W,U())},void 0,!1,D):C={},U()}}function Ku(t,e,i){const n=new v(e);for(const s of t)s.recalculate(n,i)}class Mf{constructor(e){this.entries={},this.scheduler=e}request(e,i,n,s){const c=this.entries[e]=this.entries[e]||{callbacks:[]};if(c.result){const[u,p]=c.result;return this.scheduler?this.scheduler.add(()=>{s(u,p)},i):s(u,p),()=>{}}return c.callbacks.push(s),c.cancel||(c.cancel=n((u,p)=>{c.result=[u,p];for(const m of c.callbacks)this.scheduler?this.scheduler.add(()=>{m(u,p)},i):m(u,p);setTimeout(()=>delete this.entries[e],3e3)})),()=>{c.result||(c.callbacks=c.callbacks.filter(u=>u!==s),c.callbacks.length||(c.cancel(),delete this.entries[e]))}}}function Af(t,e,i){const n=JSON.stringify(t.request);return t.data&&(this.deduped.entries[n]={result:[null,t.data]}),this.deduped.request(n,{type:"parseTile",isSymbolTile:t.isSymbolTile,zoom:t.tileZoom},s=>{const c=$n(t.request,(u,p,m,_)=>{u?s(u):p&&s(null,{vectorTile:i?void 0:new Cu(new uh(p)),rawData:p,cacheControl:m,expires:_})});return()=>{c.cancel(),s()}},e)}const If=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class Yu{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[i,n]=new Uint8Array(e,0,2);if(i!==219)throw new Error("Data does not appear to be in a KDBush format.");const s=n>>4;if(s!==1)throw new Error(`Got v${s} data when expected v1.`);const c=If[15&n];if(!c)throw new Error("Unrecognized array type.");const[u]=new Uint16Array(e,2,1),[p]=new Uint32Array(e,4,1);return new Yu(p,u,c,e)}constructor(e,i=64,n=Float64Array,s){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+i,2),65535),this.ArrayType=n,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const c=If.indexOf(this.ArrayType),u=2*e*this.ArrayType.BYTES_PER_ELEMENT,p=e*this.IndexArrayType.BYTES_PER_ELEMENT,m=(8-p%8)%8;if(c<0)throw new Error(`Unexpected typed array class: ${n}.`);s&&s instanceof ArrayBuffer?(this.data=s,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+p+m,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+u+p+m),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+p+m,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+c]),new Uint16Array(this.data,2,1)[0]=i,new Uint32Array(this.data,4,1)[0]=e)}add(e,i){const n=this._pos>>1;return this.ids[n]=n,this.coords[this._pos++]=e,this.coords[this._pos++]=i,n}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return Ju(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,i,n,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:c,coords:u,nodeSize:p}=this,m=[0,c.length-1,0],_=[];for(;m.length;){const x=m.pop()||0,b=m.pop()||0,w=m.pop()||0;if(b-w<=p){for(let D=w;D<=b;D++){const U=u[2*D],q=u[2*D+1];U>=e&&U<=n&&q>=i&&q<=s&&_.push(c[D])}continue}const S=w+b>>1,M=u[2*S],C=u[2*S+1];M>=e&&M<=n&&C>=i&&C<=s&&_.push(c[S]),(x===0?e<=M:i<=C)&&(m.push(w),m.push(S-1),m.push(1-x)),(x===0?n>=M:s>=C)&&(m.push(S+1),m.push(b),m.push(1-x))}return _}within(e,i,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:c,nodeSize:u}=this,p=[0,s.length-1,0],m=[],_=n*n;for(;p.length;){const x=p.pop()||0,b=p.pop()||0,w=p.pop()||0;if(b-w<=u){for(let D=w;D<=b;D++)zf(c[2*D],c[2*D+1],e,i)<=_&&m.push(s[D]);continue}const S=w+b>>1,M=c[2*S],C=c[2*S+1];zf(M,C,e,i)<=_&&m.push(s[S]),(x===0?e-n<=M:i-n<=C)&&(p.push(w),p.push(S-1),p.push(1-x)),(x===0?e+n>=M:i+n>=C)&&(p.push(S+1),p.push(b),p.push(1-x))}return m}}function Ju(t,e,i,n,s,c){if(s-n<=i)return;const u=n+s>>1;Cf(t,e,u,n,s,c),Ju(t,e,i,n,u-1,1-c),Ju(t,e,i,u+1,s,1-c)}function Cf(t,e,i,n,s,c){for(;s>n;){if(s-n>600){const _=s-n+1,x=i-n+1,b=Math.log(_),w=.5*Math.exp(2*b/3),S=.5*Math.sqrt(b*w*(_-w)/_)*(x-_/2<0?-1:1);Cf(t,e,i,Math.max(n,Math.floor(i-x*w/_+S)),Math.min(s,Math.floor(i+(_-x)*w/_+S)),c)}const u=e[2*i+c];let p=n,m=s;for(Yl(t,e,n,i),e[2*s+c]>u&&Yl(t,e,n,s);pu;)m--}e[2*n+c]===u?Yl(t,e,n,m):(m++,Yl(t,e,m,s)),m<=i&&(n=m+1),i<=m&&(s=m-1)}}function Yl(t,e,i,n){Qu(t,i,n),Qu(e,2*i,2*n),Qu(e,2*i+1,2*n+1)}function Qu(t,e,i){const n=t[e];t[e]=t[i],t[i]=n}function zf(t,e,i,n){const s=t-i,c=e-n;return s*s+c*c}a.ARRAY_TYPE=qi,a.AUTH_ERR_MSG=H,a.Aabb=zi,a.Actor=class{constructor(t,e,i){this.target=t,this.parent=e,this.mapId=i,this.callbacks={},this.cancelCallbacks={},dn(["receive"],this),this.target.addEventListener("message",this.receive,!1),this.globalScope=Tr()?t:Se,this.scheduler=new sg}send(t,e,i,n,s=!1,c){const u=Math.round(1e18*Math.random()).toString(36).substring(0,10);i&&(i.metadata=c,this.callbacks[u]=i);const p=Nn(this.globalScope)?void 0:[];return this.target.postMessage({id:u,type:t,hasCallback:!!i,targetMapId:n,mustQueue:s,sourceMapId:this.mapId,data:lo(e,p)},p),{cancel:()=>{i&&delete this.callbacks[u],this.target.postMessage({id:u,type:"",targetMapId:n,sourceMapId:this.mapId})}}}receive(t){const e=t.data,i=e.id;if(i&&(!e.targetMapId||this.mapId===e.targetMapId))if(e.type===""){const n=this.cancelCallbacks[i];delete this.cancelCallbacks[i],n&&n.cancel()}else if(e.mustQueue||Tr()){const n=this.callbacks[i];this.cancelCallbacks[i]=this.scheduler.add(()=>this.processTask(i,e),n&&n.metadata||{type:"message"})}else this.processTask(i,e)}processTask(t,e){if(e.type===""){const i=this.callbacks[t];delete this.callbacks[t],i&&(e.error?i(Sn(e.error)):i(null,Sn(e.data)))}else{const i=Nn(this.globalScope)?void 0:[],n=e.hasCallback?(c,u)=>{delete this.cancelCallbacks[t],this.target.postMessage({id:t,type:"",sourceMapId:this.mapId,error:c?lo(c):null,data:lo(u,i)},i)}:c=>{},s=Sn(e.data);if(this.parent[e.type])this.parent[e.type](e.sourceMapId,s,n);else if(this.parent.getWorkerSource){const c=e.type.split(".");this.parent.getWorkerSource(e.sourceMapId,c[0],s.source)[c[1]](s,n)}else n(new Error(`Could not find function ${e.type}`))}}remove(){this.scheduler.remove(),this.target.removeEventListener("message",this.receive,!1)}},a.CanonicalTileID=ah,a.Color=Zt,a.ColorMode=sn,a.CullFaceMode=jr,a.DEMData=Eh,a.DataConstantProperty=I,a.DedupedRequest=Mf,a.DepthMode=xa,a.EXTENT=Ze,a.Elevation=class{isDataAvailableAtPoint(t){const e=this._source();if(this.isUsingMockSource()||!e||t.y<0||t.y>1)return!1;const i=e.getSource().maxzoom,n=1<1)return e;const s=n.getSource().maxzoom,c=1<{const c=this.getAtTileOffset(t,s.x,s.y),u=n.upVector(t.canonical,s.x,s.y);return rr(u,u,c*n.upVectorScale(t.canonical,e,i).metersToTile),u}}getForTilePoints(t,e,i,n){if(this.isUsingMockSource())return!1;const s=Sh.create(this,t,n);return!!s&&(e.forEach(c=>{c[2]=this.exaggeration()*s.getElevationAt(c[0],c[1],i)}),!0)}getMinMaxForTile(t){if(this.isUsingMockSource())return null;const e=this.findDEMTileFor(t);if(!e||!e.dem)return null;const i=e.dem.tree,n=e.tileID,s=1<{let w=_===c-1?_-2:_===0?_:_-1;return w+=b?24575:0,[w,x]};for(let _=0;_this._skuTokenExpiresAt}transformRequest(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}}normalizeStyleURL(t,e){if(!ee(t))return t;const i=ke(t);return i.path=`/styles/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||e)}normalizeGlyphsURL(t,e){if(!ee(t))return t;const i=ke(t);return i.path=`/fonts/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||e)}normalizeSourceURL(t,e,i,n){if(!ee(t))return t;const s=ke(t);return s.path=`/v4/${s.authority}.json`,s.params.push("secure"),i&&s.params.push(`language=${i}`),n&&s.params.push(`worldview=${n}`),this._makeAPIURL(s,this._customAccessToken||e)}normalizeSpriteURL(t,e,i,n){const s=ke(t);return ee(t)?(s.path=`/styles/v1${s.path}/sprite${e}${i}`,this._makeAPIURL(s,this._customAccessToken||n)):(s.path+=`${e}${i}`,Ie(s))}normalizeTileURL(t,e,i){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!ee(t))return t;const n=ke(t);n.path=n.path.replace(/(\.(png|jpg)\d*)(?=$)/,`${e||i&&n.authority!=="raster"&&i===512?"@2x":""}${ht.supported?".webp":"$1"}`),n.authority==="raster"?n.path=`/${it.RASTER_URL_PREFIX}${n.path}`:(n.path=n.path.replace(/^.+\/v4\//,"/"),n.path=`/${it.TILE_URL_VERSION}${n.path}`);const s=this._customAccessToken||function(c){for(const u of c){const p=u.match(/^access_token=(.*)$/);if(p)return p[1]}return null}(n.params)||it.ACCESS_TOKEN;return it.REQUIRE_ACCESS_TOKEN&&s&&this._skuToken&&n.params.push(`sku=${this._skuToken}`),this._makeAPIURL(n,s)}canonicalizeTileURL(t,e){const i=ke(t);if(!i.path.match(/^(\/v4\/|\/raster\/v1\/)/)||!i.path.match(/\.[\w]+$/))return t;let n="mapbox://";i.path.match(/^\/raster\/v1\//)?n+=`raster/${i.path.replace(`/${it.RASTER_URL_PREFIX}/`,"")}`:n+=`tiles/${i.path.replace(`/${it.TILE_URL_VERSION}/`,"")}`;let s=i.params;return e&&(s=s.filter(c=>!c.match(/^access_token=/))),s.length&&(n+=`?${s.join("&")}`),n}canonicalizeTileset(t,e){const i=!!e&&ee(e),n=[];for(const s of t.tiles||[])ne(s)?n.push(this.canonicalizeTileURL(s,i)):n.push(s);return n}_makeAPIURL(t,e){const i="See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes",n=ke(it.API_URL);if(t.protocol=n.protocol,t.authority=n.authority,t.protocol==="http"){const s=t.params.indexOf("secure");s>=0&&t.params.splice(s,1)}if(n.path!=="/"&&(t.path=`${n.path}${t.path}`),!it.REQUIRE_ACCESS_TOKEN)return Ie(t);if(e=e||it.ACCESS_TOKEN,!this._silenceAuthErrors){if(!e)throw new Error(`An API access token is required to use Mapbox GL. ${i}`);if(e[0]==="s")throw new Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${i}`)}return t.params=t.params.filter(s=>s.indexOf("access_token")===-1),t.params.push(`access_token=${e||""}`),Ie(t)}},a.ResourceType=fn,a.SegmentVector=Yt,a.SourceCache=fs,a.StencilMode=Wu,a.StructArrayLayout1ui2=Zi,a.StructArrayLayout2f1f2i16=qe,a.StructArrayLayout2i4=Te,a.StructArrayLayout2ui4=ui,a.StructArrayLayout3f12=ot,a.StructArrayLayout3ui6=je,a.StructArrayLayout4i8=ge,a.StructArrayLayout5f20=St,a.Texture=Hl,a.Tile=Zu,a.Transitionable=A,a.Uniform1f=$c,a.Uniform1i=class extends In{constructor(t){super(t),this.current=0}set(t,e,i){this.fetchUniformLocation(t,e)&&this.current!==i&&(this.current=i,this.gl.uniform1i(this.location,i))}},a.Uniform2f=class extends In{constructor(t){super(t),this.current=[0,0]}set(t,e,i){this.fetchUniformLocation(t,e)&&(i[0]===this.current[0]&&i[1]===this.current[1]||(this.current=i,this.gl.uniform2f(this.location,i[0],i[1])))}},a.Uniform3f=class extends In{constructor(t){super(t),this.current=[0,0,0]}set(t,e,i){this.fetchUniformLocation(t,e)&&(i[0]===this.current[0]&&i[1]===this.current[1]&&i[2]===this.current[2]||(this.current=i,this.gl.uniform3f(this.location,i[0],i[1],i[2])))}},a.Uniform4f=cd,a.UniformColor=hd,a.UniformMatrix2f=class extends In{constructor(t){super(t),this.current=$f}set(t,e,i){if(this.fetchUniformLocation(t,e)){for(let n=0;n<4;n++)if(i[n]!==this.current[n]){this.current=i,this.gl.uniformMatrix2fv(this.location,!1,i);break}}}},a.UniformMatrix3f=class extends In{constructor(t){super(t),this.current=Gf}set(t,e,i){if(this.fetchUniformLocation(t,e)){for(let n=0;n<9;n++)if(i[n]!==this.current[n]){this.current=i,this.gl.uniformMatrix3fv(this.location,!1,i);break}}}},a.UniformMatrix4f=class extends In{constructor(t){super(t),this.current=jf}set(t,e,i){if(this.fetchUniformLocation(t,e)){if(i[12]!==this.current[12]||i[0]!==this.current[0])return this.current=i,void this.gl.uniformMatrix4fv(this.location,!1,i);for(let n=1;n<16;n++)if(i[n]!==this.current[n]){this.current=i,this.gl.uniformMatrix4fv(this.location,!1,i);break}}}},a.UnwrappedTileID=_p,a.ValidationError=Fe,a.VectorTileFeature=oh,a.VectorTileWorkerSource=class extends Po{constructor(t,e,i,n,s){super(),this.actor=t,this.layerIndex=e,this.availableImages=i,this.loadVectorData=s||Af,this.loading={},this.loaded={},this.deduped=new Mf(t.scheduler),this.isSpriteLoaded=n,this.scheduler=t.scheduler}loadTile(t,e){const i=t.uid,n=t&&t.request,s=n&&n.collectResourceTiming,c=this.loading[i]=new pg(t);c.abort=this.loadVectorData(t,(u,p)=>{const m=!this.loading[i];if(delete this.loading[i],m||u||!p)return c.status="done",m||(this.loaded[i]=c),e(u);const _=p.rawData,x={};p.expires&&(x.expires=p.expires),p.cacheControl&&(x.cacheControl=p.cacheControl),c.vectorTile=p.vectorTile||new Cu(new uh(_));const b=()=>{c.parse(c.vectorTile,this.layerIndex,this.availableImages,this.actor,(w,S)=>{if(w||!S)return e(w);const M={};if(s){const C=Ea(n);C.length>0&&(M.resourceTiming=JSON.parse(JSON.stringify(C)))}e(null,Wt({rawTileData:_.slice(0)},S,x,M))})};this.isSpriteLoaded?b():this.once("isSpriteLoaded",()=>{this.scheduler?this.scheduler.add(b,{type:"parseTile",isSymbolTile:t.isSymbolTile,zoom:t.tileZoom}):b()}),this.loaded=this.loaded||{},this.loaded[i]=c})}reloadTile(t,e){const i=this.loaded,n=t.uid,s=this;if(i&&i[n]){const c=i[n];c.showCollisionBoxes=t.showCollisionBoxes,c.enableTerrain=!!t.enableTerrain,c.projection=t.projection,c.tileTransform=ps(t.tileID.canonical,t.projection);const u=(p,m)=>{const _=c.reloadCallback;_&&(delete c.reloadCallback,c.parse(c.vectorTile,s.layerIndex,this.availableImages,s.actor,_)),e(p,m)};c.status==="parsing"?c.reloadCallback=u:c.status==="done"&&(c.vectorTile?c.parse(c.vectorTile,this.layerIndex,this.availableImages,this.actor,u):u())}}abortTile(t,e){const i=t.uid,n=this.loading[i];n&&(n.abort&&n.abort(),delete this.loading[i]),e()}removeTile(t,e){const i=this.loaded,n=t.uid;i&&i[n]&&delete i[n],e()}},a.WritingMode=or,a.ZoomDependentExpression=Ho,a.add=zn,a.addDynamicAttributes=bh,a.adjoint=function(t,e){var i=e[0],n=e[1],s=e[2],c=e[3],u=e[4],p=e[5],m=e[6],_=e[7],x=e[8];return t[0]=u*x-p*_,t[1]=s*_-n*x,t[2]=n*p-s*u,t[3]=p*m-c*x,t[4]=i*x-s*m,t[5]=s*c-i*p,t[6]=c*_-u*m,t[7]=n*m-i*_,t[8]=i*u-n*c,t},a.asyncAll=ai,a.bezier=Eo,a.bindAll=dn,a.boundsAttributes=cf,a.bufferConvexPolygon=function(t,e){const i=[];for(let n=0;nws&&(t.getActor().send("enforceCacheSizeLimit",bs),Co=0)},a.calculateGlobeLabelMatrix=function(t,e){const{x:i,y:n}=t.point,s=Dd(i,n,t.worldSize/t._pixelsPerMercatorPixel,0,0);return os(s,s,hu(en(e)))},a.calculateGlobeMatrix=function(t){const{x:e,y:i}=t.point,{lng:n,lat:s}=t._center;return Dd(e,i,t.worldSize,n,s)},a.calculateGlobeMercatorMatrix=function(t){const e=t.pixelsPerMeter,i=e/Ur(1,t.center.lat),n=Or(new Float64Array(16));return bl(n,n,[t.point.x,t.point.y,0]),ss(n,n,[i,i,e]),Float32Array.from(n)},a.circumferenceAtLatitude=du,a.clamp=ct,a.clearTileCache=function(t){if(!Io())return;const e=Se.caches.delete(jn);t&&e.catch(t).then(()=>t())},a.clipLine=$p,a.clone=function(t){var e=new qi(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},a.clone$1=Li,a.collisionCircleLayout=u_,a.config=it,a.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},a.create=function(){var t=new qi(16);return qi!=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},a.create$1=pd,a.createExpression=oo,a.createLayout=te,a.createStyleLayer=function(t){return t.type==="custom"?new ig(t):new ng[t.type](t)},a.cross=ru,a.degToRad=dt,a.distance=function(t,e){return Math.hypot(e[0]-t[0],e[1]-t[1],e[2]-t[2])},a.div=function(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t[2]=e[2]/i[2],t},a.dot=pr,a.earthRadius=Pl,a.ease=ys,a.easeCubicInOut=gs,a.ecefToLatLng=function([t,e,i]){const n=Math.hypot(t,e,i),s=Math.atan2(t,i),c=.5*Math.PI-Math.acos(-e/n);return new At(si(s),si(c))},a.emitValidationErrors=Fc,a.endsWith=Un,a.enforceCacheSizeLimit=function(t){pn(),Vi&&Vi.then(e=>{e.keys().then(i=>{for(let n=0;nc&&(n+=(t[s]-c)*(t[s]-c)),e[s]0){const M=180/n;fd(S,S,[M/_+1,0,0,0,M/x+1,0,-.5*M/b,.5*M/w,1])}return S[2]=m,S[5]=t.x,S[8]=t.y,S},a.getImage=G,a.getJSON=function(t,e){return _n(Wt(t,{type:"json"}),e)},a.getLatitudinalLod=function(t){const e=wi-5;t=ct(t,-e,e)/e*90;const i=Math.pow(Math.abs(Math.sin(dt(t))),3);return Math.round(i*(Il.length-1))},a.getMapSessionAPI=li,a.getPerformanceMeasurement=Ea,a.getProjection=nf,a.getRTLTextPluginStatus=f,a.getReferrer=mn,a.getTilePoint=function(t,{x:e,y:i},n=0){return new Le(((e-n)*t.scale-t.x)*Ze,(i*t.scale-t.y)*Ze)},a.getTileVec3=function(t,e,i=0){return ta(((e.x-i)*t.scale-t.x)*Ze,(e.y*t.scale-t.y)*Ze,Od(e.z,e.y))},a.getVideo=function(t,e){const i=Se.document.createElement("video");i.muted=!0,i.onloadstart=function(){e(null,i)};for(let n=0;n{}}},a.globeCenterToScreenPoint=function(t){const e=[0,0,0],i=Or(new Float64Array(16));return os(i,t.pixelMatrix,t.globeMatrix),qt(e,e,i),new Le(e[0],e[1])},a.globeDenormalizeECEF=hu,a.globeECEFOrigin=function(t,e){const i=[0,0,0];return qt(i,i,zl(en(e.canonical))),qt(i,i,t),i},a.globeMetersToEcef=Wc,a.globeNormalizeECEF=zl,a.globePixelsToTileUnits=function(t,e){return Ze/(512*Math.pow(2,t))*Hc(en(e))},a.globePoleMatrixForTile=function(t,e,i){const n=Or(new Float64Array(16)),s=(e/(1<0;return n===0&&!s&&!u&&c},a.identity=Or,a.identity$1=Td,a.invert=Qh,a.isFullscreen=function(){return!!Se.document.fullscreenElement||!!Se.document.webkitFullscreenElement},a.isLngLatBehindGlobe=uu,a.isMapAuthenticated=function(t){return Ti.has(t)},a.isMapboxURL=ee,a.isSafariWithAntialiasingBug=function(t){const e=t.navigator?t.navigator.userAgent:null;return!!Nn(t)&&e&&(e.match("Version/15.4")||e.match("Version/15.5")||e.match(/CPU (OS|iPhone OS) (15_4|15_5) like Mac OS X/))},a.latFromMercatorY=bi,a.latLngToECEF=ra,a.len=Qf,a.length=wl,a.length$1=function(t){return Math.hypot(t[0],t[1],t[2],t[3])},a.lngFromMercatorX=nr,a.loadVectorTile=Af,a.makeRequest=_n,a.mapValue=function(t,e,i,n,s){return ct((t-e)/(i-e)*(s-n)+n,n,s)},a.mercatorScale=Fd,a.mercatorXfromLng=tn,a.mercatorYfromLat=rn,a.mercatorZfromAltitude=Ur,a.mul=Yf,a.mul$1=Jf,a.multiply=os,a.multiply$1=fd,a.multiply$2=yd,a.nextPowerOfTwo=wr,a.normalize=Ci,a.normalize$1=em,a.normalize$2=bd,a.number=mt,a.ortho=function(t,e,i,n,s,c,u){var p=1/(e-i),m=1/(n-s),_=1/(c-u);return t[0]=-2*p,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*m,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*_,t[11]=0,t[12]=(e+i)*p,t[13]=(s+n)*m,t[14]=(u+c)*_,t[15]=1,t},a.pbf=Tp,a.perspective=function(t,e,i,n,s){var c,u=1/Math.tan(e/2);return t[0]=u/i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,s!=null&&s!==1/0?(t[10]=(s+n)*(c=1/(n-s)),t[14]=2*s*n*c):(t[10]=-1,t[14]=-2*n),t},a.pick=function(t,e){const i={};for(let n=0;n0&&i[0]<=t.width&&i[1]>0&&i[1]<=t.height&&!uu(t,new At(t.center.lat,90)),n[0]>0&&n[0]<=t.width&&n[1]>0&&n[1]<=t.height&&!uu(t,new At(t.center.lat,-90))]},a.polygonContainsPoint=us,a.polygonIntersectsBox=Zd,a.polygonIntersectsPolygon=Nd,a.polygonizeBounds=function(t,e,i=0,n=!0){const s=new Le(i,i),c=t.sub(s),u=e.add(s),p=[c,new Le(u.x,c.y),u,new Le(c.x,u.y)];return n&&p.push(c.clone()),p},a.posAttributes=Al,a.postMapLoadEvent=Xt,a.postPerformanceEvent=ri,a.postTurnstileEvent=ft,a.potpack=Du,a.prevPowerOfTwo=function(t){return t<=1?1:Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},a.radToDeg=si,a.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],a.registerForPluginStateChange=function(t){return t({pluginStatus:l,pluginURL:r}),d.on("pluginStateChange",t),t},a.removeAuthState=function(t){Ti.delete(t)},a.renderColorRamp=vu,a.resample=Ud,a.rotateX=eu,a.rotateX$1=Ed,a.rotateY=qc,a.rotateY$1=Sd,a.rotateZ=function(t,e,i){var n=Math.sin(i),s=Math.cos(i),c=e[0],u=e[1],p=e[2],m=e[3],_=e[4],x=e[5],b=e[6],w=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]=c*s+_*n,t[1]=u*s+x*n,t[2]=p*s+b*n,t[3]=m*s+w*n,t[4]=_*s-c*n,t[5]=x*s-u*n,t[6]=b*s-p*n,t[7]=w*s-m*n,t},a.rotateZ$1=function(t,e,i){i*=.5;var n=e[0],s=e[1],c=e[2],u=e[3],p=Math.sin(i),m=Math.cos(i);return t[0]=n*m+s*p,t[1]=s*m-n*p,t[2]=c*m+u*p,t[3]=u*m-c*p,t},a.scale=ss,a.scale$1=vd,a.scale$2=rr,a.scaleAndAdd=Sl,a.set=function(t,e,i,n){return t[0]=e,t[1]=i,t[2]=n,t},a.setCacheLimits=function(t,e){bs=t,ws=e},a.setColumn=function(t,e,i){t[4*e+0]=i[0],t[4*e+1]=i[1],t[4*e+2]=i[2],t[4*e+3]=i[3]},a.setRTLTextPlugin=function(t,e,i=!1){if(l===_l||l===gl||l===yl)throw new Error("setRTLTextPlugin cannot be called multiple times.");r=Er.resolveURL(t),l=_l,co=e,h(),i||g()},a.smoothstep=On,a.spec=fe,a.squaredLength=function(t){var e=t[0],i=t[1],n=t[2];return e*e+i*i+n*n},a.storeAuthState=function(t,e){e?Ti.add(t):Ti.delete(t)},a.sub=Fr,a.subtract=iu,a.symbolSize=d_,a.tileAABB=function(t,e,i,n,s,c,u,p,m){if(m.name==="globe")return om(t,e,new ah(i,n,s));const _=ps({z:i,x:n,y:s},m);return new zi([(c+_.x/_.scale)*e,e*(_.y/_.scale),u],[(c+_.x2/_.scale)*e,e*(_.y2/_.scale),p])},a.tileCornersToBounds=Xc,a.tileTransform=ps,a.transformMat3=function(t,e,i){var n=e[0],s=e[1],c=e[2];return t[0]=n*i[0]+s*i[3]+c*i[6],t[1]=n*i[1]+s*i[4]+c*i[7],t[2]=n*i[2]+s*i[5]+c*i[8],t},a.transformMat4=qt,a.transformMat4$1=as,a.transformQuat=xd,a.transitionTileAABBinECEF=zd,a.translate=bl,a.transpose=function(t,e){if(t===e){var i=e[1],n=e[2],s=e[5];t[1]=e[3],t[2]=e[6],t[3]=i,t[5]=e[7],t[6]=n,t[7]=s}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},a.triggerPluginCompletionEvent=o,a.uniqueId=Fn,a.updateGlobeVertexNormal=function(t,e,i,n,s){const c=5*e+2;t.float32[c+0]=i,t.float32[c+1]=n,t.float32[c+2]=s},a.validateCustomStyleLayer=function(t){const e=[],i=t.id;return i===void 0&&e.push({message:`layers.${i}: missing required property "id"`}),t.render===void 0&&e.push({message:`layers.${i}: missing required method "render"`}),t.renderingMode&&t.renderingMode!=="2d"&&t.renderingMode!=="3d"&&e.push({message:`layers.${i}: property "renderingMode" must be either "2d" or "3d"`}),e},a.validateFilter=t=>$i(es(t)),a.validateFog=t=>$i(Rc(t)),a.validateLayer=t=>$i(Pc(t)),a.validateLight=t=>$i(Lc(t)),a.validateSource=t=>$i(Dc(t)),a.validateStyle=Oc,a.validateTerrain=t=>$i(ul(t)),a.values=$r,a.vectorTile=nh,a.version=xr,a.warnOnce=Ut,a.window=Se,a.wrap=oi}),wo(["./shared"],function(a){function Se(Z){if(typeof Z=="number"||typeof Z=="boolean"||typeof Z=="string"||Z==null)return JSON.stringify(Z);if(Array.isArray(Z)){let P="[";for(const G of Z)P+=`${Se(G)},`;return`${P}]`}let z="{";for(const P of Object.keys(Z).sort())z+=`${P}:${Se(Z[P])},`;return`${z}}`}function xr(Z){let z="";for(const P of a.refProperties)z+=`/${Se(Z[P])}`;return z}class Ki{constructor(z){this.keyCache={},z&&this.replace(z)}replace(z){this._layerConfigs={},this._layers={},this.update(z,[])}update(z,P){for(const H of z)this._layerConfigs[H.id]=H,(this._layers[H.id]=a.createStyleLayer(H)).compileFilter(),this.keyCache[H.id]&&delete this.keyCache[H.id];for(const H of P)delete this.keyCache[H],delete this._layerConfigs[H],delete this._layers[H];this.familiesBySource={};const G=function(H,ee){const ne={};for(let Q=0;Qthis._layers[ke.id]),ne=ee[0];if(ne.visibility==="none")continue;const re=ne.source||"";let Q=this.familiesBySource[re];Q||(Q=this.familiesBySource[re]={});const de=ne.sourceLayer||"_geojsonTileLayer";let Pe=Q[de];Pe||(Pe=Q[de]=[]),Pe.push(ee)}}}class it{loadTile(z,P){const{uid:G,encoding:H,rawImageData:ee,padding:ne,buildQuadTree:re}=z,Q=a.window.ImageBitmap&&ee instanceof a.window.ImageBitmap?this.getImageData(ee,ne):ee;P(null,new a.DEMData(G,Q,H,ne<1,re))}getImageData(z,P){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(z.width,z.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=z.width,this.offscreenCanvas.height=z.height,this.offscreenCanvasContext.drawImage(z,0,0,z.width,z.height);const G=this.offscreenCanvasContext.getImageData(-P,-P,z.width+2*P,z.height+2*P);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),G}}function ht(Z,z){if(Z.length!==0){gi(Z[0],z);for(var P=1;P=Math.abs(re)?P-Q+re:re-Q+P,P=Q}P+G>=0!=!!z&&Z.reverse()}var Si=a.getDefaultExportFromCjs(function Z(z,P){var G,H=z&&z.type;if(H==="FeatureCollection")for(G=0;G>31}function Ta(Z,z){for(var P=Z.loadGeometry(),G=Z.type,H=0,ee=0,ne=P.length,re=0;reZ},ct=Math.fround||(On=new Float32Array(1),Z=>(On[0]=+Z,On[0]));var On;const oi=3,ai=5,$r=6;class Wt{constructor(z){this.options=Object.assign(Object.create(ys),z),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(z){const{log:P,minZoom:G,maxZoom:H}=this.options;P&&console.time("total time");const ee=`prepare ${z.length} points`;P&&console.time(ee),this.points=z;const ne=[];for(let Q=0;Q=G;Q--){const de=+Date.now();re=this.trees[Q]=this._createTree(this._cluster(re,Q)),P&&console.log("z%d: %d clusters in %dms",Q,re.numItems,+Date.now()-de)}return P&&console.timeEnd("total time"),this}getClusters(z,P){let G=((z[0]+180)%360+360)%360-180;const H=Math.max(-90,Math.min(90,z[1]));let ee=z[2]===180?180:((z[2]+180)%360+360)%360-180;const ne=Math.max(-90,Math.min(90,z[3]));if(z[2]-z[0]>=360)G=-180,ee=180;else if(G>ee){const ke=this.getClusters([G,H,180,ne],P),Ie=this.getClusters([-180,H,ee,ne],P);return ke.concat(Ie)}const re=this.trees[this._limitZoom(P)],Q=re.range(qr(G),wr(ne),qr(ee),wr(H)),de=re.data,Pe=[];for(const ke of Q){const Ie=this.stride*ke;Pe.push(de[Ie+ai]>1?Zr(de,Ie,this.clusterProps):this.points[de[Ie+oi]])}return Pe}getChildren(z){const P=this._getOriginId(z),G=this._getOriginZoom(z),H="No cluster with the specified id.",ee=this.trees[G];if(!ee)throw new Error(H);const ne=ee.data;if(P*this.stride>=ne.length)throw new Error(H);const re=this.options.radius/(this.options.extent*Math.pow(2,G-1)),Q=ee.within(ne[P*this.stride],ne[P*this.stride+1],re),de=[];for(const Pe of Q){const ke=Pe*this.stride;ne[ke+4]===z&&de.push(ne[ke+ai]>1?Zr(ne,ke,this.clusterProps):this.points[ne[ke+oi]])}if(de.length===0)throw new Error(H);return de}getLeaves(z,P,G){const H=[];return this._appendLeaves(H,z,P=P||10,G=G||0,0),H}getTile(z,P,G){const H=this.trees[this._limitZoom(z)],ee=Math.pow(2,z),{extent:ne,radius:re}=this.options,Q=re/ne,de=(G-Q)/ee,Pe=(G+1+Q)/ee,ke={features:[]};return this._addTileFeatures(H.range((P-Q)/ee,de,(P+1+Q)/ee,Pe),H.data,P,G,ee,ke),P===0&&this._addTileFeatures(H.range(1-Q/ee,de,1,Pe),H.data,ee,G,ee,ke),P===ee-1&&this._addTileFeatures(H.range(0,de,Q/ee,Pe),H.data,-1,G,ee,ke),ke.features.length?ke:null}getClusterExpansionZoom(z){let P=this._getOriginZoom(z)-1;for(;P<=this.options.maxZoom;){const G=this.getChildren(z);if(P++,G.length!==1)break;z=G[0].properties.cluster_id}return P}_appendLeaves(z,P,G,H,ee){const ne=this.getChildren(P);for(const re of ne){const Q=re.properties;if(Q&&Q.cluster?ee+Q.point_count<=H?ee+=Q.point_count:ee=this._appendLeaves(z,Q.cluster_id,G,H,ee):ee1;let Pe,ke,Ie;if(de)Pe=Fn(P,Q,this.clusterProps),ke=P[Q],Ie=P[Q+1];else{const Qe=this.points[P[Q+oi]];Pe=Qe.properties;const[nt,ft]=Qe.geometry.coordinates;ke=qr(nt),Ie=wr(ft)}const Je={type:1,geometry:[[Math.round(this.options.extent*(ke*ee-G)),Math.round(this.options.extent*(Ie*ee-H))]],tags:Pe};let rt;rt=de||this.options.generateId?P[Q+oi]:this.points[P[Q+oi]].id,rt!==void 0&&(Je.id=rt),ne.features.push(Je)}}_limitZoom(z){return Math.max(this.options.minZoom,Math.min(Math.floor(+z),this.options.maxZoom+1))}_cluster(z,P){const{radius:G,extent:H,reduce:ee,minPoints:ne}=this.options,re=G/(H*Math.pow(2,P)),Q=z.data,de=[],Pe=this.stride;for(let ke=0;keP&&(nt+=Q[Vt+ai])}if(nt>Qe&&nt>=ne){let ft,Vt=Ie*Qe,Xt=Je*Qe,yi=-1;const ri=((ke/Pe|0)<<5)+(P+1)+this.points.length;for(const sr of rt){const li=sr*Pe;if(Q[li+2]<=P)continue;Q[li+2]=P;const Ti=Q[li+ai];Vt+=Q[li]*Ti,Xt+=Q[li+1]*Ti,Q[li+4]=ri,ee&&(ft||(ft=this._map(Q,ke,!0),yi=this.clusterProps.length,this.clusterProps.push(ft)),ee(ft,this._map(Q,li)))}Q[ke+4]=ri,de.push(Vt/nt,Xt/nt,1/0,ri,-1,nt),ee&&de.push(yi)}else{for(let ft=0;ft1)for(const ft of rt){const Vt=ft*Pe;if(!(Q[Vt+2]<=P)){Q[Vt+2]=P;for(let Xt=0;Xt>5}_getOriginZoom(z){return(z-this.points.length)%32}_map(z,P,G){if(z[P+ai]>1){const ne=this.clusterProps[z[P+$r]];return G?Object.assign({},ne):ne}const H=this.points[z[P+oi]].properties,ee=this.options.map(H);return G&&ee===H?Object.assign({},ee):ee}}function Zr(Z,z,P){return{type:"Feature",id:Z[z+oi],properties:Fn(Z,z,P),geometry:{type:"Point",coordinates:[(G=Z[z],360*(G-.5)),xs(Z[z+1])]}};var G}function Fn(Z,z,P){const G=Z[z+ai],H=G>=1e4?`${Math.round(G/1e3)}k`:G>=1e3?Math.round(G/100)/10+"k":G,ee=Z[z+$r],ne=ee===-1?{}:Object.assign({},P[ee]);return Object.assign(ne,{cluster:!0,cluster_id:Z[z+oi],point_count:G,point_count_abbreviated:H})}function qr(Z){return Z/360+.5}function wr(Z){const z=Math.sin(Z*Math.PI/180),P=.5-.25*Math.log((1+z)/(1-z))/Math.PI;return P<0?0:P>1?1:P}function xs(Z){const z=(180-360*Z)*Math.PI/180;return 360*Math.atan(Math.exp(z))/Math.PI-90}function dn(Z,z,P,G){for(var H,ee=G,ne=P-z>>1,re=P-z,Q=Z[z],de=Z[z+1],Pe=Z[P],ke=Z[P+1],Ie=z+3;Ieee)H=Ie,ee=Je;else if(Je===ee){var rt=Math.abs(Ie-ne);rtG&&(H-z>3&&dn(Z,z,H,G),Z[H+2]=ee,P-H>3&&dn(Z,H,P,G))}function Un(Z,z,P,G,H,ee){var ne=H-P,re=ee-G;if(ne!==0||re!==0){var Q=((Z-P)*ne+(z-G)*re)/(ne*ne+re*re);Q>1?(P=H,G=ee):Q>0&&(P+=ne*Q,G+=re*Q)}return(ne=Z-P)*ne+(re=z-G)*re}function pt(Z,z,P,G){var H={id:Z===void 0?null:Z,type:z,geometry:P,tags:G,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(ee){var ne=ee.geometry,re=ee.type;if(re==="Point"||re==="MultiPoint"||re==="LineString")Vn(ee,ne);else if(re==="Polygon"||re==="MultiLineString")for(var Q=0;Q0&&(ne+=G?(H*de-Q*ee)/2:Math.sqrt(Math.pow(Q-H,2)+Math.pow(de-ee,2))),H=Q,ee=de}var Pe=z.length-3;z[2]=1,dn(z,0,Pe,P),z[Pe+2]=1,z.size=Math.abs(ne),z.start=0,z.end=z.size}function Ui(Z,z,P,G){for(var H=0;H1?1:P}function Ri(Z,z,P,G,H,ee,ne,re){if(G/=z,ee>=(P/=z)&&ne=G)return null;for(var Q=[],de=0;de=P&&rt=G)){var Qe=[];if(Ie==="Point"||Ie==="MultiPoint")Mo(ke,Qe,P,G,H);else if(Ie==="LineString")Nn(ke,Qe,P,G,H,!1,re.lineMetrics);else if(Ie==="MultiLineString")Wr(ke,Qe,P,G,H,!1);else if(Ie==="Polygon")Wr(ke,Qe,P,G,H,!0);else if(Ie==="MultiPolygon")for(var nt=0;nt=P&&ne<=G&&(z.push(Z[ee]),z.push(Z[ee+1]),z.push(Z[ee+2]))}}function Nn(Z,z,P,G,H,ee,ne){for(var re,Q,de=Ao(Z),Pe=H===0?bs:ws,ke=Z.start,Ie=0;IeP&&(Q=Pe(de,Je,rt,nt,ft,P),ne&&(de.start=ke+re*Q)):Vt>G?Xt=P&&(Q=Pe(de,Je,rt,nt,ft,P),yi=!0),Xt>G&&Vt<=G&&(Q=Pe(de,Je,rt,nt,ft,G),yi=!0),!ee&&yi&&(ne&&(de.end=ke+re*Q),z.push(de),de=Ao(Z)),ne&&(ke+=re)}var ri=Z.length-3;Je=Z[ri],rt=Z[ri+1],Qe=Z[ri+2],(Vt=H===0?Je:rt)>=P&&Vt<=G&&jn(de,Je,rt,Qe),ri=de.length-3,ee&&ri>=3&&(de[ri]!==de[0]||de[ri+1]!==de[1])&&jn(de,de[0],de[1],de[2]),de.length&&z.push(de)}function Ao(Z){var z=[];return z.size=Z.size,z.start=Z.start,z.end=Z.end,z}function Wr(Z,z,P,G,H,ee){for(var ne=0;nene.maxX&&(ne.maxX=Pe),ke>ne.maxY&&(ne.maxY=ke)}return ne}function Co(Z,z,P,G){var H=z.geometry,ee=z.type,ne=[];if(ee==="Point"||ee==="MultiPoint")for(var re=0;re0&&z.size<(H?ne:G))P.numPoints+=z.length/3;else{for(var re=[],Q=0;Qne)&&(P.numSimplified++,re.push(z[Q]),re.push(z[Q+1])),P.numPoints++;H&&function(de,Pe){for(var ke=0,Ie=0,Je=de.length,rt=Je-2;Ie0===Pe)for(Ie=0,Je=de.length;Ie24)throw new Error("maxZoom should be in the 0-24 range");if(z.promoteId&&z.generateId)throw new Error("promoteId and generateId cannot be used together.");var G=function(H,ee){var ne=[];if(H.type==="FeatureCollection")for(var re=0;re1&&console.time("creation"),Ie=this.tiles[ke]=Gn(Z,z,P,G,Q),this.tileCoords.push({z,x:P,y:G}),de)){de>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",z,P,G,Ie.numFeatures,Ie.numPoints,Ie.numSimplified),console.timeEnd("creation"));var Je="z"+z;this.stats[Je]=(this.stats[Je]||0)+1,this.total++}if(Ie.source=Z,H){if(z===Q.maxZoom||z===H)continue;var rt=1<1&&console.time("clipping");var Qe,nt,ft,Vt,Xt,yi,ri=.5*Q.buffer/Q.extent,sr=.5-ri,li=.5+ri,Ti=1+ri;Qe=nt=ft=Vt=null,Xt=Ri(Z,Pe,P-ri,P+li,0,Ie.minX,Ie.maxX,Q),yi=Ri(Z,Pe,P+sr,P+Ti,0,Ie.minX,Ie.maxX,Q),Z=null,Xt&&(Qe=Ri(Xt,Pe,G-ri,G+li,1,Ie.minY,Ie.maxY,Q),nt=Ri(Xt,Pe,G+sr,G+Ti,1,Ie.minY,Ie.maxY,Q),Xt=null),yi&&(ft=Ri(yi,Pe,G-ri,G+li,1,Ie.minY,Ie.maxY,Q),Vt=Ri(yi,Pe,G+sr,G+Ti,1,Ie.minY,Ie.maxY,Q),yi=null),de>1&&console.timeEnd("clipping"),re.push(Qe||[],z+1,2*P,2*G),re.push(nt||[],z+1,2*P,2*G+1),re.push(ft||[],z+1,2*P+1,2*G),re.push(Vt||[],z+1,2*P+1,2*G+1)}}},Hr.prototype.getTile=function(Z,z,P){var G=this.options,H=G.extent,ee=G.debug;if(Z<0||Z>24)return null;var ne=1<1&&console.log("drilling down to z%d-%d-%d",Z,z,P);for(var Q,de=Z,Pe=z,ke=P;!Q&&de>0;)de--,Pe=Math.floor(Pe/2),ke=Math.floor(ke/2),Q=this.tiles[mn(de,Pe,ke)];return Q&&Q.source?(ee>1&&console.log("found parent tile z%d-%d-%d",de,Pe,ke),ee>1&&console.time("drilling down"),this.splitTile(Q.source,de,Pe,ke,Z,z,P),ee>1&&console.timeEnd("drilling down"),this.tiles[re]?Io(this.tiles[re],H):null):null};class $n extends a.VectorTileWorkerSource{constructor(z,P,G,H,ee){super(z,P,G,H,_n),ee&&(this.loadGeoJSON=ee)}loadData(z,P){const G=z&&z.request,H=G&&G.collectResourceTiming;this.loadGeoJSON(z,(ee,ne)=>{if(ee||!ne)return P(ee);if(typeof ne!="object")return P(new Error(`Input data given to '${z.source}' is not a valid GeoJSON object.`));{Si(ne,!0);try{if(z.filter){const Q=a.createExpression(z.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(Q.result==="error")throw new Error(Q.value.map(Pe=>`${Pe.key}: ${Pe.message}`).join(", "));ne={type:"FeatureCollection",features:ne.features.filter(Pe=>Q.value.evaluate({zoom:0},Pe))}}this._geoJSONIndex=z.cluster?new Wt(function({superclusterOptions:Q,clusterProperties:de}){if(!de||!Q)return Q;const Pe={},ke={},Ie={accumulated:null,zoom:0},Je={properties:null},rt=Object.keys(de);for(const Qe of rt){const[nt,ft]=de[Qe],Vt=a.createExpression(ft),Xt=a.createExpression(typeof nt=="string"?[nt,["accumulated"],["get",Qe]]:nt);Pe[Qe]=Vt.value,ke[Qe]=Xt.value}return Q.map=Qe=>{Je.properties=Qe;const nt={};for(const ft of rt)nt[ft]=Pe[ft].evaluate(Ie,Je);return nt},Q.reduce=(Qe,nt)=>{Je.properties=nt;for(const ft of rt)Ie.accumulated=Qe[ft],Qe[ft]=ke[ft].evaluate(Ie,Je)},Q}(z)).load(ne.features):function(Q,de){return new Hr(Q,de)}(ne,z.geojsonVtOptions)}catch(Q){return P(Q)}this.loaded={};const re={};if(H){const Q=a.getPerformanceMeasurement(G);Q&&(re.resourceTiming={},re.resourceTiming[z.source]=JSON.parse(JSON.stringify(Q)))}P(null,re)}})}reloadTile(z,P){const G=this.loaded;return G&&G[z.uid]?super.reloadTile(z,P):this.loadTile(z,P)}loadGeoJSON(z,P){if(z.request)a.getJSON(z.request,P);else{if(typeof z.data!="string")return P(new Error(`Input data given to '${z.source}' is not a valid GeoJSON object.`));try{return P(null,JSON.parse(z.data))}catch{return P(new Error(`Input data given to '${z.source}' is not a valid GeoJSON object.`))}}}getClusterExpansionZoom(z,P){try{P(null,this._geoJSONIndex.getClusterExpansionZoom(z.clusterId))}catch(G){P(G)}}getClusterChildren(z,P){try{P(null,this._geoJSONIndex.getChildren(z.clusterId))}catch(G){P(G)}}getClusterLeaves(z,P){try{P(null,this._geoJSONIndex.getLeaves(z.clusterId,z.limit,z.offset))}catch(G){P(G)}}}class Ts{constructor(z){this.self=z,this.actor=new a.Actor(z,this),this.layerIndexes={},this.availableImages={},this.isSpriteLoaded={},this.projections={},this.defaultProjection=a.getProjection({name:"mercator"}),this.workerSourceTypes={vector:a.VectorTileWorkerSource,geojson:$n},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(P,G)=>{if(this.workerSourceTypes[P])throw new Error(`Worker source with name "${P}" already registered.`);this.workerSourceTypes[P]=G},this.self.registerRTLTextPlugin=P=>{if(a.plugin.isParsed())throw new Error("RTL text plugin already registered.");a.plugin.applyArabicShaping=P.applyArabicShaping,a.plugin.processBidirectionalText=P.processBidirectionalText,a.plugin.processStyledBidirectionalText=P.processStyledBidirectionalText}}clearCaches(z,P,G){delete this.layerIndexes[z],delete this.availableImages[z],delete this.workerSources[z],delete this.demWorkerSources[z],G()}checkIfReady(z,P,G){G()}setReferrer(z,P){this.referrer=P}spriteLoaded(z,P){this.isSpriteLoaded[z]=P;for(const G in this.workerSources[z]){const H=this.workerSources[z][G];for(const ee in H)H[ee]instanceof a.VectorTileWorkerSource&&(H[ee].isSpriteLoaded=P,H[ee].fire(new a.Event("isSpriteLoaded")))}}setImages(z,P,G){this.availableImages[z]=P;for(const H in this.workerSources[z]){const ee=this.workerSources[z][H];for(const ne in ee)ee[ne].availableImages=P}G()}enableTerrain(z,P,G){this.terrain=P,G()}setProjection(z,P){this.projections[z]=a.getProjection(P)}setLayers(z,P,G){this.getLayerIndex(z).replace(P),G()}updateLayers(z,P,G){this.getLayerIndex(z).update(P.layers,P.removedIds),G()}loadTile(z,P,G){const H=this.enableTerrain?a.extend({enableTerrain:this.terrain},P):P;H.projection=this.projections[z]||this.defaultProjection,this.getWorkerSource(z,P.type,P.source).loadTile(H,G)}loadDEMTile(z,P,G){const H=this.enableTerrain?a.extend({buildQuadTree:this.terrain},P):P;this.getDEMWorkerSource(z,P.source).loadTile(H,G)}reloadTile(z,P,G){const H=this.enableTerrain?a.extend({enableTerrain:this.terrain},P):P;H.projection=this.projections[z]||this.defaultProjection,this.getWorkerSource(z,P.type,P.source).reloadTile(H,G)}abortTile(z,P,G){this.getWorkerSource(z,P.type,P.source).abortTile(P,G)}removeTile(z,P,G){this.getWorkerSource(z,P.type,P.source).removeTile(P,G)}removeSource(z,P,G){if(!this.workerSources[z]||!this.workerSources[z][P.type]||!this.workerSources[z][P.type][P.source])return;const H=this.workerSources[z][P.type][P.source];delete this.workerSources[z][P.type][P.source],H.removeSource!==void 0?H.removeSource(P,G):G()}loadWorkerSource(z,P,G){try{this.self.importScripts(P.url),G()}catch(H){G(H.toString())}}syncRTLPluginState(z,P,G){try{a.plugin.setState(P);const H=a.plugin.getPluginURL();if(a.plugin.isLoaded()&&!a.plugin.isParsed()&&H!=null){this.self.importScripts(H);const ee=a.plugin.isParsed();G(ee?void 0:new Error(`RTL Text Plugin failed to import scripts from ${H}`),ee)}}catch(H){G(H.toString())}}getAvailableImages(z){let P=this.availableImages[z];return P||(P=[]),P}getLayerIndex(z){let P=this.layerIndexes[z];return P||(P=this.layerIndexes[z]=new Ki),P}getWorkerSource(z,P,G){if(this.workerSources[z]||(this.workerSources[z]={}),this.workerSources[z][P]||(this.workerSources[z][P]={}),!this.workerSources[z][P][G]){const H={send:(ee,ne,re,Q,de,Pe)=>{this.actor.send(ee,ne,re,z,de,Pe)},scheduler:this.actor.scheduler};this.workerSources[z][P][G]=new this.workerSourceTypes[P](H,this.getLayerIndex(z),this.getAvailableImages(z),this.isSpriteLoaded[z])}return this.workerSources[z][P][G]}getDEMWorkerSource(z,P){return this.demWorkerSources[z]||(this.demWorkerSources[z]={}),this.demWorkerSources[z][P]||(this.demWorkerSources[z][P]=new it),this.demWorkerSources[z][P]}enforceCacheSizeLimit(z,P){a.enforceCacheSizeLimit(P)}getWorkerPerformanceMetrics(z,P,G){G(void 0,void 0)}}return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&(self.worker=new Ts(self)),Ts}),wo(["./shared"],function(a){function Se(l,r){if(Array.isArray(l)){if(!Array.isArray(r)||l.length!==r.length)return!1;for(let o=0;o"u"||typeof document>"u"?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var h,d,f=new Blob([""],{type:"text/javascript"}),g=URL.createObjectURL(f);try{d=new Worker(g),h=!0}catch{h=!1}return d&&d.terminate(),URL.revokeObjectURL(g),h}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var h=document.createElement("canvas");h.width=h.height=1;var d=h.getContext("2d");if(!d)return!1;var f=d.getImageData(0,0,1,1);return f&&f.width===h.width}()?(it[o=r&&r.failIfMajorPerformanceCaveat]===void 0&&(it[o]=function(h){var d,f=function(g){var y=document.createElement("canvas"),v=Object.create(Ki.webGLContextAttributes);return v.failIfMajorPerformanceCaveat=g,y.getContext("webgl",v)||y.getContext("experimental-webgl",v)}(h);if(!f)return!1;try{d=f.createShader(f.VERTEX_SHADER)}catch{return!1}return!(!d||f.isContextLost())&&(f.shaderSource(d,"void main() {}"),f.compileShader(d),f.getShaderParameter(d,f.COMPILE_STATUS)===!0)}(o)),it[o]?document.documentMode?"insufficient ECMAScript 6 support":void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var o}(l)}var it={};function ht(l,r,o){const h=a.window.document.createElement(l);return r!==void 0&&(h.className=r),o&&o.appendChild(h),h}function gi(l,r,o){const h=a.window.document.createElementNS("http://www.w3.org/2000/svg",l);for(const d of Object.keys(r))h.setAttributeNS(null,d,r[d]);return o&&o.appendChild(h),h}Ki.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};const Si=a.window.document&&a.window.document.documentElement.style,vr=Si&&Si.userSelect!==void 0?"userSelect":"WebkitUserSelect";let br;function To(){Si&&vr&&(br=Si[vr],Si[vr]="none")}function Rn(){Si&&vr&&(Si[vr]=br)}function Yi(l){l.preventDefault(),l.stopPropagation(),a.window.removeEventListener("click",Yi,!0)}function Bn(){a.window.addEventListener("click",Yi,!0),a.window.setTimeout(()=>{a.window.removeEventListener("click",Yi,!0)},0)}function Ji(l,r){const o=l.getBoundingClientRect();return Qi(l,o,r)}function hn(l,r){const o=l.getBoundingClientRect(),h=[];for(let d=0;d=0?0:l.button}function Qi(l,r,o){const h=l.offsetWidth===r.width?1:l.offsetWidth/r.width;return new a.Point((o.clientX-r.left)*h,(o.clientY-r.top)*h)}function Le(l,r){var o=r[0],h=r[1],d=r[2],f=r[3],g=o*f-d*h;return g?(l[0]=f*(g=1/g),l[1]=-h*g,l[2]=-d*g,l[3]=o*g,l):null}function ba(l){const{userImage:r}=l;return!!(r&&r.render&&r.render())&&(l.data.replace(new Uint8Array(r.data.buffer)),!0)}class wa extends a.Evented{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new a.RGBAImage({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(r){if(this.loaded!==r&&(this.loaded=r,r)){for(const{ids:o,callback:h}of this.requestors)this._notify(o,h);this.requestors=[]}}hasImage(r){return!!this.getImage(r)}getImage(r){return this.images[r]}addImage(r,o){this._validate(r,o)&&(this.images[r]=o)}_validate(r,o){let h=!0;return this._validateStretch(o.stretchX,o.data&&o.data.width)||(this.fire(new a.ErrorEvent(new Error(`Image "${r}" has invalid "stretchX" value`))),h=!1),this._validateStretch(o.stretchY,o.data&&o.data.height)||(this.fire(new a.ErrorEvent(new Error(`Image "${r}" has invalid "stretchY" value`))),h=!1),this._validateContent(o.content,o)||(this.fire(new a.ErrorEvent(new Error(`Image "${r}" has invalid "content" value`))),h=!1),h}_validateStretch(r,o){if(!r)return!0;let h=0;for(const d of r){if(d[0]{this.ready=!0})}broadcast(r,o,h){a.asyncAll(this.actors,(d,f)=>{d.send(r,o,f)},h=h||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach(r=>{r.remove()}),this.actors=[],this.workerPool.release(this.id)}}function ai(l,r,o){return r*(a.EXTENT/(l.tileSize*Math.pow(2,o-l.tileID.overscaledZ)))}oi.Actor=a.Actor;class $r{constructor(r,o,h,d){this.screenBounds=r,this.cameraPoint=o,this._screenRaycastCache={},this._cameraRaycastCache={},this.isAboveHorizon=h,this.screenGeometry=this.bufferedScreenGeometry(0),this.screenGeometryMercator=this._bufferedScreenMercator(0,d)}static createFromScreenPoints(r,o){let h,d;if(r instanceof a.Point||typeof r[0]=="number"){const f=a.Point.convert(r);h=[f],d=o.isPointAboveHorizon(f)}else{const f=a.Point.convert(r[0]),g=a.Point.convert(r[1]);h=[f,g],d=a.polygonizeBounds(f,g).every(y=>o.isPointAboveHorizon(y))}return new $r(h,o.getCameraPoint(),d,o)}isPointQuery(){return this.screenBounds.length===1}bufferedScreenGeometry(r){return a.polygonizeBounds(this.screenBounds[0],this.screenBounds.length===1?this.screenBounds[0]:this.screenBounds[1],r)}bufferedCameraGeometry(r){const o=this.screenBounds[0],h=this.screenBounds.length===1?this.screenBounds[0].add(new a.Point(1,1)):this.screenBounds[1],d=a.polygonizeBounds(o,h,0,!1);return this.cameraPoint.y>h.y&&(this.cameraPoint.x>o.x&&this.cameraPoint.x=h.x?d[2]=this.cameraPoint:this.cameraPoint.x<=o.x&&(d[3]=this.cameraPoint)),a.bufferConvexPolygon(d,r)}bufferedCameraGeometryGlobe(r){const o=this.screenBounds[0],h=this.screenBounds.length===1?this.screenBounds[0].add(new a.Point(1,1)):this.screenBounds[1],d=a.polygonizeBounds(o,h,r),f=this.cameraPoint.clone();switch(3*((f.y>o.y)+(f.y>h.y))+((f.x>o.x)+(f.x>h.x))){case 0:d[0]=f,d[4]=f.clone();break;case 1:d.splice(1,0,f);break;case 2:d[1]=f;break;case 3:d.splice(4,0,f);break;case 5:d.splice(2,0,f);break;case 6:d[3]=f;break;case 7:d.splice(3,0,f);break;case 8:d[2]=f}return d}containsTile(r,o,h,d=0){const f=r.queryPadding/o._pixelsPerMercatorPixel+1,g=h?this._bufferedCameraMercator(f,o):this._bufferedScreenMercator(f,o);let y=r.tileID.wrap+(g.unwrapped?d:0);const v=g.polygon.map(F=>a.getTilePoint(r.tileTransform,F,y));if(!a.polygonIntersectsBox(v,0,0,a.EXTENT,a.EXTENT))return;y=r.tileID.wrap+(this.screenGeometryMercator.unwrapped?d:0);const E=this.screenGeometryMercator.polygon.map(F=>a.getTileVec3(r.tileTransform,F,y)),T=E.map(F=>new a.Point(F[0],F[1])),A=o.getFreeCameraOptions().position||new a.MercatorCoordinate(0,0,0),k=a.getTileVec3(r.tileTransform,A,y),R=E.map(F=>{const I=a.sub(F,F,k);return a.normalize(I,I),new a.Ray(k,I)}),O=ai(r,1,o.zoom)*o._pixelsPerMercatorPixel;return{queryGeometry:this,tilespaceGeometry:T,tilespaceRays:R,bufferedTilespaceGeometry:v,bufferedTilespaceBounds:(B=a.getBounds(v),B.min.x=a.clamp(B.min.x,0,a.EXTENT),B.min.y=a.clamp(B.min.y,0,a.EXTENT),B.max.x=a.clamp(B.max.x,0,a.EXTENT),B.max.y=a.clamp(B.max.y,0,a.EXTENT),B),tile:r,tileID:r.tileID,pixelToTileUnitsFactor:O};var B}_bufferedScreenMercator(r,o){const h=Fn(r);if(this._screenRaycastCache[h])return this._screenRaycastCache[h];{let d;return d=o.projection.name==="globe"?this._projectAndResample(this.bufferedScreenGeometry(r),o):{polygon:this.bufferedScreenGeometry(r).map(f=>o.pointCoordinate3D(f)),unwrapped:!0},this._screenRaycastCache[h]=d,d}}_bufferedCameraMercator(r,o){const h=Fn(r);if(this._cameraRaycastCache[h])return this._cameraRaycastCache[h];{let d;return d=o.projection.name==="globe"?this._projectAndResample(this.bufferedCameraGeometryGlobe(r),o):{polygon:this.bufferedCameraGeometry(r).map(f=>o.pointCoordinate3D(f)),unwrapped:!0},this._cameraRaycastCache[h]=d,d}}_projectAndResample(r,o){const h=function(f,g){const y=a.multiply([],g.pixelMatrix,g.globeMatrix),v=[0,-a.GLOBE_RADIUS,0,1],E=[0,a.GLOBE_RADIUS,0,1],T=[0,0,0,1];a.transformMat4$1(v,v,y),a.transformMat4$1(E,E,y),a.transformMat4$1(T,T,y);const A=new a.Point(v[0]/v[3],v[1]/v[3]),k=new a.Point(E[0]/E[3],E[1]/E[3]),R=a.polygonContainsPoint(f,A)&&v[3]1?Wt(f.slice(0,F),g):[],N=Fnew a.Point(Zr(Y.x),Y.y)),N=N.map(Y=>new a.Point(Zr(Y.x),Y.y));const j=[...L];j.length===0&&j.push(N[N.length-1]);const K=a.number(j[j.length-1].y,(N.length===0?L[0]:N[0]).y,I);let J;return J=R?[new a.Point(0,K),new a.Point(0,0),new a.Point(1,0),new a.Point(1,K)]:[new a.Point(1,K),new a.Point(1,1),new a.Point(0,1),new a.Point(0,K)],j.push(...J),N.length===0?j.push(L[0]):j.push(...N),{polygon:j.map(Y=>new a.MercatorCoordinate(Y.x,Y.y)),unwrapped:!1}}(r,o);if(h)return h;const d=function(f,g){let y=!1,v=-1/0,E=0;for(let A=0;Av&&(v=f[A].x,E=A);for(let A=0;A.5&&(R.x{A.x-=1}),{polygon:f,unwrapped:y}}(Wt(r,o).map(f=>new a.Point(Zr(f.x),f.y)),o);return{polygon:d.polygon.map(f=>new a.MercatorCoordinate(f.x,f.y)),unwrapped:d.unwrapped}}}function Wt(l,r){return a.resample(l,o=>{const h=r.pointCoordinate3D(o);o.x=h.x,o.y=h.y},1/256)}function Zr(l){return l<0?1+l%1:l%1}function Fn(l){return 100*l|0}function qr(l,r,o,h,d){const f=function(g,y){if(g)return d(g);if(y){l.url&&y.tiles&&l.tiles&&delete l.tiles;const v=a.pick(a.extend(y,l),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);y.vector_layers&&(v.vectorLayers=y.vector_layers,v.vectorLayerIds=v.vectorLayers.map(E=>E.id)),v.tiles=r.canonicalizeTileset(v,l.url),d(null,v)}};return l.url?a.getJSON(r.transformRequest(r.normalizeSourceURL(l.url,null,o,h),a.ResourceType.Source),f):a.exported.frame(()=>f(null,l))}class wr{constructor(r,o,h){this.bounds=a.LngLatBounds.convert(this.validateBounds(r)),this.minzoom=o||0,this.maxzoom=h||24}validateBounds(r){return Array.isArray(r)&&r.length===4?[Math.max(-180,r[0]),Math.max(-90,r[1]),Math.min(180,r[2]),Math.min(90,r[3])]:[-180,-90,180,90]}contains(r){const o=Math.pow(2,r.z),h=Math.floor(a.mercatorXfromLng(this.bounds.getWest())*o),d=Math.floor(a.mercatorYfromLat(this.bounds.getNorth())*o),f=Math.ceil(a.mercatorXfromLng(this.bounds.getEast())*o),g=Math.ceil(a.mercatorYfromLat(this.bounds.getSouth())*o);return r.x>=h&&r.x=d&&r.y{this._tileJSONRequest=null,this._loaded=!0,d?(o&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${o}`),h&&h.length!==2&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${h}`),this.fire(new a.ErrorEvent(d))):f&&(a.extend(this,f),f.bounds&&(this.tileBounds=new wr(f.bounds,this.minzoom,this.maxzoom)),a.postTurnstileEvent(f.tiles,this.map._requestManager._customAccessToken),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"content"}))),r&&r(d)})}loaded(){return this._loaded}hasTile(r){return!this.tileBounds||this.tileBounds.contains(r.canonical)}onAdd(r){this.map=r,this.load()}reload(){this.cancelTileJSONRequest(),this.load(()=>this.map.style._clearSource(this.id))}setTiles(r){return this._options.tiles=r,this.reload(),this}setUrl(r){return this.url=r,this._options.url=r,this.reload(),this}onRemove(){this.cancelTileJSONRequest()}serialize(){return a.extend({},this._options)}loadTile(r,o){const h=this.map._requestManager.normalizeTileURL(r.tileID.canonical.url(this.tiles,this.scheme)),d={request:this.map._requestManager.transformRequest(h,a.ResourceType.Tile),data:void 0,uid:r.uid,tileID:r.tileID,tileZoom:r.tileZoom,zoom:r.tileID.overscaledZ,tileSize:this.tileSize*r.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:a.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,isSymbolTile:r.isSymbolTile};if(d.request.collectResourceTiming=this._collectResourceTiming,r.actor&&r.state!=="expired")r.state==="loading"?r.reloadCallback=o:r.request=r.actor.send("reloadTile",d,f.bind(this));else if(r.actor=this._tileWorkers[h]=this._tileWorkers[h]||this.dispatcher.getActor(),this.dispatcher.ready)r.request=r.actor.send("loadTile",d,f.bind(this),void 0,!0);else{const g=a.loadVectorTile.call({deduped:this._deduped},d,(y,v)=>{y||!v?f.call(this,y):(d.data={cacheControl:v.cacheControl,expires:v.expires,rawData:v.rawData.slice(0)},r.actor&&r.actor.send("loadTile",d,f.bind(this),void 0,!0))},!0);r.request={cancel:g}}function f(g,y){return delete r.request,r.aborted?o(null):g&&g.status!==404?o(g):(y&&y.resourceTiming&&(r.resourceTiming=y.resourceTiming),this.map._refreshExpiredTiles&&y&&r.setExpiryData(y),r.loadVectorData(y,this.map.painter),a.cacheEntryPossiblyAdded(this.dispatcher),o(null),void(r.reloadCallback&&(this.loadTile(r,r.reloadCallback),r.reloadCallback=null)))}}abortTile(r){r.request&&(r.request.cancel(),delete r.request),r.actor&&r.actor.send("abortTile",{uid:r.uid,type:this.type,source:this.id})}unloadTile(r){r.unloadVectorData(),r.actor&&r.actor.send("removeTile",{uid:r.uid,type:this.type,source:this.id})}hasTransition(){return!1}afterUpdate(){this._tileWorkers={}}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}class Ie extends a.Evented{constructor(r,o,h,d){super(),this.id=r,this.dispatcher=h,this.setEventedParent(d),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=a.extend({type:"raster"},o),a.extend(this,a.pick(o,["url","scheme","tileSize"]))}load(r){this._loaded=!1,this.fire(new a.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=qr(this._options,this.map._requestManager,null,null,(o,h)=>{this._tileJSONRequest=null,this._loaded=!0,o?this.fire(new a.ErrorEvent(o)):h&&(a.extend(this,h),h.bounds&&(this.tileBounds=new wr(h.bounds,this.minzoom,this.maxzoom)),a.postTurnstileEvent(h.tiles),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"content"}))),r&&r(o)})}loaded(){return this._loaded}onAdd(r){this.map=r,this.load()}reload(){this.cancelTileJSONRequest(),this.load(()=>this.map.style._clearSource(this.id))}setTiles(r){return this._options.tiles=r,this.reload(),this}setUrl(r){return this.url=r,this._options.url=r,this.reload(),this}onRemove(){this.cancelTileJSONRequest()}serialize(){return a.extend({},this._options)}hasTile(r){return!this.tileBounds||this.tileBounds.contains(r.canonical)}loadTile(r,o){const h=a.exported.devicePixelRatio>=2,d=this.map._requestManager.normalizeTileURL(r.tileID.canonical.url(this.tiles,this.scheme),h,this.tileSize);r.request=a.getImage(this.map._requestManager.transformRequest(d,a.ResourceType.Tile),(f,g,y,v)=>(delete r.request,r.aborted?(r.state="unloaded",o(null)):f?(r.state="errored",o(f)):g?(this.map._refreshExpiredTiles&&r.setExpiryData({cacheControl:y,expires:v}),r.setTexture(g,this.map.painter),r.state="loaded",a.cacheEntryPossiblyAdded(this.dispatcher),void o(null)):o(null)))}static loadTileData(r,o,h){r.setTexture(o,h)}static unloadTileData(r,o){r.texture&&o.saveTileTexture(r.texture)}abortTile(r,o){r.request&&(r.request.cancel(),delete r.request),o()}unloadTile(r,o){r.texture&&this.map.painter.saveTileTexture(r.texture),o()}hasTransition(){return!1}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}function Je(l,r,o,h,d,f,g,y){const v=[l,o,d,r,h,f,1,1,1],E=[g,y,1],T=a.adjoint([],v),[A,k,R]=a.transformMat3(E,E,a.transpose(T,T));return a.multiply$1(v,[A,0,0,0,k,0,0,0,R],v)}class rt extends a.Evented{constructor(r,o,h,d){super(),this.id=r,this.dispatcher=h,this.coordinates=o.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(d),this.options=o,this._dirty=!1}load(r,o){this._loaded=o||!1,this.fire(new a.Event("dataloading",{dataType:"source"})),this.url=this.options.url,this._imageRequest=a.getImage(this.map._requestManager.transformRequest(this.url,a.ResourceType.Image),(h,d)=>{if(this._imageRequest=null,this._loaded=!0,h)this.fire(new a.ErrorEvent(h));else if(d){const{HTMLImageElement:f}=a.window;this.image=d instanceof f?a.exported.getImageData(d):d,this._dirty=!0,this.width=this.image.width,this.height=this.image.height,r&&(this.coordinates=r),this._finishLoading()}})}loaded(){return this._loaded}updateImage(r){return this.image&&r.url?(this._imageRequest&&r.url!==this.options.url&&(this._imageRequest.cancel(),this._imageRequest=null),this.options.url=r.url,this.load(r.coordinates,this._loaded),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(r){this.map=r,this.load()}onRemove(){this._imageRequest&&(this._imageRequest.cancel(),this._imageRequest=null),this.texture&&this.texture.destroy()}setCoordinates(r){this.coordinates=r,this._boundsArray=void 0;const o=r.map(a.MercatorCoordinate.fromLngLat);return this.tileID=function(h){let d=1/0,f=1/0,g=-1/0,y=-1/0;for(const A of h)d=Math.min(d,A.x),f=Math.min(f,A.y),g=Math.max(g,A.x),y=Math.max(y,A.y);const v=Math.max(g-d,y-f),E=Math.max(0,Math.floor(-Math.log(v)/Math.LN2)),T=Math.pow(2,E);return new a.CanonicalTileID(E,Math.floor((d+g)/2*T),Math.floor((f+y)/2*T))}(o),this.minzoom=this.maxzoom=this.tileID.z,this.fire(new a.Event("data",{dataType:"source",sourceDataType:"content"})),this}_clear(){this._boundsArray=void 0}_prepareData(r){for(const v in this.tiles){const E=this.tiles[v];E.state!=="loaded"&&(E.state="loaded",E.texture=this.texture)}if(this._boundsArray)return;const o=a.tileTransform(this.tileID,this.map.transform.projection),[h,d,f,g]=this.coordinates.map(v=>{const E=o.projection.project(v[0],v[1]);return a.getTilePoint(o,E)._round()});this.perspectiveTransform=function(v,E,T,A,k,R,O,B,F,I){const L=Je(0,0,v,0,0,E,v,E),N=Je(T,A,k,R,O,B,F,I);return a.multiply$1(N,a.adjoint(L,L),N),[N[6]/N[8]*v/a.EXTENT,N[7]/N[8]*E/a.EXTENT]}(this.width,this.height,h.x,h.y,d.x,d.y,g.x,g.y,f.x,f.y);const y=this._boundsArray=new a.StructArrayLayout4i8;y.emplaceBack(h.x,h.y,0,0),y.emplaceBack(d.x,d.y,a.EXTENT,0),y.emplaceBack(g.x,g.y,0,a.EXTENT),y.emplaceBack(f.x,f.y,a.EXTENT,a.EXTENT),this.boundsBuffer&&this.boundsBuffer.destroy(),this.boundsBuffer=r.createVertexBuffer(y,a.boundsAttributes.members),this.boundsSegments=a.SegmentVector.simpleSegment(0,0,4,2)}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const r=this.map.painter.context,o=r.gl;this._dirty&&(this.texture?this.texture.update(this.image):(this.texture=new a.Texture(r,this.image,o.RGBA),this.texture.bind(o.LINEAR,o.CLAMP_TO_EDGE)),this._dirty=!1),this._prepareData(r)}loadTile(r,o){this.tileID&&this.tileID.equals(r.tileID.canonical)?(this.tiles[String(r.tileID.wrap)]=r,r.buckets={},o(null)):(r.state="errored",o(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}const Qe={vector:ke,raster:Ie,"raster-dem":class extends Ie{constructor(l,r,o,h){super(l,r,o,h),this.type="raster-dem",this.maxzoom=22,this._options=a.extend({type:"raster-dem"},r),this.encoding=r.encoding||"mapbox"}loadTile(l,r){const o=this.map._requestManager.normalizeTileURL(l.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize);function h(d,f){d&&(l.state="errored",r(d)),f&&(l.dem=f,l.dem.onDeserialize(),l.needsHillshadePrepare=!0,l.needsDEMTextureUpload=!0,l.state="loaded",r(null))}l.request=a.getImage(this.map._requestManager.transformRequest(o,a.ResourceType.Tile),(function(d,f,g,y){if(delete l.request,l.aborted)l.state="unloaded",r(null);else if(d)l.state="errored",r(d);else if(f){this.map._refreshExpiredTiles&&l.setExpiryData({cacheControl:g,expires:y});const v=a.window.ImageBitmap&&f instanceof a.window.ImageBitmap&&(Gn==null&&(Gn=a.window.OffscreenCanvas&&new a.window.OffscreenCanvas(1,1).getContext("2d")&&typeof a.window.createImageBitmap=="function"),Gn),E=1-(f.width-a.prevPowerOfTwo(f.width))/2;E<1||l.neighboringTiles||(l.neighboringTiles=this._getNeighboringTiles(l.tileID));const T=v?f:a.exported.getImageData(f,E),A={uid:l.uid,coord:l.tileID,source:this.id,rawImageData:T,encoding:this.encoding,padding:E};l.actor&&l.state!=="expired"||(l.actor=this.dispatcher.getActor(),l.actor.send("loadDEMTile",A,h.bind(this),void 0,!0))}}).bind(this))}_getNeighboringTiles(l){const r=l.canonical,o=Math.pow(2,r.z),h=(r.x-1+o)%o,d=r.x===0?l.wrap-1:l.wrap,f=(r.x+1+o)%o,g=r.x+1===o?l.wrap+1:l.wrap,y={};return y[new a.OverscaledTileID(l.overscaledZ,d,r.z,h,r.y).key]={backfilled:!1},y[new a.OverscaledTileID(l.overscaledZ,g,r.z,f,r.y).key]={backfilled:!1},r.y>0&&(y[new a.OverscaledTileID(l.overscaledZ,d,r.z,h,r.y-1).key]={backfilled:!1},y[new a.OverscaledTileID(l.overscaledZ,l.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},y[new a.OverscaledTileID(l.overscaledZ,g,r.z,f,r.y-1).key]={backfilled:!1}),r.y+1{if(this._loaded=!0,this._pendingLoad=null,o)this.fire(new a.ErrorEvent(o));else{const d={dataType:"source",sourceDataType:this._metadataFired?"content":"metadata"};this._collectResourceTiming&&h&&h.resourceTiming&&h.resourceTiming[this.id]&&(d.resourceTiming=h.resourceTiming[this.id]),this.fire(new a.Event("data",d)),this._metadataFired=!0}this._coalesce&&(this._updateWorkerData(),this._coalesce=!1)})}loaded(){return this._loaded}loadTile(l,r){const o=l.actor?"reloadTile":"loadTile";l.actor=this.actor,l.request=this.actor.send(o,{type:this.type,uid:l.uid,tileID:l.tileID,tileZoom:l.tileZoom,zoom:l.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:a.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(h,d)=>(delete l.request,l.unloadVectorData(),l.aborted?r(null):h?r(h):(l.loadVectorData(d,this.map.painter,o==="reloadTile"),r(null))),void 0,o==="loadTile")}abortTile(l){l.request&&(l.request.cancel(),delete l.request),l.aborted=!0}unloadTile(l){l.unloadVectorData(),this.actor.send("removeTile",{uid:l.uid,type:this.type,source:this.id})}onRemove(){this._pendingLoad&&this._pendingLoad.cancel()}serialize(){return a.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}},video:class extends rt{constructor(l,r,o,h){super(l,r,o,h),this.roundZoom=!0,this.type="video",this.options=r}load(){this._loaded=!1;const l=this.options;this.urls=[];for(const r of l.urls)this.urls.push(this.map._requestManager.transformRequest(r,a.ResourceType.Source).url);a.getVideo(this.urls,(r,o)=>{this._loaded=!0,r?this.fire(new a.ErrorEvent(r)):o&&(this.video=o,this.video.loop=!0,this.video.setAttribute("playsinline",""),this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(l){if(this.video){const r=this.video.seekable;lr.end(0)?this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${this.id}`,null,`Playback for this video can be set only between the ${r.start(0)} and ${r.end(0)}-second mark.`))):this.video.currentTime=l}}getVideo(){return this.video}onAdd(l){this.map||(this.map=l,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const l=this.map.painter.context,r=l.gl;this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new a.Texture(l,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),this.width=this.video.videoWidth,this.height=this.video.videoHeight),this._prepareData(l)}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},image:rt,canvas:class extends rt{constructor(l,r,o,h){super(l,r,o,h),r.coordinates?Array.isArray(r.coordinates)&&r.coordinates.length===4&&!r.coordinates.some(d=>!Array.isArray(d)||d.length!==2||d.some(f=>typeof f!="number"))||this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${l}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${l}`,null,'missing required property "coordinates"'))),r.animate&&typeof r.animate!="boolean"&&this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${l}`,null,'optional "animate" property must be a boolean value'))),r.canvas?typeof r.canvas=="string"||r.canvas instanceof a.window.HTMLCanvasElement||this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${l}`,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 a.ErrorEvent(new a.ValidationError(`sources.${l}`,null,'missing required property "canvas"'))),this.options=r,this.animate=r.animate===void 0||r.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof a.window.HTMLCanvasElement?this.options.canvas:a.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new a.ErrorEvent(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(l){this.map=l,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let l=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,l=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,l=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const r=this.map.painter.context;this.texture?(l||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new a.Texture(r,this.canvas,r.gl.RGBA,{premultiply:!0}),this._prepareData(r)}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const l of[this.canvas.width,this.canvas.height])if(isNaN(l)||l<=0)return!0;return!1}},custom:class extends a.Evented{constructor(l,r,o,h){super(),this.id=l,this.type="custom",this._dataType="raster",this._dispatcher=o,this._implementation=r,this.setEventedParent(h),this.scheme="xyz",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this._loaded=!1,this.roundZoom=!0,this._implementation||this.fire(new a.ErrorEvent(new Error(`Missing implementation for ${this.id} custom source`))),this._implementation.loadTile||this.fire(new a.ErrorEvent(new Error(`Missing loadTile implementation for ${this.id} custom source`))),this._implementation.bounds&&(this.tileBounds=new wr(this._implementation.bounds,this.minzoom,this.maxzoom)),r.update=this._update.bind(this),r.clearTiles=this._clearTiles.bind(this),r.coveringTiles=this._coveringTiles.bind(this),a.extend(this,a.pick(r,["dataType","scheme","minzoom","maxzoom","tileSize","attribution","minTileCacheSize","maxTileCacheSize"]))}serialize(){return a.pick(this,["type","scheme","minzoom","maxzoom","tileSize","attribution"])}load(){this._loaded=!0,this.fire(new a.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"content"}))}loaded(){return this._loaded}onAdd(l){this._map=l,this._loaded=!1,this.fire(new a.Event("dataloading",{dataType:"source"})),this._implementation.onAdd&&this._implementation.onAdd(l),this.load()}onRemove(l){this._implementation.onRemove&&this._implementation.onRemove(l)}hasTile(l){if(this._implementation.hasTile){const{x:r,y:o,z:h}=l.canonical;return this._implementation.hasTile({x:r,y:o,z:h})}return!this.tileBounds||this.tileBounds.contains(l.canonical)}loadTile(l,r){const{x:o,y:h,z:d}=l.tileID.canonical,f=new a.window.AbortController;l.request=Promise.resolve(this._implementation.loadTile({x:o,y:h,z:d},{signal:f.signal})).then((function(g){return delete l.request,l.aborted?(l.state="unloaded",r(null)):g===void 0?(l.state="errored",r(null)):g===null?(this.loadTileData(l,{width:this.tileSize,height:this.tileSize,data:null}),l.state="loaded",r(null)):function(y){return y instanceof a.window.ImageData||y instanceof a.window.HTMLCanvasElement||y instanceof a.window.ImageBitmap||y instanceof a.window.HTMLImageElement}(g)?(this.loadTileData(l,g),l.state="loaded",void r(null)):(l.state="errored",r(new Error(`Can't infer data type for ${this.id}, only raster data supported at the moment`)))}).bind(this)).catch(g=>{g.code!==20&&(l.state="errored",r(g))}),l.request.cancel=()=>f.abort()}loadTileData(l,r){Ie.loadTileData(l,r,this._map.painter)}unloadTileData(l){Ie.unloadTileData(l,this._map.painter)}unloadTile(l,r){if(this.unloadTileData(l),this._implementation.unloadTile){const{x:o,y:h,z:d}=l.tileID.canonical;this._implementation.unloadTile({x:o,y:h,z:d})}r()}abortTile(l,r){l.request&&l.request.cancel&&(l.request.cancel(),delete l.request),r()}hasTransition(){return!1}_coveringTiles(){return this._map.transform.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,roundZoom:this.roundZoom}).map(l=>({x:l.canonical.x,y:l.canonical.y,z:l.canonical.z}))}_clearTiles(){this._map.style._clearSource(this.id)}_update(){this.fire(new a.Event("data",{dataType:"source",sourceDataType:"content"}))}}},nt=function(l,r,o,h){const d=new Qe[r.type](l,r,o,h);if(d.id!==l)throw new Error(`Expected Source id to be ${l} instead of ${d.id}`);return a.bindAll(["load","abort","unload","serialize","prepare"],d),d};function ft(l,r){const o=a.identity([]);return a.scale(o,o,[.5*l.width,.5*-l.height,1]),a.translate(o,o,[1,-1,0]),a.multiply(o,o,l.calculateProjMatrix(r.toUnwrapped())),Float32Array.from(o)}function Vt(l,r,o,h,d,f,g,y=!1){const v=l.tilesIn(h,g,y);v.sort(yi);const E=[];for(const A of v)E.push({wrappedTileID:A.tile.tileID.wrapped().key,queryResults:A.tile.queryRenderedFeatures(r,o,l._state,A,d,f,ft(l.transform,A.tile.tileID),y)});const T=function(A){const k={},R={};for(const O of A){const B=O.queryResults,F=O.wrappedTileID,I=R[F]=R[F]||{};for(const L in B){const N=B[L],j=I[L]=I[L]||{},K=k[L]=k[L]||[];for(const J of N)j[J.featureIndex]||(j[J.featureIndex]=!0,K.push(J))}}return k}(E);for(const A in T)T[A].forEach(k=>{const R=k.feature,O=R.layer;O&&O.type!=="background"&&O.type!=="sky"&&(R.source=O.source,O["source-layer"]&&(R.sourceLayer=O["source-layer"]),R.state=R.id!==void 0?l.getFeatureState(O["source-layer"],R.id):{})});return T}function Xt(l,r){const o=l.getRenderableIds().map(f=>l.getTileByID(f)),h=[],d={};for(let f=0;f{o.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[sr]}numActive(){return Object.keys(this.active).length}}let Ti;function Zn(){return Ti||(Ti=new li),Ti}function Ah(l,r){const o={};for(const h in l)h!=="ref"&&(o[h]=l[h]);return a.refProperties.forEach(h=>{h in r&&(o[h]=r[h])}),o}function tc(l){l=l.slice();const r=Object.create(null);for(let o=0;o0?(d-g)/y:0;return this.points[f].mult(1-v).add(this.points[o].mult(v))}}class gn{constructor(r,o,h){const d=this.boxCells=[],f=this.circleCells=[];this.xCellCount=Math.ceil(r/h),this.yCellCount=Math.ceil(o/h);for(let g=0;gthis.width||d<0||o>this.height)return!f&&[];const y=[];if(r<=0&&o<=0&&this.width<=h&&this.height<=d){if(f)return!0;for(let v=0;v0:y}_queryCircle(r,o,h,d,f){const g=r-h,y=r+h,v=o-h,E=o+h;if(y<0||g>this.width||E<0||v>this.height)return!d&&[];const T=[];return this._forEachCell(g,v,y,E,this._queryCellCircle,T,{hitTest:d,circle:{x:r,y:o,radius:h},seenUids:{box:{},circle:{}}},f),d?T.length>0:T}query(r,o,h,d,f){return this._query(r,o,h,d,!1,f)}hitTest(r,o,h,d,f){return this._query(r,o,h,d,!0,f)}hitTestCircle(r,o,h,d){return this._queryCircle(r,o,h,!0,d)}_queryCell(r,o,h,d,f,g,y,v){const E=y.seenUids,T=this.boxCells[f];if(T!==null){const k=this.bboxes;for(const R of T)if(!E.box[R]){E.box[R]=!0;const O=4*R;if(r<=k[O+2]&&o<=k[O+3]&&h>=k[O+0]&&d>=k[O+1]&&(!v||v(this.boxKeys[R]))){if(y.hitTest)return g.push(!0),!0;g.push({key:this.boxKeys[R],x1:k[O],y1:k[O+1],x2:k[O+2],y2:k[O+3]})}}}const A=this.circleCells[f];if(A!==null){const k=this.circles;for(const R of A)if(!E.circle[R]){E.circle[R]=!0;const O=3*R;if(this._circleAndRectCollide(k[O],k[O+1],k[O+2],r,o,h,d)&&(!v||v(this.circleKeys[R]))){if(y.hitTest)return g.push(!0),!0;{const B=k[O],F=k[O+1],I=k[O+2];g.push({key:this.circleKeys[R],x1:B-I,y1:F-I,x2:B+I,y2:F+I})}}}}}_queryCellCircle(r,o,h,d,f,g,y,v){const E=y.circle,T=y.seenUids,A=this.boxCells[f];if(A!==null){const R=this.bboxes;for(const O of A)if(!T.box[O]){T.box[O]=!0;const B=4*O;if(this._circleAndRectCollide(E.x,E.y,E.radius,R[B+0],R[B+1],R[B+2],R[B+3])&&(!v||v(this.boxKeys[O])))return g.push(!0),!0}}const k=this.circleCells[f];if(k!==null){const R=this.circles;for(const O of k)if(!T.circle[O]){T.circle[O]=!0;const B=3*O;if(this._circlesCollide(R[B],R[B+1],R[B+2],E.x,E.y,E.radius)&&(!v||v(this.circleKeys[O])))return g.push(!0),!0}}}_forEachCell(r,o,h,d,f,g,y,v){const E=this._convertToXCellCoord(r),T=this._convertToYCellCoord(o),A=this._convertToXCellCoord(h),k=this._convertToYCellCoord(d);for(let R=E;R<=A;R++)for(let O=T;O<=k;O++)if(f.call(this,r,o,h,d,this.xCellCount*O+R,g,y,v))return}_convertToXCellCoord(r){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(r*this.xScale)))}_convertToYCellCoord(r){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(r*this.yScale)))}_circlesCollide(r,o,h,d,f,g){const y=d-r,v=f-o,E=h+g;return E*E>y*y+v*v}_circleAndRectCollide(r,o,h,d,f,g,y){const v=(g-d)/2,E=Math.abs(r-(d+v));if(E>v+h)return!1;const T=(y-f)/2,A=Math.abs(o-(f+T));if(A>T+h)return!1;if(E<=v||A<=T)return!0;const k=E-v,R=A-T;return k*k+R*R<=h*h}}const Sr={unknown:0,flipRequired:1,flipNotRequired:2},Po=Math.tan(85*Math.PI/180);function fe(l,r,o,h,d,f,g){const y=a.create();if(o)if(f.name==="globe"){const v=a.calculateGlobeLabelMatrix(d,r);a.multiply(y,y,v)}else{const v=Le([],g);y[0]=v[0],y[1]=v[1],y[4]=v[2],y[5]=v[3],h||a.rotateZ(y,y,d.angle)}else a.multiply(y,d.labelPlaneMatrix,l);return y}function Mr(l,r,o,h,d,f,g){const y=fe(l,r,o,h,d,f,g);return f.name==="globe"&&o||(y[2]=y[6]=y[10]=y[14]=0),y}function Ht(l,r,o,h,d,f,g){if(o){if(f.name==="globe"){const y=fe(l,r,o,h,d,f,g);return a.invert(y,y),a.multiply(y,l,y),y}{const y=a.clone(l),v=a.identity([]);return v[0]=g[0],v[1]=g[1],v[4]=g[2],v[5]=g[3],a.multiply(y,y,v),h||a.rotateZ(y,y,-d.angle),y}}return d.glCoordMatrix}function ci(l,r,o,h){const d=[l,r,o,1];o?a.transformMat4$1(d,d,h):at(d,d,h);const f=d[3];return d[0]/=f,d[1]/=f,d[2]/=f,d}function ic(l,r){return Math.min(.5+l/r*.5,1.5)}function lr(l,r){const o=l[0]/l[3],h=l[1]/l[3];return o>=-r[0]&&o<=r[0]&&h>=-r[1]&&h<=r[1]}function Ia(l,r,o,h,d,f,g,y,v,E){const T=o.transform,A=h?l.textSizeData:l.iconSizeData,k=a.evaluateSizeForZoom(A,o.transform.zoom),R=T.projection.name==="globe",O=[256/o.width*2+1,256/o.height*2+1],B=h?l.text.dynamicLayoutVertexArray:l.icon.dynamicLayoutVertexArray;B.clear();let F=null;R&&(F=h?l.text.globeExtVertexArray:l.icon.globeExtVertexArray);const I=l.lineVertexArray,L=h?l.text.placedSymbolArray:l.icon.placedSymbolArray,N=o.transform.width/o.transform.height;let j,K=!1;for(let J=0;JMath.abs(o)?{useVertical:!0}:l===a.WritingMode.vertical?h>0?{needsFlipping:!0}:null:r!==Sr.unknown&&function(d,f){return d===0||Math.abs(f/d)>Po}(o,h)?r===Sr.flipRequired?{needsFlipping:!0}:null:o<0?{needsFlipping:!0}:null}function Oe(l,r,o,h,d,f,g,y,v,E,T,A,k,R,O,B,F,I,L){const N=r/24,j=l.lineOffsetX*N,K=l.lineOffsetY*N,{lineStartIndex:J,glyphStartIndex:Y,numGlyphs:ie,segment:te,writingMode:le,flipState:Te}=l,oe=J+l.lineLength,ge=he=>{if(T){const[Me,ve,Ae]=he.up,Ge=E.length;a.updateGlobeVertexNormal(T,Ge+0,Me,ve,Ae),a.updateGlobeVertexNormal(T,Ge+1,Me,ve,Ae),a.updateGlobeVertexNormal(T,Ge+2,Me,ve,Ae),a.updateGlobeVertexNormal(T,Ge+3,Me,ve,Ae)}const[we,ae,_e]=he.point;a.addDynamicAttributes(E,we,ae,_e,he.angle)};if(ie>1){const he=rc(N,y,j,K,o,A,k,l,v,f,R,B,!1,F,I,L);if(!he)return{notEnoughRoom:!0};if(h&&!o){let[we,ae,_e]=he.first.point,[Me,ve,Ae]=he.last.point;[we,ae]=ci(we,ae,_e,g),[Me,ve]=ci(Me,ve,Ae,g);const Ge=qn(le,Te,(Me-we)*O,ve-ae);if(l.flipState=Ge&&Ge.needsFlipping?Sr.flipRequired:Sr.flipNotRequired,Ge)return Ge}ge(he.first);for(let we=Y+1;we0?Me:st(k,_e,we,1,d,void 0,F,I.canonical),Ae=qn(le,Te,(ve[0]-we[0])*O,ve[1]-we[1]);if(l.flipState=Ae&&Ae.needsFlipping?Sr.flipRequired:Sr.flipNotRequired,Ae)return Ae}const he=Bi(N*y.getoffsetX(Y),j,K,o,A,k,te,J,oe,v,f,R,B,!1,!1,F,I,L);if(!he)return{notEnoughRoom:!0};ge(he)}return{}}function ut(l,r,o,h,d){const{x:f,y:g,z:y}=h.projectTilePoint(l.x,l.y,r);if(!d)return ci(f,g,y,o);const[v,E,T]=d(l);return ci(f+v,g+E,y+T,o)}function st(l,r,o,h,d,f,g,y){const v=ut(l.sub(r)._unit()._add(l),y,d,g,f);return a.sub(v,o,v),a.normalize(v,v),a.scaleAndAdd(v,o,v,h)}function Bi(l,r,o,h,d,f,g,y,v,E,T,A,k,R,O,B,F,I){const L=h?l-r:l+r;let N=L>0?1:-1,j=0;h&&(N*=-1,j=Math.PI),N<0&&(j+=Math.PI);let K=y+g+(N>0?0:1)|0,J=d,Y=d,ie=0,te=0;const le=Math.abs(L),Te=[],oe=[];let ge=f,he=ge;const we=()=>st(he,ge,Y,le-ie+1,T,k,B,F.canonical);for(;ie+te<=le;){if(K+=N,K=v)return null;if(Y=J,he=ge,Te.push(Y),R&&oe.push(he),ge=new a.Point(E.getx(K),E.gety(K)),J=A[K],!J){const qe=ut(ge,F.canonical,T,B,k);J=qe[3]>0?A[K]=qe:we()}ie+=te,te=a.distance(Y,J)}O&&k&&(A[K]&&(J=we(),te=a.distance(Y,J)),A[K]=J);const ae=(le-ie)/te,_e=ge.sub(he)._mult(ae)._add(he),Me=a.sub([],J,Y),ve=a.scaleAndAdd([],Y,Me,ae);let Ae=[0,0,1],Ge=Me[0],Xe=Me[1];if(I&&(Ae=B.upVector(F.canonical,_e.x,_e.y),Ae[0]!==0||Ae[1]!==0||Ae[2]!==1)){const qe=[Ae[2],0,-Ae[0]],lt=a.cross([],Ae,qe);a.normalize(qe,qe),a.normalize(lt,lt),Ge=a.dot(Me,qe),Xe=a.dot(Me,lt)}if(o){const qe=a.cross([],Ae,Me);a.normalize(qe,qe),a.scaleAndAdd(ve,ve,qe,o*N)}const Ve=j+Math.atan2(Xe,Ge);return Te.push(ve),R&&oe.push(_e),{point:ve,angle:Ve,path:Te,tilePath:oe,up:Ae}}function er(l,r){const o=r.length,h=o+4*l;r.resize(h),r.float32.fill(-1/0,4*o,4*h)}function at(l,r,o){const h=r[0],d=r[1];return l[0]=o[0]*h+o[4]*d+o[12],l[1]=o[1]*h+o[5]*d+o[13],l[3]=o[3]*h+o[7]*d+o[15],l}const Oi=100;class ko{constructor(r,o,h=new gn(r.width+200,r.height+200,25),d=new gn(r.width+200,r.height+200,25)){this.transform=r,this.grid=h,this.ignoredGrid=d,this.pitchfactor=Math.cos(r._pitch)*r.cameraToCenterDistance,this.screenRightBoundary=r.width+Oi,this.screenBottomBoundary=r.height+Oi,this.gridRightBoundary=r.width+200,this.gridBottomBoundary=r.height+200,this.fogState=o}placeCollisionBox(r,o,h,d,f,g,y,v){let E=h.projectedAnchorX,T=h.projectedAnchorY,A=h.projectedAnchorZ;const k=h.elevation,R=h.tileID,O=r.getProjection();if(k&&R){const[J,Y,ie]=O.upVector(R.canonical,h.tileAnchorX,h.tileAnchorY),te=O.upVectorScale(R.canonical,this.transform.center.lat,this.transform.worldSize).metersToTile;E+=J*k*te,T+=Y*k*te,A+=ie*k*te}const B=this.projectAndGetPerspectiveRatio(y,E,T,A,h.tileID,O.name==="globe"||!!k||this.transform.pitch>0,O),F=g*B.perspectiveRatio,I=(h.x1*o+d.x-h.padding)*F+B.point.x,L=(h.y1*o+d.y-h.padding)*F+B.point.y,N=(h.x2*o+d.x+h.padding)*F+B.point.x,j=(h.y2*o+d.y+h.padding)*F+B.point.y,K=B.perspectiveRatio<=.55||B.occluded;return!this.isInsideGrid(I,L,N,j)||!f&&this.grid.hitTest(I,L,N,j,v)||K?{box:[],offscreen:!1,occluded:B.occluded}:{box:[I,L,N,j],offscreen:this.isOffscreen(I,L,N,j),occluded:!1}}placeCollisionCircles(r,o,h,d,f,g,y,v,E,T,A,k,R,O,B){const F=[],I=this.transform.elevation,L=r.getProjection(),N=I?I.getAtTileOffsetFunc(B,this.transform.center.lat,this.transform.worldSize,L):null,j=new a.Point(h.tileAnchorX,h.tileAnchorY);let{x:K,y:J,z:Y}=L.projectTilePoint(j.x,j.y,B.canonical);if(N){const[_e,Me,ve]=N(j);K+=_e,J+=Me,Y+=ve}const ie=L.name==="globe",te=this.projectAndGetPerspectiveRatio(y,K,J,Y,B,ie||!!I||this.transform.pitch>0,L),{perspectiveRatio:le}=te,Te=(A?g/le:g*le)/a.ONE_EM,oe=ci(K,J,Y,v),ge=te.signedDistanceFromCamera>0?rc(Te,f,h.lineOffsetX*Te,h.lineOffsetY*Te,!1,oe,j,h,d,v,{},I&&!A?N:null,A&&!!I,L,B,A):null;let he=!1,we=!1,ae=!0;if(ge&&!te.occluded){const _e=.5*R*le+O,Me=new a.Point(-100,-100),ve=new a.Point(this.screenRightBoundary,this.screenBottomBoundary),Ae=new Aa,{first:Ge,last:Xe}=ge,Ve=Ge.path.length;let qe=[];for(let je=Ve-1;je>=1;je--)qe.push(Ge.path[je]);for(let je=1;je(N&&!ie&&(Tt=N(Etje[3]<=0)&&(qe=[]));let ot=[];if(qe.length>0){let je=1/0,wt=-1/0,Tt=1/0,Et=-1/0;for(const St of qe)je=Math.min(je,St[0]),Tt=Math.min(Tt,St[1]),wt=Math.max(wt,St[0]),Et=Math.max(Et,St[1]);wt>=Me.x&&je<=ve.x&&Et>=Me.y&&Tt<=ve.y&&(ot=[qe.map(St=>new a.Point(St[0],St[1]))],(jeve.x||Ttve.y)&&(ot=a.clipLine(ot,Me.x,Me.y,ve.x,ve.y)))}for(const je of ot){Ae.reset(je,.25*_e);let wt=0;wt=Ae.length<=.5*_e?1:Math.ceil(Ae.paddedLength/lt)+1;for(let Tt=0;Tt0?(a.transformMat4$1(v,v,r),this.fogState&&f&&y.name!=="globe"&&(E=function(k,R,O,B,F,I){const L=I.calculateFogTileMatrix(F),N=[R,O,B];return a.transformMat4(N,N,L),Eo(k,N,I.pitch,I._fov)}(this.fogState,o,h,d,f.toUnwrapped(),this.transform)>.9)):at(v,v,r);const T=v[3];return{point:new a.Point((v[0]/T+1)/2*this.transform.width+Oi,(-v[1]/T+1)/2*this.transform.height+Oi),perspectiveRatio:Math.min(.5+this.transform.getCameraToCenterDistance(y)/T*.5,1.5),signedDistanceFromCamera:T,occluded:g&&v[2]>T||E}}isOffscreen(r,o,h,d){return h=this.screenRightBoundary||dthis.screenBottomBoundary}isInsideGrid(r,o,h,d){return h>=0&&r=0&&oh.collisionGroupID===o}}return this.collisionGroups[r]}}function Ro(l,r,o,h,d){const{horizontalAlign:f,verticalAlign:g}=a.getAnchorAlignment(l),y=-(f-.5)*r,v=-(g-.5)*o,E=a.evaluateVariableOffset(l,h);return new a.Point(y+E[0]*d,v+E[1]*d)}function Bo(l,r,o,h,d){const f=new a.Point(l,r);return o&&f._rotate(h?d:-d),f}class Ss{constructor(r,o,h,d,f){this.transform=r.clone(),this.projection=r.projection.name,this.collisionIndex=new ko(this.transform,f),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=o,this.retainedQueryData={},this.collisionGroups=new oc(h),this.collisionCircleArrays={},this.prevPlacement=d,d&&(d.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(r,o,h,d){const f=h.getBucket(o),g=h.latestFeatureIndex;if(!f||!g||o.id!==f.layerIds[0])return;const y=f.layers[0].layout,v=h.collisionBoxArray,E=Math.pow(2,this.transform.zoom-h.tileID.overscaledZ),T=h.tileSize/a.EXTENT,A=h.tileID.toUnwrapped();this.transform.setProjection(f.projection);const k=(R=h.tileID,O=f.getProjection(),B=this.transform,O.name===this.projection?B.calculateProjMatrix(R.toUnwrapped()):yn(B,O,R));var R,O,B;const F=y.get("text-pitch-alignment")==="map",I=y.get("text-rotation-alignment")==="map";o.compileFilter();const L=o.dynamicFilter(),N=o.dynamicFilterNeedsFeature(),j=this.transform.calculatePixelsToTileUnitsMatrix(h),K=Mr(k,h.tileID.canonical,F,I,this.transform,f.getProjection(),j);let J=null;if(F){const te=Ht(k,h.tileID.canonical,F,I,this.transform,f.getProjection(),j);J=a.multiply([],this.transform.labelPlaneMatrix,te)}let Y=null;L&&h.latestFeatureIndex&&(Y={unwrappedTileID:A,dynamicFilter:L,dynamicFilterNeedsFeature:N,featureIndex:h.latestFeatureIndex}),this.retainedQueryData[f.bucketInstanceId]=new Ca(f.bucketInstanceId,g,f.sourceLayerIndex,f.index,h.tileID);const ie={bucket:f,layout:y,posMatrix:k,textLabelPlaneMatrix:K,labelToScreenMatrix:J,clippingData:Y,scale:E,textPixelRatio:T,holdingForFade:h.holdingForFade(),collisionBoxArray:v,partiallyEvaluatedTextSize:a.evaluateSizeForZoom(f.textSizeData,this.transform.zoom),partiallyEvaluatedIconSize:a.evaluateSizeForZoom(f.iconSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(f.sourceID)};if(d)for(const te of f.sortKeyRanges){const{sortKey:le,symbolInstanceStart:Te,symbolInstanceEnd:oe}=te;r.push({sortKey:le,symbolInstanceStart:Te,symbolInstanceEnd:oe,parameters:ie})}else r.push({symbolInstanceStart:0,symbolInstanceEnd:f.symbolInstances.length,parameters:ie})}attemptAnchorPlacement(r,o,h,d,f,g,y,v,E,T,A,k,R,O,B,F,I,L){const{textOffset0:N,textOffset1:j,crossTileID:K}=k,J=[N,j],Y=Ro(r,h,d,J,f),ie=this.collisionIndex.placeCollisionBox(O,f,o,Bo(Y.x,Y.y,g,y,this.transform.angle),A,v,E,T.predicate);if(F){const te=O.getSymbolInstanceIconSize(L,this.transform.zoom,k.placedIconSymbolIndex);if(this.collisionIndex.placeCollisionBox(O,te,F,Bo(Y.x,Y.y,g,y,this.transform.angle),A,v,E,T.predicate).box.length===0)return}if(ie.box.length>0){let te;return this.prevPlacement&&this.prevPlacement.variableOffsets[K]&&this.prevPlacement.placements[K]&&this.prevPlacement.placements[K].text&&(te=this.prevPlacement.variableOffsets[K].anchor),this.variableOffsets[K]={textOffset:J,width:h,height:d,anchor:r,textScale:f,prevAnchor:te},this.markUsedJustification(O,r,k,B),O.allowVerticalPlacement&&(this.markUsedOrientation(O,B,k),this.placedOrientations[K]=B),{shift:Y,placedGlyphBoxes:ie}}}placeLayerBucketPart(r,o,h,d){const{bucket:f,layout:g,posMatrix:y,textLabelPlaneMatrix:v,labelToScreenMatrix:E,clippingData:T,textPixelRatio:A,holdingForFade:k,collisionBoxArray:R,partiallyEvaluatedTextSize:O,partiallyEvaluatedIconSize:B,collisionGroup:F}=r.parameters,I=g.get("text-optional"),L=g.get("icon-optional"),N=g.get("text-allow-overlap"),j=g.get("icon-allow-overlap"),K=g.get("text-rotation-alignment")==="map",J=g.get("text-pitch-alignment")==="map",Y=g.get("icon-text-fit")!=="none",ie=g.get("symbol-z-order")==="viewport-y";this.transform.setProjection(f.projection);let te=N&&(j||!f.hasIconData()||L),le=j&&(N||!f.hasTextData()||I);!f.collisionArrays&&R&&f.deserializeCollisionBoxes(R),h&&d&&f.updateCollisionDebugBuffers(this.transform.zoom,R);const Te=(oe,ge,he)=>{const{crossTileID:we,numVerticalGlyphVertices:ae}=oe;if(T){const Ft={zoom:this.transform.zoom,pitch:this.transform.pitch};let Mt=null;if(T.dynamicFilterNeedsFeature){const yt=this.retainedQueryData[f.bucketInstanceId];Mt=T.featureIndex.loadFeature({featureIndex:oe.featureIndex,bucketIndex:yt.bucketIndex,sourceLayerIndex:yt.sourceLayerIndex,layoutVertexArrayOffset:0})}if(!(0,T.dynamicFilter)(Ft,Mt,this.retainedQueryData[f.bucketInstanceId].tileID.canonical,new a.Point(oe.tileAnchorX,oe.tileAnchorY),this.transform.calculateDistanceTileData(T.unwrappedTileID)))return this.placements[we]=new Do(!1,!1,!1,!0),void o.add(we)}if(o.has(we))return;if(k)return void(this.placements[we]=new Do(!1,!1,!1));let _e=!1,Me=!1,ve=!0,Ae=!1,Ge=!1,Xe=null,Ve={box:null,offscreen:null,occluded:null},qe={box:null,offscreen:null,occluded:null},lt=null,ot=null,je=null,wt=0,Tt=0,Et=0;he.textFeatureIndex?wt=he.textFeatureIndex:oe.useRuntimeCollisionCircles&&(wt=oe.featureIndex),he.verticalTextFeatureIndex&&(Tt=he.verticalTextFeatureIndex);const St=Ft=>{Ft.tileID=this.retainedQueryData[f.bucketInstanceId].tileID;const Mt=this.transform.elevation;(Mt||Ft.elevation)&&(Ft.elevation=Mt?Mt.getAtTileOffset(Ft.tileID,Ft.tileAnchorX,Ft.tileAnchorY):0)},vi=he.textBox;if(vi){St(vi);const Ft=yt=>{let Kt=a.WritingMode.horizontal;if(f.allowVerticalPlacement&&!yt&&this.prevPlacement){const Ei=this.prevPlacement.placedOrientations[we];Ei&&(this.placedOrientations[we]=Ei,Kt=Ei,this.markUsedOrientation(f,Kt,oe))}return Kt},Mt=(yt,Kt)=>{if(f.allowVerticalPlacement&&ae>0&&he.verticalTextBox){for(const Ei of f.writingModes)if(Ei===a.WritingMode.vertical?(Ve=Kt(),qe=Ve):Ve=yt(),Ve&&Ve.box&&Ve.box.length)break}else Ve=yt()};if(g.get("text-variable-anchor")){let yt=g.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[we]){const Bt=this.prevPlacement.variableOffsets[we];yt.indexOf(Bt.anchor)>0&&(yt=yt.filter(Ii=>Ii!==Bt.anchor),yt.unshift(Bt.anchor))}const Kt=(Bt,Ii,Js)=>{const Mn=f.getSymbolInstanceTextSize(O,oe,this.transform.zoom,ge),is=(Bt.x2-Bt.x1)*Mn+2*Bt.padding,Lr=(Bt.y2-Bt.y1)*Mn+2*Bt.padding,Jr=Y&&!j?Ii:null;Jr&&St(Jr);let An={box:[],offscreen:!1,occluded:!1};const Qs=N?2*yt.length:yt.length;for(let rs=0;rs=yt.length,oe,ge,f,Js,Jr,O,B);if(xl&&(An=xl.placedGlyphBoxes,An&&An.box&&An.box.length)){_e=!0,Xe=xl.shift;break}}return An};Mt(()=>Kt(vi,he.iconBox,a.WritingMode.horizontal),()=>{const Bt=he.verticalTextBox;return Bt&&St(Bt),f.allowVerticalPlacement&&!(Ve&&Ve.box&&Ve.box.length)&&ae>0&&Bt?Kt(Bt,he.verticalIconBox,a.WritingMode.vertical):{box:null,offscreen:null,occluded:null}}),Ve&&(_e=Ve.box,ve=Ve.offscreen,Ae=Ve.occluded);const Ei=Ft(!(!Ve||!Ve.box));if(!_e&&this.prevPlacement){const Bt=this.prevPlacement.variableOffsets[we];Bt&&(this.variableOffsets[we]=Bt,this.markUsedJustification(f,Bt.anchor,oe,Ei))}}else{const yt=(Kt,Ei)=>{const Bt=f.getSymbolInstanceTextSize(O,oe,this.transform.zoom,ge),Ii=this.collisionIndex.placeCollisionBox(f,Bt,Kt,new a.Point(0,0),N,A,y,F.predicate);return Ii&&Ii.box&&Ii.box.length&&(this.markUsedOrientation(f,Ei,oe),this.placedOrientations[we]=Ei),Ii};Mt(()=>yt(vi,a.WritingMode.horizontal),()=>{const Kt=he.verticalTextBox;return f.allowVerticalPlacement&&ae>0&&Kt?(St(Kt),yt(Kt,a.WritingMode.vertical)):{box:null,offscreen:null,occluded:null}}),Ft(!!(Ve&&Ve.box&&Ve.box.length))}}if(lt=Ve,_e=lt&<.box&<.box.length>0,ve=lt&<.offscreen,Ae=lt&<.occluded,oe.useRuntimeCollisionCircles){const Ft=f.text.placedSymbolArray.get(oe.centerJustifiedTextSymbolIndex>=0?oe.centerJustifiedTextSymbolIndex:oe.verticalPlacedTextSymbolIndex),Mt=a.evaluateSizeForFeature(f.textSizeData,O,Ft),yt=g.get("text-padding");ot=this.collisionIndex.placeCollisionCircles(f,N,Ft,f.lineVertexArray,f.glyphOffsetArray,Mt,y,v,E,h,J,F.predicate,oe.collisionCircleDiameter*Mt/a.ONE_EM,yt,this.retainedQueryData[f.bucketInstanceId].tileID),_e=N||ot.circles.length>0&&!ot.collisionDetected,ve=ve&&ot.offscreen,Ae=ot.occluded}if(he.iconFeatureIndex&&(Et=he.iconFeatureIndex),he.iconBox){const Ft=Mt=>{St(Mt);const yt=Y&&Xe?Bo(Xe.x,Xe.y,K,J,this.transform.angle):new a.Point(0,0),Kt=f.getSymbolInstanceIconSize(B,this.transform.zoom,oe.placedIconSymbolIndex);return this.collisionIndex.placeCollisionBox(f,Kt,Mt,yt,j,A,y,F.predicate)};qe&&qe.box&&qe.box.length&&he.verticalIconBox?(je=Ft(he.verticalIconBox),Me=je.box.length>0):(je=Ft(he.iconBox),Me=je.box.length>0),ve=ve&&je.offscreen,Ge=je.occluded}const ui=I||oe.numHorizontalGlyphVertices===0&&ae===0,Zi=L||oe.numIconVertices===0;if(ui||Zi?Zi?ui||(Me=Me&&_e):_e=Me&&_e:Me=_e=Me&&_e,_e&<&<.box&&this.collisionIndex.insertCollisionBox(lt.box,g.get("text-ignore-placement"),f.bucketInstanceId,qe&&qe.box&&Tt?Tt:wt,F.ID),Me&&je&&this.collisionIndex.insertCollisionBox(je.box,g.get("icon-ignore-placement"),f.bucketInstanceId,Et,F.ID),ot&&(_e&&this.collisionIndex.insertCollisionCircles(ot.circles,g.get("text-ignore-placement"),f.bucketInstanceId,wt,F.ID),h)){const Ft=f.bucketInstanceId;let Mt=this.collisionCircleArrays[Ft];Mt===void 0&&(Mt=this.collisionCircleArrays[Ft]=new Lo);for(let yt=0;yt=0;--ge){const he=oe[ge];Te(f.symbolInstances.get(he),he,f.collisionArrays[he])}}else for(let oe=r.symbolInstanceStart;oe=0&&(r.text.placedSymbolArray.get(f).crossTileID=A>=0&&f!==A?0:E),g>=0&&(r.text.placedSymbolArray.get(g).crossTileID=A>=0&&g!==A?0:E),y>=0&&(r.text.placedSymbolArray.get(y).crossTileID=A>=0&&y!==A?0:E),v>=0&&(r.text.placedSymbolArray.get(v).crossTileID=A>=0&&v!==A?0:E)}markUsedOrientation(r,o,h){const d=o===a.WritingMode.horizontal||o===a.WritingMode.horizontalOnly?o:0,f=o===a.WritingMode.vertical?o:0,{leftJustifiedTextSymbolIndex:g,centerJustifiedTextSymbolIndex:y,rightJustifiedTextSymbolIndex:v,verticalPlacedTextSymbolIndex:E}=h,T=r.text.placedSymbolArray;g>=0&&(T.get(g).placedOrientation=d),y>=0&&(T.get(y).placedOrientation=d),v>=0&&(T.get(v).placedOrientation=d),E>=0&&(T.get(E).placedOrientation=f)}commit(r){this.commitTime=r,this.zoomAtLastRecencyCheck=this.transform.zoom;const o=this.prevPlacement;let h=!1;this.prevZoomAdjustment=o?o.zoomAdjustment(this.transform.zoom):0;const d=o?o.symbolFadeChange(r):1,f=o?o.opacities:{},g=o?o.variableOffsets:{},y=o?o.placedOrientations:{};for(const v in this.placements){const E=this.placements[v],T=f[v];T?(this.opacities[v]=new Ar(T,d,E.text,E.icon,null,E.clipped),h=h||E.text!==T.text.placed||E.icon!==T.icon.placed):(this.opacities[v]=new Ar(null,d,E.text,E.icon,E.skipFade,E.clipped),h=h||E.text||E.icon)}for(const v in f){const E=f[v];if(!this.opacities[v]){const T=new Ar(E,d,!1,!1);T.isHidden()||(this.opacities[v]=T,h=h||E.text.placed||E.icon.placed)}}for(const v in g)this.variableOffsets[v]||!this.opacities[v]||this.opacities[v].isHidden()||(this.variableOffsets[v]=g[v]);for(const v in y)this.placedOrientations[v]||!this.opacities[v]||this.opacities[v].isHidden()||(this.placedOrientations[v]=y[v]);h?this.lastPlacementChangeTime=r:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=o?o.lastPlacementChangeTime:r)}updateLayerOpacities(r,o){const h=new Set;for(const d of o){const f=d.getBucket(r);f&&d.latestFeatureIndex&&r.id===f.layerIds[0]&&this.updateBucketOpacities(f,h,d.collisionBoxArray)}}updateBucketOpacities(r,o,h){r.hasTextData()&&r.text.opacityVertexArray.clear(),r.hasIconData()&&r.icon.opacityVertexArray.clear(),r.hasIconCollisionBoxData()&&r.iconCollisionBox.collisionVertexArray.clear(),r.hasTextCollisionBoxData()&&r.textCollisionBox.collisionVertexArray.clear();const d=r.layers[0].layout,f=!!r.layers[0].dynamicFilter(),g=new Ar(null,0,!1,!1,!0),y=d.get("text-allow-overlap"),v=d.get("icon-allow-overlap"),E=d.get("text-variable-anchor"),T=d.get("text-rotation-alignment")==="map",A=d.get("text-pitch-alignment")==="map",k=d.get("icon-text-fit")!=="none",R=new Ar(null,0,y&&(v||!r.hasIconData()||d.get("icon-optional")),v&&(y||!r.hasTextData()||d.get("text-optional")),!0);!r.collisionArrays&&h&&(r.hasIconCollisionBoxData()||r.hasTextCollisionBoxData())&&r.deserializeCollisionBoxes(h);const O=(F,I,L)=>{for(let N=0;N0||N>0,te=K>0,le=this.placedOrientations[j],Te=le===a.WritingMode.vertical,oe=le===a.WritingMode.horizontal||le===a.WritingMode.horizontalOnly;if(!ie&&!te||Y.isHidden()||B++,ie){const ge=Oo(Y.text);O(r.text,L,Te?Gt:ge),O(r.text,N,oe?Gt:ge);const he=Y.text.isHidden(),{leftJustifiedTextSymbolIndex:we,centerJustifiedTextSymbolIndex:ae,rightJustifiedTextSymbolIndex:_e,verticalPlacedTextSymbolIndex:Me}=I,ve=r.text.placedSymbolArray,Ae=he||Te?1:0;we>=0&&(ve.get(we).hidden=Ae),ae>=0&&(ve.get(ae).hidden=Ae),_e>=0&&(ve.get(_e).hidden=Ae),Me>=0&&(ve.get(Me).hidden=he||oe?1:0);const Ge=this.variableOffsets[j];Ge&&this.markUsedJustification(r,Ge.anchor,I,le);const Xe=this.placedOrientations[j];Xe&&(this.markUsedJustification(r,"left",I,Xe),this.markUsedOrientation(r,Xe,I))}if(te){const ge=Oo(Y.icon),{placedIconSymbolIndex:he,verticalPlacedIconSymbolIndex:we}=I,ae=r.icon.placedSymbolArray,_e=Y.icon.isHidden()?1:0;he>=0&&(O(r.icon,K,Te?Gt:ge),ae.get(he).hidden=_e),we>=0&&(O(r.icon,I.numVerticalIconVertices,oe?Gt:ge),ae.get(we).hidden=_e)}if(r.hasIconCollisionBoxData()||r.hasTextCollisionBoxData()){const ge=r.collisionArrays[F];if(ge){let he=new a.Point(0,0),we=!0;if(ge.textBox||ge.verticalTextBox){if(E){const _e=this.variableOffsets[j];_e?(he=Ro(_e.anchor,_e.width,_e.height,_e.textOffset,_e.textScale),T&&he._rotate(A?this.transform.angle:-this.transform.angle)):we=!1}f&&(we=!Y.clipped),ge.textBox&&Wn(r.textCollisionBox.collisionVertexArray,Y.text.placed,!we||Te,he.x,he.y),ge.verticalTextBox&&Wn(r.textCollisionBox.collisionVertexArray,Y.text.placed,!we||oe,he.x,he.y)}const ae=we&&!!(!oe&&ge.verticalIconBox);ge.iconBox&&Wn(r.iconCollisionBox.collisionVertexArray,Y.icon.placed,ae,k?he.x:0,k?he.y:0),ge.verticalIconBox&&Wn(r.iconCollisionBox.collisionVertexArray,Y.icon.placed,!ae,k?he.x:0,k?he.y:0)}}}if(r.fullyClipped=B===0,r.sortFeatures(this.transform.angle),this.retainedQueryData[r.bucketInstanceId]&&(this.retainedQueryData[r.bucketInstanceId].featureSortOrder=r.featureSortOrder),r.hasTextData()&&r.text.opacityVertexBuffer&&r.text.opacityVertexBuffer.updateData(r.text.opacityVertexArray),r.hasIconData()&&r.icon.opacityVertexBuffer&&r.icon.opacityVertexBuffer.updateData(r.icon.opacityVertexArray),r.hasIconCollisionBoxData()&&r.iconCollisionBox.collisionVertexBuffer&&r.iconCollisionBox.collisionVertexBuffer.updateData(r.iconCollisionBox.collisionVertexArray),r.hasTextCollisionBoxData()&&r.textCollisionBox.collisionVertexBuffer&&r.textCollisionBox.collisionVertexBuffer.updateData(r.textCollisionBox.collisionVertexArray),r.bucketInstanceId in this.collisionCircleArrays){const F=this.collisionCircleArrays[r.bucketInstanceId];r.placementInvProjMatrix=F.invProjMatrix,r.placementViewportMatrix=F.viewportMatrix,r.collisionCircleArray=F.circles,delete this.collisionCircleArrays[r.bucketInstanceId]}}symbolFadeChange(r){return this.fadeDuration===0?1:(r-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(r){return Math.max(0,(this.transform.zoom-r)/1.5)}hasTransitions(r){return this.stale||r-this.lastPlacementChangeTimer}setStale(){this.stale=!0}}function Wn(l,r,o,h,d){l.emplaceBack(r?1:0,o?1:0,h||0,d||0),l.emplaceBack(r?1:0,o?1:0,h||0,d||0),l.emplaceBack(r?1:0,o?1:0,h||0,d||0),l.emplaceBack(r?1:0,o?1:0,h||0,d||0)}const Mi=Math.pow(2,25),Zt=Math.pow(2,24),za=Math.pow(2,17),Pa=Math.pow(2,16),Ai=Math.pow(2,9),ji=Math.pow(2,8),sc=Math.pow(2,1);function Oo(l){if(l.opacity===0&&!l.placed)return 0;if(l.opacity===1&&l.placed)return 4294967295;const r=l.placed?1:0,o=Math.floor(127*l.opacity);return o*Mi+r*Zt+o*za+r*Pa+o*Ai+r*ji+o*sc+r}const Gt=0;class Fo{constructor(r){this._sortAcrossTiles=r.layout.get("symbol-z-order")!=="viewport-y"&&r.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs=new Set,this._bucketParts=[]}continuePlacement(r,o,h,d,f){const g=this._bucketParts;for(;this._currentTileIndexy.sortKey-v.sortKey));this._currentPartIndex{const g=a.exported.now()-d;return!this._forceFullPlacement&&g>2};for(;this._currentPlacementIndex>=0;){const g=o[r[this._currentPlacementIndex]],y=this.placement.collisionIndex.transform.zoom;if(g.type==="symbol"&&(!g.minzoom||g.minzoom<=y)&&(!g.maxzoom||g.maxzoom>y)){if(this._inProgressLayer||(this._inProgressLayer=new Fo(g)),this._inProgressLayer.continuePlacement(h[g.source],this.placement,this._showCollisionBoxes,g,f))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(r){return this.placement.commit(r),this.placement}}const xn=512/a.EXTENT/2;class fi{constructor(r,o,h){this.tileID=r,this.bucketInstanceId=h,this.index=new a.KDBush(o.length,16,Int32Array),this.keys=[],this.crossTileIDs=[];const d=r.canonical.x*a.EXTENT,f=r.canonical.y*a.EXTENT;for(let g=0;gr.overscaledZ)for(const y in g){const v=g[y];v.tileID.isChildOf(r)&&v.findMatches(o.symbolInstances,r,d)}else{const y=g[r.scaledTo(Number(f)).key];y&&y.findMatches(o.symbolInstances,r,d)}}for(let f=0;f{o[h]=!0});for(const h in this.layerIndexes)o[h]||delete this.layerIndexes[h]}}const Kr=(l,r)=>a.emitValidationErrors(l,r&&r.filter(o=>o.identifier!=="source.canvas")),Ms=a.pick(vt,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setTerrain","setFog","setProjection"]),Ih=a.pick(vt,["setCenter","setZoom","setBearing","setPitch"]),Ra={version:8,layers:[],sources:{}},Xn={fill:!0,line:!0,background:!0,hillshade:!0,raster:!0};class cr extends a.Evented{constructor(r,o={}){super(),this.map=r,this.dispatcher=new oi(Zn(),this),this.imageManager=new wa,this.imageManager.setEventedParent(this),this.glyphManager=new a.GlyphManager(r._requestManager,o.localFontFamily?a.LocalGlyphMode.all:o.localIdeographFontFamily?a.LocalGlyphMode.ideographs:a.LocalGlyphMode.none,o.localFontFamily||o.localIdeographFontFamily),this.crossTileSymbolIndex=new Ir,this._layers={},this._num3DLayers=0,this._numSymbolLayers=0,this._numCircleLayers=0,this._serializedLayers={},this._sourceCaches={},this._otherSourceCaches={},this._symbolSourceCaches={},this._loaded=!1,this._availableImages=[],this._order=[],this._drapedFirstOrder=[],this._markersNeedUpdate=!1,this._resetUpdates(),this.dispatcher.broadcast("setReferrer",a.getReferrer());const h=this;this._rtlTextPluginCallback=cr.registerForPluginStateChange(d=>{h.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:d.pluginStatus,pluginURL:d.pluginURL},(f,g)=>{if(a.triggerPluginCompletionEvent(f),g&&g.every(y=>y))for(const y in h._sourceCaches){const v=h._sourceCaches[y],E=v.getSource().type;E!=="vector"&&E!=="geojson"||v.reload()}})}),this.on("data",d=>{if(d.dataType!=="source"||d.sourceDataType!=="metadata")return;const f=this.getSource(d.sourceId);if(f&&f.vectorLayerIds)for(const g in this._layers){const y=this._layers[g];y.source===f.id&&this._validateLayer(y)}})}loadURL(r,o={}){this.fire(new a.Event("dataloading",{dataType:"style"}));const h=typeof o.validate=="boolean"?o.validate:!a.isMapboxURL(r);r=this.map._requestManager.normalizeStyleURL(r,o.accessToken);const d=this.map._requestManager.transformRequest(r,a.ResourceType.Style);this._request=a.getJSON(d,(f,g)=>{this._request=null,f?this.fire(new a.ErrorEvent(f)):g&&this._load(g,h)})}loadJSON(r,o={}){this.fire(new a.Event("dataloading",{dataType:"style"})),this._request=a.exported.frame(()=>{this._request=null,this._load(r,o.validate!==!1)})}loadEmpty(){this.fire(new a.Event("dataloading",{dataType:"style"})),this._load(Ra,!1)}_updateLayerCount(r,o){const h=o?1:-1;r.is3D()&&(this._num3DLayers+=h),r.type==="circle"&&(this._numCircleLayers+=h),r.type==="symbol"&&(this._numSymbolLayers+=h)}_load(r,o){if(o&&Kr(this,a.validateStyle(r)))return;this._loaded=!0,this.stylesheet=a.clone$1(r),this._updateMapProjection();for(const d in r.sources)this.addSource(d,r.sources[d],{validate:!1});this._changed=!1,r.sprite?this._loadSprite(r.sprite):(this.imageManager.setLoaded(!0),this.dispatcher.broadcast("spriteLoaded",!0)),this.glyphManager.setURL(r.glyphs);const h=tc(this.stylesheet.layers);this._order=h.map(d=>d.id),this._layers={},this._serializedLayers={};for(const d of h){const f=a.createStyleLayer(d);f.setEventedParent(this,{layer:{id:f.id}}),this._layers[f.id]=f,this._serializedLayers[f.id]=f.serialize(),this._updateLayerCount(f,!0)}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new si(this.stylesheet.light),this.stylesheet.terrain&&!this.terrainSetForDrapingOnly()&&this._createTerrain(this.stylesheet.terrain,1),this.stylesheet.fog&&this._createFog(this.stylesheet.fog),this._updateDrapeFirstLayers(),this.fire(new a.Event("data",{dataType:"style"})),this.fire(new a.Event("style.load"))}terrainSetForDrapingOnly(){return!!this.terrain&&this.terrain.drapeRenderMode===0}setProjection(r){r?this.stylesheet.projection=r:delete this.stylesheet.projection,this._updateMapProjection()}applyProjectionUpdate(){this._loaded&&(this.dispatcher.broadcast("setProjection",this.map.transform.projectionOptions),this.map.transform.projection.requiresDraping?this.getTerrain()||this.stylesheet.terrain||this.setTerrainForDraping():this.terrainSetForDrapingOnly()&&this.setTerrain(null))}_updateMapProjection(){this.map._useExplicitProjection?this.applyProjectionUpdate():this.map._prioritizeAndUpdateProjection(null,this.stylesheet.projection)}_loadSprite(r){this._spriteRequest=function(o,h,d){let f,g,y;const v=a.exported.devicePixelRatio>1?"@2x":"";let E=a.getJSON(h.transformRequest(h.normalizeSpriteURL(o,v,".json"),a.ResourceType.SpriteJSON),(k,R)=>{E=null,y||(y=k,f=R,A())}),T=a.getImage(h.transformRequest(h.normalizeSpriteURL(o,v,".png"),a.ResourceType.SpriteImage),(k,R)=>{T=null,y||(y=k,g=R,A())});function A(){if(y)d(y);else if(f&&g){const k=a.exported.getImageData(g),R={};for(const O in f){const{width:B,height:F,x:I,y:L,sdf:N,pixelRatio:j,stretchX:K,stretchY:J,content:Y}=f[O],ie=new a.RGBAImage({width:B,height:F});a.RGBAImage.copy(k,ie,{x:I,y:L},{x:0,y:0},{width:B,height:F}),R[O]={data:ie,pixelRatio:j,sdf:N,stretchX:K,stretchY:J,content:Y}}d(null,R)}}return{cancel(){E&&(E.cancel(),E=null),T&&(T.cancel(),T=null)}}}(r,this.map._requestManager,(o,h)=>{if(this._spriteRequest=null,o)this.fire(new a.ErrorEvent(o));else if(h)for(const d in h)this.imageManager.addImage(d,h[d]);this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),this.dispatcher.broadcast("setImages",this._availableImages),this.dispatcher.broadcast("spriteLoaded",!0),this.fire(new a.Event("data",{dataType:"style"}))})}_validateLayer(r){const o=this.getSource(r.source);if(!o)return;const h=r.sourceLayer;h&&(o.type==="geojson"||o.vectorLayerIds&&o.vectorLayerIds.indexOf(h)===-1)&&this.fire(new a.ErrorEvent(new Error(`Source layer "${h}" does not exist on source "${o.id}" as specified by style layer "${r.id}"`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const r in this._sourceCaches)if(!this._sourceCaches[r].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeLayers(r){const o=[];for(const h of r){const d=this._layers[h];d.type!=="custom"&&o.push(d.serialize())}return o}hasTransitions(){if(this.light&&this.light.hasTransition()||this.fog&&this.fog.hasTransition())return!0;for(const r in this._sourceCaches)if(this._sourceCaches[r].hasTransition())return!0;for(const r in this._layers)if(this._layers[r].hasTransition())return!0;return!1}get order(){return this.map._optimizeForTerrain&&this.terrain?this._drapedFirstOrder:this._order}isLayerDraped(r){return!!this.terrain&&(typeof r.isLayerDraped=="function"?r.isLayerDraped():Xn[r.type])}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading")}update(r){if(!this._loaded)return;const o=this._changed;if(this._changed){const d=Object.keys(this._updatedLayers),f=Object.keys(this._removedLayers);(d.length||f.length)&&this._updateWorkerLayers(d,f);for(const g in this._updatedSources){const y=this._updatedSources[g];y==="reload"?this._reloadSource(g):y==="clear"&&this._clearSource(g)}this._updateTilesForChangedImages();for(const g in this._updatedPaintProps)this._layers[g].updateTransitions(r);this.light.updateTransitions(r),this.fog&&this.fog.updateTransitions(r),this._resetUpdates()}const h={};for(const d in this._sourceCaches){const f=this._sourceCaches[d];h[d]=f.used,f.used=!1}for(const d of this._order){const f=this._layers[d];if(f.recalculate(r,this._availableImages),!f.isHidden(r.zoom)){const y=this._getLayerSourceCache(f);y&&(y.used=!0)}const g=this.map.painter;if(g){const y=f.getProgramIds();if(!y)continue;const v=f.getProgramConfiguration(r.zoom);for(const E of y)g.useProgram(E,v)}}for(const d in h){const f=this._sourceCaches[d];h[d]!==f.used&&f.getSource().fire(new a.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:f.getSource().id}))}this.light.recalculate(r),this.terrain&&this.terrain.recalculate(r),this.fog&&this.fog.recalculate(r),this.z=r.zoom,this._markersNeedUpdate&&(this._updateMarkersOpacity(),this._markersNeedUpdate=!1),o&&this.fire(new a.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){const r=Object.keys(this._changedImages);if(r.length){for(const o in this._sourceCaches)this._sourceCaches[o].reloadTilesForDependencies(["icons","patterns"],r);this._changedImages={}}}_updateWorkerLayers(r,o){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(r),removedIds:o})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}}setState(r){if(this._checkLoaded(),Kr(this,a.validateStyle(r)))return!1;(r=a.clone$1(r)).layers=tc(r.layers);const o=function(d,f){if(!d)return[{command:vt.setStyle,args:[f]}];let g=[];try{if(!Se(d.version,f.version))return[{command:vt.setStyle,args:[f]}];Se(d.center,f.center)||g.push({command:vt.setCenter,args:[f.center]}),Se(d.zoom,f.zoom)||g.push({command:vt.setZoom,args:[f.zoom]}),Se(d.bearing,f.bearing)||g.push({command:vt.setBearing,args:[f.bearing]}),Se(d.pitch,f.pitch)||g.push({command:vt.setPitch,args:[f.pitch]}),Se(d.sprite,f.sprite)||g.push({command:vt.setSprite,args:[f.sprite]}),Se(d.glyphs,f.glyphs)||g.push({command:vt.setGlyphs,args:[f.glyphs]}),Se(d.transition,f.transition)||g.push({command:vt.setTransition,args:[f.transition]}),Se(d.light,f.light)||g.push({command:vt.setLight,args:[f.light]}),Se(d.fog,f.fog)||g.push({command:vt.setFog,args:[f.fog]}),Se(d.projection,f.projection)||g.push({command:vt.setProjection,args:[f.projection]});const y={},v=[];(function(A,k,R,O){let B;for(B in k=k||{},A=A||{})A.hasOwnProperty(B)&&(k.hasOwnProperty(B)||zo(B,R,O));for(B in k){if(!k.hasOwnProperty(B))continue;const F=k[B];A.hasOwnProperty(B)?Se(A[B],F)||(A[B].type==="geojson"&&F.type==="geojson"&&Es(A,k,B)?R.push({command:vt.setGeoJSONSourceData,args:[B,F.data]}):Sa(B,k,R,O)):Ea(B,k,R)}})(d.sources,f.sources,v,y);const E=[];d.layers&&d.layers.forEach(A=>{A.source&&y[A.source]?g.push({command:vt.removeLayer,args:[A.id]}):E.push(A)});let T=d.terrain;T&&y[T.source]&&(g.push({command:vt.setTerrain,args:[void 0]}),T=void 0),g=g.concat(v),Se(T,f.terrain)||g.push({command:vt.setTerrain,args:[f.terrain]}),function(A,k,R){k=k||[];const O=(A=A||[]).map(Er),B=k.map(Er),F=A.reduce(Ma,{}),I=k.reduce(Ma,{}),L=O.slice(),N=Object.create(null);let j,K,J,Y,ie,te,le;for(j=0,K=0;j!(d.command in Ih));if(o.length===0)return!1;const h=o.filter(d=>!(d.command in Ms));if(h.length>0)throw new Error(`Unimplemented: ${h.map(d=>d.command).join(", ")}.`);return o.forEach(d=>{d.command!=="setTransition"&&d.command!=="setProjection"&&this[d.command].apply(this,d.args)}),this.stylesheet=r,this._updateMapProjection(),!0}addImage(r,o){return this.getImage(r)?this.fire(new a.ErrorEvent(new Error("An image with this name already exists."))):(this.imageManager.addImage(r,o),this._afterImageUpdated(r),this)}updateImage(r,o){this.imageManager.updateImage(r,o)}getImage(r){return this.imageManager.getImage(r)}removeImage(r){return this.getImage(r)?(this.imageManager.removeImage(r),this._afterImageUpdated(r),this):this.fire(new a.ErrorEvent(new Error("No image with this name exists.")))}_afterImageUpdated(r){this._availableImages=this.imageManager.listImages(),this._changedImages[r]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new a.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this._availableImages.slice()}addSource(r,o,h={}){if(this._checkLoaded(),this.getSource(r)!==void 0)throw new Error("There is already a source with this ID");if(!o.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(o).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(o.type)>=0&&this._validate(a.validateSource,`sources.${r}`,o,null,h))return;this.map&&this.map._collectResourceTiming&&(o.collectResourceTiming=!0);const d=nt(r,o,this.dispatcher,this);d.setEventedParent(this,()=>({isSourceLoaded:this._isSourceCacheLoaded(r),source:d.serialize(),sourceId:r}));const f=g=>{const y=(g?"symbol:":"other:")+r,v=this._sourceCaches[y]=new a.SourceCache(y,d,g);(g?this._symbolSourceCaches:this._otherSourceCaches)[r]=v,v.style=this,v.onAdd(this.map)};f(!1),o.type!=="vector"&&o.type!=="geojson"||f(!0),d.onAdd&&d.onAdd(this.map),this._changed=!0}removeSource(r){this._checkLoaded();const o=this.getSource(r);if(!o)throw new Error("There is no source with this ID");for(const d in this._layers)if(this._layers[d].source===r)return this.fire(new a.ErrorEvent(new Error(`Source "${r}" cannot be removed while layer "${d}" is using it.`)));if(this.terrain&&this.terrain.get().source===r)return this.fire(new a.ErrorEvent(new Error(`Source "${r}" cannot be removed while terrain is using it.`)));const h=this._getSourceCaches(r);for(const d of h)delete this._sourceCaches[d.id],delete this._updatedSources[d.id],d.fire(new a.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:d.getSource().id})),d.setEventedParent(null),d.clearTiles();return delete this._otherSourceCaches[r],delete this._symbolSourceCaches[r],o.setEventedParent(null),o.onRemove&&o.onRemove(this.map),this._changed=!0,this}setGeoJSONSourceData(r,o){this._checkLoaded(),this.getSource(r).setData(o),this._changed=!0}getSource(r){const o=this._getSourceCache(r);return o&&o.getSource()}_getSources(){const r=[];for(const o in this._otherSourceCaches){const h=this._getSourceCache(o);h&&r.push(h.getSource())}return r}addLayer(r,o,h={}){this._checkLoaded();const d=r.id;if(this.getLayer(d))return void this.fire(new a.ErrorEvent(new Error(`Layer with id "${d}" already exists on this map`)));let f;if(r.type==="custom"){if(Kr(this,a.validateCustomStyleLayer(r)))return;f=a.createStyleLayer(r)}else{if(typeof r.source=="object"&&(this.addSource(d,r.source),r=a.clone$1(r),r=a.extend(r,{source:d})),this._validate(a.validateLayer,`layers.${d}`,r,{arrayIndex:-1},h))return;f=a.createStyleLayer(r),this._validateLayer(f),f.setEventedParent(this,{layer:{id:d}}),this._serializedLayers[f.id]=f.serialize(),this._updateLayerCount(f,!0)}const g=o?this._order.indexOf(o):this._order.length;if(o&&g===-1)return void this.fire(new a.ErrorEvent(new Error(`Layer with id "${o}" does not exist on this map.`)));this._order.splice(g,0,d),this._layerOrderChanged=!0,this._layers[d]=f;const y=this._getLayerSourceCache(f);if(this._removedLayers[d]&&f.source&&y&&f.type!=="custom"){const v=this._removedLayers[d];delete this._removedLayers[d],v.type!==f.type?this._updatedSources[f.source]="clear":(this._updatedSources[f.source]="reload",y.pause())}this._updateLayer(f),f.onAdd&&f.onAdd(this.map),this._updateDrapeFirstLayers()}moveLayer(r,o){if(this._checkLoaded(),this._changed=!0,!this._layers[r])return void this.fire(new a.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style and cannot be moved.`)));if(r===o)return;const h=this._order.indexOf(r);this._order.splice(h,1);const d=o?this._order.indexOf(o):this._order.length;o&&d===-1?this.fire(new a.ErrorEvent(new Error(`Layer with id "${o}" does not exist on this map.`))):(this._order.splice(d,0,r),this._layerOrderChanged=!0,this._updateDrapeFirstLayers())}removeLayer(r){this._checkLoaded();const o=this._layers[r];if(!o)return void this.fire(new a.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style and cannot be removed.`)));o.setEventedParent(null),this._updateLayerCount(o,!1);const h=this._order.indexOf(r);this._order.splice(h,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[r]=o,delete this._layers[r],delete this._serializedLayers[r],delete this._updatedLayers[r],delete this._updatedPaintProps[r],o.onRemove&&o.onRemove(this.map),this._updateDrapeFirstLayers()}getLayer(r){return this._layers[r]}hasLayer(r){return r in this._layers}hasLayerType(r){for(const o in this._layers)if(this._layers[o].type===r)return!0;return!1}setLayerZoomRange(r,o,h){this._checkLoaded();const d=this.getLayer(r);d?d.minzoom===o&&d.maxzoom===h||(o!=null&&(d.minzoom=o),h!=null&&(d.maxzoom=h),this._updateLayer(d)):this.fire(new a.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style and cannot have zoom extent.`)))}setFilter(r,o,h={}){this._checkLoaded();const d=this.getLayer(r);if(d){if(!Se(d.filter,o))return o==null?(d.filter=void 0,void this._updateLayer(d)):void(this._validate(a.validateFilter,`layers.${d.id}.filter`,o,{layerType:d.type},h)||(d.filter=a.clone$1(o),this._updateLayer(d)))}else this.fire(new a.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style and cannot be filtered.`)))}getFilter(r){const o=this.getLayer(r);return o&&a.clone$1(o.filter)}setLayoutProperty(r,o,h,d={}){this._checkLoaded();const f=this.getLayer(r);f?Se(f.getLayoutProperty(o),h)||(f.setLayoutProperty(o,h,d),this._updateLayer(f)):this.fire(new a.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style and cannot be styled.`)))}getLayoutProperty(r,o){const h=this.getLayer(r);if(h)return h.getLayoutProperty(o);this.fire(new a.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style.`)))}setPaintProperty(r,o,h,d={}){this._checkLoaded();const f=this.getLayer(r);f?Se(f.getPaintProperty(o),h)||(f.setPaintProperty(o,h,d)&&this._updateLayer(f),this._changed=!0,this._updatedPaintProps[r]=!0):this.fire(new a.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style and cannot be styled.`)))}getPaintProperty(r,o){const h=this.getLayer(r);return h&&h.getPaintProperty(o)}setFeatureState(r,o){this._checkLoaded();const h=r.source,d=r.sourceLayer,f=this.getSource(h);if(!f)return void this.fire(new a.ErrorEvent(new Error(`The source '${h}' does not exist in the map's style.`)));const g=f.type;if(g==="geojson"&&d)return void this.fire(new a.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));if(g==="vector"&&!d)return void this.fire(new a.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));r.id===void 0&&this.fire(new a.ErrorEvent(new Error("The feature id parameter must be provided.")));const y=this._getSourceCaches(h);for(const v of y)v.setFeatureState(d,r.id,o)}removeFeatureState(r,o){this._checkLoaded();const h=r.source,d=this.getSource(h);if(!d)return void this.fire(new a.ErrorEvent(new Error(`The source '${h}' does not exist in the map's style.`)));const f=d.type,g=f==="vector"?r.sourceLayer:void 0;if(f==="vector"&&!g)return void this.fire(new a.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));if(o&&typeof r.id!="string"&&typeof r.id!="number")return void this.fire(new a.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));const y=this._getSourceCaches(h);for(const v of y)v.removeFeatureState(g,r.id,o)}getFeatureState(r){this._checkLoaded();const o=r.source,h=r.sourceLayer,d=this.getSource(o);if(d){if(d.type!=="vector"||h)return r.id===void 0&&this.fire(new a.ErrorEvent(new Error("The feature id parameter must be provided."))),this._getSourceCaches(o)[0].getFeatureState(h,r.id);this.fire(new a.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new a.ErrorEvent(new Error(`The source '${o}' does not exist in the map's style.`)))}getTransition(){return a.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){const r={};for(const o in this._sourceCaches){const h=this._sourceCaches[o].getSource();r[h.id]||(r[h.id]=h.serialize())}return a.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,terrain:this.getTerrain()||void 0,fog:this.stylesheet.fog,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,projection:this.stylesheet.projection,sources:r,layers:this._serializeLayers(this._order)},o=>o!==void 0)}_updateLayer(r){this._updatedLayers[r.id]=!0;const o=this._getLayerSourceCache(r);r.source&&!this._updatedSources[r.source]&&o&&o.getSource().type!=="raster"&&(this._updatedSources[r.source]="reload",o.pause()),this._changed=!0,r.invalidateCompiledFilter()}_flattenAndSortRenderedFeatures(r){const o=g=>this._layers[g].type==="fill-extrusion",h={},d=[];for(let g=this._order.length-1;g>=0;g--){const y=this._order[g];if(o(y)){h[y]=g;for(const v of r){const E=v[y];if(E)for(const T of E)d.push(T)}}}d.sort((g,y)=>y.intersectionZ-g.intersectionZ);const f=[];for(let g=this._order.length-1;g>=0;g--){const y=this._order[g];if(o(y))for(let v=d.length-1;v>=0;v--){const E=d[v].feature;if(h[E.layer.id]{const E=this.getLayer(v);return E&&E.is3D()}):this.has3DLayers(),y=$r.createFromScreenPoints(r,h);for(const v in this._sourceCaches){const E=this._sourceCaches[v].getSource().id;o.layers&&!d[E]||f.push(Vt(this._sourceCaches[v],this._layers,this._serializedLayers,y,o,h,g,!!this.map._showQueryGeometry))}return this.placement&&f.push(function(v,E,T,A,k,R,O){const B={},F=R.queryRenderedSymbols(A),I=[];for(const L of Object.keys(F).map(Number))I.push(O[L]);I.sort(yi);for(const L of I){const N=L.featureIndex.lookupSymbolFeatures(F[L.bucketInstanceId],E,L.bucketIndex,L.sourceLayerIndex,k.filter,k.layers,k.availableImages,v);for(const j in N){const K=B[j]=B[j]||[],J=N[j];J.sort((Y,ie)=>{const te=L.featureSortOrder;if(te){const le=te.indexOf(Y.featureIndex);return te.indexOf(ie.featureIndex)-le}return ie.featureIndex-Y.featureIndex});for(const Y of J)K.push(Y)}}for(const L in B)B[L].forEach(N=>{const j=N.feature,K=T(v[L]);if(!K)return;const J=K.getFeatureState(j.layer["source-layer"],j.id);j.source=j.layer.source,j.layer["source-layer"]&&(j.sourceLayer=j.layer["source-layer"]),j.state=J});return B}(this._layers,this._serializedLayers,this._getLayerSourceCache.bind(this),y.screenGeometry,o,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(f)}querySourceFeatures(r,o){o&&o.filter&&this._validate(a.validateFilter,"querySourceFeatures.filter",o.filter,null,o);const h=this._getSourceCaches(r);let d=[];for(const f of h)d=d.concat(Xt(f,o));return d}addSourceType(r,o,h){return cr.getSourceType(r)?h(new Error(`A source type called "${r}" already exists.`)):(cr.setSourceType(r,o),o.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:r,url:o.workerSourceURL},h):h(null,null))}getLight(){return this.light.getLight()}setLight(r,o={}){this._checkLoaded();const h=this.light.getLight();let d=!1;for(const g in r)if(!Se(r[g],h[g])){d=!0;break}if(!d)return;const f=this._setTransitionParameters({duration:300,delay:0});this.light.setLight(r,o),this.light.updateTransitions(f)}getTerrain(){return this.terrain&&this.terrain.drapeRenderMode===1?this.terrain.get():null}setTerrainForDraping(){this.setTerrain({source:"",exaggeration:0},0)}setTerrain(r,o=1){if(this._checkLoaded(),!r)return delete this.terrain,delete this.stylesheet.terrain,this.dispatcher.broadcast("enableTerrain",!1),this._force3DLayerUpdate(),void(this._markersNeedUpdate=!0);let h=r;if(o===1){if(typeof h.source=="object"){const d="terrain-dem-src";this.addSource(d,h.source),h=a.clone$1(h),h=a.extend(h,{source:d})}if(this._validate(a.validateTerrain,"terrain",h))return}if(!this.terrain||this.terrain&&o!==this.terrain.drapeRenderMode){if(!h)return;this._createTerrain(h,o)}else{const d=this.terrain,f=d.get();for(const g of Object.keys(a.spec.terrain))!h.hasOwnProperty(g)&&a.spec.terrain[g].default&&(h[g]=a.spec.terrain[g].default);for(const g in h)if(!Se(h[g],f[g])){d.set(h),this.stylesheet.terrain=h;const y=this._setTransitionParameters({duration:0});d.updateTransitions(y);break}}this._updateDrapeFirstLayers(),this._markersNeedUpdate=!0}_createFog(r){const o=this.fog=new On(r,this.map.transform);this.stylesheet.fog=r;const h=this._setTransitionParameters({duration:0});o.updateTransitions(h)}_updateMarkersOpacity(){this.map._markers.length!==0&&this.map._requestDomTask(()=>{for(const r of this.map._markers)r._evaluateOpacity()})}getFog(){return this.fog?this.fog.get():null}setFog(r){if(this._checkLoaded(),!r)return delete this.fog,delete this.stylesheet.fog,void(this._markersNeedUpdate=!0);if(this.fog){const o=this.fog,h=o.get();Object.keys(r).length===0&&o.set(r);for(const d in r)if(!Se(r[d],h[d])){o.set(r),this.stylesheet.fog=r;const f=this._setTransitionParameters({duration:0});o.updateTransitions(f);break}}else this._createFog(r);this._markersNeedUpdate=!0}_setTransitionParameters(r){return{now:a.exported.now(),transition:a.extend(r,this.stylesheet.transition)}}_updateDrapeFirstLayers(){if(!this.map._optimizeForTerrain||!this.terrain)return;const r=this._order.filter(h=>this.isLayerDraped(this._layers[h])),o=this._order.filter(h=>!this.isLayerDraped(this._layers[h]));this._drapedFirstOrder=[],this._drapedFirstOrder.push(...r),this._drapedFirstOrder.push(...o)}_createTerrain(r,o){const h=this.terrain=new gs(r,o);this.stylesheet.terrain=r,this.dispatcher.broadcast("enableTerrain",!this.terrainSetForDrapingOnly()),this._force3DLayerUpdate();const d=this._setTransitionParameters({duration:0});h.updateTransitions(d)}_force3DLayerUpdate(){for(const r in this._layers){const o=this._layers[r];o.type==="fill-extrusion"&&this._updateLayer(o)}}_forceSymbolLayerUpdate(){for(const r in this._layers){const o=this._layers[r];o.type==="symbol"&&this._updateLayer(o)}}_validate(r,o,h,d,f={}){return(!f||f.validate!==!1)&&Kr(this,r.call(a.validateStyle,a.extend({key:o,style:this.serialize(),value:h,styleSpec:a.spec},d)))}_remove(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),a.evented.off("pluginStateChange",this._rtlTextPluginCallback);for(const r in this._layers)this._layers[r].setEventedParent(null);for(const r in this._sourceCaches)this._sourceCaches[r].clearTiles(),this._sourceCaches[r].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()}_clearSource(r){const o=this._getSourceCaches(r);for(const h of o)h.clearTiles()}_reloadSource(r){const o=this._getSourceCaches(r);for(const h of o)h.resume(),h.reload()}_reloadSources(){for(const r of this._getSources())r.reload&&r.reload()}_updateSources(r){for(const o in this._sourceCaches)this._sourceCaches[o].update(r)}_generateCollisionBoxes(){for(const r in this._sourceCaches){const o=this._sourceCaches[r];o.resume(),o.reload()}}_updatePlacement(r,o,h,d,f=!1){let g=!1,y=!1;const v={};for(const E of this._order){const T=this._layers[E];if(T.type!=="symbol")continue;if(!v[T.source]){const k=this._getLayerSourceCache(T);if(!k)continue;v[T.source]=k.getRenderableIds(!0).map(R=>k.getTileByID(R)).sort((R,O)=>O.tileID.overscaledZ-R.tileID.overscaledZ||(R.tileID.isLessThan(O.tileID)?-1:1))}const A=this.crossTileSymbolIndex.addLayer(T,v[T.source],r.center.lng,r.projection);g=g||A}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),f=f||this._layerOrderChanged||h===0,this._layerOrderChanged&&this.fire(new a.Event("neworder")),(f||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(a.exported.now(),r.zoom))&&(this.pauseablePlacement=new ka(r,this._order,f,o,h,d,this.placement,this.fog&&r.projection.supportsFog?this.fog.state:null),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,v),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(a.exported.now()),y=!0),g&&this.pauseablePlacement.placement.setStale()),y||g)for(const E of this._order){const T=this._layers[E];T.type==="symbol"&&this.placement.updateLayerOpacities(T,v[T.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(a.exported.now())}_releaseSymbolFadeTiles(){for(const r in this._sourceCaches)this._sourceCaches[r].releaseSymbolFadeTiles()}getImages(r,o,h){this.imageManager.getImages(o.icons,h),this._updateTilesForChangedImages();const d=f=>{f&&f.setDependencies(o.tileID.key,o.type,o.icons)};d(this._otherSourceCaches[o.source]),d(this._symbolSourceCaches[o.source])}getGlyphs(r,o,h){this.glyphManager.getGlyphs(o.stacks,h)}getResource(r,o,h){return a.makeRequest(o,h)}_getSourceCache(r){return this._otherSourceCaches[r]}_getLayerSourceCache(r){return r.type==="symbol"?this._symbolSourceCaches[r.source]:this._otherSourceCaches[r.source]}_getSourceCaches(r){const o=[];return this._otherSourceCaches[r]&&o.push(this._otherSourceCaches[r]),this._symbolSourceCaches[r]&&o.push(this._symbolSourceCaches[r]),o}_isSourceCacheLoaded(r){const o=this._getSourceCaches(r);return o.length===0?(this.fire(new a.ErrorEvent(new Error(`There is no source with ID '${r}'`))),!1):o.every(h=>h.loaded())}has3DLayers(){return this._num3DLayers>0}hasSymbolLayers(){return this._numSymbolLayers>0}hasCircleLayers(){return this._numCircleLayers>0}_clearWorkerCaches(){this.dispatcher.broadcast("clearCaches")}destroy(){this._clearWorkerCaches(),this.terrainSetForDrapingOnly()&&(delete this.terrain,delete this.stylesheet.terrain)}}cr.getSourceType=function(l){return Qe[l]},cr.setSourceType=function(l,r){Qe[l]=r},cr.registerForPluginStateChange=a.registerForPluginStateChange;var Ba=` -#define EPSILON 0.0000001 -#define PI 3.141592653589793 -#define EXTENT 8192.0 -#define HALF_PI PI/2.0 -#define QUARTER_PI PI/4.0 -#define RAD_TO_DEG 180.0/PI -#define DEG_TO_RAD PI/180.0 -#define GLOBE_RADIUS EXTENT/PI/2.0`,vn="attribute highp vec3 a_pos_3f;uniform lowp mat4 u_matrix;varying highp vec3 v_uv;void main() {const mat3 half_neg_pi_around_x=mat3(1.0,0.0, 0.0,0.0,0.0,-1.0,0.0,1.0, 0.0);v_uv=half_neg_pi_around_x*a_pos_3f;vec4 pos=u_matrix*vec4(a_pos_3f,1.0);gl_Position=pos.xyww;}",Cr=` -#define ELEVATION_SCALE 7.0 -#define ELEVATION_OFFSET 450.0 -#ifdef PROJECTION_GLOBE_VIEW -uniform vec3 u_tile_tl_up;uniform vec3 u_tile_tr_up;uniform vec3 u_tile_br_up;uniform vec3 u_tile_bl_up;uniform float u_tile_up_scale;vec3 elevationVector(vec2 pos) {vec2 uv=pos/EXTENT;vec3 up=normalize(mix( -mix(u_tile_tl_up,u_tile_tr_up,uv.xxx),mix(u_tile_bl_up,u_tile_br_up,uv.xxx),uv.yyy));return up*u_tile_up_scale;} -#else -vec3 elevationVector(vec2 pos) { return vec3(0,0,1); } -#endif -const float skirtOffset=24575.0;vec3 decomposeToPosAndSkirt(vec2 posWithComposedSkirt) -{float skirt=float(posWithComposedSkirt.x >=skirtOffset);vec2 pos=posWithComposedSkirt-vec2(skirt*skirtOffset,0.0);return vec3(pos,skirt);} -#ifdef TERRAIN -#ifdef TERRAIN_DEM_FLOAT_FORMAT -uniform highp sampler2D u_dem;uniform highp sampler2D u_dem_prev; -#else -uniform sampler2D u_dem;uniform sampler2D u_dem_prev; -#endif -uniform vec4 u_dem_unpack;uniform vec2 u_dem_tl;uniform vec2 u_dem_tl_prev;uniform float u_dem_scale;uniform float u_dem_scale_prev;uniform float u_dem_size;uniform float u_dem_lerp;uniform float u_exaggeration;uniform float u_meter_to_dem;uniform mat4 u_label_plane_matrix_inv;uniform sampler2D u_depth;uniform vec2 u_depth_size_inv;vec4 tileUvToDemSample(vec2 uv,float dem_size,float dem_scale,vec2 dem_tl) {vec2 pos=dem_size*(uv*dem_scale+dem_tl)+1.0;vec2 f=fract(pos);return vec4((pos-f+0.5)/(dem_size+2.0),f);}float decodeElevation(vec4 v) {return dot(vec4(v.xyz*255.0,-1.0),u_dem_unpack);}float currentElevation(vec2 apos) { -#ifdef TERRAIN_DEM_FLOAT_FORMAT -vec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale+u_dem_tl)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture2D(u_dem,pos).a; -#else -float dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale,u_dem_tl);vec2 pos=r.xy;vec2 f=r.zw;float tl=decodeElevation(texture2D(u_dem,pos)); -#ifdef TERRAIN_DEM_NEAREST_FILTER -return u_exaggeration*tl; -#endif -float tr=decodeElevation(texture2D(u_dem,pos+vec2(dd,0.0)));float bl=decodeElevation(texture2D(u_dem,pos+vec2(0.0,dd)));float br=decodeElevation(texture2D(u_dem,pos+vec2(dd,dd)));return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y); -#endif -}float prevElevation(vec2 apos) { -#ifdef TERRAIN_DEM_FLOAT_FORMAT -vec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale_prev+u_dem_tl_prev)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture2D(u_dem_prev,pos).a; -#else -float dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale_prev,u_dem_tl_prev);vec2 pos=r.xy;vec2 f=r.zw;float tl=decodeElevation(texture2D(u_dem_prev,pos));float tr=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,0.0)));float bl=decodeElevation(texture2D(u_dem_prev,pos+vec2(0.0,dd)));float br=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,dd)));return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y); -#endif -} -#ifdef TERRAIN_VERTEX_MORPHING -float elevation(vec2 apos) { -#ifdef ZERO_EXAGGERATION -return 0.0; -#endif -float nextElevation=currentElevation(apos);float prevElevation=prevElevation(apos);return mix(prevElevation,nextElevation,u_dem_lerp);} -#else -float elevation(vec2 apos) { -#ifdef ZERO_EXAGGERATION -return 0.0; -#endif -return currentElevation(apos);} -#endif -highp float unpack_depth(highp vec4 rgba_depth) -{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}bool isOccluded(vec4 frag) {vec3 coord=frag.xyz/frag.w;float depth=unpack_depth(texture2D(u_depth,(coord.xy+1.0)*0.5));return coord.z > depth+0.0005;}float occlusionFade(vec4 frag) {vec3 coord=frag.xyz/frag.w;vec3 df=vec3(5.0*u_depth_size_inv,0.0);vec2 uv=0.5*coord.xy+0.5;vec4 depth=vec4( -unpack_depth(texture2D(u_depth,uv-df.xz)),unpack_depth(texture2D(u_depth,uv+df.xz)),unpack_depth(texture2D(u_depth,uv-df.zy)),unpack_depth(texture2D(u_depth,uv+df.zy)) -);return dot(vec4(0.25),vec4(1.0)-clamp(300.0*(vec4(coord.z-0.001)-depth),0.0,1.0));}vec4 fourSample(vec2 pos,vec2 off) { -#ifdef TERRAIN_DEM_FLOAT_FORMAT -float tl=texture2D(u_dem,pos).a;float tr=texture2D(u_dem,pos+vec2(off.x,0.0)).a;float bl=texture2D(u_dem,pos+vec2(0.0,off.y)).a;float br=texture2D(u_dem,pos+off).a; -#else -vec4 demtl=vec4(texture2D(u_dem,pos).xyz*255.0,-1.0);float tl=dot(demtl,u_dem_unpack);vec4 demtr=vec4(texture2D(u_dem,pos+vec2(off.x,0.0)).xyz*255.0,-1.0);float tr=dot(demtr,u_dem_unpack);vec4 dembl=vec4(texture2D(u_dem,pos+vec2(0.0,off.y)).xyz*255.0,-1.0);float bl=dot(dembl,u_dem_unpack);vec4 dembr=vec4(texture2D(u_dem,pos+off).xyz*255.0,-1.0);float br=dot(dembr,u_dem_unpack); -#endif -return vec4(tl,tr,bl,br);}float flatElevation(vec2 pack) {vec2 apos=floor(pack/8.0);vec2 span=10.0*(pack-apos*8.0);vec2 uvTex=(apos-vec2(1.0,1.0))/8190.0;float size=u_dem_size+2.0;float dd=1.0/size;vec2 pos=u_dem_size*(uvTex*u_dem_scale+u_dem_tl)+1.0;vec2 f=fract(pos);pos=(pos-f+0.5)*dd;vec4 h=fourSample(pos,vec2(dd));float z=mix(mix(h.x,h.y,f.x),mix(h.z,h.w,f.x),f.y);vec2 w=floor(0.5*(span*u_meter_to_dem-1.0));vec2 d=dd*w;h=fourSample(pos-d,2.0*d+vec2(dd));vec4 diff=abs(h.xzxy-h.ywzw);vec2 slope=min(vec2(0.25),u_meter_to_dem*0.5*(diff.xz+diff.yw)/(2.0*w+vec2(1.0)));vec2 fix=slope*span;float base=z+max(fix.x,fix.y);return u_exaggeration*base;}float elevationFromUint16(float word) {return u_exaggeration*(word/ELEVATION_SCALE-ELEVATION_OFFSET);} -#else -float elevation(vec2 pos) { return 0.0; }bool isOccluded(vec4 frag) { return false; }float occlusionFade(vec4 frag) { return 1.0; } -#endif`,Uo=`#ifdef FOG -uniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump mat4 u_fog_matrix;varying vec3 v_fog_pos;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}vec3 fog_position(vec3 pos) {return (u_fog_matrix*vec4(pos,1.0)).xyz;}vec3 fog_position(vec2 pos) {return fog_position(vec3(pos,0.0));}float fog(vec3 pos) {float depth=length(pos);float opacity=fog_opacity(fog_range(depth));return opacity*fog_horizon_blending(pos/depth);} -#endif`,zr=`#ifdef FOG -uniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump float u_fog_temporal_offset;varying vec3 v_fog_pos;uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform highp vec2 u_viewport;uniform float u_globe_transition;uniform int u_is_globe;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}float globe_glow_progress() {highp vec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix( -mix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);highp vec3 dir=normalize(ray_dir);highp vec3 closest_point=dot(u_globe_pos,dir)*dir;highp float sdf=length(closest_point-u_globe_pos)/u_globe_radius;return sdf+PI*0.5;}float fog_opacity(vec3 pos) {float depth=length(pos);return fog_opacity(fog_range(depth));}vec3 fog_apply(vec3 color,vec3 pos) {float depth=length(pos);float opacity;if (u_is_globe==1) {float glow_progress=globe_glow_progress();float t=mix(glow_progress,depth,u_globe_transition);opacity=fog_opacity(fog_range(t));} else {opacity=fog_opacity(fog_range(depth));opacity*=fog_horizon_blending(pos/depth);}return mix(color,u_fog_color.rgb,opacity);}vec4 fog_apply_from_vert(vec4 color,float fog_opac) {float alpha=EPSILON+color.a;color.rgb=mix(color.rgb/alpha,u_fog_color.rgb,fog_opac)*alpha;return color;}vec3 fog_apply_sky_gradient(vec3 camera_ray,vec3 sky_color) {float horizon_blend=fog_horizon_blending(normalize(camera_ray));return mix(sky_color,u_fog_color.rgb,horizon_blend);}vec4 fog_apply_premultiplied(vec4 color,vec3 pos) {float alpha=EPSILON+color.a;color.rgb=fog_apply(color.rgb/alpha,pos)*alpha;return color;}vec3 fog_dither(vec3 color) {vec2 dither_seed=gl_FragCoord.xy+u_fog_temporal_offset;return dither(color,dither_seed);}vec4 fog_dither(vec4 color) {return vec4(fog_dither(color.rgb),color.a);} -#endif`;let As={},Hn={};const Vo=[];Kn(Ba,Vo),Kn(Cr,Vo),Kn(Uo,Vo),Kn(zr,Vo),As=bt("",Cr),Hn=bt(zr,Uo);const ac=bt(` -#if __VERSION__ >=300 -#define varying in -#define gl_FragColor glFragColor -#define texture2D texture -#define textureCube texture -out vec4 glFragColor; -#endif -highp vec3 hash(highp vec2 p) {highp vec3 p3=fract(p.xyx*vec3(443.8975,397.2973,491.1871));p3+=dot(p3,p3.yxz+19.19);return fract((p3.xxy+p3.yzz)*p3.zyx);}vec3 dither(vec3 color,highp vec2 seed) {vec3 rnd=hash(seed)+hash(seed+0.59374)-0.5;return color+rnd/255.0;}highp float unpack_depth(highp vec4 rgba_depth) -{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}highp vec4 pack_depth(highp float ndc_z) {highp float depth=ndc_z*0.5+0.5;const highp vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);const highp vec4 bit_mask =vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);highp vec4 res=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;}`,` -#if __VERSION__ >=300 -#define attribute in -#define varying out -#define texture2D texture -#endif -float wrap(float n,float min,float max) {float d=max-min;float w=mod(mod(n-min,d)+d,d)+min;return (w==min) ? max : w;} -#ifdef PROJECTION_GLOBE_VIEW -vec3 mercator_tile_position(mat4 matrix,vec2 tile_anchor,vec3 tile_id,vec2 mercator_center) { -#ifndef PROJECTED_POS_ON_VIEWPORT -float tiles=tile_id.z;vec2 mercator=(tile_anchor/EXTENT+tile_id.xy)/tiles;mercator-=mercator_center;mercator.x=wrap(mercator.x,-0.5,0.5);vec4 mercator_tile=vec4(mercator.xy*EXTENT,EXTENT/(2.0*PI),1.0);mercator_tile=matrix*mercator_tile;return mercator_tile.xyz; -#else -return vec3(0.0); -#endif -}vec3 mix_globe_mercator(vec3 globe,vec3 mercator,float t) {return mix(globe,mercator,t);}mat3 globe_mercator_surface_vectors(vec3 pos_normal,vec3 up_dir,float zoom_transition) {vec3 normal=zoom_transition==0.0 ? pos_normal : normalize(mix(pos_normal,up_dir,zoom_transition));vec3 xAxis=normalize(vec3(normal.z,0.0,-normal.x));vec3 yAxis=normalize(cross(normal,xAxis));return mat3(xAxis,yAxis,normal);} -#endif -vec2 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 -);}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;}const vec4 AWAY=vec4(-1000.0,-1000.0,-1000.0,1);//Normalized device coordinate that is not rendered.`),Is=Ba,Oa=` -#ifdef GL_ES -precision mediump float; -#else - -#if !defined(lowp) -#define lowp -#endif - -#if !defined(mediump) -#define mediump -#endif - -#if !defined(highp) -#define highp -#endif - -#endif`;var Fa={background:bt(`uniform vec4 u_color;uniform float u_opacity; -#ifdef LIGHTING_3D_MODE -varying vec4 v_color; -#endif -void main() {vec4 out_color; -#ifdef LIGHTING_3D_MODE -out_color=v_color; -#else -out_color=u_color; -#endif -#ifdef FOG -out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); -#endif -gl_FragColor=out_color*u_opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec2 a_pos;uniform mat4 u_matrix; -#ifdef LIGHTING_3D_MODE -uniform vec4 u_color;varying vec4 v_color; -#endif -void main() {gl_Position=u_matrix*vec4(a_pos,0,1); -#ifdef LIGHTING_3D_MODE -v_color=apply_lighting(u_color); -#endif -#ifdef FOG -v_fog_pos=fog_position(a_pos); -#endif -}`),backgroundPattern:bt(`uniform vec2 u_pattern_tl;uniform vec2 u_pattern_br;uniform vec2 u_texsize;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos;void main() {vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(u_pattern_tl/u_texsize,u_pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos); -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color); -#endif -#ifdef FOG -out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); -#endif -gl_FragColor=out_color*u_opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_pattern_size;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_pattern_size,u_tile_units_to_pixels,a_pos); -#ifdef FOG -v_fog_pos=fog_position(a_pos); -#endif -}`),circle:bt(`varying vec3 v_data;varying float v_visibility; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define mediump float radius -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define highp vec4 stroke_color -#pragma mapbox: define mediump float stroke_width -#pragma mapbox: define lowp float stroke_opacity -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize mediump float radius -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize highp vec4 stroke_color -#pragma mapbox: initialize mediump float stroke_width -#pragma mapbox: initialize lowp float stroke_opacity -vec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);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) -);vec4 out_color=mix(color*opacity,stroke_color*stroke_opacity,color_t); -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color); -#endif -#ifdef FOG -out_color=fog_apply_premultiplied(out_color,v_fog_pos); -#endif -gl_FragColor=out_color*(v_visibility*opacity_t); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`#define NUM_VISIBILITY_RINGS 2 -#define INV_SQRT2 0.70710678 -#define ELEVATION_BIAS 0.0001 -#define NUM_SAMPLES_PER_RING 16 -uniform mat4 u_matrix;uniform mat2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos; -#ifdef PROJECTION_GLOBE_VIEW -attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir; -#endif -varying vec3 v_data;varying float v_visibility; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define mediump float radius -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define highp vec4 stroke_color -#pragma mapbox: define mediump float stroke_width -#pragma mapbox: define lowp float stroke_opacity -vec2 calc_offset(vec2 extrusion,float radius,float stroke_width, float view_scale) {return extrusion*(radius+stroke_width)*u_extrude_scale*view_scale;}float cantilevered_elevation(vec2 pos,float radius,float stroke_width,float view_scale) {vec2 c1=pos+calc_offset(vec2(-1,-1),radius,stroke_width,view_scale);vec2 c2=pos+calc_offset(vec2(1,-1),radius,stroke_width,view_scale);vec2 c3=pos+calc_offset(vec2(1,1),radius,stroke_width,view_scale);vec2 c4=pos+calc_offset(vec2(-1,1),radius,stroke_width,view_scale);float h1=elevation(c1)+ELEVATION_BIAS;float h2=elevation(c2)+ELEVATION_BIAS;float h3=elevation(c3)+ELEVATION_BIAS;float h4=elevation(c4)+ELEVATION_BIAS;return max(h4,max(h3,max(h1,h2)));}float circle_elevation(vec2 pos) { -#if defined(TERRAIN) -return elevation(pos)+ELEVATION_BIAS; -#else -return 0.0; -#endif -}vec4 project_vertex(vec2 extrusion,vec4 world_center,vec4 projected_center,float radius,float stroke_width, float view_scale,mat3 surface_vectors) {vec2 sample_offset=calc_offset(extrusion,radius,stroke_width,view_scale); -#ifdef PITCH_WITH_MAP -#ifdef PROJECTION_GLOBE_VIEW -return u_matrix*( world_center+vec4(sample_offset.x*surface_vectors[0]+sample_offset.y*surface_vectors[1],0) ); -#else -return u_matrix*( world_center+vec4(sample_offset,0,0) ); -#endif -#else -return projected_center+vec4(sample_offset,0,0); -#endif -}float get_sample_step() { -#ifdef PITCH_WITH_MAP -return 2.0*PI/float(NUM_SAMPLES_PER_RING); -#else -return PI/float(NUM_SAMPLES_PER_RING); -#endif -}void main(void) { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize mediump float radius -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize highp vec4 stroke_color -#pragma mapbox: initialize mediump float stroke_width -#pragma mapbox: initialize lowp float stroke_opacity -vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);vec4 world_center;mat3 surface_vectors; -#ifdef PROJECTION_GLOBE_VIEW -vec3 pos_normal_3=a_pos_normal_3/16384.0;surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(circle_center)*circle_elevation(circle_center);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*circle_elevation(circle_center);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,circle_center,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;vec3 pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);world_center=vec4(pos,1); -#else -surface_vectors=mat3(1.0);float height=circle_elevation(circle_center);world_center=vec4(circle_center,height,1); -#endif -vec4 projected_center=u_matrix*world_center;float view_scale=0.0; -#ifdef PITCH_WITH_MAP -#ifdef SCALE_WITH_MAP -view_scale=1.0; -#else -view_scale=projected_center.w/u_camera_to_center_distance; -#endif -#else -#ifdef SCALE_WITH_MAP -view_scale=u_camera_to_center_distance; -#else -view_scale=projected_center.w; -#endif -#endif -gl_Position=project_vertex(extrude,world_center,projected_center,radius,stroke_width,view_scale,surface_vectors);float visibility=0.0; -#ifdef TERRAIN -float step=get_sample_step();vec4 occlusion_world_center;vec4 occlusion_projected_center; -#ifdef PITCH_WITH_MAP -float cantilevered_height=cantilevered_elevation(circle_center,radius,stroke_width,view_scale);occlusion_world_center=vec4(circle_center,cantilevered_height,1);occlusion_projected_center=u_matrix*occlusion_world_center; -#else -occlusion_world_center=world_center;occlusion_projected_center=projected_center; -#endif -for(int ring=0; ring < NUM_VISIBILITY_RINGS; ring++) {float scale=(float(ring)+1.0)/float(NUM_VISIBILITY_RINGS);for(int i=0; i < NUM_SAMPLES_PER_RING; i++) {vec2 extrusion=vec2(cos(step*float(i)),-sin(step*float(i)))*scale;vec4 frag_pos=project_vertex(extrusion,occlusion_world_center,occlusion_projected_center,radius,stroke_width,view_scale,surface_vectors);visibility+=float(!isOccluded(frag_pos));}}visibility/=float(NUM_VISIBILITY_RINGS)*float(NUM_SAMPLES_PER_RING); -#else -visibility=1.0; -#endif -#ifdef PROJECTION_GLOBE_VIEW -visibility=1.0; -#endif -v_visibility=visibility;lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur); -#ifdef FOG -v_fog_pos=fog_position(world_center.xyz); -#endif -}`),clippingMask:bt("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:bt(`uniform highp float u_intensity;varying vec2 v_extrude; -#pragma mapbox: define highp float weight -#define GAUSS_COEF 0.3989422804014327 -void main() { -#pragma mapbox: initialize highp float weight -float 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); -#ifdef FOG -if (u_is_globe==0) {gl_FragColor.r*=pow(1.0-fog_opacity(v_fog_pos),2.0);} -#endif -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos; -#ifdef PROJECTION_GLOBE_VIEW -attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir; -#endif -varying vec2 v_extrude; -#pragma mapbox: define highp float weight -#pragma mapbox: define mediump float radius -const highp float ZERO=1.0/255.0/16.0; -#define GAUSS_COEF 0.3989422804014327 -void main(void) { -#pragma mapbox: initialize highp float weight -#pragma mapbox: initialize mediump float radius -vec2 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;vec2 tilePos=floor(a_pos*0.5);vec3 pos; -#ifdef PROJECTION_GLOBE_VIEW -vec3 pos_normal_3=a_pos_normal_3/16384.0;mat3 surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(tilePos)*elevation(tilePos);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*elevation(tilePos);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,tilePos,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition); -#else -pos=vec3(tilePos+extrude,elevation(tilePos)); -#endif -gl_Position=u_matrix*vec4(pos,1); -#ifdef FOG -v_fog_pos=fog_position(pos); -#endif -}`),heatmapTexture:bt(`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; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(0.0); -#endif -}`,"attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=a_pos*0.5+0.5;}"),collisionBox:bt("varying float v_placed;varying float v_notUsed;void main() {vec4 red =vec4(1.0,0.0,0.0,1.0);vec4 blue=vec4(0.0,0.0,1.0,0.5);gl_FragColor =mix(red,blue,step(0.5,v_placed))*0.5;gl_FragColor*=mix(1.0,0.1,step(0.5,v_notUsed));}",`attribute vec3 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;attribute float a_size_scale;attribute vec2 a_padding;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_pos+elevationVector(a_anchor_pos)*elevation(a_anchor_pos),1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp( -0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,1.5);gl_Position=projectedPoint;gl_Position.xy+=(a_extrude*a_size_scale+a_shift+a_padding)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}`),collisionCircle:bt("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_2f;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_2f;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:bt("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; -#ifdef PROJECTION_GLOBE_VIEW -attribute vec3 a_pos_3; -#endif -varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {float h=elevation(a_pos);v_uv=a_pos/8192.0; -#ifdef PROJECTION_GLOBE_VIEW -gl_Position=u_matrix*vec4(a_pos_3+elevationVector(a_pos)*h,1); -#else -gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,h,1); -#endif -}`),fill:bt(`#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float opacity -vec4 out_color=color; -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color); -#endif -#ifdef FOG -out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); -#endif -gl_FragColor=out_color*opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec2 a_pos;uniform mat4 u_matrix; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float opacity -gl_Position=u_matrix*vec4(a_pos,0,1); -#ifdef FOG -v_fog_pos=fog_position(a_pos); -#endif -}`),fillOutline:bt(`varying vec2 v_pos; -#pragma mapbox: define highp vec4 outline_color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 outline_color -#pragma mapbox: initialize lowp float opacity -float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=outline_color; -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color); -#endif -#ifdef FOG -out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); -#endif -gl_FragColor=out_color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos; -#pragma mapbox: define highp vec4 outline_color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 outline_color -#pragma mapbox: initialize lowp float opacity -gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world; -#ifdef FOG -v_fog_pos=fog_position(a_pos); -#endif -}`),fillOutlinePattern:bt(`uniform vec2 u_texsize;uniform sampler2D u_image;varying vec2 v_pos;varying vec2 v_pos_world; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern -vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);float dist=length(v_pos_world-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=texture2D(u_image,pos); -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color); -#endif -#ifdef FOG -out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); -#endif -gl_FragColor=out_color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;varying vec2 v_pos_world; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern -#pragma mapbox: define lowp float pixel_ratio -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern -#pragma mapbox: initialize lowp float pixel_ratio -vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);v_pos_world=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world; -#ifdef FOG -v_fog_pos=fog_position(a_pos); -#endif -}`),fillPattern:bt(`uniform vec2 u_texsize;uniform sampler2D u_image;varying vec2 v_pos; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern -vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos); -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color); -#endif -#ifdef FOG -out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); -#endif -gl_FragColor=out_color*opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern -#pragma mapbox: define lowp float pixel_ratio -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern -#pragma mapbox: initialize lowp float pixel_ratio -vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos); -#ifdef FOG -v_fog_pos=fog_position(a_pos); -#endif -}`),fillExtrusion:bt(`varying vec4 v_color; -#ifdef RENDER_SHADOWS -varying highp vec4 v_pos_light_view_0;varying highp vec4 v_pos_light_view_1;varying float v_depth; -#endif -#ifdef FAUX_AO -uniform lowp vec2 u_ao;varying vec3 v_ao; -#endif -#ifdef ZERO_ROOF_RADIUS -varying vec4 v_roof_color; -#endif -#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) -varying highp vec3 v_normal; -#endif -void main() { -#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) -vec3 normal=v_normal; -#endif -float z;vec4 color; -#ifdef ZERO_ROOF_RADIUS -z=float(normal.z > 0.00001);color=mix(v_color,v_roof_color,z); -#else -color=v_color; -#endif -#ifdef FAUX_AO -float intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x; -#ifdef ZERO_ROOF_RADIUS -concave*=(1.0-z); -#endif -float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);color.rgb=color.rgb*shade; -#endif -#ifdef RENDER_SHADOWS -#ifdef ZERO_ROOF_RADIUS -normal=mix(normal,vec3(0.0,0.0,1.0),z); -#endif -color.xyz=shadowed_color_normal(color.xyz,normalize(normal),v_pos_light_view_0,v_pos_light_view_1,v_depth); -#endif -#ifdef FOG -color=fog_dither(fog_apply_premultiplied(color,v_fog_pos)); -#endif -gl_FragColor=color; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`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;uniform float u_edge_radius;attribute vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos; -#ifdef PROJECTION_GLOBE_VIEW -attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift; -#endif -varying vec4 v_color; -#ifdef RENDER_SHADOWS -uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;varying highp vec4 v_pos_light_view_0;varying highp vec4 v_pos_light_view_1;varying float v_depth; -#endif -#ifdef ZERO_ROOF_RADIUS -varying vec4 v_roof_color; -#endif -#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) -varying highp vec3 v_normal; -#endif -#ifdef FAUX_AO -uniform lowp vec2 u_ao;varying vec3 v_ao; -#endif -#pragma mapbox: define highp float base -#pragma mapbox: define highp float height -#pragma mapbox: define highp vec4 color -void main() { -#pragma mapbox: initialize highp float base -#pragma mapbox: initialize highp float height -#pragma mapbox: initialize highp vec4 color -vec4 pos_nx=floor(a_pos_normal_ed*0.5);vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0)); -#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) -v_normal=normal; -#endif -base=max(0.0,base);height=max(0.0,top_up_ny.y==0.0 && top_up_ny.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0); -#if defined(HAS_CENTROID) || defined(TERRAIN) -centroid_pos=a_centroid_pos; -#endif -float ele=0.0;float h=0.0;float c_ele;vec3 pos; -#ifdef TERRAIN -bool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);pos=vec3(pos_nx.xy,h); -#else -h=t > 0.0 ? height : base;pos=vec3(pos_nx.xy,h); -#endif -#ifdef PROJECTION_GLOBE_VIEW -float lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*h);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,pos.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*pos.z;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition); -#endif -float hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(pos,1),AWAY,hidden); -#ifdef RENDER_SHADOWS -v_pos_light_view_0=u_light_matrix_0*vec4(pos,1);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1);v_depth=gl_Position.w; -#endif -float NdotL=0.0;float colorvalue=0.0; -#ifdef LIGHTING_3D_MODE -NdotL=calculate_NdotL(normal); -#else -colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),NdotL); -#endif -if (normal.y !=0.0) {float r=0.84; -#ifndef LIGHTING_3D_MODE -r=mix(0.7,0.98,1.0-u_lightintensity); -#endif -NdotL*=( -(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}v_color=vec4(0.0,0.0,0.0,1.0); -#ifdef FAUX_AO -float concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height; -#ifdef TERRAIN -top_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height); -#endif -v_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]); -#ifdef PROJECTION_GLOBE_VIEW -top_height+=u_height_lift; -#endif -gl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w; -#endif -#ifdef LIGHTING_3D_MODE -v_color=apply_lighting(color,NdotL); -#else -v_color.rgb+=clamp(color.rgb*NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0)); -#endif -v_color*=u_opacity; -#ifdef ZERO_ROOF_RADIUS -v_roof_color=vec4(0.0,0.0,0.0,1.0); -#ifdef LIGHTING_3D_MODE -v_roof_color=apply_lighting(color,calculate_NdotL(vec3(0.0,0.0,1.0))); -#else -float roofNdotL=clamp(u_lightpos.z,0.0,1.0);roofNdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),roofNdotL);v_roof_color.rgb+=clamp(color.rgb*roofNdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0)); -#endif -v_roof_color*=u_opacity; -#endif -#ifdef FOG -v_fog_pos=fog_position(pos); -#endif -}`),fillExtrusionPattern:bt(`uniform vec2 u_texsize;uniform sampler2D u_image; -#ifdef FAUX_AO -uniform lowp vec2 u_ao;varying vec3 v_ao; -#endif -#ifdef LIGHTING_3D_MODE -varying float v_NdotL; -#endif -varying vec2 v_pos;varying vec4 v_lighting;uniform lowp float u_opacity; -#pragma mapbox: define lowp float base -#pragma mapbox: define lowp float height -#pragma mapbox: define lowp vec4 pattern -#pragma mapbox: define lowp float pixel_ratio -void main() { -#pragma mapbox: initialize lowp float base -#pragma mapbox: initialize lowp float height -#pragma mapbox: initialize mediump vec4 pattern -#pragma mapbox: initialize lowp float pixel_ratio -vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos); -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color,v_NdotL)*u_opacity; -#else -out_color=out_color*v_lighting; -#endif -#ifdef FAUX_AO -float intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);out_color.rgb=out_color.rgb*shade; -#endif -#ifdef FOG -out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); -#endif -gl_FragColor=out_color; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform float u_tile_units_to_pixels;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 vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos; -#ifdef PROJECTION_GLOBE_VIEW -attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift; -#endif -varying vec2 v_pos;varying vec4 v_lighting; -#ifdef FAUX_AO -uniform lowp vec2 u_ao;varying vec3 v_ao; -#endif -#ifdef LIGHTING_3D_MODE -varying float v_NdotL; -#endif -#pragma mapbox: define lowp float base -#pragma mapbox: define lowp float height -#pragma mapbox: define lowp vec4 pattern -#pragma mapbox: define lowp float pixel_ratio -void main() { -#pragma mapbox: initialize lowp float base -#pragma mapbox: initialize lowp float height -#pragma mapbox: initialize mediump vec4 pattern -#pragma mapbox: initialize lowp float pixel_ratio -vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec4 pos_nx=floor(a_pos_normal_ed*0.5);mediump vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;mediump vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));float edgedistance=a_pos_normal_ed.w;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;base=max(0.0,base);height=max(0.0,height);float t=top_up_ny.x;float z=t > 0.0 ? height : base;vec2 centroid_pos=vec2(0.0); -#if defined(HAS_CENTROID) || defined(TERRAIN) -centroid_pos=a_centroid_pos; -#endif -float ele=0.0;float h=z;vec3 p;float c_ele; -#ifdef TERRAIN -bool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);p=vec3(pos_nx.xy,h); -#else -p=vec3(pos_nx.xy,z); -#endif -#ifdef PROJECTION_GLOBE_VIEW -float lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*(p.z+lift));vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,p.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*p.z;p=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition); -#endif -float hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(p,1),AWAY,hidden);vec2 pos=normal.z==1.0 -? pos_nx.xy -: vec2(edgedistance,z*u_height_factor);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float NdotL=0.0; -#ifdef LIGHTING_3D_MODE -NdotL=calculate_NdotL(normal); -#else -NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),NdotL); -#endif -if (normal.y !=0.0) {float r=0.84; -#ifndef LIGHTING_3D_MODE -r=mix(0.7,0.98,1.0-u_lightintensity); -#endif -NdotL*=( -(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));} -#ifdef FAUX_AO -float concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height; -#ifdef TERRAIN -top_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height); -#endif -v_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]); -#ifdef PROJECTION_GLOBE_VIEW -top_height+=u_height_lift; -#endif -gl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w; -#endif -#ifdef LIGHTING_3D_MODE -v_NdotL=NdotL; -#else -v_lighting.rgb+=clamp(NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity; -#endif -#ifdef FOG -v_fog_pos=fog_position(p); -#endif -}`),hillshadePrepare:bt(`#ifdef GL_ES -precision highp float; -#endif -uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord) { -#ifdef TERRAIN_DEM_FLOAT_FORMAT -return texture2D(u_image,coord).a/4.0; -#else -vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0; -#endif -}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y));float b=getElevation(v_pos+vec2(0,-epsilon.y));float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y));float d=getElevation(v_pos+vec2(-epsilon.x,0));float e=getElevation(v_pos+vec2(epsilon.x,0));float f=getElevation(v_pos+vec2(-epsilon.x,epsilon.y));float g=getElevation(v_pos+vec2(0,epsilon.y));float h=getElevation(v_pos+vec2(epsilon.x,epsilon.y));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+e+e+h)-(a+d+d+f),(f+g+g+h)-(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); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,"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:bt(`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;void 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; -#ifdef LIGHTING_3D_MODE -gl_FragColor=apply_lighting(gl_FragColor); -#endif -#ifdef FOG -gl_FragColor=fog_dither(fog_apply_premultiplied(gl_FragColor,v_fog_pos)); -#endif -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`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; -#ifdef FOG -v_fog_pos=fog_position(a_pos); -#endif -}`),line:bt(`uniform lowp float u_device_pixel_ratio;uniform float u_alpha_discard_threshold;uniform highp vec2 u_trim_offset;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec4 v_uv; -#ifdef RENDER_LINE_DASH -uniform sampler2D u_dash_image;varying vec2 v_tex; -#endif -#ifdef RENDER_LINE_GRADIENT -uniform sampler2D u_gradient_image; -#endif -uniform float u_border_width;uniform vec4 u_border_color;float luminance(vec3 c) {return (c.r+c.r+c.b+c.g+c.g+c.g)*0.1667;} -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float floorwidth -#pragma mapbox: define lowp vec4 dash -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -float linearstep(float edge0,float edge1,float x) {return clamp((x-edge0)/(edge1-edge0),0.0,1.0);}void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float floorwidth -#pragma mapbox: initialize lowp vec4 dash -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -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); -#ifdef RENDER_LINE_DASH -float sdfdist=texture2D(u_dash_image,v_tex).a;float sdfgamma=1.0/(2.0*u_device_pixel_ratio)/dash.z;alpha*=linearstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist); -#endif -highp vec4 out_color; -#ifdef RENDER_LINE_GRADIENT -out_color=texture2D(u_gradient_image,v_uv.xy); -#else -out_color=color; -#endif -float trimmed=1.0; -#ifdef RENDER_LINE_TRIM_OFFSET -highp float start=v_uv[2];highp float end=v_uv[3];highp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=(start+(v_uv.x)*(end-start));if (trim_end > trim_start) {if (line_progress <=trim_end && line_progress >=trim_start) {out_color=vec4(0,0,0,0);trimmed=0.0;}} -#endif -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color); -#endif -#ifdef FOG -out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); -#endif -#ifdef RENDER_LINE_ALPHA_DISCARD -if (alpha < u_alpha_discard_threshold) {discard;} -#endif -#ifdef RENDER_LINE_BORDER -float edgeBlur=(u_border_width+1.0/u_device_pixel_ratio);float alpha2=clamp(min(dist-(v_width2.t-edgeBlur),v_width2.s-dist)/edgeBlur,0.0,1.0);if (alpha2 < 1.) {float smoothAlpha=smoothstep(0.6,1.0,alpha2); -#ifdef RENDER_LINE_BORDER_AUTO -float Y=(out_color.a > 0.01) ? luminance(out_color.rgb/out_color.a) : 1.;float adjustment=(Y > 0.) ? 0.5/Y : 0.45;if (out_color.a > 0.25 && Y < 0.25) {vec3 borderColor=(Y > 0.) ? out_color.rgb : vec3(1,1,1)*out_color.a;out_color.rgb=out_color.rgb+borderColor*(adjustment*(1.0-smoothAlpha));} else {out_color.rgb*=(0.6 +0.4*smoothAlpha);} -#else -out_color.rgb=mix(u_border_color.rgb*u_border_color.a*trimmed,out_color.rgb,smoothAlpha); -#endif -} -#endif -gl_FragColor=out_color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,` -#define EXTRUDE_SCALE 0.015873016 -attribute vec2 a_pos_normal;attribute vec4 a_data; -#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET) -attribute highp vec4 a_packed; -#endif -#ifdef RENDER_LINE_DASH -attribute float a_linesofar; -#endif -uniform mat4 u_matrix;uniform mat2 u_pixels_to_tile_units;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 vec4 v_uv; -#ifdef RENDER_LINE_DASH -uniform vec2 u_texsize;uniform float u_tile_units_to_pixels;varying vec2 v_tex; -#endif -#ifdef RENDER_LINE_GRADIENT -uniform float u_image_height; -#endif -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float floorwidth -#pragma mapbox: define lowp vec4 dash -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define mediump float gapwidth -#pragma mapbox: define lowp float offset -#pragma mapbox: define mediump float width -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float floorwidth -#pragma mapbox: initialize lowp vec4 dash -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump float gapwidth -#pragma mapbox: initialize lowp float offset -#pragma mapbox: initialize mediump float width -float 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;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*EXTRUDE_SCALE;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*EXTRUDE_SCALE*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist*u_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude; -#ifndef RENDER_TO_TEXTURE -float 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; -#else -v_gamma_scale=1.0; -#endif -#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET) -float a_uv_x=a_packed[0];float a_split_index=a_packed[1];highp float a_clip_start=a_packed[2];highp float a_clip_end=a_packed[3]; -#ifdef RENDER_LINE_GRADIENT -highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec4(a_uv_x,a_split_index*texel_height-half_texel_height,a_clip_start,a_clip_end); -#else -v_uv=vec4(a_uv_x,0.0,a_clip_start,a_clip_end); -#endif -#endif -#ifdef RENDER_LINE_DASH -float scale=dash.z==0.0 ? 0.0 : u_tile_units_to_pixels/dash.z;float height=dash.y;v_tex=vec2(a_linesofar*scale/floorwidth,(-normal.y*height+dash.x+0.5)/u_texsize.y); -#endif -v_width2=vec2(outset,inset); -#ifdef FOG -v_fog_pos=fog_position(pos); -#endif -}`),linePattern:bt(`uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_tile_units_to_pixels;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; -#pragma mapbox: define lowp vec4 pattern -#pragma mapbox: define lowp float pixel_ratio -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize mediump vec4 pattern -#pragma mapbox: initialize lowp float pixel_ratio -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;vec2 pattern_size=vec2(display_size.x/u_tile_units_to_pixels,display_size.y);float aspect=display_size.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=mod(v_linesofar/pattern_size.x*aspect,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(x,y));vec4 color=texture2D(u_image,pos); -#ifdef LIGHTING_3D_MODE -color=apply_lighting(color); -#endif -#ifdef FOG -color=fog_dither(fog_apply_premultiplied(color,v_fog_pos)); -#endif -gl_FragColor=color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,` -#define scale 0.015873016 -attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_linesofar;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mat2 u_pixels_to_tile_units;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; -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float offset -#pragma mapbox: define mediump float gapwidth -#pragma mapbox: define mediump float width -#pragma mapbox: define lowp float floorwidth -#pragma mapbox: define lowp vec4 pattern -#pragma mapbox: define lowp float pixel_ratio -void main() { -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float offset -#pragma mapbox: initialize mediump float gapwidth -#pragma mapbox: initialize mediump float width -#pragma mapbox: initialize lowp float floorwidth -#pragma mapbox: initialize mediump vec4 pattern -#pragma mapbox: initialize lowp float pixel_ratio -float 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;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_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude; -#ifndef RENDER_TO_TEXTURE -float 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; -#else -v_gamma_scale=1.0; -#endif -v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth; -#ifdef FOG -v_fog_pos=fog_position(pos); -#endif -}`),raster:bt(`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);vec3 out_color=mix(u_high_vec,u_low_vec,rgb); -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color); -#endif -#ifdef FOG -out_color=fog_dither(fog_apply(out_color,v_fog_pos)); -#endif -gl_FragColor=vec4(out_color*color.a,color.a); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform vec2 u_perspective_transform;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {float w=1.0+dot(a_texture_pos,u_perspective_transform);gl_Position=u_matrix*vec4(a_pos*w,0,w);v_pos0=a_texture_pos/8192.0;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent; -#ifdef FOG -v_fog_pos=fog_position(a_pos); -#endif -}`),symbolIcon:bt(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize lowp float opacity -lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_pixeloffset;attribute vec4 a_projected_pos;attribute float a_fade_opacity; -#ifdef PROJECTION_GLOBE_VIEW -attribute vec3 a_globe_anchor;attribute vec3 a_globe_normal; -#endif -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 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 vec3 u_up_vector; -#ifdef PROJECTION_GLOBE_VIEW -uniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix; -#endif -varying vec2 v_tex;varying float v_fade_opacity; -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize lowp float opacity -vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_min_font_scale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[3];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 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos; -#ifdef PROJECTION_GLOBE_VIEW -mercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0; -#else -world_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0; -#endif -vec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ? -camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp( -0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjected_point; -#ifdef PROJECTION_GLOBE_VIEW -vec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetProjected_point=u_matrix*vec4(a_globe_anchor+displacement,1); -#else -offsetProjected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1); -#endif -vec2 a=projected_point.xy/projected_point.w;vec2 b=offsetProjected_point.xy/offsetProjected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos; -#ifdef PROJECTION_GLOBE_VIEW -vec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0); -#else -projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0); -#endif -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);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*max(a_min_font_scale,font_scale)+a_pxoffset/16.0); -#ifdef TERRAIN -#ifdef PITCH_WITH_MAP_TERRAIN -vec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy); -#endif -#endif -float occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade; -#ifdef PROJECTION_GLOBE_VIEW -vec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); -#else -gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); -#endif -float projection_transition_fade=1.0; -#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW) -projection_transition_fade=1.0-step(EPSILON,u_zoom_transition); -#endif -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;v_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change))*projection_transition_fade;}`),symbolSDF:bt(`#define SDF_PX 8.0 -uniform 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; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -float 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 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); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_pixeloffset;attribute vec4 a_projected_pos;attribute float a_fade_opacity; -#ifdef PROJECTION_GLOBE_VIEW -attribute vec3 a_globe_anchor;attribute vec3 a_globe_normal; -#endif -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_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 vec3 u_up_vector; -#ifdef PROJECTION_GLOBE_VIEW -uniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix; -#endif -varying vec2 v_data0;varying vec3 v_data1; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[3];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 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos; -#ifdef PROJECTION_GLOBE_VIEW -mercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0; -#else -world_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0; -#endif -vec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ? -camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp( -0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetprojected_point; -#ifdef PROJECTION_GLOBE_VIEW -vec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetprojected_point=u_matrix*vec4(a_globe_anchor+displacement,1); -#else -offsetprojected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1); -#endif -vec2 a=projected_point.xy/projected_point.w;vec2 b=offsetprojected_point.xy/offsetprojected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos; -#ifdef PROJECTION_GLOBE_VIEW -vec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0); -#else -projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0); -#endif -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);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset); -#ifdef TERRAIN -#ifdef PITCH_WITH_MAP_TERRAIN -vec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy); -#endif -#endif -float occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade; -#ifdef PROJECTION_GLOBE_VIEW -vec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); -#else -gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); -#endif -float gamma_scale=gl_Position.w;float projection_transition_fade=1.0; -#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW) -projection_transition_fade=1.0-step(EPSILON,u_zoom_transition); -#endif -vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity*projection_transition_fade);}`),symbolTextAndIcon:bt(`#define SDF_PX 8.0 -#define SDF 1.0 -#define ICON 0.0 -uniform 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; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -float 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; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -return;}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); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_projected_pos;attribute float a_fade_opacity; -#ifdef PROJECTION_GLOBE_VIEW -attribute vec3 a_globe_anchor;attribute vec3 a_globe_normal; -#endif -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_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 vec3 u_up_vector;uniform vec2 u_texsize_icon; -#ifdef PROJECTION_GLOBE_VIEW -uniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix; -#endif -varying vec4 v_data0;varying vec4 v_data1; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[3];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 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos; -#ifdef PROJECTION_GLOBE_VIEW -mercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0; -#else -world_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0; -#endif -vec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ? -camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp( -0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offset_projected_point=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projected_point.xy/projected_point.w;vec2 b=offset_projected_point.xy/offset_projected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos; -#ifdef PROJECTION_GLOBE_VIEW -vec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0); -#else -projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0); -#endif -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);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*font_scale); -#ifdef TERRAIN -#ifdef PITCH_WITH_MAP_TERRAIN -vec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy); -#endif -#endif -float occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade; -#ifdef PROJECTION_GLOBE_VIEW -vec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); -#else -gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); -#endif -float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));float projection_transition_fade=1.0; -#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW) -projection_transition_fade=1.0-step(EPSILON,u_zoom_transition); -#endif -v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity*projection_transition_fade,is_sdf);}`),terrainRaster:bt(`uniform sampler2D u_image0;varying vec2 v_pos0; -#ifdef FOG -varying float v_fog_opacity; -#endif -#ifdef RENDER_SHADOWS -varying vec4 v_pos_light_view_0;varying vec4 v_pos_light_view_1;varying float v_depth; -#endif -void main() {vec4 color=texture2D(u_image0,v_pos0); -#ifdef RENDER_SHADOWS -color.xyz=shadowed_color(color.xyz,v_pos_light_view_0,v_pos_light_view_1,v_depth); -#endif -#ifdef FOG -#ifdef ZERO_EXAGGERATION -color=fog_dither(fog_apply_premultiplied(color,v_fog_pos)); -#else -color=fog_dither(fog_apply_from_vert(color,v_fog_opacity)); -#endif -#endif -gl_FragColor=color; -#ifdef TERRAIN_WIREFRAME -gl_FragColor=vec4(1.0,0.0,0.0,0.8); -#endif -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform float u_skirt_height;attribute vec2 a_pos;varying vec2 v_pos0; -#ifdef FOG -varying float v_fog_opacity; -#endif -#ifdef RENDER_SHADOWS -uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;varying vec4 v_pos_light_view_0;varying vec4 v_pos_light_view_1;varying float v_depth; -#endif -const float wireframeOffset=0.00015;void main() {vec3 decomposedPosAndSkirt=decomposeToPosAndSkirt(a_pos);float skirt=decomposedPosAndSkirt.z;vec2 decodedPos=decomposedPosAndSkirt.xy;float elevation=elevation(decodedPos)-skirt*u_skirt_height; -#ifdef TERRAIN_WIREFRAME -elevation+=wireframeOffset; -#endif -v_pos0=decodedPos/8192.0;gl_Position=u_matrix*vec4(decodedPos,elevation,1.0); -#ifdef FOG -#ifdef ZERO_EXAGGERATION -v_fog_pos=fog_position(decodedPos); -#else -v_fog_opacity=fog(fog_position(vec3(decodedPos,elevation))); -#endif -#endif -#ifdef RENDER_SHADOWS -vec3 pos=vec3(decodedPos,elevation);v_pos_light_view_0=u_light_matrix_0*vec4(pos,1.);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1.);v_depth=gl_Position.w; -#endif -}`),terrainDepth:bt(`#ifdef GL_ES -precision highp float; -#endif -varying float v_depth;void main() {gl_FragColor=pack_depth(v_depth);}`,"uniform mat4 u_matrix;attribute vec2 a_pos;varying float v_depth;void main() {float elevation=elevation(a_pos);gl_Position=u_matrix*vec4(a_pos,elevation,1.0);v_depth=gl_Position.z/gl_Position.w;}"),skybox:bt(` -varying lowp vec3 v_uv;uniform lowp samplerCube u_cubemap;uniform lowp float u_opacity;uniform highp float u_temporal_offset;uniform highp vec3 u_sun_direction;float sun_disk(highp vec3 ray_direction,highp vec3 sun_direction) {highp float cos_angle=dot(normalize(ray_direction),sun_direction);const highp float cos_sun_angular_diameter=0.99996192306;const highp float smoothstep_delta=1e-5;return smoothstep( -cos_sun_angular_diameter-smoothstep_delta,cos_sun_angular_diameter+smoothstep_delta,cos_angle);}float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec3 uv=v_uv;const float y_bias=0.015;uv.y+=y_bias;uv.y=pow(abs(uv.y),1.0/5.0);uv.y=map(uv.y,0.0,1.0,-1.0,1.0);vec3 sky_color=textureCube(u_cubemap,uv).rgb; -#ifdef FOG -sky_color=fog_apply_sky_gradient(v_uv.xzy,sky_color); -#endif -sky_color.rgb=dither(sky_color.rgb,gl_FragCoord.xy+u_temporal_offset);sky_color+=0.1*sun_disk(v_uv,u_sun_direction);gl_FragColor=vec4(sky_color*u_opacity,u_opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,vn),skyboxGradient:bt(`varying highp vec3 v_uv;uniform lowp sampler2D u_color_ramp;uniform highp vec3 u_center_direction;uniform lowp float u_radius;uniform lowp float u_opacity;uniform highp float u_temporal_offset;void main() {float progress=acos(dot(normalize(v_uv),u_center_direction))/u_radius;vec4 color=texture2D(u_color_ramp,vec2(progress,0.5)); -#ifdef FOG -color.rgb=fog_apply_sky_gradient(v_uv.xzy,color.rgb/color.a)*color.a; -#endif -color*=u_opacity;color.rgb=dither(color.rgb,gl_FragCoord.xy+u_temporal_offset);gl_FragColor=color; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,vn),skyboxCapture:bt(` -varying highp vec3 v_position;uniform highp float u_sun_intensity;uniform highp float u_luminance;uniform lowp vec3 u_sun_direction;uniform highp vec4 u_color_tint_r;uniform highp vec4 u_color_tint_m; -#ifdef GL_ES -precision highp float; -#endif -#define BETA_R vec3(5.5e-6,13.0e-6,22.4e-6) -#define BETA_M vec3(21e-6,21e-6,21e-6) -#define MIE_G 0.76 -#define DENSITY_HEIGHT_SCALE_R 8000.0 -#define DENSITY_HEIGHT_SCALE_M 1200.0 -#define PLANET_RADIUS 6360e3 -#define ATMOSPHERE_RADIUS 6420e3 -#define SAMPLE_STEPS 10 -#define DENSITY_STEPS 4 -float ray_sphere_exit(vec3 orig,vec3 dir,float radius) {float a=dot(dir,dir);float b=2.0*dot(dir,orig);float c=dot(orig,orig)-radius*radius;float d=sqrt(b*b-4.0*a*c);return (-b+d)/(2.0*a);}vec3 extinction(vec2 density) {return exp(-vec3(BETA_R*u_color_tint_r.a*density.x+BETA_M*u_color_tint_m.a*density.y));}vec2 local_density(vec3 point) {float height=max(length(point)-PLANET_RADIUS,0.0);float exp_r=exp(-height/DENSITY_HEIGHT_SCALE_R);float exp_m=exp(-height/DENSITY_HEIGHT_SCALE_M);return vec2(exp_r,exp_m);}float phase_ray(float cos_angle) {return (3.0/(16.0*PI))*(1.0+cos_angle*cos_angle);}float phase_mie(float cos_angle) {return (3.0/(8.0*PI))*((1.0-MIE_G*MIE_G)*(1.0+cos_angle*cos_angle))/((2.0+MIE_G*MIE_G)*pow(1.0+MIE_G*MIE_G-2.0*MIE_G*cos_angle,1.5));}vec2 density_to_atmosphere(vec3 point,vec3 light_dir) {float ray_len=ray_sphere_exit(point,light_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(DENSITY_STEPS);vec2 density_point_to_atmosphere=vec2(0.0);for (int i=0; i < DENSITY_STEPS;++i) {vec3 point_on_ray=point+light_dir*((float(i)+0.5)*step_len);density_point_to_atmosphere+=local_density(point_on_ray)*step_len;;}return density_point_to_atmosphere;}vec3 atmosphere(vec3 ray_dir,vec3 sun_direction,float sun_intensity) {vec2 density_orig_to_point=vec2(0.0);vec3 scatter_r=vec3(0.0);vec3 scatter_m=vec3(0.0);vec3 origin=vec3(0.0,PLANET_RADIUS,0.0);float ray_len=ray_sphere_exit(origin,ray_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(SAMPLE_STEPS);for (int i=0; i < SAMPLE_STEPS;++i) {vec3 point_on_ray=origin+ray_dir*((float(i)+0.5)*step_len);vec2 density=local_density(point_on_ray)*step_len;density_orig_to_point+=density;vec2 density_point_to_atmosphere=density_to_atmosphere(point_on_ray,sun_direction);vec2 density_orig_to_atmosphere=density_orig_to_point+density_point_to_atmosphere;vec3 extinction=extinction(density_orig_to_atmosphere);scatter_r+=density.x*extinction;scatter_m+=density.y*extinction;}float cos_angle=dot(ray_dir,sun_direction);float phase_r=phase_ray(cos_angle);float phase_m=phase_mie(cos_angle);vec3 beta_r=BETA_R*u_color_tint_r.rgb*u_color_tint_r.a;vec3 beta_m=BETA_M*u_color_tint_m.rgb*u_color_tint_m.a;return (scatter_r*phase_r*beta_r+scatter_m*phase_m*beta_m)*sun_intensity;}const float A=0.15;const float B=0.50;const float C=0.10;const float D=0.20;const float E=0.02;const float F=0.30;vec3 uncharted2_tonemap(vec3 x) {return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;}void main() {vec3 ray_direction=v_position;ray_direction.y=pow(ray_direction.y,5.0);const float y_bias=0.015;ray_direction.y+=y_bias;vec3 color=atmosphere(normalize(ray_direction),u_sun_direction,u_sun_intensity);float white_scale=1.0748724675633854;color=uncharted2_tonemap((log2(2.0/pow(u_luminance,4.0)))*color)*white_scale;gl_FragColor=vec4(color,1.0);}`,"attribute highp vec3 a_pos_3f;uniform mat3 u_matrix_3f;varying highp vec3 v_position;float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec4 pos=vec4(u_matrix_3f*a_pos_3f,1.0);v_position=pos.xyz;v_position.y*=-1.0;v_position.y=map(v_position.y,-1.0,1.0,0.0,1.0);gl_Position=vec4(a_pos_3f.xy,0.0,1.0);}"),globeRaster:bt(`uniform sampler2D u_image0;varying vec2 v_pos0; -#ifndef FOG -uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform vec2 u_viewport; -#endif -void main() {vec4 color; -#ifdef CUSTOM_ANTIALIASING -vec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix( -mix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);vec3 dir=normalize(ray_dir);vec3 closest_point=dot(u_globe_pos,dir)*dir;float norm_dist_from_center=1.0-length(closest_point-u_globe_pos)/u_globe_radius;const float antialias_pixel=2.0;float antialias_factor=antialias_pixel*fwidth(norm_dist_from_center);float antialias=smoothstep(0.0,antialias_factor,norm_dist_from_center);vec4 raster=texture2D(u_image0,v_pos0);color=vec4(raster.rgb*antialias,raster.a*antialias); -#else -color=texture2D(u_image0,v_pos0); -#endif -#ifdef FOG -color=fog_dither(fog_apply_premultiplied(color,v_fog_pos)); -#endif -gl_FragColor=color; -#ifdef TERRAIN_WIREFRAME -gl_FragColor=vec4(1.0,0.0,0.0,0.8); -#endif -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_proj_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform float u_zoom_transition;uniform vec2 u_merc_center;uniform mat3 u_grid_matrix;uniform float u_skirt_height; -#ifdef GLOBE_POLES -attribute vec3 a_globe_pos;attribute vec2 a_uv; -#else -attribute vec2 a_pos; -#endif -varying vec2 v_pos0;const float wireframeOffset=1e3;float mercatorXfromLng(float lng) {return (180.0+lng)/360.0;}float mercatorYfromLat(float lat) {return (180.0-(RAD_TO_DEG*log(tan(QUARTER_PI+lat/2.0*DEG_TO_RAD))))/360.0;}vec3 latLngToECEF(vec2 latLng) {latLng=DEG_TO_RAD*latLng;float cosLat=cos(latLng[0]);float sinLat=sin(latLng[0]);float cosLng=cos(latLng[1]);float sinLng=sin(latLng[1]);float sx=cosLat*sinLng*GLOBE_RADIUS;float sy=-sinLat*GLOBE_RADIUS;float sz=cosLat*cosLng*GLOBE_RADIUS;return vec3(sx,sy,sz);}void main() { -#ifdef GLOBE_POLES -vec3 globe_pos=a_globe_pos;vec2 uv=a_uv; -#else -float tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];vec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float uvY=mercatorY*tiles-idy;float mercatorX=mercatorXfromLng(latLng[1]);float uvX=mercatorX*tiles-idx;vec3 globe_pos=latLngToECEF(latLng.xy);vec2 merc_pos=vec2(mercatorX,mercatorY);vec2 uv=vec2(uvX,uvY); -#endif -v_pos0=uv;vec2 tile_pos=uv*EXTENT;vec3 globe_derived_up_vector=normalize(globe_pos)*u_tile_up_scale; -#ifdef GLOBE_POLES -vec3 up_vector=globe_derived_up_vector; -#else -vec3 up_vector=elevationVector(tile_pos); -#endif -float height=elevation(tile_pos); -#ifdef TERRAIN_WIREFRAME -height+=wireframeOffset; -#endif -globe_pos+=up_vector*height; -#ifndef GLOBE_POLES -globe_pos-=globe_derived_up_vector*u_skirt_height*decomposed_pos_and_skirt.z; -#endif -#ifdef GLOBE_POLES -vec4 interpolated_pos=u_globe_matrix*vec4(globe_pos,1.0); -#else -vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {merc_world_pos=vec4(merc_pos,height-u_skirt_height*decomposed_pos_and_skirt.z,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition),1.0); -#endif -gl_Position=u_proj_matrix*interpolated_pos; -#ifdef FOG -v_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz); -#endif -}`),globeAtmosphere:bt(`uniform float u_transition;uniform highp float u_fadeout_range;uniform highp float u_temporal_offset;uniform vec3 u_start_color;uniform vec4 u_color;uniform vec4 u_space_color;uniform vec4 u_high_color;uniform float u_star_intensity;uniform float u_star_size;uniform float u_star_density;uniform float u_horizon_angle;uniform mat4 u_rotation_matrix;varying highp vec3 v_ray_dir;varying highp vec3 v_horizon_dir;highp float random(highp vec3 p) {p=fract(p*vec3(23.2342,97.1231,91.2342));p+=dot(p.zxy,p.yxz+123.1234);return fract(p.x*p.y);}float stars(vec3 p,float scale,vec2 offset) {vec2 uv_scale=(u_viewport/u_star_size)*scale;vec3 position=vec3(p.xy*uv_scale+offset*u_viewport,p.z);vec3 q=fract(position)-0.5;vec3 id=floor(position);float random_visibility=step(random(id),u_star_density);float circle=smoothstep(0.5+u_star_intensity,0.5,length(q));return circle*random_visibility;}void main() {highp vec3 dir=normalize(v_ray_dir);float globe_pos_dot_dir; -#ifdef PROJECTION_GLOBE_VIEW -globe_pos_dot_dir=dot(u_globe_pos,dir);highp vec3 closest_point_forward=abs(globe_pos_dot_dir)*dir;float norm_dist_from_center=length(closest_point_forward-u_globe_pos)/u_globe_radius;if (norm_dist_from_center < 0.98) {discard;return;} -#endif -highp vec3 horizon_dir=normalize(v_horizon_dir);float horizon_angle_mercator=dir.y < horizon_dir.y ? -0.0 : max(acos(dot(dir,horizon_dir)),0.0);float horizon_angle; -#ifdef PROJECTION_GLOBE_VIEW -highp vec3 closest_point=globe_pos_dot_dir*dir;float closest_point_to_center=length(closest_point-u_globe_pos);float theta=asin(clamp(closest_point_to_center/length(u_globe_pos),-1.0,1.0));horizon_angle=globe_pos_dot_dir < 0.0 ? -PI-theta-u_horizon_angle : theta-u_horizon_angle;float angle_t=pow(u_transition,10.0);horizon_angle=mix(horizon_angle,horizon_angle_mercator,angle_t); -#else -horizon_angle=horizon_angle_mercator; -#endif -horizon_angle/=PI;float t=exp(-horizon_angle/u_fadeout_range);float alpha_0=u_color.a;float alpha_1=u_high_color.a;float alpha_2=u_space_color.a;vec3 color_stop_0=u_color.rgb;vec3 color_stop_1=u_high_color.rgb;vec3 color_stop_2=u_space_color.rgb;vec3 c0=mix(color_stop_2,color_stop_1,alpha_1);vec3 c1=mix(c0,color_stop_0,alpha_0);vec3 c2=mix(c0,c1,t);vec3 c =mix(color_stop_2,c2,t);float a0=mix(alpha_2,1.0,alpha_1);float a1=mix(a0,1.0,alpha_0);float a2=mix(a0,a1,t);float a =mix(alpha_2,a2,t);vec2 uv=gl_FragCoord.xy/u_viewport-0.5;float aspect_ratio=u_viewport.x/u_viewport.y;vec4 uv_dir=vec4(normalize(vec3(uv.x*aspect_ratio,uv.y,1.0)),1.0);uv_dir=u_rotation_matrix*uv_dir;vec3 n=abs(uv_dir.xyz);vec2 uv_remap=(n.x > n.y && n.x > n.z) ? uv_dir.yz/uv_dir.x: -(n.y > n.x && n.y > n.z) ? uv_dir.zx/uv_dir.y: -uv_dir.xy/uv_dir.z;uv_remap.x/=aspect_ratio;vec3 D=vec3(uv_remap,1.0);highp float star_field=0.0;if (u_star_intensity > 0.0) {star_field+=stars(D,1.2,vec2(0.0,0.0));star_field+=stars(D,1.0,vec2(1.0,0.0));star_field+=stars(D,0.8,vec2(0.0,1.0));star_field+=stars(D,0.6,vec2(1.0,1.0));star_field*=(1.0-pow(t,0.25+(1.0-u_high_color.a)*0.75));c+=star_field*alpha_2;}c=dither(c,gl_FragCoord.xy+u_temporal_offset);gl_FragColor=vec4(c,a);}`,`attribute vec3 a_pos;attribute vec2 a_uv;uniform vec3 u_frustum_tl;uniform vec3 u_frustum_tr;uniform vec3 u_frustum_br;uniform vec3 u_frustum_bl;uniform float u_horizon;varying highp vec3 v_ray_dir;varying highp vec3 v_horizon_dir;void main() {v_ray_dir=mix( -mix(u_frustum_tl,u_frustum_tr,a_uv.x),mix(u_frustum_bl,u_frustum_br,a_uv.x),a_uv.y);v_horizon_dir=mix( -mix(u_frustum_tl,u_frustum_bl,u_horizon),mix(u_frustum_tr,u_frustum_br,u_horizon),a_uv.x);gl_Position=vec4(a_pos,1.0);}`)};function Kn(l,r){const o=l.replace(/\s*\/\/[^\n]*\n/g,` -`).split(` -`);for(let h of o)if(h=h.trim(),h[0]==="#"&&h.includes("if")&&!h.includes("endif")){h=h.replace("#","").replace(/ifdef|ifndef|elif|if/g,"").replace(/!|defined|\(|\)|\|\||&&/g,"").replace(/\s+/g," ").trim();const d=h.split(" ");for(const f of d)r.includes(f)||r.push(f)}}function bt(l,r){const o=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,h=r.match(/attribute (highp |mediump |lowp )?([\w]+) ([\w]+)/g),d={},f=[...Vo];return Kn(l,f),Kn(r,f),{fragmentSource:l=l.replace(o,(g,y,v,E,T)=>(d[T]=!0,y==="define"?` -#ifndef HAS_UNIFORM_u_${T} -varying ${v} ${E} ${T}; -#else -uniform ${v} ${E} u_${T}; -#endif -`:` -#ifdef HAS_UNIFORM_u_${T} - ${v} ${E} ${T} = u_${T}; -#endif -`)),vertexSource:r=r.replace(o,(g,y,v,E,T)=>{const A=E==="float"?"vec2":"vec4",k=T.match(/color/)?"color":A;return d[T]?y==="define"?` -#ifndef HAS_UNIFORM_u_${T} -uniform lowp float u_${T}_t; -attribute ${v} ${A} a_${T}; -varying ${v} ${E} ${T}; -#else -uniform ${v} ${E} u_${T}; -#endif -`:k==="vec4"?` -#ifndef HAS_UNIFORM_u_${T} - ${T} = a_${T}; -#else - ${v} ${E} ${T} = u_${T}; -#endif -`:` -#ifndef HAS_UNIFORM_u_${T} - ${T} = unpack_mix_${k}(a_${T}, u_${T}_t); -#else - ${v} ${E} ${T} = u_${T}; -#endif -`:y==="define"?` -#ifndef HAS_UNIFORM_u_${T} -uniform lowp float u_${T}_t; -attribute ${v} ${A} a_${T}; -#else -uniform ${v} ${E} u_${T}; -#endif -`:k==="vec4"?` -#ifndef HAS_UNIFORM_u_${T} - ${v} ${E} ${T} = a_${T}; -#else - ${v} ${E} ${T} = u_${T}; -#endif -`:` -#ifndef HAS_UNIFORM_u_${T} - ${v} ${E} ${T} = unpack_mix_${k}(a_${T}, u_${T}_t); -#else - ${v} ${E} ${T} = u_${T}; -#endif -`}),staticAttributes:h,usedDefines:f}}class Ch{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffers=[],this.vao=null}bind(r,o,h,d,f,g,y){this.context=r;let v=this.boundPaintVertexBuffers.length!==d.length;for(let T=0;!v&&T{const N=I.paint.get("hillshade-shadow-color"),j=I.paint.get("hillshade-highlight-color"),K=I.paint.get("hillshade-accent-color");let J=I.paint.get("hillshade-illumination-direction")*(Math.PI/180);I.paint.get("hillshade-illumination-anchor")==="viewport"&&(J-=B.transform.angle);const Y=!B.options.moving;return{u_matrix:L||B.transform.calculateProjMatrix(F.tileID.toUnwrapped(),Y),u_image:0,u_latrange:Ua(0,F.tileID),u_light:[I.paint.get("hillshade-exaggeration"),J],u_shadow:N,u_highlight:j,u_accent:K}})(l,o,h,l.terrain?r.projMatrix:null);l.prepareDrawProgram(y,T,r.toUnwrapped());const{tileBoundsBuffer:k,tileBoundsIndexBuffer:R,tileBoundsSegments:O}=l.getTileBoundsBuffers(o);T.draw(y,v.TRIANGLES,d,f,g,a.CullFaceMode.disabled,A,h.id,k,R,O)}function Va(l,r,o){if(!r.needsDEMTextureUpload)return;const h=l.context,d=h.gl;h.pixelStoreUnpackPremultiplyAlpha.set(!1),r.demTexture=r.demTexture||l.getTileTexture(o.stride);const f=o.getPixels();r.demTexture?r.demTexture.update(f,{premultiply:!1}):r.demTexture=new a.Texture(h,f,d.RGBA,{premultiply:!1}),r.needsDEMTextureUpload=!1}function cc(l,r,o,h,d,f){const g=l.context,y=g.gl;if(!r.dem)return;const v=r.dem;if(g.activeTexture.set(y.TEXTURE1),Va(l,r,v),!r.demTexture)return;r.demTexture.bind(y.NEAREST,y.CLAMP_TO_EDGE);const E=v.dim;g.activeTexture.set(y.TEXTURE0);let T=r.fbo;if(!T){const O=new a.Texture(g,{width:E,height:E,data:null},y.RGBA);O.bind(y.LINEAR,y.CLAMP_TO_EDGE),T=r.fbo=g.createFramebuffer(E,E,!0),T.colorAttachment.set(O.texture)}g.bindFramebuffer.set(T.framebuffer),g.viewport.set([0,0,E,E]);const{tileBoundsBuffer:A,tileBoundsIndexBuffer:k,tileBoundsSegments:R}=l.getMercatorTileBoundsBuffers();l.useProgram("hillshadePrepare").draw(g,y.TRIANGLES,h,d,f,a.CullFaceMode.disabled,((O,B)=>{const F=B.stride,I=a.create();return a.ortho(I,0,a.EXTENT,-a.EXTENT,0,0,1),a.translate(I,I,[0,-a.EXTENT,0]),{u_matrix:I,u_image:1,u_dimension:[F,F],u_zoom:O.overscaledZ,u_unpack:B.unpackVector}})(r.tileID,v),o.id,A,k,R),r.needsHillshadePrepare=!1}const Na=l=>({u_matrix:new a.UniformMatrix4f(l),u_image0:new a.Uniform1i(l),u_skirt_height:new a.Uniform1f(l)}),Yn=(l,r)=>({u_matrix:l,u_image0:0,u_skirt_height:r}),Cs=(l,r,o,h,d,f,g,y,v,E,T,A,k,R,O)=>({u_proj_matrix:Float32Array.from(l),u_globe_matrix:r,u_normalize_matrix:Float32Array.from(h),u_merc_matrix:o,u_zoom_transition:d,u_merc_center:f,u_image0:0,u_frustum_tl:g,u_frustum_tr:y,u_frustum_br:v,u_frustum_bl:E,u_globe_pos:T,u_globe_radius:A,u_viewport:k,u_grid_matrix:O?Float32Array.from(O):new Float32Array(9),u_skirt_height:R});function Jn(l,r){return l!=null&&r!=null&&!(!l.hasData()||!r.hasData())&&l.demTexture!=null&&r.demTexture!=null&&l.tileID.key!==r.tileID.key}const Pr=new class{constructor(){this.operations={}}newMorphing(l,r,o,h,d){if(l in this.operations){const f=this.operations[l];f.to.tileID.key!==o.tileID.key&&(f.queued=o)}else this.operations[l]={startTime:h,phase:0,duration:d,from:r,to:o,queued:null}}getMorphValuesForProxy(l){if(!(l in this.operations))return null;const r=this.operations[l];return{from:r.from,to:r.to,phase:r.phase}}update(l){for(const r in this.operations){const o=this.operations[r];for(o.phase=(l-o.startTime)/o.duration;o.phase>=1||!this._validOp(o);)if(!this._nextOp(o,l)){delete this.operations[r];break}}}_nextOp(l,r){return!!l.queued&&(l.from=l.to,l.to=l.queued,l.queued=null,l.phase=0,l.startTime=r,!0)}_validOp(l){return l.from.hasData()&&l.to.hasData()}},bn={0:null,1:"TERRAIN_VERTEX_MORPHING",2:"TERRAIN_WIREFRAME"};function zs(l){return 6*Math.pow(1.5,22-l)}function hc(l,r){const o=1<({u_matrix:l});function ja(l,r,o,h,d){if(d>0){const f=a.exported.now(),g=(f-l.timeAdded)/d,y=r?(f-r.timeAdded)/d:-1,v=o.getSource(),E=h.coveringZoomLevel({tileSize:v.tileSize,roundZoom:v.roundZoom}),T=!r||Math.abs(r.tileID.overscaledZ-E)>Math.abs(l.tileID.overscaledZ-E),A=T&&l.refreshedUponExpiration?1:a.clamp(T?g:1-y,0,1);return l.refreshedUponExpiration&&g>=1&&(l.refreshedUponExpiration=!1),r?{opacity:1,mix:1-A}:{opacity:A,mix:0}}return{opacity:1,mix:0}}class Ga extends a.SourceCache{constructor(r){const o={type:"raster-dem",maxzoom:r.transform.maxZoom},h=new oi(Zn(),null),d=nt("mock-dem",o,h,r.style);super("mock-dem",d,!1),d.setEventedParent(this),this._sourceLoaded=!0}_loadTile(r,o){r.state="loaded",o(null)}}class Ps extends a.SourceCache{constructor(r){const o=nt("proxy",{type:"geojson",maxzoom:r.transform.maxZoom},new oi(Zn(),null),r.style);super("proxy",o,!1),o.setEventedParent(this),this.map=this.getSource().map=r,this.used=this._sourceLoaded=!0,this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}update(r,o,h){if(r.freezeTileCoverage)return;this.transform=r;const d=r.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}).reduce((f,g)=>{if(f[g.key]="",!this._tiles[g.key]){const y=new a.Tile(g,this._source.tileSize*g.overscaleFactor(),r.tileZoom);y.state="loaded",this._tiles[g.key]=y}return f},{});for(const f in this._tiles)f in d||(this.freeFBO(f),this._tiles[f].unloadVectorData(),delete this._tiles[f])}freeFBO(r){const o=this.proxyCachedFBO[r];if(o!==void 0){const h=Object.values(o);this.renderCachePool.push(...h),delete this.proxyCachedFBO[r]}}deallocRenderCache(){this.renderCache.forEach(r=>r.fb.destroy()),this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}}class ks extends a.OverscaledTileID{constructor(r,o,h){super(r.overscaledZ,r.wrap,r.canonical.z,r.canonical.x,r.canonical.y),this.proxyTileKey=o,this.projMatrix=h}}class $a extends a.Elevation{constructor(r,o){super(),this.painter=r,this.terrainTileForTile={},this.prevTerrainTileForTile={};const[h,d,f]=function(v){const E=new a.StructArrayLayout2i4,T=new a.StructArrayLayout3ui6,A=131;E.reserve(17161),T.reserve(33800);const k=a.EXTENT/128,R=a.EXTENT+k/2,O=R+k;for(let F=-k;FR||F<0||F>R?24575:0,N=a.clamp(Math.round(I),0,a.EXTENT),j=a.clamp(Math.round(F),0,a.EXTENT);E.emplaceBack(N+L,j)}const B=(F,I)=>{const L=I*A+F;T.emplaceBack(L+1,L,L+A),T.emplaceBack(L+A,L+A+1,L+1)};for(let F=1;F<129;F++)for(let I=1;I<129;I++)B(I,F);return[0,129].forEach(F=>{for(let I=0;I<130;I++)B(I,F),B(F,I)}),[E,T,32768]}(),g=r.context;this.gridBuffer=g.createVertexBuffer(h,a.posAttributes.members),this.gridIndexBuffer=g.createIndexBuffer(d),this.gridSegments=a.SegmentVector.simpleSegment(0,0,h.length,d.length),this.gridNoSkirtSegments=a.SegmentVector.simpleSegment(0,0,h.length,f),this.proxyCoords=[],this.proxiedCoords={},this._visibleDemTiles=[],this._drapedRenderBatches=[],this._sourceTilesOverlap={},this.proxySourceCache=new Ps(o.map),this.orthoMatrix=a.create(),a.ortho(this.orthoMatrix,this.painter.transform.projection.name==="globe"?.015:0,a.EXTENT,0,a.EXTENT,0,1);const y=g.gl;this._overlapStencilMode=new a.StencilMode({func:y.GEQUAL,mask:255},0,255,y.KEEP,y.KEEP,y.REPLACE),this._previousZoom=r.transform.zoom,this.pool=[],this._findCoveringTileCache={},this._tilesDirty={},this.style=o,this._useVertexMorphing=!0,this._exaggeration=1,this._mockSourceCache=new Ga(o.map)}set style(r){r.on("data",this._onStyleDataEvent.bind(this)),r.on("neworder",this._checkRenderCacheEfficiency.bind(this)),this._style=r,this._checkRenderCacheEfficiency(),this._style.map.on("moveend",()=>{this._clearLineLayersFromRenderCache()})}update(r,o,h){if(r&&r.terrain){this._style!==r&&(this.style=r),this.enabled=!0;const d=r.terrain.properties;this.sourceCache=r.terrain.drapeRenderMode===0?this._mockSourceCache:r._getSourceCache(d.get("source")),this._exaggeration=d.get("exaggeration");const f=()=>{this.sourceCache.used&&a.warnOnce(`Raster DEM source '${this.sourceCache.id}' is used both for terrain and as layer source. -This leads to lower resolution of hillshade. For full hillshade resolution but higher memory consumption, define another raster DEM source.`);const g=this.getScaledDemTileSize();this.sourceCache.update(o,g,!0),this.resetTileLookupCache(this.sourceCache.id)};this.sourceCache.usedForTerrain||(this.resetTileLookupCache(this.sourceCache.id),this.sourceCache.usedForTerrain=!0,f(),this._initializing=!0),f(),o.updateElevation(!0,h),this.resetTileLookupCache(this.proxySourceCache.id),this.proxySourceCache.update(o),this._emptyDEMTextureDirty=!0}else this._disable()}resetTileLookupCache(r){this._findCoveringTileCache[r]={}}getScaledDemTileSize(){return this.sourceCache.getSource().tileSize/128*this.proxySourceCache.getSource().tileSize}_checkRenderCacheEfficiency(){const r=this.renderCacheEfficiency(this._style);this._style.map._optimizeForTerrain||r.efficiency!==100&&a.warnOnce(`Terrain render cache efficiency is not optimal (${r.efficiency}%) and performance - may be affected negatively, consider placing all background, fill and line layers before layer - with id '${r.firstUndrapedLayer}' or create a map using optimizeForTerrain: true option.`)}_onStyleDataEvent(r){r.coord&&r.dataType==="source"?this._clearRenderCacheForTile(r.sourceCacheId,r.coord):r.dataType==="style"&&(this._invalidateRenderCache=!0)}_disable(){if(this.enabled&&(this.enabled=!1,this._sharedDepthStencil=void 0,this.proxySourceCache.deallocRenderCache(),this._style))for(const r in this._style._sourceCaches)this._style._sourceCaches[r].usedForTerrain=!1}destroy(){this._disable(),this._emptyDEMTexture&&this._emptyDEMTexture.destroy(),this._emptyDepthBufferTexture&&this._emptyDepthBufferTexture.destroy(),this.pool.forEach(r=>r.fb.destroy()),this.pool=[],this._depthFBO&&(this._depthFBO.destroy(),this._depthFBO=void 0,this._depthTexture=void 0)}_source(){return this.enabled?this.sourceCache:null}isUsingMockSource(){return this.sourceCache===this._mockSourceCache}exaggeration(){return this._exaggeration}get visibleDemTiles(){return this._visibleDemTiles}get drapeBufferSize(){const r=2*this.proxySourceCache.getSource().tileSize;return[r,r]}set useVertexMorphing(r){this._useVertexMorphing=r}updateTileBinding(r){if(!this.enabled)return;this.prevTerrainTileForTile=this.terrainTileForTile;const o=this.proxySourceCache,h=this.painter.transform;this._initializing&&(this._initializing=h._centerAltitude===0&&this.getAtPointOrZero(a.MercatorCoordinate.fromLngLat(h.center),-1)===-1,this._emptyDEMTextureDirty=!this._initializing);const d=this.proxyCoords=o.getIds().map(v=>{const E=o.getTileByID(v).tileID;return E.projMatrix=h.calculateProjMatrix(E.toUnwrapped()),E});(function(v,E){const T=E.transform.pointCoordinate(E.transform.getCameraPoint()),A=new a.Point(T.x,T.y);v.sort((k,R)=>{if(R.overscaledZ-k.overscaledZ)return R.overscaledZ-k.overscaledZ;const O=new a.Point(k.canonical.x+(1<{this.proxyToSource[v.key]={}}),this.terrainTileForTile={};const g=this._style._sourceCaches;for(const v in g){const E=g[v];if(!E.used||(E!==this.sourceCache&&this.resetTileLookupCache(E.id),this._setupProxiedCoordsForOrtho(E,r[v],f),E.usedForTerrain))continue;const T=r[v];E.getSource().reparseOverscaled&&this._assignTerrainTiles(T)}this.proxiedCoords[o.id]=d.map(v=>new ks(v,v.key,this.orthoMatrix)),this._assignTerrainTiles(d),this._prepareDEMTextures(),this._setupDrapedRenderBatches(),this._initFBOPool(),this._setupRenderCache(f),this.renderingToTexture=!1,this._updateTimestamp=a.exported.now();const y={};this._visibleDemTiles=[];for(const v of this.proxyCoords){const E=this.terrainTileForTile[v.key];if(!E)continue;const T=E.tileID.key;T in y||(this._visibleDemTiles.push(E),y[T]=T)}}_assignTerrainTiles(r){this._initializing||r.forEach(o=>{if(this.terrainTileForTile[o.key])return;const h=this._findTileCoveringTileID(o,this.sourceCache);h&&(this.terrainTileForTile[o.key]=h)})}_prepareDEMTextures(){const r=this.painter.context,o=r.gl;for(const h in this.terrainTileForTile){const d=this.terrainTileForTile[h],f=d.dem;!f||d.demTexture&&!d.needsDEMTextureUpload||(r.activeTexture.set(o.TEXTURE1),Va(this.painter,d,f))}}_prepareDemTileUniforms(r,o,h,d){if(!o||o.demTexture==null)return!1;const f=r.tileID.canonical,g=Math.pow(2,o.tileID.canonical.z-f.z),y=d||"";return h[`u_dem_tl${y}`]=[f.x*g%1,f.y*g%1],h[`u_dem_scale${y}`]=g,!0}get emptyDEMTexture(){return!this._emptyDEMTextureDirty&&this._emptyDEMTexture?this._emptyDEMTexture:this._updateEmptyDEMTexture()}get emptyDepthBufferTexture(){const r=this.painter.context,o=r.gl;if(!this._emptyDepthBufferTexture){const h=new a.RGBAImage({width:1,height:1},Uint8Array.of(255,255,255,255));this._emptyDepthBufferTexture=new a.Texture(r,h,o.RGBA,{premultiply:!1})}return this._emptyDepthBufferTexture}_getLoadedAreaMinimum(){let r=0;const o=this._visibleDemTiles.reduce((h,d)=>{if(!d.dem)return h;const f=d.dem.tree.minimums[0];return f>0&&r++,h+f},0);return r?o/r:0}_updateEmptyDEMTexture(){const r=this.painter.context,o=r.gl;r.activeTexture.set(o.TEXTURE2);const h=this._getLoadedAreaMinimum(),d=new a.RGBAImage({width:1,height:1},new Uint8Array(a.DEMData.pack(h,this.sourceCache.getSource().encoding)));this._emptyDEMTextureDirty=!1;let f=this._emptyDEMTexture;return f?f.update(d,{premultiply:!1}):f=this._emptyDEMTexture=new a.Texture(r,d,o.RGBA,{premultiply:!1}),f}setupElevationDraw(r,o,h){const d=this.painter.context,f=d.gl,g=(y=this.sourceCache.getSource().encoding,{u_dem:2,u_dem_prev:4,u_dem_unpack:a.DEMData.getUnpackVector(y),u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_exaggeration:0});var y;g.u_dem_size=this.sourceCache.getSource().tileSize,g.u_exaggeration=this.exaggeration();let v=null,E=null,T=1;if(h&&h.morphing&&this._useVertexMorphing){const A=h.morphing.srcDemTile,k=h.morphing.dstDemTile;T=h.morphing.phase,A&&k&&(this._prepareDemTileUniforms(r,A,g,"_prev")&&(E=A),this._prepareDemTileUniforms(r,k,g)&&(v=k))}if(E&&v?(d.activeTexture.set(f.TEXTURE2),v.demTexture.bind(f.NEAREST,f.CLAMP_TO_EDGE,f.NEAREST),d.activeTexture.set(f.TEXTURE4),E.demTexture.bind(f.NEAREST,f.CLAMP_TO_EDGE,f.NEAREST),g.u_dem_lerp=T):(v=this.terrainTileForTile[r.tileID.key],d.activeTexture.set(f.TEXTURE2),(this._prepareDemTileUniforms(r,v,g)?v.demTexture:this.emptyDEMTexture).bind(f.NEAREST,f.CLAMP_TO_EDGE)),d.activeTexture.set(f.TEXTURE3),h&&h.useDepthForOcclusion?(this._depthTexture&&this._depthTexture.bind(f.NEAREST,f.CLAMP_TO_EDGE),this._depthFBO&&(g.u_depth_size_inv=[1/this._depthFBO.width,1/this._depthFBO.height])):(this.emptyDepthBufferTexture.bind(f.NEAREST,f.CLAMP_TO_EDGE),g.u_depth_size_inv=[1,1]),h&&h.useMeterToDem&&v){const A=(1<{if(I===we)return;const _e=[bn[we],"PROJECTION_GLOBE_VIEW"];j&&_e.push("CUSTOM_ANTIALIASING"),ae&&_e.push(bn[L]),F=E.useProgram("globeRaster",null,_e),I=we},J=E.colorModeForRenderPass(),Y=new a.DepthMode(B.LEQUAL,a.DepthMode.ReadWrite,E.depthRangeFor3D);Pr.update(R);const ie=a.calculateGlobeMercatorMatrix(N),te=[a.mercatorXfromLng(N.center.lng),a.mercatorYfromLat(N.center.lat)],le=L?[!1,!0]:[!1],Te=E.globeSharedBuffers,oe=[N.width*a.exported.devicePixelRatio,N.height*a.exported.devicePixelRatio],ge=Float32Array.from(N.globeMatrix),he={useDenormalizedUpVectorScale:!0};if(le.forEach(we=>{const ae=E.transform,_e=zs(ae.zoom)*T.exaggeration();I=-1;const Me=we?B.LINES:B.TRIANGLES;for(const ve of k){const Ae=A.getTile(ve),Ge=a.StencilMode.disabled,Xe=T.prevTerrainTileForTile[ve.key],Ve=T.terrainTileForTile[ve.key];Jn(Xe,Ve)&&Pr.newMorphing(ve.key,Xe,Ve,R,250),O.activeTexture.set(B.TEXTURE0),Ae.texture.bind(B.LINEAR,B.CLAMP_TO_EDGE);const qe=Pr.getMorphValuesForProxy(ve.key),lt=qe?1:0;qe&&a.extend$1(he,{morphing:{srcDemTile:qe.from,dstDemTile:qe.to,phase:a.easeCubicInOut(qe.phase)}});const ot=a.tileCornersToBounds(ve.canonical),je=a.getLatitudinalLod(ot.getCenter().lat),wt=a.getGridMatrix(ve.canonical,ot,je,ae.worldSize/ae._pixelsPerMercatorPixel),Tt=a.globeNormalizeECEF(a.globeTileBounds(ve.canonical)),Et=Cs(ae.projMatrix,ge,ie,Tt,a.globeToMercatorTransition(ae.zoom),te,ae.frustumCorners.TL,ae.frustumCorners.TR,ae.frustumCorners.BR,ae.frustumCorners.BL,ae.globeCenterInViewSpace,ae.globeRadius,oe,_e,wt);if(K(lt,we),T.setupElevationDraw(Ae,F,he),E.prepareDrawProgram(O,F,ve.toUnwrapped()),Te){const[St,vi,ui]=we?Te.getWirefameBuffers(E.context,je):Te.getGridBuffers(je,_e!==0);F.draw(O,Me,Y,Ge,J,a.CullFaceMode.backCCW,Et,"globe_raster",St,vi,ui)}}}),Te){const we=["GLOBE_POLES","PROJECTION_GLOBE_VIEW"];j&&we.push("CUSTOM_ANTIALIASING"),F=E.useProgram("globeRaster",null,we);for(const ae of k){const{x:_e,y:Me,z:ve}=ae.canonical,Ae=Me===0,Ge=Me===(1<Et.draw(O,B.TRIANGLES,Y,a.StencilMode.disabled,J,a.CullFaceMode.disabled,Cs(N.projMatrix,je,je,wt,0,te,N.frustumCorners.TL,N.frustumCorners.TR,N.frustumCorners.BR,N.frustumCorners.BL,N.globeCenterInViewSpace,N.globeRadius,oe,0),"globe_pole_raster",St,qe,lt);T.setupElevationDraw(ot,F,he),E.prepareDrawProgram(O,F,ae.toUnwrapped()),Ae&&Tt(F,Xe),Ge&&(je=a.scale(a.create(),je,[1,-1,1]),Tt(F,Ve))}}}})(d,f,g,y,v);else{const E=d.context,T=E.gl;let A,k;const R=d.options.showTerrainWireframe?2:0,O=(N,j)=>{if(k===N)return;const K=[bn[N]];j&&K.push(bn[R]),A=d.useProgram("terrainRaster",null,K),k=N},B=d.colorModeForRenderPass(),F=new a.DepthMode(T.LEQUAL,a.DepthMode.ReadWrite,d.depthRangeFor3D);Pr.update(v);const I=d.transform,L=zs(I.zoom)*f.exaggeration();(R?[!1,!0]:[!1]).forEach(N=>{k=-1;const j=N?T.LINES:T.TRIANGLES,[K,J]=N?f.getWirefameBuffer():[f.gridIndexBuffer,f.gridSegments];for(const Y of y){const ie=g.getTile(Y),te=a.StencilMode.disabled,le=f.prevTerrainTileForTile[Y.key],Te=f.terrainTileForTile[Y.key];Jn(le,Te)&&Pr.newMorphing(Y.key,le,Te,v,250),E.activeTexture.set(T.TEXTURE0),ie.texture.bind(T.LINEAR,T.CLAMP_TO_EDGE,T.LINEAR_MIPMAP_NEAREST);const oe=Pr.getMorphValuesForProxy(Y.key),ge=oe?1:0;let he;oe&&(he={morphing:{srcDemTile:oe.from,dstDemTile:oe.to,phase:a.easeCubicInOut(oe.phase)}});const we=Yn(Y.projMatrix,hc(Y.canonical,I.renderWorldCopies)?L/10:L);O(ge,N),f.setupElevationDraw(ie,A,he),d.prepareDrawProgram(E,A,Y.toUnwrapped()),A.draw(E,j,F,te,B,a.CullFaceMode.backCCW,we,"terrain_raster",f.gridBuffer,K,J)}})}}(o,this,this.proxySourceCache,r,this._updateTimestamp),this.renderingToTexture=!0,o.gpuTimingDeferredRenderEnd(),r.splice(0,r.length))}renderBatch(r){if(this._drapedRenderBatches.length===0)return r+1;this.renderingToTexture=!0;const o=this.painter,h=this.painter.context,d=this.proxySourceCache,f=this.proxiedCoords[d.id],g=this._drapedRenderBatches.shift(),y=[],v=o.style.order;let E=0;for(const T of f){const A=d.getTileByID(T.proxyTileKey),k=d.proxyCachedFBO[T.key]?d.proxyCachedFBO[T.key][r]:void 0,R=k!==void 0?d.renderCache[k]:this.pool[E++],O=k!==void 0;if(A.texture=R.tex,O&&!R.dirty){y.push(A.tileID);continue}let B;h.bindFramebuffer.set(R.fb.framebuffer),this.renderedToTile=!1,R.dirty&&(h.clear({color:a.Color.transparent,stencil:0}),R.dirty=!1);for(let F=g.start;F<=g.end;++F){const I=o.style._layers[v[F]];if(I.isHidden(o.transform.zoom))continue;const L=o.style._getLayerSourceCache(I),N=L?this.proxyToSource[T.key][L.id]:[T];if(!N)continue;const j=N;h.viewport.set([0,0,R.fb.width,R.fb.height]),B!==(L?L.id:null)&&(this._setupStencil(R,N,I,L),B=L?L.id:null),o.renderLayer(o,L,I,j)}this.renderedToTile?(R.dirty=!0,y.push(A.tileID)):O||--E,E===5&&(E=0,this.renderToBackBuffer(y))}return this.renderToBackBuffer(y),this.renderingToTexture=!1,h.bindFramebuffer.set(null),h.viewport.set([0,0,o.width,o.height]),g.end+1}postRender(){}renderCacheEfficiency(r){const o=r.order.length;if(o===0)return{efficiency:100};let h,d=0,f=0,g=!1;for(let y=0;yo.dem).forEach(o=>{r=Math.min(r,o.dem.tree.minimums[0])}),r===0?r:(r-30)*this._exaggeration}raycast(r,o,h){if(!this._visibleDemTiles)return null;const d=this._visibleDemTiles.filter(f=>f.dem).map(f=>{const g=f.tileID,y=1<(f.t!==null?f.t:Number.MAX_VALUE)-(g.t!==null?g.t:Number.MAX_VALUE));for(const f of d){if(f.t==null)return null;const g=f.tile.dem.tree.raycast(f.minx,f.miny,f.maxx,f.maxy,r,o,h);if(g!=null)return g}return null}_createFBO(){const r=this.painter.context,o=r.gl,h=this.drapeBufferSize;r.activeTexture.set(o.TEXTURE0);const d=new a.Texture(r,{width:h[0],height:h[1],data:null},o.RGBA);d.bind(o.LINEAR,o.CLAMP_TO_EDGE);const f=r.createFramebuffer(h[0],h[1],!1);return f.colorAttachment.set(d.texture),f.depthAttachment=new Q(r,f.framebuffer),this._sharedDepthStencil===void 0?(this._sharedDepthStencil=r.createRenderbuffer(r.gl.DEPTH_STENCIL,h[0],h[1]),this._stencilRef=0,f.depthAttachment.set(this._sharedDepthStencil),r.clear({stencil:0})):f.depthAttachment.set(this._sharedDepthStencil),r.extTextureFilterAnisotropic&&!r.extTextureFilterAnisotropicForceOff&&o.texParameterf(o.TEXTURE_2D,r.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,r.extTextureFilterAnisotropicMax),{fb:f,tex:d,dirty:!1}}_initFBOPool(){for(;this.pool.length{const o=this._style._layers[r],h=o.isHidden(this.painter.transform.zoom);return o.type==="custom"?!h&&o.shouldRedrape():!h&&o.hasTransition()})}_clearLineLayersFromRenderCache(){let r=!1;for(const h of this._style._getSources())if(h instanceof ke){r=!0;break}if(!r)return;const o={};for(let h=0;ho.renderCachePool.length){const g=Object.values(o.proxyCachedFBO);o.proxyCachedFBO={};for(let y=0;y=0;g--){const y=h[g];if(o.getTileByID(y.key),o.proxyCachedFBO[y.key]!==void 0){const v=r[y.key],E=this.proxyToSource[y.key];let T=0;for(const A in E){const k=E[A],R=v[A];if(!R||R.length!==k.length||k.some((O,B)=>O!==R[B]||d[A]&&d[A].hasOwnProperty(O.key))){T=-1;break}++T}for(const A in o.proxyCachedFBO[y.key])o.renderCache[o.proxyCachedFBO[y.key][A]].dirty=T<0||T!==Object.values(v).length}}const f=[...this._drapedRenderBatches];f.sort((g,y)=>y.end-y.start-(g.end-g.start));for(const g of f)for(const y of h){if(o.proxyCachedFBO[y.key])continue;let v=o.renderCachePool.pop();v===void 0&&o.renderCache.length<50&&(v=o.renderCache.length,o.renderCache.push(this._createFBO())),v!==void 0&&(o.proxyCachedFBO[y.key]={},o.proxyCachedFBO[y.key][g.start]=v,o.renderCache[v].dirty=!0)}this._tilesDirty={}}_setupStencil(r,o,h,d){if(!d||!this._sourceTilesOverlap[d.id])return void(this._overlapStencilType&&(this._overlapStencilType=!1));const f=this.painter.context,g=f.gl;if(o.length<=1)return void(this._overlapStencilType=!1);let y;if(h.isTileClipped())y=o.length,this._overlapStencilMode.test={func:g.EQUAL,mask:255},this._overlapStencilType="Clip";else{if(!(o[0].overscaledZ>o[o.length-1].overscaledZ))return void(this._overlapStencilType=!1);y=1,this._overlapStencilMode.test={func:g.GREATER,mask:255},this._overlapStencilType="Mask"}this._stencilRef+y>255&&(f.clear({stencil:0}),this._stencilRef=0),this._stencilRef+=y,this._overlapStencilMode.ref=this._stencilRef,h.isTileClipped()&&this._renderTileClippingMasks(o,this._overlapStencilMode.ref)}clipOrMaskOverlapStencilType(){return this._overlapStencilType==="Clip"||this._overlapStencilType==="Mask"}stencilModeForRTTOverlap(r){return this.renderingToTexture&&this._overlapStencilType?(this._overlapStencilType==="Clip"&&(this._overlapStencilMode.ref=this.painter._tileClippingMaskIDs[r.key]),this._overlapStencilMode):a.StencilMode.disabled}_renderTileClippingMasks(r,o){const h=this.painter,d=this.painter.context,f=d.gl;h._tileClippingMaskIDs={},d.setColorMode(a.ColorMode.disabled),d.setDepthMode(a.DepthMode.disabled);const g=h.useProgram("clippingMask");for(const y of r){const v=h._tileClippingMaskIDs[y.key]=--o;g.draw(d,f.TRIANGLES,a.DepthMode.disabled,new a.StencilMode({func:f.ALWAYS,mask:0},v,255,f.KEEP,f.KEEP,f.REPLACE),a.ColorMode.disabled,a.CullFaceMode.disabled,No(y.projMatrix),"$clipping",h.tileExtentBuffer,h.quadTriangleIndexBuffer,h.tileExtentSegments)}}pointCoordinate(r){const o=this.painter.transform;if(r.x<0||r.x>o.width||r.y<0||r.y>o.height)return null;const h=[r.x,r.y,1,1];a.transformMat4$1(h,h,o.pixelMatrixInverse),a.scale$1(h,h,1/h[3]),h[0]/=o.worldSize,h[1]/=o.worldSize;const d=o._camera.position,f=a.mercatorZfromAltitude(1,o.center.lat),g=[d[0],d[1],d[2]/f,0],y=a.subtract([],h.slice(0,3),g);a.normalize(y,y);const v=this.raycast(g,y,this._exaggeration);return v!==null&&v?(a.scaleAndAdd(g,g,y,v),g[3]=g[2],g[2]*=f,g):null}drawDepth(){const r=this.painter,o=r.context,h=this.proxySourceCache,d=Math.ceil(r.width),f=Math.ceil(r.height);if(!this._depthFBO||this._depthFBO.width===d&&this._depthFBO.height===f||(this._depthFBO.destroy(),this._depthFBO=void 0,this._depthTexture=void 0),!this._depthFBO){const g=o.gl,y=o.createFramebuffer(d,f,!0);o.activeTexture.set(g.TEXTURE0);const v=new a.Texture(o,{width:d,height:f,data:null},g.RGBA);v.bind(g.NEAREST,g.CLAMP_TO_EDGE),y.colorAttachment.set(v.texture);const E=o.createRenderbuffer(o.gl.DEPTH_COMPONENT16,d,f);y.depthAttachment.set(E),this._depthFBO=y,this._depthTexture=v}o.bindFramebuffer.set(this._depthFBO.framebuffer),o.viewport.set([0,0,d,f]),function(g,y,v,E){if(g.transform.projection.name==="globe")return;const T=g.context,A=T.gl;T.clear({depth:1});const k=g.useProgram("terrainDepth"),R=new a.DepthMode(A.LESS,a.DepthMode.ReadWrite,g.depthRangeFor3D);for(const O of E){const B=v.getTile(O),F=Yn(O.projMatrix,0);y.setupElevationDraw(B,k),k.draw(T,A.TRIANGLES,R,a.StencilMode.disabled,a.ColorMode.unblended,a.CullFaceMode.backCCW,F,"terrain_depth",y.gridBuffer,y.gridIndexBuffer,y.gridNoSkirtSegments)}}(r,this,h,this.proxyCoords)}_setupProxiedCoordsForOrtho(r,o,h){if(r.getSource()instanceof rt)return this._setupProxiedCoordsForImageSource(r,o,h);this._findCoveringTileCache[r.id]=this._findCoveringTileCache[r.id]||{};const d=this.proxiedCoords[r.id]=[],f=this.proxyCoords;for(let y=0;y(T.min.x=Math.min(T.min.x,A.x-y.x),T.min.y=Math.min(T.min.y,A.y-y.y),T.max.x=Math.max(T.max.x,A.x-y.x),T.max.y=Math.max(T.max.y,A.y-y.y),T),{min:new a.Point(Number.MAX_VALUE,Number.MAX_VALUE),max:new a.Point(-Number.MAX_VALUE,-Number.MAX_VALUE)}),E=(T,A)=>{const k=T.wrap+T.canonical.x/(1<B+v.max.x||R+OF+v.max.y};for(let T=0;Tg.key===o.tileID.key);if(f)return f}if(o.tileID.key!==r.key){const f=r.canonical.z-o.tileID.canonical.z;let g,y,v;d=a.create();const E=o.tileID.wrap-r.wrap<0?(g=a.EXTENT>>f,y=g*((o.tileID.canonical.x<=A){const k=r.canonical.z-A;o.getSource().reparseOverscaled?(y=Math.max(r.canonical.z+2,o.transform.tileZoom),g=new a.OverscaledTileID(y,r.wrap,A,r.canonical.x>>k,r.canonical.y>>k)):k!==0&&(y=A,g=new a.OverscaledTileID(y,r.wrap,A,r.canonical.x>>k,r.canonical.y>>k))}g.key!==r.key&&(E.push(g.key),h=o.getTile(g))}const T=A=>{E.forEach(k=>{d[k]=A}),E.length=0};for(y-=1;y>=v&&(!h||!h.hasData());y--){h&&T(h.tileID.key);const A=g.calculateScaledKey(y);if(h=o.getTileByID(A),h&&h.hasData())break;const k=d[A];if(k===null)break;k===void 0?E.push(A):h=o.getTileByID(k)}return T(h?h.tileID.key:null),h&&h.hasData()?h:null}findDEMTileFor(r){return this.enabled?this._findTileCoveringTileID(r,this.sourceCache):null}prepareDrawTile(){this.renderedToTile=!0}_clearRenderCacheForTile(r,o){let h=this._tilesDirty[r];h||(h=this._tilesDirty[r]={}),h[o.key]=!0}getWirefameBuffer(){if(!this.wireframeSegments){const r=function(o){let h=0;const d=new a.StructArrayLayout2ui4,f=131;for(let g=1;g<129;g++){for(let y=1;y<129;y++)h=g*f+y,d.emplaceBack(h,h+1),d.emplaceBack(h,h+f),d.emplaceBack(h+1,h+f),g===128&&d.emplaceBack(h+f,h+f+1);d.emplaceBack(h+1,h+1+f)}return d}();this.wireframeIndexBuffer=this.painter.context.createIndexBuffer(r),this.wireframeSegments=a.SegmentVector.simpleSegment(0,0,this.gridBuffer.length,r.length)}return[this.wireframeIndexBuffer,this.wireframeSegments]}}class mt{static cacheKey(r,o,h,d){let f=`${o}${d?d.cacheKey:""}`;for(const g of h)r.usedDefines.includes(g)&&(f+=`/${g}`);return f}constructor(r,o,h,d,f,g){const y=r.gl;this.program=y.createProgram();const v=function(I){const L=[];for(let N=0;N`#define ${I}`));const k=r.isWebGL2?`#version 300 es -`:"",R=k+A.concat(r.extStandardDerivatives&&k.length===0?`#extension GL_OES_standard_derivatives : enable -`.concat(Oa):Oa,Oa,Is,ac.fragmentSource,Hn.fragmentSource,h.fragmentSource).join(` -`),O=k+A.concat(` -#ifdef GL_ES -precision highp float; -#else - -#if !defined(lowp) -#define lowp -#endif - -#if !defined(mediump) -#define mediump -#endif - -#if !defined(highp) -#define highp -#endif - -#endif`,Is,ac.vertexSource,Hn.vertexSource,As.vertexSource,h.vertexSource).join(` -`),B=y.createShader(y.FRAGMENT_SHADER);if(y.isContextLost())return void(this.failedToCreate=!0);y.shaderSource(B,R),y.compileShader(B),y.attachShader(this.program,B);const F=y.createShader(y.VERTEX_SHADER);if(y.isContextLost())this.failedToCreate=!0;else{y.shaderSource(F,O),y.compileShader(F),y.attachShader(this.program,F),this.attributes={},this.numAttributes=T.length;for(let I=0;I({u_dem:new a.Uniform1i(I),u_dem_prev:new a.Uniform1i(I),u_dem_unpack:new a.Uniform4f(I),u_dem_tl:new a.Uniform2f(I),u_dem_scale:new a.Uniform1f(I),u_dem_tl_prev:new a.Uniform2f(I),u_dem_scale_prev:new a.Uniform1f(I),u_dem_size:new a.Uniform1f(I),u_dem_lerp:new a.Uniform1f(I),u_exaggeration:new a.Uniform1f(I),u_depth:new a.Uniform1i(I),u_depth_size_inv:new a.Uniform2f(I),u_meter_to_dem:new a.Uniform1f(I),u_label_plane_matrix_inv:new a.UniformMatrix4f(I)}))(r)),g.includes("GLOBE")&&(this.globeUniforms=(I=>({u_tile_tl_up:new a.Uniform3f(I),u_tile_tr_up:new a.Uniform3f(I),u_tile_br_up:new a.Uniform3f(I),u_tile_bl_up:new a.Uniform3f(I),u_tile_up_scale:new a.Uniform1f(I)}))(r)),g.includes("FOG")&&(this.fogUniforms=(I=>({u_fog_matrix:new a.UniformMatrix4f(I),u_fog_range:new a.Uniform2f(I),u_fog_color:new a.Uniform4f(I),u_fog_horizon_blend:new a.Uniform1f(I),u_fog_temporal_offset:new a.Uniform1f(I),u_frustum_tl:new a.Uniform3f(I),u_frustum_tr:new a.Uniform3f(I),u_frustum_br:new a.Uniform3f(I),u_frustum_bl:new a.Uniform3f(I),u_globe_pos:new a.Uniform3f(I),u_globe_radius:new a.Uniform1f(I),u_globe_transition:new a.Uniform1f(I),u_is_globe:new a.Uniform1i(I),u_viewport:new a.Uniform2f(I)}))(r))}}setTerrainUniformValues(r,o){if(!this.terrainUniforms)return;const h=this.terrainUniforms;if(!this.failedToCreate){r.program.set(this.program);for(const d in o)h[d]&&h[d].set(this.program,d,o[d])}}setGlobeUniformValues(r,o){if(!this.globeUniforms)return;const h=this.globeUniforms;if(!this.failedToCreate){r.program.set(this.program);for(const d in o)h[d]&&h[d].set(this.program,d,o[d])}}setFogUniformValues(r,o){if(!this.fogUniforms)return;const h=this.fogUniforms;if(!this.failedToCreate){r.program.set(this.program);for(const d in o)h[d].set(this.program,d,o[d])}}draw(r,o,h,d,f,g,y,v,E,T,A,k,R,O,B){const F=r.gl;if(this.failedToCreate)return;r.program.set(this.program),r.setDepthMode(h),r.setStencilMode(d),r.setColorMode(f),r.setCullFace(g);for(const L of Object.keys(this.fixedUniforms))this.fixedUniforms[L].set(this.program,L,y[L]);O&&O.setUniforms(this.program,r,this.binderUniforms,k,{zoom:R});const I={[F.LINES]:2,[F.TRIANGLES]:3,[F.LINE_STRIP]:1}[o];for(const L of A.get()){const N=L.vaos||(L.vaos={});(N[v]||(N[v]=new Ch)).bind(r,this,E,O?O.getPaintVertexBuffers():[],T,L.vertexOffset,B||[]),F.drawElements(o,L.primitiveLength*I,F.UNSIGNED_SHORT,L.primitiveOffset*I*2)}}}function jo(l,r){const o=Math.pow(2,r.tileID.overscaledZ),h=r.tileSize*Math.pow(2,l.transform.tileZoom)/o,d=h*(r.tileID.canonical.x+r.tileID.wrap*o),f=h*r.tileID.canonical.y;return{u_image:0,u_texsize:r.imageAtlasTexture.size,u_tile_units_to_pixels:1/ai(r,1,l.transform.tileZoom),u_pixel_coord_upper:[d>>16,f>>16],u_pixel_coord_lower:[65535&d,65535&f]}}const uc=a.create(),Za=(l,r,o,h,d,f,g,y,v,E,T)=>{const A=r.style.light,k=A.properties.get("position"),R=[k.x,k.y,k.z],O=a.create$1();A.properties.get("anchor")==="viewport"&&(a.fromRotation(O,-r.transform.angle),a.transformMat3(R,R,O));const B=A.properties.get("color"),F=r.transform,I={u_matrix:l,u_lightpos:R,u_lightintensity:A.properties.get("intensity"),u_lightcolor:[B.r,B.g,B.b],u_vertical_gradient:+o,u_opacity:h,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:uc,u_merc_center:[0,0],u_up_dir:[0,0,0],u_height_lift:0,u_ao:d,u_edge_radius:f};return F.projection.name==="globe"&&(I.u_tile_id=[g.canonical.x,g.canonical.y,1<{const k=Za(l,r,o,h,d,f,g,v,E,T,A),R={u_height_factor:-Math.pow(2,g.overscaledZ)/y.tileSize/8};return a.extend(k,jo(r,y),R)},wn=l=>({u_matrix:l}),qa=(l,r,o)=>a.extend(wn(l),jo(r,o)),zh=(l,r)=>({u_matrix:l,u_world:r}),Ph=(l,r,o,h)=>a.extend(qa(l,r,o),{u_world:h}),kh=a.create(),Wa=(l,r,o,h,d,f)=>{const g=l.transform,y=g.projection.name==="globe";let v;if(f.paint.get("circle-pitch-alignment")==="map")if(y){const T=a.globePixelsToTileUnits(g.zoom,r.canonical)*g._pixelsPerMercatorPixel;v=Float32Array.from([T,0,0,T])}else v=g.calculatePixelsToTileUnitsMatrix(o);else v=new Float32Array([g.pixelsToGLUnits[0],0,0,g.pixelsToGLUnits[1]]);const E={u_camera_to_center_distance:g.cameraToCenterDistance,u_matrix:l.translatePosMatrix(r.projMatrix,o,f.paint.get("circle-translate"),f.paint.get("circle-translate-anchor")),u_device_pixel_ratio:a.exported.devicePixelRatio,u_extrude_scale:v,u_inv_rot_matrix:kh,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(y){E.u_inv_rot_matrix=h,E.u_merc_center=d,E.u_tile_id=[r.canonical.x,r.canonical.y,1<{const r=[];return l.paint.get("circle-pitch-alignment")==="map"&&r.push("PITCH_WITH_MAP"),l.paint.get("circle-pitch-scale")==="map"&&r.push("SCALE_WITH_MAP"),r},Ha=(l,r,o,h)=>{const d=a.EXTENT/o.tileSize;return{u_matrix:l,u_camera_to_center_distance:r.getCameraToCenterDistance(h),u_extrude_scale:[r.pixelsToGLUnits[0]/d,r.pixelsToGLUnits[1]/d]}},Ds=(l,r,o=1)=>({u_matrix:l,u_color:r,u_overlay:0,u_overlay_scale:o}),pc=a.create(),fc=(l,r,o,h,d,f,g)=>{const y=l.transform,v=y.projection.name==="globe",E=v?a.globePixelsToTileUnits(y.zoom,r.canonical)*y._pixelsPerMercatorPixel:ai(o,1,f),T={u_matrix:r.projMatrix,u_extrude_scale:E,u_intensity:g,u_inv_rot_matrix:pc,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(v){T.u_inv_rot_matrix=h,T.u_merc_center=d,T.u_tile_id=[r.canonical.x,r.canonical.y,1<{const y=l.transform,v=y.calculatePixelsToTileUnitsMatrix(r);return{u_matrix:Ka(l,r,o,h),u_pixels_to_tile_units:v,u_device_pixel_ratio:f,u_units_to_pixels:[1/y.pixelsToGLUnits[0],1/y.pixelsToGLUnits[1]],u_dash_image:0,u_gradient_image:1,u_image_height:d,u_texsize:$o(o)?r.lineAtlasTexture.size:[0,0],u_tile_units_to_pixels:Qn(r,l.transform),u_alpha_discard_threshold:0,u_trim_offset:g}},Go=(l,r,o,h,d)=>{const f=l.transform;return{u_matrix:Ka(l,r,o,h),u_texsize:r.imageAtlasTexture.size,u_pixels_to_tile_units:f.calculatePixelsToTileUnitsMatrix(r),u_device_pixel_ratio:d,u_image:0,u_tile_units_to_pixels:Qn(r,f),u_units_to_pixels:[1/f.pixelsToGLUnits[0],1/f.pixelsToGLUnits[1]],u_alpha_discard_threshold:0}};function Qn(l,r){return 1/ai(l,1,r.tileZoom)}function Ka(l,r,o,h){return l.translatePosMatrix(h||r.tileID.projMatrix,r,o.paint.get("line-translate"),o.paint.get("line-translate-anchor"))}function $o(l){const r=l.paint.get("line-dasharray").value;return r.value||r.kind!=="constant"}const Ya=(l,r,o,h,d,f)=>{return{u_matrix:l,u_tl_parent:r,u_scale_parent:o,u_fade_t:h.mix,u_opacity:h.opacity*d.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:d.paint.get("raster-brightness-min"),u_brightness_high:d.paint.get("raster-brightness-max"),u_saturation_factor:(y=d.paint.get("raster-saturation"),y>0?1-1/(1.001-y):-y),u_contrast_factor:(g=d.paint.get("raster-contrast"),g>0?1/(1-g):1+g),u_spin_weights:hr(d.paint.get("raster-hue-rotate")),u_perspective_transform:f};var g,y};function hr(l){l*=Math.PI/180;const r=Math.sin(l),o=Math.cos(l);return[(2*o+1)/3,(-Math.sqrt(3)*r-o+1)/3,(Math.sqrt(3)*r-o+1)/3]}const Ls=a.create(),Ja=(l,r,o,h,d,f,g,y,v,E,T,A,k,R,O,B)=>{const F=d.transform,I={u_is_size_zoom_constant:+(l==="constant"||l==="source"),u_is_size_feature_constant:+(l==="constant"||l==="camera"),u_size_t:r?r.uSizeT:0,u_size:r?r.uSize:0,u_camera_to_center_distance:F.cameraToCenterDistance,u_rotate_symbol:+o,u_aspect_ratio:F.width/F.height,u_fade_change:d.options.fadeDuration?d.symbolFadeChange:1,u_matrix:f,u_label_plane_matrix:g,u_coord_matrix:y,u_is_text:+v,u_pitch_with_map:+h,u_texsize:E,u_texture:0,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:Ls,u_merc_center:[0,0],u_camera_forward:[0,0,0],u_ecef_origin:[0,0,0],u_tile_matrix:Ls,u_up_vector:[0,-1,0]};return B.name==="globe"&&(I.u_tile_id=[T.canonical.x,T.canonical.y,1<a.extend(Ja(l,r,o,h,d,f,g,y,v,E,A,k,R,O,B,F),{u_gamma_scale:h?d.transform.cameraToCenterDistance*Math.cos(d.terrain?0:d.transform._pitch):1,u_device_pixel_ratio:a.exported.devicePixelRatio,u_is_halo:+T}),mc=(l,r,o,h,d,f,g,y,v,E,T,A,k,R,O,B)=>a.extend(Rs(l,r,o,h,d,f,g,y,!0,v,!0,T,A,k,R,O,B),{u_texsize_icon:E,u_texture_icon:1}),Qa=(l,r,o)=>({u_matrix:l,u_opacity:r,u_color:o}),Lh=(l,r,o,h,d)=>a.extend(function(f,g,y){const v=g.imageManager.getPattern(f.toString()),{width:E,height:T}=g.imageManager.getPixelSize(),A=Math.pow(2,y.tileID.overscaledZ),k=y.tileSize*Math.pow(2,g.transform.tileZoom)/A,R=k*(y.tileID.canonical.x+y.tileID.wrap*A),O=k*y.tileID.canonical.y;return{u_image:0,u_pattern_tl:v.tl,u_pattern_br:v.br,u_texsize:[E,T],u_pattern_size:v.displaySize,u_tile_units_to_pixels:1/ai(y,1,g.transform.tileZoom),u_pixel_coord_upper:[R>>16,O>>16],u_pixel_coord_lower:[65535&R,65535&O]}}(h,o,d),{u_matrix:l,u_opacity:r}),el={fillExtrusion:l=>({u_matrix:new a.UniformMatrix4f(l),u_lightpos:new a.Uniform3f(l),u_lightintensity:new a.Uniform1f(l),u_lightcolor:new a.Uniform3f(l),u_vertical_gradient:new a.Uniform1f(l),u_opacity:new a.Uniform1f(l),u_edge_radius:new a.Uniform1f(l),u_ao:new a.Uniform2f(l),u_tile_id:new a.Uniform3f(l),u_zoom_transition:new a.Uniform1f(l),u_inv_rot_matrix:new a.UniformMatrix4f(l),u_merc_center:new a.Uniform2f(l),u_up_dir:new a.Uniform3f(l),u_height_lift:new a.Uniform1f(l)}),fillExtrusionPattern:l=>({u_matrix:new a.UniformMatrix4f(l),u_lightpos:new a.Uniform3f(l),u_lightintensity:new a.Uniform1f(l),u_lightcolor:new a.Uniform3f(l),u_vertical_gradient:new a.Uniform1f(l),u_height_factor:new a.Uniform1f(l),u_edge_radius:new a.Uniform1f(l),u_ao:new a.Uniform2f(l),u_tile_id:new a.Uniform3f(l),u_zoom_transition:new a.Uniform1f(l),u_inv_rot_matrix:new a.UniformMatrix4f(l),u_merc_center:new a.Uniform2f(l),u_up_dir:new a.Uniform3f(l),u_height_lift:new a.Uniform1f(l),u_image:new a.Uniform1i(l),u_texsize:new a.Uniform2f(l),u_pixel_coord_upper:new a.Uniform2f(l),u_pixel_coord_lower:new a.Uniform2f(l),u_tile_units_to_pixels:new a.Uniform1f(l),u_opacity:new a.Uniform1f(l)}),fill:l=>({u_matrix:new a.UniformMatrix4f(l)}),fillPattern:l=>({u_matrix:new a.UniformMatrix4f(l),u_image:new a.Uniform1i(l),u_texsize:new a.Uniform2f(l),u_pixel_coord_upper:new a.Uniform2f(l),u_pixel_coord_lower:new a.Uniform2f(l),u_tile_units_to_pixels:new a.Uniform1f(l)}),fillOutline:l=>({u_matrix:new a.UniformMatrix4f(l),u_world:new a.Uniform2f(l)}),fillOutlinePattern:l=>({u_matrix:new a.UniformMatrix4f(l),u_world:new a.Uniform2f(l),u_image:new a.Uniform1i(l),u_texsize:new a.Uniform2f(l),u_pixel_coord_upper:new a.Uniform2f(l),u_pixel_coord_lower:new a.Uniform2f(l),u_tile_units_to_pixels:new a.Uniform1f(l)}),circle:l=>({u_camera_to_center_distance:new a.Uniform1f(l),u_extrude_scale:new a.UniformMatrix2f(l),u_device_pixel_ratio:new a.Uniform1f(l),u_matrix:new a.UniformMatrix4f(l),u_inv_rot_matrix:new a.UniformMatrix4f(l),u_merc_center:new a.Uniform2f(l),u_tile_id:new a.Uniform3f(l),u_zoom_transition:new a.Uniform1f(l),u_up_dir:new a.Uniform3f(l)}),collisionBox:l=>({u_matrix:new a.UniformMatrix4f(l),u_camera_to_center_distance:new a.Uniform1f(l),u_extrude_scale:new a.Uniform2f(l)}),collisionCircle:l=>({u_matrix:new a.UniformMatrix4f(l),u_inv_matrix:new a.UniformMatrix4f(l),u_camera_to_center_distance:new a.Uniform1f(l),u_viewport_size:new a.Uniform2f(l)}),debug:l=>({u_color:new a.UniformColor(l),u_matrix:new a.UniformMatrix4f(l),u_overlay:new a.Uniform1i(l),u_overlay_scale:new a.Uniform1f(l)}),clippingMask:l=>({u_matrix:new a.UniformMatrix4f(l)}),heatmap:l=>({u_extrude_scale:new a.Uniform1f(l),u_intensity:new a.Uniform1f(l),u_matrix:new a.UniformMatrix4f(l),u_inv_rot_matrix:new a.UniformMatrix4f(l),u_merc_center:new a.Uniform2f(l),u_tile_id:new a.Uniform3f(l),u_zoom_transition:new a.Uniform1f(l),u_up_dir:new a.Uniform3f(l)}),heatmapTexture:l=>({u_image:new a.Uniform1i(l),u_color_ramp:new a.Uniform1i(l),u_opacity:new a.Uniform1f(l)}),hillshade:l=>({u_matrix:new a.UniformMatrix4f(l),u_image:new a.Uniform1i(l),u_latrange:new a.Uniform2f(l),u_light:new a.Uniform2f(l),u_shadow:new a.UniformColor(l),u_highlight:new a.UniformColor(l),u_accent:new a.UniformColor(l)}),hillshadePrepare:l=>({u_matrix:new a.UniformMatrix4f(l),u_image:new a.Uniform1i(l),u_dimension:new a.Uniform2f(l),u_zoom:new a.Uniform1f(l),u_unpack:new a.Uniform4f(l)}),line:l=>({u_matrix:new a.UniformMatrix4f(l),u_pixels_to_tile_units:new a.UniformMatrix2f(l),u_device_pixel_ratio:new a.Uniform1f(l),u_units_to_pixels:new a.Uniform2f(l),u_dash_image:new a.Uniform1i(l),u_gradient_image:new a.Uniform1i(l),u_image_height:new a.Uniform1f(l),u_texsize:new a.Uniform2f(l),u_tile_units_to_pixels:new a.Uniform1f(l),u_alpha_discard_threshold:new a.Uniform1f(l),u_trim_offset:new a.Uniform2f(l)}),linePattern:l=>({u_matrix:new a.UniformMatrix4f(l),u_texsize:new a.Uniform2f(l),u_pixels_to_tile_units:new a.UniformMatrix2f(l),u_device_pixel_ratio:new a.Uniform1f(l),u_image:new a.Uniform1i(l),u_units_to_pixels:new a.Uniform2f(l),u_tile_units_to_pixels:new a.Uniform1f(l),u_alpha_discard_threshold:new a.Uniform1f(l)}),raster:l=>({u_matrix:new a.UniformMatrix4f(l),u_tl_parent:new a.Uniform2f(l),u_scale_parent:new a.Uniform1f(l),u_fade_t:new a.Uniform1f(l),u_opacity:new a.Uniform1f(l),u_image0:new a.Uniform1i(l),u_image1:new a.Uniform1i(l),u_brightness_low:new a.Uniform1f(l),u_brightness_high:new a.Uniform1f(l),u_saturation_factor:new a.Uniform1f(l),u_contrast_factor:new a.Uniform1f(l),u_spin_weights:new a.Uniform3f(l),u_perspective_transform:new a.Uniform2f(l)}),symbolIcon:l=>({u_is_size_zoom_constant:new a.Uniform1i(l),u_is_size_feature_constant:new a.Uniform1i(l),u_size_t:new a.Uniform1f(l),u_size:new a.Uniform1f(l),u_camera_to_center_distance:new a.Uniform1f(l),u_rotate_symbol:new a.Uniform1i(l),u_aspect_ratio:new a.Uniform1f(l),u_fade_change:new a.Uniform1f(l),u_matrix:new a.UniformMatrix4f(l),u_label_plane_matrix:new a.UniformMatrix4f(l),u_coord_matrix:new a.UniformMatrix4f(l),u_is_text:new a.Uniform1i(l),u_pitch_with_map:new a.Uniform1i(l),u_texsize:new a.Uniform2f(l),u_tile_id:new a.Uniform3f(l),u_zoom_transition:new a.Uniform1f(l),u_inv_rot_matrix:new a.UniformMatrix4f(l),u_merc_center:new a.Uniform2f(l),u_camera_forward:new a.Uniform3f(l),u_tile_matrix:new a.UniformMatrix4f(l),u_up_vector:new a.Uniform3f(l),u_ecef_origin:new a.Uniform3f(l),u_texture:new a.Uniform1i(l)}),symbolSDF:l=>({u_is_size_zoom_constant:new a.Uniform1i(l),u_is_size_feature_constant:new a.Uniform1i(l),u_size_t:new a.Uniform1f(l),u_size:new a.Uniform1f(l),u_camera_to_center_distance:new a.Uniform1f(l),u_rotate_symbol:new a.Uniform1i(l),u_aspect_ratio:new a.Uniform1f(l),u_fade_change:new a.Uniform1f(l),u_matrix:new a.UniformMatrix4f(l),u_label_plane_matrix:new a.UniformMatrix4f(l),u_coord_matrix:new a.UniformMatrix4f(l),u_is_text:new a.Uniform1i(l),u_pitch_with_map:new a.Uniform1i(l),u_texsize:new a.Uniform2f(l),u_texture:new a.Uniform1i(l),u_gamma_scale:new a.Uniform1f(l),u_device_pixel_ratio:new a.Uniform1f(l),u_tile_id:new a.Uniform3f(l),u_zoom_transition:new a.Uniform1f(l),u_inv_rot_matrix:new a.UniformMatrix4f(l),u_merc_center:new a.Uniform2f(l),u_camera_forward:new a.Uniform3f(l),u_tile_matrix:new a.UniformMatrix4f(l),u_up_vector:new a.Uniform3f(l),u_ecef_origin:new a.Uniform3f(l),u_is_halo:new a.Uniform1i(l)}),symbolTextAndIcon:l=>({u_is_size_zoom_constant:new a.Uniform1i(l),u_is_size_feature_constant:new a.Uniform1i(l),u_size_t:new a.Uniform1f(l),u_size:new a.Uniform1f(l),u_camera_to_center_distance:new a.Uniform1f(l),u_rotate_symbol:new a.Uniform1i(l),u_aspect_ratio:new a.Uniform1f(l),u_fade_change:new a.Uniform1f(l),u_matrix:new a.UniformMatrix4f(l),u_label_plane_matrix:new a.UniformMatrix4f(l),u_coord_matrix:new a.UniformMatrix4f(l),u_is_text:new a.Uniform1i(l),u_pitch_with_map:new a.Uniform1i(l),u_texsize:new a.Uniform2f(l),u_texsize_icon:new a.Uniform2f(l),u_texture:new a.Uniform1i(l),u_texture_icon:new a.Uniform1i(l),u_gamma_scale:new a.Uniform1f(l),u_device_pixel_ratio:new a.Uniform1f(l),u_is_halo:new a.Uniform1i(l)}),background:l=>({u_matrix:new a.UniformMatrix4f(l),u_opacity:new a.Uniform1f(l),u_color:new a.UniformColor(l)}),backgroundPattern:l=>({u_matrix:new a.UniformMatrix4f(l),u_opacity:new a.Uniform1f(l),u_image:new a.Uniform1i(l),u_pattern_tl:new a.Uniform2f(l),u_pattern_br:new a.Uniform2f(l),u_texsize:new a.Uniform2f(l),u_pattern_size:new a.Uniform2f(l),u_pixel_coord_upper:new a.Uniform2f(l),u_pixel_coord_lower:new a.Uniform2f(l),u_tile_units_to_pixels:new a.Uniform1f(l)}),terrainRaster:Na,terrainDepth:Na,skybox:l=>({u_matrix:new a.UniformMatrix4f(l),u_sun_direction:new a.Uniform3f(l),u_cubemap:new a.Uniform1i(l),u_opacity:new a.Uniform1f(l),u_temporal_offset:new a.Uniform1f(l)}),skyboxGradient:l=>({u_matrix:new a.UniformMatrix4f(l),u_color_ramp:new a.Uniform1i(l),u_center_direction:new a.Uniform3f(l),u_radius:new a.Uniform1f(l),u_opacity:new a.Uniform1f(l),u_temporal_offset:new a.Uniform1f(l)}),skyboxCapture:l=>({u_matrix_3f:new a.UniformMatrix3f(l),u_sun_direction:new a.Uniform3f(l),u_sun_intensity:new a.Uniform1f(l),u_color_tint_r:new a.Uniform4f(l),u_color_tint_m:new a.Uniform4f(l),u_luminance:new a.Uniform1f(l)}),globeRaster:l=>({u_proj_matrix:new a.UniformMatrix4f(l),u_globe_matrix:new a.UniformMatrix4f(l),u_normalize_matrix:new a.UniformMatrix4f(l),u_merc_matrix:new a.UniformMatrix4f(l),u_zoom_transition:new a.Uniform1f(l),u_merc_center:new a.Uniform2f(l),u_image0:new a.Uniform1i(l),u_grid_matrix:new a.UniformMatrix3f(l),u_skirt_height:new a.Uniform1f(l),u_frustum_tl:new a.Uniform3f(l),u_frustum_tr:new a.Uniform3f(l),u_frustum_br:new a.Uniform3f(l),u_frustum_bl:new a.Uniform3f(l),u_globe_pos:new a.Uniform3f(l),u_globe_radius:new a.Uniform1f(l),u_viewport:new a.Uniform2f(l)}),globeAtmosphere:l=>({u_frustum_tl:new a.Uniform3f(l),u_frustum_tr:new a.Uniform3f(l),u_frustum_br:new a.Uniform3f(l),u_frustum_bl:new a.Uniform3f(l),u_horizon:new a.Uniform1f(l),u_transition:new a.Uniform1f(l),u_fadeout_range:new a.Uniform1f(l),u_color:new a.Uniform4f(l),u_high_color:new a.Uniform4f(l),u_space_color:new a.Uniform4f(l),u_star_intensity:new a.Uniform1f(l),u_star_density:new a.Uniform1f(l),u_star_size:new a.Uniform1f(l),u_temporal_offset:new a.Uniform1f(l),u_horizon_angle:new a.Uniform1f(l),u_rotation_matrix:new a.UniformMatrix4f(l)})};let Bs;function Zo(l,r,o,h,d,f,g){const y=l.context,v=y.gl,E=l.transform,T=l.useProgram("collisionBox"),A=[];let k=0,R=0;for(let j=0;j0){const oe=a.create(),ge=te;a.mul(oe,Y.placementInvProjMatrix,E.glCoordMatrix),a.mul(oe,oe,Y.placementViewportMatrix),A.push({circleArray:Te,circleOffset:R,transform:ge,invTransform:oe,projection:Y.getProjection()}),k+=Te.length/4,R=k}le&&(l.terrain&&l.terrain.setupElevationDraw(J,T),T.draw(y,v.LINES,a.DepthMode.disabled,a.StencilMode.disabled,l.colorModeForRenderPass(),a.CullFaceMode.disabled,Ha(te,E,J,Y.getProjection()),o.id,le.layoutVertexBuffer,le.indexBuffer,le.segments,null,E.zoom,null,[le.collisionVertexBuffer,le.collisionVertexBufferExt]))}if(!g||!A.length)return;const O=l.useProgram("collisionCircle"),B=new a.StructArrayLayout2f1f2i16;B.resize(4*k),B._trim();let F=0;for(const j of A)for(let K=0;K=0&&(O[j.associatedIconIndex]={x:oe,y:ge,z:he,angle:ve})}else er(Y,k)}if(T){R.clear();const N=l.icon.placedSymbolArray;for(let j=0;joe.sortKey-ge.sortKey);for(const oe of te){const ge=oe.state;if(l.terrain&&l.terrain.setupElevationDraw(ge.tile,ge.program,{useDepthForOcclusion:!ie,labelPlaneMatrixInv:ge.labelPlaneMatrixInv}),k.activeTexture.set(R.TEXTURE0),ge.atlasTexture.bind(ge.atlasInterpolation,R.CLAMP_TO_EDGE),ge.atlasTextureIcon&&(k.activeTexture.set(R.TEXTURE1),ge.atlasTextureIcon&&ge.atlasTextureIcon.bind(ge.atlasInterpolationIcon,R.CLAMP_TO_EDGE)),ge.isSDF){const he=ge.uniformValues;ge.hasHalo&&(he.u_is_halo=1,qo(ge.buffers,oe.segments,o,l,ge.program,K,T,A,he)),he.u_is_halo=0}qo(ge.buffers,oe.segments,o,l,ge.program,K,T,A,ge.uniformValues)}}function qo(l,r,o,h,d,f,g,y,v){const E=h.context,T=[l.dynamicLayoutVertexBuffer,l.opacityVertexBuffer,l.globeExtVertexBuffer];d.draw(E,E.gl.TRIANGLES,f,g,y,a.CullFaceMode.disabled,v,o.id,l.layoutVertexBuffer,l.indexBuffer,r,o.paint,h.transform.zoom,l.programConfigurations.get(o.id),T)}function yc(l,r,o,h,d,f,g){const y=l.context.gl,v=o.paint.get("fill-pattern"),E=v&&v.constantOr(1);let T,A,k,R,O;g?(A=E&&!o.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",T=y.LINES):(A=E?"fillPattern":"fill",T=y.TRIANGLES);for(const B of h){const F=r.getTile(B);if(E&&!F.patternsLoaded())continue;const I=F.getBucket(o);if(!I)continue;l.prepareDrawTile();const L=I.programConfigurations.get(o.id),N=l.useProgram(A,L);E&&(l.context.activeTexture.set(y.TEXTURE0),F.imageAtlasTexture.bind(y.LINEAR,y.CLAMP_TO_EDGE),L.updatePaintBuffers());const j=v.constantOr(null);if(j&&F.imageAtlas){const J=F.imageAtlas.patternPositions[j.toString()];J&&L.setConstantPatternPositions(J)}const K=l.translatePosMatrix(B.projMatrix,F,o.paint.get("fill-translate"),o.paint.get("fill-translate-anchor"));if(g){R=I.indexBuffer2,O=I.segments2;const J=l.terrain&&l.terrain.renderingToTexture?l.terrain.drapeBufferSize:[y.drawingBufferWidth,y.drawingBufferHeight];k=A==="fillOutlinePattern"&&E?Ph(K,l,F,J):zh(K,J)}else R=I.indexBuffer,O=I.segments,k=E?qa(K,l,F):wn(K);l.prepareDrawProgram(l.context,N,B.toUnwrapped()),N.draw(l.context,T,d,l.stencilModeForClipping(B),f,a.CullFaceMode.disabled,k,o.id,I.layoutVertexBuffer,R,O,o.paint,l.transform.zoom,L)}}function Os(l,r,o,h,d,f,g){const y=l.context,v=y.gl,E=l.transform,T=o.paint.get("fill-extrusion-pattern"),A=T.constantOr(1),k=o.paint.get("fill-extrusion-opacity"),R=[o.paint.get("fill-extrusion-ambient-occlusion-intensity"),o.paint.get("fill-extrusion-ambient-occlusion-radius")],O=o.layout.get("fill-extrusion-edge-radius"),B=O>0&&!o.paint.get("fill-extrusion-rounded-roof"),F=B?0:O,I=E.projection.name==="globe"?a.fillExtrusionHeightLift():0,L=E.projection.name==="globe",N=L?a.globeToMercatorTransition(E.zoom):0,j=[a.mercatorXfromLng(E.center.lng),a.mercatorYfromLat(E.center.lat)],K=[];L&&K.push("PROJECTION_GLOBE_VIEW"),R[0]>0&&K.push("FAUX_AO"),B&&K.push("ZERO_ROOF_RADIUS");for(const J of h){const Y=r.getTile(J),ie=Y.getBucket(o);if(!ie||ie.projection.name!==E.projection.name)continue;const te=ie.programConfigurations.get(o.id),le=l.useProgram(A?"fillExtrusionPattern":"fillExtrusion",te,K);if(l.terrain){const _e=l.terrain;if(l.style.terrainSetForDrapingOnly())_e.setupElevationDraw(Y,le,{useMeterToDem:!0});else{if(!ie.enableTerrain)continue;if(_e.setupElevationDraw(Y,le,{useMeterToDem:!0}),xc(y,r,J,ie,o,_e),!ie.centroidVertexBuffer){const Me=le.attributes.a_centroid_pos;Me!==void 0&&v.vertexAttrib2f(Me,0,0)}}}A&&(l.context.activeTexture.set(v.TEXTURE0),Y.imageAtlasTexture.bind(v.LINEAR,v.CLAMP_TO_EDGE),te.updatePaintBuffers());const Te=T.constantOr(null);if(Te&&Y.imageAtlas){const _e=Y.imageAtlas.patternPositions[Te.toString()];_e&&te.setConstantPatternPositions(_e)}const oe=l.translatePosMatrix(J.projMatrix,Y,o.paint.get("fill-extrusion-translate"),o.paint.get("fill-extrusion-translate-anchor")),ge=E.projection.createInversionMatrix(E,J.canonical),he=o.paint.get("fill-extrusion-vertical-gradient"),we=A?dc(oe,l,he,k,R,F,J,Y,I,N,j,ge):Za(oe,l,he,k,R,F,J,I,N,j,ge);l.prepareDrawProgram(y,le,J.toUnwrapped());const ae=[];l.terrain&&ae.push(ie.centroidVertexBuffer),L&&ae.push(ie.layoutVertexExtBuffer),le.draw(y,y.gl.TRIANGLES,d,f,g,a.CullFaceMode.backCCW,we,o.id,ie.layoutVertexBuffer,ie.indexBuffer,ie.segments,o.paint,l.transform.zoom,te,ae)}}function xc(l,r,o,h,d,f){const g=[I=>{let L=I.canonical.x-1,N=I.wrap;return L<0&&(L=(1<{let L=I.canonical.x+1,N=I.wrap;return L===1<new a.OverscaledTileID(I.overscaledZ,I.wrap,I.canonical.z,I.canonical.x,(I.canonical.y===0?1<new a.OverscaledTileID(I.overscaledZ,I.wrap,I.canonical.z,I.canonical.x,I.canonical.y===(1<{const L=r.getSource().minzoom,N=K=>{const J=r.getTileByID(K);if(J&&J.hasData())return J.getBucket(d)},j=[0,-1,1];for(const K of j){if(I.overscaledZ+K(v[0]=Math.min(I.min.y,L.min.y),v[1]=Math.max(I.max.y,L.max.y),v[2]=a.EXTENT-L.min.x>I.max.x?L.min.x-a.EXTENT:I.max.x,v),T=(I,L)=>(v[0]=Math.min(I.min.x,L.min.x),v[1]=Math.max(I.max.x,L.max.x),v[2]=a.EXTENT-L.min.y>I.max.y?L.min.y-a.EXTENT:I.max.y,v),A=[(I,L)=>E(I,L),(I,L)=>E(L,I),(I,L)=>T(I,L),(I,L)=>T(L,I)],k=new a.Point(0,0);let R,O,B;const F=(I,L,N,j,K)=>{const J=[[j?N:I,j?I:N,0],[j?N:L,j?L:N,0]],Y=K<0?a.EXTENT+K:K,ie=[j?Y:(I+L)/2,j?(I+L)/2:Y,0];return N===0&&K<0||N!==0&&K>0?f.getForTilePoints(B,[ie],!0,O):J.push(ie),f.getForTilePoints(o,J,!0,R),Math.max(J[0][2],J[1][2],ie[2])/f.exaggeration()};for(let I=0;I<4;I++){const L=(I<2?1:5)-I,N=h.borders[I];if(N.length===0)continue;const j=B=g[I](o),K=y(j);if(!(K&&K instanceof a.FillExtrusionBucket&&K.enableTerrain)||h.borderDoneWithNeighborZ[I]===K.canonical.z&&K.borderDoneWithNeighborZ[L]===h.canonical.z||(O=f.findDEMTileFor(j),!O||!O.dem))continue;if(!R){const te=f.findDEMTileFor(o);if(!te||!te.dem)return;R=te}const J=K.borders[L];let Y=0;const ie=K.borderDoneWithNeighborZ[L]!==h.canonical.z;if(h.canonical.z===K.canonical.z){for(let te=0;teTe[0]+3));)ie&&K.encodeCentroid(void 0,oe,!1),Y++;if(oe&&YTe[1]-3)&&(he++,++Y!==J.length);)oe=K.featuresOnBorder[J[Y]];if(oe=K.featuresOnBorder[J[ge]],le.intersectsCount()>1||oe.intersectsCount()>1||he!==1){he!==1&&(Y=ge),h.encodeCentroid(void 0,le,!1),ie&&K.encodeCentroid(void 0,oe,!1);continue}const we=A[I](le,oe),ae=I%2?a.EXTENT-1:0;k.x=F(we[0],Math.min(a.EXTENT-1,we[1]),ae,I<2,we[2]),k.y=0,h.encodeCentroid(k,le,!1),ie&&K.encodeCentroid(k,oe,!1)}else h.encodeCentroid(void 0,le,!1)}h.borderDoneWithNeighborZ[I]=K.canonical.z,h.needsCentroidUpdate=!0,ie&&(K.borderDoneWithNeighborZ[L]=h.canonical.z,K.needsCentroidUpdate=!0)}else{for(const te of N)h.encodeCentroid(void 0,h.featuresOnBorder[te],!1);if(ie){for(const te of J)K.encodeCentroid(void 0,K.featuresOnBorder[te],!1);K.borderDoneWithNeighborZ[L]=h.canonical.z,K.needsCentroidUpdate=!0}h.borderDoneWithNeighborZ[I]=K.canonical.z,h.needsCentroidUpdate=!0}}(h.needsCentroidUpdate||!h.centroidVertexBuffer&&h.centroidVertexArray.length!==0)&&h.uploadCentroid(l)}const eo=new a.Color(1,0,0,1),Bh=new a.Color(0,1,0,1),Oh=new a.Color(0,0,1,1),Fh=new a.Color(1,0,1,1),Uh=new a.Color(0,1,1,1);function Vh(l,r,o){const h=l.context,d=l.transform,f=h.gl,g=d.projection.name==="globe",y=g?["PROJECTION_GLOBE_VIEW"]:null;let v=o.projMatrix;if(g&&a.globeToMercatorTransition(d.zoom)>0){const le=a.transitionTileAABBinECEF(o.canonical,d),Te=a.globeDenormalizeECEF(le);v=a.multiply(new Float32Array(16),d.globeMatrix,Te),a.multiply(v,d.projMatrix,v)}const E=l.useProgram("debug",null,y),T=r.getTileByID(o.key);l.terrain&&l.terrain.setupElevationDraw(T,E);const A=a.DepthMode.disabled,k=a.StencilMode.disabled,R=l.colorModeForRenderPass(),O="$debug";h.activeTexture.set(f.TEXTURE0),l.emptyTexture.bind(f.LINEAR,f.CLAMP_TO_EDGE),g?T._makeGlobeTileDebugBuffers(l.context,d):T._makeDebugTileBoundsBuffers(l.context,d.projection);const B=T._tileDebugBuffer||l.debugBuffer,F=T._tileDebugIndexBuffer||l.debugIndexBuffer,I=T._tileDebugSegments||l.debugSegments;E.draw(h,f.LINE_STRIP,A,k,R,a.CullFaceMode.disabled,Ds(v,a.Color.red),O,B,F,I,null,null,null,[T._globeTileDebugBorderBuffer]);const L=T.latestRawTileData,N=Math.floor((L&&L.byteLength||0)/1024),j=r.getTile(o).tileSize,K=512/Math.min(j,512)*(o.overscaledZ/d.zoom)*.5;let J=o.canonical.toString();o.overscaledZ!==o.canonical.z&&(J+=` => ${o.overscaledZ}`),J+=` ${N}kb`,function(le,Te){le.initDebugOverlayCanvas();const oe=le.debugOverlayCanvas,ge=le.context.gl,he=le.debugOverlayCanvas.getContext("2d");he.clearRect(0,0,oe.width,oe.height),he.shadowColor="white",he.shadowBlur=2,he.lineWidth=1.5,he.strokeStyle="white",he.textBaseline="top",he.font="bold 36px Open Sans, sans-serif",he.fillText(Te,5,5),he.strokeText(Te,5,5),le.debugOverlayTexture.update(oe),le.debugOverlayTexture.bind(ge.LINEAR,ge.CLAMP_TO_EDGE)}(l,J);const Y=T._tileDebugTextBuffer||l.debugBuffer,ie=T._tileDebugTextIndexBuffer||l.quadTriangleIndexBuffer,te=T._tileDebugTextSegments||l.debugSegments;E.draw(h,f.TRIANGLES,A,k,a.ColorMode.alphaBlended,a.CullFaceMode.disabled,Ds(v,a.Color.transparent,K),O,Y,ie,te,null,null,null,[T._globeTileDebugTextBuffer])}function vc(l,r,o,h){to(l,0,r+o/2,l.transform.width,o,h)}function Fs(l,r,o,h){to(l,r-o/2,0,o,l.transform.height,h)}function to(l,r,o,h,d,f){const g=l.context,y=g.gl;y.enable(y.SCISSOR_TEST),y.scissor(r*a.exported.devicePixelRatio,o*a.exported.devicePixelRatio,h*a.exported.devicePixelRatio,d*a.exported.devicePixelRatio),g.clear({color:f}),y.disable(y.SCISSOR_TEST)}const bc=a.createLayout([{name:"a_pos_3f",components:3,type:"Float32"}]),{members:wc}=bc;function kr(l,r,o,h){l.emplaceBack(r,o,h)}class Us{constructor(r){this.vertexArray=new a.StructArrayLayout3f12,this.indices=new a.StructArrayLayout3ui6,kr(this.vertexArray,-1,-1,1),kr(this.vertexArray,1,-1,1),kr(this.vertexArray,-1,1,1),kr(this.vertexArray,1,1,1),kr(this.vertexArray,-1,-1,-1),kr(this.vertexArray,1,-1,-1),kr(this.vertexArray,-1,1,-1),kr(this.vertexArray,1,1,-1),this.indices.emplaceBack(5,1,3),this.indices.emplaceBack(3,7,5),this.indices.emplaceBack(6,2,0),this.indices.emplaceBack(0,4,6),this.indices.emplaceBack(2,6,7),this.indices.emplaceBack(7,3,2),this.indices.emplaceBack(5,4,0),this.indices.emplaceBack(0,1,5),this.indices.emplaceBack(0,2,3),this.indices.emplaceBack(3,1,0),this.indices.emplaceBack(7,6,4),this.indices.emplaceBack(4,5,7),this.vertexBuffer=r.createVertexBuffer(this.vertexArray,wc),this.indexBuffer=r.createIndexBuffer(this.indices),this.segment=a.SegmentVector.simpleSegment(0,0,36,12)}}function Gi(l,r,o,h,d,f){const g=l.gl,y=r.paint.get("sky-atmosphere-color"),v=r.paint.get("sky-atmosphere-halo-color"),E=r.paint.get("sky-atmosphere-sun-intensity"),T=((A,k,R,O,B)=>({u_matrix_3f:A,u_sun_direction:k,u_sun_intensity:R,u_color_tint_r:[O.r,O.g,O.b,O.a],u_color_tint_m:[B.r,B.g,B.b,B.a],u_luminance:5e-5}))(a.fromMat4(a.create$1(),h),d,E,y,v);g.framebufferTexture2D(g.FRAMEBUFFER,g.COLOR_ATTACHMENT0,g.TEXTURE_CUBE_MAP_POSITIVE_X+f,r.skyboxTexture,0),o.draw(l,g.TRIANGLES,a.DepthMode.disabled,a.StencilMode.disabled,a.ColorMode.unblended,a.CullFaceMode.frontCW,T,"skyboxCapture",r.skyboxGeometry.vertexBuffer,r.skyboxGeometry.indexBuffer,r.skyboxGeometry.segment)}const Wo=a.createLayout([{type:"Float32",name:"a_pos",components:3},{type:"Float32",name:"a_uv",components:2}]);class Tc{constructor(r){const o=new a.StructArrayLayout5f20;o.emplaceBack(-1,1,1,0,0),o.emplaceBack(1,1,1,1,0),o.emplaceBack(1,-1,1,1,1),o.emplaceBack(-1,-1,1,0,1);const h=new a.StructArrayLayout3ui6;h.emplaceBack(0,1,2),h.emplaceBack(2,3,0),this.vertexBuffer=r.createVertexBuffer(o,Wo.members),this.indexBuffer=r.createIndexBuffer(h),this.segments=a.SegmentVector.simpleSegment(0,0,4,2)}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy()}}const Tn={symbol:function(l,r,o,h,d){if(l.renderPass!=="translucent")return;const f=a.StencilMode.disabled,g=l.colorModeForRenderPass();o.layout.get("text-variable-anchor")&&function(y,v,E,T,A,k,R){const O=v.transform,B=A==="map",F=k==="map";for(const I of y){const L=T.getTile(I),N=L.getBucket(E);if(!N||!N.text||!N.text.segments.get().length)continue;const j=a.evaluateSizeForZoom(N.textSizeData,O.zoom),K=Ot(I,N.getProjection(),O),J=O.calculatePixelsToTileUnitsMatrix(L),Y=fe(K,L.tileID.canonical,F,B,O,N.getProjection(),J),ie=E.layout.get("icon-text-fit")!=="none"&&N.hasIconData();if(j){const te=Math.pow(2,O.zoom-L.tileID.overscaledZ);Rh(N,B,F,R,a.symbolSize,O,Y,I,te,j,ie)}}}(h,l,o,r,o.layout.get("text-rotation-alignment"),o.layout.get("text-pitch-alignment"),d),o.paint.get("icon-opacity").constantOr(1)!==0&&gc(l,r,o,h,!1,o.paint.get("icon-translate"),o.paint.get("icon-translate-anchor"),o.layout.get("icon-rotation-alignment"),o.layout.get("icon-pitch-alignment"),o.layout.get("icon-keep-upright"),f,g),o.paint.get("text-opacity").constantOr(1)!==0&&gc(l,r,o,h,!0,o.paint.get("text-translate"),o.paint.get("text-translate-anchor"),o.layout.get("text-rotation-alignment"),o.layout.get("text-pitch-alignment"),o.layout.get("text-keep-upright"),f,g),r.map.showCollisionBoxes&&(Zo(l,r,o,h,o.paint.get("text-translate"),o.paint.get("text-translate-anchor"),!0),Zo(l,r,o,h,o.paint.get("icon-translate"),o.paint.get("icon-translate-anchor"),!1))},circle:function(l,r,o,h){if(l.renderPass!=="translucent")return;const d=o.paint.get("circle-opacity"),f=o.paint.get("circle-stroke-width"),g=o.paint.get("circle-stroke-opacity"),y=o.layout.get("circle-sort-key").constantOr(1)!==void 0;if(d.constantOr(1)===0&&(f.constantOr(1)===0||g.constantOr(1)===0))return;const v=l.context,E=v.gl,T=l.transform,A=l.depthModeForSublayer(0,a.DepthMode.ReadOnly),k=a.StencilMode.disabled,R=l.colorModeForRenderPass(),O=T.projection.name==="globe",B=[a.mercatorXfromLng(T.center.lng),a.mercatorYfromLat(T.center.lat)],F=[];for(let L=0;LL.sortKey-N.sortKey);const I={useDepthForOcclusion:!O};for(const L of F){const{programConfiguration:N,program:j,layoutVertexBuffer:K,globeExtVertexBuffer:J,indexBuffer:Y,uniformValues:ie,tile:te}=L.state,le=L.segments;l.terrain&&l.terrain.setupElevationDraw(te,j,I),l.prepareDrawProgram(v,j,te.tileID.toUnwrapped()),j.draw(v,E.TRIANGLES,A,k,R,a.CullFaceMode.disabled,ie,o.id,K,Y,le,o.paint,T.zoom,N,[J])}},heatmap:function(l,r,o,h){if(o.paint.get("heatmap-opacity")!==0)if(l.renderPass==="offscreen"){const d=l.context,f=d.gl,g=a.StencilMode.disabled,y=new a.ColorMode([f.ONE,f.ONE],a.Color.transparent,[!0,!0,!0,!0]);(function(R,O,B,F){const I=R.gl,L=O.width*F,N=O.height*F;R.activeTexture.set(I.TEXTURE1),R.viewport.set([0,0,L,N]);let j=B.heatmapFbo;if(!j||j&&(j.width!==L||j.height!==N)){j&&j.destroy();const K=I.createTexture();I.bindTexture(I.TEXTURE_2D,K),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_WRAP_S,I.CLAMP_TO_EDGE),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_WRAP_T,I.CLAMP_TO_EDGE),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_MIN_FILTER,I.LINEAR),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_MAG_FILTER,I.LINEAR),j=B.heatmapFbo=R.createFramebuffer(L,N,!1),function(J,Y,ie,te,le,Te){const oe=J.gl;oe.texImage2D(oe.TEXTURE_2D,0,J.isWebGL2&&J.extRenderToTextureHalfFloat?oe.RGBA16F:oe.RGBA,le,Te,0,oe.RGBA,J.extRenderToTextureHalfFloat?J.isWebGL2?oe.HALF_FLOAT:J.extTextureHalfFloat.HALF_FLOAT_OES:oe.UNSIGNED_BYTE,null),te.colorAttachment.set(ie)}(R,0,K,j,L,N)}else I.bindTexture(I.TEXTURE_2D,j.colorAttachment.get()),R.bindFramebuffer.set(j.framebuffer)})(d,l,o,l.transform.projection.name==="globe"?.5:.25),d.clear({color:a.Color.transparent});const v=l.transform,E=v.projection.name==="globe",T=E?["PROJECTION_GLOBE_VIEW"]:null,A=E?a.CullFaceMode.frontCCW:a.CullFaceMode.disabled,k=[a.mercatorXfromLng(v.center.lng),a.mercatorYfromLat(v.center.lat)];for(let R=0;R({u_image:0,u_color_ramp:1,u_opacity:A.paint.get("heatmap-opacity")}))(0,f),f.id,d.viewportBuffer,d.quadTriangleIndexBuffer,d.viewportSegments,f.paint,d.transform.zoom)}(l,o))},line:function(l,r,o,h){if(l.renderPass!=="translucent")return;const d=o.paint.get("line-opacity"),f=o.paint.get("line-width");if(d.constantOr(1)===0||f.constantOr(1)===0)return;const g=l.depthModeForSublayer(0,a.DepthMode.ReadOnly),y=l.colorModeForRenderPass(),v=l.terrain&&l.terrain.renderingToTexture?1:a.exported.devicePixelRatio,E=o.paint.get("line-dasharray"),T=E.constantOr(1),A=o.layout.get("line-cap"),k=o.paint.get("line-pattern"),R=k.constantOr(1),O=o.paint.get("line-gradient"),B=R?"linePattern":"line",F=l.context,I=F.gl,L=(j=>{const K=[];$o(j)&&K.push("RENDER_LINE_DASH"),j.paint.get("line-gradient")&&K.push("RENDER_LINE_GRADIENT");const J=j.paint.get("line-trim-offset");J[0]===0&&J[1]===0||K.push("RENDER_LINE_TRIM_OFFSET");const Y=j.paint.get("line-pattern").constantOr(1),ie=j.paint.get("line-opacity").constantOr(1)!==1;return!Y&&ie&&K.push("RENDER_LINE_ALPHA_DISCARD"),K})(o);let N=L.includes("RENDER_LINE_ALPHA_DISCARD");l.terrain&&l.terrain.clipOrMaskOverlapStencilType()&&(N=!1);for(const j of h){const K=r.getTile(j);if(R&&!K.patternsLoaded())continue;const J=K.getBucket(o);if(!J)continue;l.prepareDrawTile();const Y=J.programConfigurations.get(o.id),ie=l.useProgram(B,Y,L),te=k.constantOr(null);if(te&&K.imageAtlas){const _e=K.imageAtlas.patternPositions[te.toString()];_e&&Y.setConstantPatternPositions(_e)}const le=E.constantOr(null),Te=A.constantOr(null);if(!R&&le&&Te&&K.lineAtlas){const _e=K.lineAtlas.getDash(le,Te);_e&&Y.setConstantPatternPositions(_e)}let[oe,ge]=o.paint.get("line-trim-offset");(Te==="round"||Te==="square")&&oe!==ge&&(oe===0&&(oe-=1),ge===1&&(ge+=1));const he=l.terrain?j.projMatrix:null,we=R?Go(l,K,o,he,v):Dh(l,K,o,he,J.lineClipsArray.length,v,[oe,ge]);if(O){const _e=J.gradients[o.id];let Me=_e.texture;if(o.gradientVersion!==_e.version){let ve=256;if(o.stepInterpolant){const Ae=r.getSource().maxzoom,Ge=j.canonical.z===Ae?Math.ceil(1<{ie.draw(F,I.TRIANGLES,g,_e,y,a.CullFaceMode.disabled,we,o.id,J.layoutVertexBuffer,J.indexBuffer,J.segments,o.paint,l.transform.zoom,Y,[J.layoutVertexBuffer2])};if(N){const _e=l.stencilModeForClipping(j).ref;_e===0&&l.terrain&&F.clear({stencil:0});const Me={func:I.EQUAL,mask:255};we.u_alpha_discard_threshold=.8,ae(new a.StencilMode(Me,_e,255,I.KEEP,I.KEEP,I.INVERT)),we.u_alpha_discard_threshold=0,ae(new a.StencilMode(Me,_e,255,I.KEEP,I.KEEP,I.KEEP))}else ae(l.stencilModeForClipping(j))}N&&(l.resetStencilClippingMasks(),l.terrain&&F.clear({stencil:0}))},fill:function(l,r,o,h){const d=o.paint.get("fill-color"),f=o.paint.get("fill-opacity");if(f.constantOr(1)===0)return;const g=l.colorModeForRenderPass(),y=o.paint.get("fill-pattern"),v=l.opaquePassEnabledForLayer()&&!y.constantOr(1)&&d.constantOr(a.Color.transparent).a===1&&f.constantOr(0)===1?"opaque":"translucent";if(l.renderPass===v){const E=l.depthModeForSublayer(1,l.renderPass==="opaque"?a.DepthMode.ReadWrite:a.DepthMode.ReadOnly);yc(l,r,o,h,E,g,!1)}if(l.renderPass==="translucent"&&o.paint.get("fill-antialias")){const E=l.depthModeForSublayer(o.getPaintProperty("fill-outline-color")?2:0,a.DepthMode.ReadOnly);yc(l,r,o,h,E,g,!0)}},"fill-extrusion":function(l,r,o,h){const d=o.paint.get("fill-extrusion-opacity");if(d!==0&&l.renderPass==="translucent"){const f=new a.DepthMode(l.context.gl.LEQUAL,a.DepthMode.ReadWrite,l.depthRangeFor3D);if(d!==1||o.paint.get("fill-extrusion-pattern").constantOr(1))Os(l,r,o,h,f,a.StencilMode.disabled,a.ColorMode.disabled),Os(l,r,o,h,f,l.stencilModeFor3D(),l.colorModeForRenderPass()),l.resetStencilClippingMasks();else{const g=l.colorModeForRenderPass();Os(l,r,o,h,f,a.StencilMode.disabled,g)}}},hillshade:function(l,r,o,h){if(l.renderPass!=="offscreen"&&l.renderPass!=="translucent")return;const d=l.context,f=l.depthModeForSublayer(0,a.DepthMode.ReadOnly),g=l.colorModeForRenderPass(),y=l.terrain&&l.terrain.renderingToTexture,[v,E]=l.renderPass!=="translucent"||y?[{},h]:l.stencilConfigForOverlap(h);for(const T of E){const A=r.getTile(T);if(A.needsHillshadePrepare&&l.renderPass==="offscreen")cc(l,A,o,f,a.StencilMode.disabled,g);else if(l.renderPass==="translucent"){const k=y&&l.terrain?l.terrain.stencilModeForRTTOverlap(T):v[T.overscaledZ];lc(l,T,A,o,f,k,g)}}d.viewport.set([0,0,l.width,l.height]),l.resetStencilClippingMasks()},raster:function(l,r,o,h,d,f){if(l.renderPass!=="translucent"||o.paint.get("raster-opacity")===0||!h.length)return;const g=l.context,y=g.gl,v=r.getSource(),E=l.useProgram("raster"),T=l.colorModeForRenderPass(),A=l.terrain&&l.terrain.renderingToTexture,[k,R]=v instanceof rt||A?[{},h]:l.stencilConfigForOverlap(h),O=R[R.length-1].overscaledZ,B=!l.options.moving;for(const F of R){const I=A?a.DepthMode.disabled:l.depthModeForSublayer(F.overscaledZ-O,o.paint.get("raster-opacity")===1?a.DepthMode.ReadWrite:a.DepthMode.ReadOnly,y.LESS),L=F.toUnwrapped(),N=r.getTile(F);if(A&&(!N||!N.hasData()))continue;const j=A?F.projMatrix:l.transform.calculateProjMatrix(L,B),K=l.terrain&&A?l.terrain.stencilModeForRTTOverlap(F):k[F.overscaledZ],J=f?0:o.paint.get("raster-fade-duration");N.registerFadeDuration(J);const Y=r.findLoadedParent(F,0),ie=ja(N,Y,r,l.transform,J);let te,le;l.terrain&&l.terrain.prepareDrawTile();const Te=o.paint.get("raster-resampling")==="nearest"?y.NEAREST:y.LINEAR;g.activeTexture.set(y.TEXTURE0),N.texture.bind(Te,y.CLAMP_TO_EDGE),g.activeTexture.set(y.TEXTURE1),Y?(Y.texture.bind(Te,y.CLAMP_TO_EDGE),te=Math.pow(2,Y.tileID.overscaledZ-N.tileID.overscaledZ),le=[N.tileID.canonical.x*te%1,N.tileID.canonical.y*te%1]):N.texture.bind(Te,y.CLAMP_TO_EDGE),N.texture.useMipmap&&g.extTextureFilterAnisotropic&&l.transform.pitch>20&&y.texParameterf(y.TEXTURE_2D,g.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,g.extTextureFilterAnisotropicMax);const oe=Ya(j,le||[0,0],te||1,ie,o,v instanceof rt?v.perspectiveTransform:[0,0]);if(l.prepareDrawProgram(g,E,L),v instanceof rt)v.boundsBuffer&&v.boundsSegments&&E.draw(g,y.TRIANGLES,I,a.StencilMode.disabled,T,a.CullFaceMode.disabled,oe,o.id,v.boundsBuffer,l.quadTriangleIndexBuffer,v.boundsSegments);else{const{tileBoundsBuffer:ge,tileBoundsIndexBuffer:he,tileBoundsSegments:we}=l.getTileBoundsBuffers(N);E.draw(g,y.TRIANGLES,I,K,T,a.CullFaceMode.disabled,oe,o.id,ge,he,we)}}l.resetStencilClippingMasks()},background:function(l,r,o,h){const d=o.paint.get("background-color"),f=o.paint.get("background-opacity");if(f===0)return;const g=l.context,y=g.gl,v=l.transform,E=v.tileSize,T=o.paint.get("background-pattern");if(l.isPatternMissing(T))return;const A=!T&&d.a===1&&f===1&&l.opaquePassEnabledForLayer()?"opaque":"translucent";if(l.renderPass!==A)return;const k=a.StencilMode.disabled,R=l.depthModeForSublayer(0,A==="opaque"?a.DepthMode.ReadWrite:a.DepthMode.ReadOnly),O=l.colorModeForRenderPass(),B=l.useProgram(T?"backgroundPattern":"background");let F,I=h;I||(F=l.getBackgroundTiles(),I=Object.values(F).map(L=>L.tileID)),T&&(g.activeTexture.set(y.TEXTURE0),l.imageManager.bind(l.context));for(const L of I){const N=L.toUnwrapped(),j=h?L.projMatrix:l.transform.calculateProjMatrix(N);l.prepareDrawTile();const K=r?r.getTile(L):F?F[L.key]:new a.Tile(L,E,v.zoom,l),J=T?Lh(j,f,l,T,{tileID:L,tileSize:E}):Qa(j,f,d);l.prepareDrawProgram(g,B,N);const{tileBoundsBuffer:Y,tileBoundsIndexBuffer:ie,tileBoundsSegments:te}=l.getTileBoundsBuffers(K);B.draw(g,y.TRIANGLES,R,k,O,a.CullFaceMode.disabled,J,o.id,Y,ie,te)}},sky:function(l,r,o){const h=l.transform,d=h.projection.name==="mercator"||h.projection.name==="globe"?1:a.smoothstep(7,8,h.zoom),f=o.paint.get("sky-opacity")*d;if(f===0)return;const g=l.context,y=o.paint.get("sky-type"),v=new a.DepthMode(g.gl.LEQUAL,a.DepthMode.ReadOnly,[0,1]),E=l.frameCounter/1e3%1;y==="atmosphere"?l.renderPass==="offscreen"?o.needsSkyboxCapture(l)&&(function(T,A,k,R){const O=T.context,B=O.gl;let F=A.skyboxFbo;if(!F){F=A.skyboxFbo=O.createFramebuffer(32,32,!1),A.skyboxGeometry=new Us(O),A.skyboxTexture=O.gl.createTexture(),B.bindTexture(B.TEXTURE_CUBE_MAP,A.skyboxTexture),B.texParameteri(B.TEXTURE_CUBE_MAP,B.TEXTURE_WRAP_S,B.CLAMP_TO_EDGE),B.texParameteri(B.TEXTURE_CUBE_MAP,B.TEXTURE_WRAP_T,B.CLAMP_TO_EDGE),B.texParameteri(B.TEXTURE_CUBE_MAP,B.TEXTURE_MIN_FILTER,B.LINEAR),B.texParameteri(B.TEXTURE_CUBE_MAP,B.TEXTURE_MAG_FILTER,B.LINEAR);for(let j=0;j<6;++j)B.texImage2D(B.TEXTURE_CUBE_MAP_POSITIVE_X+j,0,B.RGBA,32,32,0,B.RGBA,B.UNSIGNED_BYTE,null)}O.bindFramebuffer.set(F.framebuffer),O.viewport.set([0,0,32,32]);const I=A.getCenter(T,!0),L=T.useProgram("skyboxCapture"),N=new Float64Array(16);a.identity(N),a.rotateY(N,N,.5*-Math.PI),Gi(O,A,L,N,I,0),a.identity(N),a.rotateY(N,N,.5*Math.PI),Gi(O,A,L,N,I,1),a.identity(N),a.rotateX(N,N,.5*-Math.PI),Gi(O,A,L,N,I,2),a.identity(N),a.rotateX(N,N,.5*Math.PI),Gi(O,A,L,N,I,3),a.identity(N),Gi(O,A,L,N,I,4),a.identity(N),a.rotateY(N,N,Math.PI),Gi(O,A,L,N,I,5),O.viewport.set([0,0,T.width,T.height])}(l,o),o.markSkyboxValid(l)):l.renderPass==="sky"&&function(T,A,k,R,O){const B=T.context,F=B.gl,I=T.transform,L=T.useProgram("skybox");B.activeTexture.set(F.TEXTURE0),F.bindTexture(F.TEXTURE_CUBE_MAP,A.skyboxTexture);const N=((j,K,J,Y,ie)=>({u_matrix:j,u_sun_direction:K,u_cubemap:0,u_opacity:Y,u_temporal_offset:ie}))(I.skyboxMatrix,A.getCenter(T,!1),0,R,O);T.prepareDrawProgram(B,L),L.draw(B,F.TRIANGLES,k,a.StencilMode.disabled,T.colorModeForRenderPass(),a.CullFaceMode.backCW,N,"skybox",A.skyboxGeometry.vertexBuffer,A.skyboxGeometry.indexBuffer,A.skyboxGeometry.segment)}(l,o,v,f,E):y==="gradient"&&l.renderPass==="sky"&&function(T,A,k,R,O){const B=T.context,F=B.gl,I=T.transform,L=T.useProgram("skyboxGradient");A.skyboxGeometry||(A.skyboxGeometry=new Us(B)),B.activeTexture.set(F.TEXTURE0);let N=A.colorRampTexture;N||(N=A.colorRampTexture=new a.Texture(B,A.colorRamp,F.RGBA)),N.bind(F.LINEAR,F.CLAMP_TO_EDGE);const j=((K,J,Y,ie,te)=>({u_matrix:K,u_color_ramp:0,u_center_direction:J,u_radius:a.degToRad(Y),u_opacity:ie,u_temporal_offset:te}))(I.skyboxMatrix,A.getCenter(T,!1),A.paint.get("sky-gradient-radius"),R,O);T.prepareDrawProgram(B,L),L.draw(B,F.TRIANGLES,k,a.StencilMode.disabled,T.colorModeForRenderPass(),a.CullFaceMode.backCW,j,"skyboxGradient",A.skyboxGeometry.vertexBuffer,A.skyboxGeometry.indexBuffer,A.skyboxGeometry.segment)}(l,o,v,f,E)},debug:function(l,r,o){for(let h=0;hd)return void(this.transform.fogCullDistSq=null);const f=h+.78*(d-h);this.transform.fogCullDistSq=f*f}get terrain(){return this.transform._terrainEnabled()&&this._terrain&&this._terrain.enabled?this._terrain:null}resize(r,o){if(this.width=r*a.exported.devicePixelRatio,this.height=o*a.exported.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const h of this.style.order)this.style._layers[h].resize()}setup(){const r=this.context,o=new a.StructArrayLayout2i4;o.emplaceBack(0,0),o.emplaceBack(a.EXTENT,0),o.emplaceBack(0,a.EXTENT),o.emplaceBack(a.EXTENT,a.EXTENT),this.tileExtentBuffer=r.createVertexBuffer(o,a.posAttributes.members),this.tileExtentSegments=a.SegmentVector.simpleSegment(0,0,4,2);const h=new a.StructArrayLayout2i4;h.emplaceBack(0,0),h.emplaceBack(a.EXTENT,0),h.emplaceBack(0,a.EXTENT),h.emplaceBack(a.EXTENT,a.EXTENT),this.debugBuffer=r.createVertexBuffer(h,a.posAttributes.members),this.debugSegments=a.SegmentVector.simpleSegment(0,0,4,5);const d=new a.StructArrayLayout2i4;d.emplaceBack(-1,-1),d.emplaceBack(1,-1),d.emplaceBack(-1,1),d.emplaceBack(1,1),this.viewportBuffer=r.createVertexBuffer(d,a.posAttributes.members),this.viewportSegments=a.SegmentVector.simpleSegment(0,0,4,2);const f=new a.StructArrayLayout4i8;f.emplaceBack(0,0,0,0),f.emplaceBack(a.EXTENT,0,a.EXTENT,0),f.emplaceBack(0,a.EXTENT,0,a.EXTENT),f.emplaceBack(a.EXTENT,a.EXTENT,a.EXTENT,a.EXTENT),this.mercatorBoundsBuffer=r.createVertexBuffer(f,a.boundsAttributes.members),this.mercatorBoundsSegments=a.SegmentVector.simpleSegment(0,0,4,2);const g=new a.StructArrayLayout3ui6;g.emplaceBack(0,1,2),g.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=r.createIndexBuffer(g);const y=new a.StructArrayLayout1ui2;for(const E of[0,1,3,2,0])y.emplaceBack(E);this.debugIndexBuffer=r.createIndexBuffer(y),this.emptyTexture=new a.Texture(r,new a.RGBAImage({width:1,height:1},Uint8Array.of(0,0,0,0)),r.gl.RGBA),this.identityMat=a.create();const v=this.context.gl;this.stencilClearMode=new a.StencilMode({func:v.ALWAYS,mask:0},0,255,v.ZERO,v.ZERO,v.ZERO),this.loadTimeStamps.push(a.window.performance.now()),this.atmosphereBuffer=new Tc(this.context)}getMercatorTileBoundsBuffers(){return{tileBoundsBuffer:this.mercatorBoundsBuffer,tileBoundsIndexBuffer:this.quadTriangleIndexBuffer,tileBoundsSegments:this.mercatorBoundsSegments}}getTileBoundsBuffers(r){return r._makeTileBoundsBuffers(this.context,this.transform.projection),r._tileBoundsBuffer?{tileBoundsBuffer:r._tileBoundsBuffer,tileBoundsIndexBuffer:r._tileBoundsIndexBuffer,tileBoundsSegments:r._tileBoundsSegments}:this.getMercatorTileBoundsBuffers()}clearStencil(){const r=this.context,o=r.gl;this.nextStencilID=1,this.currentStencilSource=void 0,this._tileClippingMaskIDs={},this.useProgram("clippingMask").draw(r,o.TRIANGLES,a.DepthMode.disabled,this.stencilClearMode,a.ColorMode.disabled,a.CullFaceMode.disabled,No(this.identityMat),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}resetStencilClippingMasks(){this.terrain||(this.currentStencilSource=void 0,this._tileClippingMaskIDs={})}_renderTileClippingMasks(r,o,h){if(!o||this.currentStencilSource===o.id||!r.isTileClipped()||!h||h.length===0)return;if(this._tileClippingMaskIDs&&!this.terrain){let y=!1;for(const v of h)if(this._tileClippingMaskIDs[v.key]===void 0){y=!0;break}if(!y)return}this.currentStencilSource=o.id;const d=this.context,f=d.gl;this.nextStencilID+h.length>256&&this.clearStencil(),d.setColorMode(a.ColorMode.disabled),d.setDepthMode(a.DepthMode.disabled);const g=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const y of h){const v=o.getTile(y),E=this._tileClippingMaskIDs[y.key]=this.nextStencilID++,{tileBoundsBuffer:T,tileBoundsIndexBuffer:A,tileBoundsSegments:k}=this.getTileBoundsBuffers(v);g.draw(d,f.TRIANGLES,a.DepthMode.disabled,new a.StencilMode({func:f.ALWAYS,mask:0},E,255,f.KEEP,f.KEEP,f.REPLACE),a.ColorMode.disabled,a.CullFaceMode.disabled,No(y.projMatrix),"$clipping",T,A,k)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const r=this.nextStencilID++,o=this.context.gl;return new a.StencilMode({func:o.NOTEQUAL,mask:255},r,255,o.KEEP,o.KEEP,o.REPLACE)}stencilModeForClipping(r){if(this.terrain)return this.terrain.stencilModeForRTTOverlap(r);const o=this.context.gl;return new a.StencilMode({func:o.EQUAL,mask:255},this._tileClippingMaskIDs[r.key],0,o.KEEP,o.KEEP,o.REPLACE)}stencilConfigForOverlap(r){const o=this.context.gl,h=r.sort((g,y)=>y.overscaledZ-g.overscaledZ),d=h[h.length-1].overscaledZ,f=h[0].overscaledZ-d+1;if(f>1){this.currentStencilSource=void 0,this.nextStencilID+f>256&&this.clearStencil();const g={};for(let y=0;y=0;this.currentLayer--){const E=this.style._layers[h[this.currentLayer]],T=r._getLayerSourceCache(E);if(E.isSky())continue;const A=T?g[T.id]:void 0;this._renderTileClippingMasks(E,T,A),this.renderLayer(this,T,E,A)}if(this.style.fog&&this.transform.projection.supportsFog&&function(E,T){const A=E.context,k=A.gl,R=E.transform,O=new a.DepthMode(k.LEQUAL,a.DepthMode.ReadOnly,[0,1]),B=E.useProgram("globeAtmosphere",null,R.projection.name==="globe"?["PROJECTION_GLOBE_VIEW","FOG"]:["FOG"]),F=a.globeToMercatorTransition(R.zoom),I=T.properties.get("color").toArray01(),L=T.properties.get("high-color").toArray01(),N=T.properties.get("space-color").toArray01PremultipliedAlpha(),j=a.identity$1([]);a.rotateY$1(j,j,-a.degToRad(R._center.lng)),a.rotateX$1(j,j,a.degToRad(R._center.lat)),a.rotateZ$1(j,j,R.angle),a.rotateX$1(j,j,-R._pitch);const K=a.fromQuat(new Float32Array(16),j),J=a.mapValue(T.properties.get("star-intensity"),0,1,0,.25),Y=5e-4,ie=a.mapValue(T.properties.get("horizon-blend"),0,1,Y,.25),te=a.globeUseCustomAntiAliasing(E,A,R)&&ie===Y?R.worldSize/(2*Math.PI*1.025)-1:R.globeRadius,le=E.frameCounter/1e3%1,Te=a.length(R.globeCenterInViewSpace),oe=Math.sqrt(Math.pow(Te,2)-Math.pow(te,2)),ge=Math.acos(oe/Te),he=((ae,_e,Me,ve,Ae,Ge,Xe,Ve,qe,lt,ot,je,wt,Tt)=>({u_frustum_tl:ae,u_frustum_tr:_e,u_frustum_br:Me,u_frustum_bl:ve,u_horizon:Ae,u_transition:Ge,u_fadeout_range:Xe,u_color:Ve,u_high_color:qe,u_space_color:lt,u_star_intensity:ot,u_star_size:5*a.exported.devicePixelRatio,u_star_density:0,u_temporal_offset:je,u_horizon_angle:wt,u_rotation_matrix:Tt}))(R.frustumCorners.TL,R.frustumCorners.TR,R.frustumCorners.BR,R.frustumCorners.BL,R.frustumCorners.horizon,F,ie,I,L,N,J,le,ge,K);E.prepareDrawProgram(A,B);const we=E.atmosphereBuffer;we&&B.draw(A,k.TRIANGLES,O,a.StencilMode.disabled,a.ColorMode.alphaBlended,a.CullFaceMode.backCW,he,"skybox",we.vertexBuffer,we.indexBuffer,we.segments)}(this,this.style.fog),this.renderPass="sky",(a.globeToMercatorTransition(this.transform.zoom)>0||this.transform.projection.name!=="globe")&&this.transform.isHorizonVisible())for(this.currentLayer=0;this.currentLayer{const A=r._getLayerSourceCache(T);A&&!T.isHidden(this.transform.zoom)&&(!E||E.getSource().maxzoom0?o.pop():null}isPatternMissing(r){return r===null||r!==void 0&&!this.imageManager.getPattern(r.toString())}terrainRenderModeElevated(){return this.style&&!!this.style.getTerrain()&&!!this.terrain&&!this.terrain.renderingToTexture}currentGlobalDefines(){const r=this.terrain&&this.terrain.renderingToTexture,o=this.terrain&&this.terrain.exaggeration()===0,h=this.style&&this.style.fog,d=[];return this.terrainRenderModeElevated()&&d.push("TERRAIN"),this.transform.projection.name==="globe"&&d.push("GLOBE"),o&&d.push("ZERO_EXAGGERATION"),h&&!r&&h.getOpacity(this.transform.pitch)!==0&&d.push("FOG"),r&&d.push("RENDER_TO_TEXTURE"),this._showOverdrawInspector&&d.push("OVERDRAW_INSPECTOR"),d}useProgram(r,o,h){this.cache=this.cache||{};const d=h||[],f=this.currentGlobalDefines().concat(d),g=mt.cacheKey(Fa[r],r,f,o);return this.cache[g]||(this.cache[g]=new mt(this.context,r,Fa[r],o,el[r],f)),this.cache[g]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.frontFace.setDefault(),this.context.cullFaceSide.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const r=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(r.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=a.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new a.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this._terrain&&this._terrain.destroy(),this.globeSharedBuffers&&this.globeSharedBuffers.destroy(),this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.atmosphereBuffer&&this.atmosphereBuffer.destroy()}prepareDrawTile(){this.terrain&&this.terrain.prepareDrawTile()}prepareDrawProgram(r,o,h){if(this.terrain&&this.terrain.renderingToTexture)return;const d=this.style.fog;if(d){const f=d.getOpacity(this.transform.pitch),g=((y,v,E,T,A,k,R,O,B,F,I)=>{const L=y.transform,N=v.properties.get("color").toArray01();N[3]=T;const j=y.frameCounter/1e3%1;return{u_fog_matrix:E?L.calculateFogTileMatrix(E):y.identityMat,u_fog_range:v.getFovAdjustedRange(L._fov),u_fog_color:N,u_fog_horizon_blend:v.properties.get("horizon-blend"),u_fog_temporal_offset:j,u_frustum_tl:A,u_frustum_tr:k,u_frustum_br:R,u_frustum_bl:O,u_globe_pos:B,u_globe_radius:F,u_viewport:I,u_globe_transition:a.globeToMercatorTransition(L.zoom),u_is_globe:+(L.projection.name==="globe")}})(this,d,h,f,this.transform.frustumCorners.TL,this.transform.frustumCorners.TR,this.transform.frustumCorners.BR,this.transform.frustumCorners.BL,this.transform.globeCenterInViewSpace,this.transform.globeRadius,[this.transform.width*a.exported.devicePixelRatio,this.transform.height*a.exported.devicePixelRatio]);o.setFogUniformValues(r,g)}}setTileLoadedFlag(r){this.tileLoaded=r}saveCanvasCopy(){const r=this.canvasCopy();r&&(this.frameCopies.push(r),this.tileLoaded=!1)}canvasCopy(){const r=this.context.gl,o=r.createTexture();return r.bindTexture(r.TEXTURE_2D,o),r.copyTexImage2D(r.TEXTURE_2D,0,r.RGBA,0,0,r.drawingBufferWidth,r.drawingBufferHeight,0),o}getCanvasCopiesAndTimestamps(){return{canvasCopies:this.frameCopies,timeStamps:this.loadTimeStamps}}averageElevationNeedsEasing(){if(!this.transform._elevation)return!1;const r=this.style&&this.style.fog;return!!r&&r.getOpacity(this.transform.pitch)!==0}getBackgroundTiles(){const r=this._backgroundTiles,o=this._backgroundTiles={},h=this.transform.coveringTiles({tileSize:512});for(const d of h)o[d.key]=r[d.key]||new a.Tile(d,512,this.transform.tileZoom,this);return o}clearBackgroundTiles(){this._backgroundTiles={}}}class Vs{constructor(r=0,o=0,h=0,d=0){if(isNaN(r)||r<0||isNaN(o)||o<0||isNaN(h)||h<0||isNaN(d)||d<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=r,this.bottom=o,this.left=h,this.right=d}interpolate(r,o,h){return o.top!=null&&r.top!=null&&(this.top=a.number(r.top,o.top,h)),o.bottom!=null&&r.bottom!=null&&(this.bottom=a.number(r.bottom,o.bottom,h)),o.left!=null&&r.left!=null&&(this.left=a.number(r.left,o.left,h)),o.right!=null&&r.right!=null&&(this.right=a.number(r.right,o.right,h)),this}getCenter(r,o){const h=a.clamp((this.left+r-this.right)/2,0,r),d=a.clamp((this.top+o-this.bottom)/2,0,o);return new a.Point(h,d)}equals(r){return this.top===r.top&&this.bottom===r.bottom&&this.left===r.left&&this.right===r.right}clone(){return new Vs(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function Ns(l,r){const o=a.getColumn(l,3);a.fromQuat(l,r),a.setColumn(l,3,o)}function _t(l,r){const o=a.identity$1([]);return a.rotateZ$1(o,o,-r),a.rotateX$1(o,o,-l),o}function Xo(l,r){const o=[l[0],l[1],0],h=[r[0],r[1],0];if(a.length(o)>=1e-15){const g=a.normalize([],o);a.scale$2(h,g,a.dot(h,g)),r[0]=h[0],r[1]=h[1]}const d=a.cross([],r,l);if(a.len(d)<1e-15)return null;const f=Math.atan2(-d[1],d[0]);return _t(Math.atan2(Math.sqrt(l[0]*l[0]+l[1]*l[1]),-l[2]),f)}class Ec{constructor(r,o){this.position=r,this.orientation=o}get position(){return this._position}set position(r){if(r){const o=r instanceof a.MercatorCoordinate?r:new a.MercatorCoordinate(r[0],r[1],r[2]);this._renderWorldCopies&&(o.x=a.wrap(o.x,0,1)),this._position=o}else this._position=null}lookAtPoint(r,o){if(this.orientation=null,!this.position)return;const h=this.position,d=this._elevation?this._elevation.getAtPointOrZero(a.MercatorCoordinate.fromLngLat(r)):0,f=a.MercatorCoordinate.fromLngLat(r,d),g=[f.x-h.x,f.y-h.y,f.z-h.z];o||(o=[0,0,1]),o[2]=Math.abs(o[2]),this.orientation=Xo(g,o)}setPitchBearing(r,o){this.orientation=_t(a.degToRad(r),a.degToRad(-o))}}class js{constructor(r,o){this._transform=a.identity([]),this.orientation=o,this.position=r}get mercatorPosition(){const r=this.position;return new a.MercatorCoordinate(r[0],r[1],r[2])}get position(){const r=a.getColumn(this._transform,3);return[r[0],r[1],r[2]]}set position(r){var o;r&&a.setColumn(this._transform,3,[(o=r)[0],o[1],o[2],1])}get orientation(){return this._orientation}set orientation(r){this._orientation=r||a.identity$1([]),r&&Ns(this._transform,this._orientation)}getPitchBearing(){const r=this.forward(),o=this.right();return{bearing:Math.atan2(-o[1],o[0]),pitch:Math.atan2(Math.sqrt(r[0]*r[0]+r[1]*r[1]),-r[2])}}setPitchBearing(r,o){this._orientation=_t(r,o),Ns(this._transform,this._orientation)}forward(){const r=a.getColumn(this._transform,2);return[-r[0],-r[1],-r[2]]}up(){const r=a.getColumn(this._transform,1);return[-r[0],-r[1],-r[2]]}right(){const r=a.getColumn(this._transform,0);return[r[0],r[1],r[2]]}getCameraToWorld(r,o){const h=new Float64Array(16);return a.invert(h,this.getWorldToCamera(r,o)),h}getWorldToCameraPosition(r,o,h){const d=this.position;a.scale$2(d,d,-r);const f=new Float64Array(16);return a.fromScaling(f,[h,h,h]),a.translate(f,f,d),f[10]*=o,f}getWorldToCamera(r,o){const h=new Float64Array(16),d=new Float64Array(4),f=this.position;return a.conjugate(d,this._orientation),a.scale$2(f,f,-r),a.fromQuat(h,d),a.translate(h,h,f),h[1]*=-1,h[5]*=-1,h[9]*=-1,h[13]*=-1,h[8]*=o,h[9]*=o,h[10]*=o,h[11]*=o,h}getCameraToClipPerspective(r,o,h,d){const f=new Float64Array(16);return a.perspective(f,r,o,h,d),f}getDistanceToElevation(r,o=!1){const h=r===0?0:a.mercatorZfromAltitude(r,o?a.latFromMercatorY(this.position[1]):this.position[1]),d=this.forward();return(h-this.position[2])/d[2]}clone(){return new js([...this.position],[...this.orientation])}}function ro(l,r){const o=Gs(l.projection,l.zoom,l.width,l.height),h=function(f,g,y,v,E){const T=new a.LngLat(y.lng-180*Dr,y.lat),A=new a.LngLat(y.lng+180*Dr,y.lat),k=f.project(T.lng,T.lat),R=f.project(A.lng,A.lat),O=-Math.atan2(R.y-k.y,R.x-k.x),B=a.MercatorCoordinate.fromLngLat(y);B.y=a.clamp(B.y,-1+Dr,1-Dr);const F=B.toLngLat(),I=f.project(F.lng,F.lat),L=a.MercatorCoordinate.fromLngLat(F);L.x+=Dr;const N=L.toLngLat(),j=f.project(N.lng,N.lat),K=$s(j.x-I.x,j.y-I.y,O),J=a.MercatorCoordinate.fromLngLat(F);J.y+=Dr;const Y=J.toLngLat(),ie=f.project(Y.lng,Y.lat),te=$s(ie.x-I.x,ie.y-I.y,O),le=Math.abs(K.x)/Math.abs(te.y),Te=a.identity([]);a.rotateZ(Te,Te,-O*(1-(E?0:v)));const oe=a.identity([]);return a.scale(oe,oe,[1,1-(1-le)*v,1]),oe[4]=-te.x/te.y*v,a.rotateZ(oe,oe,O),a.multiply(oe,Te,oe),oe}(l.projection,0,l.center,o,r),d=Sc(l);return a.scale(h,h,[d,d,1]),h}function Sc(l){const r=l.projection,o=Gs(l.projection,l.zoom,l.width,l.height),h=Mc(r,l.center),d=Mc(r,a.LngLat.convert(r.center));return Math.pow(2,h*o+(1-o)*d)}function Gs(l,r,o,h,d=1/0){const f=l.range;if(!f)return 0;const g=Math.min(d,Math.max(o,h)),y=Math.log(g/1024)/Math.LN2;return a.smoothstep(f[0]+y,f[1]+y,r)}const Dr=1/4e4;function Mc(l,r){const o=a.clamp(r.lat,-a.MAX_MERCATOR_LATITUDE,a.MAX_MERCATOR_LATITUDE),h=new a.LngLat(r.lng-180*Dr,o),d=new a.LngLat(r.lng+180*Dr,o),f=l.project(h.lng,o),g=l.project(d.lng,o),y=a.MercatorCoordinate.fromLngLat(h),v=a.MercatorCoordinate.fromLngLat(d),E=g.x-f.x,T=g.y-f.y,A=v.x-y.x,k=v.y-y.y,R=Math.sqrt((A*A+k*k)/(E*E+T*T));return Math.log(R)/Math.LN2}function $s(l,r,o){const h=Math.cos(o),d=Math.sin(o);return{x:l*h-r*d,y:l*d+r*h}}class no{constructor(r,o,h,d,f,g,y){this.tileSize=512,this._renderWorldCopies=f===void 0||f,this._minZoom=r||0,this._maxZoom=o||22,this._minPitch=h??0,this._maxPitch=d??60,this.setProjection(g),this.setMaxBounds(y),this.width=0,this.height=0,this._center=new a.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._nearZ=0,this._farZ=0,this._unmodified=!0,this._edgeInsets=new Vs,this._projMatrixCache={},this._alignedProjMatrixCache={},this._fogTileMatrixCache={},this._distanceTileDataCache={},this._camera=new js,this._centerAltitude=0,this._averageElevation=0,this.cameraElevationReference="ground",this._pixelsPerMercatorPixel=1,this.globeRadius=0,this.globeCenterInViewSpace=[0,0,0],this._horizonShift=.1}clone(){const r=new no(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies,this.getProjection());return r._elevation=this._elevation,r._centerAltitude=this._centerAltitude,r._centerAltitudeValidForExaggeration=this._centerAltitudeValidForExaggeration,r.tileSize=this.tileSize,r.mercatorFromTransition=this.mercatorFromTransition,r.width=this.width,r.height=this.height,r.cameraElevationReference=this.cameraElevationReference,r._center=this._center,r._setZoom(this.zoom),r._seaLevelZoom=this._seaLevelZoom,r.angle=this.angle,r._fov=this._fov,r._pitch=this._pitch,r._nearZ=this._nearZ,r._farZ=this._farZ,r._averageElevation=this._averageElevation,r._unmodified=this._unmodified,r._edgeInsets=this._edgeInsets.clone(),r._camera=this._camera.clone(),r._calcMatrices(),r.freezeTileCoverage=this.freezeTileCoverage,r.frustumCorners=this.frustumCorners,r}get elevation(){return this._elevation}set elevation(r){this._elevation!==r&&(this._elevation=r,this._updateCameraOnTerrain(),this._calcMatrices())}updateElevation(r,o=!1){const h=this._elevation&&this._elevation.exaggeration()!==this._centerAltitudeValidForExaggeration;(this._seaLevelZoom==null||h)&&this._updateCameraOnTerrain(),(r||h)&&this._constrainCamera(o),this._calcMatrices()}getProjection(){return a.pick(this.projection,["name","center","parallels"])}setProjection(r){this.projectionOptions=r||{name:"mercator"};const o=this.projection?this.getProjection():void 0;this.projection=a.getProjection(this.projectionOptions);const h=!Se(o,this.getProjection());return h&&this._calcMatrices(),this.mercatorFromTransition=!1,h}setMercatorFromTransition(){const r=this.projection.name;this.mercatorFromTransition=!0,this.projectionOptions={name:"mercator"},this.projection=a.getProjection({name:"mercator"});const o=r!==this.projection.name;return o&&this._calcMatrices(),o}get minZoom(){return this._minZoom}set minZoom(r){this._minZoom!==r&&(this._minZoom=r,this.zoom=Math.max(this.zoom,r))}get maxZoom(){return this._maxZoom}set maxZoom(r){this._maxZoom!==r&&(this._maxZoom=r,this.zoom=Math.min(this.zoom,r))}get minPitch(){return this._minPitch}set minPitch(r){this._minPitch!==r&&(this._minPitch=r,this.pitch=Math.max(this.pitch,r))}get maxPitch(){return this._maxPitch}set maxPitch(r){this._maxPitch!==r&&(this._maxPitch=r,this.pitch=Math.min(this.pitch,r))}get renderWorldCopies(){return this._renderWorldCopies&&this.projection.supportsWorldCopies===!0}set renderWorldCopies(r){r===void 0?r=!0:r===null&&(r=!1),this._renderWorldCopies=r}get worldSize(){return this.tileSize*this.scale}get cameraWorldSizeForFog(){const r=Math.max(this._camera.getDistanceToElevation(this._averageElevation),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(r))}get cameraWorldSize(){const r=Math.max(this._camera.getDistanceToElevation(this._averageElevation,!0),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(r))}get pixelsPerMeter(){return this.projection.pixelsPerMeter(this.center.lat,this.worldSize)}get cameraPixelsPerMeter(){return a.mercatorZfromAltitude(this.center.lat,this.cameraWorldSizeForFog)}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new a.Point(this.width,this.height)}get bearing(){return a.wrap(this.rotation,-180,180)}set bearing(r){this.rotation=r}get rotation(){return-this.angle/Math.PI*180}set rotation(r){const o=-r*Math.PI/180;var h;this.angle!==o&&(this._unmodified=!1,this.angle=o,this._calcMatrices(),this.rotationMatrix=(h=new a.ARRAY_TYPE(4),a.ARRAY_TYPE!=Float32Array&&(h[1]=0,h[2]=0),h[0]=1,h[3]=1,h),function(d,f,g){var y=f[0],v=f[1],E=f[2],T=f[3],A=Math.sin(g),k=Math.cos(g);d[0]=y*k+E*A,d[1]=v*k+T*A,d[2]=y*-A+E*k,d[3]=v*-A+T*k}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(r){const o=a.clamp(r,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==o&&(this._unmodified=!1,this._pitch=o,this._calcMatrices())}get aspect(){return this.width/this.height}get fov(){return this._fov/Math.PI*180}get fovX(){return this._fov}get fovY(){const r=1/Math.tan(.5*this.fovX);return 2*Math.atan(1/this.aspect/r)}set fov(r){r=Math.max(.01,Math.min(60,r)),this._fov!==r&&(this._unmodified=!1,this._fov=a.degToRad(r),this._calcMatrices())}get averageElevation(){return this._averageElevation}set averageElevation(r){this._averageElevation=r,this._calcFogMatrices(),this._distanceTileDataCache={}}get zoom(){return this._zoom}set zoom(r){const o=Math.min(Math.max(r,this.minZoom),this.maxZoom);this._zoom!==o&&(this._unmodified=!1,this._setZoom(o),this._updateSeaLevelZoom(),this._constrain(),this._calcMatrices())}_setZoom(r){this._zoom=r,this.scale=this.zoomScale(r),this.tileZoom=Math.floor(r),this.zoomFraction=r-this.tileZoom}_updateCameraOnTerrain(){if(!this._elevation||!this._elevation.isDataAvailableAtPoint(this.locationCoordinate(this.center)))return this._centerAltitude=0,this._seaLevelZoom=null,void(this._centerAltitudeValidForExaggeration=void 0);const r=this._elevation;this._centerAltitude=r.getAtPointOrZero(this.locationCoordinate(this.center)),this._centerAltitudeValidForExaggeration=r.exaggeration(),this._updateSeaLevelZoom()}_updateSeaLevelZoom(){this._centerAltitudeValidForExaggeration!==void 0&&(this._seaLevelZoom=this._zoomFromMercatorZ((this.pixelsPerMeter*this._centerAltitude+this.cameraToCenterDistance)/this.worldSize))}sampleAverageElevation(){if(!this._elevation)return 0;const r=this._elevation,o=[[.5,.2],[.3,.5],[.5,.5],[.7,.5],[.5,.8]],h=this.horizonLineFromTop();let d=0,f=0;for(let g=0;gr.maxzoom&&(o=r.maxzoom);const g=this.locationCoordinate(this.center),y=this.center.lat,v=1<{const Me=new a.MercatorCoordinate(ae.x+25e-6,ae.y,ae.z),ve=new a.MercatorCoordinate(ae.x,ae.y+25e-6,ae.z),Ae=ae.toLngLat(),Ge=Me.toLngLat(),Xe=ve.toLngLat(),Ve=this.locationCoordinate(Ae),qe=this.locationCoordinate(Ge),lt=this.locationCoordinate(Xe),ot=Math.hypot(qe.x-Ve.x,qe.y-Ve.y),je=Math.hypot(lt.x-Ve.x,lt.y-Ve.y);return Math.sqrt(ot*je)*K/25e-6},Y=ae=>{const _e=N,Me=j;return{aabb:a.tileAABB(this,v,0,0,0,ae,Me,_e,this.projection),zoom:0,x:0,y:0,minZ:Me,maxZ:_e,wrap:ae,fullyVisible:!1}},ie=[];let te=[];const le=o,Te=r.reparseOverscaled?h:o,oe=ae=>ae*ae,ge=oe((B-this._centerAltitude)*O),he=ae=>{if(!this._elevation||!ae.tileID||!f)return;const _e=this._elevation.getMinMaxForTile(ae.tileID),Me=ae.aabb;_e?(Me.min[2]=_e.min,Me.max[2]=_e.max,Me.center[2]=(Me.min[2]+Me.max[2])/2):(ae.shouldSplit=we(ae),ae.shouldSplit||(Me.min[2]=Me.max[2]=Me.center[2]=this._centerAltitude))},we=ae=>{if(ae.zoom=.9)return!0}else if(d&&(ve=oe(ae.aabb.distanceZ(F)*O)),this.projection.isReprojectedInTileSpace&&h<=5){const Ve=Math.pow(2,ae.zoom),qe=J(new a.MercatorCoordinate((ae.x+.5)/Ve,(ae.y+.5)/Ve));Ae=qe>.85?1:qe}const Ge=_e*_e+Me*Me+ve,Xe=oe((1<{if(qe*oe(.707)0;){const ae=ie.pop(),_e=ae.x,Me=ae.y;let ve=ae.fullyVisible;if(!ve){const Ae=ae.aabb.intersects(k);if(Ae===0)continue;ve=Ae===2}if(ae.zoom!==le&&we(ae))for(let Ae=0;Ae<4;Ae++){const Ge=(_e<<1)+Ae%2,Xe=(Me<<1)+(Ae>>1),Ve={aabb:f?ae.aabb.quadrant(Ae):a.tileAABB(this,v,ae.zoom+1,Ge,Xe,ae.wrap,ae.minZ,ae.maxZ,this.projection),zoom:ae.zoom+1,x:Ge,y:Xe,wrap:ae.wrap,fullyVisible:ve,tileID:void 0,shouldSplit:void 0,minZ:ae.minZ,maxZ:ae.maxZ};d&&!T&&(Ve.tileID=new a.OverscaledTileID(ae.zoom+1===le?Te:ae.zoom+1,ae.wrap,ae.zoom+1,Ge,Xe),he(Ve)),ie.push(Ve)}else{const Ae=ae.zoom===le?Te:ae.zoom;if(r.minzoom&&r.minzoom>Ae)continue;const Ge=E[0]-(.5+_e+(ae.wrap<{const ve=[0,0,0,1],Ae=[a.EXTENT,a.EXTENT,0,1],Ge=this.calculateFogTileMatrix(Me.tileID.toUnwrapped());a.transformMat4$1(ve,ve,Ge),a.transformMat4$1(Ae,Ae,Ge);const Xe=a.getAABBPointSquareDist(ve,Ae);if(Xe===0)return!0;let Ve=!1;const qe=this._elevation;if(qe&&Xe>ae&&_e!==0){const lt=this.calculateProjMatrix(Me.tileID.toUnwrapped());let ot;r.isTerrainDEM||(ot=qe.getMinMaxForTile(Me.tileID)),ot||(ot={min:j,max:N});const je=a.furthestTileCorner(this.rotation),wt=[je[0]*a.EXTENT,je[1]*a.EXTENT,ot.max];a.transformMat4(wt,wt,lt),Ve=(1-wt[1])*this.height*.5<_e}return Xeae.distanceSq-_e.distanceSq).map(ae=>ae.tileID)}resize(r,o){this.width=r,this.height=o,this.pixelsToGLUnits=[2/r,-2/o],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(r){return Math.pow(2,r)}scaleZoom(r){return Math.log(r)/Math.LN2}project(r){const o=a.clamp(r.lat,-a.MAX_MERCATOR_LATITUDE,a.MAX_MERCATOR_LATITUDE),h=this.projection.project(r.lng,o);return new a.Point(h.x*this.worldSize,h.y*this.worldSize)}unproject(r){return this.projection.unproject(r.x/this.worldSize,r.y/this.worldSize)}get point(){return this.project(this.center)}get pointMerc(){return this.point._div(this.worldSize)}get pixelsPerMeterRatio(){return this.pixelsPerMeter/a.mercatorZfromAltitude(1,this.center.lat)/this.worldSize}setLocationAtPoint(r,o){let h,d;const f=this.centerPoint;if(this.projection.name==="globe"){const y=this.worldSize;h=(o.x-f.x)/y,d=(o.y-f.y)/y}else{const y=this.pointCoordinate(o),v=this.pointCoordinate(f);h=y.x-v.x,d=y.y-v.y}const g=this.locationCoordinate(r);this.setLocation(new a.MercatorCoordinate(g.x-h,g.y-d))}setLocation(r){this.center=this.coordinateLocation(r),this.projection.wrap&&(this.center=this.center.wrap())}locationPoint(r){return this.projection.locationPoint(this,r)}locationPoint3D(r){return this.projection.locationPoint(this,r,!0)}pointLocation(r){return this.coordinateLocation(this.pointCoordinate(r))}pointLocation3D(r){return this.coordinateLocation(this.pointCoordinate3D(r))}locationCoordinate(r,o){const h=o?a.mercatorZfromAltitude(o,r.lat):void 0,d=this.projection.project(r.lng,r.lat);return new a.MercatorCoordinate(d.x,d.y,h)}coordinateLocation(r){return this.projection.unproject(r.x,r.y)}pointRayIntersection(r,o){const h=o??this._centerAltitude,d=[r.x,r.y,0,1],f=[r.x,r.y,1,1];a.transformMat4$1(d,d,this.pixelMatrixInverse),a.transformMat4$1(f,f,this.pixelMatrixInverse);const g=f[3];a.scale$1(d,d,1/d[3]),a.scale$1(f,f,1/g);const y=d[2],v=f[2];return{p0:d,p1:f,t:y===v?0:(h-y)/(v-y)}}screenPointToMercatorRay(r){const o=[r.x,r.y,0,1],h=[r.x,r.y,1,1];return a.transformMat4$1(o,o,this.pixelMatrixInverse),a.transformMat4$1(h,h,this.pixelMatrixInverse),a.scale$1(o,o,1/o[3]),a.scale$1(h,h,1/h[3]),o[2]=a.mercatorZfromAltitude(o[2],this._center.lat)*this.worldSize,h[2]=a.mercatorZfromAltitude(h[2],this._center.lat)*this.worldSize,a.scale$1(o,o,1/this.worldSize),a.scale$1(h,h,1/this.worldSize),new a.Ray([o[0],o[1],o[2]],a.normalize([],a.sub([],h,o)))}rayIntersectionCoordinate(r){const{p0:o,p1:h,t:d}=r,f=a.mercatorZfromAltitude(o[2],this._center.lat),g=a.mercatorZfromAltitude(h[2],this._center.lat);return new a.MercatorCoordinate(a.number(o[0],h[0],d)/this.worldSize,a.number(o[1],h[1],d)/this.worldSize,a.number(f,g,d))}pointCoordinate(r,o=this._centerAltitude){return this.projection.pointCoordinate(this,r.x,r.y,o)}pointCoordinate3D(r){if(!this.elevation)return this.pointCoordinate(r);let o=this.projection.pointCoordinate3D(this,r.x,r.y);if(o)return new a.MercatorCoordinate(o[0],o[1],o[2]);let h=0,d=this.horizonLineFromTop();if(r.y>d)return this.pointCoordinate(r);const f=.02*d,g=r.clone();for(let y=0;y<10&&d-h>f;y++){g.y=a.number(h,d,.66);const v=this.projection.pointCoordinate3D(this,g.x,g.y);v?(d=g.y,o=v):h=g.y}return o?new a.MercatorCoordinate(o[0],o[1],o[2]):this.pointCoordinate(r)}isPointAboveHorizon(r){return this.projection.isPointAboveHorizon(this,r)}isPointOnSurface(r){if(r.y<0||r.y>this.height||r.x<0||r.x>this.width)return!1;if(this.elevation||this.zoom>=a.GLOBE_ZOOM_THRESHOLD_MAX)return!this.isPointAboveHorizon(r);const o=this.pointCoordinate(r);return o.y>=0&&o.y<=1}_coordinatePoint(r,o){const h=o&&this.elevation?this.elevation.getAtPointOrZero(r,this._centerAltitude):this._centerAltitude,d=[r.x*this.worldSize,r.y*this.worldSize,h+r.toAltitude(),1];return a.transformMat4$1(d,d,this.pixelMatrix),d[3]>0?new a.Point(d[0]/d[3],d[1]/d[3]):new a.Point(Number.MAX_VALUE,Number.MAX_VALUE)}_getBoundsNonRectangular(){const{top:r,left:o}=this._edgeInsets,h=this.height-this._edgeInsets.bottom,d=this.width-this._edgeInsets.right,f=this.pointLocation3D(new a.Point(o,r)),g=this.pointLocation3D(new a.Point(d,r)),y=this.pointLocation3D(new a.Point(d,h)),v=this.pointLocation3D(new a.Point(o,h));let E=Math.min(f.lng,g.lng,y.lng,v.lng),T=Math.max(f.lng,g.lng,y.lng,v.lng),A=Math.min(f.lat,g.lat,y.lat,v.lat),k=Math.max(f.lat,g.lat,y.lat,v.lat);const R=Math.pow(2,-this.zoom)/16*270,O=this.projection.name==="globe"?1:4,B=(F,I,L,N,j)=>{const K=(F+L)/2,J=(I+N)/2,Y=new a.Point(K,J),{lng:ie,lat:te}=this.pointLocation3D(Y),le=Math.max(0,E-ie,A-te,ie-T,te-k);E=Math.min(E,ie),T=Math.max(T,ie),A=Math.min(A,te),k=Math.max(k,te),(jR)&&(B(F,I,K,J,j+1),B(K,J,L,N,j+1))};if(B(o,r,d,r,1),B(d,r,d,h,1),B(d,h,o,h,1),B(o,h,o,r,1),this.projection.name==="globe"){const[F,I]=a.polesInViewport(this);F?(k=90,T=180,E=-180):I&&(A=-90,T=180,E=-180)}return new a.LngLatBounds(new a.LngLat(E,A),new a.LngLat(T,k))}_getBoundsRectangular(r,o){const{top:h,left:d}=this._edgeInsets,f=this.height-this._edgeInsets.bottom,g=this.width-this._edgeInsets.right,y=new a.Point(d,h),v=new a.Point(g,h),E=new a.Point(g,f),T=new a.Point(d,f);let A=this.pointCoordinate(y,r),k=this.pointCoordinate(v,r);const R=this.pointCoordinate(E,o),O=this.pointCoordinate(T,o),B=(F,I)=>(I.y-F.y)/(I.x-F.x);return A.y>1&&k.y>=0?A=new a.MercatorCoordinate((1-O.y)/B(O,A)+O.x,1):A.y<0&&k.y<=1&&(A=new a.MercatorCoordinate(-O.y/B(O,A)+O.x,0)),k.y>1&&A.y>=0?k=new a.MercatorCoordinate((1-R.y)/B(R,k)+R.x,1):k.y<0&&A.y<=1&&(k=new a.MercatorCoordinate(-R.y/B(R,k)+R.x,0)),new a.LngLatBounds().extend(this.coordinateLocation(A)).extend(this.coordinateLocation(k)).extend(this.coordinateLocation(O)).extend(this.coordinateLocation(R))}_getBoundsRectangularTerrain(){const r=this.elevation;if(!r.visibleDemTiles.length||r.isUsingMockSource())return this._getBoundsRectangular(0,0);const o=r.visibleDemTiles.reduce((h,d)=>{if(d.dem){const f=d.dem.tree;h.min=Math.min(h.min,f.minimums[0]),h.max=Math.max(h.max,f.maximums[0])}return h},{min:Number.MAX_VALUE,max:0});return this._getBoundsRectangular(o.min*r.exaggeration(),o.max*r.exaggeration())}getBounds(){return this.projection.name==="mercator"||this.projection.name==="equirectangular"?this._terrainEnabled()?this._getBoundsRectangularTerrain():this._getBoundsRectangular(0,0):this._getBoundsNonRectangular()}horizonLineFromTop(r=!0){const o=this.height/2/Math.tan(this._fov/2)/Math.tan(Math.max(this._pitch,.1))+this.centerOffset.y,h=this.height/2-o*(1-this._horizonShift);return r?Math.max(0,h):h}getMaxBounds(){return this.maxBounds}setMaxBounds(r){this.maxBounds=r,this.minLat=-a.MAX_MERCATOR_LATITUDE,this.maxLat=a.MAX_MERCATOR_LATITUDE,this.minLng=-180,this.maxLng=180,r&&(this.minLat=r.getSouth(),this.maxLat=r.getNorth(),this.minLng=r.getWest(),this.maxLng=r.getEast(),this.maxLngA&&(y=A-E),A-TR&&(g=R-v),R-k.5?N-1:N,j>.5?j-1:j,0]),this.alignedProjMatrix=K,y=a.create(),a.scale(y,y,[this.width/2,-this.height/2,1]),a.translate(y,y,[1,-1,0]),this.labelPlaneMatrix=y,y=a.create(),a.scale(y,y,[1,-1,1]),a.translate(y,y,[-1,-1,0]),a.scale(y,y,[2/this.width,2/this.height,1]),this.glCoordMatrix=y,this.pixelMatrix=a.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),this._calcFogMatrices(),this._distanceTileDataCache={},y=a.invert(new Float64Array(16),this.pixelMatrix),!y)throw new Error("failed to invert matrix");if(this.pixelMatrixInverse=y,this.projection.name==="globe"||this.mercatorFromTransition){this.globeMatrix=a.calculateGlobeMatrix(this);const J=[this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]];this.globeCenterInViewSpace=a.transformMat4(J,J,f),this.globeRadius=this.worldSize/2/Math.PI-1}else this.globeMatrix=y;this._projMatrixCache={},this._alignedProjMatrixCache={},this._pixelsToTileUnitsCache={}}_calcFogMatrices(){this._fogTileMatrixCache={};const r=this.cameraWorldSizeForFog,o=this.cameraPixelsPerMeter,h=this._camera.position,d=1/this.height/this._pixelsPerMercatorPixel,f=[r,r,o];a.scale$2(f,f,d),a.scale$2(h,h,-1),a.multiply$2(h,h,f);const g=a.create();a.translate(g,g,h),a.scale(g,g,f),this.mercatorFogMatrix=g,this.worldToFogMatrix=this._camera.getWorldToCameraPosition(r,o,d)}_computeCameraPosition(r){const o=(r=r||this.pixelsPerMeter)/this.pixelsPerMeter,h=this._camera.forward(),d=this.point,f=this._mercatorZfromZoom(this._seaLevelZoom?this._seaLevelZoom:this._zoom)*o-r/this.worldSize*this._centerAltitude;return[d.x/this.worldSize-h[0]*f,d.y/this.worldSize-h[1]*f,r/this.worldSize*this._centerAltitude-h[2]*f]}_updateCameraState(){this.height&&(this._camera.setPitchBearing(this._pitch,this.angle),this._camera.position=this._computeCameraPosition())}_translateCameraConstrained(r){const o=this._maxCameraBoundsDistance()*Math.cos(this._pitch),h=this._camera.position[2],d=r[2];let f=1;this.projection.wrap&&(this.center=this.center.wrap()),d>0&&(f=Math.min((o-h)/d,1)),this._camera.position=a.scaleAndAdd([],this._camera.position,r,f),this._updateStateFromCamera()}_updateStateFromCamera(){const r=this._camera.position,o=this._camera.forward(),{pitch:h,bearing:d}=this._camera.getPitchBearing(),f=a.mercatorZfromAltitude(this._centerAltitude,this.center.lat)*this._pixelsPerMercatorPixel,g=this._mercatorZfromZoom(this._maxZoom)*Math.cos(a.degToRad(this._maxPitch)),y=Math.max((r[2]-f)/Math.cos(h),g),v=this._zoomFromMercatorZ(y);a.scaleAndAdd(r,r,o,y),this._pitch=a.clamp(h,a.degToRad(this.minPitch),a.degToRad(this.maxPitch)),this.angle=a.wrap(d,-Math.PI,Math.PI),this._setZoom(a.clamp(v,this._minZoom,this._maxZoom)),this._updateSeaLevelZoom(),this._center=this.coordinateLocation(new a.MercatorCoordinate(r[0],r[1],r[2])),this._unmodified=!1,this._constrain(),this._calcMatrices()}_worldSizeFromZoom(r){return Math.pow(2,r)*this.tileSize}_mercatorZfromZoom(r){return this.cameraToCenterDistance/this._worldSizeFromZoom(r)}_minimumHeightOverTerrain(){const r=Math.min((this._seaLevelZoom!=null?this._seaLevelZoom:this._zoom)+4,this._maxZoom);return this._mercatorZfromZoom(r)}_zoomFromMercatorZ(r){return this.scaleZoom(this.cameraToCenterDistance/(r*this.tileSize))}zoomFromMercatorZAdjusted(r){let o=0,h=a.GLOBE_ZOOM_THRESHOLD_MAX,d=0,f=1/0;for(;h-o>1e-6&&h>o;){const g=o+.5*(h-o),y=this.tileSize*Math.pow(2,g),v=this.getCameraToCenterDistance(this.projection,g,y),E=this.scaleZoom(v/(r*this.tileSize)),T=Math.abs(g-E);TE||k.y>1)return!0}return!1}isHorizonVisible(){return this.pitch+a.radToDeg(this.fovAboveCenter)>88||this.anyCornerOffEdge(new a.Point(0,0),new a.Point(this.width,this.height))}zoomDeltaToMovement(r,o){const h=a.length(a.sub([],this._camera.position,r)),d=this._zoomFromMercatorZ(h)+o;return h-this._mercatorZfromZoom(d)}getCameraPoint(){if(this.projection.name==="globe"){const r=function([o,h,d],f){const g=[o,h,d,1];a.transformMat4$1(g,g,f);const y=g[3]=Math.max(g[3],1e-6);return g[0]/=y,g[1]/=y,g[2]/=y,g}([this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]],this.pixelMatrix);return new a.Point(r[0],r[1])}{const r=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new a.Point(0,r))}}getCameraToCenterDistance(r,o=this.zoom,h=this.worldSize){const d=Gs(r,o,this.width,this.height,1024),f=r.pixelSpaceConversion(this.center.lat,h,d);return .5/Math.tan(.5*this._fov)*this.height*f}getWorldToCameraMatrix(){const r=this._camera.getWorldToCamera(this.worldSize,this.projection.zAxisUnit==="meters"?this.pixelsPerMeter:1);return this.projection.name==="globe"&&a.multiply(r,r,this.globeMatrix),r}}function oo(l,r){let o=!1,h=null;const d=()=>{h=null,o&&(l(),h=setTimeout(d,r),o=!1)};return()=>(o=!0,h||d(),h)}class rl{constructor(r){this._hashName=r&&encodeURIComponent(r),a.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=oo(this._updateHashUnthrottled.bind(this),300)}addTo(r){return this._map=r,a.window.addEventListener("hashchange",this._onHashChange,!1),r.on("moveend",this._updateHash),this}remove(){return this._map?(this._map.off("moveend",this._updateHash),a.window.removeEventListener("hashchange",this._onHashChange,!1),clearTimeout(this._updateHash()),this._map=void 0,this):this}getHashString(){const r=this._map;if(!r)return"";const o=Ho(r);if(this._hashName){const h=this._hashName;let d=!1;const f=a.window.location.hash.slice(1).split("&").map(g=>{const y=g.split("=")[0];return y===h?(d=!0,`${y}=${o}`):g}).filter(g=>g);return d||f.push(`${h}=${o}`),`#${f.join("&")}`}return`#${o}`}_getCurrentHash(){const r=a.window.location.hash.replace("#","");if(this._hashName){let o;return r.split("&").map(h=>h.split("=")).forEach(h=>{h[0]===this._hashName&&(o=h)}),(o&&o[1]||"").split("/")}return r.split("/")}_onHashChange(){const r=this._map;if(!r)return!1;const o=this._getCurrentHash();if(o.length>=3&&!o.some(h=>isNaN(h))){const h=r.dragRotate.isEnabled()&&r.touchZoomRotate.isEnabled()?+(o[3]||0):r.getBearing();return r.jumpTo({center:[+o[2],+o[1]],zoom:+o[0],bearing:h,pitch:+(o[4]||0)}),!0}return!1}_updateHashUnthrottled(){const r=a.window.location.href.replace(/(#.+)?$/,this.getHashString());a.window.history.replaceState(a.window.history.state,null,r)}}function Ho(l,r){const o=l.getCenter(),h=Math.round(100*l.getZoom())/100,d=Math.ceil((h*Math.LN2+Math.log(512/360/.5))/Math.LN10),f=Math.pow(10,d),g=Math.round(o.lng*f)/f,y=Math.round(o.lat*f)/f,v=l.getBearing(),E=l.getPitch();let T=r?`/${g}/${y}/${h}`:`${h}/${y}/${g}`;return(v||E)&&(T+="/"+Math.round(10*v)/10),E&&(T+=`/${Math.round(E)}`),T}const Ko={linearity:.3,easing:a.bezier(0,0,.3,1)},Zs=a.extend({deceleration:2500,maxSpeed:1400},Ko),qs=a.extend({deceleration:20,maxSpeed:1400},Ko),Fe=a.extend({deceleration:1e3,maxSpeed:360},Ko),tr=a.extend({deceleration:1e3,maxSpeed:90},Ko);class Ac{constructor(r){this._map=r,this.clear()}clear(){this._inertiaBuffer=[]}record(r){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:a.exported.now(),settings:r})}_drainInertiaBuffer(){const r=this._inertiaBuffer,o=a.exported.now();for(;r.length>0&&o-r[0].time>160;)r.shift()}_onMoveEnd(r){if(this._map._prefersReducedMotion()||(this._drainInertiaBuffer(),this._inertiaBuffer.length<2))return;const o={zoom:0,bearing:0,pitch:0,pan:new a.Point(0,0),pinchAround:void 0,around:void 0};for(const{settings:f}of this._inertiaBuffer)o.zoom+=f.zoomDelta||0,o.bearing+=f.bearingDelta||0,o.pitch+=f.pitchDelta||0,f.panDelta&&o.pan._add(f.panDelta),f.around&&(o.around=f.around),f.pinchAround&&(o.pinchAround=f.pinchAround);const h=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,d={};if(o.pan.mag()){const f=Jo(o.pan.mag(),h,a.extend({},Zs,r||{}));d.offset=o.pan.mult(f.amount/o.pan.mag()),d.center=this._map.transform.center,Yo(d,f)}if(o.zoom){const f=Jo(o.zoom,h,qs);d.zoom=this._map.transform.zoom+f.amount,Yo(d,f)}if(o.bearing){const f=Jo(o.bearing,h,Fe);d.bearing=this._map.transform.bearing+a.clamp(f.amount,-179,179),Yo(d,f)}if(o.pitch){const f=Jo(o.pitch,h,tr);d.pitch=this._map.transform.pitch+f.amount,Yo(d,f)}if(d.zoom||d.bearing){const f=o.pinchAround===void 0?o.around:o.pinchAround;d.around=f?this._map.unproject(f):this._map.getCenter()}return this.clear(),d.noMoveStart=!0,d}}function Yo(l,r){(!l.duration||l.durationo.unproject(v)),y=f.reduce((v,E,T,A)=>v.add(E.div(A.length)),new a.Point(0,0));super(r,{points:f,point:y,lngLats:g,lngLat:o.unproject(y),originalEvent:h}),this._defaultPrevented=!1}}class Ws extends a.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(r,o,h){super(r,{originalEvent:h}),this._defaultPrevented=!1}}class nl{constructor(r,o){this._map=r,this._clickTolerance=o.clickTolerance}reset(){this._mousedownPos=void 0}wheel(r){return this._firePreventable(new Ws(r.type,this._map,r))}mousedown(r,o){return this._mousedownPos=o,this._firePreventable(new hi(r.type,this._map,r))}mouseup(r){this._map.fire(new hi(r.type,this._map,r))}preclick(r){const o=a.extend({},r);o.type="preclick",this._map.fire(new hi(o.type,this._map,o))}click(r,o){this._mousedownPos&&this._mousedownPos.dist(o)>=this._clickTolerance||(this.preclick(r),this._map.fire(new hi(r.type,this._map,r)))}dblclick(r){return this._firePreventable(new hi(r.type,this._map,r))}mouseover(r){this._map.fire(new hi(r.type,this._map,r))}mouseout(r){this._map.fire(new hi(r.type,this._map,r))}touchstart(r){return this._firePreventable(new Qo(r.type,this._map,r))}touchmove(r){this._map.fire(new Qo(r.type,this._map,r))}touchend(r){this._map.fire(new Qo(r.type,this._map,r))}touchcancel(r){this._map.fire(new Qo(r.type,this._map,r))}_firePreventable(r){if(this._map.fire(r),r.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Xs{constructor(r){this._map=r}reset(){this._delayContextMenu=!1,this._contextMenuEvent=void 0}mousemove(r){this._map.fire(new hi(r.type,this._map,r))}mousedown(){this._delayContextMenu=!0}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new hi("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(r){this._delayContextMenu?this._contextMenuEvent=r:this._map.fire(new hi(r.type,this._map,r)),this._map.listens("contextmenu")&&r.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Ic{constructor(r,o){this._map=r,this._el=r.getCanvasContainer(),this._container=r.getContainer(),this._clickTolerance=o.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(r,o){this.isEnabled()&&r.shiftKey&&r.button===0&&(To(),this._startPos=this._lastPos=o,this._active=!0)}mousemoveWindow(r,o){if(!this._active)return;const h=o,d=this._startPos,f=this._lastPos;if(!d||!f||f.equals(h)||!this._box&&h.dist(d){this._box&&(this._box.style.transform=`translate(${g}px,${v}px)`,this._box.style.width=y-g+"px",this._box.style.height=E-v+"px")})}mouseupWindow(r,o){if(!this._active)return;const h=this._startPos,d=o;if(h&&r.button===0){if(this.reset(),Bn(),h.x!==d.x||h.y!==d.y)return this._map.fire(new a.Event("boxzoomend",{originalEvent:r})),{cameraAnimation:f=>f.fitScreenCoordinates(h,d,this._map.getBearing(),{linear:!1})};this._fireEvent("boxzoomcancel",r)}}keydown(r){this._active&&r.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",r))}blur(){this.reset()}reset(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.remove(),this._box=null),Rn(),delete this._startPos,delete this._lastPos}_fireEvent(r,o){return this._map.fire(new a.Event(r,{originalEvent:o}))}}function Hs(l,r){const o={};for(let h=0;hthis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===0&&(this.startTime=r.timeStamp),h.length===this.numTouches&&(this.centroid=function(d){const f=new a.Point(0,0);for(const g of d)f._add(g);return f.div(d.length)}(o),this.touches=Hs(h,o)))}touchmove(r,o,h){if(this.aborted||!this.centroid)return;const d=Hs(h,o);for(const f in this.touches){const g=d[f];(!g||g.dist(this.touches[f])>30)&&(this.aborted=!0)}}touchend(r,o,h){if((!this.centroid||r.timeStamp-this.startTime>500)&&(this.aborted=!0),h.length===0){const d=!this.aborted&&this.centroid;if(this.reset(),d)return d}}}class ol{constructor(r){this.singleTap=new so(r),this.numTaps=r.numTaps,this.reset()}reset(){this.lastTime=1/0,this.lastTap=void 0,this.count=0,this.singleTap.reset()}touchstart(r,o,h){this.singleTap.touchstart(r,o,h)}touchmove(r,o,h){this.singleTap.touchmove(r,o,h)}touchend(r,o,h){const d=this.singleTap.touchend(r,o,h);if(d){const f=r.timeStamp-this.lastTime<500,g=!this.lastTap||this.lastTap.dist(d)<30;if(f&&g||this.reset(),this.count++,this.lastTime=r.timeStamp,this.lastTap=d,this.count===this.numTaps)return this.reset(),d}}}class Nh{constructor(){this._zoomIn=new ol({numTouches:1,numTaps:2}),this._zoomOut=new ol({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(r,o,h){this._zoomIn.touchstart(r,o,h),this._zoomOut.touchstart(r,o,h)}touchmove(r,o,h){this._zoomIn.touchmove(r,o,h),this._zoomOut.touchmove(r,o,h)}touchend(r,o,h){const d=this._zoomIn.touchend(r,o,h),f=this._zoomOut.touchend(r,o,h);return d?(this._active=!0,r.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:g=>g.easeTo({duration:300,zoom:g.getZoom()+1,around:g.unproject(d)},{originalEvent:r})}):f?(this._active=!0,r.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:g=>g.easeTo({duration:300,zoom:g.getZoom()-1,around:g.unproject(f)},{originalEvent:r})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}const Cc={0:1,2:2};class ao{constructor(r){this.reset(),this._clickTolerance=r.clickTolerance||1}blur(){this.reset()}reset(){this._active=!1,this._moved=!1,this._lastPoint=void 0,this._eventButton=void 0}_correctButton(r,o){return!1}_move(r,o){return{}}mousedown(r,o){if(this._lastPoint)return;const h=un(r);this._correctButton(r,h)&&(this._lastPoint=o,this._eventButton=h)}mousemoveWindow(r,o){const h=this._lastPoint;if(h){if(r.preventDefault(),this._eventButton!=null&&function(d,f){const g=Cc[f];return d.buttons===void 0||(d.buttons&g)!==g}(r,this._eventButton))this.reset();else if(this._moved||!(o.dist(h)0&&(this._active=!0);const d=Hs(h,o),f=new a.Point(0,0),g=new a.Point(0,0);let y=0;for(const E in d){const T=d[E],A=this._touches[E];A&&(f._add(T),g._add(T.sub(A)),y++,d[E]=T)}if(this._touches=d,y{this._alertContainer.classList.remove("mapboxgl-touch-pan-blocker-show"),this._alertContainer.setAttribute("role","null")},500)}}class es{constructor(){this.reset()}reset(){this._active=!1,this._firstTwoTouches=void 0}_start(r){}_move(r,o,h){return{}}touchstart(r,o,h){this._firstTwoTouches||h.length<2||(this._firstTwoTouches=[h[0].identifier,h[1].identifier],this._start([o[0],o[1]]))}touchmove(r,o,h){const d=this._firstTwoTouches;if(!d)return;r.preventDefault();const[f,g]=d,y=ts(h,o,f),v=ts(h,o,g);if(!y||!v)return;const E=this._aroundCenter?null:y.add(v).div(2);return this._move([y,v],E,r)}touchend(r,o,h){if(!this._firstTwoTouches)return;const[d,f]=this._firstTwoTouches,g=ts(h,o,d),y=ts(h,o,f);g&&y||(this._active&&Bn(),this.reset())}touchcancel(){this.reset()}enable(r){this._enabled=!0,this._aroundCenter=!!r&&r.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function ts(l,r,o){for(let h=0;hMath.abs(l.x)}class kc extends es{constructor(r){super(),this._map=r}reset(){super.reset(),this._valid=void 0,this._firstMove=void 0,this._lastPoints=void 0}_start(r){this._lastPoints=r,Yr(r[0].sub(r[1]))&&(this._valid=!1)}_move(r,o,h){const d=this._lastPoints;if(!d)return;const f=r[0].sub(d[0]),g=r[1].sub(d[1]);return this._map._cooperativeGestures&&!a.isFullscreen()&&h.touches.length<3||(this._valid=this.gestureBeginsVertically(f,g,h.timeStamp),!this._valid)?void 0:(this._lastPoints=r,this._active=!0,{pitchDelta:(f.y+g.y)/2*-.5})}gestureBeginsVertically(r,o,h){if(this._valid!==void 0)return this._valid;const d=r.mag()>=2,f=o.mag()>=2;if(!d&&!f)return;if(!d||!f)return this._firstMove==null&&(this._firstMove=h),h-this._firstMove<100&&void 0;const g=r.y>0==o.y>0;return Yr(r)&&Yr(o)&&g}}const Dc={panStep:100,bearingStep:15,pitchStep:10};class jh{constructor(){const r=Dc;this._panStep=r.panStep,this._bearingStep=r.bearingStep,this._pitchStep=r.pitchStep,this._rotationDisabled=!1}blur(){this.reset()}reset(){this._active=!1}keydown(r){if(r.altKey||r.ctrlKey||r.metaKey)return;let o=0,h=0,d=0,f=0,g=0;switch(r.keyCode){case 61:case 107:case 171:case 187:o=1;break;case 189:case 109:case 173:o=-1;break;case 37:r.shiftKey?h=-1:(r.preventDefault(),f=-1);break;case 39:r.shiftKey?h=1:(r.preventDefault(),f=1);break;case 38:r.shiftKey?d=1:(r.preventDefault(),g=-1);break;case 40:r.shiftKey?d=-1:(r.preventDefault(),g=1);break;default:return}return this._rotationDisabled&&(h=0,d=0),{cameraAnimation:y=>{const v=y.getZoom();y.easeTo({duration:300,easeId:"keyboardHandler",easing:Lc,zoom:o?Math.round(v)+o*(r.shiftKey?2:1):v,bearing:y.getBearing()+h*this._bearingStep,pitch:y.getPitch()+d*this._pitchStep,offset:[-f*this._panStep,-g*this._panStep],center:y.getCenter()},{originalEvent:r})}}}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 Lc(l){return l*(2-l)}const ul=4.000244140625;class Rc{constructor(r,o){this._map=r,this._el=r.getCanvasContainer(),this._handler=o,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,a.bindAll(["_onTimeout","_addScrollZoomBlocker","_showBlockerAlert"],this)}setZoomRate(r){this._defaultZoomRate=r}setWheelZoomRate(r){this._wheelZoomRate=r}isEnabled(){return!!this._enabled}isActive(){return this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(r){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!r&&r.around==="center",this._map._cooperativeGestures&&this._addScrollZoomBlocker())}disable(){this.isEnabled()&&(this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove()))}wheel(r){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!(r.ctrlKey||r.metaKey||this.isZooming()||a.isFullscreen()))return void this._showBlockerAlert();this._alertContainer.style.visibility!=="hidden"&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}let o=r.deltaMode===a.window.WheelEvent.DOM_DELTA_LINE?40*r.deltaY:r.deltaY;const h=a.exported.now(),d=h-(this._lastWheelEventTime||0);this._lastWheelEventTime=h,o!==0&&o%ul==0?this._type="wheel":o!==0&&Math.abs(o)<4?this._type="trackpad":d>400?(this._type=null,this._lastValue=o,this._timeout=setTimeout(this._onTimeout,40,r)):this._type||(this._type=Math.abs(d*o)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,o+=this._lastValue)),r.shiftKey&&o&&(o/=4),this._type&&(this._lastWheelEvent=r,this._delta-=o,this._active||this._start(r)),r.preventDefault()}_onTimeout(r){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(r)}_start(r){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 o=Ji(this._el,r);this._aroundPoint=this._aroundCenter?this._map.transform.centerPoint:o,this._aroundCoord=this._map.transform.pointCoordinate3D(this._aroundPoint),this._targetZoom=void 0,this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const r=this._map.transform;this._type==="wheel"&&r.projection.wrap&&(r._center.lng>=180||r._center.lng<=-180)&&(this._prevEase=null,this._easing=null,this._lastWheelEvent=null,this._lastWheelEventTime=0);const o=()=>r._terrainEnabled()&&this._aroundCoord?r.computeZoomRelativeTo(this._aroundCoord):r.zoom;if(this._delta!==0){const v=this._type==="wheel"&&Math.abs(this._delta)>ul?this._wheelZoomRate:this._defaultZoomRate;let E=2/(1+Math.exp(-Math.abs(this._delta*v)));this._delta<0&&E!==0&&(E=1/E);const T=o(),A=Math.pow(2,T),k=typeof this._targetZoom=="number"?r.zoomScale(this._targetZoom):A;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(k*E))),this._type==="wheel"&&(this._startZoom=T,this._easing=this._smoothOutEasing(200)),this._delta=0}const h=typeof this._targetZoom=="number"?this._targetZoom:o(),d=this._startZoom,f=this._easing;let g,y=!1;if(this._type==="wheel"&&d&&f){const v=Math.min((a.exported.now()-this._lastWheelEventTime)/200,1),E=f(v);g=a.number(d,h,E),v<1?this._frameId||(this._frameId=!0):y=!0}else g=h,y=!0;return this._active=!0,y&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!y,zoomDelta:g-o(),around:this._aroundPoint,aroundCoord:this._aroundCoord,originalEvent:this._lastWheelEvent}}_smoothOutEasing(r){let o=a.ease;if(this._prevEase){const h=this._prevEase,d=(a.exported.now()-h.start)/h.duration,f=h.easing(d+.01)-h.easing(d),g=.27/Math.sqrt(f*f+1e-4)*.01,y=Math.sqrt(.0729-g*g);o=a.bezier(g,y,.25,1)}return this._prevEase={start:a.exported.now(),duration:r,easing:o},o}blur(){this.reset()}reset(){this._active=!1}_addScrollZoomBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=ht("div","mapboxgl-scroll-zoom-blocker",this._map._container),this._alertContainer.textContent=/(Mac|iPad)/i.test(a.window.navigator.userAgent)?this._map._getUIString("ScrollZoomBlocker.CmdMessage"):this._map._getUIString("ScrollZoomBlocker.CtrlMessage"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=setTimeout(()=>{this._alertContainer.classList.remove("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","null")},200)}}class Bc{constructor(r,o){this._clickZoom=r,this._tapZoom=o}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 xi{constructor(){this.reset()}reset(){this._active=!1}blur(){this.reset()}dblclick(r,o){return r.preventDefault(),{cameraAnimation:h=>{h.easeTo({duration:300,zoom:h.getZoom()+(r.shiftKey?-1:1),around:h.unproject(o)},{originalEvent:r})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Gh{constructor(){this._tap=new ol({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,this._swipePoint=void 0,this._swipeTouch=0,this._tapTime=0,this._tap.reset()}touchstart(r,o,h){this._swipePoint||(this._tapTime&&r.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?h.length>0&&(this._swipePoint=o[0],this._swipeTouch=h[0].identifier):this._tap.touchstart(r,o,h))}touchmove(r,o,h){if(this._tapTime){if(this._swipePoint){if(h[0].identifier!==this._swipeTouch)return;const d=o[0],f=d.y-this._swipePoint.y;return this._swipePoint=d,r.preventDefault(),this._active=!0,{zoomDelta:f/128}}}else this._tap.touchmove(r,o,h)}touchend(r,o,h){this._tapTime?this._swipePoint&&h.length===0&&this.reset():this._tap.touchend(r,o,h)&&(this._tapTime=r.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Oc{constructor(r,o,h){this._el=r,this._mousePan=o,this._touchPan=h}enable(r){this._inertiaOptions=r||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class $h{constructor(r,o,h){this._pitchWithRotate=r.pitchWithRotate,this._mouseRotate=o,this._mousePitch=h}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 Zh{constructor(r,o,h,d){this._el=r,this._touchZoom=o,this._touchRotate=h,this._tapDragZoom=d,this._rotationDisabled=!1,this._enabled=!0}enable(r){this._touchZoom.enable(r),this._rotationDisabled||this._touchRotate.enable(r),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-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()}}const $i=l=>l.zoom||l.drag||l.pitch||l.rotate;class Fc extends a.Event{}class qh{constructor(){this.constants=[1,1,.01],this.radius=0}setup(r,o){const h=a.sub([],o,r);this.radius=a.length(h[2]<0?a.div([],h,this.constants):[h[0],h[1],0])}projectRay(r){a.div(r,r,this.constants),a.normalize(r,r),a.mul$1(r,r,this.constants);const o=a.scale$2([],r,this.radius);if(o[2]>0){const h=a.scale$2([],[0,0,1],a.dot(o,[0,0,1])),d=a.scale$2([],a.normalize([],[o[0],o[1],0]),this.radius),f=a.add([],o,a.scale$2([],a.sub([],a.add([],d,h),o),2));o[0]=f[0],o[1]=f[1]}return o}}function ir(l){return l.panDelta&&l.panDelta.mag()||l.zoomDelta||l.bearingDelta||l.pitchDelta}class ur{constructor(r,o){this._map=r,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Ac(r),this._bearingSnap=o.bearingSnap,this._previousActiveHandlers={},this._trackingEllipsoid=new qh,this._dragOrigin=null,this._eventsInProgress={},this._addDefaultHandlers(o),a.bindAll(["handleEvent","handleWindowEvent"],this);const h=this._el;this._listeners=[[h,"touchstart",{passive:!0}],[h,"touchmove",{passive:!1}],[h,"touchend",void 0],[h,"touchcancel",void 0],[h,"mousedown",void 0],[h,"mousemove",void 0],[h,"mouseup",void 0],[a.window.document,"mousemove",{capture:!0}],[a.window.document,"mouseup",void 0],[h,"mouseover",void 0],[h,"mouseout",void 0],[h,"dblclick",void 0],[h,"click",void 0],[h,"keydown",{capture:!1}],[h,"keyup",void 0],[h,"wheel",{passive:!1}],[h,"contextmenu",void 0],[a.window,"blur",void 0]];for(const[d,f,g]of this._listeners)d.addEventListener(f,d===a.window.document?this.handleWindowEvent:this.handleEvent,g)}destroy(){for(const[r,o,h]of this._listeners)r.removeEventListener(o,r===a.window.document?this.handleWindowEvent:this.handleEvent,h)}_addDefaultHandlers(r){const o=this._map,h=o.getCanvasContainer();this._add("mapEvent",new nl(o,r));const d=o.boxZoom=new Ic(o,r);this._add("boxZoom",d);const f=new Nh,g=new xi;o.doubleClickZoom=new Bc(g,f),this._add("tapZoom",f),this._add("clickZoom",g);const y=new Gh;this._add("tapDragZoom",y);const v=o.touchPitch=new kc(o);this._add("touchPitch",v);const E=new al(r),T=new ll(r);o.dragRotate=new $h(r,E,T),this._add("mouseRotate",E,["mousePitch"]),this._add("mousePitch",T,["mouseRotate"]);const A=new sl(r),k=new Ks(o,r);o.dragPan=new Oc(h,A,k),this._add("mousePan",A),this._add("touchPan",k,["touchZoom","touchRotate"]);const R=new Pc,O=new zc;o.touchZoomRotate=new Zh(h,O,R,y),this._add("touchRotate",R,["touchPan","touchZoom"]),this._add("touchZoom",O,["touchPan","touchRotate"]),this._add("blockableMapEvent",new Xs(o));const B=o.scrollZoom=new Rc(o,this);this._add("scrollZoom",B,["mousePan"]);const F=o.keyboard=new jh;this._add("keyboard",F);for(const I of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])r.interactive&&r[I]&&o[I].enable(r[I])}_add(r,o,h){this._handlers.push({handlerName:r,handler:o,allowed:h}),this._handlersById[r]=o}stop(r){if(!this._updatingCamera){for(const{handler:o}of this._handlers)o.reset();this._inertia.clear(),this._fireEvents({},{},r),this._changes=[]}}isActive(){for(const{handler:r}of this._handlers)if(r.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!$i(this._eventsInProgress)||this.isZooming()}_isDragging(){return!!this._eventsInProgress.drag}_blockedByActive(r,o,h){for(const d in r)if(d!==h&&(!o||o.indexOf(d)<0))return!0;return!1}handleWindowEvent(r){this.handleEvent(r,`${r.type}Window`)}_getMapTouches(r){const o=[];for(const h of r)this._el.contains(h.target)&&o.push(h);return o}handleEvent(r,o){this._updatingCamera=!0;const h=r.type==="renderFrame",d=h?void 0:r,f={needsRenderFrame:!1},g={},y={},v=r.touches?this._getMapTouches(r.touches):void 0,E=v?hn(this._el,v):h?void 0:Ji(this._el,r);for(const{handlerName:k,handler:R,allowed:O}of this._handlers){if(!R.isEnabled())continue;let B;this._blockedByActive(y,O,k)?R.reset():R[o||r.type]&&(B=R[o||r.type](r,E,v),this.mergeHandlerResult(f,g,B,k,d),B&&B.needsRenderFrame&&this._triggerRenderFrame()),(B||R.isActive())&&(y[k]=R)}const T={};for(const k in this._previousActiveHandlers)y[k]||(T[k]=d);this._previousActiveHandlers=y,(Object.keys(T).length||ir(f))&&(this._changes.push([f,g,T]),this._triggerRenderFrame()),(Object.keys(y).length||ir(f))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:A}=f;A&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],A(this._map))}mergeHandlerResult(r,o,h,d,f){if(!h)return;a.extend(r,h);const g={handlerName:d,originalEvent:h.originalEvent||f};h.zoomDelta!==void 0&&(o.zoom=g),h.panDelta!==void 0&&(o.drag=g),h.pitchDelta!==void 0&&(o.pitch=g),h.bearingDelta!==void 0&&(o.rotate=g)}_applyChanges(){const r={},o={},h={};for(const[d,f,g]of this._changes)d.panDelta&&(r.panDelta=(r.panDelta||new a.Point(0,0))._add(d.panDelta)),d.zoomDelta&&(r.zoomDelta=(r.zoomDelta||0)+d.zoomDelta),d.bearingDelta&&(r.bearingDelta=(r.bearingDelta||0)+d.bearingDelta),d.pitchDelta&&(r.pitchDelta=(r.pitchDelta||0)+d.pitchDelta),d.around!==void 0&&(r.around=d.around),d.aroundCoord!==void 0&&(r.aroundCoord=d.aroundCoord),d.pinchAround!==void 0&&(r.pinchAround=d.pinchAround),d.noInertia&&(r.noInertia=d.noInertia),a.extend(o,f),a.extend(h,g);this._updateMapTransform(r,o,h),this._changes=[]}_updateMapTransform(r,o,h){const d=this._map,f=d.transform,g=L=>[L.x,L.y,L.z];if((L=>{const N=this._eventsInProgress.drag;return N&&!this._handlersById[N.handlerName].isActive()})()&&!ir(r)){const L=f.zoom;f.cameraElevationReference="sea",f.recenterOnTerrain(),f.cameraElevationReference="ground",L!==f.zoom&&this._map._update(!0)}if(f._isCameraConstrained&&d._stop(!0),!ir(r))return void this._fireEvents(o,h,!0);let{panDelta:y,zoomDelta:v,bearingDelta:E,pitchDelta:T,around:A,aroundCoord:k,pinchAround:R}=r;f._isCameraConstrained&&(v>0&&(v=0),f._isCameraConstrained=!1),R!==void 0&&(A=R),(v||(L=>o[L]&&!this._eventsInProgress[L])("drag"))&&A&&(this._dragOrigin=g(f.pointCoordinate3D(A)),this._trackingEllipsoid.setup(f._camera.position,this._dragOrigin)),f.cameraElevationReference="sea",d._stop(!0),A=A||d.transform.centerPoint,E&&(f.bearing+=E),T&&(f.pitch+=T),f._updateCameraState();const O=[0,0,0];if(y)if(f.projection.name==="mercator"){const L=this._trackingEllipsoid.projectRay(f.screenPointToMercatorRay(A).dir),N=this._trackingEllipsoid.projectRay(f.screenPointToMercatorRay(A.sub(y)).dir);O[0]=N[0]-L[0],O[1]=N[1]-L[1]}else{const L=f.pointCoordinate(A);if(f.projection.name==="globe"){y=y.rotate(-f.angle);const N=f._pixelsPerMercatorPixel/f.worldSize;O[0]=-y.x*a.mercatorScale(a.latFromMercatorY(L.y))*N,O[1]=-y.y*a.mercatorScale(f.center.lat)*N}else{const N=f.pointCoordinate(A.sub(y));L&&N&&(O[0]=N.x-L.x,O[1]=N.y-L.y)}}const B=f.zoom,F=[0,0,0];if(v){const L=g(k||f.pointCoordinate3D(A)),N={dir:a.normalize([],a.sub([],L,f._camera.position))};if(N.dir[2]<0){const j=f.zoomDeltaToMovement(L,v);a.scale$2(F,N.dir,j)}}const I=a.add(O,O,F);f._translateCameraConstrained(I),v&&Math.abs(f.zoom-B)>1e-4&&f.recenterOnTerrain(),f.cameraElevationReference="ground",this._map._update(),r.noInertia||this._inertia.record(r),this._fireEvents(o,h,!0)}_fireEvents(r,o,h){const d=$i(this._eventsInProgress),f=$i(r),g={};for(const T in r){const{originalEvent:A}=r[T];this._eventsInProgress[T]||(g[`${T}start`]=A),this._eventsInProgress[T]=r[T]}!d&&f&&this._fireEvent("movestart",f.originalEvent);for(const T in g)this._fireEvent(T,g[T]);f&&this._fireEvent("move",f.originalEvent);for(const T in r){const{originalEvent:A}=r[T];this._fireEvent(T,A)}const y={};let v;for(const T in this._eventsInProgress){const{handlerName:A,originalEvent:k}=this._eventsInProgress[T];this._handlersById[A].isActive()||(delete this._eventsInProgress[T],v=o[A]||k,y[`${T}end`]=v)}for(const T in y)this._fireEvent(T,y[T]);const E=$i(this._eventsInProgress);if(h&&(d||f)&&!E){this._updatingCamera=!0;const T=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),A=k=>k!==0&&-this._bearingSnap{this._frameId=void 0,this.handleEvent(new Fc("renderFrame",{timeStamp:r})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}const En="map.setFreeCameraOptions(...) and map.getFreeCameraOptions() are not yet supported for non-mercator projections.";class Ys extends a.Evented{constructor(r,o){super(),this._moving=!1,this._zooming=!1,this.transform=r,this._bearingSnap=o.bearingSnap,this._respectPrefersReducedMotion=o.respectPrefersReducedMotion!==!1,a.bindAll(["_renderFrameCallback"],this)}getCenter(){return new a.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(r,o){return this.jumpTo({center:r},o)}panBy(r,o,h){return r=a.Point.convert(r).mult(-1),this.panTo(this.transform.center,a.extend({offset:r},o),h)}panTo(r,o,h){return this.easeTo(a.extend({center:r},o),h)}getZoom(){return this.transform.zoom}setZoom(r,o){return this.jumpTo({zoom:r},o),this}zoomTo(r,o,h){return this.easeTo(a.extend({zoom:r},o),h)}zoomIn(r,o){return this.zoomTo(this.getZoom()+1,r,o),this}zoomOut(r,o){return this.zoomTo(this.getZoom()-1,r,o),this}getBearing(){return this.transform.bearing}setBearing(r,o){return this.jumpTo({bearing:r},o),this}getPadding(){return this.transform.padding}setPadding(r,o){return this.jumpTo({padding:r},o),this}rotateTo(r,o,h){return this.easeTo(a.extend({bearing:r},o),h)}resetNorth(r,o){return this.rotateTo(0,a.extend({duration:1e3},r),o),this}resetNorthPitch(r,o){return this.easeTo(a.extend({bearing:0,pitch:0,duration:1e3},r),o),this}snapToNorth(r,o){return Math.abs(this.getBearing())r.aspect?h/(2*Math.tan(.5*r.fovX)*r.aspect):d/(2*Math.tan(.5*r.fovY)*r.aspect)}_cameraForBoundsOnGlobe(r,o,h,d,f,g){const y=r.clone(),v=this._extendCameraOptions(g);y.bearing=d,y.pitch=f;const E=a.LngLat.convert(o),T=a.LngLat.convert(h),A=.5*(E.lat+T.lat),k=.5*(E.lng+T.lng),R=a.latLngToECEF(A,k),O=a.normalize([],R),B=a.normalize([],a.cross([],O,[0,1,0])),F=a.cross([],B,O),I=[B[0],B[1],B[2],0,F[0],F[1],F[2],0,O[0],O[1],O[2],0,0,0,0,1],L=[R,a.latLngToECEF(E.lat,E.lng),a.latLngToECEF(T.lat,E.lng),a.latLngToECEF(T.lat,T.lng),a.latLngToECEF(E.lat,T.lng),a.latLngToECEF(A,E.lng),a.latLngToECEF(A,T.lng),a.latLngToECEF(E.lat,k),a.latLngToECEF(T.lat,k)];let N=a.Aabb.fromPoints(L.map(ve=>[a.dot(B,ve),a.dot(F,ve),a.dot(O,ve)]));const j=a.transformMat4([],N.center,I);a.squaredLength(j)===0&&a.set(j,0,0,1),a.normalize(j,j),a.scale$2(j,j,a.GLOBE_RADIUS),y.center=a.ecefToLatLng(j);const K=y.getWorldToCameraMatrix(),J=a.invert(new Float64Array(16),K);N=a.Aabb.applyTransform(N,a.multiply([],K,I)),a.transformMat4(j,j,K);const Y=.5*(N.max[2]-N.min[2]),ie=this._minimumAABBFrustumDistance(y,N),te=a.scale$2([],[0,0,1],Y),le=a.add(te,j,te),Te=ie+(y.pitch===0?0:a.distance(j,le)),oe=y.globeCenterInViewSpace,ge=a.sub([],j,[oe[0],oe[1],oe[2]]);a.normalize(ge,ge),a.scale$2(ge,ge,Te);const he=a.add([],j,ge);a.transformMat4(he,he,J);const we=a.earthRadius/a.GLOBE_RADIUS,ae=a.length(he),_e=a.mercatorZfromAltitude(Math.max(ae*we-a.earthRadius,Number.EPSILON),0),Me=Math.min(y.zoomFromMercatorZAdjusted(_e),v.maxZoom);return Me>.5*(a.GLOBE_ZOOM_THRESHOLD_MIN+a.GLOBE_ZOOM_THRESHOLD_MAX)?(y.setProjection({name:"mercator"}),y.zoom=Me,this._cameraForBounds(y,o,h,d,f,g)):{center:y.center,zoom:Me,bearing:d,pitch:f}}queryTerrainElevation(r,o){const h=this.transform.elevation;return h?(o=a.extend({},{exaggerated:!0},o),h.getAtPoint(a.MercatorCoordinate.fromLngLat(r),null,o.exaggerated)):null}_cameraForBounds(r,o,h,d,f,g){if(r.projection.name==="globe")return this._cameraForBoundsOnGlobe(r,o,h,d,f,g);const y=r.clone(),v=this._extendCameraOptions(g),E=y.padding;y.bearing=d,y.pitch=f;const T=a.LngLat.convert(o),A=a.LngLat.convert(h),k=new a.LngLat(T.lng,A.lat),R=new a.LngLat(A.lng,T.lat),O=y.project(T),B=y.project(A),F=this.queryTerrainElevation(T),I=this.queryTerrainElevation(A),L=this.queryTerrainElevation(k),N=this.queryTerrainElevation(R),j=[[O.x,O.y,Math.min(F||0,I||0,L||0,N||0)],[B.x,B.y,Math.max(F||0,I||0,L||0,N||0)]];let K=a.Aabb.fromPoints(j);const J=y.getWorldToCameraMatrix(),Y=a.invert(new Float64Array(16),J);K=a.Aabb.applyTransform(K,J);const ie=a.sub([],K.max,K.min),te=E.left||0,le=E.right||0,Te=E.bottom||0,oe=E.top||0,{left:ge,right:he,top:we,bottom:ae}=v.padding,_e=.5*(te+le),Me=.5*(oe+Te),ve=Math.min(y.scaleZoom(y.scale*Math.min((y.width-(te+le+ge+he))/ie[0],(y.height-(Te+oe+ae+we))/ie[1])),v.maxZoom),Ae=y.scale/y.zoomScale(ve);K=new a.Aabb([K.min[0]-(ge+_e)*Ae,K.min[1]-(ae+Me)*Ae,K.min[2]],[K.max[0]+(he+_e)*Ae,K.max[1]+(we+Me)*Ae,K.max[2]]);const Ge=.5*ie[2],Xe=this._minimumAABBFrustumDistance(y,K),Ve=[0,0,1,0];a.transformMat4$1(Ve,Ve,J),a.normalize$2(Ve,Ve);const qe=a.scale$2([],Ve,Xe+Ge),lt=a.add([],K.center,qe),ot=(typeof v.offset.x=="number"&&typeof v.offset.y=="number"?new a.Point(v.offset.x,v.offset.y):a.Point.convert(v.offset)).rotate(-a.degToRad(d));K.center[0]-=ot.x*Ae,K.center[1]+=ot.y*Ae,a.transformMat4(K.center,K.center,Y),a.transformMat4(lt,lt,Y);const je=[K.center[0],K.center[1],lt[2]*y.pixelsPerMeter];a.scale$2(je,je,1/y.worldSize);const wt=a.lngFromMercatorX(je[0]),Tt=a.latFromMercatorY(je[1]),Et=Math.min(y._zoomFromMercatorZ(je[2]),v.maxZoom),St=new a.LngLat(wt,Tt);return y.mercatorFromTransition&&Et<.5*(a.GLOBE_ZOOM_THRESHOLD_MIN+a.GLOBE_ZOOM_THRESHOLD_MAX)?(y.setProjection({name:"globe"}),y.zoom=Et,this._cameraForBounds(y,o,h,d,f,g)):{center:St,zoom:Et,bearing:d,pitch:f}}fitBounds(r,o,h){const d=this.cameraForBounds(r,o);return this._fitInternal(d,o,h)}fitScreenCoordinates(r,o,h,d,f){const g=a.Point.convert(r),y=a.Point.convert(o),v=new a.Point(Math.min(g.x,y.x),Math.min(g.y,y.y)),E=new a.Point(Math.max(g.x,y.x),Math.max(g.y,y.y));if(this.transform.projection.name==="mercator"&&this.transform.anyCornerOffEdge(g,y))return this;const T=this.transform.pointLocation3D(v),A=this.transform.pointLocation3D(E),k=this.transform.pointLocation3D(new a.Point(v.x,E.y)),R=this.transform.pointLocation3D(new a.Point(E.x,v.y)),O=[Math.min(T.lng,A.lng,k.lng,R.lng),Math.min(T.lat,A.lat,k.lat,R.lat)],B=[Math.max(T.lng,A.lng,k.lng,R.lng),Math.max(T.lat,A.lat,k.lat,R.lat)],F=d&&d.pitch?d.pitch:this.getPitch(),I=this._cameraForBounds(this.transform,O,B,h,F,d);return this._fitInternal(I,d,f)}_fitInternal(r,o,h){return r?(delete(o=a.extend(r,o)).padding,o.linear?this.easeTo(o,h):this.flyTo(o,h)):this}jumpTo(r,o){this.stop();const h=r.preloadOnly?this.transform.clone():this.transform;let d=!1,f=!1,g=!1;return"zoom"in r&&h.zoom!==+r.zoom&&(d=!0,h.zoom=+r.zoom),r.center!==void 0&&(h.center=a.LngLat.convert(r.center)),"bearing"in r&&h.bearing!==+r.bearing&&(f=!0,h.bearing=+r.bearing),"pitch"in r&&h.pitch!==+r.pitch&&(g=!0,h.pitch=+r.pitch),r.padding==null||h.isPaddingEqual(r.padding)||(h.padding=r.padding),r.preloadOnly?(this._preloadTiles(h),this):(this.fire(new a.Event("movestart",o)).fire(new a.Event("move",o)),d&&this.fire(new a.Event("zoomstart",o)).fire(new a.Event("zoom",o)).fire(new a.Event("zoomend",o)),f&&this.fire(new a.Event("rotatestart",o)).fire(new a.Event("rotate",o)).fire(new a.Event("rotateend",o)),g&&this.fire(new a.Event("pitchstart",o)).fire(new a.Event("pitch",o)).fire(new a.Event("pitchend",o)),this.fire(new a.Event("moveend",o)))}getFreeCameraOptions(){return this.transform.projection.supportsFreeCamera||a.warnOnce(En),this.transform.getFreeCameraOptions()}setFreeCameraOptions(r,o){const h=this.transform;if(!h.projection.supportsFreeCamera)return a.warnOnce(En),this;this.stop();const d=h.zoom,f=h.pitch,g=h.bearing;h.setFreeCameraOptions(r);const y=d!==h.zoom,v=f!==h.pitch,E=g!==h.bearing;return this.fire(new a.Event("movestart",o)).fire(new a.Event("move",o)),y&&this.fire(new a.Event("zoomstart",o)).fire(new a.Event("zoom",o)).fire(new a.Event("zoomend",o)),E&&this.fire(new a.Event("rotatestart",o)).fire(new a.Event("rotate",o)).fire(new a.Event("rotateend",o)),v&&this.fire(new a.Event("pitchstart",o)).fire(new a.Event("pitch",o)).fire(new a.Event("pitchend",o)),this.fire(new a.Event("moveend",o)),this}easeTo(r,o){this._stop(!1,r.easeId),((r=a.extend({offset:[0,0],duration:500,easing:a.ease},r)).animate===!1||this._prefersReducedMotion(r))&&(r.duration=0);const h=this.transform,d=this.getZoom(),f=this.getBearing(),g=this.getPitch(),y=this.getPadding(),v="zoom"in r?+r.zoom:d,E="bearing"in r?this._normalizeBearing(r.bearing,f):f,T="pitch"in r?+r.pitch:g,A="padding"in r?r.padding:h.padding,k=a.Point.convert(r.offset);let R,O,B;if(h.projection.name==="globe"){const te=a.MercatorCoordinate.fromLngLat(h.center),le=k.rotate(-h.angle);te.x+=le.x/h.worldSize,te.y+=le.y/h.worldSize;const Te=te.toLngLat(),oe=a.LngLat.convert(r.center||Te);this._normalizeCenter(oe),R=h.centerPoint.add(le),O=new a.Point(te.x,te.y).mult(h.worldSize),B=new a.Point(a.mercatorXfromLng(oe.lng),a.mercatorYfromLat(oe.lat)).mult(h.worldSize).sub(O)}else{R=h.centerPoint.add(k);const te=h.pointLocation(R),le=a.LngLat.convert(r.center||te);this._normalizeCenter(le),O=h.project(te),B=h.project(le).sub(O)}const F=h.zoomScale(v-d);let I,L;r.around&&(I=a.LngLat.convert(r.around),L=h.locationPoint(I));const N=this._zooming||v!==d,j=this._rotating||f!==E,K=this._pitching||T!==g,J=!h.isPaddingEqual(A),Y=te=>le=>{if(N&&(te.zoom=a.number(d,v,le)),j&&(te.bearing=a.number(f,E,le)),K&&(te.pitch=a.number(g,T,le)),J&&(te.interpolatePadding(y,A,le),R=te.centerPoint.add(k)),I)te.setLocationAtPoint(I,L);else{const Te=te.zoomScale(te.zoom-d),oe=v>d?Math.min(2,F):Math.max(.5,F),ge=Math.pow(oe,1-le),he=te.unproject(O.add(B.mult(le*ge)).mult(Te));te.setLocationAtPoint(te.renderWorldCopies?he.wrap():he,R)}return r.preloadOnly||this._fireMoveEvents(o),te};if(r.preloadOnly){const te=this._emulate(Y,r.duration,h);return this._preloadTiles(te),this}const ie={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=N,this._rotating=j,this._pitching=K,this._padding=J,this._easeId=r.easeId,this._prepareEase(o,r.noMoveStart,ie),this._ease(Y(h),te=>{h.recenterOnTerrain(),this._afterEase(o,te)},r),this}_prepareEase(r,o,h={}){this._moving=!0,this.transform.cameraElevationReference="sea",o||h.moving||this.fire(new a.Event("movestart",r)),this._zooming&&!h.zooming&&this.fire(new a.Event("zoomstart",r)),this._rotating&&!h.rotating&&this.fire(new a.Event("rotatestart",r)),this._pitching&&!h.pitching&&this.fire(new a.Event("pitchstart",r))}_fireMoveEvents(r){this.fire(new a.Event("move",r)),this._zooming&&this.fire(new a.Event("zoom",r)),this._rotating&&this.fire(new a.Event("rotate",r)),this._pitching&&this.fire(new a.Event("pitch",r))}_afterEase(r,o){if(this._easeId&&o&&this._easeId===o)return;this._easeId=void 0,this.transform.cameraElevationReference="ground";const h=this._zooming,d=this._rotating,f=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,h&&this.fire(new a.Event("zoomend",r)),d&&this.fire(new a.Event("rotateend",r)),f&&this.fire(new a.Event("pitchend",r)),this.fire(new a.Event("moveend",r))}flyTo(r,o){if(this._prefersReducedMotion(r)){const ve=a.pick(r,["center","zoom","bearing","pitch","around"]);return this.jumpTo(ve,o)}this.stop(),r=a.extend({offset:[0,0],speed:1.2,curve:1.42,easing:a.ease},r);const h=this.transform,d=this.getZoom(),f=this.getBearing(),g=this.getPitch(),y=this.getPadding(),v="zoom"in r?a.clamp(+r.zoom,h.minZoom,h.maxZoom):d,E="bearing"in r?this._normalizeBearing(r.bearing,f):f,T="pitch"in r?+r.pitch:g,A="padding"in r?r.padding:h.padding,k=h.zoomScale(v-d),R=a.Point.convert(r.offset);let O=h.centerPoint.add(R);const B=h.pointLocation(O),F=a.LngLat.convert(r.center||B);this._normalizeCenter(F);const I=h.project(B),L=h.project(F).sub(I);let N=r.curve;const j=Math.max(h.width,h.height),K=j/k,J=L.mag();if("minZoom"in r){const ve=a.clamp(Math.min(r.minZoom,d,v),h.minZoom,h.maxZoom),Ae=j/h.zoomScale(ve-d);N=Math.sqrt(Ae/J*2)}const Y=N*N;function ie(ve){const Ae=(K*K-j*j+(ve?-1:1)*Y*Y*J*J)/(2*(ve?K:j)*Y*J);return Math.log(Math.sqrt(Ae*Ae+1)-Ae)}function te(ve){return(Math.exp(ve)-Math.exp(-ve))/2}function le(ve){return(Math.exp(ve)+Math.exp(-ve))/2}const Te=ie(0);let oe=function(ve){return le(Te)/le(Te+N*ve)},ge=function(ve){return j*((le(Te)*(te(Ae=Te+N*ve)/le(Ae))-te(Te))/Y)/J;var Ae},he=(ie(1)-Te)/N;if(Math.abs(J)<1e-6||!isFinite(he)){if(Math.abs(j-K)<1e-6)return this.easeTo(r,o);const ve=Kr.maxDuration&&(r.duration=0);const we=f!==E,ae=T!==g,_e=!h.isPaddingEqual(A),Me=ve=>Ae=>{const Ge=Ae*he,Xe=1/oe(Ge);ve.zoom=Ae===1?v:d+ve.scaleZoom(Xe),we&&(ve.bearing=a.number(f,E,Ae)),ae&&(ve.pitch=a.number(g,T,Ae)),_e&&(ve.interpolatePadding(y,A,Ae),O=ve.centerPoint.add(R));const Ve=Ae===1?F:ve.unproject(I.add(L.mult(ge(Ge))).mult(Xe));return ve.setLocationAtPoint(ve.renderWorldCopies?Ve.wrap():Ve,O),ve._updateCameraOnTerrain(),r.preloadOnly||this._fireMoveEvents(o),ve};if(r.preloadOnly){const ve=this._emulate(Me,r.duration,h);return this._preloadTiles(ve),this}return this._zooming=!0,this._rotating=we,this._pitching=ae,this._padding=_e,this._prepareEase(o,!1),this._ease(Me(h),()=>this._afterEase(o),r),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(r,o){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),this._easeFrameId=void 0,this._onEaseFrame=void 0),this._onEaseEnd){const h=this._onEaseEnd;this._onEaseEnd=void 0,h.call(this,o)}if(!r){const h=this.handlers;h&&h.stop(!1)}return this}_ease(r,o,h){h.animate===!1||h.duration===0?(r(1),o()):(this._easeStart=a.exported.now(),this._easeOptions=h,this._onEaseFrame=r,this._onEaseEnd=o,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const r=Math.min((a.exported.now()-this._easeStart)/this._easeOptions.duration,1),o=this._onEaseFrame;o&&o(this._easeOptions.easing(r)),r<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(r,o){r=a.wrap(r,-180,180);const h=Math.abs(r-o);return Math.abs(r-360-o)180?-360:h<-180?360:0}_prefersReducedMotion(r){return this._respectPrefersReducedMotion&&a.exported.prefersReducedMotion&&!(r&&r.essential)}_emulate(r,o,h){const d=Math.ceil(15*o/1e3),f=[],g=r(h.clone());for(let y=0;y<=d;y++){const v=g(y/d);f.push(v.clone())}return f}}class Ue{constructor(r={}){this.options=r,a.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)}getDefaultPosition(){return"bottom-right"}onAdd(r){const o=this.options&&this.options.compact;return this._map=r,this._container=ht("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=ht("button","mapboxgl-ctrl-attrib-button",this._container),ht("span","mapboxgl-ctrl-icon",this._compactButton).setAttribute("aria-hidden","true"),this._compactButton.type="button",this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=ht("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),o&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),o===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0}_setElementTitle(r,o){const h=this._map._getUIString(`AttributionControl.${o}`);r.setAttribute("aria-label",h),r.removeAttribute("title"),r.firstElementChild&&r.firstElementChild.setAttribute("title",h)}_toggleAttribution(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","true"))}_updateEditLink(){let r=this._editLink;r||(r=this._editLink=this._container.querySelector(".mapbox-improve-map"));const o=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||a.config.ACCESS_TOKEN}];if(r){const h=o.reduce((d,f,g)=>(f.value&&(d+=`${f.key}=${f.value}${gd.length-f.length),r=r.filter((d,f)=>{for(let g=f+1;g=0)return!1;return!0}),this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?r=[...this.options.customAttribution,...r]:r.unshift(this.options.customAttribution));const h=r.join(" | ");h!==this._attribHTML&&(this._attribHTML=h,r.length?(this._innerContainer.innerHTML=h,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")}}class dl{constructor(){a.bindAll(["_updateLogo","_updateCompact"],this)}onAdd(r){this._map=r,this._container=ht("div","mapboxgl-ctrl");const o=ht("a","mapboxgl-ctrl-logo");return o.target="_blank",o.rel="noopener nofollow",o.href="https://www.mapbox.com/",o.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),o.setAttribute("rel","noopener nofollow"),this._container.appendChild(o),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)}getDefaultPosition(){return"bottom-left"}_updateLogo(r){r&&r.sourceDataType!=="metadata"||(this._container.style.display=this._logoRequired()?"block":"none")}_logoRequired(){if(!this._map.style)return!0;const r=this._map.style._sourceCaches;if(Object.entries(r).length===0)return!0;for(const o in r){const h=r[o].getSource();if(h.hasOwnProperty("mapbox_logo")&&!h.mapbox_logo)return!1}return!0}_updateCompact(){const r=this._container.children;if(r.length){const o=r[0];this._map.getCanvasContainer().offsetWidth<250?o.classList.add("mapboxgl-compact"):o.classList.remove("mapboxgl-compact")}}}class pl{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(r){const o=++this._id;return this._queue.push({callback:r,id:o,cancelled:!1}),o}remove(r){const o=this._currentlyRunning,h=o?this._queue.concat(o):this._queue;for(const d of h)if(d.id===r)return void(d.cancelled=!0)}run(r=0){const o=this._currentlyRunning=this._queue;this._queue=[];for(const h of o)if(!h.cancelled&&(h.callback(r),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}function lo(l,r,o){if(l=new a.LngLat(l.lng,l.lat),r){const h=new a.LngLat(l.lng-360,l.lat),d=new a.LngLat(l.lng+360,l.lat),f=360*Math.ceil(Math.abs(l.lng-o.center.lng)/360),g=o.locationPoint(l).distSqr(r),y=r.x<0||r.y<0||r.x>o.width||r.y>o.height;o.locationPoint(h).distSqr(r)180;){const h=o.locationPoint(l);if(h.x>=0&&h.y>=0&&h.x<=o.width&&h.y<=o.height)break;l.lng>o.center.lng?l.lng-=360:l.lng+=360}return l}const Sn={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%)"};class Be extends a.Evented{constructor(r,o){if(super(),(r instanceof a.window.HTMLElement||o)&&(r=a.extend({element:r},o)),a.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress","_clearFadeTimer"],this),this._anchor=r&&r.anchor||"center",this._color=r&&r.color||"#3FB1CE",this._scale=r&&r.scale||1,this._draggable=r&&r.draggable||!1,this._clickTolerance=r&&r.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=r&&r.rotation||0,this._rotationAlignment=r&&r.rotationAlignment||"auto",this._pitchAlignment=r&&r.pitchAlignment&&r.pitchAlignment||"auto",this._updateMoving=()=>this._update(!0),this._occludedOpacity=r&&r.occludedOpacity||.2,r&&r.element)this._element=r.element,this._offset=a.Point.convert(r&&r.offset||[0,0]);else{this._defaultMarker=!0,this._element=ht("div");const d=41,f=27,g=gi("svg",{display:"block",height:d*this._scale+"px",width:f*this._scale+"px",viewBox:`0 0 ${f} ${d}`},this._element),y=gi("radialGradient",{id:"shadowGradient"},gi("defs",{},g));gi("stop",{offset:"10%","stop-opacity":.4},y),gi("stop",{offset:"100%","stop-opacity":.05},y),gi("ellipse",{cx:13.5,cy:34.8,rx:10.5,ry:5.25,fill:"url(#shadowGradient)"},g),gi("path",{fill:this._color,d:"M27,13.5C27,19.07 20.25,27 14.75,34.5C14.02,35.5 12.98,35.5 12.25,34.5C6.75,27 0,19.22 0,13.5C0,6.04 6.04,0 13.5,0C20.96,0 27,6.04 27,13.5Z"},g),gi("path",{opacity:.25,d:"M13.5,0C6.04,0 0,6.04 0,13.5C0,19.22 6.75,27 12.25,34.5C13,35.52 14.02,35.5 14.75,34.5C20.25,27 27,19.07 27,13.5C27,6.04 20.96,0 13.5,0ZM13.5,1C20.42,1 26,6.58 26,13.5C26,15.9 24.5,19.18 22.22,22.74C19.95,26.3 16.71,30.14 13.94,33.91C13.74,34.18 13.61,34.32 13.5,34.44C13.39,34.32 13.26,34.18 13.06,33.91C10.28,30.13 7.41,26.31 5.02,22.77C2.62,19.23 1,15.95 1,13.5C1,6.58 6.58,1 13.5,1Z"},g),gi("circle",{fill:"white",cx:13.5,cy:13.5,r:5.5},g),this._offset=a.Point.convert(r&&r.offset||[0,-14])}this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label","Map marker"),this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",d=>{d.preventDefault()}),this._element.addEventListener("mousedown",d=>{d.preventDefault()});const h=this._element.classList;for(const d in Sn)h.remove(`mapboxgl-marker-anchor-${d}`);h.add(`mapboxgl-marker-anchor-${this._anchor}`),this._popup=null}addTo(r){return r===this._map||(this.remove(),this._map=r,r.getCanvasContainer().appendChild(this._element),r.on("move",this._updateMoving),r.on("moveend",this._update),r.on("remove",this._clearFadeTimer),r._addMarker(this),this.setDraggable(this._draggable),this._update(),r.on("click",this._onMapClick)),this}remove(){const r=this._map;return r&&(r.off("click",this._onMapClick),r.off("move",this._updateMoving),r.off("moveend",this._update),r.off("mousedown",this._addDragHandler),r.off("touchstart",this._addDragHandler),r.off("mouseup",this._onUp),r.off("touchend",this._onUp),r.off("mousemove",this._onMove),r.off("touchmove",this._onMove),r.off("remove",this._clearFadeTimer),r._removeMarker(this),this._map=void 0),this._clearFadeTimer(),this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(r){return this._lngLat=a.LngLat.convert(r),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(!0),this}getElement(){return this._element}setPopup(r){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeAttribute("role"),this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),r){if(!("offset"in r.options)){const d=Math.sqrt(Math.pow(13.5,2)/2);r.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[d,-1*(38.1-13.5+d)],"bottom-right":[-d,-1*(38.1-13.5+d)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=r,r._marker=this,this._lngLat&&this._popup.setLngLat(this._lngLat),this._element.setAttribute("role","button"),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress),this._element.setAttribute("aria-expanded","false")}return this}_onKeyPress(r){const o=r.code,h=r.charCode||r.keyCode;o!=="Space"&&o!=="Enter"&&h!==32&&h!==13||this.togglePopup()}_onMapClick(r){const o=r.originalEvent.target,h=this._element;this._popup&&(o===h||h.contains(o))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const r=this._popup;return r?(r.isOpen()?(r.remove(),this._element.setAttribute("aria-expanded","false")):this._map&&(r.addTo(this._map),this._element.setAttribute("aria-expanded","true")),this):this}_behindTerrain(){const r=this._map,o=this._pos;if(!r||!o)return!1;const h=r.unproject(o),d=r.getFreeCameraOptions();if(!d.position)return!1;const f=d.position.toLngLat();return f.distanceTo(h)<.9*f.distanceTo(this._lngLat)}_evaluateOpacity(){const r=this._map;if(!r)return;const o=this._pos;if(!o||o.x<0||o.x>r.transform.width||o.y<0||o.y>r.transform.height)return void this._clearFadeTimer();const h=r.unproject(o);let d;r._showingGlobe()&&a.isLngLatBehindGlobe(r.transform,this._lngLat)?d=0:(d=1-r._queryFogOpacity(h),r.transform._terrainEnabled()&&r.getTerrain()&&this._behindTerrain()&&(d*=this._occludedOpacity)),this._element.style.opacity=`${d}`,this._element.style.pointerEvents=d>0?"auto":"none",this._popup&&this._popup._setOpacity(d),this._fadeTimer=null}_clearFadeTimer(){this._fadeTimer&&(clearTimeout(this._fadeTimer),this._fadeTimer=null)}_updateDOM(){const r=this._pos;if(!r||!this._map)return;const o=this._offset.mult(this._scale);this._element.style.transform=` - translate(${r.x}px,${r.y}px) - ${Sn[this._anchor]} - ${this._calculateXYTransform()} ${this._calculateZTransform()} - translate(${o.x}px,${o.y}px) - `}_calculateXYTransform(){const r=this._pos,o=this._map,h=this.getPitchAlignment();if(!o||!r||h!=="map")return"";if(!o._showingGlobe()){const v=o.getPitch();return v?`rotateX(${v}deg)`:""}const d=a.radToDeg(a.globeTiltAtLngLat(o.transform,this._lngLat)),f=r.sub(a.globeCenterToScreenPoint(o.transform)),g=Math.abs(f.x)+Math.abs(f.y);if(g===0)return"";const y=d/g;return`rotateX(${-f.y*y}deg) rotateY(${f.x*y}deg)`}_calculateZTransform(){const r=this._pos,o=this._map;if(!o||!r)return"";let h=0;const d=this.getRotationAlignment();if(d==="map")if(o._showingGlobe()){const f=o.project(new a.LngLat(this._lngLat.lng,this._lngLat.lat+.001)),g=o.project(new a.LngLat(this._lngLat.lng,this._lngLat.lat-.001)).sub(f);h=a.radToDeg(Math.atan2(g.y,g.x))-90}else h=-o.getBearing();else if(d==="horizon"){const f=a.smoothstep(4,6,o.getZoom()),g=a.globeCenterToScreenPoint(o.transform);g.y+=f*o.transform.height;const y=r.sub(g),v=a.radToDeg(Math.atan2(y.y,y.x));h=(v>90?v-270:v+90)*(1-f)}return h+=this._rotation,h?`rotateZ(${h}deg)`:""}_update(r){a.window.cancelAnimationFrame(this._updateFrameId);const o=this._map;o&&(o.transform.renderWorldCopies&&(this._lngLat=lo(this._lngLat,this._pos,o.transform)),this._pos=o.project(this._lngLat),r===!0?this._updateFrameId=a.window.requestAnimationFrame(()=>{this._element&&this._pos&&this._anchor&&(this._pos=this._pos.round(),this._updateDOM())}):this._pos=this._pos.round(),o._requestDomTask(()=>{this._map&&(this._element&&this._pos&&this._anchor&&this._updateDOM(),(o._showingGlobe()||o.getTerrain()||o.getFog())&&!this._fadeTimer&&(this._fadeTimer=setTimeout(this._evaluateOpacity.bind(this),60)))}))}getOffset(){return this._offset}setOffset(r){return this._offset=a.Point.convert(r),this._update(),this}_onMove(r){const o=this._map;if(!o)return;const h=this._pointerdownPos,d=this._positionDelta;if(h&&d){if(!this._isDragging){const f=this._clickTolerance||o._clickTolerance;if(r.point.dist(h)=this._endTime)return this._end;const o=a.easeCubicInOut((r-this._startTime)/(this._endTime-this._startTime));return this._start*(1-o)+this._end*o}isEasing(r){return r>=this._startTime&&r<=this._endTime}jumpTo(r){this._startTime=-1/0,this._endTime=-1/0,this._start=r,this._end=r}easeTo(r,o,h){this._start=this.getValue(o),this._end=r,this._startTime=o,this._endTime=o+h}}const Vc={"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":"Mapbox logo","Map.Title":"Map","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScrollZoomBlocker.CtrlMessage":"Use ctrl + scroll to zoom the map","ScrollZoomBlocker.CmdMessage":"Use ⌘ + scroll to zoom the map","TouchPanBlocker.Message":"Use two fingers to move the map"},Nc={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:85,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,performanceMetricsCollection:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,optimizeForTerrain:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,minTileCacheSize:null,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",localFontFamily:null,transformRequest:null,accessToken:null,fadeDuration:300,respectPrefersReducedMotion:!0,crossSourceCollisions:!0},Xh={showCompass:!0,showZoom:!0,visualizePitch:!1};class Hh{constructor(r,o,h=!1){this._clickTolerance=10,this.element=o,this.mouseRotate=new al({clickTolerance:r.dragRotate._mouseRotate._clickTolerance}),this.map=r,h&&(this.mousePitch=new ll({clickTolerance:r.dragRotate._mousePitch._clickTolerance})),a.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),o.addEventListener("mousedown",this.mousedown),o.addEventListener("touchstart",this.touchstart,{passive:!1}),o.addEventListener("touchmove",this.touchmove),o.addEventListener("touchend",this.touchend),o.addEventListener("touchcancel",this.reset)}down(r,o){this.mouseRotate.mousedown(r,o),this.mousePitch&&this.mousePitch.mousedown(r,o),To()}move(r,o){const h=this.map,d=this.mouseRotate.mousemoveWindow(r,o),f=d&&d.bearingDelta;if(f&&h.setBearing(h.getBearing()+f),this.mousePitch){const g=this.mousePitch.mousemoveWindow(r,o),y=g&&g.pitchDelta;y&&h.setPitch(h.getPitch()+y)}}off(){const r=this.element;r.removeEventListener("mousedown",this.mousedown),r.removeEventListener("touchstart",this.touchstart,{passive:!1}),r.removeEventListener("touchmove",this.touchmove),r.removeEventListener("touchend",this.touchend),r.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){Rn(),a.window.removeEventListener("mousemove",this.mousemove),a.window.removeEventListener("mouseup",this.mouseup)}mousedown(r){this.down(a.extend({},r,{ctrlKey:!0,preventDefault:()=>r.preventDefault()}),Ji(this.element,r)),a.window.addEventListener("mousemove",this.mousemove),a.window.addEventListener("mouseup",this.mouseup)}mousemove(r){this.move(r,Ji(this.element,r))}mouseup(r){this.mouseRotate.mouseupWindow(r),this.mousePitch&&this.mousePitch.mouseupWindow(r),this.offTemp()}touchstart(r){r.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=hn(this.element,r.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>r.preventDefault()},this._startPos))}touchmove(r){r.targetTouches.length!==1?this.reset():(this._lastPos=hn(this.element,r.targetTouches)[0],this.move({preventDefault:()=>r.preventDefault()},this._lastPos))}touchend(r){r.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)l.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(l.minPitch!=null&&l.maxPitch!=null&&l.minPitch>l.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(l.minPitch!=null&&l.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(l.maxPitch!=null&&l.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(l.antialias&&a.isSafariWithAntialiasingBug(a.window)&&(l.antialias=!1,a.warnOnce("Antialiasing is disabled for this WebGL context to avoid browser bug: https://github.com/mapbox/mapbox-gl-js/issues/11609")),super(new no(l.minZoom,l.maxZoom,l.minPitch,l.maxPitch,l.renderWorldCopies),l),this._interactive=l.interactive,this._minTileCacheSize=l.minTileCacheSize,this._maxTileCacheSize=l.maxTileCacheSize,this._failIfMajorPerformanceCaveat=l.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=l.preserveDrawingBuffer,this._antialias=l.antialias,this._useWebGL2=l.useWebGL2,this._trackResize=l.trackResize,this._bearingSnap=l.bearingSnap,this._refreshExpiredTiles=l.refreshExpiredTiles,this._fadeDuration=l.fadeDuration,this._isInitialLoad=!0,this._crossSourceCollisions=l.crossSourceCollisions,this._collectResourceTiming=l.collectResourceTiming,this._optimizeForTerrain=l.optimizeForTerrain,this._language=this._parseLanguage(l.language),this._worldview=l.worldview,this._renderTaskQueue=new pl,this._domRenderTaskQueue=new pl,this._controls=[],this._markers=[],this._popups=[],this._mapId=a.uniqueId(),this._locale=a.extend({},Vc,l.locale),this._clickTolerance=l.clickTolerance,this._cooperativeGestures=l.cooperativeGestures,this._performanceMetricsCollection=l.performanceMetricsCollection,this._containerWidth=0,this._containerHeight=0,this._averageElevationLastSampledAt=-1/0,this._averageElevationExaggeration=0,this._averageElevation=new ml(0),this._interactionRange=[1/0,-1/0],this._visibilityHidden=0,this._useExplicitProjection=!1,this._requestManager=new a.RequestManager(l.transformRequest,l.accessToken,l.testMode),this._silenceAuthErrors=!!l.testMode,typeof l.container=="string"){if(this._container=a.window.document.getElementById(l.container),!this._container)throw new Error(`Container '${l.container}' not found.`)}else{if(!(l.container instanceof a.window.HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=l.container}if(this._container.childNodes.length>0&&a.warnOnce("The map container element should be empty, otherwise the map's interactivity will be negatively impacted. If you want to display a message when WebGL is not supported, use the Mapbox GL Supported plugin instead."),l.maxBounds&&this.setMaxBounds(l.maxBounds),a.bindAll(["_onWindowOnline","_onWindowResize","_onVisibilityChange","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),a.window!==void 0&&(a.window.addEventListener("online",this._onWindowOnline,!1),a.window.addEventListener("resize",this._onWindowResize,!1),a.window.addEventListener("orientationchange",this._onWindowResize,!1),a.window.addEventListener("webkitfullscreenchange",this._onWindowResize,!1),a.window.addEventListener("visibilitychange",this._onVisibilityChange,!1)),this.handlers=new ur(this,l),this._localFontFamily=l.localFontFamily,this._localIdeographFontFamily=l.localIdeographFontFamily,l.style&&this.setStyle(l.style,{localFontFamily:this._localFontFamily,localIdeographFontFamily:this._localIdeographFontFamily}),l.projection&&this.setProjection(l.projection),this._hash=l.hash&&new rl(typeof l.hash=="string"&&l.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:l.center,zoom:l.zoom,bearing:l.bearing,pitch:l.pitch}),l.bounds&&(this.resize(),this.fitBounds(l.bounds,a.extend({},l.fitBoundsOptions,{duration:0})))),this.resize(),l.attributionControl&&this.addControl(new Ue({customAttribution:l.customAttribution})),this._logoControl=new dl,this.addControl(this._logoControl,l.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",r=>{this._update(r.dataType==="style"),this.fire(new a.Event(`${r.dataType}data`,r))}),this.on("dataloading",r=>{this.fire(new a.Event(`${r.dataType}dataloading`,r))})}_getMapId(){return this._mapId}addControl(l,r){if(r===void 0&&(r=l.getDefaultPosition?l.getDefaultPosition():"top-right"),!l||!l.onAdd)return this.fire(new a.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const o=l.onAdd(this);this._controls.push(l);const h=this._controlPositions[r];return r.indexOf("bottom")!==-1?h.insertBefore(o,h.firstChild):h.appendChild(o),this}removeControl(l){if(!l||!l.onRemove)return this.fire(new a.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const r=this._controls.indexOf(l);return r>-1&&this._controls.splice(r,1),l.onRemove(this),this}hasControl(l){return this._controls.indexOf(l)>-1}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}resize(l){if(this._updateContainerDimensions(),this._containerWidth===this.transform.width&&this._containerHeight===this.transform.height)return this;this._resizeCanvas(this._containerWidth,this._containerHeight),this.transform.resize(this._containerWidth,this._containerHeight),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight));const r=!this._moving;return r&&this.fire(new a.Event("movestart",l)).fire(new a.Event("move",l)),this.fire(new a.Event("resize",l)),r&&this.fire(new a.Event("moveend",l)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()||null}setMaxBounds(l){return this.transform.setMaxBounds(a.LngLatBounds.convert(l)),this._update()}setMinZoom(l){if((l=l??-2)>=-2&&l<=this.transform.maxZoom)return this.transform.minZoom=l,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=l,this._update(),this.getZoom()>l?this.setZoom(l):this.fire(new a.Event("zoomstart")).fire(new a.Event("zoom")).fire(new a.Event("zoomend")),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(l){if((l=l??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(l>=0&&l<=this.transform.maxPitch)return this.transform.minPitch=l,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(l>=this.transform.minPitch)return this.transform.maxPitch=l,this._update(),this.getPitch()>l?this.setPitch(l):this.fire(new a.Event("pitchstart")).fire(new a.Event("pitch")).fire(new a.Event("pitchend")),this;throw new Error("maxPitch must be greater than or equal to minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(l){return this.transform.renderWorldCopies=l,this.transform.renderWorldCopies||this._forceMarkerAndPopupUpdate(!0),this._update()}getLanguage(){return this._language}_parseLanguage(l){return l==="auto"?a.window.navigator.language:Array.isArray(l)?l.length===0?void 0:l.map(r=>r==="auto"?a.window.navigator.language:r):l}setLanguage(l){const r=this._parseLanguage(l);if(!this.style||r===this._language)return this;this._language=r,this.style._reloadSources();for(const o of this._controls)o._setLanguage&&o._setLanguage(this._language);return this}getWorldview(){return this._worldview}setWorldview(l){return this.style&&l!==this._worldview?(this._worldview=l,this.style._reloadSources(),this):this}getProjection(){return this.transform.mercatorFromTransition?{name:"globe",center:[0,0]}:this.transform.getProjection()}_showingGlobe(){return this.transform.projection.name==="globe"}setProjection(l){return this._lazyInitEmptyStyle(),l?typeof l=="string"&&(l={name:l}):l=null,this._useExplicitProjection=!!l,this._prioritizeAndUpdateProjection(l,this.style.stylesheet?this.style.stylesheet.projection:null)}_updateProjectionTransition(){if(this.getProjection().name!=="globe")return;const l=this.transform,r=l.projection.name;let o;r==="globe"&&l.zoom>=a.GLOBE_ZOOM_THRESHOLD_MAX?(l.setMercatorFromTransition(),o=!0):r==="mercator"&&l.zoom=a.GLOBE_ZOOM_THRESHOLD_MAX?this.transform.setMercatorFromTransition():this.transform.setProjection(l),this.style.applyProjectionUpdate(),r){this.painter.clearBackgroundTiles();for(const o in this.style._sourceCaches)this.style._sourceCaches[o].clearTiles();this._update(!0),this._forceMarkerAndPopupUpdate(!0)}return this}project(l){return this.transform.locationPoint3D(a.LngLat.convert(l))}unproject(l){return this.transform.pointLocation3D(a.Point.convert(l))}isMoving(){return this._moving||this.handlers&&this.handlers.isMoving()||!1}isZooming(){return this._zooming||this.handlers&&this.handlers.isZooming()||!1}isRotating(){return this._rotating||this.handlers&&this.handlers.isRotating()||!1}_isDragging(){return this.handlers&&this.handlers._isDragging()||!1}_createDelegatedListener(l,r,o){if(l==="mouseenter"||l==="mouseover"){let h=!1;const d=g=>{const y=r.filter(E=>this.getLayer(E)),v=y.length?this.queryRenderedFeatures(g.point,{layers:y}):[];v.length?h||(h=!0,o.call(this,new hi(l,this,g.originalEvent,{features:v}))):h=!1},f=()=>{h=!1};return{layers:new Set(r),listener:o,delegates:{mousemove:d,mouseout:f}}}if(l==="mouseleave"||l==="mouseout"){let h=!1;const d=g=>{const y=r.filter(v=>this.getLayer(v));(y.length?this.queryRenderedFeatures(g.point,{layers:y}):[]).length?h=!0:h&&(h=!1,o.call(this,new hi(l,this,g.originalEvent)))},f=g=>{h&&(h=!1,o.call(this,new hi(l,this,g.originalEvent)))};return{layers:new Set(r),listener:o,delegates:{mousemove:d,mouseout:f}}}{const h=d=>{const f=r.filter(y=>this.getLayer(y)),g=f.length?this.queryRenderedFeatures(d.point,{layers:f}):[];g.length&&(d.features=g,o.call(this,d),delete d.features)};return{layers:new Set(r),listener:o,delegates:{[l]:h}}}}on(l,r,o){if(o===void 0)return super.on(l,r);Array.isArray(r)||(r=[r]);const h=this._createDelegatedListener(l,r,o);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[l]=this._delegatedListeners[l]||[],this._delegatedListeners[l].push(h);for(const d in h.delegates)this.on(d,h.delegates[d]);return this}once(l,r,o){if(o===void 0)return super.once(l,r);Array.isArray(r)||(r=[r]);const h=this._createDelegatedListener(l,r,o);for(const d in h.delegates)this.once(d,h.delegates[d]);return this}off(l,r,o){if(o===void 0)return super.off(l,r);r=new Set(Array.isArray(r)?r:[r]);const h=(f,g)=>{if(f.size!==g.size)return!1;for(const y of f)if(!g.has(y))return!1;return!0},d=this._delegatedListeners?this._delegatedListeners[l]:void 0;return d&&(f=>{for(let g=0;g{d?this.fire(new a.ErrorEvent(d)):f&&this._updateDiff(f,r)})}else typeof l=="object"&&this._updateDiff(l,r)}_updateDiff(l,r){try{this.style.setState(l)&&this._update(!0)}catch(o){a.warnOnce(`Unable to perform style diff: ${o.message||o.error||o}. Rebuilding the style from scratch.`),this._updateStyle(l,r)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():(a.warnOnce("There is no style added to the map."),!1)}addSource(l,r){return this._lazyInitEmptyStyle(),this.style.addSource(l,r),this._update(!0)}isSourceLoaded(l){return!!this.style&&this.style._isSourceCacheLoaded(l)}areTilesLoaded(){const l=this.style&&this.style._sourceCaches;for(const r in l){const o=l[r]._tiles;for(const h in o){const d=o[h];if(d.state!=="loaded"&&d.state!=="errored")return!1}}return!0}addSourceType(l,r,o){this._lazyInitEmptyStyle(),this.style.addSourceType(l,r,o)}removeSource(l){return this.style.removeSource(l),this._updateTerrain(),this._update(!0)}getSource(l){return this.style.getSource(l)}addImage(l,r,{pixelRatio:o=1,sdf:h=!1,stretchX:d,stretchY:f,content:g}={}){if(this._lazyInitEmptyStyle(),r instanceof a.window.HTMLImageElement||a.window.ImageBitmap&&r instanceof a.window.ImageBitmap){const{width:y,height:v,data:E}=a.exported.getImageData(r);this.style.addImage(l,{data:new a.RGBAImage({width:y,height:v},E),pixelRatio:o,stretchX:d,stretchY:f,content:g,sdf:h,version:0})}else if(r.width===void 0||r.height===void 0)this.fire(new a.ErrorEvent(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`")));else{const{width:y,height:v}=r,E=r;this.style.addImage(l,{data:new a.RGBAImage({width:y,height:v},new Uint8Array(E.data)),pixelRatio:o,stretchX:d,stretchY:f,content:g,sdf:h,version:0,userImage:E}),E.onAdd&&E.onAdd(this,l)}}updateImage(l,r){const o=this.style.getImage(l);if(!o)return void this.fire(new a.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const h=r instanceof a.window.HTMLImageElement||a.window.ImageBitmap&&r instanceof a.window.ImageBitmap?a.exported.getImageData(r):r,{width:d,height:f}=h;d!==void 0&&f!==void 0?d===o.data.width&&f===o.data.height?(o.data.replace(h.data,!(r instanceof a.window.HTMLImageElement||a.window.ImageBitmap&&r instanceof a.window.ImageBitmap)),this.style.updateImage(l,o)):this.fire(new a.ErrorEvent(new Error(`The width and height of the updated image (${d}, ${f}) - must be that same as the previous version of the image - (${o.data.width}, ${o.data.height})`))):this.fire(new a.ErrorEvent(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`")))}hasImage(l){return l?!!this.style.getImage(l):(this.fire(new a.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(l){this.style.removeImage(l)}loadImage(l,r){a.getImage(this._requestManager.transformRequest(l,a.ResourceType.Image),(o,h)=>{r(o,h instanceof a.window.HTMLImageElement?a.exported.getImageData(h):h)})}listImages(){return this.style.listImages()}addLayer(l,r){return this._lazyInitEmptyStyle(),this.style.addLayer(l,r),this._update(!0)}moveLayer(l,r){return this.style.moveLayer(l,r),this._update(!0)}removeLayer(l){return this.style.removeLayer(l),this._update(!0)}getLayer(l){return this.style.getLayer(l)}setLayerZoomRange(l,r,o){return this.style.setLayerZoomRange(l,r,o),this._update(!0)}setFilter(l,r,o={}){return this.style.setFilter(l,r,o),this._update(!0)}getFilter(l){return this.style.getFilter(l)}setPaintProperty(l,r,o,h={}){return this.style.setPaintProperty(l,r,o,h),this._update(!0)}getPaintProperty(l,r){return this.style.getPaintProperty(l,r)}setLayoutProperty(l,r,o,h={}){return this.style.setLayoutProperty(l,r,o,h),this._update(!0)}getLayoutProperty(l,r){return this.style.getLayoutProperty(l,r)}setLight(l,r={}){return this._lazyInitEmptyStyle(),this.style.setLight(l,r),this._update(!0)}getLight(){return this.style.getLight()}setTerrain(l){return this._lazyInitEmptyStyle(),!l&&this.transform.projection.requiresDraping?this.style.setTerrainForDraping():this.style.setTerrain(l),this._averageElevationLastSampledAt=-1/0,this._update(!0)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(l){return this._lazyInitEmptyStyle(),this.style.setFog(l),this._update(!0)}getFog(){return this.style?this.style.getFog():null}_queryFogOpacity(l){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(a.LngLat.convert(l),this.transform):0}setFeatureState(l,r){return this.style.setFeatureState(l,r),this._update()}removeFeatureState(l,r){return this.style.removeFeatureState(l,r),this._update()}getFeatureState(l){return this.style.getFeatureState(l)}_updateContainerDimensions(){if(!this._container)return;const l=this._container.getBoundingClientRect().width||400,r=this._container.getBoundingClientRect().height||300;let o,h,d,f=this._container;for(;f&&(!h||!d);){const g=a.window.getComputedStyle(f).transform;g&&g!=="none"&&(o=g.match(/matrix.*\((.+)\)/)[1].split(", "),o[0]&&o[0]!=="0"&&o[0]!=="1"&&(h=o[0]),o[3]&&o[3]!=="0"&&o[3]!=="1"&&(d=o[3])),f=f.parentElement}this._containerWidth=h?Math.abs(l/h):l,this._containerHeight=d?Math.abs(r/d):r}_detectMissingCSS(){a.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")!=="rgb(250, 128, 114)"&&a.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")}_setupContainer(){const l=this._container;l.classList.add("mapboxgl-map"),(this._missingCSSCanary=ht("div","mapboxgl-canary",l)).style.visibility="hidden",this._detectMissingCSS();const r=this._canvasContainer=ht("div","mapboxgl-canvas-container",l);this._interactive&&r.classList.add("mapboxgl-interactive"),this._canvas=ht("canvas","mapboxgl-canvas",r),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region"),this._updateContainerDimensions(),this._resizeCanvas(this._containerWidth,this._containerHeight);const o=this._controlContainer=ht("div","mapboxgl-control-container",l),h=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(d=>{h[d]=ht("div",`mapboxgl-ctrl-${d}`,o)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(l,r){const o=a.exported.devicePixelRatio||1;this._canvas.width=o*Math.ceil(l),this._canvas.height=o*Math.ceil(r),this._canvas.style.width=`${l}px`,this._canvas.style.height=`${r}px`}_addMarker(l){this._markers.push(l)}_removeMarker(l){const r=this._markers.indexOf(l);r!==-1&&this._markers.splice(r,1)}_addPopup(l){this._popups.push(l)}_removePopup(l){const r=this._popups.indexOf(l);r!==-1&&this._popups.splice(r,1)}_setupPainter(){const l=a.extend({},xr.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),r=this._useWebGL2&&this._canvas.getContext("webgl2",l),o=r||this._canvas.getContext("webgl",l)||this._canvas.getContext("experimental-webgl",l);o?(this._useWebGL2&&!r&&a.warnOnce("Failed to create WebGL 2 context. Using WebGL 1."),a.storeAuthState(o,!0),this.painter=new io(o,this.transform,!!r),this.on("data",h=>{h.dataType==="source"&&this.painter.setTileLoadedFlag(!0)}),a.exported$1.testSupport(o)):this.fire(new a.ErrorEvent(new Error("Failed to initialize WebGL")))}_contextLost(l){l.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new a.Event("webglcontextlost",{originalEvent:l}))}_contextRestored(l){this._setupPainter(),this.resize(),this._update(),this.fire(new a.Event("webglcontextrestored",{originalEvent:l}))}_onMapScroll(l){if(l.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(l){return this.style?(this._styleDirty=this._styleDirty||l,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(l){return this._update(),this._renderTaskQueue.add(l)}_cancelRenderFrame(l){this._renderTaskQueue.remove(l)}_requestDomTask(l){!this.loaded()||this.loaded()&&!this.isMoving()?l():this._domRenderTaskQueue.add(l)}_render(l){let r;const o=this.painter.context.extTimerQuery,h=a.exported.now();if(this.listens("gpu-timing-frame")&&(r=o.createQueryEXT(),o.beginQueryEXT(o.TIME_ELAPSED_EXT,r)),this.painter.context.setDirty(),this.painter.setBaseState(),(this.isMoving()||this.isRotating()||this.isZooming())&&(this._interactionRange[0]=Math.min(this._interactionRange[0],a.window.performance.now()),this._interactionRange[1]=Math.max(this._interactionRange[1],a.window.performance.now())),this._renderTaskQueue.run(l),this._domRenderTaskQueue.run(l),this._removed)return;this._updateProjectionTransition();const d=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;const y=this.transform.zoom,v=this.transform.pitch,E=a.exported.now(),T=new a.EvaluationParameters(y,{now:E,fadeDuration:d,pitch:v,transition:this.style.getTransition()});this.style.update(T)}this.style&&this.style.fog&&this.style.fog.hasTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0);let f=!1;if(this.style&&this._sourcesDirty?(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),f=this._updateAverageElevation(h),this.style._updateSources(this.transform),this._forceMarkerAndPopupUpdate()):f=this._updateAverageElevation(h),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,d,this._crossSourceCollisions),this.style&&this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showTerrainWireframe:this.showTerrainWireframe,showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,showTileAABBs:this.showTileAABBs,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:d,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),gpuTimingDeferredRender:!!this.listens("gpu-timing-deferred-render"),speedIndexTiming:this.speedIndexTiming}),this.fire(new a.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new a.Event("load"))),this.style&&this.style.hasTransitions()&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),r){const y=a.exported.now()-h;o.endQueryEXT(o.TIME_ELAPSED_EXT,r),setTimeout(()=>{const v=o.getQueryObjectEXT(r,o.QUERY_RESULT_EXT)/1e6;o.deleteQueryEXT(r),this.fire(new a.Event("gpu-timing-frame",{cpuTime:y,gpuTime:v})),a.window.performance.mark("frame-gpu",{startTime:h,detail:{gpuTime:v}})},50)}if(this.listens("gpu-timing-layer")){const y=this.painter.collectGpuTimers();setTimeout(()=>{const v=this.painter.queryGpuTimers(y);this.fire(new a.Event("gpu-timing-layer",{layerTimes:v}))},50)}if(this.listens("gpu-timing-deferred-render")){const y=this.painter.collectDeferredRenderGpuQueries();setTimeout(()=>{const v=this.painter.queryGpuTimeDeferredRender(y);this.fire(new a.Event("gpu-timing-deferred-render",{gpuTime:v}))},50)}const g=this._sourcesDirty||this._styleDirty||this._placementDirty||f;if(g||this._repaint)this.triggerRepaint();else{const y=!this.isMoving()&&this.loaded();if(y&&(f=this._updateAverageElevation(h,!0)),f)this.triggerRepaint();else if(this._triggerFrame(!1),y&&(this.fire(new a.Event("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){const v=this._calculateSpeedIndex();this.fire(new a.Event("speedindexcompleted",{speedIndex:v})),this.speedIndexTiming=!1}}!this._loaded||this._fullyLoaded||g||(this._fullyLoaded=!0,a.LivePerformanceUtils.mark(a.PerformanceMarkers.fullLoad),this._performanceMetricsCollection&&a.postPerformanceEvent(this._requestManager._customAccessToken,{width:this.painter.width,height:this.painter.height,interactionRange:this._interactionRange,visibilityHidden:this._visibilityHidden,terrainEnabled:!!this.painter.style.getTerrain(),fogEnabled:!!this.painter.style.getFog(),projection:this.getProjection().name,zoom:this.transform.zoom,renderer:this.painter.context.renderer,vendor:this.painter.context.vendor}),this._authenticate())}_forceMarkerAndPopupUpdate(l){for(const r of this._markers)l&&!this.getRenderWorldCopies()&&(r._lngLat=r._lngLat.wrap()),r._update();for(const r of this._popups)!l||this.getRenderWorldCopies()||r._trackPointer||(r._lngLat=r._lngLat.wrap()),r._update()}_updateAverageElevation(l,r=!1){const o=h=>(this.transform.averageElevation=h,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return this.transform.averageElevation!==0&&o(0);if((r||l-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(l)){const h=this.transform.averageElevation;let d=this.transform.sampleAverageElevation(),f=!1;this.transform.elevation&&(f=this.transform.elevation.exaggeration()!==this._averageElevationExaggeration,this._averageElevationExaggeration=this.transform.elevation.exaggeration()),isNaN(d)?d=0:this._averageElevationLastSampledAt=l;const g=Math.abs(h-d);if(g>1){if(this._isInitialLoad||f)return this._averageElevation.jumpTo(d),o(d);this._averageElevation.easeTo(d,l,300)}else if(g>1e-4)return this._averageElevation.jumpTo(d),o(d)}return!!this._averageElevation.isEasing(l)&&o(this._averageElevation.getValue(l))}_authenticate(){a.getMapSessionAPI(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,l=>{if(l&&(l.message===a.AUTH_ERR_MSG||l.status===401)){const r=this.painter.context.gl;a.storeAuthState(r,!1),this._logoControl instanceof dl&&this._logoControl._updateLogo(),r&&r.clear(r.DEPTH_BUFFER_BIT|r.COLOR_BUFFER_BIT|r.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new a.ErrorEvent(new Error("A valid Mapbox access token is required to use Mapbox GL JS. To create an account or a new access token, visit https://account.mapbox.com/")))}}),a.postMapLoadEvent(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,()=>{})}_updateTerrain(){const l=this._isDragging();this.painter.updateTerrain(this.style,l)}_calculateSpeedIndex(){const l=this.painter.canvasCopy(),r=this.painter.getCanvasCopiesAndTimestamps();r.timeStamps.push(performance.now());const o=this.painter.context.gl,h=o.createFramebuffer();function d(f){o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,f,0);const g=new Uint8Array(o.drawingBufferWidth*o.drawingBufferHeight*4);return o.readPixels(0,0,o.drawingBufferWidth,o.drawingBufferHeight,o.RGBA,o.UNSIGNED_BYTE,g),g}return o.bindFramebuffer(o.FRAMEBUFFER,h),this._canvasPixelComparison(d(l),r.canvasCopies.map(d),r.timeStamps)}_canvasPixelComparison(l,r,o){let h=o[1]-o[0];const d=l.length/4;for(let f=0;f{const o=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,o&&this._render(r)}))}_preloadTiles(l){const r=this.style?Object.values(this.style._sourceCaches):[];return a.asyncAll(r,(o,h)=>o._preloadTiles(l,h),()=>{this.triggerRepaint()}),this}_onWindowOnline(){this._update()}_onWindowResize(l){this._trackResize&&this.resize({originalEvent:l})._update()}_onVisibilityChange(){a.window.document.visibilityState==="hidden"&&this._visibilityHidden++}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(l){this._showTileBoundaries!==l&&(this._showTileBoundaries=l,this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(l){this._showTerrainWireframe!==l&&(this._showTerrainWireframe=l,this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(l){this._speedIndexTiming!==l&&(this._speedIndexTiming=l,this._update())}get showPadding(){return!!this._showPadding}set showPadding(l){this._showPadding!==l&&(this._showPadding=l,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(l){this._showCollisionBoxes!==l&&(this._showCollisionBoxes=l,l?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(l){this._showOverdrawInspector!==l&&(this._showOverdrawInspector=l,this._update())}get repaint(){return!!this._repaint}set repaint(l){this._repaint!==l&&(this._repaint=l,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(l){this._vertices=l,this._update()}get showTileAABBs(){return!!this._showTileAABBs}set showTileAABBs(l){this._showTileAABBs!==l&&(this._showTileAABBs=l,l&&this._update())}_setCacheLimits(l,r){a.setCacheLimits(l,r)}get version(){return a.version}},NavigationControl:class{constructor(l){this.options=a.extend({},Xh,l),this._container=ht("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",r=>r.preventDefault()),this.options.showZoom&&(a.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",r=>{this._map&&this._map.zoomIn({},{originalEvent:r})}),ht("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",r=>{this._map&&this._map.zoomOut({},{originalEvent:r})}),ht("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(a.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",r=>{const o=this._map;o&&(this.options.visualizePitch?o.resetNorthPitch({},{originalEvent:r}):o.resetNorth({},{originalEvent:r}))}),this._compassIcon=ht("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const l=this._map;if(!l)return;const r=l.getZoom(),o=r===l.getMaxZoom(),h=r===l.getMinZoom();this._zoomInButton.disabled=o,this._zoomOutButton.disabled=h,this._zoomInButton.setAttribute("aria-disabled",o.toString()),this._zoomOutButton.setAttribute("aria-disabled",h.toString())}_rotateCompassArrow(){const l=this._map;if(!l)return;const r=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(l.transform.pitch*(Math.PI/180)),.5)}) rotateX(${l.transform.pitch}deg) rotateZ(${l.transform.angle*(180/Math.PI)}deg)`:`rotate(${l.transform.angle*(180/Math.PI)}deg)`;l._requestDomTask(()=>{this._compassIcon&&(this._compassIcon.style.transform=r)})}onAdd(l){return this._map=l,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),l.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&l.on("pitch",this._rotateCompassArrow),l.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Hh(l,this._compass,this.options.visualizePitch)),this._container}onRemove(){const l=this._map;l&&(this._container.remove(),this.options.showZoom&&l.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&l.off("pitch",this._rotateCompassArrow),l.off("rotate",this._rotateCompassArrow),this._handler&&this._handler.off(),this._handler=void 0),this._map=void 0)}_createButton(l,r){const o=ht("button",l,this._container);return o.type="button",o.addEventListener("click",r),o}_setButtonTitle(l,r){if(!this._map)return;const o=this._map._getUIString(`NavigationControl.${r}`);l.setAttribute("aria-label",o),l.firstElementChild&&l.firstElementChild.setAttribute("title",o)}},GeolocateControl:class extends a.Evented{constructor(l){super(),this.options=a.extend({geolocation:a.window.navigator.geolocation},_l,l),a.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation","_onDeviceOrientation"],this),this._updateMarkerRotationThrottled=oo(this._updateMarkerRotation,20),this._numberOfWatches=0}onAdd(l){return this._map=l,this._container=ht("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkGeolocationSupport(this._setupUI),this._container}onRemove(){this._geolocationWatchID!==void 0&&(this.options.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("zoom",this._onZoom),this._map=void 0,this._numberOfWatches=0,this._noTimeout=!1}_checkGeolocationSupport(l){const r=(o=!!this.options.geolocation)=>{this._supportsGeolocation=o,l(o)};this._supportsGeolocation!==void 0?l(this._supportsGeolocation):a.window.navigator.permissions!==void 0?a.window.navigator.permissions.query({name:"geolocation"}).then(o=>r(o.state!=="denied")).catch(()=>r()):r()}_isOutOfMapMaxBounds(l){const r=this._map.getMaxBounds(),o=l.coords;return!!r&&(o.longituder.getEast()||o.latituder.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}}_onSuccess(l){if(this._map){if(this._isOutOfMapMaxBounds(l))return this._setErrorState(),this.fire(new a.Event("outofmaxbounds",l)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=l,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(l),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(l),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new a.Event("geolocate",l)),this._finish()}}_updateCamera(l){const r=new a.LngLat(l.coords.longitude,l.coords.latitude),o=l.coords.accuracy,h=this._map.getBearing(),d=a.extend({bearing:h},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(o),d,{geolocateSource:!0})}_updateMarker(l){if(l){const r=new a.LngLat(l.coords.longitude,l.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=l.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const l=this._map.transform,r=a.mercatorZfromAltitude(1,l._center.lat)*l.worldSize,o=Math.ceil(2*this._accuracy*r);this._circleElement.style.width=`${o}px`,this._circleElement.style.height=`${o}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_updateMarkerRotation(){this._userLocationDotMarker&&typeof this._heading=="number"?(this._userLocationDotMarker.setRotation(this._heading),this._dotElement.classList.add("mapboxgl-user-location-show-heading")):(this._dotElement.classList.remove("mapboxgl-user-location-show-heading"),this._userLocationDotMarker.setRotation(0))}_onError(l){if(this._map){if(this.options.trackUserLocation)if(l.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.setAttribute("aria-label",r),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",r),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(l.code===3&&this._noTimeout)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new a.Event("error",l)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(l){if(this._map!==void 0){if(this._container.addEventListener("contextmenu",r=>r.preventDefault()),this._geolocateButton=ht("button","mapboxgl-ctrl-geolocate",this._container),ht("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",l===!1){a.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");const r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.setAttribute("aria-label",r),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",r)}else{const r=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.setAttribute("aria-label",r),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",r)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=ht("div","mapboxgl-user-location"),this._dotElement.appendChild(ht("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(ht("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new Be({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=ht("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Be({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",r=>{r.geolocateSource||this._watchState!=="ACTIVE_LOCK"||r.originalEvent&&r.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this.fire(new a.Event("trackuserlocationend")))})}}_onDeviceOrientation(l){this._userLocationDotMarker&&(l.webkitCompassHeading?this._heading=l.webkitCompassHeading:l.absolute===!0&&(this._heading=-1*l.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return a.warnOnce("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 a.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._numberOfWatches--,this._noTimeout=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new a.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new a.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let l;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._numberOfWatches++,this._numberOfWatches>1?(l={maximumAge:6e5,timeout:0},this._noTimeout=!0):(l=this.options.positionOptions,this._noTimeout=!1),this._geolocationWatchID=this.options.geolocation.watchPosition(this._onSuccess,this._onError,l),this.options.showUserHeading&&this._addDeviceOrientationListener()}}else this.options.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_addDeviceOrientationListener(){const l=()=>{a.window.addEventListener("ondeviceorientationabsolute"in a.window?"deviceorientationabsolute":"deviceorientation",this._onDeviceOrientation)};a.window.DeviceMotionEvent!==void 0&&typeof a.window.DeviceMotionEvent.requestPermission=="function"?DeviceOrientationEvent.requestPermission().then(r=>{r==="granted"&&l()}).catch(console.error):l()}_clearWatch(){this.options.geolocation.clearWatch(this._geolocationWatchID),a.window.removeEventListener("deviceorientation",this._onDeviceOrientation),a.window.removeEventListener("deviceorientationabsolute",this._onDeviceOrientation),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:Ue,ScaleControl:class{constructor(l){this.options=a.extend({},gl,l),this._isNumberFormatSupported=function(){try{return new Intl.NumberFormat("en",{style:"unit",unitDisplay:"short",unit:"meter"}),!0}catch{return!1}}(),a.bindAll(["_update","_setScale","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_update(){const l=this.options.maxWidth||100,r=this._map,o=r._containerHeight/2,h=r._containerWidth/2-l/2,d=r.unproject([h,o]),f=r.unproject([h+l,o]),g=d.distanceTo(f);if(this.options.unit==="imperial"){const y=3.2808*g;y>5280?this._setScale(l,y/5280,"mile"):this._setScale(l,y,"foot")}else this.options.unit==="nautical"?this._setScale(l,g/1852,"nautical-mile"):g>=1e3?this._setScale(l,g/1e3,"kilometer"):this._setScale(l,g,"meter")}_setScale(l,r,o){this._map._requestDomTask(()=>{const h=function(f){const g=Math.pow(10,`${Math.floor(f)}`.length-1);let y=f/g;return y=y>=10?10:y>=5?5:y>=3?3:y>=2?2:y>=1?1:function(v){const E=Math.pow(10,Math.ceil(-Math.log(v)/Math.LN10));return Math.round(v*E)/E}(y),g*y}(r),d=h/r;this._container.innerHTML=this._isNumberFormatSupported&&o!=="nautical-mile"?new Intl.NumberFormat(this._language,{style:"unit",unitDisplay:"short",unit:o}).format(h):`${h} ${yl[o]}`,this._container.style.width=l*d+"px"})}onAdd(l){return this._map=l,this._language=l.getLanguage(),this._container=ht("div","mapboxgl-ctrl mapboxgl-ctrl-scale",l.getContainer()),this._container.dir="auto",this._map.on("move",this._update),this._update(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._update),this._map=void 0}_setLanguage(l){this._language=l,this._update()}setUnit(l){this.options.unit=l,this._update()}},FullscreenControl:class{constructor(l){this._fullscreen=!1,l&&l.container&&(l.container instanceof a.window.HTMLElement?this._container=l.container:a.warnOnce("Full screen control 'container' must be a DOM element.")),a.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in a.window.document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in a.window.document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(l){return this._map=l,this._container||(this._container=this._map.getContainer()),this._controlContainer=ht("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",a.warnOnce("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,a.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!a.window.document.fullscreenEnabled&&!a.window.document.webkitFullscreenEnabled)}_setupUI(){const l=this._fullscreenButton=ht("button","mapboxgl-ctrl-fullscreen",this._controlContainer);ht("span","mapboxgl-ctrl-icon",l).setAttribute("aria-hidden","true"),l.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),a.window.document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const l=this._getTitle();this._fullscreenButton.setAttribute("aria-label",l),this._fullscreenButton.firstElementChild&&this._fullscreenButton.firstElementChild.setAttribute("title",l)}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(a.window.document.fullscreenElement||a.window.document.webkitFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?a.window.document.exitFullscreen?a.window.document.exitFullscreen():a.window.document.webkitCancelFullScreen&&a.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},Popup:class extends a.Evented{constructor(l){super(),this.options=a.extend(Object.create(fl),l),a.bindAll(["_update","_onClose","remove","_onMouseEvent"],this),this._classList=new Set(l&&l.className?l.className.trim().split(/\s+/):[])}addTo(l){return this._map&&this.remove(),this._map=l,this.options.closeOnClick&&l.on("preclick",this._onClose),this.options.closeOnMove&&l.on("move",this._onClose),l.on("remove",this.remove),this._update(),l._addPopup(this),this._focusFirstElement(),this._trackPointer?(l.on("mousemove",this._onMouseEvent),l.on("mouseup",this._onMouseEvent),l._canvasContainer.classList.add("mapboxgl-track-pointer")):l.on("move",this._update),this.fire(new a.Event("open")),this}isOpen(){return!!this._map}remove(){this._content&&this._content.remove(),this._container&&(this._container.remove(),this._container=void 0);const l=this._map;return l&&(l.off("move",this._update),l.off("move",this._onClose),l.off("preclick",this._onClose),l.off("click",this._onClose),l.off("remove",this.remove),l.off("mousemove",this._onMouseEvent),l.off("mouseup",this._onMouseEvent),l.off("drag",this._onMouseEvent),l._canvasContainer&&l._canvasContainer.classList.remove("mapboxgl-track-pointer"),l._removePopup(this),this._map=void 0),this.fire(new a.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(l){this._lngLat=a.LngLat.convert(l),this._pos=null,this._trackPointer=!1,this._update();const r=this._map;return r&&(r.on("move",this._update),r.off("mousemove",this._onMouseEvent),r._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}trackPointer(){this._trackPointer=!0,this._pos=null,this._update();const l=this._map;return l&&(l.off("move",this._update),l.on("mousemove",this._onMouseEvent),l.on("drag",this._onMouseEvent),l._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(l){return this.setDOMContent(a.window.document.createTextNode(l))}setHTML(l){const r=a.window.document.createDocumentFragment(),o=a.window.document.createElement("body");let h;for(o.innerHTML=l;h=o.firstChild,h;)r.appendChild(h);return this.setDOMContent(r)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(l){return this.options.maxWidth=l,this._update(),this}setDOMContent(l){let r=this._content;if(r)for(;r.hasChildNodes();)r.firstChild&&r.removeChild(r.firstChild);else r=this._content=ht("div","mapboxgl-popup-content",this._container||void 0);if(r.appendChild(l),this.options.closeButton){const o=this._closeButton=ht("button","mapboxgl-popup-close-button",r);o.type="button",o.setAttribute("aria-label","Close popup"),o.setAttribute("aria-hidden","true"),o.innerHTML="×",o.addEventListener("click",this._onClose)}return this._update(),this._focusFirstElement(),this}addClassName(l){return this._classList.add(l),this._updateClassList(),this}removeClassName(l){return this._classList.delete(l),this._updateClassList(),this}setOffset(l){return this.options.offset=l,this._update(),this}toggleClassName(l){let r;return this._classList.delete(l)?r=!1:(this._classList.add(l),r=!0),this._updateClassList(),r}_onMouseEvent(l){this._update(l.point)}_getAnchor(l){if(this.options.anchor)return this.options.anchor;const r=this._map,o=this._container,h=this._pos;if(!r||!o||!h)return"bottom";const d=o.offsetWidth,f=o.offsetHeight,g=h.xr.transform.width-d/2;if(h.y+lr.transform.height-f){if(g)return"bottom-left";if(y)return"bottom-right"}return g?"left":y?"right":"bottom"}_updateClassList(){const l=this._container;if(!l)return;const r=[...this._classList];r.push("mapboxgl-popup"),this._anchor&&r.push(`mapboxgl-popup-anchor-${this._anchor}`),this._trackPointer&&r.push("mapboxgl-popup-track-pointer"),l.className=r.join(" ")}_update(l){const r=this._map,o=this._content;if(!r||!this._lngLat&&!this._trackPointer||!o)return;let h=this._container;if(h||(h=this._container=ht("div","mapboxgl-popup",r.getContainer()),this._tip=ht("div","mapboxgl-popup-tip",h),h.appendChild(o)),this.options.maxWidth&&h.style.maxWidth!==this.options.maxWidth&&(h.style.maxWidth=this.options.maxWidth),r.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=lo(this._lngLat,this._pos,r.transform)),!this._trackPointer||l){const d=this._pos=this._trackPointer&&l?l:r.project(this._lngLat),f=Uc(this.options.offset),g=this._anchor=this._getAnchor(f.y),y=Uc(this.options.offset,g),v=d.add(y).round();r._requestDomTask(()=>{this._container&&g&&(this._container.style.transform=`${Sn[g]} translate(${v.x}px,${v.y}px)`)})}if(!this._marker&&r._showingGlobe()){const d=a.isLngLatBehindGlobe(r.transform,this._lngLat)?0:1;this._setOpacity(d)}this._updateClassList()}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const l=this._container.querySelector(Wh);l&&l.focus()}_onClose(){this.remove()}_setOpacity(l){this._container&&(this._container.style.opacity=`${l}`),this._content&&(this._content.style.pointerEvents=l?"auto":"none")}},Marker:Be,Style:cr,LngLat:a.LngLat,LngLatBounds:a.LngLatBounds,Point:a.Point,MercatorCoordinate:a.MercatorCoordinate,FreeCameraOptions:Ec,Evented:a.Evented,config:a.config,prewarm:function(){Zn().acquire(sr)},clearPrewarmedResources:function(){const l=Ti;l&&(l.isPreloaded()&&l.numActive()===1?(l.release(sr),Ti=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()"))},get accessToken(){return a.config.ACCESS_TOKEN},set accessToken(l){a.config.ACCESS_TOKEN=l},get baseApiUrl(){return a.config.API_URL},set baseApiUrl(l){a.config.API_URL=l},get workerCount(){return li.workerCount},set workerCount(l){li.workerCount=l},get maxParallelImageRequests(){return a.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(l){a.config.MAX_PARALLEL_IMAGE_REQUESTS=l},clearStorage(l){a.clearTileCache(l)},workerUrl:"",workerClass:null,setNow:a.exported.setNow,restoreNow:a.exported.restoreNow};return co});var Vf=cn;return Vf})})(Of);var Uf=Of.exports;const yg=gg(Uf),xg=mg({__proto__:null,default:yg},[Uf]);export{xg as m}; diff --git a/cisco b/cisco index 51ecddd..b19ab24 160000 --- a/cisco +++ b/cisco @@ -1 +1 @@ -Subproject commit 51ecddd0d211ecd090cb706987baf6a85025dffd +Subproject commit b19ab24bbb904a6297c4796dfb11f5fe07aec0d7 diff --git a/docs/assets/fonts.css b/docs/assets/fonts.css deleted file mode 100644 index a18d7c0..0000000 --- a/docs/assets/fonts.css +++ /dev/null @@ -1,126 +0,0 @@ -@import url('https://fonts.googleapis.com/css2?family=Bitter:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap'); -@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap'); -@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap'); -@import url('https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;500;600;700&display=swap'); - -@font-face { - font-family: 'TT Hoves'; - font-weight: normal; - font-style: normal; - src: local('TT Hoves'), - url('./fonts/TypeType - TT Hoves Regular.ttf') format('truetype'), - url('./fonts/TTHoves-Regular/font.woff') format("woff"), - url('./fonts/TTHoves-Regular/font.woff2') format("woff2"), - url('https://cori-risi-apps.s3.amazonaws.com/fonts/TypeType - TT Hoves Regular.ttf') format('truetype'), - url('https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Regular/font.woff') format("woff"), - url('https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Regular/font.woff2') format("woff2"); -} - -@font-face { - font-family: 'TT Hoves Bold'; - font-weight: bold; - font-style: normal; - src: local('TT Hoves'), - url('./fonts/TypeType - TT Hoves Bold.ttf') format('truetype'), - url('./fonts/TTHoves-Bold/font.woff') format("woff"), - url('./fonts/TTHoves-Bold/font.woff2') format("woff2"), - url('https://cori-risi-apps.s3.amazonaws.com/fonts/TypeType - TT Hoves Bold.ttf') format('truetype'), - url('https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Bold/font.woff') format("woff"), - url('https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Bold/font.woff2') format("woff2"); -} - -@font-face { - font-family: 'TT Hoves Medium'; - font-weight: 500; - font-style: normal; - src: local('TT Hoves'), - url('./fonts/TypeType - TT Hoves Medium.ttf') format('truetype'), - url('./fonts/TTHoves-Medium/font.woff') format("woff"), - url('./fonts/TTHoves-Medium/font.woff2') format("woff2"), - url('https://cori-risi-apps.s3.amazonaws.com/fonts/TypeType - TT Hoves Medium.ttf') format('truetype'), - url('https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Medium/font.woff') format("woff"), - url('https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Medium/font.woff2') format("woff2"); -} - -@font-face { - font-family: 'TT Hoves Italic'; - font-weight: normal; - font-style: italic; - src: local('TT Hoves'), - url('./fonts/TypeType - TT Hoves Italic.ttf') format('truetype'), - url('./fonts/TTHoves-Italic/font.woff') format("woff"), - url('./fonts/TTHoves-Italic/font.woff2') format("woff2"), - url('https://cori-risi-apps.s3.amazonaws.com/fonts/TypeType - TT Hoves Italic.ttf') format('truetype'), - url('https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Italic/font.woff') format("woff"), - url('https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Italic/font.woff2') format("woff2"); -} - - -/* Typography -–––––––––––––––––––––––––––––––––––––––––––––––––– */ - -/* default */ -html, body { - font-family: "Montserrat", "Bitter", serif; -} - -h1, h2, h3, h4, h5, h6 { - font-weight: 400; - font-family: "Montserrat", "TT Hoves", sans-serif; -} - -h1, h2, h6 { - font-family: "Montserrat", "TT Hoves Bold", "TT Hoves", sans-serif; - font-weight: 700; -} - -h3 { - font-family: "Montserrat", "TT Hoves Medium", "TT Hoves", "Bitter", serif; - font-weight: 400; -} - -h4, h5 { - font-family: "Montserrat", "TT Hoves Medium", "TT Hoves", sans-serif; - font-weight: 500; -} - -h1 { font-size: 3.2em; line-height: 1.16; } -h2 { font-size: 2.4em; line-height: 1.25; } -h3 { font-size: 1.8em; line-height: 1.3; } -h4 { font-size: 1.5em; line-height: 1.3; } -h5 { font-size: 1.2em; line-height: 1.3; } -h6 { font-size: .76em; line-height: 1.35; } - -/* Larger than phablet */ -@media (min-width: 550px) { - h1 { font-size: 2.8em; } - h2 { font-size: 2.3em; } - h3 { font-size: 1.8em; } - h4 { font-size: 1.5em; } - h5 { font-size: 1.2em; } - h6 { font-size: 1.0em; } -} - -p { - font-family: "Bitter", serif; - font-size: 1em; - line-height: 1.7; -} - -a { - font-family: "Bitter", serif; - font-size: 1em; - font-weight: normal; - line-height: 1.7; - text-decoration: underline; -} - -a:hover { - text-decoration: underline; - cursor: pointer; -} - -.nav-item a, .sidebar-item a { - font-family: "Montserrat", "TT Hoves", sans-serif; - font-weight: normal; -} diff --git a/docs/assets/index-0b9b7d26.js b/docs/assets/index-0b9b7d26.js new file mode 100644 index 0000000..7145046 --- /dev/null +++ b/docs/assets/index-0b9b7d26.js @@ -0,0 +1,1396 @@ +function LP(e,n){for(var l=0;lh[m]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const m of document.querySelectorAll('link[rel="modulepreload"]'))h(m);new MutationObserver(m=>{for(const v of m)if(v.type==="childList")for(const E of v.addedNodes)E.tagName==="LINK"&&E.rel==="modulepreload"&&h(E)}).observe(document,{childList:!0,subtree:!0});function l(m){const v={};return m.integrity&&(v.integrity=m.integrity),m.referrerPolicy&&(v.referrerPolicy=m.referrerPolicy),m.crossOrigin==="use-credentials"?v.credentials="include":m.crossOrigin==="anonymous"?v.credentials="omit":v.credentials="same-origin",v}function h(m){if(m.ep)return;m.ep=!0;const v=l(m);fetch(m.href,v)}})();var Go=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function g1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function XT(e){if(e.__esModule)return e;var n=e.default;if(typeof n=="function"){var l=function h(){return this instanceof h?Reflect.construct(n,arguments,this.constructor):n.apply(this,arguments)};l.prototype=n.prototype}else l={};return Object.defineProperty(l,"__esModule",{value:!0}),Object.keys(e).forEach(function(h){var m=Object.getOwnPropertyDescriptor(e,h);Object.defineProperty(l,h,m.get?m:{enumerable:!0,get:function(){return e[h]}})}),l}var KT={exports:{}},Yt={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Yp=Symbol.for("react.element"),RP=Symbol.for("react.portal"),DP=Symbol.for("react.fragment"),OP=Symbol.for("react.strict_mode"),BP=Symbol.for("react.profiler"),FP=Symbol.for("react.provider"),NP=Symbol.for("react.context"),UP=Symbol.for("react.forward_ref"),jP=Symbol.for("react.suspense"),VP=Symbol.for("react.memo"),$P=Symbol.for("react.lazy"),v2=Symbol.iterator;function GP(e){return e===null||typeof e!="object"?null:(e=v2&&e[v2]||e["@@iterator"],typeof e=="function"?e:null)}var YT={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},JT=Object.assign,QT={};function hh(e,n,l){this.props=e,this.context=n,this.refs=QT,this.updater=l||YT}hh.prototype.isReactComponent={};hh.prototype.setState=function(e,n){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,n,"setState")};hh.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function eS(){}eS.prototype=hh.prototype;function _1(e,n,l){this.props=e,this.context=n,this.refs=QT,this.updater=l||YT}var y1=_1.prototype=new eS;y1.constructor=_1;JT(y1,hh.prototype);y1.isPureReactComponent=!0;var x2=Array.isArray,tS=Object.prototype.hasOwnProperty,v1={current:null},nS={key:!0,ref:!0,__self:!0,__source:!0};function rS(e,n,l){var h,m={},v=null,E=null;if(n!=null)for(h in n.ref!==void 0&&(E=n.ref),n.key!==void 0&&(v=""+n.key),n)tS.call(n,h)&&!nS.hasOwnProperty(h)&&(m[h]=n[h]);var s=arguments.length-2;if(s===1)m.children=l;else if(1>>1,dn=Je[Bt];if(0>>1;Btm(ii,xt))arm(br,ii)?(Je[Bt]=br,Je[ar]=xt,Bt=ar):(Je[Bt]=ii,Je[sr]=xt,Bt=sr);else if(arm(br,xt))Je[Bt]=br,Je[ar]=xt,Bt=ar;else break e}}return Tt}function m(Je,Tt){var xt=Je.sortIndex-Tt.sortIndex;return xt!==0?xt:Je.id-Tt.id}if(typeof performance=="object"&&typeof performance.now=="function"){var v=performance;e.unstable_now=function(){return v.now()}}else{var E=Date,s=E.now();e.unstable_now=function(){return E.now()-s}}var k=[],D=[],V=1,G=null,J=3,ve=!1,ae=!1,me=!1,Ce=typeof setTimeout=="function"?setTimeout:null,ie=typeof clearTimeout=="function"?clearTimeout:null,te=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function le(Je){for(var Tt=l(D);Tt!==null;){if(Tt.callback===null)h(D);else if(Tt.startTime<=Je)h(D),Tt.sortIndex=Tt.expirationTime,n(k,Tt);else break;Tt=l(D)}}function ze(Je){if(me=!1,le(Je),!ae)if(l(k)!==null)ae=!0,Li(Oe);else{var Tt=l(D);Tt!==null&&Ki(ze,Tt.startTime-Je)}}function Oe(Je,Tt){ae=!1,me&&(me=!1,ie(ht),ht=-1),ve=!0;var xt=J;try{for(le(Tt),G=l(k);G!==null&&(!(G.expirationTime>Tt)||Je&&!wr());){var Bt=G.callback;if(typeof Bt=="function"){G.callback=null,J=G.priorityLevel;var dn=Bt(G.expirationTime<=Tt);Tt=e.unstable_now(),typeof dn=="function"?G.callback=dn:G===l(k)&&h(k),le(Tt)}else h(k);G=l(k)}if(G!==null)var vn=!0;else{var sr=l(D);sr!==null&&Ki(ze,sr.startTime-Tt),vn=!1}return vn}finally{G=null,J=xt,ve=!1}}var Ke=!1,He=null,ht=-1,Ve=5,jt=-1;function wr(){return!(e.unstable_now()-jtJe||125Bt?(Je.sortIndex=xt,n(D,Je),l(k)===null&&Je===l(D)&&(me?(ie(ht),ht=-1):me=!0,Ki(ze,xt-Bt))):(Je.sortIndex=dn,n(k,Je),ae||ve||(ae=!0,Li(Oe))),Je},e.unstable_shouldYield=wr,e.unstable_wrapCallback=function(Je){var Tt=J;return function(){var xt=J;J=Tt;try{return Je.apply(this,arguments)}finally{J=xt}}}})(aS);sS.exports=aS;var XP=sS.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var KP=ut,Zi=XP;function it(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,l=1;l"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),cv=Object.prototype.hasOwnProperty,YP=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,b2={},E2={};function JP(e){return cv.call(E2,e)?!0:cv.call(b2,e)?!1:YP.test(e)?E2[e]=!0:(b2[e]=!0,!1)}function QP(e,n,l,h){if(l!==null&&l.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return h?!1:l!==null?!l.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function ez(e,n,l,h){if(n===null||typeof n>"u"||QP(e,n,l,h))return!0;if(h)return!1;if(l!==null)switch(l.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function di(e,n,l,h,m,v,E){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=h,this.attributeNamespace=m,this.mustUseProperty=l,this.propertyName=e,this.type=n,this.sanitizeURL=v,this.removeEmptyString=E}var jr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){jr[e]=new di(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];jr[n]=new di(n,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){jr[e]=new di(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){jr[e]=new di(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){jr[e]=new di(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){jr[e]=new di(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){jr[e]=new di(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){jr[e]=new di(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){jr[e]=new di(e,5,!1,e.toLowerCase(),null,!1,!1)});var w1=/[\-:]([a-z])/g;function b1(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var n=e.replace(w1,b1);jr[n]=new di(n,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(w1,b1);jr[n]=new di(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(w1,b1);jr[n]=new di(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){jr[e]=new di(e,1,!1,e.toLowerCase(),null,!1,!1)});jr.xlinkHref=new di("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){jr[e]=new di(e,1,!1,e.toLowerCase(),null,!0,!0)});function E1(e,n,l,h){var m=jr.hasOwnProperty(n)?jr[n]:null;(m!==null?m.type!==0:h||!(2s||m[E]!==v[s]){var k=` +`+m[E].replace(" at new "," at ");return e.displayName&&k.includes("")&&(k=k.replace("",e.displayName)),k}while(1<=E&&0<=s);break}}}finally{A0=!1,Error.prepareStackTrace=l}return(e=e?e.displayName||e.name:"")?up(e):""}function tz(e){switch(e.tag){case 5:return up(e.type);case 16:return up("Lazy");case 13:return up("Suspense");case 19:return up("SuspenseList");case 0:case 2:case 15:return e=C0(e.type,!1),e;case 11:return e=C0(e.type.render,!1),e;case 1:return e=C0(e.type,!0),e;default:return""}}function pv(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Lu:return"Fragment";case zu:return"Portal";case uv:return"Profiler";case T1:return"StrictMode";case hv:return"Suspense";case dv:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case uS:return(e.displayName||"Context")+".Consumer";case cS:return(e._context.displayName||"Context")+".Provider";case S1:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case A1:return n=e.displayName||null,n!==null?n:pv(e.type)||"Memo";case Ga:n=e._payload,e=e._init;try{return pv(e(n))}catch{}}return null}function nz(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return pv(n);case 8:return n===T1?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function sl(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function dS(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function rz(e){var n=dS(e)?"checked":"value",l=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),h=""+e[n];if(!e.hasOwnProperty(n)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var m=l.get,v=l.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return m.call(this)},set:function(E){h=""+E,v.call(this,E)}}),Object.defineProperty(e,n,{enumerable:l.enumerable}),{getValue:function(){return h},setValue:function(E){h=""+E},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Dm(e){e._valueTracker||(e._valueTracker=rz(e))}function pS(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var l=n.getValue(),h="";return e&&(h=dS(e)?e.checked?"true":"false":e.value),e=h,e!==l?(n.setValue(e),!0):!1}function Sg(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function fv(e,n){var l=n.checked;return Qn({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:l??e._wrapperState.initialChecked})}function S2(e,n){var l=n.defaultValue==null?"":n.defaultValue,h=n.checked!=null?n.checked:n.defaultChecked;l=sl(n.value!=null?n.value:l),e._wrapperState={initialChecked:h,initialValue:l,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function fS(e,n){n=n.checked,n!=null&&E1(e,"checked",n,!1)}function mv(e,n){fS(e,n);var l=sl(n.value),h=n.type;if(l!=null)h==="number"?(l===0&&e.value===""||e.value!=l)&&(e.value=""+l):e.value!==""+l&&(e.value=""+l);else if(h==="submit"||h==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?gv(e,n.type,l):n.hasOwnProperty("defaultValue")&&gv(e,n.type,sl(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function A2(e,n,l){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var h=n.type;if(!(h!=="submit"&&h!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+e._wrapperState.initialValue,l||n===e.value||(e.value=n),e.defaultValue=n}l=e.name,l!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,l!==""&&(e.name=l)}function gv(e,n,l){(n!=="number"||Sg(e.ownerDocument)!==e)&&(l==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+l&&(e.defaultValue=""+l))}var hp=Array.isArray;function qu(e,n,l,h){if(e=e.options,n){n={};for(var m=0;m"+n.valueOf().toString()+"",n=Om.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function Ap(e,n){if(n){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=n;return}}e.textContent=n}var fp={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},iz=["Webkit","ms","Moz","O"];Object.keys(fp).forEach(function(e){iz.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),fp[n]=fp[e]})});function yS(e,n,l){return n==null||typeof n=="boolean"||n===""?"":l||typeof n!="number"||n===0||fp.hasOwnProperty(e)&&fp[e]?(""+n).trim():n+"px"}function vS(e,n){e=e.style;for(var l in n)if(n.hasOwnProperty(l)){var h=l.indexOf("--")===0,m=yS(l,n[l],h);l==="float"&&(l="cssFloat"),h?e.setProperty(l,m):e[l]=m}}var oz=Qn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function vv(e,n){if(n){if(oz[e]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(it(137,e));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(it(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(it(61))}if(n.style!=null&&typeof n.style!="object")throw Error(it(62))}}function xv(e,n){if(e.indexOf("-")===-1)return typeof n.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var wv=null;function C1(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var bv=null,Wu=null,Zu=null;function k2(e){if(e=ef(e)){if(typeof bv!="function")throw Error(it(280));var n=e.stateNode;n&&(n=h_(n),bv(e.stateNode,e.type,n))}}function xS(e){Wu?Zu?Zu.push(e):Zu=[e]:Wu=e}function wS(){if(Wu){var e=Wu,n=Zu;if(Zu=Wu=null,k2(e),n)for(e=0;e>>=0,e===0?32:31-(gz(e)/_z|0)|0}var Bm=64,Fm=4194304;function dp(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function kg(e,n){var l=e.pendingLanes;if(l===0)return 0;var h=0,m=e.suspendedLanes,v=e.pingedLanes,E=l&268435455;if(E!==0){var s=E&~m;s!==0?h=dp(s):(v&=E,v!==0&&(h=dp(v)))}else E=l&~m,E!==0?h=dp(E):v!==0&&(h=dp(v));if(h===0)return 0;if(n!==0&&n!==h&&!(n&m)&&(m=h&-h,v=n&-n,m>=v||m===16&&(v&4194240)!==0))return n;if(h&4&&(h|=l&16),n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=h;0l;l++)n.push(e);return n}function Jp(e,n,l){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-qo(n),e[n]=l}function wz(e,n){var l=e.pendingLanes&~n;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=n,e.mutableReadLanes&=n,e.entangledLanes&=n,n=e.entanglements;var h=e.eventTimes;for(e=e.expirationTimes;0=gp),F2=String.fromCharCode(32),N2=!1;function jS(e,n){switch(e){case"keyup":return Xz.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function VS(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ru=!1;function Yz(e,n){switch(e){case"compositionend":return VS(n);case"keypress":return n.which!==32?null:(N2=!0,F2);case"textInput":return e=n.data,e===F2&&N2?null:e;default:return null}}function Jz(e,n){if(Ru)return e==="compositionend"||!D1&&jS(e,n)?(e=NS(),ag=z1=Ha=null,Ru=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1=n)return{node:l,offset:n-e};e=h}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=$2(l)}}function WS(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?WS(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function ZS(){for(var e=window,n=Sg();n instanceof e.HTMLIFrameElement;){try{var l=typeof n.contentWindow.location.href=="string"}catch{l=!1}if(l)e=n.contentWindow;else break;n=Sg(e.document)}return n}function O1(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}function aL(e){var n=ZS(),l=e.focusedElem,h=e.selectionRange;if(n!==l&&l&&l.ownerDocument&&WS(l.ownerDocument.documentElement,l)){if(h!==null&&O1(l)){if(n=h.start,e=h.end,e===void 0&&(e=n),"selectionStart"in l)l.selectionStart=n,l.selectionEnd=Math.min(e,l.value.length);else if(e=(n=l.ownerDocument||document)&&n.defaultView||window,e.getSelection){e=e.getSelection();var m=l.textContent.length,v=Math.min(h.start,m);h=h.end===void 0?v:Math.min(h.end,m),!e.extend&&v>h&&(m=h,h=v,v=m),m=G2(l,v);var E=G2(l,h);m&&E&&(e.rangeCount!==1||e.anchorNode!==m.node||e.anchorOffset!==m.offset||e.focusNode!==E.node||e.focusOffset!==E.offset)&&(n=n.createRange(),n.setStart(m.node,m.offset),e.removeAllRanges(),v>h?(e.addRange(n),e.extend(E.node,E.offset)):(n.setEnd(E.node,E.offset),e.addRange(n)))}}for(n=[],e=l;e=e.parentNode;)e.nodeType===1&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l=document.documentMode,Du=null,Iv=null,yp=null,kv=!1;function q2(e,n,l){var h=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;kv||Du==null||Du!==Sg(h)||(h=Du,"selectionStart"in h&&O1(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),yp&&zp(yp,h)||(yp=h,h=zg(Iv,"onSelect"),0Fu||(e.current=Dv[Fu],Dv[Fu]=null,Fu--)}function Pn(e,n){Fu++,Dv[Fu]=e.current,e.current=n}var al={},ni=hl(al),Ci=hl(!1),mc=al;function nh(e,n){var l=e.type.contextTypes;if(!l)return al;var h=e.stateNode;if(h&&h.__reactInternalMemoizedUnmaskedChildContext===n)return h.__reactInternalMemoizedMaskedChildContext;var m={},v;for(v in l)m[v]=n[v];return h&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=m),m}function Ii(e){return e=e.childContextTypes,e!=null}function Rg(){On(Ci),On(ni)}function J2(e,n,l){if(ni.current!==al)throw Error(it(168));Pn(ni,n),Pn(Ci,l)}function nA(e,n,l){var h=e.stateNode;if(n=n.childContextTypes,typeof h.getChildContext!="function")return l;h=h.getChildContext();for(var m in h)if(!(m in n))throw Error(it(108,nz(e)||"Unknown",m));return Qn({},l,h)}function Dg(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||al,mc=ni.current,Pn(ni,e),Pn(Ci,Ci.current),!0}function Q2(e,n,l){var h=e.stateNode;if(!h)throw Error(it(169));l?(e=nA(e,n,mc),h.__reactInternalMemoizedMergedChildContext=e,On(Ci),On(ni),Pn(ni,e)):On(Ci),Pn(Ci,l)}var Hs=null,d_=!1,j0=!1;function rA(e){Hs===null?Hs=[e]:Hs.push(e)}function vL(e){d_=!0,rA(e)}function dl(){if(!j0&&Hs!==null){j0=!0;var e=0,n=Tn;try{var l=Hs;for(Tn=1;e>=E,m-=E,Ys=1<<32-qo(n)+m|l<ht?(Ve=He,He=null):Ve=He.sibling;var jt=J(ie,He,le[ht],ze);if(jt===null){He===null&&(He=Ve);break}e&&He&&jt.alternate===null&&n(ie,He),te=v(jt,te,ht),Ke===null?Oe=jt:Ke.sibling=jt,Ke=jt,He=Ve}if(ht===le.length)return l(ie,He),jn&&sc(ie,ht),Oe;if(He===null){for(;htht?(Ve=He,He=null):Ve=He.sibling;var wr=J(ie,He,jt.value,ze);if(wr===null){He===null&&(He=Ve);break}e&&He&&wr.alternate===null&&n(ie,He),te=v(wr,te,ht),Ke===null?Oe=wr:Ke.sibling=wr,Ke=wr,He=Ve}if(jt.done)return l(ie,He),jn&&sc(ie,ht),Oe;if(He===null){for(;!jt.done;ht++,jt=le.next())jt=G(ie,jt.value,ze),jt!==null&&(te=v(jt,te,ht),Ke===null?Oe=jt:Ke.sibling=jt,Ke=jt);return jn&&sc(ie,ht),Oe}for(He=h(ie,He);!jt.done;ht++,jt=le.next())jt=ve(He,ie,ht,jt.value,ze),jt!==null&&(e&&jt.alternate!==null&&He.delete(jt.key===null?ht:jt.key),te=v(jt,te,ht),Ke===null?Oe=jt:Ke.sibling=jt,Ke=jt);return e&&He.forEach(function(St){return n(ie,St)}),jn&&sc(ie,ht),Oe}function Ce(ie,te,le,ze){if(typeof le=="object"&&le!==null&&le.type===Lu&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case Rm:e:{for(var Oe=le.key,Ke=te;Ke!==null;){if(Ke.key===Oe){if(Oe=le.type,Oe===Lu){if(Ke.tag===7){l(ie,Ke.sibling),te=m(Ke,le.props.children),te.return=ie,ie=te;break e}}else if(Ke.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===Ga&&nE(Oe)===Ke.type){l(ie,Ke.sibling),te=m(Ke,le.props),te.ref=rp(ie,Ke,le),te.return=ie,ie=te;break e}l(ie,Ke);break}else n(ie,Ke);Ke=Ke.sibling}le.type===Lu?(te=fc(le.props.children,ie.mode,ze,le.key),te.return=ie,ie=te):(ze=mg(le.type,le.key,le.props,null,ie.mode,ze),ze.ref=rp(ie,te,le),ze.return=ie,ie=ze)}return E(ie);case zu:e:{for(Ke=le.key;te!==null;){if(te.key===Ke)if(te.tag===4&&te.stateNode.containerInfo===le.containerInfo&&te.stateNode.implementation===le.implementation){l(ie,te.sibling),te=m(te,le.children||[]),te.return=ie,ie=te;break e}else{l(ie,te);break}else n(ie,te);te=te.sibling}te=X0(le,ie.mode,ze),te.return=ie,ie=te}return E(ie);case Ga:return Ke=le._init,Ce(ie,te,Ke(le._payload),ze)}if(hp(le))return ae(ie,te,le,ze);if(Jd(le))return me(ie,te,le,ze);qm(ie,le)}return typeof le=="string"&&le!==""||typeof le=="number"?(le=""+le,te!==null&&te.tag===6?(l(ie,te.sibling),te=m(te,le),te.return=ie,ie=te):(l(ie,te),te=H0(le,ie.mode,ze),te.return=ie,ie=te),E(ie)):l(ie,te)}return Ce}var ih=aA(!0),lA=aA(!1),Fg=hl(null),Ng=null,ju=null,U1=null;function j1(){U1=ju=Ng=null}function V1(e){var n=Fg.current;On(Fg),e._currentValue=n}function Fv(e,n,l){for(;e!==null;){var h=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,h!==null&&(h.childLanes|=n)):h!==null&&(h.childLanes&n)!==n&&(h.childLanes|=n),e===l)break;e=e.return}}function Xu(e,n){Ng=e,U1=ju=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&n&&(Ai=!0),e.firstContext=null)}function mo(e){var n=e._currentValue;if(U1!==e)if(e={context:e,memoizedValue:n,next:null},ju===null){if(Ng===null)throw Error(it(308));ju=e,Ng.dependencies={lanes:0,firstContext:e}}else ju=ju.next=e;return n}var uc=null;function $1(e){uc===null?uc=[e]:uc.push(e)}function cA(e,n,l,h){var m=n.interleaved;return m===null?(l.next=l,$1(n)):(l.next=m.next,m.next=l),n.interleaved=l,ra(e,h)}function ra(e,n){e.lanes|=n;var l=e.alternate;for(l!==null&&(l.lanes|=n),l=e,e=e.return;e!==null;)e.childLanes|=n,l=e.alternate,l!==null&&(l.childLanes|=n),l=e,e=e.return;return l.tag===3?l.stateNode:null}var qa=!1;function G1(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function uA(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Qs(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function tl(e,n,l){var h=e.updateQueue;if(h===null)return null;if(h=h.shared,nn&2){var m=h.pending;return m===null?n.next=n:(n.next=m.next,m.next=n),h.pending=n,ra(e,l)}return m=h.interleaved,m===null?(n.next=n,$1(h)):(n.next=m.next,m.next=n),h.interleaved=n,ra(e,l)}function cg(e,n,l){if(n=n.updateQueue,n!==null&&(n=n.shared,(l&4194240)!==0)){var h=n.lanes;h&=e.pendingLanes,l|=h,n.lanes=l,k1(e,l)}}function rE(e,n){var l=e.updateQueue,h=e.alternate;if(h!==null&&(h=h.updateQueue,l===h)){var m=null,v=null;if(l=l.firstBaseUpdate,l!==null){do{var E={eventTime:l.eventTime,lane:l.lane,tag:l.tag,payload:l.payload,callback:l.callback,next:null};v===null?m=v=E:v=v.next=E,l=l.next}while(l!==null);v===null?m=v=n:v=v.next=n}else m=v=n;l={baseState:h.baseState,firstBaseUpdate:m,lastBaseUpdate:v,shared:h.shared,effects:h.effects},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=n:e.next=n,l.lastBaseUpdate=n}function Ug(e,n,l,h){var m=e.updateQueue;qa=!1;var v=m.firstBaseUpdate,E=m.lastBaseUpdate,s=m.shared.pending;if(s!==null){m.shared.pending=null;var k=s,D=k.next;k.next=null,E===null?v=D:E.next=D,E=k;var V=e.alternate;V!==null&&(V=V.updateQueue,s=V.lastBaseUpdate,s!==E&&(s===null?V.firstBaseUpdate=D:s.next=D,V.lastBaseUpdate=k))}if(v!==null){var G=m.baseState;E=0,V=D=k=null,s=v;do{var J=s.lane,ve=s.eventTime;if((h&J)===J){V!==null&&(V=V.next={eventTime:ve,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var ae=e,me=s;switch(J=n,ve=l,me.tag){case 1:if(ae=me.payload,typeof ae=="function"){G=ae.call(ve,G,J);break e}G=ae;break e;case 3:ae.flags=ae.flags&-65537|128;case 0:if(ae=me.payload,J=typeof ae=="function"?ae.call(ve,G,J):ae,J==null)break e;G=Qn({},G,J);break e;case 2:qa=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,J=m.effects,J===null?m.effects=[s]:J.push(s))}else ve={eventTime:ve,lane:J,tag:s.tag,payload:s.payload,callback:s.callback,next:null},V===null?(D=V=ve,k=G):V=V.next=ve,E|=J;if(s=s.next,s===null){if(s=m.shared.pending,s===null)break;J=s,s=J.next,J.next=null,m.lastBaseUpdate=J,m.shared.pending=null}}while(1);if(V===null&&(k=G),m.baseState=k,m.firstBaseUpdate=D,m.lastBaseUpdate=V,n=m.shared.interleaved,n!==null){m=n;do E|=m.lane,m=m.next;while(m!==n)}else v===null&&(m.shared.lanes=0);yc|=E,e.lanes=E,e.memoizedState=G}}function iE(e,n,l){if(e=n.effects,n.effects=null,e!==null)for(n=0;nl?l:4,e(!0);var h=$0.transition;$0.transition={};try{e(!1),n()}finally{Tn=l,$0.transition=h}}function CA(){return go().memoizedState}function EL(e,n,l){var h=rl(e);if(l={lane:h,action:l,hasEagerState:!1,eagerState:null,next:null},IA(e))kA(n,l);else if(l=cA(e,n,l,h),l!==null){var m=ui();Wo(l,e,h,m),MA(l,n,h)}}function TL(e,n,l){var h=rl(e),m={lane:h,action:l,hasEagerState:!1,eagerState:null,next:null};if(IA(e))kA(n,m);else{var v=e.alternate;if(e.lanes===0&&(v===null||v.lanes===0)&&(v=n.lastRenderedReducer,v!==null))try{var E=n.lastRenderedState,s=v(E,l);if(m.hasEagerState=!0,m.eagerState=s,Xo(s,E)){var k=n.interleaved;k===null?(m.next=m,$1(n)):(m.next=k.next,k.next=m),n.interleaved=m;return}}catch{}finally{}l=cA(e,n,m,h),l!==null&&(m=ui(),Wo(l,e,h,m),MA(l,n,h))}}function IA(e){var n=e.alternate;return e===Jn||n!==null&&n===Jn}function kA(e,n){vp=Vg=!0;var l=e.pending;l===null?n.next=n:(n.next=l.next,l.next=n),e.pending=n}function MA(e,n,l){if(l&4194240){var h=n.lanes;h&=e.pendingLanes,l|=h,n.lanes=l,k1(e,l)}}var $g={readContext:mo,useCallback:Jr,useContext:Jr,useEffect:Jr,useImperativeHandle:Jr,useInsertionEffect:Jr,useLayoutEffect:Jr,useMemo:Jr,useReducer:Jr,useRef:Jr,useState:Jr,useDebugValue:Jr,useDeferredValue:Jr,useTransition:Jr,useMutableSource:Jr,useSyncExternalStore:Jr,useId:Jr,unstable_isNewReconciler:!1},SL={readContext:mo,useCallback:function(e,n){return gs().memoizedState=[e,n===void 0?null:n],e},useContext:mo,useEffect:sE,useImperativeHandle:function(e,n,l){return l=l!=null?l.concat([e]):null,hg(4194308,4,bA.bind(null,n,e),l)},useLayoutEffect:function(e,n){return hg(4194308,4,e,n)},useInsertionEffect:function(e,n){return hg(4,2,e,n)},useMemo:function(e,n){var l=gs();return n=n===void 0?null:n,e=e(),l.memoizedState=[e,n],e},useReducer:function(e,n,l){var h=gs();return n=l!==void 0?l(n):n,h.memoizedState=h.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},h.queue=e,e=e.dispatch=EL.bind(null,Jn,e),[h.memoizedState,e]},useRef:function(e){var n=gs();return e={current:e},n.memoizedState=e},useState:oE,useDebugValue:J1,useDeferredValue:function(e){return gs().memoizedState=e},useTransition:function(){var e=oE(!1),n=e[0];return e=bL.bind(null,e[1]),gs().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,l){var h=Jn,m=gs();if(jn){if(l===void 0)throw Error(it(407));l=l()}else{if(l=n(),Rr===null)throw Error(it(349));_c&30||fA(h,n,l)}m.memoizedState=l;var v={value:l,getSnapshot:n};return m.queue=v,sE(gA.bind(null,h,v,e),[e]),h.flags|=2048,Up(9,mA.bind(null,h,v,l,n),void 0,null),l},useId:function(){var e=gs(),n=Rr.identifierPrefix;if(jn){var l=Js,h=Ys;l=(h&~(1<<32-qo(h)-1)).toString(32)+l,n=":"+n+"R"+l,l=Fp++,0<\/script>",e=e.removeChild(e.firstChild)):typeof h.is=="string"?e=E.createElement(l,{is:h.is}):(e=E.createElement(l),l==="select"&&(E=e,h.multiple?E.multiple=!0:h.size&&(E.size=h.size))):e=E.createElementNS(e,l),e[ys]=n,e[Dp]=h,UA(e,n,!1,!1),n.stateNode=e;e:{switch(E=xv(l,h),l){case"dialog":Dn("cancel",e),Dn("close",e),m=h;break;case"iframe":case"object":case"embed":Dn("load",e),m=h;break;case"video":case"audio":for(m=0;mah&&(n.flags|=128,h=!0,ip(v,!1),n.lanes=4194304)}else{if(!h)if(e=jg(E),e!==null){if(n.flags|=128,h=!0,l=e.updateQueue,l!==null&&(n.updateQueue=l,n.flags|=4),ip(v,!0),v.tail===null&&v.tailMode==="hidden"&&!E.alternate&&!jn)return Qr(n),null}else 2*lr()-v.renderingStartTime>ah&&l!==1073741824&&(n.flags|=128,h=!0,ip(v,!1),n.lanes=4194304);v.isBackwards?(E.sibling=n.child,n.child=E):(l=v.last,l!==null?l.sibling=E:n.child=E,v.last=E)}return v.tail!==null?(n=v.tail,v.rendering=n,v.tail=n.sibling,v.renderingStartTime=lr(),n.sibling=null,l=Yn.current,Pn(Yn,h?l&1|2:l&1),n):(Qr(n),null);case 22:case 23:return ix(),h=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==h&&(n.flags|=8192),h&&n.mode&1?ji&1073741824&&(Qr(n),n.subtreeFlags&6&&(n.flags|=8192)):Qr(n),null;case 24:return null;case 25:return null}throw Error(it(156,n.tag))}function LL(e,n){switch(F1(n),n.tag){case 1:return Ii(n.type)&&Rg(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return oh(),On(Ci),On(ni),Z1(),e=n.flags,e&65536&&!(e&128)?(n.flags=e&-65537|128,n):null;case 5:return W1(n),null;case 13:if(On(Yn),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(it(340));rh()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return On(Yn),null;case 4:return oh(),null;case 10:return V1(n.type._context),null;case 22:case 23:return ix(),null;case 24:return null;default:return null}}var Zm=!1,ti=!1,RL=typeof WeakSet=="function"?WeakSet:Set,yt=null;function Vu(e,n){var l=e.ref;if(l!==null)if(typeof l=="function")try{l(null)}catch(h){or(e,n,h)}else l.current=null}function Zv(e,n,l){try{l()}catch(h){or(e,n,h)}}var _E=!1;function DL(e,n){if(Mv=Mg,e=ZS(),O1(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var h=l.getSelection&&l.getSelection();if(h&&h.rangeCount!==0){l=h.anchorNode;var m=h.anchorOffset,v=h.focusNode;h=h.focusOffset;try{l.nodeType,v.nodeType}catch{l=null;break e}var E=0,s=-1,k=-1,D=0,V=0,G=e,J=null;t:for(;;){for(var ve;G!==l||m!==0&&G.nodeType!==3||(s=E+m),G!==v||h!==0&&G.nodeType!==3||(k=E+h),G.nodeType===3&&(E+=G.nodeValue.length),(ve=G.firstChild)!==null;)J=G,G=ve;for(;;){if(G===e)break t;if(J===l&&++D===m&&(s=E),J===v&&++V===h&&(k=E),(ve=G.nextSibling)!==null)break;G=J,J=G.parentNode}G=ve}l=s===-1||k===-1?null:{start:s,end:k}}else l=null}l=l||{start:0,end:0}}else l=null;for(Pv={focusedElem:e,selectionRange:l},Mg=!1,yt=n;yt!==null;)if(n=yt,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,yt=e;else for(;yt!==null;){n=yt;try{var ae=n.alternate;if(n.flags&1024)switch(n.tag){case 0:case 11:case 15:break;case 1:if(ae!==null){var me=ae.memoizedProps,Ce=ae.memoizedState,ie=n.stateNode,te=ie.getSnapshotBeforeUpdate(n.elementType===n.type?me:jo(n.type,me),Ce);ie.__reactInternalSnapshotBeforeUpdate=te}break;case 3:var le=n.stateNode.containerInfo;le.nodeType===1?le.textContent="":le.nodeType===9&&le.documentElement&&le.removeChild(le.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(it(163))}}catch(ze){or(n,n.return,ze)}if(e=n.sibling,e!==null){e.return=n.return,yt=e;break}yt=n.return}return ae=_E,_E=!1,ae}function xp(e,n,l){var h=n.updateQueue;if(h=h!==null?h.lastEffect:null,h!==null){var m=h=h.next;do{if((m.tag&e)===e){var v=m.destroy;m.destroy=void 0,v!==void 0&&Zv(n,l,v)}m=m.next}while(m!==h)}}function m_(e,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var l=n=n.next;do{if((l.tag&e)===e){var h=l.create;l.destroy=h()}l=l.next}while(l!==n)}}function Hv(e){var n=e.ref;if(n!==null){var l=e.stateNode;switch(e.tag){case 5:e=l;break;default:e=l}typeof n=="function"?n(e):n.current=e}}function $A(e){var n=e.alternate;n!==null&&(e.alternate=null,$A(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[ys],delete n[Dp],delete n[Rv],delete n[_L],delete n[yL])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function GA(e){return e.tag===5||e.tag===3||e.tag===4}function yE(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||GA(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Xv(e,n,l){var h=e.tag;if(h===5||h===6)e=e.stateNode,n?l.nodeType===8?l.parentNode.insertBefore(e,n):l.insertBefore(e,n):(l.nodeType===8?(n=l.parentNode,n.insertBefore(e,l)):(n=l,n.appendChild(e)),l=l._reactRootContainer,l!=null||n.onclick!==null||(n.onclick=Lg));else if(h!==4&&(e=e.child,e!==null))for(Xv(e,n,l),e=e.sibling;e!==null;)Xv(e,n,l),e=e.sibling}function Kv(e,n,l){var h=e.tag;if(h===5||h===6)e=e.stateNode,n?l.insertBefore(e,n):l.appendChild(e);else if(h!==4&&(e=e.child,e!==null))for(Kv(e,n,l),e=e.sibling;e!==null;)Kv(e,n,l),e=e.sibling}var Fr=null,Vo=!1;function ja(e,n,l){for(l=l.child;l!==null;)qA(e,n,l),l=l.sibling}function qA(e,n,l){if(vs&&typeof vs.onCommitFiberUnmount=="function")try{vs.onCommitFiberUnmount(a_,l)}catch{}switch(l.tag){case 5:ti||Vu(l,n);case 6:var h=Fr,m=Vo;Fr=null,ja(e,n,l),Fr=h,Vo=m,Fr!==null&&(Vo?(e=Fr,l=l.stateNode,e.nodeType===8?e.parentNode.removeChild(l):e.removeChild(l)):Fr.removeChild(l.stateNode));break;case 18:Fr!==null&&(Vo?(e=Fr,l=l.stateNode,e.nodeType===8?U0(e.parentNode,l):e.nodeType===1&&U0(e,l),Mp(e)):U0(Fr,l.stateNode));break;case 4:h=Fr,m=Vo,Fr=l.stateNode.containerInfo,Vo=!0,ja(e,n,l),Fr=h,Vo=m;break;case 0:case 11:case 14:case 15:if(!ti&&(h=l.updateQueue,h!==null&&(h=h.lastEffect,h!==null))){m=h=h.next;do{var v=m,E=v.destroy;v=v.tag,E!==void 0&&(v&2||v&4)&&Zv(l,n,E),m=m.next}while(m!==h)}ja(e,n,l);break;case 1:if(!ti&&(Vu(l,n),h=l.stateNode,typeof h.componentWillUnmount=="function"))try{h.props=l.memoizedProps,h.state=l.memoizedState,h.componentWillUnmount()}catch(s){or(l,n,s)}ja(e,n,l);break;case 21:ja(e,n,l);break;case 22:l.mode&1?(ti=(h=ti)||l.memoizedState!==null,ja(e,n,l),ti=h):ja(e,n,l);break;default:ja(e,n,l)}}function vE(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var l=e.stateNode;l===null&&(l=e.stateNode=new RL),n.forEach(function(h){var m=GL.bind(null,e,h);l.has(h)||(l.add(h),h.then(m,m))})}}function Uo(e,n){var l=n.deletions;if(l!==null)for(var h=0;hm&&(m=E),h&=~v}if(h=m,h=lr()-h,h=(120>h?120:480>h?480:1080>h?1080:1920>h?1920:3e3>h?3e3:4320>h?4320:1960*BL(h/1960))-h,10e?16:e,Xa===null)var h=!1;else{if(e=Xa,Xa=null,Wg=0,nn&6)throw Error(it(331));var m=nn;for(nn|=4,yt=e.current;yt!==null;){var v=yt,E=v.child;if(yt.flags&16){var s=v.deletions;if(s!==null){for(var k=0;klr()-nx?pc(e,0):tx|=l),ki(e,n)}function QA(e,n){n===0&&(e.mode&1?(n=Fm,Fm<<=1,!(Fm&130023424)&&(Fm=4194304)):n=1);var l=ui();e=ra(e,n),e!==null&&(Jp(e,n,l),ki(e,l))}function $L(e){var n=e.memoizedState,l=0;n!==null&&(l=n.retryLane),QA(e,l)}function GL(e,n){var l=0;switch(e.tag){case 13:var h=e.stateNode,m=e.memoizedState;m!==null&&(l=m.retryLane);break;case 19:h=e.stateNode;break;default:throw Error(it(314))}h!==null&&h.delete(n),QA(e,l)}var eC;eC=function(e,n,l){if(e!==null)if(e.memoizedProps!==n.pendingProps||Ci.current)Ai=!0;else{if(!(e.lanes&l)&&!(n.flags&128))return Ai=!1,PL(e,n,l);Ai=!!(e.flags&131072)}else Ai=!1,jn&&n.flags&1048576&&iA(n,Bg,n.index);switch(n.lanes=0,n.tag){case 2:var h=n.type;dg(e,n),e=n.pendingProps;var m=nh(n,ni.current);Xu(n,l),m=X1(null,n,h,e,m,l);var v=K1();return n.flags|=1,typeof m=="object"&&m!==null&&typeof m.render=="function"&&m.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,Ii(h)?(v=!0,Dg(n)):v=!1,n.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,G1(n),m.updater=f_,n.stateNode=m,m._reactInternals=n,Uv(n,h,e,l),n=$v(null,n,h,!0,v,l)):(n.tag=0,jn&&v&&B1(n),ci(null,n,m,l),n=n.child),n;case 16:h=n.elementType;e:{switch(dg(e,n),e=n.pendingProps,m=h._init,h=m(h._payload),n.type=h,m=n.tag=WL(h),e=jo(h,e),m){case 0:n=Vv(null,n,h,e,l);break e;case 1:n=fE(null,n,h,e,l);break e;case 11:n=dE(null,n,h,e,l);break e;case 14:n=pE(null,n,h,jo(h.type,e),l);break e}throw Error(it(306,h,""))}return n;case 0:return h=n.type,m=n.pendingProps,m=n.elementType===h?m:jo(h,m),Vv(e,n,h,m,l);case 1:return h=n.type,m=n.pendingProps,m=n.elementType===h?m:jo(h,m),fE(e,n,h,m,l);case 3:e:{if(BA(n),e===null)throw Error(it(387));h=n.pendingProps,v=n.memoizedState,m=v.element,uA(e,n),Ug(n,h,null,l);var E=n.memoizedState;if(h=E.element,v.isDehydrated)if(v={element:h,isDehydrated:!1,cache:E.cache,pendingSuspenseBoundaries:E.pendingSuspenseBoundaries,transitions:E.transitions},n.updateQueue.baseState=v,n.memoizedState=v,n.flags&256){m=sh(Error(it(423)),n),n=mE(e,n,h,l,m);break e}else if(h!==m){m=sh(Error(it(424)),n),n=mE(e,n,h,l,m);break e}else for($i=el(n.stateNode.containerInfo.firstChild),Gi=n,jn=!0,$o=null,l=lA(n,null,h,l),n.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(rh(),h===m){n=ia(e,n,l);break e}ci(e,n,h,l)}n=n.child}return n;case 5:return hA(n),e===null&&Bv(n),h=n.type,m=n.pendingProps,v=e!==null?e.memoizedProps:null,E=m.children,zv(h,m)?E=null:v!==null&&zv(h,v)&&(n.flags|=32),OA(e,n),ci(e,n,E,l),n.child;case 6:return e===null&&Bv(n),null;case 13:return FA(e,n,l);case 4:return q1(n,n.stateNode.containerInfo),h=n.pendingProps,e===null?n.child=ih(n,null,h,l):ci(e,n,h,l),n.child;case 11:return h=n.type,m=n.pendingProps,m=n.elementType===h?m:jo(h,m),dE(e,n,h,m,l);case 7:return ci(e,n,n.pendingProps,l),n.child;case 8:return ci(e,n,n.pendingProps.children,l),n.child;case 12:return ci(e,n,n.pendingProps.children,l),n.child;case 10:e:{if(h=n.type._context,m=n.pendingProps,v=n.memoizedProps,E=m.value,Pn(Fg,h._currentValue),h._currentValue=E,v!==null)if(Xo(v.value,E)){if(v.children===m.children&&!Ci.current){n=ia(e,n,l);break e}}else for(v=n.child,v!==null&&(v.return=n);v!==null;){var s=v.dependencies;if(s!==null){E=v.child;for(var k=s.firstContext;k!==null;){if(k.context===h){if(v.tag===1){k=Qs(-1,l&-l),k.tag=2;var D=v.updateQueue;if(D!==null){D=D.shared;var V=D.pending;V===null?k.next=k:(k.next=V.next,V.next=k),D.pending=k}}v.lanes|=l,k=v.alternate,k!==null&&(k.lanes|=l),Fv(v.return,l,n),s.lanes|=l;break}k=k.next}}else if(v.tag===10)E=v.type===n.type?null:v.child;else if(v.tag===18){if(E=v.return,E===null)throw Error(it(341));E.lanes|=l,s=E.alternate,s!==null&&(s.lanes|=l),Fv(E,l,n),E=v.sibling}else E=v.child;if(E!==null)E.return=v;else for(E=v;E!==null;){if(E===n){E=null;break}if(v=E.sibling,v!==null){v.return=E.return,E=v;break}E=E.return}v=E}ci(e,n,m.children,l),n=n.child}return n;case 9:return m=n.type,h=n.pendingProps.children,Xu(n,l),m=mo(m),h=h(m),n.flags|=1,ci(e,n,h,l),n.child;case 14:return h=n.type,m=jo(h,n.pendingProps),m=jo(h.type,m),pE(e,n,h,m,l);case 15:return RA(e,n,n.type,n.pendingProps,l);case 17:return h=n.type,m=n.pendingProps,m=n.elementType===h?m:jo(h,m),dg(e,n),n.tag=1,Ii(h)?(e=!0,Dg(n)):e=!1,Xu(n,l),PA(n,h,m),Uv(n,h,m,l),$v(null,n,h,!0,e,l);case 19:return NA(e,n,l);case 22:return DA(e,n,l)}throw Error(it(156,n.tag))};function tC(e,n){return IS(e,n)}function qL(e,n,l,h){this.tag=e,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function po(e,n,l,h){return new qL(e,n,l,h)}function sx(e){return e=e.prototype,!(!e||!e.isReactComponent)}function WL(e){if(typeof e=="function")return sx(e)?1:0;if(e!=null){if(e=e.$$typeof,e===S1)return 11;if(e===A1)return 14}return 2}function il(e,n){var l=e.alternate;return l===null?(l=po(e.tag,n,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=n,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&14680064,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,n=e.dependencies,l.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l}function mg(e,n,l,h,m,v){var E=2;if(h=e,typeof e=="function")sx(e)&&(E=1);else if(typeof e=="string")E=5;else e:switch(e){case Lu:return fc(l.children,m,v,n);case T1:E=8,m|=8;break;case uv:return e=po(12,l,n,m|2),e.elementType=uv,e.lanes=v,e;case hv:return e=po(13,l,n,m),e.elementType=hv,e.lanes=v,e;case dv:return e=po(19,l,n,m),e.elementType=dv,e.lanes=v,e;case hS:return __(l,m,v,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case cS:E=10;break e;case uS:E=9;break e;case S1:E=11;break e;case A1:E=14;break e;case Ga:E=16,h=null;break e}throw Error(it(130,e==null?e:typeof e,""))}return n=po(E,l,n,m),n.elementType=e,n.type=h,n.lanes=v,n}function fc(e,n,l,h){return e=po(7,e,h,n),e.lanes=l,e}function __(e,n,l,h){return e=po(22,e,h,n),e.elementType=hS,e.lanes=l,e.stateNode={isHidden:!1},e}function H0(e,n,l){return e=po(6,e,null,n),e.lanes=l,e}function X0(e,n,l){return n=po(4,e.children!==null?e.children:[],e.key,n),n.lanes=l,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function ZL(e,n,l,h,m){this.tag=n,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=k0(0),this.expirationTimes=k0(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=k0(0),this.identifierPrefix=h,this.onRecoverableError=m,this.mutableSourceEagerHydrationData=null}function ax(e,n,l,h,m,v,E,s,k){return e=new ZL(e,n,l,s,k),n===1?(n=1,v===!0&&(n|=8)):n=0,v=po(3,null,null,n),e.current=v,v.stateNode=e,v.memoizedState={element:h,isDehydrated:l,cache:null,transitions:null,pendingSuspenseBoundaries:null},G1(v),e}function HL(e,n,l){var h=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(oC)}catch(e){console.error(e)}}oC(),oS.exports=Hi;var hx=oS.exports,sC,CE=hx;sC=CE.createRoot,CE.hydrateRoot;const QL="Logging",eR="NoHubcallbackProvidedException";var Ui;(function(e){e.DEBUG="DEBUG",e.ERROR="ERROR",e.INFO="INFO",e.WARN="WARN",e.VERBOSE="VERBOSE",e.NONE="NONE"})(Ui||(Ui={}));const IE={VERBOSE:1,DEBUG:2,INFO:3,WARN:4,ERROR:5,NONE:6};class Zo{constructor(n,l=Ui.WARN){this.name=n,this.level=l,this._pluggables=[]}_padding(n){return n<10?"0"+n:""+n}_ts(){const n=new Date;return[this._padding(n.getMinutes()),this._padding(n.getSeconds())].join(":")+"."+n.getMilliseconds()}configure(n){return n?(this._config=n,this._config):this._config}_log(n,...l){let h=this.level;Zo.LOG_LEVEL&&(h=Zo.LOG_LEVEL),typeof window<"u"&&window.LOG_LEVEL&&(h=window.LOG_LEVEL);const m=IE[h];if(!(IE[n]>=m))return;let E=console.log.bind(console);n===Ui.ERROR&&console.error&&(E=console.error.bind(console)),n===Ui.WARN&&console.warn&&(E=console.warn.bind(console)),Zo.BIND_ALL_LOG_LEVELS&&(n===Ui.INFO&&console.info&&(E=console.info.bind(console)),n===Ui.DEBUG&&console.debug&&(E=console.debug.bind(console)));const s=`[${n}] ${this._ts()} ${this.name}`;let k="";if(l.length===1&&typeof l[0]=="string")k=`${s} - ${l[0]}`,E(k);else if(l.length===1)k=`${s} ${l[0]}`,E(s,l[0]);else if(typeof l[0]=="string"){let D=l.slice(1);D.length===1&&(D=D[0]),k=`${s} - ${l[0]} ${D}`,E(`${s} - ${l[0]}`,D)}else k=`${s} ${l}`,E(s,l);for(const D of this._pluggables){const V={message:k,timestamp:Date.now()};D.pushLogs([V])}}log(...n){this._log(Ui.INFO,...n)}info(...n){this._log(Ui.INFO,...n)}warn(...n){this._log(Ui.WARN,...n)}error(...n){this._log(Ui.ERROR,...n)}debug(...n){this._log(Ui.DEBUG,...n)}verbose(...n){this._log(Ui.VERBOSE,...n)}addPluggable(n){n&&n.getCategoryName()===QL&&(this._pluggables.push(n),n.configure(this._config))}listPluggables(){return this._pluggables}}Zo.LOG_LEVEL=null;Zo.BIND_ALL_LOG_LEVELS=!1;class bs extends Error{constructor({message:n,name:l,recoverySuggestion:h,underlyingError:m}){super(n),this.name=l,this.underlyingError=m,this.recoverySuggestion=h,this.constructor=bs,Object.setPrototypeOf(this,bs.prototype)}}var Vp;(function(e){e.NoEndpointId="NoEndpointId",e.PlatformNotSupported="PlatformNotSupported",e.Unknown="Unknown",e.NetworkError="NetworkError"})(Vp||(Vp={}));const aC=(e,n=bs)=>(l,h,m)=>{const{message:v,recoverySuggestion:E}=e[h];if(!l)throw new n({name:h,message:m?`${v} ${m}`:v,recoverySuggestion:E})},Xg=typeof Symbol<"u"?Symbol("amplify_default"):"@@amplify_default",sp=new Zo("Hub");class tR{constructor(n){this.listeners=new Map,this.protectedChannels=["core","auth","api","analytics","interactions","pubsub","storage","ui","xr"],this.name=n}_remove(n,l){const h=this.listeners.get(n);if(!h){sp.warn(`No listeners for ${n}`);return}this.listeners.set(n,[...h.filter(({callback:m})=>m!==l)])}dispatch(n,l,h,m){typeof n=="string"&&this.protectedChannels.indexOf(n)>-1&&(m===Xg||sp.warn(`WARNING: ${n} is protected and dispatching on it can have unintended consequences`));const v={channel:n,payload:{...l},source:h,patternInfo:[]};try{this._toListeners(v)}catch(E){sp.error(E)}}listen(n,l,h="noname"){let m;if(typeof l!="function")throw new bs({name:eR,message:"No callback supplied to Hub"});m=l;let v=this.listeners.get(n);return v||(v=[],this.listeners.set(n,v)),v.push({name:h,callback:m}),()=>{this._remove(n,m)}}_toListeners(n){const{channel:l,payload:h}=n,m=this.listeners.get(l);m&&m.forEach(v=>{sp.debug(`Dispatching to ${l} with `,h);try{v.callback(n)}catch(E){sp.error(E)}})}}const t1=new tR("__default__"),nR=()=>{if(typeof window<"u"&&typeof window.atob=="function")return window.atob;if(typeof atob=="function")return atob;throw new bs({name:"Base64EncoderError",message:"Cannot resolve the `atob` function from the environment."})},rR={convert(e){return nR()(e)}};var Xs;(function(e){e.AuthTokenConfigException="AuthTokenConfigException",e.AuthUserPoolAndIdentityPoolException="AuthUserPoolAndIdentityPoolException",e.AuthUserPoolException="AuthUserPoolException",e.InvalidIdentityPoolIdException="InvalidIdentityPoolIdException",e.OAuthNotConfigureException="OAuthNotConfigureException"})(Xs||(Xs={}));const iR={[Xs.AuthTokenConfigException]:{message:"Auth Token Provider not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app."},[Xs.AuthUserPoolAndIdentityPoolException]:{message:"Auth UserPool or IdentityPool not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app with UserPoolId and IdentityPoolId."},[Xs.AuthUserPoolException]:{message:"Auth UserPool not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app with userPoolId and userPoolClientId."},[Xs.InvalidIdentityPoolIdException]:{message:"Invalid identity pool id provided.",recoverySuggestion:"Make sure a valid identityPoolId is given in the config."},[Xs.OAuthNotConfigureException]:{message:"oauth param not configured.",recoverySuggestion:"Make sure to call Amplify.configure with oauth parameter in your app."}},lC=aC(iR);function Ti(e){let n=!0;e?n=!!e.userPoolId&&!!e.userPoolClientId:n=!1,lC(n,Xs.AuthUserPoolException)}function gg(e){const n=!!(e!=null&&e.identityPoolId);lC(n,Xs.InvalidIdentityPoolIdException)}function $p(e){const n=e.split(".");if(n.length!==3)throw new Error("Invalid token");try{const h=n[1].replace(/-/g,"+").replace(/_/g,"/"),m=decodeURIComponent(rR.convert(h).split("").map(E=>`%${`00${E.charCodeAt(0).toString(16)}`.slice(-2)}`).join("")),v=JSON.parse(m);return{toString:()=>e,payload:v}}catch{throw new Error("Invalid token payload")}}const cC=e=>{const n=Reflect.ownKeys(e);for(const l of n){const h=e[l];(h&&typeof h=="object"||typeof h=="function")&&cC(h)}return Object.freeze(e)},oR=new Zo("parseAWSExports"),sR={API_KEY:"apiKey",AWS_IAM:"iam",AMAZON_COGNITO_USER_POOLS:"userPool",OPENID_CONNECT:"oidc",NONE:"none",AWS_LAMBDA:"lambda",LAMBDA:"lambda"},aR=(e={})=>{var sr,ii,ar,br,Es,Yi;if(!Object.prototype.hasOwnProperty.call(e,"aws_project_region"))throw new bs({name:"InvalidParameterException",message:"Invalid config parameter.",recoverySuggestion:"Ensure passing the config object imported from `amplifyconfiguration.json`."});const{aws_appsync_apiKey:n,aws_appsync_authenticationType:l,aws_appsync_graphqlEndpoint:h,aws_appsync_region:m,aws_bots_config:v,aws_cognito_identity_pool_id:E,aws_cognito_sign_up_verification_method:s,aws_cognito_mfa_configuration:k,aws_cognito_mfa_types:D,aws_cognito_password_protection_settings:V,aws_cognito_verification_mechanisms:G,aws_cognito_signup_attributes:J,aws_cognito_social_providers:ve,aws_cognito_username_attributes:ae,aws_mandatory_sign_in:me,aws_mobile_analytics_app_id:Ce,aws_mobile_analytics_app_region:ie,aws_user_files_s3_bucket:te,aws_user_files_s3_bucket_region:le,aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing:ze,aws_user_pools_id:Oe,aws_user_pools_web_client_id:Ke,geo:He,oauth:ht,predictions:Ve,aws_cloud_logic_custom:jt,Notifications:wr,modelIntrospection:St}=e,Vt={};Ce&&(Vt.Analytics={Pinpoint:{appId:Ce,region:ie}});const{InAppMessaging:Vr,Push:$r}=wr??{};if(Vr!=null&&Vr.AWSPinpoint||$r!=null&&$r.AWSPinpoint){if(Vr!=null&&Vr.AWSPinpoint){const{appId:xn,region:kt}=Vr.AWSPinpoint;Vt.Notifications={InAppMessaging:{Pinpoint:{appId:xn,region:kt}}}}if($r!=null&&$r.AWSPinpoint){const{appId:xn,region:kt}=$r.AWSPinpoint;Vt.Notifications={...Vt.Notifications,PushNotification:{Pinpoint:{appId:xn,region:kt}}}}}if(Array.isArray(v)&&(Vt.Interactions={LexV1:Object.fromEntries(v.map(xn=>[xn.name,xn]))}),h){const xn=sR[l];xn||oR.debug(`Invalid authentication type ${l}. Falling back to IAM.`),Vt.API={GraphQL:{endpoint:h,apiKey:n,region:m,defaultAuthMode:xn??"iam"}},St&&(Vt.API.GraphQL.modelIntrospection=St)}const Li=k?{status:k&&k.toLowerCase(),totpEnabled:(D==null?void 0:D.includes("TOTP"))??!1,smsEnabled:(D==null?void 0:D.includes("SMS"))??!1}:void 0,Ki=V?{minLength:V.passwordPolicyMinLength,requireLowercase:((sr=V.passwordPolicyCharacters)==null?void 0:sr.includes("REQUIRES_LOWERCASE"))??!1,requireUppercase:((ii=V.passwordPolicyCharacters)==null?void 0:ii.includes("REQUIRES_UPPERCASE"))??!1,requireNumbers:((ar=V.passwordPolicyCharacters)==null?void 0:ar.includes("REQUIRES_NUMBERS"))??!1,requireSpecialCharacters:((br=V.passwordPolicyCharacters)==null?void 0:br.includes("REQUIRES_SYMBOLS"))??!1}:void 0,Tt=Array.from(new Set([...G??[],...J??[]])).reduce((xn,kt)=>({...xn,[kt.toLowerCase()]:{required:!0}}),{}),xt=(ae==null?void 0:ae.includes("EMAIL"))??!1,Bt=(ae==null?void 0:ae.includes("PHONE_NUMBER"))??!1;(E||Oe)&&(Vt.Auth={Cognito:{identityPoolId:E,allowGuestAccess:me!=="enable",signUpVerificationMethod:s,userAttributes:Tt,userPoolClientId:Ke,userPoolId:Oe,mfa:Li,passwordFormat:Ki,loginWith:{username:!(xt||Bt),email:xt,phone:Bt}}});const dn=ht?Object.keys(ht).length>0:!1,vn=ve?ve.length>0:!1;if(Vt.Auth&&dn&&(Vt.Auth.Cognito.loginWith={...Vt.Auth.Cognito.loginWith,oauth:{...lR(ht),...vn&&{providers:cR(ve)}}}),te&&(Vt.Storage={S3:{bucket:te,region:le,dangerouslyConnectToHttpEndpointForTesting:ze}}),He){const{amazon_location_service:xn}=He;Vt.Geo={LocationService:{maps:xn.maps,geofenceCollections:xn.geofenceCollections,searchIndices:xn.search_indices,region:xn.region}}}if(jt&&(Vt.API={...Vt.API,REST:jt.reduce((xn,kt)=>{const{name:Yo,endpoint:Dr,region:Jo,service:wn}=kt;return{...xn,[Yo]:{endpoint:Dr,...wn?{service:wn}:void 0,...Jo?{region:Jo}:void 0}}},{})}),Ve){const{VoiceId:xn}=((Yi=(Es=Ve==null?void 0:Ve.convert)==null?void 0:Es.speechGenerator)==null?void 0:Yi.defaults)??{};Vt.Predictions=xn?{...Ve,convert:{...Ve.convert,speechGenerator:{...Ve.convert.speechGenerator,defaults:{voiceId:xn}}}}:Ve}return Vt},kE=e=>(e==null?void 0:e.split(","))??[],lR=({domain:e,scope:n,redirectSignIn:l,redirectSignOut:h,responseType:m})=>({domain:e,scopes:n,redirectSignIn:kE(l),redirectSignOut:kE(h),responseType:m}),cR=e=>e.map(n=>{const l=n.toLowerCase();return l.charAt(0).toUpperCase()+l.slice(1)}),uR=Symbol("oauth-listener");function hR(e){const{version:n}=e;return n?n.startsWith("1"):!1}function dR(e){if(!e)return;const{bucket_name:n,aws_region:l,buckets:h}=e;return{S3:{bucket:n,region:l,buckets:h&&ER(h)}}}function pR(e){if(!e)return;const{user_pool_id:n,user_pool_client_id:l,identity_pool_id:h,password_policy:m,mfa_configuration:v,mfa_methods:E,unauthenticated_identities_enabled:s,oauth:k,username_attributes:D,standard_required_attributes:V}=e,G={Cognito:{userPoolId:n,userPoolClientId:l}};return h&&(G.Cognito={...G.Cognito,identityPoolId:h}),m&&(G.Cognito.passwordFormat={requireLowercase:m.require_lowercase,requireNumbers:m.require_numbers,requireUppercase:m.require_uppercase,requireSpecialCharacters:m.require_symbols,minLength:m.min_length??6}),v&&(G.Cognito.mfa={status:bR(v),smsEnabled:E==null?void 0:E.includes("SMS"),totpEnabled:E==null?void 0:E.includes("TOTP")}),s&&(G.Cognito.allowGuestAccess=s),k&&(G.Cognito.loginWith={oauth:{domain:k.domain,redirectSignIn:k.redirect_sign_in_uri,redirectSignOut:k.redirect_sign_out_uri,responseType:k.response_type==="token"?"token":"code",scopes:k.scopes,providers:wR(k.identity_providers)}}),D&&(G.Cognito.loginWith={...G.Cognito.loginWith,email:D.includes("email"),phone:D.includes("phone_number"),username:D.includes("username")}),V&&(G.Cognito.userAttributes=V.reduce((J,ve)=>({...J,[ve]:{required:!0}}),{})),G}function fR(e){if(!(e!=null&&e.amazon_pinpoint))return;const{amazon_pinpoint:n}=e;return{Pinpoint:{appId:n.app_id,region:n.aws_region}}}function mR(e){if(!e)return;const{aws_region:n,geofence_collections:l,maps:h,search_indices:m}=e;return{LocationService:{region:n,searchIndices:m,geofenceCollections:l,maps:h}}}function gR(e){if(!e)return;const{aws_region:n,default_authorization_type:l,url:h,api_key:m,model_introspection:v}=e;return{GraphQL:{endpoint:h,defaultAuthMode:xR(l),region:n,apiKey:m,modelIntrospection:v}}}function _R(e){if(!e)return;const{aws_region:n,channels:l,amazon_pinpoint_app_id:h}=e,m=l.includes("IN_APP_MESSAGING"),v=l.includes("APNS")||l.includes("FCM");if(!(m||v))return;const E={};return m&&(E.InAppMessaging={Pinpoint:{appId:h,region:n}}),v&&(E.PushNotification={Pinpoint:{appId:h,region:n}}),E}function yR(e){const n={};return e.storage&&(n.Storage=dR(e.storage)),e.auth&&(n.Auth=pR(e.auth)),e.analytics&&(n.Analytics=fR(e.analytics)),e.geo&&(n.Geo=mR(e.geo)),e.data&&(n.API=gR(e.data)),e.notifications&&(n.Notifications=_R(e.notifications)),n}const vR={AMAZON_COGNITO_USER_POOLS:"userPool",API_KEY:"apiKey",AWS_IAM:"iam",AWS_LAMBDA:"lambda",OPENID_CONNECT:"oidc"};function xR(e){return vR[e]}const ME={GOOGLE:"Google",LOGIN_WITH_AMAZON:"Amazon",FACEBOOK:"Facebook",SIGN_IN_WITH_APPLE:"Apple"};function wR(e=[]){return e.reduce((n,l)=>(ME[l]!==void 0&&n.push(ME[l]),n),[])}function bR(e){return e==="OPTIONAL"?"optional":e==="REQUIRED"?"on":"off"}function ER(e){const n={};return e.forEach(({name:l,bucket_name:h,aws_region:m})=>{if(l in n)throw new Error(`Duplicate friendly name found: ${l}. Name must be unique.`);n[l]={bucketName:h,region:m}}),n}const uC=e=>Object.keys(e).some(n=>n.startsWith("aws_"))?aR(e):hR(e)?yR(e):e;function PE({expiresAt:e,clockDrift:n}){return Date.now()+n>e}class TR{configure(n,l){this.authConfig=n,this.authOptions=l}async fetchAuthSession(n={}){var v,E,s,k,D,V;let l,h;const m=await this.getTokens(n);return m?(h=(E=(v=m.accessToken)==null?void 0:v.payload)==null?void 0:E.sub,l=await((k=(s=this.authOptions)==null?void 0:s.credentialsProvider)==null?void 0:k.getCredentialsAndIdentityId({authConfig:this.authConfig,tokens:m,authenticated:!0,forceRefresh:n.forceRefresh}))):l=await((V=(D=this.authOptions)==null?void 0:D.credentialsProvider)==null?void 0:V.getCredentialsAndIdentityId({authConfig:this.authConfig,authenticated:!1,forceRefresh:n.forceRefresh})),{tokens:m,credentials:l==null?void 0:l.credentials,identityId:l==null?void 0:l.identityId,userSub:h}}async clearCredentials(){var n,l;await((l=(n=this.authOptions)==null?void 0:n.credentialsProvider)==null?void 0:l.clearCredentialsAndIdentityId())}async getTokens(n){var l,h;return await((h=(l=this.authOptions)==null?void 0:l.tokenProvider)==null?void 0:h.getTokens(n))??void 0}}const SR=e=>new TextEncoder().encode(e);typeof Buffer<"u"&&Buffer.from;for(let e=0;e<256;e++){let n=e.toString(16).toLowerCase();n.length===1&&(n=`0${n}`)}var _r;(function(e){e.WebUnknown="0",e.React="1",e.NextJs="2",e.Angular="3",e.VueJs="4",e.Nuxt="5",e.Svelte="6",e.ServerSideUnknown="100",e.ReactSSR="101",e.NextJsSSR="102",e.AngularSSR="103",e.VueJsSSR="104",e.NuxtSSR="105",e.SvelteSSR="106",e.ReactNative="201",e.Expo="202"})(_r||(_r={}));var zE;(function(e){e.API="api",e.Auth="auth",e.Analytics="analytics",e.DataStore="datastore",e.Geo="geo",e.InAppMessaging="inappmessaging",e.Interactions="interactions",e.Predictions="predictions",e.PubSub="pubsub",e.PushNotification="pushnotification",e.Storage="storage"})(zE||(zE={}));var LE;(function(e){e.Record="1",e.IdentifyUser="2"})(LE||(LE={}));var RE;(function(e){e.GraphQl="1",e.Get="2",e.Post="3",e.Put="4",e.Patch="5",e.Del="6",e.Head="7"})(RE||(RE={}));var DE;(function(e){e.SignUp="1",e.ConfirmSignUp="2",e.ResendSignUpCode="3",e.SignIn="4",e.FetchMFAPreference="6",e.UpdateMFAPreference="7",e.SetUpTOTP="10",e.VerifyTOTPSetup="11",e.ConfirmSignIn="12",e.DeleteUserAttributes="15",e.DeleteUser="16",e.UpdateUserAttributes="17",e.FetchUserAttributes="18",e.ConfirmUserAttribute="22",e.SignOut="26",e.UpdatePassword="27",e.ResetPassword="28",e.ConfirmResetPassword="29",e.FederatedSignIn="30",e.RememberDevice="32",e.ForgetDevice="33",e.FetchDevices="34",e.SendUserAttributeVerificationCode="35",e.SignInWithRedirect="36"})(DE||(DE={}));var OE;(function(e){e.Subscribe="1",e.GraphQl="2"})(OE||(OE={}));var BE;(function(e){e.SearchByText="0",e.SearchByCoordinates="1",e.SearchForSuggestions="2",e.SearchByPlaceId="3",e.SaveGeofences="4",e.GetGeofence="5",e.ListGeofences="6",e.DeleteGeofences="7"})(BE||(BE={}));var FE;(function(e){e.SyncMessages="1",e.IdentifyUser="2",e.NotifyMessageInteraction="3"})(FE||(FE={}));var NE;(function(e){e.None="0"})(NE||(NE={}));var UE;(function(e){e.Convert="1",e.Identify="2",e.Interpret="3"})(UE||(UE={}));var jE;(function(e){e.Subscribe="1"})(jE||(jE={}));var VE;(function(e){e.InitializePushNotifications="1",e.IdentifyUser="2"})(VE||(VE={}));var $E;(function(e){e.UploadData="1",e.DownloadData="2",e.List="3",e.Copy="4",e.Remove="5",e.GetProperties="6",e.GetUrl="7"})($E||($E={}));const b_=()=>typeof global<"u",fh=()=>typeof window<"u",hC=()=>typeof document<"u",dx=()=>typeof process<"u",Gp=(e,n)=>!!Object.keys(e).find(l=>l.startsWith(n));function AR(){const e=h=>h.startsWith("_react")||h.startsWith("__react"),n=h=>Object.keys(h).find(e),l=()=>Array.from(document.querySelectorAll("[id]"));return hC()&&l().some(n)}function CR(){return dx()&&typeof process.env<"u"&&!!Object.keys(process.env).find(e=>e.includes("react"))}function IR(){return fh()&&Gp(window,"__VUE")}function kR(){return b_()&&Gp(global,"__VUE")}function MR(){return fh()&&Gp(window,"__SVELTE")}function PR(){return dx()&&typeof process.env<"u"&&!!Object.keys(process.env).find(e=>e.includes("svelte"))}function zR(){return fh()&&window.next&&typeof window.next=="object"}function LR(){return b_()&&(Gp(global,"__next")||Gp(global,"__NEXT"))}function RR(){return fh()&&(window.__NUXT__!==void 0||window.$nuxt!==void 0)}function DR(){return b_()&&typeof global.__NUXT_PATHS__<"u"}function OR(){const e=!!(hC()&&document.querySelector("[ng-version]")),n=!!(fh()&&typeof window.ng<"u");return e||n}function BR(){var e;return dx()&&typeof process.env=="object"&&((e={}.npm_lifecycle_script)==null?void 0:e.startsWith("ng "))||!1}function FR(){return typeof navigator<"u"&&typeof navigator.product<"u"&&navigator.product==="ReactNative"}function NR(){return b_()&&typeof global.expo<"u"}function UR(){return fh()}const jR=[{platform:_r.Expo,detectionMethod:NR},{platform:_r.ReactNative,detectionMethod:FR},{platform:_r.NextJs,detectionMethod:zR},{platform:_r.Nuxt,detectionMethod:RR},{platform:_r.Angular,detectionMethod:OR},{platform:_r.React,detectionMethod:AR},{platform:_r.VueJs,detectionMethod:IR},{platform:_r.Svelte,detectionMethod:MR},{platform:_r.WebUnknown,detectionMethod:UR},{platform:_r.NextJsSSR,detectionMethod:LR},{platform:_r.NuxtSSR,detectionMethod:DR},{platform:_r.ReactSSR,detectionMethod:CR},{platform:_r.VueJsSSR,detectionMethod:kR},{platform:_r.AngularSSR,detectionMethod:BR},{platform:_r.SvelteSSR,detectionMethod:PR}];function VR(){var e;return((e=jR.find(n=>n.detectionMethod()))==null?void 0:e.platform)||_r.ServerSideUnknown}const $R=()=>typeof window<"u"&&typeof window.document<"u";class GR{constructor(){this.oAuthListener=void 0,this.resourcesConfig={},this.libraryOptions={},this.Auth=new TR}configure(n,l){const h=uC(n);this.resourcesConfig=h,l&&(this.libraryOptions=l),this.resourcesConfig=cC(this.resourcesConfig),this.Auth.configure(this.resourcesConfig.Auth,this.libraryOptions.Auth),t1.dispatch("core",{event:"configure",data:this.resourcesConfig},"Configure",Xg),this.notifyOAuthListener()}getConfig(){return this.resourcesConfig}[uR](n){var l,h,m;(h=(l=this.resourcesConfig.Auth)==null?void 0:l.Cognito.loginWith)!=null&&h.oauth?n((m=this.resourcesConfig.Auth)==null?void 0:m.Cognito):this.oAuthListener=n}notifyOAuthListener(){var n,l,h;!((l=(n=this.resourcesConfig.Auth)==null?void 0:n.Cognito.loginWith)!=null&&l.oauth)||!this.oAuthListener||(this.oAuthListener((h=this.resourcesConfig.Auth)==null?void 0:h.Cognito),this.oAuthListener=void 0)}}const Ws=new GR,E_=e=>{const{headers:n,statusCode:l}=e;return{...qR(e)?e.$metadata:{},httpStatusCode:l,requestId:n["x-amzn-requestid"]??n["x-amzn-request-id"]??n["x-amz-request-id"],extendedRequestId:n["x-amz-id-2"],cfId:n["x-amz-cf-id"]}},qR=e=>typeof(e==null?void 0:e.$metadata)=="object",nf=async e=>{if(!e||e.statusCode<300)return;const n=await T_(e),h=(E=>{const[s]=E.toString().split(/[,:]+/);return s.includes("#")?s.split("#")[1]:s})(e.headers["x-amzn-errortype"]??n.code??n.__type??"UnknownError"),m=n.message??n.Message??"Unknown error",v=new Error(m);return Object.assign(v,{name:h,$metadata:E_(e)})},T_=async e=>{if(!e.body)throw new Error("Missing response payload");const n=await e.body.json();return Object.assign(n,{$metadata:E_(e)})},px=(e,n,l,h)=>async(m,v)=>{const E={...h,...m},s=await E.endpointResolver(E,v),k=await n(v,s),D=await e(k,{...E});return l(D)},dC={id:"aws",outputs:{dnsSuffix:"amazonaws.com"},regionRegex:"^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$",regions:["aws-global"]},WR={partitions:[dC,{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn"},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:["aws-cn-global"]}]},pC=e=>{const{partitions:n}=WR;for(const{regions:l,outputs:h,regionRegex:m}of n){const v=new RegExp(m);if(l.includes(e)||v.test(e))return h.dnsSuffix}return dC.outputs.dnsSuffix},ZR=3,HR=({maxAttempts:e=ZR,retryDecider:n,computeDelay:l,abortSignal:h})=>{if(e<1)throw new Error("maxAttempts must be greater than 0");return(m,v)=>async function(s){let k,D=v.attemptsCount??0,V;const G=()=>{if(V)return GE(V,D),V;throw GE(k,D),k};for(;!(h!=null&&h.aborted)&&DD?v.attemptsCount??0:D+1,v.attemptsCount=D,await n(V,k)){if(!(h!=null&&h.aborted)&&D{if(n!=null&&n.aborted)return Promise.resolve();let l,h;const m=new Promise(v=>{h=v,l=setTimeout(v,e)});return n==null||n.addEventListener("abort",function v(E){clearTimeout(l),n==null||n.removeEventListener("abort",v),h()}),m},GE=(e,n)=>{Object.prototype.toString.call(e)==="[object Object]"&&(e.$metadata={...e.$metadata??{},attempts:n})},KR=({userAgentHeader:e="x-amz-user-agent",userAgentValue:n=""})=>l=>async function(m){if(n.trim().length===0)return await l(m);{const v=e.toLowerCase();return m.headers[v]=m.headers[v]?`${m.headers[v]} ${n}`:n,await l(m)}},fx=(e,n)=>(l,h)=>{const m={};let v=E=>e(E,h);for(let E=n.length-1;E>=0;E--){const s=n[E];v=s(h)(v,m)}return v(l)},K0=e=>{let n;return()=>(n||(n=e()),n)},YR=e=>!["HEAD","GET","DELETE"].includes(e.toUpperCase()),JR=async({url:e,method:n,headers:l,body:h},{abortSignal:m,cache:v,withCrossDomainCredentials:E})=>{var G;let s;try{s=await fetch(e,{method:n,headers:l,body:YR(n)?h:void 0,signal:m,cache:v,credentials:E?"include":"same-origin"})}catch(J){throw J instanceof TypeError?new bs({name:Vp.NetworkError,message:"A network error has occurred.",underlyingError:J}):J}const k={};(G=s.headers)==null||G.forEach((J,ve)=>{k[ve.toLowerCase()]=J});const D={statusCode:s.status,headers:k,body:null},V=Object.assign(s.body??{},{text:K0(()=>s.text()),blob:K0(()=>s.blob()),json:K0(()=>s.json())});return{...D,body:V}},fC=fx(JR,[KR,HR]),QR=5*60*1e3;function e3(e=QR){return h=>{const m=2**h*100+100*Math.random();return m>e?!1:m}}const qE=5*60*1e3,mC=e=>{const l=e3(qE)(e);return l===!1?qE:l},t3=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch","BadRequestException"],n3=e=>!!e&&t3.includes(e),gC=e=>async(n,l)=>{const h=l??await e(n)??void 0,m=(h==null?void 0:h.code)||(h==null?void 0:h.name),v=n==null?void 0:n.statusCode;return s3(l)||o3(v,m)||n3(m)||a3(v,m)},r3=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException"],i3=["TimeoutError","RequestTimeout","RequestTimeoutException"],o3=(e,n)=>e===429||!!n&&r3.includes(n),s3=e=>(e==null?void 0:e.name)==="Network error",a3=(e,n)=>!!e&&[500,502,503,504].includes(e)||!!n&&i3.includes(n),n1=URL,l3="6.6.0";let Ep;const _g=[];let Kg=!1;const c3=10,u3=10,h3=1e3,_C=()=>{var e;if(!Ep){if(Ep=VR(),Kg)for(;_g.length;)(e=_g.pop())==null||e();else _g.forEach(n=>{n()});WE(_r.ServerSideUnknown,c3),WE(_r.WebUnknown,u3)}return Ep},d3=e=>{Kg||_g.push(e)};function p3(){Ep=void 0}function WE(e,n){Ep===e&&!Kg&&setTimeout(()=>{p3(),Kg=!0,setTimeout(_C,h3)},n)}const f3={},m3=(e,n)=>{var l,h;return(h=(l=f3[e])==null?void 0:l[n])==null?void 0:h.additionalDetails},g3="aws-amplify",_3=({category:e,action:n}={})=>{const l=[[g3,l3]];if(e&&l.push([e,n]),l.push(["framework",_C()]),e&&n){const h=m3(e,n);h&&h.forEach(m=>{l.push(m)})}return l},mx=e=>_3(e).map(([h,m])=>h&&m?`${h}/${m}`:h).join(" "),y3="cognito-identity",v3=({region:e})=>({url:new n1(`https://cognito-identity.${e}.${pC(e)}`)}),x3=()=>e=>async function(l){return l.headers["cache-control"]="no-store",e(l)},yC=fx(fC,[x3]),gx={service:y3,endpointResolver:v3,retryDecider:gC(nf),computeDelay:mC,userAgentValue:mx(),cache:"no-store"};d3(()=>{gx.userAgentValue=mx()});const vC=e=>({"content-type":"application/x-amz-json-1.1","x-amz-target":`AWSCognitoIdentityService.${e}`}),xC=({url:e},n,l)=>({headers:n,url:e,body:l,method:"POST"}),w3=(e,n)=>{const l=vC("GetId"),h=JSON.stringify(e);return xC(n,l,h)},b3=async e=>{if(e.statusCode>=300)throw await nf(e);return{IdentityId:(await T_(e)).IdentityId,$metadata:E_(e)}},E3=px(yC,w3,b3,gx),T3=(e,n)=>{const l=vC("GetCredentialsForIdentity"),h=JSON.stringify(e);return xC(n,l,h)},S3=async e=>{if(e.statusCode>=300)throw await nf(e);{const n=await T_(e);return{IdentityId:n.IdentityId,Credentials:A3(n.Credentials),$metadata:E_(e)}}},A3=({AccessKeyId:e,SecretKey:n,SessionToken:l,Expiration:h}={})=>({AccessKeyId:e,SecretKey:n,SessionToken:l,Expiration:h&&new Date(h*1e3)}),ZE=px(yC,T3,S3,gx);class Km extends bs{constructor(){super({name:Vp.PlatformNotSupported,message:"Function not supported on current platform"})}}class wC{constructor(n){this.storage=n}async setItem(n,l){if(!this.storage)throw new Km;this.storage.setItem(n,l)}async getItem(n){if(!this.storage)throw new Km;return this.storage.getItem(n)}async removeItem(n){if(!this.storage)throw new Km;this.storage.removeItem(n)}async clear(){if(!this.storage)throw new Km;this.storage.clear()}}class bC{constructor(){this.storage=new Map}get length(){return this.storage.size}key(n){return n>this.length-1?null:Array.from(this.storage.keys())[n]}setItem(n,l){this.storage.set(n,l)}getItem(n){return this.storage.get(n)??null}removeItem(n){this.storage.delete(n)}clear(){this.storage.clear()}}const C3=()=>typeof window<"u"&&window.localStorage?window.localStorage:new bC,I3=()=>typeof window<"u"&&window.sessionStorage?window.sessionStorage:new bC;class k3 extends wC{constructor(){super(C3())}}class M3 extends wC{constructor(){super(I3())}}/*! js-cookie v3.0.5 | MIT */function Ym(e){for(var n=1;n"u")){E=Ym({},n,E),typeof E.expires=="number"&&(E.expires=new Date(Date.now()+E.expires*864e5)),E.expires&&(E.expires=E.expires.toUTCString()),m=encodeURIComponent(m).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var k in E)E[k]&&(s+="; "+k,E[k]!==!0&&(s+="="+E[k].split(";")[0]));return document.cookie=m+"="+e.write(v,m)+s}}function h(m){if(!(typeof document>"u"||arguments.length&&!m)){for(var v=document.cookie?document.cookie.split("; "):[],E={},s=0;sthis.removeItem(h));await Promise.all(l)}getData(){return{path:this.path,expires:this.expires,domain:this.domain,secure:this.secure,...this.sameSite&&{sameSite:this.sameSite}}}}const qp=new k3;new M3;const z3=e=>{let n;return async(...l)=>n||(n=new Promise((h,m)=>{e(...l).then(v=>{h(v)}).catch(v=>{m(v)}).finally(()=>{n=void 0})}),n)};class er extends bs{constructor(n){super(n),this.constructor=er,Object.setPrototypeOf(this,er.prototype)}}function EC(e){if(!e||e.name==="Error"||e instanceof TypeError)throw new er({name:Vp.Unknown,message:"An unknown error has occurred.",underlyingError:e})}const TC="cognito-idp",L3=({region:e})=>{var m;const n=(m=Ws.getConfig().Auth)==null?void 0:m.Cognito,l=n==null?void 0:n.userPoolEndpoint,h=new n1(`https://${TC}.${e}.${pC(e)}`);return{url:l?new n1(l):h}},R3=()=>(e,n)=>async function(h){return h.headers["cache-control"]="no-store",e(h)},D3=fx(fC,[R3]),O3={service:TC,endpointResolver:L3,retryDecider:gC(nf),computeDelay:mC,userAgentValue:mx(),cache:"no-store"},B3=e=>({"content-type":"application/x-amz-json-1.1","x-amz-target":`AWSCognitoIdentityProviderService.${e}`}),F3=({url:e},n,l)=>({headers:n,url:e,body:l,method:"POST"}),N3=e=>(n,l)=>{const h=B3(e),m=JSON.stringify(n);return F3(l,h,m)},U3=()=>async e=>{if(e.statusCode>=300){const n=await nf(e);throw EC(n),new er({name:n.name,message:n.message})}else return await T_(e)},j3=px(D3,N3("InitiateAuth"),U3(),O3);function V3(e){const n=e==null?void 0:e.split("_")[0];if(!e||e.indexOf("_")<0||!n||typeof n!="string")throw new er({name:"InvalidUserPoolId",message:"Invalid user pool id provided."});return n}function i1(e){if(!e||!e.includes(":"))throw new er({name:"InvalidIdentityPoolIdException",message:"Invalid identity pool id provided.",recoverySuggestion:"Make sure a valid identityPoolId is given in the config."});return e.split(":")[0]}const SC="UserUnAuthenticatedException",$3="InvalidRedirectException",G3="InvalidAppSchemeException",q3="InvalidPreferredRedirectUrlException";new er({name:$3,message:"signInRedirect or signOutRedirect had an invalid format or was not found.",recoverySuggestion:"Please make sure the signIn/Out redirect in your oauth config is valid."});new er({name:G3,message:"A valid non-http app scheme was not found in the config.",recoverySuggestion:"Please make sure a valid custom app scheme is present in the config."});new er({name:q3,message:"The given preferredRedirectUrl does not match any items in the redirectSignOutUrls array from the config.",recoverySuggestion:"Please make sure a matching preferredRedirectUrl is provided."});const W3="InvalidOriginException";new er({name:W3,message:"redirect is coming from a different origin. The oauth flow needs to be initiated from the same origin",recoverySuggestion:"Please call signInWithRedirect from the same origin."});const Z3="TokenRefreshException";function H3(e){if(!e||!e.idToken)throw new er({name:SC,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."})}const X3=new er({name:Z3,message:`Token refresh is not supported when authenticated with the 'implicit grant' (token) oauth flow. + Please change your oauth configuration to use 'code grant' flow.`,recoverySuggestion:`Please logout and change your Amplify configuration to use "code grant" flow. + E.g { responseType: 'code' }`}),K3=new er({name:SC,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."});function Y3(e){if(eD(e))throw X3;if(!Q3(e))throw K3}const J3={inflightOAuth:"inflightOAuth",oauthSignIn:"oauthSignIn",oauthPKCE:"oauthPKCE",oauthState:"oauthState"};function AC(e){return(e==null?void 0:e.accessToken)||(e==null?void 0:e.idToken)}function Q3(e){return AC(e)&&(e==null?void 0:e.refreshToken)}function eD(e){return AC(e)&&!(e!=null&&e.refreshToken)}function tD({username:e,userPoolId:n,userPoolClientId:l}){if(typeof window>"u")return;const h=window.AmazonCognitoAdvancedSecurityData;if(typeof h>"u")return;const m=h.getData(e,n,l);return m?{EncodedData:m}:{}}const nD=async({tokens:e,authConfig:n,username:l})=>{var J,ve;Ti(n==null?void 0:n.Cognito);const h=V3(n.Cognito.userPoolId);Y3(e);const m=e.refreshToken,v={REFRESH_TOKEN:m};(J=e.deviceMetadata)!=null&&J.deviceKey&&(v.DEVICE_KEY=e.deviceMetadata.deviceKey);const E=tD({username:l,userPoolId:n.Cognito.userPoolId,userPoolClientId:n.Cognito.userPoolClientId}),{AuthenticationResult:s}=await j3({region:h},{ClientId:(ve=n==null?void 0:n.Cognito)==null?void 0:ve.userPoolClientId,AuthFlow:"REFRESH_TOKEN_AUTH",AuthParameters:v,UserContextData:E}),k=$p((s==null?void 0:s.AccessToken)??""),D=s!=null&&s.IdToken?$p(s.IdToken):void 0,{iat:V}=k.payload;if(!V)throw new er({name:"iatNotFoundException",message:"iat not found in access token"});const G=V*1e3-new Date().getTime();return{accessToken:k,idToken:D,clockDrift:G,refreshToken:m,username:l}},rD=z3(nD),iD={accessToken:"accessToken",idToken:"idToken",oidcProvider:"oidcProvider",clockDrift:"clockDrift",refreshToken:"refreshToken",deviceKey:"deviceKey",randomPasswordKey:"randomPasswordKey",deviceGroupKey:"deviceGroupKey",signInDetails:"signInDetails",oauthMetadata:"oauthMetadata"};var Yg;(function(e){e.InvalidAuthTokens="InvalidAuthTokens"})(Yg||(Yg={}));const oD={[Yg.InvalidAuthTokens]:{message:"Invalid tokens.",recoverySuggestion:"Make sure the tokens are valid."}},sD=aC(oD);class aD{constructor(){this.name="CognitoIdentityServiceProvider"}getKeyValueStorage(){if(!this.keyValueStorage)throw new er({name:"KeyValueStorageNotFoundException",message:"KeyValueStorage was not found in TokenStore"});return this.keyValueStorage}setKeyValueStorage(n){this.keyValueStorage=n}setAuthConfig(n){this.authConfig=n}async loadTokens(){try{const n=await this.getAuthKeys(),l=await this.getKeyValueStorage().getItem(n.accessToken);if(!l)throw new er({name:"NoSessionFoundException",message:"Auth session was not found. Make sure to call signIn."});const h=$p(l),m=await this.getKeyValueStorage().getItem(n.idToken),v=m?$p(m):void 0,E=await this.getKeyValueStorage().getItem(n.refreshToken)??void 0,s=await this.getKeyValueStorage().getItem(n.clockDrift)??"0",k=Number.parseInt(s),D=await this.getKeyValueStorage().getItem(n.signInDetails),V={accessToken:h,idToken:v,refreshToken:E,deviceMetadata:await this.getDeviceMetadata()??void 0,clockDrift:k,username:await this.getLastAuthUser()};return D&&(V.signInDetails=JSON.parse(D)),V}catch{return null}}async storeTokens(n){sD(n!==void 0,Yg.InvalidAuthTokens),await this.clearTokens();const l=n.username;await this.getKeyValueStorage().setItem(this.getLastAuthUserKey(),l);const h=await this.getAuthKeys();await this.getKeyValueStorage().setItem(h.accessToken,n.accessToken.toString()),n.idToken&&await this.getKeyValueStorage().setItem(h.idToken,n.idToken.toString()),n.refreshToken&&await this.getKeyValueStorage().setItem(h.refreshToken,n.refreshToken),n.deviceMetadata&&(n.deviceMetadata.deviceKey&&await this.getKeyValueStorage().setItem(h.deviceKey,n.deviceMetadata.deviceKey),n.deviceMetadata.deviceGroupKey&&await this.getKeyValueStorage().setItem(h.deviceGroupKey,n.deviceMetadata.deviceGroupKey),await this.getKeyValueStorage().setItem(h.randomPasswordKey,n.deviceMetadata.randomPassword)),n.signInDetails&&await this.getKeyValueStorage().setItem(h.signInDetails,JSON.stringify(n.signInDetails)),await this.getKeyValueStorage().setItem(h.clockDrift,`${n.clockDrift}`)}async clearTokens(){const n=await this.getAuthKeys();await Promise.all([this.getKeyValueStorage().removeItem(n.accessToken),this.getKeyValueStorage().removeItem(n.idToken),this.getKeyValueStorage().removeItem(n.clockDrift),this.getKeyValueStorage().removeItem(n.refreshToken),this.getKeyValueStorage().removeItem(n.signInDetails),this.getKeyValueStorage().removeItem(this.getLastAuthUserKey()),this.getKeyValueStorage().removeItem(n.oauthMetadata)])}async getDeviceMetadata(n){const l=await this.getAuthKeys(n),h=await this.getKeyValueStorage().getItem(l.deviceKey),m=await this.getKeyValueStorage().getItem(l.deviceGroupKey),v=await this.getKeyValueStorage().getItem(l.randomPasswordKey);return v&&m&&h?{deviceKey:h,deviceGroupKey:m,randomPassword:v}:null}async clearDeviceMetadata(n){const l=await this.getAuthKeys(n);await Promise.all([this.getKeyValueStorage().removeItem(l.deviceKey),this.getKeyValueStorage().removeItem(l.deviceGroupKey),this.getKeyValueStorage().removeItem(l.randomPasswordKey)])}async getAuthKeys(n){var h;Ti((h=this.authConfig)==null?void 0:h.Cognito);const l=n??await this.getLastAuthUser();return lD(this.name,`${this.authConfig.Cognito.userPoolClientId}.${l}`)}getLastAuthUserKey(){var l;Ti((l=this.authConfig)==null?void 0:l.Cognito);const n=this.authConfig.Cognito.userPoolClientId;return`${this.name}.${n}.LastAuthUser`}async getLastAuthUser(){return await this.getKeyValueStorage().getItem(this.getLastAuthUserKey())??"username"}async setOAuthMetadata(n){const{oauthMetadata:l}=await this.getAuthKeys();await this.getKeyValueStorage().setItem(l,JSON.stringify(n))}async getOAuthMetadata(){const{oauthMetadata:n}=await this.getAuthKeys(),l=await this.getKeyValueStorage().getItem(n);return l&&JSON.parse(l)}}const lD=(e,n)=>_x(iD)(`${e}`,n);function _x(e){const n=Object.values({...e});return(l,h)=>n.reduce((m,v)=>({...m,[v]:`${l}.${h}.${v}`}),{})}const XE="amplify-signin-with-hostedUI",fs="CognitoIdentityServiceProvider";class cD{constructor(n){this.keyValueStorage=n}async clearOAuthInflightData(){Ti(this.cognitoConfig);const n=ms(fs,this.cognitoConfig.userPoolClientId);await Promise.all([this.keyValueStorage.removeItem(n.inflightOAuth),this.keyValueStorage.removeItem(n.oauthPKCE),this.keyValueStorage.removeItem(n.oauthState)])}async clearOAuthData(){Ti(this.cognitoConfig);const n=ms(fs,this.cognitoConfig.userPoolClientId);return await this.clearOAuthInflightData(),await this.keyValueStorage.removeItem(XE),this.keyValueStorage.removeItem(n.oauthSignIn)}loadOAuthState(){Ti(this.cognitoConfig);const n=ms(fs,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.getItem(n.oauthState)}storeOAuthState(n){Ti(this.cognitoConfig);const l=ms(fs,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.setItem(l.oauthState,n)}loadPKCE(){Ti(this.cognitoConfig);const n=ms(fs,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.getItem(n.oauthPKCE)}storePKCE(n){Ti(this.cognitoConfig);const l=ms(fs,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.setItem(l.oauthPKCE,n)}setAuthConfig(n){this.cognitoConfig=n}async loadOAuthInFlight(){Ti(this.cognitoConfig);const n=ms(fs,this.cognitoConfig.userPoolClientId);return await this.keyValueStorage.getItem(n.inflightOAuth)==="true"}async storeOAuthInFlight(n){Ti(this.cognitoConfig);const l=ms(fs,this.cognitoConfig.userPoolClientId);await this.keyValueStorage.setItem(l.inflightOAuth,`${n}`)}async loadOAuthSignIn(){var v;Ti(this.cognitoConfig);const n=ms(fs,this.cognitoConfig.userPoolClientId),l=await this.keyValueStorage.getItem(XE),[h,m]=((v=await this.keyValueStorage.getItem(n.oauthSignIn))==null?void 0:v.split(","))??[];return{isOAuthSignIn:h==="true"||l==="true",preferPrivateSession:m==="true"}}async storeOAuthSignIn(n,l=!1){Ti(this.cognitoConfig);const h=ms(fs,this.cognitoConfig.userPoolClientId);await this.keyValueStorage.setItem(h.oauthSignIn,`${n},${l}`)}}const ms=(e,n)=>_x(J3)(e,n),KE=new cD(qp),uD=[],hD=e=>{uD.push(e)};class dD{constructor(){this.waitForInflightOAuth=$R()?async()=>{if(await KE.loadOAuthInFlight())return this.inflightPromise?this.inflightPromise:(this.inflightPromise=new Promise((n,l)=>{hD(n)}),this.inflightPromise)}:async()=>{}}setAuthConfig(n){KE.setAuthConfig(n.Cognito),this.authConfig=n}setTokenRefresher(n){this.tokenRefresher=n}setAuthTokenStore(n){this.tokenStore=n}getTokenStore(){if(!this.tokenStore)throw new er({name:"EmptyTokenStoreException",message:"TokenStore not set"});return this.tokenStore}getTokenRefresher(){if(!this.tokenRefresher)throw new er({name:"EmptyTokenRefresherException",message:"TokenRefresher not set"});return this.tokenRefresher}async getTokens(n){var E,s,k,D,V;let l;try{Ti((E=this.authConfig)==null?void 0:E.Cognito)}catch{return null}await this.waitForInflightOAuth(),this.inflightPromise=void 0,l=await this.getTokenStore().loadTokens();const h=await this.getTokenStore().getLastAuthUser();if(l===null)return null;const m=!!(l!=null&&l.idToken)&&PE({expiresAt:(((k=(s=l.idToken)==null?void 0:s.payload)==null?void 0:k.exp)??0)*1e3,clockDrift:l.clockDrift??0}),v=PE({expiresAt:(((V=(D=l.accessToken)==null?void 0:D.payload)==null?void 0:V.exp)??0)*1e3,clockDrift:l.clockDrift??0});return(n!=null&&n.forceRefresh||m||v)&&(l=await this.refreshTokens({tokens:l,username:h}),l===null)?null:{accessToken:l==null?void 0:l.accessToken,idToken:l==null?void 0:l.idToken,signInDetails:l==null?void 0:l.signInDetails}}async refreshTokens({tokens:n,username:l}){try{const{signInDetails:h}=n,m=await this.getTokenRefresher()({tokens:n,authConfig:this.authConfig,username:l});return m.signInDetails=h,await this.setTokens({tokens:m}),t1.dispatch("auth",{event:"tokenRefresh"},"Auth",Xg),m}catch(h){return this.handleErrors(h)}}handleErrors(n){if(EC(n),n.message!=="Network error"&&this.clearTokens(),t1.dispatch("auth",{event:"tokenRefresh_failure",data:{error:n}},"Auth",Xg),n.name.startsWith("NotAuthorizedException"))return null;throw n}async setTokens({tokens:n}){return this.getTokenStore().storeTokens(n)}async clearTokens(){return this.getTokenStore().clearTokens()}getDeviceMetadata(n){return this.getTokenStore().getDeviceMetadata(n)}clearDeviceMetadata(n){return this.getTokenStore().clearDeviceMetadata(n)}setOAuthMetadata(n){return this.getTokenStore().setOAuthMetadata(n)}getOAuthMetadata(){return this.getTokenStore().getOAuthMetadata()}}class pD{constructor(){this.authTokenStore=new aD,this.authTokenStore.setKeyValueStorage(qp),this.tokenOrchestrator=new dD,this.tokenOrchestrator.setAuthTokenStore(this.authTokenStore),this.tokenOrchestrator.setTokenRefresher(rD)}getTokens({forceRefresh:n}={forceRefresh:!1}){return this.tokenOrchestrator.getTokens({forceRefresh:n})}setKeyValueStorage(n){this.authTokenStore.setKeyValueStorage(n)}setAuthConfig(n){this.authTokenStore.setAuthConfig(n),this.tokenOrchestrator.setAuthConfig(n)}}const Qm=new pD,fD={identityId:"identityId"},mD=new Zo("DefaultIdentityIdStore");class gD{setAuthConfig(n){gg(n.Cognito),this.authConfig=n,this._authKeys=_D("Cognito",n.Cognito.identityPoolId)}constructor(n){this._authKeys={},this.keyValueStorage=n}async loadIdentityId(){var n;gg((n=this.authConfig)==null?void 0:n.Cognito);try{if(this._primaryIdentityId)return{id:this._primaryIdentityId,type:"primary"};{const l=await this.keyValueStorage.getItem(this._authKeys.identityId);return l?{id:l,type:"guest"}:null}}catch(l){return mD.log("Error getting stored IdentityId.",l),null}}async storeIdentityId(n){var l;gg((l=this.authConfig)==null?void 0:l.Cognito),n.type==="guest"?(this.keyValueStorage.setItem(this._authKeys.identityId,n.id),this._primaryIdentityId=void 0):(this._primaryIdentityId=n.id,this.keyValueStorage.removeItem(this._authKeys.identityId))}async clearIdentityId(){this._primaryIdentityId=void 0,await this.keyValueStorage.removeItem(this._authKeys.identityId)}}const _D=(e,n)=>_x(fD)(`com.amplify.${e}`,n);function CC(e){const n=$p(e).payload.iss,l={};if(!n)throw new er({name:"InvalidIdTokenException",message:"Invalid Idtoken."});const h=n.replace(/(^\w+:|^)\/\//,"");return l[h]=e,l}const yD=new Zo("CognitoIdentityIdProvider");async function vD({tokens:e,authConfig:n,identityIdStore:l}){l.setAuthConfig({Cognito:n});let h=await l.loadIdentityId();if(e){if(h&&h.type==="primary")return h.id;{const m=e.idToken?CC(e.idToken.toString()):{},v=await YE(m,n);h&&h.id===v&&yD.debug(`The guest identity ${h.id} has become the primary identity.`),h={id:v,type:"primary"}}}else{if(h&&h.type==="guest")return h.id;h={id:await YE({},n),type:"guest"}}return l.storeIdentityId(h),h.id}async function YE(e,n){const l=n==null?void 0:n.identityPoolId,h=i1(l),m=(await E3({region:h},{IdentityPoolId:l,Logins:e})).IdentityId;if(!m)throw new er({name:"GetIdResponseException",message:"Received undefined response from getId operation",recoverySuggestion:"Make sure to pass a valid identityPoolId in the configuration."});return m}const eg=new Zo("CognitoCredentialsProvider"),JE=50*60*1e3;class xD{constructor(n){this._nextCredentialsRefresh=0,this._identityIdStore=n}async clearCredentialsAndIdentityId(){eg.debug("Clearing out credentials and identityId"),this._credentialsAndIdentityId=void 0,await this._identityIdStore.clearIdentityId()}async clearCredentials(){eg.debug("Clearing out in-memory credentials"),this._credentialsAndIdentityId=void 0}async getCredentialsAndIdentityId(n){const l=n.authenticated,{tokens:h}=n,{authConfig:m}=n;try{gg(m==null?void 0:m.Cognito)}catch{return}if(!l&&!m.Cognito.allowGuestAccess)return;const{forceRefresh:v}=n,E=this.hasTokenChanged(h),s=await vD({tokens:h,authConfig:m.Cognito,identityIdStore:this._identityIdStore});return(v||E)&&this.clearCredentials(),l?(H3(h),this.credsForOIDCTokens(m.Cognito,h,s)):this.getGuestCredentials(s,m.Cognito)}async getGuestCredentials(n,l){if(this._credentialsAndIdentityId&&!this.isPastTTL()&&this._credentialsAndIdentityId.isAuthenticatedCreds===!1)return eg.info("returning stored credentials as they neither past TTL nor expired."),this._credentialsAndIdentityId;this.clearCredentials();const h=i1(l.identityPoolId),m=await ZE({region:h},{IdentityId:n});if(m.Credentials&&m.Credentials.AccessKeyId&&m.Credentials.SecretKey){this._nextCredentialsRefresh=new Date().getTime()+JE;const v={credentials:{accessKeyId:m.Credentials.AccessKeyId,secretAccessKey:m.Credentials.SecretKey,sessionToken:m.Credentials.SessionToken,expiration:m.Credentials.Expiration},identityId:n},E=m.IdentityId;return E&&(v.identityId=E,this._identityIdStore.storeIdentityId({id:E,type:"guest"})),this._credentialsAndIdentityId={...v,isAuthenticatedCreds:!1},v}else throw new er({name:"CredentialsNotFoundException",message:"Cognito did not respond with either Credentials, AccessKeyId or SecretKey."})}async credsForOIDCTokens(n,l,h){var s;if(this._credentialsAndIdentityId&&!this.isPastTTL()&&this._credentialsAndIdentityId.isAuthenticatedCreds===!0)return eg.debug("returning stored credentials as they neither past TTL nor expired."),this._credentialsAndIdentityId;this.clearCredentials();const m=l.idToken?CC(l.idToken.toString()):{},v=i1(n.identityPoolId),E=await ZE({region:v},{IdentityId:h,Logins:m});if(E.Credentials&&E.Credentials.AccessKeyId&&E.Credentials.SecretKey){const k={credentials:{accessKeyId:E.Credentials.AccessKeyId,secretAccessKey:E.Credentials.SecretKey,sessionToken:E.Credentials.SessionToken,expiration:E.Credentials.Expiration},identityId:h};this._credentialsAndIdentityId={...k,isAuthenticatedCreds:!0,associatedIdToken:(s=l.idToken)==null?void 0:s.toString()},this._nextCredentialsRefresh=new Date().getTime()+JE;const D=E.IdentityId;return D&&(k.identityId=D,this._identityIdStore.storeIdentityId({id:D,type:"primary"})),k}else throw new er({name:"CredentialsException",message:"Cognito did not respond with either Credentials, AccessKeyId or SecretKey."})}isPastTTL(){return this._nextCredentialsRefresh===void 0?!0:this._nextCredentialsRefresh<=Date.now()}hasTokenChanged(n){var l,h;return!!n&&!!((l=this._credentialsAndIdentityId)!=null&&l.associatedIdToken)&&((h=n.idToken)==null?void 0:h.toString())!==this._credentialsAndIdentityId.associatedIdToken}}const wD=new xD(new gD(qp)),bD={configure(e,n){const l=uC(e);if(!l.Auth){Ws.configure(l,n);return}if(n!=null&&n.Auth){Ws.configure(l,n);return}if(!Ws.libraryOptions.Auth){Qm.setAuthConfig(l.Auth),Qm.setKeyValueStorage(n!=null&&n.ssr?new HE({sameSite:"lax"}):qp),Ws.configure(l,{...n,Auth:{tokenProvider:Qm,credentialsProvider:wD}});return}if(n){n.ssr!==void 0&&Qm.setKeyValueStorage(n.ssr?new HE({sameSite:"lax"}):qp),Ws.configure(l,{Auth:Ws.libraryOptions.Auth,...n});return}Ws.configure(l)},getConfig(){return Ws.getConfig()}};/* + * Frontend UI component library for the CORI Data API + * {@link https://github.com/ruralinnovation/cori.data.api} + * @copyright Rural Innovation Strategies, Inc. + * @license ISC + */var ED={oauth:{domain:"authcori.auth.us-east-1.amazoncognito.com"}},TD="us-east-1",SD="us-east-1_QeA4600FA",AD="5eusi16g0o2q1g1rr5ehgudodm",CD="authcori.auth.us-east-1.amazoncognito.com",ID="us-east-1",kD="us-east-1:2194a76a-fa3d-4c33-999e-e3c4b2b049ee",MD=["EMAIL"],PD=["EMAIL","OPENID"],zD=["EMAIL","OPENID"],LD={passwordPolicyMinLength:8,passwordPolicyCharacters:["REQUIRES_NUMBERS","REQUIRES_LOWERCASE","REQUIRES_UPPERCASE","REQUIRES_SYMBOLS"]},RD="https://bdkxhfgus5dztobic7gvn5ymue.appsync-api.us-east-1.amazonaws.com/graphql",DD="us-east-1",OD="da2-yexc3mow25fc3amaendi4vscuq",BD="API_KEY",FD="AMAZON_COGNITO_USER_POOLS,AWS_IAM",ND={version:1,models:{Todo:{name:"Todo",fields:{id:{name:"id",isArray:!1,type:"ID",isRequired:!0,attributes:[]},content:{name:"content",isArray:!1,type:"String",isRequired:!1,attributes:[]},owner:{name:"owner",isArray:!1,type:"String",isRequired:!1,attributes:[]},createdAt:{name:"createdAt",isArray:!1,type:"AWSDateTime",isRequired:!0,attributes:[]},updatedAt:{name:"updatedAt",isArray:!1,type:"AWSDateTime",isRequired:!0,attributes:[]}},syncable:!0,pluralName:"Todos",attributes:[{type:"model",properties:{}},{type:"key",properties:{fields:["id"]}},{type:"auth",properties:{rules:[{provider:"userPools",ownerField:"owner",allow:"owner",identityClaim:"cognito:username",operations:["create","update","delete","read"]},{allow:"public",operations:["read"]}]}}],primaryKeyInfo:{isCustomPrimaryKey:!1,primaryKeyFieldName:"id",sortKeyFieldNames:[]}}},enums:{},nonModels:{}},UD={Auth:ED,aws_project_region:TD,aws_user_pools_id:SD,aws_user_pools_web_client_id:AD,aws_cognito_domain:CD,aws_cognito_region:ID,aws_cognito_identity_pool_id:kD,aws_cognito_signup_attributes:MD,aws_cognito_username_attributes:PD,aws_cognito_verification_mechanisms:zD,aws_cognito_password_protection_settings:LD,aws_appsync_graphqlEndpoint:RD,aws_appsync_region:DD,aws_appsync_apiKey:OD,aws_appsync_authenticationType:BD,aws_appsync_additionalAuthenticationTypes:FD,modelIntrospection:ND};/* + * Frontend UI component library for the CORI Data API + * {@link https://github.com/ruralinnovation/cori.data.api} + * @copyright Rural Innovation Strategies, Inc. + * @license ISC + */bD.configure(UD);const jD={domain:void 0,region:void 0,identityPoolId:void 0,userPoolId:void 0,userPoolClientId:void 0};ut.createContext(jD);function IC(e,n){return function(){return e.apply(n,arguments)}}const{toString:VD}=Object.prototype,{getPrototypeOf:yx}=Object,S_=(e=>n=>{const l=VD.call(n);return e[l]||(e[l]=l.slice(8,-1).toLowerCase())})(Object.create(null)),Ko=e=>(e=e.toLowerCase(),n=>S_(n)===e),A_=e=>n=>typeof n===e,{isArray:mh}=Array,Wp=A_("undefined");function $D(e){return e!==null&&!Wp(e)&&e.constructor!==null&&!Wp(e.constructor)&&qi(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const kC=Ko("ArrayBuffer");function GD(e){let n;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?n=ArrayBuffer.isView(e):n=e&&e.buffer&&kC(e.buffer),n}const qD=A_("string"),qi=A_("function"),MC=A_("number"),C_=e=>e!==null&&typeof e=="object",WD=e=>e===!0||e===!1,yg=e=>{if(S_(e)!=="object")return!1;const n=yx(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},ZD=Ko("Date"),HD=Ko("File"),XD=Ko("Blob"),KD=Ko("FileList"),YD=e=>C_(e)&&qi(e.pipe),JD=e=>{let n;return e&&(typeof FormData=="function"&&e instanceof FormData||qi(e.append)&&((n=S_(e))==="formdata"||n==="object"&&qi(e.toString)&&e.toString()==="[object FormData]"))},QD=Ko("URLSearchParams"),[e5,t5,n5,r5]=["ReadableStream","Request","Response","Headers"].map(Ko),i5=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function rf(e,n,{allOwnKeys:l=!1}={}){if(e===null||typeof e>"u")return;let h,m;if(typeof e!="object"&&(e=[e]),mh(e))for(h=0,m=e.length;h0;)if(m=l[h],n===m.toLowerCase())return m;return null}const dc=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),zC=e=>!Wp(e)&&e!==dc;function o1(){const{caseless:e}=zC(this)&&this||{},n={},l=(h,m)=>{const v=e&&PC(n,m)||m;yg(n[v])&&yg(h)?n[v]=o1(n[v],h):yg(h)?n[v]=o1({},h):mh(h)?n[v]=h.slice():n[v]=h};for(let h=0,m=arguments.length;h(rf(n,(m,v)=>{l&&qi(m)?e[v]=IC(m,l):e[v]=m},{allOwnKeys:h}),e),s5=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),a5=(e,n,l,h)=>{e.prototype=Object.create(n.prototype,h),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:n.prototype}),l&&Object.assign(e.prototype,l)},l5=(e,n,l,h)=>{let m,v,E;const s={};if(n=n||{},e==null)return n;do{for(m=Object.getOwnPropertyNames(e),v=m.length;v-- >0;)E=m[v],(!h||h(E,e,n))&&!s[E]&&(n[E]=e[E],s[E]=!0);e=l!==!1&&yx(e)}while(e&&(!l||l(e,n))&&e!==Object.prototype);return n},c5=(e,n,l)=>{e=String(e),(l===void 0||l>e.length)&&(l=e.length),l-=n.length;const h=e.indexOf(n,l);return h!==-1&&h===l},u5=e=>{if(!e)return null;if(mh(e))return e;let n=e.length;if(!MC(n))return null;const l=new Array(n);for(;n-- >0;)l[n]=e[n];return l},h5=(e=>n=>e&&n instanceof e)(typeof Uint8Array<"u"&&yx(Uint8Array)),d5=(e,n)=>{const h=(e&&e[Symbol.iterator]).call(e);let m;for(;(m=h.next())&&!m.done;){const v=m.value;n.call(e,v[0],v[1])}},p5=(e,n)=>{let l;const h=[];for(;(l=e.exec(n))!==null;)h.push(l);return h},f5=Ko("HTMLFormElement"),m5=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(l,h,m){return h.toUpperCase()+m}),QE=(({hasOwnProperty:e})=>(n,l)=>e.call(n,l))(Object.prototype),g5=Ko("RegExp"),LC=(e,n)=>{const l=Object.getOwnPropertyDescriptors(e),h={};rf(l,(m,v)=>{let E;(E=n(m,v,e))!==!1&&(h[v]=E||m)}),Object.defineProperties(e,h)},_5=e=>{LC(e,(n,l)=>{if(qi(e)&&["arguments","caller","callee"].indexOf(l)!==-1)return!1;const h=e[l];if(qi(h)){if(n.enumerable=!1,"writable"in n){n.writable=!1;return}n.set||(n.set=()=>{throw Error("Can not rewrite read-only method '"+l+"'")})}})},y5=(e,n)=>{const l={},h=m=>{m.forEach(v=>{l[v]=!0})};return mh(e)?h(e):h(String(e).split(n)),l},v5=()=>{},x5=(e,n)=>e!=null&&Number.isFinite(e=+e)?e:n,Y0="abcdefghijklmnopqrstuvwxyz",eT="0123456789",RC={DIGIT:eT,ALPHA:Y0,ALPHA_DIGIT:Y0+Y0.toUpperCase()+eT},w5=(e=16,n=RC.ALPHA_DIGIT)=>{let l="";const{length:h}=n;for(;e--;)l+=n[Math.random()*h|0];return l};function b5(e){return!!(e&&qi(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const E5=e=>{const n=new Array(10),l=(h,m)=>{if(C_(h)){if(n.indexOf(h)>=0)return;if(!("toJSON"in h)){n[m]=h;const v=mh(h)?[]:{};return rf(h,(E,s)=>{const k=l(E,m+1);!Wp(k)&&(v[s]=k)}),n[m]=void 0,v}}return h};return l(e,0)},T5=Ko("AsyncFunction"),S5=e=>e&&(C_(e)||qi(e))&&qi(e.then)&&qi(e.catch),DC=((e,n)=>e?setImmediate:n?((l,h)=>(dc.addEventListener("message",({source:m,data:v})=>{m===dc&&v===l&&h.length&&h.shift()()},!1),m=>{h.push(m),dc.postMessage(l,"*")}))(`axios@${Math.random()}`,[]):l=>setTimeout(l))(typeof setImmediate=="function",qi(dc.postMessage)),A5=typeof queueMicrotask<"u"?queueMicrotask.bind(dc):typeof process<"u"&&process.nextTick||DC,Ne={isArray:mh,isArrayBuffer:kC,isBuffer:$D,isFormData:JD,isArrayBufferView:GD,isString:qD,isNumber:MC,isBoolean:WD,isObject:C_,isPlainObject:yg,isReadableStream:e5,isRequest:t5,isResponse:n5,isHeaders:r5,isUndefined:Wp,isDate:ZD,isFile:HD,isBlob:XD,isRegExp:g5,isFunction:qi,isStream:YD,isURLSearchParams:QD,isTypedArray:h5,isFileList:KD,forEach:rf,merge:o1,extend:o5,trim:i5,stripBOM:s5,inherits:a5,toFlatObject:l5,kindOf:S_,kindOfTest:Ko,endsWith:c5,toArray:u5,forEachEntry:d5,matchAll:p5,isHTMLForm:f5,hasOwnProperty:QE,hasOwnProp:QE,reduceDescriptors:LC,freezeMethods:_5,toObjectSet:y5,toCamelCase:m5,noop:v5,toFiniteNumber:x5,findKey:PC,global:dc,isContextDefined:zC,ALPHABET:RC,generateString:w5,isSpecCompliantForm:b5,toJSONObject:E5,isAsyncFn:T5,isThenable:S5,setImmediate:DC,asap:A5};function qt(e,n,l,h,m){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",n&&(this.code=n),l&&(this.config=l),h&&(this.request=h),m&&(this.response=m,this.status=m.status?m.status:null)}Ne.inherits(qt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Ne.toJSONObject(this.config),code:this.code,status:this.status}}});const OC=qt.prototype,BC={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{BC[e]={value:e}});Object.defineProperties(qt,BC);Object.defineProperty(OC,"isAxiosError",{value:!0});qt.from=(e,n,l,h,m,v)=>{const E=Object.create(OC);return Ne.toFlatObject(e,E,function(k){return k!==Error.prototype},s=>s!=="isAxiosError"),qt.call(E,e.message,n,l,h,m),E.cause=e,E.name=e.name,v&&Object.assign(E,v),E};const C5=null;function s1(e){return Ne.isPlainObject(e)||Ne.isArray(e)}function FC(e){return Ne.endsWith(e,"[]")?e.slice(0,-2):e}function tT(e,n,l){return e?e.concat(n).map(function(m,v){return m=FC(m),!l&&v?"["+m+"]":m}).join(l?".":""):n}function I5(e){return Ne.isArray(e)&&!e.some(s1)}const k5=Ne.toFlatObject(Ne,{},null,function(n){return/^is[A-Z]/.test(n)});function I_(e,n,l){if(!Ne.isObject(e))throw new TypeError("target must be an object");n=n||new FormData,l=Ne.toFlatObject(l,{metaTokens:!0,dots:!1,indexes:!1},!1,function(me,Ce){return!Ne.isUndefined(Ce[me])});const h=l.metaTokens,m=l.visitor||V,v=l.dots,E=l.indexes,k=(l.Blob||typeof Blob<"u"&&Blob)&&Ne.isSpecCompliantForm(n);if(!Ne.isFunction(m))throw new TypeError("visitor must be a function");function D(ae){if(ae===null)return"";if(Ne.isDate(ae))return ae.toISOString();if(!k&&Ne.isBlob(ae))throw new qt("Blob is not supported. Use a Buffer instead.");return Ne.isArrayBuffer(ae)||Ne.isTypedArray(ae)?k&&typeof Blob=="function"?new Blob([ae]):Buffer.from(ae):ae}function V(ae,me,Ce){let ie=ae;if(ae&&!Ce&&typeof ae=="object"){if(Ne.endsWith(me,"{}"))me=h?me:me.slice(0,-2),ae=JSON.stringify(ae);else if(Ne.isArray(ae)&&I5(ae)||(Ne.isFileList(ae)||Ne.endsWith(me,"[]"))&&(ie=Ne.toArray(ae)))return me=FC(me),ie.forEach(function(le,ze){!(Ne.isUndefined(le)||le===null)&&n.append(E===!0?tT([me],ze,v):E===null?me:me+"[]",D(le))}),!1}return s1(ae)?!0:(n.append(tT(Ce,me,v),D(ae)),!1)}const G=[],J=Object.assign(k5,{defaultVisitor:V,convertValue:D,isVisitable:s1});function ve(ae,me){if(!Ne.isUndefined(ae)){if(G.indexOf(ae)!==-1)throw Error("Circular reference detected in "+me.join("."));G.push(ae),Ne.forEach(ae,function(ie,te){(!(Ne.isUndefined(ie)||ie===null)&&m.call(n,ie,Ne.isString(te)?te.trim():te,me,J))===!0&&ve(ie,me?me.concat(te):[te])}),G.pop()}}if(!Ne.isObject(e))throw new TypeError("data must be an object");return ve(e),n}function nT(e){const n={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(h){return n[h]})}function vx(e,n){this._pairs=[],e&&I_(e,this,n)}const NC=vx.prototype;NC.append=function(n,l){this._pairs.push([n,l])};NC.toString=function(n){const l=n?function(h){return n.call(this,h,nT)}:nT;return this._pairs.map(function(m){return l(m[0])+"="+l(m[1])},"").join("&")};function M5(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function UC(e,n,l){if(!n)return e;const h=l&&l.encode||M5,m=l&&l.serialize;let v;if(m?v=m(n,l):v=Ne.isURLSearchParams(n)?n.toString():new vx(n,l).toString(h),v){const E=e.indexOf("#");E!==-1&&(e=e.slice(0,E)),e+=(e.indexOf("?")===-1?"?":"&")+v}return e}class P5{constructor(){this.handlers=[]}use(n,l,h){return this.handlers.push({fulfilled:n,rejected:l,synchronous:h?h.synchronous:!1,runWhen:h?h.runWhen:null}),this.handlers.length-1}eject(n){this.handlers[n]&&(this.handlers[n]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(n){Ne.forEach(this.handlers,function(h){h!==null&&n(h)})}}const rT=P5,jC={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},z5=typeof URLSearchParams<"u"?URLSearchParams:vx,L5=typeof FormData<"u"?FormData:null,R5=typeof Blob<"u"?Blob:null,D5={isBrowser:!0,classes:{URLSearchParams:z5,FormData:L5,Blob:R5},protocols:["http","https","file","blob","url","data"]},xx=typeof window<"u"&&typeof document<"u",a1=typeof navigator=="object"&&navigator||void 0,O5=xx&&(!a1||["ReactNative","NativeScript","NS"].indexOf(a1.product)<0),B5=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),F5=xx&&window.location.href||"http://localhost",N5=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:xx,hasStandardBrowserEnv:O5,hasStandardBrowserWebWorkerEnv:B5,navigator:a1,origin:F5},Symbol.toStringTag,{value:"Module"})),Mi={...N5,...D5};function U5(e,n){return I_(e,new Mi.classes.URLSearchParams,Object.assign({visitor:function(l,h,m,v){return Mi.isNode&&Ne.isBuffer(l)?(this.append(h,l.toString("base64")),!1):v.defaultVisitor.apply(this,arguments)}},n))}function j5(e){return Ne.matchAll(/\w+|\[(\w*)]/g,e).map(n=>n[0]==="[]"?"":n[1]||n[0])}function V5(e){const n={},l=Object.keys(e);let h;const m=l.length;let v;for(h=0;h=l.length;return E=!E&&Ne.isArray(m)?m.length:E,k?(Ne.hasOwnProp(m,E)?m[E]=[m[E],h]:m[E]=h,!s):((!m[E]||!Ne.isObject(m[E]))&&(m[E]=[]),n(l,h,m[E],v)&&Ne.isArray(m[E])&&(m[E]=V5(m[E])),!s)}if(Ne.isFormData(e)&&Ne.isFunction(e.entries)){const l={};return Ne.forEachEntry(e,(h,m)=>{n(j5(h),m,l,0)}),l}return null}function $5(e,n,l){if(Ne.isString(e))try{return(n||JSON.parse)(e),Ne.trim(e)}catch(h){if(h.name!=="SyntaxError")throw h}return(l||JSON.stringify)(e)}const wx={transitional:jC,adapter:["xhr","http","fetch"],transformRequest:[function(n,l){const h=l.getContentType()||"",m=h.indexOf("application/json")>-1,v=Ne.isObject(n);if(v&&Ne.isHTMLForm(n)&&(n=new FormData(n)),Ne.isFormData(n))return m?JSON.stringify(VC(n)):n;if(Ne.isArrayBuffer(n)||Ne.isBuffer(n)||Ne.isStream(n)||Ne.isFile(n)||Ne.isBlob(n)||Ne.isReadableStream(n))return n;if(Ne.isArrayBufferView(n))return n.buffer;if(Ne.isURLSearchParams(n))return l.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),n.toString();let s;if(v){if(h.indexOf("application/x-www-form-urlencoded")>-1)return U5(n,this.formSerializer).toString();if((s=Ne.isFileList(n))||h.indexOf("multipart/form-data")>-1){const k=this.env&&this.env.FormData;return I_(s?{"files[]":n}:n,k&&new k,this.formSerializer)}}return v||m?(l.setContentType("application/json",!1),$5(n)):n}],transformResponse:[function(n){const l=this.transitional||wx.transitional,h=l&&l.forcedJSONParsing,m=this.responseType==="json";if(Ne.isResponse(n)||Ne.isReadableStream(n))return n;if(n&&Ne.isString(n)&&(h&&!this.responseType||m)){const E=!(l&&l.silentJSONParsing)&&m;try{return JSON.parse(n)}catch(s){if(E)throw s.name==="SyntaxError"?qt.from(s,qt.ERR_BAD_RESPONSE,this,null,this.response):s}}return n}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Mi.classes.FormData,Blob:Mi.classes.Blob},validateStatus:function(n){return n>=200&&n<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Ne.forEach(["delete","get","head","post","put","patch"],e=>{wx.headers[e]={}});const bx=wx,G5=Ne.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),q5=e=>{const n={};let l,h,m;return e&&e.split(` +`).forEach(function(E){m=E.indexOf(":"),l=E.substring(0,m).trim().toLowerCase(),h=E.substring(m+1).trim(),!(!l||n[l]&&G5[l])&&(l==="set-cookie"?n[l]?n[l].push(h):n[l]=[h]:n[l]=n[l]?n[l]+", "+h:h)}),n},iT=Symbol("internals");function ap(e){return e&&String(e).trim().toLowerCase()}function vg(e){return e===!1||e==null?e:Ne.isArray(e)?e.map(vg):String(e)}function W5(e){const n=Object.create(null),l=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let h;for(;h=l.exec(e);)n[h[1]]=h[2];return n}const Z5=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function J0(e,n,l,h,m){if(Ne.isFunction(h))return h.call(this,n,l);if(m&&(n=l),!!Ne.isString(n)){if(Ne.isString(h))return n.indexOf(h)!==-1;if(Ne.isRegExp(h))return h.test(n)}}function H5(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(n,l,h)=>l.toUpperCase()+h)}function X5(e,n){const l=Ne.toCamelCase(" "+n);["get","set","has"].forEach(h=>{Object.defineProperty(e,h+l,{value:function(m,v,E){return this[h].call(this,n,m,v,E)},configurable:!0})})}class k_{constructor(n){n&&this.set(n)}set(n,l,h){const m=this;function v(s,k,D){const V=ap(k);if(!V)throw new Error("header name must be a non-empty string");const G=Ne.findKey(m,V);(!G||m[G]===void 0||D===!0||D===void 0&&m[G]!==!1)&&(m[G||k]=vg(s))}const E=(s,k)=>Ne.forEach(s,(D,V)=>v(D,V,k));if(Ne.isPlainObject(n)||n instanceof this.constructor)E(n,l);else if(Ne.isString(n)&&(n=n.trim())&&!Z5(n))E(q5(n),l);else if(Ne.isHeaders(n))for(const[s,k]of n.entries())v(k,s,h);else n!=null&&v(l,n,h);return this}get(n,l){if(n=ap(n),n){const h=Ne.findKey(this,n);if(h){const m=this[h];if(!l)return m;if(l===!0)return W5(m);if(Ne.isFunction(l))return l.call(this,m,h);if(Ne.isRegExp(l))return l.exec(m);throw new TypeError("parser must be boolean|regexp|function")}}}has(n,l){if(n=ap(n),n){const h=Ne.findKey(this,n);return!!(h&&this[h]!==void 0&&(!l||J0(this,this[h],h,l)))}return!1}delete(n,l){const h=this;let m=!1;function v(E){if(E=ap(E),E){const s=Ne.findKey(h,E);s&&(!l||J0(h,h[s],s,l))&&(delete h[s],m=!0)}}return Ne.isArray(n)?n.forEach(v):v(n),m}clear(n){const l=Object.keys(this);let h=l.length,m=!1;for(;h--;){const v=l[h];(!n||J0(this,this[v],v,n,!0))&&(delete this[v],m=!0)}return m}normalize(n){const l=this,h={};return Ne.forEach(this,(m,v)=>{const E=Ne.findKey(h,v);if(E){l[E]=vg(m),delete l[v];return}const s=n?H5(v):String(v).trim();s!==v&&delete l[v],l[s]=vg(m),h[s]=!0}),this}concat(...n){return this.constructor.concat(this,...n)}toJSON(n){const l=Object.create(null);return Ne.forEach(this,(h,m)=>{h!=null&&h!==!1&&(l[m]=n&&Ne.isArray(h)?h.join(", "):h)}),l}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([n,l])=>n+": "+l).join(` +`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(n){return n instanceof this?n:new this(n)}static concat(n,...l){const h=new this(n);return l.forEach(m=>h.set(m)),h}static accessor(n){const h=(this[iT]=this[iT]={accessors:{}}).accessors,m=this.prototype;function v(E){const s=ap(E);h[s]||(X5(m,E),h[s]=!0)}return Ne.isArray(n)?n.forEach(v):v(n),this}}k_.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Ne.reduceDescriptors(k_.prototype,({value:e},n)=>{let l=n[0].toUpperCase()+n.slice(1);return{get:()=>e,set(h){this[l]=h}}});Ne.freezeMethods(k_);const Ho=k_;function Q0(e,n){const l=this||bx,h=n||l,m=Ho.from(h.headers);let v=h.data;return Ne.forEach(e,function(s){v=s.call(l,v,m.normalize(),n?n.status:void 0)}),m.normalize(),v}function $C(e){return!!(e&&e.__CANCEL__)}function gh(e,n,l){qt.call(this,e??"canceled",qt.ERR_CANCELED,n,l),this.name="CanceledError"}Ne.inherits(gh,qt,{__CANCEL__:!0});function GC(e,n,l){const h=l.config.validateStatus;!l.status||!h||h(l.status)?e(l):n(new qt("Request failed with status code "+l.status,[qt.ERR_BAD_REQUEST,qt.ERR_BAD_RESPONSE][Math.floor(l.status/100)-4],l.config,l.request,l))}function K5(e){const n=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return n&&n[1]||""}function Y5(e,n){e=e||10;const l=new Array(e),h=new Array(e);let m=0,v=0,E;return n=n!==void 0?n:1e3,function(k){const D=Date.now(),V=h[v];E||(E=D),l[m]=k,h[m]=D;let G=v,J=0;for(;G!==m;)J+=l[G++],G=G%e;if(m=(m+1)%e,m===v&&(v=(v+1)%e),D-E{l=V,m=null,v&&(clearTimeout(v),v=null),e.apply(null,D)};return[(...D)=>{const V=Date.now(),G=V-l;G>=h?E(D,V):(m=D,v||(v=setTimeout(()=>{v=null,E(m)},h-G)))},()=>m&&E(m)]}const Jg=(e,n,l=3)=>{let h=0;const m=Y5(50,250);return J5(v=>{const E=v.loaded,s=v.lengthComputable?v.total:void 0,k=E-h,D=m(k),V=E<=s;h=E;const G={loaded:E,total:s,progress:s?E/s:void 0,bytes:k,rate:D||void 0,estimated:D&&s&&V?(s-E)/D:void 0,event:v,lengthComputable:s!=null,[n?"download":"upload"]:!0};e(G)},l)},oT=(e,n)=>{const l=e!=null;return[h=>n[0]({lengthComputable:l,total:e,loaded:h}),n[1]]},sT=e=>(...n)=>Ne.asap(()=>e(...n)),Q5=Mi.hasStandardBrowserEnv?function(){const n=Mi.navigator&&/(msie|trident)/i.test(Mi.navigator.userAgent),l=document.createElement("a");let h;function m(v){let E=v;return n&&(l.setAttribute("href",E),E=l.href),l.setAttribute("href",E),{href:l.href,protocol:l.protocol?l.protocol.replace(/:$/,""):"",host:l.host,search:l.search?l.search.replace(/^\?/,""):"",hash:l.hash?l.hash.replace(/^#/,""):"",hostname:l.hostname,port:l.port,pathname:l.pathname.charAt(0)==="/"?l.pathname:"/"+l.pathname}}return h=m(window.location.href),function(E){const s=Ne.isString(E)?m(E):E;return s.protocol===h.protocol&&s.host===h.host}}():function(){return function(){return!0}}(),eO=Mi.hasStandardBrowserEnv?{write(e,n,l,h,m,v){const E=[e+"="+encodeURIComponent(n)];Ne.isNumber(l)&&E.push("expires="+new Date(l).toGMTString()),Ne.isString(h)&&E.push("path="+h),Ne.isString(m)&&E.push("domain="+m),v===!0&&E.push("secure"),document.cookie=E.join("; ")},read(e){const n=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function tO(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function nO(e,n){return n?e.replace(/\/?\/$/,"")+"/"+n.replace(/^\/+/,""):e}function qC(e,n){return e&&!tO(n)?nO(e,n):n}const aT=e=>e instanceof Ho?{...e}:e;function xc(e,n){n=n||{};const l={};function h(D,V,G){return Ne.isPlainObject(D)&&Ne.isPlainObject(V)?Ne.merge.call({caseless:G},D,V):Ne.isPlainObject(V)?Ne.merge({},V):Ne.isArray(V)?V.slice():V}function m(D,V,G){if(Ne.isUndefined(V)){if(!Ne.isUndefined(D))return h(void 0,D,G)}else return h(D,V,G)}function v(D,V){if(!Ne.isUndefined(V))return h(void 0,V)}function E(D,V){if(Ne.isUndefined(V)){if(!Ne.isUndefined(D))return h(void 0,D)}else return h(void 0,V)}function s(D,V,G){if(G in n)return h(D,V);if(G in e)return h(void 0,D)}const k={url:v,method:v,data:v,baseURL:E,transformRequest:E,transformResponse:E,paramsSerializer:E,timeout:E,timeoutMessage:E,withCredentials:E,withXSRFToken:E,adapter:E,responseType:E,xsrfCookieName:E,xsrfHeaderName:E,onUploadProgress:E,onDownloadProgress:E,decompress:E,maxContentLength:E,maxBodyLength:E,beforeRedirect:E,transport:E,httpAgent:E,httpsAgent:E,cancelToken:E,socketPath:E,responseEncoding:E,validateStatus:s,headers:(D,V)=>m(aT(D),aT(V),!0)};return Ne.forEach(Object.keys(Object.assign({},e,n)),function(V){const G=k[V]||m,J=G(e[V],n[V],V);Ne.isUndefined(J)&&G!==s||(l[V]=J)}),l}const WC=e=>{const n=xc({},e);let{data:l,withXSRFToken:h,xsrfHeaderName:m,xsrfCookieName:v,headers:E,auth:s}=n;n.headers=E=Ho.from(E),n.url=UC(qC(n.baseURL,n.url),e.params,e.paramsSerializer),s&&E.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):"")));let k;if(Ne.isFormData(l)){if(Mi.hasStandardBrowserEnv||Mi.hasStandardBrowserWebWorkerEnv)E.setContentType(void 0);else if((k=E.getContentType())!==!1){const[D,...V]=k?k.split(";").map(G=>G.trim()).filter(Boolean):[];E.setContentType([D||"multipart/form-data",...V].join("; "))}}if(Mi.hasStandardBrowserEnv&&(h&&Ne.isFunction(h)&&(h=h(n)),h||h!==!1&&Q5(n.url))){const D=m&&v&&eO.read(v);D&&E.set(m,D)}return n},rO=typeof XMLHttpRequest<"u",iO=rO&&function(e){return new Promise(function(l,h){const m=WC(e);let v=m.data;const E=Ho.from(m.headers).normalize();let{responseType:s,onUploadProgress:k,onDownloadProgress:D}=m,V,G,J,ve,ae;function me(){ve&&ve(),ae&&ae(),m.cancelToken&&m.cancelToken.unsubscribe(V),m.signal&&m.signal.removeEventListener("abort",V)}let Ce=new XMLHttpRequest;Ce.open(m.method.toUpperCase(),m.url,!0),Ce.timeout=m.timeout;function ie(){if(!Ce)return;const le=Ho.from("getAllResponseHeaders"in Ce&&Ce.getAllResponseHeaders()),Oe={data:!s||s==="text"||s==="json"?Ce.responseText:Ce.response,status:Ce.status,statusText:Ce.statusText,headers:le,config:e,request:Ce};GC(function(He){l(He),me()},function(He){h(He),me()},Oe),Ce=null}"onloadend"in Ce?Ce.onloadend=ie:Ce.onreadystatechange=function(){!Ce||Ce.readyState!==4||Ce.status===0&&!(Ce.responseURL&&Ce.responseURL.indexOf("file:")===0)||setTimeout(ie)},Ce.onabort=function(){Ce&&(h(new qt("Request aborted",qt.ECONNABORTED,e,Ce)),Ce=null)},Ce.onerror=function(){h(new qt("Network Error",qt.ERR_NETWORK,e,Ce)),Ce=null},Ce.ontimeout=function(){let ze=m.timeout?"timeout of "+m.timeout+"ms exceeded":"timeout exceeded";const Oe=m.transitional||jC;m.timeoutErrorMessage&&(ze=m.timeoutErrorMessage),h(new qt(ze,Oe.clarifyTimeoutError?qt.ETIMEDOUT:qt.ECONNABORTED,e,Ce)),Ce=null},v===void 0&&E.setContentType(null),"setRequestHeader"in Ce&&Ne.forEach(E.toJSON(),function(ze,Oe){Ce.setRequestHeader(Oe,ze)}),Ne.isUndefined(m.withCredentials)||(Ce.withCredentials=!!m.withCredentials),s&&s!=="json"&&(Ce.responseType=m.responseType),D&&([J,ae]=Jg(D,!0),Ce.addEventListener("progress",J)),k&&Ce.upload&&([G,ve]=Jg(k),Ce.upload.addEventListener("progress",G),Ce.upload.addEventListener("loadend",ve)),(m.cancelToken||m.signal)&&(V=le=>{Ce&&(h(!le||le.type?new gh(null,e,Ce):le),Ce.abort(),Ce=null)},m.cancelToken&&m.cancelToken.subscribe(V),m.signal&&(m.signal.aborted?V():m.signal.addEventListener("abort",V)));const te=K5(m.url);if(te&&Mi.protocols.indexOf(te)===-1){h(new qt("Unsupported protocol "+te+":",qt.ERR_BAD_REQUEST,e));return}Ce.send(v||null)})},oO=(e,n)=>{const{length:l}=e=e?e.filter(Boolean):[];if(n||l){let h=new AbortController,m;const v=function(D){if(!m){m=!0,s();const V=D instanceof Error?D:this.reason;h.abort(V instanceof qt?V:new gh(V instanceof Error?V.message:V))}};let E=n&&setTimeout(()=>{E=null,v(new qt(`timeout ${n} of ms exceeded`,qt.ETIMEDOUT))},n);const s=()=>{e&&(E&&clearTimeout(E),E=null,e.forEach(D=>{D.unsubscribe?D.unsubscribe(v):D.removeEventListener("abort",v)}),e=null)};e.forEach(D=>D.addEventListener("abort",v));const{signal:k}=h;return k.unsubscribe=()=>Ne.asap(s),k}},sO=oO,aO=function*(e,n){let l=e.byteLength;if(!n||l{const m=lO(e,n);let v=0,E,s=k=>{E||(E=!0,h&&h(k))};return new ReadableStream({async pull(k){try{const{done:D,value:V}=await m.next();if(D){s(),k.close();return}let G=V.byteLength;if(l){let J=v+=G;l(J)}k.enqueue(new Uint8Array(V))}catch(D){throw s(D),D}},cancel(k){return s(k),m.return()}},{highWaterMark:2})},M_=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",ZC=M_&&typeof ReadableStream=="function",uO=M_&&(typeof TextEncoder=="function"?(e=>n=>e.encode(n))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),HC=(e,...n)=>{try{return!!e(...n)}catch{return!1}},hO=ZC&&HC(()=>{let e=!1;const n=new Request(Mi.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!n}),cT=64*1024,l1=ZC&&HC(()=>Ne.isReadableStream(new Response("").body)),Qg={stream:l1&&(e=>e.body)};M_&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(n=>{!Qg[n]&&(Qg[n]=Ne.isFunction(e[n])?l=>l[n]():(l,h)=>{throw new qt(`Response type '${n}' is not supported`,qt.ERR_NOT_SUPPORT,h)})})})(new Response);const dO=async e=>{if(e==null)return 0;if(Ne.isBlob(e))return e.size;if(Ne.isSpecCompliantForm(e))return(await new Request(Mi.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(Ne.isArrayBufferView(e)||Ne.isArrayBuffer(e))return e.byteLength;if(Ne.isURLSearchParams(e)&&(e=e+""),Ne.isString(e))return(await uO(e)).byteLength},pO=async(e,n)=>{const l=Ne.toFiniteNumber(e.getContentLength());return l??dO(n)},fO=M_&&(async e=>{let{url:n,method:l,data:h,signal:m,cancelToken:v,timeout:E,onDownloadProgress:s,onUploadProgress:k,responseType:D,headers:V,withCredentials:G="same-origin",fetchOptions:J}=WC(e);D=D?(D+"").toLowerCase():"text";let ve=sO([m,v&&v.toAbortSignal()],E),ae;const me=ve&&ve.unsubscribe&&(()=>{ve.unsubscribe()});let Ce;try{if(k&&hO&&l!=="get"&&l!=="head"&&(Ce=await pO(V,h))!==0){let Oe=new Request(n,{method:"POST",body:h,duplex:"half"}),Ke;if(Ne.isFormData(h)&&(Ke=Oe.headers.get("content-type"))&&V.setContentType(Ke),Oe.body){const[He,ht]=oT(Ce,Jg(sT(k)));h=lT(Oe.body,cT,He,ht)}}Ne.isString(G)||(G=G?"include":"omit");const ie="credentials"in Request.prototype;ae=new Request(n,{...J,signal:ve,method:l.toUpperCase(),headers:V.normalize().toJSON(),body:h,duplex:"half",credentials:ie?G:void 0});let te=await fetch(ae);const le=l1&&(D==="stream"||D==="response");if(l1&&(s||le&&me)){const Oe={};["status","statusText","headers"].forEach(Ve=>{Oe[Ve]=te[Ve]});const Ke=Ne.toFiniteNumber(te.headers.get("content-length")),[He,ht]=s&&oT(Ke,Jg(sT(s),!0))||[];te=new Response(lT(te.body,cT,He,()=>{ht&&ht(),me&&me()}),Oe)}D=D||"text";let ze=await Qg[Ne.findKey(Qg,D)||"text"](te,e);return!le&&me&&me(),await new Promise((Oe,Ke)=>{GC(Oe,Ke,{data:ze,headers:Ho.from(te.headers),status:te.status,statusText:te.statusText,config:e,request:ae})})}catch(ie){throw me&&me(),ie&&ie.name==="TypeError"&&/fetch/i.test(ie.message)?Object.assign(new qt("Network Error",qt.ERR_NETWORK,e,ae),{cause:ie.cause||ie}):qt.from(ie,ie&&ie.code,e,ae)}}),c1={http:C5,xhr:iO,fetch:fO};Ne.forEach(c1,(e,n)=>{if(e){try{Object.defineProperty(e,"name",{value:n})}catch{}Object.defineProperty(e,"adapterName",{value:n})}});const uT=e=>`- ${e}`,mO=e=>Ne.isFunction(e)||e===null||e===!1,XC={getAdapter:e=>{e=Ne.isArray(e)?e:[e];const{length:n}=e;let l,h;const m={};for(let v=0;v`adapter ${s} `+(k===!1?"is not supported by the environment":"is not available in the build"));let E=n?v.length>1?`since : +`+v.map(uT).join(` +`):" "+uT(v[0]):"as no adapter specified";throw new qt("There is no suitable adapter to dispatch the request "+E,"ERR_NOT_SUPPORT")}return h},adapters:c1};function ev(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new gh(null,e)}function hT(e){return ev(e),e.headers=Ho.from(e.headers),e.data=Q0.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),XC.getAdapter(e.adapter||bx.adapter)(e).then(function(h){return ev(e),h.data=Q0.call(e,e.transformResponse,h),h.headers=Ho.from(h.headers),h},function(h){return $C(h)||(ev(e),h&&h.response&&(h.response.data=Q0.call(e,e.transformResponse,h.response),h.response.headers=Ho.from(h.response.headers))),Promise.reject(h)})}const KC="1.7.7",Ex={};["object","boolean","number","function","string","symbol"].forEach((e,n)=>{Ex[e]=function(h){return typeof h===e||"a"+(n<1?"n ":" ")+e}});const dT={};Ex.transitional=function(n,l,h){function m(v,E){return"[Axios v"+KC+"] Transitional option '"+v+"'"+E+(h?". "+h:"")}return(v,E,s)=>{if(n===!1)throw new qt(m(E," has been removed"+(l?" in "+l:"")),qt.ERR_DEPRECATED);return l&&!dT[E]&&(dT[E]=!0,console.warn(m(E," has been deprecated since v"+l+" and will be removed in the near future"))),n?n(v,E,s):!0}};function gO(e,n,l){if(typeof e!="object")throw new qt("options must be an object",qt.ERR_BAD_OPTION_VALUE);const h=Object.keys(e);let m=h.length;for(;m-- >0;){const v=h[m],E=n[v];if(E){const s=e[v],k=s===void 0||E(s,v,e);if(k!==!0)throw new qt("option "+v+" must be "+k,qt.ERR_BAD_OPTION_VALUE);continue}if(l!==!0)throw new qt("Unknown option "+v,qt.ERR_BAD_OPTION)}}const u1={assertOptions:gO,validators:Ex},Va=u1.validators;class e_{constructor(n){this.defaults=n,this.interceptors={request:new rT,response:new rT}}async request(n,l){try{return await this._request(n,l)}catch(h){if(h instanceof Error){let m;Error.captureStackTrace?Error.captureStackTrace(m={}):m=new Error;const v=m.stack?m.stack.replace(/^.+\n/,""):"";try{h.stack?v&&!String(h.stack).endsWith(v.replace(/^.+\n.+\n/,""))&&(h.stack+=` +`+v):h.stack=v}catch{}}throw h}}_request(n,l){typeof n=="string"?(l=l||{},l.url=n):l=n||{},l=xc(this.defaults,l);const{transitional:h,paramsSerializer:m,headers:v}=l;h!==void 0&&u1.assertOptions(h,{silentJSONParsing:Va.transitional(Va.boolean),forcedJSONParsing:Va.transitional(Va.boolean),clarifyTimeoutError:Va.transitional(Va.boolean)},!1),m!=null&&(Ne.isFunction(m)?l.paramsSerializer={serialize:m}:u1.assertOptions(m,{encode:Va.function,serialize:Va.function},!0)),l.method=(l.method||this.defaults.method||"get").toLowerCase();let E=v&&Ne.merge(v.common,v[l.method]);v&&Ne.forEach(["delete","get","head","post","put","patch","common"],ae=>{delete v[ae]}),l.headers=Ho.concat(E,v);const s=[];let k=!0;this.interceptors.request.forEach(function(me){typeof me.runWhen=="function"&&me.runWhen(l)===!1||(k=k&&me.synchronous,s.unshift(me.fulfilled,me.rejected))});const D=[];this.interceptors.response.forEach(function(me){D.push(me.fulfilled,me.rejected)});let V,G=0,J;if(!k){const ae=[hT.bind(this),void 0];for(ae.unshift.apply(ae,s),ae.push.apply(ae,D),J=ae.length,V=Promise.resolve(l);G{if(!h._listeners)return;let v=h._listeners.length;for(;v-- >0;)h._listeners[v](m);h._listeners=null}),this.promise.then=m=>{let v;const E=new Promise(s=>{h.subscribe(s),v=s}).then(m);return E.cancel=function(){h.unsubscribe(v)},E},n(function(v,E,s){h.reason||(h.reason=new gh(v,E,s),l(h.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(n){if(this.reason){n(this.reason);return}this._listeners?this._listeners.push(n):this._listeners=[n]}unsubscribe(n){if(!this._listeners)return;const l=this._listeners.indexOf(n);l!==-1&&this._listeners.splice(l,1)}toAbortSignal(){const n=new AbortController,l=h=>{n.abort(h)};return this.subscribe(l),n.signal.unsubscribe=()=>this.unsubscribe(l),n.signal}static source(){let n;return{token:new Tx(function(m){n=m}),cancel:n}}}const _O=Tx;function yO(e){return function(l){return e.apply(null,l)}}function vO(e){return Ne.isObject(e)&&e.isAxiosError===!0}const h1={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(h1).forEach(([e,n])=>{h1[n]=e});const xO=h1;function YC(e){const n=new xg(e),l=IC(xg.prototype.request,n);return Ne.extend(l,xg.prototype,n,{allOwnKeys:!0}),Ne.extend(l,n,null,{allOwnKeys:!0}),l.create=function(m){return YC(xc(e,m))},l}const xr=YC(bx);xr.Axios=xg;xr.CanceledError=gh;xr.CancelToken=_O;xr.isCancel=$C;xr.VERSION=KC;xr.toFormData=I_;xr.AxiosError=qt;xr.Cancel=xr.CanceledError;xr.all=function(n){return Promise.all(n)};xr.spread=yO;xr.isAxiosError=vO;xr.mergeConfig=xc;xr.AxiosHeaders=Ho;xr.formToJSON=e=>VC(Ne.isHTMLForm(e)?new FormData(e):e);xr.getAdapter=XC.getAdapter;xr.HttpStatusCode=xO;xr.default=xr;const wO=xr;/* + * Frontend UI component library for the CORI Data API + * {@link https://github.com/ruralinnovation/cori.data.api} + * @copyright Rural Innovation Strategies, Inc. + * @license ISC + */const Gu="https://cori-data-api.ruralinnovation.us/",d1=wO.create({baseURL:Gu,headers:{"Content-Type":"application/json"}}),tv={},JC={apiClient:d1,authenticated:!1,authenticated_user:null,autoSignOut:null,baseURL:Gu,token:null,data:{get:()=>tv,set:e=>{for(const n in e)e.hasOwnProperty[n]&&(tv[n]=e)}},setData:e=>{for(const n in e)e.hasOwnProperty[n]&&(tv[n]=e)}},QC=ut.createContext(JC);let tg=!1,pT=!1;function bO(e){const[n,l]=ut.useState(Object.assign(Object.assign({},JC),{baseURL:e.baseURL?e.baseURL:Gu,setData:h}));function h(m){const v=n;l(Object.assign(Object.assign({},v),{data:Object.assign(Object.assign({},v.data),m),setData:h}))}return e.baseURL&&e.baseURL.length>0&&d1.interceptors.request.use(m=>(m.baseURL=e.baseURL,console.log("API baseURL updated:",m.baseURL),m),m=>Promise.reject(m)),ut.useEffect(()=>{if(l(Object.assign(Object.assign({},n),{autoSignOut:e.signOut&&typeof e.signOut=="function"?()=>{const{signOut:m}=e;m(),window.alert("Please refresh this session by clicking the browser's reload button!"),window.location=window.location.protocol+"//"+window.location.host+window.location.pathname}:null,baseURL:e.baseURL?e.baseURL:Gu})),e.fetchAuthSession){const{fetchAuthSession:m}=e;m().then(E=>{if(!tg){const s=E.tokens;if(console.log("API tokens:",s),s&&s.hasOwnProperty("idToken")&&(tg=!0,console.log("API Session is authenticated:",tg),console.log("API Session config:",E),console.log("idToken:",s.idToken),d1.interceptors.request.use(k=>{const D=s.idToken;return D&&(k.headers.Authorization=`Bearer ${D}`),e.baseURL&&(k.baseURL=e.baseURL),k},k=>Promise.reject(k)),l(Object.assign(Object.assign({},n),{authenticated:!0,autoSignOut:e.signOut&&typeof e.signOut=="function"?()=>{const{signOut:k}=e;k(),window.alert("Please refresh this session by clicking the browser's reload button!"),window.location=window.location.protocol+"//"+window.location.host+window.location.pathname}:null,baseURL:e.baseURL||Gu,token:s.idToken})),e.getCurrentUser)){const{getCurrentUser:k}=e;k().then(V=>{pT||(pT=!0,console.log("API User is authenticated:",tg),console.log("API User:",V),console.log("API User type:",V.constructor.name),l(Object.assign(Object.assign({},n),{authenticated:!0,authenticated_user:V,autoSignOut:e.signOut&&typeof e.signOut=="function"?()=>{const{signOut:G}=e;G(),window.alert("Please refresh this session by clicking the browser's reload button!"),window.location=window.location.protocol+"//"+window.location.host+window.location.pathname}:null,baseURL:e.baseURL||Gu,token:s.idToken})))})}}})}},[]),T0.createElement(T0.Fragment,null,T0.createElement(QC.Provider,{value:n},e.children))}const EO="modulepreload",TO=function(e){return"/"+e},fT={},SO=function(n,l,h){if(!l||l.length===0)return n();const m=document.getElementsByTagName("link");return Promise.all(l.map(v=>{if(v=TO(v),v in fT)return;fT[v]=!0;const E=v.endsWith(".css"),s=E?'[rel="stylesheet"]':"";if(!!h)for(let V=m.length-1;V>=0;V--){const G=m[V];if(G.href===v&&(!E||G.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${v}"]${s}`))return;const D=document.createElement("link");if(D.rel=E?"stylesheet":EO,E||(D.as="script",D.crossOrigin=""),D.href=v,document.head.appendChild(D),E)return new Promise((V,G)=>{D.addEventListener("load",V),D.addEventListener("error",()=>G(new Error(`Unable to preload CSS for ${v}`)))})})).then(()=>n()).catch(v=>{const E=new Event("vite:preloadError",{cancelable:!0});if(E.payload=v,window.dispatchEvent(E),!E.defaultPrevented)throw v})},AO=ut.createContext(null);function CO(e,n){const l=Array.isArray(e)?e[0]:e?e.x:0,h=Array.isArray(e)?e[1]:e?e.y:0,m=Array.isArray(n)?n[0]:n?n.x:0,v=Array.isArray(n)?n[1]:n?n.y:0;return l===m&&h===v}function Ks(e,n){if(e===n)return!0;if(!e||!n)return!1;if(Array.isArray(e)){if(!Array.isArray(n)||e.length!==n.length)return!1;for(let l=0;l{let m=null;"interactive"in h&&(m=Object.assign({},h),delete m.interactive);const v=n[h.ref];if(v){m=m||Object.assign({},h),delete m.ref;for(const E of kO)E in v&&(m[E]=v[E])}return m||h});return{...e,layers:l}}const vT={version:8,sources:{},layers:[]},xT={mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",click:"onClick",dblclick:"onDblClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mouseout:"onMouseOut",contextmenu:"onContextMenu",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",touchcancel:"onTouchCancel"},nv={movestart:"onMoveStart",move:"onMove",moveend:"onMoveEnd",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",zoomstart:"onZoomStart",zoom:"onZoom",zoomend:"onZoomEnd",rotatestart:"onRotateStart",rotate:"onRotate",rotateend:"onRotateEnd",pitchstart:"onPitchStart",pitch:"onPitch",pitchend:"onPitchEnd"},wT={wheel:"onWheel",boxzoomstart:"onBoxZoomStart",boxzoomend:"onBoxZoomEnd",boxzoomcancel:"onBoxZoomCancel",resize:"onResize",load:"onLoad",render:"onRender",idle:"onIdle",remove:"onRemove",data:"onData",styledata:"onStyleData",sourcedata:"onSourceData",error:"onError"},MO=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],PO=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class lh{constructor(n,l,h){this._map=null,this._internalUpdate=!1,this._inRender=!1,this._hoveredFeatures=null,this._deferredEvents={move:!1,zoom:!1,pitch:!1,rotate:!1},this._onEvent=m=>{const v=this.props[wT[m.type]];v?v(m):m.type==="error"&&console.error(m.error)},this._onPointerEvent=m=>{(m.type==="mousemove"||m.type==="mouseout")&&this._updateHover(m);const v=this.props[xT[m.type]];v&&(this.props.interactiveLayerIds&&m.type!=="mouseover"&&m.type!=="mouseout"&&(m.features=this._hoveredFeatures||this._queryRenderedFeatures(m.point)),v(m),delete m.features)},this._onCameraEvent=m=>{if(!this._internalUpdate){const v=this.props[nv[m.type]];v&&v(m)}m.type in this._deferredEvents&&(this._deferredEvents[m.type]=!1)},this._MapClass=n,this.props=l,this._initialize(h)}get map(){return this._map}get transform(){return this._renderTransform}setProps(n){const l=this.props;this.props=n;const h=this._updateSettings(n,l);h&&this._createShadowTransform(this._map);const m=this._updateSize(n),v=this._updateViewState(n,!0);this._updateStyle(n,l),this._updateStyleComponents(n,l),this._updateHandlers(n,l),(h||m||v&&!this._map.isMoving())&&this.redraw()}static reuse(n,l){const h=lh.savedMaps.pop();if(!h)return null;const m=h.map,v=m.getContainer();for(l.className=v.className;v.childNodes.length>0;)l.appendChild(v.childNodes[0]);m._container=l;const E=m._resizeObserver;E&&(E.disconnect(),E.observe(l)),h.setProps({...n,styleDiffing:!1}),m.resize();const{initialViewState:s}=n;return s&&(s.bounds?m.fitBounds(s.bounds,{...s.fitBoundsOptions,duration:0}):h._updateViewState(s,!1)),m.isStyleLoaded()?m.fire("load"):m.once("styledata",()=>m.fire("load")),m._update(),h}_initialize(n){const{props:l}=this,{mapStyle:h=vT}=l,m={...l,...l.initialViewState,accessToken:l.mapboxAccessToken||zO()||null,container:n,style:yT(h)},v=m.initialViewState||m.viewState||m;if(Object.assign(m,{center:[v.longitude||0,v.latitude||0],zoom:v.zoom||0,pitch:v.pitch||0,bearing:v.bearing||0}),l.gl){const V=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=V,l.gl)}const E=new this._MapClass(m);v.padding&&E.setPadding(v.padding),l.cursor&&(E.getCanvas().style.cursor=l.cursor),this._createShadowTransform(E);const s=E._render;E._render=V=>{this._inRender=!0,s.call(E,V),this._inRender=!1};const k=E._renderTaskQueue.run;E._renderTaskQueue.run=V=>{k.call(E._renderTaskQueue,V),this._onBeforeRepaint()},E.on("render",()=>this._onAfterRepaint());const D=E.fire;E.fire=this._fireEvent.bind(this,D),E.on("resize",()=>{this._renderTransform.resize(E.transform.width,E.transform.height)}),E.on("styledata",()=>{this._updateStyleComponents(this.props,{}),mT(E.transform,this._renderTransform)}),E.on("sourcedata",()=>this._updateStyleComponents(this.props,{}));for(const V in xT)E.on(V,this._onPointerEvent);for(const V in nv)E.on(V,this._onCameraEvent);for(const V in wT)E.on(V,this._onEvent);this._map=E}recycle(){const l=this.map.getContainer().querySelector("[mapboxgl-children]");l==null||l.remove(),lh.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const n=this._map;!this._inRender&&n.style&&(n._frame&&(n._frame.cancel(),n._frame=null),n._render())}_createShadowTransform(n){const l=IO(n.transform);n.painter.transform=l,this._renderTransform=l}_updateSize(n){const{viewState:l}=n;if(l){const h=this._map;if(l.width!==h.transform.width||l.height!==h.transform.height)return h.resize(),!0}return!1}_updateViewState(n,l){if(this._internalUpdate)return!1;const h=this._map,m=this._renderTransform,{zoom:v,pitch:E,bearing:s}=m,k=h.isMoving();k&&(m.cameraElevationReference="sea");const D=_T(m,{...gT(h.transform),...n});if(k&&(m.cameraElevationReference="ground"),D&&l){const V=this._deferredEvents;V.move=!0,V.zoom||(V.zoom=v!==m.zoom),V.rotate||(V.rotate=s!==m.bearing),V.pitch||(V.pitch=E!==m.pitch)}return k||_T(h.transform,n),D}_updateSettings(n,l){const h=this._map;let m=!1;for(const v of MO)if(v in n&&!Ks(n[v],l[v])){m=!0;const E=h[`set${v[0].toUpperCase()}${v.slice(1)}`];E==null||E.call(h,n[v])}return m}_updateStyle(n,l){if(n.cursor!==l.cursor&&(this._map.getCanvas().style.cursor=n.cursor||""),n.mapStyle!==l.mapStyle){const{mapStyle:h=vT,styleDiffing:m=!0}=n,v={diff:m};return"localIdeographFontFamily"in n&&(v.localIdeographFontFamily=n.localIdeographFontFamily),this._map.setStyle(yT(h),v),!0}return!1}_updateStyleComponents(n,l){const h=this._map;let m=!1;return h.isStyleLoaded()&&("light"in n&&h.setLight&&!Ks(n.light,l.light)&&(m=!0,h.setLight(n.light)),"fog"in n&&h.setFog&&!Ks(n.fog,l.fog)&&(m=!0,h.setFog(n.fog)),"terrain"in n&&h.setTerrain&&!Ks(n.terrain,l.terrain)&&(!n.terrain||h.getSource(n.terrain.source))&&(m=!0,h.setTerrain(n.terrain))),m}_updateHandlers(n,l){var h,m;const v=this._map;let E=!1;for(const s of PO){const k=(h=n[s])!==null&&h!==void 0?h:!0,D=(m=l[s])!==null&&m!==void 0?m:!0;Ks(k,D)||(E=!0,k?v[s].enable(k):v[s].disable())}return E}_queryRenderedFeatures(n){const l=this._map,h=l.transform,{interactiveLayerIds:m=[]}=this.props;try{return l.transform=this._renderTransform,l.queryRenderedFeatures(n,{layers:m.filter(l.getLayer.bind(l))})}catch{return[]}finally{l.transform=h}}_updateHover(n){var l;const{props:h}=this;if(h.interactiveLayerIds&&(h.onMouseMove||h.onMouseEnter||h.onMouseLeave)){const v=n.type,E=((l=this._hoveredFeatures)===null||l===void 0?void 0:l.length)>0,s=this._queryRenderedFeatures(n.point),k=s.length>0;!k&&E&&(n.type="mouseleave",this._onPointerEvent(n)),this._hoveredFeatures=s,k&&!E&&(n.type="mouseenter",this._onPointerEvent(n)),n.type=v}else this._hoveredFeatures=null}_fireEvent(n,l,h){const m=this._map,v=m.transform,E=typeof l=="string"?l:l.type;return E==="move"&&this._updateViewState(this.props,!1),E in nv&&(typeof l=="object"&&(l.viewState=gT(v)),this._map.isMoving())?(m.transform=this._renderTransform,n.call(m,l,h),m.transform=v,m):(n.call(m,l,h),m)}_onBeforeRepaint(){const n=this._map;this._internalUpdate=!0;for(const h in this._deferredEvents)this._deferredEvents[h]&&n.fire(h);this._internalUpdate=!1;const l=this._map.transform;n.transform=this._renderTransform,this._onAfterRepaint=()=>{mT(this._renderTransform,l),n.transform=l}}}lh.savedMaps=[];function zO(){let e=null;if(typeof location<"u"){const n=/access_token=([^&\/]*)/.exec(location.search);e=n&&n[1]}try{e=e||void 0}catch{}try{e=e||{}.REACT_APP_MAPBOX_ACCESS_TOKEN}catch{}return e}const LO=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function RO(e){if(!e)return null;const n=e.map,l={getMap:()=>n,getCenter:()=>e.transform.center,getZoom:()=>e.transform.zoom,getBearing:()=>e.transform.bearing,getPitch:()=>e.transform.pitch,getPadding:()=>e.transform.padding,getBounds:()=>e.transform.getBounds(),project:h=>{const m=n.transform;n.transform=e.transform;const v=n.project(h);return n.transform=m,v},unproject:h=>{const m=n.transform;n.transform=e.transform;const v=n.unproject(h);return n.transform=m,v},queryTerrainElevation:(h,m)=>{const v=n.transform;n.transform=e.transform;const E=n.queryTerrainElevation(h,m);return n.transform=v,E},queryRenderedFeatures:(h,m)=>{const v=n.transform;n.transform=e.transform;const E=n.queryRenderedFeatures(h,m);return n.transform=v,E}};for(const h of DO(n))!(h in l)&&!LO.includes(h)&&(l[h]=n[h].bind(n));return l}function DO(e){const n=new Set;let l=e;for(;l;){for(const h of Object.getOwnPropertyNames(l))h[0]!=="_"&&typeof e[h]=="function"&&h!=="fire"&&h!=="setEventedParent"&&n.add(h);l=Object.getPrototypeOf(l)}return Array.from(n)}const OO=typeof document<"u"?ut.useLayoutEffect:ut.useEffect,BO=["baseApiUrl","maxParallelImageRequests","workerClass","workerCount","workerUrl"];function FO(e,n){for(const h of BO)h in n&&(e[h]=n[h]);const{RTLTextPlugin:l="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js"}=n;l&&e.getRTLTextPluginStatus&&e.getRTLTextPluginStatus()==="unavailable"&&e.setRTLTextPlugin(l,h=>{h&&console.error(h)},!0)}const P_=ut.createContext(null);function NO(e,n,l){const h=ut.useContext(AO),[m,v]=ut.useState(null),E=ut.useRef(),{current:s}=ut.useRef({mapLib:null,map:null});ut.useEffect(()=>{const V=e.mapLib;let G=!0,J;return Promise.resolve(V||l).then(ve=>{if(!G)return;if(!ve)throw new Error("Invalid mapLib");const ae="Map"in ve?ve:ve.default;if(!ae.Map)throw new Error("Invalid mapLib");if(FO(ae,e),!ae.supported||ae.supported(e))e.reuseMaps&&(J=lh.reuse(e,E.current)),J||(J=new lh(ae.Map,e,E.current)),s.map=RO(J),s.mapLib=ae,v(J),h==null||h.onMapMount(s.map,e.id);else throw new Error("Map is not supported by this browser")}).catch(ve=>{const{onError:ae}=e;ae?ae({type:"error",target:null,originalEvent:null,error:ve}):console.error(ve)}),()=>{G=!1,J&&(h==null||h.onMapUnmount(e.id),e.reuseMaps?J.recycle():J.destroy())}},[]),OO(()=>{m&&m.setProps(e)}),ut.useImperativeHandle(n,()=>s.map,[m]);const k=ut.useMemo(()=>({position:"relative",width:"100%",height:"100%",...e.style}),[e.style]),D={height:"100%"};return ut.createElement("div",{id:e.id,ref:E,style:k},m&&ut.createElement(P_.Provider,{value:s},ut.createElement("div",{"mapboxgl-children":"",style:D},e.children)))}const UO=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function Ec(e,n){if(!e||!n)return;const l=e.style;for(const h in n){const m=n[h];Number.isFinite(m)&&!UO.test(h)?l[h]=`${m}px`:l[h]=m}}function jO(e,n){const{map:l,mapLib:h}=ut.useContext(P_),m=ut.useRef({props:e});m.current.props=e;const v=ut.useMemo(()=>{let me=!1;ut.Children.forEach(e.children,te=>{te&&(me=!0)});const Ce={...e,element:me?document.createElement("div"):null},ie=new h.Marker(Ce);return ie.setLngLat([e.longitude,e.latitude]),ie.getElement().addEventListener("click",te=>{var le,ze;(ze=(le=m.current.props).onClick)===null||ze===void 0||ze.call(le,{type:"click",target:ie,originalEvent:te})}),ie.on("dragstart",te=>{var le,ze;const Oe=te;Oe.lngLat=v.getLngLat(),(ze=(le=m.current.props).onDragStart)===null||ze===void 0||ze.call(le,Oe)}),ie.on("drag",te=>{var le,ze;const Oe=te;Oe.lngLat=v.getLngLat(),(ze=(le=m.current.props).onDrag)===null||ze===void 0||ze.call(le,Oe)}),ie.on("dragend",te=>{var le,ze;const Oe=te;Oe.lngLat=v.getLngLat(),(ze=(le=m.current.props).onDragEnd)===null||ze===void 0||ze.call(le,Oe)}),ie},[]);ut.useEffect(()=>(v.addTo(l.getMap()),()=>{v.remove()}),[]);const{longitude:E,latitude:s,offset:k,style:D,draggable:V=!1,popup:G=null,rotation:J=0,rotationAlignment:ve="auto",pitchAlignment:ae="auto"}=e;return ut.useEffect(()=>{Ec(v.getElement(),D)},[D]),ut.useImperativeHandle(n,()=>v,[]),(v.getLngLat().lng!==E||v.getLngLat().lat!==s)&&v.setLngLat([E,s]),k&&!CO(v.getOffset(),k)&&v.setOffset(k),v.isDraggable()!==V&&v.setDraggable(V),v.getRotation()!==J&&v.setRotation(J),v.getRotationAlignment()!==ve&&v.setRotationAlignment(ve),v.getPitchAlignment()!==ae&&v.setPitchAlignment(ae),v.getPopup()!==G&&v.setPopup(G),hx.createPortal(e.children,v.getElement())}const VO=ut.memo(ut.forwardRef(jO));function bT(e){return new Set(e?e.trim().split(/\s+/):[])}function $O(e,n){const{map:l,mapLib:h}=ut.useContext(P_),m=ut.useMemo(()=>document.createElement("div"),[]),v=ut.useRef({props:e});v.current.props=e;const E=ut.useMemo(()=>{const s={...e},k=new h.Popup(s);return k.setLngLat([e.longitude,e.latitude]),k.once("open",D=>{var V,G;(G=(V=v.current.props).onOpen)===null||G===void 0||G.call(V,D)}),k},[]);if(ut.useEffect(()=>{const s=k=>{var D,V;(V=(D=v.current.props).onClose)===null||V===void 0||V.call(D,k)};return E.on("close",s),E.setDOMContent(m).addTo(l.getMap()),()=>{E.off("close",s),E.isOpen()&&E.remove()}},[]),ut.useEffect(()=>{Ec(E.getElement(),e.style)},[e.style]),ut.useImperativeHandle(n,()=>E,[]),E.isOpen()&&((E.getLngLat().lng!==e.longitude||E.getLngLat().lat!==e.latitude)&&E.setLngLat([e.longitude,e.latitude]),e.offset&&!Ks(E.options.offset,e.offset)&&E.setOffset(e.offset),(E.options.anchor!==e.anchor||E.options.maxWidth!==e.maxWidth)&&(E.options.anchor=e.anchor,E.setMaxWidth(e.maxWidth)),E.options.className!==e.className)){const s=bT(E.options.className),k=bT(e.className);for(const D of s)k.has(D)||E.removeClassName(D);for(const D of k)s.has(D)||E.addClassName(D);E.options.className=e.className}return hx.createPortal(e.children,m)}ut.memo(ut.forwardRef($O));function _h(e,n,l,h){const m=ut.useContext(P_),v=ut.useMemo(()=>e(m),[]);return ut.useEffect(()=>{const E=h||l||n,s=typeof n=="function"&&typeof l=="function"?n:null,k=typeof l=="function"?l:typeof n=="function"?n:null,{map:D}=m;return D.hasControl(v)||(D.addControl(v,E==null?void 0:E.position),s&&s(m)),()=>{k&&k(m),D.hasControl(v)&&D.removeControl(v)}},[]),v}function GO(e){const n=_h(({mapLib:l})=>new l.AttributionControl(e),{position:e.position});return ut.useEffect(()=>{Ec(n._container,e.style)},[e.style]),null}ut.memo(GO);function qO(e){const n=_h(({mapLib:l})=>new l.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return ut.useEffect(()=>{Ec(n._controlContainer,e.style)},[e.style]),null}ut.memo(qO);function WO(e,n){const l=ut.useRef({props:e}),h=_h(({mapLib:m})=>{const v=new m.GeolocateControl(e),E=v._setupUI;return v._setupUI=s=>{v._container.hasChildNodes()||E(s)},v.on("geolocate",s=>{var k,D;(D=(k=l.current.props).onGeolocate)===null||D===void 0||D.call(k,s)}),v.on("error",s=>{var k,D;(D=(k=l.current.props).onError)===null||D===void 0||D.call(k,s)}),v.on("outofmaxbounds",s=>{var k,D;(D=(k=l.current.props).onOutOfMaxBounds)===null||D===void 0||D.call(k,s)}),v.on("trackuserlocationstart",s=>{var k,D;(D=(k=l.current.props).onTrackUserLocationStart)===null||D===void 0||D.call(k,s)}),v.on("trackuserlocationend",s=>{var k,D;(D=(k=l.current.props).onTrackUserLocationEnd)===null||D===void 0||D.call(k,s)}),v},{position:e.position});return l.current.props=e,ut.useImperativeHandle(n,()=>h,[]),ut.useEffect(()=>{Ec(h._container,e.style)},[e.style]),null}const ZO=ut.memo(ut.forwardRef(WO));function HO(e){const n=_h(({mapLib:l})=>new l.NavigationControl(e),{position:e.position});return ut.useEffect(()=>{Ec(n._container,e.style)},[e.style]),null}const XO=ut.memo(HO);function KO(e){const n=_h(({mapLib:v})=>new v.ScaleControl(e),{position:e.position}),l=ut.useRef(e),h=l.current;l.current=e;const{style:m}=e;return e.maxWidth!==void 0&&e.maxWidth!==h.maxWidth&&(n.options.maxWidth=e.maxWidth),e.unit!==void 0&&e.unit!==h.unit&&n.setUnit(e.unit),ut.useEffect(()=>{Ec(n._container,m)},[m]),null}const YO=ut.memo(KO),JO=SO(()=>Promise.resolve().then(()=>SU),void 0),QO=(()=>ut.forwardRef(function(n,l){return NO(n,l,JO)}))(),eI=VO,e4=XO,t4=ZO,n4=YO;var yh=i4,r4=Object.prototype.hasOwnProperty;function i4(){for(var e={},n=0;n-1};ri.prototype.value=function(e){if(this.selected=e,this.el.value=this.getItemValue(e),document.createEvent){var n=document.createEvent("HTMLEvents");n.initEvent("change",!0,!1),this.el.dispatchEvent(n)}else this.el.fireEvent("onchange")};ri.prototype.getCandidates=function(e){var n={pre:"",post:"",extract:(function(h){return this.getItemValue(h)}).bind(this)},l;this.options.filter?(l=l4.filter(this.query,this.data,n),l=l.map((function(h){return{original:h.original,string:this.render(h.original,h.string)}}).bind(this))):l=this.data.map((function(h){var m=this.render(h);return{original:h,string:m}}).bind(this)),e(l)};ri.prototype.getItemValue=function(e){return e};ri.prototype.render=function(e,n){if(n)return n;for(var l=e.original?this.getItemValue(e.original):this.getItemValue(e),h=this.normalize(l),m=h.lastIndexOf(this.query);m>-1;){var v=m+this.query.length;l=l.slice(0,m)+""+l.slice(m,v)+""+l.slice(v),m=h.slice(0,m).lastIndexOf(this.query)}return l};ri.prototype.renderError=function(e){this.list.drawError(e)};var u4=ri,nI=u4,h4=nI;typeof window<"u"&&(window.Suggestions=nI);var d4="Expected a function",ET=0/0,p4="[object Symbol]",f4=/^\s+|\s+$/g,m4=/^[-+]0x[0-9a-f]+$/i,g4=/^0b[01]+$/i,_4=/^0o[0-7]+$/i,y4=parseInt,v4=typeof Go=="object"&&Go&&Go.Object===Object&&Go,x4=typeof self=="object"&&self&&self.Object===Object&&self,w4=v4||x4||Function("return this")(),b4=Object.prototype,E4=b4.toString,T4=Math.max,S4=Math.min,rv=function(){return w4.Date.now()};function A4(e,n,l){var h,m,v,E,s,k,D=0,V=!1,G=!1,J=!0;if(typeof e!="function")throw new TypeError(d4);n=TT(n)||0,p1(l)&&(V=!!l.leading,G="maxWait"in l,v=G?T4(TT(l.maxWait)||0,n):v,J="trailing"in l?!!l.trailing:J);function ve(Ke){var He=h,ht=m;return h=m=void 0,D=Ke,E=e.apply(ht,He),E}function ae(Ke){return D=Ke,s=setTimeout(ie,n),V?ve(Ke):E}function me(Ke){var He=Ke-k,ht=Ke-D,Ve=n-He;return G?S4(Ve,v-ht):Ve}function Ce(Ke){var He=Ke-k,ht=Ke-D;return k===void 0||He>=n||He<0||G&&ht>=v}function ie(){var Ke=rv();if(Ce(Ke))return te(Ke);s=setTimeout(ie,me(Ke))}function te(Ke){return s=void 0,J&&h?ve(Ke):(h=m=void 0,E)}function le(){s!==void 0&&clearTimeout(s),D=0,h=k=m=s=void 0}function ze(){return s===void 0?E:te(rv())}function Oe(){var Ke=rv(),He=Ce(Ke);if(h=arguments,m=this,k=Ke,He){if(s===void 0)return ae(k);if(G)return s=setTimeout(ie,n),ve(k)}return s===void 0&&(s=setTimeout(ie,n)),E}return Oe.cancel=le,Oe.flush=ze,Oe}function p1(e){var n=typeof e;return!!e&&(n=="object"||n=="function")}function C4(e){return!!e&&typeof e=="object"}function I4(e){return typeof e=="symbol"||C4(e)&&E4.call(e)==p4}function TT(e){if(typeof e=="number")return e;if(I4(e))return ET;if(p1(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=p1(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=e.replace(f4,"");var l=g4.test(e);return l||_4.test(e)?y4(e.slice(2),l?2:8):m4.test(e)?ET:+e}var k4=A4,Sx={exports:{}},Yu=typeof Reflect=="object"?Reflect:null,ST=Yu&&typeof Yu.apply=="function"?Yu.apply:function(n,l,h){return Function.prototype.apply.call(n,l,h)},wg;Yu&&typeof Yu.ownKeys=="function"?wg=Yu.ownKeys:Object.getOwnPropertySymbols?wg=function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:wg=function(n){return Object.getOwnPropertyNames(n)};function M4(e){console&&console.warn&&console.warn(e)}var rI=Number.isNaN||function(n){return n!==n};function Cn(){Cn.init.call(this)}Sx.exports=Cn;Sx.exports.once=R4;Cn.EventEmitter=Cn;Cn.prototype._events=void 0;Cn.prototype._eventsCount=0;Cn.prototype._maxListeners=void 0;var AT=10;function z_(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(Cn,"defaultMaxListeners",{enumerable:!0,get:function(){return AT},set:function(e){if(typeof e!="number"||e<0||rI(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");AT=e}});Cn.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};Cn.prototype.setMaxListeners=function(n){if(typeof n!="number"||n<0||rI(n))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+n+".");return this._maxListeners=n,this};function iI(e){return e._maxListeners===void 0?Cn.defaultMaxListeners:e._maxListeners}Cn.prototype.getMaxListeners=function(){return iI(this)};Cn.prototype.emit=function(n){for(var l=[],h=1;h0&&(E=l[0]),E instanceof Error)throw E;var s=new Error("Unhandled error."+(E?" ("+E.message+")":""));throw s.context=E,s}var k=v[n];if(k===void 0)return!1;if(typeof k=="function")ST(k,this,l);else for(var D=k.length,V=cI(k,D),h=0;h0&&E.length>m&&!E.warned){E.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+E.length+" "+String(n)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=n,s.count=E.length,M4(s)}return e}Cn.prototype.addListener=function(n,l){return oI(this,n,l,!1)};Cn.prototype.on=Cn.prototype.addListener;Cn.prototype.prependListener=function(n,l){return oI(this,n,l,!0)};function P4(){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 sI(e,n,l){var h={fired:!1,wrapFn:void 0,target:e,type:n,listener:l},m=P4.bind(h);return m.listener=l,h.wrapFn=m,m}Cn.prototype.once=function(n,l){return z_(l),this.on(n,sI(this,n,l)),this};Cn.prototype.prependOnceListener=function(n,l){return z_(l),this.prependListener(n,sI(this,n,l)),this};Cn.prototype.removeListener=function(n,l){var h,m,v,E,s;if(z_(l),m=this._events,m===void 0)return this;if(h=m[n],h===void 0)return this;if(h===l||h.listener===l)--this._eventsCount===0?this._events=Object.create(null):(delete m[n],m.removeListener&&this.emit("removeListener",n,h.listener||l));else if(typeof h!="function"){for(v=-1,E=h.length-1;E>=0;E--)if(h[E]===l||h[E].listener===l){s=h[E].listener,v=E;break}if(v<0)return this;v===0?h.shift():z4(h,v),h.length===1&&(m[n]=h[0]),m.removeListener!==void 0&&this.emit("removeListener",n,s||l)}return this};Cn.prototype.off=Cn.prototype.removeListener;Cn.prototype.removeAllListeners=function(n){var l,h,m;if(h=this._events,h===void 0)return this;if(h.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):h[n]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete h[n]),this;if(arguments.length===0){var v=Object.keys(h),E;for(m=0;m=0;m--)this.removeListener(n,l[m]);return this};function aI(e,n,l){var h=e._events;if(h===void 0)return[];var m=h[n];return m===void 0?[]:typeof m=="function"?l?[m.listener||m]:[m]:l?L4(m):cI(m,m.length)}Cn.prototype.listeners=function(n){return aI(this,n,!0)};Cn.prototype.rawListeners=function(n){return aI(this,n,!1)};Cn.listenerCount=function(e,n){return typeof e.listenerCount=="function"?e.listenerCount(n):lI.call(e,n)};Cn.prototype.listenerCount=lI;function lI(e){var n=this._events;if(n!==void 0){var l=n[e];if(typeof l=="function")return 1;if(l!==void 0)return l.length}return 0}Cn.prototype.eventNames=function(){return this._eventsCount>0?wg(this._events):[]};function cI(e,n){for(var l=new Array(n),h=0;h]*)>(.*)/);if(!n)return null;var l=n[1],h=n[2].split(";"),m=null,v=h.reduce(function(E,s){var k=F4(s);return k?k.key==="rel"?(m||(m=k.value),E):(E[k.key]=k.value,E):E},{});return m?{url:l,rel:m,params:v}:null}function U4(e){return e?e.split(/,\s*=400){var E=new IT({request:e,body:n.response,statusCode:n.status});h(E);return}l(n)};var v=e.body;typeof v=="string"?n.send(v):v?n.send(JSON.stringify(v)):m?n.send(m):n.send(),t_[e.id]=n}).then(function(l){return J4(e,l)})}function dI(e,n){var l=e.url(n),h=new window.XMLHttpRequest;return h.open(e.method,l),Object.keys(e.headers).forEach(function(m){h.setRequestHeader(m,e.headers[m])}),h}function Q4(e){return Promise.resolve().then(function(){var n=dI(e,e.client.accessToken);return hI(e,n)})}var eB={browserAbort:Y4,sendRequestXhr:hI,browserSend:Q4,createRequestXhr:dI},n_={exports:{}};/*! http://mths.be/base64 v0.1.0 by @mathias | MIT license */n_.exports;(function(e,n){(function(l){var h=n,m=e&&e.exports==h&&e,v=typeof Go=="object"&&Go;(v.global===v||v.window===v)&&(l=v);var E=function(ae){this.message=ae};E.prototype=new Error,E.prototype.name="InvalidCharacterError";var s=function(ae){throw new E(ae)},k="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",D=/[\t\n\f\r ]/g,V=function(ae){ae=String(ae).replace(D,"");var me=ae.length;me%4==0&&(ae=ae.replace(/==?$/,""),me=ae.length),(me%4==1||/[^+a-zA-Z0-9/]/.test(ae))&&s("Invalid character: the string to be decoded is not correctly encoded.");for(var Ce=0,ie,te,le="",ze=-1;++ze>(-2*Ce&6)));return le},G=function(ae){ae=String(ae),/[^\0-\xFF]/.test(ae)&&s("The string to be encoded contains characters outside of the Latin1 range.");for(var me=ae.length%3,Ce="",ie=-1,te,le,ze,Oe,Ke=ae.length-me;++ie>18&63)+k.charAt(Oe>>12&63)+k.charAt(Oe>>6&63)+k.charAt(Oe&63);return me==2?(te=ae.charCodeAt(ie)<<8,le=ae.charCodeAt(++ie),Oe=te+le,Ce+=k.charAt(Oe>>10)+k.charAt(Oe>>4&63)+k.charAt(Oe<<2&63)+"="):me==1&&(Oe=ae.charCodeAt(ie),Ce+=k.charAt(Oe>>2)+k.charAt(Oe<<4&63)+"=="),Ce},J={encode:G,decode:V,version:"0.1.0"};if(h&&!h.nodeType)if(m)m.exports=J;else for(var ve in J)J.hasOwnProperty(ve)&&(h[ve]=J[ve]);else l.base64=J})(Go)})(n_,n_.exports);var tB=n_.exports,nB=tB,ov={};function rB(e){if(ov[e])return ov[e];var n=e.split("."),l=n[0],h=n[1];if(!h)throw new Error("Invalid token");var m=iB(h),v={usage:l,user:m.u};return oc(m,"a")&&(v.authorization=m.a),oc(m,"exp")&&(v.expires=m.exp*1e3),oc(m,"iat")&&(v.created=m.iat*1e3),oc(m,"scopes")&&(v.scopes=m.scopes),oc(m,"client")&&(v.client=m.client),oc(m,"ll")&&(v.lastLogin=m.ll),oc(m,"iu")&&(v.impersonator=m.iu),ov[e]=v,v}function iB(e){try{return JSON.parse(nB.decode(e))}catch{throw new Error("Invalid token")}}function oc(e,n){return Object.prototype.hasOwnProperty.call(e,n)}var pI=rB,fI={exports:{}};(function(e){var n=Object.prototype.hasOwnProperty,l="~";function h(){}Object.create&&(h.prototype=Object.create(null),new h().__proto__||(l=!1));function m(k,D,V){this.fn=k,this.context=D,this.once=V||!1}function v(k,D,V,G,J){if(typeof V!="function")throw new TypeError("The listener must be a function");var ve=new m(V,G||k,J),ae=l?l+D:D;return k._events[ae]?k._events[ae].fn?k._events[ae]=[k._events[ae],ve]:k._events[ae].push(ve):(k._events[ae]=ve,k._eventsCount++),k}function E(k,D){--k._eventsCount===0?k._events=new h:delete k._events[D]}function s(){this._events=new h,this._eventsCount=0}s.prototype.eventNames=function(){var D=[],V,G;if(this._eventsCount===0)return D;for(G in V=this._events)n.call(V,G)&&D.push(l?G.slice(1):G);return Object.getOwnPropertySymbols?D.concat(Object.getOwnPropertySymbols(V)):D},s.prototype.listeners=function(D){var V=l?l+D:D,G=this._events[V];if(!G)return[];if(G.fn)return[G.fn];for(var J=0,ve=G.length,ae=new Array(ve);Jv.length?E:v})}};zn.equal=function(n){return function(h){if(h!==n)return JSON.stringify(n)}};zn.oneOf=function(){var n=Array.isArray(arguments[0])?arguments[0]:Array.prototype.slice.call(arguments),l=n.map(function(h){return zn.equal(h)});return zn.oneOfType.apply(this,l)};zn.range=function(n){var l=n[0],h=n[1];return function(v){var E=cl(zn.number,v);if(E||vh)return"number between "+l+" & "+h+" (inclusive)"}};zn.any=function(){};zn.boolean=function(n){if(typeof n!="boolean")return"boolean"};zn.number=function(n){if(typeof n!="number")return"number"};zn.plainArray=function(n){if(!Array.isArray(n))return"array"};zn.plainObject=function(n){if(!EB(n))return"object"};zn.string=function(n){if(typeof n!="string")return"string"};zn.func=function(n){if(typeof n!="function")return"function"};function cl(e,n){if(!(n==null&&!e.hasOwnProperty("__required"))){var l=e(n);if(l)return Array.isArray(l)?l:[l]}}function Ix(e,n){var l=e.length,h=e[l-1],m=e.slice(0,l-1);return m.length===0&&(m=[bI]),n=TB(n,{path:m}),typeof h=="function"?h(n):TI(n,AB(h))}function SB(e){return e.length<2?e[0]:e.length===2?e.join(" or "):e.slice(0,-1).join(", ")+", or "+e.slice(-1)}function AB(e){return"must be "+CB(e)+"."}function CB(e){return/^an? /.test(e)?e:/^[aeiou]/i.test(e)?"an "+e:/^[a-z]/i.test(e)?"a "+e:e}function TI(e,n){var l=SI(e.path),h=e.path.join(".")+" "+n,m=l?"Item at position ":"";return m+h}function SI(e){return typeof e[e.length-1]=="number"||typeof e[0]=="number"}function IB(e){return Object.keys(e||{}).map(function(n){return{key:n,value:e[n]}})}zn.validate=cl;zn.processMessage=Ix;var kB=zn,MB=yh,Ju=kB;function PB(e){if(typeof window<"u")return e instanceof Go.Blob||e instanceof Go.ArrayBuffer?void 0:"Blob or ArrayBuffer";if(!(typeof e=="string"||e.pipe!==void 0))return"Filename or Readable stream"}function zB(e,n){return Ju.assert(Ju.strictShape(e),n)}function LB(e){var n="date";if(typeof e=="boolean")return n;try{var l=new Date(e);if(l.getTime&&isNaN(l.getTime()))return n}catch{return n}}function RB(e){return Ju.tuple(Ju.number,Ju.number)(e)}var DB=MB(Ju,{file:PB,date:LB,coordinates:RB,assertShape:zB});function OB(e,n){var l=function(h,m){return n.indexOf(h)!==-1&&m!==void 0};return typeof n=="function"&&(l=n),Object.keys(e).filter(function(h){return l(h,e[h])}).reduce(function(h,m){return h[m]=e[m],h},{})}var BB=OB;function FB(e,n){return Object.keys(e).reduce(function(l,h){return l[h]=n(h,e[h]),l},{})}var NB=FB,UB=NB;function jB(e){return UB(e,function(n,l){return typeof l=="boolean"?JSON.stringify(l):l})}var VB=jB,$B=yI,GB=wI;function qB(e){return function(n){var l;$B.prototype.isPrototypeOf(n)?l=n:l=GB(n);var h=Object.create(e);return h.client=l,h}}var WB=qB,AI=yh,tn=DB,r_=BB,CI=VB,ZB=WB,kx={},II=["country","region","postcode","district","place","locality","neighborhood","address","poi","poi.landmark"];kx.forwardGeocode=function(e){tn.assertShape({query:tn.required(tn.string),mode:tn.oneOf("mapbox.places","mapbox.places-permanent"),countries:tn.arrayOf(tn.string),proximity:tn.oneOf(tn.coordinates,"ip"),types:tn.arrayOf(tn.oneOf(II)),autocomplete:tn.boolean,bbox:tn.arrayOf(tn.number),limit:tn.number,language:tn.arrayOf(tn.string),routing:tn.boolean,fuzzyMatch:tn.boolean,worldview:tn.string})(e),e.mode=e.mode||"mapbox.places";var n=CI(AI({country:e.countries},r_(e,["proximity","types","autocomplete","bbox","limit","language","routing","fuzzyMatch","worldview"])));return this.client.createRequest({method:"GET",path:"/geocoding/v5/:mode/:query.json",params:r_(e,["mode","query"]),query:n})};kx.reverseGeocode=function(e){tn.assertShape({query:tn.required(tn.coordinates),mode:tn.oneOf("mapbox.places","mapbox.places-permanent"),countries:tn.arrayOf(tn.string),types:tn.arrayOf(tn.oneOf(II)),bbox:tn.arrayOf(tn.number),limit:tn.number,language:tn.arrayOf(tn.string),reverseMode:tn.oneOf("distance","score"),routing:tn.boolean,worldview:tn.string})(e),e.mode=e.mode||"mapbox.places";var n=CI(AI({country:e.countries},r_(e,["country","types","bbox","limit","language","reverseMode","routing","worldview"])));return this.client.createRequest({method:"GET",path:"/geocoding/v5/:mode/:query.json",params:r_(e,["mode","query"]),query:n})};var HB=ZB(kx),XB=self.crypto||self.msCrypto,Mx="-_",ol=36;for(;ol--;)Mx+=ol.toString(36);ol=36;for(;ol---10;)Mx+=ol.toString(36).toUpperCase();var KB=function(e){var n="",l=XB.getRandomValues(new Uint8Array(e||21));for(ol=e||21;ol--;)n+=Mx[l[ol]&63];return n},YB=KB;function kI(e){this.origin=e.origin||"https://api.mapbox.com",this.endpoint="events/v2",this.access_token=e.accessToken,this.version="0.2.0",this.sessionID=this.generateSessionID(),this.userAgent=this.getUserAgent(),this.options=e,this.send=this.send.bind(this),this.countries=e.countries?e.countries.split(","):null,this.types=e.types?e.types.split(","):null,this.bbox=e.bbox?e.bbox:null,this.language=e.language?e.language.split(","):null,this.limit=e.limit?+e.limit:null,this.locale=navigator.language||null,this.enableEventLogging=this.shouldEnableLogging(e),this.eventQueue=new Array,this.flushInterval=e.flushInterval||1e3,this.maxQueueSize=e.maxQueueSize||100,this.timer=this.flushInterval?setTimeout(this.flush.bind(this),this.flushInterval):null,this.lastSentInput="",this.lastSentIndex=0}kI.prototype={select:function(e,n){var l=this.getSelectedIndex(e,n),h=this.getEventPayload("search.select",n);if(h.resultIndex=l,h.resultPlaceName=e.place_name,h.resultId=e.id,!(l===this.lastSentIndex&&h.queryString===this.lastSentInput||l==-1)&&(this.lastSentIndex=l,this.lastSentInput=h.queryString,!!h.queryString))return this.push(h)},start:function(e){var n=this.getEventPayload("search.start",e);if(n.queryString)return this.push(n)},keyevent:function(e,n){if(e.key&&!(e.metaKey||[9,27,37,39,13,38,40].indexOf(e.keyCode)!==-1)){var l=this.getEventPayload("search.keystroke",n);if(l.lastAction=e.key,!!l.queryString)return this.push(l)}},send:function(e,n){if(!this.enableEventLogging)return n?n():void 0;var l=this.getRequestOptions(e);this.request(l,(function(h){if(h)return this.handleError(h,n);if(n)return n()}).bind(this))},getRequestOptions:function(e){Array.isArray(e)||(e=[e]);var n={method:"POST",host:this.origin,path:this.endpoint+"?access_token="+this.access_token,headers:{"Content-Type":"application/json"},body:JSON.stringify(e)};return n},getEventPayload:function(e,n){var l;n.options.proximity?l=[n.options.proximity.longitude,n.options.proximity.latitude]:l=null;var h=n._map?n._map.getZoom():void 0,m={event:e,created:+new Date,sessionIdentifier:this.sessionID,country:this.countries,userAgent:this.userAgent,language:this.language,bbox:this.bbox,types:this.types,endpoint:"mapbox.places",autocomplete:n.options.autocomplete,fuzzyMatch:n.options.fuzzyMatch,proximity:l,limit:n.options.limit,routing:n.options.routing,worldview:n.options.worldview,mapZoom:h,keyboardLocale:this.locale};return e==="search.select"?m.queryString=n.inputString:e!="search.select"&&n._inputEl?m.queryString=n._inputEl.value:m.queryString=n.inputString,m},request:function(e,n){var l=new XMLHttpRequest;l.onreadystatechange=function(){if(this.readyState==4)return this.status==204?n(null):n(this.statusText)},l.open(e.method,e.host+"/"+e.path,!0);for(var h in e.headers){var m=e.headers[h];l.setRequestHeader(h,m)}l.send(e.body)},handleError:function(e,n){if(n)return n(e)},generateSessionID:function(){return YB()},getUserAgent:function(){return"mapbox-gl-geocoder."+this.version+"."+navigator.userAgent},getSelectedIndex:function(e,n){if(n._typeahead){var l=n._typeahead.data,h=e.id,m=l.map(function(E){return E.id}),v=m.indexOf(h);return v}},shouldEnableLogging:function(e){return!(e.enableEventLogging===!1||e.origin&&e.origin.indexOf("api.mapbox.com")==-1||e.localGeocoder||e.filter)},flush:function(){this.eventQueue.length>0&&(this.send(this.eventQueue),this.eventQueue=new Array),this.timer&&clearTimeout(this.timer),this.flushInterval&&(this.timer=setTimeout(this.flush.bind(this),this.flushInterval))},push:function(e,n){this.eventQueue.push(e),(this.eventQueue.length>=this.maxQueueSize||n)&&this.flush()},remove:function(){this.flush()}};var JB=kI,QB={de:"Suche",it:"Ricerca",en:"Search",nl:"Zoeken",fr:"Chercher",ca:"Cerca",he:"לחפש",ja:"サーチ",lv:"Meklēt",pt:"Procurar",sr:"Претрага",zh:"搜索",cs:"Vyhledávání",hu:"Keresés",ka:"ძიება",nb:"Søke",sk:"Vyhľadávanie",th:"ค้นหา",fi:"Hae",is:"Leita",ko:"수색",pl:"Szukaj",sl:"Iskanje",fa:"جستجو",ru:"Поиск"},eF={placeholder:QB},MI={exports:{}};(function(e){(function(n,l,h){e.exports?e.exports=h():n[l]=h()})(Go,"subtag",function(){var n="",l=/^([a-zA-Z]{2,3})(?:[_-]+([a-zA-Z]{3})(?=$|[_-]+))?(?:[_-]+([a-zA-Z]{4})(?=$|[_-]+))?(?:[_-]+([a-zA-Z]{2}|[0-9]{3})(?=$|[_-]+))?/;function h(k){return k.match(l)||[]}function m(k){return h(k).filter(function(D,V){return D&&V})}function v(k){return k=h(k),{language:k[1]||n,extlang:k[2]||n,script:k[3]||n,region:k[4]||n}}function E(k,D,V){Object.defineProperty(k,D,{value:V,enumerable:!0})}function s(k,D,V){function G(J){return h(J)[k]||n}E(G,"pattern",D),E(v,V,G)}return s(1,/^[a-zA-Z]{2,3}$/,"language"),s(2,/^[a-zA-Z]{3}$/,"extlang"),s(3,/^[a-zA-Z]{4}$/,"script"),s(4,/^[a-zA-Z]{2}$|^[0-9]{3}$/,"region"),E(v,"split",m),v})})(MI);var tF=MI.exports,nF=h4,rF=k4,lc=yh,iF=O4.EventEmitter,PT=B4,zT=xB,LT=HB,oF=JB,sF=eF,aF=tF;const $a={FORWARD:0,LOCAL:1,REVERSE:2};function PI(e){this._eventEmitter=new iF,this.options=lc({},this.options,e),this.inputString="",this.fresh=!0,this.lastSelected=null}PI.prototype={options:{zoom:16,flyTo:!0,trackProximity:!0,minLength:2,reverseGeocode:!1,limit:5,origin:"https://api.mapbox.com",enableEventLogging:!0,marker:!0,mapboxgl:null,collapsed:!1,clearAndBlurOnEsc:!1,clearOnBlur:!1,getItemValue:function(e){return e.place_name},render:function(e){var n=e.place_name.split(",");return'
'+n[0]+'
'+n.splice(1,n.length).join(",")+"
"}},addTo:function(e){function n(l,h){if(!document.body.contains(h))throw new Error("Element provided to #addTo() exists, but is not in the DOM");const m=l.onAdd();h.appendChild(m)}if(e._controlContainer)e.addControl(this);else if(e instanceof HTMLElement)n(this,e);else if(typeof e=="string"){const l=document.querySelectorAll(e);if(l.length===0)throw new Error("Element ",e,"not found.");if(l.length>1)throw new Error("Geocoder can only be added to a single html element");n(this,l[0])}else throw new Error("Error: addTo must be a mapbox-gl-js map, an html element, or a CSS selector query for a single html element")},onAdd:function(e){if(e&&typeof e!="string"&&(this._map=e),this.setLanguage(),this.options.localGeocoderOnly||(this.geocoderService=LT(zT({accessToken:this.options.accessToken,origin:this.options.origin}))),this.options.localGeocoderOnly&&!this.options.localGeocoder)throw new Error("A localGeocoder function must be specified to use localGeocoderOnly mode");this.eventManager=new oF(this.options),this._onChange=this._onChange.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onPaste=this._onPaste.bind(this),this._onBlur=this._onBlur.bind(this),this._showButton=this._showButton.bind(this),this._hideButton=this._hideButton.bind(this),this._onQueryResult=this._onQueryResult.bind(this),this.clear=this.clear.bind(this),this._updateProximity=this._updateProximity.bind(this),this._collapse=this._collapse.bind(this),this._unCollapse=this._unCollapse.bind(this),this._clear=this._clear.bind(this),this._clearOnBlur=this._clearOnBlur.bind(this);var n=this.container=document.createElement("div");n.className="mapboxgl-ctrl-geocoder mapboxgl-ctrl";var l=this.createIcon("search",'');this._inputEl=document.createElement("input"),this._inputEl.type="text",this._inputEl.className="mapboxgl-ctrl-geocoder--input",this.setPlaceholder(),this.options.collapsed&&(this._collapse(),this.container.addEventListener("mouseenter",this._unCollapse),this.container.addEventListener("mouseleave",this._collapse),this._inputEl.addEventListener("focus",this._unCollapse)),(this.options.collapsed||this.options.clearOnBlur)&&this._inputEl.addEventListener("blur",this._onBlur),this._inputEl.addEventListener("keydown",rF(this._onKeyDown,200)),this._inputEl.addEventListener("paste",this._onPaste),this._inputEl.addEventListener("change",this._onChange),this.container.addEventListener("mouseenter",this._showButton),this.container.addEventListener("mouseleave",this._hideButton),this._inputEl.addEventListener("keyup",(function(v){this.eventManager.keyevent(v,this)}).bind(this));var h=document.createElement("div");h.classList.add("mapboxgl-ctrl-geocoder--pin-right"),this._clearEl=document.createElement("button"),this._clearEl.setAttribute("aria-label","Clear"),this._clearEl.addEventListener("click",this.clear),this._clearEl.className="mapboxgl-ctrl-geocoder--button";var m=this.createIcon("close",'');return this._clearEl.appendChild(m),this._loadingEl=this.createIcon("loading",''),h.appendChild(this._clearEl),h.appendChild(this._loadingEl),n.appendChild(l),n.appendChild(this._inputEl),n.appendChild(h),this._typeahead=new nF(this._inputEl,[],{filter:!1,minLength:this.options.minLength,limit:this.options.limit}),this.setRenderFunction(this.options.render),this._typeahead.getItemValue=this.options.getItemValue,this.mapMarker=null,this._handleMarker=this._handleMarker.bind(this),this._map&&(this.options.trackProximity&&(this._updateProximity(),this._map.on("moveend",this._updateProximity)),this._mapboxgl=this.options.mapboxgl,!this._mapboxgl&&this.options.marker&&(console.error("No mapboxgl detected in options. Map markers are disabled. Please set options.mapboxgl."),this.options.marker=!1)),n},createIcon:function(e,n){var l=document.createElementNS("http://www.w3.org/2000/svg","svg");if(l.setAttribute("class","mapboxgl-ctrl-geocoder--icon mapboxgl-ctrl-geocoder--icon-"+e),l.setAttribute("viewBox","0 0 18 18"),l.setAttribute("xml:space","preserve"),l.setAttribute("width",18),l.setAttribute("height",18),"innerHTML"in l)l.innerHTML=n;else{var h=document.createElement("div");h.innerHTML=""+n.valueOf().toString()+"";var m=h.firstChild,v=m.firstChild;l.appendChild(v)}return l},onRemove:function(){return this.container.parentNode.removeChild(this.container),this.options.trackProximity&&this._map&&this._map.off("moveend",this._updateProximity),this._removeMarker(),this._map=null,this},_onPaste:function(e){var n=(e.clipboardData||window.clipboardData).getData("text");n.length>=this.options.minLength&&this._geocode(n)},_onKeyDown:function(e){var n=27,l=9;if(e.keyCode===n&&this.options.clearAndBlurOnEsc)return this._clear(e),this._inputEl.blur();var h=e.target&&e.target.shadowRoot?e.target.shadowRoot.activeElement:e.target,m=h?h.value:"";if(!m)return this.fresh=!0,e.keyCode!==l&&this.clear(e),this._clearEl.style.display="none";e.metaKey||[l,n,37,39,13,38,40].indexOf(e.keyCode)!==-1||h.value.length>=this.options.minLength&&this._geocode(h.value)},_showButton:function(){this._typeahead.selected&&(this._clearEl.style.display="block")},_hideButton:function(){this._typeahead.selected&&(this._clearEl.style.display="none")},_onBlur:function(e){this.options.clearOnBlur&&this._clearOnBlur(e),this.options.collapsed&&this._collapse()},_onChange:function(){var e=this._typeahead.selected;if(e&&JSON.stringify(e)!==this.lastSelected){if(this._clearEl.style.display="none",this.options.flyTo){var n;if(e.properties&&PT[e.properties.short_code])n=lc({},this.options.flyTo),this._map&&this._map.fitBounds(PT[e.properties.short_code].bbox,n);else if(e.bbox){var l=e.bbox;n=lc({},this.options.flyTo),this._map&&this._map.fitBounds([[l[0],l[1]],[l[2],l[3]]],n)}else{var h={zoom:this.options.zoom};n=lc({},h,this.options.flyTo),e.center?n.center=e.center:e.geometry&&e.geometry.type&&e.geometry.type==="Point"&&e.geometry.coordinates&&(n.center=e.geometry.coordinates),this._map&&this._map.flyTo(n)}}this.options.marker&&this._mapboxgl&&this._handleMarker(e),this._inputEl.focus(),this._inputEl.scrollLeft=0,this._inputEl.setSelectionRange(0,0),this.lastSelected=JSON.stringify(e),this._eventEmitter.emit("result",{result:e}),this.eventManager.select(e,this)}},_requestType:function(e,n){var l;const h=/^[ ]*(-?\d+\.?\d*)[, ]+(-?\d+\.?\d*)[ ]*$/;return e.localGeocoderOnly?l=$a.LOCAL:e.reverseGeocode&&h.test(n)?l=$a.REVERSE:l=$a.FORWARD,l},_setupConfig:function(e,n){const l=["bbox","limit","proximity","countries","types","language","reverseMode","mode","autocomplete","fuzzyMatch","routing","worldview"],h=/[\s,]+/;var m=this,v=l.reduce(function(s,k){if(m.options[k]===void 0||m.options[k]===null)return s;["countries","types","language"].indexOf(k)>-1?s[k]=m.options[k].split(h):s[k]=m.options[k];const D=typeof m.options[k].longitude=="number"&&typeof m.options[k].latitude=="number";if(k==="proximity"&&D){const V=m.options[k].longitude,G=m.options[k].latitude;s[k]=[V,G]}return s},{});switch(e){case $a.REVERSE:{var E=n.split(h).map(function(s){return parseFloat(s,10)}).reverse();v.types&&v.types[0],v=lc(v,{query:E,limit:1}),["proximity","autocomplete","fuzzyMatch","bbox"].forEach(function(s){s in v&&delete v[s]})}break;case $a.FORWARD:/^[ ]*(-?\d+\.?\d*)[, ]+(-?\d+\.?\d*)*[ ]*$/.test(n)&&(n=n.replace(/,/g," ")),v=lc(v,{query:n});break}return v},_geocode:function(e){this.inputString=e,this._loadingEl.style.display="block",this._eventEmitter.emit("loading",{query:e});const n=this._requestType(this.options,e),l=this._setupConfig(n,e);var h;switch(n){case $a.LOCAL:h=Promise.resolve();break;case $a.FORWARD:h=this.geocoderService.forwardGeocode(l).send();break;case $a.REVERSE:h=this.geocoderService.reverseGeocode(l).send();break}var m=this.options.localGeocoder?this.options.localGeocoder(e)||[]:[],v=[],E=null;return h.catch((function(s){E=s}).bind(this)).then((function(s){this._loadingEl.style.display="none";var k={};return s?s.statusCode=="200"&&(k=s.body,k.request=s.request,k.headers=s.headers):k={type:"FeatureCollection",features:[]},k.config=l,this.fresh&&(this.eventManager.start(this),this.fresh=!1),k.features=k.features?m.concat(k.features):m,this.options.externalGeocoder?(v=this.options.externalGeocoder(e,k.features)||[],v.then(function(D){return k.features=k.features?D.concat(k.features):D,k},function(){return k})):k}).bind(this)).then((function(s){if(E)throw E;this.options.filter&&s.features.length&&(s.features=s.features.filter(this.options.filter)),s.features.length?(this._clearEl.style.display="block",this._eventEmitter.emit("results",s),this._typeahead.update(s.features)):(this._clearEl.style.display="none",this._typeahead.selected=null,this._renderNoResults(),this._eventEmitter.emit("results",s))}).bind(this)).catch((function(s){this._loadingEl.style.display="none",m.length&&this.options.localGeocoder||v.length&&this.options.externalGeocoder?(this._clearEl.style.display="block",this._typeahead.update(m)):(this._clearEl.style.display="none",this._typeahead.selected=null,this._renderError()),this._eventEmitter.emit("results",{features:m}),this._eventEmitter.emit("error",{error:s})}).bind(this)),h},_clear:function(e){e&&e.preventDefault(),this._inputEl.value="",this._typeahead.selected=null,this._typeahead.clear(),this._onChange(),this._clearEl.style.display="none",this._removeMarker(),this.lastSelected=null,this._eventEmitter.emit("clear"),this.fresh=!0},clear:function(e){this._clear(e),this._inputEl.focus()},_clearOnBlur:function(e){var n=this;e.relatedTarget&&n._clear(e)},_onQueryResult:function(e){var n=e.body;if(n.features.length){var l=n.features[0];this._typeahead.selected=l,this._inputEl.value=l.place_name,this._onChange()}},_updateProximity:function(){if(this._map)if(this._map.getZoom()>9){var e=this._map.getCenter().wrap();this.setProximity({longitude:e.lng,latitude:e.lat})}else this.setProximity(null)},_collapse:function(){!this._inputEl.value&&this._inputEl!==document.activeElement&&this.container.classList.add("mapboxgl-ctrl-geocoder--collapsed")},_unCollapse:function(){this.container.classList.remove("mapboxgl-ctrl-geocoder--collapsed")},query:function(e){return this._geocode(e).then(this._onQueryResult),this},_renderError:function(){var e="
There was an error reaching the server
";this._renderMessage(e)},_renderNoResults:function(){var e="
No results found
";this._renderMessage(e)},_renderMessage:function(e){this._typeahead.update([]),this._typeahead.selected=null,this._typeahead.clear(),this._typeahead.renderError(e)},_getPlaceholderText:function(){if(this.options.placeholder)return this.options.placeholder;if(this.options.language){var e=this.options.language.split(",")[0],n=aF.language(e),l=sF.placeholder[n];if(l)return l}return"Search"},setInput:function(e){return this._inputEl.value=e,this._typeahead.selected=null,this._typeahead.clear(),e.length>=this.options.minLength&&this._geocode(e),this},setProximity:function(e){return this.options.proximity=e,this},getProximity:function(){return this.options.proximity},setRenderFunction:function(e){return e&&typeof e=="function"&&(this._typeahead.render=e),this},getRenderFunction:function(){return this._typeahead.render},setLanguage:function(e){var n=navigator.language||navigator.userLanguage||navigator.browserLanguage;return this.options.language=e||this.options.language||n,this},getLanguage:function(){return this.options.language},getZoom:function(){return this.options.zoom},setZoom:function(e){return this.options.zoom=e,this},getFlyTo:function(){return this.options.flyTo},setFlyTo:function(e){return this.options.flyTo=e,this},getPlaceholder:function(){return this.options.placeholder},setPlaceholder:function(e){return this.placeholder=e||this._getPlaceholderText(),this._inputEl.placeholder=this.placeholder,this._inputEl.setAttribute("aria-label",this.placeholder),this},getBbox:function(){return this.options.bbox},setBbox:function(e){return this.options.bbox=e,this},getCountries:function(){return this.options.countries},setCountries:function(e){return this.options.countries=e,this},getTypes:function(){return this.options.types},setTypes:function(e){return this.options.types=e,this},getMinLength:function(){return this.options.minLength},setMinLength:function(e){return this.options.minLength=e,this._typeahead&&(this._typeahead.options.minLength=e),this},getLimit:function(){return this.options.limit},setLimit:function(e){return this.options.limit=e,this._typeahead&&(this._typeahead.options.limit=e),this},getFilter:function(){return this.options.filter},setFilter:function(e){return this.options.filter=e,this},setOrigin:function(e){return this.options.origin=e,this.geocoderService=LT(zT({accessToken:this.options.accessToken,origin:this.options.origin})),this},getOrigin:function(){return this.options.origin},setAutocomplete:function(e){return this.options.autocomplete=e,this},getAutocomplete:function(){return this.options.autocomplete},setFuzzyMatch:function(e){return this.options.fuzzyMatch=e,this},getFuzzyMatch:function(){return this.options.fuzzyMatch},setRouting:function(e){return this.options.routing=e,this},getRouting:function(){return this.options.routing},setWorldview:function(e){return this.options.worldview=e,this},getWorldview:function(){return this.options.worldview},_handleMarker:function(e){if(this._map){this._removeMarker();var n={color:"#4668F2"},l=lc({},n,this.options.marker);return this.mapMarker=new this._mapboxgl.Marker(l),e.center?this.mapMarker.setLngLat(e.center).addTo(this._map):e.geometry&&e.geometry.type&&e.geometry.type==="Point"&&e.geometry.coordinates&&this.mapMarker.setLngLat(e.geometry.coordinates).addTo(this._map),this}},_removeMarker:function(){this.mapMarker&&(this.mapMarker.remove(),this.mapMarker=null)},on:function(e,n){return this._eventEmitter.on(e,n),this},off:function(e,n){return this._eventEmitter.removeListener(e,n),this.eventManager.remove(),this}};var lF=PI;const cF=g1(lF);/* + * Frontend UI component library for the CORI Data API + * {@link https://github.com/ruralinnovation/cori.data.api} + * @copyright Rural Innovation Strategies, Inc. + * @license ISC + */function uF(e){const[n,l]=ut.useState(null),h=Object.assign({},e),m=_h(()=>{const v=new cF(Object.assign(Object.assign({},h),{marker:n||!1,accessToken:h.mapboxAccessToken}));return h.onLoading&&v.on("loading",h.onLoading),h.onResults&&v.on("results",h.onResults),h.onResult&&v.on("result",E=>{var s;h.onResult!==void 0&&h.onResult(E);const{result:k}=E,D=k&&(k.center||((s=k.geometry)===null||s===void 0?void 0:s.type)==="Point"&&k.geometry.coordinates);if(D&&h.marker){const V=typeof h.marker=="object"?h.marker:{};l(ut.createElement(eI,Object.assign({},V,{longitude:D[0],latitude:D[1]})))}else l(null)}),h.onError&&v.on("error",h.onError),v},{position:h.position});return m.hasOwnProperty("_map")&&m._map&&(m.getProximity()!==h.proximity&&h.proximity!==void 0&&m.setProximity(h.proximity),m.getRenderFunction()!==h.render&&h.render!==void 0&&m.setRenderFunction(h.render),m.getLanguage()!==h.language&&h.language!==void 0&&m.setLanguage(h.language),m.getZoom()!==h.zoom&&h.zoom!==void 0&&m.setZoom(h.zoom),m.getFlyTo()!==h.flyTo&&h.flyTo!==void 0&&m.setFlyTo(h.flyTo),m.getPlaceholder()!==h.placeholder&&h.placeholder!==void 0&&m.setPlaceholder(h.placeholder),m.getCountries()!==h.countries&&h.countries!==void 0&&m.setCountries(h.countries),m.getTypes()!==h.types&&h.types!==void 0&&m.setTypes(h.types),m.getMinLength()!==h.minLength&&h.minLength!==void 0&&m.setMinLength(h.minLength),m.getLimit()!==h.limit&&h.limit!==void 0&&m.setLimit(h.limit),m.getFilter()!==h.filter&&h.filter!==void 0&&m.setFilter(h.filter),m.getOrigin()!==h.origin&&h.origin!==void 0&&m.setOrigin(h.origin),m.getAutocomplete()!==h.autocomplete&&h.autocomplete!==void 0&&m.setAutocomplete(h.autocomplete),m.getFuzzyMatch()!==h.fuzzyMatch&&h.fuzzyMatch!==void 0&&m.setFuzzyMatch(h.fuzzyMatch),m.getRouting()!==h.routing&&h.routing!==void 0&&m.setRouting(h.routing),m.getWorldview()!==h.worldview&&h.worldview!==void 0&&m.setWorldview(h.worldview)),n}/* + * Frontend UI component library for the CORI Data API + * {@link https://github.com/ruralinnovation/cori.data.api} + * @copyright Rural Innovation Strategies, Inc. + * @license ISC + */var hF=8,dF="LIVE - CORI light basemap - county labels",pF={"mapbox:type":"default","mapbox:origin":"light-v10","mapbox:autocomposite":!0,"mapbox:groups":{"1444855769305.6016":{name:"Tunnels",collapsed:!0},"1444855786460.0557":{name:"Roads",collapsed:!0},"1444855799204.86":{name:"Bridges",collapsed:!0},"1444934295202.7542":{name:"Admin boundaries",collapsed:!1}},"mapbox:sdk-support":{js:"0.54.0",android:"7.4.0",ios:"4.10.0"},"mapbox:uiParadigm":"layers","mapbox:thumb":"data:image/webp;base64,UklGRmAJAABXRUJQVlA4TFQJAAAvO8AOAPX4drZtmWTXts7/wMzUqCCLGZOCMjCzbfx/1jFYYr9m+zeF5Gqx8bj3bozqqoouhWLj6dCYQqn+K1W6Vb1HB+Nn+HqXMatDQowkSVJTM/xwkv+mwu1OF8S2kRxJ7PyjfbMzs6a7+j8Be9jFwDSO7Za6ajtXwy/CHsEeYqSRsWzFQAbkSKlndkzfLGcN0zHLlJYZyNmbaOFmTdM0apq3d+t5Y906dr68rJ16zskdY1kaCWdraPJQE8CKlJazrjk+nrVM2/y0Q8ZpQtFux7BmD3bG8fxnncEJvUfnnPObbeMBsKIKWwJLA5PS8njL3DLP4CPmpnkG4+PxuFaBT22n9wiwUuTNx93WpXE+s4bmwJJyWCFwVAX3SJuMZ8fb5ic/uYKb5qc/HY+XqSvlgEmPIYI91BF5/X6fOW3Hpn0x7BGCGMgOIUVMAPdLSmn8xk/+ddM0zT/NUlqmDDhHT0NSj4pzfDEiNh53M7rOC/ElKUxkESgctcF75jilNBuP35gtU2kUjLo1fQicFbF5v7lCb488VM7WALsaKYd2zVFMDJBTSmn50/F4uY8oH9g2dlja+Pv3HebWDpZz2CAZV8BymTpIaTYb/3SZ9qXU6tvEuVU4hpI2Xye6NVcGNl5gQmAtIFJK47Qcj4/vYUcXT2V/e+hiR0dKjfeJAXNqGGNjZyGHYGhSSrPZcjkbH+83Acwe6dm7BBtfXc6umi7y9rHj4OwwIMkKSw5gmVJqm/FsNhvPlmlc+PcAb+MGLpNvvzvdHEb//8OovHFcQ+Yq/v9FAAPYcsiPFeA6pdTGbLkcz8YpXVyWKaW1nwkYRs7diBfOOr8KN/XMr5rQ0a5ZP9bB2pgIyCgcIBlYpJT6JqXl+HicUjv5Y0rp+jbBBm1ktlJfyo4HjVCu55uvNWTWNgGEcRjHAhvXJeOfjmep/JFd4HvbAxzyF3Odt55noJNjJLBCyEgTLJk6peO0PB7PlmVLsAG10hVYoHr+7tb9Xnc+Gq9LkmUp5EAAOaWOWc5mhcmkYAH+9Y69oGxQ5rm+/blu2ZcnO8ieP+xiF/UnHn5CsSdvpGRwWo4fz5bj8QTIKdUqxA4DhjDSXN3bt/Ha18gPbdnClr2jx9/+C/GJd2vFG1e2C6uWywDw0KQAUNdOEHYNtdW/9Ppr//pCNFKyMNiw+I5lm+I8GpNlnQuACwNyDES2sNDdYzNgTqQqy4CycbYlyn/fGMJR56jXN5Bxl/k8lnLsCjmL/zgc0lfHoSnKIiaEXOZssAXrI0t7EE3HQLYenf4V9p3x7Le+duJxX2Uu4IN6w2A8AvZRYLMfBfv7gOs6f/4Qh9THjV3bkxx+9L5vzc/c983rz+06z4+BKDFWCKySTMgGEOW5ydRzy6pCJj76rcn68b9LrtNns3fqsW0A+cjYLlkRkjH3+nFcfyKbqtCX7v4vzs98Z5ulUMGaHrGvbYdldC/acUDMI+ogY9183D4xWa0atXp1Br1lYw5HKnGOiHB2CO/nHtr6vCTlx0cmz3Gsv3eHObHhVctqJNe877Ab7FbtEc2e1A6XKBS5tkS5X360Y9aVjhVZn9gJGwSNx7N9/c6ZCgLgO3R6exWZUku4tlww9q0U0NLnbVRPI7tw57hOOqLMqjr1TIaJXRYSZIVsii+vgOg4skLzlWTD3c//qfA+yp242/sFnDDP4So+huswWBjmlsucf4/xnfEEj8BG783+2+m1R/Cwpne5evS5sQcLGVuteLpeZ7t/G9xbff0Z2zLAfWyKHbTUtLDN0QHWoN5OvctX2717l9Pva6cXffKx4bCViTpG+tVNnNTa5To8WwdB2UMAAw2Zon5/ALs1zbroWo0Y4X6velAf1fMDOyYxtTE8CTd9B3XbZaOa7TodvmY9vT4jvkIrjFmfqvz74xFhs1bO88CeoLNJpRweGiaO6s0RMyD5SJu+O73drb1VV6tOo9aXe3UGdR4CQ54G9w7T69Pt06SzDDx8Hqf1kXqv+rVsSi2rSZ6bubRsjXZYAOrTBwatmpl3mvaI2tXLv/+bbsw9QFv16qXf50bdXd7OZbV7/XOnV6/3p9ml79Y1ZDzSwgXLPLmji9aluLFNAQ9oAxZdfaknii934lsv8XK2bcAjuF9Pr6/O5W/1a0BhTB523M/AWetlA3tmaFOmXUO5w1i2AQLY0+L3n6c4MEOlxchsfJZ6hhtxcSoAnriA7AlgABsJMGZOcfFHk+sMho1j6TdNfOzUi6rwNkXLqsFl2GDLMjmA36dexbYL3nzu+M2J8ZIFfPpBwZZCtilmwEVh+P79qDeifhpzKNl4Pvdv2mupHWSAAUPx+47wnrFx4b4NBocBs4uqJf0XpTady3fw3Mhy/nZW2/5EGHBYVRgb3IEpWqZ0BlsZA7aFW5fuMyencAAHhvuQ8ye+/fD/fvUw4/vvtso8oiDLYLhPX08oOgYl4u6xhubkBMIc/hqo+UQYYmWxr3MIq5CJN2mq5wDKOdew+XfldefSRoX6NZKV69dHAMXLeD/AddTuqU85SNTfH1s4fAR07k8ekrXJlWXqeDtMNhXYR0F5VQKOHGHxcnyJ79kMC/ousDIHp7Zm2CMaCsbK1psuubIKWlaZrZyzye1oO4cmYwCZty45t7eYTIB/AiMHWlV+U9yrjE3k/E/yv9chv6lqOrXQ2oyrr1lzZ8DyAuNQR28WDBhTqMAR7/7MEACWb5ubKeJ7VUxdW8haAAK7otSADZji39Rd2pUKxPyjO8HTp+AHDmFccMG5BLBsF7xYrOIWzjJtvVtw/sKHF/sLgL9vCYxs4YKHZh8Zm1U1nZqa/PTXBuwdMiLP7OLgrULXSAaBsYRs38GW/rtgyWyMlV9EMSMdAKtGqu7Td3BzPBgxAOrjqKZ0wj16DETYvrZc31VRqj24OoBzp4u7vpT7zvk4OqBEuT4seAG4DFeWbLQ+9ZJclv13AxI8+yvIA/qFKR+AwSIfCVAFYJdAoG99F0uAASJ+7Xi5EzjuZk6s0hOYTLCZqwIsl4NhOjk0QLgQkevcYqaLo5VxjzyzJ/ltOJTB8wgDqICNVX3/cUwBt5OcFdkG/4OAbDbok6v49AOAgnrQJKaTmMi5qmKxcLBaev4vkeePDFjAp+cUg2cm51YN1WMoN56HKE4rgx0vnz19+Fc/ub79ZLILKw5pa4UxHOSSqQE="},fF=[-72.26808525539167,43.37747275058169],mF=10.873762090608595,gF=0,_F=2,yF={composite:{url:"mapbox://mapbox.mapbox-terrain-v2,mapbox.mapbox-streets-v8,ruralinno.2pv0vm2z,ruralinno.3v9y79ly,ruralinno.5639ssfg,ruralinno.c504wkuy,ruralinno.7stpbs93,ruralinno.cwz2k5qc,ruralinno.1joudpqe",type:"vector"}},vF="mapbox://sprites/ruralinno/cl010e7b7001p15pe3l0306hv/68n9slz9mfbus83an19oqbf32",xF="mapbox://fonts/ruralinno/{fontstack}/{range}.pbf",wF=[{id:"land",type:"background",layout:{},paint:{"background-color":"hsl(55, 0%, 100%)"}},{id:"landcover",type:"fill",source:"composite","source-layer":"landcover",maxzoom:7,layout:{},paint:{"fill-color":"hsl(0, 0%, 100%)","fill-opacity":["interpolate",["exponential",1.5],["zoom"],2,.1,7,0],"fill-antialias":!1}},{id:"national-park",type:"fill",source:"composite","source-layer":"landuse_overlay",minzoom:5,filter:["==",["get","class"],"national_park"],layout:{},paint:{"fill-color":"hsla(150, 6%, 93%, 0.63)","fill-opacity":["interpolate",["linear"],["zoom"],5,0,6,.5]}},{id:"landuse",type:"fill",source:"composite","source-layer":"landuse",minzoom:5,filter:["match",["get","class"],["park","airport","glacier","pitch","sand"],!0,!1],layout:{},paint:{"fill-opacity":["interpolate",["linear"],["zoom"],5,0,6,["match",["get","class"],"glacier",.5,1]],"fill-color":"hsl(150, 0%, 100%)"}},{id:"water-shadow",type:"fill",source:"composite","source-layer":"water",layout:{},paint:{"fill-translate-anchor":"viewport","fill-translate":["interpolate",["exponential",1.2],["zoom"],7,["literal",[0,0]],16,["literal",[-1,-1]]],"fill-color":"hsl(185, 7%, 73%)"}},{id:"waterway",type:"line",source:"composite","source-layer":"waterway",minzoom:8,layout:{"line-cap":["step",["zoom"],"butt",11,"round"],"line-join":"round"},paint:{"line-color":"hsl(187, 9%, 81%)","line-width":["interpolate",["exponential",1.3],["zoom"],9,["match",["get","class"],["canal","river"],.1,0],20,["match",["get","class"],["canal","river"],8,3]],"line-opacity":["interpolate",["linear"],["zoom"],8,0,8.5,1]}},{id:"water",type:"fill",source:"composite","source-layer":"water",layout:{},paint:{"fill-color":"#cad2d3","fill-opacity":.5}},{id:"hillshade",type:"fill",source:"composite","source-layer":"hillshade",minzoom:6,layout:{},paint:{"fill-color":["match",["get","class"],"shadow","hsl(0, 0%, 35%)","hsl(0, 0%, 100%)"],"fill-opacity":["interpolate",["linear"],["zoom"],12,["match",["get","level"],[67,56],.02,[89,78],.01,.015],15,0]}},{id:"land-structure-polygon",type:"fill",source:"composite","source-layer":"structure",minzoom:21.1,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","class"],"land"]],layout:{},paint:{"fill-color":"hsl(156, 20%, 95%)"}},{id:"land-structure-line",type:"line",source:"composite","source-layer":"structure",minzoom:13,filter:["all",["==",["geometry-type"],"LineString"],["==",["get","class"],"land"]],layout:{"line-cap":"round"},paint:{"line-width":["interpolate",["exponential",1.99],["zoom"],14,.75,20,40],"line-color":"hsl(156, 20%, 95%)"}},{id:"aeroway-polygon",type:"fill",source:"composite","source-layer":"aeroway",minzoom:11,filter:["all",["==",["geometry-type"],"Polygon"],["match",["get","type"],["runway","taxiway","helipad"],!0,!1]],layout:{},paint:{"fill-opacity":["interpolate",["linear"],["zoom"],11,0,11.5,1],"fill-color":"hsl(0, 0%, 97%)"}},{id:"aeroway-line",type:"line",source:"composite","source-layer":"aeroway",minzoom:9,filter:["==",["geometry-type"],"LineString"],layout:{},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],9,["match",["get","type"],"runway",1,.5],18,["match",["get","type"],"runway",80,20]],"line-color":"hsl(0, 0%, 97%)"}},{id:"building-outline",type:"line",source:"composite","source-layer":"building",minzoom:15,filter:["all",["!=",["get","type"],"building:part"],["==",["get","underground"],"false"]],layout:{},paint:{"line-color":"hsl(55, 3%, 87%)","line-width":["interpolate",["exponential",1.5],["zoom"],15,.75,20,3],"line-opacity":["interpolate",["linear"],["zoom"],15,0,16,1]}},{id:"building",type:"fill",source:"composite","source-layer":"building",minzoom:15,filter:["all",["!=",["get","type"],"building:part"],["==",["get","underground"],"false"]],layout:{},paint:{"fill-outline-color":"hsl(55, 3%, 87%)","fill-opacity":["interpolate",["linear"],["zoom"],15,0,16,1],"fill-color":"hsl(55, 5%, 91%)"}},{id:"tunnel-street-minor-low",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["step",["zoom"],["match",["get","class"],["street","street_limited","track","primary_link"],!0,!1],14,["match",["get","class"],["street","street_limited","track","primary_link","secondary_link","tertiary_link","service"],!0,!1]],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,["match",["get","class"],["street","street_limited","primary_link"],2,"track",1,.5],18,["match",["get","class"],["street","street_limited","primary_link"],18,12]],"line-color":"hsl(185, 7%, 88%)","line-opacity":["step",["zoom"],1,14,0]}},{id:"tunnel-street-minor-case",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["step",["zoom"],["match",["get","class"],["street","street_limited","track","primary_link"],!0,!1],14,["match",["get","class"],["street","street_limited","track","primary_link","secondary_link","tertiary_link","service"],!0,!1]],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.75,20,2],"line-color":"hsl(185, 12%, 89%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,["match",["get","class"],["street","street_limited","primary_link"],2,"track",1,.5],18,["match",["get","class"],["street","street_limited","primary_link"],18,12]],"line-opacity":["step",["zoom"],0,14,1],"line-dasharray":[3,3]}},{id:"tunnel-primary-secondary-tertiary-case",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["match",["get","class"],["primary","secondary","tertiary"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],10,["match",["get","class"],"primary",1,.75],18,2],"line-color":"hsl(185, 12%, 89%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],5,["match",["get","class"],"primary",.75,.1],18,["match",["get","class"],"primary",32,26]],"line-dasharray":[3,3]}},{id:"tunnel-major-link-case",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["match",["get","class"],["motorway_link","trunk_link"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.75,20,2],"line-color":"hsl(185, 12%, 89%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-dasharray":[3,3]}},{id:"tunnel-motorway-trunk-case",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["match",["get","class"],["motorway","trunk"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],10,1,18,2],"line-color":"hsl(185, 12%, 89%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32],"line-dasharray":[3,3]}},{id:"tunnel-construction",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:14,filter:["all",["==",["get","structure"],"tunnel"],["==",["get","class"],"construction"],["==",["geometry-type"],"LineString"]],layout:{},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,2,18,18],"line-color":"hsl(187, 7%, 88%)","line-dasharray":["step",["zoom"],["literal",[.4,.8]],15,["literal",[.3,.6]],16,["literal",[.2,.3]],17,["literal",[.2,.25]],18,["literal",[.15,.15]]]}},{id:"tunnel-path",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["==",["get","class"],"path"],["!=",["get","type"],"steps"],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],15,1,18,4],"line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.75,1]],16,["literal",[1,.75]],17,["literal",[1,.5]]],"line-color":"hsl(0, 0%, 85%)"}},{id:"tunnel-steps",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:14,filter:["all",["==",["get","structure"],"tunnel"],["==",["get","class"],"steps"],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],15,1,16,1.6,18,6],"line-color":"hsl(0, 0%, 85%)","line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.75,1]],16,["literal",[1,.75]],17,["literal",[.3,.3]]]}},{id:"tunnel-major-link",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["match",["get","class"],["motorway_link","trunk_link"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-color":"hsl(187, 7%, 88%)"}},{id:"tunnel-pedestrian",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["==",["get","class"],"pedestrian"],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,.5,18,12],"line-color":"hsl(187, 7%, 88%)","line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.5,.4]],16,["literal",[1,.2]]]}},{id:"tunnel-street-minor",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["step",["zoom"],["match",["get","class"],["street","street_limited","track","primary_link"],!0,!1],14,["match",["get","class"],["street","street_limited","track","primary_link","secondary_link","tertiary_link","service"],!0,!1]],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,["match",["get","class"],["street","street_limited","primary_link"],2,"track",1,.5],18,["match",["get","class"],["street","street_limited","primary_link"],18,12]],"line-color":"hsl(187, 7%, 88%)","line-opacity":["step",["zoom"],0,14,1]}},{id:"tunnel-primary-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["match",["get","class"],["primary","secondary","tertiary"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],5,["match",["get","class"],"primary",.75,.1],18,["match",["get","class"],"primary",32,26]],"line-color":"hsl(187, 7%, 88%)"}},{id:"tunnel-motorway-trunk",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["match",["get","class"],["motorway","trunk"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32],"line-color":"hsl(187, 7%, 88%)"}},{id:"road-pedestrian-case",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:12,filter:["all",["==",["get","class"],"pedestrian"],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,2,18,14.5],"line-color":"hsl(156, 12%, 92%)","line-opacity":["step",["zoom"],0,14,1]}},{id:"road-minor-low",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["step",["zoom"],["==",["get","class"],"track"],14,["match",["get","class"],["track","secondary_link","tertiary_link","service"],!0,!1]],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,["match",["get","class"],"track",1,.5],18,12],"line-color":"hsl(0, 0%, 100%)","line-opacity":["step",["zoom"],1,14,0]}},{id:"road-street-low",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:11,filter:["all",["match",["get","class"],["street","street_limited","primary_link"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-color":"hsl(0, 0%, 100%)","line-opacity":["step",["zoom"],1,14,0]}},{id:"road-minor-case",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["step",["zoom"],["==",["get","class"],"track"],14,["match",["get","class"],["track","secondary_link","tertiary_link","service"],!0,!1]],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.75,20,2],"line-color":"hsl(156, 12%, 92%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],14,["match",["get","class"],"track",1,.5],18,12],"line-opacity":["step",["zoom"],0,14,1]}},{id:"road-street-case",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:11,filter:["all",["match",["get","class"],["street","street_limited","primary_link"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.75,20,2],"line-color":"hsl(156, 12%, 92%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-opacity":["step",["zoom"],0,14,1]}},{id:"road-secondary-tertiary-case",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:9.3,filter:["all",["match",["get","class"],["secondary","tertiary"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],10,.75,18,2],"line-color":"hsl(156, 12%, 92%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],5,.1,18,26]}},{id:"road-primary-case",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:9.9,filter:["all",["==",["get","class"],"primary"],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],10,1,18,2],"line-color":"hsl(156, 12%, 92%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32]}},{id:"road-major-link-case",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:10,filter:["all",["match",["get","class"],["motorway_link","trunk_link"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.75,20,2],"line-color":"hsl(156, 12%, 92%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-opacity":["step",["zoom"],0,11,1]}},{id:"road-motorway-trunk-case",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:8.5,filter:["all",["match",["get","class"],["motorway","trunk"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],10,1,18,2],"line-color":"hsl(156, 12%, 92%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32],"line-opacity":["step",["zoom"],["match",["get","class"],"motorway",1,0],6,1]}},{id:"road-construction",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:14,filter:["all",["==",["get","class"],"construction"],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,2,18,18],"line-color":"hsl(0, 0%, 100%)","line-dasharray":["step",["zoom"],["literal",[.4,.8]],15,["literal",[.3,.6]],16,["literal",[.2,.3]],17,["literal",[.2,.25]],18,["literal",[.15,.15]]]}},{id:"road-path",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:12,filter:["all",["==",["get","class"],"path"],["step",["zoom"],["!",["match",["get","type"],["steps","sidewalk","crossing"],!0,!1]],16,["!=",["get","type"],"steps"]],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],13,.5,14,1,15,1,18,4],"line-color":"hsl(0, 0%, 100%)","line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.75,1]],16,["literal",[1,.75]],17,["literal",[1,.5]]]}},{id:"road-steps",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:14,filter:["all",["==",["get","type"],"steps"],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],15,1,16,1.6,18,6],"line-color":"hsl(0, 0%, 100%)","line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.75,1]],16,["literal",[1,.75]],17,["literal",[.3,.3]]]}},{id:"road-major-link",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:10,filter:["all",["match",["get","class"],["motorway_link","trunk_link"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-color":"hsl(0, 0%, 100%)"}},{id:"road-pedestrian",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:12,filter:["all",["==",["get","class"],"pedestrian"],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,.5,18,12],"line-color":"hsl(0, 0%, 100%)","line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.5,.4]],16,["literal",[1,.2]]]}},{id:"road-minor",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["step",["zoom"],["==",["get","class"],"track"],14,["match",["get","class"],["track","secondary_link","tertiary_link","service"],!0,!1]],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,["match",["get","class"],"track",1,.5],18,12],"line-color":"hsl(0, 0%, 100%)","line-opacity":["step",["zoom"],0,14,1]}},{id:"road-street",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:11,filter:["all",["match",["get","class"],["street","street_limited","primary_link"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-color":"hsl(0, 0%, 100%)","line-opacity":["step",["zoom"],0,14,1]}},{id:"road-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",filter:["all",["match",["get","class"],["secondary","tertiary"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],5,.1,18,22],"line-color":"hsl(0, 0%, 100%)"}},{id:"road-primary",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:9,filter:["all",["==",["get","class"],"primary"],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round","line-cap":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32],"line-color":"#f6eac1","line-opacity":["interpolate",["linear"],["zoom"],6,0,8,["match",["get","class"],["trunk"],.2,0],16,["match",["get","class"],["trunk"],1,.81]]}},{id:"road-motorway-trunk",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:8,filter:["all",["match",["get","class"],["motorway","trunk"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],5,.5,18,32],"line-color":["match",["get","class"],["motorway"],"hsl(26, 100%, 68%)","#f2d163"],"line-opacity":["interpolate",["linear"],["zoom"],6,["match",["get","class"],["trunk"],.3,0],8,.4,18,.7]}},{id:"road-rail",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["match",["get","class"],["major_rail","minor_rail"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,.5,20,1],"line-color":"hsl(156, 12%, 92%)"}},{id:"bridge-pedestrian-case",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["==",["get","class"],"pedestrian"],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,2,18,14.5],"line-opacity":["step",["zoom"],0,14,1],"line-color":"hsl(156, 12%, 92%)"}},{id:"bridge-street-minor-low",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["step",["zoom"],["match",["get","class"],["street","street_limited","track","primary_link"],!0,!1],14,["match",["get","class"],["street","street_limited","track","primary_link","secondary_link","tertiary_link","service"],!0,!1]],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,["match",["get","class"],["street","street_limited","primary_link"],2,"track",1,.5],18,["match",["get","class"],["street","street_limited","primary_link"],18,12]],"line-color":"hsl(0, 0%, 100%)","line-opacity":["step",["zoom"],1,14,0]}},{id:"bridge-street-minor-case",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["step",["zoom"],["match",["get","class"],["street","street_limited","track","primary_link"],!0,!1],14,["match",["get","class"],["street","street_limited","track","primary_link","secondary_link","tertiary_link","service"],!0,!1]],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.75,20,2],"line-opacity":["step",["zoom"],0,14,1],"line-gap-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,["match",["get","class"],["street","street_limited","primary_link"],2,"track",1,.5],18,["match",["get","class"],["street","street_limited","primary_link"],18,12]],"line-color":"hsl(156, 12%, 92%)"}},{id:"bridge-primary-secondary-tertiary-case",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["match",["get","class"],["primary","secondary","tertiary"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],10,["match",["get","class"],"primary",1,.75],18,2],"line-opacity":["step",["zoom"],0,10,1],"line-gap-width":["interpolate",["exponential",1.5],["zoom"],5,["match",["get","class"],"primary",.75,.1],18,["match",["get","class"],"primary",32,26]],"line-color":"hsl(156, 12%, 92%)"}},{id:"bridge-major-link-case",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["match",["get","class"],["motorway_link","trunk_link"],!0,!1],["<=",["get","layer"],1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.75,20,2],"line-gap-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-color":"hsl(156, 12%, 92%)"}},{id:"bridge-motorway-trunk-case",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["match",["get","class"],["motorway","trunk"],!0,!1],["<=",["get","layer"],1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],10,1,18,2],"line-gap-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32],"line-color":"hsl(156, 12%, 92%)"}},{id:"bridge-construction",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:14,filter:["all",["==",["get","structure"],"bridge"],["==",["get","class"],"construction"],["==",["geometry-type"],"LineString"]],layout:{},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,2,18,18],"line-dasharray":["step",["zoom"],["literal",[.4,.8]],15,["literal",[.3,.6]],16,["literal",[.2,.3]],17,["literal",[.2,.25]],18,["literal",[.15,.15]]],"line-color":"hsl(156, 0%, 100%)"}},{id:"bridge-path",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["==",["get","class"],"path"],["!=",["get","type"],"steps"],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],15,1,18,4],"line-color":"hsl(0, 0%, 100%)","line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.75,1]],16,["literal",[1,.75]],17,["literal",[1,.5]]]}},{id:"bridge-steps",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:14,filter:["all",["==",["get","type"],"steps"],["==",["get","structure"],"bridge"],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],15,1,16,1.6,18,6],"line-color":"hsl(0, 0%, 100%)","line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.75,1]],16,["literal",[1,.75]],17,["literal",[.3,.3]]]}},{id:"bridge-major-link",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["match",["get","class"],["motorway_link","trunk_link"],!0,!1],["<=",["get","layer"],1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-color":"hsl(0, 0%, 100%)"}},{id:"bridge-pedestrian",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["==",["get","class"],"pedestrian"],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,.5,18,12],"line-color":"hsl(0, 0%, 100%)","line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.5,.4]],16,["literal",[1,.2]]]}},{id:"bridge-street-minor",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["step",["zoom"],["match",["get","class"],["street","street_limited","track","primary_link"],!0,!1],14,["match",["get","class"],["street","street_limited","track","primary_link","secondary_link","tertiary_link","service"],!0,!1]],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,["match",["get","class"],["street","street_limited","primary_link"],2,"track",1,.5],18,["match",["get","class"],["street","street_limited","primary_link"],18,12]],"line-color":"hsl(0, 0%, 100%)","line-opacity":["step",["zoom"],0,14,1]}},{id:"bridge-primary-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["match",["get","class"],["primary","secondary","tertiary"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],5,["match",["get","class"],"primary",.75,.1],18,["match",["get","class"],"primary",32,26]],"line-color":"hsl(0, 0%, 100%)"}},{id:"bridge-motorway-trunk",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["match",["get","class"],["motorway","trunk"],!0,!1],["<=",["get","layer"],1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32],"line-color":"hsl(0, 0%, 100%)"}},{id:"bridge-rail",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["match",["get","class"],["major_rail","minor_rail"],!0,!1]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,.5,20,1],"line-color":"hsl(156, 12%, 92%)"}},{id:"bridge-major-link-2-case",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],[">=",["get","layer"],2],["match",["get","class"],["motorway_link","trunk_link"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.75,20,2],"line-color":"hsl(156, 12%, 92%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18]}},{id:"bridge-motorway-trunk-2-case",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],[">=",["get","layer"],2],["match",["get","class"],["motorway","trunk"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],10,1,18,2],"line-color":"hsl(156, 12%, 92%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32]}},{id:"bridge-major-link-2",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],[">=",["get","layer"],2],["match",["get","class"],["motorway_link","trunk_link"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-color":"hsl(0, 0%, 100%)"}},{id:"bridge-motorway-trunk-2",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],[">=",["get","layer"],2],["match",["get","class"],["motorway","trunk"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32],"line-color":"hsl(0, 0%, 100%)"}},{id:"admin-1-boundary-bg",type:"line",metadata:{"mapbox:group":"1444934295202.7542"},source:"composite","source-layer":"admin",filter:["all",["==",["get","admin_level"],1],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","US"],!0,!1]],layout:{"line-join":"bevel"},paint:{"line-blur":["interpolate",["linear"],["zoom"],3,0,8,3],"line-width":["interpolate",["linear"],["zoom"],7,3.75,12,5.5],"line-opacity":["interpolate",["linear"],["zoom"],7,0,8,.75],"line-dasharray":[1,0],"line-translate":[0,0],"line-color":"hsl(0, 0%, 84%)"}},{id:"admin-0-boundary-bg",type:"line",metadata:{"mapbox:group":"1444934295202.7542"},source:"composite","source-layer":"admin",minzoom:1,filter:["all",["==",["get","admin_level"],0],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","US"],!0,!1]],paint:{"line-width":["interpolate",["linear"],["zoom"],3,3.5,10,8],"line-color":"hsl(0, 0%, 84%)","line-opacity":["interpolate",["linear"],["zoom"],3,0,4,.5],"line-translate":[0,0],"line-blur":["interpolate",["linear"],["zoom"],3,0,10,2]}},{id:"admin-1-boundary",type:"line",metadata:{"mapbox:group":"1444934295202.7542"},source:"composite","source-layer":"admin",filter:["all",["==",["get","admin_level"],1],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","US"],!0,!1]],layout:{"line-join":"round","line-cap":"round"},paint:{"line-width":["interpolate",["linear"],["zoom"],7,.75,12,1.5],"line-opacity":["interpolate",["linear"],["zoom"],2,0,3,1],"line-color":["interpolate",["linear"],["zoom"],3,"hsl(0, 0%, 80%)",7,"hsl(0, 0%, 70%)"]}},{id:"admin-0-boundary",type:"line",metadata:{"mapbox:group":"1444934295202.7542"},source:"composite","source-layer":"admin",minzoom:1,filter:["all",["==",["get","admin_level"],0],["==",["get","disputed"],"false"],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","US"],!0,!1]],layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 62%)","line-width":["interpolate",["linear"],["zoom"],3,.5,10,2]}},{id:"admin-0-boundary-disputed",type:"line",metadata:{"mapbox:group":"1444934295202.7542"},source:"composite","source-layer":"admin",minzoom:1,filter:["all",["==",["get","disputed"],"true"],["==",["get","admin_level"],0],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","US"],!0,!1]],layout:{"line-join":"round"},paint:{"line-dasharray":[1.5,1.5],"line-color":"hsl(0, 0%, 62%)","line-width":["interpolate",["linear"],["zoom"],3,.5,10,2]}},{id:"county_border",type:"line",metadata:{"mapbox:group":"1444934295202.7542"},source:"composite","source-layer":"attr_county_labels_pg-155yvu",minzoom:6,maxzoom:12,paint:{"line-width":["interpolate",["linear"],["zoom"],5,.5,9,1.7,18,2],"line-color":"hsl(0, 0%, 59%)","line-opacity":["interpolate",["linear"],["zoom"],5,.2,9,.5,18,1]}},{id:"cousub_border",type:"line",source:"composite","source-layer":"attr_cousub_labels_less_pl-9lemol",minzoom:8,maxzoom:14,layout:{},paint:{"line-color":"hsl(0, 3%, 38%)","line-width":["interpolate",["linear"],["zoom"],0,1,6,1,22,1],"line-opacity":["interpolate",["linear"],["zoom"],7,.1,18,.2]}},{id:"place_border",type:"line",source:"composite","source-layer":"attr_place_labels_less_pl-0n1bxr",minzoom:8,maxzoom:14,paint:{"line-color":"hsla(0, 0%, 58%, 0.62)","line-dasharray":[3,2]}},{id:"road-label",type:"symbol",source:"composite","source-layer":"road",minzoom:10,filter:["step",["zoom"],["match",["get","class"],["motorway","trunk","primary","secondary","tertiary"],!0,!1],12,["match",["get","class"],["motorway","trunk","primary","secondary","tertiary","pedestrian","street","street_limited"],!0,!1],15,["match",["get","class"],["ferry","golf","path"],!1,!0]],layout:{"text-size":["interpolate",["linear"],["zoom"],10,["match",["get","class"],["motorway","trunk","primary","secondary","tertiary"],10,["motorway_link","trunk_link","primary_link","secondary_link","tertiary_link","pedestrian","street","street_limited"],9,6.5],18,["match",["get","class"],["motorway","trunk","primary","secondary","tertiary"],16,["motorway_link","trunk_link","primary_link","secondary_link","tertiary_link","pedestrian","street","street_limited"],14,13]],"text-max-angle":30,"text-font":["DIN Offc Pro Regular","Arial Unicode MS Regular"],"symbol-placement":"line","text-padding":1,"text-rotation-alignment":"map","text-pitch-alignment":"viewport","text-field":["coalesce",["get","name_en"],["get","name"]],"text-letter-spacing":.01},paint:{"text-color":"hsl(0, 0%, 42%)","text-halo-color":["match",["get","class"],["motorway","trunk"],"hsla(0, 0%, 100%, 0.75)","hsl(0, 0%, 100%)"],"text-halo-blur":1,"text-halo-width":.1}},{id:"waterway-label",type:"symbol",source:"composite","source-layer":"natural_label",minzoom:13,filter:["all",["match",["get","class"],["canal","river","stream"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"text-font":["DIN Offc Pro Italic","Arial Unicode MS Regular"],"text-max-angle":30,"symbol-spacing":["interpolate",["linear",1],["zoom"],15,250,17,400],"text-size":["interpolate",["linear"],["zoom"],13,12,18,16],"symbol-placement":"line","text-pitch-alignment":"viewport","text-field":["coalesce",["get","name_en"],["get","name"]]},paint:{"text-color":"hsl(187, 7%, 51%)"}},{id:"natural-line-label",type:"symbol",source:"composite","source-layer":"natural_label",minzoom:4,filter:["all",["match",["get","class"],["glacier","landform"],!0,!1],["==",["geometry-type"],"LineString"],["<=",["get","filterrank"],1]],layout:{"text-size":["step",["zoom"],["step",["get","sizerank"],18,5,12],17,["step",["get","sizerank"],18,13,12]],"text-max-angle":30,"text-field":["coalesce",["get","name_en"],["get","name"]],"text-font":["DIN Offc Pro Medium","Arial Unicode MS Regular"],"symbol-placement":"line-center","text-pitch-alignment":"viewport"},paint:{"text-halo-width":.5,"text-halo-color":"hsl(0, 0%, 100%)","text-halo-blur":.5,"text-color":"hsl(0, 0%, 42%)"}},{id:"natural-point-label",type:"symbol",source:"composite","source-layer":"natural_label",minzoom:4,filter:["all",["match",["get","class"],["dock","glacier","landform","water_feature","wetland"],!0,!1],["==",["geometry-type"],"Point"],["<=",["get","filterrank"],1]],layout:{"text-size":["step",["zoom"],["step",["get","sizerank"],18,5,12],17,["step",["get","sizerank"],18,13,12]],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-font":["DIN Offc Pro Medium","Arial Unicode MS Regular"],"text-offset":["literal",[0,0]]},paint:{"text-color":"hsl(0, 0%, 42%)","text-halo-color":"hsl(0, 0%, 100%)","text-halo-width":.5,"text-halo-blur":.5}},{id:"water-line-label",type:"symbol",source:"composite","source-layer":"natural_label",filter:["all",["match",["get","class"],["bay","ocean","reservoir","sea","water"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"text-size":["interpolate",["linear"],["zoom"],7,["step",["get","sizerank"],24,6,18,12,12],10,["step",["get","sizerank"],18,9,12],18,["step",["get","sizerank"],18,9,16]],"text-max-angle":30,"text-letter-spacing":["match",["get","class"],"ocean",.25,["sea","bay"],.15,0],"text-font":["DIN Offc Pro Italic","Arial Unicode MS Regular"],"symbol-placement":"line-center","text-pitch-alignment":"viewport","text-field":["coalesce",["get","name_en"],["get","name"]]},paint:{"text-color":"hsl(187, 7%, 51%)"}},{id:"water-point-label",type:"symbol",source:"composite","source-layer":"natural_label",filter:["all",["match",["get","class"],["bay","ocean","reservoir","sea","water"],!0,!1],["==",["geometry-type"],"Point"]],layout:{"text-line-height":1.3,"text-size":["interpolate",["linear"],["zoom"],7,["step",["get","sizerank"],24,6,18,12,12],10,["step",["get","sizerank"],18,9,12]],"text-font":["DIN Offc Pro Italic","Arial Unicode MS Regular"],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-letter-spacing":["match",["get","class"],"ocean",.25,["bay","sea"],.15,.01],"text-max-width":["match",["get","class"],"ocean",4,"sea",5,["bay","water"],7,10]},paint:{"text-color":"hsl(187, 7%, 51%)"}},{id:"poi-label",type:"symbol",source:"composite","source-layer":"poi_label",minzoom:6,filter:["<=",["get","filterrank"],1],layout:{"text-size":["step",["zoom"],["step",["get","sizerank"],18,5,12],17,["step",["get","sizerank"],18,13,12]],"text-font":["DIN Offc Pro Medium","Arial Unicode MS Regular"],"text-field":["coalesce",["get","name_en"],["get","name"]]},paint:{"text-halo-color":"hsl(0, 0%, 100%)","text-halo-width":.1,"text-halo-blur":.5,"text-color":["step",["zoom"],["step",["get","sizerank"],"hsl(0, 0%, 66%)",5,"hsl(230, 0%, 56%)"],17,["step",["get","sizerank"],"hsl(0, 0%, 66%)",13,"hsl(0, 0%, 56%)"]]}},{id:"airport-label",type:"symbol",source:"composite","source-layer":"airport_label",minzoom:8,layout:{"text-line-height":1.1,"text-size":["step",["get","sizerank"],18,9,12],"icon-image":["step",["get","sizerank"],["concat",["get","maki"],"-15"],9,["concat",["get","maki"],"-11"]],"text-font":["DIN Offc Pro Medium","Arial Unicode MS Regular"],visibility:"none","text-offset":[0,.75],"text-rotation-alignment":"viewport","text-anchor":"top","text-field":["step",["get","sizerank"],["coalesce",["get","name_en"],["get","name"]],15,["get","ref"]],"text-letter-spacing":.01,"text-max-width":9},paint:{"text-color":"hsla(0, 0%, 42%, 0)","text-halo-color":"hsl(0, 0%, 100%)","text-halo-width":1,"text-opacity":0}},{id:"settlement-subdivision-label",type:"symbol",source:"composite","source-layer":"place_label",minzoom:10,maxzoom:15,filter:["all",["==",["get","class"],"settlement_subdivision"],["<=",["get","filterrank"],4]],layout:{"text-field":["coalesce",["get","name_en"],["get","name"]],"text-transform":"uppercase","text-font":["DIN Offc Pro Regular","Arial Unicode MS Regular"],"text-letter-spacing":["match",["get","type"],"suburb",.15,.1],"text-max-width":7,"text-padding":3,"text-size":["interpolate",["cubic-bezier",.5,0,1,1],["zoom"],11,["match",["get","type"],"suburb",11,10.5],15,["match",["get","type"],"suburb",17,16]],visibility:"none"},paint:{"text-halo-color":"hsl(0, 0%, 100%)","text-color":"hsl(0, 0%, 62%)","text-halo-blur":.5,"text-halo-width":.1}},{id:"state-label",type:"symbol",source:"composite","source-layer":"place_label",minzoom:3,maxzoom:9,filter:["==",["get","class"],"state"],layout:{"text-size":["interpolate",["cubic-bezier",.85,.7,.65,1],["zoom"],4,["step",["get","symbolrank"],10,6,9.5,7,9],9,["step",["get","symbolrank"],24,6,18,7,14]],"text-transform":"uppercase","text-font":["DIN Offc Pro Bold","Arial Unicode MS Bold"],"text-field":["step",["zoom"],["step",["get","symbolrank"],["coalesce",["get","name_en"],["get","name"]],5,["coalesce",["get","abbr"],["get","name_en"],["get","name"]]],5,["coalesce",["get","name_en"],["get","name"]]],"text-letter-spacing":.15,"text-max-width":6},paint:{"text-halo-color":"hsl(0, 0%, 100%)","text-color":"hsl(0, 0%, 66%)","text-halo-width":.1}},{id:"county_label",type:"symbol",source:"composite","source-layer":"attr_county_labels-5i5o0f",minzoom:7.5,maxzoom:14,layout:{"text-field":["step",["zoom"],["upcase",["to-string",["get","name"]]],6,["upcase",["to-string",["get","name"]]],10,["upcase",["to-string",["get","namelsad"]]],22,["upcase",["to-string",["get","namelsad"]]]],"text-font":["step",["zoom"],["literal",["Open Sans Regular","Arial Unicode MS Regular"]],6,["literal",["Montserrat Medium","Arial Unicode MS Regular"]],8,["literal",["Montserrat Medium","Arial Unicode MS Regular"]],11,["literal",["Montserrat Medium","Arial Unicode MS Regular"]],22,["literal",["Montserrat Medium","Arial Unicode MS Regular"]]],"text-size":["interpolate",["linear"],["zoom"],0,0,6,6,6.5,10,7.5,14,9,30,11,75,14,85],"text-allow-overlap":["step",["zoom"],!1,5,!1,10,!1,11,!0],"text-max-width":5,"text-ignore-placement":["step",["zoom"],!1,6,!1,9,!0,12,!0,22,!0]},paint:{"text-color":"hsl(0, 0%, 48%)","text-opacity":["interpolate",["linear"],["zoom"],6.49999,1,6.5,.7,8,.3,11,.1,16,.05]}},{id:"cousub_label",type:"symbol",source:"composite","source-layer":"attr_cousub_labels_plus_pt-0kx5lj",minzoom:9,layout:{"text-field":["upcase",["get","display_name"]],"text-size":["interpolate",["linear"],["zoom"],7.9,0,8,8,9,10,14,30],"text-max-width":5,"text-line-height":1.1,visibility:"none"},paint:{"text-color":"hsla(0, 0%, 31%, 0.76)","text-halo-width":10,"text-halo-color":"hsl(0, 0%, 100%)"}},{id:"place-label new",type:"symbol",source:"composite","source-layer":"rural_places-4rf4i9",minzoom:9,filter:["match",["get","census_boundary_year"],[2020],!0,!1],layout:{"text-line-height":1.1,"text-size":["interpolate",["cubic-bezier",.2,0,.9,1],["zoom"],3,["step",["get","symbolrank"],12,9,11,10,10.5,12,9.5,14,8.5,16,6.5,17,4],15,["step",["get","symbolrank"],28,9,26,10,23,11,21,12,20,13,19,15,17]],"icon-image":["case",["==",["get","capital"],2],"border-dot-13",["step",["get","symbolrank"],"dot-11",9,"dot-10",11,"dot-9"]],"text-font":["Montserrat Medium","Arial Unicode MS Regular"],"text-justify":["step",["zoom"],["match",["get","text_anchor"],["left","bottom-left","top-left"],"left",["right","bottom-right","top-right"],"right","center"],8,"center"],visibility:"none","text-offset":["step",["zoom"],["match",["get","capital"],2,["match",["get","text_anchor"],"bottom",["literal",[0,-.3]],"bottom-left",["literal",[.3,-.1]],"left",["literal",[.45,.1]],"top-left",["literal",[.3,.1]],"top",["literal",[0,.3]],"top-right",["literal",[-.3,.1]],"right",["literal",[-.45,0]],"bottom-right",["literal",[-.3,-.1]],["literal",[0,-.3]]],["match",["get","text_anchor"],"bottom",["literal",[0,-.25]],"bottom-left",["literal",[.2,-.05]],"left",["literal",[.4,.05]],"top-left",["literal",[.2,.05]],"top",["literal",[0,.25]],"top-right",["literal",[-.2,.05]],"right",["literal",[-.4,.05]],"bottom-right",["literal",[-.2,-.05]],["literal",[0,-.25]]]],8,["literal",[0,0]]],"text-anchor":["step",["zoom"],["get","text_anchor"],8,"center"],"text-field":["coalesce",["get","NAME"]],"text-max-width":7},paint:{"text-color":["step",["get","symbolrank"],"hsl(0, 2%, 61%)",11,"hsl(0, 1%, 68%)",16,"hsl(0, 1%, 75%)"],"text-halo-color":"hsl(0, 0%, 100%)","icon-opacity":["step",["zoom"],1,8,0],"text-halo-blur":1,"text-halo-width":.1}},{id:"settlement-label",type:"symbol",source:"composite","source-layer":"place_label",maxzoom:10.76,filter:["all",["<=",["get","filterrank"],3],["==",["get","class"],"settlement"],["step",["zoom"],!0,12,[">=",["get","symbolrank"],11],13,[">=",["get","symbolrank"],12]]],layout:{"text-line-height":1.1,"text-size":["interpolate",["cubic-bezier",.2,0,.9,1],["zoom"],3,["step",["get","symbolrank"],12,9,11,10,10.5,12,9.5,14,8.5,16,6.5,17,4],15,["step",["get","symbolrank"],28,9,26,10,23,11,21,12,20,13,19,15,17]],"icon-image":["case",["==",["get","capital"],2],"border-dot-13",["step",["get","symbolrank"],"dot-11",9,"dot-10",11,"dot-9"]],"text-font":["step",["zoom"],["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]],8,["step",["get","symbolrank"],["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]],11,["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]]],10,["step",["get","symbolrank"],["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]],12,["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]]],11,["step",["get","symbolrank"],["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]],13,["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]]],12,["step",["get","symbolrank"],["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]],15,["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]]],13,["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]]],"text-justify":["step",["zoom"],["match",["get","text_anchor"],["left","bottom-left","top-left"],"left",["right","bottom-right","top-right"],"right","center"],8,"center"],"text-offset":["step",["zoom"],["match",["get","capital"],2,["match",["get","text_anchor"],"bottom",["literal",[0,-.3]],"bottom-left",["literal",[.3,-.1]],"left",["literal",[.45,.1]],"top-left",["literal",[.3,.1]],"top",["literal",[0,.3]],"top-right",["literal",[-.3,.1]],"right",["literal",[-.45,0]],"bottom-right",["literal",[-.3,-.1]],["literal",[0,-.3]]],["match",["get","text_anchor"],"bottom",["literal",[0,-.25]],"bottom-left",["literal",[.2,-.05]],"left",["literal",[.4,.05]],"top-left",["literal",[.2,.05]],"top",["literal",[0,.25]],"top-right",["literal",[-.2,.05]],"right",["literal",[-.4,.05]],"bottom-right",["literal",[-.2,-.05]],["literal",[0,-.25]]]],8,["literal",[0,0]]],"text-anchor":["step",["zoom"],["get","text_anchor"],8,"center"],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-max-width":7},paint:{"text-color":["step",["get","symbolrank"],"hsl(0, 0%, 42%)",11,"hsl(0, 0%, 55%)",16,"hsl(0, 0%, 62%)"],"text-halo-color":"hsl(0, 0%, 100%)","icon-opacity":["step",["zoom"],1,8,0],"text-halo-blur":1,"text-halo-width":.1}},{id:"wwb2s-places_lat_lon",type:"symbol",source:"composite","source-layer":"places_lat_lon-awryh9",minzoom:10.75,maxzoom:20,filter:["all",[">=",["get","pop"],101],[">",["get","pct_rural"],0],["step",["zoom"],!0,13,[">=",["get","symbolrank"],11],14,[">=",["get","symbolrank"],13]]],layout:{"text-line-height":1.1,"text-size":["step",["get","symbolrank"],20,9,18,10,16,11,14,12,12],"icon-image":["case",["==",["get","capital"],2],"border-dot-13",["step",["get","symbolrank"],"dot-11",9,"dot-10",11,"dot-9"]],"text-font":["step",["zoom"],["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]],8,["step",["get","symbolrank"],["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]],11,["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]]],10,["step",["get","symbolrank"],["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]],12,["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]]],11,["step",["get","symbolrank"],["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]],13,["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]]],12,["step",["get","symbolrank"],["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]],15,["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]]],13,["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]]],"text-justify":["step",["zoom"],["match",["get","text_anchor"],["left","bottom-left","top-left"],"left",["right","bottom-right","top-right"],"right","center"],8,"center"],"text-offset":["step",["zoom"],["match",["get","capital"],2,["match",["get","text_anchor"],"bottom",["literal",[0,-.3]],"bottom-left",["literal",[.3,-.1]],"left",["literal",[.45,.1]],"top-left",["literal",[.3,.1]],"top",["literal",[0,.3]],"top-right",["literal",[-.3,.1]],"right",["literal",[-.45,0]],"bottom-right",["literal",[-.3,-.1]],["literal",[0,-.3]]],["match",["get","text_anchor"],"bottom",["literal",[0,-.25]],"bottom-left",["literal",[.2,-.05]],"left",["literal",[.4,.05]],"top-left",["literal",[.2,.05]],"top",["literal",[0,.25]],"top-right",["literal",[-.2,.05]],"right",["literal",[-.4,.05]],"bottom-right",["literal",[-.2,-.05]],["literal",[0,-.25]]]],8,["literal",[0,0]]],"text-anchor":["step",["zoom"],["get","text_anchor"],8,"center"],"text-field":["coalesce",["get","NAME"],["get","name"]],"text-max-width":7},paint:{"text-halo-color":"hsl(0, 0%, 100%)","icon-opacity":["step",["zoom"],1,8,0],"text-halo-blur":1,"text-halo-width":.1,"text-color":["interpolate",["linear"],["zoom"],0,"hsl(0, 0%, 62%)",22,"#000000"],"text-opacity":["interpolate",["linear"],["zoom"],7,0,9,.97,22,1]}},{id:"custom-pattern",type:"fill",source:"composite","source-layer":"attr_county_labels_pg-155yvu",minzoom:6,layout:{visibility:"none"},paint:{"fill-color":"hsla(303, 73%, 74%, 0.66)","fill-pattern":"stripe-4"}}],bF="2022-02-24T13:16:14.872Z",EF="2024-07-11T16:18:50.102Z",TF="cl010e7b7001p15pe3l0306hv",SF="ruralinno",AF="private",CF=!1,IF={version:hF,name:dF,metadata:pF,center:fF,zoom:mF,bearing:gF,pitch:_F,sources:yF,sprite:vF,glyphs:xF,layers:wF,created:bF,modified:EF,id:TF,owner:SF,visibility:AF,protected:!1,draft:CF};/* + * Frontend UI component library for the CORI Data API + * {@link https://github.com/ruralinnovation/cori.data.api} + * @copyright Rural Innovation Strategies, Inc. + * @license ISC + */Object.assign({},IF);function Zp(e){let n="https://mui.com/production-error/?code="+e;for(let l=1;l0?Nr(vh,--Pi):0,uh--,yr===10&&(uh=1,D_--),yr}function Wi(){return yr=Pi2||Xp(yr)>3?"":" "}function GF(e,n){for(;--n&&Wi()&&!(yr<48||yr>102||yr>57&&yr<65||yr>70&&yr<97););return of(e,bg()+(n<6&&ws()==32&&Wi()==32))}function m1(e){for(;Wi();)switch(yr){case e:return Pi;case 34:case 39:e!==34&&e!==39&&m1(yr);break;case 40:e===41&&m1(e);break;case 92:Wi();break}return Pi}function qF(e,n){for(;Wi()&&e+yr!==47+10;)if(e+yr===42+42&&ws()===47)break;return"/*"+of(n,Pi-1)+"*"+R_(e===47?e:Wi())}function WF(e){for(;!Xp(ws());)Wi();return of(e,Pi)}function ZF(e){return BI(Tg("",null,null,null,[""],e=OI(e),0,[0],e))}function Tg(e,n,l,h,m,v,E,s,k){for(var D=0,V=0,G=E,J=0,ve=0,ae=0,me=1,Ce=1,ie=1,te=0,le="",ze=m,Oe=v,Ke=h,He=le;Ce;)switch(ae=te,te=Wi()){case 40:if(ae!=108&&Nr(He,G-1)==58){f1(He+=yn(Eg(te),"&","&\f"),"&\f")!=-1&&(ie=-1);break}case 34:case 39:case 91:He+=Eg(te);break;case 9:case 10:case 13:case 32:He+=$F(ae);break;case 92:He+=GF(bg()-1,7);continue;case 47:switch(ws()){case 42:case 47:rg(HF(qF(Wi(),bg()),n,l),k);break;default:He+="/"}break;case 123*me:s[D++]=_s(He)*ie;case 125*me:case 59:case 0:switch(te){case 0:case 125:Ce=0;case 59+V:ie==-1&&(He=yn(He,/\f/g,"")),ve>0&&_s(He)-G&&rg(ve>32?OT(He+";",h,l,G-1):OT(yn(He," ","")+";",h,l,G-2),k);break;case 59:He+=";";default:if(rg(Ke=DT(He,n,l,D,V,m,s,le,ze=[],Oe=[],G),v),te===123)if(V===0)Tg(He,n,Ke,Ke,ze,v,G,s,Oe);else switch(J===99&&Nr(He,3)===110?100:J){case 100:case 108:case 109:case 115:Tg(e,Ke,Ke,h&&rg(DT(e,Ke,Ke,0,0,m,s,le,m,ze=[],G),Oe),m,Oe,G,s,h?ze:Oe);break;default:Tg(He,Ke,Ke,Ke,[""],Oe,0,s,Oe)}}D=V=ve=0,me=ie=1,le=He="",G=E;break;case 58:G=1+_s(He),ve=ae;default:if(me<1){if(te==123)--me;else if(te==125&&me++==0&&VF()==125)continue}switch(He+=R_(te),te*me){case 38:ie=V>0?1:(He+="\f",-1);break;case 44:s[D++]=(_s(He)-1)*ie,ie=1;break;case 64:ws()===45&&(He+=Eg(Wi())),J=ws(),V=G=_s(le=He+=WF(bg())),te++;break;case 45:ae===45&&_s(He)==2&&(me=0)}}return v}function DT(e,n,l,h,m,v,E,s,k,D,V){for(var G=m-1,J=m===0?v:[""],ve=Lx(J),ae=0,me=0,Ce=0;ae0?J[ie]+" "+te:yn(te,/&\f/g,J[ie])))&&(k[Ce++]=le);return O_(e,n,l,m===0?Px:s,k,D,V)}function HF(e,n,l){return O_(e,n,l,zI,R_(jF()),Hp(e,2,-2),0)}function OT(e,n,l,h){return O_(e,n,l,zx,Hp(e,0,h),Hp(e,h+1,-1),h)}function Qu(e,n){for(var l="",h=Lx(e),m=0;m6)switch(Nr(e,n+1)){case 109:if(Nr(e,n+4)!==45)break;case 102:return yn(e,/(.+:)(.+)-([^]+)/,"$1"+_n+"$2-$3$1"+i_+(Nr(e,n+3)==108?"$3":"$2-$3"))+e;case 115:return~f1(e,"stretch")?FI(yn(e,"stretch","fill-available"),n)+e:e}break;case 4949:if(Nr(e,n+1)!==115)break;case 6444:switch(Nr(e,_s(e)-3-(~f1(e,"!important")&&10))){case 107:return yn(e,":",":"+_n)+e;case 101:return yn(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+_n+(Nr(e,14)===45?"inline-":"")+"box$3$1"+_n+"$2$3$1"+ei+"$2box$3")+e}break;case 5936:switch(Nr(e,n+11)){case 114:return _n+e+ei+yn(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return _n+e+ei+yn(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return _n+e+ei+yn(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return _n+e+ei+e+e}return e}var r6=function(n,l,h,m){if(n.length>-1&&!n.return)switch(n.type){case zx:n.return=FI(n.value,n.length);break;case LI:return Qu([lp(n,{value:yn(n.value,"@","@"+_n)})],m);case Px:if(n.length)return UF(n.props,function(v){switch(NF(v,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Qu([lp(n,{props:[yn(v,/:(read-\w+)/,":"+i_+"$1")]})],m);case"::placeholder":return Qu([lp(n,{props:[yn(v,/:(plac\w+)/,":"+_n+"input-$1")]}),lp(n,{props:[yn(v,/:(plac\w+)/,":"+i_+"$1")]}),lp(n,{props:[yn(v,/:(plac\w+)/,ei+"input-$1")]})],m)}return""})}},i6=[r6],o6=function(n){var l=n.key;if(l==="css"){var h=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(h,function(me){var Ce=me.getAttribute("data-emotion");Ce.indexOf(" ")!==-1&&(document.head.appendChild(me),me.setAttribute("data-s",""))})}var m=n.stylisPlugins||i6,v={},E,s=[];E=n.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+l+' "]'),function(me){for(var Ce=me.getAttribute("data-emotion").split(" "),ie=1;ie{n[l]=VI(e[l])}),n}function ea(e,n,l={clone:!0}){const h=l.clone?Bn({},e):e;return Pu(e)&&Pu(n)&&Object.keys(n).forEach(m=>{Pu(n[m])&&Object.prototype.hasOwnProperty.call(e,m)&&Pu(e[m])?h[m]=ea(e[m],n[m],l):l.clone?h[m]=Pu(n[m])?VI(n[m]):n[m]:h[m]=n[m]}),h}const p6=["values","unit","step"],f6=e=>{const n=Object.keys(e).map(l=>({key:l,val:e[l]}))||[];return n.sort((l,h)=>l.val-h.val),n.reduce((l,h)=>Bn({},l,{[h.key]:h.val}),{})};function m6(e){const{values:n={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:l="px",step:h=5}=e,m=pl(e,p6),v=f6(n),E=Object.keys(v);function s(J){return`@media (min-width:${typeof n[J]=="number"?n[J]:J}${l})`}function k(J){return`@media (max-width:${(typeof n[J]=="number"?n[J]:J)-h/100}${l})`}function D(J,ve){const ae=E.indexOf(ve);return`@media (min-width:${typeof n[J]=="number"?n[J]:J}${l}) and (max-width:${(ae!==-1&&typeof n[E[ae]]=="number"?n[E[ae]]:ve)-h/100}${l})`}function V(J){return E.indexOf(J)+1`@media (min-width:${Rx[e]}px)`};function oa(e,n,l){const h=e.theme||{};if(Array.isArray(n)){const v=h.breakpoints||FT;return n.reduce((E,s,k)=>(E[v.up(v.keys[k])]=l(n[k]),E),{})}if(typeof n=="object"){const v=h.breakpoints||FT;return Object.keys(n).reduce((E,s)=>{if(Object.keys(v.values||Rx).indexOf(s)!==-1){const k=v.up(s);E[k]=l(n[s],s)}else{const k=s;E[k]=n[k]}return E},{})}return l(n)}function y6(e={}){var n;return((n=e.keys)==null?void 0:n.reduce((h,m)=>{const v=e.up(m);return h[v]={},h},{}))||{}}function v6(e,n){return e.reduce((l,h)=>{const m=l[h];return(!m||Object.keys(m).length===0)&&delete l[h],l},n)}function $I(e){if(typeof e!="string")throw new Error(Zp(7));return e.charAt(0).toUpperCase()+e.slice(1)}function F_(e,n,l=!0){if(!n||typeof n!="string")return null;if(e&&e.vars&&l){const h=`vars.${n}`.split(".").reduce((m,v)=>m&&m[v]?m[v]:null,e);if(h!=null)return h}return n.split(".").reduce((h,m)=>h&&h[m]!=null?h[m]:null,e)}function o_(e,n,l,h=l){let m;return typeof e=="function"?m=e(l):Array.isArray(e)?m=e[l]||h:m=F_(e,l)||h,n&&(m=n(m,h,e)),m}function cr(e){const{prop:n,cssProperty:l=e.prop,themeKey:h,transform:m}=e,v=E=>{if(E[n]==null)return null;const s=E[n],k=E.theme,D=F_(k,h)||{};return oa(E,s,G=>{let J=o_(D,m,G);return G===J&&typeof G=="string"&&(J=o_(D,m,`${n}${G==="default"?"":$I(G)}`,G)),l===!1?J:{[l]:J}})};return v.propTypes={},v.filterProps=[n],v}function x6(e){const n={};return l=>(n[l]===void 0&&(n[l]=e(l)),n[l])}const w6={m:"margin",p:"padding"},b6={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},NT={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},E6=x6(e=>{if(e.length>2)if(NT[e])e=NT[e];else return[e];const[n,l]=e.split(""),h=w6[n],m=b6[l]||"";return Array.isArray(m)?m.map(v=>h+v):[h+m]}),Dx=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Ox=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...Dx,...Ox];function sf(e,n,l,h){var m;const v=(m=F_(e,n,!1))!=null?m:l;return typeof v=="number"?E=>typeof E=="string"?E:v*E:Array.isArray(v)?E=>typeof E=="string"?E:v[E]:typeof v=="function"?v:()=>{}}function GI(e){return sf(e,"spacing",8)}function af(e,n){if(typeof n=="string"||n==null)return n;const l=Math.abs(n),h=e(l);return n>=0?h:typeof h=="number"?-h:`-${h}`}function T6(e,n){return l=>e.reduce((h,m)=>(h[m]=af(n,l),h),{})}function S6(e,n,l,h){if(n.indexOf(l)===-1)return null;const m=E6(l),v=T6(m,h),E=e[l];return oa(e,E,v)}function qI(e,n){const l=GI(e.theme);return Object.keys(e).map(h=>S6(e,n,h,l)).reduce(Tp,{})}function rr(e){return qI(e,Dx)}rr.propTypes={};rr.filterProps=Dx;function ir(e){return qI(e,Ox)}ir.propTypes={};ir.filterProps=Ox;function A6(e=8){if(e.mui)return e;const n=GI({spacing:e}),l=(...h)=>(h.length===0?[1]:h).map(v=>{const E=n(v);return typeof E=="number"?`${E}px`:E}).join(" ");return l.mui=!0,l}function N_(...e){const n=e.reduce((h,m)=>(m.filterProps.forEach(v=>{h[v]=m}),h),{}),l=h=>Object.keys(h).reduce((m,v)=>n[v]?Tp(m,n[v](h)):m,{});return l.propTypes={},l.filterProps=e.reduce((h,m)=>h.concat(m.filterProps),[]),l}function ho(e){return typeof e!="number"?e:`${e}px solid`}function yo(e,n){return cr({prop:e,themeKey:"borders",transform:n})}const C6=yo("border",ho),I6=yo("borderTop",ho),k6=yo("borderRight",ho),M6=yo("borderBottom",ho),P6=yo("borderLeft",ho),z6=yo("borderColor"),L6=yo("borderTopColor"),R6=yo("borderRightColor"),D6=yo("borderBottomColor"),O6=yo("borderLeftColor"),B6=yo("outline",ho),F6=yo("outlineColor"),U_=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const n=sf(e.theme,"shape.borderRadius",4),l=h=>({borderRadius:af(n,h)});return oa(e,e.borderRadius,l)}return null};U_.propTypes={};U_.filterProps=["borderRadius"];N_(C6,I6,k6,M6,P6,z6,L6,R6,D6,O6,U_,B6,F6);const j_=e=>{if(e.gap!==void 0&&e.gap!==null){const n=sf(e.theme,"spacing",8),l=h=>({gap:af(n,h)});return oa(e,e.gap,l)}return null};j_.propTypes={};j_.filterProps=["gap"];const V_=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const n=sf(e.theme,"spacing",8),l=h=>({columnGap:af(n,h)});return oa(e,e.columnGap,l)}return null};V_.propTypes={};V_.filterProps=["columnGap"];const $_=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const n=sf(e.theme,"spacing",8),l=h=>({rowGap:af(n,h)});return oa(e,e.rowGap,l)}return null};$_.propTypes={};$_.filterProps=["rowGap"];const N6=cr({prop:"gridColumn"}),U6=cr({prop:"gridRow"}),j6=cr({prop:"gridAutoFlow"}),V6=cr({prop:"gridAutoColumns"}),$6=cr({prop:"gridAutoRows"}),G6=cr({prop:"gridTemplateColumns"}),q6=cr({prop:"gridTemplateRows"}),W6=cr({prop:"gridTemplateAreas"}),Z6=cr({prop:"gridArea"});N_(j_,V_,$_,N6,U6,j6,V6,$6,G6,q6,W6,Z6);function eh(e,n){return n==="grey"?n:e}const H6=cr({prop:"color",themeKey:"palette",transform:eh}),X6=cr({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:eh}),K6=cr({prop:"backgroundColor",themeKey:"palette",transform:eh});N_(H6,X6,K6);function Vi(e){return e<=1&&e!==0?`${e*100}%`:e}const Y6=cr({prop:"width",transform:Vi}),Bx=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const n=l=>{var h,m;const v=((h=e.theme)==null||(h=h.breakpoints)==null||(h=h.values)==null?void 0:h[l])||Rx[l];return v?((m=e.theme)==null||(m=m.breakpoints)==null?void 0:m.unit)!=="px"?{maxWidth:`${v}${e.theme.breakpoints.unit}`}:{maxWidth:v}:{maxWidth:Vi(l)}};return oa(e,e.maxWidth,n)}return null};Bx.filterProps=["maxWidth"];const J6=cr({prop:"minWidth",transform:Vi}),Q6=cr({prop:"height",transform:Vi}),eN=cr({prop:"maxHeight",transform:Vi}),tN=cr({prop:"minHeight",transform:Vi});cr({prop:"size",cssProperty:"width",transform:Vi});cr({prop:"size",cssProperty:"height",transform:Vi});const nN=cr({prop:"boxSizing"});N_(Y6,Bx,J6,Q6,eN,tN,nN);const rN={border:{themeKey:"borders",transform:ho},borderTop:{themeKey:"borders",transform:ho},borderRight:{themeKey:"borders",transform:ho},borderBottom:{themeKey:"borders",transform:ho},borderLeft:{themeKey:"borders",transform:ho},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:ho},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:U_},color:{themeKey:"palette",transform:eh},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:eh},backgroundColor:{themeKey:"palette",transform:eh},p:{style:ir},pt:{style:ir},pr:{style:ir},pb:{style:ir},pl:{style:ir},px:{style:ir},py:{style:ir},padding:{style:ir},paddingTop:{style:ir},paddingRight:{style:ir},paddingBottom:{style:ir},paddingLeft:{style:ir},paddingX:{style:ir},paddingY:{style:ir},paddingInline:{style:ir},paddingInlineStart:{style:ir},paddingInlineEnd:{style:ir},paddingBlock:{style:ir},paddingBlockStart:{style:ir},paddingBlockEnd:{style:ir},m:{style:rr},mt:{style:rr},mr:{style:rr},mb:{style:rr},ml:{style:rr},mx:{style:rr},my:{style:rr},margin:{style:rr},marginTop:{style:rr},marginRight:{style:rr},marginBottom:{style:rr},marginLeft:{style:rr},marginX:{style:rr},marginY:{style:rr},marginInline:{style:rr},marginInlineStart:{style:rr},marginInlineEnd:{style:rr},marginBlock:{style:rr},marginBlockStart:{style:rr},marginBlockEnd:{style:rr},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:j_},rowGap:{style:$_},columnGap:{style:V_},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Vi},maxWidth:{style:Bx},minWidth:{transform:Vi},height:{transform:Vi},maxHeight:{transform:Vi},minHeight:{transform:Vi},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}},Fx=rN;function iN(...e){const n=e.reduce((h,m)=>h.concat(Object.keys(m)),[]),l=new Set(n);return e.every(h=>l.size===Object.keys(h).length)}function oN(e,n){return typeof e=="function"?e(n):e}function sN(){function e(l,h,m,v){const E={[l]:h,theme:m},s=v[l];if(!s)return{[l]:h};const{cssProperty:k=l,themeKey:D,transform:V,style:G}=s;if(h==null)return null;if(D==="typography"&&h==="inherit")return{[l]:h};const J=F_(m,D)||{};return G?G(E):oa(E,h,ae=>{let me=o_(J,V,ae);return ae===me&&typeof ae=="string"&&(me=o_(J,V,`${l}${ae==="default"?"":$I(ae)}`,ae)),k===!1?me:{[k]:me}})}function n(l){var h;const{sx:m,theme:v={}}=l||{};if(!m)return null;const E=(h=v.unstable_sxConfig)!=null?h:Fx;function s(k){let D=k;if(typeof k=="function")D=k(v);else if(typeof k!="object")return k;if(!D)return null;const V=y6(v.breakpoints),G=Object.keys(V);let J=V;return Object.keys(D).forEach(ve=>{const ae=oN(D[ve],v);if(ae!=null)if(typeof ae=="object")if(E[ve])J=Tp(J,e(ve,ae,v,E));else{const me=oa({theme:v},ae,Ce=>({[ve]:Ce}));iN(me,ae)?J[ve]=n({sx:ae,theme:v}):J=Tp(J,me)}else J=Tp(J,e(ve,ae,v,E))}),v6(G,J)}return Array.isArray(m)?m.map(s):s(m)}return n}const WI=sN();WI.filterProps=["sx"];const ZI=WI;function aN(e,n){const l=this;return l.vars&&typeof l.getColorSchemeSelector=="function"?{[l.getColorSchemeSelector(e).replace(/(\[[^\]]+\])/,"*:where($1)")]:n}:l.palette.mode===e?n:{}}const lN=["breakpoints","palette","spacing","shape"];function cN(e={},...n){const{breakpoints:l={},palette:h={},spacing:m,shape:v={}}=e,E=pl(e,lN),s=m6(l),k=A6(m);let D=ea({breakpoints:s,direction:"ltr",components:{},palette:Bn({mode:"light"},h),spacing:k,shape:Bn({},_6,v)},E);return D.applyStyles=aN,D=n.reduce((V,G)=>ea(V,G),D),D.unstable_sxConfig=Bn({},Fx,E==null?void 0:E.unstable_sxConfig),D.unstable_sx=function(G){return ZI({sx:G,theme:this})},D}function uN(e){return Object.keys(e).length===0}function hN(e=null){const n=ut.useContext(NI);return!n||uN(n)?e:n}function dN(e,n=Number.MIN_SAFE_INTEGER,l=Number.MAX_SAFE_INTEGER){return Math.max(n,Math.min(e,l))}const pN=Object.freeze(Object.defineProperty({__proto__:null,default:dN},Symbol.toStringTag,{value:"Module"})),fN=ut.createContext(null),HI=fN;function XI(){return ut.useContext(HI)}const mN=typeof Symbol=="function"&&Symbol.for,gN=mN?Symbol.for("mui.nested"):"__THEME_NESTED__";function _N(e,n){return typeof n=="function"?n(e):Bn({},e,n)}function yN(e){const{children:n,theme:l}=e,h=XI(),m=ut.useMemo(()=>{const v=h===null?l:_N(h,l);return v!=null&&(v[gN]=h!==null),v},[l,h]);return Ka.jsx(HI.Provider,{value:m,children:n})}const vN=["value"],xN=ut.createContext();function wN(e){let{value:n}=e,l=pl(e,vN);return Ka.jsx(xN.Provider,Bn({value:n??!0},l))}const bN=ut.createContext(void 0);function EN({value:e,children:n}){return Ka.jsx(bN.Provider,{value:e,children:n})}const UT={};function jT(e,n,l,h=!1){return ut.useMemo(()=>{const m=e&&n[e]||n;if(typeof l=="function"){const v=l(m),E=e?Bn({},n,{[e]:v}):v;return h?()=>E:E}return e?Bn({},n,{[e]:l}):Bn({},n,l)},[e,n,l,h])}function TN(e){const{children:n,theme:l,themeId:h}=e,m=hN(UT),v=XI()||UT,E=jT(h,m,l),s=jT(h,v,l,!0),k=E.direction==="rtl";return Ka.jsx(yN,{theme:s,children:Ka.jsx(NI.Provider,{value:E,children:Ka.jsx(wN,{value:k,children:Ka.jsx(EN,{value:E==null?void 0:E.components,children:n})})})})}function SN(e,n){return Bn({toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}}},n)}var ur={},KI={exports:{}};(function(e){function n(l){return l&&l.__esModule?l:{default:l}}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(KI);var AN=KI.exports;const CN=XT(kF),IN=XT(pN);var YI=AN;Object.defineProperty(ur,"__esModule",{value:!0});ur.alpha=tk;ur.blend=jN;ur.colorChannel=void 0;var kN=ur.darken=Ux;ur.decomposeColor=_o;ur.emphasize=nk;var MN=ur.getContrastRatio=ON;ur.getLuminance=s_;ur.hexToRgb=JI;ur.hslToRgb=ek;var PN=ur.lighten=jx;ur.private_safeAlpha=BN;ur.private_safeColorChannel=void 0;ur.private_safeDarken=FN;ur.private_safeEmphasize=UN;ur.private_safeLighten=NN;ur.recomposeColor=xh;ur.rgbToHex=DN;var VT=YI(CN),zN=YI(IN);function Nx(e,n=0,l=1){return(0,zN.default)(e,n,l)}function JI(e){e=e.slice(1);const n=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let l=e.match(n);return l&&l[0].length===1&&(l=l.map(h=>h+h)),l?`rgb${l.length===4?"a":""}(${l.map((h,m)=>m<3?parseInt(h,16):Math.round(parseInt(h,16)/255*1e3)/1e3).join(", ")})`:""}function LN(e){const n=e.toString(16);return n.length===1?`0${n}`:n}function _o(e){if(e.type)return e;if(e.charAt(0)==="#")return _o(JI(e));const n=e.indexOf("("),l=e.substring(0,n);if(["rgb","rgba","hsl","hsla","color"].indexOf(l)===-1)throw new Error((0,VT.default)(9,e));let h=e.substring(n+1,e.length-1),m;if(l==="color"){if(h=h.split(" "),m=h.shift(),h.length===4&&h[3].charAt(0)==="/"&&(h[3]=h[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(m)===-1)throw new Error((0,VT.default)(10,m))}else h=h.split(",");return h=h.map(v=>parseFloat(v)),{type:l,values:h,colorSpace:m}}const QI=e=>{const n=_o(e);return n.values.slice(0,3).map((l,h)=>n.type.indexOf("hsl")!==-1&&h!==0?`${l}%`:l).join(" ")};ur.colorChannel=QI;const RN=(e,n)=>{try{return QI(e)}catch{return e}};ur.private_safeColorChannel=RN;function xh(e){const{type:n,colorSpace:l}=e;let{values:h}=e;return n.indexOf("rgb")!==-1?h=h.map((m,v)=>v<3?parseInt(m,10):m):n.indexOf("hsl")!==-1&&(h[1]=`${h[1]}%`,h[2]=`${h[2]}%`),n.indexOf("color")!==-1?h=`${l} ${h.join(" ")}`:h=`${h.join(", ")}`,`${n}(${h})`}function DN(e){if(e.indexOf("#")===0)return e;const{values:n}=_o(e);return`#${n.map((l,h)=>LN(h===3?Math.round(255*l):l)).join("")}`}function ek(e){e=_o(e);const{values:n}=e,l=n[0],h=n[1]/100,m=n[2]/100,v=h*Math.min(m,1-m),E=(D,V=(D+l/30)%12)=>m-v*Math.max(Math.min(V-3,9-V,1),-1);let s="rgb";const k=[Math.round(E(0)*255),Math.round(E(8)*255),Math.round(E(4)*255)];return e.type==="hsla"&&(s+="a",k.push(n[3])),xh({type:s,values:k})}function s_(e){e=_o(e);let n=e.type==="hsl"||e.type==="hsla"?_o(ek(e)).values:e.values;return n=n.map(l=>(e.type!=="color"&&(l/=255),l<=.03928?l/12.92:((l+.055)/1.055)**2.4)),Number((.2126*n[0]+.7152*n[1]+.0722*n[2]).toFixed(3))}function ON(e,n){const l=s_(e),h=s_(n);return(Math.max(l,h)+.05)/(Math.min(l,h)+.05)}function tk(e,n){return e=_o(e),n=Nx(n),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${n}`:e.values[3]=n,xh(e)}function BN(e,n,l){try{return tk(e,n)}catch{return e}}function Ux(e,n){if(e=_o(e),n=Nx(n),e.type.indexOf("hsl")!==-1)e.values[2]*=1-n;else if(e.type.indexOf("rgb")!==-1||e.type.indexOf("color")!==-1)for(let l=0;l<3;l+=1)e.values[l]*=1-n;return xh(e)}function FN(e,n,l){try{return Ux(e,n)}catch{return e}}function jx(e,n){if(e=_o(e),n=Nx(n),e.type.indexOf("hsl")!==-1)e.values[2]+=(100-e.values[2])*n;else if(e.type.indexOf("rgb")!==-1)for(let l=0;l<3;l+=1)e.values[l]+=(255-e.values[l])*n;else if(e.type.indexOf("color")!==-1)for(let l=0;l<3;l+=1)e.values[l]+=(1-e.values[l])*n;return xh(e)}function NN(e,n,l){try{return jx(e,n)}catch{return e}}function nk(e,n=.15){return s_(e)>.5?Ux(e,n):jx(e,n)}function UN(e,n,l){try{return nk(e,n)}catch{return e}}function jN(e,n,l,h=1){const m=(k,D)=>Math.round((k**(1/h)*(1-l)+D**(1/h)*l)**h),v=_o(e),E=_o(n),s=[m(v.values[0],E.values[0]),m(v.values[1],E.values[1]),m(v.values[2],E.values[2])];return xh({type:"rgb",values:s})}const VN={black:"#000",white:"#fff"},Kp=VN,$N={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},GN=$N,qN={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},Au=qN,WN={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},Cu=WN,ZN={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},cp=ZN,HN={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},Iu=HN,XN={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},ku=XN,KN={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},Mu=KN,YN=["mode","contrastThreshold","tonalOffset"],$T={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:Kp.white,default:Kp.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},av={text:{primary:Kp.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:Kp.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function GT(e,n,l,h){const m=h.light||h,v=h.dark||h*1.5;e[n]||(e.hasOwnProperty(l)?e[n]=e[l]:n==="light"?e.light=PN(e.main,m):n==="dark"&&(e.dark=kN(e.main,v)))}function JN(e="light"){return e==="dark"?{main:Iu[200],light:Iu[50],dark:Iu[400]}:{main:Iu[700],light:Iu[400],dark:Iu[800]}}function QN(e="light"){return e==="dark"?{main:Au[200],light:Au[50],dark:Au[400]}:{main:Au[500],light:Au[300],dark:Au[700]}}function eU(e="light"){return e==="dark"?{main:Cu[500],light:Cu[300],dark:Cu[700]}:{main:Cu[700],light:Cu[400],dark:Cu[800]}}function tU(e="light"){return e==="dark"?{main:ku[400],light:ku[300],dark:ku[700]}:{main:ku[700],light:ku[500],dark:ku[900]}}function nU(e="light"){return e==="dark"?{main:Mu[400],light:Mu[300],dark:Mu[700]}:{main:Mu[800],light:Mu[500],dark:Mu[900]}}function rU(e="light"){return e==="dark"?{main:cp[400],light:cp[300],dark:cp[700]}:{main:"#ed6c02",light:cp[500],dark:cp[900]}}function iU(e){const{mode:n="light",contrastThreshold:l=3,tonalOffset:h=.2}=e,m=pl(e,YN),v=e.primary||JN(n),E=e.secondary||QN(n),s=e.error||eU(n),k=e.info||tU(n),D=e.success||nU(n),V=e.warning||rU(n);function G(me){return MN(me,av.text.primary)>=l?av.text.primary:$T.text.primary}const J=({color:me,name:Ce,mainShade:ie=500,lightShade:te=300,darkShade:le=700})=>{if(me=Bn({},me),!me.main&&me[ie]&&(me.main=me[ie]),!me.hasOwnProperty("main"))throw new Error(Zp(11,Ce?` (${Ce})`:"",ie));if(typeof me.main!="string")throw new Error(Zp(12,Ce?` (${Ce})`:"",JSON.stringify(me.main)));return GT(me,"light",te,h),GT(me,"dark",le,h),me.contrastText||(me.contrastText=G(me.main)),me},ve={dark:av,light:$T};return ea(Bn({common:Bn({},Kp),mode:n,primary:J({color:v,name:"primary"}),secondary:J({color:E,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:J({color:s,name:"error"}),warning:J({color:V,name:"warning"}),info:J({color:k,name:"info"}),success:J({color:D,name:"success"}),grey:GN,contrastThreshold:l,getContrastText:G,augmentColor:J,tonalOffset:h},ve[n]),m)}const oU=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function sU(e){return Math.round(e*1e5)/1e5}const qT={textTransform:"uppercase"},WT='"Roboto", "Helvetica", "Arial", sans-serif';function aU(e,n){const l=typeof n=="function"?n(e):n,{fontFamily:h=WT,fontSize:m=14,fontWeightLight:v=300,fontWeightRegular:E=400,fontWeightMedium:s=500,fontWeightBold:k=700,htmlFontSize:D=16,allVariants:V,pxToRem:G}=l,J=pl(l,oU),ve=m/14,ae=G||(ie=>`${ie/D*ve}rem`),me=(ie,te,le,ze,Oe)=>Bn({fontFamily:h,fontWeight:ie,fontSize:ae(te),lineHeight:le},h===WT?{letterSpacing:`${sU(ze/te)}em`}:{},Oe,V),Ce={h1:me(v,96,1.167,-1.5),h2:me(v,60,1.2,-.5),h3:me(E,48,1.167,0),h4:me(E,34,1.235,.25),h5:me(E,24,1.334,0),h6:me(s,20,1.6,.15),subtitle1:me(E,16,1.75,.15),subtitle2:me(s,14,1.57,.1),body1:me(E,16,1.5,.15),body2:me(E,14,1.43,.15),button:me(s,14,1.75,.4,qT),caption:me(E,12,1.66,.4),overline:me(E,12,2.66,1,qT),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return ea(Bn({htmlFontSize:D,pxToRem:ae,fontFamily:h,fontSize:m,fontWeightLight:v,fontWeightRegular:E,fontWeightMedium:s,fontWeightBold:k},Ce),J,{clone:!1})}const lU=.2,cU=.14,uU=.12;function Un(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${lU})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${cU})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${uU})`].join(",")}const hU=["none",Un(0,2,1,-1,0,1,1,0,0,1,3,0),Un(0,3,1,-2,0,2,2,0,0,1,5,0),Un(0,3,3,-2,0,3,4,0,0,1,8,0),Un(0,2,4,-1,0,4,5,0,0,1,10,0),Un(0,3,5,-1,0,5,8,0,0,1,14,0),Un(0,3,5,-1,0,6,10,0,0,1,18,0),Un(0,4,5,-2,0,7,10,1,0,2,16,1),Un(0,5,5,-3,0,8,10,1,0,3,14,2),Un(0,5,6,-3,0,9,12,1,0,3,16,2),Un(0,6,6,-3,0,10,14,1,0,4,18,3),Un(0,6,7,-4,0,11,15,1,0,4,20,3),Un(0,7,8,-4,0,12,17,2,0,5,22,4),Un(0,7,8,-4,0,13,19,2,0,5,24,4),Un(0,7,9,-4,0,14,21,2,0,5,26,4),Un(0,8,9,-5,0,15,22,2,0,6,28,5),Un(0,8,10,-5,0,16,24,2,0,6,30,5),Un(0,8,11,-5,0,17,26,2,0,6,32,5),Un(0,9,11,-5,0,18,28,2,0,7,34,6),Un(0,9,12,-6,0,19,29,2,0,7,36,6),Un(0,10,13,-6,0,20,31,3,0,8,38,7),Un(0,10,13,-6,0,21,33,3,0,8,40,7),Un(0,10,14,-6,0,22,35,3,0,8,42,7),Un(0,11,14,-7,0,23,36,3,0,9,44,8),Un(0,11,15,-7,0,24,38,3,0,9,46,8)],dU=hU,pU=["duration","easing","delay"],fU={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},mU={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function ZT(e){return`${Math.round(e)}ms`}function gU(e){if(!e)return 0;const n=e/36;return Math.round((4+15*n**.25+n/5)*10)}function _U(e){const n=Bn({},fU,e.easing),l=Bn({},mU,e.duration);return Bn({getAutoHeightDuration:gU,create:(m=["all"],v={})=>{const{duration:E=l.standard,easing:s=n.easeInOut,delay:k=0}=v;return pl(v,pU),(Array.isArray(m)?m:[m]).map(D=>`${D} ${typeof E=="string"?E:ZT(E)} ${s} ${typeof k=="string"?k:ZT(k)}`).join(",")}},e,{easing:n,duration:l})}const yU={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},vU=yU,xU=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function wU(e={},...n){const{mixins:l={},palette:h={},transitions:m={},typography:v={}}=e,E=pl(e,xU);if(e.vars)throw new Error(Zp(18));const s=iU(h),k=cN(e);let D=ea(k,{mixins:SN(k.breakpoints,l),palette:s,shadows:dU.slice(),typography:aU(s,v),transitions:_U(m),zIndex:Bn({},vU)});return D=ea(D,E),D=n.reduce((V,G)=>ea(V,G),D),D.unstable_sxConfig=Bn({},Fx,E==null?void 0:E.unstable_sxConfig),D.unstable_sx=function(G){return ZI({sx:G,theme:this})},D}const bU=["theme"];function EU(e){let{theme:n}=e,l=pl(e,bU);const h=n[RT];return Ka.jsx(TN,Bn({},l,{themeId:h?RT:void 0,theme:h||n}))}var rk={exports:{}};(function(e,n){(function(l,h){e.exports=h()})(Go,function(){var l,h,m;function v(s,k){if(!l)l=k;else if(!h)h=k;else{var D="self.onerror = function() { console.error('An error occurred while parsing the WebWorker bundle. This is most likely due to improper transpilation by Babel; please see https://docs.mapbox.com/mapbox-gl-js/guides/install/#transpiling'); }; var sharedChunk = {}; ("+l+")(sharedChunk); ("+h+")(sharedChunk); self.onerror = null;",V={};l(V),m=k(V),typeof window<"u"&&window&&window.URL&&window.URL.createObjectURL&&(m.workerUrl=window.URL.createObjectURL(new Blob([D],{type:"text/javascript"})))}}v(["exports"],function(s){var k=typeof self<"u"?self:{},D="2.15.0";let V;const G={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){if(V==null){const r=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;try{V={}.API_URL_REGEX!=null?new RegExp({}.API_URL_REGEX):r}catch{V=r}}return V},get API_TILEJSON_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/v[0-9]*\/.*\.json.*$)/i},get API_SPRITE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*\/sprite.*\..*$)/i},get API_FONTS_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/fonts\/v[0-9]*\/)(.*\.pbf.*$)/i},get API_STYLE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*$)/i},get API_CDN_URL_REGEX(){return/^((https?:)?\/\/)?api\.mapbox\.c(n|om)(\/mapbox-gl-js\/)(.*$)/i},get EVENTS_URL(){if(!G.API_URL)return null;try{const r=new URL(G.API_URL);return r.hostname==="api.mapbox.cn"?"https://events.mapbox.cn/events/v2":r.hostname==="api.mapbox.com"?"https://events.mapbox.com/events/v2":null}catch{return null}},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},J={supported:!1,testSupport:function(r){!me&&ae&&(Ce?ie(r):ve=r)}};let ve,ae,me=!1,Ce=!1;function ie(r){const t=r.createTexture();r.bindTexture(r.TEXTURE_2D,t);try{if(r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,ae),r.isContextLost())return;J.supported=!0}catch{}r.deleteTexture(t),me=!0}k.document&&(ae=k.document.createElement("img"),ae.onload=function(){ve&&ie(ve),ve=null,Ce=!0},ae.onerror=function(){me=!0,ve=null},ae.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const te="01";function le(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var ze=Oe;function Oe(r,t,i,a){this.cx=3*r,this.bx=3*(i-r)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(a-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=r,this.p1y=t,this.p2x=i,this.p2y=a}Oe.prototype={sampleCurveX:function(r){return((this.ax*r+this.bx)*r+this.cx)*r},sampleCurveY:function(r){return((this.ay*r+this.by)*r+this.cy)*r},sampleCurveDerivativeX:function(r){return(3*this.ax*r+2*this.bx)*r+this.cx},solveCurveX:function(r,t){if(t===void 0&&(t=1e-6),r<0)return 0;if(r>1)return 1;for(var i=r,a=0;a<8;a++){var u=this.sampleCurveX(i)-r;if(Math.abs(u)u?g=i:y=i,i=.5*(y-g)+g;return i},solve:function(r,t){return this.sampleCurveY(this.solveCurveX(r,t))}};var Ke=le(ze),He=ht;function ht(r,t){this.x=r,this.y=t}ht.prototype={clone:function(){return new ht(this.x,this.y)},add:function(r){return this.clone()._add(r)},sub:function(r){return this.clone()._sub(r)},multByPoint:function(r){return this.clone()._multByPoint(r)},divByPoint:function(r){return this.clone()._divByPoint(r)},mult:function(r){return this.clone()._mult(r)},div:function(r){return this.clone()._div(r)},rotate:function(r){return this.clone()._rotate(r)},rotateAround:function(r,t){return this.clone()._rotateAround(r,t)},matMult:function(r){return this.clone()._matMult(r)},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(r){return this.x===r.x&&this.y===r.y},dist:function(r){return Math.sqrt(this.distSqr(r))},distSqr:function(r){var t=r.x-this.x,i=r.y-this.y;return t*t+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(r){return Math.atan2(this.y-r.y,this.x-r.x)},angleWith:function(r){return this.angleWithSep(r.x,r.y)},angleWithSep:function(r,t){return Math.atan2(this.x*t-this.y*r,this.x*r+this.y*t)},_matMult:function(r){var t=r[2]*this.x+r[3]*this.y;return this.x=r[0]*this.x+r[1]*this.y,this.y=t,this},_add:function(r){return this.x+=r.x,this.y+=r.y,this},_sub:function(r){return this.x-=r.x,this.y-=r.y,this},_mult:function(r){return this.x*=r,this.y*=r,this},_div:function(r){return this.x/=r,this.y/=r,this},_multByPoint:function(r){return this.x*=r.x,this.y*=r.y,this},_divByPoint:function(r){return this.x/=r.x,this.y/=r.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var r=this.y;return this.y=this.x,this.x=-r,this},_rotate:function(r){var t=Math.cos(r),i=Math.sin(r),a=i*this.x+t*this.y;return this.x=t*this.x-i*this.y,this.y=a,this},_rotateAround:function(r,t){var i=Math.cos(r),a=Math.sin(r),u=t.y+a*(this.x-t.x)+i*(this.y-t.y);return this.x=t.x+i*(this.x-t.x)-a*(this.y-t.y),this.y=u,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},ht.convert=function(r){return r instanceof ht?r:Array.isArray(r)?new ht(r[0],r[1]):r};var Ve=le(He);const jt=Math.PI/180,wr=180/Math.PI;function St(r){return r*jt}function Vt(r){return r*wr}const Vr=[[0,0],[1,0],[1,1],[0,1]];function $r(r){if(r<=0)return 0;if(r>=1)return 1;const t=r*r,i=t*r;return 4*(r<.5?i:3*(r-t)+i-.75)}function Li(r,t,i,a){const u=new Ke(r,t,i,a);return function(p){return u.solve(p)}}const Ki=Li(.25,.1,.25,1);function Je(r,t,i){return Math.min(i,Math.max(t,r))}function Tt(r,t,i){return(i=Je((i-r)/(t-r),0,1))*i*(3-2*i)}function xt(r,t,i){const a=i-t,u=((r-t)%a+a)%a+t;return u===t?i:u}function Bt(r,t,i){if(!r.length)return i(null,[]);let a=r.length;const u=new Array(r.length);let p=null;r.forEach((g,y)=>{t(g,(w,b)=>{w&&(p=w),u[y]=b,--a==0&&i(p,u)})})}function dn(r){const t=[];for(const i in r)t.push(r[i]);return t}function vn(r,...t){for(const i of t)for(const a in i)r[a]=i[a];return r}let sr=1;function ii(){return sr++}function ar(){return function r(t){return t?(t^Math.random()*(16>>t/4)).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,r)}()}function br(r){return r<=1?1:Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function Es(r){return!!r&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(r)}function Yi(r,t){r.forEach(i=>{t[i]&&(t[i]=t[i].bind(t))})}function xn(r,t){return r.indexOf(t,r.length-t.length)!==-1}function kt(r,t,i){const a={};for(const u in r)a[u]=t.call(i||this,r[u],u,r);return a}function Yo(r,t,i){const a={};for(const u in r)t.call(i||this,r[u],u,r)&&(a[u]=r[u]);return a}function Dr(r){return Array.isArray(r)?r.map(Dr):typeof r=="object"&&r?kt(r,Dr):r}const Jo={};function wn(r){Jo[r]||(typeof console<"u"&&console.warn(r),Jo[r]=!0)}function pi(r,t,i){return(i.y-r.y)*(t.x-r.x)>(t.y-r.y)*(i.x-r.x)}function Tc(r){let t=0;for(let i,a,u=0,p=r.length,g=p-1;u@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(i,a,u,p)=>{const g=u||p;return t[a]=!g||g.toLowerCase(),""}),t["max-age"]){const i=parseInt(t["max-age"],10);isNaN(i)?delete t["max-age"]:t["max-age"]=i}return t}let fl=null;function aa(r){if(fl==null){const t=r.navigator?r.navigator.userAgent:null;fl=!!r.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return fl}function ml(r){try{const t=k[r];return t.setItem("_mapbox_test_",1),t.removeItem("_mapbox_test_"),!0}catch{return!1}}function Qo(r,t){return[r[4*t],r[4*t+1],r[4*t+2],r[4*t+3]]}const la="mapbox-tiles";let Sc=500,Ac=50,fi,es;function gl(){try{return k.caches}catch{}}function Ts(){gl()&&!fi&&(fi=k.caches.open(la))}function ca(r){const t=r.indexOf("?");if(t<0)return r;const i=function(u){const p=u.indexOf("?");return p>0?u.slice(p+1).split("&"):[]}(r),a=i.filter(u=>{const p=u.split("=");return p[0]==="language"||p[0]==="worldview"});return a.length?`${r.slice(0,t)}?${a.join("&")}`:r.slice(0,t)}let _l=1/0;const Ss={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(Ss);class ts extends Error{constructor(t,i,a){i===401&&be(a)&&(t+=": you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes"),super(t),this.status=i,this.url=a}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}const As=vo()?()=>self.worker&&self.worker.referrer:()=>(k.location.protocol==="blob:"?k.parent:k).location.href,Cs=function(r,t){if(!(/^file:/.test(i=r.url)||/^file:/.test(As())&&!/^\w+:/.test(i))){if(k.fetch&&k.Request&&k.AbortController&&k.Request.prototype.hasOwnProperty("signal"))return function(a,u){const p=new k.AbortController,g=new k.Request(a.url,{method:a.method||"GET",body:a.body,credentials:a.credentials,headers:a.headers,referrer:As(),referrerPolicy:a.referrerPolicy,signal:p.signal});let y=!1,w=!1;const b=(A=g.url).indexOf("sku=")>0&&be(A);var A;a.type==="json"&&g.headers.set("Accept","application/json");const I=(L,R,F)=>{if(w)return;if(L&&L.message!=="SecurityError"&&wn(L.toString()),R&&F)return M(R);const $=Date.now();k.fetch(g).then(K=>{if(K.ok){const se=b?K.clone():null;return M(K,se,$)}return u(new ts(K.statusText,K.status,a.url))}).catch(K=>{K.name!=="AbortError"&&u(new Error(`${K.message} ${a.url}`))})},M=(L,R,F)=>{(a.type==="arrayBuffer"?L.arrayBuffer():a.type==="json"?L.json():L.text()).then($=>{w||(R&&F&&function(K,se,Y){if(Ts(),!fi)return;const re={status:se.status,statusText:se.statusText,headers:new k.Headers};se.headers.forEach((Ie,Te)=>re.headers.set(Te,Ie));const ue=oi(se.headers.get("Cache-Control")||"");if(ue["no-store"])return;ue["max-age"]&&re.headers.set("Expires",new Date(Y+1e3*ue["max-age"]).toUTCString());const ce=re.headers.get("Expires");ce&&(new Date(ce).getTime()-Y<42e4||function(Ie,Te){if(es===void 0)try{new Response(new ReadableStream),es=!0}catch{es=!1}es?Te(Ie.body):Ie.blob().then(Te)}(se,Ie=>{const Te=new k.Response(Ie,re);Ts(),fi&&fi.then(De=>De.put(ca(K.url),Te)).catch(De=>wn(De.message))}))}(g,R,F),y=!0,u(null,$,L.headers.get("Cache-Control"),L.headers.get("Expires")))}).catch($=>{w||u(new Error($.message))})};return b?function(L,R){if(Ts(),!fi)return R(null);const F=ca(L.url);fi.then($=>{$.match(F).then(K=>{const se=function(Y){if(!Y)return!1;const re=new Date(Y.headers.get("Expires")||0),ue=oi(Y.headers.get("Cache-Control")||"");return re>Date.now()&&!ue["no-cache"]}(K);$.delete(F),se&&$.put(F,K.clone()),R(null,K,se)}).catch(R)}).catch(R)}(g,I):I(null,null),{cancel:()=>{w=!0,y||p.abort()}}}(r,t);if(vo()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",r,t,void 0,!0)}var i;return function(a,u){const p=new k.XMLHttpRequest;p.open(a.method||"GET",a.url,!0),a.type==="arrayBuffer"&&(p.responseType="arraybuffer");for(const g in a.headers)p.setRequestHeader(g,a.headers[g]);return a.type==="json"&&(p.responseType="text",p.setRequestHeader("Accept","application/json")),p.withCredentials=a.credentials==="include",p.onerror=()=>{u(new Error(p.statusText))},p.onload=()=>{if((p.status>=200&&p.status<300||p.status===0)&&p.response!==null){let g=p.response;if(a.type==="json")try{g=JSON.parse(p.response)}catch(y){return u(y)}u(null,g,p.getResponseHeader("Cache-Control"),p.getResponseHeader("Expires"))}else u(new ts(p.statusText,p.status,a.url))},p.send(a.body),{cancel:()=>p.abort()}}(r,t)},ua=function(r,t){return Cs(vn(r,{type:"arrayBuffer"}),t)};function Cc(r){const t=k.document.createElement("a");return t.href=r,t.protocol===k.document.location.protocol&&t.host===k.document.location.host}const oe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let N,U;N=[],U=0;const ne=function(r,t){if(J.supported&&(r.headers||(r.headers={}),r.headers.accept="image/webp,*/*"),U>=G.MAX_PARALLEL_IMAGE_REQUESTS){const p={requestParameters:r,callback:t,cancelled:!1,cancel(){this.cancelled=!0}};return N.push(p),p}U++;let i=!1;const a=()=>{if(!i)for(i=!0,U--;N.length&&U{a(),p?t(p):g&&(k.createImageBitmap?function(b,A){const I=new k.Blob([new Uint8Array(b)],{type:"image/png"});k.createImageBitmap(I).then(M=>{A(null,M)}).catch(M=>{A(new Error(`Could not load image because of ${M.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})}(g,(b,A)=>t(b,A,y,w)):function(b,A){const I=new k.Image,M=k.URL;I.onload=()=>{A(null,I),M.revokeObjectURL(I.src),I.onload=null,k.requestAnimationFrame(()=>{I.src=oe})},I.onerror=()=>A(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 L=new k.Blob([new Uint8Array(b)],{type:"image/png"});I.src=b.byteLength?M.createObjectURL(L):oe}(g,(b,A)=>t(b,A,y,w)))});return{cancel:()=>{u.cancel(),a()}}},he="NO_ACCESS_TOKEN";function _e(r){return r.indexOf("mapbox:")===0}function be(r){return G.API_URL_REGEX.test(r)}function we(r){return G.API_CDN_URL_REGEX.test(r)}function ge(r){return G.API_STYLE_REGEX.test(r)&&!Pe(r)}function Pe(r){return G.API_SPRITE_REGEX.test(r)}const nt=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function rt(r){const t=r.match(nt);if(!t)throw new Error("Unable to parse URL object");return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]}}function Qe(r){const t=r.params.length?`?${r.params.join("&")}`:"";return`${r.protocol}://${r.authority}${r.path}${t}`}const Mt="mapbox.eventData";function Rt(r){if(!r)return null;const t=r.split(".");if(!t||t.length!==3)return null;try{return JSON.parse(decodeURIComponent(k.atob(t[1]).split("").map(i=>"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)).join("")))}catch{return null}}class Pt{constructor(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null}getStorageKey(t){const i=Rt(G.ACCESS_TOKEN);let a="";return a=i&&i.u?k.btoa(encodeURIComponent(i.u).replace(/%([0-9A-F]{2})/g,(u,p)=>String.fromCharCode(+("0x"+p)))):G.ACCESS_TOKEN||"",t?`${Mt}.${t}:${a}`:`${Mt}:${a}`}fetchEventData(){const t=ml("localStorage"),i=this.getStorageKey(),a=this.getStorageKey("uuid");if(t)try{const u=k.localStorage.getItem(i);u&&(this.eventData=JSON.parse(u));const p=k.localStorage.getItem(a);p&&(this.anonId=p)}catch{wn("Unable to read from LocalStorage")}}saveEventData(){const t=ml("localStorage"),i=this.getStorageKey(),a=this.getStorageKey("uuid");if(t)try{k.localStorage.setItem(a,this.anonId),Object.keys(this.eventData).length>=1&&k.localStorage.setItem(i,JSON.stringify(this.eventData))}catch{wn("Unable to write to LocalStorage")}}processRequests(t){}postEvent(t,i,a,u){if(!G.EVENTS_URL)return;const p=rt(G.EVENTS_URL);p.params.push(`access_token=${u||G.ACCESS_TOKEN||""}`);const g={event:this.type,created:new Date(t).toISOString()},y=i?vn(g,i):g,w={url:Qe(p),headers:{"Content-Type":"text/plain"},body:JSON.stringify([y])};this.pendingRequest=function(b,A){return Cs(vn(b,{method:"POST"}),A)}(w,b=>{this.pendingRequest=null,a(b),this.saveEventData(),this.processRequests(u)})}queueRequest(t,i){this.queue.push(t),this.processRequests(i)}}const Dt=new class extends Pt{constructor(r){super("appUserTurnstile"),this._customAccessToken=r}postTurnstileEvent(r,t){G.EVENTS_URL&&G.ACCESS_TOKEN&&Array.isArray(r)&&r.some(i=>_e(i)||be(i))&&this.queueRequest(Date.now(),t)}processRequests(r){if(this.pendingRequest||this.queue.length===0)return;this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const t=Rt(G.ACCESS_TOKEN),i=t?t.u:G.ACCESS_TOKEN;let a=i!==this.eventData.tokenU;Es(this.anonId)||(this.anonId=ar(),a=!0);const u=this.queue.shift();if(this.eventData.lastSuccess){const p=new Date(this.eventData.lastSuccess),g=new Date(u),y=(u-this.eventData.lastSuccess)/864e5;a=a||y>=1||y<-1||p.getDate()!==g.getDate()}else a=!0;a?this.postEvent(u,{sdkIdentifier:"mapbox-gl-js",sdkVersion:D,skuId:te,"enabled.telemetry":!1,userId:this.anonId},p=>{p||(this.eventData.lastSuccess=u,this.eventData.tokenU=i)},r):this.processRequests()}},Gt=Dt.postTurnstileEvent.bind(Dt),In=new class extends Pt{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(r,t,i,a){this.skuToken=t,this.errorCb=a,G.EVENTS_URL&&(i||G.ACCESS_TOKEN?this.queueRequest({id:r,timestamp:Date.now()},i):this.errorCb(new Error(he)))}processRequests(r){if(this.pendingRequest||this.queue.length===0)return;const{id:t,timestamp:i}=this.queue.shift();t&&this.success[t]||(this.anonId||this.fetchEventData(),Es(this.anonId)||(this.anonId=ar()),this.postEvent(i,{sdkIdentifier:"mapbox-gl-js",sdkVersion:D,skuId:te,skuToken:this.skuToken,userId:this.anonId},a=>{a?this.errorCb(a):t&&(this.success[t]=!0)},r))}},Vn=In.postMapLoadEvent.bind(In),Ir=new class extends Pt{constructor(){super("gljs.performance")}postPerformanceEvent(r,t){G.EVENTS_URL&&(r||G.ACCESS_TOKEN)&&this.queueRequest({timestamp:Date.now(),performanceData:t},r)}processRequests(r){if(this.pendingRequest||this.queue.length===0)return;const{timestamp:t,performanceData:i}=this.queue.shift(),a=function(u){const p=k.performance.getEntriesByType("resource"),g=k.performance.getEntriesByType("mark"),y=function(M){const L={};if(M){for(const R in M)if(R!=="other")for(const F of M[R]){const $=`${R}ResolveRangeMin`,K=`${R}ResolveRangeMax`,se=`${R}RequestCount`,Y=`${R}RequestCachedCount`;L[$]=Math.min(L[$]||1/0,F.startTime),L[K]=Math.max(L[K]||-1/0,F.responseEnd);const re=ue=>{L[ue]===void 0&&(L[ue]=0),++L[ue]};F.transferSize!==void 0&&F.transferSize===0&&re(Y),re(se)}}return L}(function(M,L){const R={};if(M)for(const F of M){const $=L(F);R[$]===void 0&&(R[$]=[]),R[$].push(F)}return R}(p,lf)),w=k.devicePixelRatio,b=k.navigator.connection||k.navigator.mozConnection||k.navigator.webkitConnection,A={counters:[],metadata:[],attributes:[]},I=(M,L,R)=>{R!=null&&M.push({name:L,value:R.toString()})};for(const M in y)I(A.counters,M,y[M]);if(u.interactionRange[0]!==1/0&&u.interactionRange[1]!==-1/0&&(I(A.counters,"interactionRangeMin",u.interactionRange[0]),I(A.counters,"interactionRangeMax",u.interactionRange[1])),g)for(const M of Object.keys(ha)){const L=ha[M],R=g.find(F=>F.name===L);R&&I(A.counters,L,R.startTime)}return I(A.counters,"visibilityHidden",u.visibilityHidden),I(A.attributes,"style",function(M){if(M)for(const L of M){const R=L.name.split("?")[0];if(ge(R)){const F=R.split("/").slice(-2);if(F.length===2)return`mapbox://styles/${F[0]}/${F[1]}`}}}(p)),I(A.attributes,"terrainEnabled",u.terrainEnabled?"true":"false"),I(A.attributes,"fogEnabled",u.fogEnabled?"true":"false"),I(A.attributes,"projection",u.projection),I(A.attributes,"zoom",u.zoom),I(A.metadata,"devicePixelRatio",w),I(A.metadata,"connectionEffectiveType",b?b.effectiveType:void 0),I(A.metadata,"navigatorUserAgent",k.navigator.userAgent),I(A.metadata,"screenWidth",k.screen.width),I(A.metadata,"screenHeight",k.screen.height),I(A.metadata,"windowWidth",k.innerWidth),I(A.metadata,"windowHeight",k.innerHeight),I(A.metadata,"mapWidth",u.width/w),I(A.metadata,"mapHeight",u.height/w),I(A.metadata,"webglRenderer",u.renderer),I(A.metadata,"webglVendor",u.vendor),I(A.metadata,"sdkVersion",D),I(A.metadata,"sdkIdentifier","mapbox-gl-js"),A}(i);for(const u of a.metadata);for(const u of a.counters);for(const u of a.attributes);this.postEvent(t,a,()=>{},r)}},tr=Ir.postPerformanceEvent.bind(Ir),Ji=new class extends Pt{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(r,t,i,a){if(!G.API_URL||!G.SESSION_PATH)return;const u=rt(G.API_URL+G.SESSION_PATH);u.params.push(`sku=${t||""}`),u.params.push(`access_token=${a||G.ACCESS_TOKEN||""}`);const p={url:Qe(u),headers:{"Content-Type":"text/plain"}};this.pendingRequest=function(g,y){return Cs(vn(g,{method:"GET"}),y)}(p,g=>{this.pendingRequest=null,i(g),this.saveEventData(),this.processRequests(a)})}getSessionAPI(r,t,i,a){this.skuToken=t,this.errorCb=a,G.SESSION_PATH&&G.API_URL&&(i||G.ACCESS_TOKEN?this.queueRequest({id:r,timestamp:Date.now()},i):this.errorCb(new Error(he)))}processRequests(r){if(this.pendingRequest||this.queue.length===0)return;const{id:t,timestamp:i}=this.queue.shift();t&&this.success[t]||this.getSession(i,this.skuToken,a=>{a?this.errorCb(a):t&&(this.success[t]=!0)},r)}},hr=Ji.getSessionAPI.bind(Ji),Or=new Set,ha={create:"create",load:"load",fullLoad:"fullLoad"},G_={mark(r){k.performance.mark(r)},measure(r,t,i){k.performance.measure(r,t,i)}};function lf(r){const t=r.name.split("?")[0];return we(t)&&t.includes("mapbox-gl.js")?"javascript":we(t)&&t.includes("mapbox-gl.css")?"css":function(i){return G.API_FONTS_REGEX.test(i)}(t)?"fontRange":Pe(t)?"sprite":ge(t)?"style":function(i){return G.API_TILEJSON_REGEX.test(i)}(t)?"tilejson":"other"}const Jt=k.performance;function wh(r){const t=r?r.url.toString():void 0;return Jt.getEntriesByName(t)}let yl,bh,Ic,Qi;const xo={now:()=>Ic!==void 0?Ic:k.performance.now(),setNow(r){Ic=r},restoreNow(){Ic=void 0},frame(r){const t=k.requestAnimationFrame(r);return{cancel:()=>k.cancelAnimationFrame(t)}},getImageData(r,t=0){const{width:i,height:a}=r;Qi||(Qi=k.document.createElement("canvas"));const u=Qi.getContext("2d",{willReadFrequently:!0});if(!u)throw new Error("failed to create canvas 2d context");return(i>Qi.width||a>Qi.height)&&(Qi.width=i,Qi.height=a),u.clearRect(-t,-t,i+2*t,a+2*t),u.drawImage(r,0,0,i,a),u.getImageData(-t,-t,i+2*t,a+2*t)},resolveURL:r=>(yl||(yl=k.document.createElement("a")),yl.href=r,yl.href),get devicePixelRatio(){return k.devicePixelRatio},get prefersReducedMotion(){return!!k.matchMedia&&(bh==null&&(bh=k.matchMedia("(prefers-reduced-motion: reduce)")),bh.matches)}};function Eh(r,t,i){i[r]&&i[r].indexOf(t)!==-1||(i[r]=i[r]||[],i[r].push(t))}function Th(r,t,i){if(i&&i[r]){const a=i[r].indexOf(t);a!==-1&&i[r].splice(a,1)}}class Is{constructor(t,i={}){vn(this,i),this.type=t}}class wo extends Is{constructor(t,i={}){super("error",vn({error:t},i))}}class vl{on(t,i){return this._listeners=this._listeners||{},Eh(t,i,this._listeners),this}off(t,i){return Th(t,i,this._listeners),Th(t,i,this._oneTimeListeners),this}once(t,i){return i?(this._oneTimeListeners=this._oneTimeListeners||{},Eh(t,i,this._oneTimeListeners),this):new Promise(a=>this.once(t,a))}fire(t,i){typeof t=="string"&&(t=new Is(t,i||{}));const a=t.type;if(this.listens(a)){t.target=this;const u=this._listeners&&this._listeners[a]?this._listeners[a].slice():[];for(const y of u)y.call(this,t);const p=this._oneTimeListeners&&this._oneTimeListeners[a]?this._oneTimeListeners[a].slice():[];for(const y of p)Th(a,y,this._oneTimeListeners),y.call(this,t);const g=this._eventedParent;g&&(vn(t,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),g.fire(t))}else t instanceof wo&&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,i){return this._eventedParent=t,this._eventedParentData=i,this}}var Re=JSON.parse('{"$version":8,"$root":{"version":{"required":true,"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"},"terrain":{"type":"terrain"},"fog":{"type":"fog"},"sources":{"required":true,"type":"sources"},"sprite":{"type":"string"},"glyphs":{"type":"string"},"transition":{"type":"transition"},"projection":{"type":"projection"},"layers":{"required":true,"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":true,"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":{}},"default":"xyz"},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"attribution":{"type":"string"},"promoteId":{"type":"promoteId"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster":{"type":{"required":true,"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":false},"*":{"type":"*"}},"source_raster_dem":{"type":{"required":true,"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":{}},"default":"mapbox"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_geojson":{"type":{"required":true,"type":"enum","values":{"geojson":{}}},"data":{"type":"*"},"maxzoom":{"type":"number","default":18},"attribution":{"type":"string"},"buffer":{"type":"number","default":128,"maximum":512,"minimum":0},"filter":{"type":"*"},"tolerance":{"type":"number","default":0.375},"cluster":{"type":"boolean","default":false},"clusterRadius":{"type":"number","default":50,"minimum":0},"clusterMaxZoom":{"type":"number"},"clusterMinPoints":{"type":"number"},"clusterProperties":{"type":"*"},"lineMetrics":{"type":"boolean","default":false},"generateId":{"type":"boolean","default":false},"promoteId":{"type":"promoteId"}},"source_video":{"type":{"required":true,"type":"enum","values":{"video":{}}},"urls":{"required":true,"type":"array","value":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_image":{"type":{"required":true,"type":"enum","values":{"image":{}}},"url":{"required":true,"type":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"layer":{"id":{"type":"string","required":true},"type":{"type":"enum","values":{"fill":{},"line":{},"symbol":{},"circle":{},"heatmap":{},"fill-extrusion":{},"raster":{},"hillshade":{},"background":{},"sky":{}},"required":true},"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_sky"],"layout_background":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_sky":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_fill":{"fill-sort-key":{"type":"number","expression":{"interpolated":false,"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":false,"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"},"fill-extrusion-edge-radius":{"type":"number","private":true,"default":0,"minimum":0,"maximum":1,"property-type":"constant"}},"layout_line":{"line-cap":{"type":"enum","values":{"butt":{},"round":{},"square":{}},"default":"butt","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-join":{"type":"enum","values":{"bevel":{},"round":{},"miter":{}},"default":"miter","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{"type":"number","default":2,"requires":[{"line-join":"miter"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-round-limit":{"type":"number","default":1.05,"requires":[{"line-join":"round"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-sort-key":{"type":"number","expression":{"interpolated":false,"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":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-spacing":{"type":"number","default":250,"minimum":1,"units":"pixels","requires":[{"symbol-placement":"line"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{"type":"boolean","default":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{"type":"enum","values":{"auto":{},"viewport-y":{},"source":{}},"default":"auto","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{"type":"boolean","default":false,"requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{"type":"boolean","default":false,"requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-optional":{"type":"boolean","default":false,"requires":["icon-image","text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"],"expression":{"interpolated":false,"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":true,"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":false,"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":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-image":{"type":"resolvedImage","tokens":true,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{"type":"number","default":0,"period":360,"units":"degrees","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{"type":"boolean","default":false,"requires":["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-offset":{"type":"array","value":"number","length":2,"default":[0,0],"requires":["icon-image"],"expression":{"interpolated":true,"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":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-field":{"type":"formatted","default":"","tokens":true,"expression":{"interpolated":false,"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":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size":{"type":"number","default":16,"minimum":0,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{"type":"number","default":10,"minimum":0,"units":"ems","requires":["text-field",{"symbol-placement":["point"]}],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{"type":"number","default":1.2,"units":"ems","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{"type":"number","default":0,"units":"ems","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-justify":{"type":"enum","values":{"auto":{},"left":{},"center":{},"right":{}},"default":"center","requires":["text-field"],"expression":{"interpolated":false,"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":true,"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":false,"parameters":["zoom"]},"property-type":"data-constant"},"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":false,"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":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-writing-mode":{"type":"array","value":"enum","values":{"horizontal":{},"vertical":{}},"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotate":{"type":"number","default":0,"period":360,"units":"degrees","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-keep-upright":{"type":"boolean","default":true,"requires":["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-transform":{"type":"enum","values":{"none":{},"uppercase":{},"lowercase":{}},"default":"none","requires":["text-field"],"expression":{"interpolated":false,"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":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{"type":"boolean","default":false,"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{"type":"boolean","default":false,"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-optional":{"type":"boolean","default":false,"requires":["text-field","icon-image"],"expression":{"interpolated":false,"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_symbol":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature","pitch","distance-from-center"]}},"filter_fill":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_line":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_circle":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_fill-extrusion":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_heatmap":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_operator":{"type":"enum","values":{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},"in":{},"!in":{},"all":{},"any":{},"none":{},"has":{},"!has":{},"within":{}}},"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":false}},"function_stop":{"type":"array","minimum":0,"maximum":24,"value":["number","color"],"length":2},"expression":{"type":"array","value":"*","minimum":1},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"high-color":{"type":"color","property-type":"data-constant","default":"#245cdf","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"space-color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"horizon-blend":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,0.2,7,0.1],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"star-intensity":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],5,0.35,6,0],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":{},"viewport":{}},"property-type":"data-constant","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"projection":{"name":{"type":"enum","values":{"albers":{},"equalEarth":{},"equirectangular":{},"lambertConformalConic":{},"mercator":{},"naturalEarth":{},"winkelTripel":{},"globe":{}},"default":"mercator","required":true},"center":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-180,-90],"maximum":[180,90],"transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]},"parallels":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-90,-90],"maximum":[90,90],"transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]}},"terrain":{"source":{"type":"string","required":true},"exaggeration":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1000,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"requires":["source"]}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"fill-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{"type":"color","transition":true,"requires":[{"!":"fill-pattern"},{"fill-antialias":true}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["fill-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"fill-extrusion-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["fill-extrusion-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"units":"meters","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"units":"meters","transition":true,"requires":["fill-extrusion-height"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant","type":"number","private":true,"default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant","type":"number","private":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"requires":["fill-extrusion-edge-radius"]},"fill-extrusion-rounded-roof":{"type":"boolean","default":true,"requires":["fill-extrusion-edge-radius"],"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_line":{"line-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"line-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["line-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"line-width":{"type":"number","default":1,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{"type":"array","value":"number","minimum":0,"transition":false,"units":"line widths","requires":[{"!":"line-pattern"}],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{"type":"color","transition":false,"requires":[{"!":"line-pattern"},{"source":"geojson","has":{"lineMetrics":true}}],"expression":{"interpolated":true,"parameters":["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{"type":"array","value":"number","length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"transition":false,"requires":[{"source":"geojson","has":{"lineMetrics":true}}],"property-type":"constant"}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["circle-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{}},"default":"viewport","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"transition":false,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"heatmap-color":{"type":"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"transition":false,"expression":{"interpolated":true,"parameters":["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_symbol":{"icon-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{"type":"color","default":"#000000","transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["icon-image","icon-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{"type":"color","default":"#000000","transition":true,"overridable":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["text-field","text-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_raster":{"raster-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{"type":"number","default":0,"period":360,"transition":true,"units":"degrees","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-resampling":{"type":"enum","values":{"linear":{},"nearest":{}},"default":"linear","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"transition":false,"units":"milliseconds","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"transition":false,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"viewport","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{"type":"number","default":0.5,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_background":{"background-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"background-pattern"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":{},"atmosphere":{}},"default":"atmosphere","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"requires":[{"sky-type":"atmosphere"}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{"type":"number","requires":[{"sky-type":"atmosphere"}],"default":10,"minimum":0,"maximum":100,"transition":false,"property-type":"data-constant"},"sky-gradient-center":{"type":"array","requires":[{"sky-type":"gradient"}],"value":"number","default":[0,0],"length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{"type":"number","requires":[{"sky-type":"gradient"}],"default":90,"minimum":0,"maximum":180,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"transition":false,"requires":[{"sky-type":"gradient"}],"expression":{"interpolated":true,"parameters":["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-atmosphere-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"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"},"color-ramp":{"type":"property-type"},"data-constant":{"type":"property-type"},"constant":{"type":"property-type"}},"promoteId":{"*":{"type":"string"}}}');function bo(r,...t){for(const i of t)for(const a in i)r[a]=i[a];return r}function $n(r){return r instanceof Number||r instanceof String||r instanceof Boolean?r.valueOf():r}function dr(r){if(Array.isArray(r))return r.map(dr);if(r instanceof Object&&!(r instanceof Number||r instanceof String||r instanceof Boolean)){const t={};for(const i in r)t[i]=dr(r[i]);return t}return $n(r)}class cf extends Error{constructor(t,i){super(i),this.message=i,this.key=t}}var eo=cf;class Sh{constructor(t,i=[]){this.parent=t,this.bindings={};for(const[a,u]of i)this.bindings[a]=u}concat(t){return new Sh(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)}}var uf=Sh;const da={kind:"null"},lt={kind:"number"},$t={kind:"string"},Ft={kind:"boolean"},si={kind:"color"},Ri={kind:"object"},Nt={kind:"value"},ai={kind:"collator"},xl={kind:"formatted"},ks={kind:"resolvedImage"};function mi(r,t){return{kind:"array",itemType:r,N:t}}function Sn(r){if(r.kind==="array"){const t=Sn(r.itemType);return typeof r.N=="number"?`array<${t}, ${r.N}>`:r.itemType.kind==="value"?"array":`array<${t}>`}return r.kind}const hf=[da,lt,$t,Ft,si,xl,Ri,mi(Nt),ks];function Eo(r,t){if(t.kind==="error")return null;if(r.kind==="array"){if(t.kind==="array"&&(t.N===0&&t.itemType.kind==="value"||!Eo(r.itemType,t.itemType))&&(typeof r.N!="number"||r.N===t.N))return null}else{if(r.kind===t.kind)return null;if(r.kind==="value"){for(const i of hf)if(!Eo(i,t))return null}}return`Expected ${Sn(r)} but found ${Sn(t)} instead.`}function wl(r,t){return t.some(i=>i.kind===r.kind)}function bl(r,t){return t.some(i=>i==="null"?r===null:i==="array"?Array.isArray(r):i==="object"?r&&!Array.isArray(r)&&typeof r=="object":i===typeof r)}var Ah,df={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function El(r){return(r=Math.round(r))<0?0:r>255?255:r}function Tl(r){return El(r[r.length-1]==="%"?parseFloat(r)/100*255:parseInt(r))}function kc(r){return(t=r[r.length-1]==="%"?parseFloat(r)/100:parseFloat(r))<0?0:t>1?1:t;var t}function pa(r,t,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?r+(t-r)*i*6:2*i<1?t:3*i<2?r+(t-r)*(2/3-i)*6:r}try{Ah={}.parseCSSColor=function(r){var t,i=r.replace(/ /g,"").toLowerCase();if(i in df)return df[i].slice();if(i[0]==="#")return i.length===4?(t=parseInt(i.substr(1),16))>=0&&t<=4095?[(3840&t)>>4|(3840&t)>>8,240&t|(240&t)>>4,15&t|(15&t)<<4,1]:null:i.length===7&&(t=parseInt(i.substr(1),16))>=0&&t<=16777215?[(16711680&t)>>16,(65280&t)>>8,255&t,1]:null;var a=i.indexOf("("),u=i.indexOf(")");if(a!==-1&&u+1===i.length){var p=i.substr(0,a),g=i.substr(a+1,u-(a+1)).split(","),y=1;switch(p){case"rgba":if(g.length!==4)return null;y=kc(g.pop());case"rgb":return g.length!==3?null:[Tl(g[0]),Tl(g[1]),Tl(g[2]),y];case"hsla":if(g.length!==4)return null;y=kc(g.pop());case"hsl":if(g.length!==3)return null;var w=(parseFloat(g[0])%360+360)%360/360,b=kc(g[1]),A=kc(g[2]),I=A<=.5?A*(b+1):A+b-A*b,M=2*A-I;return[El(255*pa(M,I,w+1/3)),El(255*pa(M,I,w)),El(255*pa(M,I,w-1/3)),y];default:return null}}return null}}catch{}class Gr{constructor(t,i,a,u=1){this.r=t,this.g=i,this.b=a,this.a=u}static parse(t){if(!t)return;if(t instanceof Gr)return t;if(typeof t!="string")return;const i=Ah(t);return i?new Gr(i[0]/255*i[3],i[1]/255*i[3],i[2]/255*i[3],i[3]):void 0}toString(){const[t,i,a,u]=this.toArray();return`rgba(${Math.round(t)},${Math.round(i)},${Math.round(a)},${u})`}toArray(){const{r:t,g:i,b:a,a:u}=this;return u===0?[0,0,0,0]:[255*t/u,255*i/u,255*a/u,u]}toArray01(){const{r:t,g:i,b:a,a:u}=this;return u===0?[0,0,0,0]:[t/u,i/u,a/u,u]}toArray01PremultipliedAlpha(){const{r:t,g:i,b:a,a:u}=this;return[t,i,a,u]}}Gr.black=new Gr(0,0,0,1),Gr.white=new Gr(1,1,1,1),Gr.transparent=new Gr(0,0,0,0),Gr.red=new Gr(1,0,0,1),Gr.blue=new Gr(0,0,1,1);var Fn=Gr;class Ch{constructor(t,i,a){this.sensitivity=t?i?"variant":"case":i?"accent":"base",this.locale=a,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,i){return this.collator.compare(t,i)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Ih{constructor(t,i,a,u,p){this.text=t.normalize?t.normalize():t,this.image=i,this.scale=a,this.fontStack=u,this.textColor=p}}class qr{constructor(t){this.sections=t}static fromString(t){return new qr([new Ih(t,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(t=>t.text.length!==0||t.image&&t.image.name.length!==0)}static factory(t){return t instanceof qr?t:qr.fromString(t)}toString(){return this.sections.length===0?"":this.sections.map(t=>t.text).join("")}serialize(){const t=["format"];for(const i of this.sections){if(i.image){t.push(["image",i.image.name]);continue}t.push(i.text);const a={};i.fontStack&&(a["text-font"]=["literal",i.fontStack.split(",")]),i.scale&&(a["font-scale"]=i.scale),i.textColor&&(a["text-color"]=["rgba"].concat(i.textColor.toArray())),t.push(a)}return t}}class gi{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new gi({name:t,available:!1}):null}serialize(){return["image",this.name]}}function pf(r,t,i,a){return typeof r=="number"&&r>=0&&r<=255&&typeof t=="number"&&t>=0&&t<=255&&typeof i=="number"&&i>=0&&i<=255?a===void 0||typeof a=="number"&&a>=0&&a<=1?null:`Invalid rgba value [${[r,t,i,a].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof a=="number"?[r,t,i,a]:[r,t,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Sl(r){if(r===null||typeof r=="string"||typeof r=="boolean"||typeof r=="number"||r instanceof Fn||r instanceof Ch||r instanceof qr||r instanceof gi)return!0;if(Array.isArray(r)){for(const t of r)if(!Sl(t))return!1;return!0}if(typeof r=="object"){for(const t in r)if(!Sl(r[t]))return!1;return!0}return!1}function Ln(r){if(r===null)return da;if(typeof r=="string")return $t;if(typeof r=="boolean")return Ft;if(typeof r=="number")return lt;if(r instanceof Fn)return si;if(r instanceof Ch)return ai;if(r instanceof qr)return xl;if(r instanceof gi)return ks;if(Array.isArray(r)){const t=r.length;let i;for(const a of r){const u=Ln(a);if(i){if(i===u)continue;i=Nt;break}i=u}return mi(i||Nt,t)}return Ri}function Al(r){const t=typeof r;return r===null?"":t==="string"||t==="number"||t==="boolean"?String(r):r instanceof Fn||r instanceof qr||r instanceof gi?r.toString():JSON.stringify(r)}class kh{constructor(t,i){this.type=t,this.value=i}static parse(t,i){if(t.length!==2)return i.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!Sl(t[1]))return i.error("invalid value");const a=t[1];let u=Ln(a);const p=i.expectedType;return u.kind!=="array"||u.N!==0||!p||p.kind!=="array"||typeof p.N=="number"&&p.N!==0||(u=p),new kh(u,a)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof Fn?["rgba"].concat(this.value.toArray()):this.value instanceof qr?this.value.serialize():this.value}}var Ms=kh,Er=class{constructor(r){this.name="ExpressionEvaluationError",this.message=r}toJSON(){return this.message}};const Mh={string:$t,number:lt,boolean:Ft,object:Ri};class Ph{constructor(t,i){this.type=t,this.args=i}static parse(t,i){if(t.length<2)return i.error("Expected at least one argument.");let a,u=1;const p=t[0];if(p==="array"){let y,w;if(t.length>2){const b=t[1];if(typeof b!="string"||!(b in Mh)||b==="object")return i.error('The item type argument of "array" must be one of string, number, boolean',1);y=Mh[b],u++}else y=Nt;if(t.length>3){if(t[2]!==null&&(typeof t[2]!="number"||t[2]<0||t[2]!==Math.floor(t[2])))return i.error('The length argument to "array" must be a positive integer literal',2);w=t[2],u++}a=mi(y,w)}else a=Mh[p];const g=[];for(;ut.outputDefined())}serialize(){const t=this.type,i=[t.kind];if(t.kind==="array"){const a=t.itemType;if(a.kind==="string"||a.kind==="number"||a.kind==="boolean"){i.push(a.kind);const u=t.N;(typeof u=="number"||this.args.length>1)&&i.push(u)}}return i.concat(this.args.map(a=>a.serialize()))}}var To=Ph;class ns{constructor(t){this.type=xl,this.sections=t}static parse(t,i){if(t.length<2)return i.error("Expected at least one argument.");const a=t[1];if(!Array.isArray(a)&&typeof a=="object")return i.error("First argument must be an image or text section.");const u=[];let p=!1;for(let g=1;g<=t.length-1;++g){const y=t[g];if(p&&typeof y=="object"&&!Array.isArray(y)){p=!1;let w=null;if(y["font-scale"]&&(w=i.parse(y["font-scale"],1,lt),!w))return null;let b=null;if(y["text-font"]&&(b=i.parse(y["text-font"],1,mi($t)),!b))return null;let A=null;if(y["text-color"]&&(A=i.parse(y["text-color"],1,si),!A))return null;const I=u[u.length-1];I.scale=w,I.font=b,I.textColor=A}else{const w=i.parse(t[g],1,Nt);if(!w)return null;const b=w.type.kind;if(b!=="string"&&b!=="value"&&b!=="null"&&b!=="resolvedImage")return i.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");p=!0,u.push({content:w,scale:null,font:null,textColor:null})}}return new ns(u)}evaluate(t){return new qr(this.sections.map(i=>{const a=i.content.evaluate(t);return Ln(a)===ks?new Ih("",a,null,null,null):new Ih(Al(a),null,i.scale?i.scale.evaluate(t):null,i.font?i.font.evaluate(t).join(","):null,i.textColor?i.textColor.evaluate(t):null)}))}eachChild(t){for(const i of this.sections)t(i.content),i.scale&&t(i.scale),i.font&&t(i.font),i.textColor&&t(i.textColor)}outputDefined(){return!1}serialize(){const t=["format"];for(const i of this.sections){t.push(i.content.serialize());const a={};i.scale&&(a["font-scale"]=i.scale.serialize()),i.font&&(a["text-font"]=i.font.serialize()),i.textColor&&(a["text-color"]=i.textColor.serialize()),t.push(a)}return t}}class Mc{constructor(t){this.type=ks,this.input=t}static parse(t,i){if(t.length!==2)return i.error("Expected two arguments.");const a=i.parse(t[1],1,$t);return a?new Mc(a):i.error("No image name provided.")}evaluate(t){const i=this.input.evaluate(t),a=gi.fromString(i);return a&&t.availableImages&&(a.available=t.availableImages.indexOf(i)>-1),a}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const q_={"to-boolean":Ft,"to-color":si,"to-number":lt,"to-string":$t};class zh{constructor(t,i){this.type=t,this.args=i}static parse(t,i){if(t.length<2)return i.error("Expected at least one argument.");const a=t[0];if((a==="to-boolean"||a==="to-string")&&t.length!==2)return i.error("Expected one argument.");const u=q_[a],p=[];for(let g=1;g4?`Invalid rbga value ${JSON.stringify(i)}: expected an array containing either three or four numeric values.`:pf(i[0],i[1],i[2],i[3]),!a))return new Fn(i[0]/255,i[1]/255,i[2]/255,i[3])}throw new Er(a||`Could not parse color from value '${typeof i=="string"?i:String(JSON.stringify(i))}'`)}if(this.type.kind==="number"){let i=null;for(const a of this.args){if(i=a.evaluate(t),i===null)return 0;const u=Number(i);if(!isNaN(u))return u}throw new Er(`Could not convert ${JSON.stringify(i)} to number.`)}return this.type.kind==="formatted"?qr.fromString(Al(this.args[0].evaluate(t))):this.type.kind==="resolvedImage"?gi.fromString(Al(this.args[0].evaluate(t))):Al(this.args[0].evaluate(t))}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}serialize(){if(this.type.kind==="formatted")return new ns([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new Mc(this.args[0]).serialize();const t=[`to-${this.type.kind}`];return this.eachChild(i=>{t.push(i.serialize())}),t}}var fa=zh;const to=["Unknown","Point","LineString","Polygon"];var Lh=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null}id(){return this.feature&&this.feature.id!==void 0?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?to[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||{}}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const r=this.featureDistanceData.center,t=this.featureDistanceData.scale,{x:i,y:a}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(i*t-r[0])+this.featureDistanceData.bearing[1]*(a*t-r[1])}return 0}parseColor(r){let t=this._parseColorCache[r];return t||(t=this._parseColorCache[r]=Fn.parse(r)),t}};class Ps{constructor(t,i,a,u){this.name=t,this.type=i,this._evaluate=a,this.args=u}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map(t=>t.serialize()))}static parse(t,i){const a=t[0],u=Ps.definitions[a];if(!u)return i.error(`Unknown expression "${a}". If you wanted a literal array, use ["literal", [...]].`,0);const p=Array.isArray(u)?u[0]:u.type,g=Array.isArray(u)?[[u[1],u[2]]]:u.overloads,y=g.filter(([b])=>!Array.isArray(b)||b.length===t.length-1);let w=null;for(const[b,A]of y){w=new Nh(i.registry,i.path,null,i.scope);const I=[];let M=!1;for(let L=1;L{return M=I,Array.isArray(M)?`(${M.map(Sn).join(", ")})`:`(${Sn(M.type)}...)`;var M}).join(" | "),A=[];for(let I=1;I=t[2]||r[1]<=t[1]||r[3]>=t[3])}function Il(r,t){const i=(180+r[0])/360,a=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r[1]*Math.PI/360)))/360,u=Math.pow(2,t.z);return[Math.round(i*u*Ao),Math.round(a*u*Ao)]}function ff(r,t,i){const a=r[0]-t[0],u=r[1]-t[1],p=r[0]-i[0],g=r[1]-i[1];return a*g-p*u==0&&a*p<=0&&u*g<=0}function zc(r,t){let i=!1;for(let g=0,y=t.length;g(a=r)[1]!=(p=w[b+1])[1]>a[1]&&a[0]<(p[0]-u[0])*(a[1]-u[1])/(p[1]-u[1])+u[0]&&(i=!i)}}var a,u,p;return i}function Rh(r,t){for(let i=0;i0&&y<0||g<0&&y>0}function ga(r,t,i){for(const b of i)for(let A=0;Ai[2]){const u=.5*a;let p=r[0]-i[0]>u?-a:i[0]-r[0]>u?a:0;p===0&&(p=r[0]-i[2]>u?-a:i[2]-r[0]>u?a:0),r[0]+=p}Pc(t,r)}function gf(r,t,i,a){const u=Math.pow(2,a.z)*Ao,p=[a.x*Ao,a.y*Ao],g=[];if(!r)return g;for(const y of r)for(const w of y){const b=[w.x+p[0],w.y+p[1]];Bh(b,t,i,u),g.push(b)}return g}function Fh(r,t,i,a){const u=Math.pow(2,a.z)*Ao,p=[a.x*Ao,a.y*Ao],g=[];if(!r)return g;for(const w of r){const b=[];for(const A of w){const I=[A.x+p[0],A.y+p[1]];Pc(t,I),b.push(I)}g.push(b)}if(t[2]-t[0]<=u/2){(y=t)[0]=y[1]=1/0,y[2]=y[3]=-1/0;for(const w of g)for(const b of w)Bh(b,t,i,u)}var y;return g}class _a{constructor(t,i){this.type=Ft,this.geojson=t,this.geometries=i}static parse(t,i){if(t.length!==2)return i.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Sl(t[1])){const a=t[1];if(a.type==="FeatureCollection")for(let u=0;u{t&&!ya(i)&&(t=!1)}),t}function Co(r){if(r instanceof So&&r.name==="feature-state")return!1;let t=!0;return r.eachChild(i=>{t&&!Co(i)&&(t=!1)}),t}function zs(r,t){if(r instanceof So&&t.indexOf(r.name)>=0)return!1;let i=!0;return r.eachChild(a=>{i&&!zs(a,t)&&(i=!1)}),i}class Rc{constructor(t,i){this.type=i.type,this.name=t,this.boundExpression=i}static parse(t,i){if(t.length!==2||typeof t[1]!="string")return i.error("'var' expression requires exactly one string literal argument.");const a=t[1];return i.scope.has(a)?new Rc(a,i.scope.get(a)):i.error(`Unknown variable "${a}". Make sure "${a}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}var _f=Rc;class kl{constructor(t,i=[],a,u=new uf,p=[]){this.registry=t,this.path=i,this.key=i.map(g=>`[${g}]`).join(""),this.scope=u,this.errors=p,this.expectedType=a}parse(t,i,a,u,p={}){return i?this.concat(i,a,u)._parse(t,p):this._parse(t,p)}_parse(t,i){function a(u,p,g){return g==="assert"?new To(p,[u]):g==="coerce"?new fa(p,[u]):u}if(t!==null&&typeof t!="string"&&typeof t!="boolean"&&typeof t!="number"||(t=["literal",t]),Array.isArray(t)){if(t.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const u=t[0];if(typeof u!="string")return this.error(`Expression name must be a string, but found ${typeof u} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const p=this.registry[u];if(p){let g=p.parse(t,this);if(!g)return null;if(this.expectedType){const y=this.expectedType,w=g.type;if(y.kind!=="string"&&y.kind!=="number"&&y.kind!=="boolean"&&y.kind!=="object"&&y.kind!=="array"||w.kind!=="value")if(y.kind!=="color"&&y.kind!=="formatted"&&y.kind!=="resolvedImage"||w.kind!=="value"&&w.kind!=="string"){if(this.checkSubtype(y,w))return null}else g=a(g,y,i.typeAnnotation||"coerce");else g=a(g,y,i.typeAnnotation||"assert")}if(!(g instanceof Ms)&&g.type.kind!=="resolvedImage"&&Uh(g)){const y=new Lh;try{g=new Ms(g.type,g.evaluate(y))}catch(w){return this.error(w.message),null}}return g}return this.error(`Unknown expression "${u}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(t===void 0?"'undefined' value invalid. Use null instead.":typeof t=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof t} instead.`)}concat(t,i,a){const u=typeof t=="number"?this.path.concat(t):this.path,p=a?this.scope.concat(a):this.scope;return new kl(this.registry,u,i||null,p,this.errors)}error(t,...i){const a=`${this.key}${i.map(u=>`[${u}]`).join("")}`;this.errors.push(new eo(a,t))}checkSubtype(t,i){const a=Eo(t,i);return a&&this.error(a),a}}var Nh=kl;function Uh(r){if(r instanceof _f)return Uh(r.boundExpression);if(r instanceof So&&r.name==="error"||r instanceof Cl||r instanceof Lc)return!1;const t=r instanceof fa||r instanceof To;let i=!0;return r.eachChild(a=>{i=t?i&&Uh(a):i&&a instanceof Ms}),!!i&&ya(r)&&zs(r,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"])}function Dc(r,t){const i=r.length-1;let a,u,p=0,g=i,y=0;for(;p<=g;)if(y=Math.floor((p+g)/2),a=r[y],u=r[y+1],a<=t){if(y===i||tt))throw new Er("Input is not a number.");g=y-1}return 0}class Oc{constructor(t,i,a){this.type=t,this.input=i,this.labels=[],this.outputs=[];for(const[u,p]of a)this.labels.push(u),this.outputs.push(p)}static parse(t,i){if(t.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return i.error("Expected an even number of arguments.");const a=i.parse(t[1],1,lt);if(!a)return null;const u=[];let p=null;i.expectedType&&i.expectedType.kind!=="value"&&(p=i.expectedType);for(let g=1;g=y)return i.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',b);const I=i.parse(w,A,p);if(!I)return null;p=p||I.type,u.push([y,I])}return new Oc(p,a,u)}evaluate(t){const i=this.labels,a=this.outputs;if(i.length===1)return a[0].evaluate(t);const u=this.input.evaluate(t);if(u<=i[0])return a[0].evaluate(t);const p=i.length;return u>=i[p-1]?a[p-1].evaluate(t):a[Dc(i,u)].evaluate(t)}eachChild(t){t(this.input);for(const i of this.outputs)t(i)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}serialize(){const t=["step",this.input.serialize()];for(let i=0;i0&&t.push(this.labels[i]),t.push(this.outputs[i].serialize());return t}}var jh=Oc;function Wt(r,t,i){return r*(1-i)+t*i}var Ml=Object.freeze({__proto__:null,array:function(r,t,i){return r.map((a,u)=>Wt(a,t[u],i))},color:function(r,t,i){return new Fn(Wt(r.r,t.r,i),Wt(r.g,t.g,i),Wt(r.b,t.b,i),Wt(r.a,t.a,i))},number:Wt});const yf=.95047,Vh=1.08883,vf=4/29,Ls=6/29,$h=3*Ls*Ls,Z_=Ls*Ls*Ls,H_=Math.PI/180,X_=180/Math.PI;function Gh(r){return r>Z_?Math.pow(r,1/3):r/$h+vf}function qh(r){return r>Ls?r*r*r:$h*(r-vf)}function Wh(r){return 255*(r<=.0031308?12.92*r:1.055*Math.pow(r,1/2.4)-.055)}function Bc(r){return(r/=255)<=.04045?r/12.92:Math.pow((r+.055)/1.055,2.4)}function xf(r){const t=Bc(r.r),i=Bc(r.g),a=Bc(r.b),u=Gh((.4124564*t+.3575761*i+.1804375*a)/yf),p=Gh((.2126729*t+.7151522*i+.072175*a)/1);return{l:116*p-16,a:500*(u-p),b:200*(p-Gh((.0193339*t+.119192*i+.9503041*a)/Vh)),alpha:r.a}}function wf(r){let t=(r.l+16)/116,i=isNaN(r.a)?t:t+r.a/500,a=isNaN(r.b)?t:t-r.b/200;return t=1*qh(t),i=yf*qh(i),a=Vh*qh(a),new Fn(Wh(3.2404542*i-1.5371385*t-.4985314*a),Wh(-.969266*i+1.8760108*t+.041556*a),Wh(.0556434*i-.2040259*t+1.0572252*a),r.alpha)}function K_(r,t,i){const a=t-r;return r+i*(a>180||a<-180?a-360*Math.round(a/360):a)}const Pl={forward:xf,reverse:wf,interpolate:function(r,t,i){return{l:Wt(r.l,t.l,i),a:Wt(r.a,t.a,i),b:Wt(r.b,t.b,i),alpha:Wt(r.alpha,t.alpha,i)}}},va={forward:function(r){const{l:t,a:i,b:a}=xf(r),u=Math.atan2(a,i)*X_;return{h:u<0?u+360:u,c:Math.sqrt(i*i+a*a),l:t,alpha:r.a}},reverse:function(r){const t=r.h*H_,i=r.c;return wf({l:r.l,a:Math.cos(t)*i,b:Math.sin(t)*i,alpha:r.alpha})},interpolate:function(r,t,i){return{h:K_(r.h,t.h,i),c:Wt(r.c,t.c,i),l:Wt(r.l,t.l,i),alpha:Wt(r.alpha,t.alpha,i)}}};var Zh=Object.freeze({__proto__:null,hcl:va,lab:Pl});class zl{constructor(t,i,a,u,p){this.type=t,this.operator=i,this.interpolation=a,this.input=u,this.labels=[],this.outputs=[];for(const[g,y]of p)this.labels.push(g),this.outputs.push(y)}static interpolationFactor(t,i,a,u){let p=0;if(t.name==="exponential")p=Hh(i,t.base,a,u);else if(t.name==="linear")p=Hh(i,1,a,u);else if(t.name==="cubic-bezier"){const g=t.controlPoints;p=new Ke(g[0],g[1],g[2],g[3]).solve(Hh(i,1,a,u))}return p}static parse(t,i){let[a,u,p,...g]=t;if(!Array.isArray(u)||u.length===0)return i.error("Expected an interpolation type expression.",1);if(u[0]==="linear")u={name:"linear"};else if(u[0]==="exponential"){const b=u[1];if(typeof b!="number")return i.error("Exponential interpolation requires a numeric base.",1,1);u={name:"exponential",base:b}}else{if(u[0]!=="cubic-bezier")return i.error(`Unknown interpolation type ${String(u[0])}`,1,0);{const b=u.slice(1);if(b.length!==4||b.some(A=>typeof A!="number"||A<0||A>1))return i.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);u={name:"cubic-bezier",controlPoints:b}}}if(t.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return i.error("Expected an even number of arguments.");if(p=i.parse(p,2,lt),!p)return null;const y=[];let w=null;a==="interpolate-hcl"||a==="interpolate-lab"?w=si:i.expectedType&&i.expectedType.kind!=="value"&&(w=i.expectedType);for(let b=0;b=A)return i.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',M);const R=i.parse(I,L,w);if(!R)return null;w=w||R.type,y.push([A,R])}return w.kind==="number"||w.kind==="color"||w.kind==="array"&&w.itemType.kind==="number"&&typeof w.N=="number"?new zl(w,a,u,p,y):i.error(`Type ${Sn(w)} is not interpolatable.`)}evaluate(t){const i=this.labels,a=this.outputs;if(i.length===1)return a[0].evaluate(t);const u=this.input.evaluate(t);if(u<=i[0])return a[0].evaluate(t);const p=i.length;if(u>=i[p-1])return a[p-1].evaluate(t);const g=Dc(i,u),y=zl.interpolationFactor(this.interpolation,u,i[g],i[g+1]),w=a[g].evaluate(t),b=a[g+1].evaluate(t);return this.operator==="interpolate"?Ml[this.type.kind.toLowerCase()](w,b,y):this.operator==="interpolate-hcl"?va.reverse(va.interpolate(va.forward(w),va.forward(b),y)):Pl.reverse(Pl.interpolate(Pl.forward(w),Pl.forward(b),y))}eachChild(t){t(this.input);for(const i of this.outputs)t(i)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}serialize(){let t;t=this.interpolation.name==="linear"?["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const i=[this.operator,t,this.input.serialize()];for(let a=0;aEo(u,y.type));return new Fc(g?Nt:a,p)}evaluate(t){let i,a=null,u=0;for(const p of this.args){if(u++,a=p.evaluate(t),a&&a instanceof gi&&!a.available&&(i||(i=a),a=null,u===this.args.length))return i;if(a!==null)break}return a}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}serialize(){const t=["coalesce"];return this.eachChild(i=>{t.push(i.serialize())}),t}}var Xh=Fc;class Nc{constructor(t,i){this.type=i.type,this.bindings=[].concat(t),this.result=i}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const i of this.bindings)t(i[1]);t(this.result)}static parse(t,i){if(t.length<4)return i.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const a=[];for(let p=1;p=a.length)throw new Er(`Array index out of bounds: ${i} > ${a.length-1}.`);if(i!==Math.floor(i))throw new Er(`Array index must be an integer, but found ${i} instead.`);return a[i]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}var Y_=Kh;class Yh{constructor(t,i){this.type=Ft,this.needle=t,this.haystack=i}static parse(t,i){if(t.length!==3)return i.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const a=i.parse(t[1],1,Nt),u=i.parse(t[2],2,Nt);return a&&u?wl(a.type,[Ft,$t,lt,da,Nt])?new Yh(a,u):i.error(`Expected first argument to be of type boolean, string, number or null, but found ${Sn(a.type)} instead`):null}evaluate(t){const i=this.needle.evaluate(t),a=this.haystack.evaluate(t);if(a==null)return!1;if(!bl(i,["boolean","string","number","null"]))throw new Er(`Expected first argument to be of type boolean, string, number or null, but found ${Sn(Ln(i))} instead.`);if(!bl(a,["string","array"]))throw new Er(`Expected second argument to be of type array or string, but found ${Sn(Ln(a))} instead.`);return a.indexOf(i)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}var Uc=Yh;class Ll{constructor(t,i,a){this.type=lt,this.needle=t,this.haystack=i,this.fromIndex=a}static parse(t,i){if(t.length<=2||t.length>=5)return i.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const a=i.parse(t[1],1,Nt),u=i.parse(t[2],2,Nt);if(!a||!u)return null;if(!wl(a.type,[Ft,$t,lt,da,Nt]))return i.error(`Expected first argument to be of type boolean, string, number or null, but found ${Sn(a.type)} instead`);if(t.length===4){const p=i.parse(t[3],3,lt);return p?new Ll(a,u,p):null}return new Ll(a,u)}evaluate(t){const i=this.needle.evaluate(t),a=this.haystack.evaluate(t);if(!bl(i,["boolean","string","number","null"]))throw new Er(`Expected first argument to be of type boolean, string, number or null, but found ${Sn(Ln(i))} instead.`);if(!bl(a,["string","array"]))throw new Er(`Expected second argument to be of type array or string, but found ${Sn(Ln(a))} instead.`);if(this.fromIndex){const u=this.fromIndex.evaluate(t);return a.indexOf(i,u)}return a.indexOf(i)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}serialize(){if(this.fromIndex!=null&&this.fromIndex!==void 0){const t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}var Ef=Ll;class Jh{constructor(t,i,a,u,p,g){this.inputType=t,this.type=i,this.input=a,this.cases=u,this.outputs=p,this.otherwise=g}static parse(t,i){if(t.length<5)return i.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return i.error("Expected an even number of arguments.");let a,u;i.expectedType&&i.expectedType.kind!=="value"&&(u=i.expectedType);const p={},g=[];for(let b=2;bNumber.MAX_SAFE_INTEGER)return M.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof R=="number"&&Math.floor(R)!==R)return M.error("Numeric branch labels must be integer values.");if(a){if(M.checkSubtype(a,Ln(R)))return null}else a=Ln(R);if(p[String(R)]!==void 0)return M.error("Branch labels must be unique.");p[String(R)]=g.length}const L=i.parse(I,b,u);if(!L)return null;u=u||L.type,g.push(L)}const y=i.parse(t[1],1,Nt);if(!y)return null;const w=i.parse(t[t.length-1],t.length-1,u);return w?y.type.kind!=="value"&&i.concat(1).checkSubtype(a,y.type)?null:new Jh(a,u,y,p,g,w):null}evaluate(t){const i=this.input.evaluate(t);return(Ln(i)===this.inputType&&this.outputs[this.cases[i]]||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()}serialize(){const t=["match",this.input.serialize()],i=Object.keys(this.cases).sort(),a=[],u={};for(const g of i){const y=u[this.cases[g]];y===void 0?(u[this.cases[g]]=a.length,a.push([this.cases[g],[g]])):a[y][1].push(g)}const p=g=>this.inputType.kind==="number"?Number(g):g;for(const[g,y]of a)t.push(y.length===1?p(y[0]):y.map(p)),t.push(this.outputs[g].serialize());return t.push(this.otherwise.serialize()),t}}var J_=Jh;class Qh{constructor(t,i,a){this.type=t,this.branches=i,this.otherwise=a}static parse(t,i){if(t.length<4)return i.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return i.error("Expected an odd number of arguments.");let a;i.expectedType&&i.expectedType.kind!=="value"&&(a=i.expectedType);const u=[];for(let g=1;gi.outputDefined())&&this.otherwise.outputDefined()}serialize(){const t=["case"];return this.eachChild(i=>{t.push(i.serialize())}),t}}var Tf=Qh;class Rl{constructor(t,i,a,u){this.type=t,this.input=i,this.beginIndex=a,this.endIndex=u}static parse(t,i){if(t.length<=2||t.length>=5)return i.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const a=i.parse(t[1],1,Nt),u=i.parse(t[2],2,lt);if(!a||!u)return null;if(!wl(a.type,[mi(Nt),$t,Nt]))return i.error(`Expected first argument to be of type array or string, but found ${Sn(a.type)} instead`);if(t.length===4){const p=i.parse(t[3],3,lt);return p?new Rl(a.type,a,u,p):null}return new Rl(a.type,a,u)}evaluate(t){const i=this.input.evaluate(t),a=this.beginIndex.evaluate(t);if(!bl(i,["string","array"]))throw new Er(`Expected first argument to be of type array or string, but found ${Sn(Ln(i))} instead.`);if(this.endIndex){const u=this.endIndex.evaluate(t);return i.slice(a,u)}return i.slice(a)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}serialize(){if(this.endIndex!=null&&this.endIndex!==void 0){const t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}var Sf=Rl;function jc(r,t){return r==="=="||r==="!="?t.kind==="boolean"||t.kind==="string"||t.kind==="number"||t.kind==="null"||t.kind==="value":t.kind==="string"||t.kind==="number"||t.kind==="value"}function Af(r,t,i,a){return a.compare(t,i)===0}function xa(r,t,i){const a=r!=="=="&&r!=="!=";return class ik{constructor(p,g,y){this.type=Ft,this.lhs=p,this.rhs=g,this.collator=y,this.hasUntypedArgument=p.type.kind==="value"||g.type.kind==="value"}static parse(p,g){if(p.length!==3&&p.length!==4)return g.error("Expected two or three arguments.");const y=p[0];let w=g.parse(p[1],1,Nt);if(!w)return null;if(!jc(y,w.type))return g.concat(1).error(`"${y}" comparisons are not supported for type '${Sn(w.type)}'.`);let b=g.parse(p[2],2,Nt);if(!b)return null;if(!jc(y,b.type))return g.concat(2).error(`"${y}" comparisons are not supported for type '${Sn(b.type)}'.`);if(w.type.kind!==b.type.kind&&w.type.kind!=="value"&&b.type.kind!=="value")return g.error(`Cannot compare types '${Sn(w.type)}' and '${Sn(b.type)}'.`);a&&(w.type.kind==="value"&&b.type.kind!=="value"?w=new To(b.type,[w]):w.type.kind!=="value"&&b.type.kind==="value"&&(b=new To(w.type,[b])));let A=null;if(p.length===4){if(w.type.kind!=="string"&&b.type.kind!=="string"&&w.type.kind!=="value"&&b.type.kind!=="value")return g.error("Cannot use collator to compare non-string types.");if(A=g.parse(p[3],3,ai),!A)return null}return new ik(w,b,A)}evaluate(p){const g=this.lhs.evaluate(p),y=this.rhs.evaluate(p);if(a&&this.hasUntypedArgument){const w=Ln(g),b=Ln(y);if(w.kind!==b.kind||w.kind!=="string"&&w.kind!=="number")throw new Er(`Expected arguments for "${r}" to be (string, string) or (number, number), but found (${w.kind}, ${b.kind}) instead.`)}if(this.collator&&!a&&this.hasUntypedArgument){const w=Ln(g),b=Ln(y);if(w.kind!=="string"||b.kind!=="string")return t(p,g,y)}return this.collator?i(p,g,y,this.collator.evaluate(p)):t(p,g,y)}eachChild(p){p(this.lhs),p(this.rhs),this.collator&&p(this.collator)}outputDefined(){return!0}serialize(){const p=[r];return this.eachChild(g=>{p.push(g.serialize())}),p}}}const Q_=xa("==",function(r,t,i){return t===i},Af),ey=xa("!=",function(r,t,i){return t!==i},function(r,t,i,a){return!Af(0,t,i,a)}),ty=xa("<",function(r,t,i){return t",function(r,t,i){return t>i},function(r,t,i,a){return a.compare(t,i)>0}),ry=xa("<=",function(r,t,i){return t<=i},function(r,t,i,a){return a.compare(t,i)<=0}),Cf=xa(">=",function(r,t,i){return t>=i},function(r,t,i,a){return a.compare(t,i)>=0});class Vc{constructor(t,i,a,u,p,g){this.type=$t,this.number=t,this.locale=i,this.currency=a,this.unit=u,this.minFractionDigits=p,this.maxFractionDigits=g}static parse(t,i){if(t.length!==3)return i.error("Expected two arguments.");const a=i.parse(t[1],1,lt);if(!a)return null;const u=t[2];if(typeof u!="object"||Array.isArray(u))return i.error("NumberFormat options argument must be an object.");let p=null;if(u.locale&&(p=i.parse(u.locale,1,$t),!p))return null;let g=null;if(u.currency&&(g=i.parse(u.currency,1,$t),!g))return null;let y=null;if(u.unit&&(y=i.parse(u.unit,1,$t),!y))return null;let w=null;if(u["min-fraction-digits"]&&(w=i.parse(u["min-fraction-digits"],1,lt),!w))return null;let b=null;return u["max-fraction-digits"]&&(b=i.parse(u["max-fraction-digits"],1,lt),!b)?null:new Vc(a,p,g,y,w,b)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(t):void 0,unit:this.unit?this.unit.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.unit&&t(this.unit),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.unit&&(t.unit=this.unit.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]}}class wa{constructor(t){this.type=lt,this.input=t}static parse(t,i){if(t.length!==2)return i.error(`Expected 1 argument, but found ${t.length-1} instead.`);const a=i.parse(t[1],1);return a?a.type.kind!=="array"&&a.type.kind!=="string"&&a.type.kind!=="value"?i.error(`Expected argument of type string or array, but found ${Sn(a.type)} instead.`):new wa(a):null}evaluate(t){const i=this.input.evaluate(t);if(typeof i=="string"||Array.isArray(i))return i.length;throw new Er(`Expected value to be of type string or array, but found ${Sn(Ln(i))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){const t=["length"];return this.eachChild(i=>{t.push(i.serialize())}),t}}const If={"==":Q_,"!=":ey,">":ny,"<":ty,">=":Cf,"<=":ry,array:To,at:Y_,boolean:To,case:Tf,coalesce:Xh,collator:Cl,format:ns,image:Mc,in:Uc,"index-of":Ef,interpolate:no,"interpolate-hcl":no,"interpolate-lab":no,length:wa,let:bf,literal:Ms,match:J_,number:To,"number-format":Vc,object:To,slice:Sf,step:jh,string:To,"to-boolean":fa,"to-color":fa,"to-number":fa,"to-string":fa,var:_f,within:Lc};function kf(r,[t,i,a,u]){t=t.evaluate(r),i=i.evaluate(r),a=a.evaluate(r);const p=u?u.evaluate(r):1,g=pf(t,i,a,p);if(g)throw new Er(g);return new Fn(t/255*p,i/255*p,a/255*p,p)}function Io(r,t){return r in t}function $c(r,t){const i=t[r];return i===void 0?null:i}function _i(r){return{type:r}}So.register(If,{error:[{kind:"error"},[$t],(r,[t])=>{throw new Er(t.evaluate(r))}],typeof:[$t,[Nt],(r,[t])=>Sn(Ln(t.evaluate(r)))],"to-rgba":[mi(lt,4),[si],(r,[t])=>t.evaluate(r).toArray()],rgb:[si,[lt,lt,lt],kf],rgba:[si,[lt,lt,lt,lt],kf],has:{type:Ft,overloads:[[[$t],(r,[t])=>Io(t.evaluate(r),r.properties())],[[$t,Ri],(r,[t,i])=>Io(t.evaluate(r),i.evaluate(r))]]},get:{type:Nt,overloads:[[[$t],(r,[t])=>$c(t.evaluate(r),r.properties())],[[$t,Ri],(r,[t,i])=>$c(t.evaluate(r),i.evaluate(r))]]},"feature-state":[Nt,[$t],(r,[t])=>$c(t.evaluate(r),r.featureState||{})],properties:[Ri,[],r=>r.properties()],"geometry-type":[$t,[],r=>r.geometryType()],id:[Nt,[],r=>r.id()],zoom:[lt,[],r=>r.globals.zoom],pitch:[lt,[],r=>r.globals.pitch||0],"distance-from-center":[lt,[],r=>r.distanceFromCenter()],"heatmap-density":[lt,[],r=>r.globals.heatmapDensity||0],"line-progress":[lt,[],r=>r.globals.lineProgress||0],"sky-radial-progress":[lt,[],r=>r.globals.skyRadialProgress||0],accumulated:[Nt,[],r=>r.globals.accumulated===void 0?null:r.globals.accumulated],"+":[lt,_i(lt),(r,t)=>{let i=0;for(const a of t)i+=a.evaluate(r);return i}],"*":[lt,_i(lt),(r,t)=>{let i=1;for(const a of t)i*=a.evaluate(r);return i}],"-":{type:lt,overloads:[[[lt,lt],(r,[t,i])=>t.evaluate(r)-i.evaluate(r)],[[lt],(r,[t])=>-t.evaluate(r)]]},"/":[lt,[lt,lt],(r,[t,i])=>t.evaluate(r)/i.evaluate(r)],"%":[lt,[lt,lt],(r,[t,i])=>t.evaluate(r)%i.evaluate(r)],ln2:[lt,[],()=>Math.LN2],pi:[lt,[],()=>Math.PI],e:[lt,[],()=>Math.E],"^":[lt,[lt,lt],(r,[t,i])=>Math.pow(t.evaluate(r),i.evaluate(r))],sqrt:[lt,[lt],(r,[t])=>Math.sqrt(t.evaluate(r))],log10:[lt,[lt],(r,[t])=>Math.log(t.evaluate(r))/Math.LN10],ln:[lt,[lt],(r,[t])=>Math.log(t.evaluate(r))],log2:[lt,[lt],(r,[t])=>Math.log(t.evaluate(r))/Math.LN2],sin:[lt,[lt],(r,[t])=>Math.sin(t.evaluate(r))],cos:[lt,[lt],(r,[t])=>Math.cos(t.evaluate(r))],tan:[lt,[lt],(r,[t])=>Math.tan(t.evaluate(r))],asin:[lt,[lt],(r,[t])=>Math.asin(t.evaluate(r))],acos:[lt,[lt],(r,[t])=>Math.acos(t.evaluate(r))],atan:[lt,[lt],(r,[t])=>Math.atan(t.evaluate(r))],min:[lt,_i(lt),(r,t)=>Math.min(...t.map(i=>i.evaluate(r)))],max:[lt,_i(lt),(r,t)=>Math.max(...t.map(i=>i.evaluate(r)))],abs:[lt,[lt],(r,[t])=>Math.abs(t.evaluate(r))],round:[lt,[lt],(r,[t])=>{const i=t.evaluate(r);return i<0?-Math.round(-i):Math.round(i)}],floor:[lt,[lt],(r,[t])=>Math.floor(t.evaluate(r))],ceil:[lt,[lt],(r,[t])=>Math.ceil(t.evaluate(r))],"filter-==":[Ft,[$t,Nt],(r,[t,i])=>r.properties()[t.value]===i.value],"filter-id-==":[Ft,[Nt],(r,[t])=>r.id()===t.value],"filter-type-==":[Ft,[$t],(r,[t])=>r.geometryType()===t.value],"filter-<":[Ft,[$t,Nt],(r,[t,i])=>{const a=r.properties()[t.value],u=i.value;return typeof a==typeof u&&a{const i=r.id(),a=t.value;return typeof i==typeof a&&i":[Ft,[$t,Nt],(r,[t,i])=>{const a=r.properties()[t.value],u=i.value;return typeof a==typeof u&&a>u}],"filter-id->":[Ft,[Nt],(r,[t])=>{const i=r.id(),a=t.value;return typeof i==typeof a&&i>a}],"filter-<=":[Ft,[$t,Nt],(r,[t,i])=>{const a=r.properties()[t.value],u=i.value;return typeof a==typeof u&&a<=u}],"filter-id-<=":[Ft,[Nt],(r,[t])=>{const i=r.id(),a=t.value;return typeof i==typeof a&&i<=a}],"filter->=":[Ft,[$t,Nt],(r,[t,i])=>{const a=r.properties()[t.value],u=i.value;return typeof a==typeof u&&a>=u}],"filter-id->=":[Ft,[Nt],(r,[t])=>{const i=r.id(),a=t.value;return typeof i==typeof a&&i>=a}],"filter-has":[Ft,[Nt],(r,[t])=>t.value in r.properties()],"filter-has-id":[Ft,[],r=>r.id()!==null&&r.id()!==void 0],"filter-type-in":[Ft,[mi($t)],(r,[t])=>t.value.indexOf(r.geometryType())>=0],"filter-id-in":[Ft,[mi(Nt)],(r,[t])=>t.value.indexOf(r.id())>=0],"filter-in-small":[Ft,[$t,mi(Nt)],(r,[t,i])=>i.value.indexOf(r.properties()[t.value])>=0],"filter-in-large":[Ft,[$t,mi(Nt)],(r,[t,i])=>function(a,u,p,g){for(;p<=g;){const y=p+g>>1;if(u[y]===a)return!0;u[y]>a?g=y-1:p=y+1}return!1}(r.properties()[t.value],i.value,0,i.value.length-1)],all:{type:Ft,overloads:[[[Ft,Ft],(r,[t,i])=>t.evaluate(r)&&i.evaluate(r)],[_i(Ft),(r,t)=>{for(const i of t)if(!i.evaluate(r))return!1;return!0}]]},any:{type:Ft,overloads:[[[Ft,Ft],(r,[t,i])=>t.evaluate(r)||i.evaluate(r)],[_i(Ft),(r,t)=>{for(const i of t)if(i.evaluate(r))return!0;return!1}]]},"!":[Ft,[Ft],(r,[t])=>!t.evaluate(r)],"is-supported-script":[Ft,[$t],(r,[t])=>{const i=r.globals&&r.globals.isSupportedScript;return!i||i(t.evaluate(r))}],upcase:[$t,[$t],(r,[t])=>t.evaluate(r).toUpperCase()],downcase:[$t,[$t],(r,[t])=>t.evaluate(r).toLowerCase()],concat:[$t,_i(Nt),(r,t)=>t.map(i=>Al(i.evaluate(r))).join("")],"resolved-locale":[$t,[ai],(r,[t])=>t.evaluate(r).resolvedLocale()]});var Dl=If;function Mf(r){return{result:"success",value:r}}function Rs(r){return{result:"error",value:r}}function ba(r){return r["property-type"]==="data-driven"}function Gc(r){return!!r.expression&&r.expression.parameters.indexOf("zoom")>-1}function qc(r){return!!r.expression&&r.expression.interpolated}function Zt(r){return r instanceof Number?"number":r instanceof String?"string":r instanceof Boolean?"boolean":Array.isArray(r)?"array":r===null?"null":typeof r}function Ol(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}function Pf(r){return r}function Wc(r,t){const i=t.type==="color",a=r.stops&&typeof r.stops[0][0]=="object",u=a||!(a||r.property!==void 0),p=r.type||(qc(t)?"exponential":"interval");if(i&&((r=bo({},r)).stops&&(r.stops=r.stops.map(b=>[b[0],Fn.parse(b[1])])),r.default=Fn.parse(r.default?r.default:t.default)),r.colorSpace&&r.colorSpace!=="rgb"&&!Zh[r.colorSpace])throw new Error(`Unknown color space: ${r.colorSpace}`);let g,y,w;if(p==="exponential")g=ko;else if(p==="interval")g=Zc;else if(p==="categorical"){g=zf,y=Object.create(null);for(const b of r.stops)y[b[0]]=b[1];w=typeof r.stops[0][0]}else{if(p!=="identity")throw new Error(`Unknown function type "${p}"`);g=Lf}if(a){const b={},A=[];for(let L=0;LL[0]),evaluate:({zoom:L},R)=>ko({stops:I,base:r.base},t,L).evaluate(L,R)}}if(u){const b=p==="exponential"?{name:"exponential",base:r.base!==void 0?r.base:1}:null;return{kind:"camera",interpolationType:b,interpolationFactor:no.interpolationFactor.bind(void 0,b),zoomStops:r.stops.map(A=>A[0]),evaluate:({zoom:A})=>g(r,t,A,y,w)}}return{kind:"source",evaluate(b,A){const I=A&&A.properties?A.properties[r.property]:void 0;return I===void 0?Ea(r.default,t.default):g(r,t,I,y,w)}}}function Ea(r,t,i){return r!==void 0?r:t!==void 0?t:i!==void 0?i:void 0}function zf(r,t,i,a,u){return Ea(typeof i===u?a[i]:void 0,r.default,t.default)}function Zc(r,t,i){if(Zt(i)!=="number")return Ea(r.default,t.default);const a=r.stops.length;if(a===1||i<=r.stops[0][0])return r.stops[0][1];if(i>=r.stops[a-1][0])return r.stops[a-1][1];const u=Dc(r.stops.map(p=>p[0]),i);return r.stops[u][1]}function ko(r,t,i){const a=r.base!==void 0?r.base:1;if(Zt(i)!=="number")return Ea(r.default,t.default);const u=r.stops.length;if(u===1||i<=r.stops[0][0])return r.stops[0][1];if(i>=r.stops[u-1][0])return r.stops[u-1][1];const p=Dc(r.stops.map(A=>A[0]),i),g=function(A,I,M,L){const R=L-M,F=A-M;return R===0?0:I===1?F/R:(Math.pow(I,F)-1)/(Math.pow(I,R)-1)}(i,a,r.stops[p][0],r.stops[p+1][0]),y=r.stops[p][1],w=r.stops[p+1][1];let b=Ml[t.type]||Pf;if(r.colorSpace&&r.colorSpace!=="rgb"){const A=Zh[r.colorSpace];b=(I,M)=>A.reverse(A.interpolate(A.forward(I),A.forward(M),g))}return typeof y.evaluate=="function"?{evaluate(...A){const I=y.evaluate.apply(void 0,A),M=w.evaluate.apply(void 0,A);if(I!==void 0&&M!==void 0)return b(I,M,g)}}:b(y,w,g)}function Lf(r,t,i){return t.type==="color"?i=Fn.parse(i):t.type==="formatted"?i=qr.fromString(i.toString()):t.type==="resolvedImage"?i=gi.fromString(i.toString()):Zt(i)===t.type||t.type==="enum"&&t.values[i]||(i=void 0),Ea(i,r.default,t.default)}class Hc{constructor(t,i){this.expression=t,this._warningHistory={},this._evaluator=new Lh,this._defaultValue=i?function(a){return a.type==="color"&&(Ol(a.default)||Array.isArray(a.default))?new Fn(0,0,0,0):a.type==="color"?Fn.parse(a.default)||null:a.default===void 0?null:a.default}(i):null,this._enumValues=i&&i.type==="enum"?i.values:null}evaluateWithoutErrorHandling(t,i,a,u,p,g,y,w){return this._evaluator.globals=t,this._evaluator.feature=i,this._evaluator.featureState=a,this._evaluator.canonical=u||null,this._evaluator.availableImages=p||null,this._evaluator.formattedSection=g,this._evaluator.featureTileCoord=y||null,this._evaluator.featureDistanceData=w||null,this.expression.evaluate(this._evaluator)}evaluate(t,i,a,u,p,g,y,w){this._evaluator.globals=t,this._evaluator.feature=i||null,this._evaluator.featureState=a||null,this._evaluator.canonical=u||null,this._evaluator.availableImages=p||null,this._evaluator.formattedSection=g||null,this._evaluator.featureTileCoord=y||null,this._evaluator.featureDistanceData=w||null;try{const b=this.expression.evaluate(this._evaluator);if(b==null||typeof b=="number"&&b!=b)return this._defaultValue;if(this._enumValues&&!(b in this._enumValues))throw new Er(`Expected value to be one of ${Object.keys(this._enumValues).map(A=>JSON.stringify(A)).join(", ")}, but found ${JSON.stringify(b)} instead.`);return b}catch(b){return this._warningHistory[b.message]||(this._warningHistory[b.message]=!0,typeof console<"u"&&console.warn(b.message)),this._defaultValue}}}function Ta(r){return Array.isArray(r)&&r.length>0&&typeof r[0]=="string"&&r[0]in Dl}function Sa(r,t){const i=new Nh(Dl,[],t?function(u){const p={color:si,string:$t,number:lt,enum:$t,boolean:Ft,formatted:xl,resolvedImage:ks};return u.type==="array"?mi(p[u.value]||Nt,u.length):p[u.type]}(t):void 0),a=i.parse(r,void 0,void 0,void 0,t&&t.type==="string"?{typeAnnotation:"coerce"}:void 0);return a?Mf(new Hc(a,t)):Rs(i.errors)}class ed{constructor(t,i){this.kind=t,this._styleExpression=i,this.isStateDependent=t!=="constant"&&!Co(i.expression)}evaluateWithoutErrorHandling(t,i,a,u,p,g){return this._styleExpression.evaluateWithoutErrorHandling(t,i,a,u,p,g)}evaluate(t,i,a,u,p,g){return this._styleExpression.evaluate(t,i,a,u,p,g)}}class Bl{constructor(t,i,a,u){this.kind=t,this.zoomStops=a,this._styleExpression=i,this.isStateDependent=t!=="camera"&&!Co(i.expression),this.interpolationType=u}evaluateWithoutErrorHandling(t,i,a,u,p,g){return this._styleExpression.evaluateWithoutErrorHandling(t,i,a,u,p,g)}evaluate(t,i,a,u,p,g){return this._styleExpression.evaluate(t,i,a,u,p,g)}interpolationFactor(t,i,a){return this.interpolationType?no.interpolationFactor(this.interpolationType,t,i,a):0}}function Fl(r,t){if((r=Sa(r,t)).result==="error")return r;const i=r.value.expression,a=ya(i);if(!a&&!ba(t))return Rs([new eo("","data expressions not supported")]);const u=zs(i,["zoom","pitch","distance-from-center"]);if(!u&&!Gc(t))return Rs([new eo("","zoom expressions not supported")]);const p=Kc(i);return p||u?p instanceof eo?Rs([p]):p instanceof no&&!qc(t)?Rs([new eo("",'"interpolate" expressions cannot be used with this property')]):Mf(p?new Bl(a?"camera":"composite",r.value,p.labels,p instanceof no?p.interpolation:void 0):new ed(a?"constant":"source",r.value)):Rs([new eo("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Xc{constructor(t,i){this._parameters=t,this._specification=i,bo(this,Wc(this._parameters,this._specification))}static deserialize(t){return new Xc(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function Kc(r){let t=null;if(r instanceof bf)t=Kc(r.result);else if(r instanceof Xh){for(const i of r.args)if(t=Kc(i),t)break}else(r instanceof jh||r instanceof no)&&r.input instanceof So&&r.input.name==="zoom"&&(t=r);return t instanceof eo||r.eachChild(i=>{const a=Kc(i);a instanceof eo?t=a:!t&&a?t=new eo("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&a&&t!==a&&(t=new eo("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),t}class ct{constructor(t,i,a,u){this.message=(t?`${t}: `:"")+a,u&&(this.identifier=u),i!=null&&i.__line__&&(this.line=i.__line__)}}function Di(r){const t=r.key,i=r.value,a=r.valueSpec||{},u=r.objectElementValidators||{},p=r.style,g=r.styleSpec;let y=[];const w=Zt(i);if(w!=="object")return[new ct(t,i,`object expected, ${w} found`)];for(const b in i){const A=b.split(".")[0];let I;u[A]?I=u[A]:a[A]?I=kr:u["*"]?I=u["*"]:a["*"]&&(I=kr),I?y=y.concat(I({key:(t&&`${t}.`)+b,value:i[b],valueSpec:a[A]||a["*"],style:p,styleSpec:g,object:i,objectKey:b},i)):y.push(new ct(t,i[b],`unknown property "${b}"`))}for(const b in a)u[b]||a[b].required&&a[b].default===void 0&&i[b]===void 0&&y.push(new ct(t,i,`missing required property "${b}"`));return y}function Rf(r){const t=r.value,i=r.valueSpec,a=r.style,u=r.styleSpec,p=r.key,g=r.arrayElementValidator||kr;if(Zt(t)!=="array")return[new ct(p,t,`array expected, ${Zt(t)} found`)];if(i.length&&t.length!==i.length)return[new ct(p,t,`array length ${i.length} expected, length ${t.length} found`)];if(i["min-length"]&&t.lengthp)return[new ct(t,i,`${i} is greater than the maximum value ${p}`)]}return[]}function Ul(r){const t=r.valueSpec,i=$n(r.value.type);let a,u,p,g={};const y=i!=="categorical"&&r.value.property===void 0,w=!y,b=Zt(r.value.stops)==="array"&&Zt(r.value.stops[0])==="array"&&Zt(r.value.stops[0][0])==="object",A=Di({key:r.key,value:r.value,valueSpec:r.styleSpec.function,style:r.style,styleSpec:r.styleSpec,objectElementValidators:{stops:function(L){if(i==="identity")return[new ct(L.key,L.value,'identity function may not have a "stops" property')];let R=[];const F=L.value;return R=R.concat(Rf({key:L.key,value:F,valueSpec:L.valueSpec,style:L.style,styleSpec:L.styleSpec,arrayElementValidator:I})),Zt(F)==="array"&&F.length===0&&R.push(new ct(L.key,F,"array must have at least one stop")),R},default:function(L){return kr({key:L.key,value:L.value,valueSpec:t,style:L.style,styleSpec:L.styleSpec})}}});return i==="identity"&&y&&A.push(new ct(r.key,r.value,'missing required property "property"')),i==="identity"||r.value.stops||A.push(new ct(r.key,r.value,'missing required property "stops"')),i==="exponential"&&r.valueSpec.expression&&!qc(r.valueSpec)&&A.push(new ct(r.key,r.value,"exponential functions not supported")),r.styleSpec.$version>=8&&(w&&!ba(r.valueSpec)?A.push(new ct(r.key,r.value,"property functions not supported")):y&&!Gc(r.valueSpec)&&A.push(new ct(r.key,r.value,"zoom functions not supported"))),i!=="categorical"&&!b||r.value.property!==void 0||A.push(new ct(r.key,r.value,'"property" property is required')),A;function I(L){let R=[];const F=L.value,$=L.key;if(Zt(F)!=="array")return[new ct($,F,`array expected, ${Zt(F)} found`)];if(F.length!==2)return[new ct($,F,`array length 2 expected, length ${F.length} found`)];if(b){if(Zt(F[0])!=="object")return[new ct($,F,`object expected, ${Zt(F[0])} found`)];if(F[0].zoom===void 0)return[new ct($,F,"object stop key must have zoom")];if(F[0].value===void 0)return[new ct($,F,"object stop key must have value")];const K=$n(F[0].zoom);if(typeof K!="number")return[new ct($,F[0].zoom,"stop zoom values must be numbers")];if(p&&p>K)return[new ct($,F[0].zoom,"stop zoom values must appear in ascending order")];K!==p&&(p=K,u=void 0,g={}),R=R.concat(Di({key:`${$}[0]`,value:F[0],valueSpec:{zoom:{}},style:L.style,styleSpec:L.styleSpec,objectElementValidators:{zoom:Nl,value:M}}))}else R=R.concat(M({key:`${$}[0]`,value:F[0],valueSpec:{},style:L.style,styleSpec:L.styleSpec},F));return Ta(dr(F[1]))?R.concat([new ct(`${$}[1]`,F[1],"expressions are not allowed in function stops.")]):R.concat(kr({key:`${$}[1]`,value:F[1],valueSpec:t,style:L.style,styleSpec:L.styleSpec}))}function M(L,R){const F=Zt(L.value),$=$n(L.value),K=L.value!==null?L.value:R;if(a){if(F!==a)return[new ct(L.key,K,`${F} stop domain type must match previous stop domain type ${a}`)]}else a=F;if(F!=="number"&&F!=="string"&&F!=="boolean"&&typeof $!="number"&&typeof $!="string"&&typeof $!="boolean")return[new ct(L.key,K,"stop domain value must be a number, string, or boolean")];if(F!=="number"&&i!=="categorical"){let se=`number expected, ${F} found`;return ba(t)&&i===void 0&&(se+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ct(L.key,K,se)]}return i!=="categorical"||F!=="number"||typeof $=="number"&&isFinite($)&&Math.floor($)===$?i!=="categorical"&&F==="number"&&typeof $=="number"&&typeof u=="number"&&u!==void 0&&$new ct(`${r.key}${a.key}`,r.value,a.message));const i=t.value.expression||t.value._styleExpression.expression;if(r.expressionContext==="property"&&r.propertyKey==="text-font"&&!i.outputDefined())return[new ct(r.key,r.value,`Invalid data expression for "${r.propertyKey}". Output values must be contained as literals within the expression.`)];if(r.expressionContext==="property"&&r.propertyType==="layout"&&!Co(i))return[new ct(r.key,r.value,'"feature-state" data expressions are not supported with layout properties.')];if(r.expressionContext==="filter")return jl(i,r);if(r.expressionContext&&r.expressionContext.indexOf("cluster")===0){if(!zs(i,["zoom","feature-state"]))return[new ct(r.key,r.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(r.expressionContext==="cluster-initial"&&!ya(i))return[new ct(r.key,r.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function jl(r,t){const i=new Set(["zoom","feature-state","pitch","distance-from-center"]);if(t.valueSpec&&t.valueSpec.expression)for(const u of t.valueSpec.expression.parameters)i.delete(u);if(i.size===0)return[];const a=[];return r instanceof So&&i.has(r.name)?[new ct(t.key,t.value,`["${r.name}"] expression is not supported in a filter for a ${t.object.type} layer with id: ${t.object.id}`)]:(r.eachChild(u=>{a.push(...jl(u,t))}),a)}function Yc(r){const t=r.key,i=r.value,a=r.valueSpec,u=[];return Array.isArray(a.values)?a.values.indexOf($n(i))===-1&&u.push(new ct(t,i,`expected one of [${a.values.join(", ")}], ${JSON.stringify(i)} found`)):Object.keys(a.values).indexOf($n(i))===-1&&u.push(new ct(t,i,`expected one of [${Object.keys(a.values).join(", ")}], ${JSON.stringify(i)} found`)),u}function td(r){if(r===!0||r===!1)return!0;if(!Array.isArray(r)||r.length===0)return!1;switch(r[0]){case"has":return r.length>=2&&r[1]!=="$id"&&r[1]!=="$type";case"in":return r.length>=3&&(typeof r[1]!="string"||Array.isArray(r[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return r.length!==3||Array.isArray(r[1])||Array.isArray(r[2]);case"any":case"all":for(const t of r.slice(1))if(!td(t)&&typeof t!="boolean")return!1;return!0;default:return!0}}function Jc(r,t="fill"){if(r==null)return{filter:()=>!0,needGeometry:!1,needFeature:!1};td(r)||(r=Ca(r));const i=r;let a=!0;try{a=function(b){if(!Aa(b))return b;let A=dr(b);return Qc(A),A=Df(A),A}(i)}catch{console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate. +This is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md +and paste the contents of this message in the report. +Thank you! +Filter Expression: +${JSON.stringify(i,null,2)} + `)}const u=Re[`filter_${t}`],p=Sa(a,u);let g=null;if(p.result==="error")throw new Error(p.value.map(b=>`${b.key}: ${b.message}`).join(", "));g=(b,A,I)=>p.value.evaluate(b,A,{},I);let y=null,w=null;if(a!==i){const b=Sa(i,u);if(b.result==="error")throw new Error(b.value.map(A=>`${A.key}: ${A.message}`).join(", "));y=(A,I,M,L,R)=>b.value.evaluate(A,I,{},M,void 0,void 0,L,R),w=!ya(b.value.expression)}return{filter:g,dynamicFilter:y||void 0,needGeometry:Of(a),needFeature:!!w}}function Df(r){if(!Array.isArray(r))return r;const t=function(i){if(nd.has(i[0])){for(let a=1;aDf(i))}function Qc(r){let t=!1;const i=[];if(r[0]==="case"){for(let a=1;a",">=","<","<=","to-boolean"]);function iy(r,t){return rt?1:0}function Of(r){if(!Array.isArray(r))return!1;if(r[0]==="within")return!0;for(let t=1;t"||t==="<="||t===">="?rd(r[1],r[2],t):t==="any"?(i=r.slice(1),["any"].concat(i.map(Ca))):t==="all"?["all"].concat(r.slice(1).map(Ca)):t==="none"?["all"].concat(r.slice(1).map(Ca).map(eu)):t==="in"?id(r[1],r.slice(2)):t==="!in"?eu(id(r[1],r.slice(2))):t==="has"?od(r[1]):t==="!has"?eu(od(r[1])):t!=="within"||r;var i}function rd(r,t,i){switch(r){case"$type":return[`filter-type-${i}`,t];case"$id":return[`filter-id-${i}`,t];default:return[`filter-${i}`,r,t]}}function id(r,t){if(t.length===0)return!1;switch(r){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some(i=>typeof i!=typeof t[0])?["filter-in-large",r,["literal",t.sort(iy)]]:["filter-in-small",r,["literal",t]]}}function od(r){switch(r){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",r]}}function eu(r){return["!",r]}function Vl(r){return td(dr(r.value))?pr(bo({},r,{expressionContext:"filter",valueSpec:r.styleSpec[`filter_${r.layerType||"fill"}`]})):$l(r)}function $l(r){const t=r.value,i=r.key;if(Zt(t)!=="array")return[new ct(i,t,`array expected, ${Zt(t)} found`)];const a=r.styleSpec;let u,p=[];if(t.length<1)return[new ct(i,t,"filter array must have at least 1 element")];switch(p=p.concat(Yc({key:`${i}[0]`,value:t[0],valueSpec:a.filter_operator,style:r.style,styleSpec:r.styleSpec})),$n(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&$n(t[1])==="$type"&&p.push(new ct(i,t,`"$type" cannot be use with operator "${t[0]}"`));case"==":case"!=":t.length!==3&&p.push(new ct(i,t,`filter array for operator "${t[0]}" must have 3 elements`));case"in":case"!in":t.length>=2&&(u=Zt(t[1]),u!=="string"&&p.push(new ct(`${i}[1]`,t[1],`string expected, ${u} found`)));for(let g=2;g{b in i&&t.push(new ct(a,i[b],`"${b}" is prohibited for ref layers`))}),u.layers.forEach(b=>{$n(b.id)===y&&(w=b)}),w?w.ref?t.push(new ct(a,i.ref,"ref cannot reference another ref layer")):g=$n(w.type):typeof y=="string"&&t.push(new ct(a,i.ref,`ref layer "${y}" not found`))}else if(g!=="background"&&g!=="sky")if(i.source){const w=u.sources&&u.sources[i.source],b=w&&$n(w.type);w?b==="vector"&&g==="raster"?t.push(new ct(a,i.source,`layer "${i.id}" requires a raster source`)):b==="raster"&&g!=="raster"?t.push(new ct(a,i.source,`layer "${i.id}" requires a vector source`)):b!=="vector"||i["source-layer"]?b==="raster-dem"&&g!=="hillshade"?t.push(new ct(a,i.source,"raster-dem source can only be used with layer type 'hillshade'.")):g!=="line"||!i.paint||!i.paint["line-gradient"]&&!i.paint["line-trim-offset"]||b==="geojson"&&w.lineMetrics||t.push(new ct(a,i,`layer "${i.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):t.push(new ct(a,i,`layer "${i.id}" must specify a "source-layer"`)):t.push(new ct(a,i.source,`source "${i.source}" not found`))}else t.push(new ct(a,i,'missing required property "source"'));return t=t.concat(Di({key:a,value:i,valueSpec:p.layer,style:r.style,styleSpec:r.styleSpec,objectElementValidators:{"*":()=>[],type:()=>kr({key:`${a}.type`,value:i.type,valueSpec:p.layer.type,style:r.style,styleSpec:r.styleSpec,object:i,objectKey:"type"}),filter:w=>Vl(bo({layerType:g},w)),layout:w=>Di({layer:i,key:w.key,value:w.value,valueSpec:{},style:w.style,styleSpec:w.styleSpec,objectElementValidators:{"*":b=>ad(bo({layerType:g},b))}}),paint:w=>Di({layer:i,key:w.key,value:w.value,valueSpec:{},style:w.style,styleSpec:w.styleSpec,objectElementValidators:{"*":b=>Bf(bo({layerType:g},b))}})}})),t}function rs(r){const t=r.value,i=r.key,a=Zt(t);return a!=="string"?[new ct(i,t,`string expected, ${a} found`)]:[]}const Nf={promoteId:function({key:r,value:t}){if(Zt(t)==="string")return rs({key:r,value:t});{const i=[];for(const a in t)i.push(...rs({key:`${r}.${a}`,value:t[a]}));return i}}};function Uf(r){const t=r.value,i=r.key,a=r.styleSpec,u=r.style;if(!t.type)return[new ct(i,t,'"type" is required')];const p=$n(t.type);let g;switch(p){case"vector":case"raster":case"raster-dem":return g=Di({key:i,value:t,valueSpec:a[`source_${p.replace("-","_")}`],style:r.style,styleSpec:a,objectElementValidators:Nf}),g;case"geojson":if(g=Di({key:i,value:t,valueSpec:a.source_geojson,style:u,styleSpec:a,objectElementValidators:Nf}),t.cluster)for(const y in t.clusterProperties){const[w,b]=t.clusterProperties[y],A=typeof w=="string"?[w,["accumulated"],["get",y]]:w;g.push(...pr({key:`${i}.${y}.map`,value:b,expressionContext:"cluster-map"})),g.push(...pr({key:`${i}.${y}.reduce`,value:A,expressionContext:"cluster-reduce"}))}return g;case"video":return Di({key:i,value:t,valueSpec:a.source_video,style:u,styleSpec:a});case"image":return Di({key:i,value:t,valueSpec:a.source_image,style:u,styleSpec:a});case"canvas":return[new ct(i,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Yc({key:`${i}.type`,value:t.type,valueSpec:{values:oy(a)},style:u,styleSpec:a})}}function oy(r){return r.source.reduce((t,i)=>{const a=r[i];return a.type.type==="enum"&&(t=t.concat(Object.keys(a.type.values))),t},[])}function jf(r){const t=r.value,i=r.styleSpec,a=i.light,u=r.style;let p=[];const g=Zt(t);if(t===void 0)return p;if(g!=="object")return p=p.concat([new ct("light",t,`object expected, ${g} found`)]),p;for(const y in t){const w=y.match(/^(.*)-transition$/);p=p.concat(w&&a[w[1]]&&a[w[1]].transition?kr({key:y,value:t[y],valueSpec:i.transition,style:u,styleSpec:i}):a[y]?kr({key:y,value:t[y],valueSpec:a[y],style:u,styleSpec:i}):[new ct(y,t[y],`unknown property "${y}"`)])}return p}function ld(r){const t=r.value,i=r.key,a=r.style,u=r.styleSpec,p=u.terrain;let g=[];const y=Zt(t);if(t===void 0)return g;if(y!=="object")return g=g.concat([new ct("terrain",t,`object expected, ${y} found`)]),g;for(const w in t){const b=w.match(/^(.*)-transition$/);g=g.concat(b&&p[b[1]]&&p[b[1]].transition?kr({key:w,value:t[w],valueSpec:u.transition,style:a,styleSpec:u}):p[w]?kr({key:w,value:t[w],valueSpec:p[w],style:a,styleSpec:u}):[new ct(w,t[w],`unknown property "${w}"`)])}if(t.source){const w=a.sources&&a.sources[t.source],b=w&&$n(w.type);w?b!=="raster-dem"&&g.push(new ct(i,t.source,`terrain cannot be used with a source of type ${String(b)}, it only be used with a "raster-dem" source type`)):g.push(new ct(i,t.source,`source "${t.source}" not found`))}else g.push(new ct(i,t,'terrain is missing required property "source"'));return g}function Vf(r){const t=r.value,i=r.style,a=r.styleSpec,u=a.fog;let p=[];const g=Zt(t);if(t===void 0)return p;if(g!=="object")return p=p.concat([new ct("fog",t,`object expected, ${g} found`)]),p;for(const y in t){const w=y.match(/^(.*)-transition$/);p=p.concat(w&&u[w[1]]&&u[w[1]].transition?kr({key:y,value:t[y],valueSpec:a.transition,style:i,styleSpec:a}):u[y]?kr({key:y,value:t[y],valueSpec:u[y],style:i,styleSpec:a}):[new ct(y,t[y],`unknown property "${y}"`)])}return p}const $f={"*":()=>[],array:Rf,boolean:function(r){const t=r.value,i=r.key,a=Zt(t);return a!=="boolean"?[new ct(i,t,`boolean expected, ${a} found`)]:[]},number:Nl,color:function(r){const t=r.key,i=r.value,a=Zt(i);return a!=="string"?[new ct(t,i,`color expected, ${a} found`)]:Ah(i)===null?[new ct(t,i,`color expected, "${i}" found`)]:[]},enum:Yc,filter:Vl,function:Ul,layer:Ff,object:Di,source:Uf,light:jf,terrain:ld,fog:Vf,string:rs,formatted:function(r){return rs(r).length===0?[]:pr(r)},resolvedImage:function(r){return rs(r).length===0?[]:pr(r)},projection:function(r){const t=r.value,i=r.styleSpec,a=i.projection,u=r.style;let p=[];const g=Zt(t);if(g==="object")for(const y in t)p=p.concat(kr({key:y,value:t[y],valueSpec:a[y],style:u,styleSpec:i}));else g!=="string"&&(p=p.concat([new ct("projection",t,`object or string expected, ${g} found`)]));return p}};function kr(r){const t=r.value,i=r.valueSpec,a=r.styleSpec;return i.expression&&Ol($n(t))?Ul(r):i.expression&&Ta(dr(t))?pr(r):i.type&&$f[i.type]?$f[i.type](r):Di(bo({},r,{valueSpec:i.type?a[i.type]:i}))}function sy(r){const t=r.value,i=r.key,a=rs(r);return a.length||(t.indexOf("{fontstack}")===-1&&a.push(new ct(i,t,'"glyphs" url must include a "{fontstack}" token')),t.indexOf("{range}")===-1&&a.push(new ct(i,t,'"glyphs" url must include a "{range}" token'))),a}function Gf(r,t=Re){return yi(kr({key:"",value:r,valueSpec:t.$root,styleSpec:t,style:r,objectElementValidators:{glyphs:sy,"*":()=>[]}}))}const ay=r=>yi(Bf(r)),ly=r=>yi(ad(r));function yi(r){return r.slice().sort((t,i)=>t.line&&i.line?t.line-i.line:0)}function qf(r,t){let i=!1;if(t&&t.length)for(const a of t)r.fire(new wo(new Error(a.message))),i=!0;return i}var cy=ro,Oi=3;function ro(r,t,i){var a=this.cells=[];if(r instanceof ArrayBuffer){this.arrayBuffer=r;var u=new Int32Array(this.arrayBuffer);r=u[0],this.d=(t=u[1])+2*(i=u[2]);for(var p=0;p=A[L+0]&&a>=A[L+1])?(g[M]=!0,p.push(b[M])):g[M]=!1}}},ro.prototype._forEachCell=function(r,t,i,a,u,p,g,y){for(var w=this._convertToCellCoord(r),b=this._convertToCellCoord(t),A=this._convertToCellCoord(i),I=this._convertToCellCoord(a),M=w;M<=A;M++)for(var L=b;L<=I;L++){var R=this.d*L+M;if((!y||y(this._convertFromCellCoord(M),this._convertFromCellCoord(L),this._convertFromCellCoord(M+1),this._convertFromCellCoord(L+1)))&&u.call(this,r,t,i,a,R,p,g,y))return}},ro.prototype._convertFromCellCoord=function(r){return(r-this.padding)/this.scale},ro.prototype._convertToCellCoord=function(r){return Math.max(0,Math.min(this.d-1,Math.floor(r*this.scale)+this.padding))},ro.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var r=this.cells,t=Oi+this.cells.length+1+1,i=0,a=0;a=0||(u[p]=Ia(r[p],t)));r instanceof Error&&(u.message=r.message)}if(u.$name)throw new Error("$name property is reserved for worker serialization logic.");return a!=="Object"&&(u.$name=a),u}throw new Error("can't serialize object of type "+typeof r)}function Os(r){if(r==null||typeof r=="boolean"||typeof r=="number"||typeof r=="string"||r instanceof Boolean||r instanceof Number||r instanceof String||r instanceof Date||r instanceof RegExp||cd(r)||ud(r)||ArrayBuffer.isView(r)||r instanceof k.ImageData)return r;if(Array.isArray(r))return r.map(Os);if(typeof r=="object"){const t=r.$name||"Object",{klass:i}=tu[t];if(!i)throw new Error(`can't deserialize unregistered class ${t}`);if(i.deserialize)return i.deserialize(r);const a=Object.create(i.prototype);for(const u of Object.keys(r))u!=="$name"&&(a[u]=Os(r[u]));return a}throw new Error("can't deserialize object of type "+typeof r)}const at={"Latin-1 Supplement":r=>r>=128&&r<=255,Arabic:r=>r>=1536&&r<=1791,"Arabic Supplement":r=>r>=1872&&r<=1919,"Arabic Extended-A":r=>r>=2208&&r<=2303,"Hangul Jamo":r=>r>=4352&&r<=4607,"Unified Canadian Aboriginal Syllabics":r=>r>=5120&&r<=5759,Khmer:r=>r>=6016&&r<=6143,"Unified Canadian Aboriginal Syllabics Extended":r=>r>=6320&&r<=6399,"General Punctuation":r=>r>=8192&&r<=8303,"Letterlike Symbols":r=>r>=8448&&r<=8527,"Number Forms":r=>r>=8528&&r<=8591,"Miscellaneous Technical":r=>r>=8960&&r<=9215,"Control Pictures":r=>r>=9216&&r<=9279,"Optical Character Recognition":r=>r>=9280&&r<=9311,"Enclosed Alphanumerics":r=>r>=9312&&r<=9471,"Geometric Shapes":r=>r>=9632&&r<=9727,"Miscellaneous Symbols":r=>r>=9728&&r<=9983,"Miscellaneous Symbols and Arrows":r=>r>=11008&&r<=11263,"CJK Radicals Supplement":r=>r>=11904&&r<=12031,"Kangxi Radicals":r=>r>=12032&&r<=12255,"Ideographic Description Characters":r=>r>=12272&&r<=12287,"CJK Symbols and Punctuation":r=>r>=12288&&r<=12351,Hiragana:r=>r>=12352&&r<=12447,Katakana:r=>r>=12448&&r<=12543,Bopomofo:r=>r>=12544&&r<=12591,"Hangul Compatibility Jamo":r=>r>=12592&&r<=12687,Kanbun:r=>r>=12688&&r<=12703,"Bopomofo Extended":r=>r>=12704&&r<=12735,"CJK Strokes":r=>r>=12736&&r<=12783,"Katakana Phonetic Extensions":r=>r>=12784&&r<=12799,"Enclosed CJK Letters and Months":r=>r>=12800&&r<=13055,"CJK Compatibility":r=>r>=13056&&r<=13311,"CJK Unified Ideographs Extension A":r=>r>=13312&&r<=19903,"Yijing Hexagram Symbols":r=>r>=19904&&r<=19967,"CJK Unified Ideographs":r=>r>=19968&&r<=40959,"Yi Syllables":r=>r>=40960&&r<=42127,"Yi Radicals":r=>r>=42128&&r<=42191,"Hangul Jamo Extended-A":r=>r>=43360&&r<=43391,"Hangul Syllables":r=>r>=44032&&r<=55215,"Hangul Jamo Extended-B":r=>r>=55216&&r<=55295,"Private Use Area":r=>r>=57344&&r<=63743,"CJK Compatibility Ideographs":r=>r>=63744&&r<=64255,"Arabic Presentation Forms-A":r=>r>=64336&&r<=65023,"Vertical Forms":r=>r>=65040&&r<=65055,"CJK Compatibility Forms":r=>r>=65072&&r<=65103,"Small Form Variants":r=>r>=65104&&r<=65135,"Arabic Presentation Forms-B":r=>r>=65136&&r<=65279,"Halfwidth and Fullwidth Forms":r=>r>=65280&&r<=65519};function hd(r){for(const t of r)if(dd(t.charCodeAt(0)))return!0;return!1}function uy(r){for(const t of r)if(!Wf(t.charCodeAt(0)))return!1;return!0}function Wf(r){return!(at.Arabic(r)||at["Arabic Supplement"](r)||at["Arabic Extended-A"](r)||at["Arabic Presentation Forms-A"](r)||at["Arabic Presentation Forms-B"](r))}function dd(r){return!(r!==746&&r!==747&&(r<4352||!(at["Bopomofo Extended"](r)||at.Bopomofo(r)||at["CJK Compatibility Forms"](r)&&!(r>=65097&&r<=65103)||at["CJK Compatibility Ideographs"](r)||at["CJK Compatibility"](r)||at["CJK Radicals Supplement"](r)||at["CJK Strokes"](r)||!(!at["CJK Symbols and Punctuation"](r)||r>=12296&&r<=12305||r>=12308&&r<=12319||r===12336)||at["CJK Unified Ideographs Extension A"](r)||at["CJK Unified Ideographs"](r)||at["Enclosed CJK Letters and Months"](r)||at["Hangul Compatibility Jamo"](r)||at["Hangul Jamo Extended-A"](r)||at["Hangul Jamo Extended-B"](r)||at["Hangul Jamo"](r)||at["Hangul Syllables"](r)||at.Hiragana(r)||at["Ideographic Description Characters"](r)||at.Kanbun(r)||at["Kangxi Radicals"](r)||at["Katakana Phonetic Extensions"](r)||at.Katakana(r)&&r!==12540||!(!at["Halfwidth and Fullwidth Forms"](r)||r===65288||r===65289||r===65293||r>=65306&&r<=65310||r===65339||r===65341||r===65343||r>=65371&&r<=65503||r===65507||r>=65512&&r<=65519)||!(!at["Small Form Variants"](r)||r>=65112&&r<=65118||r>=65123&&r<=65126)||at["Unified Canadian Aboriginal Syllabics"](r)||at["Unified Canadian Aboriginal Syllabics Extended"](r)||at["Vertical Forms"](r)||at["Yijing Hexagram Symbols"](r)||at["Yi Syllables"](r)||at["Yi Radicals"](r))))}function Zf(r){return!(dd(r)||function(t){return!!(at["Latin-1 Supplement"](t)&&(t===167||t===169||t===174||t===177||t===188||t===189||t===190||t===215||t===247)||at["General Punctuation"](t)&&(t===8214||t===8224||t===8225||t===8240||t===8241||t===8251||t===8252||t===8258||t===8263||t===8264||t===8265||t===8273)||at["Letterlike Symbols"](t)||at["Number Forms"](t)||at["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||t===9003||t>=9085&&t<=9114||t>=9150&&t<=9165||t===9167||t>=9169&&t<=9179||t>=9186&&t<=9215)||at["Control Pictures"](t)&&t!==9251||at["Optical Character Recognition"](t)||at["Enclosed Alphanumerics"](t)||at["Geometric Shapes"](t)||at["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||at["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||at["CJK Symbols and Punctuation"](t)||at.Katakana(t)||at["Private Use Area"](t)||at["CJK Compatibility Forms"](t)||at["Small Form Variants"](t)||at["Halfwidth and Fullwidth Forms"](t)||t===8734||t===8756||t===8757||t>=9984&&t<=10087||t>=10102&&t<=10131||t===65532||t===65533)}(r))}function Hf(r){return r>=1424&&r<=2303||at["Arabic Presentation Forms-A"](r)||at["Arabic Presentation Forms-B"](r)}function hy(r,t){return!(!t&&Hf(r)||r>=2304&&r<=3583||r>=3840&&r<=4255||at.Khmer(r))}function dy(r){for(const t of r)if(Hf(t.charCodeAt(0)))return!0;return!1}const pd="deferred",fd="loading",md="loaded";let ka=null,d="unavailable",o=null;const c=function(r){r&&typeof r=="string"&&r.indexOf("NetworkError")>-1&&(d="error"),ka&&ka(r)};function f(){_.fire(new Is("pluginStateChange",{pluginStatus:d,pluginURL:o}))}const _=new vl,x=function(){return d},T=function(){if(d!==pd||!o)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");d=fd,f(),o&&ua({url:o},r=>{r?c(r):(d=md,f())})},S={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>d===md||S.applyArabicShaping!=null,isLoading:()=>d===fd,setState(r){d=r.pluginStatus,o=r.pluginURL},isParsed:()=>S.applyArabicShaping!=null&&S.processBidirectionalText!=null&&S.processStyledBidirectionalText!=null,getPluginURL:()=>o};class C{constructor(t,i){this.zoom=t,i?(this.now=i.now,this.fadeDuration=i.fadeDuration,this.transition=i.transition,this.pitch=i.pitch):(this.now=0,this.fadeDuration=0,this.transition={},this.pitch=0)}isSupportedScript(t){return function(i,a){for(const u of i)if(!hy(u.charCodeAt(0),a))return!1;return!0}(t,S.isLoaded())}}class z{constructor(t,i){this.property=t,this.value=i,this.expression=function(a,u){if(Ol(a))return new Xc(a,u);if(Ta(a)){const p=Fl(a,u);if(p.result==="error")throw new Error(p.value.map(g=>`${g.key}: ${g.message}`).join(", "));return p.value}{let p=a;return typeof a=="string"&&u.type==="color"&&(p=Fn.parse(a)),{kind:"constant",evaluate:()=>p}}}(i===void 0?t.specification.default:i,t.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(t,i,a){return this.property.possiblyEvaluate(this,t,i,a)}}class P{constructor(t){this.property=t,this.value=new z(t,void 0)}transitioned(t,i){return new j(this.property,this.value,i,vn({},t.transition,this.transition),t.now)}untransitioned(){return new j(this.property,this.value,null,{},0)}}class O{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)}getValue(t){return Dr(this._values[t].value.value)}setValue(t,i){this._values.hasOwnProperty(t)||(this._values[t]=new P(this._values[t].property)),this._values[t].value=new z(this._values[t].property,i===null?void 0:Dr(i))}getTransition(t){return Dr(this._values[t].transition)}setTransition(t,i){this._values.hasOwnProperty(t)||(this._values[t]=new P(this._values[t].property)),this._values[t].transition=Dr(i)||void 0}serialize(){const t={};for(const i of Object.keys(this._values)){const a=this.getValue(i);a!==void 0&&(t[i]=a);const u=this.getTransition(i);u!==void 0&&(t[`${i}-transition`]=u)}return t}transitioned(t,i){const a=new W(this._properties);for(const u of Object.keys(this._values))a._values[u]=this._values[u].transitioned(t,i._values[u]);return a}untransitioned(){const t=new W(this._properties);for(const i of Object.keys(this._values))t._values[i]=this._values[i].untransitioned();return t}}class j{constructor(t,i,a,u,p){const g=u.delay||0,y=u.duration||0;p=p||0,this.property=t,this.value=i,this.begin=p+g,this.end=this.begin+y,t.specification.transition&&(u.delay||u.duration)&&(this.prior=a)}possiblyEvaluate(t,i,a){const u=t.now||0,p=this.value.possiblyEvaluate(t,i,a),g=this.prior;if(g){if(u>this.end)return this.prior=null,p;if(this.value.isDataDriven())return this.prior=null,p;if(uthis.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const i=this.uint8;this._refreshViews(),i&&this.uint8.set(i)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}destroy(){this.int8=this.uint8=this.int16=this.uint16=this.int32=this.uint32=this.float32=null,this.arrayBuffer=null}}function ye(r,t=1){let i=0,a=0;return{members:r.map(u=>{const p=fe[u.type].BYTES_PER_ELEMENT,g=i=Ae(i,Math.max(t,p)),y=u.components||1;return a=Math.max(a,p),i+=p*y,{name:u.name,type:u.type,components:y,offset:g}}),size:Ae(i,Math.max(a,t)),alignment:t}}function Ae(r,t){return Math.ceil(r/t)*t}class We extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i){const a=this.length;return this.resize(a+1),this.emplace(a,t,i)}emplace(t,i,a){const u=2*t;return this.int16[u+0]=i,this.int16[u+1]=a,t}}We.prototype.bytesPerElement=4,dt(We,"StructArrayLayout2i4");class Ee extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,a){const u=this.length;return this.resize(u+1),this.emplace(u,t,i,a)}emplace(t,i,a,u){const p=3*t;return this.int16[p+0]=i,this.int16[p+1]=a,this.int16[p+2]=u,t}}Ee.prototype.bytesPerElement=6,dt(Ee,"StructArrayLayout3i6");class Fe extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,a,u){const p=this.length;return this.resize(p+1),this.emplace(p,t,i,a,u)}emplace(t,i,a,u,p){const g=4*t;return this.int16[g+0]=i,this.int16[g+1]=a,this.int16[g+2]=u,this.int16[g+3]=p,t}}Fe.prototype.bytesPerElement=8,dt(Fe,"StructArrayLayout4i8");class ke extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p,g,y){const w=this.length;return this.resize(w+1),this.emplace(w,t,i,a,u,p,g,y)}emplace(t,i,a,u,p,g,y,w){const b=6*t,A=12*t,I=3*t;return this.int16[b+0]=i,this.int16[b+1]=a,this.uint8[A+4]=u,this.uint8[A+5]=p,this.uint8[A+6]=g,this.uint8[A+7]=y,this.float32[I+2]=w,t}}ke.prototype.bytesPerElement=12,dt(ke,"StructArrayLayout2i4ub1f12");class qe extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a,u){const p=this.length;return this.resize(p+1),this.emplace(p,t,i,a,u)}emplace(t,i,a,u,p){const g=4*t;return this.float32[g+0]=i,this.float32[g+1]=a,this.float32[g+2]=u,this.float32[g+3]=p,t}}qe.prototype.bytesPerElement=16,dt(qe,"StructArrayLayout4f16");class Se extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p){const g=this.length;return this.resize(g+1),this.emplace(g,t,i,a,u,p)}emplace(t,i,a,u,p,g){const y=6*t,w=3*t;return this.uint16[y+0]=i,this.uint16[y+1]=a,this.uint16[y+2]=u,this.uint16[y+3]=p,this.float32[w+2]=g,t}}Se.prototype.bytesPerElement=12,dt(Se,"StructArrayLayout4ui1f12");class Be extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,a,u){const p=this.length;return this.resize(p+1),this.emplace(p,t,i,a,u)}emplace(t,i,a,u,p){const g=4*t;return this.uint16[g+0]=i,this.uint16[g+1]=a,this.uint16[g+2]=u,this.uint16[g+3]=p,t}}Be.prototype.bytesPerElement=8,dt(Be,"StructArrayLayout4ui8");class Xe extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p,g){const y=this.length;return this.resize(y+1),this.emplace(y,t,i,a,u,p,g)}emplace(t,i,a,u,p,g,y){const w=6*t;return this.int16[w+0]=i,this.int16[w+1]=a,this.int16[w+2]=u,this.int16[w+3]=p,this.int16[w+4]=g,this.int16[w+5]=y,t}}Xe.prototype.bytesPerElement=12,dt(Xe,"StructArrayLayout6i12");class $e extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p,g,y,w,b,A,I,M){const L=this.length;return this.resize(L+1),this.emplace(L,t,i,a,u,p,g,y,w,b,A,I,M)}emplace(t,i,a,u,p,g,y,w,b,A,I,M,L){const R=12*t;return this.int16[R+0]=i,this.int16[R+1]=a,this.int16[R+2]=u,this.int16[R+3]=p,this.uint16[R+4]=g,this.uint16[R+5]=y,this.uint16[R+6]=w,this.uint16[R+7]=b,this.int16[R+8]=A,this.int16[R+9]=I,this.int16[R+10]=M,this.int16[R+11]=L,t}}$e.prototype.bytesPerElement=24,dt($e,"StructArrayLayout4i4ui4i24");class Ye extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p,g){const y=this.length;return this.resize(y+1),this.emplace(y,t,i,a,u,p,g)}emplace(t,i,a,u,p,g,y){const w=10*t,b=5*t;return this.int16[w+0]=i,this.int16[w+1]=a,this.int16[w+2]=u,this.float32[b+2]=p,this.float32[b+3]=g,this.float32[b+4]=y,t}}Ye.prototype.bytesPerElement=20,dt(Ye,"StructArrayLayout3i3f20");class gt extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){const i=this.length;return this.resize(i+1),this.emplace(i,t)}emplace(t,i){return this.uint32[1*t+0]=i,t}}gt.prototype.bytesPerElement=4,dt(gt,"StructArrayLayout1ul4");class Et extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p,g,y,w,b,A,I,M,L){const R=this.length;return this.resize(R+1),this.emplace(R,t,i,a,u,p,g,y,w,b,A,I,M,L)}emplace(t,i,a,u,p,g,y,w,b,A,I,M,L,R){const F=20*t,$=10*t;return this.int16[F+0]=i,this.int16[F+1]=a,this.int16[F+2]=u,this.int16[F+3]=p,this.int16[F+4]=g,this.float32[$+3]=y,this.float32[$+4]=w,this.float32[$+5]=b,this.float32[$+6]=A,this.int16[F+14]=I,this.uint32[$+8]=M,this.uint16[F+18]=L,this.uint16[F+19]=R,t}}Et.prototype.bytesPerElement=40,dt(Et,"StructArrayLayout5i4f1i1ul2ui40");class pt extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p,g,y){const w=this.length;return this.resize(w+1),this.emplace(w,t,i,a,u,p,g,y)}emplace(t,i,a,u,p,g,y,w){const b=8*t;return this.int16[b+0]=i,this.int16[b+1]=a,this.int16[b+2]=u,this.int16[b+4]=p,this.int16[b+5]=g,this.int16[b+6]=y,this.int16[b+7]=w,t}}pt.prototype.bytesPerElement=16,dt(pt,"StructArrayLayout3i2i2i16");class wt extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p){const g=this.length;return this.resize(g+1),this.emplace(g,t,i,a,u,p)}emplace(t,i,a,u,p,g){const y=4*t,w=8*t;return this.float32[y+0]=i,this.float32[y+1]=a,this.float32[y+2]=u,this.int16[w+6]=p,this.int16[w+7]=g,t}}wt.prototype.bytesPerElement=16,dt(wt,"StructArrayLayout2f1f2i16");class Ut extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a,u){const p=this.length;return this.resize(p+1),this.emplace(p,t,i,a,u)}emplace(t,i,a,u,p){const g=12*t,y=3*t;return this.uint8[g+0]=i,this.uint8[g+1]=a,this.float32[y+1]=u,this.float32[y+2]=p,t}}Ut.prototype.bytesPerElement=12,dt(Ut,"StructArrayLayout2ub2f12");class Ot extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a){const u=this.length;return this.resize(u+1),this.emplace(u,t,i,a)}emplace(t,i,a,u){const p=3*t;return this.float32[p+0]=i,this.float32[p+1]=a,this.float32[p+2]=u,t}}Ot.prototype.bytesPerElement=12,dt(Ot,"StructArrayLayout3f12");class mt extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,a){const u=this.length;return this.resize(u+1),this.emplace(u,t,i,a)}emplace(t,i,a,u){const p=3*t;return this.uint16[p+0]=i,this.uint16[p+1]=a,this.uint16[p+2]=u,t}}mt.prototype.bytesPerElement=6,dt(mt,"StructArrayLayout3ui6");class en extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p,g,y,w,b,A,I,M,L,R,F,$,K,se,Y,re,ue){const ce=this.length;return this.resize(ce+1),this.emplace(ce,t,i,a,u,p,g,y,w,b,A,I,M,L,R,F,$,K,se,Y,re,ue)}emplace(t,i,a,u,p,g,y,w,b,A,I,M,L,R,F,$,K,se,Y,re,ue,ce){const Ie=30*t,Te=15*t,De=60*t;return this.int16[Ie+0]=i,this.int16[Ie+1]=a,this.int16[Ie+2]=u,this.float32[Te+2]=p,this.float32[Te+3]=g,this.uint16[Ie+8]=y,this.uint16[Ie+9]=w,this.uint32[Te+5]=b,this.uint32[Te+6]=A,this.uint32[Te+7]=I,this.uint16[Ie+16]=M,this.uint16[Ie+17]=L,this.uint16[Ie+18]=R,this.float32[Te+10]=F,this.float32[Te+11]=$,this.uint8[De+48]=K,this.uint8[De+49]=se,this.uint8[De+50]=Y,this.uint32[Te+13]=re,this.int16[Ie+28]=ue,this.uint8[De+58]=ce,t}}en.prototype.bytesPerElement=60,dt(en,"StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60");class rn extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p,g,y,w,b,A,I,M,L,R,F,$,K,se,Y,re,ue,ce,Ie,Te,De,Ze,Me,Ue,je,Ge){const et=this.length;return this.resize(et+1),this.emplace(et,t,i,a,u,p,g,y,w,b,A,I,M,L,R,F,$,K,se,Y,re,ue,ce,Ie,Te,De,Ze,Me,Ue,je,Ge)}emplace(t,i,a,u,p,g,y,w,b,A,I,M,L,R,F,$,K,se,Y,re,ue,ce,Ie,Te,De,Ze,Me,Ue,je,Ge,et){const Le=38*t,ot=19*t;return this.int16[Le+0]=i,this.int16[Le+1]=a,this.int16[Le+2]=u,this.float32[ot+2]=p,this.float32[ot+3]=g,this.int16[Le+8]=y,this.int16[Le+9]=w,this.int16[Le+10]=b,this.int16[Le+11]=A,this.int16[Le+12]=I,this.int16[Le+13]=M,this.uint16[Le+14]=L,this.uint16[Le+15]=R,this.uint16[Le+16]=F,this.uint16[Le+17]=$,this.uint16[Le+18]=K,this.uint16[Le+19]=se,this.uint16[Le+20]=Y,this.uint16[Le+21]=re,this.uint16[Le+22]=ue,this.uint16[Le+23]=ce,this.uint16[Le+24]=Ie,this.uint16[Le+25]=Te,this.uint16[Le+26]=De,this.uint16[Le+27]=Ze,this.uint16[Le+28]=Me,this.uint32[ot+15]=Ue,this.float32[ot+16]=je,this.float32[ot+17]=Ge,this.float32[ot+18]=et,t}}rn.prototype.bytesPerElement=76,dt(rn,"StructArrayLayout3i2f6i15ui1ul3f76");class on extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){const i=this.length;return this.resize(i+1),this.emplace(i,t)}emplace(t,i){return this.float32[1*t+0]=i,t}}on.prototype.bytesPerElement=4,dt(on,"StructArrayLayout1f4");class sn extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p){const g=this.length;return this.resize(g+1),this.emplace(g,t,i,a,u,p)}emplace(t,i,a,u,p,g){const y=5*t;return this.float32[y+0]=i,this.float32[y+1]=a,this.float32[y+2]=u,this.float32[y+3]=p,this.float32[y+4]=g,t}}sn.prototype.bytesPerElement=20,dt(sn,"StructArrayLayout5f20");class Mr extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,a,u){const p=this.length;return this.resize(p+1),this.emplace(p,t,i,a,u)}emplace(t,i,a,u,p){const g=6*t;return this.uint32[3*t+0]=i,this.uint16[g+2]=a,this.uint16[g+3]=u,this.uint16[g+4]=p,t}}Mr.prototype.bytesPerElement=12,dt(Mr,"StructArrayLayout1ul3ui12");class fr extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i){const a=this.length;return this.resize(a+1),this.emplace(a,t,i)}emplace(t,i,a){const u=2*t;return this.uint16[u+0]=i,this.uint16[u+1]=a,t}}fr.prototype.bytesPerElement=4,dt(fr,"StructArrayLayout2ui4");class vi extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){const i=this.length;return this.resize(i+1),this.emplace(i,t)}emplace(t,i){return this.uint16[1*t+0]=i,t}}vi.prototype.bytesPerElement=2,dt(vi,"StructArrayLayout1ui2");class io extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i){const a=this.length;return this.resize(a+1),this.emplace(a,t,i)}emplace(t,i,a){const u=2*t;return this.float32[u+0]=i,this.float32[u+1]=a,t}}io.prototype.bytesPerElement=8,dt(io,"StructArrayLayout2f8");class An extends pe{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.int16[this._pos2+3]}get tileAnchorY(){return this._structArray.int16[this._pos2+4]}get x1(){return this._structArray.float32[this._pos4+3]}get y1(){return this._structArray.float32[this._pos4+4]}get x2(){return this._structArray.float32[this._pos4+5]}get y2(){return this._structArray.float32[this._pos4+6]}get padding(){return this._structArray.int16[this._pos2+14]}get featureIndex(){return this._structArray.uint32[this._pos4+8]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+18]}get bucketIndex(){return this._structArray.uint16[this._pos2+19]}}An.prototype.size=40;class an extends Et{get(t){return new An(this,t)}}dt(an,"CollisionBoxArray");class Xt extends pe{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+8]}get numGlyphs(){return this._structArray.uint16[this._pos2+9]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+5]}get lineStartIndex(){return this._structArray.uint32[this._pos4+6]}get lineLength(){return this._structArray.uint32[this._pos4+7]}get segment(){return this._structArray.uint16[this._pos2+16]}get lowerSize(){return this._structArray.uint16[this._pos2+17]}get upperSize(){return this._structArray.uint16[this._pos2+18]}get lineOffsetX(){return this._structArray.float32[this._pos4+10]}get lineOffsetY(){return this._structArray.float32[this._pos4+11]}get writingMode(){return this._structArray.uint8[this._pos1+48]}get placedOrientation(){return this._structArray.uint8[this._pos1+49]}set placedOrientation(t){this._structArray.uint8[this._pos1+49]=t}get hidden(){return this._structArray.uint8[this._pos1+50]}set hidden(t){this._structArray.uint8[this._pos1+50]=t}get crossTileID(){return this._structArray.uint32[this._pos4+13]}set crossTileID(t){this._structArray.uint32[this._pos4+13]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+28]}get flipState(){return this._structArray.uint8[this._pos1+58]}set flipState(t){this._structArray.uint8[this._pos1+58]=t}}Xt.prototype.size=60;class Gn extends en{get(t){return new Xt(this,t)}}dt(Gn,"PlacedSymbolArray");class Br extends pe{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+8]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+9]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+10]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+11]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+12]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+13]}get key(){return this._structArray.uint16[this._pos2+14]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+17]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+18]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+19]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+20]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+21]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+22]}get featureIndex(){return this._structArray.uint16[this._pos2+23]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+24]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+25]}get numIconVertices(){return this._structArray.uint16[this._pos2+26]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+27]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+28]}get crossTileID(){return this._structArray.uint32[this._pos4+15]}set crossTileID(t){this._structArray.uint32[this._pos4+15]=t}get textOffset0(){return this._structArray.float32[this._pos4+16]}get textOffset1(){return this._structArray.float32[this._pos4+17]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+18]}}Br.prototype.size=76;class En extends rn{get(t){return new Br(this,t)}}dt(En,"SymbolInstanceArray");class Wr extends on{getoffsetX(t){return this.float32[1*t+0]}}dt(Wr,"GlyphOffsetArray");class nu extends We{getx(t){return this.int16[2*t+0]}gety(t){return this.int16[2*t+1]}}dt(nu,"SymbolLineVertexArray");class Bs extends pe{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]}get layoutVertexArrayOffset(){return this._structArray.uint16[this._pos2+4]}}Bs.prototype.size=12;class Gl extends Mr{get(t){return new Bs(this,t)}}dt(Gl,"FeatureIndexArray");class Mo extends fr{geta_centroid_pos0(t){return this.uint16[2*t+0]}geta_centroid_pos1(t){return this.uint16[2*t+1]}}dt(Mo,"FillExtrusionCentroidArray");const is=ye([{name:"a_pattern",components:4,type:"Uint16"},{name:"a_pixel_ratio",components:1,type:"Float32"}]),Fs=ye([{name:"a_dash",components:4,type:"Uint16"}]);var ru={exports:{}},ql={exports:{}};ql.exports=function(r,t){var i,a,u,p,g,y,w,b;for(a=r.length-(i=3&r.length),u=t,g=3432918353,y=461845907,b=0;b>>16)*g&65535)<<16)&4294967295)<<15|w>>>17))*y+(((w>>>16)*y&65535)<<16)&4294967295)<<13|u>>>19))+((5*(u>>>16)&65535)<<16)&4294967295))+((58964+(p>>>16)&65535)<<16);switch(w=0,i){case 3:w^=(255&r.charCodeAt(b+2))<<16;case 2:w^=(255&r.charCodeAt(b+1))<<8;case 1:u^=w=(65535&(w=(w=(65535&(w^=255&r.charCodeAt(b)))*g+(((w>>>16)*g&65535)<<16)&4294967295)<<15|w>>>17))*y+(((w>>>16)*y&65535)<<16)&4294967295}return u^=r.length,u=2246822507*(65535&(u^=u>>>16))+((2246822507*(u>>>16)&65535)<<16)&4294967295,u=3266489909*(65535&(u^=u>>>13))+((3266489909*(u>>>16)&65535)<<16)&4294967295,(u^=u>>>16)>>>0};var gd=ql.exports,$x={exports:{}};$x.exports=function(r,t){for(var i,a=r.length,u=t^a,p=0;a>=4;)i=1540483477*(65535&(i=255&r.charCodeAt(p)|(255&r.charCodeAt(++p))<<8|(255&r.charCodeAt(++p))<<16|(255&r.charCodeAt(++p))<<24))+((1540483477*(i>>>16)&65535)<<16),u=1540483477*(65535&u)+((1540483477*(u>>>16)&65535)<<16)^(i=1540483477*(65535&(i^=i>>>24))+((1540483477*(i>>>16)&65535)<<16)),a-=4,++p;switch(a){case 3:u^=(255&r.charCodeAt(p+2))<<16;case 2:u^=(255&r.charCodeAt(p+1))<<8;case 1:u=1540483477*(65535&(u^=255&r.charCodeAt(p)))+((1540483477*(u>>>16)&65535)<<16)}return u=1540483477*(65535&(u^=u>>>13))+((1540483477*(u>>>16)&65535)<<16),(u^=u>>>15)>>>0};var Gx=gd,ok=$x.exports;ru.exports=Gx,ru.exports.murmur3=Gx,ru.exports.murmur2=ok;var py=le(ru.exports);class Xf{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(t,i,a,u){this.ids.push(qx(t)),this.positions.push(i,a,u)}getPositions(t){const i=qx(t);let a=0,u=this.ids.length-1;for(;a>1;this.ids[g]>=i?u=g:a=g+1}const p=[];for(;this.ids[a]===i;)p.push({index:this.positions[3*a],start:this.positions[3*a+1],end:this.positions[3*a+2]}),a++;return p}static serialize(t,i){const a=new Float64Array(t.ids),u=new Uint32Array(t.positions);return fy(a,u,0,a.length-1),i&&i.push(a.buffer,u.buffer),{ids:a,positions:u}}static deserialize(t){const i=new Xf;return i.ids=t.ids,i.positions=t.positions,i.indexed=!0,i}}function qx(r){const t=+r;return!isNaN(t)&&Number.MIN_SAFE_INTEGER<=t&&t<=Number.MAX_SAFE_INTEGER?t:py(String(r))}function fy(r,t,i,a){for(;i>1];let p=i-1,g=a+1;for(;;){do p++;while(r[p]u);if(p>=g)break;Kf(r,p,g),Kf(t,3*p,3*g),Kf(t,3*p+1,3*g+1),Kf(t,3*p+2,3*g+2)}g-i`u_${u}`),this.type=a}setUniform(t,i,a,u,p){i.set(t,p,u.constantOr(this.value))}getBinding(t,i){return this.type==="color"?new Zx(t):new Yf(t)}}class iu{constructor(t,i){this.uniformNames=i.map(a=>`u_${a}`),this.pattern=null,this.pixelRatio=1}setConstantPatternPositions(t){this.pixelRatio=t.pixelRatio||1,this.pattern=t.tl.concat(t.br)}setUniform(t,i,a,u,p){const g=p==="u_pattern"||p==="u_dash"?this.pattern:p==="u_pixel_ratio"?this.pixelRatio:null;g&&i.set(t,p,g)}getBinding(t,i){return i==="u_pattern"||i==="u_dash"?new Wx(t):new Yf(t)}}class Us{constructor(t,i,a,u){this.expression=t,this.type=a,this.maxValue=0,this.paintVertexAttributes=i.map(p=>({name:`a_${p}`,type:"Float32",components:a==="color"?2:1,offset:0})),this.paintVertexArray=new u}populatePaintArray(t,i,a,u,p,g){const y=this.paintVertexArray.length,w=this.expression.evaluate(new C(0),i,{},p,u,g);this.paintVertexArray.resize(t),this._setPaintValue(y,t,w)}updatePaintArray(t,i,a,u,p){const g=this.expression.evaluate({zoom:0},a,u,void 0,p);this._setPaintValue(t,i,g)}_setPaintValue(t,i,a){if(this.type==="color"){const u=my(a);for(let p=t;p`u_${y}_t`),this.type=a,this.useIntegerZoom=u,this.zoom=p,this.maxValue=0,this.paintVertexAttributes=i.map(y=>({name:`a_${y}`,type:"Float32",components:a==="color"?4:2,offset:0})),this.paintVertexArray=new g}populatePaintArray(t,i,a,u,p,g){const y=this.expression.evaluate(new C(this.zoom),i,{},p,u,g),w=this.expression.evaluate(new C(this.zoom+1),i,{},p,u,g),b=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(b,t,y,w)}updatePaintArray(t,i,a,u,p){const g=this.expression.evaluate({zoom:this.zoom},a,u,void 0,p),y=this.expression.evaluate({zoom:this.zoom+1},a,u,void 0,p);this._setPaintValue(t,i,g,y)}_setPaintValue(t,i,a,u){if(this.type==="color"){const p=my(a),g=my(u);for(let y=t;y!0){this.binders={},this._buffers=[];const u=[];for(const p in t.paint._values){if(!a(p))continue;const g=t.paint.get(p);if(!(g instanceof Z&&ba(g.property.specification)))continue;const y=uk(p,t.type),w=g.value,b=g.property.specification.type,A=!!g.property.useIntegerZoom,I=p==="line-dasharray"||p.endsWith("pattern"),M=p==="line-dasharray"&&t.layout.get("line-cap").value.kind!=="constant";if(w.kind!=="constant"||M)if(w.kind==="source"||M||I){const L=Hx(p,b,"source");this.binders[p]=I?new Ma(w,y,b,L,t.id):new Us(w,y,b,L),u.push(`/a_${p}`)}else{const L=Hx(p,b,"composite");this.binders[p]=new Po(w,y,b,A,i,L),u.push(`/z_${p}`)}else this.binders[p]=I?new iu(w.value,y):new _d(w.value,y,b),u.push(`/u_${p}`)}this.cacheKey=u.sort().join("")}getMaxValue(t){const i=this.binders[t];return i instanceof Us||i instanceof Po?i.maxValue:0}populatePaintArrays(t,i,a,u,p,g){for(const y in this.binders){const w=this.binders[y];(w instanceof Us||w instanceof Po||w instanceof Ma)&&w.populatePaintArray(t,i,a,u,p,g)}}setConstantPatternPositions(t){for(const i in this.binders){const a=this.binders[i];a instanceof iu&&a.setConstantPatternPositions(t)}}updatePaintArrays(t,i,a,u,p,g){let y=!1;for(const w in t){const b=i.getPositions(w);for(const A of b){const I=a.feature(A.index);for(const M in this.binders){const L=this.binders[M];if((L instanceof Us||L instanceof Po||L instanceof Ma)&&L.expression.isStateDependent===!0){const R=u.paint.get(M);L.expression=R.value,L.updatePaintArray(A.start,A.end,I,t[w],p,g),y=!0}}}}return y}defines(){const t=[];for(const i in this.binders){const a=this.binders[i];(a instanceof _d||a instanceof iu)&&t.push(...a.uniformNames.map(u=>`#define HAS_UNIFORM_${u}`))}return t}getBinderAttributes(){const t=[];for(const i in this.binders){const a=this.binders[i];if(a instanceof Us||a instanceof Po||a instanceof Ma)for(let u=0;u!0){this.programConfigurations={};for(const u of t)this.programConfigurations[u.id]=new Pa(u,i,a);this.needsUpload=!1,this._featureMap=new Xf,this._bufferOffset=0}populatePaintArrays(t,i,a,u,p,g,y){for(const w in this.programConfigurations)this.programConfigurations[w].populatePaintArrays(t,i,u,p,g,y);i.id!==void 0&&this._featureMap.add(i.id,a,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,i,a,u,p){for(const g of a)this.needsUpload=this.programConfigurations[g.id].updatePaintArrays(t,this._featureMap,i,g,u,p)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(const i in this.programConfigurations)this.programConfigurations[i].upload(t);this.needsUpload=!1}}destroy(){for(const t in this.programConfigurations)this.programConfigurations[t].destroy()}}const ck={"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","pixel_ratio"],"fill-pattern":["pattern","pixel_ratio"],"fill-extrusion-pattern":["pattern","pixel_ratio"],"line-dasharray":["dash"]};function uk(r,t){return ck[r]||[r.replace(`${t}-`,"").replace(/-/g,"_")]}const hk={"line-pattern":{source:Se,composite:Se},"fill-pattern":{source:Se,composite:Se},"fill-extrusion-pattern":{source:Se,composite:Se},"line-dasharray":{source:Be,composite:Be}},dk={color:{source:io,composite:qe},number:{source:on,composite:io}};function Hx(r,t,i){const a=hk[r];return a&&a[i]||dk[t][i]}dt(_d,"ConstantBinder"),dt(iu,"PatternConstantBinder"),dt(Us,"SourceExpressionBinder"),dt(Ma,"PatternCompositeBinder"),dt(Po,"CompositeExpressionBinder"),dt(Pa,"ProgramConfiguration",{omit:["_buffers"]}),dt(Wl,"ProgramConfigurationSet");const Xx="-transition";class zo extends vl{constructor(t,i){if(super(),this.id=t.id,this.type=t.type,this._featureFilter={filter:()=>!0,needGeometry:!1,needFeature:!1},this._filterCompiled=!1,t.type!=="custom"&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,t.type!=="background"&&t.type!=="sky"&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter),i.layout&&(this._unevaluatedLayout=new H(i.layout)),i.paint)){this._transitionablePaint=new O(i.paint);for(const a in t.paint)this.setPaintProperty(a,t.paint[a],{validate:!1});for(const a in t.layout)this.setLayoutProperty(a,t.layout[a],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new X(i.paint)}}getLayoutProperty(t){return t==="visibility"?this.visibility:this._unevaluatedLayout.getValue(t)}setLayoutProperty(t,i,a={}){i!=null&&this._validate(ly,`layers.${this.id}.layout.${t}`,t,i,a)||(t!=="visibility"?this._unevaluatedLayout.setValue(t,i):this.visibility=i)}getPaintProperty(t){return xn(t,Xx)?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)}setPaintProperty(t,i,a={}){if(i!=null&&this._validate(ay,`layers.${this.id}.paint.${t}`,t,i,a))return!1;if(xn(t,Xx))return this._transitionablePaint.setTransition(t.slice(0,-11),i||void 0),!1;{const u=this._transitionablePaint._values[t],p=u.value.isDataDriven(),g=u.value;this._transitionablePaint.setValue(t,i),this._handleSpecialPaintPropertyUpdate(t);const y=this._transitionablePaint._values[t].value,w=y.isDataDriven(),b=xn(t,"pattern")||t==="line-dasharray";return w||p||b||this._handleOverridablePaintPropertyUpdate(t,g,y)}}_handleSpecialPaintPropertyUpdate(t){}getProgramIds(){return null}getProgramConfiguration(t){return null}_handleOverridablePaintPropertyUpdate(t,i,a){return!1}isHidden(t){return!!(this.minzoom&&t=this.maxzoom)||this.visibility==="none"}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(t,i){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,i)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,i)}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),Yo(t,(i,a)=>!(i===void 0||a==="layout"&&!Object.keys(i).length||a==="paint"&&!Object.keys(i).length))}_validate(t,i,a,u,p={}){return(!p||p.validate!==!1)&&qf(this,t.call(Gf,{key:i,layerType:this.type,objectKey:a,value:u,styleSpec:Re,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isSky(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const t in this.paint._values){const i=this.paint.get(t);if(i instanceof Z&&ba(i.property.specification)&&(i.value.kind==="source"||i.value.kind==="composite")&&i.value.isStateDependent)return!0}return!1}compileFilter(){this._filterCompiled||(this._featureFilter=Jc(this.filter),this._filterCompiled=!0)}invalidateCompiledFilter(){this._filterCompiled=!1}dynamicFilter(){return this._featureFilter.dynamicFilter}dynamicFilterNeedsFeature(){return this._featureFilter.needFeature}}const pk=ye([{name:"a_pos",components:2,type:"Int16"}],4),fk=ye([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]);class qn{constructor(t=[]){this.segments=t}prepareSegment(t,i,a,u){let p=this.segments[this.segments.length-1];return t>qn.MAX_VERTEX_ARRAY_LENGTH&&wn(`Max vertices per segment is ${qn.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}`),(!p||p.vertexLength+t>qn.MAX_VERTEX_ARRAY_LENGTH||p.sortKey!==u)&&(p={vertexOffset:i.length,primitiveOffset:a.length,vertexLength:0,primitiveLength:0},u!==void 0&&(p.sortKey=u),this.segments.push(p)),p}get(){return this.segments}destroy(){for(const t of this.segments)for(const i in t.vaos)t.vaos[i].destroy()}static simpleSegment(t,i,a,u){return new qn([{vertexOffset:t,primitiveOffset:i,vertexLength:a,primitiveLength:u,vaos:{},sortKey:0}])}}qn.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,dt(qn,"SegmentVector");var vt=8192;class za{constructor(t,i){t&&(i?this.setSouthWest(t).setNorthEast(i):t.length===4?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 ln?new ln(t.lng,t.lat):ln.convert(t),this}setSouthWest(t){return this._sw=t instanceof ln?new ln(t.lng,t.lat):ln.convert(t),this}extend(t){const i=this._sw,a=this._ne;let u,p;if(t instanceof ln)u=t,p=t;else{if(!(t instanceof za))return Array.isArray(t)?t.length===4||t.every(Array.isArray)?this.extend(za.convert(t)):this.extend(ln.convert(t)):typeof t=="object"&&t!==null&&t.hasOwnProperty("lat")&&(t.hasOwnProperty("lon")||t.hasOwnProperty("lng"))?this.extend(ln.convert(t)):this;if(u=t._sw,p=t._ne,!u||!p)return this}return i||a?(i.lng=Math.min(u.lng,i.lng),i.lat=Math.min(u.lat,i.lat),a.lng=Math.max(p.lng,a.lng),a.lat=Math.max(p.lat,a.lat)):(this._sw=new ln(u.lng,u.lat),this._ne=new ln(p.lng,p.lat)),this}getCenter(){return new ln((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 ln(this.getWest(),this.getNorth())}getSouthEast(){return new ln(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:a}=ln.convert(t);let u=this._sw.lng<=i&&i<=this._ne.lng;return this._sw.lng>this._ne.lng&&(u=this._sw.lng>=i&&i>=this._ne.lng),this._sw.lat<=a&&a<=this._ne.lat&&u}static convert(t){return!t||t instanceof za?t:new za(t)}}var Jf=1e-6,xi=typeof Float32Array<"u"?Float32Array:Array;function Kx(){var r=new xi(9);return xi!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[5]=0,r[6]=0,r[7]=0),r[0]=1,r[4]=1,r[8]=1,r}function Yx(r,t,i){var a=t[0],u=t[1],p=t[2],g=t[3],y=t[4],w=t[5],b=t[6],A=t[7],I=t[8],M=i[0],L=i[1],R=i[2],F=i[3],$=i[4],K=i[5],se=i[6],Y=i[7],re=i[8];return r[0]=M*a+L*g+R*b,r[1]=M*u+L*y+R*A,r[2]=M*p+L*w+R*I,r[3]=F*a+$*g+K*b,r[4]=F*u+$*y+K*A,r[5]=F*p+$*w+K*I,r[6]=se*a+Y*g+re*b,r[7]=se*u+Y*y+re*A,r[8]=se*p+Y*w+re*I,r}function Lo(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function gy(r,t){var i=t[0],a=t[1],u=t[2],p=t[3],g=t[4],y=t[5],w=t[6],b=t[7],A=t[8],I=t[9],M=t[10],L=t[11],R=t[12],F=t[13],$=t[14],K=t[15],se=i*y-a*g,Y=i*w-u*g,re=i*b-p*g,ue=a*w-u*y,ce=a*b-p*y,Ie=u*b-p*w,Te=A*F-I*R,De=A*$-M*R,Ze=A*K-L*R,Me=I*$-M*F,Ue=I*K-L*F,je=M*K-L*$,Ge=se*je-Y*Ue+re*Me+ue*Ze-ce*De+Ie*Te;return Ge?(r[0]=(y*je-w*Ue+b*Me)*(Ge=1/Ge),r[1]=(u*Ue-a*je-p*Me)*Ge,r[2]=(F*Ie-$*ce+K*ue)*Ge,r[3]=(M*ce-I*Ie-L*ue)*Ge,r[4]=(w*Ze-g*je-b*De)*Ge,r[5]=(i*je-u*Ze+p*De)*Ge,r[6]=($*re-R*Ie-K*Y)*Ge,r[7]=(A*Ie-M*re+L*Y)*Ge,r[8]=(g*Ue-y*Ze+b*Te)*Ge,r[9]=(a*Ze-i*Ue-p*Te)*Ge,r[10]=(R*ce-F*re+K*se)*Ge,r[11]=(I*re-A*ce-L*se)*Ge,r[12]=(y*De-g*Me-w*Te)*Ge,r[13]=(i*Me-a*De+u*Te)*Ge,r[14]=(F*Y-R*ue-$*se)*Ge,r[15]=(A*ue-I*Y+M*se)*Ge,r):null}function Zl(r,t,i){var a=t[0],u=t[1],p=t[2],g=t[3],y=t[4],w=t[5],b=t[6],A=t[7],I=t[8],M=t[9],L=t[10],R=t[11],F=t[12],$=t[13],K=t[14],se=t[15],Y=i[0],re=i[1],ue=i[2],ce=i[3];return r[0]=Y*a+re*y+ue*I+ce*F,r[1]=Y*u+re*w+ue*M+ce*$,r[2]=Y*p+re*b+ue*L+ce*K,r[3]=Y*g+re*A+ue*R+ce*se,r[4]=(Y=i[4])*a+(re=i[5])*y+(ue=i[6])*I+(ce=i[7])*F,r[5]=Y*u+re*w+ue*M+ce*$,r[6]=Y*p+re*b+ue*L+ce*K,r[7]=Y*g+re*A+ue*R+ce*se,r[8]=(Y=i[8])*a+(re=i[9])*y+(ue=i[10])*I+(ce=i[11])*F,r[9]=Y*u+re*w+ue*M+ce*$,r[10]=Y*p+re*b+ue*L+ce*K,r[11]=Y*g+re*A+ue*R+ce*se,r[12]=(Y=i[12])*a+(re=i[13])*y+(ue=i[14])*I+(ce=i[15])*F,r[13]=Y*u+re*w+ue*M+ce*$,r[14]=Y*p+re*b+ue*L+ce*K,r[15]=Y*g+re*A+ue*R+ce*se,r}function yd(r,t,i){var a,u,p,g,y,w,b,A,I,M,L,R,F=i[0],$=i[1],K=i[2];return t===r?(r[12]=t[0]*F+t[4]*$+t[8]*K+t[12],r[13]=t[1]*F+t[5]*$+t[9]*K+t[13],r[14]=t[2]*F+t[6]*$+t[10]*K+t[14],r[15]=t[3]*F+t[7]*$+t[11]*K+t[15]):(u=t[1],p=t[2],g=t[3],y=t[4],w=t[5],b=t[6],A=t[7],I=t[8],M=t[9],L=t[10],R=t[11],r[0]=a=t[0],r[1]=u,r[2]=p,r[3]=g,r[4]=y,r[5]=w,r[6]=b,r[7]=A,r[8]=I,r[9]=M,r[10]=L,r[11]=R,r[12]=a*F+y*$+I*K+t[12],r[13]=u*F+w*$+M*K+t[13],r[14]=p*F+b*$+L*K+t[14],r[15]=g*F+A*$+R*K+t[15]),r}function Hl(r,t,i){var a=i[0],u=i[1],p=i[2];return r[0]=t[0]*a,r[1]=t[1]*a,r[2]=t[2]*a,r[3]=t[3]*a,r[4]=t[4]*u,r[5]=t[5]*u,r[6]=t[6]*u,r[7]=t[7]*u,r[8]=t[8]*p,r[9]=t[9]*p,r[10]=t[10]*p,r[11]=t[11]*p,r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15],r}function _y(r,t,i){var a=Math.sin(i),u=Math.cos(i),p=t[4],g=t[5],y=t[6],w=t[7],b=t[8],A=t[9],I=t[10],M=t[11];return t!==r&&(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r[4]=p*u+b*a,r[5]=g*u+A*a,r[6]=y*u+I*a,r[7]=w*u+M*a,r[8]=b*u-p*a,r[9]=A*u-g*a,r[10]=I*u-y*a,r[11]=M*u-w*a,r}function Qf(r,t,i){var a=Math.sin(i),u=Math.cos(i),p=t[0],g=t[1],y=t[2],w=t[3],b=t[8],A=t[9],I=t[10],M=t[11];return t!==r&&(r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r[0]=p*u-b*a,r[1]=g*u-A*a,r[2]=y*u-I*a,r[3]=w*u-M*a,r[8]=p*a+b*u,r[9]=g*a+A*u,r[10]=y*a+I*u,r[11]=w*a+M*u,r}function Jx(r,t){return r[0]=t[0],r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=t[1],r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=t[2],r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function Qx(r,t,i){var a,u,p,g=i[0],y=i[1],w=i[2],b=Math.hypot(g,y,w);return b0&&(p=1/Math.sqrt(p)),r[0]=t[0]*p,r[1]=t[1]*p,r[2]=t[2]*p,r}function oo(r,t){return r[0]*t[0]+r[1]*t[1]+r[2]*t[2]}function xy(r,t,i){var a=t[0],u=t[1],p=t[2],g=i[0],y=i[1],w=i[2];return r[0]=u*w-p*y,r[1]=p*g-a*w,r[2]=a*y-u*g,r}function Nn(r,t,i){var a=t[0],u=t[1],p=t[2],g=i[3]*a+i[7]*u+i[11]*p+i[15];return r[0]=(i[0]*a+i[4]*u+i[8]*p+i[12])/(g=g||1),r[1]=(i[1]*a+i[5]*u+i[9]*p+i[13])/g,r[2]=(i[2]*a+i[6]*u+i[10]*p+i[14])/g,r}function nw(r,t,i){var a=i[0],u=i[1],p=i[2],g=t[0],y=t[1],w=t[2],b=u*w-p*y,A=p*g-a*w,I=a*y-u*g,M=u*I-p*A,L=p*b-a*I,R=a*A-u*b,F=2*i[3];return A*=F,I*=F,L*=2,R*=2,r[0]=g+(b*=F)+(M*=2),r[1]=y+A+L,r[2]=w+I+R,r}var Ed,Ro=vy,gk=tw,_k=vd;function rw(r,t,i){return r[0]=t[0]*i,r[1]=t[1]*i,r[2]=t[2]*i,r[3]=t[3]*i,r}function iw(r,t){var i=t[0],a=t[1],u=t[2],p=t[3],g=i*i+a*a+u*u+p*p;return g>0&&(g=1/Math.sqrt(g)),r[0]=i*g,r[1]=a*g,r[2]=u*g,r[3]=p*g,r}function Xl(r,t,i){var a=t[0],u=t[1],p=t[2],g=t[3];return r[0]=i[0]*a+i[4]*u+i[8]*p+i[12]*g,r[1]=i[1]*a+i[5]*u+i[9]*p+i[13]*g,r[2]=i[2]*a+i[6]*u+i[10]*p+i[14]*g,r[3]=i[3]*a+i[7]*u+i[11]*p+i[15]*g,r}function ow(){var r=new xi(4);return xi!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r[3]=1,r}function sw(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=1,r}function aw(r,t,i){i*=.5;var a=t[0],u=t[1],p=t[2],g=t[3],y=Math.sin(i),w=Math.cos(i);return r[0]=a*w+g*y,r[1]=u*w+p*y,r[2]=p*w-u*y,r[3]=g*w-a*y,r}function lw(r,t,i){i*=.5;var a=t[0],u=t[1],p=t[2],g=t[3],y=Math.sin(i),w=Math.cos(i);return r[0]=a*w-p*y,r[1]=u*w+g*y,r[2]=p*w+a*y,r[3]=g*w-u*y,r}yy(),Ed=new xi(4),xi!=Float32Array&&(Ed[0]=0,Ed[1]=0,Ed[2]=0,Ed[3]=0);var yk=iw;yy(),ou(1,0,0),ou(0,1,0),ow(),ow(),Kx();const vk=ye([{type:"Float32",name:"a_globe_pos",components:3},{type:"Float32",name:"a_uv",components:2}]),{members:cw}=vk,uw=ye([{name:"a_pos_3",components:3,type:"Int16"}]);var Td=ye([{name:"a_pos",type:"Int16",components:2}]);class wy{constructor(t,i){this.pos=t,this.dir=i}intersectsPlane(t,i,a){const u=oo(i,this.dir);if(Math.abs(u)<1e-6)return!1;const p=((t[0]-this.pos[0])*i[0]+(t[1]-this.pos[1])*i[1]+(t[2]-this.pos[2])*i[2])/u;return a[0]=this.pos[0]+this.dir[0]*p,a[1]=this.pos[1]+this.dir[1]*p,a[2]=this.pos[2]+this.dir[2]*p,!0}closestPointOnSphere(t,i,a){if(function(L,R){var F=L[0],$=L[1],K=L[2],se=R[0],Y=R[1],re=R[2];return Math.abs(F-se)<=Jf*Math.max(1,Math.abs(F),Math.abs(se))&&Math.abs($-Y)<=Jf*Math.max(1,Math.abs($),Math.abs(Y))&&Math.abs(K-re)<=Jf*Math.max(1,Math.abs(K),Math.abs(re))}(this.pos,t)||i===0)return a[0]=a[1]=a[2]=0,!1;const[u,p,g]=this.dir,y=this.pos[0]-t[0],w=this.pos[1]-t[1],b=this.pos[2]-t[2],A=u*u+p*p+g*g,I=2*(y*u+w*p+b*g),M=I*I-4*A*(y*y+w*w+b*b-i*i);if(M<0){const L=Math.max(-I/2,0),R=y+u*L,F=w+p*L,$=b+g*L,K=Math.hypot(R,F,$);return a[0]=R*i/K,a[1]=F*i/K,a[2]=$*i/K,!1}{const L=(-I-Math.sqrt(M))/(2*A);if(L<0){const R=Math.hypot(y,w,b);return a[0]=y*i/R,a[1]=w*i/R,a[2]=b*i/R,!1}return a[0]=y+u*L,a[1]=w+p*L,a[2]=b+g*L,!0}}}class by{constructor(t,i,a,u,p){this.TL=t,this.TR=i,this.BR=a,this.BL=u,this.horizon=p}static fromInvProjectionMatrix(t,i,a){const u=[-1,1,1],p=[1,1,1],g=[1,-1,1],y=[-1,-1,1],w=Nn(u,u,t),b=Nn(p,p,t),A=Nn(g,g,t),I=Nn(y,y,t);return new by(w,b,A,I,i/a)}}class Ey{constructor(t,i){this.points=t,this.planes=i}static fromInvProjectionMatrix(t,i,a,u){const p=Math.pow(2,a),g=[[-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(w=>{const b=Xl([],w,t),A=1/b[3]/i*p;return function(I,M,L){return I[0]=M[0]*L[0],I[1]=M[1]*L[1],I[2]=M[2]*L[2],I[3]=M[3]*L[3],I}(b,b,[A,A,u?1/b[3]:A,A])}),y=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(w=>{const b=Zr([],xy([],Ro([],g[w[0]],g[w[1]]),Ro([],g[w[2]],g[w[1]]))),A=-oo(b,g[w[1]]);return b.concat(A)});return new Ey(g,y)}}class Hr{static fromPoints(t){const i=[1/0,1/0,1/0],a=[-1/0,-1/0,-1/0];for(const u of t)xd(i,i,u),wd(a,a,u);return new Hr(i,a)}static applyTransform(t,i){const a=t.getCorners();for(let u=0;u=0;if(g===0)return 0;g!==i.length&&(a=!1)}if(a)return 2;for(let u=0;u<3;u++){let p=Number.MAX_VALUE,g=-Number.MAX_VALUE;for(let y=0;ythis.max[u]-this.min[u])return 0}return 1}}const Ty=5,hw=6,os=vt/Math.PI/2,xk=16383,Kl=64,Sd=[Kl,32,16],so=-os,ao=os,wk=[new Hr([so,so,so],[ao,ao,ao]),new Hr([so,so,so],[0,0,ao]),new Hr([0,so,so],[ao,0,ao]),new Hr([so,0,so],[0,ao,ao]),new Hr([0,0,so],[ao,ao,ao])];function em(r){return r*os/Id}function dw(r,t,i,a=!0){const u=Bi([],r._camera.position,r.worldSize),p=[t,i,1,1];Xl(p,p,r.pixelMatrixInverse),rw(p,p,1/p[3]);const g=Zr([],Ro([],p,u)),y=r.globeMatrix,w=[y[12],y[13],y[14]],b=Ro([],w,u),A=vd(b),I=Zr([],b),M=r.worldSize/(2*Math.PI),L=oo(I,g),R=Math.asin(M/A);if(R1?null:function(a,u,p,g){const y=Math.sin(p);return a*(Math.sin((1-g)*p)/y)+u*(Math.sin(g*p)/y)}(r.a[t],r.b[t],r.angle,Je(i,0,1))+r.center[t]}function ss(r){if(r.z<=1)return wk[r.z+2*r.y+r.x];const t=Ay(tm(r));return Hr.fromPoints(t)}function Yl(r,t,i){return Bi(r,r,1-i),bd(r,r,t,i)}function pw(r,t){const i=lu(t.zoom);if(i===0)return ss(r);const a=tm(r),u=Ay(a),p=as(a.getWest())*t.worldSize,g=as(a.getEast())*t.worldSize,y=ls(a.getNorth())*t.worldSize,w=ls(a.getSouth())*t.worldSize,b=[p,y,0],A=[g,y,0],I=[p,w,0],M=[g,w,0],L=gy([],t.globeMatrix);return Nn(b,b,L),Nn(A,A,L),Nn(I,I,L),Nn(M,M,L),u[0]=Yl(u[0],I,i),u[1]=Yl(u[1],M,i),u[2]=Yl(u[2],A,i),u[3]=Yl(u[3],b,i),Hr.fromPoints(u)}function fw(r,t,i){for(const a of r)Nn(a,a,t),Bi(a,a,i)}function Ek(r,t,i){const a=t/r.worldSize,u=r.globeMatrix;if(i.z<=1){const Te=ss(i).getCorners();return fw(Te,u,a),Hr.fromPoints(Te)}const p=tm(i),g=Ay(p);fw(g,u,a);const y=Number.MAX_VALUE,w=[-y,-y,-y],b=[y,y,y];if(p.contains(r.center)){for(const Ze of g)xd(b,b,Ze),wd(w,w,Ze);w[2]=0;const Te=r.point,De=[Te.x*a,Te.y*a,0];return xd(b,b,De),wd(w,w,De),new Hr(b,w)}const A=[u[12]*a,u[13]*a,u[14]*a],I=p.getCenter(),M=Je(r.center.lat,-zr,zr),L=Je(I.lat,-zr,zr),R=as(r.center.lng),F=ls(M);let $=R-as(I.lng);const K=F-ls(L);$>.5?$-=1:$<-.5&&($+=1);let se=0;Math.abs($)>Math.abs(K)?se=$>=0?1:3:(se=K>=0?0:2,bd(A,A,[u[4]*a,u[5]*a,u[6]*a],-Math.sin(St(K>=0?p.getSouth():p.getNorth()))*os));const Y=g[se],re=g[(se+1)%4],ue=new bk(Y,re,A),ce=[Sy(ue,0)||Y[0],Sy(ue,1)||Y[1],Sy(ue,2)||Y[2]],Ie=lu(r.zoom);if(Ie>0){const Te=function({x:Ze,y:Me,z:Ue},je,Ge,et,Le){const ot=1/(1<.5?_t=-1:Ct<-.5&&(_t=1),ft=((ft+_t)*je-(et*=je))*Ge+et,st=((st+_t)*je-et)*Ge+et,At=(At*je-(Le*=je))*Ge+Le,tt=(tt*je-Le)*Ge+Le,[[ft,tt,0],[st,tt,0],[st,At,0],[ft,At,0]]}(i,t,r._pixelsPerMercatorPixel,R,F);for(let Ze=0;ZeMath.PI/2*1.01}const yw=St(85),Tk=Math.cos(yw),Sk=Math.sin(yw),Id=63710088e-1,vw=2*Math.PI*Id;class La{constructor(t,i){if(isNaN(t)||isNaN(i))throw new Error(`Invalid LngLat object: (${t}, ${i})`);if(this.lng=+t,this.lat=+i,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new La(xt(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(t){const i=Math.PI/180,a=this.lat*i,u=t.lat*i,p=Math.sin(a)*Math.sin(u)+Math.cos(a)*Math.cos(u)*Math.cos((t.lng-this.lng)*i);return Id*Math.acos(Math.min(p,1))}toBounds(t=0){const i=360*t/40075017,a=i/Math.cos(Math.PI/180*this.lat);return new za(new La(this.lng-a,this.lat-i),new La(this.lng+a,this.lat+i))}toEcef(t){const i=em(t);return au(this.lat,this.lng,os+i)}static convert(t){if(t instanceof La)return t;if(Array.isArray(t)&&(t.length===2||t.length===3))return new La(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&typeof t=="object"&&t!==null)return new La(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: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}var ln=La;function ky(r){return vw*Math.cos(r*Math.PI/180)}function as(r){return(180+r)/360}function ls(r){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360}function Do(r,t){return r/ky(t)}function Fi(r){return 360*r-180}function Pr(r){return 360/Math.PI*Math.atan(Math.exp((180-360*r)*Math.PI/180))-90}function xw(r,t){return r*ky(Pr(t))}const zr=85.051129;function ww(r){return 1/Math.cos(r*Math.PI/180)}class cu{constructor(t,i,a=0){this.x=+t,this.y=+i,this.z=+a}static fromLngLat(t,i=0){const a=ln.convert(t);return new cu(as(a.lng),ls(a.lat),Do(i,a.lat))}toLngLat(){return new ln(Fi(this.x),Pr(this.y))}toAltitude(){return xw(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/vw*ww(Pr(this.y))}}function My(r,t,i,a,u,p,g,y,w){const b=(t+a)/2,A=(i+u)/2,I=new Ve(b,A);y(I),function(M,L,R,F,$,K){const se=R-$,Y=F-K;return Math.abs((F-L)*se-(R-M)*Y)/Math.hypot(se,Y)}(I.x,I.y,p.x,p.y,g.x,g.y)>=w?(My(r,t,i,b,A,p,I,y,w),My(r,b,A,a,u,I,g,y,w)):r.push(g)}function bw(r,t,i){let a=r[0],u=a.x,p=a.y;t(a);const g=[a];for(let y=1;yr.x+1||ar.y+1)&&wn("Geometry exceeds allowed extent, reduce your vector tile buffer size"),r}function Vs(r,t,i){const a=r.loadGeometry(),u=r.extent,p=vt/u;if(t&&i&&i.projection.isReprojectedInTileSpace){const g=1<{const L=Fi((t.x+M.x/u)/g),R=Pr((t.y+M.y/u)/g),F=A.project(L,R);M.x=(F.x*y-w)*u,M.y=(F.y*y-b)*u};for(let M=0;M=u||R.y<0||R.y>=u||(I(R),L.push(R));a[M]=L}}for(const g of a)for(const y of g)Ck(y,p);return a}function Jl(r,t){return{type:r.type,id:r.id,properties:r.properties,geometry:t?Vs(r):[]}}function rm(r,t,i,a,u){r.emplaceBack(2*t+(a+1)/2,2*i+(u+1)/2)}function im(r,t,i){r.emplaceBack(t.x,t.y,t.z,i[0]*16384,i[1]*16384,i[2]*16384)}class Ly{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(i=>i.id),this.index=t.index,this.hasPattern=!1,this.projection=t.projection,this.layoutVertexArray=new We,this.indexArray=new mt,this.segments=new qn,this.programConfigurations=new Wl(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id)}populate(t,i,a,u){const p=this.layers[0],g=[];let y=null;p.type==="circle"&&(y=p.layout.get("circle-sort-key"));for(const{feature:b,id:A,index:I,sourceLayerIndex:M}of t){const L=this.layers[0]._featureFilter.needGeometry,R=Jl(b,L);if(!this.layers[0]._featureFilter.filter(new C(this.zoom),R,a))continue;const F=y?y.evaluate(R,{},a):void 0,$={id:A,properties:b.properties,type:b.type,sourceLayerIndex:M,index:I,geometry:L?R.geometry:Vs(b,a,u),patterns:{},sortKey:F};g.push($)}y&&g.sort((b,A)=>b.sortKey-A.sortKey);let w=null;u.projection.name==="globe"&&(this.globeExtVertexArray=new Xe,w=u.projection);for(const b of g){const{geometry:A,index:I,sourceLayerIndex:M}=b,L=t[I].feature;this.addFeature(b,A,I,i.availableImages,a,w),i.featureIndex.insert(L,A,I,M,this.index)}}update(t,i,a,u){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,i,this.stateDependentLayers,a,u)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,pk.members),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.globeExtVertexArray&&(this.globeExtVertexBuffer=t.createVertexBuffer(this.globeExtVertexArray,fk.members))),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}addFeature(t,i,a,u,p,g){for(const y of i)for(const w of y){const b=w.x,A=w.y;if(b<0||b>=vt||A<0||A>=vt)continue;if(g){const L=g.projectTilePoint(b,A,p),R=g.upVector(p,b,A),F=this.globeExtVertexArray;im(F,L,R),im(F,L,R),im(F,L,R),im(F,L,R)}const I=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),M=I.vertexLength;rm(this.layoutVertexArray,b,A,-1,-1),rm(this.layoutVertexArray,b,A,1,-1),rm(this.layoutVertexArray,b,A,1,1),rm(this.layoutVertexArray,b,A,-1,1),this.indexArray.emplaceBack(M,M+1,M+2),this.indexArray.emplaceBack(M,M+2,M+3),I.vertexLength+=4,I.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,a,{},u,p)}}function Tw(r,t){for(let i=0;i1){if(Ry(r,t))return!0;for(let a=0;a1?i:i.sub(t)._mult(u)._add(t))}function Cw(r,t){let i,a,u,p=!1;for(let g=0;gt.y!=u.y>t.y&&t.x<(u.x-a.x)*(t.y-a.y)/(u.y-a.y)+a.x&&(p=!p)}return p}function Ql(r,t){let i=!1;for(let a=0,u=r.length-1;at.y!=g.y>t.y&&t.x<(g.x-p.x)*(t.y-p.y)/(g.y-p.y)+p.x&&(i=!i)}return i}function Iw(r,t,i,a,u){for(const g of r)if(t<=g.x&&i<=g.y&&a>=g.x&&u>=g.y)return!0;const p=[new Ve(t,i),new Ve(t,u),new Ve(a,u),new Ve(a,i)];if(r.length>2){for(const g of p)if(Ql(r,g))return!0}for(let g=0;gu.x&&t.x>u.x||r.yu.y&&t.y>u.y)return!1;const p=pi(r,t,i[0]);return p!==pi(r,t,i[1])||p!==pi(r,t,i[2])||p!==pi(r,t,i[3])}function uu(r,t,i){const a=t.paint.get(r).value;return a.kind==="constant"?a.value:i.programConfigurations.get(t.id).getMaxValue(r)}function om(r){return Math.sqrt(r[0]*r[0]+r[1]*r[1])}function kw(r,t,i,a,u){if(!t[0]&&!t[1])return r;const p=Ve.convert(t)._mult(u);i==="viewport"&&p._rotate(-a);const g=[];for(let y=0;y0){const Y=i.projection.upVector(b,L.x,L.y);F.x+=Y[0]*A*R,F.y+=Y[1]*A*R,F.z+=Y[2]*A*R}const $=p?L:Rk(F.x,F.y,F.z,a),K=p?r.tilespaceRays.map(Y=>Ok(Y,R)):r.queryGeometry.screenGeometry,se=Xl([],[F.x,F.y,F.z,1],a);if(!g&&p?w*=se[3]/i.cameraToCenterDistance:g&&!p&&(w*=i.cameraToCenterDistance/se[3]),p){const Y=Pr((M.y/vt+b.y)/(1<r.width||u.height>r.height||i.x>r.width-u.width||i.y>r.height-u.height)throw new RangeError("out of range source coordinates for image copy");if(u.width>t.width||u.height>t.height||a.x>t.width-u.width||a.y>t.height-u.height)throw new RangeError("out of range destination coordinates for image copy");const g=r.data,y=t.data;for(let w=0;w{t[r.evaluationKey]=w;const b=r.expression.evaluate(t);u.data[g+y+0]=Math.floor(255*b.r/b.a),u.data[g+y+1]=Math.floor(255*b.g/b.a),u.data[g+y+2]=Math.floor(255*b.b/b.a),u.data[g+y+3]=Math.floor(255*b.a)};if(r.clips)for(let g=0,y=0;g80*i){a=p=r[0],u=g=r[1];for(var R=i;Rp&&(p=y),w>g&&(g=w);b=(b=Math.max(p-a,g-u))!==0?32767/b:0}return kd(M,L,i,a,u,b,0),L}function Ow(r,t,i,a,u){var p,g;if(u===jy(r,t,i,a)>0)for(p=t;p=t;p-=a)g=Nw(p,r[p],r[p+1],g);return g&&am(g,g.next)&&(Pd(g),g=g.next),g}function ec(r,t){if(!r)return r;t||(t=r);var i,a=r;do if(i=!1,a.steiner||!am(a,a.next)&&Wn(a.prev,a,a.next)!==0)a=a.next;else{if(Pd(a),(a=t=a.prev)===a.next)break;i=!0}while(i||a!==t);return t}function kd(r,t,i,a,u,p,g){if(r){!g&&p&&function(A,I,M,L){var R=A;do R.z===0&&(R.z=Ny(R.x,R.y,I,M,L)),R.prevZ=R.prev,R.nextZ=R.next,R=R.next;while(R!==A);R.prevZ.nextZ=null,R.prevZ=null,function(F){var $,K,se,Y,re,ue,ce,Ie,Te=1;do{for(K=F,F=null,re=null,ue=0;K;){for(ue++,se=K,ce=0,$=0;$0||Ie>0&&se;)ce!==0&&(Ie===0||!se||K.z<=se.z)?(Y=K,K=K.nextZ,ce--):(Y=se,se=se.nextZ,Ie--),re?re.nextZ=Y:F=Y,Y.prevZ=re,re=Y;K=se}re.nextZ=null,Te*=2}while(ue>1)}(R)}(r,a,u,p);for(var y,w,b=r;r.prev!==r.next;)if(y=r.prev,w=r.next,p?Vk(r,a,u,p):jk(r))t.push(y.i/i|0),t.push(r.i/i|0),t.push(w.i/i|0),Pd(r),r=w.next,b=w.next;else if((r=w)===b){g?g===1?kd(r=$k(ec(r),t,i),t,i,a,u,p,2):g===2&&Gk(r,t,i,a,u,p):kd(ec(r),t,i,a,u,p,1);break}}}function jk(r){var t=r.prev,i=r,a=r.next;if(Wn(t,i,a)>=0)return!1;for(var u=t.x,p=i.x,g=a.x,y=t.y,w=i.y,b=a.y,A=up?u>g?u:g:p>g?p:g,L=y>w?y>b?y:b:w>b?w:b,R=a.next;R!==t;){if(R.x>=A&&R.x<=M&&R.y>=I&&R.y<=L&&hu(u,y,p,w,g,b,R.x,R.y)&&Wn(R.prev,R,R.next)>=0)return!1;R=R.next}return!0}function Vk(r,t,i,a){var u=r.prev,p=r,g=r.next;if(Wn(u,p,g)>=0)return!1;for(var y=u.x,w=p.x,b=g.x,A=u.y,I=p.y,M=g.y,L=yw?y>b?y:b:w>b?w:b,$=A>I?A>M?A:M:I>M?I:M,K=Ny(L,R,t,i,a),se=Ny(F,$,t,i,a),Y=r.prevZ,re=r.nextZ;Y&&Y.z>=K&&re&&re.z<=se;){if(Y.x>=L&&Y.x<=F&&Y.y>=R&&Y.y<=$&&Y!==u&&Y!==g&&hu(y,A,w,I,b,M,Y.x,Y.y)&&Wn(Y.prev,Y,Y.next)>=0||(Y=Y.prevZ,re.x>=L&&re.x<=F&&re.y>=R&&re.y<=$&&re!==u&&re!==g&&hu(y,A,w,I,b,M,re.x,re.y)&&Wn(re.prev,re,re.next)>=0))return!1;re=re.nextZ}for(;Y&&Y.z>=K;){if(Y.x>=L&&Y.x<=F&&Y.y>=R&&Y.y<=$&&Y!==u&&Y!==g&&hu(y,A,w,I,b,M,Y.x,Y.y)&&Wn(Y.prev,Y,Y.next)>=0)return!1;Y=Y.prevZ}for(;re&&re.z<=se;){if(re.x>=L&&re.x<=F&&re.y>=R&&re.y<=$&&re!==u&&re!==g&&hu(y,A,w,I,b,M,re.x,re.y)&&Wn(re.prev,re,re.next)>=0)return!1;re=re.nextZ}return!0}function $k(r,t,i){var a=r;do{var u=a.prev,p=a.next.next;!am(u,p)&&Bw(u,a,a.next,p)&&Md(u,p)&&Md(p,u)&&(t.push(u.i/i|0),t.push(a.i/i|0),t.push(p.i/i|0),Pd(a),Pd(a.next),a=r=p),a=a.next}while(a!==r);return ec(a)}function Gk(r,t,i,a,u,p){var g=r;do{for(var y=g.next.next;y!==g.prev;){if(g.i!==y.i&&Xk(g,y)){var w=Fw(g,y);return g=ec(g,g.next),w=ec(w,w.next),kd(g,t,i,a,u,p,0),void kd(w,t,i,a,u,p,0)}y=y.next}g=g.next}while(g!==r)}function qk(r,t){return r.x-t.x}function Wk(r,t){var i=function(u,p){var g,y=p,w=u.x,b=u.y,A=-1/0;do{if(b<=y.y&&b>=y.next.y&&y.next.y!==y.y){var I=y.x+(b-y.y)*(y.next.x-y.x)/(y.next.y-y.y);if(I<=w&&I>A&&(A=I,g=y.x=y.x&&y.x>=R&&w!==y.x&&hu(bg.x||y.x===g.x&&Zk(g,y)))&&(g=y,$=M)),y=y.next;while(y!==L);return g}(r,t);if(!i)return t;var a=Fw(i,r);return ec(a,a.next),ec(i,i.next)}function Zk(r,t){return Wn(r.prev,r,t.prev)<0&&Wn(t.next,r,r.next)<0}function Ny(r,t,i,a,u){return(r=1431655765&((r=858993459&((r=252645135&((r=16711935&((r=(r-i)*u|0)|r<<8))|r<<4))|r<<2))|r<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-a)*u|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Hk(r){var t=r,i=r;do(t.x=(r-g)*(p-y)&&(r-g)*(a-y)>=(i-g)*(t-y)&&(i-g)*(p-y)>=(u-g)*(a-y)}function Xk(r,t){return r.next.i!==t.i&&r.prev.i!==t.i&&!function(i,a){var u=i;do{if(u.i!==i.i&&u.next.i!==i.i&&u.i!==a.i&&u.next.i!==a.i&&Bw(u,u.next,i,a))return!0;u=u.next}while(u!==i);return!1}(r,t)&&(Md(r,t)&&Md(t,r)&&function(i,a){var u=i,p=!1,g=(i.x+a.x)/2,y=(i.y+a.y)/2;do u.y>y!=u.next.y>y&&u.next.y!==u.y&&g<(u.next.x-u.x)*(y-u.y)/(u.next.y-u.y)+u.x&&(p=!p),u=u.next;while(u!==i);return p}(r,t)&&(Wn(r.prev,r,t.prev)||Wn(r,t.prev,t))||am(r,t)&&Wn(r.prev,r,r.next)>0&&Wn(t.prev,t,t.next)>0)}function Wn(r,t,i){return(t.y-r.y)*(i.x-t.x)-(t.x-r.x)*(i.y-t.y)}function am(r,t){return r.x===t.x&&r.y===t.y}function Bw(r,t,i,a){var u=cm(Wn(r,t,i)),p=cm(Wn(r,t,a)),g=cm(Wn(i,a,r)),y=cm(Wn(i,a,t));return u!==p&&g!==y||!(u!==0||!lm(r,i,t))||!(p!==0||!lm(r,a,t))||!(g!==0||!lm(i,r,a))||!(y!==0||!lm(i,t,a))}function lm(r,t,i){return t.x<=Math.max(r.x,i.x)&&t.x>=Math.min(r.x,i.x)&&t.y<=Math.max(r.y,i.y)&&t.y>=Math.min(r.y,i.y)}function cm(r){return r>0?1:r<0?-1:0}function Md(r,t){return Wn(r.prev,r,r.next)<0?Wn(r,t,r.next)>=0&&Wn(r,r.prev,t)>=0:Wn(r,t,r.prev)<0||Wn(r,r.next,t)<0}function Fw(r,t){var i=new Uy(r.i,r.x,r.y),a=new Uy(t.i,t.x,t.y),u=r.next,p=t.prev;return r.next=t,t.prev=r,i.next=u,u.prev=i,a.next=i,i.prev=a,p.next=a,a.prev=p,a}function Nw(r,t,i,a){var u=new Uy(r,t,i);return a?(u.next=a.next,u.prev=a,a.next.prev=u,a.next=u):(u.prev=u,u.next=u),u}function Pd(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function Uy(r,t,i){this.i=r,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function jy(r,t,i,a){for(var u=0,p=t,g=i-a;p0&&i.holes.push(a+=r[u-1].length)}return i};var Vy=le(Fy.exports);function Kk(r,t,i,a,u){Uw(r,t,i||0,a||r.length-1,u||Yk)}function Uw(r,t,i,a,u){for(;a>i;){if(a-i>600){var p=a-i+1,g=t-i+1,y=Math.log(p),w=.5*Math.exp(2*y/3),b=.5*Math.sqrt(y*w*(p-w)/p)*(g-p/2<0?-1:1);Uw(r,t,Math.max(i,Math.floor(t-g*w/p+b)),Math.min(a,Math.floor(t+(p-g)*w/p+b)),u)}var A=r[t],I=i,M=a;for(zd(r,i,t),u(r[a],A)>0&&zd(r,i,a);I0;)M--}u(r[i],A)===0?zd(r,i,M):zd(r,++M,a),M<=t&&(i=M+1),t<=M&&(a=M-1)}}function zd(r,t,i){var a=r[t];r[t]=r[i],r[i]=a}function Yk(r,t){return rt?1:0}function $y(r,t){const i=r.length;if(i<=1)return[r];const a=[];let u,p;for(let g=0;g1)for(let g=0;gi.id),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new We,this.indexArray=new mt,this.indexArray2=new fr,this.programConfigurations=new Wl(t.layers,t.zoom),this.segments=new qn,this.segments2=new qn,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id),this.projection=t.projection}populate(t,i,a,u){this.hasPattern=Gy("fill",this.layers,i);const p=this.layers[0].layout.get("fill-sort-key"),g=[];for(const{feature:y,id:w,index:b,sourceLayerIndex:A}of t){const I=this.layers[0]._featureFilter.needGeometry,M=Jl(y,I);if(!this.layers[0]._featureFilter.filter(new C(this.zoom),M,a))continue;const L=p?p.evaluate(M,{},a,i.availableImages):void 0,R={id:w,properties:y.properties,type:y.type,sourceLayerIndex:A,index:b,geometry:I?M.geometry:Vs(y,a,u),patterns:{},sortKey:L};g.push(R)}p&&g.sort((y,w)=>y.sortKey-w.sortKey);for(const y of g){const{geometry:w,index:b,sourceLayerIndex:A}=y;if(this.hasPattern){const I=qy("fill",this.layers,y,this.zoom,i);this.patternFeatures.push(I)}else this.addFeature(y,w,b,a,{},i.availableImages);i.featureIndex.insert(t[b].feature,w,b,A,this.index)}}update(t,i,a,u){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,i,this.stateDependentLayers,a,u)}addFeatures(t,i,a,u,p){for(const g of this.patternFeatures)this.addFeature(g,g.geometry,g.index,i,a,u)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Uk),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,i,a,u,p,g=[]){for(const y of $y(i,500)){let w=0;for(const R of y)w+=R.length;const b=this.segments.prepareSegment(w,this.layoutVertexArray,this.indexArray),A=b.vertexLength,I=[],M=[];for(const R of y){if(R.length===0)continue;R!==y[0]&&M.push(I.length/2);const F=this.segments2.prepareSegment(R.length,this.layoutVertexArray,this.indexArray2),$=F.vertexLength;this.layoutVertexArray.emplaceBack(R[0].x,R[0].y),this.indexArray2.emplaceBack($+R.length-1,$),I.push(R[0].x),I.push(R[0].y);for(let K=1;K>3}if(u--,a===1||a===2)p+=r.readSVarint(),g+=r.readSVarint(),a===1&&(t&&y.push(t),t=[]),t.push(new oM(p,g));else{if(a!==7)throw new Error("unknown command "+a);t&&t.push(t[0].clone())}}return t&&y.push(t),y},du.prototype.bbox=function(){var r=this._pbf;r.pos=this._geometry;for(var t=r.readVarint()+r.pos,i=1,a=0,u=0,p=0,g=1/0,y=-1/0,w=1/0,b=-1/0;r.pos>3}if(a--,i===1||i===2)(u+=r.readSVarint())y&&(y=u),(p+=r.readSVarint())b&&(b=p);else if(i!==7)throw new Error("unknown command "+i)}return[g,w,y,b]},du.prototype.toGeoJSON=function(r,t,i){var a,u,p=this.extent*Math.pow(2,i),g=this.extent*r,y=this.extent*t,w=this.loadGeometry(),b=du.types[this.type];function A(L){for(var R=0;R>3;u=g===1?a.readString():g===2?a.readFloat():g===3?a.readDouble():g===4?a.readVarint64():g===5?a.readVarint():g===6?a.readSVarint():g===7?a.readBoolean():null}return u}(i))}$w.prototype.feature=function(r){if(r<0||r>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[r];var t=this._pbf.readVarint()+this._pbf.pos;return new lM(this._pbf,t,this.extent,this._keys,this._values)};var uM=Vw;function hM(r,t,i){if(r===3){var a=new uM(i,i.readVarint()+i.pos);a.length&&(t[a.name]=a)}}var Wy=hm.VectorTile=function(r,t){this.layers=r.readFields(hM,{},t)},dm=hm.VectorTileFeature=jw;function pm(r,t,i,a){const u=[],p=a===0?(g,y,w,b,A,I)=>{g.push(new Ve(I,w+(I-y)/(b-y)*(A-w)))}:(g,y,w,b,A,I)=>{g.push(new Ve(y+(I-w)/(A-w)*(b-y),I))};for(const g of r){const y=[];for(const w of g){if(w.length<=2)continue;const b=[];for(let M=0;Mt&&p(b,L,R,F,$,t):K>i?se=t&&p(b,L,R,F,$,t),se>i&&K<=i&&p(b,L,R,F,$,i)}let A=w[w.length-1];const I=a===0?A.x:A.y;I>=t&&I<=i&&b.push(A),b.length&&(A=b[b.length-1],b[0].x===A.x&&b[0].y===A.y||b.push(b[0]),y.push(b))}y.length&&u.push(y)}return u}hm.VectorTileLayer=Vw;const dM=dm.types,pM=Math.pow(2,13);function Ld(r,t,i,a,u,p,g,y){r.emplaceBack((t<<1)+g,(i<<1)+p,(Math.floor(a*pM)<<1)+u,Math.round(y))}function Rd(r,t,i){r.emplaceBack(t.x,t.y,t.z,i[0]*16384,i[1]*16384,i[2]*16384)}class Gw{constructor(){this.acc=new Ve(0,0),this.polyCount=[]}startRing(t){this.currentPolyCount={edges:0,top:0},this.polyCount.push(this.currentPolyCount),this.min||(this.min=new Ve(t.x,t.y),this.max=new Ve(t.x,t.y))}append(t,i){this.currentPolyCount.edges++,this.acc._add(t);const a=this.min,u=this.max;t.xu.x&&(u.x=t.x),t.yu.y&&(u.y=t.y),((t.x===0||t.x===vt)&&t.x===i.x)!=((t.y===0||t.y===vt)&&t.y===i.y)&&this.processBorderOverlap(t,i),i.x<0!=t.x<0&&this.addBorderIntersection(0,Wt(i.y,t.y,(0-i.x)/(t.x-i.x))),i.x>vt!=t.x>vt&&this.addBorderIntersection(1,Wt(i.y,t.y,(vt-i.x)/(t.x-i.x))),i.y<0!=t.y<0&&this.addBorderIntersection(2,Wt(i.x,t.x,(0-i.y)/(t.y-i.y))),i.y>vt!=t.y>vt&&this.addBorderIntersection(3,Wt(i.x,t.x,(vt-i.y)/(t.y-i.y)))}addBorderIntersection(t,i){this.borders||(this.borders=[[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE]]);const a=this.borders[t];ia[1]&&(a[1]=i)}processBorderOverlap(t,i){if(t.x===i.x){if(t.y===i.y)return;const a=t.x===0?0:1;this.addBorderIntersection(a,i.y),this.addBorderIntersection(a,t.y)}else{const a=t.y===0?2:3;this.addBorderIntersection(a,i.x),this.addBorderIntersection(a,t.x)}}centroid(){const t=this.polyCount.reduce((i,a)=>i+a.edges,0);return t!==0?this.acc.div(t)._round():new Ve(0,0)}span(){return new Ve(this.max.x-this.min.x,this.max.y-this.min.y)}intersectsCount(){return this.borders.reduce((t,i)=>t+ +(i[0]!==Number.MAX_VALUE),0)}}class Dd{constructor(t){this.zoom=t.zoom,this.canonical=t.canonical,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(i=>i.id),this.index=t.index,this.hasPattern=!1,this.edgeRadius=0,this.projection=t.projection,this.layoutVertexArray=new Fe,this.centroidVertexArray=new Mo,this.indexArray=new mt,this.programConfigurations=new Wl(t.layers,t.zoom),this.segments=new qn,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id),this.enableTerrain=t.enableTerrain}populate(t,i,a,u){this.features=[],this.hasPattern=Gy("fill-extrusion",this.layers,i),this.featuresOnBorder=[],this.borders=[[],[],[],[]],this.borderDoneWithNeighborZ=[-1,-1,-1,-1],this.tileToMeter=function(p){const g=Math.exp(Math.PI*(1-p.y/(1<=0;K--){const se=L[K];(se.length===0||(R=se[0]).every(Y=>Y.x<=0)||R.every(Y=>Y.x>=vt)||R.every(Y=>Y.y<=0)||R.every(Y=>Y.y>=vt))&&L.splice(K,1)}var R;let F;if(A)F=Yw(L,w,u);else{F=[];for(const K of L)F.push({polygon:K,bounds:w})}const $=M?this.edgeRadius:0;for(const{polygon:K,bounds:se}of F){let Y=0,re=0;for(const ce of K)M&&!ce[0].equals(ce[ce.length-1])&&ce.push(ce[0]),re+=M?ce.length-1:ce.length;const ue=this.segments.prepareSegment((M?5:4)*re,this.layoutVertexArray,this.indexArray);if(M){const ce=[],Ie=[];Y=ue.vertexLength;for(const De of K){let Ze,Me;De.length&&De!==K[0]&&Ie.push(ce.length/2),Ze=De[1].sub(De[0])._perp()._unit();for(let Ue=1;Ue4&&Hw(ce[ce.length-2],ce[0],ce[1]),Me=$?fM(ce[ce.length-2],ce[0],ce[1],$):0;Te=ce[1].sub(ce[0])._perp()._unit();let Ue=!0;for(let je=1,Ge=0;je0?1:0,tt=et.dist(Le);if(Ge+tt>32768&&(Ge=0),$){De=ot.sub(Le)._perp()._unit();let It=Ww(et,Le,ot,qw(Te,De),$);isNaN(It)&&(It=0);const bt=Le.sub(et)._unit();et=et.add(bt.mult(Me))._round(),Le=Le.add(bt.mult(-It))._round(),Me=It,Te=De}const _t=ue.vertexLength,Ct=ce.length>4&&Hw(et,Le,ot);let Ht=Xw(Ge,Ze,Ue);if(Ld(this.layoutVertexArray,et.x,et.y,st,At,0,0,Ht),Ld(this.layoutVertexArray,et.x,et.y,st,At,0,1,Ht),Ge+=tt,Ht=Xw(Ge,Ct,!Ue),Ze=Ct,Ld(this.layoutVertexArray,Le.x,Le.y,st,At,0,0,Ht),Ld(this.layoutVertexArray,Le.x,Le.y,st,At,0,1,Ht),ue.vertexLength+=4,this.indexArray.emplaceBack(_t+0,_t+1,_t+2),this.indexArray.emplaceBack(_t+1,_t+3,_t+2),ue.primitiveLength+=2,$){const It=Y+(je===1?ce.length-2:je-2),bt=je===1?Y:It+1;if(this.indexArray.emplaceBack(_t+1,It,_t+3),this.indexArray.emplaceBack(It,bt,_t+3),ue.primitiveLength+=2,Ie===void 0&&(Ie=_t),!Zw(ot,ce[je],se)){const bn=je===ce.length-1?Ie:ue.vertexLength;this.indexArray.emplaceBack(_t+2,_t+3,bn),this.indexArray.emplaceBack(_t+3,bn+1,bn),this.indexArray.emplaceBack(_t+3,bt,bn+1),ue.primitiveLength+=3}Ue=!Ue}if(A){const It=this.layoutVertexExtArray,bt=b.projectTilePoint(et.x,et.y,u),bn=b.projectTilePoint(Le.x,Le.y,u),zt=b.upVector(u,et.x,et.y),Lt=b.upVector(u,Le.x,Le.y);Rd(It,bt,zt),Rd(It,bt,zt),Rd(It,bn,Lt),Rd(It,bn,Lt)}}M&&(Y+=ce.length-1)}}if(I&&I.polyCount.length>0){if(I.borders){I.vertexArrayOffset=this.centroidVertexArray.length;const K=I.borders,se=this.featuresOnBorder.push(I)-1;for(let Y=0;Y<4;Y++)K[Y][0]!==Number.MAX_VALUE&&this.borders[Y].push(se)}this.encodeCentroid(I.borders?void 0:I.centroid(),I)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,a,p,g,u)}sortBorders(){for(let t=0;t<4;t++)this.borders[t].sort((i,a)=>this.featuresOnBorder[i].borders[t][0]-this.featuresOnBorder[a].borders[t][0])}encodeCentroid(t,i,a=!0){let u,p;if(t)if(t.y!==0){const y=i.span()._mult(this.tileToMeter);u=(Math.max(t.x,1)<<3)+Math.min(7,Math.round(y.x/10)),p=(Math.max(t.y,1)<<3)+Math.min(7,Math.round(y.y/10))}else u=Math.ceil(7*(t.x+450)),p=0;else u=0,p=+a;let g=a?this.centroidVertexArray.length:i.vertexArrayOffset;for(const y of i.polyCount){a&&this.centroidVertexArray.resize(this.centroidVertexArray.length+4*y.edges+y.top);for(let w=0;wi[1].x&&t.x>i[1].x||r.yi[1].y&&t.y>i[1].y}function Hw(r,t,i){if(r.x<0||r.x>=vt||t.x<0||t.x>=vt||i.x<0||i.x>=vt)return!1;const a=i.sub(t),u=a.perp(),p=r.sub(t);return(a.x*p.x+a.y*p.y)/Math.sqrt((a.x*a.x+a.y*a.y)*(p.x*p.x+p.y*p.y))>-.866&&u.x*p.x+u.y*p.y<0}function Xw(r,t,i){const a=t?2|r:-3&r;return i?1|a:-2&a}function Kw(){const r=Math.PI/32,t=Math.tan(r),i=Id;return i*Math.sqrt(1+2*t*t)-i}function Yw(r,t,i){const a=1<{for(const Te of ce)R.push({polygon:Te,bounds:Ie})},$=Math.ceil(Math.log2(A)),K=Math.ceil(Math.log2(I)),se=$-K,Y=[];for(let ce=0;ce0?0:1);for(let ce=0;ceIe+1?ue.push({polygons:Ge,bounds:Le,depth:Ie+1}):F(Ge,Le)}if(et.length){const Le=[new Ve(Te===0?je:De.x,Te===1?je:De.y),Ze];Y.length>Ie+1?ue.push({polygons:et,bounds:Le,depth:Ie+1}):F(et,Le)}}return R}(r,t,Math.ceil((p-u)/11.25),Math.ceil((g-y)/11.25),1,(w,b,A)=>{if(w===0)return .5*(b+A);{const I=Pr((i.y+b/vt)/a);return(ls(.5*(Pr((i.y+A/vt)/a)+I))*a-i.y)*vt}})}dt(Dd,"FillExtrusionBucket",{omit:["layers","features"]}),dt(Gw,"PartMetadata");const mM=new ee({"fill-extrusion-edge-radius":new B(Re["layout_fill-extrusion"]["fill-extrusion-edge-radius"])});var gM={paint:new ee({"fill-extrusion-opacity":new B(Re["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new q(Re["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new B(Re["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new B(Re["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new q(Re["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new q(Re["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new q(Re["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new B(Re["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]),"fill-extrusion-ambient-occlusion-intensity":new B(Re["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-intensity"]),"fill-extrusion-ambient-occlusion-radius":new B(Re["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-radius"]),"fill-extrusion-rounded-roof":new B(Re["paint_fill-extrusion"]["fill-extrusion-rounded-roof"])}),layout:mM};function Jw(r,t,i){var a=2*Math.PI*6378137/256/Math.pow(2,i);return[r*a-2*Math.PI*6378137/2,t*a-2*Math.PI*6378137/2]}class fm{constructor(t,i,a){this.z=t,this.x=i,this.y=a,this.key=Od(0,t,t,i,a)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,i){const a=function(p,g,y){var w=Jw(256*p,256*(g=Math.pow(2,y)-g-1),y),b=Jw(256*(p+1),256*(g+1),y);return w[0]+","+w[1]+","+b[0]+","+b[1]}(this.x,this.y,this.z),u=function(p,g,y){let w,b="";for(let A=p;A>0;A--)w=1<this.canonical.z?new Xr(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Xr(t,this.wrap,t,this.canonical.x>>i,this.canonical.y>>i)}calculateScaledKey(t,i=!0){if(this.overscaledZ===t&&i)return this.key;if(t>this.canonical.z)return Od(this.wrap*+i,t,this.canonical.z,this.canonical.x,this.canonical.y);{const a=this.canonical.z-t;return Od(this.wrap*+i,t,t,this.canonical.x>>a,this.canonical.y>>a)}}isChildOf(t){if(t.wrap!==this.wrap)return!1;const i=this.canonical.z-t.canonical.z;return t.overscaledZ===0||t.overscaledZ>i&&t.canonical.y===this.canonical.y>>i}children(t){if(this.overscaledZ>=t)return[new Xr(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const i=this.canonical.z+1,a=2*this.canonical.x,u=2*this.canonical.y;return[new Xr(i,this.wrap,i,a,u),new Xr(i,this.wrap,i,a+1,u),new Xr(i,this.wrap,i,a,u+1),new Xr(i,this.wrap,i,a+1,u+1)]}isLessThan(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.yi.id),this.index=t.index,this.projection=t.projection,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(i=>{this.gradients[i.id]={}}),this.layoutVertexArray=new ke,this.layoutVertexArray2=new qe,this.indexArray=new mt,this.programConfigurations=new Wl(t.layers,t.zoom),this.segments=new qn,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id)}populate(t,i,a,u){this.hasPattern=Gy("line",this.layers,i);const p=this.layers[0].layout.get("line-sort-key"),g=[];for(const{feature:A,id:I,index:M,sourceLayerIndex:L}of t){const R=this.layers[0]._featureFilter.needGeometry,F=Jl(A,R);if(!this.layers[0]._featureFilter.filter(new C(this.zoom),F,a))continue;const $=p?p.evaluate(F,{},a):void 0,K={id:I,properties:A.properties,type:A.type,sourceLayerIndex:L,index:M,geometry:R?F.geometry:Vs(A,a,u),patterns:{},sortKey:$};g.push(K)}p&&g.sort((A,I)=>A.sortKey-I.sortKey);const{lineAtlas:y,featureIndex:w}=i,b=this.addConstantDashes(y);for(const A of g){const{geometry:I,index:M,sourceLayerIndex:L}=A;if(b&&this.addFeatureDashes(A,y),this.hasPattern){const R=qy("line",this.layers,A,this.zoom,i);this.patternFeatures.push(R)}else this.addFeature(A,I,M,a,y.positions,i.availableImages);w.insert(t[M].feature,I,M,L,this.index)}}addConstantDashes(t){let i=!1;for(const a of this.layers){const u=a.paint.get("line-dasharray").value,p=a.layout.get("line-cap").value;if(u.kind!=="constant"||p.kind!=="constant")i=!0;else{const g=p.value,y=u.value;if(!y)continue;t.addDash(y,g)}}return i}addFeatureDashes(t,i){const a=this.zoom;for(const u of this.layers){const p=u.paint.get("line-dasharray").value,g=u.layout.get("line-cap").value;if(p.kind==="constant"&&g.kind==="constant")continue;let y,w;if(p.kind==="constant"){if(y=p.value,!y)continue}else y=p.evaluate({zoom:a},t);w=g.kind==="constant"?g.value:g.evaluate({zoom:a},t),i.addDash(y,w),t.patterns[u.id]=i.getKey(y,w)}}update(t,i,a,u){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,i,this.stateDependentLayers,a,u)}addFeatures(t,i,a,u,p){for(const g of this.patternFeatures)this.addFeature(g,g.geometry,g.index,i,a,u)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,xM)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,yM),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&&t.properties.hasOwnProperty("mapbox_clip_start")&&t.properties.hasOwnProperty("mapbox_clip_end"))return{start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}}addFeature(t,i,a,u,p,g){const y=this.layers[0].layout,w=y.get("line-join").evaluate(t,{}),b=y.get("line-cap").evaluate(t,{}),A=y.get("line-miter-limit"),I=y.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(const M of i)this.addLine(M,t,w,b,A,I);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,a,p,g,u)}addLine(t,i,a,u,p,g){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineSoFar=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let K=0;K=2&&t[w-1].equals(t[w-2]);)w--;let b=0;for(;b0;if(Ie&&K>b){const Me=M.dist(L);if(Me>2*A){const Ue=M.sub(M.sub(L)._mult(A/Me)._round());this.updateDistance(L,Ue),this.addCurrentVertex(Ue,F,0,0,I),L=Ue}}const De=L&&R;let Ze=De?a:y?"butt":u;if(De&&Ze==="round"&&(uep&&(Ze="bevel"),Ze==="bevel"&&(ue>2&&(Ze="flipbevel"),ue100)se=$.mult(-1);else{const Me=ue*F.add($).mag()/F.sub($).mag();se._perp()._mult(Me*(Te?-1:1))}this.addCurrentVertex(M,se,0,0,I),this.addCurrentVertex(M,se.mult(-1),0,0,I)}else if(Ze==="bevel"||Ze==="fakeround"){const Me=-Math.sqrt(ue*ue-1),Ue=Te?Me:0,je=Te?0:Me;if(L&&this.addCurrentVertex(M,F,Ue,je,I),Ze==="fakeround"){const Ge=Math.round(180*ce/Math.PI/20);for(let et=1;et2*A){const Ue=M.add(R.sub(M)._mult(A/Me)._round());this.updateDistance(M,Ue),this.addCurrentVertex(Ue,$,0,0,I),M=Ue}}}}addCurrentVertex(t,i,a,u,p,g=!1){const y=i.y*u-i.x,w=-i.y-i.x*u;this.addHalfVertex(t,i.x+i.y*a,i.y-i.x*a,g,!1,a,p),this.addHalfVertex(t,y,w,g,!0,-u,p)}addHalfVertex({x:t,y:i},a,u,p,g,y,w){this.layoutVertexArray.emplaceBack((t<<1)+(p?1:0),(i<<1)+(g?1:0),Math.round(63*a)+128,Math.round(63*u)+128,1+(y===0?0:y<0?-1:1),0,this.lineSoFar),this.lineClips&&this.layoutVertexArray2.emplaceBack(this.scaledDistance,this.lineClipsArray.length,this.lineClips.start,this.lineClips.end);const b=w.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,b),w.primitiveLength++),g?this.e2=b:this.e1=b}updateScaledDistance(){if(this.lineClips){const t=this.totalDistance/(this.lineClips.end-this.lineClips.start);this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=t*this.lineClips.start+this.distance}else this.lineSoFar=this.distance}updateDistance(t,i){this.distance+=t.dist(i),this.updateScaledDistance()}}dt(mm,"LineBucket",{omit:["layers","patternFeatures"]});const EM=new ee({"line-cap":new q(Re.layout_line["line-cap"]),"line-join":new q(Re.layout_line["line-join"]),"line-miter-limit":new B(Re.layout_line["line-miter-limit"]),"line-round-limit":new B(Re.layout_line["line-round-limit"]),"line-sort-key":new q(Re.layout_line["line-sort-key"])});var nb={paint:new ee({"line-opacity":new q(Re.paint_line["line-opacity"]),"line-color":new q(Re.paint_line["line-color"]),"line-translate":new B(Re.paint_line["line-translate"]),"line-translate-anchor":new B(Re.paint_line["line-translate-anchor"]),"line-width":new q(Re.paint_line["line-width"]),"line-gap-width":new q(Re.paint_line["line-gap-width"]),"line-offset":new q(Re.paint_line["line-offset"]),"line-blur":new q(Re.paint_line["line-blur"]),"line-dasharray":new q(Re.paint_line["line-dasharray"]),"line-pattern":new q(Re.paint_line["line-pattern"]),"line-gradient":new Q(Re.paint_line["line-gradient"]),"line-trim-offset":new B(Re.paint_line["line-trim-offset"])}),layout:EM};const rb=new class extends q{possiblyEvaluate(r,t){return t=new C(Math.floor(t.zoom),{now:t.now,fadeDuration:t.fadeDuration,transition:t.transition}),super.possiblyEvaluate(r,t)}evaluate(r,t,i,a){return t=vn({},t,{zoom:Math.floor(t.zoom)}),super.evaluate(r,t,i,a)}}(nb.paint.properties["line-width"].specification);function ib(r,t){return t>0?t+2*r:r}rb.useIntegerZoom=!0;const TM=ye([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_tex_size",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),SM=ye([{name:"a_globe_anchor",components:3,type:"Int16"},{name:"a_globe_normal",components:3,type:"Float32"}],4),AM=ye([{name:"a_projected_pos",components:4,type:"Float32"}],4);ye([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const CM=ye([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]),IM=ye([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"}]);ye([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"tileAnchorX"},{type:"Int16",name:"tileAnchorY"},{type:"Float32",name:"x1"},{type:"Float32",name:"y1"},{type:"Float32",name:"x2"},{type:"Float32",name:"y2"},{type:"Int16",name:"padding"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const ob=ye([{name:"a_pos",components:3,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),kM=ye([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);ye([{name:"triangle",components:3,type:"Uint16"}]),ye([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{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"},{type:"Uint8",name:"flipState"}]),ye([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{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",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),ye([{type:"Float32",name:"offsetX"}]),ye([{type:"Int16",name:"x"},{type:"Int16",name:"y"}]);var Tr=24;const Oo=128;function Zy(r,t){const{expression:i}=t;if(i.kind==="constant")return{kind:"constant",layoutSize:i.evaluate(new C(r+1))};if(i.kind==="source")return{kind:"source"};{const{zoomStops:a,interpolationType:u}=i;let p=0;for(;p{a.text=function(u,p,g){const y=p.layout.get("text-transform").evaluate(g,{});return y==="uppercase"?u=u.toLocaleUpperCase():y==="lowercase"&&(u=u.toLocaleLowerCase()),S.applyArabicShaping&&(u=S.applyArabicShaping(u)),u}(a.text,t,i)}),r}const Fd={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂","←":"↑","→":"↓"};function zM(r){return r==="︶"||r==="﹈"||r==="︸"||r==="﹄"||r==="﹂"||r==="︾"||r==="︼"||r==="︺"||r==="︘"||r==="﹀"||r==="︐"||r==="︓"||r==="︔"||r==="`"||r===" ̄"||r==="︑"||r==="︒"}function LM(r){return r==="︵"||r==="﹇"||r==="︷"||r==="﹃"||r==="﹁"||r==="︽"||r==="︻"||r==="︹"||r==="︗"||r==="︿"}var sb=pn,ab=function(r,t,i,a,u){var p,g,y=8*u-a-1,w=(1<>1,A=-7,I=i?u-1:0,M=i?-1:1,L=r[t+I];for(I+=M,p=L&(1<<-A)-1,L>>=-A,A+=y;A>0;p=256*p+r[t+I],I+=M,A-=8);for(g=p&(1<<-A)-1,p>>=-A,A+=a;A>0;g=256*g+r[t+I],I+=M,A-=8);if(p===0)p=1-b;else{if(p===w)return g?NaN:1/0*(L?-1:1);g+=Math.pow(2,a),p-=b}return(L?-1:1)*g*Math.pow(2,p-a)},lb=function(r,t,i,a,u,p){var g,y,w,b=8*p-u-1,A=(1<>1,M=u===23?Math.pow(2,-24)-Math.pow(2,-77):0,L=a?0:p-1,R=a?1:-1,F=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(y=isNaN(t)?1:0,g=A):(g=Math.floor(Math.log(t)/Math.LN2),t*(w=Math.pow(2,-g))<1&&(g--,w*=2),(t+=g+I>=1?M/w:M*Math.pow(2,1-I))*w>=2&&(g++,w/=2),g+I>=A?(y=0,g=A):g+I>=1?(y=(t*w-1)*Math.pow(2,u),g+=I):(y=t*Math.pow(2,I-1)*Math.pow(2,u),g=0));u>=8;r[i+L]=255&y,L+=R,y/=256,u-=8);for(g=g<0;r[i+L]=255&g,L+=R,g/=256,b-=8);r[i+L-R]|=128*F};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */function pn(r){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(r)?r:new Uint8Array(r||0),this.pos=0,this.type=0,this.length=this.buf.length}pn.Varint=0,pn.Fixed64=1,pn.Bytes=2,pn.Fixed32=5;var Hy=4294967296,cb=1/Hy,ub=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function Gs(r){return r.type===pn.Bytes?r.readVarint()+r.pos:r.pos+1}function mu(r,t,i){return i?4294967296*t+(r>>>0):4294967296*(t>>>0)+(r>>>0)}function hb(r,t,i){var a=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));i.realloc(a);for(var u=i.pos-1;u>=r;u--)i.buf[u+a]=i.buf[u]}function RM(r,t){for(var i=0;i>>8,r[i+2]=t>>>16,r[i+3]=t>>>24}function db(r,t){return(r[t]|r[t+1]<<8|r[t+2]<<16)+(r[t+3]<<24)}pn.prototype={destroy:function(){this.buf=null},readFields:function(r,t,i){for(i=i||this.length;this.pos>3,p=this.pos;this.type=7&a,r(u,t,this),this.pos===p&&this.skip(a)}return t},readMessage:function(r,t){return this.readFields(r,t,this.readVarint()+this.pos)},readFixed32:function(){var r=_m(this.buf,this.pos);return this.pos+=4,r},readSFixed32:function(){var r=db(this.buf,this.pos);return this.pos+=4,r},readFixed64:function(){var r=_m(this.buf,this.pos)+_m(this.buf,this.pos+4)*Hy;return this.pos+=8,r},readSFixed64:function(){var r=_m(this.buf,this.pos)+db(this.buf,this.pos+4)*Hy;return this.pos+=8,r},readFloat:function(){var r=ab(this.buf,this.pos,!0,23,4);return this.pos+=4,r},readDouble:function(){var r=ab(this.buf,this.pos,!0,52,8);return this.pos+=8,r},readVarint:function(r){var t,i,a=this.buf;return t=127&(i=a[this.pos++]),i<128?t:(t|=(127&(i=a[this.pos++]))<<7,i<128?t:(t|=(127&(i=a[this.pos++]))<<14,i<128?t:(t|=(127&(i=a[this.pos++]))<<21,i<128?t:function(u,p,g){var y,w,b=g.buf;if(y=(112&(w=b[g.pos++]))>>4,w<128||(y|=(127&(w=b[g.pos++]))<<3,w<128)||(y|=(127&(w=b[g.pos++]))<<10,w<128)||(y|=(127&(w=b[g.pos++]))<<17,w<128)||(y|=(127&(w=b[g.pos++]))<<24,w<128)||(y|=(1&(w=b[g.pos++]))<<31,w<128))return mu(u,y,p);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(i=a[this.pos]))<<28,r,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var r=this.readVarint();return r%2==1?(r+1)/-2:r/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var r=this.readVarint()+this.pos,t=this.pos;return this.pos=r,r-t>=12&&ub?function(i,a,u){return ub.decode(i.subarray(a,u))}(this.buf,t,r):function(i,a,u){for(var p="",g=a;g239?4:A>223?3:A>191?2:1;if(g+M>u)break;M===1?A<128&&(I=A):M===2?(192&(y=i[g+1]))==128&&(I=(31&A)<<6|63&y)<=127&&(I=null):M===3?(w=i[g+2],(192&(y=i[g+1]))==128&&(192&w)==128&&((I=(15&A)<<12|(63&y)<<6|63&w)<=2047||I>=55296&&I<=57343)&&(I=null)):M===4&&(w=i[g+2],b=i[g+3],(192&(y=i[g+1]))==128&&(192&w)==128&&(192&b)==128&&((I=(15&A)<<18|(63&y)<<12|(63&w)<<6|63&b)<=65535||I>=1114112)&&(I=null)),I===null?(I=65533,M=1):I>65535&&(I-=65536,p+=String.fromCharCode(I>>>10&1023|55296),I=56320|1023&I),p+=String.fromCharCode(I),g+=M}return p}(this.buf,t,r)},readBytes:function(){var r=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,r);return this.pos=r,t},readPackedVarint:function(r,t){if(this.type!==pn.Bytes)return r.push(this.readVarint(t));var i=Gs(this);for(r=r||[];this.pos127;);else if(t===pn.Bytes)this.pos=this.readVarint()+this.pos;else if(t===pn.Fixed32)this.pos+=4;else{if(t!==pn.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(r,t){this.writeVarint(r<<3|t)},realloc:function(r){for(var t=this.length||16;t268435455||r<0?function(t,i){var a,u;if(t>=0?(a=t%4294967296|0,u=t/4294967296|0):(u=~(-t/4294967296),4294967295^(a=~(-t%4294967296))?a=a+1|0:(a=0,u=u+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");i.realloc(10),function(p,g,y){y.buf[y.pos++]=127&p|128,p>>>=7,y.buf[y.pos++]=127&p|128,p>>>=7,y.buf[y.pos++]=127&p|128,p>>>=7,y.buf[y.pos++]=127&p|128,y.buf[y.pos]=127&(p>>>=7)}(a,0,i),function(p,g){var y=(7&p)<<4;g.buf[g.pos++]|=y|((p>>>=3)?128:0),p&&(g.buf[g.pos++]=127&p|((p>>>=7)?128:0),p&&(g.buf[g.pos++]=127&p|((p>>>=7)?128:0),p&&(g.buf[g.pos++]=127&p|((p>>>=7)?128:0),p&&(g.buf[g.pos++]=127&p|((p>>>=7)?128:0),p&&(g.buf[g.pos++]=127&p)))))}(u,i)}(r,this):(this.realloc(4),this.buf[this.pos++]=127&r|(r>127?128:0),r<=127||(this.buf[this.pos++]=127&(r>>>=7)|(r>127?128:0),r<=127||(this.buf[this.pos++]=127&(r>>>=7)|(r>127?128:0),r<=127||(this.buf[this.pos++]=r>>>7&127))))},writeSVarint:function(r){this.writeVarint(r<0?2*-r-1:2*r)},writeBoolean:function(r){this.writeVarint(!!r)},writeString:function(r){r=String(r),this.realloc(4*r.length),this.pos++;var t=this.pos;this.pos=function(a,u,p){for(var g,y,w=0;w55295&&g<57344){if(!y){g>56319||w+1===u.length?(a[p++]=239,a[p++]=191,a[p++]=189):y=g;continue}if(g<56320){a[p++]=239,a[p++]=191,a[p++]=189,y=g;continue}g=y-55296<<10|g-56320|65536,y=null}else y&&(a[p++]=239,a[p++]=191,a[p++]=189,y=null);g<128?a[p++]=g:(g<2048?a[p++]=g>>6|192:(g<65536?a[p++]=g>>12|224:(a[p++]=g>>18|240,a[p++]=g>>12&63|128),a[p++]=g>>6&63|128),a[p++]=63&g|128)}return p}(this.buf,r,this.pos);var i=this.pos-t;i>=128&&hb(t,i,this),this.pos=t-1,this.writeVarint(i),this.pos+=i},writeFloat:function(r){this.realloc(4),lb(this.buf,r,this.pos,!0,23,4),this.pos+=4},writeDouble:function(r){this.realloc(8),lb(this.buf,r,this.pos,!0,52,8),this.pos+=8},writeBytes:function(r){var t=r.length;this.writeVarint(t),this.realloc(t);for(var i=0;i=128&&hb(i,a,this),this.pos=i-1,this.writeVarint(a),this.pos+=a},writeMessage:function(r,t,i){this.writeTag(r,pn.Bytes),this.writeRawMessage(t,i)},writePackedVarint:function(r,t){t.length&&this.writeMessage(r,RM,t)},writePackedSVarint:function(r,t){t.length&&this.writeMessage(r,DM,t)},writePackedBoolean:function(r,t){t.length&&this.writeMessage(r,FM,t)},writePackedFloat:function(r,t){t.length&&this.writeMessage(r,OM,t)},writePackedDouble:function(r,t){t.length&&this.writeMessage(r,BM,t)},writePackedFixed32:function(r,t){t.length&&this.writeMessage(r,NM,t)},writePackedSFixed32:function(r,t){t.length&&this.writeMessage(r,UM,t)},writePackedFixed64:function(r,t){t.length&&this.writeMessage(r,jM,t)},writePackedSFixed64:function(r,t){t.length&&this.writeMessage(r,VM,t)},writeBytesField:function(r,t){this.writeTag(r,pn.Bytes),this.writeBytes(t)},writeFixed32Field:function(r,t){this.writeTag(r,pn.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(r,t){this.writeTag(r,pn.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(r,t){this.writeTag(r,pn.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(r,t){this.writeTag(r,pn.Fixed64),this.writeSFixed64(t)},writeVarintField:function(r,t){this.writeTag(r,pn.Varint),this.writeVarint(t)},writeSVarintField:function(r,t){this.writeTag(r,pn.Varint),this.writeSVarint(t)},writeStringField:function(r,t){this.writeTag(r,pn.Bytes),this.writeString(t)},writeFloatField:function(r,t){this.writeTag(r,pn.Fixed32),this.writeFloat(t)},writeDoubleField:function(r,t){this.writeTag(r,pn.Fixed64),this.writeDouble(t)},writeBooleanField:function(r,t){this.writeVarintField(r,!!t)}};var ym=le(sb);const Xy=3;function $M(r,t,i){t.glyphs=[],r===1&&i.readMessage(GM,t)}function GM(r,t,i){if(r===3){const{id:a,bitmap:u,width:p,height:g,left:y,top:w,advance:b}=i.readMessage(qM,{});t.glyphs.push({id:a,bitmap:new $s({width:p+2*Xy,height:g+2*Xy},u),metrics:{width:p,height:g,left:y,top:w,advance:b}})}else r===4?t.ascender=i.readSVarint():r===5&&(t.descender=i.readSVarint())}function qM(r,t,i){r===1?t.id=i.readVarint():r===2?t.bitmap=i.readBytes():r===3?t.width=i.readVarint():r===4?t.height=i.readVarint():r===5?t.left=i.readSVarint():r===6?t.top=i.readSVarint():r===7&&(t.advance=i.readVarint())}const pb=Xy;function Ky(r){let t=0,i=0;for(const g of r)t+=g.w*g.h,i=Math.max(i,g.w);r.sort((g,y)=>y.h-g.h);const a=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),i),h:1/0}];let u=0,p=0;for(const g of r)for(let y=a.length-1;y>=0;y--){const w=a[y];if(!(g.w>w.w||g.h>w.h)){if(g.x=w.x,g.y=w.y,p=Math.max(p,g.y+g.h),u=Math.max(u,g.x+g.w),g.w===w.w&&g.h===w.h){const b=a.pop();yt.hasImage(a)),t.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const a in t.updatedImages)this.patchUpdatedImage(this.iconPositions[a],t.getImage(a),i),this.patchUpdatedImage(this.patternPositions[a],t.getImage(a),i)}patchUpdatedImage(t,i,a){if(!t||!i||t.version===i.version)return;t.version=i.version;const[u,p]=t.tl;a.update(i.data,void 0,{x:u,y:p})}}dt(Yy,"ImagePosition"),dt(fb,"ImageAtlas");const Ni={horizontal:1,vertical:2,horizontalOnly:3},mb=-17;class Nd{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(t,i){const a=new Nd;return a.scale=t||1,a.fontStack=i,a}static forImage(t){const i=new Nd;return i.imageName=t,i}}class _u{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(t,i){const a=new _u;for(let u=0;u=0&&a>=t&&vm[this.text.charCodeAt(a)];a--)i--;this.text=this.text.substring(t,i),this.sectionIndex=this.sectionIndex.slice(t,i)}substring(t,i){const a=new _u;return a.text=this.text.substring(t,i),a.sectionIndex=this.sectionIndex.slice(t,i),a.sections=this.sections,a}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((t,i)=>Math.max(t,this.sections[i].scale),0)}addTextSection(t,i){this.text+=t.text,this.sections.push(Nd.forText(t.scale,t.fontStack||i));const a=this.sections.length-1;for(let u=0;u=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Jy(r,t,i,a,u,p,g,y,w,b,A,I,M,L,R){const F=_u.fromFeature(r,u);I===Ni.vertical&&F.verticalizePunctuation(M);let $=[];const K=function(ce,Ie,Te,De,Ze,Me){if(!ce)return[];const Ue=[],je=function(ot,ft,st,At,tt,_t){let Ct=0;for(let Ht=0;Ht=0;let et=0;for(let ot=0;ot0&&No>un&&(un=No)}else{const Yr=Te[nr.fontStack];if(!Yr)continue;Yr[Mn]&&(gn=Yr[Mn]);const gr=Ie[nr.fontStack];if(!gr)continue;const No=gr.glyphs[Mn];if(!No)continue;if(Xn=No.metrics,Kn=Mn!==8203?Tr:0,_t){const Tu=gr.ascender!==void 0?Math.abs(gr.ascender):0,Xd=gr.descender!==void 0?Math.abs(gr.descender):0,Kd=(Tu+Xd)*Kt;kn-i/2;){if(g--,g<0)return!1;y-=r[g].dist(p),p=r[g]}y+=r[g].dist(r[g+1]),g++;const w=[];let b=0;for(;ya;)b-=w.shift().angleDelta;if(b>u)return!1;g++,y+=A.dist(I)}return!0}function Eb(r){let t=0;for(let i=0;ib){const R=(b-w)/L,F=Wt(I.x,M.x,R),$=Wt(I.y,M.y,R),K=new qs(F,$,0,M.angleTo(I),A);return!g||bb(r,K,y,g,t)?K:void 0}w+=L}}function KM(r,t,i,a,u,p,g,y,w){const b=Tb(a,p,g),A=Sb(a,u),I=A*g,M=r[0].x===0||r[0].x===w||r[0].y===0||r[0].y===w;return t-I=0&&re=0&&ue=0&&M+b<=A){const ce=new qs(re,ue,0,se,R);ce._round(),a&&!bb(r,ce,p,a,u)||L.push(ce)}}I+=K}return y||L.length||g||(L=Ab(r,I/2,i,a,u,p,g,!0,w)),L}function Cb(r,t,i,a,u){const p=[];for(let g=0;g=a&&I.x>=a||(A.x>=a?A=new Ve(a,A.y+(a-A.x)/(I.x-A.x)*(I.y-A.y))._round():I.x>=a&&(I=new Ve(a,A.y+(a-A.x)/(I.x-A.x)*(I.y-A.y))._round()),A.y>=u&&I.y>=u||(A.y>=u?A=new Ve(A.x+(u-A.y)/(I.y-A.y)*(I.x-A.x),u)._round():I.y>=u&&(I=new Ve(A.x+(u-A.y)/(I.y-A.y)*(I.x-A.x),u)._round()),w&&A.equals(w[w.length-1])||(w=[A],p.push(w)),w.push(I)))))}}return p}dt(qs,"Anchor");const Ud=1e20;function Ib(r,t,i,a,u,p,g,y,w){for(let b=t;b-1);w++,p[w]=y,g[w]=b,g[w+1]=Ud}for(let y=0,w=0;y{let y=this.entries[u];y||(y=this.entries[u]={glyphs:{},requests:{},ranges:{},ascender:void 0,descender:void 0});let w=y.glyphs[p];if(w!==void 0)return void g(null,{stack:u,id:p,glyph:w});if(w=this._tinySDF(y,u,p),w)return y.glyphs[p]=w,void g(null,{stack:u,id:p,glyph:w});const b=Math.floor(p/256);if(256*b>65535)return void g(new Error("glyphs > 65535 not supported"));if(y.ranges[b])return void g(null,{stack:u,id:p,glyph:w});let A=y.requests[b];A||(A=y.requests[b]=[],yu.loadGlyphRange(u,b,this.url,this.requestManager,(I,M)=>{if(M){y.ascender=M.ascender,y.descender=M.descender;for(const L in M.glyphs)this._doesCharSupportLocalGlyph(+L)||(y.glyphs[+L]=M.glyphs[+L]);y.ranges[b]=!0}for(const L of A)L(I,M);delete y.requests[b]})),A.push((I,M)=>{I?g(I):M&&g(null,{stack:u,id:p,glyph:M.glyphs[p]||null})})},(u,p)=>{if(u)i(u);else if(p){const g={};for(const{stack:y,id:w,glyph:b}of p)g[y]===void 0&&(g[y]={}),g[y].glyphs===void 0&&(g[y].glyphs={}),g[y].glyphs[w]=b&&{id:b.id,bitmap:b.bitmap.clone(),metrics:b.metrics},g[y].ascender=this.entries[y].ascender,g[y].descender=this.entries[y].descender;i(null,g)}})}_doesCharSupportLocalGlyph(t){return this.localGlyphMode!==e0.none&&(this.localGlyphMode===e0.all?!!this.localFontFamily:!!this.localFontFamily&&(at["CJK Unified Ideographs"](t)||at["Hangul Syllables"](t)||at.Hiragana(t)||at.Katakana(t)||at["CJK Symbols and Punctuation"](t)))}_tinySDF(t,i,a){const u=this.localFontFamily;if(!u||!this._doesCharSupportLocalGlyph(a))return;let p=t.tinySDF;if(!p){let F="400";/bold/i.test(i)?F="900":/medium/i.test(i)?F="500":/light/i.test(i)&&(F="200"),p=t.tinySDF=new yu.TinySDF({fontFamily:u,fontWeight:F,fontSize:24*Bo,buffer:3*Bo,radius:8*Bo}),p.fontWeight=F}if(this.localGlyphs[p.fontWeight][a])return this.localGlyphs[p.fontWeight][a];const g=String.fromCharCode(a),{data:y,width:w,height:b,glyphWidth:A,glyphHeight:I,glyphLeft:M,glyphTop:L,glyphAdvance:R}=p.draw(g);return this.localGlyphs[p.fontWeight][a]={id:a,bitmap:new $s({width:w,height:b},y),metrics:{width:A/Bo,height:I/Bo,left:M/Bo,top:L/Bo-27,advance:R/Bo,localGlyph:!0}}}}yu.loadGlyphRange=function(r,t,i,a,u){const p=256*t,g=p+255,y=a.transformRequest(a.normalizeGlyphsURL(i).replace("{fontstack}",r).replace("{range}",`${p}-${g}`),Ss.Glyphs);ua(y,(w,b)=>{if(w)u(w);else if(b){const A={},I=function(M){return new ym(M).readFields($M,{})}(b);for(const M of I.glyphs)A[M.id]=M;u(null,{glyphs:A,ascender:I.ascender,descender:I.descender})}})},yu.TinySDF=class{constructor({fontSize:r=24,buffer:t=3,radius:i=8,cutoff:a=.25,fontFamily:u="sans-serif",fontWeight:p="normal",fontStyle:g="normal"}={}){this.buffer=t,this.cutoff=a,this.radius=i;const y=this.size=r+4*t,w=this._createCanvas(y),b=this.ctx=w.getContext("2d",{willReadFrequently:!0});b.font=`${g} ${p} ${r}px ${u}`,b.textBaseline="alphabetic",b.textAlign="left",b.fillStyle="black",this.gridOuter=new Float64Array(y*y),this.gridInner=new Float64Array(y*y),this.f=new Float64Array(y),this.z=new Float64Array(y+1),this.v=new Uint16Array(y)}_createCanvas(r){const t=document.createElement("canvas");return t.width=t.height=r,t}draw(r){const{width:t,actualBoundingBoxAscent:i,actualBoundingBoxDescent:a,actualBoundingBoxLeft:u,actualBoundingBoxRight:p}=this.ctx.measureText(r),g=Math.ceil(i),y=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(p-u))),w=Math.min(this.size-this.buffer,g+Math.ceil(a)),b=y+2*this.buffer,A=w+2*this.buffer,I=Math.max(b*A,0),M=new Uint8ClampedArray(I),L={data:M,width:b,height:A,glyphWidth:y,glyphHeight:w,glyphTop:g,glyphLeft:0,glyphAdvance:t};if(y===0||w===0)return L;const{ctx:R,buffer:F,gridInner:$,gridOuter:K}=this;R.clearRect(F,F,y,w),R.fillText(r,F,F+g);const se=R.getImageData(F,F,y,w);K.fill(Ud,0,I),$.fill(0,0,I);for(let Y=0;Y0?Ie*Ie:0,$[ce]=Ie<0?Ie*Ie:0}}Ib(K,0,0,b,A,b,this.f,this.v,this.z),Ib($,F,F,y,w,b,this.f,this.v,this.z);for(let Y=0;YMe+Ue[1]-Ue[0],R=I.reduce(L,0),F=M.reduce(L,0),$=y-R,K=w-F;let se=0,Y=R,re=0,ue=F,ce=0,Ie=$,Te=0,De=K;if(p.content&&a){const Me=p.content;se=xm(I,0,Me[0]),re=xm(M,0,Me[1]),Y=xm(I,Me[0],Me[2]),ue=xm(M,Me[1],Me[3]),ce=Me[0]-se,Te=Me[1]-re,Ie=Me[2]-Me[0]-Y,De=Me[3]-Me[1]-ue}const Ze=(Me,Ue,je,Ge)=>{const et=wm(Me.stretch-se,Y,b,r.left),Le=bm(Me.fixed-ce,Ie,Me.stretch,R),ot=wm(Ue.stretch-re,ue,A,r.top),ft=bm(Ue.fixed-Te,De,Ue.stretch,F),st=wm(je.stretch-se,Y,b,r.left),At=bm(je.fixed-ce,Ie,je.stretch,R),tt=wm(Ge.stretch-re,ue,A,r.top),_t=bm(Ge.fixed-Te,De,Ge.stretch,F),Ct=new Ve(et,ot),Ht=new Ve(st,ot),It=new Ve(st,tt),bt=new Ve(et,tt),bn=new Ve(Le/g,ft/g),zt=new Ve(At/g,_t/g),Lt=t*Math.PI/180;if(Lt){const mn=Math.sin(Lt),un=Math.cos(Lt),kn=[un,-mn,mn,un];Ct._matMult(kn),Ht._matMult(kn),bt._matMult(kn),It._matMult(kn)}const cn=Me.stretch+Me.fixed,fn=Ue.stretch+Ue.fixed;return{tl:Ct,tr:Ht,bl:bt,br:It,tex:{x:p.paddedRect.x+vu+cn,y:p.paddedRect.y+vu+fn,w:je.stretch+je.fixed-cn,h:Ge.stretch+Ge.fixed-fn},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:bn,pixelOffsetBR:zt,minFontScaleX:Ie/g/b,minFontScaleY:De/g/A,isSDF:i}};if(a&&(p.stretchX||p.stretchY)){const Me=Pb(I,$,R),Ue=Pb(M,K,F);for(let je=0;je0)for(let a=(this.length>>1)-1;a>=0;a--)this._down(a)}push(t){this.data.push(t),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const t=this.data[0],i=this.data.pop();return this.length--,this.length>0&&(this.data[0]=i,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:i,compare:a}=this,u=i[t];for(;t>0;){const p=t-1>>1,g=i[p];if(a(u,g)>=0)break;i[t]=g,t=p}i[t]=u}_down(t){const{data:i,compare:a}=this,u=this.length>>1,p=i[t];for(;t=0)break;i[t]=y,t=g}i[t]=p}}function QM(r,t){return rt?1:0}function eP(r,t=1,i=!1){let a=1/0,u=1/0,p=-1/0,g=-1/0;const y=r[0];for(let L=0;Lp)&&(p=R.x),(!L||R.y>g)&&(g=R.y)}const w=Math.min(p-a,g-u);let b=w/2;const A=new JM([],tP);if(w===0)return new Ve(a,u);for(let L=a;LI.d||!I.d)&&(I=L,i&&console.log("found best %d after %d probes",Math.round(1e4*L.d)/1e4,M)),L.max-I.d<=t||(b=L.h/2,A.push(new xu(L.p.x-b,L.p.y-b,b,r)),A.push(new xu(L.p.x+b,L.p.y-b,b,r)),A.push(new xu(L.p.x-b,L.p.y+b,b,r)),A.push(new xu(L.p.x+b,L.p.y+b,b,r)),M+=4)}return i&&(console.log(`num probes: ${M}`),console.log(`best distance: ${I.d}`)),I.p}function tP(r,t){return t.max-r.max}class xu{constructor(t,i,a,u){this.p=new Ve(t,i),this.h=a,this.d=function(p,g){let y=!1,w=1/0;for(let b=0;bp.y!=F.y>p.y&&p.x<(F.x-R.x)*(p.y-R.y)/(F.y-R.y)+R.x&&(y=!y),w=Math.min(w,Aw(p,R,F))}}return(y?1:-1)*Math.sqrt(w)}(this.p,u),this.max=this.d+this.h*Math.SQRT2}}const wu=7,t0=Number.POSITIVE_INFINITY,nP=Math.sqrt(2);function zb(r,[t,i]){let a=0,u=0;if(i===t0){t<0&&(t=0);const p=t/nP;switch(r){case"top-right":case"top-left":u=p-wu;break;case"bottom-right":case"bottom-left":u=-p+wu;break;case"bottom":u=-t+wu;break;case"top":u=t-wu}switch(r){case"top-right":case"bottom-right":a=-p;break;case"top-left":case"bottom-left":a=p;break;case"left":a=t;break;case"right":a=-t}}else{switch(t=Math.abs(t),i=Math.abs(i),r){case"top-right":case"top-left":case"top":u=i-wu;break;case"bottom-right":case"bottom-left":case"bottom":u=-i+wu}switch(r){case"top-right":case"bottom-right":case"right":a=-t;break;case"top-left":case"bottom-left":case"left":a=t}}return[a,u]}function rP(r,t,i,a,u,p,g,y,w,b){r.createArrays(),r.tilePixelRatio=vt/(512*r.overscaling),r.compareText={},r.iconsNeedLinear=!1;const A=r.layers[0].layout,I=r.layers[0]._unevaluatedLayout._values,M={};if(r.textSizeData.kind==="composite"){const{minZoom:F,maxZoom:$}=r.textSizeData;M.compositeTextSizes=[I["text-size"].possiblyEvaluate(new C(F),y),I["text-size"].possiblyEvaluate(new C($),y)]}if(r.iconSizeData.kind==="composite"){const{minZoom:F,maxZoom:$}=r.iconSizeData;M.compositeIconSizes=[I["icon-size"].possiblyEvaluate(new C(F),y),I["icon-size"].possiblyEvaluate(new C($),y)]}M.layoutTextSize=I["text-size"].possiblyEvaluate(new C(w+1),y),M.layoutIconSize=I["icon-size"].possiblyEvaluate(new C(w+1),y),M.textMaxSize=I["text-size"].possiblyEvaluate(new C(18),y);const L=A.get("text-rotation-alignment")==="map"&&A.get("symbol-placement")!=="point",R=A.get("text-size");for(const F of r.features){const $=A.get("text-font").evaluate(F,{},y).join(","),K=R.evaluate(F,{},y),se=M.layoutTextSize.evaluate(F,{},y),Y=(M.layoutIconSize.evaluate(F,{},y),{horizontal:{},vertical:void 0}),re=F.text;let ue,ce=[0,0];if(re){const De=re.toString(),Ze=A.get("text-letter-spacing").evaluate(F,{},y)*Tr,Me=A.get("text-line-height").evaluate(F,{},y)*Tr,Ue=uy(De)?Ze:0,je=A.get("text-anchor").evaluate(F,{},y),Ge=A.get("text-variable-anchor");if(!Ge){const st=A.get("text-radial-offset").evaluate(F,{},y);ce=st?zb(je,[st*Tr,t0]):A.get("text-offset").evaluate(F,{},y).map(At=>At*Tr)}let et=L?"center":A.get("text-justify").evaluate(F,{},y);const Le=A.get("symbol-placement")==="point",ot=Le?A.get("text-max-width").evaluate(F,{},y)*Tr:1/0,ft=st=>{r.allowVerticalPlacement&&hd(De)&&(Y.vertical=Jy(re,t,i,u,$,ot,Me,je,st,Ue,ce,Ni.vertical,!0,se,K))};if(!L&&Ge){const st=et==="auto"?Ge.map(tt=>n0(tt)):[et];let At=!1;for(let tt=0;tt=0||!hd(De)){const st=Jy(re,t,i,u,$,ot,Me,je,et,Ue,ce,Ni.horizontal,!1,se,K);st&&(Y.horizontal[et]=st)}ft(Le?"left":et)}}let Ie=!1;if(F.icon&&F.icon.name){const De=a[F.icon.name];De&&(ue=HM(u[F.icon.name],A.get("icon-offset").evaluate(F,{},y),A.get("icon-anchor").evaluate(F,{},y)),Ie=De.sdf,r.sdfIcons===void 0?r.sdfIcons=De.sdf:r.sdfIcons!==De.sdf&&wn("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(De.pixelRatio!==r.pixelRatio||A.get("icon-rotate").constantOr(1)!==0)&&(r.iconsNeedLinear=!0))}const Te=Rb(Y.horizontal)||Y.vertical;r.iconsInText||(r.iconsInText=!!Te&&Te.iconsInText),(Te||ue)&&iP(r,F,Y,ue,a,M,se,0,ce,Ie,g,y,b)}p&&r.generateCollisionDebugBuffers(w,r.collisionBoxArray)}function n0(r){switch(r){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function iP(r,t,i,a,u,p,g,y,w,b,A,I,M){let L=p.textMaxSize.evaluate(t,{},I);L===void 0&&(L=g);const R=r.layers[0].layout,F=R.get("icon-offset").evaluate(t,{},I),$=Rb(i.horizontal)||i.vertical,K=M.name==="globe",se=Tr,Y=g/se,re=r.tilePixelRatio*L/se,ue=(je=r.overscaling,r.zoom>18&&je>2&&(je>>=1),Math.max(vt/(512*je),1)*R.get("symbol-spacing")),ce=R.get("text-padding")*r.tilePixelRatio,Ie=R.get("icon-padding")*r.tilePixelRatio,Te=St(R.get("text-max-angle")),De=R.get("text-rotation-alignment")==="map"&&R.get("symbol-placement")!=="point",Ze=R.get("icon-rotation-alignment")==="map"&&R.get("symbol-placement")!=="point",Me=R.get("symbol-placement"),Ue=ue/2;var je;const Ge=R.get("icon-text-fit");let et;a&&Ge!=="none"&&(r.allowVerticalPlacement&&i.vertical&&(et=wb(a,i.vertical,Ge,R.get("icon-text-fit-padding"),F,Y)),$&&(a=wb(a,$,Ge,R.get("icon-text-fit-padding"),F,Y)));const Le=(ot,ft,st)=>{if(ft.x<0||ft.x>=vt||ft.y<0||ft.y>=vt)return;let At=null;if(K){const{x:tt,y:_t,z:Ct}=M.projectTilePoint(ft.x,ft.y,st);At={anchor:new qs(tt,_t,Ct,0,void 0),up:M.upVector(st,ft.x,ft.y)}}(function(tt,_t,Ct,Ht,It,bt,bn,zt,Lt,cn,fn,mn,un,kn,Rn,Zn,hn,nr,Hn,Mn,Kt,Xn,gn,Kr,Kn){const Sr=tt.addToLineVertexArray(_t,Ht);let mr,Yr,gr,No,Tu,Xd,Kd,p2=0,f2=0,m2=0,g2=0,_0=-1,y0=-1;const ds={};let _2=py("");const rc=Ct?Ct.anchor:_t;let v0=0,x0=0;if(Lt._unevaluatedLayout.getValue("text-radial-offset")===void 0?[v0,x0]=Lt.layout.get("text-offset").evaluate(Kt,{},Kn).map(bi=>bi*Tr):(v0=Lt.layout.get("text-radial-offset").evaluate(Kt,{},Kn)*Tr,x0=t0),tt.allowVerticalPlacement&&It.vertical){const bi=It.vertical;if(Rn)Xd=r0(bi),zt&&(Kd=r0(zt));else{const Ei=Lt.layout.get("text-rotate").evaluate(Kt,{},Kn)+90;gr=Em(cn,rc,_t,fn,mn,un,bi,kn,Ei,Zn),zt&&(No=Em(cn,rc,_t,fn,mn,un,zt,nr,Ei))}}if(bt){const bi=Lt.layout.get("icon-rotate").evaluate(Kt,{},Kn),Ei=Lt.layout.get("icon-text-fit")!=="none",Yd=Mb(bt,bi,gn,Ei),b0=zt?Mb(zt,bi,gn,Ei):void 0;Yr=Em(cn,rc,_t,fn,mn,un,bt,nr,bi),p2=4*Yd.length;const y2=tt.iconSizeData;let ic=null;y2.kind==="source"?(ic=[Oo*Lt.layout.get("icon-size").evaluate(Kt,{},Kn)],ic[0]>Ra&&wn(`${tt.layerIds[0]}: Value for "icon-size" is >= ${jd}. Reduce your "icon-size".`)):y2.kind==="composite"&&(ic=[Oo*Xn.compositeIconSizes[0].evaluate(Kt,{},Kn),Oo*Xn.compositeIconSizes[1].evaluate(Kt,{},Kn)],(ic[0]>Ra||ic[1]>Ra)&&wn(`${tt.layerIds[0]}: Value for "icon-size" is >= ${jd}. Reduce your "icon-size".`)),tt.addSymbols(tt.icon,Yd,ic,Mn,Hn,Kt,!1,Ct,_t,Sr.lineStartIndex,Sr.lineLength,-1,Kr,Kn),_0=tt.icon.placedSymbolArray.length-1,b0&&(f2=4*b0.length,tt.addSymbols(tt.icon,b0,ic,Mn,Hn,Kt,Ni.vertical,Ct,_t,Sr.lineStartIndex,Sr.lineLength,-1,Kr,Kn),y0=tt.icon.placedSymbolArray.length-1)}for(const bi in It.horizontal){const Ei=It.horizontal[bi];mr||(_2=py(Ei.text),Rn?Tu=r0(Ei):mr=Em(cn,rc,_t,fn,mn,un,Ei,kn,Lt.layout.get("text-rotate").evaluate(Kt,{},Kn),Zn));const Yd=Ei.positionedLines.length===1;if(m2+=Lb(tt,Ct,_t,Ei,bn,Lt,Rn,Kt,Zn,Sr,It.vertical?Ni.horizontal:Ni.horizontalOnly,Yd?Object.keys(It.horizontal):[bi],ds,_0,Xn,Kr,Kn),Yd)break}It.vertical&&(g2+=Lb(tt,Ct,_t,It.vertical,bn,Lt,Rn,Kt,Zn,Sr,Ni.vertical,["vertical"],ds,y0,Xn,Kr,Kn));let Ua=-1;const w0=(bi,Ei)=>bi?Math.max(bi,Ei):Ei;Ua=w0(Tu,Ua),Ua=w0(Xd,Ua),Ua=w0(Kd,Ua);const zP=Ua>-1?1:0;tt.glyphOffsetArray.length>=Oa.MAX_GLYPHS&&wn("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Kt.sortKey!==void 0&&tt.addToSortKeyRanges(tt.symbolInstances.length,Kt.sortKey),tt.symbolInstances.emplaceBack(rc.x,rc.y,rc.z,_t.x,_t.y,ds.right>=0?ds.right:-1,ds.center>=0?ds.center:-1,ds.left>=0?ds.left:-1,ds.vertical>=0?ds.vertical:-1,_0,y0,_2,mr!==void 0?mr:tt.collisionBoxArray.length,mr!==void 0?mr+1:tt.collisionBoxArray.length,gr!==void 0?gr:tt.collisionBoxArray.length,gr!==void 0?gr+1:tt.collisionBoxArray.length,Yr!==void 0?Yr:tt.collisionBoxArray.length,Yr!==void 0?Yr+1:tt.collisionBoxArray.length,No||tt.collisionBoxArray.length,No?No+1:tt.collisionBoxArray.length,fn,m2,g2,p2,f2,zP,0,v0,x0,Ua)})(r,ft,At,ot,i,a,u,et,r.layers[0],r.collisionBoxArray,t.index,t.sourceLayerIndex,r.index,ce,De,w,0,Ie,Ze,F,t,p,b,A,I)};if(Me==="line")for(const ot of Cb(t.geometry,0,0,vt,vt)){const ft=KM(ot,ue,Te,i.vertical||$,a,se,re,r.overscaling,vt);for(const st of ft)$&&oP(r,$.text,Ue,st)||Le(ot,st,I)}else if(Me==="line-center"){for(const ot of t.geometry)if(ot.length>1){const ft=XM(ot,Te,i.vertical||$,a,se,re);ft&&Le(ot,ft,I)}}else if(t.type==="Polygon")for(const ot of $y(t.geometry,0)){const ft=eP(ot,16);Le(ot[0],new qs(ft.x,ft.y,0,0,void 0),I)}else if(t.type==="LineString")for(const ot of t.geometry)Le(ot,new qs(ot[0].x,ot[0].y,0,0,void 0),I);else if(t.type==="Point")for(const ot of t.geometry)for(const ft of ot)Le([ft],new qs(ft.x,ft.y,0,0,void 0),I)}const jd=255,Ra=jd*Oo;function Lb(r,t,i,a,u,p,g,y,w,b,A,I,M,L,R,F,$){const K=function(re,ue,ce,Ie,Te,De,Ze,Me){const Ue=[];if(ue.positionedLines.length===0)return Ue;const je=Ie.layout.get("text-rotate").evaluate(De,{})*Math.PI/180,Ge=function(st){const At=st[0],tt=st[1],_t=At*tt;return _t>0?[At,-tt]:_t<0?[-At,tt]:At===0?[tt,At]:[tt,-At]}(ce);let et=Math.abs(ue.top-ue.bottom);for(const st of ue.positionedLines)et-=st.lineOffset;const Le=ue.positionedLines.length,ot=et/Le;let ft=ue.top-ce[1];for(let st=0;stRa&&wn(`${r.layerIds[0]}: Value for "text-size" is >= ${jd}. Reduce your "text-size".`)):se.kind==="composite"&&(Y=[Oo*R.compositeTextSizes[0].evaluate(y,{},$),Oo*R.compositeTextSizes[1].evaluate(y,{},$)],(Y[0]>Ra||Y[1]>Ra)&&wn(`${r.layerIds[0]}: Value for "text-size" is >= ${jd}. Reduce your "text-size".`)),r.addSymbols(r.text,K,Y,w,g,y,A,t,i,b.lineStartIndex,b.lineLength,L,F,$);for(const re of I)M[re]=r.text.placedSymbolArray.length-1;return 4*K.length}function Rb(r){for(const t in r)return r[t];return null}function Em(r,t,i,a,u,p,g,y,w,b){let A=g.top,I=g.bottom,M=g.left,L=g.right;const R=g.collisionPadding;if(R&&(M-=R[0],A-=R[1],L+=R[2],I+=R[3]),w){const F=new Ve(M,A),$=new Ve(L,A),K=new Ve(M,I),se=new Ve(L,I),Y=St(w);let re=new Ve(0,0);b&&(re=new Ve(b[0],b[1])),F._rotateAround(Y,re),$._rotateAround(Y,re),K._rotateAround(Y,re),se._rotateAround(Y,re),M=Math.min(F.x,$.x,K.x,se.x),L=Math.max(F.x,$.x,K.x,se.x),A=Math.min(F.y,$.y,K.y,se.y),I=Math.max(F.y,$.y,K.y,se.y)}return r.emplaceBack(t.x,t.y,t.z,i.x,i.y,M,A,L,I,y,a,u,p),r.length-1}function r0(r){r.collisionPadding&&(r.top-=r.collisionPadding[1],r.bottom+=r.collisionPadding[3]);const t=r.bottom-r.top;return t>0?Math.max(10,t):null}function oP(r,t,i,a){const u=r.compareText;if(t in u){const p=u[t];for(let g=p.length-1;g>=0;g--)if(a.dist(p[g])Y&&(re(ce,Ge,Te,De,Ue,je),re(Ge,Ie,Ue,je,Ze,Me))}re(I,M,a,p,u,p),re(M,L,u,p,u,g),re(L,R,u,g,a,g),re(R,I,a,g,a,p),F-=Y,$-=Y,K+=Y,se+=Y;const ue=1/Math.max(K-F,se-$);return{scale:ue,x:F*ue,y:$*ue,x2:K*ue,y2:se*ue,projection:t}}const sP=Lo(new Float32Array(16));class Da{constructor(t){this.spec=t,this.name=t.name,this.wrap=!1,this.requiresDraping=!1,this.supportsWorldCopies=!1,this.supportsTerrain=!1,this.supportsFog=!1,this.supportsFreeCamera=!1,this.zAxisUnit="meters",this.isReprojectedInTileSpace=!0,this.unsupportedLayers=["custom"],this.center=[0,0],this.range=[3.5,7]}project(t,i){return{x:0,y:0,z:0}}unproject(t,i){return new ln(0,0)}projectTilePoint(t,i,a){return{x:t,y:i,z:0}}locationPoint(t,i,a=!0){return t._coordinatePoint(t.locationCoordinate(i),a)}pixelsPerMeter(t,i){return Do(1,t)*i}pixelSpaceConversion(t,i,a){return 1}farthestPixelDistance(t){return Db(t,t.pixelsPerMeter)}pointCoordinate(t,i,a,u){const p=t.horizonLineFromTop(!1),g=new Ve(i,Math.max(p,a));return t.rayIntersectionCoordinate(t.pointRayIntersection(g,u))}pointCoordinate3D(t,i,a){const u=new Ve(i,a);if(t.elevation)return t.elevation.pointCoordinate(u);{const p=this.pointCoordinate(t,u.x,u.y,0);return[p.x,p.y,p.z]}}isPointAboveHorizon(t,i){if(t.elevation)return!this.pointCoordinate3D(t,i.x,i.y);const a=t.horizonLineFromTop();return i.y0?i<-bu+a&&(i=-bu+a):i>bu-a&&(i=bu-a);const g=p/Math.pow(Sm(i),u);let y=g*Math.sin(u*t),w=p-g*Math.cos(u*t);return y=.5*(y/Math.PI+.5),w=.5*(w/Math.PI+.5),{x:y,y:this.southernCenter?w:1-w,z:0}}unproject(t,i){t=(2*t-.5)*Math.PI,this.southernCenter&&(i=1-i),i=(2*(1-i)-.5)*Math.PI;const{n:a,f:u}=this,p=u-i,g=Math.sign(p),y=Math.sign(a)*Math.sqrt(t*t+p*p);let w=Math.atan2(t,Math.abs(p))*g;p*a<0&&(w-=Math.PI*Math.sign(t)*g);const b=Je(Vt(w/a)+this.center[0],-180,180),A=Je(Vt(2*Math.atan(Math.pow(u/y,1/a))-bu),-zr,zr);return new ln(b,this.southernCenter?-A:A)}}class Ob extends Da{constructor(t){super(t),this.wrap=!0,this.supportsWorldCopies=!0,this.supportsTerrain=!0,this.supportsFog=!0,this.supportsFreeCamera=!0,this.isReprojectedInTileSpace=!1,this.unsupportedLayers=[],this.range=null}project(t,i){return{x:as(t),y:ls(i),z:0}}unproject(t,i){const a=Fi(t),u=Pr(i);return new ln(a,u)}}const Bb=St(zr);class hP extends Da{project(t,i){const a=(i=St(i))*i,u=a*a;return{x:.5*((t=St(t))*(.8707-.131979*a+u*(u*(.003971*a-.001529*u)-.013791))/Math.PI+.5),y:1-.5*(i*(1.007226+a*(.015085+u*(.028874*a-.044475-.005916*u)))/Math.PI+1),z:0}}unproject(t,i){t=(2*t-.5)*Math.PI;let a=i=(2*(1-i)-1)*Math.PI,u=25,p=0,g=a*a;do{g=a*a;const b=g*g;p=(a*(1.007226+g*(.015085+b*(.028874*g-.044475-.005916*b)))-i)/(1.007226+g*(.045255+b*(.259866*g-.311325-.005916*11*b))),a=Je(a-p,-Bb,Bb)}while(Math.abs(p)>1e-6&&--u>0);g=a*a;const y=Je(Vt(t/(.8707+g*(g*(g*g*g*(.003971-.001529*g)-.013791)-.131979))),-180,180),w=Vt(a);return new ln(y,w)}}const Fb=St(zr);class dP extends Da{project(t,i){i=St(i),t=St(t);const a=Math.cos(i),u=2/Math.PI,p=Math.acos(a*Math.cos(t/2)),g=Math.sin(p)/p,y=.5*(t*u+2*a*Math.sin(t/2)/g)||0,w=.5*(i+Math.sin(i)/g)||0;return{x:.5*(y/Math.PI+.5),y:1-.5*(w/Math.PI+1),z:0}}unproject(t,i){let a=t=(2*t-.5)*Math.PI,u=i=(2*(1-i)-1)*Math.PI,p=25;const g=1e-6;let y=0,w=0;do{const b=Math.cos(u),A=Math.sin(u),I=2*A*b,M=A*A,L=b*b,R=Math.cos(a/2),F=Math.sin(a/2),$=2*R*F,K=F*F,se=1-L*R*R,Y=se?1/se:0,re=se?Math.acos(b*R)*Math.sqrt(1/se):0,ue=.5*(2*re*b*F+2*a/Math.PI)-t,ce=.5*(re*A+u)-i,Ie=.5*Y*(L*K+re*b*R*M)+1/Math.PI,Te=Y*($*I/4-re*A*F),De=.125*Y*(I*F-re*A*L*$),Ze=.5*Y*(M*R+re*K*b)+.5,Me=Te*De-Ze*Ie;y=(ce*Te-ue*Ze)/Me,w=(ue*De-ce*Ie)/Me,a=Je(a-y,-Math.PI,Math.PI),u=Je(u-w,-Fb,Fb)}while((Math.abs(y)>g||Math.abs(w)>g)&&--p>0);return new ln(Vt(a),Vt(u))}}class Nb extends Da{constructor(t){super(t),this.center=t.center||[0,0],this.parallels=t.parallels||[0,0],this.cosPhi=Math.max(.01,Math.cos(St(this.parallels[0]))),this.scale=1/(2*Math.max(Math.PI*this.cosPhi,1/this.cosPhi)),this.wrap=!0,this.supportsWorldCopies=!0}project(t,i){const{scale:a,cosPhi:u}=this;return{x:St(t)*u*a+.5,y:-Math.sin(St(i))/u*a+.5,z:0}}unproject(t,i){const{scale:a,cosPhi:u}=this,p=-(i-.5)/a,g=Je(Vt((t-.5)/a)/u,-180,180),y=Math.asin(Je(p*u,-1,1)),w=Je(Vt(y),-zr,zr);return new ln(g,w)}}class pP extends Ob{constructor(t){super(t),this.requiresDraping=!0,this.supportsWorldCopies=!1,this.supportsFog=!0,this.zAxisUnit="pixels",this.unsupportedLayers=["debug"],this.range=[3,5]}projectTilePoint(t,i,a){const u=Ad(t,i,a);return Nn(u,u,Cd(ss(a))),{x:u[0],y:u[1],z:u[2]}}locationPoint(t,i){const a=au(i.lat,i.lng),u=Zr([],a),p=t.elevation?t.elevation.getAtPointOrZero(t.locationCoordinate(i),t._centerAltitude):t._centerAltitude;bd(a,a,u,Do(1,0)*vt*p);const g=Lo(new Float64Array(16));return Zl(g,t.pixelMatrix,t.globeMatrix),Nn(a,a,g),new Ve(a[0],a[1])}pixelsPerMeter(t,i){return Do(1,0)*i}pixelSpaceConversion(t,i,a){const u=Do(1,t)*i,p=Wt(Do(1,45)*i,u,a);return this.pixelsPerMeter(t,i)/p}createTileMatrix(t,i,a){const u=Cy(ss(a.canonical));return Zl(new Float64Array(16),t.globeMatrix,u)}createInversionMatrix(t,i){const{center:a}=t,u=Cd(ss(i));return Qf(u,u,St(a.lng)),_y(u,u,St(a.lat)),Hl(u,u,[t._pixelsPerMercatorPixel,t._pixelsPerMercatorPixel,1]),Float32Array.from(u)}pointCoordinate(t,i,a,u){return dw(t,i,a,!0)||new cu(0,0)}pointCoordinate3D(t,i,a){const u=this.pointCoordinate(t,i,a,0);return[u.x,u.y,u.z]}isPointAboveHorizon(t,i){return!dw(t,i.x,i.y,!1)}farthestPixelDistance(t){const i=function(u,p){const g=u.cameraToCenterDistance,y=u._centerAltitude*p,w=u._camera,b=u._camera.forward(),A=js([],Bi([],b,-g),[0,0,y]),I=u.worldSize/(2*Math.PI),M=[0,0,-I],L=u.width/u.height,R=Math.tan(u.fovAboveCenter),F=Bi([],w.up(),R),$=Bi([],w.right(),R*L),K=Zr([],js([],js([],b,F),$)),se=[];let Y;if(new wy(A,K).closestPointOnSphere(M,I,se)){const re=js([],se,M),ue=Ro([],re,A);Y=Math.cos(u.fovAboveCenter)*vd(ue)}else{const re=Ro([],A,M),ue=Ro([],M,A);Zr(ue,ue);const ce=vd(re)-I;Y=Math.sqrt(ce*(ce+2*I));const Ie=Math.acos(Y/(I+ce))-Math.acos(oo(b,ue));Y*=Math.cos(Ie)}return 1.01*Y}(t,this.pixelsPerMeter(t.center.lat,t.worldSize)),a=lu(t.zoom);if(a>0){const u=Db(t,Do(1,t.center.lat)*t.worldSize),p=t.worldSize/(2*Math.PI),g=Math.max(t.width,t.height)/t.worldSize*Math.PI;return Wt(i,u+p*(1-Math.cos(g)),Math.pow(a,10))}return i}upVector(t,i,a){return Ad(i,a,t,1)}upVectorScale(t){return{metersToTile:em(nm(ss(t)))}}}function Ub(r){const t=r.parallels,i=!!t&&Math.abs(t[0]+t[1])<.01;switch(r.name){case"mercator":return new Ob(r);case"equirectangular":return new cP(r);case"naturalEarth":return new hP(r);case"equalEarth":return new lP(r);case"winkelTripel":return new dP(r);case"albers":return i?new Nb(r):new aP(r);case"lambertConformalConic":return i?new Nb(r):new uP(r);case"globe":return new pP(r)}throw new Error(`Invalid projection name: ${r.name}`)}const fP=dm.types,mP=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Am(r,t,i,a,u,p,g,y,w,b,A,I,M){const L=y?Math.min(Ra,Math.round(y[0])):0,R=y?Math.min(Ra,Math.round(y[1])):0;r.emplaceBack(t,i,Math.round(32*a),Math.round(32*u),p,g,(L<<1)+(w?1:0),R,16*b,16*A,256*I,256*M)}function Cm(r,t,i,a,u,p,g){r.emplaceBack(t,i,a,u,p,g)}function Im(r,t,i,a,u){r.emplaceBack(t,i,a,u),r.emplaceBack(t,i,a,u),r.emplaceBack(t,i,a,u),r.emplaceBack(t,i,a,u)}function gP(r){for(const t of r.sections)if(dy(t.text))return!0;return!1}class i0{constructor(t){this.layoutVertexArray=new $e,this.indexArray=new mt,this.programConfigurations=t,this.segments=new qn,this.dynamicLayoutVertexArray=new qe,this.opacityVertexArray=new gt,this.placedSymbolArray=new Gn,this.globeExtVertexArray=new Ye}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(t,i,a,u){this.isEmpty()||(a&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,TM.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,i),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,AM.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,mP,!0),this.globeExtVertexArray.length>0&&(this.globeExtVertexBuffer=t.createVertexBuffer(this.globeExtVertexArray,SM.members,!0)),this.opacityVertexBuffer.itemSize=1),(a||u)&&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(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}}dt(i0,"SymbolBuffers");class o0{constructor(t,i,a){this.layoutVertexArray=new t,this.layoutAttributes=i,this.indexArray=new a,this.segments=new qn,this.collisionVertexArray=new Ut,this.collisionVertexArrayExt=new Ot}upload(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,CM.members,!0),this.collisionVertexBufferExt=t.createVertexBuffer(this.collisionVertexArrayExt,IM.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy(),this.collisionVertexBufferExt.destroy())}}dt(o0,"CollisionBuffers");class Oa{constructor(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(g=>g.id),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.fullyClipped=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Lo([]),this.placementViewportMatrix=Lo([]);const i=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Zy(this.zoom,i["text-size"]),this.iconSizeData=Zy(this.zoom,i["icon-size"]);const a=this.layers[0].layout,u=a.get("symbol-sort-key"),p=a.get("symbol-z-order");this.canOverlap=a.get("text-allow-overlap")||a.get("icon-allow-overlap")||a.get("text-ignore-placement")||a.get("icon-ignore-placement"),this.sortFeaturesByKey=p!=="viewport-y"&&u.constantOr(1)!==void 0,this.sortFeaturesByY=(p==="viewport-y"||p==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,this.writingModes=a.get("text-writing-mode").map(g=>Ni[g]),this.stateDependentLayerIds=this.layers.filter(g=>g.isStateDependent()).map(g=>g.id),this.sourceID=t.sourceID,this.projection=t.projection}createArrays(){this.text=new i0(new Wl(this.layers,this.zoom,t=>/^text/.test(t))),this.icon=new i0(new Wl(this.layers,this.zoom,t=>/^icon/.test(t))),this.glyphOffsetArray=new Wr,this.lineVertexArray=new nu,this.symbolInstances=new En}calculateGlyphDependencies(t,i,a,u,p){for(let g=0;g0)&&(w.value.kind!=="constant"||w.value.value.length>0),M=A.value.kind!=="constant"||!!A.value.value||Object.keys(A.parameters).length>0,L=g.get("symbol-sort-key");if(this.features=[],!I&&!M)return;const R=i.iconDependencies,F=i.glyphDependencies,$=i.availableImages,K=new C(this.zoom);for(const{feature:se,id:Y,index:re,sourceLayerIndex:ue}of t){const ce=p._featureFilter.needGeometry,Ie=Jl(se,ce);if(!p._featureFilter.filter(K,Ie,a))continue;if(ce||(Ie.geometry=Vs(se,a,u)),y&&se.type!==1&&a.z<=5){const Me=Ie.geometry,Ue=.98078528056,je=(Ge,et)=>oo(Ad(Ge.x,Ge.y,a,1),Ad(et.x,et.y,a,1))=0;for(const je of Te.sections)if(je.image)R[je.image.name]=!0;else{const Ge=hd(Te.toString()),et=je.fontStack||Me,Le=F[et]=F[et]||{};this.calculateGlyphDependencies(je.text,Le,Ue,this.allowVerticalPlacement,Ge)}}}g.get("symbol-placement")==="line"&&(this.features=function(se){const Y={},re={},ue=[];let ce=0;function Ie(Me){ue.push(se[Me]),ce++}function Te(Me,Ue,je){const Ge=re[Me];return delete re[Me],re[Ue]=Ge,ue[Ge].geometry[0].pop(),ue[Ge].geometry[0]=ue[Ge].geometry[0].concat(je[0]),Ge}function De(Me,Ue,je){const Ge=Y[Ue];return delete Y[Ue],Y[Me]=Ge,ue[Ge].geometry[0].shift(),ue[Ge].geometry[0]=je[0].concat(ue[Ge].geometry[0]),Ge}function Ze(Me,Ue,je){const Ge=je?Ue[0][Ue[0].length-1]:Ue[0][0];return`${Me}:${Ge.x}:${Ge.y}`}for(let Me=0;MeMe.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((se,Y)=>se.sortKey-Y.sortKey)}update(t,i,a,u){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,i,this.layers,a,u),this.icon.programConfigurations.updatePaintArrays(t,i,this.layers,a,u))}isEmpty(){return this.symbolInstances.length===0&&!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()}getProjection(){return this.projectionInstance||(this.projectionInstance=Ub(this.projection)),this.projectionInstance}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(t,i){const a=this.lineVertexArray.length;if(t.segment!==void 0)for(const{x:u,y:p}of i)this.lineVertexArray.emplaceBack(u,p);return{lineStartIndex:a,lineLength:this.lineVertexArray.length-a}}addSymbols(t,i,a,u,p,g,y,w,b,A,I,M,L,R){const F=t.indexArray,$=t.layoutVertexArray,K=t.globeExtVertexArray,se=t.segments.prepareSegment(4*i.length,$,F,this.canOverlap?g.sortKey:void 0),Y=this.glyphOffsetArray.length,re=se.vertexLength,ue=this.allowVerticalPlacement&&y===Ni.vertical?Math.PI/2:0,ce=g.text&&g.text.sections;for(let Te=0;Te=0?i.rightJustifiedTextSymbolIndex:i.centerJustifiedTextSymbolIndex>=0?i.centerJustifiedTextSymbolIndex:i.leftJustifiedTextSymbolIndex>=0?i.leftJustifiedTextSymbolIndex:i.verticalPlacedTextSymbolIndex>=0?i.verticalPlacedTextSymbolIndex:u),g=gm(this.textSizeData,t,p)/Tr;return this.tilePixelRatio*g}getSymbolInstanceIconSize(t,i,a){const u=this.icon.placedSymbolArray.get(a),p=gm(this.iconSizeData,t,u);return this.tilePixelRatio*p}_commitDebugCollisionVertexUpdate(t,i,a){t.emplaceBack(i,-a,-a),t.emplaceBack(i,a,-a),t.emplaceBack(i,a,a),t.emplaceBack(i,-a,a)}_updateTextDebugCollisionBoxes(t,i,a,u,p,g){for(let y=u;y0}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,i){const a=t.placedSymbolArray.get(i),u=a.vertexStartIndex+4*a.numGlyphs;for(let p=a.vertexStartIndex;pu[y]-u[w]||p[w]-p[y]),g}addToSortKeyRanges(t,i){const a=this.sortKeyRanges[this.sortKeyRanges.length-1];a&&a.sortKey===i?a.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:i,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 i of this.symbolInstanceIndexes){const a=this.symbolInstances.get(i);this.featureSortOrder.push(a.featureIndex);const{rightJustifiedTextSymbolIndex:u,centerJustifiedTextSymbolIndex:p,leftJustifiedTextSymbolIndex:g,verticalPlacedTextSymbolIndex:y,placedIconSymbolIndex:w,verticalPlacedIconSymbolIndex:b}=a;u>=0&&this.addIndicesForPlacedSymbol(this.text,u),p>=0&&p!==u&&this.addIndicesForPlacedSymbol(this.text,p),g>=0&&g!==p&&g!==u&&this.addIndicesForPlacedSymbol(this.text,g),y>=0&&this.addIndicesForPlacedSymbol(this.text,y),w>=0&&this.addIndicesForPlacedSymbol(this.icon,w),b>=0&&this.addIndicesForPlacedSymbol(this.icon,b)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}dt(Oa,"SymbolBucket",{omit:["layers","collisionBoxArray","features","compareText"]}),Oa.MAX_GLYPHS=65535,Oa.addDynamicAttributes=Im;const _P=new ee({"symbol-placement":new B(Re.layout_symbol["symbol-placement"]),"symbol-spacing":new B(Re.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new B(Re.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new q(Re.layout_symbol["symbol-sort-key"]),"symbol-z-order":new B(Re.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new B(Re.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new B(Re.layout_symbol["icon-ignore-placement"]),"icon-optional":new B(Re.layout_symbol["icon-optional"]),"icon-rotation-alignment":new B(Re.layout_symbol["icon-rotation-alignment"]),"icon-size":new q(Re.layout_symbol["icon-size"]),"icon-text-fit":new B(Re.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new B(Re.layout_symbol["icon-text-fit-padding"]),"icon-image":new q(Re.layout_symbol["icon-image"]),"icon-rotate":new q(Re.layout_symbol["icon-rotate"]),"icon-padding":new B(Re.layout_symbol["icon-padding"]),"icon-keep-upright":new B(Re.layout_symbol["icon-keep-upright"]),"icon-offset":new q(Re.layout_symbol["icon-offset"]),"icon-anchor":new q(Re.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new B(Re.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new B(Re.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new B(Re.layout_symbol["text-rotation-alignment"]),"text-field":new q(Re.layout_symbol["text-field"]),"text-font":new q(Re.layout_symbol["text-font"]),"text-size":new q(Re.layout_symbol["text-size"]),"text-max-width":new q(Re.layout_symbol["text-max-width"]),"text-line-height":new q(Re.layout_symbol["text-line-height"]),"text-letter-spacing":new q(Re.layout_symbol["text-letter-spacing"]),"text-justify":new q(Re.layout_symbol["text-justify"]),"text-radial-offset":new q(Re.layout_symbol["text-radial-offset"]),"text-variable-anchor":new B(Re.layout_symbol["text-variable-anchor"]),"text-anchor":new q(Re.layout_symbol["text-anchor"]),"text-max-angle":new B(Re.layout_symbol["text-max-angle"]),"text-writing-mode":new B(Re.layout_symbol["text-writing-mode"]),"text-rotate":new q(Re.layout_symbol["text-rotate"]),"text-padding":new B(Re.layout_symbol["text-padding"]),"text-keep-upright":new B(Re.layout_symbol["text-keep-upright"]),"text-transform":new q(Re.layout_symbol["text-transform"]),"text-offset":new q(Re.layout_symbol["text-offset"]),"text-allow-overlap":new B(Re.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new B(Re.layout_symbol["text-ignore-placement"]),"text-optional":new B(Re.layout_symbol["text-optional"])});var s0={paint:new ee({"icon-opacity":new q(Re.paint_symbol["icon-opacity"]),"icon-color":new q(Re.paint_symbol["icon-color"]),"icon-halo-color":new q(Re.paint_symbol["icon-halo-color"]),"icon-halo-width":new q(Re.paint_symbol["icon-halo-width"]),"icon-halo-blur":new q(Re.paint_symbol["icon-halo-blur"]),"icon-translate":new B(Re.paint_symbol["icon-translate"]),"icon-translate-anchor":new B(Re.paint_symbol["icon-translate-anchor"]),"text-opacity":new q(Re.paint_symbol["text-opacity"]),"text-color":new q(Re.paint_symbol["text-color"],{runtimeType:si,getOverride:r=>r.textColor,hasOverride:r=>!!r.textColor}),"text-halo-color":new q(Re.paint_symbol["text-halo-color"]),"text-halo-width":new q(Re.paint_symbol["text-halo-width"]),"text-halo-blur":new q(Re.paint_symbol["text-halo-blur"]),"text-translate":new B(Re.paint_symbol["text-translate"]),"text-translate-anchor":new B(Re.paint_symbol["text-translate-anchor"])}),layout:_P};class jb{constructor(t){this.type=t.property.overrides?t.property.overrides.runtimeType:da,this.defaultValue=t}evaluate(t){if(t.formattedSection){const i=this.defaultValue.property.overrides;if(i&&i.hasOverride(t.formattedSection))return i.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}}dt(jb,"FormatSectionOverride",{omit:["defaultValue"]});class km extends zo{constructor(t){super(t,s0)}recalculate(t,i){super.recalculate(t,i),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"));const a=this.layout.get("text-writing-mode");if(a){const u=[];for(const p of a)u.indexOf(p)<0&&u.push(p);this.layout._values["text-writing-mode"]=u}else this.layout._values["text-writing-mode"]=this.layout.get("symbol-placement")==="point"?["horizontal"]:["horizontal","vertical"];this._setPaintOverrides()}getValueAndResolveTokens(t,i,a,u){const p=this.layout.get(t).evaluate(i,{},a,u),g=this._unevaluatedLayout._values[t];return g.isDataDriven()||Ta(g.value)||!p?p:function(y,w){return w.replace(/{([^{}]+)}/g,(b,A)=>A in y?String(y[A]):"")}(i.properties,p)}createBucket(t){return new Oa(t)}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(const t of s0.paint.overridableProperties){if(!km.hasPaintOverride(this.layout,t))continue;const i=this.paint.get(t),a=new jb(i),u=new Hc(a,i.property.specification);let p=null;p=i.value.kind==="constant"||i.value.kind==="source"?new ed("source",u):new Bl("composite",u,i.value.zoomStops,i.value._interpolationType),this.paint._values[t]=new Z(i.property,p,i.parameters)}}_handleOverridablePaintPropertyUpdate(t,i,a){return!(!this.layout||i.isDataDriven()||a.isDataDriven())&&km.hasPaintOverride(this.layout,t)}static hasPaintOverride(t,i){const a=t.get("text-field"),u=s0.paint.properties[i];let p=!1;const g=y=>{for(const w of y)if(u.overrides&&u.overrides.hasOverride(w))return void(p=!0)};if(a.value.kind==="constant"&&a.value.value instanceof qr)g(a.value.value.sections);else if(a.value.kind==="source"){const y=b=>{p||(b instanceof Ms&&Ln(b.value)===xl?g(b.value.sections):b instanceof ns?g(b.sections):b.eachChild(y))},w=a.value;w._styleExpression&&y(w._styleExpression.expression)}return p}getProgramConfiguration(t){return new Pa(this,t)}}var yP={paint:new ee({"background-color":new B(Re.paint_background["background-color"]),"background-pattern":new B(Re.paint_background["background-pattern"]),"background-opacity":new B(Re.paint_background["background-opacity"])})},vP={paint:new ee({"raster-opacity":new B(Re.paint_raster["raster-opacity"]),"raster-hue-rotate":new B(Re.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new B(Re.paint_raster["raster-brightness-min"]),"raster-brightness-max":new B(Re.paint_raster["raster-brightness-max"]),"raster-saturation":new B(Re.paint_raster["raster-saturation"]),"raster-contrast":new B(Re.paint_raster["raster-contrast"]),"raster-resampling":new B(Re.paint_raster["raster-resampling"]),"raster-fade-duration":new B(Re.paint_raster["raster-fade-duration"])})};class xP extends zo{constructor(t){super(t,{}),this.implementation=t}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}isLayerDraped(){return this.implementation.renderToTile!==void 0}shouldRedrape(){return!!this.implementation.shouldRerenderTiles&&this.implementation.shouldRerenderTiles()}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){}onAdd(t){this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)}onRemove(t){this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)}}var wP={paint:new ee({"sky-type":new B(Re.paint_sky["sky-type"]),"sky-atmosphere-sun":new B(Re.paint_sky["sky-atmosphere-sun"]),"sky-atmosphere-sun-intensity":new B(Re.paint_sky["sky-atmosphere-sun-intensity"]),"sky-gradient-center":new B(Re.paint_sky["sky-gradient-center"]),"sky-gradient-radius":new B(Re.paint_sky["sky-gradient-radius"]),"sky-gradient":new Q(Re.paint_sky["sky-gradient"]),"sky-atmosphere-halo-color":new B(Re.paint_sky["sky-atmosphere-halo-color"]),"sky-atmosphere-color":new B(Re.paint_sky["sky-atmosphere-color"]),"sky-opacity":new B(Re.paint_sky["sky-opacity"])})};function a0(r,t,i){const a=[0,0,1],u=sw([]);return lw(u,u,i?-St(r)+Math.PI:St(r)),aw(u,u,-St(t)),nw(a,a,u),Zr(a,a)}const bP={circle:class extends zo{constructor(r){super(r,Lk)}createBucket(r){return new Ly(r)}queryRadius(r){const t=r;return uu("circle-radius",this,t)+uu("circle-stroke-width",this,t)+om(this.paint.get("circle-translate"))}queryIntersectsFeature(r,t,i,a,u,p,g,y){const w=Mw(this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),p.angle,r.pixelToTileUnitsFactor),b=this.paint.get("circle-radius").evaluate(t,i)+this.paint.get("circle-stroke-width").evaluate(t,i);return Pw(r,a,p,g,y,this.paint.get("circle-pitch-alignment")==="map",this.paint.get("circle-pitch-scale")==="map",w,b)}getProgramIds(){return["circle"]}getProgramConfiguration(r){return new Pa(this,r)}},heatmap:class extends zo{createBucket(r){return new Lw(r)}constructor(r){super(r,Bk),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(r){r==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=By({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(r){return uu("heatmap-radius",this,r)}queryIntersectsFeature(r,t,i,a,u,p,g,y){const w=this.paint.get("heatmap-radius").evaluate(t,i);return Pw(r,a,p,g,y,!0,!0,new Ve(0,0),w)}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}getProgramIds(){return["heatmap","heatmapTexture"]}getProgramConfiguration(r){return new Pa(this,r)}},hillshade:class extends zo{constructor(r){super(r,Fk)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}getProgramIds(){return["hillshade","hillshadePrepare"]}},fill:class extends zo{constructor(r){super(r,eM)}getProgramIds(){const r=this.paint.get("fill-pattern"),t=r&&r.constantOr(1),i=[t?"fillPattern":"fill"];return this.paint.get("fill-antialias")&&i.push(t&&!this.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline"),i}getProgramConfiguration(r){return new Pa(this,r)}recalculate(r,t){super.recalculate(r,t);const i=this.paint._values["fill-outline-color"];i.value.kind==="constant"&&i.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(r){return new um(r)}queryRadius(){return om(this.paint.get("fill-translate"))}queryIntersectsFeature(r,t,i,a,u,p){return!r.queryGeometry.isAboveHorizon&&Sw(kw(r.tilespaceGeometry,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),p.angle,r.pixelToTileUnitsFactor),a)}isTileClipped(){return!0}},"fill-extrusion":class extends zo{constructor(r){super(r,gM)}createBucket(r){return new Dd(r)}queryRadius(){return om(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}getProgramIds(){return[this.paint.get("fill-extrusion-pattern").constantOr(1)?"fillExtrusionPattern":"fillExtrusion"]}getProgramConfiguration(r){return new Pa(this,r)}queryIntersectsFeature(r,t,i,a,u,p,g,y,w){const b=Mw(this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),p.angle,r.pixelToTileUnitsFactor),A=this.paint.get("fill-extrusion-height").evaluate(t,i),I=this.paint.get("fill-extrusion-base").evaluate(t,i),M=[0,0],L=y&&p.elevation,R=p.elevation?p.elevation.exaggeration():1,F=r.tile.getBucket(this);if(L&&F instanceof Dd){const re=F.centroidVertexArray,ue=w+1;uere.polygon).flat());const $=L?y:null,[K,se]=function(re,ue,ce,Ie,Te,De,Ze,Me,Ue,je,Ge){return re.projection.name==="globe"?function(et,Le,ot,ft,st,At,tt,_t,Ct,Ht,It){const bt=[],bn=[],zt=et.projection.upVectorScale(It,et.center.lat,et.worldSize).metersToTile,Lt=[0,0,0,1],cn=[0,0,0,1],fn=(un,kn,Rn,Zn)=>{un[0]=kn,un[1]=Rn,un[2]=Zn,un[3]=1},mn=Kw();ot>0&&(ot+=mn),ft+=mn;for(const un of Le){const kn=[],Rn=[];for(const Zn of un){const hn=Zn.x+st.x,nr=Zn.y+st.y,Hn=et.projection.projectTilePoint(hn,nr,It),Mn=et.projection.upVector(It,Zn.x,Zn.y);let Kt=ot,Xn=ft;if(tt){const gn=tb(hn,nr,ot,ft,tt,_t,Ct,Ht);Kt+=gn.base,Xn+=gn.top}ot!==0?fn(Lt,Hn.x+Mn[0]*zt*Kt,Hn.y+Mn[1]*zt*Kt,Hn.z+Mn[2]*zt*Kt):fn(Lt,Hn.x,Hn.y,Hn.z),fn(cn,Hn.x+Mn[0]*zt*Xn,Hn.y+Mn[1]*zt*Xn,Hn.z+Mn[2]*zt*Xn),Nn(Lt,Lt,At),Nn(cn,cn,At),kn.push(new pu(Lt[0],Lt[1],Lt[2])),Rn.push(new pu(cn[0],cn[1],cn[2]))}bt.push(kn),bn.push(Rn)}return[bt,bn]}(re,ue,ce,Ie,Te,De,Ze,Me,Ue,je,Ge):Ze?function(et,Le,ot,ft,st,At,tt,_t,Ct){const Ht=[],It=[],bt=[0,0,0,1];for(const bn of et){const zt=[],Lt=[];for(const cn of bn){const fn=cn.x+ft.x,mn=cn.y+ft.y,un=tb(fn,mn,Le,ot,At,tt,_t,Ct);bt[0]=fn,bt[1]=mn,bt[2]=un.base,bt[3]=1,Xl(bt,bt,st),bt[3]=Math.max(bt[3],1e-5);const kn=new pu(bt[0]/bt[3],bt[1]/bt[3],bt[2]/bt[3]);bt[0]=fn,bt[1]=mn,bt[2]=un.top,bt[3]=1,Xl(bt,bt,st),bt[3]=Math.max(bt[3],1e-5);const Rn=new pu(bt[0]/bt[3],bt[1]/bt[3],bt[2]/bt[3]);zt.push(kn),Lt.push(Rn)}Ht.push(zt),It.push(Lt)}return[Ht,It]}(ue,ce,Ie,Te,De,Ze,Me,Ue,je):function(et,Le,ot,ft,st){const At=[],tt=[],_t=st[8]*Le,Ct=st[9]*Le,Ht=st[10]*Le,It=st[11]*Le,bt=st[8]*ot,bn=st[9]*ot,zt=st[10]*ot,Lt=st[11]*ot;for(const cn of et){const fn=[],mn=[];for(const un of cn){const kn=un.x+ft.x,Rn=un.y+ft.y,Zn=st[0]*kn+st[4]*Rn+st[12],hn=st[1]*kn+st[5]*Rn+st[13],nr=st[2]*kn+st[6]*Rn+st[14],Hn=st[3]*kn+st[7]*Rn+st[15],Mn=Zn+_t,Kt=hn+Ct,Xn=nr+Ht,gn=Math.max(Hn+It,1e-5),Kr=Zn+bt,Kn=hn+bn,Sr=nr+zt,mr=Math.max(Hn+Lt,1e-5);fn.push(new pu(Mn/gn,Kt/gn,Xn/gn)),mn.push(new pu(Kr/mr,Kn/mr,Sr/mr))}At.push(fn),tt.push(mn)}return[At,tt]}(ue,ce,Ie,Te,De)}(p,a,I,A,b,g,$,M,R,p.center.lat,r.tileID.canonical),Y=r.queryGeometry;return function(re,ue,ce){let Ie=1/0;Sw(ce,ue)&&(Ie=eb(ce,ue[0]));for(let Te=0;Te=3){for(let R=0;R{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){this._channel=void 0,this._callback=()=>{}}}class TP{constructor(){this.tasks={},this.taskQueue=[],Yi(["process"],this),this.invoker=new EP(this.process),this.nextId=0}add(t,i){const a=this.nextId++,u=function({type:p,isSymbolTile:g,zoom:y}){return y=y||0,p==="message"?0:p!=="maybePrepare"||g?p!=="parseTile"||g?p==="parseTile"&&g?300-y:p==="maybePrepare"&&g?400-y:500:200-y:100-y}(i);if(u===0){vo();try{t()}finally{}return{cancel:()=>{}}}return this.tasks[a]={fn:t,metadata:i,priority:u,id:a},this.taskQueue.push(a),this.invoker.trigger(),{cancel:()=>{delete this.tasks[a]}}}process(){vo();try{if(this.taskQueue=this.taskQueue.filter(a=>!!this.tasks[a]),!this.taskQueue.length)return;const t=this.pick();if(t===null)return;const i=this.tasks[t];if(delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),!i)return;i.fn()}finally{}}pick(){let t=null,i=1/0;for(let u=0;u>=1)>1;){const b=i+u>>1,A=a+p>>1;1&t?(u=i,p=a,i=g,a=y):(i=u,a=p,u=g,p=y),g=b,y=A}const w=4*r;Ba[w+0]=i,Ba[w+1]=a,Ba[w+2]=u,Ba[w+3]=p}const us=new Uint16Array(2178),Fa=new Uint8Array(1089),Mm=new Uint16Array(1089);function Gb(r){return r===0?-.03125:r===32?.03125:0}var qb=ye([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);const Wb={type:2,extent:vt,loadGeometry:()=>[[new Ve(0,0),new Ve(vt+1,0),new Ve(vt+1,vt+1),new Ve(0,vt+1),new Ve(0,0)]]};class l0{constructor(t,i,a,u,p){this.tileID=t,this.uid=ii(),this.uses=0,this.tileSize=i,this.tileZoom=a,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.isRaster=p,this.expiredRequestCount=0,this.state="loading",u&&u.transform&&(this.projection=u.transform.projection)}registerFadeDuration(t){const i=t+this.timeAdded;ip.getLayer(b)).filter(Boolean);if(w.length!==0){y.layers=w,y.stateDependentLayerIds&&(y.stateDependentLayers=y.stateDependentLayerIds.map(b=>w.filter(A=>A.id===b)[0]));for(const b of w)g[b.id]=y}}return g}(t.buckets,i.style),this.hasSymbolBuckets=!1;for(const u in this.buckets){const p=this.buckets[u];if(p instanceof Oa){if(this.hasSymbolBuckets=!0,!a)break;p.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const u in this.buckets){const p=this.buckets[u];if(p instanceof Oa&&p.hasRTLText){this.hasRTLText=!0,S.isLoading()||S.isLoaded()||x()!=="deferred"||T();break}}this.queryPadding=0;for(const u in this.buckets){const p=this.buckets[u];this.queryPadding=Math.max(this.queryPadding,i.style.getLayer(u).queryRadius(p))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage),t.lineAtlas&&(this.lineAtlas=t.lineAtlas)}else this.collisionBoxArray=new an}unloadVectorData(){if(this.hasData()){for(const t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.lineAtlasTexture&&this.lineAtlasTexture.destroy(),this._tileBoundsBuffer&&(this._tileBoundsBuffer.destroy(),this._tileBoundsIndexBuffer.destroy(),this._tileBoundsSegments.destroy(),this._tileBoundsBuffer=null),this._tileDebugBuffer&&(this._tileDebugBuffer.destroy(),this._tileDebugSegments.destroy(),this._tileDebugBuffer=null),this._tileDebugIndexBuffer&&(this._tileDebugIndexBuffer.destroy(),this._tileDebugIndexBuffer=null),this._globeTileDebugBorderBuffer&&(this._globeTileDebugBorderBuffer.destroy(),this._globeTileDebugBorderBuffer=null),this._tileDebugTextBuffer&&(this._tileDebugTextBuffer.destroy(),this._tileDebugTextSegments.destroy(),this._tileDebugTextIndexBuffer.destroy(),this._tileDebugTextBuffer=null),this._globeTileDebugTextBuffer&&(this._globeTileDebugTextBuffer.destroy(),this._globeTileDebugTextBuffer=null),this.latestFeatureIndex=null,this.state="unloaded"}}getBucket(t){return this.buckets[t.id]}upload(t){for(const a in this.buckets){const u=this.buckets[a];u.uploadPending()&&u.upload(t)}const i=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Wd(t,this.imageAtlas.image,i.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Wd(t,this.glyphAtlasImage,i.ALPHA),this.glyphAtlasImage=null),this.lineAtlas&&!this.lineAtlas.uploaded&&(this.lineAtlasTexture=new Wd(t,this.lineAtlas.image,i.ALPHA),this.lineAtlas.uploaded=!0)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,i,a,u,p,g,y,w){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({tileResult:u,pixelPosMatrix:y,transform:g,params:p,tileTransform:this.tileTransform},t,i,a):{}}querySourceFeatures(t,i){const a=this.latestFeatureIndex;if(!a||!a.rawTileData)return;const u=a.loadVTLayers(),p=i?i.sourceLayer:"",g=u._geojsonTileLayer||u[p];if(!g)return;const y=Jc(i&&i.filter),{z:w,x:b,y:A}=this.tileID.canonical,I={z:w,x:b,y:A};for(let M=0;Ma)u=!1;else if(i)if(this.expirationTime=0;$--){const K=4*$,se=Ba[K+0],Y=Ba[K+1],re=Ba[K+2],ue=Ba[K+3],ce=se+re>>1,Ie=Y+ue>>1,Te=ce+Ie-Y,De=Ie+se-ce,Ze=Y*cs+se,Me=ue*cs+re,Ue=Ie*cs+ce,je=Math.hypot((us[2*Ze+0]+us[2*Me+0])/2-us[2*Ue+0],(us[2*Ze+1]+us[2*Me+1])/2-us[2*Ue+1])>=16;Fa[Ue]=Fa[Ue]||(je?1:0),$<1022&&(Fa[Ue]=Fa[Ue]||Fa[(Y+De>>1)*cs+(se+Te>>1)]||Fa[(ue+De>>1)*cs+(re+Te>>1)])}const I=new Fe,M=new mt;let L=0;function R($,K){const se=K*cs+$;return Mm[se]===0&&(I.emplaceBack(us[2*se+0],us[2*se+1],$*vt/lo,K*vt/lo),Mm[se]=++L),Mm[se]-1}function F($,K,se,Y,re,ue){const ce=$+se>>1,Ie=K+Y>>1;if(Math.abs($-re)+Math.abs(K-ue)>1&&Fa[Ie*cs+ce])F(re,ue,$,K,ce,Ie),F(se,Y,re,ue,ce,Ie);else{const Te=R($,K),De=R(se,Y),Ze=R(re,ue);M.emplaceBack(Te,De,Ze)}}return F(0,0,lo,lo,lo,0),F(lo,lo,0,0,0,lo),{vertices:I,indices:M}}(this.tileID.canonical,i);u=g.vertices,p=g.indices}else{u=new Fe,p=new mt;for(const{x:y,y:w}of a)u.emplaceBack(y,w,0,0);const g=Vy(u.int16,void 0,4);for(let y=0;y0&&(y=gy(new Float64Array(16),i.globeMatrix)),this._makeGlobeTileDebugBorderBuffer(t,u,i,p,y,g),this._makeGlobeTileDebugTextBuffer(t,u,i,p,y,g)}_globePoint(t,i,a,u,p,g,y){let w=Ad(t,i,a);if(g){const b=1<.5?L=-1:M<-.5&&(L=1);let R=(t/vt+a.x)/b+L,F=(i/vt+a.y)/b;R=(R-A)*u._pixelsPerMercatorPixel+A,F=(F-I)*u._pixelsPerMercatorPixel+I;const $=[R*u.worldSize,F*u.worldSize,0];Nn($,$,g),w=Yl(w,$,y)}return Nn(w,w,p)}_makeGlobeTileDebugBorderBuffer(t,i,a,u,p,g){const y=new We,w=new vi,b=new Ee,A=(M,L,R,F,$)=>{const K=(R-M)/($-1),se=(F-L)/($-1),Y=y.length;for(let re=0;re<$;re++){const ue=M+re*K,ce=L+re*se;y.emplaceBack(ue,ce);const Ie=this._globePoint(ue,ce,i,a,u,p,g);b.emplaceBack(Ie[0],Ie[1],Ie[2]),w.emplaceBack(Y+re)}},I=vt;A(0,0,I,0,16),A(I,0,I,I,16),A(I,I,0,I,16),A(0,I,0,0,16),this._tileDebugIndexBuffer=t.createIndexBuffer(w),this._tileDebugBuffer=t.createVertexBuffer(y,Td.members),this._globeTileDebugBorderBuffer=t.createVertexBuffer(b,uw.members),this._tileDebugSegments=qn.simpleSegment(0,0,y.length,w.length)}_makeGlobeTileDebugTextBuffer(t,i,a,u,p,g){const y=vt/4,w=new We,b=new mt,A=new Ee,I=25;b.reserve(32),w.reserve(I),A.reserve(I);const M=(L,R)=>I*L+R;for(let L=0;Lt[g])return null}else{const y=1/a[g];let w=(r[g]-i[g])*y,b=(t[g]-i[g])*y;if(w>b){const A=w;w=b,b=A}if(w>u&&(u=w),bp)return null}return u}function Xb(r,t,i,a,u,p,g,y,w,b,A){const I=a-r,M=u-t,L=p-i,R=g-r,F=y-t,$=w-i,K=A[1]*$-A[2]*F,se=A[2]*R-A[0]*$,Y=A[0]*F-A[1]*R,re=I*K+M*se+L*Y;if(Math.abs(re)<1e-15)return null;const ue=1/re,ce=b[0]-r,Ie=b[1]-t,Te=b[2]-i,De=(ce*K+Ie*se+Te*Y)*ue;if(De<0||De>1)return null;const Ze=Ie*L-Te*M,Me=Te*I-ce*L,Ue=ce*M-Ie*I,je=(A[0]*Ze+A[1]*Me+A[2]*Ue)*ue;return je<0||De+je>1?null:(R*Ze+F*Me+$*Ue)*ue}function Kb(r,t,i){return(r-t)/(i-t)}function Yb(r,t,i,a,u,p,g,y,w){const b=1<{const se=$?1:0,Y=(L+1)*F-se,re=R*F,ue=(R+1)*F-se;K[0]=L*F,K[1]=re,K[2]=Y,K[3]=ue};let I=new Zb(w);const M=[];for(let L=0;L=1;w/=2){const L=y[y.length-1];I=new Zb(w);for(let R=0;R0;){const{idx:R,t:F,nodex:$,nodey:K,depth:se}=L.pop();if(this.leaves[R]){Yb($,K,se,t,i,a,u,I,M);const re=1<=Le[2])return F}continue}let Y=0;for(let re=0;re=b[A[Te]]&&(A.splice(Te,0,re),Ie=!0);Ie||(A[Y]=re),Y++}}for(let re=0;re=this.dim+1||i<-1||i>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(i+1)*this.stride+(t+1)}static pack(t,i){const a=[0,0,0,0],u=Pm.getUnpackVector(i);let p=Math.floor((t+u[3])/u[2]);return a[2]=p%256,p=Math.floor(p/256),a[1]=p%256,p=Math.floor(p/256),a[0]=p,a}getPixels(){return new wi({width:this.stride,height:this.stride},this.pixels)}backfillBorder(t,i,a){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");let u=i*this.dim,p=i*this.dim+this.dim,g=a*this.dim,y=a*this.dim+this.dim;switch(i){case-1:u=p-1;break;case 1:p=u+1}switch(a){case-1:g=y-1;break;case 1:y=g+1}const w=-i*this.dim,b=-a*this.dim;for(let A=g;A{this.remove(t,p)},a)),this.data[u].push(p),this.order.push(u),this.order.length>this.max){const g=this._getAndRemoveByKey(this.order[0]);g&&this.onRemove(g)}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 i=this.data[t].shift();return i.timeout&&clearTimeout(i.timeout),this.data[t].length===0&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),i.value}getByKey(t){const i=this.data[t];return i?i[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,i){if(!this.has(t))return this;const a=t.wrapped().key,u=i===void 0?0:this.data[a].indexOf(i),p=this.data[a][u];return this.data[a].splice(u,1),p.timeout&&clearTimeout(p.timeout),this.data[a].length===0&&delete this.data[a],this.onRemove(p.value),this.order.splice(this.order.indexOf(a),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){const i=this._getAndRemoveByKey(this.order[0]);i&&this.onRemove(i)}return this}filter(t){const i=[];for(const a in this.data)for(const u of this.data[a])t(u.value)||i.push(u);for(const a of i)this.remove(a.value.tileID,a)}}class Eu{constructor(t,i,a){this.func=t,this.mask=i,this.range=a}}Eu.ReadOnly=!1,Eu.ReadWrite=!0,Eu.disabled=new Eu(519,Eu.ReadOnly,[0,1]);const c0=7680;class u0{constructor(t,i,a,u,p,g){this.test=t,this.ref=i,this.mask=a,this.fail=u,this.depthFail=p,this.pass=g}}u0.disabled=new u0({func:519,mask:0},0,0,c0,c0,c0);class hs{constructor(t,i,a){this.blendFunction=t,this.blendColor=i,this.mask=a}}hs.Replace=[1,0],hs.disabled=new hs(hs.Replace,Fn.transparent,[!1,!1,!1,!1]),hs.unblended=new hs(hs.Replace,Fn.transparent,[!0,!0,!0,!0]),hs.alphaBlended=new hs([1,771],Fn.transparent,[!0,!0,!0,!0]);const h0=1029,d0=2305;class Fo{constructor(t,i,a){this.enable=t,this.mode=i,this.frontFace=a}}Fo.disabled=new Fo(!1,h0,d0),Fo.backCCW=new Fo(!0,h0,d0),Fo.backCW=new Fo(!0,h0,2304),Fo.frontCW=new Fo(!0,1028,2304),Fo.frontCCW=new Fo(!0,1028,d0);class nc extends vl{constructor(t,i,a){super(),this.id=t,this._onlySymbols=a,i.on("data",u=>{u.dataType==="source"&&u.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&u.dataType==="source"&&u.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform))}),i.on("error",()=>{this._sourceErrored=!0}),this._source=i,this._tiles={},this._cache=new kP(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._minTileCacheSize=i.minTileCacheSize,this._maxTileCacheSize=i.maxTileCacheSize,this._loadedParentTiles={},this._coveredTiles={},this._state=new AP,this._isRaster=this._source.type==="raster"||this._source.type==="raster-dem"||this._source.type==="custom"&&this._source._dataType==="raster"}onAdd(t){this.map=t,this._minTileCacheSize=this._minTileCacheSize===void 0&&t?t._minTileCacheSize:this._minTileCacheSize,this._maxTileCacheSize=this._maxTileCacheSize===void 0&&t?t._maxTileCacheSize:this._maxTileCacheSize}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(const t in this._tiles){const i=this._tiles[t];if(i.state!=="loaded"&&i.state!=="errored")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)}_loadTile(t,i){return t.isSymbolTile=this._onlySymbols,this._source.loadTile(t,i)}_unloadTile(t){if(this._source.unloadTile)return this._source.unloadTile(t,()=>{})}_abortTile(t){if(this._source.abortTile)return this._source.abortTile(t,()=>{})}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 i in this._tiles){const a=this._tiles[i];a.upload(t),a.prepare(this.map.style.imageManager)}}getIds(){return dn(this._tiles).map(t=>t.tileID).sort(t2).map(t=>t.key)}getRenderableIds(t){const i=[];for(const a in this._tiles)this._isIdRenderable(+a,t)&&i.push(this._tiles[a]);return t?i.sort((a,u)=>{const p=a.tileID,g=u.tileID,y=new Ve(p.canonical.x,p.canonical.y)._rotate(this.transform.angle),w=new Ve(g.canonical.x,g.canonical.y)._rotate(this.transform.angle);return p.overscaledZ-g.overscaledZ||w.y-y.y||w.x-y.x}).map(a=>a.tileID.key):i.map(a=>a.tileID).sort(t2).map(a=>a.key)}hasRenderableParent(t){const i=this.findLoadedParent(t,0);return!!i&&this._isIdRenderable(i.tileID.key)}_isIdRenderable(t,i){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(i||!this._tiles[t].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const t in this._tiles)this._tiles[t].state!=="errored"&&this._reloadTile(+t,"reloading")}}_reloadTile(t,i){const a=this._tiles[t];a&&(a.state!=="loading"&&(a.state=i),this._loadTile(a,this._tileLoaded.bind(this,a,t,i)))}_tileLoaded(t,i,a,u){if(u)if(t.state="errored",u.status!==404)this._source.fire(new wo(u,{tile:t}));else if(this._source.type==="raster-dem"&&this.usedForTerrain&&this.map.painter.terrain){const p=this.map.painter.terrain;this.update(this.transform,p.getScaledDemTileSize(),!0),p.resetTileLookupCache(this.id)}else this.update(this.transform);else t.timeAdded=xo.now(),a==="expired"&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(i,t),this._source.type==="raster-dem"&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),this._source.fire(new Is("data",{dataType:"source",tile:t,coord:t.tileID,sourceCacheId:this.id}))}_backfillDEM(t){const i=this.getRenderableIds();for(let u=0;u1||(Math.abs(g)>1&&(Math.abs(g+w)===1?g+=w:Math.abs(g-w)===1&&(g-=w)),p.dem&&u.dem&&(u.dem.backfillBorder(p.dem,g,y),u.neighboringTiles&&u.neighboringTiles[b]&&(u.neighboringTiles[b].backfilled=!0)))}}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._tiles[t]}_retainLoadedChildren(t,i,a,u){for(const p in this._tiles){let g=this._tiles[p];if(u[p]||!g.hasData()||g.tileID.overscaledZ<=i||g.tileID.overscaledZ>a)continue;let y=g.tileID;for(;g&&g.tileID.overscaledZ>i+1;){const b=g.tileID.scaledTo(g.tileID.overscaledZ-1);g=this._tiles[b.key],g&&g.hasData()&&(y=b)}let w=y;for(;w.overscaledZ>i;)if(w=w.scaledTo(w.overscaledZ-1),t[w.key]){u[y.key]=y;break}}}findLoadedParent(t,i){if(t.key in this._loadedParentTiles){const a=this._loadedParentTiles[t.key];return a&&a.tileID.overscaledZ>=i?a:null}for(let a=t.overscaledZ-1;a>=i;a--){const u=t.scaledTo(a),p=this._getLoadedTile(u);if(p)return p}}_getLoadedTile(t){const i=this._tiles[t.key];return i&&i.hasData()?i:this._cache.getByKey(this._source.reparseOverscaled?t.wrapped().key:t.canonical.key)}updateCacheSize(t,i){i=i||this._source.tileSize;const a=Math.ceil(t.width/i)+1,u=Math.ceil(t.height/i)+1,p=Math.floor(a*u*5),g=typeof this._minTileCacheSize=="number"?Math.max(this._minTileCacheSize,p):p,y=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,g):g;this._cache.setMaxSize(y)}handleWrapJump(t){const i=Math.round((t-(this._prevLng===void 0?t:this._prevLng))/360);if(this._prevLng=t,i){const a={};for(const u in this._tiles){const p=this._tiles[u];p.tileID=p.tileID.unwrapTo(p.tileID.wrap+i),a[p.tileID.key]=p}this._tiles=a;for(const u in this._timers)clearTimeout(this._timers[u]),delete this._timers[u];for(const u in this._tiles)this._setTileReloadTimer(+u,this._tiles[u])}}update(t,i,a){if(this.transform=t,!this._sourceLoaded||this._paused||this.transform.freezeTileCoverage||this.usedForTerrain&&!a)return;let u;this.updateCacheSize(t,i),this.transform.projection.name!=="globe"&&this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?u=t.getVisibleUnwrappedCoordinates(this._source.tileID).map(y=>new Xr(y.canonical.z,y.wrap,y.canonical.z,y.canonical.x,y.canonical.y)):(u=t.coveringTiles({tileSize:i||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!a,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain}),this._source.hasTile&&(u=u.filter(y=>this._source.hasTile(y)))):u=[];const p=this._updateRetainedTiles(u);if(n2(this._source.type)&&u.length!==0){const y={},w={},b=Object.keys(p);for(const I of b){const M=p[I],L=this._tiles[I];if(!L||L.fadeEndTime&&L.fadeEndTime<=xo.now())continue;const R=this.findLoadedParent(M,Math.max(M.overscaledZ-nc.maxOverzooming,this._source.minzoom));R&&(this._addTile(R.tileID),y[R.tileID.key]=R.tileID),w[I]=M}const A=u[u.length-1].overscaledZ;for(const I in this._tiles){const M=this._tiles[I];if(p[I]||!M.hasData())continue;let L=M.tileID;for(;L.overscaledZ>A;){L=L.scaledTo(L.overscaledZ-1);const R=this._tiles[L.key];if(R&&R.hasData()&&w[L.key]){p[I]=M.tileID;break}}}for(const I in y)p[I]||(this._coveredTiles[I]=!0,p[I]=y[I])}for(const y in p)this._tiles[y].clearFadeHold();const g=function(y,w){const b=[];for(const A in y)A in w||b.push(A);return b}(this._tiles,p);for(const y of g){const w=this._tiles[y];w.hasSymbolBuckets&&!w.holdingForFade()?w.setHoldDuration(this.map._fadeDuration):w.hasSymbolBuckets&&!w.symbolFadeFinished()||this._removeTile(+y)}this._updateLoadedParentTileCache(),this._onlySymbols&&this._source.afterUpdate&&this._source.afterUpdate()}releaseSymbolFadeTiles(){for(const t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(+t)}_updateRetainedTiles(t){const i={};if(t.length===0)return i;const a={},u=t.reduce((b,A)=>Math.min(b,A.overscaledZ),1/0),p=t[0].overscaledZ,g=Math.max(p-nc.maxOverzooming,this._source.minzoom),y=Math.max(p+nc.maxUnderzooming,this._source.minzoom),w={};for(const b of t){const A=this._addTile(b);i[b.key]=b,A.hasData()||u=this._source.maxzoom){const M=b.children(this._source.maxzoom)[0],L=this.getTile(M);if(L&&L.hasData()){i[M.key]=M;continue}}else{const M=b.children(this._source.maxzoom);if(i[M[0].key]&&i[M[1].key]&&i[M[2].key]&&i[M[3].key])continue}let I=A.wasRequested();for(let M=b.overscaledZ-1;M>=g;--M){const L=b.scaledTo(M);if(a[L.key]||(a[L.key]=!0,A=this.getTile(L),!A&&I&&(A=this._addTile(L)),A&&(i[L.key]=L,I=A.wasRequested(),A.hasData())))break}}return i}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const t in this._tiles){const i=[];let a,u=this._tiles[t].tileID;for(;u.overscaledZ>0;){if(u.key in this._loadedParentTiles){a=this._loadedParentTiles[u.key];break}i.push(u.key);const p=u.scaledTo(u.overscaledZ-1);if(a=this._getLoadedTile(p),a)break;u=p}for(const p of i)this._loadedParentTiles[p]=a}}_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 a=!!i;if(!a){const u=this.map?this.map.painter:null;i=new l0(t,this._source.tileSize*t.overscaleFactor(),this.transform.tileZoom,u,this._isRaster),this._loadTile(i,this._tileLoaded.bind(this,i,t.key,i.state))}return i?(i.uses++,this._tiles[t.key]=i,a||this._source.fire(new Is("dataloading",{tile:i,coord:i.tileID,dataType:"source"})),i):null}_setTileReloadTimer(t,i){t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);const a=i.getExpiryTimeout();a&&(this._timers[t]=setTimeout(()=>{this._reloadTile(t,"expired"),delete this._timers[t]},a))}_removeTile(t){const i=this._tiles[t];i&&(i.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),i.uses>0||(i.hasData()&&i.state!=="reloading"?this._cache.add(i.tileID,i,i.getExpiryTimeout()):(i.aborted=!0,this._abortTile(i),this._unloadTile(i))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const t in this._tiles)this._removeTile(+t);this._source._clear&&this._source._clear(),this._cache.reset(),this.map&&this.usedForTerrain&&this.map.painter.terrain&&this.map.painter.terrain.resetTileLookupCache(this.id)}tilesIn(t,i,a){const u=[],p=this.transform;if(!p)return u;const g=p.projection.name==="globe",y=as(p.center.lng);for(const w in this._tiles){const b=this._tiles[w];if(a&&b.clearQueryDebugViz(),b.holdingForFade())continue;let A;if(g){const I=b.tileID.canonical;if(I.z===0){const M=[Math.abs(Je(y,...Zd(I,-1))-y),Math.abs(Je(y,...Zd(I,1))-y)];A=[0,2*M.indexOf(Math.min(...M))-1]}else{const M=[Math.abs(Je(y,...Zd(I,-1))-y),Math.abs(Je(y,...Zd(I,0))-y),Math.abs(Je(y,...Zd(I,1))-y)];A=[M.indexOf(Math.min(...M))-1]}}else A=[0];for(const I of A){const M=t.containsTile(b,p,i,I);M&&u.push(M)}}return u}getVisibleCoordinates(t){const i=this.getRenderableIds(t).map(a=>this._tiles[a].tileID);for(const a of i)a.projMatrix=this.transform.calculateProjMatrix(a.toUnwrapped());return i}hasTransition(){if(this._source.hasTransition())return!0;if(n2(this._source.type))for(const t in this._tiles){const i=this._tiles[t];if(i.fadeEndTime!==void 0&&i.fadeEndTime>=xo.now())return!0}return!1}setFeatureState(t,i,a){this._state.updateState(t=t||"_geojsonTileLayer",i,a)}removeFeatureState(t,i,a){this._state.removeFeatureState(t=t||"_geojsonTileLayer",i,a)}getFeatureState(t,i){return this._state.getState(t=t||"_geojsonTileLayer",i)}setDependencies(t,i,a){const u=this._tiles[t];u&&u.setDependencies(i,a)}reloadTilesForDependencies(t,i){for(const a in this._tiles)this._tiles[a].hasDependency(t,i)&&this._reloadTile(+a,"reloading");this._cache.filter(a=>!a.hasDependency(t,i))}_preloadTiles(t,i){if(!this._sourceLoaded){const y=()=>{this._sourceLoaded&&(this._source.off("data",y),this._preloadTiles(t,i))};return void this._source.on("data",y)}const a=new Map,u=Array.isArray(t)?t:[t],p=this.map.painter.terrain,g=this.usedForTerrain&&p?p.getScaledDemTileSize():this._source.tileSize;for(const y of u){const w=y.coveringTiles({tileSize:g,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!this.usedForTerrain,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain});for(const b of w)a.set(b.key,b);this.usedForTerrain&&y.updateElevation(!1)}Bt(Array.from(a.values()),(y,w)=>{const b=new l0(y,this._source.tileSize*y.overscaleFactor(),this.transform.tileZoom,this.map.painter,this._isRaster);this._loadTile(b,A=>{this._source.type==="raster-dem"&&b.dem&&this._backfillDEM(b),w(A,b)})},i)}}function t2(r,t){const i=Math.abs(2*r.wrap)-+(r.wrap<0),a=Math.abs(2*t.wrap)-+(t.wrap<0);return r.overscaledZ-t.overscaledZ||a-i||t.canonical.y-r.canonical.y||t.canonical.x-r.canonical.x}function n2(r){return r==="raster"||r==="image"||r==="video"||r==="custom"}function Zd(r,t){const i=1<=0&&I[3]>=0&&w.insert(y,I[0],I[1],I[2],I[3])}}loadVTLayers(){if(!this.vtLayers){this.vtLayers=new Wy(new ym(this.rawTileData)).layers,this.sourceLayerCoder=new Vb(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]),this.vtFeatures={};for(const t in this.vtLayers)this.vtFeatures[t]=[]}return this.vtLayers}query(t,i,a,u){this.loadVTLayers();const p=t.params||{},g=Jc(p.filter),y=t.tileResult,w=t.transform,b=y.bufferedTilespaceBounds,A=this.grid.query(b.min.x,b.min.y,b.max.x,b.max.y,(R,F,$,K)=>Iw(y.bufferedTilespaceGeometry,R,F,$,K));A.sort(MP);let I=null;w.elevation&&A.length>0&&(I=zm.create(w.elevation,this.tileID));const M={};let L;for(let R=0;R(K||(K=Vs(se,this.tileID.canonical,t.tileTransform)),Y.queryIntersectsFeature(y,se,re,K,this.z,t.transform,t.pixelPosMatrix,I,ue)))}return M}loadMatchingFeature(t,i,a,u,p,g,y,w,b){const{featureIndex:A,bucketIndex:I,sourceLayerIndex:M,layoutVertexArrayOffset:L}=i,R=this.bucketLayerIDs[I];if(u&&!function(se,Y){for(let re=0;re=0)return!0;return!1}(u,R))return;const F=this.sourceLayerCoder.decode(M),$=this.vtLayers[F].feature(A);if(a.needGeometry){const se=Jl($,!0);if(!a.filter(new C(this.tileID.overscaledZ),se,this.tileID.canonical))return}else if(!a.filter(new C(this.tileID.overscaledZ),$))return;const K=this.getId($,F);for(let se=0;se{const y=t instanceof X?t.get(g):null;return y&&y.evaluate?y.evaluate(i,a,u):y})}function MP(r,t){return t-r}dt(r2,"FeatureIndex",{omit:["rawTileData","sourceLayerCoder"]});class o2{constructor(t,i){this.width=t,this.height=i,this.nextRow=0,this.image=new $s({width:t,height:i}),this.positions={},this.uploaded=!1}getDash(t,i){const a=this.getKey(t,i);return this.positions[a]}trim(){const t=this.width,i=this.height=br(this.nextRow);this.image.resize({width:t,height:i})}getKey(t,i){return t.join(",")+i}getDashRanges(t,i,a){const u=[];let p=t.length%2==1?-t[t.length-1]*a:0,g=t[0]*a,y=!0;u.push({left:p,right:g,isDash:y,zeroLength:t[0]===0});let w=t[0];for(let b=1;b1&&(w=t[++y]);const A=Math.abs(b-w.left),I=Math.abs(b-w.right),M=Math.min(A,I);let L;const R=p/a*(u+1);if(w.isDash){const F=u-Math.abs(R);L=Math.sqrt(M*M+F*F)}else L=u-Math.sqrt(M*M+R*R);this.image.data[g+b]=Math.max(0,Math.min(255,L+128))}}}addRegularDash(t,i){for(let w=t.length-1;w>=0;--w){const b=t[w],A=t[w+1];b.zeroLength?t.splice(w,1):A&&A.isDash===b.isDash&&(A.left=b.left,t.splice(w,1))}const a=t[0],u=t[t.length-1];a.isDash===u.isDash&&(a.left=u.left-this.width,u.right=a.right+this.width);const p=this.width*this.nextRow;let g=0,y=t[g];for(let w=0;w1&&(y=t[++g]);const b=Math.abs(w-y.left),A=Math.abs(w-y.right),I=Math.min(b,A);this.image.data[p+w]=Math.max(0,Math.min(255,(y.isDash?I:-I)+i+128))}}addDash(t,i){const a=this.getKey(t,i);if(this.positions[a])return this.positions[a];const u=i==="round",p=u?7:0,g=2*p+1;if(this.nextRow+g>this.height)return wn("LineAtlas out of space"),null;t.length===0&&t.push(1);let y=0;for(let A=0;A=Ue.maxzoom||Ue.visibility!=="none"&&(p0(Me,this.zoom,a),(w[Ue.id]=Ue.createBucket({index:y.bucketLayerIDs.length,layers:Me,zoom:this.zoom,canonical:this.canonical,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:De,sourceID:this.source,enableTerrain:this.enableTerrain,projection:this.projection.spec,availableImages:a})).populate(Ze,A,this.tileID.canonical,this.tileTransform),y.bucketLayerIDs.push(Me.map(je=>je.id)))}}let M,L,R,F;b.trim();const $={type:"maybePrepare",isSymbolTile:this.isSymbolTile,zoom:this.zoom},K=()=>{if(M)return p(M);if(L&&R&&F){const ue=new a2(L),ce=new fb(R,F);for(const Ie in w){const Te=w[Ie];Te instanceof Oa?(p0(Te.layers,this.zoom,a),rP(Te,L,ue.positions,R,ce.iconPositions,this.showCollisionBoxes,a,this.tileID.canonical,this.tileZoom,this.projection)):Te.hasPattern&&(Te instanceof mm||Te instanceof um||Te instanceof Dd)&&(p0(Te.layers,this.zoom,a),Te.addFeatures(A,this.tileID.canonical,ce.patternPositions,a,this.tileTransform))}this.status="done",p(null,{buckets:dn(w).filter(Ie=>!Ie.isEmpty()),featureIndex:y,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:ue.image,lineAtlas:b,imageAtlas:ce,glyphMap:this.returnDependencies?L:null,iconMap:this.returnDependencies?R:null,glyphPositions:this.returnDependencies?ue.positions:null})}},se=kt(A.glyphDependencies,ue=>Object.keys(ue).map(Number));Object.keys(se).length?u.send("getGlyphs",{uid:this.uid,stacks:se},(ue,ce)=>{M||(M=ue,L=ce,K())},void 0,!1,$):L={};const Y=Object.keys(A.iconDependencies);Y.length?u.send("getImages",{icons:Y,source:this.source,tileID:this.tileID,type:"icons"},(ue,ce)=>{M||(M=ue,R=ce,K())},void 0,!1,$):R={};const re=Object.keys(A.patternDependencies);re.length?u.send("getImages",{icons:re,source:this.source,tileID:this.tileID,type:"patterns"},(ue,ce)=>{M||(M=ue,F=ce,K())},void 0,!1,$):F={},K()}}function p0(r,t,i){const a=new C(t);for(const u of r)u.recalculate(a,i)}class l2{constructor(t){this.entries={},this.scheduler=t}request(t,i,a,u){const p=this.entries[t]=this.entries[t]||{callbacks:[]};if(p.result){const[g,y]=p.result;return this.scheduler?this.scheduler.add(()=>{u(g,y)},i):u(g,y),()=>{}}return p.callbacks.push(u),p.cancel||(p.cancel=a((g,y)=>{p.result=[g,y];for(const w of p.callbacks)this.scheduler?this.scheduler.add(()=>{w(g,y)},i):w(g,y);setTimeout(()=>delete this.entries[t],3e3)})),()=>{p.result||(p.callbacks=p.callbacks.filter(g=>g!==u),p.callbacks.length||(p.cancel(),delete this.entries[t]))}}}function c2(r,t,i){const a=JSON.stringify(r.request);return r.data&&(this.deduped.entries[a]={result:[null,r.data]}),this.deduped.request(a,{type:"parseTile",isSymbolTile:r.isSymbolTile,zoom:r.tileZoom},u=>{const p=ua(r.request,(g,y,w,b)=>{g?u(g):y&&u(null,{vectorTile:i?void 0:new Wy(new ym(y)),rawData:y,cacheControl:w,expires:b})});return()=>{p.cancel(),u()}},t)}const u2=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class f0{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[i,a]=new Uint8Array(t,0,2);if(i!==219)throw new Error("Data does not appear to be in a KDBush format.");const u=a>>4;if(u!==1)throw new Error(`Got v${u} data when expected v1.`);const p=u2[15&a];if(!p)throw new Error("Unrecognized array type.");const[g]=new Uint16Array(t,2,1),[y]=new Uint32Array(t,4,1);return new f0(y,g,p,t)}constructor(t,i=64,a=Float64Array,u){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+i,2),65535),this.ArrayType=a,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const p=u2.indexOf(this.ArrayType),g=2*t*this.ArrayType.BYTES_PER_ELEMENT,y=t*this.IndexArrayType.BYTES_PER_ELEMENT,w=(8-y%8)%8;if(p<0)throw new Error(`Unexpected typed array class: ${a}.`);u&&u instanceof ArrayBuffer?(this.data=u,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+y+w,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+g+y+w),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+y+w,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+p]),new Uint16Array(this.data,2,1)[0]=i,new Uint32Array(this.data,4,1)[0]=t)}add(t,i){const a=this._pos>>1;return this.ids[a]=a,this.coords[this._pos++]=t,this.coords[this._pos++]=i,a}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return m0(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,i,a,u){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:p,coords:g,nodeSize:y}=this,w=[0,p.length-1,0],b=[];for(;w.length;){const A=w.pop()||0,I=w.pop()||0,M=w.pop()||0;if(I-M<=y){for(let $=M;$<=I;$++){const K=g[2*$],se=g[2*$+1];K>=t&&K<=a&&se>=i&&se<=u&&b.push(p[$])}continue}const L=M+I>>1,R=g[2*L],F=g[2*L+1];R>=t&&R<=a&&F>=i&&F<=u&&b.push(p[L]),(A===0?t<=R:i<=F)&&(w.push(M),w.push(L-1),w.push(1-A)),(A===0?a>=R:u>=F)&&(w.push(L+1),w.push(I),w.push(1-A))}return b}within(t,i,a){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:u,coords:p,nodeSize:g}=this,y=[0,u.length-1,0],w=[],b=a*a;for(;y.length;){const A=y.pop()||0,I=y.pop()||0,M=y.pop()||0;if(I-M<=g){for(let $=M;$<=I;$++)d2(p[2*$],p[2*$+1],t,i)<=b&&w.push(u[$]);continue}const L=M+I>>1,R=p[2*L],F=p[2*L+1];d2(R,F,t,i)<=b&&w.push(u[L]),(A===0?t-a<=R:i-a<=F)&&(y.push(M),y.push(L-1),y.push(1-A)),(A===0?t+a>=R:i+a>=F)&&(y.push(L+1),y.push(I),y.push(1-A))}return w}}function m0(r,t,i,a,u,p){if(u-a<=i)return;const g=a+u>>1;h2(r,t,g,a,u,p),m0(r,t,i,a,g-1,1-p),m0(r,t,i,g+1,u,1-p)}function h2(r,t,i,a,u,p){for(;u>a;){if(u-a>600){const b=u-a+1,A=i-a+1,I=Math.log(b),M=.5*Math.exp(2*I/3),L=.5*Math.sqrt(I*M*(b-M)/b)*(A-b/2<0?-1:1);h2(r,t,i,Math.max(a,Math.floor(i-A*M/b+L)),Math.min(u,Math.floor(i+(b-A)*M/b+L)),p)}const g=t[2*i+p];let y=a,w=u;for(Hd(r,t,a,i),t[2*u+p]>g&&Hd(r,t,a,u);yg;)w--}t[2*a+p]===g?Hd(r,t,a,w):(w++,Hd(r,t,w,u)),w<=i&&(a=w+1),i<=w&&(u=w-1)}}function Hd(r,t,i,a){g0(r,i,a),g0(t,2*i,2*a),g0(t,2*i+1,2*a+1)}function g0(r,t,i){const a=r[t];r[t]=r[i],r[i]=a}function d2(r,t,i,a){const u=r-i,p=t-a;return u*u+p*p}s.ARRAY_TYPE=xi,s.AUTH_ERR_MSG=he,s.Aabb=Hr,s.Actor=class{constructor(r,t,i){this.target=r,this.parent=t,this.mapId=i,this.callbacks={},this.cancelCallbacks={},Yi(["receive"],this),this.target.addEventListener("message",this.receive,!1),this.globalScope=vo()?r:k,this.scheduler=new TP}send(r,t,i,a,u=!1,p){const g=Math.round(1e18*Math.random()).toString(36).substring(0,10);i&&(i.metadata=p,this.callbacks[g]=i);const y=aa(this.globalScope)?void 0:[];return this.target.postMessage({id:g,type:r,hasCallback:!!i,targetMapId:a,mustQueue:u,sourceMapId:this.mapId,data:Ia(t,y)},y),{cancel:()=>{i&&delete this.callbacks[g],this.target.postMessage({id:g,type:"",targetMapId:a,sourceMapId:this.mapId})}}}receive(r){const t=r.data,i=t.id;if(i&&(!t.targetMapId||this.mapId===t.targetMapId))if(t.type===""){const a=this.cancelCallbacks[i];delete this.cancelCallbacks[i],a&&a.cancel()}else if(t.mustQueue||vo()){const a=this.callbacks[i];this.cancelCallbacks[i]=this.scheduler.add(()=>this.processTask(i,t),a&&a.metadata||{type:"message"})}else this.processTask(i,t)}processTask(r,t){if(t.type===""){const i=this.callbacks[r];delete this.callbacks[r],i&&(t.error?i(Os(t.error)):i(null,Os(t.data)))}else{const i=aa(this.globalScope)?void 0:[],a=t.hasCallback?(p,g)=>{delete this.cancelCallbacks[r],this.target.postMessage({id:r,type:"",sourceMapId:this.mapId,error:p?Ia(p):null,data:Ia(g,i)},i)}:p=>{},u=Os(t.data);if(this.parent[t.type])this.parent[t.type](t.sourceMapId,u,a);else if(this.parent.getWorkerSource){const p=t.type.split(".");this.parent.getWorkerSource(t.sourceMapId,p[0],u.source)[p[1]](u,a)}else a(new Error(`Could not find function ${t.type}`))}}remove(){this.scheduler.remove(),this.target.removeEventListener("message",this.receive,!1)}},s.CanonicalTileID=fm,s.Color=Fn,s.ColorMode=hs,s.CullFaceMode=Fo,s.DEMData=Pm,s.DataConstantProperty=B,s.DedupedRequest=l2,s.DepthMode=Eu,s.EXTENT=vt,s.Elevation=class{isDataAvailableAtPoint(r){const t=this._source();if(this.isUsingMockSource()||!t||r.y<0||r.y>1)return!1;const i=t.getSource().maxzoom,a=1<1)return t;const u=a.getSource().maxzoom,p=1<{const p=this.getAtTileOffset(r,u.x,u.y),g=a.upVector(r.canonical,u.x,u.y);return Bi(g,g,p*a.upVectorScale(r.canonical,t,i).metersToTile),g}}getForTilePoints(r,t,i,a){if(this.isUsingMockSource())return!1;const u=zm.create(this,r,a);return!!u&&(t.forEach(p=>{p[2]=this.exaggeration()*u.getElevationAt(p[0],p[1],i)}),!0)}getMinMaxForTile(r){if(this.isUsingMockSource())return null;const t=this.findDEMTileFor(r);if(!t||!t.dem)return null;const i=t.dem.tree,a=t.tileID,u=1<{let M=b===p-1?b-2:b===0?b:b-1;return M+=I?24575:0,[M,A]};for(let b=0;bthis._skuTokenExpiresAt}transformRequest(r,t){return this._transformRequestFn&&this._transformRequestFn(r,t)||{url:r}}normalizeStyleURL(r,t){if(!_e(r))return r;const i=rt(r);return i.path=`/styles/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||t)}normalizeGlyphsURL(r,t){if(!_e(r))return r;const i=rt(r);return i.path=`/fonts/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||t)}normalizeSourceURL(r,t,i,a){if(!_e(r))return r;const u=rt(r);return u.path=`/v4/${u.authority}.json`,u.params.push("secure"),i&&u.params.push(`language=${i}`),a&&u.params.push(`worldview=${a}`),this._makeAPIURL(u,this._customAccessToken||t)}normalizeSpriteURL(r,t,i,a){const u=rt(r);return _e(r)?(u.path=`/styles/v1${u.path}/sprite${t}${i}`,this._makeAPIURL(u,this._customAccessToken||a)):(u.path+=`${t}${i}`,Qe(u))}normalizeTileURL(r,t,i){if(this._isSkuTokenExpired()&&this._createSkuToken(),r&&!_e(r))return r;const a=rt(r);a.path=a.path.replace(/(\.(png|jpg)\d*)(?=$)/,`${t||i&&a.authority!=="raster"&&i===512?"@2x":""}${J.supported?".webp":"$1"}`),a.authority==="raster"?a.path=`/${G.RASTER_URL_PREFIX}${a.path}`:(a.path=a.path.replace(/^.+\/v4\//,"/"),a.path=`/${G.TILE_URL_VERSION}${a.path}`);const u=this._customAccessToken||function(p){for(const g of p){const y=g.match(/^access_token=(.*)$/);if(y)return y[1]}return null}(a.params)||G.ACCESS_TOKEN;return G.REQUIRE_ACCESS_TOKEN&&u&&this._skuToken&&a.params.push(`sku=${this._skuToken}`),this._makeAPIURL(a,u)}canonicalizeTileURL(r,t){const i=rt(r);if(!i.path.match(/^(\/v4\/|\/raster\/v1\/)/)||!i.path.match(/\.[\w]+$/))return r;let a="mapbox://";i.path.match(/^\/raster\/v1\//)?a+=`raster/${i.path.replace(`/${G.RASTER_URL_PREFIX}/`,"")}`:a+=`tiles/${i.path.replace(`/${G.TILE_URL_VERSION}/`,"")}`;let u=i.params;return t&&(u=u.filter(p=>!p.match(/^access_token=/))),u.length&&(a+=`?${u.join("&")}`),a}canonicalizeTileset(r,t){const i=!!t&&_e(t),a=[];for(const u of r.tiles||[])be(u)?a.push(this.canonicalizeTileURL(u,i)):a.push(u);return a}_makeAPIURL(r,t){const i="See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes",a=rt(G.API_URL);if(r.protocol=a.protocol,r.authority=a.authority,r.protocol==="http"){const u=r.params.indexOf("secure");u>=0&&r.params.splice(u,1)}if(a.path!=="/"&&(r.path=`${a.path}${r.path}`),!G.REQUIRE_ACCESS_TOKEN)return Qe(r);if(t=t||G.ACCESS_TOKEN,!this._silenceAuthErrors){if(!t)throw new Error(`An API access token is required to use Mapbox GL. ${i}`);if(t[0]==="s")throw new Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${i}`)}return r.params=r.params.filter(u=>u.indexOf("access_token")===-1),r.params.push(`access_token=${t||""}`),Qe(r)}},s.ResourceType=Ss,s.SegmentVector=qn,s.SourceCache=nc,s.StencilMode=u0,s.StructArrayLayout1ui2=vi,s.StructArrayLayout2f1f2i16=wt,s.StructArrayLayout2i4=We,s.StructArrayLayout2ui4=fr,s.StructArrayLayout3f12=Ot,s.StructArrayLayout3ui6=mt,s.StructArrayLayout4i8=Fe,s.StructArrayLayout5f20=sn,s.Texture=Wd,s.Tile=l0,s.Transitionable=O,s.Uniform1f=Yf,s.Uniform1i=class extends Ns{constructor(r){super(r),this.current=0}set(r,t,i){this.fetchUniformLocation(r,t)&&this.current!==i&&(this.current=i,this.gl.uniform1i(this.location,i))}},s.Uniform2f=class extends Ns{constructor(r){super(r),this.current=[0,0]}set(r,t,i){this.fetchUniformLocation(r,t)&&(i[0]===this.current[0]&&i[1]===this.current[1]||(this.current=i,this.gl.uniform2f(this.location,i[0],i[1])))}},s.Uniform3f=class extends Ns{constructor(r){super(r),this.current=[0,0,0]}set(r,t,i){this.fetchUniformLocation(r,t)&&(i[0]===this.current[0]&&i[1]===this.current[1]&&i[2]===this.current[2]||(this.current=i,this.gl.uniform3f(this.location,i[0],i[1],i[2])))}},s.Uniform4f=Wx,s.UniformColor=Zx,s.UniformMatrix2f=class extends Ns{constructor(r){super(r),this.current=lk}set(r,t,i){if(this.fetchUniformLocation(r,t)){for(let a=0;a<4;a++)if(i[a]!==this.current[a]){this.current=i,this.gl.uniformMatrix2fv(this.location,!1,i);break}}}},s.UniformMatrix3f=class extends Ns{constructor(r){super(r),this.current=ak}set(r,t,i){if(this.fetchUniformLocation(r,t)){for(let a=0;a<9;a++)if(i[a]!==this.current[a]){this.current=i,this.gl.uniformMatrix3fv(this.location,!1,i);break}}}},s.UniformMatrix4f=class extends Ns{constructor(r){super(r),this.current=sk}set(r,t,i){if(this.fetchUniformLocation(r,t)){if(i[12]!==this.current[12]||i[0]!==this.current[0])return this.current=i,void this.gl.uniformMatrix4fv(this.location,!1,i);for(let a=1;a<16;a++)if(i[a]!==this.current[a]){this.current=i,this.gl.uniformMatrix4fv(this.location,!1,i);break}}}},s.UnwrappedTileID=Qw,s.ValidationError=ct,s.VectorTileFeature=dm,s.VectorTileWorkerSource=class extends vl{constructor(r,t,i,a,u){super(),this.actor=r,this.layerIndex=t,this.availableImages=i,this.loadVectorData=u||c2,this.loading={},this.loaded={},this.deduped=new l2(r.scheduler),this.isSpriteLoaded=a,this.scheduler=r.scheduler}loadTile(r,t){const i=r.uid,a=r&&r.request,u=a&&a.collectResourceTiming,p=this.loading[i]=new PP(r);p.abort=this.loadVectorData(r,(g,y)=>{const w=!this.loading[i];if(delete this.loading[i],w||g||!y)return p.status="done",w||(this.loaded[i]=p),t(g);const b=y.rawData,A={};y.expires&&(A.expires=y.expires),y.cacheControl&&(A.cacheControl=y.cacheControl),p.vectorTile=y.vectorTile||new Wy(new ym(b));const I=()=>{p.parse(p.vectorTile,this.layerIndex,this.availableImages,this.actor,(M,L)=>{if(M||!L)return t(M);const R={};if(u){const F=wh(a);F.length>0&&(R.resourceTiming=JSON.parse(JSON.stringify(F)))}t(null,vn({rawTileData:b.slice(0)},L,A,R))})};this.isSpriteLoaded?I():this.once("isSpriteLoaded",()=>{this.scheduler?this.scheduler.add(I,{type:"parseTile",isSymbolTile:r.isSymbolTile,zoom:r.tileZoom}):I()}),this.loaded=this.loaded||{},this.loaded[i]=p})}reloadTile(r,t){const i=this.loaded,a=r.uid,u=this;if(i&&i[a]){const p=i[a];p.showCollisionBoxes=r.showCollisionBoxes,p.enableTerrain=!!r.enableTerrain,p.projection=r.projection,p.tileTransform=tc(r.tileID.canonical,r.projection);const g=(y,w)=>{const b=p.reloadCallback;b&&(delete p.reloadCallback,p.parse(p.vectorTile,u.layerIndex,this.availableImages,u.actor,b)),t(y,w)};p.status==="parsing"?p.reloadCallback=g:p.status==="done"&&(p.vectorTile?p.parse(p.vectorTile,this.layerIndex,this.availableImages,this.actor,g):g())}}abortTile(r,t){const i=r.uid,a=this.loading[i];a&&(a.abort&&a.abort(),delete this.loading[i]),t()}removeTile(r,t){const i=this.loaded,a=r.uid;i&&i[a]&&delete i[a],t()}},s.WritingMode=Ni,s.ZoomDependentExpression=Bl,s.add=js,s.addDynamicAttributes=Im,s.adjoint=function(r,t){var i=t[0],a=t[1],u=t[2],p=t[3],g=t[4],y=t[5],w=t[6],b=t[7],A=t[8];return r[0]=g*A-y*b,r[1]=u*b-a*A,r[2]=a*y-u*g,r[3]=y*w-p*A,r[4]=i*A-u*w,r[5]=u*p-i*y,r[6]=p*b-g*w,r[7]=a*w-i*b,r[8]=i*g-a*p,r},s.asyncAll=Bt,s.bezier=Li,s.bindAll=Yi,s.boundsAttributes=qb,s.bufferConvexPolygon=function(r,t){const i=[];for(let a=0;aAc&&(r.getActor().send("enforceCacheSizeLimit",Sc),_l=0)},s.calculateGlobeLabelMatrix=function(r,t){const{x:i,y:a}=r.point,u=gw(i,a,r.worldSize/r._pixelsPerMercatorPixel,0,0);return Zl(u,u,Cy(ss(t)))},s.calculateGlobeMatrix=function(r){const{x:t,y:i}=r.point,{lng:a,lat:u}=r._center;return gw(t,i,r.worldSize,a,u)},s.calculateGlobeMercatorMatrix=function(r){const t=r.pixelsPerMeter,i=t/Do(1,r.center.lat),a=Lo(new Float64Array(16));return yd(a,a,[r.point.x,r.point.y,0]),Hl(a,a,[i,i,t]),Float32Array.from(a)},s.circumferenceAtLatitude=ky,s.clamp=Je,s.clearTileCache=function(r){if(!gl())return;const t=k.caches.delete(la);r&&t.catch(r).then(()=>r())},s.clipLine=Cb,s.clone=function(r){var t=new xi(16);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],t},s.clone$1=Dr,s.collisionCircleLayout=kM,s.config=G,s.conjugate=function(r,t){return r[0]=-t[0],r[1]=-t[1],r[2]=-t[2],r[3]=t[3],r},s.create=function(){var r=new xi(16);return xi!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=0,r[12]=0,r[13]=0,r[14]=0),r[0]=1,r[5]=1,r[10]=1,r[15]=1,r},s.create$1=Kx,s.createExpression=Sa,s.createLayout=ye,s.createStyleLayer=function(r){return r.type==="custom"?new xP(r):new bP[r.type](r)},s.cross=xy,s.degToRad=St,s.distance=function(r,t){return Math.hypot(t[0]-r[0],t[1]-r[1],t[2]-r[2])},s.div=function(r,t,i){return r[0]=t[0]/i[0],r[1]=t[1]/i[1],r[2]=t[2]/i[2],r},s.dot=oo,s.earthRadius=Id,s.ease=Ki,s.easeCubicInOut=$r,s.ecefToLatLng=function([r,t,i]){const a=Math.hypot(r,t,i),u=Math.atan2(r,i),p=.5*Math.PI-Math.acos(-t/a);return new ln(Vt(u),Vt(p))},s.emitValidationErrors=qf,s.endsWith=xn,s.enforceCacheSizeLimit=function(r){Ts(),fi&&fi.then(t=>{t.keys().then(i=>{for(let a=0;ap&&(a+=(r[u]-p)*(r[u]-p)),t[u]0){const R=180/a;Yx(L,L,[R/b+1,0,0,0,R/A+1,0,-.5*R/I,.5*R/M,1])}return L[2]=w,L[5]=r.x,L[8]=r.y,L},s.getImage=ne,s.getJSON=function(r,t){return Cs(vn(r,{type:"json"}),t)},s.getLatitudinalLod=function(r){const t=zr-5;r=Je(r,-t,t)/t*90;const i=Math.pow(Math.abs(Math.sin(St(r))),3);return Math.round(i*(Sd.length-1))},s.getMapSessionAPI=hr,s.getPerformanceMeasurement=wh,s.getProjection=Ub,s.getRTLTextPluginStatus=x,s.getReferrer=As,s.getTilePoint=function(r,{x:t,y:i},a=0){return new Ve(((t-a)*r.scale-r.x)*vt,(i*r.scale-r.y)*vt)},s.getTileVec3=function(r,t,i=0){return ou(((t.x-i)*r.scale-r.x)*vt,(t.y*r.scale-r.y)*vt,xw(t.z,t.y))},s.getVideo=function(r,t){const i=k.document.createElement("video");i.muted=!0,i.onloadstart=function(){t(null,i)};for(let a=0;a{}}},s.globeCenterToScreenPoint=function(r){const t=[0,0,0],i=Lo(new Float64Array(16));return Zl(i,r.pixelMatrix,r.globeMatrix),Nn(t,t,i),new Ve(t[0],t[1])},s.globeDenormalizeECEF=Cy,s.globeECEFOrigin=function(r,t){const i=[0,0,0];return Nn(i,i,Cd(ss(t.canonical))),Nn(i,i,r),i},s.globeMetersToEcef=em,s.globeNormalizeECEF=Cd,s.globePixelsToTileUnits=function(r,t){return vt/(512*Math.pow(2,r))*nm(ss(t))},s.globePoleMatrixForTile=function(r,t,i){const a=Lo(new Float64Array(16)),u=(t/(1<0;return a===0&&!u&&!g&&p},s.identity=Lo,s.identity$1=sw,s.invert=gy,s.isFullscreen=function(){return!!k.document.fullscreenElement||!!k.document.webkitFullscreenElement},s.isLngLatBehindGlobe=Iy,s.isMapAuthenticated=function(r){return Or.has(r)},s.isMapboxURL=_e,s.isSafariWithAntialiasingBug=function(r){const t=r.navigator?r.navigator.userAgent:null;return!!aa(r)&&t&&(t.match("Version/15.4")||t.match("Version/15.5")||t.match(/CPU (OS|iPhone OS) (15_4|15_5) like Mac OS X/))},s.latFromMercatorY=Pr,s.latLngToECEF=au,s.len=_k,s.length=vd,s.length$1=function(r){return Math.hypot(r[0],r[1],r[2],r[3])},s.lngFromMercatorX=Fi,s.loadVectorTile=c2,s.makeRequest=Cs,s.mapValue=function(r,t,i,a,u){return Je((r-t)/(i-t)*(u-a)+a,a,u)},s.mercatorScale=ww,s.mercatorXfromLng=as,s.mercatorYfromLat=ls,s.mercatorZfromAltitude=Do,s.mul=mk,s.mul$1=gk,s.multiply=Zl,s.multiply$1=Yx,s.multiply$2=tw,s.nextPowerOfTwo=br,s.normalize=Zr,s.normalize$1=yk,s.normalize$2=iw,s.number=Wt,s.ortho=function(r,t,i,a,u,p,g){var y=1/(t-i),w=1/(a-u),b=1/(p-g);return r[0]=-2*y,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*w,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=2*b,r[11]=0,r[12]=(t+i)*y,r[13]=(u+a)*w,r[14]=(g+p)*b,r[15]=1,r},s.pbf=sb,s.perspective=function(r,t,i,a,u){var p,g=1/Math.tan(t/2);return r[0]=g/i,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=g,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=-1,r[12]=0,r[13]=0,r[15]=0,u!=null&&u!==1/0?(r[10]=(u+a)*(p=1/(a-u)),r[14]=2*u*a*p):(r[10]=-1,r[14]=-2*a),r},s.pick=function(r,t){const i={};for(let a=0;a0&&i[0]<=r.width&&i[1]>0&&i[1]<=r.height&&!Iy(r,new ln(r.center.lat,90)),a[0]>0&&a[0]<=r.width&&a[1]>0&&a[1]<=r.height&&!Iy(r,new ln(r.center.lat,-90))]},s.polygonContainsPoint=Ql,s.polygonIntersectsBox=Iw,s.polygonIntersectsPolygon=Tw,s.polygonizeBounds=function(r,t,i=0,a=!0){const u=new Ve(i,i),p=r.sub(u),g=t.add(u),y=[p,new Ve(g.x,p.y),g,new Ve(p.x,g.y)];return a&&y.push(p.clone()),y},s.posAttributes=Td,s.postMapLoadEvent=Vn,s.postPerformanceEvent=tr,s.postTurnstileEvent=Gt,s.potpack=Ky,s.prevPowerOfTwo=function(r){return r<=1?1:Math.pow(2,Math.floor(Math.log(r)/Math.LN2))},s.radToDeg=Vt,s.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],s.registerForPluginStateChange=function(r){return r({pluginStatus:d,pluginURL:o}),_.on("pluginStateChange",r),r},s.removeAuthState=function(r){Or.delete(r)},s.renderColorRamp=By,s.resample=bw,s.rotateX=_y,s.rotateX$1=aw,s.rotateY=Qf,s.rotateY$1=lw,s.rotateZ=function(r,t,i){var a=Math.sin(i),u=Math.cos(i),p=t[0],g=t[1],y=t[2],w=t[3],b=t[4],A=t[5],I=t[6],M=t[7];return t!==r&&(r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r[0]=p*u+b*a,r[1]=g*u+A*a,r[2]=y*u+I*a,r[3]=w*u+M*a,r[4]=b*u-p*a,r[5]=A*u-g*a,r[6]=I*u-y*a,r[7]=M*u-w*a,r},s.rotateZ$1=function(r,t,i){i*=.5;var a=t[0],u=t[1],p=t[2],g=t[3],y=Math.sin(i),w=Math.cos(i);return r[0]=a*w+u*y,r[1]=u*w-a*y,r[2]=p*w+g*y,r[3]=g*w-p*y,r},s.scale=Hl,s.scale$1=rw,s.scale$2=Bi,s.scaleAndAdd=bd,s.set=function(r,t,i,a){return r[0]=t,r[1]=i,r[2]=a,r},s.setCacheLimits=function(r,t){Sc=r,Ac=t},s.setColumn=function(r,t,i){r[4*t+0]=i[0],r[4*t+1]=i[1],r[4*t+2]=i[2],r[4*t+3]=i[3]},s.setRTLTextPlugin=function(r,t,i=!1){if(d===pd||d===fd||d===md)throw new Error("setRTLTextPlugin cannot be called multiple times.");o=xo.resolveURL(r),d=pd,ka=t,f(),i||T()},s.smoothstep=Tt,s.spec=Re,s.squaredLength=function(r){var t=r[0],i=r[1],a=r[2];return t*t+i*i+a*a},s.storeAuthState=function(r,t){t?Or.add(r):Or.delete(r)},s.sub=Ro,s.subtract=vy,s.symbolSize=MM,s.tileAABB=function(r,t,i,a,u,p,g,y,w){if(w.name==="globe")return Ek(r,t,new fm(i,a,u));const b=tc({z:i,x:a,y:u},w);return new Hr([(p+b.x/b.scale)*t,t*(b.y/b.scale),g],[(p+b.x2/b.scale)*t,t*(b.y2/b.scale),y])},s.tileCornersToBounds=tm,s.tileTransform=tc,s.transformMat3=function(r,t,i){var a=t[0],u=t[1],p=t[2];return r[0]=a*i[0]+u*i[3]+p*i[6],r[1]=a*i[1]+u*i[4]+p*i[7],r[2]=a*i[2]+u*i[5]+p*i[8],r},s.transformMat4=Nn,s.transformMat4$1=Xl,s.transformQuat=nw,s.transitionTileAABBinECEF=pw,s.translate=yd,s.transpose=function(r,t){if(r===t){var i=t[1],a=t[2],u=t[5];r[1]=t[3],r[2]=t[6],r[3]=i,r[5]=t[7],r[6]=a,r[7]=u}else r[0]=t[0],r[1]=t[3],r[2]=t[6],r[3]=t[1],r[4]=t[4],r[5]=t[7],r[6]=t[2],r[7]=t[5],r[8]=t[8];return r},s.triggerPluginCompletionEvent=c,s.uniqueId=ii,s.updateGlobeVertexNormal=function(r,t,i,a,u){const p=5*t+2;r.float32[p+0]=i,r.float32[p+1]=a,r.float32[p+2]=u},s.validateCustomStyleLayer=function(r){const t=[],i=r.id;return i===void 0&&t.push({message:`layers.${i}: missing required property "id"`}),r.render===void 0&&t.push({message:`layers.${i}: missing required method "render"`}),r.renderingMode&&r.renderingMode!=="2d"&&r.renderingMode!=="3d"&&t.push({message:`layers.${i}: property "renderingMode" must be either "2d" or "3d"`}),t},s.validateFilter=r=>yi(Vl(r)),s.validateFog=r=>yi(Vf(r)),s.validateLayer=r=>yi(Ff(r)),s.validateLight=r=>yi(jf(r)),s.validateSource=r=>yi(Uf(r)),s.validateStyle=Gf,s.validateTerrain=r=>yi(ld(r)),s.values=dn,s.vectorTile=hm,s.version=D,s.warnOnce=wn,s.window=k,s.wrap=xt}),v(["./shared"],function(s){function k(oe){if(typeof oe=="number"||typeof oe=="boolean"||typeof oe=="string"||oe==null)return JSON.stringify(oe);if(Array.isArray(oe)){let U="[";for(const ne of oe)U+=`${k(ne)},`;return`${U}]`}let N="{";for(const U of Object.keys(oe).sort())N+=`${U}:${k(oe[U])},`;return`${N}}`}function D(oe){let N="";for(const U of s.refProperties)N+=`/${k(oe[U])}`;return N}class V{constructor(N){this.keyCache={},N&&this.replace(N)}replace(N){this._layerConfigs={},this._layers={},this.update(N,[])}update(N,U){for(const he of N)this._layerConfigs[he.id]=he,(this._layers[he.id]=s.createStyleLayer(he)).compileFilter(),this.keyCache[he.id]&&delete this.keyCache[he.id];for(const he of U)delete this.keyCache[he],delete this._layerConfigs[he],delete this._layers[he];this.familiesBySource={};const ne=function(he,_e){const be={};for(let ge=0;gethis._layers[rt.id]),be=_e[0];if(be.visibility==="none")continue;const we=be.source||"";let ge=this.familiesBySource[we];ge||(ge=this.familiesBySource[we]={});const Pe=be.sourceLayer||"_geojsonTileLayer";let nt=ge[Pe];nt||(nt=ge[Pe]=[]),nt.push(_e)}}}class G{loadTile(N,U){const{uid:ne,encoding:he,rawImageData:_e,padding:be,buildQuadTree:we}=N,ge=s.window.ImageBitmap&&_e instanceof s.window.ImageBitmap?this.getImageData(_e,be):_e;U(null,new s.DEMData(ne,ge,he,be<1,we))}getImageData(N,U){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(N.width,N.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=N.width,this.offscreenCanvas.height=N.height,this.offscreenCanvasContext.drawImage(N,0,0,N.width,N.height);const ne=this.offscreenCanvasContext.getImageData(-U,-U,N.width+2*U,N.height+2*U);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),ne}}function J(oe,N){if(oe.length!==0){ve(oe[0],N);for(var U=1;U=Math.abs(we)?U-ge+we:we-ge+U,U=ge}U+ne>=0!=!!N&&oe.reverse()}var ae=s.getDefaultExportFromCjs(function oe(N,U){var ne,he=N&&N.type;if(he==="FeatureCollection")for(ne=0;ne>31}function Vr(oe,N){for(var U=oe.loadGeometry(),ne=oe.type,he=0,_e=0,be=U.length,we=0;weoe},Je=Math.fround||(Tt=new Float32Array(1),oe=>(Tt[0]=+oe,Tt[0]));var Tt;const xt=3,Bt=5,dn=6;class vn{constructor(N){this.options=Object.assign(Object.create(Ki),N),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(N){const{log:U,minZoom:ne,maxZoom:he}=this.options;U&&console.time("total time");const _e=`prepare ${N.length} points`;U&&console.time(_e),this.points=N;const be=[];for(let ge=0;ge=ne;ge--){const Pe=+Date.now();we=this.trees[ge]=this._createTree(this._cluster(we,ge)),U&&console.log("z%d: %d clusters in %dms",ge,we.numItems,+Date.now()-Pe)}return U&&console.timeEnd("total time"),this}getClusters(N,U){let ne=((N[0]+180)%360+360)%360-180;const he=Math.max(-90,Math.min(90,N[1]));let _e=N[2]===180?180:((N[2]+180)%360+360)%360-180;const be=Math.max(-90,Math.min(90,N[3]));if(N[2]-N[0]>=360)ne=-180,_e=180;else if(ne>_e){const rt=this.getClusters([ne,he,180,be],U),Qe=this.getClusters([-180,he,_e,be],U);return rt.concat(Qe)}const we=this.trees[this._limitZoom(U)],ge=we.range(ar(ne),br(be),ar(_e),br(he)),Pe=we.data,nt=[];for(const rt of ge){const Qe=this.stride*rt;nt.push(Pe[Qe+Bt]>1?sr(Pe,Qe,this.clusterProps):this.points[Pe[Qe+xt]])}return nt}getChildren(N){const U=this._getOriginId(N),ne=this._getOriginZoom(N),he="No cluster with the specified id.",_e=this.trees[ne];if(!_e)throw new Error(he);const be=_e.data;if(U*this.stride>=be.length)throw new Error(he);const we=this.options.radius/(this.options.extent*Math.pow(2,ne-1)),ge=_e.within(be[U*this.stride],be[U*this.stride+1],we),Pe=[];for(const nt of ge){const rt=nt*this.stride;be[rt+4]===N&&Pe.push(be[rt+Bt]>1?sr(be,rt,this.clusterProps):this.points[be[rt+xt]])}if(Pe.length===0)throw new Error(he);return Pe}getLeaves(N,U,ne){const he=[];return this._appendLeaves(he,N,U=U||10,ne=ne||0,0),he}getTile(N,U,ne){const he=this.trees[this._limitZoom(N)],_e=Math.pow(2,N),{extent:be,radius:we}=this.options,ge=we/be,Pe=(ne-ge)/_e,nt=(ne+1+ge)/_e,rt={features:[]};return this._addTileFeatures(he.range((U-ge)/_e,Pe,(U+1+ge)/_e,nt),he.data,U,ne,_e,rt),U===0&&this._addTileFeatures(he.range(1-ge/_e,Pe,1,nt),he.data,_e,ne,_e,rt),U===_e-1&&this._addTileFeatures(he.range(0,Pe,ge/_e,nt),he.data,-1,ne,_e,rt),rt.features.length?rt:null}getClusterExpansionZoom(N){let U=this._getOriginZoom(N)-1;for(;U<=this.options.maxZoom;){const ne=this.getChildren(N);if(U++,ne.length!==1)break;N=ne[0].properties.cluster_id}return U}_appendLeaves(N,U,ne,he,_e){const be=this.getChildren(U);for(const we of be){const ge=we.properties;if(ge&&ge.cluster?_e+ge.point_count<=he?_e+=ge.point_count:_e=this._appendLeaves(N,ge.cluster_id,ne,he,_e):_e1;let nt,rt,Qe;if(Pe)nt=ii(U,ge,this.clusterProps),rt=U[ge],Qe=U[ge+1];else{const Pt=this.points[U[ge+xt]];nt=Pt.properties;const[Dt,Gt]=Pt.geometry.coordinates;rt=ar(Dt),Qe=br(Gt)}const Mt={type:1,geometry:[[Math.round(this.options.extent*(rt*_e-ne)),Math.round(this.options.extent*(Qe*_e-he))]],tags:nt};let Rt;Rt=Pe||this.options.generateId?U[ge+xt]:this.points[U[ge+xt]].id,Rt!==void 0&&(Mt.id=Rt),be.features.push(Mt)}}_limitZoom(N){return Math.max(this.options.minZoom,Math.min(Math.floor(+N),this.options.maxZoom+1))}_cluster(N,U){const{radius:ne,extent:he,reduce:_e,minPoints:be}=this.options,we=ne/(he*Math.pow(2,U)),ge=N.data,Pe=[],nt=this.stride;for(let rt=0;rtU&&(Dt+=ge[In+Bt])}if(Dt>Pt&&Dt>=be){let Gt,In=Qe*Pt,Vn=Mt*Pt,Ir=-1;const tr=((rt/nt|0)<<5)+(U+1)+this.points.length;for(const Ji of Rt){const hr=Ji*nt;if(ge[hr+2]<=U)continue;ge[hr+2]=U;const Or=ge[hr+Bt];In+=ge[hr]*Or,Vn+=ge[hr+1]*Or,ge[hr+4]=tr,_e&&(Gt||(Gt=this._map(ge,rt,!0),Ir=this.clusterProps.length,this.clusterProps.push(Gt)),_e(Gt,this._map(ge,hr)))}ge[rt+4]=tr,Pe.push(In/Dt,Vn/Dt,1/0,tr,-1,Dt),_e&&Pe.push(Ir)}else{for(let Gt=0;Gt1)for(const Gt of Rt){const In=Gt*nt;if(!(ge[In+2]<=U)){ge[In+2]=U;for(let Vn=0;Vn>5}_getOriginZoom(N){return(N-this.points.length)%32}_map(N,U,ne){if(N[U+Bt]>1){const be=this.clusterProps[N[U+dn]];return ne?Object.assign({},be):be}const he=this.points[N[U+xt]].properties,_e=this.options.map(he);return ne&&_e===he?Object.assign({},_e):_e}}function sr(oe,N,U){return{type:"Feature",id:oe[N+xt],properties:ii(oe,N,U),geometry:{type:"Point",coordinates:[(ne=oe[N],360*(ne-.5)),Es(oe[N+1])]}};var ne}function ii(oe,N,U){const ne=oe[N+Bt],he=ne>=1e4?`${Math.round(ne/1e3)}k`:ne>=1e3?Math.round(ne/100)/10+"k":ne,_e=oe[N+dn],be=_e===-1?{}:Object.assign({},U[_e]);return Object.assign(be,{cluster:!0,cluster_id:oe[N+xt],point_count:ne,point_count_abbreviated:he})}function ar(oe){return oe/360+.5}function br(oe){const N=Math.sin(oe*Math.PI/180),U=.5-.25*Math.log((1+N)/(1-N))/Math.PI;return U<0?0:U>1?1:U}function Es(oe){const N=(180-360*oe)*Math.PI/180;return 360*Math.atan(Math.exp(N))/Math.PI-90}function Yi(oe,N,U,ne){for(var he,_e=ne,be=U-N>>1,we=U-N,ge=oe[N],Pe=oe[N+1],nt=oe[U],rt=oe[U+1],Qe=N+3;Qe_e)he=Qe,_e=Mt;else if(Mt===_e){var Rt=Math.abs(Qe-be);Rtne&&(he-N>3&&Yi(oe,N,he,ne),oe[he+2]=_e,U-he>3&&Yi(oe,he,U,ne))}function xn(oe,N,U,ne,he,_e){var be=he-U,we=_e-ne;if(be!==0||we!==0){var ge=((oe-U)*be+(N-ne)*we)/(be*be+we*we);ge>1?(U=he,ne=_e):ge>0&&(U+=be*ge,ne+=we*ge)}return(be=oe-U)*be+(we=N-ne)*we}function kt(oe,N,U,ne){var he={id:oe===void 0?null:oe,type:N,geometry:U,tags:ne,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(_e){var be=_e.geometry,we=_e.type;if(we==="Point"||we==="MultiPoint"||we==="LineString")Yo(_e,be);else if(we==="Polygon"||we==="MultiLineString")for(var ge=0;ge0&&(be+=ne?(he*Pe-ge*_e)/2:Math.sqrt(Math.pow(ge-he,2)+Math.pow(Pe-_e,2))),he=ge,_e=Pe}var nt=N.length-3;N[2]=1,Yi(N,0,nt,U),N[nt+2]=1,N.size=Math.abs(be),N.start=0,N.end=N.size}function pi(oe,N,U,ne){for(var he=0;he1?1:U}function oi(oe,N,U,ne,he,_e,be,we){if(ne/=N,_e>=(U/=N)&&be=ne)return null;for(var ge=[],Pe=0;Pe=U&&Rt=ne)){var Pt=[];if(Qe==="Point"||Qe==="MultiPoint")fl(rt,Pt,U,ne,he);else if(Qe==="LineString")aa(rt,Pt,U,ne,he,!1,we.lineMetrics);else if(Qe==="MultiLineString")Qo(rt,Pt,U,ne,he,!1);else if(Qe==="Polygon")Qo(rt,Pt,U,ne,he,!0);else if(Qe==="MultiPolygon")for(var Dt=0;Dt=U&&be<=ne&&(N.push(oe[_e]),N.push(oe[_e+1]),N.push(oe[_e+2]))}}function aa(oe,N,U,ne,he,_e,be){for(var we,ge,Pe=ml(oe),nt=he===0?Sc:Ac,rt=oe.start,Qe=0;QeU&&(ge=nt(Pe,Mt,Rt,Dt,Gt,U),be&&(Pe.start=rt+we*ge)):In>ne?Vn=U&&(ge=nt(Pe,Mt,Rt,Dt,Gt,U),Ir=!0),Vn>ne&&In<=ne&&(ge=nt(Pe,Mt,Rt,Dt,Gt,ne),Ir=!0),!_e&&Ir&&(be&&(Pe.end=rt+we*ge),N.push(Pe),Pe=ml(oe)),be&&(rt+=we)}var tr=oe.length-3;Mt=oe[tr],Rt=oe[tr+1],Pt=oe[tr+2],(In=he===0?Mt:Rt)>=U&&In<=ne&&la(Pe,Mt,Rt,Pt),tr=Pe.length-3,_e&&tr>=3&&(Pe[tr]!==Pe[0]||Pe[tr+1]!==Pe[1])&&la(Pe,Pe[0],Pe[1],Pe[2]),Pe.length&&N.push(Pe)}function ml(oe){var N=[];return N.size=oe.size,N.start=oe.start,N.end=oe.end,N}function Qo(oe,N,U,ne,he,_e){for(var be=0;bebe.maxX&&(be.maxX=nt),rt>be.maxY&&(be.maxY=rt)}return be}function _l(oe,N,U,ne){var he=N.geometry,_e=N.type,be=[];if(_e==="Point"||_e==="MultiPoint")for(var we=0;we0&&N.size<(he?be:ne))U.numPoints+=N.length/3;else{for(var we=[],ge=0;gebe)&&(U.numSimplified++,we.push(N[ge]),we.push(N[ge+1])),U.numPoints++;he&&function(Pe,nt){for(var rt=0,Qe=0,Mt=Pe.length,Rt=Mt-2;Qe0===nt)for(Qe=0,Mt=Pe.length;Qe24)throw new Error("maxZoom should be in the 0-24 range");if(N.promoteId&&N.generateId)throw new Error("promoteId and generateId cannot be used together.");var ne=function(he,_e){var be=[];if(he.type==="FeatureCollection")for(var we=0;we1&&console.time("creation"),Qe=this.tiles[rt]=ca(oe,N,U,ne,ge),this.tileCoords.push({z:N,x:U,y:ne}),Pe)){Pe>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",N,U,ne,Qe.numFeatures,Qe.numPoints,Qe.numSimplified),console.timeEnd("creation"));var Mt="z"+N;this.stats[Mt]=(this.stats[Mt]||0)+1,this.total++}if(Qe.source=oe,he){if(N===ge.maxZoom||N===he)continue;var Rt=1<1&&console.time("clipping");var Pt,Dt,Gt,In,Vn,Ir,tr=.5*ge.buffer/ge.extent,Ji=.5-tr,hr=.5+tr,Or=1+tr;Pt=Dt=Gt=In=null,Vn=oi(oe,nt,U-tr,U+hr,0,Qe.minX,Qe.maxX,ge),Ir=oi(oe,nt,U+Ji,U+Or,0,Qe.minX,Qe.maxX,ge),oe=null,Vn&&(Pt=oi(Vn,nt,ne-tr,ne+hr,1,Qe.minY,Qe.maxY,ge),Dt=oi(Vn,nt,ne+Ji,ne+Or,1,Qe.minY,Qe.maxY,ge),Vn=null),Ir&&(Gt=oi(Ir,nt,ne-tr,ne+hr,1,Qe.minY,Qe.maxY,ge),In=oi(Ir,nt,ne+Ji,ne+Or,1,Qe.minY,Qe.maxY,ge),Ir=null),Pe>1&&console.timeEnd("clipping"),we.push(Pt||[],N+1,2*U,2*ne),we.push(Dt||[],N+1,2*U,2*ne+1),we.push(Gt||[],N+1,2*U+1,2*ne),we.push(In||[],N+1,2*U+1,2*ne+1)}}},ts.prototype.getTile=function(oe,N,U){var ne=this.options,he=ne.extent,_e=ne.debug;if(oe<0||oe>24)return null;var be=1<1&&console.log("drilling down to z%d-%d-%d",oe,N,U);for(var ge,Pe=oe,nt=N,rt=U;!ge&&Pe>0;)Pe--,nt=Math.floor(nt/2),rt=Math.floor(rt/2),ge=this.tiles[As(Pe,nt,rt)];return ge&&ge.source?(_e>1&&console.log("found parent tile z%d-%d-%d",Pe,nt,rt),_e>1&&console.time("drilling down"),this.splitTile(ge.source,Pe,nt,rt,oe,N,U),_e>1&&console.timeEnd("drilling down"),this.tiles[we]?gl(this.tiles[we],he):null):null};class ua extends s.VectorTileWorkerSource{constructor(N,U,ne,he,_e){super(N,U,ne,he,Cs),_e&&(this.loadGeoJSON=_e)}loadData(N,U){const ne=N&&N.request,he=ne&&ne.collectResourceTiming;this.loadGeoJSON(N,(_e,be)=>{if(_e||!be)return U(_e);if(typeof be!="object")return U(new Error(`Input data given to '${N.source}' is not a valid GeoJSON object.`));{ae(be,!0);try{if(N.filter){const ge=s.createExpression(N.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(ge.result==="error")throw new Error(ge.value.map(nt=>`${nt.key}: ${nt.message}`).join(", "));be={type:"FeatureCollection",features:be.features.filter(nt=>ge.value.evaluate({zoom:0},nt))}}this._geoJSONIndex=N.cluster?new vn(function({superclusterOptions:ge,clusterProperties:Pe}){if(!Pe||!ge)return ge;const nt={},rt={},Qe={accumulated:null,zoom:0},Mt={properties:null},Rt=Object.keys(Pe);for(const Pt of Rt){const[Dt,Gt]=Pe[Pt],In=s.createExpression(Gt),Vn=s.createExpression(typeof Dt=="string"?[Dt,["accumulated"],["get",Pt]]:Dt);nt[Pt]=In.value,rt[Pt]=Vn.value}return ge.map=Pt=>{Mt.properties=Pt;const Dt={};for(const Gt of Rt)Dt[Gt]=nt[Gt].evaluate(Qe,Mt);return Dt},ge.reduce=(Pt,Dt)=>{Mt.properties=Dt;for(const Gt of Rt)Qe.accumulated=Pt[Gt],Pt[Gt]=rt[Gt].evaluate(Qe,Mt)},ge}(N)).load(be.features):function(ge,Pe){return new ts(ge,Pe)}(be,N.geojsonVtOptions)}catch(ge){return U(ge)}this.loaded={};const we={};if(he){const ge=s.getPerformanceMeasurement(ne);ge&&(we.resourceTiming={},we.resourceTiming[N.source]=JSON.parse(JSON.stringify(ge)))}U(null,we)}})}reloadTile(N,U){const ne=this.loaded;return ne&&ne[N.uid]?super.reloadTile(N,U):this.loadTile(N,U)}loadGeoJSON(N,U){if(N.request)s.getJSON(N.request,U);else{if(typeof N.data!="string")return U(new Error(`Input data given to '${N.source}' is not a valid GeoJSON object.`));try{return U(null,JSON.parse(N.data))}catch{return U(new Error(`Input data given to '${N.source}' is not a valid GeoJSON object.`))}}}getClusterExpansionZoom(N,U){try{U(null,this._geoJSONIndex.getClusterExpansionZoom(N.clusterId))}catch(ne){U(ne)}}getClusterChildren(N,U){try{U(null,this._geoJSONIndex.getChildren(N.clusterId))}catch(ne){U(ne)}}getClusterLeaves(N,U){try{U(null,this._geoJSONIndex.getLeaves(N.clusterId,N.limit,N.offset))}catch(ne){U(ne)}}}class Cc{constructor(N){this.self=N,this.actor=new s.Actor(N,this),this.layerIndexes={},this.availableImages={},this.isSpriteLoaded={},this.projections={},this.defaultProjection=s.getProjection({name:"mercator"}),this.workerSourceTypes={vector:s.VectorTileWorkerSource,geojson:ua},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(U,ne)=>{if(this.workerSourceTypes[U])throw new Error(`Worker source with name "${U}" already registered.`);this.workerSourceTypes[U]=ne},this.self.registerRTLTextPlugin=U=>{if(s.plugin.isParsed())throw new Error("RTL text plugin already registered.");s.plugin.applyArabicShaping=U.applyArabicShaping,s.plugin.processBidirectionalText=U.processBidirectionalText,s.plugin.processStyledBidirectionalText=U.processStyledBidirectionalText}}clearCaches(N,U,ne){delete this.layerIndexes[N],delete this.availableImages[N],delete this.workerSources[N],delete this.demWorkerSources[N],ne()}checkIfReady(N,U,ne){ne()}setReferrer(N,U){this.referrer=U}spriteLoaded(N,U){this.isSpriteLoaded[N]=U;for(const ne in this.workerSources[N]){const he=this.workerSources[N][ne];for(const _e in he)he[_e]instanceof s.VectorTileWorkerSource&&(he[_e].isSpriteLoaded=U,he[_e].fire(new s.Event("isSpriteLoaded")))}}setImages(N,U,ne){this.availableImages[N]=U;for(const he in this.workerSources[N]){const _e=this.workerSources[N][he];for(const be in _e)_e[be].availableImages=U}ne()}enableTerrain(N,U,ne){this.terrain=U,ne()}setProjection(N,U){this.projections[N]=s.getProjection(U)}setLayers(N,U,ne){this.getLayerIndex(N).replace(U),ne()}updateLayers(N,U,ne){this.getLayerIndex(N).update(U.layers,U.removedIds),ne()}loadTile(N,U,ne){const he=this.enableTerrain?s.extend({enableTerrain:this.terrain},U):U;he.projection=this.projections[N]||this.defaultProjection,this.getWorkerSource(N,U.type,U.source).loadTile(he,ne)}loadDEMTile(N,U,ne){const he=this.enableTerrain?s.extend({buildQuadTree:this.terrain},U):U;this.getDEMWorkerSource(N,U.source).loadTile(he,ne)}reloadTile(N,U,ne){const he=this.enableTerrain?s.extend({enableTerrain:this.terrain},U):U;he.projection=this.projections[N]||this.defaultProjection,this.getWorkerSource(N,U.type,U.source).reloadTile(he,ne)}abortTile(N,U,ne){this.getWorkerSource(N,U.type,U.source).abortTile(U,ne)}removeTile(N,U,ne){this.getWorkerSource(N,U.type,U.source).removeTile(U,ne)}removeSource(N,U,ne){if(!this.workerSources[N]||!this.workerSources[N][U.type]||!this.workerSources[N][U.type][U.source])return;const he=this.workerSources[N][U.type][U.source];delete this.workerSources[N][U.type][U.source],he.removeSource!==void 0?he.removeSource(U,ne):ne()}loadWorkerSource(N,U,ne){try{this.self.importScripts(U.url),ne()}catch(he){ne(he.toString())}}syncRTLPluginState(N,U,ne){try{s.plugin.setState(U);const he=s.plugin.getPluginURL();if(s.plugin.isLoaded()&&!s.plugin.isParsed()&&he!=null){this.self.importScripts(he);const _e=s.plugin.isParsed();ne(_e?void 0:new Error(`RTL Text Plugin failed to import scripts from ${he}`),_e)}}catch(he){ne(he.toString())}}getAvailableImages(N){let U=this.availableImages[N];return U||(U=[]),U}getLayerIndex(N){let U=this.layerIndexes[N];return U||(U=this.layerIndexes[N]=new V),U}getWorkerSource(N,U,ne){if(this.workerSources[N]||(this.workerSources[N]={}),this.workerSources[N][U]||(this.workerSources[N][U]={}),!this.workerSources[N][U][ne]){const he={send:(_e,be,we,ge,Pe,nt)=>{this.actor.send(_e,be,we,N,Pe,nt)},scheduler:this.actor.scheduler};this.workerSources[N][U][ne]=new this.workerSourceTypes[U](he,this.getLayerIndex(N),this.getAvailableImages(N),this.isSpriteLoaded[N])}return this.workerSources[N][U][ne]}getDEMWorkerSource(N,U){return this.demWorkerSources[N]||(this.demWorkerSources[N]={}),this.demWorkerSources[N][U]||(this.demWorkerSources[N][U]=new G),this.demWorkerSources[N][U]}enforceCacheSizeLimit(N,U){s.enforceCacheSizeLimit(U)}getWorkerPerformanceMetrics(N,U,ne){ne(void 0,void 0)}}return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&(self.worker=new Cc(self)),Cc}),v(["./shared"],function(s){function k(d,o){if(Array.isArray(d)){if(!Array.isArray(o)||d.length!==o.length)return!1;for(let c=0;c"u"||typeof document>"u"?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var f,_,x=new Blob([""],{type:"text/javascript"}),T=URL.createObjectURL(x);try{_=new Worker(T),f=!0}catch{f=!1}return _&&_.terminate(),URL.revokeObjectURL(T),f}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var f=document.createElement("canvas");f.width=f.height=1;var _=f.getContext("2d");if(!_)return!1;var x=_.getImageData(0,0,1,1);return x&&x.width===f.width}()?(G[c=o&&o.failIfMajorPerformanceCaveat]===void 0&&(G[c]=function(f){var _,x=function(T){var S=document.createElement("canvas"),C=Object.create(V.webGLContextAttributes);return C.failIfMajorPerformanceCaveat=T,S.getContext("webgl",C)||S.getContext("experimental-webgl",C)}(f);if(!x)return!1;try{_=x.createShader(x.VERTEX_SHADER)}catch{return!1}return!(!_||x.isContextLost())&&(x.shaderSource(_,"void main() {}"),x.compileShader(_),x.getShaderParameter(_,x.COMPILE_STATUS)===!0)}(c)),G[c]?document.documentMode?"insufficient ECMAScript 6 support":void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var c}(d)}var G={};function J(d,o,c){const f=s.window.document.createElement(d);return o!==void 0&&(f.className=o),c&&c.appendChild(f),f}function ve(d,o,c){const f=s.window.document.createElementNS("http://www.w3.org/2000/svg",d);for(const _ of Object.keys(o))f.setAttributeNS(null,_,o[_]);return c&&c.appendChild(f),f}V.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};const ae=s.window.document&&s.window.document.documentElement.style,me=ae&&ae.userSelect!==void 0?"userSelect":"WebkitUserSelect";let Ce;function ie(){ae&&me&&(Ce=ae[me],ae[me]="none")}function te(){ae&&me&&(ae[me]=Ce)}function le(d){d.preventDefault(),d.stopPropagation(),s.window.removeEventListener("click",le,!0)}function ze(){s.window.addEventListener("click",le,!0),s.window.setTimeout(()=>{s.window.removeEventListener("click",le,!0)},0)}function Oe(d,o){const c=d.getBoundingClientRect();return ht(d,c,o)}function Ke(d,o){const c=d.getBoundingClientRect(),f=[];for(let _=0;_=0?0:d.button}function ht(d,o,c){const f=d.offsetWidth===o.width?1:d.offsetWidth/o.width;return new s.Point((c.clientX-o.left)*f,(c.clientY-o.top)*f)}function Ve(d,o){var c=o[0],f=o[1],_=o[2],x=o[3],T=c*x-_*f;return T?(d[0]=x*(T=1/T),d[1]=-f*T,d[2]=-_*T,d[3]=c*T,d):null}function jt(d){const{userImage:o}=d;return!!(o&&o.render&&o.render())&&(d.data.replace(new Uint8Array(o.data.buffer)),!0)}class wr extends s.Evented{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new s.RGBAImage({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(o){if(this.loaded!==o&&(this.loaded=o,o)){for(const{ids:c,callback:f}of this.requestors)this._notify(c,f);this.requestors=[]}}hasImage(o){return!!this.getImage(o)}getImage(o){return this.images[o]}addImage(o,c){this._validate(o,c)&&(this.images[o]=c)}_validate(o,c){let f=!0;return this._validateStretch(c.stretchX,c.data&&c.data.width)||(this.fire(new s.ErrorEvent(new Error(`Image "${o}" has invalid "stretchX" value`))),f=!1),this._validateStretch(c.stretchY,c.data&&c.data.height)||(this.fire(new s.ErrorEvent(new Error(`Image "${o}" has invalid "stretchY" value`))),f=!1),this._validateContent(c.content,c)||(this.fire(new s.ErrorEvent(new Error(`Image "${o}" has invalid "content" value`))),f=!1),f}_validateStretch(o,c){if(!o)return!0;let f=0;for(const _ of o){if(_[0]{this.ready=!0})}broadcast(o,c,f){s.asyncAll(this.actors,(_,x)=>{_.send(o,c,x)},f=f||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach(o=>{o.remove()}),this.actors=[],this.workerPool.release(this.id)}}function Bt(d,o,c){return o*(s.EXTENT/(d.tileSize*Math.pow(2,c-d.tileID.overscaledZ)))}xt.Actor=s.Actor;class dn{constructor(o,c,f,_){this.screenBounds=o,this.cameraPoint=c,this._screenRaycastCache={},this._cameraRaycastCache={},this.isAboveHorizon=f,this.screenGeometry=this.bufferedScreenGeometry(0),this.screenGeometryMercator=this._bufferedScreenMercator(0,_)}static createFromScreenPoints(o,c){let f,_;if(o instanceof s.Point||typeof o[0]=="number"){const x=s.Point.convert(o);f=[x],_=c.isPointAboveHorizon(x)}else{const x=s.Point.convert(o[0]),T=s.Point.convert(o[1]);f=[x,T],_=s.polygonizeBounds(x,T).every(S=>c.isPointAboveHorizon(S))}return new dn(f,c.getCameraPoint(),_,c)}isPointQuery(){return this.screenBounds.length===1}bufferedScreenGeometry(o){return s.polygonizeBounds(this.screenBounds[0],this.screenBounds.length===1?this.screenBounds[0]:this.screenBounds[1],o)}bufferedCameraGeometry(o){const c=this.screenBounds[0],f=this.screenBounds.length===1?this.screenBounds[0].add(new s.Point(1,1)):this.screenBounds[1],_=s.polygonizeBounds(c,f,0,!1);return this.cameraPoint.y>f.y&&(this.cameraPoint.x>c.x&&this.cameraPoint.x=f.x?_[2]=this.cameraPoint:this.cameraPoint.x<=c.x&&(_[3]=this.cameraPoint)),s.bufferConvexPolygon(_,o)}bufferedCameraGeometryGlobe(o){const c=this.screenBounds[0],f=this.screenBounds.length===1?this.screenBounds[0].add(new s.Point(1,1)):this.screenBounds[1],_=s.polygonizeBounds(c,f,o),x=this.cameraPoint.clone();switch(3*((x.y>c.y)+(x.y>f.y))+((x.x>c.x)+(x.x>f.x))){case 0:_[0]=x,_[4]=x.clone();break;case 1:_.splice(1,0,x);break;case 2:_[1]=x;break;case 3:_.splice(4,0,x);break;case 5:_.splice(2,0,x);break;case 6:_[3]=x;break;case 7:_.splice(3,0,x);break;case 8:_[2]=x}return _}containsTile(o,c,f,_=0){const x=o.queryPadding/c._pixelsPerMercatorPixel+1,T=f?this._bufferedCameraMercator(x,c):this._bufferedScreenMercator(x,c);let S=o.tileID.wrap+(T.unwrapped?_:0);const C=T.polygon.map(X=>s.getTilePoint(o.tileTransform,X,S));if(!s.polygonIntersectsBox(C,0,0,s.EXTENT,s.EXTENT))return;S=o.tileID.wrap+(this.screenGeometryMercator.unwrapped?_:0);const z=this.screenGeometryMercator.polygon.map(X=>s.getTileVec3(o.tileTransform,X,S)),P=z.map(X=>new s.Point(X[0],X[1])),O=c.getFreeCameraOptions().position||new s.MercatorCoordinate(0,0,0),j=s.getTileVec3(o.tileTransform,O,S),W=z.map(X=>{const B=s.sub(X,X,j);return s.normalize(B,B),new s.Ray(j,B)}),H=Bt(o,1,c.zoom)*c._pixelsPerMercatorPixel;return{queryGeometry:this,tilespaceGeometry:P,tilespaceRays:W,bufferedTilespaceGeometry:C,bufferedTilespaceBounds:(Z=s.getBounds(C),Z.min.x=s.clamp(Z.min.x,0,s.EXTENT),Z.min.y=s.clamp(Z.min.y,0,s.EXTENT),Z.max.x=s.clamp(Z.max.x,0,s.EXTENT),Z.max.y=s.clamp(Z.max.y,0,s.EXTENT),Z),tile:o,tileID:o.tileID,pixelToTileUnitsFactor:H};var Z}_bufferedScreenMercator(o,c){const f=ii(o);if(this._screenRaycastCache[f])return this._screenRaycastCache[f];{let _;return _=c.projection.name==="globe"?this._projectAndResample(this.bufferedScreenGeometry(o),c):{polygon:this.bufferedScreenGeometry(o).map(x=>c.pointCoordinate3D(x)),unwrapped:!0},this._screenRaycastCache[f]=_,_}}_bufferedCameraMercator(o,c){const f=ii(o);if(this._cameraRaycastCache[f])return this._cameraRaycastCache[f];{let _;return _=c.projection.name==="globe"?this._projectAndResample(this.bufferedCameraGeometryGlobe(o),c):{polygon:this.bufferedCameraGeometry(o).map(x=>c.pointCoordinate3D(x)),unwrapped:!0},this._cameraRaycastCache[f]=_,_}}_projectAndResample(o,c){const f=function(x,T){const S=s.multiply([],T.pixelMatrix,T.globeMatrix),C=[0,-s.GLOBE_RADIUS,0,1],z=[0,s.GLOBE_RADIUS,0,1],P=[0,0,0,1];s.transformMat4$1(C,C,S),s.transformMat4$1(z,z,S),s.transformMat4$1(P,P,S);const O=new s.Point(C[0]/C[3],C[1]/C[3]),j=new s.Point(z[0]/z[3],z[1]/z[3]),W=s.polygonContainsPoint(x,O)&&C[3]1?vn(x.slice(0,X),T):[],Q=Xnew s.Point(sr(pe.x),pe.y)),Q=Q.map(pe=>new s.Point(sr(pe.x),pe.y));const ee=[...q];ee.length===0&&ee.push(Q[Q.length-1]);const de=s.number(ee[ee.length-1].y,(Q.length===0?q[0]:Q[0]).y,B);let fe;return fe=W?[new s.Point(0,de),new s.Point(0,0),new s.Point(1,0),new s.Point(1,de)]:[new s.Point(1,de),new s.Point(1,1),new s.Point(0,1),new s.Point(0,de)],ee.push(...fe),Q.length===0?ee.push(q[0]):ee.push(...Q),{polygon:ee.map(pe=>new s.MercatorCoordinate(pe.x,pe.y)),unwrapped:!1}}(o,c);if(f)return f;const _=function(x,T){let S=!1,C=-1/0,z=0;for(let O=0;OC&&(C=x[O].x,z=O);for(let O=0;O.5&&(W.x{O.x-=1}),{polygon:x,unwrapped:S}}(vn(o,c).map(x=>new s.Point(sr(x.x),x.y)),c);return{polygon:_.polygon.map(x=>new s.MercatorCoordinate(x.x,x.y)),unwrapped:_.unwrapped}}}function vn(d,o){return s.resample(d,c=>{const f=o.pointCoordinate3D(c);c.x=f.x,c.y=f.y},1/256)}function sr(d){return d<0?1+d%1:d%1}function ii(d){return 100*d|0}function ar(d,o,c,f,_){const x=function(T,S){if(T)return _(T);if(S){d.url&&S.tiles&&d.tiles&&delete d.tiles;const C=s.pick(s.extend(S,d),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);S.vector_layers&&(C.vectorLayers=S.vector_layers,C.vectorLayerIds=C.vectorLayers.map(z=>z.id)),C.tiles=o.canonicalizeTileset(C,d.url),_(null,C)}};return d.url?s.getJSON(o.transformRequest(o.normalizeSourceURL(d.url,null,c,f),s.ResourceType.Source),x):s.exported.frame(()=>x(null,d))}class br{constructor(o,c,f){this.bounds=s.LngLatBounds.convert(this.validateBounds(o)),this.minzoom=c||0,this.maxzoom=f||24}validateBounds(o){return Array.isArray(o)&&o.length===4?[Math.max(-180,o[0]),Math.max(-90,o[1]),Math.min(180,o[2]),Math.min(90,o[3])]:[-180,-90,180,90]}contains(o){const c=Math.pow(2,o.z),f=Math.floor(s.mercatorXfromLng(this.bounds.getWest())*c),_=Math.floor(s.mercatorYfromLat(this.bounds.getNorth())*c),x=Math.ceil(s.mercatorXfromLng(this.bounds.getEast())*c),T=Math.ceil(s.mercatorYfromLat(this.bounds.getSouth())*c);return o.x>=f&&o.x=_&&o.y{this._tileJSONRequest=null,this._loaded=!0,_?(c&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${c}`),f&&f.length!==2&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${f}`),this.fire(new s.ErrorEvent(_))):x&&(s.extend(this,x),x.bounds&&(this.tileBounds=new br(x.bounds,this.minzoom,this.maxzoom)),s.postTurnstileEvent(x.tiles,this.map._requestManager._customAccessToken),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"}))),o&&o(_)})}loaded(){return this._loaded}hasTile(o){return!this.tileBounds||this.tileBounds.contains(o.canonical)}onAdd(o){this.map=o,this.load()}reload(){this.cancelTileJSONRequest(),this.load(()=>this.map.style._clearSource(this.id))}setTiles(o){return this._options.tiles=o,this.reload(),this}setUrl(o){return this.url=o,this._options.url=o,this.reload(),this}onRemove(){this.cancelTileJSONRequest()}serialize(){return s.extend({},this._options)}loadTile(o,c){const f=this.map._requestManager.normalizeTileURL(o.tileID.canonical.url(this.tiles,this.scheme)),_={request:this.map._requestManager.transformRequest(f,s.ResourceType.Tile),data:void 0,uid:o.uid,tileID:o.tileID,tileZoom:o.tileZoom,zoom:o.tileID.overscaledZ,tileSize:this.tileSize*o.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:s.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,isSymbolTile:o.isSymbolTile};if(_.request.collectResourceTiming=this._collectResourceTiming,o.actor&&o.state!=="expired")o.state==="loading"?o.reloadCallback=c:o.request=o.actor.send("reloadTile",_,x.bind(this));else if(o.actor=this._tileWorkers[f]=this._tileWorkers[f]||this.dispatcher.getActor(),this.dispatcher.ready)o.request=o.actor.send("loadTile",_,x.bind(this),void 0,!0);else{const T=s.loadVectorTile.call({deduped:this._deduped},_,(S,C)=>{S||!C?x.call(this,S):(_.data={cacheControl:C.cacheControl,expires:C.expires,rawData:C.rawData.slice(0)},o.actor&&o.actor.send("loadTile",_,x.bind(this),void 0,!0))},!0);o.request={cancel:T}}function x(T,S){return delete o.request,o.aborted?c(null):T&&T.status!==404?c(T):(S&&S.resourceTiming&&(o.resourceTiming=S.resourceTiming),this.map._refreshExpiredTiles&&S&&o.setExpiryData(S),o.loadVectorData(S,this.map.painter),s.cacheEntryPossiblyAdded(this.dispatcher),c(null),void(o.reloadCallback&&(this.loadTile(o,o.reloadCallback),o.reloadCallback=null)))}}abortTile(o){o.request&&(o.request.cancel(),delete o.request),o.actor&&o.actor.send("abortTile",{uid:o.uid,type:this.type,source:this.id})}unloadTile(o){o.unloadVectorData(),o.actor&&o.actor.send("removeTile",{uid:o.uid,type:this.type,source:this.id})}hasTransition(){return!1}afterUpdate(){this._tileWorkers={}}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}class Qe extends s.Evented{constructor(o,c,f,_){super(),this.id=o,this.dispatcher=f,this.setEventedParent(_),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=s.extend({type:"raster"},c),s.extend(this,s.pick(c,["url","scheme","tileSize"]))}load(o){this._loaded=!1,this.fire(new s.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=ar(this._options,this.map._requestManager,null,null,(c,f)=>{this._tileJSONRequest=null,this._loaded=!0,c?this.fire(new s.ErrorEvent(c)):f&&(s.extend(this,f),f.bounds&&(this.tileBounds=new br(f.bounds,this.minzoom,this.maxzoom)),s.postTurnstileEvent(f.tiles),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"}))),o&&o(c)})}loaded(){return this._loaded}onAdd(o){this.map=o,this.load()}reload(){this.cancelTileJSONRequest(),this.load(()=>this.map.style._clearSource(this.id))}setTiles(o){return this._options.tiles=o,this.reload(),this}setUrl(o){return this.url=o,this._options.url=o,this.reload(),this}onRemove(){this.cancelTileJSONRequest()}serialize(){return s.extend({},this._options)}hasTile(o){return!this.tileBounds||this.tileBounds.contains(o.canonical)}loadTile(o,c){const f=s.exported.devicePixelRatio>=2,_=this.map._requestManager.normalizeTileURL(o.tileID.canonical.url(this.tiles,this.scheme),f,this.tileSize);o.request=s.getImage(this.map._requestManager.transformRequest(_,s.ResourceType.Tile),(x,T,S,C)=>(delete o.request,o.aborted?(o.state="unloaded",c(null)):x?(o.state="errored",c(x)):T?(this.map._refreshExpiredTiles&&o.setExpiryData({cacheControl:S,expires:C}),o.setTexture(T,this.map.painter),o.state="loaded",s.cacheEntryPossiblyAdded(this.dispatcher),void c(null)):c(null)))}static loadTileData(o,c,f){o.setTexture(c,f)}static unloadTileData(o,c){o.texture&&c.saveTileTexture(o.texture)}abortTile(o,c){o.request&&(o.request.cancel(),delete o.request),c()}unloadTile(o,c){o.texture&&this.map.painter.saveTileTexture(o.texture),c()}hasTransition(){return!1}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}function Mt(d,o,c,f,_,x,T,S){const C=[d,c,_,o,f,x,1,1,1],z=[T,S,1],P=s.adjoint([],C),[O,j,W]=s.transformMat3(z,z,s.transpose(P,P));return s.multiply$1(C,[O,0,0,0,j,0,0,0,W],C)}class Rt extends s.Evented{constructor(o,c,f,_){super(),this.id=o,this.dispatcher=f,this.coordinates=c.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(_),this.options=c,this._dirty=!1}load(o,c){this._loaded=c||!1,this.fire(new s.Event("dataloading",{dataType:"source"})),this.url=this.options.url,this._imageRequest=s.getImage(this.map._requestManager.transformRequest(this.url,s.ResourceType.Image),(f,_)=>{if(this._imageRequest=null,this._loaded=!0,f)this.fire(new s.ErrorEvent(f));else if(_){const{HTMLImageElement:x}=s.window;this.image=_ instanceof x?s.exported.getImageData(_):_,this._dirty=!0,this.width=this.image.width,this.height=this.image.height,o&&(this.coordinates=o),this._finishLoading()}})}loaded(){return this._loaded}updateImage(o){return this.image&&o.url?(this._imageRequest&&o.url!==this.options.url&&(this._imageRequest.cancel(),this._imageRequest=null),this.options.url=o.url,this.load(o.coordinates,this._loaded),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(o){this.map=o,this.load()}onRemove(){this._imageRequest&&(this._imageRequest.cancel(),this._imageRequest=null),this.texture&&this.texture.destroy()}setCoordinates(o){this.coordinates=o,this._boundsArray=void 0;const c=o.map(s.MercatorCoordinate.fromLngLat);return this.tileID=function(f){let _=1/0,x=1/0,T=-1/0,S=-1/0;for(const O of f)_=Math.min(_,O.x),x=Math.min(x,O.y),T=Math.max(T,O.x),S=Math.max(S,O.y);const C=Math.max(T-_,S-x),z=Math.max(0,Math.floor(-Math.log(C)/Math.LN2)),P=Math.pow(2,z);return new s.CanonicalTileID(z,Math.floor((_+T)/2*P),Math.floor((x+S)/2*P))}(c),this.minzoom=this.maxzoom=this.tileID.z,this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"})),this}_clear(){this._boundsArray=void 0}_prepareData(o){for(const C in this.tiles){const z=this.tiles[C];z.state!=="loaded"&&(z.state="loaded",z.texture=this.texture)}if(this._boundsArray)return;const c=s.tileTransform(this.tileID,this.map.transform.projection),[f,_,x,T]=this.coordinates.map(C=>{const z=c.projection.project(C[0],C[1]);return s.getTilePoint(c,z)._round()});this.perspectiveTransform=function(C,z,P,O,j,W,H,Z,X,B){const q=Mt(0,0,C,0,0,z,C,z),Q=Mt(P,O,j,W,H,Z,X,B);return s.multiply$1(Q,s.adjoint(q,q),Q),[Q[6]/Q[8]*C/s.EXTENT,Q[7]/Q[8]*z/s.EXTENT]}(this.width,this.height,f.x,f.y,_.x,_.y,T.x,T.y,x.x,x.y);const S=this._boundsArray=new s.StructArrayLayout4i8;S.emplaceBack(f.x,f.y,0,0),S.emplaceBack(_.x,_.y,s.EXTENT,0),S.emplaceBack(T.x,T.y,0,s.EXTENT),S.emplaceBack(x.x,x.y,s.EXTENT,s.EXTENT),this.boundsBuffer&&this.boundsBuffer.destroy(),this.boundsBuffer=o.createVertexBuffer(S,s.boundsAttributes.members),this.boundsSegments=s.SegmentVector.simpleSegment(0,0,4,2)}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const o=this.map.painter.context,c=o.gl;this._dirty&&(this.texture?this.texture.update(this.image):(this.texture=new s.Texture(o,this.image,c.RGBA),this.texture.bind(c.LINEAR,c.CLAMP_TO_EDGE)),this._dirty=!1),this._prepareData(o)}loadTile(o,c){this.tileID&&this.tileID.equals(o.tileID.canonical)?(this.tiles[String(o.tileID.wrap)]=o,o.buckets={},c(null)):(o.state="errored",c(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}const Pt={vector:rt,raster:Qe,"raster-dem":class extends Qe{constructor(d,o,c,f){super(d,o,c,f),this.type="raster-dem",this.maxzoom=22,this._options=s.extend({type:"raster-dem"},o),this.encoding=o.encoding||"mapbox"}loadTile(d,o){const c=this.map._requestManager.normalizeTileURL(d.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize);function f(_,x){_&&(d.state="errored",o(_)),x&&(d.dem=x,d.dem.onDeserialize(),d.needsHillshadePrepare=!0,d.needsDEMTextureUpload=!0,d.state="loaded",o(null))}d.request=s.getImage(this.map._requestManager.transformRequest(c,s.ResourceType.Tile),(function(_,x,T,S){if(delete d.request,d.aborted)d.state="unloaded",o(null);else if(_)d.state="errored",o(_);else if(x){this.map._refreshExpiredTiles&&d.setExpiryData({cacheControl:T,expires:S});const C=s.window.ImageBitmap&&x instanceof s.window.ImageBitmap&&(ca==null&&(ca=s.window.OffscreenCanvas&&new s.window.OffscreenCanvas(1,1).getContext("2d")&&typeof s.window.createImageBitmap=="function"),ca),z=1-(x.width-s.prevPowerOfTwo(x.width))/2;z<1||d.neighboringTiles||(d.neighboringTiles=this._getNeighboringTiles(d.tileID));const P=C?x:s.exported.getImageData(x,z),O={uid:d.uid,coord:d.tileID,source:this.id,rawImageData:P,encoding:this.encoding,padding:z};d.actor&&d.state!=="expired"||(d.actor=this.dispatcher.getActor(),d.actor.send("loadDEMTile",O,f.bind(this),void 0,!0))}}).bind(this))}_getNeighboringTiles(d){const o=d.canonical,c=Math.pow(2,o.z),f=(o.x-1+c)%c,_=o.x===0?d.wrap-1:d.wrap,x=(o.x+1+c)%c,T=o.x+1===c?d.wrap+1:d.wrap,S={};return S[new s.OverscaledTileID(d.overscaledZ,_,o.z,f,o.y).key]={backfilled:!1},S[new s.OverscaledTileID(d.overscaledZ,T,o.z,x,o.y).key]={backfilled:!1},o.y>0&&(S[new s.OverscaledTileID(d.overscaledZ,_,o.z,f,o.y-1).key]={backfilled:!1},S[new s.OverscaledTileID(d.overscaledZ,d.wrap,o.z,o.x,o.y-1).key]={backfilled:!1},S[new s.OverscaledTileID(d.overscaledZ,T,o.z,x,o.y-1).key]={backfilled:!1}),o.y+1{if(this._loaded=!0,this._pendingLoad=null,c)this.fire(new s.ErrorEvent(c));else{const _={dataType:"source",sourceDataType:this._metadataFired?"content":"metadata"};this._collectResourceTiming&&f&&f.resourceTiming&&f.resourceTiming[this.id]&&(_.resourceTiming=f.resourceTiming[this.id]),this.fire(new s.Event("data",_)),this._metadataFired=!0}this._coalesce&&(this._updateWorkerData(),this._coalesce=!1)})}loaded(){return this._loaded}loadTile(d,o){const c=d.actor?"reloadTile":"loadTile";d.actor=this.actor,d.request=this.actor.send(c,{type:this.type,uid:d.uid,tileID:d.tileID,tileZoom:d.tileZoom,zoom:d.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:s.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(f,_)=>(delete d.request,d.unloadVectorData(),d.aborted?o(null):f?o(f):(d.loadVectorData(_,this.map.painter,c==="reloadTile"),o(null))),void 0,c==="loadTile")}abortTile(d){d.request&&(d.request.cancel(),delete d.request),d.aborted=!0}unloadTile(d){d.unloadVectorData(),this.actor.send("removeTile",{uid:d.uid,type:this.type,source:this.id})}onRemove(){this._pendingLoad&&this._pendingLoad.cancel()}serialize(){return s.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}},video:class extends Rt{constructor(d,o,c,f){super(d,o,c,f),this.roundZoom=!0,this.type="video",this.options=o}load(){this._loaded=!1;const d=this.options;this.urls=[];for(const o of d.urls)this.urls.push(this.map._requestManager.transformRequest(o,s.ResourceType.Source).url);s.getVideo(this.urls,(o,c)=>{this._loaded=!0,o?this.fire(new s.ErrorEvent(o)):c&&(this.video=c,this.video.loop=!0,this.video.setAttribute("playsinline",""),this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(d){if(this.video){const o=this.video.seekable;do.end(0)?this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${this.id}`,null,`Playback for this video can be set only between the ${o.start(0)} and ${o.end(0)}-second mark.`))):this.video.currentTime=d}}getVideo(){return this.video}onAdd(d){this.map||(this.map=d,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const d=this.map.painter.context,o=d.gl;this.texture?this.video.paused||(this.texture.bind(o.LINEAR,o.CLAMP_TO_EDGE),o.texSubImage2D(o.TEXTURE_2D,0,0,0,o.RGBA,o.UNSIGNED_BYTE,this.video)):(this.texture=new s.Texture(d,this.video,o.RGBA),this.texture.bind(o.LINEAR,o.CLAMP_TO_EDGE),this.width=this.video.videoWidth,this.height=this.video.videoHeight),this._prepareData(d)}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},image:Rt,canvas:class extends Rt{constructor(d,o,c,f){super(d,o,c,f),o.coordinates?Array.isArray(o.coordinates)&&o.coordinates.length===4&&!o.coordinates.some(_=>!Array.isArray(_)||_.length!==2||_.some(x=>typeof x!="number"))||this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${d}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${d}`,null,'missing required property "coordinates"'))),o.animate&&typeof o.animate!="boolean"&&this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${d}`,null,'optional "animate" property must be a boolean value'))),o.canvas?typeof o.canvas=="string"||o.canvas instanceof s.window.HTMLCanvasElement||this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${d}`,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 s.ErrorEvent(new s.ValidationError(`sources.${d}`,null,'missing required property "canvas"'))),this.options=o,this.animate=o.animate===void 0||o.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof s.window.HTMLCanvasElement?this.options.canvas:s.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new s.ErrorEvent(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(d){this.map=d,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let d=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,d=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,d=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const o=this.map.painter.context;this.texture?(d||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new s.Texture(o,this.canvas,o.gl.RGBA,{premultiply:!0}),this._prepareData(o)}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const d of[this.canvas.width,this.canvas.height])if(isNaN(d)||d<=0)return!0;return!1}},custom:class extends s.Evented{constructor(d,o,c,f){super(),this.id=d,this.type="custom",this._dataType="raster",this._dispatcher=c,this._implementation=o,this.setEventedParent(f),this.scheme="xyz",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this._loaded=!1,this.roundZoom=!0,this._implementation||this.fire(new s.ErrorEvent(new Error(`Missing implementation for ${this.id} custom source`))),this._implementation.loadTile||this.fire(new s.ErrorEvent(new Error(`Missing loadTile implementation for ${this.id} custom source`))),this._implementation.bounds&&(this.tileBounds=new br(this._implementation.bounds,this.minzoom,this.maxzoom)),o.update=this._update.bind(this),o.clearTiles=this._clearTiles.bind(this),o.coveringTiles=this._coveringTiles.bind(this),s.extend(this,s.pick(o,["dataType","scheme","minzoom","maxzoom","tileSize","attribution","minTileCacheSize","maxTileCacheSize"]))}serialize(){return s.pick(this,["type","scheme","minzoom","maxzoom","tileSize","attribution"])}load(){this._loaded=!0,this.fire(new s.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"}))}loaded(){return this._loaded}onAdd(d){this._map=d,this._loaded=!1,this.fire(new s.Event("dataloading",{dataType:"source"})),this._implementation.onAdd&&this._implementation.onAdd(d),this.load()}onRemove(d){this._implementation.onRemove&&this._implementation.onRemove(d)}hasTile(d){if(this._implementation.hasTile){const{x:o,y:c,z:f}=d.canonical;return this._implementation.hasTile({x:o,y:c,z:f})}return!this.tileBounds||this.tileBounds.contains(d.canonical)}loadTile(d,o){const{x:c,y:f,z:_}=d.tileID.canonical,x=new s.window.AbortController;d.request=Promise.resolve(this._implementation.loadTile({x:c,y:f,z:_},{signal:x.signal})).then((function(T){return delete d.request,d.aborted?(d.state="unloaded",o(null)):T===void 0?(d.state="errored",o(null)):T===null?(this.loadTileData(d,{width:this.tileSize,height:this.tileSize,data:null}),d.state="loaded",o(null)):function(S){return S instanceof s.window.ImageData||S instanceof s.window.HTMLCanvasElement||S instanceof s.window.ImageBitmap||S instanceof s.window.HTMLImageElement}(T)?(this.loadTileData(d,T),d.state="loaded",void o(null)):(d.state="errored",o(new Error(`Can't infer data type for ${this.id}, only raster data supported at the moment`)))}).bind(this)).catch(T=>{T.code!==20&&(d.state="errored",o(T))}),d.request.cancel=()=>x.abort()}loadTileData(d,o){Qe.loadTileData(d,o,this._map.painter)}unloadTileData(d){Qe.unloadTileData(d,this._map.painter)}unloadTile(d,o){if(this.unloadTileData(d),this._implementation.unloadTile){const{x:c,y:f,z:_}=d.tileID.canonical;this._implementation.unloadTile({x:c,y:f,z:_})}o()}abortTile(d,o){d.request&&d.request.cancel&&(d.request.cancel(),delete d.request),o()}hasTransition(){return!1}_coveringTiles(){return this._map.transform.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,roundZoom:this.roundZoom}).map(d=>({x:d.canonical.x,y:d.canonical.y,z:d.canonical.z}))}_clearTiles(){this._map.style._clearSource(this.id)}_update(){this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"}))}}},Dt=function(d,o,c,f){const _=new Pt[o.type](d,o,c,f);if(_.id!==d)throw new Error(`Expected Source id to be ${d} instead of ${_.id}`);return s.bindAll(["load","abort","unload","serialize","prepare"],_),_};function Gt(d,o){const c=s.identity([]);return s.scale(c,c,[.5*d.width,.5*-d.height,1]),s.translate(c,c,[1,-1,0]),s.multiply(c,c,d.calculateProjMatrix(o.toUnwrapped())),Float32Array.from(c)}function In(d,o,c,f,_,x,T,S=!1){const C=d.tilesIn(f,T,S);C.sort(Ir);const z=[];for(const O of C)z.push({wrappedTileID:O.tile.tileID.wrapped().key,queryResults:O.tile.queryRenderedFeatures(o,c,d._state,O,_,x,Gt(d.transform,O.tile.tileID),S)});const P=function(O){const j={},W={};for(const H of O){const Z=H.queryResults,X=H.wrappedTileID,B=W[X]=W[X]||{};for(const q in Z){const Q=Z[q],ee=B[q]=B[q]||{},de=j[q]=j[q]||[];for(const fe of Q)ee[fe.featureIndex]||(ee[fe.featureIndex]=!0,de.push(fe))}}return j}(z);for(const O in P)P[O].forEach(j=>{const W=j.feature,H=W.layer;H&&H.type!=="background"&&H.type!=="sky"&&(W.source=H.source,H["source-layer"]&&(W.sourceLayer=H["source-layer"]),W.state=W.id!==void 0?d.getFeatureState(H["source-layer"],W.id):{})});return P}function Vn(d,o){const c=d.getRenderableIds().map(x=>d.getTileByID(x)),f=[],_={};for(let x=0;x{c.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[Ji]}numActive(){return Object.keys(this.active).length}}let Or;function ha(){return Or||(Or=new hr),Or}function G_(d,o){const c={};for(const f in d)f!=="ref"&&(c[f]=d[f]);return s.refProperties.forEach(f=>{f in o&&(c[f]=o[f])}),c}function lf(d){d=d.slice();const o=Object.create(null);for(let c=0;c0?(_-T)/S:0;return this.points[x].mult(1-C).add(this.points[c].mult(C))}}class Is{constructor(o,c,f){const _=this.boxCells=[],x=this.circleCells=[];this.xCellCount=Math.ceil(o/f),this.yCellCount=Math.ceil(c/f);for(let T=0;Tthis.width||_<0||c>this.height)return!x&&[];const S=[];if(o<=0&&c<=0&&this.width<=f&&this.height<=_){if(x)return!0;for(let C=0;C0:S}_queryCircle(o,c,f,_,x){const T=o-f,S=o+f,C=c-f,z=c+f;if(S<0||T>this.width||z<0||C>this.height)return!_&&[];const P=[];return this._forEachCell(T,C,S,z,this._queryCellCircle,P,{hitTest:_,circle:{x:o,y:c,radius:f},seenUids:{box:{},circle:{}}},x),_?P.length>0:P}query(o,c,f,_,x){return this._query(o,c,f,_,!1,x)}hitTest(o,c,f,_,x){return this._query(o,c,f,_,!0,x)}hitTestCircle(o,c,f,_){return this._queryCircle(o,c,f,!0,_)}_queryCell(o,c,f,_,x,T,S,C){const z=S.seenUids,P=this.boxCells[x];if(P!==null){const j=this.bboxes;for(const W of P)if(!z.box[W]){z.box[W]=!0;const H=4*W;if(o<=j[H+2]&&c<=j[H+3]&&f>=j[H+0]&&_>=j[H+1]&&(!C||C(this.boxKeys[W]))){if(S.hitTest)return T.push(!0),!0;T.push({key:this.boxKeys[W],x1:j[H],y1:j[H+1],x2:j[H+2],y2:j[H+3]})}}}const O=this.circleCells[x];if(O!==null){const j=this.circles;for(const W of O)if(!z.circle[W]){z.circle[W]=!0;const H=3*W;if(this._circleAndRectCollide(j[H],j[H+1],j[H+2],o,c,f,_)&&(!C||C(this.circleKeys[W]))){if(S.hitTest)return T.push(!0),!0;{const Z=j[H],X=j[H+1],B=j[H+2];T.push({key:this.circleKeys[W],x1:Z-B,y1:X-B,x2:Z+B,y2:X+B})}}}}}_queryCellCircle(o,c,f,_,x,T,S,C){const z=S.circle,P=S.seenUids,O=this.boxCells[x];if(O!==null){const W=this.bboxes;for(const H of O)if(!P.box[H]){P.box[H]=!0;const Z=4*H;if(this._circleAndRectCollide(z.x,z.y,z.radius,W[Z+0],W[Z+1],W[Z+2],W[Z+3])&&(!C||C(this.boxKeys[H])))return T.push(!0),!0}}const j=this.circleCells[x];if(j!==null){const W=this.circles;for(const H of j)if(!P.circle[H]){P.circle[H]=!0;const Z=3*H;if(this._circlesCollide(W[Z],W[Z+1],W[Z+2],z.x,z.y,z.radius)&&(!C||C(this.circleKeys[H])))return T.push(!0),!0}}}_forEachCell(o,c,f,_,x,T,S,C){const z=this._convertToXCellCoord(o),P=this._convertToYCellCoord(c),O=this._convertToXCellCoord(f),j=this._convertToYCellCoord(_);for(let W=z;W<=O;W++)for(let H=P;H<=j;H++)if(x.call(this,o,c,f,_,this.xCellCount*H+W,T,S,C))return}_convertToXCellCoord(o){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(o*this.xScale)))}_convertToYCellCoord(o){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(o*this.yScale)))}_circlesCollide(o,c,f,_,x,T){const S=_-o,C=x-c,z=f+T;return z*z>S*S+C*C}_circleAndRectCollide(o,c,f,_,x,T,S){const C=(T-_)/2,z=Math.abs(o-(_+C));if(z>C+f)return!1;const P=(S-x)/2,O=Math.abs(c-(x+P));if(O>P+f)return!1;if(z<=C||O<=P)return!0;const j=z-C,W=O-P;return j*j+W*W<=f*f}}const wo={unknown:0,flipRequired:1,flipNotRequired:2},vl=Math.tan(85*Math.PI/180);function Re(d,o,c,f,_,x,T){const S=s.create();if(c)if(x.name==="globe"){const C=s.calculateGlobeLabelMatrix(_,o);s.multiply(S,S,C)}else{const C=Ve([],T);S[0]=C[0],S[1]=C[1],S[4]=C[2],S[5]=C[3],f||s.rotateZ(S,S,_.angle)}else s.multiply(S,_.labelPlaneMatrix,d);return S}function bo(d,o,c,f,_,x,T){const S=Re(d,o,c,f,_,x,T);return x.name==="globe"&&c||(S[2]=S[6]=S[10]=S[14]=0),S}function $n(d,o,c,f,_,x,T){if(c){if(x.name==="globe"){const S=Re(d,o,c,f,_,x,T);return s.invert(S,S),s.multiply(S,d,S),S}{const S=s.clone(d),C=s.identity([]);return C[0]=T[0],C[1]=T[1],C[4]=T[2],C[5]=T[3],s.multiply(S,S,C),f||s.rotateZ(S,S,-_.angle),S}}return _.glCoordMatrix}function dr(d,o,c,f){const _=[d,o,c,1];c?s.transformMat4$1(_,_,f):Nt(_,_,f);const x=_[3];return _[0]/=x,_[1]/=x,_[2]/=x,_}function cf(d,o){return Math.min(.5+d/o*.5,1.5)}function eo(d,o){const c=d[0]/d[3],f=d[1]/d[3];return c>=-o[0]&&c<=o[0]&&f>=-o[1]&&f<=o[1]}function Sh(d,o,c,f,_,x,T,S,C,z){const P=c.transform,O=f?d.textSizeData:d.iconSizeData,j=s.evaluateSizeForZoom(O,c.transform.zoom),W=P.projection.name==="globe",H=[256/c.width*2+1,256/c.height*2+1],Z=f?d.text.dynamicLayoutVertexArray:d.icon.dynamicLayoutVertexArray;Z.clear();let X=null;W&&(X=f?d.text.globeExtVertexArray:d.icon.globeExtVertexArray);const B=d.lineVertexArray,q=f?d.text.placedSymbolArray:d.icon.placedSymbolArray,Q=c.transform.width/c.transform.height;let ee,de=!1;for(let fe=0;feMath.abs(c)?{useVertical:!0}:d===s.WritingMode.vertical?f>0?{needsFlipping:!0}:null:o!==wo.unknown&&function(_,x){return _===0||Math.abs(x/_)>vl}(c,f)?o===wo.flipRequired?{needsFlipping:!0}:null:c<0?{needsFlipping:!0}:null}function lt(d,o,c,f,_,x,T,S,C,z,P,O,j,W,H,Z,X,B,q){const Q=o/24,ee=d.lineOffsetX*Q,de=d.lineOffsetY*Q,{lineStartIndex:fe,glyphStartIndex:pe,numGlyphs:xe,segment:ye,writingMode:Ae,flipState:We}=d,Ee=fe+d.lineLength,Fe=ke=>{if(P){const[Xe,$e,Ye]=ke.up,gt=z.length;s.updateGlobeVertexNormal(P,gt+0,Xe,$e,Ye),s.updateGlobeVertexNormal(P,gt+1,Xe,$e,Ye),s.updateGlobeVertexNormal(P,gt+2,Xe,$e,Ye),s.updateGlobeVertexNormal(P,gt+3,Xe,$e,Ye)}const[qe,Se,Be]=ke.point;s.addDynamicAttributes(z,qe,Se,Be,ke.angle)};if(xe>1){const ke=uf(Q,S,ee,de,c,O,j,d,C,x,W,Z,!1,X,B,q);if(!ke)return{notEnoughRoom:!0};if(f&&!c){let[qe,Se,Be]=ke.first.point,[Xe,$e,Ye]=ke.last.point;[qe,Se]=dr(qe,Se,Be,T),[Xe,$e]=dr(Xe,$e,Ye,T);const gt=da(Ae,We,(Xe-qe)*H,$e-Se);if(d.flipState=gt&>.needsFlipping?wo.flipRequired:wo.flipNotRequired,gt)return gt}Fe(ke.first);for(let qe=pe+1;qe0?Xe:Ft(j,Be,qe,1,_,void 0,X,B.canonical),Ye=da(Ae,We,($e[0]-qe[0])*H,$e[1]-qe[1]);if(d.flipState=Ye&&Ye.needsFlipping?wo.flipRequired:wo.flipNotRequired,Ye)return Ye}const ke=si(Q*S.getoffsetX(pe),ee,de,c,O,j,ye,fe,Ee,C,x,W,Z,!1,!1,X,B,q);if(!ke)return{notEnoughRoom:!0};Fe(ke)}return{}}function $t(d,o,c,f,_){const{x,y:T,z:S}=f.projectTilePoint(d.x,d.y,o);if(!_)return dr(x,T,S,c);const[C,z,P]=_(d);return dr(x+C,T+z,S+P,c)}function Ft(d,o,c,f,_,x,T,S){const C=$t(d.sub(o)._unit()._add(d),S,_,T,x);return s.sub(C,c,C),s.normalize(C,C),s.scaleAndAdd(C,c,C,f)}function si(d,o,c,f,_,x,T,S,C,z,P,O,j,W,H,Z,X,B){const q=f?d-o:d+o;let Q=q>0?1:-1,ee=0;f&&(Q*=-1,ee=Math.PI),Q<0&&(ee+=Math.PI);let de=S+T+(Q>0?0:1)|0,fe=_,pe=_,xe=0,ye=0;const Ae=Math.abs(q),We=[],Ee=[];let Fe=x,ke=Fe;const qe=()=>Ft(ke,Fe,pe,Ae-xe+1,P,j,Z,X.canonical);for(;xe+ye<=Ae;){if(de+=Q,de=C)return null;if(pe=fe,ke=Fe,We.push(pe),W&&Ee.push(ke),Fe=new s.Point(z.getx(de),z.gety(de)),fe=O[de],!fe){const wt=$t(Fe,X.canonical,P,Z,j);fe=wt[3]>0?O[de]=wt:qe()}xe+=ye,ye=s.distance(pe,fe)}H&&j&&(O[de]&&(fe=qe(),ye=s.distance(pe,fe)),O[de]=fe);const Se=(Ae-xe)/ye,Be=Fe.sub(ke)._mult(Se)._add(ke),Xe=s.sub([],fe,pe),$e=s.scaleAndAdd([],pe,Xe,Se);let Ye=[0,0,1],gt=Xe[0],Et=Xe[1];if(B&&(Ye=Z.upVector(X.canonical,Be.x,Be.y),Ye[0]!==0||Ye[1]!==0||Ye[2]!==1)){const wt=[Ye[2],0,-Ye[0]],Ut=s.cross([],Ye,wt);s.normalize(wt,wt),s.normalize(Ut,Ut),gt=s.dot(Xe,wt),Et=s.dot(Xe,Ut)}if(c){const wt=s.cross([],Ye,Xe);s.normalize(wt,wt),s.scaleAndAdd($e,$e,wt,c*Q)}const pt=ee+Math.atan2(Et,gt);return We.push($e),W&&Ee.push(Be),{point:$e,angle:pt,path:We,tilePath:Ee,up:Ye}}function Ri(d,o){const c=o.length,f=c+4*d;o.resize(f),o.float32.fill(-1/0,4*c,4*f)}function Nt(d,o,c){const f=o[0],_=o[1];return d[0]=c[0]*f+c[4]*_+c[12],d[1]=c[1]*f+c[5]*_+c[13],d[3]=c[3]*f+c[7]*_+c[15],d}const ai=100;class xl{constructor(o,c,f=new Is(o.width+200,o.height+200,25),_=new Is(o.width+200,o.height+200,25)){this.transform=o,this.grid=f,this.ignoredGrid=_,this.pitchfactor=Math.cos(o._pitch)*o.cameraToCenterDistance,this.screenRightBoundary=o.width+ai,this.screenBottomBoundary=o.height+ai,this.gridRightBoundary=o.width+200,this.gridBottomBoundary=o.height+200,this.fogState=c}placeCollisionBox(o,c,f,_,x,T,S,C){let z=f.projectedAnchorX,P=f.projectedAnchorY,O=f.projectedAnchorZ;const j=f.elevation,W=f.tileID,H=o.getProjection();if(j&&W){const[fe,pe,xe]=H.upVector(W.canonical,f.tileAnchorX,f.tileAnchorY),ye=H.upVectorScale(W.canonical,this.transform.center.lat,this.transform.worldSize).metersToTile;z+=fe*j*ye,P+=pe*j*ye,O+=xe*j*ye}const Z=this.projectAndGetPerspectiveRatio(S,z,P,O,f.tileID,H.name==="globe"||!!j||this.transform.pitch>0,H),X=T*Z.perspectiveRatio,B=(f.x1*c+_.x-f.padding)*X+Z.point.x,q=(f.y1*c+_.y-f.padding)*X+Z.point.y,Q=(f.x2*c+_.x+f.padding)*X+Z.point.x,ee=(f.y2*c+_.y+f.padding)*X+Z.point.y,de=Z.perspectiveRatio<=.55||Z.occluded;return!this.isInsideGrid(B,q,Q,ee)||!x&&this.grid.hitTest(B,q,Q,ee,C)||de?{box:[],offscreen:!1,occluded:Z.occluded}:{box:[B,q,Q,ee],offscreen:this.isOffscreen(B,q,Q,ee),occluded:!1}}placeCollisionCircles(o,c,f,_,x,T,S,C,z,P,O,j,W,H,Z){const X=[],B=this.transform.elevation,q=o.getProjection(),Q=B?B.getAtTileOffsetFunc(Z,this.transform.center.lat,this.transform.worldSize,q):null,ee=new s.Point(f.tileAnchorX,f.tileAnchorY);let{x:de,y:fe,z:pe}=q.projectTilePoint(ee.x,ee.y,Z.canonical);if(Q){const[Be,Xe,$e]=Q(ee);de+=Be,fe+=Xe,pe+=$e}const xe=q.name==="globe",ye=this.projectAndGetPerspectiveRatio(S,de,fe,pe,Z,xe||!!B||this.transform.pitch>0,q),{perspectiveRatio:Ae}=ye,We=(O?T/Ae:T*Ae)/s.ONE_EM,Ee=dr(de,fe,pe,C),Fe=ye.signedDistanceFromCamera>0?uf(We,x,f.lineOffsetX*We,f.lineOffsetY*We,!1,Ee,ee,f,_,C,{},B&&!O?Q:null,O&&!!B,q,Z,O):null;let ke=!1,qe=!1,Se=!0;if(Fe&&!ye.occluded){const Be=.5*W*Ae+H,Xe=new s.Point(-100,-100),$e=new s.Point(this.screenRightBoundary,this.screenBottomBoundary),Ye=new Th,{first:gt,last:Et}=Fe,pt=gt.path.length;let wt=[];for(let mt=pt-1;mt>=1;mt--)wt.push(gt.path[mt]);for(let mt=1;mt(Q&&!xe&&(rn=Q(onmt[3]<=0)&&(wt=[]));let Ot=[];if(wt.length>0){let mt=1/0,en=-1/0,rn=1/0,on=-1/0;for(const sn of wt)mt=Math.min(mt,sn[0]),rn=Math.min(rn,sn[1]),en=Math.max(en,sn[0]),on=Math.max(on,sn[1]);en>=Xe.x&&mt<=$e.x&&on>=Xe.y&&rn<=$e.y&&(Ot=[wt.map(sn=>new s.Point(sn[0],sn[1]))],(mt$e.x||rn$e.y)&&(Ot=s.clipLine(Ot,Xe.x,Xe.y,$e.x,$e.y)))}for(const mt of Ot){Ye.reset(mt,.25*Be);let en=0;en=Ye.length<=.5*Be?1:Math.ceil(Ye.paddedLength/Ut)+1;for(let rn=0;rn0?(s.transformMat4$1(C,C,o),this.fogState&&x&&S.name!=="globe"&&(z=function(j,W,H,Z,X,B){const q=B.calculateFogTileMatrix(X),Q=[W,H,Z];return s.transformMat4(Q,Q,q),Li(j,Q,B.pitch,B._fov)}(this.fogState,c,f,_,x.toUnwrapped(),this.transform)>.9)):Nt(C,C,o);const P=C[3];return{point:new s.Point((C[0]/P+1)/2*this.transform.width+ai,(-C[1]/P+1)/2*this.transform.height+ai),perspectiveRatio:Math.min(.5+this.transform.getCameraToCenterDistance(S)/P*.5,1.5),signedDistanceFromCamera:P,occluded:T&&C[2]>P||z}}isOffscreen(o,c,f,_){return f=this.screenRightBoundary||_this.screenBottomBoundary}isInsideGrid(o,c,f,_){return f>=0&&o=0&&cf.collisionGroupID===c}}return this.collisionGroups[o]}}function El(d,o,c,f,_){const{horizontalAlign:x,verticalAlign:T}=s.getAnchorAlignment(d),S=-(x-.5)*o,C=-(T-.5)*c,z=s.evaluateVariableOffset(d,f);return new s.Point(S+z[0]*_,C+z[1]*_)}function Tl(d,o,c,f,_){const x=new s.Point(d,o);return c&&x._rotate(f?_:-_),x}class kc{constructor(o,c,f,_,x){this.transform=o.clone(),this.projection=o.projection.name,this.collisionIndex=new xl(this.transform,x),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=c,this.retainedQueryData={},this.collisionGroups=new df(f),this.collisionCircleArrays={},this.prevPlacement=_,_&&(_.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(o,c,f,_){const x=f.getBucket(c),T=f.latestFeatureIndex;if(!x||!T||c.id!==x.layerIds[0])return;const S=x.layers[0].layout,C=f.collisionBoxArray,z=Math.pow(2,this.transform.zoom-f.tileID.overscaledZ),P=f.tileSize/s.EXTENT,O=f.tileID.toUnwrapped();this.transform.setProjection(x.projection);const j=(W=f.tileID,H=x.getProjection(),Z=this.transform,H.name===this.projection?Z.calculateProjMatrix(W.toUnwrapped()):ks(Z,H,W));var W,H,Z;const X=S.get("text-pitch-alignment")==="map",B=S.get("text-rotation-alignment")==="map";c.compileFilter();const q=c.dynamicFilter(),Q=c.dynamicFilterNeedsFeature(),ee=this.transform.calculatePixelsToTileUnitsMatrix(f),de=bo(j,f.tileID.canonical,X,B,this.transform,x.getProjection(),ee);let fe=null;if(X){const ye=$n(j,f.tileID.canonical,X,B,this.transform,x.getProjection(),ee);fe=s.multiply([],this.transform.labelPlaneMatrix,ye)}let pe=null;q&&f.latestFeatureIndex&&(pe={unwrappedTileID:O,dynamicFilter:q,dynamicFilterNeedsFeature:Q,featureIndex:f.latestFeatureIndex}),this.retainedQueryData[x.bucketInstanceId]=new Ah(x.bucketInstanceId,T,x.sourceLayerIndex,x.index,f.tileID);const xe={bucket:x,layout:S,posMatrix:j,textLabelPlaneMatrix:de,labelToScreenMatrix:fe,clippingData:pe,scale:z,textPixelRatio:P,holdingForFade:f.holdingForFade(),collisionBoxArray:C,partiallyEvaluatedTextSize:s.evaluateSizeForZoom(x.textSizeData,this.transform.zoom),partiallyEvaluatedIconSize:s.evaluateSizeForZoom(x.iconSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(x.sourceID)};if(_)for(const ye of x.sortKeyRanges){const{sortKey:Ae,symbolInstanceStart:We,symbolInstanceEnd:Ee}=ye;o.push({sortKey:Ae,symbolInstanceStart:We,symbolInstanceEnd:Ee,parameters:xe})}else o.push({symbolInstanceStart:0,symbolInstanceEnd:x.symbolInstances.length,parameters:xe})}attemptAnchorPlacement(o,c,f,_,x,T,S,C,z,P,O,j,W,H,Z,X,B,q){const{textOffset0:Q,textOffset1:ee,crossTileID:de}=j,fe=[Q,ee],pe=El(o,f,_,fe,x),xe=this.collisionIndex.placeCollisionBox(H,x,c,Tl(pe.x,pe.y,T,S,this.transform.angle),O,C,z,P.predicate);if(X){const ye=H.getSymbolInstanceIconSize(q,this.transform.zoom,j.placedIconSymbolIndex);if(this.collisionIndex.placeCollisionBox(H,ye,X,Tl(pe.x,pe.y,T,S,this.transform.angle),O,C,z,P.predicate).box.length===0)return}if(xe.box.length>0){let ye;return this.prevPlacement&&this.prevPlacement.variableOffsets[de]&&this.prevPlacement.placements[de]&&this.prevPlacement.placements[de].text&&(ye=this.prevPlacement.variableOffsets[de].anchor),this.variableOffsets[de]={textOffset:fe,width:f,height:_,anchor:o,textScale:x,prevAnchor:ye},this.markUsedJustification(H,o,j,Z),H.allowVerticalPlacement&&(this.markUsedOrientation(H,Z,j),this.placedOrientations[de]=Z),{shift:pe,placedGlyphBoxes:xe}}}placeLayerBucketPart(o,c,f,_){const{bucket:x,layout:T,posMatrix:S,textLabelPlaneMatrix:C,labelToScreenMatrix:z,clippingData:P,textPixelRatio:O,holdingForFade:j,collisionBoxArray:W,partiallyEvaluatedTextSize:H,partiallyEvaluatedIconSize:Z,collisionGroup:X}=o.parameters,B=T.get("text-optional"),q=T.get("icon-optional"),Q=T.get("text-allow-overlap"),ee=T.get("icon-allow-overlap"),de=T.get("text-rotation-alignment")==="map",fe=T.get("text-pitch-alignment")==="map",pe=T.get("icon-text-fit")!=="none",xe=T.get("symbol-z-order")==="viewport-y";this.transform.setProjection(x.projection);let ye=Q&&(ee||!x.hasIconData()||q),Ae=ee&&(Q||!x.hasTextData()||B);!x.collisionArrays&&W&&x.deserializeCollisionBoxes(W),f&&_&&x.updateCollisionDebugBuffers(this.transform.zoom,W);const We=(Ee,Fe,ke)=>{const{crossTileID:qe,numVerticalGlyphVertices:Se}=Ee;if(P){const An={zoom:this.transform.zoom,pitch:this.transform.pitch};let an=null;if(P.dynamicFilterNeedsFeature){const Xt=this.retainedQueryData[x.bucketInstanceId];an=P.featureIndex.loadFeature({featureIndex:Ee.featureIndex,bucketIndex:Xt.bucketIndex,sourceLayerIndex:Xt.sourceLayerIndex,layoutVertexArrayOffset:0})}if(!(0,P.dynamicFilter)(An,an,this.retainedQueryData[x.bucketInstanceId].tileID.canonical,new s.Point(Ee.tileAnchorX,Ee.tileAnchorY),this.transform.calculateDistanceTileData(P.unwrappedTileID)))return this.placements[qe]=new wl(!1,!1,!1,!0),void c.add(qe)}if(c.has(qe))return;if(j)return void(this.placements[qe]=new wl(!1,!1,!1));let Be=!1,Xe=!1,$e=!0,Ye=!1,gt=!1,Et=null,pt={box:null,offscreen:null,occluded:null},wt={box:null,offscreen:null,occluded:null},Ut=null,Ot=null,mt=null,en=0,rn=0,on=0;ke.textFeatureIndex?en=ke.textFeatureIndex:Ee.useRuntimeCollisionCircles&&(en=Ee.featureIndex),ke.verticalTextFeatureIndex&&(rn=ke.verticalTextFeatureIndex);const sn=An=>{An.tileID=this.retainedQueryData[x.bucketInstanceId].tileID;const an=this.transform.elevation;(an||An.elevation)&&(An.elevation=an?an.getAtTileOffset(An.tileID,An.tileAnchorX,An.tileAnchorY):0)},Mr=ke.textBox;if(Mr){sn(Mr);const An=Xt=>{let Gn=s.WritingMode.horizontal;if(x.allowVerticalPlacement&&!Xt&&this.prevPlacement){const Br=this.prevPlacement.placedOrientations[qe];Br&&(this.placedOrientations[qe]=Br,Gn=Br,this.markUsedOrientation(x,Gn,Ee))}return Gn},an=(Xt,Gn)=>{if(x.allowVerticalPlacement&&Se>0&&ke.verticalTextBox){for(const Br of x.writingModes)if(Br===s.WritingMode.vertical?(pt=Gn(),wt=pt):pt=Xt(),pt&&pt.box&&pt.box.length)break}else pt=Xt()};if(T.get("text-variable-anchor")){let Xt=T.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[qe]){const En=this.prevPlacement.variableOffsets[qe];Xt.indexOf(En.anchor)>0&&(Xt=Xt.filter(Wr=>Wr!==En.anchor),Xt.unshift(En.anchor))}const Gn=(En,Wr,nu)=>{const Bs=x.getSymbolInstanceTextSize(H,Ee,this.transform.zoom,Fe),Gl=(En.x2-En.x1)*Bs+2*En.padding,Mo=(En.y2-En.y1)*Bs+2*En.padding,is=pe&&!ee?Wr:null;is&&sn(is);let Fs={box:[],offscreen:!1,occluded:!1};const ru=Q?2*Xt.length:Xt.length;for(let ql=0;ql=Xt.length,Ee,Fe,x,nu,is,H,Z);if(gd&&(Fs=gd.placedGlyphBoxes,Fs&&Fs.box&&Fs.box.length)){Be=!0,Et=gd.shift;break}}return Fs};an(()=>Gn(Mr,ke.iconBox,s.WritingMode.horizontal),()=>{const En=ke.verticalTextBox;return En&&sn(En),x.allowVerticalPlacement&&!(pt&&pt.box&&pt.box.length)&&Se>0&&En?Gn(En,ke.verticalIconBox,s.WritingMode.vertical):{box:null,offscreen:null,occluded:null}}),pt&&(Be=pt.box,$e=pt.offscreen,Ye=pt.occluded);const Br=An(!(!pt||!pt.box));if(!Be&&this.prevPlacement){const En=this.prevPlacement.variableOffsets[qe];En&&(this.variableOffsets[qe]=En,this.markUsedJustification(x,En.anchor,Ee,Br))}}else{const Xt=(Gn,Br)=>{const En=x.getSymbolInstanceTextSize(H,Ee,this.transform.zoom,Fe),Wr=this.collisionIndex.placeCollisionBox(x,En,Gn,new s.Point(0,0),Q,O,S,X.predicate);return Wr&&Wr.box&&Wr.box.length&&(this.markUsedOrientation(x,Br,Ee),this.placedOrientations[qe]=Br),Wr};an(()=>Xt(Mr,s.WritingMode.horizontal),()=>{const Gn=ke.verticalTextBox;return x.allowVerticalPlacement&&Se>0&&Gn?(sn(Gn),Xt(Gn,s.WritingMode.vertical)):{box:null,offscreen:null,occluded:null}}),An(!!(pt&&pt.box&&pt.box.length))}}if(Ut=pt,Be=Ut&&Ut.box&&Ut.box.length>0,$e=Ut&&Ut.offscreen,Ye=Ut&&Ut.occluded,Ee.useRuntimeCollisionCircles){const An=x.text.placedSymbolArray.get(Ee.centerJustifiedTextSymbolIndex>=0?Ee.centerJustifiedTextSymbolIndex:Ee.verticalPlacedTextSymbolIndex),an=s.evaluateSizeForFeature(x.textSizeData,H,An),Xt=T.get("text-padding");Ot=this.collisionIndex.placeCollisionCircles(x,Q,An,x.lineVertexArray,x.glyphOffsetArray,an,S,C,z,f,fe,X.predicate,Ee.collisionCircleDiameter*an/s.ONE_EM,Xt,this.retainedQueryData[x.bucketInstanceId].tileID),Be=Q||Ot.circles.length>0&&!Ot.collisionDetected,$e=$e&&Ot.offscreen,Ye=Ot.occluded}if(ke.iconFeatureIndex&&(on=ke.iconFeatureIndex),ke.iconBox){const An=an=>{sn(an);const Xt=pe&&Et?Tl(Et.x,Et.y,de,fe,this.transform.angle):new s.Point(0,0),Gn=x.getSymbolInstanceIconSize(Z,this.transform.zoom,Ee.placedIconSymbolIndex);return this.collisionIndex.placeCollisionBox(x,Gn,an,Xt,ee,O,S,X.predicate)};wt&&wt.box&&wt.box.length&&ke.verticalIconBox?(mt=An(ke.verticalIconBox),Xe=mt.box.length>0):(mt=An(ke.iconBox),Xe=mt.box.length>0),$e=$e&&mt.offscreen,gt=mt.occluded}const fr=B||Ee.numHorizontalGlyphVertices===0&&Se===0,vi=q||Ee.numIconVertices===0;if(fr||vi?vi?fr||(Xe=Xe&&Be):Be=Xe&&Be:Xe=Be=Xe&&Be,Be&&Ut&&Ut.box&&this.collisionIndex.insertCollisionBox(Ut.box,T.get("text-ignore-placement"),x.bucketInstanceId,wt&&wt.box&&rn?rn:en,X.ID),Xe&&mt&&this.collisionIndex.insertCollisionBox(mt.box,T.get("icon-ignore-placement"),x.bucketInstanceId,on,X.ID),Ot&&(Be&&this.collisionIndex.insertCollisionCircles(Ot.circles,T.get("text-ignore-placement"),x.bucketInstanceId,en,X.ID),f)){const An=x.bucketInstanceId;let an=this.collisionCircleArrays[An];an===void 0&&(an=this.collisionCircleArrays[An]=new bl);for(let Xt=0;Xt=0;--Fe){const ke=Ee[Fe];We(x.symbolInstances.get(ke),ke,x.collisionArrays[ke])}}else for(let Ee=o.symbolInstanceStart;Ee=0&&(o.text.placedSymbolArray.get(x).crossTileID=O>=0&&x!==O?0:z),T>=0&&(o.text.placedSymbolArray.get(T).crossTileID=O>=0&&T!==O?0:z),S>=0&&(o.text.placedSymbolArray.get(S).crossTileID=O>=0&&S!==O?0:z),C>=0&&(o.text.placedSymbolArray.get(C).crossTileID=O>=0&&C!==O?0:z)}markUsedOrientation(o,c,f){const _=c===s.WritingMode.horizontal||c===s.WritingMode.horizontalOnly?c:0,x=c===s.WritingMode.vertical?c:0,{leftJustifiedTextSymbolIndex:T,centerJustifiedTextSymbolIndex:S,rightJustifiedTextSymbolIndex:C,verticalPlacedTextSymbolIndex:z}=f,P=o.text.placedSymbolArray;T>=0&&(P.get(T).placedOrientation=_),S>=0&&(P.get(S).placedOrientation=_),C>=0&&(P.get(C).placedOrientation=_),z>=0&&(P.get(z).placedOrientation=x)}commit(o){this.commitTime=o,this.zoomAtLastRecencyCheck=this.transform.zoom;const c=this.prevPlacement;let f=!1;this.prevZoomAdjustment=c?c.zoomAdjustment(this.transform.zoom):0;const _=c?c.symbolFadeChange(o):1,x=c?c.opacities:{},T=c?c.variableOffsets:{},S=c?c.placedOrientations:{};for(const C in this.placements){const z=this.placements[C],P=x[C];P?(this.opacities[C]=new Eo(P,_,z.text,z.icon,null,z.clipped),f=f||z.text!==P.text.placed||z.icon!==P.icon.placed):(this.opacities[C]=new Eo(null,_,z.text,z.icon,z.skipFade,z.clipped),f=f||z.text||z.icon)}for(const C in x){const z=x[C];if(!this.opacities[C]){const P=new Eo(z,_,!1,!1);P.isHidden()||(this.opacities[C]=P,f=f||z.text.placed||z.icon.placed)}}for(const C in T)this.variableOffsets[C]||!this.opacities[C]||this.opacities[C].isHidden()||(this.variableOffsets[C]=T[C]);for(const C in S)this.placedOrientations[C]||!this.opacities[C]||this.opacities[C].isHidden()||(this.placedOrientations[C]=S[C]);f?this.lastPlacementChangeTime=o:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=c?c.lastPlacementChangeTime:o)}updateLayerOpacities(o,c){const f=new Set;for(const _ of c){const x=_.getBucket(o);x&&_.latestFeatureIndex&&o.id===x.layerIds[0]&&this.updateBucketOpacities(x,f,_.collisionBoxArray)}}updateBucketOpacities(o,c,f){o.hasTextData()&&o.text.opacityVertexArray.clear(),o.hasIconData()&&o.icon.opacityVertexArray.clear(),o.hasIconCollisionBoxData()&&o.iconCollisionBox.collisionVertexArray.clear(),o.hasTextCollisionBoxData()&&o.textCollisionBox.collisionVertexArray.clear();const _=o.layers[0].layout,x=!!o.layers[0].dynamicFilter(),T=new Eo(null,0,!1,!1,!0),S=_.get("text-allow-overlap"),C=_.get("icon-allow-overlap"),z=_.get("text-variable-anchor"),P=_.get("text-rotation-alignment")==="map",O=_.get("text-pitch-alignment")==="map",j=_.get("icon-text-fit")!=="none",W=new Eo(null,0,S&&(C||!o.hasIconData()||_.get("icon-optional")),C&&(S||!o.hasTextData()||_.get("text-optional")),!0);!o.collisionArrays&&f&&(o.hasIconCollisionBoxData()||o.hasTextCollisionBoxData())&&o.deserializeCollisionBoxes(f);const H=(X,B,q)=>{for(let Q=0;Q0||Q>0,ye=de>0,Ae=this.placedOrientations[ee],We=Ae===s.WritingMode.vertical,Ee=Ae===s.WritingMode.horizontal||Ae===s.WritingMode.horizontalOnly;if(!xe&&!ye||pe.isHidden()||Z++,xe){const Fe=Sl(pe.text);H(o.text,q,We?Ln:Fe),H(o.text,Q,Ee?Ln:Fe);const ke=pe.text.isHidden(),{leftJustifiedTextSymbolIndex:qe,centerJustifiedTextSymbolIndex:Se,rightJustifiedTextSymbolIndex:Be,verticalPlacedTextSymbolIndex:Xe}=B,$e=o.text.placedSymbolArray,Ye=ke||We?1:0;qe>=0&&($e.get(qe).hidden=Ye),Se>=0&&($e.get(Se).hidden=Ye),Be>=0&&($e.get(Be).hidden=Ye),Xe>=0&&($e.get(Xe).hidden=ke||Ee?1:0);const gt=this.variableOffsets[ee];gt&&this.markUsedJustification(o,gt.anchor,B,Ae);const Et=this.placedOrientations[ee];Et&&(this.markUsedJustification(o,"left",B,Et),this.markUsedOrientation(o,Et,B))}if(ye){const Fe=Sl(pe.icon),{placedIconSymbolIndex:ke,verticalPlacedIconSymbolIndex:qe}=B,Se=o.icon.placedSymbolArray,Be=pe.icon.isHidden()?1:0;ke>=0&&(H(o.icon,de,We?Ln:Fe),Se.get(ke).hidden=Be),qe>=0&&(H(o.icon,B.numVerticalIconVertices,Ee?Ln:Fe),Se.get(qe).hidden=Be)}if(o.hasIconCollisionBoxData()||o.hasTextCollisionBoxData()){const Fe=o.collisionArrays[X];if(Fe){let ke=new s.Point(0,0),qe=!0;if(Fe.textBox||Fe.verticalTextBox){if(z){const Be=this.variableOffsets[ee];Be?(ke=El(Be.anchor,Be.width,Be.height,Be.textOffset,Be.textScale),P&&ke._rotate(O?this.transform.angle:-this.transform.angle)):qe=!1}x&&(qe=!pe.clipped),Fe.textBox&&pa(o.textCollisionBox.collisionVertexArray,pe.text.placed,!qe||We,ke.x,ke.y),Fe.verticalTextBox&&pa(o.textCollisionBox.collisionVertexArray,pe.text.placed,!qe||Ee,ke.x,ke.y)}const Se=qe&&!!(!Ee&&Fe.verticalIconBox);Fe.iconBox&&pa(o.iconCollisionBox.collisionVertexArray,pe.icon.placed,Se,j?ke.x:0,j?ke.y:0),Fe.verticalIconBox&&pa(o.iconCollisionBox.collisionVertexArray,pe.icon.placed,!Se,j?ke.x:0,j?ke.y:0)}}}if(o.fullyClipped=Z===0,o.sortFeatures(this.transform.angle),this.retainedQueryData[o.bucketInstanceId]&&(this.retainedQueryData[o.bucketInstanceId].featureSortOrder=o.featureSortOrder),o.hasTextData()&&o.text.opacityVertexBuffer&&o.text.opacityVertexBuffer.updateData(o.text.opacityVertexArray),o.hasIconData()&&o.icon.opacityVertexBuffer&&o.icon.opacityVertexBuffer.updateData(o.icon.opacityVertexArray),o.hasIconCollisionBoxData()&&o.iconCollisionBox.collisionVertexBuffer&&o.iconCollisionBox.collisionVertexBuffer.updateData(o.iconCollisionBox.collisionVertexArray),o.hasTextCollisionBoxData()&&o.textCollisionBox.collisionVertexBuffer&&o.textCollisionBox.collisionVertexBuffer.updateData(o.textCollisionBox.collisionVertexArray),o.bucketInstanceId in this.collisionCircleArrays){const X=this.collisionCircleArrays[o.bucketInstanceId];o.placementInvProjMatrix=X.invProjMatrix,o.placementViewportMatrix=X.viewportMatrix,o.collisionCircleArray=X.circles,delete this.collisionCircleArrays[o.bucketInstanceId]}}symbolFadeChange(o){return this.fadeDuration===0?1:(o-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(o){return Math.max(0,(this.transform.zoom-o)/1.5)}hasTransitions(o){return this.stale||o-this.lastPlacementChangeTimeo}setStale(){this.stale=!0}}function pa(d,o,c,f,_){d.emplaceBack(o?1:0,c?1:0,f||0,_||0),d.emplaceBack(o?1:0,c?1:0,f||0,_||0),d.emplaceBack(o?1:0,c?1:0,f||0,_||0),d.emplaceBack(o?1:0,c?1:0,f||0,_||0)}const Gr=Math.pow(2,25),Fn=Math.pow(2,24),Ch=Math.pow(2,17),Ih=Math.pow(2,16),qr=Math.pow(2,9),gi=Math.pow(2,8),pf=Math.pow(2,1);function Sl(d){if(d.opacity===0&&!d.placed)return 0;if(d.opacity===1&&d.placed)return 4294967295;const o=d.placed?1:0,c=Math.floor(127*d.opacity);return c*Gr+o*Fn+c*Ch+o*Ih+c*qr+o*gi+c*pf+o}const Ln=0;class Al{constructor(o){this._sortAcrossTiles=o.layout.get("symbol-z-order")!=="viewport-y"&&o.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs=new Set,this._bucketParts=[]}continuePlacement(o,c,f,_,x){const T=this._bucketParts;for(;this._currentTileIndexS.sortKey-C.sortKey));this._currentPartIndex{const T=s.exported.now()-_;return!this._forceFullPlacement&&T>2};for(;this._currentPlacementIndex>=0;){const T=c[o[this._currentPlacementIndex]],S=this.placement.collisionIndex.transform.zoom;if(T.type==="symbol"&&(!T.minzoom||T.minzoom<=S)&&(!T.maxzoom||T.maxzoom>S)){if(this._inProgressLayer||(this._inProgressLayer=new Al(T)),this._inProgressLayer.continuePlacement(f[T.source],this.placement,this._showCollisionBoxes,T,x))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(o){return this.placement.commit(o),this.placement}}const Ms=512/s.EXTENT/2;class Er{constructor(o,c,f){this.tileID=o,this.bucketInstanceId=f,this.index=new s.KDBush(c.length,16,Int32Array),this.keys=[],this.crossTileIDs=[];const _=o.canonical.x*s.EXTENT,x=o.canonical.y*s.EXTENT;for(let T=0;To.overscaledZ)for(const S in T){const C=T[S];C.tileID.isChildOf(o)&&C.findMatches(c.symbolInstances,o,_)}else{const S=T[o.scaledTo(Number(x)).key];S&&S.findMatches(c.symbolInstances,o,_)}}for(let x=0;x{c[f]=!0});for(const f in this.layerIndexes)c[f]||delete this.layerIndexes[f]}}const ns=(d,o)=>s.emitValidationErrors(d,o&&o.filter(c=>c.identifier!=="source.canvas")),Mc=s.pick(Jt,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setTerrain","setFog","setProjection"]),q_=s.pick(Jt,["setCenter","setZoom","setBearing","setPitch"]),zh={version:8,layers:[],sources:{}},fa={fill:!0,line:!0,background:!0,hillshade:!0,raster:!0};class to extends s.Evented{constructor(o,c={}){super(),this.map=o,this.dispatcher=new xt(ha(),this),this.imageManager=new wr,this.imageManager.setEventedParent(this),this.glyphManager=new s.GlyphManager(o._requestManager,c.localFontFamily?s.LocalGlyphMode.all:c.localIdeographFontFamily?s.LocalGlyphMode.ideographs:s.LocalGlyphMode.none,c.localFontFamily||c.localIdeographFontFamily),this.crossTileSymbolIndex=new To,this._layers={},this._num3DLayers=0,this._numSymbolLayers=0,this._numCircleLayers=0,this._serializedLayers={},this._sourceCaches={},this._otherSourceCaches={},this._symbolSourceCaches={},this._loaded=!1,this._availableImages=[],this._order=[],this._drapedFirstOrder=[],this._markersNeedUpdate=!1,this._resetUpdates(),this.dispatcher.broadcast("setReferrer",s.getReferrer());const f=this;this._rtlTextPluginCallback=to.registerForPluginStateChange(_=>{f.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:_.pluginStatus,pluginURL:_.pluginURL},(x,T)=>{if(s.triggerPluginCompletionEvent(x),T&&T.every(S=>S))for(const S in f._sourceCaches){const C=f._sourceCaches[S],z=C.getSource().type;z!=="vector"&&z!=="geojson"||C.reload()}})}),this.on("data",_=>{if(_.dataType!=="source"||_.sourceDataType!=="metadata")return;const x=this.getSource(_.sourceId);if(x&&x.vectorLayerIds)for(const T in this._layers){const S=this._layers[T];S.source===x.id&&this._validateLayer(S)}})}loadURL(o,c={}){this.fire(new s.Event("dataloading",{dataType:"style"}));const f=typeof c.validate=="boolean"?c.validate:!s.isMapboxURL(o);o=this.map._requestManager.normalizeStyleURL(o,c.accessToken);const _=this.map._requestManager.transformRequest(o,s.ResourceType.Style);this._request=s.getJSON(_,(x,T)=>{this._request=null,x?this.fire(new s.ErrorEvent(x)):T&&this._load(T,f)})}loadJSON(o,c={}){this.fire(new s.Event("dataloading",{dataType:"style"})),this._request=s.exported.frame(()=>{this._request=null,this._load(o,c.validate!==!1)})}loadEmpty(){this.fire(new s.Event("dataloading",{dataType:"style"})),this._load(zh,!1)}_updateLayerCount(o,c){const f=c?1:-1;o.is3D()&&(this._num3DLayers+=f),o.type==="circle"&&(this._numCircleLayers+=f),o.type==="symbol"&&(this._numSymbolLayers+=f)}_load(o,c){if(c&&ns(this,s.validateStyle(o)))return;this._loaded=!0,this.stylesheet=s.clone$1(o),this._updateMapProjection();for(const _ in o.sources)this.addSource(_,o.sources[_],{validate:!1});this._changed=!1,o.sprite?this._loadSprite(o.sprite):(this.imageManager.setLoaded(!0),this.dispatcher.broadcast("spriteLoaded",!0)),this.glyphManager.setURL(o.glyphs);const f=lf(this.stylesheet.layers);this._order=f.map(_=>_.id),this._layers={},this._serializedLayers={};for(const _ of f){const x=s.createStyleLayer(_);x.setEventedParent(this,{layer:{id:x.id}}),this._layers[x.id]=x,this._serializedLayers[x.id]=x.serialize(),this._updateLayerCount(x,!0)}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new Vt(this.stylesheet.light),this.stylesheet.terrain&&!this.terrainSetForDrapingOnly()&&this._createTerrain(this.stylesheet.terrain,1),this.stylesheet.fog&&this._createFog(this.stylesheet.fog),this._updateDrapeFirstLayers(),this.fire(new s.Event("data",{dataType:"style"})),this.fire(new s.Event("style.load"))}terrainSetForDrapingOnly(){return!!this.terrain&&this.terrain.drapeRenderMode===0}setProjection(o){o?this.stylesheet.projection=o:delete this.stylesheet.projection,this._updateMapProjection()}applyProjectionUpdate(){this._loaded&&(this.dispatcher.broadcast("setProjection",this.map.transform.projectionOptions),this.map.transform.projection.requiresDraping?this.getTerrain()||this.stylesheet.terrain||this.setTerrainForDraping():this.terrainSetForDrapingOnly()&&this.setTerrain(null))}_updateMapProjection(){this.map._useExplicitProjection?this.applyProjectionUpdate():this.map._prioritizeAndUpdateProjection(null,this.stylesheet.projection)}_loadSprite(o){this._spriteRequest=function(c,f,_){let x,T,S;const C=s.exported.devicePixelRatio>1?"@2x":"";let z=s.getJSON(f.transformRequest(f.normalizeSpriteURL(c,C,".json"),s.ResourceType.SpriteJSON),(j,W)=>{z=null,S||(S=j,x=W,O())}),P=s.getImage(f.transformRequest(f.normalizeSpriteURL(c,C,".png"),s.ResourceType.SpriteImage),(j,W)=>{P=null,S||(S=j,T=W,O())});function O(){if(S)_(S);else if(x&&T){const j=s.exported.getImageData(T),W={};for(const H in x){const{width:Z,height:X,x:B,y:q,sdf:Q,pixelRatio:ee,stretchX:de,stretchY:fe,content:pe}=x[H],xe=new s.RGBAImage({width:Z,height:X});s.RGBAImage.copy(j,xe,{x:B,y:q},{x:0,y:0},{width:Z,height:X}),W[H]={data:xe,pixelRatio:ee,sdf:Q,stretchX:de,stretchY:fe,content:pe}}_(null,W)}}return{cancel(){z&&(z.cancel(),z=null),P&&(P.cancel(),P=null)}}}(o,this.map._requestManager,(c,f)=>{if(this._spriteRequest=null,c)this.fire(new s.ErrorEvent(c));else if(f)for(const _ in f)this.imageManager.addImage(_,f[_]);this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),this.dispatcher.broadcast("setImages",this._availableImages),this.dispatcher.broadcast("spriteLoaded",!0),this.fire(new s.Event("data",{dataType:"style"}))})}_validateLayer(o){const c=this.getSource(o.source);if(!c)return;const f=o.sourceLayer;f&&(c.type==="geojson"||c.vectorLayerIds&&c.vectorLayerIds.indexOf(f)===-1)&&this.fire(new s.ErrorEvent(new Error(`Source layer "${f}" does not exist on source "${c.id}" as specified by style layer "${o.id}"`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const o in this._sourceCaches)if(!this._sourceCaches[o].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeLayers(o){const c=[];for(const f of o){const _=this._layers[f];_.type!=="custom"&&c.push(_.serialize())}return c}hasTransitions(){if(this.light&&this.light.hasTransition()||this.fog&&this.fog.hasTransition())return!0;for(const o in this._sourceCaches)if(this._sourceCaches[o].hasTransition())return!0;for(const o in this._layers)if(this._layers[o].hasTransition())return!0;return!1}get order(){return this.map._optimizeForTerrain&&this.terrain?this._drapedFirstOrder:this._order}isLayerDraped(o){return!!this.terrain&&(typeof o.isLayerDraped=="function"?o.isLayerDraped():fa[o.type])}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading")}update(o){if(!this._loaded)return;const c=this._changed;if(this._changed){const _=Object.keys(this._updatedLayers),x=Object.keys(this._removedLayers);(_.length||x.length)&&this._updateWorkerLayers(_,x);for(const T in this._updatedSources){const S=this._updatedSources[T];S==="reload"?this._reloadSource(T):S==="clear"&&this._clearSource(T)}this._updateTilesForChangedImages();for(const T in this._updatedPaintProps)this._layers[T].updateTransitions(o);this.light.updateTransitions(o),this.fog&&this.fog.updateTransitions(o),this._resetUpdates()}const f={};for(const _ in this._sourceCaches){const x=this._sourceCaches[_];f[_]=x.used,x.used=!1}for(const _ of this._order){const x=this._layers[_];if(x.recalculate(o,this._availableImages),!x.isHidden(o.zoom)){const S=this._getLayerSourceCache(x);S&&(S.used=!0)}const T=this.map.painter;if(T){const S=x.getProgramIds();if(!S)continue;const C=x.getProgramConfiguration(o.zoom);for(const z of S)T.useProgram(z,C)}}for(const _ in f){const x=this._sourceCaches[_];f[_]!==x.used&&x.getSource().fire(new s.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:x.getSource().id}))}this.light.recalculate(o),this.terrain&&this.terrain.recalculate(o),this.fog&&this.fog.recalculate(o),this.z=o.zoom,this._markersNeedUpdate&&(this._updateMarkersOpacity(),this._markersNeedUpdate=!1),c&&this.fire(new s.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){const o=Object.keys(this._changedImages);if(o.length){for(const c in this._sourceCaches)this._sourceCaches[c].reloadTilesForDependencies(["icons","patterns"],o);this._changedImages={}}}_updateWorkerLayers(o,c){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(o),removedIds:c})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}}setState(o){if(this._checkLoaded(),ns(this,s.validateStyle(o)))return!1;(o=s.clone$1(o)).layers=lf(o.layers);const c=function(_,x){if(!_)return[{command:Jt.setStyle,args:[x]}];let T=[];try{if(!k(_.version,x.version))return[{command:Jt.setStyle,args:[x]}];k(_.center,x.center)||T.push({command:Jt.setCenter,args:[x.center]}),k(_.zoom,x.zoom)||T.push({command:Jt.setZoom,args:[x.zoom]}),k(_.bearing,x.bearing)||T.push({command:Jt.setBearing,args:[x.bearing]}),k(_.pitch,x.pitch)||T.push({command:Jt.setPitch,args:[x.pitch]}),k(_.sprite,x.sprite)||T.push({command:Jt.setSprite,args:[x.sprite]}),k(_.glyphs,x.glyphs)||T.push({command:Jt.setGlyphs,args:[x.glyphs]}),k(_.transition,x.transition)||T.push({command:Jt.setTransition,args:[x.transition]}),k(_.light,x.light)||T.push({command:Jt.setLight,args:[x.light]}),k(_.fog,x.fog)||T.push({command:Jt.setFog,args:[x.fog]}),k(_.projection,x.projection)||T.push({command:Jt.setProjection,args:[x.projection]});const S={},C=[];(function(O,j,W,H){let Z;for(Z in j=j||{},O=O||{})O.hasOwnProperty(Z)&&(j.hasOwnProperty(Z)||yl(Z,W,H));for(Z in j){if(!j.hasOwnProperty(Z))continue;const X=j[Z];O.hasOwnProperty(Z)?k(O[Z],X)||(O[Z].type==="geojson"&&X.type==="geojson"&&Ic(O,j,Z)?W.push({command:Jt.setGeoJSONSourceData,args:[Z,X.data]}):bh(Z,j,W,H)):wh(Z,j,W)}})(_.sources,x.sources,C,S);const z=[];_.layers&&_.layers.forEach(O=>{O.source&&S[O.source]?T.push({command:Jt.removeLayer,args:[O.id]}):z.push(O)});let P=_.terrain;P&&S[P.source]&&(T.push({command:Jt.setTerrain,args:[void 0]}),P=void 0),T=T.concat(C),k(P,x.terrain)||T.push({command:Jt.setTerrain,args:[x.terrain]}),function(O,j,W){j=j||[];const H=(O=O||[]).map(xo),Z=j.map(xo),X=O.reduce(Eh,{}),B=j.reduce(Eh,{}),q=H.slice(),Q=Object.create(null);let ee,de,fe,pe,xe,ye,Ae;for(ee=0,de=0;ee!(_.command in q_));if(c.length===0)return!1;const f=c.filter(_=>!(_.command in Mc));if(f.length>0)throw new Error(`Unimplemented: ${f.map(_=>_.command).join(", ")}.`);return c.forEach(_=>{_.command!=="setTransition"&&_.command!=="setProjection"&&this[_.command].apply(this,_.args)}),this.stylesheet=o,this._updateMapProjection(),!0}addImage(o,c){return this.getImage(o)?this.fire(new s.ErrorEvent(new Error("An image with this name already exists."))):(this.imageManager.addImage(o,c),this._afterImageUpdated(o),this)}updateImage(o,c){this.imageManager.updateImage(o,c)}getImage(o){return this.imageManager.getImage(o)}removeImage(o){return this.getImage(o)?(this.imageManager.removeImage(o),this._afterImageUpdated(o),this):this.fire(new s.ErrorEvent(new Error("No image with this name exists.")))}_afterImageUpdated(o){this._availableImages=this.imageManager.listImages(),this._changedImages[o]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new s.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this._availableImages.slice()}addSource(o,c,f={}){if(this._checkLoaded(),this.getSource(o)!==void 0)throw new Error("There is already a source with this ID");if(!c.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(c).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(c.type)>=0&&this._validate(s.validateSource,`sources.${o}`,c,null,f))return;this.map&&this.map._collectResourceTiming&&(c.collectResourceTiming=!0);const _=Dt(o,c,this.dispatcher,this);_.setEventedParent(this,()=>({isSourceLoaded:this._isSourceCacheLoaded(o),source:_.serialize(),sourceId:o}));const x=T=>{const S=(T?"symbol:":"other:")+o,C=this._sourceCaches[S]=new s.SourceCache(S,_,T);(T?this._symbolSourceCaches:this._otherSourceCaches)[o]=C,C.style=this,C.onAdd(this.map)};x(!1),c.type!=="vector"&&c.type!=="geojson"||x(!0),_.onAdd&&_.onAdd(this.map),this._changed=!0}removeSource(o){this._checkLoaded();const c=this.getSource(o);if(!c)throw new Error("There is no source with this ID");for(const _ in this._layers)if(this._layers[_].source===o)return this.fire(new s.ErrorEvent(new Error(`Source "${o}" cannot be removed while layer "${_}" is using it.`)));if(this.terrain&&this.terrain.get().source===o)return this.fire(new s.ErrorEvent(new Error(`Source "${o}" cannot be removed while terrain is using it.`)));const f=this._getSourceCaches(o);for(const _ of f)delete this._sourceCaches[_.id],delete this._updatedSources[_.id],_.fire(new s.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:_.getSource().id})),_.setEventedParent(null),_.clearTiles();return delete this._otherSourceCaches[o],delete this._symbolSourceCaches[o],c.setEventedParent(null),c.onRemove&&c.onRemove(this.map),this._changed=!0,this}setGeoJSONSourceData(o,c){this._checkLoaded(),this.getSource(o).setData(c),this._changed=!0}getSource(o){const c=this._getSourceCache(o);return c&&c.getSource()}_getSources(){const o=[];for(const c in this._otherSourceCaches){const f=this._getSourceCache(c);f&&o.push(f.getSource())}return o}addLayer(o,c,f={}){this._checkLoaded();const _=o.id;if(this.getLayer(_))return void this.fire(new s.ErrorEvent(new Error(`Layer with id "${_}" already exists on this map`)));let x;if(o.type==="custom"){if(ns(this,s.validateCustomStyleLayer(o)))return;x=s.createStyleLayer(o)}else{if(typeof o.source=="object"&&(this.addSource(_,o.source),o=s.clone$1(o),o=s.extend(o,{source:_})),this._validate(s.validateLayer,`layers.${_}`,o,{arrayIndex:-1},f))return;x=s.createStyleLayer(o),this._validateLayer(x),x.setEventedParent(this,{layer:{id:_}}),this._serializedLayers[x.id]=x.serialize(),this._updateLayerCount(x,!0)}const T=c?this._order.indexOf(c):this._order.length;if(c&&T===-1)return void this.fire(new s.ErrorEvent(new Error(`Layer with id "${c}" does not exist on this map.`)));this._order.splice(T,0,_),this._layerOrderChanged=!0,this._layers[_]=x;const S=this._getLayerSourceCache(x);if(this._removedLayers[_]&&x.source&&S&&x.type!=="custom"){const C=this._removedLayers[_];delete this._removedLayers[_],C.type!==x.type?this._updatedSources[x.source]="clear":(this._updatedSources[x.source]="reload",S.pause())}this._updateLayer(x),x.onAdd&&x.onAdd(this.map),this._updateDrapeFirstLayers()}moveLayer(o,c){if(this._checkLoaded(),this._changed=!0,!this._layers[o])return void this.fire(new s.ErrorEvent(new Error(`The layer '${o}' does not exist in the map's style and cannot be moved.`)));if(o===c)return;const f=this._order.indexOf(o);this._order.splice(f,1);const _=c?this._order.indexOf(c):this._order.length;c&&_===-1?this.fire(new s.ErrorEvent(new Error(`Layer with id "${c}" does not exist on this map.`))):(this._order.splice(_,0,o),this._layerOrderChanged=!0,this._updateDrapeFirstLayers())}removeLayer(o){this._checkLoaded();const c=this._layers[o];if(!c)return void this.fire(new s.ErrorEvent(new Error(`The layer '${o}' does not exist in the map's style and cannot be removed.`)));c.setEventedParent(null),this._updateLayerCount(c,!1);const f=this._order.indexOf(o);this._order.splice(f,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[o]=c,delete this._layers[o],delete this._serializedLayers[o],delete this._updatedLayers[o],delete this._updatedPaintProps[o],c.onRemove&&c.onRemove(this.map),this._updateDrapeFirstLayers()}getLayer(o){return this._layers[o]}hasLayer(o){return o in this._layers}hasLayerType(o){for(const c in this._layers)if(this._layers[c].type===o)return!0;return!1}setLayerZoomRange(o,c,f){this._checkLoaded();const _=this.getLayer(o);_?_.minzoom===c&&_.maxzoom===f||(c!=null&&(_.minzoom=c),f!=null&&(_.maxzoom=f),this._updateLayer(_)):this.fire(new s.ErrorEvent(new Error(`The layer '${o}' does not exist in the map's style and cannot have zoom extent.`)))}setFilter(o,c,f={}){this._checkLoaded();const _=this.getLayer(o);if(_){if(!k(_.filter,c))return c==null?(_.filter=void 0,void this._updateLayer(_)):void(this._validate(s.validateFilter,`layers.${_.id}.filter`,c,{layerType:_.type},f)||(_.filter=s.clone$1(c),this._updateLayer(_)))}else this.fire(new s.ErrorEvent(new Error(`The layer '${o}' does not exist in the map's style and cannot be filtered.`)))}getFilter(o){const c=this.getLayer(o);return c&&s.clone$1(c.filter)}setLayoutProperty(o,c,f,_={}){this._checkLoaded();const x=this.getLayer(o);x?k(x.getLayoutProperty(c),f)||(x.setLayoutProperty(c,f,_),this._updateLayer(x)):this.fire(new s.ErrorEvent(new Error(`The layer '${o}' does not exist in the map's style and cannot be styled.`)))}getLayoutProperty(o,c){const f=this.getLayer(o);if(f)return f.getLayoutProperty(c);this.fire(new s.ErrorEvent(new Error(`The layer '${o}' does not exist in the map's style.`)))}setPaintProperty(o,c,f,_={}){this._checkLoaded();const x=this.getLayer(o);x?k(x.getPaintProperty(c),f)||(x.setPaintProperty(c,f,_)&&this._updateLayer(x),this._changed=!0,this._updatedPaintProps[o]=!0):this.fire(new s.ErrorEvent(new Error(`The layer '${o}' does not exist in the map's style and cannot be styled.`)))}getPaintProperty(o,c){const f=this.getLayer(o);return f&&f.getPaintProperty(c)}setFeatureState(o,c){this._checkLoaded();const f=o.source,_=o.sourceLayer,x=this.getSource(f);if(!x)return void this.fire(new s.ErrorEvent(new Error(`The source '${f}' does not exist in the map's style.`)));const T=x.type;if(T==="geojson"&&_)return void this.fire(new s.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));if(T==="vector"&&!_)return void this.fire(new s.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));o.id===void 0&&this.fire(new s.ErrorEvent(new Error("The feature id parameter must be provided.")));const S=this._getSourceCaches(f);for(const C of S)C.setFeatureState(_,o.id,c)}removeFeatureState(o,c){this._checkLoaded();const f=o.source,_=this.getSource(f);if(!_)return void this.fire(new s.ErrorEvent(new Error(`The source '${f}' does not exist in the map's style.`)));const x=_.type,T=x==="vector"?o.sourceLayer:void 0;if(x==="vector"&&!T)return void this.fire(new s.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));if(c&&typeof o.id!="string"&&typeof o.id!="number")return void this.fire(new s.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));const S=this._getSourceCaches(f);for(const C of S)C.removeFeatureState(T,o.id,c)}getFeatureState(o){this._checkLoaded();const c=o.source,f=o.sourceLayer,_=this.getSource(c);if(_){if(_.type!=="vector"||f)return o.id===void 0&&this.fire(new s.ErrorEvent(new Error("The feature id parameter must be provided."))),this._getSourceCaches(c)[0].getFeatureState(f,o.id);this.fire(new s.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new s.ErrorEvent(new Error(`The source '${c}' does not exist in the map's style.`)))}getTransition(){return s.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){const o={};for(const c in this._sourceCaches){const f=this._sourceCaches[c].getSource();o[f.id]||(o[f.id]=f.serialize())}return s.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,terrain:this.getTerrain()||void 0,fog:this.stylesheet.fog,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,projection:this.stylesheet.projection,sources:o,layers:this._serializeLayers(this._order)},c=>c!==void 0)}_updateLayer(o){this._updatedLayers[o.id]=!0;const c=this._getLayerSourceCache(o);o.source&&!this._updatedSources[o.source]&&c&&c.getSource().type!=="raster"&&(this._updatedSources[o.source]="reload",c.pause()),this._changed=!0,o.invalidateCompiledFilter()}_flattenAndSortRenderedFeatures(o){const c=T=>this._layers[T].type==="fill-extrusion",f={},_=[];for(let T=this._order.length-1;T>=0;T--){const S=this._order[T];if(c(S)){f[S]=T;for(const C of o){const z=C[S];if(z)for(const P of z)_.push(P)}}}_.sort((T,S)=>S.intersectionZ-T.intersectionZ);const x=[];for(let T=this._order.length-1;T>=0;T--){const S=this._order[T];if(c(S))for(let C=_.length-1;C>=0;C--){const z=_[C].feature;if(f[z.layer.id]{const z=this.getLayer(C);return z&&z.is3D()}):this.has3DLayers(),S=dn.createFromScreenPoints(o,f);for(const C in this._sourceCaches){const z=this._sourceCaches[C].getSource().id;c.layers&&!_[z]||x.push(In(this._sourceCaches[C],this._layers,this._serializedLayers,S,c,f,T,!!this.map._showQueryGeometry))}return this.placement&&x.push(function(C,z,P,O,j,W,H){const Z={},X=W.queryRenderedSymbols(O),B=[];for(const q of Object.keys(X).map(Number))B.push(H[q]);B.sort(Ir);for(const q of B){const Q=q.featureIndex.lookupSymbolFeatures(X[q.bucketInstanceId],z,q.bucketIndex,q.sourceLayerIndex,j.filter,j.layers,j.availableImages,C);for(const ee in Q){const de=Z[ee]=Z[ee]||[],fe=Q[ee];fe.sort((pe,xe)=>{const ye=q.featureSortOrder;if(ye){const Ae=ye.indexOf(pe.featureIndex);return ye.indexOf(xe.featureIndex)-Ae}return xe.featureIndex-pe.featureIndex});for(const pe of fe)de.push(pe)}}for(const q in Z)Z[q].forEach(Q=>{const ee=Q.feature,de=P(C[q]);if(!de)return;const fe=de.getFeatureState(ee.layer["source-layer"],ee.id);ee.source=ee.layer.source,ee.layer["source-layer"]&&(ee.sourceLayer=ee.layer["source-layer"]),ee.state=fe});return Z}(this._layers,this._serializedLayers,this._getLayerSourceCache.bind(this),S.screenGeometry,c,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(x)}querySourceFeatures(o,c){c&&c.filter&&this._validate(s.validateFilter,"querySourceFeatures.filter",c.filter,null,c);const f=this._getSourceCaches(o);let _=[];for(const x of f)_=_.concat(Vn(x,c));return _}addSourceType(o,c,f){return to.getSourceType(o)?f(new Error(`A source type called "${o}" already exists.`)):(to.setSourceType(o,c),c.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:o,url:c.workerSourceURL},f):f(null,null))}getLight(){return this.light.getLight()}setLight(o,c={}){this._checkLoaded();const f=this.light.getLight();let _=!1;for(const T in o)if(!k(o[T],f[T])){_=!0;break}if(!_)return;const x=this._setTransitionParameters({duration:300,delay:0});this.light.setLight(o,c),this.light.updateTransitions(x)}getTerrain(){return this.terrain&&this.terrain.drapeRenderMode===1?this.terrain.get():null}setTerrainForDraping(){this.setTerrain({source:"",exaggeration:0},0)}setTerrain(o,c=1){if(this._checkLoaded(),!o)return delete this.terrain,delete this.stylesheet.terrain,this.dispatcher.broadcast("enableTerrain",!1),this._force3DLayerUpdate(),void(this._markersNeedUpdate=!0);let f=o;if(c===1){if(typeof f.source=="object"){const _="terrain-dem-src";this.addSource(_,f.source),f=s.clone$1(f),f=s.extend(f,{source:_})}if(this._validate(s.validateTerrain,"terrain",f))return}if(!this.terrain||this.terrain&&c!==this.terrain.drapeRenderMode){if(!f)return;this._createTerrain(f,c)}else{const _=this.terrain,x=_.get();for(const T of Object.keys(s.spec.terrain))!f.hasOwnProperty(T)&&s.spec.terrain[T].default&&(f[T]=s.spec.terrain[T].default);for(const T in f)if(!k(f[T],x[T])){_.set(f),this.stylesheet.terrain=f;const S=this._setTransitionParameters({duration:0});_.updateTransitions(S);break}}this._updateDrapeFirstLayers(),this._markersNeedUpdate=!0}_createFog(o){const c=this.fog=new Tt(o,this.map.transform);this.stylesheet.fog=o;const f=this._setTransitionParameters({duration:0});c.updateTransitions(f)}_updateMarkersOpacity(){this.map._markers.length!==0&&this.map._requestDomTask(()=>{for(const o of this.map._markers)o._evaluateOpacity()})}getFog(){return this.fog?this.fog.get():null}setFog(o){if(this._checkLoaded(),!o)return delete this.fog,delete this.stylesheet.fog,void(this._markersNeedUpdate=!0);if(this.fog){const c=this.fog,f=c.get();Object.keys(o).length===0&&c.set(o);for(const _ in o)if(!k(o[_],f[_])){c.set(o),this.stylesheet.fog=o;const x=this._setTransitionParameters({duration:0});c.updateTransitions(x);break}}else this._createFog(o);this._markersNeedUpdate=!0}_setTransitionParameters(o){return{now:s.exported.now(),transition:s.extend(o,this.stylesheet.transition)}}_updateDrapeFirstLayers(){if(!this.map._optimizeForTerrain||!this.terrain)return;const o=this._order.filter(f=>this.isLayerDraped(this._layers[f])),c=this._order.filter(f=>!this.isLayerDraped(this._layers[f]));this._drapedFirstOrder=[],this._drapedFirstOrder.push(...o),this._drapedFirstOrder.push(...c)}_createTerrain(o,c){const f=this.terrain=new $r(o,c);this.stylesheet.terrain=o,this.dispatcher.broadcast("enableTerrain",!this.terrainSetForDrapingOnly()),this._force3DLayerUpdate();const _=this._setTransitionParameters({duration:0});f.updateTransitions(_)}_force3DLayerUpdate(){for(const o in this._layers){const c=this._layers[o];c.type==="fill-extrusion"&&this._updateLayer(c)}}_forceSymbolLayerUpdate(){for(const o in this._layers){const c=this._layers[o];c.type==="symbol"&&this._updateLayer(c)}}_validate(o,c,f,_,x={}){return(!x||x.validate!==!1)&&ns(this,o.call(s.validateStyle,s.extend({key:c,style:this.serialize(),value:f,styleSpec:s.spec},_)))}_remove(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),s.evented.off("pluginStateChange",this._rtlTextPluginCallback);for(const o in this._layers)this._layers[o].setEventedParent(null);for(const o in this._sourceCaches)this._sourceCaches[o].clearTiles(),this._sourceCaches[o].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()}_clearSource(o){const c=this._getSourceCaches(o);for(const f of c)f.clearTiles()}_reloadSource(o){const c=this._getSourceCaches(o);for(const f of c)f.resume(),f.reload()}_reloadSources(){for(const o of this._getSources())o.reload&&o.reload()}_updateSources(o){for(const c in this._sourceCaches)this._sourceCaches[c].update(o)}_generateCollisionBoxes(){for(const o in this._sourceCaches){const c=this._sourceCaches[o];c.resume(),c.reload()}}_updatePlacement(o,c,f,_,x=!1){let T=!1,S=!1;const C={};for(const z of this._order){const P=this._layers[z];if(P.type!=="symbol")continue;if(!C[P.source]){const j=this._getLayerSourceCache(P);if(!j)continue;C[P.source]=j.getRenderableIds(!0).map(W=>j.getTileByID(W)).sort((W,H)=>H.tileID.overscaledZ-W.tileID.overscaledZ||(W.tileID.isLessThan(H.tileID)?-1:1))}const O=this.crossTileSymbolIndex.addLayer(P,C[P.source],o.center.lng,o.projection);T=T||O}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),x=x||this._layerOrderChanged||f===0,this._layerOrderChanged&&this.fire(new s.Event("neworder")),(x||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(s.exported.now(),o.zoom))&&(this.pauseablePlacement=new kh(o,this._order,x,c,f,_,this.placement,this.fog&&o.projection.supportsFog?this.fog.state:null),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,C),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(s.exported.now()),S=!0),T&&this.pauseablePlacement.placement.setStale()),S||T)for(const z of this._order){const P=this._layers[z];P.type==="symbol"&&this.placement.updateLayerOpacities(P,C[P.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(s.exported.now())}_releaseSymbolFadeTiles(){for(const o in this._sourceCaches)this._sourceCaches[o].releaseSymbolFadeTiles()}getImages(o,c,f){this.imageManager.getImages(c.icons,f),this._updateTilesForChangedImages();const _=x=>{x&&x.setDependencies(c.tileID.key,c.type,c.icons)};_(this._otherSourceCaches[c.source]),_(this._symbolSourceCaches[c.source])}getGlyphs(o,c,f){this.glyphManager.getGlyphs(c.stacks,f)}getResource(o,c,f){return s.makeRequest(c,f)}_getSourceCache(o){return this._otherSourceCaches[o]}_getLayerSourceCache(o){return o.type==="symbol"?this._symbolSourceCaches[o.source]:this._otherSourceCaches[o.source]}_getSourceCaches(o){const c=[];return this._otherSourceCaches[o]&&c.push(this._otherSourceCaches[o]),this._symbolSourceCaches[o]&&c.push(this._symbolSourceCaches[o]),c}_isSourceCacheLoaded(o){const c=this._getSourceCaches(o);return c.length===0?(this.fire(new s.ErrorEvent(new Error(`There is no source with ID '${o}'`))),!1):c.every(f=>f.loaded())}has3DLayers(){return this._num3DLayers>0}hasSymbolLayers(){return this._numSymbolLayers>0}hasCircleLayers(){return this._numCircleLayers>0}_clearWorkerCaches(){this.dispatcher.broadcast("clearCaches")}destroy(){this._clearWorkerCaches(),this.terrainSetForDrapingOnly()&&(delete this.terrain,delete this.stylesheet.terrain)}}to.getSourceType=function(d){return Pt[d]},to.setSourceType=function(d,o){Pt[d]=o},to.registerForPluginStateChange=s.registerForPluginStateChange;var Lh=` +#define EPSILON 0.0000001 +#define PI 3.141592653589793 +#define EXTENT 8192.0 +#define HALF_PI PI/2.0 +#define QUARTER_PI PI/4.0 +#define RAD_TO_DEG 180.0/PI +#define DEG_TO_RAD PI/180.0 +#define GLOBE_RADIUS EXTENT/PI/2.0`,Ps="attribute highp vec3 a_pos_3f;uniform lowp mat4 u_matrix;varying highp vec3 v_uv;void main() {const mat3 half_neg_pi_around_x=mat3(1.0,0.0, 0.0,0.0,0.0,-1.0,0.0,1.0, 0.0);v_uv=half_neg_pi_around_x*a_pos_3f;vec4 pos=u_matrix*vec4(a_pos_3f,1.0);gl_Position=pos.xyww;}",So=` +#define ELEVATION_SCALE 7.0 +#define ELEVATION_OFFSET 450.0 +#ifdef PROJECTION_GLOBE_VIEW +uniform vec3 u_tile_tl_up;uniform vec3 u_tile_tr_up;uniform vec3 u_tile_br_up;uniform vec3 u_tile_bl_up;uniform float u_tile_up_scale;vec3 elevationVector(vec2 pos) {vec2 uv=pos/EXTENT;vec3 up=normalize(mix( +mix(u_tile_tl_up,u_tile_tr_up,uv.xxx),mix(u_tile_bl_up,u_tile_br_up,uv.xxx),uv.yyy));return up*u_tile_up_scale;} +#else +vec3 elevationVector(vec2 pos) { return vec3(0,0,1); } +#endif +const float skirtOffset=24575.0;vec3 decomposeToPosAndSkirt(vec2 posWithComposedSkirt) +{float skirt=float(posWithComposedSkirt.x >=skirtOffset);vec2 pos=posWithComposedSkirt-vec2(skirt*skirtOffset,0.0);return vec3(pos,skirt);} +#ifdef TERRAIN +#ifdef TERRAIN_DEM_FLOAT_FORMAT +uniform highp sampler2D u_dem;uniform highp sampler2D u_dem_prev; +#else +uniform sampler2D u_dem;uniform sampler2D u_dem_prev; +#endif +uniform vec4 u_dem_unpack;uniform vec2 u_dem_tl;uniform vec2 u_dem_tl_prev;uniform float u_dem_scale;uniform float u_dem_scale_prev;uniform float u_dem_size;uniform float u_dem_lerp;uniform float u_exaggeration;uniform float u_meter_to_dem;uniform mat4 u_label_plane_matrix_inv;uniform sampler2D u_depth;uniform vec2 u_depth_size_inv;vec4 tileUvToDemSample(vec2 uv,float dem_size,float dem_scale,vec2 dem_tl) {vec2 pos=dem_size*(uv*dem_scale+dem_tl)+1.0;vec2 f=fract(pos);return vec4((pos-f+0.5)/(dem_size+2.0),f);}float decodeElevation(vec4 v) {return dot(vec4(v.xyz*255.0,-1.0),u_dem_unpack);}float currentElevation(vec2 apos) { +#ifdef TERRAIN_DEM_FLOAT_FORMAT +vec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale+u_dem_tl)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture2D(u_dem,pos).a; +#else +float dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale,u_dem_tl);vec2 pos=r.xy;vec2 f=r.zw;float tl=decodeElevation(texture2D(u_dem,pos)); +#ifdef TERRAIN_DEM_NEAREST_FILTER +return u_exaggeration*tl; +#endif +float tr=decodeElevation(texture2D(u_dem,pos+vec2(dd,0.0)));float bl=decodeElevation(texture2D(u_dem,pos+vec2(0.0,dd)));float br=decodeElevation(texture2D(u_dem,pos+vec2(dd,dd)));return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y); +#endif +}float prevElevation(vec2 apos) { +#ifdef TERRAIN_DEM_FLOAT_FORMAT +vec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale_prev+u_dem_tl_prev)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture2D(u_dem_prev,pos).a; +#else +float dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale_prev,u_dem_tl_prev);vec2 pos=r.xy;vec2 f=r.zw;float tl=decodeElevation(texture2D(u_dem_prev,pos));float tr=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,0.0)));float bl=decodeElevation(texture2D(u_dem_prev,pos+vec2(0.0,dd)));float br=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,dd)));return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y); +#endif +} +#ifdef TERRAIN_VERTEX_MORPHING +float elevation(vec2 apos) { +#ifdef ZERO_EXAGGERATION +return 0.0; +#endif +float nextElevation=currentElevation(apos);float prevElevation=prevElevation(apos);return mix(prevElevation,nextElevation,u_dem_lerp);} +#else +float elevation(vec2 apos) { +#ifdef ZERO_EXAGGERATION +return 0.0; +#endif +return currentElevation(apos);} +#endif +highp float unpack_depth(highp vec4 rgba_depth) +{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}bool isOccluded(vec4 frag) {vec3 coord=frag.xyz/frag.w;float depth=unpack_depth(texture2D(u_depth,(coord.xy+1.0)*0.5));return coord.z > depth+0.0005;}float occlusionFade(vec4 frag) {vec3 coord=frag.xyz/frag.w;vec3 df=vec3(5.0*u_depth_size_inv,0.0);vec2 uv=0.5*coord.xy+0.5;vec4 depth=vec4( +unpack_depth(texture2D(u_depth,uv-df.xz)),unpack_depth(texture2D(u_depth,uv+df.xz)),unpack_depth(texture2D(u_depth,uv-df.zy)),unpack_depth(texture2D(u_depth,uv+df.zy)) +);return dot(vec4(0.25),vec4(1.0)-clamp(300.0*(vec4(coord.z-0.001)-depth),0.0,1.0));}vec4 fourSample(vec2 pos,vec2 off) { +#ifdef TERRAIN_DEM_FLOAT_FORMAT +float tl=texture2D(u_dem,pos).a;float tr=texture2D(u_dem,pos+vec2(off.x,0.0)).a;float bl=texture2D(u_dem,pos+vec2(0.0,off.y)).a;float br=texture2D(u_dem,pos+off).a; +#else +vec4 demtl=vec4(texture2D(u_dem,pos).xyz*255.0,-1.0);float tl=dot(demtl,u_dem_unpack);vec4 demtr=vec4(texture2D(u_dem,pos+vec2(off.x,0.0)).xyz*255.0,-1.0);float tr=dot(demtr,u_dem_unpack);vec4 dembl=vec4(texture2D(u_dem,pos+vec2(0.0,off.y)).xyz*255.0,-1.0);float bl=dot(dembl,u_dem_unpack);vec4 dembr=vec4(texture2D(u_dem,pos+off).xyz*255.0,-1.0);float br=dot(dembr,u_dem_unpack); +#endif +return vec4(tl,tr,bl,br);}float flatElevation(vec2 pack) {vec2 apos=floor(pack/8.0);vec2 span=10.0*(pack-apos*8.0);vec2 uvTex=(apos-vec2(1.0,1.0))/8190.0;float size=u_dem_size+2.0;float dd=1.0/size;vec2 pos=u_dem_size*(uvTex*u_dem_scale+u_dem_tl)+1.0;vec2 f=fract(pos);pos=(pos-f+0.5)*dd;vec4 h=fourSample(pos,vec2(dd));float z=mix(mix(h.x,h.y,f.x),mix(h.z,h.w,f.x),f.y);vec2 w=floor(0.5*(span*u_meter_to_dem-1.0));vec2 d=dd*w;h=fourSample(pos-d,2.0*d+vec2(dd));vec4 diff=abs(h.xzxy-h.ywzw);vec2 slope=min(vec2(0.25),u_meter_to_dem*0.5*(diff.xz+diff.yw)/(2.0*w+vec2(1.0)));vec2 fix=slope*span;float base=z+max(fix.x,fix.y);return u_exaggeration*base;}float elevationFromUint16(float word) {return u_exaggeration*(word/ELEVATION_SCALE-ELEVATION_OFFSET);} +#else +float elevation(vec2 pos) { return 0.0; }bool isOccluded(vec4 frag) { return false; }float occlusionFade(vec4 frag) { return 1.0; } +#endif`,Cl=`#ifdef FOG +uniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump mat4 u_fog_matrix;varying vec3 v_fog_pos;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}vec3 fog_position(vec3 pos) {return (u_fog_matrix*vec4(pos,1.0)).xyz;}vec3 fog_position(vec2 pos) {return fog_position(vec3(pos,0.0));}float fog(vec3 pos) {float depth=length(pos);float opacity=fog_opacity(fog_range(depth));return opacity*fog_horizon_blending(pos/depth);} +#endif`,Ao=`#ifdef FOG +uniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump float u_fog_temporal_offset;varying vec3 v_fog_pos;uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform highp vec2 u_viewport;uniform float u_globe_transition;uniform int u_is_globe;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}float globe_glow_progress() {highp vec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix( +mix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);highp vec3 dir=normalize(ray_dir);highp vec3 closest_point=dot(u_globe_pos,dir)*dir;highp float sdf=length(closest_point-u_globe_pos)/u_globe_radius;return sdf+PI*0.5;}float fog_opacity(vec3 pos) {float depth=length(pos);return fog_opacity(fog_range(depth));}vec3 fog_apply(vec3 color,vec3 pos) {float depth=length(pos);float opacity;if (u_is_globe==1) {float glow_progress=globe_glow_progress();float t=mix(glow_progress,depth,u_globe_transition);opacity=fog_opacity(fog_range(t));} else {opacity=fog_opacity(fog_range(depth));opacity*=fog_horizon_blending(pos/depth);}return mix(color,u_fog_color.rgb,opacity);}vec4 fog_apply_from_vert(vec4 color,float fog_opac) {float alpha=EPSILON+color.a;color.rgb=mix(color.rgb/alpha,u_fog_color.rgb,fog_opac)*alpha;return color;}vec3 fog_apply_sky_gradient(vec3 camera_ray,vec3 sky_color) {float horizon_blend=fog_horizon_blending(normalize(camera_ray));return mix(sky_color,u_fog_color.rgb,horizon_blend);}vec4 fog_apply_premultiplied(vec4 color,vec3 pos) {float alpha=EPSILON+color.a;color.rgb=fog_apply(color.rgb/alpha,pos)*alpha;return color;}vec3 fog_dither(vec3 color) {vec2 dither_seed=gl_FragCoord.xy+u_fog_temporal_offset;return dither(color,dither_seed);}vec4 fog_dither(vec4 color) {return vec4(fog_dither(color.rgb),color.a);} +#endif`;let Pc={},ma={};const Il=[];ga(Lh,Il),ga(So,Il),ga(Cl,Il),ga(Ao,Il),Pc=Qt("",So),ma=Qt(Ao,Cl);const ff=Qt(` +#if __VERSION__ >=300 +#define varying in +#define gl_FragColor glFragColor +#define texture2D texture +#define textureCube texture +out vec4 glFragColor; +#endif +highp vec3 hash(highp vec2 p) {highp vec3 p3=fract(p.xyx*vec3(443.8975,397.2973,491.1871));p3+=dot(p3,p3.yxz+19.19);return fract((p3.xxy+p3.yzz)*p3.zyx);}vec3 dither(vec3 color,highp vec2 seed) {vec3 rnd=hash(seed)+hash(seed+0.59374)-0.5;return color+rnd/255.0;}highp float unpack_depth(highp vec4 rgba_depth) +{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}highp vec4 pack_depth(highp float ndc_z) {highp float depth=ndc_z*0.5+0.5;const highp vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);const highp vec4 bit_mask =vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);highp vec4 res=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;}`,` +#if __VERSION__ >=300 +#define attribute in +#define varying out +#define texture2D texture +#endif +float wrap(float n,float min,float max) {float d=max-min;float w=mod(mod(n-min,d)+d,d)+min;return (w==min) ? max : w;} +#ifdef PROJECTION_GLOBE_VIEW +vec3 mercator_tile_position(mat4 matrix,vec2 tile_anchor,vec3 tile_id,vec2 mercator_center) { +#ifndef PROJECTED_POS_ON_VIEWPORT +float tiles=tile_id.z;vec2 mercator=(tile_anchor/EXTENT+tile_id.xy)/tiles;mercator-=mercator_center;mercator.x=wrap(mercator.x,-0.5,0.5);vec4 mercator_tile=vec4(mercator.xy*EXTENT,EXTENT/(2.0*PI),1.0);mercator_tile=matrix*mercator_tile;return mercator_tile.xyz; +#else +return vec3(0.0); +#endif +}vec3 mix_globe_mercator(vec3 globe,vec3 mercator,float t) {return mix(globe,mercator,t);}mat3 globe_mercator_surface_vectors(vec3 pos_normal,vec3 up_dir,float zoom_transition) {vec3 normal=zoom_transition==0.0 ? pos_normal : normalize(mix(pos_normal,up_dir,zoom_transition));vec3 xAxis=normalize(vec3(normal.z,0.0,-normal.x));vec3 yAxis=normalize(cross(normal,xAxis));return mat3(xAxis,yAxis,normal);} +#endif +vec2 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 +);}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;}const vec4 AWAY=vec4(-1000.0,-1000.0,-1000.0,1);//Normalized device coordinate that is not rendered.`),zc=Lh,Rh=` +#ifdef GL_ES +precision mediump float; +#else + +#if !defined(lowp) +#define lowp +#endif + +#if !defined(mediump) +#define mediump +#endif + +#if !defined(highp) +#define highp +#endif + +#endif`;var Dh={background:Qt(`uniform vec4 u_color;uniform float u_opacity; +#ifdef LIGHTING_3D_MODE +varying vec4 v_color; +#endif +void main() {vec4 out_color; +#ifdef LIGHTING_3D_MODE +out_color=v_color; +#else +out_color=u_color; +#endif +#ifdef FOG +out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); +#endif +gl_FragColor=out_color*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec2 a_pos;uniform mat4 u_matrix; +#ifdef LIGHTING_3D_MODE +uniform vec4 u_color;varying vec4 v_color; +#endif +void main() {gl_Position=u_matrix*vec4(a_pos,0,1); +#ifdef LIGHTING_3D_MODE +v_color=apply_lighting(u_color); +#endif +#ifdef FOG +v_fog_pos=fog_position(a_pos); +#endif +}`),backgroundPattern:Qt(`uniform vec2 u_pattern_tl;uniform vec2 u_pattern_br;uniform vec2 u_texsize;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos;void main() {vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(u_pattern_tl/u_texsize,u_pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos); +#ifdef LIGHTING_3D_MODE +out_color=apply_lighting(out_color); +#endif +#ifdef FOG +out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); +#endif +gl_FragColor=out_color*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_pattern_size;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_pattern_size,u_tile_units_to_pixels,a_pos); +#ifdef FOG +v_fog_pos=fog_position(a_pos); +#endif +}`),circle:Qt(`varying vec3 v_data;varying float v_visibility; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define mediump float radius +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define highp vec4 stroke_color +#pragma mapbox: define mediump float stroke_width +#pragma mapbox: define lowp float stroke_opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize mediump float radius +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize highp vec4 stroke_color +#pragma mapbox: initialize mediump float stroke_width +#pragma mapbox: initialize lowp float stroke_opacity +vec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);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) +);vec4 out_color=mix(color*opacity,stroke_color*stroke_opacity,color_t); +#ifdef LIGHTING_3D_MODE +out_color=apply_lighting(out_color); +#endif +#ifdef FOG +out_color=fog_apply_premultiplied(out_color,v_fog_pos); +#endif +gl_FragColor=out_color*(v_visibility*opacity_t); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`#define NUM_VISIBILITY_RINGS 2 +#define INV_SQRT2 0.70710678 +#define ELEVATION_BIAS 0.0001 +#define NUM_SAMPLES_PER_RING 16 +uniform mat4 u_matrix;uniform mat2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos; +#ifdef PROJECTION_GLOBE_VIEW +attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir; +#endif +varying vec3 v_data;varying float v_visibility; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define mediump float radius +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define highp vec4 stroke_color +#pragma mapbox: define mediump float stroke_width +#pragma mapbox: define lowp float stroke_opacity +vec2 calc_offset(vec2 extrusion,float radius,float stroke_width, float view_scale) {return extrusion*(radius+stroke_width)*u_extrude_scale*view_scale;}float cantilevered_elevation(vec2 pos,float radius,float stroke_width,float view_scale) {vec2 c1=pos+calc_offset(vec2(-1,-1),radius,stroke_width,view_scale);vec2 c2=pos+calc_offset(vec2(1,-1),radius,stroke_width,view_scale);vec2 c3=pos+calc_offset(vec2(1,1),radius,stroke_width,view_scale);vec2 c4=pos+calc_offset(vec2(-1,1),radius,stroke_width,view_scale);float h1=elevation(c1)+ELEVATION_BIAS;float h2=elevation(c2)+ELEVATION_BIAS;float h3=elevation(c3)+ELEVATION_BIAS;float h4=elevation(c4)+ELEVATION_BIAS;return max(h4,max(h3,max(h1,h2)));}float circle_elevation(vec2 pos) { +#if defined(TERRAIN) +return elevation(pos)+ELEVATION_BIAS; +#else +return 0.0; +#endif +}vec4 project_vertex(vec2 extrusion,vec4 world_center,vec4 projected_center,float radius,float stroke_width, float view_scale,mat3 surface_vectors) {vec2 sample_offset=calc_offset(extrusion,radius,stroke_width,view_scale); +#ifdef PITCH_WITH_MAP +#ifdef PROJECTION_GLOBE_VIEW +return u_matrix*( world_center+vec4(sample_offset.x*surface_vectors[0]+sample_offset.y*surface_vectors[1],0) ); +#else +return u_matrix*( world_center+vec4(sample_offset,0,0) ); +#endif +#else +return projected_center+vec4(sample_offset,0,0); +#endif +}float get_sample_step() { +#ifdef PITCH_WITH_MAP +return 2.0*PI/float(NUM_SAMPLES_PER_RING); +#else +return PI/float(NUM_SAMPLES_PER_RING); +#endif +}void main(void) { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize mediump float radius +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize highp vec4 stroke_color +#pragma mapbox: initialize mediump float stroke_width +#pragma mapbox: initialize lowp float stroke_opacity +vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);vec4 world_center;mat3 surface_vectors; +#ifdef PROJECTION_GLOBE_VIEW +vec3 pos_normal_3=a_pos_normal_3/16384.0;surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(circle_center)*circle_elevation(circle_center);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*circle_elevation(circle_center);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,circle_center,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;vec3 pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);world_center=vec4(pos,1); +#else +surface_vectors=mat3(1.0);float height=circle_elevation(circle_center);world_center=vec4(circle_center,height,1); +#endif +vec4 projected_center=u_matrix*world_center;float view_scale=0.0; +#ifdef PITCH_WITH_MAP +#ifdef SCALE_WITH_MAP +view_scale=1.0; +#else +view_scale=projected_center.w/u_camera_to_center_distance; +#endif +#else +#ifdef SCALE_WITH_MAP +view_scale=u_camera_to_center_distance; +#else +view_scale=projected_center.w; +#endif +#endif +gl_Position=project_vertex(extrude,world_center,projected_center,radius,stroke_width,view_scale,surface_vectors);float visibility=0.0; +#ifdef TERRAIN +float step=get_sample_step();vec4 occlusion_world_center;vec4 occlusion_projected_center; +#ifdef PITCH_WITH_MAP +float cantilevered_height=cantilevered_elevation(circle_center,radius,stroke_width,view_scale);occlusion_world_center=vec4(circle_center,cantilevered_height,1);occlusion_projected_center=u_matrix*occlusion_world_center; +#else +occlusion_world_center=world_center;occlusion_projected_center=projected_center; +#endif +for(int ring=0; ring < NUM_VISIBILITY_RINGS; ring++) {float scale=(float(ring)+1.0)/float(NUM_VISIBILITY_RINGS);for(int i=0; i < NUM_SAMPLES_PER_RING; i++) {vec2 extrusion=vec2(cos(step*float(i)),-sin(step*float(i)))*scale;vec4 frag_pos=project_vertex(extrusion,occlusion_world_center,occlusion_projected_center,radius,stroke_width,view_scale,surface_vectors);visibility+=float(!isOccluded(frag_pos));}}visibility/=float(NUM_VISIBILITY_RINGS)*float(NUM_SAMPLES_PER_RING); +#else +visibility=1.0; +#endif +#ifdef PROJECTION_GLOBE_VIEW +visibility=1.0; +#endif +v_visibility=visibility;lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur); +#ifdef FOG +v_fog_pos=fog_position(world_center.xyz); +#endif +}`),clippingMask:Qt("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:Qt(`uniform highp float u_intensity;varying vec2 v_extrude; +#pragma mapbox: define highp float weight +#define GAUSS_COEF 0.3989422804014327 +void main() { +#pragma mapbox: initialize highp float weight +float 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); +#ifdef FOG +if (u_is_globe==0) {gl_FragColor.r*=pow(1.0-fog_opacity(v_fog_pos),2.0);} +#endif +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos; +#ifdef PROJECTION_GLOBE_VIEW +attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir; +#endif +varying vec2 v_extrude; +#pragma mapbox: define highp float weight +#pragma mapbox: define mediump float radius +const highp float ZERO=1.0/255.0/16.0; +#define GAUSS_COEF 0.3989422804014327 +void main(void) { +#pragma mapbox: initialize highp float weight +#pragma mapbox: initialize mediump float radius +vec2 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;vec2 tilePos=floor(a_pos*0.5);vec3 pos; +#ifdef PROJECTION_GLOBE_VIEW +vec3 pos_normal_3=a_pos_normal_3/16384.0;mat3 surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(tilePos)*elevation(tilePos);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*elevation(tilePos);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,tilePos,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition); +#else +pos=vec3(tilePos+extrude,elevation(tilePos)); +#endif +gl_Position=u_matrix*vec4(pos,1); +#ifdef FOG +v_fog_pos=fog_position(pos); +#endif +}`),heatmapTexture:Qt(`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; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(0.0); +#endif +}`,"attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=a_pos*0.5+0.5;}"),collisionBox:Qt("varying float v_placed;varying float v_notUsed;void main() {vec4 red =vec4(1.0,0.0,0.0,1.0);vec4 blue=vec4(0.0,0.0,1.0,0.5);gl_FragColor =mix(red,blue,step(0.5,v_placed))*0.5;gl_FragColor*=mix(1.0,0.1,step(0.5,v_notUsed));}",`attribute vec3 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;attribute float a_size_scale;attribute vec2 a_padding;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_pos+elevationVector(a_anchor_pos)*elevation(a_anchor_pos),1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp( +0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,1.5);gl_Position=projectedPoint;gl_Position.xy+=(a_extrude*a_size_scale+a_shift+a_padding)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}`),collisionCircle:Qt("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_2f;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_2f;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:Qt("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; +#ifdef PROJECTION_GLOBE_VIEW +attribute vec3 a_pos_3; +#endif +varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {float h=elevation(a_pos);v_uv=a_pos/8192.0; +#ifdef PROJECTION_GLOBE_VIEW +gl_Position=u_matrix*vec4(a_pos_3+elevationVector(a_pos)*h,1); +#else +gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,h,1); +#endif +}`),fill:Qt(`#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float opacity +vec4 out_color=color; +#ifdef LIGHTING_3D_MODE +out_color=apply_lighting(out_color); +#endif +#ifdef FOG +out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); +#endif +gl_FragColor=out_color*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec2 a_pos;uniform mat4 u_matrix; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float opacity +gl_Position=u_matrix*vec4(a_pos,0,1); +#ifdef FOG +v_fog_pos=fog_position(a_pos); +#endif +}`),fillOutline:Qt(`varying vec2 v_pos; +#pragma mapbox: define highp vec4 outline_color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 outline_color +#pragma mapbox: initialize lowp float opacity +float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=outline_color; +#ifdef LIGHTING_3D_MODE +out_color=apply_lighting(out_color); +#endif +#ifdef FOG +out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); +#endif +gl_FragColor=out_color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos; +#pragma mapbox: define highp vec4 outline_color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 outline_color +#pragma mapbox: initialize lowp float opacity +gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world; +#ifdef FOG +v_fog_pos=fog_position(a_pos); +#endif +}`),fillOutlinePattern:Qt(`uniform vec2 u_texsize;uniform sampler2D u_image;varying vec2 v_pos;varying vec2 v_pos_world; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern +vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);float dist=length(v_pos_world-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=texture2D(u_image,pos); +#ifdef LIGHTING_3D_MODE +out_color=apply_lighting(out_color); +#endif +#ifdef FOG +out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); +#endif +gl_FragColor=out_color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;varying vec2 v_pos_world; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern +#pragma mapbox: define lowp float pixel_ratio +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern +#pragma mapbox: initialize lowp float pixel_ratio +vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);v_pos_world=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world; +#ifdef FOG +v_fog_pos=fog_position(a_pos); +#endif +}`),fillPattern:Qt(`uniform vec2 u_texsize;uniform sampler2D u_image;varying vec2 v_pos; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern +vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos); +#ifdef LIGHTING_3D_MODE +out_color=apply_lighting(out_color); +#endif +#ifdef FOG +out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); +#endif +gl_FragColor=out_color*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern +#pragma mapbox: define lowp float pixel_ratio +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern +#pragma mapbox: initialize lowp float pixel_ratio +vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos); +#ifdef FOG +v_fog_pos=fog_position(a_pos); +#endif +}`),fillExtrusion:Qt(`varying vec4 v_color; +#ifdef RENDER_SHADOWS +varying highp vec4 v_pos_light_view_0;varying highp vec4 v_pos_light_view_1;varying float v_depth; +#endif +#ifdef FAUX_AO +uniform lowp vec2 u_ao;varying vec3 v_ao; +#endif +#ifdef ZERO_ROOF_RADIUS +varying vec4 v_roof_color; +#endif +#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) +varying highp vec3 v_normal; +#endif +void main() { +#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) +vec3 normal=v_normal; +#endif +float z;vec4 color; +#ifdef ZERO_ROOF_RADIUS +z=float(normal.z > 0.00001);color=mix(v_color,v_roof_color,z); +#else +color=v_color; +#endif +#ifdef FAUX_AO +float intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x; +#ifdef ZERO_ROOF_RADIUS +concave*=(1.0-z); +#endif +float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);color.rgb=color.rgb*shade; +#endif +#ifdef RENDER_SHADOWS +#ifdef ZERO_ROOF_RADIUS +normal=mix(normal,vec3(0.0,0.0,1.0),z); +#endif +color.xyz=shadowed_color_normal(color.xyz,normalize(normal),v_pos_light_view_0,v_pos_light_view_1,v_depth); +#endif +#ifdef FOG +color=fog_dither(fog_apply_premultiplied(color,v_fog_pos)); +#endif +gl_FragColor=color; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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;uniform float u_edge_radius;attribute vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos; +#ifdef PROJECTION_GLOBE_VIEW +attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift; +#endif +varying vec4 v_color; +#ifdef RENDER_SHADOWS +uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;varying highp vec4 v_pos_light_view_0;varying highp vec4 v_pos_light_view_1;varying float v_depth; +#endif +#ifdef ZERO_ROOF_RADIUS +varying vec4 v_roof_color; +#endif +#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) +varying highp vec3 v_normal; +#endif +#ifdef FAUX_AO +uniform lowp vec2 u_ao;varying vec3 v_ao; +#endif +#pragma mapbox: define highp float base +#pragma mapbox: define highp float height +#pragma mapbox: define highp vec4 color +void main() { +#pragma mapbox: initialize highp float base +#pragma mapbox: initialize highp float height +#pragma mapbox: initialize highp vec4 color +vec4 pos_nx=floor(a_pos_normal_ed*0.5);vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0)); +#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) +v_normal=normal; +#endif +base=max(0.0,base);height=max(0.0,top_up_ny.y==0.0 && top_up_ny.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0); +#if defined(HAS_CENTROID) || defined(TERRAIN) +centroid_pos=a_centroid_pos; +#endif +float ele=0.0;float h=0.0;float c_ele;vec3 pos; +#ifdef TERRAIN +bool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);pos=vec3(pos_nx.xy,h); +#else +h=t > 0.0 ? height : base;pos=vec3(pos_nx.xy,h); +#endif +#ifdef PROJECTION_GLOBE_VIEW +float lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*h);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,pos.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*pos.z;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition); +#endif +float hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(pos,1),AWAY,hidden); +#ifdef RENDER_SHADOWS +v_pos_light_view_0=u_light_matrix_0*vec4(pos,1);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1);v_depth=gl_Position.w; +#endif +float NdotL=0.0;float colorvalue=0.0; +#ifdef LIGHTING_3D_MODE +NdotL=calculate_NdotL(normal); +#else +colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),NdotL); +#endif +if (normal.y !=0.0) {float r=0.84; +#ifndef LIGHTING_3D_MODE +r=mix(0.7,0.98,1.0-u_lightintensity); +#endif +NdotL*=( +(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}v_color=vec4(0.0,0.0,0.0,1.0); +#ifdef FAUX_AO +float concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height; +#ifdef TERRAIN +top_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height); +#endif +v_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]); +#ifdef PROJECTION_GLOBE_VIEW +top_height+=u_height_lift; +#endif +gl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w; +#endif +#ifdef LIGHTING_3D_MODE +v_color=apply_lighting(color,NdotL); +#else +v_color.rgb+=clamp(color.rgb*NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0)); +#endif +v_color*=u_opacity; +#ifdef ZERO_ROOF_RADIUS +v_roof_color=vec4(0.0,0.0,0.0,1.0); +#ifdef LIGHTING_3D_MODE +v_roof_color=apply_lighting(color,calculate_NdotL(vec3(0.0,0.0,1.0))); +#else +float roofNdotL=clamp(u_lightpos.z,0.0,1.0);roofNdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),roofNdotL);v_roof_color.rgb+=clamp(color.rgb*roofNdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0)); +#endif +v_roof_color*=u_opacity; +#endif +#ifdef FOG +v_fog_pos=fog_position(pos); +#endif +}`),fillExtrusionPattern:Qt(`uniform vec2 u_texsize;uniform sampler2D u_image; +#ifdef FAUX_AO +uniform lowp vec2 u_ao;varying vec3 v_ao; +#endif +#ifdef LIGHTING_3D_MODE +varying float v_NdotL; +#endif +varying vec2 v_pos;varying vec4 v_lighting;uniform lowp float u_opacity; +#pragma mapbox: define lowp float base +#pragma mapbox: define lowp float height +#pragma mapbox: define lowp vec4 pattern +#pragma mapbox: define lowp float pixel_ratio +void main() { +#pragma mapbox: initialize lowp float base +#pragma mapbox: initialize lowp float height +#pragma mapbox: initialize mediump vec4 pattern +#pragma mapbox: initialize lowp float pixel_ratio +vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos); +#ifdef LIGHTING_3D_MODE +out_color=apply_lighting(out_color,v_NdotL)*u_opacity; +#else +out_color=out_color*v_lighting; +#endif +#ifdef FAUX_AO +float intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);out_color.rgb=out_color.rgb*shade; +#endif +#ifdef FOG +out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); +#endif +gl_FragColor=out_color; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform float u_tile_units_to_pixels;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 vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos; +#ifdef PROJECTION_GLOBE_VIEW +attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift; +#endif +varying vec2 v_pos;varying vec4 v_lighting; +#ifdef FAUX_AO +uniform lowp vec2 u_ao;varying vec3 v_ao; +#endif +#ifdef LIGHTING_3D_MODE +varying float v_NdotL; +#endif +#pragma mapbox: define lowp float base +#pragma mapbox: define lowp float height +#pragma mapbox: define lowp vec4 pattern +#pragma mapbox: define lowp float pixel_ratio +void main() { +#pragma mapbox: initialize lowp float base +#pragma mapbox: initialize lowp float height +#pragma mapbox: initialize mediump vec4 pattern +#pragma mapbox: initialize lowp float pixel_ratio +vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec4 pos_nx=floor(a_pos_normal_ed*0.5);mediump vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;mediump vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));float edgedistance=a_pos_normal_ed.w;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;base=max(0.0,base);height=max(0.0,height);float t=top_up_ny.x;float z=t > 0.0 ? height : base;vec2 centroid_pos=vec2(0.0); +#if defined(HAS_CENTROID) || defined(TERRAIN) +centroid_pos=a_centroid_pos; +#endif +float ele=0.0;float h=z;vec3 p;float c_ele; +#ifdef TERRAIN +bool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);p=vec3(pos_nx.xy,h); +#else +p=vec3(pos_nx.xy,z); +#endif +#ifdef PROJECTION_GLOBE_VIEW +float lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*(p.z+lift));vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,p.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*p.z;p=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition); +#endif +float hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(p,1),AWAY,hidden);vec2 pos=normal.z==1.0 +? pos_nx.xy +: vec2(edgedistance,z*u_height_factor);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float NdotL=0.0; +#ifdef LIGHTING_3D_MODE +NdotL=calculate_NdotL(normal); +#else +NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),NdotL); +#endif +if (normal.y !=0.0) {float r=0.84; +#ifndef LIGHTING_3D_MODE +r=mix(0.7,0.98,1.0-u_lightintensity); +#endif +NdotL*=( +(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));} +#ifdef FAUX_AO +float concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height; +#ifdef TERRAIN +top_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height); +#endif +v_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]); +#ifdef PROJECTION_GLOBE_VIEW +top_height+=u_height_lift; +#endif +gl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w; +#endif +#ifdef LIGHTING_3D_MODE +v_NdotL=NdotL; +#else +v_lighting.rgb+=clamp(NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity; +#endif +#ifdef FOG +v_fog_pos=fog_position(p); +#endif +}`),hillshadePrepare:Qt(`#ifdef GL_ES +precision highp float; +#endif +uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord) { +#ifdef TERRAIN_DEM_FLOAT_FORMAT +return texture2D(u_image,coord).a/4.0; +#else +vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0; +#endif +}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y));float b=getElevation(v_pos+vec2(0,-epsilon.y));float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y));float d=getElevation(v_pos+vec2(-epsilon.x,0));float e=getElevation(v_pos+vec2(epsilon.x,0));float f=getElevation(v_pos+vec2(-epsilon.x,epsilon.y));float g=getElevation(v_pos+vec2(0,epsilon.y));float h=getElevation(v_pos+vec2(epsilon.x,epsilon.y));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+e+e+h)-(a+d+d+f),(f+g+g+h)-(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); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"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:Qt(`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;void 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; +#ifdef LIGHTING_3D_MODE +gl_FragColor=apply_lighting(gl_FragColor); +#endif +#ifdef FOG +gl_FragColor=fog_dither(fog_apply_premultiplied(gl_FragColor,v_fog_pos)); +#endif +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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; +#ifdef FOG +v_fog_pos=fog_position(a_pos); +#endif +}`),line:Qt(`uniform lowp float u_device_pixel_ratio;uniform float u_alpha_discard_threshold;uniform highp vec2 u_trim_offset;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec4 v_uv; +#ifdef RENDER_LINE_DASH +uniform sampler2D u_dash_image;varying vec2 v_tex; +#endif +#ifdef RENDER_LINE_GRADIENT +uniform sampler2D u_gradient_image; +#endif +uniform float u_border_width;uniform vec4 u_border_color;float luminance(vec3 c) {return (c.r+c.r+c.b+c.g+c.g+c.g)*0.1667;} +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float floorwidth +#pragma mapbox: define lowp vec4 dash +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +float linearstep(float edge0,float edge1,float x) {return clamp((x-edge0)/(edge1-edge0),0.0,1.0);}void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float floorwidth +#pragma mapbox: initialize lowp vec4 dash +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +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); +#ifdef RENDER_LINE_DASH +float sdfdist=texture2D(u_dash_image,v_tex).a;float sdfgamma=1.0/(2.0*u_device_pixel_ratio)/dash.z;alpha*=linearstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist); +#endif +highp vec4 out_color; +#ifdef RENDER_LINE_GRADIENT +out_color=texture2D(u_gradient_image,v_uv.xy); +#else +out_color=color; +#endif +float trimmed=1.0; +#ifdef RENDER_LINE_TRIM_OFFSET +highp float start=v_uv[2];highp float end=v_uv[3];highp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=(start+(v_uv.x)*(end-start));if (trim_end > trim_start) {if (line_progress <=trim_end && line_progress >=trim_start) {out_color=vec4(0,0,0,0);trimmed=0.0;}} +#endif +#ifdef LIGHTING_3D_MODE +out_color=apply_lighting(out_color); +#endif +#ifdef FOG +out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); +#endif +#ifdef RENDER_LINE_ALPHA_DISCARD +if (alpha < u_alpha_discard_threshold) {discard;} +#endif +#ifdef RENDER_LINE_BORDER +float edgeBlur=(u_border_width+1.0/u_device_pixel_ratio);float alpha2=clamp(min(dist-(v_width2.t-edgeBlur),v_width2.s-dist)/edgeBlur,0.0,1.0);if (alpha2 < 1.) {float smoothAlpha=smoothstep(0.6,1.0,alpha2); +#ifdef RENDER_LINE_BORDER_AUTO +float Y=(out_color.a > 0.01) ? luminance(out_color.rgb/out_color.a) : 1.;float adjustment=(Y > 0.) ? 0.5/Y : 0.45;if (out_color.a > 0.25 && Y < 0.25) {vec3 borderColor=(Y > 0.) ? out_color.rgb : vec3(1,1,1)*out_color.a;out_color.rgb=out_color.rgb+borderColor*(adjustment*(1.0-smoothAlpha));} else {out_color.rgb*=(0.6 +0.4*smoothAlpha);} +#else +out_color.rgb=mix(u_border_color.rgb*u_border_color.a*trimmed,out_color.rgb,smoothAlpha); +#endif +} +#endif +gl_FragColor=out_color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define EXTRUDE_SCALE 0.015873016 +attribute vec2 a_pos_normal;attribute vec4 a_data; +#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET) +attribute highp vec4 a_packed; +#endif +#ifdef RENDER_LINE_DASH +attribute float a_linesofar; +#endif +uniform mat4 u_matrix;uniform mat2 u_pixels_to_tile_units;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 vec4 v_uv; +#ifdef RENDER_LINE_DASH +uniform vec2 u_texsize;uniform float u_tile_units_to_pixels;varying vec2 v_tex; +#endif +#ifdef RENDER_LINE_GRADIENT +uniform float u_image_height; +#endif +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float floorwidth +#pragma mapbox: define lowp vec4 dash +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float floorwidth +#pragma mapbox: initialize lowp vec4 dash +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float width +float 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;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*EXTRUDE_SCALE;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*EXTRUDE_SCALE*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist*u_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude; +#ifndef RENDER_TO_TEXTURE +float 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; +#else +v_gamma_scale=1.0; +#endif +#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET) +float a_uv_x=a_packed[0];float a_split_index=a_packed[1];highp float a_clip_start=a_packed[2];highp float a_clip_end=a_packed[3]; +#ifdef RENDER_LINE_GRADIENT +highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec4(a_uv_x,a_split_index*texel_height-half_texel_height,a_clip_start,a_clip_end); +#else +v_uv=vec4(a_uv_x,0.0,a_clip_start,a_clip_end); +#endif +#endif +#ifdef RENDER_LINE_DASH +float scale=dash.z==0.0 ? 0.0 : u_tile_units_to_pixels/dash.z;float height=dash.y;v_tex=vec2(a_linesofar*scale/floorwidth,(-normal.y*height+dash.x+0.5)/u_texsize.y); +#endif +v_width2=vec2(outset,inset); +#ifdef FOG +v_fog_pos=fog_position(pos); +#endif +}`),linePattern:Qt(`uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_tile_units_to_pixels;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; +#pragma mapbox: define lowp vec4 pattern +#pragma mapbox: define lowp float pixel_ratio +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize mediump vec4 pattern +#pragma mapbox: initialize lowp float pixel_ratio +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;vec2 pattern_size=vec2(display_size.x/u_tile_units_to_pixels,display_size.y);float aspect=display_size.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=mod(v_linesofar/pattern_size.x*aspect,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(x,y));vec4 color=texture2D(u_image,pos); +#ifdef LIGHTING_3D_MODE +color=apply_lighting(color); +#endif +#ifdef FOG +color=fog_dither(fog_apply_premultiplied(color,v_fog_pos)); +#endif +gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_linesofar;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mat2 u_pixels_to_tile_units;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; +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +#pragma mapbox: define lowp vec4 pattern +#pragma mapbox: define lowp float pixel_ratio +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +#pragma mapbox: initialize mediump vec4 pattern +#pragma mapbox: initialize lowp float pixel_ratio +float 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;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_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude; +#ifndef RENDER_TO_TEXTURE +float 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; +#else +v_gamma_scale=1.0; +#endif +v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth; +#ifdef FOG +v_fog_pos=fog_position(pos); +#endif +}`),raster:Qt(`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);vec3 out_color=mix(u_high_vec,u_low_vec,rgb); +#ifdef LIGHTING_3D_MODE +out_color=apply_lighting(out_color); +#endif +#ifdef FOG +out_color=fog_dither(fog_apply(out_color,v_fog_pos)); +#endif +gl_FragColor=vec4(out_color*color.a,color.a); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform vec2 u_perspective_transform;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {float w=1.0+dot(a_texture_pos,u_perspective_transform);gl_Position=u_matrix*vec4(a_pos*w,0,w);v_pos0=a_texture_pos/8192.0;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent; +#ifdef FOG +v_fog_pos=fog_position(a_pos); +#endif +}`),symbolIcon:Qt(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize lowp float opacity +lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_pixeloffset;attribute vec4 a_projected_pos;attribute float a_fade_opacity; +#ifdef PROJECTION_GLOBE_VIEW +attribute vec3 a_globe_anchor;attribute vec3 a_globe_normal; +#endif +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 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 vec3 u_up_vector; +#ifdef PROJECTION_GLOBE_VIEW +uniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix; +#endif +varying vec2 v_tex;varying float v_fade_opacity; +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize lowp float opacity +vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_min_font_scale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[3];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 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos; +#ifdef PROJECTION_GLOBE_VIEW +mercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0; +#else +world_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0; +#endif +vec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ? +camera_to_anchor_distance/u_camera_to_center_distance : +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp( +0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjected_point; +#ifdef PROJECTION_GLOBE_VIEW +vec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetProjected_point=u_matrix*vec4(a_globe_anchor+displacement,1); +#else +offsetProjected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1); +#endif +vec2 a=projected_point.xy/projected_point.w;vec2 b=offsetProjected_point.xy/offsetProjected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos; +#ifdef PROJECTION_GLOBE_VIEW +vec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0); +#else +projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0); +#endif +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);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*max(a_min_font_scale,font_scale)+a_pxoffset/16.0); +#ifdef TERRAIN +#ifdef PITCH_WITH_MAP_TERRAIN +vec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy); +#endif +#endif +float occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade; +#ifdef PROJECTION_GLOBE_VIEW +vec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); +#else +gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); +#endif +float projection_transition_fade=1.0; +#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW) +projection_transition_fade=1.0-step(EPSILON,u_zoom_transition); +#endif +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;v_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change))*projection_transition_fade;}`),symbolSDF:Qt(`#define SDF_PX 8.0 +uniform 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; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +float 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 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); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_pixeloffset;attribute vec4 a_projected_pos;attribute float a_fade_opacity; +#ifdef PROJECTION_GLOBE_VIEW +attribute vec3 a_globe_anchor;attribute vec3 a_globe_normal; +#endif +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_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 vec3 u_up_vector; +#ifdef PROJECTION_GLOBE_VIEW +uniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix; +#endif +varying vec2 v_data0;varying vec3 v_data1; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[3];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 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos; +#ifdef PROJECTION_GLOBE_VIEW +mercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0; +#else +world_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0; +#endif +vec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ? +camera_to_anchor_distance/u_camera_to_center_distance : +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp( +0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetprojected_point; +#ifdef PROJECTION_GLOBE_VIEW +vec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetprojected_point=u_matrix*vec4(a_globe_anchor+displacement,1); +#else +offsetprojected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1); +#endif +vec2 a=projected_point.xy/projected_point.w;vec2 b=offsetprojected_point.xy/offsetprojected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos; +#ifdef PROJECTION_GLOBE_VIEW +vec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0); +#else +projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0); +#endif +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);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset); +#ifdef TERRAIN +#ifdef PITCH_WITH_MAP_TERRAIN +vec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy); +#endif +#endif +float occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade; +#ifdef PROJECTION_GLOBE_VIEW +vec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); +#else +gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); +#endif +float gamma_scale=gl_Position.w;float projection_transition_fade=1.0; +#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW) +projection_transition_fade=1.0-step(EPSILON,u_zoom_transition); +#endif +vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity*projection_transition_fade);}`),symbolTextAndIcon:Qt(`#define SDF_PX 8.0 +#define SDF 1.0 +#define ICON 0.0 +uniform 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; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +float 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; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +return;}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); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_projected_pos;attribute float a_fade_opacity; +#ifdef PROJECTION_GLOBE_VIEW +attribute vec3 a_globe_anchor;attribute vec3 a_globe_normal; +#endif +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_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 vec3 u_up_vector;uniform vec2 u_texsize_icon; +#ifdef PROJECTION_GLOBE_VIEW +uniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix; +#endif +varying vec4 v_data0;varying vec4 v_data1; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[3];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 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos; +#ifdef PROJECTION_GLOBE_VIEW +mercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0; +#else +world_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0; +#endif +vec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ? +camera_to_anchor_distance/u_camera_to_center_distance : +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp( +0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offset_projected_point=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projected_point.xy/projected_point.w;vec2 b=offset_projected_point.xy/offset_projected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos; +#ifdef PROJECTION_GLOBE_VIEW +vec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0); +#else +projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0); +#endif +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);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*font_scale); +#ifdef TERRAIN +#ifdef PITCH_WITH_MAP_TERRAIN +vec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy); +#endif +#endif +float occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade; +#ifdef PROJECTION_GLOBE_VIEW +vec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); +#else +gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); +#endif +float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));float projection_transition_fade=1.0; +#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW) +projection_transition_fade=1.0-step(EPSILON,u_zoom_transition); +#endif +v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity*projection_transition_fade,is_sdf);}`),terrainRaster:Qt(`uniform sampler2D u_image0;varying vec2 v_pos0; +#ifdef FOG +varying float v_fog_opacity; +#endif +#ifdef RENDER_SHADOWS +varying vec4 v_pos_light_view_0;varying vec4 v_pos_light_view_1;varying float v_depth; +#endif +void main() {vec4 color=texture2D(u_image0,v_pos0); +#ifdef RENDER_SHADOWS +color.xyz=shadowed_color(color.xyz,v_pos_light_view_0,v_pos_light_view_1,v_depth); +#endif +#ifdef FOG +#ifdef ZERO_EXAGGERATION +color=fog_dither(fog_apply_premultiplied(color,v_fog_pos)); +#else +color=fog_dither(fog_apply_from_vert(color,v_fog_opacity)); +#endif +#endif +gl_FragColor=color; +#ifdef TERRAIN_WIREFRAME +gl_FragColor=vec4(1.0,0.0,0.0,0.8); +#endif +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform float u_skirt_height;attribute vec2 a_pos;varying vec2 v_pos0; +#ifdef FOG +varying float v_fog_opacity; +#endif +#ifdef RENDER_SHADOWS +uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;varying vec4 v_pos_light_view_0;varying vec4 v_pos_light_view_1;varying float v_depth; +#endif +const float wireframeOffset=0.00015;void main() {vec3 decomposedPosAndSkirt=decomposeToPosAndSkirt(a_pos);float skirt=decomposedPosAndSkirt.z;vec2 decodedPos=decomposedPosAndSkirt.xy;float elevation=elevation(decodedPos)-skirt*u_skirt_height; +#ifdef TERRAIN_WIREFRAME +elevation+=wireframeOffset; +#endif +v_pos0=decodedPos/8192.0;gl_Position=u_matrix*vec4(decodedPos,elevation,1.0); +#ifdef FOG +#ifdef ZERO_EXAGGERATION +v_fog_pos=fog_position(decodedPos); +#else +v_fog_opacity=fog(fog_position(vec3(decodedPos,elevation))); +#endif +#endif +#ifdef RENDER_SHADOWS +vec3 pos=vec3(decodedPos,elevation);v_pos_light_view_0=u_light_matrix_0*vec4(pos,1.);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1.);v_depth=gl_Position.w; +#endif +}`),terrainDepth:Qt(`#ifdef GL_ES +precision highp float; +#endif +varying float v_depth;void main() {gl_FragColor=pack_depth(v_depth);}`,"uniform mat4 u_matrix;attribute vec2 a_pos;varying float v_depth;void main() {float elevation=elevation(a_pos);gl_Position=u_matrix*vec4(a_pos,elevation,1.0);v_depth=gl_Position.z/gl_Position.w;}"),skybox:Qt(` +varying lowp vec3 v_uv;uniform lowp samplerCube u_cubemap;uniform lowp float u_opacity;uniform highp float u_temporal_offset;uniform highp vec3 u_sun_direction;float sun_disk(highp vec3 ray_direction,highp vec3 sun_direction) {highp float cos_angle=dot(normalize(ray_direction),sun_direction);const highp float cos_sun_angular_diameter=0.99996192306;const highp float smoothstep_delta=1e-5;return smoothstep( +cos_sun_angular_diameter-smoothstep_delta,cos_sun_angular_diameter+smoothstep_delta,cos_angle);}float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec3 uv=v_uv;const float y_bias=0.015;uv.y+=y_bias;uv.y=pow(abs(uv.y),1.0/5.0);uv.y=map(uv.y,0.0,1.0,-1.0,1.0);vec3 sky_color=textureCube(u_cubemap,uv).rgb; +#ifdef FOG +sky_color=fog_apply_sky_gradient(v_uv.xzy,sky_color); +#endif +sky_color.rgb=dither(sky_color.rgb,gl_FragCoord.xy+u_temporal_offset);sky_color+=0.1*sun_disk(v_uv,u_sun_direction);gl_FragColor=vec4(sky_color*u_opacity,u_opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,Ps),skyboxGradient:Qt(`varying highp vec3 v_uv;uniform lowp sampler2D u_color_ramp;uniform highp vec3 u_center_direction;uniform lowp float u_radius;uniform lowp float u_opacity;uniform highp float u_temporal_offset;void main() {float progress=acos(dot(normalize(v_uv),u_center_direction))/u_radius;vec4 color=texture2D(u_color_ramp,vec2(progress,0.5)); +#ifdef FOG +color.rgb=fog_apply_sky_gradient(v_uv.xzy,color.rgb/color.a)*color.a; +#endif +color*=u_opacity;color.rgb=dither(color.rgb,gl_FragCoord.xy+u_temporal_offset);gl_FragColor=color; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,Ps),skyboxCapture:Qt(` +varying highp vec3 v_position;uniform highp float u_sun_intensity;uniform highp float u_luminance;uniform lowp vec3 u_sun_direction;uniform highp vec4 u_color_tint_r;uniform highp vec4 u_color_tint_m; +#ifdef GL_ES +precision highp float; +#endif +#define BETA_R vec3(5.5e-6,13.0e-6,22.4e-6) +#define BETA_M vec3(21e-6,21e-6,21e-6) +#define MIE_G 0.76 +#define DENSITY_HEIGHT_SCALE_R 8000.0 +#define DENSITY_HEIGHT_SCALE_M 1200.0 +#define PLANET_RADIUS 6360e3 +#define ATMOSPHERE_RADIUS 6420e3 +#define SAMPLE_STEPS 10 +#define DENSITY_STEPS 4 +float ray_sphere_exit(vec3 orig,vec3 dir,float radius) {float a=dot(dir,dir);float b=2.0*dot(dir,orig);float c=dot(orig,orig)-radius*radius;float d=sqrt(b*b-4.0*a*c);return (-b+d)/(2.0*a);}vec3 extinction(vec2 density) {return exp(-vec3(BETA_R*u_color_tint_r.a*density.x+BETA_M*u_color_tint_m.a*density.y));}vec2 local_density(vec3 point) {float height=max(length(point)-PLANET_RADIUS,0.0);float exp_r=exp(-height/DENSITY_HEIGHT_SCALE_R);float exp_m=exp(-height/DENSITY_HEIGHT_SCALE_M);return vec2(exp_r,exp_m);}float phase_ray(float cos_angle) {return (3.0/(16.0*PI))*(1.0+cos_angle*cos_angle);}float phase_mie(float cos_angle) {return (3.0/(8.0*PI))*((1.0-MIE_G*MIE_G)*(1.0+cos_angle*cos_angle))/((2.0+MIE_G*MIE_G)*pow(1.0+MIE_G*MIE_G-2.0*MIE_G*cos_angle,1.5));}vec2 density_to_atmosphere(vec3 point,vec3 light_dir) {float ray_len=ray_sphere_exit(point,light_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(DENSITY_STEPS);vec2 density_point_to_atmosphere=vec2(0.0);for (int i=0; i < DENSITY_STEPS;++i) {vec3 point_on_ray=point+light_dir*((float(i)+0.5)*step_len);density_point_to_atmosphere+=local_density(point_on_ray)*step_len;;}return density_point_to_atmosphere;}vec3 atmosphere(vec3 ray_dir,vec3 sun_direction,float sun_intensity) {vec2 density_orig_to_point=vec2(0.0);vec3 scatter_r=vec3(0.0);vec3 scatter_m=vec3(0.0);vec3 origin=vec3(0.0,PLANET_RADIUS,0.0);float ray_len=ray_sphere_exit(origin,ray_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(SAMPLE_STEPS);for (int i=0; i < SAMPLE_STEPS;++i) {vec3 point_on_ray=origin+ray_dir*((float(i)+0.5)*step_len);vec2 density=local_density(point_on_ray)*step_len;density_orig_to_point+=density;vec2 density_point_to_atmosphere=density_to_atmosphere(point_on_ray,sun_direction);vec2 density_orig_to_atmosphere=density_orig_to_point+density_point_to_atmosphere;vec3 extinction=extinction(density_orig_to_atmosphere);scatter_r+=density.x*extinction;scatter_m+=density.y*extinction;}float cos_angle=dot(ray_dir,sun_direction);float phase_r=phase_ray(cos_angle);float phase_m=phase_mie(cos_angle);vec3 beta_r=BETA_R*u_color_tint_r.rgb*u_color_tint_r.a;vec3 beta_m=BETA_M*u_color_tint_m.rgb*u_color_tint_m.a;return (scatter_r*phase_r*beta_r+scatter_m*phase_m*beta_m)*sun_intensity;}const float A=0.15;const float B=0.50;const float C=0.10;const float D=0.20;const float E=0.02;const float F=0.30;vec3 uncharted2_tonemap(vec3 x) {return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;}void main() {vec3 ray_direction=v_position;ray_direction.y=pow(ray_direction.y,5.0);const float y_bias=0.015;ray_direction.y+=y_bias;vec3 color=atmosphere(normalize(ray_direction),u_sun_direction,u_sun_intensity);float white_scale=1.0748724675633854;color=uncharted2_tonemap((log2(2.0/pow(u_luminance,4.0)))*color)*white_scale;gl_FragColor=vec4(color,1.0);}`,"attribute highp vec3 a_pos_3f;uniform mat3 u_matrix_3f;varying highp vec3 v_position;float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec4 pos=vec4(u_matrix_3f*a_pos_3f,1.0);v_position=pos.xyz;v_position.y*=-1.0;v_position.y=map(v_position.y,-1.0,1.0,0.0,1.0);gl_Position=vec4(a_pos_3f.xy,0.0,1.0);}"),globeRaster:Qt(`uniform sampler2D u_image0;varying vec2 v_pos0; +#ifndef FOG +uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform vec2 u_viewport; +#endif +void main() {vec4 color; +#ifdef CUSTOM_ANTIALIASING +vec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix( +mix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);vec3 dir=normalize(ray_dir);vec3 closest_point=dot(u_globe_pos,dir)*dir;float norm_dist_from_center=1.0-length(closest_point-u_globe_pos)/u_globe_radius;const float antialias_pixel=2.0;float antialias_factor=antialias_pixel*fwidth(norm_dist_from_center);float antialias=smoothstep(0.0,antialias_factor,norm_dist_from_center);vec4 raster=texture2D(u_image0,v_pos0);color=vec4(raster.rgb*antialias,raster.a*antialias); +#else +color=texture2D(u_image0,v_pos0); +#endif +#ifdef FOG +color=fog_dither(fog_apply_premultiplied(color,v_fog_pos)); +#endif +gl_FragColor=color; +#ifdef TERRAIN_WIREFRAME +gl_FragColor=vec4(1.0,0.0,0.0,0.8); +#endif +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_proj_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform float u_zoom_transition;uniform vec2 u_merc_center;uniform mat3 u_grid_matrix;uniform float u_skirt_height; +#ifdef GLOBE_POLES +attribute vec3 a_globe_pos;attribute vec2 a_uv; +#else +attribute vec2 a_pos; +#endif +varying vec2 v_pos0;const float wireframeOffset=1e3;float mercatorXfromLng(float lng) {return (180.0+lng)/360.0;}float mercatorYfromLat(float lat) {return (180.0-(RAD_TO_DEG*log(tan(QUARTER_PI+lat/2.0*DEG_TO_RAD))))/360.0;}vec3 latLngToECEF(vec2 latLng) {latLng=DEG_TO_RAD*latLng;float cosLat=cos(latLng[0]);float sinLat=sin(latLng[0]);float cosLng=cos(latLng[1]);float sinLng=sin(latLng[1]);float sx=cosLat*sinLng*GLOBE_RADIUS;float sy=-sinLat*GLOBE_RADIUS;float sz=cosLat*cosLng*GLOBE_RADIUS;return vec3(sx,sy,sz);}void main() { +#ifdef GLOBE_POLES +vec3 globe_pos=a_globe_pos;vec2 uv=a_uv; +#else +float tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];vec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float uvY=mercatorY*tiles-idy;float mercatorX=mercatorXfromLng(latLng[1]);float uvX=mercatorX*tiles-idx;vec3 globe_pos=latLngToECEF(latLng.xy);vec2 merc_pos=vec2(mercatorX,mercatorY);vec2 uv=vec2(uvX,uvY); +#endif +v_pos0=uv;vec2 tile_pos=uv*EXTENT;vec3 globe_derived_up_vector=normalize(globe_pos)*u_tile_up_scale; +#ifdef GLOBE_POLES +vec3 up_vector=globe_derived_up_vector; +#else +vec3 up_vector=elevationVector(tile_pos); +#endif +float height=elevation(tile_pos); +#ifdef TERRAIN_WIREFRAME +height+=wireframeOffset; +#endif +globe_pos+=up_vector*height; +#ifndef GLOBE_POLES +globe_pos-=globe_derived_up_vector*u_skirt_height*decomposed_pos_and_skirt.z; +#endif +#ifdef GLOBE_POLES +vec4 interpolated_pos=u_globe_matrix*vec4(globe_pos,1.0); +#else +vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {merc_world_pos=vec4(merc_pos,height-u_skirt_height*decomposed_pos_and_skirt.z,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition),1.0); +#endif +gl_Position=u_proj_matrix*interpolated_pos; +#ifdef FOG +v_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz); +#endif +}`),globeAtmosphere:Qt(`uniform float u_transition;uniform highp float u_fadeout_range;uniform highp float u_temporal_offset;uniform vec3 u_start_color;uniform vec4 u_color;uniform vec4 u_space_color;uniform vec4 u_high_color;uniform float u_star_intensity;uniform float u_star_size;uniform float u_star_density;uniform float u_horizon_angle;uniform mat4 u_rotation_matrix;varying highp vec3 v_ray_dir;varying highp vec3 v_horizon_dir;highp float random(highp vec3 p) {p=fract(p*vec3(23.2342,97.1231,91.2342));p+=dot(p.zxy,p.yxz+123.1234);return fract(p.x*p.y);}float stars(vec3 p,float scale,vec2 offset) {vec2 uv_scale=(u_viewport/u_star_size)*scale;vec3 position=vec3(p.xy*uv_scale+offset*u_viewport,p.z);vec3 q=fract(position)-0.5;vec3 id=floor(position);float random_visibility=step(random(id),u_star_density);float circle=smoothstep(0.5+u_star_intensity,0.5,length(q));return circle*random_visibility;}void main() {highp vec3 dir=normalize(v_ray_dir);float globe_pos_dot_dir; +#ifdef PROJECTION_GLOBE_VIEW +globe_pos_dot_dir=dot(u_globe_pos,dir);highp vec3 closest_point_forward=abs(globe_pos_dot_dir)*dir;float norm_dist_from_center=length(closest_point_forward-u_globe_pos)/u_globe_radius;if (norm_dist_from_center < 0.98) {discard;return;} +#endif +highp vec3 horizon_dir=normalize(v_horizon_dir);float horizon_angle_mercator=dir.y < horizon_dir.y ? +0.0 : max(acos(dot(dir,horizon_dir)),0.0);float horizon_angle; +#ifdef PROJECTION_GLOBE_VIEW +highp vec3 closest_point=globe_pos_dot_dir*dir;float closest_point_to_center=length(closest_point-u_globe_pos);float theta=asin(clamp(closest_point_to_center/length(u_globe_pos),-1.0,1.0));horizon_angle=globe_pos_dot_dir < 0.0 ? +PI-theta-u_horizon_angle : theta-u_horizon_angle;float angle_t=pow(u_transition,10.0);horizon_angle=mix(horizon_angle,horizon_angle_mercator,angle_t); +#else +horizon_angle=horizon_angle_mercator; +#endif +horizon_angle/=PI;float t=exp(-horizon_angle/u_fadeout_range);float alpha_0=u_color.a;float alpha_1=u_high_color.a;float alpha_2=u_space_color.a;vec3 color_stop_0=u_color.rgb;vec3 color_stop_1=u_high_color.rgb;vec3 color_stop_2=u_space_color.rgb;vec3 c0=mix(color_stop_2,color_stop_1,alpha_1);vec3 c1=mix(c0,color_stop_0,alpha_0);vec3 c2=mix(c0,c1,t);vec3 c =mix(color_stop_2,c2,t);float a0=mix(alpha_2,1.0,alpha_1);float a1=mix(a0,1.0,alpha_0);float a2=mix(a0,a1,t);float a =mix(alpha_2,a2,t);vec2 uv=gl_FragCoord.xy/u_viewport-0.5;float aspect_ratio=u_viewport.x/u_viewport.y;vec4 uv_dir=vec4(normalize(vec3(uv.x*aspect_ratio,uv.y,1.0)),1.0);uv_dir=u_rotation_matrix*uv_dir;vec3 n=abs(uv_dir.xyz);vec2 uv_remap=(n.x > n.y && n.x > n.z) ? uv_dir.yz/uv_dir.x: +(n.y > n.x && n.y > n.z) ? uv_dir.zx/uv_dir.y: +uv_dir.xy/uv_dir.z;uv_remap.x/=aspect_ratio;vec3 D=vec3(uv_remap,1.0);highp float star_field=0.0;if (u_star_intensity > 0.0) {star_field+=stars(D,1.2,vec2(0.0,0.0));star_field+=stars(D,1.0,vec2(1.0,0.0));star_field+=stars(D,0.8,vec2(0.0,1.0));star_field+=stars(D,0.6,vec2(1.0,1.0));star_field*=(1.0-pow(t,0.25+(1.0-u_high_color.a)*0.75));c+=star_field*alpha_2;}c=dither(c,gl_FragCoord.xy+u_temporal_offset);gl_FragColor=vec4(c,a);}`,`attribute vec3 a_pos;attribute vec2 a_uv;uniform vec3 u_frustum_tl;uniform vec3 u_frustum_tr;uniform vec3 u_frustum_br;uniform vec3 u_frustum_bl;uniform float u_horizon;varying highp vec3 v_ray_dir;varying highp vec3 v_horizon_dir;void main() {v_ray_dir=mix( +mix(u_frustum_tl,u_frustum_tr,a_uv.x),mix(u_frustum_bl,u_frustum_br,a_uv.x),a_uv.y);v_horizon_dir=mix( +mix(u_frustum_tl,u_frustum_bl,u_horizon),mix(u_frustum_tr,u_frustum_br,u_horizon),a_uv.x);gl_Position=vec4(a_pos,1.0);}`)};function ga(d,o){const c=d.replace(/\s*\/\/[^\n]*\n/g,` +`).split(` +`);for(let f of c)if(f=f.trim(),f[0]==="#"&&f.includes("if")&&!f.includes("endif")){f=f.replace("#","").replace(/ifdef|ifndef|elif|if/g,"").replace(/!|defined|\(|\)|\|\||&&/g,"").replace(/\s+/g," ").trim();const _=f.split(" ");for(const x of _)o.includes(x)||o.push(x)}}function Qt(d,o){const c=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,f=o.match(/attribute (highp |mediump |lowp )?([\w]+) ([\w]+)/g),_={},x=[...Il];return ga(d,x),ga(o,x),{fragmentSource:d=d.replace(c,(T,S,C,z,P)=>(_[P]=!0,S==="define"?` +#ifndef HAS_UNIFORM_u_${P} +varying ${C} ${z} ${P}; +#else +uniform ${C} ${z} u_${P}; +#endif +`:` +#ifdef HAS_UNIFORM_u_${P} + ${C} ${z} ${P} = u_${P}; +#endif +`)),vertexSource:o=o.replace(c,(T,S,C,z,P)=>{const O=z==="float"?"vec2":"vec4",j=P.match(/color/)?"color":O;return _[P]?S==="define"?` +#ifndef HAS_UNIFORM_u_${P} +uniform lowp float u_${P}_t; +attribute ${C} ${O} a_${P}; +varying ${C} ${z} ${P}; +#else +uniform ${C} ${z} u_${P}; +#endif +`:j==="vec4"?` +#ifndef HAS_UNIFORM_u_${P} + ${P} = a_${P}; +#else + ${C} ${z} ${P} = u_${P}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${P} + ${P} = unpack_mix_${j}(a_${P}, u_${P}_t); +#else + ${C} ${z} ${P} = u_${P}; +#endif +`:S==="define"?` +#ifndef HAS_UNIFORM_u_${P} +uniform lowp float u_${P}_t; +attribute ${C} ${O} a_${P}; +#else +uniform ${C} ${z} u_${P}; +#endif +`:j==="vec4"?` +#ifndef HAS_UNIFORM_u_${P} + ${C} ${z} ${P} = a_${P}; +#else + ${C} ${z} ${P} = u_${P}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${P} + ${C} ${z} ${P} = unpack_mix_${j}(a_${P}, u_${P}_t); +#else + ${C} ${z} ${P} = u_${P}; +#endif +`}),staticAttributes:f,usedDefines:x}}class W_{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffers=[],this.vao=null}bind(o,c,f,_,x,T,S){this.context=o;let C=this.boundPaintVertexBuffers.length!==_.length;for(let P=0;!C&&P<_.length;P++)this.boundPaintVertexBuffers[P]!==_[P]&&(C=!0);let z=this.boundDynamicVertexBuffers.length!==S.length;for(let P=0;!z&&P{const Q=B.paint.get("hillshade-shadow-color"),ee=B.paint.get("hillshade-highlight-color"),de=B.paint.get("hillshade-accent-color");let fe=B.paint.get("hillshade-illumination-direction")*(Math.PI/180);B.paint.get("hillshade-illumination-anchor")==="viewport"&&(fe-=Z.transform.angle);const pe=!Z.options.moving;return{u_matrix:q||Z.transform.calculateProjMatrix(X.tileID.toUnwrapped(),pe),u_image:0,u_latrange:Oh(0,X.tileID),u_light:[B.paint.get("hillshade-exaggeration"),fe],u_shadow:Q,u_highlight:ee,u_accent:de}})(d,c,f,d.terrain?o.projMatrix:null);d.prepareDrawProgram(S,P,o.toUnwrapped());const{tileBoundsBuffer:j,tileBoundsIndexBuffer:W,tileBoundsSegments:H}=d.getTileBoundsBuffers(c);P.draw(S,C.TRIANGLES,_,x,T,s.CullFaceMode.disabled,O,f.id,j,W,H)}function Bh(d,o,c){if(!o.needsDEMTextureUpload)return;const f=d.context,_=f.gl;f.pixelStoreUnpackPremultiplyAlpha.set(!1),o.demTexture=o.demTexture||d.getTileTexture(c.stride);const x=c.getPixels();o.demTexture?o.demTexture.update(x,{premultiply:!1}):o.demTexture=new s.Texture(f,x,_.RGBA,{premultiply:!1}),o.needsDEMTextureUpload=!1}function gf(d,o,c,f,_,x){const T=d.context,S=T.gl;if(!o.dem)return;const C=o.dem;if(T.activeTexture.set(S.TEXTURE1),Bh(d,o,C),!o.demTexture)return;o.demTexture.bind(S.NEAREST,S.CLAMP_TO_EDGE);const z=C.dim;T.activeTexture.set(S.TEXTURE0);let P=o.fbo;if(!P){const H=new s.Texture(T,{width:z,height:z,data:null},S.RGBA);H.bind(S.LINEAR,S.CLAMP_TO_EDGE),P=o.fbo=T.createFramebuffer(z,z,!0),P.colorAttachment.set(H.texture)}T.bindFramebuffer.set(P.framebuffer),T.viewport.set([0,0,z,z]);const{tileBoundsBuffer:O,tileBoundsIndexBuffer:j,tileBoundsSegments:W}=d.getMercatorTileBoundsBuffers();d.useProgram("hillshadePrepare").draw(T,S.TRIANGLES,f,_,x,s.CullFaceMode.disabled,((H,Z)=>{const X=Z.stride,B=s.create();return s.ortho(B,0,s.EXTENT,-s.EXTENT,0,0,1),s.translate(B,B,[0,-s.EXTENT,0]),{u_matrix:B,u_image:1,u_dimension:[X,X],u_zoom:H.overscaledZ,u_unpack:Z.unpackVector}})(o.tileID,C),c.id,O,j,W),o.needsHillshadePrepare=!1}const Fh=d=>({u_matrix:new s.UniformMatrix4f(d),u_image0:new s.Uniform1i(d),u_skirt_height:new s.Uniform1f(d)}),_a=(d,o)=>({u_matrix:d,u_image0:0,u_skirt_height:o}),Lc=(d,o,c,f,_,x,T,S,C,z,P,O,j,W,H)=>({u_proj_matrix:Float32Array.from(d),u_globe_matrix:o,u_normalize_matrix:Float32Array.from(f),u_merc_matrix:c,u_zoom_transition:_,u_merc_center:x,u_image0:0,u_frustum_tl:T,u_frustum_tr:S,u_frustum_br:C,u_frustum_bl:z,u_globe_pos:P,u_globe_radius:O,u_viewport:j,u_grid_matrix:H?Float32Array.from(H):new Float32Array(9),u_skirt_height:W});function ya(d,o){return d!=null&&o!=null&&!(!d.hasData()||!o.hasData())&&d.demTexture!=null&&o.demTexture!=null&&d.tileID.key!==o.tileID.key}const Co=new class{constructor(){this.operations={}}newMorphing(d,o,c,f,_){if(d in this.operations){const x=this.operations[d];x.to.tileID.key!==c.tileID.key&&(x.queued=c)}else this.operations[d]={startTime:f,phase:0,duration:_,from:o,to:c,queued:null}}getMorphValuesForProxy(d){if(!(d in this.operations))return null;const o=this.operations[d];return{from:o.from,to:o.to,phase:o.phase}}update(d){for(const o in this.operations){const c=this.operations[o];for(c.phase=(d-c.startTime)/c.duration;c.phase>=1||!this._validOp(c);)if(!this._nextOp(c,d)){delete this.operations[o];break}}}_nextOp(d,o){return!!d.queued&&(d.from=d.to,d.to=d.queued,d.queued=null,d.phase=0,d.startTime=o,!0)}_validOp(d){return d.from.hasData()&&d.to.hasData()}},zs={0:null,1:"TERRAIN_VERTEX_MORPHING",2:"TERRAIN_WIREFRAME"};function Rc(d){return 6*Math.pow(1.5,22-d)}function _f(d,o){const c=1<({u_matrix:d});function Nh(d,o,c,f,_){if(_>0){const x=s.exported.now(),T=(x-d.timeAdded)/_,S=o?(x-o.timeAdded)/_:-1,C=c.getSource(),z=f.coveringZoomLevel({tileSize:C.tileSize,roundZoom:C.roundZoom}),P=!o||Math.abs(o.tileID.overscaledZ-z)>Math.abs(d.tileID.overscaledZ-z),O=P&&d.refreshedUponExpiration?1:s.clamp(P?T:1-S,0,1);return d.refreshedUponExpiration&&T>=1&&(d.refreshedUponExpiration=!1),o?{opacity:1,mix:1-O}:{opacity:O,mix:0}}return{opacity:1,mix:0}}class Uh extends s.SourceCache{constructor(o){const c={type:"raster-dem",maxzoom:o.transform.maxZoom},f=new xt(ha(),null),_=Dt("mock-dem",c,f,o.style);super("mock-dem",_,!1),_.setEventedParent(this),this._sourceLoaded=!0}_loadTile(o,c){o.state="loaded",c(null)}}class Dc extends s.SourceCache{constructor(o){const c=Dt("proxy",{type:"geojson",maxzoom:o.transform.maxZoom},new xt(ha(),null),o.style);super("proxy",c,!1),c.setEventedParent(this),this.map=this.getSource().map=o,this.used=this._sourceLoaded=!0,this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}update(o,c,f){if(o.freezeTileCoverage)return;this.transform=o;const _=o.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}).reduce((x,T)=>{if(x[T.key]="",!this._tiles[T.key]){const S=new s.Tile(T,this._source.tileSize*T.overscaleFactor(),o.tileZoom);S.state="loaded",this._tiles[T.key]=S}return x},{});for(const x in this._tiles)x in _||(this.freeFBO(x),this._tiles[x].unloadVectorData(),delete this._tiles[x])}freeFBO(o){const c=this.proxyCachedFBO[o];if(c!==void 0){const f=Object.values(c);this.renderCachePool.push(...f),delete this.proxyCachedFBO[o]}}deallocRenderCache(){this.renderCache.forEach(o=>o.fb.destroy()),this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}}class Oc extends s.OverscaledTileID{constructor(o,c,f){super(o.overscaledZ,o.wrap,o.canonical.z,o.canonical.x,o.canonical.y),this.proxyTileKey=c,this.projMatrix=f}}class jh extends s.Elevation{constructor(o,c){super(),this.painter=o,this.terrainTileForTile={},this.prevTerrainTileForTile={};const[f,_,x]=function(C){const z=new s.StructArrayLayout2i4,P=new s.StructArrayLayout3ui6,O=131;z.reserve(17161),P.reserve(33800);const j=s.EXTENT/128,W=s.EXTENT+j/2,H=W+j;for(let X=-j;XW||X<0||X>W?24575:0,Q=s.clamp(Math.round(B),0,s.EXTENT),ee=s.clamp(Math.round(X),0,s.EXTENT);z.emplaceBack(Q+q,ee)}const Z=(X,B)=>{const q=B*O+X;P.emplaceBack(q+1,q,q+O),P.emplaceBack(q+O,q+O+1,q+1)};for(let X=1;X<129;X++)for(let B=1;B<129;B++)Z(B,X);return[0,129].forEach(X=>{for(let B=0;B<130;B++)Z(B,X),Z(X,B)}),[z,P,32768]}(),T=o.context;this.gridBuffer=T.createVertexBuffer(f,s.posAttributes.members),this.gridIndexBuffer=T.createIndexBuffer(_),this.gridSegments=s.SegmentVector.simpleSegment(0,0,f.length,_.length),this.gridNoSkirtSegments=s.SegmentVector.simpleSegment(0,0,f.length,x),this.proxyCoords=[],this.proxiedCoords={},this._visibleDemTiles=[],this._drapedRenderBatches=[],this._sourceTilesOverlap={},this.proxySourceCache=new Dc(c.map),this.orthoMatrix=s.create(),s.ortho(this.orthoMatrix,this.painter.transform.projection.name==="globe"?.015:0,s.EXTENT,0,s.EXTENT,0,1);const S=T.gl;this._overlapStencilMode=new s.StencilMode({func:S.GEQUAL,mask:255},0,255,S.KEEP,S.KEEP,S.REPLACE),this._previousZoom=o.transform.zoom,this.pool=[],this._findCoveringTileCache={},this._tilesDirty={},this.style=c,this._useVertexMorphing=!0,this._exaggeration=1,this._mockSourceCache=new Uh(c.map)}set style(o){o.on("data",this._onStyleDataEvent.bind(this)),o.on("neworder",this._checkRenderCacheEfficiency.bind(this)),this._style=o,this._checkRenderCacheEfficiency(),this._style.map.on("moveend",()=>{this._clearLineLayersFromRenderCache()})}update(o,c,f){if(o&&o.terrain){this._style!==o&&(this.style=o),this.enabled=!0;const _=o.terrain.properties;this.sourceCache=o.terrain.drapeRenderMode===0?this._mockSourceCache:o._getSourceCache(_.get("source")),this._exaggeration=_.get("exaggeration");const x=()=>{this.sourceCache.used&&s.warnOnce(`Raster DEM source '${this.sourceCache.id}' is used both for terrain and as layer source. +This leads to lower resolution of hillshade. For full hillshade resolution but higher memory consumption, define another raster DEM source.`);const T=this.getScaledDemTileSize();this.sourceCache.update(c,T,!0),this.resetTileLookupCache(this.sourceCache.id)};this.sourceCache.usedForTerrain||(this.resetTileLookupCache(this.sourceCache.id),this.sourceCache.usedForTerrain=!0,x(),this._initializing=!0),x(),c.updateElevation(!0,f),this.resetTileLookupCache(this.proxySourceCache.id),this.proxySourceCache.update(c),this._emptyDEMTextureDirty=!0}else this._disable()}resetTileLookupCache(o){this._findCoveringTileCache[o]={}}getScaledDemTileSize(){return this.sourceCache.getSource().tileSize/128*this.proxySourceCache.getSource().tileSize}_checkRenderCacheEfficiency(){const o=this.renderCacheEfficiency(this._style);this._style.map._optimizeForTerrain||o.efficiency!==100&&s.warnOnce(`Terrain render cache efficiency is not optimal (${o.efficiency}%) and performance + may be affected negatively, consider placing all background, fill and line layers before layer + with id '${o.firstUndrapedLayer}' or create a map using optimizeForTerrain: true option.`)}_onStyleDataEvent(o){o.coord&&o.dataType==="source"?this._clearRenderCacheForTile(o.sourceCacheId,o.coord):o.dataType==="style"&&(this._invalidateRenderCache=!0)}_disable(){if(this.enabled&&(this.enabled=!1,this._sharedDepthStencil=void 0,this.proxySourceCache.deallocRenderCache(),this._style))for(const o in this._style._sourceCaches)this._style._sourceCaches[o].usedForTerrain=!1}destroy(){this._disable(),this._emptyDEMTexture&&this._emptyDEMTexture.destroy(),this._emptyDepthBufferTexture&&this._emptyDepthBufferTexture.destroy(),this.pool.forEach(o=>o.fb.destroy()),this.pool=[],this._depthFBO&&(this._depthFBO.destroy(),this._depthFBO=void 0,this._depthTexture=void 0)}_source(){return this.enabled?this.sourceCache:null}isUsingMockSource(){return this.sourceCache===this._mockSourceCache}exaggeration(){return this._exaggeration}get visibleDemTiles(){return this._visibleDemTiles}get drapeBufferSize(){const o=2*this.proxySourceCache.getSource().tileSize;return[o,o]}set useVertexMorphing(o){this._useVertexMorphing=o}updateTileBinding(o){if(!this.enabled)return;this.prevTerrainTileForTile=this.terrainTileForTile;const c=this.proxySourceCache,f=this.painter.transform;this._initializing&&(this._initializing=f._centerAltitude===0&&this.getAtPointOrZero(s.MercatorCoordinate.fromLngLat(f.center),-1)===-1,this._emptyDEMTextureDirty=!this._initializing);const _=this.proxyCoords=c.getIds().map(C=>{const z=c.getTileByID(C).tileID;return z.projMatrix=f.calculateProjMatrix(z.toUnwrapped()),z});(function(C,z){const P=z.transform.pointCoordinate(z.transform.getCameraPoint()),O=new s.Point(P.x,P.y);C.sort((j,W)=>{if(W.overscaledZ-j.overscaledZ)return W.overscaledZ-j.overscaledZ;const H=new s.Point(j.canonical.x+(1<{this.proxyToSource[C.key]={}}),this.terrainTileForTile={};const T=this._style._sourceCaches;for(const C in T){const z=T[C];if(!z.used||(z!==this.sourceCache&&this.resetTileLookupCache(z.id),this._setupProxiedCoordsForOrtho(z,o[C],x),z.usedForTerrain))continue;const P=o[C];z.getSource().reparseOverscaled&&this._assignTerrainTiles(P)}this.proxiedCoords[c.id]=_.map(C=>new Oc(C,C.key,this.orthoMatrix)),this._assignTerrainTiles(_),this._prepareDEMTextures(),this._setupDrapedRenderBatches(),this._initFBOPool(),this._setupRenderCache(x),this.renderingToTexture=!1,this._updateTimestamp=s.exported.now();const S={};this._visibleDemTiles=[];for(const C of this.proxyCoords){const z=this.terrainTileForTile[C.key];if(!z)continue;const P=z.tileID.key;P in S||(this._visibleDemTiles.push(z),S[P]=P)}}_assignTerrainTiles(o){this._initializing||o.forEach(c=>{if(this.terrainTileForTile[c.key])return;const f=this._findTileCoveringTileID(c,this.sourceCache);f&&(this.terrainTileForTile[c.key]=f)})}_prepareDEMTextures(){const o=this.painter.context,c=o.gl;for(const f in this.terrainTileForTile){const _=this.terrainTileForTile[f],x=_.dem;!x||_.demTexture&&!_.needsDEMTextureUpload||(o.activeTexture.set(c.TEXTURE1),Bh(this.painter,_,x))}}_prepareDemTileUniforms(o,c,f,_){if(!c||c.demTexture==null)return!1;const x=o.tileID.canonical,T=Math.pow(2,c.tileID.canonical.z-x.z),S=_||"";return f[`u_dem_tl${S}`]=[x.x*T%1,x.y*T%1],f[`u_dem_scale${S}`]=T,!0}get emptyDEMTexture(){return!this._emptyDEMTextureDirty&&this._emptyDEMTexture?this._emptyDEMTexture:this._updateEmptyDEMTexture()}get emptyDepthBufferTexture(){const o=this.painter.context,c=o.gl;if(!this._emptyDepthBufferTexture){const f=new s.RGBAImage({width:1,height:1},Uint8Array.of(255,255,255,255));this._emptyDepthBufferTexture=new s.Texture(o,f,c.RGBA,{premultiply:!1})}return this._emptyDepthBufferTexture}_getLoadedAreaMinimum(){let o=0;const c=this._visibleDemTiles.reduce((f,_)=>{if(!_.dem)return f;const x=_.dem.tree.minimums[0];return x>0&&o++,f+x},0);return o?c/o:0}_updateEmptyDEMTexture(){const o=this.painter.context,c=o.gl;o.activeTexture.set(c.TEXTURE2);const f=this._getLoadedAreaMinimum(),_=new s.RGBAImage({width:1,height:1},new Uint8Array(s.DEMData.pack(f,this.sourceCache.getSource().encoding)));this._emptyDEMTextureDirty=!1;let x=this._emptyDEMTexture;return x?x.update(_,{premultiply:!1}):x=this._emptyDEMTexture=new s.Texture(o,_,c.RGBA,{premultiply:!1}),x}setupElevationDraw(o,c,f){const _=this.painter.context,x=_.gl,T=(S=this.sourceCache.getSource().encoding,{u_dem:2,u_dem_prev:4,u_dem_unpack:s.DEMData.getUnpackVector(S),u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_exaggeration:0});var S;T.u_dem_size=this.sourceCache.getSource().tileSize,T.u_exaggeration=this.exaggeration();let C=null,z=null,P=1;if(f&&f.morphing&&this._useVertexMorphing){const O=f.morphing.srcDemTile,j=f.morphing.dstDemTile;P=f.morphing.phase,O&&j&&(this._prepareDemTileUniforms(o,O,T,"_prev")&&(z=O),this._prepareDemTileUniforms(o,j,T)&&(C=j))}if(z&&C?(_.activeTexture.set(x.TEXTURE2),C.demTexture.bind(x.NEAREST,x.CLAMP_TO_EDGE,x.NEAREST),_.activeTexture.set(x.TEXTURE4),z.demTexture.bind(x.NEAREST,x.CLAMP_TO_EDGE,x.NEAREST),T.u_dem_lerp=P):(C=this.terrainTileForTile[o.tileID.key],_.activeTexture.set(x.TEXTURE2),(this._prepareDemTileUniforms(o,C,T)?C.demTexture:this.emptyDEMTexture).bind(x.NEAREST,x.CLAMP_TO_EDGE)),_.activeTexture.set(x.TEXTURE3),f&&f.useDepthForOcclusion?(this._depthTexture&&this._depthTexture.bind(x.NEAREST,x.CLAMP_TO_EDGE),this._depthFBO&&(T.u_depth_size_inv=[1/this._depthFBO.width,1/this._depthFBO.height])):(this.emptyDepthBufferTexture.bind(x.NEAREST,x.CLAMP_TO_EDGE),T.u_depth_size_inv=[1,1]),f&&f.useMeterToDem&&C){const O=(1<{if(B===qe)return;const Be=[zs[qe],"PROJECTION_GLOBE_VIEW"];ee&&Be.push("CUSTOM_ANTIALIASING"),Se&&Be.push(zs[q]),X=z.useProgram("globeRaster",null,Be),B=qe},fe=z.colorModeForRenderPass(),pe=new s.DepthMode(Z.LEQUAL,s.DepthMode.ReadWrite,z.depthRangeFor3D);Co.update(W);const xe=s.calculateGlobeMercatorMatrix(Q),ye=[s.mercatorXfromLng(Q.center.lng),s.mercatorYfromLat(Q.center.lat)],Ae=q?[!1,!0]:[!1],We=z.globeSharedBuffers,Ee=[Q.width*s.exported.devicePixelRatio,Q.height*s.exported.devicePixelRatio],Fe=Float32Array.from(Q.globeMatrix),ke={useDenormalizedUpVectorScale:!0};if(Ae.forEach(qe=>{const Se=z.transform,Be=Rc(Se.zoom)*P.exaggeration();B=-1;const Xe=qe?Z.LINES:Z.TRIANGLES;for(const $e of j){const Ye=O.getTile($e),gt=s.StencilMode.disabled,Et=P.prevTerrainTileForTile[$e.key],pt=P.terrainTileForTile[$e.key];ya(Et,pt)&&Co.newMorphing($e.key,Et,pt,W,250),H.activeTexture.set(Z.TEXTURE0),Ye.texture.bind(Z.LINEAR,Z.CLAMP_TO_EDGE);const wt=Co.getMorphValuesForProxy($e.key),Ut=wt?1:0;wt&&s.extend$1(ke,{morphing:{srcDemTile:wt.from,dstDemTile:wt.to,phase:s.easeCubicInOut(wt.phase)}});const Ot=s.tileCornersToBounds($e.canonical),mt=s.getLatitudinalLod(Ot.getCenter().lat),en=s.getGridMatrix($e.canonical,Ot,mt,Se.worldSize/Se._pixelsPerMercatorPixel),rn=s.globeNormalizeECEF(s.globeTileBounds($e.canonical)),on=Lc(Se.projMatrix,Fe,xe,rn,s.globeToMercatorTransition(Se.zoom),ye,Se.frustumCorners.TL,Se.frustumCorners.TR,Se.frustumCorners.BR,Se.frustumCorners.BL,Se.globeCenterInViewSpace,Se.globeRadius,Ee,Be,en);if(de(Ut,qe),P.setupElevationDraw(Ye,X,ke),z.prepareDrawProgram(H,X,$e.toUnwrapped()),We){const[sn,Mr,fr]=qe?We.getWirefameBuffers(z.context,mt):We.getGridBuffers(mt,Be!==0);X.draw(H,Xe,pe,gt,fe,s.CullFaceMode.backCCW,on,"globe_raster",sn,Mr,fr)}}}),We){const qe=["GLOBE_POLES","PROJECTION_GLOBE_VIEW"];ee&&qe.push("CUSTOM_ANTIALIASING"),X=z.useProgram("globeRaster",null,qe);for(const Se of j){const{x:Be,y:Xe,z:$e}=Se.canonical,Ye=Xe===0,gt=Xe===(1<<$e)-1,[Et,pt,wt,Ut]=We.getPoleBuffers($e);if(Ut&&(Ye||gt)){const Ot=O.getTile(Se);H.activeTexture.set(Z.TEXTURE0),Ot.texture.bind(Z.LINEAR,Z.CLAMP_TO_EDGE);let mt=s.globePoleMatrixForTile($e,Be,Q);const en=s.globeNormalizeECEF(s.globeTileBounds(Se.canonical)),rn=(on,sn)=>on.draw(H,Z.TRIANGLES,pe,s.StencilMode.disabled,fe,s.CullFaceMode.disabled,Lc(Q.projMatrix,mt,mt,en,0,ye,Q.frustumCorners.TL,Q.frustumCorners.TR,Q.frustumCorners.BR,Q.frustumCorners.BL,Q.globeCenterInViewSpace,Q.globeRadius,Ee,0),"globe_pole_raster",sn,wt,Ut);P.setupElevationDraw(Ot,X,ke),z.prepareDrawProgram(H,X,Se.toUnwrapped()),Ye&&rn(X,Et),gt&&(mt=s.scale(s.create(),mt,[1,-1,1]),rn(X,pt))}}}})(_,x,T,S,C);else{const z=_.context,P=z.gl;let O,j;const W=_.options.showTerrainWireframe?2:0,H=(Q,ee)=>{if(j===Q)return;const de=[zs[Q]];ee&&de.push(zs[W]),O=_.useProgram("terrainRaster",null,de),j=Q},Z=_.colorModeForRenderPass(),X=new s.DepthMode(P.LEQUAL,s.DepthMode.ReadWrite,_.depthRangeFor3D);Co.update(C);const B=_.transform,q=Rc(B.zoom)*x.exaggeration();(W?[!1,!0]:[!1]).forEach(Q=>{j=-1;const ee=Q?P.LINES:P.TRIANGLES,[de,fe]=Q?x.getWirefameBuffer():[x.gridIndexBuffer,x.gridSegments];for(const pe of S){const xe=T.getTile(pe),ye=s.StencilMode.disabled,Ae=x.prevTerrainTileForTile[pe.key],We=x.terrainTileForTile[pe.key];ya(Ae,We)&&Co.newMorphing(pe.key,Ae,We,C,250),z.activeTexture.set(P.TEXTURE0),xe.texture.bind(P.LINEAR,P.CLAMP_TO_EDGE,P.LINEAR_MIPMAP_NEAREST);const Ee=Co.getMorphValuesForProxy(pe.key),Fe=Ee?1:0;let ke;Ee&&(ke={morphing:{srcDemTile:Ee.from,dstDemTile:Ee.to,phase:s.easeCubicInOut(Ee.phase)}});const qe=_a(pe.projMatrix,_f(pe.canonical,B.renderWorldCopies)?q/10:q);H(Fe,Q),x.setupElevationDraw(xe,O,ke),_.prepareDrawProgram(z,O,pe.toUnwrapped()),O.draw(z,ee,X,ye,Z,s.CullFaceMode.backCCW,qe,"terrain_raster",x.gridBuffer,de,fe)}})}}(c,this,this.proxySourceCache,o,this._updateTimestamp),this.renderingToTexture=!0,c.gpuTimingDeferredRenderEnd(),o.splice(0,o.length))}renderBatch(o){if(this._drapedRenderBatches.length===0)return o+1;this.renderingToTexture=!0;const c=this.painter,f=this.painter.context,_=this.proxySourceCache,x=this.proxiedCoords[_.id],T=this._drapedRenderBatches.shift(),S=[],C=c.style.order;let z=0;for(const P of x){const O=_.getTileByID(P.proxyTileKey),j=_.proxyCachedFBO[P.key]?_.proxyCachedFBO[P.key][o]:void 0,W=j!==void 0?_.renderCache[j]:this.pool[z++],H=j!==void 0;if(O.texture=W.tex,H&&!W.dirty){S.push(O.tileID);continue}let Z;f.bindFramebuffer.set(W.fb.framebuffer),this.renderedToTile=!1,W.dirty&&(f.clear({color:s.Color.transparent,stencil:0}),W.dirty=!1);for(let X=T.start;X<=T.end;++X){const B=c.style._layers[C[X]];if(B.isHidden(c.transform.zoom))continue;const q=c.style._getLayerSourceCache(B),Q=q?this.proxyToSource[P.key][q.id]:[P];if(!Q)continue;const ee=Q;f.viewport.set([0,0,W.fb.width,W.fb.height]),Z!==(q?q.id:null)&&(this._setupStencil(W,Q,B,q),Z=q?q.id:null),c.renderLayer(c,q,B,ee)}this.renderedToTile?(W.dirty=!0,S.push(O.tileID)):H||--z,z===5&&(z=0,this.renderToBackBuffer(S))}return this.renderToBackBuffer(S),this.renderingToTexture=!1,f.bindFramebuffer.set(null),f.viewport.set([0,0,c.width,c.height]),T.end+1}postRender(){}renderCacheEfficiency(o){const c=o.order.length;if(c===0)return{efficiency:100};let f,_=0,x=0,T=!1;for(let S=0;Sc.dem).forEach(c=>{o=Math.min(o,c.dem.tree.minimums[0])}),o===0?o:(o-30)*this._exaggeration}raycast(o,c,f){if(!this._visibleDemTiles)return null;const _=this._visibleDemTiles.filter(x=>x.dem).map(x=>{const T=x.tileID,S=1<(x.t!==null?x.t:Number.MAX_VALUE)-(T.t!==null?T.t:Number.MAX_VALUE));for(const x of _){if(x.t==null)return null;const T=x.tile.dem.tree.raycast(x.minx,x.miny,x.maxx,x.maxy,o,c,f);if(T!=null)return T}return null}_createFBO(){const o=this.painter.context,c=o.gl,f=this.drapeBufferSize;o.activeTexture.set(c.TEXTURE0);const _=new s.Texture(o,{width:f[0],height:f[1],data:null},c.RGBA);_.bind(c.LINEAR,c.CLAMP_TO_EDGE);const x=o.createFramebuffer(f[0],f[1],!1);return x.colorAttachment.set(_.texture),x.depthAttachment=new ge(o,x.framebuffer),this._sharedDepthStencil===void 0?(this._sharedDepthStencil=o.createRenderbuffer(o.gl.DEPTH_STENCIL,f[0],f[1]),this._stencilRef=0,x.depthAttachment.set(this._sharedDepthStencil),o.clear({stencil:0})):x.depthAttachment.set(this._sharedDepthStencil),o.extTextureFilterAnisotropic&&!o.extTextureFilterAnisotropicForceOff&&c.texParameterf(c.TEXTURE_2D,o.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,o.extTextureFilterAnisotropicMax),{fb:x,tex:_,dirty:!1}}_initFBOPool(){for(;this.pool.length{const c=this._style._layers[o],f=c.isHidden(this.painter.transform.zoom);return c.type==="custom"?!f&&c.shouldRedrape():!f&&c.hasTransition()})}_clearLineLayersFromRenderCache(){let o=!1;for(const f of this._style._getSources())if(f instanceof rt){o=!0;break}if(!o)return;const c={};for(let f=0;fc.renderCachePool.length){const T=Object.values(c.proxyCachedFBO);c.proxyCachedFBO={};for(let S=0;S=0;T--){const S=f[T];if(c.getTileByID(S.key),c.proxyCachedFBO[S.key]!==void 0){const C=o[S.key],z=this.proxyToSource[S.key];let P=0;for(const O in z){const j=z[O],W=C[O];if(!W||W.length!==j.length||j.some((H,Z)=>H!==W[Z]||_[O]&&_[O].hasOwnProperty(H.key))){P=-1;break}++P}for(const O in c.proxyCachedFBO[S.key])c.renderCache[c.proxyCachedFBO[S.key][O]].dirty=P<0||P!==Object.values(C).length}}const x=[...this._drapedRenderBatches];x.sort((T,S)=>S.end-S.start-(T.end-T.start));for(const T of x)for(const S of f){if(c.proxyCachedFBO[S.key])continue;let C=c.renderCachePool.pop();C===void 0&&c.renderCache.length<50&&(C=c.renderCache.length,c.renderCache.push(this._createFBO())),C!==void 0&&(c.proxyCachedFBO[S.key]={},c.proxyCachedFBO[S.key][T.start]=C,c.renderCache[C].dirty=!0)}this._tilesDirty={}}_setupStencil(o,c,f,_){if(!_||!this._sourceTilesOverlap[_.id])return void(this._overlapStencilType&&(this._overlapStencilType=!1));const x=this.painter.context,T=x.gl;if(c.length<=1)return void(this._overlapStencilType=!1);let S;if(f.isTileClipped())S=c.length,this._overlapStencilMode.test={func:T.EQUAL,mask:255},this._overlapStencilType="Clip";else{if(!(c[0].overscaledZ>c[c.length-1].overscaledZ))return void(this._overlapStencilType=!1);S=1,this._overlapStencilMode.test={func:T.GREATER,mask:255},this._overlapStencilType="Mask"}this._stencilRef+S>255&&(x.clear({stencil:0}),this._stencilRef=0),this._stencilRef+=S,this._overlapStencilMode.ref=this._stencilRef,f.isTileClipped()&&this._renderTileClippingMasks(c,this._overlapStencilMode.ref)}clipOrMaskOverlapStencilType(){return this._overlapStencilType==="Clip"||this._overlapStencilType==="Mask"}stencilModeForRTTOverlap(o){return this.renderingToTexture&&this._overlapStencilType?(this._overlapStencilType==="Clip"&&(this._overlapStencilMode.ref=this.painter._tileClippingMaskIDs[o.key]),this._overlapStencilMode):s.StencilMode.disabled}_renderTileClippingMasks(o,c){const f=this.painter,_=this.painter.context,x=_.gl;f._tileClippingMaskIDs={},_.setColorMode(s.ColorMode.disabled),_.setDepthMode(s.DepthMode.disabled);const T=f.useProgram("clippingMask");for(const S of o){const C=f._tileClippingMaskIDs[S.key]=--c;T.draw(_,x.TRIANGLES,s.DepthMode.disabled,new s.StencilMode({func:x.ALWAYS,mask:0},C,255,x.KEEP,x.KEEP,x.REPLACE),s.ColorMode.disabled,s.CullFaceMode.disabled,kl(S.projMatrix),"$clipping",f.tileExtentBuffer,f.quadTriangleIndexBuffer,f.tileExtentSegments)}}pointCoordinate(o){const c=this.painter.transform;if(o.x<0||o.x>c.width||o.y<0||o.y>c.height)return null;const f=[o.x,o.y,1,1];s.transformMat4$1(f,f,c.pixelMatrixInverse),s.scale$1(f,f,1/f[3]),f[0]/=c.worldSize,f[1]/=c.worldSize;const _=c._camera.position,x=s.mercatorZfromAltitude(1,c.center.lat),T=[_[0],_[1],_[2]/x,0],S=s.subtract([],f.slice(0,3),T);s.normalize(S,S);const C=this.raycast(T,S,this._exaggeration);return C!==null&&C?(s.scaleAndAdd(T,T,S,C),T[3]=T[2],T[2]*=x,T):null}drawDepth(){const o=this.painter,c=o.context,f=this.proxySourceCache,_=Math.ceil(o.width),x=Math.ceil(o.height);if(!this._depthFBO||this._depthFBO.width===_&&this._depthFBO.height===x||(this._depthFBO.destroy(),this._depthFBO=void 0,this._depthTexture=void 0),!this._depthFBO){const T=c.gl,S=c.createFramebuffer(_,x,!0);c.activeTexture.set(T.TEXTURE0);const C=new s.Texture(c,{width:_,height:x,data:null},T.RGBA);C.bind(T.NEAREST,T.CLAMP_TO_EDGE),S.colorAttachment.set(C.texture);const z=c.createRenderbuffer(c.gl.DEPTH_COMPONENT16,_,x);S.depthAttachment.set(z),this._depthFBO=S,this._depthTexture=C}c.bindFramebuffer.set(this._depthFBO.framebuffer),c.viewport.set([0,0,_,x]),function(T,S,C,z){if(T.transform.projection.name==="globe")return;const P=T.context,O=P.gl;P.clear({depth:1});const j=T.useProgram("terrainDepth"),W=new s.DepthMode(O.LESS,s.DepthMode.ReadWrite,T.depthRangeFor3D);for(const H of z){const Z=C.getTile(H),X=_a(H.projMatrix,0);S.setupElevationDraw(Z,j),j.draw(P,O.TRIANGLES,W,s.StencilMode.disabled,s.ColorMode.unblended,s.CullFaceMode.backCCW,X,"terrain_depth",S.gridBuffer,S.gridIndexBuffer,S.gridNoSkirtSegments)}}(o,this,f,this.proxyCoords)}_setupProxiedCoordsForOrtho(o,c,f){if(o.getSource()instanceof Rt)return this._setupProxiedCoordsForImageSource(o,c,f);this._findCoveringTileCache[o.id]=this._findCoveringTileCache[o.id]||{};const _=this.proxiedCoords[o.id]=[],x=this.proxyCoords;for(let S=0;S(P.min.x=Math.min(P.min.x,O.x-S.x),P.min.y=Math.min(P.min.y,O.y-S.y),P.max.x=Math.max(P.max.x,O.x-S.x),P.max.y=Math.max(P.max.y,O.y-S.y),P),{min:new s.Point(Number.MAX_VALUE,Number.MAX_VALUE),max:new s.Point(-Number.MAX_VALUE,-Number.MAX_VALUE)}),z=(P,O)=>{const j=P.wrap+P.canonical.x/(1<Z+C.max.x||W+HX+C.max.y};for(let P=0;PT.key===c.tileID.key);if(x)return x}if(c.tileID.key!==o.key){const x=o.canonical.z-c.tileID.canonical.z;let T,S,C;_=s.create();const z=c.tileID.wrap-o.wrap<0?(T=s.EXTENT>>x,S=T*((c.tileID.canonical.x<=O){const j=o.canonical.z-O;c.getSource().reparseOverscaled?(S=Math.max(o.canonical.z+2,c.transform.tileZoom),T=new s.OverscaledTileID(S,o.wrap,O,o.canonical.x>>j,o.canonical.y>>j)):j!==0&&(S=O,T=new s.OverscaledTileID(S,o.wrap,O,o.canonical.x>>j,o.canonical.y>>j))}T.key!==o.key&&(z.push(T.key),f=c.getTile(T))}const P=O=>{z.forEach(j=>{_[j]=O}),z.length=0};for(S-=1;S>=C&&(!f||!f.hasData());S--){f&&P(f.tileID.key);const O=T.calculateScaledKey(S);if(f=c.getTileByID(O),f&&f.hasData())break;const j=_[O];if(j===null)break;j===void 0?z.push(O):f=c.getTileByID(j)}return P(f?f.tileID.key:null),f&&f.hasData()?f:null}findDEMTileFor(o){return this.enabled?this._findTileCoveringTileID(o,this.sourceCache):null}prepareDrawTile(){this.renderedToTile=!0}_clearRenderCacheForTile(o,c){let f=this._tilesDirty[o];f||(f=this._tilesDirty[o]={}),f[c.key]=!0}getWirefameBuffer(){if(!this.wireframeSegments){const o=function(c){let f=0;const _=new s.StructArrayLayout2ui4,x=131;for(let T=1;T<129;T++){for(let S=1;S<129;S++)f=T*x+S,_.emplaceBack(f,f+1),_.emplaceBack(f,f+x),_.emplaceBack(f+1,f+x),T===128&&_.emplaceBack(f+x,f+x+1);_.emplaceBack(f+1,f+1+x)}return _}();this.wireframeIndexBuffer=this.painter.context.createIndexBuffer(o),this.wireframeSegments=s.SegmentVector.simpleSegment(0,0,this.gridBuffer.length,o.length)}return[this.wireframeIndexBuffer,this.wireframeSegments]}}class Wt{static cacheKey(o,c,f,_){let x=`${c}${_?_.cacheKey:""}`;for(const T of f)o.usedDefines.includes(T)&&(x+=`/${T}`);return x}constructor(o,c,f,_,x,T){const S=o.gl;this.program=S.createProgram();const C=function(B){const q=[];for(let Q=0;Q`#define ${B}`));const j=o.isWebGL2?`#version 300 es +`:"",W=j+O.concat(o.extStandardDerivatives&&j.length===0?`#extension GL_OES_standard_derivatives : enable +`.concat(Rh):Rh,Rh,zc,ff.fragmentSource,ma.fragmentSource,f.fragmentSource).join(` +`),H=j+O.concat(` +#ifdef GL_ES +precision highp float; +#else + +#if !defined(lowp) +#define lowp +#endif + +#if !defined(mediump) +#define mediump +#endif + +#if !defined(highp) +#define highp +#endif + +#endif`,zc,ff.vertexSource,ma.vertexSource,Pc.vertexSource,f.vertexSource).join(` +`),Z=S.createShader(S.FRAGMENT_SHADER);if(S.isContextLost())return void(this.failedToCreate=!0);S.shaderSource(Z,W),S.compileShader(Z),S.attachShader(this.program,Z);const X=S.createShader(S.VERTEX_SHADER);if(S.isContextLost())this.failedToCreate=!0;else{S.shaderSource(X,H),S.compileShader(X),S.attachShader(this.program,X),this.attributes={},this.numAttributes=P.length;for(let B=0;B({u_dem:new s.Uniform1i(B),u_dem_prev:new s.Uniform1i(B),u_dem_unpack:new s.Uniform4f(B),u_dem_tl:new s.Uniform2f(B),u_dem_scale:new s.Uniform1f(B),u_dem_tl_prev:new s.Uniform2f(B),u_dem_scale_prev:new s.Uniform1f(B),u_dem_size:new s.Uniform1f(B),u_dem_lerp:new s.Uniform1f(B),u_exaggeration:new s.Uniform1f(B),u_depth:new s.Uniform1i(B),u_depth_size_inv:new s.Uniform2f(B),u_meter_to_dem:new s.Uniform1f(B),u_label_plane_matrix_inv:new s.UniformMatrix4f(B)}))(o)),T.includes("GLOBE")&&(this.globeUniforms=(B=>({u_tile_tl_up:new s.Uniform3f(B),u_tile_tr_up:new s.Uniform3f(B),u_tile_br_up:new s.Uniform3f(B),u_tile_bl_up:new s.Uniform3f(B),u_tile_up_scale:new s.Uniform1f(B)}))(o)),T.includes("FOG")&&(this.fogUniforms=(B=>({u_fog_matrix:new s.UniformMatrix4f(B),u_fog_range:new s.Uniform2f(B),u_fog_color:new s.Uniform4f(B),u_fog_horizon_blend:new s.Uniform1f(B),u_fog_temporal_offset:new s.Uniform1f(B),u_frustum_tl:new s.Uniform3f(B),u_frustum_tr:new s.Uniform3f(B),u_frustum_br:new s.Uniform3f(B),u_frustum_bl:new s.Uniform3f(B),u_globe_pos:new s.Uniform3f(B),u_globe_radius:new s.Uniform1f(B),u_globe_transition:new s.Uniform1f(B),u_is_globe:new s.Uniform1i(B),u_viewport:new s.Uniform2f(B)}))(o))}}setTerrainUniformValues(o,c){if(!this.terrainUniforms)return;const f=this.terrainUniforms;if(!this.failedToCreate){o.program.set(this.program);for(const _ in c)f[_]&&f[_].set(this.program,_,c[_])}}setGlobeUniformValues(o,c){if(!this.globeUniforms)return;const f=this.globeUniforms;if(!this.failedToCreate){o.program.set(this.program);for(const _ in c)f[_]&&f[_].set(this.program,_,c[_])}}setFogUniformValues(o,c){if(!this.fogUniforms)return;const f=this.fogUniforms;if(!this.failedToCreate){o.program.set(this.program);for(const _ in c)f[_].set(this.program,_,c[_])}}draw(o,c,f,_,x,T,S,C,z,P,O,j,W,H,Z){const X=o.gl;if(this.failedToCreate)return;o.program.set(this.program),o.setDepthMode(f),o.setStencilMode(_),o.setColorMode(x),o.setCullFace(T);for(const q of Object.keys(this.fixedUniforms))this.fixedUniforms[q].set(this.program,q,S[q]);H&&H.setUniforms(this.program,o,this.binderUniforms,j,{zoom:W});const B={[X.LINES]:2,[X.TRIANGLES]:3,[X.LINE_STRIP]:1}[c];for(const q of O.get()){const Q=q.vaos||(q.vaos={});(Q[C]||(Q[C]=new W_)).bind(o,this,z,H?H.getPaintVertexBuffers():[],P,q.vertexOffset,Z||[]),X.drawElements(c,q.primitiveLength*B,X.UNSIGNED_SHORT,q.primitiveOffset*B*2)}}}function Ml(d,o){const c=Math.pow(2,o.tileID.overscaledZ),f=o.tileSize*Math.pow(2,d.transform.tileZoom)/c,_=f*(o.tileID.canonical.x+o.tileID.wrap*c),x=f*o.tileID.canonical.y;return{u_image:0,u_texsize:o.imageAtlasTexture.size,u_tile_units_to_pixels:1/Bt(o,1,d.transform.tileZoom),u_pixel_coord_upper:[_>>16,x>>16],u_pixel_coord_lower:[65535&_,65535&x]}}const yf=s.create(),Vh=(d,o,c,f,_,x,T,S,C,z,P)=>{const O=o.style.light,j=O.properties.get("position"),W=[j.x,j.y,j.z],H=s.create$1();O.properties.get("anchor")==="viewport"&&(s.fromRotation(H,-o.transform.angle),s.transformMat3(W,W,H));const Z=O.properties.get("color"),X=o.transform,B={u_matrix:d,u_lightpos:W,u_lightintensity:O.properties.get("intensity"),u_lightcolor:[Z.r,Z.g,Z.b],u_vertical_gradient:+c,u_opacity:f,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:yf,u_merc_center:[0,0],u_up_dir:[0,0,0],u_height_lift:0,u_ao:_,u_edge_radius:x};return X.projection.name==="globe"&&(B.u_tile_id=[T.canonical.x,T.canonical.y,1<{const j=Vh(d,o,c,f,_,x,T,C,z,P,O),W={u_height_factor:-Math.pow(2,T.overscaledZ)/S.tileSize/8};return s.extend(j,Ml(o,S),W)},Ls=d=>({u_matrix:d}),$h=(d,o,c)=>s.extend(Ls(d),Ml(o,c)),Z_=(d,o)=>({u_matrix:d,u_world:o}),H_=(d,o,c,f)=>s.extend($h(d,o,c),{u_world:f}),X_=s.create(),Gh=(d,o,c,f,_,x)=>{const T=d.transform,S=T.projection.name==="globe";let C;if(x.paint.get("circle-pitch-alignment")==="map")if(S){const P=s.globePixelsToTileUnits(T.zoom,o.canonical)*T._pixelsPerMercatorPixel;C=Float32Array.from([P,0,0,P])}else C=T.calculatePixelsToTileUnitsMatrix(c);else C=new Float32Array([T.pixelsToGLUnits[0],0,0,T.pixelsToGLUnits[1]]);const z={u_camera_to_center_distance:T.cameraToCenterDistance,u_matrix:d.translatePosMatrix(o.projMatrix,c,x.paint.get("circle-translate"),x.paint.get("circle-translate-anchor")),u_device_pixel_ratio:s.exported.devicePixelRatio,u_extrude_scale:C,u_inv_rot_matrix:X_,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(S){z.u_inv_rot_matrix=f,z.u_merc_center=_,z.u_tile_id=[o.canonical.x,o.canonical.y,1<{const o=[];return d.paint.get("circle-pitch-alignment")==="map"&&o.push("PITCH_WITH_MAP"),d.paint.get("circle-pitch-scale")==="map"&&o.push("SCALE_WITH_MAP"),o},Wh=(d,o,c,f)=>{const _=s.EXTENT/c.tileSize;return{u_matrix:d,u_camera_to_center_distance:o.getCameraToCenterDistance(f),u_extrude_scale:[o.pixelsToGLUnits[0]/_,o.pixelsToGLUnits[1]/_]}},Bc=(d,o,c=1)=>({u_matrix:d,u_color:o,u_overlay:0,u_overlay_scale:c}),xf=s.create(),wf=(d,o,c,f,_,x,T)=>{const S=d.transform,C=S.projection.name==="globe",z=C?s.globePixelsToTileUnits(S.zoom,o.canonical)*S._pixelsPerMercatorPixel:Bt(c,1,x),P={u_matrix:o.projMatrix,u_extrude_scale:z,u_intensity:T,u_inv_rot_matrix:xf,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(C){P.u_inv_rot_matrix=f,P.u_merc_center=_,P.u_tile_id=[o.canonical.x,o.canonical.y,1<{const S=d.transform,C=S.calculatePixelsToTileUnitsMatrix(o);return{u_matrix:Zh(d,o,c,f),u_pixels_to_tile_units:C,u_device_pixel_ratio:x,u_units_to_pixels:[1/S.pixelsToGLUnits[0],1/S.pixelsToGLUnits[1]],u_dash_image:0,u_gradient_image:1,u_image_height:_,u_texsize:zl(c)?o.lineAtlasTexture.size:[0,0],u_tile_units_to_pixels:va(o,d.transform),u_alpha_discard_threshold:0,u_trim_offset:T}},Pl=(d,o,c,f,_)=>{const x=d.transform;return{u_matrix:Zh(d,o,c,f),u_texsize:o.imageAtlasTexture.size,u_pixels_to_tile_units:x.calculatePixelsToTileUnitsMatrix(o),u_device_pixel_ratio:_,u_image:0,u_tile_units_to_pixels:va(o,x),u_units_to_pixels:[1/x.pixelsToGLUnits[0],1/x.pixelsToGLUnits[1]],u_alpha_discard_threshold:0}};function va(d,o){return 1/Bt(d,1,o.tileZoom)}function Zh(d,o,c,f){return d.translatePosMatrix(f||o.tileID.projMatrix,o,c.paint.get("line-translate"),c.paint.get("line-translate-anchor"))}function zl(d){const o=d.paint.get("line-dasharray").value;return o.value||o.kind!=="constant"}const Hh=(d,o,c,f,_,x)=>{return{u_matrix:d,u_tl_parent:o,u_scale_parent:c,u_fade_t:f.mix,u_opacity:f.opacity*_.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:_.paint.get("raster-brightness-min"),u_brightness_high:_.paint.get("raster-brightness-max"),u_saturation_factor:(S=_.paint.get("raster-saturation"),S>0?1-1/(1.001-S):-S),u_contrast_factor:(T=_.paint.get("raster-contrast"),T>0?1/(1-T):1+T),u_spin_weights:no(_.paint.get("raster-hue-rotate")),u_perspective_transform:x};var T,S};function no(d){d*=Math.PI/180;const o=Math.sin(d),c=Math.cos(d);return[(2*c+1)/3,(-Math.sqrt(3)*o-c+1)/3,(Math.sqrt(3)*o-c+1)/3]}const Fc=s.create(),Xh=(d,o,c,f,_,x,T,S,C,z,P,O,j,W,H,Z)=>{const X=_.transform,B={u_is_size_zoom_constant:+(d==="constant"||d==="source"),u_is_size_feature_constant:+(d==="constant"||d==="camera"),u_size_t:o?o.uSizeT:0,u_size:o?o.uSize:0,u_camera_to_center_distance:X.cameraToCenterDistance,u_rotate_symbol:+c,u_aspect_ratio:X.width/X.height,u_fade_change:_.options.fadeDuration?_.symbolFadeChange:1,u_matrix:x,u_label_plane_matrix:T,u_coord_matrix:S,u_is_text:+C,u_pitch_with_map:+f,u_texsize:z,u_texture:0,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:Fc,u_merc_center:[0,0],u_camera_forward:[0,0,0],u_ecef_origin:[0,0,0],u_tile_matrix:Fc,u_up_vector:[0,-1,0]};return Z.name==="globe"&&(B.u_tile_id=[P.canonical.x,P.canonical.y,1<s.extend(Xh(d,o,c,f,_,x,T,S,C,z,O,j,W,H,Z,X),{u_gamma_scale:f?_.transform.cameraToCenterDistance*Math.cos(_.terrain?0:_.transform._pitch):1,u_device_pixel_ratio:s.exported.devicePixelRatio,u_is_halo:+P}),bf=(d,o,c,f,_,x,T,S,C,z,P,O,j,W,H,Z)=>s.extend(Nc(d,o,c,f,_,x,T,S,!0,C,!0,P,O,j,W,H,Z),{u_texsize_icon:z,u_texture_icon:1}),Kh=(d,o,c)=>({u_matrix:d,u_opacity:o,u_color:c}),Y_=(d,o,c,f,_)=>s.extend(function(x,T,S){const C=T.imageManager.getPattern(x.toString()),{width:z,height:P}=T.imageManager.getPixelSize(),O=Math.pow(2,S.tileID.overscaledZ),j=S.tileSize*Math.pow(2,T.transform.tileZoom)/O,W=j*(S.tileID.canonical.x+S.tileID.wrap*O),H=j*S.tileID.canonical.y;return{u_image:0,u_pattern_tl:C.tl,u_pattern_br:C.br,u_texsize:[z,P],u_pattern_size:C.displaySize,u_tile_units_to_pixels:1/Bt(S,1,T.transform.tileZoom),u_pixel_coord_upper:[W>>16,H>>16],u_pixel_coord_lower:[65535&W,65535&H]}}(f,c,_),{u_matrix:d,u_opacity:o}),Yh={fillExtrusion:d=>({u_matrix:new s.UniformMatrix4f(d),u_lightpos:new s.Uniform3f(d),u_lightintensity:new s.Uniform1f(d),u_lightcolor:new s.Uniform3f(d),u_vertical_gradient:new s.Uniform1f(d),u_opacity:new s.Uniform1f(d),u_edge_radius:new s.Uniform1f(d),u_ao:new s.Uniform2f(d),u_tile_id:new s.Uniform3f(d),u_zoom_transition:new s.Uniform1f(d),u_inv_rot_matrix:new s.UniformMatrix4f(d),u_merc_center:new s.Uniform2f(d),u_up_dir:new s.Uniform3f(d),u_height_lift:new s.Uniform1f(d)}),fillExtrusionPattern:d=>({u_matrix:new s.UniformMatrix4f(d),u_lightpos:new s.Uniform3f(d),u_lightintensity:new s.Uniform1f(d),u_lightcolor:new s.Uniform3f(d),u_vertical_gradient:new s.Uniform1f(d),u_height_factor:new s.Uniform1f(d),u_edge_radius:new s.Uniform1f(d),u_ao:new s.Uniform2f(d),u_tile_id:new s.Uniform3f(d),u_zoom_transition:new s.Uniform1f(d),u_inv_rot_matrix:new s.UniformMatrix4f(d),u_merc_center:new s.Uniform2f(d),u_up_dir:new s.Uniform3f(d),u_height_lift:new s.Uniform1f(d),u_image:new s.Uniform1i(d),u_texsize:new s.Uniform2f(d),u_pixel_coord_upper:new s.Uniform2f(d),u_pixel_coord_lower:new s.Uniform2f(d),u_tile_units_to_pixels:new s.Uniform1f(d),u_opacity:new s.Uniform1f(d)}),fill:d=>({u_matrix:new s.UniformMatrix4f(d)}),fillPattern:d=>({u_matrix:new s.UniformMatrix4f(d),u_image:new s.Uniform1i(d),u_texsize:new s.Uniform2f(d),u_pixel_coord_upper:new s.Uniform2f(d),u_pixel_coord_lower:new s.Uniform2f(d),u_tile_units_to_pixels:new s.Uniform1f(d)}),fillOutline:d=>({u_matrix:new s.UniformMatrix4f(d),u_world:new s.Uniform2f(d)}),fillOutlinePattern:d=>({u_matrix:new s.UniformMatrix4f(d),u_world:new s.Uniform2f(d),u_image:new s.Uniform1i(d),u_texsize:new s.Uniform2f(d),u_pixel_coord_upper:new s.Uniform2f(d),u_pixel_coord_lower:new s.Uniform2f(d),u_tile_units_to_pixels:new s.Uniform1f(d)}),circle:d=>({u_camera_to_center_distance:new s.Uniform1f(d),u_extrude_scale:new s.UniformMatrix2f(d),u_device_pixel_ratio:new s.Uniform1f(d),u_matrix:new s.UniformMatrix4f(d),u_inv_rot_matrix:new s.UniformMatrix4f(d),u_merc_center:new s.Uniform2f(d),u_tile_id:new s.Uniform3f(d),u_zoom_transition:new s.Uniform1f(d),u_up_dir:new s.Uniform3f(d)}),collisionBox:d=>({u_matrix:new s.UniformMatrix4f(d),u_camera_to_center_distance:new s.Uniform1f(d),u_extrude_scale:new s.Uniform2f(d)}),collisionCircle:d=>({u_matrix:new s.UniformMatrix4f(d),u_inv_matrix:new s.UniformMatrix4f(d),u_camera_to_center_distance:new s.Uniform1f(d),u_viewport_size:new s.Uniform2f(d)}),debug:d=>({u_color:new s.UniformColor(d),u_matrix:new s.UniformMatrix4f(d),u_overlay:new s.Uniform1i(d),u_overlay_scale:new s.Uniform1f(d)}),clippingMask:d=>({u_matrix:new s.UniformMatrix4f(d)}),heatmap:d=>({u_extrude_scale:new s.Uniform1f(d),u_intensity:new s.Uniform1f(d),u_matrix:new s.UniformMatrix4f(d),u_inv_rot_matrix:new s.UniformMatrix4f(d),u_merc_center:new s.Uniform2f(d),u_tile_id:new s.Uniform3f(d),u_zoom_transition:new s.Uniform1f(d),u_up_dir:new s.Uniform3f(d)}),heatmapTexture:d=>({u_image:new s.Uniform1i(d),u_color_ramp:new s.Uniform1i(d),u_opacity:new s.Uniform1f(d)}),hillshade:d=>({u_matrix:new s.UniformMatrix4f(d),u_image:new s.Uniform1i(d),u_latrange:new s.Uniform2f(d),u_light:new s.Uniform2f(d),u_shadow:new s.UniformColor(d),u_highlight:new s.UniformColor(d),u_accent:new s.UniformColor(d)}),hillshadePrepare:d=>({u_matrix:new s.UniformMatrix4f(d),u_image:new s.Uniform1i(d),u_dimension:new s.Uniform2f(d),u_zoom:new s.Uniform1f(d),u_unpack:new s.Uniform4f(d)}),line:d=>({u_matrix:new s.UniformMatrix4f(d),u_pixels_to_tile_units:new s.UniformMatrix2f(d),u_device_pixel_ratio:new s.Uniform1f(d),u_units_to_pixels:new s.Uniform2f(d),u_dash_image:new s.Uniform1i(d),u_gradient_image:new s.Uniform1i(d),u_image_height:new s.Uniform1f(d),u_texsize:new s.Uniform2f(d),u_tile_units_to_pixels:new s.Uniform1f(d),u_alpha_discard_threshold:new s.Uniform1f(d),u_trim_offset:new s.Uniform2f(d)}),linePattern:d=>({u_matrix:new s.UniformMatrix4f(d),u_texsize:new s.Uniform2f(d),u_pixels_to_tile_units:new s.UniformMatrix2f(d),u_device_pixel_ratio:new s.Uniform1f(d),u_image:new s.Uniform1i(d),u_units_to_pixels:new s.Uniform2f(d),u_tile_units_to_pixels:new s.Uniform1f(d),u_alpha_discard_threshold:new s.Uniform1f(d)}),raster:d=>({u_matrix:new s.UniformMatrix4f(d),u_tl_parent:new s.Uniform2f(d),u_scale_parent:new s.Uniform1f(d),u_fade_t:new s.Uniform1f(d),u_opacity:new s.Uniform1f(d),u_image0:new s.Uniform1i(d),u_image1:new s.Uniform1i(d),u_brightness_low:new s.Uniform1f(d),u_brightness_high:new s.Uniform1f(d),u_saturation_factor:new s.Uniform1f(d),u_contrast_factor:new s.Uniform1f(d),u_spin_weights:new s.Uniform3f(d),u_perspective_transform:new s.Uniform2f(d)}),symbolIcon:d=>({u_is_size_zoom_constant:new s.Uniform1i(d),u_is_size_feature_constant:new s.Uniform1i(d),u_size_t:new s.Uniform1f(d),u_size:new s.Uniform1f(d),u_camera_to_center_distance:new s.Uniform1f(d),u_rotate_symbol:new s.Uniform1i(d),u_aspect_ratio:new s.Uniform1f(d),u_fade_change:new s.Uniform1f(d),u_matrix:new s.UniformMatrix4f(d),u_label_plane_matrix:new s.UniformMatrix4f(d),u_coord_matrix:new s.UniformMatrix4f(d),u_is_text:new s.Uniform1i(d),u_pitch_with_map:new s.Uniform1i(d),u_texsize:new s.Uniform2f(d),u_tile_id:new s.Uniform3f(d),u_zoom_transition:new s.Uniform1f(d),u_inv_rot_matrix:new s.UniformMatrix4f(d),u_merc_center:new s.Uniform2f(d),u_camera_forward:new s.Uniform3f(d),u_tile_matrix:new s.UniformMatrix4f(d),u_up_vector:new s.Uniform3f(d),u_ecef_origin:new s.Uniform3f(d),u_texture:new s.Uniform1i(d)}),symbolSDF:d=>({u_is_size_zoom_constant:new s.Uniform1i(d),u_is_size_feature_constant:new s.Uniform1i(d),u_size_t:new s.Uniform1f(d),u_size:new s.Uniform1f(d),u_camera_to_center_distance:new s.Uniform1f(d),u_rotate_symbol:new s.Uniform1i(d),u_aspect_ratio:new s.Uniform1f(d),u_fade_change:new s.Uniform1f(d),u_matrix:new s.UniformMatrix4f(d),u_label_plane_matrix:new s.UniformMatrix4f(d),u_coord_matrix:new s.UniformMatrix4f(d),u_is_text:new s.Uniform1i(d),u_pitch_with_map:new s.Uniform1i(d),u_texsize:new s.Uniform2f(d),u_texture:new s.Uniform1i(d),u_gamma_scale:new s.Uniform1f(d),u_device_pixel_ratio:new s.Uniform1f(d),u_tile_id:new s.Uniform3f(d),u_zoom_transition:new s.Uniform1f(d),u_inv_rot_matrix:new s.UniformMatrix4f(d),u_merc_center:new s.Uniform2f(d),u_camera_forward:new s.Uniform3f(d),u_tile_matrix:new s.UniformMatrix4f(d),u_up_vector:new s.Uniform3f(d),u_ecef_origin:new s.Uniform3f(d),u_is_halo:new s.Uniform1i(d)}),symbolTextAndIcon:d=>({u_is_size_zoom_constant:new s.Uniform1i(d),u_is_size_feature_constant:new s.Uniform1i(d),u_size_t:new s.Uniform1f(d),u_size:new s.Uniform1f(d),u_camera_to_center_distance:new s.Uniform1f(d),u_rotate_symbol:new s.Uniform1i(d),u_aspect_ratio:new s.Uniform1f(d),u_fade_change:new s.Uniform1f(d),u_matrix:new s.UniformMatrix4f(d),u_label_plane_matrix:new s.UniformMatrix4f(d),u_coord_matrix:new s.UniformMatrix4f(d),u_is_text:new s.Uniform1i(d),u_pitch_with_map:new s.Uniform1i(d),u_texsize:new s.Uniform2f(d),u_texsize_icon:new s.Uniform2f(d),u_texture:new s.Uniform1i(d),u_texture_icon:new s.Uniform1i(d),u_gamma_scale:new s.Uniform1f(d),u_device_pixel_ratio:new s.Uniform1f(d),u_is_halo:new s.Uniform1i(d)}),background:d=>({u_matrix:new s.UniformMatrix4f(d),u_opacity:new s.Uniform1f(d),u_color:new s.UniformColor(d)}),backgroundPattern:d=>({u_matrix:new s.UniformMatrix4f(d),u_opacity:new s.Uniform1f(d),u_image:new s.Uniform1i(d),u_pattern_tl:new s.Uniform2f(d),u_pattern_br:new s.Uniform2f(d),u_texsize:new s.Uniform2f(d),u_pattern_size:new s.Uniform2f(d),u_pixel_coord_upper:new s.Uniform2f(d),u_pixel_coord_lower:new s.Uniform2f(d),u_tile_units_to_pixels:new s.Uniform1f(d)}),terrainRaster:Fh,terrainDepth:Fh,skybox:d=>({u_matrix:new s.UniformMatrix4f(d),u_sun_direction:new s.Uniform3f(d),u_cubemap:new s.Uniform1i(d),u_opacity:new s.Uniform1f(d),u_temporal_offset:new s.Uniform1f(d)}),skyboxGradient:d=>({u_matrix:new s.UniformMatrix4f(d),u_color_ramp:new s.Uniform1i(d),u_center_direction:new s.Uniform3f(d),u_radius:new s.Uniform1f(d),u_opacity:new s.Uniform1f(d),u_temporal_offset:new s.Uniform1f(d)}),skyboxCapture:d=>({u_matrix_3f:new s.UniformMatrix3f(d),u_sun_direction:new s.Uniform3f(d),u_sun_intensity:new s.Uniform1f(d),u_color_tint_r:new s.Uniform4f(d),u_color_tint_m:new s.Uniform4f(d),u_luminance:new s.Uniform1f(d)}),globeRaster:d=>({u_proj_matrix:new s.UniformMatrix4f(d),u_globe_matrix:new s.UniformMatrix4f(d),u_normalize_matrix:new s.UniformMatrix4f(d),u_merc_matrix:new s.UniformMatrix4f(d),u_zoom_transition:new s.Uniform1f(d),u_merc_center:new s.Uniform2f(d),u_image0:new s.Uniform1i(d),u_grid_matrix:new s.UniformMatrix3f(d),u_skirt_height:new s.Uniform1f(d),u_frustum_tl:new s.Uniform3f(d),u_frustum_tr:new s.Uniform3f(d),u_frustum_br:new s.Uniform3f(d),u_frustum_bl:new s.Uniform3f(d),u_globe_pos:new s.Uniform3f(d),u_globe_radius:new s.Uniform1f(d),u_viewport:new s.Uniform2f(d)}),globeAtmosphere:d=>({u_frustum_tl:new s.Uniform3f(d),u_frustum_tr:new s.Uniform3f(d),u_frustum_br:new s.Uniform3f(d),u_frustum_bl:new s.Uniform3f(d),u_horizon:new s.Uniform1f(d),u_transition:new s.Uniform1f(d),u_fadeout_range:new s.Uniform1f(d),u_color:new s.Uniform4f(d),u_high_color:new s.Uniform4f(d),u_space_color:new s.Uniform4f(d),u_star_intensity:new s.Uniform1f(d),u_star_density:new s.Uniform1f(d),u_star_size:new s.Uniform1f(d),u_temporal_offset:new s.Uniform1f(d),u_horizon_angle:new s.Uniform1f(d),u_rotation_matrix:new s.UniformMatrix4f(d)})};let Uc;function Ll(d,o,c,f,_,x,T){const S=d.context,C=S.gl,z=d.transform,P=d.useProgram("collisionBox"),O=[];let j=0,W=0;for(let ee=0;ee0){const Ee=s.create(),Fe=ye;s.mul(Ee,pe.placementInvProjMatrix,z.glCoordMatrix),s.mul(Ee,Ee,pe.placementViewportMatrix),O.push({circleArray:We,circleOffset:W,transform:Fe,invTransform:Ee,projection:pe.getProjection()}),j+=We.length/4,W=j}Ae&&(d.terrain&&d.terrain.setupElevationDraw(fe,P),P.draw(S,C.LINES,s.DepthMode.disabled,s.StencilMode.disabled,d.colorModeForRenderPass(),s.CullFaceMode.disabled,Wh(ye,z,fe,pe.getProjection()),c.id,Ae.layoutVertexBuffer,Ae.indexBuffer,Ae.segments,null,z.zoom,null,[Ae.collisionVertexBuffer,Ae.collisionVertexBufferExt]))}if(!T||!O.length)return;const H=d.useProgram("collisionCircle"),Z=new s.StructArrayLayout2f1f2i16;Z.resize(4*j),Z._trim();let X=0;for(const ee of O)for(let de=0;de=0&&(H[ee.associatedIconIndex]={x:Ee,y:Fe,z:ke,angle:$e})}else Ri(pe,j)}if(P){W.clear();const Q=d.icon.placedSymbolArray;for(let ee=0;eeEe.sortKey-Fe.sortKey);for(const Ee of ye){const Fe=Ee.state;if(d.terrain&&d.terrain.setupElevationDraw(Fe.tile,Fe.program,{useDepthForOcclusion:!xe,labelPlaneMatrixInv:Fe.labelPlaneMatrixInv}),j.activeTexture.set(W.TEXTURE0),Fe.atlasTexture.bind(Fe.atlasInterpolation,W.CLAMP_TO_EDGE),Fe.atlasTextureIcon&&(j.activeTexture.set(W.TEXTURE1),Fe.atlasTextureIcon&&Fe.atlasTextureIcon.bind(Fe.atlasInterpolationIcon,W.CLAMP_TO_EDGE)),Fe.isSDF){const ke=Fe.uniformValues;Fe.hasHalo&&(ke.u_is_halo=1,Rl(Fe.buffers,Ee.segments,c,d,Fe.program,de,P,O,ke)),ke.u_is_halo=0}Rl(Fe.buffers,Ee.segments,c,d,Fe.program,de,P,O,Fe.uniformValues)}}function Rl(d,o,c,f,_,x,T,S,C){const z=f.context,P=[d.dynamicLayoutVertexBuffer,d.opacityVertexBuffer,d.globeExtVertexBuffer];_.draw(z,z.gl.TRIANGLES,x,T,S,s.CullFaceMode.disabled,C,c.id,d.layoutVertexBuffer,d.indexBuffer,o,c.paint,f.transform.zoom,d.programConfigurations.get(c.id),P)}function Sf(d,o,c,f,_,x,T){const S=d.context.gl,C=c.paint.get("fill-pattern"),z=C&&C.constantOr(1);let P,O,j,W,H;T?(O=z&&!c.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",P=S.LINES):(O=z?"fillPattern":"fill",P=S.TRIANGLES);for(const Z of f){const X=o.getTile(Z);if(z&&!X.patternsLoaded())continue;const B=X.getBucket(c);if(!B)continue;d.prepareDrawTile();const q=B.programConfigurations.get(c.id),Q=d.useProgram(O,q);z&&(d.context.activeTexture.set(S.TEXTURE0),X.imageAtlasTexture.bind(S.LINEAR,S.CLAMP_TO_EDGE),q.updatePaintBuffers());const ee=C.constantOr(null);if(ee&&X.imageAtlas){const fe=X.imageAtlas.patternPositions[ee.toString()];fe&&q.setConstantPatternPositions(fe)}const de=d.translatePosMatrix(Z.projMatrix,X,c.paint.get("fill-translate"),c.paint.get("fill-translate-anchor"));if(T){W=B.indexBuffer2,H=B.segments2;const fe=d.terrain&&d.terrain.renderingToTexture?d.terrain.drapeBufferSize:[S.drawingBufferWidth,S.drawingBufferHeight];j=O==="fillOutlinePattern"&&z?H_(de,d,X,fe):Z_(de,fe)}else W=B.indexBuffer,H=B.segments,j=z?$h(de,d,X):Ls(de);d.prepareDrawProgram(d.context,Q,Z.toUnwrapped()),Q.draw(d.context,P,_,d.stencilModeForClipping(Z),x,s.CullFaceMode.disabled,j,c.id,B.layoutVertexBuffer,W,H,c.paint,d.transform.zoom,q)}}function jc(d,o,c,f,_,x,T){const S=d.context,C=S.gl,z=d.transform,P=c.paint.get("fill-extrusion-pattern"),O=P.constantOr(1),j=c.paint.get("fill-extrusion-opacity"),W=[c.paint.get("fill-extrusion-ambient-occlusion-intensity"),c.paint.get("fill-extrusion-ambient-occlusion-radius")],H=c.layout.get("fill-extrusion-edge-radius"),Z=H>0&&!c.paint.get("fill-extrusion-rounded-roof"),X=Z?0:H,B=z.projection.name==="globe"?s.fillExtrusionHeightLift():0,q=z.projection.name==="globe",Q=q?s.globeToMercatorTransition(z.zoom):0,ee=[s.mercatorXfromLng(z.center.lng),s.mercatorYfromLat(z.center.lat)],de=[];q&&de.push("PROJECTION_GLOBE_VIEW"),W[0]>0&&de.push("FAUX_AO"),Z&&de.push("ZERO_ROOF_RADIUS");for(const fe of f){const pe=o.getTile(fe),xe=pe.getBucket(c);if(!xe||xe.projection.name!==z.projection.name)continue;const ye=xe.programConfigurations.get(c.id),Ae=d.useProgram(O?"fillExtrusionPattern":"fillExtrusion",ye,de);if(d.terrain){const Be=d.terrain;if(d.style.terrainSetForDrapingOnly())Be.setupElevationDraw(pe,Ae,{useMeterToDem:!0});else{if(!xe.enableTerrain)continue;if(Be.setupElevationDraw(pe,Ae,{useMeterToDem:!0}),Af(S,o,fe,xe,c,Be),!xe.centroidVertexBuffer){const Xe=Ae.attributes.a_centroid_pos;Xe!==void 0&&C.vertexAttrib2f(Xe,0,0)}}}O&&(d.context.activeTexture.set(C.TEXTURE0),pe.imageAtlasTexture.bind(C.LINEAR,C.CLAMP_TO_EDGE),ye.updatePaintBuffers());const We=P.constantOr(null);if(We&&pe.imageAtlas){const Be=pe.imageAtlas.patternPositions[We.toString()];Be&&ye.setConstantPatternPositions(Be)}const Ee=d.translatePosMatrix(fe.projMatrix,pe,c.paint.get("fill-extrusion-translate"),c.paint.get("fill-extrusion-translate-anchor")),Fe=z.projection.createInversionMatrix(z,fe.canonical),ke=c.paint.get("fill-extrusion-vertical-gradient"),qe=O?vf(Ee,d,ke,j,W,X,fe,pe,B,Q,ee,Fe):Vh(Ee,d,ke,j,W,X,fe,B,Q,ee,Fe);d.prepareDrawProgram(S,Ae,fe.toUnwrapped());const Se=[];d.terrain&&Se.push(xe.centroidVertexBuffer),q&&Se.push(xe.layoutVertexExtBuffer),Ae.draw(S,S.gl.TRIANGLES,_,x,T,s.CullFaceMode.backCCW,qe,c.id,xe.layoutVertexBuffer,xe.indexBuffer,xe.segments,c.paint,d.transform.zoom,ye,Se)}}function Af(d,o,c,f,_,x){const T=[B=>{let q=B.canonical.x-1,Q=B.wrap;return q<0&&(q=(1<{let q=B.canonical.x+1,Q=B.wrap;return q===1<new s.OverscaledTileID(B.overscaledZ,B.wrap,B.canonical.z,B.canonical.x,(B.canonical.y===0?1<new s.OverscaledTileID(B.overscaledZ,B.wrap,B.canonical.z,B.canonical.x,B.canonical.y===(1<{const q=o.getSource().minzoom,Q=de=>{const fe=o.getTileByID(de);if(fe&&fe.hasData())return fe.getBucket(_)},ee=[0,-1,1];for(const de of ee){if(B.overscaledZ+de(C[0]=Math.min(B.min.y,q.min.y),C[1]=Math.max(B.max.y,q.max.y),C[2]=s.EXTENT-q.min.x>B.max.x?q.min.x-s.EXTENT:B.max.x,C),P=(B,q)=>(C[0]=Math.min(B.min.x,q.min.x),C[1]=Math.max(B.max.x,q.max.x),C[2]=s.EXTENT-q.min.y>B.max.y?q.min.y-s.EXTENT:B.max.y,C),O=[(B,q)=>z(B,q),(B,q)=>z(q,B),(B,q)=>P(B,q),(B,q)=>P(q,B)],j=new s.Point(0,0);let W,H,Z;const X=(B,q,Q,ee,de)=>{const fe=[[ee?Q:B,ee?B:Q,0],[ee?Q:q,ee?q:Q,0]],pe=de<0?s.EXTENT+de:de,xe=[ee?pe:(B+q)/2,ee?(B+q)/2:pe,0];return Q===0&&de<0||Q!==0&&de>0?x.getForTilePoints(Z,[xe],!0,H):fe.push(xe),x.getForTilePoints(c,fe,!0,W),Math.max(fe[0][2],fe[1][2],xe[2])/x.exaggeration()};for(let B=0;B<4;B++){const q=(B<2?1:5)-B,Q=f.borders[B];if(Q.length===0)continue;const ee=Z=T[B](c),de=S(ee);if(!(de&&de instanceof s.FillExtrusionBucket&&de.enableTerrain)||f.borderDoneWithNeighborZ[B]===de.canonical.z&&de.borderDoneWithNeighborZ[q]===f.canonical.z||(H=x.findDEMTileFor(ee),!H||!H.dem))continue;if(!W){const ye=x.findDEMTileFor(c);if(!ye||!ye.dem)return;W=ye}const fe=de.borders[q];let pe=0;const xe=de.borderDoneWithNeighborZ[q]!==f.canonical.z;if(f.canonical.z===de.canonical.z){for(let ye=0;yeWe[0]+3));)xe&&de.encodeCentroid(void 0,Ee,!1),pe++;if(Ee&&peWe[1]-3)&&(ke++,++pe!==fe.length);)Ee=de.featuresOnBorder[fe[pe]];if(Ee=de.featuresOnBorder[fe[Fe]],Ae.intersectsCount()>1||Ee.intersectsCount()>1||ke!==1){ke!==1&&(pe=Fe),f.encodeCentroid(void 0,Ae,!1),xe&&de.encodeCentroid(void 0,Ee,!1);continue}const qe=O[B](Ae,Ee),Se=B%2?s.EXTENT-1:0;j.x=X(qe[0],Math.min(s.EXTENT-1,qe[1]),Se,B<2,qe[2]),j.y=0,f.encodeCentroid(j,Ae,!1),xe&&de.encodeCentroid(j,Ee,!1)}else f.encodeCentroid(void 0,Ae,!1)}f.borderDoneWithNeighborZ[B]=de.canonical.z,f.needsCentroidUpdate=!0,xe&&(de.borderDoneWithNeighborZ[q]=f.canonical.z,de.needsCentroidUpdate=!0)}else{for(const ye of Q)f.encodeCentroid(void 0,f.featuresOnBorder[ye],!1);if(xe){for(const ye of fe)de.encodeCentroid(void 0,de.featuresOnBorder[ye],!1);de.borderDoneWithNeighborZ[q]=f.canonical.z,de.needsCentroidUpdate=!0}f.borderDoneWithNeighborZ[B]=de.canonical.z,f.needsCentroidUpdate=!0}}(f.needsCentroidUpdate||!f.centroidVertexBuffer&&f.centroidVertexArray.length!==0)&&f.uploadCentroid(d)}const xa=new s.Color(1,0,0,1),Q_=new s.Color(0,1,0,1),ey=new s.Color(0,0,1,1),ty=new s.Color(1,0,1,1),ny=new s.Color(0,1,1,1);function ry(d,o,c){const f=d.context,_=d.transform,x=f.gl,T=_.projection.name==="globe",S=T?["PROJECTION_GLOBE_VIEW"]:null;let C=c.projMatrix;if(T&&s.globeToMercatorTransition(_.zoom)>0){const Ae=s.transitionTileAABBinECEF(c.canonical,_),We=s.globeDenormalizeECEF(Ae);C=s.multiply(new Float32Array(16),_.globeMatrix,We),s.multiply(C,_.projMatrix,C)}const z=d.useProgram("debug",null,S),P=o.getTileByID(c.key);d.terrain&&d.terrain.setupElevationDraw(P,z);const O=s.DepthMode.disabled,j=s.StencilMode.disabled,W=d.colorModeForRenderPass(),H="$debug";f.activeTexture.set(x.TEXTURE0),d.emptyTexture.bind(x.LINEAR,x.CLAMP_TO_EDGE),T?P._makeGlobeTileDebugBuffers(d.context,_):P._makeDebugTileBoundsBuffers(d.context,_.projection);const Z=P._tileDebugBuffer||d.debugBuffer,X=P._tileDebugIndexBuffer||d.debugIndexBuffer,B=P._tileDebugSegments||d.debugSegments;z.draw(f,x.LINE_STRIP,O,j,W,s.CullFaceMode.disabled,Bc(C,s.Color.red),H,Z,X,B,null,null,null,[P._globeTileDebugBorderBuffer]);const q=P.latestRawTileData,Q=Math.floor((q&&q.byteLength||0)/1024),ee=o.getTile(c).tileSize,de=512/Math.min(ee,512)*(c.overscaledZ/_.zoom)*.5;let fe=c.canonical.toString();c.overscaledZ!==c.canonical.z&&(fe+=` => ${c.overscaledZ}`),fe+=` ${Q}kb`,function(Ae,We){Ae.initDebugOverlayCanvas();const Ee=Ae.debugOverlayCanvas,Fe=Ae.context.gl,ke=Ae.debugOverlayCanvas.getContext("2d");ke.clearRect(0,0,Ee.width,Ee.height),ke.shadowColor="white",ke.shadowBlur=2,ke.lineWidth=1.5,ke.strokeStyle="white",ke.textBaseline="top",ke.font="bold 36px Open Sans, sans-serif",ke.fillText(We,5,5),ke.strokeText(We,5,5),Ae.debugOverlayTexture.update(Ee),Ae.debugOverlayTexture.bind(Fe.LINEAR,Fe.CLAMP_TO_EDGE)}(d,fe);const pe=P._tileDebugTextBuffer||d.debugBuffer,xe=P._tileDebugTextIndexBuffer||d.quadTriangleIndexBuffer,ye=P._tileDebugTextSegments||d.debugSegments;z.draw(f,x.TRIANGLES,O,j,s.ColorMode.alphaBlended,s.CullFaceMode.disabled,Bc(C,s.Color.transparent,de),H,pe,xe,ye,null,null,null,[P._globeTileDebugTextBuffer])}function Cf(d,o,c,f){wa(d,0,o+c/2,d.transform.width,c,f)}function Vc(d,o,c,f){wa(d,o-c/2,0,c,d.transform.height,f)}function wa(d,o,c,f,_,x){const T=d.context,S=T.gl;S.enable(S.SCISSOR_TEST),S.scissor(o*s.exported.devicePixelRatio,c*s.exported.devicePixelRatio,f*s.exported.devicePixelRatio,_*s.exported.devicePixelRatio),T.clear({color:x}),S.disable(S.SCISSOR_TEST)}const If=s.createLayout([{name:"a_pos_3f",components:3,type:"Float32"}]),{members:kf}=If;function Io(d,o,c,f){d.emplaceBack(o,c,f)}class $c{constructor(o){this.vertexArray=new s.StructArrayLayout3f12,this.indices=new s.StructArrayLayout3ui6,Io(this.vertexArray,-1,-1,1),Io(this.vertexArray,1,-1,1),Io(this.vertexArray,-1,1,1),Io(this.vertexArray,1,1,1),Io(this.vertexArray,-1,-1,-1),Io(this.vertexArray,1,-1,-1),Io(this.vertexArray,-1,1,-1),Io(this.vertexArray,1,1,-1),this.indices.emplaceBack(5,1,3),this.indices.emplaceBack(3,7,5),this.indices.emplaceBack(6,2,0),this.indices.emplaceBack(0,4,6),this.indices.emplaceBack(2,6,7),this.indices.emplaceBack(7,3,2),this.indices.emplaceBack(5,4,0),this.indices.emplaceBack(0,1,5),this.indices.emplaceBack(0,2,3),this.indices.emplaceBack(3,1,0),this.indices.emplaceBack(7,6,4),this.indices.emplaceBack(4,5,7),this.vertexBuffer=o.createVertexBuffer(this.vertexArray,kf),this.indexBuffer=o.createIndexBuffer(this.indices),this.segment=s.SegmentVector.simpleSegment(0,0,36,12)}}function _i(d,o,c,f,_,x){const T=d.gl,S=o.paint.get("sky-atmosphere-color"),C=o.paint.get("sky-atmosphere-halo-color"),z=o.paint.get("sky-atmosphere-sun-intensity"),P=((O,j,W,H,Z)=>({u_matrix_3f:O,u_sun_direction:j,u_sun_intensity:W,u_color_tint_r:[H.r,H.g,H.b,H.a],u_color_tint_m:[Z.r,Z.g,Z.b,Z.a],u_luminance:5e-5}))(s.fromMat4(s.create$1(),f),_,z,S,C);T.framebufferTexture2D(T.FRAMEBUFFER,T.COLOR_ATTACHMENT0,T.TEXTURE_CUBE_MAP_POSITIVE_X+x,o.skyboxTexture,0),c.draw(d,T.TRIANGLES,s.DepthMode.disabled,s.StencilMode.disabled,s.ColorMode.unblended,s.CullFaceMode.frontCW,P,"skyboxCapture",o.skyboxGeometry.vertexBuffer,o.skyboxGeometry.indexBuffer,o.skyboxGeometry.segment)}const Dl=s.createLayout([{type:"Float32",name:"a_pos",components:3},{type:"Float32",name:"a_uv",components:2}]);class Mf{constructor(o){const c=new s.StructArrayLayout5f20;c.emplaceBack(-1,1,1,0,0),c.emplaceBack(1,1,1,1,0),c.emplaceBack(1,-1,1,1,1),c.emplaceBack(-1,-1,1,0,1);const f=new s.StructArrayLayout3ui6;f.emplaceBack(0,1,2),f.emplaceBack(2,3,0),this.vertexBuffer=o.createVertexBuffer(c,Dl.members),this.indexBuffer=o.createIndexBuffer(f),this.segments=s.SegmentVector.simpleSegment(0,0,4,2)}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy()}}const Rs={symbol:function(d,o,c,f,_){if(d.renderPass!=="translucent")return;const x=s.StencilMode.disabled,T=d.colorModeForRenderPass();c.layout.get("text-variable-anchor")&&function(S,C,z,P,O,j,W){const H=C.transform,Z=O==="map",X=j==="map";for(const B of S){const q=P.getTile(B),Q=q.getBucket(z);if(!Q||!Q.text||!Q.text.segments.get().length)continue;const ee=s.evaluateSizeForZoom(Q.textSizeData,H.zoom),de=Sn(B,Q.getProjection(),H),fe=H.calculatePixelsToTileUnitsMatrix(q),pe=Re(de,q.tileID.canonical,X,Z,H,Q.getProjection(),fe),xe=z.layout.get("icon-text-fit")!=="none"&&Q.hasIconData();if(ee){const ye=Math.pow(2,H.zoom-q.tileID.overscaledZ);J_(Q,Z,X,W,s.symbolSize,H,pe,B,ye,ee,xe)}}}(f,d,c,o,c.layout.get("text-rotation-alignment"),c.layout.get("text-pitch-alignment"),_),c.paint.get("icon-opacity").constantOr(1)!==0&&Tf(d,o,c,f,!1,c.paint.get("icon-translate"),c.paint.get("icon-translate-anchor"),c.layout.get("icon-rotation-alignment"),c.layout.get("icon-pitch-alignment"),c.layout.get("icon-keep-upright"),x,T),c.paint.get("text-opacity").constantOr(1)!==0&&Tf(d,o,c,f,!0,c.paint.get("text-translate"),c.paint.get("text-translate-anchor"),c.layout.get("text-rotation-alignment"),c.layout.get("text-pitch-alignment"),c.layout.get("text-keep-upright"),x,T),o.map.showCollisionBoxes&&(Ll(d,o,c,f,c.paint.get("text-translate"),c.paint.get("text-translate-anchor"),!0),Ll(d,o,c,f,c.paint.get("icon-translate"),c.paint.get("icon-translate-anchor"),!1))},circle:function(d,o,c,f){if(d.renderPass!=="translucent")return;const _=c.paint.get("circle-opacity"),x=c.paint.get("circle-stroke-width"),T=c.paint.get("circle-stroke-opacity"),S=c.layout.get("circle-sort-key").constantOr(1)!==void 0;if(_.constantOr(1)===0&&(x.constantOr(1)===0||T.constantOr(1)===0))return;const C=d.context,z=C.gl,P=d.transform,O=d.depthModeForSublayer(0,s.DepthMode.ReadOnly),j=s.StencilMode.disabled,W=d.colorModeForRenderPass(),H=P.projection.name==="globe",Z=[s.mercatorXfromLng(P.center.lng),s.mercatorYfromLat(P.center.lat)],X=[];for(let q=0;qq.sortKey-Q.sortKey);const B={useDepthForOcclusion:!H};for(const q of X){const{programConfiguration:Q,program:ee,layoutVertexBuffer:de,globeExtVertexBuffer:fe,indexBuffer:pe,uniformValues:xe,tile:ye}=q.state,Ae=q.segments;d.terrain&&d.terrain.setupElevationDraw(ye,ee,B),d.prepareDrawProgram(C,ee,ye.tileID.toUnwrapped()),ee.draw(C,z.TRIANGLES,O,j,W,s.CullFaceMode.disabled,xe,c.id,de,pe,Ae,c.paint,P.zoom,Q,[fe])}},heatmap:function(d,o,c,f){if(c.paint.get("heatmap-opacity")!==0)if(d.renderPass==="offscreen"){const _=d.context,x=_.gl,T=s.StencilMode.disabled,S=new s.ColorMode([x.ONE,x.ONE],s.Color.transparent,[!0,!0,!0,!0]);(function(W,H,Z,X){const B=W.gl,q=H.width*X,Q=H.height*X;W.activeTexture.set(B.TEXTURE1),W.viewport.set([0,0,q,Q]);let ee=Z.heatmapFbo;if(!ee||ee&&(ee.width!==q||ee.height!==Q)){ee&&ee.destroy();const de=B.createTexture();B.bindTexture(B.TEXTURE_2D,de),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_WRAP_S,B.CLAMP_TO_EDGE),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_WRAP_T,B.CLAMP_TO_EDGE),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_MIN_FILTER,B.LINEAR),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_MAG_FILTER,B.LINEAR),ee=Z.heatmapFbo=W.createFramebuffer(q,Q,!1),function(fe,pe,xe,ye,Ae,We){const Ee=fe.gl;Ee.texImage2D(Ee.TEXTURE_2D,0,fe.isWebGL2&&fe.extRenderToTextureHalfFloat?Ee.RGBA16F:Ee.RGBA,Ae,We,0,Ee.RGBA,fe.extRenderToTextureHalfFloat?fe.isWebGL2?Ee.HALF_FLOAT:fe.extTextureHalfFloat.HALF_FLOAT_OES:Ee.UNSIGNED_BYTE,null),ye.colorAttachment.set(xe)}(W,0,de,ee,q,Q)}else B.bindTexture(B.TEXTURE_2D,ee.colorAttachment.get()),W.bindFramebuffer.set(ee.framebuffer)})(_,d,c,d.transform.projection.name==="globe"?.5:.25),_.clear({color:s.Color.transparent});const C=d.transform,z=C.projection.name==="globe",P=z?["PROJECTION_GLOBE_VIEW"]:null,O=z?s.CullFaceMode.frontCCW:s.CullFaceMode.disabled,j=[s.mercatorXfromLng(C.center.lng),s.mercatorYfromLat(C.center.lat)];for(let W=0;W({u_image:0,u_color_ramp:1,u_opacity:O.paint.get("heatmap-opacity")}))(0,x),x.id,_.viewportBuffer,_.quadTriangleIndexBuffer,_.viewportSegments,x.paint,_.transform.zoom)}(d,c))},line:function(d,o,c,f){if(d.renderPass!=="translucent")return;const _=c.paint.get("line-opacity"),x=c.paint.get("line-width");if(_.constantOr(1)===0||x.constantOr(1)===0)return;const T=d.depthModeForSublayer(0,s.DepthMode.ReadOnly),S=d.colorModeForRenderPass(),C=d.terrain&&d.terrain.renderingToTexture?1:s.exported.devicePixelRatio,z=c.paint.get("line-dasharray"),P=z.constantOr(1),O=c.layout.get("line-cap"),j=c.paint.get("line-pattern"),W=j.constantOr(1),H=c.paint.get("line-gradient"),Z=W?"linePattern":"line",X=d.context,B=X.gl,q=(ee=>{const de=[];zl(ee)&&de.push("RENDER_LINE_DASH"),ee.paint.get("line-gradient")&&de.push("RENDER_LINE_GRADIENT");const fe=ee.paint.get("line-trim-offset");fe[0]===0&&fe[1]===0||de.push("RENDER_LINE_TRIM_OFFSET");const pe=ee.paint.get("line-pattern").constantOr(1),xe=ee.paint.get("line-opacity").constantOr(1)!==1;return!pe&&xe&&de.push("RENDER_LINE_ALPHA_DISCARD"),de})(c);let Q=q.includes("RENDER_LINE_ALPHA_DISCARD");d.terrain&&d.terrain.clipOrMaskOverlapStencilType()&&(Q=!1);for(const ee of f){const de=o.getTile(ee);if(W&&!de.patternsLoaded())continue;const fe=de.getBucket(c);if(!fe)continue;d.prepareDrawTile();const pe=fe.programConfigurations.get(c.id),xe=d.useProgram(Z,pe,q),ye=j.constantOr(null);if(ye&&de.imageAtlas){const Be=de.imageAtlas.patternPositions[ye.toString()];Be&&pe.setConstantPatternPositions(Be)}const Ae=z.constantOr(null),We=O.constantOr(null);if(!W&&Ae&&We&&de.lineAtlas){const Be=de.lineAtlas.getDash(Ae,We);Be&&pe.setConstantPatternPositions(Be)}let[Ee,Fe]=c.paint.get("line-trim-offset");(We==="round"||We==="square")&&Ee!==Fe&&(Ee===0&&(Ee-=1),Fe===1&&(Fe+=1));const ke=d.terrain?ee.projMatrix:null,qe=W?Pl(d,de,c,ke,C):K_(d,de,c,ke,fe.lineClipsArray.length,C,[Ee,Fe]);if(H){const Be=fe.gradients[c.id];let Xe=Be.texture;if(c.gradientVersion!==Be.version){let $e=256;if(c.stepInterpolant){const Ye=o.getSource().maxzoom,gt=ee.canonical.z===Ye?Math.ceil(1<{xe.draw(X,B.TRIANGLES,T,Be,S,s.CullFaceMode.disabled,qe,c.id,fe.layoutVertexBuffer,fe.indexBuffer,fe.segments,c.paint,d.transform.zoom,pe,[fe.layoutVertexBuffer2])};if(Q){const Be=d.stencilModeForClipping(ee).ref;Be===0&&d.terrain&&X.clear({stencil:0});const Xe={func:B.EQUAL,mask:255};qe.u_alpha_discard_threshold=.8,Se(new s.StencilMode(Xe,Be,255,B.KEEP,B.KEEP,B.INVERT)),qe.u_alpha_discard_threshold=0,Se(new s.StencilMode(Xe,Be,255,B.KEEP,B.KEEP,B.KEEP))}else Se(d.stencilModeForClipping(ee))}Q&&(d.resetStencilClippingMasks(),d.terrain&&X.clear({stencil:0}))},fill:function(d,o,c,f){const _=c.paint.get("fill-color"),x=c.paint.get("fill-opacity");if(x.constantOr(1)===0)return;const T=d.colorModeForRenderPass(),S=c.paint.get("fill-pattern"),C=d.opaquePassEnabledForLayer()&&!S.constantOr(1)&&_.constantOr(s.Color.transparent).a===1&&x.constantOr(0)===1?"opaque":"translucent";if(d.renderPass===C){const z=d.depthModeForSublayer(1,d.renderPass==="opaque"?s.DepthMode.ReadWrite:s.DepthMode.ReadOnly);Sf(d,o,c,f,z,T,!1)}if(d.renderPass==="translucent"&&c.paint.get("fill-antialias")){const z=d.depthModeForSublayer(c.getPaintProperty("fill-outline-color")?2:0,s.DepthMode.ReadOnly);Sf(d,o,c,f,z,T,!0)}},"fill-extrusion":function(d,o,c,f){const _=c.paint.get("fill-extrusion-opacity");if(_!==0&&d.renderPass==="translucent"){const x=new s.DepthMode(d.context.gl.LEQUAL,s.DepthMode.ReadWrite,d.depthRangeFor3D);if(_!==1||c.paint.get("fill-extrusion-pattern").constantOr(1))jc(d,o,c,f,x,s.StencilMode.disabled,s.ColorMode.disabled),jc(d,o,c,f,x,d.stencilModeFor3D(),d.colorModeForRenderPass()),d.resetStencilClippingMasks();else{const T=d.colorModeForRenderPass();jc(d,o,c,f,x,s.StencilMode.disabled,T)}}},hillshade:function(d,o,c,f){if(d.renderPass!=="offscreen"&&d.renderPass!=="translucent")return;const _=d.context,x=d.depthModeForSublayer(0,s.DepthMode.ReadOnly),T=d.colorModeForRenderPass(),S=d.terrain&&d.terrain.renderingToTexture,[C,z]=d.renderPass!=="translucent"||S?[{},f]:d.stencilConfigForOverlap(f);for(const P of z){const O=o.getTile(P);if(O.needsHillshadePrepare&&d.renderPass==="offscreen")gf(d,O,c,x,s.StencilMode.disabled,T);else if(d.renderPass==="translucent"){const j=S&&d.terrain?d.terrain.stencilModeForRTTOverlap(P):C[P.overscaledZ];mf(d,P,O,c,x,j,T)}}_.viewport.set([0,0,d.width,d.height]),d.resetStencilClippingMasks()},raster:function(d,o,c,f,_,x){if(d.renderPass!=="translucent"||c.paint.get("raster-opacity")===0||!f.length)return;const T=d.context,S=T.gl,C=o.getSource(),z=d.useProgram("raster"),P=d.colorModeForRenderPass(),O=d.terrain&&d.terrain.renderingToTexture,[j,W]=C instanceof Rt||O?[{},f]:d.stencilConfigForOverlap(f),H=W[W.length-1].overscaledZ,Z=!d.options.moving;for(const X of W){const B=O?s.DepthMode.disabled:d.depthModeForSublayer(X.overscaledZ-H,c.paint.get("raster-opacity")===1?s.DepthMode.ReadWrite:s.DepthMode.ReadOnly,S.LESS),q=X.toUnwrapped(),Q=o.getTile(X);if(O&&(!Q||!Q.hasData()))continue;const ee=O?X.projMatrix:d.transform.calculateProjMatrix(q,Z),de=d.terrain&&O?d.terrain.stencilModeForRTTOverlap(X):j[X.overscaledZ],fe=x?0:c.paint.get("raster-fade-duration");Q.registerFadeDuration(fe);const pe=o.findLoadedParent(X,0),xe=Nh(Q,pe,o,d.transform,fe);let ye,Ae;d.terrain&&d.terrain.prepareDrawTile();const We=c.paint.get("raster-resampling")==="nearest"?S.NEAREST:S.LINEAR;T.activeTexture.set(S.TEXTURE0),Q.texture.bind(We,S.CLAMP_TO_EDGE),T.activeTexture.set(S.TEXTURE1),pe?(pe.texture.bind(We,S.CLAMP_TO_EDGE),ye=Math.pow(2,pe.tileID.overscaledZ-Q.tileID.overscaledZ),Ae=[Q.tileID.canonical.x*ye%1,Q.tileID.canonical.y*ye%1]):Q.texture.bind(We,S.CLAMP_TO_EDGE),Q.texture.useMipmap&&T.extTextureFilterAnisotropic&&d.transform.pitch>20&&S.texParameterf(S.TEXTURE_2D,T.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,T.extTextureFilterAnisotropicMax);const Ee=Hh(ee,Ae||[0,0],ye||1,xe,c,C instanceof Rt?C.perspectiveTransform:[0,0]);if(d.prepareDrawProgram(T,z,q),C instanceof Rt)C.boundsBuffer&&C.boundsSegments&&z.draw(T,S.TRIANGLES,B,s.StencilMode.disabled,P,s.CullFaceMode.disabled,Ee,c.id,C.boundsBuffer,d.quadTriangleIndexBuffer,C.boundsSegments);else{const{tileBoundsBuffer:Fe,tileBoundsIndexBuffer:ke,tileBoundsSegments:qe}=d.getTileBoundsBuffers(Q);z.draw(T,S.TRIANGLES,B,de,P,s.CullFaceMode.disabled,Ee,c.id,Fe,ke,qe)}}d.resetStencilClippingMasks()},background:function(d,o,c,f){const _=c.paint.get("background-color"),x=c.paint.get("background-opacity");if(x===0)return;const T=d.context,S=T.gl,C=d.transform,z=C.tileSize,P=c.paint.get("background-pattern");if(d.isPatternMissing(P))return;const O=!P&&_.a===1&&x===1&&d.opaquePassEnabledForLayer()?"opaque":"translucent";if(d.renderPass!==O)return;const j=s.StencilMode.disabled,W=d.depthModeForSublayer(0,O==="opaque"?s.DepthMode.ReadWrite:s.DepthMode.ReadOnly),H=d.colorModeForRenderPass(),Z=d.useProgram(P?"backgroundPattern":"background");let X,B=f;B||(X=d.getBackgroundTiles(),B=Object.values(X).map(q=>q.tileID)),P&&(T.activeTexture.set(S.TEXTURE0),d.imageManager.bind(d.context));for(const q of B){const Q=q.toUnwrapped(),ee=f?q.projMatrix:d.transform.calculateProjMatrix(Q);d.prepareDrawTile();const de=o?o.getTile(q):X?X[q.key]:new s.Tile(q,z,C.zoom,d),fe=P?Y_(ee,x,d,P,{tileID:q,tileSize:z}):Kh(ee,x,_);d.prepareDrawProgram(T,Z,Q);const{tileBoundsBuffer:pe,tileBoundsIndexBuffer:xe,tileBoundsSegments:ye}=d.getTileBoundsBuffers(de);Z.draw(T,S.TRIANGLES,W,j,H,s.CullFaceMode.disabled,fe,c.id,pe,xe,ye)}},sky:function(d,o,c){const f=d.transform,_=f.projection.name==="mercator"||f.projection.name==="globe"?1:s.smoothstep(7,8,f.zoom),x=c.paint.get("sky-opacity")*_;if(x===0)return;const T=d.context,S=c.paint.get("sky-type"),C=new s.DepthMode(T.gl.LEQUAL,s.DepthMode.ReadOnly,[0,1]),z=d.frameCounter/1e3%1;S==="atmosphere"?d.renderPass==="offscreen"?c.needsSkyboxCapture(d)&&(function(P,O,j,W){const H=P.context,Z=H.gl;let X=O.skyboxFbo;if(!X){X=O.skyboxFbo=H.createFramebuffer(32,32,!1),O.skyboxGeometry=new $c(H),O.skyboxTexture=H.gl.createTexture(),Z.bindTexture(Z.TEXTURE_CUBE_MAP,O.skyboxTexture),Z.texParameteri(Z.TEXTURE_CUBE_MAP,Z.TEXTURE_WRAP_S,Z.CLAMP_TO_EDGE),Z.texParameteri(Z.TEXTURE_CUBE_MAP,Z.TEXTURE_WRAP_T,Z.CLAMP_TO_EDGE),Z.texParameteri(Z.TEXTURE_CUBE_MAP,Z.TEXTURE_MIN_FILTER,Z.LINEAR),Z.texParameteri(Z.TEXTURE_CUBE_MAP,Z.TEXTURE_MAG_FILTER,Z.LINEAR);for(let ee=0;ee<6;++ee)Z.texImage2D(Z.TEXTURE_CUBE_MAP_POSITIVE_X+ee,0,Z.RGBA,32,32,0,Z.RGBA,Z.UNSIGNED_BYTE,null)}H.bindFramebuffer.set(X.framebuffer),H.viewport.set([0,0,32,32]);const B=O.getCenter(P,!0),q=P.useProgram("skyboxCapture"),Q=new Float64Array(16);s.identity(Q),s.rotateY(Q,Q,.5*-Math.PI),_i(H,O,q,Q,B,0),s.identity(Q),s.rotateY(Q,Q,.5*Math.PI),_i(H,O,q,Q,B,1),s.identity(Q),s.rotateX(Q,Q,.5*-Math.PI),_i(H,O,q,Q,B,2),s.identity(Q),s.rotateX(Q,Q,.5*Math.PI),_i(H,O,q,Q,B,3),s.identity(Q),_i(H,O,q,Q,B,4),s.identity(Q),s.rotateY(Q,Q,Math.PI),_i(H,O,q,Q,B,5),H.viewport.set([0,0,P.width,P.height])}(d,c),c.markSkyboxValid(d)):d.renderPass==="sky"&&function(P,O,j,W,H){const Z=P.context,X=Z.gl,B=P.transform,q=P.useProgram("skybox");Z.activeTexture.set(X.TEXTURE0),X.bindTexture(X.TEXTURE_CUBE_MAP,O.skyboxTexture);const Q=((ee,de,fe,pe,xe)=>({u_matrix:ee,u_sun_direction:de,u_cubemap:0,u_opacity:pe,u_temporal_offset:xe}))(B.skyboxMatrix,O.getCenter(P,!1),0,W,H);P.prepareDrawProgram(Z,q),q.draw(Z,X.TRIANGLES,j,s.StencilMode.disabled,P.colorModeForRenderPass(),s.CullFaceMode.backCW,Q,"skybox",O.skyboxGeometry.vertexBuffer,O.skyboxGeometry.indexBuffer,O.skyboxGeometry.segment)}(d,c,C,x,z):S==="gradient"&&d.renderPass==="sky"&&function(P,O,j,W,H){const Z=P.context,X=Z.gl,B=P.transform,q=P.useProgram("skyboxGradient");O.skyboxGeometry||(O.skyboxGeometry=new $c(Z)),Z.activeTexture.set(X.TEXTURE0);let Q=O.colorRampTexture;Q||(Q=O.colorRampTexture=new s.Texture(Z,O.colorRamp,X.RGBA)),Q.bind(X.LINEAR,X.CLAMP_TO_EDGE);const ee=((de,fe,pe,xe,ye)=>({u_matrix:de,u_color_ramp:0,u_center_direction:fe,u_radius:s.degToRad(pe),u_opacity:xe,u_temporal_offset:ye}))(B.skyboxMatrix,O.getCenter(P,!1),O.paint.get("sky-gradient-radius"),W,H);P.prepareDrawProgram(Z,q),q.draw(Z,X.TRIANGLES,j,s.StencilMode.disabled,P.colorModeForRenderPass(),s.CullFaceMode.backCW,ee,"skyboxGradient",O.skyboxGeometry.vertexBuffer,O.skyboxGeometry.indexBuffer,O.skyboxGeometry.segment)}(d,c,C,x,z)},debug:function(d,o,c){for(let f=0;f_)return void(this.transform.fogCullDistSq=null);const x=f+.78*(_-f);this.transform.fogCullDistSq=x*x}get terrain(){return this.transform._terrainEnabled()&&this._terrain&&this._terrain.enabled?this._terrain:null}resize(o,c){if(this.width=o*s.exported.devicePixelRatio,this.height=c*s.exported.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const f of this.style.order)this.style._layers[f].resize()}setup(){const o=this.context,c=new s.StructArrayLayout2i4;c.emplaceBack(0,0),c.emplaceBack(s.EXTENT,0),c.emplaceBack(0,s.EXTENT),c.emplaceBack(s.EXTENT,s.EXTENT),this.tileExtentBuffer=o.createVertexBuffer(c,s.posAttributes.members),this.tileExtentSegments=s.SegmentVector.simpleSegment(0,0,4,2);const f=new s.StructArrayLayout2i4;f.emplaceBack(0,0),f.emplaceBack(s.EXTENT,0),f.emplaceBack(0,s.EXTENT),f.emplaceBack(s.EXTENT,s.EXTENT),this.debugBuffer=o.createVertexBuffer(f,s.posAttributes.members),this.debugSegments=s.SegmentVector.simpleSegment(0,0,4,5);const _=new s.StructArrayLayout2i4;_.emplaceBack(-1,-1),_.emplaceBack(1,-1),_.emplaceBack(-1,1),_.emplaceBack(1,1),this.viewportBuffer=o.createVertexBuffer(_,s.posAttributes.members),this.viewportSegments=s.SegmentVector.simpleSegment(0,0,4,2);const x=new s.StructArrayLayout4i8;x.emplaceBack(0,0,0,0),x.emplaceBack(s.EXTENT,0,s.EXTENT,0),x.emplaceBack(0,s.EXTENT,0,s.EXTENT),x.emplaceBack(s.EXTENT,s.EXTENT,s.EXTENT,s.EXTENT),this.mercatorBoundsBuffer=o.createVertexBuffer(x,s.boundsAttributes.members),this.mercatorBoundsSegments=s.SegmentVector.simpleSegment(0,0,4,2);const T=new s.StructArrayLayout3ui6;T.emplaceBack(0,1,2),T.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=o.createIndexBuffer(T);const S=new s.StructArrayLayout1ui2;for(const z of[0,1,3,2,0])S.emplaceBack(z);this.debugIndexBuffer=o.createIndexBuffer(S),this.emptyTexture=new s.Texture(o,new s.RGBAImage({width:1,height:1},Uint8Array.of(0,0,0,0)),o.gl.RGBA),this.identityMat=s.create();const C=this.context.gl;this.stencilClearMode=new s.StencilMode({func:C.ALWAYS,mask:0},0,255,C.ZERO,C.ZERO,C.ZERO),this.loadTimeStamps.push(s.window.performance.now()),this.atmosphereBuffer=new Mf(this.context)}getMercatorTileBoundsBuffers(){return{tileBoundsBuffer:this.mercatorBoundsBuffer,tileBoundsIndexBuffer:this.quadTriangleIndexBuffer,tileBoundsSegments:this.mercatorBoundsSegments}}getTileBoundsBuffers(o){return o._makeTileBoundsBuffers(this.context,this.transform.projection),o._tileBoundsBuffer?{tileBoundsBuffer:o._tileBoundsBuffer,tileBoundsIndexBuffer:o._tileBoundsIndexBuffer,tileBoundsSegments:o._tileBoundsSegments}:this.getMercatorTileBoundsBuffers()}clearStencil(){const o=this.context,c=o.gl;this.nextStencilID=1,this.currentStencilSource=void 0,this._tileClippingMaskIDs={},this.useProgram("clippingMask").draw(o,c.TRIANGLES,s.DepthMode.disabled,this.stencilClearMode,s.ColorMode.disabled,s.CullFaceMode.disabled,kl(this.identityMat),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}resetStencilClippingMasks(){this.terrain||(this.currentStencilSource=void 0,this._tileClippingMaskIDs={})}_renderTileClippingMasks(o,c,f){if(!c||this.currentStencilSource===c.id||!o.isTileClipped()||!f||f.length===0)return;if(this._tileClippingMaskIDs&&!this.terrain){let S=!1;for(const C of f)if(this._tileClippingMaskIDs[C.key]===void 0){S=!0;break}if(!S)return}this.currentStencilSource=c.id;const _=this.context,x=_.gl;this.nextStencilID+f.length>256&&this.clearStencil(),_.setColorMode(s.ColorMode.disabled),_.setDepthMode(s.DepthMode.disabled);const T=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const S of f){const C=c.getTile(S),z=this._tileClippingMaskIDs[S.key]=this.nextStencilID++,{tileBoundsBuffer:P,tileBoundsIndexBuffer:O,tileBoundsSegments:j}=this.getTileBoundsBuffers(C);T.draw(_,x.TRIANGLES,s.DepthMode.disabled,new s.StencilMode({func:x.ALWAYS,mask:0},z,255,x.KEEP,x.KEEP,x.REPLACE),s.ColorMode.disabled,s.CullFaceMode.disabled,kl(S.projMatrix),"$clipping",P,O,j)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const o=this.nextStencilID++,c=this.context.gl;return new s.StencilMode({func:c.NOTEQUAL,mask:255},o,255,c.KEEP,c.KEEP,c.REPLACE)}stencilModeForClipping(o){if(this.terrain)return this.terrain.stencilModeForRTTOverlap(o);const c=this.context.gl;return new s.StencilMode({func:c.EQUAL,mask:255},this._tileClippingMaskIDs[o.key],0,c.KEEP,c.KEEP,c.REPLACE)}stencilConfigForOverlap(o){const c=this.context.gl,f=o.sort((T,S)=>S.overscaledZ-T.overscaledZ),_=f[f.length-1].overscaledZ,x=f[0].overscaledZ-_+1;if(x>1){this.currentStencilSource=void 0,this.nextStencilID+x>256&&this.clearStencil();const T={};for(let S=0;S=0;this.currentLayer--){const z=this.style._layers[f[this.currentLayer]],P=o._getLayerSourceCache(z);if(z.isSky())continue;const O=P?T[P.id]:void 0;this._renderTileClippingMasks(z,P,O),this.renderLayer(this,P,z,O)}if(this.style.fog&&this.transform.projection.supportsFog&&function(z,P){const O=z.context,j=O.gl,W=z.transform,H=new s.DepthMode(j.LEQUAL,s.DepthMode.ReadOnly,[0,1]),Z=z.useProgram("globeAtmosphere",null,W.projection.name==="globe"?["PROJECTION_GLOBE_VIEW","FOG"]:["FOG"]),X=s.globeToMercatorTransition(W.zoom),B=P.properties.get("color").toArray01(),q=P.properties.get("high-color").toArray01(),Q=P.properties.get("space-color").toArray01PremultipliedAlpha(),ee=s.identity$1([]);s.rotateY$1(ee,ee,-s.degToRad(W._center.lng)),s.rotateX$1(ee,ee,s.degToRad(W._center.lat)),s.rotateZ$1(ee,ee,W.angle),s.rotateX$1(ee,ee,-W._pitch);const de=s.fromQuat(new Float32Array(16),ee),fe=s.mapValue(P.properties.get("star-intensity"),0,1,0,.25),pe=5e-4,xe=s.mapValue(P.properties.get("horizon-blend"),0,1,pe,.25),ye=s.globeUseCustomAntiAliasing(z,O,W)&&xe===pe?W.worldSize/(2*Math.PI*1.025)-1:W.globeRadius,Ae=z.frameCounter/1e3%1,We=s.length(W.globeCenterInViewSpace),Ee=Math.sqrt(Math.pow(We,2)-Math.pow(ye,2)),Fe=Math.acos(Ee/We),ke=((Se,Be,Xe,$e,Ye,gt,Et,pt,wt,Ut,Ot,mt,en,rn)=>({u_frustum_tl:Se,u_frustum_tr:Be,u_frustum_br:Xe,u_frustum_bl:$e,u_horizon:Ye,u_transition:gt,u_fadeout_range:Et,u_color:pt,u_high_color:wt,u_space_color:Ut,u_star_intensity:Ot,u_star_size:5*s.exported.devicePixelRatio,u_star_density:0,u_temporal_offset:mt,u_horizon_angle:en,u_rotation_matrix:rn}))(W.frustumCorners.TL,W.frustumCorners.TR,W.frustumCorners.BR,W.frustumCorners.BL,W.frustumCorners.horizon,X,xe,B,q,Q,fe,Ae,Fe,de);z.prepareDrawProgram(O,Z);const qe=z.atmosphereBuffer;qe&&Z.draw(O,j.TRIANGLES,H,s.StencilMode.disabled,s.ColorMode.alphaBlended,s.CullFaceMode.backCW,ke,"skybox",qe.vertexBuffer,qe.indexBuffer,qe.segments)}(this,this.style.fog),this.renderPass="sky",(s.globeToMercatorTransition(this.transform.zoom)>0||this.transform.projection.name!=="globe")&&this.transform.isHorizonVisible())for(this.currentLayer=0;this.currentLayer{const O=o._getLayerSourceCache(P);O&&!P.isHidden(this.transform.zoom)&&(!z||z.getSource().maxzoom0?c.pop():null}isPatternMissing(o){return o===null||o!==void 0&&!this.imageManager.getPattern(o.toString())}terrainRenderModeElevated(){return this.style&&!!this.style.getTerrain()&&!!this.terrain&&!this.terrain.renderingToTexture}currentGlobalDefines(){const o=this.terrain&&this.terrain.renderingToTexture,c=this.terrain&&this.terrain.exaggeration()===0,f=this.style&&this.style.fog,_=[];return this.terrainRenderModeElevated()&&_.push("TERRAIN"),this.transform.projection.name==="globe"&&_.push("GLOBE"),c&&_.push("ZERO_EXAGGERATION"),f&&!o&&f.getOpacity(this.transform.pitch)!==0&&_.push("FOG"),o&&_.push("RENDER_TO_TEXTURE"),this._showOverdrawInspector&&_.push("OVERDRAW_INSPECTOR"),_}useProgram(o,c,f){this.cache=this.cache||{};const _=f||[],x=this.currentGlobalDefines().concat(_),T=Wt.cacheKey(Dh[o],o,x,c);return this.cache[T]||(this.cache[T]=new Wt(this.context,o,Dh[o],c,Yh[o],x)),this.cache[T]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.frontFace.setDefault(),this.context.cullFaceSide.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const o=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(o.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=s.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new s.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this._terrain&&this._terrain.destroy(),this.globeSharedBuffers&&this.globeSharedBuffers.destroy(),this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.atmosphereBuffer&&this.atmosphereBuffer.destroy()}prepareDrawTile(){this.terrain&&this.terrain.prepareDrawTile()}prepareDrawProgram(o,c,f){if(this.terrain&&this.terrain.renderingToTexture)return;const _=this.style.fog;if(_){const x=_.getOpacity(this.transform.pitch),T=((S,C,z,P,O,j,W,H,Z,X,B)=>{const q=S.transform,Q=C.properties.get("color").toArray01();Q[3]=P;const ee=S.frameCounter/1e3%1;return{u_fog_matrix:z?q.calculateFogTileMatrix(z):S.identityMat,u_fog_range:C.getFovAdjustedRange(q._fov),u_fog_color:Q,u_fog_horizon_blend:C.properties.get("horizon-blend"),u_fog_temporal_offset:ee,u_frustum_tl:O,u_frustum_tr:j,u_frustum_br:W,u_frustum_bl:H,u_globe_pos:Z,u_globe_radius:X,u_viewport:B,u_globe_transition:s.globeToMercatorTransition(q.zoom),u_is_globe:+(q.projection.name==="globe")}})(this,_,f,x,this.transform.frustumCorners.TL,this.transform.frustumCorners.TR,this.transform.frustumCorners.BR,this.transform.frustumCorners.BL,this.transform.globeCenterInViewSpace,this.transform.globeRadius,[this.transform.width*s.exported.devicePixelRatio,this.transform.height*s.exported.devicePixelRatio]);c.setFogUniformValues(o,T)}}setTileLoadedFlag(o){this.tileLoaded=o}saveCanvasCopy(){const o=this.canvasCopy();o&&(this.frameCopies.push(o),this.tileLoaded=!1)}canvasCopy(){const o=this.context.gl,c=o.createTexture();return o.bindTexture(o.TEXTURE_2D,c),o.copyTexImage2D(o.TEXTURE_2D,0,o.RGBA,0,0,o.drawingBufferWidth,o.drawingBufferHeight,0),c}getCanvasCopiesAndTimestamps(){return{canvasCopies:this.frameCopies,timeStamps:this.loadTimeStamps}}averageElevationNeedsEasing(){if(!this.transform._elevation)return!1;const o=this.style&&this.style.fog;return!!o&&o.getOpacity(this.transform.pitch)!==0}getBackgroundTiles(){const o=this._backgroundTiles,c=this._backgroundTiles={},f=this.transform.coveringTiles({tileSize:512});for(const _ of f)c[_.key]=o[_.key]||new s.Tile(_,512,this.transform.tileZoom,this);return c}clearBackgroundTiles(){this._backgroundTiles={}}}class Gc{constructor(o=0,c=0,f=0,_=0){if(isNaN(o)||o<0||isNaN(c)||c<0||isNaN(f)||f<0||isNaN(_)||_<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=o,this.bottom=c,this.left=f,this.right=_}interpolate(o,c,f){return c.top!=null&&o.top!=null&&(this.top=s.number(o.top,c.top,f)),c.bottom!=null&&o.bottom!=null&&(this.bottom=s.number(o.bottom,c.bottom,f)),c.left!=null&&o.left!=null&&(this.left=s.number(o.left,c.left,f)),c.right!=null&&o.right!=null&&(this.right=s.number(o.right,c.right,f)),this}getCenter(o,c){const f=s.clamp((this.left+o-this.right)/2,0,o),_=s.clamp((this.top+c-this.bottom)/2,0,c);return new s.Point(f,_)}equals(o){return this.top===o.top&&this.bottom===o.bottom&&this.left===o.left&&this.right===o.right}clone(){return new Gc(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function qc(d,o){const c=s.getColumn(d,3);s.fromQuat(d,o),s.setColumn(d,3,c)}function Zt(d,o){const c=s.identity$1([]);return s.rotateZ$1(c,c,-o),s.rotateX$1(c,c,-d),c}function Ol(d,o){const c=[d[0],d[1],0],f=[o[0],o[1],0];if(s.length(c)>=1e-15){const T=s.normalize([],c);s.scale$2(f,T,s.dot(f,T)),o[0]=f[0],o[1]=f[1]}const _=s.cross([],o,d);if(s.len(_)<1e-15)return null;const x=Math.atan2(-_[1],_[0]);return Zt(Math.atan2(Math.sqrt(d[0]*d[0]+d[1]*d[1]),-d[2]),x)}class Pf{constructor(o,c){this.position=o,this.orientation=c}get position(){return this._position}set position(o){if(o){const c=o instanceof s.MercatorCoordinate?o:new s.MercatorCoordinate(o[0],o[1],o[2]);this._renderWorldCopies&&(c.x=s.wrap(c.x,0,1)),this._position=c}else this._position=null}lookAtPoint(o,c){if(this.orientation=null,!this.position)return;const f=this.position,_=this._elevation?this._elevation.getAtPointOrZero(s.MercatorCoordinate.fromLngLat(o)):0,x=s.MercatorCoordinate.fromLngLat(o,_),T=[x.x-f.x,x.y-f.y,x.z-f.z];c||(c=[0,0,1]),c[2]=Math.abs(c[2]),this.orientation=Ol(T,c)}setPitchBearing(o,c){this.orientation=Zt(s.degToRad(o),s.degToRad(-c))}}class Wc{constructor(o,c){this._transform=s.identity([]),this.orientation=c,this.position=o}get mercatorPosition(){const o=this.position;return new s.MercatorCoordinate(o[0],o[1],o[2])}get position(){const o=s.getColumn(this._transform,3);return[o[0],o[1],o[2]]}set position(o){var c;o&&s.setColumn(this._transform,3,[(c=o)[0],c[1],c[2],1])}get orientation(){return this._orientation}set orientation(o){this._orientation=o||s.identity$1([]),o&&qc(this._transform,this._orientation)}getPitchBearing(){const o=this.forward(),c=this.right();return{bearing:Math.atan2(-c[1],c[0]),pitch:Math.atan2(Math.sqrt(o[0]*o[0]+o[1]*o[1]),-o[2])}}setPitchBearing(o,c){this._orientation=Zt(o,c),qc(this._transform,this._orientation)}forward(){const o=s.getColumn(this._transform,2);return[-o[0],-o[1],-o[2]]}up(){const o=s.getColumn(this._transform,1);return[-o[0],-o[1],-o[2]]}right(){const o=s.getColumn(this._transform,0);return[o[0],o[1],o[2]]}getCameraToWorld(o,c){const f=new Float64Array(16);return s.invert(f,this.getWorldToCamera(o,c)),f}getWorldToCameraPosition(o,c,f){const _=this.position;s.scale$2(_,_,-o);const x=new Float64Array(16);return s.fromScaling(x,[f,f,f]),s.translate(x,x,_),x[10]*=c,x}getWorldToCamera(o,c){const f=new Float64Array(16),_=new Float64Array(4),x=this.position;return s.conjugate(_,this._orientation),s.scale$2(x,x,-o),s.fromQuat(f,_),s.translate(f,f,x),f[1]*=-1,f[5]*=-1,f[9]*=-1,f[13]*=-1,f[8]*=c,f[9]*=c,f[10]*=c,f[11]*=c,f}getCameraToClipPerspective(o,c,f,_){const x=new Float64Array(16);return s.perspective(x,o,c,f,_),x}getDistanceToElevation(o,c=!1){const f=o===0?0:s.mercatorZfromAltitude(o,c?s.latFromMercatorY(this.position[1]):this.position[1]),_=this.forward();return(f-this.position[2])/_[2]}clone(){return new Wc([...this.position],[...this.orientation])}}function Ea(d,o){const c=Zc(d.projection,d.zoom,d.width,d.height),f=function(x,T,S,C,z){const P=new s.LngLat(S.lng-180*ko,S.lat),O=new s.LngLat(S.lng+180*ko,S.lat),j=x.project(P.lng,P.lat),W=x.project(O.lng,O.lat),H=-Math.atan2(W.y-j.y,W.x-j.x),Z=s.MercatorCoordinate.fromLngLat(S);Z.y=s.clamp(Z.y,-1+ko,1-ko);const X=Z.toLngLat(),B=x.project(X.lng,X.lat),q=s.MercatorCoordinate.fromLngLat(X);q.x+=ko;const Q=q.toLngLat(),ee=x.project(Q.lng,Q.lat),de=Hc(ee.x-B.x,ee.y-B.y,H),fe=s.MercatorCoordinate.fromLngLat(X);fe.y+=ko;const pe=fe.toLngLat(),xe=x.project(pe.lng,pe.lat),ye=Hc(xe.x-B.x,xe.y-B.y,H),Ae=Math.abs(de.x)/Math.abs(ye.y),We=s.identity([]);s.rotateZ(We,We,-H*(1-(z?0:C)));const Ee=s.identity([]);return s.scale(Ee,Ee,[1,1-(1-Ae)*C,1]),Ee[4]=-ye.x/ye.y*C,s.rotateZ(Ee,Ee,H),s.multiply(Ee,We,Ee),Ee}(d.projection,0,d.center,c,o),_=zf(d);return s.scale(f,f,[_,_,1]),f}function zf(d){const o=d.projection,c=Zc(d.projection,d.zoom,d.width,d.height),f=Lf(o,d.center),_=Lf(o,s.LngLat.convert(o.center));return Math.pow(2,f*c+(1-c)*_)}function Zc(d,o,c,f,_=1/0){const x=d.range;if(!x)return 0;const T=Math.min(_,Math.max(c,f)),S=Math.log(T/1024)/Math.LN2;return s.smoothstep(x[0]+S,x[1]+S,o)}const ko=1/4e4;function Lf(d,o){const c=s.clamp(o.lat,-s.MAX_MERCATOR_LATITUDE,s.MAX_MERCATOR_LATITUDE),f=new s.LngLat(o.lng-180*ko,c),_=new s.LngLat(o.lng+180*ko,c),x=d.project(f.lng,c),T=d.project(_.lng,c),S=s.MercatorCoordinate.fromLngLat(f),C=s.MercatorCoordinate.fromLngLat(_),z=T.x-x.x,P=T.y-x.y,O=C.x-S.x,j=C.y-S.y,W=Math.sqrt((O*O+j*j)/(z*z+P*P));return Math.log(W)/Math.LN2}function Hc(d,o,c){const f=Math.cos(c),_=Math.sin(c);return{x:d*f-o*_,y:d*_+o*f}}class Ta{constructor(o,c,f,_,x,T,S){this.tileSize=512,this._renderWorldCopies=x===void 0||x,this._minZoom=o||0,this._maxZoom=c||22,this._minPitch=f??0,this._maxPitch=_??60,this.setProjection(T),this.setMaxBounds(S),this.width=0,this.height=0,this._center=new s.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._nearZ=0,this._farZ=0,this._unmodified=!0,this._edgeInsets=new Gc,this._projMatrixCache={},this._alignedProjMatrixCache={},this._fogTileMatrixCache={},this._distanceTileDataCache={},this._camera=new Wc,this._centerAltitude=0,this._averageElevation=0,this.cameraElevationReference="ground",this._pixelsPerMercatorPixel=1,this.globeRadius=0,this.globeCenterInViewSpace=[0,0,0],this._horizonShift=.1}clone(){const o=new Ta(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies,this.getProjection());return o._elevation=this._elevation,o._centerAltitude=this._centerAltitude,o._centerAltitudeValidForExaggeration=this._centerAltitudeValidForExaggeration,o.tileSize=this.tileSize,o.mercatorFromTransition=this.mercatorFromTransition,o.width=this.width,o.height=this.height,o.cameraElevationReference=this.cameraElevationReference,o._center=this._center,o._setZoom(this.zoom),o._seaLevelZoom=this._seaLevelZoom,o.angle=this.angle,o._fov=this._fov,o._pitch=this._pitch,o._nearZ=this._nearZ,o._farZ=this._farZ,o._averageElevation=this._averageElevation,o._unmodified=this._unmodified,o._edgeInsets=this._edgeInsets.clone(),o._camera=this._camera.clone(),o._calcMatrices(),o.freezeTileCoverage=this.freezeTileCoverage,o.frustumCorners=this.frustumCorners,o}get elevation(){return this._elevation}set elevation(o){this._elevation!==o&&(this._elevation=o,this._updateCameraOnTerrain(),this._calcMatrices())}updateElevation(o,c=!1){const f=this._elevation&&this._elevation.exaggeration()!==this._centerAltitudeValidForExaggeration;(this._seaLevelZoom==null||f)&&this._updateCameraOnTerrain(),(o||f)&&this._constrainCamera(c),this._calcMatrices()}getProjection(){return s.pick(this.projection,["name","center","parallels"])}setProjection(o){this.projectionOptions=o||{name:"mercator"};const c=this.projection?this.getProjection():void 0;this.projection=s.getProjection(this.projectionOptions);const f=!k(c,this.getProjection());return f&&this._calcMatrices(),this.mercatorFromTransition=!1,f}setMercatorFromTransition(){const o=this.projection.name;this.mercatorFromTransition=!0,this.projectionOptions={name:"mercator"},this.projection=s.getProjection({name:"mercator"});const c=o!==this.projection.name;return c&&this._calcMatrices(),c}get minZoom(){return this._minZoom}set minZoom(o){this._minZoom!==o&&(this._minZoom=o,this.zoom=Math.max(this.zoom,o))}get maxZoom(){return this._maxZoom}set maxZoom(o){this._maxZoom!==o&&(this._maxZoom=o,this.zoom=Math.min(this.zoom,o))}get minPitch(){return this._minPitch}set minPitch(o){this._minPitch!==o&&(this._minPitch=o,this.pitch=Math.max(this.pitch,o))}get maxPitch(){return this._maxPitch}set maxPitch(o){this._maxPitch!==o&&(this._maxPitch=o,this.pitch=Math.min(this.pitch,o))}get renderWorldCopies(){return this._renderWorldCopies&&this.projection.supportsWorldCopies===!0}set renderWorldCopies(o){o===void 0?o=!0:o===null&&(o=!1),this._renderWorldCopies=o}get worldSize(){return this.tileSize*this.scale}get cameraWorldSizeForFog(){const o=Math.max(this._camera.getDistanceToElevation(this._averageElevation),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(o))}get cameraWorldSize(){const o=Math.max(this._camera.getDistanceToElevation(this._averageElevation,!0),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(o))}get pixelsPerMeter(){return this.projection.pixelsPerMeter(this.center.lat,this.worldSize)}get cameraPixelsPerMeter(){return s.mercatorZfromAltitude(this.center.lat,this.cameraWorldSizeForFog)}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new s.Point(this.width,this.height)}get bearing(){return s.wrap(this.rotation,-180,180)}set bearing(o){this.rotation=o}get rotation(){return-this.angle/Math.PI*180}set rotation(o){const c=-o*Math.PI/180;var f;this.angle!==c&&(this._unmodified=!1,this.angle=c,this._calcMatrices(),this.rotationMatrix=(f=new s.ARRAY_TYPE(4),s.ARRAY_TYPE!=Float32Array&&(f[1]=0,f[2]=0),f[0]=1,f[3]=1,f),function(_,x,T){var S=x[0],C=x[1],z=x[2],P=x[3],O=Math.sin(T),j=Math.cos(T);_[0]=S*j+z*O,_[1]=C*j+P*O,_[2]=S*-O+z*j,_[3]=C*-O+P*j}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(o){const c=s.clamp(o,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==c&&(this._unmodified=!1,this._pitch=c,this._calcMatrices())}get aspect(){return this.width/this.height}get fov(){return this._fov/Math.PI*180}get fovX(){return this._fov}get fovY(){const o=1/Math.tan(.5*this.fovX);return 2*Math.atan(1/this.aspect/o)}set fov(o){o=Math.max(.01,Math.min(60,o)),this._fov!==o&&(this._unmodified=!1,this._fov=s.degToRad(o),this._calcMatrices())}get averageElevation(){return this._averageElevation}set averageElevation(o){this._averageElevation=o,this._calcFogMatrices(),this._distanceTileDataCache={}}get zoom(){return this._zoom}set zoom(o){const c=Math.min(Math.max(o,this.minZoom),this.maxZoom);this._zoom!==c&&(this._unmodified=!1,this._setZoom(c),this._updateSeaLevelZoom(),this._constrain(),this._calcMatrices())}_setZoom(o){this._zoom=o,this.scale=this.zoomScale(o),this.tileZoom=Math.floor(o),this.zoomFraction=o-this.tileZoom}_updateCameraOnTerrain(){if(!this._elevation||!this._elevation.isDataAvailableAtPoint(this.locationCoordinate(this.center)))return this._centerAltitude=0,this._seaLevelZoom=null,void(this._centerAltitudeValidForExaggeration=void 0);const o=this._elevation;this._centerAltitude=o.getAtPointOrZero(this.locationCoordinate(this.center)),this._centerAltitudeValidForExaggeration=o.exaggeration(),this._updateSeaLevelZoom()}_updateSeaLevelZoom(){this._centerAltitudeValidForExaggeration!==void 0&&(this._seaLevelZoom=this._zoomFromMercatorZ((this.pixelsPerMeter*this._centerAltitude+this.cameraToCenterDistance)/this.worldSize))}sampleAverageElevation(){if(!this._elevation)return 0;const o=this._elevation,c=[[.5,.2],[.3,.5],[.5,.5],[.7,.5],[.5,.8]],f=this.horizonLineFromTop();let _=0,x=0;for(let T=0;To.maxzoom&&(c=o.maxzoom);const T=this.locationCoordinate(this.center),S=this.center.lat,C=1<{const Xe=new s.MercatorCoordinate(Se.x+25e-6,Se.y,Se.z),$e=new s.MercatorCoordinate(Se.x,Se.y+25e-6,Se.z),Ye=Se.toLngLat(),gt=Xe.toLngLat(),Et=$e.toLngLat(),pt=this.locationCoordinate(Ye),wt=this.locationCoordinate(gt),Ut=this.locationCoordinate(Et),Ot=Math.hypot(wt.x-pt.x,wt.y-pt.y),mt=Math.hypot(Ut.x-pt.x,Ut.y-pt.y);return Math.sqrt(Ot*mt)*de/25e-6},pe=Se=>{const Be=Q,Xe=ee;return{aabb:s.tileAABB(this,C,0,0,0,Se,Xe,Be,this.projection),zoom:0,x:0,y:0,minZ:Xe,maxZ:Be,wrap:Se,fullyVisible:!1}},xe=[];let ye=[];const Ae=c,We=o.reparseOverscaled?f:c,Ee=Se=>Se*Se,Fe=Ee((Z-this._centerAltitude)*H),ke=Se=>{if(!this._elevation||!Se.tileID||!x)return;const Be=this._elevation.getMinMaxForTile(Se.tileID),Xe=Se.aabb;Be?(Xe.min[2]=Be.min,Xe.max[2]=Be.max,Xe.center[2]=(Xe.min[2]+Xe.max[2])/2):(Se.shouldSplit=qe(Se),Se.shouldSplit||(Xe.min[2]=Xe.max[2]=Xe.center[2]=this._centerAltitude))},qe=Se=>{if(Se.zoom=.9)return!0}else if(_&&($e=Ee(Se.aabb.distanceZ(X)*H)),this.projection.isReprojectedInTileSpace&&f<=5){const pt=Math.pow(2,Se.zoom),wt=fe(new s.MercatorCoordinate((Se.x+.5)/pt,(Se.y+.5)/pt));Ye=wt>.85?1:wt}const gt=Be*Be+Xe*Xe+$e,Et=Ee((1<{if(wt*Ee(.707)0;){const Se=xe.pop(),Be=Se.x,Xe=Se.y;let $e=Se.fullyVisible;if(!$e){const Ye=Se.aabb.intersects(j);if(Ye===0)continue;$e=Ye===2}if(Se.zoom!==Ae&&qe(Se))for(let Ye=0;Ye<4;Ye++){const gt=(Be<<1)+Ye%2,Et=(Xe<<1)+(Ye>>1),pt={aabb:x?Se.aabb.quadrant(Ye):s.tileAABB(this,C,Se.zoom+1,gt,Et,Se.wrap,Se.minZ,Se.maxZ,this.projection),zoom:Se.zoom+1,x:gt,y:Et,wrap:Se.wrap,fullyVisible:$e,tileID:void 0,shouldSplit:void 0,minZ:Se.minZ,maxZ:Se.maxZ};_&&!P&&(pt.tileID=new s.OverscaledTileID(Se.zoom+1===Ae?We:Se.zoom+1,Se.wrap,Se.zoom+1,gt,Et),ke(pt)),xe.push(pt)}else{const Ye=Se.zoom===Ae?We:Se.zoom;if(o.minzoom&&o.minzoom>Ye)continue;const gt=z[0]-(.5+Be+(Se.wrap<{const $e=[0,0,0,1],Ye=[s.EXTENT,s.EXTENT,0,1],gt=this.calculateFogTileMatrix(Xe.tileID.toUnwrapped());s.transformMat4$1($e,$e,gt),s.transformMat4$1(Ye,Ye,gt);const Et=s.getAABBPointSquareDist($e,Ye);if(Et===0)return!0;let pt=!1;const wt=this._elevation;if(wt&&Et>Se&&Be!==0){const Ut=this.calculateProjMatrix(Xe.tileID.toUnwrapped());let Ot;o.isTerrainDEM||(Ot=wt.getMinMaxForTile(Xe.tileID)),Ot||(Ot={min:ee,max:Q});const mt=s.furthestTileCorner(this.rotation),en=[mt[0]*s.EXTENT,mt[1]*s.EXTENT,Ot.max];s.transformMat4(en,en,Ut),pt=(1-en[1])*this.height*.5Se.distanceSq-Be.distanceSq).map(Se=>Se.tileID)}resize(o,c){this.width=o,this.height=c,this.pixelsToGLUnits=[2/o,-2/c],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(o){return Math.pow(2,o)}scaleZoom(o){return Math.log(o)/Math.LN2}project(o){const c=s.clamp(o.lat,-s.MAX_MERCATOR_LATITUDE,s.MAX_MERCATOR_LATITUDE),f=this.projection.project(o.lng,c);return new s.Point(f.x*this.worldSize,f.y*this.worldSize)}unproject(o){return this.projection.unproject(o.x/this.worldSize,o.y/this.worldSize)}get point(){return this.project(this.center)}get pointMerc(){return this.point._div(this.worldSize)}get pixelsPerMeterRatio(){return this.pixelsPerMeter/s.mercatorZfromAltitude(1,this.center.lat)/this.worldSize}setLocationAtPoint(o,c){let f,_;const x=this.centerPoint;if(this.projection.name==="globe"){const S=this.worldSize;f=(c.x-x.x)/S,_=(c.y-x.y)/S}else{const S=this.pointCoordinate(c),C=this.pointCoordinate(x);f=S.x-C.x,_=S.y-C.y}const T=this.locationCoordinate(o);this.setLocation(new s.MercatorCoordinate(T.x-f,T.y-_))}setLocation(o){this.center=this.coordinateLocation(o),this.projection.wrap&&(this.center=this.center.wrap())}locationPoint(o){return this.projection.locationPoint(this,o)}locationPoint3D(o){return this.projection.locationPoint(this,o,!0)}pointLocation(o){return this.coordinateLocation(this.pointCoordinate(o))}pointLocation3D(o){return this.coordinateLocation(this.pointCoordinate3D(o))}locationCoordinate(o,c){const f=c?s.mercatorZfromAltitude(c,o.lat):void 0,_=this.projection.project(o.lng,o.lat);return new s.MercatorCoordinate(_.x,_.y,f)}coordinateLocation(o){return this.projection.unproject(o.x,o.y)}pointRayIntersection(o,c){const f=c??this._centerAltitude,_=[o.x,o.y,0,1],x=[o.x,o.y,1,1];s.transformMat4$1(_,_,this.pixelMatrixInverse),s.transformMat4$1(x,x,this.pixelMatrixInverse);const T=x[3];s.scale$1(_,_,1/_[3]),s.scale$1(x,x,1/T);const S=_[2],C=x[2];return{p0:_,p1:x,t:S===C?0:(f-S)/(C-S)}}screenPointToMercatorRay(o){const c=[o.x,o.y,0,1],f=[o.x,o.y,1,1];return s.transformMat4$1(c,c,this.pixelMatrixInverse),s.transformMat4$1(f,f,this.pixelMatrixInverse),s.scale$1(c,c,1/c[3]),s.scale$1(f,f,1/f[3]),c[2]=s.mercatorZfromAltitude(c[2],this._center.lat)*this.worldSize,f[2]=s.mercatorZfromAltitude(f[2],this._center.lat)*this.worldSize,s.scale$1(c,c,1/this.worldSize),s.scale$1(f,f,1/this.worldSize),new s.Ray([c[0],c[1],c[2]],s.normalize([],s.sub([],f,c)))}rayIntersectionCoordinate(o){const{p0:c,p1:f,t:_}=o,x=s.mercatorZfromAltitude(c[2],this._center.lat),T=s.mercatorZfromAltitude(f[2],this._center.lat);return new s.MercatorCoordinate(s.number(c[0],f[0],_)/this.worldSize,s.number(c[1],f[1],_)/this.worldSize,s.number(x,T,_))}pointCoordinate(o,c=this._centerAltitude){return this.projection.pointCoordinate(this,o.x,o.y,c)}pointCoordinate3D(o){if(!this.elevation)return this.pointCoordinate(o);let c=this.projection.pointCoordinate3D(this,o.x,o.y);if(c)return new s.MercatorCoordinate(c[0],c[1],c[2]);let f=0,_=this.horizonLineFromTop();if(o.y>_)return this.pointCoordinate(o);const x=.02*_,T=o.clone();for(let S=0;S<10&&_-f>x;S++){T.y=s.number(f,_,.66);const C=this.projection.pointCoordinate3D(this,T.x,T.y);C?(_=T.y,c=C):f=T.y}return c?new s.MercatorCoordinate(c[0],c[1],c[2]):this.pointCoordinate(o)}isPointAboveHorizon(o){return this.projection.isPointAboveHorizon(this,o)}isPointOnSurface(o){if(o.y<0||o.y>this.height||o.x<0||o.x>this.width)return!1;if(this.elevation||this.zoom>=s.GLOBE_ZOOM_THRESHOLD_MAX)return!this.isPointAboveHorizon(o);const c=this.pointCoordinate(o);return c.y>=0&&c.y<=1}_coordinatePoint(o,c){const f=c&&this.elevation?this.elevation.getAtPointOrZero(o,this._centerAltitude):this._centerAltitude,_=[o.x*this.worldSize,o.y*this.worldSize,f+o.toAltitude(),1];return s.transformMat4$1(_,_,this.pixelMatrix),_[3]>0?new s.Point(_[0]/_[3],_[1]/_[3]):new s.Point(Number.MAX_VALUE,Number.MAX_VALUE)}_getBoundsNonRectangular(){const{top:o,left:c}=this._edgeInsets,f=this.height-this._edgeInsets.bottom,_=this.width-this._edgeInsets.right,x=this.pointLocation3D(new s.Point(c,o)),T=this.pointLocation3D(new s.Point(_,o)),S=this.pointLocation3D(new s.Point(_,f)),C=this.pointLocation3D(new s.Point(c,f));let z=Math.min(x.lng,T.lng,S.lng,C.lng),P=Math.max(x.lng,T.lng,S.lng,C.lng),O=Math.min(x.lat,T.lat,S.lat,C.lat),j=Math.max(x.lat,T.lat,S.lat,C.lat);const W=Math.pow(2,-this.zoom)/16*270,H=this.projection.name==="globe"?1:4,Z=(X,B,q,Q,ee)=>{const de=(X+q)/2,fe=(B+Q)/2,pe=new s.Point(de,fe),{lng:xe,lat:ye}=this.pointLocation3D(pe),Ae=Math.max(0,z-xe,O-ye,xe-P,ye-j);z=Math.min(z,xe),P=Math.max(P,xe),O=Math.min(O,ye),j=Math.max(j,ye),(eeW)&&(Z(X,B,de,fe,ee+1),Z(de,fe,q,Q,ee+1))};if(Z(c,o,_,o,1),Z(_,o,_,f,1),Z(_,f,c,f,1),Z(c,f,c,o,1),this.projection.name==="globe"){const[X,B]=s.polesInViewport(this);X?(j=90,P=180,z=-180):B&&(O=-90,P=180,z=-180)}return new s.LngLatBounds(new s.LngLat(z,O),new s.LngLat(P,j))}_getBoundsRectangular(o,c){const{top:f,left:_}=this._edgeInsets,x=this.height-this._edgeInsets.bottom,T=this.width-this._edgeInsets.right,S=new s.Point(_,f),C=new s.Point(T,f),z=new s.Point(T,x),P=new s.Point(_,x);let O=this.pointCoordinate(S,o),j=this.pointCoordinate(C,o);const W=this.pointCoordinate(z,c),H=this.pointCoordinate(P,c),Z=(X,B)=>(B.y-X.y)/(B.x-X.x);return O.y>1&&j.y>=0?O=new s.MercatorCoordinate((1-H.y)/Z(H,O)+H.x,1):O.y<0&&j.y<=1&&(O=new s.MercatorCoordinate(-H.y/Z(H,O)+H.x,0)),j.y>1&&O.y>=0?j=new s.MercatorCoordinate((1-W.y)/Z(W,j)+W.x,1):j.y<0&&O.y<=1&&(j=new s.MercatorCoordinate(-W.y/Z(W,j)+W.x,0)),new s.LngLatBounds().extend(this.coordinateLocation(O)).extend(this.coordinateLocation(j)).extend(this.coordinateLocation(H)).extend(this.coordinateLocation(W))}_getBoundsRectangularTerrain(){const o=this.elevation;if(!o.visibleDemTiles.length||o.isUsingMockSource())return this._getBoundsRectangular(0,0);const c=o.visibleDemTiles.reduce((f,_)=>{if(_.dem){const x=_.dem.tree;f.min=Math.min(f.min,x.minimums[0]),f.max=Math.max(f.max,x.maximums[0])}return f},{min:Number.MAX_VALUE,max:0});return this._getBoundsRectangular(c.min*o.exaggeration(),c.max*o.exaggeration())}getBounds(){return this.projection.name==="mercator"||this.projection.name==="equirectangular"?this._terrainEnabled()?this._getBoundsRectangularTerrain():this._getBoundsRectangular(0,0):this._getBoundsNonRectangular()}horizonLineFromTop(o=!0){const c=this.height/2/Math.tan(this._fov/2)/Math.tan(Math.max(this._pitch,.1))+this.centerOffset.y,f=this.height/2-c*(1-this._horizonShift);return o?Math.max(0,f):f}getMaxBounds(){return this.maxBounds}setMaxBounds(o){this.maxBounds=o,this.minLat=-s.MAX_MERCATOR_LATITUDE,this.maxLat=s.MAX_MERCATOR_LATITUDE,this.minLng=-180,this.maxLng=180,o&&(this.minLat=o.getSouth(),this.maxLat=o.getNorth(),this.minLng=o.getWest(),this.maxLng=o.getEast(),this.maxLngO&&(S=O-z),O-PW&&(T=W-C),W-j.5?Q-1:Q,ee>.5?ee-1:ee,0]),this.alignedProjMatrix=de,S=s.create(),s.scale(S,S,[this.width/2,-this.height/2,1]),s.translate(S,S,[1,-1,0]),this.labelPlaneMatrix=S,S=s.create(),s.scale(S,S,[1,-1,1]),s.translate(S,S,[-1,-1,0]),s.scale(S,S,[2/this.width,2/this.height,1]),this.glCoordMatrix=S,this.pixelMatrix=s.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),this._calcFogMatrices(),this._distanceTileDataCache={},S=s.invert(new Float64Array(16),this.pixelMatrix),!S)throw new Error("failed to invert matrix");if(this.pixelMatrixInverse=S,this.projection.name==="globe"||this.mercatorFromTransition){this.globeMatrix=s.calculateGlobeMatrix(this);const fe=[this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]];this.globeCenterInViewSpace=s.transformMat4(fe,fe,x),this.globeRadius=this.worldSize/2/Math.PI-1}else this.globeMatrix=S;this._projMatrixCache={},this._alignedProjMatrixCache={},this._pixelsToTileUnitsCache={}}_calcFogMatrices(){this._fogTileMatrixCache={};const o=this.cameraWorldSizeForFog,c=this.cameraPixelsPerMeter,f=this._camera.position,_=1/this.height/this._pixelsPerMercatorPixel,x=[o,o,c];s.scale$2(x,x,_),s.scale$2(f,f,-1),s.multiply$2(f,f,x);const T=s.create();s.translate(T,T,f),s.scale(T,T,x),this.mercatorFogMatrix=T,this.worldToFogMatrix=this._camera.getWorldToCameraPosition(o,c,_)}_computeCameraPosition(o){const c=(o=o||this.pixelsPerMeter)/this.pixelsPerMeter,f=this._camera.forward(),_=this.point,x=this._mercatorZfromZoom(this._seaLevelZoom?this._seaLevelZoom:this._zoom)*c-o/this.worldSize*this._centerAltitude;return[_.x/this.worldSize-f[0]*x,_.y/this.worldSize-f[1]*x,o/this.worldSize*this._centerAltitude-f[2]*x]}_updateCameraState(){this.height&&(this._camera.setPitchBearing(this._pitch,this.angle),this._camera.position=this._computeCameraPosition())}_translateCameraConstrained(o){const c=this._maxCameraBoundsDistance()*Math.cos(this._pitch),f=this._camera.position[2],_=o[2];let x=1;this.projection.wrap&&(this.center=this.center.wrap()),_>0&&(x=Math.min((c-f)/_,1)),this._camera.position=s.scaleAndAdd([],this._camera.position,o,x),this._updateStateFromCamera()}_updateStateFromCamera(){const o=this._camera.position,c=this._camera.forward(),{pitch:f,bearing:_}=this._camera.getPitchBearing(),x=s.mercatorZfromAltitude(this._centerAltitude,this.center.lat)*this._pixelsPerMercatorPixel,T=this._mercatorZfromZoom(this._maxZoom)*Math.cos(s.degToRad(this._maxPitch)),S=Math.max((o[2]-x)/Math.cos(f),T),C=this._zoomFromMercatorZ(S);s.scaleAndAdd(o,o,c,S),this._pitch=s.clamp(f,s.degToRad(this.minPitch),s.degToRad(this.maxPitch)),this.angle=s.wrap(_,-Math.PI,Math.PI),this._setZoom(s.clamp(C,this._minZoom,this._maxZoom)),this._updateSeaLevelZoom(),this._center=this.coordinateLocation(new s.MercatorCoordinate(o[0],o[1],o[2])),this._unmodified=!1,this._constrain(),this._calcMatrices()}_worldSizeFromZoom(o){return Math.pow(2,o)*this.tileSize}_mercatorZfromZoom(o){return this.cameraToCenterDistance/this._worldSizeFromZoom(o)}_minimumHeightOverTerrain(){const o=Math.min((this._seaLevelZoom!=null?this._seaLevelZoom:this._zoom)+4,this._maxZoom);return this._mercatorZfromZoom(o)}_zoomFromMercatorZ(o){return this.scaleZoom(this.cameraToCenterDistance/(o*this.tileSize))}zoomFromMercatorZAdjusted(o){let c=0,f=s.GLOBE_ZOOM_THRESHOLD_MAX,_=0,x=1/0;for(;f-c>1e-6&&f>c;){const T=c+.5*(f-c),S=this.tileSize*Math.pow(2,T),C=this.getCameraToCenterDistance(this.projection,T,S),z=this.scaleZoom(C/(o*this.tileSize)),P=Math.abs(T-z);Pz||j.y>1)return!0}return!1}isHorizonVisible(){return this.pitch+s.radToDeg(this.fovAboveCenter)>88||this.anyCornerOffEdge(new s.Point(0,0),new s.Point(this.width,this.height))}zoomDeltaToMovement(o,c){const f=s.length(s.sub([],this._camera.position,o)),_=this._zoomFromMercatorZ(f)+c;return f-this._mercatorZfromZoom(_)}getCameraPoint(){if(this.projection.name==="globe"){const o=function([c,f,_],x){const T=[c,f,_,1];s.transformMat4$1(T,T,x);const S=T[3]=Math.max(T[3],1e-6);return T[0]/=S,T[1]/=S,T[2]/=S,T}([this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]],this.pixelMatrix);return new s.Point(o[0],o[1])}{const o=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new s.Point(0,o))}}getCameraToCenterDistance(o,c=this.zoom,f=this.worldSize){const _=Zc(o,c,this.width,this.height,1024),x=o.pixelSpaceConversion(this.center.lat,f,_);return .5/Math.tan(.5*this._fov)*this.height*x}getWorldToCameraMatrix(){const o=this._camera.getWorldToCamera(this.worldSize,this.projection.zAxisUnit==="meters"?this.pixelsPerMeter:1);return this.projection.name==="globe"&&s.multiply(o,o,this.globeMatrix),o}}function Sa(d,o){let c=!1,f=null;const _=()=>{f=null,c&&(d(),f=setTimeout(_,o),c=!1)};return()=>(c=!0,f||_(),f)}class ed{constructor(o){this._hashName=o&&encodeURIComponent(o),s.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=Sa(this._updateHashUnthrottled.bind(this),300)}addTo(o){return this._map=o,s.window.addEventListener("hashchange",this._onHashChange,!1),o.on("moveend",this._updateHash),this}remove(){return this._map?(this._map.off("moveend",this._updateHash),s.window.removeEventListener("hashchange",this._onHashChange,!1),clearTimeout(this._updateHash()),this._map=void 0,this):this}getHashString(){const o=this._map;if(!o)return"";const c=Bl(o);if(this._hashName){const f=this._hashName;let _=!1;const x=s.window.location.hash.slice(1).split("&").map(T=>{const S=T.split("=")[0];return S===f?(_=!0,`${S}=${c}`):T}).filter(T=>T);return _||x.push(`${f}=${c}`),`#${x.join("&")}`}return`#${c}`}_getCurrentHash(){const o=s.window.location.hash.replace("#","");if(this._hashName){let c;return o.split("&").map(f=>f.split("=")).forEach(f=>{f[0]===this._hashName&&(c=f)}),(c&&c[1]||"").split("/")}return o.split("/")}_onHashChange(){const o=this._map;if(!o)return!1;const c=this._getCurrentHash();if(c.length>=3&&!c.some(f=>isNaN(f))){const f=o.dragRotate.isEnabled()&&o.touchZoomRotate.isEnabled()?+(c[3]||0):o.getBearing();return o.jumpTo({center:[+c[2],+c[1]],zoom:+c[0],bearing:f,pitch:+(c[4]||0)}),!0}return!1}_updateHashUnthrottled(){const o=s.window.location.href.replace(/(#.+)?$/,this.getHashString());s.window.history.replaceState(s.window.history.state,null,o)}}function Bl(d,o){const c=d.getCenter(),f=Math.round(100*d.getZoom())/100,_=Math.ceil((f*Math.LN2+Math.log(512/360/.5))/Math.LN10),x=Math.pow(10,_),T=Math.round(c.lng*x)/x,S=Math.round(c.lat*x)/x,C=d.getBearing(),z=d.getPitch();let P=o?`/${T}/${S}/${f}`:`${f}/${S}/${T}`;return(C||z)&&(P+="/"+Math.round(10*C)/10),z&&(P+=`/${Math.round(z)}`),P}const Fl={linearity:.3,easing:s.bezier(0,0,.3,1)},Xc=s.extend({deceleration:2500,maxSpeed:1400},Fl),Kc=s.extend({deceleration:20,maxSpeed:1400},Fl),ct=s.extend({deceleration:1e3,maxSpeed:360},Fl),Di=s.extend({deceleration:1e3,maxSpeed:90},Fl);class Rf{constructor(o){this._map=o,this.clear()}clear(){this._inertiaBuffer=[]}record(o){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:s.exported.now(),settings:o})}_drainInertiaBuffer(){const o=this._inertiaBuffer,c=s.exported.now();for(;o.length>0&&c-o[0].time>160;)o.shift()}_onMoveEnd(o){if(this._map._prefersReducedMotion()||(this._drainInertiaBuffer(),this._inertiaBuffer.length<2))return;const c={zoom:0,bearing:0,pitch:0,pan:new s.Point(0,0),pinchAround:void 0,around:void 0};for(const{settings:x}of this._inertiaBuffer)c.zoom+=x.zoomDelta||0,c.bearing+=x.bearingDelta||0,c.pitch+=x.pitchDelta||0,x.panDelta&&c.pan._add(x.panDelta),x.around&&(c.around=x.around),x.pinchAround&&(c.pinchAround=x.pinchAround);const f=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,_={};if(c.pan.mag()){const x=Ul(c.pan.mag(),f,s.extend({},Xc,o||{}));_.offset=c.pan.mult(x.amount/c.pan.mag()),_.center=this._map.transform.center,Nl(_,x)}if(c.zoom){const x=Ul(c.zoom,f,Kc);_.zoom=this._map.transform.zoom+x.amount,Nl(_,x)}if(c.bearing){const x=Ul(c.bearing,f,ct);_.bearing=this._map.transform.bearing+s.clamp(x.amount,-179,179),Nl(_,x)}if(c.pitch){const x=Ul(c.pitch,f,Di);_.pitch=this._map.transform.pitch+x.amount,Nl(_,x)}if(_.zoom||_.bearing){const x=c.pinchAround===void 0?c.around:c.pinchAround;_.around=x?this._map.unproject(x):this._map.getCenter()}return this.clear(),_.noMoveStart=!0,_}}function Nl(d,o){(!d.duration||d.durationc.unproject(C)),S=x.reduce((C,z,P,O)=>C.add(z.div(O.length)),new s.Point(0,0));super(o,{points:x,point:S,lngLats:T,lngLat:c.unproject(S),originalEvent:f}),this._defaultPrevented=!1}}class Yc extends s.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(o,c,f){super(o,{originalEvent:f}),this._defaultPrevented=!1}}class td{constructor(o,c){this._map=o,this._clickTolerance=c.clickTolerance}reset(){this._mousedownPos=void 0}wheel(o){return this._firePreventable(new Yc(o.type,this._map,o))}mousedown(o,c){return this._mousedownPos=c,this._firePreventable(new pr(o.type,this._map,o))}mouseup(o){this._map.fire(new pr(o.type,this._map,o))}preclick(o){const c=s.extend({},o);c.type="preclick",this._map.fire(new pr(c.type,this._map,c))}click(o,c){this._mousedownPos&&this._mousedownPos.dist(c)>=this._clickTolerance||(this.preclick(o),this._map.fire(new pr(o.type,this._map,o)))}dblclick(o){return this._firePreventable(new pr(o.type,this._map,o))}mouseover(o){this._map.fire(new pr(o.type,this._map,o))}mouseout(o){this._map.fire(new pr(o.type,this._map,o))}touchstart(o){return this._firePreventable(new jl(o.type,this._map,o))}touchmove(o){this._map.fire(new jl(o.type,this._map,o))}touchend(o){this._map.fire(new jl(o.type,this._map,o))}touchcancel(o){this._map.fire(new jl(o.type,this._map,o))}_firePreventable(o){if(this._map.fire(o),o.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Jc{constructor(o){this._map=o}reset(){this._delayContextMenu=!1,this._contextMenuEvent=void 0}mousemove(o){this._map.fire(new pr(o.type,this._map,o))}mousedown(){this._delayContextMenu=!0}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new pr("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(o){this._delayContextMenu?this._contextMenuEvent=o:this._map.fire(new pr(o.type,this._map,o)),this._map.listens("contextmenu")&&o.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Df{constructor(o,c){this._map=o,this._el=o.getCanvasContainer(),this._container=o.getContainer(),this._clickTolerance=c.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(o,c){this.isEnabled()&&o.shiftKey&&o.button===0&&(ie(),this._startPos=this._lastPos=c,this._active=!0)}mousemoveWindow(o,c){if(!this._active)return;const f=c,_=this._startPos,x=this._lastPos;if(!_||!x||x.equals(f)||!this._box&&f.dist(_){this._box&&(this._box.style.transform=`translate(${T}px,${C}px)`,this._box.style.width=S-T+"px",this._box.style.height=z-C+"px")})}mouseupWindow(o,c){if(!this._active)return;const f=this._startPos,_=c;if(f&&o.button===0){if(this.reset(),ze(),f.x!==_.x||f.y!==_.y)return this._map.fire(new s.Event("boxzoomend",{originalEvent:o})),{cameraAnimation:x=>x.fitScreenCoordinates(f,_,this._map.getBearing(),{linear:!1})};this._fireEvent("boxzoomcancel",o)}}keydown(o){this._active&&o.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",o))}blur(){this.reset()}reset(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.remove(),this._box=null),te(),delete this._startPos,delete this._lastPos}_fireEvent(o,c){return this._map.fire(new s.Event(o,{originalEvent:c}))}}function Qc(d,o){const c={};for(let f=0;fthis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===0&&(this.startTime=o.timeStamp),f.length===this.numTouches&&(this.centroid=function(_){const x=new s.Point(0,0);for(const T of _)x._add(T);return x.div(_.length)}(c),this.touches=Qc(f,c)))}touchmove(o,c,f){if(this.aborted||!this.centroid)return;const _=Qc(f,c);for(const x in this.touches){const T=_[x];(!T||T.dist(this.touches[x])>30)&&(this.aborted=!0)}}touchend(o,c,f){if((!this.centroid||o.timeStamp-this.startTime>500)&&(this.aborted=!0),f.length===0){const _=!this.aborted&&this.centroid;if(this.reset(),_)return _}}}class nd{constructor(o){this.singleTap=new Aa(o),this.numTaps=o.numTaps,this.reset()}reset(){this.lastTime=1/0,this.lastTap=void 0,this.count=0,this.singleTap.reset()}touchstart(o,c,f){this.singleTap.touchstart(o,c,f)}touchmove(o,c,f){this.singleTap.touchmove(o,c,f)}touchend(o,c,f){const _=this.singleTap.touchend(o,c,f);if(_){const x=o.timeStamp-this.lastTime<500,T=!this.lastTap||this.lastTap.dist(_)<30;if(x&&T||this.reset(),this.count++,this.lastTime=o.timeStamp,this.lastTap=_,this.count===this.numTaps)return this.reset(),_}}}class iy{constructor(){this._zoomIn=new nd({numTouches:1,numTaps:2}),this._zoomOut=new nd({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(o,c,f){this._zoomIn.touchstart(o,c,f),this._zoomOut.touchstart(o,c,f)}touchmove(o,c,f){this._zoomIn.touchmove(o,c,f),this._zoomOut.touchmove(o,c,f)}touchend(o,c,f){const _=this._zoomIn.touchend(o,c,f),x=this._zoomOut.touchend(o,c,f);return _?(this._active=!0,o.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:T=>T.easeTo({duration:300,zoom:T.getZoom()+1,around:T.unproject(_)},{originalEvent:o})}):x?(this._active=!0,o.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:T=>T.easeTo({duration:300,zoom:T.getZoom()-1,around:T.unproject(x)},{originalEvent:o})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}const Of={0:1,2:2};class Ca{constructor(o){this.reset(),this._clickTolerance=o.clickTolerance||1}blur(){this.reset()}reset(){this._active=!1,this._moved=!1,this._lastPoint=void 0,this._eventButton=void 0}_correctButton(o,c){return!1}_move(o,c){return{}}mousedown(o,c){if(this._lastPoint)return;const f=He(o);this._correctButton(o,f)&&(this._lastPoint=c,this._eventButton=f)}mousemoveWindow(o,c){const f=this._lastPoint;if(f){if(o.preventDefault(),this._eventButton!=null&&function(_,x){const T=Of[x];return _.buttons===void 0||(_.buttons&T)!==T}(o,this._eventButton))this.reset();else if(this._moved||!(c.dist(f)0&&(this._active=!0);const _=Qc(f,c),x=new s.Point(0,0),T=new s.Point(0,0);let S=0;for(const z in _){const P=_[z],O=this._touches[z];O&&(x._add(P),T._add(P.sub(O)),S++,_[z]=P)}if(this._touches=_,S{this._alertContainer.classList.remove("mapboxgl-touch-pan-blocker-show"),this._alertContainer.setAttribute("role","null")},500)}}class Vl{constructor(){this.reset()}reset(){this._active=!1,this._firstTwoTouches=void 0}_start(o){}_move(o,c,f){return{}}touchstart(o,c,f){this._firstTwoTouches||f.length<2||(this._firstTwoTouches=[f[0].identifier,f[1].identifier],this._start([c[0],c[1]]))}touchmove(o,c,f){const _=this._firstTwoTouches;if(!_)return;o.preventDefault();const[x,T]=_,S=$l(f,c,x),C=$l(f,c,T);if(!S||!C)return;const z=this._aroundCenter?null:S.add(C).div(2);return this._move([S,C],z,o)}touchend(o,c,f){if(!this._firstTwoTouches)return;const[_,x]=this._firstTwoTouches,T=$l(f,c,_),S=$l(f,c,x);T&&S||(this._active&&ze(),this.reset())}touchcancel(){this.reset()}enable(o){this._enabled=!0,this._aroundCenter=!!o&&o.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function $l(d,o,c){for(let f=0;fMath.abs(d.x)}class Nf extends Vl{constructor(o){super(),this._map=o}reset(){super.reset(),this._valid=void 0,this._firstMove=void 0,this._lastPoints=void 0}_start(o){this._lastPoints=o,rs(o[0].sub(o[1]))&&(this._valid=!1)}_move(o,c,f){const _=this._lastPoints;if(!_)return;const x=o[0].sub(_[0]),T=o[1].sub(_[1]);return this._map._cooperativeGestures&&!s.isFullscreen()&&f.touches.length<3||(this._valid=this.gestureBeginsVertically(x,T,f.timeStamp),!this._valid)?void 0:(this._lastPoints=o,this._active=!0,{pitchDelta:(x.y+T.y)/2*-.5})}gestureBeginsVertically(o,c,f){if(this._valid!==void 0)return this._valid;const _=o.mag()>=2,x=c.mag()>=2;if(!_&&!x)return;if(!_||!x)return this._firstMove==null&&(this._firstMove=f),f-this._firstMove<100&&void 0;const T=o.y>0==c.y>0;return rs(o)&&rs(c)&&T}}const Uf={panStep:100,bearingStep:15,pitchStep:10};class oy{constructor(){const o=Uf;this._panStep=o.panStep,this._bearingStep=o.bearingStep,this._pitchStep=o.pitchStep,this._rotationDisabled=!1}blur(){this.reset()}reset(){this._active=!1}keydown(o){if(o.altKey||o.ctrlKey||o.metaKey)return;let c=0,f=0,_=0,x=0,T=0;switch(o.keyCode){case 61:case 107:case 171:case 187:c=1;break;case 189:case 109:case 173:c=-1;break;case 37:o.shiftKey?f=-1:(o.preventDefault(),x=-1);break;case 39:o.shiftKey?f=1:(o.preventDefault(),x=1);break;case 38:o.shiftKey?_=1:(o.preventDefault(),T=-1);break;case 40:o.shiftKey?_=-1:(o.preventDefault(),T=1);break;default:return}return this._rotationDisabled&&(f=0,_=0),{cameraAnimation:S=>{const C=S.getZoom();S.easeTo({duration:300,easeId:"keyboardHandler",easing:jf,zoom:c?Math.round(C)+c*(o.shiftKey?2:1):C,bearing:S.getBearing()+f*this._bearingStep,pitch:S.getPitch()+_*this._pitchStep,offset:[-x*this._panStep,-T*this._panStep],center:S.getCenter()},{originalEvent:o})}}}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 jf(d){return d*(2-d)}const ld=4.000244140625;class Vf{constructor(o,c){this._map=o,this._el=o.getCanvasContainer(),this._handler=c,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,s.bindAll(["_onTimeout","_addScrollZoomBlocker","_showBlockerAlert"],this)}setZoomRate(o){this._defaultZoomRate=o}setWheelZoomRate(o){this._wheelZoomRate=o}isEnabled(){return!!this._enabled}isActive(){return this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(o){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!o&&o.around==="center",this._map._cooperativeGestures&&this._addScrollZoomBlocker())}disable(){this.isEnabled()&&(this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove()))}wheel(o){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!(o.ctrlKey||o.metaKey||this.isZooming()||s.isFullscreen()))return void this._showBlockerAlert();this._alertContainer.style.visibility!=="hidden"&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}let c=o.deltaMode===s.window.WheelEvent.DOM_DELTA_LINE?40*o.deltaY:o.deltaY;const f=s.exported.now(),_=f-(this._lastWheelEventTime||0);this._lastWheelEventTime=f,c!==0&&c%ld==0?this._type="wheel":c!==0&&Math.abs(c)<4?this._type="trackpad":_>400?(this._type=null,this._lastValue=c,this._timeout=setTimeout(this._onTimeout,40,o)):this._type||(this._type=Math.abs(_*c)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,c+=this._lastValue)),o.shiftKey&&c&&(c/=4),this._type&&(this._lastWheelEvent=o,this._delta-=c,this._active||this._start(o)),o.preventDefault()}_onTimeout(o){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(o)}_start(o){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 c=Oe(this._el,o);this._aroundPoint=this._aroundCenter?this._map.transform.centerPoint:c,this._aroundCoord=this._map.transform.pointCoordinate3D(this._aroundPoint),this._targetZoom=void 0,this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const o=this._map.transform;this._type==="wheel"&&o.projection.wrap&&(o._center.lng>=180||o._center.lng<=-180)&&(this._prevEase=null,this._easing=null,this._lastWheelEvent=null,this._lastWheelEventTime=0);const c=()=>o._terrainEnabled()&&this._aroundCoord?o.computeZoomRelativeTo(this._aroundCoord):o.zoom;if(this._delta!==0){const C=this._type==="wheel"&&Math.abs(this._delta)>ld?this._wheelZoomRate:this._defaultZoomRate;let z=2/(1+Math.exp(-Math.abs(this._delta*C)));this._delta<0&&z!==0&&(z=1/z);const P=c(),O=Math.pow(2,P),j=typeof this._targetZoom=="number"?o.zoomScale(this._targetZoom):O;this._targetZoom=Math.min(o.maxZoom,Math.max(o.minZoom,o.scaleZoom(j*z))),this._type==="wheel"&&(this._startZoom=P,this._easing=this._smoothOutEasing(200)),this._delta=0}const f=typeof this._targetZoom=="number"?this._targetZoom:c(),_=this._startZoom,x=this._easing;let T,S=!1;if(this._type==="wheel"&&_&&x){const C=Math.min((s.exported.now()-this._lastWheelEventTime)/200,1),z=x(C);T=s.number(_,f,z),C<1?this._frameId||(this._frameId=!0):S=!0}else T=f,S=!0;return this._active=!0,S&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!S,zoomDelta:T-c(),around:this._aroundPoint,aroundCoord:this._aroundCoord,originalEvent:this._lastWheelEvent}}_smoothOutEasing(o){let c=s.ease;if(this._prevEase){const f=this._prevEase,_=(s.exported.now()-f.start)/f.duration,x=f.easing(_+.01)-f.easing(_),T=.27/Math.sqrt(x*x+1e-4)*.01,S=Math.sqrt(.0729-T*T);c=s.bezier(T,S,.25,1)}return this._prevEase={start:s.exported.now(),duration:o,easing:c},c}blur(){this.reset()}reset(){this._active=!1}_addScrollZoomBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=J("div","mapboxgl-scroll-zoom-blocker",this._map._container),this._alertContainer.textContent=/(Mac|iPad)/i.test(s.window.navigator.userAgent)?this._map._getUIString("ScrollZoomBlocker.CmdMessage"):this._map._getUIString("ScrollZoomBlocker.CtrlMessage"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=setTimeout(()=>{this._alertContainer.classList.remove("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","null")},200)}}class $f{constructor(o,c){this._clickZoom=o,this._tapZoom=c}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 kr{constructor(){this.reset()}reset(){this._active=!1}blur(){this.reset()}dblclick(o,c){return o.preventDefault(),{cameraAnimation:f=>{f.easeTo({duration:300,zoom:f.getZoom()+(o.shiftKey?-1:1),around:f.unproject(c)},{originalEvent:o})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class sy{constructor(){this._tap=new nd({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,this._swipePoint=void 0,this._swipeTouch=0,this._tapTime=0,this._tap.reset()}touchstart(o,c,f){this._swipePoint||(this._tapTime&&o.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?f.length>0&&(this._swipePoint=c[0],this._swipeTouch=f[0].identifier):this._tap.touchstart(o,c,f))}touchmove(o,c,f){if(this._tapTime){if(this._swipePoint){if(f[0].identifier!==this._swipeTouch)return;const _=c[0],x=_.y-this._swipePoint.y;return this._swipePoint=_,o.preventDefault(),this._active=!0,{zoomDelta:x/128}}}else this._tap.touchmove(o,c,f)}touchend(o,c,f){this._tapTime?this._swipePoint&&f.length===0&&this.reset():this._tap.touchend(o,c,f)&&(this._tapTime=o.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Gf{constructor(o,c,f){this._el=o,this._mousePan=c,this._touchPan=f}enable(o){this._inertiaOptions=o||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class ay{constructor(o,c,f){this._pitchWithRotate=o.pitchWithRotate,this._mouseRotate=c,this._mousePitch=f}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 ly{constructor(o,c,f,_){this._el=o,this._touchZoom=c,this._touchRotate=f,this._tapDragZoom=_,this._rotationDisabled=!1,this._enabled=!0}enable(o){this._touchZoom.enable(o),this._rotationDisabled||this._touchRotate.enable(o),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-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()}}const yi=d=>d.zoom||d.drag||d.pitch||d.rotate;class qf extends s.Event{}class cy{constructor(){this.constants=[1,1,.01],this.radius=0}setup(o,c){const f=s.sub([],c,o);this.radius=s.length(f[2]<0?s.div([],f,this.constants):[f[0],f[1],0])}projectRay(o){s.div(o,o,this.constants),s.normalize(o,o),s.mul$1(o,o,this.constants);const c=s.scale$2([],o,this.radius);if(c[2]>0){const f=s.scale$2([],[0,0,1],s.dot(c,[0,0,1])),_=s.scale$2([],s.normalize([],[c[0],c[1],0]),this.radius),x=s.add([],c,s.scale$2([],s.sub([],s.add([],_,f),c),2));c[0]=x[0],c[1]=x[1]}return c}}function Oi(d){return d.panDelta&&d.panDelta.mag()||d.zoomDelta||d.bearingDelta||d.pitchDelta}class ro{constructor(o,c){this._map=o,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Rf(o),this._bearingSnap=c.bearingSnap,this._previousActiveHandlers={},this._trackingEllipsoid=new cy,this._dragOrigin=null,this._eventsInProgress={},this._addDefaultHandlers(c),s.bindAll(["handleEvent","handleWindowEvent"],this);const f=this._el;this._listeners=[[f,"touchstart",{passive:!0}],[f,"touchmove",{passive:!1}],[f,"touchend",void 0],[f,"touchcancel",void 0],[f,"mousedown",void 0],[f,"mousemove",void 0],[f,"mouseup",void 0],[s.window.document,"mousemove",{capture:!0}],[s.window.document,"mouseup",void 0],[f,"mouseover",void 0],[f,"mouseout",void 0],[f,"dblclick",void 0],[f,"click",void 0],[f,"keydown",{capture:!1}],[f,"keyup",void 0],[f,"wheel",{passive:!1}],[f,"contextmenu",void 0],[s.window,"blur",void 0]];for(const[_,x,T]of this._listeners)_.addEventListener(x,_===s.window.document?this.handleWindowEvent:this.handleEvent,T)}destroy(){for(const[o,c,f]of this._listeners)o.removeEventListener(c,o===s.window.document?this.handleWindowEvent:this.handleEvent,f)}_addDefaultHandlers(o){const c=this._map,f=c.getCanvasContainer();this._add("mapEvent",new td(c,o));const _=c.boxZoom=new Df(c,o);this._add("boxZoom",_);const x=new iy,T=new kr;c.doubleClickZoom=new $f(T,x),this._add("tapZoom",x),this._add("clickZoom",T);const S=new sy;this._add("tapDragZoom",S);const C=c.touchPitch=new Nf(c);this._add("touchPitch",C);const z=new id(o),P=new od(o);c.dragRotate=new ay(o,z,P),this._add("mouseRotate",z,["mousePitch"]),this._add("mousePitch",P,["mouseRotate"]);const O=new rd(o),j=new eu(c,o);c.dragPan=new Gf(f,O,j),this._add("mousePan",O),this._add("touchPan",j,["touchZoom","touchRotate"]);const W=new Ff,H=new Bf;c.touchZoomRotate=new ly(f,H,W,S),this._add("touchRotate",W,["touchPan","touchZoom"]),this._add("touchZoom",H,["touchPan","touchRotate"]),this._add("blockableMapEvent",new Jc(c));const Z=c.scrollZoom=new Vf(c,this);this._add("scrollZoom",Z,["mousePan"]);const X=c.keyboard=new oy;this._add("keyboard",X);for(const B of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])o.interactive&&o[B]&&c[B].enable(o[B])}_add(o,c,f){this._handlers.push({handlerName:o,handler:c,allowed:f}),this._handlersById[o]=c}stop(o){if(!this._updatingCamera){for(const{handler:c}of this._handlers)c.reset();this._inertia.clear(),this._fireEvents({},{},o),this._changes=[]}}isActive(){for(const{handler:o}of this._handlers)if(o.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!yi(this._eventsInProgress)||this.isZooming()}_isDragging(){return!!this._eventsInProgress.drag}_blockedByActive(o,c,f){for(const _ in o)if(_!==f&&(!c||c.indexOf(_)<0))return!0;return!1}handleWindowEvent(o){this.handleEvent(o,`${o.type}Window`)}_getMapTouches(o){const c=[];for(const f of o)this._el.contains(f.target)&&c.push(f);return c}handleEvent(o,c){this._updatingCamera=!0;const f=o.type==="renderFrame",_=f?void 0:o,x={needsRenderFrame:!1},T={},S={},C=o.touches?this._getMapTouches(o.touches):void 0,z=C?Ke(this._el,C):f?void 0:Oe(this._el,o);for(const{handlerName:j,handler:W,allowed:H}of this._handlers){if(!W.isEnabled())continue;let Z;this._blockedByActive(S,H,j)?W.reset():W[c||o.type]&&(Z=W[c||o.type](o,z,C),this.mergeHandlerResult(x,T,Z,j,_),Z&&Z.needsRenderFrame&&this._triggerRenderFrame()),(Z||W.isActive())&&(S[j]=W)}const P={};for(const j in this._previousActiveHandlers)S[j]||(P[j]=_);this._previousActiveHandlers=S,(Object.keys(P).length||Oi(x))&&(this._changes.push([x,T,P]),this._triggerRenderFrame()),(Object.keys(S).length||Oi(x))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:O}=x;O&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],O(this._map))}mergeHandlerResult(o,c,f,_,x){if(!f)return;s.extend(o,f);const T={handlerName:_,originalEvent:f.originalEvent||x};f.zoomDelta!==void 0&&(c.zoom=T),f.panDelta!==void 0&&(c.drag=T),f.pitchDelta!==void 0&&(c.pitch=T),f.bearingDelta!==void 0&&(c.rotate=T)}_applyChanges(){const o={},c={},f={};for(const[_,x,T]of this._changes)_.panDelta&&(o.panDelta=(o.panDelta||new s.Point(0,0))._add(_.panDelta)),_.zoomDelta&&(o.zoomDelta=(o.zoomDelta||0)+_.zoomDelta),_.bearingDelta&&(o.bearingDelta=(o.bearingDelta||0)+_.bearingDelta),_.pitchDelta&&(o.pitchDelta=(o.pitchDelta||0)+_.pitchDelta),_.around!==void 0&&(o.around=_.around),_.aroundCoord!==void 0&&(o.aroundCoord=_.aroundCoord),_.pinchAround!==void 0&&(o.pinchAround=_.pinchAround),_.noInertia&&(o.noInertia=_.noInertia),s.extend(c,x),s.extend(f,T);this._updateMapTransform(o,c,f),this._changes=[]}_updateMapTransform(o,c,f){const _=this._map,x=_.transform,T=q=>[q.x,q.y,q.z];if((q=>{const Q=this._eventsInProgress.drag;return Q&&!this._handlersById[Q.handlerName].isActive()})()&&!Oi(o)){const q=x.zoom;x.cameraElevationReference="sea",x.recenterOnTerrain(),x.cameraElevationReference="ground",q!==x.zoom&&this._map._update(!0)}if(x._isCameraConstrained&&_._stop(!0),!Oi(o))return void this._fireEvents(c,f,!0);let{panDelta:S,zoomDelta:C,bearingDelta:z,pitchDelta:P,around:O,aroundCoord:j,pinchAround:W}=o;x._isCameraConstrained&&(C>0&&(C=0),x._isCameraConstrained=!1),W!==void 0&&(O=W),(C||(q=>c[q]&&!this._eventsInProgress[q])("drag"))&&O&&(this._dragOrigin=T(x.pointCoordinate3D(O)),this._trackingEllipsoid.setup(x._camera.position,this._dragOrigin)),x.cameraElevationReference="sea",_._stop(!0),O=O||_.transform.centerPoint,z&&(x.bearing+=z),P&&(x.pitch+=P),x._updateCameraState();const H=[0,0,0];if(S)if(x.projection.name==="mercator"){const q=this._trackingEllipsoid.projectRay(x.screenPointToMercatorRay(O).dir),Q=this._trackingEllipsoid.projectRay(x.screenPointToMercatorRay(O.sub(S)).dir);H[0]=Q[0]-q[0],H[1]=Q[1]-q[1]}else{const q=x.pointCoordinate(O);if(x.projection.name==="globe"){S=S.rotate(-x.angle);const Q=x._pixelsPerMercatorPixel/x.worldSize;H[0]=-S.x*s.mercatorScale(s.latFromMercatorY(q.y))*Q,H[1]=-S.y*s.mercatorScale(x.center.lat)*Q}else{const Q=x.pointCoordinate(O.sub(S));q&&Q&&(H[0]=Q.x-q.x,H[1]=Q.y-q.y)}}const Z=x.zoom,X=[0,0,0];if(C){const q=T(j||x.pointCoordinate3D(O)),Q={dir:s.normalize([],s.sub([],q,x._camera.position))};if(Q.dir[2]<0){const ee=x.zoomDeltaToMovement(q,C);s.scale$2(X,Q.dir,ee)}}const B=s.add(H,H,X);x._translateCameraConstrained(B),C&&Math.abs(x.zoom-Z)>1e-4&&x.recenterOnTerrain(),x.cameraElevationReference="ground",this._map._update(),o.noInertia||this._inertia.record(o),this._fireEvents(c,f,!0)}_fireEvents(o,c,f){const _=yi(this._eventsInProgress),x=yi(o),T={};for(const P in o){const{originalEvent:O}=o[P];this._eventsInProgress[P]||(T[`${P}start`]=O),this._eventsInProgress[P]=o[P]}!_&&x&&this._fireEvent("movestart",x.originalEvent);for(const P in T)this._fireEvent(P,T[P]);x&&this._fireEvent("move",x.originalEvent);for(const P in o){const{originalEvent:O}=o[P];this._fireEvent(P,O)}const S={};let C;for(const P in this._eventsInProgress){const{handlerName:O,originalEvent:j}=this._eventsInProgress[P];this._handlersById[O].isActive()||(delete this._eventsInProgress[P],C=c[O]||j,S[`${P}end`]=C)}for(const P in S)this._fireEvent(P,S[P]);const z=yi(this._eventsInProgress);if(f&&(_||x)&&!z){this._updatingCamera=!0;const P=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),O=j=>j!==0&&-this._bearingSnap{this._frameId=void 0,this.handleEvent(new qf("renderFrame",{timeStamp:o})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}const Ds="map.setFreeCameraOptions(...) and map.getFreeCameraOptions() are not yet supported for non-mercator projections.";class tu extends s.Evented{constructor(o,c){super(),this._moving=!1,this._zooming=!1,this.transform=o,this._bearingSnap=c.bearingSnap,this._respectPrefersReducedMotion=c.respectPrefersReducedMotion!==!1,s.bindAll(["_renderFrameCallback"],this)}getCenter(){return new s.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(o,c){return this.jumpTo({center:o},c)}panBy(o,c,f){return o=s.Point.convert(o).mult(-1),this.panTo(this.transform.center,s.extend({offset:o},c),f)}panTo(o,c,f){return this.easeTo(s.extend({center:o},c),f)}getZoom(){return this.transform.zoom}setZoom(o,c){return this.jumpTo({zoom:o},c),this}zoomTo(o,c,f){return this.easeTo(s.extend({zoom:o},c),f)}zoomIn(o,c){return this.zoomTo(this.getZoom()+1,o,c),this}zoomOut(o,c){return this.zoomTo(this.getZoom()-1,o,c),this}getBearing(){return this.transform.bearing}setBearing(o,c){return this.jumpTo({bearing:o},c),this}getPadding(){return this.transform.padding}setPadding(o,c){return this.jumpTo({padding:o},c),this}rotateTo(o,c,f){return this.easeTo(s.extend({bearing:o},c),f)}resetNorth(o,c){return this.rotateTo(0,s.extend({duration:1e3},o),c),this}resetNorthPitch(o,c){return this.easeTo(s.extend({bearing:0,pitch:0,duration:1e3},o),c),this}snapToNorth(o,c){return Math.abs(this.getBearing())o.aspect?f/(2*Math.tan(.5*o.fovX)*o.aspect):_/(2*Math.tan(.5*o.fovY)*o.aspect)}_cameraForBoundsOnGlobe(o,c,f,_,x,T){const S=o.clone(),C=this._extendCameraOptions(T);S.bearing=_,S.pitch=x;const z=s.LngLat.convert(c),P=s.LngLat.convert(f),O=.5*(z.lat+P.lat),j=.5*(z.lng+P.lng),W=s.latLngToECEF(O,j),H=s.normalize([],W),Z=s.normalize([],s.cross([],H,[0,1,0])),X=s.cross([],Z,H),B=[Z[0],Z[1],Z[2],0,X[0],X[1],X[2],0,H[0],H[1],H[2],0,0,0,0,1],q=[W,s.latLngToECEF(z.lat,z.lng),s.latLngToECEF(P.lat,z.lng),s.latLngToECEF(P.lat,P.lng),s.latLngToECEF(z.lat,P.lng),s.latLngToECEF(O,z.lng),s.latLngToECEF(O,P.lng),s.latLngToECEF(z.lat,j),s.latLngToECEF(P.lat,j)];let Q=s.Aabb.fromPoints(q.map($e=>[s.dot(Z,$e),s.dot(X,$e),s.dot(H,$e)]));const ee=s.transformMat4([],Q.center,B);s.squaredLength(ee)===0&&s.set(ee,0,0,1),s.normalize(ee,ee),s.scale$2(ee,ee,s.GLOBE_RADIUS),S.center=s.ecefToLatLng(ee);const de=S.getWorldToCameraMatrix(),fe=s.invert(new Float64Array(16),de);Q=s.Aabb.applyTransform(Q,s.multiply([],de,B)),s.transformMat4(ee,ee,de);const pe=.5*(Q.max[2]-Q.min[2]),xe=this._minimumAABBFrustumDistance(S,Q),ye=s.scale$2([],[0,0,1],pe),Ae=s.add(ye,ee,ye),We=xe+(S.pitch===0?0:s.distance(ee,Ae)),Ee=S.globeCenterInViewSpace,Fe=s.sub([],ee,[Ee[0],Ee[1],Ee[2]]);s.normalize(Fe,Fe),s.scale$2(Fe,Fe,We);const ke=s.add([],ee,Fe);s.transformMat4(ke,ke,fe);const qe=s.earthRadius/s.GLOBE_RADIUS,Se=s.length(ke),Be=s.mercatorZfromAltitude(Math.max(Se*qe-s.earthRadius,Number.EPSILON),0),Xe=Math.min(S.zoomFromMercatorZAdjusted(Be),C.maxZoom);return Xe>.5*(s.GLOBE_ZOOM_THRESHOLD_MIN+s.GLOBE_ZOOM_THRESHOLD_MAX)?(S.setProjection({name:"mercator"}),S.zoom=Xe,this._cameraForBounds(S,c,f,_,x,T)):{center:S.center,zoom:Xe,bearing:_,pitch:x}}queryTerrainElevation(o,c){const f=this.transform.elevation;return f?(c=s.extend({},{exaggerated:!0},c),f.getAtPoint(s.MercatorCoordinate.fromLngLat(o),null,c.exaggerated)):null}_cameraForBounds(o,c,f,_,x,T){if(o.projection.name==="globe")return this._cameraForBoundsOnGlobe(o,c,f,_,x,T);const S=o.clone(),C=this._extendCameraOptions(T),z=S.padding;S.bearing=_,S.pitch=x;const P=s.LngLat.convert(c),O=s.LngLat.convert(f),j=new s.LngLat(P.lng,O.lat),W=new s.LngLat(O.lng,P.lat),H=S.project(P),Z=S.project(O),X=this.queryTerrainElevation(P),B=this.queryTerrainElevation(O),q=this.queryTerrainElevation(j),Q=this.queryTerrainElevation(W),ee=[[H.x,H.y,Math.min(X||0,B||0,q||0,Q||0)],[Z.x,Z.y,Math.max(X||0,B||0,q||0,Q||0)]];let de=s.Aabb.fromPoints(ee);const fe=S.getWorldToCameraMatrix(),pe=s.invert(new Float64Array(16),fe);de=s.Aabb.applyTransform(de,fe);const xe=s.sub([],de.max,de.min),ye=z.left||0,Ae=z.right||0,We=z.bottom||0,Ee=z.top||0,{left:Fe,right:ke,top:qe,bottom:Se}=C.padding,Be=.5*(ye+Ae),Xe=.5*(Ee+We),$e=Math.min(S.scaleZoom(S.scale*Math.min((S.width-(ye+Ae+Fe+ke))/xe[0],(S.height-(We+Ee+Se+qe))/xe[1])),C.maxZoom),Ye=S.scale/S.zoomScale($e);de=new s.Aabb([de.min[0]-(Fe+Be)*Ye,de.min[1]-(Se+Xe)*Ye,de.min[2]],[de.max[0]+(ke+Be)*Ye,de.max[1]+(qe+Xe)*Ye,de.max[2]]);const gt=.5*xe[2],Et=this._minimumAABBFrustumDistance(S,de),pt=[0,0,1,0];s.transformMat4$1(pt,pt,fe),s.normalize$2(pt,pt);const wt=s.scale$2([],pt,Et+gt),Ut=s.add([],de.center,wt),Ot=(typeof C.offset.x=="number"&&typeof C.offset.y=="number"?new s.Point(C.offset.x,C.offset.y):s.Point.convert(C.offset)).rotate(-s.degToRad(_));de.center[0]-=Ot.x*Ye,de.center[1]+=Ot.y*Ye,s.transformMat4(de.center,de.center,pe),s.transformMat4(Ut,Ut,pe);const mt=[de.center[0],de.center[1],Ut[2]*S.pixelsPerMeter];s.scale$2(mt,mt,1/S.worldSize);const en=s.lngFromMercatorX(mt[0]),rn=s.latFromMercatorY(mt[1]),on=Math.min(S._zoomFromMercatorZ(mt[2]),C.maxZoom),sn=new s.LngLat(en,rn);return S.mercatorFromTransition&&on<.5*(s.GLOBE_ZOOM_THRESHOLD_MIN+s.GLOBE_ZOOM_THRESHOLD_MAX)?(S.setProjection({name:"globe"}),S.zoom=on,this._cameraForBounds(S,c,f,_,x,T)):{center:sn,zoom:on,bearing:_,pitch:x}}fitBounds(o,c,f){const _=this.cameraForBounds(o,c);return this._fitInternal(_,c,f)}fitScreenCoordinates(o,c,f,_,x){const T=s.Point.convert(o),S=s.Point.convert(c),C=new s.Point(Math.min(T.x,S.x),Math.min(T.y,S.y)),z=new s.Point(Math.max(T.x,S.x),Math.max(T.y,S.y));if(this.transform.projection.name==="mercator"&&this.transform.anyCornerOffEdge(T,S))return this;const P=this.transform.pointLocation3D(C),O=this.transform.pointLocation3D(z),j=this.transform.pointLocation3D(new s.Point(C.x,z.y)),W=this.transform.pointLocation3D(new s.Point(z.x,C.y)),H=[Math.min(P.lng,O.lng,j.lng,W.lng),Math.min(P.lat,O.lat,j.lat,W.lat)],Z=[Math.max(P.lng,O.lng,j.lng,W.lng),Math.max(P.lat,O.lat,j.lat,W.lat)],X=_&&_.pitch?_.pitch:this.getPitch(),B=this._cameraForBounds(this.transform,H,Z,f,X,_);return this._fitInternal(B,_,x)}_fitInternal(o,c,f){return o?(delete(c=s.extend(o,c)).padding,c.linear?this.easeTo(c,f):this.flyTo(c,f)):this}jumpTo(o,c){this.stop();const f=o.preloadOnly?this.transform.clone():this.transform;let _=!1,x=!1,T=!1;return"zoom"in o&&f.zoom!==+o.zoom&&(_=!0,f.zoom=+o.zoom),o.center!==void 0&&(f.center=s.LngLat.convert(o.center)),"bearing"in o&&f.bearing!==+o.bearing&&(x=!0,f.bearing=+o.bearing),"pitch"in o&&f.pitch!==+o.pitch&&(T=!0,f.pitch=+o.pitch),o.padding==null||f.isPaddingEqual(o.padding)||(f.padding=o.padding),o.preloadOnly?(this._preloadTiles(f),this):(this.fire(new s.Event("movestart",c)).fire(new s.Event("move",c)),_&&this.fire(new s.Event("zoomstart",c)).fire(new s.Event("zoom",c)).fire(new s.Event("zoomend",c)),x&&this.fire(new s.Event("rotatestart",c)).fire(new s.Event("rotate",c)).fire(new s.Event("rotateend",c)),T&&this.fire(new s.Event("pitchstart",c)).fire(new s.Event("pitch",c)).fire(new s.Event("pitchend",c)),this.fire(new s.Event("moveend",c)))}getFreeCameraOptions(){return this.transform.projection.supportsFreeCamera||s.warnOnce(Ds),this.transform.getFreeCameraOptions()}setFreeCameraOptions(o,c){const f=this.transform;if(!f.projection.supportsFreeCamera)return s.warnOnce(Ds),this;this.stop();const _=f.zoom,x=f.pitch,T=f.bearing;f.setFreeCameraOptions(o);const S=_!==f.zoom,C=x!==f.pitch,z=T!==f.bearing;return this.fire(new s.Event("movestart",c)).fire(new s.Event("move",c)),S&&this.fire(new s.Event("zoomstart",c)).fire(new s.Event("zoom",c)).fire(new s.Event("zoomend",c)),z&&this.fire(new s.Event("rotatestart",c)).fire(new s.Event("rotate",c)).fire(new s.Event("rotateend",c)),C&&this.fire(new s.Event("pitchstart",c)).fire(new s.Event("pitch",c)).fire(new s.Event("pitchend",c)),this.fire(new s.Event("moveend",c)),this}easeTo(o,c){this._stop(!1,o.easeId),((o=s.extend({offset:[0,0],duration:500,easing:s.ease},o)).animate===!1||this._prefersReducedMotion(o))&&(o.duration=0);const f=this.transform,_=this.getZoom(),x=this.getBearing(),T=this.getPitch(),S=this.getPadding(),C="zoom"in o?+o.zoom:_,z="bearing"in o?this._normalizeBearing(o.bearing,x):x,P="pitch"in o?+o.pitch:T,O="padding"in o?o.padding:f.padding,j=s.Point.convert(o.offset);let W,H,Z;if(f.projection.name==="globe"){const ye=s.MercatorCoordinate.fromLngLat(f.center),Ae=j.rotate(-f.angle);ye.x+=Ae.x/f.worldSize,ye.y+=Ae.y/f.worldSize;const We=ye.toLngLat(),Ee=s.LngLat.convert(o.center||We);this._normalizeCenter(Ee),W=f.centerPoint.add(Ae),H=new s.Point(ye.x,ye.y).mult(f.worldSize),Z=new s.Point(s.mercatorXfromLng(Ee.lng),s.mercatorYfromLat(Ee.lat)).mult(f.worldSize).sub(H)}else{W=f.centerPoint.add(j);const ye=f.pointLocation(W),Ae=s.LngLat.convert(o.center||ye);this._normalizeCenter(Ae),H=f.project(ye),Z=f.project(Ae).sub(H)}const X=f.zoomScale(C-_);let B,q;o.around&&(B=s.LngLat.convert(o.around),q=f.locationPoint(B));const Q=this._zooming||C!==_,ee=this._rotating||x!==z,de=this._pitching||P!==T,fe=!f.isPaddingEqual(O),pe=ye=>Ae=>{if(Q&&(ye.zoom=s.number(_,C,Ae)),ee&&(ye.bearing=s.number(x,z,Ae)),de&&(ye.pitch=s.number(T,P,Ae)),fe&&(ye.interpolatePadding(S,O,Ae),W=ye.centerPoint.add(j)),B)ye.setLocationAtPoint(B,q);else{const We=ye.zoomScale(ye.zoom-_),Ee=C>_?Math.min(2,X):Math.max(.5,X),Fe=Math.pow(Ee,1-Ae),ke=ye.unproject(H.add(Z.mult(Ae*Fe)).mult(We));ye.setLocationAtPoint(ye.renderWorldCopies?ke.wrap():ke,W)}return o.preloadOnly||this._fireMoveEvents(c),ye};if(o.preloadOnly){const ye=this._emulate(pe,o.duration,f);return this._preloadTiles(ye),this}const xe={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=Q,this._rotating=ee,this._pitching=de,this._padding=fe,this._easeId=o.easeId,this._prepareEase(c,o.noMoveStart,xe),this._ease(pe(f),ye=>{f.recenterOnTerrain(),this._afterEase(c,ye)},o),this}_prepareEase(o,c,f={}){this._moving=!0,this.transform.cameraElevationReference="sea",c||f.moving||this.fire(new s.Event("movestart",o)),this._zooming&&!f.zooming&&this.fire(new s.Event("zoomstart",o)),this._rotating&&!f.rotating&&this.fire(new s.Event("rotatestart",o)),this._pitching&&!f.pitching&&this.fire(new s.Event("pitchstart",o))}_fireMoveEvents(o){this.fire(new s.Event("move",o)),this._zooming&&this.fire(new s.Event("zoom",o)),this._rotating&&this.fire(new s.Event("rotate",o)),this._pitching&&this.fire(new s.Event("pitch",o))}_afterEase(o,c){if(this._easeId&&c&&this._easeId===c)return;this._easeId=void 0,this.transform.cameraElevationReference="ground";const f=this._zooming,_=this._rotating,x=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,f&&this.fire(new s.Event("zoomend",o)),_&&this.fire(new s.Event("rotateend",o)),x&&this.fire(new s.Event("pitchend",o)),this.fire(new s.Event("moveend",o))}flyTo(o,c){if(this._prefersReducedMotion(o)){const $e=s.pick(o,["center","zoom","bearing","pitch","around"]);return this.jumpTo($e,c)}this.stop(),o=s.extend({offset:[0,0],speed:1.2,curve:1.42,easing:s.ease},o);const f=this.transform,_=this.getZoom(),x=this.getBearing(),T=this.getPitch(),S=this.getPadding(),C="zoom"in o?s.clamp(+o.zoom,f.minZoom,f.maxZoom):_,z="bearing"in o?this._normalizeBearing(o.bearing,x):x,P="pitch"in o?+o.pitch:T,O="padding"in o?o.padding:f.padding,j=f.zoomScale(C-_),W=s.Point.convert(o.offset);let H=f.centerPoint.add(W);const Z=f.pointLocation(H),X=s.LngLat.convert(o.center||Z);this._normalizeCenter(X);const B=f.project(Z),q=f.project(X).sub(B);let Q=o.curve;const ee=Math.max(f.width,f.height),de=ee/j,fe=q.mag();if("minZoom"in o){const $e=s.clamp(Math.min(o.minZoom,_,C),f.minZoom,f.maxZoom),Ye=ee/f.zoomScale($e-_);Q=Math.sqrt(Ye/fe*2)}const pe=Q*Q;function xe($e){const Ye=(de*de-ee*ee+($e?-1:1)*pe*pe*fe*fe)/(2*($e?de:ee)*pe*fe);return Math.log(Math.sqrt(Ye*Ye+1)-Ye)}function ye($e){return(Math.exp($e)-Math.exp(-$e))/2}function Ae($e){return(Math.exp($e)+Math.exp(-$e))/2}const We=xe(0);let Ee=function($e){return Ae(We)/Ae(We+Q*$e)},Fe=function($e){return ee*((Ae(We)*(ye(Ye=We+Q*$e)/Ae(Ye))-ye(We))/pe)/fe;var Ye},ke=(xe(1)-We)/Q;if(Math.abs(fe)<1e-6||!isFinite(ke)){if(Math.abs(ee-de)<1e-6)return this.easeTo(o,c);const $e=deo.maxDuration&&(o.duration=0);const qe=x!==z,Se=P!==T,Be=!f.isPaddingEqual(O),Xe=$e=>Ye=>{const gt=Ye*ke,Et=1/Ee(gt);$e.zoom=Ye===1?C:_+$e.scaleZoom(Et),qe&&($e.bearing=s.number(x,z,Ye)),Se&&($e.pitch=s.number(T,P,Ye)),Be&&($e.interpolatePadding(S,O,Ye),H=$e.centerPoint.add(W));const pt=Ye===1?X:$e.unproject(B.add(q.mult(Fe(gt))).mult(Et));return $e.setLocationAtPoint($e.renderWorldCopies?pt.wrap():pt,H),$e._updateCameraOnTerrain(),o.preloadOnly||this._fireMoveEvents(c),$e};if(o.preloadOnly){const $e=this._emulate(Xe,o.duration,f);return this._preloadTiles($e),this}return this._zooming=!0,this._rotating=qe,this._pitching=Se,this._padding=Be,this._prepareEase(c,!1),this._ease(Xe(f),()=>this._afterEase(c),o),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(o,c){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),this._easeFrameId=void 0,this._onEaseFrame=void 0),this._onEaseEnd){const f=this._onEaseEnd;this._onEaseEnd=void 0,f.call(this,c)}if(!o){const f=this.handlers;f&&f.stop(!1)}return this}_ease(o,c,f){f.animate===!1||f.duration===0?(o(1),c()):(this._easeStart=s.exported.now(),this._easeOptions=f,this._onEaseFrame=o,this._onEaseEnd=c,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const o=Math.min((s.exported.now()-this._easeStart)/this._easeOptions.duration,1),c=this._onEaseFrame;c&&c(this._easeOptions.easing(o)),o<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(o,c){o=s.wrap(o,-180,180);const f=Math.abs(o-c);return Math.abs(o-360-c)180?-360:f<-180?360:0}_prefersReducedMotion(o){return this._respectPrefersReducedMotion&&s.exported.prefersReducedMotion&&!(o&&o.essential)}_emulate(o,c,f){const _=Math.ceil(15*c/1e3),x=[],T=o(f.clone());for(let S=0;S<=_;S++){const C=T(S/_);x.push(C.clone())}return x}}class dt{constructor(o={}){this.options=o,s.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)}getDefaultPosition(){return"bottom-right"}onAdd(o){const c=this.options&&this.options.compact;return this._map=o,this._container=J("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=J("button","mapboxgl-ctrl-attrib-button",this._container),J("span","mapboxgl-ctrl-icon",this._compactButton).setAttribute("aria-hidden","true"),this._compactButton.type="button",this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=J("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),c&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),c===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0}_setElementTitle(o,c){const f=this._map._getUIString(`AttributionControl.${c}`);o.setAttribute("aria-label",f),o.removeAttribute("title"),o.firstElementChild&&o.firstElementChild.setAttribute("title",f)}_toggleAttribution(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","true"))}_updateEditLink(){let o=this._editLink;o||(o=this._editLink=this._container.querySelector(".mapbox-improve-map"));const c=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||s.config.ACCESS_TOKEN}];if(o){const f=c.reduce((_,x,T)=>(x.value&&(_+=`${x.key}=${x.value}${T_.length-x.length),o=o.filter((_,x)=>{for(let T=x+1;T=0)return!1;return!0}),this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?o=[...this.options.customAttribution,...o]:o.unshift(this.options.customAttribution));const f=o.join(" | ");f!==this._attribHTML&&(this._attribHTML=f,o.length?(this._innerContainer.innerHTML=f,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")}}class cd{constructor(){s.bindAll(["_updateLogo","_updateCompact"],this)}onAdd(o){this._map=o,this._container=J("div","mapboxgl-ctrl");const c=J("a","mapboxgl-ctrl-logo");return c.target="_blank",c.rel="noopener nofollow",c.href="https://www.mapbox.com/",c.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),c.setAttribute("rel","noopener nofollow"),this._container.appendChild(c),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)}getDefaultPosition(){return"bottom-left"}_updateLogo(o){o&&o.sourceDataType!=="metadata"||(this._container.style.display=this._logoRequired()?"block":"none")}_logoRequired(){if(!this._map.style)return!0;const o=this._map.style._sourceCaches;if(Object.entries(o).length===0)return!0;for(const c in o){const f=o[c].getSource();if(f.hasOwnProperty("mapbox_logo")&&!f.mapbox_logo)return!1}return!0}_updateCompact(){const o=this._container.children;if(o.length){const c=o[0];this._map.getCanvasContainer().offsetWidth<250?c.classList.add("mapboxgl-compact"):c.classList.remove("mapboxgl-compact")}}}class ud{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(o){const c=++this._id;return this._queue.push({callback:o,id:c,cancelled:!1}),c}remove(o){const c=this._currentlyRunning,f=c?this._queue.concat(c):this._queue;for(const _ of f)if(_.id===o)return void(_.cancelled=!0)}run(o=0){const c=this._currentlyRunning=this._queue;this._queue=[];for(const f of c)if(!f.cancelled&&(f.callback(o),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}function Ia(d,o,c){if(d=new s.LngLat(d.lng,d.lat),o){const f=new s.LngLat(d.lng-360,d.lat),_=new s.LngLat(d.lng+360,d.lat),x=360*Math.ceil(Math.abs(d.lng-c.center.lng)/360),T=c.locationPoint(d).distSqr(o),S=o.x<0||o.y<0||o.x>c.width||o.y>c.height;c.locationPoint(f).distSqr(o)180;){const f=c.locationPoint(d);if(f.x>=0&&f.y>=0&&f.x<=c.width&&f.y<=c.height)break;d.lng>c.center.lng?d.lng-=360:d.lng+=360}return d}const Os={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%)"};class at extends s.Evented{constructor(o,c){if(super(),(o instanceof s.window.HTMLElement||c)&&(o=s.extend({element:o},c)),s.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress","_clearFadeTimer"],this),this._anchor=o&&o.anchor||"center",this._color=o&&o.color||"#3FB1CE",this._scale=o&&o.scale||1,this._draggable=o&&o.draggable||!1,this._clickTolerance=o&&o.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=o&&o.rotation||0,this._rotationAlignment=o&&o.rotationAlignment||"auto",this._pitchAlignment=o&&o.pitchAlignment&&o.pitchAlignment||"auto",this._updateMoving=()=>this._update(!0),this._occludedOpacity=o&&o.occludedOpacity||.2,o&&o.element)this._element=o.element,this._offset=s.Point.convert(o&&o.offset||[0,0]);else{this._defaultMarker=!0,this._element=J("div");const _=41,x=27,T=ve("svg",{display:"block",height:_*this._scale+"px",width:x*this._scale+"px",viewBox:`0 0 ${x} ${_}`},this._element),S=ve("radialGradient",{id:"shadowGradient"},ve("defs",{},T));ve("stop",{offset:"10%","stop-opacity":.4},S),ve("stop",{offset:"100%","stop-opacity":.05},S),ve("ellipse",{cx:13.5,cy:34.8,rx:10.5,ry:5.25,fill:"url(#shadowGradient)"},T),ve("path",{fill:this._color,d:"M27,13.5C27,19.07 20.25,27 14.75,34.5C14.02,35.5 12.98,35.5 12.25,34.5C6.75,27 0,19.22 0,13.5C0,6.04 6.04,0 13.5,0C20.96,0 27,6.04 27,13.5Z"},T),ve("path",{opacity:.25,d:"M13.5,0C6.04,0 0,6.04 0,13.5C0,19.22 6.75,27 12.25,34.5C13,35.52 14.02,35.5 14.75,34.5C20.25,27 27,19.07 27,13.5C27,6.04 20.96,0 13.5,0ZM13.5,1C20.42,1 26,6.58 26,13.5C26,15.9 24.5,19.18 22.22,22.74C19.95,26.3 16.71,30.14 13.94,33.91C13.74,34.18 13.61,34.32 13.5,34.44C13.39,34.32 13.26,34.18 13.06,33.91C10.28,30.13 7.41,26.31 5.02,22.77C2.62,19.23 1,15.95 1,13.5C1,6.58 6.58,1 13.5,1Z"},T),ve("circle",{fill:"white",cx:13.5,cy:13.5,r:5.5},T),this._offset=s.Point.convert(o&&o.offset||[0,-14])}this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label","Map marker"),this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",_=>{_.preventDefault()}),this._element.addEventListener("mousedown",_=>{_.preventDefault()});const f=this._element.classList;for(const _ in Os)f.remove(`mapboxgl-marker-anchor-${_}`);f.add(`mapboxgl-marker-anchor-${this._anchor}`),this._popup=null}addTo(o){return o===this._map||(this.remove(),this._map=o,o.getCanvasContainer().appendChild(this._element),o.on("move",this._updateMoving),o.on("moveend",this._update),o.on("remove",this._clearFadeTimer),o._addMarker(this),this.setDraggable(this._draggable),this._update(),o.on("click",this._onMapClick)),this}remove(){const o=this._map;return o&&(o.off("click",this._onMapClick),o.off("move",this._updateMoving),o.off("moveend",this._update),o.off("mousedown",this._addDragHandler),o.off("touchstart",this._addDragHandler),o.off("mouseup",this._onUp),o.off("touchend",this._onUp),o.off("mousemove",this._onMove),o.off("touchmove",this._onMove),o.off("remove",this._clearFadeTimer),o._removeMarker(this),this._map=void 0),this._clearFadeTimer(),this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(o){return this._lngLat=s.LngLat.convert(o),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(!0),this}getElement(){return this._element}setPopup(o){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeAttribute("role"),this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),o){if(!("offset"in o.options)){const _=Math.sqrt(Math.pow(13.5,2)/2);o.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[_,-1*(38.1-13.5+_)],"bottom-right":[-_,-1*(38.1-13.5+_)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=o,o._marker=this,this._lngLat&&this._popup.setLngLat(this._lngLat),this._element.setAttribute("role","button"),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress),this._element.setAttribute("aria-expanded","false")}return this}_onKeyPress(o){const c=o.code,f=o.charCode||o.keyCode;c!=="Space"&&c!=="Enter"&&f!==32&&f!==13||this.togglePopup()}_onMapClick(o){const c=o.originalEvent.target,f=this._element;this._popup&&(c===f||f.contains(c))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const o=this._popup;return o?(o.isOpen()?(o.remove(),this._element.setAttribute("aria-expanded","false")):this._map&&(o.addTo(this._map),this._element.setAttribute("aria-expanded","true")),this):this}_behindTerrain(){const o=this._map,c=this._pos;if(!o||!c)return!1;const f=o.unproject(c),_=o.getFreeCameraOptions();if(!_.position)return!1;const x=_.position.toLngLat();return x.distanceTo(f)<.9*x.distanceTo(this._lngLat)}_evaluateOpacity(){const o=this._map;if(!o)return;const c=this._pos;if(!c||c.x<0||c.x>o.transform.width||c.y<0||c.y>o.transform.height)return void this._clearFadeTimer();const f=o.unproject(c);let _;o._showingGlobe()&&s.isLngLatBehindGlobe(o.transform,this._lngLat)?_=0:(_=1-o._queryFogOpacity(f),o.transform._terrainEnabled()&&o.getTerrain()&&this._behindTerrain()&&(_*=this._occludedOpacity)),this._element.style.opacity=`${_}`,this._element.style.pointerEvents=_>0?"auto":"none",this._popup&&this._popup._setOpacity(_),this._fadeTimer=null}_clearFadeTimer(){this._fadeTimer&&(clearTimeout(this._fadeTimer),this._fadeTimer=null)}_updateDOM(){const o=this._pos;if(!o||!this._map)return;const c=this._offset.mult(this._scale);this._element.style.transform=` + translate(${o.x}px,${o.y}px) + ${Os[this._anchor]} + ${this._calculateXYTransform()} ${this._calculateZTransform()} + translate(${c.x}px,${c.y}px) + `}_calculateXYTransform(){const o=this._pos,c=this._map,f=this.getPitchAlignment();if(!c||!o||f!=="map")return"";if(!c._showingGlobe()){const C=c.getPitch();return C?`rotateX(${C}deg)`:""}const _=s.radToDeg(s.globeTiltAtLngLat(c.transform,this._lngLat)),x=o.sub(s.globeCenterToScreenPoint(c.transform)),T=Math.abs(x.x)+Math.abs(x.y);if(T===0)return"";const S=_/T;return`rotateX(${-x.y*S}deg) rotateY(${x.x*S}deg)`}_calculateZTransform(){const o=this._pos,c=this._map;if(!c||!o)return"";let f=0;const _=this.getRotationAlignment();if(_==="map")if(c._showingGlobe()){const x=c.project(new s.LngLat(this._lngLat.lng,this._lngLat.lat+.001)),T=c.project(new s.LngLat(this._lngLat.lng,this._lngLat.lat-.001)).sub(x);f=s.radToDeg(Math.atan2(T.y,T.x))-90}else f=-c.getBearing();else if(_==="horizon"){const x=s.smoothstep(4,6,c.getZoom()),T=s.globeCenterToScreenPoint(c.transform);T.y+=x*c.transform.height;const S=o.sub(T),C=s.radToDeg(Math.atan2(S.y,S.x));f=(C>90?C-270:C+90)*(1-x)}return f+=this._rotation,f?`rotateZ(${f}deg)`:""}_update(o){s.window.cancelAnimationFrame(this._updateFrameId);const c=this._map;c&&(c.transform.renderWorldCopies&&(this._lngLat=Ia(this._lngLat,this._pos,c.transform)),this._pos=c.project(this._lngLat),o===!0?this._updateFrameId=s.window.requestAnimationFrame(()=>{this._element&&this._pos&&this._anchor&&(this._pos=this._pos.round(),this._updateDOM())}):this._pos=this._pos.round(),c._requestDomTask(()=>{this._map&&(this._element&&this._pos&&this._anchor&&this._updateDOM(),(c._showingGlobe()||c.getTerrain()||c.getFog())&&!this._fadeTimer&&(this._fadeTimer=setTimeout(this._evaluateOpacity.bind(this),60)))}))}getOffset(){return this._offset}setOffset(o){return this._offset=s.Point.convert(o),this._update(),this}_onMove(o){const c=this._map;if(!c)return;const f=this._pointerdownPos,_=this._positionDelta;if(f&&_){if(!this._isDragging){const x=this._clickTolerance||c._clickTolerance;if(o.point.dist(f)=this._endTime)return this._end;const c=s.easeCubicInOut((o-this._startTime)/(this._endTime-this._startTime));return this._start*(1-c)+this._end*c}isEasing(o){return o>=this._startTime&&o<=this._endTime}jumpTo(o){this._startTime=-1/0,this._endTime=-1/0,this._start=o,this._end=o}easeTo(o,c,f){this._start=this.getValue(c),this._end=o,this._startTime=c,this._endTime=c+f}}const Zf={"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":"Mapbox logo","Map.Title":"Map","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScrollZoomBlocker.CtrlMessage":"Use ctrl + scroll to zoom the map","ScrollZoomBlocker.CmdMessage":"Use ⌘ + scroll to zoom the map","TouchPanBlocker.Message":"Use two fingers to move the map"},Hf={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:85,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,performanceMetricsCollection:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,optimizeForTerrain:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,minTileCacheSize:null,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",localFontFamily:null,transformRequest:null,accessToken:null,fadeDuration:300,respectPrefersReducedMotion:!0,crossSourceCollisions:!0},hy={showCompass:!0,showZoom:!0,visualizePitch:!1};class dy{constructor(o,c,f=!1){this._clickTolerance=10,this.element=c,this.mouseRotate=new id({clickTolerance:o.dragRotate._mouseRotate._clickTolerance}),this.map=o,f&&(this.mousePitch=new od({clickTolerance:o.dragRotate._mousePitch._clickTolerance})),s.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),c.addEventListener("mousedown",this.mousedown),c.addEventListener("touchstart",this.touchstart,{passive:!1}),c.addEventListener("touchmove",this.touchmove),c.addEventListener("touchend",this.touchend),c.addEventListener("touchcancel",this.reset)}down(o,c){this.mouseRotate.mousedown(o,c),this.mousePitch&&this.mousePitch.mousedown(o,c),ie()}move(o,c){const f=this.map,_=this.mouseRotate.mousemoveWindow(o,c),x=_&&_.bearingDelta;if(x&&f.setBearing(f.getBearing()+x),this.mousePitch){const T=this.mousePitch.mousemoveWindow(o,c),S=T&&T.pitchDelta;S&&f.setPitch(f.getPitch()+S)}}off(){const o=this.element;o.removeEventListener("mousedown",this.mousedown),o.removeEventListener("touchstart",this.touchstart,{passive:!1}),o.removeEventListener("touchmove",this.touchmove),o.removeEventListener("touchend",this.touchend),o.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){te(),s.window.removeEventListener("mousemove",this.mousemove),s.window.removeEventListener("mouseup",this.mouseup)}mousedown(o){this.down(s.extend({},o,{ctrlKey:!0,preventDefault:()=>o.preventDefault()}),Oe(this.element,o)),s.window.addEventListener("mousemove",this.mousemove),s.window.addEventListener("mouseup",this.mouseup)}mousemove(o){this.move(o,Oe(this.element,o))}mouseup(o){this.mouseRotate.mouseupWindow(o),this.mousePitch&&this.mousePitch.mouseupWindow(o),this.offTemp()}touchstart(o){o.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=Ke(this.element,o.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>o.preventDefault()},this._startPos))}touchmove(o){o.targetTouches.length!==1?this.reset():(this._lastPos=Ke(this.element,o.targetTouches)[0],this.move({preventDefault:()=>o.preventDefault()},this._lastPos))}touchend(o){o.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)d.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(d.minPitch!=null&&d.maxPitch!=null&&d.minPitch>d.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(d.minPitch!=null&&d.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(d.maxPitch!=null&&d.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(d.antialias&&s.isSafariWithAntialiasingBug(s.window)&&(d.antialias=!1,s.warnOnce("Antialiasing is disabled for this WebGL context to avoid browser bug: https://github.com/mapbox/mapbox-gl-js/issues/11609")),super(new Ta(d.minZoom,d.maxZoom,d.minPitch,d.maxPitch,d.renderWorldCopies),d),this._interactive=d.interactive,this._minTileCacheSize=d.minTileCacheSize,this._maxTileCacheSize=d.maxTileCacheSize,this._failIfMajorPerformanceCaveat=d.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=d.preserveDrawingBuffer,this._antialias=d.antialias,this._useWebGL2=d.useWebGL2,this._trackResize=d.trackResize,this._bearingSnap=d.bearingSnap,this._refreshExpiredTiles=d.refreshExpiredTiles,this._fadeDuration=d.fadeDuration,this._isInitialLoad=!0,this._crossSourceCollisions=d.crossSourceCollisions,this._collectResourceTiming=d.collectResourceTiming,this._optimizeForTerrain=d.optimizeForTerrain,this._language=this._parseLanguage(d.language),this._worldview=d.worldview,this._renderTaskQueue=new ud,this._domRenderTaskQueue=new ud,this._controls=[],this._markers=[],this._popups=[],this._mapId=s.uniqueId(),this._locale=s.extend({},Zf,d.locale),this._clickTolerance=d.clickTolerance,this._cooperativeGestures=d.cooperativeGestures,this._performanceMetricsCollection=d.performanceMetricsCollection,this._containerWidth=0,this._containerHeight=0,this._averageElevationLastSampledAt=-1/0,this._averageElevationExaggeration=0,this._averageElevation=new dd(0),this._interactionRange=[1/0,-1/0],this._visibilityHidden=0,this._useExplicitProjection=!1,this._requestManager=new s.RequestManager(d.transformRequest,d.accessToken,d.testMode),this._silenceAuthErrors=!!d.testMode,typeof d.container=="string"){if(this._container=s.window.document.getElementById(d.container),!this._container)throw new Error(`Container '${d.container}' not found.`)}else{if(!(d.container instanceof s.window.HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=d.container}if(this._container.childNodes.length>0&&s.warnOnce("The map container element should be empty, otherwise the map's interactivity will be negatively impacted. If you want to display a message when WebGL is not supported, use the Mapbox GL Supported plugin instead."),d.maxBounds&&this.setMaxBounds(d.maxBounds),s.bindAll(["_onWindowOnline","_onWindowResize","_onVisibilityChange","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),s.window!==void 0&&(s.window.addEventListener("online",this._onWindowOnline,!1),s.window.addEventListener("resize",this._onWindowResize,!1),s.window.addEventListener("orientationchange",this._onWindowResize,!1),s.window.addEventListener("webkitfullscreenchange",this._onWindowResize,!1),s.window.addEventListener("visibilitychange",this._onVisibilityChange,!1)),this.handlers=new ro(this,d),this._localFontFamily=d.localFontFamily,this._localIdeographFontFamily=d.localIdeographFontFamily,d.style&&this.setStyle(d.style,{localFontFamily:this._localFontFamily,localIdeographFontFamily:this._localIdeographFontFamily}),d.projection&&this.setProjection(d.projection),this._hash=d.hash&&new ed(typeof d.hash=="string"&&d.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:d.center,zoom:d.zoom,bearing:d.bearing,pitch:d.pitch}),d.bounds&&(this.resize(),this.fitBounds(d.bounds,s.extend({},d.fitBoundsOptions,{duration:0})))),this.resize(),d.attributionControl&&this.addControl(new dt({customAttribution:d.customAttribution})),this._logoControl=new cd,this.addControl(this._logoControl,d.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",o=>{this._update(o.dataType==="style"),this.fire(new s.Event(`${o.dataType}data`,o))}),this.on("dataloading",o=>{this.fire(new s.Event(`${o.dataType}dataloading`,o))})}_getMapId(){return this._mapId}addControl(d,o){if(o===void 0&&(o=d.getDefaultPosition?d.getDefaultPosition():"top-right"),!d||!d.onAdd)return this.fire(new s.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const c=d.onAdd(this);this._controls.push(d);const f=this._controlPositions[o];return o.indexOf("bottom")!==-1?f.insertBefore(c,f.firstChild):f.appendChild(c),this}removeControl(d){if(!d||!d.onRemove)return this.fire(new s.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const o=this._controls.indexOf(d);return o>-1&&this._controls.splice(o,1),d.onRemove(this),this}hasControl(d){return this._controls.indexOf(d)>-1}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}resize(d){if(this._updateContainerDimensions(),this._containerWidth===this.transform.width&&this._containerHeight===this.transform.height)return this;this._resizeCanvas(this._containerWidth,this._containerHeight),this.transform.resize(this._containerWidth,this._containerHeight),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight));const o=!this._moving;return o&&this.fire(new s.Event("movestart",d)).fire(new s.Event("move",d)),this.fire(new s.Event("resize",d)),o&&this.fire(new s.Event("moveend",d)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()||null}setMaxBounds(d){return this.transform.setMaxBounds(s.LngLatBounds.convert(d)),this._update()}setMinZoom(d){if((d=d??-2)>=-2&&d<=this.transform.maxZoom)return this.transform.minZoom=d,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=d,this._update(),this.getZoom()>d?this.setZoom(d):this.fire(new s.Event("zoomstart")).fire(new s.Event("zoom")).fire(new s.Event("zoomend")),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(d){if((d=d??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(d>=0&&d<=this.transform.maxPitch)return this.transform.minPitch=d,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(d>=this.transform.minPitch)return this.transform.maxPitch=d,this._update(),this.getPitch()>d?this.setPitch(d):this.fire(new s.Event("pitchstart")).fire(new s.Event("pitch")).fire(new s.Event("pitchend")),this;throw new Error("maxPitch must be greater than or equal to minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(d){return this.transform.renderWorldCopies=d,this.transform.renderWorldCopies||this._forceMarkerAndPopupUpdate(!0),this._update()}getLanguage(){return this._language}_parseLanguage(d){return d==="auto"?s.window.navigator.language:Array.isArray(d)?d.length===0?void 0:d.map(o=>o==="auto"?s.window.navigator.language:o):d}setLanguage(d){const o=this._parseLanguage(d);if(!this.style||o===this._language)return this;this._language=o,this.style._reloadSources();for(const c of this._controls)c._setLanguage&&c._setLanguage(this._language);return this}getWorldview(){return this._worldview}setWorldview(d){return this.style&&d!==this._worldview?(this._worldview=d,this.style._reloadSources(),this):this}getProjection(){return this.transform.mercatorFromTransition?{name:"globe",center:[0,0]}:this.transform.getProjection()}_showingGlobe(){return this.transform.projection.name==="globe"}setProjection(d){return this._lazyInitEmptyStyle(),d?typeof d=="string"&&(d={name:d}):d=null,this._useExplicitProjection=!!d,this._prioritizeAndUpdateProjection(d,this.style.stylesheet?this.style.stylesheet.projection:null)}_updateProjectionTransition(){if(this.getProjection().name!=="globe")return;const d=this.transform,o=d.projection.name;let c;o==="globe"&&d.zoom>=s.GLOBE_ZOOM_THRESHOLD_MAX?(d.setMercatorFromTransition(),c=!0):o==="mercator"&&d.zoom=s.GLOBE_ZOOM_THRESHOLD_MAX?this.transform.setMercatorFromTransition():this.transform.setProjection(d),this.style.applyProjectionUpdate(),o){this.painter.clearBackgroundTiles();for(const c in this.style._sourceCaches)this.style._sourceCaches[c].clearTiles();this._update(!0),this._forceMarkerAndPopupUpdate(!0)}return this}project(d){return this.transform.locationPoint3D(s.LngLat.convert(d))}unproject(d){return this.transform.pointLocation3D(s.Point.convert(d))}isMoving(){return this._moving||this.handlers&&this.handlers.isMoving()||!1}isZooming(){return this._zooming||this.handlers&&this.handlers.isZooming()||!1}isRotating(){return this._rotating||this.handlers&&this.handlers.isRotating()||!1}_isDragging(){return this.handlers&&this.handlers._isDragging()||!1}_createDelegatedListener(d,o,c){if(d==="mouseenter"||d==="mouseover"){let f=!1;const _=T=>{const S=o.filter(z=>this.getLayer(z)),C=S.length?this.queryRenderedFeatures(T.point,{layers:S}):[];C.length?f||(f=!0,c.call(this,new pr(d,this,T.originalEvent,{features:C}))):f=!1},x=()=>{f=!1};return{layers:new Set(o),listener:c,delegates:{mousemove:_,mouseout:x}}}if(d==="mouseleave"||d==="mouseout"){let f=!1;const _=T=>{const S=o.filter(C=>this.getLayer(C));(S.length?this.queryRenderedFeatures(T.point,{layers:S}):[]).length?f=!0:f&&(f=!1,c.call(this,new pr(d,this,T.originalEvent)))},x=T=>{f&&(f=!1,c.call(this,new pr(d,this,T.originalEvent)))};return{layers:new Set(o),listener:c,delegates:{mousemove:_,mouseout:x}}}{const f=_=>{const x=o.filter(S=>this.getLayer(S)),T=x.length?this.queryRenderedFeatures(_.point,{layers:x}):[];T.length&&(_.features=T,c.call(this,_),delete _.features)};return{layers:new Set(o),listener:c,delegates:{[d]:f}}}}on(d,o,c){if(c===void 0)return super.on(d,o);Array.isArray(o)||(o=[o]);const f=this._createDelegatedListener(d,o,c);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[d]=this._delegatedListeners[d]||[],this._delegatedListeners[d].push(f);for(const _ in f.delegates)this.on(_,f.delegates[_]);return this}once(d,o,c){if(c===void 0)return super.once(d,o);Array.isArray(o)||(o=[o]);const f=this._createDelegatedListener(d,o,c);for(const _ in f.delegates)this.once(_,f.delegates[_]);return this}off(d,o,c){if(c===void 0)return super.off(d,o);o=new Set(Array.isArray(o)?o:[o]);const f=(x,T)=>{if(x.size!==T.size)return!1;for(const S of x)if(!T.has(S))return!1;return!0},_=this._delegatedListeners?this._delegatedListeners[d]:void 0;return _&&(x=>{for(let T=0;T{_?this.fire(new s.ErrorEvent(_)):x&&this._updateDiff(x,o)})}else typeof d=="object"&&this._updateDiff(d,o)}_updateDiff(d,o){try{this.style.setState(d)&&this._update(!0)}catch(c){s.warnOnce(`Unable to perform style diff: ${c.message||c.error||c}. Rebuilding the style from scratch.`),this._updateStyle(d,o)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():(s.warnOnce("There is no style added to the map."),!1)}addSource(d,o){return this._lazyInitEmptyStyle(),this.style.addSource(d,o),this._update(!0)}isSourceLoaded(d){return!!this.style&&this.style._isSourceCacheLoaded(d)}areTilesLoaded(){const d=this.style&&this.style._sourceCaches;for(const o in d){const c=d[o]._tiles;for(const f in c){const _=c[f];if(_.state!=="loaded"&&_.state!=="errored")return!1}}return!0}addSourceType(d,o,c){this._lazyInitEmptyStyle(),this.style.addSourceType(d,o,c)}removeSource(d){return this.style.removeSource(d),this._updateTerrain(),this._update(!0)}getSource(d){return this.style.getSource(d)}addImage(d,o,{pixelRatio:c=1,sdf:f=!1,stretchX:_,stretchY:x,content:T}={}){if(this._lazyInitEmptyStyle(),o instanceof s.window.HTMLImageElement||s.window.ImageBitmap&&o instanceof s.window.ImageBitmap){const{width:S,height:C,data:z}=s.exported.getImageData(o);this.style.addImage(d,{data:new s.RGBAImage({width:S,height:C},z),pixelRatio:c,stretchX:_,stretchY:x,content:T,sdf:f,version:0})}else if(o.width===void 0||o.height===void 0)this.fire(new s.ErrorEvent(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`")));else{const{width:S,height:C}=o,z=o;this.style.addImage(d,{data:new s.RGBAImage({width:S,height:C},new Uint8Array(z.data)),pixelRatio:c,stretchX:_,stretchY:x,content:T,sdf:f,version:0,userImage:z}),z.onAdd&&z.onAdd(this,d)}}updateImage(d,o){const c=this.style.getImage(d);if(!c)return void this.fire(new s.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const f=o instanceof s.window.HTMLImageElement||s.window.ImageBitmap&&o instanceof s.window.ImageBitmap?s.exported.getImageData(o):o,{width:_,height:x}=f;_!==void 0&&x!==void 0?_===c.data.width&&x===c.data.height?(c.data.replace(f.data,!(o instanceof s.window.HTMLImageElement||s.window.ImageBitmap&&o instanceof s.window.ImageBitmap)),this.style.updateImage(d,c)):this.fire(new s.ErrorEvent(new Error(`The width and height of the updated image (${_}, ${x}) + must be that same as the previous version of the image + (${c.data.width}, ${c.data.height})`))):this.fire(new s.ErrorEvent(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`")))}hasImage(d){return d?!!this.style.getImage(d):(this.fire(new s.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(d){this.style.removeImage(d)}loadImage(d,o){s.getImage(this._requestManager.transformRequest(d,s.ResourceType.Image),(c,f)=>{o(c,f instanceof s.window.HTMLImageElement?s.exported.getImageData(f):f)})}listImages(){return this.style.listImages()}addLayer(d,o){return this._lazyInitEmptyStyle(),this.style.addLayer(d,o),this._update(!0)}moveLayer(d,o){return this.style.moveLayer(d,o),this._update(!0)}removeLayer(d){return this.style.removeLayer(d),this._update(!0)}getLayer(d){return this.style.getLayer(d)}setLayerZoomRange(d,o,c){return this.style.setLayerZoomRange(d,o,c),this._update(!0)}setFilter(d,o,c={}){return this.style.setFilter(d,o,c),this._update(!0)}getFilter(d){return this.style.getFilter(d)}setPaintProperty(d,o,c,f={}){return this.style.setPaintProperty(d,o,c,f),this._update(!0)}getPaintProperty(d,o){return this.style.getPaintProperty(d,o)}setLayoutProperty(d,o,c,f={}){return this.style.setLayoutProperty(d,o,c,f),this._update(!0)}getLayoutProperty(d,o){return this.style.getLayoutProperty(d,o)}setLight(d,o={}){return this._lazyInitEmptyStyle(),this.style.setLight(d,o),this._update(!0)}getLight(){return this.style.getLight()}setTerrain(d){return this._lazyInitEmptyStyle(),!d&&this.transform.projection.requiresDraping?this.style.setTerrainForDraping():this.style.setTerrain(d),this._averageElevationLastSampledAt=-1/0,this._update(!0)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(d){return this._lazyInitEmptyStyle(),this.style.setFog(d),this._update(!0)}getFog(){return this.style?this.style.getFog():null}_queryFogOpacity(d){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(s.LngLat.convert(d),this.transform):0}setFeatureState(d,o){return this.style.setFeatureState(d,o),this._update()}removeFeatureState(d,o){return this.style.removeFeatureState(d,o),this._update()}getFeatureState(d){return this.style.getFeatureState(d)}_updateContainerDimensions(){if(!this._container)return;const d=this._container.getBoundingClientRect().width||400,o=this._container.getBoundingClientRect().height||300;let c,f,_,x=this._container;for(;x&&(!f||!_);){const T=s.window.getComputedStyle(x).transform;T&&T!=="none"&&(c=T.match(/matrix.*\((.+)\)/)[1].split(", "),c[0]&&c[0]!=="0"&&c[0]!=="1"&&(f=c[0]),c[3]&&c[3]!=="0"&&c[3]!=="1"&&(_=c[3])),x=x.parentElement}this._containerWidth=f?Math.abs(d/f):d,this._containerHeight=_?Math.abs(o/_):o}_detectMissingCSS(){s.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")!=="rgb(250, 128, 114)"&&s.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")}_setupContainer(){const d=this._container;d.classList.add("mapboxgl-map"),(this._missingCSSCanary=J("div","mapboxgl-canary",d)).style.visibility="hidden",this._detectMissingCSS();const o=this._canvasContainer=J("div","mapboxgl-canvas-container",d);this._interactive&&o.classList.add("mapboxgl-interactive"),this._canvas=J("canvas","mapboxgl-canvas",o),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region"),this._updateContainerDimensions(),this._resizeCanvas(this._containerWidth,this._containerHeight);const c=this._controlContainer=J("div","mapboxgl-control-container",d),f=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(_=>{f[_]=J("div",`mapboxgl-ctrl-${_}`,c)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(d,o){const c=s.exported.devicePixelRatio||1;this._canvas.width=c*Math.ceil(d),this._canvas.height=c*Math.ceil(o),this._canvas.style.width=`${d}px`,this._canvas.style.height=`${o}px`}_addMarker(d){this._markers.push(d)}_removeMarker(d){const o=this._markers.indexOf(d);o!==-1&&this._markers.splice(o,1)}_addPopup(d){this._popups.push(d)}_removePopup(d){const o=this._popups.indexOf(d);o!==-1&&this._popups.splice(o,1)}_setupPainter(){const d=s.extend({},D.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),o=this._useWebGL2&&this._canvas.getContext("webgl2",d),c=o||this._canvas.getContext("webgl",d)||this._canvas.getContext("experimental-webgl",d);c?(this._useWebGL2&&!o&&s.warnOnce("Failed to create WebGL 2 context. Using WebGL 1."),s.storeAuthState(c,!0),this.painter=new ba(c,this.transform,!!o),this.on("data",f=>{f.dataType==="source"&&this.painter.setTileLoadedFlag(!0)}),s.exported$1.testSupport(c)):this.fire(new s.ErrorEvent(new Error("Failed to initialize WebGL")))}_contextLost(d){d.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new s.Event("webglcontextlost",{originalEvent:d}))}_contextRestored(d){this._setupPainter(),this.resize(),this._update(),this.fire(new s.Event("webglcontextrestored",{originalEvent:d}))}_onMapScroll(d){if(d.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(d){return this.style?(this._styleDirty=this._styleDirty||d,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(d){return this._update(),this._renderTaskQueue.add(d)}_cancelRenderFrame(d){this._renderTaskQueue.remove(d)}_requestDomTask(d){!this.loaded()||this.loaded()&&!this.isMoving()?d():this._domRenderTaskQueue.add(d)}_render(d){let o;const c=this.painter.context.extTimerQuery,f=s.exported.now();if(this.listens("gpu-timing-frame")&&(o=c.createQueryEXT(),c.beginQueryEXT(c.TIME_ELAPSED_EXT,o)),this.painter.context.setDirty(),this.painter.setBaseState(),(this.isMoving()||this.isRotating()||this.isZooming())&&(this._interactionRange[0]=Math.min(this._interactionRange[0],s.window.performance.now()),this._interactionRange[1]=Math.max(this._interactionRange[1],s.window.performance.now())),this._renderTaskQueue.run(d),this._domRenderTaskQueue.run(d),this._removed)return;this._updateProjectionTransition();const _=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;const S=this.transform.zoom,C=this.transform.pitch,z=s.exported.now(),P=new s.EvaluationParameters(S,{now:z,fadeDuration:_,pitch:C,transition:this.style.getTransition()});this.style.update(P)}this.style&&this.style.fog&&this.style.fog.hasTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0);let x=!1;if(this.style&&this._sourcesDirty?(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),x=this._updateAverageElevation(f),this.style._updateSources(this.transform),this._forceMarkerAndPopupUpdate()):x=this._updateAverageElevation(f),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,_,this._crossSourceCollisions),this.style&&this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showTerrainWireframe:this.showTerrainWireframe,showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,showTileAABBs:this.showTileAABBs,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:_,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),gpuTimingDeferredRender:!!this.listens("gpu-timing-deferred-render"),speedIndexTiming:this.speedIndexTiming}),this.fire(new s.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new s.Event("load"))),this.style&&this.style.hasTransitions()&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),o){const S=s.exported.now()-f;c.endQueryEXT(c.TIME_ELAPSED_EXT,o),setTimeout(()=>{const C=c.getQueryObjectEXT(o,c.QUERY_RESULT_EXT)/1e6;c.deleteQueryEXT(o),this.fire(new s.Event("gpu-timing-frame",{cpuTime:S,gpuTime:C})),s.window.performance.mark("frame-gpu",{startTime:f,detail:{gpuTime:C}})},50)}if(this.listens("gpu-timing-layer")){const S=this.painter.collectGpuTimers();setTimeout(()=>{const C=this.painter.queryGpuTimers(S);this.fire(new s.Event("gpu-timing-layer",{layerTimes:C}))},50)}if(this.listens("gpu-timing-deferred-render")){const S=this.painter.collectDeferredRenderGpuQueries();setTimeout(()=>{const C=this.painter.queryGpuTimeDeferredRender(S);this.fire(new s.Event("gpu-timing-deferred-render",{gpuTime:C}))},50)}const T=this._sourcesDirty||this._styleDirty||this._placementDirty||x;if(T||this._repaint)this.triggerRepaint();else{const S=!this.isMoving()&&this.loaded();if(S&&(x=this._updateAverageElevation(f,!0)),x)this.triggerRepaint();else if(this._triggerFrame(!1),S&&(this.fire(new s.Event("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){const C=this._calculateSpeedIndex();this.fire(new s.Event("speedindexcompleted",{speedIndex:C})),this.speedIndexTiming=!1}}!this._loaded||this._fullyLoaded||T||(this._fullyLoaded=!0,s.LivePerformanceUtils.mark(s.PerformanceMarkers.fullLoad),this._performanceMetricsCollection&&s.postPerformanceEvent(this._requestManager._customAccessToken,{width:this.painter.width,height:this.painter.height,interactionRange:this._interactionRange,visibilityHidden:this._visibilityHidden,terrainEnabled:!!this.painter.style.getTerrain(),fogEnabled:!!this.painter.style.getFog(),projection:this.getProjection().name,zoom:this.transform.zoom,renderer:this.painter.context.renderer,vendor:this.painter.context.vendor}),this._authenticate())}_forceMarkerAndPopupUpdate(d){for(const o of this._markers)d&&!this.getRenderWorldCopies()&&(o._lngLat=o._lngLat.wrap()),o._update();for(const o of this._popups)!d||this.getRenderWorldCopies()||o._trackPointer||(o._lngLat=o._lngLat.wrap()),o._update()}_updateAverageElevation(d,o=!1){const c=f=>(this.transform.averageElevation=f,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return this.transform.averageElevation!==0&&c(0);if((o||d-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(d)){const f=this.transform.averageElevation;let _=this.transform.sampleAverageElevation(),x=!1;this.transform.elevation&&(x=this.transform.elevation.exaggeration()!==this._averageElevationExaggeration,this._averageElevationExaggeration=this.transform.elevation.exaggeration()),isNaN(_)?_=0:this._averageElevationLastSampledAt=d;const T=Math.abs(f-_);if(T>1){if(this._isInitialLoad||x)return this._averageElevation.jumpTo(_),c(_);this._averageElevation.easeTo(_,d,300)}else if(T>1e-4)return this._averageElevation.jumpTo(_),c(_)}return!!this._averageElevation.isEasing(d)&&c(this._averageElevation.getValue(d))}_authenticate(){s.getMapSessionAPI(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,d=>{if(d&&(d.message===s.AUTH_ERR_MSG||d.status===401)){const o=this.painter.context.gl;s.storeAuthState(o,!1),this._logoControl instanceof cd&&this._logoControl._updateLogo(),o&&o.clear(o.DEPTH_BUFFER_BIT|o.COLOR_BUFFER_BIT|o.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new s.ErrorEvent(new Error("A valid Mapbox access token is required to use Mapbox GL JS. To create an account or a new access token, visit https://account.mapbox.com/")))}}),s.postMapLoadEvent(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,()=>{})}_updateTerrain(){const d=this._isDragging();this.painter.updateTerrain(this.style,d)}_calculateSpeedIndex(){const d=this.painter.canvasCopy(),o=this.painter.getCanvasCopiesAndTimestamps();o.timeStamps.push(performance.now());const c=this.painter.context.gl,f=c.createFramebuffer();function _(x){c.framebufferTexture2D(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,c.TEXTURE_2D,x,0);const T=new Uint8Array(c.drawingBufferWidth*c.drawingBufferHeight*4);return c.readPixels(0,0,c.drawingBufferWidth,c.drawingBufferHeight,c.RGBA,c.UNSIGNED_BYTE,T),T}return c.bindFramebuffer(c.FRAMEBUFFER,f),this._canvasPixelComparison(_(d),o.canvasCopies.map(_),o.timeStamps)}_canvasPixelComparison(d,o,c){let f=c[1]-c[0];const _=d.length/4;for(let x=0;x{const c=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,c&&this._render(o)}))}_preloadTiles(d){const o=this.style?Object.values(this.style._sourceCaches):[];return s.asyncAll(o,(c,f)=>c._preloadTiles(d,f),()=>{this.triggerRepaint()}),this}_onWindowOnline(){this._update()}_onWindowResize(d){this._trackResize&&this.resize({originalEvent:d})._update()}_onVisibilityChange(){s.window.document.visibilityState==="hidden"&&this._visibilityHidden++}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(d){this._showTileBoundaries!==d&&(this._showTileBoundaries=d,this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(d){this._showTerrainWireframe!==d&&(this._showTerrainWireframe=d,this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(d){this._speedIndexTiming!==d&&(this._speedIndexTiming=d,this._update())}get showPadding(){return!!this._showPadding}set showPadding(d){this._showPadding!==d&&(this._showPadding=d,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(d){this._showCollisionBoxes!==d&&(this._showCollisionBoxes=d,d?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(d){this._showOverdrawInspector!==d&&(this._showOverdrawInspector=d,this._update())}get repaint(){return!!this._repaint}set repaint(d){this._repaint!==d&&(this._repaint=d,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(d){this._vertices=d,this._update()}get showTileAABBs(){return!!this._showTileAABBs}set showTileAABBs(d){this._showTileAABBs!==d&&(this._showTileAABBs=d,d&&this._update())}_setCacheLimits(d,o){s.setCacheLimits(d,o)}get version(){return s.version}},NavigationControl:class{constructor(d){this.options=s.extend({},hy,d),this._container=J("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",o=>o.preventDefault()),this.options.showZoom&&(s.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",o=>{this._map&&this._map.zoomIn({},{originalEvent:o})}),J("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",o=>{this._map&&this._map.zoomOut({},{originalEvent:o})}),J("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(s.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",o=>{const c=this._map;c&&(this.options.visualizePitch?c.resetNorthPitch({},{originalEvent:o}):c.resetNorth({},{originalEvent:o}))}),this._compassIcon=J("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const d=this._map;if(!d)return;const o=d.getZoom(),c=o===d.getMaxZoom(),f=o===d.getMinZoom();this._zoomInButton.disabled=c,this._zoomOutButton.disabled=f,this._zoomInButton.setAttribute("aria-disabled",c.toString()),this._zoomOutButton.setAttribute("aria-disabled",f.toString())}_rotateCompassArrow(){const d=this._map;if(!d)return;const o=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(d.transform.pitch*(Math.PI/180)),.5)}) rotateX(${d.transform.pitch}deg) rotateZ(${d.transform.angle*(180/Math.PI)}deg)`:`rotate(${d.transform.angle*(180/Math.PI)}deg)`;d._requestDomTask(()=>{this._compassIcon&&(this._compassIcon.style.transform=o)})}onAdd(d){return this._map=d,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),d.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&d.on("pitch",this._rotateCompassArrow),d.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new dy(d,this._compass,this.options.visualizePitch)),this._container}onRemove(){const d=this._map;d&&(this._container.remove(),this.options.showZoom&&d.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&d.off("pitch",this._rotateCompassArrow),d.off("rotate",this._rotateCompassArrow),this._handler&&this._handler.off(),this._handler=void 0),this._map=void 0)}_createButton(d,o){const c=J("button",d,this._container);return c.type="button",c.addEventListener("click",o),c}_setButtonTitle(d,o){if(!this._map)return;const c=this._map._getUIString(`NavigationControl.${o}`);d.setAttribute("aria-label",c),d.firstElementChild&&d.firstElementChild.setAttribute("title",c)}},GeolocateControl:class extends s.Evented{constructor(d){super(),this.options=s.extend({geolocation:s.window.navigator.geolocation},pd,d),s.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation","_onDeviceOrientation"],this),this._updateMarkerRotationThrottled=Sa(this._updateMarkerRotation,20),this._numberOfWatches=0}onAdd(d){return this._map=d,this._container=J("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkGeolocationSupport(this._setupUI),this._container}onRemove(){this._geolocationWatchID!==void 0&&(this.options.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("zoom",this._onZoom),this._map=void 0,this._numberOfWatches=0,this._noTimeout=!1}_checkGeolocationSupport(d){const o=(c=!!this.options.geolocation)=>{this._supportsGeolocation=c,d(c)};this._supportsGeolocation!==void 0?d(this._supportsGeolocation):s.window.navigator.permissions!==void 0?s.window.navigator.permissions.query({name:"geolocation"}).then(c=>o(c.state!=="denied")).catch(()=>o()):o()}_isOutOfMapMaxBounds(d){const o=this._map.getMaxBounds(),c=d.coords;return!!o&&(c.longitudeo.getEast()||c.latitudeo.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}}_onSuccess(d){if(this._map){if(this._isOutOfMapMaxBounds(d))return this._setErrorState(),this.fire(new s.Event("outofmaxbounds",d)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=d,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(d),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(d),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new s.Event("geolocate",d)),this._finish()}}_updateCamera(d){const o=new s.LngLat(d.coords.longitude,d.coords.latitude),c=d.coords.accuracy,f=this._map.getBearing(),_=s.extend({bearing:f},this.options.fitBoundsOptions);this._map.fitBounds(o.toBounds(c),_,{geolocateSource:!0})}_updateMarker(d){if(d){const o=new s.LngLat(d.coords.longitude,d.coords.latitude);this._accuracyCircleMarker.setLngLat(o).addTo(this._map),this._userLocationDotMarker.setLngLat(o).addTo(this._map),this._accuracy=d.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const d=this._map.transform,o=s.mercatorZfromAltitude(1,d._center.lat)*d.worldSize,c=Math.ceil(2*this._accuracy*o);this._circleElement.style.width=`${c}px`,this._circleElement.style.height=`${c}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_updateMarkerRotation(){this._userLocationDotMarker&&typeof this._heading=="number"?(this._userLocationDotMarker.setRotation(this._heading),this._dotElement.classList.add("mapboxgl-user-location-show-heading")):(this._dotElement.classList.remove("mapboxgl-user-location-show-heading"),this._userLocationDotMarker.setRotation(0))}_onError(d){if(this._map){if(this.options.trackUserLocation)if(d.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const o=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.setAttribute("aria-label",o),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",o),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(d.code===3&&this._noTimeout)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new s.Event("error",d)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(d){if(this._map!==void 0){if(this._container.addEventListener("contextmenu",o=>o.preventDefault()),this._geolocateButton=J("button","mapboxgl-ctrl-geolocate",this._container),J("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",d===!1){s.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");const o=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.setAttribute("aria-label",o),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",o)}else{const o=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.setAttribute("aria-label",o),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",o)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=J("div","mapboxgl-user-location"),this._dotElement.appendChild(J("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(J("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new at({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=J("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new at({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",o=>{o.geolocateSource||this._watchState!=="ACTIVE_LOCK"||o.originalEvent&&o.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this.fire(new s.Event("trackuserlocationend")))})}}_onDeviceOrientation(d){this._userLocationDotMarker&&(d.webkitCompassHeading?this._heading=d.webkitCompassHeading:d.absolute===!0&&(this._heading=-1*d.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return s.warnOnce("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 s.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._numberOfWatches--,this._noTimeout=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new s.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new s.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let d;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._numberOfWatches++,this._numberOfWatches>1?(d={maximumAge:6e5,timeout:0},this._noTimeout=!0):(d=this.options.positionOptions,this._noTimeout=!1),this._geolocationWatchID=this.options.geolocation.watchPosition(this._onSuccess,this._onError,d),this.options.showUserHeading&&this._addDeviceOrientationListener()}}else this.options.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_addDeviceOrientationListener(){const d=()=>{s.window.addEventListener("ondeviceorientationabsolute"in s.window?"deviceorientationabsolute":"deviceorientation",this._onDeviceOrientation)};s.window.DeviceMotionEvent!==void 0&&typeof s.window.DeviceMotionEvent.requestPermission=="function"?DeviceOrientationEvent.requestPermission().then(o=>{o==="granted"&&d()}).catch(console.error):d()}_clearWatch(){this.options.geolocation.clearWatch(this._geolocationWatchID),s.window.removeEventListener("deviceorientation",this._onDeviceOrientation),s.window.removeEventListener("deviceorientationabsolute",this._onDeviceOrientation),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:dt,ScaleControl:class{constructor(d){this.options=s.extend({},fd,d),this._isNumberFormatSupported=function(){try{return new Intl.NumberFormat("en",{style:"unit",unitDisplay:"short",unit:"meter"}),!0}catch{return!1}}(),s.bindAll(["_update","_setScale","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_update(){const d=this.options.maxWidth||100,o=this._map,c=o._containerHeight/2,f=o._containerWidth/2-d/2,_=o.unproject([f,c]),x=o.unproject([f+d,c]),T=_.distanceTo(x);if(this.options.unit==="imperial"){const S=3.2808*T;S>5280?this._setScale(d,S/5280,"mile"):this._setScale(d,S,"foot")}else this.options.unit==="nautical"?this._setScale(d,T/1852,"nautical-mile"):T>=1e3?this._setScale(d,T/1e3,"kilometer"):this._setScale(d,T,"meter")}_setScale(d,o,c){this._map._requestDomTask(()=>{const f=function(x){const T=Math.pow(10,`${Math.floor(x)}`.length-1);let S=x/T;return S=S>=10?10:S>=5?5:S>=3?3:S>=2?2:S>=1?1:function(C){const z=Math.pow(10,Math.ceil(-Math.log(C)/Math.LN10));return Math.round(C*z)/z}(S),T*S}(o),_=f/o;this._container.innerHTML=this._isNumberFormatSupported&&c!=="nautical-mile"?new Intl.NumberFormat(this._language,{style:"unit",unitDisplay:"short",unit:c}).format(f):`${f} ${md[c]}`,this._container.style.width=d*_+"px"})}onAdd(d){return this._map=d,this._language=d.getLanguage(),this._container=J("div","mapboxgl-ctrl mapboxgl-ctrl-scale",d.getContainer()),this._container.dir="auto",this._map.on("move",this._update),this._update(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._update),this._map=void 0}_setLanguage(d){this._language=d,this._update()}setUnit(d){this.options.unit=d,this._update()}},FullscreenControl:class{constructor(d){this._fullscreen=!1,d&&d.container&&(d.container instanceof s.window.HTMLElement?this._container=d.container:s.warnOnce("Full screen control 'container' must be a DOM element.")),s.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in s.window.document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in s.window.document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(d){return this._map=d,this._container||(this._container=this._map.getContainer()),this._controlContainer=J("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",s.warnOnce("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,s.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!s.window.document.fullscreenEnabled&&!s.window.document.webkitFullscreenEnabled)}_setupUI(){const d=this._fullscreenButton=J("button","mapboxgl-ctrl-fullscreen",this._controlContainer);J("span","mapboxgl-ctrl-icon",d).setAttribute("aria-hidden","true"),d.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),s.window.document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const d=this._getTitle();this._fullscreenButton.setAttribute("aria-label",d),this._fullscreenButton.firstElementChild&&this._fullscreenButton.firstElementChild.setAttribute("title",d)}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(s.window.document.fullscreenElement||s.window.document.webkitFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?s.window.document.exitFullscreen?s.window.document.exitFullscreen():s.window.document.webkitCancelFullScreen&&s.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},Popup:class extends s.Evented{constructor(d){super(),this.options=s.extend(Object.create(hd),d),s.bindAll(["_update","_onClose","remove","_onMouseEvent"],this),this._classList=new Set(d&&d.className?d.className.trim().split(/\s+/):[])}addTo(d){return this._map&&this.remove(),this._map=d,this.options.closeOnClick&&d.on("preclick",this._onClose),this.options.closeOnMove&&d.on("move",this._onClose),d.on("remove",this.remove),this._update(),d._addPopup(this),this._focusFirstElement(),this._trackPointer?(d.on("mousemove",this._onMouseEvent),d.on("mouseup",this._onMouseEvent),d._canvasContainer.classList.add("mapboxgl-track-pointer")):d.on("move",this._update),this.fire(new s.Event("open")),this}isOpen(){return!!this._map}remove(){this._content&&this._content.remove(),this._container&&(this._container.remove(),this._container=void 0);const d=this._map;return d&&(d.off("move",this._update),d.off("move",this._onClose),d.off("preclick",this._onClose),d.off("click",this._onClose),d.off("remove",this.remove),d.off("mousemove",this._onMouseEvent),d.off("mouseup",this._onMouseEvent),d.off("drag",this._onMouseEvent),d._canvasContainer&&d._canvasContainer.classList.remove("mapboxgl-track-pointer"),d._removePopup(this),this._map=void 0),this.fire(new s.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(d){this._lngLat=s.LngLat.convert(d),this._pos=null,this._trackPointer=!1,this._update();const o=this._map;return o&&(o.on("move",this._update),o.off("mousemove",this._onMouseEvent),o._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}trackPointer(){this._trackPointer=!0,this._pos=null,this._update();const d=this._map;return d&&(d.off("move",this._update),d.on("mousemove",this._onMouseEvent),d.on("drag",this._onMouseEvent),d._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(d){return this.setDOMContent(s.window.document.createTextNode(d))}setHTML(d){const o=s.window.document.createDocumentFragment(),c=s.window.document.createElement("body");let f;for(c.innerHTML=d;f=c.firstChild,f;)o.appendChild(f);return this.setDOMContent(o)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(d){return this.options.maxWidth=d,this._update(),this}setDOMContent(d){let o=this._content;if(o)for(;o.hasChildNodes();)o.firstChild&&o.removeChild(o.firstChild);else o=this._content=J("div","mapboxgl-popup-content",this._container||void 0);if(o.appendChild(d),this.options.closeButton){const c=this._closeButton=J("button","mapboxgl-popup-close-button",o);c.type="button",c.setAttribute("aria-label","Close popup"),c.setAttribute("aria-hidden","true"),c.innerHTML="×",c.addEventListener("click",this._onClose)}return this._update(),this._focusFirstElement(),this}addClassName(d){return this._classList.add(d),this._updateClassList(),this}removeClassName(d){return this._classList.delete(d),this._updateClassList(),this}setOffset(d){return this.options.offset=d,this._update(),this}toggleClassName(d){let o;return this._classList.delete(d)?o=!1:(this._classList.add(d),o=!0),this._updateClassList(),o}_onMouseEvent(d){this._update(d.point)}_getAnchor(d){if(this.options.anchor)return this.options.anchor;const o=this._map,c=this._container,f=this._pos;if(!o||!c||!f)return"bottom";const _=c.offsetWidth,x=c.offsetHeight,T=f.x<_/2,S=f.x>o.transform.width-_/2;if(f.y+do.transform.height-x){if(T)return"bottom-left";if(S)return"bottom-right"}return T?"left":S?"right":"bottom"}_updateClassList(){const d=this._container;if(!d)return;const o=[...this._classList];o.push("mapboxgl-popup"),this._anchor&&o.push(`mapboxgl-popup-anchor-${this._anchor}`),this._trackPointer&&o.push("mapboxgl-popup-track-pointer"),d.className=o.join(" ")}_update(d){const o=this._map,c=this._content;if(!o||!this._lngLat&&!this._trackPointer||!c)return;let f=this._container;if(f||(f=this._container=J("div","mapboxgl-popup",o.getContainer()),this._tip=J("div","mapboxgl-popup-tip",f),f.appendChild(c)),this.options.maxWidth&&f.style.maxWidth!==this.options.maxWidth&&(f.style.maxWidth=this.options.maxWidth),o.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Ia(this._lngLat,this._pos,o.transform)),!this._trackPointer||d){const _=this._pos=this._trackPointer&&d?d:o.project(this._lngLat),x=Wf(this.options.offset),T=this._anchor=this._getAnchor(x.y),S=Wf(this.options.offset,T),C=_.add(S).round();o._requestDomTask(()=>{this._container&&T&&(this._container.style.transform=`${Os[T]} translate(${C.x}px,${C.y}px)`)})}if(!this._marker&&o._showingGlobe()){const _=s.isLngLatBehindGlobe(o.transform,this._lngLat)?0:1;this._setOpacity(_)}this._updateClassList()}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const d=this._container.querySelector(uy);d&&d.focus()}_onClose(){this.remove()}_setOpacity(d){this._container&&(this._container.style.opacity=`${d}`),this._content&&(this._content.style.pointerEvents=d?"auto":"none")}},Marker:at,Style:to,LngLat:s.LngLat,LngLatBounds:s.LngLatBounds,Point:s.Point,MercatorCoordinate:s.MercatorCoordinate,FreeCameraOptions:Pf,Evented:s.Evented,config:s.config,prewarm:function(){ha().acquire(Ji)},clearPrewarmedResources:function(){const d=Or;d&&(d.isPreloaded()&&d.numActive()===1?(d.release(Ji),Or=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()"))},get accessToken(){return s.config.ACCESS_TOKEN},set accessToken(d){s.config.ACCESS_TOKEN=d},get baseApiUrl(){return s.config.API_URL},set baseApiUrl(d){s.config.API_URL=d},get workerCount(){return hr.workerCount},set workerCount(d){hr.workerCount=d},get maxParallelImageRequests(){return s.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(d){s.config.MAX_PARALLEL_IMAGE_REQUESTS=d},clearStorage(d){s.clearTileCache(d)},workerUrl:"",workerClass:null,setNow:s.exported.setNow,restoreNow:s.exported.restoreNow};return ka});var E=m;return E})})(rk);var Vx=rk.exports;const TU=g1(Vx),SU=LP({__proto__:null,default:TU},[Vx]);const lv="pk.eyJ1IjoicnVyYWxpbm5vIiwiYSI6ImNqeHl0cW0xODBlMm0zY2x0dXltYzRuazUifQ.zZBovoCHzLIW0wCZveEKzA",HT="/examples/who-wins-b2s/rural_places_5000_plus.json",AU=wU({typography:{fontFamily:"Montserrat"},palette:{primary:{main:"#00835D",light:"#A3E2B5",dark:"#26535C",contrastText:"white"}}});function CU(){var m;const e=ut.useContext(QC),n=ut.useRef(null),l=ut.useMemo(()=>new Vx.Popup().setText("Hello world!"),[]);ut.useCallback(()=>{var v;(v=n.current)==null||v.togglePopup()},[]);let h=!1;return ut.useEffect(()=>{if(e&&!e.data.hasOwnProperty("placeData")&&!h){console.log("Initial place data fetch..."),console.log(HT),h=!0;const v=window.document.getElementById("info-wrapper");v!==null&&(v.style.opacity="1.0",v.style.position="absolute",v.style.background=`rgba(46, 60, 67, 0.5) url('${e.baseURL}/images/loading.gif') no-repeat fixed center`,v.style.backgroundSize="20px"),e.setData({...(e==null?void 0:e.data)||{},placeData:null}),e==null||e.apiClient.get(HT).then(E=>{E&&E.hasOwnProperty("data")&&(console.log("Data result:",E.data.features),e.setData({...e.data,placeData:E.data.features}),h=!1,v!==null&&(v.style.opacity="0.0",v.style.pointerEvents="none",setTimeout(()=>{v.style.background="transparent"},533)))}).catch(E=>{console.error("Error fetching data:",E),h=!1,v!==null&&(v.style.opacity="0.0",v.style.pointerEvents="none",setTimeout(()=>{v.style.background="transparent"},533))})}},[e==null?void 0:e.data]),ut.createElement(EU,{theme:AU},ut.createElement("div",{className:"slippy-map"},ut.createElement(QO,{mapboxAccessToken:lv,initialViewState:{latitude:40,longitude:-100,pitch:45,zoom:3.5},style:{width:600,height:400},mapStyle:`https://api.mapbox.com/styles/v1/ruralinno/cl010e7b7001p15pe3l0306hv?access_token=${lv}`},!!(e!=null&&e.data)&&!!((m=e==null?void 0:e.data)!=null&&m.placeData)&&e.data.placeData.length>0&&!!n&&typeof n!==void 0&&ut.createElement(eI,{longitude:-122.4,latitude:37.8,color:"red",popup:l,ref:n}),ut.createElement(uF,{mapboxAccessToken:lv,position:"top-right"}),ut.createElement(t4,{position:"top-right"}),ut.createElement(e4,{position:"top-right"}),ut.createElement(n4,{position:"bottom-left",unit:"imperial"}))),ut.createElement("div",{id:"info-wrapper",style:{pointerEvents:"none",position:"absolute",top:0,minWidth:"100vw",minHeight:"100vh",transition:"opacity 5.05s ease-in-out 0.025s",opacity:"initial",background:"transparent",backgroundSize:"20px",zIndex:100}}))}const IU="https://cori-risi-apps.s3.amazonaws.com";function kU(e){sC(e).render(ut.createElement(ut.StrictMode,null,ut.createElement(bO,{baseURL:IU},ut.createElement(CU,null))))}kU(document.getElementById("app")); diff --git a/docs/assets/index-27cfc78e.js b/docs/assets/index-27cfc78e.js deleted file mode 100644 index d5a4954..0000000 --- a/docs/assets/index-27cfc78e.js +++ /dev/null @@ -1,32 +0,0 @@ -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(l){if(l.ep)return;l.ep=!0;const o=n(l);fetch(l.href,o)}})();var rs={exports:{}},T={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Gn=Symbol.for("react.element"),hc=Symbol.for("react.portal"),vc=Symbol.for("react.fragment"),yc=Symbol.for("react.strict_mode"),gc=Symbol.for("react.profiler"),wc=Symbol.for("react.provider"),Sc=Symbol.for("react.context"),kc=Symbol.for("react.forward_ref"),Ec=Symbol.for("react.suspense"),_c=Symbol.for("react.memo"),Cc=Symbol.for("react.lazy"),Ui=Symbol.iterator;function xc(e){return e===null||typeof e!="object"?null:(e=Ui&&e[Ui]||e["@@iterator"],typeof e=="function"?e:null)}var ls={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},os=Object.assign,is={};function un(e,t,n){this.props=e,this.context=t,this.refs=is,this.updater=n||ls}un.prototype.isReactComponent={};un.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};un.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function us(){}us.prototype=un.prototype;function Bo(e,t,n){this.props=e,this.context=t,this.refs=is,this.updater=n||ls}var Ho=Bo.prototype=new us;Ho.constructor=Bo;os(Ho,un.prototype);Ho.isPureReactComponent=!0;var Ai=Array.isArray,ss=Object.prototype.hasOwnProperty,Wo={current:null},as={key:!0,ref:!0,__self:!0,__source:!0};function cs(e,t,n){var r,l={},o=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(o=""+t.key),t)ss.call(t,r)&&!as.hasOwnProperty(r)&&(l[r]=t[r]);var u=arguments.length-2;if(u===1)l.children=n;else if(1>>1,X=_[W];if(0>>1;Wl(kl,L))ytl(rr,kl)?(_[W]=rr,_[yt]=L,W=yt):(_[W]=kl,_[vt]=L,W=vt);else if(ytl(rr,L))_[W]=rr,_[yt]=L,W=yt;else break e}}return N}function l(_,N){var L=_.sortIndex-N.sortIndex;return L!==0?L:_.id-N.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,u=i.now();e.unstable_now=function(){return i.now()-u}}var s=[],a=[],p=1,h=null,m=3,g=!1,w=!1,k=!1,D=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,c=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function d(_){for(var N=n(a);N!==null;){if(N.callback===null)r(a);else if(N.startTime<=_)r(a),N.sortIndex=N.expirationTime,t(s,N);else break;N=n(a)}}function v(_){if(k=!1,d(_),!w)if(n(s)!==null)w=!0,wl(S);else{var N=n(a);N!==null&&Sl(v,N.startTime-_)}}function S(_,N){w=!1,k&&(k=!1,f(z),z=-1),g=!0;var L=m;try{for(d(N),h=n(s);h!==null&&(!(h.expirationTime>N)||_&&!Pe());){var W=h.callback;if(typeof W=="function"){h.callback=null,m=h.priorityLevel;var X=W(h.expirationTime<=N);N=e.unstable_now(),typeof X=="function"?h.callback=X:h===n(s)&&r(s),d(N)}else r(s);h=n(s)}if(h!==null)var nr=!0;else{var vt=n(a);vt!==null&&Sl(v,vt.startTime-N),nr=!1}return nr}finally{h=null,m=L,g=!1}}var x=!1,P=null,z=-1,H=5,R=-1;function Pe(){return!(e.unstable_now()-R_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):H=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return n(s)},e.unstable_next=function(_){switch(m){case 1:case 2:case 3:var N=3;break;default:N=m}var L=m;m=N;try{return _()}finally{m=L}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(_,N){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var L=m;m=_;try{return N()}finally{m=L}},e.unstable_scheduleCallback=function(_,N,L){var W=e.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0W?(_.sortIndex=L,t(a,_),n(s)===null&&_===n(a)&&(k?(f(z),z=-1):k=!0,Sl(v,L-W))):(_.sortIndex=X,t(s,_),w||g||(w=!0,wl(S))),_},e.unstable_shouldYield=Pe,e.unstable_wrapCallback=function(_){var N=m;return function(){var L=m;m=N;try{return _.apply(this,arguments)}finally{m=L}}}})(ms);ps.exports=ms;var Tc=ps.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Rc=C,ye=Tc;function y(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Xl=Object.prototype.hasOwnProperty,Mc=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Vi={},Bi={};function Oc(e){return Xl.call(Bi,e)?!0:Xl.call(Vi,e)?!1:Mc.test(e)?Bi[e]=!0:(Vi[e]=!0,!1)}function Dc(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Fc(e,t,n,r){if(t===null||typeof t>"u"||Dc(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function se(e,t,n,r,l,o,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=i}var ee={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ee[e]=new se(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ee[t]=new se(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ee[e]=new se(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ee[e]=new se(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ee[e]=new se(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ee[e]=new se(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ee[e]=new se(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ee[e]=new se(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ee[e]=new se(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ko=/[\-:]([a-z])/g;function Yo(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Ko,Yo);ee[t]=new se(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Ko,Yo);ee[t]=new se(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Ko,Yo);ee[t]=new se(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ee[e]=new se(e,1,!1,e.toLowerCase(),null,!1,!1)});ee.xlinkHref=new se("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ee[e]=new se(e,1,!1,e.toLowerCase(),null,!0,!0)});function Zo(e,t,n,r){var l=ee.hasOwnProperty(t)?ee[t]:null;(l!==null?l.type!==0:r||!(2u||l[i]!==o[u]){var s=` -`+l[i].replace(" at new "," at ");return e.displayName&&s.includes("")&&(s=s.replace("",e.displayName)),s}while(1<=i&&0<=u);break}}}finally{Cl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Sn(e):""}function Ic(e){switch(e.tag){case 5:return Sn(e.type);case 16:return Sn("Lazy");case 13:return Sn("Suspense");case 19:return Sn("SuspenseList");case 0:case 2:case 15:return e=xl(e.type,!1),e;case 11:return e=xl(e.type.render,!1),e;case 1:return e=xl(e.type,!0),e;default:return""}}function bl(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ft:return"Fragment";case Dt:return"Portal";case Gl:return"Profiler";case Xo:return"StrictMode";case Jl:return"Suspense";case ql:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ys:return(e.displayName||"Context")+".Consumer";case vs:return(e._context.displayName||"Context")+".Provider";case Go:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Jo:return t=e.displayName||null,t!==null?t:bl(e.type)||"Memo";case Je:t=e._payload,e=e._init;try{return bl(e(t))}catch{}}return null}function jc(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return bl(t);case 8:return t===Xo?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ft(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ws(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Uc(e){var t=ws(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(i){r=""+i,o.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ir(e){e._valueTracker||(e._valueTracker=Uc(e))}function Ss(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ws(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Or(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function eo(e,t){var n=t.checked;return V({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Wi(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ft(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function ks(e,t){t=t.checked,t!=null&&Zo(e,"checked",t,!1)}function to(e,t){ks(e,t);var n=ft(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?no(e,t.type,n):t.hasOwnProperty("defaultValue")&&no(e,t.type,ft(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Qi(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function no(e,t,n){(t!=="number"||Or(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var kn=Array.isArray;function Kt(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=ur.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Dn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Cn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ac=["Webkit","ms","Moz","O"];Object.keys(Cn).forEach(function(e){Ac.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Cn[t]=Cn[e]})});function xs(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Cn.hasOwnProperty(e)&&Cn[e]?(""+t).trim():t+"px"}function Ps(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=xs(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var $c=V({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function oo(e,t){if(t){if($c[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(y(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(y(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(y(61))}if(t.style!=null&&typeof t.style!="object")throw Error(y(62))}}function io(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var uo=null;function qo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var so=null,Yt=null,Zt=null;function Zi(e){if(e=bn(e)){if(typeof so!="function")throw Error(y(280));var t=e.stateNode;t&&(t=ul(t),so(e.stateNode,e.type,t))}}function zs(e){Yt?Zt?Zt.push(e):Zt=[e]:Yt=e}function Ns(){if(Yt){var e=Yt,t=Zt;if(Zt=Yt=null,Zi(e),t)for(e=0;e>>=0,e===0?32:31-(Jc(e)/qc|0)|0}var sr=64,ar=4194304;function En(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function jr(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,o=e.pingedLanes,i=n&268435455;if(i!==0){var u=i&~l;u!==0?r=En(u):(o&=i,o!==0&&(r=En(o)))}else i=n&~l,i!==0?r=En(i):o!==0&&(r=En(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,o=t&-t,l>=o||l===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Jn(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Re(t),e[t]=n}function nf(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Pn),ru=String.fromCharCode(32),lu=!1;function Zs(e,t){switch(e){case"keyup":return Rf.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xs(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var It=!1;function Of(e,t){switch(e){case"compositionend":return Xs(t);case"keypress":return t.which!==32?null:(lu=!0,ru);case"textInput":return e=t.data,e===ru&&lu?null:e;default:return null}}function Df(e,t){if(It)return e==="compositionend"||!ii&&Zs(e,t)?(e=Ks(),Cr=ri=tt=null,It=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=su(n)}}function bs(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?bs(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ea(){for(var e=window,t=Or();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Or(e.document)}return t}function ui(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Hf(e){var t=ea(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&bs(n.ownerDocument.documentElement,n)){if(r!==null&&ui(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,o=Math.min(r.start,l);r=r.end===void 0?o:Math.min(r.end,l),!e.extend&&o>r&&(l=r,r=o,o=l),l=au(n,o);var i=au(n,r);l&&i&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,jt=null,ho=null,Nn=null,vo=!1;function cu(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;vo||jt==null||jt!==Or(r)||(r=jt,"selectionStart"in r&&ui(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Nn&&$n(Nn,r)||(Nn=r,r=$r(ho,"onSelect"),0$t||(e.current=Eo[$t],Eo[$t]=null,$t--)}function F(e,t){$t++,Eo[$t]=e.current,e.current=t}var dt={},le=mt(dt),fe=mt(!1),xt=dt;function bt(e,t){var n=e.type.contextTypes;if(!n)return dt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},o;for(o in n)l[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function de(e){return e=e.childContextTypes,e!=null}function Br(){j(fe),j(le)}function yu(e,t,n){if(le.current!==dt)throw Error(y(168));F(le,t),F(fe,n)}function aa(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(y(108,jc(e)||"Unknown",l));return V({},n,r)}function Hr(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||dt,xt=le.current,F(le,e),F(fe,fe.current),!0}function gu(e,t,n){var r=e.stateNode;if(!r)throw Error(y(169));n?(e=aa(e,t,xt),r.__reactInternalMemoizedMergedChildContext=e,j(fe),j(le),F(le,e)):j(fe),F(fe,n)}var $e=null,sl=!1,Al=!1;function ca(e){$e===null?$e=[e]:$e.push(e)}function td(e){sl=!0,ca(e)}function ht(){if(!Al&&$e!==null){Al=!0;var e=0,t=O;try{var n=$e;for(O=1;e>=i,l-=i,Be=1<<32-Re(t)+l|n<z?(H=P,P=null):H=P.sibling;var R=m(f,P,d[z],v);if(R===null){P===null&&(P=H);break}e&&P&&R.alternate===null&&t(f,P),c=o(R,c,z),x===null?S=R:x.sibling=R,x=R,P=H}if(z===d.length)return n(f,P),U&>(f,z),S;if(P===null){for(;zz?(H=P,P=null):H=P.sibling;var Pe=m(f,P,R.value,v);if(Pe===null){P===null&&(P=H);break}e&&P&&Pe.alternate===null&&t(f,P),c=o(Pe,c,z),x===null?S=Pe:x.sibling=Pe,x=Pe,P=H}if(R.done)return n(f,P),U&>(f,z),S;if(P===null){for(;!R.done;z++,R=d.next())R=h(f,R.value,v),R!==null&&(c=o(R,c,z),x===null?S=R:x.sibling=R,x=R);return U&>(f,z),S}for(P=r(f,P);!R.done;z++,R=d.next())R=g(P,f,z,R.value,v),R!==null&&(e&&R.alternate!==null&&P.delete(R.key===null?z:R.key),c=o(R,c,z),x===null?S=R:x.sibling=R,x=R);return e&&P.forEach(function(cn){return t(f,cn)}),U&>(f,z),S}function D(f,c,d,v){if(typeof d=="object"&&d!==null&&d.type===Ft&&d.key===null&&(d=d.props.children),typeof d=="object"&&d!==null){switch(d.$$typeof){case or:e:{for(var S=d.key,x=c;x!==null;){if(x.key===S){if(S=d.type,S===Ft){if(x.tag===7){n(f,x.sibling),c=l(x,d.props.children),c.return=f,f=c;break e}}else if(x.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Je&&ku(S)===x.type){n(f,x.sibling),c=l(x,d.props),c.ref=yn(f,x,d),c.return=f,f=c;break e}n(f,x);break}else t(f,x);x=x.sibling}d.type===Ft?(c=Ct(d.props.children,f.mode,v,d.key),c.return=f,f=c):(v=Mr(d.type,d.key,d.props,null,f.mode,v),v.ref=yn(f,c,d),v.return=f,f=v)}return i(f);case Dt:e:{for(x=d.key;c!==null;){if(c.key===x)if(c.tag===4&&c.stateNode.containerInfo===d.containerInfo&&c.stateNode.implementation===d.implementation){n(f,c.sibling),c=l(c,d.children||[]),c.return=f,f=c;break e}else{n(f,c);break}else t(f,c);c=c.sibling}c=Yl(d,f.mode,v),c.return=f,f=c}return i(f);case Je:return x=d._init,D(f,c,x(d._payload),v)}if(kn(d))return w(f,c,d,v);if(dn(d))return k(f,c,d,v);vr(f,d)}return typeof d=="string"&&d!==""||typeof d=="number"?(d=""+d,c!==null&&c.tag===6?(n(f,c.sibling),c=l(c,d),c.return=f,f=c):(n(f,c),c=Kl(d,f.mode,v),c.return=f,f=c),i(f)):n(f,c)}return D}var tn=ma(!0),ha=ma(!1),Kr=mt(null),Yr=null,Ht=null,fi=null;function di(){fi=Ht=Yr=null}function pi(e){var t=Kr.current;j(Kr),e._currentValue=t}function xo(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Gt(e,t){Yr=e,fi=Ht=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ce=!0),e.firstContext=null)}function Ce(e){var t=e._currentValue;if(fi!==e)if(e={context:e,memoizedValue:t,next:null},Ht===null){if(Yr===null)throw Error(y(308));Ht=e,Yr.dependencies={lanes:0,firstContext:e}}else Ht=Ht.next=e;return t}var kt=null;function mi(e){kt===null?kt=[e]:kt.push(e)}function va(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,mi(t)):(n.next=l.next,l.next=n),t.interleaved=n,Ye(e,r)}function Ye(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var qe=!1;function hi(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ya(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function We(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ut(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,M&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,Ye(e,n)}return l=r.interleaved,l===null?(t.next=t,mi(r)):(t.next=l.next,l.next=t),r.interleaved=t,Ye(e,n)}function Pr(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ei(e,n)}}function Eu(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?l=o=i:o=o.next=i,n=n.next}while(n!==null);o===null?l=o=t:o=o.next=t}else l=o=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Zr(e,t,n,r){var l=e.updateQueue;qe=!1;var o=l.firstBaseUpdate,i=l.lastBaseUpdate,u=l.shared.pending;if(u!==null){l.shared.pending=null;var s=u,a=s.next;s.next=null,i===null?o=a:i.next=a,i=s;var p=e.alternate;p!==null&&(p=p.updateQueue,u=p.lastBaseUpdate,u!==i&&(u===null?p.firstBaseUpdate=a:u.next=a,p.lastBaseUpdate=s))}if(o!==null){var h=l.baseState;i=0,p=a=s=null,u=o;do{var m=u.lane,g=u.eventTime;if((r&m)===m){p!==null&&(p=p.next={eventTime:g,lane:0,tag:u.tag,payload:u.payload,callback:u.callback,next:null});e:{var w=e,k=u;switch(m=t,g=n,k.tag){case 1:if(w=k.payload,typeof w=="function"){h=w.call(g,h,m);break e}h=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=k.payload,m=typeof w=="function"?w.call(g,h,m):w,m==null)break e;h=V({},h,m);break e;case 2:qe=!0}}u.callback!==null&&u.lane!==0&&(e.flags|=64,m=l.effects,m===null?l.effects=[u]:m.push(u))}else g={eventTime:g,lane:m,tag:u.tag,payload:u.payload,callback:u.callback,next:null},p===null?(a=p=g,s=h):p=p.next=g,i|=m;if(u=u.next,u===null){if(u=l.shared.pending,u===null)break;m=u,u=m.next,m.next=null,l.lastBaseUpdate=m,l.shared.pending=null}}while(1);if(p===null&&(s=h),l.baseState=s,l.firstBaseUpdate=a,l.lastBaseUpdate=p,t=l.shared.interleaved,t!==null){l=t;do i|=l.lane,l=l.next;while(l!==t)}else o===null&&(l.shared.lanes=0);Nt|=i,e.lanes=i,e.memoizedState=h}}function _u(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Vl.transition;Vl.transition={};try{e(!1),t()}finally{O=n,Vl.transition=r}}function Da(){return xe().memoizedState}function od(e,t,n){var r=at(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Fa(e))Ia(t,n);else if(n=va(e,t,n,r),n!==null){var l=ie();Me(n,e,r,l),ja(n,t,r)}}function id(e,t,n){var r=at(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Fa(e))Ia(t,l);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var i=t.lastRenderedState,u=o(i,n);if(l.hasEagerState=!0,l.eagerState=u,Oe(u,i)){var s=t.interleaved;s===null?(l.next=l,mi(t)):(l.next=s.next,s.next=l),t.interleaved=l;return}}catch{}finally{}n=va(e,t,l,r),n!==null&&(l=ie(),Me(n,e,r,l),ja(n,t,r))}}function Fa(e){var t=e.alternate;return e===$||t!==null&&t===$}function Ia(e,t){Ln=Gr=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ja(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ei(e,n)}}var Jr={readContext:Ce,useCallback:te,useContext:te,useEffect:te,useImperativeHandle:te,useInsertionEffect:te,useLayoutEffect:te,useMemo:te,useReducer:te,useRef:te,useState:te,useDebugValue:te,useDeferredValue:te,useTransition:te,useMutableSource:te,useSyncExternalStore:te,useId:te,unstable_isNewReconciler:!1},ud={readContext:Ce,useCallback:function(e,t){return Fe().memoizedState=[e,t===void 0?null:t],e},useContext:Ce,useEffect:xu,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Nr(4194308,4,La.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Nr(4194308,4,e,t)},useInsertionEffect:function(e,t){return Nr(4,2,e,t)},useMemo:function(e,t){var n=Fe();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Fe();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=od.bind(null,$,e),[r.memoizedState,e]},useRef:function(e){var t=Fe();return e={current:e},t.memoizedState=e},useState:Cu,useDebugValue:_i,useDeferredValue:function(e){return Fe().memoizedState=e},useTransition:function(){var e=Cu(!1),t=e[0];return e=ld.bind(null,e[1]),Fe().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=$,l=Fe();if(U){if(n===void 0)throw Error(y(407));n=n()}else{if(n=t(),J===null)throw Error(y(349));zt&30||ka(r,t,n)}l.memoizedState=n;var o={value:n,getSnapshot:t};return l.queue=o,xu(_a.bind(null,r,o,e),[e]),r.flags|=2048,Zn(9,Ea.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Fe(),t=J.identifierPrefix;if(U){var n=He,r=Be;n=(r&~(1<<32-Re(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Kn++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[Ie]=t,e[Hn]=r,Ya(e,t,!1,!1),t.stateNode=e;e:{switch(i=io(n,r),n){case"dialog":I("cancel",e),I("close",e),l=r;break;case"iframe":case"object":case"embed":I("load",e),l=r;break;case"video":case"audio":for(l=0;l<_n.length;l++)I(_n[l],e);l=r;break;case"source":I("error",e),l=r;break;case"img":case"image":case"link":I("error",e),I("load",e),l=r;break;case"details":I("toggle",e),l=r;break;case"input":Wi(e,r),l=eo(e,r),I("invalid",e);break;case"option":l=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},l=V({},r,{value:void 0}),I("invalid",e);break;case"textarea":Ki(e,r),l=ro(e,r),I("invalid",e);break;default:l=r}oo(n,l),u=l;for(o in u)if(u.hasOwnProperty(o)){var s=u[o];o==="style"?Ps(e,s):o==="dangerouslySetInnerHTML"?(s=s?s.__html:void 0,s!=null&&Cs(e,s)):o==="children"?typeof s=="string"?(n!=="textarea"||s!=="")&&Dn(e,s):typeof s=="number"&&Dn(e,""+s):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(On.hasOwnProperty(o)?s!=null&&o==="onScroll"&&I("scroll",e):s!=null&&Zo(e,o,s,i))}switch(n){case"input":ir(e),Qi(e,r,!1);break;case"textarea":ir(e),Yi(e);break;case"option":r.value!=null&&e.setAttribute("value",""+ft(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?Kt(e,!!r.multiple,o,!1):r.defaultValue!=null&&Kt(e,!!r.multiple,r.defaultValue,!0);break;default:typeof l.onClick=="function"&&(e.onclick=Vr)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return ne(t),null;case 6:if(e&&t.stateNode!=null)Xa(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(y(166));if(n=Et(Qn.current),Et(Ue.current),hr(t)){if(r=t.stateNode,n=t.memoizedProps,r[Ie]=t,(o=r.nodeValue!==n)&&(e=ve,e!==null))switch(e.tag){case 3:mr(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&mr(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Ie]=t,t.stateNode=r}return ne(t),null;case 13:if(j(A),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(U&&he!==null&&t.mode&1&&!(t.flags&128))pa(),en(),t.flags|=98560,o=!1;else if(o=hr(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(y(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(y(317));o[Ie]=t}else en(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ne(t),o=!1}else Te!==null&&(Vo(Te),Te=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||A.current&1?Z===0&&(Z=3):Ti())),t.updateQueue!==null&&(t.flags|=4),ne(t),null);case 4:return nn(),Oo(e,t),e===null&&Vn(t.stateNode.containerInfo),ne(t),null;case 10:return pi(t.type._context),ne(t),null;case 17:return de(t.type)&&Br(),ne(t),null;case 19:if(j(A),o=t.memoizedState,o===null)return ne(t),null;if(r=(t.flags&128)!==0,i=o.rendering,i===null)if(r)gn(o,!1);else{if(Z!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=Xr(e),i!==null){for(t.flags|=128,gn(o,!1),r=i.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,i=o.alternate,i===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=i.childLanes,o.lanes=i.lanes,o.child=i.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=i.memoizedProps,o.memoizedState=i.memoizedState,o.updateQueue=i.updateQueue,o.type=i.type,e=i.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return F(A,A.current&1|2),t.child}e=e.sibling}o.tail!==null&&Q()>ln&&(t.flags|=128,r=!0,gn(o,!1),t.lanes=4194304)}else{if(!r)if(e=Xr(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),gn(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!U)return ne(t),null}else 2*Q()-o.renderingStartTime>ln&&n!==1073741824&&(t.flags|=128,r=!0,gn(o,!1),t.lanes=4194304);o.isBackwards?(i.sibling=t.child,t.child=i):(n=o.last,n!==null?n.sibling=i:t.child=i,o.last=i)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Q(),t.sibling=null,n=A.current,F(A,r?n&1|2:n&1),t):(ne(t),null);case 22:case 23:return Li(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?me&1073741824&&(ne(t),t.subtreeFlags&6&&(t.flags|=8192)):ne(t),null;case 24:return null;case 25:return null}throw Error(y(156,t.tag))}function hd(e,t){switch(ai(t),t.tag){case 1:return de(t.type)&&Br(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return nn(),j(fe),j(le),gi(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return yi(t),null;case 13:if(j(A),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(y(340));en()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return j(A),null;case 4:return nn(),null;case 10:return pi(t.type._context),null;case 22:case 23:return Li(),null;case 24:return null;default:return null}}var gr=!1,re=!1,vd=typeof WeakSet=="function"?WeakSet:Set,E=null;function Wt(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){B(e,t,r)}else n.current=null}function Do(e,t,n){try{n()}catch(r){B(e,t,r)}}var Iu=!1;function yd(e,t){if(yo=Ur,e=ea(),ui(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var i=0,u=-1,s=-1,a=0,p=0,h=e,m=null;t:for(;;){for(var g;h!==n||l!==0&&h.nodeType!==3||(u=i+l),h!==o||r!==0&&h.nodeType!==3||(s=i+r),h.nodeType===3&&(i+=h.nodeValue.length),(g=h.firstChild)!==null;)m=h,h=g;for(;;){if(h===e)break t;if(m===n&&++a===l&&(u=i),m===o&&++p===r&&(s=i),(g=h.nextSibling)!==null)break;h=m,m=h.parentNode}h=g}n=u===-1||s===-1?null:{start:u,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(go={focusedElem:e,selectionRange:n},Ur=!1,E=t;E!==null;)if(t=E,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,E=e;else for(;E!==null;){t=E;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var k=w.memoizedProps,D=w.memoizedState,f=t.stateNode,c=f.getSnapshotBeforeUpdate(t.elementType===t.type?k:Ne(t.type,k),D);f.__reactInternalSnapshotBeforeUpdate=c}break;case 3:var d=t.stateNode.containerInfo;d.nodeType===1?d.textContent="":d.nodeType===9&&d.documentElement&&d.removeChild(d.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(y(163))}}catch(v){B(t,t.return,v)}if(e=t.sibling,e!==null){e.return=t.return,E=e;break}E=t.return}return w=Iu,Iu=!1,w}function Tn(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var o=l.destroy;l.destroy=void 0,o!==void 0&&Do(t,n,o)}l=l.next}while(l!==r)}}function fl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Fo(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Ga(e){var t=e.alternate;t!==null&&(e.alternate=null,Ga(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ie],delete t[Hn],delete t[ko],delete t[bf],delete t[ed])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Ja(e){return e.tag===5||e.tag===3||e.tag===4}function ju(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ja(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Io(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Vr));else if(r!==4&&(e=e.child,e!==null))for(Io(e,t,n),e=e.sibling;e!==null;)Io(e,t,n),e=e.sibling}function jo(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(jo(e,t,n),e=e.sibling;e!==null;)jo(e,t,n),e=e.sibling}var q=null,Le=!1;function Ge(e,t,n){for(n=n.child;n!==null;)qa(e,t,n),n=n.sibling}function qa(e,t,n){if(je&&typeof je.onCommitFiberUnmount=="function")try{je.onCommitFiberUnmount(rl,n)}catch{}switch(n.tag){case 5:re||Wt(n,t);case 6:var r=q,l=Le;q=null,Ge(e,t,n),q=r,Le=l,q!==null&&(Le?(e=q,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):q.removeChild(n.stateNode));break;case 18:q!==null&&(Le?(e=q,n=n.stateNode,e.nodeType===8?Ul(e.parentNode,n):e.nodeType===1&&Ul(e,n),Un(e)):Ul(q,n.stateNode));break;case 4:r=q,l=Le,q=n.stateNode.containerInfo,Le=!0,Ge(e,t,n),q=r,Le=l;break;case 0:case 11:case 14:case 15:if(!re&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var o=l,i=o.destroy;o=o.tag,i!==void 0&&(o&2||o&4)&&Do(n,t,i),l=l.next}while(l!==r)}Ge(e,t,n);break;case 1:if(!re&&(Wt(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(u){B(n,t,u)}Ge(e,t,n);break;case 21:Ge(e,t,n);break;case 22:n.mode&1?(re=(r=re)||n.memoizedState!==null,Ge(e,t,n),re=r):Ge(e,t,n);break;default:Ge(e,t,n)}}function Uu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new vd),t.forEach(function(r){var l=Pd.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function ze(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=i),r&=~o}if(r=l,r=Q()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*wd(r/1960))-r,10e?16:e,nt===null)var r=!1;else{if(e=nt,nt=null,el=0,M&6)throw Error(y(331));var l=M;for(M|=4,E=e.current;E!==null;){var o=E,i=o.child;if(E.flags&16){var u=o.deletions;if(u!==null){for(var s=0;sQ()-zi?_t(e,0):Pi|=n),pe(e,t)}function ic(e,t){t===0&&(e.mode&1?(t=ar,ar<<=1,!(ar&130023424)&&(ar=4194304)):t=1);var n=ie();e=Ye(e,t),e!==null&&(Jn(e,t,n),pe(e,n))}function xd(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ic(e,n)}function Pd(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(y(314))}r!==null&&r.delete(t),ic(e,n)}var uc;uc=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||fe.current)ce=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ce=!1,pd(e,t,n);ce=!!(e.flags&131072)}else ce=!1,U&&t.flags&1048576&&fa(t,Qr,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Lr(e,t),e=t.pendingProps;var l=bt(t,le.current);Gt(t,n),l=Si(null,t,r,e,l,n);var o=ki();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,de(r)?(o=!0,Hr(t)):o=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,hi(t),l.updater=cl,t.stateNode=l,l._reactInternals=t,zo(t,r,e,n),t=To(null,t,r,!0,o,n)):(t.tag=0,U&&o&&si(t),oe(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Lr(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Nd(r),e=Ne(r,e),l){case 0:t=Lo(null,t,r,e,n);break e;case 1:t=Ou(null,t,r,e,n);break e;case 11:t=Ru(null,t,r,e,n);break e;case 14:t=Mu(null,t,r,Ne(r.type,e),n);break e}throw Error(y(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ne(r,l),Lo(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ne(r,l),Ou(e,t,r,l,n);case 3:e:{if(Wa(t),e===null)throw Error(y(387));r=t.pendingProps,o=t.memoizedState,l=o.element,ya(e,t),Zr(t,r,null,n);var i=t.memoizedState;if(r=i.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){l=rn(Error(y(423)),t),t=Du(e,t,r,n,l);break e}else if(r!==l){l=rn(Error(y(424)),t),t=Du(e,t,r,n,l);break e}else for(he=it(t.stateNode.containerInfo.firstChild),ve=t,U=!0,Te=null,n=ha(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(en(),r===l){t=Ze(e,t,n);break e}oe(e,t,r,n)}t=t.child}return t;case 5:return ga(t),e===null&&Co(t),r=t.type,l=t.pendingProps,o=e!==null?e.memoizedProps:null,i=l.children,wo(r,l)?i=null:o!==null&&wo(r,o)&&(t.flags|=32),Ha(e,t),oe(e,t,i,n),t.child;case 6:return e===null&&Co(t),null;case 13:return Qa(e,t,n);case 4:return vi(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=tn(t,null,r,n):oe(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ne(r,l),Ru(e,t,r,l,n);case 7:return oe(e,t,t.pendingProps,n),t.child;case 8:return oe(e,t,t.pendingProps.children,n),t.child;case 12:return oe(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,o=t.memoizedProps,i=l.value,F(Kr,r._currentValue),r._currentValue=i,o!==null)if(Oe(o.value,i)){if(o.children===l.children&&!fe.current){t=Ze(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var u=o.dependencies;if(u!==null){i=o.child;for(var s=u.firstContext;s!==null;){if(s.context===r){if(o.tag===1){s=We(-1,n&-n),s.tag=2;var a=o.updateQueue;if(a!==null){a=a.shared;var p=a.pending;p===null?s.next=s:(s.next=p.next,p.next=s),a.pending=s}}o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),xo(o.return,n,t),u.lanes|=n;break}s=s.next}}else if(o.tag===10)i=o.type===t.type?null:o.child;else if(o.tag===18){if(i=o.return,i===null)throw Error(y(341));i.lanes|=n,u=i.alternate,u!==null&&(u.lanes|=n),xo(i,n,t),i=o.sibling}else i=o.child;if(i!==null)i.return=o;else for(i=o;i!==null;){if(i===t){i=null;break}if(o=i.sibling,o!==null){o.return=i.return,i=o;break}i=i.return}o=i}oe(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,Gt(t,n),l=Ce(l),r=r(l),t.flags|=1,oe(e,t,r,n),t.child;case 14:return r=t.type,l=Ne(r,t.pendingProps),l=Ne(r.type,l),Mu(e,t,r,l,n);case 15:return Va(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ne(r,l),Lr(e,t),t.tag=1,de(r)?(e=!0,Hr(t)):e=!1,Gt(t,n),Ua(t,r,l),zo(t,r,l,n),To(null,t,r,!0,e,n);case 19:return Ka(e,t,n);case 22:return Ba(e,t,n)}throw Error(y(156,t.tag))};function sc(e,t){return Fs(e,t)}function zd(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ee(e,t,n,r){return new zd(e,t,n,r)}function Ri(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Nd(e){if(typeof e=="function")return Ri(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Go)return 11;if(e===Jo)return 14}return 2}function ct(e,t){var n=e.alternate;return n===null?(n=Ee(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Mr(e,t,n,r,l,o){var i=2;if(r=e,typeof e=="function")Ri(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Ft:return Ct(n.children,l,o,t);case Xo:i=8,l|=8;break;case Gl:return e=Ee(12,n,t,l|2),e.elementType=Gl,e.lanes=o,e;case Jl:return e=Ee(13,n,t,l),e.elementType=Jl,e.lanes=o,e;case ql:return e=Ee(19,n,t,l),e.elementType=ql,e.lanes=o,e;case gs:return pl(n,l,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case vs:i=10;break e;case ys:i=9;break e;case Go:i=11;break e;case Jo:i=14;break e;case Je:i=16,r=null;break e}throw Error(y(130,e==null?e:typeof e,""))}return t=Ee(i,n,t,l),t.elementType=e,t.type=r,t.lanes=o,t}function Ct(e,t,n,r){return e=Ee(7,e,r,t),e.lanes=n,e}function pl(e,t,n,r){return e=Ee(22,e,r,t),e.elementType=gs,e.lanes=n,e.stateNode={isHidden:!1},e}function Kl(e,t,n){return e=Ee(6,e,null,t),e.lanes=n,e}function Yl(e,t,n){return t=Ee(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Ld(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=zl(0),this.expirationTimes=zl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zl(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function Mi(e,t,n,r,l,o,i,u,s){return e=new Ld(e,t,n,u,s),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Ee(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},hi(o),e}function Td(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(dc)}catch(e){console.error(e)}}dc(),ds.exports=ge;var Ii=ds.exports,pc,Ku=Ii;pc=Ku.createRoot,Ku.hydrateRoot;const Fd="modulepreload",Id=function(e){return"/"+e},Yu={},jd=function(t,n,r){if(!n||n.length===0)return t();const l=document.getElementsByTagName("link");return Promise.all(n.map(o=>{if(o=Id(o),o in Yu)return;Yu[o]=!0;const i=o.endsWith(".css"),u=i?'[rel="stylesheet"]':"";if(!!r)for(let p=l.length-1;p>=0;p--){const h=l[p];if(h.href===o&&(!i||h.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${u}`))return;const a=document.createElement("link");if(a.rel=i?"stylesheet":Fd,i||(a.as="script",a.crossOrigin=""),a.href=o,document.head.appendChild(a),i)return new Promise((p,h)=>{a.addEventListener("load",p),a.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${o}`)))})})).then(()=>t()).catch(o=>{const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=o,window.dispatchEvent(i),!i.defaultPrevented)throw o})},Ud=C.createContext(null);function Ad(e,t){const n=Array.isArray(e)?e[0]:e?e.x:0,r=Array.isArray(e)?e[1]:e?e.y:0,l=Array.isArray(t)?t[0]:t?t.x:0,o=Array.isArray(t)?t[1]:t?t.y:0;return n===l&&r===o}function Ve(e,t){if(e===t)return!0;if(!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n{let l=null;"interactive"in r&&(l=Object.assign({},r),delete l.interactive);const o=t[r.ref];if(o){l=l||Object.assign({},r),delete l.ref;for(const i of Vd)i in o&&(l[i]=o[i])}return l||r});return{...e,layers:n}}const qu={version:8,sources:{},layers:[]},bu={mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",click:"onClick",dblclick:"onDblClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mouseout:"onMouseOut",contextmenu:"onContextMenu",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",touchcancel:"onTouchCancel"},Zl={movestart:"onMoveStart",move:"onMove",moveend:"onMoveEnd",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",zoomstart:"onZoomStart",zoom:"onZoom",zoomend:"onZoomEnd",rotatestart:"onRotateStart",rotate:"onRotate",rotateend:"onRotateEnd",pitchstart:"onPitchStart",pitch:"onPitch",pitchend:"onPitchEnd"},es={wheel:"onWheel",boxzoomstart:"onBoxZoomStart",boxzoomend:"onBoxZoomEnd",boxzoomcancel:"onBoxZoomCancel",resize:"onResize",load:"onLoad",render:"onRender",idle:"onIdle",remove:"onRemove",data:"onData",styledata:"onStyleData",sourcedata:"onSourceData",error:"onError"},Bd=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],Hd=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class on{constructor(t,n,r){this._map=null,this._internalUpdate=!1,this._inRender=!1,this._hoveredFeatures=null,this._deferredEvents={move:!1,zoom:!1,pitch:!1,rotate:!1},this._onEvent=l=>{const o=this.props[es[l.type]];o?o(l):l.type==="error"&&console.error(l.error)},this._onPointerEvent=l=>{(l.type==="mousemove"||l.type==="mouseout")&&this._updateHover(l);const o=this.props[bu[l.type]];o&&(this.props.interactiveLayerIds&&l.type!=="mouseover"&&l.type!=="mouseout"&&(l.features=this._hoveredFeatures||this._queryRenderedFeatures(l.point)),o(l),delete l.features)},this._onCameraEvent=l=>{if(!this._internalUpdate){const o=this.props[Zl[l.type]];o&&o(l)}l.type in this._deferredEvents&&(this._deferredEvents[l.type]=!1)},this._MapClass=t,this.props=n,this._initialize(r)}get map(){return this._map}get transform(){return this._renderTransform}setProps(t){const n=this.props;this.props=t;const r=this._updateSettings(t,n);r&&this._createShadowTransform(this._map);const l=this._updateSize(t),o=this._updateViewState(t,!0);this._updateStyle(t,n),this._updateStyleComponents(t,n),this._updateHandlers(t,n),(r||l||o&&!this._map.isMoving())&&this.redraw()}static reuse(t,n){const r=on.savedMaps.pop();if(!r)return null;const l=r.map,o=l.getContainer();for(n.className=o.className;o.childNodes.length>0;)n.appendChild(o.childNodes[0]);l._container=n;const i=l._resizeObserver;i&&(i.disconnect(),i.observe(n)),r.setProps({...t,styleDiffing:!1}),l.resize();const{initialViewState:u}=t;return u&&(u.bounds?l.fitBounds(u.bounds,{...u.fitBoundsOptions,duration:0}):r._updateViewState(u,!1)),l.isStyleLoaded()?l.fire("load"):l.once("styledata",()=>l.fire("load")),l._update(),r}_initialize(t){const{props:n}=this,{mapStyle:r=qu}=n,l={...n,...n.initialViewState,accessToken:n.mapboxAccessToken||Wd()||null,container:t,style:Ju(r)},o=l.initialViewState||l.viewState||l;if(Object.assign(l,{center:[o.longitude||0,o.latitude||0],zoom:o.zoom||0,pitch:o.pitch||0,bearing:o.bearing||0}),n.gl){const p=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=p,n.gl)}const i=new this._MapClass(l);o.padding&&i.setPadding(o.padding),n.cursor&&(i.getCanvas().style.cursor=n.cursor),this._createShadowTransform(i);const u=i._render;i._render=p=>{this._inRender=!0,u.call(i,p),this._inRender=!1};const s=i._renderTaskQueue.run;i._renderTaskQueue.run=p=>{s.call(i._renderTaskQueue,p),this._onBeforeRepaint()},i.on("render",()=>this._onAfterRepaint());const a=i.fire;i.fire=this._fireEvent.bind(this,a),i.on("resize",()=>{this._renderTransform.resize(i.transform.width,i.transform.height)}),i.on("styledata",()=>{this._updateStyleComponents(this.props,{}),Zu(i.transform,this._renderTransform)}),i.on("sourcedata",()=>this._updateStyleComponents(this.props,{}));for(const p in bu)i.on(p,this._onPointerEvent);for(const p in Zl)i.on(p,this._onCameraEvent);for(const p in es)i.on(p,this._onEvent);this._map=i}recycle(){const n=this.map.getContainer().querySelector("[mapboxgl-children]");n==null||n.remove(),on.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const t=this._map;!this._inRender&&t.style&&(t._frame&&(t._frame.cancel(),t._frame=null),t._render())}_createShadowTransform(t){const n=$d(t.transform);t.painter.transform=n,this._renderTransform=n}_updateSize(t){const{viewState:n}=t;if(n){const r=this._map;if(n.width!==r.transform.width||n.height!==r.transform.height)return r.resize(),!0}return!1}_updateViewState(t,n){if(this._internalUpdate)return!1;const r=this._map,l=this._renderTransform,{zoom:o,pitch:i,bearing:u}=l,s=r.isMoving();s&&(l.cameraElevationReference="sea");const a=Gu(l,{...Xu(r.transform),...t});if(s&&(l.cameraElevationReference="ground"),a&&n){const p=this._deferredEvents;p.move=!0,p.zoom||(p.zoom=o!==l.zoom),p.rotate||(p.rotate=u!==l.bearing),p.pitch||(p.pitch=i!==l.pitch)}return s||Gu(r.transform,t),a}_updateSettings(t,n){const r=this._map;let l=!1;for(const o of Bd)if(o in t&&!Ve(t[o],n[o])){l=!0;const i=r[`set${o[0].toUpperCase()}${o.slice(1)}`];i==null||i.call(r,t[o])}return l}_updateStyle(t,n){if(t.cursor!==n.cursor&&(this._map.getCanvas().style.cursor=t.cursor||""),t.mapStyle!==n.mapStyle){const{mapStyle:r=qu,styleDiffing:l=!0}=t,o={diff:l};return"localIdeographFontFamily"in t&&(o.localIdeographFontFamily=t.localIdeographFontFamily),this._map.setStyle(Ju(r),o),!0}return!1}_updateStyleComponents(t,n){const r=this._map;let l=!1;return r.isStyleLoaded()&&("light"in t&&r.setLight&&!Ve(t.light,n.light)&&(l=!0,r.setLight(t.light)),"fog"in t&&r.setFog&&!Ve(t.fog,n.fog)&&(l=!0,r.setFog(t.fog)),"terrain"in t&&r.setTerrain&&!Ve(t.terrain,n.terrain)&&(!t.terrain||r.getSource(t.terrain.source))&&(l=!0,r.setTerrain(t.terrain))),l}_updateHandlers(t,n){var r,l;const o=this._map;let i=!1;for(const u of Hd){const s=(r=t[u])!==null&&r!==void 0?r:!0,a=(l=n[u])!==null&&l!==void 0?l:!0;Ve(s,a)||(i=!0,s?o[u].enable(s):o[u].disable())}return i}_queryRenderedFeatures(t){const n=this._map,r=n.transform,{interactiveLayerIds:l=[]}=this.props;try{return n.transform=this._renderTransform,n.queryRenderedFeatures(t,{layers:l.filter(n.getLayer.bind(n))})}catch{return[]}finally{n.transform=r}}_updateHover(t){var n;const{props:r}=this;if(r.interactiveLayerIds&&(r.onMouseMove||r.onMouseEnter||r.onMouseLeave)){const o=t.type,i=((n=this._hoveredFeatures)===null||n===void 0?void 0:n.length)>0,u=this._queryRenderedFeatures(t.point),s=u.length>0;!s&&i&&(t.type="mouseleave",this._onPointerEvent(t)),this._hoveredFeatures=u,s&&!i&&(t.type="mouseenter",this._onPointerEvent(t)),t.type=o}else this._hoveredFeatures=null}_fireEvent(t,n,r){const l=this._map,o=l.transform,i=typeof n=="string"?n:n.type;return i==="move"&&this._updateViewState(this.props,!1),i in Zl&&(typeof n=="object"&&(n.viewState=Xu(o)),this._map.isMoving())?(l.transform=this._renderTransform,t.call(l,n,r),l.transform=o,l):(t.call(l,n,r),l)}_onBeforeRepaint(){const t=this._map;this._internalUpdate=!0;for(const r in this._deferredEvents)this._deferredEvents[r]&&t.fire(r);this._internalUpdate=!1;const n=this._map.transform;t.transform=this._renderTransform,this._onAfterRepaint=()=>{Zu(this._renderTransform,n),t.transform=n}}}on.savedMaps=[];function Wd(){let e=null;if(typeof location<"u"){const t=/access_token=([^&\/]*)/.exec(location.search);e=t&&t[1]}try{e=e||void 0}catch{}try{e=e||{}.REACT_APP_MAPBOX_ACCESS_TOKEN}catch{}return e}const Qd=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function Kd(e){if(!e)return null;const t=e.map,n={getMap:()=>t,getCenter:()=>e.transform.center,getZoom:()=>e.transform.zoom,getBearing:()=>e.transform.bearing,getPitch:()=>e.transform.pitch,getPadding:()=>e.transform.padding,getBounds:()=>e.transform.getBounds(),project:r=>{const l=t.transform;t.transform=e.transform;const o=t.project(r);return t.transform=l,o},unproject:r=>{const l=t.transform;t.transform=e.transform;const o=t.unproject(r);return t.transform=l,o},queryTerrainElevation:(r,l)=>{const o=t.transform;t.transform=e.transform;const i=t.queryTerrainElevation(r,l);return t.transform=o,i},queryRenderedFeatures:(r,l)=>{const o=t.transform;t.transform=e.transform;const i=t.queryRenderedFeatures(r,l);return t.transform=o,i}};for(const r of Yd(t))!(r in n)&&!Qd.includes(r)&&(n[r]=t[r].bind(t));return n}function Yd(e){const t=new Set;let n=e;for(;n;){for(const r of Object.getOwnPropertyNames(n))r[0]!=="_"&&typeof e[r]=="function"&&r!=="fire"&&r!=="setEventedParent"&&t.add(r);n=Object.getPrototypeOf(n)}return Array.from(t)}const Zd=typeof document<"u"?C.useLayoutEffect:C.useEffect,Xd=["baseApiUrl","maxParallelImageRequests","workerClass","workerCount","workerUrl"];function Gd(e,t){for(const r of Xd)r in t&&(e[r]=t[r]);const{RTLTextPlugin:n="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js"}=t;n&&e.getRTLTextPluginStatus&&e.getRTLTextPluginStatus()==="unavailable"&&e.setRTLTextPlugin(n,r=>{r&&console.error(r)},!0)}const gl=C.createContext(null);function Jd(e,t,n){const r=C.useContext(Ud),[l,o]=C.useState(null),i=C.useRef(),{current:u}=C.useRef({mapLib:null,map:null});C.useEffect(()=>{const p=e.mapLib;let h=!0,m;return Promise.resolve(p||n).then(g=>{if(!h)return;if(!g)throw new Error("Invalid mapLib");const w="Map"in g?g:g.default;if(!w.Map)throw new Error("Invalid mapLib");if(Gd(w,e),!w.supported||w.supported(e))e.reuseMaps&&(m=on.reuse(e,i.current)),m||(m=new on(w.Map,e,i.current)),u.map=Kd(m),u.mapLib=w,o(m),r==null||r.onMapMount(u.map,e.id);else throw new Error("Map is not supported by this browser")}).catch(g=>{const{onError:w}=e;w?w({type:"error",target:null,originalEvent:null,error:g}):console.error(g)}),()=>{h=!1,m&&(r==null||r.onMapUnmount(e.id),e.reuseMaps?m.recycle():m.destroy())}},[]),Zd(()=>{l&&l.setProps(e)}),C.useImperativeHandle(t,()=>u.map,[l]);const s=C.useMemo(()=>({position:"relative",width:"100%",height:"100%",...e.style}),[e.style]),a={height:"100%"};return C.createElement("div",{id:e.id,ref:i,style:s},l&&C.createElement(gl.Provider,{value:u},C.createElement("div",{"mapboxgl-children":"",style:a},e.children)))}const qd=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function Mt(e,t){if(!e||!t)return;const n=e.style;for(const r in t){const l=t[r];Number.isFinite(l)&&!qd.test(r)?n[r]=`${l}px`:n[r]=l}}function bd(e,t){const{map:n,mapLib:r}=C.useContext(gl),l=C.useRef({props:e});l.current.props=e;const o=C.useMemo(()=>{let k=!1;C.Children.forEach(e.children,c=>{c&&(k=!0)});const D={...e,element:k?document.createElement("div"):null},f=new r.Marker(D);return f.setLngLat([e.longitude,e.latitude]),f.getElement().addEventListener("click",c=>{var d,v;(v=(d=l.current.props).onClick)===null||v===void 0||v.call(d,{type:"click",target:f,originalEvent:c})}),f.on("dragstart",c=>{var d,v;const S=c;S.lngLat=o.getLngLat(),(v=(d=l.current.props).onDragStart)===null||v===void 0||v.call(d,S)}),f.on("drag",c=>{var d,v;const S=c;S.lngLat=o.getLngLat(),(v=(d=l.current.props).onDrag)===null||v===void 0||v.call(d,S)}),f.on("dragend",c=>{var d,v;const S=c;S.lngLat=o.getLngLat(),(v=(d=l.current.props).onDragEnd)===null||v===void 0||v.call(d,S)}),f},[]);C.useEffect(()=>(o.addTo(n.getMap()),()=>{o.remove()}),[]);const{longitude:i,latitude:u,offset:s,style:a,draggable:p=!1,popup:h=null,rotation:m=0,rotationAlignment:g="auto",pitchAlignment:w="auto"}=e;return C.useEffect(()=>{Mt(o.getElement(),a)},[a]),C.useImperativeHandle(t,()=>o,[]),(o.getLngLat().lng!==i||o.getLngLat().lat!==u)&&o.setLngLat([i,u]),s&&!Ad(o.getOffset(),s)&&o.setOffset(s),o.isDraggable()!==p&&o.setDraggable(p),o.getRotation()!==m&&o.setRotation(m),o.getRotationAlignment()!==g&&o.setRotationAlignment(g),o.getPitchAlignment()!==w&&o.setPitchAlignment(w),o.getPopup()!==h&&o.setPopup(h),Ii.createPortal(e.children,o.getElement())}C.memo(C.forwardRef(bd));function ts(e){return new Set(e?e.trim().split(/\s+/):[])}function ep(e,t){const{map:n,mapLib:r}=C.useContext(gl),l=C.useMemo(()=>document.createElement("div"),[]),o=C.useRef({props:e});o.current.props=e;const i=C.useMemo(()=>{const u={...e},s=new r.Popup(u);return s.setLngLat([e.longitude,e.latitude]),s.once("open",a=>{var p,h;(h=(p=o.current.props).onOpen)===null||h===void 0||h.call(p,a)}),s},[]);if(C.useEffect(()=>{const u=s=>{var a,p;(p=(a=o.current.props).onClose)===null||p===void 0||p.call(a,s)};return i.on("close",u),i.setDOMContent(l).addTo(n.getMap()),()=>{i.off("close",u),i.isOpen()&&i.remove()}},[]),C.useEffect(()=>{Mt(i.getElement(),e.style)},[e.style]),C.useImperativeHandle(t,()=>i,[]),i.isOpen()&&((i.getLngLat().lng!==e.longitude||i.getLngLat().lat!==e.latitude)&&i.setLngLat([e.longitude,e.latitude]),e.offset&&!Ve(i.options.offset,e.offset)&&i.setOffset(e.offset),(i.options.anchor!==e.anchor||i.options.maxWidth!==e.maxWidth)&&(i.options.anchor=e.anchor,i.setMaxWidth(e.maxWidth)),i.options.className!==e.className)){const u=ts(i.options.className),s=ts(e.className);for(const a of u)s.has(a)||i.removeClassName(a);for(const a of s)u.has(a)||i.addClassName(a);i.options.className=e.className}return Ii.createPortal(e.children,l)}C.memo(C.forwardRef(ep));function tr(e,t,n,r){const l=C.useContext(gl),o=C.useMemo(()=>e(l),[]);return C.useEffect(()=>{const i=r||n||t,u=typeof t=="function"&&typeof n=="function"?t:null,s=typeof n=="function"?n:typeof t=="function"?t:null,{map:a}=l;return a.hasControl(o)||(a.addControl(o,i==null?void 0:i.position),u&&u(l)),()=>{s&&s(l),a.hasControl(o)&&a.removeControl(o)}},[]),o}function tp(e){const t=tr(({mapLib:n})=>new n.AttributionControl(e),{position:e.position});return C.useEffect(()=>{Mt(t._container,e.style)},[e.style]),null}C.memo(tp);function np(e){const t=tr(({mapLib:n})=>new n.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return C.useEffect(()=>{Mt(t._controlContainer,e.style)},[e.style]),null}C.memo(np);function rp(e,t){const n=C.useRef({props:e}),r=tr(({mapLib:l})=>{const o=new l.GeolocateControl(e),i=o._setupUI;return o._setupUI=u=>{o._container.hasChildNodes()||i(u)},o.on("geolocate",u=>{var s,a;(a=(s=n.current.props).onGeolocate)===null||a===void 0||a.call(s,u)}),o.on("error",u=>{var s,a;(a=(s=n.current.props).onError)===null||a===void 0||a.call(s,u)}),o.on("outofmaxbounds",u=>{var s,a;(a=(s=n.current.props).onOutOfMaxBounds)===null||a===void 0||a.call(s,u)}),o.on("trackuserlocationstart",u=>{var s,a;(a=(s=n.current.props).onTrackUserLocationStart)===null||a===void 0||a.call(s,u)}),o.on("trackuserlocationend",u=>{var s,a;(a=(s=n.current.props).onTrackUserLocationEnd)===null||a===void 0||a.call(s,u)}),o},{position:e.position});return n.current.props=e,C.useImperativeHandle(t,()=>r,[]),C.useEffect(()=>{Mt(r._container,e.style)},[e.style]),null}const lp=C.memo(C.forwardRef(rp));function op(e){const t=tr(({mapLib:n})=>new n.NavigationControl(e),{position:e.position});return C.useEffect(()=>{Mt(t._container,e.style)},[e.style]),null}const ip=C.memo(op);function up(e){const t=tr(({mapLib:o})=>new o.ScaleControl(e),{position:e.position}),n=C.useRef(e),r=n.current;n.current=e;const{style:l}=e;return e.maxWidth!==void 0&&e.maxWidth!==r.maxWidth&&(t.options.maxWidth=e.maxWidth),e.unit!==void 0&&e.unit!==r.unit&&t.setUnit(e.unit),C.useEffect(()=>{Mt(t._container,l)},[l]),null}const sp=C.memo(up),ap=jd(()=>import("./mapbox-gl-87c162e0.js").then(e=>e.m),[]),cp=(()=>C.forwardRef(function(t,n){return Jd(t,n,ap)}))(),fp=ip,dp=lp,pp=sp,mp={"slippy-map":"_slippy-map_1sfxu_2"};const ns="pk.eyJ1IjoicnVyYWxpbm5vIiwiYSI6ImNqeHl0cW0xODBlMm0zY2x0dXltYzRuazUifQ.zZBovoCHzLIW0wCZveEKzA";function hp(){return console.log("Re-rendering App component with MAPBOX_TOKEN: ",ns),C.createElement(C.Fragment,null,C.createElement("div",{className:mp["slippy-map"]},C.createElement(cp,{mapboxAccessToken:ns,mapStyle:"mapbox://styles/mapbox/light-v9",initialViewState:{latitude:39,longitude:-97.5,pitch:45,zoom:4.15},onMove:e=>{}},C.createElement(dp,{position:"top-right"}),C.createElement(fp,{position:"top-right"}),C.createElement(pp,{position:"bottom-left",unit:"imperial"}))))}function vp(e){pc(e).render(C.createElement(C.StrictMode,null,C.createElement(hp,null)))}vp(document.getElementById("app")); diff --git a/docs/assets/index-732dca48.css b/docs/assets/index-732dca48.css deleted file mode 100644 index 95fa18c..0000000 --- a/docs/assets/index-732dca48.css +++ /dev/null @@ -1 +0,0 @@ -@import"https://fonts.googleapis.com/css2?family=Bitter:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap";@import"https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap";@import"https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap";@import"https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;500;600;700&display=swap";*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:theme("borderColor.DEFAULT",currentColor)}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:theme("fontFamily.sans",ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:theme("fontFamily.sans[1].fontFeatureSettings",normal);font-variation-settings:theme("fontFamily.sans[1].fontVariationSettings",normal)}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}code,kbd,samp,pre{font-family:theme("fontFamily.mono",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-size:1em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}::-webkit-search-decoration{-webkit-appearance:none}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1;color:theme("colors.gray.400",#9ca3af)}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}@font-face{font-family:TT Hoves;font-weight:400;font-style:normal;src:local("TT Hoves"),url("https://cori-risi-apps.s3.amazonaws.com/fonts/TypeType - TT Hoves Regular.ttf") format("truetype"),url(https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Regular/font.woff) format("woff"),url(https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Regular/font.woff2) format("woff2")}@font-face{font-family:TT Hoves Bold;font-weight:700;font-style:normal;src:local("TT Hoves"),url("https://cori-risi-apps.s3.amazonaws.com/fonts/TypeType - TT Hoves Bold.ttf") format("truetype"),url(https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Bold/font.woff) format("woff"),url(https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Bold/font.woff2) format("woff2")}@font-face{font-family:TT Hoves Medium;font-weight:500;font-style:normal;src:local("TT Hoves"),url("https://cori-risi-apps.s3.amazonaws.com/fonts/TypeType - TT Hoves Medium.ttf") format("truetype"),url(https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Medium/font.woff) format("woff"),url(https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Medium/font.woff2) format("woff2")}@font-face{font-family:TT Hoves Italic;font-weight:400;font-style:italic;src:local("TT Hoves"),url("https://cori-risi-apps.s3.amazonaws.com/fonts/TypeType - TT Hoves Italic.ttf") format("truetype"),url(https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Italic/font.woff) format("woff"),url(https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Italic/font.woff2) format("woff2")}html,body{font-family:Montserrat,Bitter,serif}h1,h2,h3,h4,h5,h6{font-weight:400;font-family:Montserrat,TT Hoves,sans-serif}h1,h2,h6{font-family:Montserrat,TT Hoves Bold,TT Hoves,sans-serif;font-weight:700}h3{font-family:Montserrat,TT Hoves Medium,TT Hoves,Bitter,serif;font-weight:400}h4,h5{font-family:Montserrat,TT Hoves Medium,TT Hoves,sans-serif;font-weight:500}h1{font-size:3.2em;line-height:1.16}h2{font-size:2.4em;line-height:1.25}h3{font-size:1.8em;line-height:1.3}h4{font-size:1.5em;line-height:1.3}h5{font-size:1.2em;line-height:1.3}h6{font-size:.76em;line-height:1.35}@media (min-width: 550px){h1{font-size:2.8em}h2{font-size:2.3em}h3{font-size:1.8em}h4{font-size:1.5em}h5{font-size:1.2em}h6{font-size:1em}}p{font-family:Bitter,serif;font-size:1em;line-height:1.7}a{font-family:Bitter,serif;font-size:1em;font-weight:400;line-height:1.7;text-decoration:underline}a:hover{text-decoration:underline;cursor:pointer}.nav-item a,.sidebar-item a{font-family:Montserrat,TT Hoves,sans-serif;font-weight:400}body{margin:0;font-family:Bitter,Montserrat,serif}#map{width:100%;height:100%;z-index:1}#map * .mapboxgl-ctrl{font-family:Bitter,serif}.control-panel{position:absolute;top:0;left:0;max-width:320px;background:#fff;box-shadow:0 2px 4px #0000004d;padding:12px 24px;margin:20px;font-size:13px;line-height:2;color:#6b6b76;text-transform:uppercase;outline:none;z-index:2}._slippy-map_1sfxu_2{position:relative;width:100%;height:100%;overflow:hidden}._slippy-map_1sfxu_2>*{overflow:hidden}.mapboxgl-map{-webkit-tap-highlight-color:rgb(0 0 0/0);font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative}.mapboxgl-canvas{left:0;position:absolute;top:0}.mapboxgl-map:-webkit-full-screen{height:100%;width:100%}.mapboxgl-canary{background-color:salmon}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass{cursor:grab;-webkit-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active{cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas{touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:none}.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.mapboxgl-ctrl-top-left{left:0;top:0}.mapboxgl-ctrl-top-right{right:0;top:0}.mapboxgl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-bottom-right{bottom:0;right:0}.mapboxgl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{float:left;margin:10px 0 0 10px}.mapboxgl-ctrl-top-right .mapboxgl-ctrl{float:right;margin:10px 10px 0 0}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl{float:left;margin:0 0 10px 10px}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl{float:right;margin:0 10px 10px 0}.mapboxgl-ctrl-group{background:#fff;border-radius:4px}.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px #0000001a}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.mapboxgl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;overflow:hidden;padding:0;width:29px}.mapboxgl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon{background-color:transparent}.mapboxgl-ctrl-group button+button{border-top:1px solid ButtonText}}.mapboxgl-ctrl-attrib-button:focus,.mapboxgl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon{opacity:.25}.mapboxgl-ctrl-group button:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:only-child{border-radius:inherit}.mapboxgl-ctrl button:not(:disabled):hover{background-color:#0000000d}.mapboxgl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23999'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon{animation:mapboxgl-spin 2s linear infinite}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23000'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}}@keyframes mapboxgl-spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='0.3' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='0.9' fill='%23fff'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.mapboxgl-ctrl-logo.mapboxgl-compact{width:23px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='1' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='1' fill='%23fff'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='1' stroke='%23fff' stroke-width='3' fill='%23fff'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='1' fill='%23000'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib{background-color:#ffffff80;margin:0;padding:0 5px}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact{background-color:#fff;border-radius:12px;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib-button{background-color:#ffffff80;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-top-left .mapboxgl-ctrl-attrib-button{left:0}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-inner{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-button{background-color:#0000000d}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{right:0;top:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{left:0;top:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.mapboxgl-ctrl-attrib a{color:#000000bf;text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-ctrl-attrib .mapbox-improve-map{font-weight:700;margin-left:2px}.mapboxgl-attrib-empty{display:none}.mapboxgl-ctrl-scale{background-color:#ffffffbf;border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px;white-space:nowrap}.mapboxgl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right{flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right{flex-direction:column-reverse}.mapboxgl-popup-anchor-left{flex-direction:row}.mapboxgl-popup-anchor-right{flex-direction:row-reverse}.mapboxgl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.mapboxgl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.mapboxgl-popup-close-button:hover{background-color:#0000000d}.mapboxgl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px #0000001a;padding:10px 10px 15px;pointer-events:auto;position:relative}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer{display:none}.mapboxgl-marker{left:0;opacity:1;position:absolute;top:0;transition:opacity .2s;will-change:transform}.mapboxgl-user-location-dot,.mapboxgl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.mapboxgl-user-location-dot:before{animation:mapboxgl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.mapboxgl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px #00000059;box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading{height:0;width:0}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:after,.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:before{border-bottom:7.5px solid #4aa1eb;content:"";position:absolute}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:before{border-left:7.5px solid transparent;transform:translateY(-28px) skewY(-20deg)}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:after{border-right:7.5px solid transparent;transform:translate(7.5px,-28px) skewY(20deg)}@keyframes mapboxgl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.mapboxgl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}@media print{.mapbox-improve-map{display:none}}.mapboxgl-scroll-zoom-blocker,.mapboxgl-touch-pan-blocker{align-items:center;background:rgba(0,0,0,.7);color:#fff;display:flex;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif;height:100%;justify-content:center;left:0;opacity:0;pointer-events:none;position:absolute;text-align:center;top:0;transition:opacity .75s ease-in-out;transition-delay:1s;width:100%}.mapboxgl-scroll-zoom-blocker-show,.mapboxgl-touch-pan-blocker-show{opacity:1;transition:opacity .1s ease-in-out}.mapboxgl-canvas-container.mapboxgl-touch-pan-blocker-override.mapboxgl-scrollable-page,.mapboxgl-canvas-container.mapboxgl-touch-pan-blocker-override.mapboxgl-scrollable-page .mapboxgl-canvas{touch-action:pan-x pan-y}/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none} diff --git a/docs/assets/index-b3a314fc.css b/docs/assets/index-b3a314fc.css new file mode 100644 index 0000000..7734cba --- /dev/null +++ b/docs/assets/index-b3a314fc.css @@ -0,0 +1 @@ +.mapboxgl-map{-webkit-tap-highlight-color:rgb(0 0 0/0);font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative}.mapboxgl-canvas{left:0;position:absolute;top:0}.mapboxgl-map:-webkit-full-screen{height:100%;width:100%}.mapboxgl-canary{background-color:salmon}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass{cursor:grab;-webkit-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active{cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas{touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:none}.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.mapboxgl-ctrl-top-left{left:0;top:0}.mapboxgl-ctrl-top-right{right:0;top:0}.mapboxgl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-bottom-right{bottom:0;right:0}.mapboxgl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{float:left;margin:10px 0 0 10px}.mapboxgl-ctrl-top-right .mapboxgl-ctrl{float:right;margin:10px 10px 0 0}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl{float:left;margin:0 0 10px 10px}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl{float:right;margin:0 10px 10px 0}.mapboxgl-ctrl-group{background:#fff;border-radius:4px}.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px #0000001a}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.mapboxgl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;overflow:hidden;padding:0;width:29px}.mapboxgl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon{background-color:transparent}.mapboxgl-ctrl-group button+button{border-top:1px solid ButtonText}}.mapboxgl-ctrl-attrib-button:focus,.mapboxgl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon{opacity:.25}.mapboxgl-ctrl-group button:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:only-child{border-radius:inherit}.mapboxgl-ctrl button:not(:disabled):hover{background-color:#0000000d}.mapboxgl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23999'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon{animation:mapboxgl-spin 2s linear infinite}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23000'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}}@keyframes mapboxgl-spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='0.3' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='0.9' fill='%23fff'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.mapboxgl-ctrl-logo.mapboxgl-compact{width:23px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='1' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='1' fill='%23fff'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='1' stroke='%23fff' stroke-width='3' fill='%23fff'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='1' fill='%23000'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib{background-color:#ffffff80;margin:0;padding:0 5px}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact{background-color:#fff;border-radius:12px;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib-button{background-color:#ffffff80;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-top-left .mapboxgl-ctrl-attrib-button{left:0}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-inner{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-button{background-color:#0000000d}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{right:0;top:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{left:0;top:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.mapboxgl-ctrl-attrib a{color:#000000bf;text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-ctrl-attrib .mapbox-improve-map{font-weight:700;margin-left:2px}.mapboxgl-attrib-empty{display:none}.mapboxgl-ctrl-scale{background-color:#ffffffbf;border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px;white-space:nowrap}.mapboxgl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right{flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right{flex-direction:column-reverse}.mapboxgl-popup-anchor-left{flex-direction:row}.mapboxgl-popup-anchor-right{flex-direction:row-reverse}.mapboxgl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.mapboxgl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.mapboxgl-popup-close-button:hover{background-color:#0000000d}.mapboxgl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px #0000001a;padding:10px 10px 15px;pointer-events:auto;position:relative}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer{display:none}.mapboxgl-marker{left:0;opacity:1;position:absolute;top:0;transition:opacity .2s;will-change:transform}.mapboxgl-user-location-dot,.mapboxgl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.mapboxgl-user-location-dot:before{animation:mapboxgl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.mapboxgl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px #00000059;box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading{height:0;width:0}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:after,.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:before{border-bottom:7.5px solid #4aa1eb;content:"";position:absolute}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:before{border-left:7.5px solid transparent;transform:translateY(-28px) skewY(-20deg)}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:after{border-right:7.5px solid transparent;transform:translate(7.5px,-28px) skewY(20deg)}@keyframes mapboxgl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.mapboxgl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}@media print{.mapbox-improve-map{display:none}}.mapboxgl-scroll-zoom-blocker,.mapboxgl-touch-pan-blocker{align-items:center;background:rgba(0,0,0,.7);color:#fff;display:flex;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif;height:100%;justify-content:center;left:0;opacity:0;pointer-events:none;position:absolute;text-align:center;top:0;transition:opacity .75s ease-in-out;transition-delay:1s;width:100%}.mapboxgl-scroll-zoom-blocker-show,.mapboxgl-touch-pan-blocker-show{opacity:1;transition:opacity .1s ease-in-out}.mapboxgl-canvas-container.mapboxgl-touch-pan-blocker-override.mapboxgl-scrollable-page,.mapboxgl-canvas-container.mapboxgl-touch-pan-blocker-override.mapboxgl-scrollable-page .mapboxgl-canvas{touch-action:pan-x pan-y}:root,[data-amplify-theme]{--amplify-components-button-link-color: #ffffff;--amplify-components-button-link-loading-background-color: #2c3e50;--amplify-components-button-link-loading-border-color: #1a242f;--amplify-components-button-link-disabled-background-color: #2c3e50;--amplify-components-button-link-disabled-border-color: #1a242f;--amplify-components-button-link-active-border-color: #1a242f;--amplify-components-button-link-focus-border-color: #1a242f;--amplify-components-button-link-hover-border-color: #1a242f;--amplify-components-button-link-border-color: #1a242f;--amplify-components-button-link-background-color: #2c3e50;--amplify-components-button-menu-background-color: #2c3e50;--amplify-components-button-primary-background-color: #2c3e50;--amplify-components-button-primary-active-background-color: #1a242f;--amplify-components-button-primary-active-border-color: #1a242f;--amplify-components-button-primary-focus-background-color: #1a242f;--amplify-components-button-primary-focus-border-color: #1a242f;--amplify-components-button-primary-hover-background-color: #1a242f;--amplify-components-button-primary-hover-border-color: #1a242f;--amplify-components-button-primary-loading-border-color: #1a242f;--amplify-components-button-primary-disabled-border-color: #1a242f;--amplify-components-button-primary-border-color: #1a242f;--amplify-components-button-disabled-background-color: #2c3e50;--amplify-components-button-loading-background-color: #2c3e50;--amplify-components-tabs-item-active-color: #18bc9c;--amplify-components-tabs-item-border-style: 4px solid #2c3e50;--amplify-components-tabs-item-active-border-color: #2c3e50}[data-amplify-theme=default-theme] [data-amplify-authenticator] [data-amplify-router]{background-color:var(--amplify-components-authenticator-router-background-color);box-shadow:var(--amplify-components-authenticator-router-box-shadow);border-color:transparent}.ApiContextProvider_amplify-button--primary__x3TB9{border-width:var(--amplify-components-button-primary-border-width);background-color:var(--amplify-components-button-primary-background-color);border-color:var(--amplify-components-button-primary-border-color);color:var(--amplify-components-button-primary-color);--amplify-internal-button-disabled-border-color: var( --amplify-components-button-primary-disabled-border-color );--amplify-internal-button-disabled-background-color: var( --amplify-components-button-primary-disabled-background-color );--amplify-internal-button-disabled-color: var( --amplify-components-button-primary-disabled-color );--amplify-internal-button-loading-background-color: var( --amplify-components-button-primary-loading-background-color );--amplify-internal-button-loading-border-color: var( --amplify-components-button-primary-loading-border-color );--amplify-internal-button-loading-color: var( --amplify-components-button-primary-loading-color )}.ApiContextProvider_amplify-button--primary__x3TB9:hover{background-color:var(--amplify-components-button-primary-hover-background-color);border-color:var(--amplify-components-button-primary-hover-border-color);color:var(--amplify-components-button-primary-hover-color)}.ApiContextProvider_amplify-button--primary__x3TB9:focus{background-color:var(--amplify-components-button-primary-focus-background-color);border-color:var(--amplify-components-button-primary-focus-border-color);color:var(--amplify-components-button-primary-focus-color);box-shadow:var(--amplify-components-button-primary-focus-box-shadow)}.ApiContextProvider_amplify-button--primary__x3TB9:active{background-color:var(--amplify-components-button-primary-active-background-color);border-color:var(--amplify-components-button-primary-active-border-color);color:var(--amplify-components-button-primary-active-color)}.ApiContextProvider_amplify-tabs-item__-6nTX[data-state=active]{color:var(--amplify-components-tabs-item-active-color);border-color:var(--amplify-components-tabs-item-active-border-color);background-color:var(--amplify-components-tabs-item-active-background-color);transition-property:none}.ApiContextProvider_amplify-input__ycAUW.ApiContextProvider_amplify-field-group__control__cRTcr{text-align:left}.CategoricalLegend-module_categorical-legend__KiFcS{display:flex;flex-wrap:wrap;margin:1.5rem 0px}.CategoricalLegend-module_categorical-legend__KiFcS .CategoricalLegend-module_entry__4zxZU{display:flex;justify-content:space-around;margin:0 20px 5px 0}.CategoricalLegend-module_categorical-legend__KiFcS .CategoricalLegend-module_entry__4zxZU .CategoricalLegend-module_key__1Hgb-{height:1rem;width:1rem;opacity:.9}.CategoricalLegend-module_categorical-legend__KiFcS .CategoricalLegend-module_entry__4zxZU p{line-height:1rem;font-size:1rem;margin:0 0 0 6px}.HoverInfo-module_tooltip__3wVpX{width:320px;border:1px solid black;background-color:#fff;padding:10px;position:absolute;z-index:10;pointer-events:none}.HoverInfo-module_tooltip__3wVpX h3{margin:.5rem 0rem}.HoverInfo-module_tooltip__3wVpX .HoverInfo-module_details__4eyQ7{margin:.1rem 0rem;line-height:1.6}.HoverInfo-module_tooltip__3wVpX .HoverInfo-module_prop-score__DKjwo{font-weight:400;margin:0}.slippy-map{position:relative;width:100vw;height:100vh}.slippy-map>*{overflow:hidden}.slippy-map>.mapboxgl-map{width:100%!important;height:100%!important}.tooltip{width:320px;border:1px solid black;background-color:#fff;padding:10px;position:absolute;z-index:10;pointer-events:none}.tooltip h3{margin:.5rem 0rem}.tooltip .details{margin:.1rem 0rem;line-height:1.6}.tooltip .prop-score{font-weight:400;margin:0}.tooltip .click-prompt{font-style:italic;font-weight:600;margin-top:5px}.tooltip p{margin:0}/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body{font-family:Montserrat,Arial,Helvetica,sans-serif;overflow:none}h1{font-size:2rem}h2{font-size:1.8rem}h3{font-size:1.6rem}h4{font-size:1.4rem}h5{font-size:1.2rem}h6{font-size:1rem}h1,h2,h3,h4,h5,h6{font-family:Montserrat,Arial,Helvetica,sans-serif;margin-top:.5em;margin-bottom:.5em}p,a{font-family:Montserrat,Arial,Helvetica,sans-serif;line-height:1.4}a{margin-top:0;margin-bottom:0;color:#00835d;text-decoration:underline;font-weight:700}a:hover{text-decoration:underline;cursor:pointer}#map{display:flex} diff --git a/docs/assets/mapbox-gl-87c162e0.js b/docs/assets/mapbox-gl-87c162e0.js deleted file mode 100644 index 78e444f..0000000 --- a/docs/assets/mapbox-gl-87c162e0.js +++ /dev/null @@ -1,1318 +0,0 @@ -function mg(gr,Mh){for(var ln=0;lnyr[cn]})}}}return Object.freeze(Object.defineProperty(gr,Symbol.toStringTag,{value:"Module"}))}var _g=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function gg(gr){return gr&&gr.__esModule&&Object.prototype.hasOwnProperty.call(gr,"default")?gr.default:gr}var Of={exports:{}};(function(gr,Mh){(function(ln,yr){gr.exports=yr()})(_g,function(){var ln,yr,cn;function wo(a,Se){if(!ln)ln=Se;else if(!yr)yr=Se;else{var xr="self.onerror = function() { console.error('An error occurred while parsing the WebWorker bundle. This is most likely due to improper transpilation by Babel; please see https://docs.mapbox.com/mapbox-gl-js/guides/install/#transpiling'); }; var sharedChunk = {}; ("+ln+")(sharedChunk); ("+yr+")(sharedChunk); self.onerror = null;",Ki={};ln(Ki),cn=Se(Ki),typeof window<"u"&&window&&window.URL&&window.URL.createObjectURL&&(cn.workerUrl=window.URL.createObjectURL(new Blob([xr],{type:"text/javascript"})))}}wo(["exports"],function(a){var Se=typeof self<"u"?self:{},xr="2.15.0";let Ki;const it={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){if(Ki==null){const t=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;try{Ki={}.API_URL_REGEX!=null?new RegExp({}.API_URL_REGEX):t}catch{Ki=t}}return Ki},get API_TILEJSON_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/v[0-9]*\/.*\.json.*$)/i},get API_SPRITE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*\/sprite.*\..*$)/i},get API_FONTS_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/fonts\/v[0-9]*\/)(.*\.pbf.*$)/i},get API_STYLE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*$)/i},get API_CDN_URL_REGEX(){return/^((https?:)?\/\/)?api\.mapbox\.c(n|om)(\/mapbox-gl-js\/)(.*$)/i},get EVENTS_URL(){if(!it.API_URL)return null;try{const t=new URL(it.API_URL);return t.hostname==="api.mapbox.cn"?"https://events.mapbox.cn/events/v2":t.hostname==="api.mapbox.com"?"https://events.mapbox.com/events/v2":null}catch{return null}},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},ht={supported:!1,testSupport:function(t){!vr&&Si&&(br?To(t):gi=t)}};let gi,Si,vr=!1,br=!1;function To(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,Si),t.isContextLost())return;ht.supported=!0}catch{}t.deleteTexture(e),vr=!0}Se.document&&(Si=Se.document.createElement("img"),Si.onload=function(){gi&&To(gi),gi=null,br=!0},Si.onerror=function(){vr=!0,gi=null},Si.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const Rn="01";function Yi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Bn=Ji;function Ji(t,e,i,n){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*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=e,this.p2x=i,this.p2y=n}Ji.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(e===void 0&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var i=t,n=0;n<8;n++){var s=this.sampleCurveX(i)-t;if(Math.abs(s)s?u=i:p=i,i=.5*(p-u)+u;return i},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}};var hn=Yi(Bn),un=Qi;function Qi(t,e){this.x=t,this.y=e}Qi.prototype={clone:function(){return new Qi(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),n=i*this.x+e*this.y;return this.x=e*this.x-i*this.y,this.y=n,this},_rotateAround:function(t,e){var i=Math.cos(t),n=Math.sin(t),s=e.y+n*(this.x-e.x)+i*(this.y-e.y);return this.x=e.x+i*(this.x-e.x)-n*(this.y-e.y),this.y=s,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Qi.convert=function(t){return t instanceof Qi?t:Array.isArray(t)?new Qi(t[0],t[1]):t};var Le=Yi(un);const ba=Math.PI/180,wa=180/Math.PI;function dt(t){return t*ba}function si(t){return t*wa}const Ta=[[0,0],[1,0],[1,1],[0,1]];function gs(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)}function Eo(t,e,i,n){const s=new hn(t,e,i,n);return function(c){return s.solve(c)}}const ys=Eo(.25,.1,.25,1);function ct(t,e,i){return Math.min(i,Math.max(e,t))}function On(t,e,i){return(i=ct((i-t)/(e-t),0,1))*i*(3-2*i)}function oi(t,e,i){const n=i-e,s=((t-e)%n+n)%n+e;return s===e?i:s}function ai(t,e,i){if(!t.length)return i(null,[]);let n=t.length;const s=new Array(t.length);let c=null;t.forEach((u,p)=>{e(u,(m,_)=>{m&&(c=m),s[p]=_,--n==0&&i(c,s)})})}function $r(t){const e=[];for(const i in t)e.push(t[i]);return e}function Wt(t,...e){for(const i of e)for(const n in i)t[n]=i[n];return t}let Zr=1;function Fn(){return Zr++}function qr(){return function t(e){return e?(e^Math.random()*(16>>e/4)).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function wr(t){return t<=1?1:Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function xs(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function dn(t,e){t.forEach(i=>{e[i]&&(e[i]=e[i].bind(e))})}function Un(t,e){return t.indexOf(e,t.length-e.length)!==-1}function pt(t,e,i){const n={};for(const s in t)n[s]=e.call(i||this,t[s],s,t);return n}function Vn(t,e,i){const n={};for(const s in t)e.call(i||this,t[s],s,t)&&(n[s]=t[s]);return n}function Li(t){return Array.isArray(t)?t.map(Li):typeof t=="object"&&t?pt(t,Li):t}const So={};function Ut(t){So[t]||(typeof console<"u"&&console.warn(t),So[t]=!0)}function Ui(t,e,i){return(i.y-t.y)*(e.x-t.x)>(e.y-t.y)*(i.x-t.x)}function vs(t){let e=0;for(let i,n,s=0,c=t.length,u=c-1;s@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(i,n,s,c)=>{const u=s||c;return e[n]=!u||u.toLowerCase(),""}),e["max-age"]){const i=parseInt(e["max-age"],10);isNaN(i)?delete e["max-age"]:e["max-age"]=i}return e}let Mo=null;function Nn(t){if(Mo==null){const e=t.navigator?t.navigator.userAgent:null;Mo=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return Mo}function Ao(t){try{const e=Se[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch{return!1}}function Wr(t,e){return[t[4*e],t[4*e+1],t[4*e+2],t[4*e+3]]}const jn="mapbox-tiles";let bs=500,ws=50,Vi,Xr;function Io(){try{return Se.caches}catch{}}function pn(){Io()&&!Vi&&(Vi=Se.caches.open(jn))}function Gn(t){const e=t.indexOf("?");if(e<0)return t;const i=function(s){const c=s.indexOf("?");return c>0?s.slice(c+1).split("&"):[]}(t),n=i.filter(s=>{const c=s.split("=");return c[0]==="language"||c[0]==="worldview"});return n.length?`${t.slice(0,e)}?${n.join("&")}`:t.slice(0,e)}let Co=1/0;const fn={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(fn);class Hr extends Error{constructor(e,i,n){i===401&&ne(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes"),super(e),this.status=i,this.url=n}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}const mn=Tr()?()=>self.worker&&self.worker.referrer:()=>(Se.location.protocol==="blob:"?Se.parent:Se).location.href,_n=function(t,e){if(!(/^file:/.test(i=t.url)||/^file:/.test(mn())&&!/^\w+:/.test(i))){if(Se.fetch&&Se.Request&&Se.AbortController&&Se.Request.prototype.hasOwnProperty("signal"))return function(n,s){const c=new Se.AbortController,u=new Se.Request(n.url,{method:n.method||"GET",body:n.body,credentials:n.credentials,headers:n.headers,referrer:mn(),referrerPolicy:n.referrerPolicy,signal:c.signal});let p=!1,m=!1;const _=(x=u.url).indexOf("sku=")>0&&ne(x);var x;n.type==="json"&&u.headers.set("Accept","application/json");const b=(S,M,C)=>{if(m)return;if(S&&S.message!=="SecurityError"&&Ut(S.toString()),M&&C)return w(M);const D=Date.now();Se.fetch(u).then(U=>{if(U.ok){const q=_?U.clone():null;return w(U,q,D)}return s(new Hr(U.statusText,U.status,n.url))}).catch(U=>{U.name!=="AbortError"&&s(new Error(`${U.message} ${n.url}`))})},w=(S,M,C)=>{(n.type==="arrayBuffer"?S.arrayBuffer():n.type==="json"?S.json():S.text()).then(D=>{m||(M&&C&&function(U,q,V){if(pn(),!Vi)return;const $={status:q.status,statusText:q.statusText,headers:new Se.Headers};q.headers.forEach((ce,se)=>$.headers.set(se,ce));const X=Ri(q.headers.get("Cache-Control")||"");if(X["no-store"])return;X["max-age"]&&$.headers.set("Expires",new Date(V+1e3*X["max-age"]).toUTCString());const W=$.headers.get("Expires");W&&(new Date(W).getTime()-V<42e4||function(ce,se){if(Xr===void 0)try{new Response(new ReadableStream),Xr=!0}catch{Xr=!1}Xr?se(ce.body):ce.blob().then(se)}(q,ce=>{const se=new Se.Response(ce,$);pn(),Vi&&Vi.then(me=>me.put(Gn(U.url),se)).catch(me=>Ut(me.message))}))}(u,M,C),p=!0,s(null,D,S.headers.get("Cache-Control"),S.headers.get("Expires")))}).catch(D=>{m||s(new Error(D.message))})};return _?function(S,M){if(pn(),!Vi)return M(null);const C=Gn(S.url);Vi.then(D=>{D.match(C).then(U=>{const q=function(V){if(!V)return!1;const $=new Date(V.headers.get("Expires")||0),X=Ri(V.headers.get("Cache-Control")||"");return $>Date.now()&&!X["no-cache"]}(U);D.delete(C),q&&D.put(C,U.clone()),M(null,U,q)}).catch(M)}).catch(M)}(u,b):b(null,null),{cancel:()=>{m=!0,p||c.abort()}}}(t,e);if(Tr()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var i;return function(n,s){const c=new Se.XMLHttpRequest;c.open(n.method||"GET",n.url,!0),n.type==="arrayBuffer"&&(c.responseType="arraybuffer");for(const u in n.headers)c.setRequestHeader(u,n.headers[u]);return n.type==="json"&&(c.responseType="text",c.setRequestHeader("Accept","application/json")),c.withCredentials=n.credentials==="include",c.onerror=()=>{s(new Error(c.statusText))},c.onload=()=>{if((c.status>=200&&c.status<300||c.status===0)&&c.response!==null){let u=c.response;if(n.type==="json")try{u=JSON.parse(c.response)}catch(p){return s(p)}s(null,u,c.getResponseHeader("Cache-Control"),c.getResponseHeader("Expires"))}else s(new Hr(c.statusText,c.status,n.url))},c.send(n.body),{cancel:()=>c.abort()}}(t,e)},$n=function(t,e){return _n(Wt(t,{type:"arrayBuffer"}),e)};function Ts(t){const e=Se.document.createElement("a");return e.href=t,e.protocol===Se.document.location.protocol&&e.host===Se.document.location.host}const Z="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let z,P;z=[],P=0;const G=function(t,e){if(ht.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),P>=it.MAX_PARALLEL_IMAGE_REQUESTS){const c={requestParameters:t,callback:e,cancelled:!1,cancel(){this.cancelled=!0}};return z.push(c),c}P++;let i=!1;const n=()=>{if(!i)for(i=!0,P--;z.length&&P{n(),c?e(c):u&&(Se.createImageBitmap?function(_,x){const b=new Se.Blob([new Uint8Array(_)],{type:"image/png"});Se.createImageBitmap(b).then(w=>{x(null,w)}).catch(w=>{x(new Error(`Could not load image because of ${w.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})}(u,(_,x)=>e(_,x,p,m)):function(_,x){const b=new Se.Image,w=Se.URL;b.onload=()=>{x(null,b),w.revokeObjectURL(b.src),b.onload=null,Se.requestAnimationFrame(()=>{b.src=Z})},b.onerror=()=>x(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 S=new Se.Blob([new Uint8Array(_)],{type:"image/png"});b.src=_.byteLength?w.createObjectURL(S):Z}(u,(_,x)=>e(_,x,p,m)))});return{cancel:()=>{s.cancel(),n()}}},H="NO_ACCESS_TOKEN";function ee(t){return t.indexOf("mapbox:")===0}function ne(t){return it.API_URL_REGEX.test(t)}function re(t){return it.API_CDN_URL_REGEX.test(t)}function Q(t){return it.API_STYLE_REGEX.test(t)&&!de(t)}function de(t){return it.API_SPRITE_REGEX.test(t)}const Pe=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function ke(t){const e=t.match(Pe);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function Ie(t){const e=t.params.length?`?${t.params.join("&")}`:"";return`${t.protocol}://${t.authority}${t.path}${e}`}const Je="mapbox.eventData";function rt(t){if(!t)return null;const e=t.split(".");if(!e||e.length!==3)return null;try{return JSON.parse(decodeURIComponent(Se.atob(e[1]).split("").map(i=>"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)).join("")))}catch{return null}}class Qe{constructor(e){this.type=e,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null}getStorageKey(e){const i=rt(it.ACCESS_TOKEN);let n="";return n=i&&i.u?Se.btoa(encodeURIComponent(i.u).replace(/%([0-9A-F]{2})/g,(s,c)=>String.fromCharCode(+("0x"+c)))):it.ACCESS_TOKEN||"",e?`${Je}.${e}:${n}`:`${Je}:${n}`}fetchEventData(){const e=Ao("localStorage"),i=this.getStorageKey(),n=this.getStorageKey("uuid");if(e)try{const s=Se.localStorage.getItem(i);s&&(this.eventData=JSON.parse(s));const c=Se.localStorage.getItem(n);c&&(this.anonId=c)}catch{Ut("Unable to read from LocalStorage")}}saveEventData(){const e=Ao("localStorage"),i=this.getStorageKey(),n=this.getStorageKey("uuid");if(e)try{Se.localStorage.setItem(n,this.anonId),Object.keys(this.eventData).length>=1&&Se.localStorage.setItem(i,JSON.stringify(this.eventData))}catch{Ut("Unable to write to LocalStorage")}}processRequests(e){}postEvent(e,i,n,s){if(!it.EVENTS_URL)return;const c=ke(it.EVENTS_URL);c.params.push(`access_token=${s||it.ACCESS_TOKEN||""}`);const u={event:this.type,created:new Date(e).toISOString()},p=i?Wt(u,i):u,m={url:Ie(c),headers:{"Content-Type":"text/plain"},body:JSON.stringify([p])};this.pendingRequest=function(_,x){return _n(Wt(_,{method:"POST"}),x)}(m,_=>{this.pendingRequest=null,n(_),this.saveEventData(),this.processRequests(s)})}queueRequest(e,i){this.queue.push(e),this.processRequests(i)}}const nt=new class extends Qe{constructor(t){super("appUserTurnstile"),this._customAccessToken=t}postTurnstileEvent(t,e){it.EVENTS_URL&&it.ACCESS_TOKEN&&Array.isArray(t)&&t.some(i=>ee(i)||ne(i))&&this.queueRequest(Date.now(),e)}processRequests(t){if(this.pendingRequest||this.queue.length===0)return;this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const e=rt(it.ACCESS_TOKEN),i=e?e.u:it.ACCESS_TOKEN;let n=i!==this.eventData.tokenU;xs(this.anonId)||(this.anonId=qr(),n=!0);const s=this.queue.shift();if(this.eventData.lastSuccess){const c=new Date(this.eventData.lastSuccess),u=new Date(s),p=(s-this.eventData.lastSuccess)/864e5;n=n||p>=1||p<-1||c.getDate()!==u.getDate()}else n=!0;n?this.postEvent(s,{sdkIdentifier:"mapbox-gl-js",sdkVersion:xr,skuId:Rn,"enabled.telemetry":!1,userId:this.anonId},c=>{c||(this.eventData.lastSuccess=s,this.eventData.tokenU=i)},t):this.processRequests()}},ft=nt.postTurnstileEvent.bind(nt),Vt=new class extends Qe{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(t,e,i,n){this.skuToken=e,this.errorCb=n,it.EVENTS_URL&&(i||it.ACCESS_TOKEN?this.queueRequest({id:t,timestamp:Date.now()},i):this.errorCb(new Error(H)))}processRequests(t){if(this.pendingRequest||this.queue.length===0)return;const{id:e,timestamp:i}=this.queue.shift();e&&this.success[e]||(this.anonId||this.fetchEventData(),xs(this.anonId)||(this.anonId=qr()),this.postEvent(i,{sdkIdentifier:"mapbox-gl-js",sdkVersion:xr,skuId:Rn,skuToken:this.skuToken,userId:this.anonId},n=>{n?this.errorCb(n):e&&(this.success[e]=!0)},t))}},Xt=Vt.postMapLoadEvent.bind(Vt),yi=new class extends Qe{constructor(){super("gljs.performance")}postPerformanceEvent(t,e){it.EVENTS_URL&&(t||it.ACCESS_TOKEN)&&this.queueRequest({timestamp:Date.now(),performanceData:e},t)}processRequests(t){if(this.pendingRequest||this.queue.length===0)return;const{timestamp:e,performanceData:i}=this.queue.shift(),n=function(s){const c=Se.performance.getEntriesByType("resource"),u=Se.performance.getEntriesByType("mark"),p=function(w){const S={};if(w){for(const M in w)if(M!=="other")for(const C of w[M]){const D=`${M}ResolveRangeMin`,U=`${M}ResolveRangeMax`,q=`${M}RequestCount`,V=`${M}RequestCachedCount`;S[D]=Math.min(S[D]||1/0,C.startTime),S[U]=Math.max(S[U]||-1/0,C.responseEnd);const $=X=>{S[X]===void 0&&(S[X]=0),++S[X]};C.transferSize!==void 0&&C.transferSize===0&&$(V),$(q)}}return S}(function(w,S){const M={};if(w)for(const C of w){const D=S(C);M[D]===void 0&&(M[D]=[]),M[D].push(C)}return M}(c,tc)),m=Se.devicePixelRatio,_=Se.navigator.connection||Se.navigator.mozConnection||Se.navigator.webkitConnection,x={counters:[],metadata:[],attributes:[]},b=(w,S,M)=>{M!=null&&w.push({name:S,value:M.toString()})};for(const w in p)b(x.counters,w,p[w]);if(s.interactionRange[0]!==1/0&&s.interactionRange[1]!==-1/0&&(b(x.counters,"interactionRangeMin",s.interactionRange[0]),b(x.counters,"interactionRangeMax",s.interactionRange[1])),u)for(const w of Object.keys(Zn)){const S=Zn[w],M=u.find(C=>C.name===S);M&&b(x.counters,S,M.startTime)}return b(x.counters,"visibilityHidden",s.visibilityHidden),b(x.attributes,"style",function(w){if(w)for(const S of w){const M=S.name.split("?")[0];if(Q(M)){const C=M.split("/").slice(-2);if(C.length===2)return`mapbox://styles/${C[0]}/${C[1]}`}}}(c)),b(x.attributes,"terrainEnabled",s.terrainEnabled?"true":"false"),b(x.attributes,"fogEnabled",s.fogEnabled?"true":"false"),b(x.attributes,"projection",s.projection),b(x.attributes,"zoom",s.zoom),b(x.metadata,"devicePixelRatio",m),b(x.metadata,"connectionEffectiveType",_?_.effectiveType:void 0),b(x.metadata,"navigatorUserAgent",Se.navigator.userAgent),b(x.metadata,"screenWidth",Se.screen.width),b(x.metadata,"screenHeight",Se.screen.height),b(x.metadata,"windowWidth",Se.innerWidth),b(x.metadata,"windowHeight",Se.innerHeight),b(x.metadata,"mapWidth",s.width/m),b(x.metadata,"mapHeight",s.height/m),b(x.metadata,"webglRenderer",s.renderer),b(x.metadata,"webglVendor",s.vendor),b(x.metadata,"sdkVersion",xr),b(x.metadata,"sdkIdentifier","mapbox-gl-js"),x}(i);for(const s of n.metadata);for(const s of n.counters);for(const s of n.attributes);this.postEvent(e,n,()=>{},t)}},ri=yi.postPerformanceEvent.bind(yi),sr=new class extends Qe{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(t,e,i,n){if(!it.API_URL||!it.SESSION_PATH)return;const s=ke(it.API_URL+it.SESSION_PATH);s.params.push(`sku=${e||""}`),s.params.push(`access_token=${n||it.ACCESS_TOKEN||""}`);const c={url:Ie(s),headers:{"Content-Type":"text/plain"}};this.pendingRequest=function(u,p){return _n(Wt(u,{method:"GET"}),p)}(c,u=>{this.pendingRequest=null,i(u),this.saveEventData(),this.processRequests(n)})}getSessionAPI(t,e,i,n){this.skuToken=e,this.errorCb=n,it.SESSION_PATH&&it.API_URL&&(i||it.ACCESS_TOKEN?this.queueRequest({id:t,timestamp:Date.now()},i):this.errorCb(new Error(H)))}processRequests(t){if(this.pendingRequest||this.queue.length===0)return;const{id:e,timestamp:i}=this.queue.shift();e&&this.success[e]||this.getSession(i,this.skuToken,n=>{n?this.errorCb(n):e&&(this.success[e]=!0)},t)}},li=sr.getSessionAPI.bind(sr),Ti=new Set,Zn={create:"create",load:"load",fullLoad:"fullLoad"},Ah={mark(t){Se.performance.mark(t)},measure(t,e,i){Se.performance.measure(t,e,i)}};function tc(t){const e=t.name.split("?")[0];return re(e)&&e.includes("mapbox-gl.js")?"javascript":re(e)&&e.includes("mapbox-gl.css")?"css":function(i){return it.API_FONTS_REGEX.test(i)}(e)?"fontRange":de(e)?"sprite":Q(e)?"style":function(i){return it.API_TILEJSON_REGEX.test(i)}(e)?"tilejson":"other"}const vt=Se.performance;function Ea(t){const e=t?t.url.toString():void 0;return vt.getEntriesByName(e)}let zo,Sa,Es,ar;const Er={now:()=>Es!==void 0?Es:Se.performance.now(),setNow(t){Es=t},restoreNow(){Es=void 0},frame(t){const e=Se.requestAnimationFrame(t);return{cancel:()=>Se.cancelAnimationFrame(e)}},getImageData(t,e=0){const{width:i,height:n}=t;ar||(ar=Se.document.createElement("canvas"));const s=ar.getContext("2d",{willReadFrequently:!0});if(!s)throw new Error("failed to create canvas 2d context");return(i>ar.width||n>ar.height)&&(ar.width=i,ar.height=n),s.clearRect(-e,-e,i+2*e,n+2*e),s.drawImage(t,0,0,i,n),s.getImageData(-e,-e,i+2*e,n+2*e)},resolveURL:t=>(zo||(zo=Se.document.createElement("a")),zo.href=t,zo.href),get devicePixelRatio(){return Se.devicePixelRatio},get prefersReducedMotion(){return!!Se.matchMedia&&(Sa==null&&(Sa=Se.matchMedia("(prefers-reduced-motion: reduce)")),Sa.matches)}};function Ma(t,e,i){i[t]&&i[t].indexOf(e)!==-1||(i[t]=i[t]||[],i[t].push(e))}function Aa(t,e,i){if(i&&i[t]){const n=i[t].indexOf(e);n!==-1&&i[t].splice(n,1)}}class gn{constructor(e,i={}){Wt(this,i),this.type=e}}class Sr extends gn{constructor(e,i={}){super("error",Wt({error:e},i))}}class Po{on(e,i){return this._listeners=this._listeners||{},Ma(e,i,this._listeners),this}off(e,i){return Aa(e,i,this._listeners),Aa(e,i,this._oneTimeListeners),this}once(e,i){return i?(this._oneTimeListeners=this._oneTimeListeners||{},Ma(e,i,this._oneTimeListeners),this):new Promise(n=>this.once(e,n))}fire(e,i){typeof e=="string"&&(e=new gn(e,i||{}));const n=e.type;if(this.listens(n)){e.target=this;const s=this._listeners&&this._listeners[n]?this._listeners[n].slice():[];for(const p of s)p.call(this,e);const c=this._oneTimeListeners&&this._oneTimeListeners[n]?this._oneTimeListeners[n].slice():[];for(const p of c)Aa(n,p,this._oneTimeListeners),p.call(this,e);const u=this._eventedParent;u&&(Wt(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),u.fire(e))}else e instanceof Sr&&console.error(e.error);return this}listens(e){return!!(this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e))}setEventedParent(e,i){return this._eventedParent=e,this._eventedParentData=i,this}}var fe=JSON.parse('{"$version":8,"$root":{"version":{"required":true,"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"},"terrain":{"type":"terrain"},"fog":{"type":"fog"},"sources":{"required":true,"type":"sources"},"sprite":{"type":"string"},"glyphs":{"type":"string"},"transition":{"type":"transition"},"projection":{"type":"projection"},"layers":{"required":true,"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":true,"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":{}},"default":"xyz"},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"attribution":{"type":"string"},"promoteId":{"type":"promoteId"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster":{"type":{"required":true,"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":false},"*":{"type":"*"}},"source_raster_dem":{"type":{"required":true,"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":{}},"default":"mapbox"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_geojson":{"type":{"required":true,"type":"enum","values":{"geojson":{}}},"data":{"type":"*"},"maxzoom":{"type":"number","default":18},"attribution":{"type":"string"},"buffer":{"type":"number","default":128,"maximum":512,"minimum":0},"filter":{"type":"*"},"tolerance":{"type":"number","default":0.375},"cluster":{"type":"boolean","default":false},"clusterRadius":{"type":"number","default":50,"minimum":0},"clusterMaxZoom":{"type":"number"},"clusterMinPoints":{"type":"number"},"clusterProperties":{"type":"*"},"lineMetrics":{"type":"boolean","default":false},"generateId":{"type":"boolean","default":false},"promoteId":{"type":"promoteId"}},"source_video":{"type":{"required":true,"type":"enum","values":{"video":{}}},"urls":{"required":true,"type":"array","value":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_image":{"type":{"required":true,"type":"enum","values":{"image":{}}},"url":{"required":true,"type":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"layer":{"id":{"type":"string","required":true},"type":{"type":"enum","values":{"fill":{},"line":{},"symbol":{},"circle":{},"heatmap":{},"fill-extrusion":{},"raster":{},"hillshade":{},"background":{},"sky":{}},"required":true},"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_sky"],"layout_background":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_sky":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_fill":{"fill-sort-key":{"type":"number","expression":{"interpolated":false,"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":false,"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"},"fill-extrusion-edge-radius":{"type":"number","private":true,"default":0,"minimum":0,"maximum":1,"property-type":"constant"}},"layout_line":{"line-cap":{"type":"enum","values":{"butt":{},"round":{},"square":{}},"default":"butt","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-join":{"type":"enum","values":{"bevel":{},"round":{},"miter":{}},"default":"miter","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{"type":"number","default":2,"requires":[{"line-join":"miter"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-round-limit":{"type":"number","default":1.05,"requires":[{"line-join":"round"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-sort-key":{"type":"number","expression":{"interpolated":false,"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":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-spacing":{"type":"number","default":250,"minimum":1,"units":"pixels","requires":[{"symbol-placement":"line"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{"type":"boolean","default":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{"type":"enum","values":{"auto":{},"viewport-y":{},"source":{}},"default":"auto","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{"type":"boolean","default":false,"requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{"type":"boolean","default":false,"requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-optional":{"type":"boolean","default":false,"requires":["icon-image","text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"],"expression":{"interpolated":false,"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":true,"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":false,"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":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-image":{"type":"resolvedImage","tokens":true,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{"type":"number","default":0,"period":360,"units":"degrees","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{"type":"boolean","default":false,"requires":["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-offset":{"type":"array","value":"number","length":2,"default":[0,0],"requires":["icon-image"],"expression":{"interpolated":true,"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":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-field":{"type":"formatted","default":"","tokens":true,"expression":{"interpolated":false,"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":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size":{"type":"number","default":16,"minimum":0,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{"type":"number","default":10,"minimum":0,"units":"ems","requires":["text-field",{"symbol-placement":["point"]}],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{"type":"number","default":1.2,"units":"ems","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{"type":"number","default":0,"units":"ems","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-justify":{"type":"enum","values":{"auto":{},"left":{},"center":{},"right":{}},"default":"center","requires":["text-field"],"expression":{"interpolated":false,"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":true,"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":false,"parameters":["zoom"]},"property-type":"data-constant"},"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":false,"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":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-writing-mode":{"type":"array","value":"enum","values":{"horizontal":{},"vertical":{}},"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotate":{"type":"number","default":0,"period":360,"units":"degrees","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-keep-upright":{"type":"boolean","default":true,"requires":["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-transform":{"type":"enum","values":{"none":{},"uppercase":{},"lowercase":{}},"default":"none","requires":["text-field"],"expression":{"interpolated":false,"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":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{"type":"boolean","default":false,"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{"type":"boolean","default":false,"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-optional":{"type":"boolean","default":false,"requires":["text-field","icon-image"],"expression":{"interpolated":false,"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_symbol":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature","pitch","distance-from-center"]}},"filter_fill":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_line":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_circle":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_fill-extrusion":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_heatmap":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_operator":{"type":"enum","values":{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},"in":{},"!in":{},"all":{},"any":{},"none":{},"has":{},"!has":{},"within":{}}},"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":false}},"function_stop":{"type":"array","minimum":0,"maximum":24,"value":["number","color"],"length":2},"expression":{"type":"array","value":"*","minimum":1},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"high-color":{"type":"color","property-type":"data-constant","default":"#245cdf","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"space-color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"horizon-blend":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,0.2,7,0.1],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"star-intensity":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],5,0.35,6,0],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":{},"viewport":{}},"property-type":"data-constant","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"projection":{"name":{"type":"enum","values":{"albers":{},"equalEarth":{},"equirectangular":{},"lambertConformalConic":{},"mercator":{},"naturalEarth":{},"winkelTripel":{},"globe":{}},"default":"mercator","required":true},"center":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-180,-90],"maximum":[180,90],"transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]},"parallels":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-90,-90],"maximum":[90,90],"transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]}},"terrain":{"source":{"type":"string","required":true},"exaggeration":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1000,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"requires":["source"]}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"fill-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{"type":"color","transition":true,"requires":[{"!":"fill-pattern"},{"fill-antialias":true}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["fill-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"fill-extrusion-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["fill-extrusion-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"units":"meters","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"units":"meters","transition":true,"requires":["fill-extrusion-height"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant","type":"number","private":true,"default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant","type":"number","private":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"requires":["fill-extrusion-edge-radius"]},"fill-extrusion-rounded-roof":{"type":"boolean","default":true,"requires":["fill-extrusion-edge-radius"],"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_line":{"line-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"line-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["line-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"line-width":{"type":"number","default":1,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{"type":"array","value":"number","minimum":0,"transition":false,"units":"line widths","requires":[{"!":"line-pattern"}],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{"type":"color","transition":false,"requires":[{"!":"line-pattern"},{"source":"geojson","has":{"lineMetrics":true}}],"expression":{"interpolated":true,"parameters":["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{"type":"array","value":"number","length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"transition":false,"requires":[{"source":"geojson","has":{"lineMetrics":true}}],"property-type":"constant"}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["circle-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{}},"default":"viewport","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"transition":false,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"heatmap-color":{"type":"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"transition":false,"expression":{"interpolated":true,"parameters":["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_symbol":{"icon-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{"type":"color","default":"#000000","transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["icon-image","icon-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{"type":"color","default":"#000000","transition":true,"overridable":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["text-field","text-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_raster":{"raster-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{"type":"number","default":0,"period":360,"transition":true,"units":"degrees","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-resampling":{"type":"enum","values":{"linear":{},"nearest":{}},"default":"linear","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"transition":false,"units":"milliseconds","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"transition":false,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"viewport","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{"type":"number","default":0.5,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_background":{"background-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"background-pattern"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":{},"atmosphere":{}},"default":"atmosphere","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"requires":[{"sky-type":"atmosphere"}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{"type":"number","requires":[{"sky-type":"atmosphere"}],"default":10,"minimum":0,"maximum":100,"transition":false,"property-type":"data-constant"},"sky-gradient-center":{"type":"array","requires":[{"sky-type":"gradient"}],"value":"number","default":[0,0],"length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{"type":"number","requires":[{"sky-type":"gradient"}],"default":90,"minimum":0,"maximum":180,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"transition":false,"requires":[{"sky-type":"gradient"}],"expression":{"interpolated":true,"parameters":["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-atmosphere-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"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"},"color-ramp":{"type":"property-type"},"data-constant":{"type":"property-type"},"constant":{"type":"property-type"}},"promoteId":{"*":{"type":"string"}}}');function Mr(t,...e){for(const i of e)for(const n in i)t[n]=i[n];return t}function Ht(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function ci(t){if(Array.isArray(t))return t.map(ci);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){const e={};for(const i in t)e[i]=ci(t[i]);return e}return Ht(t)}class ic extends Error{constructor(e,i){super(i),this.message=i,this.key=e}}var lr=ic;class Ia{constructor(e,i=[]){this.parent=e,this.bindings={};for(const[n,s]of i)this.bindings[n]=s}concat(e){return new Ia(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}var rc=Ia;const qn={kind:"null"},Oe={kind:"number"},ut={kind:"string"},st={kind:"boolean"},Bi={kind:"color"},er={kind:"object"},at={kind:"value"},Oi={kind:"collator"},ko={kind:"formatted"},yn={kind:"resolvedImage"};function Ni(t,e){return{kind:"array",itemType:t,N:e}}function Ot(t){if(t.kind==="array"){const e=Ot(t.itemType);return typeof t.N=="number"?`array<${e}, ${t.N}>`:t.itemType.kind==="value"?"array":`array<${e}>`}return t.kind}const nc=[qn,Oe,ut,st,Bi,ko,er,Ni(at),yn];function Ar(t,e){if(e.kind==="error")return null;if(t.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!Ar(t.itemType,e.itemType))&&(typeof t.N!="number"||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if(t.kind==="value"){for(const i of nc)if(!Ar(i,e))return null}}return`Expected ${Ot(t)} but found ${Ot(e)} instead.`}function Do(t,e){return e.some(i=>i.kind===t.kind)}function Lo(t,e){return e.some(i=>i==="null"?t===null:i==="array"?Array.isArray(t):i==="object"?t&&!Array.isArray(t)&&typeof t=="object":i===typeof t)}var Ca,oc={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Ro(t){return(t=Math.round(t))<0?0:t>255?255:t}function Bo(t){return Ro(t[t.length-1]==="%"?parseFloat(t)/100*255:parseInt(t))}function Ss(t){return(e=t[t.length-1]==="%"?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e}function Wn(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}try{Ca={}.parseCSSColor=function(t){var e,i=t.replace(/ /g,"").toLowerCase();if(i in oc)return oc[i].slice();if(i[0]==="#")return i.length===4?(e=parseInt(i.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:i.length===7&&(e=parseInt(i.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var n=i.indexOf("("),s=i.indexOf(")");if(n!==-1&&s+1===i.length){var c=i.substr(0,n),u=i.substr(n+1,s-(n+1)).split(","),p=1;switch(c){case"rgba":if(u.length!==4)return null;p=Ss(u.pop());case"rgb":return u.length!==3?null:[Bo(u[0]),Bo(u[1]),Bo(u[2]),p];case"hsla":if(u.length!==4)return null;p=Ss(u.pop());case"hsl":if(u.length!==3)return null;var m=(parseFloat(u[0])%360+360)%360/360,_=Ss(u[1]),x=Ss(u[2]),b=x<=.5?x*(_+1):x+_-x*_,w=2*x-b;return[Ro(255*Wn(w,b,m+1/3)),Ro(255*Wn(w,b,m)),Ro(255*Wn(w,b,m-1/3)),p];default:return null}}return null}}catch{}class Mi{constructor(e,i,n,s=1){this.r=e,this.g=i,this.b=n,this.a=s}static parse(e){if(!e)return;if(e instanceof Mi)return e;if(typeof e!="string")return;const i=Ca(e);return i?new Mi(i[0]/255*i[3],i[1]/255*i[3],i[2]/255*i[3],i[3]):void 0}toString(){const[e,i,n,s]=this.toArray();return`rgba(${Math.round(e)},${Math.round(i)},${Math.round(n)},${s})`}toArray(){const{r:e,g:i,b:n,a:s}=this;return s===0?[0,0,0,0]:[255*e/s,255*i/s,255*n/s,s]}toArray01(){const{r:e,g:i,b:n,a:s}=this;return s===0?[0,0,0,0]:[e/s,i/s,n/s,s]}toArray01PremultipliedAlpha(){const{r:e,g:i,b:n,a:s}=this;return[e,i,n,s]}}Mi.black=new Mi(0,0,0,1),Mi.white=new Mi(1,1,1,1),Mi.transparent=new Mi(0,0,0,0),Mi.red=new Mi(1,0,0,1),Mi.blue=new Mi(0,0,1,1);var Zt=Mi;class za{constructor(e,i,n){this.sensitivity=e?i?"variant":"case":i?"accent":"base",this.locale=n,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,i){return this.collator.compare(e,i)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Pa{constructor(e,i,n,s,c){this.text=e.normalize?e.normalize():e,this.image=i,this.scale=n,this.fontStack=s,this.textColor=c}}class Ai{constructor(e){this.sections=e}static fromString(e){return new Ai([new Pa(e,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof Ai?e:Ai.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}serialize(){const e=["format"];for(const i of this.sections){if(i.image){e.push(["image",i.image.name]);continue}e.push(i.text);const n={};i.fontStack&&(n["text-font"]=["literal",i.fontStack.split(",")]),i.scale&&(n["font-scale"]=i.scale),i.textColor&&(n["text-color"]=["rgba"].concat(i.textColor.toArray())),e.push(n)}return e}}class ji{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new ji({name:e,available:!1}):null}serialize(){return["image",this.name]}}function sc(t,e,i,n){return typeof t=="number"&&t>=0&&t<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof i=="number"&&i>=0&&i<=255?n===void 0||typeof n=="number"&&n>=0&&n<=1?null:`Invalid rgba value [${[t,e,i,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof n=="number"?[t,e,i,n]:[t,e,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Oo(t){if(t===null||typeof t=="string"||typeof t=="boolean"||typeof t=="number"||t instanceof Zt||t instanceof za||t instanceof Ai||t instanceof ji)return!0;if(Array.isArray(t)){for(const e of t)if(!Oo(e))return!1;return!0}if(typeof t=="object"){for(const e in t)if(!Oo(t[e]))return!1;return!0}return!1}function Gt(t){if(t===null)return qn;if(typeof t=="string")return ut;if(typeof t=="boolean")return st;if(typeof t=="number")return Oe;if(t instanceof Zt)return Bi;if(t instanceof za)return Oi;if(t instanceof Ai)return ko;if(t instanceof ji)return yn;if(Array.isArray(t)){const e=t.length;let i;for(const n of t){const s=Gt(n);if(i){if(i===s)continue;i=at;break}i=s}return Ni(i||at,e)}return er}function Fo(t){const e=typeof t;return t===null?"":e==="string"||e==="number"||e==="boolean"?String(t):t instanceof Zt||t instanceof Ai||t instanceof ji?t.toString():JSON.stringify(t)}class ka{constructor(e,i){this.type=e,this.value=i}static parse(e,i){if(e.length!==2)return i.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!Oo(e[1]))return i.error("invalid value");const n=e[1];let s=Gt(n);const c=i.expectedType;return s.kind!=="array"||s.N!==0||!c||c.kind!=="array"||typeof c.N=="number"&&c.N!==0||(s=c),new ka(s,n)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof Zt?["rgba"].concat(this.value.toArray()):this.value instanceof Ai?this.value.serialize():this.value}}var xn=ka,fi=class{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}};const Da={string:ut,number:Oe,boolean:st,object:er};class La{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");let n,s=1;const c=e[0];if(c==="array"){let p,m;if(e.length>2){const _=e[1];if(typeof _!="string"||!(_ in Da)||_==="object")return i.error('The item type argument of "array" must be one of string, number, boolean',1);p=Da[_],s++}else p=at;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return i.error('The length argument to "array" must be a positive integer literal',2);m=e[2],s++}n=Ni(p,m)}else n=Da[c];const u=[];for(;se.outputDefined())}serialize(){const e=this.type,i=[e.kind];if(e.kind==="array"){const n=e.itemType;if(n.kind==="string"||n.kind==="number"||n.kind==="boolean"){i.push(n.kind);const s=e.N;(typeof s=="number"||this.args.length>1)&&i.push(s)}}return i.concat(this.args.map(n=>n.serialize()))}}var Ir=La;class Kr{constructor(e){this.type=ko,this.sections=e}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");const n=e[1];if(!Array.isArray(n)&&typeof n=="object")return i.error("First argument must be an image or text section.");const s=[];let c=!1;for(let u=1;u<=e.length-1;++u){const p=e[u];if(c&&typeof p=="object"&&!Array.isArray(p)){c=!1;let m=null;if(p["font-scale"]&&(m=i.parse(p["font-scale"],1,Oe),!m))return null;let _=null;if(p["text-font"]&&(_=i.parse(p["text-font"],1,Ni(ut)),!_))return null;let x=null;if(p["text-color"]&&(x=i.parse(p["text-color"],1,Bi),!x))return null;const b=s[s.length-1];b.scale=m,b.font=_,b.textColor=x}else{const m=i.parse(e[u],1,at);if(!m)return null;const _=m.type.kind;if(_!=="string"&&_!=="value"&&_!=="null"&&_!=="resolvedImage")return i.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");c=!0,s.push({content:m,scale:null,font:null,textColor:null})}}return new Kr(s)}evaluate(e){return new Ai(this.sections.map(i=>{const n=i.content.evaluate(e);return Gt(n)===yn?new Pa("",n,null,null,null):new Pa(Fo(n),null,i.scale?i.scale.evaluate(e):null,i.font?i.font.evaluate(e).join(","):null,i.textColor?i.textColor.evaluate(e):null)}))}eachChild(e){for(const i of this.sections)e(i.content),i.scale&&e(i.scale),i.font&&e(i.font),i.textColor&&e(i.textColor)}outputDefined(){return!1}serialize(){const e=["format"];for(const i of this.sections){e.push(i.content.serialize());const n={};i.scale&&(n["font-scale"]=i.scale.serialize()),i.font&&(n["text-font"]=i.font.serialize()),i.textColor&&(n["text-color"]=i.textColor.serialize()),e.push(n)}return e}}class Ms{constructor(e){this.type=yn,this.input=e}static parse(e,i){if(e.length!==2)return i.error("Expected two arguments.");const n=i.parse(e[1],1,ut);return n?new Ms(n):i.error("No image name provided.")}evaluate(e){const i=this.input.evaluate(e),n=ji.fromString(i);return n&&e.availableImages&&(n.available=e.availableImages.indexOf(i)>-1),n}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const Ih={"to-boolean":st,"to-color":Bi,"to-number":Oe,"to-string":ut};class Ra{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");const n=e[0];if((n==="to-boolean"||n==="to-string")&&e.length!==2)return i.error("Expected one argument.");const s=Ih[n],c=[];for(let u=1;u4?`Invalid rbga value ${JSON.stringify(i)}: expected an array containing either three or four numeric values.`:sc(i[0],i[1],i[2],i[3]),!n))return new Zt(i[0]/255,i[1]/255,i[2]/255,i[3])}throw new fi(n||`Could not parse color from value '${typeof i=="string"?i:String(JSON.stringify(i))}'`)}if(this.type.kind==="number"){let i=null;for(const n of this.args){if(i=n.evaluate(e),i===null)return 0;const s=Number(i);if(!isNaN(s))return s}throw new fi(`Could not convert ${JSON.stringify(i)} to number.`)}return this.type.kind==="formatted"?Ai.fromString(Fo(this.args[0].evaluate(e))):this.type.kind==="resolvedImage"?ji.fromString(Fo(this.args[0].evaluate(e))):Fo(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){if(this.type.kind==="formatted")return new Kr([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new Ms(this.args[0]).serialize();const e=[`to-${this.type.kind}`];return this.eachChild(i=>{e.push(i.serialize())}),e}}var Xn=Ra;const cr=["Unknown","Point","LineString","Polygon"];var Ba=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null}id(){return this.feature&&this.feature.id!==void 0?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?cr[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||{}}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const t=this.featureDistanceData.center,e=this.featureDistanceData.scale,{x:i,y:n}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(i*e-t[0])+this.featureDistanceData.bearing[1]*(n*e-t[1])}return 0}parseColor(t){let e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=Zt.parse(t)),e}};class vn{constructor(e,i,n,s){this.name=e,this.type=i,this._evaluate=n,this.args=s}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map(e=>e.serialize()))}static parse(e,i){const n=e[0],s=vn.definitions[n];if(!s)return i.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0);const c=Array.isArray(s)?s[0]:s.type,u=Array.isArray(s)?[[s[1],s[2]]]:s.overloads,p=u.filter(([_])=>!Array.isArray(_)||_.length===e.length-1);let m=null;for(const[_,x]of p){m=new ja(i.registry,i.path,null,i.scope);const b=[];let w=!1;for(let S=1;S{return w=b,Array.isArray(w)?`(${w.map(Ot).join(", ")})`:`(${Ot(w.type)}...)`;var w}).join(" | "),x=[];for(let b=1;b=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Vo(t,e){const i=(180+t[0])/360,n=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,s=Math.pow(2,e.z);return[Math.round(i*s*zr),Math.round(n*s*zr)]}function ac(t,e,i){const n=t[0]-e[0],s=t[1]-e[1],c=t[0]-i[0],u=t[1]-i[1];return n*u-c*s==0&&n*c<=0&&s*u<=0}function Is(t,e){let i=!1;for(let u=0,p=e.length;u(n=t)[1]!=(c=m[_+1])[1]>n[1]&&n[0]<(c[0]-s[0])*(n[1]-s[1])/(c[1]-s[1])+s[0]&&(i=!i)}}var n,s,c;return i}function Oa(t,e){for(let i=0;i0&&p<0||u<0&&p>0}function Kn(t,e,i){for(const _ of i)for(let x=0;x<_.length-1;++x)if((p=[(u=_[x+1])[0]-(c=_[x])[0],u[1]-c[1]])[0]*(m=[(s=e)[0]-(n=t)[0],s[1]-n[1]])[1]-p[1]*m[0]!=0&&Fa(n,s,c,u)&&Fa(c,u,n,s))return!0;var n,s,c,u,p,m;return!1}function bt(t,e){for(let i=0;ii[2]){const s=.5*n;let c=t[0]-i[0]>s?-n:i[0]-t[0]>s?n:0;c===0&&(c=t[0]-i[2]>s?-n:i[2]-t[0]>s?n:0),t[0]+=c}As(e,t)}function cc(t,e,i,n){const s=Math.pow(2,n.z)*zr,c=[n.x*zr,n.y*zr],u=[];if(!t)return u;for(const p of t)for(const m of p){const _=[m.x+c[0],m.y+c[1]];Va(_,e,i,s),u.push(_)}return u}function Na(t,e,i,n){const s=Math.pow(2,n.z)*zr,c=[n.x*zr,n.y*zr],u=[];if(!t)return u;for(const m of t){const _=[];for(const x of m){const b=[x.x+c[0],x.y+c[1]];As(e,b),_.push(b)}u.push(_)}if(e[2]-e[0]<=s/2){(p=e)[0]=p[1]=1/0,p[2]=p[3]=-1/0;for(const m of u)for(const _ of m)Va(_,e,i,s)}var p;return u}class Yn{constructor(e,i){this.type=st,this.geojson=e,this.geometries=i}static parse(e,i){if(e.length!==2)return i.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Oo(e[1])){const n=e[1];if(n.type==="FeatureCollection")for(let s=0;s{e&&!Jn(i)&&(e=!1)}),e}function Pr(t){if(t instanceof Cr&&t.name==="feature-state")return!1;let e=!0;return t.eachChild(i=>{e&&!Pr(i)&&(e=!1)}),e}function bn(t,e){if(t instanceof Cr&&e.indexOf(t.name)>=0)return!1;let i=!0;return t.eachChild(n=>{i&&!bn(n,e)&&(i=!1)}),i}class zs{constructor(e,i){this.type=i.type,this.name=e,this.boundExpression=i}static parse(e,i){if(e.length!==2||typeof e[1]!="string")return i.error("'var' expression requires exactly one string literal argument.");const n=e[1];return i.scope.has(n)?new zs(n,i.scope.get(n)):i.error(`Unknown variable "${n}". Make sure "${n}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}var hc=zs;class No{constructor(e,i=[],n,s=new rc,c=[]){this.registry=e,this.path=i,this.key=i.map(u=>`[${u}]`).join(""),this.scope=s,this.errors=c,this.expectedType=n}parse(e,i,n,s,c={}){return i?this.concat(i,n,s)._parse(e,c):this._parse(e,c)}_parse(e,i){function n(s,c,u){return u==="assert"?new Ir(c,[s]):u==="coerce"?new Xn(c,[s]):s}if(e!==null&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"||(e=["literal",e]),Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const s=e[0];if(typeof s!="string")return this.error(`Expression name must be a string, but found ${typeof s} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const c=this.registry[s];if(c){let u=c.parse(e,this);if(!u)return null;if(this.expectedType){const p=this.expectedType,m=u.type;if(p.kind!=="string"&&p.kind!=="number"&&p.kind!=="boolean"&&p.kind!=="object"&&p.kind!=="array"||m.kind!=="value")if(p.kind!=="color"&&p.kind!=="formatted"&&p.kind!=="resolvedImage"||m.kind!=="value"&&m.kind!=="string"){if(this.checkSubtype(p,m))return null}else u=n(u,p,i.typeAnnotation||"coerce");else u=n(u,p,i.typeAnnotation||"assert")}if(!(u instanceof xn)&&u.type.kind!=="resolvedImage"&&Ga(u)){const p=new Ba;try{u=new xn(u.type,u.evaluate(p))}catch(m){return this.error(m.message),null}}return u}return this.error(`Unknown expression "${s}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(e===void 0?"'undefined' value invalid. Use null instead.":typeof e=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,i,n){const s=typeof e=="number"?this.path.concat(e):this.path,c=n?this.scope.concat(n):this.scope;return new No(this.registry,s,i||null,c,this.errors)}error(e,...i){const n=`${this.key}${i.map(s=>`[${s}]`).join("")}`;this.errors.push(new lr(n,e))}checkSubtype(e,i){const n=Ar(e,i);return n&&this.error(n),n}}var ja=No;function Ga(t){if(t instanceof hc)return Ga(t.boundExpression);if(t instanceof Cr&&t.name==="error"||t instanceof Uo||t instanceof Cs)return!1;const e=t instanceof Xn||t instanceof Ir;let i=!0;return t.eachChild(n=>{i=e?i&&Ga(n):i&&n instanceof xn}),!!i&&Jn(t)&&bn(t,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"])}function Ps(t,e){const i=t.length-1;let n,s,c=0,u=i,p=0;for(;c<=u;)if(p=Math.floor((c+u)/2),n=t[p],s=t[p+1],n<=e){if(p===i||ee))throw new fi("Input is not a number.");u=p-1}return 0}class ks{constructor(e,i,n){this.type=e,this.input=i,this.labels=[],this.outputs=[];for(const[s,c]of n)this.labels.push(s),this.outputs.push(c)}static parse(e,i){if(e.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return i.error("Expected an even number of arguments.");const n=i.parse(e[1],1,Oe);if(!n)return null;const s=[];let c=null;i.expectedType&&i.expectedType.kind!=="value"&&(c=i.expectedType);for(let u=1;u=p)return i.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',_);const b=i.parse(m,x,c);if(!b)return null;c=c||b.type,s.push([p,b])}return new ks(c,n,s)}evaluate(e){const i=this.labels,n=this.outputs;if(i.length===1)return n[0].evaluate(e);const s=this.input.evaluate(e);if(s<=i[0])return n[0].evaluate(e);const c=i.length;return s>=i[c-1]?n[c-1].evaluate(e):n[Ps(i,s)].evaluate(e)}eachChild(e){e(this.input);for(const i of this.outputs)e(i)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}serialize(){const e=["step",this.input.serialize()];for(let i=0;i0&&e.push(this.labels[i]),e.push(this.outputs[i].serialize());return e}}var $a=ks;function mt(t,e,i){return t*(1-i)+e*i}var jo=Object.freeze({__proto__:null,array:function(t,e,i){return t.map((n,s)=>mt(n,e[s],i))},color:function(t,e,i){return new Zt(mt(t.r,e.r,i),mt(t.g,e.g,i),mt(t.b,e.b,i),mt(t.a,e.a,i))},number:mt});const uc=.95047,Za=1.08883,dc=4/29,wn=6/29,qa=3*wn*wn,zh=wn*wn*wn,Ph=Math.PI/180,kh=180/Math.PI;function Wa(t){return t>zh?Math.pow(t,1/3):t/qa+dc}function Xa(t){return t>wn?t*t*t:qa*(t-dc)}function Ha(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Ds(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function pc(t){const e=Ds(t.r),i=Ds(t.g),n=Ds(t.b),s=Wa((.4124564*e+.3575761*i+.1804375*n)/uc),c=Wa((.2126729*e+.7151522*i+.072175*n)/1);return{l:116*c-16,a:500*(s-c),b:200*(c-Wa((.0193339*e+.119192*i+.9503041*n)/Za)),alpha:t.a}}function fc(t){let e=(t.l+16)/116,i=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*Xa(e),i=uc*Xa(i),n=Za*Xa(n),new Zt(Ha(3.2404542*i-1.5371385*e-.4985314*n),Ha(-.969266*i+1.8760108*e+.041556*n),Ha(.0556434*i-.2040259*e+1.0572252*n),t.alpha)}function Dh(t,e,i){const n=e-t;return t+i*(n>180||n<-180?n-360*Math.round(n/360):n)}const Go={forward:pc,reverse:fc,interpolate:function(t,e,i){return{l:mt(t.l,e.l,i),a:mt(t.a,e.a,i),b:mt(t.b,e.b,i),alpha:mt(t.alpha,e.alpha,i)}}},Qn={forward:function(t){const{l:e,a:i,b:n}=pc(t),s=Math.atan2(n,i)*kh;return{h:s<0?s+360:s,c:Math.sqrt(i*i+n*n),l:e,alpha:t.a}},reverse:function(t){const e=t.h*Ph,i=t.c;return fc({l:t.l,a:Math.cos(e)*i,b:Math.sin(e)*i,alpha:t.alpha})},interpolate:function(t,e,i){return{h:Dh(t.h,e.h,i),c:mt(t.c,e.c,i),l:mt(t.l,e.l,i),alpha:mt(t.alpha,e.alpha,i)}}};var Ka=Object.freeze({__proto__:null,hcl:Qn,lab:Go});class $o{constructor(e,i,n,s,c){this.type=e,this.operator=i,this.interpolation=n,this.input=s,this.labels=[],this.outputs=[];for(const[u,p]of c)this.labels.push(u),this.outputs.push(p)}static interpolationFactor(e,i,n,s){let c=0;if(e.name==="exponential")c=Ya(i,e.base,n,s);else if(e.name==="linear")c=Ya(i,1,n,s);else if(e.name==="cubic-bezier"){const u=e.controlPoints;c=new hn(u[0],u[1],u[2],u[3]).solve(Ya(i,1,n,s))}return c}static parse(e,i){let[n,s,c,...u]=e;if(!Array.isArray(s)||s.length===0)return i.error("Expected an interpolation type expression.",1);if(s[0]==="linear")s={name:"linear"};else if(s[0]==="exponential"){const _=s[1];if(typeof _!="number")return i.error("Exponential interpolation requires a numeric base.",1,1);s={name:"exponential",base:_}}else{if(s[0]!=="cubic-bezier")return i.error(`Unknown interpolation type ${String(s[0])}`,1,0);{const _=s.slice(1);if(_.length!==4||_.some(x=>typeof x!="number"||x<0||x>1))return i.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);s={name:"cubic-bezier",controlPoints:_}}}if(e.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return i.error("Expected an even number of arguments.");if(c=i.parse(c,2,Oe),!c)return null;const p=[];let m=null;n==="interpolate-hcl"||n==="interpolate-lab"?m=Bi:i.expectedType&&i.expectedType.kind!=="value"&&(m=i.expectedType);for(let _=0;_=x)return i.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',w);const M=i.parse(b,S,m);if(!M)return null;m=m||M.type,p.push([x,M])}return m.kind==="number"||m.kind==="color"||m.kind==="array"&&m.itemType.kind==="number"&&typeof m.N=="number"?new $o(m,n,s,c,p):i.error(`Type ${Ot(m)} is not interpolatable.`)}evaluate(e){const i=this.labels,n=this.outputs;if(i.length===1)return n[0].evaluate(e);const s=this.input.evaluate(e);if(s<=i[0])return n[0].evaluate(e);const c=i.length;if(s>=i[c-1])return n[c-1].evaluate(e);const u=Ps(i,s),p=$o.interpolationFactor(this.interpolation,s,i[u],i[u+1]),m=n[u].evaluate(e),_=n[u+1].evaluate(e);return this.operator==="interpolate"?jo[this.type.kind.toLowerCase()](m,_,p):this.operator==="interpolate-hcl"?Qn.reverse(Qn.interpolate(Qn.forward(m),Qn.forward(_),p)):Go.reverse(Go.interpolate(Go.forward(m),Go.forward(_),p))}eachChild(e){e(this.input);for(const i of this.outputs)e(i)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}serialize(){let e;e=this.interpolation.name==="linear"?["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const i=[this.operator,e,this.input.serialize()];for(let n=0;nAr(s,p.type));return new Ls(u?at:n,c)}evaluate(e){let i,n=null,s=0;for(const c of this.args){if(s++,n=c.evaluate(e),n&&n instanceof ji&&!n.available&&(i||(i=n),n=null,s===this.args.length))return i;if(n!==null)break}return n}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){const e=["coalesce"];return this.eachChild(i=>{e.push(i.serialize())}),e}}var Ja=Ls;class Rs{constructor(e,i){this.type=i.type,this.bindings=[].concat(e),this.result=i}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const i of this.bindings)e(i[1]);e(this.result)}static parse(e,i){if(e.length<4)return i.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const n=[];for(let c=1;c=n.length)throw new fi(`Array index out of bounds: ${i} > ${n.length-1}.`);if(i!==Math.floor(i))throw new fi(`Array index must be an integer, but found ${i} instead.`);return n[i]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}var Lh=Qa;class el{constructor(e,i){this.type=st,this.needle=e,this.haystack=i}static parse(e,i){if(e.length!==3)return i.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const n=i.parse(e[1],1,at),s=i.parse(e[2],2,at);return n&&s?Do(n.type,[st,ut,Oe,qn,at])?new el(n,s):i.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ot(n.type)} instead`):null}evaluate(e){const i=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(n==null)return!1;if(!Lo(i,["boolean","string","number","null"]))throw new fi(`Expected first argument to be of type boolean, string, number or null, but found ${Ot(Gt(i))} instead.`);if(!Lo(n,["string","array"]))throw new fi(`Expected second argument to be of type array or string, but found ${Ot(Gt(n))} instead.`);return n.indexOf(i)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}var Bs=el;class Zo{constructor(e,i,n){this.type=Oe,this.needle=e,this.haystack=i,this.fromIndex=n}static parse(e,i){if(e.length<=2||e.length>=5)return i.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const n=i.parse(e[1],1,at),s=i.parse(e[2],2,at);if(!n||!s)return null;if(!Do(n.type,[st,ut,Oe,qn,at]))return i.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ot(n.type)} instead`);if(e.length===4){const c=i.parse(e[3],3,Oe);return c?new Zo(n,s,c):null}return new Zo(n,s)}evaluate(e){const i=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!Lo(i,["boolean","string","number","null"]))throw new fi(`Expected first argument to be of type boolean, string, number or null, but found ${Ot(Gt(i))} instead.`);if(!Lo(n,["string","array"]))throw new fi(`Expected second argument to be of type array or string, but found ${Ot(Gt(n))} instead.`);if(this.fromIndex){const s=this.fromIndex.evaluate(e);return n.indexOf(i,s)}return n.indexOf(i)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}serialize(){if(this.fromIndex!=null&&this.fromIndex!==void 0){const e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}var _c=Zo;class tl{constructor(e,i,n,s,c,u){this.inputType=e,this.type=i,this.input=n,this.cases=s,this.outputs=c,this.otherwise=u}static parse(e,i){if(e.length<5)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return i.error("Expected an even number of arguments.");let n,s;i.expectedType&&i.expectedType.kind!=="value"&&(s=i.expectedType);const c={},u=[];for(let _=2;_Number.MAX_SAFE_INTEGER)return w.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof M=="number"&&Math.floor(M)!==M)return w.error("Numeric branch labels must be integer values.");if(n){if(w.checkSubtype(n,Gt(M)))return null}else n=Gt(M);if(c[String(M)]!==void 0)return w.error("Branch labels must be unique.");c[String(M)]=u.length}const S=i.parse(b,_,s);if(!S)return null;s=s||S.type,u.push(S)}const p=i.parse(e[1],1,at);if(!p)return null;const m=i.parse(e[e.length-1],e.length-1,s);return m?p.type.kind!=="value"&&i.concat(1).checkSubtype(n,p.type)?null:new tl(n,s,p,c,u,m):null}evaluate(e){const i=this.input.evaluate(e);return(Gt(i)===this.inputType&&this.outputs[this.cases[i]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}serialize(){const e=["match",this.input.serialize()],i=Object.keys(this.cases).sort(),n=[],s={};for(const u of i){const p=s[this.cases[u]];p===void 0?(s[this.cases[u]]=n.length,n.push([this.cases[u],[u]])):n[p][1].push(u)}const c=u=>this.inputType.kind==="number"?Number(u):u;for(const[u,p]of n)e.push(p.length===1?c(p[0]):p.map(c)),e.push(this.outputs[u].serialize());return e.push(this.otherwise.serialize()),e}}var Rh=tl;class il{constructor(e,i,n){this.type=e,this.branches=i,this.otherwise=n}static parse(e,i){if(e.length<4)return i.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return i.error("Expected an odd number of arguments.");let n;i.expectedType&&i.expectedType.kind!=="value"&&(n=i.expectedType);const s=[];for(let u=1;ui.outputDefined())&&this.otherwise.outputDefined()}serialize(){const e=["case"];return this.eachChild(i=>{e.push(i.serialize())}),e}}var gc=il;class qo{constructor(e,i,n,s){this.type=e,this.input=i,this.beginIndex=n,this.endIndex=s}static parse(e,i){if(e.length<=2||e.length>=5)return i.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const n=i.parse(e[1],1,at),s=i.parse(e[2],2,Oe);if(!n||!s)return null;if(!Do(n.type,[Ni(at),ut,at]))return i.error(`Expected first argument to be of type array or string, but found ${Ot(n.type)} instead`);if(e.length===4){const c=i.parse(e[3],3,Oe);return c?new qo(n.type,n,s,c):null}return new qo(n.type,n,s)}evaluate(e){const i=this.input.evaluate(e),n=this.beginIndex.evaluate(e);if(!Lo(i,["string","array"]))throw new fi(`Expected first argument to be of type array or string, but found ${Ot(Gt(i))} instead.`);if(this.endIndex){const s=this.endIndex.evaluate(e);return i.slice(n,s)}return i.slice(n)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}serialize(){if(this.endIndex!=null&&this.endIndex!==void 0){const e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}var yc=qo;function Os(t,e){return t==="=="||t==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function xc(t,e,i,n){return n.compare(e,i)===0}function eo(t,e,i){const n=t!=="=="&&t!=="!=";return class Ff{constructor(c,u,p){this.type=st,this.lhs=c,this.rhs=u,this.collator=p,this.hasUntypedArgument=c.type.kind==="value"||u.type.kind==="value"}static parse(c,u){if(c.length!==3&&c.length!==4)return u.error("Expected two or three arguments.");const p=c[0];let m=u.parse(c[1],1,at);if(!m)return null;if(!Os(p,m.type))return u.concat(1).error(`"${p}" comparisons are not supported for type '${Ot(m.type)}'.`);let _=u.parse(c[2],2,at);if(!_)return null;if(!Os(p,_.type))return u.concat(2).error(`"${p}" comparisons are not supported for type '${Ot(_.type)}'.`);if(m.type.kind!==_.type.kind&&m.type.kind!=="value"&&_.type.kind!=="value")return u.error(`Cannot compare types '${Ot(m.type)}' and '${Ot(_.type)}'.`);n&&(m.type.kind==="value"&&_.type.kind!=="value"?m=new Ir(_.type,[m]):m.type.kind!=="value"&&_.type.kind==="value"&&(_=new Ir(m.type,[_])));let x=null;if(c.length===4){if(m.type.kind!=="string"&&_.type.kind!=="string"&&m.type.kind!=="value"&&_.type.kind!=="value")return u.error("Cannot use collator to compare non-string types.");if(x=u.parse(c[3],3,Oi),!x)return null}return new Ff(m,_,x)}evaluate(c){const u=this.lhs.evaluate(c),p=this.rhs.evaluate(c);if(n&&this.hasUntypedArgument){const m=Gt(u),_=Gt(p);if(m.kind!==_.kind||m.kind!=="string"&&m.kind!=="number")throw new fi(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${m.kind}, ${_.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const m=Gt(u),_=Gt(p);if(m.kind!=="string"||_.kind!=="string")return e(c,u,p)}return this.collator?i(c,u,p,this.collator.evaluate(c)):e(c,u,p)}eachChild(c){c(this.lhs),c(this.rhs),this.collator&&c(this.collator)}outputDefined(){return!0}serialize(){const c=[t];return this.eachChild(u=>{c.push(u.serialize())}),c}}}const Bh=eo("==",function(t,e,i){return e===i},xc),Oh=eo("!=",function(t,e,i){return e!==i},function(t,e,i,n){return!xc(0,e,i,n)}),Fh=eo("<",function(t,e,i){return e",function(t,e,i){return e>i},function(t,e,i,n){return n.compare(e,i)>0}),Vh=eo("<=",function(t,e,i){return e<=i},function(t,e,i,n){return n.compare(e,i)<=0}),vc=eo(">=",function(t,e,i){return e>=i},function(t,e,i,n){return n.compare(e,i)>=0});class Fs{constructor(e,i,n,s,c,u){this.type=ut,this.number=e,this.locale=i,this.currency=n,this.unit=s,this.minFractionDigits=c,this.maxFractionDigits=u}static parse(e,i){if(e.length!==3)return i.error("Expected two arguments.");const n=i.parse(e[1],1,Oe);if(!n)return null;const s=e[2];if(typeof s!="object"||Array.isArray(s))return i.error("NumberFormat options argument must be an object.");let c=null;if(s.locale&&(c=i.parse(s.locale,1,ut),!c))return null;let u=null;if(s.currency&&(u=i.parse(s.currency,1,ut),!u))return null;let p=null;if(s.unit&&(p=i.parse(s.unit,1,ut),!p))return null;let m=null;if(s["min-fraction-digits"]&&(m=i.parse(s["min-fraction-digits"],1,Oe),!m))return null;let _=null;return s["max-fraction-digits"]&&(_=i.parse(s["max-fraction-digits"],1,Oe),!_)?null:new Fs(n,c,u,p,m,_)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.unit&&(e.unit=this.unit.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]}}class to{constructor(e){this.type=Oe,this.input=e}static parse(e,i){if(e.length!==2)return i.error(`Expected 1 argument, but found ${e.length-1} instead.`);const n=i.parse(e[1],1);return n?n.type.kind!=="array"&&n.type.kind!=="string"&&n.type.kind!=="value"?i.error(`Expected argument of type string or array, but found ${Ot(n.type)} instead.`):new to(n):null}evaluate(e){const i=this.input.evaluate(e);if(typeof i=="string"||Array.isArray(i))return i.length;throw new fi(`Expected value to be of type string or array, but found ${Ot(Gt(i))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){const e=["length"];return this.eachChild(i=>{e.push(i.serialize())}),e}}const bc={"==":Bh,"!=":Oh,">":Uh,"<":Fh,">=":vc,"<=":Vh,array:Ir,at:Lh,boolean:Ir,case:gc,coalesce:Ja,collator:Uo,format:Kr,image:Ms,in:Bs,"index-of":_c,interpolate:hr,"interpolate-hcl":hr,"interpolate-lab":hr,length:to,let:mc,literal:xn,match:Rh,number:Ir,"number-format":Fs,object:Ir,slice:yc,step:$a,string:Ir,"to-boolean":Xn,"to-color":Xn,"to-number":Xn,"to-string":Xn,var:hc,within:Cs};function wc(t,[e,i,n,s]){e=e.evaluate(t),i=i.evaluate(t),n=n.evaluate(t);const c=s?s.evaluate(t):1,u=sc(e,i,n,c);if(u)throw new fi(u);return new Zt(e/255*c,i/255*c,n/255*c,c)}function kr(t,e){return t in e}function Us(t,e){const i=e[t];return i===void 0?null:i}function Gi(t){return{type:t}}Cr.register(bc,{error:[{kind:"error"},[ut],(t,[e])=>{throw new fi(e.evaluate(t))}],typeof:[ut,[at],(t,[e])=>Ot(Gt(e.evaluate(t)))],"to-rgba":[Ni(Oe,4),[Bi],(t,[e])=>e.evaluate(t).toArray()],rgb:[Bi,[Oe,Oe,Oe],wc],rgba:[Bi,[Oe,Oe,Oe,Oe],wc],has:{type:st,overloads:[[[ut],(t,[e])=>kr(e.evaluate(t),t.properties())],[[ut,er],(t,[e,i])=>kr(e.evaluate(t),i.evaluate(t))]]},get:{type:at,overloads:[[[ut],(t,[e])=>Us(e.evaluate(t),t.properties())],[[ut,er],(t,[e,i])=>Us(e.evaluate(t),i.evaluate(t))]]},"feature-state":[at,[ut],(t,[e])=>Us(e.evaluate(t),t.featureState||{})],properties:[er,[],t=>t.properties()],"geometry-type":[ut,[],t=>t.geometryType()],id:[at,[],t=>t.id()],zoom:[Oe,[],t=>t.globals.zoom],pitch:[Oe,[],t=>t.globals.pitch||0],"distance-from-center":[Oe,[],t=>t.distanceFromCenter()],"heatmap-density":[Oe,[],t=>t.globals.heatmapDensity||0],"line-progress":[Oe,[],t=>t.globals.lineProgress||0],"sky-radial-progress":[Oe,[],t=>t.globals.skyRadialProgress||0],accumulated:[at,[],t=>t.globals.accumulated===void 0?null:t.globals.accumulated],"+":[Oe,Gi(Oe),(t,e)=>{let i=0;for(const n of e)i+=n.evaluate(t);return i}],"*":[Oe,Gi(Oe),(t,e)=>{let i=1;for(const n of e)i*=n.evaluate(t);return i}],"-":{type:Oe,overloads:[[[Oe,Oe],(t,[e,i])=>e.evaluate(t)-i.evaluate(t)],[[Oe],(t,[e])=>-e.evaluate(t)]]},"/":[Oe,[Oe,Oe],(t,[e,i])=>e.evaluate(t)/i.evaluate(t)],"%":[Oe,[Oe,Oe],(t,[e,i])=>e.evaluate(t)%i.evaluate(t)],ln2:[Oe,[],()=>Math.LN2],pi:[Oe,[],()=>Math.PI],e:[Oe,[],()=>Math.E],"^":[Oe,[Oe,Oe],(t,[e,i])=>Math.pow(e.evaluate(t),i.evaluate(t))],sqrt:[Oe,[Oe],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[Oe,[Oe],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[Oe,[Oe],(t,[e])=>Math.log(e.evaluate(t))],log2:[Oe,[Oe],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[Oe,[Oe],(t,[e])=>Math.sin(e.evaluate(t))],cos:[Oe,[Oe],(t,[e])=>Math.cos(e.evaluate(t))],tan:[Oe,[Oe],(t,[e])=>Math.tan(e.evaluate(t))],asin:[Oe,[Oe],(t,[e])=>Math.asin(e.evaluate(t))],acos:[Oe,[Oe],(t,[e])=>Math.acos(e.evaluate(t))],atan:[Oe,[Oe],(t,[e])=>Math.atan(e.evaluate(t))],min:[Oe,Gi(Oe),(t,e)=>Math.min(...e.map(i=>i.evaluate(t)))],max:[Oe,Gi(Oe),(t,e)=>Math.max(...e.map(i=>i.evaluate(t)))],abs:[Oe,[Oe],(t,[e])=>Math.abs(e.evaluate(t))],round:[Oe,[Oe],(t,[e])=>{const i=e.evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[Oe,[Oe],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[Oe,[Oe],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[st,[ut,at],(t,[e,i])=>t.properties()[e.value]===i.value],"filter-id-==":[st,[at],(t,[e])=>t.id()===e.value],"filter-type-==":[st,[ut],(t,[e])=>t.geometryType()===e.value],"filter-<":[st,[ut,at],(t,[e,i])=>{const n=t.properties()[e.value],s=i.value;return typeof n==typeof s&&n{const i=t.id(),n=e.value;return typeof i==typeof n&&i":[st,[ut,at],(t,[e,i])=>{const n=t.properties()[e.value],s=i.value;return typeof n==typeof s&&n>s}],"filter-id->":[st,[at],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i>n}],"filter-<=":[st,[ut,at],(t,[e,i])=>{const n=t.properties()[e.value],s=i.value;return typeof n==typeof s&&n<=s}],"filter-id-<=":[st,[at],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i<=n}],"filter->=":[st,[ut,at],(t,[e,i])=>{const n=t.properties()[e.value],s=i.value;return typeof n==typeof s&&n>=s}],"filter-id->=":[st,[at],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i>=n}],"filter-has":[st,[at],(t,[e])=>e.value in t.properties()],"filter-has-id":[st,[],t=>t.id()!==null&&t.id()!==void 0],"filter-type-in":[st,[Ni(ut)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[st,[Ni(at)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[st,[ut,Ni(at)],(t,[e,i])=>i.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[st,[ut,Ni(at)],(t,[e,i])=>function(n,s,c,u){for(;c<=u;){const p=c+u>>1;if(s[p]===n)return!0;s[p]>n?u=p-1:c=p+1}return!1}(t.properties()[e.value],i.value,0,i.value.length-1)],all:{type:st,overloads:[[[st,st],(t,[e,i])=>e.evaluate(t)&&i.evaluate(t)],[Gi(st),(t,e)=>{for(const i of e)if(!i.evaluate(t))return!1;return!0}]]},any:{type:st,overloads:[[[st,st],(t,[e,i])=>e.evaluate(t)||i.evaluate(t)],[Gi(st),(t,e)=>{for(const i of e)if(i.evaluate(t))return!0;return!1}]]},"!":[st,[st],(t,[e])=>!e.evaluate(t)],"is-supported-script":[st,[ut],(t,[e])=>{const i=t.globals&&t.globals.isSupportedScript;return!i||i(e.evaluate(t))}],upcase:[ut,[ut],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[ut,[ut],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[ut,Gi(at),(t,e)=>e.map(i=>Fo(i.evaluate(t))).join("")],"resolved-locale":[ut,[Oi],(t,[e])=>e.evaluate(t).resolvedLocale()]});var Wo=bc;function Tc(t){return{result:"success",value:t}}function Tn(t){return{result:"error",value:t}}function io(t){return t["property-type"]==="data-driven"}function Vs(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Ns(t){return!!t.expression&&t.expression.interpolated}function _t(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":t===null?"null":typeof t}function Xo(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Ec(t){return t}function js(t,e){const i=e.type==="color",n=t.stops&&typeof t.stops[0][0]=="object",s=n||!(n||t.property!==void 0),c=t.type||(Ns(e)?"exponential":"interval");if(i&&((t=Mr({},t)).stops&&(t.stops=t.stops.map(_=>[_[0],Zt.parse(_[1])])),t.default=Zt.parse(t.default?t.default:e.default)),t.colorSpace&&t.colorSpace!=="rgb"&&!Ka[t.colorSpace])throw new Error(`Unknown color space: ${t.colorSpace}`);let u,p,m;if(c==="exponential")u=Dr;else if(c==="interval")u=Gs;else if(c==="categorical"){u=Sc,p=Object.create(null);for(const _ of t.stops)p[_[0]]=_[1];m=typeof t.stops[0][0]}else{if(c!=="identity")throw new Error(`Unknown function type "${c}"`);u=Mc}if(n){const _={},x=[];for(let S=0;SS[0]),evaluate:({zoom:S},M)=>Dr({stops:b,base:t.base},e,S).evaluate(S,M)}}if(s){const _=c==="exponential"?{name:"exponential",base:t.base!==void 0?t.base:1}:null;return{kind:"camera",interpolationType:_,interpolationFactor:hr.interpolationFactor.bind(void 0,_),zoomStops:t.stops.map(x=>x[0]),evaluate:({zoom:x})=>u(t,e,x,p,m)}}return{kind:"source",evaluate(_,x){const b=x&&x.properties?x.properties[t.property]:void 0;return b===void 0?ro(t.default,e.default):u(t,e,b,p,m)}}}function ro(t,e,i){return t!==void 0?t:e!==void 0?e:i!==void 0?i:void 0}function Sc(t,e,i,n,s){return ro(typeof i===s?n[i]:void 0,t.default,e.default)}function Gs(t,e,i){if(_t(i)!=="number")return ro(t.default,e.default);const n=t.stops.length;if(n===1||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=Ps(t.stops.map(c=>c[0]),i);return t.stops[s][1]}function Dr(t,e,i){const n=t.base!==void 0?t.base:1;if(_t(i)!=="number")return ro(t.default,e.default);const s=t.stops.length;if(s===1||i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[s-1][0])return t.stops[s-1][1];const c=Ps(t.stops.map(x=>x[0]),i),u=function(x,b,w,S){const M=S-w,C=x-w;return M===0?0:b===1?C/M:(Math.pow(b,C)-1)/(Math.pow(b,M)-1)}(i,n,t.stops[c][0],t.stops[c+1][0]),p=t.stops[c][1],m=t.stops[c+1][1];let _=jo[e.type]||Ec;if(t.colorSpace&&t.colorSpace!=="rgb"){const x=Ka[t.colorSpace];_=(b,w)=>x.reverse(x.interpolate(x.forward(b),x.forward(w),u))}return typeof p.evaluate=="function"?{evaluate(...x){const b=p.evaluate.apply(void 0,x),w=m.evaluate.apply(void 0,x);if(b!==void 0&&w!==void 0)return _(b,w,u)}}:_(p,m,u)}function Mc(t,e,i){return e.type==="color"?i=Zt.parse(i):e.type==="formatted"?i=Ai.fromString(i.toString()):e.type==="resolvedImage"?i=ji.fromString(i.toString()):_t(i)===e.type||e.type==="enum"&&e.values[i]||(i=void 0),ro(i,t.default,e.default)}class $s{constructor(e,i){this.expression=e,this._warningHistory={},this._evaluator=new Ba,this._defaultValue=i?function(n){return n.type==="color"&&(Xo(n.default)||Array.isArray(n.default))?new Zt(0,0,0,0):n.type==="color"?Zt.parse(n.default)||null:n.default===void 0?null:n.default}(i):null,this._enumValues=i&&i.type==="enum"?i.values:null}evaluateWithoutErrorHandling(e,i,n,s,c,u,p,m){return this._evaluator.globals=e,this._evaluator.feature=i,this._evaluator.featureState=n,this._evaluator.canonical=s||null,this._evaluator.availableImages=c||null,this._evaluator.formattedSection=u,this._evaluator.featureTileCoord=p||null,this._evaluator.featureDistanceData=m||null,this.expression.evaluate(this._evaluator)}evaluate(e,i,n,s,c,u,p,m){this._evaluator.globals=e,this._evaluator.feature=i||null,this._evaluator.featureState=n||null,this._evaluator.canonical=s||null,this._evaluator.availableImages=c||null,this._evaluator.formattedSection=u||null,this._evaluator.featureTileCoord=p||null,this._evaluator.featureDistanceData=m||null;try{const _=this.expression.evaluate(this._evaluator);if(_==null||typeof _=="number"&&_!=_)return this._defaultValue;if(this._enumValues&&!(_ in this._enumValues))throw new fi(`Expected value to be one of ${Object.keys(this._enumValues).map(x=>JSON.stringify(x)).join(", ")}, but found ${JSON.stringify(_)} instead.`);return _}catch(_){return this._warningHistory[_.message]||(this._warningHistory[_.message]=!0,typeof console<"u"&&console.warn(_.message)),this._defaultValue}}}function no(t){return Array.isArray(t)&&t.length>0&&typeof t[0]=="string"&&t[0]in Wo}function oo(t,e){const i=new ja(Wo,[],e?function(s){const c={color:Bi,string:ut,number:Oe,enum:ut,boolean:st,formatted:ko,resolvedImage:yn};return s.type==="array"?Ni(c[s.value]||at,s.length):c[s.type]}(e):void 0),n=i.parse(t,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return n?Tc(new $s(n,e)):Tn(i.errors)}class rl{constructor(e,i){this.kind=e,this._styleExpression=i,this.isStateDependent=e!=="constant"&&!Pr(i.expression)}evaluateWithoutErrorHandling(e,i,n,s,c,u){return this._styleExpression.evaluateWithoutErrorHandling(e,i,n,s,c,u)}evaluate(e,i,n,s,c,u){return this._styleExpression.evaluate(e,i,n,s,c,u)}}class Ho{constructor(e,i,n,s){this.kind=e,this.zoomStops=n,this._styleExpression=i,this.isStateDependent=e!=="camera"&&!Pr(i.expression),this.interpolationType=s}evaluateWithoutErrorHandling(e,i,n,s,c,u){return this._styleExpression.evaluateWithoutErrorHandling(e,i,n,s,c,u)}evaluate(e,i,n,s,c,u){return this._styleExpression.evaluate(e,i,n,s,c,u)}interpolationFactor(e,i,n){return this.interpolationType?hr.interpolationFactor(this.interpolationType,e,i,n):0}}function Ko(t,e){if((t=oo(t,e)).result==="error")return t;const i=t.value.expression,n=Jn(i);if(!n&&!io(e))return Tn([new lr("","data expressions not supported")]);const s=bn(i,["zoom","pitch","distance-from-center"]);if(!s&&!Vs(e))return Tn([new lr("","zoom expressions not supported")]);const c=qs(i);return c||s?c instanceof lr?Tn([c]):c instanceof hr&&!Ns(e)?Tn([new lr("",'"interpolate" expressions cannot be used with this property')]):Tc(c?new Ho(n?"camera":"composite",t.value,c.labels,c instanceof hr?c.interpolation:void 0):new rl(n?"constant":"source",t.value)):Tn([new lr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Zs{constructor(e,i){this._parameters=e,this._specification=i,Mr(this,js(this._parameters,this._specification))}static deserialize(e){return new Zs(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function qs(t){let e=null;if(t instanceof mc)e=qs(t.result);else if(t instanceof Ja){for(const i of t.args)if(e=qs(i),e)break}else(t instanceof $a||t instanceof hr)&&t.input instanceof Cr&&t.input.name==="zoom"&&(e=t);return e instanceof lr||t.eachChild(i=>{const n=qs(i);n instanceof lr?e=n:!e&&n?e=new lr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&n&&e!==n&&(e=new lr("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}class Fe{constructor(e,i,n,s){this.message=(e?`${e}: `:"")+n,s&&(this.identifier=s),i!=null&&i.__line__&&(this.line=i.__line__)}}function tr(t){const e=t.key,i=t.value,n=t.valueSpec||{},s=t.objectElementValidators||{},c=t.style,u=t.styleSpec;let p=[];const m=_t(i);if(m!=="object")return[new Fe(e,i,`object expected, ${m} found`)];for(const _ in i){const x=_.split(".")[0];let b;s[x]?b=s[x]:n[x]?b=xi:s["*"]?b=s["*"]:n["*"]&&(b=xi),b?p=p.concat(b({key:(e&&`${e}.`)+_,value:i[_],valueSpec:n[x]||n["*"],style:c,styleSpec:u,object:i,objectKey:_},i)):p.push(new Fe(e,i[_],`unknown property "${_}"`))}for(const _ in n)s[_]||n[_].required&&n[_].default===void 0&&i[_]===void 0&&p.push(new Fe(e,i,`missing required property "${_}"`));return p}function Ac(t){const e=t.value,i=t.valueSpec,n=t.style,s=t.styleSpec,c=t.key,u=t.arrayElementValidator||xi;if(_t(e)!=="array")return[new Fe(c,e,`array expected, ${_t(e)} found`)];if(i.length&&e.length!==i.length)return[new Fe(c,e,`array length ${i.length} expected, length ${e.length} found`)];if(i["min-length"]&&e.lengthc)return[new Fe(e,i,`${i} is greater than the maximum value ${c}`)]}return[]}function Jo(t){const e=t.valueSpec,i=Ht(t.value.type);let n,s,c,u={};const p=i!=="categorical"&&t.value.property===void 0,m=!p,_=_t(t.value.stops)==="array"&&_t(t.value.stops[0])==="array"&&_t(t.value.stops[0][0])==="object",x=tr({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(S){if(i==="identity")return[new Fe(S.key,S.value,'identity function may not have a "stops" property')];let M=[];const C=S.value;return M=M.concat(Ac({key:S.key,value:C,valueSpec:S.valueSpec,style:S.style,styleSpec:S.styleSpec,arrayElementValidator:b})),_t(C)==="array"&&C.length===0&&M.push(new Fe(S.key,C,"array must have at least one stop")),M},default:function(S){return xi({key:S.key,value:S.value,valueSpec:e,style:S.style,styleSpec:S.styleSpec})}}});return i==="identity"&&p&&x.push(new Fe(t.key,t.value,'missing required property "property"')),i==="identity"||t.value.stops||x.push(new Fe(t.key,t.value,'missing required property "stops"')),i==="exponential"&&t.valueSpec.expression&&!Ns(t.valueSpec)&&x.push(new Fe(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(m&&!io(t.valueSpec)?x.push(new Fe(t.key,t.value,"property functions not supported")):p&&!Vs(t.valueSpec)&&x.push(new Fe(t.key,t.value,"zoom functions not supported"))),i!=="categorical"&&!_||t.value.property!==void 0||x.push(new Fe(t.key,t.value,'"property" property is required')),x;function b(S){let M=[];const C=S.value,D=S.key;if(_t(C)!=="array")return[new Fe(D,C,`array expected, ${_t(C)} found`)];if(C.length!==2)return[new Fe(D,C,`array length 2 expected, length ${C.length} found`)];if(_){if(_t(C[0])!=="object")return[new Fe(D,C,`object expected, ${_t(C[0])} found`)];if(C[0].zoom===void 0)return[new Fe(D,C,"object stop key must have zoom")];if(C[0].value===void 0)return[new Fe(D,C,"object stop key must have value")];const U=Ht(C[0].zoom);if(typeof U!="number")return[new Fe(D,C[0].zoom,"stop zoom values must be numbers")];if(c&&c>U)return[new Fe(D,C[0].zoom,"stop zoom values must appear in ascending order")];U!==c&&(c=U,s=void 0,u={}),M=M.concat(tr({key:`${D}[0]`,value:C[0],valueSpec:{zoom:{}},style:S.style,styleSpec:S.styleSpec,objectElementValidators:{zoom:Yo,value:w}}))}else M=M.concat(w({key:`${D}[0]`,value:C[0],valueSpec:{},style:S.style,styleSpec:S.styleSpec},C));return no(ci(C[1]))?M.concat([new Fe(`${D}[1]`,C[1],"expressions are not allowed in function stops.")]):M.concat(xi({key:`${D}[1]`,value:C[1],valueSpec:e,style:S.style,styleSpec:S.styleSpec}))}function w(S,M){const C=_t(S.value),D=Ht(S.value),U=S.value!==null?S.value:M;if(n){if(C!==n)return[new Fe(S.key,U,`${C} stop domain type must match previous stop domain type ${n}`)]}else n=C;if(C!=="number"&&C!=="string"&&C!=="boolean"&&typeof D!="number"&&typeof D!="string"&&typeof D!="boolean")return[new Fe(S.key,U,"stop domain value must be a number, string, or boolean")];if(C!=="number"&&i!=="categorical"){let q=`number expected, ${C} found`;return io(e)&&i===void 0&&(q+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Fe(S.key,U,q)]}return i!=="categorical"||C!=="number"||typeof D=="number"&&isFinite(D)&&Math.floor(D)===D?i!=="categorical"&&C==="number"&&typeof D=="number"&&typeof s=="number"&&s!==void 0&&Dnew Fe(`${t.key}${n.key}`,t.value,n.message));const i=e.value.expression||e.value._styleExpression.expression;if(t.expressionContext==="property"&&t.propertyKey==="text-font"&&!i.outputDefined())return[new Fe(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if(t.expressionContext==="property"&&t.propertyType==="layout"&&!Pr(i))return[new Fe(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if(t.expressionContext==="filter")return Qo(i,t);if(t.expressionContext&&t.expressionContext.indexOf("cluster")===0){if(!bn(i,["zoom","feature-state"]))return[new Fe(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(t.expressionContext==="cluster-initial"&&!Jn(i))return[new Fe(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Qo(t,e){const i=new Set(["zoom","feature-state","pitch","distance-from-center"]);if(e.valueSpec&&e.valueSpec.expression)for(const s of e.valueSpec.expression.parameters)i.delete(s);if(i.size===0)return[];const n=[];return t instanceof Cr&&i.has(t.name)?[new Fe(e.key,e.value,`["${t.name}"] expression is not supported in a filter for a ${e.object.type} layer with id: ${e.object.id}`)]:(t.eachChild(s=>{n.push(...Qo(s,e))}),n)}function Ws(t){const e=t.key,i=t.value,n=t.valueSpec,s=[];return Array.isArray(n.values)?n.values.indexOf(Ht(i))===-1&&s.push(new Fe(e,i,`expected one of [${n.values.join(", ")}], ${JSON.stringify(i)} found`)):Object.keys(n.values).indexOf(Ht(i))===-1&&s.push(new Fe(e,i,`expected one of [${Object.keys(n.values).join(", ")}], ${JSON.stringify(i)} found`)),s}function nl(t){if(t===!0||t===!1)return!0;if(!Array.isArray(t)||t.length===0)return!1;switch(t[0]){case"has":return t.length>=2&&t[1]!=="$id"&&t[1]!=="$type";case"in":return t.length>=3&&(typeof t[1]!="string"||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return t.length!==3||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(const e of t.slice(1))if(!nl(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}function Xs(t,e="fill"){if(t==null)return{filter:()=>!0,needGeometry:!1,needFeature:!1};nl(t)||(t=ao(t));const i=t;let n=!0;try{n=function(_){if(!so(_))return _;let x=ci(_);return Hs(x),x=Ic(x),x}(i)}catch{console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate. -This is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md -and paste the contents of this message in the report. -Thank you! -Filter Expression: -${JSON.stringify(i,null,2)} - `)}const s=fe[`filter_${e}`],c=oo(n,s);let u=null;if(c.result==="error")throw new Error(c.value.map(_=>`${_.key}: ${_.message}`).join(", "));u=(_,x,b)=>c.value.evaluate(_,x,{},b);let p=null,m=null;if(n!==i){const _=oo(i,s);if(_.result==="error")throw new Error(_.value.map(x=>`${x.key}: ${x.message}`).join(", "));p=(x,b,w,S,M)=>_.value.evaluate(x,b,{},w,void 0,void 0,S,M),m=!Jn(_.value.expression)}return{filter:u,dynamicFilter:p||void 0,needGeometry:Cc(n),needFeature:!!m}}function Ic(t){if(!Array.isArray(t))return t;const e=function(i){if(ol.has(i[0])){for(let n=1;nIc(i))}function Hs(t){let e=!1;const i=[];if(t[0]==="case"){for(let n=1;n",">=","<","<=","to-boolean"]);function Nh(t,e){return te?1:0}function Cc(t){if(!Array.isArray(t))return!1;if(t[0]==="within")return!0;for(let e=1;e"||e==="<="||e===">="?sl(t[1],t[2],e):e==="any"?(i=t.slice(1),["any"].concat(i.map(ao))):e==="all"?["all"].concat(t.slice(1).map(ao)):e==="none"?["all"].concat(t.slice(1).map(ao).map(Ks)):e==="in"?al(t[1],t.slice(2)):e==="!in"?Ks(al(t[1],t.slice(2))):e==="has"?ll(t[1]):e==="!has"?Ks(ll(t[1])):e!=="within"||t;var i}function sl(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 al(t,e){if(e.length===0)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(i=>typeof i!=typeof e[0])?["filter-in-large",t,["literal",e.sort(Nh)]]:["filter-in-small",t,["literal",e]]}}function ll(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Ks(t){return["!",t]}function es(t){return nl(ci(t.value))?hi(Mr({},t,{expressionContext:"filter",valueSpec:t.styleSpec[`filter_${t.layerType||"fill"}`]})):ts(t)}function ts(t){const e=t.value,i=t.key;if(_t(e)!=="array")return[new Fe(i,e,`array expected, ${_t(e)} found`)];const n=t.styleSpec;let s,c=[];if(e.length<1)return[new Fe(i,e,"filter array must have at least 1 element")];switch(c=c.concat(Ws({key:`${i}[0]`,value:e[0],valueSpec:n.filter_operator,style:t.style,styleSpec:t.styleSpec})),Ht(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&Ht(e[1])==="$type"&&c.push(new Fe(i,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&c.push(new Fe(i,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(s=_t(e[1]),s!=="string"&&c.push(new Fe(`${i}[1]`,e[1],`string expected, ${s} found`)));for(let u=2;u{_ in i&&e.push(new Fe(n,i[_],`"${_}" is prohibited for ref layers`))}),s.layers.forEach(_=>{Ht(_.id)===p&&(m=_)}),m?m.ref?e.push(new Fe(n,i.ref,"ref cannot reference another ref layer")):u=Ht(m.type):typeof p=="string"&&e.push(new Fe(n,i.ref,`ref layer "${p}" not found`))}else if(u!=="background"&&u!=="sky")if(i.source){const m=s.sources&&s.sources[i.source],_=m&&Ht(m.type);m?_==="vector"&&u==="raster"?e.push(new Fe(n,i.source,`layer "${i.id}" requires a raster source`)):_==="raster"&&u!=="raster"?e.push(new Fe(n,i.source,`layer "${i.id}" requires a vector source`)):_!=="vector"||i["source-layer"]?_==="raster-dem"&&u!=="hillshade"?e.push(new Fe(n,i.source,"raster-dem source can only be used with layer type 'hillshade'.")):u!=="line"||!i.paint||!i.paint["line-gradient"]&&!i.paint["line-trim-offset"]||_==="geojson"&&m.lineMetrics||e.push(new Fe(n,i,`layer "${i.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new Fe(n,i,`layer "${i.id}" must specify a "source-layer"`)):e.push(new Fe(n,i.source,`source "${i.source}" not found`))}else e.push(new Fe(n,i,'missing required property "source"'));return e=e.concat(tr({key:n,value:i,valueSpec:c.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":()=>[],type:()=>xi({key:`${n}.type`,value:i.type,valueSpec:c.layer.type,style:t.style,styleSpec:t.styleSpec,object:i,objectKey:"type"}),filter:m=>es(Mr({layerType:u},m)),layout:m=>tr({layer:i,key:m.key,value:m.value,valueSpec:{},style:m.style,styleSpec:m.styleSpec,objectElementValidators:{"*":_=>hl(Mr({layerType:u},_))}}),paint:m=>tr({layer:i,key:m.key,value:m.value,valueSpec:{},style:m.style,styleSpec:m.styleSpec,objectElementValidators:{"*":_=>zc(Mr({layerType:u},_))}})}})),e}function Yr(t){const e=t.value,i=t.key,n=_t(e);return n!=="string"?[new Fe(i,e,`string expected, ${n} found`)]:[]}const kc={promoteId:function({key:t,value:e}){if(_t(e)==="string")return Yr({key:t,value:e});{const i=[];for(const n in e)i.push(...Yr({key:`${t}.${n}`,value:e[n]}));return i}}};function Dc(t){const e=t.value,i=t.key,n=t.styleSpec,s=t.style;if(!e.type)return[new Fe(i,e,'"type" is required')];const c=Ht(e.type);let u;switch(c){case"vector":case"raster":case"raster-dem":return u=tr({key:i,value:e,valueSpec:n[`source_${c.replace("-","_")}`],style:t.style,styleSpec:n,objectElementValidators:kc}),u;case"geojson":if(u=tr({key:i,value:e,valueSpec:n.source_geojson,style:s,styleSpec:n,objectElementValidators:kc}),e.cluster)for(const p in e.clusterProperties){const[m,_]=e.clusterProperties[p],x=typeof m=="string"?[m,["accumulated"],["get",p]]:m;u.push(...hi({key:`${i}.${p}.map`,value:_,expressionContext:"cluster-map"})),u.push(...hi({key:`${i}.${p}.reduce`,value:x,expressionContext:"cluster-reduce"}))}return u;case"video":return tr({key:i,value:e,valueSpec:n.source_video,style:s,styleSpec:n});case"image":return tr({key:i,value:e,valueSpec:n.source_image,style:s,styleSpec:n});case"canvas":return[new Fe(i,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Ws({key:`${i}.type`,value:e.type,valueSpec:{values:jh(n)},style:s,styleSpec:n})}}function jh(t){return t.source.reduce((e,i)=>{const n=t[i];return n.type.type==="enum"&&(e=e.concat(Object.keys(n.type.values))),e},[])}function Lc(t){const e=t.value,i=t.styleSpec,n=i.light,s=t.style;let c=[];const u=_t(e);if(e===void 0)return c;if(u!=="object")return c=c.concat([new Fe("light",e,`object expected, ${u} found`)]),c;for(const p in e){const m=p.match(/^(.*)-transition$/);c=c.concat(m&&n[m[1]]&&n[m[1]].transition?xi({key:p,value:e[p],valueSpec:i.transition,style:s,styleSpec:i}):n[p]?xi({key:p,value:e[p],valueSpec:n[p],style:s,styleSpec:i}):[new Fe(p,e[p],`unknown property "${p}"`)])}return c}function ul(t){const e=t.value,i=t.key,n=t.style,s=t.styleSpec,c=s.terrain;let u=[];const p=_t(e);if(e===void 0)return u;if(p!=="object")return u=u.concat([new Fe("terrain",e,`object expected, ${p} found`)]),u;for(const m in e){const _=m.match(/^(.*)-transition$/);u=u.concat(_&&c[_[1]]&&c[_[1]].transition?xi({key:m,value:e[m],valueSpec:s.transition,style:n,styleSpec:s}):c[m]?xi({key:m,value:e[m],valueSpec:c[m],style:n,styleSpec:s}):[new Fe(m,e[m],`unknown property "${m}"`)])}if(e.source){const m=n.sources&&n.sources[e.source],_=m&&Ht(m.type);m?_!=="raster-dem"&&u.push(new Fe(i,e.source,`terrain cannot be used with a source of type ${String(_)}, it only be used with a "raster-dem" source type`)):u.push(new Fe(i,e.source,`source "${e.source}" not found`))}else u.push(new Fe(i,e,'terrain is missing required property "source"'));return u}function Rc(t){const e=t.value,i=t.style,n=t.styleSpec,s=n.fog;let c=[];const u=_t(e);if(e===void 0)return c;if(u!=="object")return c=c.concat([new Fe("fog",e,`object expected, ${u} found`)]),c;for(const p in e){const m=p.match(/^(.*)-transition$/);c=c.concat(m&&s[m[1]]&&s[m[1]].transition?xi({key:p,value:e[p],valueSpec:n.transition,style:i,styleSpec:n}):s[p]?xi({key:p,value:e[p],valueSpec:s[p],style:i,styleSpec:n}):[new Fe(p,e[p],`unknown property "${p}"`)])}return c}const Bc={"*":()=>[],array:Ac,boolean:function(t){const e=t.value,i=t.key,n=_t(e);return n!=="boolean"?[new Fe(i,e,`boolean expected, ${n} found`)]:[]},number:Yo,color:function(t){const e=t.key,i=t.value,n=_t(i);return n!=="string"?[new Fe(e,i,`color expected, ${n} found`)]:Ca(i)===null?[new Fe(e,i,`color expected, "${i}" found`)]:[]},enum:Ws,filter:es,function:Jo,layer:Pc,object:tr,source:Dc,light:Lc,terrain:ul,fog:Rc,string:Yr,formatted:function(t){return Yr(t).length===0?[]:hi(t)},resolvedImage:function(t){return Yr(t).length===0?[]:hi(t)},projection:function(t){const e=t.value,i=t.styleSpec,n=i.projection,s=t.style;let c=[];const u=_t(e);if(u==="object")for(const p in e)c=c.concat(xi({key:p,value:e[p],valueSpec:n[p],style:s,styleSpec:i}));else u!=="string"&&(c=c.concat([new Fe("projection",e,`object or string expected, ${u} found`)]));return c}};function xi(t){const e=t.value,i=t.valueSpec,n=t.styleSpec;return i.expression&&Xo(Ht(e))?Jo(t):i.expression&&no(ci(e))?hi(t):i.type&&Bc[i.type]?Bc[i.type](t):tr(Mr({},t,{valueSpec:i.type?n[i.type]:i}))}function Gh(t){const e=t.value,i=t.key,n=Yr(t);return n.length||(e.indexOf("{fontstack}")===-1&&n.push(new Fe(i,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&n.push(new Fe(i,e,'"glyphs" url must include a "{range}" token'))),n}function Oc(t,e=fe){return $i(xi({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:Gh,"*":()=>[]}}))}const $h=t=>$i(zc(t)),Zh=t=>$i(hl(t));function $i(t){return t.slice().sort((e,i)=>e.line&&i.line?e.line-i.line:0)}function Fc(t,e){let i=!1;if(e&&e.length)for(const n of e)t.fire(new Sr(new Error(n.message))),i=!0;return i}var qh=ur,ir=3;function ur(t,e,i){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var s=new Int32Array(this.arrayBuffer);t=s[0],this.d=(e=s[1])+2*(i=s[2]);for(var c=0;c=x[S+0]&&n>=x[S+1])?(u[w]=!0,c.push(_[w])):u[w]=!1}}},ur.prototype._forEachCell=function(t,e,i,n,s,c,u,p){for(var m=this._convertToCellCoord(t),_=this._convertToCellCoord(e),x=this._convertToCellCoord(i),b=this._convertToCellCoord(n),w=m;w<=x;w++)for(var S=_;S<=b;S++){var M=this.d*S+w;if((!p||p(this._convertFromCellCoord(w),this._convertFromCellCoord(S),this._convertFromCellCoord(w+1),this._convertFromCellCoord(S+1)))&&s.call(this,t,e,i,n,M,c,u,p))return}},ur.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},ur.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},ur.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=ir+this.cells.length+1+1,i=0,n=0;n=0||(s[c]=lo(t[c],e)));t instanceof Error&&(s.message=t.message)}if(s.$name)throw new Error("$name property is reserved for worker serialization logic.");return n!=="Object"&&(s.$name=n),s}throw new Error("can't serialize object of type "+typeof t)}function Sn(t){if(t==null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||dl(t)||pl(t)||ArrayBuffer.isView(t)||t instanceof Se.ImageData)return t;if(Array.isArray(t))return t.map(Sn);if(typeof t=="object"){const e=t.$name||"Object",{klass:i}=Ys[e];if(!i)throw new Error(`can't deserialize unregistered class ${e}`);if(i.deserialize)return i.deserialize(t);const n=Object.create(i.prototype);for(const s of Object.keys(t))s!=="$name"&&(n[s]=Sn(t[s]));return n}throw new Error("can't deserialize object of type "+typeof t)}const Be={"Latin-1 Supplement":t=>t>=128&&t<=255,Arabic:t=>t>=1536&&t<=1791,"Arabic Supplement":t=>t>=1872&&t<=1919,"Arabic Extended-A":t=>t>=2208&&t<=2303,"Hangul Jamo":t=>t>=4352&&t<=4607,"Unified Canadian Aboriginal Syllabics":t=>t>=5120&&t<=5759,Khmer:t=>t>=6016&&t<=6143,"Unified Canadian Aboriginal Syllabics Extended":t=>t>=6320&&t<=6399,"General Punctuation":t=>t>=8192&&t<=8303,"Letterlike Symbols":t=>t>=8448&&t<=8527,"Number Forms":t=>t>=8528&&t<=8591,"Miscellaneous Technical":t=>t>=8960&&t<=9215,"Control Pictures":t=>t>=9216&&t<=9279,"Optical Character Recognition":t=>t>=9280&&t<=9311,"Enclosed Alphanumerics":t=>t>=9312&&t<=9471,"Geometric Shapes":t=>t>=9632&&t<=9727,"Miscellaneous Symbols":t=>t>=9728&&t<=9983,"Miscellaneous Symbols and Arrows":t=>t>=11008&&t<=11263,"CJK Radicals Supplement":t=>t>=11904&&t<=12031,"Kangxi Radicals":t=>t>=12032&&t<=12255,"Ideographic Description Characters":t=>t>=12272&&t<=12287,"CJK Symbols and Punctuation":t=>t>=12288&&t<=12351,Hiragana:t=>t>=12352&&t<=12447,Katakana:t=>t>=12448&&t<=12543,Bopomofo:t=>t>=12544&&t<=12591,"Hangul Compatibility Jamo":t=>t>=12592&&t<=12687,Kanbun:t=>t>=12688&&t<=12703,"Bopomofo Extended":t=>t>=12704&&t<=12735,"CJK Strokes":t=>t>=12736&&t<=12783,"Katakana Phonetic Extensions":t=>t>=12784&&t<=12799,"Enclosed CJK Letters and Months":t=>t>=12800&&t<=13055,"CJK Compatibility":t=>t>=13056&&t<=13311,"CJK Unified Ideographs Extension A":t=>t>=13312&&t<=19903,"Yijing Hexagram Symbols":t=>t>=19904&&t<=19967,"CJK Unified Ideographs":t=>t>=19968&&t<=40959,"Yi Syllables":t=>t>=40960&&t<=42127,"Yi Radicals":t=>t>=42128&&t<=42191,"Hangul Jamo Extended-A":t=>t>=43360&&t<=43391,"Hangul Syllables":t=>t>=44032&&t<=55215,"Hangul Jamo Extended-B":t=>t>=55216&&t<=55295,"Private Use Area":t=>t>=57344&&t<=63743,"CJK Compatibility Ideographs":t=>t>=63744&&t<=64255,"Arabic Presentation Forms-A":t=>t>=64336&&t<=65023,"Vertical Forms":t=>t>=65040&&t<=65055,"CJK Compatibility Forms":t=>t>=65072&&t<=65103,"Small Form Variants":t=>t>=65104&&t<=65135,"Arabic Presentation Forms-B":t=>t>=65136&&t<=65279,"Halfwidth and Fullwidth Forms":t=>t>=65280&&t<=65519};function fl(t){for(const e of t)if(ml(e.charCodeAt(0)))return!0;return!1}function Wh(t){for(const e of t)if(!Uc(e.charCodeAt(0)))return!1;return!0}function Uc(t){return!(Be.Arabic(t)||Be["Arabic Supplement"](t)||Be["Arabic Extended-A"](t)||Be["Arabic Presentation Forms-A"](t)||Be["Arabic Presentation Forms-B"](t))}function ml(t){return!(t!==746&&t!==747&&(t<4352||!(Be["Bopomofo Extended"](t)||Be.Bopomofo(t)||Be["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||Be["CJK Compatibility Ideographs"](t)||Be["CJK Compatibility"](t)||Be["CJK Radicals Supplement"](t)||Be["CJK Strokes"](t)||!(!Be["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||t===12336)||Be["CJK Unified Ideographs Extension A"](t)||Be["CJK Unified Ideographs"](t)||Be["Enclosed CJK Letters and Months"](t)||Be["Hangul Compatibility Jamo"](t)||Be["Hangul Jamo Extended-A"](t)||Be["Hangul Jamo Extended-B"](t)||Be["Hangul Jamo"](t)||Be["Hangul Syllables"](t)||Be.Hiragana(t)||Be["Ideographic Description Characters"](t)||Be.Kanbun(t)||Be["Kangxi Radicals"](t)||Be["Katakana Phonetic Extensions"](t)||Be.Katakana(t)&&t!==12540||!(!Be["Halfwidth and Fullwidth Forms"](t)||t===65288||t===65289||t===65293||t>=65306&&t<=65310||t===65339||t===65341||t===65343||t>=65371&&t<=65503||t===65507||t>=65512&&t<=65519)||!(!Be["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||Be["Unified Canadian Aboriginal Syllabics"](t)||Be["Unified Canadian Aboriginal Syllabics Extended"](t)||Be["Vertical Forms"](t)||Be["Yijing Hexagram Symbols"](t)||Be["Yi Syllables"](t)||Be["Yi Radicals"](t))))}function Vc(t){return!(ml(t)||function(e){return!!(Be["Latin-1 Supplement"](e)&&(e===167||e===169||e===174||e===177||e===188||e===189||e===190||e===215||e===247)||Be["General Punctuation"](e)&&(e===8214||e===8224||e===8225||e===8240||e===8241||e===8251||e===8252||e===8258||e===8263||e===8264||e===8265||e===8273)||Be["Letterlike Symbols"](e)||Be["Number Forms"](e)||Be["Miscellaneous Technical"](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||e===9003||e>=9085&&e<=9114||e>=9150&&e<=9165||e===9167||e>=9169&&e<=9179||e>=9186&&e<=9215)||Be["Control Pictures"](e)&&e!==9251||Be["Optical Character Recognition"](e)||Be["Enclosed Alphanumerics"](e)||Be["Geometric Shapes"](e)||Be["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||Be["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||Be["CJK Symbols and Punctuation"](e)||Be.Katakana(e)||Be["Private Use Area"](e)||Be["CJK Compatibility Forms"](e)||Be["Small Form Variants"](e)||Be["Halfwidth and Fullwidth Forms"](e)||e===8734||e===8756||e===8757||e>=9984&&e<=10087||e>=10102&&e<=10131||e===65532||e===65533)}(t))}function Nc(t){return t>=1424&&t<=2303||Be["Arabic Presentation Forms-A"](t)||Be["Arabic Presentation Forms-B"](t)}function Xh(t,e){return!(!e&&Nc(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||Be.Khmer(t))}function Hh(t){for(const e of t)if(Nc(e.charCodeAt(0)))return!0;return!1}const _l="deferred",gl="loading",yl="loaded";let co=null,l="unavailable",r=null;const o=function(t){t&&typeof t=="string"&&t.indexOf("NetworkError")>-1&&(l="error"),co&&co(t)};function h(){d.fire(new gn("pluginStateChange",{pluginStatus:l,pluginURL:r}))}const d=new Po,f=function(){return l},g=function(){if(l!==_l||!r)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");l=gl,h(),r&&$n({url:r},t=>{t?o(t):(l=yl,h())})},y={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>l===yl||y.applyArabicShaping!=null,isLoading:()=>l===gl,setState(t){l=t.pluginStatus,r=t.pluginURL},isParsed:()=>y.applyArabicShaping!=null&&y.processBidirectionalText!=null&&y.processStyledBidirectionalText!=null,getPluginURL:()=>r};class v{constructor(e,i){this.zoom=e,i?(this.now=i.now,this.fadeDuration=i.fadeDuration,this.transition=i.transition,this.pitch=i.pitch):(this.now=0,this.fadeDuration=0,this.transition={},this.pitch=0)}isSupportedScript(e){return function(i,n){for(const s of i)if(!Xh(s.charCodeAt(0),n))return!1;return!0}(e,y.isLoaded())}}class E{constructor(e,i){this.property=e,this.value=i,this.expression=function(n,s){if(Xo(n))return new Zs(n,s);if(no(n)){const c=Ko(n,s);if(c.result==="error")throw new Error(c.value.map(u=>`${u.key}: ${u.message}`).join(", "));return c.value}{let c=n;return typeof n=="string"&&s.type==="color"&&(c=Zt.parse(n)),{kind:"constant",evaluate:()=>c}}}(i===void 0?e.specification.default:i,e.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(e,i,n){return this.property.possiblyEvaluate(this,e,i,n)}}class T{constructor(e){this.property=e,this.value=new E(e,void 0)}transitioned(e,i){return new k(this.property,this.value,i,Wt({},e.transition,this.transition),e.now)}untransitioned(){return new k(this.property,this.value,null,{},0)}}class A{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return Li(this._values[e].value.value)}setValue(e,i){this._values.hasOwnProperty(e)||(this._values[e]=new T(this._values[e].property)),this._values[e].value=new E(this._values[e].property,i===null?void 0:Li(i))}getTransition(e){return Li(this._values[e].transition)}setTransition(e,i){this._values.hasOwnProperty(e)||(this._values[e]=new T(this._values[e].property)),this._values[e].transition=Li(i)||void 0}serialize(){const e={};for(const i of Object.keys(this._values)){const n=this.getValue(i);n!==void 0&&(e[i]=n);const s=this.getTransition(i);s!==void 0&&(e[`${i}-transition`]=s)}return e}transitioned(e,i){const n=new R(this._properties);for(const s of Object.keys(this._values))n._values[s]=this._values[s].transitioned(e,i._values[s]);return n}untransitioned(){const e=new R(this._properties);for(const i of Object.keys(this._values))e._values[i]=this._values[i].untransitioned();return e}}class k{constructor(e,i,n,s,c){const u=s.delay||0,p=s.duration||0;c=c||0,this.property=e,this.value=i,this.begin=c+u,this.end=this.begin+p,e.specification.transition&&(s.delay||s.duration)&&(this.prior=n)}possiblyEvaluate(e,i,n){const s=e.now||0,c=this.value.possiblyEvaluate(e,i,n),u=this.prior;if(u){if(s>this.end)return this.prior=null,c;if(this.value.isDataDriven())return this.prior=null,c;if(sthis.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const i=this.uint8;this._refreshViews(),i&&this.uint8.set(i)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}destroy(){this.int8=this.uint8=this.int16=this.uint16=this.int32=this.uint32=this.float32=null,this.arrayBuffer=null}}function te(t,e=1){let i=0,n=0;return{members:t.map(s=>{const c=J[s.type].BYTES_PER_ELEMENT,u=i=le(i,Math.max(e,c)),p=s.components||1;return n=Math.max(n,c),i+=c*p,{name:s.name,type:s.type,components:p,offset:u}}),size:le(i,Math.max(n,e)),alignment:e}}function le(t,e){return Math.ceil(t/e)*e}class Te extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,i)}emplace(e,i,n){const s=2*e;return this.int16[s+0]=i,this.int16[s+1]=n,e}}Te.prototype.bytesPerElement=4,Ue(Te,"StructArrayLayout2i4");class oe extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,n){const s=this.length;return this.resize(s+1),this.emplace(s,e,i,n)}emplace(e,i,n,s){const c=3*e;return this.int16[c+0]=i,this.int16[c+1]=n,this.int16[c+2]=s,e}}oe.prototype.bytesPerElement=6,Ue(oe,"StructArrayLayout3i6");class ge extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,n,s){const c=this.length;return this.resize(c+1),this.emplace(c,e,i,n,s)}emplace(e,i,n,s,c){const u=4*e;return this.int16[u+0]=i,this.int16[u+1]=n,this.int16[u+2]=s,this.int16[u+3]=c,e}}ge.prototype.bytesPerElement=8,Ue(ge,"StructArrayLayout4i8");class he extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c,u,p){const m=this.length;return this.resize(m+1),this.emplace(m,e,i,n,s,c,u,p)}emplace(e,i,n,s,c,u,p,m){const _=6*e,x=12*e,b=3*e;return this.int16[_+0]=i,this.int16[_+1]=n,this.uint8[x+4]=s,this.uint8[x+5]=c,this.uint8[x+6]=u,this.uint8[x+7]=p,this.float32[b+2]=m,e}}he.prototype.bytesPerElement=12,Ue(he,"StructArrayLayout2i4ub1f12");class we extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,n,s){const c=this.length;return this.resize(c+1),this.emplace(c,e,i,n,s)}emplace(e,i,n,s,c){const u=4*e;return this.float32[u+0]=i,this.float32[u+1]=n,this.float32[u+2]=s,this.float32[u+3]=c,e}}we.prototype.bytesPerElement=16,Ue(we,"StructArrayLayout4f16");class ae extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c){const u=this.length;return this.resize(u+1),this.emplace(u,e,i,n,s,c)}emplace(e,i,n,s,c,u){const p=6*e,m=3*e;return this.uint16[p+0]=i,this.uint16[p+1]=n,this.uint16[p+2]=s,this.uint16[p+3]=c,this.float32[m+2]=u,e}}ae.prototype.bytesPerElement=12,Ue(ae,"StructArrayLayout4ui1f12");class _e extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,n,s){const c=this.length;return this.resize(c+1),this.emplace(c,e,i,n,s)}emplace(e,i,n,s,c){const u=4*e;return this.uint16[u+0]=i,this.uint16[u+1]=n,this.uint16[u+2]=s,this.uint16[u+3]=c,e}}_e.prototype.bytesPerElement=8,Ue(_e,"StructArrayLayout4ui8");class Me extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c,u){const p=this.length;return this.resize(p+1),this.emplace(p,e,i,n,s,c,u)}emplace(e,i,n,s,c,u,p){const m=6*e;return this.int16[m+0]=i,this.int16[m+1]=n,this.int16[m+2]=s,this.int16[m+3]=c,this.int16[m+4]=u,this.int16[m+5]=p,e}}Me.prototype.bytesPerElement=12,Ue(Me,"StructArrayLayout6i12");class ve extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c,u,p,m,_,x,b,w){const S=this.length;return this.resize(S+1),this.emplace(S,e,i,n,s,c,u,p,m,_,x,b,w)}emplace(e,i,n,s,c,u,p,m,_,x,b,w,S){const M=12*e;return this.int16[M+0]=i,this.int16[M+1]=n,this.int16[M+2]=s,this.int16[M+3]=c,this.uint16[M+4]=u,this.uint16[M+5]=p,this.uint16[M+6]=m,this.uint16[M+7]=_,this.int16[M+8]=x,this.int16[M+9]=b,this.int16[M+10]=w,this.int16[M+11]=S,e}}ve.prototype.bytesPerElement=24,Ue(ve,"StructArrayLayout4i4ui4i24");class Ae extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c,u){const p=this.length;return this.resize(p+1),this.emplace(p,e,i,n,s,c,u)}emplace(e,i,n,s,c,u,p){const m=10*e,_=5*e;return this.int16[m+0]=i,this.int16[m+1]=n,this.int16[m+2]=s,this.float32[_+2]=c,this.float32[_+3]=u,this.float32[_+4]=p,e}}Ae.prototype.bytesPerElement=20,Ue(Ae,"StructArrayLayout3i3f20");class Ge extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.uint32[1*e+0]=i,e}}Ge.prototype.bytesPerElement=4,Ue(Ge,"StructArrayLayout1ul4");class Xe extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c,u,p,m,_,x,b,w,S){const M=this.length;return this.resize(M+1),this.emplace(M,e,i,n,s,c,u,p,m,_,x,b,w,S)}emplace(e,i,n,s,c,u,p,m,_,x,b,w,S,M){const C=20*e,D=10*e;return this.int16[C+0]=i,this.int16[C+1]=n,this.int16[C+2]=s,this.int16[C+3]=c,this.int16[C+4]=u,this.float32[D+3]=p,this.float32[D+4]=m,this.float32[D+5]=_,this.float32[D+6]=x,this.int16[C+14]=b,this.uint32[D+8]=w,this.uint16[C+18]=S,this.uint16[C+19]=M,e}}Xe.prototype.bytesPerElement=40,Ue(Xe,"StructArrayLayout5i4f1i1ul2ui40");class Ve extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c,u,p){const m=this.length;return this.resize(m+1),this.emplace(m,e,i,n,s,c,u,p)}emplace(e,i,n,s,c,u,p,m){const _=8*e;return this.int16[_+0]=i,this.int16[_+1]=n,this.int16[_+2]=s,this.int16[_+4]=c,this.int16[_+5]=u,this.int16[_+6]=p,this.int16[_+7]=m,e}}Ve.prototype.bytesPerElement=16,Ue(Ve,"StructArrayLayout3i2i2i16");class qe extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c){const u=this.length;return this.resize(u+1),this.emplace(u,e,i,n,s,c)}emplace(e,i,n,s,c,u){const p=4*e,m=8*e;return this.float32[p+0]=i,this.float32[p+1]=n,this.float32[p+2]=s,this.int16[m+6]=c,this.int16[m+7]=u,e}}qe.prototype.bytesPerElement=16,Ue(qe,"StructArrayLayout2f1f2i16");class lt extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,n,s){const c=this.length;return this.resize(c+1),this.emplace(c,e,i,n,s)}emplace(e,i,n,s,c){const u=12*e,p=3*e;return this.uint8[u+0]=i,this.uint8[u+1]=n,this.float32[p+1]=s,this.float32[p+2]=c,e}}lt.prototype.bytesPerElement=12,Ue(lt,"StructArrayLayout2ub2f12");class ot extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,n){const s=this.length;return this.resize(s+1),this.emplace(s,e,i,n)}emplace(e,i,n,s){const c=3*e;return this.float32[c+0]=i,this.float32[c+1]=n,this.float32[c+2]=s,e}}ot.prototype.bytesPerElement=12,Ue(ot,"StructArrayLayout3f12");class je extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,n){const s=this.length;return this.resize(s+1),this.emplace(s,e,i,n)}emplace(e,i,n,s){const c=3*e;return this.uint16[c+0]=i,this.uint16[c+1]=n,this.uint16[c+2]=s,e}}je.prototype.bytesPerElement=6,Ue(je,"StructArrayLayout3ui6");class wt extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c,u,p,m,_,x,b,w,S,M,C,D,U,q,V,$,X){const W=this.length;return this.resize(W+1),this.emplace(W,e,i,n,s,c,u,p,m,_,x,b,w,S,M,C,D,U,q,V,$,X)}emplace(e,i,n,s,c,u,p,m,_,x,b,w,S,M,C,D,U,q,V,$,X,W){const ce=30*e,se=15*e,me=60*e;return this.int16[ce+0]=i,this.int16[ce+1]=n,this.int16[ce+2]=s,this.float32[se+2]=c,this.float32[se+3]=u,this.uint16[ce+8]=p,this.uint16[ce+9]=m,this.uint32[se+5]=_,this.uint32[se+6]=x,this.uint32[se+7]=b,this.uint16[ce+16]=w,this.uint16[ce+17]=S,this.uint16[ce+18]=M,this.float32[se+10]=C,this.float32[se+11]=D,this.uint8[me+48]=U,this.uint8[me+49]=q,this.uint8[me+50]=V,this.uint32[se+13]=$,this.int16[ce+28]=X,this.uint8[me+58]=W,e}}wt.prototype.bytesPerElement=60,Ue(wt,"StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60");class Tt extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c,u,p,m,_,x,b,w,S,M,C,D,U,q,V,$,X,W,ce,se,me,Ee,ue,ye,xe,be){const Ce=this.length;return this.resize(Ce+1),this.emplace(Ce,e,i,n,s,c,u,p,m,_,x,b,w,S,M,C,D,U,q,V,$,X,W,ce,se,me,Ee,ue,ye,xe,be)}emplace(e,i,n,s,c,u,p,m,_,x,b,w,S,M,C,D,U,q,V,$,X,W,ce,se,me,Ee,ue,ye,xe,be,Ce){const pe=38*e,De=19*e;return this.int16[pe+0]=i,this.int16[pe+1]=n,this.int16[pe+2]=s,this.float32[De+2]=c,this.float32[De+3]=u,this.int16[pe+8]=p,this.int16[pe+9]=m,this.int16[pe+10]=_,this.int16[pe+11]=x,this.int16[pe+12]=b,this.int16[pe+13]=w,this.uint16[pe+14]=S,this.uint16[pe+15]=M,this.uint16[pe+16]=C,this.uint16[pe+17]=D,this.uint16[pe+18]=U,this.uint16[pe+19]=q,this.uint16[pe+20]=V,this.uint16[pe+21]=$,this.uint16[pe+22]=X,this.uint16[pe+23]=W,this.uint16[pe+24]=ce,this.uint16[pe+25]=se,this.uint16[pe+26]=me,this.uint16[pe+27]=Ee,this.uint16[pe+28]=ue,this.uint32[De+15]=ye,this.float32[De+16]=xe,this.float32[De+17]=be,this.float32[De+18]=Ce,e}}Tt.prototype.bytesPerElement=76,Ue(Tt,"StructArrayLayout3i2f6i15ui1ul3f76");class Et extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.float32[1*e+0]=i,e}}Et.prototype.bytesPerElement=4,Ue(Et,"StructArrayLayout1f4");class St extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c){const u=this.length;return this.resize(u+1),this.emplace(u,e,i,n,s,c)}emplace(e,i,n,s,c,u){const p=5*e;return this.float32[p+0]=i,this.float32[p+1]=n,this.float32[p+2]=s,this.float32[p+3]=c,this.float32[p+4]=u,e}}St.prototype.bytesPerElement=20,Ue(St,"StructArrayLayout5f20");class vi extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,n,s){const c=this.length;return this.resize(c+1),this.emplace(c,e,i,n,s)}emplace(e,i,n,s,c){const u=6*e;return this.uint32[3*e+0]=i,this.uint16[u+2]=n,this.uint16[u+3]=s,this.uint16[u+4]=c,e}}vi.prototype.bytesPerElement=12,Ue(vi,"StructArrayLayout1ul3ui12");class ui extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,i)}emplace(e,i,n){const s=2*e;return this.uint16[s+0]=i,this.uint16[s+1]=n,e}}ui.prototype.bytesPerElement=4,Ue(ui,"StructArrayLayout2ui4");class Zi extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.uint16[1*e+0]=i,e}}Zi.prototype.bytesPerElement=2,Ue(Zi,"StructArrayLayout1ui2");class dr extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,i)}emplace(e,i,n){const s=2*e;return this.float32[s+0]=i,this.float32[s+1]=n,e}}dr.prototype.bytesPerElement=8,Ue(dr,"StructArrayLayout2f8");class Ft extends Y{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.int16[this._pos2+3]}get tileAnchorY(){return this._structArray.int16[this._pos2+4]}get x1(){return this._structArray.float32[this._pos4+3]}get y1(){return this._structArray.float32[this._pos4+4]}get x2(){return this._structArray.float32[this._pos4+5]}get y2(){return this._structArray.float32[this._pos4+6]}get padding(){return this._structArray.int16[this._pos2+14]}get featureIndex(){return this._structArray.uint32[this._pos4+8]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+18]}get bucketIndex(){return this._structArray.uint16[this._pos2+19]}}Ft.prototype.size=40;class Mt extends Xe{get(e){return new Ft(this,e)}}Ue(Mt,"CollisionBoxArray");class yt extends Y{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+8]}get numGlyphs(){return this._structArray.uint16[this._pos2+9]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+5]}get lineStartIndex(){return this._structArray.uint32[this._pos4+6]}get lineLength(){return this._structArray.uint32[this._pos4+7]}get segment(){return this._structArray.uint16[this._pos2+16]}get lowerSize(){return this._structArray.uint16[this._pos2+17]}get upperSize(){return this._structArray.uint16[this._pos2+18]}get lineOffsetX(){return this._structArray.float32[this._pos4+10]}get lineOffsetY(){return this._structArray.float32[this._pos4+11]}get writingMode(){return this._structArray.uint8[this._pos1+48]}get placedOrientation(){return this._structArray.uint8[this._pos1+49]}set placedOrientation(e){this._structArray.uint8[this._pos1+49]=e}get hidden(){return this._structArray.uint8[this._pos1+50]}set hidden(e){this._structArray.uint8[this._pos1+50]=e}get crossTileID(){return this._structArray.uint32[this._pos4+13]}set crossTileID(e){this._structArray.uint32[this._pos4+13]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+28]}get flipState(){return this._structArray.uint8[this._pos1+58]}set flipState(e){this._structArray.uint8[this._pos1+58]=e}}yt.prototype.size=60;class Kt extends wt{get(e){return new yt(this,e)}}Ue(Kt,"PlacedSymbolArray");class Ei extends Y{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+8]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+9]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+10]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+11]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+12]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+13]}get key(){return this._structArray.uint16[this._pos2+14]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+17]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+18]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+19]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+20]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+21]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+22]}get featureIndex(){return this._structArray.uint16[this._pos2+23]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+24]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+25]}get numIconVertices(){return this._structArray.uint16[this._pos2+26]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+27]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+28]}get crossTileID(){return this._structArray.uint32[this._pos4+15]}set crossTileID(e){this._structArray.uint32[this._pos4+15]=e}get textOffset0(){return this._structArray.float32[this._pos4+16]}get textOffset1(){return this._structArray.float32[this._pos4+17]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+18]}}Ei.prototype.size=76;class Bt extends Tt{get(e){return new Ei(this,e)}}Ue(Bt,"SymbolInstanceArray");class Ii extends Et{getoffsetX(e){return this.float32[1*e+0]}}Ue(Ii,"GlyphOffsetArray");class Js extends Te{getx(e){return this.int16[2*e+0]}gety(e){return this.int16[2*e+1]}}Ue(Js,"SymbolLineVertexArray");class Mn extends Y{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]}get layoutVertexArrayOffset(){return this._structArray.uint16[this._pos2+4]}}Mn.prototype.size=12;class is extends vi{get(e){return new Mn(this,e)}}Ue(is,"FeatureIndexArray");class Lr extends ui{geta_centroid_pos0(e){return this.uint16[2*e+0]}geta_centroid_pos1(e){return this.uint16[2*e+1]}}Ue(Lr,"FillExtrusionCentroidArray");const Jr=te([{name:"a_pattern",components:4,type:"Uint16"},{name:"a_pixel_ratio",components:1,type:"Float32"}]),An=te([{name:"a_dash",components:4,type:"Uint16"}]);var Qs={exports:{}},rs={exports:{}};rs.exports=function(t,e){var i,n,s,c,u,p,m,_;for(n=t.length-(i=3&t.length),s=e,u=3432918353,p=461845907,_=0;_>>16)*u&65535)<<16)&4294967295)<<15|m>>>17))*p+(((m>>>16)*p&65535)<<16)&4294967295)<<13|s>>>19))+((5*(s>>>16)&65535)<<16)&4294967295))+((58964+(c>>>16)&65535)<<16);switch(m=0,i){case 3:m^=(255&t.charCodeAt(_+2))<<16;case 2:m^=(255&t.charCodeAt(_+1))<<8;case 1:s^=m=(65535&(m=(m=(65535&(m^=255&t.charCodeAt(_)))*u+(((m>>>16)*u&65535)<<16)&4294967295)<<15|m>>>17))*p+(((m>>>16)*p&65535)<<16)&4294967295}return s^=t.length,s=2246822507*(65535&(s^=s>>>16))+((2246822507*(s>>>16)&65535)<<16)&4294967295,s=3266489909*(65535&(s^=s>>>13))+((3266489909*(s>>>16)&65535)<<16)&4294967295,(s^=s>>>16)>>>0};var xl=rs.exports,sd={exports:{}};sd.exports=function(t,e){for(var i,n=t.length,s=e^n,c=0;n>=4;)i=1540483477*(65535&(i=255&t.charCodeAt(c)|(255&t.charCodeAt(++c))<<8|(255&t.charCodeAt(++c))<<16|(255&t.charCodeAt(++c))<<24))+((1540483477*(i>>>16)&65535)<<16),s=1540483477*(65535&s)+((1540483477*(s>>>16)&65535)<<16)^(i=1540483477*(65535&(i^=i>>>24))+((1540483477*(i>>>16)&65535)<<16)),n-=4,++c;switch(n){case 3:s^=(255&t.charCodeAt(c+2))<<16;case 2:s^=(255&t.charCodeAt(c+1))<<8;case 1:s=1540483477*(65535&(s^=255&t.charCodeAt(c)))+((1540483477*(s>>>16)&65535)<<16)}return s=1540483477*(65535&(s^=s>>>13))+((1540483477*(s>>>16)&65535)<<16),(s^=s>>>15)>>>0};var ad=xl,Nf=sd.exports;Qs.exports=ad,Qs.exports.murmur3=ad,Qs.exports.murmur2=Nf;var Kh=Yi(Qs.exports);class jc{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,i,n,s){this.ids.push(ld(e)),this.positions.push(i,n,s)}getPositions(e){const i=ld(e);let n=0,s=this.ids.length-1;for(;n>1;this.ids[u]>=i?s=u:n=u+1}const c=[];for(;this.ids[n]===i;)c.push({index:this.positions[3*n],start:this.positions[3*n+1],end:this.positions[3*n+2]}),n++;return c}static serialize(e,i){const n=new Float64Array(e.ids),s=new Uint32Array(e.positions);return Yh(n,s,0,n.length-1),i&&i.push(n.buffer,s.buffer),{ids:n,positions:s}}static deserialize(e){const i=new jc;return i.ids=e.ids,i.positions=e.positions,i.indexed=!0,i}}function ld(t){const e=+t;return!isNaN(e)&&Number.MIN_SAFE_INTEGER<=e&&e<=Number.MAX_SAFE_INTEGER?e:Kh(String(t))}function Yh(t,e,i,n){for(;i>1];let c=i-1,u=n+1;for(;;){do c++;while(t[c]s);if(c>=u)break;Gc(t,c,u),Gc(e,3*c,3*u),Gc(e,3*c+1,3*u+1),Gc(e,3*c+2,3*u+2)}u-i`u_${s}`),this.type=n}setUniform(e,i,n,s,c){i.set(e,c,s.constantOr(this.value))}getBinding(e,i){return this.type==="color"?new hd(e):new $c(e)}}class ea{constructor(e,i){this.uniformNames=i.map(n=>`u_${n}`),this.pattern=null,this.pixelRatio=1}setConstantPatternPositions(e){this.pixelRatio=e.pixelRatio||1,this.pattern=e.tl.concat(e.br)}setUniform(e,i,n,s,c){const u=c==="u_pattern"||c==="u_dash"?this.pattern:c==="u_pixel_ratio"?this.pixelRatio:null;u&&i.set(e,c,u)}getBinding(e,i){return i==="u_pattern"||i==="u_dash"?new cd(e):new $c(e)}}class Cn{constructor(e,i,n,s){this.expression=e,this.type=n,this.maxValue=0,this.paintVertexAttributes=i.map(c=>({name:`a_${c}`,type:"Float32",components:n==="color"?2:1,offset:0})),this.paintVertexArray=new s}populatePaintArray(e,i,n,s,c,u){const p=this.paintVertexArray.length,m=this.expression.evaluate(new v(0),i,{},c,s,u);this.paintVertexArray.resize(e),this._setPaintValue(p,e,m)}updatePaintArray(e,i,n,s,c){const u=this.expression.evaluate({zoom:0},n,s,void 0,c);this._setPaintValue(e,i,u)}_setPaintValue(e,i,n){if(this.type==="color"){const s=Jh(n);for(let c=e;c`u_${p}_t`),this.type=n,this.useIntegerZoom=s,this.zoom=c,this.maxValue=0,this.paintVertexAttributes=i.map(p=>({name:`a_${p}`,type:"Float32",components:n==="color"?4:2,offset:0})),this.paintVertexArray=new u}populatePaintArray(e,i,n,s,c,u){const p=this.expression.evaluate(new v(this.zoom),i,{},c,s,u),m=this.expression.evaluate(new v(this.zoom+1),i,{},c,s,u),_=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(_,e,p,m)}updatePaintArray(e,i,n,s,c){const u=this.expression.evaluate({zoom:this.zoom},n,s,void 0,c),p=this.expression.evaluate({zoom:this.zoom+1},n,s,void 0,c);this._setPaintValue(e,i,u,p)}_setPaintValue(e,i,n,s){if(this.type==="color"){const c=Jh(n),u=Jh(s);for(let p=e;p!0){this.binders={},this._buffers=[];const s=[];for(const c in e.paint._values){if(!n(c))continue;const u=e.paint.get(c);if(!(u instanceof B&&io(u.property.specification)))continue;const p=qf(c,e.type),m=u.value,_=u.property.specification.type,x=!!u.property.useIntegerZoom,b=c==="line-dasharray"||c.endsWith("pattern"),w=c==="line-dasharray"&&e.layout.get("line-cap").value.kind!=="constant";if(m.kind!=="constant"||w)if(m.kind==="source"||w||b){const S=ud(c,_,"source");this.binders[c]=b?new ho(m,p,_,S,e.id):new Cn(m,p,_,S),s.push(`/a_${c}`)}else{const S=ud(c,_,"composite");this.binders[c]=new Rr(m,p,_,x,i,S),s.push(`/z_${c}`)}else this.binders[c]=b?new ea(m.value,p):new vl(m.value,p,_),s.push(`/u_${c}`)}this.cacheKey=s.sort().join("")}getMaxValue(e){const i=this.binders[e];return i instanceof Cn||i instanceof Rr?i.maxValue:0}populatePaintArrays(e,i,n,s,c,u){for(const p in this.binders){const m=this.binders[p];(m instanceof Cn||m instanceof Rr||m instanceof ho)&&m.populatePaintArray(e,i,n,s,c,u)}}setConstantPatternPositions(e){for(const i in this.binders){const n=this.binders[i];n instanceof ea&&n.setConstantPatternPositions(e)}}updatePaintArrays(e,i,n,s,c,u){let p=!1;for(const m in e){const _=i.getPositions(m);for(const x of _){const b=n.feature(x.index);for(const w in this.binders){const S=this.binders[w];if((S instanceof Cn||S instanceof Rr||S instanceof ho)&&S.expression.isStateDependent===!0){const M=s.paint.get(w);S.expression=M.value,S.updatePaintArray(x.start,x.end,b,e[m],c,u),p=!0}}}}return p}defines(){const e=[];for(const i in this.binders){const n=this.binders[i];(n instanceof vl||n instanceof ea)&&e.push(...n.uniformNames.map(s=>`#define HAS_UNIFORM_${s}`))}return e}getBinderAttributes(){const e=[];for(const i in this.binders){const n=this.binders[i];if(n instanceof Cn||n instanceof Rr||n instanceof ho)for(let s=0;s!0){this.programConfigurations={};for(const s of e)this.programConfigurations[s.id]=new uo(s,i,n);this.needsUpload=!1,this._featureMap=new jc,this._bufferOffset=0}populatePaintArrays(e,i,n,s,c,u,p){for(const m in this.programConfigurations)this.programConfigurations[m].populatePaintArrays(e,i,s,c,u,p);i.id!==void 0&&this._featureMap.add(i.id,n,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,i,n,s,c){for(const u of n)this.needsUpload=this.programConfigurations[u.id].updatePaintArrays(e,this._featureMap,i,u,s,c)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const i in this.programConfigurations)this.programConfigurations[i].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}const Zf={"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","pixel_ratio"],"fill-pattern":["pattern","pixel_ratio"],"fill-extrusion-pattern":["pattern","pixel_ratio"],"line-dasharray":["dash"]};function qf(t,e){return Zf[t]||[t.replace(`${e}-`,"").replace(/-/g,"_")]}const Wf={"line-pattern":{source:ae,composite:ae},"fill-pattern":{source:ae,composite:ae},"fill-extrusion-pattern":{source:ae,composite:ae},"line-dasharray":{source:_e,composite:_e}},Xf={color:{source:dr,composite:we},number:{source:Et,composite:dr}};function ud(t,e,i){const n=Wf[t];return n&&n[i]||Xf[e][i]}Ue(vl,"ConstantBinder"),Ue(ea,"PatternConstantBinder"),Ue(Cn,"SourceExpressionBinder"),Ue(ho,"PatternCompositeBinder"),Ue(Rr,"CompositeExpressionBinder"),Ue(uo,"ProgramConfiguration",{omit:["_buffers"]}),Ue(ns,"ProgramConfigurationSet");const dd="-transition";class Br extends Po{constructor(e,i){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:()=>!0,needGeometry:!1,needFeature:!1},this._filterCompiled=!1,e.type!=="custom"&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type!=="background"&&e.type!=="sky"&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),i.layout&&(this._unevaluatedLayout=new O(i.layout)),i.paint)){this._transitionablePaint=new A(i.paint);for(const n in e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(const n in e.layout)this.setLayoutProperty(n,e.layout[n],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new F(i.paint)}}getLayoutProperty(e){return e==="visibility"?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,i,n={}){i!=null&&this._validate(Zh,`layers.${this.id}.layout.${e}`,e,i,n)||(e!=="visibility"?this._unevaluatedLayout.setValue(e,i):this.visibility=i)}getPaintProperty(e){return Un(e,dd)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,i,n={}){if(i!=null&&this._validate($h,`layers.${this.id}.paint.${e}`,e,i,n))return!1;if(Un(e,dd))return this._transitionablePaint.setTransition(e.slice(0,-11),i||void 0),!1;{const s=this._transitionablePaint._values[e],c=s.value.isDataDriven(),u=s.value;this._transitionablePaint.setValue(e,i),this._handleSpecialPaintPropertyUpdate(e);const p=this._transitionablePaint._values[e].value,m=p.isDataDriven(),_=Un(e,"pattern")||e==="line-dasharray";return m||c||_||this._handleOverridablePaintPropertyUpdate(e,u,p)}}_handleSpecialPaintPropertyUpdate(e){}getProgramIds(){return null}getProgramConfiguration(e){return null}_handleOverridablePaintPropertyUpdate(e,i,n){return!1}isHidden(e){return!!(this.minzoom&&e=this.maxzoom)||this.visibility==="none"}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,i){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,i)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,i)}serialize(){const e={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&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),Vn(e,(i,n)=>!(i===void 0||n==="layout"&&!Object.keys(i).length||n==="paint"&&!Object.keys(i).length))}_validate(e,i,n,s,c={}){return(!c||c.validate!==!1)&&Fc(this,e.call(Oc,{key:i,layerType:this.type,objectKey:n,value:s,styleSpec:fe,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isSky(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const e in this.paint._values){const i=this.paint.get(e);if(i instanceof B&&io(i.property.specification)&&(i.value.kind==="source"||i.value.kind==="composite")&&i.value.isStateDependent)return!0}return!1}compileFilter(){this._filterCompiled||(this._featureFilter=Xs(this.filter),this._filterCompiled=!0)}invalidateCompiledFilter(){this._filterCompiled=!1}dynamicFilter(){return this._featureFilter.dynamicFilter}dynamicFilterNeedsFeature(){return this._featureFilter.needFeature}}const Hf=te([{name:"a_pos",components:2,type:"Int16"}],4),Kf=te([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]);class Yt{constructor(e=[]){this.segments=e}prepareSegment(e,i,n,s){let c=this.segments[this.segments.length-1];return e>Yt.MAX_VERTEX_ARRAY_LENGTH&&Ut(`Max vertices per segment is ${Yt.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!c||c.vertexLength+e>Yt.MAX_VERTEX_ARRAY_LENGTH||c.sortKey!==s)&&(c={vertexOffset:i.length,primitiveOffset:n.length,vertexLength:0,primitiveLength:0},s!==void 0&&(c.sortKey=s),this.segments.push(c)),c}get(){return this.segments}destroy(){for(const e of this.segments)for(const i in e.vaos)e.vaos[i].destroy()}static simpleSegment(e,i,n,s){return new Yt([{vertexOffset:e,primitiveOffset:i,vertexLength:n,primitiveLength:s,vaos:{},sortKey:0}])}}Yt.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Ue(Yt,"SegmentVector");var Ze=8192;class po{constructor(e,i){e&&(i?this.setSouthWest(e).setNorthEast(i):e.length===4?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))}setNorthEast(e){return this._ne=e instanceof At?new At(e.lng,e.lat):At.convert(e),this}setSouthWest(e){return this._sw=e instanceof At?new At(e.lng,e.lat):At.convert(e),this}extend(e){const i=this._sw,n=this._ne;let s,c;if(e instanceof At)s=e,c=e;else{if(!(e instanceof po))return Array.isArray(e)?e.length===4||e.every(Array.isArray)?this.extend(po.convert(e)):this.extend(At.convert(e)):typeof e=="object"&&e!==null&&e.hasOwnProperty("lat")&&(e.hasOwnProperty("lon")||e.hasOwnProperty("lng"))?this.extend(At.convert(e)):this;if(s=e._sw,c=e._ne,!s||!c)return this}return i||n?(i.lng=Math.min(s.lng,i.lng),i.lat=Math.min(s.lat,i.lat),n.lng=Math.max(c.lng,n.lng),n.lat=Math.max(c.lat,n.lat)):(this._sw=new At(s.lng,s.lat),this._ne=new At(c.lng,c.lat)),this}getCenter(){return new At((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 At(this.getWest(),this.getNorth())}getSouthEast(){return new At(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(e){const{lng:i,lat:n}=At.convert(e);let s=this._sw.lng<=i&&i<=this._ne.lng;return this._sw.lng>this._ne.lng&&(s=this._sw.lng>=i&&i>=this._ne.lng),this._sw.lat<=n&&n<=this._ne.lat&&s}static convert(e){return!e||e instanceof po?e:new po(e)}}var Zc=1e-6,qi=typeof Float32Array<"u"?Float32Array:Array;function pd(){var t=new qi(9);return qi!=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}function fd(t,e,i){var n=e[0],s=e[1],c=e[2],u=e[3],p=e[4],m=e[5],_=e[6],x=e[7],b=e[8],w=i[0],S=i[1],M=i[2],C=i[3],D=i[4],U=i[5],q=i[6],V=i[7],$=i[8];return t[0]=w*n+S*u+M*_,t[1]=w*s+S*p+M*x,t[2]=w*c+S*m+M*b,t[3]=C*n+D*u+U*_,t[4]=C*s+D*p+U*x,t[5]=C*c+D*m+U*b,t[6]=q*n+V*u+$*_,t[7]=q*s+V*p+$*x,t[8]=q*c+V*m+$*b,t}function Or(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 Qh(t,e){var i=e[0],n=e[1],s=e[2],c=e[3],u=e[4],p=e[5],m=e[6],_=e[7],x=e[8],b=e[9],w=e[10],S=e[11],M=e[12],C=e[13],D=e[14],U=e[15],q=i*p-n*u,V=i*m-s*u,$=i*_-c*u,X=n*m-s*p,W=n*_-c*p,ce=s*_-c*m,se=x*C-b*M,me=x*D-w*M,Ee=x*U-S*M,ue=b*D-w*C,ye=b*U-S*C,xe=w*U-S*D,be=q*xe-V*ye+$*ue+X*Ee-W*me+ce*se;return be?(t[0]=(p*xe-m*ye+_*ue)*(be=1/be),t[1]=(s*ye-n*xe-c*ue)*be,t[2]=(C*ce-D*W+U*X)*be,t[3]=(w*W-b*ce-S*X)*be,t[4]=(m*Ee-u*xe-_*me)*be,t[5]=(i*xe-s*Ee+c*me)*be,t[6]=(D*$-M*ce-U*V)*be,t[7]=(x*ce-w*$+S*V)*be,t[8]=(u*ye-p*Ee+_*se)*be,t[9]=(n*Ee-i*ye-c*se)*be,t[10]=(M*W-C*$+U*q)*be,t[11]=(b*$-x*W-S*q)*be,t[12]=(p*me-u*ue-m*se)*be,t[13]=(i*ue-n*me+s*se)*be,t[14]=(C*V-M*X-D*q)*be,t[15]=(x*X-b*V+w*q)*be,t):null}function os(t,e,i){var n=e[0],s=e[1],c=e[2],u=e[3],p=e[4],m=e[5],_=e[6],x=e[7],b=e[8],w=e[9],S=e[10],M=e[11],C=e[12],D=e[13],U=e[14],q=e[15],V=i[0],$=i[1],X=i[2],W=i[3];return t[0]=V*n+$*p+X*b+W*C,t[1]=V*s+$*m+X*w+W*D,t[2]=V*c+$*_+X*S+W*U,t[3]=V*u+$*x+X*M+W*q,t[4]=(V=i[4])*n+($=i[5])*p+(X=i[6])*b+(W=i[7])*C,t[5]=V*s+$*m+X*w+W*D,t[6]=V*c+$*_+X*S+W*U,t[7]=V*u+$*x+X*M+W*q,t[8]=(V=i[8])*n+($=i[9])*p+(X=i[10])*b+(W=i[11])*C,t[9]=V*s+$*m+X*w+W*D,t[10]=V*c+$*_+X*S+W*U,t[11]=V*u+$*x+X*M+W*q,t[12]=(V=i[12])*n+($=i[13])*p+(X=i[14])*b+(W=i[15])*C,t[13]=V*s+$*m+X*w+W*D,t[14]=V*c+$*_+X*S+W*U,t[15]=V*u+$*x+X*M+W*q,t}function bl(t,e,i){var n,s,c,u,p,m,_,x,b,w,S,M,C=i[0],D=i[1],U=i[2];return e===t?(t[12]=e[0]*C+e[4]*D+e[8]*U+e[12],t[13]=e[1]*C+e[5]*D+e[9]*U+e[13],t[14]=e[2]*C+e[6]*D+e[10]*U+e[14],t[15]=e[3]*C+e[7]*D+e[11]*U+e[15]):(s=e[1],c=e[2],u=e[3],p=e[4],m=e[5],_=e[6],x=e[7],b=e[8],w=e[9],S=e[10],M=e[11],t[0]=n=e[0],t[1]=s,t[2]=c,t[3]=u,t[4]=p,t[5]=m,t[6]=_,t[7]=x,t[8]=b,t[9]=w,t[10]=S,t[11]=M,t[12]=n*C+p*D+b*U+e[12],t[13]=s*C+m*D+w*U+e[13],t[14]=c*C+_*D+S*U+e[14],t[15]=u*C+x*D+M*U+e[15]),t}function ss(t,e,i){var n=i[0],s=i[1],c=i[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*s,t[5]=e[5]*s,t[6]=e[6]*s,t[7]=e[7]*s,t[8]=e[8]*c,t[9]=e[9]*c,t[10]=e[10]*c,t[11]=e[11]*c,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function eu(t,e,i){var n=Math.sin(i),s=Math.cos(i),c=e[4],u=e[5],p=e[6],m=e[7],_=e[8],x=e[9],b=e[10],w=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]=c*s+_*n,t[5]=u*s+x*n,t[6]=p*s+b*n,t[7]=m*s+w*n,t[8]=_*s-c*n,t[9]=x*s-u*n,t[10]=b*s-p*n,t[11]=w*s-m*n,t}function qc(t,e,i){var n=Math.sin(i),s=Math.cos(i),c=e[0],u=e[1],p=e[2],m=e[3],_=e[8],x=e[9],b=e[10],w=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=c*s-_*n,t[1]=u*s-x*n,t[2]=p*s-b*n,t[3]=m*s-w*n,t[8]=c*n+_*s,t[9]=u*n+x*s,t[10]=p*n+b*s,t[11]=m*n+w*s,t}function md(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}function _d(t,e,i){var n,s,c,u=i[0],p=i[1],m=i[2],_=Math.hypot(u,p,m);return _0&&(c=1/Math.sqrt(c)),t[0]=e[0]*c,t[1]=e[1]*c,t[2]=e[2]*c,t}function pr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ru(t,e,i){var n=e[0],s=e[1],c=e[2],u=i[0],p=i[1],m=i[2];return t[0]=s*m-c*p,t[1]=c*u-n*m,t[2]=n*p-s*u,t}function qt(t,e,i){var n=e[0],s=e[1],c=e[2],u=i[3]*n+i[7]*s+i[11]*c+i[15];return t[0]=(i[0]*n+i[4]*s+i[8]*c+i[12])/(u=u||1),t[1]=(i[1]*n+i[5]*s+i[9]*c+i[13])/u,t[2]=(i[2]*n+i[6]*s+i[10]*c+i[14])/u,t}function xd(t,e,i){var n=i[0],s=i[1],c=i[2],u=e[0],p=e[1],m=e[2],_=s*m-c*p,x=c*u-n*m,b=n*p-s*u,w=s*b-c*x,S=c*_-n*b,M=n*x-s*_,C=2*i[3];return x*=C,b*=C,S*=2,M*=2,t[0]=u+(_*=C)+(w*=2),t[1]=p+x+S,t[2]=m+b+M,t}var Ml,Fr=iu,Jf=yd,Qf=wl;function vd(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t}function bd(t,e){var i=e[0],n=e[1],s=e[2],c=e[3],u=i*i+n*n+s*s+c*c;return u>0&&(u=1/Math.sqrt(u)),t[0]=i*u,t[1]=n*u,t[2]=s*u,t[3]=c*u,t}function as(t,e,i){var n=e[0],s=e[1],c=e[2],u=e[3];return t[0]=i[0]*n+i[4]*s+i[8]*c+i[12]*u,t[1]=i[1]*n+i[5]*s+i[9]*c+i[13]*u,t[2]=i[2]*n+i[6]*s+i[10]*c+i[14]*u,t[3]=i[3]*n+i[7]*s+i[11]*c+i[15]*u,t}function wd(){var t=new qi(4);return qi!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Td(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function Ed(t,e,i){i*=.5;var n=e[0],s=e[1],c=e[2],u=e[3],p=Math.sin(i),m=Math.cos(i);return t[0]=n*m+u*p,t[1]=s*m+c*p,t[2]=c*m-s*p,t[3]=u*m-n*p,t}function Sd(t,e,i){i*=.5;var n=e[0],s=e[1],c=e[2],u=e[3],p=Math.sin(i),m=Math.cos(i);return t[0]=n*m-c*p,t[1]=s*m+u*p,t[2]=c*m+n*p,t[3]=u*m-s*p,t}tu(),Ml=new qi(4),qi!=Float32Array&&(Ml[0]=0,Ml[1]=0,Ml[2]=0,Ml[3]=0);var em=bd;tu(),ta(1,0,0),ta(0,1,0),wd(),wd(),pd();const tm=te([{type:"Float32",name:"a_globe_pos",components:3},{type:"Float32",name:"a_uv",components:2}]),{members:Md}=tm,Ad=te([{name:"a_pos_3",components:3,type:"Int16"}]);var Al=te([{name:"a_pos",type:"Int16",components:2}]);class nu{constructor(e,i){this.pos=e,this.dir=i}intersectsPlane(e,i,n){const s=pr(i,this.dir);if(Math.abs(s)<1e-6)return!1;const c=((e[0]-this.pos[0])*i[0]+(e[1]-this.pos[1])*i[1]+(e[2]-this.pos[2])*i[2])/s;return n[0]=this.pos[0]+this.dir[0]*c,n[1]=this.pos[1]+this.dir[1]*c,n[2]=this.pos[2]+this.dir[2]*c,!0}closestPointOnSphere(e,i,n){if(function(S,M){var C=S[0],D=S[1],U=S[2],q=M[0],V=M[1],$=M[2];return Math.abs(C-q)<=Zc*Math.max(1,Math.abs(C),Math.abs(q))&&Math.abs(D-V)<=Zc*Math.max(1,Math.abs(D),Math.abs(V))&&Math.abs(U-$)<=Zc*Math.max(1,Math.abs(U),Math.abs($))}(this.pos,e)||i===0)return n[0]=n[1]=n[2]=0,!1;const[s,c,u]=this.dir,p=this.pos[0]-e[0],m=this.pos[1]-e[1],_=this.pos[2]-e[2],x=s*s+c*c+u*u,b=2*(p*s+m*c+_*u),w=b*b-4*x*(p*p+m*m+_*_-i*i);if(w<0){const S=Math.max(-b/2,0),M=p+s*S,C=m+c*S,D=_+u*S,U=Math.hypot(M,C,D);return n[0]=M*i/U,n[1]=C*i/U,n[2]=D*i/U,!1}{const S=(-b-Math.sqrt(w))/(2*x);if(S<0){const M=Math.hypot(p,m,_);return n[0]=p*i/M,n[1]=m*i/M,n[2]=_*i/M,!1}return n[0]=p+s*S,n[1]=m+c*S,n[2]=_+u*S,!0}}}class ou{constructor(e,i,n,s,c){this.TL=e,this.TR=i,this.BR=n,this.BL=s,this.horizon=c}static fromInvProjectionMatrix(e,i,n){const s=[-1,1,1],c=[1,1,1],u=[1,-1,1],p=[-1,-1,1],m=qt(s,s,e),_=qt(c,c,e),x=qt(u,u,e),b=qt(p,p,e);return new ou(m,_,x,b,i/n)}}class su{constructor(e,i){this.points=e,this.planes=i}static fromInvProjectionMatrix(e,i,n,s){const c=Math.pow(2,n),u=[[-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(m=>{const _=as([],m,e),x=1/_[3]/i*c;return function(b,w,S){return b[0]=w[0]*S[0],b[1]=w[1]*S[1],b[2]=w[2]*S[2],b[3]=w[3]*S[3],b}(_,_,[x,x,s?1/_[3]:x,x])}),p=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(m=>{const _=Ci([],ru([],Fr([],u[m[0]],u[m[1]]),Fr([],u[m[2]],u[m[1]]))),x=-pr(_,u[m[1]]);return _.concat(x)});return new su(u,p)}}class zi{static fromPoints(e){const i=[1/0,1/0,1/0],n=[-1/0,-1/0,-1/0];for(const s of e)Tl(i,i,s),El(n,n,s);return new zi(i,n)}static applyTransform(e,i){const n=e.getCorners();for(let s=0;s=0;if(u===0)return 0;u!==i.length&&(n=!1)}if(n)return 2;for(let s=0;s<3;s++){let c=Number.MAX_VALUE,u=-Number.MAX_VALUE;for(let p=0;pthis.max[s]-this.min[s])return 0}return 1}}const au=5,Id=6,Qr=Ze/Math.PI/2,im=16383,ls=64,Il=[ls,32,16],fr=-Qr,mr=Qr,rm=[new zi([fr,fr,fr],[mr,mr,mr]),new zi([fr,fr,fr],[0,0,mr]),new zi([0,fr,fr],[mr,0,mr]),new zi([fr,0,fr],[0,mr,mr]),new zi([0,0,fr],[mr,mr,mr])];function Wc(t){return t*Qr/Pl}function Cd(t,e,i,n=!0){const s=rr([],t._camera.position,t.worldSize),c=[e,i,1,1];as(c,c,t.pixelMatrixInverse),vd(c,c,1/c[3]);const u=Ci([],Fr([],c,s)),p=t.globeMatrix,m=[p[12],p[13],p[14]],_=Fr([],m,s),x=wl(_),b=Ci([],_),w=t.worldSize/(2*Math.PI),S=pr(b,u),M=Math.asin(w/x);if(M1?null:function(n,s,c,u){const p=Math.sin(c);return n*(Math.sin((1-u)*c)/p)+s*(Math.sin(u*c)/p)}(t.a[e],t.b[e],t.angle,ct(i,0,1))+t.center[e]}function en(t){if(t.z<=1)return rm[t.z+2*t.y+t.x];const e=cu(Xc(t));return zi.fromPoints(e)}function cs(t,e,i){return rr(t,t,1-i),Sl(t,t,e,i)}function zd(t,e){const i=na(e.zoom);if(i===0)return en(t);const n=Xc(t),s=cu(n),c=tn(n.getWest())*e.worldSize,u=tn(n.getEast())*e.worldSize,p=rn(n.getNorth())*e.worldSize,m=rn(n.getSouth())*e.worldSize,_=[c,p,0],x=[u,p,0],b=[c,m,0],w=[u,m,0],S=Qh([],e.globeMatrix);return qt(_,_,S),qt(x,x,S),qt(b,b,S),qt(w,w,S),s[0]=cs(s[0],b,i),s[1]=cs(s[1],w,i),s[2]=cs(s[2],x,i),s[3]=cs(s[3],_,i),zi.fromPoints(s)}function Pd(t,e,i){for(const n of t)qt(n,n,e),rr(n,n,i)}function om(t,e,i){const n=e/t.worldSize,s=t.globeMatrix;if(i.z<=1){const se=en(i).getCorners();return Pd(se,s,n),zi.fromPoints(se)}const c=Xc(i),u=cu(c);Pd(u,s,n);const p=Number.MAX_VALUE,m=[-p,-p,-p],_=[p,p,p];if(c.contains(t.center)){for(const Ee of u)Tl(_,_,Ee),El(m,m,Ee);m[2]=0;const se=t.point,me=[se.x*n,se.y*n,0];return Tl(_,_,me),El(m,m,me),new zi(_,m)}const x=[s[12]*n,s[13]*n,s[14]*n],b=c.getCenter(),w=ct(t.center.lat,-wi,wi),S=ct(b.lat,-wi,wi),M=tn(t.center.lng),C=rn(w);let D=M-tn(b.lng);const U=C-rn(S);D>.5?D-=1:D<-.5&&(D+=1);let q=0;Math.abs(D)>Math.abs(U)?q=D>=0?1:3:(q=U>=0?0:2,Sl(x,x,[s[4]*n,s[5]*n,s[6]*n],-Math.sin(dt(U>=0?c.getSouth():c.getNorth()))*Qr));const V=u[q],$=u[(q+1)%4],X=new nm(V,$,x),W=[lu(X,0)||V[0],lu(X,1)||V[1],lu(X,2)||V[2]],ce=na(t.zoom);if(ce>0){const se=function({x:Ee,y:ue,z:ye},xe,be,Ce,pe){const De=1/(1<.5?$e=-1:Ke<-.5&&($e=1),Ne=((Ne+$e)*xe-(Ce*=xe))*be+Ce,Re=((Re+$e)*xe-Ce)*be+Ce,He=(He*xe-(pe*=xe))*be+pe,ze=(ze*xe-pe)*be+pe,[[Ne,ze,0],[Re,ze,0],[Re,He,0],[Ne,He,0]]}(i,e,t._pixelsPerMercatorPixel,M,C);for(let Ee=0;EeMath.PI/2*1.01}const Rd=dt(85),sm=Math.cos(Rd),am=Math.sin(Rd),Pl=63710088e-1,Bd=2*Math.PI*Pl;class fo{constructor(e,i){if(isNaN(e)||isNaN(i))throw new Error(`Invalid LngLat object: (${e}, ${i})`);if(this.lng=+e,this.lat=+i,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new fo(oi(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const i=Math.PI/180,n=this.lat*i,s=e.lat*i,c=Math.sin(n)*Math.sin(s)+Math.cos(n)*Math.cos(s)*Math.cos((e.lng-this.lng)*i);return Pl*Math.acos(Math.min(c,1))}toBounds(e=0){const i=360*e/40075017,n=i/Math.cos(Math.PI/180*this.lat);return new po(new fo(this.lng-n,this.lat-i),new fo(this.lng+n,this.lat+i))}toEcef(e){const i=Wc(e);return ra(this.lat,this.lng,Qr+i)}static convert(e){if(e instanceof fo)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new fo(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new fo(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}var At=fo;function du(t){return Bd*Math.cos(t*Math.PI/180)}function tn(t){return(180+t)/360}function rn(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Ur(t,e){return t/du(e)}function nr(t){return 360*t-180}function bi(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}function Od(t,e){return t*du(bi(e))}const wi=85.051129;function Fd(t){return 1/Math.cos(t*Math.PI/180)}class oa{constructor(e,i,n=0){this.x=+e,this.y=+i,this.z=+n}static fromLngLat(e,i=0){const n=At.convert(e);return new oa(tn(n.lng),rn(n.lat),Ur(i,n.lat))}toLngLat(){return new At(nr(this.x),bi(this.y))}toAltitude(){return Od(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/Bd*Fd(bi(this.y))}}function pu(t,e,i,n,s,c,u,p,m){const _=(e+n)/2,x=(i+s)/2,b=new Le(_,x);p(b),function(w,S,M,C,D,U){const q=M-D,V=C-U;return Math.abs((C-S)*q-(M-w)*V)/Math.hypot(q,V)}(b.x,b.y,c.x,c.y,u.x,u.y)>=m?(pu(t,e,i,_,x,c,b,p,m),pu(t,_,x,n,s,b,u,p,m)):t.push(u)}function Ud(t,e,i){let n=t[0],s=n.x,c=n.y;e(n);const u=[n];for(let p=1;pt.x+1||nt.y+1)&&Ut("Geometry exceeds allowed extent, reduce your vector tile buffer size"),t}function Pn(t,e,i){const n=t.loadGeometry(),s=t.extent,c=Ze/s;if(e&&i&&i.projection.isReprojectedInTileSpace){const u=1<{const S=nr((e.x+w.x/s)/u),M=bi((e.y+w.y/s)/u),C=x.project(S,M);w.x=(C.x*p-m)*s,w.y=(C.y*p-_)*s};for(let w=0;w=s||M.y<0||M.y>=s||(b(M),S.push(M));n[w]=S}}for(const u of n)for(const p of u)cm(p,c);return n}function hs(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?Pn(t):[]}}function Kc(t,e,i,n,s){t.emplaceBack(2*e+(n+1)/2,2*i+(s+1)/2)}function Yc(t,e,i){t.emplaceBack(e.x,e.y,e.z,i[0]*16384,i[1]*16384,i[2]*16384)}class _u{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(i=>i.id),this.index=e.index,this.hasPattern=!1,this.projection=e.projection,this.layoutVertexArray=new Te,this.indexArray=new je,this.segments=new Yt,this.programConfigurations=new ns(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id)}populate(e,i,n,s){const c=this.layers[0],u=[];let p=null;c.type==="circle"&&(p=c.layout.get("circle-sort-key"));for(const{feature:_,id:x,index:b,sourceLayerIndex:w}of e){const S=this.layers[0]._featureFilter.needGeometry,M=hs(_,S);if(!this.layers[0]._featureFilter.filter(new v(this.zoom),M,n))continue;const C=p?p.evaluate(M,{},n):void 0,D={id:x,properties:_.properties,type:_.type,sourceLayerIndex:w,index:b,geometry:S?M.geometry:Pn(_,n,s),patterns:{},sortKey:C};u.push(D)}p&&u.sort((_,x)=>_.sortKey-x.sortKey);let m=null;s.projection.name==="globe"&&(this.globeExtVertexArray=new Me,m=s.projection);for(const _ of u){const{geometry:x,index:b,sourceLayerIndex:w}=_,S=e[b].feature;this.addFeature(_,x,b,i.availableImages,n,m),i.featureIndex.insert(S,x,b,w,this.index)}}update(e,i,n,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,n,s)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Hf.members),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.globeExtVertexArray&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,Kf.members))),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}addFeature(e,i,n,s,c,u){for(const p of i)for(const m of p){const _=m.x,x=m.y;if(_<0||_>=Ze||x<0||x>=Ze)continue;if(u){const S=u.projectTilePoint(_,x,c),M=u.upVector(c,_,x),C=this.globeExtVertexArray;Yc(C,S,M),Yc(C,S,M),Yc(C,S,M),Yc(C,S,M)}const b=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),w=b.vertexLength;Kc(this.layoutVertexArray,_,x,-1,-1),Kc(this.layoutVertexArray,_,x,1,-1),Kc(this.layoutVertexArray,_,x,1,1),Kc(this.layoutVertexArray,_,x,-1,1),this.indexArray.emplaceBack(w,w+1,w+2),this.indexArray.emplaceBack(w,w+2,w+3),b.vertexLength+=4,b.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,{},s,c)}}function Nd(t,e){for(let i=0;i1){if(gu(t,e))return!0;for(let n=0;n1?i:i.sub(e)._mult(s)._add(e))}function $d(t,e){let i,n,s,c=!1;for(let u=0;ue.y!=s.y>e.y&&e.x<(s.x-n.x)*(e.y-n.y)/(s.y-n.y)+n.x&&(c=!c)}return c}function us(t,e){let i=!1;for(let n=0,s=t.length-1;ne.y!=u.y>e.y&&e.x<(u.x-c.x)*(e.y-c.y)/(u.y-c.y)+c.x&&(i=!i)}return i}function Zd(t,e,i,n,s){for(const u of t)if(e<=u.x&&i<=u.y&&n>=u.x&&s>=u.y)return!0;const c=[new Le(e,i),new Le(e,s),new Le(n,s),new Le(n,i)];if(t.length>2){for(const u of c)if(us(t,u))return!0}for(let u=0;us.x&&e.x>s.x||t.ys.y&&e.y>s.y)return!1;const c=Ui(t,e,i[0]);return c!==Ui(t,e,i[1])||c!==Ui(t,e,i[2])||c!==Ui(t,e,i[3])}function sa(t,e,i){const n=e.paint.get(t).value;return n.kind==="constant"?n.value:i.programConfigurations.get(e.id).getMaxValue(t)}function Jc(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function qd(t,e,i,n,s){if(!e[0]&&!e[1])return t;const c=Le.convert(e)._mult(s);i==="viewport"&&c._rotate(-n);const u=[];for(let p=0;p0){const V=i.projection.upVector(_,S.x,S.y);C.x+=V[0]*x*M,C.y+=V[1]*x*M,C.z+=V[2]*x*M}const D=c?S:_m(C.x,C.y,C.z,n),U=c?t.tilespaceRays.map(V=>ym(V,M)):t.queryGeometry.screenGeometry,q=as([],[C.x,C.y,C.z,1],n);if(!u&&c?m*=q[3]/i.cameraToCenterDistance:u&&!c&&(m*=i.cameraToCenterDistance/q[3]),c){const V=bi((w.y/Ze+_.y)/(1<<_.z));m/=i.projection.pixelsPerMeter(V,1)/Ur(1,V)}if(hm(U,D,m))return!0}return!1}function _m(t,e,i,n){const s=as([],[t,e,i,1],n);return new Le(s[0]/s[3],s[1]/s[3])}const Hd=ta(0,0,0),gm=ta(0,0,1);function ym(t,e){const i=tu();return Hd[2]=e,t.intersectsPlane(Hd,gm,i),new Le(i[0],i[1])}class Kd extends _u{}function Yd(t,{width:e,height:i},n,s){if(s){if(s instanceof Uint8ClampedArray)s=new Uint8Array(s.buffer);else if(s.length!==e*i*n)throw new RangeError("mismatched image size")}else s=new Uint8Array(e*i*n);return t.width=e,t.height=i,t.data=s,t}function Jd(t,e,i){const{width:n,height:s}=e;n===t.width&&s===t.height||(xu(t,e,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,n),height:Math.min(t.height,s)},i),t.width=n,t.height=s,t.data=e.data)}function xu(t,e,i,n,s,c){if(s.width===0||s.height===0)return e;if(s.width>t.width||s.height>t.height||i.x>t.width-s.width||i.y>t.height-s.height)throw new RangeError("out of range source coordinates for image copy");if(s.width>e.width||s.height>e.height||n.x>e.width-s.width||n.y>e.height-s.height)throw new RangeError("out of range destination coordinates for image copy");const u=t.data,p=e.data;for(let m=0;m{e[t.evaluationKey]=m;const _=t.expression.evaluate(e);s.data[u+p+0]=Math.floor(255*_.r/_.a),s.data[u+p+1]=Math.floor(255*_.g/_.a),s.data[u+p+2]=Math.floor(255*_.b/_.a),s.data[u+p+3]=Math.floor(255*_.a)};if(t.clips)for(let u=0,p=0;u80*i){n=c=t[0],s=u=t[1];for(var M=i;Mc&&(c=p),m>u&&(u=m);_=(_=Math.max(c-n,u-s))!==0?32767/_:0}return kl(w,S,i,n,s,_,0),S}function Qd(t,e,i,n,s){var c,u;if(s===Eu(t,e,i,n)>0)for(c=e;c=e;c-=n)u=ip(c,t[c],t[c+1],u);return u&&eh(u,u.next)&&(Ll(u),u=u.next),u}function ds(t,e){if(!t)return t;e||(e=t);var i,n=t;do if(i=!1,n.steiner||!eh(n,n.next)&&Jt(n.prev,n,n.next)!==0)n=n.next;else{if(Ll(n),(n=e=n.prev)===n.next)break;i=!0}while(i||n!==e);return e}function kl(t,e,i,n,s,c,u){if(t){!u&&c&&function(x,b,w,S){var M=x;do M.z===0&&(M.z=wu(M.x,M.y,b,w,S)),M.prevZ=M.prev,M.nextZ=M.next,M=M.next;while(M!==x);M.prevZ.nextZ=null,M.prevZ=null,function(C){var D,U,q,V,$,X,W,ce,se=1;do{for(U=C,C=null,$=null,X=0;U;){for(X++,q=U,W=0,D=0;D0||ce>0&&q;)W!==0&&(ce===0||!q||U.z<=q.z)?(V=U,U=U.nextZ,W--):(V=q,q=q.nextZ,ce--),$?$.nextZ=V:C=V,V.prevZ=$,$=V;U=q}$.nextZ=null,se*=2}while(X>1)}(M)}(t,n,s,c);for(var p,m,_=t;t.prev!==t.next;)if(p=t.prev,m=t.next,c?Em(t,n,s,c):Tm(t))e.push(p.i/i|0),e.push(t.i/i|0),e.push(m.i/i|0),Ll(t),t=m.next,_=m.next;else if((t=m)===_){u?u===1?kl(t=Sm(ds(t),e,i),e,i,n,s,c,2):u===2&&Mm(t,e,i,n,s,c):kl(ds(t),e,i,n,s,c,1);break}}}function Tm(t){var e=t.prev,i=t,n=t.next;if(Jt(e,i,n)>=0)return!1;for(var s=e.x,c=i.x,u=n.x,p=e.y,m=i.y,_=n.y,x=sc?s>u?s:u:c>u?c:u,S=p>m?p>_?p:_:m>_?m:_,M=n.next;M!==e;){if(M.x>=x&&M.x<=w&&M.y>=b&&M.y<=S&&aa(s,p,c,m,u,_,M.x,M.y)&&Jt(M.prev,M,M.next)>=0)return!1;M=M.next}return!0}function Em(t,e,i,n){var s=t.prev,c=t,u=t.next;if(Jt(s,c,u)>=0)return!1;for(var p=s.x,m=c.x,_=u.x,x=s.y,b=c.y,w=u.y,S=pm?p>_?p:_:m>_?m:_,D=x>b?x>w?x:w:b>w?b:w,U=wu(S,M,e,i,n),q=wu(C,D,e,i,n),V=t.prevZ,$=t.nextZ;V&&V.z>=U&&$&&$.z<=q;){if(V.x>=S&&V.x<=C&&V.y>=M&&V.y<=D&&V!==s&&V!==u&&aa(p,x,m,b,_,w,V.x,V.y)&&Jt(V.prev,V,V.next)>=0||(V=V.prevZ,$.x>=S&&$.x<=C&&$.y>=M&&$.y<=D&&$!==s&&$!==u&&aa(p,x,m,b,_,w,$.x,$.y)&&Jt($.prev,$,$.next)>=0))return!1;$=$.nextZ}for(;V&&V.z>=U;){if(V.x>=S&&V.x<=C&&V.y>=M&&V.y<=D&&V!==s&&V!==u&&aa(p,x,m,b,_,w,V.x,V.y)&&Jt(V.prev,V,V.next)>=0)return!1;V=V.prevZ}for(;$&&$.z<=q;){if($.x>=S&&$.x<=C&&$.y>=M&&$.y<=D&&$!==s&&$!==u&&aa(p,x,m,b,_,w,$.x,$.y)&&Jt($.prev,$,$.next)>=0)return!1;$=$.nextZ}return!0}function Sm(t,e,i){var n=t;do{var s=n.prev,c=n.next.next;!eh(s,c)&&ep(s,n,n.next,c)&&Dl(s,c)&&Dl(c,s)&&(e.push(s.i/i|0),e.push(n.i/i|0),e.push(c.i/i|0),Ll(n),Ll(n.next),n=t=c),n=n.next}while(n!==t);return ds(n)}function Mm(t,e,i,n,s,c){var u=t;do{for(var p=u.next.next;p!==u.prev;){if(u.i!==p.i&&Pm(u,p)){var m=tp(u,p);return u=ds(u,u.next),m=ds(m,m.next),kl(u,e,i,n,s,c,0),void kl(m,e,i,n,s,c,0)}p=p.next}u=u.next}while(u!==t)}function Am(t,e){return t.x-e.x}function Im(t,e){var i=function(s,c){var u,p=c,m=s.x,_=s.y,x=-1/0;do{if(_<=p.y&&_>=p.next.y&&p.next.y!==p.y){var b=p.x+(_-p.y)*(p.next.x-p.x)/(p.next.y-p.y);if(b<=m&&b>x&&(x=b,u=p.x=p.x&&p.x>=M&&m!==p.x&&aa(_u.x||p.x===u.x&&Cm(u,p)))&&(u=p,D=w)),p=p.next;while(p!==S);return u}(t,e);if(!i)return e;var n=tp(i,t);return ds(n,n.next),ds(i,i.next)}function Cm(t,e){return Jt(t.prev,t,e.prev)<0&&Jt(e.next,t,t.next)<0}function wu(t,e,i,n,s){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*s|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*s|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function zm(t){var e=t,i=t;do(e.x=(t-u)*(c-p)&&(t-u)*(n-p)>=(i-u)*(e-p)&&(i-u)*(c-p)>=(s-u)*(n-p)}function Pm(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(i,n){var s=i;do{if(s.i!==i.i&&s.next.i!==i.i&&s.i!==n.i&&s.next.i!==n.i&&ep(s,s.next,i,n))return!0;s=s.next}while(s!==i);return!1}(t,e)&&(Dl(t,e)&&Dl(e,t)&&function(i,n){var s=i,c=!1,u=(i.x+n.x)/2,p=(i.y+n.y)/2;do s.y>p!=s.next.y>p&&s.next.y!==s.y&&u<(s.next.x-s.x)*(p-s.y)/(s.next.y-s.y)+s.x&&(c=!c),s=s.next;while(s!==i);return c}(t,e)&&(Jt(t.prev,t,e.prev)||Jt(t,e.prev,e))||eh(t,e)&&Jt(t.prev,t,t.next)>0&&Jt(e.prev,e,e.next)>0)}function Jt(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function eh(t,e){return t.x===e.x&&t.y===e.y}function ep(t,e,i,n){var s=ih(Jt(t,e,i)),c=ih(Jt(t,e,n)),u=ih(Jt(i,n,t)),p=ih(Jt(i,n,e));return s!==c&&u!==p||!(s!==0||!th(t,i,e))||!(c!==0||!th(t,n,e))||!(u!==0||!th(i,t,n))||!(p!==0||!th(i,e,n))}function th(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 ih(t){return t>0?1:t<0?-1:0}function Dl(t,e){return Jt(t.prev,t,t.next)<0?Jt(t,e,t.next)>=0&&Jt(t,t.prev,e)>=0:Jt(t,e,t.prev)<0||Jt(t,t.next,e)<0}function tp(t,e){var i=new Tu(t.i,t.x,t.y),n=new Tu(e.i,e.x,e.y),s=t.next,c=e.prev;return t.next=e,e.prev=t,i.next=s,s.prev=i,n.next=i,i.prev=n,c.next=n,n.prev=c,n}function ip(t,e,i,n){var s=new Tu(t,e,i);return n?(s.next=n.next,s.prev=n,n.next.prev=s,n.next=s):(s.prev=s,s.next=s),s}function Ll(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 Tu(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Eu(t,e,i,n){for(var s=0,c=e,u=i-n;c0&&i.holes.push(n+=t[s-1].length)}return i};var Su=Yi(bu.exports);function km(t,e,i,n,s){rp(t,e,i||0,n||t.length-1,s||Dm)}function rp(t,e,i,n,s){for(;n>i;){if(n-i>600){var c=n-i+1,u=e-i+1,p=Math.log(c),m=.5*Math.exp(2*p/3),_=.5*Math.sqrt(p*m*(c-m)/c)*(u-c/2<0?-1:1);rp(t,e,Math.max(i,Math.floor(e-u*m/c+_)),Math.min(n,Math.floor(e+(c-u)*m/c+_)),s)}var x=t[e],b=i,w=n;for(Rl(t,i,e),s(t[n],x)>0&&Rl(t,i,n);b0;)w--}s(t[i],x)===0?Rl(t,i,w):Rl(t,++w,n),w<=e&&(i=w+1),e<=w&&(n=w-1)}}function Rl(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function Dm(t,e){return te?1:0}function Mu(t,e){const i=t.length;if(i<=1)return[t];const n=[];let s,c;for(let u=0;u1)for(let u=0;ui.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Te,this.indexArray=new je,this.indexArray2=new ui,this.programConfigurations=new ns(e.layers,e.zoom),this.segments=new Yt,this.segments2=new Yt,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id),this.projection=e.projection}populate(e,i,n,s){this.hasPattern=Au("fill",this.layers,i);const c=this.layers[0].layout.get("fill-sort-key"),u=[];for(const{feature:p,id:m,index:_,sourceLayerIndex:x}of e){const b=this.layers[0]._featureFilter.needGeometry,w=hs(p,b);if(!this.layers[0]._featureFilter.filter(new v(this.zoom),w,n))continue;const S=c?c.evaluate(w,{},n,i.availableImages):void 0,M={id:m,properties:p.properties,type:p.type,sourceLayerIndex:x,index:_,geometry:b?w.geometry:Pn(p,n,s),patterns:{},sortKey:S};u.push(M)}c&&u.sort((p,m)=>p.sortKey-m.sortKey);for(const p of u){const{geometry:m,index:_,sourceLayerIndex:x}=p;if(this.hasPattern){const b=Iu("fill",this.layers,p,this.zoom,i);this.patternFeatures.push(b)}else this.addFeature(p,m,_,n,{},i.availableImages);i.featureIndex.insert(e[_].feature,m,_,x,this.index)}}update(e,i,n,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,n,s)}addFeatures(e,i,n,s,c){for(const u of this.patternFeatures)this.addFeature(u,u.geometry,u.index,i,n,s)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,wm),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),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(e,i,n,s,c,u=[]){for(const p of Mu(i,500)){let m=0;for(const M of p)m+=M.length;const _=this.segments.prepareSegment(m,this.layoutVertexArray,this.indexArray),x=_.vertexLength,b=[],w=[];for(const M of p){if(M.length===0)continue;M!==p[0]&&w.push(b.length/2);const C=this.segments2.prepareSegment(M.length,this.layoutVertexArray,this.indexArray2),D=C.vertexLength;this.layoutVertexArray.emplaceBack(M[0].x,M[0].y),this.indexArray2.emplaceBack(D+M.length-1,D),b.push(M[0].x),b.push(M[0].y);for(let U=1;U>3}if(s--,n===1||n===2)c+=t.readSVarint(),u+=t.readSVarint(),n===1&&(e&&p.push(e),e=[]),e.push(new Nm(c,u));else{if(n!==7)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&p.push(e),p},la.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,i=1,n=0,s=0,c=0,u=1/0,p=-1/0,m=1/0,_=-1/0;t.pos>3}if(n--,i===1||i===2)(s+=t.readSVarint())p&&(p=s),(c+=t.readSVarint())_&&(_=c);else if(i!==7)throw new Error("unknown command "+i)}return[u,m,p,_]},la.prototype.toGeoJSON=function(t,e,i){var n,s,c=this.extent*Math.pow(2,i),u=this.extent*t,p=this.extent*e,m=this.loadGeometry(),_=la.types[this.type];function x(S){for(var M=0;M>3;s=u===1?n.readString():u===2?n.readFloat():u===3?n.readDouble():u===4?n.readVarint64():u===5?n.readVarint():u===6?n.readSVarint():u===7?n.readBoolean():null}return s}(i))}sp.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 $m(this._pbf,e,this.extent,this._keys,this._values)};var qm=op;function Wm(t,e,i){if(t===3){var n=new qm(i,i.readVarint()+i.pos);n.length&&(e[n.name]=n)}}var Cu=nh.VectorTile=function(t,e){this.layers=t.readFields(Wm,{},e)},oh=nh.VectorTileFeature=np;function sh(t,e,i,n){const s=[],c=n===0?(u,p,m,_,x,b)=>{u.push(new Le(b,m+(b-p)/(_-p)*(x-m)))}:(u,p,m,_,x,b)=>{u.push(new Le(p+(b-m)/(x-m)*(_-p),b))};for(const u of t){const p=[];for(const m of u){if(m.length<=2)continue;const _=[];for(let w=0;we&&c(_,S,M,C,D,e):U>i?q=e&&c(_,S,M,C,D,e),q>i&&U<=i&&c(_,S,M,C,D,i)}let x=m[m.length-1];const b=n===0?x.x:x.y;b>=e&&b<=i&&_.push(x),_.length&&(x=_[_.length-1],_[0].x===x.x&&_[0].y===x.y||_.push(_[0]),p.push(_))}p.length&&s.push(p)}return s}nh.VectorTileLayer=op;const Xm=oh.types,Hm=Math.pow(2,13);function Bl(t,e,i,n,s,c,u,p){t.emplaceBack((e<<1)+u,(i<<1)+c,(Math.floor(n*Hm)<<1)+s,Math.round(p))}function Ol(t,e,i){t.emplaceBack(e.x,e.y,e.z,i[0]*16384,i[1]*16384,i[2]*16384)}class ap{constructor(){this.acc=new Le(0,0),this.polyCount=[]}startRing(e){this.currentPolyCount={edges:0,top:0},this.polyCount.push(this.currentPolyCount),this.min||(this.min=new Le(e.x,e.y),this.max=new Le(e.x,e.y))}append(e,i){this.currentPolyCount.edges++,this.acc._add(e);const n=this.min,s=this.max;e.xs.x&&(s.x=e.x),e.ys.y&&(s.y=e.y),((e.x===0||e.x===Ze)&&e.x===i.x)!=((e.y===0||e.y===Ze)&&e.y===i.y)&&this.processBorderOverlap(e,i),i.x<0!=e.x<0&&this.addBorderIntersection(0,mt(i.y,e.y,(0-i.x)/(e.x-i.x))),i.x>Ze!=e.x>Ze&&this.addBorderIntersection(1,mt(i.y,e.y,(Ze-i.x)/(e.x-i.x))),i.y<0!=e.y<0&&this.addBorderIntersection(2,mt(i.x,e.x,(0-i.y)/(e.y-i.y))),i.y>Ze!=e.y>Ze&&this.addBorderIntersection(3,mt(i.x,e.x,(Ze-i.y)/(e.y-i.y)))}addBorderIntersection(e,i){this.borders||(this.borders=[[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE]]);const n=this.borders[e];in[1]&&(n[1]=i)}processBorderOverlap(e,i){if(e.x===i.x){if(e.y===i.y)return;const n=e.x===0?0:1;this.addBorderIntersection(n,i.y),this.addBorderIntersection(n,e.y)}else{const n=e.y===0?2:3;this.addBorderIntersection(n,i.x),this.addBorderIntersection(n,e.x)}}centroid(){const e=this.polyCount.reduce((i,n)=>i+n.edges,0);return e!==0?this.acc.div(e)._round():new Le(0,0)}span(){return new Le(this.max.x-this.min.x,this.max.y-this.min.y)}intersectsCount(){return this.borders.reduce((e,i)=>e+ +(i[0]!==Number.MAX_VALUE),0)}}class Fl{constructor(e){this.zoom=e.zoom,this.canonical=e.canonical,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(i=>i.id),this.index=e.index,this.hasPattern=!1,this.edgeRadius=0,this.projection=e.projection,this.layoutVertexArray=new ge,this.centroidVertexArray=new Lr,this.indexArray=new je,this.programConfigurations=new ns(e.layers,e.zoom),this.segments=new Yt,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id),this.enableTerrain=e.enableTerrain}populate(e,i,n,s){this.features=[],this.hasPattern=Au("fill-extrusion",this.layers,i),this.featuresOnBorder=[],this.borders=[[],[],[],[]],this.borderDoneWithNeighborZ=[-1,-1,-1,-1],this.tileToMeter=function(c){const u=Math.exp(Math.PI*(1-c.y/(1<=0;U--){const q=S[U];(q.length===0||(M=q[0]).every(V=>V.x<=0)||M.every(V=>V.x>=Ze)||M.every(V=>V.y<=0)||M.every(V=>V.y>=Ze))&&S.splice(U,1)}var M;let C;if(x)C=fp(S,m,s);else{C=[];for(const U of S)C.push({polygon:U,bounds:m})}const D=w?this.edgeRadius:0;for(const{polygon:U,bounds:q}of C){let V=0,$=0;for(const W of U)w&&!W[0].equals(W[W.length-1])&&W.push(W[0]),$+=w?W.length-1:W.length;const X=this.segments.prepareSegment((w?5:4)*$,this.layoutVertexArray,this.indexArray);if(w){const W=[],ce=[];V=X.vertexLength;for(const me of U){let Ee,ue;me.length&&me!==U[0]&&ce.push(W.length/2),Ee=me[1].sub(me[0])._perp()._unit();for(let ye=1;ye4&&up(W[W.length-2],W[0],W[1]),ue=D?Km(W[W.length-2],W[0],W[1],D):0;se=W[1].sub(W[0])._perp()._unit();let ye=!0;for(let xe=1,be=0;xe0?1:0,ze=Ce.dist(pe);if(be+ze>32768&&(be=0),D){me=De.sub(pe)._perp()._unit();let Ye=cp(Ce,pe,De,lp(se,me),D);isNaN(Ye)&&(Ye=0);const We=pe.sub(Ce)._unit();Ce=Ce.add(We.mult(ue))._round(),pe=pe.add(We.mult(-Ye))._round(),ue=Ye,se=me}const $e=X.vertexLength,Ke=W.length>4&&up(Ce,pe,De);let gt=dp(be,Ee,ye);if(Bl(this.layoutVertexArray,Ce.x,Ce.y,Re,He,0,0,gt),Bl(this.layoutVertexArray,Ce.x,Ce.y,Re,He,0,1,gt),be+=ze,gt=dp(be,Ke,!ye),Ee=Ke,Bl(this.layoutVertexArray,pe.x,pe.y,Re,He,0,0,gt),Bl(this.layoutVertexArray,pe.x,pe.y,Re,He,0,1,gt),X.vertexLength+=4,this.indexArray.emplaceBack($e+0,$e+1,$e+2),this.indexArray.emplaceBack($e+1,$e+3,$e+2),X.primitiveLength+=2,D){const Ye=V+(xe===1?W.length-2:xe-2),We=xe===1?V:Ye+1;if(this.indexArray.emplaceBack($e+1,Ye,$e+3),this.indexArray.emplaceBack(Ye,We,$e+3),X.primitiveLength+=2,ce===void 0&&(ce=$e),!hp(De,W[xe],q)){const Rt=xe===W.length-1?ce:X.vertexLength;this.indexArray.emplaceBack($e+2,$e+3,Rt),this.indexArray.emplaceBack($e+3,Rt+1,Rt),this.indexArray.emplaceBack($e+3,We,Rt+1),X.primitiveLength+=3}ye=!ye}if(x){const Ye=this.layoutVertexExtArray,We=_.projectTilePoint(Ce.x,Ce.y,s),Rt=_.projectTilePoint(pe.x,pe.y,s),et=_.upVector(s,Ce.x,Ce.y),tt=_.upVector(s,pe.x,pe.y);Ol(Ye,We,et),Ol(Ye,We,et),Ol(Ye,Rt,tt),Ol(Ye,Rt,tt)}}w&&(V+=W.length-1)}}if(b&&b.polyCount.length>0){if(b.borders){b.vertexArrayOffset=this.centroidVertexArray.length;const U=b.borders,q=this.featuresOnBorder.push(b)-1;for(let V=0;V<4;V++)U[V][0]!==Number.MAX_VALUE&&this.borders[V].push(q)}this.encodeCentroid(b.borders?void 0:b.centroid(),b)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,c,u,s)}sortBorders(){for(let e=0;e<4;e++)this.borders[e].sort((i,n)=>this.featuresOnBorder[i].borders[e][0]-this.featuresOnBorder[n].borders[e][0])}encodeCentroid(e,i,n=!0){let s,c;if(e)if(e.y!==0){const p=i.span()._mult(this.tileToMeter);s=(Math.max(e.x,1)<<3)+Math.min(7,Math.round(p.x/10)),c=(Math.max(e.y,1)<<3)+Math.min(7,Math.round(p.y/10))}else s=Math.ceil(7*(e.x+450)),c=0;else s=0,c=+n;let u=n?this.centroidVertexArray.length:i.vertexArrayOffset;for(const p of i.polyCount){n&&this.centroidVertexArray.resize(this.centroidVertexArray.length+4*p.edges+p.top);for(let m=0;mi[1].x&&e.x>i[1].x||t.yi[1].y&&e.y>i[1].y}function up(t,e,i){if(t.x<0||t.x>=Ze||e.x<0||e.x>=Ze||i.x<0||i.x>=Ze)return!1;const n=i.sub(e),s=n.perp(),c=t.sub(e);return(n.x*c.x+n.y*c.y)/Math.sqrt((n.x*n.x+n.y*n.y)*(c.x*c.x+c.y*c.y))>-.866&&s.x*c.x+s.y*c.y<0}function dp(t,e,i){const n=e?2|t:-3&t;return i?1|n:-2&n}function pp(){const t=Math.PI/32,e=Math.tan(t),i=Pl;return i*Math.sqrt(1+2*e*e)-i}function fp(t,e,i){const n=1<{for(const se of W)M.push({polygon:se,bounds:ce})},D=Math.ceil(Math.log2(x)),U=Math.ceil(Math.log2(b)),q=D-U,V=[];for(let W=0;W0?0:1);for(let W=0;Wce+1?X.push({polygons:be,bounds:pe,depth:ce+1}):C(be,pe)}if(Ce.length){const pe=[new Le(se===0?xe:me.x,se===1?xe:me.y),Ee];V.length>ce+1?X.push({polygons:Ce,bounds:pe,depth:ce+1}):C(Ce,pe)}}return M}(t,e,Math.ceil((c-s)/11.25),Math.ceil((u-p)/11.25),1,(m,_,x)=>{if(m===0)return .5*(_+x);{const b=bi((i.y+_/Ze)/n);return(rn(.5*(bi((i.y+x/Ze)/n)+b))*n-i.y)*Ze}})}Ue(Fl,"FillExtrusionBucket",{omit:["layers","features"]}),Ue(ap,"PartMetadata");const Ym=new j({"fill-extrusion-edge-radius":new I(fe["layout_fill-extrusion"]["fill-extrusion-edge-radius"])});var Jm={paint:new j({"fill-extrusion-opacity":new I(fe["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new L(fe["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new I(fe["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new I(fe["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new L(fe["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new L(fe["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new L(fe["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new I(fe["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]),"fill-extrusion-ambient-occlusion-intensity":new I(fe["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-intensity"]),"fill-extrusion-ambient-occlusion-radius":new I(fe["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-radius"]),"fill-extrusion-rounded-roof":new I(fe["paint_fill-extrusion"]["fill-extrusion-rounded-roof"])}),layout:Ym};function mp(t,e,i){var n=2*Math.PI*6378137/256/Math.pow(2,i);return[t*n-2*Math.PI*6378137/2,e*n-2*Math.PI*6378137/2]}class ah{constructor(e,i,n){this.z=e,this.x=i,this.y=n,this.key=Ul(0,e,e,i,n)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,i){const n=function(c,u,p){var m=mp(256*c,256*(u=Math.pow(2,p)-u-1),p),_=mp(256*(c+1),256*(u+1),p);return m[0]+","+m[1]+","+_[0]+","+_[1]}(this.x,this.y,this.z),s=function(c,u,p){let m,_="";for(let x=c;x>0;x--)m=1<this.canonical.z?new Pi(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Pi(e,this.wrap,e,this.canonical.x>>i,this.canonical.y>>i)}calculateScaledKey(e,i=!0){if(this.overscaledZ===e&&i)return this.key;if(e>this.canonical.z)return Ul(this.wrap*+i,e,this.canonical.z,this.canonical.x,this.canonical.y);{const n=this.canonical.z-e;return Ul(this.wrap*+i,e,e,this.canonical.x>>n,this.canonical.y>>n)}}isChildOf(e){if(e.wrap!==this.wrap)return!1;const i=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ>i&&e.canonical.y===this.canonical.y>>i}children(e){if(this.overscaledZ>=e)return[new Pi(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const i=this.canonical.z+1,n=2*this.canonical.x,s=2*this.canonical.y;return[new Pi(i,this.wrap,i,n,s),new Pi(i,this.wrap,i,n+1,s),new Pi(i,this.wrap,i,n,s+1),new Pi(i,this.wrap,i,n+1,s+1)]}isLessThan(e){return this.wrape.wrap)&&(this.overscaledZe.overscaledZ)&&(this.canonical.xe.canonical.x)&&this.canonical.yi.id),this.index=e.index,this.projection=e.projection,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(i=>{this.gradients[i.id]={}}),this.layoutVertexArray=new he,this.layoutVertexArray2=new we,this.indexArray=new je,this.programConfigurations=new ns(e.layers,e.zoom),this.segments=new Yt,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id)}populate(e,i,n,s){this.hasPattern=Au("line",this.layers,i);const c=this.layers[0].layout.get("line-sort-key"),u=[];for(const{feature:x,id:b,index:w,sourceLayerIndex:S}of e){const M=this.layers[0]._featureFilter.needGeometry,C=hs(x,M);if(!this.layers[0]._featureFilter.filter(new v(this.zoom),C,n))continue;const D=c?c.evaluate(C,{},n):void 0,U={id:b,properties:x.properties,type:x.type,sourceLayerIndex:S,index:w,geometry:M?C.geometry:Pn(x,n,s),patterns:{},sortKey:D};u.push(U)}c&&u.sort((x,b)=>x.sortKey-b.sortKey);const{lineAtlas:p,featureIndex:m}=i,_=this.addConstantDashes(p);for(const x of u){const{geometry:b,index:w,sourceLayerIndex:S}=x;if(_&&this.addFeatureDashes(x,p),this.hasPattern){const M=Iu("line",this.layers,x,this.zoom,i);this.patternFeatures.push(M)}else this.addFeature(x,b,w,n,p.positions,i.availableImages);m.insert(e[w].feature,b,w,S,this.index)}}addConstantDashes(e){let i=!1;for(const n of this.layers){const s=n.paint.get("line-dasharray").value,c=n.layout.get("line-cap").value;if(s.kind!=="constant"||c.kind!=="constant")i=!0;else{const u=c.value,p=s.value;if(!p)continue;e.addDash(p,u)}}return i}addFeatureDashes(e,i){const n=this.zoom;for(const s of this.layers){const c=s.paint.get("line-dasharray").value,u=s.layout.get("line-cap").value;if(c.kind==="constant"&&u.kind==="constant")continue;let p,m;if(c.kind==="constant"){if(p=c.value,!p)continue}else p=c.evaluate({zoom:n},e);m=u.kind==="constant"?u.value:u.evaluate({zoom:n},e),i.addDash(p,m),e.patterns[s.id]=i.getKey(p,m)}}update(e,i,n,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,n,s)}addFeatures(e,i,n,s,c){for(const u of this.patternFeatures)this.addFeature(u,u.geometry,u.index,i,n,s)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,i_)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,e_),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,i,n,s,c,u){const p=this.layers[0].layout,m=p.get("line-join").evaluate(e,{}),_=p.get("line-cap").evaluate(e,{}),x=p.get("line-miter-limit"),b=p.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const w of i)this.addLine(w,e,m,_,x,b);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,c,u,s)}addLine(e,i,n,s,c,u){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineSoFar=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let U=0;U=2&&e[m-1].equals(e[m-2]);)m--;let _=0;for(;_0;if(ce&&U>_){const ue=w.dist(S);if(ue>2*x){const ye=w.sub(w.sub(S)._mult(x/ue)._round());this.updateDistance(S,ye),this.addCurrentVertex(ye,C,0,0,b),S=ye}}const me=S&&M;let Ee=me?n:p?"butt":s;if(me&&Ee==="round"&&(Xc&&(Ee="bevel"),Ee==="bevel"&&(X>2&&(Ee="flipbevel"),X100)q=D.mult(-1);else{const ue=X*C.add(D).mag()/C.sub(D).mag();q._perp()._mult(ue*(se?-1:1))}this.addCurrentVertex(w,q,0,0,b),this.addCurrentVertex(w,q.mult(-1),0,0,b)}else if(Ee==="bevel"||Ee==="fakeround"){const ue=-Math.sqrt(X*X-1),ye=se?ue:0,xe=se?0:ue;if(S&&this.addCurrentVertex(w,C,ye,xe,b),Ee==="fakeround"){const be=Math.round(180*W/Math.PI/20);for(let Ce=1;Ce2*x){const ye=w.add(M.sub(w)._mult(x/ue)._round());this.updateDistance(w,ye),this.addCurrentVertex(ye,D,0,0,b),w=ye}}}}addCurrentVertex(e,i,n,s,c,u=!1){const p=i.y*s-i.x,m=-i.y-i.x*s;this.addHalfVertex(e,i.x+i.y*n,i.y-i.x*n,u,!1,n,c),this.addHalfVertex(e,p,m,u,!0,-s,c)}addHalfVertex({x:e,y:i},n,s,c,u,p,m){this.layoutVertexArray.emplaceBack((e<<1)+(c?1:0),(i<<1)+(u?1:0),Math.round(63*n)+128,Math.round(63*s)+128,1+(p===0?0:p<0?-1:1),0,this.lineSoFar),this.lineClips&&this.layoutVertexArray2.emplaceBack(this.scaledDistance,this.lineClipsArray.length,this.lineClips.start,this.lineClips.end);const _=m.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,_),m.primitiveLength++),u?this.e2=_:this.e1=_}updateScaledDistance(){if(this.lineClips){const e=this.totalDistance/(this.lineClips.end-this.lineClips.start);this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=e*this.lineClips.start+this.distance}else this.lineSoFar=this.distance}updateDistance(e,i){this.distance+=e.dist(i),this.updateScaledDistance()}}Ue(lh,"LineBucket",{omit:["layers","patternFeatures"]});const o_=new j({"line-cap":new L(fe.layout_line["line-cap"]),"line-join":new L(fe.layout_line["line-join"]),"line-miter-limit":new I(fe.layout_line["line-miter-limit"]),"line-round-limit":new I(fe.layout_line["line-round-limit"]),"line-sort-key":new L(fe.layout_line["line-sort-key"])});var xp={paint:new j({"line-opacity":new L(fe.paint_line["line-opacity"]),"line-color":new L(fe.paint_line["line-color"]),"line-translate":new I(fe.paint_line["line-translate"]),"line-translate-anchor":new I(fe.paint_line["line-translate-anchor"]),"line-width":new L(fe.paint_line["line-width"]),"line-gap-width":new L(fe.paint_line["line-gap-width"]),"line-offset":new L(fe.paint_line["line-offset"]),"line-blur":new L(fe.paint_line["line-blur"]),"line-dasharray":new L(fe.paint_line["line-dasharray"]),"line-pattern":new L(fe.paint_line["line-pattern"]),"line-gradient":new N(fe.paint_line["line-gradient"]),"line-trim-offset":new I(fe.paint_line["line-trim-offset"])}),layout:o_};const vp=new class extends L{possiblyEvaluate(t,e){return e=new v(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,transition:e.transition}),super.possiblyEvaluate(t,e)}evaluate(t,e,i,n){return e=Wt({},e,{zoom:Math.floor(e.zoom)}),super.evaluate(t,e,i,n)}}(xp.paint.properties["line-width"].specification);function bp(t,e){return e>0?e+2*t:t}vp.useIntegerZoom=!0;const s_=te([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_tex_size",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),a_=te([{name:"a_globe_anchor",components:3,type:"Int16"},{name:"a_globe_normal",components:3,type:"Float32"}],4),l_=te([{name:"a_projected_pos",components:4,type:"Float32"}],4);te([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const c_=te([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]),h_=te([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"}]);te([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"tileAnchorX"},{type:"Int16",name:"tileAnchorY"},{type:"Float32",name:"x1"},{type:"Float32",name:"y1"},{type:"Float32",name:"x2"},{type:"Float32",name:"y2"},{type:"Int16",name:"padding"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const wp=te([{name:"a_pos",components:3,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),u_=te([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);te([{name:"triangle",components:3,type:"Uint16"}]),te([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{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"},{type:"Uint8",name:"flipState"}]),te([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{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",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),te([{type:"Float32",name:"offsetX"}]),te([{type:"Int16",name:"x"},{type:"Int16",name:"y"}]);var mi=24;const Vr=128;function zu(t,e){const{expression:i}=e;if(i.kind==="constant")return{kind:"constant",layoutSize:i.evaluate(new v(t+1))};if(i.kind==="source")return{kind:"source"};{const{zoomStops:n,interpolationType:s}=i;let c=0;for(;c{n.text=function(s,c,u){const p=c.layout.get("text-transform").evaluate(u,{});return p==="uppercase"?s=s.toLocaleUpperCase():p==="lowercase"&&(s=s.toLocaleLowerCase()),y.applyArabicShaping&&(s=y.applyArabicShaping(s)),s}(n.text,e,i)}),t}const Nl={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂","←":"↑","→":"↓"};function f_(t){return t==="︶"||t==="﹈"||t==="︸"||t==="﹄"||t==="﹂"||t==="︾"||t==="︼"||t==="︺"||t==="︘"||t==="﹀"||t==="︐"||t==="︓"||t==="︔"||t==="`"||t===" ̄"||t==="︑"||t==="︒"}function m_(t){return t==="︵"||t==="﹇"||t==="︷"||t==="﹃"||t==="﹁"||t==="︽"||t==="︻"||t==="︹"||t==="︗"||t==="︿"}var Tp=Pt,Ep=function(t,e,i,n,s){var c,u,p=8*s-n-1,m=(1<>1,x=-7,b=i?s-1:0,w=i?-1:1,S=t[e+b];for(b+=w,c=S&(1<<-x)-1,S>>=-x,x+=p;x>0;c=256*c+t[e+b],b+=w,x-=8);for(u=c&(1<<-x)-1,c>>=-x,x+=n;x>0;u=256*u+t[e+b],b+=w,x-=8);if(c===0)c=1-_;else{if(c===m)return u?NaN:1/0*(S?-1:1);u+=Math.pow(2,n),c-=_}return(S?-1:1)*u*Math.pow(2,c-n)},Sp=function(t,e,i,n,s,c){var u,p,m,_=8*c-s-1,x=(1<<_)-1,b=x>>1,w=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=n?0:c-1,M=n?1:-1,C=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(p=isNaN(e)?1:0,u=x):(u=Math.floor(Math.log(e)/Math.LN2),e*(m=Math.pow(2,-u))<1&&(u--,m*=2),(e+=u+b>=1?w/m:w*Math.pow(2,1-b))*m>=2&&(u++,m/=2),u+b>=x?(p=0,u=x):u+b>=1?(p=(e*m-1)*Math.pow(2,s),u+=b):(p=e*Math.pow(2,b-1)*Math.pow(2,s),u=0));s>=8;t[i+S]=255&p,S+=M,p/=256,s-=8);for(u=u<0;t[i+S]=255&u,S+=M,u/=256,_-=8);t[i+S-M]|=128*C};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */function Pt(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Pt.Varint=0,Pt.Fixed64=1,Pt.Bytes=2,Pt.Fixed32=5;var Pu=4294967296,Mp=1/Pu,Ap=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function Dn(t){return t.type===Pt.Bytes?t.readVarint()+t.pos:t.pos+1}function ua(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Ip(t,e,i){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(n);for(var s=i.pos-1;s>=t;s--)i.buf[s+n]=i.buf[s]}function __(t,e){for(var i=0;i>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function Cp(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}Pt.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos>3,c=this.pos;this.type=7&n,t(s,e,this),this.pos===c&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=hh(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Cp(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=hh(this.buf,this.pos)+hh(this.buf,this.pos+4)*Pu;return this.pos+=8,t},readSFixed64:function(){var t=hh(this.buf,this.pos)+Cp(this.buf,this.pos+4)*Pu;return this.pos+=8,t},readFloat:function(){var t=Ep(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Ep(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,n=this.buf;return e=127&(i=n[this.pos++]),i<128?e:(e|=(127&(i=n[this.pos++]))<<7,i<128?e:(e|=(127&(i=n[this.pos++]))<<14,i<128?e:(e|=(127&(i=n[this.pos++]))<<21,i<128?e:function(s,c,u){var p,m,_=u.buf;if(p=(112&(m=_[u.pos++]))>>4,m<128||(p|=(127&(m=_[u.pos++]))<<3,m<128)||(p|=(127&(m=_[u.pos++]))<<10,m<128)||(p|=(127&(m=_[u.pos++]))<<17,m<128)||(p|=(127&(m=_[u.pos++]))<<24,m<128)||(p|=(1&(m=_[u.pos++]))<<31,m<128))return ua(s,p,c);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&Ap?function(i,n,s){return Ap.decode(i.subarray(n,s))}(this.buf,e,t):function(i,n,s){for(var c="",u=n;u239?4:x>223?3:x>191?2:1;if(u+w>s)break;w===1?x<128&&(b=x):w===2?(192&(p=i[u+1]))==128&&(b=(31&x)<<6|63&p)<=127&&(b=null):w===3?(m=i[u+2],(192&(p=i[u+1]))==128&&(192&m)==128&&((b=(15&x)<<12|(63&p)<<6|63&m)<=2047||b>=55296&&b<=57343)&&(b=null)):w===4&&(m=i[u+2],_=i[u+3],(192&(p=i[u+1]))==128&&(192&m)==128&&(192&_)==128&&((b=(15&x)<<18|(63&p)<<12|(63&m)<<6|63&_)<=65535||b>=1114112)&&(b=null)),b===null?(b=65533,w=1):b>65535&&(b-=65536,c+=String.fromCharCode(b>>>10&1023|55296),b=56320|1023&b),c+=String.fromCharCode(b),u+=w}return c}(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!==Pt.Bytes)return t.push(this.readVarint(e));var i=Dn(this);for(t=t||[];this.pos127;);else if(e===Pt.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Pt.Fixed32)this.pos+=4;else{if(e!==Pt.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;e268435455||t<0?function(e,i){var n,s;if(e>=0?(n=e%4294967296|0,s=e/4294967296|0):(s=~(-e/4294967296),4294967295^(n=~(-e%4294967296))?n=n+1|0:(n=0,s=s+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");i.realloc(10),function(c,u,p){p.buf[p.pos++]=127&c|128,c>>>=7,p.buf[p.pos++]=127&c|128,c>>>=7,p.buf[p.pos++]=127&c|128,c>>>=7,p.buf[p.pos++]=127&c|128,p.buf[p.pos]=127&(c>>>=7)}(n,0,i),function(c,u){var p=(7&c)<<4;u.buf[u.pos++]|=p|((c>>>=3)?128:0),c&&(u.buf[u.pos++]=127&c|((c>>>=7)?128:0),c&&(u.buf[u.pos++]=127&c|((c>>>=7)?128:0),c&&(u.buf[u.pos++]=127&c|((c>>>=7)?128:0),c&&(u.buf[u.pos++]=127&c|((c>>>=7)?128:0),c&&(u.buf[u.pos++]=127&c)))))}(s,i)}(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(!!t)},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(n,s,c){for(var u,p,m=0;m55295&&u<57344){if(!p){u>56319||m+1===s.length?(n[c++]=239,n[c++]=191,n[c++]=189):p=u;continue}if(u<56320){n[c++]=239,n[c++]=191,n[c++]=189,p=u;continue}u=p-55296<<10|u-56320|65536,p=null}else p&&(n[c++]=239,n[c++]=191,n[c++]=189,p=null);u<128?n[c++]=u:(u<2048?n[c++]=u>>6|192:(u<65536?n[c++]=u>>12|224:(n[c++]=u>>18|240,n[c++]=u>>12&63|128),n[c++]=u>>6&63|128),n[c++]=63&u|128)}return c}(this.buf,t,this.pos);var i=this.pos-e;i>=128&&Ip(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),Sp(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Sp(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=128&&Ip(i,n,this),this.pos=i-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,i){this.writeTag(t,Pt.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,__,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,g_,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,v_,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,y_,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,x_,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,b_,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,w_,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,T_,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,E_,e)},writeBytesField:function(t,e){this.writeTag(t,Pt.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Pt.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Pt.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Pt.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Pt.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Pt.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Pt.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Pt.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Pt.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Pt.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,!!e)}};var uh=Yi(Tp);const ku=3;function S_(t,e,i){e.glyphs=[],t===1&&i.readMessage(M_,e)}function M_(t,e,i){if(t===3){const{id:n,bitmap:s,width:c,height:u,left:p,top:m,advance:_}=i.readMessage(A_,{});e.glyphs.push({id:n,bitmap:new kn({width:c+2*ku,height:u+2*ku},s),metrics:{width:c,height:u,left:p,top:m,advance:_}})}else t===4?e.ascender=i.readSVarint():t===5&&(e.descender=i.readSVarint())}function A_(t,e,i){t===1?e.id=i.readVarint():t===2?e.bitmap=i.readBytes():t===3?e.width=i.readVarint():t===4?e.height=i.readVarint():t===5?e.left=i.readSVarint():t===6?e.top=i.readSVarint():t===7&&(e.advance=i.readVarint())}const zp=ku;function Du(t){let e=0,i=0;for(const u of t)e+=u.w*u.h,i=Math.max(i,u.w);t.sort((u,p)=>p.h-u.h);const n=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),i),h:1/0}];let s=0,c=0;for(const u of t)for(let p=n.length-1;p>=0;p--){const m=n[p];if(!(u.w>m.w||u.h>m.h)){if(u.x=m.x,u.y=m.y,c=Math.max(c,u.y+u.h),s=Math.max(s,u.x+u.w),u.w===m.w&&u.h===m.h){const _=n.pop();pe.hasImage(n)),e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const n in e.updatedImages)this.patchUpdatedImage(this.iconPositions[n],e.getImage(n),i),this.patchUpdatedImage(this.patternPositions[n],e.getImage(n),i)}patchUpdatedImage(e,i,n){if(!e||!i||e.version===i.version)return;e.version=i.version;const[s,c]=e.tl;n.update(i.data,void 0,{x:s,y:c})}}Ue(Lu,"ImagePosition"),Ue(Pp,"ImageAtlas");const or={horizontal:1,vertical:2,horizontalOnly:3},kp=-17;class jl{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(e,i){const n=new jl;return n.scale=e||1,n.fontStack=i,n}static forImage(e){const i=new jl;return i.imageName=e,i}}class pa{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,i){const n=new pa;for(let s=0;s=0&&n>=e&&dh[this.text.charCodeAt(n)];n--)i--;this.text=this.text.substring(e,i),this.sectionIndex=this.sectionIndex.slice(e,i)}substring(e,i){const n=new pa;return n.text=this.text.substring(e,i),n.sectionIndex=this.sectionIndex.slice(e,i),n.sections=this.sections,n}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,i)=>Math.max(e,this.sections[i].scale),0)}addTextSection(e,i){this.text+=e.text,this.sections.push(jl.forText(e.scale,e.fontStack||i));const n=this.sections.length-1;for(let s=0;s=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Ru(t,e,i,n,s,c,u,p,m,_,x,b,w,S,M){const C=pa.fromFeature(t,s);b===or.vertical&&C.verticalizePunctuation(w);let D=[];const U=function(W,ce,se,me,Ee,ue){if(!W)return[];const ye=[],xe=function(De,Ne,Re,He,ze,$e){let Ke=0;for(let gt=0;gt=0;let Ce=0;for(let De=0;De0&&Gr>Ct&&(Ct=Gr)}else{const Di=se[ni.fontStack];if(!Di)continue;Di[jt]&&(Lt=Di[jt]);const pi=ce[ni.fontStack];if(!pi)continue;const Gr=pi.glyphs[jt];if(!Gr)continue;if(ti=Gr.metrics,ii=jt!==8203?mi:0,$e){const va=pi.ascender!==void 0?Math.abs(pi.ascender):0,Jl=pi.descender!==void 0?Math.abs(pi.descender):0,Ql=(va+Jl)*xt;Nt-i/2;){if(u--,u<0)return!1;p-=t[u].dist(c),c=t[u]}p+=t[u].dist(t[u+1]),u++;const m=[];let _=0;for(;pn;)_-=m.shift().angleDelta;if(_>s)return!1;u++,p+=x.dist(b)}return!0}function Vp(t){let e=0;for(let i=0;i_){const M=(_-m)/S,C=mt(b.x,w.x,M),D=mt(b.y,w.y,M),U=new Ln(C,D,0,w.angleTo(b),x);return!u||Up(t,U,p,u,e)?U:void 0}m+=S}}function k_(t,e,i,n,s,c,u,p,m){const _=Np(n,c,u),x=jp(n,s),b=x*u,w=t[0].x===0||t[0].x===m||t[0].y===0||t[0].y===m;return e-b=0&&$=0&&X=0&&w+_<=x){const W=new Ln($,X,0,q,M);W._round(),n&&!Up(t,W,c,n,s)||S.push(W)}}b+=U}return p||S.length||u||(S=Gp(t,b/2,i,n,s,c,u,!0,m)),S}function $p(t,e,i,n,s){const c=[];for(let u=0;u=n&&b.x>=n||(x.x>=n?x=new Le(n,x.y+(n-x.x)/(b.x-x.x)*(b.y-x.y))._round():b.x>=n&&(b=new Le(n,x.y+(n-x.x)/(b.x-x.x)*(b.y-x.y))._round()),x.y>=s&&b.y>=s||(x.y>=s?x=new Le(x.x+(s-x.y)/(b.y-x.y)*(b.x-x.x),s)._round():b.y>=s&&(b=new Le(x.x+(s-x.y)/(b.y-x.y)*(b.x-x.x),s)._round()),m&&x.equals(m[m.length-1])||(m=[x],c.push(m)),m.push(b)))))}}return c}Ue(Ln,"Anchor");const Gl=1e20;function Zp(t,e,i,n,s,c,u,p,m){for(let _=e;_-1);m++,c[m]=p,u[m]=_,u[m+1]=Gl}for(let p=0,m=0;p{let p=this.entries[s];p||(p=this.entries[s]={glyphs:{},requests:{},ranges:{},ascender:void 0,descender:void 0});let m=p.glyphs[c];if(m!==void 0)return void u(null,{stack:s,id:c,glyph:m});if(m=this._tinySDF(p,s,c),m)return p.glyphs[c]=m,void u(null,{stack:s,id:c,glyph:m});const _=Math.floor(c/256);if(256*_>65535)return void u(new Error("glyphs > 65535 not supported"));if(p.ranges[_])return void u(null,{stack:s,id:c,glyph:m});let x=p.requests[_];x||(x=p.requests[_]=[],fa.loadGlyphRange(s,_,this.url,this.requestManager,(b,w)=>{if(w){p.ascender=w.ascender,p.descender=w.descender;for(const S in w.glyphs)this._doesCharSupportLocalGlyph(+S)||(p.glyphs[+S]=w.glyphs[+S]);p.ranges[_]=!0}for(const S of x)S(b,w);delete p.requests[_]})),x.push((b,w)=>{b?u(b):w&&u(null,{stack:s,id:c,glyph:w.glyphs[c]||null})})},(s,c)=>{if(s)i(s);else if(c){const u={};for(const{stack:p,id:m,glyph:_}of c)u[p]===void 0&&(u[p]={}),u[p].glyphs===void 0&&(u[p].glyphs={}),u[p].glyphs[m]=_&&{id:_.id,bitmap:_.bitmap.clone(),metrics:_.metrics},u[p].ascender=this.entries[p].ascender,u[p].descender=this.entries[p].descender;i(null,u)}})}_doesCharSupportLocalGlyph(e){return this.localGlyphMode!==Ou.none&&(this.localGlyphMode===Ou.all?!!this.localFontFamily:!!this.localFontFamily&&(Be["CJK Unified Ideographs"](e)||Be["Hangul Syllables"](e)||Be.Hiragana(e)||Be.Katakana(e)||Be["CJK Symbols and Punctuation"](e)))}_tinySDF(e,i,n){const s=this.localFontFamily;if(!s||!this._doesCharSupportLocalGlyph(n))return;let c=e.tinySDF;if(!c){let C="400";/bold/i.test(i)?C="900":/medium/i.test(i)?C="500":/light/i.test(i)&&(C="200"),c=e.tinySDF=new fa.TinySDF({fontFamily:s,fontWeight:C,fontSize:24*Nr,buffer:3*Nr,radius:8*Nr}),c.fontWeight=C}if(this.localGlyphs[c.fontWeight][n])return this.localGlyphs[c.fontWeight][n];const u=String.fromCharCode(n),{data:p,width:m,height:_,glyphWidth:x,glyphHeight:b,glyphLeft:w,glyphTop:S,glyphAdvance:M}=c.draw(u);return this.localGlyphs[c.fontWeight][n]={id:n,bitmap:new kn({width:m,height:_},p),metrics:{width:x/Nr,height:b/Nr,left:w/Nr,top:S/Nr-27,advance:M/Nr,localGlyph:!0}}}}fa.loadGlyphRange=function(t,e,i,n,s){const c=256*e,u=c+255,p=n.transformRequest(n.normalizeGlyphsURL(i).replace("{fontstack}",t).replace("{range}",`${c}-${u}`),fn.Glyphs);$n(p,(m,_)=>{if(m)s(m);else if(_){const x={},b=function(w){return new uh(w).readFields(S_,{})}(_);for(const w of b.glyphs)x[w.id]=w;s(null,{glyphs:x,ascender:b.ascender,descender:b.descender})}})},fa.TinySDF=class{constructor({fontSize:t=24,buffer:e=3,radius:i=8,cutoff:n=.25,fontFamily:s="sans-serif",fontWeight:c="normal",fontStyle:u="normal"}={}){this.buffer=e,this.cutoff=n,this.radius=i;const p=this.size=t+4*e,m=this._createCanvas(p),_=this.ctx=m.getContext("2d",{willReadFrequently:!0});_.font=`${u} ${c} ${t}px ${s}`,_.textBaseline="alphabetic",_.textAlign="left",_.fillStyle="black",this.gridOuter=new Float64Array(p*p),this.gridInner=new Float64Array(p*p),this.f=new Float64Array(p),this.z=new Float64Array(p+1),this.v=new Uint16Array(p)}_createCanvas(t){const e=document.createElement("canvas");return e.width=e.height=t,e}draw(t){const{width:e,actualBoundingBoxAscent:i,actualBoundingBoxDescent:n,actualBoundingBoxLeft:s,actualBoundingBoxRight:c}=this.ctx.measureText(t),u=Math.ceil(i),p=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(c-s))),m=Math.min(this.size-this.buffer,u+Math.ceil(n)),_=p+2*this.buffer,x=m+2*this.buffer,b=Math.max(_*x,0),w=new Uint8ClampedArray(b),S={data:w,width:_,height:x,glyphWidth:p,glyphHeight:m,glyphTop:u,glyphLeft:0,glyphAdvance:e};if(p===0||m===0)return S;const{ctx:M,buffer:C,gridInner:D,gridOuter:U}=this;M.clearRect(C,C,p,m),M.fillText(t,C,C+u);const q=M.getImageData(C,C,p,m);U.fill(Gl,0,b),D.fill(0,0,b);for(let V=0;V0?ce*ce:0,D[W]=ce<0?ce*ce:0}}Zp(U,0,0,_,x,_,this.f,this.v,this.z),Zp(D,C,C,p,m,_,this.f,this.v,this.z);for(let V=0;Vue+ye[1]-ye[0],M=b.reduce(S,0),C=w.reduce(S,0),D=p-M,U=m-C;let q=0,V=M,$=0,X=C,W=0,ce=D,se=0,me=U;if(c.content&&n){const ue=c.content;q=ph(b,0,ue[0]),$=ph(w,0,ue[1]),V=ph(b,ue[0],ue[2]),X=ph(w,ue[1],ue[3]),W=ue[0]-q,se=ue[1]-$,ce=ue[2]-ue[0]-V,me=ue[3]-ue[1]-X}const Ee=(ue,ye,xe,be)=>{const Ce=fh(ue.stretch-q,V,_,t.left),pe=mh(ue.fixed-W,ce,ue.stretch,M),De=fh(ye.stretch-$,X,x,t.top),Ne=mh(ye.fixed-se,me,ye.stretch,C),Re=fh(xe.stretch-q,V,_,t.left),He=mh(xe.fixed-W,ce,xe.stretch,M),ze=fh(be.stretch-$,X,x,t.top),$e=mh(be.fixed-se,me,be.stretch,C),Ke=new Le(Ce,De),gt=new Le(Re,De),Ye=new Le(Re,ze),We=new Le(Ce,ze),Rt=new Le(pe/u,Ne/u),et=new Le(He/u,$e/u),tt=e*Math.PI/180;if(tt){const Dt=Math.sin(tt),Ct=Math.cos(tt),Nt=[Ct,-Dt,Dt,Ct];Ke._matMult(Nt),gt._matMult(Nt),We._matMult(Nt),Ye._matMult(Nt)}const It=ue.stretch+ue.fixed,kt=ye.stretch+ye.fixed;return{tl:Ke,tr:gt,bl:We,br:Ye,tex:{x:c.paddedRect.x+ma+It,y:c.paddedRect.y+ma+kt,w:xe.stretch+xe.fixed-It,h:be.stretch+be.fixed-kt},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Rt,pixelOffsetBR:et,minFontScaleX:ce/u/_,minFontScaleY:me/u/x,isSDF:i}};if(n&&(c.stretchX||c.stretchY)){const ue=Xp(b,D,M),ye=Xp(w,U,C);for(let xe=0;xe0)for(let n=(this.length>>1)-1;n>=0;n--)this._down(n)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const e=this.data[0],i=this.data.pop();return this.length--,this.length>0&&(this.data[0]=i,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:i,compare:n}=this,s=i[e];for(;e>0;){const c=e-1>>1,u=i[c];if(n(s,u)>=0)break;i[e]=u,e=c}i[e]=s}_down(e){const{data:i,compare:n}=this,s=this.length>>1,c=i[e];for(;e=0)break;i[e]=p,e=u}i[e]=c}}function R_(t,e){return te?1:0}function B_(t,e=1,i=!1){let n=1/0,s=1/0,c=-1/0,u=-1/0;const p=t[0];for(let S=0;Sc)&&(c=M.x),(!S||M.y>u)&&(u=M.y)}const m=Math.min(c-n,u-s);let _=m/2;const x=new L_([],O_);if(m===0)return new Le(n,s);for(let S=n;Sb.d||!b.d)&&(b=S,i&&console.log("found best %d after %d probes",Math.round(1e4*S.d)/1e4,w)),S.max-b.d<=e||(_=S.h/2,x.push(new _a(S.p.x-_,S.p.y-_,_,t)),x.push(new _a(S.p.x+_,S.p.y-_,_,t)),x.push(new _a(S.p.x-_,S.p.y+_,_,t)),x.push(new _a(S.p.x+_,S.p.y+_,_,t)),w+=4)}return i&&(console.log(`num probes: ${w}`),console.log(`best distance: ${b.d}`)),b.p}function O_(t,e){return e.max-t.max}class _a{constructor(e,i,n,s){this.p=new Le(e,i),this.h=n,this.d=function(c,u){let p=!1,m=1/0;for(let _=0;_c.y!=C.y>c.y&&c.x<(C.x-M.x)*(c.y-M.y)/(C.y-M.y)+M.x&&(p=!p),m=Math.min(m,Gd(c,M,C))}}return(p?1:-1)*Math.sqrt(m)}(this.p,s),this.max=this.d+this.h*Math.SQRT2}}const ga=7,Fu=Number.POSITIVE_INFINITY,F_=Math.sqrt(2);function Hp(t,[e,i]){let n=0,s=0;if(i===Fu){e<0&&(e=0);const c=e/F_;switch(t){case"top-right":case"top-left":s=c-ga;break;case"bottom-right":case"bottom-left":s=-c+ga;break;case"bottom":s=-e+ga;break;case"top":s=e-ga}switch(t){case"top-right":case"bottom-right":n=-c;break;case"top-left":case"bottom-left":n=c;break;case"left":n=e;break;case"right":n=-e}}else{switch(e=Math.abs(e),i=Math.abs(i),t){case"top-right":case"top-left":case"top":s=i-ga;break;case"bottom-right":case"bottom-left":case"bottom":s=-i+ga}switch(t){case"top-right":case"bottom-right":case"right":n=-e;break;case"top-left":case"bottom-left":case"left":n=e}}return[n,s]}function U_(t,e,i,n,s,c,u,p,m,_){t.createArrays(),t.tilePixelRatio=Ze/(512*t.overscaling),t.compareText={},t.iconsNeedLinear=!1;const x=t.layers[0].layout,b=t.layers[0]._unevaluatedLayout._values,w={};if(t.textSizeData.kind==="composite"){const{minZoom:C,maxZoom:D}=t.textSizeData;w.compositeTextSizes=[b["text-size"].possiblyEvaluate(new v(C),p),b["text-size"].possiblyEvaluate(new v(D),p)]}if(t.iconSizeData.kind==="composite"){const{minZoom:C,maxZoom:D}=t.iconSizeData;w.compositeIconSizes=[b["icon-size"].possiblyEvaluate(new v(C),p),b["icon-size"].possiblyEvaluate(new v(D),p)]}w.layoutTextSize=b["text-size"].possiblyEvaluate(new v(m+1),p),w.layoutIconSize=b["icon-size"].possiblyEvaluate(new v(m+1),p),w.textMaxSize=b["text-size"].possiblyEvaluate(new v(18),p);const S=x.get("text-rotation-alignment")==="map"&&x.get("symbol-placement")!=="point",M=x.get("text-size");for(const C of t.features){const D=x.get("text-font").evaluate(C,{},p).join(","),U=M.evaluate(C,{},p),q=w.layoutTextSize.evaluate(C,{},p),V=(w.layoutIconSize.evaluate(C,{},p),{horizontal:{},vertical:void 0}),$=C.text;let X,W=[0,0];if($){const me=$.toString(),Ee=x.get("text-letter-spacing").evaluate(C,{},p)*mi,ue=x.get("text-line-height").evaluate(C,{},p)*mi,ye=Wh(me)?Ee:0,xe=x.get("text-anchor").evaluate(C,{},p),be=x.get("text-variable-anchor");if(!be){const Re=x.get("text-radial-offset").evaluate(C,{},p);W=Re?Hp(xe,[Re*mi,Fu]):x.get("text-offset").evaluate(C,{},p).map(He=>He*mi)}let Ce=S?"center":x.get("text-justify").evaluate(C,{},p);const pe=x.get("symbol-placement")==="point",De=pe?x.get("text-max-width").evaluate(C,{},p)*mi:1/0,Ne=Re=>{t.allowVerticalPlacement&&fl(me)&&(V.vertical=Ru($,e,i,s,D,De,ue,xe,Re,ye,W,or.vertical,!0,q,U))};if(!S&&be){const Re=Ce==="auto"?be.map(ze=>Uu(ze)):[Ce];let He=!1;for(let ze=0;ze=0||!fl(me)){const Re=Ru($,e,i,s,D,De,ue,xe,Ce,ye,W,or.horizontal,!1,q,U);Re&&(V.horizontal[Ce]=Re)}Ne(pe?"left":Ce)}}let ce=!1;if(C.icon&&C.icon.name){const me=n[C.icon.name];me&&(X=z_(s[C.icon.name],x.get("icon-offset").evaluate(C,{},p),x.get("icon-anchor").evaluate(C,{},p)),ce=me.sdf,t.sdfIcons===void 0?t.sdfIcons=me.sdf:t.sdfIcons!==me.sdf&&Ut("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(me.pixelRatio!==t.pixelRatio||x.get("icon-rotate").constantOr(1)!==0)&&(t.iconsNeedLinear=!0))}const se=Yp(V.horizontal)||V.vertical;t.iconsInText||(t.iconsInText=!!se&&se.iconsInText),(se||X)&&V_(t,C,V,X,n,w,q,0,W,ce,u,p,_)}c&&t.generateCollisionDebugBuffers(m,t.collisionBoxArray)}function Uu(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 V_(t,e,i,n,s,c,u,p,m,_,x,b,w){let S=c.textMaxSize.evaluate(e,{},b);S===void 0&&(S=u);const M=t.layers[0].layout,C=M.get("icon-offset").evaluate(e,{},b),D=Yp(i.horizontal)||i.vertical,U=w.name==="globe",q=mi,V=u/q,$=t.tilePixelRatio*S/q,X=(xe=t.overscaling,t.zoom>18&&xe>2&&(xe>>=1),Math.max(Ze/(512*xe),1)*M.get("symbol-spacing")),W=M.get("text-padding")*t.tilePixelRatio,ce=M.get("icon-padding")*t.tilePixelRatio,se=dt(M.get("text-max-angle")),me=M.get("text-rotation-alignment")==="map"&&M.get("symbol-placement")!=="point",Ee=M.get("icon-rotation-alignment")==="map"&&M.get("symbol-placement")!=="point",ue=M.get("symbol-placement"),ye=X/2;var xe;const be=M.get("icon-text-fit");let Ce;n&&be!=="none"&&(t.allowVerticalPlacement&&i.vertical&&(Ce=Fp(n,i.vertical,be,M.get("icon-text-fit-padding"),C,V)),D&&(n=Fp(n,D,be,M.get("icon-text-fit-padding"),C,V)));const pe=(De,Ne,Re)=>{if(Ne.x<0||Ne.x>=Ze||Ne.y<0||Ne.y>=Ze)return;let He=null;if(U){const{x:ze,y:$e,z:Ke}=w.projectTilePoint(Ne.x,Ne.y,Re);He={anchor:new Ln(ze,$e,Ke,0,void 0),up:w.upVector(Re,Ne.x,Ne.y)}}(function(ze,$e,Ke,gt,Ye,We,Rt,et,tt,It,kt,Dt,Ct,Nt,$t,Qt,zt,ni,ei,jt,xt,ti,Lt,ki,ii){const _i=ze.addToLineVertexArray($e,gt);let di,Di,pi,Gr,va,Jl,Ql,Pf=0,kf=0,Df=0,Lf=0,ed=-1,td=-1;const an={};let Rf=Kh("");const ms=Ke?Ke.anchor:$e;let id=0,rd=0;if(tt._unevaluatedLayout.getValue("text-radial-offset")===void 0?[id,rd]=tt.layout.get("text-offset").evaluate(xt,{},ii).map(Xi=>Xi*mi):(id=tt.layout.get("text-radial-offset").evaluate(xt,{},ii)*mi,rd=Fu),ze.allowVerticalPlacement&&Ye.vertical){const Xi=Ye.vertical;if($t)Jl=Vu(Xi),et&&(Ql=Vu(et));else{const Hi=tt.layout.get("text-rotate").evaluate(xt,{},ii)+90;pi=_h(It,ms,$e,kt,Dt,Ct,Xi,Nt,Hi,Qt),et&&(Gr=_h(It,ms,$e,kt,Dt,Ct,et,ni,Hi))}}if(We){const Xi=tt.layout.get("icon-rotate").evaluate(xt,{},ii),Hi=tt.layout.get("icon-text-fit")!=="none",ec=Wp(We,Xi,Lt,Hi),od=et?Wp(et,Xi,Lt,Hi):void 0;Di=_h(It,ms,$e,kt,Dt,Ct,We,ni,Xi),Pf=4*ec.length;const Bf=ze.iconSizeData;let _s=null;Bf.kind==="source"?(_s=[Vr*tt.layout.get("icon-size").evaluate(xt,{},ii)],_s[0]>mo&&Ut(`${ze.layerIds[0]}: Value for "icon-size" is >= ${$l}. Reduce your "icon-size".`)):Bf.kind==="composite"&&(_s=[Vr*ti.compositeIconSizes[0].evaluate(xt,{},ii),Vr*ti.compositeIconSizes[1].evaluate(xt,{},ii)],(_s[0]>mo||_s[1]>mo)&&Ut(`${ze.layerIds[0]}: Value for "icon-size" is >= ${$l}. Reduce your "icon-size".`)),ze.addSymbols(ze.icon,ec,_s,jt,ei,xt,!1,Ke,$e,_i.lineStartIndex,_i.lineLength,-1,ki,ii),ed=ze.icon.placedSymbolArray.length-1,od&&(kf=4*od.length,ze.addSymbols(ze.icon,od,_s,jt,ei,xt,or.vertical,Ke,$e,_i.lineStartIndex,_i.lineLength,-1,ki,ii),td=ze.icon.placedSymbolArray.length-1)}for(const Xi in Ye.horizontal){const Hi=Ye.horizontal[Xi];di||(Rf=Kh(Hi.text),$t?va=Vu(Hi):di=_h(It,ms,$e,kt,Dt,Ct,Hi,Nt,tt.layout.get("text-rotate").evaluate(xt,{},ii),Qt));const ec=Hi.positionedLines.length===1;if(Df+=Kp(ze,Ke,$e,Hi,Rt,tt,$t,xt,Qt,_i,Ye.vertical?or.horizontal:or.horizontalOnly,ec?Object.keys(Ye.horizontal):[Xi],an,ed,ti,ki,ii),ec)break}Ye.vertical&&(Lf+=Kp(ze,Ke,$e,Ye.vertical,Rt,tt,$t,xt,Qt,_i,or.vertical,["vertical"],an,td,ti,ki,ii));let bo=-1;const nd=(Xi,Hi)=>Xi?Math.max(Xi,Hi):Hi;bo=nd(va,bo),bo=nd(Jl,bo),bo=nd(Ql,bo);const fg=bo>-1?1:0;ze.glyphOffsetArray.length>=go.MAX_GLYPHS&&Ut("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),xt.sortKey!==void 0&&ze.addToSortKeyRanges(ze.symbolInstances.length,xt.sortKey),ze.symbolInstances.emplaceBack(ms.x,ms.y,ms.z,$e.x,$e.y,an.right>=0?an.right:-1,an.center>=0?an.center:-1,an.left>=0?an.left:-1,an.vertical>=0?an.vertical:-1,ed,td,Rf,di!==void 0?di:ze.collisionBoxArray.length,di!==void 0?di+1:ze.collisionBoxArray.length,pi!==void 0?pi:ze.collisionBoxArray.length,pi!==void 0?pi+1:ze.collisionBoxArray.length,Di!==void 0?Di:ze.collisionBoxArray.length,Di!==void 0?Di+1:ze.collisionBoxArray.length,Gr||ze.collisionBoxArray.length,Gr?Gr+1:ze.collisionBoxArray.length,kt,Df,Lf,Pf,kf,fg,0,id,rd,bo)})(t,Ne,He,De,i,n,s,Ce,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,W,me,m,0,ce,Ee,C,e,c,_,x,b)};if(ue==="line")for(const De of $p(e.geometry,0,0,Ze,Ze)){const Ne=k_(De,X,se,i.vertical||D,n,q,$,t.overscaling,Ze);for(const Re of Ne)D&&N_(t,D.text,ye,Re)||pe(De,Re,b)}else if(ue==="line-center"){for(const De of e.geometry)if(De.length>1){const Ne=P_(De,se,i.vertical||D,n,q,$);Ne&&pe(De,Ne,b)}}else if(e.type==="Polygon")for(const De of Mu(e.geometry,0)){const Ne=B_(De,16);pe(De[0],new Ln(Ne.x,Ne.y,0,0,void 0),b)}else if(e.type==="LineString")for(const De of e.geometry)pe(De,new Ln(De[0].x,De[0].y,0,0,void 0),b);else if(e.type==="Point")for(const De of e.geometry)for(const Ne of De)pe([Ne],new Ln(Ne.x,Ne.y,0,0,void 0),b)}const $l=255,mo=$l*Vr;function Kp(t,e,i,n,s,c,u,p,m,_,x,b,w,S,M,C,D){const U=function($,X,W,ce,se,me,Ee,ue){const ye=[];if(X.positionedLines.length===0)return ye;const xe=ce.layout.get("text-rotate").evaluate(me,{})*Math.PI/180,be=function(Re){const He=Re[0],ze=Re[1],$e=He*ze;return $e>0?[He,-ze]:$e<0?[-He,ze]:He===0?[ze,He]:[ze,-He]}(W);let Ce=Math.abs(X.top-X.bottom);for(const Re of X.positionedLines)Ce-=Re.lineOffset;const pe=X.positionedLines.length,De=Ce/pe;let Ne=X.top-W[1];for(let Re=0;Remo&&Ut(`${t.layerIds[0]}: Value for "text-size" is >= ${$l}. Reduce your "text-size".`)):q.kind==="composite"&&(V=[Vr*M.compositeTextSizes[0].evaluate(p,{},D),Vr*M.compositeTextSizes[1].evaluate(p,{},D)],(V[0]>mo||V[1]>mo)&&Ut(`${t.layerIds[0]}: Value for "text-size" is >= ${$l}. Reduce your "text-size".`)),t.addSymbols(t.text,U,V,m,u,p,x,e,i,_.lineStartIndex,_.lineLength,S,C,D);for(const $ of b)w[$]=t.text.placedSymbolArray.length-1;return 4*U.length}function Yp(t){for(const e in t)return t[e];return null}function _h(t,e,i,n,s,c,u,p,m,_){let x=u.top,b=u.bottom,w=u.left,S=u.right;const M=u.collisionPadding;if(M&&(w-=M[0],x-=M[1],S+=M[2],b+=M[3]),m){const C=new Le(w,x),D=new Le(S,x),U=new Le(w,b),q=new Le(S,b),V=dt(m);let $=new Le(0,0);_&&($=new Le(_[0],_[1])),C._rotateAround(V,$),D._rotateAround(V,$),U._rotateAround(V,$),q._rotateAround(V,$),w=Math.min(C.x,D.x,U.x,q.x),S=Math.max(C.x,D.x,U.x,q.x),x=Math.min(C.y,D.y,U.y,q.y),b=Math.max(C.y,D.y,U.y,q.y)}return t.emplaceBack(e.x,e.y,e.z,i.x,i.y,w,x,S,b,p,n,s,c),t.length-1}function Vu(t){t.collisionPadding&&(t.top-=t.collisionPadding[1],t.bottom+=t.collisionPadding[3]);const e=t.bottom-t.top;return e>0?Math.max(10,e):null}function N_(t,e,i,n){const s=t.compareText;if(e in s){const c=s[e];for(let u=c.length-1;u>=0;u--)if(n.dist(c[u])V&&($(W,be,se,me,ye,xe),$(be,ce,ye,xe,Ee,ue))}$(b,w,n,c,s,c),$(w,S,s,c,s,u),$(S,M,s,u,n,u),$(M,b,n,u,n,c),C-=V,D-=V,U+=V,q+=V;const X=1/Math.max(U-C,q-D);return{scale:X,x:C*X,y:D*X,x2:U*X,y2:q*X,projection:e}}const j_=Or(new Float32Array(16));class _o{constructor(e){this.spec=e,this.name=e.name,this.wrap=!1,this.requiresDraping=!1,this.supportsWorldCopies=!1,this.supportsTerrain=!1,this.supportsFog=!1,this.supportsFreeCamera=!1,this.zAxisUnit="meters",this.isReprojectedInTileSpace=!0,this.unsupportedLayers=["custom"],this.center=[0,0],this.range=[3.5,7]}project(e,i){return{x:0,y:0,z:0}}unproject(e,i){return new At(0,0)}projectTilePoint(e,i,n){return{x:e,y:i,z:0}}locationPoint(e,i,n=!0){return e._coordinatePoint(e.locationCoordinate(i),n)}pixelsPerMeter(e,i){return Ur(1,e)*i}pixelSpaceConversion(e,i,n){return 1}farthestPixelDistance(e){return Jp(e,e.pixelsPerMeter)}pointCoordinate(e,i,n,s){const c=e.horizonLineFromTop(!1),u=new Le(i,Math.max(c,n));return e.rayIntersectionCoordinate(e.pointRayIntersection(u,s))}pointCoordinate3D(e,i,n){const s=new Le(i,n);if(e.elevation)return e.elevation.pointCoordinate(s);{const c=this.pointCoordinate(e,s.x,s.y,0);return[c.x,c.y,c.z]}}isPointAboveHorizon(e,i){if(e.elevation)return!this.pointCoordinate3D(e,i.x,i.y);const n=e.horizonLineFromTop();return i.y0?i<-ya+n&&(i=-ya+n):i>ya-n&&(i=ya-n);const u=c/Math.pow(yh(i),s);let p=u*Math.sin(s*e),m=c-u*Math.cos(s*e);return p=.5*(p/Math.PI+.5),m=.5*(m/Math.PI+.5),{x:p,y:this.southernCenter?m:1-m,z:0}}unproject(e,i){e=(2*e-.5)*Math.PI,this.southernCenter&&(i=1-i),i=(2*(1-i)-.5)*Math.PI;const{n,f:s}=this,c=s-i,u=Math.sign(c),p=Math.sign(n)*Math.sqrt(e*e+c*c);let m=Math.atan2(e,Math.abs(c))*u;c*n<0&&(m-=Math.PI*Math.sign(e)*u);const _=ct(si(m/n)+this.center[0],-180,180),x=ct(si(2*Math.atan(Math.pow(s/p,1/n))-ya),-wi,wi);return new At(_,this.southernCenter?-x:x)}}class Qp extends _o{constructor(e){super(e),this.wrap=!0,this.supportsWorldCopies=!0,this.supportsTerrain=!0,this.supportsFog=!0,this.supportsFreeCamera=!0,this.isReprojectedInTileSpace=!1,this.unsupportedLayers=[],this.range=null}project(e,i){return{x:tn(e),y:rn(i),z:0}}unproject(e,i){const n=nr(e),s=bi(i);return new At(n,s)}}const ef=dt(wi);class W_ extends _o{project(e,i){const n=(i=dt(i))*i,s=n*n;return{x:.5*((e=dt(e))*(.8707-.131979*n+s*(s*(.003971*n-.001529*s)-.013791))/Math.PI+.5),y:1-.5*(i*(1.007226+n*(.015085+s*(.028874*n-.044475-.005916*s)))/Math.PI+1),z:0}}unproject(e,i){e=(2*e-.5)*Math.PI;let n=i=(2*(1-i)-1)*Math.PI,s=25,c=0,u=n*n;do{u=n*n;const _=u*u;c=(n*(1.007226+u*(.015085+_*(.028874*u-.044475-.005916*_)))-i)/(1.007226+u*(.045255+_*(.259866*u-.311325-.005916*11*_))),n=ct(n-c,-ef,ef)}while(Math.abs(c)>1e-6&&--s>0);u=n*n;const p=ct(si(e/(.8707+u*(u*(u*u*u*(.003971-.001529*u)-.013791)-.131979))),-180,180),m=si(n);return new At(p,m)}}const tf=dt(wi);class X_ extends _o{project(e,i){i=dt(i),e=dt(e);const n=Math.cos(i),s=2/Math.PI,c=Math.acos(n*Math.cos(e/2)),u=Math.sin(c)/c,p=.5*(e*s+2*n*Math.sin(e/2)/u)||0,m=.5*(i+Math.sin(i)/u)||0;return{x:.5*(p/Math.PI+.5),y:1-.5*(m/Math.PI+1),z:0}}unproject(e,i){let n=e=(2*e-.5)*Math.PI,s=i=(2*(1-i)-1)*Math.PI,c=25;const u=1e-6;let p=0,m=0;do{const _=Math.cos(s),x=Math.sin(s),b=2*x*_,w=x*x,S=_*_,M=Math.cos(n/2),C=Math.sin(n/2),D=2*M*C,U=C*C,q=1-S*M*M,V=q?1/q:0,$=q?Math.acos(_*M)*Math.sqrt(1/q):0,X=.5*(2*$*_*C+2*n/Math.PI)-e,W=.5*($*x+s)-i,ce=.5*V*(S*U+$*_*M*w)+1/Math.PI,se=V*(D*b/4-$*x*C),me=.125*V*(b*C-$*x*S*D),Ee=.5*V*(w*M+$*U*_)+.5,ue=se*me-Ee*ce;p=(W*se-X*Ee)/ue,m=(X*me-W*ce)/ue,n=ct(n-p,-Math.PI,Math.PI),s=ct(s-m,-tf,tf)}while((Math.abs(p)>u||Math.abs(m)>u)&&--c>0);return new At(si(n),si(s))}}class rf extends _o{constructor(e){super(e),this.center=e.center||[0,0],this.parallels=e.parallels||[0,0],this.cosPhi=Math.max(.01,Math.cos(dt(this.parallels[0]))),this.scale=1/(2*Math.max(Math.PI*this.cosPhi,1/this.cosPhi)),this.wrap=!0,this.supportsWorldCopies=!0}project(e,i){const{scale:n,cosPhi:s}=this;return{x:dt(e)*s*n+.5,y:-Math.sin(dt(i))/s*n+.5,z:0}}unproject(e,i){const{scale:n,cosPhi:s}=this,c=-(i-.5)/n,u=ct(si((e-.5)/n)/s,-180,180),p=Math.asin(ct(c*s,-1,1)),m=ct(si(p),-wi,wi);return new At(u,m)}}class H_ extends Qp{constructor(e){super(e),this.requiresDraping=!0,this.supportsWorldCopies=!1,this.supportsFog=!0,this.zAxisUnit="pixels",this.unsupportedLayers=["debug"],this.range=[3,5]}projectTilePoint(e,i,n){const s=Cl(e,i,n);return qt(s,s,zl(en(n))),{x:s[0],y:s[1],z:s[2]}}locationPoint(e,i){const n=ra(i.lat,i.lng),s=Ci([],n),c=e.elevation?e.elevation.getAtPointOrZero(e.locationCoordinate(i),e._centerAltitude):e._centerAltitude;Sl(n,n,s,Ur(1,0)*Ze*c);const u=Or(new Float64Array(16));return os(u,e.pixelMatrix,e.globeMatrix),qt(n,n,u),new Le(n[0],n[1])}pixelsPerMeter(e,i){return Ur(1,0)*i}pixelSpaceConversion(e,i,n){const s=Ur(1,e)*i,c=mt(Ur(1,45)*i,s,n);return this.pixelsPerMeter(e,i)/c}createTileMatrix(e,i,n){const s=hu(en(n.canonical));return os(new Float64Array(16),e.globeMatrix,s)}createInversionMatrix(e,i){const{center:n}=e,s=zl(en(i));return qc(s,s,dt(n.lng)),eu(s,s,dt(n.lat)),ss(s,s,[e._pixelsPerMercatorPixel,e._pixelsPerMercatorPixel,1]),Float32Array.from(s)}pointCoordinate(e,i,n,s){return Cd(e,i,n,!0)||new oa(0,0)}pointCoordinate3D(e,i,n){const s=this.pointCoordinate(e,i,n,0);return[s.x,s.y,s.z]}isPointAboveHorizon(e,i){return!Cd(e,i.x,i.y,!1)}farthestPixelDistance(e){const i=function(s,c){const u=s.cameraToCenterDistance,p=s._centerAltitude*c,m=s._camera,_=s._camera.forward(),x=zn([],rr([],_,-u),[0,0,p]),b=s.worldSize/(2*Math.PI),w=[0,0,-b],S=s.width/s.height,M=Math.tan(s.fovAboveCenter),C=rr([],m.up(),M),D=rr([],m.right(),M*S),U=Ci([],zn([],zn([],_,C),D)),q=[];let V;if(new nu(x,U).closestPointOnSphere(w,b,q)){const $=zn([],q,w),X=Fr([],$,x);V=Math.cos(s.fovAboveCenter)*wl(X)}else{const $=Fr([],x,w),X=Fr([],w,x);Ci(X,X);const W=wl($)-b;V=Math.sqrt(W*(W+2*b));const ce=Math.acos(V/(b+W))-Math.acos(pr(_,X));V*=Math.cos(ce)}return 1.01*V}(e,this.pixelsPerMeter(e.center.lat,e.worldSize)),n=na(e.zoom);if(n>0){const s=Jp(e,Ur(1,e.center.lat)*e.worldSize),c=e.worldSize/(2*Math.PI),u=Math.max(e.width,e.height)/e.worldSize*Math.PI;return mt(i,s+c*(1-Math.cos(u)),Math.pow(n,10))}return i}upVector(e,i,n){return Cl(i,n,e,1)}upVectorScale(e){return{metersToTile:Wc(Hc(en(e)))}}}function nf(t){const e=t.parallels,i=!!e&&Math.abs(e[0]+e[1])<.01;switch(t.name){case"mercator":return new Qp(t);case"equirectangular":return new Z_(t);case"naturalEarth":return new W_(t);case"equalEarth":return new $_(t);case"winkelTripel":return new X_(t);case"albers":return i?new rf(t):new G_(t);case"lambertConformalConic":return i?new rf(t):new q_(t);case"globe":return new H_(t)}throw new Error(`Invalid projection name: ${t.name}`)}const K_=oh.types,Y_=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function xh(t,e,i,n,s,c,u,p,m,_,x,b,w){const S=p?Math.min(mo,Math.round(p[0])):0,M=p?Math.min(mo,Math.round(p[1])):0;t.emplaceBack(e,i,Math.round(32*n),Math.round(32*s),c,u,(S<<1)+(m?1:0),M,16*_,16*x,256*b,256*w)}function vh(t,e,i,n,s,c,u){t.emplaceBack(e,i,n,s,c,u)}function bh(t,e,i,n,s){t.emplaceBack(e,i,n,s),t.emplaceBack(e,i,n,s),t.emplaceBack(e,i,n,s),t.emplaceBack(e,i,n,s)}function J_(t){for(const e of t.sections)if(Hh(e.text))return!0;return!1}class Nu{constructor(e){this.layoutVertexArray=new ve,this.indexArray=new je,this.programConfigurations=e,this.segments=new Yt,this.dynamicLayoutVertexArray=new we,this.opacityVertexArray=new Ge,this.placedSymbolArray=new Kt,this.globeExtVertexArray=new Ae}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(e,i,n,s){this.isEmpty()||(n&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,s_.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,i),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,l_.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,Y_,!0),this.globeExtVertexArray.length>0&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,a_.members,!0)),this.opacityVertexBuffer.itemSize=1),(n||s)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}}Ue(Nu,"SymbolBuffers");class ju{constructor(e,i,n){this.layoutVertexArray=new e,this.layoutAttributes=i,this.indexArray=new n,this.segments=new Yt,this.collisionVertexArray=new lt,this.collisionVertexArrayExt=new ot}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,c_.members,!0),this.collisionVertexBufferExt=e.createVertexBuffer(this.collisionVertexArrayExt,h_.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy(),this.collisionVertexBufferExt.destroy())}}Ue(ju,"CollisionBuffers");class go{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(u=>u.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.fullyClipped=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Or([]),this.placementViewportMatrix=Or([]);const i=this.layers[0]._unevaluatedLayout._values;this.textSizeData=zu(this.zoom,i["text-size"]),this.iconSizeData=zu(this.zoom,i["icon-size"]);const n=this.layers[0].layout,s=n.get("symbol-sort-key"),c=n.get("symbol-z-order");this.canOverlap=n.get("text-allow-overlap")||n.get("icon-allow-overlap")||n.get("text-ignore-placement")||n.get("icon-ignore-placement"),this.sortFeaturesByKey=c!=="viewport-y"&&s.constantOr(1)!==void 0,this.sortFeaturesByY=(c==="viewport-y"||c==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,this.writingModes=n.get("text-writing-mode").map(u=>or[u]),this.stateDependentLayerIds=this.layers.filter(u=>u.isStateDependent()).map(u=>u.id),this.sourceID=e.sourceID,this.projection=e.projection}createArrays(){this.text=new Nu(new ns(this.layers,this.zoom,e=>/^text/.test(e))),this.icon=new Nu(new ns(this.layers,this.zoom,e=>/^icon/.test(e))),this.glyphOffsetArray=new Ii,this.lineVertexArray=new Js,this.symbolInstances=new Bt}calculateGlyphDependencies(e,i,n,s,c){for(let u=0;u0)&&(m.value.kind!=="constant"||m.value.value.length>0),w=x.value.kind!=="constant"||!!x.value.value||Object.keys(x.parameters).length>0,S=u.get("symbol-sort-key");if(this.features=[],!b&&!w)return;const M=i.iconDependencies,C=i.glyphDependencies,D=i.availableImages,U=new v(this.zoom);for(const{feature:q,id:V,index:$,sourceLayerIndex:X}of e){const W=c._featureFilter.needGeometry,ce=hs(q,W);if(!c._featureFilter.filter(U,ce,n))continue;if(W||(ce.geometry=Pn(q,n,s)),p&&q.type!==1&&n.z<=5){const ue=ce.geometry,ye=.98078528056,xe=(be,Ce)=>pr(Cl(be.x,be.y,n,1),Cl(Ce.x,Ce.y,n,1))=0;for(const xe of se.sections)if(xe.image)M[xe.image.name]=!0;else{const be=fl(se.toString()),Ce=xe.fontStack||ue,pe=C[Ce]=C[Ce]||{};this.calculateGlyphDependencies(xe.text,pe,ye,this.allowVerticalPlacement,be)}}}u.get("symbol-placement")==="line"&&(this.features=function(q){const V={},$={},X=[];let W=0;function ce(ue){X.push(q[ue]),W++}function se(ue,ye,xe){const be=$[ue];return delete $[ue],$[ye]=be,X[be].geometry[0].pop(),X[be].geometry[0]=X[be].geometry[0].concat(xe[0]),be}function me(ue,ye,xe){const be=V[ye];return delete V[ye],V[ue]=be,X[be].geometry[0].shift(),X[be].geometry[0]=xe[0].concat(X[be].geometry[0]),be}function Ee(ue,ye,xe){const be=xe?ye[0][ye[0].length-1]:ye[0][0];return`${ue}:${be.x}:${be.y}`}for(let ue=0;ueue.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((q,V)=>q.sortKey-V.sortKey)}update(e,i,n,s){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,i,this.layers,n,s),this.icon.programConfigurations.updatePaintArrays(e,i,this.layers,n,s))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}getProjection(){return this.projectionInstance||(this.projectionInstance=nf(this.projection)),this.projectionInstance}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,i){const n=this.lineVertexArray.length;if(e.segment!==void 0)for(const{x:s,y:c}of i)this.lineVertexArray.emplaceBack(s,c);return{lineStartIndex:n,lineLength:this.lineVertexArray.length-n}}addSymbols(e,i,n,s,c,u,p,m,_,x,b,w,S,M){const C=e.indexArray,D=e.layoutVertexArray,U=e.globeExtVertexArray,q=e.segments.prepareSegment(4*i.length,D,C,this.canOverlap?u.sortKey:void 0),V=this.glyphOffsetArray.length,$=q.vertexLength,X=this.allowVerticalPlacement&&p===or.vertical?Math.PI/2:0,W=u.text&&u.text.sections;for(let se=0;se=0?i.rightJustifiedTextSymbolIndex:i.centerJustifiedTextSymbolIndex>=0?i.centerJustifiedTextSymbolIndex:i.leftJustifiedTextSymbolIndex>=0?i.leftJustifiedTextSymbolIndex:i.verticalPlacedTextSymbolIndex>=0?i.verticalPlacedTextSymbolIndex:s),u=ch(this.textSizeData,e,c)/mi;return this.tilePixelRatio*u}getSymbolInstanceIconSize(e,i,n){const s=this.icon.placedSymbolArray.get(n),c=ch(this.iconSizeData,e,s);return this.tilePixelRatio*c}_commitDebugCollisionVertexUpdate(e,i,n){e.emplaceBack(i,-n,-n),e.emplaceBack(i,n,-n),e.emplaceBack(i,n,n),e.emplaceBack(i,-n,n)}_updateTextDebugCollisionBoxes(e,i,n,s,c,u){for(let p=s;p0}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(e,i){const n=e.placedSymbolArray.get(i),s=n.vertexStartIndex+4*n.numGlyphs;for(let c=n.vertexStartIndex;cs[p]-s[m]||c[m]-c[p]),u}addToSortKeyRanges(e,i){const n=this.sortKeyRanges[this.sortKeyRanges.length-1];n&&n.sortKey===i?n.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:i,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const i of this.symbolInstanceIndexes){const n=this.symbolInstances.get(i);this.featureSortOrder.push(n.featureIndex);const{rightJustifiedTextSymbolIndex:s,centerJustifiedTextSymbolIndex:c,leftJustifiedTextSymbolIndex:u,verticalPlacedTextSymbolIndex:p,placedIconSymbolIndex:m,verticalPlacedIconSymbolIndex:_}=n;s>=0&&this.addIndicesForPlacedSymbol(this.text,s),c>=0&&c!==s&&this.addIndicesForPlacedSymbol(this.text,c),u>=0&&u!==c&&u!==s&&this.addIndicesForPlacedSymbol(this.text,u),p>=0&&this.addIndicesForPlacedSymbol(this.text,p),m>=0&&this.addIndicesForPlacedSymbol(this.icon,m),_>=0&&this.addIndicesForPlacedSymbol(this.icon,_)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}Ue(go,"SymbolBucket",{omit:["layers","collisionBoxArray","features","compareText"]}),go.MAX_GLYPHS=65535,go.addDynamicAttributes=bh;const Q_=new j({"symbol-placement":new I(fe.layout_symbol["symbol-placement"]),"symbol-spacing":new I(fe.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new I(fe.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new L(fe.layout_symbol["symbol-sort-key"]),"symbol-z-order":new I(fe.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new I(fe.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new I(fe.layout_symbol["icon-ignore-placement"]),"icon-optional":new I(fe.layout_symbol["icon-optional"]),"icon-rotation-alignment":new I(fe.layout_symbol["icon-rotation-alignment"]),"icon-size":new L(fe.layout_symbol["icon-size"]),"icon-text-fit":new I(fe.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new I(fe.layout_symbol["icon-text-fit-padding"]),"icon-image":new L(fe.layout_symbol["icon-image"]),"icon-rotate":new L(fe.layout_symbol["icon-rotate"]),"icon-padding":new I(fe.layout_symbol["icon-padding"]),"icon-keep-upright":new I(fe.layout_symbol["icon-keep-upright"]),"icon-offset":new L(fe.layout_symbol["icon-offset"]),"icon-anchor":new L(fe.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new I(fe.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new I(fe.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new I(fe.layout_symbol["text-rotation-alignment"]),"text-field":new L(fe.layout_symbol["text-field"]),"text-font":new L(fe.layout_symbol["text-font"]),"text-size":new L(fe.layout_symbol["text-size"]),"text-max-width":new L(fe.layout_symbol["text-max-width"]),"text-line-height":new L(fe.layout_symbol["text-line-height"]),"text-letter-spacing":new L(fe.layout_symbol["text-letter-spacing"]),"text-justify":new L(fe.layout_symbol["text-justify"]),"text-radial-offset":new L(fe.layout_symbol["text-radial-offset"]),"text-variable-anchor":new I(fe.layout_symbol["text-variable-anchor"]),"text-anchor":new L(fe.layout_symbol["text-anchor"]),"text-max-angle":new I(fe.layout_symbol["text-max-angle"]),"text-writing-mode":new I(fe.layout_symbol["text-writing-mode"]),"text-rotate":new L(fe.layout_symbol["text-rotate"]),"text-padding":new I(fe.layout_symbol["text-padding"]),"text-keep-upright":new I(fe.layout_symbol["text-keep-upright"]),"text-transform":new L(fe.layout_symbol["text-transform"]),"text-offset":new L(fe.layout_symbol["text-offset"]),"text-allow-overlap":new I(fe.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new I(fe.layout_symbol["text-ignore-placement"]),"text-optional":new I(fe.layout_symbol["text-optional"])});var Gu={paint:new j({"icon-opacity":new L(fe.paint_symbol["icon-opacity"]),"icon-color":new L(fe.paint_symbol["icon-color"]),"icon-halo-color":new L(fe.paint_symbol["icon-halo-color"]),"icon-halo-width":new L(fe.paint_symbol["icon-halo-width"]),"icon-halo-blur":new L(fe.paint_symbol["icon-halo-blur"]),"icon-translate":new I(fe.paint_symbol["icon-translate"]),"icon-translate-anchor":new I(fe.paint_symbol["icon-translate-anchor"]),"text-opacity":new L(fe.paint_symbol["text-opacity"]),"text-color":new L(fe.paint_symbol["text-color"],{runtimeType:Bi,getOverride:t=>t.textColor,hasOverride:t=>!!t.textColor}),"text-halo-color":new L(fe.paint_symbol["text-halo-color"]),"text-halo-width":new L(fe.paint_symbol["text-halo-width"]),"text-halo-blur":new L(fe.paint_symbol["text-halo-blur"]),"text-translate":new I(fe.paint_symbol["text-translate"]),"text-translate-anchor":new I(fe.paint_symbol["text-translate-anchor"])}),layout:Q_};class of{constructor(e){this.type=e.property.overrides?e.property.overrides.runtimeType:qn,this.defaultValue=e}evaluate(e){if(e.formattedSection){const i=this.defaultValue.property.overrides;if(i&&i.hasOverride(e.formattedSection))return i.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Ue(of,"FormatSectionOverride",{omit:["defaultValue"]});class wh extends Br{constructor(e){super(e,Gu)}recalculate(e,i){super.recalculate(e,i),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"));const n=this.layout.get("text-writing-mode");if(n){const s=[];for(const c of n)s.indexOf(c)<0&&s.push(c);this.layout._values["text-writing-mode"]=s}else this.layout._values["text-writing-mode"]=this.layout.get("symbol-placement")==="point"?["horizontal"]:["horizontal","vertical"];this._setPaintOverrides()}getValueAndResolveTokens(e,i,n,s){const c=this.layout.get(e).evaluate(i,{},n,s),u=this._unevaluatedLayout._values[e];return u.isDataDriven()||no(u.value)||!c?c:function(p,m){return m.replace(/{([^{}]+)}/g,(_,x)=>x in p?String(p[x]):"")}(i.properties,c)}createBucket(e){return new go(e)}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(const e of Gu.paint.overridableProperties){if(!wh.hasPaintOverride(this.layout,e))continue;const i=this.paint.get(e),n=new of(i),s=new $s(n,i.property.specification);let c=null;c=i.value.kind==="constant"||i.value.kind==="source"?new rl("source",s):new Ho("composite",s,i.value.zoomStops,i.value._interpolationType),this.paint._values[e]=new B(i.property,c,i.parameters)}}_handleOverridablePaintPropertyUpdate(e,i,n){return!(!this.layout||i.isDataDriven()||n.isDataDriven())&&wh.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,i){const n=e.get("text-field"),s=Gu.paint.properties[i];let c=!1;const u=p=>{for(const m of p)if(s.overrides&&s.overrides.hasOverride(m))return void(c=!0)};if(n.value.kind==="constant"&&n.value.value instanceof Ai)u(n.value.value.sections);else if(n.value.kind==="source"){const p=_=>{c||(_ instanceof xn&&Gt(_.value)===ko?u(_.value.sections):_ instanceof Kr?u(_.sections):_.eachChild(p))},m=n.value;m._styleExpression&&p(m._styleExpression.expression)}return c}getProgramConfiguration(e){return new uo(this,e)}}var eg={paint:new j({"background-color":new I(fe.paint_background["background-color"]),"background-pattern":new I(fe.paint_background["background-pattern"]),"background-opacity":new I(fe.paint_background["background-opacity"])})},tg={paint:new j({"raster-opacity":new I(fe.paint_raster["raster-opacity"]),"raster-hue-rotate":new I(fe.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new I(fe.paint_raster["raster-brightness-min"]),"raster-brightness-max":new I(fe.paint_raster["raster-brightness-max"]),"raster-saturation":new I(fe.paint_raster["raster-saturation"]),"raster-contrast":new I(fe.paint_raster["raster-contrast"]),"raster-resampling":new I(fe.paint_raster["raster-resampling"]),"raster-fade-duration":new I(fe.paint_raster["raster-fade-duration"])})};class ig extends Br{constructor(e){super(e,{}),this.implementation=e}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}isLayerDraped(){return this.implementation.renderToTile!==void 0}shouldRedrape(){return!!this.implementation.shouldRerenderTiles&&this.implementation.shouldRerenderTiles()}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){}onAdd(e){this.implementation.onAdd&&this.implementation.onAdd(e,e.painter.context.gl)}onRemove(e){this.implementation.onRemove&&this.implementation.onRemove(e,e.painter.context.gl)}}var rg={paint:new j({"sky-type":new I(fe.paint_sky["sky-type"]),"sky-atmosphere-sun":new I(fe.paint_sky["sky-atmosphere-sun"]),"sky-atmosphere-sun-intensity":new I(fe.paint_sky["sky-atmosphere-sun-intensity"]),"sky-gradient-center":new I(fe.paint_sky["sky-gradient-center"]),"sky-gradient-radius":new I(fe.paint_sky["sky-gradient-radius"]),"sky-gradient":new N(fe.paint_sky["sky-gradient"]),"sky-atmosphere-halo-color":new I(fe.paint_sky["sky-atmosphere-halo-color"]),"sky-atmosphere-color":new I(fe.paint_sky["sky-atmosphere-color"]),"sky-opacity":new I(fe.paint_sky["sky-opacity"])})};function $u(t,e,i){const n=[0,0,1],s=Td([]);return Sd(s,s,i?-dt(t)+Math.PI:dt(t)),Ed(s,s,-dt(e)),xd(n,n,s),Ci(n,n)}const ng={circle:class extends Br{constructor(t){super(t,mm)}createBucket(t){return new _u(t)}queryRadius(t){const e=t;return sa("circle-radius",this,e)+sa("circle-stroke-width",this,e)+Jc(this.paint.get("circle-translate"))}queryIntersectsFeature(t,e,i,n,s,c,u,p){const m=Wd(this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),c.angle,t.pixelToTileUnitsFactor),_=this.paint.get("circle-radius").evaluate(e,i)+this.paint.get("circle-stroke-width").evaluate(e,i);return Xd(t,n,c,u,p,this.paint.get("circle-pitch-alignment")==="map",this.paint.get("circle-pitch-scale")==="map",m,_)}getProgramIds(){return["circle"]}getProgramConfiguration(t){return new uo(this,t)}},heatmap:class extends Br{createBucket(t){return new Kd(t)}constructor(t){super(t,xm),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){t==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=vu({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(t){return sa("heatmap-radius",this,t)}queryIntersectsFeature(t,e,i,n,s,c,u,p){const m=this.paint.get("heatmap-radius").evaluate(e,i);return Xd(t,n,c,u,p,!0,!0,new Le(0,0),m)}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}getProgramIds(){return["heatmap","heatmapTexture"]}getProgramConfiguration(t){return new uo(this,t)}},hillshade:class extends Br{constructor(t){super(t,vm)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}getProgramIds(){return["hillshade","hillshadePrepare"]}},fill:class extends Br{constructor(t){super(t,Bm)}getProgramIds(){const t=this.paint.get("fill-pattern"),e=t&&t.constantOr(1),i=[e?"fillPattern":"fill"];return this.paint.get("fill-antialias")&&i.push(e&&!this.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline"),i}getProgramConfiguration(t){return new uo(this,t)}recalculate(t,e){super.recalculate(t,e);const i=this.paint._values["fill-outline-color"];i.value.kind==="constant"&&i.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(t){return new rh(t)}queryRadius(){return Jc(this.paint.get("fill-translate"))}queryIntersectsFeature(t,e,i,n,s,c){return!t.queryGeometry.isAboveHorizon&&jd(qd(t.tilespaceGeometry,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),c.angle,t.pixelToTileUnitsFactor),n)}isTileClipped(){return!0}},"fill-extrusion":class extends Br{constructor(t){super(t,Jm)}createBucket(t){return new Fl(t)}queryRadius(){return Jc(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}getProgramIds(){return[this.paint.get("fill-extrusion-pattern").constantOr(1)?"fillExtrusionPattern":"fillExtrusion"]}getProgramConfiguration(t){return new uo(this,t)}queryIntersectsFeature(t,e,i,n,s,c,u,p,m){const _=Wd(this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),c.angle,t.pixelToTileUnitsFactor),x=this.paint.get("fill-extrusion-height").evaluate(e,i),b=this.paint.get("fill-extrusion-base").evaluate(e,i),w=[0,0],S=p&&c.elevation,M=c.elevation?c.elevation.exaggeration():1,C=t.tile.getBucket(this);if(S&&C instanceof Fl){const $=C.centroidVertexArray,X=m+1;X<$.length&&(w[0]=$.geta_centroid_pos0(X),w[1]=$.geta_centroid_pos1(X))}if(w[0]===0&&w[1]===1)return!1;c.projection.name==="globe"&&(n=fp([n],[new Le(0,0),new Le(Ze,Ze)],t.tileID.canonical).map($=>$.polygon).flat());const D=S?p:null,[U,q]=function($,X,W,ce,se,me,Ee,ue,ye,xe,be){return $.projection.name==="globe"?function(Ce,pe,De,Ne,Re,He,ze,$e,Ke,gt,Ye){const We=[],Rt=[],et=Ce.projection.upVectorScale(Ye,Ce.center.lat,Ce.worldSize).metersToTile,tt=[0,0,0,1],It=[0,0,0,1],kt=(Ct,Nt,$t,Qt)=>{Ct[0]=Nt,Ct[1]=$t,Ct[2]=Qt,Ct[3]=1},Dt=pp();De>0&&(De+=Dt),Ne+=Dt;for(const Ct of pe){const Nt=[],$t=[];for(const Qt of Ct){const zt=Qt.x+Re.x,ni=Qt.y+Re.y,ei=Ce.projection.projectTilePoint(zt,ni,Ye),jt=Ce.projection.upVector(Ye,Qt.x,Qt.y);let xt=De,ti=Ne;if(ze){const Lt=yp(zt,ni,De,Ne,ze,$e,Ke,gt);xt+=Lt.base,ti+=Lt.top}De!==0?kt(tt,ei.x+jt[0]*et*xt,ei.y+jt[1]*et*xt,ei.z+jt[2]*et*xt):kt(tt,ei.x,ei.y,ei.z),kt(It,ei.x+jt[0]*et*ti,ei.y+jt[1]*et*ti,ei.z+jt[2]*et*ti),qt(tt,tt,He),qt(It,It,He),Nt.push(new ca(tt[0],tt[1],tt[2])),$t.push(new ca(It[0],It[1],It[2]))}We.push(Nt),Rt.push($t)}return[We,Rt]}($,X,W,ce,se,me,Ee,ue,ye,xe,be):Ee?function(Ce,pe,De,Ne,Re,He,ze,$e,Ke){const gt=[],Ye=[],We=[0,0,0,1];for(const Rt of Ce){const et=[],tt=[];for(const It of Rt){const kt=It.x+Ne.x,Dt=It.y+Ne.y,Ct=yp(kt,Dt,pe,De,He,ze,$e,Ke);We[0]=kt,We[1]=Dt,We[2]=Ct.base,We[3]=1,as(We,We,Re),We[3]=Math.max(We[3],1e-5);const Nt=new ca(We[0]/We[3],We[1]/We[3],We[2]/We[3]);We[0]=kt,We[1]=Dt,We[2]=Ct.top,We[3]=1,as(We,We,Re),We[3]=Math.max(We[3],1e-5);const $t=new ca(We[0]/We[3],We[1]/We[3],We[2]/We[3]);et.push(Nt),tt.push($t)}gt.push(et),Ye.push(tt)}return[gt,Ye]}(X,W,ce,se,me,Ee,ue,ye,xe):function(Ce,pe,De,Ne,Re){const He=[],ze=[],$e=Re[8]*pe,Ke=Re[9]*pe,gt=Re[10]*pe,Ye=Re[11]*pe,We=Re[8]*De,Rt=Re[9]*De,et=Re[10]*De,tt=Re[11]*De;for(const It of Ce){const kt=[],Dt=[];for(const Ct of It){const Nt=Ct.x+Ne.x,$t=Ct.y+Ne.y,Qt=Re[0]*Nt+Re[4]*$t+Re[12],zt=Re[1]*Nt+Re[5]*$t+Re[13],ni=Re[2]*Nt+Re[6]*$t+Re[14],ei=Re[3]*Nt+Re[7]*$t+Re[15],jt=Qt+$e,xt=zt+Ke,ti=ni+gt,Lt=Math.max(ei+Ye,1e-5),ki=Qt+We,ii=zt+Rt,_i=ni+et,di=Math.max(ei+tt,1e-5);kt.push(new ca(jt/Lt,xt/Lt,ti/Lt)),Dt.push(new ca(ki/di,ii/di,_i/di))}He.push(kt),ze.push(Dt)}return[He,ze]}(X,W,ce,se,me)}(c,n,b,x,_,u,D,w,M,c.center.lat,t.tileID.canonical),V=t.queryGeometry;return function($,X,W){let ce=1/0;jd(W,X)&&(ce=gp(W,X[0]));for(let se=0;se=3){for(let M=0;M{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){this._channel=void 0,this._callback=()=>{}}}class sg{constructor(){this.tasks={},this.taskQueue=[],dn(["process"],this),this.invoker=new og(this.process),this.nextId=0}add(e,i){const n=this.nextId++,s=function({type:c,isSymbolTile:u,zoom:p}){return p=p||0,c==="message"?0:c!=="maybePrepare"||u?c!=="parseTile"||u?c==="parseTile"&&u?300-p:c==="maybePrepare"&&u?400-p:500:200-p:100-p}(i);if(s===0){Tr();try{e()}finally{}return{cancel:()=>{}}}return this.tasks[n]={fn:e,metadata:i,priority:s,id:n},this.taskQueue.push(n),this.invoker.trigger(),{cancel:()=>{delete this.tasks[n]}}}process(){Tr();try{if(this.taskQueue=this.taskQueue.filter(n=>!!this.tasks[n]),!this.taskQueue.length)return;const e=this.pick();if(e===null)return;const i=this.tasks[e];if(delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),!i)return;i.fn()}finally{}}pick(){let e=null,i=1/0;for(let s=0;s>=1)>1;){const _=i+s>>1,x=n+c>>1;1&e?(s=i,c=n,i=u,n=p):(i=s,n=c,s=u,c=p),u=_,p=x}const m=4*t;yo[m+0]=i,yo[m+1]=n,yo[m+2]=s,yo[m+3]=c}const on=new Uint16Array(2178),xo=new Uint8Array(1089),Th=new Uint16Array(1089);function lf(t){return t===0?-.03125:t===32?.03125:0}var cf=te([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);const hf={type:2,extent:Ze,loadGeometry:()=>[[new Le(0,0),new Le(Ze+1,0),new Le(Ze+1,Ze+1),new Le(0,Ze+1),new Le(0,0)]]};class Zu{constructor(e,i,n,s,c){this.tileID=e,this.uid=Fn(),this.uses=0,this.tileSize=i,this.tileZoom=n,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.isRaster=c,this.expiredRequestCount=0,this.state="loading",s&&s.transform&&(this.projection=s.transform.projection)}registerFadeDuration(e){const i=e+this.timeAdded;ic.getLayer(_)).filter(Boolean);if(m.length!==0){p.layers=m,p.stateDependentLayerIds&&(p.stateDependentLayers=p.stateDependentLayerIds.map(_=>m.filter(x=>x.id===_)[0]));for(const _ of m)u[_.id]=p}}return u}(e.buckets,i.style),this.hasSymbolBuckets=!1;for(const s in this.buckets){const c=this.buckets[s];if(c instanceof go){if(this.hasSymbolBuckets=!0,!n)break;c.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const s in this.buckets){const c=this.buckets[s];if(c instanceof go&&c.hasRTLText){this.hasRTLText=!0,y.isLoading()||y.isLoaded()||f()!=="deferred"||g();break}}this.queryPadding=0;for(const s in this.buckets){const c=this.buckets[s];this.queryPadding=Math.max(this.queryPadding,i.style.getLayer(s).queryRadius(c))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage),e.lineAtlas&&(this.lineAtlas=e.lineAtlas)}else this.collisionBoxArray=new Mt}unloadVectorData(){if(this.hasData()){for(const e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.lineAtlasTexture&&this.lineAtlasTexture.destroy(),this._tileBoundsBuffer&&(this._tileBoundsBuffer.destroy(),this._tileBoundsIndexBuffer.destroy(),this._tileBoundsSegments.destroy(),this._tileBoundsBuffer=null),this._tileDebugBuffer&&(this._tileDebugBuffer.destroy(),this._tileDebugSegments.destroy(),this._tileDebugBuffer=null),this._tileDebugIndexBuffer&&(this._tileDebugIndexBuffer.destroy(),this._tileDebugIndexBuffer=null),this._globeTileDebugBorderBuffer&&(this._globeTileDebugBorderBuffer.destroy(),this._globeTileDebugBorderBuffer=null),this._tileDebugTextBuffer&&(this._tileDebugTextBuffer.destroy(),this._tileDebugTextSegments.destroy(),this._tileDebugTextIndexBuffer.destroy(),this._tileDebugTextBuffer=null),this._globeTileDebugTextBuffer&&(this._globeTileDebugTextBuffer.destroy(),this._globeTileDebugTextBuffer=null),this.latestFeatureIndex=null,this.state="unloaded"}}getBucket(e){return this.buckets[e.id]}upload(e){for(const n in this.buckets){const s=this.buckets[n];s.uploadPending()&&s.upload(e)}const i=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Hl(e,this.imageAtlas.image,i.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Hl(e,this.glyphAtlasImage,i.ALPHA),this.glyphAtlasImage=null),this.lineAtlas&&!this.lineAtlas.uploaded&&(this.lineAtlasTexture=new Hl(e,this.lineAtlas.image,i.ALPHA),this.lineAtlas.uploaded=!0)}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,i,n,s,c,u,p,m){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({tileResult:s,pixelPosMatrix:p,transform:u,params:c,tileTransform:this.tileTransform},e,i,n):{}}querySourceFeatures(e,i){const n=this.latestFeatureIndex;if(!n||!n.rawTileData)return;const s=n.loadVTLayers(),c=i?i.sourceLayer:"",u=s._geojsonTileLayer||s[c];if(!u)return;const p=Xs(i&&i.filter),{z:m,x:_,y:x}=this.tileID.canonical,b={z:m,x:_,y:x};for(let w=0;wn)s=!1;else if(i)if(this.expirationTime=0;D--){const U=4*D,q=yo[U+0],V=yo[U+1],$=yo[U+2],X=yo[U+3],W=q+$>>1,ce=V+X>>1,se=W+ce-V,me=ce+q-W,Ee=V*nn+q,ue=X*nn+$,ye=ce*nn+W,xe=Math.hypot((on[2*Ee+0]+on[2*ue+0])/2-on[2*ye+0],(on[2*Ee+1]+on[2*ue+1])/2-on[2*ye+1])>=16;xo[ye]=xo[ye]||(xe?1:0),D<1022&&(xo[ye]=xo[ye]||xo[(V+me>>1)*nn+(q+se>>1)]||xo[(X+me>>1)*nn+($+se>>1)])}const b=new ge,w=new je;let S=0;function M(D,U){const q=U*nn+D;return Th[q]===0&&(b.emplaceBack(on[2*q+0],on[2*q+1],D*Ze/_r,U*Ze/_r),Th[q]=++S),Th[q]-1}function C(D,U,q,V,$,X){const W=D+q>>1,ce=U+V>>1;if(Math.abs(D-$)+Math.abs(U-X)>1&&xo[ce*nn+W])C($,X,D,U,W,ce),C(q,V,$,X,W,ce);else{const se=M(D,U),me=M(q,V),Ee=M($,X);w.emplaceBack(se,me,Ee)}}return C(0,0,_r,_r,_r,0),C(_r,_r,0,0,0,_r),{vertices:b,indices:w}}(this.tileID.canonical,i);s=u.vertices,c=u.indices}else{s=new ge,c=new je;for(const{x:p,y:m}of n)s.emplaceBack(p,m,0,0);const u=Su(s.int16,void 0,4);for(let p=0;p0&&(p=Qh(new Float64Array(16),i.globeMatrix)),this._makeGlobeTileDebugBorderBuffer(e,s,i,c,p,u),this._makeGlobeTileDebugTextBuffer(e,s,i,c,p,u)}_globePoint(e,i,n,s,c,u,p){let m=Cl(e,i,n);if(u){const _=1<.5?S=-1:w<-.5&&(S=1);let M=(e/Ze+n.x)/_+S,C=(i/Ze+n.y)/_;M=(M-x)*s._pixelsPerMercatorPixel+x,C=(C-b)*s._pixelsPerMercatorPixel+b;const D=[M*s.worldSize,C*s.worldSize,0];qt(D,D,u),m=cs(m,D,p)}return qt(m,m,c)}_makeGlobeTileDebugBorderBuffer(e,i,n,s,c,u){const p=new Te,m=new Zi,_=new oe,x=(w,S,M,C,D)=>{const U=(M-w)/(D-1),q=(C-S)/(D-1),V=p.length;for(let $=0;$b*S+M;for(let S=0;Se[u])return null}else{const p=1/n[u];let m=(t[u]-i[u])*p,_=(e[u]-i[u])*p;if(m>_){const x=m;m=_,_=x}if(m>s&&(s=m),_c)return null}return s}function pf(t,e,i,n,s,c,u,p,m,_,x){const b=n-t,w=s-e,S=c-i,M=u-t,C=p-e,D=m-i,U=x[1]*D-x[2]*C,q=x[2]*M-x[0]*D,V=x[0]*C-x[1]*M,$=b*U+w*q+S*V;if(Math.abs($)<1e-15)return null;const X=1/$,W=_[0]-t,ce=_[1]-e,se=_[2]-i,me=(W*U+ce*q+se*V)*X;if(me<0||me>1)return null;const Ee=ce*S-se*w,ue=se*b-W*S,ye=W*w-ce*b,xe=(x[0]*Ee+x[1]*ue+x[2]*ye)*X;return xe<0||me+xe>1?null:(M*Ee+C*ue+D*ye)*X}function ff(t,e,i){return(t-e)/(i-e)}function mf(t,e,i,n,s,c,u,p,m){const _=1<{const q=D?1:0,V=(S+1)*C-q,$=M*C,X=(M+1)*C-q;U[0]=S*C,U[1]=$,U[2]=V,U[3]=X};let b=new uf(m);const w=[];for(let S=0;S=1;m/=2){const S=p[p.length-1];b=new uf(m);for(let M=0;M0;){const{idx:M,t:C,nodex:D,nodey:U,depth:q}=S.pop();if(this.leaves[M]){mf(D,U,q,e,i,n,s,b,w);const $=1<=pe[2])return C}continue}let V=0;for(let $=0;$=_[x[se]]&&(x.splice(se,0,$),ce=!0);ce||(x[V]=$),V++}}for(let $=0;$=this.dim+1||i<-1||i>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(i+1)*this.stride+(e+1)}static pack(e,i){const n=[0,0,0,0],s=Eh.getUnpackVector(i);let c=Math.floor((e+s[3])/s[2]);return n[2]=c%256,c=Math.floor(c/256),n[1]=c%256,c=Math.floor(c/256),n[0]=c,n}getPixels(){return new Wi({width:this.stride,height:this.stride},this.pixels)}backfillBorder(e,i,n){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let s=i*this.dim,c=i*this.dim+this.dim,u=n*this.dim,p=n*this.dim+this.dim;switch(i){case-1:s=c-1;break;case 1:c=s+1}switch(n){case-1:u=p-1;break;case 1:p=u+1}const m=-i*this.dim,_=-n*this.dim;for(let x=u;x{this.remove(e,c)},n)),this.data[s].push(c),this.order.push(s),this.order.length>this.max){const u=this._getAndRemoveByKey(this.order[0]);u&&this.onRemove(u)}return this}has(e){return e.wrapped().key in this.data}getAndRemove(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}_getAndRemoveByKey(e){const i=this.data[e].shift();return i.timeout&&clearTimeout(i.timeout),this.data[e].length===0&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),i.value}getByKey(e){const i=this.data[e];return i?i[0].value:null}get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,i){if(!this.has(e))return this;const n=e.wrapped().key,s=i===void 0?0:this.data[n].indexOf(i),c=this.data[n][s];return this.data[n].splice(s,1),c.timeout&&clearTimeout(c.timeout),this.data[n].length===0&&delete this.data[n],this.onRemove(c.value),this.order.splice(this.order.indexOf(n),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){const i=this._getAndRemoveByKey(this.order[0]);i&&this.onRemove(i)}return this}filter(e){const i=[];for(const n in this.data)for(const s of this.data[n])e(s.value)||i.push(s);for(const n of i)this.remove(n.value.tileID,n)}}class xa{constructor(e,i,n){this.func=e,this.mask=i,this.range=n}}xa.ReadOnly=!1,xa.ReadWrite=!0,xa.disabled=new xa(519,xa.ReadOnly,[0,1]);const qu=7680;class Wu{constructor(e,i,n,s,c,u){this.test=e,this.ref=i,this.mask=n,this.fail=s,this.depthFail=c,this.pass=u}}Wu.disabled=new Wu({func:519,mask:0},0,0,qu,qu,qu);class sn{constructor(e,i,n){this.blendFunction=e,this.blendColor=i,this.mask=n}}sn.Replace=[1,0],sn.disabled=new sn(sn.Replace,Zt.transparent,[!1,!1,!1,!1]),sn.unblended=new sn(sn.Replace,Zt.transparent,[!0,!0,!0,!0]),sn.alphaBlended=new sn([1,771],Zt.transparent,[!0,!0,!0,!0]);const Xu=1029,Hu=2305;class jr{constructor(e,i,n){this.enable=e,this.mode=i,this.frontFace=n}}jr.disabled=new jr(!1,Xu,Hu),jr.backCCW=new jr(!0,Xu,Hu),jr.backCW=new jr(!0,Xu,2304),jr.frontCW=new jr(!0,1028,2304),jr.frontCCW=new jr(!0,1028,Hu);class fs extends Po{constructor(e,i,n){super(),this.id=e,this._onlySymbols=n,i.on("data",s=>{s.dataType==="source"&&s.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&s.dataType==="source"&&s.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform))}),i.on("error",()=>{this._sourceErrored=!0}),this._source=i,this._tiles={},this._cache=new ug(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._minTileCacheSize=i.minTileCacheSize,this._maxTileCacheSize=i.maxTileCacheSize,this._loadedParentTiles={},this._coveredTiles={},this._state=new lg,this._isRaster=this._source.type==="raster"||this._source.type==="raster-dem"||this._source.type==="custom"&&this._source._dataType==="raster"}onAdd(e){this.map=e,this._minTileCacheSize=this._minTileCacheSize===void 0&&e?e._minTileCacheSize:this._minTileCacheSize,this._maxTileCacheSize=this._maxTileCacheSize===void 0&&e?e._maxTileCacheSize:this._maxTileCacheSize}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(const e in this._tiles){const i=this._tiles[e];if(i.state!=="loaded"&&i.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform)}_loadTile(e,i){return e.isSymbolTile=this._onlySymbols,this._source.loadTile(e,i)}_unloadTile(e){if(this._source.unloadTile)return this._source.unloadTile(e,()=>{})}_abortTile(e){if(this._source.abortTile)return this._source.abortTile(e,()=>{})}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const i in this._tiles){const n=this._tiles[i];n.upload(e),n.prepare(this.map.style.imageManager)}}getIds(){return $r(this._tiles).map(e=>e.tileID).sort(xf).map(e=>e.key)}getRenderableIds(e){const i=[];for(const n in this._tiles)this._isIdRenderable(+n,e)&&i.push(this._tiles[n]);return e?i.sort((n,s)=>{const c=n.tileID,u=s.tileID,p=new Le(c.canonical.x,c.canonical.y)._rotate(this.transform.angle),m=new Le(u.canonical.x,u.canonical.y)._rotate(this.transform.angle);return c.overscaledZ-u.overscaledZ||m.y-p.y||m.x-p.x}).map(n=>n.tileID.key):i.map(n=>n.tileID).sort(xf).map(n=>n.key)}hasRenderableParent(e){const i=this.findLoadedParent(e,0);return!!i&&this._isIdRenderable(i.tileID.key)}_isIdRenderable(e,i){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(i||!this._tiles[e].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const e in this._tiles)this._tiles[e].state!=="errored"&&this._reloadTile(+e,"reloading")}}_reloadTile(e,i){const n=this._tiles[e];n&&(n.state!=="loading"&&(n.state=i),this._loadTile(n,this._tileLoaded.bind(this,n,e,i)))}_tileLoaded(e,i,n,s){if(s)if(e.state="errored",s.status!==404)this._source.fire(new Sr(s,{tile:e}));else if(this._source.type==="raster-dem"&&this.usedForTerrain&&this.map.painter.terrain){const c=this.map.painter.terrain;this.update(this.transform,c.getScaledDemTileSize(),!0),c.resetTileLookupCache(this.id)}else this.update(this.transform);else e.timeAdded=Er.now(),n==="expired"&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(i,e),this._source.type==="raster-dem"&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),this._source.fire(new gn("data",{dataType:"source",tile:e,coord:e.tileID,sourceCacheId:this.id}))}_backfillDEM(e){const i=this.getRenderableIds();for(let s=0;s1||(Math.abs(u)>1&&(Math.abs(u+m)===1?u+=m:Math.abs(u-m)===1&&(u-=m)),c.dem&&s.dem&&(s.dem.backfillBorder(c.dem,u,p),s.neighboringTiles&&s.neighboringTiles[_]&&(s.neighboringTiles[_].backfilled=!0)))}}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._tiles[e]}_retainLoadedChildren(e,i,n,s){for(const c in this._tiles){let u=this._tiles[c];if(s[c]||!u.hasData()||u.tileID.overscaledZ<=i||u.tileID.overscaledZ>n)continue;let p=u.tileID;for(;u&&u.tileID.overscaledZ>i+1;){const _=u.tileID.scaledTo(u.tileID.overscaledZ-1);u=this._tiles[_.key],u&&u.hasData()&&(p=_)}let m=p;for(;m.overscaledZ>i;)if(m=m.scaledTo(m.overscaledZ-1),e[m.key]){s[p.key]=p;break}}}findLoadedParent(e,i){if(e.key in this._loadedParentTiles){const n=this._loadedParentTiles[e.key];return n&&n.tileID.overscaledZ>=i?n:null}for(let n=e.overscaledZ-1;n>=i;n--){const s=e.scaledTo(n),c=this._getLoadedTile(s);if(c)return c}}_getLoadedTile(e){const i=this._tiles[e.key];return i&&i.hasData()?i:this._cache.getByKey(this._source.reparseOverscaled?e.wrapped().key:e.canonical.key)}updateCacheSize(e,i){i=i||this._source.tileSize;const n=Math.ceil(e.width/i)+1,s=Math.ceil(e.height/i)+1,c=Math.floor(n*s*5),u=typeof this._minTileCacheSize=="number"?Math.max(this._minTileCacheSize,c):c,p=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,u):u;this._cache.setMaxSize(p)}handleWrapJump(e){const i=Math.round((e-(this._prevLng===void 0?e:this._prevLng))/360);if(this._prevLng=e,i){const n={};for(const s in this._tiles){const c=this._tiles[s];c.tileID=c.tileID.unwrapTo(c.tileID.wrap+i),n[c.tileID.key]=c}this._tiles=n;for(const s in this._timers)clearTimeout(this._timers[s]),delete this._timers[s];for(const s in this._tiles)this._setTileReloadTimer(+s,this._tiles[s])}}update(e,i,n){if(this.transform=e,!this._sourceLoaded||this._paused||this.transform.freezeTileCoverage||this.usedForTerrain&&!n)return;let s;this.updateCacheSize(e,i),this.transform.projection.name!=="globe"&&this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?s=e.getVisibleUnwrappedCoordinates(this._source.tileID).map(p=>new Pi(p.canonical.z,p.wrap,p.canonical.z,p.canonical.x,p.canonical.y)):(s=e.coveringTiles({tileSize:i||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!n,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain}),this._source.hasTile&&(s=s.filter(p=>this._source.hasTile(p)))):s=[];const c=this._updateRetainedTiles(s);if(vf(this._source.type)&&s.length!==0){const p={},m={},_=Object.keys(c);for(const b of _){const w=c[b],S=this._tiles[b];if(!S||S.fadeEndTime&&S.fadeEndTime<=Er.now())continue;const M=this.findLoadedParent(w,Math.max(w.overscaledZ-fs.maxOverzooming,this._source.minzoom));M&&(this._addTile(M.tileID),p[M.tileID.key]=M.tileID),m[b]=w}const x=s[s.length-1].overscaledZ;for(const b in this._tiles){const w=this._tiles[b];if(c[b]||!w.hasData())continue;let S=w.tileID;for(;S.overscaledZ>x;){S=S.scaledTo(S.overscaledZ-1);const M=this._tiles[S.key];if(M&&M.hasData()&&m[S.key]){c[b]=w.tileID;break}}}for(const b in p)c[b]||(this._coveredTiles[b]=!0,c[b]=p[b])}for(const p in c)this._tiles[p].clearFadeHold();const u=function(p,m){const _=[];for(const x in p)x in m||_.push(x);return _}(this._tiles,c);for(const p of u){const m=this._tiles[p];m.hasSymbolBuckets&&!m.holdingForFade()?m.setHoldDuration(this.map._fadeDuration):m.hasSymbolBuckets&&!m.symbolFadeFinished()||this._removeTile(+p)}this._updateLoadedParentTileCache(),this._onlySymbols&&this._source.afterUpdate&&this._source.afterUpdate()}releaseSymbolFadeTiles(){for(const e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(+e)}_updateRetainedTiles(e){const i={};if(e.length===0)return i;const n={},s=e.reduce((_,x)=>Math.min(_,x.overscaledZ),1/0),c=e[0].overscaledZ,u=Math.max(c-fs.maxOverzooming,this._source.minzoom),p=Math.max(c+fs.maxUnderzooming,this._source.minzoom),m={};for(const _ of e){const x=this._addTile(_);i[_.key]=_,x.hasData()||s=this._source.maxzoom){const w=_.children(this._source.maxzoom)[0],S=this.getTile(w);if(S&&S.hasData()){i[w.key]=w;continue}}else{const w=_.children(this._source.maxzoom);if(i[w[0].key]&&i[w[1].key]&&i[w[2].key]&&i[w[3].key])continue}let b=x.wasRequested();for(let w=_.overscaledZ-1;w>=u;--w){const S=_.scaledTo(w);if(n[S.key]||(n[S.key]=!0,x=this.getTile(S),!x&&b&&(x=this._addTile(S)),x&&(i[S.key]=S,b=x.wasRequested(),x.hasData())))break}}return i}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const e in this._tiles){const i=[];let n,s=this._tiles[e].tileID;for(;s.overscaledZ>0;){if(s.key in this._loadedParentTiles){n=this._loadedParentTiles[s.key];break}i.push(s.key);const c=s.scaledTo(s.overscaledZ-1);if(n=this._getLoadedTile(c),n)break;s=c}for(const c of i)this._loadedParentTiles[c]=n}}_addTile(e){let i=this._tiles[e.key];if(i)return i;i=this._cache.getAndRemove(e),i&&(this._setTileReloadTimer(e.key,i),i.tileID=e,this._state.initializeTileState(i,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,i)));const n=!!i;if(!n){const s=this.map?this.map.painter:null;i=new Zu(e,this._source.tileSize*e.overscaleFactor(),this.transform.tileZoom,s,this._isRaster),this._loadTile(i,this._tileLoaded.bind(this,i,e.key,i.state))}return i?(i.uses++,this._tiles[e.key]=i,n||this._source.fire(new gn("dataloading",{tile:i,coord:i.tileID,dataType:"source"})),i):null}_setTileReloadTimer(e,i){e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);const n=i.getExpiryTimeout();n&&(this._timers[e]=setTimeout(()=>{this._reloadTile(e,"expired"),delete this._timers[e]},n))}_removeTile(e){const i=this._tiles[e];i&&(i.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),i.uses>0||(i.hasData()&&i.state!=="reloading"?this._cache.add(i.tileID,i,i.getExpiryTimeout()):(i.aborted=!0,this._abortTile(i),this._unloadTile(i))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const e in this._tiles)this._removeTile(+e);this._source._clear&&this._source._clear(),this._cache.reset(),this.map&&this.usedForTerrain&&this.map.painter.terrain&&this.map.painter.terrain.resetTileLookupCache(this.id)}tilesIn(e,i,n){const s=[],c=this.transform;if(!c)return s;const u=c.projection.name==="globe",p=tn(c.center.lng);for(const m in this._tiles){const _=this._tiles[m];if(n&&_.clearQueryDebugViz(),_.holdingForFade())continue;let x;if(u){const b=_.tileID.canonical;if(b.z===0){const w=[Math.abs(ct(p,...Kl(b,-1))-p),Math.abs(ct(p,...Kl(b,1))-p)];x=[0,2*w.indexOf(Math.min(...w))-1]}else{const w=[Math.abs(ct(p,...Kl(b,-1))-p),Math.abs(ct(p,...Kl(b,0))-p),Math.abs(ct(p,...Kl(b,1))-p)];x=[w.indexOf(Math.min(...w))-1]}}else x=[0];for(const b of x){const w=e.containsTile(_,c,i,b);w&&s.push(w)}}return s}getVisibleCoordinates(e){const i=this.getRenderableIds(e).map(n=>this._tiles[n].tileID);for(const n of i)n.projMatrix=this.transform.calculateProjMatrix(n.toUnwrapped());return i}hasTransition(){if(this._source.hasTransition())return!0;if(vf(this._source.type))for(const e in this._tiles){const i=this._tiles[e];if(i.fadeEndTime!==void 0&&i.fadeEndTime>=Er.now())return!0}return!1}setFeatureState(e,i,n){this._state.updateState(e=e||"_geojsonTileLayer",i,n)}removeFeatureState(e,i,n){this._state.removeFeatureState(e=e||"_geojsonTileLayer",i,n)}getFeatureState(e,i){return this._state.getState(e=e||"_geojsonTileLayer",i)}setDependencies(e,i,n){const s=this._tiles[e];s&&s.setDependencies(i,n)}reloadTilesForDependencies(e,i){for(const n in this._tiles)this._tiles[n].hasDependency(e,i)&&this._reloadTile(+n,"reloading");this._cache.filter(n=>!n.hasDependency(e,i))}_preloadTiles(e,i){if(!this._sourceLoaded){const p=()=>{this._sourceLoaded&&(this._source.off("data",p),this._preloadTiles(e,i))};return void this._source.on("data",p)}const n=new Map,s=Array.isArray(e)?e:[e],c=this.map.painter.terrain,u=this.usedForTerrain&&c?c.getScaledDemTileSize():this._source.tileSize;for(const p of s){const m=p.coveringTiles({tileSize:u,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!this.usedForTerrain,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain});for(const _ of m)n.set(_.key,_);this.usedForTerrain&&p.updateElevation(!1)}ai(Array.from(n.values()),(p,m)=>{const _=new Zu(p,this._source.tileSize*p.overscaleFactor(),this.transform.tileZoom,this.map.painter,this._isRaster);this._loadTile(_,x=>{this._source.type==="raster-dem"&&_.dem&&this._backfillDEM(_),m(x,_)})},i)}}function xf(t,e){const i=Math.abs(2*t.wrap)-+(t.wrap<0),n=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||n-i||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function vf(t){return t==="raster"||t==="image"||t==="video"||t==="custom"}function Kl(t,e){const i=1<=0&&b[3]>=0&&m.insert(p,b[0],b[1],b[2],b[3])}}loadVTLayers(){if(!this.vtLayers){this.vtLayers=new Cu(new uh(this.rawTileData)).layers,this.sourceLayerCoder=new sf(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]),this.vtFeatures={};for(const e in this.vtLayers)this.vtFeatures[e]=[]}return this.vtLayers}query(e,i,n,s){this.loadVTLayers();const c=e.params||{},u=Xs(c.filter),p=e.tileResult,m=e.transform,_=p.bufferedTilespaceBounds,x=this.grid.query(_.min.x,_.min.y,_.max.x,_.max.y,(M,C,D,U)=>Zd(p.bufferedTilespaceGeometry,M,C,D,U));x.sort(dg);let b=null;m.elevation&&x.length>0&&(b=Sh.create(m.elevation,this.tileID));const w={};let S;for(let M=0;M(U||(U=Pn(q,this.tileID.canonical,e.tileTransform)),V.queryIntersectsFeature(p,q,$,U,this.z,e.transform,e.pixelPosMatrix,b,X)))}return w}loadMatchingFeature(e,i,n,s,c,u,p,m,_){const{featureIndex:x,bucketIndex:b,sourceLayerIndex:w,layoutVertexArrayOffset:S}=i,M=this.bucketLayerIDs[b];if(s&&!function(q,V){for(let $=0;$=0)return!0;return!1}(s,M))return;const C=this.sourceLayerCoder.decode(w),D=this.vtLayers[C].feature(x);if(n.needGeometry){const q=hs(D,!0);if(!n.filter(new v(this.tileID.overscaledZ),q,this.tileID.canonical))return}else if(!n.filter(new v(this.tileID.overscaledZ),D))return;const U=this.getId(D,C);for(let q=0;q{const p=e instanceof F?e.get(u):null;return p&&p.evaluate?p.evaluate(i,n,s):p})}function dg(t,e){return e-t}Ue(bf,"FeatureIndex",{omit:["rawTileData","sourceLayerCoder"]});class Tf{constructor(e,i){this.width=e,this.height=i,this.nextRow=0,this.image=new kn({width:e,height:i}),this.positions={},this.uploaded=!1}getDash(e,i){const n=this.getKey(e,i);return this.positions[n]}trim(){const e=this.width,i=this.height=wr(this.nextRow);this.image.resize({width:e,height:i})}getKey(e,i){return e.join(",")+i}getDashRanges(e,i,n){const s=[];let c=e.length%2==1?-e[e.length-1]*n:0,u=e[0]*n,p=!0;s.push({left:c,right:u,isDash:p,zeroLength:e[0]===0});let m=e[0];for(let _=1;_1&&(m=e[++p]);const x=Math.abs(_-m.left),b=Math.abs(_-m.right),w=Math.min(x,b);let S;const M=c/n*(s+1);if(m.isDash){const C=s-Math.abs(M);S=Math.sqrt(w*w+C*C)}else S=s-Math.sqrt(w*w+M*M);this.image.data[u+_]=Math.max(0,Math.min(255,S+128))}}}addRegularDash(e,i){for(let m=e.length-1;m>=0;--m){const _=e[m],x=e[m+1];_.zeroLength?e.splice(m,1):x&&x.isDash===_.isDash&&(x.left=_.left,e.splice(m,1))}const n=e[0],s=e[e.length-1];n.isDash===s.isDash&&(n.left=s.left-this.width,s.right=n.right+this.width);const c=this.width*this.nextRow;let u=0,p=e[u];for(let m=0;m1&&(p=e[++u]);const _=Math.abs(m-p.left),x=Math.abs(m-p.right),b=Math.min(_,x);this.image.data[c+m]=Math.max(0,Math.min(255,(p.isDash?b:-b)+i+128))}}addDash(e,i){const n=this.getKey(e,i);if(this.positions[n])return this.positions[n];const s=i==="round",c=s?7:0,u=2*c+1;if(this.nextRow+u>this.height)return Ut("LineAtlas out of space"),null;e.length===0&&e.push(1);let p=0;for(let x=0;x=ye.maxzoom||ye.visibility!=="none"&&(Ku(ue,this.zoom,n),(m[ye.id]=ye.createBucket({index:p.bucketLayerIDs.length,layers:ue,zoom:this.zoom,canonical:this.canonical,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:me,sourceID:this.source,enableTerrain:this.enableTerrain,projection:this.projection.spec,availableImages:n})).populate(Ee,x,this.tileID.canonical,this.tileTransform),p.bucketLayerIDs.push(ue.map(xe=>xe.id)))}}let w,S,M,C;_.trim();const D={type:"maybePrepare",isSymbolTile:this.isSymbolTile,zoom:this.zoom},U=()=>{if(w)return c(w);if(S&&M&&C){const X=new Sf(S),W=new Pp(M,C);for(const ce in m){const se=m[ce];se instanceof go?(Ku(se.layers,this.zoom,n),U_(se,S,X.positions,M,W.iconPositions,this.showCollisionBoxes,n,this.tileID.canonical,this.tileZoom,this.projection)):se.hasPattern&&(se instanceof lh||se instanceof rh||se instanceof Fl)&&(Ku(se.layers,this.zoom,n),se.addFeatures(x,this.tileID.canonical,W.patternPositions,n,this.tileTransform))}this.status="done",c(null,{buckets:$r(m).filter(ce=>!ce.isEmpty()),featureIndex:p,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:X.image,lineAtlas:_,imageAtlas:W,glyphMap:this.returnDependencies?S:null,iconMap:this.returnDependencies?M:null,glyphPositions:this.returnDependencies?X.positions:null})}},q=pt(x.glyphDependencies,X=>Object.keys(X).map(Number));Object.keys(q).length?s.send("getGlyphs",{uid:this.uid,stacks:q},(X,W)=>{w||(w=X,S=W,U())},void 0,!1,D):S={};const V=Object.keys(x.iconDependencies);V.length?s.send("getImages",{icons:V,source:this.source,tileID:this.tileID,type:"icons"},(X,W)=>{w||(w=X,M=W,U())},void 0,!1,D):M={};const $=Object.keys(x.patternDependencies);$.length?s.send("getImages",{icons:$,source:this.source,tileID:this.tileID,type:"patterns"},(X,W)=>{w||(w=X,C=W,U())},void 0,!1,D):C={},U()}}function Ku(t,e,i){const n=new v(e);for(const s of t)s.recalculate(n,i)}class Mf{constructor(e){this.entries={},this.scheduler=e}request(e,i,n,s){const c=this.entries[e]=this.entries[e]||{callbacks:[]};if(c.result){const[u,p]=c.result;return this.scheduler?this.scheduler.add(()=>{s(u,p)},i):s(u,p),()=>{}}return c.callbacks.push(s),c.cancel||(c.cancel=n((u,p)=>{c.result=[u,p];for(const m of c.callbacks)this.scheduler?this.scheduler.add(()=>{m(u,p)},i):m(u,p);setTimeout(()=>delete this.entries[e],3e3)})),()=>{c.result||(c.callbacks=c.callbacks.filter(u=>u!==s),c.callbacks.length||(c.cancel(),delete this.entries[e]))}}}function Af(t,e,i){const n=JSON.stringify(t.request);return t.data&&(this.deduped.entries[n]={result:[null,t.data]}),this.deduped.request(n,{type:"parseTile",isSymbolTile:t.isSymbolTile,zoom:t.tileZoom},s=>{const c=$n(t.request,(u,p,m,_)=>{u?s(u):p&&s(null,{vectorTile:i?void 0:new Cu(new uh(p)),rawData:p,cacheControl:m,expires:_})});return()=>{c.cancel(),s()}},e)}const If=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class Yu{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[i,n]=new Uint8Array(e,0,2);if(i!==219)throw new Error("Data does not appear to be in a KDBush format.");const s=n>>4;if(s!==1)throw new Error(`Got v${s} data when expected v1.`);const c=If[15&n];if(!c)throw new Error("Unrecognized array type.");const[u]=new Uint16Array(e,2,1),[p]=new Uint32Array(e,4,1);return new Yu(p,u,c,e)}constructor(e,i=64,n=Float64Array,s){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+i,2),65535),this.ArrayType=n,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const c=If.indexOf(this.ArrayType),u=2*e*this.ArrayType.BYTES_PER_ELEMENT,p=e*this.IndexArrayType.BYTES_PER_ELEMENT,m=(8-p%8)%8;if(c<0)throw new Error(`Unexpected typed array class: ${n}.`);s&&s instanceof ArrayBuffer?(this.data=s,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+p+m,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+u+p+m),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+p+m,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+c]),new Uint16Array(this.data,2,1)[0]=i,new Uint32Array(this.data,4,1)[0]=e)}add(e,i){const n=this._pos>>1;return this.ids[n]=n,this.coords[this._pos++]=e,this.coords[this._pos++]=i,n}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return Ju(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,i,n,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:c,coords:u,nodeSize:p}=this,m=[0,c.length-1,0],_=[];for(;m.length;){const x=m.pop()||0,b=m.pop()||0,w=m.pop()||0;if(b-w<=p){for(let D=w;D<=b;D++){const U=u[2*D],q=u[2*D+1];U>=e&&U<=n&&q>=i&&q<=s&&_.push(c[D])}continue}const S=w+b>>1,M=u[2*S],C=u[2*S+1];M>=e&&M<=n&&C>=i&&C<=s&&_.push(c[S]),(x===0?e<=M:i<=C)&&(m.push(w),m.push(S-1),m.push(1-x)),(x===0?n>=M:s>=C)&&(m.push(S+1),m.push(b),m.push(1-x))}return _}within(e,i,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:c,nodeSize:u}=this,p=[0,s.length-1,0],m=[],_=n*n;for(;p.length;){const x=p.pop()||0,b=p.pop()||0,w=p.pop()||0;if(b-w<=u){for(let D=w;D<=b;D++)zf(c[2*D],c[2*D+1],e,i)<=_&&m.push(s[D]);continue}const S=w+b>>1,M=c[2*S],C=c[2*S+1];zf(M,C,e,i)<=_&&m.push(s[S]),(x===0?e-n<=M:i-n<=C)&&(p.push(w),p.push(S-1),p.push(1-x)),(x===0?e+n>=M:i+n>=C)&&(p.push(S+1),p.push(b),p.push(1-x))}return m}}function Ju(t,e,i,n,s,c){if(s-n<=i)return;const u=n+s>>1;Cf(t,e,u,n,s,c),Ju(t,e,i,n,u-1,1-c),Ju(t,e,i,u+1,s,1-c)}function Cf(t,e,i,n,s,c){for(;s>n;){if(s-n>600){const _=s-n+1,x=i-n+1,b=Math.log(_),w=.5*Math.exp(2*b/3),S=.5*Math.sqrt(b*w*(_-w)/_)*(x-_/2<0?-1:1);Cf(t,e,i,Math.max(n,Math.floor(i-x*w/_+S)),Math.min(s,Math.floor(i+(_-x)*w/_+S)),c)}const u=e[2*i+c];let p=n,m=s;for(Yl(t,e,n,i),e[2*s+c]>u&&Yl(t,e,n,s);pu;)m--}e[2*n+c]===u?Yl(t,e,n,m):(m++,Yl(t,e,m,s)),m<=i&&(n=m+1),i<=m&&(s=m-1)}}function Yl(t,e,i,n){Qu(t,i,n),Qu(e,2*i,2*n),Qu(e,2*i+1,2*n+1)}function Qu(t,e,i){const n=t[e];t[e]=t[i],t[i]=n}function zf(t,e,i,n){const s=t-i,c=e-n;return s*s+c*c}a.ARRAY_TYPE=qi,a.AUTH_ERR_MSG=H,a.Aabb=zi,a.Actor=class{constructor(t,e,i){this.target=t,this.parent=e,this.mapId=i,this.callbacks={},this.cancelCallbacks={},dn(["receive"],this),this.target.addEventListener("message",this.receive,!1),this.globalScope=Tr()?t:Se,this.scheduler=new sg}send(t,e,i,n,s=!1,c){const u=Math.round(1e18*Math.random()).toString(36).substring(0,10);i&&(i.metadata=c,this.callbacks[u]=i);const p=Nn(this.globalScope)?void 0:[];return this.target.postMessage({id:u,type:t,hasCallback:!!i,targetMapId:n,mustQueue:s,sourceMapId:this.mapId,data:lo(e,p)},p),{cancel:()=>{i&&delete this.callbacks[u],this.target.postMessage({id:u,type:"",targetMapId:n,sourceMapId:this.mapId})}}}receive(t){const e=t.data,i=e.id;if(i&&(!e.targetMapId||this.mapId===e.targetMapId))if(e.type===""){const n=this.cancelCallbacks[i];delete this.cancelCallbacks[i],n&&n.cancel()}else if(e.mustQueue||Tr()){const n=this.callbacks[i];this.cancelCallbacks[i]=this.scheduler.add(()=>this.processTask(i,e),n&&n.metadata||{type:"message"})}else this.processTask(i,e)}processTask(t,e){if(e.type===""){const i=this.callbacks[t];delete this.callbacks[t],i&&(e.error?i(Sn(e.error)):i(null,Sn(e.data)))}else{const i=Nn(this.globalScope)?void 0:[],n=e.hasCallback?(c,u)=>{delete this.cancelCallbacks[t],this.target.postMessage({id:t,type:"",sourceMapId:this.mapId,error:c?lo(c):null,data:lo(u,i)},i)}:c=>{},s=Sn(e.data);if(this.parent[e.type])this.parent[e.type](e.sourceMapId,s,n);else if(this.parent.getWorkerSource){const c=e.type.split(".");this.parent.getWorkerSource(e.sourceMapId,c[0],s.source)[c[1]](s,n)}else n(new Error(`Could not find function ${e.type}`))}}remove(){this.scheduler.remove(),this.target.removeEventListener("message",this.receive,!1)}},a.CanonicalTileID=ah,a.Color=Zt,a.ColorMode=sn,a.CullFaceMode=jr,a.DEMData=Eh,a.DataConstantProperty=I,a.DedupedRequest=Mf,a.DepthMode=xa,a.EXTENT=Ze,a.Elevation=class{isDataAvailableAtPoint(t){const e=this._source();if(this.isUsingMockSource()||!e||t.y<0||t.y>1)return!1;const i=e.getSource().maxzoom,n=1<1)return e;const s=n.getSource().maxzoom,c=1<{const c=this.getAtTileOffset(t,s.x,s.y),u=n.upVector(t.canonical,s.x,s.y);return rr(u,u,c*n.upVectorScale(t.canonical,e,i).metersToTile),u}}getForTilePoints(t,e,i,n){if(this.isUsingMockSource())return!1;const s=Sh.create(this,t,n);return!!s&&(e.forEach(c=>{c[2]=this.exaggeration()*s.getElevationAt(c[0],c[1],i)}),!0)}getMinMaxForTile(t){if(this.isUsingMockSource())return null;const e=this.findDEMTileFor(t);if(!e||!e.dem)return null;const i=e.dem.tree,n=e.tileID,s=1<{let w=_===c-1?_-2:_===0?_:_-1;return w+=b?24575:0,[w,x]};for(let _=0;_this._skuTokenExpiresAt}transformRequest(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}}normalizeStyleURL(t,e){if(!ee(t))return t;const i=ke(t);return i.path=`/styles/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||e)}normalizeGlyphsURL(t,e){if(!ee(t))return t;const i=ke(t);return i.path=`/fonts/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||e)}normalizeSourceURL(t,e,i,n){if(!ee(t))return t;const s=ke(t);return s.path=`/v4/${s.authority}.json`,s.params.push("secure"),i&&s.params.push(`language=${i}`),n&&s.params.push(`worldview=${n}`),this._makeAPIURL(s,this._customAccessToken||e)}normalizeSpriteURL(t,e,i,n){const s=ke(t);return ee(t)?(s.path=`/styles/v1${s.path}/sprite${e}${i}`,this._makeAPIURL(s,this._customAccessToken||n)):(s.path+=`${e}${i}`,Ie(s))}normalizeTileURL(t,e,i){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!ee(t))return t;const n=ke(t);n.path=n.path.replace(/(\.(png|jpg)\d*)(?=$)/,`${e||i&&n.authority!=="raster"&&i===512?"@2x":""}${ht.supported?".webp":"$1"}`),n.authority==="raster"?n.path=`/${it.RASTER_URL_PREFIX}${n.path}`:(n.path=n.path.replace(/^.+\/v4\//,"/"),n.path=`/${it.TILE_URL_VERSION}${n.path}`);const s=this._customAccessToken||function(c){for(const u of c){const p=u.match(/^access_token=(.*)$/);if(p)return p[1]}return null}(n.params)||it.ACCESS_TOKEN;return it.REQUIRE_ACCESS_TOKEN&&s&&this._skuToken&&n.params.push(`sku=${this._skuToken}`),this._makeAPIURL(n,s)}canonicalizeTileURL(t,e){const i=ke(t);if(!i.path.match(/^(\/v4\/|\/raster\/v1\/)/)||!i.path.match(/\.[\w]+$/))return t;let n="mapbox://";i.path.match(/^\/raster\/v1\//)?n+=`raster/${i.path.replace(`/${it.RASTER_URL_PREFIX}/`,"")}`:n+=`tiles/${i.path.replace(`/${it.TILE_URL_VERSION}/`,"")}`;let s=i.params;return e&&(s=s.filter(c=>!c.match(/^access_token=/))),s.length&&(n+=`?${s.join("&")}`),n}canonicalizeTileset(t,e){const i=!!e&&ee(e),n=[];for(const s of t.tiles||[])ne(s)?n.push(this.canonicalizeTileURL(s,i)):n.push(s);return n}_makeAPIURL(t,e){const i="See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes",n=ke(it.API_URL);if(t.protocol=n.protocol,t.authority=n.authority,t.protocol==="http"){const s=t.params.indexOf("secure");s>=0&&t.params.splice(s,1)}if(n.path!=="/"&&(t.path=`${n.path}${t.path}`),!it.REQUIRE_ACCESS_TOKEN)return Ie(t);if(e=e||it.ACCESS_TOKEN,!this._silenceAuthErrors){if(!e)throw new Error(`An API access token is required to use Mapbox GL. ${i}`);if(e[0]==="s")throw new Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${i}`)}return t.params=t.params.filter(s=>s.indexOf("access_token")===-1),t.params.push(`access_token=${e||""}`),Ie(t)}},a.ResourceType=fn,a.SegmentVector=Yt,a.SourceCache=fs,a.StencilMode=Wu,a.StructArrayLayout1ui2=Zi,a.StructArrayLayout2f1f2i16=qe,a.StructArrayLayout2i4=Te,a.StructArrayLayout2ui4=ui,a.StructArrayLayout3f12=ot,a.StructArrayLayout3ui6=je,a.StructArrayLayout4i8=ge,a.StructArrayLayout5f20=St,a.Texture=Hl,a.Tile=Zu,a.Transitionable=A,a.Uniform1f=$c,a.Uniform1i=class extends In{constructor(t){super(t),this.current=0}set(t,e,i){this.fetchUniformLocation(t,e)&&this.current!==i&&(this.current=i,this.gl.uniform1i(this.location,i))}},a.Uniform2f=class extends In{constructor(t){super(t),this.current=[0,0]}set(t,e,i){this.fetchUniformLocation(t,e)&&(i[0]===this.current[0]&&i[1]===this.current[1]||(this.current=i,this.gl.uniform2f(this.location,i[0],i[1])))}},a.Uniform3f=class extends In{constructor(t){super(t),this.current=[0,0,0]}set(t,e,i){this.fetchUniformLocation(t,e)&&(i[0]===this.current[0]&&i[1]===this.current[1]&&i[2]===this.current[2]||(this.current=i,this.gl.uniform3f(this.location,i[0],i[1],i[2])))}},a.Uniform4f=cd,a.UniformColor=hd,a.UniformMatrix2f=class extends In{constructor(t){super(t),this.current=$f}set(t,e,i){if(this.fetchUniformLocation(t,e)){for(let n=0;n<4;n++)if(i[n]!==this.current[n]){this.current=i,this.gl.uniformMatrix2fv(this.location,!1,i);break}}}},a.UniformMatrix3f=class extends In{constructor(t){super(t),this.current=Gf}set(t,e,i){if(this.fetchUniformLocation(t,e)){for(let n=0;n<9;n++)if(i[n]!==this.current[n]){this.current=i,this.gl.uniformMatrix3fv(this.location,!1,i);break}}}},a.UniformMatrix4f=class extends In{constructor(t){super(t),this.current=jf}set(t,e,i){if(this.fetchUniformLocation(t,e)){if(i[12]!==this.current[12]||i[0]!==this.current[0])return this.current=i,void this.gl.uniformMatrix4fv(this.location,!1,i);for(let n=1;n<16;n++)if(i[n]!==this.current[n]){this.current=i,this.gl.uniformMatrix4fv(this.location,!1,i);break}}}},a.UnwrappedTileID=_p,a.ValidationError=Fe,a.VectorTileFeature=oh,a.VectorTileWorkerSource=class extends Po{constructor(t,e,i,n,s){super(),this.actor=t,this.layerIndex=e,this.availableImages=i,this.loadVectorData=s||Af,this.loading={},this.loaded={},this.deduped=new Mf(t.scheduler),this.isSpriteLoaded=n,this.scheduler=t.scheduler}loadTile(t,e){const i=t.uid,n=t&&t.request,s=n&&n.collectResourceTiming,c=this.loading[i]=new pg(t);c.abort=this.loadVectorData(t,(u,p)=>{const m=!this.loading[i];if(delete this.loading[i],m||u||!p)return c.status="done",m||(this.loaded[i]=c),e(u);const _=p.rawData,x={};p.expires&&(x.expires=p.expires),p.cacheControl&&(x.cacheControl=p.cacheControl),c.vectorTile=p.vectorTile||new Cu(new uh(_));const b=()=>{c.parse(c.vectorTile,this.layerIndex,this.availableImages,this.actor,(w,S)=>{if(w||!S)return e(w);const M={};if(s){const C=Ea(n);C.length>0&&(M.resourceTiming=JSON.parse(JSON.stringify(C)))}e(null,Wt({rawTileData:_.slice(0)},S,x,M))})};this.isSpriteLoaded?b():this.once("isSpriteLoaded",()=>{this.scheduler?this.scheduler.add(b,{type:"parseTile",isSymbolTile:t.isSymbolTile,zoom:t.tileZoom}):b()}),this.loaded=this.loaded||{},this.loaded[i]=c})}reloadTile(t,e){const i=this.loaded,n=t.uid,s=this;if(i&&i[n]){const c=i[n];c.showCollisionBoxes=t.showCollisionBoxes,c.enableTerrain=!!t.enableTerrain,c.projection=t.projection,c.tileTransform=ps(t.tileID.canonical,t.projection);const u=(p,m)=>{const _=c.reloadCallback;_&&(delete c.reloadCallback,c.parse(c.vectorTile,s.layerIndex,this.availableImages,s.actor,_)),e(p,m)};c.status==="parsing"?c.reloadCallback=u:c.status==="done"&&(c.vectorTile?c.parse(c.vectorTile,this.layerIndex,this.availableImages,this.actor,u):u())}}abortTile(t,e){const i=t.uid,n=this.loading[i];n&&(n.abort&&n.abort(),delete this.loading[i]),e()}removeTile(t,e){const i=this.loaded,n=t.uid;i&&i[n]&&delete i[n],e()}},a.WritingMode=or,a.ZoomDependentExpression=Ho,a.add=zn,a.addDynamicAttributes=bh,a.adjoint=function(t,e){var i=e[0],n=e[1],s=e[2],c=e[3],u=e[4],p=e[5],m=e[6],_=e[7],x=e[8];return t[0]=u*x-p*_,t[1]=s*_-n*x,t[2]=n*p-s*u,t[3]=p*m-c*x,t[4]=i*x-s*m,t[5]=s*c-i*p,t[6]=c*_-u*m,t[7]=n*m-i*_,t[8]=i*u-n*c,t},a.asyncAll=ai,a.bezier=Eo,a.bindAll=dn,a.boundsAttributes=cf,a.bufferConvexPolygon=function(t,e){const i=[];for(let n=0;nws&&(t.getActor().send("enforceCacheSizeLimit",bs),Co=0)},a.calculateGlobeLabelMatrix=function(t,e){const{x:i,y:n}=t.point,s=Dd(i,n,t.worldSize/t._pixelsPerMercatorPixel,0,0);return os(s,s,hu(en(e)))},a.calculateGlobeMatrix=function(t){const{x:e,y:i}=t.point,{lng:n,lat:s}=t._center;return Dd(e,i,t.worldSize,n,s)},a.calculateGlobeMercatorMatrix=function(t){const e=t.pixelsPerMeter,i=e/Ur(1,t.center.lat),n=Or(new Float64Array(16));return bl(n,n,[t.point.x,t.point.y,0]),ss(n,n,[i,i,e]),Float32Array.from(n)},a.circumferenceAtLatitude=du,a.clamp=ct,a.clearTileCache=function(t){if(!Io())return;const e=Se.caches.delete(jn);t&&e.catch(t).then(()=>t())},a.clipLine=$p,a.clone=function(t){var e=new qi(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},a.clone$1=Li,a.collisionCircleLayout=u_,a.config=it,a.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},a.create=function(){var t=new qi(16);return qi!=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},a.create$1=pd,a.createExpression=oo,a.createLayout=te,a.createStyleLayer=function(t){return t.type==="custom"?new ig(t):new ng[t.type](t)},a.cross=ru,a.degToRad=dt,a.distance=function(t,e){return Math.hypot(e[0]-t[0],e[1]-t[1],e[2]-t[2])},a.div=function(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t[2]=e[2]/i[2],t},a.dot=pr,a.earthRadius=Pl,a.ease=ys,a.easeCubicInOut=gs,a.ecefToLatLng=function([t,e,i]){const n=Math.hypot(t,e,i),s=Math.atan2(t,i),c=.5*Math.PI-Math.acos(-e/n);return new At(si(s),si(c))},a.emitValidationErrors=Fc,a.endsWith=Un,a.enforceCacheSizeLimit=function(t){pn(),Vi&&Vi.then(e=>{e.keys().then(i=>{for(let n=0;nc&&(n+=(t[s]-c)*(t[s]-c)),e[s]0){const M=180/n;fd(S,S,[M/_+1,0,0,0,M/x+1,0,-.5*M/b,.5*M/w,1])}return S[2]=m,S[5]=t.x,S[8]=t.y,S},a.getImage=G,a.getJSON=function(t,e){return _n(Wt(t,{type:"json"}),e)},a.getLatitudinalLod=function(t){const e=wi-5;t=ct(t,-e,e)/e*90;const i=Math.pow(Math.abs(Math.sin(dt(t))),3);return Math.round(i*(Il.length-1))},a.getMapSessionAPI=li,a.getPerformanceMeasurement=Ea,a.getProjection=nf,a.getRTLTextPluginStatus=f,a.getReferrer=mn,a.getTilePoint=function(t,{x:e,y:i},n=0){return new Le(((e-n)*t.scale-t.x)*Ze,(i*t.scale-t.y)*Ze)},a.getTileVec3=function(t,e,i=0){return ta(((e.x-i)*t.scale-t.x)*Ze,(e.y*t.scale-t.y)*Ze,Od(e.z,e.y))},a.getVideo=function(t,e){const i=Se.document.createElement("video");i.muted=!0,i.onloadstart=function(){e(null,i)};for(let n=0;n{}}},a.globeCenterToScreenPoint=function(t){const e=[0,0,0],i=Or(new Float64Array(16));return os(i,t.pixelMatrix,t.globeMatrix),qt(e,e,i),new Le(e[0],e[1])},a.globeDenormalizeECEF=hu,a.globeECEFOrigin=function(t,e){const i=[0,0,0];return qt(i,i,zl(en(e.canonical))),qt(i,i,t),i},a.globeMetersToEcef=Wc,a.globeNormalizeECEF=zl,a.globePixelsToTileUnits=function(t,e){return Ze/(512*Math.pow(2,t))*Hc(en(e))},a.globePoleMatrixForTile=function(t,e,i){const n=Or(new Float64Array(16)),s=(e/(1<0;return n===0&&!s&&!u&&c},a.identity=Or,a.identity$1=Td,a.invert=Qh,a.isFullscreen=function(){return!!Se.document.fullscreenElement||!!Se.document.webkitFullscreenElement},a.isLngLatBehindGlobe=uu,a.isMapAuthenticated=function(t){return Ti.has(t)},a.isMapboxURL=ee,a.isSafariWithAntialiasingBug=function(t){const e=t.navigator?t.navigator.userAgent:null;return!!Nn(t)&&e&&(e.match("Version/15.4")||e.match("Version/15.5")||e.match(/CPU (OS|iPhone OS) (15_4|15_5) like Mac OS X/))},a.latFromMercatorY=bi,a.latLngToECEF=ra,a.len=Qf,a.length=wl,a.length$1=function(t){return Math.hypot(t[0],t[1],t[2],t[3])},a.lngFromMercatorX=nr,a.loadVectorTile=Af,a.makeRequest=_n,a.mapValue=function(t,e,i,n,s){return ct((t-e)/(i-e)*(s-n)+n,n,s)},a.mercatorScale=Fd,a.mercatorXfromLng=tn,a.mercatorYfromLat=rn,a.mercatorZfromAltitude=Ur,a.mul=Yf,a.mul$1=Jf,a.multiply=os,a.multiply$1=fd,a.multiply$2=yd,a.nextPowerOfTwo=wr,a.normalize=Ci,a.normalize$1=em,a.normalize$2=bd,a.number=mt,a.ortho=function(t,e,i,n,s,c,u){var p=1/(e-i),m=1/(n-s),_=1/(c-u);return t[0]=-2*p,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*m,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*_,t[11]=0,t[12]=(e+i)*p,t[13]=(s+n)*m,t[14]=(u+c)*_,t[15]=1,t},a.pbf=Tp,a.perspective=function(t,e,i,n,s){var c,u=1/Math.tan(e/2);return t[0]=u/i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,s!=null&&s!==1/0?(t[10]=(s+n)*(c=1/(n-s)),t[14]=2*s*n*c):(t[10]=-1,t[14]=-2*n),t},a.pick=function(t,e){const i={};for(let n=0;n0&&i[0]<=t.width&&i[1]>0&&i[1]<=t.height&&!uu(t,new At(t.center.lat,90)),n[0]>0&&n[0]<=t.width&&n[1]>0&&n[1]<=t.height&&!uu(t,new At(t.center.lat,-90))]},a.polygonContainsPoint=us,a.polygonIntersectsBox=Zd,a.polygonIntersectsPolygon=Nd,a.polygonizeBounds=function(t,e,i=0,n=!0){const s=new Le(i,i),c=t.sub(s),u=e.add(s),p=[c,new Le(u.x,c.y),u,new Le(c.x,u.y)];return n&&p.push(c.clone()),p},a.posAttributes=Al,a.postMapLoadEvent=Xt,a.postPerformanceEvent=ri,a.postTurnstileEvent=ft,a.potpack=Du,a.prevPowerOfTwo=function(t){return t<=1?1:Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},a.radToDeg=si,a.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],a.registerForPluginStateChange=function(t){return t({pluginStatus:l,pluginURL:r}),d.on("pluginStateChange",t),t},a.removeAuthState=function(t){Ti.delete(t)},a.renderColorRamp=vu,a.resample=Ud,a.rotateX=eu,a.rotateX$1=Ed,a.rotateY=qc,a.rotateY$1=Sd,a.rotateZ=function(t,e,i){var n=Math.sin(i),s=Math.cos(i),c=e[0],u=e[1],p=e[2],m=e[3],_=e[4],x=e[5],b=e[6],w=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]=c*s+_*n,t[1]=u*s+x*n,t[2]=p*s+b*n,t[3]=m*s+w*n,t[4]=_*s-c*n,t[5]=x*s-u*n,t[6]=b*s-p*n,t[7]=w*s-m*n,t},a.rotateZ$1=function(t,e,i){i*=.5;var n=e[0],s=e[1],c=e[2],u=e[3],p=Math.sin(i),m=Math.cos(i);return t[0]=n*m+s*p,t[1]=s*m-n*p,t[2]=c*m+u*p,t[3]=u*m-c*p,t},a.scale=ss,a.scale$1=vd,a.scale$2=rr,a.scaleAndAdd=Sl,a.set=function(t,e,i,n){return t[0]=e,t[1]=i,t[2]=n,t},a.setCacheLimits=function(t,e){bs=t,ws=e},a.setColumn=function(t,e,i){t[4*e+0]=i[0],t[4*e+1]=i[1],t[4*e+2]=i[2],t[4*e+3]=i[3]},a.setRTLTextPlugin=function(t,e,i=!1){if(l===_l||l===gl||l===yl)throw new Error("setRTLTextPlugin cannot be called multiple times.");r=Er.resolveURL(t),l=_l,co=e,h(),i||g()},a.smoothstep=On,a.spec=fe,a.squaredLength=function(t){var e=t[0],i=t[1],n=t[2];return e*e+i*i+n*n},a.storeAuthState=function(t,e){e?Ti.add(t):Ti.delete(t)},a.sub=Fr,a.subtract=iu,a.symbolSize=d_,a.tileAABB=function(t,e,i,n,s,c,u,p,m){if(m.name==="globe")return om(t,e,new ah(i,n,s));const _=ps({z:i,x:n,y:s},m);return new zi([(c+_.x/_.scale)*e,e*(_.y/_.scale),u],[(c+_.x2/_.scale)*e,e*(_.y2/_.scale),p])},a.tileCornersToBounds=Xc,a.tileTransform=ps,a.transformMat3=function(t,e,i){var n=e[0],s=e[1],c=e[2];return t[0]=n*i[0]+s*i[3]+c*i[6],t[1]=n*i[1]+s*i[4]+c*i[7],t[2]=n*i[2]+s*i[5]+c*i[8],t},a.transformMat4=qt,a.transformMat4$1=as,a.transformQuat=xd,a.transitionTileAABBinECEF=zd,a.translate=bl,a.transpose=function(t,e){if(t===e){var i=e[1],n=e[2],s=e[5];t[1]=e[3],t[2]=e[6],t[3]=i,t[5]=e[7],t[6]=n,t[7]=s}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},a.triggerPluginCompletionEvent=o,a.uniqueId=Fn,a.updateGlobeVertexNormal=function(t,e,i,n,s){const c=5*e+2;t.float32[c+0]=i,t.float32[c+1]=n,t.float32[c+2]=s},a.validateCustomStyleLayer=function(t){const e=[],i=t.id;return i===void 0&&e.push({message:`layers.${i}: missing required property "id"`}),t.render===void 0&&e.push({message:`layers.${i}: missing required method "render"`}),t.renderingMode&&t.renderingMode!=="2d"&&t.renderingMode!=="3d"&&e.push({message:`layers.${i}: property "renderingMode" must be either "2d" or "3d"`}),e},a.validateFilter=t=>$i(es(t)),a.validateFog=t=>$i(Rc(t)),a.validateLayer=t=>$i(Pc(t)),a.validateLight=t=>$i(Lc(t)),a.validateSource=t=>$i(Dc(t)),a.validateStyle=Oc,a.validateTerrain=t=>$i(ul(t)),a.values=$r,a.vectorTile=nh,a.version=xr,a.warnOnce=Ut,a.window=Se,a.wrap=oi}),wo(["./shared"],function(a){function Se(Z){if(typeof Z=="number"||typeof Z=="boolean"||typeof Z=="string"||Z==null)return JSON.stringify(Z);if(Array.isArray(Z)){let P="[";for(const G of Z)P+=`${Se(G)},`;return`${P}]`}let z="{";for(const P of Object.keys(Z).sort())z+=`${P}:${Se(Z[P])},`;return`${z}}`}function xr(Z){let z="";for(const P of a.refProperties)z+=`/${Se(Z[P])}`;return z}class Ki{constructor(z){this.keyCache={},z&&this.replace(z)}replace(z){this._layerConfigs={},this._layers={},this.update(z,[])}update(z,P){for(const H of z)this._layerConfigs[H.id]=H,(this._layers[H.id]=a.createStyleLayer(H)).compileFilter(),this.keyCache[H.id]&&delete this.keyCache[H.id];for(const H of P)delete this.keyCache[H],delete this._layerConfigs[H],delete this._layers[H];this.familiesBySource={};const G=function(H,ee){const ne={};for(let Q=0;Qthis._layers[ke.id]),ne=ee[0];if(ne.visibility==="none")continue;const re=ne.source||"";let Q=this.familiesBySource[re];Q||(Q=this.familiesBySource[re]={});const de=ne.sourceLayer||"_geojsonTileLayer";let Pe=Q[de];Pe||(Pe=Q[de]=[]),Pe.push(ee)}}}class it{loadTile(z,P){const{uid:G,encoding:H,rawImageData:ee,padding:ne,buildQuadTree:re}=z,Q=a.window.ImageBitmap&&ee instanceof a.window.ImageBitmap?this.getImageData(ee,ne):ee;P(null,new a.DEMData(G,Q,H,ne<1,re))}getImageData(z,P){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(z.width,z.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=z.width,this.offscreenCanvas.height=z.height,this.offscreenCanvasContext.drawImage(z,0,0,z.width,z.height);const G=this.offscreenCanvasContext.getImageData(-P,-P,z.width+2*P,z.height+2*P);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),G}}function ht(Z,z){if(Z.length!==0){gi(Z[0],z);for(var P=1;P=Math.abs(re)?P-Q+re:re-Q+P,P=Q}P+G>=0!=!!z&&Z.reverse()}var Si=a.getDefaultExportFromCjs(function Z(z,P){var G,H=z&&z.type;if(H==="FeatureCollection")for(G=0;G>31}function Ta(Z,z){for(var P=Z.loadGeometry(),G=Z.type,H=0,ee=0,ne=P.length,re=0;reZ},ct=Math.fround||(On=new Float32Array(1),Z=>(On[0]=+Z,On[0]));var On;const oi=3,ai=5,$r=6;class Wt{constructor(z){this.options=Object.assign(Object.create(ys),z),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(z){const{log:P,minZoom:G,maxZoom:H}=this.options;P&&console.time("total time");const ee=`prepare ${z.length} points`;P&&console.time(ee),this.points=z;const ne=[];for(let Q=0;Q=G;Q--){const de=+Date.now();re=this.trees[Q]=this._createTree(this._cluster(re,Q)),P&&console.log("z%d: %d clusters in %dms",Q,re.numItems,+Date.now()-de)}return P&&console.timeEnd("total time"),this}getClusters(z,P){let G=((z[0]+180)%360+360)%360-180;const H=Math.max(-90,Math.min(90,z[1]));let ee=z[2]===180?180:((z[2]+180)%360+360)%360-180;const ne=Math.max(-90,Math.min(90,z[3]));if(z[2]-z[0]>=360)G=-180,ee=180;else if(G>ee){const ke=this.getClusters([G,H,180,ne],P),Ie=this.getClusters([-180,H,ee,ne],P);return ke.concat(Ie)}const re=this.trees[this._limitZoom(P)],Q=re.range(qr(G),wr(ne),qr(ee),wr(H)),de=re.data,Pe=[];for(const ke of Q){const Ie=this.stride*ke;Pe.push(de[Ie+ai]>1?Zr(de,Ie,this.clusterProps):this.points[de[Ie+oi]])}return Pe}getChildren(z){const P=this._getOriginId(z),G=this._getOriginZoom(z),H="No cluster with the specified id.",ee=this.trees[G];if(!ee)throw new Error(H);const ne=ee.data;if(P*this.stride>=ne.length)throw new Error(H);const re=this.options.radius/(this.options.extent*Math.pow(2,G-1)),Q=ee.within(ne[P*this.stride],ne[P*this.stride+1],re),de=[];for(const Pe of Q){const ke=Pe*this.stride;ne[ke+4]===z&&de.push(ne[ke+ai]>1?Zr(ne,ke,this.clusterProps):this.points[ne[ke+oi]])}if(de.length===0)throw new Error(H);return de}getLeaves(z,P,G){const H=[];return this._appendLeaves(H,z,P=P||10,G=G||0,0),H}getTile(z,P,G){const H=this.trees[this._limitZoom(z)],ee=Math.pow(2,z),{extent:ne,radius:re}=this.options,Q=re/ne,de=(G-Q)/ee,Pe=(G+1+Q)/ee,ke={features:[]};return this._addTileFeatures(H.range((P-Q)/ee,de,(P+1+Q)/ee,Pe),H.data,P,G,ee,ke),P===0&&this._addTileFeatures(H.range(1-Q/ee,de,1,Pe),H.data,ee,G,ee,ke),P===ee-1&&this._addTileFeatures(H.range(0,de,Q/ee,Pe),H.data,-1,G,ee,ke),ke.features.length?ke:null}getClusterExpansionZoom(z){let P=this._getOriginZoom(z)-1;for(;P<=this.options.maxZoom;){const G=this.getChildren(z);if(P++,G.length!==1)break;z=G[0].properties.cluster_id}return P}_appendLeaves(z,P,G,H,ee){const ne=this.getChildren(P);for(const re of ne){const Q=re.properties;if(Q&&Q.cluster?ee+Q.point_count<=H?ee+=Q.point_count:ee=this._appendLeaves(z,Q.cluster_id,G,H,ee):ee1;let Pe,ke,Ie;if(de)Pe=Fn(P,Q,this.clusterProps),ke=P[Q],Ie=P[Q+1];else{const Qe=this.points[P[Q+oi]];Pe=Qe.properties;const[nt,ft]=Qe.geometry.coordinates;ke=qr(nt),Ie=wr(ft)}const Je={type:1,geometry:[[Math.round(this.options.extent*(ke*ee-G)),Math.round(this.options.extent*(Ie*ee-H))]],tags:Pe};let rt;rt=de||this.options.generateId?P[Q+oi]:this.points[P[Q+oi]].id,rt!==void 0&&(Je.id=rt),ne.features.push(Je)}}_limitZoom(z){return Math.max(this.options.minZoom,Math.min(Math.floor(+z),this.options.maxZoom+1))}_cluster(z,P){const{radius:G,extent:H,reduce:ee,minPoints:ne}=this.options,re=G/(H*Math.pow(2,P)),Q=z.data,de=[],Pe=this.stride;for(let ke=0;keP&&(nt+=Q[Vt+ai])}if(nt>Qe&&nt>=ne){let ft,Vt=Ie*Qe,Xt=Je*Qe,yi=-1;const ri=((ke/Pe|0)<<5)+(P+1)+this.points.length;for(const sr of rt){const li=sr*Pe;if(Q[li+2]<=P)continue;Q[li+2]=P;const Ti=Q[li+ai];Vt+=Q[li]*Ti,Xt+=Q[li+1]*Ti,Q[li+4]=ri,ee&&(ft||(ft=this._map(Q,ke,!0),yi=this.clusterProps.length,this.clusterProps.push(ft)),ee(ft,this._map(Q,li)))}Q[ke+4]=ri,de.push(Vt/nt,Xt/nt,1/0,ri,-1,nt),ee&&de.push(yi)}else{for(let ft=0;ft1)for(const ft of rt){const Vt=ft*Pe;if(!(Q[Vt+2]<=P)){Q[Vt+2]=P;for(let Xt=0;Xt>5}_getOriginZoom(z){return(z-this.points.length)%32}_map(z,P,G){if(z[P+ai]>1){const ne=this.clusterProps[z[P+$r]];return G?Object.assign({},ne):ne}const H=this.points[z[P+oi]].properties,ee=this.options.map(H);return G&&ee===H?Object.assign({},ee):ee}}function Zr(Z,z,P){return{type:"Feature",id:Z[z+oi],properties:Fn(Z,z,P),geometry:{type:"Point",coordinates:[(G=Z[z],360*(G-.5)),xs(Z[z+1])]}};var G}function Fn(Z,z,P){const G=Z[z+ai],H=G>=1e4?`${Math.round(G/1e3)}k`:G>=1e3?Math.round(G/100)/10+"k":G,ee=Z[z+$r],ne=ee===-1?{}:Object.assign({},P[ee]);return Object.assign(ne,{cluster:!0,cluster_id:Z[z+oi],point_count:G,point_count_abbreviated:H})}function qr(Z){return Z/360+.5}function wr(Z){const z=Math.sin(Z*Math.PI/180),P=.5-.25*Math.log((1+z)/(1-z))/Math.PI;return P<0?0:P>1?1:P}function xs(Z){const z=(180-360*Z)*Math.PI/180;return 360*Math.atan(Math.exp(z))/Math.PI-90}function dn(Z,z,P,G){for(var H,ee=G,ne=P-z>>1,re=P-z,Q=Z[z],de=Z[z+1],Pe=Z[P],ke=Z[P+1],Ie=z+3;Ieee)H=Ie,ee=Je;else if(Je===ee){var rt=Math.abs(Ie-ne);rtG&&(H-z>3&&dn(Z,z,H,G),Z[H+2]=ee,P-H>3&&dn(Z,H,P,G))}function Un(Z,z,P,G,H,ee){var ne=H-P,re=ee-G;if(ne!==0||re!==0){var Q=((Z-P)*ne+(z-G)*re)/(ne*ne+re*re);Q>1?(P=H,G=ee):Q>0&&(P+=ne*Q,G+=re*Q)}return(ne=Z-P)*ne+(re=z-G)*re}function pt(Z,z,P,G){var H={id:Z===void 0?null:Z,type:z,geometry:P,tags:G,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(ee){var ne=ee.geometry,re=ee.type;if(re==="Point"||re==="MultiPoint"||re==="LineString")Vn(ee,ne);else if(re==="Polygon"||re==="MultiLineString")for(var Q=0;Q0&&(ne+=G?(H*de-Q*ee)/2:Math.sqrt(Math.pow(Q-H,2)+Math.pow(de-ee,2))),H=Q,ee=de}var Pe=z.length-3;z[2]=1,dn(z,0,Pe,P),z[Pe+2]=1,z.size=Math.abs(ne),z.start=0,z.end=z.size}function Ui(Z,z,P,G){for(var H=0;H1?1:P}function Ri(Z,z,P,G,H,ee,ne,re){if(G/=z,ee>=(P/=z)&&ne=G)return null;for(var Q=[],de=0;de=P&&rt=G)){var Qe=[];if(Ie==="Point"||Ie==="MultiPoint")Mo(ke,Qe,P,G,H);else if(Ie==="LineString")Nn(ke,Qe,P,G,H,!1,re.lineMetrics);else if(Ie==="MultiLineString")Wr(ke,Qe,P,G,H,!1);else if(Ie==="Polygon")Wr(ke,Qe,P,G,H,!0);else if(Ie==="MultiPolygon")for(var nt=0;nt=P&&ne<=G&&(z.push(Z[ee]),z.push(Z[ee+1]),z.push(Z[ee+2]))}}function Nn(Z,z,P,G,H,ee,ne){for(var re,Q,de=Ao(Z),Pe=H===0?bs:ws,ke=Z.start,Ie=0;IeP&&(Q=Pe(de,Je,rt,nt,ft,P),ne&&(de.start=ke+re*Q)):Vt>G?Xt=P&&(Q=Pe(de,Je,rt,nt,ft,P),yi=!0),Xt>G&&Vt<=G&&(Q=Pe(de,Je,rt,nt,ft,G),yi=!0),!ee&&yi&&(ne&&(de.end=ke+re*Q),z.push(de),de=Ao(Z)),ne&&(ke+=re)}var ri=Z.length-3;Je=Z[ri],rt=Z[ri+1],Qe=Z[ri+2],(Vt=H===0?Je:rt)>=P&&Vt<=G&&jn(de,Je,rt,Qe),ri=de.length-3,ee&&ri>=3&&(de[ri]!==de[0]||de[ri+1]!==de[1])&&jn(de,de[0],de[1],de[2]),de.length&&z.push(de)}function Ao(Z){var z=[];return z.size=Z.size,z.start=Z.start,z.end=Z.end,z}function Wr(Z,z,P,G,H,ee){for(var ne=0;nene.maxX&&(ne.maxX=Pe),ke>ne.maxY&&(ne.maxY=ke)}return ne}function Co(Z,z,P,G){var H=z.geometry,ee=z.type,ne=[];if(ee==="Point"||ee==="MultiPoint")for(var re=0;re0&&z.size<(H?ne:G))P.numPoints+=z.length/3;else{for(var re=[],Q=0;Qne)&&(P.numSimplified++,re.push(z[Q]),re.push(z[Q+1])),P.numPoints++;H&&function(de,Pe){for(var ke=0,Ie=0,Je=de.length,rt=Je-2;Ie0===Pe)for(Ie=0,Je=de.length;Ie24)throw new Error("maxZoom should be in the 0-24 range");if(z.promoteId&&z.generateId)throw new Error("promoteId and generateId cannot be used together.");var G=function(H,ee){var ne=[];if(H.type==="FeatureCollection")for(var re=0;re1&&console.time("creation"),Ie=this.tiles[ke]=Gn(Z,z,P,G,Q),this.tileCoords.push({z,x:P,y:G}),de)){de>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",z,P,G,Ie.numFeatures,Ie.numPoints,Ie.numSimplified),console.timeEnd("creation"));var Je="z"+z;this.stats[Je]=(this.stats[Je]||0)+1,this.total++}if(Ie.source=Z,H){if(z===Q.maxZoom||z===H)continue;var rt=1<1&&console.time("clipping");var Qe,nt,ft,Vt,Xt,yi,ri=.5*Q.buffer/Q.extent,sr=.5-ri,li=.5+ri,Ti=1+ri;Qe=nt=ft=Vt=null,Xt=Ri(Z,Pe,P-ri,P+li,0,Ie.minX,Ie.maxX,Q),yi=Ri(Z,Pe,P+sr,P+Ti,0,Ie.minX,Ie.maxX,Q),Z=null,Xt&&(Qe=Ri(Xt,Pe,G-ri,G+li,1,Ie.minY,Ie.maxY,Q),nt=Ri(Xt,Pe,G+sr,G+Ti,1,Ie.minY,Ie.maxY,Q),Xt=null),yi&&(ft=Ri(yi,Pe,G-ri,G+li,1,Ie.minY,Ie.maxY,Q),Vt=Ri(yi,Pe,G+sr,G+Ti,1,Ie.minY,Ie.maxY,Q),yi=null),de>1&&console.timeEnd("clipping"),re.push(Qe||[],z+1,2*P,2*G),re.push(nt||[],z+1,2*P,2*G+1),re.push(ft||[],z+1,2*P+1,2*G),re.push(Vt||[],z+1,2*P+1,2*G+1)}}},Hr.prototype.getTile=function(Z,z,P){var G=this.options,H=G.extent,ee=G.debug;if(Z<0||Z>24)return null;var ne=1<1&&console.log("drilling down to z%d-%d-%d",Z,z,P);for(var Q,de=Z,Pe=z,ke=P;!Q&&de>0;)de--,Pe=Math.floor(Pe/2),ke=Math.floor(ke/2),Q=this.tiles[mn(de,Pe,ke)];return Q&&Q.source?(ee>1&&console.log("found parent tile z%d-%d-%d",de,Pe,ke),ee>1&&console.time("drilling down"),this.splitTile(Q.source,de,Pe,ke,Z,z,P),ee>1&&console.timeEnd("drilling down"),this.tiles[re]?Io(this.tiles[re],H):null):null};class $n extends a.VectorTileWorkerSource{constructor(z,P,G,H,ee){super(z,P,G,H,_n),ee&&(this.loadGeoJSON=ee)}loadData(z,P){const G=z&&z.request,H=G&&G.collectResourceTiming;this.loadGeoJSON(z,(ee,ne)=>{if(ee||!ne)return P(ee);if(typeof ne!="object")return P(new Error(`Input data given to '${z.source}' is not a valid GeoJSON object.`));{Si(ne,!0);try{if(z.filter){const Q=a.createExpression(z.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(Q.result==="error")throw new Error(Q.value.map(Pe=>`${Pe.key}: ${Pe.message}`).join(", "));ne={type:"FeatureCollection",features:ne.features.filter(Pe=>Q.value.evaluate({zoom:0},Pe))}}this._geoJSONIndex=z.cluster?new Wt(function({superclusterOptions:Q,clusterProperties:de}){if(!de||!Q)return Q;const Pe={},ke={},Ie={accumulated:null,zoom:0},Je={properties:null},rt=Object.keys(de);for(const Qe of rt){const[nt,ft]=de[Qe],Vt=a.createExpression(ft),Xt=a.createExpression(typeof nt=="string"?[nt,["accumulated"],["get",Qe]]:nt);Pe[Qe]=Vt.value,ke[Qe]=Xt.value}return Q.map=Qe=>{Je.properties=Qe;const nt={};for(const ft of rt)nt[ft]=Pe[ft].evaluate(Ie,Je);return nt},Q.reduce=(Qe,nt)=>{Je.properties=nt;for(const ft of rt)Ie.accumulated=Qe[ft],Qe[ft]=ke[ft].evaluate(Ie,Je)},Q}(z)).load(ne.features):function(Q,de){return new Hr(Q,de)}(ne,z.geojsonVtOptions)}catch(Q){return P(Q)}this.loaded={};const re={};if(H){const Q=a.getPerformanceMeasurement(G);Q&&(re.resourceTiming={},re.resourceTiming[z.source]=JSON.parse(JSON.stringify(Q)))}P(null,re)}})}reloadTile(z,P){const G=this.loaded;return G&&G[z.uid]?super.reloadTile(z,P):this.loadTile(z,P)}loadGeoJSON(z,P){if(z.request)a.getJSON(z.request,P);else{if(typeof z.data!="string")return P(new Error(`Input data given to '${z.source}' is not a valid GeoJSON object.`));try{return P(null,JSON.parse(z.data))}catch{return P(new Error(`Input data given to '${z.source}' is not a valid GeoJSON object.`))}}}getClusterExpansionZoom(z,P){try{P(null,this._geoJSONIndex.getClusterExpansionZoom(z.clusterId))}catch(G){P(G)}}getClusterChildren(z,P){try{P(null,this._geoJSONIndex.getChildren(z.clusterId))}catch(G){P(G)}}getClusterLeaves(z,P){try{P(null,this._geoJSONIndex.getLeaves(z.clusterId,z.limit,z.offset))}catch(G){P(G)}}}class Ts{constructor(z){this.self=z,this.actor=new a.Actor(z,this),this.layerIndexes={},this.availableImages={},this.isSpriteLoaded={},this.projections={},this.defaultProjection=a.getProjection({name:"mercator"}),this.workerSourceTypes={vector:a.VectorTileWorkerSource,geojson:$n},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(P,G)=>{if(this.workerSourceTypes[P])throw new Error(`Worker source with name "${P}" already registered.`);this.workerSourceTypes[P]=G},this.self.registerRTLTextPlugin=P=>{if(a.plugin.isParsed())throw new Error("RTL text plugin already registered.");a.plugin.applyArabicShaping=P.applyArabicShaping,a.plugin.processBidirectionalText=P.processBidirectionalText,a.plugin.processStyledBidirectionalText=P.processStyledBidirectionalText}}clearCaches(z,P,G){delete this.layerIndexes[z],delete this.availableImages[z],delete this.workerSources[z],delete this.demWorkerSources[z],G()}checkIfReady(z,P,G){G()}setReferrer(z,P){this.referrer=P}spriteLoaded(z,P){this.isSpriteLoaded[z]=P;for(const G in this.workerSources[z]){const H=this.workerSources[z][G];for(const ee in H)H[ee]instanceof a.VectorTileWorkerSource&&(H[ee].isSpriteLoaded=P,H[ee].fire(new a.Event("isSpriteLoaded")))}}setImages(z,P,G){this.availableImages[z]=P;for(const H in this.workerSources[z]){const ee=this.workerSources[z][H];for(const ne in ee)ee[ne].availableImages=P}G()}enableTerrain(z,P,G){this.terrain=P,G()}setProjection(z,P){this.projections[z]=a.getProjection(P)}setLayers(z,P,G){this.getLayerIndex(z).replace(P),G()}updateLayers(z,P,G){this.getLayerIndex(z).update(P.layers,P.removedIds),G()}loadTile(z,P,G){const H=this.enableTerrain?a.extend({enableTerrain:this.terrain},P):P;H.projection=this.projections[z]||this.defaultProjection,this.getWorkerSource(z,P.type,P.source).loadTile(H,G)}loadDEMTile(z,P,G){const H=this.enableTerrain?a.extend({buildQuadTree:this.terrain},P):P;this.getDEMWorkerSource(z,P.source).loadTile(H,G)}reloadTile(z,P,G){const H=this.enableTerrain?a.extend({enableTerrain:this.terrain},P):P;H.projection=this.projections[z]||this.defaultProjection,this.getWorkerSource(z,P.type,P.source).reloadTile(H,G)}abortTile(z,P,G){this.getWorkerSource(z,P.type,P.source).abortTile(P,G)}removeTile(z,P,G){this.getWorkerSource(z,P.type,P.source).removeTile(P,G)}removeSource(z,P,G){if(!this.workerSources[z]||!this.workerSources[z][P.type]||!this.workerSources[z][P.type][P.source])return;const H=this.workerSources[z][P.type][P.source];delete this.workerSources[z][P.type][P.source],H.removeSource!==void 0?H.removeSource(P,G):G()}loadWorkerSource(z,P,G){try{this.self.importScripts(P.url),G()}catch(H){G(H.toString())}}syncRTLPluginState(z,P,G){try{a.plugin.setState(P);const H=a.plugin.getPluginURL();if(a.plugin.isLoaded()&&!a.plugin.isParsed()&&H!=null){this.self.importScripts(H);const ee=a.plugin.isParsed();G(ee?void 0:new Error(`RTL Text Plugin failed to import scripts from ${H}`),ee)}}catch(H){G(H.toString())}}getAvailableImages(z){let P=this.availableImages[z];return P||(P=[]),P}getLayerIndex(z){let P=this.layerIndexes[z];return P||(P=this.layerIndexes[z]=new Ki),P}getWorkerSource(z,P,G){if(this.workerSources[z]||(this.workerSources[z]={}),this.workerSources[z][P]||(this.workerSources[z][P]={}),!this.workerSources[z][P][G]){const H={send:(ee,ne,re,Q,de,Pe)=>{this.actor.send(ee,ne,re,z,de,Pe)},scheduler:this.actor.scheduler};this.workerSources[z][P][G]=new this.workerSourceTypes[P](H,this.getLayerIndex(z),this.getAvailableImages(z),this.isSpriteLoaded[z])}return this.workerSources[z][P][G]}getDEMWorkerSource(z,P){return this.demWorkerSources[z]||(this.demWorkerSources[z]={}),this.demWorkerSources[z][P]||(this.demWorkerSources[z][P]=new it),this.demWorkerSources[z][P]}enforceCacheSizeLimit(z,P){a.enforceCacheSizeLimit(P)}getWorkerPerformanceMetrics(z,P,G){G(void 0,void 0)}}return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&(self.worker=new Ts(self)),Ts}),wo(["./shared"],function(a){function Se(l,r){if(Array.isArray(l)){if(!Array.isArray(r)||l.length!==r.length)return!1;for(let o=0;o"u"||typeof document>"u"?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var h,d,f=new Blob([""],{type:"text/javascript"}),g=URL.createObjectURL(f);try{d=new Worker(g),h=!0}catch{h=!1}return d&&d.terminate(),URL.revokeObjectURL(g),h}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var h=document.createElement("canvas");h.width=h.height=1;var d=h.getContext("2d");if(!d)return!1;var f=d.getImageData(0,0,1,1);return f&&f.width===h.width}()?(it[o=r&&r.failIfMajorPerformanceCaveat]===void 0&&(it[o]=function(h){var d,f=function(g){var y=document.createElement("canvas"),v=Object.create(Ki.webGLContextAttributes);return v.failIfMajorPerformanceCaveat=g,y.getContext("webgl",v)||y.getContext("experimental-webgl",v)}(h);if(!f)return!1;try{d=f.createShader(f.VERTEX_SHADER)}catch{return!1}return!(!d||f.isContextLost())&&(f.shaderSource(d,"void main() {}"),f.compileShader(d),f.getShaderParameter(d,f.COMPILE_STATUS)===!0)}(o)),it[o]?document.documentMode?"insufficient ECMAScript 6 support":void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var o}(l)}var it={};function ht(l,r,o){const h=a.window.document.createElement(l);return r!==void 0&&(h.className=r),o&&o.appendChild(h),h}function gi(l,r,o){const h=a.window.document.createElementNS("http://www.w3.org/2000/svg",l);for(const d of Object.keys(r))h.setAttributeNS(null,d,r[d]);return o&&o.appendChild(h),h}Ki.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};const Si=a.window.document&&a.window.document.documentElement.style,vr=Si&&Si.userSelect!==void 0?"userSelect":"WebkitUserSelect";let br;function To(){Si&&vr&&(br=Si[vr],Si[vr]="none")}function Rn(){Si&&vr&&(Si[vr]=br)}function Yi(l){l.preventDefault(),l.stopPropagation(),a.window.removeEventListener("click",Yi,!0)}function Bn(){a.window.addEventListener("click",Yi,!0),a.window.setTimeout(()=>{a.window.removeEventListener("click",Yi,!0)},0)}function Ji(l,r){const o=l.getBoundingClientRect();return Qi(l,o,r)}function hn(l,r){const o=l.getBoundingClientRect(),h=[];for(let d=0;d=0?0:l.button}function Qi(l,r,o){const h=l.offsetWidth===r.width?1:l.offsetWidth/r.width;return new a.Point((o.clientX-r.left)*h,(o.clientY-r.top)*h)}function Le(l,r){var o=r[0],h=r[1],d=r[2],f=r[3],g=o*f-d*h;return g?(l[0]=f*(g=1/g),l[1]=-h*g,l[2]=-d*g,l[3]=o*g,l):null}function ba(l){const{userImage:r}=l;return!!(r&&r.render&&r.render())&&(l.data.replace(new Uint8Array(r.data.buffer)),!0)}class wa extends a.Evented{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new a.RGBAImage({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(r){if(this.loaded!==r&&(this.loaded=r,r)){for(const{ids:o,callback:h}of this.requestors)this._notify(o,h);this.requestors=[]}}hasImage(r){return!!this.getImage(r)}getImage(r){return this.images[r]}addImage(r,o){this._validate(r,o)&&(this.images[r]=o)}_validate(r,o){let h=!0;return this._validateStretch(o.stretchX,o.data&&o.data.width)||(this.fire(new a.ErrorEvent(new Error(`Image "${r}" has invalid "stretchX" value`))),h=!1),this._validateStretch(o.stretchY,o.data&&o.data.height)||(this.fire(new a.ErrorEvent(new Error(`Image "${r}" has invalid "stretchY" value`))),h=!1),this._validateContent(o.content,o)||(this.fire(new a.ErrorEvent(new Error(`Image "${r}" has invalid "content" value`))),h=!1),h}_validateStretch(r,o){if(!r)return!0;let h=0;for(const d of r){if(d[0]{this.ready=!0})}broadcast(r,o,h){a.asyncAll(this.actors,(d,f)=>{d.send(r,o,f)},h=h||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach(r=>{r.remove()}),this.actors=[],this.workerPool.release(this.id)}}function ai(l,r,o){return r*(a.EXTENT/(l.tileSize*Math.pow(2,o-l.tileID.overscaledZ)))}oi.Actor=a.Actor;class $r{constructor(r,o,h,d){this.screenBounds=r,this.cameraPoint=o,this._screenRaycastCache={},this._cameraRaycastCache={},this.isAboveHorizon=h,this.screenGeometry=this.bufferedScreenGeometry(0),this.screenGeometryMercator=this._bufferedScreenMercator(0,d)}static createFromScreenPoints(r,o){let h,d;if(r instanceof a.Point||typeof r[0]=="number"){const f=a.Point.convert(r);h=[f],d=o.isPointAboveHorizon(f)}else{const f=a.Point.convert(r[0]),g=a.Point.convert(r[1]);h=[f,g],d=a.polygonizeBounds(f,g).every(y=>o.isPointAboveHorizon(y))}return new $r(h,o.getCameraPoint(),d,o)}isPointQuery(){return this.screenBounds.length===1}bufferedScreenGeometry(r){return a.polygonizeBounds(this.screenBounds[0],this.screenBounds.length===1?this.screenBounds[0]:this.screenBounds[1],r)}bufferedCameraGeometry(r){const o=this.screenBounds[0],h=this.screenBounds.length===1?this.screenBounds[0].add(new a.Point(1,1)):this.screenBounds[1],d=a.polygonizeBounds(o,h,0,!1);return this.cameraPoint.y>h.y&&(this.cameraPoint.x>o.x&&this.cameraPoint.x=h.x?d[2]=this.cameraPoint:this.cameraPoint.x<=o.x&&(d[3]=this.cameraPoint)),a.bufferConvexPolygon(d,r)}bufferedCameraGeometryGlobe(r){const o=this.screenBounds[0],h=this.screenBounds.length===1?this.screenBounds[0].add(new a.Point(1,1)):this.screenBounds[1],d=a.polygonizeBounds(o,h,r),f=this.cameraPoint.clone();switch(3*((f.y>o.y)+(f.y>h.y))+((f.x>o.x)+(f.x>h.x))){case 0:d[0]=f,d[4]=f.clone();break;case 1:d.splice(1,0,f);break;case 2:d[1]=f;break;case 3:d.splice(4,0,f);break;case 5:d.splice(2,0,f);break;case 6:d[3]=f;break;case 7:d.splice(3,0,f);break;case 8:d[2]=f}return d}containsTile(r,o,h,d=0){const f=r.queryPadding/o._pixelsPerMercatorPixel+1,g=h?this._bufferedCameraMercator(f,o):this._bufferedScreenMercator(f,o);let y=r.tileID.wrap+(g.unwrapped?d:0);const v=g.polygon.map(F=>a.getTilePoint(r.tileTransform,F,y));if(!a.polygonIntersectsBox(v,0,0,a.EXTENT,a.EXTENT))return;y=r.tileID.wrap+(this.screenGeometryMercator.unwrapped?d:0);const E=this.screenGeometryMercator.polygon.map(F=>a.getTileVec3(r.tileTransform,F,y)),T=E.map(F=>new a.Point(F[0],F[1])),A=o.getFreeCameraOptions().position||new a.MercatorCoordinate(0,0,0),k=a.getTileVec3(r.tileTransform,A,y),R=E.map(F=>{const I=a.sub(F,F,k);return a.normalize(I,I),new a.Ray(k,I)}),O=ai(r,1,o.zoom)*o._pixelsPerMercatorPixel;return{queryGeometry:this,tilespaceGeometry:T,tilespaceRays:R,bufferedTilespaceGeometry:v,bufferedTilespaceBounds:(B=a.getBounds(v),B.min.x=a.clamp(B.min.x,0,a.EXTENT),B.min.y=a.clamp(B.min.y,0,a.EXTENT),B.max.x=a.clamp(B.max.x,0,a.EXTENT),B.max.y=a.clamp(B.max.y,0,a.EXTENT),B),tile:r,tileID:r.tileID,pixelToTileUnitsFactor:O};var B}_bufferedScreenMercator(r,o){const h=Fn(r);if(this._screenRaycastCache[h])return this._screenRaycastCache[h];{let d;return d=o.projection.name==="globe"?this._projectAndResample(this.bufferedScreenGeometry(r),o):{polygon:this.bufferedScreenGeometry(r).map(f=>o.pointCoordinate3D(f)),unwrapped:!0},this._screenRaycastCache[h]=d,d}}_bufferedCameraMercator(r,o){const h=Fn(r);if(this._cameraRaycastCache[h])return this._cameraRaycastCache[h];{let d;return d=o.projection.name==="globe"?this._projectAndResample(this.bufferedCameraGeometryGlobe(r),o):{polygon:this.bufferedCameraGeometry(r).map(f=>o.pointCoordinate3D(f)),unwrapped:!0},this._cameraRaycastCache[h]=d,d}}_projectAndResample(r,o){const h=function(f,g){const y=a.multiply([],g.pixelMatrix,g.globeMatrix),v=[0,-a.GLOBE_RADIUS,0,1],E=[0,a.GLOBE_RADIUS,0,1],T=[0,0,0,1];a.transformMat4$1(v,v,y),a.transformMat4$1(E,E,y),a.transformMat4$1(T,T,y);const A=new a.Point(v[0]/v[3],v[1]/v[3]),k=new a.Point(E[0]/E[3],E[1]/E[3]),R=a.polygonContainsPoint(f,A)&&v[3]1?Wt(f.slice(0,F),g):[],N=Fnew a.Point(Zr(Y.x),Y.y)),N=N.map(Y=>new a.Point(Zr(Y.x),Y.y));const j=[...L];j.length===0&&j.push(N[N.length-1]);const K=a.number(j[j.length-1].y,(N.length===0?L[0]:N[0]).y,I);let J;return J=R?[new a.Point(0,K),new a.Point(0,0),new a.Point(1,0),new a.Point(1,K)]:[new a.Point(1,K),new a.Point(1,1),new a.Point(0,1),new a.Point(0,K)],j.push(...J),N.length===0?j.push(L[0]):j.push(...N),{polygon:j.map(Y=>new a.MercatorCoordinate(Y.x,Y.y)),unwrapped:!1}}(r,o);if(h)return h;const d=function(f,g){let y=!1,v=-1/0,E=0;for(let A=0;Av&&(v=f[A].x,E=A);for(let A=0;A.5&&(R.x{A.x-=1}),{polygon:f,unwrapped:y}}(Wt(r,o).map(f=>new a.Point(Zr(f.x),f.y)),o);return{polygon:d.polygon.map(f=>new a.MercatorCoordinate(f.x,f.y)),unwrapped:d.unwrapped}}}function Wt(l,r){return a.resample(l,o=>{const h=r.pointCoordinate3D(o);o.x=h.x,o.y=h.y},1/256)}function Zr(l){return l<0?1+l%1:l%1}function Fn(l){return 100*l|0}function qr(l,r,o,h,d){const f=function(g,y){if(g)return d(g);if(y){l.url&&y.tiles&&l.tiles&&delete l.tiles;const v=a.pick(a.extend(y,l),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);y.vector_layers&&(v.vectorLayers=y.vector_layers,v.vectorLayerIds=v.vectorLayers.map(E=>E.id)),v.tiles=r.canonicalizeTileset(v,l.url),d(null,v)}};return l.url?a.getJSON(r.transformRequest(r.normalizeSourceURL(l.url,null,o,h),a.ResourceType.Source),f):a.exported.frame(()=>f(null,l))}class wr{constructor(r,o,h){this.bounds=a.LngLatBounds.convert(this.validateBounds(r)),this.minzoom=o||0,this.maxzoom=h||24}validateBounds(r){return Array.isArray(r)&&r.length===4?[Math.max(-180,r[0]),Math.max(-90,r[1]),Math.min(180,r[2]),Math.min(90,r[3])]:[-180,-90,180,90]}contains(r){const o=Math.pow(2,r.z),h=Math.floor(a.mercatorXfromLng(this.bounds.getWest())*o),d=Math.floor(a.mercatorYfromLat(this.bounds.getNorth())*o),f=Math.ceil(a.mercatorXfromLng(this.bounds.getEast())*o),g=Math.ceil(a.mercatorYfromLat(this.bounds.getSouth())*o);return r.x>=h&&r.x=d&&r.y{this._tileJSONRequest=null,this._loaded=!0,d?(o&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${o}`),h&&h.length!==2&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${h}`),this.fire(new a.ErrorEvent(d))):f&&(a.extend(this,f),f.bounds&&(this.tileBounds=new wr(f.bounds,this.minzoom,this.maxzoom)),a.postTurnstileEvent(f.tiles,this.map._requestManager._customAccessToken),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"content"}))),r&&r(d)})}loaded(){return this._loaded}hasTile(r){return!this.tileBounds||this.tileBounds.contains(r.canonical)}onAdd(r){this.map=r,this.load()}reload(){this.cancelTileJSONRequest(),this.load(()=>this.map.style._clearSource(this.id))}setTiles(r){return this._options.tiles=r,this.reload(),this}setUrl(r){return this.url=r,this._options.url=r,this.reload(),this}onRemove(){this.cancelTileJSONRequest()}serialize(){return a.extend({},this._options)}loadTile(r,o){const h=this.map._requestManager.normalizeTileURL(r.tileID.canonical.url(this.tiles,this.scheme)),d={request:this.map._requestManager.transformRequest(h,a.ResourceType.Tile),data:void 0,uid:r.uid,tileID:r.tileID,tileZoom:r.tileZoom,zoom:r.tileID.overscaledZ,tileSize:this.tileSize*r.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:a.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,isSymbolTile:r.isSymbolTile};if(d.request.collectResourceTiming=this._collectResourceTiming,r.actor&&r.state!=="expired")r.state==="loading"?r.reloadCallback=o:r.request=r.actor.send("reloadTile",d,f.bind(this));else if(r.actor=this._tileWorkers[h]=this._tileWorkers[h]||this.dispatcher.getActor(),this.dispatcher.ready)r.request=r.actor.send("loadTile",d,f.bind(this),void 0,!0);else{const g=a.loadVectorTile.call({deduped:this._deduped},d,(y,v)=>{y||!v?f.call(this,y):(d.data={cacheControl:v.cacheControl,expires:v.expires,rawData:v.rawData.slice(0)},r.actor&&r.actor.send("loadTile",d,f.bind(this),void 0,!0))},!0);r.request={cancel:g}}function f(g,y){return delete r.request,r.aborted?o(null):g&&g.status!==404?o(g):(y&&y.resourceTiming&&(r.resourceTiming=y.resourceTiming),this.map._refreshExpiredTiles&&y&&r.setExpiryData(y),r.loadVectorData(y,this.map.painter),a.cacheEntryPossiblyAdded(this.dispatcher),o(null),void(r.reloadCallback&&(this.loadTile(r,r.reloadCallback),r.reloadCallback=null)))}}abortTile(r){r.request&&(r.request.cancel(),delete r.request),r.actor&&r.actor.send("abortTile",{uid:r.uid,type:this.type,source:this.id})}unloadTile(r){r.unloadVectorData(),r.actor&&r.actor.send("removeTile",{uid:r.uid,type:this.type,source:this.id})}hasTransition(){return!1}afterUpdate(){this._tileWorkers={}}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}class Ie extends a.Evented{constructor(r,o,h,d){super(),this.id=r,this.dispatcher=h,this.setEventedParent(d),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=a.extend({type:"raster"},o),a.extend(this,a.pick(o,["url","scheme","tileSize"]))}load(r){this._loaded=!1,this.fire(new a.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=qr(this._options,this.map._requestManager,null,null,(o,h)=>{this._tileJSONRequest=null,this._loaded=!0,o?this.fire(new a.ErrorEvent(o)):h&&(a.extend(this,h),h.bounds&&(this.tileBounds=new wr(h.bounds,this.minzoom,this.maxzoom)),a.postTurnstileEvent(h.tiles),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"content"}))),r&&r(o)})}loaded(){return this._loaded}onAdd(r){this.map=r,this.load()}reload(){this.cancelTileJSONRequest(),this.load(()=>this.map.style._clearSource(this.id))}setTiles(r){return this._options.tiles=r,this.reload(),this}setUrl(r){return this.url=r,this._options.url=r,this.reload(),this}onRemove(){this.cancelTileJSONRequest()}serialize(){return a.extend({},this._options)}hasTile(r){return!this.tileBounds||this.tileBounds.contains(r.canonical)}loadTile(r,o){const h=a.exported.devicePixelRatio>=2,d=this.map._requestManager.normalizeTileURL(r.tileID.canonical.url(this.tiles,this.scheme),h,this.tileSize);r.request=a.getImage(this.map._requestManager.transformRequest(d,a.ResourceType.Tile),(f,g,y,v)=>(delete r.request,r.aborted?(r.state="unloaded",o(null)):f?(r.state="errored",o(f)):g?(this.map._refreshExpiredTiles&&r.setExpiryData({cacheControl:y,expires:v}),r.setTexture(g,this.map.painter),r.state="loaded",a.cacheEntryPossiblyAdded(this.dispatcher),void o(null)):o(null)))}static loadTileData(r,o,h){r.setTexture(o,h)}static unloadTileData(r,o){r.texture&&o.saveTileTexture(r.texture)}abortTile(r,o){r.request&&(r.request.cancel(),delete r.request),o()}unloadTile(r,o){r.texture&&this.map.painter.saveTileTexture(r.texture),o()}hasTransition(){return!1}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}function Je(l,r,o,h,d,f,g,y){const v=[l,o,d,r,h,f,1,1,1],E=[g,y,1],T=a.adjoint([],v),[A,k,R]=a.transformMat3(E,E,a.transpose(T,T));return a.multiply$1(v,[A,0,0,0,k,0,0,0,R],v)}class rt extends a.Evented{constructor(r,o,h,d){super(),this.id=r,this.dispatcher=h,this.coordinates=o.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(d),this.options=o,this._dirty=!1}load(r,o){this._loaded=o||!1,this.fire(new a.Event("dataloading",{dataType:"source"})),this.url=this.options.url,this._imageRequest=a.getImage(this.map._requestManager.transformRequest(this.url,a.ResourceType.Image),(h,d)=>{if(this._imageRequest=null,this._loaded=!0,h)this.fire(new a.ErrorEvent(h));else if(d){const{HTMLImageElement:f}=a.window;this.image=d instanceof f?a.exported.getImageData(d):d,this._dirty=!0,this.width=this.image.width,this.height=this.image.height,r&&(this.coordinates=r),this._finishLoading()}})}loaded(){return this._loaded}updateImage(r){return this.image&&r.url?(this._imageRequest&&r.url!==this.options.url&&(this._imageRequest.cancel(),this._imageRequest=null),this.options.url=r.url,this.load(r.coordinates,this._loaded),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(r){this.map=r,this.load()}onRemove(){this._imageRequest&&(this._imageRequest.cancel(),this._imageRequest=null),this.texture&&this.texture.destroy()}setCoordinates(r){this.coordinates=r,this._boundsArray=void 0;const o=r.map(a.MercatorCoordinate.fromLngLat);return this.tileID=function(h){let d=1/0,f=1/0,g=-1/0,y=-1/0;for(const A of h)d=Math.min(d,A.x),f=Math.min(f,A.y),g=Math.max(g,A.x),y=Math.max(y,A.y);const v=Math.max(g-d,y-f),E=Math.max(0,Math.floor(-Math.log(v)/Math.LN2)),T=Math.pow(2,E);return new a.CanonicalTileID(E,Math.floor((d+g)/2*T),Math.floor((f+y)/2*T))}(o),this.minzoom=this.maxzoom=this.tileID.z,this.fire(new a.Event("data",{dataType:"source",sourceDataType:"content"})),this}_clear(){this._boundsArray=void 0}_prepareData(r){for(const v in this.tiles){const E=this.tiles[v];E.state!=="loaded"&&(E.state="loaded",E.texture=this.texture)}if(this._boundsArray)return;const o=a.tileTransform(this.tileID,this.map.transform.projection),[h,d,f,g]=this.coordinates.map(v=>{const E=o.projection.project(v[0],v[1]);return a.getTilePoint(o,E)._round()});this.perspectiveTransform=function(v,E,T,A,k,R,O,B,F,I){const L=Je(0,0,v,0,0,E,v,E),N=Je(T,A,k,R,O,B,F,I);return a.multiply$1(N,a.adjoint(L,L),N),[N[6]/N[8]*v/a.EXTENT,N[7]/N[8]*E/a.EXTENT]}(this.width,this.height,h.x,h.y,d.x,d.y,g.x,g.y,f.x,f.y);const y=this._boundsArray=new a.StructArrayLayout4i8;y.emplaceBack(h.x,h.y,0,0),y.emplaceBack(d.x,d.y,a.EXTENT,0),y.emplaceBack(g.x,g.y,0,a.EXTENT),y.emplaceBack(f.x,f.y,a.EXTENT,a.EXTENT),this.boundsBuffer&&this.boundsBuffer.destroy(),this.boundsBuffer=r.createVertexBuffer(y,a.boundsAttributes.members),this.boundsSegments=a.SegmentVector.simpleSegment(0,0,4,2)}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const r=this.map.painter.context,o=r.gl;this._dirty&&(this.texture?this.texture.update(this.image):(this.texture=new a.Texture(r,this.image,o.RGBA),this.texture.bind(o.LINEAR,o.CLAMP_TO_EDGE)),this._dirty=!1),this._prepareData(r)}loadTile(r,o){this.tileID&&this.tileID.equals(r.tileID.canonical)?(this.tiles[String(r.tileID.wrap)]=r,r.buckets={},o(null)):(r.state="errored",o(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}const Qe={vector:ke,raster:Ie,"raster-dem":class extends Ie{constructor(l,r,o,h){super(l,r,o,h),this.type="raster-dem",this.maxzoom=22,this._options=a.extend({type:"raster-dem"},r),this.encoding=r.encoding||"mapbox"}loadTile(l,r){const o=this.map._requestManager.normalizeTileURL(l.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize);function h(d,f){d&&(l.state="errored",r(d)),f&&(l.dem=f,l.dem.onDeserialize(),l.needsHillshadePrepare=!0,l.needsDEMTextureUpload=!0,l.state="loaded",r(null))}l.request=a.getImage(this.map._requestManager.transformRequest(o,a.ResourceType.Tile),(function(d,f,g,y){if(delete l.request,l.aborted)l.state="unloaded",r(null);else if(d)l.state="errored",r(d);else if(f){this.map._refreshExpiredTiles&&l.setExpiryData({cacheControl:g,expires:y});const v=a.window.ImageBitmap&&f instanceof a.window.ImageBitmap&&(Gn==null&&(Gn=a.window.OffscreenCanvas&&new a.window.OffscreenCanvas(1,1).getContext("2d")&&typeof a.window.createImageBitmap=="function"),Gn),E=1-(f.width-a.prevPowerOfTwo(f.width))/2;E<1||l.neighboringTiles||(l.neighboringTiles=this._getNeighboringTiles(l.tileID));const T=v?f:a.exported.getImageData(f,E),A={uid:l.uid,coord:l.tileID,source:this.id,rawImageData:T,encoding:this.encoding,padding:E};l.actor&&l.state!=="expired"||(l.actor=this.dispatcher.getActor(),l.actor.send("loadDEMTile",A,h.bind(this),void 0,!0))}}).bind(this))}_getNeighboringTiles(l){const r=l.canonical,o=Math.pow(2,r.z),h=(r.x-1+o)%o,d=r.x===0?l.wrap-1:l.wrap,f=(r.x+1+o)%o,g=r.x+1===o?l.wrap+1:l.wrap,y={};return y[new a.OverscaledTileID(l.overscaledZ,d,r.z,h,r.y).key]={backfilled:!1},y[new a.OverscaledTileID(l.overscaledZ,g,r.z,f,r.y).key]={backfilled:!1},r.y>0&&(y[new a.OverscaledTileID(l.overscaledZ,d,r.z,h,r.y-1).key]={backfilled:!1},y[new a.OverscaledTileID(l.overscaledZ,l.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},y[new a.OverscaledTileID(l.overscaledZ,g,r.z,f,r.y-1).key]={backfilled:!1}),r.y+1{if(this._loaded=!0,this._pendingLoad=null,o)this.fire(new a.ErrorEvent(o));else{const d={dataType:"source",sourceDataType:this._metadataFired?"content":"metadata"};this._collectResourceTiming&&h&&h.resourceTiming&&h.resourceTiming[this.id]&&(d.resourceTiming=h.resourceTiming[this.id]),this.fire(new a.Event("data",d)),this._metadataFired=!0}this._coalesce&&(this._updateWorkerData(),this._coalesce=!1)})}loaded(){return this._loaded}loadTile(l,r){const o=l.actor?"reloadTile":"loadTile";l.actor=this.actor,l.request=this.actor.send(o,{type:this.type,uid:l.uid,tileID:l.tileID,tileZoom:l.tileZoom,zoom:l.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:a.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(h,d)=>(delete l.request,l.unloadVectorData(),l.aborted?r(null):h?r(h):(l.loadVectorData(d,this.map.painter,o==="reloadTile"),r(null))),void 0,o==="loadTile")}abortTile(l){l.request&&(l.request.cancel(),delete l.request),l.aborted=!0}unloadTile(l){l.unloadVectorData(),this.actor.send("removeTile",{uid:l.uid,type:this.type,source:this.id})}onRemove(){this._pendingLoad&&this._pendingLoad.cancel()}serialize(){return a.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}},video:class extends rt{constructor(l,r,o,h){super(l,r,o,h),this.roundZoom=!0,this.type="video",this.options=r}load(){this._loaded=!1;const l=this.options;this.urls=[];for(const r of l.urls)this.urls.push(this.map._requestManager.transformRequest(r,a.ResourceType.Source).url);a.getVideo(this.urls,(r,o)=>{this._loaded=!0,r?this.fire(new a.ErrorEvent(r)):o&&(this.video=o,this.video.loop=!0,this.video.setAttribute("playsinline",""),this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(l){if(this.video){const r=this.video.seekable;lr.end(0)?this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${this.id}`,null,`Playback for this video can be set only between the ${r.start(0)} and ${r.end(0)}-second mark.`))):this.video.currentTime=l}}getVideo(){return this.video}onAdd(l){this.map||(this.map=l,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const l=this.map.painter.context,r=l.gl;this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new a.Texture(l,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),this.width=this.video.videoWidth,this.height=this.video.videoHeight),this._prepareData(l)}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},image:rt,canvas:class extends rt{constructor(l,r,o,h){super(l,r,o,h),r.coordinates?Array.isArray(r.coordinates)&&r.coordinates.length===4&&!r.coordinates.some(d=>!Array.isArray(d)||d.length!==2||d.some(f=>typeof f!="number"))||this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${l}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${l}`,null,'missing required property "coordinates"'))),r.animate&&typeof r.animate!="boolean"&&this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${l}`,null,'optional "animate" property must be a boolean value'))),r.canvas?typeof r.canvas=="string"||r.canvas instanceof a.window.HTMLCanvasElement||this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${l}`,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 a.ErrorEvent(new a.ValidationError(`sources.${l}`,null,'missing required property "canvas"'))),this.options=r,this.animate=r.animate===void 0||r.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof a.window.HTMLCanvasElement?this.options.canvas:a.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new a.ErrorEvent(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(l){this.map=l,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let l=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,l=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,l=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const r=this.map.painter.context;this.texture?(l||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new a.Texture(r,this.canvas,r.gl.RGBA,{premultiply:!0}),this._prepareData(r)}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const l of[this.canvas.width,this.canvas.height])if(isNaN(l)||l<=0)return!0;return!1}},custom:class extends a.Evented{constructor(l,r,o,h){super(),this.id=l,this.type="custom",this._dataType="raster",this._dispatcher=o,this._implementation=r,this.setEventedParent(h),this.scheme="xyz",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this._loaded=!1,this.roundZoom=!0,this._implementation||this.fire(new a.ErrorEvent(new Error(`Missing implementation for ${this.id} custom source`))),this._implementation.loadTile||this.fire(new a.ErrorEvent(new Error(`Missing loadTile implementation for ${this.id} custom source`))),this._implementation.bounds&&(this.tileBounds=new wr(this._implementation.bounds,this.minzoom,this.maxzoom)),r.update=this._update.bind(this),r.clearTiles=this._clearTiles.bind(this),r.coveringTiles=this._coveringTiles.bind(this),a.extend(this,a.pick(r,["dataType","scheme","minzoom","maxzoom","tileSize","attribution","minTileCacheSize","maxTileCacheSize"]))}serialize(){return a.pick(this,["type","scheme","minzoom","maxzoom","tileSize","attribution"])}load(){this._loaded=!0,this.fire(new a.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"content"}))}loaded(){return this._loaded}onAdd(l){this._map=l,this._loaded=!1,this.fire(new a.Event("dataloading",{dataType:"source"})),this._implementation.onAdd&&this._implementation.onAdd(l),this.load()}onRemove(l){this._implementation.onRemove&&this._implementation.onRemove(l)}hasTile(l){if(this._implementation.hasTile){const{x:r,y:o,z:h}=l.canonical;return this._implementation.hasTile({x:r,y:o,z:h})}return!this.tileBounds||this.tileBounds.contains(l.canonical)}loadTile(l,r){const{x:o,y:h,z:d}=l.tileID.canonical,f=new a.window.AbortController;l.request=Promise.resolve(this._implementation.loadTile({x:o,y:h,z:d},{signal:f.signal})).then((function(g){return delete l.request,l.aborted?(l.state="unloaded",r(null)):g===void 0?(l.state="errored",r(null)):g===null?(this.loadTileData(l,{width:this.tileSize,height:this.tileSize,data:null}),l.state="loaded",r(null)):function(y){return y instanceof a.window.ImageData||y instanceof a.window.HTMLCanvasElement||y instanceof a.window.ImageBitmap||y instanceof a.window.HTMLImageElement}(g)?(this.loadTileData(l,g),l.state="loaded",void r(null)):(l.state="errored",r(new Error(`Can't infer data type for ${this.id}, only raster data supported at the moment`)))}).bind(this)).catch(g=>{g.code!==20&&(l.state="errored",r(g))}),l.request.cancel=()=>f.abort()}loadTileData(l,r){Ie.loadTileData(l,r,this._map.painter)}unloadTileData(l){Ie.unloadTileData(l,this._map.painter)}unloadTile(l,r){if(this.unloadTileData(l),this._implementation.unloadTile){const{x:o,y:h,z:d}=l.tileID.canonical;this._implementation.unloadTile({x:o,y:h,z:d})}r()}abortTile(l,r){l.request&&l.request.cancel&&(l.request.cancel(),delete l.request),r()}hasTransition(){return!1}_coveringTiles(){return this._map.transform.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,roundZoom:this.roundZoom}).map(l=>({x:l.canonical.x,y:l.canonical.y,z:l.canonical.z}))}_clearTiles(){this._map.style._clearSource(this.id)}_update(){this.fire(new a.Event("data",{dataType:"source",sourceDataType:"content"}))}}},nt=function(l,r,o,h){const d=new Qe[r.type](l,r,o,h);if(d.id!==l)throw new Error(`Expected Source id to be ${l} instead of ${d.id}`);return a.bindAll(["load","abort","unload","serialize","prepare"],d),d};function ft(l,r){const o=a.identity([]);return a.scale(o,o,[.5*l.width,.5*-l.height,1]),a.translate(o,o,[1,-1,0]),a.multiply(o,o,l.calculateProjMatrix(r.toUnwrapped())),Float32Array.from(o)}function Vt(l,r,o,h,d,f,g,y=!1){const v=l.tilesIn(h,g,y);v.sort(yi);const E=[];for(const A of v)E.push({wrappedTileID:A.tile.tileID.wrapped().key,queryResults:A.tile.queryRenderedFeatures(r,o,l._state,A,d,f,ft(l.transform,A.tile.tileID),y)});const T=function(A){const k={},R={};for(const O of A){const B=O.queryResults,F=O.wrappedTileID,I=R[F]=R[F]||{};for(const L in B){const N=B[L],j=I[L]=I[L]||{},K=k[L]=k[L]||[];for(const J of N)j[J.featureIndex]||(j[J.featureIndex]=!0,K.push(J))}}return k}(E);for(const A in T)T[A].forEach(k=>{const R=k.feature,O=R.layer;O&&O.type!=="background"&&O.type!=="sky"&&(R.source=O.source,O["source-layer"]&&(R.sourceLayer=O["source-layer"]),R.state=R.id!==void 0?l.getFeatureState(O["source-layer"],R.id):{})});return T}function Xt(l,r){const o=l.getRenderableIds().map(f=>l.getTileByID(f)),h=[],d={};for(let f=0;f{o.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[sr]}numActive(){return Object.keys(this.active).length}}let Ti;function Zn(){return Ti||(Ti=new li),Ti}function Ah(l,r){const o={};for(const h in l)h!=="ref"&&(o[h]=l[h]);return a.refProperties.forEach(h=>{h in r&&(o[h]=r[h])}),o}function tc(l){l=l.slice();const r=Object.create(null);for(let o=0;o0?(d-g)/y:0;return this.points[f].mult(1-v).add(this.points[o].mult(v))}}class gn{constructor(r,o,h){const d=this.boxCells=[],f=this.circleCells=[];this.xCellCount=Math.ceil(r/h),this.yCellCount=Math.ceil(o/h);for(let g=0;gthis.width||d<0||o>this.height)return!f&&[];const y=[];if(r<=0&&o<=0&&this.width<=h&&this.height<=d){if(f)return!0;for(let v=0;v0:y}_queryCircle(r,o,h,d,f){const g=r-h,y=r+h,v=o-h,E=o+h;if(y<0||g>this.width||E<0||v>this.height)return!d&&[];const T=[];return this._forEachCell(g,v,y,E,this._queryCellCircle,T,{hitTest:d,circle:{x:r,y:o,radius:h},seenUids:{box:{},circle:{}}},f),d?T.length>0:T}query(r,o,h,d,f){return this._query(r,o,h,d,!1,f)}hitTest(r,o,h,d,f){return this._query(r,o,h,d,!0,f)}hitTestCircle(r,o,h,d){return this._queryCircle(r,o,h,!0,d)}_queryCell(r,o,h,d,f,g,y,v){const E=y.seenUids,T=this.boxCells[f];if(T!==null){const k=this.bboxes;for(const R of T)if(!E.box[R]){E.box[R]=!0;const O=4*R;if(r<=k[O+2]&&o<=k[O+3]&&h>=k[O+0]&&d>=k[O+1]&&(!v||v(this.boxKeys[R]))){if(y.hitTest)return g.push(!0),!0;g.push({key:this.boxKeys[R],x1:k[O],y1:k[O+1],x2:k[O+2],y2:k[O+3]})}}}const A=this.circleCells[f];if(A!==null){const k=this.circles;for(const R of A)if(!E.circle[R]){E.circle[R]=!0;const O=3*R;if(this._circleAndRectCollide(k[O],k[O+1],k[O+2],r,o,h,d)&&(!v||v(this.circleKeys[R]))){if(y.hitTest)return g.push(!0),!0;{const B=k[O],F=k[O+1],I=k[O+2];g.push({key:this.circleKeys[R],x1:B-I,y1:F-I,x2:B+I,y2:F+I})}}}}}_queryCellCircle(r,o,h,d,f,g,y,v){const E=y.circle,T=y.seenUids,A=this.boxCells[f];if(A!==null){const R=this.bboxes;for(const O of A)if(!T.box[O]){T.box[O]=!0;const B=4*O;if(this._circleAndRectCollide(E.x,E.y,E.radius,R[B+0],R[B+1],R[B+2],R[B+3])&&(!v||v(this.boxKeys[O])))return g.push(!0),!0}}const k=this.circleCells[f];if(k!==null){const R=this.circles;for(const O of k)if(!T.circle[O]){T.circle[O]=!0;const B=3*O;if(this._circlesCollide(R[B],R[B+1],R[B+2],E.x,E.y,E.radius)&&(!v||v(this.circleKeys[O])))return g.push(!0),!0}}}_forEachCell(r,o,h,d,f,g,y,v){const E=this._convertToXCellCoord(r),T=this._convertToYCellCoord(o),A=this._convertToXCellCoord(h),k=this._convertToYCellCoord(d);for(let R=E;R<=A;R++)for(let O=T;O<=k;O++)if(f.call(this,r,o,h,d,this.xCellCount*O+R,g,y,v))return}_convertToXCellCoord(r){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(r*this.xScale)))}_convertToYCellCoord(r){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(r*this.yScale)))}_circlesCollide(r,o,h,d,f,g){const y=d-r,v=f-o,E=h+g;return E*E>y*y+v*v}_circleAndRectCollide(r,o,h,d,f,g,y){const v=(g-d)/2,E=Math.abs(r-(d+v));if(E>v+h)return!1;const T=(y-f)/2,A=Math.abs(o-(f+T));if(A>T+h)return!1;if(E<=v||A<=T)return!0;const k=E-v,R=A-T;return k*k+R*R<=h*h}}const Sr={unknown:0,flipRequired:1,flipNotRequired:2},Po=Math.tan(85*Math.PI/180);function fe(l,r,o,h,d,f,g){const y=a.create();if(o)if(f.name==="globe"){const v=a.calculateGlobeLabelMatrix(d,r);a.multiply(y,y,v)}else{const v=Le([],g);y[0]=v[0],y[1]=v[1],y[4]=v[2],y[5]=v[3],h||a.rotateZ(y,y,d.angle)}else a.multiply(y,d.labelPlaneMatrix,l);return y}function Mr(l,r,o,h,d,f,g){const y=fe(l,r,o,h,d,f,g);return f.name==="globe"&&o||(y[2]=y[6]=y[10]=y[14]=0),y}function Ht(l,r,o,h,d,f,g){if(o){if(f.name==="globe"){const y=fe(l,r,o,h,d,f,g);return a.invert(y,y),a.multiply(y,l,y),y}{const y=a.clone(l),v=a.identity([]);return v[0]=g[0],v[1]=g[1],v[4]=g[2],v[5]=g[3],a.multiply(y,y,v),h||a.rotateZ(y,y,-d.angle),y}}return d.glCoordMatrix}function ci(l,r,o,h){const d=[l,r,o,1];o?a.transformMat4$1(d,d,h):at(d,d,h);const f=d[3];return d[0]/=f,d[1]/=f,d[2]/=f,d}function ic(l,r){return Math.min(.5+l/r*.5,1.5)}function lr(l,r){const o=l[0]/l[3],h=l[1]/l[3];return o>=-r[0]&&o<=r[0]&&h>=-r[1]&&h<=r[1]}function Ia(l,r,o,h,d,f,g,y,v,E){const T=o.transform,A=h?l.textSizeData:l.iconSizeData,k=a.evaluateSizeForZoom(A,o.transform.zoom),R=T.projection.name==="globe",O=[256/o.width*2+1,256/o.height*2+1],B=h?l.text.dynamicLayoutVertexArray:l.icon.dynamicLayoutVertexArray;B.clear();let F=null;R&&(F=h?l.text.globeExtVertexArray:l.icon.globeExtVertexArray);const I=l.lineVertexArray,L=h?l.text.placedSymbolArray:l.icon.placedSymbolArray,N=o.transform.width/o.transform.height;let j,K=!1;for(let J=0;JMath.abs(o)?{useVertical:!0}:l===a.WritingMode.vertical?h>0?{needsFlipping:!0}:null:r!==Sr.unknown&&function(d,f){return d===0||Math.abs(f/d)>Po}(o,h)?r===Sr.flipRequired?{needsFlipping:!0}:null:o<0?{needsFlipping:!0}:null}function Oe(l,r,o,h,d,f,g,y,v,E,T,A,k,R,O,B,F,I,L){const N=r/24,j=l.lineOffsetX*N,K=l.lineOffsetY*N,{lineStartIndex:J,glyphStartIndex:Y,numGlyphs:ie,segment:te,writingMode:le,flipState:Te}=l,oe=J+l.lineLength,ge=he=>{if(T){const[Me,ve,Ae]=he.up,Ge=E.length;a.updateGlobeVertexNormal(T,Ge+0,Me,ve,Ae),a.updateGlobeVertexNormal(T,Ge+1,Me,ve,Ae),a.updateGlobeVertexNormal(T,Ge+2,Me,ve,Ae),a.updateGlobeVertexNormal(T,Ge+3,Me,ve,Ae)}const[we,ae,_e]=he.point;a.addDynamicAttributes(E,we,ae,_e,he.angle)};if(ie>1){const he=rc(N,y,j,K,o,A,k,l,v,f,R,B,!1,F,I,L);if(!he)return{notEnoughRoom:!0};if(h&&!o){let[we,ae,_e]=he.first.point,[Me,ve,Ae]=he.last.point;[we,ae]=ci(we,ae,_e,g),[Me,ve]=ci(Me,ve,Ae,g);const Ge=qn(le,Te,(Me-we)*O,ve-ae);if(l.flipState=Ge&&Ge.needsFlipping?Sr.flipRequired:Sr.flipNotRequired,Ge)return Ge}ge(he.first);for(let we=Y+1;we0?Me:st(k,_e,we,1,d,void 0,F,I.canonical),Ae=qn(le,Te,(ve[0]-we[0])*O,ve[1]-we[1]);if(l.flipState=Ae&&Ae.needsFlipping?Sr.flipRequired:Sr.flipNotRequired,Ae)return Ae}const he=Bi(N*y.getoffsetX(Y),j,K,o,A,k,te,J,oe,v,f,R,B,!1,!1,F,I,L);if(!he)return{notEnoughRoom:!0};ge(he)}return{}}function ut(l,r,o,h,d){const{x:f,y:g,z:y}=h.projectTilePoint(l.x,l.y,r);if(!d)return ci(f,g,y,o);const[v,E,T]=d(l);return ci(f+v,g+E,y+T,o)}function st(l,r,o,h,d,f,g,y){const v=ut(l.sub(r)._unit()._add(l),y,d,g,f);return a.sub(v,o,v),a.normalize(v,v),a.scaleAndAdd(v,o,v,h)}function Bi(l,r,o,h,d,f,g,y,v,E,T,A,k,R,O,B,F,I){const L=h?l-r:l+r;let N=L>0?1:-1,j=0;h&&(N*=-1,j=Math.PI),N<0&&(j+=Math.PI);let K=y+g+(N>0?0:1)|0,J=d,Y=d,ie=0,te=0;const le=Math.abs(L),Te=[],oe=[];let ge=f,he=ge;const we=()=>st(he,ge,Y,le-ie+1,T,k,B,F.canonical);for(;ie+te<=le;){if(K+=N,K=v)return null;if(Y=J,he=ge,Te.push(Y),R&&oe.push(he),ge=new a.Point(E.getx(K),E.gety(K)),J=A[K],!J){const qe=ut(ge,F.canonical,T,B,k);J=qe[3]>0?A[K]=qe:we()}ie+=te,te=a.distance(Y,J)}O&&k&&(A[K]&&(J=we(),te=a.distance(Y,J)),A[K]=J);const ae=(le-ie)/te,_e=ge.sub(he)._mult(ae)._add(he),Me=a.sub([],J,Y),ve=a.scaleAndAdd([],Y,Me,ae);let Ae=[0,0,1],Ge=Me[0],Xe=Me[1];if(I&&(Ae=B.upVector(F.canonical,_e.x,_e.y),Ae[0]!==0||Ae[1]!==0||Ae[2]!==1)){const qe=[Ae[2],0,-Ae[0]],lt=a.cross([],Ae,qe);a.normalize(qe,qe),a.normalize(lt,lt),Ge=a.dot(Me,qe),Xe=a.dot(Me,lt)}if(o){const qe=a.cross([],Ae,Me);a.normalize(qe,qe),a.scaleAndAdd(ve,ve,qe,o*N)}const Ve=j+Math.atan2(Xe,Ge);return Te.push(ve),R&&oe.push(_e),{point:ve,angle:Ve,path:Te,tilePath:oe,up:Ae}}function er(l,r){const o=r.length,h=o+4*l;r.resize(h),r.float32.fill(-1/0,4*o,4*h)}function at(l,r,o){const h=r[0],d=r[1];return l[0]=o[0]*h+o[4]*d+o[12],l[1]=o[1]*h+o[5]*d+o[13],l[3]=o[3]*h+o[7]*d+o[15],l}const Oi=100;class ko{constructor(r,o,h=new gn(r.width+200,r.height+200,25),d=new gn(r.width+200,r.height+200,25)){this.transform=r,this.grid=h,this.ignoredGrid=d,this.pitchfactor=Math.cos(r._pitch)*r.cameraToCenterDistance,this.screenRightBoundary=r.width+Oi,this.screenBottomBoundary=r.height+Oi,this.gridRightBoundary=r.width+200,this.gridBottomBoundary=r.height+200,this.fogState=o}placeCollisionBox(r,o,h,d,f,g,y,v){let E=h.projectedAnchorX,T=h.projectedAnchorY,A=h.projectedAnchorZ;const k=h.elevation,R=h.tileID,O=r.getProjection();if(k&&R){const[J,Y,ie]=O.upVector(R.canonical,h.tileAnchorX,h.tileAnchorY),te=O.upVectorScale(R.canonical,this.transform.center.lat,this.transform.worldSize).metersToTile;E+=J*k*te,T+=Y*k*te,A+=ie*k*te}const B=this.projectAndGetPerspectiveRatio(y,E,T,A,h.tileID,O.name==="globe"||!!k||this.transform.pitch>0,O),F=g*B.perspectiveRatio,I=(h.x1*o+d.x-h.padding)*F+B.point.x,L=(h.y1*o+d.y-h.padding)*F+B.point.y,N=(h.x2*o+d.x+h.padding)*F+B.point.x,j=(h.y2*o+d.y+h.padding)*F+B.point.y,K=B.perspectiveRatio<=.55||B.occluded;return!this.isInsideGrid(I,L,N,j)||!f&&this.grid.hitTest(I,L,N,j,v)||K?{box:[],offscreen:!1,occluded:B.occluded}:{box:[I,L,N,j],offscreen:this.isOffscreen(I,L,N,j),occluded:!1}}placeCollisionCircles(r,o,h,d,f,g,y,v,E,T,A,k,R,O,B){const F=[],I=this.transform.elevation,L=r.getProjection(),N=I?I.getAtTileOffsetFunc(B,this.transform.center.lat,this.transform.worldSize,L):null,j=new a.Point(h.tileAnchorX,h.tileAnchorY);let{x:K,y:J,z:Y}=L.projectTilePoint(j.x,j.y,B.canonical);if(N){const[_e,Me,ve]=N(j);K+=_e,J+=Me,Y+=ve}const ie=L.name==="globe",te=this.projectAndGetPerspectiveRatio(y,K,J,Y,B,ie||!!I||this.transform.pitch>0,L),{perspectiveRatio:le}=te,Te=(A?g/le:g*le)/a.ONE_EM,oe=ci(K,J,Y,v),ge=te.signedDistanceFromCamera>0?rc(Te,f,h.lineOffsetX*Te,h.lineOffsetY*Te,!1,oe,j,h,d,v,{},I&&!A?N:null,A&&!!I,L,B,A):null;let he=!1,we=!1,ae=!0;if(ge&&!te.occluded){const _e=.5*R*le+O,Me=new a.Point(-100,-100),ve=new a.Point(this.screenRightBoundary,this.screenBottomBoundary),Ae=new Aa,{first:Ge,last:Xe}=ge,Ve=Ge.path.length;let qe=[];for(let je=Ve-1;je>=1;je--)qe.push(Ge.path[je]);for(let je=1;je(N&&!ie&&(Tt=N(Etje[3]<=0)&&(qe=[]));let ot=[];if(qe.length>0){let je=1/0,wt=-1/0,Tt=1/0,Et=-1/0;for(const St of qe)je=Math.min(je,St[0]),Tt=Math.min(Tt,St[1]),wt=Math.max(wt,St[0]),Et=Math.max(Et,St[1]);wt>=Me.x&&je<=ve.x&&Et>=Me.y&&Tt<=ve.y&&(ot=[qe.map(St=>new a.Point(St[0],St[1]))],(jeve.x||Ttve.y)&&(ot=a.clipLine(ot,Me.x,Me.y,ve.x,ve.y)))}for(const je of ot){Ae.reset(je,.25*_e);let wt=0;wt=Ae.length<=.5*_e?1:Math.ceil(Ae.paddedLength/lt)+1;for(let Tt=0;Tt0?(a.transformMat4$1(v,v,r),this.fogState&&f&&y.name!=="globe"&&(E=function(k,R,O,B,F,I){const L=I.calculateFogTileMatrix(F),N=[R,O,B];return a.transformMat4(N,N,L),Eo(k,N,I.pitch,I._fov)}(this.fogState,o,h,d,f.toUnwrapped(),this.transform)>.9)):at(v,v,r);const T=v[3];return{point:new a.Point((v[0]/T+1)/2*this.transform.width+Oi,(-v[1]/T+1)/2*this.transform.height+Oi),perspectiveRatio:Math.min(.5+this.transform.getCameraToCenterDistance(y)/T*.5,1.5),signedDistanceFromCamera:T,occluded:g&&v[2]>T||E}}isOffscreen(r,o,h,d){return h=this.screenRightBoundary||dthis.screenBottomBoundary}isInsideGrid(r,o,h,d){return h>=0&&r=0&&oh.collisionGroupID===o}}return this.collisionGroups[r]}}function Ro(l,r,o,h,d){const{horizontalAlign:f,verticalAlign:g}=a.getAnchorAlignment(l),y=-(f-.5)*r,v=-(g-.5)*o,E=a.evaluateVariableOffset(l,h);return new a.Point(y+E[0]*d,v+E[1]*d)}function Bo(l,r,o,h,d){const f=new a.Point(l,r);return o&&f._rotate(h?d:-d),f}class Ss{constructor(r,o,h,d,f){this.transform=r.clone(),this.projection=r.projection.name,this.collisionIndex=new ko(this.transform,f),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=o,this.retainedQueryData={},this.collisionGroups=new oc(h),this.collisionCircleArrays={},this.prevPlacement=d,d&&(d.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(r,o,h,d){const f=h.getBucket(o),g=h.latestFeatureIndex;if(!f||!g||o.id!==f.layerIds[0])return;const y=f.layers[0].layout,v=h.collisionBoxArray,E=Math.pow(2,this.transform.zoom-h.tileID.overscaledZ),T=h.tileSize/a.EXTENT,A=h.tileID.toUnwrapped();this.transform.setProjection(f.projection);const k=(R=h.tileID,O=f.getProjection(),B=this.transform,O.name===this.projection?B.calculateProjMatrix(R.toUnwrapped()):yn(B,O,R));var R,O,B;const F=y.get("text-pitch-alignment")==="map",I=y.get("text-rotation-alignment")==="map";o.compileFilter();const L=o.dynamicFilter(),N=o.dynamicFilterNeedsFeature(),j=this.transform.calculatePixelsToTileUnitsMatrix(h),K=Mr(k,h.tileID.canonical,F,I,this.transform,f.getProjection(),j);let J=null;if(F){const te=Ht(k,h.tileID.canonical,F,I,this.transform,f.getProjection(),j);J=a.multiply([],this.transform.labelPlaneMatrix,te)}let Y=null;L&&h.latestFeatureIndex&&(Y={unwrappedTileID:A,dynamicFilter:L,dynamicFilterNeedsFeature:N,featureIndex:h.latestFeatureIndex}),this.retainedQueryData[f.bucketInstanceId]=new Ca(f.bucketInstanceId,g,f.sourceLayerIndex,f.index,h.tileID);const ie={bucket:f,layout:y,posMatrix:k,textLabelPlaneMatrix:K,labelToScreenMatrix:J,clippingData:Y,scale:E,textPixelRatio:T,holdingForFade:h.holdingForFade(),collisionBoxArray:v,partiallyEvaluatedTextSize:a.evaluateSizeForZoom(f.textSizeData,this.transform.zoom),partiallyEvaluatedIconSize:a.evaluateSizeForZoom(f.iconSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(f.sourceID)};if(d)for(const te of f.sortKeyRanges){const{sortKey:le,symbolInstanceStart:Te,symbolInstanceEnd:oe}=te;r.push({sortKey:le,symbolInstanceStart:Te,symbolInstanceEnd:oe,parameters:ie})}else r.push({symbolInstanceStart:0,symbolInstanceEnd:f.symbolInstances.length,parameters:ie})}attemptAnchorPlacement(r,o,h,d,f,g,y,v,E,T,A,k,R,O,B,F,I,L){const{textOffset0:N,textOffset1:j,crossTileID:K}=k,J=[N,j],Y=Ro(r,h,d,J,f),ie=this.collisionIndex.placeCollisionBox(O,f,o,Bo(Y.x,Y.y,g,y,this.transform.angle),A,v,E,T.predicate);if(F){const te=O.getSymbolInstanceIconSize(L,this.transform.zoom,k.placedIconSymbolIndex);if(this.collisionIndex.placeCollisionBox(O,te,F,Bo(Y.x,Y.y,g,y,this.transform.angle),A,v,E,T.predicate).box.length===0)return}if(ie.box.length>0){let te;return this.prevPlacement&&this.prevPlacement.variableOffsets[K]&&this.prevPlacement.placements[K]&&this.prevPlacement.placements[K].text&&(te=this.prevPlacement.variableOffsets[K].anchor),this.variableOffsets[K]={textOffset:J,width:h,height:d,anchor:r,textScale:f,prevAnchor:te},this.markUsedJustification(O,r,k,B),O.allowVerticalPlacement&&(this.markUsedOrientation(O,B,k),this.placedOrientations[K]=B),{shift:Y,placedGlyphBoxes:ie}}}placeLayerBucketPart(r,o,h,d){const{bucket:f,layout:g,posMatrix:y,textLabelPlaneMatrix:v,labelToScreenMatrix:E,clippingData:T,textPixelRatio:A,holdingForFade:k,collisionBoxArray:R,partiallyEvaluatedTextSize:O,partiallyEvaluatedIconSize:B,collisionGroup:F}=r.parameters,I=g.get("text-optional"),L=g.get("icon-optional"),N=g.get("text-allow-overlap"),j=g.get("icon-allow-overlap"),K=g.get("text-rotation-alignment")==="map",J=g.get("text-pitch-alignment")==="map",Y=g.get("icon-text-fit")!=="none",ie=g.get("symbol-z-order")==="viewport-y";this.transform.setProjection(f.projection);let te=N&&(j||!f.hasIconData()||L),le=j&&(N||!f.hasTextData()||I);!f.collisionArrays&&R&&f.deserializeCollisionBoxes(R),h&&d&&f.updateCollisionDebugBuffers(this.transform.zoom,R);const Te=(oe,ge,he)=>{const{crossTileID:we,numVerticalGlyphVertices:ae}=oe;if(T){const Ft={zoom:this.transform.zoom,pitch:this.transform.pitch};let Mt=null;if(T.dynamicFilterNeedsFeature){const yt=this.retainedQueryData[f.bucketInstanceId];Mt=T.featureIndex.loadFeature({featureIndex:oe.featureIndex,bucketIndex:yt.bucketIndex,sourceLayerIndex:yt.sourceLayerIndex,layoutVertexArrayOffset:0})}if(!(0,T.dynamicFilter)(Ft,Mt,this.retainedQueryData[f.bucketInstanceId].tileID.canonical,new a.Point(oe.tileAnchorX,oe.tileAnchorY),this.transform.calculateDistanceTileData(T.unwrappedTileID)))return this.placements[we]=new Do(!1,!1,!1,!0),void o.add(we)}if(o.has(we))return;if(k)return void(this.placements[we]=new Do(!1,!1,!1));let _e=!1,Me=!1,ve=!0,Ae=!1,Ge=!1,Xe=null,Ve={box:null,offscreen:null,occluded:null},qe={box:null,offscreen:null,occluded:null},lt=null,ot=null,je=null,wt=0,Tt=0,Et=0;he.textFeatureIndex?wt=he.textFeatureIndex:oe.useRuntimeCollisionCircles&&(wt=oe.featureIndex),he.verticalTextFeatureIndex&&(Tt=he.verticalTextFeatureIndex);const St=Ft=>{Ft.tileID=this.retainedQueryData[f.bucketInstanceId].tileID;const Mt=this.transform.elevation;(Mt||Ft.elevation)&&(Ft.elevation=Mt?Mt.getAtTileOffset(Ft.tileID,Ft.tileAnchorX,Ft.tileAnchorY):0)},vi=he.textBox;if(vi){St(vi);const Ft=yt=>{let Kt=a.WritingMode.horizontal;if(f.allowVerticalPlacement&&!yt&&this.prevPlacement){const Ei=this.prevPlacement.placedOrientations[we];Ei&&(this.placedOrientations[we]=Ei,Kt=Ei,this.markUsedOrientation(f,Kt,oe))}return Kt},Mt=(yt,Kt)=>{if(f.allowVerticalPlacement&&ae>0&&he.verticalTextBox){for(const Ei of f.writingModes)if(Ei===a.WritingMode.vertical?(Ve=Kt(),qe=Ve):Ve=yt(),Ve&&Ve.box&&Ve.box.length)break}else Ve=yt()};if(g.get("text-variable-anchor")){let yt=g.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[we]){const Bt=this.prevPlacement.variableOffsets[we];yt.indexOf(Bt.anchor)>0&&(yt=yt.filter(Ii=>Ii!==Bt.anchor),yt.unshift(Bt.anchor))}const Kt=(Bt,Ii,Js)=>{const Mn=f.getSymbolInstanceTextSize(O,oe,this.transform.zoom,ge),is=(Bt.x2-Bt.x1)*Mn+2*Bt.padding,Lr=(Bt.y2-Bt.y1)*Mn+2*Bt.padding,Jr=Y&&!j?Ii:null;Jr&&St(Jr);let An={box:[],offscreen:!1,occluded:!1};const Qs=N?2*yt.length:yt.length;for(let rs=0;rs=yt.length,oe,ge,f,Js,Jr,O,B);if(xl&&(An=xl.placedGlyphBoxes,An&&An.box&&An.box.length)){_e=!0,Xe=xl.shift;break}}return An};Mt(()=>Kt(vi,he.iconBox,a.WritingMode.horizontal),()=>{const Bt=he.verticalTextBox;return Bt&&St(Bt),f.allowVerticalPlacement&&!(Ve&&Ve.box&&Ve.box.length)&&ae>0&&Bt?Kt(Bt,he.verticalIconBox,a.WritingMode.vertical):{box:null,offscreen:null,occluded:null}}),Ve&&(_e=Ve.box,ve=Ve.offscreen,Ae=Ve.occluded);const Ei=Ft(!(!Ve||!Ve.box));if(!_e&&this.prevPlacement){const Bt=this.prevPlacement.variableOffsets[we];Bt&&(this.variableOffsets[we]=Bt,this.markUsedJustification(f,Bt.anchor,oe,Ei))}}else{const yt=(Kt,Ei)=>{const Bt=f.getSymbolInstanceTextSize(O,oe,this.transform.zoom,ge),Ii=this.collisionIndex.placeCollisionBox(f,Bt,Kt,new a.Point(0,0),N,A,y,F.predicate);return Ii&&Ii.box&&Ii.box.length&&(this.markUsedOrientation(f,Ei,oe),this.placedOrientations[we]=Ei),Ii};Mt(()=>yt(vi,a.WritingMode.horizontal),()=>{const Kt=he.verticalTextBox;return f.allowVerticalPlacement&&ae>0&&Kt?(St(Kt),yt(Kt,a.WritingMode.vertical)):{box:null,offscreen:null,occluded:null}}),Ft(!!(Ve&&Ve.box&&Ve.box.length))}}if(lt=Ve,_e=lt&<.box&<.box.length>0,ve=lt&<.offscreen,Ae=lt&<.occluded,oe.useRuntimeCollisionCircles){const Ft=f.text.placedSymbolArray.get(oe.centerJustifiedTextSymbolIndex>=0?oe.centerJustifiedTextSymbolIndex:oe.verticalPlacedTextSymbolIndex),Mt=a.evaluateSizeForFeature(f.textSizeData,O,Ft),yt=g.get("text-padding");ot=this.collisionIndex.placeCollisionCircles(f,N,Ft,f.lineVertexArray,f.glyphOffsetArray,Mt,y,v,E,h,J,F.predicate,oe.collisionCircleDiameter*Mt/a.ONE_EM,yt,this.retainedQueryData[f.bucketInstanceId].tileID),_e=N||ot.circles.length>0&&!ot.collisionDetected,ve=ve&&ot.offscreen,Ae=ot.occluded}if(he.iconFeatureIndex&&(Et=he.iconFeatureIndex),he.iconBox){const Ft=Mt=>{St(Mt);const yt=Y&&Xe?Bo(Xe.x,Xe.y,K,J,this.transform.angle):new a.Point(0,0),Kt=f.getSymbolInstanceIconSize(B,this.transform.zoom,oe.placedIconSymbolIndex);return this.collisionIndex.placeCollisionBox(f,Kt,Mt,yt,j,A,y,F.predicate)};qe&&qe.box&&qe.box.length&&he.verticalIconBox?(je=Ft(he.verticalIconBox),Me=je.box.length>0):(je=Ft(he.iconBox),Me=je.box.length>0),ve=ve&&je.offscreen,Ge=je.occluded}const ui=I||oe.numHorizontalGlyphVertices===0&&ae===0,Zi=L||oe.numIconVertices===0;if(ui||Zi?Zi?ui||(Me=Me&&_e):_e=Me&&_e:Me=_e=Me&&_e,_e&<&<.box&&this.collisionIndex.insertCollisionBox(lt.box,g.get("text-ignore-placement"),f.bucketInstanceId,qe&&qe.box&&Tt?Tt:wt,F.ID),Me&&je&&this.collisionIndex.insertCollisionBox(je.box,g.get("icon-ignore-placement"),f.bucketInstanceId,Et,F.ID),ot&&(_e&&this.collisionIndex.insertCollisionCircles(ot.circles,g.get("text-ignore-placement"),f.bucketInstanceId,wt,F.ID),h)){const Ft=f.bucketInstanceId;let Mt=this.collisionCircleArrays[Ft];Mt===void 0&&(Mt=this.collisionCircleArrays[Ft]=new Lo);for(let yt=0;yt=0;--ge){const he=oe[ge];Te(f.symbolInstances.get(he),he,f.collisionArrays[he])}}else for(let oe=r.symbolInstanceStart;oe=0&&(r.text.placedSymbolArray.get(f).crossTileID=A>=0&&f!==A?0:E),g>=0&&(r.text.placedSymbolArray.get(g).crossTileID=A>=0&&g!==A?0:E),y>=0&&(r.text.placedSymbolArray.get(y).crossTileID=A>=0&&y!==A?0:E),v>=0&&(r.text.placedSymbolArray.get(v).crossTileID=A>=0&&v!==A?0:E)}markUsedOrientation(r,o,h){const d=o===a.WritingMode.horizontal||o===a.WritingMode.horizontalOnly?o:0,f=o===a.WritingMode.vertical?o:0,{leftJustifiedTextSymbolIndex:g,centerJustifiedTextSymbolIndex:y,rightJustifiedTextSymbolIndex:v,verticalPlacedTextSymbolIndex:E}=h,T=r.text.placedSymbolArray;g>=0&&(T.get(g).placedOrientation=d),y>=0&&(T.get(y).placedOrientation=d),v>=0&&(T.get(v).placedOrientation=d),E>=0&&(T.get(E).placedOrientation=f)}commit(r){this.commitTime=r,this.zoomAtLastRecencyCheck=this.transform.zoom;const o=this.prevPlacement;let h=!1;this.prevZoomAdjustment=o?o.zoomAdjustment(this.transform.zoom):0;const d=o?o.symbolFadeChange(r):1,f=o?o.opacities:{},g=o?o.variableOffsets:{},y=o?o.placedOrientations:{};for(const v in this.placements){const E=this.placements[v],T=f[v];T?(this.opacities[v]=new Ar(T,d,E.text,E.icon,null,E.clipped),h=h||E.text!==T.text.placed||E.icon!==T.icon.placed):(this.opacities[v]=new Ar(null,d,E.text,E.icon,E.skipFade,E.clipped),h=h||E.text||E.icon)}for(const v in f){const E=f[v];if(!this.opacities[v]){const T=new Ar(E,d,!1,!1);T.isHidden()||(this.opacities[v]=T,h=h||E.text.placed||E.icon.placed)}}for(const v in g)this.variableOffsets[v]||!this.opacities[v]||this.opacities[v].isHidden()||(this.variableOffsets[v]=g[v]);for(const v in y)this.placedOrientations[v]||!this.opacities[v]||this.opacities[v].isHidden()||(this.placedOrientations[v]=y[v]);h?this.lastPlacementChangeTime=r:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=o?o.lastPlacementChangeTime:r)}updateLayerOpacities(r,o){const h=new Set;for(const d of o){const f=d.getBucket(r);f&&d.latestFeatureIndex&&r.id===f.layerIds[0]&&this.updateBucketOpacities(f,h,d.collisionBoxArray)}}updateBucketOpacities(r,o,h){r.hasTextData()&&r.text.opacityVertexArray.clear(),r.hasIconData()&&r.icon.opacityVertexArray.clear(),r.hasIconCollisionBoxData()&&r.iconCollisionBox.collisionVertexArray.clear(),r.hasTextCollisionBoxData()&&r.textCollisionBox.collisionVertexArray.clear();const d=r.layers[0].layout,f=!!r.layers[0].dynamicFilter(),g=new Ar(null,0,!1,!1,!0),y=d.get("text-allow-overlap"),v=d.get("icon-allow-overlap"),E=d.get("text-variable-anchor"),T=d.get("text-rotation-alignment")==="map",A=d.get("text-pitch-alignment")==="map",k=d.get("icon-text-fit")!=="none",R=new Ar(null,0,y&&(v||!r.hasIconData()||d.get("icon-optional")),v&&(y||!r.hasTextData()||d.get("text-optional")),!0);!r.collisionArrays&&h&&(r.hasIconCollisionBoxData()||r.hasTextCollisionBoxData())&&r.deserializeCollisionBoxes(h);const O=(F,I,L)=>{for(let N=0;N0||N>0,te=K>0,le=this.placedOrientations[j],Te=le===a.WritingMode.vertical,oe=le===a.WritingMode.horizontal||le===a.WritingMode.horizontalOnly;if(!ie&&!te||Y.isHidden()||B++,ie){const ge=Oo(Y.text);O(r.text,L,Te?Gt:ge),O(r.text,N,oe?Gt:ge);const he=Y.text.isHidden(),{leftJustifiedTextSymbolIndex:we,centerJustifiedTextSymbolIndex:ae,rightJustifiedTextSymbolIndex:_e,verticalPlacedTextSymbolIndex:Me}=I,ve=r.text.placedSymbolArray,Ae=he||Te?1:0;we>=0&&(ve.get(we).hidden=Ae),ae>=0&&(ve.get(ae).hidden=Ae),_e>=0&&(ve.get(_e).hidden=Ae),Me>=0&&(ve.get(Me).hidden=he||oe?1:0);const Ge=this.variableOffsets[j];Ge&&this.markUsedJustification(r,Ge.anchor,I,le);const Xe=this.placedOrientations[j];Xe&&(this.markUsedJustification(r,"left",I,Xe),this.markUsedOrientation(r,Xe,I))}if(te){const ge=Oo(Y.icon),{placedIconSymbolIndex:he,verticalPlacedIconSymbolIndex:we}=I,ae=r.icon.placedSymbolArray,_e=Y.icon.isHidden()?1:0;he>=0&&(O(r.icon,K,Te?Gt:ge),ae.get(he).hidden=_e),we>=0&&(O(r.icon,I.numVerticalIconVertices,oe?Gt:ge),ae.get(we).hidden=_e)}if(r.hasIconCollisionBoxData()||r.hasTextCollisionBoxData()){const ge=r.collisionArrays[F];if(ge){let he=new a.Point(0,0),we=!0;if(ge.textBox||ge.verticalTextBox){if(E){const _e=this.variableOffsets[j];_e?(he=Ro(_e.anchor,_e.width,_e.height,_e.textOffset,_e.textScale),T&&he._rotate(A?this.transform.angle:-this.transform.angle)):we=!1}f&&(we=!Y.clipped),ge.textBox&&Wn(r.textCollisionBox.collisionVertexArray,Y.text.placed,!we||Te,he.x,he.y),ge.verticalTextBox&&Wn(r.textCollisionBox.collisionVertexArray,Y.text.placed,!we||oe,he.x,he.y)}const ae=we&&!!(!oe&&ge.verticalIconBox);ge.iconBox&&Wn(r.iconCollisionBox.collisionVertexArray,Y.icon.placed,ae,k?he.x:0,k?he.y:0),ge.verticalIconBox&&Wn(r.iconCollisionBox.collisionVertexArray,Y.icon.placed,!ae,k?he.x:0,k?he.y:0)}}}if(r.fullyClipped=B===0,r.sortFeatures(this.transform.angle),this.retainedQueryData[r.bucketInstanceId]&&(this.retainedQueryData[r.bucketInstanceId].featureSortOrder=r.featureSortOrder),r.hasTextData()&&r.text.opacityVertexBuffer&&r.text.opacityVertexBuffer.updateData(r.text.opacityVertexArray),r.hasIconData()&&r.icon.opacityVertexBuffer&&r.icon.opacityVertexBuffer.updateData(r.icon.opacityVertexArray),r.hasIconCollisionBoxData()&&r.iconCollisionBox.collisionVertexBuffer&&r.iconCollisionBox.collisionVertexBuffer.updateData(r.iconCollisionBox.collisionVertexArray),r.hasTextCollisionBoxData()&&r.textCollisionBox.collisionVertexBuffer&&r.textCollisionBox.collisionVertexBuffer.updateData(r.textCollisionBox.collisionVertexArray),r.bucketInstanceId in this.collisionCircleArrays){const F=this.collisionCircleArrays[r.bucketInstanceId];r.placementInvProjMatrix=F.invProjMatrix,r.placementViewportMatrix=F.viewportMatrix,r.collisionCircleArray=F.circles,delete this.collisionCircleArrays[r.bucketInstanceId]}}symbolFadeChange(r){return this.fadeDuration===0?1:(r-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(r){return Math.max(0,(this.transform.zoom-r)/1.5)}hasTransitions(r){return this.stale||r-this.lastPlacementChangeTimer}setStale(){this.stale=!0}}function Wn(l,r,o,h,d){l.emplaceBack(r?1:0,o?1:0,h||0,d||0),l.emplaceBack(r?1:0,o?1:0,h||0,d||0),l.emplaceBack(r?1:0,o?1:0,h||0,d||0),l.emplaceBack(r?1:0,o?1:0,h||0,d||0)}const Mi=Math.pow(2,25),Zt=Math.pow(2,24),za=Math.pow(2,17),Pa=Math.pow(2,16),Ai=Math.pow(2,9),ji=Math.pow(2,8),sc=Math.pow(2,1);function Oo(l){if(l.opacity===0&&!l.placed)return 0;if(l.opacity===1&&l.placed)return 4294967295;const r=l.placed?1:0,o=Math.floor(127*l.opacity);return o*Mi+r*Zt+o*za+r*Pa+o*Ai+r*ji+o*sc+r}const Gt=0;class Fo{constructor(r){this._sortAcrossTiles=r.layout.get("symbol-z-order")!=="viewport-y"&&r.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs=new Set,this._bucketParts=[]}continuePlacement(r,o,h,d,f){const g=this._bucketParts;for(;this._currentTileIndexy.sortKey-v.sortKey));this._currentPartIndex{const g=a.exported.now()-d;return!this._forceFullPlacement&&g>2};for(;this._currentPlacementIndex>=0;){const g=o[r[this._currentPlacementIndex]],y=this.placement.collisionIndex.transform.zoom;if(g.type==="symbol"&&(!g.minzoom||g.minzoom<=y)&&(!g.maxzoom||g.maxzoom>y)){if(this._inProgressLayer||(this._inProgressLayer=new Fo(g)),this._inProgressLayer.continuePlacement(h[g.source],this.placement,this._showCollisionBoxes,g,f))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(r){return this.placement.commit(r),this.placement}}const xn=512/a.EXTENT/2;class fi{constructor(r,o,h){this.tileID=r,this.bucketInstanceId=h,this.index=new a.KDBush(o.length,16,Int32Array),this.keys=[],this.crossTileIDs=[];const d=r.canonical.x*a.EXTENT,f=r.canonical.y*a.EXTENT;for(let g=0;gr.overscaledZ)for(const y in g){const v=g[y];v.tileID.isChildOf(r)&&v.findMatches(o.symbolInstances,r,d)}else{const y=g[r.scaledTo(Number(f)).key];y&&y.findMatches(o.symbolInstances,r,d)}}for(let f=0;f{o[h]=!0});for(const h in this.layerIndexes)o[h]||delete this.layerIndexes[h]}}const Kr=(l,r)=>a.emitValidationErrors(l,r&&r.filter(o=>o.identifier!=="source.canvas")),Ms=a.pick(vt,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setTerrain","setFog","setProjection"]),Ih=a.pick(vt,["setCenter","setZoom","setBearing","setPitch"]),Ra={version:8,layers:[],sources:{}},Xn={fill:!0,line:!0,background:!0,hillshade:!0,raster:!0};class cr extends a.Evented{constructor(r,o={}){super(),this.map=r,this.dispatcher=new oi(Zn(),this),this.imageManager=new wa,this.imageManager.setEventedParent(this),this.glyphManager=new a.GlyphManager(r._requestManager,o.localFontFamily?a.LocalGlyphMode.all:o.localIdeographFontFamily?a.LocalGlyphMode.ideographs:a.LocalGlyphMode.none,o.localFontFamily||o.localIdeographFontFamily),this.crossTileSymbolIndex=new Ir,this._layers={},this._num3DLayers=0,this._numSymbolLayers=0,this._numCircleLayers=0,this._serializedLayers={},this._sourceCaches={},this._otherSourceCaches={},this._symbolSourceCaches={},this._loaded=!1,this._availableImages=[],this._order=[],this._drapedFirstOrder=[],this._markersNeedUpdate=!1,this._resetUpdates(),this.dispatcher.broadcast("setReferrer",a.getReferrer());const h=this;this._rtlTextPluginCallback=cr.registerForPluginStateChange(d=>{h.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:d.pluginStatus,pluginURL:d.pluginURL},(f,g)=>{if(a.triggerPluginCompletionEvent(f),g&&g.every(y=>y))for(const y in h._sourceCaches){const v=h._sourceCaches[y],E=v.getSource().type;E!=="vector"&&E!=="geojson"||v.reload()}})}),this.on("data",d=>{if(d.dataType!=="source"||d.sourceDataType!=="metadata")return;const f=this.getSource(d.sourceId);if(f&&f.vectorLayerIds)for(const g in this._layers){const y=this._layers[g];y.source===f.id&&this._validateLayer(y)}})}loadURL(r,o={}){this.fire(new a.Event("dataloading",{dataType:"style"}));const h=typeof o.validate=="boolean"?o.validate:!a.isMapboxURL(r);r=this.map._requestManager.normalizeStyleURL(r,o.accessToken);const d=this.map._requestManager.transformRequest(r,a.ResourceType.Style);this._request=a.getJSON(d,(f,g)=>{this._request=null,f?this.fire(new a.ErrorEvent(f)):g&&this._load(g,h)})}loadJSON(r,o={}){this.fire(new a.Event("dataloading",{dataType:"style"})),this._request=a.exported.frame(()=>{this._request=null,this._load(r,o.validate!==!1)})}loadEmpty(){this.fire(new a.Event("dataloading",{dataType:"style"})),this._load(Ra,!1)}_updateLayerCount(r,o){const h=o?1:-1;r.is3D()&&(this._num3DLayers+=h),r.type==="circle"&&(this._numCircleLayers+=h),r.type==="symbol"&&(this._numSymbolLayers+=h)}_load(r,o){if(o&&Kr(this,a.validateStyle(r)))return;this._loaded=!0,this.stylesheet=a.clone$1(r),this._updateMapProjection();for(const d in r.sources)this.addSource(d,r.sources[d],{validate:!1});this._changed=!1,r.sprite?this._loadSprite(r.sprite):(this.imageManager.setLoaded(!0),this.dispatcher.broadcast("spriteLoaded",!0)),this.glyphManager.setURL(r.glyphs);const h=tc(this.stylesheet.layers);this._order=h.map(d=>d.id),this._layers={},this._serializedLayers={};for(const d of h){const f=a.createStyleLayer(d);f.setEventedParent(this,{layer:{id:f.id}}),this._layers[f.id]=f,this._serializedLayers[f.id]=f.serialize(),this._updateLayerCount(f,!0)}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new si(this.stylesheet.light),this.stylesheet.terrain&&!this.terrainSetForDrapingOnly()&&this._createTerrain(this.stylesheet.terrain,1),this.stylesheet.fog&&this._createFog(this.stylesheet.fog),this._updateDrapeFirstLayers(),this.fire(new a.Event("data",{dataType:"style"})),this.fire(new a.Event("style.load"))}terrainSetForDrapingOnly(){return!!this.terrain&&this.terrain.drapeRenderMode===0}setProjection(r){r?this.stylesheet.projection=r:delete this.stylesheet.projection,this._updateMapProjection()}applyProjectionUpdate(){this._loaded&&(this.dispatcher.broadcast("setProjection",this.map.transform.projectionOptions),this.map.transform.projection.requiresDraping?this.getTerrain()||this.stylesheet.terrain||this.setTerrainForDraping():this.terrainSetForDrapingOnly()&&this.setTerrain(null))}_updateMapProjection(){this.map._useExplicitProjection?this.applyProjectionUpdate():this.map._prioritizeAndUpdateProjection(null,this.stylesheet.projection)}_loadSprite(r){this._spriteRequest=function(o,h,d){let f,g,y;const v=a.exported.devicePixelRatio>1?"@2x":"";let E=a.getJSON(h.transformRequest(h.normalizeSpriteURL(o,v,".json"),a.ResourceType.SpriteJSON),(k,R)=>{E=null,y||(y=k,f=R,A())}),T=a.getImage(h.transformRequest(h.normalizeSpriteURL(o,v,".png"),a.ResourceType.SpriteImage),(k,R)=>{T=null,y||(y=k,g=R,A())});function A(){if(y)d(y);else if(f&&g){const k=a.exported.getImageData(g),R={};for(const O in f){const{width:B,height:F,x:I,y:L,sdf:N,pixelRatio:j,stretchX:K,stretchY:J,content:Y}=f[O],ie=new a.RGBAImage({width:B,height:F});a.RGBAImage.copy(k,ie,{x:I,y:L},{x:0,y:0},{width:B,height:F}),R[O]={data:ie,pixelRatio:j,sdf:N,stretchX:K,stretchY:J,content:Y}}d(null,R)}}return{cancel(){E&&(E.cancel(),E=null),T&&(T.cancel(),T=null)}}}(r,this.map._requestManager,(o,h)=>{if(this._spriteRequest=null,o)this.fire(new a.ErrorEvent(o));else if(h)for(const d in h)this.imageManager.addImage(d,h[d]);this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),this.dispatcher.broadcast("setImages",this._availableImages),this.dispatcher.broadcast("spriteLoaded",!0),this.fire(new a.Event("data",{dataType:"style"}))})}_validateLayer(r){const o=this.getSource(r.source);if(!o)return;const h=r.sourceLayer;h&&(o.type==="geojson"||o.vectorLayerIds&&o.vectorLayerIds.indexOf(h)===-1)&&this.fire(new a.ErrorEvent(new Error(`Source layer "${h}" does not exist on source "${o.id}" as specified by style layer "${r.id}"`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const r in this._sourceCaches)if(!this._sourceCaches[r].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeLayers(r){const o=[];for(const h of r){const d=this._layers[h];d.type!=="custom"&&o.push(d.serialize())}return o}hasTransitions(){if(this.light&&this.light.hasTransition()||this.fog&&this.fog.hasTransition())return!0;for(const r in this._sourceCaches)if(this._sourceCaches[r].hasTransition())return!0;for(const r in this._layers)if(this._layers[r].hasTransition())return!0;return!1}get order(){return this.map._optimizeForTerrain&&this.terrain?this._drapedFirstOrder:this._order}isLayerDraped(r){return!!this.terrain&&(typeof r.isLayerDraped=="function"?r.isLayerDraped():Xn[r.type])}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading")}update(r){if(!this._loaded)return;const o=this._changed;if(this._changed){const d=Object.keys(this._updatedLayers),f=Object.keys(this._removedLayers);(d.length||f.length)&&this._updateWorkerLayers(d,f);for(const g in this._updatedSources){const y=this._updatedSources[g];y==="reload"?this._reloadSource(g):y==="clear"&&this._clearSource(g)}this._updateTilesForChangedImages();for(const g in this._updatedPaintProps)this._layers[g].updateTransitions(r);this.light.updateTransitions(r),this.fog&&this.fog.updateTransitions(r),this._resetUpdates()}const h={};for(const d in this._sourceCaches){const f=this._sourceCaches[d];h[d]=f.used,f.used=!1}for(const d of this._order){const f=this._layers[d];if(f.recalculate(r,this._availableImages),!f.isHidden(r.zoom)){const y=this._getLayerSourceCache(f);y&&(y.used=!0)}const g=this.map.painter;if(g){const y=f.getProgramIds();if(!y)continue;const v=f.getProgramConfiguration(r.zoom);for(const E of y)g.useProgram(E,v)}}for(const d in h){const f=this._sourceCaches[d];h[d]!==f.used&&f.getSource().fire(new a.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:f.getSource().id}))}this.light.recalculate(r),this.terrain&&this.terrain.recalculate(r),this.fog&&this.fog.recalculate(r),this.z=r.zoom,this._markersNeedUpdate&&(this._updateMarkersOpacity(),this._markersNeedUpdate=!1),o&&this.fire(new a.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){const r=Object.keys(this._changedImages);if(r.length){for(const o in this._sourceCaches)this._sourceCaches[o].reloadTilesForDependencies(["icons","patterns"],r);this._changedImages={}}}_updateWorkerLayers(r,o){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(r),removedIds:o})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}}setState(r){if(this._checkLoaded(),Kr(this,a.validateStyle(r)))return!1;(r=a.clone$1(r)).layers=tc(r.layers);const o=function(d,f){if(!d)return[{command:vt.setStyle,args:[f]}];let g=[];try{if(!Se(d.version,f.version))return[{command:vt.setStyle,args:[f]}];Se(d.center,f.center)||g.push({command:vt.setCenter,args:[f.center]}),Se(d.zoom,f.zoom)||g.push({command:vt.setZoom,args:[f.zoom]}),Se(d.bearing,f.bearing)||g.push({command:vt.setBearing,args:[f.bearing]}),Se(d.pitch,f.pitch)||g.push({command:vt.setPitch,args:[f.pitch]}),Se(d.sprite,f.sprite)||g.push({command:vt.setSprite,args:[f.sprite]}),Se(d.glyphs,f.glyphs)||g.push({command:vt.setGlyphs,args:[f.glyphs]}),Se(d.transition,f.transition)||g.push({command:vt.setTransition,args:[f.transition]}),Se(d.light,f.light)||g.push({command:vt.setLight,args:[f.light]}),Se(d.fog,f.fog)||g.push({command:vt.setFog,args:[f.fog]}),Se(d.projection,f.projection)||g.push({command:vt.setProjection,args:[f.projection]});const y={},v=[];(function(A,k,R,O){let B;for(B in k=k||{},A=A||{})A.hasOwnProperty(B)&&(k.hasOwnProperty(B)||zo(B,R,O));for(B in k){if(!k.hasOwnProperty(B))continue;const F=k[B];A.hasOwnProperty(B)?Se(A[B],F)||(A[B].type==="geojson"&&F.type==="geojson"&&Es(A,k,B)?R.push({command:vt.setGeoJSONSourceData,args:[B,F.data]}):Sa(B,k,R,O)):Ea(B,k,R)}})(d.sources,f.sources,v,y);const E=[];d.layers&&d.layers.forEach(A=>{A.source&&y[A.source]?g.push({command:vt.removeLayer,args:[A.id]}):E.push(A)});let T=d.terrain;T&&y[T.source]&&(g.push({command:vt.setTerrain,args:[void 0]}),T=void 0),g=g.concat(v),Se(T,f.terrain)||g.push({command:vt.setTerrain,args:[f.terrain]}),function(A,k,R){k=k||[];const O=(A=A||[]).map(Er),B=k.map(Er),F=A.reduce(Ma,{}),I=k.reduce(Ma,{}),L=O.slice(),N=Object.create(null);let j,K,J,Y,ie,te,le;for(j=0,K=0;j!(d.command in Ih));if(o.length===0)return!1;const h=o.filter(d=>!(d.command in Ms));if(h.length>0)throw new Error(`Unimplemented: ${h.map(d=>d.command).join(", ")}.`);return o.forEach(d=>{d.command!=="setTransition"&&d.command!=="setProjection"&&this[d.command].apply(this,d.args)}),this.stylesheet=r,this._updateMapProjection(),!0}addImage(r,o){return this.getImage(r)?this.fire(new a.ErrorEvent(new Error("An image with this name already exists."))):(this.imageManager.addImage(r,o),this._afterImageUpdated(r),this)}updateImage(r,o){this.imageManager.updateImage(r,o)}getImage(r){return this.imageManager.getImage(r)}removeImage(r){return this.getImage(r)?(this.imageManager.removeImage(r),this._afterImageUpdated(r),this):this.fire(new a.ErrorEvent(new Error("No image with this name exists.")))}_afterImageUpdated(r){this._availableImages=this.imageManager.listImages(),this._changedImages[r]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new a.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this._availableImages.slice()}addSource(r,o,h={}){if(this._checkLoaded(),this.getSource(r)!==void 0)throw new Error("There is already a source with this ID");if(!o.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(o).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(o.type)>=0&&this._validate(a.validateSource,`sources.${r}`,o,null,h))return;this.map&&this.map._collectResourceTiming&&(o.collectResourceTiming=!0);const d=nt(r,o,this.dispatcher,this);d.setEventedParent(this,()=>({isSourceLoaded:this._isSourceCacheLoaded(r),source:d.serialize(),sourceId:r}));const f=g=>{const y=(g?"symbol:":"other:")+r,v=this._sourceCaches[y]=new a.SourceCache(y,d,g);(g?this._symbolSourceCaches:this._otherSourceCaches)[r]=v,v.style=this,v.onAdd(this.map)};f(!1),o.type!=="vector"&&o.type!=="geojson"||f(!0),d.onAdd&&d.onAdd(this.map),this._changed=!0}removeSource(r){this._checkLoaded();const o=this.getSource(r);if(!o)throw new Error("There is no source with this ID");for(const d in this._layers)if(this._layers[d].source===r)return this.fire(new a.ErrorEvent(new Error(`Source "${r}" cannot be removed while layer "${d}" is using it.`)));if(this.terrain&&this.terrain.get().source===r)return this.fire(new a.ErrorEvent(new Error(`Source "${r}" cannot be removed while terrain is using it.`)));const h=this._getSourceCaches(r);for(const d of h)delete this._sourceCaches[d.id],delete this._updatedSources[d.id],d.fire(new a.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:d.getSource().id})),d.setEventedParent(null),d.clearTiles();return delete this._otherSourceCaches[r],delete this._symbolSourceCaches[r],o.setEventedParent(null),o.onRemove&&o.onRemove(this.map),this._changed=!0,this}setGeoJSONSourceData(r,o){this._checkLoaded(),this.getSource(r).setData(o),this._changed=!0}getSource(r){const o=this._getSourceCache(r);return o&&o.getSource()}_getSources(){const r=[];for(const o in this._otherSourceCaches){const h=this._getSourceCache(o);h&&r.push(h.getSource())}return r}addLayer(r,o,h={}){this._checkLoaded();const d=r.id;if(this.getLayer(d))return void this.fire(new a.ErrorEvent(new Error(`Layer with id "${d}" already exists on this map`)));let f;if(r.type==="custom"){if(Kr(this,a.validateCustomStyleLayer(r)))return;f=a.createStyleLayer(r)}else{if(typeof r.source=="object"&&(this.addSource(d,r.source),r=a.clone$1(r),r=a.extend(r,{source:d})),this._validate(a.validateLayer,`layers.${d}`,r,{arrayIndex:-1},h))return;f=a.createStyleLayer(r),this._validateLayer(f),f.setEventedParent(this,{layer:{id:d}}),this._serializedLayers[f.id]=f.serialize(),this._updateLayerCount(f,!0)}const g=o?this._order.indexOf(o):this._order.length;if(o&&g===-1)return void this.fire(new a.ErrorEvent(new Error(`Layer with id "${o}" does not exist on this map.`)));this._order.splice(g,0,d),this._layerOrderChanged=!0,this._layers[d]=f;const y=this._getLayerSourceCache(f);if(this._removedLayers[d]&&f.source&&y&&f.type!=="custom"){const v=this._removedLayers[d];delete this._removedLayers[d],v.type!==f.type?this._updatedSources[f.source]="clear":(this._updatedSources[f.source]="reload",y.pause())}this._updateLayer(f),f.onAdd&&f.onAdd(this.map),this._updateDrapeFirstLayers()}moveLayer(r,o){if(this._checkLoaded(),this._changed=!0,!this._layers[r])return void this.fire(new a.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style and cannot be moved.`)));if(r===o)return;const h=this._order.indexOf(r);this._order.splice(h,1);const d=o?this._order.indexOf(o):this._order.length;o&&d===-1?this.fire(new a.ErrorEvent(new Error(`Layer with id "${o}" does not exist on this map.`))):(this._order.splice(d,0,r),this._layerOrderChanged=!0,this._updateDrapeFirstLayers())}removeLayer(r){this._checkLoaded();const o=this._layers[r];if(!o)return void this.fire(new a.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style and cannot be removed.`)));o.setEventedParent(null),this._updateLayerCount(o,!1);const h=this._order.indexOf(r);this._order.splice(h,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[r]=o,delete this._layers[r],delete this._serializedLayers[r],delete this._updatedLayers[r],delete this._updatedPaintProps[r],o.onRemove&&o.onRemove(this.map),this._updateDrapeFirstLayers()}getLayer(r){return this._layers[r]}hasLayer(r){return r in this._layers}hasLayerType(r){for(const o in this._layers)if(this._layers[o].type===r)return!0;return!1}setLayerZoomRange(r,o,h){this._checkLoaded();const d=this.getLayer(r);d?d.minzoom===o&&d.maxzoom===h||(o!=null&&(d.minzoom=o),h!=null&&(d.maxzoom=h),this._updateLayer(d)):this.fire(new a.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style and cannot have zoom extent.`)))}setFilter(r,o,h={}){this._checkLoaded();const d=this.getLayer(r);if(d){if(!Se(d.filter,o))return o==null?(d.filter=void 0,void this._updateLayer(d)):void(this._validate(a.validateFilter,`layers.${d.id}.filter`,o,{layerType:d.type},h)||(d.filter=a.clone$1(o),this._updateLayer(d)))}else this.fire(new a.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style and cannot be filtered.`)))}getFilter(r){const o=this.getLayer(r);return o&&a.clone$1(o.filter)}setLayoutProperty(r,o,h,d={}){this._checkLoaded();const f=this.getLayer(r);f?Se(f.getLayoutProperty(o),h)||(f.setLayoutProperty(o,h,d),this._updateLayer(f)):this.fire(new a.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style and cannot be styled.`)))}getLayoutProperty(r,o){const h=this.getLayer(r);if(h)return h.getLayoutProperty(o);this.fire(new a.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style.`)))}setPaintProperty(r,o,h,d={}){this._checkLoaded();const f=this.getLayer(r);f?Se(f.getPaintProperty(o),h)||(f.setPaintProperty(o,h,d)&&this._updateLayer(f),this._changed=!0,this._updatedPaintProps[r]=!0):this.fire(new a.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style and cannot be styled.`)))}getPaintProperty(r,o){const h=this.getLayer(r);return h&&h.getPaintProperty(o)}setFeatureState(r,o){this._checkLoaded();const h=r.source,d=r.sourceLayer,f=this.getSource(h);if(!f)return void this.fire(new a.ErrorEvent(new Error(`The source '${h}' does not exist in the map's style.`)));const g=f.type;if(g==="geojson"&&d)return void this.fire(new a.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));if(g==="vector"&&!d)return void this.fire(new a.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));r.id===void 0&&this.fire(new a.ErrorEvent(new Error("The feature id parameter must be provided.")));const y=this._getSourceCaches(h);for(const v of y)v.setFeatureState(d,r.id,o)}removeFeatureState(r,o){this._checkLoaded();const h=r.source,d=this.getSource(h);if(!d)return void this.fire(new a.ErrorEvent(new Error(`The source '${h}' does not exist in the map's style.`)));const f=d.type,g=f==="vector"?r.sourceLayer:void 0;if(f==="vector"&&!g)return void this.fire(new a.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));if(o&&typeof r.id!="string"&&typeof r.id!="number")return void this.fire(new a.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));const y=this._getSourceCaches(h);for(const v of y)v.removeFeatureState(g,r.id,o)}getFeatureState(r){this._checkLoaded();const o=r.source,h=r.sourceLayer,d=this.getSource(o);if(d){if(d.type!=="vector"||h)return r.id===void 0&&this.fire(new a.ErrorEvent(new Error("The feature id parameter must be provided."))),this._getSourceCaches(o)[0].getFeatureState(h,r.id);this.fire(new a.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new a.ErrorEvent(new Error(`The source '${o}' does not exist in the map's style.`)))}getTransition(){return a.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){const r={};for(const o in this._sourceCaches){const h=this._sourceCaches[o].getSource();r[h.id]||(r[h.id]=h.serialize())}return a.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,terrain:this.getTerrain()||void 0,fog:this.stylesheet.fog,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,projection:this.stylesheet.projection,sources:r,layers:this._serializeLayers(this._order)},o=>o!==void 0)}_updateLayer(r){this._updatedLayers[r.id]=!0;const o=this._getLayerSourceCache(r);r.source&&!this._updatedSources[r.source]&&o&&o.getSource().type!=="raster"&&(this._updatedSources[r.source]="reload",o.pause()),this._changed=!0,r.invalidateCompiledFilter()}_flattenAndSortRenderedFeatures(r){const o=g=>this._layers[g].type==="fill-extrusion",h={},d=[];for(let g=this._order.length-1;g>=0;g--){const y=this._order[g];if(o(y)){h[y]=g;for(const v of r){const E=v[y];if(E)for(const T of E)d.push(T)}}}d.sort((g,y)=>y.intersectionZ-g.intersectionZ);const f=[];for(let g=this._order.length-1;g>=0;g--){const y=this._order[g];if(o(y))for(let v=d.length-1;v>=0;v--){const E=d[v].feature;if(h[E.layer.id]{const E=this.getLayer(v);return E&&E.is3D()}):this.has3DLayers(),y=$r.createFromScreenPoints(r,h);for(const v in this._sourceCaches){const E=this._sourceCaches[v].getSource().id;o.layers&&!d[E]||f.push(Vt(this._sourceCaches[v],this._layers,this._serializedLayers,y,o,h,g,!!this.map._showQueryGeometry))}return this.placement&&f.push(function(v,E,T,A,k,R,O){const B={},F=R.queryRenderedSymbols(A),I=[];for(const L of Object.keys(F).map(Number))I.push(O[L]);I.sort(yi);for(const L of I){const N=L.featureIndex.lookupSymbolFeatures(F[L.bucketInstanceId],E,L.bucketIndex,L.sourceLayerIndex,k.filter,k.layers,k.availableImages,v);for(const j in N){const K=B[j]=B[j]||[],J=N[j];J.sort((Y,ie)=>{const te=L.featureSortOrder;if(te){const le=te.indexOf(Y.featureIndex);return te.indexOf(ie.featureIndex)-le}return ie.featureIndex-Y.featureIndex});for(const Y of J)K.push(Y)}}for(const L in B)B[L].forEach(N=>{const j=N.feature,K=T(v[L]);if(!K)return;const J=K.getFeatureState(j.layer["source-layer"],j.id);j.source=j.layer.source,j.layer["source-layer"]&&(j.sourceLayer=j.layer["source-layer"]),j.state=J});return B}(this._layers,this._serializedLayers,this._getLayerSourceCache.bind(this),y.screenGeometry,o,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(f)}querySourceFeatures(r,o){o&&o.filter&&this._validate(a.validateFilter,"querySourceFeatures.filter",o.filter,null,o);const h=this._getSourceCaches(r);let d=[];for(const f of h)d=d.concat(Xt(f,o));return d}addSourceType(r,o,h){return cr.getSourceType(r)?h(new Error(`A source type called "${r}" already exists.`)):(cr.setSourceType(r,o),o.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:r,url:o.workerSourceURL},h):h(null,null))}getLight(){return this.light.getLight()}setLight(r,o={}){this._checkLoaded();const h=this.light.getLight();let d=!1;for(const g in r)if(!Se(r[g],h[g])){d=!0;break}if(!d)return;const f=this._setTransitionParameters({duration:300,delay:0});this.light.setLight(r,o),this.light.updateTransitions(f)}getTerrain(){return this.terrain&&this.terrain.drapeRenderMode===1?this.terrain.get():null}setTerrainForDraping(){this.setTerrain({source:"",exaggeration:0},0)}setTerrain(r,o=1){if(this._checkLoaded(),!r)return delete this.terrain,delete this.stylesheet.terrain,this.dispatcher.broadcast("enableTerrain",!1),this._force3DLayerUpdate(),void(this._markersNeedUpdate=!0);let h=r;if(o===1){if(typeof h.source=="object"){const d="terrain-dem-src";this.addSource(d,h.source),h=a.clone$1(h),h=a.extend(h,{source:d})}if(this._validate(a.validateTerrain,"terrain",h))return}if(!this.terrain||this.terrain&&o!==this.terrain.drapeRenderMode){if(!h)return;this._createTerrain(h,o)}else{const d=this.terrain,f=d.get();for(const g of Object.keys(a.spec.terrain))!h.hasOwnProperty(g)&&a.spec.terrain[g].default&&(h[g]=a.spec.terrain[g].default);for(const g in h)if(!Se(h[g],f[g])){d.set(h),this.stylesheet.terrain=h;const y=this._setTransitionParameters({duration:0});d.updateTransitions(y);break}}this._updateDrapeFirstLayers(),this._markersNeedUpdate=!0}_createFog(r){const o=this.fog=new On(r,this.map.transform);this.stylesheet.fog=r;const h=this._setTransitionParameters({duration:0});o.updateTransitions(h)}_updateMarkersOpacity(){this.map._markers.length!==0&&this.map._requestDomTask(()=>{for(const r of this.map._markers)r._evaluateOpacity()})}getFog(){return this.fog?this.fog.get():null}setFog(r){if(this._checkLoaded(),!r)return delete this.fog,delete this.stylesheet.fog,void(this._markersNeedUpdate=!0);if(this.fog){const o=this.fog,h=o.get();Object.keys(r).length===0&&o.set(r);for(const d in r)if(!Se(r[d],h[d])){o.set(r),this.stylesheet.fog=r;const f=this._setTransitionParameters({duration:0});o.updateTransitions(f);break}}else this._createFog(r);this._markersNeedUpdate=!0}_setTransitionParameters(r){return{now:a.exported.now(),transition:a.extend(r,this.stylesheet.transition)}}_updateDrapeFirstLayers(){if(!this.map._optimizeForTerrain||!this.terrain)return;const r=this._order.filter(h=>this.isLayerDraped(this._layers[h])),o=this._order.filter(h=>!this.isLayerDraped(this._layers[h]));this._drapedFirstOrder=[],this._drapedFirstOrder.push(...r),this._drapedFirstOrder.push(...o)}_createTerrain(r,o){const h=this.terrain=new gs(r,o);this.stylesheet.terrain=r,this.dispatcher.broadcast("enableTerrain",!this.terrainSetForDrapingOnly()),this._force3DLayerUpdate();const d=this._setTransitionParameters({duration:0});h.updateTransitions(d)}_force3DLayerUpdate(){for(const r in this._layers){const o=this._layers[r];o.type==="fill-extrusion"&&this._updateLayer(o)}}_forceSymbolLayerUpdate(){for(const r in this._layers){const o=this._layers[r];o.type==="symbol"&&this._updateLayer(o)}}_validate(r,o,h,d,f={}){return(!f||f.validate!==!1)&&Kr(this,r.call(a.validateStyle,a.extend({key:o,style:this.serialize(),value:h,styleSpec:a.spec},d)))}_remove(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),a.evented.off("pluginStateChange",this._rtlTextPluginCallback);for(const r in this._layers)this._layers[r].setEventedParent(null);for(const r in this._sourceCaches)this._sourceCaches[r].clearTiles(),this._sourceCaches[r].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()}_clearSource(r){const o=this._getSourceCaches(r);for(const h of o)h.clearTiles()}_reloadSource(r){const o=this._getSourceCaches(r);for(const h of o)h.resume(),h.reload()}_reloadSources(){for(const r of this._getSources())r.reload&&r.reload()}_updateSources(r){for(const o in this._sourceCaches)this._sourceCaches[o].update(r)}_generateCollisionBoxes(){for(const r in this._sourceCaches){const o=this._sourceCaches[r];o.resume(),o.reload()}}_updatePlacement(r,o,h,d,f=!1){let g=!1,y=!1;const v={};for(const E of this._order){const T=this._layers[E];if(T.type!=="symbol")continue;if(!v[T.source]){const k=this._getLayerSourceCache(T);if(!k)continue;v[T.source]=k.getRenderableIds(!0).map(R=>k.getTileByID(R)).sort((R,O)=>O.tileID.overscaledZ-R.tileID.overscaledZ||(R.tileID.isLessThan(O.tileID)?-1:1))}const A=this.crossTileSymbolIndex.addLayer(T,v[T.source],r.center.lng,r.projection);g=g||A}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),f=f||this._layerOrderChanged||h===0,this._layerOrderChanged&&this.fire(new a.Event("neworder")),(f||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(a.exported.now(),r.zoom))&&(this.pauseablePlacement=new ka(r,this._order,f,o,h,d,this.placement,this.fog&&r.projection.supportsFog?this.fog.state:null),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,v),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(a.exported.now()),y=!0),g&&this.pauseablePlacement.placement.setStale()),y||g)for(const E of this._order){const T=this._layers[E];T.type==="symbol"&&this.placement.updateLayerOpacities(T,v[T.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(a.exported.now())}_releaseSymbolFadeTiles(){for(const r in this._sourceCaches)this._sourceCaches[r].releaseSymbolFadeTiles()}getImages(r,o,h){this.imageManager.getImages(o.icons,h),this._updateTilesForChangedImages();const d=f=>{f&&f.setDependencies(o.tileID.key,o.type,o.icons)};d(this._otherSourceCaches[o.source]),d(this._symbolSourceCaches[o.source])}getGlyphs(r,o,h){this.glyphManager.getGlyphs(o.stacks,h)}getResource(r,o,h){return a.makeRequest(o,h)}_getSourceCache(r){return this._otherSourceCaches[r]}_getLayerSourceCache(r){return r.type==="symbol"?this._symbolSourceCaches[r.source]:this._otherSourceCaches[r.source]}_getSourceCaches(r){const o=[];return this._otherSourceCaches[r]&&o.push(this._otherSourceCaches[r]),this._symbolSourceCaches[r]&&o.push(this._symbolSourceCaches[r]),o}_isSourceCacheLoaded(r){const o=this._getSourceCaches(r);return o.length===0?(this.fire(new a.ErrorEvent(new Error(`There is no source with ID '${r}'`))),!1):o.every(h=>h.loaded())}has3DLayers(){return this._num3DLayers>0}hasSymbolLayers(){return this._numSymbolLayers>0}hasCircleLayers(){return this._numCircleLayers>0}_clearWorkerCaches(){this.dispatcher.broadcast("clearCaches")}destroy(){this._clearWorkerCaches(),this.terrainSetForDrapingOnly()&&(delete this.terrain,delete this.stylesheet.terrain)}}cr.getSourceType=function(l){return Qe[l]},cr.setSourceType=function(l,r){Qe[l]=r},cr.registerForPluginStateChange=a.registerForPluginStateChange;var Ba=` -#define EPSILON 0.0000001 -#define PI 3.141592653589793 -#define EXTENT 8192.0 -#define HALF_PI PI/2.0 -#define QUARTER_PI PI/4.0 -#define RAD_TO_DEG 180.0/PI -#define DEG_TO_RAD PI/180.0 -#define GLOBE_RADIUS EXTENT/PI/2.0`,vn="attribute highp vec3 a_pos_3f;uniform lowp mat4 u_matrix;varying highp vec3 v_uv;void main() {const mat3 half_neg_pi_around_x=mat3(1.0,0.0, 0.0,0.0,0.0,-1.0,0.0,1.0, 0.0);v_uv=half_neg_pi_around_x*a_pos_3f;vec4 pos=u_matrix*vec4(a_pos_3f,1.0);gl_Position=pos.xyww;}",Cr=` -#define ELEVATION_SCALE 7.0 -#define ELEVATION_OFFSET 450.0 -#ifdef PROJECTION_GLOBE_VIEW -uniform vec3 u_tile_tl_up;uniform vec3 u_tile_tr_up;uniform vec3 u_tile_br_up;uniform vec3 u_tile_bl_up;uniform float u_tile_up_scale;vec3 elevationVector(vec2 pos) {vec2 uv=pos/EXTENT;vec3 up=normalize(mix( -mix(u_tile_tl_up,u_tile_tr_up,uv.xxx),mix(u_tile_bl_up,u_tile_br_up,uv.xxx),uv.yyy));return up*u_tile_up_scale;} -#else -vec3 elevationVector(vec2 pos) { return vec3(0,0,1); } -#endif -const float skirtOffset=24575.0;vec3 decomposeToPosAndSkirt(vec2 posWithComposedSkirt) -{float skirt=float(posWithComposedSkirt.x >=skirtOffset);vec2 pos=posWithComposedSkirt-vec2(skirt*skirtOffset,0.0);return vec3(pos,skirt);} -#ifdef TERRAIN -#ifdef TERRAIN_DEM_FLOAT_FORMAT -uniform highp sampler2D u_dem;uniform highp sampler2D u_dem_prev; -#else -uniform sampler2D u_dem;uniform sampler2D u_dem_prev; -#endif -uniform vec4 u_dem_unpack;uniform vec2 u_dem_tl;uniform vec2 u_dem_tl_prev;uniform float u_dem_scale;uniform float u_dem_scale_prev;uniform float u_dem_size;uniform float u_dem_lerp;uniform float u_exaggeration;uniform float u_meter_to_dem;uniform mat4 u_label_plane_matrix_inv;uniform sampler2D u_depth;uniform vec2 u_depth_size_inv;vec4 tileUvToDemSample(vec2 uv,float dem_size,float dem_scale,vec2 dem_tl) {vec2 pos=dem_size*(uv*dem_scale+dem_tl)+1.0;vec2 f=fract(pos);return vec4((pos-f+0.5)/(dem_size+2.0),f);}float decodeElevation(vec4 v) {return dot(vec4(v.xyz*255.0,-1.0),u_dem_unpack);}float currentElevation(vec2 apos) { -#ifdef TERRAIN_DEM_FLOAT_FORMAT -vec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale+u_dem_tl)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture2D(u_dem,pos).a; -#else -float dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale,u_dem_tl);vec2 pos=r.xy;vec2 f=r.zw;float tl=decodeElevation(texture2D(u_dem,pos)); -#ifdef TERRAIN_DEM_NEAREST_FILTER -return u_exaggeration*tl; -#endif -float tr=decodeElevation(texture2D(u_dem,pos+vec2(dd,0.0)));float bl=decodeElevation(texture2D(u_dem,pos+vec2(0.0,dd)));float br=decodeElevation(texture2D(u_dem,pos+vec2(dd,dd)));return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y); -#endif -}float prevElevation(vec2 apos) { -#ifdef TERRAIN_DEM_FLOAT_FORMAT -vec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale_prev+u_dem_tl_prev)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture2D(u_dem_prev,pos).a; -#else -float dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale_prev,u_dem_tl_prev);vec2 pos=r.xy;vec2 f=r.zw;float tl=decodeElevation(texture2D(u_dem_prev,pos));float tr=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,0.0)));float bl=decodeElevation(texture2D(u_dem_prev,pos+vec2(0.0,dd)));float br=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,dd)));return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y); -#endif -} -#ifdef TERRAIN_VERTEX_MORPHING -float elevation(vec2 apos) { -#ifdef ZERO_EXAGGERATION -return 0.0; -#endif -float nextElevation=currentElevation(apos);float prevElevation=prevElevation(apos);return mix(prevElevation,nextElevation,u_dem_lerp);} -#else -float elevation(vec2 apos) { -#ifdef ZERO_EXAGGERATION -return 0.0; -#endif -return currentElevation(apos);} -#endif -highp float unpack_depth(highp vec4 rgba_depth) -{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}bool isOccluded(vec4 frag) {vec3 coord=frag.xyz/frag.w;float depth=unpack_depth(texture2D(u_depth,(coord.xy+1.0)*0.5));return coord.z > depth+0.0005;}float occlusionFade(vec4 frag) {vec3 coord=frag.xyz/frag.w;vec3 df=vec3(5.0*u_depth_size_inv,0.0);vec2 uv=0.5*coord.xy+0.5;vec4 depth=vec4( -unpack_depth(texture2D(u_depth,uv-df.xz)),unpack_depth(texture2D(u_depth,uv+df.xz)),unpack_depth(texture2D(u_depth,uv-df.zy)),unpack_depth(texture2D(u_depth,uv+df.zy)) -);return dot(vec4(0.25),vec4(1.0)-clamp(300.0*(vec4(coord.z-0.001)-depth),0.0,1.0));}vec4 fourSample(vec2 pos,vec2 off) { -#ifdef TERRAIN_DEM_FLOAT_FORMAT -float tl=texture2D(u_dem,pos).a;float tr=texture2D(u_dem,pos+vec2(off.x,0.0)).a;float bl=texture2D(u_dem,pos+vec2(0.0,off.y)).a;float br=texture2D(u_dem,pos+off).a; -#else -vec4 demtl=vec4(texture2D(u_dem,pos).xyz*255.0,-1.0);float tl=dot(demtl,u_dem_unpack);vec4 demtr=vec4(texture2D(u_dem,pos+vec2(off.x,0.0)).xyz*255.0,-1.0);float tr=dot(demtr,u_dem_unpack);vec4 dembl=vec4(texture2D(u_dem,pos+vec2(0.0,off.y)).xyz*255.0,-1.0);float bl=dot(dembl,u_dem_unpack);vec4 dembr=vec4(texture2D(u_dem,pos+off).xyz*255.0,-1.0);float br=dot(dembr,u_dem_unpack); -#endif -return vec4(tl,tr,bl,br);}float flatElevation(vec2 pack) {vec2 apos=floor(pack/8.0);vec2 span=10.0*(pack-apos*8.0);vec2 uvTex=(apos-vec2(1.0,1.0))/8190.0;float size=u_dem_size+2.0;float dd=1.0/size;vec2 pos=u_dem_size*(uvTex*u_dem_scale+u_dem_tl)+1.0;vec2 f=fract(pos);pos=(pos-f+0.5)*dd;vec4 h=fourSample(pos,vec2(dd));float z=mix(mix(h.x,h.y,f.x),mix(h.z,h.w,f.x),f.y);vec2 w=floor(0.5*(span*u_meter_to_dem-1.0));vec2 d=dd*w;h=fourSample(pos-d,2.0*d+vec2(dd));vec4 diff=abs(h.xzxy-h.ywzw);vec2 slope=min(vec2(0.25),u_meter_to_dem*0.5*(diff.xz+diff.yw)/(2.0*w+vec2(1.0)));vec2 fix=slope*span;float base=z+max(fix.x,fix.y);return u_exaggeration*base;}float elevationFromUint16(float word) {return u_exaggeration*(word/ELEVATION_SCALE-ELEVATION_OFFSET);} -#else -float elevation(vec2 pos) { return 0.0; }bool isOccluded(vec4 frag) { return false; }float occlusionFade(vec4 frag) { return 1.0; } -#endif`,Uo=`#ifdef FOG -uniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump mat4 u_fog_matrix;varying vec3 v_fog_pos;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}vec3 fog_position(vec3 pos) {return (u_fog_matrix*vec4(pos,1.0)).xyz;}vec3 fog_position(vec2 pos) {return fog_position(vec3(pos,0.0));}float fog(vec3 pos) {float depth=length(pos);float opacity=fog_opacity(fog_range(depth));return opacity*fog_horizon_blending(pos/depth);} -#endif`,zr=`#ifdef FOG -uniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump float u_fog_temporal_offset;varying vec3 v_fog_pos;uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform highp vec2 u_viewport;uniform float u_globe_transition;uniform int u_is_globe;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}float globe_glow_progress() {highp vec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix( -mix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);highp vec3 dir=normalize(ray_dir);highp vec3 closest_point=dot(u_globe_pos,dir)*dir;highp float sdf=length(closest_point-u_globe_pos)/u_globe_radius;return sdf+PI*0.5;}float fog_opacity(vec3 pos) {float depth=length(pos);return fog_opacity(fog_range(depth));}vec3 fog_apply(vec3 color,vec3 pos) {float depth=length(pos);float opacity;if (u_is_globe==1) {float glow_progress=globe_glow_progress();float t=mix(glow_progress,depth,u_globe_transition);opacity=fog_opacity(fog_range(t));} else {opacity=fog_opacity(fog_range(depth));opacity*=fog_horizon_blending(pos/depth);}return mix(color,u_fog_color.rgb,opacity);}vec4 fog_apply_from_vert(vec4 color,float fog_opac) {float alpha=EPSILON+color.a;color.rgb=mix(color.rgb/alpha,u_fog_color.rgb,fog_opac)*alpha;return color;}vec3 fog_apply_sky_gradient(vec3 camera_ray,vec3 sky_color) {float horizon_blend=fog_horizon_blending(normalize(camera_ray));return mix(sky_color,u_fog_color.rgb,horizon_blend);}vec4 fog_apply_premultiplied(vec4 color,vec3 pos) {float alpha=EPSILON+color.a;color.rgb=fog_apply(color.rgb/alpha,pos)*alpha;return color;}vec3 fog_dither(vec3 color) {vec2 dither_seed=gl_FragCoord.xy+u_fog_temporal_offset;return dither(color,dither_seed);}vec4 fog_dither(vec4 color) {return vec4(fog_dither(color.rgb),color.a);} -#endif`;let As={},Hn={};const Vo=[];Kn(Ba,Vo),Kn(Cr,Vo),Kn(Uo,Vo),Kn(zr,Vo),As=bt("",Cr),Hn=bt(zr,Uo);const ac=bt(` -#if __VERSION__ >=300 -#define varying in -#define gl_FragColor glFragColor -#define texture2D texture -#define textureCube texture -out vec4 glFragColor; -#endif -highp vec3 hash(highp vec2 p) {highp vec3 p3=fract(p.xyx*vec3(443.8975,397.2973,491.1871));p3+=dot(p3,p3.yxz+19.19);return fract((p3.xxy+p3.yzz)*p3.zyx);}vec3 dither(vec3 color,highp vec2 seed) {vec3 rnd=hash(seed)+hash(seed+0.59374)-0.5;return color+rnd/255.0;}highp float unpack_depth(highp vec4 rgba_depth) -{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}highp vec4 pack_depth(highp float ndc_z) {highp float depth=ndc_z*0.5+0.5;const highp vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);const highp vec4 bit_mask =vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);highp vec4 res=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;}`,` -#if __VERSION__ >=300 -#define attribute in -#define varying out -#define texture2D texture -#endif -float wrap(float n,float min,float max) {float d=max-min;float w=mod(mod(n-min,d)+d,d)+min;return (w==min) ? max : w;} -#ifdef PROJECTION_GLOBE_VIEW -vec3 mercator_tile_position(mat4 matrix,vec2 tile_anchor,vec3 tile_id,vec2 mercator_center) { -#ifndef PROJECTED_POS_ON_VIEWPORT -float tiles=tile_id.z;vec2 mercator=(tile_anchor/EXTENT+tile_id.xy)/tiles;mercator-=mercator_center;mercator.x=wrap(mercator.x,-0.5,0.5);vec4 mercator_tile=vec4(mercator.xy*EXTENT,EXTENT/(2.0*PI),1.0);mercator_tile=matrix*mercator_tile;return mercator_tile.xyz; -#else -return vec3(0.0); -#endif -}vec3 mix_globe_mercator(vec3 globe,vec3 mercator,float t) {return mix(globe,mercator,t);}mat3 globe_mercator_surface_vectors(vec3 pos_normal,vec3 up_dir,float zoom_transition) {vec3 normal=zoom_transition==0.0 ? pos_normal : normalize(mix(pos_normal,up_dir,zoom_transition));vec3 xAxis=normalize(vec3(normal.z,0.0,-normal.x));vec3 yAxis=normalize(cross(normal,xAxis));return mat3(xAxis,yAxis,normal);} -#endif -vec2 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 -);}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;}const vec4 AWAY=vec4(-1000.0,-1000.0,-1000.0,1);//Normalized device coordinate that is not rendered.`),Is=Ba,Oa=` -#ifdef GL_ES -precision mediump float; -#else - -#if !defined(lowp) -#define lowp -#endif - -#if !defined(mediump) -#define mediump -#endif - -#if !defined(highp) -#define highp -#endif - -#endif`;var Fa={background:bt(`uniform vec4 u_color;uniform float u_opacity; -#ifdef LIGHTING_3D_MODE -varying vec4 v_color; -#endif -void main() {vec4 out_color; -#ifdef LIGHTING_3D_MODE -out_color=v_color; -#else -out_color=u_color; -#endif -#ifdef FOG -out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); -#endif -gl_FragColor=out_color*u_opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec2 a_pos;uniform mat4 u_matrix; -#ifdef LIGHTING_3D_MODE -uniform vec4 u_color;varying vec4 v_color; -#endif -void main() {gl_Position=u_matrix*vec4(a_pos,0,1); -#ifdef LIGHTING_3D_MODE -v_color=apply_lighting(u_color); -#endif -#ifdef FOG -v_fog_pos=fog_position(a_pos); -#endif -}`),backgroundPattern:bt(`uniform vec2 u_pattern_tl;uniform vec2 u_pattern_br;uniform vec2 u_texsize;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos;void main() {vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(u_pattern_tl/u_texsize,u_pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos); -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color); -#endif -#ifdef FOG -out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); -#endif -gl_FragColor=out_color*u_opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_pattern_size;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_pattern_size,u_tile_units_to_pixels,a_pos); -#ifdef FOG -v_fog_pos=fog_position(a_pos); -#endif -}`),circle:bt(`varying vec3 v_data;varying float v_visibility; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define mediump float radius -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define highp vec4 stroke_color -#pragma mapbox: define mediump float stroke_width -#pragma mapbox: define lowp float stroke_opacity -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize mediump float radius -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize highp vec4 stroke_color -#pragma mapbox: initialize mediump float stroke_width -#pragma mapbox: initialize lowp float stroke_opacity -vec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);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) -);vec4 out_color=mix(color*opacity,stroke_color*stroke_opacity,color_t); -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color); -#endif -#ifdef FOG -out_color=fog_apply_premultiplied(out_color,v_fog_pos); -#endif -gl_FragColor=out_color*(v_visibility*opacity_t); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`#define NUM_VISIBILITY_RINGS 2 -#define INV_SQRT2 0.70710678 -#define ELEVATION_BIAS 0.0001 -#define NUM_SAMPLES_PER_RING 16 -uniform mat4 u_matrix;uniform mat2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos; -#ifdef PROJECTION_GLOBE_VIEW -attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir; -#endif -varying vec3 v_data;varying float v_visibility; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define mediump float radius -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define highp vec4 stroke_color -#pragma mapbox: define mediump float stroke_width -#pragma mapbox: define lowp float stroke_opacity -vec2 calc_offset(vec2 extrusion,float radius,float stroke_width, float view_scale) {return extrusion*(radius+stroke_width)*u_extrude_scale*view_scale;}float cantilevered_elevation(vec2 pos,float radius,float stroke_width,float view_scale) {vec2 c1=pos+calc_offset(vec2(-1,-1),radius,stroke_width,view_scale);vec2 c2=pos+calc_offset(vec2(1,-1),radius,stroke_width,view_scale);vec2 c3=pos+calc_offset(vec2(1,1),radius,stroke_width,view_scale);vec2 c4=pos+calc_offset(vec2(-1,1),radius,stroke_width,view_scale);float h1=elevation(c1)+ELEVATION_BIAS;float h2=elevation(c2)+ELEVATION_BIAS;float h3=elevation(c3)+ELEVATION_BIAS;float h4=elevation(c4)+ELEVATION_BIAS;return max(h4,max(h3,max(h1,h2)));}float circle_elevation(vec2 pos) { -#if defined(TERRAIN) -return elevation(pos)+ELEVATION_BIAS; -#else -return 0.0; -#endif -}vec4 project_vertex(vec2 extrusion,vec4 world_center,vec4 projected_center,float radius,float stroke_width, float view_scale,mat3 surface_vectors) {vec2 sample_offset=calc_offset(extrusion,radius,stroke_width,view_scale); -#ifdef PITCH_WITH_MAP -#ifdef PROJECTION_GLOBE_VIEW -return u_matrix*( world_center+vec4(sample_offset.x*surface_vectors[0]+sample_offset.y*surface_vectors[1],0) ); -#else -return u_matrix*( world_center+vec4(sample_offset,0,0) ); -#endif -#else -return projected_center+vec4(sample_offset,0,0); -#endif -}float get_sample_step() { -#ifdef PITCH_WITH_MAP -return 2.0*PI/float(NUM_SAMPLES_PER_RING); -#else -return PI/float(NUM_SAMPLES_PER_RING); -#endif -}void main(void) { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize mediump float radius -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize highp vec4 stroke_color -#pragma mapbox: initialize mediump float stroke_width -#pragma mapbox: initialize lowp float stroke_opacity -vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);vec4 world_center;mat3 surface_vectors; -#ifdef PROJECTION_GLOBE_VIEW -vec3 pos_normal_3=a_pos_normal_3/16384.0;surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(circle_center)*circle_elevation(circle_center);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*circle_elevation(circle_center);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,circle_center,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;vec3 pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);world_center=vec4(pos,1); -#else -surface_vectors=mat3(1.0);float height=circle_elevation(circle_center);world_center=vec4(circle_center,height,1); -#endif -vec4 projected_center=u_matrix*world_center;float view_scale=0.0; -#ifdef PITCH_WITH_MAP -#ifdef SCALE_WITH_MAP -view_scale=1.0; -#else -view_scale=projected_center.w/u_camera_to_center_distance; -#endif -#else -#ifdef SCALE_WITH_MAP -view_scale=u_camera_to_center_distance; -#else -view_scale=projected_center.w; -#endif -#endif -gl_Position=project_vertex(extrude,world_center,projected_center,radius,stroke_width,view_scale,surface_vectors);float visibility=0.0; -#ifdef TERRAIN -float step=get_sample_step();vec4 occlusion_world_center;vec4 occlusion_projected_center; -#ifdef PITCH_WITH_MAP -float cantilevered_height=cantilevered_elevation(circle_center,radius,stroke_width,view_scale);occlusion_world_center=vec4(circle_center,cantilevered_height,1);occlusion_projected_center=u_matrix*occlusion_world_center; -#else -occlusion_world_center=world_center;occlusion_projected_center=projected_center; -#endif -for(int ring=0; ring < NUM_VISIBILITY_RINGS; ring++) {float scale=(float(ring)+1.0)/float(NUM_VISIBILITY_RINGS);for(int i=0; i < NUM_SAMPLES_PER_RING; i++) {vec2 extrusion=vec2(cos(step*float(i)),-sin(step*float(i)))*scale;vec4 frag_pos=project_vertex(extrusion,occlusion_world_center,occlusion_projected_center,radius,stroke_width,view_scale,surface_vectors);visibility+=float(!isOccluded(frag_pos));}}visibility/=float(NUM_VISIBILITY_RINGS)*float(NUM_SAMPLES_PER_RING); -#else -visibility=1.0; -#endif -#ifdef PROJECTION_GLOBE_VIEW -visibility=1.0; -#endif -v_visibility=visibility;lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur); -#ifdef FOG -v_fog_pos=fog_position(world_center.xyz); -#endif -}`),clippingMask:bt("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:bt(`uniform highp float u_intensity;varying vec2 v_extrude; -#pragma mapbox: define highp float weight -#define GAUSS_COEF 0.3989422804014327 -void main() { -#pragma mapbox: initialize highp float weight -float 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); -#ifdef FOG -if (u_is_globe==0) {gl_FragColor.r*=pow(1.0-fog_opacity(v_fog_pos),2.0);} -#endif -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos; -#ifdef PROJECTION_GLOBE_VIEW -attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir; -#endif -varying vec2 v_extrude; -#pragma mapbox: define highp float weight -#pragma mapbox: define mediump float radius -const highp float ZERO=1.0/255.0/16.0; -#define GAUSS_COEF 0.3989422804014327 -void main(void) { -#pragma mapbox: initialize highp float weight -#pragma mapbox: initialize mediump float radius -vec2 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;vec2 tilePos=floor(a_pos*0.5);vec3 pos; -#ifdef PROJECTION_GLOBE_VIEW -vec3 pos_normal_3=a_pos_normal_3/16384.0;mat3 surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(tilePos)*elevation(tilePos);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*elevation(tilePos);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,tilePos,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition); -#else -pos=vec3(tilePos+extrude,elevation(tilePos)); -#endif -gl_Position=u_matrix*vec4(pos,1); -#ifdef FOG -v_fog_pos=fog_position(pos); -#endif -}`),heatmapTexture:bt(`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; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(0.0); -#endif -}`,"attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=a_pos*0.5+0.5;}"),collisionBox:bt("varying float v_placed;varying float v_notUsed;void main() {vec4 red =vec4(1.0,0.0,0.0,1.0);vec4 blue=vec4(0.0,0.0,1.0,0.5);gl_FragColor =mix(red,blue,step(0.5,v_placed))*0.5;gl_FragColor*=mix(1.0,0.1,step(0.5,v_notUsed));}",`attribute vec3 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;attribute float a_size_scale;attribute vec2 a_padding;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_pos+elevationVector(a_anchor_pos)*elevation(a_anchor_pos),1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp( -0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,1.5);gl_Position=projectedPoint;gl_Position.xy+=(a_extrude*a_size_scale+a_shift+a_padding)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}`),collisionCircle:bt("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_2f;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_2f;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:bt("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; -#ifdef PROJECTION_GLOBE_VIEW -attribute vec3 a_pos_3; -#endif -varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {float h=elevation(a_pos);v_uv=a_pos/8192.0; -#ifdef PROJECTION_GLOBE_VIEW -gl_Position=u_matrix*vec4(a_pos_3+elevationVector(a_pos)*h,1); -#else -gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,h,1); -#endif -}`),fill:bt(`#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float opacity -vec4 out_color=color; -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color); -#endif -#ifdef FOG -out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); -#endif -gl_FragColor=out_color*opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec2 a_pos;uniform mat4 u_matrix; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float opacity -gl_Position=u_matrix*vec4(a_pos,0,1); -#ifdef FOG -v_fog_pos=fog_position(a_pos); -#endif -}`),fillOutline:bt(`varying vec2 v_pos; -#pragma mapbox: define highp vec4 outline_color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 outline_color -#pragma mapbox: initialize lowp float opacity -float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=outline_color; -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color); -#endif -#ifdef FOG -out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); -#endif -gl_FragColor=out_color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos; -#pragma mapbox: define highp vec4 outline_color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 outline_color -#pragma mapbox: initialize lowp float opacity -gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world; -#ifdef FOG -v_fog_pos=fog_position(a_pos); -#endif -}`),fillOutlinePattern:bt(`uniform vec2 u_texsize;uniform sampler2D u_image;varying vec2 v_pos;varying vec2 v_pos_world; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern -vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);float dist=length(v_pos_world-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=texture2D(u_image,pos); -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color); -#endif -#ifdef FOG -out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); -#endif -gl_FragColor=out_color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;varying vec2 v_pos_world; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern -#pragma mapbox: define lowp float pixel_ratio -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern -#pragma mapbox: initialize lowp float pixel_ratio -vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);v_pos_world=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world; -#ifdef FOG -v_fog_pos=fog_position(a_pos); -#endif -}`),fillPattern:bt(`uniform vec2 u_texsize;uniform sampler2D u_image;varying vec2 v_pos; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern -vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos); -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color); -#endif -#ifdef FOG -out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); -#endif -gl_FragColor=out_color*opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern -#pragma mapbox: define lowp float pixel_ratio -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern -#pragma mapbox: initialize lowp float pixel_ratio -vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos); -#ifdef FOG -v_fog_pos=fog_position(a_pos); -#endif -}`),fillExtrusion:bt(`varying vec4 v_color; -#ifdef RENDER_SHADOWS -varying highp vec4 v_pos_light_view_0;varying highp vec4 v_pos_light_view_1;varying float v_depth; -#endif -#ifdef FAUX_AO -uniform lowp vec2 u_ao;varying vec3 v_ao; -#endif -#ifdef ZERO_ROOF_RADIUS -varying vec4 v_roof_color; -#endif -#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) -varying highp vec3 v_normal; -#endif -void main() { -#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) -vec3 normal=v_normal; -#endif -float z;vec4 color; -#ifdef ZERO_ROOF_RADIUS -z=float(normal.z > 0.00001);color=mix(v_color,v_roof_color,z); -#else -color=v_color; -#endif -#ifdef FAUX_AO -float intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x; -#ifdef ZERO_ROOF_RADIUS -concave*=(1.0-z); -#endif -float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);color.rgb=color.rgb*shade; -#endif -#ifdef RENDER_SHADOWS -#ifdef ZERO_ROOF_RADIUS -normal=mix(normal,vec3(0.0,0.0,1.0),z); -#endif -color.xyz=shadowed_color_normal(color.xyz,normalize(normal),v_pos_light_view_0,v_pos_light_view_1,v_depth); -#endif -#ifdef FOG -color=fog_dither(fog_apply_premultiplied(color,v_fog_pos)); -#endif -gl_FragColor=color; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`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;uniform float u_edge_radius;attribute vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos; -#ifdef PROJECTION_GLOBE_VIEW -attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift; -#endif -varying vec4 v_color; -#ifdef RENDER_SHADOWS -uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;varying highp vec4 v_pos_light_view_0;varying highp vec4 v_pos_light_view_1;varying float v_depth; -#endif -#ifdef ZERO_ROOF_RADIUS -varying vec4 v_roof_color; -#endif -#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) -varying highp vec3 v_normal; -#endif -#ifdef FAUX_AO -uniform lowp vec2 u_ao;varying vec3 v_ao; -#endif -#pragma mapbox: define highp float base -#pragma mapbox: define highp float height -#pragma mapbox: define highp vec4 color -void main() { -#pragma mapbox: initialize highp float base -#pragma mapbox: initialize highp float height -#pragma mapbox: initialize highp vec4 color -vec4 pos_nx=floor(a_pos_normal_ed*0.5);vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0)); -#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) -v_normal=normal; -#endif -base=max(0.0,base);height=max(0.0,top_up_ny.y==0.0 && top_up_ny.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0); -#if defined(HAS_CENTROID) || defined(TERRAIN) -centroid_pos=a_centroid_pos; -#endif -float ele=0.0;float h=0.0;float c_ele;vec3 pos; -#ifdef TERRAIN -bool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);pos=vec3(pos_nx.xy,h); -#else -h=t > 0.0 ? height : base;pos=vec3(pos_nx.xy,h); -#endif -#ifdef PROJECTION_GLOBE_VIEW -float lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*h);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,pos.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*pos.z;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition); -#endif -float hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(pos,1),AWAY,hidden); -#ifdef RENDER_SHADOWS -v_pos_light_view_0=u_light_matrix_0*vec4(pos,1);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1);v_depth=gl_Position.w; -#endif -float NdotL=0.0;float colorvalue=0.0; -#ifdef LIGHTING_3D_MODE -NdotL=calculate_NdotL(normal); -#else -colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),NdotL); -#endif -if (normal.y !=0.0) {float r=0.84; -#ifndef LIGHTING_3D_MODE -r=mix(0.7,0.98,1.0-u_lightintensity); -#endif -NdotL*=( -(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}v_color=vec4(0.0,0.0,0.0,1.0); -#ifdef FAUX_AO -float concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height; -#ifdef TERRAIN -top_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height); -#endif -v_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]); -#ifdef PROJECTION_GLOBE_VIEW -top_height+=u_height_lift; -#endif -gl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w; -#endif -#ifdef LIGHTING_3D_MODE -v_color=apply_lighting(color,NdotL); -#else -v_color.rgb+=clamp(color.rgb*NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0)); -#endif -v_color*=u_opacity; -#ifdef ZERO_ROOF_RADIUS -v_roof_color=vec4(0.0,0.0,0.0,1.0); -#ifdef LIGHTING_3D_MODE -v_roof_color=apply_lighting(color,calculate_NdotL(vec3(0.0,0.0,1.0))); -#else -float roofNdotL=clamp(u_lightpos.z,0.0,1.0);roofNdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),roofNdotL);v_roof_color.rgb+=clamp(color.rgb*roofNdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0)); -#endif -v_roof_color*=u_opacity; -#endif -#ifdef FOG -v_fog_pos=fog_position(pos); -#endif -}`),fillExtrusionPattern:bt(`uniform vec2 u_texsize;uniform sampler2D u_image; -#ifdef FAUX_AO -uniform lowp vec2 u_ao;varying vec3 v_ao; -#endif -#ifdef LIGHTING_3D_MODE -varying float v_NdotL; -#endif -varying vec2 v_pos;varying vec4 v_lighting;uniform lowp float u_opacity; -#pragma mapbox: define lowp float base -#pragma mapbox: define lowp float height -#pragma mapbox: define lowp vec4 pattern -#pragma mapbox: define lowp float pixel_ratio -void main() { -#pragma mapbox: initialize lowp float base -#pragma mapbox: initialize lowp float height -#pragma mapbox: initialize mediump vec4 pattern -#pragma mapbox: initialize lowp float pixel_ratio -vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos); -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color,v_NdotL)*u_opacity; -#else -out_color=out_color*v_lighting; -#endif -#ifdef FAUX_AO -float intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);out_color.rgb=out_color.rgb*shade; -#endif -#ifdef FOG -out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); -#endif -gl_FragColor=out_color; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform float u_tile_units_to_pixels;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 vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos; -#ifdef PROJECTION_GLOBE_VIEW -attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift; -#endif -varying vec2 v_pos;varying vec4 v_lighting; -#ifdef FAUX_AO -uniform lowp vec2 u_ao;varying vec3 v_ao; -#endif -#ifdef LIGHTING_3D_MODE -varying float v_NdotL; -#endif -#pragma mapbox: define lowp float base -#pragma mapbox: define lowp float height -#pragma mapbox: define lowp vec4 pattern -#pragma mapbox: define lowp float pixel_ratio -void main() { -#pragma mapbox: initialize lowp float base -#pragma mapbox: initialize lowp float height -#pragma mapbox: initialize mediump vec4 pattern -#pragma mapbox: initialize lowp float pixel_ratio -vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec4 pos_nx=floor(a_pos_normal_ed*0.5);mediump vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;mediump vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));float edgedistance=a_pos_normal_ed.w;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;base=max(0.0,base);height=max(0.0,height);float t=top_up_ny.x;float z=t > 0.0 ? height : base;vec2 centroid_pos=vec2(0.0); -#if defined(HAS_CENTROID) || defined(TERRAIN) -centroid_pos=a_centroid_pos; -#endif -float ele=0.0;float h=z;vec3 p;float c_ele; -#ifdef TERRAIN -bool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);p=vec3(pos_nx.xy,h); -#else -p=vec3(pos_nx.xy,z); -#endif -#ifdef PROJECTION_GLOBE_VIEW -float lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*(p.z+lift));vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,p.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*p.z;p=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition); -#endif -float hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(p,1),AWAY,hidden);vec2 pos=normal.z==1.0 -? pos_nx.xy -: vec2(edgedistance,z*u_height_factor);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float NdotL=0.0; -#ifdef LIGHTING_3D_MODE -NdotL=calculate_NdotL(normal); -#else -NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),NdotL); -#endif -if (normal.y !=0.0) {float r=0.84; -#ifndef LIGHTING_3D_MODE -r=mix(0.7,0.98,1.0-u_lightintensity); -#endif -NdotL*=( -(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));} -#ifdef FAUX_AO -float concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height; -#ifdef TERRAIN -top_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height); -#endif -v_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]); -#ifdef PROJECTION_GLOBE_VIEW -top_height+=u_height_lift; -#endif -gl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w; -#endif -#ifdef LIGHTING_3D_MODE -v_NdotL=NdotL; -#else -v_lighting.rgb+=clamp(NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity; -#endif -#ifdef FOG -v_fog_pos=fog_position(p); -#endif -}`),hillshadePrepare:bt(`#ifdef GL_ES -precision highp float; -#endif -uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord) { -#ifdef TERRAIN_DEM_FLOAT_FORMAT -return texture2D(u_image,coord).a/4.0; -#else -vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0; -#endif -}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y));float b=getElevation(v_pos+vec2(0,-epsilon.y));float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y));float d=getElevation(v_pos+vec2(-epsilon.x,0));float e=getElevation(v_pos+vec2(epsilon.x,0));float f=getElevation(v_pos+vec2(-epsilon.x,epsilon.y));float g=getElevation(v_pos+vec2(0,epsilon.y));float h=getElevation(v_pos+vec2(epsilon.x,epsilon.y));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+e+e+h)-(a+d+d+f),(f+g+g+h)-(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); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,"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:bt(`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;void 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; -#ifdef LIGHTING_3D_MODE -gl_FragColor=apply_lighting(gl_FragColor); -#endif -#ifdef FOG -gl_FragColor=fog_dither(fog_apply_premultiplied(gl_FragColor,v_fog_pos)); -#endif -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`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; -#ifdef FOG -v_fog_pos=fog_position(a_pos); -#endif -}`),line:bt(`uniform lowp float u_device_pixel_ratio;uniform float u_alpha_discard_threshold;uniform highp vec2 u_trim_offset;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec4 v_uv; -#ifdef RENDER_LINE_DASH -uniform sampler2D u_dash_image;varying vec2 v_tex; -#endif -#ifdef RENDER_LINE_GRADIENT -uniform sampler2D u_gradient_image; -#endif -uniform float u_border_width;uniform vec4 u_border_color;float luminance(vec3 c) {return (c.r+c.r+c.b+c.g+c.g+c.g)*0.1667;} -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float floorwidth -#pragma mapbox: define lowp vec4 dash -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -float linearstep(float edge0,float edge1,float x) {return clamp((x-edge0)/(edge1-edge0),0.0,1.0);}void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float floorwidth -#pragma mapbox: initialize lowp vec4 dash -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -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); -#ifdef RENDER_LINE_DASH -float sdfdist=texture2D(u_dash_image,v_tex).a;float sdfgamma=1.0/(2.0*u_device_pixel_ratio)/dash.z;alpha*=linearstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist); -#endif -highp vec4 out_color; -#ifdef RENDER_LINE_GRADIENT -out_color=texture2D(u_gradient_image,v_uv.xy); -#else -out_color=color; -#endif -float trimmed=1.0; -#ifdef RENDER_LINE_TRIM_OFFSET -highp float start=v_uv[2];highp float end=v_uv[3];highp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=(start+(v_uv.x)*(end-start));if (trim_end > trim_start) {if (line_progress <=trim_end && line_progress >=trim_start) {out_color=vec4(0,0,0,0);trimmed=0.0;}} -#endif -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color); -#endif -#ifdef FOG -out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); -#endif -#ifdef RENDER_LINE_ALPHA_DISCARD -if (alpha < u_alpha_discard_threshold) {discard;} -#endif -#ifdef RENDER_LINE_BORDER -float edgeBlur=(u_border_width+1.0/u_device_pixel_ratio);float alpha2=clamp(min(dist-(v_width2.t-edgeBlur),v_width2.s-dist)/edgeBlur,0.0,1.0);if (alpha2 < 1.) {float smoothAlpha=smoothstep(0.6,1.0,alpha2); -#ifdef RENDER_LINE_BORDER_AUTO -float Y=(out_color.a > 0.01) ? luminance(out_color.rgb/out_color.a) : 1.;float adjustment=(Y > 0.) ? 0.5/Y : 0.45;if (out_color.a > 0.25 && Y < 0.25) {vec3 borderColor=(Y > 0.) ? out_color.rgb : vec3(1,1,1)*out_color.a;out_color.rgb=out_color.rgb+borderColor*(adjustment*(1.0-smoothAlpha));} else {out_color.rgb*=(0.6 +0.4*smoothAlpha);} -#else -out_color.rgb=mix(u_border_color.rgb*u_border_color.a*trimmed,out_color.rgb,smoothAlpha); -#endif -} -#endif -gl_FragColor=out_color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,` -#define EXTRUDE_SCALE 0.015873016 -attribute vec2 a_pos_normal;attribute vec4 a_data; -#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET) -attribute highp vec4 a_packed; -#endif -#ifdef RENDER_LINE_DASH -attribute float a_linesofar; -#endif -uniform mat4 u_matrix;uniform mat2 u_pixels_to_tile_units;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 vec4 v_uv; -#ifdef RENDER_LINE_DASH -uniform vec2 u_texsize;uniform float u_tile_units_to_pixels;varying vec2 v_tex; -#endif -#ifdef RENDER_LINE_GRADIENT -uniform float u_image_height; -#endif -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float floorwidth -#pragma mapbox: define lowp vec4 dash -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define mediump float gapwidth -#pragma mapbox: define lowp float offset -#pragma mapbox: define mediump float width -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float floorwidth -#pragma mapbox: initialize lowp vec4 dash -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump float gapwidth -#pragma mapbox: initialize lowp float offset -#pragma mapbox: initialize mediump float width -float 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;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*EXTRUDE_SCALE;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*EXTRUDE_SCALE*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist*u_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude; -#ifndef RENDER_TO_TEXTURE -float 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; -#else -v_gamma_scale=1.0; -#endif -#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET) -float a_uv_x=a_packed[0];float a_split_index=a_packed[1];highp float a_clip_start=a_packed[2];highp float a_clip_end=a_packed[3]; -#ifdef RENDER_LINE_GRADIENT -highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec4(a_uv_x,a_split_index*texel_height-half_texel_height,a_clip_start,a_clip_end); -#else -v_uv=vec4(a_uv_x,0.0,a_clip_start,a_clip_end); -#endif -#endif -#ifdef RENDER_LINE_DASH -float scale=dash.z==0.0 ? 0.0 : u_tile_units_to_pixels/dash.z;float height=dash.y;v_tex=vec2(a_linesofar*scale/floorwidth,(-normal.y*height+dash.x+0.5)/u_texsize.y); -#endif -v_width2=vec2(outset,inset); -#ifdef FOG -v_fog_pos=fog_position(pos); -#endif -}`),linePattern:bt(`uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_tile_units_to_pixels;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; -#pragma mapbox: define lowp vec4 pattern -#pragma mapbox: define lowp float pixel_ratio -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize mediump vec4 pattern -#pragma mapbox: initialize lowp float pixel_ratio -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;vec2 pattern_size=vec2(display_size.x/u_tile_units_to_pixels,display_size.y);float aspect=display_size.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=mod(v_linesofar/pattern_size.x*aspect,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(x,y));vec4 color=texture2D(u_image,pos); -#ifdef LIGHTING_3D_MODE -color=apply_lighting(color); -#endif -#ifdef FOG -color=fog_dither(fog_apply_premultiplied(color,v_fog_pos)); -#endif -gl_FragColor=color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,` -#define scale 0.015873016 -attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_linesofar;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mat2 u_pixels_to_tile_units;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; -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float offset -#pragma mapbox: define mediump float gapwidth -#pragma mapbox: define mediump float width -#pragma mapbox: define lowp float floorwidth -#pragma mapbox: define lowp vec4 pattern -#pragma mapbox: define lowp float pixel_ratio -void main() { -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float offset -#pragma mapbox: initialize mediump float gapwidth -#pragma mapbox: initialize mediump float width -#pragma mapbox: initialize lowp float floorwidth -#pragma mapbox: initialize mediump vec4 pattern -#pragma mapbox: initialize lowp float pixel_ratio -float 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;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_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude; -#ifndef RENDER_TO_TEXTURE -float 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; -#else -v_gamma_scale=1.0; -#endif -v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth; -#ifdef FOG -v_fog_pos=fog_position(pos); -#endif -}`),raster:bt(`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);vec3 out_color=mix(u_high_vec,u_low_vec,rgb); -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color); -#endif -#ifdef FOG -out_color=fog_dither(fog_apply(out_color,v_fog_pos)); -#endif -gl_FragColor=vec4(out_color*color.a,color.a); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform vec2 u_perspective_transform;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {float w=1.0+dot(a_texture_pos,u_perspective_transform);gl_Position=u_matrix*vec4(a_pos*w,0,w);v_pos0=a_texture_pos/8192.0;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent; -#ifdef FOG -v_fog_pos=fog_position(a_pos); -#endif -}`),symbolIcon:bt(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize lowp float opacity -lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_pixeloffset;attribute vec4 a_projected_pos;attribute float a_fade_opacity; -#ifdef PROJECTION_GLOBE_VIEW -attribute vec3 a_globe_anchor;attribute vec3 a_globe_normal; -#endif -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 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 vec3 u_up_vector; -#ifdef PROJECTION_GLOBE_VIEW -uniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix; -#endif -varying vec2 v_tex;varying float v_fade_opacity; -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize lowp float opacity -vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_min_font_scale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[3];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 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos; -#ifdef PROJECTION_GLOBE_VIEW -mercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0; -#else -world_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0; -#endif -vec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ? -camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp( -0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjected_point; -#ifdef PROJECTION_GLOBE_VIEW -vec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetProjected_point=u_matrix*vec4(a_globe_anchor+displacement,1); -#else -offsetProjected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1); -#endif -vec2 a=projected_point.xy/projected_point.w;vec2 b=offsetProjected_point.xy/offsetProjected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos; -#ifdef PROJECTION_GLOBE_VIEW -vec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0); -#else -projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0); -#endif -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);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*max(a_min_font_scale,font_scale)+a_pxoffset/16.0); -#ifdef TERRAIN -#ifdef PITCH_WITH_MAP_TERRAIN -vec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy); -#endif -#endif -float occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade; -#ifdef PROJECTION_GLOBE_VIEW -vec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); -#else -gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); -#endif -float projection_transition_fade=1.0; -#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW) -projection_transition_fade=1.0-step(EPSILON,u_zoom_transition); -#endif -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;v_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change))*projection_transition_fade;}`),symbolSDF:bt(`#define SDF_PX 8.0 -uniform 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; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -float 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 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); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_pixeloffset;attribute vec4 a_projected_pos;attribute float a_fade_opacity; -#ifdef PROJECTION_GLOBE_VIEW -attribute vec3 a_globe_anchor;attribute vec3 a_globe_normal; -#endif -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_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 vec3 u_up_vector; -#ifdef PROJECTION_GLOBE_VIEW -uniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix; -#endif -varying vec2 v_data0;varying vec3 v_data1; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[3];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 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos; -#ifdef PROJECTION_GLOBE_VIEW -mercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0; -#else -world_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0; -#endif -vec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ? -camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp( -0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetprojected_point; -#ifdef PROJECTION_GLOBE_VIEW -vec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetprojected_point=u_matrix*vec4(a_globe_anchor+displacement,1); -#else -offsetprojected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1); -#endif -vec2 a=projected_point.xy/projected_point.w;vec2 b=offsetprojected_point.xy/offsetprojected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos; -#ifdef PROJECTION_GLOBE_VIEW -vec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0); -#else -projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0); -#endif -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);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset); -#ifdef TERRAIN -#ifdef PITCH_WITH_MAP_TERRAIN -vec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy); -#endif -#endif -float occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade; -#ifdef PROJECTION_GLOBE_VIEW -vec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); -#else -gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); -#endif -float gamma_scale=gl_Position.w;float projection_transition_fade=1.0; -#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW) -projection_transition_fade=1.0-step(EPSILON,u_zoom_transition); -#endif -vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity*projection_transition_fade);}`),symbolTextAndIcon:bt(`#define SDF_PX 8.0 -#define SDF 1.0 -#define ICON 0.0 -uniform 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; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -float 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; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -return;}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); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_projected_pos;attribute float a_fade_opacity; -#ifdef PROJECTION_GLOBE_VIEW -attribute vec3 a_globe_anchor;attribute vec3 a_globe_normal; -#endif -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_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 vec3 u_up_vector;uniform vec2 u_texsize_icon; -#ifdef PROJECTION_GLOBE_VIEW -uniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix; -#endif -varying vec4 v_data0;varying vec4 v_data1; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[3];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 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos; -#ifdef PROJECTION_GLOBE_VIEW -mercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0; -#else -world_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0; -#endif -vec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ? -camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp( -0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offset_projected_point=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projected_point.xy/projected_point.w;vec2 b=offset_projected_point.xy/offset_projected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos; -#ifdef PROJECTION_GLOBE_VIEW -vec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0); -#else -projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0); -#endif -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);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*font_scale); -#ifdef TERRAIN -#ifdef PITCH_WITH_MAP_TERRAIN -vec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy); -#endif -#endif -float occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade; -#ifdef PROJECTION_GLOBE_VIEW -vec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); -#else -gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); -#endif -float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));float projection_transition_fade=1.0; -#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW) -projection_transition_fade=1.0-step(EPSILON,u_zoom_transition); -#endif -v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity*projection_transition_fade,is_sdf);}`),terrainRaster:bt(`uniform sampler2D u_image0;varying vec2 v_pos0; -#ifdef FOG -varying float v_fog_opacity; -#endif -#ifdef RENDER_SHADOWS -varying vec4 v_pos_light_view_0;varying vec4 v_pos_light_view_1;varying float v_depth; -#endif -void main() {vec4 color=texture2D(u_image0,v_pos0); -#ifdef RENDER_SHADOWS -color.xyz=shadowed_color(color.xyz,v_pos_light_view_0,v_pos_light_view_1,v_depth); -#endif -#ifdef FOG -#ifdef ZERO_EXAGGERATION -color=fog_dither(fog_apply_premultiplied(color,v_fog_pos)); -#else -color=fog_dither(fog_apply_from_vert(color,v_fog_opacity)); -#endif -#endif -gl_FragColor=color; -#ifdef TERRAIN_WIREFRAME -gl_FragColor=vec4(1.0,0.0,0.0,0.8); -#endif -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform float u_skirt_height;attribute vec2 a_pos;varying vec2 v_pos0; -#ifdef FOG -varying float v_fog_opacity; -#endif -#ifdef RENDER_SHADOWS -uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;varying vec4 v_pos_light_view_0;varying vec4 v_pos_light_view_1;varying float v_depth; -#endif -const float wireframeOffset=0.00015;void main() {vec3 decomposedPosAndSkirt=decomposeToPosAndSkirt(a_pos);float skirt=decomposedPosAndSkirt.z;vec2 decodedPos=decomposedPosAndSkirt.xy;float elevation=elevation(decodedPos)-skirt*u_skirt_height; -#ifdef TERRAIN_WIREFRAME -elevation+=wireframeOffset; -#endif -v_pos0=decodedPos/8192.0;gl_Position=u_matrix*vec4(decodedPos,elevation,1.0); -#ifdef FOG -#ifdef ZERO_EXAGGERATION -v_fog_pos=fog_position(decodedPos); -#else -v_fog_opacity=fog(fog_position(vec3(decodedPos,elevation))); -#endif -#endif -#ifdef RENDER_SHADOWS -vec3 pos=vec3(decodedPos,elevation);v_pos_light_view_0=u_light_matrix_0*vec4(pos,1.);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1.);v_depth=gl_Position.w; -#endif -}`),terrainDepth:bt(`#ifdef GL_ES -precision highp float; -#endif -varying float v_depth;void main() {gl_FragColor=pack_depth(v_depth);}`,"uniform mat4 u_matrix;attribute vec2 a_pos;varying float v_depth;void main() {float elevation=elevation(a_pos);gl_Position=u_matrix*vec4(a_pos,elevation,1.0);v_depth=gl_Position.z/gl_Position.w;}"),skybox:bt(` -varying lowp vec3 v_uv;uniform lowp samplerCube u_cubemap;uniform lowp float u_opacity;uniform highp float u_temporal_offset;uniform highp vec3 u_sun_direction;float sun_disk(highp vec3 ray_direction,highp vec3 sun_direction) {highp float cos_angle=dot(normalize(ray_direction),sun_direction);const highp float cos_sun_angular_diameter=0.99996192306;const highp float smoothstep_delta=1e-5;return smoothstep( -cos_sun_angular_diameter-smoothstep_delta,cos_sun_angular_diameter+smoothstep_delta,cos_angle);}float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec3 uv=v_uv;const float y_bias=0.015;uv.y+=y_bias;uv.y=pow(abs(uv.y),1.0/5.0);uv.y=map(uv.y,0.0,1.0,-1.0,1.0);vec3 sky_color=textureCube(u_cubemap,uv).rgb; -#ifdef FOG -sky_color=fog_apply_sky_gradient(v_uv.xzy,sky_color); -#endif -sky_color.rgb=dither(sky_color.rgb,gl_FragCoord.xy+u_temporal_offset);sky_color+=0.1*sun_disk(v_uv,u_sun_direction);gl_FragColor=vec4(sky_color*u_opacity,u_opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,vn),skyboxGradient:bt(`varying highp vec3 v_uv;uniform lowp sampler2D u_color_ramp;uniform highp vec3 u_center_direction;uniform lowp float u_radius;uniform lowp float u_opacity;uniform highp float u_temporal_offset;void main() {float progress=acos(dot(normalize(v_uv),u_center_direction))/u_radius;vec4 color=texture2D(u_color_ramp,vec2(progress,0.5)); -#ifdef FOG -color.rgb=fog_apply_sky_gradient(v_uv.xzy,color.rgb/color.a)*color.a; -#endif -color*=u_opacity;color.rgb=dither(color.rgb,gl_FragCoord.xy+u_temporal_offset);gl_FragColor=color; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,vn),skyboxCapture:bt(` -varying highp vec3 v_position;uniform highp float u_sun_intensity;uniform highp float u_luminance;uniform lowp vec3 u_sun_direction;uniform highp vec4 u_color_tint_r;uniform highp vec4 u_color_tint_m; -#ifdef GL_ES -precision highp float; -#endif -#define BETA_R vec3(5.5e-6,13.0e-6,22.4e-6) -#define BETA_M vec3(21e-6,21e-6,21e-6) -#define MIE_G 0.76 -#define DENSITY_HEIGHT_SCALE_R 8000.0 -#define DENSITY_HEIGHT_SCALE_M 1200.0 -#define PLANET_RADIUS 6360e3 -#define ATMOSPHERE_RADIUS 6420e3 -#define SAMPLE_STEPS 10 -#define DENSITY_STEPS 4 -float ray_sphere_exit(vec3 orig,vec3 dir,float radius) {float a=dot(dir,dir);float b=2.0*dot(dir,orig);float c=dot(orig,orig)-radius*radius;float d=sqrt(b*b-4.0*a*c);return (-b+d)/(2.0*a);}vec3 extinction(vec2 density) {return exp(-vec3(BETA_R*u_color_tint_r.a*density.x+BETA_M*u_color_tint_m.a*density.y));}vec2 local_density(vec3 point) {float height=max(length(point)-PLANET_RADIUS,0.0);float exp_r=exp(-height/DENSITY_HEIGHT_SCALE_R);float exp_m=exp(-height/DENSITY_HEIGHT_SCALE_M);return vec2(exp_r,exp_m);}float phase_ray(float cos_angle) {return (3.0/(16.0*PI))*(1.0+cos_angle*cos_angle);}float phase_mie(float cos_angle) {return (3.0/(8.0*PI))*((1.0-MIE_G*MIE_G)*(1.0+cos_angle*cos_angle))/((2.0+MIE_G*MIE_G)*pow(1.0+MIE_G*MIE_G-2.0*MIE_G*cos_angle,1.5));}vec2 density_to_atmosphere(vec3 point,vec3 light_dir) {float ray_len=ray_sphere_exit(point,light_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(DENSITY_STEPS);vec2 density_point_to_atmosphere=vec2(0.0);for (int i=0; i < DENSITY_STEPS;++i) {vec3 point_on_ray=point+light_dir*((float(i)+0.5)*step_len);density_point_to_atmosphere+=local_density(point_on_ray)*step_len;;}return density_point_to_atmosphere;}vec3 atmosphere(vec3 ray_dir,vec3 sun_direction,float sun_intensity) {vec2 density_orig_to_point=vec2(0.0);vec3 scatter_r=vec3(0.0);vec3 scatter_m=vec3(0.0);vec3 origin=vec3(0.0,PLANET_RADIUS,0.0);float ray_len=ray_sphere_exit(origin,ray_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(SAMPLE_STEPS);for (int i=0; i < SAMPLE_STEPS;++i) {vec3 point_on_ray=origin+ray_dir*((float(i)+0.5)*step_len);vec2 density=local_density(point_on_ray)*step_len;density_orig_to_point+=density;vec2 density_point_to_atmosphere=density_to_atmosphere(point_on_ray,sun_direction);vec2 density_orig_to_atmosphere=density_orig_to_point+density_point_to_atmosphere;vec3 extinction=extinction(density_orig_to_atmosphere);scatter_r+=density.x*extinction;scatter_m+=density.y*extinction;}float cos_angle=dot(ray_dir,sun_direction);float phase_r=phase_ray(cos_angle);float phase_m=phase_mie(cos_angle);vec3 beta_r=BETA_R*u_color_tint_r.rgb*u_color_tint_r.a;vec3 beta_m=BETA_M*u_color_tint_m.rgb*u_color_tint_m.a;return (scatter_r*phase_r*beta_r+scatter_m*phase_m*beta_m)*sun_intensity;}const float A=0.15;const float B=0.50;const float C=0.10;const float D=0.20;const float E=0.02;const float F=0.30;vec3 uncharted2_tonemap(vec3 x) {return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;}void main() {vec3 ray_direction=v_position;ray_direction.y=pow(ray_direction.y,5.0);const float y_bias=0.015;ray_direction.y+=y_bias;vec3 color=atmosphere(normalize(ray_direction),u_sun_direction,u_sun_intensity);float white_scale=1.0748724675633854;color=uncharted2_tonemap((log2(2.0/pow(u_luminance,4.0)))*color)*white_scale;gl_FragColor=vec4(color,1.0);}`,"attribute highp vec3 a_pos_3f;uniform mat3 u_matrix_3f;varying highp vec3 v_position;float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec4 pos=vec4(u_matrix_3f*a_pos_3f,1.0);v_position=pos.xyz;v_position.y*=-1.0;v_position.y=map(v_position.y,-1.0,1.0,0.0,1.0);gl_Position=vec4(a_pos_3f.xy,0.0,1.0);}"),globeRaster:bt(`uniform sampler2D u_image0;varying vec2 v_pos0; -#ifndef FOG -uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform vec2 u_viewport; -#endif -void main() {vec4 color; -#ifdef CUSTOM_ANTIALIASING -vec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix( -mix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);vec3 dir=normalize(ray_dir);vec3 closest_point=dot(u_globe_pos,dir)*dir;float norm_dist_from_center=1.0-length(closest_point-u_globe_pos)/u_globe_radius;const float antialias_pixel=2.0;float antialias_factor=antialias_pixel*fwidth(norm_dist_from_center);float antialias=smoothstep(0.0,antialias_factor,norm_dist_from_center);vec4 raster=texture2D(u_image0,v_pos0);color=vec4(raster.rgb*antialias,raster.a*antialias); -#else -color=texture2D(u_image0,v_pos0); -#endif -#ifdef FOG -color=fog_dither(fog_apply_premultiplied(color,v_fog_pos)); -#endif -gl_FragColor=color; -#ifdef TERRAIN_WIREFRAME -gl_FragColor=vec4(1.0,0.0,0.0,0.8); -#endif -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_proj_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform float u_zoom_transition;uniform vec2 u_merc_center;uniform mat3 u_grid_matrix;uniform float u_skirt_height; -#ifdef GLOBE_POLES -attribute vec3 a_globe_pos;attribute vec2 a_uv; -#else -attribute vec2 a_pos; -#endif -varying vec2 v_pos0;const float wireframeOffset=1e3;float mercatorXfromLng(float lng) {return (180.0+lng)/360.0;}float mercatorYfromLat(float lat) {return (180.0-(RAD_TO_DEG*log(tan(QUARTER_PI+lat/2.0*DEG_TO_RAD))))/360.0;}vec3 latLngToECEF(vec2 latLng) {latLng=DEG_TO_RAD*latLng;float cosLat=cos(latLng[0]);float sinLat=sin(latLng[0]);float cosLng=cos(latLng[1]);float sinLng=sin(latLng[1]);float sx=cosLat*sinLng*GLOBE_RADIUS;float sy=-sinLat*GLOBE_RADIUS;float sz=cosLat*cosLng*GLOBE_RADIUS;return vec3(sx,sy,sz);}void main() { -#ifdef GLOBE_POLES -vec3 globe_pos=a_globe_pos;vec2 uv=a_uv; -#else -float tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];vec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float uvY=mercatorY*tiles-idy;float mercatorX=mercatorXfromLng(latLng[1]);float uvX=mercatorX*tiles-idx;vec3 globe_pos=latLngToECEF(latLng.xy);vec2 merc_pos=vec2(mercatorX,mercatorY);vec2 uv=vec2(uvX,uvY); -#endif -v_pos0=uv;vec2 tile_pos=uv*EXTENT;vec3 globe_derived_up_vector=normalize(globe_pos)*u_tile_up_scale; -#ifdef GLOBE_POLES -vec3 up_vector=globe_derived_up_vector; -#else -vec3 up_vector=elevationVector(tile_pos); -#endif -float height=elevation(tile_pos); -#ifdef TERRAIN_WIREFRAME -height+=wireframeOffset; -#endif -globe_pos+=up_vector*height; -#ifndef GLOBE_POLES -globe_pos-=globe_derived_up_vector*u_skirt_height*decomposed_pos_and_skirt.z; -#endif -#ifdef GLOBE_POLES -vec4 interpolated_pos=u_globe_matrix*vec4(globe_pos,1.0); -#else -vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {merc_world_pos=vec4(merc_pos,height-u_skirt_height*decomposed_pos_and_skirt.z,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition),1.0); -#endif -gl_Position=u_proj_matrix*interpolated_pos; -#ifdef FOG -v_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz); -#endif -}`),globeAtmosphere:bt(`uniform float u_transition;uniform highp float u_fadeout_range;uniform highp float u_temporal_offset;uniform vec3 u_start_color;uniform vec4 u_color;uniform vec4 u_space_color;uniform vec4 u_high_color;uniform float u_star_intensity;uniform float u_star_size;uniform float u_star_density;uniform float u_horizon_angle;uniform mat4 u_rotation_matrix;varying highp vec3 v_ray_dir;varying highp vec3 v_horizon_dir;highp float random(highp vec3 p) {p=fract(p*vec3(23.2342,97.1231,91.2342));p+=dot(p.zxy,p.yxz+123.1234);return fract(p.x*p.y);}float stars(vec3 p,float scale,vec2 offset) {vec2 uv_scale=(u_viewport/u_star_size)*scale;vec3 position=vec3(p.xy*uv_scale+offset*u_viewport,p.z);vec3 q=fract(position)-0.5;vec3 id=floor(position);float random_visibility=step(random(id),u_star_density);float circle=smoothstep(0.5+u_star_intensity,0.5,length(q));return circle*random_visibility;}void main() {highp vec3 dir=normalize(v_ray_dir);float globe_pos_dot_dir; -#ifdef PROJECTION_GLOBE_VIEW -globe_pos_dot_dir=dot(u_globe_pos,dir);highp vec3 closest_point_forward=abs(globe_pos_dot_dir)*dir;float norm_dist_from_center=length(closest_point_forward-u_globe_pos)/u_globe_radius;if (norm_dist_from_center < 0.98) {discard;return;} -#endif -highp vec3 horizon_dir=normalize(v_horizon_dir);float horizon_angle_mercator=dir.y < horizon_dir.y ? -0.0 : max(acos(dot(dir,horizon_dir)),0.0);float horizon_angle; -#ifdef PROJECTION_GLOBE_VIEW -highp vec3 closest_point=globe_pos_dot_dir*dir;float closest_point_to_center=length(closest_point-u_globe_pos);float theta=asin(clamp(closest_point_to_center/length(u_globe_pos),-1.0,1.0));horizon_angle=globe_pos_dot_dir < 0.0 ? -PI-theta-u_horizon_angle : theta-u_horizon_angle;float angle_t=pow(u_transition,10.0);horizon_angle=mix(horizon_angle,horizon_angle_mercator,angle_t); -#else -horizon_angle=horizon_angle_mercator; -#endif -horizon_angle/=PI;float t=exp(-horizon_angle/u_fadeout_range);float alpha_0=u_color.a;float alpha_1=u_high_color.a;float alpha_2=u_space_color.a;vec3 color_stop_0=u_color.rgb;vec3 color_stop_1=u_high_color.rgb;vec3 color_stop_2=u_space_color.rgb;vec3 c0=mix(color_stop_2,color_stop_1,alpha_1);vec3 c1=mix(c0,color_stop_0,alpha_0);vec3 c2=mix(c0,c1,t);vec3 c =mix(color_stop_2,c2,t);float a0=mix(alpha_2,1.0,alpha_1);float a1=mix(a0,1.0,alpha_0);float a2=mix(a0,a1,t);float a =mix(alpha_2,a2,t);vec2 uv=gl_FragCoord.xy/u_viewport-0.5;float aspect_ratio=u_viewport.x/u_viewport.y;vec4 uv_dir=vec4(normalize(vec3(uv.x*aspect_ratio,uv.y,1.0)),1.0);uv_dir=u_rotation_matrix*uv_dir;vec3 n=abs(uv_dir.xyz);vec2 uv_remap=(n.x > n.y && n.x > n.z) ? uv_dir.yz/uv_dir.x: -(n.y > n.x && n.y > n.z) ? uv_dir.zx/uv_dir.y: -uv_dir.xy/uv_dir.z;uv_remap.x/=aspect_ratio;vec3 D=vec3(uv_remap,1.0);highp float star_field=0.0;if (u_star_intensity > 0.0) {star_field+=stars(D,1.2,vec2(0.0,0.0));star_field+=stars(D,1.0,vec2(1.0,0.0));star_field+=stars(D,0.8,vec2(0.0,1.0));star_field+=stars(D,0.6,vec2(1.0,1.0));star_field*=(1.0-pow(t,0.25+(1.0-u_high_color.a)*0.75));c+=star_field*alpha_2;}c=dither(c,gl_FragCoord.xy+u_temporal_offset);gl_FragColor=vec4(c,a);}`,`attribute vec3 a_pos;attribute vec2 a_uv;uniform vec3 u_frustum_tl;uniform vec3 u_frustum_tr;uniform vec3 u_frustum_br;uniform vec3 u_frustum_bl;uniform float u_horizon;varying highp vec3 v_ray_dir;varying highp vec3 v_horizon_dir;void main() {v_ray_dir=mix( -mix(u_frustum_tl,u_frustum_tr,a_uv.x),mix(u_frustum_bl,u_frustum_br,a_uv.x),a_uv.y);v_horizon_dir=mix( -mix(u_frustum_tl,u_frustum_bl,u_horizon),mix(u_frustum_tr,u_frustum_br,u_horizon),a_uv.x);gl_Position=vec4(a_pos,1.0);}`)};function Kn(l,r){const o=l.replace(/\s*\/\/[^\n]*\n/g,` -`).split(` -`);for(let h of o)if(h=h.trim(),h[0]==="#"&&h.includes("if")&&!h.includes("endif")){h=h.replace("#","").replace(/ifdef|ifndef|elif|if/g,"").replace(/!|defined|\(|\)|\|\||&&/g,"").replace(/\s+/g," ").trim();const d=h.split(" ");for(const f of d)r.includes(f)||r.push(f)}}function bt(l,r){const o=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,h=r.match(/attribute (highp |mediump |lowp )?([\w]+) ([\w]+)/g),d={},f=[...Vo];return Kn(l,f),Kn(r,f),{fragmentSource:l=l.replace(o,(g,y,v,E,T)=>(d[T]=!0,y==="define"?` -#ifndef HAS_UNIFORM_u_${T} -varying ${v} ${E} ${T}; -#else -uniform ${v} ${E} u_${T}; -#endif -`:` -#ifdef HAS_UNIFORM_u_${T} - ${v} ${E} ${T} = u_${T}; -#endif -`)),vertexSource:r=r.replace(o,(g,y,v,E,T)=>{const A=E==="float"?"vec2":"vec4",k=T.match(/color/)?"color":A;return d[T]?y==="define"?` -#ifndef HAS_UNIFORM_u_${T} -uniform lowp float u_${T}_t; -attribute ${v} ${A} a_${T}; -varying ${v} ${E} ${T}; -#else -uniform ${v} ${E} u_${T}; -#endif -`:k==="vec4"?` -#ifndef HAS_UNIFORM_u_${T} - ${T} = a_${T}; -#else - ${v} ${E} ${T} = u_${T}; -#endif -`:` -#ifndef HAS_UNIFORM_u_${T} - ${T} = unpack_mix_${k}(a_${T}, u_${T}_t); -#else - ${v} ${E} ${T} = u_${T}; -#endif -`:y==="define"?` -#ifndef HAS_UNIFORM_u_${T} -uniform lowp float u_${T}_t; -attribute ${v} ${A} a_${T}; -#else -uniform ${v} ${E} u_${T}; -#endif -`:k==="vec4"?` -#ifndef HAS_UNIFORM_u_${T} - ${v} ${E} ${T} = a_${T}; -#else - ${v} ${E} ${T} = u_${T}; -#endif -`:` -#ifndef HAS_UNIFORM_u_${T} - ${v} ${E} ${T} = unpack_mix_${k}(a_${T}, u_${T}_t); -#else - ${v} ${E} ${T} = u_${T}; -#endif -`}),staticAttributes:h,usedDefines:f}}class Ch{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffers=[],this.vao=null}bind(r,o,h,d,f,g,y){this.context=r;let v=this.boundPaintVertexBuffers.length!==d.length;for(let T=0;!v&&T{const N=I.paint.get("hillshade-shadow-color"),j=I.paint.get("hillshade-highlight-color"),K=I.paint.get("hillshade-accent-color");let J=I.paint.get("hillshade-illumination-direction")*(Math.PI/180);I.paint.get("hillshade-illumination-anchor")==="viewport"&&(J-=B.transform.angle);const Y=!B.options.moving;return{u_matrix:L||B.transform.calculateProjMatrix(F.tileID.toUnwrapped(),Y),u_image:0,u_latrange:Ua(0,F.tileID),u_light:[I.paint.get("hillshade-exaggeration"),J],u_shadow:N,u_highlight:j,u_accent:K}})(l,o,h,l.terrain?r.projMatrix:null);l.prepareDrawProgram(y,T,r.toUnwrapped());const{tileBoundsBuffer:k,tileBoundsIndexBuffer:R,tileBoundsSegments:O}=l.getTileBoundsBuffers(o);T.draw(y,v.TRIANGLES,d,f,g,a.CullFaceMode.disabled,A,h.id,k,R,O)}function Va(l,r,o){if(!r.needsDEMTextureUpload)return;const h=l.context,d=h.gl;h.pixelStoreUnpackPremultiplyAlpha.set(!1),r.demTexture=r.demTexture||l.getTileTexture(o.stride);const f=o.getPixels();r.demTexture?r.demTexture.update(f,{premultiply:!1}):r.demTexture=new a.Texture(h,f,d.RGBA,{premultiply:!1}),r.needsDEMTextureUpload=!1}function cc(l,r,o,h,d,f){const g=l.context,y=g.gl;if(!r.dem)return;const v=r.dem;if(g.activeTexture.set(y.TEXTURE1),Va(l,r,v),!r.demTexture)return;r.demTexture.bind(y.NEAREST,y.CLAMP_TO_EDGE);const E=v.dim;g.activeTexture.set(y.TEXTURE0);let T=r.fbo;if(!T){const O=new a.Texture(g,{width:E,height:E,data:null},y.RGBA);O.bind(y.LINEAR,y.CLAMP_TO_EDGE),T=r.fbo=g.createFramebuffer(E,E,!0),T.colorAttachment.set(O.texture)}g.bindFramebuffer.set(T.framebuffer),g.viewport.set([0,0,E,E]);const{tileBoundsBuffer:A,tileBoundsIndexBuffer:k,tileBoundsSegments:R}=l.getMercatorTileBoundsBuffers();l.useProgram("hillshadePrepare").draw(g,y.TRIANGLES,h,d,f,a.CullFaceMode.disabled,((O,B)=>{const F=B.stride,I=a.create();return a.ortho(I,0,a.EXTENT,-a.EXTENT,0,0,1),a.translate(I,I,[0,-a.EXTENT,0]),{u_matrix:I,u_image:1,u_dimension:[F,F],u_zoom:O.overscaledZ,u_unpack:B.unpackVector}})(r.tileID,v),o.id,A,k,R),r.needsHillshadePrepare=!1}const Na=l=>({u_matrix:new a.UniformMatrix4f(l),u_image0:new a.Uniform1i(l),u_skirt_height:new a.Uniform1f(l)}),Yn=(l,r)=>({u_matrix:l,u_image0:0,u_skirt_height:r}),Cs=(l,r,o,h,d,f,g,y,v,E,T,A,k,R,O)=>({u_proj_matrix:Float32Array.from(l),u_globe_matrix:r,u_normalize_matrix:Float32Array.from(h),u_merc_matrix:o,u_zoom_transition:d,u_merc_center:f,u_image0:0,u_frustum_tl:g,u_frustum_tr:y,u_frustum_br:v,u_frustum_bl:E,u_globe_pos:T,u_globe_radius:A,u_viewport:k,u_grid_matrix:O?Float32Array.from(O):new Float32Array(9),u_skirt_height:R});function Jn(l,r){return l!=null&&r!=null&&!(!l.hasData()||!r.hasData())&&l.demTexture!=null&&r.demTexture!=null&&l.tileID.key!==r.tileID.key}const Pr=new class{constructor(){this.operations={}}newMorphing(l,r,o,h,d){if(l in this.operations){const f=this.operations[l];f.to.tileID.key!==o.tileID.key&&(f.queued=o)}else this.operations[l]={startTime:h,phase:0,duration:d,from:r,to:o,queued:null}}getMorphValuesForProxy(l){if(!(l in this.operations))return null;const r=this.operations[l];return{from:r.from,to:r.to,phase:r.phase}}update(l){for(const r in this.operations){const o=this.operations[r];for(o.phase=(l-o.startTime)/o.duration;o.phase>=1||!this._validOp(o);)if(!this._nextOp(o,l)){delete this.operations[r];break}}}_nextOp(l,r){return!!l.queued&&(l.from=l.to,l.to=l.queued,l.queued=null,l.phase=0,l.startTime=r,!0)}_validOp(l){return l.from.hasData()&&l.to.hasData()}},bn={0:null,1:"TERRAIN_VERTEX_MORPHING",2:"TERRAIN_WIREFRAME"};function zs(l){return 6*Math.pow(1.5,22-l)}function hc(l,r){const o=1<({u_matrix:l});function ja(l,r,o,h,d){if(d>0){const f=a.exported.now(),g=(f-l.timeAdded)/d,y=r?(f-r.timeAdded)/d:-1,v=o.getSource(),E=h.coveringZoomLevel({tileSize:v.tileSize,roundZoom:v.roundZoom}),T=!r||Math.abs(r.tileID.overscaledZ-E)>Math.abs(l.tileID.overscaledZ-E),A=T&&l.refreshedUponExpiration?1:a.clamp(T?g:1-y,0,1);return l.refreshedUponExpiration&&g>=1&&(l.refreshedUponExpiration=!1),r?{opacity:1,mix:1-A}:{opacity:A,mix:0}}return{opacity:1,mix:0}}class Ga extends a.SourceCache{constructor(r){const o={type:"raster-dem",maxzoom:r.transform.maxZoom},h=new oi(Zn(),null),d=nt("mock-dem",o,h,r.style);super("mock-dem",d,!1),d.setEventedParent(this),this._sourceLoaded=!0}_loadTile(r,o){r.state="loaded",o(null)}}class Ps extends a.SourceCache{constructor(r){const o=nt("proxy",{type:"geojson",maxzoom:r.transform.maxZoom},new oi(Zn(),null),r.style);super("proxy",o,!1),o.setEventedParent(this),this.map=this.getSource().map=r,this.used=this._sourceLoaded=!0,this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}update(r,o,h){if(r.freezeTileCoverage)return;this.transform=r;const d=r.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}).reduce((f,g)=>{if(f[g.key]="",!this._tiles[g.key]){const y=new a.Tile(g,this._source.tileSize*g.overscaleFactor(),r.tileZoom);y.state="loaded",this._tiles[g.key]=y}return f},{});for(const f in this._tiles)f in d||(this.freeFBO(f),this._tiles[f].unloadVectorData(),delete this._tiles[f])}freeFBO(r){const o=this.proxyCachedFBO[r];if(o!==void 0){const h=Object.values(o);this.renderCachePool.push(...h),delete this.proxyCachedFBO[r]}}deallocRenderCache(){this.renderCache.forEach(r=>r.fb.destroy()),this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}}class ks extends a.OverscaledTileID{constructor(r,o,h){super(r.overscaledZ,r.wrap,r.canonical.z,r.canonical.x,r.canonical.y),this.proxyTileKey=o,this.projMatrix=h}}class $a extends a.Elevation{constructor(r,o){super(),this.painter=r,this.terrainTileForTile={},this.prevTerrainTileForTile={};const[h,d,f]=function(v){const E=new a.StructArrayLayout2i4,T=new a.StructArrayLayout3ui6,A=131;E.reserve(17161),T.reserve(33800);const k=a.EXTENT/128,R=a.EXTENT+k/2,O=R+k;for(let F=-k;FR||F<0||F>R?24575:0,N=a.clamp(Math.round(I),0,a.EXTENT),j=a.clamp(Math.round(F),0,a.EXTENT);E.emplaceBack(N+L,j)}const B=(F,I)=>{const L=I*A+F;T.emplaceBack(L+1,L,L+A),T.emplaceBack(L+A,L+A+1,L+1)};for(let F=1;F<129;F++)for(let I=1;I<129;I++)B(I,F);return[0,129].forEach(F=>{for(let I=0;I<130;I++)B(I,F),B(F,I)}),[E,T,32768]}(),g=r.context;this.gridBuffer=g.createVertexBuffer(h,a.posAttributes.members),this.gridIndexBuffer=g.createIndexBuffer(d),this.gridSegments=a.SegmentVector.simpleSegment(0,0,h.length,d.length),this.gridNoSkirtSegments=a.SegmentVector.simpleSegment(0,0,h.length,f),this.proxyCoords=[],this.proxiedCoords={},this._visibleDemTiles=[],this._drapedRenderBatches=[],this._sourceTilesOverlap={},this.proxySourceCache=new Ps(o.map),this.orthoMatrix=a.create(),a.ortho(this.orthoMatrix,this.painter.transform.projection.name==="globe"?.015:0,a.EXTENT,0,a.EXTENT,0,1);const y=g.gl;this._overlapStencilMode=new a.StencilMode({func:y.GEQUAL,mask:255},0,255,y.KEEP,y.KEEP,y.REPLACE),this._previousZoom=r.transform.zoom,this.pool=[],this._findCoveringTileCache={},this._tilesDirty={},this.style=o,this._useVertexMorphing=!0,this._exaggeration=1,this._mockSourceCache=new Ga(o.map)}set style(r){r.on("data",this._onStyleDataEvent.bind(this)),r.on("neworder",this._checkRenderCacheEfficiency.bind(this)),this._style=r,this._checkRenderCacheEfficiency(),this._style.map.on("moveend",()=>{this._clearLineLayersFromRenderCache()})}update(r,o,h){if(r&&r.terrain){this._style!==r&&(this.style=r),this.enabled=!0;const d=r.terrain.properties;this.sourceCache=r.terrain.drapeRenderMode===0?this._mockSourceCache:r._getSourceCache(d.get("source")),this._exaggeration=d.get("exaggeration");const f=()=>{this.sourceCache.used&&a.warnOnce(`Raster DEM source '${this.sourceCache.id}' is used both for terrain and as layer source. -This leads to lower resolution of hillshade. For full hillshade resolution but higher memory consumption, define another raster DEM source.`);const g=this.getScaledDemTileSize();this.sourceCache.update(o,g,!0),this.resetTileLookupCache(this.sourceCache.id)};this.sourceCache.usedForTerrain||(this.resetTileLookupCache(this.sourceCache.id),this.sourceCache.usedForTerrain=!0,f(),this._initializing=!0),f(),o.updateElevation(!0,h),this.resetTileLookupCache(this.proxySourceCache.id),this.proxySourceCache.update(o),this._emptyDEMTextureDirty=!0}else this._disable()}resetTileLookupCache(r){this._findCoveringTileCache[r]={}}getScaledDemTileSize(){return this.sourceCache.getSource().tileSize/128*this.proxySourceCache.getSource().tileSize}_checkRenderCacheEfficiency(){const r=this.renderCacheEfficiency(this._style);this._style.map._optimizeForTerrain||r.efficiency!==100&&a.warnOnce(`Terrain render cache efficiency is not optimal (${r.efficiency}%) and performance - may be affected negatively, consider placing all background, fill and line layers before layer - with id '${r.firstUndrapedLayer}' or create a map using optimizeForTerrain: true option.`)}_onStyleDataEvent(r){r.coord&&r.dataType==="source"?this._clearRenderCacheForTile(r.sourceCacheId,r.coord):r.dataType==="style"&&(this._invalidateRenderCache=!0)}_disable(){if(this.enabled&&(this.enabled=!1,this._sharedDepthStencil=void 0,this.proxySourceCache.deallocRenderCache(),this._style))for(const r in this._style._sourceCaches)this._style._sourceCaches[r].usedForTerrain=!1}destroy(){this._disable(),this._emptyDEMTexture&&this._emptyDEMTexture.destroy(),this._emptyDepthBufferTexture&&this._emptyDepthBufferTexture.destroy(),this.pool.forEach(r=>r.fb.destroy()),this.pool=[],this._depthFBO&&(this._depthFBO.destroy(),this._depthFBO=void 0,this._depthTexture=void 0)}_source(){return this.enabled?this.sourceCache:null}isUsingMockSource(){return this.sourceCache===this._mockSourceCache}exaggeration(){return this._exaggeration}get visibleDemTiles(){return this._visibleDemTiles}get drapeBufferSize(){const r=2*this.proxySourceCache.getSource().tileSize;return[r,r]}set useVertexMorphing(r){this._useVertexMorphing=r}updateTileBinding(r){if(!this.enabled)return;this.prevTerrainTileForTile=this.terrainTileForTile;const o=this.proxySourceCache,h=this.painter.transform;this._initializing&&(this._initializing=h._centerAltitude===0&&this.getAtPointOrZero(a.MercatorCoordinate.fromLngLat(h.center),-1)===-1,this._emptyDEMTextureDirty=!this._initializing);const d=this.proxyCoords=o.getIds().map(v=>{const E=o.getTileByID(v).tileID;return E.projMatrix=h.calculateProjMatrix(E.toUnwrapped()),E});(function(v,E){const T=E.transform.pointCoordinate(E.transform.getCameraPoint()),A=new a.Point(T.x,T.y);v.sort((k,R)=>{if(R.overscaledZ-k.overscaledZ)return R.overscaledZ-k.overscaledZ;const O=new a.Point(k.canonical.x+(1<{this.proxyToSource[v.key]={}}),this.terrainTileForTile={};const g=this._style._sourceCaches;for(const v in g){const E=g[v];if(!E.used||(E!==this.sourceCache&&this.resetTileLookupCache(E.id),this._setupProxiedCoordsForOrtho(E,r[v],f),E.usedForTerrain))continue;const T=r[v];E.getSource().reparseOverscaled&&this._assignTerrainTiles(T)}this.proxiedCoords[o.id]=d.map(v=>new ks(v,v.key,this.orthoMatrix)),this._assignTerrainTiles(d),this._prepareDEMTextures(),this._setupDrapedRenderBatches(),this._initFBOPool(),this._setupRenderCache(f),this.renderingToTexture=!1,this._updateTimestamp=a.exported.now();const y={};this._visibleDemTiles=[];for(const v of this.proxyCoords){const E=this.terrainTileForTile[v.key];if(!E)continue;const T=E.tileID.key;T in y||(this._visibleDemTiles.push(E),y[T]=T)}}_assignTerrainTiles(r){this._initializing||r.forEach(o=>{if(this.terrainTileForTile[o.key])return;const h=this._findTileCoveringTileID(o,this.sourceCache);h&&(this.terrainTileForTile[o.key]=h)})}_prepareDEMTextures(){const r=this.painter.context,o=r.gl;for(const h in this.terrainTileForTile){const d=this.terrainTileForTile[h],f=d.dem;!f||d.demTexture&&!d.needsDEMTextureUpload||(r.activeTexture.set(o.TEXTURE1),Va(this.painter,d,f))}}_prepareDemTileUniforms(r,o,h,d){if(!o||o.demTexture==null)return!1;const f=r.tileID.canonical,g=Math.pow(2,o.tileID.canonical.z-f.z),y=d||"";return h[`u_dem_tl${y}`]=[f.x*g%1,f.y*g%1],h[`u_dem_scale${y}`]=g,!0}get emptyDEMTexture(){return!this._emptyDEMTextureDirty&&this._emptyDEMTexture?this._emptyDEMTexture:this._updateEmptyDEMTexture()}get emptyDepthBufferTexture(){const r=this.painter.context,o=r.gl;if(!this._emptyDepthBufferTexture){const h=new a.RGBAImage({width:1,height:1},Uint8Array.of(255,255,255,255));this._emptyDepthBufferTexture=new a.Texture(r,h,o.RGBA,{premultiply:!1})}return this._emptyDepthBufferTexture}_getLoadedAreaMinimum(){let r=0;const o=this._visibleDemTiles.reduce((h,d)=>{if(!d.dem)return h;const f=d.dem.tree.minimums[0];return f>0&&r++,h+f},0);return r?o/r:0}_updateEmptyDEMTexture(){const r=this.painter.context,o=r.gl;r.activeTexture.set(o.TEXTURE2);const h=this._getLoadedAreaMinimum(),d=new a.RGBAImage({width:1,height:1},new Uint8Array(a.DEMData.pack(h,this.sourceCache.getSource().encoding)));this._emptyDEMTextureDirty=!1;let f=this._emptyDEMTexture;return f?f.update(d,{premultiply:!1}):f=this._emptyDEMTexture=new a.Texture(r,d,o.RGBA,{premultiply:!1}),f}setupElevationDraw(r,o,h){const d=this.painter.context,f=d.gl,g=(y=this.sourceCache.getSource().encoding,{u_dem:2,u_dem_prev:4,u_dem_unpack:a.DEMData.getUnpackVector(y),u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_exaggeration:0});var y;g.u_dem_size=this.sourceCache.getSource().tileSize,g.u_exaggeration=this.exaggeration();let v=null,E=null,T=1;if(h&&h.morphing&&this._useVertexMorphing){const A=h.morphing.srcDemTile,k=h.morphing.dstDemTile;T=h.morphing.phase,A&&k&&(this._prepareDemTileUniforms(r,A,g,"_prev")&&(E=A),this._prepareDemTileUniforms(r,k,g)&&(v=k))}if(E&&v?(d.activeTexture.set(f.TEXTURE2),v.demTexture.bind(f.NEAREST,f.CLAMP_TO_EDGE,f.NEAREST),d.activeTexture.set(f.TEXTURE4),E.demTexture.bind(f.NEAREST,f.CLAMP_TO_EDGE,f.NEAREST),g.u_dem_lerp=T):(v=this.terrainTileForTile[r.tileID.key],d.activeTexture.set(f.TEXTURE2),(this._prepareDemTileUniforms(r,v,g)?v.demTexture:this.emptyDEMTexture).bind(f.NEAREST,f.CLAMP_TO_EDGE)),d.activeTexture.set(f.TEXTURE3),h&&h.useDepthForOcclusion?(this._depthTexture&&this._depthTexture.bind(f.NEAREST,f.CLAMP_TO_EDGE),this._depthFBO&&(g.u_depth_size_inv=[1/this._depthFBO.width,1/this._depthFBO.height])):(this.emptyDepthBufferTexture.bind(f.NEAREST,f.CLAMP_TO_EDGE),g.u_depth_size_inv=[1,1]),h&&h.useMeterToDem&&v){const A=(1<{if(I===we)return;const _e=[bn[we],"PROJECTION_GLOBE_VIEW"];j&&_e.push("CUSTOM_ANTIALIASING"),ae&&_e.push(bn[L]),F=E.useProgram("globeRaster",null,_e),I=we},J=E.colorModeForRenderPass(),Y=new a.DepthMode(B.LEQUAL,a.DepthMode.ReadWrite,E.depthRangeFor3D);Pr.update(R);const ie=a.calculateGlobeMercatorMatrix(N),te=[a.mercatorXfromLng(N.center.lng),a.mercatorYfromLat(N.center.lat)],le=L?[!1,!0]:[!1],Te=E.globeSharedBuffers,oe=[N.width*a.exported.devicePixelRatio,N.height*a.exported.devicePixelRatio],ge=Float32Array.from(N.globeMatrix),he={useDenormalizedUpVectorScale:!0};if(le.forEach(we=>{const ae=E.transform,_e=zs(ae.zoom)*T.exaggeration();I=-1;const Me=we?B.LINES:B.TRIANGLES;for(const ve of k){const Ae=A.getTile(ve),Ge=a.StencilMode.disabled,Xe=T.prevTerrainTileForTile[ve.key],Ve=T.terrainTileForTile[ve.key];Jn(Xe,Ve)&&Pr.newMorphing(ve.key,Xe,Ve,R,250),O.activeTexture.set(B.TEXTURE0),Ae.texture.bind(B.LINEAR,B.CLAMP_TO_EDGE);const qe=Pr.getMorphValuesForProxy(ve.key),lt=qe?1:0;qe&&a.extend$1(he,{morphing:{srcDemTile:qe.from,dstDemTile:qe.to,phase:a.easeCubicInOut(qe.phase)}});const ot=a.tileCornersToBounds(ve.canonical),je=a.getLatitudinalLod(ot.getCenter().lat),wt=a.getGridMatrix(ve.canonical,ot,je,ae.worldSize/ae._pixelsPerMercatorPixel),Tt=a.globeNormalizeECEF(a.globeTileBounds(ve.canonical)),Et=Cs(ae.projMatrix,ge,ie,Tt,a.globeToMercatorTransition(ae.zoom),te,ae.frustumCorners.TL,ae.frustumCorners.TR,ae.frustumCorners.BR,ae.frustumCorners.BL,ae.globeCenterInViewSpace,ae.globeRadius,oe,_e,wt);if(K(lt,we),T.setupElevationDraw(Ae,F,he),E.prepareDrawProgram(O,F,ve.toUnwrapped()),Te){const[St,vi,ui]=we?Te.getWirefameBuffers(E.context,je):Te.getGridBuffers(je,_e!==0);F.draw(O,Me,Y,Ge,J,a.CullFaceMode.backCCW,Et,"globe_raster",St,vi,ui)}}}),Te){const we=["GLOBE_POLES","PROJECTION_GLOBE_VIEW"];j&&we.push("CUSTOM_ANTIALIASING"),F=E.useProgram("globeRaster",null,we);for(const ae of k){const{x:_e,y:Me,z:ve}=ae.canonical,Ae=Me===0,Ge=Me===(1<Et.draw(O,B.TRIANGLES,Y,a.StencilMode.disabled,J,a.CullFaceMode.disabled,Cs(N.projMatrix,je,je,wt,0,te,N.frustumCorners.TL,N.frustumCorners.TR,N.frustumCorners.BR,N.frustumCorners.BL,N.globeCenterInViewSpace,N.globeRadius,oe,0),"globe_pole_raster",St,qe,lt);T.setupElevationDraw(ot,F,he),E.prepareDrawProgram(O,F,ae.toUnwrapped()),Ae&&Tt(F,Xe),Ge&&(je=a.scale(a.create(),je,[1,-1,1]),Tt(F,Ve))}}}})(d,f,g,y,v);else{const E=d.context,T=E.gl;let A,k;const R=d.options.showTerrainWireframe?2:0,O=(N,j)=>{if(k===N)return;const K=[bn[N]];j&&K.push(bn[R]),A=d.useProgram("terrainRaster",null,K),k=N},B=d.colorModeForRenderPass(),F=new a.DepthMode(T.LEQUAL,a.DepthMode.ReadWrite,d.depthRangeFor3D);Pr.update(v);const I=d.transform,L=zs(I.zoom)*f.exaggeration();(R?[!1,!0]:[!1]).forEach(N=>{k=-1;const j=N?T.LINES:T.TRIANGLES,[K,J]=N?f.getWirefameBuffer():[f.gridIndexBuffer,f.gridSegments];for(const Y of y){const ie=g.getTile(Y),te=a.StencilMode.disabled,le=f.prevTerrainTileForTile[Y.key],Te=f.terrainTileForTile[Y.key];Jn(le,Te)&&Pr.newMorphing(Y.key,le,Te,v,250),E.activeTexture.set(T.TEXTURE0),ie.texture.bind(T.LINEAR,T.CLAMP_TO_EDGE,T.LINEAR_MIPMAP_NEAREST);const oe=Pr.getMorphValuesForProxy(Y.key),ge=oe?1:0;let he;oe&&(he={morphing:{srcDemTile:oe.from,dstDemTile:oe.to,phase:a.easeCubicInOut(oe.phase)}});const we=Yn(Y.projMatrix,hc(Y.canonical,I.renderWorldCopies)?L/10:L);O(ge,N),f.setupElevationDraw(ie,A,he),d.prepareDrawProgram(E,A,Y.toUnwrapped()),A.draw(E,j,F,te,B,a.CullFaceMode.backCCW,we,"terrain_raster",f.gridBuffer,K,J)}})}}(o,this,this.proxySourceCache,r,this._updateTimestamp),this.renderingToTexture=!0,o.gpuTimingDeferredRenderEnd(),r.splice(0,r.length))}renderBatch(r){if(this._drapedRenderBatches.length===0)return r+1;this.renderingToTexture=!0;const o=this.painter,h=this.painter.context,d=this.proxySourceCache,f=this.proxiedCoords[d.id],g=this._drapedRenderBatches.shift(),y=[],v=o.style.order;let E=0;for(const T of f){const A=d.getTileByID(T.proxyTileKey),k=d.proxyCachedFBO[T.key]?d.proxyCachedFBO[T.key][r]:void 0,R=k!==void 0?d.renderCache[k]:this.pool[E++],O=k!==void 0;if(A.texture=R.tex,O&&!R.dirty){y.push(A.tileID);continue}let B;h.bindFramebuffer.set(R.fb.framebuffer),this.renderedToTile=!1,R.dirty&&(h.clear({color:a.Color.transparent,stencil:0}),R.dirty=!1);for(let F=g.start;F<=g.end;++F){const I=o.style._layers[v[F]];if(I.isHidden(o.transform.zoom))continue;const L=o.style._getLayerSourceCache(I),N=L?this.proxyToSource[T.key][L.id]:[T];if(!N)continue;const j=N;h.viewport.set([0,0,R.fb.width,R.fb.height]),B!==(L?L.id:null)&&(this._setupStencil(R,N,I,L),B=L?L.id:null),o.renderLayer(o,L,I,j)}this.renderedToTile?(R.dirty=!0,y.push(A.tileID)):O||--E,E===5&&(E=0,this.renderToBackBuffer(y))}return this.renderToBackBuffer(y),this.renderingToTexture=!1,h.bindFramebuffer.set(null),h.viewport.set([0,0,o.width,o.height]),g.end+1}postRender(){}renderCacheEfficiency(r){const o=r.order.length;if(o===0)return{efficiency:100};let h,d=0,f=0,g=!1;for(let y=0;yo.dem).forEach(o=>{r=Math.min(r,o.dem.tree.minimums[0])}),r===0?r:(r-30)*this._exaggeration}raycast(r,o,h){if(!this._visibleDemTiles)return null;const d=this._visibleDemTiles.filter(f=>f.dem).map(f=>{const g=f.tileID,y=1<(f.t!==null?f.t:Number.MAX_VALUE)-(g.t!==null?g.t:Number.MAX_VALUE));for(const f of d){if(f.t==null)return null;const g=f.tile.dem.tree.raycast(f.minx,f.miny,f.maxx,f.maxy,r,o,h);if(g!=null)return g}return null}_createFBO(){const r=this.painter.context,o=r.gl,h=this.drapeBufferSize;r.activeTexture.set(o.TEXTURE0);const d=new a.Texture(r,{width:h[0],height:h[1],data:null},o.RGBA);d.bind(o.LINEAR,o.CLAMP_TO_EDGE);const f=r.createFramebuffer(h[0],h[1],!1);return f.colorAttachment.set(d.texture),f.depthAttachment=new Q(r,f.framebuffer),this._sharedDepthStencil===void 0?(this._sharedDepthStencil=r.createRenderbuffer(r.gl.DEPTH_STENCIL,h[0],h[1]),this._stencilRef=0,f.depthAttachment.set(this._sharedDepthStencil),r.clear({stencil:0})):f.depthAttachment.set(this._sharedDepthStencil),r.extTextureFilterAnisotropic&&!r.extTextureFilterAnisotropicForceOff&&o.texParameterf(o.TEXTURE_2D,r.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,r.extTextureFilterAnisotropicMax),{fb:f,tex:d,dirty:!1}}_initFBOPool(){for(;this.pool.length{const o=this._style._layers[r],h=o.isHidden(this.painter.transform.zoom);return o.type==="custom"?!h&&o.shouldRedrape():!h&&o.hasTransition()})}_clearLineLayersFromRenderCache(){let r=!1;for(const h of this._style._getSources())if(h instanceof ke){r=!0;break}if(!r)return;const o={};for(let h=0;ho.renderCachePool.length){const g=Object.values(o.proxyCachedFBO);o.proxyCachedFBO={};for(let y=0;y=0;g--){const y=h[g];if(o.getTileByID(y.key),o.proxyCachedFBO[y.key]!==void 0){const v=r[y.key],E=this.proxyToSource[y.key];let T=0;for(const A in E){const k=E[A],R=v[A];if(!R||R.length!==k.length||k.some((O,B)=>O!==R[B]||d[A]&&d[A].hasOwnProperty(O.key))){T=-1;break}++T}for(const A in o.proxyCachedFBO[y.key])o.renderCache[o.proxyCachedFBO[y.key][A]].dirty=T<0||T!==Object.values(v).length}}const f=[...this._drapedRenderBatches];f.sort((g,y)=>y.end-y.start-(g.end-g.start));for(const g of f)for(const y of h){if(o.proxyCachedFBO[y.key])continue;let v=o.renderCachePool.pop();v===void 0&&o.renderCache.length<50&&(v=o.renderCache.length,o.renderCache.push(this._createFBO())),v!==void 0&&(o.proxyCachedFBO[y.key]={},o.proxyCachedFBO[y.key][g.start]=v,o.renderCache[v].dirty=!0)}this._tilesDirty={}}_setupStencil(r,o,h,d){if(!d||!this._sourceTilesOverlap[d.id])return void(this._overlapStencilType&&(this._overlapStencilType=!1));const f=this.painter.context,g=f.gl;if(o.length<=1)return void(this._overlapStencilType=!1);let y;if(h.isTileClipped())y=o.length,this._overlapStencilMode.test={func:g.EQUAL,mask:255},this._overlapStencilType="Clip";else{if(!(o[0].overscaledZ>o[o.length-1].overscaledZ))return void(this._overlapStencilType=!1);y=1,this._overlapStencilMode.test={func:g.GREATER,mask:255},this._overlapStencilType="Mask"}this._stencilRef+y>255&&(f.clear({stencil:0}),this._stencilRef=0),this._stencilRef+=y,this._overlapStencilMode.ref=this._stencilRef,h.isTileClipped()&&this._renderTileClippingMasks(o,this._overlapStencilMode.ref)}clipOrMaskOverlapStencilType(){return this._overlapStencilType==="Clip"||this._overlapStencilType==="Mask"}stencilModeForRTTOverlap(r){return this.renderingToTexture&&this._overlapStencilType?(this._overlapStencilType==="Clip"&&(this._overlapStencilMode.ref=this.painter._tileClippingMaskIDs[r.key]),this._overlapStencilMode):a.StencilMode.disabled}_renderTileClippingMasks(r,o){const h=this.painter,d=this.painter.context,f=d.gl;h._tileClippingMaskIDs={},d.setColorMode(a.ColorMode.disabled),d.setDepthMode(a.DepthMode.disabled);const g=h.useProgram("clippingMask");for(const y of r){const v=h._tileClippingMaskIDs[y.key]=--o;g.draw(d,f.TRIANGLES,a.DepthMode.disabled,new a.StencilMode({func:f.ALWAYS,mask:0},v,255,f.KEEP,f.KEEP,f.REPLACE),a.ColorMode.disabled,a.CullFaceMode.disabled,No(y.projMatrix),"$clipping",h.tileExtentBuffer,h.quadTriangleIndexBuffer,h.tileExtentSegments)}}pointCoordinate(r){const o=this.painter.transform;if(r.x<0||r.x>o.width||r.y<0||r.y>o.height)return null;const h=[r.x,r.y,1,1];a.transformMat4$1(h,h,o.pixelMatrixInverse),a.scale$1(h,h,1/h[3]),h[0]/=o.worldSize,h[1]/=o.worldSize;const d=o._camera.position,f=a.mercatorZfromAltitude(1,o.center.lat),g=[d[0],d[1],d[2]/f,0],y=a.subtract([],h.slice(0,3),g);a.normalize(y,y);const v=this.raycast(g,y,this._exaggeration);return v!==null&&v?(a.scaleAndAdd(g,g,y,v),g[3]=g[2],g[2]*=f,g):null}drawDepth(){const r=this.painter,o=r.context,h=this.proxySourceCache,d=Math.ceil(r.width),f=Math.ceil(r.height);if(!this._depthFBO||this._depthFBO.width===d&&this._depthFBO.height===f||(this._depthFBO.destroy(),this._depthFBO=void 0,this._depthTexture=void 0),!this._depthFBO){const g=o.gl,y=o.createFramebuffer(d,f,!0);o.activeTexture.set(g.TEXTURE0);const v=new a.Texture(o,{width:d,height:f,data:null},g.RGBA);v.bind(g.NEAREST,g.CLAMP_TO_EDGE),y.colorAttachment.set(v.texture);const E=o.createRenderbuffer(o.gl.DEPTH_COMPONENT16,d,f);y.depthAttachment.set(E),this._depthFBO=y,this._depthTexture=v}o.bindFramebuffer.set(this._depthFBO.framebuffer),o.viewport.set([0,0,d,f]),function(g,y,v,E){if(g.transform.projection.name==="globe")return;const T=g.context,A=T.gl;T.clear({depth:1});const k=g.useProgram("terrainDepth"),R=new a.DepthMode(A.LESS,a.DepthMode.ReadWrite,g.depthRangeFor3D);for(const O of E){const B=v.getTile(O),F=Yn(O.projMatrix,0);y.setupElevationDraw(B,k),k.draw(T,A.TRIANGLES,R,a.StencilMode.disabled,a.ColorMode.unblended,a.CullFaceMode.backCCW,F,"terrain_depth",y.gridBuffer,y.gridIndexBuffer,y.gridNoSkirtSegments)}}(r,this,h,this.proxyCoords)}_setupProxiedCoordsForOrtho(r,o,h){if(r.getSource()instanceof rt)return this._setupProxiedCoordsForImageSource(r,o,h);this._findCoveringTileCache[r.id]=this._findCoveringTileCache[r.id]||{};const d=this.proxiedCoords[r.id]=[],f=this.proxyCoords;for(let y=0;y(T.min.x=Math.min(T.min.x,A.x-y.x),T.min.y=Math.min(T.min.y,A.y-y.y),T.max.x=Math.max(T.max.x,A.x-y.x),T.max.y=Math.max(T.max.y,A.y-y.y),T),{min:new a.Point(Number.MAX_VALUE,Number.MAX_VALUE),max:new a.Point(-Number.MAX_VALUE,-Number.MAX_VALUE)}),E=(T,A)=>{const k=T.wrap+T.canonical.x/(1<B+v.max.x||R+OF+v.max.y};for(let T=0;Tg.key===o.tileID.key);if(f)return f}if(o.tileID.key!==r.key){const f=r.canonical.z-o.tileID.canonical.z;let g,y,v;d=a.create();const E=o.tileID.wrap-r.wrap<0?(g=a.EXTENT>>f,y=g*((o.tileID.canonical.x<=A){const k=r.canonical.z-A;o.getSource().reparseOverscaled?(y=Math.max(r.canonical.z+2,o.transform.tileZoom),g=new a.OverscaledTileID(y,r.wrap,A,r.canonical.x>>k,r.canonical.y>>k)):k!==0&&(y=A,g=new a.OverscaledTileID(y,r.wrap,A,r.canonical.x>>k,r.canonical.y>>k))}g.key!==r.key&&(E.push(g.key),h=o.getTile(g))}const T=A=>{E.forEach(k=>{d[k]=A}),E.length=0};for(y-=1;y>=v&&(!h||!h.hasData());y--){h&&T(h.tileID.key);const A=g.calculateScaledKey(y);if(h=o.getTileByID(A),h&&h.hasData())break;const k=d[A];if(k===null)break;k===void 0?E.push(A):h=o.getTileByID(k)}return T(h?h.tileID.key:null),h&&h.hasData()?h:null}findDEMTileFor(r){return this.enabled?this._findTileCoveringTileID(r,this.sourceCache):null}prepareDrawTile(){this.renderedToTile=!0}_clearRenderCacheForTile(r,o){let h=this._tilesDirty[r];h||(h=this._tilesDirty[r]={}),h[o.key]=!0}getWirefameBuffer(){if(!this.wireframeSegments){const r=function(o){let h=0;const d=new a.StructArrayLayout2ui4,f=131;for(let g=1;g<129;g++){for(let y=1;y<129;y++)h=g*f+y,d.emplaceBack(h,h+1),d.emplaceBack(h,h+f),d.emplaceBack(h+1,h+f),g===128&&d.emplaceBack(h+f,h+f+1);d.emplaceBack(h+1,h+1+f)}return d}();this.wireframeIndexBuffer=this.painter.context.createIndexBuffer(r),this.wireframeSegments=a.SegmentVector.simpleSegment(0,0,this.gridBuffer.length,r.length)}return[this.wireframeIndexBuffer,this.wireframeSegments]}}class mt{static cacheKey(r,o,h,d){let f=`${o}${d?d.cacheKey:""}`;for(const g of h)r.usedDefines.includes(g)&&(f+=`/${g}`);return f}constructor(r,o,h,d,f,g){const y=r.gl;this.program=y.createProgram();const v=function(I){const L=[];for(let N=0;N`#define ${I}`));const k=r.isWebGL2?`#version 300 es -`:"",R=k+A.concat(r.extStandardDerivatives&&k.length===0?`#extension GL_OES_standard_derivatives : enable -`.concat(Oa):Oa,Oa,Is,ac.fragmentSource,Hn.fragmentSource,h.fragmentSource).join(` -`),O=k+A.concat(` -#ifdef GL_ES -precision highp float; -#else - -#if !defined(lowp) -#define lowp -#endif - -#if !defined(mediump) -#define mediump -#endif - -#if !defined(highp) -#define highp -#endif - -#endif`,Is,ac.vertexSource,Hn.vertexSource,As.vertexSource,h.vertexSource).join(` -`),B=y.createShader(y.FRAGMENT_SHADER);if(y.isContextLost())return void(this.failedToCreate=!0);y.shaderSource(B,R),y.compileShader(B),y.attachShader(this.program,B);const F=y.createShader(y.VERTEX_SHADER);if(y.isContextLost())this.failedToCreate=!0;else{y.shaderSource(F,O),y.compileShader(F),y.attachShader(this.program,F),this.attributes={},this.numAttributes=T.length;for(let I=0;I({u_dem:new a.Uniform1i(I),u_dem_prev:new a.Uniform1i(I),u_dem_unpack:new a.Uniform4f(I),u_dem_tl:new a.Uniform2f(I),u_dem_scale:new a.Uniform1f(I),u_dem_tl_prev:new a.Uniform2f(I),u_dem_scale_prev:new a.Uniform1f(I),u_dem_size:new a.Uniform1f(I),u_dem_lerp:new a.Uniform1f(I),u_exaggeration:new a.Uniform1f(I),u_depth:new a.Uniform1i(I),u_depth_size_inv:new a.Uniform2f(I),u_meter_to_dem:new a.Uniform1f(I),u_label_plane_matrix_inv:new a.UniformMatrix4f(I)}))(r)),g.includes("GLOBE")&&(this.globeUniforms=(I=>({u_tile_tl_up:new a.Uniform3f(I),u_tile_tr_up:new a.Uniform3f(I),u_tile_br_up:new a.Uniform3f(I),u_tile_bl_up:new a.Uniform3f(I),u_tile_up_scale:new a.Uniform1f(I)}))(r)),g.includes("FOG")&&(this.fogUniforms=(I=>({u_fog_matrix:new a.UniformMatrix4f(I),u_fog_range:new a.Uniform2f(I),u_fog_color:new a.Uniform4f(I),u_fog_horizon_blend:new a.Uniform1f(I),u_fog_temporal_offset:new a.Uniform1f(I),u_frustum_tl:new a.Uniform3f(I),u_frustum_tr:new a.Uniform3f(I),u_frustum_br:new a.Uniform3f(I),u_frustum_bl:new a.Uniform3f(I),u_globe_pos:new a.Uniform3f(I),u_globe_radius:new a.Uniform1f(I),u_globe_transition:new a.Uniform1f(I),u_is_globe:new a.Uniform1i(I),u_viewport:new a.Uniform2f(I)}))(r))}}setTerrainUniformValues(r,o){if(!this.terrainUniforms)return;const h=this.terrainUniforms;if(!this.failedToCreate){r.program.set(this.program);for(const d in o)h[d]&&h[d].set(this.program,d,o[d])}}setGlobeUniformValues(r,o){if(!this.globeUniforms)return;const h=this.globeUniforms;if(!this.failedToCreate){r.program.set(this.program);for(const d in o)h[d]&&h[d].set(this.program,d,o[d])}}setFogUniformValues(r,o){if(!this.fogUniforms)return;const h=this.fogUniforms;if(!this.failedToCreate){r.program.set(this.program);for(const d in o)h[d].set(this.program,d,o[d])}}draw(r,o,h,d,f,g,y,v,E,T,A,k,R,O,B){const F=r.gl;if(this.failedToCreate)return;r.program.set(this.program),r.setDepthMode(h),r.setStencilMode(d),r.setColorMode(f),r.setCullFace(g);for(const L of Object.keys(this.fixedUniforms))this.fixedUniforms[L].set(this.program,L,y[L]);O&&O.setUniforms(this.program,r,this.binderUniforms,k,{zoom:R});const I={[F.LINES]:2,[F.TRIANGLES]:3,[F.LINE_STRIP]:1}[o];for(const L of A.get()){const N=L.vaos||(L.vaos={});(N[v]||(N[v]=new Ch)).bind(r,this,E,O?O.getPaintVertexBuffers():[],T,L.vertexOffset,B||[]),F.drawElements(o,L.primitiveLength*I,F.UNSIGNED_SHORT,L.primitiveOffset*I*2)}}}function jo(l,r){const o=Math.pow(2,r.tileID.overscaledZ),h=r.tileSize*Math.pow(2,l.transform.tileZoom)/o,d=h*(r.tileID.canonical.x+r.tileID.wrap*o),f=h*r.tileID.canonical.y;return{u_image:0,u_texsize:r.imageAtlasTexture.size,u_tile_units_to_pixels:1/ai(r,1,l.transform.tileZoom),u_pixel_coord_upper:[d>>16,f>>16],u_pixel_coord_lower:[65535&d,65535&f]}}const uc=a.create(),Za=(l,r,o,h,d,f,g,y,v,E,T)=>{const A=r.style.light,k=A.properties.get("position"),R=[k.x,k.y,k.z],O=a.create$1();A.properties.get("anchor")==="viewport"&&(a.fromRotation(O,-r.transform.angle),a.transformMat3(R,R,O));const B=A.properties.get("color"),F=r.transform,I={u_matrix:l,u_lightpos:R,u_lightintensity:A.properties.get("intensity"),u_lightcolor:[B.r,B.g,B.b],u_vertical_gradient:+o,u_opacity:h,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:uc,u_merc_center:[0,0],u_up_dir:[0,0,0],u_height_lift:0,u_ao:d,u_edge_radius:f};return F.projection.name==="globe"&&(I.u_tile_id=[g.canonical.x,g.canonical.y,1<{const k=Za(l,r,o,h,d,f,g,v,E,T,A),R={u_height_factor:-Math.pow(2,g.overscaledZ)/y.tileSize/8};return a.extend(k,jo(r,y),R)},wn=l=>({u_matrix:l}),qa=(l,r,o)=>a.extend(wn(l),jo(r,o)),zh=(l,r)=>({u_matrix:l,u_world:r}),Ph=(l,r,o,h)=>a.extend(qa(l,r,o),{u_world:h}),kh=a.create(),Wa=(l,r,o,h,d,f)=>{const g=l.transform,y=g.projection.name==="globe";let v;if(f.paint.get("circle-pitch-alignment")==="map")if(y){const T=a.globePixelsToTileUnits(g.zoom,r.canonical)*g._pixelsPerMercatorPixel;v=Float32Array.from([T,0,0,T])}else v=g.calculatePixelsToTileUnitsMatrix(o);else v=new Float32Array([g.pixelsToGLUnits[0],0,0,g.pixelsToGLUnits[1]]);const E={u_camera_to_center_distance:g.cameraToCenterDistance,u_matrix:l.translatePosMatrix(r.projMatrix,o,f.paint.get("circle-translate"),f.paint.get("circle-translate-anchor")),u_device_pixel_ratio:a.exported.devicePixelRatio,u_extrude_scale:v,u_inv_rot_matrix:kh,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(y){E.u_inv_rot_matrix=h,E.u_merc_center=d,E.u_tile_id=[r.canonical.x,r.canonical.y,1<{const r=[];return l.paint.get("circle-pitch-alignment")==="map"&&r.push("PITCH_WITH_MAP"),l.paint.get("circle-pitch-scale")==="map"&&r.push("SCALE_WITH_MAP"),r},Ha=(l,r,o,h)=>{const d=a.EXTENT/o.tileSize;return{u_matrix:l,u_camera_to_center_distance:r.getCameraToCenterDistance(h),u_extrude_scale:[r.pixelsToGLUnits[0]/d,r.pixelsToGLUnits[1]/d]}},Ds=(l,r,o=1)=>({u_matrix:l,u_color:r,u_overlay:0,u_overlay_scale:o}),pc=a.create(),fc=(l,r,o,h,d,f,g)=>{const y=l.transform,v=y.projection.name==="globe",E=v?a.globePixelsToTileUnits(y.zoom,r.canonical)*y._pixelsPerMercatorPixel:ai(o,1,f),T={u_matrix:r.projMatrix,u_extrude_scale:E,u_intensity:g,u_inv_rot_matrix:pc,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(v){T.u_inv_rot_matrix=h,T.u_merc_center=d,T.u_tile_id=[r.canonical.x,r.canonical.y,1<{const y=l.transform,v=y.calculatePixelsToTileUnitsMatrix(r);return{u_matrix:Ka(l,r,o,h),u_pixels_to_tile_units:v,u_device_pixel_ratio:f,u_units_to_pixels:[1/y.pixelsToGLUnits[0],1/y.pixelsToGLUnits[1]],u_dash_image:0,u_gradient_image:1,u_image_height:d,u_texsize:$o(o)?r.lineAtlasTexture.size:[0,0],u_tile_units_to_pixels:Qn(r,l.transform),u_alpha_discard_threshold:0,u_trim_offset:g}},Go=(l,r,o,h,d)=>{const f=l.transform;return{u_matrix:Ka(l,r,o,h),u_texsize:r.imageAtlasTexture.size,u_pixels_to_tile_units:f.calculatePixelsToTileUnitsMatrix(r),u_device_pixel_ratio:d,u_image:0,u_tile_units_to_pixels:Qn(r,f),u_units_to_pixels:[1/f.pixelsToGLUnits[0],1/f.pixelsToGLUnits[1]],u_alpha_discard_threshold:0}};function Qn(l,r){return 1/ai(l,1,r.tileZoom)}function Ka(l,r,o,h){return l.translatePosMatrix(h||r.tileID.projMatrix,r,o.paint.get("line-translate"),o.paint.get("line-translate-anchor"))}function $o(l){const r=l.paint.get("line-dasharray").value;return r.value||r.kind!=="constant"}const Ya=(l,r,o,h,d,f)=>{return{u_matrix:l,u_tl_parent:r,u_scale_parent:o,u_fade_t:h.mix,u_opacity:h.opacity*d.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:d.paint.get("raster-brightness-min"),u_brightness_high:d.paint.get("raster-brightness-max"),u_saturation_factor:(y=d.paint.get("raster-saturation"),y>0?1-1/(1.001-y):-y),u_contrast_factor:(g=d.paint.get("raster-contrast"),g>0?1/(1-g):1+g),u_spin_weights:hr(d.paint.get("raster-hue-rotate")),u_perspective_transform:f};var g,y};function hr(l){l*=Math.PI/180;const r=Math.sin(l),o=Math.cos(l);return[(2*o+1)/3,(-Math.sqrt(3)*r-o+1)/3,(Math.sqrt(3)*r-o+1)/3]}const Ls=a.create(),Ja=(l,r,o,h,d,f,g,y,v,E,T,A,k,R,O,B)=>{const F=d.transform,I={u_is_size_zoom_constant:+(l==="constant"||l==="source"),u_is_size_feature_constant:+(l==="constant"||l==="camera"),u_size_t:r?r.uSizeT:0,u_size:r?r.uSize:0,u_camera_to_center_distance:F.cameraToCenterDistance,u_rotate_symbol:+o,u_aspect_ratio:F.width/F.height,u_fade_change:d.options.fadeDuration?d.symbolFadeChange:1,u_matrix:f,u_label_plane_matrix:g,u_coord_matrix:y,u_is_text:+v,u_pitch_with_map:+h,u_texsize:E,u_texture:0,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:Ls,u_merc_center:[0,0],u_camera_forward:[0,0,0],u_ecef_origin:[0,0,0],u_tile_matrix:Ls,u_up_vector:[0,-1,0]};return B.name==="globe"&&(I.u_tile_id=[T.canonical.x,T.canonical.y,1<a.extend(Ja(l,r,o,h,d,f,g,y,v,E,A,k,R,O,B,F),{u_gamma_scale:h?d.transform.cameraToCenterDistance*Math.cos(d.terrain?0:d.transform._pitch):1,u_device_pixel_ratio:a.exported.devicePixelRatio,u_is_halo:+T}),mc=(l,r,o,h,d,f,g,y,v,E,T,A,k,R,O,B)=>a.extend(Rs(l,r,o,h,d,f,g,y,!0,v,!0,T,A,k,R,O,B),{u_texsize_icon:E,u_texture_icon:1}),Qa=(l,r,o)=>({u_matrix:l,u_opacity:r,u_color:o}),Lh=(l,r,o,h,d)=>a.extend(function(f,g,y){const v=g.imageManager.getPattern(f.toString()),{width:E,height:T}=g.imageManager.getPixelSize(),A=Math.pow(2,y.tileID.overscaledZ),k=y.tileSize*Math.pow(2,g.transform.tileZoom)/A,R=k*(y.tileID.canonical.x+y.tileID.wrap*A),O=k*y.tileID.canonical.y;return{u_image:0,u_pattern_tl:v.tl,u_pattern_br:v.br,u_texsize:[E,T],u_pattern_size:v.displaySize,u_tile_units_to_pixels:1/ai(y,1,g.transform.tileZoom),u_pixel_coord_upper:[R>>16,O>>16],u_pixel_coord_lower:[65535&R,65535&O]}}(h,o,d),{u_matrix:l,u_opacity:r}),el={fillExtrusion:l=>({u_matrix:new a.UniformMatrix4f(l),u_lightpos:new a.Uniform3f(l),u_lightintensity:new a.Uniform1f(l),u_lightcolor:new a.Uniform3f(l),u_vertical_gradient:new a.Uniform1f(l),u_opacity:new a.Uniform1f(l),u_edge_radius:new a.Uniform1f(l),u_ao:new a.Uniform2f(l),u_tile_id:new a.Uniform3f(l),u_zoom_transition:new a.Uniform1f(l),u_inv_rot_matrix:new a.UniformMatrix4f(l),u_merc_center:new a.Uniform2f(l),u_up_dir:new a.Uniform3f(l),u_height_lift:new a.Uniform1f(l)}),fillExtrusionPattern:l=>({u_matrix:new a.UniformMatrix4f(l),u_lightpos:new a.Uniform3f(l),u_lightintensity:new a.Uniform1f(l),u_lightcolor:new a.Uniform3f(l),u_vertical_gradient:new a.Uniform1f(l),u_height_factor:new a.Uniform1f(l),u_edge_radius:new a.Uniform1f(l),u_ao:new a.Uniform2f(l),u_tile_id:new a.Uniform3f(l),u_zoom_transition:new a.Uniform1f(l),u_inv_rot_matrix:new a.UniformMatrix4f(l),u_merc_center:new a.Uniform2f(l),u_up_dir:new a.Uniform3f(l),u_height_lift:new a.Uniform1f(l),u_image:new a.Uniform1i(l),u_texsize:new a.Uniform2f(l),u_pixel_coord_upper:new a.Uniform2f(l),u_pixel_coord_lower:new a.Uniform2f(l),u_tile_units_to_pixels:new a.Uniform1f(l),u_opacity:new a.Uniform1f(l)}),fill:l=>({u_matrix:new a.UniformMatrix4f(l)}),fillPattern:l=>({u_matrix:new a.UniformMatrix4f(l),u_image:new a.Uniform1i(l),u_texsize:new a.Uniform2f(l),u_pixel_coord_upper:new a.Uniform2f(l),u_pixel_coord_lower:new a.Uniform2f(l),u_tile_units_to_pixels:new a.Uniform1f(l)}),fillOutline:l=>({u_matrix:new a.UniformMatrix4f(l),u_world:new a.Uniform2f(l)}),fillOutlinePattern:l=>({u_matrix:new a.UniformMatrix4f(l),u_world:new a.Uniform2f(l),u_image:new a.Uniform1i(l),u_texsize:new a.Uniform2f(l),u_pixel_coord_upper:new a.Uniform2f(l),u_pixel_coord_lower:new a.Uniform2f(l),u_tile_units_to_pixels:new a.Uniform1f(l)}),circle:l=>({u_camera_to_center_distance:new a.Uniform1f(l),u_extrude_scale:new a.UniformMatrix2f(l),u_device_pixel_ratio:new a.Uniform1f(l),u_matrix:new a.UniformMatrix4f(l),u_inv_rot_matrix:new a.UniformMatrix4f(l),u_merc_center:new a.Uniform2f(l),u_tile_id:new a.Uniform3f(l),u_zoom_transition:new a.Uniform1f(l),u_up_dir:new a.Uniform3f(l)}),collisionBox:l=>({u_matrix:new a.UniformMatrix4f(l),u_camera_to_center_distance:new a.Uniform1f(l),u_extrude_scale:new a.Uniform2f(l)}),collisionCircle:l=>({u_matrix:new a.UniformMatrix4f(l),u_inv_matrix:new a.UniformMatrix4f(l),u_camera_to_center_distance:new a.Uniform1f(l),u_viewport_size:new a.Uniform2f(l)}),debug:l=>({u_color:new a.UniformColor(l),u_matrix:new a.UniformMatrix4f(l),u_overlay:new a.Uniform1i(l),u_overlay_scale:new a.Uniform1f(l)}),clippingMask:l=>({u_matrix:new a.UniformMatrix4f(l)}),heatmap:l=>({u_extrude_scale:new a.Uniform1f(l),u_intensity:new a.Uniform1f(l),u_matrix:new a.UniformMatrix4f(l),u_inv_rot_matrix:new a.UniformMatrix4f(l),u_merc_center:new a.Uniform2f(l),u_tile_id:new a.Uniform3f(l),u_zoom_transition:new a.Uniform1f(l),u_up_dir:new a.Uniform3f(l)}),heatmapTexture:l=>({u_image:new a.Uniform1i(l),u_color_ramp:new a.Uniform1i(l),u_opacity:new a.Uniform1f(l)}),hillshade:l=>({u_matrix:new a.UniformMatrix4f(l),u_image:new a.Uniform1i(l),u_latrange:new a.Uniform2f(l),u_light:new a.Uniform2f(l),u_shadow:new a.UniformColor(l),u_highlight:new a.UniformColor(l),u_accent:new a.UniformColor(l)}),hillshadePrepare:l=>({u_matrix:new a.UniformMatrix4f(l),u_image:new a.Uniform1i(l),u_dimension:new a.Uniform2f(l),u_zoom:new a.Uniform1f(l),u_unpack:new a.Uniform4f(l)}),line:l=>({u_matrix:new a.UniformMatrix4f(l),u_pixels_to_tile_units:new a.UniformMatrix2f(l),u_device_pixel_ratio:new a.Uniform1f(l),u_units_to_pixels:new a.Uniform2f(l),u_dash_image:new a.Uniform1i(l),u_gradient_image:new a.Uniform1i(l),u_image_height:new a.Uniform1f(l),u_texsize:new a.Uniform2f(l),u_tile_units_to_pixels:new a.Uniform1f(l),u_alpha_discard_threshold:new a.Uniform1f(l),u_trim_offset:new a.Uniform2f(l)}),linePattern:l=>({u_matrix:new a.UniformMatrix4f(l),u_texsize:new a.Uniform2f(l),u_pixels_to_tile_units:new a.UniformMatrix2f(l),u_device_pixel_ratio:new a.Uniform1f(l),u_image:new a.Uniform1i(l),u_units_to_pixels:new a.Uniform2f(l),u_tile_units_to_pixels:new a.Uniform1f(l),u_alpha_discard_threshold:new a.Uniform1f(l)}),raster:l=>({u_matrix:new a.UniformMatrix4f(l),u_tl_parent:new a.Uniform2f(l),u_scale_parent:new a.Uniform1f(l),u_fade_t:new a.Uniform1f(l),u_opacity:new a.Uniform1f(l),u_image0:new a.Uniform1i(l),u_image1:new a.Uniform1i(l),u_brightness_low:new a.Uniform1f(l),u_brightness_high:new a.Uniform1f(l),u_saturation_factor:new a.Uniform1f(l),u_contrast_factor:new a.Uniform1f(l),u_spin_weights:new a.Uniform3f(l),u_perspective_transform:new a.Uniform2f(l)}),symbolIcon:l=>({u_is_size_zoom_constant:new a.Uniform1i(l),u_is_size_feature_constant:new a.Uniform1i(l),u_size_t:new a.Uniform1f(l),u_size:new a.Uniform1f(l),u_camera_to_center_distance:new a.Uniform1f(l),u_rotate_symbol:new a.Uniform1i(l),u_aspect_ratio:new a.Uniform1f(l),u_fade_change:new a.Uniform1f(l),u_matrix:new a.UniformMatrix4f(l),u_label_plane_matrix:new a.UniformMatrix4f(l),u_coord_matrix:new a.UniformMatrix4f(l),u_is_text:new a.Uniform1i(l),u_pitch_with_map:new a.Uniform1i(l),u_texsize:new a.Uniform2f(l),u_tile_id:new a.Uniform3f(l),u_zoom_transition:new a.Uniform1f(l),u_inv_rot_matrix:new a.UniformMatrix4f(l),u_merc_center:new a.Uniform2f(l),u_camera_forward:new a.Uniform3f(l),u_tile_matrix:new a.UniformMatrix4f(l),u_up_vector:new a.Uniform3f(l),u_ecef_origin:new a.Uniform3f(l),u_texture:new a.Uniform1i(l)}),symbolSDF:l=>({u_is_size_zoom_constant:new a.Uniform1i(l),u_is_size_feature_constant:new a.Uniform1i(l),u_size_t:new a.Uniform1f(l),u_size:new a.Uniform1f(l),u_camera_to_center_distance:new a.Uniform1f(l),u_rotate_symbol:new a.Uniform1i(l),u_aspect_ratio:new a.Uniform1f(l),u_fade_change:new a.Uniform1f(l),u_matrix:new a.UniformMatrix4f(l),u_label_plane_matrix:new a.UniformMatrix4f(l),u_coord_matrix:new a.UniformMatrix4f(l),u_is_text:new a.Uniform1i(l),u_pitch_with_map:new a.Uniform1i(l),u_texsize:new a.Uniform2f(l),u_texture:new a.Uniform1i(l),u_gamma_scale:new a.Uniform1f(l),u_device_pixel_ratio:new a.Uniform1f(l),u_tile_id:new a.Uniform3f(l),u_zoom_transition:new a.Uniform1f(l),u_inv_rot_matrix:new a.UniformMatrix4f(l),u_merc_center:new a.Uniform2f(l),u_camera_forward:new a.Uniform3f(l),u_tile_matrix:new a.UniformMatrix4f(l),u_up_vector:new a.Uniform3f(l),u_ecef_origin:new a.Uniform3f(l),u_is_halo:new a.Uniform1i(l)}),symbolTextAndIcon:l=>({u_is_size_zoom_constant:new a.Uniform1i(l),u_is_size_feature_constant:new a.Uniform1i(l),u_size_t:new a.Uniform1f(l),u_size:new a.Uniform1f(l),u_camera_to_center_distance:new a.Uniform1f(l),u_rotate_symbol:new a.Uniform1i(l),u_aspect_ratio:new a.Uniform1f(l),u_fade_change:new a.Uniform1f(l),u_matrix:new a.UniformMatrix4f(l),u_label_plane_matrix:new a.UniformMatrix4f(l),u_coord_matrix:new a.UniformMatrix4f(l),u_is_text:new a.Uniform1i(l),u_pitch_with_map:new a.Uniform1i(l),u_texsize:new a.Uniform2f(l),u_texsize_icon:new a.Uniform2f(l),u_texture:new a.Uniform1i(l),u_texture_icon:new a.Uniform1i(l),u_gamma_scale:new a.Uniform1f(l),u_device_pixel_ratio:new a.Uniform1f(l),u_is_halo:new a.Uniform1i(l)}),background:l=>({u_matrix:new a.UniformMatrix4f(l),u_opacity:new a.Uniform1f(l),u_color:new a.UniformColor(l)}),backgroundPattern:l=>({u_matrix:new a.UniformMatrix4f(l),u_opacity:new a.Uniform1f(l),u_image:new a.Uniform1i(l),u_pattern_tl:new a.Uniform2f(l),u_pattern_br:new a.Uniform2f(l),u_texsize:new a.Uniform2f(l),u_pattern_size:new a.Uniform2f(l),u_pixel_coord_upper:new a.Uniform2f(l),u_pixel_coord_lower:new a.Uniform2f(l),u_tile_units_to_pixels:new a.Uniform1f(l)}),terrainRaster:Na,terrainDepth:Na,skybox:l=>({u_matrix:new a.UniformMatrix4f(l),u_sun_direction:new a.Uniform3f(l),u_cubemap:new a.Uniform1i(l),u_opacity:new a.Uniform1f(l),u_temporal_offset:new a.Uniform1f(l)}),skyboxGradient:l=>({u_matrix:new a.UniformMatrix4f(l),u_color_ramp:new a.Uniform1i(l),u_center_direction:new a.Uniform3f(l),u_radius:new a.Uniform1f(l),u_opacity:new a.Uniform1f(l),u_temporal_offset:new a.Uniform1f(l)}),skyboxCapture:l=>({u_matrix_3f:new a.UniformMatrix3f(l),u_sun_direction:new a.Uniform3f(l),u_sun_intensity:new a.Uniform1f(l),u_color_tint_r:new a.Uniform4f(l),u_color_tint_m:new a.Uniform4f(l),u_luminance:new a.Uniform1f(l)}),globeRaster:l=>({u_proj_matrix:new a.UniformMatrix4f(l),u_globe_matrix:new a.UniformMatrix4f(l),u_normalize_matrix:new a.UniformMatrix4f(l),u_merc_matrix:new a.UniformMatrix4f(l),u_zoom_transition:new a.Uniform1f(l),u_merc_center:new a.Uniform2f(l),u_image0:new a.Uniform1i(l),u_grid_matrix:new a.UniformMatrix3f(l),u_skirt_height:new a.Uniform1f(l),u_frustum_tl:new a.Uniform3f(l),u_frustum_tr:new a.Uniform3f(l),u_frustum_br:new a.Uniform3f(l),u_frustum_bl:new a.Uniform3f(l),u_globe_pos:new a.Uniform3f(l),u_globe_radius:new a.Uniform1f(l),u_viewport:new a.Uniform2f(l)}),globeAtmosphere:l=>({u_frustum_tl:new a.Uniform3f(l),u_frustum_tr:new a.Uniform3f(l),u_frustum_br:new a.Uniform3f(l),u_frustum_bl:new a.Uniform3f(l),u_horizon:new a.Uniform1f(l),u_transition:new a.Uniform1f(l),u_fadeout_range:new a.Uniform1f(l),u_color:new a.Uniform4f(l),u_high_color:new a.Uniform4f(l),u_space_color:new a.Uniform4f(l),u_star_intensity:new a.Uniform1f(l),u_star_density:new a.Uniform1f(l),u_star_size:new a.Uniform1f(l),u_temporal_offset:new a.Uniform1f(l),u_horizon_angle:new a.Uniform1f(l),u_rotation_matrix:new a.UniformMatrix4f(l)})};let Bs;function Zo(l,r,o,h,d,f,g){const y=l.context,v=y.gl,E=l.transform,T=l.useProgram("collisionBox"),A=[];let k=0,R=0;for(let j=0;j0){const oe=a.create(),ge=te;a.mul(oe,Y.placementInvProjMatrix,E.glCoordMatrix),a.mul(oe,oe,Y.placementViewportMatrix),A.push({circleArray:Te,circleOffset:R,transform:ge,invTransform:oe,projection:Y.getProjection()}),k+=Te.length/4,R=k}le&&(l.terrain&&l.terrain.setupElevationDraw(J,T),T.draw(y,v.LINES,a.DepthMode.disabled,a.StencilMode.disabled,l.colorModeForRenderPass(),a.CullFaceMode.disabled,Ha(te,E,J,Y.getProjection()),o.id,le.layoutVertexBuffer,le.indexBuffer,le.segments,null,E.zoom,null,[le.collisionVertexBuffer,le.collisionVertexBufferExt]))}if(!g||!A.length)return;const O=l.useProgram("collisionCircle"),B=new a.StructArrayLayout2f1f2i16;B.resize(4*k),B._trim();let F=0;for(const j of A)for(let K=0;K=0&&(O[j.associatedIconIndex]={x:oe,y:ge,z:he,angle:ve})}else er(Y,k)}if(T){R.clear();const N=l.icon.placedSymbolArray;for(let j=0;joe.sortKey-ge.sortKey);for(const oe of te){const ge=oe.state;if(l.terrain&&l.terrain.setupElevationDraw(ge.tile,ge.program,{useDepthForOcclusion:!ie,labelPlaneMatrixInv:ge.labelPlaneMatrixInv}),k.activeTexture.set(R.TEXTURE0),ge.atlasTexture.bind(ge.atlasInterpolation,R.CLAMP_TO_EDGE),ge.atlasTextureIcon&&(k.activeTexture.set(R.TEXTURE1),ge.atlasTextureIcon&&ge.atlasTextureIcon.bind(ge.atlasInterpolationIcon,R.CLAMP_TO_EDGE)),ge.isSDF){const he=ge.uniformValues;ge.hasHalo&&(he.u_is_halo=1,qo(ge.buffers,oe.segments,o,l,ge.program,K,T,A,he)),he.u_is_halo=0}qo(ge.buffers,oe.segments,o,l,ge.program,K,T,A,ge.uniformValues)}}function qo(l,r,o,h,d,f,g,y,v){const E=h.context,T=[l.dynamicLayoutVertexBuffer,l.opacityVertexBuffer,l.globeExtVertexBuffer];d.draw(E,E.gl.TRIANGLES,f,g,y,a.CullFaceMode.disabled,v,o.id,l.layoutVertexBuffer,l.indexBuffer,r,o.paint,h.transform.zoom,l.programConfigurations.get(o.id),T)}function yc(l,r,o,h,d,f,g){const y=l.context.gl,v=o.paint.get("fill-pattern"),E=v&&v.constantOr(1);let T,A,k,R,O;g?(A=E&&!o.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",T=y.LINES):(A=E?"fillPattern":"fill",T=y.TRIANGLES);for(const B of h){const F=r.getTile(B);if(E&&!F.patternsLoaded())continue;const I=F.getBucket(o);if(!I)continue;l.prepareDrawTile();const L=I.programConfigurations.get(o.id),N=l.useProgram(A,L);E&&(l.context.activeTexture.set(y.TEXTURE0),F.imageAtlasTexture.bind(y.LINEAR,y.CLAMP_TO_EDGE),L.updatePaintBuffers());const j=v.constantOr(null);if(j&&F.imageAtlas){const J=F.imageAtlas.patternPositions[j.toString()];J&&L.setConstantPatternPositions(J)}const K=l.translatePosMatrix(B.projMatrix,F,o.paint.get("fill-translate"),o.paint.get("fill-translate-anchor"));if(g){R=I.indexBuffer2,O=I.segments2;const J=l.terrain&&l.terrain.renderingToTexture?l.terrain.drapeBufferSize:[y.drawingBufferWidth,y.drawingBufferHeight];k=A==="fillOutlinePattern"&&E?Ph(K,l,F,J):zh(K,J)}else R=I.indexBuffer,O=I.segments,k=E?qa(K,l,F):wn(K);l.prepareDrawProgram(l.context,N,B.toUnwrapped()),N.draw(l.context,T,d,l.stencilModeForClipping(B),f,a.CullFaceMode.disabled,k,o.id,I.layoutVertexBuffer,R,O,o.paint,l.transform.zoom,L)}}function Os(l,r,o,h,d,f,g){const y=l.context,v=y.gl,E=l.transform,T=o.paint.get("fill-extrusion-pattern"),A=T.constantOr(1),k=o.paint.get("fill-extrusion-opacity"),R=[o.paint.get("fill-extrusion-ambient-occlusion-intensity"),o.paint.get("fill-extrusion-ambient-occlusion-radius")],O=o.layout.get("fill-extrusion-edge-radius"),B=O>0&&!o.paint.get("fill-extrusion-rounded-roof"),F=B?0:O,I=E.projection.name==="globe"?a.fillExtrusionHeightLift():0,L=E.projection.name==="globe",N=L?a.globeToMercatorTransition(E.zoom):0,j=[a.mercatorXfromLng(E.center.lng),a.mercatorYfromLat(E.center.lat)],K=[];L&&K.push("PROJECTION_GLOBE_VIEW"),R[0]>0&&K.push("FAUX_AO"),B&&K.push("ZERO_ROOF_RADIUS");for(const J of h){const Y=r.getTile(J),ie=Y.getBucket(o);if(!ie||ie.projection.name!==E.projection.name)continue;const te=ie.programConfigurations.get(o.id),le=l.useProgram(A?"fillExtrusionPattern":"fillExtrusion",te,K);if(l.terrain){const _e=l.terrain;if(l.style.terrainSetForDrapingOnly())_e.setupElevationDraw(Y,le,{useMeterToDem:!0});else{if(!ie.enableTerrain)continue;if(_e.setupElevationDraw(Y,le,{useMeterToDem:!0}),xc(y,r,J,ie,o,_e),!ie.centroidVertexBuffer){const Me=le.attributes.a_centroid_pos;Me!==void 0&&v.vertexAttrib2f(Me,0,0)}}}A&&(l.context.activeTexture.set(v.TEXTURE0),Y.imageAtlasTexture.bind(v.LINEAR,v.CLAMP_TO_EDGE),te.updatePaintBuffers());const Te=T.constantOr(null);if(Te&&Y.imageAtlas){const _e=Y.imageAtlas.patternPositions[Te.toString()];_e&&te.setConstantPatternPositions(_e)}const oe=l.translatePosMatrix(J.projMatrix,Y,o.paint.get("fill-extrusion-translate"),o.paint.get("fill-extrusion-translate-anchor")),ge=E.projection.createInversionMatrix(E,J.canonical),he=o.paint.get("fill-extrusion-vertical-gradient"),we=A?dc(oe,l,he,k,R,F,J,Y,I,N,j,ge):Za(oe,l,he,k,R,F,J,I,N,j,ge);l.prepareDrawProgram(y,le,J.toUnwrapped());const ae=[];l.terrain&&ae.push(ie.centroidVertexBuffer),L&&ae.push(ie.layoutVertexExtBuffer),le.draw(y,y.gl.TRIANGLES,d,f,g,a.CullFaceMode.backCCW,we,o.id,ie.layoutVertexBuffer,ie.indexBuffer,ie.segments,o.paint,l.transform.zoom,te,ae)}}function xc(l,r,o,h,d,f){const g=[I=>{let L=I.canonical.x-1,N=I.wrap;return L<0&&(L=(1<{let L=I.canonical.x+1,N=I.wrap;return L===1<new a.OverscaledTileID(I.overscaledZ,I.wrap,I.canonical.z,I.canonical.x,(I.canonical.y===0?1<new a.OverscaledTileID(I.overscaledZ,I.wrap,I.canonical.z,I.canonical.x,I.canonical.y===(1<{const L=r.getSource().minzoom,N=K=>{const J=r.getTileByID(K);if(J&&J.hasData())return J.getBucket(d)},j=[0,-1,1];for(const K of j){if(I.overscaledZ+K(v[0]=Math.min(I.min.y,L.min.y),v[1]=Math.max(I.max.y,L.max.y),v[2]=a.EXTENT-L.min.x>I.max.x?L.min.x-a.EXTENT:I.max.x,v),T=(I,L)=>(v[0]=Math.min(I.min.x,L.min.x),v[1]=Math.max(I.max.x,L.max.x),v[2]=a.EXTENT-L.min.y>I.max.y?L.min.y-a.EXTENT:I.max.y,v),A=[(I,L)=>E(I,L),(I,L)=>E(L,I),(I,L)=>T(I,L),(I,L)=>T(L,I)],k=new a.Point(0,0);let R,O,B;const F=(I,L,N,j,K)=>{const J=[[j?N:I,j?I:N,0],[j?N:L,j?L:N,0]],Y=K<0?a.EXTENT+K:K,ie=[j?Y:(I+L)/2,j?(I+L)/2:Y,0];return N===0&&K<0||N!==0&&K>0?f.getForTilePoints(B,[ie],!0,O):J.push(ie),f.getForTilePoints(o,J,!0,R),Math.max(J[0][2],J[1][2],ie[2])/f.exaggeration()};for(let I=0;I<4;I++){const L=(I<2?1:5)-I,N=h.borders[I];if(N.length===0)continue;const j=B=g[I](o),K=y(j);if(!(K&&K instanceof a.FillExtrusionBucket&&K.enableTerrain)||h.borderDoneWithNeighborZ[I]===K.canonical.z&&K.borderDoneWithNeighborZ[L]===h.canonical.z||(O=f.findDEMTileFor(j),!O||!O.dem))continue;if(!R){const te=f.findDEMTileFor(o);if(!te||!te.dem)return;R=te}const J=K.borders[L];let Y=0;const ie=K.borderDoneWithNeighborZ[L]!==h.canonical.z;if(h.canonical.z===K.canonical.z){for(let te=0;teTe[0]+3));)ie&&K.encodeCentroid(void 0,oe,!1),Y++;if(oe&&YTe[1]-3)&&(he++,++Y!==J.length);)oe=K.featuresOnBorder[J[Y]];if(oe=K.featuresOnBorder[J[ge]],le.intersectsCount()>1||oe.intersectsCount()>1||he!==1){he!==1&&(Y=ge),h.encodeCentroid(void 0,le,!1),ie&&K.encodeCentroid(void 0,oe,!1);continue}const we=A[I](le,oe),ae=I%2?a.EXTENT-1:0;k.x=F(we[0],Math.min(a.EXTENT-1,we[1]),ae,I<2,we[2]),k.y=0,h.encodeCentroid(k,le,!1),ie&&K.encodeCentroid(k,oe,!1)}else h.encodeCentroid(void 0,le,!1)}h.borderDoneWithNeighborZ[I]=K.canonical.z,h.needsCentroidUpdate=!0,ie&&(K.borderDoneWithNeighborZ[L]=h.canonical.z,K.needsCentroidUpdate=!0)}else{for(const te of N)h.encodeCentroid(void 0,h.featuresOnBorder[te],!1);if(ie){for(const te of J)K.encodeCentroid(void 0,K.featuresOnBorder[te],!1);K.borderDoneWithNeighborZ[L]=h.canonical.z,K.needsCentroidUpdate=!0}h.borderDoneWithNeighborZ[I]=K.canonical.z,h.needsCentroidUpdate=!0}}(h.needsCentroidUpdate||!h.centroidVertexBuffer&&h.centroidVertexArray.length!==0)&&h.uploadCentroid(l)}const eo=new a.Color(1,0,0,1),Bh=new a.Color(0,1,0,1),Oh=new a.Color(0,0,1,1),Fh=new a.Color(1,0,1,1),Uh=new a.Color(0,1,1,1);function Vh(l,r,o){const h=l.context,d=l.transform,f=h.gl,g=d.projection.name==="globe",y=g?["PROJECTION_GLOBE_VIEW"]:null;let v=o.projMatrix;if(g&&a.globeToMercatorTransition(d.zoom)>0){const le=a.transitionTileAABBinECEF(o.canonical,d),Te=a.globeDenormalizeECEF(le);v=a.multiply(new Float32Array(16),d.globeMatrix,Te),a.multiply(v,d.projMatrix,v)}const E=l.useProgram("debug",null,y),T=r.getTileByID(o.key);l.terrain&&l.terrain.setupElevationDraw(T,E);const A=a.DepthMode.disabled,k=a.StencilMode.disabled,R=l.colorModeForRenderPass(),O="$debug";h.activeTexture.set(f.TEXTURE0),l.emptyTexture.bind(f.LINEAR,f.CLAMP_TO_EDGE),g?T._makeGlobeTileDebugBuffers(l.context,d):T._makeDebugTileBoundsBuffers(l.context,d.projection);const B=T._tileDebugBuffer||l.debugBuffer,F=T._tileDebugIndexBuffer||l.debugIndexBuffer,I=T._tileDebugSegments||l.debugSegments;E.draw(h,f.LINE_STRIP,A,k,R,a.CullFaceMode.disabled,Ds(v,a.Color.red),O,B,F,I,null,null,null,[T._globeTileDebugBorderBuffer]);const L=T.latestRawTileData,N=Math.floor((L&&L.byteLength||0)/1024),j=r.getTile(o).tileSize,K=512/Math.min(j,512)*(o.overscaledZ/d.zoom)*.5;let J=o.canonical.toString();o.overscaledZ!==o.canonical.z&&(J+=` => ${o.overscaledZ}`),J+=` ${N}kb`,function(le,Te){le.initDebugOverlayCanvas();const oe=le.debugOverlayCanvas,ge=le.context.gl,he=le.debugOverlayCanvas.getContext("2d");he.clearRect(0,0,oe.width,oe.height),he.shadowColor="white",he.shadowBlur=2,he.lineWidth=1.5,he.strokeStyle="white",he.textBaseline="top",he.font="bold 36px Open Sans, sans-serif",he.fillText(Te,5,5),he.strokeText(Te,5,5),le.debugOverlayTexture.update(oe),le.debugOverlayTexture.bind(ge.LINEAR,ge.CLAMP_TO_EDGE)}(l,J);const Y=T._tileDebugTextBuffer||l.debugBuffer,ie=T._tileDebugTextIndexBuffer||l.quadTriangleIndexBuffer,te=T._tileDebugTextSegments||l.debugSegments;E.draw(h,f.TRIANGLES,A,k,a.ColorMode.alphaBlended,a.CullFaceMode.disabled,Ds(v,a.Color.transparent,K),O,Y,ie,te,null,null,null,[T._globeTileDebugTextBuffer])}function vc(l,r,o,h){to(l,0,r+o/2,l.transform.width,o,h)}function Fs(l,r,o,h){to(l,r-o/2,0,o,l.transform.height,h)}function to(l,r,o,h,d,f){const g=l.context,y=g.gl;y.enable(y.SCISSOR_TEST),y.scissor(r*a.exported.devicePixelRatio,o*a.exported.devicePixelRatio,h*a.exported.devicePixelRatio,d*a.exported.devicePixelRatio),g.clear({color:f}),y.disable(y.SCISSOR_TEST)}const bc=a.createLayout([{name:"a_pos_3f",components:3,type:"Float32"}]),{members:wc}=bc;function kr(l,r,o,h){l.emplaceBack(r,o,h)}class Us{constructor(r){this.vertexArray=new a.StructArrayLayout3f12,this.indices=new a.StructArrayLayout3ui6,kr(this.vertexArray,-1,-1,1),kr(this.vertexArray,1,-1,1),kr(this.vertexArray,-1,1,1),kr(this.vertexArray,1,1,1),kr(this.vertexArray,-1,-1,-1),kr(this.vertexArray,1,-1,-1),kr(this.vertexArray,-1,1,-1),kr(this.vertexArray,1,1,-1),this.indices.emplaceBack(5,1,3),this.indices.emplaceBack(3,7,5),this.indices.emplaceBack(6,2,0),this.indices.emplaceBack(0,4,6),this.indices.emplaceBack(2,6,7),this.indices.emplaceBack(7,3,2),this.indices.emplaceBack(5,4,0),this.indices.emplaceBack(0,1,5),this.indices.emplaceBack(0,2,3),this.indices.emplaceBack(3,1,0),this.indices.emplaceBack(7,6,4),this.indices.emplaceBack(4,5,7),this.vertexBuffer=r.createVertexBuffer(this.vertexArray,wc),this.indexBuffer=r.createIndexBuffer(this.indices),this.segment=a.SegmentVector.simpleSegment(0,0,36,12)}}function Gi(l,r,o,h,d,f){const g=l.gl,y=r.paint.get("sky-atmosphere-color"),v=r.paint.get("sky-atmosphere-halo-color"),E=r.paint.get("sky-atmosphere-sun-intensity"),T=((A,k,R,O,B)=>({u_matrix_3f:A,u_sun_direction:k,u_sun_intensity:R,u_color_tint_r:[O.r,O.g,O.b,O.a],u_color_tint_m:[B.r,B.g,B.b,B.a],u_luminance:5e-5}))(a.fromMat4(a.create$1(),h),d,E,y,v);g.framebufferTexture2D(g.FRAMEBUFFER,g.COLOR_ATTACHMENT0,g.TEXTURE_CUBE_MAP_POSITIVE_X+f,r.skyboxTexture,0),o.draw(l,g.TRIANGLES,a.DepthMode.disabled,a.StencilMode.disabled,a.ColorMode.unblended,a.CullFaceMode.frontCW,T,"skyboxCapture",r.skyboxGeometry.vertexBuffer,r.skyboxGeometry.indexBuffer,r.skyboxGeometry.segment)}const Wo=a.createLayout([{type:"Float32",name:"a_pos",components:3},{type:"Float32",name:"a_uv",components:2}]);class Tc{constructor(r){const o=new a.StructArrayLayout5f20;o.emplaceBack(-1,1,1,0,0),o.emplaceBack(1,1,1,1,0),o.emplaceBack(1,-1,1,1,1),o.emplaceBack(-1,-1,1,0,1);const h=new a.StructArrayLayout3ui6;h.emplaceBack(0,1,2),h.emplaceBack(2,3,0),this.vertexBuffer=r.createVertexBuffer(o,Wo.members),this.indexBuffer=r.createIndexBuffer(h),this.segments=a.SegmentVector.simpleSegment(0,0,4,2)}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy()}}const Tn={symbol:function(l,r,o,h,d){if(l.renderPass!=="translucent")return;const f=a.StencilMode.disabled,g=l.colorModeForRenderPass();o.layout.get("text-variable-anchor")&&function(y,v,E,T,A,k,R){const O=v.transform,B=A==="map",F=k==="map";for(const I of y){const L=T.getTile(I),N=L.getBucket(E);if(!N||!N.text||!N.text.segments.get().length)continue;const j=a.evaluateSizeForZoom(N.textSizeData,O.zoom),K=Ot(I,N.getProjection(),O),J=O.calculatePixelsToTileUnitsMatrix(L),Y=fe(K,L.tileID.canonical,F,B,O,N.getProjection(),J),ie=E.layout.get("icon-text-fit")!=="none"&&N.hasIconData();if(j){const te=Math.pow(2,O.zoom-L.tileID.overscaledZ);Rh(N,B,F,R,a.symbolSize,O,Y,I,te,j,ie)}}}(h,l,o,r,o.layout.get("text-rotation-alignment"),o.layout.get("text-pitch-alignment"),d),o.paint.get("icon-opacity").constantOr(1)!==0&&gc(l,r,o,h,!1,o.paint.get("icon-translate"),o.paint.get("icon-translate-anchor"),o.layout.get("icon-rotation-alignment"),o.layout.get("icon-pitch-alignment"),o.layout.get("icon-keep-upright"),f,g),o.paint.get("text-opacity").constantOr(1)!==0&&gc(l,r,o,h,!0,o.paint.get("text-translate"),o.paint.get("text-translate-anchor"),o.layout.get("text-rotation-alignment"),o.layout.get("text-pitch-alignment"),o.layout.get("text-keep-upright"),f,g),r.map.showCollisionBoxes&&(Zo(l,r,o,h,o.paint.get("text-translate"),o.paint.get("text-translate-anchor"),!0),Zo(l,r,o,h,o.paint.get("icon-translate"),o.paint.get("icon-translate-anchor"),!1))},circle:function(l,r,o,h){if(l.renderPass!=="translucent")return;const d=o.paint.get("circle-opacity"),f=o.paint.get("circle-stroke-width"),g=o.paint.get("circle-stroke-opacity"),y=o.layout.get("circle-sort-key").constantOr(1)!==void 0;if(d.constantOr(1)===0&&(f.constantOr(1)===0||g.constantOr(1)===0))return;const v=l.context,E=v.gl,T=l.transform,A=l.depthModeForSublayer(0,a.DepthMode.ReadOnly),k=a.StencilMode.disabled,R=l.colorModeForRenderPass(),O=T.projection.name==="globe",B=[a.mercatorXfromLng(T.center.lng),a.mercatorYfromLat(T.center.lat)],F=[];for(let L=0;LL.sortKey-N.sortKey);const I={useDepthForOcclusion:!O};for(const L of F){const{programConfiguration:N,program:j,layoutVertexBuffer:K,globeExtVertexBuffer:J,indexBuffer:Y,uniformValues:ie,tile:te}=L.state,le=L.segments;l.terrain&&l.terrain.setupElevationDraw(te,j,I),l.prepareDrawProgram(v,j,te.tileID.toUnwrapped()),j.draw(v,E.TRIANGLES,A,k,R,a.CullFaceMode.disabled,ie,o.id,K,Y,le,o.paint,T.zoom,N,[J])}},heatmap:function(l,r,o,h){if(o.paint.get("heatmap-opacity")!==0)if(l.renderPass==="offscreen"){const d=l.context,f=d.gl,g=a.StencilMode.disabled,y=new a.ColorMode([f.ONE,f.ONE],a.Color.transparent,[!0,!0,!0,!0]);(function(R,O,B,F){const I=R.gl,L=O.width*F,N=O.height*F;R.activeTexture.set(I.TEXTURE1),R.viewport.set([0,0,L,N]);let j=B.heatmapFbo;if(!j||j&&(j.width!==L||j.height!==N)){j&&j.destroy();const K=I.createTexture();I.bindTexture(I.TEXTURE_2D,K),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_WRAP_S,I.CLAMP_TO_EDGE),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_WRAP_T,I.CLAMP_TO_EDGE),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_MIN_FILTER,I.LINEAR),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_MAG_FILTER,I.LINEAR),j=B.heatmapFbo=R.createFramebuffer(L,N,!1),function(J,Y,ie,te,le,Te){const oe=J.gl;oe.texImage2D(oe.TEXTURE_2D,0,J.isWebGL2&&J.extRenderToTextureHalfFloat?oe.RGBA16F:oe.RGBA,le,Te,0,oe.RGBA,J.extRenderToTextureHalfFloat?J.isWebGL2?oe.HALF_FLOAT:J.extTextureHalfFloat.HALF_FLOAT_OES:oe.UNSIGNED_BYTE,null),te.colorAttachment.set(ie)}(R,0,K,j,L,N)}else I.bindTexture(I.TEXTURE_2D,j.colorAttachment.get()),R.bindFramebuffer.set(j.framebuffer)})(d,l,o,l.transform.projection.name==="globe"?.5:.25),d.clear({color:a.Color.transparent});const v=l.transform,E=v.projection.name==="globe",T=E?["PROJECTION_GLOBE_VIEW"]:null,A=E?a.CullFaceMode.frontCCW:a.CullFaceMode.disabled,k=[a.mercatorXfromLng(v.center.lng),a.mercatorYfromLat(v.center.lat)];for(let R=0;R({u_image:0,u_color_ramp:1,u_opacity:A.paint.get("heatmap-opacity")}))(0,f),f.id,d.viewportBuffer,d.quadTriangleIndexBuffer,d.viewportSegments,f.paint,d.transform.zoom)}(l,o))},line:function(l,r,o,h){if(l.renderPass!=="translucent")return;const d=o.paint.get("line-opacity"),f=o.paint.get("line-width");if(d.constantOr(1)===0||f.constantOr(1)===0)return;const g=l.depthModeForSublayer(0,a.DepthMode.ReadOnly),y=l.colorModeForRenderPass(),v=l.terrain&&l.terrain.renderingToTexture?1:a.exported.devicePixelRatio,E=o.paint.get("line-dasharray"),T=E.constantOr(1),A=o.layout.get("line-cap"),k=o.paint.get("line-pattern"),R=k.constantOr(1),O=o.paint.get("line-gradient"),B=R?"linePattern":"line",F=l.context,I=F.gl,L=(j=>{const K=[];$o(j)&&K.push("RENDER_LINE_DASH"),j.paint.get("line-gradient")&&K.push("RENDER_LINE_GRADIENT");const J=j.paint.get("line-trim-offset");J[0]===0&&J[1]===0||K.push("RENDER_LINE_TRIM_OFFSET");const Y=j.paint.get("line-pattern").constantOr(1),ie=j.paint.get("line-opacity").constantOr(1)!==1;return!Y&&ie&&K.push("RENDER_LINE_ALPHA_DISCARD"),K})(o);let N=L.includes("RENDER_LINE_ALPHA_DISCARD");l.terrain&&l.terrain.clipOrMaskOverlapStencilType()&&(N=!1);for(const j of h){const K=r.getTile(j);if(R&&!K.patternsLoaded())continue;const J=K.getBucket(o);if(!J)continue;l.prepareDrawTile();const Y=J.programConfigurations.get(o.id),ie=l.useProgram(B,Y,L),te=k.constantOr(null);if(te&&K.imageAtlas){const _e=K.imageAtlas.patternPositions[te.toString()];_e&&Y.setConstantPatternPositions(_e)}const le=E.constantOr(null),Te=A.constantOr(null);if(!R&&le&&Te&&K.lineAtlas){const _e=K.lineAtlas.getDash(le,Te);_e&&Y.setConstantPatternPositions(_e)}let[oe,ge]=o.paint.get("line-trim-offset");(Te==="round"||Te==="square")&&oe!==ge&&(oe===0&&(oe-=1),ge===1&&(ge+=1));const he=l.terrain?j.projMatrix:null,we=R?Go(l,K,o,he,v):Dh(l,K,o,he,J.lineClipsArray.length,v,[oe,ge]);if(O){const _e=J.gradients[o.id];let Me=_e.texture;if(o.gradientVersion!==_e.version){let ve=256;if(o.stepInterpolant){const Ae=r.getSource().maxzoom,Ge=j.canonical.z===Ae?Math.ceil(1<{ie.draw(F,I.TRIANGLES,g,_e,y,a.CullFaceMode.disabled,we,o.id,J.layoutVertexBuffer,J.indexBuffer,J.segments,o.paint,l.transform.zoom,Y,[J.layoutVertexBuffer2])};if(N){const _e=l.stencilModeForClipping(j).ref;_e===0&&l.terrain&&F.clear({stencil:0});const Me={func:I.EQUAL,mask:255};we.u_alpha_discard_threshold=.8,ae(new a.StencilMode(Me,_e,255,I.KEEP,I.KEEP,I.INVERT)),we.u_alpha_discard_threshold=0,ae(new a.StencilMode(Me,_e,255,I.KEEP,I.KEEP,I.KEEP))}else ae(l.stencilModeForClipping(j))}N&&(l.resetStencilClippingMasks(),l.terrain&&F.clear({stencil:0}))},fill:function(l,r,o,h){const d=o.paint.get("fill-color"),f=o.paint.get("fill-opacity");if(f.constantOr(1)===0)return;const g=l.colorModeForRenderPass(),y=o.paint.get("fill-pattern"),v=l.opaquePassEnabledForLayer()&&!y.constantOr(1)&&d.constantOr(a.Color.transparent).a===1&&f.constantOr(0)===1?"opaque":"translucent";if(l.renderPass===v){const E=l.depthModeForSublayer(1,l.renderPass==="opaque"?a.DepthMode.ReadWrite:a.DepthMode.ReadOnly);yc(l,r,o,h,E,g,!1)}if(l.renderPass==="translucent"&&o.paint.get("fill-antialias")){const E=l.depthModeForSublayer(o.getPaintProperty("fill-outline-color")?2:0,a.DepthMode.ReadOnly);yc(l,r,o,h,E,g,!0)}},"fill-extrusion":function(l,r,o,h){const d=o.paint.get("fill-extrusion-opacity");if(d!==0&&l.renderPass==="translucent"){const f=new a.DepthMode(l.context.gl.LEQUAL,a.DepthMode.ReadWrite,l.depthRangeFor3D);if(d!==1||o.paint.get("fill-extrusion-pattern").constantOr(1))Os(l,r,o,h,f,a.StencilMode.disabled,a.ColorMode.disabled),Os(l,r,o,h,f,l.stencilModeFor3D(),l.colorModeForRenderPass()),l.resetStencilClippingMasks();else{const g=l.colorModeForRenderPass();Os(l,r,o,h,f,a.StencilMode.disabled,g)}}},hillshade:function(l,r,o,h){if(l.renderPass!=="offscreen"&&l.renderPass!=="translucent")return;const d=l.context,f=l.depthModeForSublayer(0,a.DepthMode.ReadOnly),g=l.colorModeForRenderPass(),y=l.terrain&&l.terrain.renderingToTexture,[v,E]=l.renderPass!=="translucent"||y?[{},h]:l.stencilConfigForOverlap(h);for(const T of E){const A=r.getTile(T);if(A.needsHillshadePrepare&&l.renderPass==="offscreen")cc(l,A,o,f,a.StencilMode.disabled,g);else if(l.renderPass==="translucent"){const k=y&&l.terrain?l.terrain.stencilModeForRTTOverlap(T):v[T.overscaledZ];lc(l,T,A,o,f,k,g)}}d.viewport.set([0,0,l.width,l.height]),l.resetStencilClippingMasks()},raster:function(l,r,o,h,d,f){if(l.renderPass!=="translucent"||o.paint.get("raster-opacity")===0||!h.length)return;const g=l.context,y=g.gl,v=r.getSource(),E=l.useProgram("raster"),T=l.colorModeForRenderPass(),A=l.terrain&&l.terrain.renderingToTexture,[k,R]=v instanceof rt||A?[{},h]:l.stencilConfigForOverlap(h),O=R[R.length-1].overscaledZ,B=!l.options.moving;for(const F of R){const I=A?a.DepthMode.disabled:l.depthModeForSublayer(F.overscaledZ-O,o.paint.get("raster-opacity")===1?a.DepthMode.ReadWrite:a.DepthMode.ReadOnly,y.LESS),L=F.toUnwrapped(),N=r.getTile(F);if(A&&(!N||!N.hasData()))continue;const j=A?F.projMatrix:l.transform.calculateProjMatrix(L,B),K=l.terrain&&A?l.terrain.stencilModeForRTTOverlap(F):k[F.overscaledZ],J=f?0:o.paint.get("raster-fade-duration");N.registerFadeDuration(J);const Y=r.findLoadedParent(F,0),ie=ja(N,Y,r,l.transform,J);let te,le;l.terrain&&l.terrain.prepareDrawTile();const Te=o.paint.get("raster-resampling")==="nearest"?y.NEAREST:y.LINEAR;g.activeTexture.set(y.TEXTURE0),N.texture.bind(Te,y.CLAMP_TO_EDGE),g.activeTexture.set(y.TEXTURE1),Y?(Y.texture.bind(Te,y.CLAMP_TO_EDGE),te=Math.pow(2,Y.tileID.overscaledZ-N.tileID.overscaledZ),le=[N.tileID.canonical.x*te%1,N.tileID.canonical.y*te%1]):N.texture.bind(Te,y.CLAMP_TO_EDGE),N.texture.useMipmap&&g.extTextureFilterAnisotropic&&l.transform.pitch>20&&y.texParameterf(y.TEXTURE_2D,g.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,g.extTextureFilterAnisotropicMax);const oe=Ya(j,le||[0,0],te||1,ie,o,v instanceof rt?v.perspectiveTransform:[0,0]);if(l.prepareDrawProgram(g,E,L),v instanceof rt)v.boundsBuffer&&v.boundsSegments&&E.draw(g,y.TRIANGLES,I,a.StencilMode.disabled,T,a.CullFaceMode.disabled,oe,o.id,v.boundsBuffer,l.quadTriangleIndexBuffer,v.boundsSegments);else{const{tileBoundsBuffer:ge,tileBoundsIndexBuffer:he,tileBoundsSegments:we}=l.getTileBoundsBuffers(N);E.draw(g,y.TRIANGLES,I,K,T,a.CullFaceMode.disabled,oe,o.id,ge,he,we)}}l.resetStencilClippingMasks()},background:function(l,r,o,h){const d=o.paint.get("background-color"),f=o.paint.get("background-opacity");if(f===0)return;const g=l.context,y=g.gl,v=l.transform,E=v.tileSize,T=o.paint.get("background-pattern");if(l.isPatternMissing(T))return;const A=!T&&d.a===1&&f===1&&l.opaquePassEnabledForLayer()?"opaque":"translucent";if(l.renderPass!==A)return;const k=a.StencilMode.disabled,R=l.depthModeForSublayer(0,A==="opaque"?a.DepthMode.ReadWrite:a.DepthMode.ReadOnly),O=l.colorModeForRenderPass(),B=l.useProgram(T?"backgroundPattern":"background");let F,I=h;I||(F=l.getBackgroundTiles(),I=Object.values(F).map(L=>L.tileID)),T&&(g.activeTexture.set(y.TEXTURE0),l.imageManager.bind(l.context));for(const L of I){const N=L.toUnwrapped(),j=h?L.projMatrix:l.transform.calculateProjMatrix(N);l.prepareDrawTile();const K=r?r.getTile(L):F?F[L.key]:new a.Tile(L,E,v.zoom,l),J=T?Lh(j,f,l,T,{tileID:L,tileSize:E}):Qa(j,f,d);l.prepareDrawProgram(g,B,N);const{tileBoundsBuffer:Y,tileBoundsIndexBuffer:ie,tileBoundsSegments:te}=l.getTileBoundsBuffers(K);B.draw(g,y.TRIANGLES,R,k,O,a.CullFaceMode.disabled,J,o.id,Y,ie,te)}},sky:function(l,r,o){const h=l.transform,d=h.projection.name==="mercator"||h.projection.name==="globe"?1:a.smoothstep(7,8,h.zoom),f=o.paint.get("sky-opacity")*d;if(f===0)return;const g=l.context,y=o.paint.get("sky-type"),v=new a.DepthMode(g.gl.LEQUAL,a.DepthMode.ReadOnly,[0,1]),E=l.frameCounter/1e3%1;y==="atmosphere"?l.renderPass==="offscreen"?o.needsSkyboxCapture(l)&&(function(T,A,k,R){const O=T.context,B=O.gl;let F=A.skyboxFbo;if(!F){F=A.skyboxFbo=O.createFramebuffer(32,32,!1),A.skyboxGeometry=new Us(O),A.skyboxTexture=O.gl.createTexture(),B.bindTexture(B.TEXTURE_CUBE_MAP,A.skyboxTexture),B.texParameteri(B.TEXTURE_CUBE_MAP,B.TEXTURE_WRAP_S,B.CLAMP_TO_EDGE),B.texParameteri(B.TEXTURE_CUBE_MAP,B.TEXTURE_WRAP_T,B.CLAMP_TO_EDGE),B.texParameteri(B.TEXTURE_CUBE_MAP,B.TEXTURE_MIN_FILTER,B.LINEAR),B.texParameteri(B.TEXTURE_CUBE_MAP,B.TEXTURE_MAG_FILTER,B.LINEAR);for(let j=0;j<6;++j)B.texImage2D(B.TEXTURE_CUBE_MAP_POSITIVE_X+j,0,B.RGBA,32,32,0,B.RGBA,B.UNSIGNED_BYTE,null)}O.bindFramebuffer.set(F.framebuffer),O.viewport.set([0,0,32,32]);const I=A.getCenter(T,!0),L=T.useProgram("skyboxCapture"),N=new Float64Array(16);a.identity(N),a.rotateY(N,N,.5*-Math.PI),Gi(O,A,L,N,I,0),a.identity(N),a.rotateY(N,N,.5*Math.PI),Gi(O,A,L,N,I,1),a.identity(N),a.rotateX(N,N,.5*-Math.PI),Gi(O,A,L,N,I,2),a.identity(N),a.rotateX(N,N,.5*Math.PI),Gi(O,A,L,N,I,3),a.identity(N),Gi(O,A,L,N,I,4),a.identity(N),a.rotateY(N,N,Math.PI),Gi(O,A,L,N,I,5),O.viewport.set([0,0,T.width,T.height])}(l,o),o.markSkyboxValid(l)):l.renderPass==="sky"&&function(T,A,k,R,O){const B=T.context,F=B.gl,I=T.transform,L=T.useProgram("skybox");B.activeTexture.set(F.TEXTURE0),F.bindTexture(F.TEXTURE_CUBE_MAP,A.skyboxTexture);const N=((j,K,J,Y,ie)=>({u_matrix:j,u_sun_direction:K,u_cubemap:0,u_opacity:Y,u_temporal_offset:ie}))(I.skyboxMatrix,A.getCenter(T,!1),0,R,O);T.prepareDrawProgram(B,L),L.draw(B,F.TRIANGLES,k,a.StencilMode.disabled,T.colorModeForRenderPass(),a.CullFaceMode.backCW,N,"skybox",A.skyboxGeometry.vertexBuffer,A.skyboxGeometry.indexBuffer,A.skyboxGeometry.segment)}(l,o,v,f,E):y==="gradient"&&l.renderPass==="sky"&&function(T,A,k,R,O){const B=T.context,F=B.gl,I=T.transform,L=T.useProgram("skyboxGradient");A.skyboxGeometry||(A.skyboxGeometry=new Us(B)),B.activeTexture.set(F.TEXTURE0);let N=A.colorRampTexture;N||(N=A.colorRampTexture=new a.Texture(B,A.colorRamp,F.RGBA)),N.bind(F.LINEAR,F.CLAMP_TO_EDGE);const j=((K,J,Y,ie,te)=>({u_matrix:K,u_color_ramp:0,u_center_direction:J,u_radius:a.degToRad(Y),u_opacity:ie,u_temporal_offset:te}))(I.skyboxMatrix,A.getCenter(T,!1),A.paint.get("sky-gradient-radius"),R,O);T.prepareDrawProgram(B,L),L.draw(B,F.TRIANGLES,k,a.StencilMode.disabled,T.colorModeForRenderPass(),a.CullFaceMode.backCW,j,"skyboxGradient",A.skyboxGeometry.vertexBuffer,A.skyboxGeometry.indexBuffer,A.skyboxGeometry.segment)}(l,o,v,f,E)},debug:function(l,r,o){for(let h=0;hd)return void(this.transform.fogCullDistSq=null);const f=h+.78*(d-h);this.transform.fogCullDistSq=f*f}get terrain(){return this.transform._terrainEnabled()&&this._terrain&&this._terrain.enabled?this._terrain:null}resize(r,o){if(this.width=r*a.exported.devicePixelRatio,this.height=o*a.exported.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const h of this.style.order)this.style._layers[h].resize()}setup(){const r=this.context,o=new a.StructArrayLayout2i4;o.emplaceBack(0,0),o.emplaceBack(a.EXTENT,0),o.emplaceBack(0,a.EXTENT),o.emplaceBack(a.EXTENT,a.EXTENT),this.tileExtentBuffer=r.createVertexBuffer(o,a.posAttributes.members),this.tileExtentSegments=a.SegmentVector.simpleSegment(0,0,4,2);const h=new a.StructArrayLayout2i4;h.emplaceBack(0,0),h.emplaceBack(a.EXTENT,0),h.emplaceBack(0,a.EXTENT),h.emplaceBack(a.EXTENT,a.EXTENT),this.debugBuffer=r.createVertexBuffer(h,a.posAttributes.members),this.debugSegments=a.SegmentVector.simpleSegment(0,0,4,5);const d=new a.StructArrayLayout2i4;d.emplaceBack(-1,-1),d.emplaceBack(1,-1),d.emplaceBack(-1,1),d.emplaceBack(1,1),this.viewportBuffer=r.createVertexBuffer(d,a.posAttributes.members),this.viewportSegments=a.SegmentVector.simpleSegment(0,0,4,2);const f=new a.StructArrayLayout4i8;f.emplaceBack(0,0,0,0),f.emplaceBack(a.EXTENT,0,a.EXTENT,0),f.emplaceBack(0,a.EXTENT,0,a.EXTENT),f.emplaceBack(a.EXTENT,a.EXTENT,a.EXTENT,a.EXTENT),this.mercatorBoundsBuffer=r.createVertexBuffer(f,a.boundsAttributes.members),this.mercatorBoundsSegments=a.SegmentVector.simpleSegment(0,0,4,2);const g=new a.StructArrayLayout3ui6;g.emplaceBack(0,1,2),g.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=r.createIndexBuffer(g);const y=new a.StructArrayLayout1ui2;for(const E of[0,1,3,2,0])y.emplaceBack(E);this.debugIndexBuffer=r.createIndexBuffer(y),this.emptyTexture=new a.Texture(r,new a.RGBAImage({width:1,height:1},Uint8Array.of(0,0,0,0)),r.gl.RGBA),this.identityMat=a.create();const v=this.context.gl;this.stencilClearMode=new a.StencilMode({func:v.ALWAYS,mask:0},0,255,v.ZERO,v.ZERO,v.ZERO),this.loadTimeStamps.push(a.window.performance.now()),this.atmosphereBuffer=new Tc(this.context)}getMercatorTileBoundsBuffers(){return{tileBoundsBuffer:this.mercatorBoundsBuffer,tileBoundsIndexBuffer:this.quadTriangleIndexBuffer,tileBoundsSegments:this.mercatorBoundsSegments}}getTileBoundsBuffers(r){return r._makeTileBoundsBuffers(this.context,this.transform.projection),r._tileBoundsBuffer?{tileBoundsBuffer:r._tileBoundsBuffer,tileBoundsIndexBuffer:r._tileBoundsIndexBuffer,tileBoundsSegments:r._tileBoundsSegments}:this.getMercatorTileBoundsBuffers()}clearStencil(){const r=this.context,o=r.gl;this.nextStencilID=1,this.currentStencilSource=void 0,this._tileClippingMaskIDs={},this.useProgram("clippingMask").draw(r,o.TRIANGLES,a.DepthMode.disabled,this.stencilClearMode,a.ColorMode.disabled,a.CullFaceMode.disabled,No(this.identityMat),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}resetStencilClippingMasks(){this.terrain||(this.currentStencilSource=void 0,this._tileClippingMaskIDs={})}_renderTileClippingMasks(r,o,h){if(!o||this.currentStencilSource===o.id||!r.isTileClipped()||!h||h.length===0)return;if(this._tileClippingMaskIDs&&!this.terrain){let y=!1;for(const v of h)if(this._tileClippingMaskIDs[v.key]===void 0){y=!0;break}if(!y)return}this.currentStencilSource=o.id;const d=this.context,f=d.gl;this.nextStencilID+h.length>256&&this.clearStencil(),d.setColorMode(a.ColorMode.disabled),d.setDepthMode(a.DepthMode.disabled);const g=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const y of h){const v=o.getTile(y),E=this._tileClippingMaskIDs[y.key]=this.nextStencilID++,{tileBoundsBuffer:T,tileBoundsIndexBuffer:A,tileBoundsSegments:k}=this.getTileBoundsBuffers(v);g.draw(d,f.TRIANGLES,a.DepthMode.disabled,new a.StencilMode({func:f.ALWAYS,mask:0},E,255,f.KEEP,f.KEEP,f.REPLACE),a.ColorMode.disabled,a.CullFaceMode.disabled,No(y.projMatrix),"$clipping",T,A,k)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const r=this.nextStencilID++,o=this.context.gl;return new a.StencilMode({func:o.NOTEQUAL,mask:255},r,255,o.KEEP,o.KEEP,o.REPLACE)}stencilModeForClipping(r){if(this.terrain)return this.terrain.stencilModeForRTTOverlap(r);const o=this.context.gl;return new a.StencilMode({func:o.EQUAL,mask:255},this._tileClippingMaskIDs[r.key],0,o.KEEP,o.KEEP,o.REPLACE)}stencilConfigForOverlap(r){const o=this.context.gl,h=r.sort((g,y)=>y.overscaledZ-g.overscaledZ),d=h[h.length-1].overscaledZ,f=h[0].overscaledZ-d+1;if(f>1){this.currentStencilSource=void 0,this.nextStencilID+f>256&&this.clearStencil();const g={};for(let y=0;y=0;this.currentLayer--){const E=this.style._layers[h[this.currentLayer]],T=r._getLayerSourceCache(E);if(E.isSky())continue;const A=T?g[T.id]:void 0;this._renderTileClippingMasks(E,T,A),this.renderLayer(this,T,E,A)}if(this.style.fog&&this.transform.projection.supportsFog&&function(E,T){const A=E.context,k=A.gl,R=E.transform,O=new a.DepthMode(k.LEQUAL,a.DepthMode.ReadOnly,[0,1]),B=E.useProgram("globeAtmosphere",null,R.projection.name==="globe"?["PROJECTION_GLOBE_VIEW","FOG"]:["FOG"]),F=a.globeToMercatorTransition(R.zoom),I=T.properties.get("color").toArray01(),L=T.properties.get("high-color").toArray01(),N=T.properties.get("space-color").toArray01PremultipliedAlpha(),j=a.identity$1([]);a.rotateY$1(j,j,-a.degToRad(R._center.lng)),a.rotateX$1(j,j,a.degToRad(R._center.lat)),a.rotateZ$1(j,j,R.angle),a.rotateX$1(j,j,-R._pitch);const K=a.fromQuat(new Float32Array(16),j),J=a.mapValue(T.properties.get("star-intensity"),0,1,0,.25),Y=5e-4,ie=a.mapValue(T.properties.get("horizon-blend"),0,1,Y,.25),te=a.globeUseCustomAntiAliasing(E,A,R)&&ie===Y?R.worldSize/(2*Math.PI*1.025)-1:R.globeRadius,le=E.frameCounter/1e3%1,Te=a.length(R.globeCenterInViewSpace),oe=Math.sqrt(Math.pow(Te,2)-Math.pow(te,2)),ge=Math.acos(oe/Te),he=((ae,_e,Me,ve,Ae,Ge,Xe,Ve,qe,lt,ot,je,wt,Tt)=>({u_frustum_tl:ae,u_frustum_tr:_e,u_frustum_br:Me,u_frustum_bl:ve,u_horizon:Ae,u_transition:Ge,u_fadeout_range:Xe,u_color:Ve,u_high_color:qe,u_space_color:lt,u_star_intensity:ot,u_star_size:5*a.exported.devicePixelRatio,u_star_density:0,u_temporal_offset:je,u_horizon_angle:wt,u_rotation_matrix:Tt}))(R.frustumCorners.TL,R.frustumCorners.TR,R.frustumCorners.BR,R.frustumCorners.BL,R.frustumCorners.horizon,F,ie,I,L,N,J,le,ge,K);E.prepareDrawProgram(A,B);const we=E.atmosphereBuffer;we&&B.draw(A,k.TRIANGLES,O,a.StencilMode.disabled,a.ColorMode.alphaBlended,a.CullFaceMode.backCW,he,"skybox",we.vertexBuffer,we.indexBuffer,we.segments)}(this,this.style.fog),this.renderPass="sky",(a.globeToMercatorTransition(this.transform.zoom)>0||this.transform.projection.name!=="globe")&&this.transform.isHorizonVisible())for(this.currentLayer=0;this.currentLayer{const A=r._getLayerSourceCache(T);A&&!T.isHidden(this.transform.zoom)&&(!E||E.getSource().maxzoom0?o.pop():null}isPatternMissing(r){return r===null||r!==void 0&&!this.imageManager.getPattern(r.toString())}terrainRenderModeElevated(){return this.style&&!!this.style.getTerrain()&&!!this.terrain&&!this.terrain.renderingToTexture}currentGlobalDefines(){const r=this.terrain&&this.terrain.renderingToTexture,o=this.terrain&&this.terrain.exaggeration()===0,h=this.style&&this.style.fog,d=[];return this.terrainRenderModeElevated()&&d.push("TERRAIN"),this.transform.projection.name==="globe"&&d.push("GLOBE"),o&&d.push("ZERO_EXAGGERATION"),h&&!r&&h.getOpacity(this.transform.pitch)!==0&&d.push("FOG"),r&&d.push("RENDER_TO_TEXTURE"),this._showOverdrawInspector&&d.push("OVERDRAW_INSPECTOR"),d}useProgram(r,o,h){this.cache=this.cache||{};const d=h||[],f=this.currentGlobalDefines().concat(d),g=mt.cacheKey(Fa[r],r,f,o);return this.cache[g]||(this.cache[g]=new mt(this.context,r,Fa[r],o,el[r],f)),this.cache[g]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.frontFace.setDefault(),this.context.cullFaceSide.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const r=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(r.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=a.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new a.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this._terrain&&this._terrain.destroy(),this.globeSharedBuffers&&this.globeSharedBuffers.destroy(),this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.atmosphereBuffer&&this.atmosphereBuffer.destroy()}prepareDrawTile(){this.terrain&&this.terrain.prepareDrawTile()}prepareDrawProgram(r,o,h){if(this.terrain&&this.terrain.renderingToTexture)return;const d=this.style.fog;if(d){const f=d.getOpacity(this.transform.pitch),g=((y,v,E,T,A,k,R,O,B,F,I)=>{const L=y.transform,N=v.properties.get("color").toArray01();N[3]=T;const j=y.frameCounter/1e3%1;return{u_fog_matrix:E?L.calculateFogTileMatrix(E):y.identityMat,u_fog_range:v.getFovAdjustedRange(L._fov),u_fog_color:N,u_fog_horizon_blend:v.properties.get("horizon-blend"),u_fog_temporal_offset:j,u_frustum_tl:A,u_frustum_tr:k,u_frustum_br:R,u_frustum_bl:O,u_globe_pos:B,u_globe_radius:F,u_viewport:I,u_globe_transition:a.globeToMercatorTransition(L.zoom),u_is_globe:+(L.projection.name==="globe")}})(this,d,h,f,this.transform.frustumCorners.TL,this.transform.frustumCorners.TR,this.transform.frustumCorners.BR,this.transform.frustumCorners.BL,this.transform.globeCenterInViewSpace,this.transform.globeRadius,[this.transform.width*a.exported.devicePixelRatio,this.transform.height*a.exported.devicePixelRatio]);o.setFogUniformValues(r,g)}}setTileLoadedFlag(r){this.tileLoaded=r}saveCanvasCopy(){const r=this.canvasCopy();r&&(this.frameCopies.push(r),this.tileLoaded=!1)}canvasCopy(){const r=this.context.gl,o=r.createTexture();return r.bindTexture(r.TEXTURE_2D,o),r.copyTexImage2D(r.TEXTURE_2D,0,r.RGBA,0,0,r.drawingBufferWidth,r.drawingBufferHeight,0),o}getCanvasCopiesAndTimestamps(){return{canvasCopies:this.frameCopies,timeStamps:this.loadTimeStamps}}averageElevationNeedsEasing(){if(!this.transform._elevation)return!1;const r=this.style&&this.style.fog;return!!r&&r.getOpacity(this.transform.pitch)!==0}getBackgroundTiles(){const r=this._backgroundTiles,o=this._backgroundTiles={},h=this.transform.coveringTiles({tileSize:512});for(const d of h)o[d.key]=r[d.key]||new a.Tile(d,512,this.transform.tileZoom,this);return o}clearBackgroundTiles(){this._backgroundTiles={}}}class Vs{constructor(r=0,o=0,h=0,d=0){if(isNaN(r)||r<0||isNaN(o)||o<0||isNaN(h)||h<0||isNaN(d)||d<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=r,this.bottom=o,this.left=h,this.right=d}interpolate(r,o,h){return o.top!=null&&r.top!=null&&(this.top=a.number(r.top,o.top,h)),o.bottom!=null&&r.bottom!=null&&(this.bottom=a.number(r.bottom,o.bottom,h)),o.left!=null&&r.left!=null&&(this.left=a.number(r.left,o.left,h)),o.right!=null&&r.right!=null&&(this.right=a.number(r.right,o.right,h)),this}getCenter(r,o){const h=a.clamp((this.left+r-this.right)/2,0,r),d=a.clamp((this.top+o-this.bottom)/2,0,o);return new a.Point(h,d)}equals(r){return this.top===r.top&&this.bottom===r.bottom&&this.left===r.left&&this.right===r.right}clone(){return new Vs(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function Ns(l,r){const o=a.getColumn(l,3);a.fromQuat(l,r),a.setColumn(l,3,o)}function _t(l,r){const o=a.identity$1([]);return a.rotateZ$1(o,o,-r),a.rotateX$1(o,o,-l),o}function Xo(l,r){const o=[l[0],l[1],0],h=[r[0],r[1],0];if(a.length(o)>=1e-15){const g=a.normalize([],o);a.scale$2(h,g,a.dot(h,g)),r[0]=h[0],r[1]=h[1]}const d=a.cross([],r,l);if(a.len(d)<1e-15)return null;const f=Math.atan2(-d[1],d[0]);return _t(Math.atan2(Math.sqrt(l[0]*l[0]+l[1]*l[1]),-l[2]),f)}class Ec{constructor(r,o){this.position=r,this.orientation=o}get position(){return this._position}set position(r){if(r){const o=r instanceof a.MercatorCoordinate?r:new a.MercatorCoordinate(r[0],r[1],r[2]);this._renderWorldCopies&&(o.x=a.wrap(o.x,0,1)),this._position=o}else this._position=null}lookAtPoint(r,o){if(this.orientation=null,!this.position)return;const h=this.position,d=this._elevation?this._elevation.getAtPointOrZero(a.MercatorCoordinate.fromLngLat(r)):0,f=a.MercatorCoordinate.fromLngLat(r,d),g=[f.x-h.x,f.y-h.y,f.z-h.z];o||(o=[0,0,1]),o[2]=Math.abs(o[2]),this.orientation=Xo(g,o)}setPitchBearing(r,o){this.orientation=_t(a.degToRad(r),a.degToRad(-o))}}class js{constructor(r,o){this._transform=a.identity([]),this.orientation=o,this.position=r}get mercatorPosition(){const r=this.position;return new a.MercatorCoordinate(r[0],r[1],r[2])}get position(){const r=a.getColumn(this._transform,3);return[r[0],r[1],r[2]]}set position(r){var o;r&&a.setColumn(this._transform,3,[(o=r)[0],o[1],o[2],1])}get orientation(){return this._orientation}set orientation(r){this._orientation=r||a.identity$1([]),r&&Ns(this._transform,this._orientation)}getPitchBearing(){const r=this.forward(),o=this.right();return{bearing:Math.atan2(-o[1],o[0]),pitch:Math.atan2(Math.sqrt(r[0]*r[0]+r[1]*r[1]),-r[2])}}setPitchBearing(r,o){this._orientation=_t(r,o),Ns(this._transform,this._orientation)}forward(){const r=a.getColumn(this._transform,2);return[-r[0],-r[1],-r[2]]}up(){const r=a.getColumn(this._transform,1);return[-r[0],-r[1],-r[2]]}right(){const r=a.getColumn(this._transform,0);return[r[0],r[1],r[2]]}getCameraToWorld(r,o){const h=new Float64Array(16);return a.invert(h,this.getWorldToCamera(r,o)),h}getWorldToCameraPosition(r,o,h){const d=this.position;a.scale$2(d,d,-r);const f=new Float64Array(16);return a.fromScaling(f,[h,h,h]),a.translate(f,f,d),f[10]*=o,f}getWorldToCamera(r,o){const h=new Float64Array(16),d=new Float64Array(4),f=this.position;return a.conjugate(d,this._orientation),a.scale$2(f,f,-r),a.fromQuat(h,d),a.translate(h,h,f),h[1]*=-1,h[5]*=-1,h[9]*=-1,h[13]*=-1,h[8]*=o,h[9]*=o,h[10]*=o,h[11]*=o,h}getCameraToClipPerspective(r,o,h,d){const f=new Float64Array(16);return a.perspective(f,r,o,h,d),f}getDistanceToElevation(r,o=!1){const h=r===0?0:a.mercatorZfromAltitude(r,o?a.latFromMercatorY(this.position[1]):this.position[1]),d=this.forward();return(h-this.position[2])/d[2]}clone(){return new js([...this.position],[...this.orientation])}}function ro(l,r){const o=Gs(l.projection,l.zoom,l.width,l.height),h=function(f,g,y,v,E){const T=new a.LngLat(y.lng-180*Dr,y.lat),A=new a.LngLat(y.lng+180*Dr,y.lat),k=f.project(T.lng,T.lat),R=f.project(A.lng,A.lat),O=-Math.atan2(R.y-k.y,R.x-k.x),B=a.MercatorCoordinate.fromLngLat(y);B.y=a.clamp(B.y,-1+Dr,1-Dr);const F=B.toLngLat(),I=f.project(F.lng,F.lat),L=a.MercatorCoordinate.fromLngLat(F);L.x+=Dr;const N=L.toLngLat(),j=f.project(N.lng,N.lat),K=$s(j.x-I.x,j.y-I.y,O),J=a.MercatorCoordinate.fromLngLat(F);J.y+=Dr;const Y=J.toLngLat(),ie=f.project(Y.lng,Y.lat),te=$s(ie.x-I.x,ie.y-I.y,O),le=Math.abs(K.x)/Math.abs(te.y),Te=a.identity([]);a.rotateZ(Te,Te,-O*(1-(E?0:v)));const oe=a.identity([]);return a.scale(oe,oe,[1,1-(1-le)*v,1]),oe[4]=-te.x/te.y*v,a.rotateZ(oe,oe,O),a.multiply(oe,Te,oe),oe}(l.projection,0,l.center,o,r),d=Sc(l);return a.scale(h,h,[d,d,1]),h}function Sc(l){const r=l.projection,o=Gs(l.projection,l.zoom,l.width,l.height),h=Mc(r,l.center),d=Mc(r,a.LngLat.convert(r.center));return Math.pow(2,h*o+(1-o)*d)}function Gs(l,r,o,h,d=1/0){const f=l.range;if(!f)return 0;const g=Math.min(d,Math.max(o,h)),y=Math.log(g/1024)/Math.LN2;return a.smoothstep(f[0]+y,f[1]+y,r)}const Dr=1/4e4;function Mc(l,r){const o=a.clamp(r.lat,-a.MAX_MERCATOR_LATITUDE,a.MAX_MERCATOR_LATITUDE),h=new a.LngLat(r.lng-180*Dr,o),d=new a.LngLat(r.lng+180*Dr,o),f=l.project(h.lng,o),g=l.project(d.lng,o),y=a.MercatorCoordinate.fromLngLat(h),v=a.MercatorCoordinate.fromLngLat(d),E=g.x-f.x,T=g.y-f.y,A=v.x-y.x,k=v.y-y.y,R=Math.sqrt((A*A+k*k)/(E*E+T*T));return Math.log(R)/Math.LN2}function $s(l,r,o){const h=Math.cos(o),d=Math.sin(o);return{x:l*h-r*d,y:l*d+r*h}}class no{constructor(r,o,h,d,f,g,y){this.tileSize=512,this._renderWorldCopies=f===void 0||f,this._minZoom=r||0,this._maxZoom=o||22,this._minPitch=h??0,this._maxPitch=d??60,this.setProjection(g),this.setMaxBounds(y),this.width=0,this.height=0,this._center=new a.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._nearZ=0,this._farZ=0,this._unmodified=!0,this._edgeInsets=new Vs,this._projMatrixCache={},this._alignedProjMatrixCache={},this._fogTileMatrixCache={},this._distanceTileDataCache={},this._camera=new js,this._centerAltitude=0,this._averageElevation=0,this.cameraElevationReference="ground",this._pixelsPerMercatorPixel=1,this.globeRadius=0,this.globeCenterInViewSpace=[0,0,0],this._horizonShift=.1}clone(){const r=new no(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies,this.getProjection());return r._elevation=this._elevation,r._centerAltitude=this._centerAltitude,r._centerAltitudeValidForExaggeration=this._centerAltitudeValidForExaggeration,r.tileSize=this.tileSize,r.mercatorFromTransition=this.mercatorFromTransition,r.width=this.width,r.height=this.height,r.cameraElevationReference=this.cameraElevationReference,r._center=this._center,r._setZoom(this.zoom),r._seaLevelZoom=this._seaLevelZoom,r.angle=this.angle,r._fov=this._fov,r._pitch=this._pitch,r._nearZ=this._nearZ,r._farZ=this._farZ,r._averageElevation=this._averageElevation,r._unmodified=this._unmodified,r._edgeInsets=this._edgeInsets.clone(),r._camera=this._camera.clone(),r._calcMatrices(),r.freezeTileCoverage=this.freezeTileCoverage,r.frustumCorners=this.frustumCorners,r}get elevation(){return this._elevation}set elevation(r){this._elevation!==r&&(this._elevation=r,this._updateCameraOnTerrain(),this._calcMatrices())}updateElevation(r,o=!1){const h=this._elevation&&this._elevation.exaggeration()!==this._centerAltitudeValidForExaggeration;(this._seaLevelZoom==null||h)&&this._updateCameraOnTerrain(),(r||h)&&this._constrainCamera(o),this._calcMatrices()}getProjection(){return a.pick(this.projection,["name","center","parallels"])}setProjection(r){this.projectionOptions=r||{name:"mercator"};const o=this.projection?this.getProjection():void 0;this.projection=a.getProjection(this.projectionOptions);const h=!Se(o,this.getProjection());return h&&this._calcMatrices(),this.mercatorFromTransition=!1,h}setMercatorFromTransition(){const r=this.projection.name;this.mercatorFromTransition=!0,this.projectionOptions={name:"mercator"},this.projection=a.getProjection({name:"mercator"});const o=r!==this.projection.name;return o&&this._calcMatrices(),o}get minZoom(){return this._minZoom}set minZoom(r){this._minZoom!==r&&(this._minZoom=r,this.zoom=Math.max(this.zoom,r))}get maxZoom(){return this._maxZoom}set maxZoom(r){this._maxZoom!==r&&(this._maxZoom=r,this.zoom=Math.min(this.zoom,r))}get minPitch(){return this._minPitch}set minPitch(r){this._minPitch!==r&&(this._minPitch=r,this.pitch=Math.max(this.pitch,r))}get maxPitch(){return this._maxPitch}set maxPitch(r){this._maxPitch!==r&&(this._maxPitch=r,this.pitch=Math.min(this.pitch,r))}get renderWorldCopies(){return this._renderWorldCopies&&this.projection.supportsWorldCopies===!0}set renderWorldCopies(r){r===void 0?r=!0:r===null&&(r=!1),this._renderWorldCopies=r}get worldSize(){return this.tileSize*this.scale}get cameraWorldSizeForFog(){const r=Math.max(this._camera.getDistanceToElevation(this._averageElevation),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(r))}get cameraWorldSize(){const r=Math.max(this._camera.getDistanceToElevation(this._averageElevation,!0),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(r))}get pixelsPerMeter(){return this.projection.pixelsPerMeter(this.center.lat,this.worldSize)}get cameraPixelsPerMeter(){return a.mercatorZfromAltitude(this.center.lat,this.cameraWorldSizeForFog)}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new a.Point(this.width,this.height)}get bearing(){return a.wrap(this.rotation,-180,180)}set bearing(r){this.rotation=r}get rotation(){return-this.angle/Math.PI*180}set rotation(r){const o=-r*Math.PI/180;var h;this.angle!==o&&(this._unmodified=!1,this.angle=o,this._calcMatrices(),this.rotationMatrix=(h=new a.ARRAY_TYPE(4),a.ARRAY_TYPE!=Float32Array&&(h[1]=0,h[2]=0),h[0]=1,h[3]=1,h),function(d,f,g){var y=f[0],v=f[1],E=f[2],T=f[3],A=Math.sin(g),k=Math.cos(g);d[0]=y*k+E*A,d[1]=v*k+T*A,d[2]=y*-A+E*k,d[3]=v*-A+T*k}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(r){const o=a.clamp(r,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==o&&(this._unmodified=!1,this._pitch=o,this._calcMatrices())}get aspect(){return this.width/this.height}get fov(){return this._fov/Math.PI*180}get fovX(){return this._fov}get fovY(){const r=1/Math.tan(.5*this.fovX);return 2*Math.atan(1/this.aspect/r)}set fov(r){r=Math.max(.01,Math.min(60,r)),this._fov!==r&&(this._unmodified=!1,this._fov=a.degToRad(r),this._calcMatrices())}get averageElevation(){return this._averageElevation}set averageElevation(r){this._averageElevation=r,this._calcFogMatrices(),this._distanceTileDataCache={}}get zoom(){return this._zoom}set zoom(r){const o=Math.min(Math.max(r,this.minZoom),this.maxZoom);this._zoom!==o&&(this._unmodified=!1,this._setZoom(o),this._updateSeaLevelZoom(),this._constrain(),this._calcMatrices())}_setZoom(r){this._zoom=r,this.scale=this.zoomScale(r),this.tileZoom=Math.floor(r),this.zoomFraction=r-this.tileZoom}_updateCameraOnTerrain(){if(!this._elevation||!this._elevation.isDataAvailableAtPoint(this.locationCoordinate(this.center)))return this._centerAltitude=0,this._seaLevelZoom=null,void(this._centerAltitudeValidForExaggeration=void 0);const r=this._elevation;this._centerAltitude=r.getAtPointOrZero(this.locationCoordinate(this.center)),this._centerAltitudeValidForExaggeration=r.exaggeration(),this._updateSeaLevelZoom()}_updateSeaLevelZoom(){this._centerAltitudeValidForExaggeration!==void 0&&(this._seaLevelZoom=this._zoomFromMercatorZ((this.pixelsPerMeter*this._centerAltitude+this.cameraToCenterDistance)/this.worldSize))}sampleAverageElevation(){if(!this._elevation)return 0;const r=this._elevation,o=[[.5,.2],[.3,.5],[.5,.5],[.7,.5],[.5,.8]],h=this.horizonLineFromTop();let d=0,f=0;for(let g=0;gr.maxzoom&&(o=r.maxzoom);const g=this.locationCoordinate(this.center),y=this.center.lat,v=1<{const Me=new a.MercatorCoordinate(ae.x+25e-6,ae.y,ae.z),ve=new a.MercatorCoordinate(ae.x,ae.y+25e-6,ae.z),Ae=ae.toLngLat(),Ge=Me.toLngLat(),Xe=ve.toLngLat(),Ve=this.locationCoordinate(Ae),qe=this.locationCoordinate(Ge),lt=this.locationCoordinate(Xe),ot=Math.hypot(qe.x-Ve.x,qe.y-Ve.y),je=Math.hypot(lt.x-Ve.x,lt.y-Ve.y);return Math.sqrt(ot*je)*K/25e-6},Y=ae=>{const _e=N,Me=j;return{aabb:a.tileAABB(this,v,0,0,0,ae,Me,_e,this.projection),zoom:0,x:0,y:0,minZ:Me,maxZ:_e,wrap:ae,fullyVisible:!1}},ie=[];let te=[];const le=o,Te=r.reparseOverscaled?h:o,oe=ae=>ae*ae,ge=oe((B-this._centerAltitude)*O),he=ae=>{if(!this._elevation||!ae.tileID||!f)return;const _e=this._elevation.getMinMaxForTile(ae.tileID),Me=ae.aabb;_e?(Me.min[2]=_e.min,Me.max[2]=_e.max,Me.center[2]=(Me.min[2]+Me.max[2])/2):(ae.shouldSplit=we(ae),ae.shouldSplit||(Me.min[2]=Me.max[2]=Me.center[2]=this._centerAltitude))},we=ae=>{if(ae.zoom=.9)return!0}else if(d&&(ve=oe(ae.aabb.distanceZ(F)*O)),this.projection.isReprojectedInTileSpace&&h<=5){const Ve=Math.pow(2,ae.zoom),qe=J(new a.MercatorCoordinate((ae.x+.5)/Ve,(ae.y+.5)/Ve));Ae=qe>.85?1:qe}const Ge=_e*_e+Me*Me+ve,Xe=oe((1<{if(qe*oe(.707)0;){const ae=ie.pop(),_e=ae.x,Me=ae.y;let ve=ae.fullyVisible;if(!ve){const Ae=ae.aabb.intersects(k);if(Ae===0)continue;ve=Ae===2}if(ae.zoom!==le&&we(ae))for(let Ae=0;Ae<4;Ae++){const Ge=(_e<<1)+Ae%2,Xe=(Me<<1)+(Ae>>1),Ve={aabb:f?ae.aabb.quadrant(Ae):a.tileAABB(this,v,ae.zoom+1,Ge,Xe,ae.wrap,ae.minZ,ae.maxZ,this.projection),zoom:ae.zoom+1,x:Ge,y:Xe,wrap:ae.wrap,fullyVisible:ve,tileID:void 0,shouldSplit:void 0,minZ:ae.minZ,maxZ:ae.maxZ};d&&!T&&(Ve.tileID=new a.OverscaledTileID(ae.zoom+1===le?Te:ae.zoom+1,ae.wrap,ae.zoom+1,Ge,Xe),he(Ve)),ie.push(Ve)}else{const Ae=ae.zoom===le?Te:ae.zoom;if(r.minzoom&&r.minzoom>Ae)continue;const Ge=E[0]-(.5+_e+(ae.wrap<{const ve=[0,0,0,1],Ae=[a.EXTENT,a.EXTENT,0,1],Ge=this.calculateFogTileMatrix(Me.tileID.toUnwrapped());a.transformMat4$1(ve,ve,Ge),a.transformMat4$1(Ae,Ae,Ge);const Xe=a.getAABBPointSquareDist(ve,Ae);if(Xe===0)return!0;let Ve=!1;const qe=this._elevation;if(qe&&Xe>ae&&_e!==0){const lt=this.calculateProjMatrix(Me.tileID.toUnwrapped());let ot;r.isTerrainDEM||(ot=qe.getMinMaxForTile(Me.tileID)),ot||(ot={min:j,max:N});const je=a.furthestTileCorner(this.rotation),wt=[je[0]*a.EXTENT,je[1]*a.EXTENT,ot.max];a.transformMat4(wt,wt,lt),Ve=(1-wt[1])*this.height*.5<_e}return Xeae.distanceSq-_e.distanceSq).map(ae=>ae.tileID)}resize(r,o){this.width=r,this.height=o,this.pixelsToGLUnits=[2/r,-2/o],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(r){return Math.pow(2,r)}scaleZoom(r){return Math.log(r)/Math.LN2}project(r){const o=a.clamp(r.lat,-a.MAX_MERCATOR_LATITUDE,a.MAX_MERCATOR_LATITUDE),h=this.projection.project(r.lng,o);return new a.Point(h.x*this.worldSize,h.y*this.worldSize)}unproject(r){return this.projection.unproject(r.x/this.worldSize,r.y/this.worldSize)}get point(){return this.project(this.center)}get pointMerc(){return this.point._div(this.worldSize)}get pixelsPerMeterRatio(){return this.pixelsPerMeter/a.mercatorZfromAltitude(1,this.center.lat)/this.worldSize}setLocationAtPoint(r,o){let h,d;const f=this.centerPoint;if(this.projection.name==="globe"){const y=this.worldSize;h=(o.x-f.x)/y,d=(o.y-f.y)/y}else{const y=this.pointCoordinate(o),v=this.pointCoordinate(f);h=y.x-v.x,d=y.y-v.y}const g=this.locationCoordinate(r);this.setLocation(new a.MercatorCoordinate(g.x-h,g.y-d))}setLocation(r){this.center=this.coordinateLocation(r),this.projection.wrap&&(this.center=this.center.wrap())}locationPoint(r){return this.projection.locationPoint(this,r)}locationPoint3D(r){return this.projection.locationPoint(this,r,!0)}pointLocation(r){return this.coordinateLocation(this.pointCoordinate(r))}pointLocation3D(r){return this.coordinateLocation(this.pointCoordinate3D(r))}locationCoordinate(r,o){const h=o?a.mercatorZfromAltitude(o,r.lat):void 0,d=this.projection.project(r.lng,r.lat);return new a.MercatorCoordinate(d.x,d.y,h)}coordinateLocation(r){return this.projection.unproject(r.x,r.y)}pointRayIntersection(r,o){const h=o??this._centerAltitude,d=[r.x,r.y,0,1],f=[r.x,r.y,1,1];a.transformMat4$1(d,d,this.pixelMatrixInverse),a.transformMat4$1(f,f,this.pixelMatrixInverse);const g=f[3];a.scale$1(d,d,1/d[3]),a.scale$1(f,f,1/g);const y=d[2],v=f[2];return{p0:d,p1:f,t:y===v?0:(h-y)/(v-y)}}screenPointToMercatorRay(r){const o=[r.x,r.y,0,1],h=[r.x,r.y,1,1];return a.transformMat4$1(o,o,this.pixelMatrixInverse),a.transformMat4$1(h,h,this.pixelMatrixInverse),a.scale$1(o,o,1/o[3]),a.scale$1(h,h,1/h[3]),o[2]=a.mercatorZfromAltitude(o[2],this._center.lat)*this.worldSize,h[2]=a.mercatorZfromAltitude(h[2],this._center.lat)*this.worldSize,a.scale$1(o,o,1/this.worldSize),a.scale$1(h,h,1/this.worldSize),new a.Ray([o[0],o[1],o[2]],a.normalize([],a.sub([],h,o)))}rayIntersectionCoordinate(r){const{p0:o,p1:h,t:d}=r,f=a.mercatorZfromAltitude(o[2],this._center.lat),g=a.mercatorZfromAltitude(h[2],this._center.lat);return new a.MercatorCoordinate(a.number(o[0],h[0],d)/this.worldSize,a.number(o[1],h[1],d)/this.worldSize,a.number(f,g,d))}pointCoordinate(r,o=this._centerAltitude){return this.projection.pointCoordinate(this,r.x,r.y,o)}pointCoordinate3D(r){if(!this.elevation)return this.pointCoordinate(r);let o=this.projection.pointCoordinate3D(this,r.x,r.y);if(o)return new a.MercatorCoordinate(o[0],o[1],o[2]);let h=0,d=this.horizonLineFromTop();if(r.y>d)return this.pointCoordinate(r);const f=.02*d,g=r.clone();for(let y=0;y<10&&d-h>f;y++){g.y=a.number(h,d,.66);const v=this.projection.pointCoordinate3D(this,g.x,g.y);v?(d=g.y,o=v):h=g.y}return o?new a.MercatorCoordinate(o[0],o[1],o[2]):this.pointCoordinate(r)}isPointAboveHorizon(r){return this.projection.isPointAboveHorizon(this,r)}isPointOnSurface(r){if(r.y<0||r.y>this.height||r.x<0||r.x>this.width)return!1;if(this.elevation||this.zoom>=a.GLOBE_ZOOM_THRESHOLD_MAX)return!this.isPointAboveHorizon(r);const o=this.pointCoordinate(r);return o.y>=0&&o.y<=1}_coordinatePoint(r,o){const h=o&&this.elevation?this.elevation.getAtPointOrZero(r,this._centerAltitude):this._centerAltitude,d=[r.x*this.worldSize,r.y*this.worldSize,h+r.toAltitude(),1];return a.transformMat4$1(d,d,this.pixelMatrix),d[3]>0?new a.Point(d[0]/d[3],d[1]/d[3]):new a.Point(Number.MAX_VALUE,Number.MAX_VALUE)}_getBoundsNonRectangular(){const{top:r,left:o}=this._edgeInsets,h=this.height-this._edgeInsets.bottom,d=this.width-this._edgeInsets.right,f=this.pointLocation3D(new a.Point(o,r)),g=this.pointLocation3D(new a.Point(d,r)),y=this.pointLocation3D(new a.Point(d,h)),v=this.pointLocation3D(new a.Point(o,h));let E=Math.min(f.lng,g.lng,y.lng,v.lng),T=Math.max(f.lng,g.lng,y.lng,v.lng),A=Math.min(f.lat,g.lat,y.lat,v.lat),k=Math.max(f.lat,g.lat,y.lat,v.lat);const R=Math.pow(2,-this.zoom)/16*270,O=this.projection.name==="globe"?1:4,B=(F,I,L,N,j)=>{const K=(F+L)/2,J=(I+N)/2,Y=new a.Point(K,J),{lng:ie,lat:te}=this.pointLocation3D(Y),le=Math.max(0,E-ie,A-te,ie-T,te-k);E=Math.min(E,ie),T=Math.max(T,ie),A=Math.min(A,te),k=Math.max(k,te),(jR)&&(B(F,I,K,J,j+1),B(K,J,L,N,j+1))};if(B(o,r,d,r,1),B(d,r,d,h,1),B(d,h,o,h,1),B(o,h,o,r,1),this.projection.name==="globe"){const[F,I]=a.polesInViewport(this);F?(k=90,T=180,E=-180):I&&(A=-90,T=180,E=-180)}return new a.LngLatBounds(new a.LngLat(E,A),new a.LngLat(T,k))}_getBoundsRectangular(r,o){const{top:h,left:d}=this._edgeInsets,f=this.height-this._edgeInsets.bottom,g=this.width-this._edgeInsets.right,y=new a.Point(d,h),v=new a.Point(g,h),E=new a.Point(g,f),T=new a.Point(d,f);let A=this.pointCoordinate(y,r),k=this.pointCoordinate(v,r);const R=this.pointCoordinate(E,o),O=this.pointCoordinate(T,o),B=(F,I)=>(I.y-F.y)/(I.x-F.x);return A.y>1&&k.y>=0?A=new a.MercatorCoordinate((1-O.y)/B(O,A)+O.x,1):A.y<0&&k.y<=1&&(A=new a.MercatorCoordinate(-O.y/B(O,A)+O.x,0)),k.y>1&&A.y>=0?k=new a.MercatorCoordinate((1-R.y)/B(R,k)+R.x,1):k.y<0&&A.y<=1&&(k=new a.MercatorCoordinate(-R.y/B(R,k)+R.x,0)),new a.LngLatBounds().extend(this.coordinateLocation(A)).extend(this.coordinateLocation(k)).extend(this.coordinateLocation(O)).extend(this.coordinateLocation(R))}_getBoundsRectangularTerrain(){const r=this.elevation;if(!r.visibleDemTiles.length||r.isUsingMockSource())return this._getBoundsRectangular(0,0);const o=r.visibleDemTiles.reduce((h,d)=>{if(d.dem){const f=d.dem.tree;h.min=Math.min(h.min,f.minimums[0]),h.max=Math.max(h.max,f.maximums[0])}return h},{min:Number.MAX_VALUE,max:0});return this._getBoundsRectangular(o.min*r.exaggeration(),o.max*r.exaggeration())}getBounds(){return this.projection.name==="mercator"||this.projection.name==="equirectangular"?this._terrainEnabled()?this._getBoundsRectangularTerrain():this._getBoundsRectangular(0,0):this._getBoundsNonRectangular()}horizonLineFromTop(r=!0){const o=this.height/2/Math.tan(this._fov/2)/Math.tan(Math.max(this._pitch,.1))+this.centerOffset.y,h=this.height/2-o*(1-this._horizonShift);return r?Math.max(0,h):h}getMaxBounds(){return this.maxBounds}setMaxBounds(r){this.maxBounds=r,this.minLat=-a.MAX_MERCATOR_LATITUDE,this.maxLat=a.MAX_MERCATOR_LATITUDE,this.minLng=-180,this.maxLng=180,r&&(this.minLat=r.getSouth(),this.maxLat=r.getNorth(),this.minLng=r.getWest(),this.maxLng=r.getEast(),this.maxLngA&&(y=A-E),A-TR&&(g=R-v),R-k.5?N-1:N,j>.5?j-1:j,0]),this.alignedProjMatrix=K,y=a.create(),a.scale(y,y,[this.width/2,-this.height/2,1]),a.translate(y,y,[1,-1,0]),this.labelPlaneMatrix=y,y=a.create(),a.scale(y,y,[1,-1,1]),a.translate(y,y,[-1,-1,0]),a.scale(y,y,[2/this.width,2/this.height,1]),this.glCoordMatrix=y,this.pixelMatrix=a.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),this._calcFogMatrices(),this._distanceTileDataCache={},y=a.invert(new Float64Array(16),this.pixelMatrix),!y)throw new Error("failed to invert matrix");if(this.pixelMatrixInverse=y,this.projection.name==="globe"||this.mercatorFromTransition){this.globeMatrix=a.calculateGlobeMatrix(this);const J=[this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]];this.globeCenterInViewSpace=a.transformMat4(J,J,f),this.globeRadius=this.worldSize/2/Math.PI-1}else this.globeMatrix=y;this._projMatrixCache={},this._alignedProjMatrixCache={},this._pixelsToTileUnitsCache={}}_calcFogMatrices(){this._fogTileMatrixCache={};const r=this.cameraWorldSizeForFog,o=this.cameraPixelsPerMeter,h=this._camera.position,d=1/this.height/this._pixelsPerMercatorPixel,f=[r,r,o];a.scale$2(f,f,d),a.scale$2(h,h,-1),a.multiply$2(h,h,f);const g=a.create();a.translate(g,g,h),a.scale(g,g,f),this.mercatorFogMatrix=g,this.worldToFogMatrix=this._camera.getWorldToCameraPosition(r,o,d)}_computeCameraPosition(r){const o=(r=r||this.pixelsPerMeter)/this.pixelsPerMeter,h=this._camera.forward(),d=this.point,f=this._mercatorZfromZoom(this._seaLevelZoom?this._seaLevelZoom:this._zoom)*o-r/this.worldSize*this._centerAltitude;return[d.x/this.worldSize-h[0]*f,d.y/this.worldSize-h[1]*f,r/this.worldSize*this._centerAltitude-h[2]*f]}_updateCameraState(){this.height&&(this._camera.setPitchBearing(this._pitch,this.angle),this._camera.position=this._computeCameraPosition())}_translateCameraConstrained(r){const o=this._maxCameraBoundsDistance()*Math.cos(this._pitch),h=this._camera.position[2],d=r[2];let f=1;this.projection.wrap&&(this.center=this.center.wrap()),d>0&&(f=Math.min((o-h)/d,1)),this._camera.position=a.scaleAndAdd([],this._camera.position,r,f),this._updateStateFromCamera()}_updateStateFromCamera(){const r=this._camera.position,o=this._camera.forward(),{pitch:h,bearing:d}=this._camera.getPitchBearing(),f=a.mercatorZfromAltitude(this._centerAltitude,this.center.lat)*this._pixelsPerMercatorPixel,g=this._mercatorZfromZoom(this._maxZoom)*Math.cos(a.degToRad(this._maxPitch)),y=Math.max((r[2]-f)/Math.cos(h),g),v=this._zoomFromMercatorZ(y);a.scaleAndAdd(r,r,o,y),this._pitch=a.clamp(h,a.degToRad(this.minPitch),a.degToRad(this.maxPitch)),this.angle=a.wrap(d,-Math.PI,Math.PI),this._setZoom(a.clamp(v,this._minZoom,this._maxZoom)),this._updateSeaLevelZoom(),this._center=this.coordinateLocation(new a.MercatorCoordinate(r[0],r[1],r[2])),this._unmodified=!1,this._constrain(),this._calcMatrices()}_worldSizeFromZoom(r){return Math.pow(2,r)*this.tileSize}_mercatorZfromZoom(r){return this.cameraToCenterDistance/this._worldSizeFromZoom(r)}_minimumHeightOverTerrain(){const r=Math.min((this._seaLevelZoom!=null?this._seaLevelZoom:this._zoom)+4,this._maxZoom);return this._mercatorZfromZoom(r)}_zoomFromMercatorZ(r){return this.scaleZoom(this.cameraToCenterDistance/(r*this.tileSize))}zoomFromMercatorZAdjusted(r){let o=0,h=a.GLOBE_ZOOM_THRESHOLD_MAX,d=0,f=1/0;for(;h-o>1e-6&&h>o;){const g=o+.5*(h-o),y=this.tileSize*Math.pow(2,g),v=this.getCameraToCenterDistance(this.projection,g,y),E=this.scaleZoom(v/(r*this.tileSize)),T=Math.abs(g-E);TE||k.y>1)return!0}return!1}isHorizonVisible(){return this.pitch+a.radToDeg(this.fovAboveCenter)>88||this.anyCornerOffEdge(new a.Point(0,0),new a.Point(this.width,this.height))}zoomDeltaToMovement(r,o){const h=a.length(a.sub([],this._camera.position,r)),d=this._zoomFromMercatorZ(h)+o;return h-this._mercatorZfromZoom(d)}getCameraPoint(){if(this.projection.name==="globe"){const r=function([o,h,d],f){const g=[o,h,d,1];a.transformMat4$1(g,g,f);const y=g[3]=Math.max(g[3],1e-6);return g[0]/=y,g[1]/=y,g[2]/=y,g}([this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]],this.pixelMatrix);return new a.Point(r[0],r[1])}{const r=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new a.Point(0,r))}}getCameraToCenterDistance(r,o=this.zoom,h=this.worldSize){const d=Gs(r,o,this.width,this.height,1024),f=r.pixelSpaceConversion(this.center.lat,h,d);return .5/Math.tan(.5*this._fov)*this.height*f}getWorldToCameraMatrix(){const r=this._camera.getWorldToCamera(this.worldSize,this.projection.zAxisUnit==="meters"?this.pixelsPerMeter:1);return this.projection.name==="globe"&&a.multiply(r,r,this.globeMatrix),r}}function oo(l,r){let o=!1,h=null;const d=()=>{h=null,o&&(l(),h=setTimeout(d,r),o=!1)};return()=>(o=!0,h||d(),h)}class rl{constructor(r){this._hashName=r&&encodeURIComponent(r),a.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=oo(this._updateHashUnthrottled.bind(this),300)}addTo(r){return this._map=r,a.window.addEventListener("hashchange",this._onHashChange,!1),r.on("moveend",this._updateHash),this}remove(){return this._map?(this._map.off("moveend",this._updateHash),a.window.removeEventListener("hashchange",this._onHashChange,!1),clearTimeout(this._updateHash()),this._map=void 0,this):this}getHashString(){const r=this._map;if(!r)return"";const o=Ho(r);if(this._hashName){const h=this._hashName;let d=!1;const f=a.window.location.hash.slice(1).split("&").map(g=>{const y=g.split("=")[0];return y===h?(d=!0,`${y}=${o}`):g}).filter(g=>g);return d||f.push(`${h}=${o}`),`#${f.join("&")}`}return`#${o}`}_getCurrentHash(){const r=a.window.location.hash.replace("#","");if(this._hashName){let o;return r.split("&").map(h=>h.split("=")).forEach(h=>{h[0]===this._hashName&&(o=h)}),(o&&o[1]||"").split("/")}return r.split("/")}_onHashChange(){const r=this._map;if(!r)return!1;const o=this._getCurrentHash();if(o.length>=3&&!o.some(h=>isNaN(h))){const h=r.dragRotate.isEnabled()&&r.touchZoomRotate.isEnabled()?+(o[3]||0):r.getBearing();return r.jumpTo({center:[+o[2],+o[1]],zoom:+o[0],bearing:h,pitch:+(o[4]||0)}),!0}return!1}_updateHashUnthrottled(){const r=a.window.location.href.replace(/(#.+)?$/,this.getHashString());a.window.history.replaceState(a.window.history.state,null,r)}}function Ho(l,r){const o=l.getCenter(),h=Math.round(100*l.getZoom())/100,d=Math.ceil((h*Math.LN2+Math.log(512/360/.5))/Math.LN10),f=Math.pow(10,d),g=Math.round(o.lng*f)/f,y=Math.round(o.lat*f)/f,v=l.getBearing(),E=l.getPitch();let T=r?`/${g}/${y}/${h}`:`${h}/${y}/${g}`;return(v||E)&&(T+="/"+Math.round(10*v)/10),E&&(T+=`/${Math.round(E)}`),T}const Ko={linearity:.3,easing:a.bezier(0,0,.3,1)},Zs=a.extend({deceleration:2500,maxSpeed:1400},Ko),qs=a.extend({deceleration:20,maxSpeed:1400},Ko),Fe=a.extend({deceleration:1e3,maxSpeed:360},Ko),tr=a.extend({deceleration:1e3,maxSpeed:90},Ko);class Ac{constructor(r){this._map=r,this.clear()}clear(){this._inertiaBuffer=[]}record(r){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:a.exported.now(),settings:r})}_drainInertiaBuffer(){const r=this._inertiaBuffer,o=a.exported.now();for(;r.length>0&&o-r[0].time>160;)r.shift()}_onMoveEnd(r){if(this._map._prefersReducedMotion()||(this._drainInertiaBuffer(),this._inertiaBuffer.length<2))return;const o={zoom:0,bearing:0,pitch:0,pan:new a.Point(0,0),pinchAround:void 0,around:void 0};for(const{settings:f}of this._inertiaBuffer)o.zoom+=f.zoomDelta||0,o.bearing+=f.bearingDelta||0,o.pitch+=f.pitchDelta||0,f.panDelta&&o.pan._add(f.panDelta),f.around&&(o.around=f.around),f.pinchAround&&(o.pinchAround=f.pinchAround);const h=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,d={};if(o.pan.mag()){const f=Jo(o.pan.mag(),h,a.extend({},Zs,r||{}));d.offset=o.pan.mult(f.amount/o.pan.mag()),d.center=this._map.transform.center,Yo(d,f)}if(o.zoom){const f=Jo(o.zoom,h,qs);d.zoom=this._map.transform.zoom+f.amount,Yo(d,f)}if(o.bearing){const f=Jo(o.bearing,h,Fe);d.bearing=this._map.transform.bearing+a.clamp(f.amount,-179,179),Yo(d,f)}if(o.pitch){const f=Jo(o.pitch,h,tr);d.pitch=this._map.transform.pitch+f.amount,Yo(d,f)}if(d.zoom||d.bearing){const f=o.pinchAround===void 0?o.around:o.pinchAround;d.around=f?this._map.unproject(f):this._map.getCenter()}return this.clear(),d.noMoveStart=!0,d}}function Yo(l,r){(!l.duration||l.durationo.unproject(v)),y=f.reduce((v,E,T,A)=>v.add(E.div(A.length)),new a.Point(0,0));super(r,{points:f,point:y,lngLats:g,lngLat:o.unproject(y),originalEvent:h}),this._defaultPrevented=!1}}class Ws extends a.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(r,o,h){super(r,{originalEvent:h}),this._defaultPrevented=!1}}class nl{constructor(r,o){this._map=r,this._clickTolerance=o.clickTolerance}reset(){this._mousedownPos=void 0}wheel(r){return this._firePreventable(new Ws(r.type,this._map,r))}mousedown(r,o){return this._mousedownPos=o,this._firePreventable(new hi(r.type,this._map,r))}mouseup(r){this._map.fire(new hi(r.type,this._map,r))}preclick(r){const o=a.extend({},r);o.type="preclick",this._map.fire(new hi(o.type,this._map,o))}click(r,o){this._mousedownPos&&this._mousedownPos.dist(o)>=this._clickTolerance||(this.preclick(r),this._map.fire(new hi(r.type,this._map,r)))}dblclick(r){return this._firePreventable(new hi(r.type,this._map,r))}mouseover(r){this._map.fire(new hi(r.type,this._map,r))}mouseout(r){this._map.fire(new hi(r.type,this._map,r))}touchstart(r){return this._firePreventable(new Qo(r.type,this._map,r))}touchmove(r){this._map.fire(new Qo(r.type,this._map,r))}touchend(r){this._map.fire(new Qo(r.type,this._map,r))}touchcancel(r){this._map.fire(new Qo(r.type,this._map,r))}_firePreventable(r){if(this._map.fire(r),r.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Xs{constructor(r){this._map=r}reset(){this._delayContextMenu=!1,this._contextMenuEvent=void 0}mousemove(r){this._map.fire(new hi(r.type,this._map,r))}mousedown(){this._delayContextMenu=!0}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new hi("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(r){this._delayContextMenu?this._contextMenuEvent=r:this._map.fire(new hi(r.type,this._map,r)),this._map.listens("contextmenu")&&r.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Ic{constructor(r,o){this._map=r,this._el=r.getCanvasContainer(),this._container=r.getContainer(),this._clickTolerance=o.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(r,o){this.isEnabled()&&r.shiftKey&&r.button===0&&(To(),this._startPos=this._lastPos=o,this._active=!0)}mousemoveWindow(r,o){if(!this._active)return;const h=o,d=this._startPos,f=this._lastPos;if(!d||!f||f.equals(h)||!this._box&&h.dist(d){this._box&&(this._box.style.transform=`translate(${g}px,${v}px)`,this._box.style.width=y-g+"px",this._box.style.height=E-v+"px")})}mouseupWindow(r,o){if(!this._active)return;const h=this._startPos,d=o;if(h&&r.button===0){if(this.reset(),Bn(),h.x!==d.x||h.y!==d.y)return this._map.fire(new a.Event("boxzoomend",{originalEvent:r})),{cameraAnimation:f=>f.fitScreenCoordinates(h,d,this._map.getBearing(),{linear:!1})};this._fireEvent("boxzoomcancel",r)}}keydown(r){this._active&&r.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",r))}blur(){this.reset()}reset(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.remove(),this._box=null),Rn(),delete this._startPos,delete this._lastPos}_fireEvent(r,o){return this._map.fire(new a.Event(r,{originalEvent:o}))}}function Hs(l,r){const o={};for(let h=0;hthis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===0&&(this.startTime=r.timeStamp),h.length===this.numTouches&&(this.centroid=function(d){const f=new a.Point(0,0);for(const g of d)f._add(g);return f.div(d.length)}(o),this.touches=Hs(h,o)))}touchmove(r,o,h){if(this.aborted||!this.centroid)return;const d=Hs(h,o);for(const f in this.touches){const g=d[f];(!g||g.dist(this.touches[f])>30)&&(this.aborted=!0)}}touchend(r,o,h){if((!this.centroid||r.timeStamp-this.startTime>500)&&(this.aborted=!0),h.length===0){const d=!this.aborted&&this.centroid;if(this.reset(),d)return d}}}class ol{constructor(r){this.singleTap=new so(r),this.numTaps=r.numTaps,this.reset()}reset(){this.lastTime=1/0,this.lastTap=void 0,this.count=0,this.singleTap.reset()}touchstart(r,o,h){this.singleTap.touchstart(r,o,h)}touchmove(r,o,h){this.singleTap.touchmove(r,o,h)}touchend(r,o,h){const d=this.singleTap.touchend(r,o,h);if(d){const f=r.timeStamp-this.lastTime<500,g=!this.lastTap||this.lastTap.dist(d)<30;if(f&&g||this.reset(),this.count++,this.lastTime=r.timeStamp,this.lastTap=d,this.count===this.numTaps)return this.reset(),d}}}class Nh{constructor(){this._zoomIn=new ol({numTouches:1,numTaps:2}),this._zoomOut=new ol({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(r,o,h){this._zoomIn.touchstart(r,o,h),this._zoomOut.touchstart(r,o,h)}touchmove(r,o,h){this._zoomIn.touchmove(r,o,h),this._zoomOut.touchmove(r,o,h)}touchend(r,o,h){const d=this._zoomIn.touchend(r,o,h),f=this._zoomOut.touchend(r,o,h);return d?(this._active=!0,r.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:g=>g.easeTo({duration:300,zoom:g.getZoom()+1,around:g.unproject(d)},{originalEvent:r})}):f?(this._active=!0,r.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:g=>g.easeTo({duration:300,zoom:g.getZoom()-1,around:g.unproject(f)},{originalEvent:r})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}const Cc={0:1,2:2};class ao{constructor(r){this.reset(),this._clickTolerance=r.clickTolerance||1}blur(){this.reset()}reset(){this._active=!1,this._moved=!1,this._lastPoint=void 0,this._eventButton=void 0}_correctButton(r,o){return!1}_move(r,o){return{}}mousedown(r,o){if(this._lastPoint)return;const h=un(r);this._correctButton(r,h)&&(this._lastPoint=o,this._eventButton=h)}mousemoveWindow(r,o){const h=this._lastPoint;if(h){if(r.preventDefault(),this._eventButton!=null&&function(d,f){const g=Cc[f];return d.buttons===void 0||(d.buttons&g)!==g}(r,this._eventButton))this.reset();else if(this._moved||!(o.dist(h)0&&(this._active=!0);const d=Hs(h,o),f=new a.Point(0,0),g=new a.Point(0,0);let y=0;for(const E in d){const T=d[E],A=this._touches[E];A&&(f._add(T),g._add(T.sub(A)),y++,d[E]=T)}if(this._touches=d,y{this._alertContainer.classList.remove("mapboxgl-touch-pan-blocker-show"),this._alertContainer.setAttribute("role","null")},500)}}class es{constructor(){this.reset()}reset(){this._active=!1,this._firstTwoTouches=void 0}_start(r){}_move(r,o,h){return{}}touchstart(r,o,h){this._firstTwoTouches||h.length<2||(this._firstTwoTouches=[h[0].identifier,h[1].identifier],this._start([o[0],o[1]]))}touchmove(r,o,h){const d=this._firstTwoTouches;if(!d)return;r.preventDefault();const[f,g]=d,y=ts(h,o,f),v=ts(h,o,g);if(!y||!v)return;const E=this._aroundCenter?null:y.add(v).div(2);return this._move([y,v],E,r)}touchend(r,o,h){if(!this._firstTwoTouches)return;const[d,f]=this._firstTwoTouches,g=ts(h,o,d),y=ts(h,o,f);g&&y||(this._active&&Bn(),this.reset())}touchcancel(){this.reset()}enable(r){this._enabled=!0,this._aroundCenter=!!r&&r.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function ts(l,r,o){for(let h=0;hMath.abs(l.x)}class kc extends es{constructor(r){super(),this._map=r}reset(){super.reset(),this._valid=void 0,this._firstMove=void 0,this._lastPoints=void 0}_start(r){this._lastPoints=r,Yr(r[0].sub(r[1]))&&(this._valid=!1)}_move(r,o,h){const d=this._lastPoints;if(!d)return;const f=r[0].sub(d[0]),g=r[1].sub(d[1]);return this._map._cooperativeGestures&&!a.isFullscreen()&&h.touches.length<3||(this._valid=this.gestureBeginsVertically(f,g,h.timeStamp),!this._valid)?void 0:(this._lastPoints=r,this._active=!0,{pitchDelta:(f.y+g.y)/2*-.5})}gestureBeginsVertically(r,o,h){if(this._valid!==void 0)return this._valid;const d=r.mag()>=2,f=o.mag()>=2;if(!d&&!f)return;if(!d||!f)return this._firstMove==null&&(this._firstMove=h),h-this._firstMove<100&&void 0;const g=r.y>0==o.y>0;return Yr(r)&&Yr(o)&&g}}const Dc={panStep:100,bearingStep:15,pitchStep:10};class jh{constructor(){const r=Dc;this._panStep=r.panStep,this._bearingStep=r.bearingStep,this._pitchStep=r.pitchStep,this._rotationDisabled=!1}blur(){this.reset()}reset(){this._active=!1}keydown(r){if(r.altKey||r.ctrlKey||r.metaKey)return;let o=0,h=0,d=0,f=0,g=0;switch(r.keyCode){case 61:case 107:case 171:case 187:o=1;break;case 189:case 109:case 173:o=-1;break;case 37:r.shiftKey?h=-1:(r.preventDefault(),f=-1);break;case 39:r.shiftKey?h=1:(r.preventDefault(),f=1);break;case 38:r.shiftKey?d=1:(r.preventDefault(),g=-1);break;case 40:r.shiftKey?d=-1:(r.preventDefault(),g=1);break;default:return}return this._rotationDisabled&&(h=0,d=0),{cameraAnimation:y=>{const v=y.getZoom();y.easeTo({duration:300,easeId:"keyboardHandler",easing:Lc,zoom:o?Math.round(v)+o*(r.shiftKey?2:1):v,bearing:y.getBearing()+h*this._bearingStep,pitch:y.getPitch()+d*this._pitchStep,offset:[-f*this._panStep,-g*this._panStep],center:y.getCenter()},{originalEvent:r})}}}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 Lc(l){return l*(2-l)}const ul=4.000244140625;class Rc{constructor(r,o){this._map=r,this._el=r.getCanvasContainer(),this._handler=o,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,a.bindAll(["_onTimeout","_addScrollZoomBlocker","_showBlockerAlert"],this)}setZoomRate(r){this._defaultZoomRate=r}setWheelZoomRate(r){this._wheelZoomRate=r}isEnabled(){return!!this._enabled}isActive(){return this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(r){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!r&&r.around==="center",this._map._cooperativeGestures&&this._addScrollZoomBlocker())}disable(){this.isEnabled()&&(this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove()))}wheel(r){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!(r.ctrlKey||r.metaKey||this.isZooming()||a.isFullscreen()))return void this._showBlockerAlert();this._alertContainer.style.visibility!=="hidden"&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}let o=r.deltaMode===a.window.WheelEvent.DOM_DELTA_LINE?40*r.deltaY:r.deltaY;const h=a.exported.now(),d=h-(this._lastWheelEventTime||0);this._lastWheelEventTime=h,o!==0&&o%ul==0?this._type="wheel":o!==0&&Math.abs(o)<4?this._type="trackpad":d>400?(this._type=null,this._lastValue=o,this._timeout=setTimeout(this._onTimeout,40,r)):this._type||(this._type=Math.abs(d*o)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,o+=this._lastValue)),r.shiftKey&&o&&(o/=4),this._type&&(this._lastWheelEvent=r,this._delta-=o,this._active||this._start(r)),r.preventDefault()}_onTimeout(r){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(r)}_start(r){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 o=Ji(this._el,r);this._aroundPoint=this._aroundCenter?this._map.transform.centerPoint:o,this._aroundCoord=this._map.transform.pointCoordinate3D(this._aroundPoint),this._targetZoom=void 0,this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const r=this._map.transform;this._type==="wheel"&&r.projection.wrap&&(r._center.lng>=180||r._center.lng<=-180)&&(this._prevEase=null,this._easing=null,this._lastWheelEvent=null,this._lastWheelEventTime=0);const o=()=>r._terrainEnabled()&&this._aroundCoord?r.computeZoomRelativeTo(this._aroundCoord):r.zoom;if(this._delta!==0){const v=this._type==="wheel"&&Math.abs(this._delta)>ul?this._wheelZoomRate:this._defaultZoomRate;let E=2/(1+Math.exp(-Math.abs(this._delta*v)));this._delta<0&&E!==0&&(E=1/E);const T=o(),A=Math.pow(2,T),k=typeof this._targetZoom=="number"?r.zoomScale(this._targetZoom):A;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(k*E))),this._type==="wheel"&&(this._startZoom=T,this._easing=this._smoothOutEasing(200)),this._delta=0}const h=typeof this._targetZoom=="number"?this._targetZoom:o(),d=this._startZoom,f=this._easing;let g,y=!1;if(this._type==="wheel"&&d&&f){const v=Math.min((a.exported.now()-this._lastWheelEventTime)/200,1),E=f(v);g=a.number(d,h,E),v<1?this._frameId||(this._frameId=!0):y=!0}else g=h,y=!0;return this._active=!0,y&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!y,zoomDelta:g-o(),around:this._aroundPoint,aroundCoord:this._aroundCoord,originalEvent:this._lastWheelEvent}}_smoothOutEasing(r){let o=a.ease;if(this._prevEase){const h=this._prevEase,d=(a.exported.now()-h.start)/h.duration,f=h.easing(d+.01)-h.easing(d),g=.27/Math.sqrt(f*f+1e-4)*.01,y=Math.sqrt(.0729-g*g);o=a.bezier(g,y,.25,1)}return this._prevEase={start:a.exported.now(),duration:r,easing:o},o}blur(){this.reset()}reset(){this._active=!1}_addScrollZoomBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=ht("div","mapboxgl-scroll-zoom-blocker",this._map._container),this._alertContainer.textContent=/(Mac|iPad)/i.test(a.window.navigator.userAgent)?this._map._getUIString("ScrollZoomBlocker.CmdMessage"):this._map._getUIString("ScrollZoomBlocker.CtrlMessage"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=setTimeout(()=>{this._alertContainer.classList.remove("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","null")},200)}}class Bc{constructor(r,o){this._clickZoom=r,this._tapZoom=o}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 xi{constructor(){this.reset()}reset(){this._active=!1}blur(){this.reset()}dblclick(r,o){return r.preventDefault(),{cameraAnimation:h=>{h.easeTo({duration:300,zoom:h.getZoom()+(r.shiftKey?-1:1),around:h.unproject(o)},{originalEvent:r})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Gh{constructor(){this._tap=new ol({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,this._swipePoint=void 0,this._swipeTouch=0,this._tapTime=0,this._tap.reset()}touchstart(r,o,h){this._swipePoint||(this._tapTime&&r.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?h.length>0&&(this._swipePoint=o[0],this._swipeTouch=h[0].identifier):this._tap.touchstart(r,o,h))}touchmove(r,o,h){if(this._tapTime){if(this._swipePoint){if(h[0].identifier!==this._swipeTouch)return;const d=o[0],f=d.y-this._swipePoint.y;return this._swipePoint=d,r.preventDefault(),this._active=!0,{zoomDelta:f/128}}}else this._tap.touchmove(r,o,h)}touchend(r,o,h){this._tapTime?this._swipePoint&&h.length===0&&this.reset():this._tap.touchend(r,o,h)&&(this._tapTime=r.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Oc{constructor(r,o,h){this._el=r,this._mousePan=o,this._touchPan=h}enable(r){this._inertiaOptions=r||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class $h{constructor(r,o,h){this._pitchWithRotate=r.pitchWithRotate,this._mouseRotate=o,this._mousePitch=h}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 Zh{constructor(r,o,h,d){this._el=r,this._touchZoom=o,this._touchRotate=h,this._tapDragZoom=d,this._rotationDisabled=!1,this._enabled=!0}enable(r){this._touchZoom.enable(r),this._rotationDisabled||this._touchRotate.enable(r),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-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()}}const $i=l=>l.zoom||l.drag||l.pitch||l.rotate;class Fc extends a.Event{}class qh{constructor(){this.constants=[1,1,.01],this.radius=0}setup(r,o){const h=a.sub([],o,r);this.radius=a.length(h[2]<0?a.div([],h,this.constants):[h[0],h[1],0])}projectRay(r){a.div(r,r,this.constants),a.normalize(r,r),a.mul$1(r,r,this.constants);const o=a.scale$2([],r,this.radius);if(o[2]>0){const h=a.scale$2([],[0,0,1],a.dot(o,[0,0,1])),d=a.scale$2([],a.normalize([],[o[0],o[1],0]),this.radius),f=a.add([],o,a.scale$2([],a.sub([],a.add([],d,h),o),2));o[0]=f[0],o[1]=f[1]}return o}}function ir(l){return l.panDelta&&l.panDelta.mag()||l.zoomDelta||l.bearingDelta||l.pitchDelta}class ur{constructor(r,o){this._map=r,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Ac(r),this._bearingSnap=o.bearingSnap,this._previousActiveHandlers={},this._trackingEllipsoid=new qh,this._dragOrigin=null,this._eventsInProgress={},this._addDefaultHandlers(o),a.bindAll(["handleEvent","handleWindowEvent"],this);const h=this._el;this._listeners=[[h,"touchstart",{passive:!0}],[h,"touchmove",{passive:!1}],[h,"touchend",void 0],[h,"touchcancel",void 0],[h,"mousedown",void 0],[h,"mousemove",void 0],[h,"mouseup",void 0],[a.window.document,"mousemove",{capture:!0}],[a.window.document,"mouseup",void 0],[h,"mouseover",void 0],[h,"mouseout",void 0],[h,"dblclick",void 0],[h,"click",void 0],[h,"keydown",{capture:!1}],[h,"keyup",void 0],[h,"wheel",{passive:!1}],[h,"contextmenu",void 0],[a.window,"blur",void 0]];for(const[d,f,g]of this._listeners)d.addEventListener(f,d===a.window.document?this.handleWindowEvent:this.handleEvent,g)}destroy(){for(const[r,o,h]of this._listeners)r.removeEventListener(o,r===a.window.document?this.handleWindowEvent:this.handleEvent,h)}_addDefaultHandlers(r){const o=this._map,h=o.getCanvasContainer();this._add("mapEvent",new nl(o,r));const d=o.boxZoom=new Ic(o,r);this._add("boxZoom",d);const f=new Nh,g=new xi;o.doubleClickZoom=new Bc(g,f),this._add("tapZoom",f),this._add("clickZoom",g);const y=new Gh;this._add("tapDragZoom",y);const v=o.touchPitch=new kc(o);this._add("touchPitch",v);const E=new al(r),T=new ll(r);o.dragRotate=new $h(r,E,T),this._add("mouseRotate",E,["mousePitch"]),this._add("mousePitch",T,["mouseRotate"]);const A=new sl(r),k=new Ks(o,r);o.dragPan=new Oc(h,A,k),this._add("mousePan",A),this._add("touchPan",k,["touchZoom","touchRotate"]);const R=new Pc,O=new zc;o.touchZoomRotate=new Zh(h,O,R,y),this._add("touchRotate",R,["touchPan","touchZoom"]),this._add("touchZoom",O,["touchPan","touchRotate"]),this._add("blockableMapEvent",new Xs(o));const B=o.scrollZoom=new Rc(o,this);this._add("scrollZoom",B,["mousePan"]);const F=o.keyboard=new jh;this._add("keyboard",F);for(const I of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])r.interactive&&r[I]&&o[I].enable(r[I])}_add(r,o,h){this._handlers.push({handlerName:r,handler:o,allowed:h}),this._handlersById[r]=o}stop(r){if(!this._updatingCamera){for(const{handler:o}of this._handlers)o.reset();this._inertia.clear(),this._fireEvents({},{},r),this._changes=[]}}isActive(){for(const{handler:r}of this._handlers)if(r.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!$i(this._eventsInProgress)||this.isZooming()}_isDragging(){return!!this._eventsInProgress.drag}_blockedByActive(r,o,h){for(const d in r)if(d!==h&&(!o||o.indexOf(d)<0))return!0;return!1}handleWindowEvent(r){this.handleEvent(r,`${r.type}Window`)}_getMapTouches(r){const o=[];for(const h of r)this._el.contains(h.target)&&o.push(h);return o}handleEvent(r,o){this._updatingCamera=!0;const h=r.type==="renderFrame",d=h?void 0:r,f={needsRenderFrame:!1},g={},y={},v=r.touches?this._getMapTouches(r.touches):void 0,E=v?hn(this._el,v):h?void 0:Ji(this._el,r);for(const{handlerName:k,handler:R,allowed:O}of this._handlers){if(!R.isEnabled())continue;let B;this._blockedByActive(y,O,k)?R.reset():R[o||r.type]&&(B=R[o||r.type](r,E,v),this.mergeHandlerResult(f,g,B,k,d),B&&B.needsRenderFrame&&this._triggerRenderFrame()),(B||R.isActive())&&(y[k]=R)}const T={};for(const k in this._previousActiveHandlers)y[k]||(T[k]=d);this._previousActiveHandlers=y,(Object.keys(T).length||ir(f))&&(this._changes.push([f,g,T]),this._triggerRenderFrame()),(Object.keys(y).length||ir(f))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:A}=f;A&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],A(this._map))}mergeHandlerResult(r,o,h,d,f){if(!h)return;a.extend(r,h);const g={handlerName:d,originalEvent:h.originalEvent||f};h.zoomDelta!==void 0&&(o.zoom=g),h.panDelta!==void 0&&(o.drag=g),h.pitchDelta!==void 0&&(o.pitch=g),h.bearingDelta!==void 0&&(o.rotate=g)}_applyChanges(){const r={},o={},h={};for(const[d,f,g]of this._changes)d.panDelta&&(r.panDelta=(r.panDelta||new a.Point(0,0))._add(d.panDelta)),d.zoomDelta&&(r.zoomDelta=(r.zoomDelta||0)+d.zoomDelta),d.bearingDelta&&(r.bearingDelta=(r.bearingDelta||0)+d.bearingDelta),d.pitchDelta&&(r.pitchDelta=(r.pitchDelta||0)+d.pitchDelta),d.around!==void 0&&(r.around=d.around),d.aroundCoord!==void 0&&(r.aroundCoord=d.aroundCoord),d.pinchAround!==void 0&&(r.pinchAround=d.pinchAround),d.noInertia&&(r.noInertia=d.noInertia),a.extend(o,f),a.extend(h,g);this._updateMapTransform(r,o,h),this._changes=[]}_updateMapTransform(r,o,h){const d=this._map,f=d.transform,g=L=>[L.x,L.y,L.z];if((L=>{const N=this._eventsInProgress.drag;return N&&!this._handlersById[N.handlerName].isActive()})()&&!ir(r)){const L=f.zoom;f.cameraElevationReference="sea",f.recenterOnTerrain(),f.cameraElevationReference="ground",L!==f.zoom&&this._map._update(!0)}if(f._isCameraConstrained&&d._stop(!0),!ir(r))return void this._fireEvents(o,h,!0);let{panDelta:y,zoomDelta:v,bearingDelta:E,pitchDelta:T,around:A,aroundCoord:k,pinchAround:R}=r;f._isCameraConstrained&&(v>0&&(v=0),f._isCameraConstrained=!1),R!==void 0&&(A=R),(v||(L=>o[L]&&!this._eventsInProgress[L])("drag"))&&A&&(this._dragOrigin=g(f.pointCoordinate3D(A)),this._trackingEllipsoid.setup(f._camera.position,this._dragOrigin)),f.cameraElevationReference="sea",d._stop(!0),A=A||d.transform.centerPoint,E&&(f.bearing+=E),T&&(f.pitch+=T),f._updateCameraState();const O=[0,0,0];if(y)if(f.projection.name==="mercator"){const L=this._trackingEllipsoid.projectRay(f.screenPointToMercatorRay(A).dir),N=this._trackingEllipsoid.projectRay(f.screenPointToMercatorRay(A.sub(y)).dir);O[0]=N[0]-L[0],O[1]=N[1]-L[1]}else{const L=f.pointCoordinate(A);if(f.projection.name==="globe"){y=y.rotate(-f.angle);const N=f._pixelsPerMercatorPixel/f.worldSize;O[0]=-y.x*a.mercatorScale(a.latFromMercatorY(L.y))*N,O[1]=-y.y*a.mercatorScale(f.center.lat)*N}else{const N=f.pointCoordinate(A.sub(y));L&&N&&(O[0]=N.x-L.x,O[1]=N.y-L.y)}}const B=f.zoom,F=[0,0,0];if(v){const L=g(k||f.pointCoordinate3D(A)),N={dir:a.normalize([],a.sub([],L,f._camera.position))};if(N.dir[2]<0){const j=f.zoomDeltaToMovement(L,v);a.scale$2(F,N.dir,j)}}const I=a.add(O,O,F);f._translateCameraConstrained(I),v&&Math.abs(f.zoom-B)>1e-4&&f.recenterOnTerrain(),f.cameraElevationReference="ground",this._map._update(),r.noInertia||this._inertia.record(r),this._fireEvents(o,h,!0)}_fireEvents(r,o,h){const d=$i(this._eventsInProgress),f=$i(r),g={};for(const T in r){const{originalEvent:A}=r[T];this._eventsInProgress[T]||(g[`${T}start`]=A),this._eventsInProgress[T]=r[T]}!d&&f&&this._fireEvent("movestart",f.originalEvent);for(const T in g)this._fireEvent(T,g[T]);f&&this._fireEvent("move",f.originalEvent);for(const T in r){const{originalEvent:A}=r[T];this._fireEvent(T,A)}const y={};let v;for(const T in this._eventsInProgress){const{handlerName:A,originalEvent:k}=this._eventsInProgress[T];this._handlersById[A].isActive()||(delete this._eventsInProgress[T],v=o[A]||k,y[`${T}end`]=v)}for(const T in y)this._fireEvent(T,y[T]);const E=$i(this._eventsInProgress);if(h&&(d||f)&&!E){this._updatingCamera=!0;const T=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),A=k=>k!==0&&-this._bearingSnap{this._frameId=void 0,this.handleEvent(new Fc("renderFrame",{timeStamp:r})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}const En="map.setFreeCameraOptions(...) and map.getFreeCameraOptions() are not yet supported for non-mercator projections.";class Ys extends a.Evented{constructor(r,o){super(),this._moving=!1,this._zooming=!1,this.transform=r,this._bearingSnap=o.bearingSnap,this._respectPrefersReducedMotion=o.respectPrefersReducedMotion!==!1,a.bindAll(["_renderFrameCallback"],this)}getCenter(){return new a.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(r,o){return this.jumpTo({center:r},o)}panBy(r,o,h){return r=a.Point.convert(r).mult(-1),this.panTo(this.transform.center,a.extend({offset:r},o),h)}panTo(r,o,h){return this.easeTo(a.extend({center:r},o),h)}getZoom(){return this.transform.zoom}setZoom(r,o){return this.jumpTo({zoom:r},o),this}zoomTo(r,o,h){return this.easeTo(a.extend({zoom:r},o),h)}zoomIn(r,o){return this.zoomTo(this.getZoom()+1,r,o),this}zoomOut(r,o){return this.zoomTo(this.getZoom()-1,r,o),this}getBearing(){return this.transform.bearing}setBearing(r,o){return this.jumpTo({bearing:r},o),this}getPadding(){return this.transform.padding}setPadding(r,o){return this.jumpTo({padding:r},o),this}rotateTo(r,o,h){return this.easeTo(a.extend({bearing:r},o),h)}resetNorth(r,o){return this.rotateTo(0,a.extend({duration:1e3},r),o),this}resetNorthPitch(r,o){return this.easeTo(a.extend({bearing:0,pitch:0,duration:1e3},r),o),this}snapToNorth(r,o){return Math.abs(this.getBearing())r.aspect?h/(2*Math.tan(.5*r.fovX)*r.aspect):d/(2*Math.tan(.5*r.fovY)*r.aspect)}_cameraForBoundsOnGlobe(r,o,h,d,f,g){const y=r.clone(),v=this._extendCameraOptions(g);y.bearing=d,y.pitch=f;const E=a.LngLat.convert(o),T=a.LngLat.convert(h),A=.5*(E.lat+T.lat),k=.5*(E.lng+T.lng),R=a.latLngToECEF(A,k),O=a.normalize([],R),B=a.normalize([],a.cross([],O,[0,1,0])),F=a.cross([],B,O),I=[B[0],B[1],B[2],0,F[0],F[1],F[2],0,O[0],O[1],O[2],0,0,0,0,1],L=[R,a.latLngToECEF(E.lat,E.lng),a.latLngToECEF(T.lat,E.lng),a.latLngToECEF(T.lat,T.lng),a.latLngToECEF(E.lat,T.lng),a.latLngToECEF(A,E.lng),a.latLngToECEF(A,T.lng),a.latLngToECEF(E.lat,k),a.latLngToECEF(T.lat,k)];let N=a.Aabb.fromPoints(L.map(ve=>[a.dot(B,ve),a.dot(F,ve),a.dot(O,ve)]));const j=a.transformMat4([],N.center,I);a.squaredLength(j)===0&&a.set(j,0,0,1),a.normalize(j,j),a.scale$2(j,j,a.GLOBE_RADIUS),y.center=a.ecefToLatLng(j);const K=y.getWorldToCameraMatrix(),J=a.invert(new Float64Array(16),K);N=a.Aabb.applyTransform(N,a.multiply([],K,I)),a.transformMat4(j,j,K);const Y=.5*(N.max[2]-N.min[2]),ie=this._minimumAABBFrustumDistance(y,N),te=a.scale$2([],[0,0,1],Y),le=a.add(te,j,te),Te=ie+(y.pitch===0?0:a.distance(j,le)),oe=y.globeCenterInViewSpace,ge=a.sub([],j,[oe[0],oe[1],oe[2]]);a.normalize(ge,ge),a.scale$2(ge,ge,Te);const he=a.add([],j,ge);a.transformMat4(he,he,J);const we=a.earthRadius/a.GLOBE_RADIUS,ae=a.length(he),_e=a.mercatorZfromAltitude(Math.max(ae*we-a.earthRadius,Number.EPSILON),0),Me=Math.min(y.zoomFromMercatorZAdjusted(_e),v.maxZoom);return Me>.5*(a.GLOBE_ZOOM_THRESHOLD_MIN+a.GLOBE_ZOOM_THRESHOLD_MAX)?(y.setProjection({name:"mercator"}),y.zoom=Me,this._cameraForBounds(y,o,h,d,f,g)):{center:y.center,zoom:Me,bearing:d,pitch:f}}queryTerrainElevation(r,o){const h=this.transform.elevation;return h?(o=a.extend({},{exaggerated:!0},o),h.getAtPoint(a.MercatorCoordinate.fromLngLat(r),null,o.exaggerated)):null}_cameraForBounds(r,o,h,d,f,g){if(r.projection.name==="globe")return this._cameraForBoundsOnGlobe(r,o,h,d,f,g);const y=r.clone(),v=this._extendCameraOptions(g),E=y.padding;y.bearing=d,y.pitch=f;const T=a.LngLat.convert(o),A=a.LngLat.convert(h),k=new a.LngLat(T.lng,A.lat),R=new a.LngLat(A.lng,T.lat),O=y.project(T),B=y.project(A),F=this.queryTerrainElevation(T),I=this.queryTerrainElevation(A),L=this.queryTerrainElevation(k),N=this.queryTerrainElevation(R),j=[[O.x,O.y,Math.min(F||0,I||0,L||0,N||0)],[B.x,B.y,Math.max(F||0,I||0,L||0,N||0)]];let K=a.Aabb.fromPoints(j);const J=y.getWorldToCameraMatrix(),Y=a.invert(new Float64Array(16),J);K=a.Aabb.applyTransform(K,J);const ie=a.sub([],K.max,K.min),te=E.left||0,le=E.right||0,Te=E.bottom||0,oe=E.top||0,{left:ge,right:he,top:we,bottom:ae}=v.padding,_e=.5*(te+le),Me=.5*(oe+Te),ve=Math.min(y.scaleZoom(y.scale*Math.min((y.width-(te+le+ge+he))/ie[0],(y.height-(Te+oe+ae+we))/ie[1])),v.maxZoom),Ae=y.scale/y.zoomScale(ve);K=new a.Aabb([K.min[0]-(ge+_e)*Ae,K.min[1]-(ae+Me)*Ae,K.min[2]],[K.max[0]+(he+_e)*Ae,K.max[1]+(we+Me)*Ae,K.max[2]]);const Ge=.5*ie[2],Xe=this._minimumAABBFrustumDistance(y,K),Ve=[0,0,1,0];a.transformMat4$1(Ve,Ve,J),a.normalize$2(Ve,Ve);const qe=a.scale$2([],Ve,Xe+Ge),lt=a.add([],K.center,qe),ot=(typeof v.offset.x=="number"&&typeof v.offset.y=="number"?new a.Point(v.offset.x,v.offset.y):a.Point.convert(v.offset)).rotate(-a.degToRad(d));K.center[0]-=ot.x*Ae,K.center[1]+=ot.y*Ae,a.transformMat4(K.center,K.center,Y),a.transformMat4(lt,lt,Y);const je=[K.center[0],K.center[1],lt[2]*y.pixelsPerMeter];a.scale$2(je,je,1/y.worldSize);const wt=a.lngFromMercatorX(je[0]),Tt=a.latFromMercatorY(je[1]),Et=Math.min(y._zoomFromMercatorZ(je[2]),v.maxZoom),St=new a.LngLat(wt,Tt);return y.mercatorFromTransition&&Et<.5*(a.GLOBE_ZOOM_THRESHOLD_MIN+a.GLOBE_ZOOM_THRESHOLD_MAX)?(y.setProjection({name:"globe"}),y.zoom=Et,this._cameraForBounds(y,o,h,d,f,g)):{center:St,zoom:Et,bearing:d,pitch:f}}fitBounds(r,o,h){const d=this.cameraForBounds(r,o);return this._fitInternal(d,o,h)}fitScreenCoordinates(r,o,h,d,f){const g=a.Point.convert(r),y=a.Point.convert(o),v=new a.Point(Math.min(g.x,y.x),Math.min(g.y,y.y)),E=new a.Point(Math.max(g.x,y.x),Math.max(g.y,y.y));if(this.transform.projection.name==="mercator"&&this.transform.anyCornerOffEdge(g,y))return this;const T=this.transform.pointLocation3D(v),A=this.transform.pointLocation3D(E),k=this.transform.pointLocation3D(new a.Point(v.x,E.y)),R=this.transform.pointLocation3D(new a.Point(E.x,v.y)),O=[Math.min(T.lng,A.lng,k.lng,R.lng),Math.min(T.lat,A.lat,k.lat,R.lat)],B=[Math.max(T.lng,A.lng,k.lng,R.lng),Math.max(T.lat,A.lat,k.lat,R.lat)],F=d&&d.pitch?d.pitch:this.getPitch(),I=this._cameraForBounds(this.transform,O,B,h,F,d);return this._fitInternal(I,d,f)}_fitInternal(r,o,h){return r?(delete(o=a.extend(r,o)).padding,o.linear?this.easeTo(o,h):this.flyTo(o,h)):this}jumpTo(r,o){this.stop();const h=r.preloadOnly?this.transform.clone():this.transform;let d=!1,f=!1,g=!1;return"zoom"in r&&h.zoom!==+r.zoom&&(d=!0,h.zoom=+r.zoom),r.center!==void 0&&(h.center=a.LngLat.convert(r.center)),"bearing"in r&&h.bearing!==+r.bearing&&(f=!0,h.bearing=+r.bearing),"pitch"in r&&h.pitch!==+r.pitch&&(g=!0,h.pitch=+r.pitch),r.padding==null||h.isPaddingEqual(r.padding)||(h.padding=r.padding),r.preloadOnly?(this._preloadTiles(h),this):(this.fire(new a.Event("movestart",o)).fire(new a.Event("move",o)),d&&this.fire(new a.Event("zoomstart",o)).fire(new a.Event("zoom",o)).fire(new a.Event("zoomend",o)),f&&this.fire(new a.Event("rotatestart",o)).fire(new a.Event("rotate",o)).fire(new a.Event("rotateend",o)),g&&this.fire(new a.Event("pitchstart",o)).fire(new a.Event("pitch",o)).fire(new a.Event("pitchend",o)),this.fire(new a.Event("moveend",o)))}getFreeCameraOptions(){return this.transform.projection.supportsFreeCamera||a.warnOnce(En),this.transform.getFreeCameraOptions()}setFreeCameraOptions(r,o){const h=this.transform;if(!h.projection.supportsFreeCamera)return a.warnOnce(En),this;this.stop();const d=h.zoom,f=h.pitch,g=h.bearing;h.setFreeCameraOptions(r);const y=d!==h.zoom,v=f!==h.pitch,E=g!==h.bearing;return this.fire(new a.Event("movestart",o)).fire(new a.Event("move",o)),y&&this.fire(new a.Event("zoomstart",o)).fire(new a.Event("zoom",o)).fire(new a.Event("zoomend",o)),E&&this.fire(new a.Event("rotatestart",o)).fire(new a.Event("rotate",o)).fire(new a.Event("rotateend",o)),v&&this.fire(new a.Event("pitchstart",o)).fire(new a.Event("pitch",o)).fire(new a.Event("pitchend",o)),this.fire(new a.Event("moveend",o)),this}easeTo(r,o){this._stop(!1,r.easeId),((r=a.extend({offset:[0,0],duration:500,easing:a.ease},r)).animate===!1||this._prefersReducedMotion(r))&&(r.duration=0);const h=this.transform,d=this.getZoom(),f=this.getBearing(),g=this.getPitch(),y=this.getPadding(),v="zoom"in r?+r.zoom:d,E="bearing"in r?this._normalizeBearing(r.bearing,f):f,T="pitch"in r?+r.pitch:g,A="padding"in r?r.padding:h.padding,k=a.Point.convert(r.offset);let R,O,B;if(h.projection.name==="globe"){const te=a.MercatorCoordinate.fromLngLat(h.center),le=k.rotate(-h.angle);te.x+=le.x/h.worldSize,te.y+=le.y/h.worldSize;const Te=te.toLngLat(),oe=a.LngLat.convert(r.center||Te);this._normalizeCenter(oe),R=h.centerPoint.add(le),O=new a.Point(te.x,te.y).mult(h.worldSize),B=new a.Point(a.mercatorXfromLng(oe.lng),a.mercatorYfromLat(oe.lat)).mult(h.worldSize).sub(O)}else{R=h.centerPoint.add(k);const te=h.pointLocation(R),le=a.LngLat.convert(r.center||te);this._normalizeCenter(le),O=h.project(te),B=h.project(le).sub(O)}const F=h.zoomScale(v-d);let I,L;r.around&&(I=a.LngLat.convert(r.around),L=h.locationPoint(I));const N=this._zooming||v!==d,j=this._rotating||f!==E,K=this._pitching||T!==g,J=!h.isPaddingEqual(A),Y=te=>le=>{if(N&&(te.zoom=a.number(d,v,le)),j&&(te.bearing=a.number(f,E,le)),K&&(te.pitch=a.number(g,T,le)),J&&(te.interpolatePadding(y,A,le),R=te.centerPoint.add(k)),I)te.setLocationAtPoint(I,L);else{const Te=te.zoomScale(te.zoom-d),oe=v>d?Math.min(2,F):Math.max(.5,F),ge=Math.pow(oe,1-le),he=te.unproject(O.add(B.mult(le*ge)).mult(Te));te.setLocationAtPoint(te.renderWorldCopies?he.wrap():he,R)}return r.preloadOnly||this._fireMoveEvents(o),te};if(r.preloadOnly){const te=this._emulate(Y,r.duration,h);return this._preloadTiles(te),this}const ie={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=N,this._rotating=j,this._pitching=K,this._padding=J,this._easeId=r.easeId,this._prepareEase(o,r.noMoveStart,ie),this._ease(Y(h),te=>{h.recenterOnTerrain(),this._afterEase(o,te)},r),this}_prepareEase(r,o,h={}){this._moving=!0,this.transform.cameraElevationReference="sea",o||h.moving||this.fire(new a.Event("movestart",r)),this._zooming&&!h.zooming&&this.fire(new a.Event("zoomstart",r)),this._rotating&&!h.rotating&&this.fire(new a.Event("rotatestart",r)),this._pitching&&!h.pitching&&this.fire(new a.Event("pitchstart",r))}_fireMoveEvents(r){this.fire(new a.Event("move",r)),this._zooming&&this.fire(new a.Event("zoom",r)),this._rotating&&this.fire(new a.Event("rotate",r)),this._pitching&&this.fire(new a.Event("pitch",r))}_afterEase(r,o){if(this._easeId&&o&&this._easeId===o)return;this._easeId=void 0,this.transform.cameraElevationReference="ground";const h=this._zooming,d=this._rotating,f=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,h&&this.fire(new a.Event("zoomend",r)),d&&this.fire(new a.Event("rotateend",r)),f&&this.fire(new a.Event("pitchend",r)),this.fire(new a.Event("moveend",r))}flyTo(r,o){if(this._prefersReducedMotion(r)){const ve=a.pick(r,["center","zoom","bearing","pitch","around"]);return this.jumpTo(ve,o)}this.stop(),r=a.extend({offset:[0,0],speed:1.2,curve:1.42,easing:a.ease},r);const h=this.transform,d=this.getZoom(),f=this.getBearing(),g=this.getPitch(),y=this.getPadding(),v="zoom"in r?a.clamp(+r.zoom,h.minZoom,h.maxZoom):d,E="bearing"in r?this._normalizeBearing(r.bearing,f):f,T="pitch"in r?+r.pitch:g,A="padding"in r?r.padding:h.padding,k=h.zoomScale(v-d),R=a.Point.convert(r.offset);let O=h.centerPoint.add(R);const B=h.pointLocation(O),F=a.LngLat.convert(r.center||B);this._normalizeCenter(F);const I=h.project(B),L=h.project(F).sub(I);let N=r.curve;const j=Math.max(h.width,h.height),K=j/k,J=L.mag();if("minZoom"in r){const ve=a.clamp(Math.min(r.minZoom,d,v),h.minZoom,h.maxZoom),Ae=j/h.zoomScale(ve-d);N=Math.sqrt(Ae/J*2)}const Y=N*N;function ie(ve){const Ae=(K*K-j*j+(ve?-1:1)*Y*Y*J*J)/(2*(ve?K:j)*Y*J);return Math.log(Math.sqrt(Ae*Ae+1)-Ae)}function te(ve){return(Math.exp(ve)-Math.exp(-ve))/2}function le(ve){return(Math.exp(ve)+Math.exp(-ve))/2}const Te=ie(0);let oe=function(ve){return le(Te)/le(Te+N*ve)},ge=function(ve){return j*((le(Te)*(te(Ae=Te+N*ve)/le(Ae))-te(Te))/Y)/J;var Ae},he=(ie(1)-Te)/N;if(Math.abs(J)<1e-6||!isFinite(he)){if(Math.abs(j-K)<1e-6)return this.easeTo(r,o);const ve=Kr.maxDuration&&(r.duration=0);const we=f!==E,ae=T!==g,_e=!h.isPaddingEqual(A),Me=ve=>Ae=>{const Ge=Ae*he,Xe=1/oe(Ge);ve.zoom=Ae===1?v:d+ve.scaleZoom(Xe),we&&(ve.bearing=a.number(f,E,Ae)),ae&&(ve.pitch=a.number(g,T,Ae)),_e&&(ve.interpolatePadding(y,A,Ae),O=ve.centerPoint.add(R));const Ve=Ae===1?F:ve.unproject(I.add(L.mult(ge(Ge))).mult(Xe));return ve.setLocationAtPoint(ve.renderWorldCopies?Ve.wrap():Ve,O),ve._updateCameraOnTerrain(),r.preloadOnly||this._fireMoveEvents(o),ve};if(r.preloadOnly){const ve=this._emulate(Me,r.duration,h);return this._preloadTiles(ve),this}return this._zooming=!0,this._rotating=we,this._pitching=ae,this._padding=_e,this._prepareEase(o,!1),this._ease(Me(h),()=>this._afterEase(o),r),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(r,o){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),this._easeFrameId=void 0,this._onEaseFrame=void 0),this._onEaseEnd){const h=this._onEaseEnd;this._onEaseEnd=void 0,h.call(this,o)}if(!r){const h=this.handlers;h&&h.stop(!1)}return this}_ease(r,o,h){h.animate===!1||h.duration===0?(r(1),o()):(this._easeStart=a.exported.now(),this._easeOptions=h,this._onEaseFrame=r,this._onEaseEnd=o,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const r=Math.min((a.exported.now()-this._easeStart)/this._easeOptions.duration,1),o=this._onEaseFrame;o&&o(this._easeOptions.easing(r)),r<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(r,o){r=a.wrap(r,-180,180);const h=Math.abs(r-o);return Math.abs(r-360-o)180?-360:h<-180?360:0}_prefersReducedMotion(r){return this._respectPrefersReducedMotion&&a.exported.prefersReducedMotion&&!(r&&r.essential)}_emulate(r,o,h){const d=Math.ceil(15*o/1e3),f=[],g=r(h.clone());for(let y=0;y<=d;y++){const v=g(y/d);f.push(v.clone())}return f}}class Ue{constructor(r={}){this.options=r,a.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)}getDefaultPosition(){return"bottom-right"}onAdd(r){const o=this.options&&this.options.compact;return this._map=r,this._container=ht("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=ht("button","mapboxgl-ctrl-attrib-button",this._container),ht("span","mapboxgl-ctrl-icon",this._compactButton).setAttribute("aria-hidden","true"),this._compactButton.type="button",this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=ht("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),o&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),o===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0}_setElementTitle(r,o){const h=this._map._getUIString(`AttributionControl.${o}`);r.setAttribute("aria-label",h),r.removeAttribute("title"),r.firstElementChild&&r.firstElementChild.setAttribute("title",h)}_toggleAttribution(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","true"))}_updateEditLink(){let r=this._editLink;r||(r=this._editLink=this._container.querySelector(".mapbox-improve-map"));const o=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||a.config.ACCESS_TOKEN}];if(r){const h=o.reduce((d,f,g)=>(f.value&&(d+=`${f.key}=${f.value}${gd.length-f.length),r=r.filter((d,f)=>{for(let g=f+1;g=0)return!1;return!0}),this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?r=[...this.options.customAttribution,...r]:r.unshift(this.options.customAttribution));const h=r.join(" | ");h!==this._attribHTML&&(this._attribHTML=h,r.length?(this._innerContainer.innerHTML=h,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")}}class dl{constructor(){a.bindAll(["_updateLogo","_updateCompact"],this)}onAdd(r){this._map=r,this._container=ht("div","mapboxgl-ctrl");const o=ht("a","mapboxgl-ctrl-logo");return o.target="_blank",o.rel="noopener nofollow",o.href="https://www.mapbox.com/",o.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),o.setAttribute("rel","noopener nofollow"),this._container.appendChild(o),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)}getDefaultPosition(){return"bottom-left"}_updateLogo(r){r&&r.sourceDataType!=="metadata"||(this._container.style.display=this._logoRequired()?"block":"none")}_logoRequired(){if(!this._map.style)return!0;const r=this._map.style._sourceCaches;if(Object.entries(r).length===0)return!0;for(const o in r){const h=r[o].getSource();if(h.hasOwnProperty("mapbox_logo")&&!h.mapbox_logo)return!1}return!0}_updateCompact(){const r=this._container.children;if(r.length){const o=r[0];this._map.getCanvasContainer().offsetWidth<250?o.classList.add("mapboxgl-compact"):o.classList.remove("mapboxgl-compact")}}}class pl{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(r){const o=++this._id;return this._queue.push({callback:r,id:o,cancelled:!1}),o}remove(r){const o=this._currentlyRunning,h=o?this._queue.concat(o):this._queue;for(const d of h)if(d.id===r)return void(d.cancelled=!0)}run(r=0){const o=this._currentlyRunning=this._queue;this._queue=[];for(const h of o)if(!h.cancelled&&(h.callback(r),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}function lo(l,r,o){if(l=new a.LngLat(l.lng,l.lat),r){const h=new a.LngLat(l.lng-360,l.lat),d=new a.LngLat(l.lng+360,l.lat),f=360*Math.ceil(Math.abs(l.lng-o.center.lng)/360),g=o.locationPoint(l).distSqr(r),y=r.x<0||r.y<0||r.x>o.width||r.y>o.height;o.locationPoint(h).distSqr(r)180;){const h=o.locationPoint(l);if(h.x>=0&&h.y>=0&&h.x<=o.width&&h.y<=o.height)break;l.lng>o.center.lng?l.lng-=360:l.lng+=360}return l}const Sn={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%)"};class Be extends a.Evented{constructor(r,o){if(super(),(r instanceof a.window.HTMLElement||o)&&(r=a.extend({element:r},o)),a.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress","_clearFadeTimer"],this),this._anchor=r&&r.anchor||"center",this._color=r&&r.color||"#3FB1CE",this._scale=r&&r.scale||1,this._draggable=r&&r.draggable||!1,this._clickTolerance=r&&r.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=r&&r.rotation||0,this._rotationAlignment=r&&r.rotationAlignment||"auto",this._pitchAlignment=r&&r.pitchAlignment&&r.pitchAlignment||"auto",this._updateMoving=()=>this._update(!0),this._occludedOpacity=r&&r.occludedOpacity||.2,r&&r.element)this._element=r.element,this._offset=a.Point.convert(r&&r.offset||[0,0]);else{this._defaultMarker=!0,this._element=ht("div");const d=41,f=27,g=gi("svg",{display:"block",height:d*this._scale+"px",width:f*this._scale+"px",viewBox:`0 0 ${f} ${d}`},this._element),y=gi("radialGradient",{id:"shadowGradient"},gi("defs",{},g));gi("stop",{offset:"10%","stop-opacity":.4},y),gi("stop",{offset:"100%","stop-opacity":.05},y),gi("ellipse",{cx:13.5,cy:34.8,rx:10.5,ry:5.25,fill:"url(#shadowGradient)"},g),gi("path",{fill:this._color,d:"M27,13.5C27,19.07 20.25,27 14.75,34.5C14.02,35.5 12.98,35.5 12.25,34.5C6.75,27 0,19.22 0,13.5C0,6.04 6.04,0 13.5,0C20.96,0 27,6.04 27,13.5Z"},g),gi("path",{opacity:.25,d:"M13.5,0C6.04,0 0,6.04 0,13.5C0,19.22 6.75,27 12.25,34.5C13,35.52 14.02,35.5 14.75,34.5C20.25,27 27,19.07 27,13.5C27,6.04 20.96,0 13.5,0ZM13.5,1C20.42,1 26,6.58 26,13.5C26,15.9 24.5,19.18 22.22,22.74C19.95,26.3 16.71,30.14 13.94,33.91C13.74,34.18 13.61,34.32 13.5,34.44C13.39,34.32 13.26,34.18 13.06,33.91C10.28,30.13 7.41,26.31 5.02,22.77C2.62,19.23 1,15.95 1,13.5C1,6.58 6.58,1 13.5,1Z"},g),gi("circle",{fill:"white",cx:13.5,cy:13.5,r:5.5},g),this._offset=a.Point.convert(r&&r.offset||[0,-14])}this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label","Map marker"),this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",d=>{d.preventDefault()}),this._element.addEventListener("mousedown",d=>{d.preventDefault()});const h=this._element.classList;for(const d in Sn)h.remove(`mapboxgl-marker-anchor-${d}`);h.add(`mapboxgl-marker-anchor-${this._anchor}`),this._popup=null}addTo(r){return r===this._map||(this.remove(),this._map=r,r.getCanvasContainer().appendChild(this._element),r.on("move",this._updateMoving),r.on("moveend",this._update),r.on("remove",this._clearFadeTimer),r._addMarker(this),this.setDraggable(this._draggable),this._update(),r.on("click",this._onMapClick)),this}remove(){const r=this._map;return r&&(r.off("click",this._onMapClick),r.off("move",this._updateMoving),r.off("moveend",this._update),r.off("mousedown",this._addDragHandler),r.off("touchstart",this._addDragHandler),r.off("mouseup",this._onUp),r.off("touchend",this._onUp),r.off("mousemove",this._onMove),r.off("touchmove",this._onMove),r.off("remove",this._clearFadeTimer),r._removeMarker(this),this._map=void 0),this._clearFadeTimer(),this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(r){return this._lngLat=a.LngLat.convert(r),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(!0),this}getElement(){return this._element}setPopup(r){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeAttribute("role"),this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),r){if(!("offset"in r.options)){const d=Math.sqrt(Math.pow(13.5,2)/2);r.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[d,-1*(38.1-13.5+d)],"bottom-right":[-d,-1*(38.1-13.5+d)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=r,r._marker=this,this._lngLat&&this._popup.setLngLat(this._lngLat),this._element.setAttribute("role","button"),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress),this._element.setAttribute("aria-expanded","false")}return this}_onKeyPress(r){const o=r.code,h=r.charCode||r.keyCode;o!=="Space"&&o!=="Enter"&&h!==32&&h!==13||this.togglePopup()}_onMapClick(r){const o=r.originalEvent.target,h=this._element;this._popup&&(o===h||h.contains(o))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const r=this._popup;return r?(r.isOpen()?(r.remove(),this._element.setAttribute("aria-expanded","false")):this._map&&(r.addTo(this._map),this._element.setAttribute("aria-expanded","true")),this):this}_behindTerrain(){const r=this._map,o=this._pos;if(!r||!o)return!1;const h=r.unproject(o),d=r.getFreeCameraOptions();if(!d.position)return!1;const f=d.position.toLngLat();return f.distanceTo(h)<.9*f.distanceTo(this._lngLat)}_evaluateOpacity(){const r=this._map;if(!r)return;const o=this._pos;if(!o||o.x<0||o.x>r.transform.width||o.y<0||o.y>r.transform.height)return void this._clearFadeTimer();const h=r.unproject(o);let d;r._showingGlobe()&&a.isLngLatBehindGlobe(r.transform,this._lngLat)?d=0:(d=1-r._queryFogOpacity(h),r.transform._terrainEnabled()&&r.getTerrain()&&this._behindTerrain()&&(d*=this._occludedOpacity)),this._element.style.opacity=`${d}`,this._element.style.pointerEvents=d>0?"auto":"none",this._popup&&this._popup._setOpacity(d),this._fadeTimer=null}_clearFadeTimer(){this._fadeTimer&&(clearTimeout(this._fadeTimer),this._fadeTimer=null)}_updateDOM(){const r=this._pos;if(!r||!this._map)return;const o=this._offset.mult(this._scale);this._element.style.transform=` - translate(${r.x}px,${r.y}px) - ${Sn[this._anchor]} - ${this._calculateXYTransform()} ${this._calculateZTransform()} - translate(${o.x}px,${o.y}px) - `}_calculateXYTransform(){const r=this._pos,o=this._map,h=this.getPitchAlignment();if(!o||!r||h!=="map")return"";if(!o._showingGlobe()){const v=o.getPitch();return v?`rotateX(${v}deg)`:""}const d=a.radToDeg(a.globeTiltAtLngLat(o.transform,this._lngLat)),f=r.sub(a.globeCenterToScreenPoint(o.transform)),g=Math.abs(f.x)+Math.abs(f.y);if(g===0)return"";const y=d/g;return`rotateX(${-f.y*y}deg) rotateY(${f.x*y}deg)`}_calculateZTransform(){const r=this._pos,o=this._map;if(!o||!r)return"";let h=0;const d=this.getRotationAlignment();if(d==="map")if(o._showingGlobe()){const f=o.project(new a.LngLat(this._lngLat.lng,this._lngLat.lat+.001)),g=o.project(new a.LngLat(this._lngLat.lng,this._lngLat.lat-.001)).sub(f);h=a.radToDeg(Math.atan2(g.y,g.x))-90}else h=-o.getBearing();else if(d==="horizon"){const f=a.smoothstep(4,6,o.getZoom()),g=a.globeCenterToScreenPoint(o.transform);g.y+=f*o.transform.height;const y=r.sub(g),v=a.radToDeg(Math.atan2(y.y,y.x));h=(v>90?v-270:v+90)*(1-f)}return h+=this._rotation,h?`rotateZ(${h}deg)`:""}_update(r){a.window.cancelAnimationFrame(this._updateFrameId);const o=this._map;o&&(o.transform.renderWorldCopies&&(this._lngLat=lo(this._lngLat,this._pos,o.transform)),this._pos=o.project(this._lngLat),r===!0?this._updateFrameId=a.window.requestAnimationFrame(()=>{this._element&&this._pos&&this._anchor&&(this._pos=this._pos.round(),this._updateDOM())}):this._pos=this._pos.round(),o._requestDomTask(()=>{this._map&&(this._element&&this._pos&&this._anchor&&this._updateDOM(),(o._showingGlobe()||o.getTerrain()||o.getFog())&&!this._fadeTimer&&(this._fadeTimer=setTimeout(this._evaluateOpacity.bind(this),60)))}))}getOffset(){return this._offset}setOffset(r){return this._offset=a.Point.convert(r),this._update(),this}_onMove(r){const o=this._map;if(!o)return;const h=this._pointerdownPos,d=this._positionDelta;if(h&&d){if(!this._isDragging){const f=this._clickTolerance||o._clickTolerance;if(r.point.dist(h)=this._endTime)return this._end;const o=a.easeCubicInOut((r-this._startTime)/(this._endTime-this._startTime));return this._start*(1-o)+this._end*o}isEasing(r){return r>=this._startTime&&r<=this._endTime}jumpTo(r){this._startTime=-1/0,this._endTime=-1/0,this._start=r,this._end=r}easeTo(r,o,h){this._start=this.getValue(o),this._end=r,this._startTime=o,this._endTime=o+h}}const Vc={"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":"Mapbox logo","Map.Title":"Map","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScrollZoomBlocker.CtrlMessage":"Use ctrl + scroll to zoom the map","ScrollZoomBlocker.CmdMessage":"Use ⌘ + scroll to zoom the map","TouchPanBlocker.Message":"Use two fingers to move the map"},Nc={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:85,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,performanceMetricsCollection:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,optimizeForTerrain:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,minTileCacheSize:null,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",localFontFamily:null,transformRequest:null,accessToken:null,fadeDuration:300,respectPrefersReducedMotion:!0,crossSourceCollisions:!0},Xh={showCompass:!0,showZoom:!0,visualizePitch:!1};class Hh{constructor(r,o,h=!1){this._clickTolerance=10,this.element=o,this.mouseRotate=new al({clickTolerance:r.dragRotate._mouseRotate._clickTolerance}),this.map=r,h&&(this.mousePitch=new ll({clickTolerance:r.dragRotate._mousePitch._clickTolerance})),a.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),o.addEventListener("mousedown",this.mousedown),o.addEventListener("touchstart",this.touchstart,{passive:!1}),o.addEventListener("touchmove",this.touchmove),o.addEventListener("touchend",this.touchend),o.addEventListener("touchcancel",this.reset)}down(r,o){this.mouseRotate.mousedown(r,o),this.mousePitch&&this.mousePitch.mousedown(r,o),To()}move(r,o){const h=this.map,d=this.mouseRotate.mousemoveWindow(r,o),f=d&&d.bearingDelta;if(f&&h.setBearing(h.getBearing()+f),this.mousePitch){const g=this.mousePitch.mousemoveWindow(r,o),y=g&&g.pitchDelta;y&&h.setPitch(h.getPitch()+y)}}off(){const r=this.element;r.removeEventListener("mousedown",this.mousedown),r.removeEventListener("touchstart",this.touchstart,{passive:!1}),r.removeEventListener("touchmove",this.touchmove),r.removeEventListener("touchend",this.touchend),r.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){Rn(),a.window.removeEventListener("mousemove",this.mousemove),a.window.removeEventListener("mouseup",this.mouseup)}mousedown(r){this.down(a.extend({},r,{ctrlKey:!0,preventDefault:()=>r.preventDefault()}),Ji(this.element,r)),a.window.addEventListener("mousemove",this.mousemove),a.window.addEventListener("mouseup",this.mouseup)}mousemove(r){this.move(r,Ji(this.element,r))}mouseup(r){this.mouseRotate.mouseupWindow(r),this.mousePitch&&this.mousePitch.mouseupWindow(r),this.offTemp()}touchstart(r){r.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=hn(this.element,r.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>r.preventDefault()},this._startPos))}touchmove(r){r.targetTouches.length!==1?this.reset():(this._lastPos=hn(this.element,r.targetTouches)[0],this.move({preventDefault:()=>r.preventDefault()},this._lastPos))}touchend(r){r.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)l.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(l.minPitch!=null&&l.maxPitch!=null&&l.minPitch>l.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(l.minPitch!=null&&l.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(l.maxPitch!=null&&l.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(l.antialias&&a.isSafariWithAntialiasingBug(a.window)&&(l.antialias=!1,a.warnOnce("Antialiasing is disabled for this WebGL context to avoid browser bug: https://github.com/mapbox/mapbox-gl-js/issues/11609")),super(new no(l.minZoom,l.maxZoom,l.minPitch,l.maxPitch,l.renderWorldCopies),l),this._interactive=l.interactive,this._minTileCacheSize=l.minTileCacheSize,this._maxTileCacheSize=l.maxTileCacheSize,this._failIfMajorPerformanceCaveat=l.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=l.preserveDrawingBuffer,this._antialias=l.antialias,this._useWebGL2=l.useWebGL2,this._trackResize=l.trackResize,this._bearingSnap=l.bearingSnap,this._refreshExpiredTiles=l.refreshExpiredTiles,this._fadeDuration=l.fadeDuration,this._isInitialLoad=!0,this._crossSourceCollisions=l.crossSourceCollisions,this._collectResourceTiming=l.collectResourceTiming,this._optimizeForTerrain=l.optimizeForTerrain,this._language=this._parseLanguage(l.language),this._worldview=l.worldview,this._renderTaskQueue=new pl,this._domRenderTaskQueue=new pl,this._controls=[],this._markers=[],this._popups=[],this._mapId=a.uniqueId(),this._locale=a.extend({},Vc,l.locale),this._clickTolerance=l.clickTolerance,this._cooperativeGestures=l.cooperativeGestures,this._performanceMetricsCollection=l.performanceMetricsCollection,this._containerWidth=0,this._containerHeight=0,this._averageElevationLastSampledAt=-1/0,this._averageElevationExaggeration=0,this._averageElevation=new ml(0),this._interactionRange=[1/0,-1/0],this._visibilityHidden=0,this._useExplicitProjection=!1,this._requestManager=new a.RequestManager(l.transformRequest,l.accessToken,l.testMode),this._silenceAuthErrors=!!l.testMode,typeof l.container=="string"){if(this._container=a.window.document.getElementById(l.container),!this._container)throw new Error(`Container '${l.container}' not found.`)}else{if(!(l.container instanceof a.window.HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=l.container}if(this._container.childNodes.length>0&&a.warnOnce("The map container element should be empty, otherwise the map's interactivity will be negatively impacted. If you want to display a message when WebGL is not supported, use the Mapbox GL Supported plugin instead."),l.maxBounds&&this.setMaxBounds(l.maxBounds),a.bindAll(["_onWindowOnline","_onWindowResize","_onVisibilityChange","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),a.window!==void 0&&(a.window.addEventListener("online",this._onWindowOnline,!1),a.window.addEventListener("resize",this._onWindowResize,!1),a.window.addEventListener("orientationchange",this._onWindowResize,!1),a.window.addEventListener("webkitfullscreenchange",this._onWindowResize,!1),a.window.addEventListener("visibilitychange",this._onVisibilityChange,!1)),this.handlers=new ur(this,l),this._localFontFamily=l.localFontFamily,this._localIdeographFontFamily=l.localIdeographFontFamily,l.style&&this.setStyle(l.style,{localFontFamily:this._localFontFamily,localIdeographFontFamily:this._localIdeographFontFamily}),l.projection&&this.setProjection(l.projection),this._hash=l.hash&&new rl(typeof l.hash=="string"&&l.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:l.center,zoom:l.zoom,bearing:l.bearing,pitch:l.pitch}),l.bounds&&(this.resize(),this.fitBounds(l.bounds,a.extend({},l.fitBoundsOptions,{duration:0})))),this.resize(),l.attributionControl&&this.addControl(new Ue({customAttribution:l.customAttribution})),this._logoControl=new dl,this.addControl(this._logoControl,l.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",r=>{this._update(r.dataType==="style"),this.fire(new a.Event(`${r.dataType}data`,r))}),this.on("dataloading",r=>{this.fire(new a.Event(`${r.dataType}dataloading`,r))})}_getMapId(){return this._mapId}addControl(l,r){if(r===void 0&&(r=l.getDefaultPosition?l.getDefaultPosition():"top-right"),!l||!l.onAdd)return this.fire(new a.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const o=l.onAdd(this);this._controls.push(l);const h=this._controlPositions[r];return r.indexOf("bottom")!==-1?h.insertBefore(o,h.firstChild):h.appendChild(o),this}removeControl(l){if(!l||!l.onRemove)return this.fire(new a.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const r=this._controls.indexOf(l);return r>-1&&this._controls.splice(r,1),l.onRemove(this),this}hasControl(l){return this._controls.indexOf(l)>-1}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}resize(l){if(this._updateContainerDimensions(),this._containerWidth===this.transform.width&&this._containerHeight===this.transform.height)return this;this._resizeCanvas(this._containerWidth,this._containerHeight),this.transform.resize(this._containerWidth,this._containerHeight),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight));const r=!this._moving;return r&&this.fire(new a.Event("movestart",l)).fire(new a.Event("move",l)),this.fire(new a.Event("resize",l)),r&&this.fire(new a.Event("moveend",l)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()||null}setMaxBounds(l){return this.transform.setMaxBounds(a.LngLatBounds.convert(l)),this._update()}setMinZoom(l){if((l=l??-2)>=-2&&l<=this.transform.maxZoom)return this.transform.minZoom=l,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=l,this._update(),this.getZoom()>l?this.setZoom(l):this.fire(new a.Event("zoomstart")).fire(new a.Event("zoom")).fire(new a.Event("zoomend")),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(l){if((l=l??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(l>=0&&l<=this.transform.maxPitch)return this.transform.minPitch=l,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(l>=this.transform.minPitch)return this.transform.maxPitch=l,this._update(),this.getPitch()>l?this.setPitch(l):this.fire(new a.Event("pitchstart")).fire(new a.Event("pitch")).fire(new a.Event("pitchend")),this;throw new Error("maxPitch must be greater than or equal to minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(l){return this.transform.renderWorldCopies=l,this.transform.renderWorldCopies||this._forceMarkerAndPopupUpdate(!0),this._update()}getLanguage(){return this._language}_parseLanguage(l){return l==="auto"?a.window.navigator.language:Array.isArray(l)?l.length===0?void 0:l.map(r=>r==="auto"?a.window.navigator.language:r):l}setLanguage(l){const r=this._parseLanguage(l);if(!this.style||r===this._language)return this;this._language=r,this.style._reloadSources();for(const o of this._controls)o._setLanguage&&o._setLanguage(this._language);return this}getWorldview(){return this._worldview}setWorldview(l){return this.style&&l!==this._worldview?(this._worldview=l,this.style._reloadSources(),this):this}getProjection(){return this.transform.mercatorFromTransition?{name:"globe",center:[0,0]}:this.transform.getProjection()}_showingGlobe(){return this.transform.projection.name==="globe"}setProjection(l){return this._lazyInitEmptyStyle(),l?typeof l=="string"&&(l={name:l}):l=null,this._useExplicitProjection=!!l,this._prioritizeAndUpdateProjection(l,this.style.stylesheet?this.style.stylesheet.projection:null)}_updateProjectionTransition(){if(this.getProjection().name!=="globe")return;const l=this.transform,r=l.projection.name;let o;r==="globe"&&l.zoom>=a.GLOBE_ZOOM_THRESHOLD_MAX?(l.setMercatorFromTransition(),o=!0):r==="mercator"&&l.zoom=a.GLOBE_ZOOM_THRESHOLD_MAX?this.transform.setMercatorFromTransition():this.transform.setProjection(l),this.style.applyProjectionUpdate(),r){this.painter.clearBackgroundTiles();for(const o in this.style._sourceCaches)this.style._sourceCaches[o].clearTiles();this._update(!0),this._forceMarkerAndPopupUpdate(!0)}return this}project(l){return this.transform.locationPoint3D(a.LngLat.convert(l))}unproject(l){return this.transform.pointLocation3D(a.Point.convert(l))}isMoving(){return this._moving||this.handlers&&this.handlers.isMoving()||!1}isZooming(){return this._zooming||this.handlers&&this.handlers.isZooming()||!1}isRotating(){return this._rotating||this.handlers&&this.handlers.isRotating()||!1}_isDragging(){return this.handlers&&this.handlers._isDragging()||!1}_createDelegatedListener(l,r,o){if(l==="mouseenter"||l==="mouseover"){let h=!1;const d=g=>{const y=r.filter(E=>this.getLayer(E)),v=y.length?this.queryRenderedFeatures(g.point,{layers:y}):[];v.length?h||(h=!0,o.call(this,new hi(l,this,g.originalEvent,{features:v}))):h=!1},f=()=>{h=!1};return{layers:new Set(r),listener:o,delegates:{mousemove:d,mouseout:f}}}if(l==="mouseleave"||l==="mouseout"){let h=!1;const d=g=>{const y=r.filter(v=>this.getLayer(v));(y.length?this.queryRenderedFeatures(g.point,{layers:y}):[]).length?h=!0:h&&(h=!1,o.call(this,new hi(l,this,g.originalEvent)))},f=g=>{h&&(h=!1,o.call(this,new hi(l,this,g.originalEvent)))};return{layers:new Set(r),listener:o,delegates:{mousemove:d,mouseout:f}}}{const h=d=>{const f=r.filter(y=>this.getLayer(y)),g=f.length?this.queryRenderedFeatures(d.point,{layers:f}):[];g.length&&(d.features=g,o.call(this,d),delete d.features)};return{layers:new Set(r),listener:o,delegates:{[l]:h}}}}on(l,r,o){if(o===void 0)return super.on(l,r);Array.isArray(r)||(r=[r]);const h=this._createDelegatedListener(l,r,o);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[l]=this._delegatedListeners[l]||[],this._delegatedListeners[l].push(h);for(const d in h.delegates)this.on(d,h.delegates[d]);return this}once(l,r,o){if(o===void 0)return super.once(l,r);Array.isArray(r)||(r=[r]);const h=this._createDelegatedListener(l,r,o);for(const d in h.delegates)this.once(d,h.delegates[d]);return this}off(l,r,o){if(o===void 0)return super.off(l,r);r=new Set(Array.isArray(r)?r:[r]);const h=(f,g)=>{if(f.size!==g.size)return!1;for(const y of f)if(!g.has(y))return!1;return!0},d=this._delegatedListeners?this._delegatedListeners[l]:void 0;return d&&(f=>{for(let g=0;g{d?this.fire(new a.ErrorEvent(d)):f&&this._updateDiff(f,r)})}else typeof l=="object"&&this._updateDiff(l,r)}_updateDiff(l,r){try{this.style.setState(l)&&this._update(!0)}catch(o){a.warnOnce(`Unable to perform style diff: ${o.message||o.error||o}. Rebuilding the style from scratch.`),this._updateStyle(l,r)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():(a.warnOnce("There is no style added to the map."),!1)}addSource(l,r){return this._lazyInitEmptyStyle(),this.style.addSource(l,r),this._update(!0)}isSourceLoaded(l){return!!this.style&&this.style._isSourceCacheLoaded(l)}areTilesLoaded(){const l=this.style&&this.style._sourceCaches;for(const r in l){const o=l[r]._tiles;for(const h in o){const d=o[h];if(d.state!=="loaded"&&d.state!=="errored")return!1}}return!0}addSourceType(l,r,o){this._lazyInitEmptyStyle(),this.style.addSourceType(l,r,o)}removeSource(l){return this.style.removeSource(l),this._updateTerrain(),this._update(!0)}getSource(l){return this.style.getSource(l)}addImage(l,r,{pixelRatio:o=1,sdf:h=!1,stretchX:d,stretchY:f,content:g}={}){if(this._lazyInitEmptyStyle(),r instanceof a.window.HTMLImageElement||a.window.ImageBitmap&&r instanceof a.window.ImageBitmap){const{width:y,height:v,data:E}=a.exported.getImageData(r);this.style.addImage(l,{data:new a.RGBAImage({width:y,height:v},E),pixelRatio:o,stretchX:d,stretchY:f,content:g,sdf:h,version:0})}else if(r.width===void 0||r.height===void 0)this.fire(new a.ErrorEvent(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`")));else{const{width:y,height:v}=r,E=r;this.style.addImage(l,{data:new a.RGBAImage({width:y,height:v},new Uint8Array(E.data)),pixelRatio:o,stretchX:d,stretchY:f,content:g,sdf:h,version:0,userImage:E}),E.onAdd&&E.onAdd(this,l)}}updateImage(l,r){const o=this.style.getImage(l);if(!o)return void this.fire(new a.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const h=r instanceof a.window.HTMLImageElement||a.window.ImageBitmap&&r instanceof a.window.ImageBitmap?a.exported.getImageData(r):r,{width:d,height:f}=h;d!==void 0&&f!==void 0?d===o.data.width&&f===o.data.height?(o.data.replace(h.data,!(r instanceof a.window.HTMLImageElement||a.window.ImageBitmap&&r instanceof a.window.ImageBitmap)),this.style.updateImage(l,o)):this.fire(new a.ErrorEvent(new Error(`The width and height of the updated image (${d}, ${f}) - must be that same as the previous version of the image - (${o.data.width}, ${o.data.height})`))):this.fire(new a.ErrorEvent(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`")))}hasImage(l){return l?!!this.style.getImage(l):(this.fire(new a.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(l){this.style.removeImage(l)}loadImage(l,r){a.getImage(this._requestManager.transformRequest(l,a.ResourceType.Image),(o,h)=>{r(o,h instanceof a.window.HTMLImageElement?a.exported.getImageData(h):h)})}listImages(){return this.style.listImages()}addLayer(l,r){return this._lazyInitEmptyStyle(),this.style.addLayer(l,r),this._update(!0)}moveLayer(l,r){return this.style.moveLayer(l,r),this._update(!0)}removeLayer(l){return this.style.removeLayer(l),this._update(!0)}getLayer(l){return this.style.getLayer(l)}setLayerZoomRange(l,r,o){return this.style.setLayerZoomRange(l,r,o),this._update(!0)}setFilter(l,r,o={}){return this.style.setFilter(l,r,o),this._update(!0)}getFilter(l){return this.style.getFilter(l)}setPaintProperty(l,r,o,h={}){return this.style.setPaintProperty(l,r,o,h),this._update(!0)}getPaintProperty(l,r){return this.style.getPaintProperty(l,r)}setLayoutProperty(l,r,o,h={}){return this.style.setLayoutProperty(l,r,o,h),this._update(!0)}getLayoutProperty(l,r){return this.style.getLayoutProperty(l,r)}setLight(l,r={}){return this._lazyInitEmptyStyle(),this.style.setLight(l,r),this._update(!0)}getLight(){return this.style.getLight()}setTerrain(l){return this._lazyInitEmptyStyle(),!l&&this.transform.projection.requiresDraping?this.style.setTerrainForDraping():this.style.setTerrain(l),this._averageElevationLastSampledAt=-1/0,this._update(!0)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(l){return this._lazyInitEmptyStyle(),this.style.setFog(l),this._update(!0)}getFog(){return this.style?this.style.getFog():null}_queryFogOpacity(l){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(a.LngLat.convert(l),this.transform):0}setFeatureState(l,r){return this.style.setFeatureState(l,r),this._update()}removeFeatureState(l,r){return this.style.removeFeatureState(l,r),this._update()}getFeatureState(l){return this.style.getFeatureState(l)}_updateContainerDimensions(){if(!this._container)return;const l=this._container.getBoundingClientRect().width||400,r=this._container.getBoundingClientRect().height||300;let o,h,d,f=this._container;for(;f&&(!h||!d);){const g=a.window.getComputedStyle(f).transform;g&&g!=="none"&&(o=g.match(/matrix.*\((.+)\)/)[1].split(", "),o[0]&&o[0]!=="0"&&o[0]!=="1"&&(h=o[0]),o[3]&&o[3]!=="0"&&o[3]!=="1"&&(d=o[3])),f=f.parentElement}this._containerWidth=h?Math.abs(l/h):l,this._containerHeight=d?Math.abs(r/d):r}_detectMissingCSS(){a.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")!=="rgb(250, 128, 114)"&&a.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")}_setupContainer(){const l=this._container;l.classList.add("mapboxgl-map"),(this._missingCSSCanary=ht("div","mapboxgl-canary",l)).style.visibility="hidden",this._detectMissingCSS();const r=this._canvasContainer=ht("div","mapboxgl-canvas-container",l);this._interactive&&r.classList.add("mapboxgl-interactive"),this._canvas=ht("canvas","mapboxgl-canvas",r),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region"),this._updateContainerDimensions(),this._resizeCanvas(this._containerWidth,this._containerHeight);const o=this._controlContainer=ht("div","mapboxgl-control-container",l),h=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(d=>{h[d]=ht("div",`mapboxgl-ctrl-${d}`,o)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(l,r){const o=a.exported.devicePixelRatio||1;this._canvas.width=o*Math.ceil(l),this._canvas.height=o*Math.ceil(r),this._canvas.style.width=`${l}px`,this._canvas.style.height=`${r}px`}_addMarker(l){this._markers.push(l)}_removeMarker(l){const r=this._markers.indexOf(l);r!==-1&&this._markers.splice(r,1)}_addPopup(l){this._popups.push(l)}_removePopup(l){const r=this._popups.indexOf(l);r!==-1&&this._popups.splice(r,1)}_setupPainter(){const l=a.extend({},xr.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),r=this._useWebGL2&&this._canvas.getContext("webgl2",l),o=r||this._canvas.getContext("webgl",l)||this._canvas.getContext("experimental-webgl",l);o?(this._useWebGL2&&!r&&a.warnOnce("Failed to create WebGL 2 context. Using WebGL 1."),a.storeAuthState(o,!0),this.painter=new io(o,this.transform,!!r),this.on("data",h=>{h.dataType==="source"&&this.painter.setTileLoadedFlag(!0)}),a.exported$1.testSupport(o)):this.fire(new a.ErrorEvent(new Error("Failed to initialize WebGL")))}_contextLost(l){l.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new a.Event("webglcontextlost",{originalEvent:l}))}_contextRestored(l){this._setupPainter(),this.resize(),this._update(),this.fire(new a.Event("webglcontextrestored",{originalEvent:l}))}_onMapScroll(l){if(l.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(l){return this.style?(this._styleDirty=this._styleDirty||l,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(l){return this._update(),this._renderTaskQueue.add(l)}_cancelRenderFrame(l){this._renderTaskQueue.remove(l)}_requestDomTask(l){!this.loaded()||this.loaded()&&!this.isMoving()?l():this._domRenderTaskQueue.add(l)}_render(l){let r;const o=this.painter.context.extTimerQuery,h=a.exported.now();if(this.listens("gpu-timing-frame")&&(r=o.createQueryEXT(),o.beginQueryEXT(o.TIME_ELAPSED_EXT,r)),this.painter.context.setDirty(),this.painter.setBaseState(),(this.isMoving()||this.isRotating()||this.isZooming())&&(this._interactionRange[0]=Math.min(this._interactionRange[0],a.window.performance.now()),this._interactionRange[1]=Math.max(this._interactionRange[1],a.window.performance.now())),this._renderTaskQueue.run(l),this._domRenderTaskQueue.run(l),this._removed)return;this._updateProjectionTransition();const d=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;const y=this.transform.zoom,v=this.transform.pitch,E=a.exported.now(),T=new a.EvaluationParameters(y,{now:E,fadeDuration:d,pitch:v,transition:this.style.getTransition()});this.style.update(T)}this.style&&this.style.fog&&this.style.fog.hasTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0);let f=!1;if(this.style&&this._sourcesDirty?(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),f=this._updateAverageElevation(h),this.style._updateSources(this.transform),this._forceMarkerAndPopupUpdate()):f=this._updateAverageElevation(h),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,d,this._crossSourceCollisions),this.style&&this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showTerrainWireframe:this.showTerrainWireframe,showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,showTileAABBs:this.showTileAABBs,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:d,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),gpuTimingDeferredRender:!!this.listens("gpu-timing-deferred-render"),speedIndexTiming:this.speedIndexTiming}),this.fire(new a.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new a.Event("load"))),this.style&&this.style.hasTransitions()&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),r){const y=a.exported.now()-h;o.endQueryEXT(o.TIME_ELAPSED_EXT,r),setTimeout(()=>{const v=o.getQueryObjectEXT(r,o.QUERY_RESULT_EXT)/1e6;o.deleteQueryEXT(r),this.fire(new a.Event("gpu-timing-frame",{cpuTime:y,gpuTime:v})),a.window.performance.mark("frame-gpu",{startTime:h,detail:{gpuTime:v}})},50)}if(this.listens("gpu-timing-layer")){const y=this.painter.collectGpuTimers();setTimeout(()=>{const v=this.painter.queryGpuTimers(y);this.fire(new a.Event("gpu-timing-layer",{layerTimes:v}))},50)}if(this.listens("gpu-timing-deferred-render")){const y=this.painter.collectDeferredRenderGpuQueries();setTimeout(()=>{const v=this.painter.queryGpuTimeDeferredRender(y);this.fire(new a.Event("gpu-timing-deferred-render",{gpuTime:v}))},50)}const g=this._sourcesDirty||this._styleDirty||this._placementDirty||f;if(g||this._repaint)this.triggerRepaint();else{const y=!this.isMoving()&&this.loaded();if(y&&(f=this._updateAverageElevation(h,!0)),f)this.triggerRepaint();else if(this._triggerFrame(!1),y&&(this.fire(new a.Event("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){const v=this._calculateSpeedIndex();this.fire(new a.Event("speedindexcompleted",{speedIndex:v})),this.speedIndexTiming=!1}}!this._loaded||this._fullyLoaded||g||(this._fullyLoaded=!0,a.LivePerformanceUtils.mark(a.PerformanceMarkers.fullLoad),this._performanceMetricsCollection&&a.postPerformanceEvent(this._requestManager._customAccessToken,{width:this.painter.width,height:this.painter.height,interactionRange:this._interactionRange,visibilityHidden:this._visibilityHidden,terrainEnabled:!!this.painter.style.getTerrain(),fogEnabled:!!this.painter.style.getFog(),projection:this.getProjection().name,zoom:this.transform.zoom,renderer:this.painter.context.renderer,vendor:this.painter.context.vendor}),this._authenticate())}_forceMarkerAndPopupUpdate(l){for(const r of this._markers)l&&!this.getRenderWorldCopies()&&(r._lngLat=r._lngLat.wrap()),r._update();for(const r of this._popups)!l||this.getRenderWorldCopies()||r._trackPointer||(r._lngLat=r._lngLat.wrap()),r._update()}_updateAverageElevation(l,r=!1){const o=h=>(this.transform.averageElevation=h,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return this.transform.averageElevation!==0&&o(0);if((r||l-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(l)){const h=this.transform.averageElevation;let d=this.transform.sampleAverageElevation(),f=!1;this.transform.elevation&&(f=this.transform.elevation.exaggeration()!==this._averageElevationExaggeration,this._averageElevationExaggeration=this.transform.elevation.exaggeration()),isNaN(d)?d=0:this._averageElevationLastSampledAt=l;const g=Math.abs(h-d);if(g>1){if(this._isInitialLoad||f)return this._averageElevation.jumpTo(d),o(d);this._averageElevation.easeTo(d,l,300)}else if(g>1e-4)return this._averageElevation.jumpTo(d),o(d)}return!!this._averageElevation.isEasing(l)&&o(this._averageElevation.getValue(l))}_authenticate(){a.getMapSessionAPI(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,l=>{if(l&&(l.message===a.AUTH_ERR_MSG||l.status===401)){const r=this.painter.context.gl;a.storeAuthState(r,!1),this._logoControl instanceof dl&&this._logoControl._updateLogo(),r&&r.clear(r.DEPTH_BUFFER_BIT|r.COLOR_BUFFER_BIT|r.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new a.ErrorEvent(new Error("A valid Mapbox access token is required to use Mapbox GL JS. To create an account or a new access token, visit https://account.mapbox.com/")))}}),a.postMapLoadEvent(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,()=>{})}_updateTerrain(){const l=this._isDragging();this.painter.updateTerrain(this.style,l)}_calculateSpeedIndex(){const l=this.painter.canvasCopy(),r=this.painter.getCanvasCopiesAndTimestamps();r.timeStamps.push(performance.now());const o=this.painter.context.gl,h=o.createFramebuffer();function d(f){o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,f,0);const g=new Uint8Array(o.drawingBufferWidth*o.drawingBufferHeight*4);return o.readPixels(0,0,o.drawingBufferWidth,o.drawingBufferHeight,o.RGBA,o.UNSIGNED_BYTE,g),g}return o.bindFramebuffer(o.FRAMEBUFFER,h),this._canvasPixelComparison(d(l),r.canvasCopies.map(d),r.timeStamps)}_canvasPixelComparison(l,r,o){let h=o[1]-o[0];const d=l.length/4;for(let f=0;f{const o=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,o&&this._render(r)}))}_preloadTiles(l){const r=this.style?Object.values(this.style._sourceCaches):[];return a.asyncAll(r,(o,h)=>o._preloadTiles(l,h),()=>{this.triggerRepaint()}),this}_onWindowOnline(){this._update()}_onWindowResize(l){this._trackResize&&this.resize({originalEvent:l})._update()}_onVisibilityChange(){a.window.document.visibilityState==="hidden"&&this._visibilityHidden++}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(l){this._showTileBoundaries!==l&&(this._showTileBoundaries=l,this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(l){this._showTerrainWireframe!==l&&(this._showTerrainWireframe=l,this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(l){this._speedIndexTiming!==l&&(this._speedIndexTiming=l,this._update())}get showPadding(){return!!this._showPadding}set showPadding(l){this._showPadding!==l&&(this._showPadding=l,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(l){this._showCollisionBoxes!==l&&(this._showCollisionBoxes=l,l?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(l){this._showOverdrawInspector!==l&&(this._showOverdrawInspector=l,this._update())}get repaint(){return!!this._repaint}set repaint(l){this._repaint!==l&&(this._repaint=l,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(l){this._vertices=l,this._update()}get showTileAABBs(){return!!this._showTileAABBs}set showTileAABBs(l){this._showTileAABBs!==l&&(this._showTileAABBs=l,l&&this._update())}_setCacheLimits(l,r){a.setCacheLimits(l,r)}get version(){return a.version}},NavigationControl:class{constructor(l){this.options=a.extend({},Xh,l),this._container=ht("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",r=>r.preventDefault()),this.options.showZoom&&(a.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",r=>{this._map&&this._map.zoomIn({},{originalEvent:r})}),ht("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",r=>{this._map&&this._map.zoomOut({},{originalEvent:r})}),ht("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(a.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",r=>{const o=this._map;o&&(this.options.visualizePitch?o.resetNorthPitch({},{originalEvent:r}):o.resetNorth({},{originalEvent:r}))}),this._compassIcon=ht("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const l=this._map;if(!l)return;const r=l.getZoom(),o=r===l.getMaxZoom(),h=r===l.getMinZoom();this._zoomInButton.disabled=o,this._zoomOutButton.disabled=h,this._zoomInButton.setAttribute("aria-disabled",o.toString()),this._zoomOutButton.setAttribute("aria-disabled",h.toString())}_rotateCompassArrow(){const l=this._map;if(!l)return;const r=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(l.transform.pitch*(Math.PI/180)),.5)}) rotateX(${l.transform.pitch}deg) rotateZ(${l.transform.angle*(180/Math.PI)}deg)`:`rotate(${l.transform.angle*(180/Math.PI)}deg)`;l._requestDomTask(()=>{this._compassIcon&&(this._compassIcon.style.transform=r)})}onAdd(l){return this._map=l,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),l.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&l.on("pitch",this._rotateCompassArrow),l.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Hh(l,this._compass,this.options.visualizePitch)),this._container}onRemove(){const l=this._map;l&&(this._container.remove(),this.options.showZoom&&l.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&l.off("pitch",this._rotateCompassArrow),l.off("rotate",this._rotateCompassArrow),this._handler&&this._handler.off(),this._handler=void 0),this._map=void 0)}_createButton(l,r){const o=ht("button",l,this._container);return o.type="button",o.addEventListener("click",r),o}_setButtonTitle(l,r){if(!this._map)return;const o=this._map._getUIString(`NavigationControl.${r}`);l.setAttribute("aria-label",o),l.firstElementChild&&l.firstElementChild.setAttribute("title",o)}},GeolocateControl:class extends a.Evented{constructor(l){super(),this.options=a.extend({geolocation:a.window.navigator.geolocation},_l,l),a.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation","_onDeviceOrientation"],this),this._updateMarkerRotationThrottled=oo(this._updateMarkerRotation,20),this._numberOfWatches=0}onAdd(l){return this._map=l,this._container=ht("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkGeolocationSupport(this._setupUI),this._container}onRemove(){this._geolocationWatchID!==void 0&&(this.options.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("zoom",this._onZoom),this._map=void 0,this._numberOfWatches=0,this._noTimeout=!1}_checkGeolocationSupport(l){const r=(o=!!this.options.geolocation)=>{this._supportsGeolocation=o,l(o)};this._supportsGeolocation!==void 0?l(this._supportsGeolocation):a.window.navigator.permissions!==void 0?a.window.navigator.permissions.query({name:"geolocation"}).then(o=>r(o.state!=="denied")).catch(()=>r()):r()}_isOutOfMapMaxBounds(l){const r=this._map.getMaxBounds(),o=l.coords;return!!r&&(o.longituder.getEast()||o.latituder.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}}_onSuccess(l){if(this._map){if(this._isOutOfMapMaxBounds(l))return this._setErrorState(),this.fire(new a.Event("outofmaxbounds",l)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=l,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(l),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(l),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new a.Event("geolocate",l)),this._finish()}}_updateCamera(l){const r=new a.LngLat(l.coords.longitude,l.coords.latitude),o=l.coords.accuracy,h=this._map.getBearing(),d=a.extend({bearing:h},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(o),d,{geolocateSource:!0})}_updateMarker(l){if(l){const r=new a.LngLat(l.coords.longitude,l.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=l.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const l=this._map.transform,r=a.mercatorZfromAltitude(1,l._center.lat)*l.worldSize,o=Math.ceil(2*this._accuracy*r);this._circleElement.style.width=`${o}px`,this._circleElement.style.height=`${o}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_updateMarkerRotation(){this._userLocationDotMarker&&typeof this._heading=="number"?(this._userLocationDotMarker.setRotation(this._heading),this._dotElement.classList.add("mapboxgl-user-location-show-heading")):(this._dotElement.classList.remove("mapboxgl-user-location-show-heading"),this._userLocationDotMarker.setRotation(0))}_onError(l){if(this._map){if(this.options.trackUserLocation)if(l.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.setAttribute("aria-label",r),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",r),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(l.code===3&&this._noTimeout)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new a.Event("error",l)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(l){if(this._map!==void 0){if(this._container.addEventListener("contextmenu",r=>r.preventDefault()),this._geolocateButton=ht("button","mapboxgl-ctrl-geolocate",this._container),ht("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",l===!1){a.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");const r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.setAttribute("aria-label",r),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",r)}else{const r=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.setAttribute("aria-label",r),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",r)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=ht("div","mapboxgl-user-location"),this._dotElement.appendChild(ht("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(ht("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new Be({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=ht("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Be({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",r=>{r.geolocateSource||this._watchState!=="ACTIVE_LOCK"||r.originalEvent&&r.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this.fire(new a.Event("trackuserlocationend")))})}}_onDeviceOrientation(l){this._userLocationDotMarker&&(l.webkitCompassHeading?this._heading=l.webkitCompassHeading:l.absolute===!0&&(this._heading=-1*l.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return a.warnOnce("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 a.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._numberOfWatches--,this._noTimeout=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new a.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new a.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let l;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._numberOfWatches++,this._numberOfWatches>1?(l={maximumAge:6e5,timeout:0},this._noTimeout=!0):(l=this.options.positionOptions,this._noTimeout=!1),this._geolocationWatchID=this.options.geolocation.watchPosition(this._onSuccess,this._onError,l),this.options.showUserHeading&&this._addDeviceOrientationListener()}}else this.options.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_addDeviceOrientationListener(){const l=()=>{a.window.addEventListener("ondeviceorientationabsolute"in a.window?"deviceorientationabsolute":"deviceorientation",this._onDeviceOrientation)};a.window.DeviceMotionEvent!==void 0&&typeof a.window.DeviceMotionEvent.requestPermission=="function"?DeviceOrientationEvent.requestPermission().then(r=>{r==="granted"&&l()}).catch(console.error):l()}_clearWatch(){this.options.geolocation.clearWatch(this._geolocationWatchID),a.window.removeEventListener("deviceorientation",this._onDeviceOrientation),a.window.removeEventListener("deviceorientationabsolute",this._onDeviceOrientation),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:Ue,ScaleControl:class{constructor(l){this.options=a.extend({},gl,l),this._isNumberFormatSupported=function(){try{return new Intl.NumberFormat("en",{style:"unit",unitDisplay:"short",unit:"meter"}),!0}catch{return!1}}(),a.bindAll(["_update","_setScale","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_update(){const l=this.options.maxWidth||100,r=this._map,o=r._containerHeight/2,h=r._containerWidth/2-l/2,d=r.unproject([h,o]),f=r.unproject([h+l,o]),g=d.distanceTo(f);if(this.options.unit==="imperial"){const y=3.2808*g;y>5280?this._setScale(l,y/5280,"mile"):this._setScale(l,y,"foot")}else this.options.unit==="nautical"?this._setScale(l,g/1852,"nautical-mile"):g>=1e3?this._setScale(l,g/1e3,"kilometer"):this._setScale(l,g,"meter")}_setScale(l,r,o){this._map._requestDomTask(()=>{const h=function(f){const g=Math.pow(10,`${Math.floor(f)}`.length-1);let y=f/g;return y=y>=10?10:y>=5?5:y>=3?3:y>=2?2:y>=1?1:function(v){const E=Math.pow(10,Math.ceil(-Math.log(v)/Math.LN10));return Math.round(v*E)/E}(y),g*y}(r),d=h/r;this._container.innerHTML=this._isNumberFormatSupported&&o!=="nautical-mile"?new Intl.NumberFormat(this._language,{style:"unit",unitDisplay:"short",unit:o}).format(h):`${h} ${yl[o]}`,this._container.style.width=l*d+"px"})}onAdd(l){return this._map=l,this._language=l.getLanguage(),this._container=ht("div","mapboxgl-ctrl mapboxgl-ctrl-scale",l.getContainer()),this._container.dir="auto",this._map.on("move",this._update),this._update(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._update),this._map=void 0}_setLanguage(l){this._language=l,this._update()}setUnit(l){this.options.unit=l,this._update()}},FullscreenControl:class{constructor(l){this._fullscreen=!1,l&&l.container&&(l.container instanceof a.window.HTMLElement?this._container=l.container:a.warnOnce("Full screen control 'container' must be a DOM element.")),a.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in a.window.document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in a.window.document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(l){return this._map=l,this._container||(this._container=this._map.getContainer()),this._controlContainer=ht("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",a.warnOnce("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,a.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!a.window.document.fullscreenEnabled&&!a.window.document.webkitFullscreenEnabled)}_setupUI(){const l=this._fullscreenButton=ht("button","mapboxgl-ctrl-fullscreen",this._controlContainer);ht("span","mapboxgl-ctrl-icon",l).setAttribute("aria-hidden","true"),l.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),a.window.document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const l=this._getTitle();this._fullscreenButton.setAttribute("aria-label",l),this._fullscreenButton.firstElementChild&&this._fullscreenButton.firstElementChild.setAttribute("title",l)}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(a.window.document.fullscreenElement||a.window.document.webkitFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?a.window.document.exitFullscreen?a.window.document.exitFullscreen():a.window.document.webkitCancelFullScreen&&a.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},Popup:class extends a.Evented{constructor(l){super(),this.options=a.extend(Object.create(fl),l),a.bindAll(["_update","_onClose","remove","_onMouseEvent"],this),this._classList=new Set(l&&l.className?l.className.trim().split(/\s+/):[])}addTo(l){return this._map&&this.remove(),this._map=l,this.options.closeOnClick&&l.on("preclick",this._onClose),this.options.closeOnMove&&l.on("move",this._onClose),l.on("remove",this.remove),this._update(),l._addPopup(this),this._focusFirstElement(),this._trackPointer?(l.on("mousemove",this._onMouseEvent),l.on("mouseup",this._onMouseEvent),l._canvasContainer.classList.add("mapboxgl-track-pointer")):l.on("move",this._update),this.fire(new a.Event("open")),this}isOpen(){return!!this._map}remove(){this._content&&this._content.remove(),this._container&&(this._container.remove(),this._container=void 0);const l=this._map;return l&&(l.off("move",this._update),l.off("move",this._onClose),l.off("preclick",this._onClose),l.off("click",this._onClose),l.off("remove",this.remove),l.off("mousemove",this._onMouseEvent),l.off("mouseup",this._onMouseEvent),l.off("drag",this._onMouseEvent),l._canvasContainer&&l._canvasContainer.classList.remove("mapboxgl-track-pointer"),l._removePopup(this),this._map=void 0),this.fire(new a.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(l){this._lngLat=a.LngLat.convert(l),this._pos=null,this._trackPointer=!1,this._update();const r=this._map;return r&&(r.on("move",this._update),r.off("mousemove",this._onMouseEvent),r._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}trackPointer(){this._trackPointer=!0,this._pos=null,this._update();const l=this._map;return l&&(l.off("move",this._update),l.on("mousemove",this._onMouseEvent),l.on("drag",this._onMouseEvent),l._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(l){return this.setDOMContent(a.window.document.createTextNode(l))}setHTML(l){const r=a.window.document.createDocumentFragment(),o=a.window.document.createElement("body");let h;for(o.innerHTML=l;h=o.firstChild,h;)r.appendChild(h);return this.setDOMContent(r)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(l){return this.options.maxWidth=l,this._update(),this}setDOMContent(l){let r=this._content;if(r)for(;r.hasChildNodes();)r.firstChild&&r.removeChild(r.firstChild);else r=this._content=ht("div","mapboxgl-popup-content",this._container||void 0);if(r.appendChild(l),this.options.closeButton){const o=this._closeButton=ht("button","mapboxgl-popup-close-button",r);o.type="button",o.setAttribute("aria-label","Close popup"),o.setAttribute("aria-hidden","true"),o.innerHTML="×",o.addEventListener("click",this._onClose)}return this._update(),this._focusFirstElement(),this}addClassName(l){return this._classList.add(l),this._updateClassList(),this}removeClassName(l){return this._classList.delete(l),this._updateClassList(),this}setOffset(l){return this.options.offset=l,this._update(),this}toggleClassName(l){let r;return this._classList.delete(l)?r=!1:(this._classList.add(l),r=!0),this._updateClassList(),r}_onMouseEvent(l){this._update(l.point)}_getAnchor(l){if(this.options.anchor)return this.options.anchor;const r=this._map,o=this._container,h=this._pos;if(!r||!o||!h)return"bottom";const d=o.offsetWidth,f=o.offsetHeight,g=h.xr.transform.width-d/2;if(h.y+lr.transform.height-f){if(g)return"bottom-left";if(y)return"bottom-right"}return g?"left":y?"right":"bottom"}_updateClassList(){const l=this._container;if(!l)return;const r=[...this._classList];r.push("mapboxgl-popup"),this._anchor&&r.push(`mapboxgl-popup-anchor-${this._anchor}`),this._trackPointer&&r.push("mapboxgl-popup-track-pointer"),l.className=r.join(" ")}_update(l){const r=this._map,o=this._content;if(!r||!this._lngLat&&!this._trackPointer||!o)return;let h=this._container;if(h||(h=this._container=ht("div","mapboxgl-popup",r.getContainer()),this._tip=ht("div","mapboxgl-popup-tip",h),h.appendChild(o)),this.options.maxWidth&&h.style.maxWidth!==this.options.maxWidth&&(h.style.maxWidth=this.options.maxWidth),r.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=lo(this._lngLat,this._pos,r.transform)),!this._trackPointer||l){const d=this._pos=this._trackPointer&&l?l:r.project(this._lngLat),f=Uc(this.options.offset),g=this._anchor=this._getAnchor(f.y),y=Uc(this.options.offset,g),v=d.add(y).round();r._requestDomTask(()=>{this._container&&g&&(this._container.style.transform=`${Sn[g]} translate(${v.x}px,${v.y}px)`)})}if(!this._marker&&r._showingGlobe()){const d=a.isLngLatBehindGlobe(r.transform,this._lngLat)?0:1;this._setOpacity(d)}this._updateClassList()}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const l=this._container.querySelector(Wh);l&&l.focus()}_onClose(){this.remove()}_setOpacity(l){this._container&&(this._container.style.opacity=`${l}`),this._content&&(this._content.style.pointerEvents=l?"auto":"none")}},Marker:Be,Style:cr,LngLat:a.LngLat,LngLatBounds:a.LngLatBounds,Point:a.Point,MercatorCoordinate:a.MercatorCoordinate,FreeCameraOptions:Ec,Evented:a.Evented,config:a.config,prewarm:function(){Zn().acquire(sr)},clearPrewarmedResources:function(){const l=Ti;l&&(l.isPreloaded()&&l.numActive()===1?(l.release(sr),Ti=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()"))},get accessToken(){return a.config.ACCESS_TOKEN},set accessToken(l){a.config.ACCESS_TOKEN=l},get baseApiUrl(){return a.config.API_URL},set baseApiUrl(l){a.config.API_URL=l},get workerCount(){return li.workerCount},set workerCount(l){li.workerCount=l},get maxParallelImageRequests(){return a.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(l){a.config.MAX_PARALLEL_IMAGE_REQUESTS=l},clearStorage(l){a.clearTileCache(l)},workerUrl:"",workerClass:null,setNow:a.exported.setNow,restoreNow:a.exported.restoreNow};return co});var Vf=cn;return Vf})})(Of);var Uf=Of.exports;const yg=gg(Uf),xg=mg({__proto__:null,default:yg},[Uf]);export{xg as m}; diff --git a/docs/cisco/downloads.html b/docs/cisco/downloads.html index 6432a03..8c4af59 100644 --- a/docs/cisco/downloads.html +++ b/docs/cisco/downloads.html @@ -53,7 +53,7 @@ } - + diff --git a/docs/cisco/eda.html b/docs/cisco/eda.html index f04e268..2102334 100644 --- a/docs/cisco/eda.html +++ b/docs/cisco/eda.html @@ -66,7 +66,7 @@ - + @@ -218,23 +218,24 @@

How many RIN community members completed the Cisco coursework?

+

Note: Some enrolled learners have completed both courses simultaneously

13

-
- +
+

Who are the RIN community members enrolled in Cisco Networking Academy course(s)?

-

Full table view may require scrolling to the right =>

+

Note: Full table view may require scrolling to the right =>

-
- +
+
@@ -249,11 +250,12 @@

Who completed t
-
- +
+
+ + + + + + + diff --git a/docs/frontend/dist/assets/index-0b9b7d26.js b/docs/frontend/dist/assets/index-0b9b7d26.js new file mode 100644 index 0000000..7145046 --- /dev/null +++ b/docs/frontend/dist/assets/index-0b9b7d26.js @@ -0,0 +1,1396 @@ +function LP(e,n){for(var l=0;lh[m]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const m of document.querySelectorAll('link[rel="modulepreload"]'))h(m);new MutationObserver(m=>{for(const v of m)if(v.type==="childList")for(const E of v.addedNodes)E.tagName==="LINK"&&E.rel==="modulepreload"&&h(E)}).observe(document,{childList:!0,subtree:!0});function l(m){const v={};return m.integrity&&(v.integrity=m.integrity),m.referrerPolicy&&(v.referrerPolicy=m.referrerPolicy),m.crossOrigin==="use-credentials"?v.credentials="include":m.crossOrigin==="anonymous"?v.credentials="omit":v.credentials="same-origin",v}function h(m){if(m.ep)return;m.ep=!0;const v=l(m);fetch(m.href,v)}})();var Go=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function g1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function XT(e){if(e.__esModule)return e;var n=e.default;if(typeof n=="function"){var l=function h(){return this instanceof h?Reflect.construct(n,arguments,this.constructor):n.apply(this,arguments)};l.prototype=n.prototype}else l={};return Object.defineProperty(l,"__esModule",{value:!0}),Object.keys(e).forEach(function(h){var m=Object.getOwnPropertyDescriptor(e,h);Object.defineProperty(l,h,m.get?m:{enumerable:!0,get:function(){return e[h]}})}),l}var KT={exports:{}},Yt={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Yp=Symbol.for("react.element"),RP=Symbol.for("react.portal"),DP=Symbol.for("react.fragment"),OP=Symbol.for("react.strict_mode"),BP=Symbol.for("react.profiler"),FP=Symbol.for("react.provider"),NP=Symbol.for("react.context"),UP=Symbol.for("react.forward_ref"),jP=Symbol.for("react.suspense"),VP=Symbol.for("react.memo"),$P=Symbol.for("react.lazy"),v2=Symbol.iterator;function GP(e){return e===null||typeof e!="object"?null:(e=v2&&e[v2]||e["@@iterator"],typeof e=="function"?e:null)}var YT={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},JT=Object.assign,QT={};function hh(e,n,l){this.props=e,this.context=n,this.refs=QT,this.updater=l||YT}hh.prototype.isReactComponent={};hh.prototype.setState=function(e,n){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,n,"setState")};hh.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function eS(){}eS.prototype=hh.prototype;function _1(e,n,l){this.props=e,this.context=n,this.refs=QT,this.updater=l||YT}var y1=_1.prototype=new eS;y1.constructor=_1;JT(y1,hh.prototype);y1.isPureReactComponent=!0;var x2=Array.isArray,tS=Object.prototype.hasOwnProperty,v1={current:null},nS={key:!0,ref:!0,__self:!0,__source:!0};function rS(e,n,l){var h,m={},v=null,E=null;if(n!=null)for(h in n.ref!==void 0&&(E=n.ref),n.key!==void 0&&(v=""+n.key),n)tS.call(n,h)&&!nS.hasOwnProperty(h)&&(m[h]=n[h]);var s=arguments.length-2;if(s===1)m.children=l;else if(1>>1,dn=Je[Bt];if(0>>1;Btm(ii,xt))arm(br,ii)?(Je[Bt]=br,Je[ar]=xt,Bt=ar):(Je[Bt]=ii,Je[sr]=xt,Bt=sr);else if(arm(br,xt))Je[Bt]=br,Je[ar]=xt,Bt=ar;else break e}}return Tt}function m(Je,Tt){var xt=Je.sortIndex-Tt.sortIndex;return xt!==0?xt:Je.id-Tt.id}if(typeof performance=="object"&&typeof performance.now=="function"){var v=performance;e.unstable_now=function(){return v.now()}}else{var E=Date,s=E.now();e.unstable_now=function(){return E.now()-s}}var k=[],D=[],V=1,G=null,J=3,ve=!1,ae=!1,me=!1,Ce=typeof setTimeout=="function"?setTimeout:null,ie=typeof clearTimeout=="function"?clearTimeout:null,te=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function le(Je){for(var Tt=l(D);Tt!==null;){if(Tt.callback===null)h(D);else if(Tt.startTime<=Je)h(D),Tt.sortIndex=Tt.expirationTime,n(k,Tt);else break;Tt=l(D)}}function ze(Je){if(me=!1,le(Je),!ae)if(l(k)!==null)ae=!0,Li(Oe);else{var Tt=l(D);Tt!==null&&Ki(ze,Tt.startTime-Je)}}function Oe(Je,Tt){ae=!1,me&&(me=!1,ie(ht),ht=-1),ve=!0;var xt=J;try{for(le(Tt),G=l(k);G!==null&&(!(G.expirationTime>Tt)||Je&&!wr());){var Bt=G.callback;if(typeof Bt=="function"){G.callback=null,J=G.priorityLevel;var dn=Bt(G.expirationTime<=Tt);Tt=e.unstable_now(),typeof dn=="function"?G.callback=dn:G===l(k)&&h(k),le(Tt)}else h(k);G=l(k)}if(G!==null)var vn=!0;else{var sr=l(D);sr!==null&&Ki(ze,sr.startTime-Tt),vn=!1}return vn}finally{G=null,J=xt,ve=!1}}var Ke=!1,He=null,ht=-1,Ve=5,jt=-1;function wr(){return!(e.unstable_now()-jtJe||125Bt?(Je.sortIndex=xt,n(D,Je),l(k)===null&&Je===l(D)&&(me?(ie(ht),ht=-1):me=!0,Ki(ze,xt-Bt))):(Je.sortIndex=dn,n(k,Je),ae||ve||(ae=!0,Li(Oe))),Je},e.unstable_shouldYield=wr,e.unstable_wrapCallback=function(Je){var Tt=J;return function(){var xt=J;J=Tt;try{return Je.apply(this,arguments)}finally{J=xt}}}})(aS);sS.exports=aS;var XP=sS.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var KP=ut,Zi=XP;function it(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,l=1;l"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),cv=Object.prototype.hasOwnProperty,YP=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,b2={},E2={};function JP(e){return cv.call(E2,e)?!0:cv.call(b2,e)?!1:YP.test(e)?E2[e]=!0:(b2[e]=!0,!1)}function QP(e,n,l,h){if(l!==null&&l.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return h?!1:l!==null?!l.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function ez(e,n,l,h){if(n===null||typeof n>"u"||QP(e,n,l,h))return!0;if(h)return!1;if(l!==null)switch(l.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function di(e,n,l,h,m,v,E){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=h,this.attributeNamespace=m,this.mustUseProperty=l,this.propertyName=e,this.type=n,this.sanitizeURL=v,this.removeEmptyString=E}var jr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){jr[e]=new di(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];jr[n]=new di(n,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){jr[e]=new di(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){jr[e]=new di(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){jr[e]=new di(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){jr[e]=new di(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){jr[e]=new di(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){jr[e]=new di(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){jr[e]=new di(e,5,!1,e.toLowerCase(),null,!1,!1)});var w1=/[\-:]([a-z])/g;function b1(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var n=e.replace(w1,b1);jr[n]=new di(n,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(w1,b1);jr[n]=new di(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(w1,b1);jr[n]=new di(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){jr[e]=new di(e,1,!1,e.toLowerCase(),null,!1,!1)});jr.xlinkHref=new di("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){jr[e]=new di(e,1,!1,e.toLowerCase(),null,!0,!0)});function E1(e,n,l,h){var m=jr.hasOwnProperty(n)?jr[n]:null;(m!==null?m.type!==0:h||!(2s||m[E]!==v[s]){var k=` +`+m[E].replace(" at new "," at ");return e.displayName&&k.includes("")&&(k=k.replace("",e.displayName)),k}while(1<=E&&0<=s);break}}}finally{A0=!1,Error.prepareStackTrace=l}return(e=e?e.displayName||e.name:"")?up(e):""}function tz(e){switch(e.tag){case 5:return up(e.type);case 16:return up("Lazy");case 13:return up("Suspense");case 19:return up("SuspenseList");case 0:case 2:case 15:return e=C0(e.type,!1),e;case 11:return e=C0(e.type.render,!1),e;case 1:return e=C0(e.type,!0),e;default:return""}}function pv(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Lu:return"Fragment";case zu:return"Portal";case uv:return"Profiler";case T1:return"StrictMode";case hv:return"Suspense";case dv:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case uS:return(e.displayName||"Context")+".Consumer";case cS:return(e._context.displayName||"Context")+".Provider";case S1:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case A1:return n=e.displayName||null,n!==null?n:pv(e.type)||"Memo";case Ga:n=e._payload,e=e._init;try{return pv(e(n))}catch{}}return null}function nz(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return pv(n);case 8:return n===T1?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function sl(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function dS(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function rz(e){var n=dS(e)?"checked":"value",l=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),h=""+e[n];if(!e.hasOwnProperty(n)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var m=l.get,v=l.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return m.call(this)},set:function(E){h=""+E,v.call(this,E)}}),Object.defineProperty(e,n,{enumerable:l.enumerable}),{getValue:function(){return h},setValue:function(E){h=""+E},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Dm(e){e._valueTracker||(e._valueTracker=rz(e))}function pS(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var l=n.getValue(),h="";return e&&(h=dS(e)?e.checked?"true":"false":e.value),e=h,e!==l?(n.setValue(e),!0):!1}function Sg(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function fv(e,n){var l=n.checked;return Qn({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:l??e._wrapperState.initialChecked})}function S2(e,n){var l=n.defaultValue==null?"":n.defaultValue,h=n.checked!=null?n.checked:n.defaultChecked;l=sl(n.value!=null?n.value:l),e._wrapperState={initialChecked:h,initialValue:l,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function fS(e,n){n=n.checked,n!=null&&E1(e,"checked",n,!1)}function mv(e,n){fS(e,n);var l=sl(n.value),h=n.type;if(l!=null)h==="number"?(l===0&&e.value===""||e.value!=l)&&(e.value=""+l):e.value!==""+l&&(e.value=""+l);else if(h==="submit"||h==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?gv(e,n.type,l):n.hasOwnProperty("defaultValue")&&gv(e,n.type,sl(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function A2(e,n,l){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var h=n.type;if(!(h!=="submit"&&h!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+e._wrapperState.initialValue,l||n===e.value||(e.value=n),e.defaultValue=n}l=e.name,l!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,l!==""&&(e.name=l)}function gv(e,n,l){(n!=="number"||Sg(e.ownerDocument)!==e)&&(l==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+l&&(e.defaultValue=""+l))}var hp=Array.isArray;function qu(e,n,l,h){if(e=e.options,n){n={};for(var m=0;m"+n.valueOf().toString()+"",n=Om.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function Ap(e,n){if(n){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=n;return}}e.textContent=n}var fp={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},iz=["Webkit","ms","Moz","O"];Object.keys(fp).forEach(function(e){iz.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),fp[n]=fp[e]})});function yS(e,n,l){return n==null||typeof n=="boolean"||n===""?"":l||typeof n!="number"||n===0||fp.hasOwnProperty(e)&&fp[e]?(""+n).trim():n+"px"}function vS(e,n){e=e.style;for(var l in n)if(n.hasOwnProperty(l)){var h=l.indexOf("--")===0,m=yS(l,n[l],h);l==="float"&&(l="cssFloat"),h?e.setProperty(l,m):e[l]=m}}var oz=Qn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function vv(e,n){if(n){if(oz[e]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(it(137,e));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(it(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(it(61))}if(n.style!=null&&typeof n.style!="object")throw Error(it(62))}}function xv(e,n){if(e.indexOf("-")===-1)return typeof n.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var wv=null;function C1(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var bv=null,Wu=null,Zu=null;function k2(e){if(e=ef(e)){if(typeof bv!="function")throw Error(it(280));var n=e.stateNode;n&&(n=h_(n),bv(e.stateNode,e.type,n))}}function xS(e){Wu?Zu?Zu.push(e):Zu=[e]:Wu=e}function wS(){if(Wu){var e=Wu,n=Zu;if(Zu=Wu=null,k2(e),n)for(e=0;e>>=0,e===0?32:31-(gz(e)/_z|0)|0}var Bm=64,Fm=4194304;function dp(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function kg(e,n){var l=e.pendingLanes;if(l===0)return 0;var h=0,m=e.suspendedLanes,v=e.pingedLanes,E=l&268435455;if(E!==0){var s=E&~m;s!==0?h=dp(s):(v&=E,v!==0&&(h=dp(v)))}else E=l&~m,E!==0?h=dp(E):v!==0&&(h=dp(v));if(h===0)return 0;if(n!==0&&n!==h&&!(n&m)&&(m=h&-h,v=n&-n,m>=v||m===16&&(v&4194240)!==0))return n;if(h&4&&(h|=l&16),n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=h;0l;l++)n.push(e);return n}function Jp(e,n,l){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-qo(n),e[n]=l}function wz(e,n){var l=e.pendingLanes&~n;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=n,e.mutableReadLanes&=n,e.entangledLanes&=n,n=e.entanglements;var h=e.eventTimes;for(e=e.expirationTimes;0=gp),F2=String.fromCharCode(32),N2=!1;function jS(e,n){switch(e){case"keyup":return Xz.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function VS(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ru=!1;function Yz(e,n){switch(e){case"compositionend":return VS(n);case"keypress":return n.which!==32?null:(N2=!0,F2);case"textInput":return e=n.data,e===F2&&N2?null:e;default:return null}}function Jz(e,n){if(Ru)return e==="compositionend"||!D1&&jS(e,n)?(e=NS(),ag=z1=Ha=null,Ru=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1=n)return{node:l,offset:n-e};e=h}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=$2(l)}}function WS(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?WS(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function ZS(){for(var e=window,n=Sg();n instanceof e.HTMLIFrameElement;){try{var l=typeof n.contentWindow.location.href=="string"}catch{l=!1}if(l)e=n.contentWindow;else break;n=Sg(e.document)}return n}function O1(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}function aL(e){var n=ZS(),l=e.focusedElem,h=e.selectionRange;if(n!==l&&l&&l.ownerDocument&&WS(l.ownerDocument.documentElement,l)){if(h!==null&&O1(l)){if(n=h.start,e=h.end,e===void 0&&(e=n),"selectionStart"in l)l.selectionStart=n,l.selectionEnd=Math.min(e,l.value.length);else if(e=(n=l.ownerDocument||document)&&n.defaultView||window,e.getSelection){e=e.getSelection();var m=l.textContent.length,v=Math.min(h.start,m);h=h.end===void 0?v:Math.min(h.end,m),!e.extend&&v>h&&(m=h,h=v,v=m),m=G2(l,v);var E=G2(l,h);m&&E&&(e.rangeCount!==1||e.anchorNode!==m.node||e.anchorOffset!==m.offset||e.focusNode!==E.node||e.focusOffset!==E.offset)&&(n=n.createRange(),n.setStart(m.node,m.offset),e.removeAllRanges(),v>h?(e.addRange(n),e.extend(E.node,E.offset)):(n.setEnd(E.node,E.offset),e.addRange(n)))}}for(n=[],e=l;e=e.parentNode;)e.nodeType===1&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l=document.documentMode,Du=null,Iv=null,yp=null,kv=!1;function q2(e,n,l){var h=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;kv||Du==null||Du!==Sg(h)||(h=Du,"selectionStart"in h&&O1(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),yp&&zp(yp,h)||(yp=h,h=zg(Iv,"onSelect"),0Fu||(e.current=Dv[Fu],Dv[Fu]=null,Fu--)}function Pn(e,n){Fu++,Dv[Fu]=e.current,e.current=n}var al={},ni=hl(al),Ci=hl(!1),mc=al;function nh(e,n){var l=e.type.contextTypes;if(!l)return al;var h=e.stateNode;if(h&&h.__reactInternalMemoizedUnmaskedChildContext===n)return h.__reactInternalMemoizedMaskedChildContext;var m={},v;for(v in l)m[v]=n[v];return h&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=m),m}function Ii(e){return e=e.childContextTypes,e!=null}function Rg(){On(Ci),On(ni)}function J2(e,n,l){if(ni.current!==al)throw Error(it(168));Pn(ni,n),Pn(Ci,l)}function nA(e,n,l){var h=e.stateNode;if(n=n.childContextTypes,typeof h.getChildContext!="function")return l;h=h.getChildContext();for(var m in h)if(!(m in n))throw Error(it(108,nz(e)||"Unknown",m));return Qn({},l,h)}function Dg(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||al,mc=ni.current,Pn(ni,e),Pn(Ci,Ci.current),!0}function Q2(e,n,l){var h=e.stateNode;if(!h)throw Error(it(169));l?(e=nA(e,n,mc),h.__reactInternalMemoizedMergedChildContext=e,On(Ci),On(ni),Pn(ni,e)):On(Ci),Pn(Ci,l)}var Hs=null,d_=!1,j0=!1;function rA(e){Hs===null?Hs=[e]:Hs.push(e)}function vL(e){d_=!0,rA(e)}function dl(){if(!j0&&Hs!==null){j0=!0;var e=0,n=Tn;try{var l=Hs;for(Tn=1;e>=E,m-=E,Ys=1<<32-qo(n)+m|l<ht?(Ve=He,He=null):Ve=He.sibling;var jt=J(ie,He,le[ht],ze);if(jt===null){He===null&&(He=Ve);break}e&&He&&jt.alternate===null&&n(ie,He),te=v(jt,te,ht),Ke===null?Oe=jt:Ke.sibling=jt,Ke=jt,He=Ve}if(ht===le.length)return l(ie,He),jn&&sc(ie,ht),Oe;if(He===null){for(;htht?(Ve=He,He=null):Ve=He.sibling;var wr=J(ie,He,jt.value,ze);if(wr===null){He===null&&(He=Ve);break}e&&He&&wr.alternate===null&&n(ie,He),te=v(wr,te,ht),Ke===null?Oe=wr:Ke.sibling=wr,Ke=wr,He=Ve}if(jt.done)return l(ie,He),jn&&sc(ie,ht),Oe;if(He===null){for(;!jt.done;ht++,jt=le.next())jt=G(ie,jt.value,ze),jt!==null&&(te=v(jt,te,ht),Ke===null?Oe=jt:Ke.sibling=jt,Ke=jt);return jn&&sc(ie,ht),Oe}for(He=h(ie,He);!jt.done;ht++,jt=le.next())jt=ve(He,ie,ht,jt.value,ze),jt!==null&&(e&&jt.alternate!==null&&He.delete(jt.key===null?ht:jt.key),te=v(jt,te,ht),Ke===null?Oe=jt:Ke.sibling=jt,Ke=jt);return e&&He.forEach(function(St){return n(ie,St)}),jn&&sc(ie,ht),Oe}function Ce(ie,te,le,ze){if(typeof le=="object"&&le!==null&&le.type===Lu&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case Rm:e:{for(var Oe=le.key,Ke=te;Ke!==null;){if(Ke.key===Oe){if(Oe=le.type,Oe===Lu){if(Ke.tag===7){l(ie,Ke.sibling),te=m(Ke,le.props.children),te.return=ie,ie=te;break e}}else if(Ke.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===Ga&&nE(Oe)===Ke.type){l(ie,Ke.sibling),te=m(Ke,le.props),te.ref=rp(ie,Ke,le),te.return=ie,ie=te;break e}l(ie,Ke);break}else n(ie,Ke);Ke=Ke.sibling}le.type===Lu?(te=fc(le.props.children,ie.mode,ze,le.key),te.return=ie,ie=te):(ze=mg(le.type,le.key,le.props,null,ie.mode,ze),ze.ref=rp(ie,te,le),ze.return=ie,ie=ze)}return E(ie);case zu:e:{for(Ke=le.key;te!==null;){if(te.key===Ke)if(te.tag===4&&te.stateNode.containerInfo===le.containerInfo&&te.stateNode.implementation===le.implementation){l(ie,te.sibling),te=m(te,le.children||[]),te.return=ie,ie=te;break e}else{l(ie,te);break}else n(ie,te);te=te.sibling}te=X0(le,ie.mode,ze),te.return=ie,ie=te}return E(ie);case Ga:return Ke=le._init,Ce(ie,te,Ke(le._payload),ze)}if(hp(le))return ae(ie,te,le,ze);if(Jd(le))return me(ie,te,le,ze);qm(ie,le)}return typeof le=="string"&&le!==""||typeof le=="number"?(le=""+le,te!==null&&te.tag===6?(l(ie,te.sibling),te=m(te,le),te.return=ie,ie=te):(l(ie,te),te=H0(le,ie.mode,ze),te.return=ie,ie=te),E(ie)):l(ie,te)}return Ce}var ih=aA(!0),lA=aA(!1),Fg=hl(null),Ng=null,ju=null,U1=null;function j1(){U1=ju=Ng=null}function V1(e){var n=Fg.current;On(Fg),e._currentValue=n}function Fv(e,n,l){for(;e!==null;){var h=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,h!==null&&(h.childLanes|=n)):h!==null&&(h.childLanes&n)!==n&&(h.childLanes|=n),e===l)break;e=e.return}}function Xu(e,n){Ng=e,U1=ju=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&n&&(Ai=!0),e.firstContext=null)}function mo(e){var n=e._currentValue;if(U1!==e)if(e={context:e,memoizedValue:n,next:null},ju===null){if(Ng===null)throw Error(it(308));ju=e,Ng.dependencies={lanes:0,firstContext:e}}else ju=ju.next=e;return n}var uc=null;function $1(e){uc===null?uc=[e]:uc.push(e)}function cA(e,n,l,h){var m=n.interleaved;return m===null?(l.next=l,$1(n)):(l.next=m.next,m.next=l),n.interleaved=l,ra(e,h)}function ra(e,n){e.lanes|=n;var l=e.alternate;for(l!==null&&(l.lanes|=n),l=e,e=e.return;e!==null;)e.childLanes|=n,l=e.alternate,l!==null&&(l.childLanes|=n),l=e,e=e.return;return l.tag===3?l.stateNode:null}var qa=!1;function G1(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function uA(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Qs(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function tl(e,n,l){var h=e.updateQueue;if(h===null)return null;if(h=h.shared,nn&2){var m=h.pending;return m===null?n.next=n:(n.next=m.next,m.next=n),h.pending=n,ra(e,l)}return m=h.interleaved,m===null?(n.next=n,$1(h)):(n.next=m.next,m.next=n),h.interleaved=n,ra(e,l)}function cg(e,n,l){if(n=n.updateQueue,n!==null&&(n=n.shared,(l&4194240)!==0)){var h=n.lanes;h&=e.pendingLanes,l|=h,n.lanes=l,k1(e,l)}}function rE(e,n){var l=e.updateQueue,h=e.alternate;if(h!==null&&(h=h.updateQueue,l===h)){var m=null,v=null;if(l=l.firstBaseUpdate,l!==null){do{var E={eventTime:l.eventTime,lane:l.lane,tag:l.tag,payload:l.payload,callback:l.callback,next:null};v===null?m=v=E:v=v.next=E,l=l.next}while(l!==null);v===null?m=v=n:v=v.next=n}else m=v=n;l={baseState:h.baseState,firstBaseUpdate:m,lastBaseUpdate:v,shared:h.shared,effects:h.effects},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=n:e.next=n,l.lastBaseUpdate=n}function Ug(e,n,l,h){var m=e.updateQueue;qa=!1;var v=m.firstBaseUpdate,E=m.lastBaseUpdate,s=m.shared.pending;if(s!==null){m.shared.pending=null;var k=s,D=k.next;k.next=null,E===null?v=D:E.next=D,E=k;var V=e.alternate;V!==null&&(V=V.updateQueue,s=V.lastBaseUpdate,s!==E&&(s===null?V.firstBaseUpdate=D:s.next=D,V.lastBaseUpdate=k))}if(v!==null){var G=m.baseState;E=0,V=D=k=null,s=v;do{var J=s.lane,ve=s.eventTime;if((h&J)===J){V!==null&&(V=V.next={eventTime:ve,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var ae=e,me=s;switch(J=n,ve=l,me.tag){case 1:if(ae=me.payload,typeof ae=="function"){G=ae.call(ve,G,J);break e}G=ae;break e;case 3:ae.flags=ae.flags&-65537|128;case 0:if(ae=me.payload,J=typeof ae=="function"?ae.call(ve,G,J):ae,J==null)break e;G=Qn({},G,J);break e;case 2:qa=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,J=m.effects,J===null?m.effects=[s]:J.push(s))}else ve={eventTime:ve,lane:J,tag:s.tag,payload:s.payload,callback:s.callback,next:null},V===null?(D=V=ve,k=G):V=V.next=ve,E|=J;if(s=s.next,s===null){if(s=m.shared.pending,s===null)break;J=s,s=J.next,J.next=null,m.lastBaseUpdate=J,m.shared.pending=null}}while(1);if(V===null&&(k=G),m.baseState=k,m.firstBaseUpdate=D,m.lastBaseUpdate=V,n=m.shared.interleaved,n!==null){m=n;do E|=m.lane,m=m.next;while(m!==n)}else v===null&&(m.shared.lanes=0);yc|=E,e.lanes=E,e.memoizedState=G}}function iE(e,n,l){if(e=n.effects,n.effects=null,e!==null)for(n=0;nl?l:4,e(!0);var h=$0.transition;$0.transition={};try{e(!1),n()}finally{Tn=l,$0.transition=h}}function CA(){return go().memoizedState}function EL(e,n,l){var h=rl(e);if(l={lane:h,action:l,hasEagerState:!1,eagerState:null,next:null},IA(e))kA(n,l);else if(l=cA(e,n,l,h),l!==null){var m=ui();Wo(l,e,h,m),MA(l,n,h)}}function TL(e,n,l){var h=rl(e),m={lane:h,action:l,hasEagerState:!1,eagerState:null,next:null};if(IA(e))kA(n,m);else{var v=e.alternate;if(e.lanes===0&&(v===null||v.lanes===0)&&(v=n.lastRenderedReducer,v!==null))try{var E=n.lastRenderedState,s=v(E,l);if(m.hasEagerState=!0,m.eagerState=s,Xo(s,E)){var k=n.interleaved;k===null?(m.next=m,$1(n)):(m.next=k.next,k.next=m),n.interleaved=m;return}}catch{}finally{}l=cA(e,n,m,h),l!==null&&(m=ui(),Wo(l,e,h,m),MA(l,n,h))}}function IA(e){var n=e.alternate;return e===Jn||n!==null&&n===Jn}function kA(e,n){vp=Vg=!0;var l=e.pending;l===null?n.next=n:(n.next=l.next,l.next=n),e.pending=n}function MA(e,n,l){if(l&4194240){var h=n.lanes;h&=e.pendingLanes,l|=h,n.lanes=l,k1(e,l)}}var $g={readContext:mo,useCallback:Jr,useContext:Jr,useEffect:Jr,useImperativeHandle:Jr,useInsertionEffect:Jr,useLayoutEffect:Jr,useMemo:Jr,useReducer:Jr,useRef:Jr,useState:Jr,useDebugValue:Jr,useDeferredValue:Jr,useTransition:Jr,useMutableSource:Jr,useSyncExternalStore:Jr,useId:Jr,unstable_isNewReconciler:!1},SL={readContext:mo,useCallback:function(e,n){return gs().memoizedState=[e,n===void 0?null:n],e},useContext:mo,useEffect:sE,useImperativeHandle:function(e,n,l){return l=l!=null?l.concat([e]):null,hg(4194308,4,bA.bind(null,n,e),l)},useLayoutEffect:function(e,n){return hg(4194308,4,e,n)},useInsertionEffect:function(e,n){return hg(4,2,e,n)},useMemo:function(e,n){var l=gs();return n=n===void 0?null:n,e=e(),l.memoizedState=[e,n],e},useReducer:function(e,n,l){var h=gs();return n=l!==void 0?l(n):n,h.memoizedState=h.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},h.queue=e,e=e.dispatch=EL.bind(null,Jn,e),[h.memoizedState,e]},useRef:function(e){var n=gs();return e={current:e},n.memoizedState=e},useState:oE,useDebugValue:J1,useDeferredValue:function(e){return gs().memoizedState=e},useTransition:function(){var e=oE(!1),n=e[0];return e=bL.bind(null,e[1]),gs().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,l){var h=Jn,m=gs();if(jn){if(l===void 0)throw Error(it(407));l=l()}else{if(l=n(),Rr===null)throw Error(it(349));_c&30||fA(h,n,l)}m.memoizedState=l;var v={value:l,getSnapshot:n};return m.queue=v,sE(gA.bind(null,h,v,e),[e]),h.flags|=2048,Up(9,mA.bind(null,h,v,l,n),void 0,null),l},useId:function(){var e=gs(),n=Rr.identifierPrefix;if(jn){var l=Js,h=Ys;l=(h&~(1<<32-qo(h)-1)).toString(32)+l,n=":"+n+"R"+l,l=Fp++,0<\/script>",e=e.removeChild(e.firstChild)):typeof h.is=="string"?e=E.createElement(l,{is:h.is}):(e=E.createElement(l),l==="select"&&(E=e,h.multiple?E.multiple=!0:h.size&&(E.size=h.size))):e=E.createElementNS(e,l),e[ys]=n,e[Dp]=h,UA(e,n,!1,!1),n.stateNode=e;e:{switch(E=xv(l,h),l){case"dialog":Dn("cancel",e),Dn("close",e),m=h;break;case"iframe":case"object":case"embed":Dn("load",e),m=h;break;case"video":case"audio":for(m=0;mah&&(n.flags|=128,h=!0,ip(v,!1),n.lanes=4194304)}else{if(!h)if(e=jg(E),e!==null){if(n.flags|=128,h=!0,l=e.updateQueue,l!==null&&(n.updateQueue=l,n.flags|=4),ip(v,!0),v.tail===null&&v.tailMode==="hidden"&&!E.alternate&&!jn)return Qr(n),null}else 2*lr()-v.renderingStartTime>ah&&l!==1073741824&&(n.flags|=128,h=!0,ip(v,!1),n.lanes=4194304);v.isBackwards?(E.sibling=n.child,n.child=E):(l=v.last,l!==null?l.sibling=E:n.child=E,v.last=E)}return v.tail!==null?(n=v.tail,v.rendering=n,v.tail=n.sibling,v.renderingStartTime=lr(),n.sibling=null,l=Yn.current,Pn(Yn,h?l&1|2:l&1),n):(Qr(n),null);case 22:case 23:return ix(),h=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==h&&(n.flags|=8192),h&&n.mode&1?ji&1073741824&&(Qr(n),n.subtreeFlags&6&&(n.flags|=8192)):Qr(n),null;case 24:return null;case 25:return null}throw Error(it(156,n.tag))}function LL(e,n){switch(F1(n),n.tag){case 1:return Ii(n.type)&&Rg(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return oh(),On(Ci),On(ni),Z1(),e=n.flags,e&65536&&!(e&128)?(n.flags=e&-65537|128,n):null;case 5:return W1(n),null;case 13:if(On(Yn),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(it(340));rh()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return On(Yn),null;case 4:return oh(),null;case 10:return V1(n.type._context),null;case 22:case 23:return ix(),null;case 24:return null;default:return null}}var Zm=!1,ti=!1,RL=typeof WeakSet=="function"?WeakSet:Set,yt=null;function Vu(e,n){var l=e.ref;if(l!==null)if(typeof l=="function")try{l(null)}catch(h){or(e,n,h)}else l.current=null}function Zv(e,n,l){try{l()}catch(h){or(e,n,h)}}var _E=!1;function DL(e,n){if(Mv=Mg,e=ZS(),O1(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var h=l.getSelection&&l.getSelection();if(h&&h.rangeCount!==0){l=h.anchorNode;var m=h.anchorOffset,v=h.focusNode;h=h.focusOffset;try{l.nodeType,v.nodeType}catch{l=null;break e}var E=0,s=-1,k=-1,D=0,V=0,G=e,J=null;t:for(;;){for(var ve;G!==l||m!==0&&G.nodeType!==3||(s=E+m),G!==v||h!==0&&G.nodeType!==3||(k=E+h),G.nodeType===3&&(E+=G.nodeValue.length),(ve=G.firstChild)!==null;)J=G,G=ve;for(;;){if(G===e)break t;if(J===l&&++D===m&&(s=E),J===v&&++V===h&&(k=E),(ve=G.nextSibling)!==null)break;G=J,J=G.parentNode}G=ve}l=s===-1||k===-1?null:{start:s,end:k}}else l=null}l=l||{start:0,end:0}}else l=null;for(Pv={focusedElem:e,selectionRange:l},Mg=!1,yt=n;yt!==null;)if(n=yt,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,yt=e;else for(;yt!==null;){n=yt;try{var ae=n.alternate;if(n.flags&1024)switch(n.tag){case 0:case 11:case 15:break;case 1:if(ae!==null){var me=ae.memoizedProps,Ce=ae.memoizedState,ie=n.stateNode,te=ie.getSnapshotBeforeUpdate(n.elementType===n.type?me:jo(n.type,me),Ce);ie.__reactInternalSnapshotBeforeUpdate=te}break;case 3:var le=n.stateNode.containerInfo;le.nodeType===1?le.textContent="":le.nodeType===9&&le.documentElement&&le.removeChild(le.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(it(163))}}catch(ze){or(n,n.return,ze)}if(e=n.sibling,e!==null){e.return=n.return,yt=e;break}yt=n.return}return ae=_E,_E=!1,ae}function xp(e,n,l){var h=n.updateQueue;if(h=h!==null?h.lastEffect:null,h!==null){var m=h=h.next;do{if((m.tag&e)===e){var v=m.destroy;m.destroy=void 0,v!==void 0&&Zv(n,l,v)}m=m.next}while(m!==h)}}function m_(e,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var l=n=n.next;do{if((l.tag&e)===e){var h=l.create;l.destroy=h()}l=l.next}while(l!==n)}}function Hv(e){var n=e.ref;if(n!==null){var l=e.stateNode;switch(e.tag){case 5:e=l;break;default:e=l}typeof n=="function"?n(e):n.current=e}}function $A(e){var n=e.alternate;n!==null&&(e.alternate=null,$A(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[ys],delete n[Dp],delete n[Rv],delete n[_L],delete n[yL])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function GA(e){return e.tag===5||e.tag===3||e.tag===4}function yE(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||GA(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Xv(e,n,l){var h=e.tag;if(h===5||h===6)e=e.stateNode,n?l.nodeType===8?l.parentNode.insertBefore(e,n):l.insertBefore(e,n):(l.nodeType===8?(n=l.parentNode,n.insertBefore(e,l)):(n=l,n.appendChild(e)),l=l._reactRootContainer,l!=null||n.onclick!==null||(n.onclick=Lg));else if(h!==4&&(e=e.child,e!==null))for(Xv(e,n,l),e=e.sibling;e!==null;)Xv(e,n,l),e=e.sibling}function Kv(e,n,l){var h=e.tag;if(h===5||h===6)e=e.stateNode,n?l.insertBefore(e,n):l.appendChild(e);else if(h!==4&&(e=e.child,e!==null))for(Kv(e,n,l),e=e.sibling;e!==null;)Kv(e,n,l),e=e.sibling}var Fr=null,Vo=!1;function ja(e,n,l){for(l=l.child;l!==null;)qA(e,n,l),l=l.sibling}function qA(e,n,l){if(vs&&typeof vs.onCommitFiberUnmount=="function")try{vs.onCommitFiberUnmount(a_,l)}catch{}switch(l.tag){case 5:ti||Vu(l,n);case 6:var h=Fr,m=Vo;Fr=null,ja(e,n,l),Fr=h,Vo=m,Fr!==null&&(Vo?(e=Fr,l=l.stateNode,e.nodeType===8?e.parentNode.removeChild(l):e.removeChild(l)):Fr.removeChild(l.stateNode));break;case 18:Fr!==null&&(Vo?(e=Fr,l=l.stateNode,e.nodeType===8?U0(e.parentNode,l):e.nodeType===1&&U0(e,l),Mp(e)):U0(Fr,l.stateNode));break;case 4:h=Fr,m=Vo,Fr=l.stateNode.containerInfo,Vo=!0,ja(e,n,l),Fr=h,Vo=m;break;case 0:case 11:case 14:case 15:if(!ti&&(h=l.updateQueue,h!==null&&(h=h.lastEffect,h!==null))){m=h=h.next;do{var v=m,E=v.destroy;v=v.tag,E!==void 0&&(v&2||v&4)&&Zv(l,n,E),m=m.next}while(m!==h)}ja(e,n,l);break;case 1:if(!ti&&(Vu(l,n),h=l.stateNode,typeof h.componentWillUnmount=="function"))try{h.props=l.memoizedProps,h.state=l.memoizedState,h.componentWillUnmount()}catch(s){or(l,n,s)}ja(e,n,l);break;case 21:ja(e,n,l);break;case 22:l.mode&1?(ti=(h=ti)||l.memoizedState!==null,ja(e,n,l),ti=h):ja(e,n,l);break;default:ja(e,n,l)}}function vE(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var l=e.stateNode;l===null&&(l=e.stateNode=new RL),n.forEach(function(h){var m=GL.bind(null,e,h);l.has(h)||(l.add(h),h.then(m,m))})}}function Uo(e,n){var l=n.deletions;if(l!==null)for(var h=0;hm&&(m=E),h&=~v}if(h=m,h=lr()-h,h=(120>h?120:480>h?480:1080>h?1080:1920>h?1920:3e3>h?3e3:4320>h?4320:1960*BL(h/1960))-h,10e?16:e,Xa===null)var h=!1;else{if(e=Xa,Xa=null,Wg=0,nn&6)throw Error(it(331));var m=nn;for(nn|=4,yt=e.current;yt!==null;){var v=yt,E=v.child;if(yt.flags&16){var s=v.deletions;if(s!==null){for(var k=0;klr()-nx?pc(e,0):tx|=l),ki(e,n)}function QA(e,n){n===0&&(e.mode&1?(n=Fm,Fm<<=1,!(Fm&130023424)&&(Fm=4194304)):n=1);var l=ui();e=ra(e,n),e!==null&&(Jp(e,n,l),ki(e,l))}function $L(e){var n=e.memoizedState,l=0;n!==null&&(l=n.retryLane),QA(e,l)}function GL(e,n){var l=0;switch(e.tag){case 13:var h=e.stateNode,m=e.memoizedState;m!==null&&(l=m.retryLane);break;case 19:h=e.stateNode;break;default:throw Error(it(314))}h!==null&&h.delete(n),QA(e,l)}var eC;eC=function(e,n,l){if(e!==null)if(e.memoizedProps!==n.pendingProps||Ci.current)Ai=!0;else{if(!(e.lanes&l)&&!(n.flags&128))return Ai=!1,PL(e,n,l);Ai=!!(e.flags&131072)}else Ai=!1,jn&&n.flags&1048576&&iA(n,Bg,n.index);switch(n.lanes=0,n.tag){case 2:var h=n.type;dg(e,n),e=n.pendingProps;var m=nh(n,ni.current);Xu(n,l),m=X1(null,n,h,e,m,l);var v=K1();return n.flags|=1,typeof m=="object"&&m!==null&&typeof m.render=="function"&&m.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,Ii(h)?(v=!0,Dg(n)):v=!1,n.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,G1(n),m.updater=f_,n.stateNode=m,m._reactInternals=n,Uv(n,h,e,l),n=$v(null,n,h,!0,v,l)):(n.tag=0,jn&&v&&B1(n),ci(null,n,m,l),n=n.child),n;case 16:h=n.elementType;e:{switch(dg(e,n),e=n.pendingProps,m=h._init,h=m(h._payload),n.type=h,m=n.tag=WL(h),e=jo(h,e),m){case 0:n=Vv(null,n,h,e,l);break e;case 1:n=fE(null,n,h,e,l);break e;case 11:n=dE(null,n,h,e,l);break e;case 14:n=pE(null,n,h,jo(h.type,e),l);break e}throw Error(it(306,h,""))}return n;case 0:return h=n.type,m=n.pendingProps,m=n.elementType===h?m:jo(h,m),Vv(e,n,h,m,l);case 1:return h=n.type,m=n.pendingProps,m=n.elementType===h?m:jo(h,m),fE(e,n,h,m,l);case 3:e:{if(BA(n),e===null)throw Error(it(387));h=n.pendingProps,v=n.memoizedState,m=v.element,uA(e,n),Ug(n,h,null,l);var E=n.memoizedState;if(h=E.element,v.isDehydrated)if(v={element:h,isDehydrated:!1,cache:E.cache,pendingSuspenseBoundaries:E.pendingSuspenseBoundaries,transitions:E.transitions},n.updateQueue.baseState=v,n.memoizedState=v,n.flags&256){m=sh(Error(it(423)),n),n=mE(e,n,h,l,m);break e}else if(h!==m){m=sh(Error(it(424)),n),n=mE(e,n,h,l,m);break e}else for($i=el(n.stateNode.containerInfo.firstChild),Gi=n,jn=!0,$o=null,l=lA(n,null,h,l),n.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(rh(),h===m){n=ia(e,n,l);break e}ci(e,n,h,l)}n=n.child}return n;case 5:return hA(n),e===null&&Bv(n),h=n.type,m=n.pendingProps,v=e!==null?e.memoizedProps:null,E=m.children,zv(h,m)?E=null:v!==null&&zv(h,v)&&(n.flags|=32),OA(e,n),ci(e,n,E,l),n.child;case 6:return e===null&&Bv(n),null;case 13:return FA(e,n,l);case 4:return q1(n,n.stateNode.containerInfo),h=n.pendingProps,e===null?n.child=ih(n,null,h,l):ci(e,n,h,l),n.child;case 11:return h=n.type,m=n.pendingProps,m=n.elementType===h?m:jo(h,m),dE(e,n,h,m,l);case 7:return ci(e,n,n.pendingProps,l),n.child;case 8:return ci(e,n,n.pendingProps.children,l),n.child;case 12:return ci(e,n,n.pendingProps.children,l),n.child;case 10:e:{if(h=n.type._context,m=n.pendingProps,v=n.memoizedProps,E=m.value,Pn(Fg,h._currentValue),h._currentValue=E,v!==null)if(Xo(v.value,E)){if(v.children===m.children&&!Ci.current){n=ia(e,n,l);break e}}else for(v=n.child,v!==null&&(v.return=n);v!==null;){var s=v.dependencies;if(s!==null){E=v.child;for(var k=s.firstContext;k!==null;){if(k.context===h){if(v.tag===1){k=Qs(-1,l&-l),k.tag=2;var D=v.updateQueue;if(D!==null){D=D.shared;var V=D.pending;V===null?k.next=k:(k.next=V.next,V.next=k),D.pending=k}}v.lanes|=l,k=v.alternate,k!==null&&(k.lanes|=l),Fv(v.return,l,n),s.lanes|=l;break}k=k.next}}else if(v.tag===10)E=v.type===n.type?null:v.child;else if(v.tag===18){if(E=v.return,E===null)throw Error(it(341));E.lanes|=l,s=E.alternate,s!==null&&(s.lanes|=l),Fv(E,l,n),E=v.sibling}else E=v.child;if(E!==null)E.return=v;else for(E=v;E!==null;){if(E===n){E=null;break}if(v=E.sibling,v!==null){v.return=E.return,E=v;break}E=E.return}v=E}ci(e,n,m.children,l),n=n.child}return n;case 9:return m=n.type,h=n.pendingProps.children,Xu(n,l),m=mo(m),h=h(m),n.flags|=1,ci(e,n,h,l),n.child;case 14:return h=n.type,m=jo(h,n.pendingProps),m=jo(h.type,m),pE(e,n,h,m,l);case 15:return RA(e,n,n.type,n.pendingProps,l);case 17:return h=n.type,m=n.pendingProps,m=n.elementType===h?m:jo(h,m),dg(e,n),n.tag=1,Ii(h)?(e=!0,Dg(n)):e=!1,Xu(n,l),PA(n,h,m),Uv(n,h,m,l),$v(null,n,h,!0,e,l);case 19:return NA(e,n,l);case 22:return DA(e,n,l)}throw Error(it(156,n.tag))};function tC(e,n){return IS(e,n)}function qL(e,n,l,h){this.tag=e,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function po(e,n,l,h){return new qL(e,n,l,h)}function sx(e){return e=e.prototype,!(!e||!e.isReactComponent)}function WL(e){if(typeof e=="function")return sx(e)?1:0;if(e!=null){if(e=e.$$typeof,e===S1)return 11;if(e===A1)return 14}return 2}function il(e,n){var l=e.alternate;return l===null?(l=po(e.tag,n,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=n,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&14680064,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,n=e.dependencies,l.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l}function mg(e,n,l,h,m,v){var E=2;if(h=e,typeof e=="function")sx(e)&&(E=1);else if(typeof e=="string")E=5;else e:switch(e){case Lu:return fc(l.children,m,v,n);case T1:E=8,m|=8;break;case uv:return e=po(12,l,n,m|2),e.elementType=uv,e.lanes=v,e;case hv:return e=po(13,l,n,m),e.elementType=hv,e.lanes=v,e;case dv:return e=po(19,l,n,m),e.elementType=dv,e.lanes=v,e;case hS:return __(l,m,v,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case cS:E=10;break e;case uS:E=9;break e;case S1:E=11;break e;case A1:E=14;break e;case Ga:E=16,h=null;break e}throw Error(it(130,e==null?e:typeof e,""))}return n=po(E,l,n,m),n.elementType=e,n.type=h,n.lanes=v,n}function fc(e,n,l,h){return e=po(7,e,h,n),e.lanes=l,e}function __(e,n,l,h){return e=po(22,e,h,n),e.elementType=hS,e.lanes=l,e.stateNode={isHidden:!1},e}function H0(e,n,l){return e=po(6,e,null,n),e.lanes=l,e}function X0(e,n,l){return n=po(4,e.children!==null?e.children:[],e.key,n),n.lanes=l,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function ZL(e,n,l,h,m){this.tag=n,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=k0(0),this.expirationTimes=k0(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=k0(0),this.identifierPrefix=h,this.onRecoverableError=m,this.mutableSourceEagerHydrationData=null}function ax(e,n,l,h,m,v,E,s,k){return e=new ZL(e,n,l,s,k),n===1?(n=1,v===!0&&(n|=8)):n=0,v=po(3,null,null,n),e.current=v,v.stateNode=e,v.memoizedState={element:h,isDehydrated:l,cache:null,transitions:null,pendingSuspenseBoundaries:null},G1(v),e}function HL(e,n,l){var h=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(oC)}catch(e){console.error(e)}}oC(),oS.exports=Hi;var hx=oS.exports,sC,CE=hx;sC=CE.createRoot,CE.hydrateRoot;const QL="Logging",eR="NoHubcallbackProvidedException";var Ui;(function(e){e.DEBUG="DEBUG",e.ERROR="ERROR",e.INFO="INFO",e.WARN="WARN",e.VERBOSE="VERBOSE",e.NONE="NONE"})(Ui||(Ui={}));const IE={VERBOSE:1,DEBUG:2,INFO:3,WARN:4,ERROR:5,NONE:6};class Zo{constructor(n,l=Ui.WARN){this.name=n,this.level=l,this._pluggables=[]}_padding(n){return n<10?"0"+n:""+n}_ts(){const n=new Date;return[this._padding(n.getMinutes()),this._padding(n.getSeconds())].join(":")+"."+n.getMilliseconds()}configure(n){return n?(this._config=n,this._config):this._config}_log(n,...l){let h=this.level;Zo.LOG_LEVEL&&(h=Zo.LOG_LEVEL),typeof window<"u"&&window.LOG_LEVEL&&(h=window.LOG_LEVEL);const m=IE[h];if(!(IE[n]>=m))return;let E=console.log.bind(console);n===Ui.ERROR&&console.error&&(E=console.error.bind(console)),n===Ui.WARN&&console.warn&&(E=console.warn.bind(console)),Zo.BIND_ALL_LOG_LEVELS&&(n===Ui.INFO&&console.info&&(E=console.info.bind(console)),n===Ui.DEBUG&&console.debug&&(E=console.debug.bind(console)));const s=`[${n}] ${this._ts()} ${this.name}`;let k="";if(l.length===1&&typeof l[0]=="string")k=`${s} - ${l[0]}`,E(k);else if(l.length===1)k=`${s} ${l[0]}`,E(s,l[0]);else if(typeof l[0]=="string"){let D=l.slice(1);D.length===1&&(D=D[0]),k=`${s} - ${l[0]} ${D}`,E(`${s} - ${l[0]}`,D)}else k=`${s} ${l}`,E(s,l);for(const D of this._pluggables){const V={message:k,timestamp:Date.now()};D.pushLogs([V])}}log(...n){this._log(Ui.INFO,...n)}info(...n){this._log(Ui.INFO,...n)}warn(...n){this._log(Ui.WARN,...n)}error(...n){this._log(Ui.ERROR,...n)}debug(...n){this._log(Ui.DEBUG,...n)}verbose(...n){this._log(Ui.VERBOSE,...n)}addPluggable(n){n&&n.getCategoryName()===QL&&(this._pluggables.push(n),n.configure(this._config))}listPluggables(){return this._pluggables}}Zo.LOG_LEVEL=null;Zo.BIND_ALL_LOG_LEVELS=!1;class bs extends Error{constructor({message:n,name:l,recoverySuggestion:h,underlyingError:m}){super(n),this.name=l,this.underlyingError=m,this.recoverySuggestion=h,this.constructor=bs,Object.setPrototypeOf(this,bs.prototype)}}var Vp;(function(e){e.NoEndpointId="NoEndpointId",e.PlatformNotSupported="PlatformNotSupported",e.Unknown="Unknown",e.NetworkError="NetworkError"})(Vp||(Vp={}));const aC=(e,n=bs)=>(l,h,m)=>{const{message:v,recoverySuggestion:E}=e[h];if(!l)throw new n({name:h,message:m?`${v} ${m}`:v,recoverySuggestion:E})},Xg=typeof Symbol<"u"?Symbol("amplify_default"):"@@amplify_default",sp=new Zo("Hub");class tR{constructor(n){this.listeners=new Map,this.protectedChannels=["core","auth","api","analytics","interactions","pubsub","storage","ui","xr"],this.name=n}_remove(n,l){const h=this.listeners.get(n);if(!h){sp.warn(`No listeners for ${n}`);return}this.listeners.set(n,[...h.filter(({callback:m})=>m!==l)])}dispatch(n,l,h,m){typeof n=="string"&&this.protectedChannels.indexOf(n)>-1&&(m===Xg||sp.warn(`WARNING: ${n} is protected and dispatching on it can have unintended consequences`));const v={channel:n,payload:{...l},source:h,patternInfo:[]};try{this._toListeners(v)}catch(E){sp.error(E)}}listen(n,l,h="noname"){let m;if(typeof l!="function")throw new bs({name:eR,message:"No callback supplied to Hub"});m=l;let v=this.listeners.get(n);return v||(v=[],this.listeners.set(n,v)),v.push({name:h,callback:m}),()=>{this._remove(n,m)}}_toListeners(n){const{channel:l,payload:h}=n,m=this.listeners.get(l);m&&m.forEach(v=>{sp.debug(`Dispatching to ${l} with `,h);try{v.callback(n)}catch(E){sp.error(E)}})}}const t1=new tR("__default__"),nR=()=>{if(typeof window<"u"&&typeof window.atob=="function")return window.atob;if(typeof atob=="function")return atob;throw new bs({name:"Base64EncoderError",message:"Cannot resolve the `atob` function from the environment."})},rR={convert(e){return nR()(e)}};var Xs;(function(e){e.AuthTokenConfigException="AuthTokenConfigException",e.AuthUserPoolAndIdentityPoolException="AuthUserPoolAndIdentityPoolException",e.AuthUserPoolException="AuthUserPoolException",e.InvalidIdentityPoolIdException="InvalidIdentityPoolIdException",e.OAuthNotConfigureException="OAuthNotConfigureException"})(Xs||(Xs={}));const iR={[Xs.AuthTokenConfigException]:{message:"Auth Token Provider not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app."},[Xs.AuthUserPoolAndIdentityPoolException]:{message:"Auth UserPool or IdentityPool not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app with UserPoolId and IdentityPoolId."},[Xs.AuthUserPoolException]:{message:"Auth UserPool not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app with userPoolId and userPoolClientId."},[Xs.InvalidIdentityPoolIdException]:{message:"Invalid identity pool id provided.",recoverySuggestion:"Make sure a valid identityPoolId is given in the config."},[Xs.OAuthNotConfigureException]:{message:"oauth param not configured.",recoverySuggestion:"Make sure to call Amplify.configure with oauth parameter in your app."}},lC=aC(iR);function Ti(e){let n=!0;e?n=!!e.userPoolId&&!!e.userPoolClientId:n=!1,lC(n,Xs.AuthUserPoolException)}function gg(e){const n=!!(e!=null&&e.identityPoolId);lC(n,Xs.InvalidIdentityPoolIdException)}function $p(e){const n=e.split(".");if(n.length!==3)throw new Error("Invalid token");try{const h=n[1].replace(/-/g,"+").replace(/_/g,"/"),m=decodeURIComponent(rR.convert(h).split("").map(E=>`%${`00${E.charCodeAt(0).toString(16)}`.slice(-2)}`).join("")),v=JSON.parse(m);return{toString:()=>e,payload:v}}catch{throw new Error("Invalid token payload")}}const cC=e=>{const n=Reflect.ownKeys(e);for(const l of n){const h=e[l];(h&&typeof h=="object"||typeof h=="function")&&cC(h)}return Object.freeze(e)},oR=new Zo("parseAWSExports"),sR={API_KEY:"apiKey",AWS_IAM:"iam",AMAZON_COGNITO_USER_POOLS:"userPool",OPENID_CONNECT:"oidc",NONE:"none",AWS_LAMBDA:"lambda",LAMBDA:"lambda"},aR=(e={})=>{var sr,ii,ar,br,Es,Yi;if(!Object.prototype.hasOwnProperty.call(e,"aws_project_region"))throw new bs({name:"InvalidParameterException",message:"Invalid config parameter.",recoverySuggestion:"Ensure passing the config object imported from `amplifyconfiguration.json`."});const{aws_appsync_apiKey:n,aws_appsync_authenticationType:l,aws_appsync_graphqlEndpoint:h,aws_appsync_region:m,aws_bots_config:v,aws_cognito_identity_pool_id:E,aws_cognito_sign_up_verification_method:s,aws_cognito_mfa_configuration:k,aws_cognito_mfa_types:D,aws_cognito_password_protection_settings:V,aws_cognito_verification_mechanisms:G,aws_cognito_signup_attributes:J,aws_cognito_social_providers:ve,aws_cognito_username_attributes:ae,aws_mandatory_sign_in:me,aws_mobile_analytics_app_id:Ce,aws_mobile_analytics_app_region:ie,aws_user_files_s3_bucket:te,aws_user_files_s3_bucket_region:le,aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing:ze,aws_user_pools_id:Oe,aws_user_pools_web_client_id:Ke,geo:He,oauth:ht,predictions:Ve,aws_cloud_logic_custom:jt,Notifications:wr,modelIntrospection:St}=e,Vt={};Ce&&(Vt.Analytics={Pinpoint:{appId:Ce,region:ie}});const{InAppMessaging:Vr,Push:$r}=wr??{};if(Vr!=null&&Vr.AWSPinpoint||$r!=null&&$r.AWSPinpoint){if(Vr!=null&&Vr.AWSPinpoint){const{appId:xn,region:kt}=Vr.AWSPinpoint;Vt.Notifications={InAppMessaging:{Pinpoint:{appId:xn,region:kt}}}}if($r!=null&&$r.AWSPinpoint){const{appId:xn,region:kt}=$r.AWSPinpoint;Vt.Notifications={...Vt.Notifications,PushNotification:{Pinpoint:{appId:xn,region:kt}}}}}if(Array.isArray(v)&&(Vt.Interactions={LexV1:Object.fromEntries(v.map(xn=>[xn.name,xn]))}),h){const xn=sR[l];xn||oR.debug(`Invalid authentication type ${l}. Falling back to IAM.`),Vt.API={GraphQL:{endpoint:h,apiKey:n,region:m,defaultAuthMode:xn??"iam"}},St&&(Vt.API.GraphQL.modelIntrospection=St)}const Li=k?{status:k&&k.toLowerCase(),totpEnabled:(D==null?void 0:D.includes("TOTP"))??!1,smsEnabled:(D==null?void 0:D.includes("SMS"))??!1}:void 0,Ki=V?{minLength:V.passwordPolicyMinLength,requireLowercase:((sr=V.passwordPolicyCharacters)==null?void 0:sr.includes("REQUIRES_LOWERCASE"))??!1,requireUppercase:((ii=V.passwordPolicyCharacters)==null?void 0:ii.includes("REQUIRES_UPPERCASE"))??!1,requireNumbers:((ar=V.passwordPolicyCharacters)==null?void 0:ar.includes("REQUIRES_NUMBERS"))??!1,requireSpecialCharacters:((br=V.passwordPolicyCharacters)==null?void 0:br.includes("REQUIRES_SYMBOLS"))??!1}:void 0,Tt=Array.from(new Set([...G??[],...J??[]])).reduce((xn,kt)=>({...xn,[kt.toLowerCase()]:{required:!0}}),{}),xt=(ae==null?void 0:ae.includes("EMAIL"))??!1,Bt=(ae==null?void 0:ae.includes("PHONE_NUMBER"))??!1;(E||Oe)&&(Vt.Auth={Cognito:{identityPoolId:E,allowGuestAccess:me!=="enable",signUpVerificationMethod:s,userAttributes:Tt,userPoolClientId:Ke,userPoolId:Oe,mfa:Li,passwordFormat:Ki,loginWith:{username:!(xt||Bt),email:xt,phone:Bt}}});const dn=ht?Object.keys(ht).length>0:!1,vn=ve?ve.length>0:!1;if(Vt.Auth&&dn&&(Vt.Auth.Cognito.loginWith={...Vt.Auth.Cognito.loginWith,oauth:{...lR(ht),...vn&&{providers:cR(ve)}}}),te&&(Vt.Storage={S3:{bucket:te,region:le,dangerouslyConnectToHttpEndpointForTesting:ze}}),He){const{amazon_location_service:xn}=He;Vt.Geo={LocationService:{maps:xn.maps,geofenceCollections:xn.geofenceCollections,searchIndices:xn.search_indices,region:xn.region}}}if(jt&&(Vt.API={...Vt.API,REST:jt.reduce((xn,kt)=>{const{name:Yo,endpoint:Dr,region:Jo,service:wn}=kt;return{...xn,[Yo]:{endpoint:Dr,...wn?{service:wn}:void 0,...Jo?{region:Jo}:void 0}}},{})}),Ve){const{VoiceId:xn}=((Yi=(Es=Ve==null?void 0:Ve.convert)==null?void 0:Es.speechGenerator)==null?void 0:Yi.defaults)??{};Vt.Predictions=xn?{...Ve,convert:{...Ve.convert,speechGenerator:{...Ve.convert.speechGenerator,defaults:{voiceId:xn}}}}:Ve}return Vt},kE=e=>(e==null?void 0:e.split(","))??[],lR=({domain:e,scope:n,redirectSignIn:l,redirectSignOut:h,responseType:m})=>({domain:e,scopes:n,redirectSignIn:kE(l),redirectSignOut:kE(h),responseType:m}),cR=e=>e.map(n=>{const l=n.toLowerCase();return l.charAt(0).toUpperCase()+l.slice(1)}),uR=Symbol("oauth-listener");function hR(e){const{version:n}=e;return n?n.startsWith("1"):!1}function dR(e){if(!e)return;const{bucket_name:n,aws_region:l,buckets:h}=e;return{S3:{bucket:n,region:l,buckets:h&&ER(h)}}}function pR(e){if(!e)return;const{user_pool_id:n,user_pool_client_id:l,identity_pool_id:h,password_policy:m,mfa_configuration:v,mfa_methods:E,unauthenticated_identities_enabled:s,oauth:k,username_attributes:D,standard_required_attributes:V}=e,G={Cognito:{userPoolId:n,userPoolClientId:l}};return h&&(G.Cognito={...G.Cognito,identityPoolId:h}),m&&(G.Cognito.passwordFormat={requireLowercase:m.require_lowercase,requireNumbers:m.require_numbers,requireUppercase:m.require_uppercase,requireSpecialCharacters:m.require_symbols,minLength:m.min_length??6}),v&&(G.Cognito.mfa={status:bR(v),smsEnabled:E==null?void 0:E.includes("SMS"),totpEnabled:E==null?void 0:E.includes("TOTP")}),s&&(G.Cognito.allowGuestAccess=s),k&&(G.Cognito.loginWith={oauth:{domain:k.domain,redirectSignIn:k.redirect_sign_in_uri,redirectSignOut:k.redirect_sign_out_uri,responseType:k.response_type==="token"?"token":"code",scopes:k.scopes,providers:wR(k.identity_providers)}}),D&&(G.Cognito.loginWith={...G.Cognito.loginWith,email:D.includes("email"),phone:D.includes("phone_number"),username:D.includes("username")}),V&&(G.Cognito.userAttributes=V.reduce((J,ve)=>({...J,[ve]:{required:!0}}),{})),G}function fR(e){if(!(e!=null&&e.amazon_pinpoint))return;const{amazon_pinpoint:n}=e;return{Pinpoint:{appId:n.app_id,region:n.aws_region}}}function mR(e){if(!e)return;const{aws_region:n,geofence_collections:l,maps:h,search_indices:m}=e;return{LocationService:{region:n,searchIndices:m,geofenceCollections:l,maps:h}}}function gR(e){if(!e)return;const{aws_region:n,default_authorization_type:l,url:h,api_key:m,model_introspection:v}=e;return{GraphQL:{endpoint:h,defaultAuthMode:xR(l),region:n,apiKey:m,modelIntrospection:v}}}function _R(e){if(!e)return;const{aws_region:n,channels:l,amazon_pinpoint_app_id:h}=e,m=l.includes("IN_APP_MESSAGING"),v=l.includes("APNS")||l.includes("FCM");if(!(m||v))return;const E={};return m&&(E.InAppMessaging={Pinpoint:{appId:h,region:n}}),v&&(E.PushNotification={Pinpoint:{appId:h,region:n}}),E}function yR(e){const n={};return e.storage&&(n.Storage=dR(e.storage)),e.auth&&(n.Auth=pR(e.auth)),e.analytics&&(n.Analytics=fR(e.analytics)),e.geo&&(n.Geo=mR(e.geo)),e.data&&(n.API=gR(e.data)),e.notifications&&(n.Notifications=_R(e.notifications)),n}const vR={AMAZON_COGNITO_USER_POOLS:"userPool",API_KEY:"apiKey",AWS_IAM:"iam",AWS_LAMBDA:"lambda",OPENID_CONNECT:"oidc"};function xR(e){return vR[e]}const ME={GOOGLE:"Google",LOGIN_WITH_AMAZON:"Amazon",FACEBOOK:"Facebook",SIGN_IN_WITH_APPLE:"Apple"};function wR(e=[]){return e.reduce((n,l)=>(ME[l]!==void 0&&n.push(ME[l]),n),[])}function bR(e){return e==="OPTIONAL"?"optional":e==="REQUIRED"?"on":"off"}function ER(e){const n={};return e.forEach(({name:l,bucket_name:h,aws_region:m})=>{if(l in n)throw new Error(`Duplicate friendly name found: ${l}. Name must be unique.`);n[l]={bucketName:h,region:m}}),n}const uC=e=>Object.keys(e).some(n=>n.startsWith("aws_"))?aR(e):hR(e)?yR(e):e;function PE({expiresAt:e,clockDrift:n}){return Date.now()+n>e}class TR{configure(n,l){this.authConfig=n,this.authOptions=l}async fetchAuthSession(n={}){var v,E,s,k,D,V;let l,h;const m=await this.getTokens(n);return m?(h=(E=(v=m.accessToken)==null?void 0:v.payload)==null?void 0:E.sub,l=await((k=(s=this.authOptions)==null?void 0:s.credentialsProvider)==null?void 0:k.getCredentialsAndIdentityId({authConfig:this.authConfig,tokens:m,authenticated:!0,forceRefresh:n.forceRefresh}))):l=await((V=(D=this.authOptions)==null?void 0:D.credentialsProvider)==null?void 0:V.getCredentialsAndIdentityId({authConfig:this.authConfig,authenticated:!1,forceRefresh:n.forceRefresh})),{tokens:m,credentials:l==null?void 0:l.credentials,identityId:l==null?void 0:l.identityId,userSub:h}}async clearCredentials(){var n,l;await((l=(n=this.authOptions)==null?void 0:n.credentialsProvider)==null?void 0:l.clearCredentialsAndIdentityId())}async getTokens(n){var l,h;return await((h=(l=this.authOptions)==null?void 0:l.tokenProvider)==null?void 0:h.getTokens(n))??void 0}}const SR=e=>new TextEncoder().encode(e);typeof Buffer<"u"&&Buffer.from;for(let e=0;e<256;e++){let n=e.toString(16).toLowerCase();n.length===1&&(n=`0${n}`)}var _r;(function(e){e.WebUnknown="0",e.React="1",e.NextJs="2",e.Angular="3",e.VueJs="4",e.Nuxt="5",e.Svelte="6",e.ServerSideUnknown="100",e.ReactSSR="101",e.NextJsSSR="102",e.AngularSSR="103",e.VueJsSSR="104",e.NuxtSSR="105",e.SvelteSSR="106",e.ReactNative="201",e.Expo="202"})(_r||(_r={}));var zE;(function(e){e.API="api",e.Auth="auth",e.Analytics="analytics",e.DataStore="datastore",e.Geo="geo",e.InAppMessaging="inappmessaging",e.Interactions="interactions",e.Predictions="predictions",e.PubSub="pubsub",e.PushNotification="pushnotification",e.Storage="storage"})(zE||(zE={}));var LE;(function(e){e.Record="1",e.IdentifyUser="2"})(LE||(LE={}));var RE;(function(e){e.GraphQl="1",e.Get="2",e.Post="3",e.Put="4",e.Patch="5",e.Del="6",e.Head="7"})(RE||(RE={}));var DE;(function(e){e.SignUp="1",e.ConfirmSignUp="2",e.ResendSignUpCode="3",e.SignIn="4",e.FetchMFAPreference="6",e.UpdateMFAPreference="7",e.SetUpTOTP="10",e.VerifyTOTPSetup="11",e.ConfirmSignIn="12",e.DeleteUserAttributes="15",e.DeleteUser="16",e.UpdateUserAttributes="17",e.FetchUserAttributes="18",e.ConfirmUserAttribute="22",e.SignOut="26",e.UpdatePassword="27",e.ResetPassword="28",e.ConfirmResetPassword="29",e.FederatedSignIn="30",e.RememberDevice="32",e.ForgetDevice="33",e.FetchDevices="34",e.SendUserAttributeVerificationCode="35",e.SignInWithRedirect="36"})(DE||(DE={}));var OE;(function(e){e.Subscribe="1",e.GraphQl="2"})(OE||(OE={}));var BE;(function(e){e.SearchByText="0",e.SearchByCoordinates="1",e.SearchForSuggestions="2",e.SearchByPlaceId="3",e.SaveGeofences="4",e.GetGeofence="5",e.ListGeofences="6",e.DeleteGeofences="7"})(BE||(BE={}));var FE;(function(e){e.SyncMessages="1",e.IdentifyUser="2",e.NotifyMessageInteraction="3"})(FE||(FE={}));var NE;(function(e){e.None="0"})(NE||(NE={}));var UE;(function(e){e.Convert="1",e.Identify="2",e.Interpret="3"})(UE||(UE={}));var jE;(function(e){e.Subscribe="1"})(jE||(jE={}));var VE;(function(e){e.InitializePushNotifications="1",e.IdentifyUser="2"})(VE||(VE={}));var $E;(function(e){e.UploadData="1",e.DownloadData="2",e.List="3",e.Copy="4",e.Remove="5",e.GetProperties="6",e.GetUrl="7"})($E||($E={}));const b_=()=>typeof global<"u",fh=()=>typeof window<"u",hC=()=>typeof document<"u",dx=()=>typeof process<"u",Gp=(e,n)=>!!Object.keys(e).find(l=>l.startsWith(n));function AR(){const e=h=>h.startsWith("_react")||h.startsWith("__react"),n=h=>Object.keys(h).find(e),l=()=>Array.from(document.querySelectorAll("[id]"));return hC()&&l().some(n)}function CR(){return dx()&&typeof process.env<"u"&&!!Object.keys(process.env).find(e=>e.includes("react"))}function IR(){return fh()&&Gp(window,"__VUE")}function kR(){return b_()&&Gp(global,"__VUE")}function MR(){return fh()&&Gp(window,"__SVELTE")}function PR(){return dx()&&typeof process.env<"u"&&!!Object.keys(process.env).find(e=>e.includes("svelte"))}function zR(){return fh()&&window.next&&typeof window.next=="object"}function LR(){return b_()&&(Gp(global,"__next")||Gp(global,"__NEXT"))}function RR(){return fh()&&(window.__NUXT__!==void 0||window.$nuxt!==void 0)}function DR(){return b_()&&typeof global.__NUXT_PATHS__<"u"}function OR(){const e=!!(hC()&&document.querySelector("[ng-version]")),n=!!(fh()&&typeof window.ng<"u");return e||n}function BR(){var e;return dx()&&typeof process.env=="object"&&((e={}.npm_lifecycle_script)==null?void 0:e.startsWith("ng "))||!1}function FR(){return typeof navigator<"u"&&typeof navigator.product<"u"&&navigator.product==="ReactNative"}function NR(){return b_()&&typeof global.expo<"u"}function UR(){return fh()}const jR=[{platform:_r.Expo,detectionMethod:NR},{platform:_r.ReactNative,detectionMethod:FR},{platform:_r.NextJs,detectionMethod:zR},{platform:_r.Nuxt,detectionMethod:RR},{platform:_r.Angular,detectionMethod:OR},{platform:_r.React,detectionMethod:AR},{platform:_r.VueJs,detectionMethod:IR},{platform:_r.Svelte,detectionMethod:MR},{platform:_r.WebUnknown,detectionMethod:UR},{platform:_r.NextJsSSR,detectionMethod:LR},{platform:_r.NuxtSSR,detectionMethod:DR},{platform:_r.ReactSSR,detectionMethod:CR},{platform:_r.VueJsSSR,detectionMethod:kR},{platform:_r.AngularSSR,detectionMethod:BR},{platform:_r.SvelteSSR,detectionMethod:PR}];function VR(){var e;return((e=jR.find(n=>n.detectionMethod()))==null?void 0:e.platform)||_r.ServerSideUnknown}const $R=()=>typeof window<"u"&&typeof window.document<"u";class GR{constructor(){this.oAuthListener=void 0,this.resourcesConfig={},this.libraryOptions={},this.Auth=new TR}configure(n,l){const h=uC(n);this.resourcesConfig=h,l&&(this.libraryOptions=l),this.resourcesConfig=cC(this.resourcesConfig),this.Auth.configure(this.resourcesConfig.Auth,this.libraryOptions.Auth),t1.dispatch("core",{event:"configure",data:this.resourcesConfig},"Configure",Xg),this.notifyOAuthListener()}getConfig(){return this.resourcesConfig}[uR](n){var l,h,m;(h=(l=this.resourcesConfig.Auth)==null?void 0:l.Cognito.loginWith)!=null&&h.oauth?n((m=this.resourcesConfig.Auth)==null?void 0:m.Cognito):this.oAuthListener=n}notifyOAuthListener(){var n,l,h;!((l=(n=this.resourcesConfig.Auth)==null?void 0:n.Cognito.loginWith)!=null&&l.oauth)||!this.oAuthListener||(this.oAuthListener((h=this.resourcesConfig.Auth)==null?void 0:h.Cognito),this.oAuthListener=void 0)}}const Ws=new GR,E_=e=>{const{headers:n,statusCode:l}=e;return{...qR(e)?e.$metadata:{},httpStatusCode:l,requestId:n["x-amzn-requestid"]??n["x-amzn-request-id"]??n["x-amz-request-id"],extendedRequestId:n["x-amz-id-2"],cfId:n["x-amz-cf-id"]}},qR=e=>typeof(e==null?void 0:e.$metadata)=="object",nf=async e=>{if(!e||e.statusCode<300)return;const n=await T_(e),h=(E=>{const[s]=E.toString().split(/[,:]+/);return s.includes("#")?s.split("#")[1]:s})(e.headers["x-amzn-errortype"]??n.code??n.__type??"UnknownError"),m=n.message??n.Message??"Unknown error",v=new Error(m);return Object.assign(v,{name:h,$metadata:E_(e)})},T_=async e=>{if(!e.body)throw new Error("Missing response payload");const n=await e.body.json();return Object.assign(n,{$metadata:E_(e)})},px=(e,n,l,h)=>async(m,v)=>{const E={...h,...m},s=await E.endpointResolver(E,v),k=await n(v,s),D=await e(k,{...E});return l(D)},dC={id:"aws",outputs:{dnsSuffix:"amazonaws.com"},regionRegex:"^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$",regions:["aws-global"]},WR={partitions:[dC,{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn"},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:["aws-cn-global"]}]},pC=e=>{const{partitions:n}=WR;for(const{regions:l,outputs:h,regionRegex:m}of n){const v=new RegExp(m);if(l.includes(e)||v.test(e))return h.dnsSuffix}return dC.outputs.dnsSuffix},ZR=3,HR=({maxAttempts:e=ZR,retryDecider:n,computeDelay:l,abortSignal:h})=>{if(e<1)throw new Error("maxAttempts must be greater than 0");return(m,v)=>async function(s){let k,D=v.attemptsCount??0,V;const G=()=>{if(V)return GE(V,D),V;throw GE(k,D),k};for(;!(h!=null&&h.aborted)&&DD?v.attemptsCount??0:D+1,v.attemptsCount=D,await n(V,k)){if(!(h!=null&&h.aborted)&&D{if(n!=null&&n.aborted)return Promise.resolve();let l,h;const m=new Promise(v=>{h=v,l=setTimeout(v,e)});return n==null||n.addEventListener("abort",function v(E){clearTimeout(l),n==null||n.removeEventListener("abort",v),h()}),m},GE=(e,n)=>{Object.prototype.toString.call(e)==="[object Object]"&&(e.$metadata={...e.$metadata??{},attempts:n})},KR=({userAgentHeader:e="x-amz-user-agent",userAgentValue:n=""})=>l=>async function(m){if(n.trim().length===0)return await l(m);{const v=e.toLowerCase();return m.headers[v]=m.headers[v]?`${m.headers[v]} ${n}`:n,await l(m)}},fx=(e,n)=>(l,h)=>{const m={};let v=E=>e(E,h);for(let E=n.length-1;E>=0;E--){const s=n[E];v=s(h)(v,m)}return v(l)},K0=e=>{let n;return()=>(n||(n=e()),n)},YR=e=>!["HEAD","GET","DELETE"].includes(e.toUpperCase()),JR=async({url:e,method:n,headers:l,body:h},{abortSignal:m,cache:v,withCrossDomainCredentials:E})=>{var G;let s;try{s=await fetch(e,{method:n,headers:l,body:YR(n)?h:void 0,signal:m,cache:v,credentials:E?"include":"same-origin"})}catch(J){throw J instanceof TypeError?new bs({name:Vp.NetworkError,message:"A network error has occurred.",underlyingError:J}):J}const k={};(G=s.headers)==null||G.forEach((J,ve)=>{k[ve.toLowerCase()]=J});const D={statusCode:s.status,headers:k,body:null},V=Object.assign(s.body??{},{text:K0(()=>s.text()),blob:K0(()=>s.blob()),json:K0(()=>s.json())});return{...D,body:V}},fC=fx(JR,[KR,HR]),QR=5*60*1e3;function e3(e=QR){return h=>{const m=2**h*100+100*Math.random();return m>e?!1:m}}const qE=5*60*1e3,mC=e=>{const l=e3(qE)(e);return l===!1?qE:l},t3=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch","BadRequestException"],n3=e=>!!e&&t3.includes(e),gC=e=>async(n,l)=>{const h=l??await e(n)??void 0,m=(h==null?void 0:h.code)||(h==null?void 0:h.name),v=n==null?void 0:n.statusCode;return s3(l)||o3(v,m)||n3(m)||a3(v,m)},r3=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException"],i3=["TimeoutError","RequestTimeout","RequestTimeoutException"],o3=(e,n)=>e===429||!!n&&r3.includes(n),s3=e=>(e==null?void 0:e.name)==="Network error",a3=(e,n)=>!!e&&[500,502,503,504].includes(e)||!!n&&i3.includes(n),n1=URL,l3="6.6.0";let Ep;const _g=[];let Kg=!1;const c3=10,u3=10,h3=1e3,_C=()=>{var e;if(!Ep){if(Ep=VR(),Kg)for(;_g.length;)(e=_g.pop())==null||e();else _g.forEach(n=>{n()});WE(_r.ServerSideUnknown,c3),WE(_r.WebUnknown,u3)}return Ep},d3=e=>{Kg||_g.push(e)};function p3(){Ep=void 0}function WE(e,n){Ep===e&&!Kg&&setTimeout(()=>{p3(),Kg=!0,setTimeout(_C,h3)},n)}const f3={},m3=(e,n)=>{var l,h;return(h=(l=f3[e])==null?void 0:l[n])==null?void 0:h.additionalDetails},g3="aws-amplify",_3=({category:e,action:n}={})=>{const l=[[g3,l3]];if(e&&l.push([e,n]),l.push(["framework",_C()]),e&&n){const h=m3(e,n);h&&h.forEach(m=>{l.push(m)})}return l},mx=e=>_3(e).map(([h,m])=>h&&m?`${h}/${m}`:h).join(" "),y3="cognito-identity",v3=({region:e})=>({url:new n1(`https://cognito-identity.${e}.${pC(e)}`)}),x3=()=>e=>async function(l){return l.headers["cache-control"]="no-store",e(l)},yC=fx(fC,[x3]),gx={service:y3,endpointResolver:v3,retryDecider:gC(nf),computeDelay:mC,userAgentValue:mx(),cache:"no-store"};d3(()=>{gx.userAgentValue=mx()});const vC=e=>({"content-type":"application/x-amz-json-1.1","x-amz-target":`AWSCognitoIdentityService.${e}`}),xC=({url:e},n,l)=>({headers:n,url:e,body:l,method:"POST"}),w3=(e,n)=>{const l=vC("GetId"),h=JSON.stringify(e);return xC(n,l,h)},b3=async e=>{if(e.statusCode>=300)throw await nf(e);return{IdentityId:(await T_(e)).IdentityId,$metadata:E_(e)}},E3=px(yC,w3,b3,gx),T3=(e,n)=>{const l=vC("GetCredentialsForIdentity"),h=JSON.stringify(e);return xC(n,l,h)},S3=async e=>{if(e.statusCode>=300)throw await nf(e);{const n=await T_(e);return{IdentityId:n.IdentityId,Credentials:A3(n.Credentials),$metadata:E_(e)}}},A3=({AccessKeyId:e,SecretKey:n,SessionToken:l,Expiration:h}={})=>({AccessKeyId:e,SecretKey:n,SessionToken:l,Expiration:h&&new Date(h*1e3)}),ZE=px(yC,T3,S3,gx);class Km extends bs{constructor(){super({name:Vp.PlatformNotSupported,message:"Function not supported on current platform"})}}class wC{constructor(n){this.storage=n}async setItem(n,l){if(!this.storage)throw new Km;this.storage.setItem(n,l)}async getItem(n){if(!this.storage)throw new Km;return this.storage.getItem(n)}async removeItem(n){if(!this.storage)throw new Km;this.storage.removeItem(n)}async clear(){if(!this.storage)throw new Km;this.storage.clear()}}class bC{constructor(){this.storage=new Map}get length(){return this.storage.size}key(n){return n>this.length-1?null:Array.from(this.storage.keys())[n]}setItem(n,l){this.storage.set(n,l)}getItem(n){return this.storage.get(n)??null}removeItem(n){this.storage.delete(n)}clear(){this.storage.clear()}}const C3=()=>typeof window<"u"&&window.localStorage?window.localStorage:new bC,I3=()=>typeof window<"u"&&window.sessionStorage?window.sessionStorage:new bC;class k3 extends wC{constructor(){super(C3())}}class M3 extends wC{constructor(){super(I3())}}/*! js-cookie v3.0.5 | MIT */function Ym(e){for(var n=1;n"u")){E=Ym({},n,E),typeof E.expires=="number"&&(E.expires=new Date(Date.now()+E.expires*864e5)),E.expires&&(E.expires=E.expires.toUTCString()),m=encodeURIComponent(m).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var k in E)E[k]&&(s+="; "+k,E[k]!==!0&&(s+="="+E[k].split(";")[0]));return document.cookie=m+"="+e.write(v,m)+s}}function h(m){if(!(typeof document>"u"||arguments.length&&!m)){for(var v=document.cookie?document.cookie.split("; "):[],E={},s=0;sthis.removeItem(h));await Promise.all(l)}getData(){return{path:this.path,expires:this.expires,domain:this.domain,secure:this.secure,...this.sameSite&&{sameSite:this.sameSite}}}}const qp=new k3;new M3;const z3=e=>{let n;return async(...l)=>n||(n=new Promise((h,m)=>{e(...l).then(v=>{h(v)}).catch(v=>{m(v)}).finally(()=>{n=void 0})}),n)};class er extends bs{constructor(n){super(n),this.constructor=er,Object.setPrototypeOf(this,er.prototype)}}function EC(e){if(!e||e.name==="Error"||e instanceof TypeError)throw new er({name:Vp.Unknown,message:"An unknown error has occurred.",underlyingError:e})}const TC="cognito-idp",L3=({region:e})=>{var m;const n=(m=Ws.getConfig().Auth)==null?void 0:m.Cognito,l=n==null?void 0:n.userPoolEndpoint,h=new n1(`https://${TC}.${e}.${pC(e)}`);return{url:l?new n1(l):h}},R3=()=>(e,n)=>async function(h){return h.headers["cache-control"]="no-store",e(h)},D3=fx(fC,[R3]),O3={service:TC,endpointResolver:L3,retryDecider:gC(nf),computeDelay:mC,userAgentValue:mx(),cache:"no-store"},B3=e=>({"content-type":"application/x-amz-json-1.1","x-amz-target":`AWSCognitoIdentityProviderService.${e}`}),F3=({url:e},n,l)=>({headers:n,url:e,body:l,method:"POST"}),N3=e=>(n,l)=>{const h=B3(e),m=JSON.stringify(n);return F3(l,h,m)},U3=()=>async e=>{if(e.statusCode>=300){const n=await nf(e);throw EC(n),new er({name:n.name,message:n.message})}else return await T_(e)},j3=px(D3,N3("InitiateAuth"),U3(),O3);function V3(e){const n=e==null?void 0:e.split("_")[0];if(!e||e.indexOf("_")<0||!n||typeof n!="string")throw new er({name:"InvalidUserPoolId",message:"Invalid user pool id provided."});return n}function i1(e){if(!e||!e.includes(":"))throw new er({name:"InvalidIdentityPoolIdException",message:"Invalid identity pool id provided.",recoverySuggestion:"Make sure a valid identityPoolId is given in the config."});return e.split(":")[0]}const SC="UserUnAuthenticatedException",$3="InvalidRedirectException",G3="InvalidAppSchemeException",q3="InvalidPreferredRedirectUrlException";new er({name:$3,message:"signInRedirect or signOutRedirect had an invalid format or was not found.",recoverySuggestion:"Please make sure the signIn/Out redirect in your oauth config is valid."});new er({name:G3,message:"A valid non-http app scheme was not found in the config.",recoverySuggestion:"Please make sure a valid custom app scheme is present in the config."});new er({name:q3,message:"The given preferredRedirectUrl does not match any items in the redirectSignOutUrls array from the config.",recoverySuggestion:"Please make sure a matching preferredRedirectUrl is provided."});const W3="InvalidOriginException";new er({name:W3,message:"redirect is coming from a different origin. The oauth flow needs to be initiated from the same origin",recoverySuggestion:"Please call signInWithRedirect from the same origin."});const Z3="TokenRefreshException";function H3(e){if(!e||!e.idToken)throw new er({name:SC,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."})}const X3=new er({name:Z3,message:`Token refresh is not supported when authenticated with the 'implicit grant' (token) oauth flow. + Please change your oauth configuration to use 'code grant' flow.`,recoverySuggestion:`Please logout and change your Amplify configuration to use "code grant" flow. + E.g { responseType: 'code' }`}),K3=new er({name:SC,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."});function Y3(e){if(eD(e))throw X3;if(!Q3(e))throw K3}const J3={inflightOAuth:"inflightOAuth",oauthSignIn:"oauthSignIn",oauthPKCE:"oauthPKCE",oauthState:"oauthState"};function AC(e){return(e==null?void 0:e.accessToken)||(e==null?void 0:e.idToken)}function Q3(e){return AC(e)&&(e==null?void 0:e.refreshToken)}function eD(e){return AC(e)&&!(e!=null&&e.refreshToken)}function tD({username:e,userPoolId:n,userPoolClientId:l}){if(typeof window>"u")return;const h=window.AmazonCognitoAdvancedSecurityData;if(typeof h>"u")return;const m=h.getData(e,n,l);return m?{EncodedData:m}:{}}const nD=async({tokens:e,authConfig:n,username:l})=>{var J,ve;Ti(n==null?void 0:n.Cognito);const h=V3(n.Cognito.userPoolId);Y3(e);const m=e.refreshToken,v={REFRESH_TOKEN:m};(J=e.deviceMetadata)!=null&&J.deviceKey&&(v.DEVICE_KEY=e.deviceMetadata.deviceKey);const E=tD({username:l,userPoolId:n.Cognito.userPoolId,userPoolClientId:n.Cognito.userPoolClientId}),{AuthenticationResult:s}=await j3({region:h},{ClientId:(ve=n==null?void 0:n.Cognito)==null?void 0:ve.userPoolClientId,AuthFlow:"REFRESH_TOKEN_AUTH",AuthParameters:v,UserContextData:E}),k=$p((s==null?void 0:s.AccessToken)??""),D=s!=null&&s.IdToken?$p(s.IdToken):void 0,{iat:V}=k.payload;if(!V)throw new er({name:"iatNotFoundException",message:"iat not found in access token"});const G=V*1e3-new Date().getTime();return{accessToken:k,idToken:D,clockDrift:G,refreshToken:m,username:l}},rD=z3(nD),iD={accessToken:"accessToken",idToken:"idToken",oidcProvider:"oidcProvider",clockDrift:"clockDrift",refreshToken:"refreshToken",deviceKey:"deviceKey",randomPasswordKey:"randomPasswordKey",deviceGroupKey:"deviceGroupKey",signInDetails:"signInDetails",oauthMetadata:"oauthMetadata"};var Yg;(function(e){e.InvalidAuthTokens="InvalidAuthTokens"})(Yg||(Yg={}));const oD={[Yg.InvalidAuthTokens]:{message:"Invalid tokens.",recoverySuggestion:"Make sure the tokens are valid."}},sD=aC(oD);class aD{constructor(){this.name="CognitoIdentityServiceProvider"}getKeyValueStorage(){if(!this.keyValueStorage)throw new er({name:"KeyValueStorageNotFoundException",message:"KeyValueStorage was not found in TokenStore"});return this.keyValueStorage}setKeyValueStorage(n){this.keyValueStorage=n}setAuthConfig(n){this.authConfig=n}async loadTokens(){try{const n=await this.getAuthKeys(),l=await this.getKeyValueStorage().getItem(n.accessToken);if(!l)throw new er({name:"NoSessionFoundException",message:"Auth session was not found. Make sure to call signIn."});const h=$p(l),m=await this.getKeyValueStorage().getItem(n.idToken),v=m?$p(m):void 0,E=await this.getKeyValueStorage().getItem(n.refreshToken)??void 0,s=await this.getKeyValueStorage().getItem(n.clockDrift)??"0",k=Number.parseInt(s),D=await this.getKeyValueStorage().getItem(n.signInDetails),V={accessToken:h,idToken:v,refreshToken:E,deviceMetadata:await this.getDeviceMetadata()??void 0,clockDrift:k,username:await this.getLastAuthUser()};return D&&(V.signInDetails=JSON.parse(D)),V}catch{return null}}async storeTokens(n){sD(n!==void 0,Yg.InvalidAuthTokens),await this.clearTokens();const l=n.username;await this.getKeyValueStorage().setItem(this.getLastAuthUserKey(),l);const h=await this.getAuthKeys();await this.getKeyValueStorage().setItem(h.accessToken,n.accessToken.toString()),n.idToken&&await this.getKeyValueStorage().setItem(h.idToken,n.idToken.toString()),n.refreshToken&&await this.getKeyValueStorage().setItem(h.refreshToken,n.refreshToken),n.deviceMetadata&&(n.deviceMetadata.deviceKey&&await this.getKeyValueStorage().setItem(h.deviceKey,n.deviceMetadata.deviceKey),n.deviceMetadata.deviceGroupKey&&await this.getKeyValueStorage().setItem(h.deviceGroupKey,n.deviceMetadata.deviceGroupKey),await this.getKeyValueStorage().setItem(h.randomPasswordKey,n.deviceMetadata.randomPassword)),n.signInDetails&&await this.getKeyValueStorage().setItem(h.signInDetails,JSON.stringify(n.signInDetails)),await this.getKeyValueStorage().setItem(h.clockDrift,`${n.clockDrift}`)}async clearTokens(){const n=await this.getAuthKeys();await Promise.all([this.getKeyValueStorage().removeItem(n.accessToken),this.getKeyValueStorage().removeItem(n.idToken),this.getKeyValueStorage().removeItem(n.clockDrift),this.getKeyValueStorage().removeItem(n.refreshToken),this.getKeyValueStorage().removeItem(n.signInDetails),this.getKeyValueStorage().removeItem(this.getLastAuthUserKey()),this.getKeyValueStorage().removeItem(n.oauthMetadata)])}async getDeviceMetadata(n){const l=await this.getAuthKeys(n),h=await this.getKeyValueStorage().getItem(l.deviceKey),m=await this.getKeyValueStorage().getItem(l.deviceGroupKey),v=await this.getKeyValueStorage().getItem(l.randomPasswordKey);return v&&m&&h?{deviceKey:h,deviceGroupKey:m,randomPassword:v}:null}async clearDeviceMetadata(n){const l=await this.getAuthKeys(n);await Promise.all([this.getKeyValueStorage().removeItem(l.deviceKey),this.getKeyValueStorage().removeItem(l.deviceGroupKey),this.getKeyValueStorage().removeItem(l.randomPasswordKey)])}async getAuthKeys(n){var h;Ti((h=this.authConfig)==null?void 0:h.Cognito);const l=n??await this.getLastAuthUser();return lD(this.name,`${this.authConfig.Cognito.userPoolClientId}.${l}`)}getLastAuthUserKey(){var l;Ti((l=this.authConfig)==null?void 0:l.Cognito);const n=this.authConfig.Cognito.userPoolClientId;return`${this.name}.${n}.LastAuthUser`}async getLastAuthUser(){return await this.getKeyValueStorage().getItem(this.getLastAuthUserKey())??"username"}async setOAuthMetadata(n){const{oauthMetadata:l}=await this.getAuthKeys();await this.getKeyValueStorage().setItem(l,JSON.stringify(n))}async getOAuthMetadata(){const{oauthMetadata:n}=await this.getAuthKeys(),l=await this.getKeyValueStorage().getItem(n);return l&&JSON.parse(l)}}const lD=(e,n)=>_x(iD)(`${e}`,n);function _x(e){const n=Object.values({...e});return(l,h)=>n.reduce((m,v)=>({...m,[v]:`${l}.${h}.${v}`}),{})}const XE="amplify-signin-with-hostedUI",fs="CognitoIdentityServiceProvider";class cD{constructor(n){this.keyValueStorage=n}async clearOAuthInflightData(){Ti(this.cognitoConfig);const n=ms(fs,this.cognitoConfig.userPoolClientId);await Promise.all([this.keyValueStorage.removeItem(n.inflightOAuth),this.keyValueStorage.removeItem(n.oauthPKCE),this.keyValueStorage.removeItem(n.oauthState)])}async clearOAuthData(){Ti(this.cognitoConfig);const n=ms(fs,this.cognitoConfig.userPoolClientId);return await this.clearOAuthInflightData(),await this.keyValueStorage.removeItem(XE),this.keyValueStorage.removeItem(n.oauthSignIn)}loadOAuthState(){Ti(this.cognitoConfig);const n=ms(fs,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.getItem(n.oauthState)}storeOAuthState(n){Ti(this.cognitoConfig);const l=ms(fs,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.setItem(l.oauthState,n)}loadPKCE(){Ti(this.cognitoConfig);const n=ms(fs,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.getItem(n.oauthPKCE)}storePKCE(n){Ti(this.cognitoConfig);const l=ms(fs,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.setItem(l.oauthPKCE,n)}setAuthConfig(n){this.cognitoConfig=n}async loadOAuthInFlight(){Ti(this.cognitoConfig);const n=ms(fs,this.cognitoConfig.userPoolClientId);return await this.keyValueStorage.getItem(n.inflightOAuth)==="true"}async storeOAuthInFlight(n){Ti(this.cognitoConfig);const l=ms(fs,this.cognitoConfig.userPoolClientId);await this.keyValueStorage.setItem(l.inflightOAuth,`${n}`)}async loadOAuthSignIn(){var v;Ti(this.cognitoConfig);const n=ms(fs,this.cognitoConfig.userPoolClientId),l=await this.keyValueStorage.getItem(XE),[h,m]=((v=await this.keyValueStorage.getItem(n.oauthSignIn))==null?void 0:v.split(","))??[];return{isOAuthSignIn:h==="true"||l==="true",preferPrivateSession:m==="true"}}async storeOAuthSignIn(n,l=!1){Ti(this.cognitoConfig);const h=ms(fs,this.cognitoConfig.userPoolClientId);await this.keyValueStorage.setItem(h.oauthSignIn,`${n},${l}`)}}const ms=(e,n)=>_x(J3)(e,n),KE=new cD(qp),uD=[],hD=e=>{uD.push(e)};class dD{constructor(){this.waitForInflightOAuth=$R()?async()=>{if(await KE.loadOAuthInFlight())return this.inflightPromise?this.inflightPromise:(this.inflightPromise=new Promise((n,l)=>{hD(n)}),this.inflightPromise)}:async()=>{}}setAuthConfig(n){KE.setAuthConfig(n.Cognito),this.authConfig=n}setTokenRefresher(n){this.tokenRefresher=n}setAuthTokenStore(n){this.tokenStore=n}getTokenStore(){if(!this.tokenStore)throw new er({name:"EmptyTokenStoreException",message:"TokenStore not set"});return this.tokenStore}getTokenRefresher(){if(!this.tokenRefresher)throw new er({name:"EmptyTokenRefresherException",message:"TokenRefresher not set"});return this.tokenRefresher}async getTokens(n){var E,s,k,D,V;let l;try{Ti((E=this.authConfig)==null?void 0:E.Cognito)}catch{return null}await this.waitForInflightOAuth(),this.inflightPromise=void 0,l=await this.getTokenStore().loadTokens();const h=await this.getTokenStore().getLastAuthUser();if(l===null)return null;const m=!!(l!=null&&l.idToken)&&PE({expiresAt:(((k=(s=l.idToken)==null?void 0:s.payload)==null?void 0:k.exp)??0)*1e3,clockDrift:l.clockDrift??0}),v=PE({expiresAt:(((V=(D=l.accessToken)==null?void 0:D.payload)==null?void 0:V.exp)??0)*1e3,clockDrift:l.clockDrift??0});return(n!=null&&n.forceRefresh||m||v)&&(l=await this.refreshTokens({tokens:l,username:h}),l===null)?null:{accessToken:l==null?void 0:l.accessToken,idToken:l==null?void 0:l.idToken,signInDetails:l==null?void 0:l.signInDetails}}async refreshTokens({tokens:n,username:l}){try{const{signInDetails:h}=n,m=await this.getTokenRefresher()({tokens:n,authConfig:this.authConfig,username:l});return m.signInDetails=h,await this.setTokens({tokens:m}),t1.dispatch("auth",{event:"tokenRefresh"},"Auth",Xg),m}catch(h){return this.handleErrors(h)}}handleErrors(n){if(EC(n),n.message!=="Network error"&&this.clearTokens(),t1.dispatch("auth",{event:"tokenRefresh_failure",data:{error:n}},"Auth",Xg),n.name.startsWith("NotAuthorizedException"))return null;throw n}async setTokens({tokens:n}){return this.getTokenStore().storeTokens(n)}async clearTokens(){return this.getTokenStore().clearTokens()}getDeviceMetadata(n){return this.getTokenStore().getDeviceMetadata(n)}clearDeviceMetadata(n){return this.getTokenStore().clearDeviceMetadata(n)}setOAuthMetadata(n){return this.getTokenStore().setOAuthMetadata(n)}getOAuthMetadata(){return this.getTokenStore().getOAuthMetadata()}}class pD{constructor(){this.authTokenStore=new aD,this.authTokenStore.setKeyValueStorage(qp),this.tokenOrchestrator=new dD,this.tokenOrchestrator.setAuthTokenStore(this.authTokenStore),this.tokenOrchestrator.setTokenRefresher(rD)}getTokens({forceRefresh:n}={forceRefresh:!1}){return this.tokenOrchestrator.getTokens({forceRefresh:n})}setKeyValueStorage(n){this.authTokenStore.setKeyValueStorage(n)}setAuthConfig(n){this.authTokenStore.setAuthConfig(n),this.tokenOrchestrator.setAuthConfig(n)}}const Qm=new pD,fD={identityId:"identityId"},mD=new Zo("DefaultIdentityIdStore");class gD{setAuthConfig(n){gg(n.Cognito),this.authConfig=n,this._authKeys=_D("Cognito",n.Cognito.identityPoolId)}constructor(n){this._authKeys={},this.keyValueStorage=n}async loadIdentityId(){var n;gg((n=this.authConfig)==null?void 0:n.Cognito);try{if(this._primaryIdentityId)return{id:this._primaryIdentityId,type:"primary"};{const l=await this.keyValueStorage.getItem(this._authKeys.identityId);return l?{id:l,type:"guest"}:null}}catch(l){return mD.log("Error getting stored IdentityId.",l),null}}async storeIdentityId(n){var l;gg((l=this.authConfig)==null?void 0:l.Cognito),n.type==="guest"?(this.keyValueStorage.setItem(this._authKeys.identityId,n.id),this._primaryIdentityId=void 0):(this._primaryIdentityId=n.id,this.keyValueStorage.removeItem(this._authKeys.identityId))}async clearIdentityId(){this._primaryIdentityId=void 0,await this.keyValueStorage.removeItem(this._authKeys.identityId)}}const _D=(e,n)=>_x(fD)(`com.amplify.${e}`,n);function CC(e){const n=$p(e).payload.iss,l={};if(!n)throw new er({name:"InvalidIdTokenException",message:"Invalid Idtoken."});const h=n.replace(/(^\w+:|^)\/\//,"");return l[h]=e,l}const yD=new Zo("CognitoIdentityIdProvider");async function vD({tokens:e,authConfig:n,identityIdStore:l}){l.setAuthConfig({Cognito:n});let h=await l.loadIdentityId();if(e){if(h&&h.type==="primary")return h.id;{const m=e.idToken?CC(e.idToken.toString()):{},v=await YE(m,n);h&&h.id===v&&yD.debug(`The guest identity ${h.id} has become the primary identity.`),h={id:v,type:"primary"}}}else{if(h&&h.type==="guest")return h.id;h={id:await YE({},n),type:"guest"}}return l.storeIdentityId(h),h.id}async function YE(e,n){const l=n==null?void 0:n.identityPoolId,h=i1(l),m=(await E3({region:h},{IdentityPoolId:l,Logins:e})).IdentityId;if(!m)throw new er({name:"GetIdResponseException",message:"Received undefined response from getId operation",recoverySuggestion:"Make sure to pass a valid identityPoolId in the configuration."});return m}const eg=new Zo("CognitoCredentialsProvider"),JE=50*60*1e3;class xD{constructor(n){this._nextCredentialsRefresh=0,this._identityIdStore=n}async clearCredentialsAndIdentityId(){eg.debug("Clearing out credentials and identityId"),this._credentialsAndIdentityId=void 0,await this._identityIdStore.clearIdentityId()}async clearCredentials(){eg.debug("Clearing out in-memory credentials"),this._credentialsAndIdentityId=void 0}async getCredentialsAndIdentityId(n){const l=n.authenticated,{tokens:h}=n,{authConfig:m}=n;try{gg(m==null?void 0:m.Cognito)}catch{return}if(!l&&!m.Cognito.allowGuestAccess)return;const{forceRefresh:v}=n,E=this.hasTokenChanged(h),s=await vD({tokens:h,authConfig:m.Cognito,identityIdStore:this._identityIdStore});return(v||E)&&this.clearCredentials(),l?(H3(h),this.credsForOIDCTokens(m.Cognito,h,s)):this.getGuestCredentials(s,m.Cognito)}async getGuestCredentials(n,l){if(this._credentialsAndIdentityId&&!this.isPastTTL()&&this._credentialsAndIdentityId.isAuthenticatedCreds===!1)return eg.info("returning stored credentials as they neither past TTL nor expired."),this._credentialsAndIdentityId;this.clearCredentials();const h=i1(l.identityPoolId),m=await ZE({region:h},{IdentityId:n});if(m.Credentials&&m.Credentials.AccessKeyId&&m.Credentials.SecretKey){this._nextCredentialsRefresh=new Date().getTime()+JE;const v={credentials:{accessKeyId:m.Credentials.AccessKeyId,secretAccessKey:m.Credentials.SecretKey,sessionToken:m.Credentials.SessionToken,expiration:m.Credentials.Expiration},identityId:n},E=m.IdentityId;return E&&(v.identityId=E,this._identityIdStore.storeIdentityId({id:E,type:"guest"})),this._credentialsAndIdentityId={...v,isAuthenticatedCreds:!1},v}else throw new er({name:"CredentialsNotFoundException",message:"Cognito did not respond with either Credentials, AccessKeyId or SecretKey."})}async credsForOIDCTokens(n,l,h){var s;if(this._credentialsAndIdentityId&&!this.isPastTTL()&&this._credentialsAndIdentityId.isAuthenticatedCreds===!0)return eg.debug("returning stored credentials as they neither past TTL nor expired."),this._credentialsAndIdentityId;this.clearCredentials();const m=l.idToken?CC(l.idToken.toString()):{},v=i1(n.identityPoolId),E=await ZE({region:v},{IdentityId:h,Logins:m});if(E.Credentials&&E.Credentials.AccessKeyId&&E.Credentials.SecretKey){const k={credentials:{accessKeyId:E.Credentials.AccessKeyId,secretAccessKey:E.Credentials.SecretKey,sessionToken:E.Credentials.SessionToken,expiration:E.Credentials.Expiration},identityId:h};this._credentialsAndIdentityId={...k,isAuthenticatedCreds:!0,associatedIdToken:(s=l.idToken)==null?void 0:s.toString()},this._nextCredentialsRefresh=new Date().getTime()+JE;const D=E.IdentityId;return D&&(k.identityId=D,this._identityIdStore.storeIdentityId({id:D,type:"primary"})),k}else throw new er({name:"CredentialsException",message:"Cognito did not respond with either Credentials, AccessKeyId or SecretKey."})}isPastTTL(){return this._nextCredentialsRefresh===void 0?!0:this._nextCredentialsRefresh<=Date.now()}hasTokenChanged(n){var l,h;return!!n&&!!((l=this._credentialsAndIdentityId)!=null&&l.associatedIdToken)&&((h=n.idToken)==null?void 0:h.toString())!==this._credentialsAndIdentityId.associatedIdToken}}const wD=new xD(new gD(qp)),bD={configure(e,n){const l=uC(e);if(!l.Auth){Ws.configure(l,n);return}if(n!=null&&n.Auth){Ws.configure(l,n);return}if(!Ws.libraryOptions.Auth){Qm.setAuthConfig(l.Auth),Qm.setKeyValueStorage(n!=null&&n.ssr?new HE({sameSite:"lax"}):qp),Ws.configure(l,{...n,Auth:{tokenProvider:Qm,credentialsProvider:wD}});return}if(n){n.ssr!==void 0&&Qm.setKeyValueStorage(n.ssr?new HE({sameSite:"lax"}):qp),Ws.configure(l,{Auth:Ws.libraryOptions.Auth,...n});return}Ws.configure(l)},getConfig(){return Ws.getConfig()}};/* + * Frontend UI component library for the CORI Data API + * {@link https://github.com/ruralinnovation/cori.data.api} + * @copyright Rural Innovation Strategies, Inc. + * @license ISC + */var ED={oauth:{domain:"authcori.auth.us-east-1.amazoncognito.com"}},TD="us-east-1",SD="us-east-1_QeA4600FA",AD="5eusi16g0o2q1g1rr5ehgudodm",CD="authcori.auth.us-east-1.amazoncognito.com",ID="us-east-1",kD="us-east-1:2194a76a-fa3d-4c33-999e-e3c4b2b049ee",MD=["EMAIL"],PD=["EMAIL","OPENID"],zD=["EMAIL","OPENID"],LD={passwordPolicyMinLength:8,passwordPolicyCharacters:["REQUIRES_NUMBERS","REQUIRES_LOWERCASE","REQUIRES_UPPERCASE","REQUIRES_SYMBOLS"]},RD="https://bdkxhfgus5dztobic7gvn5ymue.appsync-api.us-east-1.amazonaws.com/graphql",DD="us-east-1",OD="da2-yexc3mow25fc3amaendi4vscuq",BD="API_KEY",FD="AMAZON_COGNITO_USER_POOLS,AWS_IAM",ND={version:1,models:{Todo:{name:"Todo",fields:{id:{name:"id",isArray:!1,type:"ID",isRequired:!0,attributes:[]},content:{name:"content",isArray:!1,type:"String",isRequired:!1,attributes:[]},owner:{name:"owner",isArray:!1,type:"String",isRequired:!1,attributes:[]},createdAt:{name:"createdAt",isArray:!1,type:"AWSDateTime",isRequired:!0,attributes:[]},updatedAt:{name:"updatedAt",isArray:!1,type:"AWSDateTime",isRequired:!0,attributes:[]}},syncable:!0,pluralName:"Todos",attributes:[{type:"model",properties:{}},{type:"key",properties:{fields:["id"]}},{type:"auth",properties:{rules:[{provider:"userPools",ownerField:"owner",allow:"owner",identityClaim:"cognito:username",operations:["create","update","delete","read"]},{allow:"public",operations:["read"]}]}}],primaryKeyInfo:{isCustomPrimaryKey:!1,primaryKeyFieldName:"id",sortKeyFieldNames:[]}}},enums:{},nonModels:{}},UD={Auth:ED,aws_project_region:TD,aws_user_pools_id:SD,aws_user_pools_web_client_id:AD,aws_cognito_domain:CD,aws_cognito_region:ID,aws_cognito_identity_pool_id:kD,aws_cognito_signup_attributes:MD,aws_cognito_username_attributes:PD,aws_cognito_verification_mechanisms:zD,aws_cognito_password_protection_settings:LD,aws_appsync_graphqlEndpoint:RD,aws_appsync_region:DD,aws_appsync_apiKey:OD,aws_appsync_authenticationType:BD,aws_appsync_additionalAuthenticationTypes:FD,modelIntrospection:ND};/* + * Frontend UI component library for the CORI Data API + * {@link https://github.com/ruralinnovation/cori.data.api} + * @copyright Rural Innovation Strategies, Inc. + * @license ISC + */bD.configure(UD);const jD={domain:void 0,region:void 0,identityPoolId:void 0,userPoolId:void 0,userPoolClientId:void 0};ut.createContext(jD);function IC(e,n){return function(){return e.apply(n,arguments)}}const{toString:VD}=Object.prototype,{getPrototypeOf:yx}=Object,S_=(e=>n=>{const l=VD.call(n);return e[l]||(e[l]=l.slice(8,-1).toLowerCase())})(Object.create(null)),Ko=e=>(e=e.toLowerCase(),n=>S_(n)===e),A_=e=>n=>typeof n===e,{isArray:mh}=Array,Wp=A_("undefined");function $D(e){return e!==null&&!Wp(e)&&e.constructor!==null&&!Wp(e.constructor)&&qi(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const kC=Ko("ArrayBuffer");function GD(e){let n;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?n=ArrayBuffer.isView(e):n=e&&e.buffer&&kC(e.buffer),n}const qD=A_("string"),qi=A_("function"),MC=A_("number"),C_=e=>e!==null&&typeof e=="object",WD=e=>e===!0||e===!1,yg=e=>{if(S_(e)!=="object")return!1;const n=yx(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},ZD=Ko("Date"),HD=Ko("File"),XD=Ko("Blob"),KD=Ko("FileList"),YD=e=>C_(e)&&qi(e.pipe),JD=e=>{let n;return e&&(typeof FormData=="function"&&e instanceof FormData||qi(e.append)&&((n=S_(e))==="formdata"||n==="object"&&qi(e.toString)&&e.toString()==="[object FormData]"))},QD=Ko("URLSearchParams"),[e5,t5,n5,r5]=["ReadableStream","Request","Response","Headers"].map(Ko),i5=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function rf(e,n,{allOwnKeys:l=!1}={}){if(e===null||typeof e>"u")return;let h,m;if(typeof e!="object"&&(e=[e]),mh(e))for(h=0,m=e.length;h0;)if(m=l[h],n===m.toLowerCase())return m;return null}const dc=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),zC=e=>!Wp(e)&&e!==dc;function o1(){const{caseless:e}=zC(this)&&this||{},n={},l=(h,m)=>{const v=e&&PC(n,m)||m;yg(n[v])&&yg(h)?n[v]=o1(n[v],h):yg(h)?n[v]=o1({},h):mh(h)?n[v]=h.slice():n[v]=h};for(let h=0,m=arguments.length;h(rf(n,(m,v)=>{l&&qi(m)?e[v]=IC(m,l):e[v]=m},{allOwnKeys:h}),e),s5=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),a5=(e,n,l,h)=>{e.prototype=Object.create(n.prototype,h),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:n.prototype}),l&&Object.assign(e.prototype,l)},l5=(e,n,l,h)=>{let m,v,E;const s={};if(n=n||{},e==null)return n;do{for(m=Object.getOwnPropertyNames(e),v=m.length;v-- >0;)E=m[v],(!h||h(E,e,n))&&!s[E]&&(n[E]=e[E],s[E]=!0);e=l!==!1&&yx(e)}while(e&&(!l||l(e,n))&&e!==Object.prototype);return n},c5=(e,n,l)=>{e=String(e),(l===void 0||l>e.length)&&(l=e.length),l-=n.length;const h=e.indexOf(n,l);return h!==-1&&h===l},u5=e=>{if(!e)return null;if(mh(e))return e;let n=e.length;if(!MC(n))return null;const l=new Array(n);for(;n-- >0;)l[n]=e[n];return l},h5=(e=>n=>e&&n instanceof e)(typeof Uint8Array<"u"&&yx(Uint8Array)),d5=(e,n)=>{const h=(e&&e[Symbol.iterator]).call(e);let m;for(;(m=h.next())&&!m.done;){const v=m.value;n.call(e,v[0],v[1])}},p5=(e,n)=>{let l;const h=[];for(;(l=e.exec(n))!==null;)h.push(l);return h},f5=Ko("HTMLFormElement"),m5=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(l,h,m){return h.toUpperCase()+m}),QE=(({hasOwnProperty:e})=>(n,l)=>e.call(n,l))(Object.prototype),g5=Ko("RegExp"),LC=(e,n)=>{const l=Object.getOwnPropertyDescriptors(e),h={};rf(l,(m,v)=>{let E;(E=n(m,v,e))!==!1&&(h[v]=E||m)}),Object.defineProperties(e,h)},_5=e=>{LC(e,(n,l)=>{if(qi(e)&&["arguments","caller","callee"].indexOf(l)!==-1)return!1;const h=e[l];if(qi(h)){if(n.enumerable=!1,"writable"in n){n.writable=!1;return}n.set||(n.set=()=>{throw Error("Can not rewrite read-only method '"+l+"'")})}})},y5=(e,n)=>{const l={},h=m=>{m.forEach(v=>{l[v]=!0})};return mh(e)?h(e):h(String(e).split(n)),l},v5=()=>{},x5=(e,n)=>e!=null&&Number.isFinite(e=+e)?e:n,Y0="abcdefghijklmnopqrstuvwxyz",eT="0123456789",RC={DIGIT:eT,ALPHA:Y0,ALPHA_DIGIT:Y0+Y0.toUpperCase()+eT},w5=(e=16,n=RC.ALPHA_DIGIT)=>{let l="";const{length:h}=n;for(;e--;)l+=n[Math.random()*h|0];return l};function b5(e){return!!(e&&qi(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const E5=e=>{const n=new Array(10),l=(h,m)=>{if(C_(h)){if(n.indexOf(h)>=0)return;if(!("toJSON"in h)){n[m]=h;const v=mh(h)?[]:{};return rf(h,(E,s)=>{const k=l(E,m+1);!Wp(k)&&(v[s]=k)}),n[m]=void 0,v}}return h};return l(e,0)},T5=Ko("AsyncFunction"),S5=e=>e&&(C_(e)||qi(e))&&qi(e.then)&&qi(e.catch),DC=((e,n)=>e?setImmediate:n?((l,h)=>(dc.addEventListener("message",({source:m,data:v})=>{m===dc&&v===l&&h.length&&h.shift()()},!1),m=>{h.push(m),dc.postMessage(l,"*")}))(`axios@${Math.random()}`,[]):l=>setTimeout(l))(typeof setImmediate=="function",qi(dc.postMessage)),A5=typeof queueMicrotask<"u"?queueMicrotask.bind(dc):typeof process<"u"&&process.nextTick||DC,Ne={isArray:mh,isArrayBuffer:kC,isBuffer:$D,isFormData:JD,isArrayBufferView:GD,isString:qD,isNumber:MC,isBoolean:WD,isObject:C_,isPlainObject:yg,isReadableStream:e5,isRequest:t5,isResponse:n5,isHeaders:r5,isUndefined:Wp,isDate:ZD,isFile:HD,isBlob:XD,isRegExp:g5,isFunction:qi,isStream:YD,isURLSearchParams:QD,isTypedArray:h5,isFileList:KD,forEach:rf,merge:o1,extend:o5,trim:i5,stripBOM:s5,inherits:a5,toFlatObject:l5,kindOf:S_,kindOfTest:Ko,endsWith:c5,toArray:u5,forEachEntry:d5,matchAll:p5,isHTMLForm:f5,hasOwnProperty:QE,hasOwnProp:QE,reduceDescriptors:LC,freezeMethods:_5,toObjectSet:y5,toCamelCase:m5,noop:v5,toFiniteNumber:x5,findKey:PC,global:dc,isContextDefined:zC,ALPHABET:RC,generateString:w5,isSpecCompliantForm:b5,toJSONObject:E5,isAsyncFn:T5,isThenable:S5,setImmediate:DC,asap:A5};function qt(e,n,l,h,m){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",n&&(this.code=n),l&&(this.config=l),h&&(this.request=h),m&&(this.response=m,this.status=m.status?m.status:null)}Ne.inherits(qt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Ne.toJSONObject(this.config),code:this.code,status:this.status}}});const OC=qt.prototype,BC={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{BC[e]={value:e}});Object.defineProperties(qt,BC);Object.defineProperty(OC,"isAxiosError",{value:!0});qt.from=(e,n,l,h,m,v)=>{const E=Object.create(OC);return Ne.toFlatObject(e,E,function(k){return k!==Error.prototype},s=>s!=="isAxiosError"),qt.call(E,e.message,n,l,h,m),E.cause=e,E.name=e.name,v&&Object.assign(E,v),E};const C5=null;function s1(e){return Ne.isPlainObject(e)||Ne.isArray(e)}function FC(e){return Ne.endsWith(e,"[]")?e.slice(0,-2):e}function tT(e,n,l){return e?e.concat(n).map(function(m,v){return m=FC(m),!l&&v?"["+m+"]":m}).join(l?".":""):n}function I5(e){return Ne.isArray(e)&&!e.some(s1)}const k5=Ne.toFlatObject(Ne,{},null,function(n){return/^is[A-Z]/.test(n)});function I_(e,n,l){if(!Ne.isObject(e))throw new TypeError("target must be an object");n=n||new FormData,l=Ne.toFlatObject(l,{metaTokens:!0,dots:!1,indexes:!1},!1,function(me,Ce){return!Ne.isUndefined(Ce[me])});const h=l.metaTokens,m=l.visitor||V,v=l.dots,E=l.indexes,k=(l.Blob||typeof Blob<"u"&&Blob)&&Ne.isSpecCompliantForm(n);if(!Ne.isFunction(m))throw new TypeError("visitor must be a function");function D(ae){if(ae===null)return"";if(Ne.isDate(ae))return ae.toISOString();if(!k&&Ne.isBlob(ae))throw new qt("Blob is not supported. Use a Buffer instead.");return Ne.isArrayBuffer(ae)||Ne.isTypedArray(ae)?k&&typeof Blob=="function"?new Blob([ae]):Buffer.from(ae):ae}function V(ae,me,Ce){let ie=ae;if(ae&&!Ce&&typeof ae=="object"){if(Ne.endsWith(me,"{}"))me=h?me:me.slice(0,-2),ae=JSON.stringify(ae);else if(Ne.isArray(ae)&&I5(ae)||(Ne.isFileList(ae)||Ne.endsWith(me,"[]"))&&(ie=Ne.toArray(ae)))return me=FC(me),ie.forEach(function(le,ze){!(Ne.isUndefined(le)||le===null)&&n.append(E===!0?tT([me],ze,v):E===null?me:me+"[]",D(le))}),!1}return s1(ae)?!0:(n.append(tT(Ce,me,v),D(ae)),!1)}const G=[],J=Object.assign(k5,{defaultVisitor:V,convertValue:D,isVisitable:s1});function ve(ae,me){if(!Ne.isUndefined(ae)){if(G.indexOf(ae)!==-1)throw Error("Circular reference detected in "+me.join("."));G.push(ae),Ne.forEach(ae,function(ie,te){(!(Ne.isUndefined(ie)||ie===null)&&m.call(n,ie,Ne.isString(te)?te.trim():te,me,J))===!0&&ve(ie,me?me.concat(te):[te])}),G.pop()}}if(!Ne.isObject(e))throw new TypeError("data must be an object");return ve(e),n}function nT(e){const n={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(h){return n[h]})}function vx(e,n){this._pairs=[],e&&I_(e,this,n)}const NC=vx.prototype;NC.append=function(n,l){this._pairs.push([n,l])};NC.toString=function(n){const l=n?function(h){return n.call(this,h,nT)}:nT;return this._pairs.map(function(m){return l(m[0])+"="+l(m[1])},"").join("&")};function M5(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function UC(e,n,l){if(!n)return e;const h=l&&l.encode||M5,m=l&&l.serialize;let v;if(m?v=m(n,l):v=Ne.isURLSearchParams(n)?n.toString():new vx(n,l).toString(h),v){const E=e.indexOf("#");E!==-1&&(e=e.slice(0,E)),e+=(e.indexOf("?")===-1?"?":"&")+v}return e}class P5{constructor(){this.handlers=[]}use(n,l,h){return this.handlers.push({fulfilled:n,rejected:l,synchronous:h?h.synchronous:!1,runWhen:h?h.runWhen:null}),this.handlers.length-1}eject(n){this.handlers[n]&&(this.handlers[n]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(n){Ne.forEach(this.handlers,function(h){h!==null&&n(h)})}}const rT=P5,jC={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},z5=typeof URLSearchParams<"u"?URLSearchParams:vx,L5=typeof FormData<"u"?FormData:null,R5=typeof Blob<"u"?Blob:null,D5={isBrowser:!0,classes:{URLSearchParams:z5,FormData:L5,Blob:R5},protocols:["http","https","file","blob","url","data"]},xx=typeof window<"u"&&typeof document<"u",a1=typeof navigator=="object"&&navigator||void 0,O5=xx&&(!a1||["ReactNative","NativeScript","NS"].indexOf(a1.product)<0),B5=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),F5=xx&&window.location.href||"http://localhost",N5=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:xx,hasStandardBrowserEnv:O5,hasStandardBrowserWebWorkerEnv:B5,navigator:a1,origin:F5},Symbol.toStringTag,{value:"Module"})),Mi={...N5,...D5};function U5(e,n){return I_(e,new Mi.classes.URLSearchParams,Object.assign({visitor:function(l,h,m,v){return Mi.isNode&&Ne.isBuffer(l)?(this.append(h,l.toString("base64")),!1):v.defaultVisitor.apply(this,arguments)}},n))}function j5(e){return Ne.matchAll(/\w+|\[(\w*)]/g,e).map(n=>n[0]==="[]"?"":n[1]||n[0])}function V5(e){const n={},l=Object.keys(e);let h;const m=l.length;let v;for(h=0;h=l.length;return E=!E&&Ne.isArray(m)?m.length:E,k?(Ne.hasOwnProp(m,E)?m[E]=[m[E],h]:m[E]=h,!s):((!m[E]||!Ne.isObject(m[E]))&&(m[E]=[]),n(l,h,m[E],v)&&Ne.isArray(m[E])&&(m[E]=V5(m[E])),!s)}if(Ne.isFormData(e)&&Ne.isFunction(e.entries)){const l={};return Ne.forEachEntry(e,(h,m)=>{n(j5(h),m,l,0)}),l}return null}function $5(e,n,l){if(Ne.isString(e))try{return(n||JSON.parse)(e),Ne.trim(e)}catch(h){if(h.name!=="SyntaxError")throw h}return(l||JSON.stringify)(e)}const wx={transitional:jC,adapter:["xhr","http","fetch"],transformRequest:[function(n,l){const h=l.getContentType()||"",m=h.indexOf("application/json")>-1,v=Ne.isObject(n);if(v&&Ne.isHTMLForm(n)&&(n=new FormData(n)),Ne.isFormData(n))return m?JSON.stringify(VC(n)):n;if(Ne.isArrayBuffer(n)||Ne.isBuffer(n)||Ne.isStream(n)||Ne.isFile(n)||Ne.isBlob(n)||Ne.isReadableStream(n))return n;if(Ne.isArrayBufferView(n))return n.buffer;if(Ne.isURLSearchParams(n))return l.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),n.toString();let s;if(v){if(h.indexOf("application/x-www-form-urlencoded")>-1)return U5(n,this.formSerializer).toString();if((s=Ne.isFileList(n))||h.indexOf("multipart/form-data")>-1){const k=this.env&&this.env.FormData;return I_(s?{"files[]":n}:n,k&&new k,this.formSerializer)}}return v||m?(l.setContentType("application/json",!1),$5(n)):n}],transformResponse:[function(n){const l=this.transitional||wx.transitional,h=l&&l.forcedJSONParsing,m=this.responseType==="json";if(Ne.isResponse(n)||Ne.isReadableStream(n))return n;if(n&&Ne.isString(n)&&(h&&!this.responseType||m)){const E=!(l&&l.silentJSONParsing)&&m;try{return JSON.parse(n)}catch(s){if(E)throw s.name==="SyntaxError"?qt.from(s,qt.ERR_BAD_RESPONSE,this,null,this.response):s}}return n}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Mi.classes.FormData,Blob:Mi.classes.Blob},validateStatus:function(n){return n>=200&&n<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Ne.forEach(["delete","get","head","post","put","patch"],e=>{wx.headers[e]={}});const bx=wx,G5=Ne.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),q5=e=>{const n={};let l,h,m;return e&&e.split(` +`).forEach(function(E){m=E.indexOf(":"),l=E.substring(0,m).trim().toLowerCase(),h=E.substring(m+1).trim(),!(!l||n[l]&&G5[l])&&(l==="set-cookie"?n[l]?n[l].push(h):n[l]=[h]:n[l]=n[l]?n[l]+", "+h:h)}),n},iT=Symbol("internals");function ap(e){return e&&String(e).trim().toLowerCase()}function vg(e){return e===!1||e==null?e:Ne.isArray(e)?e.map(vg):String(e)}function W5(e){const n=Object.create(null),l=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let h;for(;h=l.exec(e);)n[h[1]]=h[2];return n}const Z5=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function J0(e,n,l,h,m){if(Ne.isFunction(h))return h.call(this,n,l);if(m&&(n=l),!!Ne.isString(n)){if(Ne.isString(h))return n.indexOf(h)!==-1;if(Ne.isRegExp(h))return h.test(n)}}function H5(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(n,l,h)=>l.toUpperCase()+h)}function X5(e,n){const l=Ne.toCamelCase(" "+n);["get","set","has"].forEach(h=>{Object.defineProperty(e,h+l,{value:function(m,v,E){return this[h].call(this,n,m,v,E)},configurable:!0})})}class k_{constructor(n){n&&this.set(n)}set(n,l,h){const m=this;function v(s,k,D){const V=ap(k);if(!V)throw new Error("header name must be a non-empty string");const G=Ne.findKey(m,V);(!G||m[G]===void 0||D===!0||D===void 0&&m[G]!==!1)&&(m[G||k]=vg(s))}const E=(s,k)=>Ne.forEach(s,(D,V)=>v(D,V,k));if(Ne.isPlainObject(n)||n instanceof this.constructor)E(n,l);else if(Ne.isString(n)&&(n=n.trim())&&!Z5(n))E(q5(n),l);else if(Ne.isHeaders(n))for(const[s,k]of n.entries())v(k,s,h);else n!=null&&v(l,n,h);return this}get(n,l){if(n=ap(n),n){const h=Ne.findKey(this,n);if(h){const m=this[h];if(!l)return m;if(l===!0)return W5(m);if(Ne.isFunction(l))return l.call(this,m,h);if(Ne.isRegExp(l))return l.exec(m);throw new TypeError("parser must be boolean|regexp|function")}}}has(n,l){if(n=ap(n),n){const h=Ne.findKey(this,n);return!!(h&&this[h]!==void 0&&(!l||J0(this,this[h],h,l)))}return!1}delete(n,l){const h=this;let m=!1;function v(E){if(E=ap(E),E){const s=Ne.findKey(h,E);s&&(!l||J0(h,h[s],s,l))&&(delete h[s],m=!0)}}return Ne.isArray(n)?n.forEach(v):v(n),m}clear(n){const l=Object.keys(this);let h=l.length,m=!1;for(;h--;){const v=l[h];(!n||J0(this,this[v],v,n,!0))&&(delete this[v],m=!0)}return m}normalize(n){const l=this,h={};return Ne.forEach(this,(m,v)=>{const E=Ne.findKey(h,v);if(E){l[E]=vg(m),delete l[v];return}const s=n?H5(v):String(v).trim();s!==v&&delete l[v],l[s]=vg(m),h[s]=!0}),this}concat(...n){return this.constructor.concat(this,...n)}toJSON(n){const l=Object.create(null);return Ne.forEach(this,(h,m)=>{h!=null&&h!==!1&&(l[m]=n&&Ne.isArray(h)?h.join(", "):h)}),l}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([n,l])=>n+": "+l).join(` +`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(n){return n instanceof this?n:new this(n)}static concat(n,...l){const h=new this(n);return l.forEach(m=>h.set(m)),h}static accessor(n){const h=(this[iT]=this[iT]={accessors:{}}).accessors,m=this.prototype;function v(E){const s=ap(E);h[s]||(X5(m,E),h[s]=!0)}return Ne.isArray(n)?n.forEach(v):v(n),this}}k_.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Ne.reduceDescriptors(k_.prototype,({value:e},n)=>{let l=n[0].toUpperCase()+n.slice(1);return{get:()=>e,set(h){this[l]=h}}});Ne.freezeMethods(k_);const Ho=k_;function Q0(e,n){const l=this||bx,h=n||l,m=Ho.from(h.headers);let v=h.data;return Ne.forEach(e,function(s){v=s.call(l,v,m.normalize(),n?n.status:void 0)}),m.normalize(),v}function $C(e){return!!(e&&e.__CANCEL__)}function gh(e,n,l){qt.call(this,e??"canceled",qt.ERR_CANCELED,n,l),this.name="CanceledError"}Ne.inherits(gh,qt,{__CANCEL__:!0});function GC(e,n,l){const h=l.config.validateStatus;!l.status||!h||h(l.status)?e(l):n(new qt("Request failed with status code "+l.status,[qt.ERR_BAD_REQUEST,qt.ERR_BAD_RESPONSE][Math.floor(l.status/100)-4],l.config,l.request,l))}function K5(e){const n=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return n&&n[1]||""}function Y5(e,n){e=e||10;const l=new Array(e),h=new Array(e);let m=0,v=0,E;return n=n!==void 0?n:1e3,function(k){const D=Date.now(),V=h[v];E||(E=D),l[m]=k,h[m]=D;let G=v,J=0;for(;G!==m;)J+=l[G++],G=G%e;if(m=(m+1)%e,m===v&&(v=(v+1)%e),D-E{l=V,m=null,v&&(clearTimeout(v),v=null),e.apply(null,D)};return[(...D)=>{const V=Date.now(),G=V-l;G>=h?E(D,V):(m=D,v||(v=setTimeout(()=>{v=null,E(m)},h-G)))},()=>m&&E(m)]}const Jg=(e,n,l=3)=>{let h=0;const m=Y5(50,250);return J5(v=>{const E=v.loaded,s=v.lengthComputable?v.total:void 0,k=E-h,D=m(k),V=E<=s;h=E;const G={loaded:E,total:s,progress:s?E/s:void 0,bytes:k,rate:D||void 0,estimated:D&&s&&V?(s-E)/D:void 0,event:v,lengthComputable:s!=null,[n?"download":"upload"]:!0};e(G)},l)},oT=(e,n)=>{const l=e!=null;return[h=>n[0]({lengthComputable:l,total:e,loaded:h}),n[1]]},sT=e=>(...n)=>Ne.asap(()=>e(...n)),Q5=Mi.hasStandardBrowserEnv?function(){const n=Mi.navigator&&/(msie|trident)/i.test(Mi.navigator.userAgent),l=document.createElement("a");let h;function m(v){let E=v;return n&&(l.setAttribute("href",E),E=l.href),l.setAttribute("href",E),{href:l.href,protocol:l.protocol?l.protocol.replace(/:$/,""):"",host:l.host,search:l.search?l.search.replace(/^\?/,""):"",hash:l.hash?l.hash.replace(/^#/,""):"",hostname:l.hostname,port:l.port,pathname:l.pathname.charAt(0)==="/"?l.pathname:"/"+l.pathname}}return h=m(window.location.href),function(E){const s=Ne.isString(E)?m(E):E;return s.protocol===h.protocol&&s.host===h.host}}():function(){return function(){return!0}}(),eO=Mi.hasStandardBrowserEnv?{write(e,n,l,h,m,v){const E=[e+"="+encodeURIComponent(n)];Ne.isNumber(l)&&E.push("expires="+new Date(l).toGMTString()),Ne.isString(h)&&E.push("path="+h),Ne.isString(m)&&E.push("domain="+m),v===!0&&E.push("secure"),document.cookie=E.join("; ")},read(e){const n=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function tO(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function nO(e,n){return n?e.replace(/\/?\/$/,"")+"/"+n.replace(/^\/+/,""):e}function qC(e,n){return e&&!tO(n)?nO(e,n):n}const aT=e=>e instanceof Ho?{...e}:e;function xc(e,n){n=n||{};const l={};function h(D,V,G){return Ne.isPlainObject(D)&&Ne.isPlainObject(V)?Ne.merge.call({caseless:G},D,V):Ne.isPlainObject(V)?Ne.merge({},V):Ne.isArray(V)?V.slice():V}function m(D,V,G){if(Ne.isUndefined(V)){if(!Ne.isUndefined(D))return h(void 0,D,G)}else return h(D,V,G)}function v(D,V){if(!Ne.isUndefined(V))return h(void 0,V)}function E(D,V){if(Ne.isUndefined(V)){if(!Ne.isUndefined(D))return h(void 0,D)}else return h(void 0,V)}function s(D,V,G){if(G in n)return h(D,V);if(G in e)return h(void 0,D)}const k={url:v,method:v,data:v,baseURL:E,transformRequest:E,transformResponse:E,paramsSerializer:E,timeout:E,timeoutMessage:E,withCredentials:E,withXSRFToken:E,adapter:E,responseType:E,xsrfCookieName:E,xsrfHeaderName:E,onUploadProgress:E,onDownloadProgress:E,decompress:E,maxContentLength:E,maxBodyLength:E,beforeRedirect:E,transport:E,httpAgent:E,httpsAgent:E,cancelToken:E,socketPath:E,responseEncoding:E,validateStatus:s,headers:(D,V)=>m(aT(D),aT(V),!0)};return Ne.forEach(Object.keys(Object.assign({},e,n)),function(V){const G=k[V]||m,J=G(e[V],n[V],V);Ne.isUndefined(J)&&G!==s||(l[V]=J)}),l}const WC=e=>{const n=xc({},e);let{data:l,withXSRFToken:h,xsrfHeaderName:m,xsrfCookieName:v,headers:E,auth:s}=n;n.headers=E=Ho.from(E),n.url=UC(qC(n.baseURL,n.url),e.params,e.paramsSerializer),s&&E.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):"")));let k;if(Ne.isFormData(l)){if(Mi.hasStandardBrowserEnv||Mi.hasStandardBrowserWebWorkerEnv)E.setContentType(void 0);else if((k=E.getContentType())!==!1){const[D,...V]=k?k.split(";").map(G=>G.trim()).filter(Boolean):[];E.setContentType([D||"multipart/form-data",...V].join("; "))}}if(Mi.hasStandardBrowserEnv&&(h&&Ne.isFunction(h)&&(h=h(n)),h||h!==!1&&Q5(n.url))){const D=m&&v&&eO.read(v);D&&E.set(m,D)}return n},rO=typeof XMLHttpRequest<"u",iO=rO&&function(e){return new Promise(function(l,h){const m=WC(e);let v=m.data;const E=Ho.from(m.headers).normalize();let{responseType:s,onUploadProgress:k,onDownloadProgress:D}=m,V,G,J,ve,ae;function me(){ve&&ve(),ae&&ae(),m.cancelToken&&m.cancelToken.unsubscribe(V),m.signal&&m.signal.removeEventListener("abort",V)}let Ce=new XMLHttpRequest;Ce.open(m.method.toUpperCase(),m.url,!0),Ce.timeout=m.timeout;function ie(){if(!Ce)return;const le=Ho.from("getAllResponseHeaders"in Ce&&Ce.getAllResponseHeaders()),Oe={data:!s||s==="text"||s==="json"?Ce.responseText:Ce.response,status:Ce.status,statusText:Ce.statusText,headers:le,config:e,request:Ce};GC(function(He){l(He),me()},function(He){h(He),me()},Oe),Ce=null}"onloadend"in Ce?Ce.onloadend=ie:Ce.onreadystatechange=function(){!Ce||Ce.readyState!==4||Ce.status===0&&!(Ce.responseURL&&Ce.responseURL.indexOf("file:")===0)||setTimeout(ie)},Ce.onabort=function(){Ce&&(h(new qt("Request aborted",qt.ECONNABORTED,e,Ce)),Ce=null)},Ce.onerror=function(){h(new qt("Network Error",qt.ERR_NETWORK,e,Ce)),Ce=null},Ce.ontimeout=function(){let ze=m.timeout?"timeout of "+m.timeout+"ms exceeded":"timeout exceeded";const Oe=m.transitional||jC;m.timeoutErrorMessage&&(ze=m.timeoutErrorMessage),h(new qt(ze,Oe.clarifyTimeoutError?qt.ETIMEDOUT:qt.ECONNABORTED,e,Ce)),Ce=null},v===void 0&&E.setContentType(null),"setRequestHeader"in Ce&&Ne.forEach(E.toJSON(),function(ze,Oe){Ce.setRequestHeader(Oe,ze)}),Ne.isUndefined(m.withCredentials)||(Ce.withCredentials=!!m.withCredentials),s&&s!=="json"&&(Ce.responseType=m.responseType),D&&([J,ae]=Jg(D,!0),Ce.addEventListener("progress",J)),k&&Ce.upload&&([G,ve]=Jg(k),Ce.upload.addEventListener("progress",G),Ce.upload.addEventListener("loadend",ve)),(m.cancelToken||m.signal)&&(V=le=>{Ce&&(h(!le||le.type?new gh(null,e,Ce):le),Ce.abort(),Ce=null)},m.cancelToken&&m.cancelToken.subscribe(V),m.signal&&(m.signal.aborted?V():m.signal.addEventListener("abort",V)));const te=K5(m.url);if(te&&Mi.protocols.indexOf(te)===-1){h(new qt("Unsupported protocol "+te+":",qt.ERR_BAD_REQUEST,e));return}Ce.send(v||null)})},oO=(e,n)=>{const{length:l}=e=e?e.filter(Boolean):[];if(n||l){let h=new AbortController,m;const v=function(D){if(!m){m=!0,s();const V=D instanceof Error?D:this.reason;h.abort(V instanceof qt?V:new gh(V instanceof Error?V.message:V))}};let E=n&&setTimeout(()=>{E=null,v(new qt(`timeout ${n} of ms exceeded`,qt.ETIMEDOUT))},n);const s=()=>{e&&(E&&clearTimeout(E),E=null,e.forEach(D=>{D.unsubscribe?D.unsubscribe(v):D.removeEventListener("abort",v)}),e=null)};e.forEach(D=>D.addEventListener("abort",v));const{signal:k}=h;return k.unsubscribe=()=>Ne.asap(s),k}},sO=oO,aO=function*(e,n){let l=e.byteLength;if(!n||l{const m=lO(e,n);let v=0,E,s=k=>{E||(E=!0,h&&h(k))};return new ReadableStream({async pull(k){try{const{done:D,value:V}=await m.next();if(D){s(),k.close();return}let G=V.byteLength;if(l){let J=v+=G;l(J)}k.enqueue(new Uint8Array(V))}catch(D){throw s(D),D}},cancel(k){return s(k),m.return()}},{highWaterMark:2})},M_=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",ZC=M_&&typeof ReadableStream=="function",uO=M_&&(typeof TextEncoder=="function"?(e=>n=>e.encode(n))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),HC=(e,...n)=>{try{return!!e(...n)}catch{return!1}},hO=ZC&&HC(()=>{let e=!1;const n=new Request(Mi.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!n}),cT=64*1024,l1=ZC&&HC(()=>Ne.isReadableStream(new Response("").body)),Qg={stream:l1&&(e=>e.body)};M_&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(n=>{!Qg[n]&&(Qg[n]=Ne.isFunction(e[n])?l=>l[n]():(l,h)=>{throw new qt(`Response type '${n}' is not supported`,qt.ERR_NOT_SUPPORT,h)})})})(new Response);const dO=async e=>{if(e==null)return 0;if(Ne.isBlob(e))return e.size;if(Ne.isSpecCompliantForm(e))return(await new Request(Mi.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(Ne.isArrayBufferView(e)||Ne.isArrayBuffer(e))return e.byteLength;if(Ne.isURLSearchParams(e)&&(e=e+""),Ne.isString(e))return(await uO(e)).byteLength},pO=async(e,n)=>{const l=Ne.toFiniteNumber(e.getContentLength());return l??dO(n)},fO=M_&&(async e=>{let{url:n,method:l,data:h,signal:m,cancelToken:v,timeout:E,onDownloadProgress:s,onUploadProgress:k,responseType:D,headers:V,withCredentials:G="same-origin",fetchOptions:J}=WC(e);D=D?(D+"").toLowerCase():"text";let ve=sO([m,v&&v.toAbortSignal()],E),ae;const me=ve&&ve.unsubscribe&&(()=>{ve.unsubscribe()});let Ce;try{if(k&&hO&&l!=="get"&&l!=="head"&&(Ce=await pO(V,h))!==0){let Oe=new Request(n,{method:"POST",body:h,duplex:"half"}),Ke;if(Ne.isFormData(h)&&(Ke=Oe.headers.get("content-type"))&&V.setContentType(Ke),Oe.body){const[He,ht]=oT(Ce,Jg(sT(k)));h=lT(Oe.body,cT,He,ht)}}Ne.isString(G)||(G=G?"include":"omit");const ie="credentials"in Request.prototype;ae=new Request(n,{...J,signal:ve,method:l.toUpperCase(),headers:V.normalize().toJSON(),body:h,duplex:"half",credentials:ie?G:void 0});let te=await fetch(ae);const le=l1&&(D==="stream"||D==="response");if(l1&&(s||le&&me)){const Oe={};["status","statusText","headers"].forEach(Ve=>{Oe[Ve]=te[Ve]});const Ke=Ne.toFiniteNumber(te.headers.get("content-length")),[He,ht]=s&&oT(Ke,Jg(sT(s),!0))||[];te=new Response(lT(te.body,cT,He,()=>{ht&&ht(),me&&me()}),Oe)}D=D||"text";let ze=await Qg[Ne.findKey(Qg,D)||"text"](te,e);return!le&&me&&me(),await new Promise((Oe,Ke)=>{GC(Oe,Ke,{data:ze,headers:Ho.from(te.headers),status:te.status,statusText:te.statusText,config:e,request:ae})})}catch(ie){throw me&&me(),ie&&ie.name==="TypeError"&&/fetch/i.test(ie.message)?Object.assign(new qt("Network Error",qt.ERR_NETWORK,e,ae),{cause:ie.cause||ie}):qt.from(ie,ie&&ie.code,e,ae)}}),c1={http:C5,xhr:iO,fetch:fO};Ne.forEach(c1,(e,n)=>{if(e){try{Object.defineProperty(e,"name",{value:n})}catch{}Object.defineProperty(e,"adapterName",{value:n})}});const uT=e=>`- ${e}`,mO=e=>Ne.isFunction(e)||e===null||e===!1,XC={getAdapter:e=>{e=Ne.isArray(e)?e:[e];const{length:n}=e;let l,h;const m={};for(let v=0;v`adapter ${s} `+(k===!1?"is not supported by the environment":"is not available in the build"));let E=n?v.length>1?`since : +`+v.map(uT).join(` +`):" "+uT(v[0]):"as no adapter specified";throw new qt("There is no suitable adapter to dispatch the request "+E,"ERR_NOT_SUPPORT")}return h},adapters:c1};function ev(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new gh(null,e)}function hT(e){return ev(e),e.headers=Ho.from(e.headers),e.data=Q0.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),XC.getAdapter(e.adapter||bx.adapter)(e).then(function(h){return ev(e),h.data=Q0.call(e,e.transformResponse,h),h.headers=Ho.from(h.headers),h},function(h){return $C(h)||(ev(e),h&&h.response&&(h.response.data=Q0.call(e,e.transformResponse,h.response),h.response.headers=Ho.from(h.response.headers))),Promise.reject(h)})}const KC="1.7.7",Ex={};["object","boolean","number","function","string","symbol"].forEach((e,n)=>{Ex[e]=function(h){return typeof h===e||"a"+(n<1?"n ":" ")+e}});const dT={};Ex.transitional=function(n,l,h){function m(v,E){return"[Axios v"+KC+"] Transitional option '"+v+"'"+E+(h?". "+h:"")}return(v,E,s)=>{if(n===!1)throw new qt(m(E," has been removed"+(l?" in "+l:"")),qt.ERR_DEPRECATED);return l&&!dT[E]&&(dT[E]=!0,console.warn(m(E," has been deprecated since v"+l+" and will be removed in the near future"))),n?n(v,E,s):!0}};function gO(e,n,l){if(typeof e!="object")throw new qt("options must be an object",qt.ERR_BAD_OPTION_VALUE);const h=Object.keys(e);let m=h.length;for(;m-- >0;){const v=h[m],E=n[v];if(E){const s=e[v],k=s===void 0||E(s,v,e);if(k!==!0)throw new qt("option "+v+" must be "+k,qt.ERR_BAD_OPTION_VALUE);continue}if(l!==!0)throw new qt("Unknown option "+v,qt.ERR_BAD_OPTION)}}const u1={assertOptions:gO,validators:Ex},Va=u1.validators;class e_{constructor(n){this.defaults=n,this.interceptors={request:new rT,response:new rT}}async request(n,l){try{return await this._request(n,l)}catch(h){if(h instanceof Error){let m;Error.captureStackTrace?Error.captureStackTrace(m={}):m=new Error;const v=m.stack?m.stack.replace(/^.+\n/,""):"";try{h.stack?v&&!String(h.stack).endsWith(v.replace(/^.+\n.+\n/,""))&&(h.stack+=` +`+v):h.stack=v}catch{}}throw h}}_request(n,l){typeof n=="string"?(l=l||{},l.url=n):l=n||{},l=xc(this.defaults,l);const{transitional:h,paramsSerializer:m,headers:v}=l;h!==void 0&&u1.assertOptions(h,{silentJSONParsing:Va.transitional(Va.boolean),forcedJSONParsing:Va.transitional(Va.boolean),clarifyTimeoutError:Va.transitional(Va.boolean)},!1),m!=null&&(Ne.isFunction(m)?l.paramsSerializer={serialize:m}:u1.assertOptions(m,{encode:Va.function,serialize:Va.function},!0)),l.method=(l.method||this.defaults.method||"get").toLowerCase();let E=v&&Ne.merge(v.common,v[l.method]);v&&Ne.forEach(["delete","get","head","post","put","patch","common"],ae=>{delete v[ae]}),l.headers=Ho.concat(E,v);const s=[];let k=!0;this.interceptors.request.forEach(function(me){typeof me.runWhen=="function"&&me.runWhen(l)===!1||(k=k&&me.synchronous,s.unshift(me.fulfilled,me.rejected))});const D=[];this.interceptors.response.forEach(function(me){D.push(me.fulfilled,me.rejected)});let V,G=0,J;if(!k){const ae=[hT.bind(this),void 0];for(ae.unshift.apply(ae,s),ae.push.apply(ae,D),J=ae.length,V=Promise.resolve(l);G{if(!h._listeners)return;let v=h._listeners.length;for(;v-- >0;)h._listeners[v](m);h._listeners=null}),this.promise.then=m=>{let v;const E=new Promise(s=>{h.subscribe(s),v=s}).then(m);return E.cancel=function(){h.unsubscribe(v)},E},n(function(v,E,s){h.reason||(h.reason=new gh(v,E,s),l(h.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(n){if(this.reason){n(this.reason);return}this._listeners?this._listeners.push(n):this._listeners=[n]}unsubscribe(n){if(!this._listeners)return;const l=this._listeners.indexOf(n);l!==-1&&this._listeners.splice(l,1)}toAbortSignal(){const n=new AbortController,l=h=>{n.abort(h)};return this.subscribe(l),n.signal.unsubscribe=()=>this.unsubscribe(l),n.signal}static source(){let n;return{token:new Tx(function(m){n=m}),cancel:n}}}const _O=Tx;function yO(e){return function(l){return e.apply(null,l)}}function vO(e){return Ne.isObject(e)&&e.isAxiosError===!0}const h1={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(h1).forEach(([e,n])=>{h1[n]=e});const xO=h1;function YC(e){const n=new xg(e),l=IC(xg.prototype.request,n);return Ne.extend(l,xg.prototype,n,{allOwnKeys:!0}),Ne.extend(l,n,null,{allOwnKeys:!0}),l.create=function(m){return YC(xc(e,m))},l}const xr=YC(bx);xr.Axios=xg;xr.CanceledError=gh;xr.CancelToken=_O;xr.isCancel=$C;xr.VERSION=KC;xr.toFormData=I_;xr.AxiosError=qt;xr.Cancel=xr.CanceledError;xr.all=function(n){return Promise.all(n)};xr.spread=yO;xr.isAxiosError=vO;xr.mergeConfig=xc;xr.AxiosHeaders=Ho;xr.formToJSON=e=>VC(Ne.isHTMLForm(e)?new FormData(e):e);xr.getAdapter=XC.getAdapter;xr.HttpStatusCode=xO;xr.default=xr;const wO=xr;/* + * Frontend UI component library for the CORI Data API + * {@link https://github.com/ruralinnovation/cori.data.api} + * @copyright Rural Innovation Strategies, Inc. + * @license ISC + */const Gu="https://cori-data-api.ruralinnovation.us/",d1=wO.create({baseURL:Gu,headers:{"Content-Type":"application/json"}}),tv={},JC={apiClient:d1,authenticated:!1,authenticated_user:null,autoSignOut:null,baseURL:Gu,token:null,data:{get:()=>tv,set:e=>{for(const n in e)e.hasOwnProperty[n]&&(tv[n]=e)}},setData:e=>{for(const n in e)e.hasOwnProperty[n]&&(tv[n]=e)}},QC=ut.createContext(JC);let tg=!1,pT=!1;function bO(e){const[n,l]=ut.useState(Object.assign(Object.assign({},JC),{baseURL:e.baseURL?e.baseURL:Gu,setData:h}));function h(m){const v=n;l(Object.assign(Object.assign({},v),{data:Object.assign(Object.assign({},v.data),m),setData:h}))}return e.baseURL&&e.baseURL.length>0&&d1.interceptors.request.use(m=>(m.baseURL=e.baseURL,console.log("API baseURL updated:",m.baseURL),m),m=>Promise.reject(m)),ut.useEffect(()=>{if(l(Object.assign(Object.assign({},n),{autoSignOut:e.signOut&&typeof e.signOut=="function"?()=>{const{signOut:m}=e;m(),window.alert("Please refresh this session by clicking the browser's reload button!"),window.location=window.location.protocol+"//"+window.location.host+window.location.pathname}:null,baseURL:e.baseURL?e.baseURL:Gu})),e.fetchAuthSession){const{fetchAuthSession:m}=e;m().then(E=>{if(!tg){const s=E.tokens;if(console.log("API tokens:",s),s&&s.hasOwnProperty("idToken")&&(tg=!0,console.log("API Session is authenticated:",tg),console.log("API Session config:",E),console.log("idToken:",s.idToken),d1.interceptors.request.use(k=>{const D=s.idToken;return D&&(k.headers.Authorization=`Bearer ${D}`),e.baseURL&&(k.baseURL=e.baseURL),k},k=>Promise.reject(k)),l(Object.assign(Object.assign({},n),{authenticated:!0,autoSignOut:e.signOut&&typeof e.signOut=="function"?()=>{const{signOut:k}=e;k(),window.alert("Please refresh this session by clicking the browser's reload button!"),window.location=window.location.protocol+"//"+window.location.host+window.location.pathname}:null,baseURL:e.baseURL||Gu,token:s.idToken})),e.getCurrentUser)){const{getCurrentUser:k}=e;k().then(V=>{pT||(pT=!0,console.log("API User is authenticated:",tg),console.log("API User:",V),console.log("API User type:",V.constructor.name),l(Object.assign(Object.assign({},n),{authenticated:!0,authenticated_user:V,autoSignOut:e.signOut&&typeof e.signOut=="function"?()=>{const{signOut:G}=e;G(),window.alert("Please refresh this session by clicking the browser's reload button!"),window.location=window.location.protocol+"//"+window.location.host+window.location.pathname}:null,baseURL:e.baseURL||Gu,token:s.idToken})))})}}})}},[]),T0.createElement(T0.Fragment,null,T0.createElement(QC.Provider,{value:n},e.children))}const EO="modulepreload",TO=function(e){return"/"+e},fT={},SO=function(n,l,h){if(!l||l.length===0)return n();const m=document.getElementsByTagName("link");return Promise.all(l.map(v=>{if(v=TO(v),v in fT)return;fT[v]=!0;const E=v.endsWith(".css"),s=E?'[rel="stylesheet"]':"";if(!!h)for(let V=m.length-1;V>=0;V--){const G=m[V];if(G.href===v&&(!E||G.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${v}"]${s}`))return;const D=document.createElement("link");if(D.rel=E?"stylesheet":EO,E||(D.as="script",D.crossOrigin=""),D.href=v,document.head.appendChild(D),E)return new Promise((V,G)=>{D.addEventListener("load",V),D.addEventListener("error",()=>G(new Error(`Unable to preload CSS for ${v}`)))})})).then(()=>n()).catch(v=>{const E=new Event("vite:preloadError",{cancelable:!0});if(E.payload=v,window.dispatchEvent(E),!E.defaultPrevented)throw v})},AO=ut.createContext(null);function CO(e,n){const l=Array.isArray(e)?e[0]:e?e.x:0,h=Array.isArray(e)?e[1]:e?e.y:0,m=Array.isArray(n)?n[0]:n?n.x:0,v=Array.isArray(n)?n[1]:n?n.y:0;return l===m&&h===v}function Ks(e,n){if(e===n)return!0;if(!e||!n)return!1;if(Array.isArray(e)){if(!Array.isArray(n)||e.length!==n.length)return!1;for(let l=0;l{let m=null;"interactive"in h&&(m=Object.assign({},h),delete m.interactive);const v=n[h.ref];if(v){m=m||Object.assign({},h),delete m.ref;for(const E of kO)E in v&&(m[E]=v[E])}return m||h});return{...e,layers:l}}const vT={version:8,sources:{},layers:[]},xT={mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",click:"onClick",dblclick:"onDblClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mouseout:"onMouseOut",contextmenu:"onContextMenu",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",touchcancel:"onTouchCancel"},nv={movestart:"onMoveStart",move:"onMove",moveend:"onMoveEnd",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",zoomstart:"onZoomStart",zoom:"onZoom",zoomend:"onZoomEnd",rotatestart:"onRotateStart",rotate:"onRotate",rotateend:"onRotateEnd",pitchstart:"onPitchStart",pitch:"onPitch",pitchend:"onPitchEnd"},wT={wheel:"onWheel",boxzoomstart:"onBoxZoomStart",boxzoomend:"onBoxZoomEnd",boxzoomcancel:"onBoxZoomCancel",resize:"onResize",load:"onLoad",render:"onRender",idle:"onIdle",remove:"onRemove",data:"onData",styledata:"onStyleData",sourcedata:"onSourceData",error:"onError"},MO=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],PO=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class lh{constructor(n,l,h){this._map=null,this._internalUpdate=!1,this._inRender=!1,this._hoveredFeatures=null,this._deferredEvents={move:!1,zoom:!1,pitch:!1,rotate:!1},this._onEvent=m=>{const v=this.props[wT[m.type]];v?v(m):m.type==="error"&&console.error(m.error)},this._onPointerEvent=m=>{(m.type==="mousemove"||m.type==="mouseout")&&this._updateHover(m);const v=this.props[xT[m.type]];v&&(this.props.interactiveLayerIds&&m.type!=="mouseover"&&m.type!=="mouseout"&&(m.features=this._hoveredFeatures||this._queryRenderedFeatures(m.point)),v(m),delete m.features)},this._onCameraEvent=m=>{if(!this._internalUpdate){const v=this.props[nv[m.type]];v&&v(m)}m.type in this._deferredEvents&&(this._deferredEvents[m.type]=!1)},this._MapClass=n,this.props=l,this._initialize(h)}get map(){return this._map}get transform(){return this._renderTransform}setProps(n){const l=this.props;this.props=n;const h=this._updateSettings(n,l);h&&this._createShadowTransform(this._map);const m=this._updateSize(n),v=this._updateViewState(n,!0);this._updateStyle(n,l),this._updateStyleComponents(n,l),this._updateHandlers(n,l),(h||m||v&&!this._map.isMoving())&&this.redraw()}static reuse(n,l){const h=lh.savedMaps.pop();if(!h)return null;const m=h.map,v=m.getContainer();for(l.className=v.className;v.childNodes.length>0;)l.appendChild(v.childNodes[0]);m._container=l;const E=m._resizeObserver;E&&(E.disconnect(),E.observe(l)),h.setProps({...n,styleDiffing:!1}),m.resize();const{initialViewState:s}=n;return s&&(s.bounds?m.fitBounds(s.bounds,{...s.fitBoundsOptions,duration:0}):h._updateViewState(s,!1)),m.isStyleLoaded()?m.fire("load"):m.once("styledata",()=>m.fire("load")),m._update(),h}_initialize(n){const{props:l}=this,{mapStyle:h=vT}=l,m={...l,...l.initialViewState,accessToken:l.mapboxAccessToken||zO()||null,container:n,style:yT(h)},v=m.initialViewState||m.viewState||m;if(Object.assign(m,{center:[v.longitude||0,v.latitude||0],zoom:v.zoom||0,pitch:v.pitch||0,bearing:v.bearing||0}),l.gl){const V=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=V,l.gl)}const E=new this._MapClass(m);v.padding&&E.setPadding(v.padding),l.cursor&&(E.getCanvas().style.cursor=l.cursor),this._createShadowTransform(E);const s=E._render;E._render=V=>{this._inRender=!0,s.call(E,V),this._inRender=!1};const k=E._renderTaskQueue.run;E._renderTaskQueue.run=V=>{k.call(E._renderTaskQueue,V),this._onBeforeRepaint()},E.on("render",()=>this._onAfterRepaint());const D=E.fire;E.fire=this._fireEvent.bind(this,D),E.on("resize",()=>{this._renderTransform.resize(E.transform.width,E.transform.height)}),E.on("styledata",()=>{this._updateStyleComponents(this.props,{}),mT(E.transform,this._renderTransform)}),E.on("sourcedata",()=>this._updateStyleComponents(this.props,{}));for(const V in xT)E.on(V,this._onPointerEvent);for(const V in nv)E.on(V,this._onCameraEvent);for(const V in wT)E.on(V,this._onEvent);this._map=E}recycle(){const l=this.map.getContainer().querySelector("[mapboxgl-children]");l==null||l.remove(),lh.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const n=this._map;!this._inRender&&n.style&&(n._frame&&(n._frame.cancel(),n._frame=null),n._render())}_createShadowTransform(n){const l=IO(n.transform);n.painter.transform=l,this._renderTransform=l}_updateSize(n){const{viewState:l}=n;if(l){const h=this._map;if(l.width!==h.transform.width||l.height!==h.transform.height)return h.resize(),!0}return!1}_updateViewState(n,l){if(this._internalUpdate)return!1;const h=this._map,m=this._renderTransform,{zoom:v,pitch:E,bearing:s}=m,k=h.isMoving();k&&(m.cameraElevationReference="sea");const D=_T(m,{...gT(h.transform),...n});if(k&&(m.cameraElevationReference="ground"),D&&l){const V=this._deferredEvents;V.move=!0,V.zoom||(V.zoom=v!==m.zoom),V.rotate||(V.rotate=s!==m.bearing),V.pitch||(V.pitch=E!==m.pitch)}return k||_T(h.transform,n),D}_updateSettings(n,l){const h=this._map;let m=!1;for(const v of MO)if(v in n&&!Ks(n[v],l[v])){m=!0;const E=h[`set${v[0].toUpperCase()}${v.slice(1)}`];E==null||E.call(h,n[v])}return m}_updateStyle(n,l){if(n.cursor!==l.cursor&&(this._map.getCanvas().style.cursor=n.cursor||""),n.mapStyle!==l.mapStyle){const{mapStyle:h=vT,styleDiffing:m=!0}=n,v={diff:m};return"localIdeographFontFamily"in n&&(v.localIdeographFontFamily=n.localIdeographFontFamily),this._map.setStyle(yT(h),v),!0}return!1}_updateStyleComponents(n,l){const h=this._map;let m=!1;return h.isStyleLoaded()&&("light"in n&&h.setLight&&!Ks(n.light,l.light)&&(m=!0,h.setLight(n.light)),"fog"in n&&h.setFog&&!Ks(n.fog,l.fog)&&(m=!0,h.setFog(n.fog)),"terrain"in n&&h.setTerrain&&!Ks(n.terrain,l.terrain)&&(!n.terrain||h.getSource(n.terrain.source))&&(m=!0,h.setTerrain(n.terrain))),m}_updateHandlers(n,l){var h,m;const v=this._map;let E=!1;for(const s of PO){const k=(h=n[s])!==null&&h!==void 0?h:!0,D=(m=l[s])!==null&&m!==void 0?m:!0;Ks(k,D)||(E=!0,k?v[s].enable(k):v[s].disable())}return E}_queryRenderedFeatures(n){const l=this._map,h=l.transform,{interactiveLayerIds:m=[]}=this.props;try{return l.transform=this._renderTransform,l.queryRenderedFeatures(n,{layers:m.filter(l.getLayer.bind(l))})}catch{return[]}finally{l.transform=h}}_updateHover(n){var l;const{props:h}=this;if(h.interactiveLayerIds&&(h.onMouseMove||h.onMouseEnter||h.onMouseLeave)){const v=n.type,E=((l=this._hoveredFeatures)===null||l===void 0?void 0:l.length)>0,s=this._queryRenderedFeatures(n.point),k=s.length>0;!k&&E&&(n.type="mouseleave",this._onPointerEvent(n)),this._hoveredFeatures=s,k&&!E&&(n.type="mouseenter",this._onPointerEvent(n)),n.type=v}else this._hoveredFeatures=null}_fireEvent(n,l,h){const m=this._map,v=m.transform,E=typeof l=="string"?l:l.type;return E==="move"&&this._updateViewState(this.props,!1),E in nv&&(typeof l=="object"&&(l.viewState=gT(v)),this._map.isMoving())?(m.transform=this._renderTransform,n.call(m,l,h),m.transform=v,m):(n.call(m,l,h),m)}_onBeforeRepaint(){const n=this._map;this._internalUpdate=!0;for(const h in this._deferredEvents)this._deferredEvents[h]&&n.fire(h);this._internalUpdate=!1;const l=this._map.transform;n.transform=this._renderTransform,this._onAfterRepaint=()=>{mT(this._renderTransform,l),n.transform=l}}}lh.savedMaps=[];function zO(){let e=null;if(typeof location<"u"){const n=/access_token=([^&\/]*)/.exec(location.search);e=n&&n[1]}try{e=e||void 0}catch{}try{e=e||{}.REACT_APP_MAPBOX_ACCESS_TOKEN}catch{}return e}const LO=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function RO(e){if(!e)return null;const n=e.map,l={getMap:()=>n,getCenter:()=>e.transform.center,getZoom:()=>e.transform.zoom,getBearing:()=>e.transform.bearing,getPitch:()=>e.transform.pitch,getPadding:()=>e.transform.padding,getBounds:()=>e.transform.getBounds(),project:h=>{const m=n.transform;n.transform=e.transform;const v=n.project(h);return n.transform=m,v},unproject:h=>{const m=n.transform;n.transform=e.transform;const v=n.unproject(h);return n.transform=m,v},queryTerrainElevation:(h,m)=>{const v=n.transform;n.transform=e.transform;const E=n.queryTerrainElevation(h,m);return n.transform=v,E},queryRenderedFeatures:(h,m)=>{const v=n.transform;n.transform=e.transform;const E=n.queryRenderedFeatures(h,m);return n.transform=v,E}};for(const h of DO(n))!(h in l)&&!LO.includes(h)&&(l[h]=n[h].bind(n));return l}function DO(e){const n=new Set;let l=e;for(;l;){for(const h of Object.getOwnPropertyNames(l))h[0]!=="_"&&typeof e[h]=="function"&&h!=="fire"&&h!=="setEventedParent"&&n.add(h);l=Object.getPrototypeOf(l)}return Array.from(n)}const OO=typeof document<"u"?ut.useLayoutEffect:ut.useEffect,BO=["baseApiUrl","maxParallelImageRequests","workerClass","workerCount","workerUrl"];function FO(e,n){for(const h of BO)h in n&&(e[h]=n[h]);const{RTLTextPlugin:l="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js"}=n;l&&e.getRTLTextPluginStatus&&e.getRTLTextPluginStatus()==="unavailable"&&e.setRTLTextPlugin(l,h=>{h&&console.error(h)},!0)}const P_=ut.createContext(null);function NO(e,n,l){const h=ut.useContext(AO),[m,v]=ut.useState(null),E=ut.useRef(),{current:s}=ut.useRef({mapLib:null,map:null});ut.useEffect(()=>{const V=e.mapLib;let G=!0,J;return Promise.resolve(V||l).then(ve=>{if(!G)return;if(!ve)throw new Error("Invalid mapLib");const ae="Map"in ve?ve:ve.default;if(!ae.Map)throw new Error("Invalid mapLib");if(FO(ae,e),!ae.supported||ae.supported(e))e.reuseMaps&&(J=lh.reuse(e,E.current)),J||(J=new lh(ae.Map,e,E.current)),s.map=RO(J),s.mapLib=ae,v(J),h==null||h.onMapMount(s.map,e.id);else throw new Error("Map is not supported by this browser")}).catch(ve=>{const{onError:ae}=e;ae?ae({type:"error",target:null,originalEvent:null,error:ve}):console.error(ve)}),()=>{G=!1,J&&(h==null||h.onMapUnmount(e.id),e.reuseMaps?J.recycle():J.destroy())}},[]),OO(()=>{m&&m.setProps(e)}),ut.useImperativeHandle(n,()=>s.map,[m]);const k=ut.useMemo(()=>({position:"relative",width:"100%",height:"100%",...e.style}),[e.style]),D={height:"100%"};return ut.createElement("div",{id:e.id,ref:E,style:k},m&&ut.createElement(P_.Provider,{value:s},ut.createElement("div",{"mapboxgl-children":"",style:D},e.children)))}const UO=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function Ec(e,n){if(!e||!n)return;const l=e.style;for(const h in n){const m=n[h];Number.isFinite(m)&&!UO.test(h)?l[h]=`${m}px`:l[h]=m}}function jO(e,n){const{map:l,mapLib:h}=ut.useContext(P_),m=ut.useRef({props:e});m.current.props=e;const v=ut.useMemo(()=>{let me=!1;ut.Children.forEach(e.children,te=>{te&&(me=!0)});const Ce={...e,element:me?document.createElement("div"):null},ie=new h.Marker(Ce);return ie.setLngLat([e.longitude,e.latitude]),ie.getElement().addEventListener("click",te=>{var le,ze;(ze=(le=m.current.props).onClick)===null||ze===void 0||ze.call(le,{type:"click",target:ie,originalEvent:te})}),ie.on("dragstart",te=>{var le,ze;const Oe=te;Oe.lngLat=v.getLngLat(),(ze=(le=m.current.props).onDragStart)===null||ze===void 0||ze.call(le,Oe)}),ie.on("drag",te=>{var le,ze;const Oe=te;Oe.lngLat=v.getLngLat(),(ze=(le=m.current.props).onDrag)===null||ze===void 0||ze.call(le,Oe)}),ie.on("dragend",te=>{var le,ze;const Oe=te;Oe.lngLat=v.getLngLat(),(ze=(le=m.current.props).onDragEnd)===null||ze===void 0||ze.call(le,Oe)}),ie},[]);ut.useEffect(()=>(v.addTo(l.getMap()),()=>{v.remove()}),[]);const{longitude:E,latitude:s,offset:k,style:D,draggable:V=!1,popup:G=null,rotation:J=0,rotationAlignment:ve="auto",pitchAlignment:ae="auto"}=e;return ut.useEffect(()=>{Ec(v.getElement(),D)},[D]),ut.useImperativeHandle(n,()=>v,[]),(v.getLngLat().lng!==E||v.getLngLat().lat!==s)&&v.setLngLat([E,s]),k&&!CO(v.getOffset(),k)&&v.setOffset(k),v.isDraggable()!==V&&v.setDraggable(V),v.getRotation()!==J&&v.setRotation(J),v.getRotationAlignment()!==ve&&v.setRotationAlignment(ve),v.getPitchAlignment()!==ae&&v.setPitchAlignment(ae),v.getPopup()!==G&&v.setPopup(G),hx.createPortal(e.children,v.getElement())}const VO=ut.memo(ut.forwardRef(jO));function bT(e){return new Set(e?e.trim().split(/\s+/):[])}function $O(e,n){const{map:l,mapLib:h}=ut.useContext(P_),m=ut.useMemo(()=>document.createElement("div"),[]),v=ut.useRef({props:e});v.current.props=e;const E=ut.useMemo(()=>{const s={...e},k=new h.Popup(s);return k.setLngLat([e.longitude,e.latitude]),k.once("open",D=>{var V,G;(G=(V=v.current.props).onOpen)===null||G===void 0||G.call(V,D)}),k},[]);if(ut.useEffect(()=>{const s=k=>{var D,V;(V=(D=v.current.props).onClose)===null||V===void 0||V.call(D,k)};return E.on("close",s),E.setDOMContent(m).addTo(l.getMap()),()=>{E.off("close",s),E.isOpen()&&E.remove()}},[]),ut.useEffect(()=>{Ec(E.getElement(),e.style)},[e.style]),ut.useImperativeHandle(n,()=>E,[]),E.isOpen()&&((E.getLngLat().lng!==e.longitude||E.getLngLat().lat!==e.latitude)&&E.setLngLat([e.longitude,e.latitude]),e.offset&&!Ks(E.options.offset,e.offset)&&E.setOffset(e.offset),(E.options.anchor!==e.anchor||E.options.maxWidth!==e.maxWidth)&&(E.options.anchor=e.anchor,E.setMaxWidth(e.maxWidth)),E.options.className!==e.className)){const s=bT(E.options.className),k=bT(e.className);for(const D of s)k.has(D)||E.removeClassName(D);for(const D of k)s.has(D)||E.addClassName(D);E.options.className=e.className}return hx.createPortal(e.children,m)}ut.memo(ut.forwardRef($O));function _h(e,n,l,h){const m=ut.useContext(P_),v=ut.useMemo(()=>e(m),[]);return ut.useEffect(()=>{const E=h||l||n,s=typeof n=="function"&&typeof l=="function"?n:null,k=typeof l=="function"?l:typeof n=="function"?n:null,{map:D}=m;return D.hasControl(v)||(D.addControl(v,E==null?void 0:E.position),s&&s(m)),()=>{k&&k(m),D.hasControl(v)&&D.removeControl(v)}},[]),v}function GO(e){const n=_h(({mapLib:l})=>new l.AttributionControl(e),{position:e.position});return ut.useEffect(()=>{Ec(n._container,e.style)},[e.style]),null}ut.memo(GO);function qO(e){const n=_h(({mapLib:l})=>new l.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return ut.useEffect(()=>{Ec(n._controlContainer,e.style)},[e.style]),null}ut.memo(qO);function WO(e,n){const l=ut.useRef({props:e}),h=_h(({mapLib:m})=>{const v=new m.GeolocateControl(e),E=v._setupUI;return v._setupUI=s=>{v._container.hasChildNodes()||E(s)},v.on("geolocate",s=>{var k,D;(D=(k=l.current.props).onGeolocate)===null||D===void 0||D.call(k,s)}),v.on("error",s=>{var k,D;(D=(k=l.current.props).onError)===null||D===void 0||D.call(k,s)}),v.on("outofmaxbounds",s=>{var k,D;(D=(k=l.current.props).onOutOfMaxBounds)===null||D===void 0||D.call(k,s)}),v.on("trackuserlocationstart",s=>{var k,D;(D=(k=l.current.props).onTrackUserLocationStart)===null||D===void 0||D.call(k,s)}),v.on("trackuserlocationend",s=>{var k,D;(D=(k=l.current.props).onTrackUserLocationEnd)===null||D===void 0||D.call(k,s)}),v},{position:e.position});return l.current.props=e,ut.useImperativeHandle(n,()=>h,[]),ut.useEffect(()=>{Ec(h._container,e.style)},[e.style]),null}const ZO=ut.memo(ut.forwardRef(WO));function HO(e){const n=_h(({mapLib:l})=>new l.NavigationControl(e),{position:e.position});return ut.useEffect(()=>{Ec(n._container,e.style)},[e.style]),null}const XO=ut.memo(HO);function KO(e){const n=_h(({mapLib:v})=>new v.ScaleControl(e),{position:e.position}),l=ut.useRef(e),h=l.current;l.current=e;const{style:m}=e;return e.maxWidth!==void 0&&e.maxWidth!==h.maxWidth&&(n.options.maxWidth=e.maxWidth),e.unit!==void 0&&e.unit!==h.unit&&n.setUnit(e.unit),ut.useEffect(()=>{Ec(n._container,m)},[m]),null}const YO=ut.memo(KO),JO=SO(()=>Promise.resolve().then(()=>SU),void 0),QO=(()=>ut.forwardRef(function(n,l){return NO(n,l,JO)}))(),eI=VO,e4=XO,t4=ZO,n4=YO;var yh=i4,r4=Object.prototype.hasOwnProperty;function i4(){for(var e={},n=0;n-1};ri.prototype.value=function(e){if(this.selected=e,this.el.value=this.getItemValue(e),document.createEvent){var n=document.createEvent("HTMLEvents");n.initEvent("change",!0,!1),this.el.dispatchEvent(n)}else this.el.fireEvent("onchange")};ri.prototype.getCandidates=function(e){var n={pre:"",post:"",extract:(function(h){return this.getItemValue(h)}).bind(this)},l;this.options.filter?(l=l4.filter(this.query,this.data,n),l=l.map((function(h){return{original:h.original,string:this.render(h.original,h.string)}}).bind(this))):l=this.data.map((function(h){var m=this.render(h);return{original:h,string:m}}).bind(this)),e(l)};ri.prototype.getItemValue=function(e){return e};ri.prototype.render=function(e,n){if(n)return n;for(var l=e.original?this.getItemValue(e.original):this.getItemValue(e),h=this.normalize(l),m=h.lastIndexOf(this.query);m>-1;){var v=m+this.query.length;l=l.slice(0,m)+""+l.slice(m,v)+""+l.slice(v),m=h.slice(0,m).lastIndexOf(this.query)}return l};ri.prototype.renderError=function(e){this.list.drawError(e)};var u4=ri,nI=u4,h4=nI;typeof window<"u"&&(window.Suggestions=nI);var d4="Expected a function",ET=0/0,p4="[object Symbol]",f4=/^\s+|\s+$/g,m4=/^[-+]0x[0-9a-f]+$/i,g4=/^0b[01]+$/i,_4=/^0o[0-7]+$/i,y4=parseInt,v4=typeof Go=="object"&&Go&&Go.Object===Object&&Go,x4=typeof self=="object"&&self&&self.Object===Object&&self,w4=v4||x4||Function("return this")(),b4=Object.prototype,E4=b4.toString,T4=Math.max,S4=Math.min,rv=function(){return w4.Date.now()};function A4(e,n,l){var h,m,v,E,s,k,D=0,V=!1,G=!1,J=!0;if(typeof e!="function")throw new TypeError(d4);n=TT(n)||0,p1(l)&&(V=!!l.leading,G="maxWait"in l,v=G?T4(TT(l.maxWait)||0,n):v,J="trailing"in l?!!l.trailing:J);function ve(Ke){var He=h,ht=m;return h=m=void 0,D=Ke,E=e.apply(ht,He),E}function ae(Ke){return D=Ke,s=setTimeout(ie,n),V?ve(Ke):E}function me(Ke){var He=Ke-k,ht=Ke-D,Ve=n-He;return G?S4(Ve,v-ht):Ve}function Ce(Ke){var He=Ke-k,ht=Ke-D;return k===void 0||He>=n||He<0||G&&ht>=v}function ie(){var Ke=rv();if(Ce(Ke))return te(Ke);s=setTimeout(ie,me(Ke))}function te(Ke){return s=void 0,J&&h?ve(Ke):(h=m=void 0,E)}function le(){s!==void 0&&clearTimeout(s),D=0,h=k=m=s=void 0}function ze(){return s===void 0?E:te(rv())}function Oe(){var Ke=rv(),He=Ce(Ke);if(h=arguments,m=this,k=Ke,He){if(s===void 0)return ae(k);if(G)return s=setTimeout(ie,n),ve(k)}return s===void 0&&(s=setTimeout(ie,n)),E}return Oe.cancel=le,Oe.flush=ze,Oe}function p1(e){var n=typeof e;return!!e&&(n=="object"||n=="function")}function C4(e){return!!e&&typeof e=="object"}function I4(e){return typeof e=="symbol"||C4(e)&&E4.call(e)==p4}function TT(e){if(typeof e=="number")return e;if(I4(e))return ET;if(p1(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=p1(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=e.replace(f4,"");var l=g4.test(e);return l||_4.test(e)?y4(e.slice(2),l?2:8):m4.test(e)?ET:+e}var k4=A4,Sx={exports:{}},Yu=typeof Reflect=="object"?Reflect:null,ST=Yu&&typeof Yu.apply=="function"?Yu.apply:function(n,l,h){return Function.prototype.apply.call(n,l,h)},wg;Yu&&typeof Yu.ownKeys=="function"?wg=Yu.ownKeys:Object.getOwnPropertySymbols?wg=function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:wg=function(n){return Object.getOwnPropertyNames(n)};function M4(e){console&&console.warn&&console.warn(e)}var rI=Number.isNaN||function(n){return n!==n};function Cn(){Cn.init.call(this)}Sx.exports=Cn;Sx.exports.once=R4;Cn.EventEmitter=Cn;Cn.prototype._events=void 0;Cn.prototype._eventsCount=0;Cn.prototype._maxListeners=void 0;var AT=10;function z_(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(Cn,"defaultMaxListeners",{enumerable:!0,get:function(){return AT},set:function(e){if(typeof e!="number"||e<0||rI(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");AT=e}});Cn.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};Cn.prototype.setMaxListeners=function(n){if(typeof n!="number"||n<0||rI(n))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+n+".");return this._maxListeners=n,this};function iI(e){return e._maxListeners===void 0?Cn.defaultMaxListeners:e._maxListeners}Cn.prototype.getMaxListeners=function(){return iI(this)};Cn.prototype.emit=function(n){for(var l=[],h=1;h0&&(E=l[0]),E instanceof Error)throw E;var s=new Error("Unhandled error."+(E?" ("+E.message+")":""));throw s.context=E,s}var k=v[n];if(k===void 0)return!1;if(typeof k=="function")ST(k,this,l);else for(var D=k.length,V=cI(k,D),h=0;h0&&E.length>m&&!E.warned){E.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+E.length+" "+String(n)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=n,s.count=E.length,M4(s)}return e}Cn.prototype.addListener=function(n,l){return oI(this,n,l,!1)};Cn.prototype.on=Cn.prototype.addListener;Cn.prototype.prependListener=function(n,l){return oI(this,n,l,!0)};function P4(){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 sI(e,n,l){var h={fired:!1,wrapFn:void 0,target:e,type:n,listener:l},m=P4.bind(h);return m.listener=l,h.wrapFn=m,m}Cn.prototype.once=function(n,l){return z_(l),this.on(n,sI(this,n,l)),this};Cn.prototype.prependOnceListener=function(n,l){return z_(l),this.prependListener(n,sI(this,n,l)),this};Cn.prototype.removeListener=function(n,l){var h,m,v,E,s;if(z_(l),m=this._events,m===void 0)return this;if(h=m[n],h===void 0)return this;if(h===l||h.listener===l)--this._eventsCount===0?this._events=Object.create(null):(delete m[n],m.removeListener&&this.emit("removeListener",n,h.listener||l));else if(typeof h!="function"){for(v=-1,E=h.length-1;E>=0;E--)if(h[E]===l||h[E].listener===l){s=h[E].listener,v=E;break}if(v<0)return this;v===0?h.shift():z4(h,v),h.length===1&&(m[n]=h[0]),m.removeListener!==void 0&&this.emit("removeListener",n,s||l)}return this};Cn.prototype.off=Cn.prototype.removeListener;Cn.prototype.removeAllListeners=function(n){var l,h,m;if(h=this._events,h===void 0)return this;if(h.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):h[n]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete h[n]),this;if(arguments.length===0){var v=Object.keys(h),E;for(m=0;m=0;m--)this.removeListener(n,l[m]);return this};function aI(e,n,l){var h=e._events;if(h===void 0)return[];var m=h[n];return m===void 0?[]:typeof m=="function"?l?[m.listener||m]:[m]:l?L4(m):cI(m,m.length)}Cn.prototype.listeners=function(n){return aI(this,n,!0)};Cn.prototype.rawListeners=function(n){return aI(this,n,!1)};Cn.listenerCount=function(e,n){return typeof e.listenerCount=="function"?e.listenerCount(n):lI.call(e,n)};Cn.prototype.listenerCount=lI;function lI(e){var n=this._events;if(n!==void 0){var l=n[e];if(typeof l=="function")return 1;if(l!==void 0)return l.length}return 0}Cn.prototype.eventNames=function(){return this._eventsCount>0?wg(this._events):[]};function cI(e,n){for(var l=new Array(n),h=0;h]*)>(.*)/);if(!n)return null;var l=n[1],h=n[2].split(";"),m=null,v=h.reduce(function(E,s){var k=F4(s);return k?k.key==="rel"?(m||(m=k.value),E):(E[k.key]=k.value,E):E},{});return m?{url:l,rel:m,params:v}:null}function U4(e){return e?e.split(/,\s*=400){var E=new IT({request:e,body:n.response,statusCode:n.status});h(E);return}l(n)};var v=e.body;typeof v=="string"?n.send(v):v?n.send(JSON.stringify(v)):m?n.send(m):n.send(),t_[e.id]=n}).then(function(l){return J4(e,l)})}function dI(e,n){var l=e.url(n),h=new window.XMLHttpRequest;return h.open(e.method,l),Object.keys(e.headers).forEach(function(m){h.setRequestHeader(m,e.headers[m])}),h}function Q4(e){return Promise.resolve().then(function(){var n=dI(e,e.client.accessToken);return hI(e,n)})}var eB={browserAbort:Y4,sendRequestXhr:hI,browserSend:Q4,createRequestXhr:dI},n_={exports:{}};/*! http://mths.be/base64 v0.1.0 by @mathias | MIT license */n_.exports;(function(e,n){(function(l){var h=n,m=e&&e.exports==h&&e,v=typeof Go=="object"&&Go;(v.global===v||v.window===v)&&(l=v);var E=function(ae){this.message=ae};E.prototype=new Error,E.prototype.name="InvalidCharacterError";var s=function(ae){throw new E(ae)},k="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",D=/[\t\n\f\r ]/g,V=function(ae){ae=String(ae).replace(D,"");var me=ae.length;me%4==0&&(ae=ae.replace(/==?$/,""),me=ae.length),(me%4==1||/[^+a-zA-Z0-9/]/.test(ae))&&s("Invalid character: the string to be decoded is not correctly encoded.");for(var Ce=0,ie,te,le="",ze=-1;++ze>(-2*Ce&6)));return le},G=function(ae){ae=String(ae),/[^\0-\xFF]/.test(ae)&&s("The string to be encoded contains characters outside of the Latin1 range.");for(var me=ae.length%3,Ce="",ie=-1,te,le,ze,Oe,Ke=ae.length-me;++ie>18&63)+k.charAt(Oe>>12&63)+k.charAt(Oe>>6&63)+k.charAt(Oe&63);return me==2?(te=ae.charCodeAt(ie)<<8,le=ae.charCodeAt(++ie),Oe=te+le,Ce+=k.charAt(Oe>>10)+k.charAt(Oe>>4&63)+k.charAt(Oe<<2&63)+"="):me==1&&(Oe=ae.charCodeAt(ie),Ce+=k.charAt(Oe>>2)+k.charAt(Oe<<4&63)+"=="),Ce},J={encode:G,decode:V,version:"0.1.0"};if(h&&!h.nodeType)if(m)m.exports=J;else for(var ve in J)J.hasOwnProperty(ve)&&(h[ve]=J[ve]);else l.base64=J})(Go)})(n_,n_.exports);var tB=n_.exports,nB=tB,ov={};function rB(e){if(ov[e])return ov[e];var n=e.split("."),l=n[0],h=n[1];if(!h)throw new Error("Invalid token");var m=iB(h),v={usage:l,user:m.u};return oc(m,"a")&&(v.authorization=m.a),oc(m,"exp")&&(v.expires=m.exp*1e3),oc(m,"iat")&&(v.created=m.iat*1e3),oc(m,"scopes")&&(v.scopes=m.scopes),oc(m,"client")&&(v.client=m.client),oc(m,"ll")&&(v.lastLogin=m.ll),oc(m,"iu")&&(v.impersonator=m.iu),ov[e]=v,v}function iB(e){try{return JSON.parse(nB.decode(e))}catch{throw new Error("Invalid token")}}function oc(e,n){return Object.prototype.hasOwnProperty.call(e,n)}var pI=rB,fI={exports:{}};(function(e){var n=Object.prototype.hasOwnProperty,l="~";function h(){}Object.create&&(h.prototype=Object.create(null),new h().__proto__||(l=!1));function m(k,D,V){this.fn=k,this.context=D,this.once=V||!1}function v(k,D,V,G,J){if(typeof V!="function")throw new TypeError("The listener must be a function");var ve=new m(V,G||k,J),ae=l?l+D:D;return k._events[ae]?k._events[ae].fn?k._events[ae]=[k._events[ae],ve]:k._events[ae].push(ve):(k._events[ae]=ve,k._eventsCount++),k}function E(k,D){--k._eventsCount===0?k._events=new h:delete k._events[D]}function s(){this._events=new h,this._eventsCount=0}s.prototype.eventNames=function(){var D=[],V,G;if(this._eventsCount===0)return D;for(G in V=this._events)n.call(V,G)&&D.push(l?G.slice(1):G);return Object.getOwnPropertySymbols?D.concat(Object.getOwnPropertySymbols(V)):D},s.prototype.listeners=function(D){var V=l?l+D:D,G=this._events[V];if(!G)return[];if(G.fn)return[G.fn];for(var J=0,ve=G.length,ae=new Array(ve);Jv.length?E:v})}};zn.equal=function(n){return function(h){if(h!==n)return JSON.stringify(n)}};zn.oneOf=function(){var n=Array.isArray(arguments[0])?arguments[0]:Array.prototype.slice.call(arguments),l=n.map(function(h){return zn.equal(h)});return zn.oneOfType.apply(this,l)};zn.range=function(n){var l=n[0],h=n[1];return function(v){var E=cl(zn.number,v);if(E||vh)return"number between "+l+" & "+h+" (inclusive)"}};zn.any=function(){};zn.boolean=function(n){if(typeof n!="boolean")return"boolean"};zn.number=function(n){if(typeof n!="number")return"number"};zn.plainArray=function(n){if(!Array.isArray(n))return"array"};zn.plainObject=function(n){if(!EB(n))return"object"};zn.string=function(n){if(typeof n!="string")return"string"};zn.func=function(n){if(typeof n!="function")return"function"};function cl(e,n){if(!(n==null&&!e.hasOwnProperty("__required"))){var l=e(n);if(l)return Array.isArray(l)?l:[l]}}function Ix(e,n){var l=e.length,h=e[l-1],m=e.slice(0,l-1);return m.length===0&&(m=[bI]),n=TB(n,{path:m}),typeof h=="function"?h(n):TI(n,AB(h))}function SB(e){return e.length<2?e[0]:e.length===2?e.join(" or "):e.slice(0,-1).join(", ")+", or "+e.slice(-1)}function AB(e){return"must be "+CB(e)+"."}function CB(e){return/^an? /.test(e)?e:/^[aeiou]/i.test(e)?"an "+e:/^[a-z]/i.test(e)?"a "+e:e}function TI(e,n){var l=SI(e.path),h=e.path.join(".")+" "+n,m=l?"Item at position ":"";return m+h}function SI(e){return typeof e[e.length-1]=="number"||typeof e[0]=="number"}function IB(e){return Object.keys(e||{}).map(function(n){return{key:n,value:e[n]}})}zn.validate=cl;zn.processMessage=Ix;var kB=zn,MB=yh,Ju=kB;function PB(e){if(typeof window<"u")return e instanceof Go.Blob||e instanceof Go.ArrayBuffer?void 0:"Blob or ArrayBuffer";if(!(typeof e=="string"||e.pipe!==void 0))return"Filename or Readable stream"}function zB(e,n){return Ju.assert(Ju.strictShape(e),n)}function LB(e){var n="date";if(typeof e=="boolean")return n;try{var l=new Date(e);if(l.getTime&&isNaN(l.getTime()))return n}catch{return n}}function RB(e){return Ju.tuple(Ju.number,Ju.number)(e)}var DB=MB(Ju,{file:PB,date:LB,coordinates:RB,assertShape:zB});function OB(e,n){var l=function(h,m){return n.indexOf(h)!==-1&&m!==void 0};return typeof n=="function"&&(l=n),Object.keys(e).filter(function(h){return l(h,e[h])}).reduce(function(h,m){return h[m]=e[m],h},{})}var BB=OB;function FB(e,n){return Object.keys(e).reduce(function(l,h){return l[h]=n(h,e[h]),l},{})}var NB=FB,UB=NB;function jB(e){return UB(e,function(n,l){return typeof l=="boolean"?JSON.stringify(l):l})}var VB=jB,$B=yI,GB=wI;function qB(e){return function(n){var l;$B.prototype.isPrototypeOf(n)?l=n:l=GB(n);var h=Object.create(e);return h.client=l,h}}var WB=qB,AI=yh,tn=DB,r_=BB,CI=VB,ZB=WB,kx={},II=["country","region","postcode","district","place","locality","neighborhood","address","poi","poi.landmark"];kx.forwardGeocode=function(e){tn.assertShape({query:tn.required(tn.string),mode:tn.oneOf("mapbox.places","mapbox.places-permanent"),countries:tn.arrayOf(tn.string),proximity:tn.oneOf(tn.coordinates,"ip"),types:tn.arrayOf(tn.oneOf(II)),autocomplete:tn.boolean,bbox:tn.arrayOf(tn.number),limit:tn.number,language:tn.arrayOf(tn.string),routing:tn.boolean,fuzzyMatch:tn.boolean,worldview:tn.string})(e),e.mode=e.mode||"mapbox.places";var n=CI(AI({country:e.countries},r_(e,["proximity","types","autocomplete","bbox","limit","language","routing","fuzzyMatch","worldview"])));return this.client.createRequest({method:"GET",path:"/geocoding/v5/:mode/:query.json",params:r_(e,["mode","query"]),query:n})};kx.reverseGeocode=function(e){tn.assertShape({query:tn.required(tn.coordinates),mode:tn.oneOf("mapbox.places","mapbox.places-permanent"),countries:tn.arrayOf(tn.string),types:tn.arrayOf(tn.oneOf(II)),bbox:tn.arrayOf(tn.number),limit:tn.number,language:tn.arrayOf(tn.string),reverseMode:tn.oneOf("distance","score"),routing:tn.boolean,worldview:tn.string})(e),e.mode=e.mode||"mapbox.places";var n=CI(AI({country:e.countries},r_(e,["country","types","bbox","limit","language","reverseMode","routing","worldview"])));return this.client.createRequest({method:"GET",path:"/geocoding/v5/:mode/:query.json",params:r_(e,["mode","query"]),query:n})};var HB=ZB(kx),XB=self.crypto||self.msCrypto,Mx="-_",ol=36;for(;ol--;)Mx+=ol.toString(36);ol=36;for(;ol---10;)Mx+=ol.toString(36).toUpperCase();var KB=function(e){var n="",l=XB.getRandomValues(new Uint8Array(e||21));for(ol=e||21;ol--;)n+=Mx[l[ol]&63];return n},YB=KB;function kI(e){this.origin=e.origin||"https://api.mapbox.com",this.endpoint="events/v2",this.access_token=e.accessToken,this.version="0.2.0",this.sessionID=this.generateSessionID(),this.userAgent=this.getUserAgent(),this.options=e,this.send=this.send.bind(this),this.countries=e.countries?e.countries.split(","):null,this.types=e.types?e.types.split(","):null,this.bbox=e.bbox?e.bbox:null,this.language=e.language?e.language.split(","):null,this.limit=e.limit?+e.limit:null,this.locale=navigator.language||null,this.enableEventLogging=this.shouldEnableLogging(e),this.eventQueue=new Array,this.flushInterval=e.flushInterval||1e3,this.maxQueueSize=e.maxQueueSize||100,this.timer=this.flushInterval?setTimeout(this.flush.bind(this),this.flushInterval):null,this.lastSentInput="",this.lastSentIndex=0}kI.prototype={select:function(e,n){var l=this.getSelectedIndex(e,n),h=this.getEventPayload("search.select",n);if(h.resultIndex=l,h.resultPlaceName=e.place_name,h.resultId=e.id,!(l===this.lastSentIndex&&h.queryString===this.lastSentInput||l==-1)&&(this.lastSentIndex=l,this.lastSentInput=h.queryString,!!h.queryString))return this.push(h)},start:function(e){var n=this.getEventPayload("search.start",e);if(n.queryString)return this.push(n)},keyevent:function(e,n){if(e.key&&!(e.metaKey||[9,27,37,39,13,38,40].indexOf(e.keyCode)!==-1)){var l=this.getEventPayload("search.keystroke",n);if(l.lastAction=e.key,!!l.queryString)return this.push(l)}},send:function(e,n){if(!this.enableEventLogging)return n?n():void 0;var l=this.getRequestOptions(e);this.request(l,(function(h){if(h)return this.handleError(h,n);if(n)return n()}).bind(this))},getRequestOptions:function(e){Array.isArray(e)||(e=[e]);var n={method:"POST",host:this.origin,path:this.endpoint+"?access_token="+this.access_token,headers:{"Content-Type":"application/json"},body:JSON.stringify(e)};return n},getEventPayload:function(e,n){var l;n.options.proximity?l=[n.options.proximity.longitude,n.options.proximity.latitude]:l=null;var h=n._map?n._map.getZoom():void 0,m={event:e,created:+new Date,sessionIdentifier:this.sessionID,country:this.countries,userAgent:this.userAgent,language:this.language,bbox:this.bbox,types:this.types,endpoint:"mapbox.places",autocomplete:n.options.autocomplete,fuzzyMatch:n.options.fuzzyMatch,proximity:l,limit:n.options.limit,routing:n.options.routing,worldview:n.options.worldview,mapZoom:h,keyboardLocale:this.locale};return e==="search.select"?m.queryString=n.inputString:e!="search.select"&&n._inputEl?m.queryString=n._inputEl.value:m.queryString=n.inputString,m},request:function(e,n){var l=new XMLHttpRequest;l.onreadystatechange=function(){if(this.readyState==4)return this.status==204?n(null):n(this.statusText)},l.open(e.method,e.host+"/"+e.path,!0);for(var h in e.headers){var m=e.headers[h];l.setRequestHeader(h,m)}l.send(e.body)},handleError:function(e,n){if(n)return n(e)},generateSessionID:function(){return YB()},getUserAgent:function(){return"mapbox-gl-geocoder."+this.version+"."+navigator.userAgent},getSelectedIndex:function(e,n){if(n._typeahead){var l=n._typeahead.data,h=e.id,m=l.map(function(E){return E.id}),v=m.indexOf(h);return v}},shouldEnableLogging:function(e){return!(e.enableEventLogging===!1||e.origin&&e.origin.indexOf("api.mapbox.com")==-1||e.localGeocoder||e.filter)},flush:function(){this.eventQueue.length>0&&(this.send(this.eventQueue),this.eventQueue=new Array),this.timer&&clearTimeout(this.timer),this.flushInterval&&(this.timer=setTimeout(this.flush.bind(this),this.flushInterval))},push:function(e,n){this.eventQueue.push(e),(this.eventQueue.length>=this.maxQueueSize||n)&&this.flush()},remove:function(){this.flush()}};var JB=kI,QB={de:"Suche",it:"Ricerca",en:"Search",nl:"Zoeken",fr:"Chercher",ca:"Cerca",he:"לחפש",ja:"サーチ",lv:"Meklēt",pt:"Procurar",sr:"Претрага",zh:"搜索",cs:"Vyhledávání",hu:"Keresés",ka:"ძიება",nb:"Søke",sk:"Vyhľadávanie",th:"ค้นหา",fi:"Hae",is:"Leita",ko:"수색",pl:"Szukaj",sl:"Iskanje",fa:"جستجو",ru:"Поиск"},eF={placeholder:QB},MI={exports:{}};(function(e){(function(n,l,h){e.exports?e.exports=h():n[l]=h()})(Go,"subtag",function(){var n="",l=/^([a-zA-Z]{2,3})(?:[_-]+([a-zA-Z]{3})(?=$|[_-]+))?(?:[_-]+([a-zA-Z]{4})(?=$|[_-]+))?(?:[_-]+([a-zA-Z]{2}|[0-9]{3})(?=$|[_-]+))?/;function h(k){return k.match(l)||[]}function m(k){return h(k).filter(function(D,V){return D&&V})}function v(k){return k=h(k),{language:k[1]||n,extlang:k[2]||n,script:k[3]||n,region:k[4]||n}}function E(k,D,V){Object.defineProperty(k,D,{value:V,enumerable:!0})}function s(k,D,V){function G(J){return h(J)[k]||n}E(G,"pattern",D),E(v,V,G)}return s(1,/^[a-zA-Z]{2,3}$/,"language"),s(2,/^[a-zA-Z]{3}$/,"extlang"),s(3,/^[a-zA-Z]{4}$/,"script"),s(4,/^[a-zA-Z]{2}$|^[0-9]{3}$/,"region"),E(v,"split",m),v})})(MI);var tF=MI.exports,nF=h4,rF=k4,lc=yh,iF=O4.EventEmitter,PT=B4,zT=xB,LT=HB,oF=JB,sF=eF,aF=tF;const $a={FORWARD:0,LOCAL:1,REVERSE:2};function PI(e){this._eventEmitter=new iF,this.options=lc({},this.options,e),this.inputString="",this.fresh=!0,this.lastSelected=null}PI.prototype={options:{zoom:16,flyTo:!0,trackProximity:!0,minLength:2,reverseGeocode:!1,limit:5,origin:"https://api.mapbox.com",enableEventLogging:!0,marker:!0,mapboxgl:null,collapsed:!1,clearAndBlurOnEsc:!1,clearOnBlur:!1,getItemValue:function(e){return e.place_name},render:function(e){var n=e.place_name.split(",");return'
'+n[0]+'
'+n.splice(1,n.length).join(",")+"
"}},addTo:function(e){function n(l,h){if(!document.body.contains(h))throw new Error("Element provided to #addTo() exists, but is not in the DOM");const m=l.onAdd();h.appendChild(m)}if(e._controlContainer)e.addControl(this);else if(e instanceof HTMLElement)n(this,e);else if(typeof e=="string"){const l=document.querySelectorAll(e);if(l.length===0)throw new Error("Element ",e,"not found.");if(l.length>1)throw new Error("Geocoder can only be added to a single html element");n(this,l[0])}else throw new Error("Error: addTo must be a mapbox-gl-js map, an html element, or a CSS selector query for a single html element")},onAdd:function(e){if(e&&typeof e!="string"&&(this._map=e),this.setLanguage(),this.options.localGeocoderOnly||(this.geocoderService=LT(zT({accessToken:this.options.accessToken,origin:this.options.origin}))),this.options.localGeocoderOnly&&!this.options.localGeocoder)throw new Error("A localGeocoder function must be specified to use localGeocoderOnly mode");this.eventManager=new oF(this.options),this._onChange=this._onChange.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onPaste=this._onPaste.bind(this),this._onBlur=this._onBlur.bind(this),this._showButton=this._showButton.bind(this),this._hideButton=this._hideButton.bind(this),this._onQueryResult=this._onQueryResult.bind(this),this.clear=this.clear.bind(this),this._updateProximity=this._updateProximity.bind(this),this._collapse=this._collapse.bind(this),this._unCollapse=this._unCollapse.bind(this),this._clear=this._clear.bind(this),this._clearOnBlur=this._clearOnBlur.bind(this);var n=this.container=document.createElement("div");n.className="mapboxgl-ctrl-geocoder mapboxgl-ctrl";var l=this.createIcon("search",'');this._inputEl=document.createElement("input"),this._inputEl.type="text",this._inputEl.className="mapboxgl-ctrl-geocoder--input",this.setPlaceholder(),this.options.collapsed&&(this._collapse(),this.container.addEventListener("mouseenter",this._unCollapse),this.container.addEventListener("mouseleave",this._collapse),this._inputEl.addEventListener("focus",this._unCollapse)),(this.options.collapsed||this.options.clearOnBlur)&&this._inputEl.addEventListener("blur",this._onBlur),this._inputEl.addEventListener("keydown",rF(this._onKeyDown,200)),this._inputEl.addEventListener("paste",this._onPaste),this._inputEl.addEventListener("change",this._onChange),this.container.addEventListener("mouseenter",this._showButton),this.container.addEventListener("mouseleave",this._hideButton),this._inputEl.addEventListener("keyup",(function(v){this.eventManager.keyevent(v,this)}).bind(this));var h=document.createElement("div");h.classList.add("mapboxgl-ctrl-geocoder--pin-right"),this._clearEl=document.createElement("button"),this._clearEl.setAttribute("aria-label","Clear"),this._clearEl.addEventListener("click",this.clear),this._clearEl.className="mapboxgl-ctrl-geocoder--button";var m=this.createIcon("close",'');return this._clearEl.appendChild(m),this._loadingEl=this.createIcon("loading",''),h.appendChild(this._clearEl),h.appendChild(this._loadingEl),n.appendChild(l),n.appendChild(this._inputEl),n.appendChild(h),this._typeahead=new nF(this._inputEl,[],{filter:!1,minLength:this.options.minLength,limit:this.options.limit}),this.setRenderFunction(this.options.render),this._typeahead.getItemValue=this.options.getItemValue,this.mapMarker=null,this._handleMarker=this._handleMarker.bind(this),this._map&&(this.options.trackProximity&&(this._updateProximity(),this._map.on("moveend",this._updateProximity)),this._mapboxgl=this.options.mapboxgl,!this._mapboxgl&&this.options.marker&&(console.error("No mapboxgl detected in options. Map markers are disabled. Please set options.mapboxgl."),this.options.marker=!1)),n},createIcon:function(e,n){var l=document.createElementNS("http://www.w3.org/2000/svg","svg");if(l.setAttribute("class","mapboxgl-ctrl-geocoder--icon mapboxgl-ctrl-geocoder--icon-"+e),l.setAttribute("viewBox","0 0 18 18"),l.setAttribute("xml:space","preserve"),l.setAttribute("width",18),l.setAttribute("height",18),"innerHTML"in l)l.innerHTML=n;else{var h=document.createElement("div");h.innerHTML=""+n.valueOf().toString()+"";var m=h.firstChild,v=m.firstChild;l.appendChild(v)}return l},onRemove:function(){return this.container.parentNode.removeChild(this.container),this.options.trackProximity&&this._map&&this._map.off("moveend",this._updateProximity),this._removeMarker(),this._map=null,this},_onPaste:function(e){var n=(e.clipboardData||window.clipboardData).getData("text");n.length>=this.options.minLength&&this._geocode(n)},_onKeyDown:function(e){var n=27,l=9;if(e.keyCode===n&&this.options.clearAndBlurOnEsc)return this._clear(e),this._inputEl.blur();var h=e.target&&e.target.shadowRoot?e.target.shadowRoot.activeElement:e.target,m=h?h.value:"";if(!m)return this.fresh=!0,e.keyCode!==l&&this.clear(e),this._clearEl.style.display="none";e.metaKey||[l,n,37,39,13,38,40].indexOf(e.keyCode)!==-1||h.value.length>=this.options.minLength&&this._geocode(h.value)},_showButton:function(){this._typeahead.selected&&(this._clearEl.style.display="block")},_hideButton:function(){this._typeahead.selected&&(this._clearEl.style.display="none")},_onBlur:function(e){this.options.clearOnBlur&&this._clearOnBlur(e),this.options.collapsed&&this._collapse()},_onChange:function(){var e=this._typeahead.selected;if(e&&JSON.stringify(e)!==this.lastSelected){if(this._clearEl.style.display="none",this.options.flyTo){var n;if(e.properties&&PT[e.properties.short_code])n=lc({},this.options.flyTo),this._map&&this._map.fitBounds(PT[e.properties.short_code].bbox,n);else if(e.bbox){var l=e.bbox;n=lc({},this.options.flyTo),this._map&&this._map.fitBounds([[l[0],l[1]],[l[2],l[3]]],n)}else{var h={zoom:this.options.zoom};n=lc({},h,this.options.flyTo),e.center?n.center=e.center:e.geometry&&e.geometry.type&&e.geometry.type==="Point"&&e.geometry.coordinates&&(n.center=e.geometry.coordinates),this._map&&this._map.flyTo(n)}}this.options.marker&&this._mapboxgl&&this._handleMarker(e),this._inputEl.focus(),this._inputEl.scrollLeft=0,this._inputEl.setSelectionRange(0,0),this.lastSelected=JSON.stringify(e),this._eventEmitter.emit("result",{result:e}),this.eventManager.select(e,this)}},_requestType:function(e,n){var l;const h=/^[ ]*(-?\d+\.?\d*)[, ]+(-?\d+\.?\d*)[ ]*$/;return e.localGeocoderOnly?l=$a.LOCAL:e.reverseGeocode&&h.test(n)?l=$a.REVERSE:l=$a.FORWARD,l},_setupConfig:function(e,n){const l=["bbox","limit","proximity","countries","types","language","reverseMode","mode","autocomplete","fuzzyMatch","routing","worldview"],h=/[\s,]+/;var m=this,v=l.reduce(function(s,k){if(m.options[k]===void 0||m.options[k]===null)return s;["countries","types","language"].indexOf(k)>-1?s[k]=m.options[k].split(h):s[k]=m.options[k];const D=typeof m.options[k].longitude=="number"&&typeof m.options[k].latitude=="number";if(k==="proximity"&&D){const V=m.options[k].longitude,G=m.options[k].latitude;s[k]=[V,G]}return s},{});switch(e){case $a.REVERSE:{var E=n.split(h).map(function(s){return parseFloat(s,10)}).reverse();v.types&&v.types[0],v=lc(v,{query:E,limit:1}),["proximity","autocomplete","fuzzyMatch","bbox"].forEach(function(s){s in v&&delete v[s]})}break;case $a.FORWARD:/^[ ]*(-?\d+\.?\d*)[, ]+(-?\d+\.?\d*)*[ ]*$/.test(n)&&(n=n.replace(/,/g," ")),v=lc(v,{query:n});break}return v},_geocode:function(e){this.inputString=e,this._loadingEl.style.display="block",this._eventEmitter.emit("loading",{query:e});const n=this._requestType(this.options,e),l=this._setupConfig(n,e);var h;switch(n){case $a.LOCAL:h=Promise.resolve();break;case $a.FORWARD:h=this.geocoderService.forwardGeocode(l).send();break;case $a.REVERSE:h=this.geocoderService.reverseGeocode(l).send();break}var m=this.options.localGeocoder?this.options.localGeocoder(e)||[]:[],v=[],E=null;return h.catch((function(s){E=s}).bind(this)).then((function(s){this._loadingEl.style.display="none";var k={};return s?s.statusCode=="200"&&(k=s.body,k.request=s.request,k.headers=s.headers):k={type:"FeatureCollection",features:[]},k.config=l,this.fresh&&(this.eventManager.start(this),this.fresh=!1),k.features=k.features?m.concat(k.features):m,this.options.externalGeocoder?(v=this.options.externalGeocoder(e,k.features)||[],v.then(function(D){return k.features=k.features?D.concat(k.features):D,k},function(){return k})):k}).bind(this)).then((function(s){if(E)throw E;this.options.filter&&s.features.length&&(s.features=s.features.filter(this.options.filter)),s.features.length?(this._clearEl.style.display="block",this._eventEmitter.emit("results",s),this._typeahead.update(s.features)):(this._clearEl.style.display="none",this._typeahead.selected=null,this._renderNoResults(),this._eventEmitter.emit("results",s))}).bind(this)).catch((function(s){this._loadingEl.style.display="none",m.length&&this.options.localGeocoder||v.length&&this.options.externalGeocoder?(this._clearEl.style.display="block",this._typeahead.update(m)):(this._clearEl.style.display="none",this._typeahead.selected=null,this._renderError()),this._eventEmitter.emit("results",{features:m}),this._eventEmitter.emit("error",{error:s})}).bind(this)),h},_clear:function(e){e&&e.preventDefault(),this._inputEl.value="",this._typeahead.selected=null,this._typeahead.clear(),this._onChange(),this._clearEl.style.display="none",this._removeMarker(),this.lastSelected=null,this._eventEmitter.emit("clear"),this.fresh=!0},clear:function(e){this._clear(e),this._inputEl.focus()},_clearOnBlur:function(e){var n=this;e.relatedTarget&&n._clear(e)},_onQueryResult:function(e){var n=e.body;if(n.features.length){var l=n.features[0];this._typeahead.selected=l,this._inputEl.value=l.place_name,this._onChange()}},_updateProximity:function(){if(this._map)if(this._map.getZoom()>9){var e=this._map.getCenter().wrap();this.setProximity({longitude:e.lng,latitude:e.lat})}else this.setProximity(null)},_collapse:function(){!this._inputEl.value&&this._inputEl!==document.activeElement&&this.container.classList.add("mapboxgl-ctrl-geocoder--collapsed")},_unCollapse:function(){this.container.classList.remove("mapboxgl-ctrl-geocoder--collapsed")},query:function(e){return this._geocode(e).then(this._onQueryResult),this},_renderError:function(){var e="
There was an error reaching the server
";this._renderMessage(e)},_renderNoResults:function(){var e="
No results found
";this._renderMessage(e)},_renderMessage:function(e){this._typeahead.update([]),this._typeahead.selected=null,this._typeahead.clear(),this._typeahead.renderError(e)},_getPlaceholderText:function(){if(this.options.placeholder)return this.options.placeholder;if(this.options.language){var e=this.options.language.split(",")[0],n=aF.language(e),l=sF.placeholder[n];if(l)return l}return"Search"},setInput:function(e){return this._inputEl.value=e,this._typeahead.selected=null,this._typeahead.clear(),e.length>=this.options.minLength&&this._geocode(e),this},setProximity:function(e){return this.options.proximity=e,this},getProximity:function(){return this.options.proximity},setRenderFunction:function(e){return e&&typeof e=="function"&&(this._typeahead.render=e),this},getRenderFunction:function(){return this._typeahead.render},setLanguage:function(e){var n=navigator.language||navigator.userLanguage||navigator.browserLanguage;return this.options.language=e||this.options.language||n,this},getLanguage:function(){return this.options.language},getZoom:function(){return this.options.zoom},setZoom:function(e){return this.options.zoom=e,this},getFlyTo:function(){return this.options.flyTo},setFlyTo:function(e){return this.options.flyTo=e,this},getPlaceholder:function(){return this.options.placeholder},setPlaceholder:function(e){return this.placeholder=e||this._getPlaceholderText(),this._inputEl.placeholder=this.placeholder,this._inputEl.setAttribute("aria-label",this.placeholder),this},getBbox:function(){return this.options.bbox},setBbox:function(e){return this.options.bbox=e,this},getCountries:function(){return this.options.countries},setCountries:function(e){return this.options.countries=e,this},getTypes:function(){return this.options.types},setTypes:function(e){return this.options.types=e,this},getMinLength:function(){return this.options.minLength},setMinLength:function(e){return this.options.minLength=e,this._typeahead&&(this._typeahead.options.minLength=e),this},getLimit:function(){return this.options.limit},setLimit:function(e){return this.options.limit=e,this._typeahead&&(this._typeahead.options.limit=e),this},getFilter:function(){return this.options.filter},setFilter:function(e){return this.options.filter=e,this},setOrigin:function(e){return this.options.origin=e,this.geocoderService=LT(zT({accessToken:this.options.accessToken,origin:this.options.origin})),this},getOrigin:function(){return this.options.origin},setAutocomplete:function(e){return this.options.autocomplete=e,this},getAutocomplete:function(){return this.options.autocomplete},setFuzzyMatch:function(e){return this.options.fuzzyMatch=e,this},getFuzzyMatch:function(){return this.options.fuzzyMatch},setRouting:function(e){return this.options.routing=e,this},getRouting:function(){return this.options.routing},setWorldview:function(e){return this.options.worldview=e,this},getWorldview:function(){return this.options.worldview},_handleMarker:function(e){if(this._map){this._removeMarker();var n={color:"#4668F2"},l=lc({},n,this.options.marker);return this.mapMarker=new this._mapboxgl.Marker(l),e.center?this.mapMarker.setLngLat(e.center).addTo(this._map):e.geometry&&e.geometry.type&&e.geometry.type==="Point"&&e.geometry.coordinates&&this.mapMarker.setLngLat(e.geometry.coordinates).addTo(this._map),this}},_removeMarker:function(){this.mapMarker&&(this.mapMarker.remove(),this.mapMarker=null)},on:function(e,n){return this._eventEmitter.on(e,n),this},off:function(e,n){return this._eventEmitter.removeListener(e,n),this.eventManager.remove(),this}};var lF=PI;const cF=g1(lF);/* + * Frontend UI component library for the CORI Data API + * {@link https://github.com/ruralinnovation/cori.data.api} + * @copyright Rural Innovation Strategies, Inc. + * @license ISC + */function uF(e){const[n,l]=ut.useState(null),h=Object.assign({},e),m=_h(()=>{const v=new cF(Object.assign(Object.assign({},h),{marker:n||!1,accessToken:h.mapboxAccessToken}));return h.onLoading&&v.on("loading",h.onLoading),h.onResults&&v.on("results",h.onResults),h.onResult&&v.on("result",E=>{var s;h.onResult!==void 0&&h.onResult(E);const{result:k}=E,D=k&&(k.center||((s=k.geometry)===null||s===void 0?void 0:s.type)==="Point"&&k.geometry.coordinates);if(D&&h.marker){const V=typeof h.marker=="object"?h.marker:{};l(ut.createElement(eI,Object.assign({},V,{longitude:D[0],latitude:D[1]})))}else l(null)}),h.onError&&v.on("error",h.onError),v},{position:h.position});return m.hasOwnProperty("_map")&&m._map&&(m.getProximity()!==h.proximity&&h.proximity!==void 0&&m.setProximity(h.proximity),m.getRenderFunction()!==h.render&&h.render!==void 0&&m.setRenderFunction(h.render),m.getLanguage()!==h.language&&h.language!==void 0&&m.setLanguage(h.language),m.getZoom()!==h.zoom&&h.zoom!==void 0&&m.setZoom(h.zoom),m.getFlyTo()!==h.flyTo&&h.flyTo!==void 0&&m.setFlyTo(h.flyTo),m.getPlaceholder()!==h.placeholder&&h.placeholder!==void 0&&m.setPlaceholder(h.placeholder),m.getCountries()!==h.countries&&h.countries!==void 0&&m.setCountries(h.countries),m.getTypes()!==h.types&&h.types!==void 0&&m.setTypes(h.types),m.getMinLength()!==h.minLength&&h.minLength!==void 0&&m.setMinLength(h.minLength),m.getLimit()!==h.limit&&h.limit!==void 0&&m.setLimit(h.limit),m.getFilter()!==h.filter&&h.filter!==void 0&&m.setFilter(h.filter),m.getOrigin()!==h.origin&&h.origin!==void 0&&m.setOrigin(h.origin),m.getAutocomplete()!==h.autocomplete&&h.autocomplete!==void 0&&m.setAutocomplete(h.autocomplete),m.getFuzzyMatch()!==h.fuzzyMatch&&h.fuzzyMatch!==void 0&&m.setFuzzyMatch(h.fuzzyMatch),m.getRouting()!==h.routing&&h.routing!==void 0&&m.setRouting(h.routing),m.getWorldview()!==h.worldview&&h.worldview!==void 0&&m.setWorldview(h.worldview)),n}/* + * Frontend UI component library for the CORI Data API + * {@link https://github.com/ruralinnovation/cori.data.api} + * @copyright Rural Innovation Strategies, Inc. + * @license ISC + */var hF=8,dF="LIVE - CORI light basemap - county labels",pF={"mapbox:type":"default","mapbox:origin":"light-v10","mapbox:autocomposite":!0,"mapbox:groups":{"1444855769305.6016":{name:"Tunnels",collapsed:!0},"1444855786460.0557":{name:"Roads",collapsed:!0},"1444855799204.86":{name:"Bridges",collapsed:!0},"1444934295202.7542":{name:"Admin boundaries",collapsed:!1}},"mapbox:sdk-support":{js:"0.54.0",android:"7.4.0",ios:"4.10.0"},"mapbox:uiParadigm":"layers","mapbox:thumb":"data:image/webp;base64,UklGRmAJAABXRUJQVlA4TFQJAAAvO8AOAPX4drZtmWTXts7/wMzUqCCLGZOCMjCzbfx/1jFYYr9m+zeF5Gqx8bj3bozqqoouhWLj6dCYQqn+K1W6Vb1HB+Nn+HqXMatDQowkSVJTM/xwkv+mwu1OF8S2kRxJ7PyjfbMzs6a7+j8Be9jFwDSO7Za6ajtXwy/CHsEeYqSRsWzFQAbkSKlndkzfLGcN0zHLlJYZyNmbaOFmTdM0apq3d+t5Y906dr68rJ16zskdY1kaCWdraPJQE8CKlJazrjk+nrVM2/y0Q8ZpQtFux7BmD3bG8fxnncEJvUfnnPObbeMBsKIKWwJLA5PS8njL3DLP4CPmpnkG4+PxuFaBT22n9wiwUuTNx93WpXE+s4bmwJJyWCFwVAX3SJuMZ8fb5ic/uYKb5qc/HY+XqSvlgEmPIYI91BF5/X6fOW3Hpn0x7BGCGMgOIUVMAPdLSmn8xk/+ddM0zT/NUlqmDDhHT0NSj4pzfDEiNh53M7rOC/ElKUxkESgctcF75jilNBuP35gtU2kUjLo1fQicFbF5v7lCb488VM7WALsaKYd2zVFMDJBTSmn50/F4uY8oH9g2dlja+Pv3HebWDpZz2CAZV8BymTpIaTYb/3SZ9qXU6tvEuVU4hpI2Xye6NVcGNl5gQmAtIFJK47Qcj4/vYUcXT2V/e+hiR0dKjfeJAXNqGGNjZyGHYGhSSrPZcjkbH+83Acwe6dm7BBtfXc6umi7y9rHj4OwwIMkKSw5gmVJqm/FsNhvPlmlc+PcAb+MGLpNvvzvdHEb//8OovHFcQ+Yq/v9FAAPYcsiPFeA6pdTGbLkcz8YpXVyWKaW1nwkYRs7diBfOOr8KN/XMr5rQ0a5ZP9bB2pgIyCgcIBlYpJT6JqXl+HicUjv5Y0rp+jbBBm1ktlJfyo4HjVCu55uvNWTWNgGEcRjHAhvXJeOfjmep/JFd4HvbAxzyF3Odt55noJNjJLBCyEgTLJk6peO0PB7PlmVLsAG10hVYoHr+7tb9Xnc+Gq9LkmUp5EAAOaWOWc5mhcmkYAH+9Y69oGxQ5rm+/blu2ZcnO8ieP+xiF/UnHn5CsSdvpGRwWo4fz5bj8QTIKdUqxA4DhjDSXN3bt/Ha18gPbdnClr2jx9/+C/GJd2vFG1e2C6uWywDw0KQAUNdOEHYNtdW/9Ppr//pCNFKyMNiw+I5lm+I8GpNlnQuACwNyDES2sNDdYzNgTqQqy4CycbYlyn/fGMJR56jXN5Bxl/k8lnLsCjmL/zgc0lfHoSnKIiaEXOZssAXrI0t7EE3HQLYenf4V9p3x7Le+duJxX2Uu4IN6w2A8AvZRYLMfBfv7gOs6f/4Qh9THjV3bkxx+9L5vzc/c983rz+06z4+BKDFWCKySTMgGEOW5ydRzy6pCJj76rcn68b9LrtNns3fqsW0A+cjYLlkRkjH3+nFcfyKbqtCX7v4vzs98Z5ulUMGaHrGvbYdldC/acUDMI+ogY9183D4xWa0atXp1Br1lYw5HKnGOiHB2CO/nHtr6vCTlx0cmz3Gsv3eHObHhVctqJNe877Ab7FbtEc2e1A6XKBS5tkS5X360Y9aVjhVZn9gJGwSNx7N9/c6ZCgLgO3R6exWZUku4tlww9q0U0NLnbVRPI7tw57hOOqLMqjr1TIaJXRYSZIVsii+vgOg4skLzlWTD3c//qfA+yp242/sFnDDP4So+huswWBjmlsucf4/xnfEEj8BG783+2+m1R/Cwpne5evS5sQcLGVuteLpeZ7t/G9xbff0Z2zLAfWyKHbTUtLDN0QHWoN5OvctX2717l9Pva6cXffKx4bCViTpG+tVNnNTa5To8WwdB2UMAAw2Zon5/ALs1zbroWo0Y4X6velAf1fMDOyYxtTE8CTd9B3XbZaOa7TodvmY9vT4jvkIrjFmfqvz74xFhs1bO88CeoLNJpRweGiaO6s0RMyD5SJu+O73drb1VV6tOo9aXe3UGdR4CQ54G9w7T69Pt06SzDDx8Hqf1kXqv+rVsSi2rSZ6bubRsjXZYAOrTBwatmpl3mvaI2tXLv/+bbsw9QFv16qXf50bdXd7OZbV7/XOnV6/3p9ml79Y1ZDzSwgXLPLmji9aluLFNAQ9oAxZdfaknii934lsv8XK2bcAjuF9Pr6/O5W/1a0BhTB523M/AWetlA3tmaFOmXUO5w1i2AQLY0+L3n6c4MEOlxchsfJZ6hhtxcSoAnriA7AlgABsJMGZOcfFHk+sMho1j6TdNfOzUi6rwNkXLqsFl2GDLMjmA36dexbYL3nzu+M2J8ZIFfPpBwZZCtilmwEVh+P79qDeifhpzKNl4Pvdv2mupHWSAAUPx+47wnrFx4b4NBocBs4uqJf0XpTady3fw3Mhy/nZW2/5EGHBYVRgb3IEpWqZ0BlsZA7aFW5fuMyencAAHhvuQ8ye+/fD/fvUw4/vvtso8oiDLYLhPX08oOgYl4u6xhubkBMIc/hqo+UQYYmWxr3MIq5CJN2mq5wDKOdew+XfldefSRoX6NZKV69dHAMXLeD/AddTuqU85SNTfH1s4fAR07k8ekrXJlWXqeDtMNhXYR0F5VQKOHGHxcnyJ79kMC/ousDIHp7Zm2CMaCsbK1psuubIKWlaZrZyzye1oO4cmYwCZty45t7eYTIB/AiMHWlV+U9yrjE3k/E/yv9chv6lqOrXQ2oyrr1lzZ8DyAuNQR28WDBhTqMAR7/7MEACWb5ubKeJ7VUxdW8haAAK7otSADZji39Rd2pUKxPyjO8HTp+AHDmFccMG5BLBsF7xYrOIWzjJtvVtw/sKHF/sLgL9vCYxs4YKHZh8Zm1U1nZqa/PTXBuwdMiLP7OLgrULXSAaBsYRs38GW/rtgyWyMlV9EMSMdAKtGqu7Td3BzPBgxAOrjqKZ0wj16DETYvrZc31VRqj24OoBzp4u7vpT7zvk4OqBEuT4seAG4DFeWbLQ+9ZJclv13AxI8+yvIA/qFKR+AwSIfCVAFYJdAoG99F0uAASJ+7Xi5EzjuZk6s0hOYTLCZqwIsl4NhOjk0QLgQkevcYqaLo5VxjzyzJ/ltOJTB8wgDqICNVX3/cUwBt5OcFdkG/4OAbDbok6v49AOAgnrQJKaTmMi5qmKxcLBaev4vkeePDFjAp+cUg2cm51YN1WMoN56HKE4rgx0vnz19+Fc/ub79ZLILKw5pa4UxHOSSqQE="},fF=[-72.26808525539167,43.37747275058169],mF=10.873762090608595,gF=0,_F=2,yF={composite:{url:"mapbox://mapbox.mapbox-terrain-v2,mapbox.mapbox-streets-v8,ruralinno.2pv0vm2z,ruralinno.3v9y79ly,ruralinno.5639ssfg,ruralinno.c504wkuy,ruralinno.7stpbs93,ruralinno.cwz2k5qc,ruralinno.1joudpqe",type:"vector"}},vF="mapbox://sprites/ruralinno/cl010e7b7001p15pe3l0306hv/68n9slz9mfbus83an19oqbf32",xF="mapbox://fonts/ruralinno/{fontstack}/{range}.pbf",wF=[{id:"land",type:"background",layout:{},paint:{"background-color":"hsl(55, 0%, 100%)"}},{id:"landcover",type:"fill",source:"composite","source-layer":"landcover",maxzoom:7,layout:{},paint:{"fill-color":"hsl(0, 0%, 100%)","fill-opacity":["interpolate",["exponential",1.5],["zoom"],2,.1,7,0],"fill-antialias":!1}},{id:"national-park",type:"fill",source:"composite","source-layer":"landuse_overlay",minzoom:5,filter:["==",["get","class"],"national_park"],layout:{},paint:{"fill-color":"hsla(150, 6%, 93%, 0.63)","fill-opacity":["interpolate",["linear"],["zoom"],5,0,6,.5]}},{id:"landuse",type:"fill",source:"composite","source-layer":"landuse",minzoom:5,filter:["match",["get","class"],["park","airport","glacier","pitch","sand"],!0,!1],layout:{},paint:{"fill-opacity":["interpolate",["linear"],["zoom"],5,0,6,["match",["get","class"],"glacier",.5,1]],"fill-color":"hsl(150, 0%, 100%)"}},{id:"water-shadow",type:"fill",source:"composite","source-layer":"water",layout:{},paint:{"fill-translate-anchor":"viewport","fill-translate":["interpolate",["exponential",1.2],["zoom"],7,["literal",[0,0]],16,["literal",[-1,-1]]],"fill-color":"hsl(185, 7%, 73%)"}},{id:"waterway",type:"line",source:"composite","source-layer":"waterway",minzoom:8,layout:{"line-cap":["step",["zoom"],"butt",11,"round"],"line-join":"round"},paint:{"line-color":"hsl(187, 9%, 81%)","line-width":["interpolate",["exponential",1.3],["zoom"],9,["match",["get","class"],["canal","river"],.1,0],20,["match",["get","class"],["canal","river"],8,3]],"line-opacity":["interpolate",["linear"],["zoom"],8,0,8.5,1]}},{id:"water",type:"fill",source:"composite","source-layer":"water",layout:{},paint:{"fill-color":"#cad2d3","fill-opacity":.5}},{id:"hillshade",type:"fill",source:"composite","source-layer":"hillshade",minzoom:6,layout:{},paint:{"fill-color":["match",["get","class"],"shadow","hsl(0, 0%, 35%)","hsl(0, 0%, 100%)"],"fill-opacity":["interpolate",["linear"],["zoom"],12,["match",["get","level"],[67,56],.02,[89,78],.01,.015],15,0]}},{id:"land-structure-polygon",type:"fill",source:"composite","source-layer":"structure",minzoom:21.1,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","class"],"land"]],layout:{},paint:{"fill-color":"hsl(156, 20%, 95%)"}},{id:"land-structure-line",type:"line",source:"composite","source-layer":"structure",minzoom:13,filter:["all",["==",["geometry-type"],"LineString"],["==",["get","class"],"land"]],layout:{"line-cap":"round"},paint:{"line-width":["interpolate",["exponential",1.99],["zoom"],14,.75,20,40],"line-color":"hsl(156, 20%, 95%)"}},{id:"aeroway-polygon",type:"fill",source:"composite","source-layer":"aeroway",minzoom:11,filter:["all",["==",["geometry-type"],"Polygon"],["match",["get","type"],["runway","taxiway","helipad"],!0,!1]],layout:{},paint:{"fill-opacity":["interpolate",["linear"],["zoom"],11,0,11.5,1],"fill-color":"hsl(0, 0%, 97%)"}},{id:"aeroway-line",type:"line",source:"composite","source-layer":"aeroway",minzoom:9,filter:["==",["geometry-type"],"LineString"],layout:{},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],9,["match",["get","type"],"runway",1,.5],18,["match",["get","type"],"runway",80,20]],"line-color":"hsl(0, 0%, 97%)"}},{id:"building-outline",type:"line",source:"composite","source-layer":"building",minzoom:15,filter:["all",["!=",["get","type"],"building:part"],["==",["get","underground"],"false"]],layout:{},paint:{"line-color":"hsl(55, 3%, 87%)","line-width":["interpolate",["exponential",1.5],["zoom"],15,.75,20,3],"line-opacity":["interpolate",["linear"],["zoom"],15,0,16,1]}},{id:"building",type:"fill",source:"composite","source-layer":"building",minzoom:15,filter:["all",["!=",["get","type"],"building:part"],["==",["get","underground"],"false"]],layout:{},paint:{"fill-outline-color":"hsl(55, 3%, 87%)","fill-opacity":["interpolate",["linear"],["zoom"],15,0,16,1],"fill-color":"hsl(55, 5%, 91%)"}},{id:"tunnel-street-minor-low",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["step",["zoom"],["match",["get","class"],["street","street_limited","track","primary_link"],!0,!1],14,["match",["get","class"],["street","street_limited","track","primary_link","secondary_link","tertiary_link","service"],!0,!1]],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,["match",["get","class"],["street","street_limited","primary_link"],2,"track",1,.5],18,["match",["get","class"],["street","street_limited","primary_link"],18,12]],"line-color":"hsl(185, 7%, 88%)","line-opacity":["step",["zoom"],1,14,0]}},{id:"tunnel-street-minor-case",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["step",["zoom"],["match",["get","class"],["street","street_limited","track","primary_link"],!0,!1],14,["match",["get","class"],["street","street_limited","track","primary_link","secondary_link","tertiary_link","service"],!0,!1]],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.75,20,2],"line-color":"hsl(185, 12%, 89%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,["match",["get","class"],["street","street_limited","primary_link"],2,"track",1,.5],18,["match",["get","class"],["street","street_limited","primary_link"],18,12]],"line-opacity":["step",["zoom"],0,14,1],"line-dasharray":[3,3]}},{id:"tunnel-primary-secondary-tertiary-case",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["match",["get","class"],["primary","secondary","tertiary"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],10,["match",["get","class"],"primary",1,.75],18,2],"line-color":"hsl(185, 12%, 89%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],5,["match",["get","class"],"primary",.75,.1],18,["match",["get","class"],"primary",32,26]],"line-dasharray":[3,3]}},{id:"tunnel-major-link-case",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["match",["get","class"],["motorway_link","trunk_link"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.75,20,2],"line-color":"hsl(185, 12%, 89%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-dasharray":[3,3]}},{id:"tunnel-motorway-trunk-case",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["match",["get","class"],["motorway","trunk"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],10,1,18,2],"line-color":"hsl(185, 12%, 89%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32],"line-dasharray":[3,3]}},{id:"tunnel-construction",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:14,filter:["all",["==",["get","structure"],"tunnel"],["==",["get","class"],"construction"],["==",["geometry-type"],"LineString"]],layout:{},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,2,18,18],"line-color":"hsl(187, 7%, 88%)","line-dasharray":["step",["zoom"],["literal",[.4,.8]],15,["literal",[.3,.6]],16,["literal",[.2,.3]],17,["literal",[.2,.25]],18,["literal",[.15,.15]]]}},{id:"tunnel-path",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["==",["get","class"],"path"],["!=",["get","type"],"steps"],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],15,1,18,4],"line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.75,1]],16,["literal",[1,.75]],17,["literal",[1,.5]]],"line-color":"hsl(0, 0%, 85%)"}},{id:"tunnel-steps",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:14,filter:["all",["==",["get","structure"],"tunnel"],["==",["get","class"],"steps"],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],15,1,16,1.6,18,6],"line-color":"hsl(0, 0%, 85%)","line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.75,1]],16,["literal",[1,.75]],17,["literal",[.3,.3]]]}},{id:"tunnel-major-link",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["match",["get","class"],["motorway_link","trunk_link"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-color":"hsl(187, 7%, 88%)"}},{id:"tunnel-pedestrian",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["==",["get","class"],"pedestrian"],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,.5,18,12],"line-color":"hsl(187, 7%, 88%)","line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.5,.4]],16,["literal",[1,.2]]]}},{id:"tunnel-street-minor",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["step",["zoom"],["match",["get","class"],["street","street_limited","track","primary_link"],!0,!1],14,["match",["get","class"],["street","street_limited","track","primary_link","secondary_link","tertiary_link","service"],!0,!1]],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,["match",["get","class"],["street","street_limited","primary_link"],2,"track",1,.5],18,["match",["get","class"],["street","street_limited","primary_link"],18,12]],"line-color":"hsl(187, 7%, 88%)","line-opacity":["step",["zoom"],0,14,1]}},{id:"tunnel-primary-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["match",["get","class"],["primary","secondary","tertiary"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],5,["match",["get","class"],"primary",.75,.1],18,["match",["get","class"],"primary",32,26]],"line-color":"hsl(187, 7%, 88%)"}},{id:"tunnel-motorway-trunk",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["match",["get","class"],["motorway","trunk"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32],"line-color":"hsl(187, 7%, 88%)"}},{id:"road-pedestrian-case",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:12,filter:["all",["==",["get","class"],"pedestrian"],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,2,18,14.5],"line-color":"hsl(156, 12%, 92%)","line-opacity":["step",["zoom"],0,14,1]}},{id:"road-minor-low",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["step",["zoom"],["==",["get","class"],"track"],14,["match",["get","class"],["track","secondary_link","tertiary_link","service"],!0,!1]],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,["match",["get","class"],"track",1,.5],18,12],"line-color":"hsl(0, 0%, 100%)","line-opacity":["step",["zoom"],1,14,0]}},{id:"road-street-low",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:11,filter:["all",["match",["get","class"],["street","street_limited","primary_link"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-color":"hsl(0, 0%, 100%)","line-opacity":["step",["zoom"],1,14,0]}},{id:"road-minor-case",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["step",["zoom"],["==",["get","class"],"track"],14,["match",["get","class"],["track","secondary_link","tertiary_link","service"],!0,!1]],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.75,20,2],"line-color":"hsl(156, 12%, 92%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],14,["match",["get","class"],"track",1,.5],18,12],"line-opacity":["step",["zoom"],0,14,1]}},{id:"road-street-case",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:11,filter:["all",["match",["get","class"],["street","street_limited","primary_link"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.75,20,2],"line-color":"hsl(156, 12%, 92%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-opacity":["step",["zoom"],0,14,1]}},{id:"road-secondary-tertiary-case",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:9.3,filter:["all",["match",["get","class"],["secondary","tertiary"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],10,.75,18,2],"line-color":"hsl(156, 12%, 92%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],5,.1,18,26]}},{id:"road-primary-case",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:9.9,filter:["all",["==",["get","class"],"primary"],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],10,1,18,2],"line-color":"hsl(156, 12%, 92%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32]}},{id:"road-major-link-case",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:10,filter:["all",["match",["get","class"],["motorway_link","trunk_link"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.75,20,2],"line-color":"hsl(156, 12%, 92%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-opacity":["step",["zoom"],0,11,1]}},{id:"road-motorway-trunk-case",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:8.5,filter:["all",["match",["get","class"],["motorway","trunk"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],10,1,18,2],"line-color":"hsl(156, 12%, 92%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32],"line-opacity":["step",["zoom"],["match",["get","class"],"motorway",1,0],6,1]}},{id:"road-construction",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:14,filter:["all",["==",["get","class"],"construction"],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,2,18,18],"line-color":"hsl(0, 0%, 100%)","line-dasharray":["step",["zoom"],["literal",[.4,.8]],15,["literal",[.3,.6]],16,["literal",[.2,.3]],17,["literal",[.2,.25]],18,["literal",[.15,.15]]]}},{id:"road-path",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:12,filter:["all",["==",["get","class"],"path"],["step",["zoom"],["!",["match",["get","type"],["steps","sidewalk","crossing"],!0,!1]],16,["!=",["get","type"],"steps"]],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],13,.5,14,1,15,1,18,4],"line-color":"hsl(0, 0%, 100%)","line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.75,1]],16,["literal",[1,.75]],17,["literal",[1,.5]]]}},{id:"road-steps",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:14,filter:["all",["==",["get","type"],"steps"],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],15,1,16,1.6,18,6],"line-color":"hsl(0, 0%, 100%)","line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.75,1]],16,["literal",[1,.75]],17,["literal",[.3,.3]]]}},{id:"road-major-link",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:10,filter:["all",["match",["get","class"],["motorway_link","trunk_link"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-color":"hsl(0, 0%, 100%)"}},{id:"road-pedestrian",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:12,filter:["all",["==",["get","class"],"pedestrian"],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,.5,18,12],"line-color":"hsl(0, 0%, 100%)","line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.5,.4]],16,["literal",[1,.2]]]}},{id:"road-minor",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["step",["zoom"],["==",["get","class"],"track"],14,["match",["get","class"],["track","secondary_link","tertiary_link","service"],!0,!1]],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,["match",["get","class"],"track",1,.5],18,12],"line-color":"hsl(0, 0%, 100%)","line-opacity":["step",["zoom"],0,14,1]}},{id:"road-street",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:11,filter:["all",["match",["get","class"],["street","street_limited","primary_link"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-color":"hsl(0, 0%, 100%)","line-opacity":["step",["zoom"],0,14,1]}},{id:"road-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",filter:["all",["match",["get","class"],["secondary","tertiary"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],5,.1,18,22],"line-color":"hsl(0, 0%, 100%)"}},{id:"road-primary",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:9,filter:["all",["==",["get","class"],"primary"],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round","line-cap":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32],"line-color":"#f6eac1","line-opacity":["interpolate",["linear"],["zoom"],6,0,8,["match",["get","class"],["trunk"],.2,0],16,["match",["get","class"],["trunk"],1,.81]]}},{id:"road-motorway-trunk",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:8,filter:["all",["match",["get","class"],["motorway","trunk"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],5,.5,18,32],"line-color":["match",["get","class"],["motorway"],"hsl(26, 100%, 68%)","#f2d163"],"line-opacity":["interpolate",["linear"],["zoom"],6,["match",["get","class"],["trunk"],.3,0],8,.4,18,.7]}},{id:"road-rail",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["match",["get","class"],["major_rail","minor_rail"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,.5,20,1],"line-color":"hsl(156, 12%, 92%)"}},{id:"bridge-pedestrian-case",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["==",["get","class"],"pedestrian"],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,2,18,14.5],"line-opacity":["step",["zoom"],0,14,1],"line-color":"hsl(156, 12%, 92%)"}},{id:"bridge-street-minor-low",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["step",["zoom"],["match",["get","class"],["street","street_limited","track","primary_link"],!0,!1],14,["match",["get","class"],["street","street_limited","track","primary_link","secondary_link","tertiary_link","service"],!0,!1]],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,["match",["get","class"],["street","street_limited","primary_link"],2,"track",1,.5],18,["match",["get","class"],["street","street_limited","primary_link"],18,12]],"line-color":"hsl(0, 0%, 100%)","line-opacity":["step",["zoom"],1,14,0]}},{id:"bridge-street-minor-case",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["step",["zoom"],["match",["get","class"],["street","street_limited","track","primary_link"],!0,!1],14,["match",["get","class"],["street","street_limited","track","primary_link","secondary_link","tertiary_link","service"],!0,!1]],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.75,20,2],"line-opacity":["step",["zoom"],0,14,1],"line-gap-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,["match",["get","class"],["street","street_limited","primary_link"],2,"track",1,.5],18,["match",["get","class"],["street","street_limited","primary_link"],18,12]],"line-color":"hsl(156, 12%, 92%)"}},{id:"bridge-primary-secondary-tertiary-case",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["match",["get","class"],["primary","secondary","tertiary"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],10,["match",["get","class"],"primary",1,.75],18,2],"line-opacity":["step",["zoom"],0,10,1],"line-gap-width":["interpolate",["exponential",1.5],["zoom"],5,["match",["get","class"],"primary",.75,.1],18,["match",["get","class"],"primary",32,26]],"line-color":"hsl(156, 12%, 92%)"}},{id:"bridge-major-link-case",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["match",["get","class"],["motorway_link","trunk_link"],!0,!1],["<=",["get","layer"],1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.75,20,2],"line-gap-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-color":"hsl(156, 12%, 92%)"}},{id:"bridge-motorway-trunk-case",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["match",["get","class"],["motorway","trunk"],!0,!1],["<=",["get","layer"],1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],10,1,18,2],"line-gap-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32],"line-color":"hsl(156, 12%, 92%)"}},{id:"bridge-construction",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:14,filter:["all",["==",["get","structure"],"bridge"],["==",["get","class"],"construction"],["==",["geometry-type"],"LineString"]],layout:{},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,2,18,18],"line-dasharray":["step",["zoom"],["literal",[.4,.8]],15,["literal",[.3,.6]],16,["literal",[.2,.3]],17,["literal",[.2,.25]],18,["literal",[.15,.15]]],"line-color":"hsl(156, 0%, 100%)"}},{id:"bridge-path",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["==",["get","class"],"path"],["!=",["get","type"],"steps"],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],15,1,18,4],"line-color":"hsl(0, 0%, 100%)","line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.75,1]],16,["literal",[1,.75]],17,["literal",[1,.5]]]}},{id:"bridge-steps",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:14,filter:["all",["==",["get","type"],"steps"],["==",["get","structure"],"bridge"],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],15,1,16,1.6,18,6],"line-color":"hsl(0, 0%, 100%)","line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.75,1]],16,["literal",[1,.75]],17,["literal",[.3,.3]]]}},{id:"bridge-major-link",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["match",["get","class"],["motorway_link","trunk_link"],!0,!1],["<=",["get","layer"],1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-color":"hsl(0, 0%, 100%)"}},{id:"bridge-pedestrian",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["==",["get","class"],"pedestrian"],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,.5,18,12],"line-color":"hsl(0, 0%, 100%)","line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.5,.4]],16,["literal",[1,.2]]]}},{id:"bridge-street-minor",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["step",["zoom"],["match",["get","class"],["street","street_limited","track","primary_link"],!0,!1],14,["match",["get","class"],["street","street_limited","track","primary_link","secondary_link","tertiary_link","service"],!0,!1]],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,["match",["get","class"],["street","street_limited","primary_link"],2,"track",1,.5],18,["match",["get","class"],["street","street_limited","primary_link"],18,12]],"line-color":"hsl(0, 0%, 100%)","line-opacity":["step",["zoom"],0,14,1]}},{id:"bridge-primary-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["match",["get","class"],["primary","secondary","tertiary"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],5,["match",["get","class"],"primary",.75,.1],18,["match",["get","class"],"primary",32,26]],"line-color":"hsl(0, 0%, 100%)"}},{id:"bridge-motorway-trunk",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["match",["get","class"],["motorway","trunk"],!0,!1],["<=",["get","layer"],1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32],"line-color":"hsl(0, 0%, 100%)"}},{id:"bridge-rail",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["match",["get","class"],["major_rail","minor_rail"],!0,!1]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,.5,20,1],"line-color":"hsl(156, 12%, 92%)"}},{id:"bridge-major-link-2-case",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],[">=",["get","layer"],2],["match",["get","class"],["motorway_link","trunk_link"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.75,20,2],"line-color":"hsl(156, 12%, 92%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18]}},{id:"bridge-motorway-trunk-2-case",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],[">=",["get","layer"],2],["match",["get","class"],["motorway","trunk"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],10,1,18,2],"line-color":"hsl(156, 12%, 92%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32]}},{id:"bridge-major-link-2",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],[">=",["get","layer"],2],["match",["get","class"],["motorway_link","trunk_link"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-color":"hsl(0, 0%, 100%)"}},{id:"bridge-motorway-trunk-2",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],[">=",["get","layer"],2],["match",["get","class"],["motorway","trunk"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32],"line-color":"hsl(0, 0%, 100%)"}},{id:"admin-1-boundary-bg",type:"line",metadata:{"mapbox:group":"1444934295202.7542"},source:"composite","source-layer":"admin",filter:["all",["==",["get","admin_level"],1],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","US"],!0,!1]],layout:{"line-join":"bevel"},paint:{"line-blur":["interpolate",["linear"],["zoom"],3,0,8,3],"line-width":["interpolate",["linear"],["zoom"],7,3.75,12,5.5],"line-opacity":["interpolate",["linear"],["zoom"],7,0,8,.75],"line-dasharray":[1,0],"line-translate":[0,0],"line-color":"hsl(0, 0%, 84%)"}},{id:"admin-0-boundary-bg",type:"line",metadata:{"mapbox:group":"1444934295202.7542"},source:"composite","source-layer":"admin",minzoom:1,filter:["all",["==",["get","admin_level"],0],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","US"],!0,!1]],paint:{"line-width":["interpolate",["linear"],["zoom"],3,3.5,10,8],"line-color":"hsl(0, 0%, 84%)","line-opacity":["interpolate",["linear"],["zoom"],3,0,4,.5],"line-translate":[0,0],"line-blur":["interpolate",["linear"],["zoom"],3,0,10,2]}},{id:"admin-1-boundary",type:"line",metadata:{"mapbox:group":"1444934295202.7542"},source:"composite","source-layer":"admin",filter:["all",["==",["get","admin_level"],1],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","US"],!0,!1]],layout:{"line-join":"round","line-cap":"round"},paint:{"line-width":["interpolate",["linear"],["zoom"],7,.75,12,1.5],"line-opacity":["interpolate",["linear"],["zoom"],2,0,3,1],"line-color":["interpolate",["linear"],["zoom"],3,"hsl(0, 0%, 80%)",7,"hsl(0, 0%, 70%)"]}},{id:"admin-0-boundary",type:"line",metadata:{"mapbox:group":"1444934295202.7542"},source:"composite","source-layer":"admin",minzoom:1,filter:["all",["==",["get","admin_level"],0],["==",["get","disputed"],"false"],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","US"],!0,!1]],layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 62%)","line-width":["interpolate",["linear"],["zoom"],3,.5,10,2]}},{id:"admin-0-boundary-disputed",type:"line",metadata:{"mapbox:group":"1444934295202.7542"},source:"composite","source-layer":"admin",minzoom:1,filter:["all",["==",["get","disputed"],"true"],["==",["get","admin_level"],0],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","US"],!0,!1]],layout:{"line-join":"round"},paint:{"line-dasharray":[1.5,1.5],"line-color":"hsl(0, 0%, 62%)","line-width":["interpolate",["linear"],["zoom"],3,.5,10,2]}},{id:"county_border",type:"line",metadata:{"mapbox:group":"1444934295202.7542"},source:"composite","source-layer":"attr_county_labels_pg-155yvu",minzoom:6,maxzoom:12,paint:{"line-width":["interpolate",["linear"],["zoom"],5,.5,9,1.7,18,2],"line-color":"hsl(0, 0%, 59%)","line-opacity":["interpolate",["linear"],["zoom"],5,.2,9,.5,18,1]}},{id:"cousub_border",type:"line",source:"composite","source-layer":"attr_cousub_labels_less_pl-9lemol",minzoom:8,maxzoom:14,layout:{},paint:{"line-color":"hsl(0, 3%, 38%)","line-width":["interpolate",["linear"],["zoom"],0,1,6,1,22,1],"line-opacity":["interpolate",["linear"],["zoom"],7,.1,18,.2]}},{id:"place_border",type:"line",source:"composite","source-layer":"attr_place_labels_less_pl-0n1bxr",minzoom:8,maxzoom:14,paint:{"line-color":"hsla(0, 0%, 58%, 0.62)","line-dasharray":[3,2]}},{id:"road-label",type:"symbol",source:"composite","source-layer":"road",minzoom:10,filter:["step",["zoom"],["match",["get","class"],["motorway","trunk","primary","secondary","tertiary"],!0,!1],12,["match",["get","class"],["motorway","trunk","primary","secondary","tertiary","pedestrian","street","street_limited"],!0,!1],15,["match",["get","class"],["ferry","golf","path"],!1,!0]],layout:{"text-size":["interpolate",["linear"],["zoom"],10,["match",["get","class"],["motorway","trunk","primary","secondary","tertiary"],10,["motorway_link","trunk_link","primary_link","secondary_link","tertiary_link","pedestrian","street","street_limited"],9,6.5],18,["match",["get","class"],["motorway","trunk","primary","secondary","tertiary"],16,["motorway_link","trunk_link","primary_link","secondary_link","tertiary_link","pedestrian","street","street_limited"],14,13]],"text-max-angle":30,"text-font":["DIN Offc Pro Regular","Arial Unicode MS Regular"],"symbol-placement":"line","text-padding":1,"text-rotation-alignment":"map","text-pitch-alignment":"viewport","text-field":["coalesce",["get","name_en"],["get","name"]],"text-letter-spacing":.01},paint:{"text-color":"hsl(0, 0%, 42%)","text-halo-color":["match",["get","class"],["motorway","trunk"],"hsla(0, 0%, 100%, 0.75)","hsl(0, 0%, 100%)"],"text-halo-blur":1,"text-halo-width":.1}},{id:"waterway-label",type:"symbol",source:"composite","source-layer":"natural_label",minzoom:13,filter:["all",["match",["get","class"],["canal","river","stream"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"text-font":["DIN Offc Pro Italic","Arial Unicode MS Regular"],"text-max-angle":30,"symbol-spacing":["interpolate",["linear",1],["zoom"],15,250,17,400],"text-size":["interpolate",["linear"],["zoom"],13,12,18,16],"symbol-placement":"line","text-pitch-alignment":"viewport","text-field":["coalesce",["get","name_en"],["get","name"]]},paint:{"text-color":"hsl(187, 7%, 51%)"}},{id:"natural-line-label",type:"symbol",source:"composite","source-layer":"natural_label",minzoom:4,filter:["all",["match",["get","class"],["glacier","landform"],!0,!1],["==",["geometry-type"],"LineString"],["<=",["get","filterrank"],1]],layout:{"text-size":["step",["zoom"],["step",["get","sizerank"],18,5,12],17,["step",["get","sizerank"],18,13,12]],"text-max-angle":30,"text-field":["coalesce",["get","name_en"],["get","name"]],"text-font":["DIN Offc Pro Medium","Arial Unicode MS Regular"],"symbol-placement":"line-center","text-pitch-alignment":"viewport"},paint:{"text-halo-width":.5,"text-halo-color":"hsl(0, 0%, 100%)","text-halo-blur":.5,"text-color":"hsl(0, 0%, 42%)"}},{id:"natural-point-label",type:"symbol",source:"composite","source-layer":"natural_label",minzoom:4,filter:["all",["match",["get","class"],["dock","glacier","landform","water_feature","wetland"],!0,!1],["==",["geometry-type"],"Point"],["<=",["get","filterrank"],1]],layout:{"text-size":["step",["zoom"],["step",["get","sizerank"],18,5,12],17,["step",["get","sizerank"],18,13,12]],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-font":["DIN Offc Pro Medium","Arial Unicode MS Regular"],"text-offset":["literal",[0,0]]},paint:{"text-color":"hsl(0, 0%, 42%)","text-halo-color":"hsl(0, 0%, 100%)","text-halo-width":.5,"text-halo-blur":.5}},{id:"water-line-label",type:"symbol",source:"composite","source-layer":"natural_label",filter:["all",["match",["get","class"],["bay","ocean","reservoir","sea","water"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"text-size":["interpolate",["linear"],["zoom"],7,["step",["get","sizerank"],24,6,18,12,12],10,["step",["get","sizerank"],18,9,12],18,["step",["get","sizerank"],18,9,16]],"text-max-angle":30,"text-letter-spacing":["match",["get","class"],"ocean",.25,["sea","bay"],.15,0],"text-font":["DIN Offc Pro Italic","Arial Unicode MS Regular"],"symbol-placement":"line-center","text-pitch-alignment":"viewport","text-field":["coalesce",["get","name_en"],["get","name"]]},paint:{"text-color":"hsl(187, 7%, 51%)"}},{id:"water-point-label",type:"symbol",source:"composite","source-layer":"natural_label",filter:["all",["match",["get","class"],["bay","ocean","reservoir","sea","water"],!0,!1],["==",["geometry-type"],"Point"]],layout:{"text-line-height":1.3,"text-size":["interpolate",["linear"],["zoom"],7,["step",["get","sizerank"],24,6,18,12,12],10,["step",["get","sizerank"],18,9,12]],"text-font":["DIN Offc Pro Italic","Arial Unicode MS Regular"],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-letter-spacing":["match",["get","class"],"ocean",.25,["bay","sea"],.15,.01],"text-max-width":["match",["get","class"],"ocean",4,"sea",5,["bay","water"],7,10]},paint:{"text-color":"hsl(187, 7%, 51%)"}},{id:"poi-label",type:"symbol",source:"composite","source-layer":"poi_label",minzoom:6,filter:["<=",["get","filterrank"],1],layout:{"text-size":["step",["zoom"],["step",["get","sizerank"],18,5,12],17,["step",["get","sizerank"],18,13,12]],"text-font":["DIN Offc Pro Medium","Arial Unicode MS Regular"],"text-field":["coalesce",["get","name_en"],["get","name"]]},paint:{"text-halo-color":"hsl(0, 0%, 100%)","text-halo-width":.1,"text-halo-blur":.5,"text-color":["step",["zoom"],["step",["get","sizerank"],"hsl(0, 0%, 66%)",5,"hsl(230, 0%, 56%)"],17,["step",["get","sizerank"],"hsl(0, 0%, 66%)",13,"hsl(0, 0%, 56%)"]]}},{id:"airport-label",type:"symbol",source:"composite","source-layer":"airport_label",minzoom:8,layout:{"text-line-height":1.1,"text-size":["step",["get","sizerank"],18,9,12],"icon-image":["step",["get","sizerank"],["concat",["get","maki"],"-15"],9,["concat",["get","maki"],"-11"]],"text-font":["DIN Offc Pro Medium","Arial Unicode MS Regular"],visibility:"none","text-offset":[0,.75],"text-rotation-alignment":"viewport","text-anchor":"top","text-field":["step",["get","sizerank"],["coalesce",["get","name_en"],["get","name"]],15,["get","ref"]],"text-letter-spacing":.01,"text-max-width":9},paint:{"text-color":"hsla(0, 0%, 42%, 0)","text-halo-color":"hsl(0, 0%, 100%)","text-halo-width":1,"text-opacity":0}},{id:"settlement-subdivision-label",type:"symbol",source:"composite","source-layer":"place_label",minzoom:10,maxzoom:15,filter:["all",["==",["get","class"],"settlement_subdivision"],["<=",["get","filterrank"],4]],layout:{"text-field":["coalesce",["get","name_en"],["get","name"]],"text-transform":"uppercase","text-font":["DIN Offc Pro Regular","Arial Unicode MS Regular"],"text-letter-spacing":["match",["get","type"],"suburb",.15,.1],"text-max-width":7,"text-padding":3,"text-size":["interpolate",["cubic-bezier",.5,0,1,1],["zoom"],11,["match",["get","type"],"suburb",11,10.5],15,["match",["get","type"],"suburb",17,16]],visibility:"none"},paint:{"text-halo-color":"hsl(0, 0%, 100%)","text-color":"hsl(0, 0%, 62%)","text-halo-blur":.5,"text-halo-width":.1}},{id:"state-label",type:"symbol",source:"composite","source-layer":"place_label",minzoom:3,maxzoom:9,filter:["==",["get","class"],"state"],layout:{"text-size":["interpolate",["cubic-bezier",.85,.7,.65,1],["zoom"],4,["step",["get","symbolrank"],10,6,9.5,7,9],9,["step",["get","symbolrank"],24,6,18,7,14]],"text-transform":"uppercase","text-font":["DIN Offc Pro Bold","Arial Unicode MS Bold"],"text-field":["step",["zoom"],["step",["get","symbolrank"],["coalesce",["get","name_en"],["get","name"]],5,["coalesce",["get","abbr"],["get","name_en"],["get","name"]]],5,["coalesce",["get","name_en"],["get","name"]]],"text-letter-spacing":.15,"text-max-width":6},paint:{"text-halo-color":"hsl(0, 0%, 100%)","text-color":"hsl(0, 0%, 66%)","text-halo-width":.1}},{id:"county_label",type:"symbol",source:"composite","source-layer":"attr_county_labels-5i5o0f",minzoom:7.5,maxzoom:14,layout:{"text-field":["step",["zoom"],["upcase",["to-string",["get","name"]]],6,["upcase",["to-string",["get","name"]]],10,["upcase",["to-string",["get","namelsad"]]],22,["upcase",["to-string",["get","namelsad"]]]],"text-font":["step",["zoom"],["literal",["Open Sans Regular","Arial Unicode MS Regular"]],6,["literal",["Montserrat Medium","Arial Unicode MS Regular"]],8,["literal",["Montserrat Medium","Arial Unicode MS Regular"]],11,["literal",["Montserrat Medium","Arial Unicode MS Regular"]],22,["literal",["Montserrat Medium","Arial Unicode MS Regular"]]],"text-size":["interpolate",["linear"],["zoom"],0,0,6,6,6.5,10,7.5,14,9,30,11,75,14,85],"text-allow-overlap":["step",["zoom"],!1,5,!1,10,!1,11,!0],"text-max-width":5,"text-ignore-placement":["step",["zoom"],!1,6,!1,9,!0,12,!0,22,!0]},paint:{"text-color":"hsl(0, 0%, 48%)","text-opacity":["interpolate",["linear"],["zoom"],6.49999,1,6.5,.7,8,.3,11,.1,16,.05]}},{id:"cousub_label",type:"symbol",source:"composite","source-layer":"attr_cousub_labels_plus_pt-0kx5lj",minzoom:9,layout:{"text-field":["upcase",["get","display_name"]],"text-size":["interpolate",["linear"],["zoom"],7.9,0,8,8,9,10,14,30],"text-max-width":5,"text-line-height":1.1,visibility:"none"},paint:{"text-color":"hsla(0, 0%, 31%, 0.76)","text-halo-width":10,"text-halo-color":"hsl(0, 0%, 100%)"}},{id:"place-label new",type:"symbol",source:"composite","source-layer":"rural_places-4rf4i9",minzoom:9,filter:["match",["get","census_boundary_year"],[2020],!0,!1],layout:{"text-line-height":1.1,"text-size":["interpolate",["cubic-bezier",.2,0,.9,1],["zoom"],3,["step",["get","symbolrank"],12,9,11,10,10.5,12,9.5,14,8.5,16,6.5,17,4],15,["step",["get","symbolrank"],28,9,26,10,23,11,21,12,20,13,19,15,17]],"icon-image":["case",["==",["get","capital"],2],"border-dot-13",["step",["get","symbolrank"],"dot-11",9,"dot-10",11,"dot-9"]],"text-font":["Montserrat Medium","Arial Unicode MS Regular"],"text-justify":["step",["zoom"],["match",["get","text_anchor"],["left","bottom-left","top-left"],"left",["right","bottom-right","top-right"],"right","center"],8,"center"],visibility:"none","text-offset":["step",["zoom"],["match",["get","capital"],2,["match",["get","text_anchor"],"bottom",["literal",[0,-.3]],"bottom-left",["literal",[.3,-.1]],"left",["literal",[.45,.1]],"top-left",["literal",[.3,.1]],"top",["literal",[0,.3]],"top-right",["literal",[-.3,.1]],"right",["literal",[-.45,0]],"bottom-right",["literal",[-.3,-.1]],["literal",[0,-.3]]],["match",["get","text_anchor"],"bottom",["literal",[0,-.25]],"bottom-left",["literal",[.2,-.05]],"left",["literal",[.4,.05]],"top-left",["literal",[.2,.05]],"top",["literal",[0,.25]],"top-right",["literal",[-.2,.05]],"right",["literal",[-.4,.05]],"bottom-right",["literal",[-.2,-.05]],["literal",[0,-.25]]]],8,["literal",[0,0]]],"text-anchor":["step",["zoom"],["get","text_anchor"],8,"center"],"text-field":["coalesce",["get","NAME"]],"text-max-width":7},paint:{"text-color":["step",["get","symbolrank"],"hsl(0, 2%, 61%)",11,"hsl(0, 1%, 68%)",16,"hsl(0, 1%, 75%)"],"text-halo-color":"hsl(0, 0%, 100%)","icon-opacity":["step",["zoom"],1,8,0],"text-halo-blur":1,"text-halo-width":.1}},{id:"settlement-label",type:"symbol",source:"composite","source-layer":"place_label",maxzoom:10.76,filter:["all",["<=",["get","filterrank"],3],["==",["get","class"],"settlement"],["step",["zoom"],!0,12,[">=",["get","symbolrank"],11],13,[">=",["get","symbolrank"],12]]],layout:{"text-line-height":1.1,"text-size":["interpolate",["cubic-bezier",.2,0,.9,1],["zoom"],3,["step",["get","symbolrank"],12,9,11,10,10.5,12,9.5,14,8.5,16,6.5,17,4],15,["step",["get","symbolrank"],28,9,26,10,23,11,21,12,20,13,19,15,17]],"icon-image":["case",["==",["get","capital"],2],"border-dot-13",["step",["get","symbolrank"],"dot-11",9,"dot-10",11,"dot-9"]],"text-font":["step",["zoom"],["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]],8,["step",["get","symbolrank"],["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]],11,["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]]],10,["step",["get","symbolrank"],["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]],12,["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]]],11,["step",["get","symbolrank"],["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]],13,["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]]],12,["step",["get","symbolrank"],["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]],15,["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]]],13,["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]]],"text-justify":["step",["zoom"],["match",["get","text_anchor"],["left","bottom-left","top-left"],"left",["right","bottom-right","top-right"],"right","center"],8,"center"],"text-offset":["step",["zoom"],["match",["get","capital"],2,["match",["get","text_anchor"],"bottom",["literal",[0,-.3]],"bottom-left",["literal",[.3,-.1]],"left",["literal",[.45,.1]],"top-left",["literal",[.3,.1]],"top",["literal",[0,.3]],"top-right",["literal",[-.3,.1]],"right",["literal",[-.45,0]],"bottom-right",["literal",[-.3,-.1]],["literal",[0,-.3]]],["match",["get","text_anchor"],"bottom",["literal",[0,-.25]],"bottom-left",["literal",[.2,-.05]],"left",["literal",[.4,.05]],"top-left",["literal",[.2,.05]],"top",["literal",[0,.25]],"top-right",["literal",[-.2,.05]],"right",["literal",[-.4,.05]],"bottom-right",["literal",[-.2,-.05]],["literal",[0,-.25]]]],8,["literal",[0,0]]],"text-anchor":["step",["zoom"],["get","text_anchor"],8,"center"],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-max-width":7},paint:{"text-color":["step",["get","symbolrank"],"hsl(0, 0%, 42%)",11,"hsl(0, 0%, 55%)",16,"hsl(0, 0%, 62%)"],"text-halo-color":"hsl(0, 0%, 100%)","icon-opacity":["step",["zoom"],1,8,0],"text-halo-blur":1,"text-halo-width":.1}},{id:"wwb2s-places_lat_lon",type:"symbol",source:"composite","source-layer":"places_lat_lon-awryh9",minzoom:10.75,maxzoom:20,filter:["all",[">=",["get","pop"],101],[">",["get","pct_rural"],0],["step",["zoom"],!0,13,[">=",["get","symbolrank"],11],14,[">=",["get","symbolrank"],13]]],layout:{"text-line-height":1.1,"text-size":["step",["get","symbolrank"],20,9,18,10,16,11,14,12,12],"icon-image":["case",["==",["get","capital"],2],"border-dot-13",["step",["get","symbolrank"],"dot-11",9,"dot-10",11,"dot-9"]],"text-font":["step",["zoom"],["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]],8,["step",["get","symbolrank"],["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]],11,["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]]],10,["step",["get","symbolrank"],["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]],12,["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]]],11,["step",["get","symbolrank"],["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]],13,["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]]],12,["step",["get","symbolrank"],["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]],15,["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]]],13,["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]]],"text-justify":["step",["zoom"],["match",["get","text_anchor"],["left","bottom-left","top-left"],"left",["right","bottom-right","top-right"],"right","center"],8,"center"],"text-offset":["step",["zoom"],["match",["get","capital"],2,["match",["get","text_anchor"],"bottom",["literal",[0,-.3]],"bottom-left",["literal",[.3,-.1]],"left",["literal",[.45,.1]],"top-left",["literal",[.3,.1]],"top",["literal",[0,.3]],"top-right",["literal",[-.3,.1]],"right",["literal",[-.45,0]],"bottom-right",["literal",[-.3,-.1]],["literal",[0,-.3]]],["match",["get","text_anchor"],"bottom",["literal",[0,-.25]],"bottom-left",["literal",[.2,-.05]],"left",["literal",[.4,.05]],"top-left",["literal",[.2,.05]],"top",["literal",[0,.25]],"top-right",["literal",[-.2,.05]],"right",["literal",[-.4,.05]],"bottom-right",["literal",[-.2,-.05]],["literal",[0,-.25]]]],8,["literal",[0,0]]],"text-anchor":["step",["zoom"],["get","text_anchor"],8,"center"],"text-field":["coalesce",["get","NAME"],["get","name"]],"text-max-width":7},paint:{"text-halo-color":"hsl(0, 0%, 100%)","icon-opacity":["step",["zoom"],1,8,0],"text-halo-blur":1,"text-halo-width":.1,"text-color":["interpolate",["linear"],["zoom"],0,"hsl(0, 0%, 62%)",22,"#000000"],"text-opacity":["interpolate",["linear"],["zoom"],7,0,9,.97,22,1]}},{id:"custom-pattern",type:"fill",source:"composite","source-layer":"attr_county_labels_pg-155yvu",minzoom:6,layout:{visibility:"none"},paint:{"fill-color":"hsla(303, 73%, 74%, 0.66)","fill-pattern":"stripe-4"}}],bF="2022-02-24T13:16:14.872Z",EF="2024-07-11T16:18:50.102Z",TF="cl010e7b7001p15pe3l0306hv",SF="ruralinno",AF="private",CF=!1,IF={version:hF,name:dF,metadata:pF,center:fF,zoom:mF,bearing:gF,pitch:_F,sources:yF,sprite:vF,glyphs:xF,layers:wF,created:bF,modified:EF,id:TF,owner:SF,visibility:AF,protected:!1,draft:CF};/* + * Frontend UI component library for the CORI Data API + * {@link https://github.com/ruralinnovation/cori.data.api} + * @copyright Rural Innovation Strategies, Inc. + * @license ISC + */Object.assign({},IF);function Zp(e){let n="https://mui.com/production-error/?code="+e;for(let l=1;l0?Nr(vh,--Pi):0,uh--,yr===10&&(uh=1,D_--),yr}function Wi(){return yr=Pi2||Xp(yr)>3?"":" "}function GF(e,n){for(;--n&&Wi()&&!(yr<48||yr>102||yr>57&&yr<65||yr>70&&yr<97););return of(e,bg()+(n<6&&ws()==32&&Wi()==32))}function m1(e){for(;Wi();)switch(yr){case e:return Pi;case 34:case 39:e!==34&&e!==39&&m1(yr);break;case 40:e===41&&m1(e);break;case 92:Wi();break}return Pi}function qF(e,n){for(;Wi()&&e+yr!==47+10;)if(e+yr===42+42&&ws()===47)break;return"/*"+of(n,Pi-1)+"*"+R_(e===47?e:Wi())}function WF(e){for(;!Xp(ws());)Wi();return of(e,Pi)}function ZF(e){return BI(Tg("",null,null,null,[""],e=OI(e),0,[0],e))}function Tg(e,n,l,h,m,v,E,s,k){for(var D=0,V=0,G=E,J=0,ve=0,ae=0,me=1,Ce=1,ie=1,te=0,le="",ze=m,Oe=v,Ke=h,He=le;Ce;)switch(ae=te,te=Wi()){case 40:if(ae!=108&&Nr(He,G-1)==58){f1(He+=yn(Eg(te),"&","&\f"),"&\f")!=-1&&(ie=-1);break}case 34:case 39:case 91:He+=Eg(te);break;case 9:case 10:case 13:case 32:He+=$F(ae);break;case 92:He+=GF(bg()-1,7);continue;case 47:switch(ws()){case 42:case 47:rg(HF(qF(Wi(),bg()),n,l),k);break;default:He+="/"}break;case 123*me:s[D++]=_s(He)*ie;case 125*me:case 59:case 0:switch(te){case 0:case 125:Ce=0;case 59+V:ie==-1&&(He=yn(He,/\f/g,"")),ve>0&&_s(He)-G&&rg(ve>32?OT(He+";",h,l,G-1):OT(yn(He," ","")+";",h,l,G-2),k);break;case 59:He+=";";default:if(rg(Ke=DT(He,n,l,D,V,m,s,le,ze=[],Oe=[],G),v),te===123)if(V===0)Tg(He,n,Ke,Ke,ze,v,G,s,Oe);else switch(J===99&&Nr(He,3)===110?100:J){case 100:case 108:case 109:case 115:Tg(e,Ke,Ke,h&&rg(DT(e,Ke,Ke,0,0,m,s,le,m,ze=[],G),Oe),m,Oe,G,s,h?ze:Oe);break;default:Tg(He,Ke,Ke,Ke,[""],Oe,0,s,Oe)}}D=V=ve=0,me=ie=1,le=He="",G=E;break;case 58:G=1+_s(He),ve=ae;default:if(me<1){if(te==123)--me;else if(te==125&&me++==0&&VF()==125)continue}switch(He+=R_(te),te*me){case 38:ie=V>0?1:(He+="\f",-1);break;case 44:s[D++]=(_s(He)-1)*ie,ie=1;break;case 64:ws()===45&&(He+=Eg(Wi())),J=ws(),V=G=_s(le=He+=WF(bg())),te++;break;case 45:ae===45&&_s(He)==2&&(me=0)}}return v}function DT(e,n,l,h,m,v,E,s,k,D,V){for(var G=m-1,J=m===0?v:[""],ve=Lx(J),ae=0,me=0,Ce=0;ae0?J[ie]+" "+te:yn(te,/&\f/g,J[ie])))&&(k[Ce++]=le);return O_(e,n,l,m===0?Px:s,k,D,V)}function HF(e,n,l){return O_(e,n,l,zI,R_(jF()),Hp(e,2,-2),0)}function OT(e,n,l,h){return O_(e,n,l,zx,Hp(e,0,h),Hp(e,h+1,-1),h)}function Qu(e,n){for(var l="",h=Lx(e),m=0;m6)switch(Nr(e,n+1)){case 109:if(Nr(e,n+4)!==45)break;case 102:return yn(e,/(.+:)(.+)-([^]+)/,"$1"+_n+"$2-$3$1"+i_+(Nr(e,n+3)==108?"$3":"$2-$3"))+e;case 115:return~f1(e,"stretch")?FI(yn(e,"stretch","fill-available"),n)+e:e}break;case 4949:if(Nr(e,n+1)!==115)break;case 6444:switch(Nr(e,_s(e)-3-(~f1(e,"!important")&&10))){case 107:return yn(e,":",":"+_n)+e;case 101:return yn(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+_n+(Nr(e,14)===45?"inline-":"")+"box$3$1"+_n+"$2$3$1"+ei+"$2box$3")+e}break;case 5936:switch(Nr(e,n+11)){case 114:return _n+e+ei+yn(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return _n+e+ei+yn(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return _n+e+ei+yn(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return _n+e+ei+e+e}return e}var r6=function(n,l,h,m){if(n.length>-1&&!n.return)switch(n.type){case zx:n.return=FI(n.value,n.length);break;case LI:return Qu([lp(n,{value:yn(n.value,"@","@"+_n)})],m);case Px:if(n.length)return UF(n.props,function(v){switch(NF(v,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Qu([lp(n,{props:[yn(v,/:(read-\w+)/,":"+i_+"$1")]})],m);case"::placeholder":return Qu([lp(n,{props:[yn(v,/:(plac\w+)/,":"+_n+"input-$1")]}),lp(n,{props:[yn(v,/:(plac\w+)/,":"+i_+"$1")]}),lp(n,{props:[yn(v,/:(plac\w+)/,ei+"input-$1")]})],m)}return""})}},i6=[r6],o6=function(n){var l=n.key;if(l==="css"){var h=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(h,function(me){var Ce=me.getAttribute("data-emotion");Ce.indexOf(" ")!==-1&&(document.head.appendChild(me),me.setAttribute("data-s",""))})}var m=n.stylisPlugins||i6,v={},E,s=[];E=n.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+l+' "]'),function(me){for(var Ce=me.getAttribute("data-emotion").split(" "),ie=1;ie{n[l]=VI(e[l])}),n}function ea(e,n,l={clone:!0}){const h=l.clone?Bn({},e):e;return Pu(e)&&Pu(n)&&Object.keys(n).forEach(m=>{Pu(n[m])&&Object.prototype.hasOwnProperty.call(e,m)&&Pu(e[m])?h[m]=ea(e[m],n[m],l):l.clone?h[m]=Pu(n[m])?VI(n[m]):n[m]:h[m]=n[m]}),h}const p6=["values","unit","step"],f6=e=>{const n=Object.keys(e).map(l=>({key:l,val:e[l]}))||[];return n.sort((l,h)=>l.val-h.val),n.reduce((l,h)=>Bn({},l,{[h.key]:h.val}),{})};function m6(e){const{values:n={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:l="px",step:h=5}=e,m=pl(e,p6),v=f6(n),E=Object.keys(v);function s(J){return`@media (min-width:${typeof n[J]=="number"?n[J]:J}${l})`}function k(J){return`@media (max-width:${(typeof n[J]=="number"?n[J]:J)-h/100}${l})`}function D(J,ve){const ae=E.indexOf(ve);return`@media (min-width:${typeof n[J]=="number"?n[J]:J}${l}) and (max-width:${(ae!==-1&&typeof n[E[ae]]=="number"?n[E[ae]]:ve)-h/100}${l})`}function V(J){return E.indexOf(J)+1`@media (min-width:${Rx[e]}px)`};function oa(e,n,l){const h=e.theme||{};if(Array.isArray(n)){const v=h.breakpoints||FT;return n.reduce((E,s,k)=>(E[v.up(v.keys[k])]=l(n[k]),E),{})}if(typeof n=="object"){const v=h.breakpoints||FT;return Object.keys(n).reduce((E,s)=>{if(Object.keys(v.values||Rx).indexOf(s)!==-1){const k=v.up(s);E[k]=l(n[s],s)}else{const k=s;E[k]=n[k]}return E},{})}return l(n)}function y6(e={}){var n;return((n=e.keys)==null?void 0:n.reduce((h,m)=>{const v=e.up(m);return h[v]={},h},{}))||{}}function v6(e,n){return e.reduce((l,h)=>{const m=l[h];return(!m||Object.keys(m).length===0)&&delete l[h],l},n)}function $I(e){if(typeof e!="string")throw new Error(Zp(7));return e.charAt(0).toUpperCase()+e.slice(1)}function F_(e,n,l=!0){if(!n||typeof n!="string")return null;if(e&&e.vars&&l){const h=`vars.${n}`.split(".").reduce((m,v)=>m&&m[v]?m[v]:null,e);if(h!=null)return h}return n.split(".").reduce((h,m)=>h&&h[m]!=null?h[m]:null,e)}function o_(e,n,l,h=l){let m;return typeof e=="function"?m=e(l):Array.isArray(e)?m=e[l]||h:m=F_(e,l)||h,n&&(m=n(m,h,e)),m}function cr(e){const{prop:n,cssProperty:l=e.prop,themeKey:h,transform:m}=e,v=E=>{if(E[n]==null)return null;const s=E[n],k=E.theme,D=F_(k,h)||{};return oa(E,s,G=>{let J=o_(D,m,G);return G===J&&typeof G=="string"&&(J=o_(D,m,`${n}${G==="default"?"":$I(G)}`,G)),l===!1?J:{[l]:J}})};return v.propTypes={},v.filterProps=[n],v}function x6(e){const n={};return l=>(n[l]===void 0&&(n[l]=e(l)),n[l])}const w6={m:"margin",p:"padding"},b6={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},NT={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},E6=x6(e=>{if(e.length>2)if(NT[e])e=NT[e];else return[e];const[n,l]=e.split(""),h=w6[n],m=b6[l]||"";return Array.isArray(m)?m.map(v=>h+v):[h+m]}),Dx=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Ox=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...Dx,...Ox];function sf(e,n,l,h){var m;const v=(m=F_(e,n,!1))!=null?m:l;return typeof v=="number"?E=>typeof E=="string"?E:v*E:Array.isArray(v)?E=>typeof E=="string"?E:v[E]:typeof v=="function"?v:()=>{}}function GI(e){return sf(e,"spacing",8)}function af(e,n){if(typeof n=="string"||n==null)return n;const l=Math.abs(n),h=e(l);return n>=0?h:typeof h=="number"?-h:`-${h}`}function T6(e,n){return l=>e.reduce((h,m)=>(h[m]=af(n,l),h),{})}function S6(e,n,l,h){if(n.indexOf(l)===-1)return null;const m=E6(l),v=T6(m,h),E=e[l];return oa(e,E,v)}function qI(e,n){const l=GI(e.theme);return Object.keys(e).map(h=>S6(e,n,h,l)).reduce(Tp,{})}function rr(e){return qI(e,Dx)}rr.propTypes={};rr.filterProps=Dx;function ir(e){return qI(e,Ox)}ir.propTypes={};ir.filterProps=Ox;function A6(e=8){if(e.mui)return e;const n=GI({spacing:e}),l=(...h)=>(h.length===0?[1]:h).map(v=>{const E=n(v);return typeof E=="number"?`${E}px`:E}).join(" ");return l.mui=!0,l}function N_(...e){const n=e.reduce((h,m)=>(m.filterProps.forEach(v=>{h[v]=m}),h),{}),l=h=>Object.keys(h).reduce((m,v)=>n[v]?Tp(m,n[v](h)):m,{});return l.propTypes={},l.filterProps=e.reduce((h,m)=>h.concat(m.filterProps),[]),l}function ho(e){return typeof e!="number"?e:`${e}px solid`}function yo(e,n){return cr({prop:e,themeKey:"borders",transform:n})}const C6=yo("border",ho),I6=yo("borderTop",ho),k6=yo("borderRight",ho),M6=yo("borderBottom",ho),P6=yo("borderLeft",ho),z6=yo("borderColor"),L6=yo("borderTopColor"),R6=yo("borderRightColor"),D6=yo("borderBottomColor"),O6=yo("borderLeftColor"),B6=yo("outline",ho),F6=yo("outlineColor"),U_=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const n=sf(e.theme,"shape.borderRadius",4),l=h=>({borderRadius:af(n,h)});return oa(e,e.borderRadius,l)}return null};U_.propTypes={};U_.filterProps=["borderRadius"];N_(C6,I6,k6,M6,P6,z6,L6,R6,D6,O6,U_,B6,F6);const j_=e=>{if(e.gap!==void 0&&e.gap!==null){const n=sf(e.theme,"spacing",8),l=h=>({gap:af(n,h)});return oa(e,e.gap,l)}return null};j_.propTypes={};j_.filterProps=["gap"];const V_=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const n=sf(e.theme,"spacing",8),l=h=>({columnGap:af(n,h)});return oa(e,e.columnGap,l)}return null};V_.propTypes={};V_.filterProps=["columnGap"];const $_=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const n=sf(e.theme,"spacing",8),l=h=>({rowGap:af(n,h)});return oa(e,e.rowGap,l)}return null};$_.propTypes={};$_.filterProps=["rowGap"];const N6=cr({prop:"gridColumn"}),U6=cr({prop:"gridRow"}),j6=cr({prop:"gridAutoFlow"}),V6=cr({prop:"gridAutoColumns"}),$6=cr({prop:"gridAutoRows"}),G6=cr({prop:"gridTemplateColumns"}),q6=cr({prop:"gridTemplateRows"}),W6=cr({prop:"gridTemplateAreas"}),Z6=cr({prop:"gridArea"});N_(j_,V_,$_,N6,U6,j6,V6,$6,G6,q6,W6,Z6);function eh(e,n){return n==="grey"?n:e}const H6=cr({prop:"color",themeKey:"palette",transform:eh}),X6=cr({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:eh}),K6=cr({prop:"backgroundColor",themeKey:"palette",transform:eh});N_(H6,X6,K6);function Vi(e){return e<=1&&e!==0?`${e*100}%`:e}const Y6=cr({prop:"width",transform:Vi}),Bx=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const n=l=>{var h,m;const v=((h=e.theme)==null||(h=h.breakpoints)==null||(h=h.values)==null?void 0:h[l])||Rx[l];return v?((m=e.theme)==null||(m=m.breakpoints)==null?void 0:m.unit)!=="px"?{maxWidth:`${v}${e.theme.breakpoints.unit}`}:{maxWidth:v}:{maxWidth:Vi(l)}};return oa(e,e.maxWidth,n)}return null};Bx.filterProps=["maxWidth"];const J6=cr({prop:"minWidth",transform:Vi}),Q6=cr({prop:"height",transform:Vi}),eN=cr({prop:"maxHeight",transform:Vi}),tN=cr({prop:"minHeight",transform:Vi});cr({prop:"size",cssProperty:"width",transform:Vi});cr({prop:"size",cssProperty:"height",transform:Vi});const nN=cr({prop:"boxSizing"});N_(Y6,Bx,J6,Q6,eN,tN,nN);const rN={border:{themeKey:"borders",transform:ho},borderTop:{themeKey:"borders",transform:ho},borderRight:{themeKey:"borders",transform:ho},borderBottom:{themeKey:"borders",transform:ho},borderLeft:{themeKey:"borders",transform:ho},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:ho},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:U_},color:{themeKey:"palette",transform:eh},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:eh},backgroundColor:{themeKey:"palette",transform:eh},p:{style:ir},pt:{style:ir},pr:{style:ir},pb:{style:ir},pl:{style:ir},px:{style:ir},py:{style:ir},padding:{style:ir},paddingTop:{style:ir},paddingRight:{style:ir},paddingBottom:{style:ir},paddingLeft:{style:ir},paddingX:{style:ir},paddingY:{style:ir},paddingInline:{style:ir},paddingInlineStart:{style:ir},paddingInlineEnd:{style:ir},paddingBlock:{style:ir},paddingBlockStart:{style:ir},paddingBlockEnd:{style:ir},m:{style:rr},mt:{style:rr},mr:{style:rr},mb:{style:rr},ml:{style:rr},mx:{style:rr},my:{style:rr},margin:{style:rr},marginTop:{style:rr},marginRight:{style:rr},marginBottom:{style:rr},marginLeft:{style:rr},marginX:{style:rr},marginY:{style:rr},marginInline:{style:rr},marginInlineStart:{style:rr},marginInlineEnd:{style:rr},marginBlock:{style:rr},marginBlockStart:{style:rr},marginBlockEnd:{style:rr},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:j_},rowGap:{style:$_},columnGap:{style:V_},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Vi},maxWidth:{style:Bx},minWidth:{transform:Vi},height:{transform:Vi},maxHeight:{transform:Vi},minHeight:{transform:Vi},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}},Fx=rN;function iN(...e){const n=e.reduce((h,m)=>h.concat(Object.keys(m)),[]),l=new Set(n);return e.every(h=>l.size===Object.keys(h).length)}function oN(e,n){return typeof e=="function"?e(n):e}function sN(){function e(l,h,m,v){const E={[l]:h,theme:m},s=v[l];if(!s)return{[l]:h};const{cssProperty:k=l,themeKey:D,transform:V,style:G}=s;if(h==null)return null;if(D==="typography"&&h==="inherit")return{[l]:h};const J=F_(m,D)||{};return G?G(E):oa(E,h,ae=>{let me=o_(J,V,ae);return ae===me&&typeof ae=="string"&&(me=o_(J,V,`${l}${ae==="default"?"":$I(ae)}`,ae)),k===!1?me:{[k]:me}})}function n(l){var h;const{sx:m,theme:v={}}=l||{};if(!m)return null;const E=(h=v.unstable_sxConfig)!=null?h:Fx;function s(k){let D=k;if(typeof k=="function")D=k(v);else if(typeof k!="object")return k;if(!D)return null;const V=y6(v.breakpoints),G=Object.keys(V);let J=V;return Object.keys(D).forEach(ve=>{const ae=oN(D[ve],v);if(ae!=null)if(typeof ae=="object")if(E[ve])J=Tp(J,e(ve,ae,v,E));else{const me=oa({theme:v},ae,Ce=>({[ve]:Ce}));iN(me,ae)?J[ve]=n({sx:ae,theme:v}):J=Tp(J,me)}else J=Tp(J,e(ve,ae,v,E))}),v6(G,J)}return Array.isArray(m)?m.map(s):s(m)}return n}const WI=sN();WI.filterProps=["sx"];const ZI=WI;function aN(e,n){const l=this;return l.vars&&typeof l.getColorSchemeSelector=="function"?{[l.getColorSchemeSelector(e).replace(/(\[[^\]]+\])/,"*:where($1)")]:n}:l.palette.mode===e?n:{}}const lN=["breakpoints","palette","spacing","shape"];function cN(e={},...n){const{breakpoints:l={},palette:h={},spacing:m,shape:v={}}=e,E=pl(e,lN),s=m6(l),k=A6(m);let D=ea({breakpoints:s,direction:"ltr",components:{},palette:Bn({mode:"light"},h),spacing:k,shape:Bn({},_6,v)},E);return D.applyStyles=aN,D=n.reduce((V,G)=>ea(V,G),D),D.unstable_sxConfig=Bn({},Fx,E==null?void 0:E.unstable_sxConfig),D.unstable_sx=function(G){return ZI({sx:G,theme:this})},D}function uN(e){return Object.keys(e).length===0}function hN(e=null){const n=ut.useContext(NI);return!n||uN(n)?e:n}function dN(e,n=Number.MIN_SAFE_INTEGER,l=Number.MAX_SAFE_INTEGER){return Math.max(n,Math.min(e,l))}const pN=Object.freeze(Object.defineProperty({__proto__:null,default:dN},Symbol.toStringTag,{value:"Module"})),fN=ut.createContext(null),HI=fN;function XI(){return ut.useContext(HI)}const mN=typeof Symbol=="function"&&Symbol.for,gN=mN?Symbol.for("mui.nested"):"__THEME_NESTED__";function _N(e,n){return typeof n=="function"?n(e):Bn({},e,n)}function yN(e){const{children:n,theme:l}=e,h=XI(),m=ut.useMemo(()=>{const v=h===null?l:_N(h,l);return v!=null&&(v[gN]=h!==null),v},[l,h]);return Ka.jsx(HI.Provider,{value:m,children:n})}const vN=["value"],xN=ut.createContext();function wN(e){let{value:n}=e,l=pl(e,vN);return Ka.jsx(xN.Provider,Bn({value:n??!0},l))}const bN=ut.createContext(void 0);function EN({value:e,children:n}){return Ka.jsx(bN.Provider,{value:e,children:n})}const UT={};function jT(e,n,l,h=!1){return ut.useMemo(()=>{const m=e&&n[e]||n;if(typeof l=="function"){const v=l(m),E=e?Bn({},n,{[e]:v}):v;return h?()=>E:E}return e?Bn({},n,{[e]:l}):Bn({},n,l)},[e,n,l,h])}function TN(e){const{children:n,theme:l,themeId:h}=e,m=hN(UT),v=XI()||UT,E=jT(h,m,l),s=jT(h,v,l,!0),k=E.direction==="rtl";return Ka.jsx(yN,{theme:s,children:Ka.jsx(NI.Provider,{value:E,children:Ka.jsx(wN,{value:k,children:Ka.jsx(EN,{value:E==null?void 0:E.components,children:n})})})})}function SN(e,n){return Bn({toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}}},n)}var ur={},KI={exports:{}};(function(e){function n(l){return l&&l.__esModule?l:{default:l}}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(KI);var AN=KI.exports;const CN=XT(kF),IN=XT(pN);var YI=AN;Object.defineProperty(ur,"__esModule",{value:!0});ur.alpha=tk;ur.blend=jN;ur.colorChannel=void 0;var kN=ur.darken=Ux;ur.decomposeColor=_o;ur.emphasize=nk;var MN=ur.getContrastRatio=ON;ur.getLuminance=s_;ur.hexToRgb=JI;ur.hslToRgb=ek;var PN=ur.lighten=jx;ur.private_safeAlpha=BN;ur.private_safeColorChannel=void 0;ur.private_safeDarken=FN;ur.private_safeEmphasize=UN;ur.private_safeLighten=NN;ur.recomposeColor=xh;ur.rgbToHex=DN;var VT=YI(CN),zN=YI(IN);function Nx(e,n=0,l=1){return(0,zN.default)(e,n,l)}function JI(e){e=e.slice(1);const n=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let l=e.match(n);return l&&l[0].length===1&&(l=l.map(h=>h+h)),l?`rgb${l.length===4?"a":""}(${l.map((h,m)=>m<3?parseInt(h,16):Math.round(parseInt(h,16)/255*1e3)/1e3).join(", ")})`:""}function LN(e){const n=e.toString(16);return n.length===1?`0${n}`:n}function _o(e){if(e.type)return e;if(e.charAt(0)==="#")return _o(JI(e));const n=e.indexOf("("),l=e.substring(0,n);if(["rgb","rgba","hsl","hsla","color"].indexOf(l)===-1)throw new Error((0,VT.default)(9,e));let h=e.substring(n+1,e.length-1),m;if(l==="color"){if(h=h.split(" "),m=h.shift(),h.length===4&&h[3].charAt(0)==="/"&&(h[3]=h[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(m)===-1)throw new Error((0,VT.default)(10,m))}else h=h.split(",");return h=h.map(v=>parseFloat(v)),{type:l,values:h,colorSpace:m}}const QI=e=>{const n=_o(e);return n.values.slice(0,3).map((l,h)=>n.type.indexOf("hsl")!==-1&&h!==0?`${l}%`:l).join(" ")};ur.colorChannel=QI;const RN=(e,n)=>{try{return QI(e)}catch{return e}};ur.private_safeColorChannel=RN;function xh(e){const{type:n,colorSpace:l}=e;let{values:h}=e;return n.indexOf("rgb")!==-1?h=h.map((m,v)=>v<3?parseInt(m,10):m):n.indexOf("hsl")!==-1&&(h[1]=`${h[1]}%`,h[2]=`${h[2]}%`),n.indexOf("color")!==-1?h=`${l} ${h.join(" ")}`:h=`${h.join(", ")}`,`${n}(${h})`}function DN(e){if(e.indexOf("#")===0)return e;const{values:n}=_o(e);return`#${n.map((l,h)=>LN(h===3?Math.round(255*l):l)).join("")}`}function ek(e){e=_o(e);const{values:n}=e,l=n[0],h=n[1]/100,m=n[2]/100,v=h*Math.min(m,1-m),E=(D,V=(D+l/30)%12)=>m-v*Math.max(Math.min(V-3,9-V,1),-1);let s="rgb";const k=[Math.round(E(0)*255),Math.round(E(8)*255),Math.round(E(4)*255)];return e.type==="hsla"&&(s+="a",k.push(n[3])),xh({type:s,values:k})}function s_(e){e=_o(e);let n=e.type==="hsl"||e.type==="hsla"?_o(ek(e)).values:e.values;return n=n.map(l=>(e.type!=="color"&&(l/=255),l<=.03928?l/12.92:((l+.055)/1.055)**2.4)),Number((.2126*n[0]+.7152*n[1]+.0722*n[2]).toFixed(3))}function ON(e,n){const l=s_(e),h=s_(n);return(Math.max(l,h)+.05)/(Math.min(l,h)+.05)}function tk(e,n){return e=_o(e),n=Nx(n),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${n}`:e.values[3]=n,xh(e)}function BN(e,n,l){try{return tk(e,n)}catch{return e}}function Ux(e,n){if(e=_o(e),n=Nx(n),e.type.indexOf("hsl")!==-1)e.values[2]*=1-n;else if(e.type.indexOf("rgb")!==-1||e.type.indexOf("color")!==-1)for(let l=0;l<3;l+=1)e.values[l]*=1-n;return xh(e)}function FN(e,n,l){try{return Ux(e,n)}catch{return e}}function jx(e,n){if(e=_o(e),n=Nx(n),e.type.indexOf("hsl")!==-1)e.values[2]+=(100-e.values[2])*n;else if(e.type.indexOf("rgb")!==-1)for(let l=0;l<3;l+=1)e.values[l]+=(255-e.values[l])*n;else if(e.type.indexOf("color")!==-1)for(let l=0;l<3;l+=1)e.values[l]+=(1-e.values[l])*n;return xh(e)}function NN(e,n,l){try{return jx(e,n)}catch{return e}}function nk(e,n=.15){return s_(e)>.5?Ux(e,n):jx(e,n)}function UN(e,n,l){try{return nk(e,n)}catch{return e}}function jN(e,n,l,h=1){const m=(k,D)=>Math.round((k**(1/h)*(1-l)+D**(1/h)*l)**h),v=_o(e),E=_o(n),s=[m(v.values[0],E.values[0]),m(v.values[1],E.values[1]),m(v.values[2],E.values[2])];return xh({type:"rgb",values:s})}const VN={black:"#000",white:"#fff"},Kp=VN,$N={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},GN=$N,qN={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},Au=qN,WN={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},Cu=WN,ZN={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},cp=ZN,HN={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},Iu=HN,XN={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},ku=XN,KN={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},Mu=KN,YN=["mode","contrastThreshold","tonalOffset"],$T={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:Kp.white,default:Kp.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},av={text:{primary:Kp.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:Kp.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function GT(e,n,l,h){const m=h.light||h,v=h.dark||h*1.5;e[n]||(e.hasOwnProperty(l)?e[n]=e[l]:n==="light"?e.light=PN(e.main,m):n==="dark"&&(e.dark=kN(e.main,v)))}function JN(e="light"){return e==="dark"?{main:Iu[200],light:Iu[50],dark:Iu[400]}:{main:Iu[700],light:Iu[400],dark:Iu[800]}}function QN(e="light"){return e==="dark"?{main:Au[200],light:Au[50],dark:Au[400]}:{main:Au[500],light:Au[300],dark:Au[700]}}function eU(e="light"){return e==="dark"?{main:Cu[500],light:Cu[300],dark:Cu[700]}:{main:Cu[700],light:Cu[400],dark:Cu[800]}}function tU(e="light"){return e==="dark"?{main:ku[400],light:ku[300],dark:ku[700]}:{main:ku[700],light:ku[500],dark:ku[900]}}function nU(e="light"){return e==="dark"?{main:Mu[400],light:Mu[300],dark:Mu[700]}:{main:Mu[800],light:Mu[500],dark:Mu[900]}}function rU(e="light"){return e==="dark"?{main:cp[400],light:cp[300],dark:cp[700]}:{main:"#ed6c02",light:cp[500],dark:cp[900]}}function iU(e){const{mode:n="light",contrastThreshold:l=3,tonalOffset:h=.2}=e,m=pl(e,YN),v=e.primary||JN(n),E=e.secondary||QN(n),s=e.error||eU(n),k=e.info||tU(n),D=e.success||nU(n),V=e.warning||rU(n);function G(me){return MN(me,av.text.primary)>=l?av.text.primary:$T.text.primary}const J=({color:me,name:Ce,mainShade:ie=500,lightShade:te=300,darkShade:le=700})=>{if(me=Bn({},me),!me.main&&me[ie]&&(me.main=me[ie]),!me.hasOwnProperty("main"))throw new Error(Zp(11,Ce?` (${Ce})`:"",ie));if(typeof me.main!="string")throw new Error(Zp(12,Ce?` (${Ce})`:"",JSON.stringify(me.main)));return GT(me,"light",te,h),GT(me,"dark",le,h),me.contrastText||(me.contrastText=G(me.main)),me},ve={dark:av,light:$T};return ea(Bn({common:Bn({},Kp),mode:n,primary:J({color:v,name:"primary"}),secondary:J({color:E,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:J({color:s,name:"error"}),warning:J({color:V,name:"warning"}),info:J({color:k,name:"info"}),success:J({color:D,name:"success"}),grey:GN,contrastThreshold:l,getContrastText:G,augmentColor:J,tonalOffset:h},ve[n]),m)}const oU=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function sU(e){return Math.round(e*1e5)/1e5}const qT={textTransform:"uppercase"},WT='"Roboto", "Helvetica", "Arial", sans-serif';function aU(e,n){const l=typeof n=="function"?n(e):n,{fontFamily:h=WT,fontSize:m=14,fontWeightLight:v=300,fontWeightRegular:E=400,fontWeightMedium:s=500,fontWeightBold:k=700,htmlFontSize:D=16,allVariants:V,pxToRem:G}=l,J=pl(l,oU),ve=m/14,ae=G||(ie=>`${ie/D*ve}rem`),me=(ie,te,le,ze,Oe)=>Bn({fontFamily:h,fontWeight:ie,fontSize:ae(te),lineHeight:le},h===WT?{letterSpacing:`${sU(ze/te)}em`}:{},Oe,V),Ce={h1:me(v,96,1.167,-1.5),h2:me(v,60,1.2,-.5),h3:me(E,48,1.167,0),h4:me(E,34,1.235,.25),h5:me(E,24,1.334,0),h6:me(s,20,1.6,.15),subtitle1:me(E,16,1.75,.15),subtitle2:me(s,14,1.57,.1),body1:me(E,16,1.5,.15),body2:me(E,14,1.43,.15),button:me(s,14,1.75,.4,qT),caption:me(E,12,1.66,.4),overline:me(E,12,2.66,1,qT),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return ea(Bn({htmlFontSize:D,pxToRem:ae,fontFamily:h,fontSize:m,fontWeightLight:v,fontWeightRegular:E,fontWeightMedium:s,fontWeightBold:k},Ce),J,{clone:!1})}const lU=.2,cU=.14,uU=.12;function Un(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${lU})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${cU})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${uU})`].join(",")}const hU=["none",Un(0,2,1,-1,0,1,1,0,0,1,3,0),Un(0,3,1,-2,0,2,2,0,0,1,5,0),Un(0,3,3,-2,0,3,4,0,0,1,8,0),Un(0,2,4,-1,0,4,5,0,0,1,10,0),Un(0,3,5,-1,0,5,8,0,0,1,14,0),Un(0,3,5,-1,0,6,10,0,0,1,18,0),Un(0,4,5,-2,0,7,10,1,0,2,16,1),Un(0,5,5,-3,0,8,10,1,0,3,14,2),Un(0,5,6,-3,0,9,12,1,0,3,16,2),Un(0,6,6,-3,0,10,14,1,0,4,18,3),Un(0,6,7,-4,0,11,15,1,0,4,20,3),Un(0,7,8,-4,0,12,17,2,0,5,22,4),Un(0,7,8,-4,0,13,19,2,0,5,24,4),Un(0,7,9,-4,0,14,21,2,0,5,26,4),Un(0,8,9,-5,0,15,22,2,0,6,28,5),Un(0,8,10,-5,0,16,24,2,0,6,30,5),Un(0,8,11,-5,0,17,26,2,0,6,32,5),Un(0,9,11,-5,0,18,28,2,0,7,34,6),Un(0,9,12,-6,0,19,29,2,0,7,36,6),Un(0,10,13,-6,0,20,31,3,0,8,38,7),Un(0,10,13,-6,0,21,33,3,0,8,40,7),Un(0,10,14,-6,0,22,35,3,0,8,42,7),Un(0,11,14,-7,0,23,36,3,0,9,44,8),Un(0,11,15,-7,0,24,38,3,0,9,46,8)],dU=hU,pU=["duration","easing","delay"],fU={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},mU={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function ZT(e){return`${Math.round(e)}ms`}function gU(e){if(!e)return 0;const n=e/36;return Math.round((4+15*n**.25+n/5)*10)}function _U(e){const n=Bn({},fU,e.easing),l=Bn({},mU,e.duration);return Bn({getAutoHeightDuration:gU,create:(m=["all"],v={})=>{const{duration:E=l.standard,easing:s=n.easeInOut,delay:k=0}=v;return pl(v,pU),(Array.isArray(m)?m:[m]).map(D=>`${D} ${typeof E=="string"?E:ZT(E)} ${s} ${typeof k=="string"?k:ZT(k)}`).join(",")}},e,{easing:n,duration:l})}const yU={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},vU=yU,xU=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function wU(e={},...n){const{mixins:l={},palette:h={},transitions:m={},typography:v={}}=e,E=pl(e,xU);if(e.vars)throw new Error(Zp(18));const s=iU(h),k=cN(e);let D=ea(k,{mixins:SN(k.breakpoints,l),palette:s,shadows:dU.slice(),typography:aU(s,v),transitions:_U(m),zIndex:Bn({},vU)});return D=ea(D,E),D=n.reduce((V,G)=>ea(V,G),D),D.unstable_sxConfig=Bn({},Fx,E==null?void 0:E.unstable_sxConfig),D.unstable_sx=function(G){return ZI({sx:G,theme:this})},D}const bU=["theme"];function EU(e){let{theme:n}=e,l=pl(e,bU);const h=n[RT];return Ka.jsx(TN,Bn({},l,{themeId:h?RT:void 0,theme:h||n}))}var rk={exports:{}};(function(e,n){(function(l,h){e.exports=h()})(Go,function(){var l,h,m;function v(s,k){if(!l)l=k;else if(!h)h=k;else{var D="self.onerror = function() { console.error('An error occurred while parsing the WebWorker bundle. This is most likely due to improper transpilation by Babel; please see https://docs.mapbox.com/mapbox-gl-js/guides/install/#transpiling'); }; var sharedChunk = {}; ("+l+")(sharedChunk); ("+h+")(sharedChunk); self.onerror = null;",V={};l(V),m=k(V),typeof window<"u"&&window&&window.URL&&window.URL.createObjectURL&&(m.workerUrl=window.URL.createObjectURL(new Blob([D],{type:"text/javascript"})))}}v(["exports"],function(s){var k=typeof self<"u"?self:{},D="2.15.0";let V;const G={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){if(V==null){const r=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;try{V={}.API_URL_REGEX!=null?new RegExp({}.API_URL_REGEX):r}catch{V=r}}return V},get API_TILEJSON_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/v[0-9]*\/.*\.json.*$)/i},get API_SPRITE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*\/sprite.*\..*$)/i},get API_FONTS_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/fonts\/v[0-9]*\/)(.*\.pbf.*$)/i},get API_STYLE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*$)/i},get API_CDN_URL_REGEX(){return/^((https?:)?\/\/)?api\.mapbox\.c(n|om)(\/mapbox-gl-js\/)(.*$)/i},get EVENTS_URL(){if(!G.API_URL)return null;try{const r=new URL(G.API_URL);return r.hostname==="api.mapbox.cn"?"https://events.mapbox.cn/events/v2":r.hostname==="api.mapbox.com"?"https://events.mapbox.com/events/v2":null}catch{return null}},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},J={supported:!1,testSupport:function(r){!me&&ae&&(Ce?ie(r):ve=r)}};let ve,ae,me=!1,Ce=!1;function ie(r){const t=r.createTexture();r.bindTexture(r.TEXTURE_2D,t);try{if(r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,ae),r.isContextLost())return;J.supported=!0}catch{}r.deleteTexture(t),me=!0}k.document&&(ae=k.document.createElement("img"),ae.onload=function(){ve&&ie(ve),ve=null,Ce=!0},ae.onerror=function(){me=!0,ve=null},ae.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const te="01";function le(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var ze=Oe;function Oe(r,t,i,a){this.cx=3*r,this.bx=3*(i-r)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(a-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=r,this.p1y=t,this.p2x=i,this.p2y=a}Oe.prototype={sampleCurveX:function(r){return((this.ax*r+this.bx)*r+this.cx)*r},sampleCurveY:function(r){return((this.ay*r+this.by)*r+this.cy)*r},sampleCurveDerivativeX:function(r){return(3*this.ax*r+2*this.bx)*r+this.cx},solveCurveX:function(r,t){if(t===void 0&&(t=1e-6),r<0)return 0;if(r>1)return 1;for(var i=r,a=0;a<8;a++){var u=this.sampleCurveX(i)-r;if(Math.abs(u)u?g=i:y=i,i=.5*(y-g)+g;return i},solve:function(r,t){return this.sampleCurveY(this.solveCurveX(r,t))}};var Ke=le(ze),He=ht;function ht(r,t){this.x=r,this.y=t}ht.prototype={clone:function(){return new ht(this.x,this.y)},add:function(r){return this.clone()._add(r)},sub:function(r){return this.clone()._sub(r)},multByPoint:function(r){return this.clone()._multByPoint(r)},divByPoint:function(r){return this.clone()._divByPoint(r)},mult:function(r){return this.clone()._mult(r)},div:function(r){return this.clone()._div(r)},rotate:function(r){return this.clone()._rotate(r)},rotateAround:function(r,t){return this.clone()._rotateAround(r,t)},matMult:function(r){return this.clone()._matMult(r)},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(r){return this.x===r.x&&this.y===r.y},dist:function(r){return Math.sqrt(this.distSqr(r))},distSqr:function(r){var t=r.x-this.x,i=r.y-this.y;return t*t+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(r){return Math.atan2(this.y-r.y,this.x-r.x)},angleWith:function(r){return this.angleWithSep(r.x,r.y)},angleWithSep:function(r,t){return Math.atan2(this.x*t-this.y*r,this.x*r+this.y*t)},_matMult:function(r){var t=r[2]*this.x+r[3]*this.y;return this.x=r[0]*this.x+r[1]*this.y,this.y=t,this},_add:function(r){return this.x+=r.x,this.y+=r.y,this},_sub:function(r){return this.x-=r.x,this.y-=r.y,this},_mult:function(r){return this.x*=r,this.y*=r,this},_div:function(r){return this.x/=r,this.y/=r,this},_multByPoint:function(r){return this.x*=r.x,this.y*=r.y,this},_divByPoint:function(r){return this.x/=r.x,this.y/=r.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var r=this.y;return this.y=this.x,this.x=-r,this},_rotate:function(r){var t=Math.cos(r),i=Math.sin(r),a=i*this.x+t*this.y;return this.x=t*this.x-i*this.y,this.y=a,this},_rotateAround:function(r,t){var i=Math.cos(r),a=Math.sin(r),u=t.y+a*(this.x-t.x)+i*(this.y-t.y);return this.x=t.x+i*(this.x-t.x)-a*(this.y-t.y),this.y=u,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},ht.convert=function(r){return r instanceof ht?r:Array.isArray(r)?new ht(r[0],r[1]):r};var Ve=le(He);const jt=Math.PI/180,wr=180/Math.PI;function St(r){return r*jt}function Vt(r){return r*wr}const Vr=[[0,0],[1,0],[1,1],[0,1]];function $r(r){if(r<=0)return 0;if(r>=1)return 1;const t=r*r,i=t*r;return 4*(r<.5?i:3*(r-t)+i-.75)}function Li(r,t,i,a){const u=new Ke(r,t,i,a);return function(p){return u.solve(p)}}const Ki=Li(.25,.1,.25,1);function Je(r,t,i){return Math.min(i,Math.max(t,r))}function Tt(r,t,i){return(i=Je((i-r)/(t-r),0,1))*i*(3-2*i)}function xt(r,t,i){const a=i-t,u=((r-t)%a+a)%a+t;return u===t?i:u}function Bt(r,t,i){if(!r.length)return i(null,[]);let a=r.length;const u=new Array(r.length);let p=null;r.forEach((g,y)=>{t(g,(w,b)=>{w&&(p=w),u[y]=b,--a==0&&i(p,u)})})}function dn(r){const t=[];for(const i in r)t.push(r[i]);return t}function vn(r,...t){for(const i of t)for(const a in i)r[a]=i[a];return r}let sr=1;function ii(){return sr++}function ar(){return function r(t){return t?(t^Math.random()*(16>>t/4)).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,r)}()}function br(r){return r<=1?1:Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function Es(r){return!!r&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(r)}function Yi(r,t){r.forEach(i=>{t[i]&&(t[i]=t[i].bind(t))})}function xn(r,t){return r.indexOf(t,r.length-t.length)!==-1}function kt(r,t,i){const a={};for(const u in r)a[u]=t.call(i||this,r[u],u,r);return a}function Yo(r,t,i){const a={};for(const u in r)t.call(i||this,r[u],u,r)&&(a[u]=r[u]);return a}function Dr(r){return Array.isArray(r)?r.map(Dr):typeof r=="object"&&r?kt(r,Dr):r}const Jo={};function wn(r){Jo[r]||(typeof console<"u"&&console.warn(r),Jo[r]=!0)}function pi(r,t,i){return(i.y-r.y)*(t.x-r.x)>(t.y-r.y)*(i.x-r.x)}function Tc(r){let t=0;for(let i,a,u=0,p=r.length,g=p-1;u@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(i,a,u,p)=>{const g=u||p;return t[a]=!g||g.toLowerCase(),""}),t["max-age"]){const i=parseInt(t["max-age"],10);isNaN(i)?delete t["max-age"]:t["max-age"]=i}return t}let fl=null;function aa(r){if(fl==null){const t=r.navigator?r.navigator.userAgent:null;fl=!!r.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return fl}function ml(r){try{const t=k[r];return t.setItem("_mapbox_test_",1),t.removeItem("_mapbox_test_"),!0}catch{return!1}}function Qo(r,t){return[r[4*t],r[4*t+1],r[4*t+2],r[4*t+3]]}const la="mapbox-tiles";let Sc=500,Ac=50,fi,es;function gl(){try{return k.caches}catch{}}function Ts(){gl()&&!fi&&(fi=k.caches.open(la))}function ca(r){const t=r.indexOf("?");if(t<0)return r;const i=function(u){const p=u.indexOf("?");return p>0?u.slice(p+1).split("&"):[]}(r),a=i.filter(u=>{const p=u.split("=");return p[0]==="language"||p[0]==="worldview"});return a.length?`${r.slice(0,t)}?${a.join("&")}`:r.slice(0,t)}let _l=1/0;const Ss={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(Ss);class ts extends Error{constructor(t,i,a){i===401&&be(a)&&(t+=": you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes"),super(t),this.status=i,this.url=a}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}const As=vo()?()=>self.worker&&self.worker.referrer:()=>(k.location.protocol==="blob:"?k.parent:k).location.href,Cs=function(r,t){if(!(/^file:/.test(i=r.url)||/^file:/.test(As())&&!/^\w+:/.test(i))){if(k.fetch&&k.Request&&k.AbortController&&k.Request.prototype.hasOwnProperty("signal"))return function(a,u){const p=new k.AbortController,g=new k.Request(a.url,{method:a.method||"GET",body:a.body,credentials:a.credentials,headers:a.headers,referrer:As(),referrerPolicy:a.referrerPolicy,signal:p.signal});let y=!1,w=!1;const b=(A=g.url).indexOf("sku=")>0&&be(A);var A;a.type==="json"&&g.headers.set("Accept","application/json");const I=(L,R,F)=>{if(w)return;if(L&&L.message!=="SecurityError"&&wn(L.toString()),R&&F)return M(R);const $=Date.now();k.fetch(g).then(K=>{if(K.ok){const se=b?K.clone():null;return M(K,se,$)}return u(new ts(K.statusText,K.status,a.url))}).catch(K=>{K.name!=="AbortError"&&u(new Error(`${K.message} ${a.url}`))})},M=(L,R,F)=>{(a.type==="arrayBuffer"?L.arrayBuffer():a.type==="json"?L.json():L.text()).then($=>{w||(R&&F&&function(K,se,Y){if(Ts(),!fi)return;const re={status:se.status,statusText:se.statusText,headers:new k.Headers};se.headers.forEach((Ie,Te)=>re.headers.set(Te,Ie));const ue=oi(se.headers.get("Cache-Control")||"");if(ue["no-store"])return;ue["max-age"]&&re.headers.set("Expires",new Date(Y+1e3*ue["max-age"]).toUTCString());const ce=re.headers.get("Expires");ce&&(new Date(ce).getTime()-Y<42e4||function(Ie,Te){if(es===void 0)try{new Response(new ReadableStream),es=!0}catch{es=!1}es?Te(Ie.body):Ie.blob().then(Te)}(se,Ie=>{const Te=new k.Response(Ie,re);Ts(),fi&&fi.then(De=>De.put(ca(K.url),Te)).catch(De=>wn(De.message))}))}(g,R,F),y=!0,u(null,$,L.headers.get("Cache-Control"),L.headers.get("Expires")))}).catch($=>{w||u(new Error($.message))})};return b?function(L,R){if(Ts(),!fi)return R(null);const F=ca(L.url);fi.then($=>{$.match(F).then(K=>{const se=function(Y){if(!Y)return!1;const re=new Date(Y.headers.get("Expires")||0),ue=oi(Y.headers.get("Cache-Control")||"");return re>Date.now()&&!ue["no-cache"]}(K);$.delete(F),se&&$.put(F,K.clone()),R(null,K,se)}).catch(R)}).catch(R)}(g,I):I(null,null),{cancel:()=>{w=!0,y||p.abort()}}}(r,t);if(vo()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",r,t,void 0,!0)}var i;return function(a,u){const p=new k.XMLHttpRequest;p.open(a.method||"GET",a.url,!0),a.type==="arrayBuffer"&&(p.responseType="arraybuffer");for(const g in a.headers)p.setRequestHeader(g,a.headers[g]);return a.type==="json"&&(p.responseType="text",p.setRequestHeader("Accept","application/json")),p.withCredentials=a.credentials==="include",p.onerror=()=>{u(new Error(p.statusText))},p.onload=()=>{if((p.status>=200&&p.status<300||p.status===0)&&p.response!==null){let g=p.response;if(a.type==="json")try{g=JSON.parse(p.response)}catch(y){return u(y)}u(null,g,p.getResponseHeader("Cache-Control"),p.getResponseHeader("Expires"))}else u(new ts(p.statusText,p.status,a.url))},p.send(a.body),{cancel:()=>p.abort()}}(r,t)},ua=function(r,t){return Cs(vn(r,{type:"arrayBuffer"}),t)};function Cc(r){const t=k.document.createElement("a");return t.href=r,t.protocol===k.document.location.protocol&&t.host===k.document.location.host}const oe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let N,U;N=[],U=0;const ne=function(r,t){if(J.supported&&(r.headers||(r.headers={}),r.headers.accept="image/webp,*/*"),U>=G.MAX_PARALLEL_IMAGE_REQUESTS){const p={requestParameters:r,callback:t,cancelled:!1,cancel(){this.cancelled=!0}};return N.push(p),p}U++;let i=!1;const a=()=>{if(!i)for(i=!0,U--;N.length&&U{a(),p?t(p):g&&(k.createImageBitmap?function(b,A){const I=new k.Blob([new Uint8Array(b)],{type:"image/png"});k.createImageBitmap(I).then(M=>{A(null,M)}).catch(M=>{A(new Error(`Could not load image because of ${M.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})}(g,(b,A)=>t(b,A,y,w)):function(b,A){const I=new k.Image,M=k.URL;I.onload=()=>{A(null,I),M.revokeObjectURL(I.src),I.onload=null,k.requestAnimationFrame(()=>{I.src=oe})},I.onerror=()=>A(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 L=new k.Blob([new Uint8Array(b)],{type:"image/png"});I.src=b.byteLength?M.createObjectURL(L):oe}(g,(b,A)=>t(b,A,y,w)))});return{cancel:()=>{u.cancel(),a()}}},he="NO_ACCESS_TOKEN";function _e(r){return r.indexOf("mapbox:")===0}function be(r){return G.API_URL_REGEX.test(r)}function we(r){return G.API_CDN_URL_REGEX.test(r)}function ge(r){return G.API_STYLE_REGEX.test(r)&&!Pe(r)}function Pe(r){return G.API_SPRITE_REGEX.test(r)}const nt=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function rt(r){const t=r.match(nt);if(!t)throw new Error("Unable to parse URL object");return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]}}function Qe(r){const t=r.params.length?`?${r.params.join("&")}`:"";return`${r.protocol}://${r.authority}${r.path}${t}`}const Mt="mapbox.eventData";function Rt(r){if(!r)return null;const t=r.split(".");if(!t||t.length!==3)return null;try{return JSON.parse(decodeURIComponent(k.atob(t[1]).split("").map(i=>"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)).join("")))}catch{return null}}class Pt{constructor(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null}getStorageKey(t){const i=Rt(G.ACCESS_TOKEN);let a="";return a=i&&i.u?k.btoa(encodeURIComponent(i.u).replace(/%([0-9A-F]{2})/g,(u,p)=>String.fromCharCode(+("0x"+p)))):G.ACCESS_TOKEN||"",t?`${Mt}.${t}:${a}`:`${Mt}:${a}`}fetchEventData(){const t=ml("localStorage"),i=this.getStorageKey(),a=this.getStorageKey("uuid");if(t)try{const u=k.localStorage.getItem(i);u&&(this.eventData=JSON.parse(u));const p=k.localStorage.getItem(a);p&&(this.anonId=p)}catch{wn("Unable to read from LocalStorage")}}saveEventData(){const t=ml("localStorage"),i=this.getStorageKey(),a=this.getStorageKey("uuid");if(t)try{k.localStorage.setItem(a,this.anonId),Object.keys(this.eventData).length>=1&&k.localStorage.setItem(i,JSON.stringify(this.eventData))}catch{wn("Unable to write to LocalStorage")}}processRequests(t){}postEvent(t,i,a,u){if(!G.EVENTS_URL)return;const p=rt(G.EVENTS_URL);p.params.push(`access_token=${u||G.ACCESS_TOKEN||""}`);const g={event:this.type,created:new Date(t).toISOString()},y=i?vn(g,i):g,w={url:Qe(p),headers:{"Content-Type":"text/plain"},body:JSON.stringify([y])};this.pendingRequest=function(b,A){return Cs(vn(b,{method:"POST"}),A)}(w,b=>{this.pendingRequest=null,a(b),this.saveEventData(),this.processRequests(u)})}queueRequest(t,i){this.queue.push(t),this.processRequests(i)}}const Dt=new class extends Pt{constructor(r){super("appUserTurnstile"),this._customAccessToken=r}postTurnstileEvent(r,t){G.EVENTS_URL&&G.ACCESS_TOKEN&&Array.isArray(r)&&r.some(i=>_e(i)||be(i))&&this.queueRequest(Date.now(),t)}processRequests(r){if(this.pendingRequest||this.queue.length===0)return;this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const t=Rt(G.ACCESS_TOKEN),i=t?t.u:G.ACCESS_TOKEN;let a=i!==this.eventData.tokenU;Es(this.anonId)||(this.anonId=ar(),a=!0);const u=this.queue.shift();if(this.eventData.lastSuccess){const p=new Date(this.eventData.lastSuccess),g=new Date(u),y=(u-this.eventData.lastSuccess)/864e5;a=a||y>=1||y<-1||p.getDate()!==g.getDate()}else a=!0;a?this.postEvent(u,{sdkIdentifier:"mapbox-gl-js",sdkVersion:D,skuId:te,"enabled.telemetry":!1,userId:this.anonId},p=>{p||(this.eventData.lastSuccess=u,this.eventData.tokenU=i)},r):this.processRequests()}},Gt=Dt.postTurnstileEvent.bind(Dt),In=new class extends Pt{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(r,t,i,a){this.skuToken=t,this.errorCb=a,G.EVENTS_URL&&(i||G.ACCESS_TOKEN?this.queueRequest({id:r,timestamp:Date.now()},i):this.errorCb(new Error(he)))}processRequests(r){if(this.pendingRequest||this.queue.length===0)return;const{id:t,timestamp:i}=this.queue.shift();t&&this.success[t]||(this.anonId||this.fetchEventData(),Es(this.anonId)||(this.anonId=ar()),this.postEvent(i,{sdkIdentifier:"mapbox-gl-js",sdkVersion:D,skuId:te,skuToken:this.skuToken,userId:this.anonId},a=>{a?this.errorCb(a):t&&(this.success[t]=!0)},r))}},Vn=In.postMapLoadEvent.bind(In),Ir=new class extends Pt{constructor(){super("gljs.performance")}postPerformanceEvent(r,t){G.EVENTS_URL&&(r||G.ACCESS_TOKEN)&&this.queueRequest({timestamp:Date.now(),performanceData:t},r)}processRequests(r){if(this.pendingRequest||this.queue.length===0)return;const{timestamp:t,performanceData:i}=this.queue.shift(),a=function(u){const p=k.performance.getEntriesByType("resource"),g=k.performance.getEntriesByType("mark"),y=function(M){const L={};if(M){for(const R in M)if(R!=="other")for(const F of M[R]){const $=`${R}ResolveRangeMin`,K=`${R}ResolveRangeMax`,se=`${R}RequestCount`,Y=`${R}RequestCachedCount`;L[$]=Math.min(L[$]||1/0,F.startTime),L[K]=Math.max(L[K]||-1/0,F.responseEnd);const re=ue=>{L[ue]===void 0&&(L[ue]=0),++L[ue]};F.transferSize!==void 0&&F.transferSize===0&&re(Y),re(se)}}return L}(function(M,L){const R={};if(M)for(const F of M){const $=L(F);R[$]===void 0&&(R[$]=[]),R[$].push(F)}return R}(p,lf)),w=k.devicePixelRatio,b=k.navigator.connection||k.navigator.mozConnection||k.navigator.webkitConnection,A={counters:[],metadata:[],attributes:[]},I=(M,L,R)=>{R!=null&&M.push({name:L,value:R.toString()})};for(const M in y)I(A.counters,M,y[M]);if(u.interactionRange[0]!==1/0&&u.interactionRange[1]!==-1/0&&(I(A.counters,"interactionRangeMin",u.interactionRange[0]),I(A.counters,"interactionRangeMax",u.interactionRange[1])),g)for(const M of Object.keys(ha)){const L=ha[M],R=g.find(F=>F.name===L);R&&I(A.counters,L,R.startTime)}return I(A.counters,"visibilityHidden",u.visibilityHidden),I(A.attributes,"style",function(M){if(M)for(const L of M){const R=L.name.split("?")[0];if(ge(R)){const F=R.split("/").slice(-2);if(F.length===2)return`mapbox://styles/${F[0]}/${F[1]}`}}}(p)),I(A.attributes,"terrainEnabled",u.terrainEnabled?"true":"false"),I(A.attributes,"fogEnabled",u.fogEnabled?"true":"false"),I(A.attributes,"projection",u.projection),I(A.attributes,"zoom",u.zoom),I(A.metadata,"devicePixelRatio",w),I(A.metadata,"connectionEffectiveType",b?b.effectiveType:void 0),I(A.metadata,"navigatorUserAgent",k.navigator.userAgent),I(A.metadata,"screenWidth",k.screen.width),I(A.metadata,"screenHeight",k.screen.height),I(A.metadata,"windowWidth",k.innerWidth),I(A.metadata,"windowHeight",k.innerHeight),I(A.metadata,"mapWidth",u.width/w),I(A.metadata,"mapHeight",u.height/w),I(A.metadata,"webglRenderer",u.renderer),I(A.metadata,"webglVendor",u.vendor),I(A.metadata,"sdkVersion",D),I(A.metadata,"sdkIdentifier","mapbox-gl-js"),A}(i);for(const u of a.metadata);for(const u of a.counters);for(const u of a.attributes);this.postEvent(t,a,()=>{},r)}},tr=Ir.postPerformanceEvent.bind(Ir),Ji=new class extends Pt{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(r,t,i,a){if(!G.API_URL||!G.SESSION_PATH)return;const u=rt(G.API_URL+G.SESSION_PATH);u.params.push(`sku=${t||""}`),u.params.push(`access_token=${a||G.ACCESS_TOKEN||""}`);const p={url:Qe(u),headers:{"Content-Type":"text/plain"}};this.pendingRequest=function(g,y){return Cs(vn(g,{method:"GET"}),y)}(p,g=>{this.pendingRequest=null,i(g),this.saveEventData(),this.processRequests(a)})}getSessionAPI(r,t,i,a){this.skuToken=t,this.errorCb=a,G.SESSION_PATH&&G.API_URL&&(i||G.ACCESS_TOKEN?this.queueRequest({id:r,timestamp:Date.now()},i):this.errorCb(new Error(he)))}processRequests(r){if(this.pendingRequest||this.queue.length===0)return;const{id:t,timestamp:i}=this.queue.shift();t&&this.success[t]||this.getSession(i,this.skuToken,a=>{a?this.errorCb(a):t&&(this.success[t]=!0)},r)}},hr=Ji.getSessionAPI.bind(Ji),Or=new Set,ha={create:"create",load:"load",fullLoad:"fullLoad"},G_={mark(r){k.performance.mark(r)},measure(r,t,i){k.performance.measure(r,t,i)}};function lf(r){const t=r.name.split("?")[0];return we(t)&&t.includes("mapbox-gl.js")?"javascript":we(t)&&t.includes("mapbox-gl.css")?"css":function(i){return G.API_FONTS_REGEX.test(i)}(t)?"fontRange":Pe(t)?"sprite":ge(t)?"style":function(i){return G.API_TILEJSON_REGEX.test(i)}(t)?"tilejson":"other"}const Jt=k.performance;function wh(r){const t=r?r.url.toString():void 0;return Jt.getEntriesByName(t)}let yl,bh,Ic,Qi;const xo={now:()=>Ic!==void 0?Ic:k.performance.now(),setNow(r){Ic=r},restoreNow(){Ic=void 0},frame(r){const t=k.requestAnimationFrame(r);return{cancel:()=>k.cancelAnimationFrame(t)}},getImageData(r,t=0){const{width:i,height:a}=r;Qi||(Qi=k.document.createElement("canvas"));const u=Qi.getContext("2d",{willReadFrequently:!0});if(!u)throw new Error("failed to create canvas 2d context");return(i>Qi.width||a>Qi.height)&&(Qi.width=i,Qi.height=a),u.clearRect(-t,-t,i+2*t,a+2*t),u.drawImage(r,0,0,i,a),u.getImageData(-t,-t,i+2*t,a+2*t)},resolveURL:r=>(yl||(yl=k.document.createElement("a")),yl.href=r,yl.href),get devicePixelRatio(){return k.devicePixelRatio},get prefersReducedMotion(){return!!k.matchMedia&&(bh==null&&(bh=k.matchMedia("(prefers-reduced-motion: reduce)")),bh.matches)}};function Eh(r,t,i){i[r]&&i[r].indexOf(t)!==-1||(i[r]=i[r]||[],i[r].push(t))}function Th(r,t,i){if(i&&i[r]){const a=i[r].indexOf(t);a!==-1&&i[r].splice(a,1)}}class Is{constructor(t,i={}){vn(this,i),this.type=t}}class wo extends Is{constructor(t,i={}){super("error",vn({error:t},i))}}class vl{on(t,i){return this._listeners=this._listeners||{},Eh(t,i,this._listeners),this}off(t,i){return Th(t,i,this._listeners),Th(t,i,this._oneTimeListeners),this}once(t,i){return i?(this._oneTimeListeners=this._oneTimeListeners||{},Eh(t,i,this._oneTimeListeners),this):new Promise(a=>this.once(t,a))}fire(t,i){typeof t=="string"&&(t=new Is(t,i||{}));const a=t.type;if(this.listens(a)){t.target=this;const u=this._listeners&&this._listeners[a]?this._listeners[a].slice():[];for(const y of u)y.call(this,t);const p=this._oneTimeListeners&&this._oneTimeListeners[a]?this._oneTimeListeners[a].slice():[];for(const y of p)Th(a,y,this._oneTimeListeners),y.call(this,t);const g=this._eventedParent;g&&(vn(t,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),g.fire(t))}else t instanceof wo&&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,i){return this._eventedParent=t,this._eventedParentData=i,this}}var Re=JSON.parse('{"$version":8,"$root":{"version":{"required":true,"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"},"terrain":{"type":"terrain"},"fog":{"type":"fog"},"sources":{"required":true,"type":"sources"},"sprite":{"type":"string"},"glyphs":{"type":"string"},"transition":{"type":"transition"},"projection":{"type":"projection"},"layers":{"required":true,"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":true,"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":{}},"default":"xyz"},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"attribution":{"type":"string"},"promoteId":{"type":"promoteId"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster":{"type":{"required":true,"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":false},"*":{"type":"*"}},"source_raster_dem":{"type":{"required":true,"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":{}},"default":"mapbox"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_geojson":{"type":{"required":true,"type":"enum","values":{"geojson":{}}},"data":{"type":"*"},"maxzoom":{"type":"number","default":18},"attribution":{"type":"string"},"buffer":{"type":"number","default":128,"maximum":512,"minimum":0},"filter":{"type":"*"},"tolerance":{"type":"number","default":0.375},"cluster":{"type":"boolean","default":false},"clusterRadius":{"type":"number","default":50,"minimum":0},"clusterMaxZoom":{"type":"number"},"clusterMinPoints":{"type":"number"},"clusterProperties":{"type":"*"},"lineMetrics":{"type":"boolean","default":false},"generateId":{"type":"boolean","default":false},"promoteId":{"type":"promoteId"}},"source_video":{"type":{"required":true,"type":"enum","values":{"video":{}}},"urls":{"required":true,"type":"array","value":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_image":{"type":{"required":true,"type":"enum","values":{"image":{}}},"url":{"required":true,"type":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"layer":{"id":{"type":"string","required":true},"type":{"type":"enum","values":{"fill":{},"line":{},"symbol":{},"circle":{},"heatmap":{},"fill-extrusion":{},"raster":{},"hillshade":{},"background":{},"sky":{}},"required":true},"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_sky"],"layout_background":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_sky":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_fill":{"fill-sort-key":{"type":"number","expression":{"interpolated":false,"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":false,"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"},"fill-extrusion-edge-radius":{"type":"number","private":true,"default":0,"minimum":0,"maximum":1,"property-type":"constant"}},"layout_line":{"line-cap":{"type":"enum","values":{"butt":{},"round":{},"square":{}},"default":"butt","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-join":{"type":"enum","values":{"bevel":{},"round":{},"miter":{}},"default":"miter","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{"type":"number","default":2,"requires":[{"line-join":"miter"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-round-limit":{"type":"number","default":1.05,"requires":[{"line-join":"round"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-sort-key":{"type":"number","expression":{"interpolated":false,"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":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-spacing":{"type":"number","default":250,"minimum":1,"units":"pixels","requires":[{"symbol-placement":"line"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{"type":"boolean","default":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{"type":"enum","values":{"auto":{},"viewport-y":{},"source":{}},"default":"auto","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{"type":"boolean","default":false,"requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{"type":"boolean","default":false,"requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-optional":{"type":"boolean","default":false,"requires":["icon-image","text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"],"expression":{"interpolated":false,"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":true,"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":false,"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":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-image":{"type":"resolvedImage","tokens":true,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{"type":"number","default":0,"period":360,"units":"degrees","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{"type":"boolean","default":false,"requires":["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-offset":{"type":"array","value":"number","length":2,"default":[0,0],"requires":["icon-image"],"expression":{"interpolated":true,"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":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-field":{"type":"formatted","default":"","tokens":true,"expression":{"interpolated":false,"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":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size":{"type":"number","default":16,"minimum":0,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{"type":"number","default":10,"minimum":0,"units":"ems","requires":["text-field",{"symbol-placement":["point"]}],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{"type":"number","default":1.2,"units":"ems","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{"type":"number","default":0,"units":"ems","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-justify":{"type":"enum","values":{"auto":{},"left":{},"center":{},"right":{}},"default":"center","requires":["text-field"],"expression":{"interpolated":false,"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":true,"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":false,"parameters":["zoom"]},"property-type":"data-constant"},"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":false,"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":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-writing-mode":{"type":"array","value":"enum","values":{"horizontal":{},"vertical":{}},"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotate":{"type":"number","default":0,"period":360,"units":"degrees","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-keep-upright":{"type":"boolean","default":true,"requires":["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-transform":{"type":"enum","values":{"none":{},"uppercase":{},"lowercase":{}},"default":"none","requires":["text-field"],"expression":{"interpolated":false,"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":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{"type":"boolean","default":false,"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{"type":"boolean","default":false,"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-optional":{"type":"boolean","default":false,"requires":["text-field","icon-image"],"expression":{"interpolated":false,"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_symbol":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature","pitch","distance-from-center"]}},"filter_fill":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_line":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_circle":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_fill-extrusion":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_heatmap":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_operator":{"type":"enum","values":{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},"in":{},"!in":{},"all":{},"any":{},"none":{},"has":{},"!has":{},"within":{}}},"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":false}},"function_stop":{"type":"array","minimum":0,"maximum":24,"value":["number","color"],"length":2},"expression":{"type":"array","value":"*","minimum":1},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"high-color":{"type":"color","property-type":"data-constant","default":"#245cdf","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"space-color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"horizon-blend":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,0.2,7,0.1],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"star-intensity":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],5,0.35,6,0],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":{},"viewport":{}},"property-type":"data-constant","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"projection":{"name":{"type":"enum","values":{"albers":{},"equalEarth":{},"equirectangular":{},"lambertConformalConic":{},"mercator":{},"naturalEarth":{},"winkelTripel":{},"globe":{}},"default":"mercator","required":true},"center":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-180,-90],"maximum":[180,90],"transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]},"parallels":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-90,-90],"maximum":[90,90],"transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]}},"terrain":{"source":{"type":"string","required":true},"exaggeration":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1000,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"requires":["source"]}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"fill-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{"type":"color","transition":true,"requires":[{"!":"fill-pattern"},{"fill-antialias":true}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["fill-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"fill-extrusion-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["fill-extrusion-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"units":"meters","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"units":"meters","transition":true,"requires":["fill-extrusion-height"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant","type":"number","private":true,"default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant","type":"number","private":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"requires":["fill-extrusion-edge-radius"]},"fill-extrusion-rounded-roof":{"type":"boolean","default":true,"requires":["fill-extrusion-edge-radius"],"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_line":{"line-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"line-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["line-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"line-width":{"type":"number","default":1,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{"type":"array","value":"number","minimum":0,"transition":false,"units":"line widths","requires":[{"!":"line-pattern"}],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{"type":"color","transition":false,"requires":[{"!":"line-pattern"},{"source":"geojson","has":{"lineMetrics":true}}],"expression":{"interpolated":true,"parameters":["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{"type":"array","value":"number","length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"transition":false,"requires":[{"source":"geojson","has":{"lineMetrics":true}}],"property-type":"constant"}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["circle-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{}},"default":"viewport","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"transition":false,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"heatmap-color":{"type":"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"transition":false,"expression":{"interpolated":true,"parameters":["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_symbol":{"icon-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{"type":"color","default":"#000000","transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["icon-image","icon-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{"type":"color","default":"#000000","transition":true,"overridable":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["text-field","text-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_raster":{"raster-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{"type":"number","default":0,"period":360,"transition":true,"units":"degrees","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-resampling":{"type":"enum","values":{"linear":{},"nearest":{}},"default":"linear","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"transition":false,"units":"milliseconds","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"transition":false,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"viewport","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{"type":"number","default":0.5,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_background":{"background-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"background-pattern"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":{},"atmosphere":{}},"default":"atmosphere","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"requires":[{"sky-type":"atmosphere"}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{"type":"number","requires":[{"sky-type":"atmosphere"}],"default":10,"minimum":0,"maximum":100,"transition":false,"property-type":"data-constant"},"sky-gradient-center":{"type":"array","requires":[{"sky-type":"gradient"}],"value":"number","default":[0,0],"length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{"type":"number","requires":[{"sky-type":"gradient"}],"default":90,"minimum":0,"maximum":180,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"transition":false,"requires":[{"sky-type":"gradient"}],"expression":{"interpolated":true,"parameters":["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-atmosphere-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"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"},"color-ramp":{"type":"property-type"},"data-constant":{"type":"property-type"},"constant":{"type":"property-type"}},"promoteId":{"*":{"type":"string"}}}');function bo(r,...t){for(const i of t)for(const a in i)r[a]=i[a];return r}function $n(r){return r instanceof Number||r instanceof String||r instanceof Boolean?r.valueOf():r}function dr(r){if(Array.isArray(r))return r.map(dr);if(r instanceof Object&&!(r instanceof Number||r instanceof String||r instanceof Boolean)){const t={};for(const i in r)t[i]=dr(r[i]);return t}return $n(r)}class cf extends Error{constructor(t,i){super(i),this.message=i,this.key=t}}var eo=cf;class Sh{constructor(t,i=[]){this.parent=t,this.bindings={};for(const[a,u]of i)this.bindings[a]=u}concat(t){return new Sh(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)}}var uf=Sh;const da={kind:"null"},lt={kind:"number"},$t={kind:"string"},Ft={kind:"boolean"},si={kind:"color"},Ri={kind:"object"},Nt={kind:"value"},ai={kind:"collator"},xl={kind:"formatted"},ks={kind:"resolvedImage"};function mi(r,t){return{kind:"array",itemType:r,N:t}}function Sn(r){if(r.kind==="array"){const t=Sn(r.itemType);return typeof r.N=="number"?`array<${t}, ${r.N}>`:r.itemType.kind==="value"?"array":`array<${t}>`}return r.kind}const hf=[da,lt,$t,Ft,si,xl,Ri,mi(Nt),ks];function Eo(r,t){if(t.kind==="error")return null;if(r.kind==="array"){if(t.kind==="array"&&(t.N===0&&t.itemType.kind==="value"||!Eo(r.itemType,t.itemType))&&(typeof r.N!="number"||r.N===t.N))return null}else{if(r.kind===t.kind)return null;if(r.kind==="value"){for(const i of hf)if(!Eo(i,t))return null}}return`Expected ${Sn(r)} but found ${Sn(t)} instead.`}function wl(r,t){return t.some(i=>i.kind===r.kind)}function bl(r,t){return t.some(i=>i==="null"?r===null:i==="array"?Array.isArray(r):i==="object"?r&&!Array.isArray(r)&&typeof r=="object":i===typeof r)}var Ah,df={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function El(r){return(r=Math.round(r))<0?0:r>255?255:r}function Tl(r){return El(r[r.length-1]==="%"?parseFloat(r)/100*255:parseInt(r))}function kc(r){return(t=r[r.length-1]==="%"?parseFloat(r)/100:parseFloat(r))<0?0:t>1?1:t;var t}function pa(r,t,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?r+(t-r)*i*6:2*i<1?t:3*i<2?r+(t-r)*(2/3-i)*6:r}try{Ah={}.parseCSSColor=function(r){var t,i=r.replace(/ /g,"").toLowerCase();if(i in df)return df[i].slice();if(i[0]==="#")return i.length===4?(t=parseInt(i.substr(1),16))>=0&&t<=4095?[(3840&t)>>4|(3840&t)>>8,240&t|(240&t)>>4,15&t|(15&t)<<4,1]:null:i.length===7&&(t=parseInt(i.substr(1),16))>=0&&t<=16777215?[(16711680&t)>>16,(65280&t)>>8,255&t,1]:null;var a=i.indexOf("("),u=i.indexOf(")");if(a!==-1&&u+1===i.length){var p=i.substr(0,a),g=i.substr(a+1,u-(a+1)).split(","),y=1;switch(p){case"rgba":if(g.length!==4)return null;y=kc(g.pop());case"rgb":return g.length!==3?null:[Tl(g[0]),Tl(g[1]),Tl(g[2]),y];case"hsla":if(g.length!==4)return null;y=kc(g.pop());case"hsl":if(g.length!==3)return null;var w=(parseFloat(g[0])%360+360)%360/360,b=kc(g[1]),A=kc(g[2]),I=A<=.5?A*(b+1):A+b-A*b,M=2*A-I;return[El(255*pa(M,I,w+1/3)),El(255*pa(M,I,w)),El(255*pa(M,I,w-1/3)),y];default:return null}}return null}}catch{}class Gr{constructor(t,i,a,u=1){this.r=t,this.g=i,this.b=a,this.a=u}static parse(t){if(!t)return;if(t instanceof Gr)return t;if(typeof t!="string")return;const i=Ah(t);return i?new Gr(i[0]/255*i[3],i[1]/255*i[3],i[2]/255*i[3],i[3]):void 0}toString(){const[t,i,a,u]=this.toArray();return`rgba(${Math.round(t)},${Math.round(i)},${Math.round(a)},${u})`}toArray(){const{r:t,g:i,b:a,a:u}=this;return u===0?[0,0,0,0]:[255*t/u,255*i/u,255*a/u,u]}toArray01(){const{r:t,g:i,b:a,a:u}=this;return u===0?[0,0,0,0]:[t/u,i/u,a/u,u]}toArray01PremultipliedAlpha(){const{r:t,g:i,b:a,a:u}=this;return[t,i,a,u]}}Gr.black=new Gr(0,0,0,1),Gr.white=new Gr(1,1,1,1),Gr.transparent=new Gr(0,0,0,0),Gr.red=new Gr(1,0,0,1),Gr.blue=new Gr(0,0,1,1);var Fn=Gr;class Ch{constructor(t,i,a){this.sensitivity=t?i?"variant":"case":i?"accent":"base",this.locale=a,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,i){return this.collator.compare(t,i)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Ih{constructor(t,i,a,u,p){this.text=t.normalize?t.normalize():t,this.image=i,this.scale=a,this.fontStack=u,this.textColor=p}}class qr{constructor(t){this.sections=t}static fromString(t){return new qr([new Ih(t,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(t=>t.text.length!==0||t.image&&t.image.name.length!==0)}static factory(t){return t instanceof qr?t:qr.fromString(t)}toString(){return this.sections.length===0?"":this.sections.map(t=>t.text).join("")}serialize(){const t=["format"];for(const i of this.sections){if(i.image){t.push(["image",i.image.name]);continue}t.push(i.text);const a={};i.fontStack&&(a["text-font"]=["literal",i.fontStack.split(",")]),i.scale&&(a["font-scale"]=i.scale),i.textColor&&(a["text-color"]=["rgba"].concat(i.textColor.toArray())),t.push(a)}return t}}class gi{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new gi({name:t,available:!1}):null}serialize(){return["image",this.name]}}function pf(r,t,i,a){return typeof r=="number"&&r>=0&&r<=255&&typeof t=="number"&&t>=0&&t<=255&&typeof i=="number"&&i>=0&&i<=255?a===void 0||typeof a=="number"&&a>=0&&a<=1?null:`Invalid rgba value [${[r,t,i,a].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof a=="number"?[r,t,i,a]:[r,t,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Sl(r){if(r===null||typeof r=="string"||typeof r=="boolean"||typeof r=="number"||r instanceof Fn||r instanceof Ch||r instanceof qr||r instanceof gi)return!0;if(Array.isArray(r)){for(const t of r)if(!Sl(t))return!1;return!0}if(typeof r=="object"){for(const t in r)if(!Sl(r[t]))return!1;return!0}return!1}function Ln(r){if(r===null)return da;if(typeof r=="string")return $t;if(typeof r=="boolean")return Ft;if(typeof r=="number")return lt;if(r instanceof Fn)return si;if(r instanceof Ch)return ai;if(r instanceof qr)return xl;if(r instanceof gi)return ks;if(Array.isArray(r)){const t=r.length;let i;for(const a of r){const u=Ln(a);if(i){if(i===u)continue;i=Nt;break}i=u}return mi(i||Nt,t)}return Ri}function Al(r){const t=typeof r;return r===null?"":t==="string"||t==="number"||t==="boolean"?String(r):r instanceof Fn||r instanceof qr||r instanceof gi?r.toString():JSON.stringify(r)}class kh{constructor(t,i){this.type=t,this.value=i}static parse(t,i){if(t.length!==2)return i.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!Sl(t[1]))return i.error("invalid value");const a=t[1];let u=Ln(a);const p=i.expectedType;return u.kind!=="array"||u.N!==0||!p||p.kind!=="array"||typeof p.N=="number"&&p.N!==0||(u=p),new kh(u,a)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof Fn?["rgba"].concat(this.value.toArray()):this.value instanceof qr?this.value.serialize():this.value}}var Ms=kh,Er=class{constructor(r){this.name="ExpressionEvaluationError",this.message=r}toJSON(){return this.message}};const Mh={string:$t,number:lt,boolean:Ft,object:Ri};class Ph{constructor(t,i){this.type=t,this.args=i}static parse(t,i){if(t.length<2)return i.error("Expected at least one argument.");let a,u=1;const p=t[0];if(p==="array"){let y,w;if(t.length>2){const b=t[1];if(typeof b!="string"||!(b in Mh)||b==="object")return i.error('The item type argument of "array" must be one of string, number, boolean',1);y=Mh[b],u++}else y=Nt;if(t.length>3){if(t[2]!==null&&(typeof t[2]!="number"||t[2]<0||t[2]!==Math.floor(t[2])))return i.error('The length argument to "array" must be a positive integer literal',2);w=t[2],u++}a=mi(y,w)}else a=Mh[p];const g=[];for(;ut.outputDefined())}serialize(){const t=this.type,i=[t.kind];if(t.kind==="array"){const a=t.itemType;if(a.kind==="string"||a.kind==="number"||a.kind==="boolean"){i.push(a.kind);const u=t.N;(typeof u=="number"||this.args.length>1)&&i.push(u)}}return i.concat(this.args.map(a=>a.serialize()))}}var To=Ph;class ns{constructor(t){this.type=xl,this.sections=t}static parse(t,i){if(t.length<2)return i.error("Expected at least one argument.");const a=t[1];if(!Array.isArray(a)&&typeof a=="object")return i.error("First argument must be an image or text section.");const u=[];let p=!1;for(let g=1;g<=t.length-1;++g){const y=t[g];if(p&&typeof y=="object"&&!Array.isArray(y)){p=!1;let w=null;if(y["font-scale"]&&(w=i.parse(y["font-scale"],1,lt),!w))return null;let b=null;if(y["text-font"]&&(b=i.parse(y["text-font"],1,mi($t)),!b))return null;let A=null;if(y["text-color"]&&(A=i.parse(y["text-color"],1,si),!A))return null;const I=u[u.length-1];I.scale=w,I.font=b,I.textColor=A}else{const w=i.parse(t[g],1,Nt);if(!w)return null;const b=w.type.kind;if(b!=="string"&&b!=="value"&&b!=="null"&&b!=="resolvedImage")return i.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");p=!0,u.push({content:w,scale:null,font:null,textColor:null})}}return new ns(u)}evaluate(t){return new qr(this.sections.map(i=>{const a=i.content.evaluate(t);return Ln(a)===ks?new Ih("",a,null,null,null):new Ih(Al(a),null,i.scale?i.scale.evaluate(t):null,i.font?i.font.evaluate(t).join(","):null,i.textColor?i.textColor.evaluate(t):null)}))}eachChild(t){for(const i of this.sections)t(i.content),i.scale&&t(i.scale),i.font&&t(i.font),i.textColor&&t(i.textColor)}outputDefined(){return!1}serialize(){const t=["format"];for(const i of this.sections){t.push(i.content.serialize());const a={};i.scale&&(a["font-scale"]=i.scale.serialize()),i.font&&(a["text-font"]=i.font.serialize()),i.textColor&&(a["text-color"]=i.textColor.serialize()),t.push(a)}return t}}class Mc{constructor(t){this.type=ks,this.input=t}static parse(t,i){if(t.length!==2)return i.error("Expected two arguments.");const a=i.parse(t[1],1,$t);return a?new Mc(a):i.error("No image name provided.")}evaluate(t){const i=this.input.evaluate(t),a=gi.fromString(i);return a&&t.availableImages&&(a.available=t.availableImages.indexOf(i)>-1),a}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const q_={"to-boolean":Ft,"to-color":si,"to-number":lt,"to-string":$t};class zh{constructor(t,i){this.type=t,this.args=i}static parse(t,i){if(t.length<2)return i.error("Expected at least one argument.");const a=t[0];if((a==="to-boolean"||a==="to-string")&&t.length!==2)return i.error("Expected one argument.");const u=q_[a],p=[];for(let g=1;g4?`Invalid rbga value ${JSON.stringify(i)}: expected an array containing either three or four numeric values.`:pf(i[0],i[1],i[2],i[3]),!a))return new Fn(i[0]/255,i[1]/255,i[2]/255,i[3])}throw new Er(a||`Could not parse color from value '${typeof i=="string"?i:String(JSON.stringify(i))}'`)}if(this.type.kind==="number"){let i=null;for(const a of this.args){if(i=a.evaluate(t),i===null)return 0;const u=Number(i);if(!isNaN(u))return u}throw new Er(`Could not convert ${JSON.stringify(i)} to number.`)}return this.type.kind==="formatted"?qr.fromString(Al(this.args[0].evaluate(t))):this.type.kind==="resolvedImage"?gi.fromString(Al(this.args[0].evaluate(t))):Al(this.args[0].evaluate(t))}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}serialize(){if(this.type.kind==="formatted")return new ns([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new Mc(this.args[0]).serialize();const t=[`to-${this.type.kind}`];return this.eachChild(i=>{t.push(i.serialize())}),t}}var fa=zh;const to=["Unknown","Point","LineString","Polygon"];var Lh=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null}id(){return this.feature&&this.feature.id!==void 0?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?to[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||{}}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const r=this.featureDistanceData.center,t=this.featureDistanceData.scale,{x:i,y:a}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(i*t-r[0])+this.featureDistanceData.bearing[1]*(a*t-r[1])}return 0}parseColor(r){let t=this._parseColorCache[r];return t||(t=this._parseColorCache[r]=Fn.parse(r)),t}};class Ps{constructor(t,i,a,u){this.name=t,this.type=i,this._evaluate=a,this.args=u}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map(t=>t.serialize()))}static parse(t,i){const a=t[0],u=Ps.definitions[a];if(!u)return i.error(`Unknown expression "${a}". If you wanted a literal array, use ["literal", [...]].`,0);const p=Array.isArray(u)?u[0]:u.type,g=Array.isArray(u)?[[u[1],u[2]]]:u.overloads,y=g.filter(([b])=>!Array.isArray(b)||b.length===t.length-1);let w=null;for(const[b,A]of y){w=new Nh(i.registry,i.path,null,i.scope);const I=[];let M=!1;for(let L=1;L{return M=I,Array.isArray(M)?`(${M.map(Sn).join(", ")})`:`(${Sn(M.type)}...)`;var M}).join(" | "),A=[];for(let I=1;I=t[2]||r[1]<=t[1]||r[3]>=t[3])}function Il(r,t){const i=(180+r[0])/360,a=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r[1]*Math.PI/360)))/360,u=Math.pow(2,t.z);return[Math.round(i*u*Ao),Math.round(a*u*Ao)]}function ff(r,t,i){const a=r[0]-t[0],u=r[1]-t[1],p=r[0]-i[0],g=r[1]-i[1];return a*g-p*u==0&&a*p<=0&&u*g<=0}function zc(r,t){let i=!1;for(let g=0,y=t.length;g(a=r)[1]!=(p=w[b+1])[1]>a[1]&&a[0]<(p[0]-u[0])*(a[1]-u[1])/(p[1]-u[1])+u[0]&&(i=!i)}}var a,u,p;return i}function Rh(r,t){for(let i=0;i0&&y<0||g<0&&y>0}function ga(r,t,i){for(const b of i)for(let A=0;Ai[2]){const u=.5*a;let p=r[0]-i[0]>u?-a:i[0]-r[0]>u?a:0;p===0&&(p=r[0]-i[2]>u?-a:i[2]-r[0]>u?a:0),r[0]+=p}Pc(t,r)}function gf(r,t,i,a){const u=Math.pow(2,a.z)*Ao,p=[a.x*Ao,a.y*Ao],g=[];if(!r)return g;for(const y of r)for(const w of y){const b=[w.x+p[0],w.y+p[1]];Bh(b,t,i,u),g.push(b)}return g}function Fh(r,t,i,a){const u=Math.pow(2,a.z)*Ao,p=[a.x*Ao,a.y*Ao],g=[];if(!r)return g;for(const w of r){const b=[];for(const A of w){const I=[A.x+p[0],A.y+p[1]];Pc(t,I),b.push(I)}g.push(b)}if(t[2]-t[0]<=u/2){(y=t)[0]=y[1]=1/0,y[2]=y[3]=-1/0;for(const w of g)for(const b of w)Bh(b,t,i,u)}var y;return g}class _a{constructor(t,i){this.type=Ft,this.geojson=t,this.geometries=i}static parse(t,i){if(t.length!==2)return i.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Sl(t[1])){const a=t[1];if(a.type==="FeatureCollection")for(let u=0;u{t&&!ya(i)&&(t=!1)}),t}function Co(r){if(r instanceof So&&r.name==="feature-state")return!1;let t=!0;return r.eachChild(i=>{t&&!Co(i)&&(t=!1)}),t}function zs(r,t){if(r instanceof So&&t.indexOf(r.name)>=0)return!1;let i=!0;return r.eachChild(a=>{i&&!zs(a,t)&&(i=!1)}),i}class Rc{constructor(t,i){this.type=i.type,this.name=t,this.boundExpression=i}static parse(t,i){if(t.length!==2||typeof t[1]!="string")return i.error("'var' expression requires exactly one string literal argument.");const a=t[1];return i.scope.has(a)?new Rc(a,i.scope.get(a)):i.error(`Unknown variable "${a}". Make sure "${a}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}var _f=Rc;class kl{constructor(t,i=[],a,u=new uf,p=[]){this.registry=t,this.path=i,this.key=i.map(g=>`[${g}]`).join(""),this.scope=u,this.errors=p,this.expectedType=a}parse(t,i,a,u,p={}){return i?this.concat(i,a,u)._parse(t,p):this._parse(t,p)}_parse(t,i){function a(u,p,g){return g==="assert"?new To(p,[u]):g==="coerce"?new fa(p,[u]):u}if(t!==null&&typeof t!="string"&&typeof t!="boolean"&&typeof t!="number"||(t=["literal",t]),Array.isArray(t)){if(t.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const u=t[0];if(typeof u!="string")return this.error(`Expression name must be a string, but found ${typeof u} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const p=this.registry[u];if(p){let g=p.parse(t,this);if(!g)return null;if(this.expectedType){const y=this.expectedType,w=g.type;if(y.kind!=="string"&&y.kind!=="number"&&y.kind!=="boolean"&&y.kind!=="object"&&y.kind!=="array"||w.kind!=="value")if(y.kind!=="color"&&y.kind!=="formatted"&&y.kind!=="resolvedImage"||w.kind!=="value"&&w.kind!=="string"){if(this.checkSubtype(y,w))return null}else g=a(g,y,i.typeAnnotation||"coerce");else g=a(g,y,i.typeAnnotation||"assert")}if(!(g instanceof Ms)&&g.type.kind!=="resolvedImage"&&Uh(g)){const y=new Lh;try{g=new Ms(g.type,g.evaluate(y))}catch(w){return this.error(w.message),null}}return g}return this.error(`Unknown expression "${u}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(t===void 0?"'undefined' value invalid. Use null instead.":typeof t=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof t} instead.`)}concat(t,i,a){const u=typeof t=="number"?this.path.concat(t):this.path,p=a?this.scope.concat(a):this.scope;return new kl(this.registry,u,i||null,p,this.errors)}error(t,...i){const a=`${this.key}${i.map(u=>`[${u}]`).join("")}`;this.errors.push(new eo(a,t))}checkSubtype(t,i){const a=Eo(t,i);return a&&this.error(a),a}}var Nh=kl;function Uh(r){if(r instanceof _f)return Uh(r.boundExpression);if(r instanceof So&&r.name==="error"||r instanceof Cl||r instanceof Lc)return!1;const t=r instanceof fa||r instanceof To;let i=!0;return r.eachChild(a=>{i=t?i&&Uh(a):i&&a instanceof Ms}),!!i&&ya(r)&&zs(r,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"])}function Dc(r,t){const i=r.length-1;let a,u,p=0,g=i,y=0;for(;p<=g;)if(y=Math.floor((p+g)/2),a=r[y],u=r[y+1],a<=t){if(y===i||tt))throw new Er("Input is not a number.");g=y-1}return 0}class Oc{constructor(t,i,a){this.type=t,this.input=i,this.labels=[],this.outputs=[];for(const[u,p]of a)this.labels.push(u),this.outputs.push(p)}static parse(t,i){if(t.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return i.error("Expected an even number of arguments.");const a=i.parse(t[1],1,lt);if(!a)return null;const u=[];let p=null;i.expectedType&&i.expectedType.kind!=="value"&&(p=i.expectedType);for(let g=1;g=y)return i.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',b);const I=i.parse(w,A,p);if(!I)return null;p=p||I.type,u.push([y,I])}return new Oc(p,a,u)}evaluate(t){const i=this.labels,a=this.outputs;if(i.length===1)return a[0].evaluate(t);const u=this.input.evaluate(t);if(u<=i[0])return a[0].evaluate(t);const p=i.length;return u>=i[p-1]?a[p-1].evaluate(t):a[Dc(i,u)].evaluate(t)}eachChild(t){t(this.input);for(const i of this.outputs)t(i)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}serialize(){const t=["step",this.input.serialize()];for(let i=0;i0&&t.push(this.labels[i]),t.push(this.outputs[i].serialize());return t}}var jh=Oc;function Wt(r,t,i){return r*(1-i)+t*i}var Ml=Object.freeze({__proto__:null,array:function(r,t,i){return r.map((a,u)=>Wt(a,t[u],i))},color:function(r,t,i){return new Fn(Wt(r.r,t.r,i),Wt(r.g,t.g,i),Wt(r.b,t.b,i),Wt(r.a,t.a,i))},number:Wt});const yf=.95047,Vh=1.08883,vf=4/29,Ls=6/29,$h=3*Ls*Ls,Z_=Ls*Ls*Ls,H_=Math.PI/180,X_=180/Math.PI;function Gh(r){return r>Z_?Math.pow(r,1/3):r/$h+vf}function qh(r){return r>Ls?r*r*r:$h*(r-vf)}function Wh(r){return 255*(r<=.0031308?12.92*r:1.055*Math.pow(r,1/2.4)-.055)}function Bc(r){return(r/=255)<=.04045?r/12.92:Math.pow((r+.055)/1.055,2.4)}function xf(r){const t=Bc(r.r),i=Bc(r.g),a=Bc(r.b),u=Gh((.4124564*t+.3575761*i+.1804375*a)/yf),p=Gh((.2126729*t+.7151522*i+.072175*a)/1);return{l:116*p-16,a:500*(u-p),b:200*(p-Gh((.0193339*t+.119192*i+.9503041*a)/Vh)),alpha:r.a}}function wf(r){let t=(r.l+16)/116,i=isNaN(r.a)?t:t+r.a/500,a=isNaN(r.b)?t:t-r.b/200;return t=1*qh(t),i=yf*qh(i),a=Vh*qh(a),new Fn(Wh(3.2404542*i-1.5371385*t-.4985314*a),Wh(-.969266*i+1.8760108*t+.041556*a),Wh(.0556434*i-.2040259*t+1.0572252*a),r.alpha)}function K_(r,t,i){const a=t-r;return r+i*(a>180||a<-180?a-360*Math.round(a/360):a)}const Pl={forward:xf,reverse:wf,interpolate:function(r,t,i){return{l:Wt(r.l,t.l,i),a:Wt(r.a,t.a,i),b:Wt(r.b,t.b,i),alpha:Wt(r.alpha,t.alpha,i)}}},va={forward:function(r){const{l:t,a:i,b:a}=xf(r),u=Math.atan2(a,i)*X_;return{h:u<0?u+360:u,c:Math.sqrt(i*i+a*a),l:t,alpha:r.a}},reverse:function(r){const t=r.h*H_,i=r.c;return wf({l:r.l,a:Math.cos(t)*i,b:Math.sin(t)*i,alpha:r.alpha})},interpolate:function(r,t,i){return{h:K_(r.h,t.h,i),c:Wt(r.c,t.c,i),l:Wt(r.l,t.l,i),alpha:Wt(r.alpha,t.alpha,i)}}};var Zh=Object.freeze({__proto__:null,hcl:va,lab:Pl});class zl{constructor(t,i,a,u,p){this.type=t,this.operator=i,this.interpolation=a,this.input=u,this.labels=[],this.outputs=[];for(const[g,y]of p)this.labels.push(g),this.outputs.push(y)}static interpolationFactor(t,i,a,u){let p=0;if(t.name==="exponential")p=Hh(i,t.base,a,u);else if(t.name==="linear")p=Hh(i,1,a,u);else if(t.name==="cubic-bezier"){const g=t.controlPoints;p=new Ke(g[0],g[1],g[2],g[3]).solve(Hh(i,1,a,u))}return p}static parse(t,i){let[a,u,p,...g]=t;if(!Array.isArray(u)||u.length===0)return i.error("Expected an interpolation type expression.",1);if(u[0]==="linear")u={name:"linear"};else if(u[0]==="exponential"){const b=u[1];if(typeof b!="number")return i.error("Exponential interpolation requires a numeric base.",1,1);u={name:"exponential",base:b}}else{if(u[0]!=="cubic-bezier")return i.error(`Unknown interpolation type ${String(u[0])}`,1,0);{const b=u.slice(1);if(b.length!==4||b.some(A=>typeof A!="number"||A<0||A>1))return i.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);u={name:"cubic-bezier",controlPoints:b}}}if(t.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return i.error("Expected an even number of arguments.");if(p=i.parse(p,2,lt),!p)return null;const y=[];let w=null;a==="interpolate-hcl"||a==="interpolate-lab"?w=si:i.expectedType&&i.expectedType.kind!=="value"&&(w=i.expectedType);for(let b=0;b=A)return i.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',M);const R=i.parse(I,L,w);if(!R)return null;w=w||R.type,y.push([A,R])}return w.kind==="number"||w.kind==="color"||w.kind==="array"&&w.itemType.kind==="number"&&typeof w.N=="number"?new zl(w,a,u,p,y):i.error(`Type ${Sn(w)} is not interpolatable.`)}evaluate(t){const i=this.labels,a=this.outputs;if(i.length===1)return a[0].evaluate(t);const u=this.input.evaluate(t);if(u<=i[0])return a[0].evaluate(t);const p=i.length;if(u>=i[p-1])return a[p-1].evaluate(t);const g=Dc(i,u),y=zl.interpolationFactor(this.interpolation,u,i[g],i[g+1]),w=a[g].evaluate(t),b=a[g+1].evaluate(t);return this.operator==="interpolate"?Ml[this.type.kind.toLowerCase()](w,b,y):this.operator==="interpolate-hcl"?va.reverse(va.interpolate(va.forward(w),va.forward(b),y)):Pl.reverse(Pl.interpolate(Pl.forward(w),Pl.forward(b),y))}eachChild(t){t(this.input);for(const i of this.outputs)t(i)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}serialize(){let t;t=this.interpolation.name==="linear"?["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const i=[this.operator,t,this.input.serialize()];for(let a=0;aEo(u,y.type));return new Fc(g?Nt:a,p)}evaluate(t){let i,a=null,u=0;for(const p of this.args){if(u++,a=p.evaluate(t),a&&a instanceof gi&&!a.available&&(i||(i=a),a=null,u===this.args.length))return i;if(a!==null)break}return a}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}serialize(){const t=["coalesce"];return this.eachChild(i=>{t.push(i.serialize())}),t}}var Xh=Fc;class Nc{constructor(t,i){this.type=i.type,this.bindings=[].concat(t),this.result=i}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const i of this.bindings)t(i[1]);t(this.result)}static parse(t,i){if(t.length<4)return i.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const a=[];for(let p=1;p=a.length)throw new Er(`Array index out of bounds: ${i} > ${a.length-1}.`);if(i!==Math.floor(i))throw new Er(`Array index must be an integer, but found ${i} instead.`);return a[i]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}var Y_=Kh;class Yh{constructor(t,i){this.type=Ft,this.needle=t,this.haystack=i}static parse(t,i){if(t.length!==3)return i.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const a=i.parse(t[1],1,Nt),u=i.parse(t[2],2,Nt);return a&&u?wl(a.type,[Ft,$t,lt,da,Nt])?new Yh(a,u):i.error(`Expected first argument to be of type boolean, string, number or null, but found ${Sn(a.type)} instead`):null}evaluate(t){const i=this.needle.evaluate(t),a=this.haystack.evaluate(t);if(a==null)return!1;if(!bl(i,["boolean","string","number","null"]))throw new Er(`Expected first argument to be of type boolean, string, number or null, but found ${Sn(Ln(i))} instead.`);if(!bl(a,["string","array"]))throw new Er(`Expected second argument to be of type array or string, but found ${Sn(Ln(a))} instead.`);return a.indexOf(i)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}var Uc=Yh;class Ll{constructor(t,i,a){this.type=lt,this.needle=t,this.haystack=i,this.fromIndex=a}static parse(t,i){if(t.length<=2||t.length>=5)return i.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const a=i.parse(t[1],1,Nt),u=i.parse(t[2],2,Nt);if(!a||!u)return null;if(!wl(a.type,[Ft,$t,lt,da,Nt]))return i.error(`Expected first argument to be of type boolean, string, number or null, but found ${Sn(a.type)} instead`);if(t.length===4){const p=i.parse(t[3],3,lt);return p?new Ll(a,u,p):null}return new Ll(a,u)}evaluate(t){const i=this.needle.evaluate(t),a=this.haystack.evaluate(t);if(!bl(i,["boolean","string","number","null"]))throw new Er(`Expected first argument to be of type boolean, string, number or null, but found ${Sn(Ln(i))} instead.`);if(!bl(a,["string","array"]))throw new Er(`Expected second argument to be of type array or string, but found ${Sn(Ln(a))} instead.`);if(this.fromIndex){const u=this.fromIndex.evaluate(t);return a.indexOf(i,u)}return a.indexOf(i)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}serialize(){if(this.fromIndex!=null&&this.fromIndex!==void 0){const t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}var Ef=Ll;class Jh{constructor(t,i,a,u,p,g){this.inputType=t,this.type=i,this.input=a,this.cases=u,this.outputs=p,this.otherwise=g}static parse(t,i){if(t.length<5)return i.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return i.error("Expected an even number of arguments.");let a,u;i.expectedType&&i.expectedType.kind!=="value"&&(u=i.expectedType);const p={},g=[];for(let b=2;bNumber.MAX_SAFE_INTEGER)return M.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof R=="number"&&Math.floor(R)!==R)return M.error("Numeric branch labels must be integer values.");if(a){if(M.checkSubtype(a,Ln(R)))return null}else a=Ln(R);if(p[String(R)]!==void 0)return M.error("Branch labels must be unique.");p[String(R)]=g.length}const L=i.parse(I,b,u);if(!L)return null;u=u||L.type,g.push(L)}const y=i.parse(t[1],1,Nt);if(!y)return null;const w=i.parse(t[t.length-1],t.length-1,u);return w?y.type.kind!=="value"&&i.concat(1).checkSubtype(a,y.type)?null:new Jh(a,u,y,p,g,w):null}evaluate(t){const i=this.input.evaluate(t);return(Ln(i)===this.inputType&&this.outputs[this.cases[i]]||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()}serialize(){const t=["match",this.input.serialize()],i=Object.keys(this.cases).sort(),a=[],u={};for(const g of i){const y=u[this.cases[g]];y===void 0?(u[this.cases[g]]=a.length,a.push([this.cases[g],[g]])):a[y][1].push(g)}const p=g=>this.inputType.kind==="number"?Number(g):g;for(const[g,y]of a)t.push(y.length===1?p(y[0]):y.map(p)),t.push(this.outputs[g].serialize());return t.push(this.otherwise.serialize()),t}}var J_=Jh;class Qh{constructor(t,i,a){this.type=t,this.branches=i,this.otherwise=a}static parse(t,i){if(t.length<4)return i.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return i.error("Expected an odd number of arguments.");let a;i.expectedType&&i.expectedType.kind!=="value"&&(a=i.expectedType);const u=[];for(let g=1;gi.outputDefined())&&this.otherwise.outputDefined()}serialize(){const t=["case"];return this.eachChild(i=>{t.push(i.serialize())}),t}}var Tf=Qh;class Rl{constructor(t,i,a,u){this.type=t,this.input=i,this.beginIndex=a,this.endIndex=u}static parse(t,i){if(t.length<=2||t.length>=5)return i.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const a=i.parse(t[1],1,Nt),u=i.parse(t[2],2,lt);if(!a||!u)return null;if(!wl(a.type,[mi(Nt),$t,Nt]))return i.error(`Expected first argument to be of type array or string, but found ${Sn(a.type)} instead`);if(t.length===4){const p=i.parse(t[3],3,lt);return p?new Rl(a.type,a,u,p):null}return new Rl(a.type,a,u)}evaluate(t){const i=this.input.evaluate(t),a=this.beginIndex.evaluate(t);if(!bl(i,["string","array"]))throw new Er(`Expected first argument to be of type array or string, but found ${Sn(Ln(i))} instead.`);if(this.endIndex){const u=this.endIndex.evaluate(t);return i.slice(a,u)}return i.slice(a)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}serialize(){if(this.endIndex!=null&&this.endIndex!==void 0){const t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}var Sf=Rl;function jc(r,t){return r==="=="||r==="!="?t.kind==="boolean"||t.kind==="string"||t.kind==="number"||t.kind==="null"||t.kind==="value":t.kind==="string"||t.kind==="number"||t.kind==="value"}function Af(r,t,i,a){return a.compare(t,i)===0}function xa(r,t,i){const a=r!=="=="&&r!=="!=";return class ik{constructor(p,g,y){this.type=Ft,this.lhs=p,this.rhs=g,this.collator=y,this.hasUntypedArgument=p.type.kind==="value"||g.type.kind==="value"}static parse(p,g){if(p.length!==3&&p.length!==4)return g.error("Expected two or three arguments.");const y=p[0];let w=g.parse(p[1],1,Nt);if(!w)return null;if(!jc(y,w.type))return g.concat(1).error(`"${y}" comparisons are not supported for type '${Sn(w.type)}'.`);let b=g.parse(p[2],2,Nt);if(!b)return null;if(!jc(y,b.type))return g.concat(2).error(`"${y}" comparisons are not supported for type '${Sn(b.type)}'.`);if(w.type.kind!==b.type.kind&&w.type.kind!=="value"&&b.type.kind!=="value")return g.error(`Cannot compare types '${Sn(w.type)}' and '${Sn(b.type)}'.`);a&&(w.type.kind==="value"&&b.type.kind!=="value"?w=new To(b.type,[w]):w.type.kind!=="value"&&b.type.kind==="value"&&(b=new To(w.type,[b])));let A=null;if(p.length===4){if(w.type.kind!=="string"&&b.type.kind!=="string"&&w.type.kind!=="value"&&b.type.kind!=="value")return g.error("Cannot use collator to compare non-string types.");if(A=g.parse(p[3],3,ai),!A)return null}return new ik(w,b,A)}evaluate(p){const g=this.lhs.evaluate(p),y=this.rhs.evaluate(p);if(a&&this.hasUntypedArgument){const w=Ln(g),b=Ln(y);if(w.kind!==b.kind||w.kind!=="string"&&w.kind!=="number")throw new Er(`Expected arguments for "${r}" to be (string, string) or (number, number), but found (${w.kind}, ${b.kind}) instead.`)}if(this.collator&&!a&&this.hasUntypedArgument){const w=Ln(g),b=Ln(y);if(w.kind!=="string"||b.kind!=="string")return t(p,g,y)}return this.collator?i(p,g,y,this.collator.evaluate(p)):t(p,g,y)}eachChild(p){p(this.lhs),p(this.rhs),this.collator&&p(this.collator)}outputDefined(){return!0}serialize(){const p=[r];return this.eachChild(g=>{p.push(g.serialize())}),p}}}const Q_=xa("==",function(r,t,i){return t===i},Af),ey=xa("!=",function(r,t,i){return t!==i},function(r,t,i,a){return!Af(0,t,i,a)}),ty=xa("<",function(r,t,i){return t",function(r,t,i){return t>i},function(r,t,i,a){return a.compare(t,i)>0}),ry=xa("<=",function(r,t,i){return t<=i},function(r,t,i,a){return a.compare(t,i)<=0}),Cf=xa(">=",function(r,t,i){return t>=i},function(r,t,i,a){return a.compare(t,i)>=0});class Vc{constructor(t,i,a,u,p,g){this.type=$t,this.number=t,this.locale=i,this.currency=a,this.unit=u,this.minFractionDigits=p,this.maxFractionDigits=g}static parse(t,i){if(t.length!==3)return i.error("Expected two arguments.");const a=i.parse(t[1],1,lt);if(!a)return null;const u=t[2];if(typeof u!="object"||Array.isArray(u))return i.error("NumberFormat options argument must be an object.");let p=null;if(u.locale&&(p=i.parse(u.locale,1,$t),!p))return null;let g=null;if(u.currency&&(g=i.parse(u.currency,1,$t),!g))return null;let y=null;if(u.unit&&(y=i.parse(u.unit,1,$t),!y))return null;let w=null;if(u["min-fraction-digits"]&&(w=i.parse(u["min-fraction-digits"],1,lt),!w))return null;let b=null;return u["max-fraction-digits"]&&(b=i.parse(u["max-fraction-digits"],1,lt),!b)?null:new Vc(a,p,g,y,w,b)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(t):void 0,unit:this.unit?this.unit.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.unit&&t(this.unit),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.unit&&(t.unit=this.unit.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]}}class wa{constructor(t){this.type=lt,this.input=t}static parse(t,i){if(t.length!==2)return i.error(`Expected 1 argument, but found ${t.length-1} instead.`);const a=i.parse(t[1],1);return a?a.type.kind!=="array"&&a.type.kind!=="string"&&a.type.kind!=="value"?i.error(`Expected argument of type string or array, but found ${Sn(a.type)} instead.`):new wa(a):null}evaluate(t){const i=this.input.evaluate(t);if(typeof i=="string"||Array.isArray(i))return i.length;throw new Er(`Expected value to be of type string or array, but found ${Sn(Ln(i))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){const t=["length"];return this.eachChild(i=>{t.push(i.serialize())}),t}}const If={"==":Q_,"!=":ey,">":ny,"<":ty,">=":Cf,"<=":ry,array:To,at:Y_,boolean:To,case:Tf,coalesce:Xh,collator:Cl,format:ns,image:Mc,in:Uc,"index-of":Ef,interpolate:no,"interpolate-hcl":no,"interpolate-lab":no,length:wa,let:bf,literal:Ms,match:J_,number:To,"number-format":Vc,object:To,slice:Sf,step:jh,string:To,"to-boolean":fa,"to-color":fa,"to-number":fa,"to-string":fa,var:_f,within:Lc};function kf(r,[t,i,a,u]){t=t.evaluate(r),i=i.evaluate(r),a=a.evaluate(r);const p=u?u.evaluate(r):1,g=pf(t,i,a,p);if(g)throw new Er(g);return new Fn(t/255*p,i/255*p,a/255*p,p)}function Io(r,t){return r in t}function $c(r,t){const i=t[r];return i===void 0?null:i}function _i(r){return{type:r}}So.register(If,{error:[{kind:"error"},[$t],(r,[t])=>{throw new Er(t.evaluate(r))}],typeof:[$t,[Nt],(r,[t])=>Sn(Ln(t.evaluate(r)))],"to-rgba":[mi(lt,4),[si],(r,[t])=>t.evaluate(r).toArray()],rgb:[si,[lt,lt,lt],kf],rgba:[si,[lt,lt,lt,lt],kf],has:{type:Ft,overloads:[[[$t],(r,[t])=>Io(t.evaluate(r),r.properties())],[[$t,Ri],(r,[t,i])=>Io(t.evaluate(r),i.evaluate(r))]]},get:{type:Nt,overloads:[[[$t],(r,[t])=>$c(t.evaluate(r),r.properties())],[[$t,Ri],(r,[t,i])=>$c(t.evaluate(r),i.evaluate(r))]]},"feature-state":[Nt,[$t],(r,[t])=>$c(t.evaluate(r),r.featureState||{})],properties:[Ri,[],r=>r.properties()],"geometry-type":[$t,[],r=>r.geometryType()],id:[Nt,[],r=>r.id()],zoom:[lt,[],r=>r.globals.zoom],pitch:[lt,[],r=>r.globals.pitch||0],"distance-from-center":[lt,[],r=>r.distanceFromCenter()],"heatmap-density":[lt,[],r=>r.globals.heatmapDensity||0],"line-progress":[lt,[],r=>r.globals.lineProgress||0],"sky-radial-progress":[lt,[],r=>r.globals.skyRadialProgress||0],accumulated:[Nt,[],r=>r.globals.accumulated===void 0?null:r.globals.accumulated],"+":[lt,_i(lt),(r,t)=>{let i=0;for(const a of t)i+=a.evaluate(r);return i}],"*":[lt,_i(lt),(r,t)=>{let i=1;for(const a of t)i*=a.evaluate(r);return i}],"-":{type:lt,overloads:[[[lt,lt],(r,[t,i])=>t.evaluate(r)-i.evaluate(r)],[[lt],(r,[t])=>-t.evaluate(r)]]},"/":[lt,[lt,lt],(r,[t,i])=>t.evaluate(r)/i.evaluate(r)],"%":[lt,[lt,lt],(r,[t,i])=>t.evaluate(r)%i.evaluate(r)],ln2:[lt,[],()=>Math.LN2],pi:[lt,[],()=>Math.PI],e:[lt,[],()=>Math.E],"^":[lt,[lt,lt],(r,[t,i])=>Math.pow(t.evaluate(r),i.evaluate(r))],sqrt:[lt,[lt],(r,[t])=>Math.sqrt(t.evaluate(r))],log10:[lt,[lt],(r,[t])=>Math.log(t.evaluate(r))/Math.LN10],ln:[lt,[lt],(r,[t])=>Math.log(t.evaluate(r))],log2:[lt,[lt],(r,[t])=>Math.log(t.evaluate(r))/Math.LN2],sin:[lt,[lt],(r,[t])=>Math.sin(t.evaluate(r))],cos:[lt,[lt],(r,[t])=>Math.cos(t.evaluate(r))],tan:[lt,[lt],(r,[t])=>Math.tan(t.evaluate(r))],asin:[lt,[lt],(r,[t])=>Math.asin(t.evaluate(r))],acos:[lt,[lt],(r,[t])=>Math.acos(t.evaluate(r))],atan:[lt,[lt],(r,[t])=>Math.atan(t.evaluate(r))],min:[lt,_i(lt),(r,t)=>Math.min(...t.map(i=>i.evaluate(r)))],max:[lt,_i(lt),(r,t)=>Math.max(...t.map(i=>i.evaluate(r)))],abs:[lt,[lt],(r,[t])=>Math.abs(t.evaluate(r))],round:[lt,[lt],(r,[t])=>{const i=t.evaluate(r);return i<0?-Math.round(-i):Math.round(i)}],floor:[lt,[lt],(r,[t])=>Math.floor(t.evaluate(r))],ceil:[lt,[lt],(r,[t])=>Math.ceil(t.evaluate(r))],"filter-==":[Ft,[$t,Nt],(r,[t,i])=>r.properties()[t.value]===i.value],"filter-id-==":[Ft,[Nt],(r,[t])=>r.id()===t.value],"filter-type-==":[Ft,[$t],(r,[t])=>r.geometryType()===t.value],"filter-<":[Ft,[$t,Nt],(r,[t,i])=>{const a=r.properties()[t.value],u=i.value;return typeof a==typeof u&&a{const i=r.id(),a=t.value;return typeof i==typeof a&&i":[Ft,[$t,Nt],(r,[t,i])=>{const a=r.properties()[t.value],u=i.value;return typeof a==typeof u&&a>u}],"filter-id->":[Ft,[Nt],(r,[t])=>{const i=r.id(),a=t.value;return typeof i==typeof a&&i>a}],"filter-<=":[Ft,[$t,Nt],(r,[t,i])=>{const a=r.properties()[t.value],u=i.value;return typeof a==typeof u&&a<=u}],"filter-id-<=":[Ft,[Nt],(r,[t])=>{const i=r.id(),a=t.value;return typeof i==typeof a&&i<=a}],"filter->=":[Ft,[$t,Nt],(r,[t,i])=>{const a=r.properties()[t.value],u=i.value;return typeof a==typeof u&&a>=u}],"filter-id->=":[Ft,[Nt],(r,[t])=>{const i=r.id(),a=t.value;return typeof i==typeof a&&i>=a}],"filter-has":[Ft,[Nt],(r,[t])=>t.value in r.properties()],"filter-has-id":[Ft,[],r=>r.id()!==null&&r.id()!==void 0],"filter-type-in":[Ft,[mi($t)],(r,[t])=>t.value.indexOf(r.geometryType())>=0],"filter-id-in":[Ft,[mi(Nt)],(r,[t])=>t.value.indexOf(r.id())>=0],"filter-in-small":[Ft,[$t,mi(Nt)],(r,[t,i])=>i.value.indexOf(r.properties()[t.value])>=0],"filter-in-large":[Ft,[$t,mi(Nt)],(r,[t,i])=>function(a,u,p,g){for(;p<=g;){const y=p+g>>1;if(u[y]===a)return!0;u[y]>a?g=y-1:p=y+1}return!1}(r.properties()[t.value],i.value,0,i.value.length-1)],all:{type:Ft,overloads:[[[Ft,Ft],(r,[t,i])=>t.evaluate(r)&&i.evaluate(r)],[_i(Ft),(r,t)=>{for(const i of t)if(!i.evaluate(r))return!1;return!0}]]},any:{type:Ft,overloads:[[[Ft,Ft],(r,[t,i])=>t.evaluate(r)||i.evaluate(r)],[_i(Ft),(r,t)=>{for(const i of t)if(i.evaluate(r))return!0;return!1}]]},"!":[Ft,[Ft],(r,[t])=>!t.evaluate(r)],"is-supported-script":[Ft,[$t],(r,[t])=>{const i=r.globals&&r.globals.isSupportedScript;return!i||i(t.evaluate(r))}],upcase:[$t,[$t],(r,[t])=>t.evaluate(r).toUpperCase()],downcase:[$t,[$t],(r,[t])=>t.evaluate(r).toLowerCase()],concat:[$t,_i(Nt),(r,t)=>t.map(i=>Al(i.evaluate(r))).join("")],"resolved-locale":[$t,[ai],(r,[t])=>t.evaluate(r).resolvedLocale()]});var Dl=If;function Mf(r){return{result:"success",value:r}}function Rs(r){return{result:"error",value:r}}function ba(r){return r["property-type"]==="data-driven"}function Gc(r){return!!r.expression&&r.expression.parameters.indexOf("zoom")>-1}function qc(r){return!!r.expression&&r.expression.interpolated}function Zt(r){return r instanceof Number?"number":r instanceof String?"string":r instanceof Boolean?"boolean":Array.isArray(r)?"array":r===null?"null":typeof r}function Ol(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}function Pf(r){return r}function Wc(r,t){const i=t.type==="color",a=r.stops&&typeof r.stops[0][0]=="object",u=a||!(a||r.property!==void 0),p=r.type||(qc(t)?"exponential":"interval");if(i&&((r=bo({},r)).stops&&(r.stops=r.stops.map(b=>[b[0],Fn.parse(b[1])])),r.default=Fn.parse(r.default?r.default:t.default)),r.colorSpace&&r.colorSpace!=="rgb"&&!Zh[r.colorSpace])throw new Error(`Unknown color space: ${r.colorSpace}`);let g,y,w;if(p==="exponential")g=ko;else if(p==="interval")g=Zc;else if(p==="categorical"){g=zf,y=Object.create(null);for(const b of r.stops)y[b[0]]=b[1];w=typeof r.stops[0][0]}else{if(p!=="identity")throw new Error(`Unknown function type "${p}"`);g=Lf}if(a){const b={},A=[];for(let L=0;LL[0]),evaluate:({zoom:L},R)=>ko({stops:I,base:r.base},t,L).evaluate(L,R)}}if(u){const b=p==="exponential"?{name:"exponential",base:r.base!==void 0?r.base:1}:null;return{kind:"camera",interpolationType:b,interpolationFactor:no.interpolationFactor.bind(void 0,b),zoomStops:r.stops.map(A=>A[0]),evaluate:({zoom:A})=>g(r,t,A,y,w)}}return{kind:"source",evaluate(b,A){const I=A&&A.properties?A.properties[r.property]:void 0;return I===void 0?Ea(r.default,t.default):g(r,t,I,y,w)}}}function Ea(r,t,i){return r!==void 0?r:t!==void 0?t:i!==void 0?i:void 0}function zf(r,t,i,a,u){return Ea(typeof i===u?a[i]:void 0,r.default,t.default)}function Zc(r,t,i){if(Zt(i)!=="number")return Ea(r.default,t.default);const a=r.stops.length;if(a===1||i<=r.stops[0][0])return r.stops[0][1];if(i>=r.stops[a-1][0])return r.stops[a-1][1];const u=Dc(r.stops.map(p=>p[0]),i);return r.stops[u][1]}function ko(r,t,i){const a=r.base!==void 0?r.base:1;if(Zt(i)!=="number")return Ea(r.default,t.default);const u=r.stops.length;if(u===1||i<=r.stops[0][0])return r.stops[0][1];if(i>=r.stops[u-1][0])return r.stops[u-1][1];const p=Dc(r.stops.map(A=>A[0]),i),g=function(A,I,M,L){const R=L-M,F=A-M;return R===0?0:I===1?F/R:(Math.pow(I,F)-1)/(Math.pow(I,R)-1)}(i,a,r.stops[p][0],r.stops[p+1][0]),y=r.stops[p][1],w=r.stops[p+1][1];let b=Ml[t.type]||Pf;if(r.colorSpace&&r.colorSpace!=="rgb"){const A=Zh[r.colorSpace];b=(I,M)=>A.reverse(A.interpolate(A.forward(I),A.forward(M),g))}return typeof y.evaluate=="function"?{evaluate(...A){const I=y.evaluate.apply(void 0,A),M=w.evaluate.apply(void 0,A);if(I!==void 0&&M!==void 0)return b(I,M,g)}}:b(y,w,g)}function Lf(r,t,i){return t.type==="color"?i=Fn.parse(i):t.type==="formatted"?i=qr.fromString(i.toString()):t.type==="resolvedImage"?i=gi.fromString(i.toString()):Zt(i)===t.type||t.type==="enum"&&t.values[i]||(i=void 0),Ea(i,r.default,t.default)}class Hc{constructor(t,i){this.expression=t,this._warningHistory={},this._evaluator=new Lh,this._defaultValue=i?function(a){return a.type==="color"&&(Ol(a.default)||Array.isArray(a.default))?new Fn(0,0,0,0):a.type==="color"?Fn.parse(a.default)||null:a.default===void 0?null:a.default}(i):null,this._enumValues=i&&i.type==="enum"?i.values:null}evaluateWithoutErrorHandling(t,i,a,u,p,g,y,w){return this._evaluator.globals=t,this._evaluator.feature=i,this._evaluator.featureState=a,this._evaluator.canonical=u||null,this._evaluator.availableImages=p||null,this._evaluator.formattedSection=g,this._evaluator.featureTileCoord=y||null,this._evaluator.featureDistanceData=w||null,this.expression.evaluate(this._evaluator)}evaluate(t,i,a,u,p,g,y,w){this._evaluator.globals=t,this._evaluator.feature=i||null,this._evaluator.featureState=a||null,this._evaluator.canonical=u||null,this._evaluator.availableImages=p||null,this._evaluator.formattedSection=g||null,this._evaluator.featureTileCoord=y||null,this._evaluator.featureDistanceData=w||null;try{const b=this.expression.evaluate(this._evaluator);if(b==null||typeof b=="number"&&b!=b)return this._defaultValue;if(this._enumValues&&!(b in this._enumValues))throw new Er(`Expected value to be one of ${Object.keys(this._enumValues).map(A=>JSON.stringify(A)).join(", ")}, but found ${JSON.stringify(b)} instead.`);return b}catch(b){return this._warningHistory[b.message]||(this._warningHistory[b.message]=!0,typeof console<"u"&&console.warn(b.message)),this._defaultValue}}}function Ta(r){return Array.isArray(r)&&r.length>0&&typeof r[0]=="string"&&r[0]in Dl}function Sa(r,t){const i=new Nh(Dl,[],t?function(u){const p={color:si,string:$t,number:lt,enum:$t,boolean:Ft,formatted:xl,resolvedImage:ks};return u.type==="array"?mi(p[u.value]||Nt,u.length):p[u.type]}(t):void 0),a=i.parse(r,void 0,void 0,void 0,t&&t.type==="string"?{typeAnnotation:"coerce"}:void 0);return a?Mf(new Hc(a,t)):Rs(i.errors)}class ed{constructor(t,i){this.kind=t,this._styleExpression=i,this.isStateDependent=t!=="constant"&&!Co(i.expression)}evaluateWithoutErrorHandling(t,i,a,u,p,g){return this._styleExpression.evaluateWithoutErrorHandling(t,i,a,u,p,g)}evaluate(t,i,a,u,p,g){return this._styleExpression.evaluate(t,i,a,u,p,g)}}class Bl{constructor(t,i,a,u){this.kind=t,this.zoomStops=a,this._styleExpression=i,this.isStateDependent=t!=="camera"&&!Co(i.expression),this.interpolationType=u}evaluateWithoutErrorHandling(t,i,a,u,p,g){return this._styleExpression.evaluateWithoutErrorHandling(t,i,a,u,p,g)}evaluate(t,i,a,u,p,g){return this._styleExpression.evaluate(t,i,a,u,p,g)}interpolationFactor(t,i,a){return this.interpolationType?no.interpolationFactor(this.interpolationType,t,i,a):0}}function Fl(r,t){if((r=Sa(r,t)).result==="error")return r;const i=r.value.expression,a=ya(i);if(!a&&!ba(t))return Rs([new eo("","data expressions not supported")]);const u=zs(i,["zoom","pitch","distance-from-center"]);if(!u&&!Gc(t))return Rs([new eo("","zoom expressions not supported")]);const p=Kc(i);return p||u?p instanceof eo?Rs([p]):p instanceof no&&!qc(t)?Rs([new eo("",'"interpolate" expressions cannot be used with this property')]):Mf(p?new Bl(a?"camera":"composite",r.value,p.labels,p instanceof no?p.interpolation:void 0):new ed(a?"constant":"source",r.value)):Rs([new eo("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Xc{constructor(t,i){this._parameters=t,this._specification=i,bo(this,Wc(this._parameters,this._specification))}static deserialize(t){return new Xc(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function Kc(r){let t=null;if(r instanceof bf)t=Kc(r.result);else if(r instanceof Xh){for(const i of r.args)if(t=Kc(i),t)break}else(r instanceof jh||r instanceof no)&&r.input instanceof So&&r.input.name==="zoom"&&(t=r);return t instanceof eo||r.eachChild(i=>{const a=Kc(i);a instanceof eo?t=a:!t&&a?t=new eo("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&a&&t!==a&&(t=new eo("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),t}class ct{constructor(t,i,a,u){this.message=(t?`${t}: `:"")+a,u&&(this.identifier=u),i!=null&&i.__line__&&(this.line=i.__line__)}}function Di(r){const t=r.key,i=r.value,a=r.valueSpec||{},u=r.objectElementValidators||{},p=r.style,g=r.styleSpec;let y=[];const w=Zt(i);if(w!=="object")return[new ct(t,i,`object expected, ${w} found`)];for(const b in i){const A=b.split(".")[0];let I;u[A]?I=u[A]:a[A]?I=kr:u["*"]?I=u["*"]:a["*"]&&(I=kr),I?y=y.concat(I({key:(t&&`${t}.`)+b,value:i[b],valueSpec:a[A]||a["*"],style:p,styleSpec:g,object:i,objectKey:b},i)):y.push(new ct(t,i[b],`unknown property "${b}"`))}for(const b in a)u[b]||a[b].required&&a[b].default===void 0&&i[b]===void 0&&y.push(new ct(t,i,`missing required property "${b}"`));return y}function Rf(r){const t=r.value,i=r.valueSpec,a=r.style,u=r.styleSpec,p=r.key,g=r.arrayElementValidator||kr;if(Zt(t)!=="array")return[new ct(p,t,`array expected, ${Zt(t)} found`)];if(i.length&&t.length!==i.length)return[new ct(p,t,`array length ${i.length} expected, length ${t.length} found`)];if(i["min-length"]&&t.lengthp)return[new ct(t,i,`${i} is greater than the maximum value ${p}`)]}return[]}function Ul(r){const t=r.valueSpec,i=$n(r.value.type);let a,u,p,g={};const y=i!=="categorical"&&r.value.property===void 0,w=!y,b=Zt(r.value.stops)==="array"&&Zt(r.value.stops[0])==="array"&&Zt(r.value.stops[0][0])==="object",A=Di({key:r.key,value:r.value,valueSpec:r.styleSpec.function,style:r.style,styleSpec:r.styleSpec,objectElementValidators:{stops:function(L){if(i==="identity")return[new ct(L.key,L.value,'identity function may not have a "stops" property')];let R=[];const F=L.value;return R=R.concat(Rf({key:L.key,value:F,valueSpec:L.valueSpec,style:L.style,styleSpec:L.styleSpec,arrayElementValidator:I})),Zt(F)==="array"&&F.length===0&&R.push(new ct(L.key,F,"array must have at least one stop")),R},default:function(L){return kr({key:L.key,value:L.value,valueSpec:t,style:L.style,styleSpec:L.styleSpec})}}});return i==="identity"&&y&&A.push(new ct(r.key,r.value,'missing required property "property"')),i==="identity"||r.value.stops||A.push(new ct(r.key,r.value,'missing required property "stops"')),i==="exponential"&&r.valueSpec.expression&&!qc(r.valueSpec)&&A.push(new ct(r.key,r.value,"exponential functions not supported")),r.styleSpec.$version>=8&&(w&&!ba(r.valueSpec)?A.push(new ct(r.key,r.value,"property functions not supported")):y&&!Gc(r.valueSpec)&&A.push(new ct(r.key,r.value,"zoom functions not supported"))),i!=="categorical"&&!b||r.value.property!==void 0||A.push(new ct(r.key,r.value,'"property" property is required')),A;function I(L){let R=[];const F=L.value,$=L.key;if(Zt(F)!=="array")return[new ct($,F,`array expected, ${Zt(F)} found`)];if(F.length!==2)return[new ct($,F,`array length 2 expected, length ${F.length} found`)];if(b){if(Zt(F[0])!=="object")return[new ct($,F,`object expected, ${Zt(F[0])} found`)];if(F[0].zoom===void 0)return[new ct($,F,"object stop key must have zoom")];if(F[0].value===void 0)return[new ct($,F,"object stop key must have value")];const K=$n(F[0].zoom);if(typeof K!="number")return[new ct($,F[0].zoom,"stop zoom values must be numbers")];if(p&&p>K)return[new ct($,F[0].zoom,"stop zoom values must appear in ascending order")];K!==p&&(p=K,u=void 0,g={}),R=R.concat(Di({key:`${$}[0]`,value:F[0],valueSpec:{zoom:{}},style:L.style,styleSpec:L.styleSpec,objectElementValidators:{zoom:Nl,value:M}}))}else R=R.concat(M({key:`${$}[0]`,value:F[0],valueSpec:{},style:L.style,styleSpec:L.styleSpec},F));return Ta(dr(F[1]))?R.concat([new ct(`${$}[1]`,F[1],"expressions are not allowed in function stops.")]):R.concat(kr({key:`${$}[1]`,value:F[1],valueSpec:t,style:L.style,styleSpec:L.styleSpec}))}function M(L,R){const F=Zt(L.value),$=$n(L.value),K=L.value!==null?L.value:R;if(a){if(F!==a)return[new ct(L.key,K,`${F} stop domain type must match previous stop domain type ${a}`)]}else a=F;if(F!=="number"&&F!=="string"&&F!=="boolean"&&typeof $!="number"&&typeof $!="string"&&typeof $!="boolean")return[new ct(L.key,K,"stop domain value must be a number, string, or boolean")];if(F!=="number"&&i!=="categorical"){let se=`number expected, ${F} found`;return ba(t)&&i===void 0&&(se+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ct(L.key,K,se)]}return i!=="categorical"||F!=="number"||typeof $=="number"&&isFinite($)&&Math.floor($)===$?i!=="categorical"&&F==="number"&&typeof $=="number"&&typeof u=="number"&&u!==void 0&&$new ct(`${r.key}${a.key}`,r.value,a.message));const i=t.value.expression||t.value._styleExpression.expression;if(r.expressionContext==="property"&&r.propertyKey==="text-font"&&!i.outputDefined())return[new ct(r.key,r.value,`Invalid data expression for "${r.propertyKey}". Output values must be contained as literals within the expression.`)];if(r.expressionContext==="property"&&r.propertyType==="layout"&&!Co(i))return[new ct(r.key,r.value,'"feature-state" data expressions are not supported with layout properties.')];if(r.expressionContext==="filter")return jl(i,r);if(r.expressionContext&&r.expressionContext.indexOf("cluster")===0){if(!zs(i,["zoom","feature-state"]))return[new ct(r.key,r.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(r.expressionContext==="cluster-initial"&&!ya(i))return[new ct(r.key,r.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function jl(r,t){const i=new Set(["zoom","feature-state","pitch","distance-from-center"]);if(t.valueSpec&&t.valueSpec.expression)for(const u of t.valueSpec.expression.parameters)i.delete(u);if(i.size===0)return[];const a=[];return r instanceof So&&i.has(r.name)?[new ct(t.key,t.value,`["${r.name}"] expression is not supported in a filter for a ${t.object.type} layer with id: ${t.object.id}`)]:(r.eachChild(u=>{a.push(...jl(u,t))}),a)}function Yc(r){const t=r.key,i=r.value,a=r.valueSpec,u=[];return Array.isArray(a.values)?a.values.indexOf($n(i))===-1&&u.push(new ct(t,i,`expected one of [${a.values.join(", ")}], ${JSON.stringify(i)} found`)):Object.keys(a.values).indexOf($n(i))===-1&&u.push(new ct(t,i,`expected one of [${Object.keys(a.values).join(", ")}], ${JSON.stringify(i)} found`)),u}function td(r){if(r===!0||r===!1)return!0;if(!Array.isArray(r)||r.length===0)return!1;switch(r[0]){case"has":return r.length>=2&&r[1]!=="$id"&&r[1]!=="$type";case"in":return r.length>=3&&(typeof r[1]!="string"||Array.isArray(r[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return r.length!==3||Array.isArray(r[1])||Array.isArray(r[2]);case"any":case"all":for(const t of r.slice(1))if(!td(t)&&typeof t!="boolean")return!1;return!0;default:return!0}}function Jc(r,t="fill"){if(r==null)return{filter:()=>!0,needGeometry:!1,needFeature:!1};td(r)||(r=Ca(r));const i=r;let a=!0;try{a=function(b){if(!Aa(b))return b;let A=dr(b);return Qc(A),A=Df(A),A}(i)}catch{console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate. +This is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md +and paste the contents of this message in the report. +Thank you! +Filter Expression: +${JSON.stringify(i,null,2)} + `)}const u=Re[`filter_${t}`],p=Sa(a,u);let g=null;if(p.result==="error")throw new Error(p.value.map(b=>`${b.key}: ${b.message}`).join(", "));g=(b,A,I)=>p.value.evaluate(b,A,{},I);let y=null,w=null;if(a!==i){const b=Sa(i,u);if(b.result==="error")throw new Error(b.value.map(A=>`${A.key}: ${A.message}`).join(", "));y=(A,I,M,L,R)=>b.value.evaluate(A,I,{},M,void 0,void 0,L,R),w=!ya(b.value.expression)}return{filter:g,dynamicFilter:y||void 0,needGeometry:Of(a),needFeature:!!w}}function Df(r){if(!Array.isArray(r))return r;const t=function(i){if(nd.has(i[0])){for(let a=1;aDf(i))}function Qc(r){let t=!1;const i=[];if(r[0]==="case"){for(let a=1;a",">=","<","<=","to-boolean"]);function iy(r,t){return rt?1:0}function Of(r){if(!Array.isArray(r))return!1;if(r[0]==="within")return!0;for(let t=1;t"||t==="<="||t===">="?rd(r[1],r[2],t):t==="any"?(i=r.slice(1),["any"].concat(i.map(Ca))):t==="all"?["all"].concat(r.slice(1).map(Ca)):t==="none"?["all"].concat(r.slice(1).map(Ca).map(eu)):t==="in"?id(r[1],r.slice(2)):t==="!in"?eu(id(r[1],r.slice(2))):t==="has"?od(r[1]):t==="!has"?eu(od(r[1])):t!=="within"||r;var i}function rd(r,t,i){switch(r){case"$type":return[`filter-type-${i}`,t];case"$id":return[`filter-id-${i}`,t];default:return[`filter-${i}`,r,t]}}function id(r,t){if(t.length===0)return!1;switch(r){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some(i=>typeof i!=typeof t[0])?["filter-in-large",r,["literal",t.sort(iy)]]:["filter-in-small",r,["literal",t]]}}function od(r){switch(r){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",r]}}function eu(r){return["!",r]}function Vl(r){return td(dr(r.value))?pr(bo({},r,{expressionContext:"filter",valueSpec:r.styleSpec[`filter_${r.layerType||"fill"}`]})):$l(r)}function $l(r){const t=r.value,i=r.key;if(Zt(t)!=="array")return[new ct(i,t,`array expected, ${Zt(t)} found`)];const a=r.styleSpec;let u,p=[];if(t.length<1)return[new ct(i,t,"filter array must have at least 1 element")];switch(p=p.concat(Yc({key:`${i}[0]`,value:t[0],valueSpec:a.filter_operator,style:r.style,styleSpec:r.styleSpec})),$n(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&$n(t[1])==="$type"&&p.push(new ct(i,t,`"$type" cannot be use with operator "${t[0]}"`));case"==":case"!=":t.length!==3&&p.push(new ct(i,t,`filter array for operator "${t[0]}" must have 3 elements`));case"in":case"!in":t.length>=2&&(u=Zt(t[1]),u!=="string"&&p.push(new ct(`${i}[1]`,t[1],`string expected, ${u} found`)));for(let g=2;g{b in i&&t.push(new ct(a,i[b],`"${b}" is prohibited for ref layers`))}),u.layers.forEach(b=>{$n(b.id)===y&&(w=b)}),w?w.ref?t.push(new ct(a,i.ref,"ref cannot reference another ref layer")):g=$n(w.type):typeof y=="string"&&t.push(new ct(a,i.ref,`ref layer "${y}" not found`))}else if(g!=="background"&&g!=="sky")if(i.source){const w=u.sources&&u.sources[i.source],b=w&&$n(w.type);w?b==="vector"&&g==="raster"?t.push(new ct(a,i.source,`layer "${i.id}" requires a raster source`)):b==="raster"&&g!=="raster"?t.push(new ct(a,i.source,`layer "${i.id}" requires a vector source`)):b!=="vector"||i["source-layer"]?b==="raster-dem"&&g!=="hillshade"?t.push(new ct(a,i.source,"raster-dem source can only be used with layer type 'hillshade'.")):g!=="line"||!i.paint||!i.paint["line-gradient"]&&!i.paint["line-trim-offset"]||b==="geojson"&&w.lineMetrics||t.push(new ct(a,i,`layer "${i.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):t.push(new ct(a,i,`layer "${i.id}" must specify a "source-layer"`)):t.push(new ct(a,i.source,`source "${i.source}" not found`))}else t.push(new ct(a,i,'missing required property "source"'));return t=t.concat(Di({key:a,value:i,valueSpec:p.layer,style:r.style,styleSpec:r.styleSpec,objectElementValidators:{"*":()=>[],type:()=>kr({key:`${a}.type`,value:i.type,valueSpec:p.layer.type,style:r.style,styleSpec:r.styleSpec,object:i,objectKey:"type"}),filter:w=>Vl(bo({layerType:g},w)),layout:w=>Di({layer:i,key:w.key,value:w.value,valueSpec:{},style:w.style,styleSpec:w.styleSpec,objectElementValidators:{"*":b=>ad(bo({layerType:g},b))}}),paint:w=>Di({layer:i,key:w.key,value:w.value,valueSpec:{},style:w.style,styleSpec:w.styleSpec,objectElementValidators:{"*":b=>Bf(bo({layerType:g},b))}})}})),t}function rs(r){const t=r.value,i=r.key,a=Zt(t);return a!=="string"?[new ct(i,t,`string expected, ${a} found`)]:[]}const Nf={promoteId:function({key:r,value:t}){if(Zt(t)==="string")return rs({key:r,value:t});{const i=[];for(const a in t)i.push(...rs({key:`${r}.${a}`,value:t[a]}));return i}}};function Uf(r){const t=r.value,i=r.key,a=r.styleSpec,u=r.style;if(!t.type)return[new ct(i,t,'"type" is required')];const p=$n(t.type);let g;switch(p){case"vector":case"raster":case"raster-dem":return g=Di({key:i,value:t,valueSpec:a[`source_${p.replace("-","_")}`],style:r.style,styleSpec:a,objectElementValidators:Nf}),g;case"geojson":if(g=Di({key:i,value:t,valueSpec:a.source_geojson,style:u,styleSpec:a,objectElementValidators:Nf}),t.cluster)for(const y in t.clusterProperties){const[w,b]=t.clusterProperties[y],A=typeof w=="string"?[w,["accumulated"],["get",y]]:w;g.push(...pr({key:`${i}.${y}.map`,value:b,expressionContext:"cluster-map"})),g.push(...pr({key:`${i}.${y}.reduce`,value:A,expressionContext:"cluster-reduce"}))}return g;case"video":return Di({key:i,value:t,valueSpec:a.source_video,style:u,styleSpec:a});case"image":return Di({key:i,value:t,valueSpec:a.source_image,style:u,styleSpec:a});case"canvas":return[new ct(i,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Yc({key:`${i}.type`,value:t.type,valueSpec:{values:oy(a)},style:u,styleSpec:a})}}function oy(r){return r.source.reduce((t,i)=>{const a=r[i];return a.type.type==="enum"&&(t=t.concat(Object.keys(a.type.values))),t},[])}function jf(r){const t=r.value,i=r.styleSpec,a=i.light,u=r.style;let p=[];const g=Zt(t);if(t===void 0)return p;if(g!=="object")return p=p.concat([new ct("light",t,`object expected, ${g} found`)]),p;for(const y in t){const w=y.match(/^(.*)-transition$/);p=p.concat(w&&a[w[1]]&&a[w[1]].transition?kr({key:y,value:t[y],valueSpec:i.transition,style:u,styleSpec:i}):a[y]?kr({key:y,value:t[y],valueSpec:a[y],style:u,styleSpec:i}):[new ct(y,t[y],`unknown property "${y}"`)])}return p}function ld(r){const t=r.value,i=r.key,a=r.style,u=r.styleSpec,p=u.terrain;let g=[];const y=Zt(t);if(t===void 0)return g;if(y!=="object")return g=g.concat([new ct("terrain",t,`object expected, ${y} found`)]),g;for(const w in t){const b=w.match(/^(.*)-transition$/);g=g.concat(b&&p[b[1]]&&p[b[1]].transition?kr({key:w,value:t[w],valueSpec:u.transition,style:a,styleSpec:u}):p[w]?kr({key:w,value:t[w],valueSpec:p[w],style:a,styleSpec:u}):[new ct(w,t[w],`unknown property "${w}"`)])}if(t.source){const w=a.sources&&a.sources[t.source],b=w&&$n(w.type);w?b!=="raster-dem"&&g.push(new ct(i,t.source,`terrain cannot be used with a source of type ${String(b)}, it only be used with a "raster-dem" source type`)):g.push(new ct(i,t.source,`source "${t.source}" not found`))}else g.push(new ct(i,t,'terrain is missing required property "source"'));return g}function Vf(r){const t=r.value,i=r.style,a=r.styleSpec,u=a.fog;let p=[];const g=Zt(t);if(t===void 0)return p;if(g!=="object")return p=p.concat([new ct("fog",t,`object expected, ${g} found`)]),p;for(const y in t){const w=y.match(/^(.*)-transition$/);p=p.concat(w&&u[w[1]]&&u[w[1]].transition?kr({key:y,value:t[y],valueSpec:a.transition,style:i,styleSpec:a}):u[y]?kr({key:y,value:t[y],valueSpec:u[y],style:i,styleSpec:a}):[new ct(y,t[y],`unknown property "${y}"`)])}return p}const $f={"*":()=>[],array:Rf,boolean:function(r){const t=r.value,i=r.key,a=Zt(t);return a!=="boolean"?[new ct(i,t,`boolean expected, ${a} found`)]:[]},number:Nl,color:function(r){const t=r.key,i=r.value,a=Zt(i);return a!=="string"?[new ct(t,i,`color expected, ${a} found`)]:Ah(i)===null?[new ct(t,i,`color expected, "${i}" found`)]:[]},enum:Yc,filter:Vl,function:Ul,layer:Ff,object:Di,source:Uf,light:jf,terrain:ld,fog:Vf,string:rs,formatted:function(r){return rs(r).length===0?[]:pr(r)},resolvedImage:function(r){return rs(r).length===0?[]:pr(r)},projection:function(r){const t=r.value,i=r.styleSpec,a=i.projection,u=r.style;let p=[];const g=Zt(t);if(g==="object")for(const y in t)p=p.concat(kr({key:y,value:t[y],valueSpec:a[y],style:u,styleSpec:i}));else g!=="string"&&(p=p.concat([new ct("projection",t,`object or string expected, ${g} found`)]));return p}};function kr(r){const t=r.value,i=r.valueSpec,a=r.styleSpec;return i.expression&&Ol($n(t))?Ul(r):i.expression&&Ta(dr(t))?pr(r):i.type&&$f[i.type]?$f[i.type](r):Di(bo({},r,{valueSpec:i.type?a[i.type]:i}))}function sy(r){const t=r.value,i=r.key,a=rs(r);return a.length||(t.indexOf("{fontstack}")===-1&&a.push(new ct(i,t,'"glyphs" url must include a "{fontstack}" token')),t.indexOf("{range}")===-1&&a.push(new ct(i,t,'"glyphs" url must include a "{range}" token'))),a}function Gf(r,t=Re){return yi(kr({key:"",value:r,valueSpec:t.$root,styleSpec:t,style:r,objectElementValidators:{glyphs:sy,"*":()=>[]}}))}const ay=r=>yi(Bf(r)),ly=r=>yi(ad(r));function yi(r){return r.slice().sort((t,i)=>t.line&&i.line?t.line-i.line:0)}function qf(r,t){let i=!1;if(t&&t.length)for(const a of t)r.fire(new wo(new Error(a.message))),i=!0;return i}var cy=ro,Oi=3;function ro(r,t,i){var a=this.cells=[];if(r instanceof ArrayBuffer){this.arrayBuffer=r;var u=new Int32Array(this.arrayBuffer);r=u[0],this.d=(t=u[1])+2*(i=u[2]);for(var p=0;p=A[L+0]&&a>=A[L+1])?(g[M]=!0,p.push(b[M])):g[M]=!1}}},ro.prototype._forEachCell=function(r,t,i,a,u,p,g,y){for(var w=this._convertToCellCoord(r),b=this._convertToCellCoord(t),A=this._convertToCellCoord(i),I=this._convertToCellCoord(a),M=w;M<=A;M++)for(var L=b;L<=I;L++){var R=this.d*L+M;if((!y||y(this._convertFromCellCoord(M),this._convertFromCellCoord(L),this._convertFromCellCoord(M+1),this._convertFromCellCoord(L+1)))&&u.call(this,r,t,i,a,R,p,g,y))return}},ro.prototype._convertFromCellCoord=function(r){return(r-this.padding)/this.scale},ro.prototype._convertToCellCoord=function(r){return Math.max(0,Math.min(this.d-1,Math.floor(r*this.scale)+this.padding))},ro.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var r=this.cells,t=Oi+this.cells.length+1+1,i=0,a=0;a=0||(u[p]=Ia(r[p],t)));r instanceof Error&&(u.message=r.message)}if(u.$name)throw new Error("$name property is reserved for worker serialization logic.");return a!=="Object"&&(u.$name=a),u}throw new Error("can't serialize object of type "+typeof r)}function Os(r){if(r==null||typeof r=="boolean"||typeof r=="number"||typeof r=="string"||r instanceof Boolean||r instanceof Number||r instanceof String||r instanceof Date||r instanceof RegExp||cd(r)||ud(r)||ArrayBuffer.isView(r)||r instanceof k.ImageData)return r;if(Array.isArray(r))return r.map(Os);if(typeof r=="object"){const t=r.$name||"Object",{klass:i}=tu[t];if(!i)throw new Error(`can't deserialize unregistered class ${t}`);if(i.deserialize)return i.deserialize(r);const a=Object.create(i.prototype);for(const u of Object.keys(r))u!=="$name"&&(a[u]=Os(r[u]));return a}throw new Error("can't deserialize object of type "+typeof r)}const at={"Latin-1 Supplement":r=>r>=128&&r<=255,Arabic:r=>r>=1536&&r<=1791,"Arabic Supplement":r=>r>=1872&&r<=1919,"Arabic Extended-A":r=>r>=2208&&r<=2303,"Hangul Jamo":r=>r>=4352&&r<=4607,"Unified Canadian Aboriginal Syllabics":r=>r>=5120&&r<=5759,Khmer:r=>r>=6016&&r<=6143,"Unified Canadian Aboriginal Syllabics Extended":r=>r>=6320&&r<=6399,"General Punctuation":r=>r>=8192&&r<=8303,"Letterlike Symbols":r=>r>=8448&&r<=8527,"Number Forms":r=>r>=8528&&r<=8591,"Miscellaneous Technical":r=>r>=8960&&r<=9215,"Control Pictures":r=>r>=9216&&r<=9279,"Optical Character Recognition":r=>r>=9280&&r<=9311,"Enclosed Alphanumerics":r=>r>=9312&&r<=9471,"Geometric Shapes":r=>r>=9632&&r<=9727,"Miscellaneous Symbols":r=>r>=9728&&r<=9983,"Miscellaneous Symbols and Arrows":r=>r>=11008&&r<=11263,"CJK Radicals Supplement":r=>r>=11904&&r<=12031,"Kangxi Radicals":r=>r>=12032&&r<=12255,"Ideographic Description Characters":r=>r>=12272&&r<=12287,"CJK Symbols and Punctuation":r=>r>=12288&&r<=12351,Hiragana:r=>r>=12352&&r<=12447,Katakana:r=>r>=12448&&r<=12543,Bopomofo:r=>r>=12544&&r<=12591,"Hangul Compatibility Jamo":r=>r>=12592&&r<=12687,Kanbun:r=>r>=12688&&r<=12703,"Bopomofo Extended":r=>r>=12704&&r<=12735,"CJK Strokes":r=>r>=12736&&r<=12783,"Katakana Phonetic Extensions":r=>r>=12784&&r<=12799,"Enclosed CJK Letters and Months":r=>r>=12800&&r<=13055,"CJK Compatibility":r=>r>=13056&&r<=13311,"CJK Unified Ideographs Extension A":r=>r>=13312&&r<=19903,"Yijing Hexagram Symbols":r=>r>=19904&&r<=19967,"CJK Unified Ideographs":r=>r>=19968&&r<=40959,"Yi Syllables":r=>r>=40960&&r<=42127,"Yi Radicals":r=>r>=42128&&r<=42191,"Hangul Jamo Extended-A":r=>r>=43360&&r<=43391,"Hangul Syllables":r=>r>=44032&&r<=55215,"Hangul Jamo Extended-B":r=>r>=55216&&r<=55295,"Private Use Area":r=>r>=57344&&r<=63743,"CJK Compatibility Ideographs":r=>r>=63744&&r<=64255,"Arabic Presentation Forms-A":r=>r>=64336&&r<=65023,"Vertical Forms":r=>r>=65040&&r<=65055,"CJK Compatibility Forms":r=>r>=65072&&r<=65103,"Small Form Variants":r=>r>=65104&&r<=65135,"Arabic Presentation Forms-B":r=>r>=65136&&r<=65279,"Halfwidth and Fullwidth Forms":r=>r>=65280&&r<=65519};function hd(r){for(const t of r)if(dd(t.charCodeAt(0)))return!0;return!1}function uy(r){for(const t of r)if(!Wf(t.charCodeAt(0)))return!1;return!0}function Wf(r){return!(at.Arabic(r)||at["Arabic Supplement"](r)||at["Arabic Extended-A"](r)||at["Arabic Presentation Forms-A"](r)||at["Arabic Presentation Forms-B"](r))}function dd(r){return!(r!==746&&r!==747&&(r<4352||!(at["Bopomofo Extended"](r)||at.Bopomofo(r)||at["CJK Compatibility Forms"](r)&&!(r>=65097&&r<=65103)||at["CJK Compatibility Ideographs"](r)||at["CJK Compatibility"](r)||at["CJK Radicals Supplement"](r)||at["CJK Strokes"](r)||!(!at["CJK Symbols and Punctuation"](r)||r>=12296&&r<=12305||r>=12308&&r<=12319||r===12336)||at["CJK Unified Ideographs Extension A"](r)||at["CJK Unified Ideographs"](r)||at["Enclosed CJK Letters and Months"](r)||at["Hangul Compatibility Jamo"](r)||at["Hangul Jamo Extended-A"](r)||at["Hangul Jamo Extended-B"](r)||at["Hangul Jamo"](r)||at["Hangul Syllables"](r)||at.Hiragana(r)||at["Ideographic Description Characters"](r)||at.Kanbun(r)||at["Kangxi Radicals"](r)||at["Katakana Phonetic Extensions"](r)||at.Katakana(r)&&r!==12540||!(!at["Halfwidth and Fullwidth Forms"](r)||r===65288||r===65289||r===65293||r>=65306&&r<=65310||r===65339||r===65341||r===65343||r>=65371&&r<=65503||r===65507||r>=65512&&r<=65519)||!(!at["Small Form Variants"](r)||r>=65112&&r<=65118||r>=65123&&r<=65126)||at["Unified Canadian Aboriginal Syllabics"](r)||at["Unified Canadian Aboriginal Syllabics Extended"](r)||at["Vertical Forms"](r)||at["Yijing Hexagram Symbols"](r)||at["Yi Syllables"](r)||at["Yi Radicals"](r))))}function Zf(r){return!(dd(r)||function(t){return!!(at["Latin-1 Supplement"](t)&&(t===167||t===169||t===174||t===177||t===188||t===189||t===190||t===215||t===247)||at["General Punctuation"](t)&&(t===8214||t===8224||t===8225||t===8240||t===8241||t===8251||t===8252||t===8258||t===8263||t===8264||t===8265||t===8273)||at["Letterlike Symbols"](t)||at["Number Forms"](t)||at["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||t===9003||t>=9085&&t<=9114||t>=9150&&t<=9165||t===9167||t>=9169&&t<=9179||t>=9186&&t<=9215)||at["Control Pictures"](t)&&t!==9251||at["Optical Character Recognition"](t)||at["Enclosed Alphanumerics"](t)||at["Geometric Shapes"](t)||at["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||at["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||at["CJK Symbols and Punctuation"](t)||at.Katakana(t)||at["Private Use Area"](t)||at["CJK Compatibility Forms"](t)||at["Small Form Variants"](t)||at["Halfwidth and Fullwidth Forms"](t)||t===8734||t===8756||t===8757||t>=9984&&t<=10087||t>=10102&&t<=10131||t===65532||t===65533)}(r))}function Hf(r){return r>=1424&&r<=2303||at["Arabic Presentation Forms-A"](r)||at["Arabic Presentation Forms-B"](r)}function hy(r,t){return!(!t&&Hf(r)||r>=2304&&r<=3583||r>=3840&&r<=4255||at.Khmer(r))}function dy(r){for(const t of r)if(Hf(t.charCodeAt(0)))return!0;return!1}const pd="deferred",fd="loading",md="loaded";let ka=null,d="unavailable",o=null;const c=function(r){r&&typeof r=="string"&&r.indexOf("NetworkError")>-1&&(d="error"),ka&&ka(r)};function f(){_.fire(new Is("pluginStateChange",{pluginStatus:d,pluginURL:o}))}const _=new vl,x=function(){return d},T=function(){if(d!==pd||!o)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");d=fd,f(),o&&ua({url:o},r=>{r?c(r):(d=md,f())})},S={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>d===md||S.applyArabicShaping!=null,isLoading:()=>d===fd,setState(r){d=r.pluginStatus,o=r.pluginURL},isParsed:()=>S.applyArabicShaping!=null&&S.processBidirectionalText!=null&&S.processStyledBidirectionalText!=null,getPluginURL:()=>o};class C{constructor(t,i){this.zoom=t,i?(this.now=i.now,this.fadeDuration=i.fadeDuration,this.transition=i.transition,this.pitch=i.pitch):(this.now=0,this.fadeDuration=0,this.transition={},this.pitch=0)}isSupportedScript(t){return function(i,a){for(const u of i)if(!hy(u.charCodeAt(0),a))return!1;return!0}(t,S.isLoaded())}}class z{constructor(t,i){this.property=t,this.value=i,this.expression=function(a,u){if(Ol(a))return new Xc(a,u);if(Ta(a)){const p=Fl(a,u);if(p.result==="error")throw new Error(p.value.map(g=>`${g.key}: ${g.message}`).join(", "));return p.value}{let p=a;return typeof a=="string"&&u.type==="color"&&(p=Fn.parse(a)),{kind:"constant",evaluate:()=>p}}}(i===void 0?t.specification.default:i,t.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(t,i,a){return this.property.possiblyEvaluate(this,t,i,a)}}class P{constructor(t){this.property=t,this.value=new z(t,void 0)}transitioned(t,i){return new j(this.property,this.value,i,vn({},t.transition,this.transition),t.now)}untransitioned(){return new j(this.property,this.value,null,{},0)}}class O{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)}getValue(t){return Dr(this._values[t].value.value)}setValue(t,i){this._values.hasOwnProperty(t)||(this._values[t]=new P(this._values[t].property)),this._values[t].value=new z(this._values[t].property,i===null?void 0:Dr(i))}getTransition(t){return Dr(this._values[t].transition)}setTransition(t,i){this._values.hasOwnProperty(t)||(this._values[t]=new P(this._values[t].property)),this._values[t].transition=Dr(i)||void 0}serialize(){const t={};for(const i of Object.keys(this._values)){const a=this.getValue(i);a!==void 0&&(t[i]=a);const u=this.getTransition(i);u!==void 0&&(t[`${i}-transition`]=u)}return t}transitioned(t,i){const a=new W(this._properties);for(const u of Object.keys(this._values))a._values[u]=this._values[u].transitioned(t,i._values[u]);return a}untransitioned(){const t=new W(this._properties);for(const i of Object.keys(this._values))t._values[i]=this._values[i].untransitioned();return t}}class j{constructor(t,i,a,u,p){const g=u.delay||0,y=u.duration||0;p=p||0,this.property=t,this.value=i,this.begin=p+g,this.end=this.begin+y,t.specification.transition&&(u.delay||u.duration)&&(this.prior=a)}possiblyEvaluate(t,i,a){const u=t.now||0,p=this.value.possiblyEvaluate(t,i,a),g=this.prior;if(g){if(u>this.end)return this.prior=null,p;if(this.value.isDataDriven())return this.prior=null,p;if(uthis.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const i=this.uint8;this._refreshViews(),i&&this.uint8.set(i)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}destroy(){this.int8=this.uint8=this.int16=this.uint16=this.int32=this.uint32=this.float32=null,this.arrayBuffer=null}}function ye(r,t=1){let i=0,a=0;return{members:r.map(u=>{const p=fe[u.type].BYTES_PER_ELEMENT,g=i=Ae(i,Math.max(t,p)),y=u.components||1;return a=Math.max(a,p),i+=p*y,{name:u.name,type:u.type,components:y,offset:g}}),size:Ae(i,Math.max(a,t)),alignment:t}}function Ae(r,t){return Math.ceil(r/t)*t}class We extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i){const a=this.length;return this.resize(a+1),this.emplace(a,t,i)}emplace(t,i,a){const u=2*t;return this.int16[u+0]=i,this.int16[u+1]=a,t}}We.prototype.bytesPerElement=4,dt(We,"StructArrayLayout2i4");class Ee extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,a){const u=this.length;return this.resize(u+1),this.emplace(u,t,i,a)}emplace(t,i,a,u){const p=3*t;return this.int16[p+0]=i,this.int16[p+1]=a,this.int16[p+2]=u,t}}Ee.prototype.bytesPerElement=6,dt(Ee,"StructArrayLayout3i6");class Fe extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,a,u){const p=this.length;return this.resize(p+1),this.emplace(p,t,i,a,u)}emplace(t,i,a,u,p){const g=4*t;return this.int16[g+0]=i,this.int16[g+1]=a,this.int16[g+2]=u,this.int16[g+3]=p,t}}Fe.prototype.bytesPerElement=8,dt(Fe,"StructArrayLayout4i8");class ke extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p,g,y){const w=this.length;return this.resize(w+1),this.emplace(w,t,i,a,u,p,g,y)}emplace(t,i,a,u,p,g,y,w){const b=6*t,A=12*t,I=3*t;return this.int16[b+0]=i,this.int16[b+1]=a,this.uint8[A+4]=u,this.uint8[A+5]=p,this.uint8[A+6]=g,this.uint8[A+7]=y,this.float32[I+2]=w,t}}ke.prototype.bytesPerElement=12,dt(ke,"StructArrayLayout2i4ub1f12");class qe extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a,u){const p=this.length;return this.resize(p+1),this.emplace(p,t,i,a,u)}emplace(t,i,a,u,p){const g=4*t;return this.float32[g+0]=i,this.float32[g+1]=a,this.float32[g+2]=u,this.float32[g+3]=p,t}}qe.prototype.bytesPerElement=16,dt(qe,"StructArrayLayout4f16");class Se extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p){const g=this.length;return this.resize(g+1),this.emplace(g,t,i,a,u,p)}emplace(t,i,a,u,p,g){const y=6*t,w=3*t;return this.uint16[y+0]=i,this.uint16[y+1]=a,this.uint16[y+2]=u,this.uint16[y+3]=p,this.float32[w+2]=g,t}}Se.prototype.bytesPerElement=12,dt(Se,"StructArrayLayout4ui1f12");class Be extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,a,u){const p=this.length;return this.resize(p+1),this.emplace(p,t,i,a,u)}emplace(t,i,a,u,p){const g=4*t;return this.uint16[g+0]=i,this.uint16[g+1]=a,this.uint16[g+2]=u,this.uint16[g+3]=p,t}}Be.prototype.bytesPerElement=8,dt(Be,"StructArrayLayout4ui8");class Xe extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p,g){const y=this.length;return this.resize(y+1),this.emplace(y,t,i,a,u,p,g)}emplace(t,i,a,u,p,g,y){const w=6*t;return this.int16[w+0]=i,this.int16[w+1]=a,this.int16[w+2]=u,this.int16[w+3]=p,this.int16[w+4]=g,this.int16[w+5]=y,t}}Xe.prototype.bytesPerElement=12,dt(Xe,"StructArrayLayout6i12");class $e extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p,g,y,w,b,A,I,M){const L=this.length;return this.resize(L+1),this.emplace(L,t,i,a,u,p,g,y,w,b,A,I,M)}emplace(t,i,a,u,p,g,y,w,b,A,I,M,L){const R=12*t;return this.int16[R+0]=i,this.int16[R+1]=a,this.int16[R+2]=u,this.int16[R+3]=p,this.uint16[R+4]=g,this.uint16[R+5]=y,this.uint16[R+6]=w,this.uint16[R+7]=b,this.int16[R+8]=A,this.int16[R+9]=I,this.int16[R+10]=M,this.int16[R+11]=L,t}}$e.prototype.bytesPerElement=24,dt($e,"StructArrayLayout4i4ui4i24");class Ye extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p,g){const y=this.length;return this.resize(y+1),this.emplace(y,t,i,a,u,p,g)}emplace(t,i,a,u,p,g,y){const w=10*t,b=5*t;return this.int16[w+0]=i,this.int16[w+1]=a,this.int16[w+2]=u,this.float32[b+2]=p,this.float32[b+3]=g,this.float32[b+4]=y,t}}Ye.prototype.bytesPerElement=20,dt(Ye,"StructArrayLayout3i3f20");class gt extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){const i=this.length;return this.resize(i+1),this.emplace(i,t)}emplace(t,i){return this.uint32[1*t+0]=i,t}}gt.prototype.bytesPerElement=4,dt(gt,"StructArrayLayout1ul4");class Et extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p,g,y,w,b,A,I,M,L){const R=this.length;return this.resize(R+1),this.emplace(R,t,i,a,u,p,g,y,w,b,A,I,M,L)}emplace(t,i,a,u,p,g,y,w,b,A,I,M,L,R){const F=20*t,$=10*t;return this.int16[F+0]=i,this.int16[F+1]=a,this.int16[F+2]=u,this.int16[F+3]=p,this.int16[F+4]=g,this.float32[$+3]=y,this.float32[$+4]=w,this.float32[$+5]=b,this.float32[$+6]=A,this.int16[F+14]=I,this.uint32[$+8]=M,this.uint16[F+18]=L,this.uint16[F+19]=R,t}}Et.prototype.bytesPerElement=40,dt(Et,"StructArrayLayout5i4f1i1ul2ui40");class pt extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p,g,y){const w=this.length;return this.resize(w+1),this.emplace(w,t,i,a,u,p,g,y)}emplace(t,i,a,u,p,g,y,w){const b=8*t;return this.int16[b+0]=i,this.int16[b+1]=a,this.int16[b+2]=u,this.int16[b+4]=p,this.int16[b+5]=g,this.int16[b+6]=y,this.int16[b+7]=w,t}}pt.prototype.bytesPerElement=16,dt(pt,"StructArrayLayout3i2i2i16");class wt extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p){const g=this.length;return this.resize(g+1),this.emplace(g,t,i,a,u,p)}emplace(t,i,a,u,p,g){const y=4*t,w=8*t;return this.float32[y+0]=i,this.float32[y+1]=a,this.float32[y+2]=u,this.int16[w+6]=p,this.int16[w+7]=g,t}}wt.prototype.bytesPerElement=16,dt(wt,"StructArrayLayout2f1f2i16");class Ut extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a,u){const p=this.length;return this.resize(p+1),this.emplace(p,t,i,a,u)}emplace(t,i,a,u,p){const g=12*t,y=3*t;return this.uint8[g+0]=i,this.uint8[g+1]=a,this.float32[y+1]=u,this.float32[y+2]=p,t}}Ut.prototype.bytesPerElement=12,dt(Ut,"StructArrayLayout2ub2f12");class Ot extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a){const u=this.length;return this.resize(u+1),this.emplace(u,t,i,a)}emplace(t,i,a,u){const p=3*t;return this.float32[p+0]=i,this.float32[p+1]=a,this.float32[p+2]=u,t}}Ot.prototype.bytesPerElement=12,dt(Ot,"StructArrayLayout3f12");class mt extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,a){const u=this.length;return this.resize(u+1),this.emplace(u,t,i,a)}emplace(t,i,a,u){const p=3*t;return this.uint16[p+0]=i,this.uint16[p+1]=a,this.uint16[p+2]=u,t}}mt.prototype.bytesPerElement=6,dt(mt,"StructArrayLayout3ui6");class en extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p,g,y,w,b,A,I,M,L,R,F,$,K,se,Y,re,ue){const ce=this.length;return this.resize(ce+1),this.emplace(ce,t,i,a,u,p,g,y,w,b,A,I,M,L,R,F,$,K,se,Y,re,ue)}emplace(t,i,a,u,p,g,y,w,b,A,I,M,L,R,F,$,K,se,Y,re,ue,ce){const Ie=30*t,Te=15*t,De=60*t;return this.int16[Ie+0]=i,this.int16[Ie+1]=a,this.int16[Ie+2]=u,this.float32[Te+2]=p,this.float32[Te+3]=g,this.uint16[Ie+8]=y,this.uint16[Ie+9]=w,this.uint32[Te+5]=b,this.uint32[Te+6]=A,this.uint32[Te+7]=I,this.uint16[Ie+16]=M,this.uint16[Ie+17]=L,this.uint16[Ie+18]=R,this.float32[Te+10]=F,this.float32[Te+11]=$,this.uint8[De+48]=K,this.uint8[De+49]=se,this.uint8[De+50]=Y,this.uint32[Te+13]=re,this.int16[Ie+28]=ue,this.uint8[De+58]=ce,t}}en.prototype.bytesPerElement=60,dt(en,"StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60");class rn extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p,g,y,w,b,A,I,M,L,R,F,$,K,se,Y,re,ue,ce,Ie,Te,De,Ze,Me,Ue,je,Ge){const et=this.length;return this.resize(et+1),this.emplace(et,t,i,a,u,p,g,y,w,b,A,I,M,L,R,F,$,K,se,Y,re,ue,ce,Ie,Te,De,Ze,Me,Ue,je,Ge)}emplace(t,i,a,u,p,g,y,w,b,A,I,M,L,R,F,$,K,se,Y,re,ue,ce,Ie,Te,De,Ze,Me,Ue,je,Ge,et){const Le=38*t,ot=19*t;return this.int16[Le+0]=i,this.int16[Le+1]=a,this.int16[Le+2]=u,this.float32[ot+2]=p,this.float32[ot+3]=g,this.int16[Le+8]=y,this.int16[Le+9]=w,this.int16[Le+10]=b,this.int16[Le+11]=A,this.int16[Le+12]=I,this.int16[Le+13]=M,this.uint16[Le+14]=L,this.uint16[Le+15]=R,this.uint16[Le+16]=F,this.uint16[Le+17]=$,this.uint16[Le+18]=K,this.uint16[Le+19]=se,this.uint16[Le+20]=Y,this.uint16[Le+21]=re,this.uint16[Le+22]=ue,this.uint16[Le+23]=ce,this.uint16[Le+24]=Ie,this.uint16[Le+25]=Te,this.uint16[Le+26]=De,this.uint16[Le+27]=Ze,this.uint16[Le+28]=Me,this.uint32[ot+15]=Ue,this.float32[ot+16]=je,this.float32[ot+17]=Ge,this.float32[ot+18]=et,t}}rn.prototype.bytesPerElement=76,dt(rn,"StructArrayLayout3i2f6i15ui1ul3f76");class on extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){const i=this.length;return this.resize(i+1),this.emplace(i,t)}emplace(t,i){return this.float32[1*t+0]=i,t}}on.prototype.bytesPerElement=4,dt(on,"StructArrayLayout1f4");class sn extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p){const g=this.length;return this.resize(g+1),this.emplace(g,t,i,a,u,p)}emplace(t,i,a,u,p,g){const y=5*t;return this.float32[y+0]=i,this.float32[y+1]=a,this.float32[y+2]=u,this.float32[y+3]=p,this.float32[y+4]=g,t}}sn.prototype.bytesPerElement=20,dt(sn,"StructArrayLayout5f20");class Mr extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,a,u){const p=this.length;return this.resize(p+1),this.emplace(p,t,i,a,u)}emplace(t,i,a,u,p){const g=6*t;return this.uint32[3*t+0]=i,this.uint16[g+2]=a,this.uint16[g+3]=u,this.uint16[g+4]=p,t}}Mr.prototype.bytesPerElement=12,dt(Mr,"StructArrayLayout1ul3ui12");class fr extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i){const a=this.length;return this.resize(a+1),this.emplace(a,t,i)}emplace(t,i,a){const u=2*t;return this.uint16[u+0]=i,this.uint16[u+1]=a,t}}fr.prototype.bytesPerElement=4,dt(fr,"StructArrayLayout2ui4");class vi extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){const i=this.length;return this.resize(i+1),this.emplace(i,t)}emplace(t,i){return this.uint16[1*t+0]=i,t}}vi.prototype.bytesPerElement=2,dt(vi,"StructArrayLayout1ui2");class io extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i){const a=this.length;return this.resize(a+1),this.emplace(a,t,i)}emplace(t,i,a){const u=2*t;return this.float32[u+0]=i,this.float32[u+1]=a,t}}io.prototype.bytesPerElement=8,dt(io,"StructArrayLayout2f8");class An extends pe{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.int16[this._pos2+3]}get tileAnchorY(){return this._structArray.int16[this._pos2+4]}get x1(){return this._structArray.float32[this._pos4+3]}get y1(){return this._structArray.float32[this._pos4+4]}get x2(){return this._structArray.float32[this._pos4+5]}get y2(){return this._structArray.float32[this._pos4+6]}get padding(){return this._structArray.int16[this._pos2+14]}get featureIndex(){return this._structArray.uint32[this._pos4+8]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+18]}get bucketIndex(){return this._structArray.uint16[this._pos2+19]}}An.prototype.size=40;class an extends Et{get(t){return new An(this,t)}}dt(an,"CollisionBoxArray");class Xt extends pe{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+8]}get numGlyphs(){return this._structArray.uint16[this._pos2+9]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+5]}get lineStartIndex(){return this._structArray.uint32[this._pos4+6]}get lineLength(){return this._structArray.uint32[this._pos4+7]}get segment(){return this._structArray.uint16[this._pos2+16]}get lowerSize(){return this._structArray.uint16[this._pos2+17]}get upperSize(){return this._structArray.uint16[this._pos2+18]}get lineOffsetX(){return this._structArray.float32[this._pos4+10]}get lineOffsetY(){return this._structArray.float32[this._pos4+11]}get writingMode(){return this._structArray.uint8[this._pos1+48]}get placedOrientation(){return this._structArray.uint8[this._pos1+49]}set placedOrientation(t){this._structArray.uint8[this._pos1+49]=t}get hidden(){return this._structArray.uint8[this._pos1+50]}set hidden(t){this._structArray.uint8[this._pos1+50]=t}get crossTileID(){return this._structArray.uint32[this._pos4+13]}set crossTileID(t){this._structArray.uint32[this._pos4+13]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+28]}get flipState(){return this._structArray.uint8[this._pos1+58]}set flipState(t){this._structArray.uint8[this._pos1+58]=t}}Xt.prototype.size=60;class Gn extends en{get(t){return new Xt(this,t)}}dt(Gn,"PlacedSymbolArray");class Br extends pe{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+8]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+9]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+10]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+11]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+12]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+13]}get key(){return this._structArray.uint16[this._pos2+14]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+17]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+18]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+19]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+20]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+21]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+22]}get featureIndex(){return this._structArray.uint16[this._pos2+23]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+24]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+25]}get numIconVertices(){return this._structArray.uint16[this._pos2+26]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+27]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+28]}get crossTileID(){return this._structArray.uint32[this._pos4+15]}set crossTileID(t){this._structArray.uint32[this._pos4+15]=t}get textOffset0(){return this._structArray.float32[this._pos4+16]}get textOffset1(){return this._structArray.float32[this._pos4+17]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+18]}}Br.prototype.size=76;class En extends rn{get(t){return new Br(this,t)}}dt(En,"SymbolInstanceArray");class Wr extends on{getoffsetX(t){return this.float32[1*t+0]}}dt(Wr,"GlyphOffsetArray");class nu extends We{getx(t){return this.int16[2*t+0]}gety(t){return this.int16[2*t+1]}}dt(nu,"SymbolLineVertexArray");class Bs extends pe{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]}get layoutVertexArrayOffset(){return this._structArray.uint16[this._pos2+4]}}Bs.prototype.size=12;class Gl extends Mr{get(t){return new Bs(this,t)}}dt(Gl,"FeatureIndexArray");class Mo extends fr{geta_centroid_pos0(t){return this.uint16[2*t+0]}geta_centroid_pos1(t){return this.uint16[2*t+1]}}dt(Mo,"FillExtrusionCentroidArray");const is=ye([{name:"a_pattern",components:4,type:"Uint16"},{name:"a_pixel_ratio",components:1,type:"Float32"}]),Fs=ye([{name:"a_dash",components:4,type:"Uint16"}]);var ru={exports:{}},ql={exports:{}};ql.exports=function(r,t){var i,a,u,p,g,y,w,b;for(a=r.length-(i=3&r.length),u=t,g=3432918353,y=461845907,b=0;b>>16)*g&65535)<<16)&4294967295)<<15|w>>>17))*y+(((w>>>16)*y&65535)<<16)&4294967295)<<13|u>>>19))+((5*(u>>>16)&65535)<<16)&4294967295))+((58964+(p>>>16)&65535)<<16);switch(w=0,i){case 3:w^=(255&r.charCodeAt(b+2))<<16;case 2:w^=(255&r.charCodeAt(b+1))<<8;case 1:u^=w=(65535&(w=(w=(65535&(w^=255&r.charCodeAt(b)))*g+(((w>>>16)*g&65535)<<16)&4294967295)<<15|w>>>17))*y+(((w>>>16)*y&65535)<<16)&4294967295}return u^=r.length,u=2246822507*(65535&(u^=u>>>16))+((2246822507*(u>>>16)&65535)<<16)&4294967295,u=3266489909*(65535&(u^=u>>>13))+((3266489909*(u>>>16)&65535)<<16)&4294967295,(u^=u>>>16)>>>0};var gd=ql.exports,$x={exports:{}};$x.exports=function(r,t){for(var i,a=r.length,u=t^a,p=0;a>=4;)i=1540483477*(65535&(i=255&r.charCodeAt(p)|(255&r.charCodeAt(++p))<<8|(255&r.charCodeAt(++p))<<16|(255&r.charCodeAt(++p))<<24))+((1540483477*(i>>>16)&65535)<<16),u=1540483477*(65535&u)+((1540483477*(u>>>16)&65535)<<16)^(i=1540483477*(65535&(i^=i>>>24))+((1540483477*(i>>>16)&65535)<<16)),a-=4,++p;switch(a){case 3:u^=(255&r.charCodeAt(p+2))<<16;case 2:u^=(255&r.charCodeAt(p+1))<<8;case 1:u=1540483477*(65535&(u^=255&r.charCodeAt(p)))+((1540483477*(u>>>16)&65535)<<16)}return u=1540483477*(65535&(u^=u>>>13))+((1540483477*(u>>>16)&65535)<<16),(u^=u>>>15)>>>0};var Gx=gd,ok=$x.exports;ru.exports=Gx,ru.exports.murmur3=Gx,ru.exports.murmur2=ok;var py=le(ru.exports);class Xf{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(t,i,a,u){this.ids.push(qx(t)),this.positions.push(i,a,u)}getPositions(t){const i=qx(t);let a=0,u=this.ids.length-1;for(;a>1;this.ids[g]>=i?u=g:a=g+1}const p=[];for(;this.ids[a]===i;)p.push({index:this.positions[3*a],start:this.positions[3*a+1],end:this.positions[3*a+2]}),a++;return p}static serialize(t,i){const a=new Float64Array(t.ids),u=new Uint32Array(t.positions);return fy(a,u,0,a.length-1),i&&i.push(a.buffer,u.buffer),{ids:a,positions:u}}static deserialize(t){const i=new Xf;return i.ids=t.ids,i.positions=t.positions,i.indexed=!0,i}}function qx(r){const t=+r;return!isNaN(t)&&Number.MIN_SAFE_INTEGER<=t&&t<=Number.MAX_SAFE_INTEGER?t:py(String(r))}function fy(r,t,i,a){for(;i>1];let p=i-1,g=a+1;for(;;){do p++;while(r[p]u);if(p>=g)break;Kf(r,p,g),Kf(t,3*p,3*g),Kf(t,3*p+1,3*g+1),Kf(t,3*p+2,3*g+2)}g-i`u_${u}`),this.type=a}setUniform(t,i,a,u,p){i.set(t,p,u.constantOr(this.value))}getBinding(t,i){return this.type==="color"?new Zx(t):new Yf(t)}}class iu{constructor(t,i){this.uniformNames=i.map(a=>`u_${a}`),this.pattern=null,this.pixelRatio=1}setConstantPatternPositions(t){this.pixelRatio=t.pixelRatio||1,this.pattern=t.tl.concat(t.br)}setUniform(t,i,a,u,p){const g=p==="u_pattern"||p==="u_dash"?this.pattern:p==="u_pixel_ratio"?this.pixelRatio:null;g&&i.set(t,p,g)}getBinding(t,i){return i==="u_pattern"||i==="u_dash"?new Wx(t):new Yf(t)}}class Us{constructor(t,i,a,u){this.expression=t,this.type=a,this.maxValue=0,this.paintVertexAttributes=i.map(p=>({name:`a_${p}`,type:"Float32",components:a==="color"?2:1,offset:0})),this.paintVertexArray=new u}populatePaintArray(t,i,a,u,p,g){const y=this.paintVertexArray.length,w=this.expression.evaluate(new C(0),i,{},p,u,g);this.paintVertexArray.resize(t),this._setPaintValue(y,t,w)}updatePaintArray(t,i,a,u,p){const g=this.expression.evaluate({zoom:0},a,u,void 0,p);this._setPaintValue(t,i,g)}_setPaintValue(t,i,a){if(this.type==="color"){const u=my(a);for(let p=t;p`u_${y}_t`),this.type=a,this.useIntegerZoom=u,this.zoom=p,this.maxValue=0,this.paintVertexAttributes=i.map(y=>({name:`a_${y}`,type:"Float32",components:a==="color"?4:2,offset:0})),this.paintVertexArray=new g}populatePaintArray(t,i,a,u,p,g){const y=this.expression.evaluate(new C(this.zoom),i,{},p,u,g),w=this.expression.evaluate(new C(this.zoom+1),i,{},p,u,g),b=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(b,t,y,w)}updatePaintArray(t,i,a,u,p){const g=this.expression.evaluate({zoom:this.zoom},a,u,void 0,p),y=this.expression.evaluate({zoom:this.zoom+1},a,u,void 0,p);this._setPaintValue(t,i,g,y)}_setPaintValue(t,i,a,u){if(this.type==="color"){const p=my(a),g=my(u);for(let y=t;y!0){this.binders={},this._buffers=[];const u=[];for(const p in t.paint._values){if(!a(p))continue;const g=t.paint.get(p);if(!(g instanceof Z&&ba(g.property.specification)))continue;const y=uk(p,t.type),w=g.value,b=g.property.specification.type,A=!!g.property.useIntegerZoom,I=p==="line-dasharray"||p.endsWith("pattern"),M=p==="line-dasharray"&&t.layout.get("line-cap").value.kind!=="constant";if(w.kind!=="constant"||M)if(w.kind==="source"||M||I){const L=Hx(p,b,"source");this.binders[p]=I?new Ma(w,y,b,L,t.id):new Us(w,y,b,L),u.push(`/a_${p}`)}else{const L=Hx(p,b,"composite");this.binders[p]=new Po(w,y,b,A,i,L),u.push(`/z_${p}`)}else this.binders[p]=I?new iu(w.value,y):new _d(w.value,y,b),u.push(`/u_${p}`)}this.cacheKey=u.sort().join("")}getMaxValue(t){const i=this.binders[t];return i instanceof Us||i instanceof Po?i.maxValue:0}populatePaintArrays(t,i,a,u,p,g){for(const y in this.binders){const w=this.binders[y];(w instanceof Us||w instanceof Po||w instanceof Ma)&&w.populatePaintArray(t,i,a,u,p,g)}}setConstantPatternPositions(t){for(const i in this.binders){const a=this.binders[i];a instanceof iu&&a.setConstantPatternPositions(t)}}updatePaintArrays(t,i,a,u,p,g){let y=!1;for(const w in t){const b=i.getPositions(w);for(const A of b){const I=a.feature(A.index);for(const M in this.binders){const L=this.binders[M];if((L instanceof Us||L instanceof Po||L instanceof Ma)&&L.expression.isStateDependent===!0){const R=u.paint.get(M);L.expression=R.value,L.updatePaintArray(A.start,A.end,I,t[w],p,g),y=!0}}}}return y}defines(){const t=[];for(const i in this.binders){const a=this.binders[i];(a instanceof _d||a instanceof iu)&&t.push(...a.uniformNames.map(u=>`#define HAS_UNIFORM_${u}`))}return t}getBinderAttributes(){const t=[];for(const i in this.binders){const a=this.binders[i];if(a instanceof Us||a instanceof Po||a instanceof Ma)for(let u=0;u!0){this.programConfigurations={};for(const u of t)this.programConfigurations[u.id]=new Pa(u,i,a);this.needsUpload=!1,this._featureMap=new Xf,this._bufferOffset=0}populatePaintArrays(t,i,a,u,p,g,y){for(const w in this.programConfigurations)this.programConfigurations[w].populatePaintArrays(t,i,u,p,g,y);i.id!==void 0&&this._featureMap.add(i.id,a,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,i,a,u,p){for(const g of a)this.needsUpload=this.programConfigurations[g.id].updatePaintArrays(t,this._featureMap,i,g,u,p)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(const i in this.programConfigurations)this.programConfigurations[i].upload(t);this.needsUpload=!1}}destroy(){for(const t in this.programConfigurations)this.programConfigurations[t].destroy()}}const ck={"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","pixel_ratio"],"fill-pattern":["pattern","pixel_ratio"],"fill-extrusion-pattern":["pattern","pixel_ratio"],"line-dasharray":["dash"]};function uk(r,t){return ck[r]||[r.replace(`${t}-`,"").replace(/-/g,"_")]}const hk={"line-pattern":{source:Se,composite:Se},"fill-pattern":{source:Se,composite:Se},"fill-extrusion-pattern":{source:Se,composite:Se},"line-dasharray":{source:Be,composite:Be}},dk={color:{source:io,composite:qe},number:{source:on,composite:io}};function Hx(r,t,i){const a=hk[r];return a&&a[i]||dk[t][i]}dt(_d,"ConstantBinder"),dt(iu,"PatternConstantBinder"),dt(Us,"SourceExpressionBinder"),dt(Ma,"PatternCompositeBinder"),dt(Po,"CompositeExpressionBinder"),dt(Pa,"ProgramConfiguration",{omit:["_buffers"]}),dt(Wl,"ProgramConfigurationSet");const Xx="-transition";class zo extends vl{constructor(t,i){if(super(),this.id=t.id,this.type=t.type,this._featureFilter={filter:()=>!0,needGeometry:!1,needFeature:!1},this._filterCompiled=!1,t.type!=="custom"&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,t.type!=="background"&&t.type!=="sky"&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter),i.layout&&(this._unevaluatedLayout=new H(i.layout)),i.paint)){this._transitionablePaint=new O(i.paint);for(const a in t.paint)this.setPaintProperty(a,t.paint[a],{validate:!1});for(const a in t.layout)this.setLayoutProperty(a,t.layout[a],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new X(i.paint)}}getLayoutProperty(t){return t==="visibility"?this.visibility:this._unevaluatedLayout.getValue(t)}setLayoutProperty(t,i,a={}){i!=null&&this._validate(ly,`layers.${this.id}.layout.${t}`,t,i,a)||(t!=="visibility"?this._unevaluatedLayout.setValue(t,i):this.visibility=i)}getPaintProperty(t){return xn(t,Xx)?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)}setPaintProperty(t,i,a={}){if(i!=null&&this._validate(ay,`layers.${this.id}.paint.${t}`,t,i,a))return!1;if(xn(t,Xx))return this._transitionablePaint.setTransition(t.slice(0,-11),i||void 0),!1;{const u=this._transitionablePaint._values[t],p=u.value.isDataDriven(),g=u.value;this._transitionablePaint.setValue(t,i),this._handleSpecialPaintPropertyUpdate(t);const y=this._transitionablePaint._values[t].value,w=y.isDataDriven(),b=xn(t,"pattern")||t==="line-dasharray";return w||p||b||this._handleOverridablePaintPropertyUpdate(t,g,y)}}_handleSpecialPaintPropertyUpdate(t){}getProgramIds(){return null}getProgramConfiguration(t){return null}_handleOverridablePaintPropertyUpdate(t,i,a){return!1}isHidden(t){return!!(this.minzoom&&t=this.maxzoom)||this.visibility==="none"}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(t,i){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,i)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,i)}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),Yo(t,(i,a)=>!(i===void 0||a==="layout"&&!Object.keys(i).length||a==="paint"&&!Object.keys(i).length))}_validate(t,i,a,u,p={}){return(!p||p.validate!==!1)&&qf(this,t.call(Gf,{key:i,layerType:this.type,objectKey:a,value:u,styleSpec:Re,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isSky(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const t in this.paint._values){const i=this.paint.get(t);if(i instanceof Z&&ba(i.property.specification)&&(i.value.kind==="source"||i.value.kind==="composite")&&i.value.isStateDependent)return!0}return!1}compileFilter(){this._filterCompiled||(this._featureFilter=Jc(this.filter),this._filterCompiled=!0)}invalidateCompiledFilter(){this._filterCompiled=!1}dynamicFilter(){return this._featureFilter.dynamicFilter}dynamicFilterNeedsFeature(){return this._featureFilter.needFeature}}const pk=ye([{name:"a_pos",components:2,type:"Int16"}],4),fk=ye([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]);class qn{constructor(t=[]){this.segments=t}prepareSegment(t,i,a,u){let p=this.segments[this.segments.length-1];return t>qn.MAX_VERTEX_ARRAY_LENGTH&&wn(`Max vertices per segment is ${qn.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}`),(!p||p.vertexLength+t>qn.MAX_VERTEX_ARRAY_LENGTH||p.sortKey!==u)&&(p={vertexOffset:i.length,primitiveOffset:a.length,vertexLength:0,primitiveLength:0},u!==void 0&&(p.sortKey=u),this.segments.push(p)),p}get(){return this.segments}destroy(){for(const t of this.segments)for(const i in t.vaos)t.vaos[i].destroy()}static simpleSegment(t,i,a,u){return new qn([{vertexOffset:t,primitiveOffset:i,vertexLength:a,primitiveLength:u,vaos:{},sortKey:0}])}}qn.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,dt(qn,"SegmentVector");var vt=8192;class za{constructor(t,i){t&&(i?this.setSouthWest(t).setNorthEast(i):t.length===4?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 ln?new ln(t.lng,t.lat):ln.convert(t),this}setSouthWest(t){return this._sw=t instanceof ln?new ln(t.lng,t.lat):ln.convert(t),this}extend(t){const i=this._sw,a=this._ne;let u,p;if(t instanceof ln)u=t,p=t;else{if(!(t instanceof za))return Array.isArray(t)?t.length===4||t.every(Array.isArray)?this.extend(za.convert(t)):this.extend(ln.convert(t)):typeof t=="object"&&t!==null&&t.hasOwnProperty("lat")&&(t.hasOwnProperty("lon")||t.hasOwnProperty("lng"))?this.extend(ln.convert(t)):this;if(u=t._sw,p=t._ne,!u||!p)return this}return i||a?(i.lng=Math.min(u.lng,i.lng),i.lat=Math.min(u.lat,i.lat),a.lng=Math.max(p.lng,a.lng),a.lat=Math.max(p.lat,a.lat)):(this._sw=new ln(u.lng,u.lat),this._ne=new ln(p.lng,p.lat)),this}getCenter(){return new ln((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 ln(this.getWest(),this.getNorth())}getSouthEast(){return new ln(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:a}=ln.convert(t);let u=this._sw.lng<=i&&i<=this._ne.lng;return this._sw.lng>this._ne.lng&&(u=this._sw.lng>=i&&i>=this._ne.lng),this._sw.lat<=a&&a<=this._ne.lat&&u}static convert(t){return!t||t instanceof za?t:new za(t)}}var Jf=1e-6,xi=typeof Float32Array<"u"?Float32Array:Array;function Kx(){var r=new xi(9);return xi!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[5]=0,r[6]=0,r[7]=0),r[0]=1,r[4]=1,r[8]=1,r}function Yx(r,t,i){var a=t[0],u=t[1],p=t[2],g=t[3],y=t[4],w=t[5],b=t[6],A=t[7],I=t[8],M=i[0],L=i[1],R=i[2],F=i[3],$=i[4],K=i[5],se=i[6],Y=i[7],re=i[8];return r[0]=M*a+L*g+R*b,r[1]=M*u+L*y+R*A,r[2]=M*p+L*w+R*I,r[3]=F*a+$*g+K*b,r[4]=F*u+$*y+K*A,r[5]=F*p+$*w+K*I,r[6]=se*a+Y*g+re*b,r[7]=se*u+Y*y+re*A,r[8]=se*p+Y*w+re*I,r}function Lo(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function gy(r,t){var i=t[0],a=t[1],u=t[2],p=t[3],g=t[4],y=t[5],w=t[6],b=t[7],A=t[8],I=t[9],M=t[10],L=t[11],R=t[12],F=t[13],$=t[14],K=t[15],se=i*y-a*g,Y=i*w-u*g,re=i*b-p*g,ue=a*w-u*y,ce=a*b-p*y,Ie=u*b-p*w,Te=A*F-I*R,De=A*$-M*R,Ze=A*K-L*R,Me=I*$-M*F,Ue=I*K-L*F,je=M*K-L*$,Ge=se*je-Y*Ue+re*Me+ue*Ze-ce*De+Ie*Te;return Ge?(r[0]=(y*je-w*Ue+b*Me)*(Ge=1/Ge),r[1]=(u*Ue-a*je-p*Me)*Ge,r[2]=(F*Ie-$*ce+K*ue)*Ge,r[3]=(M*ce-I*Ie-L*ue)*Ge,r[4]=(w*Ze-g*je-b*De)*Ge,r[5]=(i*je-u*Ze+p*De)*Ge,r[6]=($*re-R*Ie-K*Y)*Ge,r[7]=(A*Ie-M*re+L*Y)*Ge,r[8]=(g*Ue-y*Ze+b*Te)*Ge,r[9]=(a*Ze-i*Ue-p*Te)*Ge,r[10]=(R*ce-F*re+K*se)*Ge,r[11]=(I*re-A*ce-L*se)*Ge,r[12]=(y*De-g*Me-w*Te)*Ge,r[13]=(i*Me-a*De+u*Te)*Ge,r[14]=(F*Y-R*ue-$*se)*Ge,r[15]=(A*ue-I*Y+M*se)*Ge,r):null}function Zl(r,t,i){var a=t[0],u=t[1],p=t[2],g=t[3],y=t[4],w=t[5],b=t[6],A=t[7],I=t[8],M=t[9],L=t[10],R=t[11],F=t[12],$=t[13],K=t[14],se=t[15],Y=i[0],re=i[1],ue=i[2],ce=i[3];return r[0]=Y*a+re*y+ue*I+ce*F,r[1]=Y*u+re*w+ue*M+ce*$,r[2]=Y*p+re*b+ue*L+ce*K,r[3]=Y*g+re*A+ue*R+ce*se,r[4]=(Y=i[4])*a+(re=i[5])*y+(ue=i[6])*I+(ce=i[7])*F,r[5]=Y*u+re*w+ue*M+ce*$,r[6]=Y*p+re*b+ue*L+ce*K,r[7]=Y*g+re*A+ue*R+ce*se,r[8]=(Y=i[8])*a+(re=i[9])*y+(ue=i[10])*I+(ce=i[11])*F,r[9]=Y*u+re*w+ue*M+ce*$,r[10]=Y*p+re*b+ue*L+ce*K,r[11]=Y*g+re*A+ue*R+ce*se,r[12]=(Y=i[12])*a+(re=i[13])*y+(ue=i[14])*I+(ce=i[15])*F,r[13]=Y*u+re*w+ue*M+ce*$,r[14]=Y*p+re*b+ue*L+ce*K,r[15]=Y*g+re*A+ue*R+ce*se,r}function yd(r,t,i){var a,u,p,g,y,w,b,A,I,M,L,R,F=i[0],$=i[1],K=i[2];return t===r?(r[12]=t[0]*F+t[4]*$+t[8]*K+t[12],r[13]=t[1]*F+t[5]*$+t[9]*K+t[13],r[14]=t[2]*F+t[6]*$+t[10]*K+t[14],r[15]=t[3]*F+t[7]*$+t[11]*K+t[15]):(u=t[1],p=t[2],g=t[3],y=t[4],w=t[5],b=t[6],A=t[7],I=t[8],M=t[9],L=t[10],R=t[11],r[0]=a=t[0],r[1]=u,r[2]=p,r[3]=g,r[4]=y,r[5]=w,r[6]=b,r[7]=A,r[8]=I,r[9]=M,r[10]=L,r[11]=R,r[12]=a*F+y*$+I*K+t[12],r[13]=u*F+w*$+M*K+t[13],r[14]=p*F+b*$+L*K+t[14],r[15]=g*F+A*$+R*K+t[15]),r}function Hl(r,t,i){var a=i[0],u=i[1],p=i[2];return r[0]=t[0]*a,r[1]=t[1]*a,r[2]=t[2]*a,r[3]=t[3]*a,r[4]=t[4]*u,r[5]=t[5]*u,r[6]=t[6]*u,r[7]=t[7]*u,r[8]=t[8]*p,r[9]=t[9]*p,r[10]=t[10]*p,r[11]=t[11]*p,r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15],r}function _y(r,t,i){var a=Math.sin(i),u=Math.cos(i),p=t[4],g=t[5],y=t[6],w=t[7],b=t[8],A=t[9],I=t[10],M=t[11];return t!==r&&(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r[4]=p*u+b*a,r[5]=g*u+A*a,r[6]=y*u+I*a,r[7]=w*u+M*a,r[8]=b*u-p*a,r[9]=A*u-g*a,r[10]=I*u-y*a,r[11]=M*u-w*a,r}function Qf(r,t,i){var a=Math.sin(i),u=Math.cos(i),p=t[0],g=t[1],y=t[2],w=t[3],b=t[8],A=t[9],I=t[10],M=t[11];return t!==r&&(r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r[0]=p*u-b*a,r[1]=g*u-A*a,r[2]=y*u-I*a,r[3]=w*u-M*a,r[8]=p*a+b*u,r[9]=g*a+A*u,r[10]=y*a+I*u,r[11]=w*a+M*u,r}function Jx(r,t){return r[0]=t[0],r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=t[1],r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=t[2],r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function Qx(r,t,i){var a,u,p,g=i[0],y=i[1],w=i[2],b=Math.hypot(g,y,w);return b0&&(p=1/Math.sqrt(p)),r[0]=t[0]*p,r[1]=t[1]*p,r[2]=t[2]*p,r}function oo(r,t){return r[0]*t[0]+r[1]*t[1]+r[2]*t[2]}function xy(r,t,i){var a=t[0],u=t[1],p=t[2],g=i[0],y=i[1],w=i[2];return r[0]=u*w-p*y,r[1]=p*g-a*w,r[2]=a*y-u*g,r}function Nn(r,t,i){var a=t[0],u=t[1],p=t[2],g=i[3]*a+i[7]*u+i[11]*p+i[15];return r[0]=(i[0]*a+i[4]*u+i[8]*p+i[12])/(g=g||1),r[1]=(i[1]*a+i[5]*u+i[9]*p+i[13])/g,r[2]=(i[2]*a+i[6]*u+i[10]*p+i[14])/g,r}function nw(r,t,i){var a=i[0],u=i[1],p=i[2],g=t[0],y=t[1],w=t[2],b=u*w-p*y,A=p*g-a*w,I=a*y-u*g,M=u*I-p*A,L=p*b-a*I,R=a*A-u*b,F=2*i[3];return A*=F,I*=F,L*=2,R*=2,r[0]=g+(b*=F)+(M*=2),r[1]=y+A+L,r[2]=w+I+R,r}var Ed,Ro=vy,gk=tw,_k=vd;function rw(r,t,i){return r[0]=t[0]*i,r[1]=t[1]*i,r[2]=t[2]*i,r[3]=t[3]*i,r}function iw(r,t){var i=t[0],a=t[1],u=t[2],p=t[3],g=i*i+a*a+u*u+p*p;return g>0&&(g=1/Math.sqrt(g)),r[0]=i*g,r[1]=a*g,r[2]=u*g,r[3]=p*g,r}function Xl(r,t,i){var a=t[0],u=t[1],p=t[2],g=t[3];return r[0]=i[0]*a+i[4]*u+i[8]*p+i[12]*g,r[1]=i[1]*a+i[5]*u+i[9]*p+i[13]*g,r[2]=i[2]*a+i[6]*u+i[10]*p+i[14]*g,r[3]=i[3]*a+i[7]*u+i[11]*p+i[15]*g,r}function ow(){var r=new xi(4);return xi!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r[3]=1,r}function sw(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=1,r}function aw(r,t,i){i*=.5;var a=t[0],u=t[1],p=t[2],g=t[3],y=Math.sin(i),w=Math.cos(i);return r[0]=a*w+g*y,r[1]=u*w+p*y,r[2]=p*w-u*y,r[3]=g*w-a*y,r}function lw(r,t,i){i*=.5;var a=t[0],u=t[1],p=t[2],g=t[3],y=Math.sin(i),w=Math.cos(i);return r[0]=a*w-p*y,r[1]=u*w+g*y,r[2]=p*w+a*y,r[3]=g*w-u*y,r}yy(),Ed=new xi(4),xi!=Float32Array&&(Ed[0]=0,Ed[1]=0,Ed[2]=0,Ed[3]=0);var yk=iw;yy(),ou(1,0,0),ou(0,1,0),ow(),ow(),Kx();const vk=ye([{type:"Float32",name:"a_globe_pos",components:3},{type:"Float32",name:"a_uv",components:2}]),{members:cw}=vk,uw=ye([{name:"a_pos_3",components:3,type:"Int16"}]);var Td=ye([{name:"a_pos",type:"Int16",components:2}]);class wy{constructor(t,i){this.pos=t,this.dir=i}intersectsPlane(t,i,a){const u=oo(i,this.dir);if(Math.abs(u)<1e-6)return!1;const p=((t[0]-this.pos[0])*i[0]+(t[1]-this.pos[1])*i[1]+(t[2]-this.pos[2])*i[2])/u;return a[0]=this.pos[0]+this.dir[0]*p,a[1]=this.pos[1]+this.dir[1]*p,a[2]=this.pos[2]+this.dir[2]*p,!0}closestPointOnSphere(t,i,a){if(function(L,R){var F=L[0],$=L[1],K=L[2],se=R[0],Y=R[1],re=R[2];return Math.abs(F-se)<=Jf*Math.max(1,Math.abs(F),Math.abs(se))&&Math.abs($-Y)<=Jf*Math.max(1,Math.abs($),Math.abs(Y))&&Math.abs(K-re)<=Jf*Math.max(1,Math.abs(K),Math.abs(re))}(this.pos,t)||i===0)return a[0]=a[1]=a[2]=0,!1;const[u,p,g]=this.dir,y=this.pos[0]-t[0],w=this.pos[1]-t[1],b=this.pos[2]-t[2],A=u*u+p*p+g*g,I=2*(y*u+w*p+b*g),M=I*I-4*A*(y*y+w*w+b*b-i*i);if(M<0){const L=Math.max(-I/2,0),R=y+u*L,F=w+p*L,$=b+g*L,K=Math.hypot(R,F,$);return a[0]=R*i/K,a[1]=F*i/K,a[2]=$*i/K,!1}{const L=(-I-Math.sqrt(M))/(2*A);if(L<0){const R=Math.hypot(y,w,b);return a[0]=y*i/R,a[1]=w*i/R,a[2]=b*i/R,!1}return a[0]=y+u*L,a[1]=w+p*L,a[2]=b+g*L,!0}}}class by{constructor(t,i,a,u,p){this.TL=t,this.TR=i,this.BR=a,this.BL=u,this.horizon=p}static fromInvProjectionMatrix(t,i,a){const u=[-1,1,1],p=[1,1,1],g=[1,-1,1],y=[-1,-1,1],w=Nn(u,u,t),b=Nn(p,p,t),A=Nn(g,g,t),I=Nn(y,y,t);return new by(w,b,A,I,i/a)}}class Ey{constructor(t,i){this.points=t,this.planes=i}static fromInvProjectionMatrix(t,i,a,u){const p=Math.pow(2,a),g=[[-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(w=>{const b=Xl([],w,t),A=1/b[3]/i*p;return function(I,M,L){return I[0]=M[0]*L[0],I[1]=M[1]*L[1],I[2]=M[2]*L[2],I[3]=M[3]*L[3],I}(b,b,[A,A,u?1/b[3]:A,A])}),y=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(w=>{const b=Zr([],xy([],Ro([],g[w[0]],g[w[1]]),Ro([],g[w[2]],g[w[1]]))),A=-oo(b,g[w[1]]);return b.concat(A)});return new Ey(g,y)}}class Hr{static fromPoints(t){const i=[1/0,1/0,1/0],a=[-1/0,-1/0,-1/0];for(const u of t)xd(i,i,u),wd(a,a,u);return new Hr(i,a)}static applyTransform(t,i){const a=t.getCorners();for(let u=0;u=0;if(g===0)return 0;g!==i.length&&(a=!1)}if(a)return 2;for(let u=0;u<3;u++){let p=Number.MAX_VALUE,g=-Number.MAX_VALUE;for(let y=0;ythis.max[u]-this.min[u])return 0}return 1}}const Ty=5,hw=6,os=vt/Math.PI/2,xk=16383,Kl=64,Sd=[Kl,32,16],so=-os,ao=os,wk=[new Hr([so,so,so],[ao,ao,ao]),new Hr([so,so,so],[0,0,ao]),new Hr([0,so,so],[ao,0,ao]),new Hr([so,0,so],[0,ao,ao]),new Hr([0,0,so],[ao,ao,ao])];function em(r){return r*os/Id}function dw(r,t,i,a=!0){const u=Bi([],r._camera.position,r.worldSize),p=[t,i,1,1];Xl(p,p,r.pixelMatrixInverse),rw(p,p,1/p[3]);const g=Zr([],Ro([],p,u)),y=r.globeMatrix,w=[y[12],y[13],y[14]],b=Ro([],w,u),A=vd(b),I=Zr([],b),M=r.worldSize/(2*Math.PI),L=oo(I,g),R=Math.asin(M/A);if(R1?null:function(a,u,p,g){const y=Math.sin(p);return a*(Math.sin((1-g)*p)/y)+u*(Math.sin(g*p)/y)}(r.a[t],r.b[t],r.angle,Je(i,0,1))+r.center[t]}function ss(r){if(r.z<=1)return wk[r.z+2*r.y+r.x];const t=Ay(tm(r));return Hr.fromPoints(t)}function Yl(r,t,i){return Bi(r,r,1-i),bd(r,r,t,i)}function pw(r,t){const i=lu(t.zoom);if(i===0)return ss(r);const a=tm(r),u=Ay(a),p=as(a.getWest())*t.worldSize,g=as(a.getEast())*t.worldSize,y=ls(a.getNorth())*t.worldSize,w=ls(a.getSouth())*t.worldSize,b=[p,y,0],A=[g,y,0],I=[p,w,0],M=[g,w,0],L=gy([],t.globeMatrix);return Nn(b,b,L),Nn(A,A,L),Nn(I,I,L),Nn(M,M,L),u[0]=Yl(u[0],I,i),u[1]=Yl(u[1],M,i),u[2]=Yl(u[2],A,i),u[3]=Yl(u[3],b,i),Hr.fromPoints(u)}function fw(r,t,i){for(const a of r)Nn(a,a,t),Bi(a,a,i)}function Ek(r,t,i){const a=t/r.worldSize,u=r.globeMatrix;if(i.z<=1){const Te=ss(i).getCorners();return fw(Te,u,a),Hr.fromPoints(Te)}const p=tm(i),g=Ay(p);fw(g,u,a);const y=Number.MAX_VALUE,w=[-y,-y,-y],b=[y,y,y];if(p.contains(r.center)){for(const Ze of g)xd(b,b,Ze),wd(w,w,Ze);w[2]=0;const Te=r.point,De=[Te.x*a,Te.y*a,0];return xd(b,b,De),wd(w,w,De),new Hr(b,w)}const A=[u[12]*a,u[13]*a,u[14]*a],I=p.getCenter(),M=Je(r.center.lat,-zr,zr),L=Je(I.lat,-zr,zr),R=as(r.center.lng),F=ls(M);let $=R-as(I.lng);const K=F-ls(L);$>.5?$-=1:$<-.5&&($+=1);let se=0;Math.abs($)>Math.abs(K)?se=$>=0?1:3:(se=K>=0?0:2,bd(A,A,[u[4]*a,u[5]*a,u[6]*a],-Math.sin(St(K>=0?p.getSouth():p.getNorth()))*os));const Y=g[se],re=g[(se+1)%4],ue=new bk(Y,re,A),ce=[Sy(ue,0)||Y[0],Sy(ue,1)||Y[1],Sy(ue,2)||Y[2]],Ie=lu(r.zoom);if(Ie>0){const Te=function({x:Ze,y:Me,z:Ue},je,Ge,et,Le){const ot=1/(1<.5?_t=-1:Ct<-.5&&(_t=1),ft=((ft+_t)*je-(et*=je))*Ge+et,st=((st+_t)*je-et)*Ge+et,At=(At*je-(Le*=je))*Ge+Le,tt=(tt*je-Le)*Ge+Le,[[ft,tt,0],[st,tt,0],[st,At,0],[ft,At,0]]}(i,t,r._pixelsPerMercatorPixel,R,F);for(let Ze=0;ZeMath.PI/2*1.01}const yw=St(85),Tk=Math.cos(yw),Sk=Math.sin(yw),Id=63710088e-1,vw=2*Math.PI*Id;class La{constructor(t,i){if(isNaN(t)||isNaN(i))throw new Error(`Invalid LngLat object: (${t}, ${i})`);if(this.lng=+t,this.lat=+i,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new La(xt(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(t){const i=Math.PI/180,a=this.lat*i,u=t.lat*i,p=Math.sin(a)*Math.sin(u)+Math.cos(a)*Math.cos(u)*Math.cos((t.lng-this.lng)*i);return Id*Math.acos(Math.min(p,1))}toBounds(t=0){const i=360*t/40075017,a=i/Math.cos(Math.PI/180*this.lat);return new za(new La(this.lng-a,this.lat-i),new La(this.lng+a,this.lat+i))}toEcef(t){const i=em(t);return au(this.lat,this.lng,os+i)}static convert(t){if(t instanceof La)return t;if(Array.isArray(t)&&(t.length===2||t.length===3))return new La(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&typeof t=="object"&&t!==null)return new La(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: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}var ln=La;function ky(r){return vw*Math.cos(r*Math.PI/180)}function as(r){return(180+r)/360}function ls(r){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360}function Do(r,t){return r/ky(t)}function Fi(r){return 360*r-180}function Pr(r){return 360/Math.PI*Math.atan(Math.exp((180-360*r)*Math.PI/180))-90}function xw(r,t){return r*ky(Pr(t))}const zr=85.051129;function ww(r){return 1/Math.cos(r*Math.PI/180)}class cu{constructor(t,i,a=0){this.x=+t,this.y=+i,this.z=+a}static fromLngLat(t,i=0){const a=ln.convert(t);return new cu(as(a.lng),ls(a.lat),Do(i,a.lat))}toLngLat(){return new ln(Fi(this.x),Pr(this.y))}toAltitude(){return xw(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/vw*ww(Pr(this.y))}}function My(r,t,i,a,u,p,g,y,w){const b=(t+a)/2,A=(i+u)/2,I=new Ve(b,A);y(I),function(M,L,R,F,$,K){const se=R-$,Y=F-K;return Math.abs((F-L)*se-(R-M)*Y)/Math.hypot(se,Y)}(I.x,I.y,p.x,p.y,g.x,g.y)>=w?(My(r,t,i,b,A,p,I,y,w),My(r,b,A,a,u,I,g,y,w)):r.push(g)}function bw(r,t,i){let a=r[0],u=a.x,p=a.y;t(a);const g=[a];for(let y=1;yr.x+1||ar.y+1)&&wn("Geometry exceeds allowed extent, reduce your vector tile buffer size"),r}function Vs(r,t,i){const a=r.loadGeometry(),u=r.extent,p=vt/u;if(t&&i&&i.projection.isReprojectedInTileSpace){const g=1<{const L=Fi((t.x+M.x/u)/g),R=Pr((t.y+M.y/u)/g),F=A.project(L,R);M.x=(F.x*y-w)*u,M.y=(F.y*y-b)*u};for(let M=0;M=u||R.y<0||R.y>=u||(I(R),L.push(R));a[M]=L}}for(const g of a)for(const y of g)Ck(y,p);return a}function Jl(r,t){return{type:r.type,id:r.id,properties:r.properties,geometry:t?Vs(r):[]}}function rm(r,t,i,a,u){r.emplaceBack(2*t+(a+1)/2,2*i+(u+1)/2)}function im(r,t,i){r.emplaceBack(t.x,t.y,t.z,i[0]*16384,i[1]*16384,i[2]*16384)}class Ly{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(i=>i.id),this.index=t.index,this.hasPattern=!1,this.projection=t.projection,this.layoutVertexArray=new We,this.indexArray=new mt,this.segments=new qn,this.programConfigurations=new Wl(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id)}populate(t,i,a,u){const p=this.layers[0],g=[];let y=null;p.type==="circle"&&(y=p.layout.get("circle-sort-key"));for(const{feature:b,id:A,index:I,sourceLayerIndex:M}of t){const L=this.layers[0]._featureFilter.needGeometry,R=Jl(b,L);if(!this.layers[0]._featureFilter.filter(new C(this.zoom),R,a))continue;const F=y?y.evaluate(R,{},a):void 0,$={id:A,properties:b.properties,type:b.type,sourceLayerIndex:M,index:I,geometry:L?R.geometry:Vs(b,a,u),patterns:{},sortKey:F};g.push($)}y&&g.sort((b,A)=>b.sortKey-A.sortKey);let w=null;u.projection.name==="globe"&&(this.globeExtVertexArray=new Xe,w=u.projection);for(const b of g){const{geometry:A,index:I,sourceLayerIndex:M}=b,L=t[I].feature;this.addFeature(b,A,I,i.availableImages,a,w),i.featureIndex.insert(L,A,I,M,this.index)}}update(t,i,a,u){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,i,this.stateDependentLayers,a,u)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,pk.members),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.globeExtVertexArray&&(this.globeExtVertexBuffer=t.createVertexBuffer(this.globeExtVertexArray,fk.members))),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}addFeature(t,i,a,u,p,g){for(const y of i)for(const w of y){const b=w.x,A=w.y;if(b<0||b>=vt||A<0||A>=vt)continue;if(g){const L=g.projectTilePoint(b,A,p),R=g.upVector(p,b,A),F=this.globeExtVertexArray;im(F,L,R),im(F,L,R),im(F,L,R),im(F,L,R)}const I=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),M=I.vertexLength;rm(this.layoutVertexArray,b,A,-1,-1),rm(this.layoutVertexArray,b,A,1,-1),rm(this.layoutVertexArray,b,A,1,1),rm(this.layoutVertexArray,b,A,-1,1),this.indexArray.emplaceBack(M,M+1,M+2),this.indexArray.emplaceBack(M,M+2,M+3),I.vertexLength+=4,I.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,a,{},u,p)}}function Tw(r,t){for(let i=0;i1){if(Ry(r,t))return!0;for(let a=0;a1?i:i.sub(t)._mult(u)._add(t))}function Cw(r,t){let i,a,u,p=!1;for(let g=0;gt.y!=u.y>t.y&&t.x<(u.x-a.x)*(t.y-a.y)/(u.y-a.y)+a.x&&(p=!p)}return p}function Ql(r,t){let i=!1;for(let a=0,u=r.length-1;at.y!=g.y>t.y&&t.x<(g.x-p.x)*(t.y-p.y)/(g.y-p.y)+p.x&&(i=!i)}return i}function Iw(r,t,i,a,u){for(const g of r)if(t<=g.x&&i<=g.y&&a>=g.x&&u>=g.y)return!0;const p=[new Ve(t,i),new Ve(t,u),new Ve(a,u),new Ve(a,i)];if(r.length>2){for(const g of p)if(Ql(r,g))return!0}for(let g=0;gu.x&&t.x>u.x||r.yu.y&&t.y>u.y)return!1;const p=pi(r,t,i[0]);return p!==pi(r,t,i[1])||p!==pi(r,t,i[2])||p!==pi(r,t,i[3])}function uu(r,t,i){const a=t.paint.get(r).value;return a.kind==="constant"?a.value:i.programConfigurations.get(t.id).getMaxValue(r)}function om(r){return Math.sqrt(r[0]*r[0]+r[1]*r[1])}function kw(r,t,i,a,u){if(!t[0]&&!t[1])return r;const p=Ve.convert(t)._mult(u);i==="viewport"&&p._rotate(-a);const g=[];for(let y=0;y0){const Y=i.projection.upVector(b,L.x,L.y);F.x+=Y[0]*A*R,F.y+=Y[1]*A*R,F.z+=Y[2]*A*R}const $=p?L:Rk(F.x,F.y,F.z,a),K=p?r.tilespaceRays.map(Y=>Ok(Y,R)):r.queryGeometry.screenGeometry,se=Xl([],[F.x,F.y,F.z,1],a);if(!g&&p?w*=se[3]/i.cameraToCenterDistance:g&&!p&&(w*=i.cameraToCenterDistance/se[3]),p){const Y=Pr((M.y/vt+b.y)/(1<r.width||u.height>r.height||i.x>r.width-u.width||i.y>r.height-u.height)throw new RangeError("out of range source coordinates for image copy");if(u.width>t.width||u.height>t.height||a.x>t.width-u.width||a.y>t.height-u.height)throw new RangeError("out of range destination coordinates for image copy");const g=r.data,y=t.data;for(let w=0;w{t[r.evaluationKey]=w;const b=r.expression.evaluate(t);u.data[g+y+0]=Math.floor(255*b.r/b.a),u.data[g+y+1]=Math.floor(255*b.g/b.a),u.data[g+y+2]=Math.floor(255*b.b/b.a),u.data[g+y+3]=Math.floor(255*b.a)};if(r.clips)for(let g=0,y=0;g80*i){a=p=r[0],u=g=r[1];for(var R=i;Rp&&(p=y),w>g&&(g=w);b=(b=Math.max(p-a,g-u))!==0?32767/b:0}return kd(M,L,i,a,u,b,0),L}function Ow(r,t,i,a,u){var p,g;if(u===jy(r,t,i,a)>0)for(p=t;p=t;p-=a)g=Nw(p,r[p],r[p+1],g);return g&&am(g,g.next)&&(Pd(g),g=g.next),g}function ec(r,t){if(!r)return r;t||(t=r);var i,a=r;do if(i=!1,a.steiner||!am(a,a.next)&&Wn(a.prev,a,a.next)!==0)a=a.next;else{if(Pd(a),(a=t=a.prev)===a.next)break;i=!0}while(i||a!==t);return t}function kd(r,t,i,a,u,p,g){if(r){!g&&p&&function(A,I,M,L){var R=A;do R.z===0&&(R.z=Ny(R.x,R.y,I,M,L)),R.prevZ=R.prev,R.nextZ=R.next,R=R.next;while(R!==A);R.prevZ.nextZ=null,R.prevZ=null,function(F){var $,K,se,Y,re,ue,ce,Ie,Te=1;do{for(K=F,F=null,re=null,ue=0;K;){for(ue++,se=K,ce=0,$=0;$0||Ie>0&&se;)ce!==0&&(Ie===0||!se||K.z<=se.z)?(Y=K,K=K.nextZ,ce--):(Y=se,se=se.nextZ,Ie--),re?re.nextZ=Y:F=Y,Y.prevZ=re,re=Y;K=se}re.nextZ=null,Te*=2}while(ue>1)}(R)}(r,a,u,p);for(var y,w,b=r;r.prev!==r.next;)if(y=r.prev,w=r.next,p?Vk(r,a,u,p):jk(r))t.push(y.i/i|0),t.push(r.i/i|0),t.push(w.i/i|0),Pd(r),r=w.next,b=w.next;else if((r=w)===b){g?g===1?kd(r=$k(ec(r),t,i),t,i,a,u,p,2):g===2&&Gk(r,t,i,a,u,p):kd(ec(r),t,i,a,u,p,1);break}}}function jk(r){var t=r.prev,i=r,a=r.next;if(Wn(t,i,a)>=0)return!1;for(var u=t.x,p=i.x,g=a.x,y=t.y,w=i.y,b=a.y,A=up?u>g?u:g:p>g?p:g,L=y>w?y>b?y:b:w>b?w:b,R=a.next;R!==t;){if(R.x>=A&&R.x<=M&&R.y>=I&&R.y<=L&&hu(u,y,p,w,g,b,R.x,R.y)&&Wn(R.prev,R,R.next)>=0)return!1;R=R.next}return!0}function Vk(r,t,i,a){var u=r.prev,p=r,g=r.next;if(Wn(u,p,g)>=0)return!1;for(var y=u.x,w=p.x,b=g.x,A=u.y,I=p.y,M=g.y,L=yw?y>b?y:b:w>b?w:b,$=A>I?A>M?A:M:I>M?I:M,K=Ny(L,R,t,i,a),se=Ny(F,$,t,i,a),Y=r.prevZ,re=r.nextZ;Y&&Y.z>=K&&re&&re.z<=se;){if(Y.x>=L&&Y.x<=F&&Y.y>=R&&Y.y<=$&&Y!==u&&Y!==g&&hu(y,A,w,I,b,M,Y.x,Y.y)&&Wn(Y.prev,Y,Y.next)>=0||(Y=Y.prevZ,re.x>=L&&re.x<=F&&re.y>=R&&re.y<=$&&re!==u&&re!==g&&hu(y,A,w,I,b,M,re.x,re.y)&&Wn(re.prev,re,re.next)>=0))return!1;re=re.nextZ}for(;Y&&Y.z>=K;){if(Y.x>=L&&Y.x<=F&&Y.y>=R&&Y.y<=$&&Y!==u&&Y!==g&&hu(y,A,w,I,b,M,Y.x,Y.y)&&Wn(Y.prev,Y,Y.next)>=0)return!1;Y=Y.prevZ}for(;re&&re.z<=se;){if(re.x>=L&&re.x<=F&&re.y>=R&&re.y<=$&&re!==u&&re!==g&&hu(y,A,w,I,b,M,re.x,re.y)&&Wn(re.prev,re,re.next)>=0)return!1;re=re.nextZ}return!0}function $k(r,t,i){var a=r;do{var u=a.prev,p=a.next.next;!am(u,p)&&Bw(u,a,a.next,p)&&Md(u,p)&&Md(p,u)&&(t.push(u.i/i|0),t.push(a.i/i|0),t.push(p.i/i|0),Pd(a),Pd(a.next),a=r=p),a=a.next}while(a!==r);return ec(a)}function Gk(r,t,i,a,u,p){var g=r;do{for(var y=g.next.next;y!==g.prev;){if(g.i!==y.i&&Xk(g,y)){var w=Fw(g,y);return g=ec(g,g.next),w=ec(w,w.next),kd(g,t,i,a,u,p,0),void kd(w,t,i,a,u,p,0)}y=y.next}g=g.next}while(g!==r)}function qk(r,t){return r.x-t.x}function Wk(r,t){var i=function(u,p){var g,y=p,w=u.x,b=u.y,A=-1/0;do{if(b<=y.y&&b>=y.next.y&&y.next.y!==y.y){var I=y.x+(b-y.y)*(y.next.x-y.x)/(y.next.y-y.y);if(I<=w&&I>A&&(A=I,g=y.x=y.x&&y.x>=R&&w!==y.x&&hu(bg.x||y.x===g.x&&Zk(g,y)))&&(g=y,$=M)),y=y.next;while(y!==L);return g}(r,t);if(!i)return t;var a=Fw(i,r);return ec(a,a.next),ec(i,i.next)}function Zk(r,t){return Wn(r.prev,r,t.prev)<0&&Wn(t.next,r,r.next)<0}function Ny(r,t,i,a,u){return(r=1431655765&((r=858993459&((r=252645135&((r=16711935&((r=(r-i)*u|0)|r<<8))|r<<4))|r<<2))|r<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-a)*u|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Hk(r){var t=r,i=r;do(t.x=(r-g)*(p-y)&&(r-g)*(a-y)>=(i-g)*(t-y)&&(i-g)*(p-y)>=(u-g)*(a-y)}function Xk(r,t){return r.next.i!==t.i&&r.prev.i!==t.i&&!function(i,a){var u=i;do{if(u.i!==i.i&&u.next.i!==i.i&&u.i!==a.i&&u.next.i!==a.i&&Bw(u,u.next,i,a))return!0;u=u.next}while(u!==i);return!1}(r,t)&&(Md(r,t)&&Md(t,r)&&function(i,a){var u=i,p=!1,g=(i.x+a.x)/2,y=(i.y+a.y)/2;do u.y>y!=u.next.y>y&&u.next.y!==u.y&&g<(u.next.x-u.x)*(y-u.y)/(u.next.y-u.y)+u.x&&(p=!p),u=u.next;while(u!==i);return p}(r,t)&&(Wn(r.prev,r,t.prev)||Wn(r,t.prev,t))||am(r,t)&&Wn(r.prev,r,r.next)>0&&Wn(t.prev,t,t.next)>0)}function Wn(r,t,i){return(t.y-r.y)*(i.x-t.x)-(t.x-r.x)*(i.y-t.y)}function am(r,t){return r.x===t.x&&r.y===t.y}function Bw(r,t,i,a){var u=cm(Wn(r,t,i)),p=cm(Wn(r,t,a)),g=cm(Wn(i,a,r)),y=cm(Wn(i,a,t));return u!==p&&g!==y||!(u!==0||!lm(r,i,t))||!(p!==0||!lm(r,a,t))||!(g!==0||!lm(i,r,a))||!(y!==0||!lm(i,t,a))}function lm(r,t,i){return t.x<=Math.max(r.x,i.x)&&t.x>=Math.min(r.x,i.x)&&t.y<=Math.max(r.y,i.y)&&t.y>=Math.min(r.y,i.y)}function cm(r){return r>0?1:r<0?-1:0}function Md(r,t){return Wn(r.prev,r,r.next)<0?Wn(r,t,r.next)>=0&&Wn(r,r.prev,t)>=0:Wn(r,t,r.prev)<0||Wn(r,r.next,t)<0}function Fw(r,t){var i=new Uy(r.i,r.x,r.y),a=new Uy(t.i,t.x,t.y),u=r.next,p=t.prev;return r.next=t,t.prev=r,i.next=u,u.prev=i,a.next=i,i.prev=a,p.next=a,a.prev=p,a}function Nw(r,t,i,a){var u=new Uy(r,t,i);return a?(u.next=a.next,u.prev=a,a.next.prev=u,a.next=u):(u.prev=u,u.next=u),u}function Pd(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function Uy(r,t,i){this.i=r,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function jy(r,t,i,a){for(var u=0,p=t,g=i-a;p0&&i.holes.push(a+=r[u-1].length)}return i};var Vy=le(Fy.exports);function Kk(r,t,i,a,u){Uw(r,t,i||0,a||r.length-1,u||Yk)}function Uw(r,t,i,a,u){for(;a>i;){if(a-i>600){var p=a-i+1,g=t-i+1,y=Math.log(p),w=.5*Math.exp(2*y/3),b=.5*Math.sqrt(y*w*(p-w)/p)*(g-p/2<0?-1:1);Uw(r,t,Math.max(i,Math.floor(t-g*w/p+b)),Math.min(a,Math.floor(t+(p-g)*w/p+b)),u)}var A=r[t],I=i,M=a;for(zd(r,i,t),u(r[a],A)>0&&zd(r,i,a);I0;)M--}u(r[i],A)===0?zd(r,i,M):zd(r,++M,a),M<=t&&(i=M+1),t<=M&&(a=M-1)}}function zd(r,t,i){var a=r[t];r[t]=r[i],r[i]=a}function Yk(r,t){return rt?1:0}function $y(r,t){const i=r.length;if(i<=1)return[r];const a=[];let u,p;for(let g=0;g1)for(let g=0;gi.id),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new We,this.indexArray=new mt,this.indexArray2=new fr,this.programConfigurations=new Wl(t.layers,t.zoom),this.segments=new qn,this.segments2=new qn,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id),this.projection=t.projection}populate(t,i,a,u){this.hasPattern=Gy("fill",this.layers,i);const p=this.layers[0].layout.get("fill-sort-key"),g=[];for(const{feature:y,id:w,index:b,sourceLayerIndex:A}of t){const I=this.layers[0]._featureFilter.needGeometry,M=Jl(y,I);if(!this.layers[0]._featureFilter.filter(new C(this.zoom),M,a))continue;const L=p?p.evaluate(M,{},a,i.availableImages):void 0,R={id:w,properties:y.properties,type:y.type,sourceLayerIndex:A,index:b,geometry:I?M.geometry:Vs(y,a,u),patterns:{},sortKey:L};g.push(R)}p&&g.sort((y,w)=>y.sortKey-w.sortKey);for(const y of g){const{geometry:w,index:b,sourceLayerIndex:A}=y;if(this.hasPattern){const I=qy("fill",this.layers,y,this.zoom,i);this.patternFeatures.push(I)}else this.addFeature(y,w,b,a,{},i.availableImages);i.featureIndex.insert(t[b].feature,w,b,A,this.index)}}update(t,i,a,u){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,i,this.stateDependentLayers,a,u)}addFeatures(t,i,a,u,p){for(const g of this.patternFeatures)this.addFeature(g,g.geometry,g.index,i,a,u)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Uk),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,i,a,u,p,g=[]){for(const y of $y(i,500)){let w=0;for(const R of y)w+=R.length;const b=this.segments.prepareSegment(w,this.layoutVertexArray,this.indexArray),A=b.vertexLength,I=[],M=[];for(const R of y){if(R.length===0)continue;R!==y[0]&&M.push(I.length/2);const F=this.segments2.prepareSegment(R.length,this.layoutVertexArray,this.indexArray2),$=F.vertexLength;this.layoutVertexArray.emplaceBack(R[0].x,R[0].y),this.indexArray2.emplaceBack($+R.length-1,$),I.push(R[0].x),I.push(R[0].y);for(let K=1;K>3}if(u--,a===1||a===2)p+=r.readSVarint(),g+=r.readSVarint(),a===1&&(t&&y.push(t),t=[]),t.push(new oM(p,g));else{if(a!==7)throw new Error("unknown command "+a);t&&t.push(t[0].clone())}}return t&&y.push(t),y},du.prototype.bbox=function(){var r=this._pbf;r.pos=this._geometry;for(var t=r.readVarint()+r.pos,i=1,a=0,u=0,p=0,g=1/0,y=-1/0,w=1/0,b=-1/0;r.pos>3}if(a--,i===1||i===2)(u+=r.readSVarint())y&&(y=u),(p+=r.readSVarint())b&&(b=p);else if(i!==7)throw new Error("unknown command "+i)}return[g,w,y,b]},du.prototype.toGeoJSON=function(r,t,i){var a,u,p=this.extent*Math.pow(2,i),g=this.extent*r,y=this.extent*t,w=this.loadGeometry(),b=du.types[this.type];function A(L){for(var R=0;R>3;u=g===1?a.readString():g===2?a.readFloat():g===3?a.readDouble():g===4?a.readVarint64():g===5?a.readVarint():g===6?a.readSVarint():g===7?a.readBoolean():null}return u}(i))}$w.prototype.feature=function(r){if(r<0||r>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[r];var t=this._pbf.readVarint()+this._pbf.pos;return new lM(this._pbf,t,this.extent,this._keys,this._values)};var uM=Vw;function hM(r,t,i){if(r===3){var a=new uM(i,i.readVarint()+i.pos);a.length&&(t[a.name]=a)}}var Wy=hm.VectorTile=function(r,t){this.layers=r.readFields(hM,{},t)},dm=hm.VectorTileFeature=jw;function pm(r,t,i,a){const u=[],p=a===0?(g,y,w,b,A,I)=>{g.push(new Ve(I,w+(I-y)/(b-y)*(A-w)))}:(g,y,w,b,A,I)=>{g.push(new Ve(y+(I-w)/(A-w)*(b-y),I))};for(const g of r){const y=[];for(const w of g){if(w.length<=2)continue;const b=[];for(let M=0;Mt&&p(b,L,R,F,$,t):K>i?se=t&&p(b,L,R,F,$,t),se>i&&K<=i&&p(b,L,R,F,$,i)}let A=w[w.length-1];const I=a===0?A.x:A.y;I>=t&&I<=i&&b.push(A),b.length&&(A=b[b.length-1],b[0].x===A.x&&b[0].y===A.y||b.push(b[0]),y.push(b))}y.length&&u.push(y)}return u}hm.VectorTileLayer=Vw;const dM=dm.types,pM=Math.pow(2,13);function Ld(r,t,i,a,u,p,g,y){r.emplaceBack((t<<1)+g,(i<<1)+p,(Math.floor(a*pM)<<1)+u,Math.round(y))}function Rd(r,t,i){r.emplaceBack(t.x,t.y,t.z,i[0]*16384,i[1]*16384,i[2]*16384)}class Gw{constructor(){this.acc=new Ve(0,0),this.polyCount=[]}startRing(t){this.currentPolyCount={edges:0,top:0},this.polyCount.push(this.currentPolyCount),this.min||(this.min=new Ve(t.x,t.y),this.max=new Ve(t.x,t.y))}append(t,i){this.currentPolyCount.edges++,this.acc._add(t);const a=this.min,u=this.max;t.xu.x&&(u.x=t.x),t.yu.y&&(u.y=t.y),((t.x===0||t.x===vt)&&t.x===i.x)!=((t.y===0||t.y===vt)&&t.y===i.y)&&this.processBorderOverlap(t,i),i.x<0!=t.x<0&&this.addBorderIntersection(0,Wt(i.y,t.y,(0-i.x)/(t.x-i.x))),i.x>vt!=t.x>vt&&this.addBorderIntersection(1,Wt(i.y,t.y,(vt-i.x)/(t.x-i.x))),i.y<0!=t.y<0&&this.addBorderIntersection(2,Wt(i.x,t.x,(0-i.y)/(t.y-i.y))),i.y>vt!=t.y>vt&&this.addBorderIntersection(3,Wt(i.x,t.x,(vt-i.y)/(t.y-i.y)))}addBorderIntersection(t,i){this.borders||(this.borders=[[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE]]);const a=this.borders[t];ia[1]&&(a[1]=i)}processBorderOverlap(t,i){if(t.x===i.x){if(t.y===i.y)return;const a=t.x===0?0:1;this.addBorderIntersection(a,i.y),this.addBorderIntersection(a,t.y)}else{const a=t.y===0?2:3;this.addBorderIntersection(a,i.x),this.addBorderIntersection(a,t.x)}}centroid(){const t=this.polyCount.reduce((i,a)=>i+a.edges,0);return t!==0?this.acc.div(t)._round():new Ve(0,0)}span(){return new Ve(this.max.x-this.min.x,this.max.y-this.min.y)}intersectsCount(){return this.borders.reduce((t,i)=>t+ +(i[0]!==Number.MAX_VALUE),0)}}class Dd{constructor(t){this.zoom=t.zoom,this.canonical=t.canonical,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(i=>i.id),this.index=t.index,this.hasPattern=!1,this.edgeRadius=0,this.projection=t.projection,this.layoutVertexArray=new Fe,this.centroidVertexArray=new Mo,this.indexArray=new mt,this.programConfigurations=new Wl(t.layers,t.zoom),this.segments=new qn,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id),this.enableTerrain=t.enableTerrain}populate(t,i,a,u){this.features=[],this.hasPattern=Gy("fill-extrusion",this.layers,i),this.featuresOnBorder=[],this.borders=[[],[],[],[]],this.borderDoneWithNeighborZ=[-1,-1,-1,-1],this.tileToMeter=function(p){const g=Math.exp(Math.PI*(1-p.y/(1<=0;K--){const se=L[K];(se.length===0||(R=se[0]).every(Y=>Y.x<=0)||R.every(Y=>Y.x>=vt)||R.every(Y=>Y.y<=0)||R.every(Y=>Y.y>=vt))&&L.splice(K,1)}var R;let F;if(A)F=Yw(L,w,u);else{F=[];for(const K of L)F.push({polygon:K,bounds:w})}const $=M?this.edgeRadius:0;for(const{polygon:K,bounds:se}of F){let Y=0,re=0;for(const ce of K)M&&!ce[0].equals(ce[ce.length-1])&&ce.push(ce[0]),re+=M?ce.length-1:ce.length;const ue=this.segments.prepareSegment((M?5:4)*re,this.layoutVertexArray,this.indexArray);if(M){const ce=[],Ie=[];Y=ue.vertexLength;for(const De of K){let Ze,Me;De.length&&De!==K[0]&&Ie.push(ce.length/2),Ze=De[1].sub(De[0])._perp()._unit();for(let Ue=1;Ue4&&Hw(ce[ce.length-2],ce[0],ce[1]),Me=$?fM(ce[ce.length-2],ce[0],ce[1],$):0;Te=ce[1].sub(ce[0])._perp()._unit();let Ue=!0;for(let je=1,Ge=0;je0?1:0,tt=et.dist(Le);if(Ge+tt>32768&&(Ge=0),$){De=ot.sub(Le)._perp()._unit();let It=Ww(et,Le,ot,qw(Te,De),$);isNaN(It)&&(It=0);const bt=Le.sub(et)._unit();et=et.add(bt.mult(Me))._round(),Le=Le.add(bt.mult(-It))._round(),Me=It,Te=De}const _t=ue.vertexLength,Ct=ce.length>4&&Hw(et,Le,ot);let Ht=Xw(Ge,Ze,Ue);if(Ld(this.layoutVertexArray,et.x,et.y,st,At,0,0,Ht),Ld(this.layoutVertexArray,et.x,et.y,st,At,0,1,Ht),Ge+=tt,Ht=Xw(Ge,Ct,!Ue),Ze=Ct,Ld(this.layoutVertexArray,Le.x,Le.y,st,At,0,0,Ht),Ld(this.layoutVertexArray,Le.x,Le.y,st,At,0,1,Ht),ue.vertexLength+=4,this.indexArray.emplaceBack(_t+0,_t+1,_t+2),this.indexArray.emplaceBack(_t+1,_t+3,_t+2),ue.primitiveLength+=2,$){const It=Y+(je===1?ce.length-2:je-2),bt=je===1?Y:It+1;if(this.indexArray.emplaceBack(_t+1,It,_t+3),this.indexArray.emplaceBack(It,bt,_t+3),ue.primitiveLength+=2,Ie===void 0&&(Ie=_t),!Zw(ot,ce[je],se)){const bn=je===ce.length-1?Ie:ue.vertexLength;this.indexArray.emplaceBack(_t+2,_t+3,bn),this.indexArray.emplaceBack(_t+3,bn+1,bn),this.indexArray.emplaceBack(_t+3,bt,bn+1),ue.primitiveLength+=3}Ue=!Ue}if(A){const It=this.layoutVertexExtArray,bt=b.projectTilePoint(et.x,et.y,u),bn=b.projectTilePoint(Le.x,Le.y,u),zt=b.upVector(u,et.x,et.y),Lt=b.upVector(u,Le.x,Le.y);Rd(It,bt,zt),Rd(It,bt,zt),Rd(It,bn,Lt),Rd(It,bn,Lt)}}M&&(Y+=ce.length-1)}}if(I&&I.polyCount.length>0){if(I.borders){I.vertexArrayOffset=this.centroidVertexArray.length;const K=I.borders,se=this.featuresOnBorder.push(I)-1;for(let Y=0;Y<4;Y++)K[Y][0]!==Number.MAX_VALUE&&this.borders[Y].push(se)}this.encodeCentroid(I.borders?void 0:I.centroid(),I)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,a,p,g,u)}sortBorders(){for(let t=0;t<4;t++)this.borders[t].sort((i,a)=>this.featuresOnBorder[i].borders[t][0]-this.featuresOnBorder[a].borders[t][0])}encodeCentroid(t,i,a=!0){let u,p;if(t)if(t.y!==0){const y=i.span()._mult(this.tileToMeter);u=(Math.max(t.x,1)<<3)+Math.min(7,Math.round(y.x/10)),p=(Math.max(t.y,1)<<3)+Math.min(7,Math.round(y.y/10))}else u=Math.ceil(7*(t.x+450)),p=0;else u=0,p=+a;let g=a?this.centroidVertexArray.length:i.vertexArrayOffset;for(const y of i.polyCount){a&&this.centroidVertexArray.resize(this.centroidVertexArray.length+4*y.edges+y.top);for(let w=0;wi[1].x&&t.x>i[1].x||r.yi[1].y&&t.y>i[1].y}function Hw(r,t,i){if(r.x<0||r.x>=vt||t.x<0||t.x>=vt||i.x<0||i.x>=vt)return!1;const a=i.sub(t),u=a.perp(),p=r.sub(t);return(a.x*p.x+a.y*p.y)/Math.sqrt((a.x*a.x+a.y*a.y)*(p.x*p.x+p.y*p.y))>-.866&&u.x*p.x+u.y*p.y<0}function Xw(r,t,i){const a=t?2|r:-3&r;return i?1|a:-2&a}function Kw(){const r=Math.PI/32,t=Math.tan(r),i=Id;return i*Math.sqrt(1+2*t*t)-i}function Yw(r,t,i){const a=1<{for(const Te of ce)R.push({polygon:Te,bounds:Ie})},$=Math.ceil(Math.log2(A)),K=Math.ceil(Math.log2(I)),se=$-K,Y=[];for(let ce=0;ce0?0:1);for(let ce=0;ceIe+1?ue.push({polygons:Ge,bounds:Le,depth:Ie+1}):F(Ge,Le)}if(et.length){const Le=[new Ve(Te===0?je:De.x,Te===1?je:De.y),Ze];Y.length>Ie+1?ue.push({polygons:et,bounds:Le,depth:Ie+1}):F(et,Le)}}return R}(r,t,Math.ceil((p-u)/11.25),Math.ceil((g-y)/11.25),1,(w,b,A)=>{if(w===0)return .5*(b+A);{const I=Pr((i.y+b/vt)/a);return(ls(.5*(Pr((i.y+A/vt)/a)+I))*a-i.y)*vt}})}dt(Dd,"FillExtrusionBucket",{omit:["layers","features"]}),dt(Gw,"PartMetadata");const mM=new ee({"fill-extrusion-edge-radius":new B(Re["layout_fill-extrusion"]["fill-extrusion-edge-radius"])});var gM={paint:new ee({"fill-extrusion-opacity":new B(Re["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new q(Re["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new B(Re["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new B(Re["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new q(Re["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new q(Re["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new q(Re["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new B(Re["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]),"fill-extrusion-ambient-occlusion-intensity":new B(Re["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-intensity"]),"fill-extrusion-ambient-occlusion-radius":new B(Re["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-radius"]),"fill-extrusion-rounded-roof":new B(Re["paint_fill-extrusion"]["fill-extrusion-rounded-roof"])}),layout:mM};function Jw(r,t,i){var a=2*Math.PI*6378137/256/Math.pow(2,i);return[r*a-2*Math.PI*6378137/2,t*a-2*Math.PI*6378137/2]}class fm{constructor(t,i,a){this.z=t,this.x=i,this.y=a,this.key=Od(0,t,t,i,a)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,i){const a=function(p,g,y){var w=Jw(256*p,256*(g=Math.pow(2,y)-g-1),y),b=Jw(256*(p+1),256*(g+1),y);return w[0]+","+w[1]+","+b[0]+","+b[1]}(this.x,this.y,this.z),u=function(p,g,y){let w,b="";for(let A=p;A>0;A--)w=1<this.canonical.z?new Xr(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Xr(t,this.wrap,t,this.canonical.x>>i,this.canonical.y>>i)}calculateScaledKey(t,i=!0){if(this.overscaledZ===t&&i)return this.key;if(t>this.canonical.z)return Od(this.wrap*+i,t,this.canonical.z,this.canonical.x,this.canonical.y);{const a=this.canonical.z-t;return Od(this.wrap*+i,t,t,this.canonical.x>>a,this.canonical.y>>a)}}isChildOf(t){if(t.wrap!==this.wrap)return!1;const i=this.canonical.z-t.canonical.z;return t.overscaledZ===0||t.overscaledZ>i&&t.canonical.y===this.canonical.y>>i}children(t){if(this.overscaledZ>=t)return[new Xr(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const i=this.canonical.z+1,a=2*this.canonical.x,u=2*this.canonical.y;return[new Xr(i,this.wrap,i,a,u),new Xr(i,this.wrap,i,a+1,u),new Xr(i,this.wrap,i,a,u+1),new Xr(i,this.wrap,i,a+1,u+1)]}isLessThan(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.yi.id),this.index=t.index,this.projection=t.projection,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(i=>{this.gradients[i.id]={}}),this.layoutVertexArray=new ke,this.layoutVertexArray2=new qe,this.indexArray=new mt,this.programConfigurations=new Wl(t.layers,t.zoom),this.segments=new qn,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id)}populate(t,i,a,u){this.hasPattern=Gy("line",this.layers,i);const p=this.layers[0].layout.get("line-sort-key"),g=[];for(const{feature:A,id:I,index:M,sourceLayerIndex:L}of t){const R=this.layers[0]._featureFilter.needGeometry,F=Jl(A,R);if(!this.layers[0]._featureFilter.filter(new C(this.zoom),F,a))continue;const $=p?p.evaluate(F,{},a):void 0,K={id:I,properties:A.properties,type:A.type,sourceLayerIndex:L,index:M,geometry:R?F.geometry:Vs(A,a,u),patterns:{},sortKey:$};g.push(K)}p&&g.sort((A,I)=>A.sortKey-I.sortKey);const{lineAtlas:y,featureIndex:w}=i,b=this.addConstantDashes(y);for(const A of g){const{geometry:I,index:M,sourceLayerIndex:L}=A;if(b&&this.addFeatureDashes(A,y),this.hasPattern){const R=qy("line",this.layers,A,this.zoom,i);this.patternFeatures.push(R)}else this.addFeature(A,I,M,a,y.positions,i.availableImages);w.insert(t[M].feature,I,M,L,this.index)}}addConstantDashes(t){let i=!1;for(const a of this.layers){const u=a.paint.get("line-dasharray").value,p=a.layout.get("line-cap").value;if(u.kind!=="constant"||p.kind!=="constant")i=!0;else{const g=p.value,y=u.value;if(!y)continue;t.addDash(y,g)}}return i}addFeatureDashes(t,i){const a=this.zoom;for(const u of this.layers){const p=u.paint.get("line-dasharray").value,g=u.layout.get("line-cap").value;if(p.kind==="constant"&&g.kind==="constant")continue;let y,w;if(p.kind==="constant"){if(y=p.value,!y)continue}else y=p.evaluate({zoom:a},t);w=g.kind==="constant"?g.value:g.evaluate({zoom:a},t),i.addDash(y,w),t.patterns[u.id]=i.getKey(y,w)}}update(t,i,a,u){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,i,this.stateDependentLayers,a,u)}addFeatures(t,i,a,u,p){for(const g of this.patternFeatures)this.addFeature(g,g.geometry,g.index,i,a,u)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,xM)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,yM),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&&t.properties.hasOwnProperty("mapbox_clip_start")&&t.properties.hasOwnProperty("mapbox_clip_end"))return{start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}}addFeature(t,i,a,u,p,g){const y=this.layers[0].layout,w=y.get("line-join").evaluate(t,{}),b=y.get("line-cap").evaluate(t,{}),A=y.get("line-miter-limit"),I=y.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(const M of i)this.addLine(M,t,w,b,A,I);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,a,p,g,u)}addLine(t,i,a,u,p,g){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineSoFar=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let K=0;K=2&&t[w-1].equals(t[w-2]);)w--;let b=0;for(;b0;if(Ie&&K>b){const Me=M.dist(L);if(Me>2*A){const Ue=M.sub(M.sub(L)._mult(A/Me)._round());this.updateDistance(L,Ue),this.addCurrentVertex(Ue,F,0,0,I),L=Ue}}const De=L&&R;let Ze=De?a:y?"butt":u;if(De&&Ze==="round"&&(uep&&(Ze="bevel"),Ze==="bevel"&&(ue>2&&(Ze="flipbevel"),ue100)se=$.mult(-1);else{const Me=ue*F.add($).mag()/F.sub($).mag();se._perp()._mult(Me*(Te?-1:1))}this.addCurrentVertex(M,se,0,0,I),this.addCurrentVertex(M,se.mult(-1),0,0,I)}else if(Ze==="bevel"||Ze==="fakeround"){const Me=-Math.sqrt(ue*ue-1),Ue=Te?Me:0,je=Te?0:Me;if(L&&this.addCurrentVertex(M,F,Ue,je,I),Ze==="fakeround"){const Ge=Math.round(180*ce/Math.PI/20);for(let et=1;et2*A){const Ue=M.add(R.sub(M)._mult(A/Me)._round());this.updateDistance(M,Ue),this.addCurrentVertex(Ue,$,0,0,I),M=Ue}}}}addCurrentVertex(t,i,a,u,p,g=!1){const y=i.y*u-i.x,w=-i.y-i.x*u;this.addHalfVertex(t,i.x+i.y*a,i.y-i.x*a,g,!1,a,p),this.addHalfVertex(t,y,w,g,!0,-u,p)}addHalfVertex({x:t,y:i},a,u,p,g,y,w){this.layoutVertexArray.emplaceBack((t<<1)+(p?1:0),(i<<1)+(g?1:0),Math.round(63*a)+128,Math.round(63*u)+128,1+(y===0?0:y<0?-1:1),0,this.lineSoFar),this.lineClips&&this.layoutVertexArray2.emplaceBack(this.scaledDistance,this.lineClipsArray.length,this.lineClips.start,this.lineClips.end);const b=w.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,b),w.primitiveLength++),g?this.e2=b:this.e1=b}updateScaledDistance(){if(this.lineClips){const t=this.totalDistance/(this.lineClips.end-this.lineClips.start);this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=t*this.lineClips.start+this.distance}else this.lineSoFar=this.distance}updateDistance(t,i){this.distance+=t.dist(i),this.updateScaledDistance()}}dt(mm,"LineBucket",{omit:["layers","patternFeatures"]});const EM=new ee({"line-cap":new q(Re.layout_line["line-cap"]),"line-join":new q(Re.layout_line["line-join"]),"line-miter-limit":new B(Re.layout_line["line-miter-limit"]),"line-round-limit":new B(Re.layout_line["line-round-limit"]),"line-sort-key":new q(Re.layout_line["line-sort-key"])});var nb={paint:new ee({"line-opacity":new q(Re.paint_line["line-opacity"]),"line-color":new q(Re.paint_line["line-color"]),"line-translate":new B(Re.paint_line["line-translate"]),"line-translate-anchor":new B(Re.paint_line["line-translate-anchor"]),"line-width":new q(Re.paint_line["line-width"]),"line-gap-width":new q(Re.paint_line["line-gap-width"]),"line-offset":new q(Re.paint_line["line-offset"]),"line-blur":new q(Re.paint_line["line-blur"]),"line-dasharray":new q(Re.paint_line["line-dasharray"]),"line-pattern":new q(Re.paint_line["line-pattern"]),"line-gradient":new Q(Re.paint_line["line-gradient"]),"line-trim-offset":new B(Re.paint_line["line-trim-offset"])}),layout:EM};const rb=new class extends q{possiblyEvaluate(r,t){return t=new C(Math.floor(t.zoom),{now:t.now,fadeDuration:t.fadeDuration,transition:t.transition}),super.possiblyEvaluate(r,t)}evaluate(r,t,i,a){return t=vn({},t,{zoom:Math.floor(t.zoom)}),super.evaluate(r,t,i,a)}}(nb.paint.properties["line-width"].specification);function ib(r,t){return t>0?t+2*r:r}rb.useIntegerZoom=!0;const TM=ye([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_tex_size",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),SM=ye([{name:"a_globe_anchor",components:3,type:"Int16"},{name:"a_globe_normal",components:3,type:"Float32"}],4),AM=ye([{name:"a_projected_pos",components:4,type:"Float32"}],4);ye([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const CM=ye([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]),IM=ye([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"}]);ye([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"tileAnchorX"},{type:"Int16",name:"tileAnchorY"},{type:"Float32",name:"x1"},{type:"Float32",name:"y1"},{type:"Float32",name:"x2"},{type:"Float32",name:"y2"},{type:"Int16",name:"padding"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const ob=ye([{name:"a_pos",components:3,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),kM=ye([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);ye([{name:"triangle",components:3,type:"Uint16"}]),ye([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{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"},{type:"Uint8",name:"flipState"}]),ye([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{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",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),ye([{type:"Float32",name:"offsetX"}]),ye([{type:"Int16",name:"x"},{type:"Int16",name:"y"}]);var Tr=24;const Oo=128;function Zy(r,t){const{expression:i}=t;if(i.kind==="constant")return{kind:"constant",layoutSize:i.evaluate(new C(r+1))};if(i.kind==="source")return{kind:"source"};{const{zoomStops:a,interpolationType:u}=i;let p=0;for(;p{a.text=function(u,p,g){const y=p.layout.get("text-transform").evaluate(g,{});return y==="uppercase"?u=u.toLocaleUpperCase():y==="lowercase"&&(u=u.toLocaleLowerCase()),S.applyArabicShaping&&(u=S.applyArabicShaping(u)),u}(a.text,t,i)}),r}const Fd={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂","←":"↑","→":"↓"};function zM(r){return r==="︶"||r==="﹈"||r==="︸"||r==="﹄"||r==="﹂"||r==="︾"||r==="︼"||r==="︺"||r==="︘"||r==="﹀"||r==="︐"||r==="︓"||r==="︔"||r==="`"||r===" ̄"||r==="︑"||r==="︒"}function LM(r){return r==="︵"||r==="﹇"||r==="︷"||r==="﹃"||r==="﹁"||r==="︽"||r==="︻"||r==="︹"||r==="︗"||r==="︿"}var sb=pn,ab=function(r,t,i,a,u){var p,g,y=8*u-a-1,w=(1<>1,A=-7,I=i?u-1:0,M=i?-1:1,L=r[t+I];for(I+=M,p=L&(1<<-A)-1,L>>=-A,A+=y;A>0;p=256*p+r[t+I],I+=M,A-=8);for(g=p&(1<<-A)-1,p>>=-A,A+=a;A>0;g=256*g+r[t+I],I+=M,A-=8);if(p===0)p=1-b;else{if(p===w)return g?NaN:1/0*(L?-1:1);g+=Math.pow(2,a),p-=b}return(L?-1:1)*g*Math.pow(2,p-a)},lb=function(r,t,i,a,u,p){var g,y,w,b=8*p-u-1,A=(1<>1,M=u===23?Math.pow(2,-24)-Math.pow(2,-77):0,L=a?0:p-1,R=a?1:-1,F=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(y=isNaN(t)?1:0,g=A):(g=Math.floor(Math.log(t)/Math.LN2),t*(w=Math.pow(2,-g))<1&&(g--,w*=2),(t+=g+I>=1?M/w:M*Math.pow(2,1-I))*w>=2&&(g++,w/=2),g+I>=A?(y=0,g=A):g+I>=1?(y=(t*w-1)*Math.pow(2,u),g+=I):(y=t*Math.pow(2,I-1)*Math.pow(2,u),g=0));u>=8;r[i+L]=255&y,L+=R,y/=256,u-=8);for(g=g<0;r[i+L]=255&g,L+=R,g/=256,b-=8);r[i+L-R]|=128*F};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */function pn(r){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(r)?r:new Uint8Array(r||0),this.pos=0,this.type=0,this.length=this.buf.length}pn.Varint=0,pn.Fixed64=1,pn.Bytes=2,pn.Fixed32=5;var Hy=4294967296,cb=1/Hy,ub=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function Gs(r){return r.type===pn.Bytes?r.readVarint()+r.pos:r.pos+1}function mu(r,t,i){return i?4294967296*t+(r>>>0):4294967296*(t>>>0)+(r>>>0)}function hb(r,t,i){var a=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));i.realloc(a);for(var u=i.pos-1;u>=r;u--)i.buf[u+a]=i.buf[u]}function RM(r,t){for(var i=0;i>>8,r[i+2]=t>>>16,r[i+3]=t>>>24}function db(r,t){return(r[t]|r[t+1]<<8|r[t+2]<<16)+(r[t+3]<<24)}pn.prototype={destroy:function(){this.buf=null},readFields:function(r,t,i){for(i=i||this.length;this.pos>3,p=this.pos;this.type=7&a,r(u,t,this),this.pos===p&&this.skip(a)}return t},readMessage:function(r,t){return this.readFields(r,t,this.readVarint()+this.pos)},readFixed32:function(){var r=_m(this.buf,this.pos);return this.pos+=4,r},readSFixed32:function(){var r=db(this.buf,this.pos);return this.pos+=4,r},readFixed64:function(){var r=_m(this.buf,this.pos)+_m(this.buf,this.pos+4)*Hy;return this.pos+=8,r},readSFixed64:function(){var r=_m(this.buf,this.pos)+db(this.buf,this.pos+4)*Hy;return this.pos+=8,r},readFloat:function(){var r=ab(this.buf,this.pos,!0,23,4);return this.pos+=4,r},readDouble:function(){var r=ab(this.buf,this.pos,!0,52,8);return this.pos+=8,r},readVarint:function(r){var t,i,a=this.buf;return t=127&(i=a[this.pos++]),i<128?t:(t|=(127&(i=a[this.pos++]))<<7,i<128?t:(t|=(127&(i=a[this.pos++]))<<14,i<128?t:(t|=(127&(i=a[this.pos++]))<<21,i<128?t:function(u,p,g){var y,w,b=g.buf;if(y=(112&(w=b[g.pos++]))>>4,w<128||(y|=(127&(w=b[g.pos++]))<<3,w<128)||(y|=(127&(w=b[g.pos++]))<<10,w<128)||(y|=(127&(w=b[g.pos++]))<<17,w<128)||(y|=(127&(w=b[g.pos++]))<<24,w<128)||(y|=(1&(w=b[g.pos++]))<<31,w<128))return mu(u,y,p);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(i=a[this.pos]))<<28,r,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var r=this.readVarint();return r%2==1?(r+1)/-2:r/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var r=this.readVarint()+this.pos,t=this.pos;return this.pos=r,r-t>=12&&ub?function(i,a,u){return ub.decode(i.subarray(a,u))}(this.buf,t,r):function(i,a,u){for(var p="",g=a;g239?4:A>223?3:A>191?2:1;if(g+M>u)break;M===1?A<128&&(I=A):M===2?(192&(y=i[g+1]))==128&&(I=(31&A)<<6|63&y)<=127&&(I=null):M===3?(w=i[g+2],(192&(y=i[g+1]))==128&&(192&w)==128&&((I=(15&A)<<12|(63&y)<<6|63&w)<=2047||I>=55296&&I<=57343)&&(I=null)):M===4&&(w=i[g+2],b=i[g+3],(192&(y=i[g+1]))==128&&(192&w)==128&&(192&b)==128&&((I=(15&A)<<18|(63&y)<<12|(63&w)<<6|63&b)<=65535||I>=1114112)&&(I=null)),I===null?(I=65533,M=1):I>65535&&(I-=65536,p+=String.fromCharCode(I>>>10&1023|55296),I=56320|1023&I),p+=String.fromCharCode(I),g+=M}return p}(this.buf,t,r)},readBytes:function(){var r=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,r);return this.pos=r,t},readPackedVarint:function(r,t){if(this.type!==pn.Bytes)return r.push(this.readVarint(t));var i=Gs(this);for(r=r||[];this.pos127;);else if(t===pn.Bytes)this.pos=this.readVarint()+this.pos;else if(t===pn.Fixed32)this.pos+=4;else{if(t!==pn.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(r,t){this.writeVarint(r<<3|t)},realloc:function(r){for(var t=this.length||16;t268435455||r<0?function(t,i){var a,u;if(t>=0?(a=t%4294967296|0,u=t/4294967296|0):(u=~(-t/4294967296),4294967295^(a=~(-t%4294967296))?a=a+1|0:(a=0,u=u+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");i.realloc(10),function(p,g,y){y.buf[y.pos++]=127&p|128,p>>>=7,y.buf[y.pos++]=127&p|128,p>>>=7,y.buf[y.pos++]=127&p|128,p>>>=7,y.buf[y.pos++]=127&p|128,y.buf[y.pos]=127&(p>>>=7)}(a,0,i),function(p,g){var y=(7&p)<<4;g.buf[g.pos++]|=y|((p>>>=3)?128:0),p&&(g.buf[g.pos++]=127&p|((p>>>=7)?128:0),p&&(g.buf[g.pos++]=127&p|((p>>>=7)?128:0),p&&(g.buf[g.pos++]=127&p|((p>>>=7)?128:0),p&&(g.buf[g.pos++]=127&p|((p>>>=7)?128:0),p&&(g.buf[g.pos++]=127&p)))))}(u,i)}(r,this):(this.realloc(4),this.buf[this.pos++]=127&r|(r>127?128:0),r<=127||(this.buf[this.pos++]=127&(r>>>=7)|(r>127?128:0),r<=127||(this.buf[this.pos++]=127&(r>>>=7)|(r>127?128:0),r<=127||(this.buf[this.pos++]=r>>>7&127))))},writeSVarint:function(r){this.writeVarint(r<0?2*-r-1:2*r)},writeBoolean:function(r){this.writeVarint(!!r)},writeString:function(r){r=String(r),this.realloc(4*r.length),this.pos++;var t=this.pos;this.pos=function(a,u,p){for(var g,y,w=0;w55295&&g<57344){if(!y){g>56319||w+1===u.length?(a[p++]=239,a[p++]=191,a[p++]=189):y=g;continue}if(g<56320){a[p++]=239,a[p++]=191,a[p++]=189,y=g;continue}g=y-55296<<10|g-56320|65536,y=null}else y&&(a[p++]=239,a[p++]=191,a[p++]=189,y=null);g<128?a[p++]=g:(g<2048?a[p++]=g>>6|192:(g<65536?a[p++]=g>>12|224:(a[p++]=g>>18|240,a[p++]=g>>12&63|128),a[p++]=g>>6&63|128),a[p++]=63&g|128)}return p}(this.buf,r,this.pos);var i=this.pos-t;i>=128&&hb(t,i,this),this.pos=t-1,this.writeVarint(i),this.pos+=i},writeFloat:function(r){this.realloc(4),lb(this.buf,r,this.pos,!0,23,4),this.pos+=4},writeDouble:function(r){this.realloc(8),lb(this.buf,r,this.pos,!0,52,8),this.pos+=8},writeBytes:function(r){var t=r.length;this.writeVarint(t),this.realloc(t);for(var i=0;i=128&&hb(i,a,this),this.pos=i-1,this.writeVarint(a),this.pos+=a},writeMessage:function(r,t,i){this.writeTag(r,pn.Bytes),this.writeRawMessage(t,i)},writePackedVarint:function(r,t){t.length&&this.writeMessage(r,RM,t)},writePackedSVarint:function(r,t){t.length&&this.writeMessage(r,DM,t)},writePackedBoolean:function(r,t){t.length&&this.writeMessage(r,FM,t)},writePackedFloat:function(r,t){t.length&&this.writeMessage(r,OM,t)},writePackedDouble:function(r,t){t.length&&this.writeMessage(r,BM,t)},writePackedFixed32:function(r,t){t.length&&this.writeMessage(r,NM,t)},writePackedSFixed32:function(r,t){t.length&&this.writeMessage(r,UM,t)},writePackedFixed64:function(r,t){t.length&&this.writeMessage(r,jM,t)},writePackedSFixed64:function(r,t){t.length&&this.writeMessage(r,VM,t)},writeBytesField:function(r,t){this.writeTag(r,pn.Bytes),this.writeBytes(t)},writeFixed32Field:function(r,t){this.writeTag(r,pn.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(r,t){this.writeTag(r,pn.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(r,t){this.writeTag(r,pn.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(r,t){this.writeTag(r,pn.Fixed64),this.writeSFixed64(t)},writeVarintField:function(r,t){this.writeTag(r,pn.Varint),this.writeVarint(t)},writeSVarintField:function(r,t){this.writeTag(r,pn.Varint),this.writeSVarint(t)},writeStringField:function(r,t){this.writeTag(r,pn.Bytes),this.writeString(t)},writeFloatField:function(r,t){this.writeTag(r,pn.Fixed32),this.writeFloat(t)},writeDoubleField:function(r,t){this.writeTag(r,pn.Fixed64),this.writeDouble(t)},writeBooleanField:function(r,t){this.writeVarintField(r,!!t)}};var ym=le(sb);const Xy=3;function $M(r,t,i){t.glyphs=[],r===1&&i.readMessage(GM,t)}function GM(r,t,i){if(r===3){const{id:a,bitmap:u,width:p,height:g,left:y,top:w,advance:b}=i.readMessage(qM,{});t.glyphs.push({id:a,bitmap:new $s({width:p+2*Xy,height:g+2*Xy},u),metrics:{width:p,height:g,left:y,top:w,advance:b}})}else r===4?t.ascender=i.readSVarint():r===5&&(t.descender=i.readSVarint())}function qM(r,t,i){r===1?t.id=i.readVarint():r===2?t.bitmap=i.readBytes():r===3?t.width=i.readVarint():r===4?t.height=i.readVarint():r===5?t.left=i.readSVarint():r===6?t.top=i.readSVarint():r===7&&(t.advance=i.readVarint())}const pb=Xy;function Ky(r){let t=0,i=0;for(const g of r)t+=g.w*g.h,i=Math.max(i,g.w);r.sort((g,y)=>y.h-g.h);const a=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),i),h:1/0}];let u=0,p=0;for(const g of r)for(let y=a.length-1;y>=0;y--){const w=a[y];if(!(g.w>w.w||g.h>w.h)){if(g.x=w.x,g.y=w.y,p=Math.max(p,g.y+g.h),u=Math.max(u,g.x+g.w),g.w===w.w&&g.h===w.h){const b=a.pop();yt.hasImage(a)),t.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const a in t.updatedImages)this.patchUpdatedImage(this.iconPositions[a],t.getImage(a),i),this.patchUpdatedImage(this.patternPositions[a],t.getImage(a),i)}patchUpdatedImage(t,i,a){if(!t||!i||t.version===i.version)return;t.version=i.version;const[u,p]=t.tl;a.update(i.data,void 0,{x:u,y:p})}}dt(Yy,"ImagePosition"),dt(fb,"ImageAtlas");const Ni={horizontal:1,vertical:2,horizontalOnly:3},mb=-17;class Nd{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(t,i){const a=new Nd;return a.scale=t||1,a.fontStack=i,a}static forImage(t){const i=new Nd;return i.imageName=t,i}}class _u{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(t,i){const a=new _u;for(let u=0;u=0&&a>=t&&vm[this.text.charCodeAt(a)];a--)i--;this.text=this.text.substring(t,i),this.sectionIndex=this.sectionIndex.slice(t,i)}substring(t,i){const a=new _u;return a.text=this.text.substring(t,i),a.sectionIndex=this.sectionIndex.slice(t,i),a.sections=this.sections,a}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((t,i)=>Math.max(t,this.sections[i].scale),0)}addTextSection(t,i){this.text+=t.text,this.sections.push(Nd.forText(t.scale,t.fontStack||i));const a=this.sections.length-1;for(let u=0;u=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Jy(r,t,i,a,u,p,g,y,w,b,A,I,M,L,R){const F=_u.fromFeature(r,u);I===Ni.vertical&&F.verticalizePunctuation(M);let $=[];const K=function(ce,Ie,Te,De,Ze,Me){if(!ce)return[];const Ue=[],je=function(ot,ft,st,At,tt,_t){let Ct=0;for(let Ht=0;Ht=0;let et=0;for(let ot=0;ot0&&No>un&&(un=No)}else{const Yr=Te[nr.fontStack];if(!Yr)continue;Yr[Mn]&&(gn=Yr[Mn]);const gr=Ie[nr.fontStack];if(!gr)continue;const No=gr.glyphs[Mn];if(!No)continue;if(Xn=No.metrics,Kn=Mn!==8203?Tr:0,_t){const Tu=gr.ascender!==void 0?Math.abs(gr.ascender):0,Xd=gr.descender!==void 0?Math.abs(gr.descender):0,Kd=(Tu+Xd)*Kt;kn-i/2;){if(g--,g<0)return!1;y-=r[g].dist(p),p=r[g]}y+=r[g].dist(r[g+1]),g++;const w=[];let b=0;for(;ya;)b-=w.shift().angleDelta;if(b>u)return!1;g++,y+=A.dist(I)}return!0}function Eb(r){let t=0;for(let i=0;ib){const R=(b-w)/L,F=Wt(I.x,M.x,R),$=Wt(I.y,M.y,R),K=new qs(F,$,0,M.angleTo(I),A);return!g||bb(r,K,y,g,t)?K:void 0}w+=L}}function KM(r,t,i,a,u,p,g,y,w){const b=Tb(a,p,g),A=Sb(a,u),I=A*g,M=r[0].x===0||r[0].x===w||r[0].y===0||r[0].y===w;return t-I=0&&re=0&&ue=0&&M+b<=A){const ce=new qs(re,ue,0,se,R);ce._round(),a&&!bb(r,ce,p,a,u)||L.push(ce)}}I+=K}return y||L.length||g||(L=Ab(r,I/2,i,a,u,p,g,!0,w)),L}function Cb(r,t,i,a,u){const p=[];for(let g=0;g=a&&I.x>=a||(A.x>=a?A=new Ve(a,A.y+(a-A.x)/(I.x-A.x)*(I.y-A.y))._round():I.x>=a&&(I=new Ve(a,A.y+(a-A.x)/(I.x-A.x)*(I.y-A.y))._round()),A.y>=u&&I.y>=u||(A.y>=u?A=new Ve(A.x+(u-A.y)/(I.y-A.y)*(I.x-A.x),u)._round():I.y>=u&&(I=new Ve(A.x+(u-A.y)/(I.y-A.y)*(I.x-A.x),u)._round()),w&&A.equals(w[w.length-1])||(w=[A],p.push(w)),w.push(I)))))}}return p}dt(qs,"Anchor");const Ud=1e20;function Ib(r,t,i,a,u,p,g,y,w){for(let b=t;b-1);w++,p[w]=y,g[w]=b,g[w+1]=Ud}for(let y=0,w=0;y{let y=this.entries[u];y||(y=this.entries[u]={glyphs:{},requests:{},ranges:{},ascender:void 0,descender:void 0});let w=y.glyphs[p];if(w!==void 0)return void g(null,{stack:u,id:p,glyph:w});if(w=this._tinySDF(y,u,p),w)return y.glyphs[p]=w,void g(null,{stack:u,id:p,glyph:w});const b=Math.floor(p/256);if(256*b>65535)return void g(new Error("glyphs > 65535 not supported"));if(y.ranges[b])return void g(null,{stack:u,id:p,glyph:w});let A=y.requests[b];A||(A=y.requests[b]=[],yu.loadGlyphRange(u,b,this.url,this.requestManager,(I,M)=>{if(M){y.ascender=M.ascender,y.descender=M.descender;for(const L in M.glyphs)this._doesCharSupportLocalGlyph(+L)||(y.glyphs[+L]=M.glyphs[+L]);y.ranges[b]=!0}for(const L of A)L(I,M);delete y.requests[b]})),A.push((I,M)=>{I?g(I):M&&g(null,{stack:u,id:p,glyph:M.glyphs[p]||null})})},(u,p)=>{if(u)i(u);else if(p){const g={};for(const{stack:y,id:w,glyph:b}of p)g[y]===void 0&&(g[y]={}),g[y].glyphs===void 0&&(g[y].glyphs={}),g[y].glyphs[w]=b&&{id:b.id,bitmap:b.bitmap.clone(),metrics:b.metrics},g[y].ascender=this.entries[y].ascender,g[y].descender=this.entries[y].descender;i(null,g)}})}_doesCharSupportLocalGlyph(t){return this.localGlyphMode!==e0.none&&(this.localGlyphMode===e0.all?!!this.localFontFamily:!!this.localFontFamily&&(at["CJK Unified Ideographs"](t)||at["Hangul Syllables"](t)||at.Hiragana(t)||at.Katakana(t)||at["CJK Symbols and Punctuation"](t)))}_tinySDF(t,i,a){const u=this.localFontFamily;if(!u||!this._doesCharSupportLocalGlyph(a))return;let p=t.tinySDF;if(!p){let F="400";/bold/i.test(i)?F="900":/medium/i.test(i)?F="500":/light/i.test(i)&&(F="200"),p=t.tinySDF=new yu.TinySDF({fontFamily:u,fontWeight:F,fontSize:24*Bo,buffer:3*Bo,radius:8*Bo}),p.fontWeight=F}if(this.localGlyphs[p.fontWeight][a])return this.localGlyphs[p.fontWeight][a];const g=String.fromCharCode(a),{data:y,width:w,height:b,glyphWidth:A,glyphHeight:I,glyphLeft:M,glyphTop:L,glyphAdvance:R}=p.draw(g);return this.localGlyphs[p.fontWeight][a]={id:a,bitmap:new $s({width:w,height:b},y),metrics:{width:A/Bo,height:I/Bo,left:M/Bo,top:L/Bo-27,advance:R/Bo,localGlyph:!0}}}}yu.loadGlyphRange=function(r,t,i,a,u){const p=256*t,g=p+255,y=a.transformRequest(a.normalizeGlyphsURL(i).replace("{fontstack}",r).replace("{range}",`${p}-${g}`),Ss.Glyphs);ua(y,(w,b)=>{if(w)u(w);else if(b){const A={},I=function(M){return new ym(M).readFields($M,{})}(b);for(const M of I.glyphs)A[M.id]=M;u(null,{glyphs:A,ascender:I.ascender,descender:I.descender})}})},yu.TinySDF=class{constructor({fontSize:r=24,buffer:t=3,radius:i=8,cutoff:a=.25,fontFamily:u="sans-serif",fontWeight:p="normal",fontStyle:g="normal"}={}){this.buffer=t,this.cutoff=a,this.radius=i;const y=this.size=r+4*t,w=this._createCanvas(y),b=this.ctx=w.getContext("2d",{willReadFrequently:!0});b.font=`${g} ${p} ${r}px ${u}`,b.textBaseline="alphabetic",b.textAlign="left",b.fillStyle="black",this.gridOuter=new Float64Array(y*y),this.gridInner=new Float64Array(y*y),this.f=new Float64Array(y),this.z=new Float64Array(y+1),this.v=new Uint16Array(y)}_createCanvas(r){const t=document.createElement("canvas");return t.width=t.height=r,t}draw(r){const{width:t,actualBoundingBoxAscent:i,actualBoundingBoxDescent:a,actualBoundingBoxLeft:u,actualBoundingBoxRight:p}=this.ctx.measureText(r),g=Math.ceil(i),y=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(p-u))),w=Math.min(this.size-this.buffer,g+Math.ceil(a)),b=y+2*this.buffer,A=w+2*this.buffer,I=Math.max(b*A,0),M=new Uint8ClampedArray(I),L={data:M,width:b,height:A,glyphWidth:y,glyphHeight:w,glyphTop:g,glyphLeft:0,glyphAdvance:t};if(y===0||w===0)return L;const{ctx:R,buffer:F,gridInner:$,gridOuter:K}=this;R.clearRect(F,F,y,w),R.fillText(r,F,F+g);const se=R.getImageData(F,F,y,w);K.fill(Ud,0,I),$.fill(0,0,I);for(let Y=0;Y0?Ie*Ie:0,$[ce]=Ie<0?Ie*Ie:0}}Ib(K,0,0,b,A,b,this.f,this.v,this.z),Ib($,F,F,y,w,b,this.f,this.v,this.z);for(let Y=0;YMe+Ue[1]-Ue[0],R=I.reduce(L,0),F=M.reduce(L,0),$=y-R,K=w-F;let se=0,Y=R,re=0,ue=F,ce=0,Ie=$,Te=0,De=K;if(p.content&&a){const Me=p.content;se=xm(I,0,Me[0]),re=xm(M,0,Me[1]),Y=xm(I,Me[0],Me[2]),ue=xm(M,Me[1],Me[3]),ce=Me[0]-se,Te=Me[1]-re,Ie=Me[2]-Me[0]-Y,De=Me[3]-Me[1]-ue}const Ze=(Me,Ue,je,Ge)=>{const et=wm(Me.stretch-se,Y,b,r.left),Le=bm(Me.fixed-ce,Ie,Me.stretch,R),ot=wm(Ue.stretch-re,ue,A,r.top),ft=bm(Ue.fixed-Te,De,Ue.stretch,F),st=wm(je.stretch-se,Y,b,r.left),At=bm(je.fixed-ce,Ie,je.stretch,R),tt=wm(Ge.stretch-re,ue,A,r.top),_t=bm(Ge.fixed-Te,De,Ge.stretch,F),Ct=new Ve(et,ot),Ht=new Ve(st,ot),It=new Ve(st,tt),bt=new Ve(et,tt),bn=new Ve(Le/g,ft/g),zt=new Ve(At/g,_t/g),Lt=t*Math.PI/180;if(Lt){const mn=Math.sin(Lt),un=Math.cos(Lt),kn=[un,-mn,mn,un];Ct._matMult(kn),Ht._matMult(kn),bt._matMult(kn),It._matMult(kn)}const cn=Me.stretch+Me.fixed,fn=Ue.stretch+Ue.fixed;return{tl:Ct,tr:Ht,bl:bt,br:It,tex:{x:p.paddedRect.x+vu+cn,y:p.paddedRect.y+vu+fn,w:je.stretch+je.fixed-cn,h:Ge.stretch+Ge.fixed-fn},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:bn,pixelOffsetBR:zt,minFontScaleX:Ie/g/b,minFontScaleY:De/g/A,isSDF:i}};if(a&&(p.stretchX||p.stretchY)){const Me=Pb(I,$,R),Ue=Pb(M,K,F);for(let je=0;je0)for(let a=(this.length>>1)-1;a>=0;a--)this._down(a)}push(t){this.data.push(t),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const t=this.data[0],i=this.data.pop();return this.length--,this.length>0&&(this.data[0]=i,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:i,compare:a}=this,u=i[t];for(;t>0;){const p=t-1>>1,g=i[p];if(a(u,g)>=0)break;i[t]=g,t=p}i[t]=u}_down(t){const{data:i,compare:a}=this,u=this.length>>1,p=i[t];for(;t=0)break;i[t]=y,t=g}i[t]=p}}function QM(r,t){return rt?1:0}function eP(r,t=1,i=!1){let a=1/0,u=1/0,p=-1/0,g=-1/0;const y=r[0];for(let L=0;Lp)&&(p=R.x),(!L||R.y>g)&&(g=R.y)}const w=Math.min(p-a,g-u);let b=w/2;const A=new JM([],tP);if(w===0)return new Ve(a,u);for(let L=a;LI.d||!I.d)&&(I=L,i&&console.log("found best %d after %d probes",Math.round(1e4*L.d)/1e4,M)),L.max-I.d<=t||(b=L.h/2,A.push(new xu(L.p.x-b,L.p.y-b,b,r)),A.push(new xu(L.p.x+b,L.p.y-b,b,r)),A.push(new xu(L.p.x-b,L.p.y+b,b,r)),A.push(new xu(L.p.x+b,L.p.y+b,b,r)),M+=4)}return i&&(console.log(`num probes: ${M}`),console.log(`best distance: ${I.d}`)),I.p}function tP(r,t){return t.max-r.max}class xu{constructor(t,i,a,u){this.p=new Ve(t,i),this.h=a,this.d=function(p,g){let y=!1,w=1/0;for(let b=0;bp.y!=F.y>p.y&&p.x<(F.x-R.x)*(p.y-R.y)/(F.y-R.y)+R.x&&(y=!y),w=Math.min(w,Aw(p,R,F))}}return(y?1:-1)*Math.sqrt(w)}(this.p,u),this.max=this.d+this.h*Math.SQRT2}}const wu=7,t0=Number.POSITIVE_INFINITY,nP=Math.sqrt(2);function zb(r,[t,i]){let a=0,u=0;if(i===t0){t<0&&(t=0);const p=t/nP;switch(r){case"top-right":case"top-left":u=p-wu;break;case"bottom-right":case"bottom-left":u=-p+wu;break;case"bottom":u=-t+wu;break;case"top":u=t-wu}switch(r){case"top-right":case"bottom-right":a=-p;break;case"top-left":case"bottom-left":a=p;break;case"left":a=t;break;case"right":a=-t}}else{switch(t=Math.abs(t),i=Math.abs(i),r){case"top-right":case"top-left":case"top":u=i-wu;break;case"bottom-right":case"bottom-left":case"bottom":u=-i+wu}switch(r){case"top-right":case"bottom-right":case"right":a=-t;break;case"top-left":case"bottom-left":case"left":a=t}}return[a,u]}function rP(r,t,i,a,u,p,g,y,w,b){r.createArrays(),r.tilePixelRatio=vt/(512*r.overscaling),r.compareText={},r.iconsNeedLinear=!1;const A=r.layers[0].layout,I=r.layers[0]._unevaluatedLayout._values,M={};if(r.textSizeData.kind==="composite"){const{minZoom:F,maxZoom:$}=r.textSizeData;M.compositeTextSizes=[I["text-size"].possiblyEvaluate(new C(F),y),I["text-size"].possiblyEvaluate(new C($),y)]}if(r.iconSizeData.kind==="composite"){const{minZoom:F,maxZoom:$}=r.iconSizeData;M.compositeIconSizes=[I["icon-size"].possiblyEvaluate(new C(F),y),I["icon-size"].possiblyEvaluate(new C($),y)]}M.layoutTextSize=I["text-size"].possiblyEvaluate(new C(w+1),y),M.layoutIconSize=I["icon-size"].possiblyEvaluate(new C(w+1),y),M.textMaxSize=I["text-size"].possiblyEvaluate(new C(18),y);const L=A.get("text-rotation-alignment")==="map"&&A.get("symbol-placement")!=="point",R=A.get("text-size");for(const F of r.features){const $=A.get("text-font").evaluate(F,{},y).join(","),K=R.evaluate(F,{},y),se=M.layoutTextSize.evaluate(F,{},y),Y=(M.layoutIconSize.evaluate(F,{},y),{horizontal:{},vertical:void 0}),re=F.text;let ue,ce=[0,0];if(re){const De=re.toString(),Ze=A.get("text-letter-spacing").evaluate(F,{},y)*Tr,Me=A.get("text-line-height").evaluate(F,{},y)*Tr,Ue=uy(De)?Ze:0,je=A.get("text-anchor").evaluate(F,{},y),Ge=A.get("text-variable-anchor");if(!Ge){const st=A.get("text-radial-offset").evaluate(F,{},y);ce=st?zb(je,[st*Tr,t0]):A.get("text-offset").evaluate(F,{},y).map(At=>At*Tr)}let et=L?"center":A.get("text-justify").evaluate(F,{},y);const Le=A.get("symbol-placement")==="point",ot=Le?A.get("text-max-width").evaluate(F,{},y)*Tr:1/0,ft=st=>{r.allowVerticalPlacement&&hd(De)&&(Y.vertical=Jy(re,t,i,u,$,ot,Me,je,st,Ue,ce,Ni.vertical,!0,se,K))};if(!L&&Ge){const st=et==="auto"?Ge.map(tt=>n0(tt)):[et];let At=!1;for(let tt=0;tt=0||!hd(De)){const st=Jy(re,t,i,u,$,ot,Me,je,et,Ue,ce,Ni.horizontal,!1,se,K);st&&(Y.horizontal[et]=st)}ft(Le?"left":et)}}let Ie=!1;if(F.icon&&F.icon.name){const De=a[F.icon.name];De&&(ue=HM(u[F.icon.name],A.get("icon-offset").evaluate(F,{},y),A.get("icon-anchor").evaluate(F,{},y)),Ie=De.sdf,r.sdfIcons===void 0?r.sdfIcons=De.sdf:r.sdfIcons!==De.sdf&&wn("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(De.pixelRatio!==r.pixelRatio||A.get("icon-rotate").constantOr(1)!==0)&&(r.iconsNeedLinear=!0))}const Te=Rb(Y.horizontal)||Y.vertical;r.iconsInText||(r.iconsInText=!!Te&&Te.iconsInText),(Te||ue)&&iP(r,F,Y,ue,a,M,se,0,ce,Ie,g,y,b)}p&&r.generateCollisionDebugBuffers(w,r.collisionBoxArray)}function n0(r){switch(r){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function iP(r,t,i,a,u,p,g,y,w,b,A,I,M){let L=p.textMaxSize.evaluate(t,{},I);L===void 0&&(L=g);const R=r.layers[0].layout,F=R.get("icon-offset").evaluate(t,{},I),$=Rb(i.horizontal)||i.vertical,K=M.name==="globe",se=Tr,Y=g/se,re=r.tilePixelRatio*L/se,ue=(je=r.overscaling,r.zoom>18&&je>2&&(je>>=1),Math.max(vt/(512*je),1)*R.get("symbol-spacing")),ce=R.get("text-padding")*r.tilePixelRatio,Ie=R.get("icon-padding")*r.tilePixelRatio,Te=St(R.get("text-max-angle")),De=R.get("text-rotation-alignment")==="map"&&R.get("symbol-placement")!=="point",Ze=R.get("icon-rotation-alignment")==="map"&&R.get("symbol-placement")!=="point",Me=R.get("symbol-placement"),Ue=ue/2;var je;const Ge=R.get("icon-text-fit");let et;a&&Ge!=="none"&&(r.allowVerticalPlacement&&i.vertical&&(et=wb(a,i.vertical,Ge,R.get("icon-text-fit-padding"),F,Y)),$&&(a=wb(a,$,Ge,R.get("icon-text-fit-padding"),F,Y)));const Le=(ot,ft,st)=>{if(ft.x<0||ft.x>=vt||ft.y<0||ft.y>=vt)return;let At=null;if(K){const{x:tt,y:_t,z:Ct}=M.projectTilePoint(ft.x,ft.y,st);At={anchor:new qs(tt,_t,Ct,0,void 0),up:M.upVector(st,ft.x,ft.y)}}(function(tt,_t,Ct,Ht,It,bt,bn,zt,Lt,cn,fn,mn,un,kn,Rn,Zn,hn,nr,Hn,Mn,Kt,Xn,gn,Kr,Kn){const Sr=tt.addToLineVertexArray(_t,Ht);let mr,Yr,gr,No,Tu,Xd,Kd,p2=0,f2=0,m2=0,g2=0,_0=-1,y0=-1;const ds={};let _2=py("");const rc=Ct?Ct.anchor:_t;let v0=0,x0=0;if(Lt._unevaluatedLayout.getValue("text-radial-offset")===void 0?[v0,x0]=Lt.layout.get("text-offset").evaluate(Kt,{},Kn).map(bi=>bi*Tr):(v0=Lt.layout.get("text-radial-offset").evaluate(Kt,{},Kn)*Tr,x0=t0),tt.allowVerticalPlacement&&It.vertical){const bi=It.vertical;if(Rn)Xd=r0(bi),zt&&(Kd=r0(zt));else{const Ei=Lt.layout.get("text-rotate").evaluate(Kt,{},Kn)+90;gr=Em(cn,rc,_t,fn,mn,un,bi,kn,Ei,Zn),zt&&(No=Em(cn,rc,_t,fn,mn,un,zt,nr,Ei))}}if(bt){const bi=Lt.layout.get("icon-rotate").evaluate(Kt,{},Kn),Ei=Lt.layout.get("icon-text-fit")!=="none",Yd=Mb(bt,bi,gn,Ei),b0=zt?Mb(zt,bi,gn,Ei):void 0;Yr=Em(cn,rc,_t,fn,mn,un,bt,nr,bi),p2=4*Yd.length;const y2=tt.iconSizeData;let ic=null;y2.kind==="source"?(ic=[Oo*Lt.layout.get("icon-size").evaluate(Kt,{},Kn)],ic[0]>Ra&&wn(`${tt.layerIds[0]}: Value for "icon-size" is >= ${jd}. Reduce your "icon-size".`)):y2.kind==="composite"&&(ic=[Oo*Xn.compositeIconSizes[0].evaluate(Kt,{},Kn),Oo*Xn.compositeIconSizes[1].evaluate(Kt,{},Kn)],(ic[0]>Ra||ic[1]>Ra)&&wn(`${tt.layerIds[0]}: Value for "icon-size" is >= ${jd}. Reduce your "icon-size".`)),tt.addSymbols(tt.icon,Yd,ic,Mn,Hn,Kt,!1,Ct,_t,Sr.lineStartIndex,Sr.lineLength,-1,Kr,Kn),_0=tt.icon.placedSymbolArray.length-1,b0&&(f2=4*b0.length,tt.addSymbols(tt.icon,b0,ic,Mn,Hn,Kt,Ni.vertical,Ct,_t,Sr.lineStartIndex,Sr.lineLength,-1,Kr,Kn),y0=tt.icon.placedSymbolArray.length-1)}for(const bi in It.horizontal){const Ei=It.horizontal[bi];mr||(_2=py(Ei.text),Rn?Tu=r0(Ei):mr=Em(cn,rc,_t,fn,mn,un,Ei,kn,Lt.layout.get("text-rotate").evaluate(Kt,{},Kn),Zn));const Yd=Ei.positionedLines.length===1;if(m2+=Lb(tt,Ct,_t,Ei,bn,Lt,Rn,Kt,Zn,Sr,It.vertical?Ni.horizontal:Ni.horizontalOnly,Yd?Object.keys(It.horizontal):[bi],ds,_0,Xn,Kr,Kn),Yd)break}It.vertical&&(g2+=Lb(tt,Ct,_t,It.vertical,bn,Lt,Rn,Kt,Zn,Sr,Ni.vertical,["vertical"],ds,y0,Xn,Kr,Kn));let Ua=-1;const w0=(bi,Ei)=>bi?Math.max(bi,Ei):Ei;Ua=w0(Tu,Ua),Ua=w0(Xd,Ua),Ua=w0(Kd,Ua);const zP=Ua>-1?1:0;tt.glyphOffsetArray.length>=Oa.MAX_GLYPHS&&wn("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Kt.sortKey!==void 0&&tt.addToSortKeyRanges(tt.symbolInstances.length,Kt.sortKey),tt.symbolInstances.emplaceBack(rc.x,rc.y,rc.z,_t.x,_t.y,ds.right>=0?ds.right:-1,ds.center>=0?ds.center:-1,ds.left>=0?ds.left:-1,ds.vertical>=0?ds.vertical:-1,_0,y0,_2,mr!==void 0?mr:tt.collisionBoxArray.length,mr!==void 0?mr+1:tt.collisionBoxArray.length,gr!==void 0?gr:tt.collisionBoxArray.length,gr!==void 0?gr+1:tt.collisionBoxArray.length,Yr!==void 0?Yr:tt.collisionBoxArray.length,Yr!==void 0?Yr+1:tt.collisionBoxArray.length,No||tt.collisionBoxArray.length,No?No+1:tt.collisionBoxArray.length,fn,m2,g2,p2,f2,zP,0,v0,x0,Ua)})(r,ft,At,ot,i,a,u,et,r.layers[0],r.collisionBoxArray,t.index,t.sourceLayerIndex,r.index,ce,De,w,0,Ie,Ze,F,t,p,b,A,I)};if(Me==="line")for(const ot of Cb(t.geometry,0,0,vt,vt)){const ft=KM(ot,ue,Te,i.vertical||$,a,se,re,r.overscaling,vt);for(const st of ft)$&&oP(r,$.text,Ue,st)||Le(ot,st,I)}else if(Me==="line-center"){for(const ot of t.geometry)if(ot.length>1){const ft=XM(ot,Te,i.vertical||$,a,se,re);ft&&Le(ot,ft,I)}}else if(t.type==="Polygon")for(const ot of $y(t.geometry,0)){const ft=eP(ot,16);Le(ot[0],new qs(ft.x,ft.y,0,0,void 0),I)}else if(t.type==="LineString")for(const ot of t.geometry)Le(ot,new qs(ot[0].x,ot[0].y,0,0,void 0),I);else if(t.type==="Point")for(const ot of t.geometry)for(const ft of ot)Le([ft],new qs(ft.x,ft.y,0,0,void 0),I)}const jd=255,Ra=jd*Oo;function Lb(r,t,i,a,u,p,g,y,w,b,A,I,M,L,R,F,$){const K=function(re,ue,ce,Ie,Te,De,Ze,Me){const Ue=[];if(ue.positionedLines.length===0)return Ue;const je=Ie.layout.get("text-rotate").evaluate(De,{})*Math.PI/180,Ge=function(st){const At=st[0],tt=st[1],_t=At*tt;return _t>0?[At,-tt]:_t<0?[-At,tt]:At===0?[tt,At]:[tt,-At]}(ce);let et=Math.abs(ue.top-ue.bottom);for(const st of ue.positionedLines)et-=st.lineOffset;const Le=ue.positionedLines.length,ot=et/Le;let ft=ue.top-ce[1];for(let st=0;stRa&&wn(`${r.layerIds[0]}: Value for "text-size" is >= ${jd}. Reduce your "text-size".`)):se.kind==="composite"&&(Y=[Oo*R.compositeTextSizes[0].evaluate(y,{},$),Oo*R.compositeTextSizes[1].evaluate(y,{},$)],(Y[0]>Ra||Y[1]>Ra)&&wn(`${r.layerIds[0]}: Value for "text-size" is >= ${jd}. Reduce your "text-size".`)),r.addSymbols(r.text,K,Y,w,g,y,A,t,i,b.lineStartIndex,b.lineLength,L,F,$);for(const re of I)M[re]=r.text.placedSymbolArray.length-1;return 4*K.length}function Rb(r){for(const t in r)return r[t];return null}function Em(r,t,i,a,u,p,g,y,w,b){let A=g.top,I=g.bottom,M=g.left,L=g.right;const R=g.collisionPadding;if(R&&(M-=R[0],A-=R[1],L+=R[2],I+=R[3]),w){const F=new Ve(M,A),$=new Ve(L,A),K=new Ve(M,I),se=new Ve(L,I),Y=St(w);let re=new Ve(0,0);b&&(re=new Ve(b[0],b[1])),F._rotateAround(Y,re),$._rotateAround(Y,re),K._rotateAround(Y,re),se._rotateAround(Y,re),M=Math.min(F.x,$.x,K.x,se.x),L=Math.max(F.x,$.x,K.x,se.x),A=Math.min(F.y,$.y,K.y,se.y),I=Math.max(F.y,$.y,K.y,se.y)}return r.emplaceBack(t.x,t.y,t.z,i.x,i.y,M,A,L,I,y,a,u,p),r.length-1}function r0(r){r.collisionPadding&&(r.top-=r.collisionPadding[1],r.bottom+=r.collisionPadding[3]);const t=r.bottom-r.top;return t>0?Math.max(10,t):null}function oP(r,t,i,a){const u=r.compareText;if(t in u){const p=u[t];for(let g=p.length-1;g>=0;g--)if(a.dist(p[g])Y&&(re(ce,Ge,Te,De,Ue,je),re(Ge,Ie,Ue,je,Ze,Me))}re(I,M,a,p,u,p),re(M,L,u,p,u,g),re(L,R,u,g,a,g),re(R,I,a,g,a,p),F-=Y,$-=Y,K+=Y,se+=Y;const ue=1/Math.max(K-F,se-$);return{scale:ue,x:F*ue,y:$*ue,x2:K*ue,y2:se*ue,projection:t}}const sP=Lo(new Float32Array(16));class Da{constructor(t){this.spec=t,this.name=t.name,this.wrap=!1,this.requiresDraping=!1,this.supportsWorldCopies=!1,this.supportsTerrain=!1,this.supportsFog=!1,this.supportsFreeCamera=!1,this.zAxisUnit="meters",this.isReprojectedInTileSpace=!0,this.unsupportedLayers=["custom"],this.center=[0,0],this.range=[3.5,7]}project(t,i){return{x:0,y:0,z:0}}unproject(t,i){return new ln(0,0)}projectTilePoint(t,i,a){return{x:t,y:i,z:0}}locationPoint(t,i,a=!0){return t._coordinatePoint(t.locationCoordinate(i),a)}pixelsPerMeter(t,i){return Do(1,t)*i}pixelSpaceConversion(t,i,a){return 1}farthestPixelDistance(t){return Db(t,t.pixelsPerMeter)}pointCoordinate(t,i,a,u){const p=t.horizonLineFromTop(!1),g=new Ve(i,Math.max(p,a));return t.rayIntersectionCoordinate(t.pointRayIntersection(g,u))}pointCoordinate3D(t,i,a){const u=new Ve(i,a);if(t.elevation)return t.elevation.pointCoordinate(u);{const p=this.pointCoordinate(t,u.x,u.y,0);return[p.x,p.y,p.z]}}isPointAboveHorizon(t,i){if(t.elevation)return!this.pointCoordinate3D(t,i.x,i.y);const a=t.horizonLineFromTop();return i.y0?i<-bu+a&&(i=-bu+a):i>bu-a&&(i=bu-a);const g=p/Math.pow(Sm(i),u);let y=g*Math.sin(u*t),w=p-g*Math.cos(u*t);return y=.5*(y/Math.PI+.5),w=.5*(w/Math.PI+.5),{x:y,y:this.southernCenter?w:1-w,z:0}}unproject(t,i){t=(2*t-.5)*Math.PI,this.southernCenter&&(i=1-i),i=(2*(1-i)-.5)*Math.PI;const{n:a,f:u}=this,p=u-i,g=Math.sign(p),y=Math.sign(a)*Math.sqrt(t*t+p*p);let w=Math.atan2(t,Math.abs(p))*g;p*a<0&&(w-=Math.PI*Math.sign(t)*g);const b=Je(Vt(w/a)+this.center[0],-180,180),A=Je(Vt(2*Math.atan(Math.pow(u/y,1/a))-bu),-zr,zr);return new ln(b,this.southernCenter?-A:A)}}class Ob extends Da{constructor(t){super(t),this.wrap=!0,this.supportsWorldCopies=!0,this.supportsTerrain=!0,this.supportsFog=!0,this.supportsFreeCamera=!0,this.isReprojectedInTileSpace=!1,this.unsupportedLayers=[],this.range=null}project(t,i){return{x:as(t),y:ls(i),z:0}}unproject(t,i){const a=Fi(t),u=Pr(i);return new ln(a,u)}}const Bb=St(zr);class hP extends Da{project(t,i){const a=(i=St(i))*i,u=a*a;return{x:.5*((t=St(t))*(.8707-.131979*a+u*(u*(.003971*a-.001529*u)-.013791))/Math.PI+.5),y:1-.5*(i*(1.007226+a*(.015085+u*(.028874*a-.044475-.005916*u)))/Math.PI+1),z:0}}unproject(t,i){t=(2*t-.5)*Math.PI;let a=i=(2*(1-i)-1)*Math.PI,u=25,p=0,g=a*a;do{g=a*a;const b=g*g;p=(a*(1.007226+g*(.015085+b*(.028874*g-.044475-.005916*b)))-i)/(1.007226+g*(.045255+b*(.259866*g-.311325-.005916*11*b))),a=Je(a-p,-Bb,Bb)}while(Math.abs(p)>1e-6&&--u>0);g=a*a;const y=Je(Vt(t/(.8707+g*(g*(g*g*g*(.003971-.001529*g)-.013791)-.131979))),-180,180),w=Vt(a);return new ln(y,w)}}const Fb=St(zr);class dP extends Da{project(t,i){i=St(i),t=St(t);const a=Math.cos(i),u=2/Math.PI,p=Math.acos(a*Math.cos(t/2)),g=Math.sin(p)/p,y=.5*(t*u+2*a*Math.sin(t/2)/g)||0,w=.5*(i+Math.sin(i)/g)||0;return{x:.5*(y/Math.PI+.5),y:1-.5*(w/Math.PI+1),z:0}}unproject(t,i){let a=t=(2*t-.5)*Math.PI,u=i=(2*(1-i)-1)*Math.PI,p=25;const g=1e-6;let y=0,w=0;do{const b=Math.cos(u),A=Math.sin(u),I=2*A*b,M=A*A,L=b*b,R=Math.cos(a/2),F=Math.sin(a/2),$=2*R*F,K=F*F,se=1-L*R*R,Y=se?1/se:0,re=se?Math.acos(b*R)*Math.sqrt(1/se):0,ue=.5*(2*re*b*F+2*a/Math.PI)-t,ce=.5*(re*A+u)-i,Ie=.5*Y*(L*K+re*b*R*M)+1/Math.PI,Te=Y*($*I/4-re*A*F),De=.125*Y*(I*F-re*A*L*$),Ze=.5*Y*(M*R+re*K*b)+.5,Me=Te*De-Ze*Ie;y=(ce*Te-ue*Ze)/Me,w=(ue*De-ce*Ie)/Me,a=Je(a-y,-Math.PI,Math.PI),u=Je(u-w,-Fb,Fb)}while((Math.abs(y)>g||Math.abs(w)>g)&&--p>0);return new ln(Vt(a),Vt(u))}}class Nb extends Da{constructor(t){super(t),this.center=t.center||[0,0],this.parallels=t.parallels||[0,0],this.cosPhi=Math.max(.01,Math.cos(St(this.parallels[0]))),this.scale=1/(2*Math.max(Math.PI*this.cosPhi,1/this.cosPhi)),this.wrap=!0,this.supportsWorldCopies=!0}project(t,i){const{scale:a,cosPhi:u}=this;return{x:St(t)*u*a+.5,y:-Math.sin(St(i))/u*a+.5,z:0}}unproject(t,i){const{scale:a,cosPhi:u}=this,p=-(i-.5)/a,g=Je(Vt((t-.5)/a)/u,-180,180),y=Math.asin(Je(p*u,-1,1)),w=Je(Vt(y),-zr,zr);return new ln(g,w)}}class pP extends Ob{constructor(t){super(t),this.requiresDraping=!0,this.supportsWorldCopies=!1,this.supportsFog=!0,this.zAxisUnit="pixels",this.unsupportedLayers=["debug"],this.range=[3,5]}projectTilePoint(t,i,a){const u=Ad(t,i,a);return Nn(u,u,Cd(ss(a))),{x:u[0],y:u[1],z:u[2]}}locationPoint(t,i){const a=au(i.lat,i.lng),u=Zr([],a),p=t.elevation?t.elevation.getAtPointOrZero(t.locationCoordinate(i),t._centerAltitude):t._centerAltitude;bd(a,a,u,Do(1,0)*vt*p);const g=Lo(new Float64Array(16));return Zl(g,t.pixelMatrix,t.globeMatrix),Nn(a,a,g),new Ve(a[0],a[1])}pixelsPerMeter(t,i){return Do(1,0)*i}pixelSpaceConversion(t,i,a){const u=Do(1,t)*i,p=Wt(Do(1,45)*i,u,a);return this.pixelsPerMeter(t,i)/p}createTileMatrix(t,i,a){const u=Cy(ss(a.canonical));return Zl(new Float64Array(16),t.globeMatrix,u)}createInversionMatrix(t,i){const{center:a}=t,u=Cd(ss(i));return Qf(u,u,St(a.lng)),_y(u,u,St(a.lat)),Hl(u,u,[t._pixelsPerMercatorPixel,t._pixelsPerMercatorPixel,1]),Float32Array.from(u)}pointCoordinate(t,i,a,u){return dw(t,i,a,!0)||new cu(0,0)}pointCoordinate3D(t,i,a){const u=this.pointCoordinate(t,i,a,0);return[u.x,u.y,u.z]}isPointAboveHorizon(t,i){return!dw(t,i.x,i.y,!1)}farthestPixelDistance(t){const i=function(u,p){const g=u.cameraToCenterDistance,y=u._centerAltitude*p,w=u._camera,b=u._camera.forward(),A=js([],Bi([],b,-g),[0,0,y]),I=u.worldSize/(2*Math.PI),M=[0,0,-I],L=u.width/u.height,R=Math.tan(u.fovAboveCenter),F=Bi([],w.up(),R),$=Bi([],w.right(),R*L),K=Zr([],js([],js([],b,F),$)),se=[];let Y;if(new wy(A,K).closestPointOnSphere(M,I,se)){const re=js([],se,M),ue=Ro([],re,A);Y=Math.cos(u.fovAboveCenter)*vd(ue)}else{const re=Ro([],A,M),ue=Ro([],M,A);Zr(ue,ue);const ce=vd(re)-I;Y=Math.sqrt(ce*(ce+2*I));const Ie=Math.acos(Y/(I+ce))-Math.acos(oo(b,ue));Y*=Math.cos(Ie)}return 1.01*Y}(t,this.pixelsPerMeter(t.center.lat,t.worldSize)),a=lu(t.zoom);if(a>0){const u=Db(t,Do(1,t.center.lat)*t.worldSize),p=t.worldSize/(2*Math.PI),g=Math.max(t.width,t.height)/t.worldSize*Math.PI;return Wt(i,u+p*(1-Math.cos(g)),Math.pow(a,10))}return i}upVector(t,i,a){return Ad(i,a,t,1)}upVectorScale(t){return{metersToTile:em(nm(ss(t)))}}}function Ub(r){const t=r.parallels,i=!!t&&Math.abs(t[0]+t[1])<.01;switch(r.name){case"mercator":return new Ob(r);case"equirectangular":return new cP(r);case"naturalEarth":return new hP(r);case"equalEarth":return new lP(r);case"winkelTripel":return new dP(r);case"albers":return i?new Nb(r):new aP(r);case"lambertConformalConic":return i?new Nb(r):new uP(r);case"globe":return new pP(r)}throw new Error(`Invalid projection name: ${r.name}`)}const fP=dm.types,mP=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Am(r,t,i,a,u,p,g,y,w,b,A,I,M){const L=y?Math.min(Ra,Math.round(y[0])):0,R=y?Math.min(Ra,Math.round(y[1])):0;r.emplaceBack(t,i,Math.round(32*a),Math.round(32*u),p,g,(L<<1)+(w?1:0),R,16*b,16*A,256*I,256*M)}function Cm(r,t,i,a,u,p,g){r.emplaceBack(t,i,a,u,p,g)}function Im(r,t,i,a,u){r.emplaceBack(t,i,a,u),r.emplaceBack(t,i,a,u),r.emplaceBack(t,i,a,u),r.emplaceBack(t,i,a,u)}function gP(r){for(const t of r.sections)if(dy(t.text))return!0;return!1}class i0{constructor(t){this.layoutVertexArray=new $e,this.indexArray=new mt,this.programConfigurations=t,this.segments=new qn,this.dynamicLayoutVertexArray=new qe,this.opacityVertexArray=new gt,this.placedSymbolArray=new Gn,this.globeExtVertexArray=new Ye}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(t,i,a,u){this.isEmpty()||(a&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,TM.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,i),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,AM.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,mP,!0),this.globeExtVertexArray.length>0&&(this.globeExtVertexBuffer=t.createVertexBuffer(this.globeExtVertexArray,SM.members,!0)),this.opacityVertexBuffer.itemSize=1),(a||u)&&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(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}}dt(i0,"SymbolBuffers");class o0{constructor(t,i,a){this.layoutVertexArray=new t,this.layoutAttributes=i,this.indexArray=new a,this.segments=new qn,this.collisionVertexArray=new Ut,this.collisionVertexArrayExt=new Ot}upload(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,CM.members,!0),this.collisionVertexBufferExt=t.createVertexBuffer(this.collisionVertexArrayExt,IM.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy(),this.collisionVertexBufferExt.destroy())}}dt(o0,"CollisionBuffers");class Oa{constructor(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(g=>g.id),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.fullyClipped=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Lo([]),this.placementViewportMatrix=Lo([]);const i=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Zy(this.zoom,i["text-size"]),this.iconSizeData=Zy(this.zoom,i["icon-size"]);const a=this.layers[0].layout,u=a.get("symbol-sort-key"),p=a.get("symbol-z-order");this.canOverlap=a.get("text-allow-overlap")||a.get("icon-allow-overlap")||a.get("text-ignore-placement")||a.get("icon-ignore-placement"),this.sortFeaturesByKey=p!=="viewport-y"&&u.constantOr(1)!==void 0,this.sortFeaturesByY=(p==="viewport-y"||p==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,this.writingModes=a.get("text-writing-mode").map(g=>Ni[g]),this.stateDependentLayerIds=this.layers.filter(g=>g.isStateDependent()).map(g=>g.id),this.sourceID=t.sourceID,this.projection=t.projection}createArrays(){this.text=new i0(new Wl(this.layers,this.zoom,t=>/^text/.test(t))),this.icon=new i0(new Wl(this.layers,this.zoom,t=>/^icon/.test(t))),this.glyphOffsetArray=new Wr,this.lineVertexArray=new nu,this.symbolInstances=new En}calculateGlyphDependencies(t,i,a,u,p){for(let g=0;g0)&&(w.value.kind!=="constant"||w.value.value.length>0),M=A.value.kind!=="constant"||!!A.value.value||Object.keys(A.parameters).length>0,L=g.get("symbol-sort-key");if(this.features=[],!I&&!M)return;const R=i.iconDependencies,F=i.glyphDependencies,$=i.availableImages,K=new C(this.zoom);for(const{feature:se,id:Y,index:re,sourceLayerIndex:ue}of t){const ce=p._featureFilter.needGeometry,Ie=Jl(se,ce);if(!p._featureFilter.filter(K,Ie,a))continue;if(ce||(Ie.geometry=Vs(se,a,u)),y&&se.type!==1&&a.z<=5){const Me=Ie.geometry,Ue=.98078528056,je=(Ge,et)=>oo(Ad(Ge.x,Ge.y,a,1),Ad(et.x,et.y,a,1))=0;for(const je of Te.sections)if(je.image)R[je.image.name]=!0;else{const Ge=hd(Te.toString()),et=je.fontStack||Me,Le=F[et]=F[et]||{};this.calculateGlyphDependencies(je.text,Le,Ue,this.allowVerticalPlacement,Ge)}}}g.get("symbol-placement")==="line"&&(this.features=function(se){const Y={},re={},ue=[];let ce=0;function Ie(Me){ue.push(se[Me]),ce++}function Te(Me,Ue,je){const Ge=re[Me];return delete re[Me],re[Ue]=Ge,ue[Ge].geometry[0].pop(),ue[Ge].geometry[0]=ue[Ge].geometry[0].concat(je[0]),Ge}function De(Me,Ue,je){const Ge=Y[Ue];return delete Y[Ue],Y[Me]=Ge,ue[Ge].geometry[0].shift(),ue[Ge].geometry[0]=je[0].concat(ue[Ge].geometry[0]),Ge}function Ze(Me,Ue,je){const Ge=je?Ue[0][Ue[0].length-1]:Ue[0][0];return`${Me}:${Ge.x}:${Ge.y}`}for(let Me=0;MeMe.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((se,Y)=>se.sortKey-Y.sortKey)}update(t,i,a,u){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,i,this.layers,a,u),this.icon.programConfigurations.updatePaintArrays(t,i,this.layers,a,u))}isEmpty(){return this.symbolInstances.length===0&&!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()}getProjection(){return this.projectionInstance||(this.projectionInstance=Ub(this.projection)),this.projectionInstance}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(t,i){const a=this.lineVertexArray.length;if(t.segment!==void 0)for(const{x:u,y:p}of i)this.lineVertexArray.emplaceBack(u,p);return{lineStartIndex:a,lineLength:this.lineVertexArray.length-a}}addSymbols(t,i,a,u,p,g,y,w,b,A,I,M,L,R){const F=t.indexArray,$=t.layoutVertexArray,K=t.globeExtVertexArray,se=t.segments.prepareSegment(4*i.length,$,F,this.canOverlap?g.sortKey:void 0),Y=this.glyphOffsetArray.length,re=se.vertexLength,ue=this.allowVerticalPlacement&&y===Ni.vertical?Math.PI/2:0,ce=g.text&&g.text.sections;for(let Te=0;Te=0?i.rightJustifiedTextSymbolIndex:i.centerJustifiedTextSymbolIndex>=0?i.centerJustifiedTextSymbolIndex:i.leftJustifiedTextSymbolIndex>=0?i.leftJustifiedTextSymbolIndex:i.verticalPlacedTextSymbolIndex>=0?i.verticalPlacedTextSymbolIndex:u),g=gm(this.textSizeData,t,p)/Tr;return this.tilePixelRatio*g}getSymbolInstanceIconSize(t,i,a){const u=this.icon.placedSymbolArray.get(a),p=gm(this.iconSizeData,t,u);return this.tilePixelRatio*p}_commitDebugCollisionVertexUpdate(t,i,a){t.emplaceBack(i,-a,-a),t.emplaceBack(i,a,-a),t.emplaceBack(i,a,a),t.emplaceBack(i,-a,a)}_updateTextDebugCollisionBoxes(t,i,a,u,p,g){for(let y=u;y0}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,i){const a=t.placedSymbolArray.get(i),u=a.vertexStartIndex+4*a.numGlyphs;for(let p=a.vertexStartIndex;pu[y]-u[w]||p[w]-p[y]),g}addToSortKeyRanges(t,i){const a=this.sortKeyRanges[this.sortKeyRanges.length-1];a&&a.sortKey===i?a.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:i,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 i of this.symbolInstanceIndexes){const a=this.symbolInstances.get(i);this.featureSortOrder.push(a.featureIndex);const{rightJustifiedTextSymbolIndex:u,centerJustifiedTextSymbolIndex:p,leftJustifiedTextSymbolIndex:g,verticalPlacedTextSymbolIndex:y,placedIconSymbolIndex:w,verticalPlacedIconSymbolIndex:b}=a;u>=0&&this.addIndicesForPlacedSymbol(this.text,u),p>=0&&p!==u&&this.addIndicesForPlacedSymbol(this.text,p),g>=0&&g!==p&&g!==u&&this.addIndicesForPlacedSymbol(this.text,g),y>=0&&this.addIndicesForPlacedSymbol(this.text,y),w>=0&&this.addIndicesForPlacedSymbol(this.icon,w),b>=0&&this.addIndicesForPlacedSymbol(this.icon,b)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}dt(Oa,"SymbolBucket",{omit:["layers","collisionBoxArray","features","compareText"]}),Oa.MAX_GLYPHS=65535,Oa.addDynamicAttributes=Im;const _P=new ee({"symbol-placement":new B(Re.layout_symbol["symbol-placement"]),"symbol-spacing":new B(Re.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new B(Re.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new q(Re.layout_symbol["symbol-sort-key"]),"symbol-z-order":new B(Re.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new B(Re.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new B(Re.layout_symbol["icon-ignore-placement"]),"icon-optional":new B(Re.layout_symbol["icon-optional"]),"icon-rotation-alignment":new B(Re.layout_symbol["icon-rotation-alignment"]),"icon-size":new q(Re.layout_symbol["icon-size"]),"icon-text-fit":new B(Re.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new B(Re.layout_symbol["icon-text-fit-padding"]),"icon-image":new q(Re.layout_symbol["icon-image"]),"icon-rotate":new q(Re.layout_symbol["icon-rotate"]),"icon-padding":new B(Re.layout_symbol["icon-padding"]),"icon-keep-upright":new B(Re.layout_symbol["icon-keep-upright"]),"icon-offset":new q(Re.layout_symbol["icon-offset"]),"icon-anchor":new q(Re.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new B(Re.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new B(Re.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new B(Re.layout_symbol["text-rotation-alignment"]),"text-field":new q(Re.layout_symbol["text-field"]),"text-font":new q(Re.layout_symbol["text-font"]),"text-size":new q(Re.layout_symbol["text-size"]),"text-max-width":new q(Re.layout_symbol["text-max-width"]),"text-line-height":new q(Re.layout_symbol["text-line-height"]),"text-letter-spacing":new q(Re.layout_symbol["text-letter-spacing"]),"text-justify":new q(Re.layout_symbol["text-justify"]),"text-radial-offset":new q(Re.layout_symbol["text-radial-offset"]),"text-variable-anchor":new B(Re.layout_symbol["text-variable-anchor"]),"text-anchor":new q(Re.layout_symbol["text-anchor"]),"text-max-angle":new B(Re.layout_symbol["text-max-angle"]),"text-writing-mode":new B(Re.layout_symbol["text-writing-mode"]),"text-rotate":new q(Re.layout_symbol["text-rotate"]),"text-padding":new B(Re.layout_symbol["text-padding"]),"text-keep-upright":new B(Re.layout_symbol["text-keep-upright"]),"text-transform":new q(Re.layout_symbol["text-transform"]),"text-offset":new q(Re.layout_symbol["text-offset"]),"text-allow-overlap":new B(Re.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new B(Re.layout_symbol["text-ignore-placement"]),"text-optional":new B(Re.layout_symbol["text-optional"])});var s0={paint:new ee({"icon-opacity":new q(Re.paint_symbol["icon-opacity"]),"icon-color":new q(Re.paint_symbol["icon-color"]),"icon-halo-color":new q(Re.paint_symbol["icon-halo-color"]),"icon-halo-width":new q(Re.paint_symbol["icon-halo-width"]),"icon-halo-blur":new q(Re.paint_symbol["icon-halo-blur"]),"icon-translate":new B(Re.paint_symbol["icon-translate"]),"icon-translate-anchor":new B(Re.paint_symbol["icon-translate-anchor"]),"text-opacity":new q(Re.paint_symbol["text-opacity"]),"text-color":new q(Re.paint_symbol["text-color"],{runtimeType:si,getOverride:r=>r.textColor,hasOverride:r=>!!r.textColor}),"text-halo-color":new q(Re.paint_symbol["text-halo-color"]),"text-halo-width":new q(Re.paint_symbol["text-halo-width"]),"text-halo-blur":new q(Re.paint_symbol["text-halo-blur"]),"text-translate":new B(Re.paint_symbol["text-translate"]),"text-translate-anchor":new B(Re.paint_symbol["text-translate-anchor"])}),layout:_P};class jb{constructor(t){this.type=t.property.overrides?t.property.overrides.runtimeType:da,this.defaultValue=t}evaluate(t){if(t.formattedSection){const i=this.defaultValue.property.overrides;if(i&&i.hasOverride(t.formattedSection))return i.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}}dt(jb,"FormatSectionOverride",{omit:["defaultValue"]});class km extends zo{constructor(t){super(t,s0)}recalculate(t,i){super.recalculate(t,i),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"));const a=this.layout.get("text-writing-mode");if(a){const u=[];for(const p of a)u.indexOf(p)<0&&u.push(p);this.layout._values["text-writing-mode"]=u}else this.layout._values["text-writing-mode"]=this.layout.get("symbol-placement")==="point"?["horizontal"]:["horizontal","vertical"];this._setPaintOverrides()}getValueAndResolveTokens(t,i,a,u){const p=this.layout.get(t).evaluate(i,{},a,u),g=this._unevaluatedLayout._values[t];return g.isDataDriven()||Ta(g.value)||!p?p:function(y,w){return w.replace(/{([^{}]+)}/g,(b,A)=>A in y?String(y[A]):"")}(i.properties,p)}createBucket(t){return new Oa(t)}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(const t of s0.paint.overridableProperties){if(!km.hasPaintOverride(this.layout,t))continue;const i=this.paint.get(t),a=new jb(i),u=new Hc(a,i.property.specification);let p=null;p=i.value.kind==="constant"||i.value.kind==="source"?new ed("source",u):new Bl("composite",u,i.value.zoomStops,i.value._interpolationType),this.paint._values[t]=new Z(i.property,p,i.parameters)}}_handleOverridablePaintPropertyUpdate(t,i,a){return!(!this.layout||i.isDataDriven()||a.isDataDriven())&&km.hasPaintOverride(this.layout,t)}static hasPaintOverride(t,i){const a=t.get("text-field"),u=s0.paint.properties[i];let p=!1;const g=y=>{for(const w of y)if(u.overrides&&u.overrides.hasOverride(w))return void(p=!0)};if(a.value.kind==="constant"&&a.value.value instanceof qr)g(a.value.value.sections);else if(a.value.kind==="source"){const y=b=>{p||(b instanceof Ms&&Ln(b.value)===xl?g(b.value.sections):b instanceof ns?g(b.sections):b.eachChild(y))},w=a.value;w._styleExpression&&y(w._styleExpression.expression)}return p}getProgramConfiguration(t){return new Pa(this,t)}}var yP={paint:new ee({"background-color":new B(Re.paint_background["background-color"]),"background-pattern":new B(Re.paint_background["background-pattern"]),"background-opacity":new B(Re.paint_background["background-opacity"])})},vP={paint:new ee({"raster-opacity":new B(Re.paint_raster["raster-opacity"]),"raster-hue-rotate":new B(Re.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new B(Re.paint_raster["raster-brightness-min"]),"raster-brightness-max":new B(Re.paint_raster["raster-brightness-max"]),"raster-saturation":new B(Re.paint_raster["raster-saturation"]),"raster-contrast":new B(Re.paint_raster["raster-contrast"]),"raster-resampling":new B(Re.paint_raster["raster-resampling"]),"raster-fade-duration":new B(Re.paint_raster["raster-fade-duration"])})};class xP extends zo{constructor(t){super(t,{}),this.implementation=t}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}isLayerDraped(){return this.implementation.renderToTile!==void 0}shouldRedrape(){return!!this.implementation.shouldRerenderTiles&&this.implementation.shouldRerenderTiles()}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){}onAdd(t){this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)}onRemove(t){this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)}}var wP={paint:new ee({"sky-type":new B(Re.paint_sky["sky-type"]),"sky-atmosphere-sun":new B(Re.paint_sky["sky-atmosphere-sun"]),"sky-atmosphere-sun-intensity":new B(Re.paint_sky["sky-atmosphere-sun-intensity"]),"sky-gradient-center":new B(Re.paint_sky["sky-gradient-center"]),"sky-gradient-radius":new B(Re.paint_sky["sky-gradient-radius"]),"sky-gradient":new Q(Re.paint_sky["sky-gradient"]),"sky-atmosphere-halo-color":new B(Re.paint_sky["sky-atmosphere-halo-color"]),"sky-atmosphere-color":new B(Re.paint_sky["sky-atmosphere-color"]),"sky-opacity":new B(Re.paint_sky["sky-opacity"])})};function a0(r,t,i){const a=[0,0,1],u=sw([]);return lw(u,u,i?-St(r)+Math.PI:St(r)),aw(u,u,-St(t)),nw(a,a,u),Zr(a,a)}const bP={circle:class extends zo{constructor(r){super(r,Lk)}createBucket(r){return new Ly(r)}queryRadius(r){const t=r;return uu("circle-radius",this,t)+uu("circle-stroke-width",this,t)+om(this.paint.get("circle-translate"))}queryIntersectsFeature(r,t,i,a,u,p,g,y){const w=Mw(this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),p.angle,r.pixelToTileUnitsFactor),b=this.paint.get("circle-radius").evaluate(t,i)+this.paint.get("circle-stroke-width").evaluate(t,i);return Pw(r,a,p,g,y,this.paint.get("circle-pitch-alignment")==="map",this.paint.get("circle-pitch-scale")==="map",w,b)}getProgramIds(){return["circle"]}getProgramConfiguration(r){return new Pa(this,r)}},heatmap:class extends zo{createBucket(r){return new Lw(r)}constructor(r){super(r,Bk),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(r){r==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=By({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(r){return uu("heatmap-radius",this,r)}queryIntersectsFeature(r,t,i,a,u,p,g,y){const w=this.paint.get("heatmap-radius").evaluate(t,i);return Pw(r,a,p,g,y,!0,!0,new Ve(0,0),w)}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}getProgramIds(){return["heatmap","heatmapTexture"]}getProgramConfiguration(r){return new Pa(this,r)}},hillshade:class extends zo{constructor(r){super(r,Fk)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}getProgramIds(){return["hillshade","hillshadePrepare"]}},fill:class extends zo{constructor(r){super(r,eM)}getProgramIds(){const r=this.paint.get("fill-pattern"),t=r&&r.constantOr(1),i=[t?"fillPattern":"fill"];return this.paint.get("fill-antialias")&&i.push(t&&!this.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline"),i}getProgramConfiguration(r){return new Pa(this,r)}recalculate(r,t){super.recalculate(r,t);const i=this.paint._values["fill-outline-color"];i.value.kind==="constant"&&i.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(r){return new um(r)}queryRadius(){return om(this.paint.get("fill-translate"))}queryIntersectsFeature(r,t,i,a,u,p){return!r.queryGeometry.isAboveHorizon&&Sw(kw(r.tilespaceGeometry,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),p.angle,r.pixelToTileUnitsFactor),a)}isTileClipped(){return!0}},"fill-extrusion":class extends zo{constructor(r){super(r,gM)}createBucket(r){return new Dd(r)}queryRadius(){return om(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}getProgramIds(){return[this.paint.get("fill-extrusion-pattern").constantOr(1)?"fillExtrusionPattern":"fillExtrusion"]}getProgramConfiguration(r){return new Pa(this,r)}queryIntersectsFeature(r,t,i,a,u,p,g,y,w){const b=Mw(this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),p.angle,r.pixelToTileUnitsFactor),A=this.paint.get("fill-extrusion-height").evaluate(t,i),I=this.paint.get("fill-extrusion-base").evaluate(t,i),M=[0,0],L=y&&p.elevation,R=p.elevation?p.elevation.exaggeration():1,F=r.tile.getBucket(this);if(L&&F instanceof Dd){const re=F.centroidVertexArray,ue=w+1;uere.polygon).flat());const $=L?y:null,[K,se]=function(re,ue,ce,Ie,Te,De,Ze,Me,Ue,je,Ge){return re.projection.name==="globe"?function(et,Le,ot,ft,st,At,tt,_t,Ct,Ht,It){const bt=[],bn=[],zt=et.projection.upVectorScale(It,et.center.lat,et.worldSize).metersToTile,Lt=[0,0,0,1],cn=[0,0,0,1],fn=(un,kn,Rn,Zn)=>{un[0]=kn,un[1]=Rn,un[2]=Zn,un[3]=1},mn=Kw();ot>0&&(ot+=mn),ft+=mn;for(const un of Le){const kn=[],Rn=[];for(const Zn of un){const hn=Zn.x+st.x,nr=Zn.y+st.y,Hn=et.projection.projectTilePoint(hn,nr,It),Mn=et.projection.upVector(It,Zn.x,Zn.y);let Kt=ot,Xn=ft;if(tt){const gn=tb(hn,nr,ot,ft,tt,_t,Ct,Ht);Kt+=gn.base,Xn+=gn.top}ot!==0?fn(Lt,Hn.x+Mn[0]*zt*Kt,Hn.y+Mn[1]*zt*Kt,Hn.z+Mn[2]*zt*Kt):fn(Lt,Hn.x,Hn.y,Hn.z),fn(cn,Hn.x+Mn[0]*zt*Xn,Hn.y+Mn[1]*zt*Xn,Hn.z+Mn[2]*zt*Xn),Nn(Lt,Lt,At),Nn(cn,cn,At),kn.push(new pu(Lt[0],Lt[1],Lt[2])),Rn.push(new pu(cn[0],cn[1],cn[2]))}bt.push(kn),bn.push(Rn)}return[bt,bn]}(re,ue,ce,Ie,Te,De,Ze,Me,Ue,je,Ge):Ze?function(et,Le,ot,ft,st,At,tt,_t,Ct){const Ht=[],It=[],bt=[0,0,0,1];for(const bn of et){const zt=[],Lt=[];for(const cn of bn){const fn=cn.x+ft.x,mn=cn.y+ft.y,un=tb(fn,mn,Le,ot,At,tt,_t,Ct);bt[0]=fn,bt[1]=mn,bt[2]=un.base,bt[3]=1,Xl(bt,bt,st),bt[3]=Math.max(bt[3],1e-5);const kn=new pu(bt[0]/bt[3],bt[1]/bt[3],bt[2]/bt[3]);bt[0]=fn,bt[1]=mn,bt[2]=un.top,bt[3]=1,Xl(bt,bt,st),bt[3]=Math.max(bt[3],1e-5);const Rn=new pu(bt[0]/bt[3],bt[1]/bt[3],bt[2]/bt[3]);zt.push(kn),Lt.push(Rn)}Ht.push(zt),It.push(Lt)}return[Ht,It]}(ue,ce,Ie,Te,De,Ze,Me,Ue,je):function(et,Le,ot,ft,st){const At=[],tt=[],_t=st[8]*Le,Ct=st[9]*Le,Ht=st[10]*Le,It=st[11]*Le,bt=st[8]*ot,bn=st[9]*ot,zt=st[10]*ot,Lt=st[11]*ot;for(const cn of et){const fn=[],mn=[];for(const un of cn){const kn=un.x+ft.x,Rn=un.y+ft.y,Zn=st[0]*kn+st[4]*Rn+st[12],hn=st[1]*kn+st[5]*Rn+st[13],nr=st[2]*kn+st[6]*Rn+st[14],Hn=st[3]*kn+st[7]*Rn+st[15],Mn=Zn+_t,Kt=hn+Ct,Xn=nr+Ht,gn=Math.max(Hn+It,1e-5),Kr=Zn+bt,Kn=hn+bn,Sr=nr+zt,mr=Math.max(Hn+Lt,1e-5);fn.push(new pu(Mn/gn,Kt/gn,Xn/gn)),mn.push(new pu(Kr/mr,Kn/mr,Sr/mr))}At.push(fn),tt.push(mn)}return[At,tt]}(ue,ce,Ie,Te,De)}(p,a,I,A,b,g,$,M,R,p.center.lat,r.tileID.canonical),Y=r.queryGeometry;return function(re,ue,ce){let Ie=1/0;Sw(ce,ue)&&(Ie=eb(ce,ue[0]));for(let Te=0;Te=3){for(let R=0;R{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){this._channel=void 0,this._callback=()=>{}}}class TP{constructor(){this.tasks={},this.taskQueue=[],Yi(["process"],this),this.invoker=new EP(this.process),this.nextId=0}add(t,i){const a=this.nextId++,u=function({type:p,isSymbolTile:g,zoom:y}){return y=y||0,p==="message"?0:p!=="maybePrepare"||g?p!=="parseTile"||g?p==="parseTile"&&g?300-y:p==="maybePrepare"&&g?400-y:500:200-y:100-y}(i);if(u===0){vo();try{t()}finally{}return{cancel:()=>{}}}return this.tasks[a]={fn:t,metadata:i,priority:u,id:a},this.taskQueue.push(a),this.invoker.trigger(),{cancel:()=>{delete this.tasks[a]}}}process(){vo();try{if(this.taskQueue=this.taskQueue.filter(a=>!!this.tasks[a]),!this.taskQueue.length)return;const t=this.pick();if(t===null)return;const i=this.tasks[t];if(delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),!i)return;i.fn()}finally{}}pick(){let t=null,i=1/0;for(let u=0;u>=1)>1;){const b=i+u>>1,A=a+p>>1;1&t?(u=i,p=a,i=g,a=y):(i=u,a=p,u=g,p=y),g=b,y=A}const w=4*r;Ba[w+0]=i,Ba[w+1]=a,Ba[w+2]=u,Ba[w+3]=p}const us=new Uint16Array(2178),Fa=new Uint8Array(1089),Mm=new Uint16Array(1089);function Gb(r){return r===0?-.03125:r===32?.03125:0}var qb=ye([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);const Wb={type:2,extent:vt,loadGeometry:()=>[[new Ve(0,0),new Ve(vt+1,0),new Ve(vt+1,vt+1),new Ve(0,vt+1),new Ve(0,0)]]};class l0{constructor(t,i,a,u,p){this.tileID=t,this.uid=ii(),this.uses=0,this.tileSize=i,this.tileZoom=a,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.isRaster=p,this.expiredRequestCount=0,this.state="loading",u&&u.transform&&(this.projection=u.transform.projection)}registerFadeDuration(t){const i=t+this.timeAdded;ip.getLayer(b)).filter(Boolean);if(w.length!==0){y.layers=w,y.stateDependentLayerIds&&(y.stateDependentLayers=y.stateDependentLayerIds.map(b=>w.filter(A=>A.id===b)[0]));for(const b of w)g[b.id]=y}}return g}(t.buckets,i.style),this.hasSymbolBuckets=!1;for(const u in this.buckets){const p=this.buckets[u];if(p instanceof Oa){if(this.hasSymbolBuckets=!0,!a)break;p.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const u in this.buckets){const p=this.buckets[u];if(p instanceof Oa&&p.hasRTLText){this.hasRTLText=!0,S.isLoading()||S.isLoaded()||x()!=="deferred"||T();break}}this.queryPadding=0;for(const u in this.buckets){const p=this.buckets[u];this.queryPadding=Math.max(this.queryPadding,i.style.getLayer(u).queryRadius(p))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage),t.lineAtlas&&(this.lineAtlas=t.lineAtlas)}else this.collisionBoxArray=new an}unloadVectorData(){if(this.hasData()){for(const t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.lineAtlasTexture&&this.lineAtlasTexture.destroy(),this._tileBoundsBuffer&&(this._tileBoundsBuffer.destroy(),this._tileBoundsIndexBuffer.destroy(),this._tileBoundsSegments.destroy(),this._tileBoundsBuffer=null),this._tileDebugBuffer&&(this._tileDebugBuffer.destroy(),this._tileDebugSegments.destroy(),this._tileDebugBuffer=null),this._tileDebugIndexBuffer&&(this._tileDebugIndexBuffer.destroy(),this._tileDebugIndexBuffer=null),this._globeTileDebugBorderBuffer&&(this._globeTileDebugBorderBuffer.destroy(),this._globeTileDebugBorderBuffer=null),this._tileDebugTextBuffer&&(this._tileDebugTextBuffer.destroy(),this._tileDebugTextSegments.destroy(),this._tileDebugTextIndexBuffer.destroy(),this._tileDebugTextBuffer=null),this._globeTileDebugTextBuffer&&(this._globeTileDebugTextBuffer.destroy(),this._globeTileDebugTextBuffer=null),this.latestFeatureIndex=null,this.state="unloaded"}}getBucket(t){return this.buckets[t.id]}upload(t){for(const a in this.buckets){const u=this.buckets[a];u.uploadPending()&&u.upload(t)}const i=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Wd(t,this.imageAtlas.image,i.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Wd(t,this.glyphAtlasImage,i.ALPHA),this.glyphAtlasImage=null),this.lineAtlas&&!this.lineAtlas.uploaded&&(this.lineAtlasTexture=new Wd(t,this.lineAtlas.image,i.ALPHA),this.lineAtlas.uploaded=!0)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,i,a,u,p,g,y,w){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({tileResult:u,pixelPosMatrix:y,transform:g,params:p,tileTransform:this.tileTransform},t,i,a):{}}querySourceFeatures(t,i){const a=this.latestFeatureIndex;if(!a||!a.rawTileData)return;const u=a.loadVTLayers(),p=i?i.sourceLayer:"",g=u._geojsonTileLayer||u[p];if(!g)return;const y=Jc(i&&i.filter),{z:w,x:b,y:A}=this.tileID.canonical,I={z:w,x:b,y:A};for(let M=0;Ma)u=!1;else if(i)if(this.expirationTime=0;$--){const K=4*$,se=Ba[K+0],Y=Ba[K+1],re=Ba[K+2],ue=Ba[K+3],ce=se+re>>1,Ie=Y+ue>>1,Te=ce+Ie-Y,De=Ie+se-ce,Ze=Y*cs+se,Me=ue*cs+re,Ue=Ie*cs+ce,je=Math.hypot((us[2*Ze+0]+us[2*Me+0])/2-us[2*Ue+0],(us[2*Ze+1]+us[2*Me+1])/2-us[2*Ue+1])>=16;Fa[Ue]=Fa[Ue]||(je?1:0),$<1022&&(Fa[Ue]=Fa[Ue]||Fa[(Y+De>>1)*cs+(se+Te>>1)]||Fa[(ue+De>>1)*cs+(re+Te>>1)])}const I=new Fe,M=new mt;let L=0;function R($,K){const se=K*cs+$;return Mm[se]===0&&(I.emplaceBack(us[2*se+0],us[2*se+1],$*vt/lo,K*vt/lo),Mm[se]=++L),Mm[se]-1}function F($,K,se,Y,re,ue){const ce=$+se>>1,Ie=K+Y>>1;if(Math.abs($-re)+Math.abs(K-ue)>1&&Fa[Ie*cs+ce])F(re,ue,$,K,ce,Ie),F(se,Y,re,ue,ce,Ie);else{const Te=R($,K),De=R(se,Y),Ze=R(re,ue);M.emplaceBack(Te,De,Ze)}}return F(0,0,lo,lo,lo,0),F(lo,lo,0,0,0,lo),{vertices:I,indices:M}}(this.tileID.canonical,i);u=g.vertices,p=g.indices}else{u=new Fe,p=new mt;for(const{x:y,y:w}of a)u.emplaceBack(y,w,0,0);const g=Vy(u.int16,void 0,4);for(let y=0;y0&&(y=gy(new Float64Array(16),i.globeMatrix)),this._makeGlobeTileDebugBorderBuffer(t,u,i,p,y,g),this._makeGlobeTileDebugTextBuffer(t,u,i,p,y,g)}_globePoint(t,i,a,u,p,g,y){let w=Ad(t,i,a);if(g){const b=1<.5?L=-1:M<-.5&&(L=1);let R=(t/vt+a.x)/b+L,F=(i/vt+a.y)/b;R=(R-A)*u._pixelsPerMercatorPixel+A,F=(F-I)*u._pixelsPerMercatorPixel+I;const $=[R*u.worldSize,F*u.worldSize,0];Nn($,$,g),w=Yl(w,$,y)}return Nn(w,w,p)}_makeGlobeTileDebugBorderBuffer(t,i,a,u,p,g){const y=new We,w=new vi,b=new Ee,A=(M,L,R,F,$)=>{const K=(R-M)/($-1),se=(F-L)/($-1),Y=y.length;for(let re=0;re<$;re++){const ue=M+re*K,ce=L+re*se;y.emplaceBack(ue,ce);const Ie=this._globePoint(ue,ce,i,a,u,p,g);b.emplaceBack(Ie[0],Ie[1],Ie[2]),w.emplaceBack(Y+re)}},I=vt;A(0,0,I,0,16),A(I,0,I,I,16),A(I,I,0,I,16),A(0,I,0,0,16),this._tileDebugIndexBuffer=t.createIndexBuffer(w),this._tileDebugBuffer=t.createVertexBuffer(y,Td.members),this._globeTileDebugBorderBuffer=t.createVertexBuffer(b,uw.members),this._tileDebugSegments=qn.simpleSegment(0,0,y.length,w.length)}_makeGlobeTileDebugTextBuffer(t,i,a,u,p,g){const y=vt/4,w=new We,b=new mt,A=new Ee,I=25;b.reserve(32),w.reserve(I),A.reserve(I);const M=(L,R)=>I*L+R;for(let L=0;Lt[g])return null}else{const y=1/a[g];let w=(r[g]-i[g])*y,b=(t[g]-i[g])*y;if(w>b){const A=w;w=b,b=A}if(w>u&&(u=w),bp)return null}return u}function Xb(r,t,i,a,u,p,g,y,w,b,A){const I=a-r,M=u-t,L=p-i,R=g-r,F=y-t,$=w-i,K=A[1]*$-A[2]*F,se=A[2]*R-A[0]*$,Y=A[0]*F-A[1]*R,re=I*K+M*se+L*Y;if(Math.abs(re)<1e-15)return null;const ue=1/re,ce=b[0]-r,Ie=b[1]-t,Te=b[2]-i,De=(ce*K+Ie*se+Te*Y)*ue;if(De<0||De>1)return null;const Ze=Ie*L-Te*M,Me=Te*I-ce*L,Ue=ce*M-Ie*I,je=(A[0]*Ze+A[1]*Me+A[2]*Ue)*ue;return je<0||De+je>1?null:(R*Ze+F*Me+$*Ue)*ue}function Kb(r,t,i){return(r-t)/(i-t)}function Yb(r,t,i,a,u,p,g,y,w){const b=1<{const se=$?1:0,Y=(L+1)*F-se,re=R*F,ue=(R+1)*F-se;K[0]=L*F,K[1]=re,K[2]=Y,K[3]=ue};let I=new Zb(w);const M=[];for(let L=0;L=1;w/=2){const L=y[y.length-1];I=new Zb(w);for(let R=0;R0;){const{idx:R,t:F,nodex:$,nodey:K,depth:se}=L.pop();if(this.leaves[R]){Yb($,K,se,t,i,a,u,I,M);const re=1<=Le[2])return F}continue}let Y=0;for(let re=0;re=b[A[Te]]&&(A.splice(Te,0,re),Ie=!0);Ie||(A[Y]=re),Y++}}for(let re=0;re=this.dim+1||i<-1||i>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(i+1)*this.stride+(t+1)}static pack(t,i){const a=[0,0,0,0],u=Pm.getUnpackVector(i);let p=Math.floor((t+u[3])/u[2]);return a[2]=p%256,p=Math.floor(p/256),a[1]=p%256,p=Math.floor(p/256),a[0]=p,a}getPixels(){return new wi({width:this.stride,height:this.stride},this.pixels)}backfillBorder(t,i,a){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");let u=i*this.dim,p=i*this.dim+this.dim,g=a*this.dim,y=a*this.dim+this.dim;switch(i){case-1:u=p-1;break;case 1:p=u+1}switch(a){case-1:g=y-1;break;case 1:y=g+1}const w=-i*this.dim,b=-a*this.dim;for(let A=g;A{this.remove(t,p)},a)),this.data[u].push(p),this.order.push(u),this.order.length>this.max){const g=this._getAndRemoveByKey(this.order[0]);g&&this.onRemove(g)}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 i=this.data[t].shift();return i.timeout&&clearTimeout(i.timeout),this.data[t].length===0&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),i.value}getByKey(t){const i=this.data[t];return i?i[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,i){if(!this.has(t))return this;const a=t.wrapped().key,u=i===void 0?0:this.data[a].indexOf(i),p=this.data[a][u];return this.data[a].splice(u,1),p.timeout&&clearTimeout(p.timeout),this.data[a].length===0&&delete this.data[a],this.onRemove(p.value),this.order.splice(this.order.indexOf(a),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){const i=this._getAndRemoveByKey(this.order[0]);i&&this.onRemove(i)}return this}filter(t){const i=[];for(const a in this.data)for(const u of this.data[a])t(u.value)||i.push(u);for(const a of i)this.remove(a.value.tileID,a)}}class Eu{constructor(t,i,a){this.func=t,this.mask=i,this.range=a}}Eu.ReadOnly=!1,Eu.ReadWrite=!0,Eu.disabled=new Eu(519,Eu.ReadOnly,[0,1]);const c0=7680;class u0{constructor(t,i,a,u,p,g){this.test=t,this.ref=i,this.mask=a,this.fail=u,this.depthFail=p,this.pass=g}}u0.disabled=new u0({func:519,mask:0},0,0,c0,c0,c0);class hs{constructor(t,i,a){this.blendFunction=t,this.blendColor=i,this.mask=a}}hs.Replace=[1,0],hs.disabled=new hs(hs.Replace,Fn.transparent,[!1,!1,!1,!1]),hs.unblended=new hs(hs.Replace,Fn.transparent,[!0,!0,!0,!0]),hs.alphaBlended=new hs([1,771],Fn.transparent,[!0,!0,!0,!0]);const h0=1029,d0=2305;class Fo{constructor(t,i,a){this.enable=t,this.mode=i,this.frontFace=a}}Fo.disabled=new Fo(!1,h0,d0),Fo.backCCW=new Fo(!0,h0,d0),Fo.backCW=new Fo(!0,h0,2304),Fo.frontCW=new Fo(!0,1028,2304),Fo.frontCCW=new Fo(!0,1028,d0);class nc extends vl{constructor(t,i,a){super(),this.id=t,this._onlySymbols=a,i.on("data",u=>{u.dataType==="source"&&u.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&u.dataType==="source"&&u.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform))}),i.on("error",()=>{this._sourceErrored=!0}),this._source=i,this._tiles={},this._cache=new kP(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._minTileCacheSize=i.minTileCacheSize,this._maxTileCacheSize=i.maxTileCacheSize,this._loadedParentTiles={},this._coveredTiles={},this._state=new AP,this._isRaster=this._source.type==="raster"||this._source.type==="raster-dem"||this._source.type==="custom"&&this._source._dataType==="raster"}onAdd(t){this.map=t,this._minTileCacheSize=this._minTileCacheSize===void 0&&t?t._minTileCacheSize:this._minTileCacheSize,this._maxTileCacheSize=this._maxTileCacheSize===void 0&&t?t._maxTileCacheSize:this._maxTileCacheSize}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(const t in this._tiles){const i=this._tiles[t];if(i.state!=="loaded"&&i.state!=="errored")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)}_loadTile(t,i){return t.isSymbolTile=this._onlySymbols,this._source.loadTile(t,i)}_unloadTile(t){if(this._source.unloadTile)return this._source.unloadTile(t,()=>{})}_abortTile(t){if(this._source.abortTile)return this._source.abortTile(t,()=>{})}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 i in this._tiles){const a=this._tiles[i];a.upload(t),a.prepare(this.map.style.imageManager)}}getIds(){return dn(this._tiles).map(t=>t.tileID).sort(t2).map(t=>t.key)}getRenderableIds(t){const i=[];for(const a in this._tiles)this._isIdRenderable(+a,t)&&i.push(this._tiles[a]);return t?i.sort((a,u)=>{const p=a.tileID,g=u.tileID,y=new Ve(p.canonical.x,p.canonical.y)._rotate(this.transform.angle),w=new Ve(g.canonical.x,g.canonical.y)._rotate(this.transform.angle);return p.overscaledZ-g.overscaledZ||w.y-y.y||w.x-y.x}).map(a=>a.tileID.key):i.map(a=>a.tileID).sort(t2).map(a=>a.key)}hasRenderableParent(t){const i=this.findLoadedParent(t,0);return!!i&&this._isIdRenderable(i.tileID.key)}_isIdRenderable(t,i){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(i||!this._tiles[t].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const t in this._tiles)this._tiles[t].state!=="errored"&&this._reloadTile(+t,"reloading")}}_reloadTile(t,i){const a=this._tiles[t];a&&(a.state!=="loading"&&(a.state=i),this._loadTile(a,this._tileLoaded.bind(this,a,t,i)))}_tileLoaded(t,i,a,u){if(u)if(t.state="errored",u.status!==404)this._source.fire(new wo(u,{tile:t}));else if(this._source.type==="raster-dem"&&this.usedForTerrain&&this.map.painter.terrain){const p=this.map.painter.terrain;this.update(this.transform,p.getScaledDemTileSize(),!0),p.resetTileLookupCache(this.id)}else this.update(this.transform);else t.timeAdded=xo.now(),a==="expired"&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(i,t),this._source.type==="raster-dem"&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),this._source.fire(new Is("data",{dataType:"source",tile:t,coord:t.tileID,sourceCacheId:this.id}))}_backfillDEM(t){const i=this.getRenderableIds();for(let u=0;u1||(Math.abs(g)>1&&(Math.abs(g+w)===1?g+=w:Math.abs(g-w)===1&&(g-=w)),p.dem&&u.dem&&(u.dem.backfillBorder(p.dem,g,y),u.neighboringTiles&&u.neighboringTiles[b]&&(u.neighboringTiles[b].backfilled=!0)))}}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._tiles[t]}_retainLoadedChildren(t,i,a,u){for(const p in this._tiles){let g=this._tiles[p];if(u[p]||!g.hasData()||g.tileID.overscaledZ<=i||g.tileID.overscaledZ>a)continue;let y=g.tileID;for(;g&&g.tileID.overscaledZ>i+1;){const b=g.tileID.scaledTo(g.tileID.overscaledZ-1);g=this._tiles[b.key],g&&g.hasData()&&(y=b)}let w=y;for(;w.overscaledZ>i;)if(w=w.scaledTo(w.overscaledZ-1),t[w.key]){u[y.key]=y;break}}}findLoadedParent(t,i){if(t.key in this._loadedParentTiles){const a=this._loadedParentTiles[t.key];return a&&a.tileID.overscaledZ>=i?a:null}for(let a=t.overscaledZ-1;a>=i;a--){const u=t.scaledTo(a),p=this._getLoadedTile(u);if(p)return p}}_getLoadedTile(t){const i=this._tiles[t.key];return i&&i.hasData()?i:this._cache.getByKey(this._source.reparseOverscaled?t.wrapped().key:t.canonical.key)}updateCacheSize(t,i){i=i||this._source.tileSize;const a=Math.ceil(t.width/i)+1,u=Math.ceil(t.height/i)+1,p=Math.floor(a*u*5),g=typeof this._minTileCacheSize=="number"?Math.max(this._minTileCacheSize,p):p,y=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,g):g;this._cache.setMaxSize(y)}handleWrapJump(t){const i=Math.round((t-(this._prevLng===void 0?t:this._prevLng))/360);if(this._prevLng=t,i){const a={};for(const u in this._tiles){const p=this._tiles[u];p.tileID=p.tileID.unwrapTo(p.tileID.wrap+i),a[p.tileID.key]=p}this._tiles=a;for(const u in this._timers)clearTimeout(this._timers[u]),delete this._timers[u];for(const u in this._tiles)this._setTileReloadTimer(+u,this._tiles[u])}}update(t,i,a){if(this.transform=t,!this._sourceLoaded||this._paused||this.transform.freezeTileCoverage||this.usedForTerrain&&!a)return;let u;this.updateCacheSize(t,i),this.transform.projection.name!=="globe"&&this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?u=t.getVisibleUnwrappedCoordinates(this._source.tileID).map(y=>new Xr(y.canonical.z,y.wrap,y.canonical.z,y.canonical.x,y.canonical.y)):(u=t.coveringTiles({tileSize:i||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!a,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain}),this._source.hasTile&&(u=u.filter(y=>this._source.hasTile(y)))):u=[];const p=this._updateRetainedTiles(u);if(n2(this._source.type)&&u.length!==0){const y={},w={},b=Object.keys(p);for(const I of b){const M=p[I],L=this._tiles[I];if(!L||L.fadeEndTime&&L.fadeEndTime<=xo.now())continue;const R=this.findLoadedParent(M,Math.max(M.overscaledZ-nc.maxOverzooming,this._source.minzoom));R&&(this._addTile(R.tileID),y[R.tileID.key]=R.tileID),w[I]=M}const A=u[u.length-1].overscaledZ;for(const I in this._tiles){const M=this._tiles[I];if(p[I]||!M.hasData())continue;let L=M.tileID;for(;L.overscaledZ>A;){L=L.scaledTo(L.overscaledZ-1);const R=this._tiles[L.key];if(R&&R.hasData()&&w[L.key]){p[I]=M.tileID;break}}}for(const I in y)p[I]||(this._coveredTiles[I]=!0,p[I]=y[I])}for(const y in p)this._tiles[y].clearFadeHold();const g=function(y,w){const b=[];for(const A in y)A in w||b.push(A);return b}(this._tiles,p);for(const y of g){const w=this._tiles[y];w.hasSymbolBuckets&&!w.holdingForFade()?w.setHoldDuration(this.map._fadeDuration):w.hasSymbolBuckets&&!w.symbolFadeFinished()||this._removeTile(+y)}this._updateLoadedParentTileCache(),this._onlySymbols&&this._source.afterUpdate&&this._source.afterUpdate()}releaseSymbolFadeTiles(){for(const t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(+t)}_updateRetainedTiles(t){const i={};if(t.length===0)return i;const a={},u=t.reduce((b,A)=>Math.min(b,A.overscaledZ),1/0),p=t[0].overscaledZ,g=Math.max(p-nc.maxOverzooming,this._source.minzoom),y=Math.max(p+nc.maxUnderzooming,this._source.minzoom),w={};for(const b of t){const A=this._addTile(b);i[b.key]=b,A.hasData()||u=this._source.maxzoom){const M=b.children(this._source.maxzoom)[0],L=this.getTile(M);if(L&&L.hasData()){i[M.key]=M;continue}}else{const M=b.children(this._source.maxzoom);if(i[M[0].key]&&i[M[1].key]&&i[M[2].key]&&i[M[3].key])continue}let I=A.wasRequested();for(let M=b.overscaledZ-1;M>=g;--M){const L=b.scaledTo(M);if(a[L.key]||(a[L.key]=!0,A=this.getTile(L),!A&&I&&(A=this._addTile(L)),A&&(i[L.key]=L,I=A.wasRequested(),A.hasData())))break}}return i}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const t in this._tiles){const i=[];let a,u=this._tiles[t].tileID;for(;u.overscaledZ>0;){if(u.key in this._loadedParentTiles){a=this._loadedParentTiles[u.key];break}i.push(u.key);const p=u.scaledTo(u.overscaledZ-1);if(a=this._getLoadedTile(p),a)break;u=p}for(const p of i)this._loadedParentTiles[p]=a}}_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 a=!!i;if(!a){const u=this.map?this.map.painter:null;i=new l0(t,this._source.tileSize*t.overscaleFactor(),this.transform.tileZoom,u,this._isRaster),this._loadTile(i,this._tileLoaded.bind(this,i,t.key,i.state))}return i?(i.uses++,this._tiles[t.key]=i,a||this._source.fire(new Is("dataloading",{tile:i,coord:i.tileID,dataType:"source"})),i):null}_setTileReloadTimer(t,i){t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);const a=i.getExpiryTimeout();a&&(this._timers[t]=setTimeout(()=>{this._reloadTile(t,"expired"),delete this._timers[t]},a))}_removeTile(t){const i=this._tiles[t];i&&(i.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),i.uses>0||(i.hasData()&&i.state!=="reloading"?this._cache.add(i.tileID,i,i.getExpiryTimeout()):(i.aborted=!0,this._abortTile(i),this._unloadTile(i))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const t in this._tiles)this._removeTile(+t);this._source._clear&&this._source._clear(),this._cache.reset(),this.map&&this.usedForTerrain&&this.map.painter.terrain&&this.map.painter.terrain.resetTileLookupCache(this.id)}tilesIn(t,i,a){const u=[],p=this.transform;if(!p)return u;const g=p.projection.name==="globe",y=as(p.center.lng);for(const w in this._tiles){const b=this._tiles[w];if(a&&b.clearQueryDebugViz(),b.holdingForFade())continue;let A;if(g){const I=b.tileID.canonical;if(I.z===0){const M=[Math.abs(Je(y,...Zd(I,-1))-y),Math.abs(Je(y,...Zd(I,1))-y)];A=[0,2*M.indexOf(Math.min(...M))-1]}else{const M=[Math.abs(Je(y,...Zd(I,-1))-y),Math.abs(Je(y,...Zd(I,0))-y),Math.abs(Je(y,...Zd(I,1))-y)];A=[M.indexOf(Math.min(...M))-1]}}else A=[0];for(const I of A){const M=t.containsTile(b,p,i,I);M&&u.push(M)}}return u}getVisibleCoordinates(t){const i=this.getRenderableIds(t).map(a=>this._tiles[a].tileID);for(const a of i)a.projMatrix=this.transform.calculateProjMatrix(a.toUnwrapped());return i}hasTransition(){if(this._source.hasTransition())return!0;if(n2(this._source.type))for(const t in this._tiles){const i=this._tiles[t];if(i.fadeEndTime!==void 0&&i.fadeEndTime>=xo.now())return!0}return!1}setFeatureState(t,i,a){this._state.updateState(t=t||"_geojsonTileLayer",i,a)}removeFeatureState(t,i,a){this._state.removeFeatureState(t=t||"_geojsonTileLayer",i,a)}getFeatureState(t,i){return this._state.getState(t=t||"_geojsonTileLayer",i)}setDependencies(t,i,a){const u=this._tiles[t];u&&u.setDependencies(i,a)}reloadTilesForDependencies(t,i){for(const a in this._tiles)this._tiles[a].hasDependency(t,i)&&this._reloadTile(+a,"reloading");this._cache.filter(a=>!a.hasDependency(t,i))}_preloadTiles(t,i){if(!this._sourceLoaded){const y=()=>{this._sourceLoaded&&(this._source.off("data",y),this._preloadTiles(t,i))};return void this._source.on("data",y)}const a=new Map,u=Array.isArray(t)?t:[t],p=this.map.painter.terrain,g=this.usedForTerrain&&p?p.getScaledDemTileSize():this._source.tileSize;for(const y of u){const w=y.coveringTiles({tileSize:g,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!this.usedForTerrain,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain});for(const b of w)a.set(b.key,b);this.usedForTerrain&&y.updateElevation(!1)}Bt(Array.from(a.values()),(y,w)=>{const b=new l0(y,this._source.tileSize*y.overscaleFactor(),this.transform.tileZoom,this.map.painter,this._isRaster);this._loadTile(b,A=>{this._source.type==="raster-dem"&&b.dem&&this._backfillDEM(b),w(A,b)})},i)}}function t2(r,t){const i=Math.abs(2*r.wrap)-+(r.wrap<0),a=Math.abs(2*t.wrap)-+(t.wrap<0);return r.overscaledZ-t.overscaledZ||a-i||t.canonical.y-r.canonical.y||t.canonical.x-r.canonical.x}function n2(r){return r==="raster"||r==="image"||r==="video"||r==="custom"}function Zd(r,t){const i=1<=0&&I[3]>=0&&w.insert(y,I[0],I[1],I[2],I[3])}}loadVTLayers(){if(!this.vtLayers){this.vtLayers=new Wy(new ym(this.rawTileData)).layers,this.sourceLayerCoder=new Vb(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]),this.vtFeatures={};for(const t in this.vtLayers)this.vtFeatures[t]=[]}return this.vtLayers}query(t,i,a,u){this.loadVTLayers();const p=t.params||{},g=Jc(p.filter),y=t.tileResult,w=t.transform,b=y.bufferedTilespaceBounds,A=this.grid.query(b.min.x,b.min.y,b.max.x,b.max.y,(R,F,$,K)=>Iw(y.bufferedTilespaceGeometry,R,F,$,K));A.sort(MP);let I=null;w.elevation&&A.length>0&&(I=zm.create(w.elevation,this.tileID));const M={};let L;for(let R=0;R(K||(K=Vs(se,this.tileID.canonical,t.tileTransform)),Y.queryIntersectsFeature(y,se,re,K,this.z,t.transform,t.pixelPosMatrix,I,ue)))}return M}loadMatchingFeature(t,i,a,u,p,g,y,w,b){const{featureIndex:A,bucketIndex:I,sourceLayerIndex:M,layoutVertexArrayOffset:L}=i,R=this.bucketLayerIDs[I];if(u&&!function(se,Y){for(let re=0;re=0)return!0;return!1}(u,R))return;const F=this.sourceLayerCoder.decode(M),$=this.vtLayers[F].feature(A);if(a.needGeometry){const se=Jl($,!0);if(!a.filter(new C(this.tileID.overscaledZ),se,this.tileID.canonical))return}else if(!a.filter(new C(this.tileID.overscaledZ),$))return;const K=this.getId($,F);for(let se=0;se{const y=t instanceof X?t.get(g):null;return y&&y.evaluate?y.evaluate(i,a,u):y})}function MP(r,t){return t-r}dt(r2,"FeatureIndex",{omit:["rawTileData","sourceLayerCoder"]});class o2{constructor(t,i){this.width=t,this.height=i,this.nextRow=0,this.image=new $s({width:t,height:i}),this.positions={},this.uploaded=!1}getDash(t,i){const a=this.getKey(t,i);return this.positions[a]}trim(){const t=this.width,i=this.height=br(this.nextRow);this.image.resize({width:t,height:i})}getKey(t,i){return t.join(",")+i}getDashRanges(t,i,a){const u=[];let p=t.length%2==1?-t[t.length-1]*a:0,g=t[0]*a,y=!0;u.push({left:p,right:g,isDash:y,zeroLength:t[0]===0});let w=t[0];for(let b=1;b1&&(w=t[++y]);const A=Math.abs(b-w.left),I=Math.abs(b-w.right),M=Math.min(A,I);let L;const R=p/a*(u+1);if(w.isDash){const F=u-Math.abs(R);L=Math.sqrt(M*M+F*F)}else L=u-Math.sqrt(M*M+R*R);this.image.data[g+b]=Math.max(0,Math.min(255,L+128))}}}addRegularDash(t,i){for(let w=t.length-1;w>=0;--w){const b=t[w],A=t[w+1];b.zeroLength?t.splice(w,1):A&&A.isDash===b.isDash&&(A.left=b.left,t.splice(w,1))}const a=t[0],u=t[t.length-1];a.isDash===u.isDash&&(a.left=u.left-this.width,u.right=a.right+this.width);const p=this.width*this.nextRow;let g=0,y=t[g];for(let w=0;w1&&(y=t[++g]);const b=Math.abs(w-y.left),A=Math.abs(w-y.right),I=Math.min(b,A);this.image.data[p+w]=Math.max(0,Math.min(255,(y.isDash?I:-I)+i+128))}}addDash(t,i){const a=this.getKey(t,i);if(this.positions[a])return this.positions[a];const u=i==="round",p=u?7:0,g=2*p+1;if(this.nextRow+g>this.height)return wn("LineAtlas out of space"),null;t.length===0&&t.push(1);let y=0;for(let A=0;A=Ue.maxzoom||Ue.visibility!=="none"&&(p0(Me,this.zoom,a),(w[Ue.id]=Ue.createBucket({index:y.bucketLayerIDs.length,layers:Me,zoom:this.zoom,canonical:this.canonical,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:De,sourceID:this.source,enableTerrain:this.enableTerrain,projection:this.projection.spec,availableImages:a})).populate(Ze,A,this.tileID.canonical,this.tileTransform),y.bucketLayerIDs.push(Me.map(je=>je.id)))}}let M,L,R,F;b.trim();const $={type:"maybePrepare",isSymbolTile:this.isSymbolTile,zoom:this.zoom},K=()=>{if(M)return p(M);if(L&&R&&F){const ue=new a2(L),ce=new fb(R,F);for(const Ie in w){const Te=w[Ie];Te instanceof Oa?(p0(Te.layers,this.zoom,a),rP(Te,L,ue.positions,R,ce.iconPositions,this.showCollisionBoxes,a,this.tileID.canonical,this.tileZoom,this.projection)):Te.hasPattern&&(Te instanceof mm||Te instanceof um||Te instanceof Dd)&&(p0(Te.layers,this.zoom,a),Te.addFeatures(A,this.tileID.canonical,ce.patternPositions,a,this.tileTransform))}this.status="done",p(null,{buckets:dn(w).filter(Ie=>!Ie.isEmpty()),featureIndex:y,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:ue.image,lineAtlas:b,imageAtlas:ce,glyphMap:this.returnDependencies?L:null,iconMap:this.returnDependencies?R:null,glyphPositions:this.returnDependencies?ue.positions:null})}},se=kt(A.glyphDependencies,ue=>Object.keys(ue).map(Number));Object.keys(se).length?u.send("getGlyphs",{uid:this.uid,stacks:se},(ue,ce)=>{M||(M=ue,L=ce,K())},void 0,!1,$):L={};const Y=Object.keys(A.iconDependencies);Y.length?u.send("getImages",{icons:Y,source:this.source,tileID:this.tileID,type:"icons"},(ue,ce)=>{M||(M=ue,R=ce,K())},void 0,!1,$):R={};const re=Object.keys(A.patternDependencies);re.length?u.send("getImages",{icons:re,source:this.source,tileID:this.tileID,type:"patterns"},(ue,ce)=>{M||(M=ue,F=ce,K())},void 0,!1,$):F={},K()}}function p0(r,t,i){const a=new C(t);for(const u of r)u.recalculate(a,i)}class l2{constructor(t){this.entries={},this.scheduler=t}request(t,i,a,u){const p=this.entries[t]=this.entries[t]||{callbacks:[]};if(p.result){const[g,y]=p.result;return this.scheduler?this.scheduler.add(()=>{u(g,y)},i):u(g,y),()=>{}}return p.callbacks.push(u),p.cancel||(p.cancel=a((g,y)=>{p.result=[g,y];for(const w of p.callbacks)this.scheduler?this.scheduler.add(()=>{w(g,y)},i):w(g,y);setTimeout(()=>delete this.entries[t],3e3)})),()=>{p.result||(p.callbacks=p.callbacks.filter(g=>g!==u),p.callbacks.length||(p.cancel(),delete this.entries[t]))}}}function c2(r,t,i){const a=JSON.stringify(r.request);return r.data&&(this.deduped.entries[a]={result:[null,r.data]}),this.deduped.request(a,{type:"parseTile",isSymbolTile:r.isSymbolTile,zoom:r.tileZoom},u=>{const p=ua(r.request,(g,y,w,b)=>{g?u(g):y&&u(null,{vectorTile:i?void 0:new Wy(new ym(y)),rawData:y,cacheControl:w,expires:b})});return()=>{p.cancel(),u()}},t)}const u2=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class f0{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[i,a]=new Uint8Array(t,0,2);if(i!==219)throw new Error("Data does not appear to be in a KDBush format.");const u=a>>4;if(u!==1)throw new Error(`Got v${u} data when expected v1.`);const p=u2[15&a];if(!p)throw new Error("Unrecognized array type.");const[g]=new Uint16Array(t,2,1),[y]=new Uint32Array(t,4,1);return new f0(y,g,p,t)}constructor(t,i=64,a=Float64Array,u){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+i,2),65535),this.ArrayType=a,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const p=u2.indexOf(this.ArrayType),g=2*t*this.ArrayType.BYTES_PER_ELEMENT,y=t*this.IndexArrayType.BYTES_PER_ELEMENT,w=(8-y%8)%8;if(p<0)throw new Error(`Unexpected typed array class: ${a}.`);u&&u instanceof ArrayBuffer?(this.data=u,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+y+w,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+g+y+w),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+y+w,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+p]),new Uint16Array(this.data,2,1)[0]=i,new Uint32Array(this.data,4,1)[0]=t)}add(t,i){const a=this._pos>>1;return this.ids[a]=a,this.coords[this._pos++]=t,this.coords[this._pos++]=i,a}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return m0(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,i,a,u){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:p,coords:g,nodeSize:y}=this,w=[0,p.length-1,0],b=[];for(;w.length;){const A=w.pop()||0,I=w.pop()||0,M=w.pop()||0;if(I-M<=y){for(let $=M;$<=I;$++){const K=g[2*$],se=g[2*$+1];K>=t&&K<=a&&se>=i&&se<=u&&b.push(p[$])}continue}const L=M+I>>1,R=g[2*L],F=g[2*L+1];R>=t&&R<=a&&F>=i&&F<=u&&b.push(p[L]),(A===0?t<=R:i<=F)&&(w.push(M),w.push(L-1),w.push(1-A)),(A===0?a>=R:u>=F)&&(w.push(L+1),w.push(I),w.push(1-A))}return b}within(t,i,a){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:u,coords:p,nodeSize:g}=this,y=[0,u.length-1,0],w=[],b=a*a;for(;y.length;){const A=y.pop()||0,I=y.pop()||0,M=y.pop()||0;if(I-M<=g){for(let $=M;$<=I;$++)d2(p[2*$],p[2*$+1],t,i)<=b&&w.push(u[$]);continue}const L=M+I>>1,R=p[2*L],F=p[2*L+1];d2(R,F,t,i)<=b&&w.push(u[L]),(A===0?t-a<=R:i-a<=F)&&(y.push(M),y.push(L-1),y.push(1-A)),(A===0?t+a>=R:i+a>=F)&&(y.push(L+1),y.push(I),y.push(1-A))}return w}}function m0(r,t,i,a,u,p){if(u-a<=i)return;const g=a+u>>1;h2(r,t,g,a,u,p),m0(r,t,i,a,g-1,1-p),m0(r,t,i,g+1,u,1-p)}function h2(r,t,i,a,u,p){for(;u>a;){if(u-a>600){const b=u-a+1,A=i-a+1,I=Math.log(b),M=.5*Math.exp(2*I/3),L=.5*Math.sqrt(I*M*(b-M)/b)*(A-b/2<0?-1:1);h2(r,t,i,Math.max(a,Math.floor(i-A*M/b+L)),Math.min(u,Math.floor(i+(b-A)*M/b+L)),p)}const g=t[2*i+p];let y=a,w=u;for(Hd(r,t,a,i),t[2*u+p]>g&&Hd(r,t,a,u);yg;)w--}t[2*a+p]===g?Hd(r,t,a,w):(w++,Hd(r,t,w,u)),w<=i&&(a=w+1),i<=w&&(u=w-1)}}function Hd(r,t,i,a){g0(r,i,a),g0(t,2*i,2*a),g0(t,2*i+1,2*a+1)}function g0(r,t,i){const a=r[t];r[t]=r[i],r[i]=a}function d2(r,t,i,a){const u=r-i,p=t-a;return u*u+p*p}s.ARRAY_TYPE=xi,s.AUTH_ERR_MSG=he,s.Aabb=Hr,s.Actor=class{constructor(r,t,i){this.target=r,this.parent=t,this.mapId=i,this.callbacks={},this.cancelCallbacks={},Yi(["receive"],this),this.target.addEventListener("message",this.receive,!1),this.globalScope=vo()?r:k,this.scheduler=new TP}send(r,t,i,a,u=!1,p){const g=Math.round(1e18*Math.random()).toString(36).substring(0,10);i&&(i.metadata=p,this.callbacks[g]=i);const y=aa(this.globalScope)?void 0:[];return this.target.postMessage({id:g,type:r,hasCallback:!!i,targetMapId:a,mustQueue:u,sourceMapId:this.mapId,data:Ia(t,y)},y),{cancel:()=>{i&&delete this.callbacks[g],this.target.postMessage({id:g,type:"",targetMapId:a,sourceMapId:this.mapId})}}}receive(r){const t=r.data,i=t.id;if(i&&(!t.targetMapId||this.mapId===t.targetMapId))if(t.type===""){const a=this.cancelCallbacks[i];delete this.cancelCallbacks[i],a&&a.cancel()}else if(t.mustQueue||vo()){const a=this.callbacks[i];this.cancelCallbacks[i]=this.scheduler.add(()=>this.processTask(i,t),a&&a.metadata||{type:"message"})}else this.processTask(i,t)}processTask(r,t){if(t.type===""){const i=this.callbacks[r];delete this.callbacks[r],i&&(t.error?i(Os(t.error)):i(null,Os(t.data)))}else{const i=aa(this.globalScope)?void 0:[],a=t.hasCallback?(p,g)=>{delete this.cancelCallbacks[r],this.target.postMessage({id:r,type:"",sourceMapId:this.mapId,error:p?Ia(p):null,data:Ia(g,i)},i)}:p=>{},u=Os(t.data);if(this.parent[t.type])this.parent[t.type](t.sourceMapId,u,a);else if(this.parent.getWorkerSource){const p=t.type.split(".");this.parent.getWorkerSource(t.sourceMapId,p[0],u.source)[p[1]](u,a)}else a(new Error(`Could not find function ${t.type}`))}}remove(){this.scheduler.remove(),this.target.removeEventListener("message",this.receive,!1)}},s.CanonicalTileID=fm,s.Color=Fn,s.ColorMode=hs,s.CullFaceMode=Fo,s.DEMData=Pm,s.DataConstantProperty=B,s.DedupedRequest=l2,s.DepthMode=Eu,s.EXTENT=vt,s.Elevation=class{isDataAvailableAtPoint(r){const t=this._source();if(this.isUsingMockSource()||!t||r.y<0||r.y>1)return!1;const i=t.getSource().maxzoom,a=1<1)return t;const u=a.getSource().maxzoom,p=1<{const p=this.getAtTileOffset(r,u.x,u.y),g=a.upVector(r.canonical,u.x,u.y);return Bi(g,g,p*a.upVectorScale(r.canonical,t,i).metersToTile),g}}getForTilePoints(r,t,i,a){if(this.isUsingMockSource())return!1;const u=zm.create(this,r,a);return!!u&&(t.forEach(p=>{p[2]=this.exaggeration()*u.getElevationAt(p[0],p[1],i)}),!0)}getMinMaxForTile(r){if(this.isUsingMockSource())return null;const t=this.findDEMTileFor(r);if(!t||!t.dem)return null;const i=t.dem.tree,a=t.tileID,u=1<{let M=b===p-1?b-2:b===0?b:b-1;return M+=I?24575:0,[M,A]};for(let b=0;bthis._skuTokenExpiresAt}transformRequest(r,t){return this._transformRequestFn&&this._transformRequestFn(r,t)||{url:r}}normalizeStyleURL(r,t){if(!_e(r))return r;const i=rt(r);return i.path=`/styles/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||t)}normalizeGlyphsURL(r,t){if(!_e(r))return r;const i=rt(r);return i.path=`/fonts/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||t)}normalizeSourceURL(r,t,i,a){if(!_e(r))return r;const u=rt(r);return u.path=`/v4/${u.authority}.json`,u.params.push("secure"),i&&u.params.push(`language=${i}`),a&&u.params.push(`worldview=${a}`),this._makeAPIURL(u,this._customAccessToken||t)}normalizeSpriteURL(r,t,i,a){const u=rt(r);return _e(r)?(u.path=`/styles/v1${u.path}/sprite${t}${i}`,this._makeAPIURL(u,this._customAccessToken||a)):(u.path+=`${t}${i}`,Qe(u))}normalizeTileURL(r,t,i){if(this._isSkuTokenExpired()&&this._createSkuToken(),r&&!_e(r))return r;const a=rt(r);a.path=a.path.replace(/(\.(png|jpg)\d*)(?=$)/,`${t||i&&a.authority!=="raster"&&i===512?"@2x":""}${J.supported?".webp":"$1"}`),a.authority==="raster"?a.path=`/${G.RASTER_URL_PREFIX}${a.path}`:(a.path=a.path.replace(/^.+\/v4\//,"/"),a.path=`/${G.TILE_URL_VERSION}${a.path}`);const u=this._customAccessToken||function(p){for(const g of p){const y=g.match(/^access_token=(.*)$/);if(y)return y[1]}return null}(a.params)||G.ACCESS_TOKEN;return G.REQUIRE_ACCESS_TOKEN&&u&&this._skuToken&&a.params.push(`sku=${this._skuToken}`),this._makeAPIURL(a,u)}canonicalizeTileURL(r,t){const i=rt(r);if(!i.path.match(/^(\/v4\/|\/raster\/v1\/)/)||!i.path.match(/\.[\w]+$/))return r;let a="mapbox://";i.path.match(/^\/raster\/v1\//)?a+=`raster/${i.path.replace(`/${G.RASTER_URL_PREFIX}/`,"")}`:a+=`tiles/${i.path.replace(`/${G.TILE_URL_VERSION}/`,"")}`;let u=i.params;return t&&(u=u.filter(p=>!p.match(/^access_token=/))),u.length&&(a+=`?${u.join("&")}`),a}canonicalizeTileset(r,t){const i=!!t&&_e(t),a=[];for(const u of r.tiles||[])be(u)?a.push(this.canonicalizeTileURL(u,i)):a.push(u);return a}_makeAPIURL(r,t){const i="See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes",a=rt(G.API_URL);if(r.protocol=a.protocol,r.authority=a.authority,r.protocol==="http"){const u=r.params.indexOf("secure");u>=0&&r.params.splice(u,1)}if(a.path!=="/"&&(r.path=`${a.path}${r.path}`),!G.REQUIRE_ACCESS_TOKEN)return Qe(r);if(t=t||G.ACCESS_TOKEN,!this._silenceAuthErrors){if(!t)throw new Error(`An API access token is required to use Mapbox GL. ${i}`);if(t[0]==="s")throw new Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${i}`)}return r.params=r.params.filter(u=>u.indexOf("access_token")===-1),r.params.push(`access_token=${t||""}`),Qe(r)}},s.ResourceType=Ss,s.SegmentVector=qn,s.SourceCache=nc,s.StencilMode=u0,s.StructArrayLayout1ui2=vi,s.StructArrayLayout2f1f2i16=wt,s.StructArrayLayout2i4=We,s.StructArrayLayout2ui4=fr,s.StructArrayLayout3f12=Ot,s.StructArrayLayout3ui6=mt,s.StructArrayLayout4i8=Fe,s.StructArrayLayout5f20=sn,s.Texture=Wd,s.Tile=l0,s.Transitionable=O,s.Uniform1f=Yf,s.Uniform1i=class extends Ns{constructor(r){super(r),this.current=0}set(r,t,i){this.fetchUniformLocation(r,t)&&this.current!==i&&(this.current=i,this.gl.uniform1i(this.location,i))}},s.Uniform2f=class extends Ns{constructor(r){super(r),this.current=[0,0]}set(r,t,i){this.fetchUniformLocation(r,t)&&(i[0]===this.current[0]&&i[1]===this.current[1]||(this.current=i,this.gl.uniform2f(this.location,i[0],i[1])))}},s.Uniform3f=class extends Ns{constructor(r){super(r),this.current=[0,0,0]}set(r,t,i){this.fetchUniformLocation(r,t)&&(i[0]===this.current[0]&&i[1]===this.current[1]&&i[2]===this.current[2]||(this.current=i,this.gl.uniform3f(this.location,i[0],i[1],i[2])))}},s.Uniform4f=Wx,s.UniformColor=Zx,s.UniformMatrix2f=class extends Ns{constructor(r){super(r),this.current=lk}set(r,t,i){if(this.fetchUniformLocation(r,t)){for(let a=0;a<4;a++)if(i[a]!==this.current[a]){this.current=i,this.gl.uniformMatrix2fv(this.location,!1,i);break}}}},s.UniformMatrix3f=class extends Ns{constructor(r){super(r),this.current=ak}set(r,t,i){if(this.fetchUniformLocation(r,t)){for(let a=0;a<9;a++)if(i[a]!==this.current[a]){this.current=i,this.gl.uniformMatrix3fv(this.location,!1,i);break}}}},s.UniformMatrix4f=class extends Ns{constructor(r){super(r),this.current=sk}set(r,t,i){if(this.fetchUniformLocation(r,t)){if(i[12]!==this.current[12]||i[0]!==this.current[0])return this.current=i,void this.gl.uniformMatrix4fv(this.location,!1,i);for(let a=1;a<16;a++)if(i[a]!==this.current[a]){this.current=i,this.gl.uniformMatrix4fv(this.location,!1,i);break}}}},s.UnwrappedTileID=Qw,s.ValidationError=ct,s.VectorTileFeature=dm,s.VectorTileWorkerSource=class extends vl{constructor(r,t,i,a,u){super(),this.actor=r,this.layerIndex=t,this.availableImages=i,this.loadVectorData=u||c2,this.loading={},this.loaded={},this.deduped=new l2(r.scheduler),this.isSpriteLoaded=a,this.scheduler=r.scheduler}loadTile(r,t){const i=r.uid,a=r&&r.request,u=a&&a.collectResourceTiming,p=this.loading[i]=new PP(r);p.abort=this.loadVectorData(r,(g,y)=>{const w=!this.loading[i];if(delete this.loading[i],w||g||!y)return p.status="done",w||(this.loaded[i]=p),t(g);const b=y.rawData,A={};y.expires&&(A.expires=y.expires),y.cacheControl&&(A.cacheControl=y.cacheControl),p.vectorTile=y.vectorTile||new Wy(new ym(b));const I=()=>{p.parse(p.vectorTile,this.layerIndex,this.availableImages,this.actor,(M,L)=>{if(M||!L)return t(M);const R={};if(u){const F=wh(a);F.length>0&&(R.resourceTiming=JSON.parse(JSON.stringify(F)))}t(null,vn({rawTileData:b.slice(0)},L,A,R))})};this.isSpriteLoaded?I():this.once("isSpriteLoaded",()=>{this.scheduler?this.scheduler.add(I,{type:"parseTile",isSymbolTile:r.isSymbolTile,zoom:r.tileZoom}):I()}),this.loaded=this.loaded||{},this.loaded[i]=p})}reloadTile(r,t){const i=this.loaded,a=r.uid,u=this;if(i&&i[a]){const p=i[a];p.showCollisionBoxes=r.showCollisionBoxes,p.enableTerrain=!!r.enableTerrain,p.projection=r.projection,p.tileTransform=tc(r.tileID.canonical,r.projection);const g=(y,w)=>{const b=p.reloadCallback;b&&(delete p.reloadCallback,p.parse(p.vectorTile,u.layerIndex,this.availableImages,u.actor,b)),t(y,w)};p.status==="parsing"?p.reloadCallback=g:p.status==="done"&&(p.vectorTile?p.parse(p.vectorTile,this.layerIndex,this.availableImages,this.actor,g):g())}}abortTile(r,t){const i=r.uid,a=this.loading[i];a&&(a.abort&&a.abort(),delete this.loading[i]),t()}removeTile(r,t){const i=this.loaded,a=r.uid;i&&i[a]&&delete i[a],t()}},s.WritingMode=Ni,s.ZoomDependentExpression=Bl,s.add=js,s.addDynamicAttributes=Im,s.adjoint=function(r,t){var i=t[0],a=t[1],u=t[2],p=t[3],g=t[4],y=t[5],w=t[6],b=t[7],A=t[8];return r[0]=g*A-y*b,r[1]=u*b-a*A,r[2]=a*y-u*g,r[3]=y*w-p*A,r[4]=i*A-u*w,r[5]=u*p-i*y,r[6]=p*b-g*w,r[7]=a*w-i*b,r[8]=i*g-a*p,r},s.asyncAll=Bt,s.bezier=Li,s.bindAll=Yi,s.boundsAttributes=qb,s.bufferConvexPolygon=function(r,t){const i=[];for(let a=0;aAc&&(r.getActor().send("enforceCacheSizeLimit",Sc),_l=0)},s.calculateGlobeLabelMatrix=function(r,t){const{x:i,y:a}=r.point,u=gw(i,a,r.worldSize/r._pixelsPerMercatorPixel,0,0);return Zl(u,u,Cy(ss(t)))},s.calculateGlobeMatrix=function(r){const{x:t,y:i}=r.point,{lng:a,lat:u}=r._center;return gw(t,i,r.worldSize,a,u)},s.calculateGlobeMercatorMatrix=function(r){const t=r.pixelsPerMeter,i=t/Do(1,r.center.lat),a=Lo(new Float64Array(16));return yd(a,a,[r.point.x,r.point.y,0]),Hl(a,a,[i,i,t]),Float32Array.from(a)},s.circumferenceAtLatitude=ky,s.clamp=Je,s.clearTileCache=function(r){if(!gl())return;const t=k.caches.delete(la);r&&t.catch(r).then(()=>r())},s.clipLine=Cb,s.clone=function(r){var t=new xi(16);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],t},s.clone$1=Dr,s.collisionCircleLayout=kM,s.config=G,s.conjugate=function(r,t){return r[0]=-t[0],r[1]=-t[1],r[2]=-t[2],r[3]=t[3],r},s.create=function(){var r=new xi(16);return xi!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=0,r[12]=0,r[13]=0,r[14]=0),r[0]=1,r[5]=1,r[10]=1,r[15]=1,r},s.create$1=Kx,s.createExpression=Sa,s.createLayout=ye,s.createStyleLayer=function(r){return r.type==="custom"?new xP(r):new bP[r.type](r)},s.cross=xy,s.degToRad=St,s.distance=function(r,t){return Math.hypot(t[0]-r[0],t[1]-r[1],t[2]-r[2])},s.div=function(r,t,i){return r[0]=t[0]/i[0],r[1]=t[1]/i[1],r[2]=t[2]/i[2],r},s.dot=oo,s.earthRadius=Id,s.ease=Ki,s.easeCubicInOut=$r,s.ecefToLatLng=function([r,t,i]){const a=Math.hypot(r,t,i),u=Math.atan2(r,i),p=.5*Math.PI-Math.acos(-t/a);return new ln(Vt(u),Vt(p))},s.emitValidationErrors=qf,s.endsWith=xn,s.enforceCacheSizeLimit=function(r){Ts(),fi&&fi.then(t=>{t.keys().then(i=>{for(let a=0;ap&&(a+=(r[u]-p)*(r[u]-p)),t[u]0){const R=180/a;Yx(L,L,[R/b+1,0,0,0,R/A+1,0,-.5*R/I,.5*R/M,1])}return L[2]=w,L[5]=r.x,L[8]=r.y,L},s.getImage=ne,s.getJSON=function(r,t){return Cs(vn(r,{type:"json"}),t)},s.getLatitudinalLod=function(r){const t=zr-5;r=Je(r,-t,t)/t*90;const i=Math.pow(Math.abs(Math.sin(St(r))),3);return Math.round(i*(Sd.length-1))},s.getMapSessionAPI=hr,s.getPerformanceMeasurement=wh,s.getProjection=Ub,s.getRTLTextPluginStatus=x,s.getReferrer=As,s.getTilePoint=function(r,{x:t,y:i},a=0){return new Ve(((t-a)*r.scale-r.x)*vt,(i*r.scale-r.y)*vt)},s.getTileVec3=function(r,t,i=0){return ou(((t.x-i)*r.scale-r.x)*vt,(t.y*r.scale-r.y)*vt,xw(t.z,t.y))},s.getVideo=function(r,t){const i=k.document.createElement("video");i.muted=!0,i.onloadstart=function(){t(null,i)};for(let a=0;a{}}},s.globeCenterToScreenPoint=function(r){const t=[0,0,0],i=Lo(new Float64Array(16));return Zl(i,r.pixelMatrix,r.globeMatrix),Nn(t,t,i),new Ve(t[0],t[1])},s.globeDenormalizeECEF=Cy,s.globeECEFOrigin=function(r,t){const i=[0,0,0];return Nn(i,i,Cd(ss(t.canonical))),Nn(i,i,r),i},s.globeMetersToEcef=em,s.globeNormalizeECEF=Cd,s.globePixelsToTileUnits=function(r,t){return vt/(512*Math.pow(2,r))*nm(ss(t))},s.globePoleMatrixForTile=function(r,t,i){const a=Lo(new Float64Array(16)),u=(t/(1<0;return a===0&&!u&&!g&&p},s.identity=Lo,s.identity$1=sw,s.invert=gy,s.isFullscreen=function(){return!!k.document.fullscreenElement||!!k.document.webkitFullscreenElement},s.isLngLatBehindGlobe=Iy,s.isMapAuthenticated=function(r){return Or.has(r)},s.isMapboxURL=_e,s.isSafariWithAntialiasingBug=function(r){const t=r.navigator?r.navigator.userAgent:null;return!!aa(r)&&t&&(t.match("Version/15.4")||t.match("Version/15.5")||t.match(/CPU (OS|iPhone OS) (15_4|15_5) like Mac OS X/))},s.latFromMercatorY=Pr,s.latLngToECEF=au,s.len=_k,s.length=vd,s.length$1=function(r){return Math.hypot(r[0],r[1],r[2],r[3])},s.lngFromMercatorX=Fi,s.loadVectorTile=c2,s.makeRequest=Cs,s.mapValue=function(r,t,i,a,u){return Je((r-t)/(i-t)*(u-a)+a,a,u)},s.mercatorScale=ww,s.mercatorXfromLng=as,s.mercatorYfromLat=ls,s.mercatorZfromAltitude=Do,s.mul=mk,s.mul$1=gk,s.multiply=Zl,s.multiply$1=Yx,s.multiply$2=tw,s.nextPowerOfTwo=br,s.normalize=Zr,s.normalize$1=yk,s.normalize$2=iw,s.number=Wt,s.ortho=function(r,t,i,a,u,p,g){var y=1/(t-i),w=1/(a-u),b=1/(p-g);return r[0]=-2*y,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*w,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=2*b,r[11]=0,r[12]=(t+i)*y,r[13]=(u+a)*w,r[14]=(g+p)*b,r[15]=1,r},s.pbf=sb,s.perspective=function(r,t,i,a,u){var p,g=1/Math.tan(t/2);return r[0]=g/i,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=g,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=-1,r[12]=0,r[13]=0,r[15]=0,u!=null&&u!==1/0?(r[10]=(u+a)*(p=1/(a-u)),r[14]=2*u*a*p):(r[10]=-1,r[14]=-2*a),r},s.pick=function(r,t){const i={};for(let a=0;a0&&i[0]<=r.width&&i[1]>0&&i[1]<=r.height&&!Iy(r,new ln(r.center.lat,90)),a[0]>0&&a[0]<=r.width&&a[1]>0&&a[1]<=r.height&&!Iy(r,new ln(r.center.lat,-90))]},s.polygonContainsPoint=Ql,s.polygonIntersectsBox=Iw,s.polygonIntersectsPolygon=Tw,s.polygonizeBounds=function(r,t,i=0,a=!0){const u=new Ve(i,i),p=r.sub(u),g=t.add(u),y=[p,new Ve(g.x,p.y),g,new Ve(p.x,g.y)];return a&&y.push(p.clone()),y},s.posAttributes=Td,s.postMapLoadEvent=Vn,s.postPerformanceEvent=tr,s.postTurnstileEvent=Gt,s.potpack=Ky,s.prevPowerOfTwo=function(r){return r<=1?1:Math.pow(2,Math.floor(Math.log(r)/Math.LN2))},s.radToDeg=Vt,s.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],s.registerForPluginStateChange=function(r){return r({pluginStatus:d,pluginURL:o}),_.on("pluginStateChange",r),r},s.removeAuthState=function(r){Or.delete(r)},s.renderColorRamp=By,s.resample=bw,s.rotateX=_y,s.rotateX$1=aw,s.rotateY=Qf,s.rotateY$1=lw,s.rotateZ=function(r,t,i){var a=Math.sin(i),u=Math.cos(i),p=t[0],g=t[1],y=t[2],w=t[3],b=t[4],A=t[5],I=t[6],M=t[7];return t!==r&&(r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r[0]=p*u+b*a,r[1]=g*u+A*a,r[2]=y*u+I*a,r[3]=w*u+M*a,r[4]=b*u-p*a,r[5]=A*u-g*a,r[6]=I*u-y*a,r[7]=M*u-w*a,r},s.rotateZ$1=function(r,t,i){i*=.5;var a=t[0],u=t[1],p=t[2],g=t[3],y=Math.sin(i),w=Math.cos(i);return r[0]=a*w+u*y,r[1]=u*w-a*y,r[2]=p*w+g*y,r[3]=g*w-p*y,r},s.scale=Hl,s.scale$1=rw,s.scale$2=Bi,s.scaleAndAdd=bd,s.set=function(r,t,i,a){return r[0]=t,r[1]=i,r[2]=a,r},s.setCacheLimits=function(r,t){Sc=r,Ac=t},s.setColumn=function(r,t,i){r[4*t+0]=i[0],r[4*t+1]=i[1],r[4*t+2]=i[2],r[4*t+3]=i[3]},s.setRTLTextPlugin=function(r,t,i=!1){if(d===pd||d===fd||d===md)throw new Error("setRTLTextPlugin cannot be called multiple times.");o=xo.resolveURL(r),d=pd,ka=t,f(),i||T()},s.smoothstep=Tt,s.spec=Re,s.squaredLength=function(r){var t=r[0],i=r[1],a=r[2];return t*t+i*i+a*a},s.storeAuthState=function(r,t){t?Or.add(r):Or.delete(r)},s.sub=Ro,s.subtract=vy,s.symbolSize=MM,s.tileAABB=function(r,t,i,a,u,p,g,y,w){if(w.name==="globe")return Ek(r,t,new fm(i,a,u));const b=tc({z:i,x:a,y:u},w);return new Hr([(p+b.x/b.scale)*t,t*(b.y/b.scale),g],[(p+b.x2/b.scale)*t,t*(b.y2/b.scale),y])},s.tileCornersToBounds=tm,s.tileTransform=tc,s.transformMat3=function(r,t,i){var a=t[0],u=t[1],p=t[2];return r[0]=a*i[0]+u*i[3]+p*i[6],r[1]=a*i[1]+u*i[4]+p*i[7],r[2]=a*i[2]+u*i[5]+p*i[8],r},s.transformMat4=Nn,s.transformMat4$1=Xl,s.transformQuat=nw,s.transitionTileAABBinECEF=pw,s.translate=yd,s.transpose=function(r,t){if(r===t){var i=t[1],a=t[2],u=t[5];r[1]=t[3],r[2]=t[6],r[3]=i,r[5]=t[7],r[6]=a,r[7]=u}else r[0]=t[0],r[1]=t[3],r[2]=t[6],r[3]=t[1],r[4]=t[4],r[5]=t[7],r[6]=t[2],r[7]=t[5],r[8]=t[8];return r},s.triggerPluginCompletionEvent=c,s.uniqueId=ii,s.updateGlobeVertexNormal=function(r,t,i,a,u){const p=5*t+2;r.float32[p+0]=i,r.float32[p+1]=a,r.float32[p+2]=u},s.validateCustomStyleLayer=function(r){const t=[],i=r.id;return i===void 0&&t.push({message:`layers.${i}: missing required property "id"`}),r.render===void 0&&t.push({message:`layers.${i}: missing required method "render"`}),r.renderingMode&&r.renderingMode!=="2d"&&r.renderingMode!=="3d"&&t.push({message:`layers.${i}: property "renderingMode" must be either "2d" or "3d"`}),t},s.validateFilter=r=>yi(Vl(r)),s.validateFog=r=>yi(Vf(r)),s.validateLayer=r=>yi(Ff(r)),s.validateLight=r=>yi(jf(r)),s.validateSource=r=>yi(Uf(r)),s.validateStyle=Gf,s.validateTerrain=r=>yi(ld(r)),s.values=dn,s.vectorTile=hm,s.version=D,s.warnOnce=wn,s.window=k,s.wrap=xt}),v(["./shared"],function(s){function k(oe){if(typeof oe=="number"||typeof oe=="boolean"||typeof oe=="string"||oe==null)return JSON.stringify(oe);if(Array.isArray(oe)){let U="[";for(const ne of oe)U+=`${k(ne)},`;return`${U}]`}let N="{";for(const U of Object.keys(oe).sort())N+=`${U}:${k(oe[U])},`;return`${N}}`}function D(oe){let N="";for(const U of s.refProperties)N+=`/${k(oe[U])}`;return N}class V{constructor(N){this.keyCache={},N&&this.replace(N)}replace(N){this._layerConfigs={},this._layers={},this.update(N,[])}update(N,U){for(const he of N)this._layerConfigs[he.id]=he,(this._layers[he.id]=s.createStyleLayer(he)).compileFilter(),this.keyCache[he.id]&&delete this.keyCache[he.id];for(const he of U)delete this.keyCache[he],delete this._layerConfigs[he],delete this._layers[he];this.familiesBySource={};const ne=function(he,_e){const be={};for(let ge=0;gethis._layers[rt.id]),be=_e[0];if(be.visibility==="none")continue;const we=be.source||"";let ge=this.familiesBySource[we];ge||(ge=this.familiesBySource[we]={});const Pe=be.sourceLayer||"_geojsonTileLayer";let nt=ge[Pe];nt||(nt=ge[Pe]=[]),nt.push(_e)}}}class G{loadTile(N,U){const{uid:ne,encoding:he,rawImageData:_e,padding:be,buildQuadTree:we}=N,ge=s.window.ImageBitmap&&_e instanceof s.window.ImageBitmap?this.getImageData(_e,be):_e;U(null,new s.DEMData(ne,ge,he,be<1,we))}getImageData(N,U){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(N.width,N.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=N.width,this.offscreenCanvas.height=N.height,this.offscreenCanvasContext.drawImage(N,0,0,N.width,N.height);const ne=this.offscreenCanvasContext.getImageData(-U,-U,N.width+2*U,N.height+2*U);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),ne}}function J(oe,N){if(oe.length!==0){ve(oe[0],N);for(var U=1;U=Math.abs(we)?U-ge+we:we-ge+U,U=ge}U+ne>=0!=!!N&&oe.reverse()}var ae=s.getDefaultExportFromCjs(function oe(N,U){var ne,he=N&&N.type;if(he==="FeatureCollection")for(ne=0;ne>31}function Vr(oe,N){for(var U=oe.loadGeometry(),ne=oe.type,he=0,_e=0,be=U.length,we=0;weoe},Je=Math.fround||(Tt=new Float32Array(1),oe=>(Tt[0]=+oe,Tt[0]));var Tt;const xt=3,Bt=5,dn=6;class vn{constructor(N){this.options=Object.assign(Object.create(Ki),N),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(N){const{log:U,minZoom:ne,maxZoom:he}=this.options;U&&console.time("total time");const _e=`prepare ${N.length} points`;U&&console.time(_e),this.points=N;const be=[];for(let ge=0;ge=ne;ge--){const Pe=+Date.now();we=this.trees[ge]=this._createTree(this._cluster(we,ge)),U&&console.log("z%d: %d clusters in %dms",ge,we.numItems,+Date.now()-Pe)}return U&&console.timeEnd("total time"),this}getClusters(N,U){let ne=((N[0]+180)%360+360)%360-180;const he=Math.max(-90,Math.min(90,N[1]));let _e=N[2]===180?180:((N[2]+180)%360+360)%360-180;const be=Math.max(-90,Math.min(90,N[3]));if(N[2]-N[0]>=360)ne=-180,_e=180;else if(ne>_e){const rt=this.getClusters([ne,he,180,be],U),Qe=this.getClusters([-180,he,_e,be],U);return rt.concat(Qe)}const we=this.trees[this._limitZoom(U)],ge=we.range(ar(ne),br(be),ar(_e),br(he)),Pe=we.data,nt=[];for(const rt of ge){const Qe=this.stride*rt;nt.push(Pe[Qe+Bt]>1?sr(Pe,Qe,this.clusterProps):this.points[Pe[Qe+xt]])}return nt}getChildren(N){const U=this._getOriginId(N),ne=this._getOriginZoom(N),he="No cluster with the specified id.",_e=this.trees[ne];if(!_e)throw new Error(he);const be=_e.data;if(U*this.stride>=be.length)throw new Error(he);const we=this.options.radius/(this.options.extent*Math.pow(2,ne-1)),ge=_e.within(be[U*this.stride],be[U*this.stride+1],we),Pe=[];for(const nt of ge){const rt=nt*this.stride;be[rt+4]===N&&Pe.push(be[rt+Bt]>1?sr(be,rt,this.clusterProps):this.points[be[rt+xt]])}if(Pe.length===0)throw new Error(he);return Pe}getLeaves(N,U,ne){const he=[];return this._appendLeaves(he,N,U=U||10,ne=ne||0,0),he}getTile(N,U,ne){const he=this.trees[this._limitZoom(N)],_e=Math.pow(2,N),{extent:be,radius:we}=this.options,ge=we/be,Pe=(ne-ge)/_e,nt=(ne+1+ge)/_e,rt={features:[]};return this._addTileFeatures(he.range((U-ge)/_e,Pe,(U+1+ge)/_e,nt),he.data,U,ne,_e,rt),U===0&&this._addTileFeatures(he.range(1-ge/_e,Pe,1,nt),he.data,_e,ne,_e,rt),U===_e-1&&this._addTileFeatures(he.range(0,Pe,ge/_e,nt),he.data,-1,ne,_e,rt),rt.features.length?rt:null}getClusterExpansionZoom(N){let U=this._getOriginZoom(N)-1;for(;U<=this.options.maxZoom;){const ne=this.getChildren(N);if(U++,ne.length!==1)break;N=ne[0].properties.cluster_id}return U}_appendLeaves(N,U,ne,he,_e){const be=this.getChildren(U);for(const we of be){const ge=we.properties;if(ge&&ge.cluster?_e+ge.point_count<=he?_e+=ge.point_count:_e=this._appendLeaves(N,ge.cluster_id,ne,he,_e):_e1;let nt,rt,Qe;if(Pe)nt=ii(U,ge,this.clusterProps),rt=U[ge],Qe=U[ge+1];else{const Pt=this.points[U[ge+xt]];nt=Pt.properties;const[Dt,Gt]=Pt.geometry.coordinates;rt=ar(Dt),Qe=br(Gt)}const Mt={type:1,geometry:[[Math.round(this.options.extent*(rt*_e-ne)),Math.round(this.options.extent*(Qe*_e-he))]],tags:nt};let Rt;Rt=Pe||this.options.generateId?U[ge+xt]:this.points[U[ge+xt]].id,Rt!==void 0&&(Mt.id=Rt),be.features.push(Mt)}}_limitZoom(N){return Math.max(this.options.minZoom,Math.min(Math.floor(+N),this.options.maxZoom+1))}_cluster(N,U){const{radius:ne,extent:he,reduce:_e,minPoints:be}=this.options,we=ne/(he*Math.pow(2,U)),ge=N.data,Pe=[],nt=this.stride;for(let rt=0;rtU&&(Dt+=ge[In+Bt])}if(Dt>Pt&&Dt>=be){let Gt,In=Qe*Pt,Vn=Mt*Pt,Ir=-1;const tr=((rt/nt|0)<<5)+(U+1)+this.points.length;for(const Ji of Rt){const hr=Ji*nt;if(ge[hr+2]<=U)continue;ge[hr+2]=U;const Or=ge[hr+Bt];In+=ge[hr]*Or,Vn+=ge[hr+1]*Or,ge[hr+4]=tr,_e&&(Gt||(Gt=this._map(ge,rt,!0),Ir=this.clusterProps.length,this.clusterProps.push(Gt)),_e(Gt,this._map(ge,hr)))}ge[rt+4]=tr,Pe.push(In/Dt,Vn/Dt,1/0,tr,-1,Dt),_e&&Pe.push(Ir)}else{for(let Gt=0;Gt1)for(const Gt of Rt){const In=Gt*nt;if(!(ge[In+2]<=U)){ge[In+2]=U;for(let Vn=0;Vn>5}_getOriginZoom(N){return(N-this.points.length)%32}_map(N,U,ne){if(N[U+Bt]>1){const be=this.clusterProps[N[U+dn]];return ne?Object.assign({},be):be}const he=this.points[N[U+xt]].properties,_e=this.options.map(he);return ne&&_e===he?Object.assign({},_e):_e}}function sr(oe,N,U){return{type:"Feature",id:oe[N+xt],properties:ii(oe,N,U),geometry:{type:"Point",coordinates:[(ne=oe[N],360*(ne-.5)),Es(oe[N+1])]}};var ne}function ii(oe,N,U){const ne=oe[N+Bt],he=ne>=1e4?`${Math.round(ne/1e3)}k`:ne>=1e3?Math.round(ne/100)/10+"k":ne,_e=oe[N+dn],be=_e===-1?{}:Object.assign({},U[_e]);return Object.assign(be,{cluster:!0,cluster_id:oe[N+xt],point_count:ne,point_count_abbreviated:he})}function ar(oe){return oe/360+.5}function br(oe){const N=Math.sin(oe*Math.PI/180),U=.5-.25*Math.log((1+N)/(1-N))/Math.PI;return U<0?0:U>1?1:U}function Es(oe){const N=(180-360*oe)*Math.PI/180;return 360*Math.atan(Math.exp(N))/Math.PI-90}function Yi(oe,N,U,ne){for(var he,_e=ne,be=U-N>>1,we=U-N,ge=oe[N],Pe=oe[N+1],nt=oe[U],rt=oe[U+1],Qe=N+3;Qe_e)he=Qe,_e=Mt;else if(Mt===_e){var Rt=Math.abs(Qe-be);Rtne&&(he-N>3&&Yi(oe,N,he,ne),oe[he+2]=_e,U-he>3&&Yi(oe,he,U,ne))}function xn(oe,N,U,ne,he,_e){var be=he-U,we=_e-ne;if(be!==0||we!==0){var ge=((oe-U)*be+(N-ne)*we)/(be*be+we*we);ge>1?(U=he,ne=_e):ge>0&&(U+=be*ge,ne+=we*ge)}return(be=oe-U)*be+(we=N-ne)*we}function kt(oe,N,U,ne){var he={id:oe===void 0?null:oe,type:N,geometry:U,tags:ne,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(_e){var be=_e.geometry,we=_e.type;if(we==="Point"||we==="MultiPoint"||we==="LineString")Yo(_e,be);else if(we==="Polygon"||we==="MultiLineString")for(var ge=0;ge0&&(be+=ne?(he*Pe-ge*_e)/2:Math.sqrt(Math.pow(ge-he,2)+Math.pow(Pe-_e,2))),he=ge,_e=Pe}var nt=N.length-3;N[2]=1,Yi(N,0,nt,U),N[nt+2]=1,N.size=Math.abs(be),N.start=0,N.end=N.size}function pi(oe,N,U,ne){for(var he=0;he1?1:U}function oi(oe,N,U,ne,he,_e,be,we){if(ne/=N,_e>=(U/=N)&&be=ne)return null;for(var ge=[],Pe=0;Pe=U&&Rt=ne)){var Pt=[];if(Qe==="Point"||Qe==="MultiPoint")fl(rt,Pt,U,ne,he);else if(Qe==="LineString")aa(rt,Pt,U,ne,he,!1,we.lineMetrics);else if(Qe==="MultiLineString")Qo(rt,Pt,U,ne,he,!1);else if(Qe==="Polygon")Qo(rt,Pt,U,ne,he,!0);else if(Qe==="MultiPolygon")for(var Dt=0;Dt=U&&be<=ne&&(N.push(oe[_e]),N.push(oe[_e+1]),N.push(oe[_e+2]))}}function aa(oe,N,U,ne,he,_e,be){for(var we,ge,Pe=ml(oe),nt=he===0?Sc:Ac,rt=oe.start,Qe=0;QeU&&(ge=nt(Pe,Mt,Rt,Dt,Gt,U),be&&(Pe.start=rt+we*ge)):In>ne?Vn=U&&(ge=nt(Pe,Mt,Rt,Dt,Gt,U),Ir=!0),Vn>ne&&In<=ne&&(ge=nt(Pe,Mt,Rt,Dt,Gt,ne),Ir=!0),!_e&&Ir&&(be&&(Pe.end=rt+we*ge),N.push(Pe),Pe=ml(oe)),be&&(rt+=we)}var tr=oe.length-3;Mt=oe[tr],Rt=oe[tr+1],Pt=oe[tr+2],(In=he===0?Mt:Rt)>=U&&In<=ne&&la(Pe,Mt,Rt,Pt),tr=Pe.length-3,_e&&tr>=3&&(Pe[tr]!==Pe[0]||Pe[tr+1]!==Pe[1])&&la(Pe,Pe[0],Pe[1],Pe[2]),Pe.length&&N.push(Pe)}function ml(oe){var N=[];return N.size=oe.size,N.start=oe.start,N.end=oe.end,N}function Qo(oe,N,U,ne,he,_e){for(var be=0;bebe.maxX&&(be.maxX=nt),rt>be.maxY&&(be.maxY=rt)}return be}function _l(oe,N,U,ne){var he=N.geometry,_e=N.type,be=[];if(_e==="Point"||_e==="MultiPoint")for(var we=0;we0&&N.size<(he?be:ne))U.numPoints+=N.length/3;else{for(var we=[],ge=0;gebe)&&(U.numSimplified++,we.push(N[ge]),we.push(N[ge+1])),U.numPoints++;he&&function(Pe,nt){for(var rt=0,Qe=0,Mt=Pe.length,Rt=Mt-2;Qe0===nt)for(Qe=0,Mt=Pe.length;Qe24)throw new Error("maxZoom should be in the 0-24 range");if(N.promoteId&&N.generateId)throw new Error("promoteId and generateId cannot be used together.");var ne=function(he,_e){var be=[];if(he.type==="FeatureCollection")for(var we=0;we1&&console.time("creation"),Qe=this.tiles[rt]=ca(oe,N,U,ne,ge),this.tileCoords.push({z:N,x:U,y:ne}),Pe)){Pe>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",N,U,ne,Qe.numFeatures,Qe.numPoints,Qe.numSimplified),console.timeEnd("creation"));var Mt="z"+N;this.stats[Mt]=(this.stats[Mt]||0)+1,this.total++}if(Qe.source=oe,he){if(N===ge.maxZoom||N===he)continue;var Rt=1<1&&console.time("clipping");var Pt,Dt,Gt,In,Vn,Ir,tr=.5*ge.buffer/ge.extent,Ji=.5-tr,hr=.5+tr,Or=1+tr;Pt=Dt=Gt=In=null,Vn=oi(oe,nt,U-tr,U+hr,0,Qe.minX,Qe.maxX,ge),Ir=oi(oe,nt,U+Ji,U+Or,0,Qe.minX,Qe.maxX,ge),oe=null,Vn&&(Pt=oi(Vn,nt,ne-tr,ne+hr,1,Qe.minY,Qe.maxY,ge),Dt=oi(Vn,nt,ne+Ji,ne+Or,1,Qe.minY,Qe.maxY,ge),Vn=null),Ir&&(Gt=oi(Ir,nt,ne-tr,ne+hr,1,Qe.minY,Qe.maxY,ge),In=oi(Ir,nt,ne+Ji,ne+Or,1,Qe.minY,Qe.maxY,ge),Ir=null),Pe>1&&console.timeEnd("clipping"),we.push(Pt||[],N+1,2*U,2*ne),we.push(Dt||[],N+1,2*U,2*ne+1),we.push(Gt||[],N+1,2*U+1,2*ne),we.push(In||[],N+1,2*U+1,2*ne+1)}}},ts.prototype.getTile=function(oe,N,U){var ne=this.options,he=ne.extent,_e=ne.debug;if(oe<0||oe>24)return null;var be=1<1&&console.log("drilling down to z%d-%d-%d",oe,N,U);for(var ge,Pe=oe,nt=N,rt=U;!ge&&Pe>0;)Pe--,nt=Math.floor(nt/2),rt=Math.floor(rt/2),ge=this.tiles[As(Pe,nt,rt)];return ge&&ge.source?(_e>1&&console.log("found parent tile z%d-%d-%d",Pe,nt,rt),_e>1&&console.time("drilling down"),this.splitTile(ge.source,Pe,nt,rt,oe,N,U),_e>1&&console.timeEnd("drilling down"),this.tiles[we]?gl(this.tiles[we],he):null):null};class ua extends s.VectorTileWorkerSource{constructor(N,U,ne,he,_e){super(N,U,ne,he,Cs),_e&&(this.loadGeoJSON=_e)}loadData(N,U){const ne=N&&N.request,he=ne&&ne.collectResourceTiming;this.loadGeoJSON(N,(_e,be)=>{if(_e||!be)return U(_e);if(typeof be!="object")return U(new Error(`Input data given to '${N.source}' is not a valid GeoJSON object.`));{ae(be,!0);try{if(N.filter){const ge=s.createExpression(N.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(ge.result==="error")throw new Error(ge.value.map(nt=>`${nt.key}: ${nt.message}`).join(", "));be={type:"FeatureCollection",features:be.features.filter(nt=>ge.value.evaluate({zoom:0},nt))}}this._geoJSONIndex=N.cluster?new vn(function({superclusterOptions:ge,clusterProperties:Pe}){if(!Pe||!ge)return ge;const nt={},rt={},Qe={accumulated:null,zoom:0},Mt={properties:null},Rt=Object.keys(Pe);for(const Pt of Rt){const[Dt,Gt]=Pe[Pt],In=s.createExpression(Gt),Vn=s.createExpression(typeof Dt=="string"?[Dt,["accumulated"],["get",Pt]]:Dt);nt[Pt]=In.value,rt[Pt]=Vn.value}return ge.map=Pt=>{Mt.properties=Pt;const Dt={};for(const Gt of Rt)Dt[Gt]=nt[Gt].evaluate(Qe,Mt);return Dt},ge.reduce=(Pt,Dt)=>{Mt.properties=Dt;for(const Gt of Rt)Qe.accumulated=Pt[Gt],Pt[Gt]=rt[Gt].evaluate(Qe,Mt)},ge}(N)).load(be.features):function(ge,Pe){return new ts(ge,Pe)}(be,N.geojsonVtOptions)}catch(ge){return U(ge)}this.loaded={};const we={};if(he){const ge=s.getPerformanceMeasurement(ne);ge&&(we.resourceTiming={},we.resourceTiming[N.source]=JSON.parse(JSON.stringify(ge)))}U(null,we)}})}reloadTile(N,U){const ne=this.loaded;return ne&&ne[N.uid]?super.reloadTile(N,U):this.loadTile(N,U)}loadGeoJSON(N,U){if(N.request)s.getJSON(N.request,U);else{if(typeof N.data!="string")return U(new Error(`Input data given to '${N.source}' is not a valid GeoJSON object.`));try{return U(null,JSON.parse(N.data))}catch{return U(new Error(`Input data given to '${N.source}' is not a valid GeoJSON object.`))}}}getClusterExpansionZoom(N,U){try{U(null,this._geoJSONIndex.getClusterExpansionZoom(N.clusterId))}catch(ne){U(ne)}}getClusterChildren(N,U){try{U(null,this._geoJSONIndex.getChildren(N.clusterId))}catch(ne){U(ne)}}getClusterLeaves(N,U){try{U(null,this._geoJSONIndex.getLeaves(N.clusterId,N.limit,N.offset))}catch(ne){U(ne)}}}class Cc{constructor(N){this.self=N,this.actor=new s.Actor(N,this),this.layerIndexes={},this.availableImages={},this.isSpriteLoaded={},this.projections={},this.defaultProjection=s.getProjection({name:"mercator"}),this.workerSourceTypes={vector:s.VectorTileWorkerSource,geojson:ua},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(U,ne)=>{if(this.workerSourceTypes[U])throw new Error(`Worker source with name "${U}" already registered.`);this.workerSourceTypes[U]=ne},this.self.registerRTLTextPlugin=U=>{if(s.plugin.isParsed())throw new Error("RTL text plugin already registered.");s.plugin.applyArabicShaping=U.applyArabicShaping,s.plugin.processBidirectionalText=U.processBidirectionalText,s.plugin.processStyledBidirectionalText=U.processStyledBidirectionalText}}clearCaches(N,U,ne){delete this.layerIndexes[N],delete this.availableImages[N],delete this.workerSources[N],delete this.demWorkerSources[N],ne()}checkIfReady(N,U,ne){ne()}setReferrer(N,U){this.referrer=U}spriteLoaded(N,U){this.isSpriteLoaded[N]=U;for(const ne in this.workerSources[N]){const he=this.workerSources[N][ne];for(const _e in he)he[_e]instanceof s.VectorTileWorkerSource&&(he[_e].isSpriteLoaded=U,he[_e].fire(new s.Event("isSpriteLoaded")))}}setImages(N,U,ne){this.availableImages[N]=U;for(const he in this.workerSources[N]){const _e=this.workerSources[N][he];for(const be in _e)_e[be].availableImages=U}ne()}enableTerrain(N,U,ne){this.terrain=U,ne()}setProjection(N,U){this.projections[N]=s.getProjection(U)}setLayers(N,U,ne){this.getLayerIndex(N).replace(U),ne()}updateLayers(N,U,ne){this.getLayerIndex(N).update(U.layers,U.removedIds),ne()}loadTile(N,U,ne){const he=this.enableTerrain?s.extend({enableTerrain:this.terrain},U):U;he.projection=this.projections[N]||this.defaultProjection,this.getWorkerSource(N,U.type,U.source).loadTile(he,ne)}loadDEMTile(N,U,ne){const he=this.enableTerrain?s.extend({buildQuadTree:this.terrain},U):U;this.getDEMWorkerSource(N,U.source).loadTile(he,ne)}reloadTile(N,U,ne){const he=this.enableTerrain?s.extend({enableTerrain:this.terrain},U):U;he.projection=this.projections[N]||this.defaultProjection,this.getWorkerSource(N,U.type,U.source).reloadTile(he,ne)}abortTile(N,U,ne){this.getWorkerSource(N,U.type,U.source).abortTile(U,ne)}removeTile(N,U,ne){this.getWorkerSource(N,U.type,U.source).removeTile(U,ne)}removeSource(N,U,ne){if(!this.workerSources[N]||!this.workerSources[N][U.type]||!this.workerSources[N][U.type][U.source])return;const he=this.workerSources[N][U.type][U.source];delete this.workerSources[N][U.type][U.source],he.removeSource!==void 0?he.removeSource(U,ne):ne()}loadWorkerSource(N,U,ne){try{this.self.importScripts(U.url),ne()}catch(he){ne(he.toString())}}syncRTLPluginState(N,U,ne){try{s.plugin.setState(U);const he=s.plugin.getPluginURL();if(s.plugin.isLoaded()&&!s.plugin.isParsed()&&he!=null){this.self.importScripts(he);const _e=s.plugin.isParsed();ne(_e?void 0:new Error(`RTL Text Plugin failed to import scripts from ${he}`),_e)}}catch(he){ne(he.toString())}}getAvailableImages(N){let U=this.availableImages[N];return U||(U=[]),U}getLayerIndex(N){let U=this.layerIndexes[N];return U||(U=this.layerIndexes[N]=new V),U}getWorkerSource(N,U,ne){if(this.workerSources[N]||(this.workerSources[N]={}),this.workerSources[N][U]||(this.workerSources[N][U]={}),!this.workerSources[N][U][ne]){const he={send:(_e,be,we,ge,Pe,nt)=>{this.actor.send(_e,be,we,N,Pe,nt)},scheduler:this.actor.scheduler};this.workerSources[N][U][ne]=new this.workerSourceTypes[U](he,this.getLayerIndex(N),this.getAvailableImages(N),this.isSpriteLoaded[N])}return this.workerSources[N][U][ne]}getDEMWorkerSource(N,U){return this.demWorkerSources[N]||(this.demWorkerSources[N]={}),this.demWorkerSources[N][U]||(this.demWorkerSources[N][U]=new G),this.demWorkerSources[N][U]}enforceCacheSizeLimit(N,U){s.enforceCacheSizeLimit(U)}getWorkerPerformanceMetrics(N,U,ne){ne(void 0,void 0)}}return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&(self.worker=new Cc(self)),Cc}),v(["./shared"],function(s){function k(d,o){if(Array.isArray(d)){if(!Array.isArray(o)||d.length!==o.length)return!1;for(let c=0;c"u"||typeof document>"u"?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var f,_,x=new Blob([""],{type:"text/javascript"}),T=URL.createObjectURL(x);try{_=new Worker(T),f=!0}catch{f=!1}return _&&_.terminate(),URL.revokeObjectURL(T),f}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var f=document.createElement("canvas");f.width=f.height=1;var _=f.getContext("2d");if(!_)return!1;var x=_.getImageData(0,0,1,1);return x&&x.width===f.width}()?(G[c=o&&o.failIfMajorPerformanceCaveat]===void 0&&(G[c]=function(f){var _,x=function(T){var S=document.createElement("canvas"),C=Object.create(V.webGLContextAttributes);return C.failIfMajorPerformanceCaveat=T,S.getContext("webgl",C)||S.getContext("experimental-webgl",C)}(f);if(!x)return!1;try{_=x.createShader(x.VERTEX_SHADER)}catch{return!1}return!(!_||x.isContextLost())&&(x.shaderSource(_,"void main() {}"),x.compileShader(_),x.getShaderParameter(_,x.COMPILE_STATUS)===!0)}(c)),G[c]?document.documentMode?"insufficient ECMAScript 6 support":void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var c}(d)}var G={};function J(d,o,c){const f=s.window.document.createElement(d);return o!==void 0&&(f.className=o),c&&c.appendChild(f),f}function ve(d,o,c){const f=s.window.document.createElementNS("http://www.w3.org/2000/svg",d);for(const _ of Object.keys(o))f.setAttributeNS(null,_,o[_]);return c&&c.appendChild(f),f}V.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};const ae=s.window.document&&s.window.document.documentElement.style,me=ae&&ae.userSelect!==void 0?"userSelect":"WebkitUserSelect";let Ce;function ie(){ae&&me&&(Ce=ae[me],ae[me]="none")}function te(){ae&&me&&(ae[me]=Ce)}function le(d){d.preventDefault(),d.stopPropagation(),s.window.removeEventListener("click",le,!0)}function ze(){s.window.addEventListener("click",le,!0),s.window.setTimeout(()=>{s.window.removeEventListener("click",le,!0)},0)}function Oe(d,o){const c=d.getBoundingClientRect();return ht(d,c,o)}function Ke(d,o){const c=d.getBoundingClientRect(),f=[];for(let _=0;_=0?0:d.button}function ht(d,o,c){const f=d.offsetWidth===o.width?1:d.offsetWidth/o.width;return new s.Point((c.clientX-o.left)*f,(c.clientY-o.top)*f)}function Ve(d,o){var c=o[0],f=o[1],_=o[2],x=o[3],T=c*x-_*f;return T?(d[0]=x*(T=1/T),d[1]=-f*T,d[2]=-_*T,d[3]=c*T,d):null}function jt(d){const{userImage:o}=d;return!!(o&&o.render&&o.render())&&(d.data.replace(new Uint8Array(o.data.buffer)),!0)}class wr extends s.Evented{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new s.RGBAImage({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(o){if(this.loaded!==o&&(this.loaded=o,o)){for(const{ids:c,callback:f}of this.requestors)this._notify(c,f);this.requestors=[]}}hasImage(o){return!!this.getImage(o)}getImage(o){return this.images[o]}addImage(o,c){this._validate(o,c)&&(this.images[o]=c)}_validate(o,c){let f=!0;return this._validateStretch(c.stretchX,c.data&&c.data.width)||(this.fire(new s.ErrorEvent(new Error(`Image "${o}" has invalid "stretchX" value`))),f=!1),this._validateStretch(c.stretchY,c.data&&c.data.height)||(this.fire(new s.ErrorEvent(new Error(`Image "${o}" has invalid "stretchY" value`))),f=!1),this._validateContent(c.content,c)||(this.fire(new s.ErrorEvent(new Error(`Image "${o}" has invalid "content" value`))),f=!1),f}_validateStretch(o,c){if(!o)return!0;let f=0;for(const _ of o){if(_[0]{this.ready=!0})}broadcast(o,c,f){s.asyncAll(this.actors,(_,x)=>{_.send(o,c,x)},f=f||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach(o=>{o.remove()}),this.actors=[],this.workerPool.release(this.id)}}function Bt(d,o,c){return o*(s.EXTENT/(d.tileSize*Math.pow(2,c-d.tileID.overscaledZ)))}xt.Actor=s.Actor;class dn{constructor(o,c,f,_){this.screenBounds=o,this.cameraPoint=c,this._screenRaycastCache={},this._cameraRaycastCache={},this.isAboveHorizon=f,this.screenGeometry=this.bufferedScreenGeometry(0),this.screenGeometryMercator=this._bufferedScreenMercator(0,_)}static createFromScreenPoints(o,c){let f,_;if(o instanceof s.Point||typeof o[0]=="number"){const x=s.Point.convert(o);f=[x],_=c.isPointAboveHorizon(x)}else{const x=s.Point.convert(o[0]),T=s.Point.convert(o[1]);f=[x,T],_=s.polygonizeBounds(x,T).every(S=>c.isPointAboveHorizon(S))}return new dn(f,c.getCameraPoint(),_,c)}isPointQuery(){return this.screenBounds.length===1}bufferedScreenGeometry(o){return s.polygonizeBounds(this.screenBounds[0],this.screenBounds.length===1?this.screenBounds[0]:this.screenBounds[1],o)}bufferedCameraGeometry(o){const c=this.screenBounds[0],f=this.screenBounds.length===1?this.screenBounds[0].add(new s.Point(1,1)):this.screenBounds[1],_=s.polygonizeBounds(c,f,0,!1);return this.cameraPoint.y>f.y&&(this.cameraPoint.x>c.x&&this.cameraPoint.x=f.x?_[2]=this.cameraPoint:this.cameraPoint.x<=c.x&&(_[3]=this.cameraPoint)),s.bufferConvexPolygon(_,o)}bufferedCameraGeometryGlobe(o){const c=this.screenBounds[0],f=this.screenBounds.length===1?this.screenBounds[0].add(new s.Point(1,1)):this.screenBounds[1],_=s.polygonizeBounds(c,f,o),x=this.cameraPoint.clone();switch(3*((x.y>c.y)+(x.y>f.y))+((x.x>c.x)+(x.x>f.x))){case 0:_[0]=x,_[4]=x.clone();break;case 1:_.splice(1,0,x);break;case 2:_[1]=x;break;case 3:_.splice(4,0,x);break;case 5:_.splice(2,0,x);break;case 6:_[3]=x;break;case 7:_.splice(3,0,x);break;case 8:_[2]=x}return _}containsTile(o,c,f,_=0){const x=o.queryPadding/c._pixelsPerMercatorPixel+1,T=f?this._bufferedCameraMercator(x,c):this._bufferedScreenMercator(x,c);let S=o.tileID.wrap+(T.unwrapped?_:0);const C=T.polygon.map(X=>s.getTilePoint(o.tileTransform,X,S));if(!s.polygonIntersectsBox(C,0,0,s.EXTENT,s.EXTENT))return;S=o.tileID.wrap+(this.screenGeometryMercator.unwrapped?_:0);const z=this.screenGeometryMercator.polygon.map(X=>s.getTileVec3(o.tileTransform,X,S)),P=z.map(X=>new s.Point(X[0],X[1])),O=c.getFreeCameraOptions().position||new s.MercatorCoordinate(0,0,0),j=s.getTileVec3(o.tileTransform,O,S),W=z.map(X=>{const B=s.sub(X,X,j);return s.normalize(B,B),new s.Ray(j,B)}),H=Bt(o,1,c.zoom)*c._pixelsPerMercatorPixel;return{queryGeometry:this,tilespaceGeometry:P,tilespaceRays:W,bufferedTilespaceGeometry:C,bufferedTilespaceBounds:(Z=s.getBounds(C),Z.min.x=s.clamp(Z.min.x,0,s.EXTENT),Z.min.y=s.clamp(Z.min.y,0,s.EXTENT),Z.max.x=s.clamp(Z.max.x,0,s.EXTENT),Z.max.y=s.clamp(Z.max.y,0,s.EXTENT),Z),tile:o,tileID:o.tileID,pixelToTileUnitsFactor:H};var Z}_bufferedScreenMercator(o,c){const f=ii(o);if(this._screenRaycastCache[f])return this._screenRaycastCache[f];{let _;return _=c.projection.name==="globe"?this._projectAndResample(this.bufferedScreenGeometry(o),c):{polygon:this.bufferedScreenGeometry(o).map(x=>c.pointCoordinate3D(x)),unwrapped:!0},this._screenRaycastCache[f]=_,_}}_bufferedCameraMercator(o,c){const f=ii(o);if(this._cameraRaycastCache[f])return this._cameraRaycastCache[f];{let _;return _=c.projection.name==="globe"?this._projectAndResample(this.bufferedCameraGeometryGlobe(o),c):{polygon:this.bufferedCameraGeometry(o).map(x=>c.pointCoordinate3D(x)),unwrapped:!0},this._cameraRaycastCache[f]=_,_}}_projectAndResample(o,c){const f=function(x,T){const S=s.multiply([],T.pixelMatrix,T.globeMatrix),C=[0,-s.GLOBE_RADIUS,0,1],z=[0,s.GLOBE_RADIUS,0,1],P=[0,0,0,1];s.transformMat4$1(C,C,S),s.transformMat4$1(z,z,S),s.transformMat4$1(P,P,S);const O=new s.Point(C[0]/C[3],C[1]/C[3]),j=new s.Point(z[0]/z[3],z[1]/z[3]),W=s.polygonContainsPoint(x,O)&&C[3]1?vn(x.slice(0,X),T):[],Q=Xnew s.Point(sr(pe.x),pe.y)),Q=Q.map(pe=>new s.Point(sr(pe.x),pe.y));const ee=[...q];ee.length===0&&ee.push(Q[Q.length-1]);const de=s.number(ee[ee.length-1].y,(Q.length===0?q[0]:Q[0]).y,B);let fe;return fe=W?[new s.Point(0,de),new s.Point(0,0),new s.Point(1,0),new s.Point(1,de)]:[new s.Point(1,de),new s.Point(1,1),new s.Point(0,1),new s.Point(0,de)],ee.push(...fe),Q.length===0?ee.push(q[0]):ee.push(...Q),{polygon:ee.map(pe=>new s.MercatorCoordinate(pe.x,pe.y)),unwrapped:!1}}(o,c);if(f)return f;const _=function(x,T){let S=!1,C=-1/0,z=0;for(let O=0;OC&&(C=x[O].x,z=O);for(let O=0;O.5&&(W.x{O.x-=1}),{polygon:x,unwrapped:S}}(vn(o,c).map(x=>new s.Point(sr(x.x),x.y)),c);return{polygon:_.polygon.map(x=>new s.MercatorCoordinate(x.x,x.y)),unwrapped:_.unwrapped}}}function vn(d,o){return s.resample(d,c=>{const f=o.pointCoordinate3D(c);c.x=f.x,c.y=f.y},1/256)}function sr(d){return d<0?1+d%1:d%1}function ii(d){return 100*d|0}function ar(d,o,c,f,_){const x=function(T,S){if(T)return _(T);if(S){d.url&&S.tiles&&d.tiles&&delete d.tiles;const C=s.pick(s.extend(S,d),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);S.vector_layers&&(C.vectorLayers=S.vector_layers,C.vectorLayerIds=C.vectorLayers.map(z=>z.id)),C.tiles=o.canonicalizeTileset(C,d.url),_(null,C)}};return d.url?s.getJSON(o.transformRequest(o.normalizeSourceURL(d.url,null,c,f),s.ResourceType.Source),x):s.exported.frame(()=>x(null,d))}class br{constructor(o,c,f){this.bounds=s.LngLatBounds.convert(this.validateBounds(o)),this.minzoom=c||0,this.maxzoom=f||24}validateBounds(o){return Array.isArray(o)&&o.length===4?[Math.max(-180,o[0]),Math.max(-90,o[1]),Math.min(180,o[2]),Math.min(90,o[3])]:[-180,-90,180,90]}contains(o){const c=Math.pow(2,o.z),f=Math.floor(s.mercatorXfromLng(this.bounds.getWest())*c),_=Math.floor(s.mercatorYfromLat(this.bounds.getNorth())*c),x=Math.ceil(s.mercatorXfromLng(this.bounds.getEast())*c),T=Math.ceil(s.mercatorYfromLat(this.bounds.getSouth())*c);return o.x>=f&&o.x=_&&o.y{this._tileJSONRequest=null,this._loaded=!0,_?(c&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${c}`),f&&f.length!==2&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${f}`),this.fire(new s.ErrorEvent(_))):x&&(s.extend(this,x),x.bounds&&(this.tileBounds=new br(x.bounds,this.minzoom,this.maxzoom)),s.postTurnstileEvent(x.tiles,this.map._requestManager._customAccessToken),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"}))),o&&o(_)})}loaded(){return this._loaded}hasTile(o){return!this.tileBounds||this.tileBounds.contains(o.canonical)}onAdd(o){this.map=o,this.load()}reload(){this.cancelTileJSONRequest(),this.load(()=>this.map.style._clearSource(this.id))}setTiles(o){return this._options.tiles=o,this.reload(),this}setUrl(o){return this.url=o,this._options.url=o,this.reload(),this}onRemove(){this.cancelTileJSONRequest()}serialize(){return s.extend({},this._options)}loadTile(o,c){const f=this.map._requestManager.normalizeTileURL(o.tileID.canonical.url(this.tiles,this.scheme)),_={request:this.map._requestManager.transformRequest(f,s.ResourceType.Tile),data:void 0,uid:o.uid,tileID:o.tileID,tileZoom:o.tileZoom,zoom:o.tileID.overscaledZ,tileSize:this.tileSize*o.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:s.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,isSymbolTile:o.isSymbolTile};if(_.request.collectResourceTiming=this._collectResourceTiming,o.actor&&o.state!=="expired")o.state==="loading"?o.reloadCallback=c:o.request=o.actor.send("reloadTile",_,x.bind(this));else if(o.actor=this._tileWorkers[f]=this._tileWorkers[f]||this.dispatcher.getActor(),this.dispatcher.ready)o.request=o.actor.send("loadTile",_,x.bind(this),void 0,!0);else{const T=s.loadVectorTile.call({deduped:this._deduped},_,(S,C)=>{S||!C?x.call(this,S):(_.data={cacheControl:C.cacheControl,expires:C.expires,rawData:C.rawData.slice(0)},o.actor&&o.actor.send("loadTile",_,x.bind(this),void 0,!0))},!0);o.request={cancel:T}}function x(T,S){return delete o.request,o.aborted?c(null):T&&T.status!==404?c(T):(S&&S.resourceTiming&&(o.resourceTiming=S.resourceTiming),this.map._refreshExpiredTiles&&S&&o.setExpiryData(S),o.loadVectorData(S,this.map.painter),s.cacheEntryPossiblyAdded(this.dispatcher),c(null),void(o.reloadCallback&&(this.loadTile(o,o.reloadCallback),o.reloadCallback=null)))}}abortTile(o){o.request&&(o.request.cancel(),delete o.request),o.actor&&o.actor.send("abortTile",{uid:o.uid,type:this.type,source:this.id})}unloadTile(o){o.unloadVectorData(),o.actor&&o.actor.send("removeTile",{uid:o.uid,type:this.type,source:this.id})}hasTransition(){return!1}afterUpdate(){this._tileWorkers={}}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}class Qe extends s.Evented{constructor(o,c,f,_){super(),this.id=o,this.dispatcher=f,this.setEventedParent(_),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=s.extend({type:"raster"},c),s.extend(this,s.pick(c,["url","scheme","tileSize"]))}load(o){this._loaded=!1,this.fire(new s.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=ar(this._options,this.map._requestManager,null,null,(c,f)=>{this._tileJSONRequest=null,this._loaded=!0,c?this.fire(new s.ErrorEvent(c)):f&&(s.extend(this,f),f.bounds&&(this.tileBounds=new br(f.bounds,this.minzoom,this.maxzoom)),s.postTurnstileEvent(f.tiles),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"}))),o&&o(c)})}loaded(){return this._loaded}onAdd(o){this.map=o,this.load()}reload(){this.cancelTileJSONRequest(),this.load(()=>this.map.style._clearSource(this.id))}setTiles(o){return this._options.tiles=o,this.reload(),this}setUrl(o){return this.url=o,this._options.url=o,this.reload(),this}onRemove(){this.cancelTileJSONRequest()}serialize(){return s.extend({},this._options)}hasTile(o){return!this.tileBounds||this.tileBounds.contains(o.canonical)}loadTile(o,c){const f=s.exported.devicePixelRatio>=2,_=this.map._requestManager.normalizeTileURL(o.tileID.canonical.url(this.tiles,this.scheme),f,this.tileSize);o.request=s.getImage(this.map._requestManager.transformRequest(_,s.ResourceType.Tile),(x,T,S,C)=>(delete o.request,o.aborted?(o.state="unloaded",c(null)):x?(o.state="errored",c(x)):T?(this.map._refreshExpiredTiles&&o.setExpiryData({cacheControl:S,expires:C}),o.setTexture(T,this.map.painter),o.state="loaded",s.cacheEntryPossiblyAdded(this.dispatcher),void c(null)):c(null)))}static loadTileData(o,c,f){o.setTexture(c,f)}static unloadTileData(o,c){o.texture&&c.saveTileTexture(o.texture)}abortTile(o,c){o.request&&(o.request.cancel(),delete o.request),c()}unloadTile(o,c){o.texture&&this.map.painter.saveTileTexture(o.texture),c()}hasTransition(){return!1}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}function Mt(d,o,c,f,_,x,T,S){const C=[d,c,_,o,f,x,1,1,1],z=[T,S,1],P=s.adjoint([],C),[O,j,W]=s.transformMat3(z,z,s.transpose(P,P));return s.multiply$1(C,[O,0,0,0,j,0,0,0,W],C)}class Rt extends s.Evented{constructor(o,c,f,_){super(),this.id=o,this.dispatcher=f,this.coordinates=c.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(_),this.options=c,this._dirty=!1}load(o,c){this._loaded=c||!1,this.fire(new s.Event("dataloading",{dataType:"source"})),this.url=this.options.url,this._imageRequest=s.getImage(this.map._requestManager.transformRequest(this.url,s.ResourceType.Image),(f,_)=>{if(this._imageRequest=null,this._loaded=!0,f)this.fire(new s.ErrorEvent(f));else if(_){const{HTMLImageElement:x}=s.window;this.image=_ instanceof x?s.exported.getImageData(_):_,this._dirty=!0,this.width=this.image.width,this.height=this.image.height,o&&(this.coordinates=o),this._finishLoading()}})}loaded(){return this._loaded}updateImage(o){return this.image&&o.url?(this._imageRequest&&o.url!==this.options.url&&(this._imageRequest.cancel(),this._imageRequest=null),this.options.url=o.url,this.load(o.coordinates,this._loaded),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(o){this.map=o,this.load()}onRemove(){this._imageRequest&&(this._imageRequest.cancel(),this._imageRequest=null),this.texture&&this.texture.destroy()}setCoordinates(o){this.coordinates=o,this._boundsArray=void 0;const c=o.map(s.MercatorCoordinate.fromLngLat);return this.tileID=function(f){let _=1/0,x=1/0,T=-1/0,S=-1/0;for(const O of f)_=Math.min(_,O.x),x=Math.min(x,O.y),T=Math.max(T,O.x),S=Math.max(S,O.y);const C=Math.max(T-_,S-x),z=Math.max(0,Math.floor(-Math.log(C)/Math.LN2)),P=Math.pow(2,z);return new s.CanonicalTileID(z,Math.floor((_+T)/2*P),Math.floor((x+S)/2*P))}(c),this.minzoom=this.maxzoom=this.tileID.z,this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"})),this}_clear(){this._boundsArray=void 0}_prepareData(o){for(const C in this.tiles){const z=this.tiles[C];z.state!=="loaded"&&(z.state="loaded",z.texture=this.texture)}if(this._boundsArray)return;const c=s.tileTransform(this.tileID,this.map.transform.projection),[f,_,x,T]=this.coordinates.map(C=>{const z=c.projection.project(C[0],C[1]);return s.getTilePoint(c,z)._round()});this.perspectiveTransform=function(C,z,P,O,j,W,H,Z,X,B){const q=Mt(0,0,C,0,0,z,C,z),Q=Mt(P,O,j,W,H,Z,X,B);return s.multiply$1(Q,s.adjoint(q,q),Q),[Q[6]/Q[8]*C/s.EXTENT,Q[7]/Q[8]*z/s.EXTENT]}(this.width,this.height,f.x,f.y,_.x,_.y,T.x,T.y,x.x,x.y);const S=this._boundsArray=new s.StructArrayLayout4i8;S.emplaceBack(f.x,f.y,0,0),S.emplaceBack(_.x,_.y,s.EXTENT,0),S.emplaceBack(T.x,T.y,0,s.EXTENT),S.emplaceBack(x.x,x.y,s.EXTENT,s.EXTENT),this.boundsBuffer&&this.boundsBuffer.destroy(),this.boundsBuffer=o.createVertexBuffer(S,s.boundsAttributes.members),this.boundsSegments=s.SegmentVector.simpleSegment(0,0,4,2)}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const o=this.map.painter.context,c=o.gl;this._dirty&&(this.texture?this.texture.update(this.image):(this.texture=new s.Texture(o,this.image,c.RGBA),this.texture.bind(c.LINEAR,c.CLAMP_TO_EDGE)),this._dirty=!1),this._prepareData(o)}loadTile(o,c){this.tileID&&this.tileID.equals(o.tileID.canonical)?(this.tiles[String(o.tileID.wrap)]=o,o.buckets={},c(null)):(o.state="errored",c(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}const Pt={vector:rt,raster:Qe,"raster-dem":class extends Qe{constructor(d,o,c,f){super(d,o,c,f),this.type="raster-dem",this.maxzoom=22,this._options=s.extend({type:"raster-dem"},o),this.encoding=o.encoding||"mapbox"}loadTile(d,o){const c=this.map._requestManager.normalizeTileURL(d.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize);function f(_,x){_&&(d.state="errored",o(_)),x&&(d.dem=x,d.dem.onDeserialize(),d.needsHillshadePrepare=!0,d.needsDEMTextureUpload=!0,d.state="loaded",o(null))}d.request=s.getImage(this.map._requestManager.transformRequest(c,s.ResourceType.Tile),(function(_,x,T,S){if(delete d.request,d.aborted)d.state="unloaded",o(null);else if(_)d.state="errored",o(_);else if(x){this.map._refreshExpiredTiles&&d.setExpiryData({cacheControl:T,expires:S});const C=s.window.ImageBitmap&&x instanceof s.window.ImageBitmap&&(ca==null&&(ca=s.window.OffscreenCanvas&&new s.window.OffscreenCanvas(1,1).getContext("2d")&&typeof s.window.createImageBitmap=="function"),ca),z=1-(x.width-s.prevPowerOfTwo(x.width))/2;z<1||d.neighboringTiles||(d.neighboringTiles=this._getNeighboringTiles(d.tileID));const P=C?x:s.exported.getImageData(x,z),O={uid:d.uid,coord:d.tileID,source:this.id,rawImageData:P,encoding:this.encoding,padding:z};d.actor&&d.state!=="expired"||(d.actor=this.dispatcher.getActor(),d.actor.send("loadDEMTile",O,f.bind(this),void 0,!0))}}).bind(this))}_getNeighboringTiles(d){const o=d.canonical,c=Math.pow(2,o.z),f=(o.x-1+c)%c,_=o.x===0?d.wrap-1:d.wrap,x=(o.x+1+c)%c,T=o.x+1===c?d.wrap+1:d.wrap,S={};return S[new s.OverscaledTileID(d.overscaledZ,_,o.z,f,o.y).key]={backfilled:!1},S[new s.OverscaledTileID(d.overscaledZ,T,o.z,x,o.y).key]={backfilled:!1},o.y>0&&(S[new s.OverscaledTileID(d.overscaledZ,_,o.z,f,o.y-1).key]={backfilled:!1},S[new s.OverscaledTileID(d.overscaledZ,d.wrap,o.z,o.x,o.y-1).key]={backfilled:!1},S[new s.OverscaledTileID(d.overscaledZ,T,o.z,x,o.y-1).key]={backfilled:!1}),o.y+1{if(this._loaded=!0,this._pendingLoad=null,c)this.fire(new s.ErrorEvent(c));else{const _={dataType:"source",sourceDataType:this._metadataFired?"content":"metadata"};this._collectResourceTiming&&f&&f.resourceTiming&&f.resourceTiming[this.id]&&(_.resourceTiming=f.resourceTiming[this.id]),this.fire(new s.Event("data",_)),this._metadataFired=!0}this._coalesce&&(this._updateWorkerData(),this._coalesce=!1)})}loaded(){return this._loaded}loadTile(d,o){const c=d.actor?"reloadTile":"loadTile";d.actor=this.actor,d.request=this.actor.send(c,{type:this.type,uid:d.uid,tileID:d.tileID,tileZoom:d.tileZoom,zoom:d.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:s.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(f,_)=>(delete d.request,d.unloadVectorData(),d.aborted?o(null):f?o(f):(d.loadVectorData(_,this.map.painter,c==="reloadTile"),o(null))),void 0,c==="loadTile")}abortTile(d){d.request&&(d.request.cancel(),delete d.request),d.aborted=!0}unloadTile(d){d.unloadVectorData(),this.actor.send("removeTile",{uid:d.uid,type:this.type,source:this.id})}onRemove(){this._pendingLoad&&this._pendingLoad.cancel()}serialize(){return s.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}},video:class extends Rt{constructor(d,o,c,f){super(d,o,c,f),this.roundZoom=!0,this.type="video",this.options=o}load(){this._loaded=!1;const d=this.options;this.urls=[];for(const o of d.urls)this.urls.push(this.map._requestManager.transformRequest(o,s.ResourceType.Source).url);s.getVideo(this.urls,(o,c)=>{this._loaded=!0,o?this.fire(new s.ErrorEvent(o)):c&&(this.video=c,this.video.loop=!0,this.video.setAttribute("playsinline",""),this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(d){if(this.video){const o=this.video.seekable;do.end(0)?this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${this.id}`,null,`Playback for this video can be set only between the ${o.start(0)} and ${o.end(0)}-second mark.`))):this.video.currentTime=d}}getVideo(){return this.video}onAdd(d){this.map||(this.map=d,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const d=this.map.painter.context,o=d.gl;this.texture?this.video.paused||(this.texture.bind(o.LINEAR,o.CLAMP_TO_EDGE),o.texSubImage2D(o.TEXTURE_2D,0,0,0,o.RGBA,o.UNSIGNED_BYTE,this.video)):(this.texture=new s.Texture(d,this.video,o.RGBA),this.texture.bind(o.LINEAR,o.CLAMP_TO_EDGE),this.width=this.video.videoWidth,this.height=this.video.videoHeight),this._prepareData(d)}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},image:Rt,canvas:class extends Rt{constructor(d,o,c,f){super(d,o,c,f),o.coordinates?Array.isArray(o.coordinates)&&o.coordinates.length===4&&!o.coordinates.some(_=>!Array.isArray(_)||_.length!==2||_.some(x=>typeof x!="number"))||this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${d}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${d}`,null,'missing required property "coordinates"'))),o.animate&&typeof o.animate!="boolean"&&this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${d}`,null,'optional "animate" property must be a boolean value'))),o.canvas?typeof o.canvas=="string"||o.canvas instanceof s.window.HTMLCanvasElement||this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${d}`,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 s.ErrorEvent(new s.ValidationError(`sources.${d}`,null,'missing required property "canvas"'))),this.options=o,this.animate=o.animate===void 0||o.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof s.window.HTMLCanvasElement?this.options.canvas:s.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new s.ErrorEvent(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(d){this.map=d,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let d=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,d=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,d=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const o=this.map.painter.context;this.texture?(d||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new s.Texture(o,this.canvas,o.gl.RGBA,{premultiply:!0}),this._prepareData(o)}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const d of[this.canvas.width,this.canvas.height])if(isNaN(d)||d<=0)return!0;return!1}},custom:class extends s.Evented{constructor(d,o,c,f){super(),this.id=d,this.type="custom",this._dataType="raster",this._dispatcher=c,this._implementation=o,this.setEventedParent(f),this.scheme="xyz",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this._loaded=!1,this.roundZoom=!0,this._implementation||this.fire(new s.ErrorEvent(new Error(`Missing implementation for ${this.id} custom source`))),this._implementation.loadTile||this.fire(new s.ErrorEvent(new Error(`Missing loadTile implementation for ${this.id} custom source`))),this._implementation.bounds&&(this.tileBounds=new br(this._implementation.bounds,this.minzoom,this.maxzoom)),o.update=this._update.bind(this),o.clearTiles=this._clearTiles.bind(this),o.coveringTiles=this._coveringTiles.bind(this),s.extend(this,s.pick(o,["dataType","scheme","minzoom","maxzoom","tileSize","attribution","minTileCacheSize","maxTileCacheSize"]))}serialize(){return s.pick(this,["type","scheme","minzoom","maxzoom","tileSize","attribution"])}load(){this._loaded=!0,this.fire(new s.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"}))}loaded(){return this._loaded}onAdd(d){this._map=d,this._loaded=!1,this.fire(new s.Event("dataloading",{dataType:"source"})),this._implementation.onAdd&&this._implementation.onAdd(d),this.load()}onRemove(d){this._implementation.onRemove&&this._implementation.onRemove(d)}hasTile(d){if(this._implementation.hasTile){const{x:o,y:c,z:f}=d.canonical;return this._implementation.hasTile({x:o,y:c,z:f})}return!this.tileBounds||this.tileBounds.contains(d.canonical)}loadTile(d,o){const{x:c,y:f,z:_}=d.tileID.canonical,x=new s.window.AbortController;d.request=Promise.resolve(this._implementation.loadTile({x:c,y:f,z:_},{signal:x.signal})).then((function(T){return delete d.request,d.aborted?(d.state="unloaded",o(null)):T===void 0?(d.state="errored",o(null)):T===null?(this.loadTileData(d,{width:this.tileSize,height:this.tileSize,data:null}),d.state="loaded",o(null)):function(S){return S instanceof s.window.ImageData||S instanceof s.window.HTMLCanvasElement||S instanceof s.window.ImageBitmap||S instanceof s.window.HTMLImageElement}(T)?(this.loadTileData(d,T),d.state="loaded",void o(null)):(d.state="errored",o(new Error(`Can't infer data type for ${this.id}, only raster data supported at the moment`)))}).bind(this)).catch(T=>{T.code!==20&&(d.state="errored",o(T))}),d.request.cancel=()=>x.abort()}loadTileData(d,o){Qe.loadTileData(d,o,this._map.painter)}unloadTileData(d){Qe.unloadTileData(d,this._map.painter)}unloadTile(d,o){if(this.unloadTileData(d),this._implementation.unloadTile){const{x:c,y:f,z:_}=d.tileID.canonical;this._implementation.unloadTile({x:c,y:f,z:_})}o()}abortTile(d,o){d.request&&d.request.cancel&&(d.request.cancel(),delete d.request),o()}hasTransition(){return!1}_coveringTiles(){return this._map.transform.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,roundZoom:this.roundZoom}).map(d=>({x:d.canonical.x,y:d.canonical.y,z:d.canonical.z}))}_clearTiles(){this._map.style._clearSource(this.id)}_update(){this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"}))}}},Dt=function(d,o,c,f){const _=new Pt[o.type](d,o,c,f);if(_.id!==d)throw new Error(`Expected Source id to be ${d} instead of ${_.id}`);return s.bindAll(["load","abort","unload","serialize","prepare"],_),_};function Gt(d,o){const c=s.identity([]);return s.scale(c,c,[.5*d.width,.5*-d.height,1]),s.translate(c,c,[1,-1,0]),s.multiply(c,c,d.calculateProjMatrix(o.toUnwrapped())),Float32Array.from(c)}function In(d,o,c,f,_,x,T,S=!1){const C=d.tilesIn(f,T,S);C.sort(Ir);const z=[];for(const O of C)z.push({wrappedTileID:O.tile.tileID.wrapped().key,queryResults:O.tile.queryRenderedFeatures(o,c,d._state,O,_,x,Gt(d.transform,O.tile.tileID),S)});const P=function(O){const j={},W={};for(const H of O){const Z=H.queryResults,X=H.wrappedTileID,B=W[X]=W[X]||{};for(const q in Z){const Q=Z[q],ee=B[q]=B[q]||{},de=j[q]=j[q]||[];for(const fe of Q)ee[fe.featureIndex]||(ee[fe.featureIndex]=!0,de.push(fe))}}return j}(z);for(const O in P)P[O].forEach(j=>{const W=j.feature,H=W.layer;H&&H.type!=="background"&&H.type!=="sky"&&(W.source=H.source,H["source-layer"]&&(W.sourceLayer=H["source-layer"]),W.state=W.id!==void 0?d.getFeatureState(H["source-layer"],W.id):{})});return P}function Vn(d,o){const c=d.getRenderableIds().map(x=>d.getTileByID(x)),f=[],_={};for(let x=0;x{c.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[Ji]}numActive(){return Object.keys(this.active).length}}let Or;function ha(){return Or||(Or=new hr),Or}function G_(d,o){const c={};for(const f in d)f!=="ref"&&(c[f]=d[f]);return s.refProperties.forEach(f=>{f in o&&(c[f]=o[f])}),c}function lf(d){d=d.slice();const o=Object.create(null);for(let c=0;c0?(_-T)/S:0;return this.points[x].mult(1-C).add(this.points[c].mult(C))}}class Is{constructor(o,c,f){const _=this.boxCells=[],x=this.circleCells=[];this.xCellCount=Math.ceil(o/f),this.yCellCount=Math.ceil(c/f);for(let T=0;Tthis.width||_<0||c>this.height)return!x&&[];const S=[];if(o<=0&&c<=0&&this.width<=f&&this.height<=_){if(x)return!0;for(let C=0;C0:S}_queryCircle(o,c,f,_,x){const T=o-f,S=o+f,C=c-f,z=c+f;if(S<0||T>this.width||z<0||C>this.height)return!_&&[];const P=[];return this._forEachCell(T,C,S,z,this._queryCellCircle,P,{hitTest:_,circle:{x:o,y:c,radius:f},seenUids:{box:{},circle:{}}},x),_?P.length>0:P}query(o,c,f,_,x){return this._query(o,c,f,_,!1,x)}hitTest(o,c,f,_,x){return this._query(o,c,f,_,!0,x)}hitTestCircle(o,c,f,_){return this._queryCircle(o,c,f,!0,_)}_queryCell(o,c,f,_,x,T,S,C){const z=S.seenUids,P=this.boxCells[x];if(P!==null){const j=this.bboxes;for(const W of P)if(!z.box[W]){z.box[W]=!0;const H=4*W;if(o<=j[H+2]&&c<=j[H+3]&&f>=j[H+0]&&_>=j[H+1]&&(!C||C(this.boxKeys[W]))){if(S.hitTest)return T.push(!0),!0;T.push({key:this.boxKeys[W],x1:j[H],y1:j[H+1],x2:j[H+2],y2:j[H+3]})}}}const O=this.circleCells[x];if(O!==null){const j=this.circles;for(const W of O)if(!z.circle[W]){z.circle[W]=!0;const H=3*W;if(this._circleAndRectCollide(j[H],j[H+1],j[H+2],o,c,f,_)&&(!C||C(this.circleKeys[W]))){if(S.hitTest)return T.push(!0),!0;{const Z=j[H],X=j[H+1],B=j[H+2];T.push({key:this.circleKeys[W],x1:Z-B,y1:X-B,x2:Z+B,y2:X+B})}}}}}_queryCellCircle(o,c,f,_,x,T,S,C){const z=S.circle,P=S.seenUids,O=this.boxCells[x];if(O!==null){const W=this.bboxes;for(const H of O)if(!P.box[H]){P.box[H]=!0;const Z=4*H;if(this._circleAndRectCollide(z.x,z.y,z.radius,W[Z+0],W[Z+1],W[Z+2],W[Z+3])&&(!C||C(this.boxKeys[H])))return T.push(!0),!0}}const j=this.circleCells[x];if(j!==null){const W=this.circles;for(const H of j)if(!P.circle[H]){P.circle[H]=!0;const Z=3*H;if(this._circlesCollide(W[Z],W[Z+1],W[Z+2],z.x,z.y,z.radius)&&(!C||C(this.circleKeys[H])))return T.push(!0),!0}}}_forEachCell(o,c,f,_,x,T,S,C){const z=this._convertToXCellCoord(o),P=this._convertToYCellCoord(c),O=this._convertToXCellCoord(f),j=this._convertToYCellCoord(_);for(let W=z;W<=O;W++)for(let H=P;H<=j;H++)if(x.call(this,o,c,f,_,this.xCellCount*H+W,T,S,C))return}_convertToXCellCoord(o){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(o*this.xScale)))}_convertToYCellCoord(o){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(o*this.yScale)))}_circlesCollide(o,c,f,_,x,T){const S=_-o,C=x-c,z=f+T;return z*z>S*S+C*C}_circleAndRectCollide(o,c,f,_,x,T,S){const C=(T-_)/2,z=Math.abs(o-(_+C));if(z>C+f)return!1;const P=(S-x)/2,O=Math.abs(c-(x+P));if(O>P+f)return!1;if(z<=C||O<=P)return!0;const j=z-C,W=O-P;return j*j+W*W<=f*f}}const wo={unknown:0,flipRequired:1,flipNotRequired:2},vl=Math.tan(85*Math.PI/180);function Re(d,o,c,f,_,x,T){const S=s.create();if(c)if(x.name==="globe"){const C=s.calculateGlobeLabelMatrix(_,o);s.multiply(S,S,C)}else{const C=Ve([],T);S[0]=C[0],S[1]=C[1],S[4]=C[2],S[5]=C[3],f||s.rotateZ(S,S,_.angle)}else s.multiply(S,_.labelPlaneMatrix,d);return S}function bo(d,o,c,f,_,x,T){const S=Re(d,o,c,f,_,x,T);return x.name==="globe"&&c||(S[2]=S[6]=S[10]=S[14]=0),S}function $n(d,o,c,f,_,x,T){if(c){if(x.name==="globe"){const S=Re(d,o,c,f,_,x,T);return s.invert(S,S),s.multiply(S,d,S),S}{const S=s.clone(d),C=s.identity([]);return C[0]=T[0],C[1]=T[1],C[4]=T[2],C[5]=T[3],s.multiply(S,S,C),f||s.rotateZ(S,S,-_.angle),S}}return _.glCoordMatrix}function dr(d,o,c,f){const _=[d,o,c,1];c?s.transformMat4$1(_,_,f):Nt(_,_,f);const x=_[3];return _[0]/=x,_[1]/=x,_[2]/=x,_}function cf(d,o){return Math.min(.5+d/o*.5,1.5)}function eo(d,o){const c=d[0]/d[3],f=d[1]/d[3];return c>=-o[0]&&c<=o[0]&&f>=-o[1]&&f<=o[1]}function Sh(d,o,c,f,_,x,T,S,C,z){const P=c.transform,O=f?d.textSizeData:d.iconSizeData,j=s.evaluateSizeForZoom(O,c.transform.zoom),W=P.projection.name==="globe",H=[256/c.width*2+1,256/c.height*2+1],Z=f?d.text.dynamicLayoutVertexArray:d.icon.dynamicLayoutVertexArray;Z.clear();let X=null;W&&(X=f?d.text.globeExtVertexArray:d.icon.globeExtVertexArray);const B=d.lineVertexArray,q=f?d.text.placedSymbolArray:d.icon.placedSymbolArray,Q=c.transform.width/c.transform.height;let ee,de=!1;for(let fe=0;feMath.abs(c)?{useVertical:!0}:d===s.WritingMode.vertical?f>0?{needsFlipping:!0}:null:o!==wo.unknown&&function(_,x){return _===0||Math.abs(x/_)>vl}(c,f)?o===wo.flipRequired?{needsFlipping:!0}:null:c<0?{needsFlipping:!0}:null}function lt(d,o,c,f,_,x,T,S,C,z,P,O,j,W,H,Z,X,B,q){const Q=o/24,ee=d.lineOffsetX*Q,de=d.lineOffsetY*Q,{lineStartIndex:fe,glyphStartIndex:pe,numGlyphs:xe,segment:ye,writingMode:Ae,flipState:We}=d,Ee=fe+d.lineLength,Fe=ke=>{if(P){const[Xe,$e,Ye]=ke.up,gt=z.length;s.updateGlobeVertexNormal(P,gt+0,Xe,$e,Ye),s.updateGlobeVertexNormal(P,gt+1,Xe,$e,Ye),s.updateGlobeVertexNormal(P,gt+2,Xe,$e,Ye),s.updateGlobeVertexNormal(P,gt+3,Xe,$e,Ye)}const[qe,Se,Be]=ke.point;s.addDynamicAttributes(z,qe,Se,Be,ke.angle)};if(xe>1){const ke=uf(Q,S,ee,de,c,O,j,d,C,x,W,Z,!1,X,B,q);if(!ke)return{notEnoughRoom:!0};if(f&&!c){let[qe,Se,Be]=ke.first.point,[Xe,$e,Ye]=ke.last.point;[qe,Se]=dr(qe,Se,Be,T),[Xe,$e]=dr(Xe,$e,Ye,T);const gt=da(Ae,We,(Xe-qe)*H,$e-Se);if(d.flipState=gt&>.needsFlipping?wo.flipRequired:wo.flipNotRequired,gt)return gt}Fe(ke.first);for(let qe=pe+1;qe0?Xe:Ft(j,Be,qe,1,_,void 0,X,B.canonical),Ye=da(Ae,We,($e[0]-qe[0])*H,$e[1]-qe[1]);if(d.flipState=Ye&&Ye.needsFlipping?wo.flipRequired:wo.flipNotRequired,Ye)return Ye}const ke=si(Q*S.getoffsetX(pe),ee,de,c,O,j,ye,fe,Ee,C,x,W,Z,!1,!1,X,B,q);if(!ke)return{notEnoughRoom:!0};Fe(ke)}return{}}function $t(d,o,c,f,_){const{x,y:T,z:S}=f.projectTilePoint(d.x,d.y,o);if(!_)return dr(x,T,S,c);const[C,z,P]=_(d);return dr(x+C,T+z,S+P,c)}function Ft(d,o,c,f,_,x,T,S){const C=$t(d.sub(o)._unit()._add(d),S,_,T,x);return s.sub(C,c,C),s.normalize(C,C),s.scaleAndAdd(C,c,C,f)}function si(d,o,c,f,_,x,T,S,C,z,P,O,j,W,H,Z,X,B){const q=f?d-o:d+o;let Q=q>0?1:-1,ee=0;f&&(Q*=-1,ee=Math.PI),Q<0&&(ee+=Math.PI);let de=S+T+(Q>0?0:1)|0,fe=_,pe=_,xe=0,ye=0;const Ae=Math.abs(q),We=[],Ee=[];let Fe=x,ke=Fe;const qe=()=>Ft(ke,Fe,pe,Ae-xe+1,P,j,Z,X.canonical);for(;xe+ye<=Ae;){if(de+=Q,de=C)return null;if(pe=fe,ke=Fe,We.push(pe),W&&Ee.push(ke),Fe=new s.Point(z.getx(de),z.gety(de)),fe=O[de],!fe){const wt=$t(Fe,X.canonical,P,Z,j);fe=wt[3]>0?O[de]=wt:qe()}xe+=ye,ye=s.distance(pe,fe)}H&&j&&(O[de]&&(fe=qe(),ye=s.distance(pe,fe)),O[de]=fe);const Se=(Ae-xe)/ye,Be=Fe.sub(ke)._mult(Se)._add(ke),Xe=s.sub([],fe,pe),$e=s.scaleAndAdd([],pe,Xe,Se);let Ye=[0,0,1],gt=Xe[0],Et=Xe[1];if(B&&(Ye=Z.upVector(X.canonical,Be.x,Be.y),Ye[0]!==0||Ye[1]!==0||Ye[2]!==1)){const wt=[Ye[2],0,-Ye[0]],Ut=s.cross([],Ye,wt);s.normalize(wt,wt),s.normalize(Ut,Ut),gt=s.dot(Xe,wt),Et=s.dot(Xe,Ut)}if(c){const wt=s.cross([],Ye,Xe);s.normalize(wt,wt),s.scaleAndAdd($e,$e,wt,c*Q)}const pt=ee+Math.atan2(Et,gt);return We.push($e),W&&Ee.push(Be),{point:$e,angle:pt,path:We,tilePath:Ee,up:Ye}}function Ri(d,o){const c=o.length,f=c+4*d;o.resize(f),o.float32.fill(-1/0,4*c,4*f)}function Nt(d,o,c){const f=o[0],_=o[1];return d[0]=c[0]*f+c[4]*_+c[12],d[1]=c[1]*f+c[5]*_+c[13],d[3]=c[3]*f+c[7]*_+c[15],d}const ai=100;class xl{constructor(o,c,f=new Is(o.width+200,o.height+200,25),_=new Is(o.width+200,o.height+200,25)){this.transform=o,this.grid=f,this.ignoredGrid=_,this.pitchfactor=Math.cos(o._pitch)*o.cameraToCenterDistance,this.screenRightBoundary=o.width+ai,this.screenBottomBoundary=o.height+ai,this.gridRightBoundary=o.width+200,this.gridBottomBoundary=o.height+200,this.fogState=c}placeCollisionBox(o,c,f,_,x,T,S,C){let z=f.projectedAnchorX,P=f.projectedAnchorY,O=f.projectedAnchorZ;const j=f.elevation,W=f.tileID,H=o.getProjection();if(j&&W){const[fe,pe,xe]=H.upVector(W.canonical,f.tileAnchorX,f.tileAnchorY),ye=H.upVectorScale(W.canonical,this.transform.center.lat,this.transform.worldSize).metersToTile;z+=fe*j*ye,P+=pe*j*ye,O+=xe*j*ye}const Z=this.projectAndGetPerspectiveRatio(S,z,P,O,f.tileID,H.name==="globe"||!!j||this.transform.pitch>0,H),X=T*Z.perspectiveRatio,B=(f.x1*c+_.x-f.padding)*X+Z.point.x,q=(f.y1*c+_.y-f.padding)*X+Z.point.y,Q=(f.x2*c+_.x+f.padding)*X+Z.point.x,ee=(f.y2*c+_.y+f.padding)*X+Z.point.y,de=Z.perspectiveRatio<=.55||Z.occluded;return!this.isInsideGrid(B,q,Q,ee)||!x&&this.grid.hitTest(B,q,Q,ee,C)||de?{box:[],offscreen:!1,occluded:Z.occluded}:{box:[B,q,Q,ee],offscreen:this.isOffscreen(B,q,Q,ee),occluded:!1}}placeCollisionCircles(o,c,f,_,x,T,S,C,z,P,O,j,W,H,Z){const X=[],B=this.transform.elevation,q=o.getProjection(),Q=B?B.getAtTileOffsetFunc(Z,this.transform.center.lat,this.transform.worldSize,q):null,ee=new s.Point(f.tileAnchorX,f.tileAnchorY);let{x:de,y:fe,z:pe}=q.projectTilePoint(ee.x,ee.y,Z.canonical);if(Q){const[Be,Xe,$e]=Q(ee);de+=Be,fe+=Xe,pe+=$e}const xe=q.name==="globe",ye=this.projectAndGetPerspectiveRatio(S,de,fe,pe,Z,xe||!!B||this.transform.pitch>0,q),{perspectiveRatio:Ae}=ye,We=(O?T/Ae:T*Ae)/s.ONE_EM,Ee=dr(de,fe,pe,C),Fe=ye.signedDistanceFromCamera>0?uf(We,x,f.lineOffsetX*We,f.lineOffsetY*We,!1,Ee,ee,f,_,C,{},B&&!O?Q:null,O&&!!B,q,Z,O):null;let ke=!1,qe=!1,Se=!0;if(Fe&&!ye.occluded){const Be=.5*W*Ae+H,Xe=new s.Point(-100,-100),$e=new s.Point(this.screenRightBoundary,this.screenBottomBoundary),Ye=new Th,{first:gt,last:Et}=Fe,pt=gt.path.length;let wt=[];for(let mt=pt-1;mt>=1;mt--)wt.push(gt.path[mt]);for(let mt=1;mt(Q&&!xe&&(rn=Q(onmt[3]<=0)&&(wt=[]));let Ot=[];if(wt.length>0){let mt=1/0,en=-1/0,rn=1/0,on=-1/0;for(const sn of wt)mt=Math.min(mt,sn[0]),rn=Math.min(rn,sn[1]),en=Math.max(en,sn[0]),on=Math.max(on,sn[1]);en>=Xe.x&&mt<=$e.x&&on>=Xe.y&&rn<=$e.y&&(Ot=[wt.map(sn=>new s.Point(sn[0],sn[1]))],(mt$e.x||rn$e.y)&&(Ot=s.clipLine(Ot,Xe.x,Xe.y,$e.x,$e.y)))}for(const mt of Ot){Ye.reset(mt,.25*Be);let en=0;en=Ye.length<=.5*Be?1:Math.ceil(Ye.paddedLength/Ut)+1;for(let rn=0;rn0?(s.transformMat4$1(C,C,o),this.fogState&&x&&S.name!=="globe"&&(z=function(j,W,H,Z,X,B){const q=B.calculateFogTileMatrix(X),Q=[W,H,Z];return s.transformMat4(Q,Q,q),Li(j,Q,B.pitch,B._fov)}(this.fogState,c,f,_,x.toUnwrapped(),this.transform)>.9)):Nt(C,C,o);const P=C[3];return{point:new s.Point((C[0]/P+1)/2*this.transform.width+ai,(-C[1]/P+1)/2*this.transform.height+ai),perspectiveRatio:Math.min(.5+this.transform.getCameraToCenterDistance(S)/P*.5,1.5),signedDistanceFromCamera:P,occluded:T&&C[2]>P||z}}isOffscreen(o,c,f,_){return f=this.screenRightBoundary||_this.screenBottomBoundary}isInsideGrid(o,c,f,_){return f>=0&&o=0&&cf.collisionGroupID===c}}return this.collisionGroups[o]}}function El(d,o,c,f,_){const{horizontalAlign:x,verticalAlign:T}=s.getAnchorAlignment(d),S=-(x-.5)*o,C=-(T-.5)*c,z=s.evaluateVariableOffset(d,f);return new s.Point(S+z[0]*_,C+z[1]*_)}function Tl(d,o,c,f,_){const x=new s.Point(d,o);return c&&x._rotate(f?_:-_),x}class kc{constructor(o,c,f,_,x){this.transform=o.clone(),this.projection=o.projection.name,this.collisionIndex=new xl(this.transform,x),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=c,this.retainedQueryData={},this.collisionGroups=new df(f),this.collisionCircleArrays={},this.prevPlacement=_,_&&(_.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(o,c,f,_){const x=f.getBucket(c),T=f.latestFeatureIndex;if(!x||!T||c.id!==x.layerIds[0])return;const S=x.layers[0].layout,C=f.collisionBoxArray,z=Math.pow(2,this.transform.zoom-f.tileID.overscaledZ),P=f.tileSize/s.EXTENT,O=f.tileID.toUnwrapped();this.transform.setProjection(x.projection);const j=(W=f.tileID,H=x.getProjection(),Z=this.transform,H.name===this.projection?Z.calculateProjMatrix(W.toUnwrapped()):ks(Z,H,W));var W,H,Z;const X=S.get("text-pitch-alignment")==="map",B=S.get("text-rotation-alignment")==="map";c.compileFilter();const q=c.dynamicFilter(),Q=c.dynamicFilterNeedsFeature(),ee=this.transform.calculatePixelsToTileUnitsMatrix(f),de=bo(j,f.tileID.canonical,X,B,this.transform,x.getProjection(),ee);let fe=null;if(X){const ye=$n(j,f.tileID.canonical,X,B,this.transform,x.getProjection(),ee);fe=s.multiply([],this.transform.labelPlaneMatrix,ye)}let pe=null;q&&f.latestFeatureIndex&&(pe={unwrappedTileID:O,dynamicFilter:q,dynamicFilterNeedsFeature:Q,featureIndex:f.latestFeatureIndex}),this.retainedQueryData[x.bucketInstanceId]=new Ah(x.bucketInstanceId,T,x.sourceLayerIndex,x.index,f.tileID);const xe={bucket:x,layout:S,posMatrix:j,textLabelPlaneMatrix:de,labelToScreenMatrix:fe,clippingData:pe,scale:z,textPixelRatio:P,holdingForFade:f.holdingForFade(),collisionBoxArray:C,partiallyEvaluatedTextSize:s.evaluateSizeForZoom(x.textSizeData,this.transform.zoom),partiallyEvaluatedIconSize:s.evaluateSizeForZoom(x.iconSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(x.sourceID)};if(_)for(const ye of x.sortKeyRanges){const{sortKey:Ae,symbolInstanceStart:We,symbolInstanceEnd:Ee}=ye;o.push({sortKey:Ae,symbolInstanceStart:We,symbolInstanceEnd:Ee,parameters:xe})}else o.push({symbolInstanceStart:0,symbolInstanceEnd:x.symbolInstances.length,parameters:xe})}attemptAnchorPlacement(o,c,f,_,x,T,S,C,z,P,O,j,W,H,Z,X,B,q){const{textOffset0:Q,textOffset1:ee,crossTileID:de}=j,fe=[Q,ee],pe=El(o,f,_,fe,x),xe=this.collisionIndex.placeCollisionBox(H,x,c,Tl(pe.x,pe.y,T,S,this.transform.angle),O,C,z,P.predicate);if(X){const ye=H.getSymbolInstanceIconSize(q,this.transform.zoom,j.placedIconSymbolIndex);if(this.collisionIndex.placeCollisionBox(H,ye,X,Tl(pe.x,pe.y,T,S,this.transform.angle),O,C,z,P.predicate).box.length===0)return}if(xe.box.length>0){let ye;return this.prevPlacement&&this.prevPlacement.variableOffsets[de]&&this.prevPlacement.placements[de]&&this.prevPlacement.placements[de].text&&(ye=this.prevPlacement.variableOffsets[de].anchor),this.variableOffsets[de]={textOffset:fe,width:f,height:_,anchor:o,textScale:x,prevAnchor:ye},this.markUsedJustification(H,o,j,Z),H.allowVerticalPlacement&&(this.markUsedOrientation(H,Z,j),this.placedOrientations[de]=Z),{shift:pe,placedGlyphBoxes:xe}}}placeLayerBucketPart(o,c,f,_){const{bucket:x,layout:T,posMatrix:S,textLabelPlaneMatrix:C,labelToScreenMatrix:z,clippingData:P,textPixelRatio:O,holdingForFade:j,collisionBoxArray:W,partiallyEvaluatedTextSize:H,partiallyEvaluatedIconSize:Z,collisionGroup:X}=o.parameters,B=T.get("text-optional"),q=T.get("icon-optional"),Q=T.get("text-allow-overlap"),ee=T.get("icon-allow-overlap"),de=T.get("text-rotation-alignment")==="map",fe=T.get("text-pitch-alignment")==="map",pe=T.get("icon-text-fit")!=="none",xe=T.get("symbol-z-order")==="viewport-y";this.transform.setProjection(x.projection);let ye=Q&&(ee||!x.hasIconData()||q),Ae=ee&&(Q||!x.hasTextData()||B);!x.collisionArrays&&W&&x.deserializeCollisionBoxes(W),f&&_&&x.updateCollisionDebugBuffers(this.transform.zoom,W);const We=(Ee,Fe,ke)=>{const{crossTileID:qe,numVerticalGlyphVertices:Se}=Ee;if(P){const An={zoom:this.transform.zoom,pitch:this.transform.pitch};let an=null;if(P.dynamicFilterNeedsFeature){const Xt=this.retainedQueryData[x.bucketInstanceId];an=P.featureIndex.loadFeature({featureIndex:Ee.featureIndex,bucketIndex:Xt.bucketIndex,sourceLayerIndex:Xt.sourceLayerIndex,layoutVertexArrayOffset:0})}if(!(0,P.dynamicFilter)(An,an,this.retainedQueryData[x.bucketInstanceId].tileID.canonical,new s.Point(Ee.tileAnchorX,Ee.tileAnchorY),this.transform.calculateDistanceTileData(P.unwrappedTileID)))return this.placements[qe]=new wl(!1,!1,!1,!0),void c.add(qe)}if(c.has(qe))return;if(j)return void(this.placements[qe]=new wl(!1,!1,!1));let Be=!1,Xe=!1,$e=!0,Ye=!1,gt=!1,Et=null,pt={box:null,offscreen:null,occluded:null},wt={box:null,offscreen:null,occluded:null},Ut=null,Ot=null,mt=null,en=0,rn=0,on=0;ke.textFeatureIndex?en=ke.textFeatureIndex:Ee.useRuntimeCollisionCircles&&(en=Ee.featureIndex),ke.verticalTextFeatureIndex&&(rn=ke.verticalTextFeatureIndex);const sn=An=>{An.tileID=this.retainedQueryData[x.bucketInstanceId].tileID;const an=this.transform.elevation;(an||An.elevation)&&(An.elevation=an?an.getAtTileOffset(An.tileID,An.tileAnchorX,An.tileAnchorY):0)},Mr=ke.textBox;if(Mr){sn(Mr);const An=Xt=>{let Gn=s.WritingMode.horizontal;if(x.allowVerticalPlacement&&!Xt&&this.prevPlacement){const Br=this.prevPlacement.placedOrientations[qe];Br&&(this.placedOrientations[qe]=Br,Gn=Br,this.markUsedOrientation(x,Gn,Ee))}return Gn},an=(Xt,Gn)=>{if(x.allowVerticalPlacement&&Se>0&&ke.verticalTextBox){for(const Br of x.writingModes)if(Br===s.WritingMode.vertical?(pt=Gn(),wt=pt):pt=Xt(),pt&&pt.box&&pt.box.length)break}else pt=Xt()};if(T.get("text-variable-anchor")){let Xt=T.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[qe]){const En=this.prevPlacement.variableOffsets[qe];Xt.indexOf(En.anchor)>0&&(Xt=Xt.filter(Wr=>Wr!==En.anchor),Xt.unshift(En.anchor))}const Gn=(En,Wr,nu)=>{const Bs=x.getSymbolInstanceTextSize(H,Ee,this.transform.zoom,Fe),Gl=(En.x2-En.x1)*Bs+2*En.padding,Mo=(En.y2-En.y1)*Bs+2*En.padding,is=pe&&!ee?Wr:null;is&&sn(is);let Fs={box:[],offscreen:!1,occluded:!1};const ru=Q?2*Xt.length:Xt.length;for(let ql=0;ql=Xt.length,Ee,Fe,x,nu,is,H,Z);if(gd&&(Fs=gd.placedGlyphBoxes,Fs&&Fs.box&&Fs.box.length)){Be=!0,Et=gd.shift;break}}return Fs};an(()=>Gn(Mr,ke.iconBox,s.WritingMode.horizontal),()=>{const En=ke.verticalTextBox;return En&&sn(En),x.allowVerticalPlacement&&!(pt&&pt.box&&pt.box.length)&&Se>0&&En?Gn(En,ke.verticalIconBox,s.WritingMode.vertical):{box:null,offscreen:null,occluded:null}}),pt&&(Be=pt.box,$e=pt.offscreen,Ye=pt.occluded);const Br=An(!(!pt||!pt.box));if(!Be&&this.prevPlacement){const En=this.prevPlacement.variableOffsets[qe];En&&(this.variableOffsets[qe]=En,this.markUsedJustification(x,En.anchor,Ee,Br))}}else{const Xt=(Gn,Br)=>{const En=x.getSymbolInstanceTextSize(H,Ee,this.transform.zoom,Fe),Wr=this.collisionIndex.placeCollisionBox(x,En,Gn,new s.Point(0,0),Q,O,S,X.predicate);return Wr&&Wr.box&&Wr.box.length&&(this.markUsedOrientation(x,Br,Ee),this.placedOrientations[qe]=Br),Wr};an(()=>Xt(Mr,s.WritingMode.horizontal),()=>{const Gn=ke.verticalTextBox;return x.allowVerticalPlacement&&Se>0&&Gn?(sn(Gn),Xt(Gn,s.WritingMode.vertical)):{box:null,offscreen:null,occluded:null}}),An(!!(pt&&pt.box&&pt.box.length))}}if(Ut=pt,Be=Ut&&Ut.box&&Ut.box.length>0,$e=Ut&&Ut.offscreen,Ye=Ut&&Ut.occluded,Ee.useRuntimeCollisionCircles){const An=x.text.placedSymbolArray.get(Ee.centerJustifiedTextSymbolIndex>=0?Ee.centerJustifiedTextSymbolIndex:Ee.verticalPlacedTextSymbolIndex),an=s.evaluateSizeForFeature(x.textSizeData,H,An),Xt=T.get("text-padding");Ot=this.collisionIndex.placeCollisionCircles(x,Q,An,x.lineVertexArray,x.glyphOffsetArray,an,S,C,z,f,fe,X.predicate,Ee.collisionCircleDiameter*an/s.ONE_EM,Xt,this.retainedQueryData[x.bucketInstanceId].tileID),Be=Q||Ot.circles.length>0&&!Ot.collisionDetected,$e=$e&&Ot.offscreen,Ye=Ot.occluded}if(ke.iconFeatureIndex&&(on=ke.iconFeatureIndex),ke.iconBox){const An=an=>{sn(an);const Xt=pe&&Et?Tl(Et.x,Et.y,de,fe,this.transform.angle):new s.Point(0,0),Gn=x.getSymbolInstanceIconSize(Z,this.transform.zoom,Ee.placedIconSymbolIndex);return this.collisionIndex.placeCollisionBox(x,Gn,an,Xt,ee,O,S,X.predicate)};wt&&wt.box&&wt.box.length&&ke.verticalIconBox?(mt=An(ke.verticalIconBox),Xe=mt.box.length>0):(mt=An(ke.iconBox),Xe=mt.box.length>0),$e=$e&&mt.offscreen,gt=mt.occluded}const fr=B||Ee.numHorizontalGlyphVertices===0&&Se===0,vi=q||Ee.numIconVertices===0;if(fr||vi?vi?fr||(Xe=Xe&&Be):Be=Xe&&Be:Xe=Be=Xe&&Be,Be&&Ut&&Ut.box&&this.collisionIndex.insertCollisionBox(Ut.box,T.get("text-ignore-placement"),x.bucketInstanceId,wt&&wt.box&&rn?rn:en,X.ID),Xe&&mt&&this.collisionIndex.insertCollisionBox(mt.box,T.get("icon-ignore-placement"),x.bucketInstanceId,on,X.ID),Ot&&(Be&&this.collisionIndex.insertCollisionCircles(Ot.circles,T.get("text-ignore-placement"),x.bucketInstanceId,en,X.ID),f)){const An=x.bucketInstanceId;let an=this.collisionCircleArrays[An];an===void 0&&(an=this.collisionCircleArrays[An]=new bl);for(let Xt=0;Xt=0;--Fe){const ke=Ee[Fe];We(x.symbolInstances.get(ke),ke,x.collisionArrays[ke])}}else for(let Ee=o.symbolInstanceStart;Ee=0&&(o.text.placedSymbolArray.get(x).crossTileID=O>=0&&x!==O?0:z),T>=0&&(o.text.placedSymbolArray.get(T).crossTileID=O>=0&&T!==O?0:z),S>=0&&(o.text.placedSymbolArray.get(S).crossTileID=O>=0&&S!==O?0:z),C>=0&&(o.text.placedSymbolArray.get(C).crossTileID=O>=0&&C!==O?0:z)}markUsedOrientation(o,c,f){const _=c===s.WritingMode.horizontal||c===s.WritingMode.horizontalOnly?c:0,x=c===s.WritingMode.vertical?c:0,{leftJustifiedTextSymbolIndex:T,centerJustifiedTextSymbolIndex:S,rightJustifiedTextSymbolIndex:C,verticalPlacedTextSymbolIndex:z}=f,P=o.text.placedSymbolArray;T>=0&&(P.get(T).placedOrientation=_),S>=0&&(P.get(S).placedOrientation=_),C>=0&&(P.get(C).placedOrientation=_),z>=0&&(P.get(z).placedOrientation=x)}commit(o){this.commitTime=o,this.zoomAtLastRecencyCheck=this.transform.zoom;const c=this.prevPlacement;let f=!1;this.prevZoomAdjustment=c?c.zoomAdjustment(this.transform.zoom):0;const _=c?c.symbolFadeChange(o):1,x=c?c.opacities:{},T=c?c.variableOffsets:{},S=c?c.placedOrientations:{};for(const C in this.placements){const z=this.placements[C],P=x[C];P?(this.opacities[C]=new Eo(P,_,z.text,z.icon,null,z.clipped),f=f||z.text!==P.text.placed||z.icon!==P.icon.placed):(this.opacities[C]=new Eo(null,_,z.text,z.icon,z.skipFade,z.clipped),f=f||z.text||z.icon)}for(const C in x){const z=x[C];if(!this.opacities[C]){const P=new Eo(z,_,!1,!1);P.isHidden()||(this.opacities[C]=P,f=f||z.text.placed||z.icon.placed)}}for(const C in T)this.variableOffsets[C]||!this.opacities[C]||this.opacities[C].isHidden()||(this.variableOffsets[C]=T[C]);for(const C in S)this.placedOrientations[C]||!this.opacities[C]||this.opacities[C].isHidden()||(this.placedOrientations[C]=S[C]);f?this.lastPlacementChangeTime=o:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=c?c.lastPlacementChangeTime:o)}updateLayerOpacities(o,c){const f=new Set;for(const _ of c){const x=_.getBucket(o);x&&_.latestFeatureIndex&&o.id===x.layerIds[0]&&this.updateBucketOpacities(x,f,_.collisionBoxArray)}}updateBucketOpacities(o,c,f){o.hasTextData()&&o.text.opacityVertexArray.clear(),o.hasIconData()&&o.icon.opacityVertexArray.clear(),o.hasIconCollisionBoxData()&&o.iconCollisionBox.collisionVertexArray.clear(),o.hasTextCollisionBoxData()&&o.textCollisionBox.collisionVertexArray.clear();const _=o.layers[0].layout,x=!!o.layers[0].dynamicFilter(),T=new Eo(null,0,!1,!1,!0),S=_.get("text-allow-overlap"),C=_.get("icon-allow-overlap"),z=_.get("text-variable-anchor"),P=_.get("text-rotation-alignment")==="map",O=_.get("text-pitch-alignment")==="map",j=_.get("icon-text-fit")!=="none",W=new Eo(null,0,S&&(C||!o.hasIconData()||_.get("icon-optional")),C&&(S||!o.hasTextData()||_.get("text-optional")),!0);!o.collisionArrays&&f&&(o.hasIconCollisionBoxData()||o.hasTextCollisionBoxData())&&o.deserializeCollisionBoxes(f);const H=(X,B,q)=>{for(let Q=0;Q0||Q>0,ye=de>0,Ae=this.placedOrientations[ee],We=Ae===s.WritingMode.vertical,Ee=Ae===s.WritingMode.horizontal||Ae===s.WritingMode.horizontalOnly;if(!xe&&!ye||pe.isHidden()||Z++,xe){const Fe=Sl(pe.text);H(o.text,q,We?Ln:Fe),H(o.text,Q,Ee?Ln:Fe);const ke=pe.text.isHidden(),{leftJustifiedTextSymbolIndex:qe,centerJustifiedTextSymbolIndex:Se,rightJustifiedTextSymbolIndex:Be,verticalPlacedTextSymbolIndex:Xe}=B,$e=o.text.placedSymbolArray,Ye=ke||We?1:0;qe>=0&&($e.get(qe).hidden=Ye),Se>=0&&($e.get(Se).hidden=Ye),Be>=0&&($e.get(Be).hidden=Ye),Xe>=0&&($e.get(Xe).hidden=ke||Ee?1:0);const gt=this.variableOffsets[ee];gt&&this.markUsedJustification(o,gt.anchor,B,Ae);const Et=this.placedOrientations[ee];Et&&(this.markUsedJustification(o,"left",B,Et),this.markUsedOrientation(o,Et,B))}if(ye){const Fe=Sl(pe.icon),{placedIconSymbolIndex:ke,verticalPlacedIconSymbolIndex:qe}=B,Se=o.icon.placedSymbolArray,Be=pe.icon.isHidden()?1:0;ke>=0&&(H(o.icon,de,We?Ln:Fe),Se.get(ke).hidden=Be),qe>=0&&(H(o.icon,B.numVerticalIconVertices,Ee?Ln:Fe),Se.get(qe).hidden=Be)}if(o.hasIconCollisionBoxData()||o.hasTextCollisionBoxData()){const Fe=o.collisionArrays[X];if(Fe){let ke=new s.Point(0,0),qe=!0;if(Fe.textBox||Fe.verticalTextBox){if(z){const Be=this.variableOffsets[ee];Be?(ke=El(Be.anchor,Be.width,Be.height,Be.textOffset,Be.textScale),P&&ke._rotate(O?this.transform.angle:-this.transform.angle)):qe=!1}x&&(qe=!pe.clipped),Fe.textBox&&pa(o.textCollisionBox.collisionVertexArray,pe.text.placed,!qe||We,ke.x,ke.y),Fe.verticalTextBox&&pa(o.textCollisionBox.collisionVertexArray,pe.text.placed,!qe||Ee,ke.x,ke.y)}const Se=qe&&!!(!Ee&&Fe.verticalIconBox);Fe.iconBox&&pa(o.iconCollisionBox.collisionVertexArray,pe.icon.placed,Se,j?ke.x:0,j?ke.y:0),Fe.verticalIconBox&&pa(o.iconCollisionBox.collisionVertexArray,pe.icon.placed,!Se,j?ke.x:0,j?ke.y:0)}}}if(o.fullyClipped=Z===0,o.sortFeatures(this.transform.angle),this.retainedQueryData[o.bucketInstanceId]&&(this.retainedQueryData[o.bucketInstanceId].featureSortOrder=o.featureSortOrder),o.hasTextData()&&o.text.opacityVertexBuffer&&o.text.opacityVertexBuffer.updateData(o.text.opacityVertexArray),o.hasIconData()&&o.icon.opacityVertexBuffer&&o.icon.opacityVertexBuffer.updateData(o.icon.opacityVertexArray),o.hasIconCollisionBoxData()&&o.iconCollisionBox.collisionVertexBuffer&&o.iconCollisionBox.collisionVertexBuffer.updateData(o.iconCollisionBox.collisionVertexArray),o.hasTextCollisionBoxData()&&o.textCollisionBox.collisionVertexBuffer&&o.textCollisionBox.collisionVertexBuffer.updateData(o.textCollisionBox.collisionVertexArray),o.bucketInstanceId in this.collisionCircleArrays){const X=this.collisionCircleArrays[o.bucketInstanceId];o.placementInvProjMatrix=X.invProjMatrix,o.placementViewportMatrix=X.viewportMatrix,o.collisionCircleArray=X.circles,delete this.collisionCircleArrays[o.bucketInstanceId]}}symbolFadeChange(o){return this.fadeDuration===0?1:(o-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(o){return Math.max(0,(this.transform.zoom-o)/1.5)}hasTransitions(o){return this.stale||o-this.lastPlacementChangeTimeo}setStale(){this.stale=!0}}function pa(d,o,c,f,_){d.emplaceBack(o?1:0,c?1:0,f||0,_||0),d.emplaceBack(o?1:0,c?1:0,f||0,_||0),d.emplaceBack(o?1:0,c?1:0,f||0,_||0),d.emplaceBack(o?1:0,c?1:0,f||0,_||0)}const Gr=Math.pow(2,25),Fn=Math.pow(2,24),Ch=Math.pow(2,17),Ih=Math.pow(2,16),qr=Math.pow(2,9),gi=Math.pow(2,8),pf=Math.pow(2,1);function Sl(d){if(d.opacity===0&&!d.placed)return 0;if(d.opacity===1&&d.placed)return 4294967295;const o=d.placed?1:0,c=Math.floor(127*d.opacity);return c*Gr+o*Fn+c*Ch+o*Ih+c*qr+o*gi+c*pf+o}const Ln=0;class Al{constructor(o){this._sortAcrossTiles=o.layout.get("symbol-z-order")!=="viewport-y"&&o.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs=new Set,this._bucketParts=[]}continuePlacement(o,c,f,_,x){const T=this._bucketParts;for(;this._currentTileIndexS.sortKey-C.sortKey));this._currentPartIndex{const T=s.exported.now()-_;return!this._forceFullPlacement&&T>2};for(;this._currentPlacementIndex>=0;){const T=c[o[this._currentPlacementIndex]],S=this.placement.collisionIndex.transform.zoom;if(T.type==="symbol"&&(!T.minzoom||T.minzoom<=S)&&(!T.maxzoom||T.maxzoom>S)){if(this._inProgressLayer||(this._inProgressLayer=new Al(T)),this._inProgressLayer.continuePlacement(f[T.source],this.placement,this._showCollisionBoxes,T,x))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(o){return this.placement.commit(o),this.placement}}const Ms=512/s.EXTENT/2;class Er{constructor(o,c,f){this.tileID=o,this.bucketInstanceId=f,this.index=new s.KDBush(c.length,16,Int32Array),this.keys=[],this.crossTileIDs=[];const _=o.canonical.x*s.EXTENT,x=o.canonical.y*s.EXTENT;for(let T=0;To.overscaledZ)for(const S in T){const C=T[S];C.tileID.isChildOf(o)&&C.findMatches(c.symbolInstances,o,_)}else{const S=T[o.scaledTo(Number(x)).key];S&&S.findMatches(c.symbolInstances,o,_)}}for(let x=0;x{c[f]=!0});for(const f in this.layerIndexes)c[f]||delete this.layerIndexes[f]}}const ns=(d,o)=>s.emitValidationErrors(d,o&&o.filter(c=>c.identifier!=="source.canvas")),Mc=s.pick(Jt,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setTerrain","setFog","setProjection"]),q_=s.pick(Jt,["setCenter","setZoom","setBearing","setPitch"]),zh={version:8,layers:[],sources:{}},fa={fill:!0,line:!0,background:!0,hillshade:!0,raster:!0};class to extends s.Evented{constructor(o,c={}){super(),this.map=o,this.dispatcher=new xt(ha(),this),this.imageManager=new wr,this.imageManager.setEventedParent(this),this.glyphManager=new s.GlyphManager(o._requestManager,c.localFontFamily?s.LocalGlyphMode.all:c.localIdeographFontFamily?s.LocalGlyphMode.ideographs:s.LocalGlyphMode.none,c.localFontFamily||c.localIdeographFontFamily),this.crossTileSymbolIndex=new To,this._layers={},this._num3DLayers=0,this._numSymbolLayers=0,this._numCircleLayers=0,this._serializedLayers={},this._sourceCaches={},this._otherSourceCaches={},this._symbolSourceCaches={},this._loaded=!1,this._availableImages=[],this._order=[],this._drapedFirstOrder=[],this._markersNeedUpdate=!1,this._resetUpdates(),this.dispatcher.broadcast("setReferrer",s.getReferrer());const f=this;this._rtlTextPluginCallback=to.registerForPluginStateChange(_=>{f.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:_.pluginStatus,pluginURL:_.pluginURL},(x,T)=>{if(s.triggerPluginCompletionEvent(x),T&&T.every(S=>S))for(const S in f._sourceCaches){const C=f._sourceCaches[S],z=C.getSource().type;z!=="vector"&&z!=="geojson"||C.reload()}})}),this.on("data",_=>{if(_.dataType!=="source"||_.sourceDataType!=="metadata")return;const x=this.getSource(_.sourceId);if(x&&x.vectorLayerIds)for(const T in this._layers){const S=this._layers[T];S.source===x.id&&this._validateLayer(S)}})}loadURL(o,c={}){this.fire(new s.Event("dataloading",{dataType:"style"}));const f=typeof c.validate=="boolean"?c.validate:!s.isMapboxURL(o);o=this.map._requestManager.normalizeStyleURL(o,c.accessToken);const _=this.map._requestManager.transformRequest(o,s.ResourceType.Style);this._request=s.getJSON(_,(x,T)=>{this._request=null,x?this.fire(new s.ErrorEvent(x)):T&&this._load(T,f)})}loadJSON(o,c={}){this.fire(new s.Event("dataloading",{dataType:"style"})),this._request=s.exported.frame(()=>{this._request=null,this._load(o,c.validate!==!1)})}loadEmpty(){this.fire(new s.Event("dataloading",{dataType:"style"})),this._load(zh,!1)}_updateLayerCount(o,c){const f=c?1:-1;o.is3D()&&(this._num3DLayers+=f),o.type==="circle"&&(this._numCircleLayers+=f),o.type==="symbol"&&(this._numSymbolLayers+=f)}_load(o,c){if(c&&ns(this,s.validateStyle(o)))return;this._loaded=!0,this.stylesheet=s.clone$1(o),this._updateMapProjection();for(const _ in o.sources)this.addSource(_,o.sources[_],{validate:!1});this._changed=!1,o.sprite?this._loadSprite(o.sprite):(this.imageManager.setLoaded(!0),this.dispatcher.broadcast("spriteLoaded",!0)),this.glyphManager.setURL(o.glyphs);const f=lf(this.stylesheet.layers);this._order=f.map(_=>_.id),this._layers={},this._serializedLayers={};for(const _ of f){const x=s.createStyleLayer(_);x.setEventedParent(this,{layer:{id:x.id}}),this._layers[x.id]=x,this._serializedLayers[x.id]=x.serialize(),this._updateLayerCount(x,!0)}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new Vt(this.stylesheet.light),this.stylesheet.terrain&&!this.terrainSetForDrapingOnly()&&this._createTerrain(this.stylesheet.terrain,1),this.stylesheet.fog&&this._createFog(this.stylesheet.fog),this._updateDrapeFirstLayers(),this.fire(new s.Event("data",{dataType:"style"})),this.fire(new s.Event("style.load"))}terrainSetForDrapingOnly(){return!!this.terrain&&this.terrain.drapeRenderMode===0}setProjection(o){o?this.stylesheet.projection=o:delete this.stylesheet.projection,this._updateMapProjection()}applyProjectionUpdate(){this._loaded&&(this.dispatcher.broadcast("setProjection",this.map.transform.projectionOptions),this.map.transform.projection.requiresDraping?this.getTerrain()||this.stylesheet.terrain||this.setTerrainForDraping():this.terrainSetForDrapingOnly()&&this.setTerrain(null))}_updateMapProjection(){this.map._useExplicitProjection?this.applyProjectionUpdate():this.map._prioritizeAndUpdateProjection(null,this.stylesheet.projection)}_loadSprite(o){this._spriteRequest=function(c,f,_){let x,T,S;const C=s.exported.devicePixelRatio>1?"@2x":"";let z=s.getJSON(f.transformRequest(f.normalizeSpriteURL(c,C,".json"),s.ResourceType.SpriteJSON),(j,W)=>{z=null,S||(S=j,x=W,O())}),P=s.getImage(f.transformRequest(f.normalizeSpriteURL(c,C,".png"),s.ResourceType.SpriteImage),(j,W)=>{P=null,S||(S=j,T=W,O())});function O(){if(S)_(S);else if(x&&T){const j=s.exported.getImageData(T),W={};for(const H in x){const{width:Z,height:X,x:B,y:q,sdf:Q,pixelRatio:ee,stretchX:de,stretchY:fe,content:pe}=x[H],xe=new s.RGBAImage({width:Z,height:X});s.RGBAImage.copy(j,xe,{x:B,y:q},{x:0,y:0},{width:Z,height:X}),W[H]={data:xe,pixelRatio:ee,sdf:Q,stretchX:de,stretchY:fe,content:pe}}_(null,W)}}return{cancel(){z&&(z.cancel(),z=null),P&&(P.cancel(),P=null)}}}(o,this.map._requestManager,(c,f)=>{if(this._spriteRequest=null,c)this.fire(new s.ErrorEvent(c));else if(f)for(const _ in f)this.imageManager.addImage(_,f[_]);this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),this.dispatcher.broadcast("setImages",this._availableImages),this.dispatcher.broadcast("spriteLoaded",!0),this.fire(new s.Event("data",{dataType:"style"}))})}_validateLayer(o){const c=this.getSource(o.source);if(!c)return;const f=o.sourceLayer;f&&(c.type==="geojson"||c.vectorLayerIds&&c.vectorLayerIds.indexOf(f)===-1)&&this.fire(new s.ErrorEvent(new Error(`Source layer "${f}" does not exist on source "${c.id}" as specified by style layer "${o.id}"`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const o in this._sourceCaches)if(!this._sourceCaches[o].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeLayers(o){const c=[];for(const f of o){const _=this._layers[f];_.type!=="custom"&&c.push(_.serialize())}return c}hasTransitions(){if(this.light&&this.light.hasTransition()||this.fog&&this.fog.hasTransition())return!0;for(const o in this._sourceCaches)if(this._sourceCaches[o].hasTransition())return!0;for(const o in this._layers)if(this._layers[o].hasTransition())return!0;return!1}get order(){return this.map._optimizeForTerrain&&this.terrain?this._drapedFirstOrder:this._order}isLayerDraped(o){return!!this.terrain&&(typeof o.isLayerDraped=="function"?o.isLayerDraped():fa[o.type])}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading")}update(o){if(!this._loaded)return;const c=this._changed;if(this._changed){const _=Object.keys(this._updatedLayers),x=Object.keys(this._removedLayers);(_.length||x.length)&&this._updateWorkerLayers(_,x);for(const T in this._updatedSources){const S=this._updatedSources[T];S==="reload"?this._reloadSource(T):S==="clear"&&this._clearSource(T)}this._updateTilesForChangedImages();for(const T in this._updatedPaintProps)this._layers[T].updateTransitions(o);this.light.updateTransitions(o),this.fog&&this.fog.updateTransitions(o),this._resetUpdates()}const f={};for(const _ in this._sourceCaches){const x=this._sourceCaches[_];f[_]=x.used,x.used=!1}for(const _ of this._order){const x=this._layers[_];if(x.recalculate(o,this._availableImages),!x.isHidden(o.zoom)){const S=this._getLayerSourceCache(x);S&&(S.used=!0)}const T=this.map.painter;if(T){const S=x.getProgramIds();if(!S)continue;const C=x.getProgramConfiguration(o.zoom);for(const z of S)T.useProgram(z,C)}}for(const _ in f){const x=this._sourceCaches[_];f[_]!==x.used&&x.getSource().fire(new s.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:x.getSource().id}))}this.light.recalculate(o),this.terrain&&this.terrain.recalculate(o),this.fog&&this.fog.recalculate(o),this.z=o.zoom,this._markersNeedUpdate&&(this._updateMarkersOpacity(),this._markersNeedUpdate=!1),c&&this.fire(new s.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){const o=Object.keys(this._changedImages);if(o.length){for(const c in this._sourceCaches)this._sourceCaches[c].reloadTilesForDependencies(["icons","patterns"],o);this._changedImages={}}}_updateWorkerLayers(o,c){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(o),removedIds:c})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}}setState(o){if(this._checkLoaded(),ns(this,s.validateStyle(o)))return!1;(o=s.clone$1(o)).layers=lf(o.layers);const c=function(_,x){if(!_)return[{command:Jt.setStyle,args:[x]}];let T=[];try{if(!k(_.version,x.version))return[{command:Jt.setStyle,args:[x]}];k(_.center,x.center)||T.push({command:Jt.setCenter,args:[x.center]}),k(_.zoom,x.zoom)||T.push({command:Jt.setZoom,args:[x.zoom]}),k(_.bearing,x.bearing)||T.push({command:Jt.setBearing,args:[x.bearing]}),k(_.pitch,x.pitch)||T.push({command:Jt.setPitch,args:[x.pitch]}),k(_.sprite,x.sprite)||T.push({command:Jt.setSprite,args:[x.sprite]}),k(_.glyphs,x.glyphs)||T.push({command:Jt.setGlyphs,args:[x.glyphs]}),k(_.transition,x.transition)||T.push({command:Jt.setTransition,args:[x.transition]}),k(_.light,x.light)||T.push({command:Jt.setLight,args:[x.light]}),k(_.fog,x.fog)||T.push({command:Jt.setFog,args:[x.fog]}),k(_.projection,x.projection)||T.push({command:Jt.setProjection,args:[x.projection]});const S={},C=[];(function(O,j,W,H){let Z;for(Z in j=j||{},O=O||{})O.hasOwnProperty(Z)&&(j.hasOwnProperty(Z)||yl(Z,W,H));for(Z in j){if(!j.hasOwnProperty(Z))continue;const X=j[Z];O.hasOwnProperty(Z)?k(O[Z],X)||(O[Z].type==="geojson"&&X.type==="geojson"&&Ic(O,j,Z)?W.push({command:Jt.setGeoJSONSourceData,args:[Z,X.data]}):bh(Z,j,W,H)):wh(Z,j,W)}})(_.sources,x.sources,C,S);const z=[];_.layers&&_.layers.forEach(O=>{O.source&&S[O.source]?T.push({command:Jt.removeLayer,args:[O.id]}):z.push(O)});let P=_.terrain;P&&S[P.source]&&(T.push({command:Jt.setTerrain,args:[void 0]}),P=void 0),T=T.concat(C),k(P,x.terrain)||T.push({command:Jt.setTerrain,args:[x.terrain]}),function(O,j,W){j=j||[];const H=(O=O||[]).map(xo),Z=j.map(xo),X=O.reduce(Eh,{}),B=j.reduce(Eh,{}),q=H.slice(),Q=Object.create(null);let ee,de,fe,pe,xe,ye,Ae;for(ee=0,de=0;ee!(_.command in q_));if(c.length===0)return!1;const f=c.filter(_=>!(_.command in Mc));if(f.length>0)throw new Error(`Unimplemented: ${f.map(_=>_.command).join(", ")}.`);return c.forEach(_=>{_.command!=="setTransition"&&_.command!=="setProjection"&&this[_.command].apply(this,_.args)}),this.stylesheet=o,this._updateMapProjection(),!0}addImage(o,c){return this.getImage(o)?this.fire(new s.ErrorEvent(new Error("An image with this name already exists."))):(this.imageManager.addImage(o,c),this._afterImageUpdated(o),this)}updateImage(o,c){this.imageManager.updateImage(o,c)}getImage(o){return this.imageManager.getImage(o)}removeImage(o){return this.getImage(o)?(this.imageManager.removeImage(o),this._afterImageUpdated(o),this):this.fire(new s.ErrorEvent(new Error("No image with this name exists.")))}_afterImageUpdated(o){this._availableImages=this.imageManager.listImages(),this._changedImages[o]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new s.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this._availableImages.slice()}addSource(o,c,f={}){if(this._checkLoaded(),this.getSource(o)!==void 0)throw new Error("There is already a source with this ID");if(!c.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(c).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(c.type)>=0&&this._validate(s.validateSource,`sources.${o}`,c,null,f))return;this.map&&this.map._collectResourceTiming&&(c.collectResourceTiming=!0);const _=Dt(o,c,this.dispatcher,this);_.setEventedParent(this,()=>({isSourceLoaded:this._isSourceCacheLoaded(o),source:_.serialize(),sourceId:o}));const x=T=>{const S=(T?"symbol:":"other:")+o,C=this._sourceCaches[S]=new s.SourceCache(S,_,T);(T?this._symbolSourceCaches:this._otherSourceCaches)[o]=C,C.style=this,C.onAdd(this.map)};x(!1),c.type!=="vector"&&c.type!=="geojson"||x(!0),_.onAdd&&_.onAdd(this.map),this._changed=!0}removeSource(o){this._checkLoaded();const c=this.getSource(o);if(!c)throw new Error("There is no source with this ID");for(const _ in this._layers)if(this._layers[_].source===o)return this.fire(new s.ErrorEvent(new Error(`Source "${o}" cannot be removed while layer "${_}" is using it.`)));if(this.terrain&&this.terrain.get().source===o)return this.fire(new s.ErrorEvent(new Error(`Source "${o}" cannot be removed while terrain is using it.`)));const f=this._getSourceCaches(o);for(const _ of f)delete this._sourceCaches[_.id],delete this._updatedSources[_.id],_.fire(new s.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:_.getSource().id})),_.setEventedParent(null),_.clearTiles();return delete this._otherSourceCaches[o],delete this._symbolSourceCaches[o],c.setEventedParent(null),c.onRemove&&c.onRemove(this.map),this._changed=!0,this}setGeoJSONSourceData(o,c){this._checkLoaded(),this.getSource(o).setData(c),this._changed=!0}getSource(o){const c=this._getSourceCache(o);return c&&c.getSource()}_getSources(){const o=[];for(const c in this._otherSourceCaches){const f=this._getSourceCache(c);f&&o.push(f.getSource())}return o}addLayer(o,c,f={}){this._checkLoaded();const _=o.id;if(this.getLayer(_))return void this.fire(new s.ErrorEvent(new Error(`Layer with id "${_}" already exists on this map`)));let x;if(o.type==="custom"){if(ns(this,s.validateCustomStyleLayer(o)))return;x=s.createStyleLayer(o)}else{if(typeof o.source=="object"&&(this.addSource(_,o.source),o=s.clone$1(o),o=s.extend(o,{source:_})),this._validate(s.validateLayer,`layers.${_}`,o,{arrayIndex:-1},f))return;x=s.createStyleLayer(o),this._validateLayer(x),x.setEventedParent(this,{layer:{id:_}}),this._serializedLayers[x.id]=x.serialize(),this._updateLayerCount(x,!0)}const T=c?this._order.indexOf(c):this._order.length;if(c&&T===-1)return void this.fire(new s.ErrorEvent(new Error(`Layer with id "${c}" does not exist on this map.`)));this._order.splice(T,0,_),this._layerOrderChanged=!0,this._layers[_]=x;const S=this._getLayerSourceCache(x);if(this._removedLayers[_]&&x.source&&S&&x.type!=="custom"){const C=this._removedLayers[_];delete this._removedLayers[_],C.type!==x.type?this._updatedSources[x.source]="clear":(this._updatedSources[x.source]="reload",S.pause())}this._updateLayer(x),x.onAdd&&x.onAdd(this.map),this._updateDrapeFirstLayers()}moveLayer(o,c){if(this._checkLoaded(),this._changed=!0,!this._layers[o])return void this.fire(new s.ErrorEvent(new Error(`The layer '${o}' does not exist in the map's style and cannot be moved.`)));if(o===c)return;const f=this._order.indexOf(o);this._order.splice(f,1);const _=c?this._order.indexOf(c):this._order.length;c&&_===-1?this.fire(new s.ErrorEvent(new Error(`Layer with id "${c}" does not exist on this map.`))):(this._order.splice(_,0,o),this._layerOrderChanged=!0,this._updateDrapeFirstLayers())}removeLayer(o){this._checkLoaded();const c=this._layers[o];if(!c)return void this.fire(new s.ErrorEvent(new Error(`The layer '${o}' does not exist in the map's style and cannot be removed.`)));c.setEventedParent(null),this._updateLayerCount(c,!1);const f=this._order.indexOf(o);this._order.splice(f,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[o]=c,delete this._layers[o],delete this._serializedLayers[o],delete this._updatedLayers[o],delete this._updatedPaintProps[o],c.onRemove&&c.onRemove(this.map),this._updateDrapeFirstLayers()}getLayer(o){return this._layers[o]}hasLayer(o){return o in this._layers}hasLayerType(o){for(const c in this._layers)if(this._layers[c].type===o)return!0;return!1}setLayerZoomRange(o,c,f){this._checkLoaded();const _=this.getLayer(o);_?_.minzoom===c&&_.maxzoom===f||(c!=null&&(_.minzoom=c),f!=null&&(_.maxzoom=f),this._updateLayer(_)):this.fire(new s.ErrorEvent(new Error(`The layer '${o}' does not exist in the map's style and cannot have zoom extent.`)))}setFilter(o,c,f={}){this._checkLoaded();const _=this.getLayer(o);if(_){if(!k(_.filter,c))return c==null?(_.filter=void 0,void this._updateLayer(_)):void(this._validate(s.validateFilter,`layers.${_.id}.filter`,c,{layerType:_.type},f)||(_.filter=s.clone$1(c),this._updateLayer(_)))}else this.fire(new s.ErrorEvent(new Error(`The layer '${o}' does not exist in the map's style and cannot be filtered.`)))}getFilter(o){const c=this.getLayer(o);return c&&s.clone$1(c.filter)}setLayoutProperty(o,c,f,_={}){this._checkLoaded();const x=this.getLayer(o);x?k(x.getLayoutProperty(c),f)||(x.setLayoutProperty(c,f,_),this._updateLayer(x)):this.fire(new s.ErrorEvent(new Error(`The layer '${o}' does not exist in the map's style and cannot be styled.`)))}getLayoutProperty(o,c){const f=this.getLayer(o);if(f)return f.getLayoutProperty(c);this.fire(new s.ErrorEvent(new Error(`The layer '${o}' does not exist in the map's style.`)))}setPaintProperty(o,c,f,_={}){this._checkLoaded();const x=this.getLayer(o);x?k(x.getPaintProperty(c),f)||(x.setPaintProperty(c,f,_)&&this._updateLayer(x),this._changed=!0,this._updatedPaintProps[o]=!0):this.fire(new s.ErrorEvent(new Error(`The layer '${o}' does not exist in the map's style and cannot be styled.`)))}getPaintProperty(o,c){const f=this.getLayer(o);return f&&f.getPaintProperty(c)}setFeatureState(o,c){this._checkLoaded();const f=o.source,_=o.sourceLayer,x=this.getSource(f);if(!x)return void this.fire(new s.ErrorEvent(new Error(`The source '${f}' does not exist in the map's style.`)));const T=x.type;if(T==="geojson"&&_)return void this.fire(new s.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));if(T==="vector"&&!_)return void this.fire(new s.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));o.id===void 0&&this.fire(new s.ErrorEvent(new Error("The feature id parameter must be provided.")));const S=this._getSourceCaches(f);for(const C of S)C.setFeatureState(_,o.id,c)}removeFeatureState(o,c){this._checkLoaded();const f=o.source,_=this.getSource(f);if(!_)return void this.fire(new s.ErrorEvent(new Error(`The source '${f}' does not exist in the map's style.`)));const x=_.type,T=x==="vector"?o.sourceLayer:void 0;if(x==="vector"&&!T)return void this.fire(new s.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));if(c&&typeof o.id!="string"&&typeof o.id!="number")return void this.fire(new s.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));const S=this._getSourceCaches(f);for(const C of S)C.removeFeatureState(T,o.id,c)}getFeatureState(o){this._checkLoaded();const c=o.source,f=o.sourceLayer,_=this.getSource(c);if(_){if(_.type!=="vector"||f)return o.id===void 0&&this.fire(new s.ErrorEvent(new Error("The feature id parameter must be provided."))),this._getSourceCaches(c)[0].getFeatureState(f,o.id);this.fire(new s.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new s.ErrorEvent(new Error(`The source '${c}' does not exist in the map's style.`)))}getTransition(){return s.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){const o={};for(const c in this._sourceCaches){const f=this._sourceCaches[c].getSource();o[f.id]||(o[f.id]=f.serialize())}return s.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,terrain:this.getTerrain()||void 0,fog:this.stylesheet.fog,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,projection:this.stylesheet.projection,sources:o,layers:this._serializeLayers(this._order)},c=>c!==void 0)}_updateLayer(o){this._updatedLayers[o.id]=!0;const c=this._getLayerSourceCache(o);o.source&&!this._updatedSources[o.source]&&c&&c.getSource().type!=="raster"&&(this._updatedSources[o.source]="reload",c.pause()),this._changed=!0,o.invalidateCompiledFilter()}_flattenAndSortRenderedFeatures(o){const c=T=>this._layers[T].type==="fill-extrusion",f={},_=[];for(let T=this._order.length-1;T>=0;T--){const S=this._order[T];if(c(S)){f[S]=T;for(const C of o){const z=C[S];if(z)for(const P of z)_.push(P)}}}_.sort((T,S)=>S.intersectionZ-T.intersectionZ);const x=[];for(let T=this._order.length-1;T>=0;T--){const S=this._order[T];if(c(S))for(let C=_.length-1;C>=0;C--){const z=_[C].feature;if(f[z.layer.id]{const z=this.getLayer(C);return z&&z.is3D()}):this.has3DLayers(),S=dn.createFromScreenPoints(o,f);for(const C in this._sourceCaches){const z=this._sourceCaches[C].getSource().id;c.layers&&!_[z]||x.push(In(this._sourceCaches[C],this._layers,this._serializedLayers,S,c,f,T,!!this.map._showQueryGeometry))}return this.placement&&x.push(function(C,z,P,O,j,W,H){const Z={},X=W.queryRenderedSymbols(O),B=[];for(const q of Object.keys(X).map(Number))B.push(H[q]);B.sort(Ir);for(const q of B){const Q=q.featureIndex.lookupSymbolFeatures(X[q.bucketInstanceId],z,q.bucketIndex,q.sourceLayerIndex,j.filter,j.layers,j.availableImages,C);for(const ee in Q){const de=Z[ee]=Z[ee]||[],fe=Q[ee];fe.sort((pe,xe)=>{const ye=q.featureSortOrder;if(ye){const Ae=ye.indexOf(pe.featureIndex);return ye.indexOf(xe.featureIndex)-Ae}return xe.featureIndex-pe.featureIndex});for(const pe of fe)de.push(pe)}}for(const q in Z)Z[q].forEach(Q=>{const ee=Q.feature,de=P(C[q]);if(!de)return;const fe=de.getFeatureState(ee.layer["source-layer"],ee.id);ee.source=ee.layer.source,ee.layer["source-layer"]&&(ee.sourceLayer=ee.layer["source-layer"]),ee.state=fe});return Z}(this._layers,this._serializedLayers,this._getLayerSourceCache.bind(this),S.screenGeometry,c,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(x)}querySourceFeatures(o,c){c&&c.filter&&this._validate(s.validateFilter,"querySourceFeatures.filter",c.filter,null,c);const f=this._getSourceCaches(o);let _=[];for(const x of f)_=_.concat(Vn(x,c));return _}addSourceType(o,c,f){return to.getSourceType(o)?f(new Error(`A source type called "${o}" already exists.`)):(to.setSourceType(o,c),c.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:o,url:c.workerSourceURL},f):f(null,null))}getLight(){return this.light.getLight()}setLight(o,c={}){this._checkLoaded();const f=this.light.getLight();let _=!1;for(const T in o)if(!k(o[T],f[T])){_=!0;break}if(!_)return;const x=this._setTransitionParameters({duration:300,delay:0});this.light.setLight(o,c),this.light.updateTransitions(x)}getTerrain(){return this.terrain&&this.terrain.drapeRenderMode===1?this.terrain.get():null}setTerrainForDraping(){this.setTerrain({source:"",exaggeration:0},0)}setTerrain(o,c=1){if(this._checkLoaded(),!o)return delete this.terrain,delete this.stylesheet.terrain,this.dispatcher.broadcast("enableTerrain",!1),this._force3DLayerUpdate(),void(this._markersNeedUpdate=!0);let f=o;if(c===1){if(typeof f.source=="object"){const _="terrain-dem-src";this.addSource(_,f.source),f=s.clone$1(f),f=s.extend(f,{source:_})}if(this._validate(s.validateTerrain,"terrain",f))return}if(!this.terrain||this.terrain&&c!==this.terrain.drapeRenderMode){if(!f)return;this._createTerrain(f,c)}else{const _=this.terrain,x=_.get();for(const T of Object.keys(s.spec.terrain))!f.hasOwnProperty(T)&&s.spec.terrain[T].default&&(f[T]=s.spec.terrain[T].default);for(const T in f)if(!k(f[T],x[T])){_.set(f),this.stylesheet.terrain=f;const S=this._setTransitionParameters({duration:0});_.updateTransitions(S);break}}this._updateDrapeFirstLayers(),this._markersNeedUpdate=!0}_createFog(o){const c=this.fog=new Tt(o,this.map.transform);this.stylesheet.fog=o;const f=this._setTransitionParameters({duration:0});c.updateTransitions(f)}_updateMarkersOpacity(){this.map._markers.length!==0&&this.map._requestDomTask(()=>{for(const o of this.map._markers)o._evaluateOpacity()})}getFog(){return this.fog?this.fog.get():null}setFog(o){if(this._checkLoaded(),!o)return delete this.fog,delete this.stylesheet.fog,void(this._markersNeedUpdate=!0);if(this.fog){const c=this.fog,f=c.get();Object.keys(o).length===0&&c.set(o);for(const _ in o)if(!k(o[_],f[_])){c.set(o),this.stylesheet.fog=o;const x=this._setTransitionParameters({duration:0});c.updateTransitions(x);break}}else this._createFog(o);this._markersNeedUpdate=!0}_setTransitionParameters(o){return{now:s.exported.now(),transition:s.extend(o,this.stylesheet.transition)}}_updateDrapeFirstLayers(){if(!this.map._optimizeForTerrain||!this.terrain)return;const o=this._order.filter(f=>this.isLayerDraped(this._layers[f])),c=this._order.filter(f=>!this.isLayerDraped(this._layers[f]));this._drapedFirstOrder=[],this._drapedFirstOrder.push(...o),this._drapedFirstOrder.push(...c)}_createTerrain(o,c){const f=this.terrain=new $r(o,c);this.stylesheet.terrain=o,this.dispatcher.broadcast("enableTerrain",!this.terrainSetForDrapingOnly()),this._force3DLayerUpdate();const _=this._setTransitionParameters({duration:0});f.updateTransitions(_)}_force3DLayerUpdate(){for(const o in this._layers){const c=this._layers[o];c.type==="fill-extrusion"&&this._updateLayer(c)}}_forceSymbolLayerUpdate(){for(const o in this._layers){const c=this._layers[o];c.type==="symbol"&&this._updateLayer(c)}}_validate(o,c,f,_,x={}){return(!x||x.validate!==!1)&&ns(this,o.call(s.validateStyle,s.extend({key:c,style:this.serialize(),value:f,styleSpec:s.spec},_)))}_remove(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),s.evented.off("pluginStateChange",this._rtlTextPluginCallback);for(const o in this._layers)this._layers[o].setEventedParent(null);for(const o in this._sourceCaches)this._sourceCaches[o].clearTiles(),this._sourceCaches[o].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()}_clearSource(o){const c=this._getSourceCaches(o);for(const f of c)f.clearTiles()}_reloadSource(o){const c=this._getSourceCaches(o);for(const f of c)f.resume(),f.reload()}_reloadSources(){for(const o of this._getSources())o.reload&&o.reload()}_updateSources(o){for(const c in this._sourceCaches)this._sourceCaches[c].update(o)}_generateCollisionBoxes(){for(const o in this._sourceCaches){const c=this._sourceCaches[o];c.resume(),c.reload()}}_updatePlacement(o,c,f,_,x=!1){let T=!1,S=!1;const C={};for(const z of this._order){const P=this._layers[z];if(P.type!=="symbol")continue;if(!C[P.source]){const j=this._getLayerSourceCache(P);if(!j)continue;C[P.source]=j.getRenderableIds(!0).map(W=>j.getTileByID(W)).sort((W,H)=>H.tileID.overscaledZ-W.tileID.overscaledZ||(W.tileID.isLessThan(H.tileID)?-1:1))}const O=this.crossTileSymbolIndex.addLayer(P,C[P.source],o.center.lng,o.projection);T=T||O}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),x=x||this._layerOrderChanged||f===0,this._layerOrderChanged&&this.fire(new s.Event("neworder")),(x||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(s.exported.now(),o.zoom))&&(this.pauseablePlacement=new kh(o,this._order,x,c,f,_,this.placement,this.fog&&o.projection.supportsFog?this.fog.state:null),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,C),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(s.exported.now()),S=!0),T&&this.pauseablePlacement.placement.setStale()),S||T)for(const z of this._order){const P=this._layers[z];P.type==="symbol"&&this.placement.updateLayerOpacities(P,C[P.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(s.exported.now())}_releaseSymbolFadeTiles(){for(const o in this._sourceCaches)this._sourceCaches[o].releaseSymbolFadeTiles()}getImages(o,c,f){this.imageManager.getImages(c.icons,f),this._updateTilesForChangedImages();const _=x=>{x&&x.setDependencies(c.tileID.key,c.type,c.icons)};_(this._otherSourceCaches[c.source]),_(this._symbolSourceCaches[c.source])}getGlyphs(o,c,f){this.glyphManager.getGlyphs(c.stacks,f)}getResource(o,c,f){return s.makeRequest(c,f)}_getSourceCache(o){return this._otherSourceCaches[o]}_getLayerSourceCache(o){return o.type==="symbol"?this._symbolSourceCaches[o.source]:this._otherSourceCaches[o.source]}_getSourceCaches(o){const c=[];return this._otherSourceCaches[o]&&c.push(this._otherSourceCaches[o]),this._symbolSourceCaches[o]&&c.push(this._symbolSourceCaches[o]),c}_isSourceCacheLoaded(o){const c=this._getSourceCaches(o);return c.length===0?(this.fire(new s.ErrorEvent(new Error(`There is no source with ID '${o}'`))),!1):c.every(f=>f.loaded())}has3DLayers(){return this._num3DLayers>0}hasSymbolLayers(){return this._numSymbolLayers>0}hasCircleLayers(){return this._numCircleLayers>0}_clearWorkerCaches(){this.dispatcher.broadcast("clearCaches")}destroy(){this._clearWorkerCaches(),this.terrainSetForDrapingOnly()&&(delete this.terrain,delete this.stylesheet.terrain)}}to.getSourceType=function(d){return Pt[d]},to.setSourceType=function(d,o){Pt[d]=o},to.registerForPluginStateChange=s.registerForPluginStateChange;var Lh=` +#define EPSILON 0.0000001 +#define PI 3.141592653589793 +#define EXTENT 8192.0 +#define HALF_PI PI/2.0 +#define QUARTER_PI PI/4.0 +#define RAD_TO_DEG 180.0/PI +#define DEG_TO_RAD PI/180.0 +#define GLOBE_RADIUS EXTENT/PI/2.0`,Ps="attribute highp vec3 a_pos_3f;uniform lowp mat4 u_matrix;varying highp vec3 v_uv;void main() {const mat3 half_neg_pi_around_x=mat3(1.0,0.0, 0.0,0.0,0.0,-1.0,0.0,1.0, 0.0);v_uv=half_neg_pi_around_x*a_pos_3f;vec4 pos=u_matrix*vec4(a_pos_3f,1.0);gl_Position=pos.xyww;}",So=` +#define ELEVATION_SCALE 7.0 +#define ELEVATION_OFFSET 450.0 +#ifdef PROJECTION_GLOBE_VIEW +uniform vec3 u_tile_tl_up;uniform vec3 u_tile_tr_up;uniform vec3 u_tile_br_up;uniform vec3 u_tile_bl_up;uniform float u_tile_up_scale;vec3 elevationVector(vec2 pos) {vec2 uv=pos/EXTENT;vec3 up=normalize(mix( +mix(u_tile_tl_up,u_tile_tr_up,uv.xxx),mix(u_tile_bl_up,u_tile_br_up,uv.xxx),uv.yyy));return up*u_tile_up_scale;} +#else +vec3 elevationVector(vec2 pos) { return vec3(0,0,1); } +#endif +const float skirtOffset=24575.0;vec3 decomposeToPosAndSkirt(vec2 posWithComposedSkirt) +{float skirt=float(posWithComposedSkirt.x >=skirtOffset);vec2 pos=posWithComposedSkirt-vec2(skirt*skirtOffset,0.0);return vec3(pos,skirt);} +#ifdef TERRAIN +#ifdef TERRAIN_DEM_FLOAT_FORMAT +uniform highp sampler2D u_dem;uniform highp sampler2D u_dem_prev; +#else +uniform sampler2D u_dem;uniform sampler2D u_dem_prev; +#endif +uniform vec4 u_dem_unpack;uniform vec2 u_dem_tl;uniform vec2 u_dem_tl_prev;uniform float u_dem_scale;uniform float u_dem_scale_prev;uniform float u_dem_size;uniform float u_dem_lerp;uniform float u_exaggeration;uniform float u_meter_to_dem;uniform mat4 u_label_plane_matrix_inv;uniform sampler2D u_depth;uniform vec2 u_depth_size_inv;vec4 tileUvToDemSample(vec2 uv,float dem_size,float dem_scale,vec2 dem_tl) {vec2 pos=dem_size*(uv*dem_scale+dem_tl)+1.0;vec2 f=fract(pos);return vec4((pos-f+0.5)/(dem_size+2.0),f);}float decodeElevation(vec4 v) {return dot(vec4(v.xyz*255.0,-1.0),u_dem_unpack);}float currentElevation(vec2 apos) { +#ifdef TERRAIN_DEM_FLOAT_FORMAT +vec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale+u_dem_tl)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture2D(u_dem,pos).a; +#else +float dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale,u_dem_tl);vec2 pos=r.xy;vec2 f=r.zw;float tl=decodeElevation(texture2D(u_dem,pos)); +#ifdef TERRAIN_DEM_NEAREST_FILTER +return u_exaggeration*tl; +#endif +float tr=decodeElevation(texture2D(u_dem,pos+vec2(dd,0.0)));float bl=decodeElevation(texture2D(u_dem,pos+vec2(0.0,dd)));float br=decodeElevation(texture2D(u_dem,pos+vec2(dd,dd)));return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y); +#endif +}float prevElevation(vec2 apos) { +#ifdef TERRAIN_DEM_FLOAT_FORMAT +vec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale_prev+u_dem_tl_prev)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture2D(u_dem_prev,pos).a; +#else +float dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale_prev,u_dem_tl_prev);vec2 pos=r.xy;vec2 f=r.zw;float tl=decodeElevation(texture2D(u_dem_prev,pos));float tr=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,0.0)));float bl=decodeElevation(texture2D(u_dem_prev,pos+vec2(0.0,dd)));float br=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,dd)));return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y); +#endif +} +#ifdef TERRAIN_VERTEX_MORPHING +float elevation(vec2 apos) { +#ifdef ZERO_EXAGGERATION +return 0.0; +#endif +float nextElevation=currentElevation(apos);float prevElevation=prevElevation(apos);return mix(prevElevation,nextElevation,u_dem_lerp);} +#else +float elevation(vec2 apos) { +#ifdef ZERO_EXAGGERATION +return 0.0; +#endif +return currentElevation(apos);} +#endif +highp float unpack_depth(highp vec4 rgba_depth) +{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}bool isOccluded(vec4 frag) {vec3 coord=frag.xyz/frag.w;float depth=unpack_depth(texture2D(u_depth,(coord.xy+1.0)*0.5));return coord.z > depth+0.0005;}float occlusionFade(vec4 frag) {vec3 coord=frag.xyz/frag.w;vec3 df=vec3(5.0*u_depth_size_inv,0.0);vec2 uv=0.5*coord.xy+0.5;vec4 depth=vec4( +unpack_depth(texture2D(u_depth,uv-df.xz)),unpack_depth(texture2D(u_depth,uv+df.xz)),unpack_depth(texture2D(u_depth,uv-df.zy)),unpack_depth(texture2D(u_depth,uv+df.zy)) +);return dot(vec4(0.25),vec4(1.0)-clamp(300.0*(vec4(coord.z-0.001)-depth),0.0,1.0));}vec4 fourSample(vec2 pos,vec2 off) { +#ifdef TERRAIN_DEM_FLOAT_FORMAT +float tl=texture2D(u_dem,pos).a;float tr=texture2D(u_dem,pos+vec2(off.x,0.0)).a;float bl=texture2D(u_dem,pos+vec2(0.0,off.y)).a;float br=texture2D(u_dem,pos+off).a; +#else +vec4 demtl=vec4(texture2D(u_dem,pos).xyz*255.0,-1.0);float tl=dot(demtl,u_dem_unpack);vec4 demtr=vec4(texture2D(u_dem,pos+vec2(off.x,0.0)).xyz*255.0,-1.0);float tr=dot(demtr,u_dem_unpack);vec4 dembl=vec4(texture2D(u_dem,pos+vec2(0.0,off.y)).xyz*255.0,-1.0);float bl=dot(dembl,u_dem_unpack);vec4 dembr=vec4(texture2D(u_dem,pos+off).xyz*255.0,-1.0);float br=dot(dembr,u_dem_unpack); +#endif +return vec4(tl,tr,bl,br);}float flatElevation(vec2 pack) {vec2 apos=floor(pack/8.0);vec2 span=10.0*(pack-apos*8.0);vec2 uvTex=(apos-vec2(1.0,1.0))/8190.0;float size=u_dem_size+2.0;float dd=1.0/size;vec2 pos=u_dem_size*(uvTex*u_dem_scale+u_dem_tl)+1.0;vec2 f=fract(pos);pos=(pos-f+0.5)*dd;vec4 h=fourSample(pos,vec2(dd));float z=mix(mix(h.x,h.y,f.x),mix(h.z,h.w,f.x),f.y);vec2 w=floor(0.5*(span*u_meter_to_dem-1.0));vec2 d=dd*w;h=fourSample(pos-d,2.0*d+vec2(dd));vec4 diff=abs(h.xzxy-h.ywzw);vec2 slope=min(vec2(0.25),u_meter_to_dem*0.5*(diff.xz+diff.yw)/(2.0*w+vec2(1.0)));vec2 fix=slope*span;float base=z+max(fix.x,fix.y);return u_exaggeration*base;}float elevationFromUint16(float word) {return u_exaggeration*(word/ELEVATION_SCALE-ELEVATION_OFFSET);} +#else +float elevation(vec2 pos) { return 0.0; }bool isOccluded(vec4 frag) { return false; }float occlusionFade(vec4 frag) { return 1.0; } +#endif`,Cl=`#ifdef FOG +uniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump mat4 u_fog_matrix;varying vec3 v_fog_pos;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}vec3 fog_position(vec3 pos) {return (u_fog_matrix*vec4(pos,1.0)).xyz;}vec3 fog_position(vec2 pos) {return fog_position(vec3(pos,0.0));}float fog(vec3 pos) {float depth=length(pos);float opacity=fog_opacity(fog_range(depth));return opacity*fog_horizon_blending(pos/depth);} +#endif`,Ao=`#ifdef FOG +uniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump float u_fog_temporal_offset;varying vec3 v_fog_pos;uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform highp vec2 u_viewport;uniform float u_globe_transition;uniform int u_is_globe;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}float globe_glow_progress() {highp vec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix( +mix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);highp vec3 dir=normalize(ray_dir);highp vec3 closest_point=dot(u_globe_pos,dir)*dir;highp float sdf=length(closest_point-u_globe_pos)/u_globe_radius;return sdf+PI*0.5;}float fog_opacity(vec3 pos) {float depth=length(pos);return fog_opacity(fog_range(depth));}vec3 fog_apply(vec3 color,vec3 pos) {float depth=length(pos);float opacity;if (u_is_globe==1) {float glow_progress=globe_glow_progress();float t=mix(glow_progress,depth,u_globe_transition);opacity=fog_opacity(fog_range(t));} else {opacity=fog_opacity(fog_range(depth));opacity*=fog_horizon_blending(pos/depth);}return mix(color,u_fog_color.rgb,opacity);}vec4 fog_apply_from_vert(vec4 color,float fog_opac) {float alpha=EPSILON+color.a;color.rgb=mix(color.rgb/alpha,u_fog_color.rgb,fog_opac)*alpha;return color;}vec3 fog_apply_sky_gradient(vec3 camera_ray,vec3 sky_color) {float horizon_blend=fog_horizon_blending(normalize(camera_ray));return mix(sky_color,u_fog_color.rgb,horizon_blend);}vec4 fog_apply_premultiplied(vec4 color,vec3 pos) {float alpha=EPSILON+color.a;color.rgb=fog_apply(color.rgb/alpha,pos)*alpha;return color;}vec3 fog_dither(vec3 color) {vec2 dither_seed=gl_FragCoord.xy+u_fog_temporal_offset;return dither(color,dither_seed);}vec4 fog_dither(vec4 color) {return vec4(fog_dither(color.rgb),color.a);} +#endif`;let Pc={},ma={};const Il=[];ga(Lh,Il),ga(So,Il),ga(Cl,Il),ga(Ao,Il),Pc=Qt("",So),ma=Qt(Ao,Cl);const ff=Qt(` +#if __VERSION__ >=300 +#define varying in +#define gl_FragColor glFragColor +#define texture2D texture +#define textureCube texture +out vec4 glFragColor; +#endif +highp vec3 hash(highp vec2 p) {highp vec3 p3=fract(p.xyx*vec3(443.8975,397.2973,491.1871));p3+=dot(p3,p3.yxz+19.19);return fract((p3.xxy+p3.yzz)*p3.zyx);}vec3 dither(vec3 color,highp vec2 seed) {vec3 rnd=hash(seed)+hash(seed+0.59374)-0.5;return color+rnd/255.0;}highp float unpack_depth(highp vec4 rgba_depth) +{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}highp vec4 pack_depth(highp float ndc_z) {highp float depth=ndc_z*0.5+0.5;const highp vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);const highp vec4 bit_mask =vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);highp vec4 res=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;}`,` +#if __VERSION__ >=300 +#define attribute in +#define varying out +#define texture2D texture +#endif +float wrap(float n,float min,float max) {float d=max-min;float w=mod(mod(n-min,d)+d,d)+min;return (w==min) ? max : w;} +#ifdef PROJECTION_GLOBE_VIEW +vec3 mercator_tile_position(mat4 matrix,vec2 tile_anchor,vec3 tile_id,vec2 mercator_center) { +#ifndef PROJECTED_POS_ON_VIEWPORT +float tiles=tile_id.z;vec2 mercator=(tile_anchor/EXTENT+tile_id.xy)/tiles;mercator-=mercator_center;mercator.x=wrap(mercator.x,-0.5,0.5);vec4 mercator_tile=vec4(mercator.xy*EXTENT,EXTENT/(2.0*PI),1.0);mercator_tile=matrix*mercator_tile;return mercator_tile.xyz; +#else +return vec3(0.0); +#endif +}vec3 mix_globe_mercator(vec3 globe,vec3 mercator,float t) {return mix(globe,mercator,t);}mat3 globe_mercator_surface_vectors(vec3 pos_normal,vec3 up_dir,float zoom_transition) {vec3 normal=zoom_transition==0.0 ? pos_normal : normalize(mix(pos_normal,up_dir,zoom_transition));vec3 xAxis=normalize(vec3(normal.z,0.0,-normal.x));vec3 yAxis=normalize(cross(normal,xAxis));return mat3(xAxis,yAxis,normal);} +#endif +vec2 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 +);}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;}const vec4 AWAY=vec4(-1000.0,-1000.0,-1000.0,1);//Normalized device coordinate that is not rendered.`),zc=Lh,Rh=` +#ifdef GL_ES +precision mediump float; +#else + +#if !defined(lowp) +#define lowp +#endif + +#if !defined(mediump) +#define mediump +#endif + +#if !defined(highp) +#define highp +#endif + +#endif`;var Dh={background:Qt(`uniform vec4 u_color;uniform float u_opacity; +#ifdef LIGHTING_3D_MODE +varying vec4 v_color; +#endif +void main() {vec4 out_color; +#ifdef LIGHTING_3D_MODE +out_color=v_color; +#else +out_color=u_color; +#endif +#ifdef FOG +out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); +#endif +gl_FragColor=out_color*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec2 a_pos;uniform mat4 u_matrix; +#ifdef LIGHTING_3D_MODE +uniform vec4 u_color;varying vec4 v_color; +#endif +void main() {gl_Position=u_matrix*vec4(a_pos,0,1); +#ifdef LIGHTING_3D_MODE +v_color=apply_lighting(u_color); +#endif +#ifdef FOG +v_fog_pos=fog_position(a_pos); +#endif +}`),backgroundPattern:Qt(`uniform vec2 u_pattern_tl;uniform vec2 u_pattern_br;uniform vec2 u_texsize;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos;void main() {vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(u_pattern_tl/u_texsize,u_pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos); +#ifdef LIGHTING_3D_MODE +out_color=apply_lighting(out_color); +#endif +#ifdef FOG +out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); +#endif +gl_FragColor=out_color*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_pattern_size;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_pattern_size,u_tile_units_to_pixels,a_pos); +#ifdef FOG +v_fog_pos=fog_position(a_pos); +#endif +}`),circle:Qt(`varying vec3 v_data;varying float v_visibility; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define mediump float radius +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define highp vec4 stroke_color +#pragma mapbox: define mediump float stroke_width +#pragma mapbox: define lowp float stroke_opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize mediump float radius +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize highp vec4 stroke_color +#pragma mapbox: initialize mediump float stroke_width +#pragma mapbox: initialize lowp float stroke_opacity +vec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);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) +);vec4 out_color=mix(color*opacity,stroke_color*stroke_opacity,color_t); +#ifdef LIGHTING_3D_MODE +out_color=apply_lighting(out_color); +#endif +#ifdef FOG +out_color=fog_apply_premultiplied(out_color,v_fog_pos); +#endif +gl_FragColor=out_color*(v_visibility*opacity_t); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`#define NUM_VISIBILITY_RINGS 2 +#define INV_SQRT2 0.70710678 +#define ELEVATION_BIAS 0.0001 +#define NUM_SAMPLES_PER_RING 16 +uniform mat4 u_matrix;uniform mat2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos; +#ifdef PROJECTION_GLOBE_VIEW +attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir; +#endif +varying vec3 v_data;varying float v_visibility; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define mediump float radius +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define highp vec4 stroke_color +#pragma mapbox: define mediump float stroke_width +#pragma mapbox: define lowp float stroke_opacity +vec2 calc_offset(vec2 extrusion,float radius,float stroke_width, float view_scale) {return extrusion*(radius+stroke_width)*u_extrude_scale*view_scale;}float cantilevered_elevation(vec2 pos,float radius,float stroke_width,float view_scale) {vec2 c1=pos+calc_offset(vec2(-1,-1),radius,stroke_width,view_scale);vec2 c2=pos+calc_offset(vec2(1,-1),radius,stroke_width,view_scale);vec2 c3=pos+calc_offset(vec2(1,1),radius,stroke_width,view_scale);vec2 c4=pos+calc_offset(vec2(-1,1),radius,stroke_width,view_scale);float h1=elevation(c1)+ELEVATION_BIAS;float h2=elevation(c2)+ELEVATION_BIAS;float h3=elevation(c3)+ELEVATION_BIAS;float h4=elevation(c4)+ELEVATION_BIAS;return max(h4,max(h3,max(h1,h2)));}float circle_elevation(vec2 pos) { +#if defined(TERRAIN) +return elevation(pos)+ELEVATION_BIAS; +#else +return 0.0; +#endif +}vec4 project_vertex(vec2 extrusion,vec4 world_center,vec4 projected_center,float radius,float stroke_width, float view_scale,mat3 surface_vectors) {vec2 sample_offset=calc_offset(extrusion,radius,stroke_width,view_scale); +#ifdef PITCH_WITH_MAP +#ifdef PROJECTION_GLOBE_VIEW +return u_matrix*( world_center+vec4(sample_offset.x*surface_vectors[0]+sample_offset.y*surface_vectors[1],0) ); +#else +return u_matrix*( world_center+vec4(sample_offset,0,0) ); +#endif +#else +return projected_center+vec4(sample_offset,0,0); +#endif +}float get_sample_step() { +#ifdef PITCH_WITH_MAP +return 2.0*PI/float(NUM_SAMPLES_PER_RING); +#else +return PI/float(NUM_SAMPLES_PER_RING); +#endif +}void main(void) { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize mediump float radius +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize highp vec4 stroke_color +#pragma mapbox: initialize mediump float stroke_width +#pragma mapbox: initialize lowp float stroke_opacity +vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);vec4 world_center;mat3 surface_vectors; +#ifdef PROJECTION_GLOBE_VIEW +vec3 pos_normal_3=a_pos_normal_3/16384.0;surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(circle_center)*circle_elevation(circle_center);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*circle_elevation(circle_center);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,circle_center,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;vec3 pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);world_center=vec4(pos,1); +#else +surface_vectors=mat3(1.0);float height=circle_elevation(circle_center);world_center=vec4(circle_center,height,1); +#endif +vec4 projected_center=u_matrix*world_center;float view_scale=0.0; +#ifdef PITCH_WITH_MAP +#ifdef SCALE_WITH_MAP +view_scale=1.0; +#else +view_scale=projected_center.w/u_camera_to_center_distance; +#endif +#else +#ifdef SCALE_WITH_MAP +view_scale=u_camera_to_center_distance; +#else +view_scale=projected_center.w; +#endif +#endif +gl_Position=project_vertex(extrude,world_center,projected_center,radius,stroke_width,view_scale,surface_vectors);float visibility=0.0; +#ifdef TERRAIN +float step=get_sample_step();vec4 occlusion_world_center;vec4 occlusion_projected_center; +#ifdef PITCH_WITH_MAP +float cantilevered_height=cantilevered_elevation(circle_center,radius,stroke_width,view_scale);occlusion_world_center=vec4(circle_center,cantilevered_height,1);occlusion_projected_center=u_matrix*occlusion_world_center; +#else +occlusion_world_center=world_center;occlusion_projected_center=projected_center; +#endif +for(int ring=0; ring < NUM_VISIBILITY_RINGS; ring++) {float scale=(float(ring)+1.0)/float(NUM_VISIBILITY_RINGS);for(int i=0; i < NUM_SAMPLES_PER_RING; i++) {vec2 extrusion=vec2(cos(step*float(i)),-sin(step*float(i)))*scale;vec4 frag_pos=project_vertex(extrusion,occlusion_world_center,occlusion_projected_center,radius,stroke_width,view_scale,surface_vectors);visibility+=float(!isOccluded(frag_pos));}}visibility/=float(NUM_VISIBILITY_RINGS)*float(NUM_SAMPLES_PER_RING); +#else +visibility=1.0; +#endif +#ifdef PROJECTION_GLOBE_VIEW +visibility=1.0; +#endif +v_visibility=visibility;lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur); +#ifdef FOG +v_fog_pos=fog_position(world_center.xyz); +#endif +}`),clippingMask:Qt("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:Qt(`uniform highp float u_intensity;varying vec2 v_extrude; +#pragma mapbox: define highp float weight +#define GAUSS_COEF 0.3989422804014327 +void main() { +#pragma mapbox: initialize highp float weight +float 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); +#ifdef FOG +if (u_is_globe==0) {gl_FragColor.r*=pow(1.0-fog_opacity(v_fog_pos),2.0);} +#endif +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos; +#ifdef PROJECTION_GLOBE_VIEW +attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir; +#endif +varying vec2 v_extrude; +#pragma mapbox: define highp float weight +#pragma mapbox: define mediump float radius +const highp float ZERO=1.0/255.0/16.0; +#define GAUSS_COEF 0.3989422804014327 +void main(void) { +#pragma mapbox: initialize highp float weight +#pragma mapbox: initialize mediump float radius +vec2 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;vec2 tilePos=floor(a_pos*0.5);vec3 pos; +#ifdef PROJECTION_GLOBE_VIEW +vec3 pos_normal_3=a_pos_normal_3/16384.0;mat3 surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(tilePos)*elevation(tilePos);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*elevation(tilePos);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,tilePos,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition); +#else +pos=vec3(tilePos+extrude,elevation(tilePos)); +#endif +gl_Position=u_matrix*vec4(pos,1); +#ifdef FOG +v_fog_pos=fog_position(pos); +#endif +}`),heatmapTexture:Qt(`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; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(0.0); +#endif +}`,"attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=a_pos*0.5+0.5;}"),collisionBox:Qt("varying float v_placed;varying float v_notUsed;void main() {vec4 red =vec4(1.0,0.0,0.0,1.0);vec4 blue=vec4(0.0,0.0,1.0,0.5);gl_FragColor =mix(red,blue,step(0.5,v_placed))*0.5;gl_FragColor*=mix(1.0,0.1,step(0.5,v_notUsed));}",`attribute vec3 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;attribute float a_size_scale;attribute vec2 a_padding;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_pos+elevationVector(a_anchor_pos)*elevation(a_anchor_pos),1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp( +0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,1.5);gl_Position=projectedPoint;gl_Position.xy+=(a_extrude*a_size_scale+a_shift+a_padding)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}`),collisionCircle:Qt("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_2f;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_2f;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:Qt("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; +#ifdef PROJECTION_GLOBE_VIEW +attribute vec3 a_pos_3; +#endif +varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {float h=elevation(a_pos);v_uv=a_pos/8192.0; +#ifdef PROJECTION_GLOBE_VIEW +gl_Position=u_matrix*vec4(a_pos_3+elevationVector(a_pos)*h,1); +#else +gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,h,1); +#endif +}`),fill:Qt(`#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float opacity +vec4 out_color=color; +#ifdef LIGHTING_3D_MODE +out_color=apply_lighting(out_color); +#endif +#ifdef FOG +out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); +#endif +gl_FragColor=out_color*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec2 a_pos;uniform mat4 u_matrix; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float opacity +gl_Position=u_matrix*vec4(a_pos,0,1); +#ifdef FOG +v_fog_pos=fog_position(a_pos); +#endif +}`),fillOutline:Qt(`varying vec2 v_pos; +#pragma mapbox: define highp vec4 outline_color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 outline_color +#pragma mapbox: initialize lowp float opacity +float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=outline_color; +#ifdef LIGHTING_3D_MODE +out_color=apply_lighting(out_color); +#endif +#ifdef FOG +out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); +#endif +gl_FragColor=out_color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos; +#pragma mapbox: define highp vec4 outline_color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 outline_color +#pragma mapbox: initialize lowp float opacity +gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world; +#ifdef FOG +v_fog_pos=fog_position(a_pos); +#endif +}`),fillOutlinePattern:Qt(`uniform vec2 u_texsize;uniform sampler2D u_image;varying vec2 v_pos;varying vec2 v_pos_world; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern +vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);float dist=length(v_pos_world-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=texture2D(u_image,pos); +#ifdef LIGHTING_3D_MODE +out_color=apply_lighting(out_color); +#endif +#ifdef FOG +out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); +#endif +gl_FragColor=out_color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;varying vec2 v_pos_world; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern +#pragma mapbox: define lowp float pixel_ratio +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern +#pragma mapbox: initialize lowp float pixel_ratio +vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);v_pos_world=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world; +#ifdef FOG +v_fog_pos=fog_position(a_pos); +#endif +}`),fillPattern:Qt(`uniform vec2 u_texsize;uniform sampler2D u_image;varying vec2 v_pos; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern +vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos); +#ifdef LIGHTING_3D_MODE +out_color=apply_lighting(out_color); +#endif +#ifdef FOG +out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); +#endif +gl_FragColor=out_color*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern +#pragma mapbox: define lowp float pixel_ratio +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern +#pragma mapbox: initialize lowp float pixel_ratio +vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos); +#ifdef FOG +v_fog_pos=fog_position(a_pos); +#endif +}`),fillExtrusion:Qt(`varying vec4 v_color; +#ifdef RENDER_SHADOWS +varying highp vec4 v_pos_light_view_0;varying highp vec4 v_pos_light_view_1;varying float v_depth; +#endif +#ifdef FAUX_AO +uniform lowp vec2 u_ao;varying vec3 v_ao; +#endif +#ifdef ZERO_ROOF_RADIUS +varying vec4 v_roof_color; +#endif +#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) +varying highp vec3 v_normal; +#endif +void main() { +#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) +vec3 normal=v_normal; +#endif +float z;vec4 color; +#ifdef ZERO_ROOF_RADIUS +z=float(normal.z > 0.00001);color=mix(v_color,v_roof_color,z); +#else +color=v_color; +#endif +#ifdef FAUX_AO +float intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x; +#ifdef ZERO_ROOF_RADIUS +concave*=(1.0-z); +#endif +float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);color.rgb=color.rgb*shade; +#endif +#ifdef RENDER_SHADOWS +#ifdef ZERO_ROOF_RADIUS +normal=mix(normal,vec3(0.0,0.0,1.0),z); +#endif +color.xyz=shadowed_color_normal(color.xyz,normalize(normal),v_pos_light_view_0,v_pos_light_view_1,v_depth); +#endif +#ifdef FOG +color=fog_dither(fog_apply_premultiplied(color,v_fog_pos)); +#endif +gl_FragColor=color; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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;uniform float u_edge_radius;attribute vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos; +#ifdef PROJECTION_GLOBE_VIEW +attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift; +#endif +varying vec4 v_color; +#ifdef RENDER_SHADOWS +uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;varying highp vec4 v_pos_light_view_0;varying highp vec4 v_pos_light_view_1;varying float v_depth; +#endif +#ifdef ZERO_ROOF_RADIUS +varying vec4 v_roof_color; +#endif +#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) +varying highp vec3 v_normal; +#endif +#ifdef FAUX_AO +uniform lowp vec2 u_ao;varying vec3 v_ao; +#endif +#pragma mapbox: define highp float base +#pragma mapbox: define highp float height +#pragma mapbox: define highp vec4 color +void main() { +#pragma mapbox: initialize highp float base +#pragma mapbox: initialize highp float height +#pragma mapbox: initialize highp vec4 color +vec4 pos_nx=floor(a_pos_normal_ed*0.5);vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0)); +#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) +v_normal=normal; +#endif +base=max(0.0,base);height=max(0.0,top_up_ny.y==0.0 && top_up_ny.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0); +#if defined(HAS_CENTROID) || defined(TERRAIN) +centroid_pos=a_centroid_pos; +#endif +float ele=0.0;float h=0.0;float c_ele;vec3 pos; +#ifdef TERRAIN +bool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);pos=vec3(pos_nx.xy,h); +#else +h=t > 0.0 ? height : base;pos=vec3(pos_nx.xy,h); +#endif +#ifdef PROJECTION_GLOBE_VIEW +float lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*h);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,pos.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*pos.z;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition); +#endif +float hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(pos,1),AWAY,hidden); +#ifdef RENDER_SHADOWS +v_pos_light_view_0=u_light_matrix_0*vec4(pos,1);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1);v_depth=gl_Position.w; +#endif +float NdotL=0.0;float colorvalue=0.0; +#ifdef LIGHTING_3D_MODE +NdotL=calculate_NdotL(normal); +#else +colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),NdotL); +#endif +if (normal.y !=0.0) {float r=0.84; +#ifndef LIGHTING_3D_MODE +r=mix(0.7,0.98,1.0-u_lightintensity); +#endif +NdotL*=( +(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}v_color=vec4(0.0,0.0,0.0,1.0); +#ifdef FAUX_AO +float concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height; +#ifdef TERRAIN +top_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height); +#endif +v_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]); +#ifdef PROJECTION_GLOBE_VIEW +top_height+=u_height_lift; +#endif +gl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w; +#endif +#ifdef LIGHTING_3D_MODE +v_color=apply_lighting(color,NdotL); +#else +v_color.rgb+=clamp(color.rgb*NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0)); +#endif +v_color*=u_opacity; +#ifdef ZERO_ROOF_RADIUS +v_roof_color=vec4(0.0,0.0,0.0,1.0); +#ifdef LIGHTING_3D_MODE +v_roof_color=apply_lighting(color,calculate_NdotL(vec3(0.0,0.0,1.0))); +#else +float roofNdotL=clamp(u_lightpos.z,0.0,1.0);roofNdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),roofNdotL);v_roof_color.rgb+=clamp(color.rgb*roofNdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0)); +#endif +v_roof_color*=u_opacity; +#endif +#ifdef FOG +v_fog_pos=fog_position(pos); +#endif +}`),fillExtrusionPattern:Qt(`uniform vec2 u_texsize;uniform sampler2D u_image; +#ifdef FAUX_AO +uniform lowp vec2 u_ao;varying vec3 v_ao; +#endif +#ifdef LIGHTING_3D_MODE +varying float v_NdotL; +#endif +varying vec2 v_pos;varying vec4 v_lighting;uniform lowp float u_opacity; +#pragma mapbox: define lowp float base +#pragma mapbox: define lowp float height +#pragma mapbox: define lowp vec4 pattern +#pragma mapbox: define lowp float pixel_ratio +void main() { +#pragma mapbox: initialize lowp float base +#pragma mapbox: initialize lowp float height +#pragma mapbox: initialize mediump vec4 pattern +#pragma mapbox: initialize lowp float pixel_ratio +vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos); +#ifdef LIGHTING_3D_MODE +out_color=apply_lighting(out_color,v_NdotL)*u_opacity; +#else +out_color=out_color*v_lighting; +#endif +#ifdef FAUX_AO +float intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);out_color.rgb=out_color.rgb*shade; +#endif +#ifdef FOG +out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); +#endif +gl_FragColor=out_color; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform float u_tile_units_to_pixels;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 vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos; +#ifdef PROJECTION_GLOBE_VIEW +attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift; +#endif +varying vec2 v_pos;varying vec4 v_lighting; +#ifdef FAUX_AO +uniform lowp vec2 u_ao;varying vec3 v_ao; +#endif +#ifdef LIGHTING_3D_MODE +varying float v_NdotL; +#endif +#pragma mapbox: define lowp float base +#pragma mapbox: define lowp float height +#pragma mapbox: define lowp vec4 pattern +#pragma mapbox: define lowp float pixel_ratio +void main() { +#pragma mapbox: initialize lowp float base +#pragma mapbox: initialize lowp float height +#pragma mapbox: initialize mediump vec4 pattern +#pragma mapbox: initialize lowp float pixel_ratio +vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec4 pos_nx=floor(a_pos_normal_ed*0.5);mediump vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;mediump vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));float edgedistance=a_pos_normal_ed.w;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;base=max(0.0,base);height=max(0.0,height);float t=top_up_ny.x;float z=t > 0.0 ? height : base;vec2 centroid_pos=vec2(0.0); +#if defined(HAS_CENTROID) || defined(TERRAIN) +centroid_pos=a_centroid_pos; +#endif +float ele=0.0;float h=z;vec3 p;float c_ele; +#ifdef TERRAIN +bool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);p=vec3(pos_nx.xy,h); +#else +p=vec3(pos_nx.xy,z); +#endif +#ifdef PROJECTION_GLOBE_VIEW +float lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*(p.z+lift));vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,p.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*p.z;p=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition); +#endif +float hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(p,1),AWAY,hidden);vec2 pos=normal.z==1.0 +? pos_nx.xy +: vec2(edgedistance,z*u_height_factor);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float NdotL=0.0; +#ifdef LIGHTING_3D_MODE +NdotL=calculate_NdotL(normal); +#else +NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),NdotL); +#endif +if (normal.y !=0.0) {float r=0.84; +#ifndef LIGHTING_3D_MODE +r=mix(0.7,0.98,1.0-u_lightintensity); +#endif +NdotL*=( +(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));} +#ifdef FAUX_AO +float concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height; +#ifdef TERRAIN +top_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height); +#endif +v_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]); +#ifdef PROJECTION_GLOBE_VIEW +top_height+=u_height_lift; +#endif +gl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w; +#endif +#ifdef LIGHTING_3D_MODE +v_NdotL=NdotL; +#else +v_lighting.rgb+=clamp(NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity; +#endif +#ifdef FOG +v_fog_pos=fog_position(p); +#endif +}`),hillshadePrepare:Qt(`#ifdef GL_ES +precision highp float; +#endif +uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord) { +#ifdef TERRAIN_DEM_FLOAT_FORMAT +return texture2D(u_image,coord).a/4.0; +#else +vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0; +#endif +}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y));float b=getElevation(v_pos+vec2(0,-epsilon.y));float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y));float d=getElevation(v_pos+vec2(-epsilon.x,0));float e=getElevation(v_pos+vec2(epsilon.x,0));float f=getElevation(v_pos+vec2(-epsilon.x,epsilon.y));float g=getElevation(v_pos+vec2(0,epsilon.y));float h=getElevation(v_pos+vec2(epsilon.x,epsilon.y));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+e+e+h)-(a+d+d+f),(f+g+g+h)-(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); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"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:Qt(`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;void 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; +#ifdef LIGHTING_3D_MODE +gl_FragColor=apply_lighting(gl_FragColor); +#endif +#ifdef FOG +gl_FragColor=fog_dither(fog_apply_premultiplied(gl_FragColor,v_fog_pos)); +#endif +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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; +#ifdef FOG +v_fog_pos=fog_position(a_pos); +#endif +}`),line:Qt(`uniform lowp float u_device_pixel_ratio;uniform float u_alpha_discard_threshold;uniform highp vec2 u_trim_offset;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec4 v_uv; +#ifdef RENDER_LINE_DASH +uniform sampler2D u_dash_image;varying vec2 v_tex; +#endif +#ifdef RENDER_LINE_GRADIENT +uniform sampler2D u_gradient_image; +#endif +uniform float u_border_width;uniform vec4 u_border_color;float luminance(vec3 c) {return (c.r+c.r+c.b+c.g+c.g+c.g)*0.1667;} +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float floorwidth +#pragma mapbox: define lowp vec4 dash +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +float linearstep(float edge0,float edge1,float x) {return clamp((x-edge0)/(edge1-edge0),0.0,1.0);}void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float floorwidth +#pragma mapbox: initialize lowp vec4 dash +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +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); +#ifdef RENDER_LINE_DASH +float sdfdist=texture2D(u_dash_image,v_tex).a;float sdfgamma=1.0/(2.0*u_device_pixel_ratio)/dash.z;alpha*=linearstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist); +#endif +highp vec4 out_color; +#ifdef RENDER_LINE_GRADIENT +out_color=texture2D(u_gradient_image,v_uv.xy); +#else +out_color=color; +#endif +float trimmed=1.0; +#ifdef RENDER_LINE_TRIM_OFFSET +highp float start=v_uv[2];highp float end=v_uv[3];highp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=(start+(v_uv.x)*(end-start));if (trim_end > trim_start) {if (line_progress <=trim_end && line_progress >=trim_start) {out_color=vec4(0,0,0,0);trimmed=0.0;}} +#endif +#ifdef LIGHTING_3D_MODE +out_color=apply_lighting(out_color); +#endif +#ifdef FOG +out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); +#endif +#ifdef RENDER_LINE_ALPHA_DISCARD +if (alpha < u_alpha_discard_threshold) {discard;} +#endif +#ifdef RENDER_LINE_BORDER +float edgeBlur=(u_border_width+1.0/u_device_pixel_ratio);float alpha2=clamp(min(dist-(v_width2.t-edgeBlur),v_width2.s-dist)/edgeBlur,0.0,1.0);if (alpha2 < 1.) {float smoothAlpha=smoothstep(0.6,1.0,alpha2); +#ifdef RENDER_LINE_BORDER_AUTO +float Y=(out_color.a > 0.01) ? luminance(out_color.rgb/out_color.a) : 1.;float adjustment=(Y > 0.) ? 0.5/Y : 0.45;if (out_color.a > 0.25 && Y < 0.25) {vec3 borderColor=(Y > 0.) ? out_color.rgb : vec3(1,1,1)*out_color.a;out_color.rgb=out_color.rgb+borderColor*(adjustment*(1.0-smoothAlpha));} else {out_color.rgb*=(0.6 +0.4*smoothAlpha);} +#else +out_color.rgb=mix(u_border_color.rgb*u_border_color.a*trimmed,out_color.rgb,smoothAlpha); +#endif +} +#endif +gl_FragColor=out_color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define EXTRUDE_SCALE 0.015873016 +attribute vec2 a_pos_normal;attribute vec4 a_data; +#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET) +attribute highp vec4 a_packed; +#endif +#ifdef RENDER_LINE_DASH +attribute float a_linesofar; +#endif +uniform mat4 u_matrix;uniform mat2 u_pixels_to_tile_units;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 vec4 v_uv; +#ifdef RENDER_LINE_DASH +uniform vec2 u_texsize;uniform float u_tile_units_to_pixels;varying vec2 v_tex; +#endif +#ifdef RENDER_LINE_GRADIENT +uniform float u_image_height; +#endif +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float floorwidth +#pragma mapbox: define lowp vec4 dash +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float floorwidth +#pragma mapbox: initialize lowp vec4 dash +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float width +float 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;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*EXTRUDE_SCALE;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*EXTRUDE_SCALE*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist*u_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude; +#ifndef RENDER_TO_TEXTURE +float 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; +#else +v_gamma_scale=1.0; +#endif +#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET) +float a_uv_x=a_packed[0];float a_split_index=a_packed[1];highp float a_clip_start=a_packed[2];highp float a_clip_end=a_packed[3]; +#ifdef RENDER_LINE_GRADIENT +highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec4(a_uv_x,a_split_index*texel_height-half_texel_height,a_clip_start,a_clip_end); +#else +v_uv=vec4(a_uv_x,0.0,a_clip_start,a_clip_end); +#endif +#endif +#ifdef RENDER_LINE_DASH +float scale=dash.z==0.0 ? 0.0 : u_tile_units_to_pixels/dash.z;float height=dash.y;v_tex=vec2(a_linesofar*scale/floorwidth,(-normal.y*height+dash.x+0.5)/u_texsize.y); +#endif +v_width2=vec2(outset,inset); +#ifdef FOG +v_fog_pos=fog_position(pos); +#endif +}`),linePattern:Qt(`uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_tile_units_to_pixels;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; +#pragma mapbox: define lowp vec4 pattern +#pragma mapbox: define lowp float pixel_ratio +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize mediump vec4 pattern +#pragma mapbox: initialize lowp float pixel_ratio +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;vec2 pattern_size=vec2(display_size.x/u_tile_units_to_pixels,display_size.y);float aspect=display_size.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=mod(v_linesofar/pattern_size.x*aspect,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(x,y));vec4 color=texture2D(u_image,pos); +#ifdef LIGHTING_3D_MODE +color=apply_lighting(color); +#endif +#ifdef FOG +color=fog_dither(fog_apply_premultiplied(color,v_fog_pos)); +#endif +gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_linesofar;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mat2 u_pixels_to_tile_units;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; +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +#pragma mapbox: define lowp vec4 pattern +#pragma mapbox: define lowp float pixel_ratio +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +#pragma mapbox: initialize mediump vec4 pattern +#pragma mapbox: initialize lowp float pixel_ratio +float 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;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_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude; +#ifndef RENDER_TO_TEXTURE +float 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; +#else +v_gamma_scale=1.0; +#endif +v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth; +#ifdef FOG +v_fog_pos=fog_position(pos); +#endif +}`),raster:Qt(`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);vec3 out_color=mix(u_high_vec,u_low_vec,rgb); +#ifdef LIGHTING_3D_MODE +out_color=apply_lighting(out_color); +#endif +#ifdef FOG +out_color=fog_dither(fog_apply(out_color,v_fog_pos)); +#endif +gl_FragColor=vec4(out_color*color.a,color.a); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform vec2 u_perspective_transform;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {float w=1.0+dot(a_texture_pos,u_perspective_transform);gl_Position=u_matrix*vec4(a_pos*w,0,w);v_pos0=a_texture_pos/8192.0;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent; +#ifdef FOG +v_fog_pos=fog_position(a_pos); +#endif +}`),symbolIcon:Qt(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize lowp float opacity +lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_pixeloffset;attribute vec4 a_projected_pos;attribute float a_fade_opacity; +#ifdef PROJECTION_GLOBE_VIEW +attribute vec3 a_globe_anchor;attribute vec3 a_globe_normal; +#endif +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 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 vec3 u_up_vector; +#ifdef PROJECTION_GLOBE_VIEW +uniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix; +#endif +varying vec2 v_tex;varying float v_fade_opacity; +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize lowp float opacity +vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_min_font_scale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[3];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 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos; +#ifdef PROJECTION_GLOBE_VIEW +mercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0; +#else +world_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0; +#endif +vec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ? +camera_to_anchor_distance/u_camera_to_center_distance : +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp( +0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjected_point; +#ifdef PROJECTION_GLOBE_VIEW +vec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetProjected_point=u_matrix*vec4(a_globe_anchor+displacement,1); +#else +offsetProjected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1); +#endif +vec2 a=projected_point.xy/projected_point.w;vec2 b=offsetProjected_point.xy/offsetProjected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos; +#ifdef PROJECTION_GLOBE_VIEW +vec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0); +#else +projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0); +#endif +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);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*max(a_min_font_scale,font_scale)+a_pxoffset/16.0); +#ifdef TERRAIN +#ifdef PITCH_WITH_MAP_TERRAIN +vec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy); +#endif +#endif +float occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade; +#ifdef PROJECTION_GLOBE_VIEW +vec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); +#else +gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); +#endif +float projection_transition_fade=1.0; +#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW) +projection_transition_fade=1.0-step(EPSILON,u_zoom_transition); +#endif +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;v_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change))*projection_transition_fade;}`),symbolSDF:Qt(`#define SDF_PX 8.0 +uniform 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; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +float 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 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); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_pixeloffset;attribute vec4 a_projected_pos;attribute float a_fade_opacity; +#ifdef PROJECTION_GLOBE_VIEW +attribute vec3 a_globe_anchor;attribute vec3 a_globe_normal; +#endif +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_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 vec3 u_up_vector; +#ifdef PROJECTION_GLOBE_VIEW +uniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix; +#endif +varying vec2 v_data0;varying vec3 v_data1; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[3];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 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos; +#ifdef PROJECTION_GLOBE_VIEW +mercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0; +#else +world_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0; +#endif +vec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ? +camera_to_anchor_distance/u_camera_to_center_distance : +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp( +0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetprojected_point; +#ifdef PROJECTION_GLOBE_VIEW +vec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetprojected_point=u_matrix*vec4(a_globe_anchor+displacement,1); +#else +offsetprojected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1); +#endif +vec2 a=projected_point.xy/projected_point.w;vec2 b=offsetprojected_point.xy/offsetprojected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos; +#ifdef PROJECTION_GLOBE_VIEW +vec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0); +#else +projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0); +#endif +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);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset); +#ifdef TERRAIN +#ifdef PITCH_WITH_MAP_TERRAIN +vec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy); +#endif +#endif +float occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade; +#ifdef PROJECTION_GLOBE_VIEW +vec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); +#else +gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); +#endif +float gamma_scale=gl_Position.w;float projection_transition_fade=1.0; +#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW) +projection_transition_fade=1.0-step(EPSILON,u_zoom_transition); +#endif +vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity*projection_transition_fade);}`),symbolTextAndIcon:Qt(`#define SDF_PX 8.0 +#define SDF 1.0 +#define ICON 0.0 +uniform 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; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +float 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; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +return;}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); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_projected_pos;attribute float a_fade_opacity; +#ifdef PROJECTION_GLOBE_VIEW +attribute vec3 a_globe_anchor;attribute vec3 a_globe_normal; +#endif +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_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 vec3 u_up_vector;uniform vec2 u_texsize_icon; +#ifdef PROJECTION_GLOBE_VIEW +uniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix; +#endif +varying vec4 v_data0;varying vec4 v_data1; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[3];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 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos; +#ifdef PROJECTION_GLOBE_VIEW +mercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0; +#else +world_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0; +#endif +vec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ? +camera_to_anchor_distance/u_camera_to_center_distance : +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp( +0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offset_projected_point=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projected_point.xy/projected_point.w;vec2 b=offset_projected_point.xy/offset_projected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos; +#ifdef PROJECTION_GLOBE_VIEW +vec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0); +#else +projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0); +#endif +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);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*font_scale); +#ifdef TERRAIN +#ifdef PITCH_WITH_MAP_TERRAIN +vec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy); +#endif +#endif +float occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade; +#ifdef PROJECTION_GLOBE_VIEW +vec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); +#else +gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); +#endif +float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));float projection_transition_fade=1.0; +#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW) +projection_transition_fade=1.0-step(EPSILON,u_zoom_transition); +#endif +v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity*projection_transition_fade,is_sdf);}`),terrainRaster:Qt(`uniform sampler2D u_image0;varying vec2 v_pos0; +#ifdef FOG +varying float v_fog_opacity; +#endif +#ifdef RENDER_SHADOWS +varying vec4 v_pos_light_view_0;varying vec4 v_pos_light_view_1;varying float v_depth; +#endif +void main() {vec4 color=texture2D(u_image0,v_pos0); +#ifdef RENDER_SHADOWS +color.xyz=shadowed_color(color.xyz,v_pos_light_view_0,v_pos_light_view_1,v_depth); +#endif +#ifdef FOG +#ifdef ZERO_EXAGGERATION +color=fog_dither(fog_apply_premultiplied(color,v_fog_pos)); +#else +color=fog_dither(fog_apply_from_vert(color,v_fog_opacity)); +#endif +#endif +gl_FragColor=color; +#ifdef TERRAIN_WIREFRAME +gl_FragColor=vec4(1.0,0.0,0.0,0.8); +#endif +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform float u_skirt_height;attribute vec2 a_pos;varying vec2 v_pos0; +#ifdef FOG +varying float v_fog_opacity; +#endif +#ifdef RENDER_SHADOWS +uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;varying vec4 v_pos_light_view_0;varying vec4 v_pos_light_view_1;varying float v_depth; +#endif +const float wireframeOffset=0.00015;void main() {vec3 decomposedPosAndSkirt=decomposeToPosAndSkirt(a_pos);float skirt=decomposedPosAndSkirt.z;vec2 decodedPos=decomposedPosAndSkirt.xy;float elevation=elevation(decodedPos)-skirt*u_skirt_height; +#ifdef TERRAIN_WIREFRAME +elevation+=wireframeOffset; +#endif +v_pos0=decodedPos/8192.0;gl_Position=u_matrix*vec4(decodedPos,elevation,1.0); +#ifdef FOG +#ifdef ZERO_EXAGGERATION +v_fog_pos=fog_position(decodedPos); +#else +v_fog_opacity=fog(fog_position(vec3(decodedPos,elevation))); +#endif +#endif +#ifdef RENDER_SHADOWS +vec3 pos=vec3(decodedPos,elevation);v_pos_light_view_0=u_light_matrix_0*vec4(pos,1.);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1.);v_depth=gl_Position.w; +#endif +}`),terrainDepth:Qt(`#ifdef GL_ES +precision highp float; +#endif +varying float v_depth;void main() {gl_FragColor=pack_depth(v_depth);}`,"uniform mat4 u_matrix;attribute vec2 a_pos;varying float v_depth;void main() {float elevation=elevation(a_pos);gl_Position=u_matrix*vec4(a_pos,elevation,1.0);v_depth=gl_Position.z/gl_Position.w;}"),skybox:Qt(` +varying lowp vec3 v_uv;uniform lowp samplerCube u_cubemap;uniform lowp float u_opacity;uniform highp float u_temporal_offset;uniform highp vec3 u_sun_direction;float sun_disk(highp vec3 ray_direction,highp vec3 sun_direction) {highp float cos_angle=dot(normalize(ray_direction),sun_direction);const highp float cos_sun_angular_diameter=0.99996192306;const highp float smoothstep_delta=1e-5;return smoothstep( +cos_sun_angular_diameter-smoothstep_delta,cos_sun_angular_diameter+smoothstep_delta,cos_angle);}float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec3 uv=v_uv;const float y_bias=0.015;uv.y+=y_bias;uv.y=pow(abs(uv.y),1.0/5.0);uv.y=map(uv.y,0.0,1.0,-1.0,1.0);vec3 sky_color=textureCube(u_cubemap,uv).rgb; +#ifdef FOG +sky_color=fog_apply_sky_gradient(v_uv.xzy,sky_color); +#endif +sky_color.rgb=dither(sky_color.rgb,gl_FragCoord.xy+u_temporal_offset);sky_color+=0.1*sun_disk(v_uv,u_sun_direction);gl_FragColor=vec4(sky_color*u_opacity,u_opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,Ps),skyboxGradient:Qt(`varying highp vec3 v_uv;uniform lowp sampler2D u_color_ramp;uniform highp vec3 u_center_direction;uniform lowp float u_radius;uniform lowp float u_opacity;uniform highp float u_temporal_offset;void main() {float progress=acos(dot(normalize(v_uv),u_center_direction))/u_radius;vec4 color=texture2D(u_color_ramp,vec2(progress,0.5)); +#ifdef FOG +color.rgb=fog_apply_sky_gradient(v_uv.xzy,color.rgb/color.a)*color.a; +#endif +color*=u_opacity;color.rgb=dither(color.rgb,gl_FragCoord.xy+u_temporal_offset);gl_FragColor=color; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,Ps),skyboxCapture:Qt(` +varying highp vec3 v_position;uniform highp float u_sun_intensity;uniform highp float u_luminance;uniform lowp vec3 u_sun_direction;uniform highp vec4 u_color_tint_r;uniform highp vec4 u_color_tint_m; +#ifdef GL_ES +precision highp float; +#endif +#define BETA_R vec3(5.5e-6,13.0e-6,22.4e-6) +#define BETA_M vec3(21e-6,21e-6,21e-6) +#define MIE_G 0.76 +#define DENSITY_HEIGHT_SCALE_R 8000.0 +#define DENSITY_HEIGHT_SCALE_M 1200.0 +#define PLANET_RADIUS 6360e3 +#define ATMOSPHERE_RADIUS 6420e3 +#define SAMPLE_STEPS 10 +#define DENSITY_STEPS 4 +float ray_sphere_exit(vec3 orig,vec3 dir,float radius) {float a=dot(dir,dir);float b=2.0*dot(dir,orig);float c=dot(orig,orig)-radius*radius;float d=sqrt(b*b-4.0*a*c);return (-b+d)/(2.0*a);}vec3 extinction(vec2 density) {return exp(-vec3(BETA_R*u_color_tint_r.a*density.x+BETA_M*u_color_tint_m.a*density.y));}vec2 local_density(vec3 point) {float height=max(length(point)-PLANET_RADIUS,0.0);float exp_r=exp(-height/DENSITY_HEIGHT_SCALE_R);float exp_m=exp(-height/DENSITY_HEIGHT_SCALE_M);return vec2(exp_r,exp_m);}float phase_ray(float cos_angle) {return (3.0/(16.0*PI))*(1.0+cos_angle*cos_angle);}float phase_mie(float cos_angle) {return (3.0/(8.0*PI))*((1.0-MIE_G*MIE_G)*(1.0+cos_angle*cos_angle))/((2.0+MIE_G*MIE_G)*pow(1.0+MIE_G*MIE_G-2.0*MIE_G*cos_angle,1.5));}vec2 density_to_atmosphere(vec3 point,vec3 light_dir) {float ray_len=ray_sphere_exit(point,light_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(DENSITY_STEPS);vec2 density_point_to_atmosphere=vec2(0.0);for (int i=0; i < DENSITY_STEPS;++i) {vec3 point_on_ray=point+light_dir*((float(i)+0.5)*step_len);density_point_to_atmosphere+=local_density(point_on_ray)*step_len;;}return density_point_to_atmosphere;}vec3 atmosphere(vec3 ray_dir,vec3 sun_direction,float sun_intensity) {vec2 density_orig_to_point=vec2(0.0);vec3 scatter_r=vec3(0.0);vec3 scatter_m=vec3(0.0);vec3 origin=vec3(0.0,PLANET_RADIUS,0.0);float ray_len=ray_sphere_exit(origin,ray_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(SAMPLE_STEPS);for (int i=0; i < SAMPLE_STEPS;++i) {vec3 point_on_ray=origin+ray_dir*((float(i)+0.5)*step_len);vec2 density=local_density(point_on_ray)*step_len;density_orig_to_point+=density;vec2 density_point_to_atmosphere=density_to_atmosphere(point_on_ray,sun_direction);vec2 density_orig_to_atmosphere=density_orig_to_point+density_point_to_atmosphere;vec3 extinction=extinction(density_orig_to_atmosphere);scatter_r+=density.x*extinction;scatter_m+=density.y*extinction;}float cos_angle=dot(ray_dir,sun_direction);float phase_r=phase_ray(cos_angle);float phase_m=phase_mie(cos_angle);vec3 beta_r=BETA_R*u_color_tint_r.rgb*u_color_tint_r.a;vec3 beta_m=BETA_M*u_color_tint_m.rgb*u_color_tint_m.a;return (scatter_r*phase_r*beta_r+scatter_m*phase_m*beta_m)*sun_intensity;}const float A=0.15;const float B=0.50;const float C=0.10;const float D=0.20;const float E=0.02;const float F=0.30;vec3 uncharted2_tonemap(vec3 x) {return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;}void main() {vec3 ray_direction=v_position;ray_direction.y=pow(ray_direction.y,5.0);const float y_bias=0.015;ray_direction.y+=y_bias;vec3 color=atmosphere(normalize(ray_direction),u_sun_direction,u_sun_intensity);float white_scale=1.0748724675633854;color=uncharted2_tonemap((log2(2.0/pow(u_luminance,4.0)))*color)*white_scale;gl_FragColor=vec4(color,1.0);}`,"attribute highp vec3 a_pos_3f;uniform mat3 u_matrix_3f;varying highp vec3 v_position;float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec4 pos=vec4(u_matrix_3f*a_pos_3f,1.0);v_position=pos.xyz;v_position.y*=-1.0;v_position.y=map(v_position.y,-1.0,1.0,0.0,1.0);gl_Position=vec4(a_pos_3f.xy,0.0,1.0);}"),globeRaster:Qt(`uniform sampler2D u_image0;varying vec2 v_pos0; +#ifndef FOG +uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform vec2 u_viewport; +#endif +void main() {vec4 color; +#ifdef CUSTOM_ANTIALIASING +vec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix( +mix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);vec3 dir=normalize(ray_dir);vec3 closest_point=dot(u_globe_pos,dir)*dir;float norm_dist_from_center=1.0-length(closest_point-u_globe_pos)/u_globe_radius;const float antialias_pixel=2.0;float antialias_factor=antialias_pixel*fwidth(norm_dist_from_center);float antialias=smoothstep(0.0,antialias_factor,norm_dist_from_center);vec4 raster=texture2D(u_image0,v_pos0);color=vec4(raster.rgb*antialias,raster.a*antialias); +#else +color=texture2D(u_image0,v_pos0); +#endif +#ifdef FOG +color=fog_dither(fog_apply_premultiplied(color,v_fog_pos)); +#endif +gl_FragColor=color; +#ifdef TERRAIN_WIREFRAME +gl_FragColor=vec4(1.0,0.0,0.0,0.8); +#endif +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_proj_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform float u_zoom_transition;uniform vec2 u_merc_center;uniform mat3 u_grid_matrix;uniform float u_skirt_height; +#ifdef GLOBE_POLES +attribute vec3 a_globe_pos;attribute vec2 a_uv; +#else +attribute vec2 a_pos; +#endif +varying vec2 v_pos0;const float wireframeOffset=1e3;float mercatorXfromLng(float lng) {return (180.0+lng)/360.0;}float mercatorYfromLat(float lat) {return (180.0-(RAD_TO_DEG*log(tan(QUARTER_PI+lat/2.0*DEG_TO_RAD))))/360.0;}vec3 latLngToECEF(vec2 latLng) {latLng=DEG_TO_RAD*latLng;float cosLat=cos(latLng[0]);float sinLat=sin(latLng[0]);float cosLng=cos(latLng[1]);float sinLng=sin(latLng[1]);float sx=cosLat*sinLng*GLOBE_RADIUS;float sy=-sinLat*GLOBE_RADIUS;float sz=cosLat*cosLng*GLOBE_RADIUS;return vec3(sx,sy,sz);}void main() { +#ifdef GLOBE_POLES +vec3 globe_pos=a_globe_pos;vec2 uv=a_uv; +#else +float tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];vec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float uvY=mercatorY*tiles-idy;float mercatorX=mercatorXfromLng(latLng[1]);float uvX=mercatorX*tiles-idx;vec3 globe_pos=latLngToECEF(latLng.xy);vec2 merc_pos=vec2(mercatorX,mercatorY);vec2 uv=vec2(uvX,uvY); +#endif +v_pos0=uv;vec2 tile_pos=uv*EXTENT;vec3 globe_derived_up_vector=normalize(globe_pos)*u_tile_up_scale; +#ifdef GLOBE_POLES +vec3 up_vector=globe_derived_up_vector; +#else +vec3 up_vector=elevationVector(tile_pos); +#endif +float height=elevation(tile_pos); +#ifdef TERRAIN_WIREFRAME +height+=wireframeOffset; +#endif +globe_pos+=up_vector*height; +#ifndef GLOBE_POLES +globe_pos-=globe_derived_up_vector*u_skirt_height*decomposed_pos_and_skirt.z; +#endif +#ifdef GLOBE_POLES +vec4 interpolated_pos=u_globe_matrix*vec4(globe_pos,1.0); +#else +vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {merc_world_pos=vec4(merc_pos,height-u_skirt_height*decomposed_pos_and_skirt.z,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition),1.0); +#endif +gl_Position=u_proj_matrix*interpolated_pos; +#ifdef FOG +v_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz); +#endif +}`),globeAtmosphere:Qt(`uniform float u_transition;uniform highp float u_fadeout_range;uniform highp float u_temporal_offset;uniform vec3 u_start_color;uniform vec4 u_color;uniform vec4 u_space_color;uniform vec4 u_high_color;uniform float u_star_intensity;uniform float u_star_size;uniform float u_star_density;uniform float u_horizon_angle;uniform mat4 u_rotation_matrix;varying highp vec3 v_ray_dir;varying highp vec3 v_horizon_dir;highp float random(highp vec3 p) {p=fract(p*vec3(23.2342,97.1231,91.2342));p+=dot(p.zxy,p.yxz+123.1234);return fract(p.x*p.y);}float stars(vec3 p,float scale,vec2 offset) {vec2 uv_scale=(u_viewport/u_star_size)*scale;vec3 position=vec3(p.xy*uv_scale+offset*u_viewport,p.z);vec3 q=fract(position)-0.5;vec3 id=floor(position);float random_visibility=step(random(id),u_star_density);float circle=smoothstep(0.5+u_star_intensity,0.5,length(q));return circle*random_visibility;}void main() {highp vec3 dir=normalize(v_ray_dir);float globe_pos_dot_dir; +#ifdef PROJECTION_GLOBE_VIEW +globe_pos_dot_dir=dot(u_globe_pos,dir);highp vec3 closest_point_forward=abs(globe_pos_dot_dir)*dir;float norm_dist_from_center=length(closest_point_forward-u_globe_pos)/u_globe_radius;if (norm_dist_from_center < 0.98) {discard;return;} +#endif +highp vec3 horizon_dir=normalize(v_horizon_dir);float horizon_angle_mercator=dir.y < horizon_dir.y ? +0.0 : max(acos(dot(dir,horizon_dir)),0.0);float horizon_angle; +#ifdef PROJECTION_GLOBE_VIEW +highp vec3 closest_point=globe_pos_dot_dir*dir;float closest_point_to_center=length(closest_point-u_globe_pos);float theta=asin(clamp(closest_point_to_center/length(u_globe_pos),-1.0,1.0));horizon_angle=globe_pos_dot_dir < 0.0 ? +PI-theta-u_horizon_angle : theta-u_horizon_angle;float angle_t=pow(u_transition,10.0);horizon_angle=mix(horizon_angle,horizon_angle_mercator,angle_t); +#else +horizon_angle=horizon_angle_mercator; +#endif +horizon_angle/=PI;float t=exp(-horizon_angle/u_fadeout_range);float alpha_0=u_color.a;float alpha_1=u_high_color.a;float alpha_2=u_space_color.a;vec3 color_stop_0=u_color.rgb;vec3 color_stop_1=u_high_color.rgb;vec3 color_stop_2=u_space_color.rgb;vec3 c0=mix(color_stop_2,color_stop_1,alpha_1);vec3 c1=mix(c0,color_stop_0,alpha_0);vec3 c2=mix(c0,c1,t);vec3 c =mix(color_stop_2,c2,t);float a0=mix(alpha_2,1.0,alpha_1);float a1=mix(a0,1.0,alpha_0);float a2=mix(a0,a1,t);float a =mix(alpha_2,a2,t);vec2 uv=gl_FragCoord.xy/u_viewport-0.5;float aspect_ratio=u_viewport.x/u_viewport.y;vec4 uv_dir=vec4(normalize(vec3(uv.x*aspect_ratio,uv.y,1.0)),1.0);uv_dir=u_rotation_matrix*uv_dir;vec3 n=abs(uv_dir.xyz);vec2 uv_remap=(n.x > n.y && n.x > n.z) ? uv_dir.yz/uv_dir.x: +(n.y > n.x && n.y > n.z) ? uv_dir.zx/uv_dir.y: +uv_dir.xy/uv_dir.z;uv_remap.x/=aspect_ratio;vec3 D=vec3(uv_remap,1.0);highp float star_field=0.0;if (u_star_intensity > 0.0) {star_field+=stars(D,1.2,vec2(0.0,0.0));star_field+=stars(D,1.0,vec2(1.0,0.0));star_field+=stars(D,0.8,vec2(0.0,1.0));star_field+=stars(D,0.6,vec2(1.0,1.0));star_field*=(1.0-pow(t,0.25+(1.0-u_high_color.a)*0.75));c+=star_field*alpha_2;}c=dither(c,gl_FragCoord.xy+u_temporal_offset);gl_FragColor=vec4(c,a);}`,`attribute vec3 a_pos;attribute vec2 a_uv;uniform vec3 u_frustum_tl;uniform vec3 u_frustum_tr;uniform vec3 u_frustum_br;uniform vec3 u_frustum_bl;uniform float u_horizon;varying highp vec3 v_ray_dir;varying highp vec3 v_horizon_dir;void main() {v_ray_dir=mix( +mix(u_frustum_tl,u_frustum_tr,a_uv.x),mix(u_frustum_bl,u_frustum_br,a_uv.x),a_uv.y);v_horizon_dir=mix( +mix(u_frustum_tl,u_frustum_bl,u_horizon),mix(u_frustum_tr,u_frustum_br,u_horizon),a_uv.x);gl_Position=vec4(a_pos,1.0);}`)};function ga(d,o){const c=d.replace(/\s*\/\/[^\n]*\n/g,` +`).split(` +`);for(let f of c)if(f=f.trim(),f[0]==="#"&&f.includes("if")&&!f.includes("endif")){f=f.replace("#","").replace(/ifdef|ifndef|elif|if/g,"").replace(/!|defined|\(|\)|\|\||&&/g,"").replace(/\s+/g," ").trim();const _=f.split(" ");for(const x of _)o.includes(x)||o.push(x)}}function Qt(d,o){const c=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,f=o.match(/attribute (highp |mediump |lowp )?([\w]+) ([\w]+)/g),_={},x=[...Il];return ga(d,x),ga(o,x),{fragmentSource:d=d.replace(c,(T,S,C,z,P)=>(_[P]=!0,S==="define"?` +#ifndef HAS_UNIFORM_u_${P} +varying ${C} ${z} ${P}; +#else +uniform ${C} ${z} u_${P}; +#endif +`:` +#ifdef HAS_UNIFORM_u_${P} + ${C} ${z} ${P} = u_${P}; +#endif +`)),vertexSource:o=o.replace(c,(T,S,C,z,P)=>{const O=z==="float"?"vec2":"vec4",j=P.match(/color/)?"color":O;return _[P]?S==="define"?` +#ifndef HAS_UNIFORM_u_${P} +uniform lowp float u_${P}_t; +attribute ${C} ${O} a_${P}; +varying ${C} ${z} ${P}; +#else +uniform ${C} ${z} u_${P}; +#endif +`:j==="vec4"?` +#ifndef HAS_UNIFORM_u_${P} + ${P} = a_${P}; +#else + ${C} ${z} ${P} = u_${P}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${P} + ${P} = unpack_mix_${j}(a_${P}, u_${P}_t); +#else + ${C} ${z} ${P} = u_${P}; +#endif +`:S==="define"?` +#ifndef HAS_UNIFORM_u_${P} +uniform lowp float u_${P}_t; +attribute ${C} ${O} a_${P}; +#else +uniform ${C} ${z} u_${P}; +#endif +`:j==="vec4"?` +#ifndef HAS_UNIFORM_u_${P} + ${C} ${z} ${P} = a_${P}; +#else + ${C} ${z} ${P} = u_${P}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${P} + ${C} ${z} ${P} = unpack_mix_${j}(a_${P}, u_${P}_t); +#else + ${C} ${z} ${P} = u_${P}; +#endif +`}),staticAttributes:f,usedDefines:x}}class W_{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffers=[],this.vao=null}bind(o,c,f,_,x,T,S){this.context=o;let C=this.boundPaintVertexBuffers.length!==_.length;for(let P=0;!C&&P<_.length;P++)this.boundPaintVertexBuffers[P]!==_[P]&&(C=!0);let z=this.boundDynamicVertexBuffers.length!==S.length;for(let P=0;!z&&P{const Q=B.paint.get("hillshade-shadow-color"),ee=B.paint.get("hillshade-highlight-color"),de=B.paint.get("hillshade-accent-color");let fe=B.paint.get("hillshade-illumination-direction")*(Math.PI/180);B.paint.get("hillshade-illumination-anchor")==="viewport"&&(fe-=Z.transform.angle);const pe=!Z.options.moving;return{u_matrix:q||Z.transform.calculateProjMatrix(X.tileID.toUnwrapped(),pe),u_image:0,u_latrange:Oh(0,X.tileID),u_light:[B.paint.get("hillshade-exaggeration"),fe],u_shadow:Q,u_highlight:ee,u_accent:de}})(d,c,f,d.terrain?o.projMatrix:null);d.prepareDrawProgram(S,P,o.toUnwrapped());const{tileBoundsBuffer:j,tileBoundsIndexBuffer:W,tileBoundsSegments:H}=d.getTileBoundsBuffers(c);P.draw(S,C.TRIANGLES,_,x,T,s.CullFaceMode.disabled,O,f.id,j,W,H)}function Bh(d,o,c){if(!o.needsDEMTextureUpload)return;const f=d.context,_=f.gl;f.pixelStoreUnpackPremultiplyAlpha.set(!1),o.demTexture=o.demTexture||d.getTileTexture(c.stride);const x=c.getPixels();o.demTexture?o.demTexture.update(x,{premultiply:!1}):o.demTexture=new s.Texture(f,x,_.RGBA,{premultiply:!1}),o.needsDEMTextureUpload=!1}function gf(d,o,c,f,_,x){const T=d.context,S=T.gl;if(!o.dem)return;const C=o.dem;if(T.activeTexture.set(S.TEXTURE1),Bh(d,o,C),!o.demTexture)return;o.demTexture.bind(S.NEAREST,S.CLAMP_TO_EDGE);const z=C.dim;T.activeTexture.set(S.TEXTURE0);let P=o.fbo;if(!P){const H=new s.Texture(T,{width:z,height:z,data:null},S.RGBA);H.bind(S.LINEAR,S.CLAMP_TO_EDGE),P=o.fbo=T.createFramebuffer(z,z,!0),P.colorAttachment.set(H.texture)}T.bindFramebuffer.set(P.framebuffer),T.viewport.set([0,0,z,z]);const{tileBoundsBuffer:O,tileBoundsIndexBuffer:j,tileBoundsSegments:W}=d.getMercatorTileBoundsBuffers();d.useProgram("hillshadePrepare").draw(T,S.TRIANGLES,f,_,x,s.CullFaceMode.disabled,((H,Z)=>{const X=Z.stride,B=s.create();return s.ortho(B,0,s.EXTENT,-s.EXTENT,0,0,1),s.translate(B,B,[0,-s.EXTENT,0]),{u_matrix:B,u_image:1,u_dimension:[X,X],u_zoom:H.overscaledZ,u_unpack:Z.unpackVector}})(o.tileID,C),c.id,O,j,W),o.needsHillshadePrepare=!1}const Fh=d=>({u_matrix:new s.UniformMatrix4f(d),u_image0:new s.Uniform1i(d),u_skirt_height:new s.Uniform1f(d)}),_a=(d,o)=>({u_matrix:d,u_image0:0,u_skirt_height:o}),Lc=(d,o,c,f,_,x,T,S,C,z,P,O,j,W,H)=>({u_proj_matrix:Float32Array.from(d),u_globe_matrix:o,u_normalize_matrix:Float32Array.from(f),u_merc_matrix:c,u_zoom_transition:_,u_merc_center:x,u_image0:0,u_frustum_tl:T,u_frustum_tr:S,u_frustum_br:C,u_frustum_bl:z,u_globe_pos:P,u_globe_radius:O,u_viewport:j,u_grid_matrix:H?Float32Array.from(H):new Float32Array(9),u_skirt_height:W});function ya(d,o){return d!=null&&o!=null&&!(!d.hasData()||!o.hasData())&&d.demTexture!=null&&o.demTexture!=null&&d.tileID.key!==o.tileID.key}const Co=new class{constructor(){this.operations={}}newMorphing(d,o,c,f,_){if(d in this.operations){const x=this.operations[d];x.to.tileID.key!==c.tileID.key&&(x.queued=c)}else this.operations[d]={startTime:f,phase:0,duration:_,from:o,to:c,queued:null}}getMorphValuesForProxy(d){if(!(d in this.operations))return null;const o=this.operations[d];return{from:o.from,to:o.to,phase:o.phase}}update(d){for(const o in this.operations){const c=this.operations[o];for(c.phase=(d-c.startTime)/c.duration;c.phase>=1||!this._validOp(c);)if(!this._nextOp(c,d)){delete this.operations[o];break}}}_nextOp(d,o){return!!d.queued&&(d.from=d.to,d.to=d.queued,d.queued=null,d.phase=0,d.startTime=o,!0)}_validOp(d){return d.from.hasData()&&d.to.hasData()}},zs={0:null,1:"TERRAIN_VERTEX_MORPHING",2:"TERRAIN_WIREFRAME"};function Rc(d){return 6*Math.pow(1.5,22-d)}function _f(d,o){const c=1<({u_matrix:d});function Nh(d,o,c,f,_){if(_>0){const x=s.exported.now(),T=(x-d.timeAdded)/_,S=o?(x-o.timeAdded)/_:-1,C=c.getSource(),z=f.coveringZoomLevel({tileSize:C.tileSize,roundZoom:C.roundZoom}),P=!o||Math.abs(o.tileID.overscaledZ-z)>Math.abs(d.tileID.overscaledZ-z),O=P&&d.refreshedUponExpiration?1:s.clamp(P?T:1-S,0,1);return d.refreshedUponExpiration&&T>=1&&(d.refreshedUponExpiration=!1),o?{opacity:1,mix:1-O}:{opacity:O,mix:0}}return{opacity:1,mix:0}}class Uh extends s.SourceCache{constructor(o){const c={type:"raster-dem",maxzoom:o.transform.maxZoom},f=new xt(ha(),null),_=Dt("mock-dem",c,f,o.style);super("mock-dem",_,!1),_.setEventedParent(this),this._sourceLoaded=!0}_loadTile(o,c){o.state="loaded",c(null)}}class Dc extends s.SourceCache{constructor(o){const c=Dt("proxy",{type:"geojson",maxzoom:o.transform.maxZoom},new xt(ha(),null),o.style);super("proxy",c,!1),c.setEventedParent(this),this.map=this.getSource().map=o,this.used=this._sourceLoaded=!0,this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}update(o,c,f){if(o.freezeTileCoverage)return;this.transform=o;const _=o.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}).reduce((x,T)=>{if(x[T.key]="",!this._tiles[T.key]){const S=new s.Tile(T,this._source.tileSize*T.overscaleFactor(),o.tileZoom);S.state="loaded",this._tiles[T.key]=S}return x},{});for(const x in this._tiles)x in _||(this.freeFBO(x),this._tiles[x].unloadVectorData(),delete this._tiles[x])}freeFBO(o){const c=this.proxyCachedFBO[o];if(c!==void 0){const f=Object.values(c);this.renderCachePool.push(...f),delete this.proxyCachedFBO[o]}}deallocRenderCache(){this.renderCache.forEach(o=>o.fb.destroy()),this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}}class Oc extends s.OverscaledTileID{constructor(o,c,f){super(o.overscaledZ,o.wrap,o.canonical.z,o.canonical.x,o.canonical.y),this.proxyTileKey=c,this.projMatrix=f}}class jh extends s.Elevation{constructor(o,c){super(),this.painter=o,this.terrainTileForTile={},this.prevTerrainTileForTile={};const[f,_,x]=function(C){const z=new s.StructArrayLayout2i4,P=new s.StructArrayLayout3ui6,O=131;z.reserve(17161),P.reserve(33800);const j=s.EXTENT/128,W=s.EXTENT+j/2,H=W+j;for(let X=-j;XW||X<0||X>W?24575:0,Q=s.clamp(Math.round(B),0,s.EXTENT),ee=s.clamp(Math.round(X),0,s.EXTENT);z.emplaceBack(Q+q,ee)}const Z=(X,B)=>{const q=B*O+X;P.emplaceBack(q+1,q,q+O),P.emplaceBack(q+O,q+O+1,q+1)};for(let X=1;X<129;X++)for(let B=1;B<129;B++)Z(B,X);return[0,129].forEach(X=>{for(let B=0;B<130;B++)Z(B,X),Z(X,B)}),[z,P,32768]}(),T=o.context;this.gridBuffer=T.createVertexBuffer(f,s.posAttributes.members),this.gridIndexBuffer=T.createIndexBuffer(_),this.gridSegments=s.SegmentVector.simpleSegment(0,0,f.length,_.length),this.gridNoSkirtSegments=s.SegmentVector.simpleSegment(0,0,f.length,x),this.proxyCoords=[],this.proxiedCoords={},this._visibleDemTiles=[],this._drapedRenderBatches=[],this._sourceTilesOverlap={},this.proxySourceCache=new Dc(c.map),this.orthoMatrix=s.create(),s.ortho(this.orthoMatrix,this.painter.transform.projection.name==="globe"?.015:0,s.EXTENT,0,s.EXTENT,0,1);const S=T.gl;this._overlapStencilMode=new s.StencilMode({func:S.GEQUAL,mask:255},0,255,S.KEEP,S.KEEP,S.REPLACE),this._previousZoom=o.transform.zoom,this.pool=[],this._findCoveringTileCache={},this._tilesDirty={},this.style=c,this._useVertexMorphing=!0,this._exaggeration=1,this._mockSourceCache=new Uh(c.map)}set style(o){o.on("data",this._onStyleDataEvent.bind(this)),o.on("neworder",this._checkRenderCacheEfficiency.bind(this)),this._style=o,this._checkRenderCacheEfficiency(),this._style.map.on("moveend",()=>{this._clearLineLayersFromRenderCache()})}update(o,c,f){if(o&&o.terrain){this._style!==o&&(this.style=o),this.enabled=!0;const _=o.terrain.properties;this.sourceCache=o.terrain.drapeRenderMode===0?this._mockSourceCache:o._getSourceCache(_.get("source")),this._exaggeration=_.get("exaggeration");const x=()=>{this.sourceCache.used&&s.warnOnce(`Raster DEM source '${this.sourceCache.id}' is used both for terrain and as layer source. +This leads to lower resolution of hillshade. For full hillshade resolution but higher memory consumption, define another raster DEM source.`);const T=this.getScaledDemTileSize();this.sourceCache.update(c,T,!0),this.resetTileLookupCache(this.sourceCache.id)};this.sourceCache.usedForTerrain||(this.resetTileLookupCache(this.sourceCache.id),this.sourceCache.usedForTerrain=!0,x(),this._initializing=!0),x(),c.updateElevation(!0,f),this.resetTileLookupCache(this.proxySourceCache.id),this.proxySourceCache.update(c),this._emptyDEMTextureDirty=!0}else this._disable()}resetTileLookupCache(o){this._findCoveringTileCache[o]={}}getScaledDemTileSize(){return this.sourceCache.getSource().tileSize/128*this.proxySourceCache.getSource().tileSize}_checkRenderCacheEfficiency(){const o=this.renderCacheEfficiency(this._style);this._style.map._optimizeForTerrain||o.efficiency!==100&&s.warnOnce(`Terrain render cache efficiency is not optimal (${o.efficiency}%) and performance + may be affected negatively, consider placing all background, fill and line layers before layer + with id '${o.firstUndrapedLayer}' or create a map using optimizeForTerrain: true option.`)}_onStyleDataEvent(o){o.coord&&o.dataType==="source"?this._clearRenderCacheForTile(o.sourceCacheId,o.coord):o.dataType==="style"&&(this._invalidateRenderCache=!0)}_disable(){if(this.enabled&&(this.enabled=!1,this._sharedDepthStencil=void 0,this.proxySourceCache.deallocRenderCache(),this._style))for(const o in this._style._sourceCaches)this._style._sourceCaches[o].usedForTerrain=!1}destroy(){this._disable(),this._emptyDEMTexture&&this._emptyDEMTexture.destroy(),this._emptyDepthBufferTexture&&this._emptyDepthBufferTexture.destroy(),this.pool.forEach(o=>o.fb.destroy()),this.pool=[],this._depthFBO&&(this._depthFBO.destroy(),this._depthFBO=void 0,this._depthTexture=void 0)}_source(){return this.enabled?this.sourceCache:null}isUsingMockSource(){return this.sourceCache===this._mockSourceCache}exaggeration(){return this._exaggeration}get visibleDemTiles(){return this._visibleDemTiles}get drapeBufferSize(){const o=2*this.proxySourceCache.getSource().tileSize;return[o,o]}set useVertexMorphing(o){this._useVertexMorphing=o}updateTileBinding(o){if(!this.enabled)return;this.prevTerrainTileForTile=this.terrainTileForTile;const c=this.proxySourceCache,f=this.painter.transform;this._initializing&&(this._initializing=f._centerAltitude===0&&this.getAtPointOrZero(s.MercatorCoordinate.fromLngLat(f.center),-1)===-1,this._emptyDEMTextureDirty=!this._initializing);const _=this.proxyCoords=c.getIds().map(C=>{const z=c.getTileByID(C).tileID;return z.projMatrix=f.calculateProjMatrix(z.toUnwrapped()),z});(function(C,z){const P=z.transform.pointCoordinate(z.transform.getCameraPoint()),O=new s.Point(P.x,P.y);C.sort((j,W)=>{if(W.overscaledZ-j.overscaledZ)return W.overscaledZ-j.overscaledZ;const H=new s.Point(j.canonical.x+(1<{this.proxyToSource[C.key]={}}),this.terrainTileForTile={};const T=this._style._sourceCaches;for(const C in T){const z=T[C];if(!z.used||(z!==this.sourceCache&&this.resetTileLookupCache(z.id),this._setupProxiedCoordsForOrtho(z,o[C],x),z.usedForTerrain))continue;const P=o[C];z.getSource().reparseOverscaled&&this._assignTerrainTiles(P)}this.proxiedCoords[c.id]=_.map(C=>new Oc(C,C.key,this.orthoMatrix)),this._assignTerrainTiles(_),this._prepareDEMTextures(),this._setupDrapedRenderBatches(),this._initFBOPool(),this._setupRenderCache(x),this.renderingToTexture=!1,this._updateTimestamp=s.exported.now();const S={};this._visibleDemTiles=[];for(const C of this.proxyCoords){const z=this.terrainTileForTile[C.key];if(!z)continue;const P=z.tileID.key;P in S||(this._visibleDemTiles.push(z),S[P]=P)}}_assignTerrainTiles(o){this._initializing||o.forEach(c=>{if(this.terrainTileForTile[c.key])return;const f=this._findTileCoveringTileID(c,this.sourceCache);f&&(this.terrainTileForTile[c.key]=f)})}_prepareDEMTextures(){const o=this.painter.context,c=o.gl;for(const f in this.terrainTileForTile){const _=this.terrainTileForTile[f],x=_.dem;!x||_.demTexture&&!_.needsDEMTextureUpload||(o.activeTexture.set(c.TEXTURE1),Bh(this.painter,_,x))}}_prepareDemTileUniforms(o,c,f,_){if(!c||c.demTexture==null)return!1;const x=o.tileID.canonical,T=Math.pow(2,c.tileID.canonical.z-x.z),S=_||"";return f[`u_dem_tl${S}`]=[x.x*T%1,x.y*T%1],f[`u_dem_scale${S}`]=T,!0}get emptyDEMTexture(){return!this._emptyDEMTextureDirty&&this._emptyDEMTexture?this._emptyDEMTexture:this._updateEmptyDEMTexture()}get emptyDepthBufferTexture(){const o=this.painter.context,c=o.gl;if(!this._emptyDepthBufferTexture){const f=new s.RGBAImage({width:1,height:1},Uint8Array.of(255,255,255,255));this._emptyDepthBufferTexture=new s.Texture(o,f,c.RGBA,{premultiply:!1})}return this._emptyDepthBufferTexture}_getLoadedAreaMinimum(){let o=0;const c=this._visibleDemTiles.reduce((f,_)=>{if(!_.dem)return f;const x=_.dem.tree.minimums[0];return x>0&&o++,f+x},0);return o?c/o:0}_updateEmptyDEMTexture(){const o=this.painter.context,c=o.gl;o.activeTexture.set(c.TEXTURE2);const f=this._getLoadedAreaMinimum(),_=new s.RGBAImage({width:1,height:1},new Uint8Array(s.DEMData.pack(f,this.sourceCache.getSource().encoding)));this._emptyDEMTextureDirty=!1;let x=this._emptyDEMTexture;return x?x.update(_,{premultiply:!1}):x=this._emptyDEMTexture=new s.Texture(o,_,c.RGBA,{premultiply:!1}),x}setupElevationDraw(o,c,f){const _=this.painter.context,x=_.gl,T=(S=this.sourceCache.getSource().encoding,{u_dem:2,u_dem_prev:4,u_dem_unpack:s.DEMData.getUnpackVector(S),u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_exaggeration:0});var S;T.u_dem_size=this.sourceCache.getSource().tileSize,T.u_exaggeration=this.exaggeration();let C=null,z=null,P=1;if(f&&f.morphing&&this._useVertexMorphing){const O=f.morphing.srcDemTile,j=f.morphing.dstDemTile;P=f.morphing.phase,O&&j&&(this._prepareDemTileUniforms(o,O,T,"_prev")&&(z=O),this._prepareDemTileUniforms(o,j,T)&&(C=j))}if(z&&C?(_.activeTexture.set(x.TEXTURE2),C.demTexture.bind(x.NEAREST,x.CLAMP_TO_EDGE,x.NEAREST),_.activeTexture.set(x.TEXTURE4),z.demTexture.bind(x.NEAREST,x.CLAMP_TO_EDGE,x.NEAREST),T.u_dem_lerp=P):(C=this.terrainTileForTile[o.tileID.key],_.activeTexture.set(x.TEXTURE2),(this._prepareDemTileUniforms(o,C,T)?C.demTexture:this.emptyDEMTexture).bind(x.NEAREST,x.CLAMP_TO_EDGE)),_.activeTexture.set(x.TEXTURE3),f&&f.useDepthForOcclusion?(this._depthTexture&&this._depthTexture.bind(x.NEAREST,x.CLAMP_TO_EDGE),this._depthFBO&&(T.u_depth_size_inv=[1/this._depthFBO.width,1/this._depthFBO.height])):(this.emptyDepthBufferTexture.bind(x.NEAREST,x.CLAMP_TO_EDGE),T.u_depth_size_inv=[1,1]),f&&f.useMeterToDem&&C){const O=(1<{if(B===qe)return;const Be=[zs[qe],"PROJECTION_GLOBE_VIEW"];ee&&Be.push("CUSTOM_ANTIALIASING"),Se&&Be.push(zs[q]),X=z.useProgram("globeRaster",null,Be),B=qe},fe=z.colorModeForRenderPass(),pe=new s.DepthMode(Z.LEQUAL,s.DepthMode.ReadWrite,z.depthRangeFor3D);Co.update(W);const xe=s.calculateGlobeMercatorMatrix(Q),ye=[s.mercatorXfromLng(Q.center.lng),s.mercatorYfromLat(Q.center.lat)],Ae=q?[!1,!0]:[!1],We=z.globeSharedBuffers,Ee=[Q.width*s.exported.devicePixelRatio,Q.height*s.exported.devicePixelRatio],Fe=Float32Array.from(Q.globeMatrix),ke={useDenormalizedUpVectorScale:!0};if(Ae.forEach(qe=>{const Se=z.transform,Be=Rc(Se.zoom)*P.exaggeration();B=-1;const Xe=qe?Z.LINES:Z.TRIANGLES;for(const $e of j){const Ye=O.getTile($e),gt=s.StencilMode.disabled,Et=P.prevTerrainTileForTile[$e.key],pt=P.terrainTileForTile[$e.key];ya(Et,pt)&&Co.newMorphing($e.key,Et,pt,W,250),H.activeTexture.set(Z.TEXTURE0),Ye.texture.bind(Z.LINEAR,Z.CLAMP_TO_EDGE);const wt=Co.getMorphValuesForProxy($e.key),Ut=wt?1:0;wt&&s.extend$1(ke,{morphing:{srcDemTile:wt.from,dstDemTile:wt.to,phase:s.easeCubicInOut(wt.phase)}});const Ot=s.tileCornersToBounds($e.canonical),mt=s.getLatitudinalLod(Ot.getCenter().lat),en=s.getGridMatrix($e.canonical,Ot,mt,Se.worldSize/Se._pixelsPerMercatorPixel),rn=s.globeNormalizeECEF(s.globeTileBounds($e.canonical)),on=Lc(Se.projMatrix,Fe,xe,rn,s.globeToMercatorTransition(Se.zoom),ye,Se.frustumCorners.TL,Se.frustumCorners.TR,Se.frustumCorners.BR,Se.frustumCorners.BL,Se.globeCenterInViewSpace,Se.globeRadius,Ee,Be,en);if(de(Ut,qe),P.setupElevationDraw(Ye,X,ke),z.prepareDrawProgram(H,X,$e.toUnwrapped()),We){const[sn,Mr,fr]=qe?We.getWirefameBuffers(z.context,mt):We.getGridBuffers(mt,Be!==0);X.draw(H,Xe,pe,gt,fe,s.CullFaceMode.backCCW,on,"globe_raster",sn,Mr,fr)}}}),We){const qe=["GLOBE_POLES","PROJECTION_GLOBE_VIEW"];ee&&qe.push("CUSTOM_ANTIALIASING"),X=z.useProgram("globeRaster",null,qe);for(const Se of j){const{x:Be,y:Xe,z:$e}=Se.canonical,Ye=Xe===0,gt=Xe===(1<<$e)-1,[Et,pt,wt,Ut]=We.getPoleBuffers($e);if(Ut&&(Ye||gt)){const Ot=O.getTile(Se);H.activeTexture.set(Z.TEXTURE0),Ot.texture.bind(Z.LINEAR,Z.CLAMP_TO_EDGE);let mt=s.globePoleMatrixForTile($e,Be,Q);const en=s.globeNormalizeECEF(s.globeTileBounds(Se.canonical)),rn=(on,sn)=>on.draw(H,Z.TRIANGLES,pe,s.StencilMode.disabled,fe,s.CullFaceMode.disabled,Lc(Q.projMatrix,mt,mt,en,0,ye,Q.frustumCorners.TL,Q.frustumCorners.TR,Q.frustumCorners.BR,Q.frustumCorners.BL,Q.globeCenterInViewSpace,Q.globeRadius,Ee,0),"globe_pole_raster",sn,wt,Ut);P.setupElevationDraw(Ot,X,ke),z.prepareDrawProgram(H,X,Se.toUnwrapped()),Ye&&rn(X,Et),gt&&(mt=s.scale(s.create(),mt,[1,-1,1]),rn(X,pt))}}}})(_,x,T,S,C);else{const z=_.context,P=z.gl;let O,j;const W=_.options.showTerrainWireframe?2:0,H=(Q,ee)=>{if(j===Q)return;const de=[zs[Q]];ee&&de.push(zs[W]),O=_.useProgram("terrainRaster",null,de),j=Q},Z=_.colorModeForRenderPass(),X=new s.DepthMode(P.LEQUAL,s.DepthMode.ReadWrite,_.depthRangeFor3D);Co.update(C);const B=_.transform,q=Rc(B.zoom)*x.exaggeration();(W?[!1,!0]:[!1]).forEach(Q=>{j=-1;const ee=Q?P.LINES:P.TRIANGLES,[de,fe]=Q?x.getWirefameBuffer():[x.gridIndexBuffer,x.gridSegments];for(const pe of S){const xe=T.getTile(pe),ye=s.StencilMode.disabled,Ae=x.prevTerrainTileForTile[pe.key],We=x.terrainTileForTile[pe.key];ya(Ae,We)&&Co.newMorphing(pe.key,Ae,We,C,250),z.activeTexture.set(P.TEXTURE0),xe.texture.bind(P.LINEAR,P.CLAMP_TO_EDGE,P.LINEAR_MIPMAP_NEAREST);const Ee=Co.getMorphValuesForProxy(pe.key),Fe=Ee?1:0;let ke;Ee&&(ke={morphing:{srcDemTile:Ee.from,dstDemTile:Ee.to,phase:s.easeCubicInOut(Ee.phase)}});const qe=_a(pe.projMatrix,_f(pe.canonical,B.renderWorldCopies)?q/10:q);H(Fe,Q),x.setupElevationDraw(xe,O,ke),_.prepareDrawProgram(z,O,pe.toUnwrapped()),O.draw(z,ee,X,ye,Z,s.CullFaceMode.backCCW,qe,"terrain_raster",x.gridBuffer,de,fe)}})}}(c,this,this.proxySourceCache,o,this._updateTimestamp),this.renderingToTexture=!0,c.gpuTimingDeferredRenderEnd(),o.splice(0,o.length))}renderBatch(o){if(this._drapedRenderBatches.length===0)return o+1;this.renderingToTexture=!0;const c=this.painter,f=this.painter.context,_=this.proxySourceCache,x=this.proxiedCoords[_.id],T=this._drapedRenderBatches.shift(),S=[],C=c.style.order;let z=0;for(const P of x){const O=_.getTileByID(P.proxyTileKey),j=_.proxyCachedFBO[P.key]?_.proxyCachedFBO[P.key][o]:void 0,W=j!==void 0?_.renderCache[j]:this.pool[z++],H=j!==void 0;if(O.texture=W.tex,H&&!W.dirty){S.push(O.tileID);continue}let Z;f.bindFramebuffer.set(W.fb.framebuffer),this.renderedToTile=!1,W.dirty&&(f.clear({color:s.Color.transparent,stencil:0}),W.dirty=!1);for(let X=T.start;X<=T.end;++X){const B=c.style._layers[C[X]];if(B.isHidden(c.transform.zoom))continue;const q=c.style._getLayerSourceCache(B),Q=q?this.proxyToSource[P.key][q.id]:[P];if(!Q)continue;const ee=Q;f.viewport.set([0,0,W.fb.width,W.fb.height]),Z!==(q?q.id:null)&&(this._setupStencil(W,Q,B,q),Z=q?q.id:null),c.renderLayer(c,q,B,ee)}this.renderedToTile?(W.dirty=!0,S.push(O.tileID)):H||--z,z===5&&(z=0,this.renderToBackBuffer(S))}return this.renderToBackBuffer(S),this.renderingToTexture=!1,f.bindFramebuffer.set(null),f.viewport.set([0,0,c.width,c.height]),T.end+1}postRender(){}renderCacheEfficiency(o){const c=o.order.length;if(c===0)return{efficiency:100};let f,_=0,x=0,T=!1;for(let S=0;Sc.dem).forEach(c=>{o=Math.min(o,c.dem.tree.minimums[0])}),o===0?o:(o-30)*this._exaggeration}raycast(o,c,f){if(!this._visibleDemTiles)return null;const _=this._visibleDemTiles.filter(x=>x.dem).map(x=>{const T=x.tileID,S=1<(x.t!==null?x.t:Number.MAX_VALUE)-(T.t!==null?T.t:Number.MAX_VALUE));for(const x of _){if(x.t==null)return null;const T=x.tile.dem.tree.raycast(x.minx,x.miny,x.maxx,x.maxy,o,c,f);if(T!=null)return T}return null}_createFBO(){const o=this.painter.context,c=o.gl,f=this.drapeBufferSize;o.activeTexture.set(c.TEXTURE0);const _=new s.Texture(o,{width:f[0],height:f[1],data:null},c.RGBA);_.bind(c.LINEAR,c.CLAMP_TO_EDGE);const x=o.createFramebuffer(f[0],f[1],!1);return x.colorAttachment.set(_.texture),x.depthAttachment=new ge(o,x.framebuffer),this._sharedDepthStencil===void 0?(this._sharedDepthStencil=o.createRenderbuffer(o.gl.DEPTH_STENCIL,f[0],f[1]),this._stencilRef=0,x.depthAttachment.set(this._sharedDepthStencil),o.clear({stencil:0})):x.depthAttachment.set(this._sharedDepthStencil),o.extTextureFilterAnisotropic&&!o.extTextureFilterAnisotropicForceOff&&c.texParameterf(c.TEXTURE_2D,o.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,o.extTextureFilterAnisotropicMax),{fb:x,tex:_,dirty:!1}}_initFBOPool(){for(;this.pool.length{const c=this._style._layers[o],f=c.isHidden(this.painter.transform.zoom);return c.type==="custom"?!f&&c.shouldRedrape():!f&&c.hasTransition()})}_clearLineLayersFromRenderCache(){let o=!1;for(const f of this._style._getSources())if(f instanceof rt){o=!0;break}if(!o)return;const c={};for(let f=0;fc.renderCachePool.length){const T=Object.values(c.proxyCachedFBO);c.proxyCachedFBO={};for(let S=0;S=0;T--){const S=f[T];if(c.getTileByID(S.key),c.proxyCachedFBO[S.key]!==void 0){const C=o[S.key],z=this.proxyToSource[S.key];let P=0;for(const O in z){const j=z[O],W=C[O];if(!W||W.length!==j.length||j.some((H,Z)=>H!==W[Z]||_[O]&&_[O].hasOwnProperty(H.key))){P=-1;break}++P}for(const O in c.proxyCachedFBO[S.key])c.renderCache[c.proxyCachedFBO[S.key][O]].dirty=P<0||P!==Object.values(C).length}}const x=[...this._drapedRenderBatches];x.sort((T,S)=>S.end-S.start-(T.end-T.start));for(const T of x)for(const S of f){if(c.proxyCachedFBO[S.key])continue;let C=c.renderCachePool.pop();C===void 0&&c.renderCache.length<50&&(C=c.renderCache.length,c.renderCache.push(this._createFBO())),C!==void 0&&(c.proxyCachedFBO[S.key]={},c.proxyCachedFBO[S.key][T.start]=C,c.renderCache[C].dirty=!0)}this._tilesDirty={}}_setupStencil(o,c,f,_){if(!_||!this._sourceTilesOverlap[_.id])return void(this._overlapStencilType&&(this._overlapStencilType=!1));const x=this.painter.context,T=x.gl;if(c.length<=1)return void(this._overlapStencilType=!1);let S;if(f.isTileClipped())S=c.length,this._overlapStencilMode.test={func:T.EQUAL,mask:255},this._overlapStencilType="Clip";else{if(!(c[0].overscaledZ>c[c.length-1].overscaledZ))return void(this._overlapStencilType=!1);S=1,this._overlapStencilMode.test={func:T.GREATER,mask:255},this._overlapStencilType="Mask"}this._stencilRef+S>255&&(x.clear({stencil:0}),this._stencilRef=0),this._stencilRef+=S,this._overlapStencilMode.ref=this._stencilRef,f.isTileClipped()&&this._renderTileClippingMasks(c,this._overlapStencilMode.ref)}clipOrMaskOverlapStencilType(){return this._overlapStencilType==="Clip"||this._overlapStencilType==="Mask"}stencilModeForRTTOverlap(o){return this.renderingToTexture&&this._overlapStencilType?(this._overlapStencilType==="Clip"&&(this._overlapStencilMode.ref=this.painter._tileClippingMaskIDs[o.key]),this._overlapStencilMode):s.StencilMode.disabled}_renderTileClippingMasks(o,c){const f=this.painter,_=this.painter.context,x=_.gl;f._tileClippingMaskIDs={},_.setColorMode(s.ColorMode.disabled),_.setDepthMode(s.DepthMode.disabled);const T=f.useProgram("clippingMask");for(const S of o){const C=f._tileClippingMaskIDs[S.key]=--c;T.draw(_,x.TRIANGLES,s.DepthMode.disabled,new s.StencilMode({func:x.ALWAYS,mask:0},C,255,x.KEEP,x.KEEP,x.REPLACE),s.ColorMode.disabled,s.CullFaceMode.disabled,kl(S.projMatrix),"$clipping",f.tileExtentBuffer,f.quadTriangleIndexBuffer,f.tileExtentSegments)}}pointCoordinate(o){const c=this.painter.transform;if(o.x<0||o.x>c.width||o.y<0||o.y>c.height)return null;const f=[o.x,o.y,1,1];s.transformMat4$1(f,f,c.pixelMatrixInverse),s.scale$1(f,f,1/f[3]),f[0]/=c.worldSize,f[1]/=c.worldSize;const _=c._camera.position,x=s.mercatorZfromAltitude(1,c.center.lat),T=[_[0],_[1],_[2]/x,0],S=s.subtract([],f.slice(0,3),T);s.normalize(S,S);const C=this.raycast(T,S,this._exaggeration);return C!==null&&C?(s.scaleAndAdd(T,T,S,C),T[3]=T[2],T[2]*=x,T):null}drawDepth(){const o=this.painter,c=o.context,f=this.proxySourceCache,_=Math.ceil(o.width),x=Math.ceil(o.height);if(!this._depthFBO||this._depthFBO.width===_&&this._depthFBO.height===x||(this._depthFBO.destroy(),this._depthFBO=void 0,this._depthTexture=void 0),!this._depthFBO){const T=c.gl,S=c.createFramebuffer(_,x,!0);c.activeTexture.set(T.TEXTURE0);const C=new s.Texture(c,{width:_,height:x,data:null},T.RGBA);C.bind(T.NEAREST,T.CLAMP_TO_EDGE),S.colorAttachment.set(C.texture);const z=c.createRenderbuffer(c.gl.DEPTH_COMPONENT16,_,x);S.depthAttachment.set(z),this._depthFBO=S,this._depthTexture=C}c.bindFramebuffer.set(this._depthFBO.framebuffer),c.viewport.set([0,0,_,x]),function(T,S,C,z){if(T.transform.projection.name==="globe")return;const P=T.context,O=P.gl;P.clear({depth:1});const j=T.useProgram("terrainDepth"),W=new s.DepthMode(O.LESS,s.DepthMode.ReadWrite,T.depthRangeFor3D);for(const H of z){const Z=C.getTile(H),X=_a(H.projMatrix,0);S.setupElevationDraw(Z,j),j.draw(P,O.TRIANGLES,W,s.StencilMode.disabled,s.ColorMode.unblended,s.CullFaceMode.backCCW,X,"terrain_depth",S.gridBuffer,S.gridIndexBuffer,S.gridNoSkirtSegments)}}(o,this,f,this.proxyCoords)}_setupProxiedCoordsForOrtho(o,c,f){if(o.getSource()instanceof Rt)return this._setupProxiedCoordsForImageSource(o,c,f);this._findCoveringTileCache[o.id]=this._findCoveringTileCache[o.id]||{};const _=this.proxiedCoords[o.id]=[],x=this.proxyCoords;for(let S=0;S(P.min.x=Math.min(P.min.x,O.x-S.x),P.min.y=Math.min(P.min.y,O.y-S.y),P.max.x=Math.max(P.max.x,O.x-S.x),P.max.y=Math.max(P.max.y,O.y-S.y),P),{min:new s.Point(Number.MAX_VALUE,Number.MAX_VALUE),max:new s.Point(-Number.MAX_VALUE,-Number.MAX_VALUE)}),z=(P,O)=>{const j=P.wrap+P.canonical.x/(1<Z+C.max.x||W+HX+C.max.y};for(let P=0;PT.key===c.tileID.key);if(x)return x}if(c.tileID.key!==o.key){const x=o.canonical.z-c.tileID.canonical.z;let T,S,C;_=s.create();const z=c.tileID.wrap-o.wrap<0?(T=s.EXTENT>>x,S=T*((c.tileID.canonical.x<=O){const j=o.canonical.z-O;c.getSource().reparseOverscaled?(S=Math.max(o.canonical.z+2,c.transform.tileZoom),T=new s.OverscaledTileID(S,o.wrap,O,o.canonical.x>>j,o.canonical.y>>j)):j!==0&&(S=O,T=new s.OverscaledTileID(S,o.wrap,O,o.canonical.x>>j,o.canonical.y>>j))}T.key!==o.key&&(z.push(T.key),f=c.getTile(T))}const P=O=>{z.forEach(j=>{_[j]=O}),z.length=0};for(S-=1;S>=C&&(!f||!f.hasData());S--){f&&P(f.tileID.key);const O=T.calculateScaledKey(S);if(f=c.getTileByID(O),f&&f.hasData())break;const j=_[O];if(j===null)break;j===void 0?z.push(O):f=c.getTileByID(j)}return P(f?f.tileID.key:null),f&&f.hasData()?f:null}findDEMTileFor(o){return this.enabled?this._findTileCoveringTileID(o,this.sourceCache):null}prepareDrawTile(){this.renderedToTile=!0}_clearRenderCacheForTile(o,c){let f=this._tilesDirty[o];f||(f=this._tilesDirty[o]={}),f[c.key]=!0}getWirefameBuffer(){if(!this.wireframeSegments){const o=function(c){let f=0;const _=new s.StructArrayLayout2ui4,x=131;for(let T=1;T<129;T++){for(let S=1;S<129;S++)f=T*x+S,_.emplaceBack(f,f+1),_.emplaceBack(f,f+x),_.emplaceBack(f+1,f+x),T===128&&_.emplaceBack(f+x,f+x+1);_.emplaceBack(f+1,f+1+x)}return _}();this.wireframeIndexBuffer=this.painter.context.createIndexBuffer(o),this.wireframeSegments=s.SegmentVector.simpleSegment(0,0,this.gridBuffer.length,o.length)}return[this.wireframeIndexBuffer,this.wireframeSegments]}}class Wt{static cacheKey(o,c,f,_){let x=`${c}${_?_.cacheKey:""}`;for(const T of f)o.usedDefines.includes(T)&&(x+=`/${T}`);return x}constructor(o,c,f,_,x,T){const S=o.gl;this.program=S.createProgram();const C=function(B){const q=[];for(let Q=0;Q`#define ${B}`));const j=o.isWebGL2?`#version 300 es +`:"",W=j+O.concat(o.extStandardDerivatives&&j.length===0?`#extension GL_OES_standard_derivatives : enable +`.concat(Rh):Rh,Rh,zc,ff.fragmentSource,ma.fragmentSource,f.fragmentSource).join(` +`),H=j+O.concat(` +#ifdef GL_ES +precision highp float; +#else + +#if !defined(lowp) +#define lowp +#endif + +#if !defined(mediump) +#define mediump +#endif + +#if !defined(highp) +#define highp +#endif + +#endif`,zc,ff.vertexSource,ma.vertexSource,Pc.vertexSource,f.vertexSource).join(` +`),Z=S.createShader(S.FRAGMENT_SHADER);if(S.isContextLost())return void(this.failedToCreate=!0);S.shaderSource(Z,W),S.compileShader(Z),S.attachShader(this.program,Z);const X=S.createShader(S.VERTEX_SHADER);if(S.isContextLost())this.failedToCreate=!0;else{S.shaderSource(X,H),S.compileShader(X),S.attachShader(this.program,X),this.attributes={},this.numAttributes=P.length;for(let B=0;B({u_dem:new s.Uniform1i(B),u_dem_prev:new s.Uniform1i(B),u_dem_unpack:new s.Uniform4f(B),u_dem_tl:new s.Uniform2f(B),u_dem_scale:new s.Uniform1f(B),u_dem_tl_prev:new s.Uniform2f(B),u_dem_scale_prev:new s.Uniform1f(B),u_dem_size:new s.Uniform1f(B),u_dem_lerp:new s.Uniform1f(B),u_exaggeration:new s.Uniform1f(B),u_depth:new s.Uniform1i(B),u_depth_size_inv:new s.Uniform2f(B),u_meter_to_dem:new s.Uniform1f(B),u_label_plane_matrix_inv:new s.UniformMatrix4f(B)}))(o)),T.includes("GLOBE")&&(this.globeUniforms=(B=>({u_tile_tl_up:new s.Uniform3f(B),u_tile_tr_up:new s.Uniform3f(B),u_tile_br_up:new s.Uniform3f(B),u_tile_bl_up:new s.Uniform3f(B),u_tile_up_scale:new s.Uniform1f(B)}))(o)),T.includes("FOG")&&(this.fogUniforms=(B=>({u_fog_matrix:new s.UniformMatrix4f(B),u_fog_range:new s.Uniform2f(B),u_fog_color:new s.Uniform4f(B),u_fog_horizon_blend:new s.Uniform1f(B),u_fog_temporal_offset:new s.Uniform1f(B),u_frustum_tl:new s.Uniform3f(B),u_frustum_tr:new s.Uniform3f(B),u_frustum_br:new s.Uniform3f(B),u_frustum_bl:new s.Uniform3f(B),u_globe_pos:new s.Uniform3f(B),u_globe_radius:new s.Uniform1f(B),u_globe_transition:new s.Uniform1f(B),u_is_globe:new s.Uniform1i(B),u_viewport:new s.Uniform2f(B)}))(o))}}setTerrainUniformValues(o,c){if(!this.terrainUniforms)return;const f=this.terrainUniforms;if(!this.failedToCreate){o.program.set(this.program);for(const _ in c)f[_]&&f[_].set(this.program,_,c[_])}}setGlobeUniformValues(o,c){if(!this.globeUniforms)return;const f=this.globeUniforms;if(!this.failedToCreate){o.program.set(this.program);for(const _ in c)f[_]&&f[_].set(this.program,_,c[_])}}setFogUniformValues(o,c){if(!this.fogUniforms)return;const f=this.fogUniforms;if(!this.failedToCreate){o.program.set(this.program);for(const _ in c)f[_].set(this.program,_,c[_])}}draw(o,c,f,_,x,T,S,C,z,P,O,j,W,H,Z){const X=o.gl;if(this.failedToCreate)return;o.program.set(this.program),o.setDepthMode(f),o.setStencilMode(_),o.setColorMode(x),o.setCullFace(T);for(const q of Object.keys(this.fixedUniforms))this.fixedUniforms[q].set(this.program,q,S[q]);H&&H.setUniforms(this.program,o,this.binderUniforms,j,{zoom:W});const B={[X.LINES]:2,[X.TRIANGLES]:3,[X.LINE_STRIP]:1}[c];for(const q of O.get()){const Q=q.vaos||(q.vaos={});(Q[C]||(Q[C]=new W_)).bind(o,this,z,H?H.getPaintVertexBuffers():[],P,q.vertexOffset,Z||[]),X.drawElements(c,q.primitiveLength*B,X.UNSIGNED_SHORT,q.primitiveOffset*B*2)}}}function Ml(d,o){const c=Math.pow(2,o.tileID.overscaledZ),f=o.tileSize*Math.pow(2,d.transform.tileZoom)/c,_=f*(o.tileID.canonical.x+o.tileID.wrap*c),x=f*o.tileID.canonical.y;return{u_image:0,u_texsize:o.imageAtlasTexture.size,u_tile_units_to_pixels:1/Bt(o,1,d.transform.tileZoom),u_pixel_coord_upper:[_>>16,x>>16],u_pixel_coord_lower:[65535&_,65535&x]}}const yf=s.create(),Vh=(d,o,c,f,_,x,T,S,C,z,P)=>{const O=o.style.light,j=O.properties.get("position"),W=[j.x,j.y,j.z],H=s.create$1();O.properties.get("anchor")==="viewport"&&(s.fromRotation(H,-o.transform.angle),s.transformMat3(W,W,H));const Z=O.properties.get("color"),X=o.transform,B={u_matrix:d,u_lightpos:W,u_lightintensity:O.properties.get("intensity"),u_lightcolor:[Z.r,Z.g,Z.b],u_vertical_gradient:+c,u_opacity:f,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:yf,u_merc_center:[0,0],u_up_dir:[0,0,0],u_height_lift:0,u_ao:_,u_edge_radius:x};return X.projection.name==="globe"&&(B.u_tile_id=[T.canonical.x,T.canonical.y,1<{const j=Vh(d,o,c,f,_,x,T,C,z,P,O),W={u_height_factor:-Math.pow(2,T.overscaledZ)/S.tileSize/8};return s.extend(j,Ml(o,S),W)},Ls=d=>({u_matrix:d}),$h=(d,o,c)=>s.extend(Ls(d),Ml(o,c)),Z_=(d,o)=>({u_matrix:d,u_world:o}),H_=(d,o,c,f)=>s.extend($h(d,o,c),{u_world:f}),X_=s.create(),Gh=(d,o,c,f,_,x)=>{const T=d.transform,S=T.projection.name==="globe";let C;if(x.paint.get("circle-pitch-alignment")==="map")if(S){const P=s.globePixelsToTileUnits(T.zoom,o.canonical)*T._pixelsPerMercatorPixel;C=Float32Array.from([P,0,0,P])}else C=T.calculatePixelsToTileUnitsMatrix(c);else C=new Float32Array([T.pixelsToGLUnits[0],0,0,T.pixelsToGLUnits[1]]);const z={u_camera_to_center_distance:T.cameraToCenterDistance,u_matrix:d.translatePosMatrix(o.projMatrix,c,x.paint.get("circle-translate"),x.paint.get("circle-translate-anchor")),u_device_pixel_ratio:s.exported.devicePixelRatio,u_extrude_scale:C,u_inv_rot_matrix:X_,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(S){z.u_inv_rot_matrix=f,z.u_merc_center=_,z.u_tile_id=[o.canonical.x,o.canonical.y,1<{const o=[];return d.paint.get("circle-pitch-alignment")==="map"&&o.push("PITCH_WITH_MAP"),d.paint.get("circle-pitch-scale")==="map"&&o.push("SCALE_WITH_MAP"),o},Wh=(d,o,c,f)=>{const _=s.EXTENT/c.tileSize;return{u_matrix:d,u_camera_to_center_distance:o.getCameraToCenterDistance(f),u_extrude_scale:[o.pixelsToGLUnits[0]/_,o.pixelsToGLUnits[1]/_]}},Bc=(d,o,c=1)=>({u_matrix:d,u_color:o,u_overlay:0,u_overlay_scale:c}),xf=s.create(),wf=(d,o,c,f,_,x,T)=>{const S=d.transform,C=S.projection.name==="globe",z=C?s.globePixelsToTileUnits(S.zoom,o.canonical)*S._pixelsPerMercatorPixel:Bt(c,1,x),P={u_matrix:o.projMatrix,u_extrude_scale:z,u_intensity:T,u_inv_rot_matrix:xf,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(C){P.u_inv_rot_matrix=f,P.u_merc_center=_,P.u_tile_id=[o.canonical.x,o.canonical.y,1<{const S=d.transform,C=S.calculatePixelsToTileUnitsMatrix(o);return{u_matrix:Zh(d,o,c,f),u_pixels_to_tile_units:C,u_device_pixel_ratio:x,u_units_to_pixels:[1/S.pixelsToGLUnits[0],1/S.pixelsToGLUnits[1]],u_dash_image:0,u_gradient_image:1,u_image_height:_,u_texsize:zl(c)?o.lineAtlasTexture.size:[0,0],u_tile_units_to_pixels:va(o,d.transform),u_alpha_discard_threshold:0,u_trim_offset:T}},Pl=(d,o,c,f,_)=>{const x=d.transform;return{u_matrix:Zh(d,o,c,f),u_texsize:o.imageAtlasTexture.size,u_pixels_to_tile_units:x.calculatePixelsToTileUnitsMatrix(o),u_device_pixel_ratio:_,u_image:0,u_tile_units_to_pixels:va(o,x),u_units_to_pixels:[1/x.pixelsToGLUnits[0],1/x.pixelsToGLUnits[1]],u_alpha_discard_threshold:0}};function va(d,o){return 1/Bt(d,1,o.tileZoom)}function Zh(d,o,c,f){return d.translatePosMatrix(f||o.tileID.projMatrix,o,c.paint.get("line-translate"),c.paint.get("line-translate-anchor"))}function zl(d){const o=d.paint.get("line-dasharray").value;return o.value||o.kind!=="constant"}const Hh=(d,o,c,f,_,x)=>{return{u_matrix:d,u_tl_parent:o,u_scale_parent:c,u_fade_t:f.mix,u_opacity:f.opacity*_.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:_.paint.get("raster-brightness-min"),u_brightness_high:_.paint.get("raster-brightness-max"),u_saturation_factor:(S=_.paint.get("raster-saturation"),S>0?1-1/(1.001-S):-S),u_contrast_factor:(T=_.paint.get("raster-contrast"),T>0?1/(1-T):1+T),u_spin_weights:no(_.paint.get("raster-hue-rotate")),u_perspective_transform:x};var T,S};function no(d){d*=Math.PI/180;const o=Math.sin(d),c=Math.cos(d);return[(2*c+1)/3,(-Math.sqrt(3)*o-c+1)/3,(Math.sqrt(3)*o-c+1)/3]}const Fc=s.create(),Xh=(d,o,c,f,_,x,T,S,C,z,P,O,j,W,H,Z)=>{const X=_.transform,B={u_is_size_zoom_constant:+(d==="constant"||d==="source"),u_is_size_feature_constant:+(d==="constant"||d==="camera"),u_size_t:o?o.uSizeT:0,u_size:o?o.uSize:0,u_camera_to_center_distance:X.cameraToCenterDistance,u_rotate_symbol:+c,u_aspect_ratio:X.width/X.height,u_fade_change:_.options.fadeDuration?_.symbolFadeChange:1,u_matrix:x,u_label_plane_matrix:T,u_coord_matrix:S,u_is_text:+C,u_pitch_with_map:+f,u_texsize:z,u_texture:0,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:Fc,u_merc_center:[0,0],u_camera_forward:[0,0,0],u_ecef_origin:[0,0,0],u_tile_matrix:Fc,u_up_vector:[0,-1,0]};return Z.name==="globe"&&(B.u_tile_id=[P.canonical.x,P.canonical.y,1<s.extend(Xh(d,o,c,f,_,x,T,S,C,z,O,j,W,H,Z,X),{u_gamma_scale:f?_.transform.cameraToCenterDistance*Math.cos(_.terrain?0:_.transform._pitch):1,u_device_pixel_ratio:s.exported.devicePixelRatio,u_is_halo:+P}),bf=(d,o,c,f,_,x,T,S,C,z,P,O,j,W,H,Z)=>s.extend(Nc(d,o,c,f,_,x,T,S,!0,C,!0,P,O,j,W,H,Z),{u_texsize_icon:z,u_texture_icon:1}),Kh=(d,o,c)=>({u_matrix:d,u_opacity:o,u_color:c}),Y_=(d,o,c,f,_)=>s.extend(function(x,T,S){const C=T.imageManager.getPattern(x.toString()),{width:z,height:P}=T.imageManager.getPixelSize(),O=Math.pow(2,S.tileID.overscaledZ),j=S.tileSize*Math.pow(2,T.transform.tileZoom)/O,W=j*(S.tileID.canonical.x+S.tileID.wrap*O),H=j*S.tileID.canonical.y;return{u_image:0,u_pattern_tl:C.tl,u_pattern_br:C.br,u_texsize:[z,P],u_pattern_size:C.displaySize,u_tile_units_to_pixels:1/Bt(S,1,T.transform.tileZoom),u_pixel_coord_upper:[W>>16,H>>16],u_pixel_coord_lower:[65535&W,65535&H]}}(f,c,_),{u_matrix:d,u_opacity:o}),Yh={fillExtrusion:d=>({u_matrix:new s.UniformMatrix4f(d),u_lightpos:new s.Uniform3f(d),u_lightintensity:new s.Uniform1f(d),u_lightcolor:new s.Uniform3f(d),u_vertical_gradient:new s.Uniform1f(d),u_opacity:new s.Uniform1f(d),u_edge_radius:new s.Uniform1f(d),u_ao:new s.Uniform2f(d),u_tile_id:new s.Uniform3f(d),u_zoom_transition:new s.Uniform1f(d),u_inv_rot_matrix:new s.UniformMatrix4f(d),u_merc_center:new s.Uniform2f(d),u_up_dir:new s.Uniform3f(d),u_height_lift:new s.Uniform1f(d)}),fillExtrusionPattern:d=>({u_matrix:new s.UniformMatrix4f(d),u_lightpos:new s.Uniform3f(d),u_lightintensity:new s.Uniform1f(d),u_lightcolor:new s.Uniform3f(d),u_vertical_gradient:new s.Uniform1f(d),u_height_factor:new s.Uniform1f(d),u_edge_radius:new s.Uniform1f(d),u_ao:new s.Uniform2f(d),u_tile_id:new s.Uniform3f(d),u_zoom_transition:new s.Uniform1f(d),u_inv_rot_matrix:new s.UniformMatrix4f(d),u_merc_center:new s.Uniform2f(d),u_up_dir:new s.Uniform3f(d),u_height_lift:new s.Uniform1f(d),u_image:new s.Uniform1i(d),u_texsize:new s.Uniform2f(d),u_pixel_coord_upper:new s.Uniform2f(d),u_pixel_coord_lower:new s.Uniform2f(d),u_tile_units_to_pixels:new s.Uniform1f(d),u_opacity:new s.Uniform1f(d)}),fill:d=>({u_matrix:new s.UniformMatrix4f(d)}),fillPattern:d=>({u_matrix:new s.UniformMatrix4f(d),u_image:new s.Uniform1i(d),u_texsize:new s.Uniform2f(d),u_pixel_coord_upper:new s.Uniform2f(d),u_pixel_coord_lower:new s.Uniform2f(d),u_tile_units_to_pixels:new s.Uniform1f(d)}),fillOutline:d=>({u_matrix:new s.UniformMatrix4f(d),u_world:new s.Uniform2f(d)}),fillOutlinePattern:d=>({u_matrix:new s.UniformMatrix4f(d),u_world:new s.Uniform2f(d),u_image:new s.Uniform1i(d),u_texsize:new s.Uniform2f(d),u_pixel_coord_upper:new s.Uniform2f(d),u_pixel_coord_lower:new s.Uniform2f(d),u_tile_units_to_pixels:new s.Uniform1f(d)}),circle:d=>({u_camera_to_center_distance:new s.Uniform1f(d),u_extrude_scale:new s.UniformMatrix2f(d),u_device_pixel_ratio:new s.Uniform1f(d),u_matrix:new s.UniformMatrix4f(d),u_inv_rot_matrix:new s.UniformMatrix4f(d),u_merc_center:new s.Uniform2f(d),u_tile_id:new s.Uniform3f(d),u_zoom_transition:new s.Uniform1f(d),u_up_dir:new s.Uniform3f(d)}),collisionBox:d=>({u_matrix:new s.UniformMatrix4f(d),u_camera_to_center_distance:new s.Uniform1f(d),u_extrude_scale:new s.Uniform2f(d)}),collisionCircle:d=>({u_matrix:new s.UniformMatrix4f(d),u_inv_matrix:new s.UniformMatrix4f(d),u_camera_to_center_distance:new s.Uniform1f(d),u_viewport_size:new s.Uniform2f(d)}),debug:d=>({u_color:new s.UniformColor(d),u_matrix:new s.UniformMatrix4f(d),u_overlay:new s.Uniform1i(d),u_overlay_scale:new s.Uniform1f(d)}),clippingMask:d=>({u_matrix:new s.UniformMatrix4f(d)}),heatmap:d=>({u_extrude_scale:new s.Uniform1f(d),u_intensity:new s.Uniform1f(d),u_matrix:new s.UniformMatrix4f(d),u_inv_rot_matrix:new s.UniformMatrix4f(d),u_merc_center:new s.Uniform2f(d),u_tile_id:new s.Uniform3f(d),u_zoom_transition:new s.Uniform1f(d),u_up_dir:new s.Uniform3f(d)}),heatmapTexture:d=>({u_image:new s.Uniform1i(d),u_color_ramp:new s.Uniform1i(d),u_opacity:new s.Uniform1f(d)}),hillshade:d=>({u_matrix:new s.UniformMatrix4f(d),u_image:new s.Uniform1i(d),u_latrange:new s.Uniform2f(d),u_light:new s.Uniform2f(d),u_shadow:new s.UniformColor(d),u_highlight:new s.UniformColor(d),u_accent:new s.UniformColor(d)}),hillshadePrepare:d=>({u_matrix:new s.UniformMatrix4f(d),u_image:new s.Uniform1i(d),u_dimension:new s.Uniform2f(d),u_zoom:new s.Uniform1f(d),u_unpack:new s.Uniform4f(d)}),line:d=>({u_matrix:new s.UniformMatrix4f(d),u_pixels_to_tile_units:new s.UniformMatrix2f(d),u_device_pixel_ratio:new s.Uniform1f(d),u_units_to_pixels:new s.Uniform2f(d),u_dash_image:new s.Uniform1i(d),u_gradient_image:new s.Uniform1i(d),u_image_height:new s.Uniform1f(d),u_texsize:new s.Uniform2f(d),u_tile_units_to_pixels:new s.Uniform1f(d),u_alpha_discard_threshold:new s.Uniform1f(d),u_trim_offset:new s.Uniform2f(d)}),linePattern:d=>({u_matrix:new s.UniformMatrix4f(d),u_texsize:new s.Uniform2f(d),u_pixels_to_tile_units:new s.UniformMatrix2f(d),u_device_pixel_ratio:new s.Uniform1f(d),u_image:new s.Uniform1i(d),u_units_to_pixels:new s.Uniform2f(d),u_tile_units_to_pixels:new s.Uniform1f(d),u_alpha_discard_threshold:new s.Uniform1f(d)}),raster:d=>({u_matrix:new s.UniformMatrix4f(d),u_tl_parent:new s.Uniform2f(d),u_scale_parent:new s.Uniform1f(d),u_fade_t:new s.Uniform1f(d),u_opacity:new s.Uniform1f(d),u_image0:new s.Uniform1i(d),u_image1:new s.Uniform1i(d),u_brightness_low:new s.Uniform1f(d),u_brightness_high:new s.Uniform1f(d),u_saturation_factor:new s.Uniform1f(d),u_contrast_factor:new s.Uniform1f(d),u_spin_weights:new s.Uniform3f(d),u_perspective_transform:new s.Uniform2f(d)}),symbolIcon:d=>({u_is_size_zoom_constant:new s.Uniform1i(d),u_is_size_feature_constant:new s.Uniform1i(d),u_size_t:new s.Uniform1f(d),u_size:new s.Uniform1f(d),u_camera_to_center_distance:new s.Uniform1f(d),u_rotate_symbol:new s.Uniform1i(d),u_aspect_ratio:new s.Uniform1f(d),u_fade_change:new s.Uniform1f(d),u_matrix:new s.UniformMatrix4f(d),u_label_plane_matrix:new s.UniformMatrix4f(d),u_coord_matrix:new s.UniformMatrix4f(d),u_is_text:new s.Uniform1i(d),u_pitch_with_map:new s.Uniform1i(d),u_texsize:new s.Uniform2f(d),u_tile_id:new s.Uniform3f(d),u_zoom_transition:new s.Uniform1f(d),u_inv_rot_matrix:new s.UniformMatrix4f(d),u_merc_center:new s.Uniform2f(d),u_camera_forward:new s.Uniform3f(d),u_tile_matrix:new s.UniformMatrix4f(d),u_up_vector:new s.Uniform3f(d),u_ecef_origin:new s.Uniform3f(d),u_texture:new s.Uniform1i(d)}),symbolSDF:d=>({u_is_size_zoom_constant:new s.Uniform1i(d),u_is_size_feature_constant:new s.Uniform1i(d),u_size_t:new s.Uniform1f(d),u_size:new s.Uniform1f(d),u_camera_to_center_distance:new s.Uniform1f(d),u_rotate_symbol:new s.Uniform1i(d),u_aspect_ratio:new s.Uniform1f(d),u_fade_change:new s.Uniform1f(d),u_matrix:new s.UniformMatrix4f(d),u_label_plane_matrix:new s.UniformMatrix4f(d),u_coord_matrix:new s.UniformMatrix4f(d),u_is_text:new s.Uniform1i(d),u_pitch_with_map:new s.Uniform1i(d),u_texsize:new s.Uniform2f(d),u_texture:new s.Uniform1i(d),u_gamma_scale:new s.Uniform1f(d),u_device_pixel_ratio:new s.Uniform1f(d),u_tile_id:new s.Uniform3f(d),u_zoom_transition:new s.Uniform1f(d),u_inv_rot_matrix:new s.UniformMatrix4f(d),u_merc_center:new s.Uniform2f(d),u_camera_forward:new s.Uniform3f(d),u_tile_matrix:new s.UniformMatrix4f(d),u_up_vector:new s.Uniform3f(d),u_ecef_origin:new s.Uniform3f(d),u_is_halo:new s.Uniform1i(d)}),symbolTextAndIcon:d=>({u_is_size_zoom_constant:new s.Uniform1i(d),u_is_size_feature_constant:new s.Uniform1i(d),u_size_t:new s.Uniform1f(d),u_size:new s.Uniform1f(d),u_camera_to_center_distance:new s.Uniform1f(d),u_rotate_symbol:new s.Uniform1i(d),u_aspect_ratio:new s.Uniform1f(d),u_fade_change:new s.Uniform1f(d),u_matrix:new s.UniformMatrix4f(d),u_label_plane_matrix:new s.UniformMatrix4f(d),u_coord_matrix:new s.UniformMatrix4f(d),u_is_text:new s.Uniform1i(d),u_pitch_with_map:new s.Uniform1i(d),u_texsize:new s.Uniform2f(d),u_texsize_icon:new s.Uniform2f(d),u_texture:new s.Uniform1i(d),u_texture_icon:new s.Uniform1i(d),u_gamma_scale:new s.Uniform1f(d),u_device_pixel_ratio:new s.Uniform1f(d),u_is_halo:new s.Uniform1i(d)}),background:d=>({u_matrix:new s.UniformMatrix4f(d),u_opacity:new s.Uniform1f(d),u_color:new s.UniformColor(d)}),backgroundPattern:d=>({u_matrix:new s.UniformMatrix4f(d),u_opacity:new s.Uniform1f(d),u_image:new s.Uniform1i(d),u_pattern_tl:new s.Uniform2f(d),u_pattern_br:new s.Uniform2f(d),u_texsize:new s.Uniform2f(d),u_pattern_size:new s.Uniform2f(d),u_pixel_coord_upper:new s.Uniform2f(d),u_pixel_coord_lower:new s.Uniform2f(d),u_tile_units_to_pixels:new s.Uniform1f(d)}),terrainRaster:Fh,terrainDepth:Fh,skybox:d=>({u_matrix:new s.UniformMatrix4f(d),u_sun_direction:new s.Uniform3f(d),u_cubemap:new s.Uniform1i(d),u_opacity:new s.Uniform1f(d),u_temporal_offset:new s.Uniform1f(d)}),skyboxGradient:d=>({u_matrix:new s.UniformMatrix4f(d),u_color_ramp:new s.Uniform1i(d),u_center_direction:new s.Uniform3f(d),u_radius:new s.Uniform1f(d),u_opacity:new s.Uniform1f(d),u_temporal_offset:new s.Uniform1f(d)}),skyboxCapture:d=>({u_matrix_3f:new s.UniformMatrix3f(d),u_sun_direction:new s.Uniform3f(d),u_sun_intensity:new s.Uniform1f(d),u_color_tint_r:new s.Uniform4f(d),u_color_tint_m:new s.Uniform4f(d),u_luminance:new s.Uniform1f(d)}),globeRaster:d=>({u_proj_matrix:new s.UniformMatrix4f(d),u_globe_matrix:new s.UniformMatrix4f(d),u_normalize_matrix:new s.UniformMatrix4f(d),u_merc_matrix:new s.UniformMatrix4f(d),u_zoom_transition:new s.Uniform1f(d),u_merc_center:new s.Uniform2f(d),u_image0:new s.Uniform1i(d),u_grid_matrix:new s.UniformMatrix3f(d),u_skirt_height:new s.Uniform1f(d),u_frustum_tl:new s.Uniform3f(d),u_frustum_tr:new s.Uniform3f(d),u_frustum_br:new s.Uniform3f(d),u_frustum_bl:new s.Uniform3f(d),u_globe_pos:new s.Uniform3f(d),u_globe_radius:new s.Uniform1f(d),u_viewport:new s.Uniform2f(d)}),globeAtmosphere:d=>({u_frustum_tl:new s.Uniform3f(d),u_frustum_tr:new s.Uniform3f(d),u_frustum_br:new s.Uniform3f(d),u_frustum_bl:new s.Uniform3f(d),u_horizon:new s.Uniform1f(d),u_transition:new s.Uniform1f(d),u_fadeout_range:new s.Uniform1f(d),u_color:new s.Uniform4f(d),u_high_color:new s.Uniform4f(d),u_space_color:new s.Uniform4f(d),u_star_intensity:new s.Uniform1f(d),u_star_density:new s.Uniform1f(d),u_star_size:new s.Uniform1f(d),u_temporal_offset:new s.Uniform1f(d),u_horizon_angle:new s.Uniform1f(d),u_rotation_matrix:new s.UniformMatrix4f(d)})};let Uc;function Ll(d,o,c,f,_,x,T){const S=d.context,C=S.gl,z=d.transform,P=d.useProgram("collisionBox"),O=[];let j=0,W=0;for(let ee=0;ee0){const Ee=s.create(),Fe=ye;s.mul(Ee,pe.placementInvProjMatrix,z.glCoordMatrix),s.mul(Ee,Ee,pe.placementViewportMatrix),O.push({circleArray:We,circleOffset:W,transform:Fe,invTransform:Ee,projection:pe.getProjection()}),j+=We.length/4,W=j}Ae&&(d.terrain&&d.terrain.setupElevationDraw(fe,P),P.draw(S,C.LINES,s.DepthMode.disabled,s.StencilMode.disabled,d.colorModeForRenderPass(),s.CullFaceMode.disabled,Wh(ye,z,fe,pe.getProjection()),c.id,Ae.layoutVertexBuffer,Ae.indexBuffer,Ae.segments,null,z.zoom,null,[Ae.collisionVertexBuffer,Ae.collisionVertexBufferExt]))}if(!T||!O.length)return;const H=d.useProgram("collisionCircle"),Z=new s.StructArrayLayout2f1f2i16;Z.resize(4*j),Z._trim();let X=0;for(const ee of O)for(let de=0;de=0&&(H[ee.associatedIconIndex]={x:Ee,y:Fe,z:ke,angle:$e})}else Ri(pe,j)}if(P){W.clear();const Q=d.icon.placedSymbolArray;for(let ee=0;eeEe.sortKey-Fe.sortKey);for(const Ee of ye){const Fe=Ee.state;if(d.terrain&&d.terrain.setupElevationDraw(Fe.tile,Fe.program,{useDepthForOcclusion:!xe,labelPlaneMatrixInv:Fe.labelPlaneMatrixInv}),j.activeTexture.set(W.TEXTURE0),Fe.atlasTexture.bind(Fe.atlasInterpolation,W.CLAMP_TO_EDGE),Fe.atlasTextureIcon&&(j.activeTexture.set(W.TEXTURE1),Fe.atlasTextureIcon&&Fe.atlasTextureIcon.bind(Fe.atlasInterpolationIcon,W.CLAMP_TO_EDGE)),Fe.isSDF){const ke=Fe.uniformValues;Fe.hasHalo&&(ke.u_is_halo=1,Rl(Fe.buffers,Ee.segments,c,d,Fe.program,de,P,O,ke)),ke.u_is_halo=0}Rl(Fe.buffers,Ee.segments,c,d,Fe.program,de,P,O,Fe.uniformValues)}}function Rl(d,o,c,f,_,x,T,S,C){const z=f.context,P=[d.dynamicLayoutVertexBuffer,d.opacityVertexBuffer,d.globeExtVertexBuffer];_.draw(z,z.gl.TRIANGLES,x,T,S,s.CullFaceMode.disabled,C,c.id,d.layoutVertexBuffer,d.indexBuffer,o,c.paint,f.transform.zoom,d.programConfigurations.get(c.id),P)}function Sf(d,o,c,f,_,x,T){const S=d.context.gl,C=c.paint.get("fill-pattern"),z=C&&C.constantOr(1);let P,O,j,W,H;T?(O=z&&!c.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",P=S.LINES):(O=z?"fillPattern":"fill",P=S.TRIANGLES);for(const Z of f){const X=o.getTile(Z);if(z&&!X.patternsLoaded())continue;const B=X.getBucket(c);if(!B)continue;d.prepareDrawTile();const q=B.programConfigurations.get(c.id),Q=d.useProgram(O,q);z&&(d.context.activeTexture.set(S.TEXTURE0),X.imageAtlasTexture.bind(S.LINEAR,S.CLAMP_TO_EDGE),q.updatePaintBuffers());const ee=C.constantOr(null);if(ee&&X.imageAtlas){const fe=X.imageAtlas.patternPositions[ee.toString()];fe&&q.setConstantPatternPositions(fe)}const de=d.translatePosMatrix(Z.projMatrix,X,c.paint.get("fill-translate"),c.paint.get("fill-translate-anchor"));if(T){W=B.indexBuffer2,H=B.segments2;const fe=d.terrain&&d.terrain.renderingToTexture?d.terrain.drapeBufferSize:[S.drawingBufferWidth,S.drawingBufferHeight];j=O==="fillOutlinePattern"&&z?H_(de,d,X,fe):Z_(de,fe)}else W=B.indexBuffer,H=B.segments,j=z?$h(de,d,X):Ls(de);d.prepareDrawProgram(d.context,Q,Z.toUnwrapped()),Q.draw(d.context,P,_,d.stencilModeForClipping(Z),x,s.CullFaceMode.disabled,j,c.id,B.layoutVertexBuffer,W,H,c.paint,d.transform.zoom,q)}}function jc(d,o,c,f,_,x,T){const S=d.context,C=S.gl,z=d.transform,P=c.paint.get("fill-extrusion-pattern"),O=P.constantOr(1),j=c.paint.get("fill-extrusion-opacity"),W=[c.paint.get("fill-extrusion-ambient-occlusion-intensity"),c.paint.get("fill-extrusion-ambient-occlusion-radius")],H=c.layout.get("fill-extrusion-edge-radius"),Z=H>0&&!c.paint.get("fill-extrusion-rounded-roof"),X=Z?0:H,B=z.projection.name==="globe"?s.fillExtrusionHeightLift():0,q=z.projection.name==="globe",Q=q?s.globeToMercatorTransition(z.zoom):0,ee=[s.mercatorXfromLng(z.center.lng),s.mercatorYfromLat(z.center.lat)],de=[];q&&de.push("PROJECTION_GLOBE_VIEW"),W[0]>0&&de.push("FAUX_AO"),Z&&de.push("ZERO_ROOF_RADIUS");for(const fe of f){const pe=o.getTile(fe),xe=pe.getBucket(c);if(!xe||xe.projection.name!==z.projection.name)continue;const ye=xe.programConfigurations.get(c.id),Ae=d.useProgram(O?"fillExtrusionPattern":"fillExtrusion",ye,de);if(d.terrain){const Be=d.terrain;if(d.style.terrainSetForDrapingOnly())Be.setupElevationDraw(pe,Ae,{useMeterToDem:!0});else{if(!xe.enableTerrain)continue;if(Be.setupElevationDraw(pe,Ae,{useMeterToDem:!0}),Af(S,o,fe,xe,c,Be),!xe.centroidVertexBuffer){const Xe=Ae.attributes.a_centroid_pos;Xe!==void 0&&C.vertexAttrib2f(Xe,0,0)}}}O&&(d.context.activeTexture.set(C.TEXTURE0),pe.imageAtlasTexture.bind(C.LINEAR,C.CLAMP_TO_EDGE),ye.updatePaintBuffers());const We=P.constantOr(null);if(We&&pe.imageAtlas){const Be=pe.imageAtlas.patternPositions[We.toString()];Be&&ye.setConstantPatternPositions(Be)}const Ee=d.translatePosMatrix(fe.projMatrix,pe,c.paint.get("fill-extrusion-translate"),c.paint.get("fill-extrusion-translate-anchor")),Fe=z.projection.createInversionMatrix(z,fe.canonical),ke=c.paint.get("fill-extrusion-vertical-gradient"),qe=O?vf(Ee,d,ke,j,W,X,fe,pe,B,Q,ee,Fe):Vh(Ee,d,ke,j,W,X,fe,B,Q,ee,Fe);d.prepareDrawProgram(S,Ae,fe.toUnwrapped());const Se=[];d.terrain&&Se.push(xe.centroidVertexBuffer),q&&Se.push(xe.layoutVertexExtBuffer),Ae.draw(S,S.gl.TRIANGLES,_,x,T,s.CullFaceMode.backCCW,qe,c.id,xe.layoutVertexBuffer,xe.indexBuffer,xe.segments,c.paint,d.transform.zoom,ye,Se)}}function Af(d,o,c,f,_,x){const T=[B=>{let q=B.canonical.x-1,Q=B.wrap;return q<0&&(q=(1<{let q=B.canonical.x+1,Q=B.wrap;return q===1<new s.OverscaledTileID(B.overscaledZ,B.wrap,B.canonical.z,B.canonical.x,(B.canonical.y===0?1<new s.OverscaledTileID(B.overscaledZ,B.wrap,B.canonical.z,B.canonical.x,B.canonical.y===(1<{const q=o.getSource().minzoom,Q=de=>{const fe=o.getTileByID(de);if(fe&&fe.hasData())return fe.getBucket(_)},ee=[0,-1,1];for(const de of ee){if(B.overscaledZ+de(C[0]=Math.min(B.min.y,q.min.y),C[1]=Math.max(B.max.y,q.max.y),C[2]=s.EXTENT-q.min.x>B.max.x?q.min.x-s.EXTENT:B.max.x,C),P=(B,q)=>(C[0]=Math.min(B.min.x,q.min.x),C[1]=Math.max(B.max.x,q.max.x),C[2]=s.EXTENT-q.min.y>B.max.y?q.min.y-s.EXTENT:B.max.y,C),O=[(B,q)=>z(B,q),(B,q)=>z(q,B),(B,q)=>P(B,q),(B,q)=>P(q,B)],j=new s.Point(0,0);let W,H,Z;const X=(B,q,Q,ee,de)=>{const fe=[[ee?Q:B,ee?B:Q,0],[ee?Q:q,ee?q:Q,0]],pe=de<0?s.EXTENT+de:de,xe=[ee?pe:(B+q)/2,ee?(B+q)/2:pe,0];return Q===0&&de<0||Q!==0&&de>0?x.getForTilePoints(Z,[xe],!0,H):fe.push(xe),x.getForTilePoints(c,fe,!0,W),Math.max(fe[0][2],fe[1][2],xe[2])/x.exaggeration()};for(let B=0;B<4;B++){const q=(B<2?1:5)-B,Q=f.borders[B];if(Q.length===0)continue;const ee=Z=T[B](c),de=S(ee);if(!(de&&de instanceof s.FillExtrusionBucket&&de.enableTerrain)||f.borderDoneWithNeighborZ[B]===de.canonical.z&&de.borderDoneWithNeighborZ[q]===f.canonical.z||(H=x.findDEMTileFor(ee),!H||!H.dem))continue;if(!W){const ye=x.findDEMTileFor(c);if(!ye||!ye.dem)return;W=ye}const fe=de.borders[q];let pe=0;const xe=de.borderDoneWithNeighborZ[q]!==f.canonical.z;if(f.canonical.z===de.canonical.z){for(let ye=0;yeWe[0]+3));)xe&&de.encodeCentroid(void 0,Ee,!1),pe++;if(Ee&&peWe[1]-3)&&(ke++,++pe!==fe.length);)Ee=de.featuresOnBorder[fe[pe]];if(Ee=de.featuresOnBorder[fe[Fe]],Ae.intersectsCount()>1||Ee.intersectsCount()>1||ke!==1){ke!==1&&(pe=Fe),f.encodeCentroid(void 0,Ae,!1),xe&&de.encodeCentroid(void 0,Ee,!1);continue}const qe=O[B](Ae,Ee),Se=B%2?s.EXTENT-1:0;j.x=X(qe[0],Math.min(s.EXTENT-1,qe[1]),Se,B<2,qe[2]),j.y=0,f.encodeCentroid(j,Ae,!1),xe&&de.encodeCentroid(j,Ee,!1)}else f.encodeCentroid(void 0,Ae,!1)}f.borderDoneWithNeighborZ[B]=de.canonical.z,f.needsCentroidUpdate=!0,xe&&(de.borderDoneWithNeighborZ[q]=f.canonical.z,de.needsCentroidUpdate=!0)}else{for(const ye of Q)f.encodeCentroid(void 0,f.featuresOnBorder[ye],!1);if(xe){for(const ye of fe)de.encodeCentroid(void 0,de.featuresOnBorder[ye],!1);de.borderDoneWithNeighborZ[q]=f.canonical.z,de.needsCentroidUpdate=!0}f.borderDoneWithNeighborZ[B]=de.canonical.z,f.needsCentroidUpdate=!0}}(f.needsCentroidUpdate||!f.centroidVertexBuffer&&f.centroidVertexArray.length!==0)&&f.uploadCentroid(d)}const xa=new s.Color(1,0,0,1),Q_=new s.Color(0,1,0,1),ey=new s.Color(0,0,1,1),ty=new s.Color(1,0,1,1),ny=new s.Color(0,1,1,1);function ry(d,o,c){const f=d.context,_=d.transform,x=f.gl,T=_.projection.name==="globe",S=T?["PROJECTION_GLOBE_VIEW"]:null;let C=c.projMatrix;if(T&&s.globeToMercatorTransition(_.zoom)>0){const Ae=s.transitionTileAABBinECEF(c.canonical,_),We=s.globeDenormalizeECEF(Ae);C=s.multiply(new Float32Array(16),_.globeMatrix,We),s.multiply(C,_.projMatrix,C)}const z=d.useProgram("debug",null,S),P=o.getTileByID(c.key);d.terrain&&d.terrain.setupElevationDraw(P,z);const O=s.DepthMode.disabled,j=s.StencilMode.disabled,W=d.colorModeForRenderPass(),H="$debug";f.activeTexture.set(x.TEXTURE0),d.emptyTexture.bind(x.LINEAR,x.CLAMP_TO_EDGE),T?P._makeGlobeTileDebugBuffers(d.context,_):P._makeDebugTileBoundsBuffers(d.context,_.projection);const Z=P._tileDebugBuffer||d.debugBuffer,X=P._tileDebugIndexBuffer||d.debugIndexBuffer,B=P._tileDebugSegments||d.debugSegments;z.draw(f,x.LINE_STRIP,O,j,W,s.CullFaceMode.disabled,Bc(C,s.Color.red),H,Z,X,B,null,null,null,[P._globeTileDebugBorderBuffer]);const q=P.latestRawTileData,Q=Math.floor((q&&q.byteLength||0)/1024),ee=o.getTile(c).tileSize,de=512/Math.min(ee,512)*(c.overscaledZ/_.zoom)*.5;let fe=c.canonical.toString();c.overscaledZ!==c.canonical.z&&(fe+=` => ${c.overscaledZ}`),fe+=` ${Q}kb`,function(Ae,We){Ae.initDebugOverlayCanvas();const Ee=Ae.debugOverlayCanvas,Fe=Ae.context.gl,ke=Ae.debugOverlayCanvas.getContext("2d");ke.clearRect(0,0,Ee.width,Ee.height),ke.shadowColor="white",ke.shadowBlur=2,ke.lineWidth=1.5,ke.strokeStyle="white",ke.textBaseline="top",ke.font="bold 36px Open Sans, sans-serif",ke.fillText(We,5,5),ke.strokeText(We,5,5),Ae.debugOverlayTexture.update(Ee),Ae.debugOverlayTexture.bind(Fe.LINEAR,Fe.CLAMP_TO_EDGE)}(d,fe);const pe=P._tileDebugTextBuffer||d.debugBuffer,xe=P._tileDebugTextIndexBuffer||d.quadTriangleIndexBuffer,ye=P._tileDebugTextSegments||d.debugSegments;z.draw(f,x.TRIANGLES,O,j,s.ColorMode.alphaBlended,s.CullFaceMode.disabled,Bc(C,s.Color.transparent,de),H,pe,xe,ye,null,null,null,[P._globeTileDebugTextBuffer])}function Cf(d,o,c,f){wa(d,0,o+c/2,d.transform.width,c,f)}function Vc(d,o,c,f){wa(d,o-c/2,0,c,d.transform.height,f)}function wa(d,o,c,f,_,x){const T=d.context,S=T.gl;S.enable(S.SCISSOR_TEST),S.scissor(o*s.exported.devicePixelRatio,c*s.exported.devicePixelRatio,f*s.exported.devicePixelRatio,_*s.exported.devicePixelRatio),T.clear({color:x}),S.disable(S.SCISSOR_TEST)}const If=s.createLayout([{name:"a_pos_3f",components:3,type:"Float32"}]),{members:kf}=If;function Io(d,o,c,f){d.emplaceBack(o,c,f)}class $c{constructor(o){this.vertexArray=new s.StructArrayLayout3f12,this.indices=new s.StructArrayLayout3ui6,Io(this.vertexArray,-1,-1,1),Io(this.vertexArray,1,-1,1),Io(this.vertexArray,-1,1,1),Io(this.vertexArray,1,1,1),Io(this.vertexArray,-1,-1,-1),Io(this.vertexArray,1,-1,-1),Io(this.vertexArray,-1,1,-1),Io(this.vertexArray,1,1,-1),this.indices.emplaceBack(5,1,3),this.indices.emplaceBack(3,7,5),this.indices.emplaceBack(6,2,0),this.indices.emplaceBack(0,4,6),this.indices.emplaceBack(2,6,7),this.indices.emplaceBack(7,3,2),this.indices.emplaceBack(5,4,0),this.indices.emplaceBack(0,1,5),this.indices.emplaceBack(0,2,3),this.indices.emplaceBack(3,1,0),this.indices.emplaceBack(7,6,4),this.indices.emplaceBack(4,5,7),this.vertexBuffer=o.createVertexBuffer(this.vertexArray,kf),this.indexBuffer=o.createIndexBuffer(this.indices),this.segment=s.SegmentVector.simpleSegment(0,0,36,12)}}function _i(d,o,c,f,_,x){const T=d.gl,S=o.paint.get("sky-atmosphere-color"),C=o.paint.get("sky-atmosphere-halo-color"),z=o.paint.get("sky-atmosphere-sun-intensity"),P=((O,j,W,H,Z)=>({u_matrix_3f:O,u_sun_direction:j,u_sun_intensity:W,u_color_tint_r:[H.r,H.g,H.b,H.a],u_color_tint_m:[Z.r,Z.g,Z.b,Z.a],u_luminance:5e-5}))(s.fromMat4(s.create$1(),f),_,z,S,C);T.framebufferTexture2D(T.FRAMEBUFFER,T.COLOR_ATTACHMENT0,T.TEXTURE_CUBE_MAP_POSITIVE_X+x,o.skyboxTexture,0),c.draw(d,T.TRIANGLES,s.DepthMode.disabled,s.StencilMode.disabled,s.ColorMode.unblended,s.CullFaceMode.frontCW,P,"skyboxCapture",o.skyboxGeometry.vertexBuffer,o.skyboxGeometry.indexBuffer,o.skyboxGeometry.segment)}const Dl=s.createLayout([{type:"Float32",name:"a_pos",components:3},{type:"Float32",name:"a_uv",components:2}]);class Mf{constructor(o){const c=new s.StructArrayLayout5f20;c.emplaceBack(-1,1,1,0,0),c.emplaceBack(1,1,1,1,0),c.emplaceBack(1,-1,1,1,1),c.emplaceBack(-1,-1,1,0,1);const f=new s.StructArrayLayout3ui6;f.emplaceBack(0,1,2),f.emplaceBack(2,3,0),this.vertexBuffer=o.createVertexBuffer(c,Dl.members),this.indexBuffer=o.createIndexBuffer(f),this.segments=s.SegmentVector.simpleSegment(0,0,4,2)}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy()}}const Rs={symbol:function(d,o,c,f,_){if(d.renderPass!=="translucent")return;const x=s.StencilMode.disabled,T=d.colorModeForRenderPass();c.layout.get("text-variable-anchor")&&function(S,C,z,P,O,j,W){const H=C.transform,Z=O==="map",X=j==="map";for(const B of S){const q=P.getTile(B),Q=q.getBucket(z);if(!Q||!Q.text||!Q.text.segments.get().length)continue;const ee=s.evaluateSizeForZoom(Q.textSizeData,H.zoom),de=Sn(B,Q.getProjection(),H),fe=H.calculatePixelsToTileUnitsMatrix(q),pe=Re(de,q.tileID.canonical,X,Z,H,Q.getProjection(),fe),xe=z.layout.get("icon-text-fit")!=="none"&&Q.hasIconData();if(ee){const ye=Math.pow(2,H.zoom-q.tileID.overscaledZ);J_(Q,Z,X,W,s.symbolSize,H,pe,B,ye,ee,xe)}}}(f,d,c,o,c.layout.get("text-rotation-alignment"),c.layout.get("text-pitch-alignment"),_),c.paint.get("icon-opacity").constantOr(1)!==0&&Tf(d,o,c,f,!1,c.paint.get("icon-translate"),c.paint.get("icon-translate-anchor"),c.layout.get("icon-rotation-alignment"),c.layout.get("icon-pitch-alignment"),c.layout.get("icon-keep-upright"),x,T),c.paint.get("text-opacity").constantOr(1)!==0&&Tf(d,o,c,f,!0,c.paint.get("text-translate"),c.paint.get("text-translate-anchor"),c.layout.get("text-rotation-alignment"),c.layout.get("text-pitch-alignment"),c.layout.get("text-keep-upright"),x,T),o.map.showCollisionBoxes&&(Ll(d,o,c,f,c.paint.get("text-translate"),c.paint.get("text-translate-anchor"),!0),Ll(d,o,c,f,c.paint.get("icon-translate"),c.paint.get("icon-translate-anchor"),!1))},circle:function(d,o,c,f){if(d.renderPass!=="translucent")return;const _=c.paint.get("circle-opacity"),x=c.paint.get("circle-stroke-width"),T=c.paint.get("circle-stroke-opacity"),S=c.layout.get("circle-sort-key").constantOr(1)!==void 0;if(_.constantOr(1)===0&&(x.constantOr(1)===0||T.constantOr(1)===0))return;const C=d.context,z=C.gl,P=d.transform,O=d.depthModeForSublayer(0,s.DepthMode.ReadOnly),j=s.StencilMode.disabled,W=d.colorModeForRenderPass(),H=P.projection.name==="globe",Z=[s.mercatorXfromLng(P.center.lng),s.mercatorYfromLat(P.center.lat)],X=[];for(let q=0;qq.sortKey-Q.sortKey);const B={useDepthForOcclusion:!H};for(const q of X){const{programConfiguration:Q,program:ee,layoutVertexBuffer:de,globeExtVertexBuffer:fe,indexBuffer:pe,uniformValues:xe,tile:ye}=q.state,Ae=q.segments;d.terrain&&d.terrain.setupElevationDraw(ye,ee,B),d.prepareDrawProgram(C,ee,ye.tileID.toUnwrapped()),ee.draw(C,z.TRIANGLES,O,j,W,s.CullFaceMode.disabled,xe,c.id,de,pe,Ae,c.paint,P.zoom,Q,[fe])}},heatmap:function(d,o,c,f){if(c.paint.get("heatmap-opacity")!==0)if(d.renderPass==="offscreen"){const _=d.context,x=_.gl,T=s.StencilMode.disabled,S=new s.ColorMode([x.ONE,x.ONE],s.Color.transparent,[!0,!0,!0,!0]);(function(W,H,Z,X){const B=W.gl,q=H.width*X,Q=H.height*X;W.activeTexture.set(B.TEXTURE1),W.viewport.set([0,0,q,Q]);let ee=Z.heatmapFbo;if(!ee||ee&&(ee.width!==q||ee.height!==Q)){ee&&ee.destroy();const de=B.createTexture();B.bindTexture(B.TEXTURE_2D,de),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_WRAP_S,B.CLAMP_TO_EDGE),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_WRAP_T,B.CLAMP_TO_EDGE),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_MIN_FILTER,B.LINEAR),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_MAG_FILTER,B.LINEAR),ee=Z.heatmapFbo=W.createFramebuffer(q,Q,!1),function(fe,pe,xe,ye,Ae,We){const Ee=fe.gl;Ee.texImage2D(Ee.TEXTURE_2D,0,fe.isWebGL2&&fe.extRenderToTextureHalfFloat?Ee.RGBA16F:Ee.RGBA,Ae,We,0,Ee.RGBA,fe.extRenderToTextureHalfFloat?fe.isWebGL2?Ee.HALF_FLOAT:fe.extTextureHalfFloat.HALF_FLOAT_OES:Ee.UNSIGNED_BYTE,null),ye.colorAttachment.set(xe)}(W,0,de,ee,q,Q)}else B.bindTexture(B.TEXTURE_2D,ee.colorAttachment.get()),W.bindFramebuffer.set(ee.framebuffer)})(_,d,c,d.transform.projection.name==="globe"?.5:.25),_.clear({color:s.Color.transparent});const C=d.transform,z=C.projection.name==="globe",P=z?["PROJECTION_GLOBE_VIEW"]:null,O=z?s.CullFaceMode.frontCCW:s.CullFaceMode.disabled,j=[s.mercatorXfromLng(C.center.lng),s.mercatorYfromLat(C.center.lat)];for(let W=0;W({u_image:0,u_color_ramp:1,u_opacity:O.paint.get("heatmap-opacity")}))(0,x),x.id,_.viewportBuffer,_.quadTriangleIndexBuffer,_.viewportSegments,x.paint,_.transform.zoom)}(d,c))},line:function(d,o,c,f){if(d.renderPass!=="translucent")return;const _=c.paint.get("line-opacity"),x=c.paint.get("line-width");if(_.constantOr(1)===0||x.constantOr(1)===0)return;const T=d.depthModeForSublayer(0,s.DepthMode.ReadOnly),S=d.colorModeForRenderPass(),C=d.terrain&&d.terrain.renderingToTexture?1:s.exported.devicePixelRatio,z=c.paint.get("line-dasharray"),P=z.constantOr(1),O=c.layout.get("line-cap"),j=c.paint.get("line-pattern"),W=j.constantOr(1),H=c.paint.get("line-gradient"),Z=W?"linePattern":"line",X=d.context,B=X.gl,q=(ee=>{const de=[];zl(ee)&&de.push("RENDER_LINE_DASH"),ee.paint.get("line-gradient")&&de.push("RENDER_LINE_GRADIENT");const fe=ee.paint.get("line-trim-offset");fe[0]===0&&fe[1]===0||de.push("RENDER_LINE_TRIM_OFFSET");const pe=ee.paint.get("line-pattern").constantOr(1),xe=ee.paint.get("line-opacity").constantOr(1)!==1;return!pe&&xe&&de.push("RENDER_LINE_ALPHA_DISCARD"),de})(c);let Q=q.includes("RENDER_LINE_ALPHA_DISCARD");d.terrain&&d.terrain.clipOrMaskOverlapStencilType()&&(Q=!1);for(const ee of f){const de=o.getTile(ee);if(W&&!de.patternsLoaded())continue;const fe=de.getBucket(c);if(!fe)continue;d.prepareDrawTile();const pe=fe.programConfigurations.get(c.id),xe=d.useProgram(Z,pe,q),ye=j.constantOr(null);if(ye&&de.imageAtlas){const Be=de.imageAtlas.patternPositions[ye.toString()];Be&&pe.setConstantPatternPositions(Be)}const Ae=z.constantOr(null),We=O.constantOr(null);if(!W&&Ae&&We&&de.lineAtlas){const Be=de.lineAtlas.getDash(Ae,We);Be&&pe.setConstantPatternPositions(Be)}let[Ee,Fe]=c.paint.get("line-trim-offset");(We==="round"||We==="square")&&Ee!==Fe&&(Ee===0&&(Ee-=1),Fe===1&&(Fe+=1));const ke=d.terrain?ee.projMatrix:null,qe=W?Pl(d,de,c,ke,C):K_(d,de,c,ke,fe.lineClipsArray.length,C,[Ee,Fe]);if(H){const Be=fe.gradients[c.id];let Xe=Be.texture;if(c.gradientVersion!==Be.version){let $e=256;if(c.stepInterpolant){const Ye=o.getSource().maxzoom,gt=ee.canonical.z===Ye?Math.ceil(1<{xe.draw(X,B.TRIANGLES,T,Be,S,s.CullFaceMode.disabled,qe,c.id,fe.layoutVertexBuffer,fe.indexBuffer,fe.segments,c.paint,d.transform.zoom,pe,[fe.layoutVertexBuffer2])};if(Q){const Be=d.stencilModeForClipping(ee).ref;Be===0&&d.terrain&&X.clear({stencil:0});const Xe={func:B.EQUAL,mask:255};qe.u_alpha_discard_threshold=.8,Se(new s.StencilMode(Xe,Be,255,B.KEEP,B.KEEP,B.INVERT)),qe.u_alpha_discard_threshold=0,Se(new s.StencilMode(Xe,Be,255,B.KEEP,B.KEEP,B.KEEP))}else Se(d.stencilModeForClipping(ee))}Q&&(d.resetStencilClippingMasks(),d.terrain&&X.clear({stencil:0}))},fill:function(d,o,c,f){const _=c.paint.get("fill-color"),x=c.paint.get("fill-opacity");if(x.constantOr(1)===0)return;const T=d.colorModeForRenderPass(),S=c.paint.get("fill-pattern"),C=d.opaquePassEnabledForLayer()&&!S.constantOr(1)&&_.constantOr(s.Color.transparent).a===1&&x.constantOr(0)===1?"opaque":"translucent";if(d.renderPass===C){const z=d.depthModeForSublayer(1,d.renderPass==="opaque"?s.DepthMode.ReadWrite:s.DepthMode.ReadOnly);Sf(d,o,c,f,z,T,!1)}if(d.renderPass==="translucent"&&c.paint.get("fill-antialias")){const z=d.depthModeForSublayer(c.getPaintProperty("fill-outline-color")?2:0,s.DepthMode.ReadOnly);Sf(d,o,c,f,z,T,!0)}},"fill-extrusion":function(d,o,c,f){const _=c.paint.get("fill-extrusion-opacity");if(_!==0&&d.renderPass==="translucent"){const x=new s.DepthMode(d.context.gl.LEQUAL,s.DepthMode.ReadWrite,d.depthRangeFor3D);if(_!==1||c.paint.get("fill-extrusion-pattern").constantOr(1))jc(d,o,c,f,x,s.StencilMode.disabled,s.ColorMode.disabled),jc(d,o,c,f,x,d.stencilModeFor3D(),d.colorModeForRenderPass()),d.resetStencilClippingMasks();else{const T=d.colorModeForRenderPass();jc(d,o,c,f,x,s.StencilMode.disabled,T)}}},hillshade:function(d,o,c,f){if(d.renderPass!=="offscreen"&&d.renderPass!=="translucent")return;const _=d.context,x=d.depthModeForSublayer(0,s.DepthMode.ReadOnly),T=d.colorModeForRenderPass(),S=d.terrain&&d.terrain.renderingToTexture,[C,z]=d.renderPass!=="translucent"||S?[{},f]:d.stencilConfigForOverlap(f);for(const P of z){const O=o.getTile(P);if(O.needsHillshadePrepare&&d.renderPass==="offscreen")gf(d,O,c,x,s.StencilMode.disabled,T);else if(d.renderPass==="translucent"){const j=S&&d.terrain?d.terrain.stencilModeForRTTOverlap(P):C[P.overscaledZ];mf(d,P,O,c,x,j,T)}}_.viewport.set([0,0,d.width,d.height]),d.resetStencilClippingMasks()},raster:function(d,o,c,f,_,x){if(d.renderPass!=="translucent"||c.paint.get("raster-opacity")===0||!f.length)return;const T=d.context,S=T.gl,C=o.getSource(),z=d.useProgram("raster"),P=d.colorModeForRenderPass(),O=d.terrain&&d.terrain.renderingToTexture,[j,W]=C instanceof Rt||O?[{},f]:d.stencilConfigForOverlap(f),H=W[W.length-1].overscaledZ,Z=!d.options.moving;for(const X of W){const B=O?s.DepthMode.disabled:d.depthModeForSublayer(X.overscaledZ-H,c.paint.get("raster-opacity")===1?s.DepthMode.ReadWrite:s.DepthMode.ReadOnly,S.LESS),q=X.toUnwrapped(),Q=o.getTile(X);if(O&&(!Q||!Q.hasData()))continue;const ee=O?X.projMatrix:d.transform.calculateProjMatrix(q,Z),de=d.terrain&&O?d.terrain.stencilModeForRTTOverlap(X):j[X.overscaledZ],fe=x?0:c.paint.get("raster-fade-duration");Q.registerFadeDuration(fe);const pe=o.findLoadedParent(X,0),xe=Nh(Q,pe,o,d.transform,fe);let ye,Ae;d.terrain&&d.terrain.prepareDrawTile();const We=c.paint.get("raster-resampling")==="nearest"?S.NEAREST:S.LINEAR;T.activeTexture.set(S.TEXTURE0),Q.texture.bind(We,S.CLAMP_TO_EDGE),T.activeTexture.set(S.TEXTURE1),pe?(pe.texture.bind(We,S.CLAMP_TO_EDGE),ye=Math.pow(2,pe.tileID.overscaledZ-Q.tileID.overscaledZ),Ae=[Q.tileID.canonical.x*ye%1,Q.tileID.canonical.y*ye%1]):Q.texture.bind(We,S.CLAMP_TO_EDGE),Q.texture.useMipmap&&T.extTextureFilterAnisotropic&&d.transform.pitch>20&&S.texParameterf(S.TEXTURE_2D,T.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,T.extTextureFilterAnisotropicMax);const Ee=Hh(ee,Ae||[0,0],ye||1,xe,c,C instanceof Rt?C.perspectiveTransform:[0,0]);if(d.prepareDrawProgram(T,z,q),C instanceof Rt)C.boundsBuffer&&C.boundsSegments&&z.draw(T,S.TRIANGLES,B,s.StencilMode.disabled,P,s.CullFaceMode.disabled,Ee,c.id,C.boundsBuffer,d.quadTriangleIndexBuffer,C.boundsSegments);else{const{tileBoundsBuffer:Fe,tileBoundsIndexBuffer:ke,tileBoundsSegments:qe}=d.getTileBoundsBuffers(Q);z.draw(T,S.TRIANGLES,B,de,P,s.CullFaceMode.disabled,Ee,c.id,Fe,ke,qe)}}d.resetStencilClippingMasks()},background:function(d,o,c,f){const _=c.paint.get("background-color"),x=c.paint.get("background-opacity");if(x===0)return;const T=d.context,S=T.gl,C=d.transform,z=C.tileSize,P=c.paint.get("background-pattern");if(d.isPatternMissing(P))return;const O=!P&&_.a===1&&x===1&&d.opaquePassEnabledForLayer()?"opaque":"translucent";if(d.renderPass!==O)return;const j=s.StencilMode.disabled,W=d.depthModeForSublayer(0,O==="opaque"?s.DepthMode.ReadWrite:s.DepthMode.ReadOnly),H=d.colorModeForRenderPass(),Z=d.useProgram(P?"backgroundPattern":"background");let X,B=f;B||(X=d.getBackgroundTiles(),B=Object.values(X).map(q=>q.tileID)),P&&(T.activeTexture.set(S.TEXTURE0),d.imageManager.bind(d.context));for(const q of B){const Q=q.toUnwrapped(),ee=f?q.projMatrix:d.transform.calculateProjMatrix(Q);d.prepareDrawTile();const de=o?o.getTile(q):X?X[q.key]:new s.Tile(q,z,C.zoom,d),fe=P?Y_(ee,x,d,P,{tileID:q,tileSize:z}):Kh(ee,x,_);d.prepareDrawProgram(T,Z,Q);const{tileBoundsBuffer:pe,tileBoundsIndexBuffer:xe,tileBoundsSegments:ye}=d.getTileBoundsBuffers(de);Z.draw(T,S.TRIANGLES,W,j,H,s.CullFaceMode.disabled,fe,c.id,pe,xe,ye)}},sky:function(d,o,c){const f=d.transform,_=f.projection.name==="mercator"||f.projection.name==="globe"?1:s.smoothstep(7,8,f.zoom),x=c.paint.get("sky-opacity")*_;if(x===0)return;const T=d.context,S=c.paint.get("sky-type"),C=new s.DepthMode(T.gl.LEQUAL,s.DepthMode.ReadOnly,[0,1]),z=d.frameCounter/1e3%1;S==="atmosphere"?d.renderPass==="offscreen"?c.needsSkyboxCapture(d)&&(function(P,O,j,W){const H=P.context,Z=H.gl;let X=O.skyboxFbo;if(!X){X=O.skyboxFbo=H.createFramebuffer(32,32,!1),O.skyboxGeometry=new $c(H),O.skyboxTexture=H.gl.createTexture(),Z.bindTexture(Z.TEXTURE_CUBE_MAP,O.skyboxTexture),Z.texParameteri(Z.TEXTURE_CUBE_MAP,Z.TEXTURE_WRAP_S,Z.CLAMP_TO_EDGE),Z.texParameteri(Z.TEXTURE_CUBE_MAP,Z.TEXTURE_WRAP_T,Z.CLAMP_TO_EDGE),Z.texParameteri(Z.TEXTURE_CUBE_MAP,Z.TEXTURE_MIN_FILTER,Z.LINEAR),Z.texParameteri(Z.TEXTURE_CUBE_MAP,Z.TEXTURE_MAG_FILTER,Z.LINEAR);for(let ee=0;ee<6;++ee)Z.texImage2D(Z.TEXTURE_CUBE_MAP_POSITIVE_X+ee,0,Z.RGBA,32,32,0,Z.RGBA,Z.UNSIGNED_BYTE,null)}H.bindFramebuffer.set(X.framebuffer),H.viewport.set([0,0,32,32]);const B=O.getCenter(P,!0),q=P.useProgram("skyboxCapture"),Q=new Float64Array(16);s.identity(Q),s.rotateY(Q,Q,.5*-Math.PI),_i(H,O,q,Q,B,0),s.identity(Q),s.rotateY(Q,Q,.5*Math.PI),_i(H,O,q,Q,B,1),s.identity(Q),s.rotateX(Q,Q,.5*-Math.PI),_i(H,O,q,Q,B,2),s.identity(Q),s.rotateX(Q,Q,.5*Math.PI),_i(H,O,q,Q,B,3),s.identity(Q),_i(H,O,q,Q,B,4),s.identity(Q),s.rotateY(Q,Q,Math.PI),_i(H,O,q,Q,B,5),H.viewport.set([0,0,P.width,P.height])}(d,c),c.markSkyboxValid(d)):d.renderPass==="sky"&&function(P,O,j,W,H){const Z=P.context,X=Z.gl,B=P.transform,q=P.useProgram("skybox");Z.activeTexture.set(X.TEXTURE0),X.bindTexture(X.TEXTURE_CUBE_MAP,O.skyboxTexture);const Q=((ee,de,fe,pe,xe)=>({u_matrix:ee,u_sun_direction:de,u_cubemap:0,u_opacity:pe,u_temporal_offset:xe}))(B.skyboxMatrix,O.getCenter(P,!1),0,W,H);P.prepareDrawProgram(Z,q),q.draw(Z,X.TRIANGLES,j,s.StencilMode.disabled,P.colorModeForRenderPass(),s.CullFaceMode.backCW,Q,"skybox",O.skyboxGeometry.vertexBuffer,O.skyboxGeometry.indexBuffer,O.skyboxGeometry.segment)}(d,c,C,x,z):S==="gradient"&&d.renderPass==="sky"&&function(P,O,j,W,H){const Z=P.context,X=Z.gl,B=P.transform,q=P.useProgram("skyboxGradient");O.skyboxGeometry||(O.skyboxGeometry=new $c(Z)),Z.activeTexture.set(X.TEXTURE0);let Q=O.colorRampTexture;Q||(Q=O.colorRampTexture=new s.Texture(Z,O.colorRamp,X.RGBA)),Q.bind(X.LINEAR,X.CLAMP_TO_EDGE);const ee=((de,fe,pe,xe,ye)=>({u_matrix:de,u_color_ramp:0,u_center_direction:fe,u_radius:s.degToRad(pe),u_opacity:xe,u_temporal_offset:ye}))(B.skyboxMatrix,O.getCenter(P,!1),O.paint.get("sky-gradient-radius"),W,H);P.prepareDrawProgram(Z,q),q.draw(Z,X.TRIANGLES,j,s.StencilMode.disabled,P.colorModeForRenderPass(),s.CullFaceMode.backCW,ee,"skyboxGradient",O.skyboxGeometry.vertexBuffer,O.skyboxGeometry.indexBuffer,O.skyboxGeometry.segment)}(d,c,C,x,z)},debug:function(d,o,c){for(let f=0;f_)return void(this.transform.fogCullDistSq=null);const x=f+.78*(_-f);this.transform.fogCullDistSq=x*x}get terrain(){return this.transform._terrainEnabled()&&this._terrain&&this._terrain.enabled?this._terrain:null}resize(o,c){if(this.width=o*s.exported.devicePixelRatio,this.height=c*s.exported.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const f of this.style.order)this.style._layers[f].resize()}setup(){const o=this.context,c=new s.StructArrayLayout2i4;c.emplaceBack(0,0),c.emplaceBack(s.EXTENT,0),c.emplaceBack(0,s.EXTENT),c.emplaceBack(s.EXTENT,s.EXTENT),this.tileExtentBuffer=o.createVertexBuffer(c,s.posAttributes.members),this.tileExtentSegments=s.SegmentVector.simpleSegment(0,0,4,2);const f=new s.StructArrayLayout2i4;f.emplaceBack(0,0),f.emplaceBack(s.EXTENT,0),f.emplaceBack(0,s.EXTENT),f.emplaceBack(s.EXTENT,s.EXTENT),this.debugBuffer=o.createVertexBuffer(f,s.posAttributes.members),this.debugSegments=s.SegmentVector.simpleSegment(0,0,4,5);const _=new s.StructArrayLayout2i4;_.emplaceBack(-1,-1),_.emplaceBack(1,-1),_.emplaceBack(-1,1),_.emplaceBack(1,1),this.viewportBuffer=o.createVertexBuffer(_,s.posAttributes.members),this.viewportSegments=s.SegmentVector.simpleSegment(0,0,4,2);const x=new s.StructArrayLayout4i8;x.emplaceBack(0,0,0,0),x.emplaceBack(s.EXTENT,0,s.EXTENT,0),x.emplaceBack(0,s.EXTENT,0,s.EXTENT),x.emplaceBack(s.EXTENT,s.EXTENT,s.EXTENT,s.EXTENT),this.mercatorBoundsBuffer=o.createVertexBuffer(x,s.boundsAttributes.members),this.mercatorBoundsSegments=s.SegmentVector.simpleSegment(0,0,4,2);const T=new s.StructArrayLayout3ui6;T.emplaceBack(0,1,2),T.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=o.createIndexBuffer(T);const S=new s.StructArrayLayout1ui2;for(const z of[0,1,3,2,0])S.emplaceBack(z);this.debugIndexBuffer=o.createIndexBuffer(S),this.emptyTexture=new s.Texture(o,new s.RGBAImage({width:1,height:1},Uint8Array.of(0,0,0,0)),o.gl.RGBA),this.identityMat=s.create();const C=this.context.gl;this.stencilClearMode=new s.StencilMode({func:C.ALWAYS,mask:0},0,255,C.ZERO,C.ZERO,C.ZERO),this.loadTimeStamps.push(s.window.performance.now()),this.atmosphereBuffer=new Mf(this.context)}getMercatorTileBoundsBuffers(){return{tileBoundsBuffer:this.mercatorBoundsBuffer,tileBoundsIndexBuffer:this.quadTriangleIndexBuffer,tileBoundsSegments:this.mercatorBoundsSegments}}getTileBoundsBuffers(o){return o._makeTileBoundsBuffers(this.context,this.transform.projection),o._tileBoundsBuffer?{tileBoundsBuffer:o._tileBoundsBuffer,tileBoundsIndexBuffer:o._tileBoundsIndexBuffer,tileBoundsSegments:o._tileBoundsSegments}:this.getMercatorTileBoundsBuffers()}clearStencil(){const o=this.context,c=o.gl;this.nextStencilID=1,this.currentStencilSource=void 0,this._tileClippingMaskIDs={},this.useProgram("clippingMask").draw(o,c.TRIANGLES,s.DepthMode.disabled,this.stencilClearMode,s.ColorMode.disabled,s.CullFaceMode.disabled,kl(this.identityMat),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}resetStencilClippingMasks(){this.terrain||(this.currentStencilSource=void 0,this._tileClippingMaskIDs={})}_renderTileClippingMasks(o,c,f){if(!c||this.currentStencilSource===c.id||!o.isTileClipped()||!f||f.length===0)return;if(this._tileClippingMaskIDs&&!this.terrain){let S=!1;for(const C of f)if(this._tileClippingMaskIDs[C.key]===void 0){S=!0;break}if(!S)return}this.currentStencilSource=c.id;const _=this.context,x=_.gl;this.nextStencilID+f.length>256&&this.clearStencil(),_.setColorMode(s.ColorMode.disabled),_.setDepthMode(s.DepthMode.disabled);const T=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const S of f){const C=c.getTile(S),z=this._tileClippingMaskIDs[S.key]=this.nextStencilID++,{tileBoundsBuffer:P,tileBoundsIndexBuffer:O,tileBoundsSegments:j}=this.getTileBoundsBuffers(C);T.draw(_,x.TRIANGLES,s.DepthMode.disabled,new s.StencilMode({func:x.ALWAYS,mask:0},z,255,x.KEEP,x.KEEP,x.REPLACE),s.ColorMode.disabled,s.CullFaceMode.disabled,kl(S.projMatrix),"$clipping",P,O,j)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const o=this.nextStencilID++,c=this.context.gl;return new s.StencilMode({func:c.NOTEQUAL,mask:255},o,255,c.KEEP,c.KEEP,c.REPLACE)}stencilModeForClipping(o){if(this.terrain)return this.terrain.stencilModeForRTTOverlap(o);const c=this.context.gl;return new s.StencilMode({func:c.EQUAL,mask:255},this._tileClippingMaskIDs[o.key],0,c.KEEP,c.KEEP,c.REPLACE)}stencilConfigForOverlap(o){const c=this.context.gl,f=o.sort((T,S)=>S.overscaledZ-T.overscaledZ),_=f[f.length-1].overscaledZ,x=f[0].overscaledZ-_+1;if(x>1){this.currentStencilSource=void 0,this.nextStencilID+x>256&&this.clearStencil();const T={};for(let S=0;S=0;this.currentLayer--){const z=this.style._layers[f[this.currentLayer]],P=o._getLayerSourceCache(z);if(z.isSky())continue;const O=P?T[P.id]:void 0;this._renderTileClippingMasks(z,P,O),this.renderLayer(this,P,z,O)}if(this.style.fog&&this.transform.projection.supportsFog&&function(z,P){const O=z.context,j=O.gl,W=z.transform,H=new s.DepthMode(j.LEQUAL,s.DepthMode.ReadOnly,[0,1]),Z=z.useProgram("globeAtmosphere",null,W.projection.name==="globe"?["PROJECTION_GLOBE_VIEW","FOG"]:["FOG"]),X=s.globeToMercatorTransition(W.zoom),B=P.properties.get("color").toArray01(),q=P.properties.get("high-color").toArray01(),Q=P.properties.get("space-color").toArray01PremultipliedAlpha(),ee=s.identity$1([]);s.rotateY$1(ee,ee,-s.degToRad(W._center.lng)),s.rotateX$1(ee,ee,s.degToRad(W._center.lat)),s.rotateZ$1(ee,ee,W.angle),s.rotateX$1(ee,ee,-W._pitch);const de=s.fromQuat(new Float32Array(16),ee),fe=s.mapValue(P.properties.get("star-intensity"),0,1,0,.25),pe=5e-4,xe=s.mapValue(P.properties.get("horizon-blend"),0,1,pe,.25),ye=s.globeUseCustomAntiAliasing(z,O,W)&&xe===pe?W.worldSize/(2*Math.PI*1.025)-1:W.globeRadius,Ae=z.frameCounter/1e3%1,We=s.length(W.globeCenterInViewSpace),Ee=Math.sqrt(Math.pow(We,2)-Math.pow(ye,2)),Fe=Math.acos(Ee/We),ke=((Se,Be,Xe,$e,Ye,gt,Et,pt,wt,Ut,Ot,mt,en,rn)=>({u_frustum_tl:Se,u_frustum_tr:Be,u_frustum_br:Xe,u_frustum_bl:$e,u_horizon:Ye,u_transition:gt,u_fadeout_range:Et,u_color:pt,u_high_color:wt,u_space_color:Ut,u_star_intensity:Ot,u_star_size:5*s.exported.devicePixelRatio,u_star_density:0,u_temporal_offset:mt,u_horizon_angle:en,u_rotation_matrix:rn}))(W.frustumCorners.TL,W.frustumCorners.TR,W.frustumCorners.BR,W.frustumCorners.BL,W.frustumCorners.horizon,X,xe,B,q,Q,fe,Ae,Fe,de);z.prepareDrawProgram(O,Z);const qe=z.atmosphereBuffer;qe&&Z.draw(O,j.TRIANGLES,H,s.StencilMode.disabled,s.ColorMode.alphaBlended,s.CullFaceMode.backCW,ke,"skybox",qe.vertexBuffer,qe.indexBuffer,qe.segments)}(this,this.style.fog),this.renderPass="sky",(s.globeToMercatorTransition(this.transform.zoom)>0||this.transform.projection.name!=="globe")&&this.transform.isHorizonVisible())for(this.currentLayer=0;this.currentLayer{const O=o._getLayerSourceCache(P);O&&!P.isHidden(this.transform.zoom)&&(!z||z.getSource().maxzoom0?c.pop():null}isPatternMissing(o){return o===null||o!==void 0&&!this.imageManager.getPattern(o.toString())}terrainRenderModeElevated(){return this.style&&!!this.style.getTerrain()&&!!this.terrain&&!this.terrain.renderingToTexture}currentGlobalDefines(){const o=this.terrain&&this.terrain.renderingToTexture,c=this.terrain&&this.terrain.exaggeration()===0,f=this.style&&this.style.fog,_=[];return this.terrainRenderModeElevated()&&_.push("TERRAIN"),this.transform.projection.name==="globe"&&_.push("GLOBE"),c&&_.push("ZERO_EXAGGERATION"),f&&!o&&f.getOpacity(this.transform.pitch)!==0&&_.push("FOG"),o&&_.push("RENDER_TO_TEXTURE"),this._showOverdrawInspector&&_.push("OVERDRAW_INSPECTOR"),_}useProgram(o,c,f){this.cache=this.cache||{};const _=f||[],x=this.currentGlobalDefines().concat(_),T=Wt.cacheKey(Dh[o],o,x,c);return this.cache[T]||(this.cache[T]=new Wt(this.context,o,Dh[o],c,Yh[o],x)),this.cache[T]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.frontFace.setDefault(),this.context.cullFaceSide.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const o=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(o.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=s.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new s.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this._terrain&&this._terrain.destroy(),this.globeSharedBuffers&&this.globeSharedBuffers.destroy(),this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.atmosphereBuffer&&this.atmosphereBuffer.destroy()}prepareDrawTile(){this.terrain&&this.terrain.prepareDrawTile()}prepareDrawProgram(o,c,f){if(this.terrain&&this.terrain.renderingToTexture)return;const _=this.style.fog;if(_){const x=_.getOpacity(this.transform.pitch),T=((S,C,z,P,O,j,W,H,Z,X,B)=>{const q=S.transform,Q=C.properties.get("color").toArray01();Q[3]=P;const ee=S.frameCounter/1e3%1;return{u_fog_matrix:z?q.calculateFogTileMatrix(z):S.identityMat,u_fog_range:C.getFovAdjustedRange(q._fov),u_fog_color:Q,u_fog_horizon_blend:C.properties.get("horizon-blend"),u_fog_temporal_offset:ee,u_frustum_tl:O,u_frustum_tr:j,u_frustum_br:W,u_frustum_bl:H,u_globe_pos:Z,u_globe_radius:X,u_viewport:B,u_globe_transition:s.globeToMercatorTransition(q.zoom),u_is_globe:+(q.projection.name==="globe")}})(this,_,f,x,this.transform.frustumCorners.TL,this.transform.frustumCorners.TR,this.transform.frustumCorners.BR,this.transform.frustumCorners.BL,this.transform.globeCenterInViewSpace,this.transform.globeRadius,[this.transform.width*s.exported.devicePixelRatio,this.transform.height*s.exported.devicePixelRatio]);c.setFogUniformValues(o,T)}}setTileLoadedFlag(o){this.tileLoaded=o}saveCanvasCopy(){const o=this.canvasCopy();o&&(this.frameCopies.push(o),this.tileLoaded=!1)}canvasCopy(){const o=this.context.gl,c=o.createTexture();return o.bindTexture(o.TEXTURE_2D,c),o.copyTexImage2D(o.TEXTURE_2D,0,o.RGBA,0,0,o.drawingBufferWidth,o.drawingBufferHeight,0),c}getCanvasCopiesAndTimestamps(){return{canvasCopies:this.frameCopies,timeStamps:this.loadTimeStamps}}averageElevationNeedsEasing(){if(!this.transform._elevation)return!1;const o=this.style&&this.style.fog;return!!o&&o.getOpacity(this.transform.pitch)!==0}getBackgroundTiles(){const o=this._backgroundTiles,c=this._backgroundTiles={},f=this.transform.coveringTiles({tileSize:512});for(const _ of f)c[_.key]=o[_.key]||new s.Tile(_,512,this.transform.tileZoom,this);return c}clearBackgroundTiles(){this._backgroundTiles={}}}class Gc{constructor(o=0,c=0,f=0,_=0){if(isNaN(o)||o<0||isNaN(c)||c<0||isNaN(f)||f<0||isNaN(_)||_<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=o,this.bottom=c,this.left=f,this.right=_}interpolate(o,c,f){return c.top!=null&&o.top!=null&&(this.top=s.number(o.top,c.top,f)),c.bottom!=null&&o.bottom!=null&&(this.bottom=s.number(o.bottom,c.bottom,f)),c.left!=null&&o.left!=null&&(this.left=s.number(o.left,c.left,f)),c.right!=null&&o.right!=null&&(this.right=s.number(o.right,c.right,f)),this}getCenter(o,c){const f=s.clamp((this.left+o-this.right)/2,0,o),_=s.clamp((this.top+c-this.bottom)/2,0,c);return new s.Point(f,_)}equals(o){return this.top===o.top&&this.bottom===o.bottom&&this.left===o.left&&this.right===o.right}clone(){return new Gc(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function qc(d,o){const c=s.getColumn(d,3);s.fromQuat(d,o),s.setColumn(d,3,c)}function Zt(d,o){const c=s.identity$1([]);return s.rotateZ$1(c,c,-o),s.rotateX$1(c,c,-d),c}function Ol(d,o){const c=[d[0],d[1],0],f=[o[0],o[1],0];if(s.length(c)>=1e-15){const T=s.normalize([],c);s.scale$2(f,T,s.dot(f,T)),o[0]=f[0],o[1]=f[1]}const _=s.cross([],o,d);if(s.len(_)<1e-15)return null;const x=Math.atan2(-_[1],_[0]);return Zt(Math.atan2(Math.sqrt(d[0]*d[0]+d[1]*d[1]),-d[2]),x)}class Pf{constructor(o,c){this.position=o,this.orientation=c}get position(){return this._position}set position(o){if(o){const c=o instanceof s.MercatorCoordinate?o:new s.MercatorCoordinate(o[0],o[1],o[2]);this._renderWorldCopies&&(c.x=s.wrap(c.x,0,1)),this._position=c}else this._position=null}lookAtPoint(o,c){if(this.orientation=null,!this.position)return;const f=this.position,_=this._elevation?this._elevation.getAtPointOrZero(s.MercatorCoordinate.fromLngLat(o)):0,x=s.MercatorCoordinate.fromLngLat(o,_),T=[x.x-f.x,x.y-f.y,x.z-f.z];c||(c=[0,0,1]),c[2]=Math.abs(c[2]),this.orientation=Ol(T,c)}setPitchBearing(o,c){this.orientation=Zt(s.degToRad(o),s.degToRad(-c))}}class Wc{constructor(o,c){this._transform=s.identity([]),this.orientation=c,this.position=o}get mercatorPosition(){const o=this.position;return new s.MercatorCoordinate(o[0],o[1],o[2])}get position(){const o=s.getColumn(this._transform,3);return[o[0],o[1],o[2]]}set position(o){var c;o&&s.setColumn(this._transform,3,[(c=o)[0],c[1],c[2],1])}get orientation(){return this._orientation}set orientation(o){this._orientation=o||s.identity$1([]),o&&qc(this._transform,this._orientation)}getPitchBearing(){const o=this.forward(),c=this.right();return{bearing:Math.atan2(-c[1],c[0]),pitch:Math.atan2(Math.sqrt(o[0]*o[0]+o[1]*o[1]),-o[2])}}setPitchBearing(o,c){this._orientation=Zt(o,c),qc(this._transform,this._orientation)}forward(){const o=s.getColumn(this._transform,2);return[-o[0],-o[1],-o[2]]}up(){const o=s.getColumn(this._transform,1);return[-o[0],-o[1],-o[2]]}right(){const o=s.getColumn(this._transform,0);return[o[0],o[1],o[2]]}getCameraToWorld(o,c){const f=new Float64Array(16);return s.invert(f,this.getWorldToCamera(o,c)),f}getWorldToCameraPosition(o,c,f){const _=this.position;s.scale$2(_,_,-o);const x=new Float64Array(16);return s.fromScaling(x,[f,f,f]),s.translate(x,x,_),x[10]*=c,x}getWorldToCamera(o,c){const f=new Float64Array(16),_=new Float64Array(4),x=this.position;return s.conjugate(_,this._orientation),s.scale$2(x,x,-o),s.fromQuat(f,_),s.translate(f,f,x),f[1]*=-1,f[5]*=-1,f[9]*=-1,f[13]*=-1,f[8]*=c,f[9]*=c,f[10]*=c,f[11]*=c,f}getCameraToClipPerspective(o,c,f,_){const x=new Float64Array(16);return s.perspective(x,o,c,f,_),x}getDistanceToElevation(o,c=!1){const f=o===0?0:s.mercatorZfromAltitude(o,c?s.latFromMercatorY(this.position[1]):this.position[1]),_=this.forward();return(f-this.position[2])/_[2]}clone(){return new Wc([...this.position],[...this.orientation])}}function Ea(d,o){const c=Zc(d.projection,d.zoom,d.width,d.height),f=function(x,T,S,C,z){const P=new s.LngLat(S.lng-180*ko,S.lat),O=new s.LngLat(S.lng+180*ko,S.lat),j=x.project(P.lng,P.lat),W=x.project(O.lng,O.lat),H=-Math.atan2(W.y-j.y,W.x-j.x),Z=s.MercatorCoordinate.fromLngLat(S);Z.y=s.clamp(Z.y,-1+ko,1-ko);const X=Z.toLngLat(),B=x.project(X.lng,X.lat),q=s.MercatorCoordinate.fromLngLat(X);q.x+=ko;const Q=q.toLngLat(),ee=x.project(Q.lng,Q.lat),de=Hc(ee.x-B.x,ee.y-B.y,H),fe=s.MercatorCoordinate.fromLngLat(X);fe.y+=ko;const pe=fe.toLngLat(),xe=x.project(pe.lng,pe.lat),ye=Hc(xe.x-B.x,xe.y-B.y,H),Ae=Math.abs(de.x)/Math.abs(ye.y),We=s.identity([]);s.rotateZ(We,We,-H*(1-(z?0:C)));const Ee=s.identity([]);return s.scale(Ee,Ee,[1,1-(1-Ae)*C,1]),Ee[4]=-ye.x/ye.y*C,s.rotateZ(Ee,Ee,H),s.multiply(Ee,We,Ee),Ee}(d.projection,0,d.center,c,o),_=zf(d);return s.scale(f,f,[_,_,1]),f}function zf(d){const o=d.projection,c=Zc(d.projection,d.zoom,d.width,d.height),f=Lf(o,d.center),_=Lf(o,s.LngLat.convert(o.center));return Math.pow(2,f*c+(1-c)*_)}function Zc(d,o,c,f,_=1/0){const x=d.range;if(!x)return 0;const T=Math.min(_,Math.max(c,f)),S=Math.log(T/1024)/Math.LN2;return s.smoothstep(x[0]+S,x[1]+S,o)}const ko=1/4e4;function Lf(d,o){const c=s.clamp(o.lat,-s.MAX_MERCATOR_LATITUDE,s.MAX_MERCATOR_LATITUDE),f=new s.LngLat(o.lng-180*ko,c),_=new s.LngLat(o.lng+180*ko,c),x=d.project(f.lng,c),T=d.project(_.lng,c),S=s.MercatorCoordinate.fromLngLat(f),C=s.MercatorCoordinate.fromLngLat(_),z=T.x-x.x,P=T.y-x.y,O=C.x-S.x,j=C.y-S.y,W=Math.sqrt((O*O+j*j)/(z*z+P*P));return Math.log(W)/Math.LN2}function Hc(d,o,c){const f=Math.cos(c),_=Math.sin(c);return{x:d*f-o*_,y:d*_+o*f}}class Ta{constructor(o,c,f,_,x,T,S){this.tileSize=512,this._renderWorldCopies=x===void 0||x,this._minZoom=o||0,this._maxZoom=c||22,this._minPitch=f??0,this._maxPitch=_??60,this.setProjection(T),this.setMaxBounds(S),this.width=0,this.height=0,this._center=new s.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._nearZ=0,this._farZ=0,this._unmodified=!0,this._edgeInsets=new Gc,this._projMatrixCache={},this._alignedProjMatrixCache={},this._fogTileMatrixCache={},this._distanceTileDataCache={},this._camera=new Wc,this._centerAltitude=0,this._averageElevation=0,this.cameraElevationReference="ground",this._pixelsPerMercatorPixel=1,this.globeRadius=0,this.globeCenterInViewSpace=[0,0,0],this._horizonShift=.1}clone(){const o=new Ta(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies,this.getProjection());return o._elevation=this._elevation,o._centerAltitude=this._centerAltitude,o._centerAltitudeValidForExaggeration=this._centerAltitudeValidForExaggeration,o.tileSize=this.tileSize,o.mercatorFromTransition=this.mercatorFromTransition,o.width=this.width,o.height=this.height,o.cameraElevationReference=this.cameraElevationReference,o._center=this._center,o._setZoom(this.zoom),o._seaLevelZoom=this._seaLevelZoom,o.angle=this.angle,o._fov=this._fov,o._pitch=this._pitch,o._nearZ=this._nearZ,o._farZ=this._farZ,o._averageElevation=this._averageElevation,o._unmodified=this._unmodified,o._edgeInsets=this._edgeInsets.clone(),o._camera=this._camera.clone(),o._calcMatrices(),o.freezeTileCoverage=this.freezeTileCoverage,o.frustumCorners=this.frustumCorners,o}get elevation(){return this._elevation}set elevation(o){this._elevation!==o&&(this._elevation=o,this._updateCameraOnTerrain(),this._calcMatrices())}updateElevation(o,c=!1){const f=this._elevation&&this._elevation.exaggeration()!==this._centerAltitudeValidForExaggeration;(this._seaLevelZoom==null||f)&&this._updateCameraOnTerrain(),(o||f)&&this._constrainCamera(c),this._calcMatrices()}getProjection(){return s.pick(this.projection,["name","center","parallels"])}setProjection(o){this.projectionOptions=o||{name:"mercator"};const c=this.projection?this.getProjection():void 0;this.projection=s.getProjection(this.projectionOptions);const f=!k(c,this.getProjection());return f&&this._calcMatrices(),this.mercatorFromTransition=!1,f}setMercatorFromTransition(){const o=this.projection.name;this.mercatorFromTransition=!0,this.projectionOptions={name:"mercator"},this.projection=s.getProjection({name:"mercator"});const c=o!==this.projection.name;return c&&this._calcMatrices(),c}get minZoom(){return this._minZoom}set minZoom(o){this._minZoom!==o&&(this._minZoom=o,this.zoom=Math.max(this.zoom,o))}get maxZoom(){return this._maxZoom}set maxZoom(o){this._maxZoom!==o&&(this._maxZoom=o,this.zoom=Math.min(this.zoom,o))}get minPitch(){return this._minPitch}set minPitch(o){this._minPitch!==o&&(this._minPitch=o,this.pitch=Math.max(this.pitch,o))}get maxPitch(){return this._maxPitch}set maxPitch(o){this._maxPitch!==o&&(this._maxPitch=o,this.pitch=Math.min(this.pitch,o))}get renderWorldCopies(){return this._renderWorldCopies&&this.projection.supportsWorldCopies===!0}set renderWorldCopies(o){o===void 0?o=!0:o===null&&(o=!1),this._renderWorldCopies=o}get worldSize(){return this.tileSize*this.scale}get cameraWorldSizeForFog(){const o=Math.max(this._camera.getDistanceToElevation(this._averageElevation),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(o))}get cameraWorldSize(){const o=Math.max(this._camera.getDistanceToElevation(this._averageElevation,!0),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(o))}get pixelsPerMeter(){return this.projection.pixelsPerMeter(this.center.lat,this.worldSize)}get cameraPixelsPerMeter(){return s.mercatorZfromAltitude(this.center.lat,this.cameraWorldSizeForFog)}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new s.Point(this.width,this.height)}get bearing(){return s.wrap(this.rotation,-180,180)}set bearing(o){this.rotation=o}get rotation(){return-this.angle/Math.PI*180}set rotation(o){const c=-o*Math.PI/180;var f;this.angle!==c&&(this._unmodified=!1,this.angle=c,this._calcMatrices(),this.rotationMatrix=(f=new s.ARRAY_TYPE(4),s.ARRAY_TYPE!=Float32Array&&(f[1]=0,f[2]=0),f[0]=1,f[3]=1,f),function(_,x,T){var S=x[0],C=x[1],z=x[2],P=x[3],O=Math.sin(T),j=Math.cos(T);_[0]=S*j+z*O,_[1]=C*j+P*O,_[2]=S*-O+z*j,_[3]=C*-O+P*j}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(o){const c=s.clamp(o,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==c&&(this._unmodified=!1,this._pitch=c,this._calcMatrices())}get aspect(){return this.width/this.height}get fov(){return this._fov/Math.PI*180}get fovX(){return this._fov}get fovY(){const o=1/Math.tan(.5*this.fovX);return 2*Math.atan(1/this.aspect/o)}set fov(o){o=Math.max(.01,Math.min(60,o)),this._fov!==o&&(this._unmodified=!1,this._fov=s.degToRad(o),this._calcMatrices())}get averageElevation(){return this._averageElevation}set averageElevation(o){this._averageElevation=o,this._calcFogMatrices(),this._distanceTileDataCache={}}get zoom(){return this._zoom}set zoom(o){const c=Math.min(Math.max(o,this.minZoom),this.maxZoom);this._zoom!==c&&(this._unmodified=!1,this._setZoom(c),this._updateSeaLevelZoom(),this._constrain(),this._calcMatrices())}_setZoom(o){this._zoom=o,this.scale=this.zoomScale(o),this.tileZoom=Math.floor(o),this.zoomFraction=o-this.tileZoom}_updateCameraOnTerrain(){if(!this._elevation||!this._elevation.isDataAvailableAtPoint(this.locationCoordinate(this.center)))return this._centerAltitude=0,this._seaLevelZoom=null,void(this._centerAltitudeValidForExaggeration=void 0);const o=this._elevation;this._centerAltitude=o.getAtPointOrZero(this.locationCoordinate(this.center)),this._centerAltitudeValidForExaggeration=o.exaggeration(),this._updateSeaLevelZoom()}_updateSeaLevelZoom(){this._centerAltitudeValidForExaggeration!==void 0&&(this._seaLevelZoom=this._zoomFromMercatorZ((this.pixelsPerMeter*this._centerAltitude+this.cameraToCenterDistance)/this.worldSize))}sampleAverageElevation(){if(!this._elevation)return 0;const o=this._elevation,c=[[.5,.2],[.3,.5],[.5,.5],[.7,.5],[.5,.8]],f=this.horizonLineFromTop();let _=0,x=0;for(let T=0;To.maxzoom&&(c=o.maxzoom);const T=this.locationCoordinate(this.center),S=this.center.lat,C=1<{const Xe=new s.MercatorCoordinate(Se.x+25e-6,Se.y,Se.z),$e=new s.MercatorCoordinate(Se.x,Se.y+25e-6,Se.z),Ye=Se.toLngLat(),gt=Xe.toLngLat(),Et=$e.toLngLat(),pt=this.locationCoordinate(Ye),wt=this.locationCoordinate(gt),Ut=this.locationCoordinate(Et),Ot=Math.hypot(wt.x-pt.x,wt.y-pt.y),mt=Math.hypot(Ut.x-pt.x,Ut.y-pt.y);return Math.sqrt(Ot*mt)*de/25e-6},pe=Se=>{const Be=Q,Xe=ee;return{aabb:s.tileAABB(this,C,0,0,0,Se,Xe,Be,this.projection),zoom:0,x:0,y:0,minZ:Xe,maxZ:Be,wrap:Se,fullyVisible:!1}},xe=[];let ye=[];const Ae=c,We=o.reparseOverscaled?f:c,Ee=Se=>Se*Se,Fe=Ee((Z-this._centerAltitude)*H),ke=Se=>{if(!this._elevation||!Se.tileID||!x)return;const Be=this._elevation.getMinMaxForTile(Se.tileID),Xe=Se.aabb;Be?(Xe.min[2]=Be.min,Xe.max[2]=Be.max,Xe.center[2]=(Xe.min[2]+Xe.max[2])/2):(Se.shouldSplit=qe(Se),Se.shouldSplit||(Xe.min[2]=Xe.max[2]=Xe.center[2]=this._centerAltitude))},qe=Se=>{if(Se.zoom=.9)return!0}else if(_&&($e=Ee(Se.aabb.distanceZ(X)*H)),this.projection.isReprojectedInTileSpace&&f<=5){const pt=Math.pow(2,Se.zoom),wt=fe(new s.MercatorCoordinate((Se.x+.5)/pt,(Se.y+.5)/pt));Ye=wt>.85?1:wt}const gt=Be*Be+Xe*Xe+$e,Et=Ee((1<{if(wt*Ee(.707)0;){const Se=xe.pop(),Be=Se.x,Xe=Se.y;let $e=Se.fullyVisible;if(!$e){const Ye=Se.aabb.intersects(j);if(Ye===0)continue;$e=Ye===2}if(Se.zoom!==Ae&&qe(Se))for(let Ye=0;Ye<4;Ye++){const gt=(Be<<1)+Ye%2,Et=(Xe<<1)+(Ye>>1),pt={aabb:x?Se.aabb.quadrant(Ye):s.tileAABB(this,C,Se.zoom+1,gt,Et,Se.wrap,Se.minZ,Se.maxZ,this.projection),zoom:Se.zoom+1,x:gt,y:Et,wrap:Se.wrap,fullyVisible:$e,tileID:void 0,shouldSplit:void 0,minZ:Se.minZ,maxZ:Se.maxZ};_&&!P&&(pt.tileID=new s.OverscaledTileID(Se.zoom+1===Ae?We:Se.zoom+1,Se.wrap,Se.zoom+1,gt,Et),ke(pt)),xe.push(pt)}else{const Ye=Se.zoom===Ae?We:Se.zoom;if(o.minzoom&&o.minzoom>Ye)continue;const gt=z[0]-(.5+Be+(Se.wrap<{const $e=[0,0,0,1],Ye=[s.EXTENT,s.EXTENT,0,1],gt=this.calculateFogTileMatrix(Xe.tileID.toUnwrapped());s.transformMat4$1($e,$e,gt),s.transformMat4$1(Ye,Ye,gt);const Et=s.getAABBPointSquareDist($e,Ye);if(Et===0)return!0;let pt=!1;const wt=this._elevation;if(wt&&Et>Se&&Be!==0){const Ut=this.calculateProjMatrix(Xe.tileID.toUnwrapped());let Ot;o.isTerrainDEM||(Ot=wt.getMinMaxForTile(Xe.tileID)),Ot||(Ot={min:ee,max:Q});const mt=s.furthestTileCorner(this.rotation),en=[mt[0]*s.EXTENT,mt[1]*s.EXTENT,Ot.max];s.transformMat4(en,en,Ut),pt=(1-en[1])*this.height*.5Se.distanceSq-Be.distanceSq).map(Se=>Se.tileID)}resize(o,c){this.width=o,this.height=c,this.pixelsToGLUnits=[2/o,-2/c],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(o){return Math.pow(2,o)}scaleZoom(o){return Math.log(o)/Math.LN2}project(o){const c=s.clamp(o.lat,-s.MAX_MERCATOR_LATITUDE,s.MAX_MERCATOR_LATITUDE),f=this.projection.project(o.lng,c);return new s.Point(f.x*this.worldSize,f.y*this.worldSize)}unproject(o){return this.projection.unproject(o.x/this.worldSize,o.y/this.worldSize)}get point(){return this.project(this.center)}get pointMerc(){return this.point._div(this.worldSize)}get pixelsPerMeterRatio(){return this.pixelsPerMeter/s.mercatorZfromAltitude(1,this.center.lat)/this.worldSize}setLocationAtPoint(o,c){let f,_;const x=this.centerPoint;if(this.projection.name==="globe"){const S=this.worldSize;f=(c.x-x.x)/S,_=(c.y-x.y)/S}else{const S=this.pointCoordinate(c),C=this.pointCoordinate(x);f=S.x-C.x,_=S.y-C.y}const T=this.locationCoordinate(o);this.setLocation(new s.MercatorCoordinate(T.x-f,T.y-_))}setLocation(o){this.center=this.coordinateLocation(o),this.projection.wrap&&(this.center=this.center.wrap())}locationPoint(o){return this.projection.locationPoint(this,o)}locationPoint3D(o){return this.projection.locationPoint(this,o,!0)}pointLocation(o){return this.coordinateLocation(this.pointCoordinate(o))}pointLocation3D(o){return this.coordinateLocation(this.pointCoordinate3D(o))}locationCoordinate(o,c){const f=c?s.mercatorZfromAltitude(c,o.lat):void 0,_=this.projection.project(o.lng,o.lat);return new s.MercatorCoordinate(_.x,_.y,f)}coordinateLocation(o){return this.projection.unproject(o.x,o.y)}pointRayIntersection(o,c){const f=c??this._centerAltitude,_=[o.x,o.y,0,1],x=[o.x,o.y,1,1];s.transformMat4$1(_,_,this.pixelMatrixInverse),s.transformMat4$1(x,x,this.pixelMatrixInverse);const T=x[3];s.scale$1(_,_,1/_[3]),s.scale$1(x,x,1/T);const S=_[2],C=x[2];return{p0:_,p1:x,t:S===C?0:(f-S)/(C-S)}}screenPointToMercatorRay(o){const c=[o.x,o.y,0,1],f=[o.x,o.y,1,1];return s.transformMat4$1(c,c,this.pixelMatrixInverse),s.transformMat4$1(f,f,this.pixelMatrixInverse),s.scale$1(c,c,1/c[3]),s.scale$1(f,f,1/f[3]),c[2]=s.mercatorZfromAltitude(c[2],this._center.lat)*this.worldSize,f[2]=s.mercatorZfromAltitude(f[2],this._center.lat)*this.worldSize,s.scale$1(c,c,1/this.worldSize),s.scale$1(f,f,1/this.worldSize),new s.Ray([c[0],c[1],c[2]],s.normalize([],s.sub([],f,c)))}rayIntersectionCoordinate(o){const{p0:c,p1:f,t:_}=o,x=s.mercatorZfromAltitude(c[2],this._center.lat),T=s.mercatorZfromAltitude(f[2],this._center.lat);return new s.MercatorCoordinate(s.number(c[0],f[0],_)/this.worldSize,s.number(c[1],f[1],_)/this.worldSize,s.number(x,T,_))}pointCoordinate(o,c=this._centerAltitude){return this.projection.pointCoordinate(this,o.x,o.y,c)}pointCoordinate3D(o){if(!this.elevation)return this.pointCoordinate(o);let c=this.projection.pointCoordinate3D(this,o.x,o.y);if(c)return new s.MercatorCoordinate(c[0],c[1],c[2]);let f=0,_=this.horizonLineFromTop();if(o.y>_)return this.pointCoordinate(o);const x=.02*_,T=o.clone();for(let S=0;S<10&&_-f>x;S++){T.y=s.number(f,_,.66);const C=this.projection.pointCoordinate3D(this,T.x,T.y);C?(_=T.y,c=C):f=T.y}return c?new s.MercatorCoordinate(c[0],c[1],c[2]):this.pointCoordinate(o)}isPointAboveHorizon(o){return this.projection.isPointAboveHorizon(this,o)}isPointOnSurface(o){if(o.y<0||o.y>this.height||o.x<0||o.x>this.width)return!1;if(this.elevation||this.zoom>=s.GLOBE_ZOOM_THRESHOLD_MAX)return!this.isPointAboveHorizon(o);const c=this.pointCoordinate(o);return c.y>=0&&c.y<=1}_coordinatePoint(o,c){const f=c&&this.elevation?this.elevation.getAtPointOrZero(o,this._centerAltitude):this._centerAltitude,_=[o.x*this.worldSize,o.y*this.worldSize,f+o.toAltitude(),1];return s.transformMat4$1(_,_,this.pixelMatrix),_[3]>0?new s.Point(_[0]/_[3],_[1]/_[3]):new s.Point(Number.MAX_VALUE,Number.MAX_VALUE)}_getBoundsNonRectangular(){const{top:o,left:c}=this._edgeInsets,f=this.height-this._edgeInsets.bottom,_=this.width-this._edgeInsets.right,x=this.pointLocation3D(new s.Point(c,o)),T=this.pointLocation3D(new s.Point(_,o)),S=this.pointLocation3D(new s.Point(_,f)),C=this.pointLocation3D(new s.Point(c,f));let z=Math.min(x.lng,T.lng,S.lng,C.lng),P=Math.max(x.lng,T.lng,S.lng,C.lng),O=Math.min(x.lat,T.lat,S.lat,C.lat),j=Math.max(x.lat,T.lat,S.lat,C.lat);const W=Math.pow(2,-this.zoom)/16*270,H=this.projection.name==="globe"?1:4,Z=(X,B,q,Q,ee)=>{const de=(X+q)/2,fe=(B+Q)/2,pe=new s.Point(de,fe),{lng:xe,lat:ye}=this.pointLocation3D(pe),Ae=Math.max(0,z-xe,O-ye,xe-P,ye-j);z=Math.min(z,xe),P=Math.max(P,xe),O=Math.min(O,ye),j=Math.max(j,ye),(eeW)&&(Z(X,B,de,fe,ee+1),Z(de,fe,q,Q,ee+1))};if(Z(c,o,_,o,1),Z(_,o,_,f,1),Z(_,f,c,f,1),Z(c,f,c,o,1),this.projection.name==="globe"){const[X,B]=s.polesInViewport(this);X?(j=90,P=180,z=-180):B&&(O=-90,P=180,z=-180)}return new s.LngLatBounds(new s.LngLat(z,O),new s.LngLat(P,j))}_getBoundsRectangular(o,c){const{top:f,left:_}=this._edgeInsets,x=this.height-this._edgeInsets.bottom,T=this.width-this._edgeInsets.right,S=new s.Point(_,f),C=new s.Point(T,f),z=new s.Point(T,x),P=new s.Point(_,x);let O=this.pointCoordinate(S,o),j=this.pointCoordinate(C,o);const W=this.pointCoordinate(z,c),H=this.pointCoordinate(P,c),Z=(X,B)=>(B.y-X.y)/(B.x-X.x);return O.y>1&&j.y>=0?O=new s.MercatorCoordinate((1-H.y)/Z(H,O)+H.x,1):O.y<0&&j.y<=1&&(O=new s.MercatorCoordinate(-H.y/Z(H,O)+H.x,0)),j.y>1&&O.y>=0?j=new s.MercatorCoordinate((1-W.y)/Z(W,j)+W.x,1):j.y<0&&O.y<=1&&(j=new s.MercatorCoordinate(-W.y/Z(W,j)+W.x,0)),new s.LngLatBounds().extend(this.coordinateLocation(O)).extend(this.coordinateLocation(j)).extend(this.coordinateLocation(H)).extend(this.coordinateLocation(W))}_getBoundsRectangularTerrain(){const o=this.elevation;if(!o.visibleDemTiles.length||o.isUsingMockSource())return this._getBoundsRectangular(0,0);const c=o.visibleDemTiles.reduce((f,_)=>{if(_.dem){const x=_.dem.tree;f.min=Math.min(f.min,x.minimums[0]),f.max=Math.max(f.max,x.maximums[0])}return f},{min:Number.MAX_VALUE,max:0});return this._getBoundsRectangular(c.min*o.exaggeration(),c.max*o.exaggeration())}getBounds(){return this.projection.name==="mercator"||this.projection.name==="equirectangular"?this._terrainEnabled()?this._getBoundsRectangularTerrain():this._getBoundsRectangular(0,0):this._getBoundsNonRectangular()}horizonLineFromTop(o=!0){const c=this.height/2/Math.tan(this._fov/2)/Math.tan(Math.max(this._pitch,.1))+this.centerOffset.y,f=this.height/2-c*(1-this._horizonShift);return o?Math.max(0,f):f}getMaxBounds(){return this.maxBounds}setMaxBounds(o){this.maxBounds=o,this.minLat=-s.MAX_MERCATOR_LATITUDE,this.maxLat=s.MAX_MERCATOR_LATITUDE,this.minLng=-180,this.maxLng=180,o&&(this.minLat=o.getSouth(),this.maxLat=o.getNorth(),this.minLng=o.getWest(),this.maxLng=o.getEast(),this.maxLngO&&(S=O-z),O-PW&&(T=W-C),W-j.5?Q-1:Q,ee>.5?ee-1:ee,0]),this.alignedProjMatrix=de,S=s.create(),s.scale(S,S,[this.width/2,-this.height/2,1]),s.translate(S,S,[1,-1,0]),this.labelPlaneMatrix=S,S=s.create(),s.scale(S,S,[1,-1,1]),s.translate(S,S,[-1,-1,0]),s.scale(S,S,[2/this.width,2/this.height,1]),this.glCoordMatrix=S,this.pixelMatrix=s.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),this._calcFogMatrices(),this._distanceTileDataCache={},S=s.invert(new Float64Array(16),this.pixelMatrix),!S)throw new Error("failed to invert matrix");if(this.pixelMatrixInverse=S,this.projection.name==="globe"||this.mercatorFromTransition){this.globeMatrix=s.calculateGlobeMatrix(this);const fe=[this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]];this.globeCenterInViewSpace=s.transformMat4(fe,fe,x),this.globeRadius=this.worldSize/2/Math.PI-1}else this.globeMatrix=S;this._projMatrixCache={},this._alignedProjMatrixCache={},this._pixelsToTileUnitsCache={}}_calcFogMatrices(){this._fogTileMatrixCache={};const o=this.cameraWorldSizeForFog,c=this.cameraPixelsPerMeter,f=this._camera.position,_=1/this.height/this._pixelsPerMercatorPixel,x=[o,o,c];s.scale$2(x,x,_),s.scale$2(f,f,-1),s.multiply$2(f,f,x);const T=s.create();s.translate(T,T,f),s.scale(T,T,x),this.mercatorFogMatrix=T,this.worldToFogMatrix=this._camera.getWorldToCameraPosition(o,c,_)}_computeCameraPosition(o){const c=(o=o||this.pixelsPerMeter)/this.pixelsPerMeter,f=this._camera.forward(),_=this.point,x=this._mercatorZfromZoom(this._seaLevelZoom?this._seaLevelZoom:this._zoom)*c-o/this.worldSize*this._centerAltitude;return[_.x/this.worldSize-f[0]*x,_.y/this.worldSize-f[1]*x,o/this.worldSize*this._centerAltitude-f[2]*x]}_updateCameraState(){this.height&&(this._camera.setPitchBearing(this._pitch,this.angle),this._camera.position=this._computeCameraPosition())}_translateCameraConstrained(o){const c=this._maxCameraBoundsDistance()*Math.cos(this._pitch),f=this._camera.position[2],_=o[2];let x=1;this.projection.wrap&&(this.center=this.center.wrap()),_>0&&(x=Math.min((c-f)/_,1)),this._camera.position=s.scaleAndAdd([],this._camera.position,o,x),this._updateStateFromCamera()}_updateStateFromCamera(){const o=this._camera.position,c=this._camera.forward(),{pitch:f,bearing:_}=this._camera.getPitchBearing(),x=s.mercatorZfromAltitude(this._centerAltitude,this.center.lat)*this._pixelsPerMercatorPixel,T=this._mercatorZfromZoom(this._maxZoom)*Math.cos(s.degToRad(this._maxPitch)),S=Math.max((o[2]-x)/Math.cos(f),T),C=this._zoomFromMercatorZ(S);s.scaleAndAdd(o,o,c,S),this._pitch=s.clamp(f,s.degToRad(this.minPitch),s.degToRad(this.maxPitch)),this.angle=s.wrap(_,-Math.PI,Math.PI),this._setZoom(s.clamp(C,this._minZoom,this._maxZoom)),this._updateSeaLevelZoom(),this._center=this.coordinateLocation(new s.MercatorCoordinate(o[0],o[1],o[2])),this._unmodified=!1,this._constrain(),this._calcMatrices()}_worldSizeFromZoom(o){return Math.pow(2,o)*this.tileSize}_mercatorZfromZoom(o){return this.cameraToCenterDistance/this._worldSizeFromZoom(o)}_minimumHeightOverTerrain(){const o=Math.min((this._seaLevelZoom!=null?this._seaLevelZoom:this._zoom)+4,this._maxZoom);return this._mercatorZfromZoom(o)}_zoomFromMercatorZ(o){return this.scaleZoom(this.cameraToCenterDistance/(o*this.tileSize))}zoomFromMercatorZAdjusted(o){let c=0,f=s.GLOBE_ZOOM_THRESHOLD_MAX,_=0,x=1/0;for(;f-c>1e-6&&f>c;){const T=c+.5*(f-c),S=this.tileSize*Math.pow(2,T),C=this.getCameraToCenterDistance(this.projection,T,S),z=this.scaleZoom(C/(o*this.tileSize)),P=Math.abs(T-z);Pz||j.y>1)return!0}return!1}isHorizonVisible(){return this.pitch+s.radToDeg(this.fovAboveCenter)>88||this.anyCornerOffEdge(new s.Point(0,0),new s.Point(this.width,this.height))}zoomDeltaToMovement(o,c){const f=s.length(s.sub([],this._camera.position,o)),_=this._zoomFromMercatorZ(f)+c;return f-this._mercatorZfromZoom(_)}getCameraPoint(){if(this.projection.name==="globe"){const o=function([c,f,_],x){const T=[c,f,_,1];s.transformMat4$1(T,T,x);const S=T[3]=Math.max(T[3],1e-6);return T[0]/=S,T[1]/=S,T[2]/=S,T}([this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]],this.pixelMatrix);return new s.Point(o[0],o[1])}{const o=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new s.Point(0,o))}}getCameraToCenterDistance(o,c=this.zoom,f=this.worldSize){const _=Zc(o,c,this.width,this.height,1024),x=o.pixelSpaceConversion(this.center.lat,f,_);return .5/Math.tan(.5*this._fov)*this.height*x}getWorldToCameraMatrix(){const o=this._camera.getWorldToCamera(this.worldSize,this.projection.zAxisUnit==="meters"?this.pixelsPerMeter:1);return this.projection.name==="globe"&&s.multiply(o,o,this.globeMatrix),o}}function Sa(d,o){let c=!1,f=null;const _=()=>{f=null,c&&(d(),f=setTimeout(_,o),c=!1)};return()=>(c=!0,f||_(),f)}class ed{constructor(o){this._hashName=o&&encodeURIComponent(o),s.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=Sa(this._updateHashUnthrottled.bind(this),300)}addTo(o){return this._map=o,s.window.addEventListener("hashchange",this._onHashChange,!1),o.on("moveend",this._updateHash),this}remove(){return this._map?(this._map.off("moveend",this._updateHash),s.window.removeEventListener("hashchange",this._onHashChange,!1),clearTimeout(this._updateHash()),this._map=void 0,this):this}getHashString(){const o=this._map;if(!o)return"";const c=Bl(o);if(this._hashName){const f=this._hashName;let _=!1;const x=s.window.location.hash.slice(1).split("&").map(T=>{const S=T.split("=")[0];return S===f?(_=!0,`${S}=${c}`):T}).filter(T=>T);return _||x.push(`${f}=${c}`),`#${x.join("&")}`}return`#${c}`}_getCurrentHash(){const o=s.window.location.hash.replace("#","");if(this._hashName){let c;return o.split("&").map(f=>f.split("=")).forEach(f=>{f[0]===this._hashName&&(c=f)}),(c&&c[1]||"").split("/")}return o.split("/")}_onHashChange(){const o=this._map;if(!o)return!1;const c=this._getCurrentHash();if(c.length>=3&&!c.some(f=>isNaN(f))){const f=o.dragRotate.isEnabled()&&o.touchZoomRotate.isEnabled()?+(c[3]||0):o.getBearing();return o.jumpTo({center:[+c[2],+c[1]],zoom:+c[0],bearing:f,pitch:+(c[4]||0)}),!0}return!1}_updateHashUnthrottled(){const o=s.window.location.href.replace(/(#.+)?$/,this.getHashString());s.window.history.replaceState(s.window.history.state,null,o)}}function Bl(d,o){const c=d.getCenter(),f=Math.round(100*d.getZoom())/100,_=Math.ceil((f*Math.LN2+Math.log(512/360/.5))/Math.LN10),x=Math.pow(10,_),T=Math.round(c.lng*x)/x,S=Math.round(c.lat*x)/x,C=d.getBearing(),z=d.getPitch();let P=o?`/${T}/${S}/${f}`:`${f}/${S}/${T}`;return(C||z)&&(P+="/"+Math.round(10*C)/10),z&&(P+=`/${Math.round(z)}`),P}const Fl={linearity:.3,easing:s.bezier(0,0,.3,1)},Xc=s.extend({deceleration:2500,maxSpeed:1400},Fl),Kc=s.extend({deceleration:20,maxSpeed:1400},Fl),ct=s.extend({deceleration:1e3,maxSpeed:360},Fl),Di=s.extend({deceleration:1e3,maxSpeed:90},Fl);class Rf{constructor(o){this._map=o,this.clear()}clear(){this._inertiaBuffer=[]}record(o){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:s.exported.now(),settings:o})}_drainInertiaBuffer(){const o=this._inertiaBuffer,c=s.exported.now();for(;o.length>0&&c-o[0].time>160;)o.shift()}_onMoveEnd(o){if(this._map._prefersReducedMotion()||(this._drainInertiaBuffer(),this._inertiaBuffer.length<2))return;const c={zoom:0,bearing:0,pitch:0,pan:new s.Point(0,0),pinchAround:void 0,around:void 0};for(const{settings:x}of this._inertiaBuffer)c.zoom+=x.zoomDelta||0,c.bearing+=x.bearingDelta||0,c.pitch+=x.pitchDelta||0,x.panDelta&&c.pan._add(x.panDelta),x.around&&(c.around=x.around),x.pinchAround&&(c.pinchAround=x.pinchAround);const f=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,_={};if(c.pan.mag()){const x=Ul(c.pan.mag(),f,s.extend({},Xc,o||{}));_.offset=c.pan.mult(x.amount/c.pan.mag()),_.center=this._map.transform.center,Nl(_,x)}if(c.zoom){const x=Ul(c.zoom,f,Kc);_.zoom=this._map.transform.zoom+x.amount,Nl(_,x)}if(c.bearing){const x=Ul(c.bearing,f,ct);_.bearing=this._map.transform.bearing+s.clamp(x.amount,-179,179),Nl(_,x)}if(c.pitch){const x=Ul(c.pitch,f,Di);_.pitch=this._map.transform.pitch+x.amount,Nl(_,x)}if(_.zoom||_.bearing){const x=c.pinchAround===void 0?c.around:c.pinchAround;_.around=x?this._map.unproject(x):this._map.getCenter()}return this.clear(),_.noMoveStart=!0,_}}function Nl(d,o){(!d.duration||d.durationc.unproject(C)),S=x.reduce((C,z,P,O)=>C.add(z.div(O.length)),new s.Point(0,0));super(o,{points:x,point:S,lngLats:T,lngLat:c.unproject(S),originalEvent:f}),this._defaultPrevented=!1}}class Yc extends s.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(o,c,f){super(o,{originalEvent:f}),this._defaultPrevented=!1}}class td{constructor(o,c){this._map=o,this._clickTolerance=c.clickTolerance}reset(){this._mousedownPos=void 0}wheel(o){return this._firePreventable(new Yc(o.type,this._map,o))}mousedown(o,c){return this._mousedownPos=c,this._firePreventable(new pr(o.type,this._map,o))}mouseup(o){this._map.fire(new pr(o.type,this._map,o))}preclick(o){const c=s.extend({},o);c.type="preclick",this._map.fire(new pr(c.type,this._map,c))}click(o,c){this._mousedownPos&&this._mousedownPos.dist(c)>=this._clickTolerance||(this.preclick(o),this._map.fire(new pr(o.type,this._map,o)))}dblclick(o){return this._firePreventable(new pr(o.type,this._map,o))}mouseover(o){this._map.fire(new pr(o.type,this._map,o))}mouseout(o){this._map.fire(new pr(o.type,this._map,o))}touchstart(o){return this._firePreventable(new jl(o.type,this._map,o))}touchmove(o){this._map.fire(new jl(o.type,this._map,o))}touchend(o){this._map.fire(new jl(o.type,this._map,o))}touchcancel(o){this._map.fire(new jl(o.type,this._map,o))}_firePreventable(o){if(this._map.fire(o),o.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Jc{constructor(o){this._map=o}reset(){this._delayContextMenu=!1,this._contextMenuEvent=void 0}mousemove(o){this._map.fire(new pr(o.type,this._map,o))}mousedown(){this._delayContextMenu=!0}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new pr("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(o){this._delayContextMenu?this._contextMenuEvent=o:this._map.fire(new pr(o.type,this._map,o)),this._map.listens("contextmenu")&&o.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Df{constructor(o,c){this._map=o,this._el=o.getCanvasContainer(),this._container=o.getContainer(),this._clickTolerance=c.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(o,c){this.isEnabled()&&o.shiftKey&&o.button===0&&(ie(),this._startPos=this._lastPos=c,this._active=!0)}mousemoveWindow(o,c){if(!this._active)return;const f=c,_=this._startPos,x=this._lastPos;if(!_||!x||x.equals(f)||!this._box&&f.dist(_){this._box&&(this._box.style.transform=`translate(${T}px,${C}px)`,this._box.style.width=S-T+"px",this._box.style.height=z-C+"px")})}mouseupWindow(o,c){if(!this._active)return;const f=this._startPos,_=c;if(f&&o.button===0){if(this.reset(),ze(),f.x!==_.x||f.y!==_.y)return this._map.fire(new s.Event("boxzoomend",{originalEvent:o})),{cameraAnimation:x=>x.fitScreenCoordinates(f,_,this._map.getBearing(),{linear:!1})};this._fireEvent("boxzoomcancel",o)}}keydown(o){this._active&&o.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",o))}blur(){this.reset()}reset(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.remove(),this._box=null),te(),delete this._startPos,delete this._lastPos}_fireEvent(o,c){return this._map.fire(new s.Event(o,{originalEvent:c}))}}function Qc(d,o){const c={};for(let f=0;fthis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===0&&(this.startTime=o.timeStamp),f.length===this.numTouches&&(this.centroid=function(_){const x=new s.Point(0,0);for(const T of _)x._add(T);return x.div(_.length)}(c),this.touches=Qc(f,c)))}touchmove(o,c,f){if(this.aborted||!this.centroid)return;const _=Qc(f,c);for(const x in this.touches){const T=_[x];(!T||T.dist(this.touches[x])>30)&&(this.aborted=!0)}}touchend(o,c,f){if((!this.centroid||o.timeStamp-this.startTime>500)&&(this.aborted=!0),f.length===0){const _=!this.aborted&&this.centroid;if(this.reset(),_)return _}}}class nd{constructor(o){this.singleTap=new Aa(o),this.numTaps=o.numTaps,this.reset()}reset(){this.lastTime=1/0,this.lastTap=void 0,this.count=0,this.singleTap.reset()}touchstart(o,c,f){this.singleTap.touchstart(o,c,f)}touchmove(o,c,f){this.singleTap.touchmove(o,c,f)}touchend(o,c,f){const _=this.singleTap.touchend(o,c,f);if(_){const x=o.timeStamp-this.lastTime<500,T=!this.lastTap||this.lastTap.dist(_)<30;if(x&&T||this.reset(),this.count++,this.lastTime=o.timeStamp,this.lastTap=_,this.count===this.numTaps)return this.reset(),_}}}class iy{constructor(){this._zoomIn=new nd({numTouches:1,numTaps:2}),this._zoomOut=new nd({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(o,c,f){this._zoomIn.touchstart(o,c,f),this._zoomOut.touchstart(o,c,f)}touchmove(o,c,f){this._zoomIn.touchmove(o,c,f),this._zoomOut.touchmove(o,c,f)}touchend(o,c,f){const _=this._zoomIn.touchend(o,c,f),x=this._zoomOut.touchend(o,c,f);return _?(this._active=!0,o.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:T=>T.easeTo({duration:300,zoom:T.getZoom()+1,around:T.unproject(_)},{originalEvent:o})}):x?(this._active=!0,o.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:T=>T.easeTo({duration:300,zoom:T.getZoom()-1,around:T.unproject(x)},{originalEvent:o})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}const Of={0:1,2:2};class Ca{constructor(o){this.reset(),this._clickTolerance=o.clickTolerance||1}blur(){this.reset()}reset(){this._active=!1,this._moved=!1,this._lastPoint=void 0,this._eventButton=void 0}_correctButton(o,c){return!1}_move(o,c){return{}}mousedown(o,c){if(this._lastPoint)return;const f=He(o);this._correctButton(o,f)&&(this._lastPoint=c,this._eventButton=f)}mousemoveWindow(o,c){const f=this._lastPoint;if(f){if(o.preventDefault(),this._eventButton!=null&&function(_,x){const T=Of[x];return _.buttons===void 0||(_.buttons&T)!==T}(o,this._eventButton))this.reset();else if(this._moved||!(c.dist(f)0&&(this._active=!0);const _=Qc(f,c),x=new s.Point(0,0),T=new s.Point(0,0);let S=0;for(const z in _){const P=_[z],O=this._touches[z];O&&(x._add(P),T._add(P.sub(O)),S++,_[z]=P)}if(this._touches=_,S{this._alertContainer.classList.remove("mapboxgl-touch-pan-blocker-show"),this._alertContainer.setAttribute("role","null")},500)}}class Vl{constructor(){this.reset()}reset(){this._active=!1,this._firstTwoTouches=void 0}_start(o){}_move(o,c,f){return{}}touchstart(o,c,f){this._firstTwoTouches||f.length<2||(this._firstTwoTouches=[f[0].identifier,f[1].identifier],this._start([c[0],c[1]]))}touchmove(o,c,f){const _=this._firstTwoTouches;if(!_)return;o.preventDefault();const[x,T]=_,S=$l(f,c,x),C=$l(f,c,T);if(!S||!C)return;const z=this._aroundCenter?null:S.add(C).div(2);return this._move([S,C],z,o)}touchend(o,c,f){if(!this._firstTwoTouches)return;const[_,x]=this._firstTwoTouches,T=$l(f,c,_),S=$l(f,c,x);T&&S||(this._active&&ze(),this.reset())}touchcancel(){this.reset()}enable(o){this._enabled=!0,this._aroundCenter=!!o&&o.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function $l(d,o,c){for(let f=0;fMath.abs(d.x)}class Nf extends Vl{constructor(o){super(),this._map=o}reset(){super.reset(),this._valid=void 0,this._firstMove=void 0,this._lastPoints=void 0}_start(o){this._lastPoints=o,rs(o[0].sub(o[1]))&&(this._valid=!1)}_move(o,c,f){const _=this._lastPoints;if(!_)return;const x=o[0].sub(_[0]),T=o[1].sub(_[1]);return this._map._cooperativeGestures&&!s.isFullscreen()&&f.touches.length<3||(this._valid=this.gestureBeginsVertically(x,T,f.timeStamp),!this._valid)?void 0:(this._lastPoints=o,this._active=!0,{pitchDelta:(x.y+T.y)/2*-.5})}gestureBeginsVertically(o,c,f){if(this._valid!==void 0)return this._valid;const _=o.mag()>=2,x=c.mag()>=2;if(!_&&!x)return;if(!_||!x)return this._firstMove==null&&(this._firstMove=f),f-this._firstMove<100&&void 0;const T=o.y>0==c.y>0;return rs(o)&&rs(c)&&T}}const Uf={panStep:100,bearingStep:15,pitchStep:10};class oy{constructor(){const o=Uf;this._panStep=o.panStep,this._bearingStep=o.bearingStep,this._pitchStep=o.pitchStep,this._rotationDisabled=!1}blur(){this.reset()}reset(){this._active=!1}keydown(o){if(o.altKey||o.ctrlKey||o.metaKey)return;let c=0,f=0,_=0,x=0,T=0;switch(o.keyCode){case 61:case 107:case 171:case 187:c=1;break;case 189:case 109:case 173:c=-1;break;case 37:o.shiftKey?f=-1:(o.preventDefault(),x=-1);break;case 39:o.shiftKey?f=1:(o.preventDefault(),x=1);break;case 38:o.shiftKey?_=1:(o.preventDefault(),T=-1);break;case 40:o.shiftKey?_=-1:(o.preventDefault(),T=1);break;default:return}return this._rotationDisabled&&(f=0,_=0),{cameraAnimation:S=>{const C=S.getZoom();S.easeTo({duration:300,easeId:"keyboardHandler",easing:jf,zoom:c?Math.round(C)+c*(o.shiftKey?2:1):C,bearing:S.getBearing()+f*this._bearingStep,pitch:S.getPitch()+_*this._pitchStep,offset:[-x*this._panStep,-T*this._panStep],center:S.getCenter()},{originalEvent:o})}}}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 jf(d){return d*(2-d)}const ld=4.000244140625;class Vf{constructor(o,c){this._map=o,this._el=o.getCanvasContainer(),this._handler=c,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,s.bindAll(["_onTimeout","_addScrollZoomBlocker","_showBlockerAlert"],this)}setZoomRate(o){this._defaultZoomRate=o}setWheelZoomRate(o){this._wheelZoomRate=o}isEnabled(){return!!this._enabled}isActive(){return this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(o){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!o&&o.around==="center",this._map._cooperativeGestures&&this._addScrollZoomBlocker())}disable(){this.isEnabled()&&(this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove()))}wheel(o){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!(o.ctrlKey||o.metaKey||this.isZooming()||s.isFullscreen()))return void this._showBlockerAlert();this._alertContainer.style.visibility!=="hidden"&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}let c=o.deltaMode===s.window.WheelEvent.DOM_DELTA_LINE?40*o.deltaY:o.deltaY;const f=s.exported.now(),_=f-(this._lastWheelEventTime||0);this._lastWheelEventTime=f,c!==0&&c%ld==0?this._type="wheel":c!==0&&Math.abs(c)<4?this._type="trackpad":_>400?(this._type=null,this._lastValue=c,this._timeout=setTimeout(this._onTimeout,40,o)):this._type||(this._type=Math.abs(_*c)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,c+=this._lastValue)),o.shiftKey&&c&&(c/=4),this._type&&(this._lastWheelEvent=o,this._delta-=c,this._active||this._start(o)),o.preventDefault()}_onTimeout(o){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(o)}_start(o){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 c=Oe(this._el,o);this._aroundPoint=this._aroundCenter?this._map.transform.centerPoint:c,this._aroundCoord=this._map.transform.pointCoordinate3D(this._aroundPoint),this._targetZoom=void 0,this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const o=this._map.transform;this._type==="wheel"&&o.projection.wrap&&(o._center.lng>=180||o._center.lng<=-180)&&(this._prevEase=null,this._easing=null,this._lastWheelEvent=null,this._lastWheelEventTime=0);const c=()=>o._terrainEnabled()&&this._aroundCoord?o.computeZoomRelativeTo(this._aroundCoord):o.zoom;if(this._delta!==0){const C=this._type==="wheel"&&Math.abs(this._delta)>ld?this._wheelZoomRate:this._defaultZoomRate;let z=2/(1+Math.exp(-Math.abs(this._delta*C)));this._delta<0&&z!==0&&(z=1/z);const P=c(),O=Math.pow(2,P),j=typeof this._targetZoom=="number"?o.zoomScale(this._targetZoom):O;this._targetZoom=Math.min(o.maxZoom,Math.max(o.minZoom,o.scaleZoom(j*z))),this._type==="wheel"&&(this._startZoom=P,this._easing=this._smoothOutEasing(200)),this._delta=0}const f=typeof this._targetZoom=="number"?this._targetZoom:c(),_=this._startZoom,x=this._easing;let T,S=!1;if(this._type==="wheel"&&_&&x){const C=Math.min((s.exported.now()-this._lastWheelEventTime)/200,1),z=x(C);T=s.number(_,f,z),C<1?this._frameId||(this._frameId=!0):S=!0}else T=f,S=!0;return this._active=!0,S&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!S,zoomDelta:T-c(),around:this._aroundPoint,aroundCoord:this._aroundCoord,originalEvent:this._lastWheelEvent}}_smoothOutEasing(o){let c=s.ease;if(this._prevEase){const f=this._prevEase,_=(s.exported.now()-f.start)/f.duration,x=f.easing(_+.01)-f.easing(_),T=.27/Math.sqrt(x*x+1e-4)*.01,S=Math.sqrt(.0729-T*T);c=s.bezier(T,S,.25,1)}return this._prevEase={start:s.exported.now(),duration:o,easing:c},c}blur(){this.reset()}reset(){this._active=!1}_addScrollZoomBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=J("div","mapboxgl-scroll-zoom-blocker",this._map._container),this._alertContainer.textContent=/(Mac|iPad)/i.test(s.window.navigator.userAgent)?this._map._getUIString("ScrollZoomBlocker.CmdMessage"):this._map._getUIString("ScrollZoomBlocker.CtrlMessage"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=setTimeout(()=>{this._alertContainer.classList.remove("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","null")},200)}}class $f{constructor(o,c){this._clickZoom=o,this._tapZoom=c}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 kr{constructor(){this.reset()}reset(){this._active=!1}blur(){this.reset()}dblclick(o,c){return o.preventDefault(),{cameraAnimation:f=>{f.easeTo({duration:300,zoom:f.getZoom()+(o.shiftKey?-1:1),around:f.unproject(c)},{originalEvent:o})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class sy{constructor(){this._tap=new nd({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,this._swipePoint=void 0,this._swipeTouch=0,this._tapTime=0,this._tap.reset()}touchstart(o,c,f){this._swipePoint||(this._tapTime&&o.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?f.length>0&&(this._swipePoint=c[0],this._swipeTouch=f[0].identifier):this._tap.touchstart(o,c,f))}touchmove(o,c,f){if(this._tapTime){if(this._swipePoint){if(f[0].identifier!==this._swipeTouch)return;const _=c[0],x=_.y-this._swipePoint.y;return this._swipePoint=_,o.preventDefault(),this._active=!0,{zoomDelta:x/128}}}else this._tap.touchmove(o,c,f)}touchend(o,c,f){this._tapTime?this._swipePoint&&f.length===0&&this.reset():this._tap.touchend(o,c,f)&&(this._tapTime=o.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Gf{constructor(o,c,f){this._el=o,this._mousePan=c,this._touchPan=f}enable(o){this._inertiaOptions=o||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class ay{constructor(o,c,f){this._pitchWithRotate=o.pitchWithRotate,this._mouseRotate=c,this._mousePitch=f}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 ly{constructor(o,c,f,_){this._el=o,this._touchZoom=c,this._touchRotate=f,this._tapDragZoom=_,this._rotationDisabled=!1,this._enabled=!0}enable(o){this._touchZoom.enable(o),this._rotationDisabled||this._touchRotate.enable(o),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-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()}}const yi=d=>d.zoom||d.drag||d.pitch||d.rotate;class qf extends s.Event{}class cy{constructor(){this.constants=[1,1,.01],this.radius=0}setup(o,c){const f=s.sub([],c,o);this.radius=s.length(f[2]<0?s.div([],f,this.constants):[f[0],f[1],0])}projectRay(o){s.div(o,o,this.constants),s.normalize(o,o),s.mul$1(o,o,this.constants);const c=s.scale$2([],o,this.radius);if(c[2]>0){const f=s.scale$2([],[0,0,1],s.dot(c,[0,0,1])),_=s.scale$2([],s.normalize([],[c[0],c[1],0]),this.radius),x=s.add([],c,s.scale$2([],s.sub([],s.add([],_,f),c),2));c[0]=x[0],c[1]=x[1]}return c}}function Oi(d){return d.panDelta&&d.panDelta.mag()||d.zoomDelta||d.bearingDelta||d.pitchDelta}class ro{constructor(o,c){this._map=o,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Rf(o),this._bearingSnap=c.bearingSnap,this._previousActiveHandlers={},this._trackingEllipsoid=new cy,this._dragOrigin=null,this._eventsInProgress={},this._addDefaultHandlers(c),s.bindAll(["handleEvent","handleWindowEvent"],this);const f=this._el;this._listeners=[[f,"touchstart",{passive:!0}],[f,"touchmove",{passive:!1}],[f,"touchend",void 0],[f,"touchcancel",void 0],[f,"mousedown",void 0],[f,"mousemove",void 0],[f,"mouseup",void 0],[s.window.document,"mousemove",{capture:!0}],[s.window.document,"mouseup",void 0],[f,"mouseover",void 0],[f,"mouseout",void 0],[f,"dblclick",void 0],[f,"click",void 0],[f,"keydown",{capture:!1}],[f,"keyup",void 0],[f,"wheel",{passive:!1}],[f,"contextmenu",void 0],[s.window,"blur",void 0]];for(const[_,x,T]of this._listeners)_.addEventListener(x,_===s.window.document?this.handleWindowEvent:this.handleEvent,T)}destroy(){for(const[o,c,f]of this._listeners)o.removeEventListener(c,o===s.window.document?this.handleWindowEvent:this.handleEvent,f)}_addDefaultHandlers(o){const c=this._map,f=c.getCanvasContainer();this._add("mapEvent",new td(c,o));const _=c.boxZoom=new Df(c,o);this._add("boxZoom",_);const x=new iy,T=new kr;c.doubleClickZoom=new $f(T,x),this._add("tapZoom",x),this._add("clickZoom",T);const S=new sy;this._add("tapDragZoom",S);const C=c.touchPitch=new Nf(c);this._add("touchPitch",C);const z=new id(o),P=new od(o);c.dragRotate=new ay(o,z,P),this._add("mouseRotate",z,["mousePitch"]),this._add("mousePitch",P,["mouseRotate"]);const O=new rd(o),j=new eu(c,o);c.dragPan=new Gf(f,O,j),this._add("mousePan",O),this._add("touchPan",j,["touchZoom","touchRotate"]);const W=new Ff,H=new Bf;c.touchZoomRotate=new ly(f,H,W,S),this._add("touchRotate",W,["touchPan","touchZoom"]),this._add("touchZoom",H,["touchPan","touchRotate"]),this._add("blockableMapEvent",new Jc(c));const Z=c.scrollZoom=new Vf(c,this);this._add("scrollZoom",Z,["mousePan"]);const X=c.keyboard=new oy;this._add("keyboard",X);for(const B of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])o.interactive&&o[B]&&c[B].enable(o[B])}_add(o,c,f){this._handlers.push({handlerName:o,handler:c,allowed:f}),this._handlersById[o]=c}stop(o){if(!this._updatingCamera){for(const{handler:c}of this._handlers)c.reset();this._inertia.clear(),this._fireEvents({},{},o),this._changes=[]}}isActive(){for(const{handler:o}of this._handlers)if(o.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!yi(this._eventsInProgress)||this.isZooming()}_isDragging(){return!!this._eventsInProgress.drag}_blockedByActive(o,c,f){for(const _ in o)if(_!==f&&(!c||c.indexOf(_)<0))return!0;return!1}handleWindowEvent(o){this.handleEvent(o,`${o.type}Window`)}_getMapTouches(o){const c=[];for(const f of o)this._el.contains(f.target)&&c.push(f);return c}handleEvent(o,c){this._updatingCamera=!0;const f=o.type==="renderFrame",_=f?void 0:o,x={needsRenderFrame:!1},T={},S={},C=o.touches?this._getMapTouches(o.touches):void 0,z=C?Ke(this._el,C):f?void 0:Oe(this._el,o);for(const{handlerName:j,handler:W,allowed:H}of this._handlers){if(!W.isEnabled())continue;let Z;this._blockedByActive(S,H,j)?W.reset():W[c||o.type]&&(Z=W[c||o.type](o,z,C),this.mergeHandlerResult(x,T,Z,j,_),Z&&Z.needsRenderFrame&&this._triggerRenderFrame()),(Z||W.isActive())&&(S[j]=W)}const P={};for(const j in this._previousActiveHandlers)S[j]||(P[j]=_);this._previousActiveHandlers=S,(Object.keys(P).length||Oi(x))&&(this._changes.push([x,T,P]),this._triggerRenderFrame()),(Object.keys(S).length||Oi(x))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:O}=x;O&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],O(this._map))}mergeHandlerResult(o,c,f,_,x){if(!f)return;s.extend(o,f);const T={handlerName:_,originalEvent:f.originalEvent||x};f.zoomDelta!==void 0&&(c.zoom=T),f.panDelta!==void 0&&(c.drag=T),f.pitchDelta!==void 0&&(c.pitch=T),f.bearingDelta!==void 0&&(c.rotate=T)}_applyChanges(){const o={},c={},f={};for(const[_,x,T]of this._changes)_.panDelta&&(o.panDelta=(o.panDelta||new s.Point(0,0))._add(_.panDelta)),_.zoomDelta&&(o.zoomDelta=(o.zoomDelta||0)+_.zoomDelta),_.bearingDelta&&(o.bearingDelta=(o.bearingDelta||0)+_.bearingDelta),_.pitchDelta&&(o.pitchDelta=(o.pitchDelta||0)+_.pitchDelta),_.around!==void 0&&(o.around=_.around),_.aroundCoord!==void 0&&(o.aroundCoord=_.aroundCoord),_.pinchAround!==void 0&&(o.pinchAround=_.pinchAround),_.noInertia&&(o.noInertia=_.noInertia),s.extend(c,x),s.extend(f,T);this._updateMapTransform(o,c,f),this._changes=[]}_updateMapTransform(o,c,f){const _=this._map,x=_.transform,T=q=>[q.x,q.y,q.z];if((q=>{const Q=this._eventsInProgress.drag;return Q&&!this._handlersById[Q.handlerName].isActive()})()&&!Oi(o)){const q=x.zoom;x.cameraElevationReference="sea",x.recenterOnTerrain(),x.cameraElevationReference="ground",q!==x.zoom&&this._map._update(!0)}if(x._isCameraConstrained&&_._stop(!0),!Oi(o))return void this._fireEvents(c,f,!0);let{panDelta:S,zoomDelta:C,bearingDelta:z,pitchDelta:P,around:O,aroundCoord:j,pinchAround:W}=o;x._isCameraConstrained&&(C>0&&(C=0),x._isCameraConstrained=!1),W!==void 0&&(O=W),(C||(q=>c[q]&&!this._eventsInProgress[q])("drag"))&&O&&(this._dragOrigin=T(x.pointCoordinate3D(O)),this._trackingEllipsoid.setup(x._camera.position,this._dragOrigin)),x.cameraElevationReference="sea",_._stop(!0),O=O||_.transform.centerPoint,z&&(x.bearing+=z),P&&(x.pitch+=P),x._updateCameraState();const H=[0,0,0];if(S)if(x.projection.name==="mercator"){const q=this._trackingEllipsoid.projectRay(x.screenPointToMercatorRay(O).dir),Q=this._trackingEllipsoid.projectRay(x.screenPointToMercatorRay(O.sub(S)).dir);H[0]=Q[0]-q[0],H[1]=Q[1]-q[1]}else{const q=x.pointCoordinate(O);if(x.projection.name==="globe"){S=S.rotate(-x.angle);const Q=x._pixelsPerMercatorPixel/x.worldSize;H[0]=-S.x*s.mercatorScale(s.latFromMercatorY(q.y))*Q,H[1]=-S.y*s.mercatorScale(x.center.lat)*Q}else{const Q=x.pointCoordinate(O.sub(S));q&&Q&&(H[0]=Q.x-q.x,H[1]=Q.y-q.y)}}const Z=x.zoom,X=[0,0,0];if(C){const q=T(j||x.pointCoordinate3D(O)),Q={dir:s.normalize([],s.sub([],q,x._camera.position))};if(Q.dir[2]<0){const ee=x.zoomDeltaToMovement(q,C);s.scale$2(X,Q.dir,ee)}}const B=s.add(H,H,X);x._translateCameraConstrained(B),C&&Math.abs(x.zoom-Z)>1e-4&&x.recenterOnTerrain(),x.cameraElevationReference="ground",this._map._update(),o.noInertia||this._inertia.record(o),this._fireEvents(c,f,!0)}_fireEvents(o,c,f){const _=yi(this._eventsInProgress),x=yi(o),T={};for(const P in o){const{originalEvent:O}=o[P];this._eventsInProgress[P]||(T[`${P}start`]=O),this._eventsInProgress[P]=o[P]}!_&&x&&this._fireEvent("movestart",x.originalEvent);for(const P in T)this._fireEvent(P,T[P]);x&&this._fireEvent("move",x.originalEvent);for(const P in o){const{originalEvent:O}=o[P];this._fireEvent(P,O)}const S={};let C;for(const P in this._eventsInProgress){const{handlerName:O,originalEvent:j}=this._eventsInProgress[P];this._handlersById[O].isActive()||(delete this._eventsInProgress[P],C=c[O]||j,S[`${P}end`]=C)}for(const P in S)this._fireEvent(P,S[P]);const z=yi(this._eventsInProgress);if(f&&(_||x)&&!z){this._updatingCamera=!0;const P=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),O=j=>j!==0&&-this._bearingSnap{this._frameId=void 0,this.handleEvent(new qf("renderFrame",{timeStamp:o})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}const Ds="map.setFreeCameraOptions(...) and map.getFreeCameraOptions() are not yet supported for non-mercator projections.";class tu extends s.Evented{constructor(o,c){super(),this._moving=!1,this._zooming=!1,this.transform=o,this._bearingSnap=c.bearingSnap,this._respectPrefersReducedMotion=c.respectPrefersReducedMotion!==!1,s.bindAll(["_renderFrameCallback"],this)}getCenter(){return new s.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(o,c){return this.jumpTo({center:o},c)}panBy(o,c,f){return o=s.Point.convert(o).mult(-1),this.panTo(this.transform.center,s.extend({offset:o},c),f)}panTo(o,c,f){return this.easeTo(s.extend({center:o},c),f)}getZoom(){return this.transform.zoom}setZoom(o,c){return this.jumpTo({zoom:o},c),this}zoomTo(o,c,f){return this.easeTo(s.extend({zoom:o},c),f)}zoomIn(o,c){return this.zoomTo(this.getZoom()+1,o,c),this}zoomOut(o,c){return this.zoomTo(this.getZoom()-1,o,c),this}getBearing(){return this.transform.bearing}setBearing(o,c){return this.jumpTo({bearing:o},c),this}getPadding(){return this.transform.padding}setPadding(o,c){return this.jumpTo({padding:o},c),this}rotateTo(o,c,f){return this.easeTo(s.extend({bearing:o},c),f)}resetNorth(o,c){return this.rotateTo(0,s.extend({duration:1e3},o),c),this}resetNorthPitch(o,c){return this.easeTo(s.extend({bearing:0,pitch:0,duration:1e3},o),c),this}snapToNorth(o,c){return Math.abs(this.getBearing())o.aspect?f/(2*Math.tan(.5*o.fovX)*o.aspect):_/(2*Math.tan(.5*o.fovY)*o.aspect)}_cameraForBoundsOnGlobe(o,c,f,_,x,T){const S=o.clone(),C=this._extendCameraOptions(T);S.bearing=_,S.pitch=x;const z=s.LngLat.convert(c),P=s.LngLat.convert(f),O=.5*(z.lat+P.lat),j=.5*(z.lng+P.lng),W=s.latLngToECEF(O,j),H=s.normalize([],W),Z=s.normalize([],s.cross([],H,[0,1,0])),X=s.cross([],Z,H),B=[Z[0],Z[1],Z[2],0,X[0],X[1],X[2],0,H[0],H[1],H[2],0,0,0,0,1],q=[W,s.latLngToECEF(z.lat,z.lng),s.latLngToECEF(P.lat,z.lng),s.latLngToECEF(P.lat,P.lng),s.latLngToECEF(z.lat,P.lng),s.latLngToECEF(O,z.lng),s.latLngToECEF(O,P.lng),s.latLngToECEF(z.lat,j),s.latLngToECEF(P.lat,j)];let Q=s.Aabb.fromPoints(q.map($e=>[s.dot(Z,$e),s.dot(X,$e),s.dot(H,$e)]));const ee=s.transformMat4([],Q.center,B);s.squaredLength(ee)===0&&s.set(ee,0,0,1),s.normalize(ee,ee),s.scale$2(ee,ee,s.GLOBE_RADIUS),S.center=s.ecefToLatLng(ee);const de=S.getWorldToCameraMatrix(),fe=s.invert(new Float64Array(16),de);Q=s.Aabb.applyTransform(Q,s.multiply([],de,B)),s.transformMat4(ee,ee,de);const pe=.5*(Q.max[2]-Q.min[2]),xe=this._minimumAABBFrustumDistance(S,Q),ye=s.scale$2([],[0,0,1],pe),Ae=s.add(ye,ee,ye),We=xe+(S.pitch===0?0:s.distance(ee,Ae)),Ee=S.globeCenterInViewSpace,Fe=s.sub([],ee,[Ee[0],Ee[1],Ee[2]]);s.normalize(Fe,Fe),s.scale$2(Fe,Fe,We);const ke=s.add([],ee,Fe);s.transformMat4(ke,ke,fe);const qe=s.earthRadius/s.GLOBE_RADIUS,Se=s.length(ke),Be=s.mercatorZfromAltitude(Math.max(Se*qe-s.earthRadius,Number.EPSILON),0),Xe=Math.min(S.zoomFromMercatorZAdjusted(Be),C.maxZoom);return Xe>.5*(s.GLOBE_ZOOM_THRESHOLD_MIN+s.GLOBE_ZOOM_THRESHOLD_MAX)?(S.setProjection({name:"mercator"}),S.zoom=Xe,this._cameraForBounds(S,c,f,_,x,T)):{center:S.center,zoom:Xe,bearing:_,pitch:x}}queryTerrainElevation(o,c){const f=this.transform.elevation;return f?(c=s.extend({},{exaggerated:!0},c),f.getAtPoint(s.MercatorCoordinate.fromLngLat(o),null,c.exaggerated)):null}_cameraForBounds(o,c,f,_,x,T){if(o.projection.name==="globe")return this._cameraForBoundsOnGlobe(o,c,f,_,x,T);const S=o.clone(),C=this._extendCameraOptions(T),z=S.padding;S.bearing=_,S.pitch=x;const P=s.LngLat.convert(c),O=s.LngLat.convert(f),j=new s.LngLat(P.lng,O.lat),W=new s.LngLat(O.lng,P.lat),H=S.project(P),Z=S.project(O),X=this.queryTerrainElevation(P),B=this.queryTerrainElevation(O),q=this.queryTerrainElevation(j),Q=this.queryTerrainElevation(W),ee=[[H.x,H.y,Math.min(X||0,B||0,q||0,Q||0)],[Z.x,Z.y,Math.max(X||0,B||0,q||0,Q||0)]];let de=s.Aabb.fromPoints(ee);const fe=S.getWorldToCameraMatrix(),pe=s.invert(new Float64Array(16),fe);de=s.Aabb.applyTransform(de,fe);const xe=s.sub([],de.max,de.min),ye=z.left||0,Ae=z.right||0,We=z.bottom||0,Ee=z.top||0,{left:Fe,right:ke,top:qe,bottom:Se}=C.padding,Be=.5*(ye+Ae),Xe=.5*(Ee+We),$e=Math.min(S.scaleZoom(S.scale*Math.min((S.width-(ye+Ae+Fe+ke))/xe[0],(S.height-(We+Ee+Se+qe))/xe[1])),C.maxZoom),Ye=S.scale/S.zoomScale($e);de=new s.Aabb([de.min[0]-(Fe+Be)*Ye,de.min[1]-(Se+Xe)*Ye,de.min[2]],[de.max[0]+(ke+Be)*Ye,de.max[1]+(qe+Xe)*Ye,de.max[2]]);const gt=.5*xe[2],Et=this._minimumAABBFrustumDistance(S,de),pt=[0,0,1,0];s.transformMat4$1(pt,pt,fe),s.normalize$2(pt,pt);const wt=s.scale$2([],pt,Et+gt),Ut=s.add([],de.center,wt),Ot=(typeof C.offset.x=="number"&&typeof C.offset.y=="number"?new s.Point(C.offset.x,C.offset.y):s.Point.convert(C.offset)).rotate(-s.degToRad(_));de.center[0]-=Ot.x*Ye,de.center[1]+=Ot.y*Ye,s.transformMat4(de.center,de.center,pe),s.transformMat4(Ut,Ut,pe);const mt=[de.center[0],de.center[1],Ut[2]*S.pixelsPerMeter];s.scale$2(mt,mt,1/S.worldSize);const en=s.lngFromMercatorX(mt[0]),rn=s.latFromMercatorY(mt[1]),on=Math.min(S._zoomFromMercatorZ(mt[2]),C.maxZoom),sn=new s.LngLat(en,rn);return S.mercatorFromTransition&&on<.5*(s.GLOBE_ZOOM_THRESHOLD_MIN+s.GLOBE_ZOOM_THRESHOLD_MAX)?(S.setProjection({name:"globe"}),S.zoom=on,this._cameraForBounds(S,c,f,_,x,T)):{center:sn,zoom:on,bearing:_,pitch:x}}fitBounds(o,c,f){const _=this.cameraForBounds(o,c);return this._fitInternal(_,c,f)}fitScreenCoordinates(o,c,f,_,x){const T=s.Point.convert(o),S=s.Point.convert(c),C=new s.Point(Math.min(T.x,S.x),Math.min(T.y,S.y)),z=new s.Point(Math.max(T.x,S.x),Math.max(T.y,S.y));if(this.transform.projection.name==="mercator"&&this.transform.anyCornerOffEdge(T,S))return this;const P=this.transform.pointLocation3D(C),O=this.transform.pointLocation3D(z),j=this.transform.pointLocation3D(new s.Point(C.x,z.y)),W=this.transform.pointLocation3D(new s.Point(z.x,C.y)),H=[Math.min(P.lng,O.lng,j.lng,W.lng),Math.min(P.lat,O.lat,j.lat,W.lat)],Z=[Math.max(P.lng,O.lng,j.lng,W.lng),Math.max(P.lat,O.lat,j.lat,W.lat)],X=_&&_.pitch?_.pitch:this.getPitch(),B=this._cameraForBounds(this.transform,H,Z,f,X,_);return this._fitInternal(B,_,x)}_fitInternal(o,c,f){return o?(delete(c=s.extend(o,c)).padding,c.linear?this.easeTo(c,f):this.flyTo(c,f)):this}jumpTo(o,c){this.stop();const f=o.preloadOnly?this.transform.clone():this.transform;let _=!1,x=!1,T=!1;return"zoom"in o&&f.zoom!==+o.zoom&&(_=!0,f.zoom=+o.zoom),o.center!==void 0&&(f.center=s.LngLat.convert(o.center)),"bearing"in o&&f.bearing!==+o.bearing&&(x=!0,f.bearing=+o.bearing),"pitch"in o&&f.pitch!==+o.pitch&&(T=!0,f.pitch=+o.pitch),o.padding==null||f.isPaddingEqual(o.padding)||(f.padding=o.padding),o.preloadOnly?(this._preloadTiles(f),this):(this.fire(new s.Event("movestart",c)).fire(new s.Event("move",c)),_&&this.fire(new s.Event("zoomstart",c)).fire(new s.Event("zoom",c)).fire(new s.Event("zoomend",c)),x&&this.fire(new s.Event("rotatestart",c)).fire(new s.Event("rotate",c)).fire(new s.Event("rotateend",c)),T&&this.fire(new s.Event("pitchstart",c)).fire(new s.Event("pitch",c)).fire(new s.Event("pitchend",c)),this.fire(new s.Event("moveend",c)))}getFreeCameraOptions(){return this.transform.projection.supportsFreeCamera||s.warnOnce(Ds),this.transform.getFreeCameraOptions()}setFreeCameraOptions(o,c){const f=this.transform;if(!f.projection.supportsFreeCamera)return s.warnOnce(Ds),this;this.stop();const _=f.zoom,x=f.pitch,T=f.bearing;f.setFreeCameraOptions(o);const S=_!==f.zoom,C=x!==f.pitch,z=T!==f.bearing;return this.fire(new s.Event("movestart",c)).fire(new s.Event("move",c)),S&&this.fire(new s.Event("zoomstart",c)).fire(new s.Event("zoom",c)).fire(new s.Event("zoomend",c)),z&&this.fire(new s.Event("rotatestart",c)).fire(new s.Event("rotate",c)).fire(new s.Event("rotateend",c)),C&&this.fire(new s.Event("pitchstart",c)).fire(new s.Event("pitch",c)).fire(new s.Event("pitchend",c)),this.fire(new s.Event("moveend",c)),this}easeTo(o,c){this._stop(!1,o.easeId),((o=s.extend({offset:[0,0],duration:500,easing:s.ease},o)).animate===!1||this._prefersReducedMotion(o))&&(o.duration=0);const f=this.transform,_=this.getZoom(),x=this.getBearing(),T=this.getPitch(),S=this.getPadding(),C="zoom"in o?+o.zoom:_,z="bearing"in o?this._normalizeBearing(o.bearing,x):x,P="pitch"in o?+o.pitch:T,O="padding"in o?o.padding:f.padding,j=s.Point.convert(o.offset);let W,H,Z;if(f.projection.name==="globe"){const ye=s.MercatorCoordinate.fromLngLat(f.center),Ae=j.rotate(-f.angle);ye.x+=Ae.x/f.worldSize,ye.y+=Ae.y/f.worldSize;const We=ye.toLngLat(),Ee=s.LngLat.convert(o.center||We);this._normalizeCenter(Ee),W=f.centerPoint.add(Ae),H=new s.Point(ye.x,ye.y).mult(f.worldSize),Z=new s.Point(s.mercatorXfromLng(Ee.lng),s.mercatorYfromLat(Ee.lat)).mult(f.worldSize).sub(H)}else{W=f.centerPoint.add(j);const ye=f.pointLocation(W),Ae=s.LngLat.convert(o.center||ye);this._normalizeCenter(Ae),H=f.project(ye),Z=f.project(Ae).sub(H)}const X=f.zoomScale(C-_);let B,q;o.around&&(B=s.LngLat.convert(o.around),q=f.locationPoint(B));const Q=this._zooming||C!==_,ee=this._rotating||x!==z,de=this._pitching||P!==T,fe=!f.isPaddingEqual(O),pe=ye=>Ae=>{if(Q&&(ye.zoom=s.number(_,C,Ae)),ee&&(ye.bearing=s.number(x,z,Ae)),de&&(ye.pitch=s.number(T,P,Ae)),fe&&(ye.interpolatePadding(S,O,Ae),W=ye.centerPoint.add(j)),B)ye.setLocationAtPoint(B,q);else{const We=ye.zoomScale(ye.zoom-_),Ee=C>_?Math.min(2,X):Math.max(.5,X),Fe=Math.pow(Ee,1-Ae),ke=ye.unproject(H.add(Z.mult(Ae*Fe)).mult(We));ye.setLocationAtPoint(ye.renderWorldCopies?ke.wrap():ke,W)}return o.preloadOnly||this._fireMoveEvents(c),ye};if(o.preloadOnly){const ye=this._emulate(pe,o.duration,f);return this._preloadTiles(ye),this}const xe={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=Q,this._rotating=ee,this._pitching=de,this._padding=fe,this._easeId=o.easeId,this._prepareEase(c,o.noMoveStart,xe),this._ease(pe(f),ye=>{f.recenterOnTerrain(),this._afterEase(c,ye)},o),this}_prepareEase(o,c,f={}){this._moving=!0,this.transform.cameraElevationReference="sea",c||f.moving||this.fire(new s.Event("movestart",o)),this._zooming&&!f.zooming&&this.fire(new s.Event("zoomstart",o)),this._rotating&&!f.rotating&&this.fire(new s.Event("rotatestart",o)),this._pitching&&!f.pitching&&this.fire(new s.Event("pitchstart",o))}_fireMoveEvents(o){this.fire(new s.Event("move",o)),this._zooming&&this.fire(new s.Event("zoom",o)),this._rotating&&this.fire(new s.Event("rotate",o)),this._pitching&&this.fire(new s.Event("pitch",o))}_afterEase(o,c){if(this._easeId&&c&&this._easeId===c)return;this._easeId=void 0,this.transform.cameraElevationReference="ground";const f=this._zooming,_=this._rotating,x=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,f&&this.fire(new s.Event("zoomend",o)),_&&this.fire(new s.Event("rotateend",o)),x&&this.fire(new s.Event("pitchend",o)),this.fire(new s.Event("moveend",o))}flyTo(o,c){if(this._prefersReducedMotion(o)){const $e=s.pick(o,["center","zoom","bearing","pitch","around"]);return this.jumpTo($e,c)}this.stop(),o=s.extend({offset:[0,0],speed:1.2,curve:1.42,easing:s.ease},o);const f=this.transform,_=this.getZoom(),x=this.getBearing(),T=this.getPitch(),S=this.getPadding(),C="zoom"in o?s.clamp(+o.zoom,f.minZoom,f.maxZoom):_,z="bearing"in o?this._normalizeBearing(o.bearing,x):x,P="pitch"in o?+o.pitch:T,O="padding"in o?o.padding:f.padding,j=f.zoomScale(C-_),W=s.Point.convert(o.offset);let H=f.centerPoint.add(W);const Z=f.pointLocation(H),X=s.LngLat.convert(o.center||Z);this._normalizeCenter(X);const B=f.project(Z),q=f.project(X).sub(B);let Q=o.curve;const ee=Math.max(f.width,f.height),de=ee/j,fe=q.mag();if("minZoom"in o){const $e=s.clamp(Math.min(o.minZoom,_,C),f.minZoom,f.maxZoom),Ye=ee/f.zoomScale($e-_);Q=Math.sqrt(Ye/fe*2)}const pe=Q*Q;function xe($e){const Ye=(de*de-ee*ee+($e?-1:1)*pe*pe*fe*fe)/(2*($e?de:ee)*pe*fe);return Math.log(Math.sqrt(Ye*Ye+1)-Ye)}function ye($e){return(Math.exp($e)-Math.exp(-$e))/2}function Ae($e){return(Math.exp($e)+Math.exp(-$e))/2}const We=xe(0);let Ee=function($e){return Ae(We)/Ae(We+Q*$e)},Fe=function($e){return ee*((Ae(We)*(ye(Ye=We+Q*$e)/Ae(Ye))-ye(We))/pe)/fe;var Ye},ke=(xe(1)-We)/Q;if(Math.abs(fe)<1e-6||!isFinite(ke)){if(Math.abs(ee-de)<1e-6)return this.easeTo(o,c);const $e=deo.maxDuration&&(o.duration=0);const qe=x!==z,Se=P!==T,Be=!f.isPaddingEqual(O),Xe=$e=>Ye=>{const gt=Ye*ke,Et=1/Ee(gt);$e.zoom=Ye===1?C:_+$e.scaleZoom(Et),qe&&($e.bearing=s.number(x,z,Ye)),Se&&($e.pitch=s.number(T,P,Ye)),Be&&($e.interpolatePadding(S,O,Ye),H=$e.centerPoint.add(W));const pt=Ye===1?X:$e.unproject(B.add(q.mult(Fe(gt))).mult(Et));return $e.setLocationAtPoint($e.renderWorldCopies?pt.wrap():pt,H),$e._updateCameraOnTerrain(),o.preloadOnly||this._fireMoveEvents(c),$e};if(o.preloadOnly){const $e=this._emulate(Xe,o.duration,f);return this._preloadTiles($e),this}return this._zooming=!0,this._rotating=qe,this._pitching=Se,this._padding=Be,this._prepareEase(c,!1),this._ease(Xe(f),()=>this._afterEase(c),o),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(o,c){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),this._easeFrameId=void 0,this._onEaseFrame=void 0),this._onEaseEnd){const f=this._onEaseEnd;this._onEaseEnd=void 0,f.call(this,c)}if(!o){const f=this.handlers;f&&f.stop(!1)}return this}_ease(o,c,f){f.animate===!1||f.duration===0?(o(1),c()):(this._easeStart=s.exported.now(),this._easeOptions=f,this._onEaseFrame=o,this._onEaseEnd=c,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const o=Math.min((s.exported.now()-this._easeStart)/this._easeOptions.duration,1),c=this._onEaseFrame;c&&c(this._easeOptions.easing(o)),o<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(o,c){o=s.wrap(o,-180,180);const f=Math.abs(o-c);return Math.abs(o-360-c)180?-360:f<-180?360:0}_prefersReducedMotion(o){return this._respectPrefersReducedMotion&&s.exported.prefersReducedMotion&&!(o&&o.essential)}_emulate(o,c,f){const _=Math.ceil(15*c/1e3),x=[],T=o(f.clone());for(let S=0;S<=_;S++){const C=T(S/_);x.push(C.clone())}return x}}class dt{constructor(o={}){this.options=o,s.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)}getDefaultPosition(){return"bottom-right"}onAdd(o){const c=this.options&&this.options.compact;return this._map=o,this._container=J("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=J("button","mapboxgl-ctrl-attrib-button",this._container),J("span","mapboxgl-ctrl-icon",this._compactButton).setAttribute("aria-hidden","true"),this._compactButton.type="button",this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=J("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),c&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),c===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0}_setElementTitle(o,c){const f=this._map._getUIString(`AttributionControl.${c}`);o.setAttribute("aria-label",f),o.removeAttribute("title"),o.firstElementChild&&o.firstElementChild.setAttribute("title",f)}_toggleAttribution(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","true"))}_updateEditLink(){let o=this._editLink;o||(o=this._editLink=this._container.querySelector(".mapbox-improve-map"));const c=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||s.config.ACCESS_TOKEN}];if(o){const f=c.reduce((_,x,T)=>(x.value&&(_+=`${x.key}=${x.value}${T_.length-x.length),o=o.filter((_,x)=>{for(let T=x+1;T=0)return!1;return!0}),this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?o=[...this.options.customAttribution,...o]:o.unshift(this.options.customAttribution));const f=o.join(" | ");f!==this._attribHTML&&(this._attribHTML=f,o.length?(this._innerContainer.innerHTML=f,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")}}class cd{constructor(){s.bindAll(["_updateLogo","_updateCompact"],this)}onAdd(o){this._map=o,this._container=J("div","mapboxgl-ctrl");const c=J("a","mapboxgl-ctrl-logo");return c.target="_blank",c.rel="noopener nofollow",c.href="https://www.mapbox.com/",c.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),c.setAttribute("rel","noopener nofollow"),this._container.appendChild(c),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)}getDefaultPosition(){return"bottom-left"}_updateLogo(o){o&&o.sourceDataType!=="metadata"||(this._container.style.display=this._logoRequired()?"block":"none")}_logoRequired(){if(!this._map.style)return!0;const o=this._map.style._sourceCaches;if(Object.entries(o).length===0)return!0;for(const c in o){const f=o[c].getSource();if(f.hasOwnProperty("mapbox_logo")&&!f.mapbox_logo)return!1}return!0}_updateCompact(){const o=this._container.children;if(o.length){const c=o[0];this._map.getCanvasContainer().offsetWidth<250?c.classList.add("mapboxgl-compact"):c.classList.remove("mapboxgl-compact")}}}class ud{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(o){const c=++this._id;return this._queue.push({callback:o,id:c,cancelled:!1}),c}remove(o){const c=this._currentlyRunning,f=c?this._queue.concat(c):this._queue;for(const _ of f)if(_.id===o)return void(_.cancelled=!0)}run(o=0){const c=this._currentlyRunning=this._queue;this._queue=[];for(const f of c)if(!f.cancelled&&(f.callback(o),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}function Ia(d,o,c){if(d=new s.LngLat(d.lng,d.lat),o){const f=new s.LngLat(d.lng-360,d.lat),_=new s.LngLat(d.lng+360,d.lat),x=360*Math.ceil(Math.abs(d.lng-c.center.lng)/360),T=c.locationPoint(d).distSqr(o),S=o.x<0||o.y<0||o.x>c.width||o.y>c.height;c.locationPoint(f).distSqr(o)180;){const f=c.locationPoint(d);if(f.x>=0&&f.y>=0&&f.x<=c.width&&f.y<=c.height)break;d.lng>c.center.lng?d.lng-=360:d.lng+=360}return d}const Os={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%)"};class at extends s.Evented{constructor(o,c){if(super(),(o instanceof s.window.HTMLElement||c)&&(o=s.extend({element:o},c)),s.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress","_clearFadeTimer"],this),this._anchor=o&&o.anchor||"center",this._color=o&&o.color||"#3FB1CE",this._scale=o&&o.scale||1,this._draggable=o&&o.draggable||!1,this._clickTolerance=o&&o.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=o&&o.rotation||0,this._rotationAlignment=o&&o.rotationAlignment||"auto",this._pitchAlignment=o&&o.pitchAlignment&&o.pitchAlignment||"auto",this._updateMoving=()=>this._update(!0),this._occludedOpacity=o&&o.occludedOpacity||.2,o&&o.element)this._element=o.element,this._offset=s.Point.convert(o&&o.offset||[0,0]);else{this._defaultMarker=!0,this._element=J("div");const _=41,x=27,T=ve("svg",{display:"block",height:_*this._scale+"px",width:x*this._scale+"px",viewBox:`0 0 ${x} ${_}`},this._element),S=ve("radialGradient",{id:"shadowGradient"},ve("defs",{},T));ve("stop",{offset:"10%","stop-opacity":.4},S),ve("stop",{offset:"100%","stop-opacity":.05},S),ve("ellipse",{cx:13.5,cy:34.8,rx:10.5,ry:5.25,fill:"url(#shadowGradient)"},T),ve("path",{fill:this._color,d:"M27,13.5C27,19.07 20.25,27 14.75,34.5C14.02,35.5 12.98,35.5 12.25,34.5C6.75,27 0,19.22 0,13.5C0,6.04 6.04,0 13.5,0C20.96,0 27,6.04 27,13.5Z"},T),ve("path",{opacity:.25,d:"M13.5,0C6.04,0 0,6.04 0,13.5C0,19.22 6.75,27 12.25,34.5C13,35.52 14.02,35.5 14.75,34.5C20.25,27 27,19.07 27,13.5C27,6.04 20.96,0 13.5,0ZM13.5,1C20.42,1 26,6.58 26,13.5C26,15.9 24.5,19.18 22.22,22.74C19.95,26.3 16.71,30.14 13.94,33.91C13.74,34.18 13.61,34.32 13.5,34.44C13.39,34.32 13.26,34.18 13.06,33.91C10.28,30.13 7.41,26.31 5.02,22.77C2.62,19.23 1,15.95 1,13.5C1,6.58 6.58,1 13.5,1Z"},T),ve("circle",{fill:"white",cx:13.5,cy:13.5,r:5.5},T),this._offset=s.Point.convert(o&&o.offset||[0,-14])}this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label","Map marker"),this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",_=>{_.preventDefault()}),this._element.addEventListener("mousedown",_=>{_.preventDefault()});const f=this._element.classList;for(const _ in Os)f.remove(`mapboxgl-marker-anchor-${_}`);f.add(`mapboxgl-marker-anchor-${this._anchor}`),this._popup=null}addTo(o){return o===this._map||(this.remove(),this._map=o,o.getCanvasContainer().appendChild(this._element),o.on("move",this._updateMoving),o.on("moveend",this._update),o.on("remove",this._clearFadeTimer),o._addMarker(this),this.setDraggable(this._draggable),this._update(),o.on("click",this._onMapClick)),this}remove(){const o=this._map;return o&&(o.off("click",this._onMapClick),o.off("move",this._updateMoving),o.off("moveend",this._update),o.off("mousedown",this._addDragHandler),o.off("touchstart",this._addDragHandler),o.off("mouseup",this._onUp),o.off("touchend",this._onUp),o.off("mousemove",this._onMove),o.off("touchmove",this._onMove),o.off("remove",this._clearFadeTimer),o._removeMarker(this),this._map=void 0),this._clearFadeTimer(),this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(o){return this._lngLat=s.LngLat.convert(o),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(!0),this}getElement(){return this._element}setPopup(o){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeAttribute("role"),this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),o){if(!("offset"in o.options)){const _=Math.sqrt(Math.pow(13.5,2)/2);o.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[_,-1*(38.1-13.5+_)],"bottom-right":[-_,-1*(38.1-13.5+_)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=o,o._marker=this,this._lngLat&&this._popup.setLngLat(this._lngLat),this._element.setAttribute("role","button"),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress),this._element.setAttribute("aria-expanded","false")}return this}_onKeyPress(o){const c=o.code,f=o.charCode||o.keyCode;c!=="Space"&&c!=="Enter"&&f!==32&&f!==13||this.togglePopup()}_onMapClick(o){const c=o.originalEvent.target,f=this._element;this._popup&&(c===f||f.contains(c))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const o=this._popup;return o?(o.isOpen()?(o.remove(),this._element.setAttribute("aria-expanded","false")):this._map&&(o.addTo(this._map),this._element.setAttribute("aria-expanded","true")),this):this}_behindTerrain(){const o=this._map,c=this._pos;if(!o||!c)return!1;const f=o.unproject(c),_=o.getFreeCameraOptions();if(!_.position)return!1;const x=_.position.toLngLat();return x.distanceTo(f)<.9*x.distanceTo(this._lngLat)}_evaluateOpacity(){const o=this._map;if(!o)return;const c=this._pos;if(!c||c.x<0||c.x>o.transform.width||c.y<0||c.y>o.transform.height)return void this._clearFadeTimer();const f=o.unproject(c);let _;o._showingGlobe()&&s.isLngLatBehindGlobe(o.transform,this._lngLat)?_=0:(_=1-o._queryFogOpacity(f),o.transform._terrainEnabled()&&o.getTerrain()&&this._behindTerrain()&&(_*=this._occludedOpacity)),this._element.style.opacity=`${_}`,this._element.style.pointerEvents=_>0?"auto":"none",this._popup&&this._popup._setOpacity(_),this._fadeTimer=null}_clearFadeTimer(){this._fadeTimer&&(clearTimeout(this._fadeTimer),this._fadeTimer=null)}_updateDOM(){const o=this._pos;if(!o||!this._map)return;const c=this._offset.mult(this._scale);this._element.style.transform=` + translate(${o.x}px,${o.y}px) + ${Os[this._anchor]} + ${this._calculateXYTransform()} ${this._calculateZTransform()} + translate(${c.x}px,${c.y}px) + `}_calculateXYTransform(){const o=this._pos,c=this._map,f=this.getPitchAlignment();if(!c||!o||f!=="map")return"";if(!c._showingGlobe()){const C=c.getPitch();return C?`rotateX(${C}deg)`:""}const _=s.radToDeg(s.globeTiltAtLngLat(c.transform,this._lngLat)),x=o.sub(s.globeCenterToScreenPoint(c.transform)),T=Math.abs(x.x)+Math.abs(x.y);if(T===0)return"";const S=_/T;return`rotateX(${-x.y*S}deg) rotateY(${x.x*S}deg)`}_calculateZTransform(){const o=this._pos,c=this._map;if(!c||!o)return"";let f=0;const _=this.getRotationAlignment();if(_==="map")if(c._showingGlobe()){const x=c.project(new s.LngLat(this._lngLat.lng,this._lngLat.lat+.001)),T=c.project(new s.LngLat(this._lngLat.lng,this._lngLat.lat-.001)).sub(x);f=s.radToDeg(Math.atan2(T.y,T.x))-90}else f=-c.getBearing();else if(_==="horizon"){const x=s.smoothstep(4,6,c.getZoom()),T=s.globeCenterToScreenPoint(c.transform);T.y+=x*c.transform.height;const S=o.sub(T),C=s.radToDeg(Math.atan2(S.y,S.x));f=(C>90?C-270:C+90)*(1-x)}return f+=this._rotation,f?`rotateZ(${f}deg)`:""}_update(o){s.window.cancelAnimationFrame(this._updateFrameId);const c=this._map;c&&(c.transform.renderWorldCopies&&(this._lngLat=Ia(this._lngLat,this._pos,c.transform)),this._pos=c.project(this._lngLat),o===!0?this._updateFrameId=s.window.requestAnimationFrame(()=>{this._element&&this._pos&&this._anchor&&(this._pos=this._pos.round(),this._updateDOM())}):this._pos=this._pos.round(),c._requestDomTask(()=>{this._map&&(this._element&&this._pos&&this._anchor&&this._updateDOM(),(c._showingGlobe()||c.getTerrain()||c.getFog())&&!this._fadeTimer&&(this._fadeTimer=setTimeout(this._evaluateOpacity.bind(this),60)))}))}getOffset(){return this._offset}setOffset(o){return this._offset=s.Point.convert(o),this._update(),this}_onMove(o){const c=this._map;if(!c)return;const f=this._pointerdownPos,_=this._positionDelta;if(f&&_){if(!this._isDragging){const x=this._clickTolerance||c._clickTolerance;if(o.point.dist(f)=this._endTime)return this._end;const c=s.easeCubicInOut((o-this._startTime)/(this._endTime-this._startTime));return this._start*(1-c)+this._end*c}isEasing(o){return o>=this._startTime&&o<=this._endTime}jumpTo(o){this._startTime=-1/0,this._endTime=-1/0,this._start=o,this._end=o}easeTo(o,c,f){this._start=this.getValue(c),this._end=o,this._startTime=c,this._endTime=c+f}}const Zf={"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":"Mapbox logo","Map.Title":"Map","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScrollZoomBlocker.CtrlMessage":"Use ctrl + scroll to zoom the map","ScrollZoomBlocker.CmdMessage":"Use ⌘ + scroll to zoom the map","TouchPanBlocker.Message":"Use two fingers to move the map"},Hf={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:85,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,performanceMetricsCollection:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,optimizeForTerrain:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,minTileCacheSize:null,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",localFontFamily:null,transformRequest:null,accessToken:null,fadeDuration:300,respectPrefersReducedMotion:!0,crossSourceCollisions:!0},hy={showCompass:!0,showZoom:!0,visualizePitch:!1};class dy{constructor(o,c,f=!1){this._clickTolerance=10,this.element=c,this.mouseRotate=new id({clickTolerance:o.dragRotate._mouseRotate._clickTolerance}),this.map=o,f&&(this.mousePitch=new od({clickTolerance:o.dragRotate._mousePitch._clickTolerance})),s.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),c.addEventListener("mousedown",this.mousedown),c.addEventListener("touchstart",this.touchstart,{passive:!1}),c.addEventListener("touchmove",this.touchmove),c.addEventListener("touchend",this.touchend),c.addEventListener("touchcancel",this.reset)}down(o,c){this.mouseRotate.mousedown(o,c),this.mousePitch&&this.mousePitch.mousedown(o,c),ie()}move(o,c){const f=this.map,_=this.mouseRotate.mousemoveWindow(o,c),x=_&&_.bearingDelta;if(x&&f.setBearing(f.getBearing()+x),this.mousePitch){const T=this.mousePitch.mousemoveWindow(o,c),S=T&&T.pitchDelta;S&&f.setPitch(f.getPitch()+S)}}off(){const o=this.element;o.removeEventListener("mousedown",this.mousedown),o.removeEventListener("touchstart",this.touchstart,{passive:!1}),o.removeEventListener("touchmove",this.touchmove),o.removeEventListener("touchend",this.touchend),o.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){te(),s.window.removeEventListener("mousemove",this.mousemove),s.window.removeEventListener("mouseup",this.mouseup)}mousedown(o){this.down(s.extend({},o,{ctrlKey:!0,preventDefault:()=>o.preventDefault()}),Oe(this.element,o)),s.window.addEventListener("mousemove",this.mousemove),s.window.addEventListener("mouseup",this.mouseup)}mousemove(o){this.move(o,Oe(this.element,o))}mouseup(o){this.mouseRotate.mouseupWindow(o),this.mousePitch&&this.mousePitch.mouseupWindow(o),this.offTemp()}touchstart(o){o.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=Ke(this.element,o.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>o.preventDefault()},this._startPos))}touchmove(o){o.targetTouches.length!==1?this.reset():(this._lastPos=Ke(this.element,o.targetTouches)[0],this.move({preventDefault:()=>o.preventDefault()},this._lastPos))}touchend(o){o.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)d.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(d.minPitch!=null&&d.maxPitch!=null&&d.minPitch>d.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(d.minPitch!=null&&d.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(d.maxPitch!=null&&d.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(d.antialias&&s.isSafariWithAntialiasingBug(s.window)&&(d.antialias=!1,s.warnOnce("Antialiasing is disabled for this WebGL context to avoid browser bug: https://github.com/mapbox/mapbox-gl-js/issues/11609")),super(new Ta(d.minZoom,d.maxZoom,d.minPitch,d.maxPitch,d.renderWorldCopies),d),this._interactive=d.interactive,this._minTileCacheSize=d.minTileCacheSize,this._maxTileCacheSize=d.maxTileCacheSize,this._failIfMajorPerformanceCaveat=d.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=d.preserveDrawingBuffer,this._antialias=d.antialias,this._useWebGL2=d.useWebGL2,this._trackResize=d.trackResize,this._bearingSnap=d.bearingSnap,this._refreshExpiredTiles=d.refreshExpiredTiles,this._fadeDuration=d.fadeDuration,this._isInitialLoad=!0,this._crossSourceCollisions=d.crossSourceCollisions,this._collectResourceTiming=d.collectResourceTiming,this._optimizeForTerrain=d.optimizeForTerrain,this._language=this._parseLanguage(d.language),this._worldview=d.worldview,this._renderTaskQueue=new ud,this._domRenderTaskQueue=new ud,this._controls=[],this._markers=[],this._popups=[],this._mapId=s.uniqueId(),this._locale=s.extend({},Zf,d.locale),this._clickTolerance=d.clickTolerance,this._cooperativeGestures=d.cooperativeGestures,this._performanceMetricsCollection=d.performanceMetricsCollection,this._containerWidth=0,this._containerHeight=0,this._averageElevationLastSampledAt=-1/0,this._averageElevationExaggeration=0,this._averageElevation=new dd(0),this._interactionRange=[1/0,-1/0],this._visibilityHidden=0,this._useExplicitProjection=!1,this._requestManager=new s.RequestManager(d.transformRequest,d.accessToken,d.testMode),this._silenceAuthErrors=!!d.testMode,typeof d.container=="string"){if(this._container=s.window.document.getElementById(d.container),!this._container)throw new Error(`Container '${d.container}' not found.`)}else{if(!(d.container instanceof s.window.HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=d.container}if(this._container.childNodes.length>0&&s.warnOnce("The map container element should be empty, otherwise the map's interactivity will be negatively impacted. If you want to display a message when WebGL is not supported, use the Mapbox GL Supported plugin instead."),d.maxBounds&&this.setMaxBounds(d.maxBounds),s.bindAll(["_onWindowOnline","_onWindowResize","_onVisibilityChange","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),s.window!==void 0&&(s.window.addEventListener("online",this._onWindowOnline,!1),s.window.addEventListener("resize",this._onWindowResize,!1),s.window.addEventListener("orientationchange",this._onWindowResize,!1),s.window.addEventListener("webkitfullscreenchange",this._onWindowResize,!1),s.window.addEventListener("visibilitychange",this._onVisibilityChange,!1)),this.handlers=new ro(this,d),this._localFontFamily=d.localFontFamily,this._localIdeographFontFamily=d.localIdeographFontFamily,d.style&&this.setStyle(d.style,{localFontFamily:this._localFontFamily,localIdeographFontFamily:this._localIdeographFontFamily}),d.projection&&this.setProjection(d.projection),this._hash=d.hash&&new ed(typeof d.hash=="string"&&d.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:d.center,zoom:d.zoom,bearing:d.bearing,pitch:d.pitch}),d.bounds&&(this.resize(),this.fitBounds(d.bounds,s.extend({},d.fitBoundsOptions,{duration:0})))),this.resize(),d.attributionControl&&this.addControl(new dt({customAttribution:d.customAttribution})),this._logoControl=new cd,this.addControl(this._logoControl,d.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",o=>{this._update(o.dataType==="style"),this.fire(new s.Event(`${o.dataType}data`,o))}),this.on("dataloading",o=>{this.fire(new s.Event(`${o.dataType}dataloading`,o))})}_getMapId(){return this._mapId}addControl(d,o){if(o===void 0&&(o=d.getDefaultPosition?d.getDefaultPosition():"top-right"),!d||!d.onAdd)return this.fire(new s.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const c=d.onAdd(this);this._controls.push(d);const f=this._controlPositions[o];return o.indexOf("bottom")!==-1?f.insertBefore(c,f.firstChild):f.appendChild(c),this}removeControl(d){if(!d||!d.onRemove)return this.fire(new s.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const o=this._controls.indexOf(d);return o>-1&&this._controls.splice(o,1),d.onRemove(this),this}hasControl(d){return this._controls.indexOf(d)>-1}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}resize(d){if(this._updateContainerDimensions(),this._containerWidth===this.transform.width&&this._containerHeight===this.transform.height)return this;this._resizeCanvas(this._containerWidth,this._containerHeight),this.transform.resize(this._containerWidth,this._containerHeight),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight));const o=!this._moving;return o&&this.fire(new s.Event("movestart",d)).fire(new s.Event("move",d)),this.fire(new s.Event("resize",d)),o&&this.fire(new s.Event("moveend",d)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()||null}setMaxBounds(d){return this.transform.setMaxBounds(s.LngLatBounds.convert(d)),this._update()}setMinZoom(d){if((d=d??-2)>=-2&&d<=this.transform.maxZoom)return this.transform.minZoom=d,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=d,this._update(),this.getZoom()>d?this.setZoom(d):this.fire(new s.Event("zoomstart")).fire(new s.Event("zoom")).fire(new s.Event("zoomend")),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(d){if((d=d??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(d>=0&&d<=this.transform.maxPitch)return this.transform.minPitch=d,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(d>=this.transform.minPitch)return this.transform.maxPitch=d,this._update(),this.getPitch()>d?this.setPitch(d):this.fire(new s.Event("pitchstart")).fire(new s.Event("pitch")).fire(new s.Event("pitchend")),this;throw new Error("maxPitch must be greater than or equal to minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(d){return this.transform.renderWorldCopies=d,this.transform.renderWorldCopies||this._forceMarkerAndPopupUpdate(!0),this._update()}getLanguage(){return this._language}_parseLanguage(d){return d==="auto"?s.window.navigator.language:Array.isArray(d)?d.length===0?void 0:d.map(o=>o==="auto"?s.window.navigator.language:o):d}setLanguage(d){const o=this._parseLanguage(d);if(!this.style||o===this._language)return this;this._language=o,this.style._reloadSources();for(const c of this._controls)c._setLanguage&&c._setLanguage(this._language);return this}getWorldview(){return this._worldview}setWorldview(d){return this.style&&d!==this._worldview?(this._worldview=d,this.style._reloadSources(),this):this}getProjection(){return this.transform.mercatorFromTransition?{name:"globe",center:[0,0]}:this.transform.getProjection()}_showingGlobe(){return this.transform.projection.name==="globe"}setProjection(d){return this._lazyInitEmptyStyle(),d?typeof d=="string"&&(d={name:d}):d=null,this._useExplicitProjection=!!d,this._prioritizeAndUpdateProjection(d,this.style.stylesheet?this.style.stylesheet.projection:null)}_updateProjectionTransition(){if(this.getProjection().name!=="globe")return;const d=this.transform,o=d.projection.name;let c;o==="globe"&&d.zoom>=s.GLOBE_ZOOM_THRESHOLD_MAX?(d.setMercatorFromTransition(),c=!0):o==="mercator"&&d.zoom=s.GLOBE_ZOOM_THRESHOLD_MAX?this.transform.setMercatorFromTransition():this.transform.setProjection(d),this.style.applyProjectionUpdate(),o){this.painter.clearBackgroundTiles();for(const c in this.style._sourceCaches)this.style._sourceCaches[c].clearTiles();this._update(!0),this._forceMarkerAndPopupUpdate(!0)}return this}project(d){return this.transform.locationPoint3D(s.LngLat.convert(d))}unproject(d){return this.transform.pointLocation3D(s.Point.convert(d))}isMoving(){return this._moving||this.handlers&&this.handlers.isMoving()||!1}isZooming(){return this._zooming||this.handlers&&this.handlers.isZooming()||!1}isRotating(){return this._rotating||this.handlers&&this.handlers.isRotating()||!1}_isDragging(){return this.handlers&&this.handlers._isDragging()||!1}_createDelegatedListener(d,o,c){if(d==="mouseenter"||d==="mouseover"){let f=!1;const _=T=>{const S=o.filter(z=>this.getLayer(z)),C=S.length?this.queryRenderedFeatures(T.point,{layers:S}):[];C.length?f||(f=!0,c.call(this,new pr(d,this,T.originalEvent,{features:C}))):f=!1},x=()=>{f=!1};return{layers:new Set(o),listener:c,delegates:{mousemove:_,mouseout:x}}}if(d==="mouseleave"||d==="mouseout"){let f=!1;const _=T=>{const S=o.filter(C=>this.getLayer(C));(S.length?this.queryRenderedFeatures(T.point,{layers:S}):[]).length?f=!0:f&&(f=!1,c.call(this,new pr(d,this,T.originalEvent)))},x=T=>{f&&(f=!1,c.call(this,new pr(d,this,T.originalEvent)))};return{layers:new Set(o),listener:c,delegates:{mousemove:_,mouseout:x}}}{const f=_=>{const x=o.filter(S=>this.getLayer(S)),T=x.length?this.queryRenderedFeatures(_.point,{layers:x}):[];T.length&&(_.features=T,c.call(this,_),delete _.features)};return{layers:new Set(o),listener:c,delegates:{[d]:f}}}}on(d,o,c){if(c===void 0)return super.on(d,o);Array.isArray(o)||(o=[o]);const f=this._createDelegatedListener(d,o,c);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[d]=this._delegatedListeners[d]||[],this._delegatedListeners[d].push(f);for(const _ in f.delegates)this.on(_,f.delegates[_]);return this}once(d,o,c){if(c===void 0)return super.once(d,o);Array.isArray(o)||(o=[o]);const f=this._createDelegatedListener(d,o,c);for(const _ in f.delegates)this.once(_,f.delegates[_]);return this}off(d,o,c){if(c===void 0)return super.off(d,o);o=new Set(Array.isArray(o)?o:[o]);const f=(x,T)=>{if(x.size!==T.size)return!1;for(const S of x)if(!T.has(S))return!1;return!0},_=this._delegatedListeners?this._delegatedListeners[d]:void 0;return _&&(x=>{for(let T=0;T{_?this.fire(new s.ErrorEvent(_)):x&&this._updateDiff(x,o)})}else typeof d=="object"&&this._updateDiff(d,o)}_updateDiff(d,o){try{this.style.setState(d)&&this._update(!0)}catch(c){s.warnOnce(`Unable to perform style diff: ${c.message||c.error||c}. Rebuilding the style from scratch.`),this._updateStyle(d,o)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():(s.warnOnce("There is no style added to the map."),!1)}addSource(d,o){return this._lazyInitEmptyStyle(),this.style.addSource(d,o),this._update(!0)}isSourceLoaded(d){return!!this.style&&this.style._isSourceCacheLoaded(d)}areTilesLoaded(){const d=this.style&&this.style._sourceCaches;for(const o in d){const c=d[o]._tiles;for(const f in c){const _=c[f];if(_.state!=="loaded"&&_.state!=="errored")return!1}}return!0}addSourceType(d,o,c){this._lazyInitEmptyStyle(),this.style.addSourceType(d,o,c)}removeSource(d){return this.style.removeSource(d),this._updateTerrain(),this._update(!0)}getSource(d){return this.style.getSource(d)}addImage(d,o,{pixelRatio:c=1,sdf:f=!1,stretchX:_,stretchY:x,content:T}={}){if(this._lazyInitEmptyStyle(),o instanceof s.window.HTMLImageElement||s.window.ImageBitmap&&o instanceof s.window.ImageBitmap){const{width:S,height:C,data:z}=s.exported.getImageData(o);this.style.addImage(d,{data:new s.RGBAImage({width:S,height:C},z),pixelRatio:c,stretchX:_,stretchY:x,content:T,sdf:f,version:0})}else if(o.width===void 0||o.height===void 0)this.fire(new s.ErrorEvent(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`")));else{const{width:S,height:C}=o,z=o;this.style.addImage(d,{data:new s.RGBAImage({width:S,height:C},new Uint8Array(z.data)),pixelRatio:c,stretchX:_,stretchY:x,content:T,sdf:f,version:0,userImage:z}),z.onAdd&&z.onAdd(this,d)}}updateImage(d,o){const c=this.style.getImage(d);if(!c)return void this.fire(new s.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const f=o instanceof s.window.HTMLImageElement||s.window.ImageBitmap&&o instanceof s.window.ImageBitmap?s.exported.getImageData(o):o,{width:_,height:x}=f;_!==void 0&&x!==void 0?_===c.data.width&&x===c.data.height?(c.data.replace(f.data,!(o instanceof s.window.HTMLImageElement||s.window.ImageBitmap&&o instanceof s.window.ImageBitmap)),this.style.updateImage(d,c)):this.fire(new s.ErrorEvent(new Error(`The width and height of the updated image (${_}, ${x}) + must be that same as the previous version of the image + (${c.data.width}, ${c.data.height})`))):this.fire(new s.ErrorEvent(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`")))}hasImage(d){return d?!!this.style.getImage(d):(this.fire(new s.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(d){this.style.removeImage(d)}loadImage(d,o){s.getImage(this._requestManager.transformRequest(d,s.ResourceType.Image),(c,f)=>{o(c,f instanceof s.window.HTMLImageElement?s.exported.getImageData(f):f)})}listImages(){return this.style.listImages()}addLayer(d,o){return this._lazyInitEmptyStyle(),this.style.addLayer(d,o),this._update(!0)}moveLayer(d,o){return this.style.moveLayer(d,o),this._update(!0)}removeLayer(d){return this.style.removeLayer(d),this._update(!0)}getLayer(d){return this.style.getLayer(d)}setLayerZoomRange(d,o,c){return this.style.setLayerZoomRange(d,o,c),this._update(!0)}setFilter(d,o,c={}){return this.style.setFilter(d,o,c),this._update(!0)}getFilter(d){return this.style.getFilter(d)}setPaintProperty(d,o,c,f={}){return this.style.setPaintProperty(d,o,c,f),this._update(!0)}getPaintProperty(d,o){return this.style.getPaintProperty(d,o)}setLayoutProperty(d,o,c,f={}){return this.style.setLayoutProperty(d,o,c,f),this._update(!0)}getLayoutProperty(d,o){return this.style.getLayoutProperty(d,o)}setLight(d,o={}){return this._lazyInitEmptyStyle(),this.style.setLight(d,o),this._update(!0)}getLight(){return this.style.getLight()}setTerrain(d){return this._lazyInitEmptyStyle(),!d&&this.transform.projection.requiresDraping?this.style.setTerrainForDraping():this.style.setTerrain(d),this._averageElevationLastSampledAt=-1/0,this._update(!0)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(d){return this._lazyInitEmptyStyle(),this.style.setFog(d),this._update(!0)}getFog(){return this.style?this.style.getFog():null}_queryFogOpacity(d){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(s.LngLat.convert(d),this.transform):0}setFeatureState(d,o){return this.style.setFeatureState(d,o),this._update()}removeFeatureState(d,o){return this.style.removeFeatureState(d,o),this._update()}getFeatureState(d){return this.style.getFeatureState(d)}_updateContainerDimensions(){if(!this._container)return;const d=this._container.getBoundingClientRect().width||400,o=this._container.getBoundingClientRect().height||300;let c,f,_,x=this._container;for(;x&&(!f||!_);){const T=s.window.getComputedStyle(x).transform;T&&T!=="none"&&(c=T.match(/matrix.*\((.+)\)/)[1].split(", "),c[0]&&c[0]!=="0"&&c[0]!=="1"&&(f=c[0]),c[3]&&c[3]!=="0"&&c[3]!=="1"&&(_=c[3])),x=x.parentElement}this._containerWidth=f?Math.abs(d/f):d,this._containerHeight=_?Math.abs(o/_):o}_detectMissingCSS(){s.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")!=="rgb(250, 128, 114)"&&s.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")}_setupContainer(){const d=this._container;d.classList.add("mapboxgl-map"),(this._missingCSSCanary=J("div","mapboxgl-canary",d)).style.visibility="hidden",this._detectMissingCSS();const o=this._canvasContainer=J("div","mapboxgl-canvas-container",d);this._interactive&&o.classList.add("mapboxgl-interactive"),this._canvas=J("canvas","mapboxgl-canvas",o),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region"),this._updateContainerDimensions(),this._resizeCanvas(this._containerWidth,this._containerHeight);const c=this._controlContainer=J("div","mapboxgl-control-container",d),f=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(_=>{f[_]=J("div",`mapboxgl-ctrl-${_}`,c)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(d,o){const c=s.exported.devicePixelRatio||1;this._canvas.width=c*Math.ceil(d),this._canvas.height=c*Math.ceil(o),this._canvas.style.width=`${d}px`,this._canvas.style.height=`${o}px`}_addMarker(d){this._markers.push(d)}_removeMarker(d){const o=this._markers.indexOf(d);o!==-1&&this._markers.splice(o,1)}_addPopup(d){this._popups.push(d)}_removePopup(d){const o=this._popups.indexOf(d);o!==-1&&this._popups.splice(o,1)}_setupPainter(){const d=s.extend({},D.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),o=this._useWebGL2&&this._canvas.getContext("webgl2",d),c=o||this._canvas.getContext("webgl",d)||this._canvas.getContext("experimental-webgl",d);c?(this._useWebGL2&&!o&&s.warnOnce("Failed to create WebGL 2 context. Using WebGL 1."),s.storeAuthState(c,!0),this.painter=new ba(c,this.transform,!!o),this.on("data",f=>{f.dataType==="source"&&this.painter.setTileLoadedFlag(!0)}),s.exported$1.testSupport(c)):this.fire(new s.ErrorEvent(new Error("Failed to initialize WebGL")))}_contextLost(d){d.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new s.Event("webglcontextlost",{originalEvent:d}))}_contextRestored(d){this._setupPainter(),this.resize(),this._update(),this.fire(new s.Event("webglcontextrestored",{originalEvent:d}))}_onMapScroll(d){if(d.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(d){return this.style?(this._styleDirty=this._styleDirty||d,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(d){return this._update(),this._renderTaskQueue.add(d)}_cancelRenderFrame(d){this._renderTaskQueue.remove(d)}_requestDomTask(d){!this.loaded()||this.loaded()&&!this.isMoving()?d():this._domRenderTaskQueue.add(d)}_render(d){let o;const c=this.painter.context.extTimerQuery,f=s.exported.now();if(this.listens("gpu-timing-frame")&&(o=c.createQueryEXT(),c.beginQueryEXT(c.TIME_ELAPSED_EXT,o)),this.painter.context.setDirty(),this.painter.setBaseState(),(this.isMoving()||this.isRotating()||this.isZooming())&&(this._interactionRange[0]=Math.min(this._interactionRange[0],s.window.performance.now()),this._interactionRange[1]=Math.max(this._interactionRange[1],s.window.performance.now())),this._renderTaskQueue.run(d),this._domRenderTaskQueue.run(d),this._removed)return;this._updateProjectionTransition();const _=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;const S=this.transform.zoom,C=this.transform.pitch,z=s.exported.now(),P=new s.EvaluationParameters(S,{now:z,fadeDuration:_,pitch:C,transition:this.style.getTransition()});this.style.update(P)}this.style&&this.style.fog&&this.style.fog.hasTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0);let x=!1;if(this.style&&this._sourcesDirty?(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),x=this._updateAverageElevation(f),this.style._updateSources(this.transform),this._forceMarkerAndPopupUpdate()):x=this._updateAverageElevation(f),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,_,this._crossSourceCollisions),this.style&&this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showTerrainWireframe:this.showTerrainWireframe,showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,showTileAABBs:this.showTileAABBs,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:_,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),gpuTimingDeferredRender:!!this.listens("gpu-timing-deferred-render"),speedIndexTiming:this.speedIndexTiming}),this.fire(new s.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new s.Event("load"))),this.style&&this.style.hasTransitions()&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),o){const S=s.exported.now()-f;c.endQueryEXT(c.TIME_ELAPSED_EXT,o),setTimeout(()=>{const C=c.getQueryObjectEXT(o,c.QUERY_RESULT_EXT)/1e6;c.deleteQueryEXT(o),this.fire(new s.Event("gpu-timing-frame",{cpuTime:S,gpuTime:C})),s.window.performance.mark("frame-gpu",{startTime:f,detail:{gpuTime:C}})},50)}if(this.listens("gpu-timing-layer")){const S=this.painter.collectGpuTimers();setTimeout(()=>{const C=this.painter.queryGpuTimers(S);this.fire(new s.Event("gpu-timing-layer",{layerTimes:C}))},50)}if(this.listens("gpu-timing-deferred-render")){const S=this.painter.collectDeferredRenderGpuQueries();setTimeout(()=>{const C=this.painter.queryGpuTimeDeferredRender(S);this.fire(new s.Event("gpu-timing-deferred-render",{gpuTime:C}))},50)}const T=this._sourcesDirty||this._styleDirty||this._placementDirty||x;if(T||this._repaint)this.triggerRepaint();else{const S=!this.isMoving()&&this.loaded();if(S&&(x=this._updateAverageElevation(f,!0)),x)this.triggerRepaint();else if(this._triggerFrame(!1),S&&(this.fire(new s.Event("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){const C=this._calculateSpeedIndex();this.fire(new s.Event("speedindexcompleted",{speedIndex:C})),this.speedIndexTiming=!1}}!this._loaded||this._fullyLoaded||T||(this._fullyLoaded=!0,s.LivePerformanceUtils.mark(s.PerformanceMarkers.fullLoad),this._performanceMetricsCollection&&s.postPerformanceEvent(this._requestManager._customAccessToken,{width:this.painter.width,height:this.painter.height,interactionRange:this._interactionRange,visibilityHidden:this._visibilityHidden,terrainEnabled:!!this.painter.style.getTerrain(),fogEnabled:!!this.painter.style.getFog(),projection:this.getProjection().name,zoom:this.transform.zoom,renderer:this.painter.context.renderer,vendor:this.painter.context.vendor}),this._authenticate())}_forceMarkerAndPopupUpdate(d){for(const o of this._markers)d&&!this.getRenderWorldCopies()&&(o._lngLat=o._lngLat.wrap()),o._update();for(const o of this._popups)!d||this.getRenderWorldCopies()||o._trackPointer||(o._lngLat=o._lngLat.wrap()),o._update()}_updateAverageElevation(d,o=!1){const c=f=>(this.transform.averageElevation=f,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return this.transform.averageElevation!==0&&c(0);if((o||d-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(d)){const f=this.transform.averageElevation;let _=this.transform.sampleAverageElevation(),x=!1;this.transform.elevation&&(x=this.transform.elevation.exaggeration()!==this._averageElevationExaggeration,this._averageElevationExaggeration=this.transform.elevation.exaggeration()),isNaN(_)?_=0:this._averageElevationLastSampledAt=d;const T=Math.abs(f-_);if(T>1){if(this._isInitialLoad||x)return this._averageElevation.jumpTo(_),c(_);this._averageElevation.easeTo(_,d,300)}else if(T>1e-4)return this._averageElevation.jumpTo(_),c(_)}return!!this._averageElevation.isEasing(d)&&c(this._averageElevation.getValue(d))}_authenticate(){s.getMapSessionAPI(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,d=>{if(d&&(d.message===s.AUTH_ERR_MSG||d.status===401)){const o=this.painter.context.gl;s.storeAuthState(o,!1),this._logoControl instanceof cd&&this._logoControl._updateLogo(),o&&o.clear(o.DEPTH_BUFFER_BIT|o.COLOR_BUFFER_BIT|o.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new s.ErrorEvent(new Error("A valid Mapbox access token is required to use Mapbox GL JS. To create an account or a new access token, visit https://account.mapbox.com/")))}}),s.postMapLoadEvent(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,()=>{})}_updateTerrain(){const d=this._isDragging();this.painter.updateTerrain(this.style,d)}_calculateSpeedIndex(){const d=this.painter.canvasCopy(),o=this.painter.getCanvasCopiesAndTimestamps();o.timeStamps.push(performance.now());const c=this.painter.context.gl,f=c.createFramebuffer();function _(x){c.framebufferTexture2D(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,c.TEXTURE_2D,x,0);const T=new Uint8Array(c.drawingBufferWidth*c.drawingBufferHeight*4);return c.readPixels(0,0,c.drawingBufferWidth,c.drawingBufferHeight,c.RGBA,c.UNSIGNED_BYTE,T),T}return c.bindFramebuffer(c.FRAMEBUFFER,f),this._canvasPixelComparison(_(d),o.canvasCopies.map(_),o.timeStamps)}_canvasPixelComparison(d,o,c){let f=c[1]-c[0];const _=d.length/4;for(let x=0;x{const c=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,c&&this._render(o)}))}_preloadTiles(d){const o=this.style?Object.values(this.style._sourceCaches):[];return s.asyncAll(o,(c,f)=>c._preloadTiles(d,f),()=>{this.triggerRepaint()}),this}_onWindowOnline(){this._update()}_onWindowResize(d){this._trackResize&&this.resize({originalEvent:d})._update()}_onVisibilityChange(){s.window.document.visibilityState==="hidden"&&this._visibilityHidden++}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(d){this._showTileBoundaries!==d&&(this._showTileBoundaries=d,this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(d){this._showTerrainWireframe!==d&&(this._showTerrainWireframe=d,this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(d){this._speedIndexTiming!==d&&(this._speedIndexTiming=d,this._update())}get showPadding(){return!!this._showPadding}set showPadding(d){this._showPadding!==d&&(this._showPadding=d,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(d){this._showCollisionBoxes!==d&&(this._showCollisionBoxes=d,d?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(d){this._showOverdrawInspector!==d&&(this._showOverdrawInspector=d,this._update())}get repaint(){return!!this._repaint}set repaint(d){this._repaint!==d&&(this._repaint=d,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(d){this._vertices=d,this._update()}get showTileAABBs(){return!!this._showTileAABBs}set showTileAABBs(d){this._showTileAABBs!==d&&(this._showTileAABBs=d,d&&this._update())}_setCacheLimits(d,o){s.setCacheLimits(d,o)}get version(){return s.version}},NavigationControl:class{constructor(d){this.options=s.extend({},hy,d),this._container=J("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",o=>o.preventDefault()),this.options.showZoom&&(s.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",o=>{this._map&&this._map.zoomIn({},{originalEvent:o})}),J("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",o=>{this._map&&this._map.zoomOut({},{originalEvent:o})}),J("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(s.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",o=>{const c=this._map;c&&(this.options.visualizePitch?c.resetNorthPitch({},{originalEvent:o}):c.resetNorth({},{originalEvent:o}))}),this._compassIcon=J("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const d=this._map;if(!d)return;const o=d.getZoom(),c=o===d.getMaxZoom(),f=o===d.getMinZoom();this._zoomInButton.disabled=c,this._zoomOutButton.disabled=f,this._zoomInButton.setAttribute("aria-disabled",c.toString()),this._zoomOutButton.setAttribute("aria-disabled",f.toString())}_rotateCompassArrow(){const d=this._map;if(!d)return;const o=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(d.transform.pitch*(Math.PI/180)),.5)}) rotateX(${d.transform.pitch}deg) rotateZ(${d.transform.angle*(180/Math.PI)}deg)`:`rotate(${d.transform.angle*(180/Math.PI)}deg)`;d._requestDomTask(()=>{this._compassIcon&&(this._compassIcon.style.transform=o)})}onAdd(d){return this._map=d,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),d.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&d.on("pitch",this._rotateCompassArrow),d.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new dy(d,this._compass,this.options.visualizePitch)),this._container}onRemove(){const d=this._map;d&&(this._container.remove(),this.options.showZoom&&d.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&d.off("pitch",this._rotateCompassArrow),d.off("rotate",this._rotateCompassArrow),this._handler&&this._handler.off(),this._handler=void 0),this._map=void 0)}_createButton(d,o){const c=J("button",d,this._container);return c.type="button",c.addEventListener("click",o),c}_setButtonTitle(d,o){if(!this._map)return;const c=this._map._getUIString(`NavigationControl.${o}`);d.setAttribute("aria-label",c),d.firstElementChild&&d.firstElementChild.setAttribute("title",c)}},GeolocateControl:class extends s.Evented{constructor(d){super(),this.options=s.extend({geolocation:s.window.navigator.geolocation},pd,d),s.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation","_onDeviceOrientation"],this),this._updateMarkerRotationThrottled=Sa(this._updateMarkerRotation,20),this._numberOfWatches=0}onAdd(d){return this._map=d,this._container=J("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkGeolocationSupport(this._setupUI),this._container}onRemove(){this._geolocationWatchID!==void 0&&(this.options.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("zoom",this._onZoom),this._map=void 0,this._numberOfWatches=0,this._noTimeout=!1}_checkGeolocationSupport(d){const o=(c=!!this.options.geolocation)=>{this._supportsGeolocation=c,d(c)};this._supportsGeolocation!==void 0?d(this._supportsGeolocation):s.window.navigator.permissions!==void 0?s.window.navigator.permissions.query({name:"geolocation"}).then(c=>o(c.state!=="denied")).catch(()=>o()):o()}_isOutOfMapMaxBounds(d){const o=this._map.getMaxBounds(),c=d.coords;return!!o&&(c.longitudeo.getEast()||c.latitudeo.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}}_onSuccess(d){if(this._map){if(this._isOutOfMapMaxBounds(d))return this._setErrorState(),this.fire(new s.Event("outofmaxbounds",d)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=d,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(d),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(d),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new s.Event("geolocate",d)),this._finish()}}_updateCamera(d){const o=new s.LngLat(d.coords.longitude,d.coords.latitude),c=d.coords.accuracy,f=this._map.getBearing(),_=s.extend({bearing:f},this.options.fitBoundsOptions);this._map.fitBounds(o.toBounds(c),_,{geolocateSource:!0})}_updateMarker(d){if(d){const o=new s.LngLat(d.coords.longitude,d.coords.latitude);this._accuracyCircleMarker.setLngLat(o).addTo(this._map),this._userLocationDotMarker.setLngLat(o).addTo(this._map),this._accuracy=d.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const d=this._map.transform,o=s.mercatorZfromAltitude(1,d._center.lat)*d.worldSize,c=Math.ceil(2*this._accuracy*o);this._circleElement.style.width=`${c}px`,this._circleElement.style.height=`${c}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_updateMarkerRotation(){this._userLocationDotMarker&&typeof this._heading=="number"?(this._userLocationDotMarker.setRotation(this._heading),this._dotElement.classList.add("mapboxgl-user-location-show-heading")):(this._dotElement.classList.remove("mapboxgl-user-location-show-heading"),this._userLocationDotMarker.setRotation(0))}_onError(d){if(this._map){if(this.options.trackUserLocation)if(d.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const o=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.setAttribute("aria-label",o),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",o),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(d.code===3&&this._noTimeout)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new s.Event("error",d)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(d){if(this._map!==void 0){if(this._container.addEventListener("contextmenu",o=>o.preventDefault()),this._geolocateButton=J("button","mapboxgl-ctrl-geolocate",this._container),J("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",d===!1){s.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");const o=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.setAttribute("aria-label",o),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",o)}else{const o=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.setAttribute("aria-label",o),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",o)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=J("div","mapboxgl-user-location"),this._dotElement.appendChild(J("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(J("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new at({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=J("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new at({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",o=>{o.geolocateSource||this._watchState!=="ACTIVE_LOCK"||o.originalEvent&&o.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this.fire(new s.Event("trackuserlocationend")))})}}_onDeviceOrientation(d){this._userLocationDotMarker&&(d.webkitCompassHeading?this._heading=d.webkitCompassHeading:d.absolute===!0&&(this._heading=-1*d.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return s.warnOnce("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 s.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._numberOfWatches--,this._noTimeout=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new s.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new s.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let d;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._numberOfWatches++,this._numberOfWatches>1?(d={maximumAge:6e5,timeout:0},this._noTimeout=!0):(d=this.options.positionOptions,this._noTimeout=!1),this._geolocationWatchID=this.options.geolocation.watchPosition(this._onSuccess,this._onError,d),this.options.showUserHeading&&this._addDeviceOrientationListener()}}else this.options.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_addDeviceOrientationListener(){const d=()=>{s.window.addEventListener("ondeviceorientationabsolute"in s.window?"deviceorientationabsolute":"deviceorientation",this._onDeviceOrientation)};s.window.DeviceMotionEvent!==void 0&&typeof s.window.DeviceMotionEvent.requestPermission=="function"?DeviceOrientationEvent.requestPermission().then(o=>{o==="granted"&&d()}).catch(console.error):d()}_clearWatch(){this.options.geolocation.clearWatch(this._geolocationWatchID),s.window.removeEventListener("deviceorientation",this._onDeviceOrientation),s.window.removeEventListener("deviceorientationabsolute",this._onDeviceOrientation),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:dt,ScaleControl:class{constructor(d){this.options=s.extend({},fd,d),this._isNumberFormatSupported=function(){try{return new Intl.NumberFormat("en",{style:"unit",unitDisplay:"short",unit:"meter"}),!0}catch{return!1}}(),s.bindAll(["_update","_setScale","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_update(){const d=this.options.maxWidth||100,o=this._map,c=o._containerHeight/2,f=o._containerWidth/2-d/2,_=o.unproject([f,c]),x=o.unproject([f+d,c]),T=_.distanceTo(x);if(this.options.unit==="imperial"){const S=3.2808*T;S>5280?this._setScale(d,S/5280,"mile"):this._setScale(d,S,"foot")}else this.options.unit==="nautical"?this._setScale(d,T/1852,"nautical-mile"):T>=1e3?this._setScale(d,T/1e3,"kilometer"):this._setScale(d,T,"meter")}_setScale(d,o,c){this._map._requestDomTask(()=>{const f=function(x){const T=Math.pow(10,`${Math.floor(x)}`.length-1);let S=x/T;return S=S>=10?10:S>=5?5:S>=3?3:S>=2?2:S>=1?1:function(C){const z=Math.pow(10,Math.ceil(-Math.log(C)/Math.LN10));return Math.round(C*z)/z}(S),T*S}(o),_=f/o;this._container.innerHTML=this._isNumberFormatSupported&&c!=="nautical-mile"?new Intl.NumberFormat(this._language,{style:"unit",unitDisplay:"short",unit:c}).format(f):`${f} ${md[c]}`,this._container.style.width=d*_+"px"})}onAdd(d){return this._map=d,this._language=d.getLanguage(),this._container=J("div","mapboxgl-ctrl mapboxgl-ctrl-scale",d.getContainer()),this._container.dir="auto",this._map.on("move",this._update),this._update(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._update),this._map=void 0}_setLanguage(d){this._language=d,this._update()}setUnit(d){this.options.unit=d,this._update()}},FullscreenControl:class{constructor(d){this._fullscreen=!1,d&&d.container&&(d.container instanceof s.window.HTMLElement?this._container=d.container:s.warnOnce("Full screen control 'container' must be a DOM element.")),s.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in s.window.document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in s.window.document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(d){return this._map=d,this._container||(this._container=this._map.getContainer()),this._controlContainer=J("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",s.warnOnce("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,s.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!s.window.document.fullscreenEnabled&&!s.window.document.webkitFullscreenEnabled)}_setupUI(){const d=this._fullscreenButton=J("button","mapboxgl-ctrl-fullscreen",this._controlContainer);J("span","mapboxgl-ctrl-icon",d).setAttribute("aria-hidden","true"),d.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),s.window.document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const d=this._getTitle();this._fullscreenButton.setAttribute("aria-label",d),this._fullscreenButton.firstElementChild&&this._fullscreenButton.firstElementChild.setAttribute("title",d)}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(s.window.document.fullscreenElement||s.window.document.webkitFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?s.window.document.exitFullscreen?s.window.document.exitFullscreen():s.window.document.webkitCancelFullScreen&&s.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},Popup:class extends s.Evented{constructor(d){super(),this.options=s.extend(Object.create(hd),d),s.bindAll(["_update","_onClose","remove","_onMouseEvent"],this),this._classList=new Set(d&&d.className?d.className.trim().split(/\s+/):[])}addTo(d){return this._map&&this.remove(),this._map=d,this.options.closeOnClick&&d.on("preclick",this._onClose),this.options.closeOnMove&&d.on("move",this._onClose),d.on("remove",this.remove),this._update(),d._addPopup(this),this._focusFirstElement(),this._trackPointer?(d.on("mousemove",this._onMouseEvent),d.on("mouseup",this._onMouseEvent),d._canvasContainer.classList.add("mapboxgl-track-pointer")):d.on("move",this._update),this.fire(new s.Event("open")),this}isOpen(){return!!this._map}remove(){this._content&&this._content.remove(),this._container&&(this._container.remove(),this._container=void 0);const d=this._map;return d&&(d.off("move",this._update),d.off("move",this._onClose),d.off("preclick",this._onClose),d.off("click",this._onClose),d.off("remove",this.remove),d.off("mousemove",this._onMouseEvent),d.off("mouseup",this._onMouseEvent),d.off("drag",this._onMouseEvent),d._canvasContainer&&d._canvasContainer.classList.remove("mapboxgl-track-pointer"),d._removePopup(this),this._map=void 0),this.fire(new s.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(d){this._lngLat=s.LngLat.convert(d),this._pos=null,this._trackPointer=!1,this._update();const o=this._map;return o&&(o.on("move",this._update),o.off("mousemove",this._onMouseEvent),o._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}trackPointer(){this._trackPointer=!0,this._pos=null,this._update();const d=this._map;return d&&(d.off("move",this._update),d.on("mousemove",this._onMouseEvent),d.on("drag",this._onMouseEvent),d._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(d){return this.setDOMContent(s.window.document.createTextNode(d))}setHTML(d){const o=s.window.document.createDocumentFragment(),c=s.window.document.createElement("body");let f;for(c.innerHTML=d;f=c.firstChild,f;)o.appendChild(f);return this.setDOMContent(o)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(d){return this.options.maxWidth=d,this._update(),this}setDOMContent(d){let o=this._content;if(o)for(;o.hasChildNodes();)o.firstChild&&o.removeChild(o.firstChild);else o=this._content=J("div","mapboxgl-popup-content",this._container||void 0);if(o.appendChild(d),this.options.closeButton){const c=this._closeButton=J("button","mapboxgl-popup-close-button",o);c.type="button",c.setAttribute("aria-label","Close popup"),c.setAttribute("aria-hidden","true"),c.innerHTML="×",c.addEventListener("click",this._onClose)}return this._update(),this._focusFirstElement(),this}addClassName(d){return this._classList.add(d),this._updateClassList(),this}removeClassName(d){return this._classList.delete(d),this._updateClassList(),this}setOffset(d){return this.options.offset=d,this._update(),this}toggleClassName(d){let o;return this._classList.delete(d)?o=!1:(this._classList.add(d),o=!0),this._updateClassList(),o}_onMouseEvent(d){this._update(d.point)}_getAnchor(d){if(this.options.anchor)return this.options.anchor;const o=this._map,c=this._container,f=this._pos;if(!o||!c||!f)return"bottom";const _=c.offsetWidth,x=c.offsetHeight,T=f.x<_/2,S=f.x>o.transform.width-_/2;if(f.y+do.transform.height-x){if(T)return"bottom-left";if(S)return"bottom-right"}return T?"left":S?"right":"bottom"}_updateClassList(){const d=this._container;if(!d)return;const o=[...this._classList];o.push("mapboxgl-popup"),this._anchor&&o.push(`mapboxgl-popup-anchor-${this._anchor}`),this._trackPointer&&o.push("mapboxgl-popup-track-pointer"),d.className=o.join(" ")}_update(d){const o=this._map,c=this._content;if(!o||!this._lngLat&&!this._trackPointer||!c)return;let f=this._container;if(f||(f=this._container=J("div","mapboxgl-popup",o.getContainer()),this._tip=J("div","mapboxgl-popup-tip",f),f.appendChild(c)),this.options.maxWidth&&f.style.maxWidth!==this.options.maxWidth&&(f.style.maxWidth=this.options.maxWidth),o.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Ia(this._lngLat,this._pos,o.transform)),!this._trackPointer||d){const _=this._pos=this._trackPointer&&d?d:o.project(this._lngLat),x=Wf(this.options.offset),T=this._anchor=this._getAnchor(x.y),S=Wf(this.options.offset,T),C=_.add(S).round();o._requestDomTask(()=>{this._container&&T&&(this._container.style.transform=`${Os[T]} translate(${C.x}px,${C.y}px)`)})}if(!this._marker&&o._showingGlobe()){const _=s.isLngLatBehindGlobe(o.transform,this._lngLat)?0:1;this._setOpacity(_)}this._updateClassList()}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const d=this._container.querySelector(uy);d&&d.focus()}_onClose(){this.remove()}_setOpacity(d){this._container&&(this._container.style.opacity=`${d}`),this._content&&(this._content.style.pointerEvents=d?"auto":"none")}},Marker:at,Style:to,LngLat:s.LngLat,LngLatBounds:s.LngLatBounds,Point:s.Point,MercatorCoordinate:s.MercatorCoordinate,FreeCameraOptions:Pf,Evented:s.Evented,config:s.config,prewarm:function(){ha().acquire(Ji)},clearPrewarmedResources:function(){const d=Or;d&&(d.isPreloaded()&&d.numActive()===1?(d.release(Ji),Or=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()"))},get accessToken(){return s.config.ACCESS_TOKEN},set accessToken(d){s.config.ACCESS_TOKEN=d},get baseApiUrl(){return s.config.API_URL},set baseApiUrl(d){s.config.API_URL=d},get workerCount(){return hr.workerCount},set workerCount(d){hr.workerCount=d},get maxParallelImageRequests(){return s.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(d){s.config.MAX_PARALLEL_IMAGE_REQUESTS=d},clearStorage(d){s.clearTileCache(d)},workerUrl:"",workerClass:null,setNow:s.exported.setNow,restoreNow:s.exported.restoreNow};return ka});var E=m;return E})})(rk);var Vx=rk.exports;const TU=g1(Vx),SU=LP({__proto__:null,default:TU},[Vx]);const lv="pk.eyJ1IjoicnVyYWxpbm5vIiwiYSI6ImNqeHl0cW0xODBlMm0zY2x0dXltYzRuazUifQ.zZBovoCHzLIW0wCZveEKzA",HT="/examples/who-wins-b2s/rural_places_5000_plus.json",AU=wU({typography:{fontFamily:"Montserrat"},palette:{primary:{main:"#00835D",light:"#A3E2B5",dark:"#26535C",contrastText:"white"}}});function CU(){var m;const e=ut.useContext(QC),n=ut.useRef(null),l=ut.useMemo(()=>new Vx.Popup().setText("Hello world!"),[]);ut.useCallback(()=>{var v;(v=n.current)==null||v.togglePopup()},[]);let h=!1;return ut.useEffect(()=>{if(e&&!e.data.hasOwnProperty("placeData")&&!h){console.log("Initial place data fetch..."),console.log(HT),h=!0;const v=window.document.getElementById("info-wrapper");v!==null&&(v.style.opacity="1.0",v.style.position="absolute",v.style.background=`rgba(46, 60, 67, 0.5) url('${e.baseURL}/images/loading.gif') no-repeat fixed center`,v.style.backgroundSize="20px"),e.setData({...(e==null?void 0:e.data)||{},placeData:null}),e==null||e.apiClient.get(HT).then(E=>{E&&E.hasOwnProperty("data")&&(console.log("Data result:",E.data.features),e.setData({...e.data,placeData:E.data.features}),h=!1,v!==null&&(v.style.opacity="0.0",v.style.pointerEvents="none",setTimeout(()=>{v.style.background="transparent"},533)))}).catch(E=>{console.error("Error fetching data:",E),h=!1,v!==null&&(v.style.opacity="0.0",v.style.pointerEvents="none",setTimeout(()=>{v.style.background="transparent"},533))})}},[e==null?void 0:e.data]),ut.createElement(EU,{theme:AU},ut.createElement("div",{className:"slippy-map"},ut.createElement(QO,{mapboxAccessToken:lv,initialViewState:{latitude:40,longitude:-100,pitch:45,zoom:3.5},style:{width:600,height:400},mapStyle:`https://api.mapbox.com/styles/v1/ruralinno/cl010e7b7001p15pe3l0306hv?access_token=${lv}`},!!(e!=null&&e.data)&&!!((m=e==null?void 0:e.data)!=null&&m.placeData)&&e.data.placeData.length>0&&!!n&&typeof n!==void 0&&ut.createElement(eI,{longitude:-122.4,latitude:37.8,color:"red",popup:l,ref:n}),ut.createElement(uF,{mapboxAccessToken:lv,position:"top-right"}),ut.createElement(t4,{position:"top-right"}),ut.createElement(e4,{position:"top-right"}),ut.createElement(n4,{position:"bottom-left",unit:"imperial"}))),ut.createElement("div",{id:"info-wrapper",style:{pointerEvents:"none",position:"absolute",top:0,minWidth:"100vw",minHeight:"100vh",transition:"opacity 5.05s ease-in-out 0.025s",opacity:"initial",background:"transparent",backgroundSize:"20px",zIndex:100}}))}const IU="https://cori-risi-apps.s3.amazonaws.com";function kU(e){sC(e).render(ut.createElement(ut.StrictMode,null,ut.createElement(bO,{baseURL:IU},ut.createElement(CU,null))))}kU(document.getElementById("app")); diff --git a/docs/frontend/dist/assets/index-27cfc78e.js b/docs/frontend/dist/assets/index-27cfc78e.js deleted file mode 100644 index d5a4954..0000000 --- a/docs/frontend/dist/assets/index-27cfc78e.js +++ /dev/null @@ -1,32 +0,0 @@ -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(l){if(l.ep)return;l.ep=!0;const o=n(l);fetch(l.href,o)}})();var rs={exports:{}},T={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Gn=Symbol.for("react.element"),hc=Symbol.for("react.portal"),vc=Symbol.for("react.fragment"),yc=Symbol.for("react.strict_mode"),gc=Symbol.for("react.profiler"),wc=Symbol.for("react.provider"),Sc=Symbol.for("react.context"),kc=Symbol.for("react.forward_ref"),Ec=Symbol.for("react.suspense"),_c=Symbol.for("react.memo"),Cc=Symbol.for("react.lazy"),Ui=Symbol.iterator;function xc(e){return e===null||typeof e!="object"?null:(e=Ui&&e[Ui]||e["@@iterator"],typeof e=="function"?e:null)}var ls={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},os=Object.assign,is={};function un(e,t,n){this.props=e,this.context=t,this.refs=is,this.updater=n||ls}un.prototype.isReactComponent={};un.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};un.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function us(){}us.prototype=un.prototype;function Bo(e,t,n){this.props=e,this.context=t,this.refs=is,this.updater=n||ls}var Ho=Bo.prototype=new us;Ho.constructor=Bo;os(Ho,un.prototype);Ho.isPureReactComponent=!0;var Ai=Array.isArray,ss=Object.prototype.hasOwnProperty,Wo={current:null},as={key:!0,ref:!0,__self:!0,__source:!0};function cs(e,t,n){var r,l={},o=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(o=""+t.key),t)ss.call(t,r)&&!as.hasOwnProperty(r)&&(l[r]=t[r]);var u=arguments.length-2;if(u===1)l.children=n;else if(1>>1,X=_[W];if(0>>1;Wl(kl,L))ytl(rr,kl)?(_[W]=rr,_[yt]=L,W=yt):(_[W]=kl,_[vt]=L,W=vt);else if(ytl(rr,L))_[W]=rr,_[yt]=L,W=yt;else break e}}return N}function l(_,N){var L=_.sortIndex-N.sortIndex;return L!==0?L:_.id-N.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,u=i.now();e.unstable_now=function(){return i.now()-u}}var s=[],a=[],p=1,h=null,m=3,g=!1,w=!1,k=!1,D=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,c=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function d(_){for(var N=n(a);N!==null;){if(N.callback===null)r(a);else if(N.startTime<=_)r(a),N.sortIndex=N.expirationTime,t(s,N);else break;N=n(a)}}function v(_){if(k=!1,d(_),!w)if(n(s)!==null)w=!0,wl(S);else{var N=n(a);N!==null&&Sl(v,N.startTime-_)}}function S(_,N){w=!1,k&&(k=!1,f(z),z=-1),g=!0;var L=m;try{for(d(N),h=n(s);h!==null&&(!(h.expirationTime>N)||_&&!Pe());){var W=h.callback;if(typeof W=="function"){h.callback=null,m=h.priorityLevel;var X=W(h.expirationTime<=N);N=e.unstable_now(),typeof X=="function"?h.callback=X:h===n(s)&&r(s),d(N)}else r(s);h=n(s)}if(h!==null)var nr=!0;else{var vt=n(a);vt!==null&&Sl(v,vt.startTime-N),nr=!1}return nr}finally{h=null,m=L,g=!1}}var x=!1,P=null,z=-1,H=5,R=-1;function Pe(){return!(e.unstable_now()-R_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):H=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return n(s)},e.unstable_next=function(_){switch(m){case 1:case 2:case 3:var N=3;break;default:N=m}var L=m;m=N;try{return _()}finally{m=L}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(_,N){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var L=m;m=_;try{return N()}finally{m=L}},e.unstable_scheduleCallback=function(_,N,L){var W=e.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0W?(_.sortIndex=L,t(a,_),n(s)===null&&_===n(a)&&(k?(f(z),z=-1):k=!0,Sl(v,L-W))):(_.sortIndex=X,t(s,_),w||g||(w=!0,wl(S))),_},e.unstable_shouldYield=Pe,e.unstable_wrapCallback=function(_){var N=m;return function(){var L=m;m=N;try{return _.apply(this,arguments)}finally{m=L}}}})(ms);ps.exports=ms;var Tc=ps.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Rc=C,ye=Tc;function y(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Xl=Object.prototype.hasOwnProperty,Mc=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Vi={},Bi={};function Oc(e){return Xl.call(Bi,e)?!0:Xl.call(Vi,e)?!1:Mc.test(e)?Bi[e]=!0:(Vi[e]=!0,!1)}function Dc(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Fc(e,t,n,r){if(t===null||typeof t>"u"||Dc(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function se(e,t,n,r,l,o,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=i}var ee={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ee[e]=new se(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ee[t]=new se(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ee[e]=new se(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ee[e]=new se(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ee[e]=new se(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ee[e]=new se(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ee[e]=new se(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ee[e]=new se(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ee[e]=new se(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ko=/[\-:]([a-z])/g;function Yo(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Ko,Yo);ee[t]=new se(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Ko,Yo);ee[t]=new se(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Ko,Yo);ee[t]=new se(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ee[e]=new se(e,1,!1,e.toLowerCase(),null,!1,!1)});ee.xlinkHref=new se("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ee[e]=new se(e,1,!1,e.toLowerCase(),null,!0,!0)});function Zo(e,t,n,r){var l=ee.hasOwnProperty(t)?ee[t]:null;(l!==null?l.type!==0:r||!(2u||l[i]!==o[u]){var s=` -`+l[i].replace(" at new "," at ");return e.displayName&&s.includes("")&&(s=s.replace("",e.displayName)),s}while(1<=i&&0<=u);break}}}finally{Cl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Sn(e):""}function Ic(e){switch(e.tag){case 5:return Sn(e.type);case 16:return Sn("Lazy");case 13:return Sn("Suspense");case 19:return Sn("SuspenseList");case 0:case 2:case 15:return e=xl(e.type,!1),e;case 11:return e=xl(e.type.render,!1),e;case 1:return e=xl(e.type,!0),e;default:return""}}function bl(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ft:return"Fragment";case Dt:return"Portal";case Gl:return"Profiler";case Xo:return"StrictMode";case Jl:return"Suspense";case ql:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ys:return(e.displayName||"Context")+".Consumer";case vs:return(e._context.displayName||"Context")+".Provider";case Go:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Jo:return t=e.displayName||null,t!==null?t:bl(e.type)||"Memo";case Je:t=e._payload,e=e._init;try{return bl(e(t))}catch{}}return null}function jc(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return bl(t);case 8:return t===Xo?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ft(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ws(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Uc(e){var t=ws(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(i){r=""+i,o.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ir(e){e._valueTracker||(e._valueTracker=Uc(e))}function Ss(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ws(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Or(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function eo(e,t){var n=t.checked;return V({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Wi(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ft(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function ks(e,t){t=t.checked,t!=null&&Zo(e,"checked",t,!1)}function to(e,t){ks(e,t);var n=ft(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?no(e,t.type,n):t.hasOwnProperty("defaultValue")&&no(e,t.type,ft(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Qi(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function no(e,t,n){(t!=="number"||Or(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var kn=Array.isArray;function Kt(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=ur.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Dn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Cn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ac=["Webkit","ms","Moz","O"];Object.keys(Cn).forEach(function(e){Ac.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Cn[t]=Cn[e]})});function xs(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Cn.hasOwnProperty(e)&&Cn[e]?(""+t).trim():t+"px"}function Ps(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=xs(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var $c=V({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function oo(e,t){if(t){if($c[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(y(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(y(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(y(61))}if(t.style!=null&&typeof t.style!="object")throw Error(y(62))}}function io(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var uo=null;function qo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var so=null,Yt=null,Zt=null;function Zi(e){if(e=bn(e)){if(typeof so!="function")throw Error(y(280));var t=e.stateNode;t&&(t=ul(t),so(e.stateNode,e.type,t))}}function zs(e){Yt?Zt?Zt.push(e):Zt=[e]:Yt=e}function Ns(){if(Yt){var e=Yt,t=Zt;if(Zt=Yt=null,Zi(e),t)for(e=0;e>>=0,e===0?32:31-(Jc(e)/qc|0)|0}var sr=64,ar=4194304;function En(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function jr(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,o=e.pingedLanes,i=n&268435455;if(i!==0){var u=i&~l;u!==0?r=En(u):(o&=i,o!==0&&(r=En(o)))}else i=n&~l,i!==0?r=En(i):o!==0&&(r=En(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,o=t&-t,l>=o||l===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Jn(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Re(t),e[t]=n}function nf(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Pn),ru=String.fromCharCode(32),lu=!1;function Zs(e,t){switch(e){case"keyup":return Rf.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xs(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var It=!1;function Of(e,t){switch(e){case"compositionend":return Xs(t);case"keypress":return t.which!==32?null:(lu=!0,ru);case"textInput":return e=t.data,e===ru&&lu?null:e;default:return null}}function Df(e,t){if(It)return e==="compositionend"||!ii&&Zs(e,t)?(e=Ks(),Cr=ri=tt=null,It=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=su(n)}}function bs(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?bs(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ea(){for(var e=window,t=Or();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Or(e.document)}return t}function ui(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Hf(e){var t=ea(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&bs(n.ownerDocument.documentElement,n)){if(r!==null&&ui(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,o=Math.min(r.start,l);r=r.end===void 0?o:Math.min(r.end,l),!e.extend&&o>r&&(l=r,r=o,o=l),l=au(n,o);var i=au(n,r);l&&i&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,jt=null,ho=null,Nn=null,vo=!1;function cu(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;vo||jt==null||jt!==Or(r)||(r=jt,"selectionStart"in r&&ui(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Nn&&$n(Nn,r)||(Nn=r,r=$r(ho,"onSelect"),0$t||(e.current=Eo[$t],Eo[$t]=null,$t--)}function F(e,t){$t++,Eo[$t]=e.current,e.current=t}var dt={},le=mt(dt),fe=mt(!1),xt=dt;function bt(e,t){var n=e.type.contextTypes;if(!n)return dt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},o;for(o in n)l[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function de(e){return e=e.childContextTypes,e!=null}function Br(){j(fe),j(le)}function yu(e,t,n){if(le.current!==dt)throw Error(y(168));F(le,t),F(fe,n)}function aa(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(y(108,jc(e)||"Unknown",l));return V({},n,r)}function Hr(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||dt,xt=le.current,F(le,e),F(fe,fe.current),!0}function gu(e,t,n){var r=e.stateNode;if(!r)throw Error(y(169));n?(e=aa(e,t,xt),r.__reactInternalMemoizedMergedChildContext=e,j(fe),j(le),F(le,e)):j(fe),F(fe,n)}var $e=null,sl=!1,Al=!1;function ca(e){$e===null?$e=[e]:$e.push(e)}function td(e){sl=!0,ca(e)}function ht(){if(!Al&&$e!==null){Al=!0;var e=0,t=O;try{var n=$e;for(O=1;e>=i,l-=i,Be=1<<32-Re(t)+l|n<z?(H=P,P=null):H=P.sibling;var R=m(f,P,d[z],v);if(R===null){P===null&&(P=H);break}e&&P&&R.alternate===null&&t(f,P),c=o(R,c,z),x===null?S=R:x.sibling=R,x=R,P=H}if(z===d.length)return n(f,P),U&>(f,z),S;if(P===null){for(;zz?(H=P,P=null):H=P.sibling;var Pe=m(f,P,R.value,v);if(Pe===null){P===null&&(P=H);break}e&&P&&Pe.alternate===null&&t(f,P),c=o(Pe,c,z),x===null?S=Pe:x.sibling=Pe,x=Pe,P=H}if(R.done)return n(f,P),U&>(f,z),S;if(P===null){for(;!R.done;z++,R=d.next())R=h(f,R.value,v),R!==null&&(c=o(R,c,z),x===null?S=R:x.sibling=R,x=R);return U&>(f,z),S}for(P=r(f,P);!R.done;z++,R=d.next())R=g(P,f,z,R.value,v),R!==null&&(e&&R.alternate!==null&&P.delete(R.key===null?z:R.key),c=o(R,c,z),x===null?S=R:x.sibling=R,x=R);return e&&P.forEach(function(cn){return t(f,cn)}),U&>(f,z),S}function D(f,c,d,v){if(typeof d=="object"&&d!==null&&d.type===Ft&&d.key===null&&(d=d.props.children),typeof d=="object"&&d!==null){switch(d.$$typeof){case or:e:{for(var S=d.key,x=c;x!==null;){if(x.key===S){if(S=d.type,S===Ft){if(x.tag===7){n(f,x.sibling),c=l(x,d.props.children),c.return=f,f=c;break e}}else if(x.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Je&&ku(S)===x.type){n(f,x.sibling),c=l(x,d.props),c.ref=yn(f,x,d),c.return=f,f=c;break e}n(f,x);break}else t(f,x);x=x.sibling}d.type===Ft?(c=Ct(d.props.children,f.mode,v,d.key),c.return=f,f=c):(v=Mr(d.type,d.key,d.props,null,f.mode,v),v.ref=yn(f,c,d),v.return=f,f=v)}return i(f);case Dt:e:{for(x=d.key;c!==null;){if(c.key===x)if(c.tag===4&&c.stateNode.containerInfo===d.containerInfo&&c.stateNode.implementation===d.implementation){n(f,c.sibling),c=l(c,d.children||[]),c.return=f,f=c;break e}else{n(f,c);break}else t(f,c);c=c.sibling}c=Yl(d,f.mode,v),c.return=f,f=c}return i(f);case Je:return x=d._init,D(f,c,x(d._payload),v)}if(kn(d))return w(f,c,d,v);if(dn(d))return k(f,c,d,v);vr(f,d)}return typeof d=="string"&&d!==""||typeof d=="number"?(d=""+d,c!==null&&c.tag===6?(n(f,c.sibling),c=l(c,d),c.return=f,f=c):(n(f,c),c=Kl(d,f.mode,v),c.return=f,f=c),i(f)):n(f,c)}return D}var tn=ma(!0),ha=ma(!1),Kr=mt(null),Yr=null,Ht=null,fi=null;function di(){fi=Ht=Yr=null}function pi(e){var t=Kr.current;j(Kr),e._currentValue=t}function xo(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Gt(e,t){Yr=e,fi=Ht=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ce=!0),e.firstContext=null)}function Ce(e){var t=e._currentValue;if(fi!==e)if(e={context:e,memoizedValue:t,next:null},Ht===null){if(Yr===null)throw Error(y(308));Ht=e,Yr.dependencies={lanes:0,firstContext:e}}else Ht=Ht.next=e;return t}var kt=null;function mi(e){kt===null?kt=[e]:kt.push(e)}function va(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,mi(t)):(n.next=l.next,l.next=n),t.interleaved=n,Ye(e,r)}function Ye(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var qe=!1;function hi(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ya(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function We(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ut(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,M&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,Ye(e,n)}return l=r.interleaved,l===null?(t.next=t,mi(r)):(t.next=l.next,l.next=t),r.interleaved=t,Ye(e,n)}function Pr(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ei(e,n)}}function Eu(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?l=o=i:o=o.next=i,n=n.next}while(n!==null);o===null?l=o=t:o=o.next=t}else l=o=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Zr(e,t,n,r){var l=e.updateQueue;qe=!1;var o=l.firstBaseUpdate,i=l.lastBaseUpdate,u=l.shared.pending;if(u!==null){l.shared.pending=null;var s=u,a=s.next;s.next=null,i===null?o=a:i.next=a,i=s;var p=e.alternate;p!==null&&(p=p.updateQueue,u=p.lastBaseUpdate,u!==i&&(u===null?p.firstBaseUpdate=a:u.next=a,p.lastBaseUpdate=s))}if(o!==null){var h=l.baseState;i=0,p=a=s=null,u=o;do{var m=u.lane,g=u.eventTime;if((r&m)===m){p!==null&&(p=p.next={eventTime:g,lane:0,tag:u.tag,payload:u.payload,callback:u.callback,next:null});e:{var w=e,k=u;switch(m=t,g=n,k.tag){case 1:if(w=k.payload,typeof w=="function"){h=w.call(g,h,m);break e}h=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=k.payload,m=typeof w=="function"?w.call(g,h,m):w,m==null)break e;h=V({},h,m);break e;case 2:qe=!0}}u.callback!==null&&u.lane!==0&&(e.flags|=64,m=l.effects,m===null?l.effects=[u]:m.push(u))}else g={eventTime:g,lane:m,tag:u.tag,payload:u.payload,callback:u.callback,next:null},p===null?(a=p=g,s=h):p=p.next=g,i|=m;if(u=u.next,u===null){if(u=l.shared.pending,u===null)break;m=u,u=m.next,m.next=null,l.lastBaseUpdate=m,l.shared.pending=null}}while(1);if(p===null&&(s=h),l.baseState=s,l.firstBaseUpdate=a,l.lastBaseUpdate=p,t=l.shared.interleaved,t!==null){l=t;do i|=l.lane,l=l.next;while(l!==t)}else o===null&&(l.shared.lanes=0);Nt|=i,e.lanes=i,e.memoizedState=h}}function _u(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Vl.transition;Vl.transition={};try{e(!1),t()}finally{O=n,Vl.transition=r}}function Da(){return xe().memoizedState}function od(e,t,n){var r=at(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Fa(e))Ia(t,n);else if(n=va(e,t,n,r),n!==null){var l=ie();Me(n,e,r,l),ja(n,t,r)}}function id(e,t,n){var r=at(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Fa(e))Ia(t,l);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var i=t.lastRenderedState,u=o(i,n);if(l.hasEagerState=!0,l.eagerState=u,Oe(u,i)){var s=t.interleaved;s===null?(l.next=l,mi(t)):(l.next=s.next,s.next=l),t.interleaved=l;return}}catch{}finally{}n=va(e,t,l,r),n!==null&&(l=ie(),Me(n,e,r,l),ja(n,t,r))}}function Fa(e){var t=e.alternate;return e===$||t!==null&&t===$}function Ia(e,t){Ln=Gr=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ja(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ei(e,n)}}var Jr={readContext:Ce,useCallback:te,useContext:te,useEffect:te,useImperativeHandle:te,useInsertionEffect:te,useLayoutEffect:te,useMemo:te,useReducer:te,useRef:te,useState:te,useDebugValue:te,useDeferredValue:te,useTransition:te,useMutableSource:te,useSyncExternalStore:te,useId:te,unstable_isNewReconciler:!1},ud={readContext:Ce,useCallback:function(e,t){return Fe().memoizedState=[e,t===void 0?null:t],e},useContext:Ce,useEffect:xu,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Nr(4194308,4,La.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Nr(4194308,4,e,t)},useInsertionEffect:function(e,t){return Nr(4,2,e,t)},useMemo:function(e,t){var n=Fe();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Fe();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=od.bind(null,$,e),[r.memoizedState,e]},useRef:function(e){var t=Fe();return e={current:e},t.memoizedState=e},useState:Cu,useDebugValue:_i,useDeferredValue:function(e){return Fe().memoizedState=e},useTransition:function(){var e=Cu(!1),t=e[0];return e=ld.bind(null,e[1]),Fe().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=$,l=Fe();if(U){if(n===void 0)throw Error(y(407));n=n()}else{if(n=t(),J===null)throw Error(y(349));zt&30||ka(r,t,n)}l.memoizedState=n;var o={value:n,getSnapshot:t};return l.queue=o,xu(_a.bind(null,r,o,e),[e]),r.flags|=2048,Zn(9,Ea.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Fe(),t=J.identifierPrefix;if(U){var n=He,r=Be;n=(r&~(1<<32-Re(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Kn++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[Ie]=t,e[Hn]=r,Ya(e,t,!1,!1),t.stateNode=e;e:{switch(i=io(n,r),n){case"dialog":I("cancel",e),I("close",e),l=r;break;case"iframe":case"object":case"embed":I("load",e),l=r;break;case"video":case"audio":for(l=0;l<_n.length;l++)I(_n[l],e);l=r;break;case"source":I("error",e),l=r;break;case"img":case"image":case"link":I("error",e),I("load",e),l=r;break;case"details":I("toggle",e),l=r;break;case"input":Wi(e,r),l=eo(e,r),I("invalid",e);break;case"option":l=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},l=V({},r,{value:void 0}),I("invalid",e);break;case"textarea":Ki(e,r),l=ro(e,r),I("invalid",e);break;default:l=r}oo(n,l),u=l;for(o in u)if(u.hasOwnProperty(o)){var s=u[o];o==="style"?Ps(e,s):o==="dangerouslySetInnerHTML"?(s=s?s.__html:void 0,s!=null&&Cs(e,s)):o==="children"?typeof s=="string"?(n!=="textarea"||s!=="")&&Dn(e,s):typeof s=="number"&&Dn(e,""+s):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(On.hasOwnProperty(o)?s!=null&&o==="onScroll"&&I("scroll",e):s!=null&&Zo(e,o,s,i))}switch(n){case"input":ir(e),Qi(e,r,!1);break;case"textarea":ir(e),Yi(e);break;case"option":r.value!=null&&e.setAttribute("value",""+ft(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?Kt(e,!!r.multiple,o,!1):r.defaultValue!=null&&Kt(e,!!r.multiple,r.defaultValue,!0);break;default:typeof l.onClick=="function"&&(e.onclick=Vr)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return ne(t),null;case 6:if(e&&t.stateNode!=null)Xa(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(y(166));if(n=Et(Qn.current),Et(Ue.current),hr(t)){if(r=t.stateNode,n=t.memoizedProps,r[Ie]=t,(o=r.nodeValue!==n)&&(e=ve,e!==null))switch(e.tag){case 3:mr(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&mr(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Ie]=t,t.stateNode=r}return ne(t),null;case 13:if(j(A),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(U&&he!==null&&t.mode&1&&!(t.flags&128))pa(),en(),t.flags|=98560,o=!1;else if(o=hr(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(y(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(y(317));o[Ie]=t}else en(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ne(t),o=!1}else Te!==null&&(Vo(Te),Te=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||A.current&1?Z===0&&(Z=3):Ti())),t.updateQueue!==null&&(t.flags|=4),ne(t),null);case 4:return nn(),Oo(e,t),e===null&&Vn(t.stateNode.containerInfo),ne(t),null;case 10:return pi(t.type._context),ne(t),null;case 17:return de(t.type)&&Br(),ne(t),null;case 19:if(j(A),o=t.memoizedState,o===null)return ne(t),null;if(r=(t.flags&128)!==0,i=o.rendering,i===null)if(r)gn(o,!1);else{if(Z!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=Xr(e),i!==null){for(t.flags|=128,gn(o,!1),r=i.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,i=o.alternate,i===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=i.childLanes,o.lanes=i.lanes,o.child=i.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=i.memoizedProps,o.memoizedState=i.memoizedState,o.updateQueue=i.updateQueue,o.type=i.type,e=i.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return F(A,A.current&1|2),t.child}e=e.sibling}o.tail!==null&&Q()>ln&&(t.flags|=128,r=!0,gn(o,!1),t.lanes=4194304)}else{if(!r)if(e=Xr(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),gn(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!U)return ne(t),null}else 2*Q()-o.renderingStartTime>ln&&n!==1073741824&&(t.flags|=128,r=!0,gn(o,!1),t.lanes=4194304);o.isBackwards?(i.sibling=t.child,t.child=i):(n=o.last,n!==null?n.sibling=i:t.child=i,o.last=i)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Q(),t.sibling=null,n=A.current,F(A,r?n&1|2:n&1),t):(ne(t),null);case 22:case 23:return Li(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?me&1073741824&&(ne(t),t.subtreeFlags&6&&(t.flags|=8192)):ne(t),null;case 24:return null;case 25:return null}throw Error(y(156,t.tag))}function hd(e,t){switch(ai(t),t.tag){case 1:return de(t.type)&&Br(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return nn(),j(fe),j(le),gi(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return yi(t),null;case 13:if(j(A),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(y(340));en()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return j(A),null;case 4:return nn(),null;case 10:return pi(t.type._context),null;case 22:case 23:return Li(),null;case 24:return null;default:return null}}var gr=!1,re=!1,vd=typeof WeakSet=="function"?WeakSet:Set,E=null;function Wt(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){B(e,t,r)}else n.current=null}function Do(e,t,n){try{n()}catch(r){B(e,t,r)}}var Iu=!1;function yd(e,t){if(yo=Ur,e=ea(),ui(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var i=0,u=-1,s=-1,a=0,p=0,h=e,m=null;t:for(;;){for(var g;h!==n||l!==0&&h.nodeType!==3||(u=i+l),h!==o||r!==0&&h.nodeType!==3||(s=i+r),h.nodeType===3&&(i+=h.nodeValue.length),(g=h.firstChild)!==null;)m=h,h=g;for(;;){if(h===e)break t;if(m===n&&++a===l&&(u=i),m===o&&++p===r&&(s=i),(g=h.nextSibling)!==null)break;h=m,m=h.parentNode}h=g}n=u===-1||s===-1?null:{start:u,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(go={focusedElem:e,selectionRange:n},Ur=!1,E=t;E!==null;)if(t=E,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,E=e;else for(;E!==null;){t=E;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var k=w.memoizedProps,D=w.memoizedState,f=t.stateNode,c=f.getSnapshotBeforeUpdate(t.elementType===t.type?k:Ne(t.type,k),D);f.__reactInternalSnapshotBeforeUpdate=c}break;case 3:var d=t.stateNode.containerInfo;d.nodeType===1?d.textContent="":d.nodeType===9&&d.documentElement&&d.removeChild(d.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(y(163))}}catch(v){B(t,t.return,v)}if(e=t.sibling,e!==null){e.return=t.return,E=e;break}E=t.return}return w=Iu,Iu=!1,w}function Tn(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var o=l.destroy;l.destroy=void 0,o!==void 0&&Do(t,n,o)}l=l.next}while(l!==r)}}function fl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Fo(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Ga(e){var t=e.alternate;t!==null&&(e.alternate=null,Ga(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ie],delete t[Hn],delete t[ko],delete t[bf],delete t[ed])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Ja(e){return e.tag===5||e.tag===3||e.tag===4}function ju(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ja(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Io(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Vr));else if(r!==4&&(e=e.child,e!==null))for(Io(e,t,n),e=e.sibling;e!==null;)Io(e,t,n),e=e.sibling}function jo(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(jo(e,t,n),e=e.sibling;e!==null;)jo(e,t,n),e=e.sibling}var q=null,Le=!1;function Ge(e,t,n){for(n=n.child;n!==null;)qa(e,t,n),n=n.sibling}function qa(e,t,n){if(je&&typeof je.onCommitFiberUnmount=="function")try{je.onCommitFiberUnmount(rl,n)}catch{}switch(n.tag){case 5:re||Wt(n,t);case 6:var r=q,l=Le;q=null,Ge(e,t,n),q=r,Le=l,q!==null&&(Le?(e=q,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):q.removeChild(n.stateNode));break;case 18:q!==null&&(Le?(e=q,n=n.stateNode,e.nodeType===8?Ul(e.parentNode,n):e.nodeType===1&&Ul(e,n),Un(e)):Ul(q,n.stateNode));break;case 4:r=q,l=Le,q=n.stateNode.containerInfo,Le=!0,Ge(e,t,n),q=r,Le=l;break;case 0:case 11:case 14:case 15:if(!re&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var o=l,i=o.destroy;o=o.tag,i!==void 0&&(o&2||o&4)&&Do(n,t,i),l=l.next}while(l!==r)}Ge(e,t,n);break;case 1:if(!re&&(Wt(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(u){B(n,t,u)}Ge(e,t,n);break;case 21:Ge(e,t,n);break;case 22:n.mode&1?(re=(r=re)||n.memoizedState!==null,Ge(e,t,n),re=r):Ge(e,t,n);break;default:Ge(e,t,n)}}function Uu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new vd),t.forEach(function(r){var l=Pd.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function ze(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=i),r&=~o}if(r=l,r=Q()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*wd(r/1960))-r,10e?16:e,nt===null)var r=!1;else{if(e=nt,nt=null,el=0,M&6)throw Error(y(331));var l=M;for(M|=4,E=e.current;E!==null;){var o=E,i=o.child;if(E.flags&16){var u=o.deletions;if(u!==null){for(var s=0;sQ()-zi?_t(e,0):Pi|=n),pe(e,t)}function ic(e,t){t===0&&(e.mode&1?(t=ar,ar<<=1,!(ar&130023424)&&(ar=4194304)):t=1);var n=ie();e=Ye(e,t),e!==null&&(Jn(e,t,n),pe(e,n))}function xd(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ic(e,n)}function Pd(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(y(314))}r!==null&&r.delete(t),ic(e,n)}var uc;uc=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||fe.current)ce=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ce=!1,pd(e,t,n);ce=!!(e.flags&131072)}else ce=!1,U&&t.flags&1048576&&fa(t,Qr,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Lr(e,t),e=t.pendingProps;var l=bt(t,le.current);Gt(t,n),l=Si(null,t,r,e,l,n);var o=ki();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,de(r)?(o=!0,Hr(t)):o=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,hi(t),l.updater=cl,t.stateNode=l,l._reactInternals=t,zo(t,r,e,n),t=To(null,t,r,!0,o,n)):(t.tag=0,U&&o&&si(t),oe(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Lr(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Nd(r),e=Ne(r,e),l){case 0:t=Lo(null,t,r,e,n);break e;case 1:t=Ou(null,t,r,e,n);break e;case 11:t=Ru(null,t,r,e,n);break e;case 14:t=Mu(null,t,r,Ne(r.type,e),n);break e}throw Error(y(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ne(r,l),Lo(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ne(r,l),Ou(e,t,r,l,n);case 3:e:{if(Wa(t),e===null)throw Error(y(387));r=t.pendingProps,o=t.memoizedState,l=o.element,ya(e,t),Zr(t,r,null,n);var i=t.memoizedState;if(r=i.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){l=rn(Error(y(423)),t),t=Du(e,t,r,n,l);break e}else if(r!==l){l=rn(Error(y(424)),t),t=Du(e,t,r,n,l);break e}else for(he=it(t.stateNode.containerInfo.firstChild),ve=t,U=!0,Te=null,n=ha(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(en(),r===l){t=Ze(e,t,n);break e}oe(e,t,r,n)}t=t.child}return t;case 5:return ga(t),e===null&&Co(t),r=t.type,l=t.pendingProps,o=e!==null?e.memoizedProps:null,i=l.children,wo(r,l)?i=null:o!==null&&wo(r,o)&&(t.flags|=32),Ha(e,t),oe(e,t,i,n),t.child;case 6:return e===null&&Co(t),null;case 13:return Qa(e,t,n);case 4:return vi(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=tn(t,null,r,n):oe(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ne(r,l),Ru(e,t,r,l,n);case 7:return oe(e,t,t.pendingProps,n),t.child;case 8:return oe(e,t,t.pendingProps.children,n),t.child;case 12:return oe(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,o=t.memoizedProps,i=l.value,F(Kr,r._currentValue),r._currentValue=i,o!==null)if(Oe(o.value,i)){if(o.children===l.children&&!fe.current){t=Ze(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var u=o.dependencies;if(u!==null){i=o.child;for(var s=u.firstContext;s!==null;){if(s.context===r){if(o.tag===1){s=We(-1,n&-n),s.tag=2;var a=o.updateQueue;if(a!==null){a=a.shared;var p=a.pending;p===null?s.next=s:(s.next=p.next,p.next=s),a.pending=s}}o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),xo(o.return,n,t),u.lanes|=n;break}s=s.next}}else if(o.tag===10)i=o.type===t.type?null:o.child;else if(o.tag===18){if(i=o.return,i===null)throw Error(y(341));i.lanes|=n,u=i.alternate,u!==null&&(u.lanes|=n),xo(i,n,t),i=o.sibling}else i=o.child;if(i!==null)i.return=o;else for(i=o;i!==null;){if(i===t){i=null;break}if(o=i.sibling,o!==null){o.return=i.return,i=o;break}i=i.return}o=i}oe(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,Gt(t,n),l=Ce(l),r=r(l),t.flags|=1,oe(e,t,r,n),t.child;case 14:return r=t.type,l=Ne(r,t.pendingProps),l=Ne(r.type,l),Mu(e,t,r,l,n);case 15:return Va(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ne(r,l),Lr(e,t),t.tag=1,de(r)?(e=!0,Hr(t)):e=!1,Gt(t,n),Ua(t,r,l),zo(t,r,l,n),To(null,t,r,!0,e,n);case 19:return Ka(e,t,n);case 22:return Ba(e,t,n)}throw Error(y(156,t.tag))};function sc(e,t){return Fs(e,t)}function zd(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ee(e,t,n,r){return new zd(e,t,n,r)}function Ri(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Nd(e){if(typeof e=="function")return Ri(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Go)return 11;if(e===Jo)return 14}return 2}function ct(e,t){var n=e.alternate;return n===null?(n=Ee(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Mr(e,t,n,r,l,o){var i=2;if(r=e,typeof e=="function")Ri(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Ft:return Ct(n.children,l,o,t);case Xo:i=8,l|=8;break;case Gl:return e=Ee(12,n,t,l|2),e.elementType=Gl,e.lanes=o,e;case Jl:return e=Ee(13,n,t,l),e.elementType=Jl,e.lanes=o,e;case ql:return e=Ee(19,n,t,l),e.elementType=ql,e.lanes=o,e;case gs:return pl(n,l,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case vs:i=10;break e;case ys:i=9;break e;case Go:i=11;break e;case Jo:i=14;break e;case Je:i=16,r=null;break e}throw Error(y(130,e==null?e:typeof e,""))}return t=Ee(i,n,t,l),t.elementType=e,t.type=r,t.lanes=o,t}function Ct(e,t,n,r){return e=Ee(7,e,r,t),e.lanes=n,e}function pl(e,t,n,r){return e=Ee(22,e,r,t),e.elementType=gs,e.lanes=n,e.stateNode={isHidden:!1},e}function Kl(e,t,n){return e=Ee(6,e,null,t),e.lanes=n,e}function Yl(e,t,n){return t=Ee(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Ld(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=zl(0),this.expirationTimes=zl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zl(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function Mi(e,t,n,r,l,o,i,u,s){return e=new Ld(e,t,n,u,s),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Ee(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},hi(o),e}function Td(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(dc)}catch(e){console.error(e)}}dc(),ds.exports=ge;var Ii=ds.exports,pc,Ku=Ii;pc=Ku.createRoot,Ku.hydrateRoot;const Fd="modulepreload",Id=function(e){return"/"+e},Yu={},jd=function(t,n,r){if(!n||n.length===0)return t();const l=document.getElementsByTagName("link");return Promise.all(n.map(o=>{if(o=Id(o),o in Yu)return;Yu[o]=!0;const i=o.endsWith(".css"),u=i?'[rel="stylesheet"]':"";if(!!r)for(let p=l.length-1;p>=0;p--){const h=l[p];if(h.href===o&&(!i||h.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${u}`))return;const a=document.createElement("link");if(a.rel=i?"stylesheet":Fd,i||(a.as="script",a.crossOrigin=""),a.href=o,document.head.appendChild(a),i)return new Promise((p,h)=>{a.addEventListener("load",p),a.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${o}`)))})})).then(()=>t()).catch(o=>{const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=o,window.dispatchEvent(i),!i.defaultPrevented)throw o})},Ud=C.createContext(null);function Ad(e,t){const n=Array.isArray(e)?e[0]:e?e.x:0,r=Array.isArray(e)?e[1]:e?e.y:0,l=Array.isArray(t)?t[0]:t?t.x:0,o=Array.isArray(t)?t[1]:t?t.y:0;return n===l&&r===o}function Ve(e,t){if(e===t)return!0;if(!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n{let l=null;"interactive"in r&&(l=Object.assign({},r),delete l.interactive);const o=t[r.ref];if(o){l=l||Object.assign({},r),delete l.ref;for(const i of Vd)i in o&&(l[i]=o[i])}return l||r});return{...e,layers:n}}const qu={version:8,sources:{},layers:[]},bu={mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",click:"onClick",dblclick:"onDblClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mouseout:"onMouseOut",contextmenu:"onContextMenu",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",touchcancel:"onTouchCancel"},Zl={movestart:"onMoveStart",move:"onMove",moveend:"onMoveEnd",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",zoomstart:"onZoomStart",zoom:"onZoom",zoomend:"onZoomEnd",rotatestart:"onRotateStart",rotate:"onRotate",rotateend:"onRotateEnd",pitchstart:"onPitchStart",pitch:"onPitch",pitchend:"onPitchEnd"},es={wheel:"onWheel",boxzoomstart:"onBoxZoomStart",boxzoomend:"onBoxZoomEnd",boxzoomcancel:"onBoxZoomCancel",resize:"onResize",load:"onLoad",render:"onRender",idle:"onIdle",remove:"onRemove",data:"onData",styledata:"onStyleData",sourcedata:"onSourceData",error:"onError"},Bd=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],Hd=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class on{constructor(t,n,r){this._map=null,this._internalUpdate=!1,this._inRender=!1,this._hoveredFeatures=null,this._deferredEvents={move:!1,zoom:!1,pitch:!1,rotate:!1},this._onEvent=l=>{const o=this.props[es[l.type]];o?o(l):l.type==="error"&&console.error(l.error)},this._onPointerEvent=l=>{(l.type==="mousemove"||l.type==="mouseout")&&this._updateHover(l);const o=this.props[bu[l.type]];o&&(this.props.interactiveLayerIds&&l.type!=="mouseover"&&l.type!=="mouseout"&&(l.features=this._hoveredFeatures||this._queryRenderedFeatures(l.point)),o(l),delete l.features)},this._onCameraEvent=l=>{if(!this._internalUpdate){const o=this.props[Zl[l.type]];o&&o(l)}l.type in this._deferredEvents&&(this._deferredEvents[l.type]=!1)},this._MapClass=t,this.props=n,this._initialize(r)}get map(){return this._map}get transform(){return this._renderTransform}setProps(t){const n=this.props;this.props=t;const r=this._updateSettings(t,n);r&&this._createShadowTransform(this._map);const l=this._updateSize(t),o=this._updateViewState(t,!0);this._updateStyle(t,n),this._updateStyleComponents(t,n),this._updateHandlers(t,n),(r||l||o&&!this._map.isMoving())&&this.redraw()}static reuse(t,n){const r=on.savedMaps.pop();if(!r)return null;const l=r.map,o=l.getContainer();for(n.className=o.className;o.childNodes.length>0;)n.appendChild(o.childNodes[0]);l._container=n;const i=l._resizeObserver;i&&(i.disconnect(),i.observe(n)),r.setProps({...t,styleDiffing:!1}),l.resize();const{initialViewState:u}=t;return u&&(u.bounds?l.fitBounds(u.bounds,{...u.fitBoundsOptions,duration:0}):r._updateViewState(u,!1)),l.isStyleLoaded()?l.fire("load"):l.once("styledata",()=>l.fire("load")),l._update(),r}_initialize(t){const{props:n}=this,{mapStyle:r=qu}=n,l={...n,...n.initialViewState,accessToken:n.mapboxAccessToken||Wd()||null,container:t,style:Ju(r)},o=l.initialViewState||l.viewState||l;if(Object.assign(l,{center:[o.longitude||0,o.latitude||0],zoom:o.zoom||0,pitch:o.pitch||0,bearing:o.bearing||0}),n.gl){const p=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=p,n.gl)}const i=new this._MapClass(l);o.padding&&i.setPadding(o.padding),n.cursor&&(i.getCanvas().style.cursor=n.cursor),this._createShadowTransform(i);const u=i._render;i._render=p=>{this._inRender=!0,u.call(i,p),this._inRender=!1};const s=i._renderTaskQueue.run;i._renderTaskQueue.run=p=>{s.call(i._renderTaskQueue,p),this._onBeforeRepaint()},i.on("render",()=>this._onAfterRepaint());const a=i.fire;i.fire=this._fireEvent.bind(this,a),i.on("resize",()=>{this._renderTransform.resize(i.transform.width,i.transform.height)}),i.on("styledata",()=>{this._updateStyleComponents(this.props,{}),Zu(i.transform,this._renderTransform)}),i.on("sourcedata",()=>this._updateStyleComponents(this.props,{}));for(const p in bu)i.on(p,this._onPointerEvent);for(const p in Zl)i.on(p,this._onCameraEvent);for(const p in es)i.on(p,this._onEvent);this._map=i}recycle(){const n=this.map.getContainer().querySelector("[mapboxgl-children]");n==null||n.remove(),on.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const t=this._map;!this._inRender&&t.style&&(t._frame&&(t._frame.cancel(),t._frame=null),t._render())}_createShadowTransform(t){const n=$d(t.transform);t.painter.transform=n,this._renderTransform=n}_updateSize(t){const{viewState:n}=t;if(n){const r=this._map;if(n.width!==r.transform.width||n.height!==r.transform.height)return r.resize(),!0}return!1}_updateViewState(t,n){if(this._internalUpdate)return!1;const r=this._map,l=this._renderTransform,{zoom:o,pitch:i,bearing:u}=l,s=r.isMoving();s&&(l.cameraElevationReference="sea");const a=Gu(l,{...Xu(r.transform),...t});if(s&&(l.cameraElevationReference="ground"),a&&n){const p=this._deferredEvents;p.move=!0,p.zoom||(p.zoom=o!==l.zoom),p.rotate||(p.rotate=u!==l.bearing),p.pitch||(p.pitch=i!==l.pitch)}return s||Gu(r.transform,t),a}_updateSettings(t,n){const r=this._map;let l=!1;for(const o of Bd)if(o in t&&!Ve(t[o],n[o])){l=!0;const i=r[`set${o[0].toUpperCase()}${o.slice(1)}`];i==null||i.call(r,t[o])}return l}_updateStyle(t,n){if(t.cursor!==n.cursor&&(this._map.getCanvas().style.cursor=t.cursor||""),t.mapStyle!==n.mapStyle){const{mapStyle:r=qu,styleDiffing:l=!0}=t,o={diff:l};return"localIdeographFontFamily"in t&&(o.localIdeographFontFamily=t.localIdeographFontFamily),this._map.setStyle(Ju(r),o),!0}return!1}_updateStyleComponents(t,n){const r=this._map;let l=!1;return r.isStyleLoaded()&&("light"in t&&r.setLight&&!Ve(t.light,n.light)&&(l=!0,r.setLight(t.light)),"fog"in t&&r.setFog&&!Ve(t.fog,n.fog)&&(l=!0,r.setFog(t.fog)),"terrain"in t&&r.setTerrain&&!Ve(t.terrain,n.terrain)&&(!t.terrain||r.getSource(t.terrain.source))&&(l=!0,r.setTerrain(t.terrain))),l}_updateHandlers(t,n){var r,l;const o=this._map;let i=!1;for(const u of Hd){const s=(r=t[u])!==null&&r!==void 0?r:!0,a=(l=n[u])!==null&&l!==void 0?l:!0;Ve(s,a)||(i=!0,s?o[u].enable(s):o[u].disable())}return i}_queryRenderedFeatures(t){const n=this._map,r=n.transform,{interactiveLayerIds:l=[]}=this.props;try{return n.transform=this._renderTransform,n.queryRenderedFeatures(t,{layers:l.filter(n.getLayer.bind(n))})}catch{return[]}finally{n.transform=r}}_updateHover(t){var n;const{props:r}=this;if(r.interactiveLayerIds&&(r.onMouseMove||r.onMouseEnter||r.onMouseLeave)){const o=t.type,i=((n=this._hoveredFeatures)===null||n===void 0?void 0:n.length)>0,u=this._queryRenderedFeatures(t.point),s=u.length>0;!s&&i&&(t.type="mouseleave",this._onPointerEvent(t)),this._hoveredFeatures=u,s&&!i&&(t.type="mouseenter",this._onPointerEvent(t)),t.type=o}else this._hoveredFeatures=null}_fireEvent(t,n,r){const l=this._map,o=l.transform,i=typeof n=="string"?n:n.type;return i==="move"&&this._updateViewState(this.props,!1),i in Zl&&(typeof n=="object"&&(n.viewState=Xu(o)),this._map.isMoving())?(l.transform=this._renderTransform,t.call(l,n,r),l.transform=o,l):(t.call(l,n,r),l)}_onBeforeRepaint(){const t=this._map;this._internalUpdate=!0;for(const r in this._deferredEvents)this._deferredEvents[r]&&t.fire(r);this._internalUpdate=!1;const n=this._map.transform;t.transform=this._renderTransform,this._onAfterRepaint=()=>{Zu(this._renderTransform,n),t.transform=n}}}on.savedMaps=[];function Wd(){let e=null;if(typeof location<"u"){const t=/access_token=([^&\/]*)/.exec(location.search);e=t&&t[1]}try{e=e||void 0}catch{}try{e=e||{}.REACT_APP_MAPBOX_ACCESS_TOKEN}catch{}return e}const Qd=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function Kd(e){if(!e)return null;const t=e.map,n={getMap:()=>t,getCenter:()=>e.transform.center,getZoom:()=>e.transform.zoom,getBearing:()=>e.transform.bearing,getPitch:()=>e.transform.pitch,getPadding:()=>e.transform.padding,getBounds:()=>e.transform.getBounds(),project:r=>{const l=t.transform;t.transform=e.transform;const o=t.project(r);return t.transform=l,o},unproject:r=>{const l=t.transform;t.transform=e.transform;const o=t.unproject(r);return t.transform=l,o},queryTerrainElevation:(r,l)=>{const o=t.transform;t.transform=e.transform;const i=t.queryTerrainElevation(r,l);return t.transform=o,i},queryRenderedFeatures:(r,l)=>{const o=t.transform;t.transform=e.transform;const i=t.queryRenderedFeatures(r,l);return t.transform=o,i}};for(const r of Yd(t))!(r in n)&&!Qd.includes(r)&&(n[r]=t[r].bind(t));return n}function Yd(e){const t=new Set;let n=e;for(;n;){for(const r of Object.getOwnPropertyNames(n))r[0]!=="_"&&typeof e[r]=="function"&&r!=="fire"&&r!=="setEventedParent"&&t.add(r);n=Object.getPrototypeOf(n)}return Array.from(t)}const Zd=typeof document<"u"?C.useLayoutEffect:C.useEffect,Xd=["baseApiUrl","maxParallelImageRequests","workerClass","workerCount","workerUrl"];function Gd(e,t){for(const r of Xd)r in t&&(e[r]=t[r]);const{RTLTextPlugin:n="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js"}=t;n&&e.getRTLTextPluginStatus&&e.getRTLTextPluginStatus()==="unavailable"&&e.setRTLTextPlugin(n,r=>{r&&console.error(r)},!0)}const gl=C.createContext(null);function Jd(e,t,n){const r=C.useContext(Ud),[l,o]=C.useState(null),i=C.useRef(),{current:u}=C.useRef({mapLib:null,map:null});C.useEffect(()=>{const p=e.mapLib;let h=!0,m;return Promise.resolve(p||n).then(g=>{if(!h)return;if(!g)throw new Error("Invalid mapLib");const w="Map"in g?g:g.default;if(!w.Map)throw new Error("Invalid mapLib");if(Gd(w,e),!w.supported||w.supported(e))e.reuseMaps&&(m=on.reuse(e,i.current)),m||(m=new on(w.Map,e,i.current)),u.map=Kd(m),u.mapLib=w,o(m),r==null||r.onMapMount(u.map,e.id);else throw new Error("Map is not supported by this browser")}).catch(g=>{const{onError:w}=e;w?w({type:"error",target:null,originalEvent:null,error:g}):console.error(g)}),()=>{h=!1,m&&(r==null||r.onMapUnmount(e.id),e.reuseMaps?m.recycle():m.destroy())}},[]),Zd(()=>{l&&l.setProps(e)}),C.useImperativeHandle(t,()=>u.map,[l]);const s=C.useMemo(()=>({position:"relative",width:"100%",height:"100%",...e.style}),[e.style]),a={height:"100%"};return C.createElement("div",{id:e.id,ref:i,style:s},l&&C.createElement(gl.Provider,{value:u},C.createElement("div",{"mapboxgl-children":"",style:a},e.children)))}const qd=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function Mt(e,t){if(!e||!t)return;const n=e.style;for(const r in t){const l=t[r];Number.isFinite(l)&&!qd.test(r)?n[r]=`${l}px`:n[r]=l}}function bd(e,t){const{map:n,mapLib:r}=C.useContext(gl),l=C.useRef({props:e});l.current.props=e;const o=C.useMemo(()=>{let k=!1;C.Children.forEach(e.children,c=>{c&&(k=!0)});const D={...e,element:k?document.createElement("div"):null},f=new r.Marker(D);return f.setLngLat([e.longitude,e.latitude]),f.getElement().addEventListener("click",c=>{var d,v;(v=(d=l.current.props).onClick)===null||v===void 0||v.call(d,{type:"click",target:f,originalEvent:c})}),f.on("dragstart",c=>{var d,v;const S=c;S.lngLat=o.getLngLat(),(v=(d=l.current.props).onDragStart)===null||v===void 0||v.call(d,S)}),f.on("drag",c=>{var d,v;const S=c;S.lngLat=o.getLngLat(),(v=(d=l.current.props).onDrag)===null||v===void 0||v.call(d,S)}),f.on("dragend",c=>{var d,v;const S=c;S.lngLat=o.getLngLat(),(v=(d=l.current.props).onDragEnd)===null||v===void 0||v.call(d,S)}),f},[]);C.useEffect(()=>(o.addTo(n.getMap()),()=>{o.remove()}),[]);const{longitude:i,latitude:u,offset:s,style:a,draggable:p=!1,popup:h=null,rotation:m=0,rotationAlignment:g="auto",pitchAlignment:w="auto"}=e;return C.useEffect(()=>{Mt(o.getElement(),a)},[a]),C.useImperativeHandle(t,()=>o,[]),(o.getLngLat().lng!==i||o.getLngLat().lat!==u)&&o.setLngLat([i,u]),s&&!Ad(o.getOffset(),s)&&o.setOffset(s),o.isDraggable()!==p&&o.setDraggable(p),o.getRotation()!==m&&o.setRotation(m),o.getRotationAlignment()!==g&&o.setRotationAlignment(g),o.getPitchAlignment()!==w&&o.setPitchAlignment(w),o.getPopup()!==h&&o.setPopup(h),Ii.createPortal(e.children,o.getElement())}C.memo(C.forwardRef(bd));function ts(e){return new Set(e?e.trim().split(/\s+/):[])}function ep(e,t){const{map:n,mapLib:r}=C.useContext(gl),l=C.useMemo(()=>document.createElement("div"),[]),o=C.useRef({props:e});o.current.props=e;const i=C.useMemo(()=>{const u={...e},s=new r.Popup(u);return s.setLngLat([e.longitude,e.latitude]),s.once("open",a=>{var p,h;(h=(p=o.current.props).onOpen)===null||h===void 0||h.call(p,a)}),s},[]);if(C.useEffect(()=>{const u=s=>{var a,p;(p=(a=o.current.props).onClose)===null||p===void 0||p.call(a,s)};return i.on("close",u),i.setDOMContent(l).addTo(n.getMap()),()=>{i.off("close",u),i.isOpen()&&i.remove()}},[]),C.useEffect(()=>{Mt(i.getElement(),e.style)},[e.style]),C.useImperativeHandle(t,()=>i,[]),i.isOpen()&&((i.getLngLat().lng!==e.longitude||i.getLngLat().lat!==e.latitude)&&i.setLngLat([e.longitude,e.latitude]),e.offset&&!Ve(i.options.offset,e.offset)&&i.setOffset(e.offset),(i.options.anchor!==e.anchor||i.options.maxWidth!==e.maxWidth)&&(i.options.anchor=e.anchor,i.setMaxWidth(e.maxWidth)),i.options.className!==e.className)){const u=ts(i.options.className),s=ts(e.className);for(const a of u)s.has(a)||i.removeClassName(a);for(const a of s)u.has(a)||i.addClassName(a);i.options.className=e.className}return Ii.createPortal(e.children,l)}C.memo(C.forwardRef(ep));function tr(e,t,n,r){const l=C.useContext(gl),o=C.useMemo(()=>e(l),[]);return C.useEffect(()=>{const i=r||n||t,u=typeof t=="function"&&typeof n=="function"?t:null,s=typeof n=="function"?n:typeof t=="function"?t:null,{map:a}=l;return a.hasControl(o)||(a.addControl(o,i==null?void 0:i.position),u&&u(l)),()=>{s&&s(l),a.hasControl(o)&&a.removeControl(o)}},[]),o}function tp(e){const t=tr(({mapLib:n})=>new n.AttributionControl(e),{position:e.position});return C.useEffect(()=>{Mt(t._container,e.style)},[e.style]),null}C.memo(tp);function np(e){const t=tr(({mapLib:n})=>new n.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return C.useEffect(()=>{Mt(t._controlContainer,e.style)},[e.style]),null}C.memo(np);function rp(e,t){const n=C.useRef({props:e}),r=tr(({mapLib:l})=>{const o=new l.GeolocateControl(e),i=o._setupUI;return o._setupUI=u=>{o._container.hasChildNodes()||i(u)},o.on("geolocate",u=>{var s,a;(a=(s=n.current.props).onGeolocate)===null||a===void 0||a.call(s,u)}),o.on("error",u=>{var s,a;(a=(s=n.current.props).onError)===null||a===void 0||a.call(s,u)}),o.on("outofmaxbounds",u=>{var s,a;(a=(s=n.current.props).onOutOfMaxBounds)===null||a===void 0||a.call(s,u)}),o.on("trackuserlocationstart",u=>{var s,a;(a=(s=n.current.props).onTrackUserLocationStart)===null||a===void 0||a.call(s,u)}),o.on("trackuserlocationend",u=>{var s,a;(a=(s=n.current.props).onTrackUserLocationEnd)===null||a===void 0||a.call(s,u)}),o},{position:e.position});return n.current.props=e,C.useImperativeHandle(t,()=>r,[]),C.useEffect(()=>{Mt(r._container,e.style)},[e.style]),null}const lp=C.memo(C.forwardRef(rp));function op(e){const t=tr(({mapLib:n})=>new n.NavigationControl(e),{position:e.position});return C.useEffect(()=>{Mt(t._container,e.style)},[e.style]),null}const ip=C.memo(op);function up(e){const t=tr(({mapLib:o})=>new o.ScaleControl(e),{position:e.position}),n=C.useRef(e),r=n.current;n.current=e;const{style:l}=e;return e.maxWidth!==void 0&&e.maxWidth!==r.maxWidth&&(t.options.maxWidth=e.maxWidth),e.unit!==void 0&&e.unit!==r.unit&&t.setUnit(e.unit),C.useEffect(()=>{Mt(t._container,l)},[l]),null}const sp=C.memo(up),ap=jd(()=>import("./mapbox-gl-87c162e0.js").then(e=>e.m),[]),cp=(()=>C.forwardRef(function(t,n){return Jd(t,n,ap)}))(),fp=ip,dp=lp,pp=sp,mp={"slippy-map":"_slippy-map_1sfxu_2"};const ns="pk.eyJ1IjoicnVyYWxpbm5vIiwiYSI6ImNqeHl0cW0xODBlMm0zY2x0dXltYzRuazUifQ.zZBovoCHzLIW0wCZveEKzA";function hp(){return console.log("Re-rendering App component with MAPBOX_TOKEN: ",ns),C.createElement(C.Fragment,null,C.createElement("div",{className:mp["slippy-map"]},C.createElement(cp,{mapboxAccessToken:ns,mapStyle:"mapbox://styles/mapbox/light-v9",initialViewState:{latitude:39,longitude:-97.5,pitch:45,zoom:4.15},onMove:e=>{}},C.createElement(dp,{position:"top-right"}),C.createElement(fp,{position:"top-right"}),C.createElement(pp,{position:"bottom-left",unit:"imperial"}))))}function vp(e){pc(e).render(C.createElement(C.StrictMode,null,C.createElement(hp,null)))}vp(document.getElementById("app")); diff --git a/docs/frontend/dist/assets/index-732dca48.css b/docs/frontend/dist/assets/index-732dca48.css deleted file mode 100644 index 95fa18c..0000000 --- a/docs/frontend/dist/assets/index-732dca48.css +++ /dev/null @@ -1 +0,0 @@ -@import"https://fonts.googleapis.com/css2?family=Bitter:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap";@import"https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap";@import"https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap";@import"https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;500;600;700&display=swap";*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:theme("borderColor.DEFAULT",currentColor)}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:theme("fontFamily.sans",ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:theme("fontFamily.sans[1].fontFeatureSettings",normal);font-variation-settings:theme("fontFamily.sans[1].fontVariationSettings",normal)}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}code,kbd,samp,pre{font-family:theme("fontFamily.mono",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-size:1em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}::-webkit-search-decoration{-webkit-appearance:none}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1;color:theme("colors.gray.400",#9ca3af)}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}@font-face{font-family:TT Hoves;font-weight:400;font-style:normal;src:local("TT Hoves"),url("https://cori-risi-apps.s3.amazonaws.com/fonts/TypeType - TT Hoves Regular.ttf") format("truetype"),url(https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Regular/font.woff) format("woff"),url(https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Regular/font.woff2) format("woff2")}@font-face{font-family:TT Hoves Bold;font-weight:700;font-style:normal;src:local("TT Hoves"),url("https://cori-risi-apps.s3.amazonaws.com/fonts/TypeType - TT Hoves Bold.ttf") format("truetype"),url(https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Bold/font.woff) format("woff"),url(https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Bold/font.woff2) format("woff2")}@font-face{font-family:TT Hoves Medium;font-weight:500;font-style:normal;src:local("TT Hoves"),url("https://cori-risi-apps.s3.amazonaws.com/fonts/TypeType - TT Hoves Medium.ttf") format("truetype"),url(https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Medium/font.woff) format("woff"),url(https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Medium/font.woff2) format("woff2")}@font-face{font-family:TT Hoves Italic;font-weight:400;font-style:italic;src:local("TT Hoves"),url("https://cori-risi-apps.s3.amazonaws.com/fonts/TypeType - TT Hoves Italic.ttf") format("truetype"),url(https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Italic/font.woff) format("woff"),url(https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Italic/font.woff2) format("woff2")}html,body{font-family:Montserrat,Bitter,serif}h1,h2,h3,h4,h5,h6{font-weight:400;font-family:Montserrat,TT Hoves,sans-serif}h1,h2,h6{font-family:Montserrat,TT Hoves Bold,TT Hoves,sans-serif;font-weight:700}h3{font-family:Montserrat,TT Hoves Medium,TT Hoves,Bitter,serif;font-weight:400}h4,h5{font-family:Montserrat,TT Hoves Medium,TT Hoves,sans-serif;font-weight:500}h1{font-size:3.2em;line-height:1.16}h2{font-size:2.4em;line-height:1.25}h3{font-size:1.8em;line-height:1.3}h4{font-size:1.5em;line-height:1.3}h5{font-size:1.2em;line-height:1.3}h6{font-size:.76em;line-height:1.35}@media (min-width: 550px){h1{font-size:2.8em}h2{font-size:2.3em}h3{font-size:1.8em}h4{font-size:1.5em}h5{font-size:1.2em}h6{font-size:1em}}p{font-family:Bitter,serif;font-size:1em;line-height:1.7}a{font-family:Bitter,serif;font-size:1em;font-weight:400;line-height:1.7;text-decoration:underline}a:hover{text-decoration:underline;cursor:pointer}.nav-item a,.sidebar-item a{font-family:Montserrat,TT Hoves,sans-serif;font-weight:400}body{margin:0;font-family:Bitter,Montserrat,serif}#map{width:100%;height:100%;z-index:1}#map * .mapboxgl-ctrl{font-family:Bitter,serif}.control-panel{position:absolute;top:0;left:0;max-width:320px;background:#fff;box-shadow:0 2px 4px #0000004d;padding:12px 24px;margin:20px;font-size:13px;line-height:2;color:#6b6b76;text-transform:uppercase;outline:none;z-index:2}._slippy-map_1sfxu_2{position:relative;width:100%;height:100%;overflow:hidden}._slippy-map_1sfxu_2>*{overflow:hidden}.mapboxgl-map{-webkit-tap-highlight-color:rgb(0 0 0/0);font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative}.mapboxgl-canvas{left:0;position:absolute;top:0}.mapboxgl-map:-webkit-full-screen{height:100%;width:100%}.mapboxgl-canary{background-color:salmon}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass{cursor:grab;-webkit-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active{cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas{touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:none}.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.mapboxgl-ctrl-top-left{left:0;top:0}.mapboxgl-ctrl-top-right{right:0;top:0}.mapboxgl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-bottom-right{bottom:0;right:0}.mapboxgl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{float:left;margin:10px 0 0 10px}.mapboxgl-ctrl-top-right .mapboxgl-ctrl{float:right;margin:10px 10px 0 0}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl{float:left;margin:0 0 10px 10px}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl{float:right;margin:0 10px 10px 0}.mapboxgl-ctrl-group{background:#fff;border-radius:4px}.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px #0000001a}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.mapboxgl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;overflow:hidden;padding:0;width:29px}.mapboxgl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon{background-color:transparent}.mapboxgl-ctrl-group button+button{border-top:1px solid ButtonText}}.mapboxgl-ctrl-attrib-button:focus,.mapboxgl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon{opacity:.25}.mapboxgl-ctrl-group button:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:only-child{border-radius:inherit}.mapboxgl-ctrl button:not(:disabled):hover{background-color:#0000000d}.mapboxgl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23999'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon{animation:mapboxgl-spin 2s linear infinite}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23000'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}}@keyframes mapboxgl-spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='0.3' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='0.9' fill='%23fff'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.mapboxgl-ctrl-logo.mapboxgl-compact{width:23px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='1' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='1' fill='%23fff'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='1' stroke='%23fff' stroke-width='3' fill='%23fff'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='1' fill='%23000'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib{background-color:#ffffff80;margin:0;padding:0 5px}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact{background-color:#fff;border-radius:12px;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib-button{background-color:#ffffff80;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-top-left .mapboxgl-ctrl-attrib-button{left:0}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-inner{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-button{background-color:#0000000d}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{right:0;top:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{left:0;top:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.mapboxgl-ctrl-attrib a{color:#000000bf;text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-ctrl-attrib .mapbox-improve-map{font-weight:700;margin-left:2px}.mapboxgl-attrib-empty{display:none}.mapboxgl-ctrl-scale{background-color:#ffffffbf;border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px;white-space:nowrap}.mapboxgl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right{flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right{flex-direction:column-reverse}.mapboxgl-popup-anchor-left{flex-direction:row}.mapboxgl-popup-anchor-right{flex-direction:row-reverse}.mapboxgl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.mapboxgl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.mapboxgl-popup-close-button:hover{background-color:#0000000d}.mapboxgl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px #0000001a;padding:10px 10px 15px;pointer-events:auto;position:relative}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer{display:none}.mapboxgl-marker{left:0;opacity:1;position:absolute;top:0;transition:opacity .2s;will-change:transform}.mapboxgl-user-location-dot,.mapboxgl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.mapboxgl-user-location-dot:before{animation:mapboxgl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.mapboxgl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px #00000059;box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading{height:0;width:0}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:after,.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:before{border-bottom:7.5px solid #4aa1eb;content:"";position:absolute}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:before{border-left:7.5px solid transparent;transform:translateY(-28px) skewY(-20deg)}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:after{border-right:7.5px solid transparent;transform:translate(7.5px,-28px) skewY(20deg)}@keyframes mapboxgl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.mapboxgl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}@media print{.mapbox-improve-map{display:none}}.mapboxgl-scroll-zoom-blocker,.mapboxgl-touch-pan-blocker{align-items:center;background:rgba(0,0,0,.7);color:#fff;display:flex;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif;height:100%;justify-content:center;left:0;opacity:0;pointer-events:none;position:absolute;text-align:center;top:0;transition:opacity .75s ease-in-out;transition-delay:1s;width:100%}.mapboxgl-scroll-zoom-blocker-show,.mapboxgl-touch-pan-blocker-show{opacity:1;transition:opacity .1s ease-in-out}.mapboxgl-canvas-container.mapboxgl-touch-pan-blocker-override.mapboxgl-scrollable-page,.mapboxgl-canvas-container.mapboxgl-touch-pan-blocker-override.mapboxgl-scrollable-page .mapboxgl-canvas{touch-action:pan-x pan-y}/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none} diff --git a/docs/frontend/dist/assets/index-b3a314fc.css b/docs/frontend/dist/assets/index-b3a314fc.css new file mode 100644 index 0000000..7734cba --- /dev/null +++ b/docs/frontend/dist/assets/index-b3a314fc.css @@ -0,0 +1 @@ +.mapboxgl-map{-webkit-tap-highlight-color:rgb(0 0 0/0);font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative}.mapboxgl-canvas{left:0;position:absolute;top:0}.mapboxgl-map:-webkit-full-screen{height:100%;width:100%}.mapboxgl-canary{background-color:salmon}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass{cursor:grab;-webkit-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active{cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas{touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:none}.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.mapboxgl-ctrl-top-left{left:0;top:0}.mapboxgl-ctrl-top-right{right:0;top:0}.mapboxgl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-bottom-right{bottom:0;right:0}.mapboxgl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{float:left;margin:10px 0 0 10px}.mapboxgl-ctrl-top-right .mapboxgl-ctrl{float:right;margin:10px 10px 0 0}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl{float:left;margin:0 0 10px 10px}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl{float:right;margin:0 10px 10px 0}.mapboxgl-ctrl-group{background:#fff;border-radius:4px}.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px #0000001a}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.mapboxgl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;overflow:hidden;padding:0;width:29px}.mapboxgl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon{background-color:transparent}.mapboxgl-ctrl-group button+button{border-top:1px solid ButtonText}}.mapboxgl-ctrl-attrib-button:focus,.mapboxgl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon{opacity:.25}.mapboxgl-ctrl-group button:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:only-child{border-radius:inherit}.mapboxgl-ctrl button:not(:disabled):hover{background-color:#0000000d}.mapboxgl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23999'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon{animation:mapboxgl-spin 2s linear infinite}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23000'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}}@keyframes mapboxgl-spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='0.3' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='0.9' fill='%23fff'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.mapboxgl-ctrl-logo.mapboxgl-compact{width:23px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='1' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='1' fill='%23fff'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='1' stroke='%23fff' stroke-width='3' fill='%23fff'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='1' fill='%23000'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib{background-color:#ffffff80;margin:0;padding:0 5px}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact{background-color:#fff;border-radius:12px;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib-button{background-color:#ffffff80;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-top-left .mapboxgl-ctrl-attrib-button{left:0}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-inner{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-button{background-color:#0000000d}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{right:0;top:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{left:0;top:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.mapboxgl-ctrl-attrib a{color:#000000bf;text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-ctrl-attrib .mapbox-improve-map{font-weight:700;margin-left:2px}.mapboxgl-attrib-empty{display:none}.mapboxgl-ctrl-scale{background-color:#ffffffbf;border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px;white-space:nowrap}.mapboxgl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right{flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right{flex-direction:column-reverse}.mapboxgl-popup-anchor-left{flex-direction:row}.mapboxgl-popup-anchor-right{flex-direction:row-reverse}.mapboxgl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.mapboxgl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.mapboxgl-popup-close-button:hover{background-color:#0000000d}.mapboxgl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px #0000001a;padding:10px 10px 15px;pointer-events:auto;position:relative}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer{display:none}.mapboxgl-marker{left:0;opacity:1;position:absolute;top:0;transition:opacity .2s;will-change:transform}.mapboxgl-user-location-dot,.mapboxgl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.mapboxgl-user-location-dot:before{animation:mapboxgl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.mapboxgl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px #00000059;box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading{height:0;width:0}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:after,.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:before{border-bottom:7.5px solid #4aa1eb;content:"";position:absolute}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:before{border-left:7.5px solid transparent;transform:translateY(-28px) skewY(-20deg)}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:after{border-right:7.5px solid transparent;transform:translate(7.5px,-28px) skewY(20deg)}@keyframes mapboxgl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.mapboxgl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}@media print{.mapbox-improve-map{display:none}}.mapboxgl-scroll-zoom-blocker,.mapboxgl-touch-pan-blocker{align-items:center;background:rgba(0,0,0,.7);color:#fff;display:flex;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif;height:100%;justify-content:center;left:0;opacity:0;pointer-events:none;position:absolute;text-align:center;top:0;transition:opacity .75s ease-in-out;transition-delay:1s;width:100%}.mapboxgl-scroll-zoom-blocker-show,.mapboxgl-touch-pan-blocker-show{opacity:1;transition:opacity .1s ease-in-out}.mapboxgl-canvas-container.mapboxgl-touch-pan-blocker-override.mapboxgl-scrollable-page,.mapboxgl-canvas-container.mapboxgl-touch-pan-blocker-override.mapboxgl-scrollable-page .mapboxgl-canvas{touch-action:pan-x pan-y}:root,[data-amplify-theme]{--amplify-components-button-link-color: #ffffff;--amplify-components-button-link-loading-background-color: #2c3e50;--amplify-components-button-link-loading-border-color: #1a242f;--amplify-components-button-link-disabled-background-color: #2c3e50;--amplify-components-button-link-disabled-border-color: #1a242f;--amplify-components-button-link-active-border-color: #1a242f;--amplify-components-button-link-focus-border-color: #1a242f;--amplify-components-button-link-hover-border-color: #1a242f;--amplify-components-button-link-border-color: #1a242f;--amplify-components-button-link-background-color: #2c3e50;--amplify-components-button-menu-background-color: #2c3e50;--amplify-components-button-primary-background-color: #2c3e50;--amplify-components-button-primary-active-background-color: #1a242f;--amplify-components-button-primary-active-border-color: #1a242f;--amplify-components-button-primary-focus-background-color: #1a242f;--amplify-components-button-primary-focus-border-color: #1a242f;--amplify-components-button-primary-hover-background-color: #1a242f;--amplify-components-button-primary-hover-border-color: #1a242f;--amplify-components-button-primary-loading-border-color: #1a242f;--amplify-components-button-primary-disabled-border-color: #1a242f;--amplify-components-button-primary-border-color: #1a242f;--amplify-components-button-disabled-background-color: #2c3e50;--amplify-components-button-loading-background-color: #2c3e50;--amplify-components-tabs-item-active-color: #18bc9c;--amplify-components-tabs-item-border-style: 4px solid #2c3e50;--amplify-components-tabs-item-active-border-color: #2c3e50}[data-amplify-theme=default-theme] [data-amplify-authenticator] [data-amplify-router]{background-color:var(--amplify-components-authenticator-router-background-color);box-shadow:var(--amplify-components-authenticator-router-box-shadow);border-color:transparent}.ApiContextProvider_amplify-button--primary__x3TB9{border-width:var(--amplify-components-button-primary-border-width);background-color:var(--amplify-components-button-primary-background-color);border-color:var(--amplify-components-button-primary-border-color);color:var(--amplify-components-button-primary-color);--amplify-internal-button-disabled-border-color: var( --amplify-components-button-primary-disabled-border-color );--amplify-internal-button-disabled-background-color: var( --amplify-components-button-primary-disabled-background-color );--amplify-internal-button-disabled-color: var( --amplify-components-button-primary-disabled-color );--amplify-internal-button-loading-background-color: var( --amplify-components-button-primary-loading-background-color );--amplify-internal-button-loading-border-color: var( --amplify-components-button-primary-loading-border-color );--amplify-internal-button-loading-color: var( --amplify-components-button-primary-loading-color )}.ApiContextProvider_amplify-button--primary__x3TB9:hover{background-color:var(--amplify-components-button-primary-hover-background-color);border-color:var(--amplify-components-button-primary-hover-border-color);color:var(--amplify-components-button-primary-hover-color)}.ApiContextProvider_amplify-button--primary__x3TB9:focus{background-color:var(--amplify-components-button-primary-focus-background-color);border-color:var(--amplify-components-button-primary-focus-border-color);color:var(--amplify-components-button-primary-focus-color);box-shadow:var(--amplify-components-button-primary-focus-box-shadow)}.ApiContextProvider_amplify-button--primary__x3TB9:active{background-color:var(--amplify-components-button-primary-active-background-color);border-color:var(--amplify-components-button-primary-active-border-color);color:var(--amplify-components-button-primary-active-color)}.ApiContextProvider_amplify-tabs-item__-6nTX[data-state=active]{color:var(--amplify-components-tabs-item-active-color);border-color:var(--amplify-components-tabs-item-active-border-color);background-color:var(--amplify-components-tabs-item-active-background-color);transition-property:none}.ApiContextProvider_amplify-input__ycAUW.ApiContextProvider_amplify-field-group__control__cRTcr{text-align:left}.CategoricalLegend-module_categorical-legend__KiFcS{display:flex;flex-wrap:wrap;margin:1.5rem 0px}.CategoricalLegend-module_categorical-legend__KiFcS .CategoricalLegend-module_entry__4zxZU{display:flex;justify-content:space-around;margin:0 20px 5px 0}.CategoricalLegend-module_categorical-legend__KiFcS .CategoricalLegend-module_entry__4zxZU .CategoricalLegend-module_key__1Hgb-{height:1rem;width:1rem;opacity:.9}.CategoricalLegend-module_categorical-legend__KiFcS .CategoricalLegend-module_entry__4zxZU p{line-height:1rem;font-size:1rem;margin:0 0 0 6px}.HoverInfo-module_tooltip__3wVpX{width:320px;border:1px solid black;background-color:#fff;padding:10px;position:absolute;z-index:10;pointer-events:none}.HoverInfo-module_tooltip__3wVpX h3{margin:.5rem 0rem}.HoverInfo-module_tooltip__3wVpX .HoverInfo-module_details__4eyQ7{margin:.1rem 0rem;line-height:1.6}.HoverInfo-module_tooltip__3wVpX .HoverInfo-module_prop-score__DKjwo{font-weight:400;margin:0}.slippy-map{position:relative;width:100vw;height:100vh}.slippy-map>*{overflow:hidden}.slippy-map>.mapboxgl-map{width:100%!important;height:100%!important}.tooltip{width:320px;border:1px solid black;background-color:#fff;padding:10px;position:absolute;z-index:10;pointer-events:none}.tooltip h3{margin:.5rem 0rem}.tooltip .details{margin:.1rem 0rem;line-height:1.6}.tooltip .prop-score{font-weight:400;margin:0}.tooltip .click-prompt{font-style:italic;font-weight:600;margin-top:5px}.tooltip p{margin:0}/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body{font-family:Montserrat,Arial,Helvetica,sans-serif;overflow:none}h1{font-size:2rem}h2{font-size:1.8rem}h3{font-size:1.6rem}h4{font-size:1.4rem}h5{font-size:1.2rem}h6{font-size:1rem}h1,h2,h3,h4,h5,h6{font-family:Montserrat,Arial,Helvetica,sans-serif;margin-top:.5em;margin-bottom:.5em}p,a{font-family:Montserrat,Arial,Helvetica,sans-serif;line-height:1.4}a{margin-top:0;margin-bottom:0;color:#00835d;text-decoration:underline;font-weight:700}a:hover{text-decoration:underline;cursor:pointer}#map{display:flex} diff --git a/docs/frontend/dist/assets/mapbox-gl-87c162e0.js b/docs/frontend/dist/assets/mapbox-gl-87c162e0.js deleted file mode 100644 index 78e444f..0000000 --- a/docs/frontend/dist/assets/mapbox-gl-87c162e0.js +++ /dev/null @@ -1,1318 +0,0 @@ -function mg(gr,Mh){for(var ln=0;lnyr[cn]})}}}return Object.freeze(Object.defineProperty(gr,Symbol.toStringTag,{value:"Module"}))}var _g=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function gg(gr){return gr&&gr.__esModule&&Object.prototype.hasOwnProperty.call(gr,"default")?gr.default:gr}var Of={exports:{}};(function(gr,Mh){(function(ln,yr){gr.exports=yr()})(_g,function(){var ln,yr,cn;function wo(a,Se){if(!ln)ln=Se;else if(!yr)yr=Se;else{var xr="self.onerror = function() { console.error('An error occurred while parsing the WebWorker bundle. This is most likely due to improper transpilation by Babel; please see https://docs.mapbox.com/mapbox-gl-js/guides/install/#transpiling'); }; var sharedChunk = {}; ("+ln+")(sharedChunk); ("+yr+")(sharedChunk); self.onerror = null;",Ki={};ln(Ki),cn=Se(Ki),typeof window<"u"&&window&&window.URL&&window.URL.createObjectURL&&(cn.workerUrl=window.URL.createObjectURL(new Blob([xr],{type:"text/javascript"})))}}wo(["exports"],function(a){var Se=typeof self<"u"?self:{},xr="2.15.0";let Ki;const it={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){if(Ki==null){const t=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;try{Ki={}.API_URL_REGEX!=null?new RegExp({}.API_URL_REGEX):t}catch{Ki=t}}return Ki},get API_TILEJSON_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/v[0-9]*\/.*\.json.*$)/i},get API_SPRITE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*\/sprite.*\..*$)/i},get API_FONTS_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/fonts\/v[0-9]*\/)(.*\.pbf.*$)/i},get API_STYLE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*$)/i},get API_CDN_URL_REGEX(){return/^((https?:)?\/\/)?api\.mapbox\.c(n|om)(\/mapbox-gl-js\/)(.*$)/i},get EVENTS_URL(){if(!it.API_URL)return null;try{const t=new URL(it.API_URL);return t.hostname==="api.mapbox.cn"?"https://events.mapbox.cn/events/v2":t.hostname==="api.mapbox.com"?"https://events.mapbox.com/events/v2":null}catch{return null}},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},ht={supported:!1,testSupport:function(t){!vr&&Si&&(br?To(t):gi=t)}};let gi,Si,vr=!1,br=!1;function To(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,Si),t.isContextLost())return;ht.supported=!0}catch{}t.deleteTexture(e),vr=!0}Se.document&&(Si=Se.document.createElement("img"),Si.onload=function(){gi&&To(gi),gi=null,br=!0},Si.onerror=function(){vr=!0,gi=null},Si.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const Rn="01";function Yi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Bn=Ji;function Ji(t,e,i,n){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*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=e,this.p2x=i,this.p2y=n}Ji.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(e===void 0&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var i=t,n=0;n<8;n++){var s=this.sampleCurveX(i)-t;if(Math.abs(s)s?u=i:p=i,i=.5*(p-u)+u;return i},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}};var hn=Yi(Bn),un=Qi;function Qi(t,e){this.x=t,this.y=e}Qi.prototype={clone:function(){return new Qi(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),n=i*this.x+e*this.y;return this.x=e*this.x-i*this.y,this.y=n,this},_rotateAround:function(t,e){var i=Math.cos(t),n=Math.sin(t),s=e.y+n*(this.x-e.x)+i*(this.y-e.y);return this.x=e.x+i*(this.x-e.x)-n*(this.y-e.y),this.y=s,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Qi.convert=function(t){return t instanceof Qi?t:Array.isArray(t)?new Qi(t[0],t[1]):t};var Le=Yi(un);const ba=Math.PI/180,wa=180/Math.PI;function dt(t){return t*ba}function si(t){return t*wa}const Ta=[[0,0],[1,0],[1,1],[0,1]];function gs(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)}function Eo(t,e,i,n){const s=new hn(t,e,i,n);return function(c){return s.solve(c)}}const ys=Eo(.25,.1,.25,1);function ct(t,e,i){return Math.min(i,Math.max(e,t))}function On(t,e,i){return(i=ct((i-t)/(e-t),0,1))*i*(3-2*i)}function oi(t,e,i){const n=i-e,s=((t-e)%n+n)%n+e;return s===e?i:s}function ai(t,e,i){if(!t.length)return i(null,[]);let n=t.length;const s=new Array(t.length);let c=null;t.forEach((u,p)=>{e(u,(m,_)=>{m&&(c=m),s[p]=_,--n==0&&i(c,s)})})}function $r(t){const e=[];for(const i in t)e.push(t[i]);return e}function Wt(t,...e){for(const i of e)for(const n in i)t[n]=i[n];return t}let Zr=1;function Fn(){return Zr++}function qr(){return function t(e){return e?(e^Math.random()*(16>>e/4)).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function wr(t){return t<=1?1:Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function xs(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function dn(t,e){t.forEach(i=>{e[i]&&(e[i]=e[i].bind(e))})}function Un(t,e){return t.indexOf(e,t.length-e.length)!==-1}function pt(t,e,i){const n={};for(const s in t)n[s]=e.call(i||this,t[s],s,t);return n}function Vn(t,e,i){const n={};for(const s in t)e.call(i||this,t[s],s,t)&&(n[s]=t[s]);return n}function Li(t){return Array.isArray(t)?t.map(Li):typeof t=="object"&&t?pt(t,Li):t}const So={};function Ut(t){So[t]||(typeof console<"u"&&console.warn(t),So[t]=!0)}function Ui(t,e,i){return(i.y-t.y)*(e.x-t.x)>(e.y-t.y)*(i.x-t.x)}function vs(t){let e=0;for(let i,n,s=0,c=t.length,u=c-1;s@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(i,n,s,c)=>{const u=s||c;return e[n]=!u||u.toLowerCase(),""}),e["max-age"]){const i=parseInt(e["max-age"],10);isNaN(i)?delete e["max-age"]:e["max-age"]=i}return e}let Mo=null;function Nn(t){if(Mo==null){const e=t.navigator?t.navigator.userAgent:null;Mo=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return Mo}function Ao(t){try{const e=Se[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch{return!1}}function Wr(t,e){return[t[4*e],t[4*e+1],t[4*e+2],t[4*e+3]]}const jn="mapbox-tiles";let bs=500,ws=50,Vi,Xr;function Io(){try{return Se.caches}catch{}}function pn(){Io()&&!Vi&&(Vi=Se.caches.open(jn))}function Gn(t){const e=t.indexOf("?");if(e<0)return t;const i=function(s){const c=s.indexOf("?");return c>0?s.slice(c+1).split("&"):[]}(t),n=i.filter(s=>{const c=s.split("=");return c[0]==="language"||c[0]==="worldview"});return n.length?`${t.slice(0,e)}?${n.join("&")}`:t.slice(0,e)}let Co=1/0;const fn={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(fn);class Hr extends Error{constructor(e,i,n){i===401&&ne(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes"),super(e),this.status=i,this.url=n}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}const mn=Tr()?()=>self.worker&&self.worker.referrer:()=>(Se.location.protocol==="blob:"?Se.parent:Se).location.href,_n=function(t,e){if(!(/^file:/.test(i=t.url)||/^file:/.test(mn())&&!/^\w+:/.test(i))){if(Se.fetch&&Se.Request&&Se.AbortController&&Se.Request.prototype.hasOwnProperty("signal"))return function(n,s){const c=new Se.AbortController,u=new Se.Request(n.url,{method:n.method||"GET",body:n.body,credentials:n.credentials,headers:n.headers,referrer:mn(),referrerPolicy:n.referrerPolicy,signal:c.signal});let p=!1,m=!1;const _=(x=u.url).indexOf("sku=")>0&&ne(x);var x;n.type==="json"&&u.headers.set("Accept","application/json");const b=(S,M,C)=>{if(m)return;if(S&&S.message!=="SecurityError"&&Ut(S.toString()),M&&C)return w(M);const D=Date.now();Se.fetch(u).then(U=>{if(U.ok){const q=_?U.clone():null;return w(U,q,D)}return s(new Hr(U.statusText,U.status,n.url))}).catch(U=>{U.name!=="AbortError"&&s(new Error(`${U.message} ${n.url}`))})},w=(S,M,C)=>{(n.type==="arrayBuffer"?S.arrayBuffer():n.type==="json"?S.json():S.text()).then(D=>{m||(M&&C&&function(U,q,V){if(pn(),!Vi)return;const $={status:q.status,statusText:q.statusText,headers:new Se.Headers};q.headers.forEach((ce,se)=>$.headers.set(se,ce));const X=Ri(q.headers.get("Cache-Control")||"");if(X["no-store"])return;X["max-age"]&&$.headers.set("Expires",new Date(V+1e3*X["max-age"]).toUTCString());const W=$.headers.get("Expires");W&&(new Date(W).getTime()-V<42e4||function(ce,se){if(Xr===void 0)try{new Response(new ReadableStream),Xr=!0}catch{Xr=!1}Xr?se(ce.body):ce.blob().then(se)}(q,ce=>{const se=new Se.Response(ce,$);pn(),Vi&&Vi.then(me=>me.put(Gn(U.url),se)).catch(me=>Ut(me.message))}))}(u,M,C),p=!0,s(null,D,S.headers.get("Cache-Control"),S.headers.get("Expires")))}).catch(D=>{m||s(new Error(D.message))})};return _?function(S,M){if(pn(),!Vi)return M(null);const C=Gn(S.url);Vi.then(D=>{D.match(C).then(U=>{const q=function(V){if(!V)return!1;const $=new Date(V.headers.get("Expires")||0),X=Ri(V.headers.get("Cache-Control")||"");return $>Date.now()&&!X["no-cache"]}(U);D.delete(C),q&&D.put(C,U.clone()),M(null,U,q)}).catch(M)}).catch(M)}(u,b):b(null,null),{cancel:()=>{m=!0,p||c.abort()}}}(t,e);if(Tr()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var i;return function(n,s){const c=new Se.XMLHttpRequest;c.open(n.method||"GET",n.url,!0),n.type==="arrayBuffer"&&(c.responseType="arraybuffer");for(const u in n.headers)c.setRequestHeader(u,n.headers[u]);return n.type==="json"&&(c.responseType="text",c.setRequestHeader("Accept","application/json")),c.withCredentials=n.credentials==="include",c.onerror=()=>{s(new Error(c.statusText))},c.onload=()=>{if((c.status>=200&&c.status<300||c.status===0)&&c.response!==null){let u=c.response;if(n.type==="json")try{u=JSON.parse(c.response)}catch(p){return s(p)}s(null,u,c.getResponseHeader("Cache-Control"),c.getResponseHeader("Expires"))}else s(new Hr(c.statusText,c.status,n.url))},c.send(n.body),{cancel:()=>c.abort()}}(t,e)},$n=function(t,e){return _n(Wt(t,{type:"arrayBuffer"}),e)};function Ts(t){const e=Se.document.createElement("a");return e.href=t,e.protocol===Se.document.location.protocol&&e.host===Se.document.location.host}const Z="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let z,P;z=[],P=0;const G=function(t,e){if(ht.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),P>=it.MAX_PARALLEL_IMAGE_REQUESTS){const c={requestParameters:t,callback:e,cancelled:!1,cancel(){this.cancelled=!0}};return z.push(c),c}P++;let i=!1;const n=()=>{if(!i)for(i=!0,P--;z.length&&P{n(),c?e(c):u&&(Se.createImageBitmap?function(_,x){const b=new Se.Blob([new Uint8Array(_)],{type:"image/png"});Se.createImageBitmap(b).then(w=>{x(null,w)}).catch(w=>{x(new Error(`Could not load image because of ${w.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})}(u,(_,x)=>e(_,x,p,m)):function(_,x){const b=new Se.Image,w=Se.URL;b.onload=()=>{x(null,b),w.revokeObjectURL(b.src),b.onload=null,Se.requestAnimationFrame(()=>{b.src=Z})},b.onerror=()=>x(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 S=new Se.Blob([new Uint8Array(_)],{type:"image/png"});b.src=_.byteLength?w.createObjectURL(S):Z}(u,(_,x)=>e(_,x,p,m)))});return{cancel:()=>{s.cancel(),n()}}},H="NO_ACCESS_TOKEN";function ee(t){return t.indexOf("mapbox:")===0}function ne(t){return it.API_URL_REGEX.test(t)}function re(t){return it.API_CDN_URL_REGEX.test(t)}function Q(t){return it.API_STYLE_REGEX.test(t)&&!de(t)}function de(t){return it.API_SPRITE_REGEX.test(t)}const Pe=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function ke(t){const e=t.match(Pe);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function Ie(t){const e=t.params.length?`?${t.params.join("&")}`:"";return`${t.protocol}://${t.authority}${t.path}${e}`}const Je="mapbox.eventData";function rt(t){if(!t)return null;const e=t.split(".");if(!e||e.length!==3)return null;try{return JSON.parse(decodeURIComponent(Se.atob(e[1]).split("").map(i=>"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)).join("")))}catch{return null}}class Qe{constructor(e){this.type=e,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null}getStorageKey(e){const i=rt(it.ACCESS_TOKEN);let n="";return n=i&&i.u?Se.btoa(encodeURIComponent(i.u).replace(/%([0-9A-F]{2})/g,(s,c)=>String.fromCharCode(+("0x"+c)))):it.ACCESS_TOKEN||"",e?`${Je}.${e}:${n}`:`${Je}:${n}`}fetchEventData(){const e=Ao("localStorage"),i=this.getStorageKey(),n=this.getStorageKey("uuid");if(e)try{const s=Se.localStorage.getItem(i);s&&(this.eventData=JSON.parse(s));const c=Se.localStorage.getItem(n);c&&(this.anonId=c)}catch{Ut("Unable to read from LocalStorage")}}saveEventData(){const e=Ao("localStorage"),i=this.getStorageKey(),n=this.getStorageKey("uuid");if(e)try{Se.localStorage.setItem(n,this.anonId),Object.keys(this.eventData).length>=1&&Se.localStorage.setItem(i,JSON.stringify(this.eventData))}catch{Ut("Unable to write to LocalStorage")}}processRequests(e){}postEvent(e,i,n,s){if(!it.EVENTS_URL)return;const c=ke(it.EVENTS_URL);c.params.push(`access_token=${s||it.ACCESS_TOKEN||""}`);const u={event:this.type,created:new Date(e).toISOString()},p=i?Wt(u,i):u,m={url:Ie(c),headers:{"Content-Type":"text/plain"},body:JSON.stringify([p])};this.pendingRequest=function(_,x){return _n(Wt(_,{method:"POST"}),x)}(m,_=>{this.pendingRequest=null,n(_),this.saveEventData(),this.processRequests(s)})}queueRequest(e,i){this.queue.push(e),this.processRequests(i)}}const nt=new class extends Qe{constructor(t){super("appUserTurnstile"),this._customAccessToken=t}postTurnstileEvent(t,e){it.EVENTS_URL&&it.ACCESS_TOKEN&&Array.isArray(t)&&t.some(i=>ee(i)||ne(i))&&this.queueRequest(Date.now(),e)}processRequests(t){if(this.pendingRequest||this.queue.length===0)return;this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const e=rt(it.ACCESS_TOKEN),i=e?e.u:it.ACCESS_TOKEN;let n=i!==this.eventData.tokenU;xs(this.anonId)||(this.anonId=qr(),n=!0);const s=this.queue.shift();if(this.eventData.lastSuccess){const c=new Date(this.eventData.lastSuccess),u=new Date(s),p=(s-this.eventData.lastSuccess)/864e5;n=n||p>=1||p<-1||c.getDate()!==u.getDate()}else n=!0;n?this.postEvent(s,{sdkIdentifier:"mapbox-gl-js",sdkVersion:xr,skuId:Rn,"enabled.telemetry":!1,userId:this.anonId},c=>{c||(this.eventData.lastSuccess=s,this.eventData.tokenU=i)},t):this.processRequests()}},ft=nt.postTurnstileEvent.bind(nt),Vt=new class extends Qe{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(t,e,i,n){this.skuToken=e,this.errorCb=n,it.EVENTS_URL&&(i||it.ACCESS_TOKEN?this.queueRequest({id:t,timestamp:Date.now()},i):this.errorCb(new Error(H)))}processRequests(t){if(this.pendingRequest||this.queue.length===0)return;const{id:e,timestamp:i}=this.queue.shift();e&&this.success[e]||(this.anonId||this.fetchEventData(),xs(this.anonId)||(this.anonId=qr()),this.postEvent(i,{sdkIdentifier:"mapbox-gl-js",sdkVersion:xr,skuId:Rn,skuToken:this.skuToken,userId:this.anonId},n=>{n?this.errorCb(n):e&&(this.success[e]=!0)},t))}},Xt=Vt.postMapLoadEvent.bind(Vt),yi=new class extends Qe{constructor(){super("gljs.performance")}postPerformanceEvent(t,e){it.EVENTS_URL&&(t||it.ACCESS_TOKEN)&&this.queueRequest({timestamp:Date.now(),performanceData:e},t)}processRequests(t){if(this.pendingRequest||this.queue.length===0)return;const{timestamp:e,performanceData:i}=this.queue.shift(),n=function(s){const c=Se.performance.getEntriesByType("resource"),u=Se.performance.getEntriesByType("mark"),p=function(w){const S={};if(w){for(const M in w)if(M!=="other")for(const C of w[M]){const D=`${M}ResolveRangeMin`,U=`${M}ResolveRangeMax`,q=`${M}RequestCount`,V=`${M}RequestCachedCount`;S[D]=Math.min(S[D]||1/0,C.startTime),S[U]=Math.max(S[U]||-1/0,C.responseEnd);const $=X=>{S[X]===void 0&&(S[X]=0),++S[X]};C.transferSize!==void 0&&C.transferSize===0&&$(V),$(q)}}return S}(function(w,S){const M={};if(w)for(const C of w){const D=S(C);M[D]===void 0&&(M[D]=[]),M[D].push(C)}return M}(c,tc)),m=Se.devicePixelRatio,_=Se.navigator.connection||Se.navigator.mozConnection||Se.navigator.webkitConnection,x={counters:[],metadata:[],attributes:[]},b=(w,S,M)=>{M!=null&&w.push({name:S,value:M.toString()})};for(const w in p)b(x.counters,w,p[w]);if(s.interactionRange[0]!==1/0&&s.interactionRange[1]!==-1/0&&(b(x.counters,"interactionRangeMin",s.interactionRange[0]),b(x.counters,"interactionRangeMax",s.interactionRange[1])),u)for(const w of Object.keys(Zn)){const S=Zn[w],M=u.find(C=>C.name===S);M&&b(x.counters,S,M.startTime)}return b(x.counters,"visibilityHidden",s.visibilityHidden),b(x.attributes,"style",function(w){if(w)for(const S of w){const M=S.name.split("?")[0];if(Q(M)){const C=M.split("/").slice(-2);if(C.length===2)return`mapbox://styles/${C[0]}/${C[1]}`}}}(c)),b(x.attributes,"terrainEnabled",s.terrainEnabled?"true":"false"),b(x.attributes,"fogEnabled",s.fogEnabled?"true":"false"),b(x.attributes,"projection",s.projection),b(x.attributes,"zoom",s.zoom),b(x.metadata,"devicePixelRatio",m),b(x.metadata,"connectionEffectiveType",_?_.effectiveType:void 0),b(x.metadata,"navigatorUserAgent",Se.navigator.userAgent),b(x.metadata,"screenWidth",Se.screen.width),b(x.metadata,"screenHeight",Se.screen.height),b(x.metadata,"windowWidth",Se.innerWidth),b(x.metadata,"windowHeight",Se.innerHeight),b(x.metadata,"mapWidth",s.width/m),b(x.metadata,"mapHeight",s.height/m),b(x.metadata,"webglRenderer",s.renderer),b(x.metadata,"webglVendor",s.vendor),b(x.metadata,"sdkVersion",xr),b(x.metadata,"sdkIdentifier","mapbox-gl-js"),x}(i);for(const s of n.metadata);for(const s of n.counters);for(const s of n.attributes);this.postEvent(e,n,()=>{},t)}},ri=yi.postPerformanceEvent.bind(yi),sr=new class extends Qe{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(t,e,i,n){if(!it.API_URL||!it.SESSION_PATH)return;const s=ke(it.API_URL+it.SESSION_PATH);s.params.push(`sku=${e||""}`),s.params.push(`access_token=${n||it.ACCESS_TOKEN||""}`);const c={url:Ie(s),headers:{"Content-Type":"text/plain"}};this.pendingRequest=function(u,p){return _n(Wt(u,{method:"GET"}),p)}(c,u=>{this.pendingRequest=null,i(u),this.saveEventData(),this.processRequests(n)})}getSessionAPI(t,e,i,n){this.skuToken=e,this.errorCb=n,it.SESSION_PATH&&it.API_URL&&(i||it.ACCESS_TOKEN?this.queueRequest({id:t,timestamp:Date.now()},i):this.errorCb(new Error(H)))}processRequests(t){if(this.pendingRequest||this.queue.length===0)return;const{id:e,timestamp:i}=this.queue.shift();e&&this.success[e]||this.getSession(i,this.skuToken,n=>{n?this.errorCb(n):e&&(this.success[e]=!0)},t)}},li=sr.getSessionAPI.bind(sr),Ti=new Set,Zn={create:"create",load:"load",fullLoad:"fullLoad"},Ah={mark(t){Se.performance.mark(t)},measure(t,e,i){Se.performance.measure(t,e,i)}};function tc(t){const e=t.name.split("?")[0];return re(e)&&e.includes("mapbox-gl.js")?"javascript":re(e)&&e.includes("mapbox-gl.css")?"css":function(i){return it.API_FONTS_REGEX.test(i)}(e)?"fontRange":de(e)?"sprite":Q(e)?"style":function(i){return it.API_TILEJSON_REGEX.test(i)}(e)?"tilejson":"other"}const vt=Se.performance;function Ea(t){const e=t?t.url.toString():void 0;return vt.getEntriesByName(e)}let zo,Sa,Es,ar;const Er={now:()=>Es!==void 0?Es:Se.performance.now(),setNow(t){Es=t},restoreNow(){Es=void 0},frame(t){const e=Se.requestAnimationFrame(t);return{cancel:()=>Se.cancelAnimationFrame(e)}},getImageData(t,e=0){const{width:i,height:n}=t;ar||(ar=Se.document.createElement("canvas"));const s=ar.getContext("2d",{willReadFrequently:!0});if(!s)throw new Error("failed to create canvas 2d context");return(i>ar.width||n>ar.height)&&(ar.width=i,ar.height=n),s.clearRect(-e,-e,i+2*e,n+2*e),s.drawImage(t,0,0,i,n),s.getImageData(-e,-e,i+2*e,n+2*e)},resolveURL:t=>(zo||(zo=Se.document.createElement("a")),zo.href=t,zo.href),get devicePixelRatio(){return Se.devicePixelRatio},get prefersReducedMotion(){return!!Se.matchMedia&&(Sa==null&&(Sa=Se.matchMedia("(prefers-reduced-motion: reduce)")),Sa.matches)}};function Ma(t,e,i){i[t]&&i[t].indexOf(e)!==-1||(i[t]=i[t]||[],i[t].push(e))}function Aa(t,e,i){if(i&&i[t]){const n=i[t].indexOf(e);n!==-1&&i[t].splice(n,1)}}class gn{constructor(e,i={}){Wt(this,i),this.type=e}}class Sr extends gn{constructor(e,i={}){super("error",Wt({error:e},i))}}class Po{on(e,i){return this._listeners=this._listeners||{},Ma(e,i,this._listeners),this}off(e,i){return Aa(e,i,this._listeners),Aa(e,i,this._oneTimeListeners),this}once(e,i){return i?(this._oneTimeListeners=this._oneTimeListeners||{},Ma(e,i,this._oneTimeListeners),this):new Promise(n=>this.once(e,n))}fire(e,i){typeof e=="string"&&(e=new gn(e,i||{}));const n=e.type;if(this.listens(n)){e.target=this;const s=this._listeners&&this._listeners[n]?this._listeners[n].slice():[];for(const p of s)p.call(this,e);const c=this._oneTimeListeners&&this._oneTimeListeners[n]?this._oneTimeListeners[n].slice():[];for(const p of c)Aa(n,p,this._oneTimeListeners),p.call(this,e);const u=this._eventedParent;u&&(Wt(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),u.fire(e))}else e instanceof Sr&&console.error(e.error);return this}listens(e){return!!(this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e))}setEventedParent(e,i){return this._eventedParent=e,this._eventedParentData=i,this}}var fe=JSON.parse('{"$version":8,"$root":{"version":{"required":true,"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"},"terrain":{"type":"terrain"},"fog":{"type":"fog"},"sources":{"required":true,"type":"sources"},"sprite":{"type":"string"},"glyphs":{"type":"string"},"transition":{"type":"transition"},"projection":{"type":"projection"},"layers":{"required":true,"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":true,"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":{}},"default":"xyz"},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"attribution":{"type":"string"},"promoteId":{"type":"promoteId"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster":{"type":{"required":true,"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":false},"*":{"type":"*"}},"source_raster_dem":{"type":{"required":true,"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":{}},"default":"mapbox"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_geojson":{"type":{"required":true,"type":"enum","values":{"geojson":{}}},"data":{"type":"*"},"maxzoom":{"type":"number","default":18},"attribution":{"type":"string"},"buffer":{"type":"number","default":128,"maximum":512,"minimum":0},"filter":{"type":"*"},"tolerance":{"type":"number","default":0.375},"cluster":{"type":"boolean","default":false},"clusterRadius":{"type":"number","default":50,"minimum":0},"clusterMaxZoom":{"type":"number"},"clusterMinPoints":{"type":"number"},"clusterProperties":{"type":"*"},"lineMetrics":{"type":"boolean","default":false},"generateId":{"type":"boolean","default":false},"promoteId":{"type":"promoteId"}},"source_video":{"type":{"required":true,"type":"enum","values":{"video":{}}},"urls":{"required":true,"type":"array","value":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_image":{"type":{"required":true,"type":"enum","values":{"image":{}}},"url":{"required":true,"type":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"layer":{"id":{"type":"string","required":true},"type":{"type":"enum","values":{"fill":{},"line":{},"symbol":{},"circle":{},"heatmap":{},"fill-extrusion":{},"raster":{},"hillshade":{},"background":{},"sky":{}},"required":true},"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_sky"],"layout_background":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_sky":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_fill":{"fill-sort-key":{"type":"number","expression":{"interpolated":false,"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":false,"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"},"fill-extrusion-edge-radius":{"type":"number","private":true,"default":0,"minimum":0,"maximum":1,"property-type":"constant"}},"layout_line":{"line-cap":{"type":"enum","values":{"butt":{},"round":{},"square":{}},"default":"butt","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-join":{"type":"enum","values":{"bevel":{},"round":{},"miter":{}},"default":"miter","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{"type":"number","default":2,"requires":[{"line-join":"miter"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-round-limit":{"type":"number","default":1.05,"requires":[{"line-join":"round"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-sort-key":{"type":"number","expression":{"interpolated":false,"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":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-spacing":{"type":"number","default":250,"minimum":1,"units":"pixels","requires":[{"symbol-placement":"line"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{"type":"boolean","default":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{"type":"enum","values":{"auto":{},"viewport-y":{},"source":{}},"default":"auto","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{"type":"boolean","default":false,"requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{"type":"boolean","default":false,"requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-optional":{"type":"boolean","default":false,"requires":["icon-image","text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"],"expression":{"interpolated":false,"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":true,"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":false,"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":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-image":{"type":"resolvedImage","tokens":true,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{"type":"number","default":0,"period":360,"units":"degrees","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{"type":"boolean","default":false,"requires":["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-offset":{"type":"array","value":"number","length":2,"default":[0,0],"requires":["icon-image"],"expression":{"interpolated":true,"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":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-field":{"type":"formatted","default":"","tokens":true,"expression":{"interpolated":false,"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":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size":{"type":"number","default":16,"minimum":0,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{"type":"number","default":10,"minimum":0,"units":"ems","requires":["text-field",{"symbol-placement":["point"]}],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{"type":"number","default":1.2,"units":"ems","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{"type":"number","default":0,"units":"ems","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-justify":{"type":"enum","values":{"auto":{},"left":{},"center":{},"right":{}},"default":"center","requires":["text-field"],"expression":{"interpolated":false,"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":true,"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":false,"parameters":["zoom"]},"property-type":"data-constant"},"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":false,"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":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-writing-mode":{"type":"array","value":"enum","values":{"horizontal":{},"vertical":{}},"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotate":{"type":"number","default":0,"period":360,"units":"degrees","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-keep-upright":{"type":"boolean","default":true,"requires":["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-transform":{"type":"enum","values":{"none":{},"uppercase":{},"lowercase":{}},"default":"none","requires":["text-field"],"expression":{"interpolated":false,"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":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{"type":"boolean","default":false,"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{"type":"boolean","default":false,"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-optional":{"type":"boolean","default":false,"requires":["text-field","icon-image"],"expression":{"interpolated":false,"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_symbol":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature","pitch","distance-from-center"]}},"filter_fill":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_line":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_circle":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_fill-extrusion":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_heatmap":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_operator":{"type":"enum","values":{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},"in":{},"!in":{},"all":{},"any":{},"none":{},"has":{},"!has":{},"within":{}}},"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":false}},"function_stop":{"type":"array","minimum":0,"maximum":24,"value":["number","color"],"length":2},"expression":{"type":"array","value":"*","minimum":1},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"high-color":{"type":"color","property-type":"data-constant","default":"#245cdf","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"space-color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"horizon-blend":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,0.2,7,0.1],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"star-intensity":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],5,0.35,6,0],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":{},"viewport":{}},"property-type":"data-constant","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"projection":{"name":{"type":"enum","values":{"albers":{},"equalEarth":{},"equirectangular":{},"lambertConformalConic":{},"mercator":{},"naturalEarth":{},"winkelTripel":{},"globe":{}},"default":"mercator","required":true},"center":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-180,-90],"maximum":[180,90],"transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]},"parallels":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-90,-90],"maximum":[90,90],"transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]}},"terrain":{"source":{"type":"string","required":true},"exaggeration":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1000,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"requires":["source"]}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"fill-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{"type":"color","transition":true,"requires":[{"!":"fill-pattern"},{"fill-antialias":true}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["fill-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"fill-extrusion-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["fill-extrusion-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"units":"meters","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"units":"meters","transition":true,"requires":["fill-extrusion-height"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant","type":"number","private":true,"default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant","type":"number","private":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"requires":["fill-extrusion-edge-radius"]},"fill-extrusion-rounded-roof":{"type":"boolean","default":true,"requires":["fill-extrusion-edge-radius"],"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_line":{"line-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"line-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["line-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"line-width":{"type":"number","default":1,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{"type":"array","value":"number","minimum":0,"transition":false,"units":"line widths","requires":[{"!":"line-pattern"}],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{"type":"color","transition":false,"requires":[{"!":"line-pattern"},{"source":"geojson","has":{"lineMetrics":true}}],"expression":{"interpolated":true,"parameters":["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{"type":"array","value":"number","length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"transition":false,"requires":[{"source":"geojson","has":{"lineMetrics":true}}],"property-type":"constant"}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["circle-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{}},"default":"viewport","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"transition":false,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"heatmap-color":{"type":"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"transition":false,"expression":{"interpolated":true,"parameters":["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_symbol":{"icon-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{"type":"color","default":"#000000","transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["icon-image","icon-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{"type":"color","default":"#000000","transition":true,"overridable":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["text-field","text-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_raster":{"raster-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{"type":"number","default":0,"period":360,"transition":true,"units":"degrees","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-resampling":{"type":"enum","values":{"linear":{},"nearest":{}},"default":"linear","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"transition":false,"units":"milliseconds","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"transition":false,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"viewport","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{"type":"number","default":0.5,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_background":{"background-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"background-pattern"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":{},"atmosphere":{}},"default":"atmosphere","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"requires":[{"sky-type":"atmosphere"}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{"type":"number","requires":[{"sky-type":"atmosphere"}],"default":10,"minimum":0,"maximum":100,"transition":false,"property-type":"data-constant"},"sky-gradient-center":{"type":"array","requires":[{"sky-type":"gradient"}],"value":"number","default":[0,0],"length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{"type":"number","requires":[{"sky-type":"gradient"}],"default":90,"minimum":0,"maximum":180,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"transition":false,"requires":[{"sky-type":"gradient"}],"expression":{"interpolated":true,"parameters":["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-atmosphere-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"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"},"color-ramp":{"type":"property-type"},"data-constant":{"type":"property-type"},"constant":{"type":"property-type"}},"promoteId":{"*":{"type":"string"}}}');function Mr(t,...e){for(const i of e)for(const n in i)t[n]=i[n];return t}function Ht(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function ci(t){if(Array.isArray(t))return t.map(ci);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){const e={};for(const i in t)e[i]=ci(t[i]);return e}return Ht(t)}class ic extends Error{constructor(e,i){super(i),this.message=i,this.key=e}}var lr=ic;class Ia{constructor(e,i=[]){this.parent=e,this.bindings={};for(const[n,s]of i)this.bindings[n]=s}concat(e){return new Ia(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}var rc=Ia;const qn={kind:"null"},Oe={kind:"number"},ut={kind:"string"},st={kind:"boolean"},Bi={kind:"color"},er={kind:"object"},at={kind:"value"},Oi={kind:"collator"},ko={kind:"formatted"},yn={kind:"resolvedImage"};function Ni(t,e){return{kind:"array",itemType:t,N:e}}function Ot(t){if(t.kind==="array"){const e=Ot(t.itemType);return typeof t.N=="number"?`array<${e}, ${t.N}>`:t.itemType.kind==="value"?"array":`array<${e}>`}return t.kind}const nc=[qn,Oe,ut,st,Bi,ko,er,Ni(at),yn];function Ar(t,e){if(e.kind==="error")return null;if(t.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!Ar(t.itemType,e.itemType))&&(typeof t.N!="number"||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if(t.kind==="value"){for(const i of nc)if(!Ar(i,e))return null}}return`Expected ${Ot(t)} but found ${Ot(e)} instead.`}function Do(t,e){return e.some(i=>i.kind===t.kind)}function Lo(t,e){return e.some(i=>i==="null"?t===null:i==="array"?Array.isArray(t):i==="object"?t&&!Array.isArray(t)&&typeof t=="object":i===typeof t)}var Ca,oc={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Ro(t){return(t=Math.round(t))<0?0:t>255?255:t}function Bo(t){return Ro(t[t.length-1]==="%"?parseFloat(t)/100*255:parseInt(t))}function Ss(t){return(e=t[t.length-1]==="%"?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e}function Wn(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}try{Ca={}.parseCSSColor=function(t){var e,i=t.replace(/ /g,"").toLowerCase();if(i in oc)return oc[i].slice();if(i[0]==="#")return i.length===4?(e=parseInt(i.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:i.length===7&&(e=parseInt(i.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var n=i.indexOf("("),s=i.indexOf(")");if(n!==-1&&s+1===i.length){var c=i.substr(0,n),u=i.substr(n+1,s-(n+1)).split(","),p=1;switch(c){case"rgba":if(u.length!==4)return null;p=Ss(u.pop());case"rgb":return u.length!==3?null:[Bo(u[0]),Bo(u[1]),Bo(u[2]),p];case"hsla":if(u.length!==4)return null;p=Ss(u.pop());case"hsl":if(u.length!==3)return null;var m=(parseFloat(u[0])%360+360)%360/360,_=Ss(u[1]),x=Ss(u[2]),b=x<=.5?x*(_+1):x+_-x*_,w=2*x-b;return[Ro(255*Wn(w,b,m+1/3)),Ro(255*Wn(w,b,m)),Ro(255*Wn(w,b,m-1/3)),p];default:return null}}return null}}catch{}class Mi{constructor(e,i,n,s=1){this.r=e,this.g=i,this.b=n,this.a=s}static parse(e){if(!e)return;if(e instanceof Mi)return e;if(typeof e!="string")return;const i=Ca(e);return i?new Mi(i[0]/255*i[3],i[1]/255*i[3],i[2]/255*i[3],i[3]):void 0}toString(){const[e,i,n,s]=this.toArray();return`rgba(${Math.round(e)},${Math.round(i)},${Math.round(n)},${s})`}toArray(){const{r:e,g:i,b:n,a:s}=this;return s===0?[0,0,0,0]:[255*e/s,255*i/s,255*n/s,s]}toArray01(){const{r:e,g:i,b:n,a:s}=this;return s===0?[0,0,0,0]:[e/s,i/s,n/s,s]}toArray01PremultipliedAlpha(){const{r:e,g:i,b:n,a:s}=this;return[e,i,n,s]}}Mi.black=new Mi(0,0,0,1),Mi.white=new Mi(1,1,1,1),Mi.transparent=new Mi(0,0,0,0),Mi.red=new Mi(1,0,0,1),Mi.blue=new Mi(0,0,1,1);var Zt=Mi;class za{constructor(e,i,n){this.sensitivity=e?i?"variant":"case":i?"accent":"base",this.locale=n,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,i){return this.collator.compare(e,i)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Pa{constructor(e,i,n,s,c){this.text=e.normalize?e.normalize():e,this.image=i,this.scale=n,this.fontStack=s,this.textColor=c}}class Ai{constructor(e){this.sections=e}static fromString(e){return new Ai([new Pa(e,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof Ai?e:Ai.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}serialize(){const e=["format"];for(const i of this.sections){if(i.image){e.push(["image",i.image.name]);continue}e.push(i.text);const n={};i.fontStack&&(n["text-font"]=["literal",i.fontStack.split(",")]),i.scale&&(n["font-scale"]=i.scale),i.textColor&&(n["text-color"]=["rgba"].concat(i.textColor.toArray())),e.push(n)}return e}}class ji{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new ji({name:e,available:!1}):null}serialize(){return["image",this.name]}}function sc(t,e,i,n){return typeof t=="number"&&t>=0&&t<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof i=="number"&&i>=0&&i<=255?n===void 0||typeof n=="number"&&n>=0&&n<=1?null:`Invalid rgba value [${[t,e,i,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof n=="number"?[t,e,i,n]:[t,e,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Oo(t){if(t===null||typeof t=="string"||typeof t=="boolean"||typeof t=="number"||t instanceof Zt||t instanceof za||t instanceof Ai||t instanceof ji)return!0;if(Array.isArray(t)){for(const e of t)if(!Oo(e))return!1;return!0}if(typeof t=="object"){for(const e in t)if(!Oo(t[e]))return!1;return!0}return!1}function Gt(t){if(t===null)return qn;if(typeof t=="string")return ut;if(typeof t=="boolean")return st;if(typeof t=="number")return Oe;if(t instanceof Zt)return Bi;if(t instanceof za)return Oi;if(t instanceof Ai)return ko;if(t instanceof ji)return yn;if(Array.isArray(t)){const e=t.length;let i;for(const n of t){const s=Gt(n);if(i){if(i===s)continue;i=at;break}i=s}return Ni(i||at,e)}return er}function Fo(t){const e=typeof t;return t===null?"":e==="string"||e==="number"||e==="boolean"?String(t):t instanceof Zt||t instanceof Ai||t instanceof ji?t.toString():JSON.stringify(t)}class ka{constructor(e,i){this.type=e,this.value=i}static parse(e,i){if(e.length!==2)return i.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!Oo(e[1]))return i.error("invalid value");const n=e[1];let s=Gt(n);const c=i.expectedType;return s.kind!=="array"||s.N!==0||!c||c.kind!=="array"||typeof c.N=="number"&&c.N!==0||(s=c),new ka(s,n)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof Zt?["rgba"].concat(this.value.toArray()):this.value instanceof Ai?this.value.serialize():this.value}}var xn=ka,fi=class{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}};const Da={string:ut,number:Oe,boolean:st,object:er};class La{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");let n,s=1;const c=e[0];if(c==="array"){let p,m;if(e.length>2){const _=e[1];if(typeof _!="string"||!(_ in Da)||_==="object")return i.error('The item type argument of "array" must be one of string, number, boolean',1);p=Da[_],s++}else p=at;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return i.error('The length argument to "array" must be a positive integer literal',2);m=e[2],s++}n=Ni(p,m)}else n=Da[c];const u=[];for(;se.outputDefined())}serialize(){const e=this.type,i=[e.kind];if(e.kind==="array"){const n=e.itemType;if(n.kind==="string"||n.kind==="number"||n.kind==="boolean"){i.push(n.kind);const s=e.N;(typeof s=="number"||this.args.length>1)&&i.push(s)}}return i.concat(this.args.map(n=>n.serialize()))}}var Ir=La;class Kr{constructor(e){this.type=ko,this.sections=e}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");const n=e[1];if(!Array.isArray(n)&&typeof n=="object")return i.error("First argument must be an image or text section.");const s=[];let c=!1;for(let u=1;u<=e.length-1;++u){const p=e[u];if(c&&typeof p=="object"&&!Array.isArray(p)){c=!1;let m=null;if(p["font-scale"]&&(m=i.parse(p["font-scale"],1,Oe),!m))return null;let _=null;if(p["text-font"]&&(_=i.parse(p["text-font"],1,Ni(ut)),!_))return null;let x=null;if(p["text-color"]&&(x=i.parse(p["text-color"],1,Bi),!x))return null;const b=s[s.length-1];b.scale=m,b.font=_,b.textColor=x}else{const m=i.parse(e[u],1,at);if(!m)return null;const _=m.type.kind;if(_!=="string"&&_!=="value"&&_!=="null"&&_!=="resolvedImage")return i.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");c=!0,s.push({content:m,scale:null,font:null,textColor:null})}}return new Kr(s)}evaluate(e){return new Ai(this.sections.map(i=>{const n=i.content.evaluate(e);return Gt(n)===yn?new Pa("",n,null,null,null):new Pa(Fo(n),null,i.scale?i.scale.evaluate(e):null,i.font?i.font.evaluate(e).join(","):null,i.textColor?i.textColor.evaluate(e):null)}))}eachChild(e){for(const i of this.sections)e(i.content),i.scale&&e(i.scale),i.font&&e(i.font),i.textColor&&e(i.textColor)}outputDefined(){return!1}serialize(){const e=["format"];for(const i of this.sections){e.push(i.content.serialize());const n={};i.scale&&(n["font-scale"]=i.scale.serialize()),i.font&&(n["text-font"]=i.font.serialize()),i.textColor&&(n["text-color"]=i.textColor.serialize()),e.push(n)}return e}}class Ms{constructor(e){this.type=yn,this.input=e}static parse(e,i){if(e.length!==2)return i.error("Expected two arguments.");const n=i.parse(e[1],1,ut);return n?new Ms(n):i.error("No image name provided.")}evaluate(e){const i=this.input.evaluate(e),n=ji.fromString(i);return n&&e.availableImages&&(n.available=e.availableImages.indexOf(i)>-1),n}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const Ih={"to-boolean":st,"to-color":Bi,"to-number":Oe,"to-string":ut};class Ra{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");const n=e[0];if((n==="to-boolean"||n==="to-string")&&e.length!==2)return i.error("Expected one argument.");const s=Ih[n],c=[];for(let u=1;u4?`Invalid rbga value ${JSON.stringify(i)}: expected an array containing either three or four numeric values.`:sc(i[0],i[1],i[2],i[3]),!n))return new Zt(i[0]/255,i[1]/255,i[2]/255,i[3])}throw new fi(n||`Could not parse color from value '${typeof i=="string"?i:String(JSON.stringify(i))}'`)}if(this.type.kind==="number"){let i=null;for(const n of this.args){if(i=n.evaluate(e),i===null)return 0;const s=Number(i);if(!isNaN(s))return s}throw new fi(`Could not convert ${JSON.stringify(i)} to number.`)}return this.type.kind==="formatted"?Ai.fromString(Fo(this.args[0].evaluate(e))):this.type.kind==="resolvedImage"?ji.fromString(Fo(this.args[0].evaluate(e))):Fo(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){if(this.type.kind==="formatted")return new Kr([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new Ms(this.args[0]).serialize();const e=[`to-${this.type.kind}`];return this.eachChild(i=>{e.push(i.serialize())}),e}}var Xn=Ra;const cr=["Unknown","Point","LineString","Polygon"];var Ba=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null}id(){return this.feature&&this.feature.id!==void 0?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?cr[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||{}}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const t=this.featureDistanceData.center,e=this.featureDistanceData.scale,{x:i,y:n}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(i*e-t[0])+this.featureDistanceData.bearing[1]*(n*e-t[1])}return 0}parseColor(t){let e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=Zt.parse(t)),e}};class vn{constructor(e,i,n,s){this.name=e,this.type=i,this._evaluate=n,this.args=s}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map(e=>e.serialize()))}static parse(e,i){const n=e[0],s=vn.definitions[n];if(!s)return i.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0);const c=Array.isArray(s)?s[0]:s.type,u=Array.isArray(s)?[[s[1],s[2]]]:s.overloads,p=u.filter(([_])=>!Array.isArray(_)||_.length===e.length-1);let m=null;for(const[_,x]of p){m=new ja(i.registry,i.path,null,i.scope);const b=[];let w=!1;for(let S=1;S{return w=b,Array.isArray(w)?`(${w.map(Ot).join(", ")})`:`(${Ot(w.type)}...)`;var w}).join(" | "),x=[];for(let b=1;b=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Vo(t,e){const i=(180+t[0])/360,n=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,s=Math.pow(2,e.z);return[Math.round(i*s*zr),Math.round(n*s*zr)]}function ac(t,e,i){const n=t[0]-e[0],s=t[1]-e[1],c=t[0]-i[0],u=t[1]-i[1];return n*u-c*s==0&&n*c<=0&&s*u<=0}function Is(t,e){let i=!1;for(let u=0,p=e.length;u(n=t)[1]!=(c=m[_+1])[1]>n[1]&&n[0]<(c[0]-s[0])*(n[1]-s[1])/(c[1]-s[1])+s[0]&&(i=!i)}}var n,s,c;return i}function Oa(t,e){for(let i=0;i0&&p<0||u<0&&p>0}function Kn(t,e,i){for(const _ of i)for(let x=0;x<_.length-1;++x)if((p=[(u=_[x+1])[0]-(c=_[x])[0],u[1]-c[1]])[0]*(m=[(s=e)[0]-(n=t)[0],s[1]-n[1]])[1]-p[1]*m[0]!=0&&Fa(n,s,c,u)&&Fa(c,u,n,s))return!0;var n,s,c,u,p,m;return!1}function bt(t,e){for(let i=0;ii[2]){const s=.5*n;let c=t[0]-i[0]>s?-n:i[0]-t[0]>s?n:0;c===0&&(c=t[0]-i[2]>s?-n:i[2]-t[0]>s?n:0),t[0]+=c}As(e,t)}function cc(t,e,i,n){const s=Math.pow(2,n.z)*zr,c=[n.x*zr,n.y*zr],u=[];if(!t)return u;for(const p of t)for(const m of p){const _=[m.x+c[0],m.y+c[1]];Va(_,e,i,s),u.push(_)}return u}function Na(t,e,i,n){const s=Math.pow(2,n.z)*zr,c=[n.x*zr,n.y*zr],u=[];if(!t)return u;for(const m of t){const _=[];for(const x of m){const b=[x.x+c[0],x.y+c[1]];As(e,b),_.push(b)}u.push(_)}if(e[2]-e[0]<=s/2){(p=e)[0]=p[1]=1/0,p[2]=p[3]=-1/0;for(const m of u)for(const _ of m)Va(_,e,i,s)}var p;return u}class Yn{constructor(e,i){this.type=st,this.geojson=e,this.geometries=i}static parse(e,i){if(e.length!==2)return i.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Oo(e[1])){const n=e[1];if(n.type==="FeatureCollection")for(let s=0;s{e&&!Jn(i)&&(e=!1)}),e}function Pr(t){if(t instanceof Cr&&t.name==="feature-state")return!1;let e=!0;return t.eachChild(i=>{e&&!Pr(i)&&(e=!1)}),e}function bn(t,e){if(t instanceof Cr&&e.indexOf(t.name)>=0)return!1;let i=!0;return t.eachChild(n=>{i&&!bn(n,e)&&(i=!1)}),i}class zs{constructor(e,i){this.type=i.type,this.name=e,this.boundExpression=i}static parse(e,i){if(e.length!==2||typeof e[1]!="string")return i.error("'var' expression requires exactly one string literal argument.");const n=e[1];return i.scope.has(n)?new zs(n,i.scope.get(n)):i.error(`Unknown variable "${n}". Make sure "${n}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}var hc=zs;class No{constructor(e,i=[],n,s=new rc,c=[]){this.registry=e,this.path=i,this.key=i.map(u=>`[${u}]`).join(""),this.scope=s,this.errors=c,this.expectedType=n}parse(e,i,n,s,c={}){return i?this.concat(i,n,s)._parse(e,c):this._parse(e,c)}_parse(e,i){function n(s,c,u){return u==="assert"?new Ir(c,[s]):u==="coerce"?new Xn(c,[s]):s}if(e!==null&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"||(e=["literal",e]),Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const s=e[0];if(typeof s!="string")return this.error(`Expression name must be a string, but found ${typeof s} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const c=this.registry[s];if(c){let u=c.parse(e,this);if(!u)return null;if(this.expectedType){const p=this.expectedType,m=u.type;if(p.kind!=="string"&&p.kind!=="number"&&p.kind!=="boolean"&&p.kind!=="object"&&p.kind!=="array"||m.kind!=="value")if(p.kind!=="color"&&p.kind!=="formatted"&&p.kind!=="resolvedImage"||m.kind!=="value"&&m.kind!=="string"){if(this.checkSubtype(p,m))return null}else u=n(u,p,i.typeAnnotation||"coerce");else u=n(u,p,i.typeAnnotation||"assert")}if(!(u instanceof xn)&&u.type.kind!=="resolvedImage"&&Ga(u)){const p=new Ba;try{u=new xn(u.type,u.evaluate(p))}catch(m){return this.error(m.message),null}}return u}return this.error(`Unknown expression "${s}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(e===void 0?"'undefined' value invalid. Use null instead.":typeof e=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,i,n){const s=typeof e=="number"?this.path.concat(e):this.path,c=n?this.scope.concat(n):this.scope;return new No(this.registry,s,i||null,c,this.errors)}error(e,...i){const n=`${this.key}${i.map(s=>`[${s}]`).join("")}`;this.errors.push(new lr(n,e))}checkSubtype(e,i){const n=Ar(e,i);return n&&this.error(n),n}}var ja=No;function Ga(t){if(t instanceof hc)return Ga(t.boundExpression);if(t instanceof Cr&&t.name==="error"||t instanceof Uo||t instanceof Cs)return!1;const e=t instanceof Xn||t instanceof Ir;let i=!0;return t.eachChild(n=>{i=e?i&&Ga(n):i&&n instanceof xn}),!!i&&Jn(t)&&bn(t,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"])}function Ps(t,e){const i=t.length-1;let n,s,c=0,u=i,p=0;for(;c<=u;)if(p=Math.floor((c+u)/2),n=t[p],s=t[p+1],n<=e){if(p===i||ee))throw new fi("Input is not a number.");u=p-1}return 0}class ks{constructor(e,i,n){this.type=e,this.input=i,this.labels=[],this.outputs=[];for(const[s,c]of n)this.labels.push(s),this.outputs.push(c)}static parse(e,i){if(e.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return i.error("Expected an even number of arguments.");const n=i.parse(e[1],1,Oe);if(!n)return null;const s=[];let c=null;i.expectedType&&i.expectedType.kind!=="value"&&(c=i.expectedType);for(let u=1;u=p)return i.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',_);const b=i.parse(m,x,c);if(!b)return null;c=c||b.type,s.push([p,b])}return new ks(c,n,s)}evaluate(e){const i=this.labels,n=this.outputs;if(i.length===1)return n[0].evaluate(e);const s=this.input.evaluate(e);if(s<=i[0])return n[0].evaluate(e);const c=i.length;return s>=i[c-1]?n[c-1].evaluate(e):n[Ps(i,s)].evaluate(e)}eachChild(e){e(this.input);for(const i of this.outputs)e(i)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}serialize(){const e=["step",this.input.serialize()];for(let i=0;i0&&e.push(this.labels[i]),e.push(this.outputs[i].serialize());return e}}var $a=ks;function mt(t,e,i){return t*(1-i)+e*i}var jo=Object.freeze({__proto__:null,array:function(t,e,i){return t.map((n,s)=>mt(n,e[s],i))},color:function(t,e,i){return new Zt(mt(t.r,e.r,i),mt(t.g,e.g,i),mt(t.b,e.b,i),mt(t.a,e.a,i))},number:mt});const uc=.95047,Za=1.08883,dc=4/29,wn=6/29,qa=3*wn*wn,zh=wn*wn*wn,Ph=Math.PI/180,kh=180/Math.PI;function Wa(t){return t>zh?Math.pow(t,1/3):t/qa+dc}function Xa(t){return t>wn?t*t*t:qa*(t-dc)}function Ha(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Ds(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function pc(t){const e=Ds(t.r),i=Ds(t.g),n=Ds(t.b),s=Wa((.4124564*e+.3575761*i+.1804375*n)/uc),c=Wa((.2126729*e+.7151522*i+.072175*n)/1);return{l:116*c-16,a:500*(s-c),b:200*(c-Wa((.0193339*e+.119192*i+.9503041*n)/Za)),alpha:t.a}}function fc(t){let e=(t.l+16)/116,i=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*Xa(e),i=uc*Xa(i),n=Za*Xa(n),new Zt(Ha(3.2404542*i-1.5371385*e-.4985314*n),Ha(-.969266*i+1.8760108*e+.041556*n),Ha(.0556434*i-.2040259*e+1.0572252*n),t.alpha)}function Dh(t,e,i){const n=e-t;return t+i*(n>180||n<-180?n-360*Math.round(n/360):n)}const Go={forward:pc,reverse:fc,interpolate:function(t,e,i){return{l:mt(t.l,e.l,i),a:mt(t.a,e.a,i),b:mt(t.b,e.b,i),alpha:mt(t.alpha,e.alpha,i)}}},Qn={forward:function(t){const{l:e,a:i,b:n}=pc(t),s=Math.atan2(n,i)*kh;return{h:s<0?s+360:s,c:Math.sqrt(i*i+n*n),l:e,alpha:t.a}},reverse:function(t){const e=t.h*Ph,i=t.c;return fc({l:t.l,a:Math.cos(e)*i,b:Math.sin(e)*i,alpha:t.alpha})},interpolate:function(t,e,i){return{h:Dh(t.h,e.h,i),c:mt(t.c,e.c,i),l:mt(t.l,e.l,i),alpha:mt(t.alpha,e.alpha,i)}}};var Ka=Object.freeze({__proto__:null,hcl:Qn,lab:Go});class $o{constructor(e,i,n,s,c){this.type=e,this.operator=i,this.interpolation=n,this.input=s,this.labels=[],this.outputs=[];for(const[u,p]of c)this.labels.push(u),this.outputs.push(p)}static interpolationFactor(e,i,n,s){let c=0;if(e.name==="exponential")c=Ya(i,e.base,n,s);else if(e.name==="linear")c=Ya(i,1,n,s);else if(e.name==="cubic-bezier"){const u=e.controlPoints;c=new hn(u[0],u[1],u[2],u[3]).solve(Ya(i,1,n,s))}return c}static parse(e,i){let[n,s,c,...u]=e;if(!Array.isArray(s)||s.length===0)return i.error("Expected an interpolation type expression.",1);if(s[0]==="linear")s={name:"linear"};else if(s[0]==="exponential"){const _=s[1];if(typeof _!="number")return i.error("Exponential interpolation requires a numeric base.",1,1);s={name:"exponential",base:_}}else{if(s[0]!=="cubic-bezier")return i.error(`Unknown interpolation type ${String(s[0])}`,1,0);{const _=s.slice(1);if(_.length!==4||_.some(x=>typeof x!="number"||x<0||x>1))return i.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);s={name:"cubic-bezier",controlPoints:_}}}if(e.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return i.error("Expected an even number of arguments.");if(c=i.parse(c,2,Oe),!c)return null;const p=[];let m=null;n==="interpolate-hcl"||n==="interpolate-lab"?m=Bi:i.expectedType&&i.expectedType.kind!=="value"&&(m=i.expectedType);for(let _=0;_=x)return i.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',w);const M=i.parse(b,S,m);if(!M)return null;m=m||M.type,p.push([x,M])}return m.kind==="number"||m.kind==="color"||m.kind==="array"&&m.itemType.kind==="number"&&typeof m.N=="number"?new $o(m,n,s,c,p):i.error(`Type ${Ot(m)} is not interpolatable.`)}evaluate(e){const i=this.labels,n=this.outputs;if(i.length===1)return n[0].evaluate(e);const s=this.input.evaluate(e);if(s<=i[0])return n[0].evaluate(e);const c=i.length;if(s>=i[c-1])return n[c-1].evaluate(e);const u=Ps(i,s),p=$o.interpolationFactor(this.interpolation,s,i[u],i[u+1]),m=n[u].evaluate(e),_=n[u+1].evaluate(e);return this.operator==="interpolate"?jo[this.type.kind.toLowerCase()](m,_,p):this.operator==="interpolate-hcl"?Qn.reverse(Qn.interpolate(Qn.forward(m),Qn.forward(_),p)):Go.reverse(Go.interpolate(Go.forward(m),Go.forward(_),p))}eachChild(e){e(this.input);for(const i of this.outputs)e(i)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}serialize(){let e;e=this.interpolation.name==="linear"?["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const i=[this.operator,e,this.input.serialize()];for(let n=0;nAr(s,p.type));return new Ls(u?at:n,c)}evaluate(e){let i,n=null,s=0;for(const c of this.args){if(s++,n=c.evaluate(e),n&&n instanceof ji&&!n.available&&(i||(i=n),n=null,s===this.args.length))return i;if(n!==null)break}return n}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){const e=["coalesce"];return this.eachChild(i=>{e.push(i.serialize())}),e}}var Ja=Ls;class Rs{constructor(e,i){this.type=i.type,this.bindings=[].concat(e),this.result=i}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const i of this.bindings)e(i[1]);e(this.result)}static parse(e,i){if(e.length<4)return i.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const n=[];for(let c=1;c=n.length)throw new fi(`Array index out of bounds: ${i} > ${n.length-1}.`);if(i!==Math.floor(i))throw new fi(`Array index must be an integer, but found ${i} instead.`);return n[i]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}var Lh=Qa;class el{constructor(e,i){this.type=st,this.needle=e,this.haystack=i}static parse(e,i){if(e.length!==3)return i.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const n=i.parse(e[1],1,at),s=i.parse(e[2],2,at);return n&&s?Do(n.type,[st,ut,Oe,qn,at])?new el(n,s):i.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ot(n.type)} instead`):null}evaluate(e){const i=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(n==null)return!1;if(!Lo(i,["boolean","string","number","null"]))throw new fi(`Expected first argument to be of type boolean, string, number or null, but found ${Ot(Gt(i))} instead.`);if(!Lo(n,["string","array"]))throw new fi(`Expected second argument to be of type array or string, but found ${Ot(Gt(n))} instead.`);return n.indexOf(i)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}var Bs=el;class Zo{constructor(e,i,n){this.type=Oe,this.needle=e,this.haystack=i,this.fromIndex=n}static parse(e,i){if(e.length<=2||e.length>=5)return i.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const n=i.parse(e[1],1,at),s=i.parse(e[2],2,at);if(!n||!s)return null;if(!Do(n.type,[st,ut,Oe,qn,at]))return i.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ot(n.type)} instead`);if(e.length===4){const c=i.parse(e[3],3,Oe);return c?new Zo(n,s,c):null}return new Zo(n,s)}evaluate(e){const i=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!Lo(i,["boolean","string","number","null"]))throw new fi(`Expected first argument to be of type boolean, string, number or null, but found ${Ot(Gt(i))} instead.`);if(!Lo(n,["string","array"]))throw new fi(`Expected second argument to be of type array or string, but found ${Ot(Gt(n))} instead.`);if(this.fromIndex){const s=this.fromIndex.evaluate(e);return n.indexOf(i,s)}return n.indexOf(i)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}serialize(){if(this.fromIndex!=null&&this.fromIndex!==void 0){const e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}var _c=Zo;class tl{constructor(e,i,n,s,c,u){this.inputType=e,this.type=i,this.input=n,this.cases=s,this.outputs=c,this.otherwise=u}static parse(e,i){if(e.length<5)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return i.error("Expected an even number of arguments.");let n,s;i.expectedType&&i.expectedType.kind!=="value"&&(s=i.expectedType);const c={},u=[];for(let _=2;_Number.MAX_SAFE_INTEGER)return w.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof M=="number"&&Math.floor(M)!==M)return w.error("Numeric branch labels must be integer values.");if(n){if(w.checkSubtype(n,Gt(M)))return null}else n=Gt(M);if(c[String(M)]!==void 0)return w.error("Branch labels must be unique.");c[String(M)]=u.length}const S=i.parse(b,_,s);if(!S)return null;s=s||S.type,u.push(S)}const p=i.parse(e[1],1,at);if(!p)return null;const m=i.parse(e[e.length-1],e.length-1,s);return m?p.type.kind!=="value"&&i.concat(1).checkSubtype(n,p.type)?null:new tl(n,s,p,c,u,m):null}evaluate(e){const i=this.input.evaluate(e);return(Gt(i)===this.inputType&&this.outputs[this.cases[i]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}serialize(){const e=["match",this.input.serialize()],i=Object.keys(this.cases).sort(),n=[],s={};for(const u of i){const p=s[this.cases[u]];p===void 0?(s[this.cases[u]]=n.length,n.push([this.cases[u],[u]])):n[p][1].push(u)}const c=u=>this.inputType.kind==="number"?Number(u):u;for(const[u,p]of n)e.push(p.length===1?c(p[0]):p.map(c)),e.push(this.outputs[u].serialize());return e.push(this.otherwise.serialize()),e}}var Rh=tl;class il{constructor(e,i,n){this.type=e,this.branches=i,this.otherwise=n}static parse(e,i){if(e.length<4)return i.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return i.error("Expected an odd number of arguments.");let n;i.expectedType&&i.expectedType.kind!=="value"&&(n=i.expectedType);const s=[];for(let u=1;ui.outputDefined())&&this.otherwise.outputDefined()}serialize(){const e=["case"];return this.eachChild(i=>{e.push(i.serialize())}),e}}var gc=il;class qo{constructor(e,i,n,s){this.type=e,this.input=i,this.beginIndex=n,this.endIndex=s}static parse(e,i){if(e.length<=2||e.length>=5)return i.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const n=i.parse(e[1],1,at),s=i.parse(e[2],2,Oe);if(!n||!s)return null;if(!Do(n.type,[Ni(at),ut,at]))return i.error(`Expected first argument to be of type array or string, but found ${Ot(n.type)} instead`);if(e.length===4){const c=i.parse(e[3],3,Oe);return c?new qo(n.type,n,s,c):null}return new qo(n.type,n,s)}evaluate(e){const i=this.input.evaluate(e),n=this.beginIndex.evaluate(e);if(!Lo(i,["string","array"]))throw new fi(`Expected first argument to be of type array or string, but found ${Ot(Gt(i))} instead.`);if(this.endIndex){const s=this.endIndex.evaluate(e);return i.slice(n,s)}return i.slice(n)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}serialize(){if(this.endIndex!=null&&this.endIndex!==void 0){const e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}var yc=qo;function Os(t,e){return t==="=="||t==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function xc(t,e,i,n){return n.compare(e,i)===0}function eo(t,e,i){const n=t!=="=="&&t!=="!=";return class Ff{constructor(c,u,p){this.type=st,this.lhs=c,this.rhs=u,this.collator=p,this.hasUntypedArgument=c.type.kind==="value"||u.type.kind==="value"}static parse(c,u){if(c.length!==3&&c.length!==4)return u.error("Expected two or three arguments.");const p=c[0];let m=u.parse(c[1],1,at);if(!m)return null;if(!Os(p,m.type))return u.concat(1).error(`"${p}" comparisons are not supported for type '${Ot(m.type)}'.`);let _=u.parse(c[2],2,at);if(!_)return null;if(!Os(p,_.type))return u.concat(2).error(`"${p}" comparisons are not supported for type '${Ot(_.type)}'.`);if(m.type.kind!==_.type.kind&&m.type.kind!=="value"&&_.type.kind!=="value")return u.error(`Cannot compare types '${Ot(m.type)}' and '${Ot(_.type)}'.`);n&&(m.type.kind==="value"&&_.type.kind!=="value"?m=new Ir(_.type,[m]):m.type.kind!=="value"&&_.type.kind==="value"&&(_=new Ir(m.type,[_])));let x=null;if(c.length===4){if(m.type.kind!=="string"&&_.type.kind!=="string"&&m.type.kind!=="value"&&_.type.kind!=="value")return u.error("Cannot use collator to compare non-string types.");if(x=u.parse(c[3],3,Oi),!x)return null}return new Ff(m,_,x)}evaluate(c){const u=this.lhs.evaluate(c),p=this.rhs.evaluate(c);if(n&&this.hasUntypedArgument){const m=Gt(u),_=Gt(p);if(m.kind!==_.kind||m.kind!=="string"&&m.kind!=="number")throw new fi(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${m.kind}, ${_.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const m=Gt(u),_=Gt(p);if(m.kind!=="string"||_.kind!=="string")return e(c,u,p)}return this.collator?i(c,u,p,this.collator.evaluate(c)):e(c,u,p)}eachChild(c){c(this.lhs),c(this.rhs),this.collator&&c(this.collator)}outputDefined(){return!0}serialize(){const c=[t];return this.eachChild(u=>{c.push(u.serialize())}),c}}}const Bh=eo("==",function(t,e,i){return e===i},xc),Oh=eo("!=",function(t,e,i){return e!==i},function(t,e,i,n){return!xc(0,e,i,n)}),Fh=eo("<",function(t,e,i){return e",function(t,e,i){return e>i},function(t,e,i,n){return n.compare(e,i)>0}),Vh=eo("<=",function(t,e,i){return e<=i},function(t,e,i,n){return n.compare(e,i)<=0}),vc=eo(">=",function(t,e,i){return e>=i},function(t,e,i,n){return n.compare(e,i)>=0});class Fs{constructor(e,i,n,s,c,u){this.type=ut,this.number=e,this.locale=i,this.currency=n,this.unit=s,this.minFractionDigits=c,this.maxFractionDigits=u}static parse(e,i){if(e.length!==3)return i.error("Expected two arguments.");const n=i.parse(e[1],1,Oe);if(!n)return null;const s=e[2];if(typeof s!="object"||Array.isArray(s))return i.error("NumberFormat options argument must be an object.");let c=null;if(s.locale&&(c=i.parse(s.locale,1,ut),!c))return null;let u=null;if(s.currency&&(u=i.parse(s.currency,1,ut),!u))return null;let p=null;if(s.unit&&(p=i.parse(s.unit,1,ut),!p))return null;let m=null;if(s["min-fraction-digits"]&&(m=i.parse(s["min-fraction-digits"],1,Oe),!m))return null;let _=null;return s["max-fraction-digits"]&&(_=i.parse(s["max-fraction-digits"],1,Oe),!_)?null:new Fs(n,c,u,p,m,_)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.unit&&(e.unit=this.unit.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]}}class to{constructor(e){this.type=Oe,this.input=e}static parse(e,i){if(e.length!==2)return i.error(`Expected 1 argument, but found ${e.length-1} instead.`);const n=i.parse(e[1],1);return n?n.type.kind!=="array"&&n.type.kind!=="string"&&n.type.kind!=="value"?i.error(`Expected argument of type string or array, but found ${Ot(n.type)} instead.`):new to(n):null}evaluate(e){const i=this.input.evaluate(e);if(typeof i=="string"||Array.isArray(i))return i.length;throw new fi(`Expected value to be of type string or array, but found ${Ot(Gt(i))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){const e=["length"];return this.eachChild(i=>{e.push(i.serialize())}),e}}const bc={"==":Bh,"!=":Oh,">":Uh,"<":Fh,">=":vc,"<=":Vh,array:Ir,at:Lh,boolean:Ir,case:gc,coalesce:Ja,collator:Uo,format:Kr,image:Ms,in:Bs,"index-of":_c,interpolate:hr,"interpolate-hcl":hr,"interpolate-lab":hr,length:to,let:mc,literal:xn,match:Rh,number:Ir,"number-format":Fs,object:Ir,slice:yc,step:$a,string:Ir,"to-boolean":Xn,"to-color":Xn,"to-number":Xn,"to-string":Xn,var:hc,within:Cs};function wc(t,[e,i,n,s]){e=e.evaluate(t),i=i.evaluate(t),n=n.evaluate(t);const c=s?s.evaluate(t):1,u=sc(e,i,n,c);if(u)throw new fi(u);return new Zt(e/255*c,i/255*c,n/255*c,c)}function kr(t,e){return t in e}function Us(t,e){const i=e[t];return i===void 0?null:i}function Gi(t){return{type:t}}Cr.register(bc,{error:[{kind:"error"},[ut],(t,[e])=>{throw new fi(e.evaluate(t))}],typeof:[ut,[at],(t,[e])=>Ot(Gt(e.evaluate(t)))],"to-rgba":[Ni(Oe,4),[Bi],(t,[e])=>e.evaluate(t).toArray()],rgb:[Bi,[Oe,Oe,Oe],wc],rgba:[Bi,[Oe,Oe,Oe,Oe],wc],has:{type:st,overloads:[[[ut],(t,[e])=>kr(e.evaluate(t),t.properties())],[[ut,er],(t,[e,i])=>kr(e.evaluate(t),i.evaluate(t))]]},get:{type:at,overloads:[[[ut],(t,[e])=>Us(e.evaluate(t),t.properties())],[[ut,er],(t,[e,i])=>Us(e.evaluate(t),i.evaluate(t))]]},"feature-state":[at,[ut],(t,[e])=>Us(e.evaluate(t),t.featureState||{})],properties:[er,[],t=>t.properties()],"geometry-type":[ut,[],t=>t.geometryType()],id:[at,[],t=>t.id()],zoom:[Oe,[],t=>t.globals.zoom],pitch:[Oe,[],t=>t.globals.pitch||0],"distance-from-center":[Oe,[],t=>t.distanceFromCenter()],"heatmap-density":[Oe,[],t=>t.globals.heatmapDensity||0],"line-progress":[Oe,[],t=>t.globals.lineProgress||0],"sky-radial-progress":[Oe,[],t=>t.globals.skyRadialProgress||0],accumulated:[at,[],t=>t.globals.accumulated===void 0?null:t.globals.accumulated],"+":[Oe,Gi(Oe),(t,e)=>{let i=0;for(const n of e)i+=n.evaluate(t);return i}],"*":[Oe,Gi(Oe),(t,e)=>{let i=1;for(const n of e)i*=n.evaluate(t);return i}],"-":{type:Oe,overloads:[[[Oe,Oe],(t,[e,i])=>e.evaluate(t)-i.evaluate(t)],[[Oe],(t,[e])=>-e.evaluate(t)]]},"/":[Oe,[Oe,Oe],(t,[e,i])=>e.evaluate(t)/i.evaluate(t)],"%":[Oe,[Oe,Oe],(t,[e,i])=>e.evaluate(t)%i.evaluate(t)],ln2:[Oe,[],()=>Math.LN2],pi:[Oe,[],()=>Math.PI],e:[Oe,[],()=>Math.E],"^":[Oe,[Oe,Oe],(t,[e,i])=>Math.pow(e.evaluate(t),i.evaluate(t))],sqrt:[Oe,[Oe],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[Oe,[Oe],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[Oe,[Oe],(t,[e])=>Math.log(e.evaluate(t))],log2:[Oe,[Oe],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[Oe,[Oe],(t,[e])=>Math.sin(e.evaluate(t))],cos:[Oe,[Oe],(t,[e])=>Math.cos(e.evaluate(t))],tan:[Oe,[Oe],(t,[e])=>Math.tan(e.evaluate(t))],asin:[Oe,[Oe],(t,[e])=>Math.asin(e.evaluate(t))],acos:[Oe,[Oe],(t,[e])=>Math.acos(e.evaluate(t))],atan:[Oe,[Oe],(t,[e])=>Math.atan(e.evaluate(t))],min:[Oe,Gi(Oe),(t,e)=>Math.min(...e.map(i=>i.evaluate(t)))],max:[Oe,Gi(Oe),(t,e)=>Math.max(...e.map(i=>i.evaluate(t)))],abs:[Oe,[Oe],(t,[e])=>Math.abs(e.evaluate(t))],round:[Oe,[Oe],(t,[e])=>{const i=e.evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[Oe,[Oe],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[Oe,[Oe],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[st,[ut,at],(t,[e,i])=>t.properties()[e.value]===i.value],"filter-id-==":[st,[at],(t,[e])=>t.id()===e.value],"filter-type-==":[st,[ut],(t,[e])=>t.geometryType()===e.value],"filter-<":[st,[ut,at],(t,[e,i])=>{const n=t.properties()[e.value],s=i.value;return typeof n==typeof s&&n{const i=t.id(),n=e.value;return typeof i==typeof n&&i":[st,[ut,at],(t,[e,i])=>{const n=t.properties()[e.value],s=i.value;return typeof n==typeof s&&n>s}],"filter-id->":[st,[at],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i>n}],"filter-<=":[st,[ut,at],(t,[e,i])=>{const n=t.properties()[e.value],s=i.value;return typeof n==typeof s&&n<=s}],"filter-id-<=":[st,[at],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i<=n}],"filter->=":[st,[ut,at],(t,[e,i])=>{const n=t.properties()[e.value],s=i.value;return typeof n==typeof s&&n>=s}],"filter-id->=":[st,[at],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i>=n}],"filter-has":[st,[at],(t,[e])=>e.value in t.properties()],"filter-has-id":[st,[],t=>t.id()!==null&&t.id()!==void 0],"filter-type-in":[st,[Ni(ut)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[st,[Ni(at)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[st,[ut,Ni(at)],(t,[e,i])=>i.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[st,[ut,Ni(at)],(t,[e,i])=>function(n,s,c,u){for(;c<=u;){const p=c+u>>1;if(s[p]===n)return!0;s[p]>n?u=p-1:c=p+1}return!1}(t.properties()[e.value],i.value,0,i.value.length-1)],all:{type:st,overloads:[[[st,st],(t,[e,i])=>e.evaluate(t)&&i.evaluate(t)],[Gi(st),(t,e)=>{for(const i of e)if(!i.evaluate(t))return!1;return!0}]]},any:{type:st,overloads:[[[st,st],(t,[e,i])=>e.evaluate(t)||i.evaluate(t)],[Gi(st),(t,e)=>{for(const i of e)if(i.evaluate(t))return!0;return!1}]]},"!":[st,[st],(t,[e])=>!e.evaluate(t)],"is-supported-script":[st,[ut],(t,[e])=>{const i=t.globals&&t.globals.isSupportedScript;return!i||i(e.evaluate(t))}],upcase:[ut,[ut],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[ut,[ut],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[ut,Gi(at),(t,e)=>e.map(i=>Fo(i.evaluate(t))).join("")],"resolved-locale":[ut,[Oi],(t,[e])=>e.evaluate(t).resolvedLocale()]});var Wo=bc;function Tc(t){return{result:"success",value:t}}function Tn(t){return{result:"error",value:t}}function io(t){return t["property-type"]==="data-driven"}function Vs(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Ns(t){return!!t.expression&&t.expression.interpolated}function _t(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":t===null?"null":typeof t}function Xo(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Ec(t){return t}function js(t,e){const i=e.type==="color",n=t.stops&&typeof t.stops[0][0]=="object",s=n||!(n||t.property!==void 0),c=t.type||(Ns(e)?"exponential":"interval");if(i&&((t=Mr({},t)).stops&&(t.stops=t.stops.map(_=>[_[0],Zt.parse(_[1])])),t.default=Zt.parse(t.default?t.default:e.default)),t.colorSpace&&t.colorSpace!=="rgb"&&!Ka[t.colorSpace])throw new Error(`Unknown color space: ${t.colorSpace}`);let u,p,m;if(c==="exponential")u=Dr;else if(c==="interval")u=Gs;else if(c==="categorical"){u=Sc,p=Object.create(null);for(const _ of t.stops)p[_[0]]=_[1];m=typeof t.stops[0][0]}else{if(c!=="identity")throw new Error(`Unknown function type "${c}"`);u=Mc}if(n){const _={},x=[];for(let S=0;SS[0]),evaluate:({zoom:S},M)=>Dr({stops:b,base:t.base},e,S).evaluate(S,M)}}if(s){const _=c==="exponential"?{name:"exponential",base:t.base!==void 0?t.base:1}:null;return{kind:"camera",interpolationType:_,interpolationFactor:hr.interpolationFactor.bind(void 0,_),zoomStops:t.stops.map(x=>x[0]),evaluate:({zoom:x})=>u(t,e,x,p,m)}}return{kind:"source",evaluate(_,x){const b=x&&x.properties?x.properties[t.property]:void 0;return b===void 0?ro(t.default,e.default):u(t,e,b,p,m)}}}function ro(t,e,i){return t!==void 0?t:e!==void 0?e:i!==void 0?i:void 0}function Sc(t,e,i,n,s){return ro(typeof i===s?n[i]:void 0,t.default,e.default)}function Gs(t,e,i){if(_t(i)!=="number")return ro(t.default,e.default);const n=t.stops.length;if(n===1||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=Ps(t.stops.map(c=>c[0]),i);return t.stops[s][1]}function Dr(t,e,i){const n=t.base!==void 0?t.base:1;if(_t(i)!=="number")return ro(t.default,e.default);const s=t.stops.length;if(s===1||i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[s-1][0])return t.stops[s-1][1];const c=Ps(t.stops.map(x=>x[0]),i),u=function(x,b,w,S){const M=S-w,C=x-w;return M===0?0:b===1?C/M:(Math.pow(b,C)-1)/(Math.pow(b,M)-1)}(i,n,t.stops[c][0],t.stops[c+1][0]),p=t.stops[c][1],m=t.stops[c+1][1];let _=jo[e.type]||Ec;if(t.colorSpace&&t.colorSpace!=="rgb"){const x=Ka[t.colorSpace];_=(b,w)=>x.reverse(x.interpolate(x.forward(b),x.forward(w),u))}return typeof p.evaluate=="function"?{evaluate(...x){const b=p.evaluate.apply(void 0,x),w=m.evaluate.apply(void 0,x);if(b!==void 0&&w!==void 0)return _(b,w,u)}}:_(p,m,u)}function Mc(t,e,i){return e.type==="color"?i=Zt.parse(i):e.type==="formatted"?i=Ai.fromString(i.toString()):e.type==="resolvedImage"?i=ji.fromString(i.toString()):_t(i)===e.type||e.type==="enum"&&e.values[i]||(i=void 0),ro(i,t.default,e.default)}class $s{constructor(e,i){this.expression=e,this._warningHistory={},this._evaluator=new Ba,this._defaultValue=i?function(n){return n.type==="color"&&(Xo(n.default)||Array.isArray(n.default))?new Zt(0,0,0,0):n.type==="color"?Zt.parse(n.default)||null:n.default===void 0?null:n.default}(i):null,this._enumValues=i&&i.type==="enum"?i.values:null}evaluateWithoutErrorHandling(e,i,n,s,c,u,p,m){return this._evaluator.globals=e,this._evaluator.feature=i,this._evaluator.featureState=n,this._evaluator.canonical=s||null,this._evaluator.availableImages=c||null,this._evaluator.formattedSection=u,this._evaluator.featureTileCoord=p||null,this._evaluator.featureDistanceData=m||null,this.expression.evaluate(this._evaluator)}evaluate(e,i,n,s,c,u,p,m){this._evaluator.globals=e,this._evaluator.feature=i||null,this._evaluator.featureState=n||null,this._evaluator.canonical=s||null,this._evaluator.availableImages=c||null,this._evaluator.formattedSection=u||null,this._evaluator.featureTileCoord=p||null,this._evaluator.featureDistanceData=m||null;try{const _=this.expression.evaluate(this._evaluator);if(_==null||typeof _=="number"&&_!=_)return this._defaultValue;if(this._enumValues&&!(_ in this._enumValues))throw new fi(`Expected value to be one of ${Object.keys(this._enumValues).map(x=>JSON.stringify(x)).join(", ")}, but found ${JSON.stringify(_)} instead.`);return _}catch(_){return this._warningHistory[_.message]||(this._warningHistory[_.message]=!0,typeof console<"u"&&console.warn(_.message)),this._defaultValue}}}function no(t){return Array.isArray(t)&&t.length>0&&typeof t[0]=="string"&&t[0]in Wo}function oo(t,e){const i=new ja(Wo,[],e?function(s){const c={color:Bi,string:ut,number:Oe,enum:ut,boolean:st,formatted:ko,resolvedImage:yn};return s.type==="array"?Ni(c[s.value]||at,s.length):c[s.type]}(e):void 0),n=i.parse(t,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return n?Tc(new $s(n,e)):Tn(i.errors)}class rl{constructor(e,i){this.kind=e,this._styleExpression=i,this.isStateDependent=e!=="constant"&&!Pr(i.expression)}evaluateWithoutErrorHandling(e,i,n,s,c,u){return this._styleExpression.evaluateWithoutErrorHandling(e,i,n,s,c,u)}evaluate(e,i,n,s,c,u){return this._styleExpression.evaluate(e,i,n,s,c,u)}}class Ho{constructor(e,i,n,s){this.kind=e,this.zoomStops=n,this._styleExpression=i,this.isStateDependent=e!=="camera"&&!Pr(i.expression),this.interpolationType=s}evaluateWithoutErrorHandling(e,i,n,s,c,u){return this._styleExpression.evaluateWithoutErrorHandling(e,i,n,s,c,u)}evaluate(e,i,n,s,c,u){return this._styleExpression.evaluate(e,i,n,s,c,u)}interpolationFactor(e,i,n){return this.interpolationType?hr.interpolationFactor(this.interpolationType,e,i,n):0}}function Ko(t,e){if((t=oo(t,e)).result==="error")return t;const i=t.value.expression,n=Jn(i);if(!n&&!io(e))return Tn([new lr("","data expressions not supported")]);const s=bn(i,["zoom","pitch","distance-from-center"]);if(!s&&!Vs(e))return Tn([new lr("","zoom expressions not supported")]);const c=qs(i);return c||s?c instanceof lr?Tn([c]):c instanceof hr&&!Ns(e)?Tn([new lr("",'"interpolate" expressions cannot be used with this property')]):Tc(c?new Ho(n?"camera":"composite",t.value,c.labels,c instanceof hr?c.interpolation:void 0):new rl(n?"constant":"source",t.value)):Tn([new lr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Zs{constructor(e,i){this._parameters=e,this._specification=i,Mr(this,js(this._parameters,this._specification))}static deserialize(e){return new Zs(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function qs(t){let e=null;if(t instanceof mc)e=qs(t.result);else if(t instanceof Ja){for(const i of t.args)if(e=qs(i),e)break}else(t instanceof $a||t instanceof hr)&&t.input instanceof Cr&&t.input.name==="zoom"&&(e=t);return e instanceof lr||t.eachChild(i=>{const n=qs(i);n instanceof lr?e=n:!e&&n?e=new lr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&n&&e!==n&&(e=new lr("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}class Fe{constructor(e,i,n,s){this.message=(e?`${e}: `:"")+n,s&&(this.identifier=s),i!=null&&i.__line__&&(this.line=i.__line__)}}function tr(t){const e=t.key,i=t.value,n=t.valueSpec||{},s=t.objectElementValidators||{},c=t.style,u=t.styleSpec;let p=[];const m=_t(i);if(m!=="object")return[new Fe(e,i,`object expected, ${m} found`)];for(const _ in i){const x=_.split(".")[0];let b;s[x]?b=s[x]:n[x]?b=xi:s["*"]?b=s["*"]:n["*"]&&(b=xi),b?p=p.concat(b({key:(e&&`${e}.`)+_,value:i[_],valueSpec:n[x]||n["*"],style:c,styleSpec:u,object:i,objectKey:_},i)):p.push(new Fe(e,i[_],`unknown property "${_}"`))}for(const _ in n)s[_]||n[_].required&&n[_].default===void 0&&i[_]===void 0&&p.push(new Fe(e,i,`missing required property "${_}"`));return p}function Ac(t){const e=t.value,i=t.valueSpec,n=t.style,s=t.styleSpec,c=t.key,u=t.arrayElementValidator||xi;if(_t(e)!=="array")return[new Fe(c,e,`array expected, ${_t(e)} found`)];if(i.length&&e.length!==i.length)return[new Fe(c,e,`array length ${i.length} expected, length ${e.length} found`)];if(i["min-length"]&&e.lengthc)return[new Fe(e,i,`${i} is greater than the maximum value ${c}`)]}return[]}function Jo(t){const e=t.valueSpec,i=Ht(t.value.type);let n,s,c,u={};const p=i!=="categorical"&&t.value.property===void 0,m=!p,_=_t(t.value.stops)==="array"&&_t(t.value.stops[0])==="array"&&_t(t.value.stops[0][0])==="object",x=tr({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(S){if(i==="identity")return[new Fe(S.key,S.value,'identity function may not have a "stops" property')];let M=[];const C=S.value;return M=M.concat(Ac({key:S.key,value:C,valueSpec:S.valueSpec,style:S.style,styleSpec:S.styleSpec,arrayElementValidator:b})),_t(C)==="array"&&C.length===0&&M.push(new Fe(S.key,C,"array must have at least one stop")),M},default:function(S){return xi({key:S.key,value:S.value,valueSpec:e,style:S.style,styleSpec:S.styleSpec})}}});return i==="identity"&&p&&x.push(new Fe(t.key,t.value,'missing required property "property"')),i==="identity"||t.value.stops||x.push(new Fe(t.key,t.value,'missing required property "stops"')),i==="exponential"&&t.valueSpec.expression&&!Ns(t.valueSpec)&&x.push(new Fe(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(m&&!io(t.valueSpec)?x.push(new Fe(t.key,t.value,"property functions not supported")):p&&!Vs(t.valueSpec)&&x.push(new Fe(t.key,t.value,"zoom functions not supported"))),i!=="categorical"&&!_||t.value.property!==void 0||x.push(new Fe(t.key,t.value,'"property" property is required')),x;function b(S){let M=[];const C=S.value,D=S.key;if(_t(C)!=="array")return[new Fe(D,C,`array expected, ${_t(C)} found`)];if(C.length!==2)return[new Fe(D,C,`array length 2 expected, length ${C.length} found`)];if(_){if(_t(C[0])!=="object")return[new Fe(D,C,`object expected, ${_t(C[0])} found`)];if(C[0].zoom===void 0)return[new Fe(D,C,"object stop key must have zoom")];if(C[0].value===void 0)return[new Fe(D,C,"object stop key must have value")];const U=Ht(C[0].zoom);if(typeof U!="number")return[new Fe(D,C[0].zoom,"stop zoom values must be numbers")];if(c&&c>U)return[new Fe(D,C[0].zoom,"stop zoom values must appear in ascending order")];U!==c&&(c=U,s=void 0,u={}),M=M.concat(tr({key:`${D}[0]`,value:C[0],valueSpec:{zoom:{}},style:S.style,styleSpec:S.styleSpec,objectElementValidators:{zoom:Yo,value:w}}))}else M=M.concat(w({key:`${D}[0]`,value:C[0],valueSpec:{},style:S.style,styleSpec:S.styleSpec},C));return no(ci(C[1]))?M.concat([new Fe(`${D}[1]`,C[1],"expressions are not allowed in function stops.")]):M.concat(xi({key:`${D}[1]`,value:C[1],valueSpec:e,style:S.style,styleSpec:S.styleSpec}))}function w(S,M){const C=_t(S.value),D=Ht(S.value),U=S.value!==null?S.value:M;if(n){if(C!==n)return[new Fe(S.key,U,`${C} stop domain type must match previous stop domain type ${n}`)]}else n=C;if(C!=="number"&&C!=="string"&&C!=="boolean"&&typeof D!="number"&&typeof D!="string"&&typeof D!="boolean")return[new Fe(S.key,U,"stop domain value must be a number, string, or boolean")];if(C!=="number"&&i!=="categorical"){let q=`number expected, ${C} found`;return io(e)&&i===void 0&&(q+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Fe(S.key,U,q)]}return i!=="categorical"||C!=="number"||typeof D=="number"&&isFinite(D)&&Math.floor(D)===D?i!=="categorical"&&C==="number"&&typeof D=="number"&&typeof s=="number"&&s!==void 0&&Dnew Fe(`${t.key}${n.key}`,t.value,n.message));const i=e.value.expression||e.value._styleExpression.expression;if(t.expressionContext==="property"&&t.propertyKey==="text-font"&&!i.outputDefined())return[new Fe(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if(t.expressionContext==="property"&&t.propertyType==="layout"&&!Pr(i))return[new Fe(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if(t.expressionContext==="filter")return Qo(i,t);if(t.expressionContext&&t.expressionContext.indexOf("cluster")===0){if(!bn(i,["zoom","feature-state"]))return[new Fe(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(t.expressionContext==="cluster-initial"&&!Jn(i))return[new Fe(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Qo(t,e){const i=new Set(["zoom","feature-state","pitch","distance-from-center"]);if(e.valueSpec&&e.valueSpec.expression)for(const s of e.valueSpec.expression.parameters)i.delete(s);if(i.size===0)return[];const n=[];return t instanceof Cr&&i.has(t.name)?[new Fe(e.key,e.value,`["${t.name}"] expression is not supported in a filter for a ${e.object.type} layer with id: ${e.object.id}`)]:(t.eachChild(s=>{n.push(...Qo(s,e))}),n)}function Ws(t){const e=t.key,i=t.value,n=t.valueSpec,s=[];return Array.isArray(n.values)?n.values.indexOf(Ht(i))===-1&&s.push(new Fe(e,i,`expected one of [${n.values.join(", ")}], ${JSON.stringify(i)} found`)):Object.keys(n.values).indexOf(Ht(i))===-1&&s.push(new Fe(e,i,`expected one of [${Object.keys(n.values).join(", ")}], ${JSON.stringify(i)} found`)),s}function nl(t){if(t===!0||t===!1)return!0;if(!Array.isArray(t)||t.length===0)return!1;switch(t[0]){case"has":return t.length>=2&&t[1]!=="$id"&&t[1]!=="$type";case"in":return t.length>=3&&(typeof t[1]!="string"||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return t.length!==3||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(const e of t.slice(1))if(!nl(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}function Xs(t,e="fill"){if(t==null)return{filter:()=>!0,needGeometry:!1,needFeature:!1};nl(t)||(t=ao(t));const i=t;let n=!0;try{n=function(_){if(!so(_))return _;let x=ci(_);return Hs(x),x=Ic(x),x}(i)}catch{console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate. -This is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md -and paste the contents of this message in the report. -Thank you! -Filter Expression: -${JSON.stringify(i,null,2)} - `)}const s=fe[`filter_${e}`],c=oo(n,s);let u=null;if(c.result==="error")throw new Error(c.value.map(_=>`${_.key}: ${_.message}`).join(", "));u=(_,x,b)=>c.value.evaluate(_,x,{},b);let p=null,m=null;if(n!==i){const _=oo(i,s);if(_.result==="error")throw new Error(_.value.map(x=>`${x.key}: ${x.message}`).join(", "));p=(x,b,w,S,M)=>_.value.evaluate(x,b,{},w,void 0,void 0,S,M),m=!Jn(_.value.expression)}return{filter:u,dynamicFilter:p||void 0,needGeometry:Cc(n),needFeature:!!m}}function Ic(t){if(!Array.isArray(t))return t;const e=function(i){if(ol.has(i[0])){for(let n=1;nIc(i))}function Hs(t){let e=!1;const i=[];if(t[0]==="case"){for(let n=1;n",">=","<","<=","to-boolean"]);function Nh(t,e){return te?1:0}function Cc(t){if(!Array.isArray(t))return!1;if(t[0]==="within")return!0;for(let e=1;e"||e==="<="||e===">="?sl(t[1],t[2],e):e==="any"?(i=t.slice(1),["any"].concat(i.map(ao))):e==="all"?["all"].concat(t.slice(1).map(ao)):e==="none"?["all"].concat(t.slice(1).map(ao).map(Ks)):e==="in"?al(t[1],t.slice(2)):e==="!in"?Ks(al(t[1],t.slice(2))):e==="has"?ll(t[1]):e==="!has"?Ks(ll(t[1])):e!=="within"||t;var i}function sl(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 al(t,e){if(e.length===0)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(i=>typeof i!=typeof e[0])?["filter-in-large",t,["literal",e.sort(Nh)]]:["filter-in-small",t,["literal",e]]}}function ll(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Ks(t){return["!",t]}function es(t){return nl(ci(t.value))?hi(Mr({},t,{expressionContext:"filter",valueSpec:t.styleSpec[`filter_${t.layerType||"fill"}`]})):ts(t)}function ts(t){const e=t.value,i=t.key;if(_t(e)!=="array")return[new Fe(i,e,`array expected, ${_t(e)} found`)];const n=t.styleSpec;let s,c=[];if(e.length<1)return[new Fe(i,e,"filter array must have at least 1 element")];switch(c=c.concat(Ws({key:`${i}[0]`,value:e[0],valueSpec:n.filter_operator,style:t.style,styleSpec:t.styleSpec})),Ht(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&Ht(e[1])==="$type"&&c.push(new Fe(i,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&c.push(new Fe(i,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(s=_t(e[1]),s!=="string"&&c.push(new Fe(`${i}[1]`,e[1],`string expected, ${s} found`)));for(let u=2;u{_ in i&&e.push(new Fe(n,i[_],`"${_}" is prohibited for ref layers`))}),s.layers.forEach(_=>{Ht(_.id)===p&&(m=_)}),m?m.ref?e.push(new Fe(n,i.ref,"ref cannot reference another ref layer")):u=Ht(m.type):typeof p=="string"&&e.push(new Fe(n,i.ref,`ref layer "${p}" not found`))}else if(u!=="background"&&u!=="sky")if(i.source){const m=s.sources&&s.sources[i.source],_=m&&Ht(m.type);m?_==="vector"&&u==="raster"?e.push(new Fe(n,i.source,`layer "${i.id}" requires a raster source`)):_==="raster"&&u!=="raster"?e.push(new Fe(n,i.source,`layer "${i.id}" requires a vector source`)):_!=="vector"||i["source-layer"]?_==="raster-dem"&&u!=="hillshade"?e.push(new Fe(n,i.source,"raster-dem source can only be used with layer type 'hillshade'.")):u!=="line"||!i.paint||!i.paint["line-gradient"]&&!i.paint["line-trim-offset"]||_==="geojson"&&m.lineMetrics||e.push(new Fe(n,i,`layer "${i.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new Fe(n,i,`layer "${i.id}" must specify a "source-layer"`)):e.push(new Fe(n,i.source,`source "${i.source}" not found`))}else e.push(new Fe(n,i,'missing required property "source"'));return e=e.concat(tr({key:n,value:i,valueSpec:c.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":()=>[],type:()=>xi({key:`${n}.type`,value:i.type,valueSpec:c.layer.type,style:t.style,styleSpec:t.styleSpec,object:i,objectKey:"type"}),filter:m=>es(Mr({layerType:u},m)),layout:m=>tr({layer:i,key:m.key,value:m.value,valueSpec:{},style:m.style,styleSpec:m.styleSpec,objectElementValidators:{"*":_=>hl(Mr({layerType:u},_))}}),paint:m=>tr({layer:i,key:m.key,value:m.value,valueSpec:{},style:m.style,styleSpec:m.styleSpec,objectElementValidators:{"*":_=>zc(Mr({layerType:u},_))}})}})),e}function Yr(t){const e=t.value,i=t.key,n=_t(e);return n!=="string"?[new Fe(i,e,`string expected, ${n} found`)]:[]}const kc={promoteId:function({key:t,value:e}){if(_t(e)==="string")return Yr({key:t,value:e});{const i=[];for(const n in e)i.push(...Yr({key:`${t}.${n}`,value:e[n]}));return i}}};function Dc(t){const e=t.value,i=t.key,n=t.styleSpec,s=t.style;if(!e.type)return[new Fe(i,e,'"type" is required')];const c=Ht(e.type);let u;switch(c){case"vector":case"raster":case"raster-dem":return u=tr({key:i,value:e,valueSpec:n[`source_${c.replace("-","_")}`],style:t.style,styleSpec:n,objectElementValidators:kc}),u;case"geojson":if(u=tr({key:i,value:e,valueSpec:n.source_geojson,style:s,styleSpec:n,objectElementValidators:kc}),e.cluster)for(const p in e.clusterProperties){const[m,_]=e.clusterProperties[p],x=typeof m=="string"?[m,["accumulated"],["get",p]]:m;u.push(...hi({key:`${i}.${p}.map`,value:_,expressionContext:"cluster-map"})),u.push(...hi({key:`${i}.${p}.reduce`,value:x,expressionContext:"cluster-reduce"}))}return u;case"video":return tr({key:i,value:e,valueSpec:n.source_video,style:s,styleSpec:n});case"image":return tr({key:i,value:e,valueSpec:n.source_image,style:s,styleSpec:n});case"canvas":return[new Fe(i,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Ws({key:`${i}.type`,value:e.type,valueSpec:{values:jh(n)},style:s,styleSpec:n})}}function jh(t){return t.source.reduce((e,i)=>{const n=t[i];return n.type.type==="enum"&&(e=e.concat(Object.keys(n.type.values))),e},[])}function Lc(t){const e=t.value,i=t.styleSpec,n=i.light,s=t.style;let c=[];const u=_t(e);if(e===void 0)return c;if(u!=="object")return c=c.concat([new Fe("light",e,`object expected, ${u} found`)]),c;for(const p in e){const m=p.match(/^(.*)-transition$/);c=c.concat(m&&n[m[1]]&&n[m[1]].transition?xi({key:p,value:e[p],valueSpec:i.transition,style:s,styleSpec:i}):n[p]?xi({key:p,value:e[p],valueSpec:n[p],style:s,styleSpec:i}):[new Fe(p,e[p],`unknown property "${p}"`)])}return c}function ul(t){const e=t.value,i=t.key,n=t.style,s=t.styleSpec,c=s.terrain;let u=[];const p=_t(e);if(e===void 0)return u;if(p!=="object")return u=u.concat([new Fe("terrain",e,`object expected, ${p} found`)]),u;for(const m in e){const _=m.match(/^(.*)-transition$/);u=u.concat(_&&c[_[1]]&&c[_[1]].transition?xi({key:m,value:e[m],valueSpec:s.transition,style:n,styleSpec:s}):c[m]?xi({key:m,value:e[m],valueSpec:c[m],style:n,styleSpec:s}):[new Fe(m,e[m],`unknown property "${m}"`)])}if(e.source){const m=n.sources&&n.sources[e.source],_=m&&Ht(m.type);m?_!=="raster-dem"&&u.push(new Fe(i,e.source,`terrain cannot be used with a source of type ${String(_)}, it only be used with a "raster-dem" source type`)):u.push(new Fe(i,e.source,`source "${e.source}" not found`))}else u.push(new Fe(i,e,'terrain is missing required property "source"'));return u}function Rc(t){const e=t.value,i=t.style,n=t.styleSpec,s=n.fog;let c=[];const u=_t(e);if(e===void 0)return c;if(u!=="object")return c=c.concat([new Fe("fog",e,`object expected, ${u} found`)]),c;for(const p in e){const m=p.match(/^(.*)-transition$/);c=c.concat(m&&s[m[1]]&&s[m[1]].transition?xi({key:p,value:e[p],valueSpec:n.transition,style:i,styleSpec:n}):s[p]?xi({key:p,value:e[p],valueSpec:s[p],style:i,styleSpec:n}):[new Fe(p,e[p],`unknown property "${p}"`)])}return c}const Bc={"*":()=>[],array:Ac,boolean:function(t){const e=t.value,i=t.key,n=_t(e);return n!=="boolean"?[new Fe(i,e,`boolean expected, ${n} found`)]:[]},number:Yo,color:function(t){const e=t.key,i=t.value,n=_t(i);return n!=="string"?[new Fe(e,i,`color expected, ${n} found`)]:Ca(i)===null?[new Fe(e,i,`color expected, "${i}" found`)]:[]},enum:Ws,filter:es,function:Jo,layer:Pc,object:tr,source:Dc,light:Lc,terrain:ul,fog:Rc,string:Yr,formatted:function(t){return Yr(t).length===0?[]:hi(t)},resolvedImage:function(t){return Yr(t).length===0?[]:hi(t)},projection:function(t){const e=t.value,i=t.styleSpec,n=i.projection,s=t.style;let c=[];const u=_t(e);if(u==="object")for(const p in e)c=c.concat(xi({key:p,value:e[p],valueSpec:n[p],style:s,styleSpec:i}));else u!=="string"&&(c=c.concat([new Fe("projection",e,`object or string expected, ${u} found`)]));return c}};function xi(t){const e=t.value,i=t.valueSpec,n=t.styleSpec;return i.expression&&Xo(Ht(e))?Jo(t):i.expression&&no(ci(e))?hi(t):i.type&&Bc[i.type]?Bc[i.type](t):tr(Mr({},t,{valueSpec:i.type?n[i.type]:i}))}function Gh(t){const e=t.value,i=t.key,n=Yr(t);return n.length||(e.indexOf("{fontstack}")===-1&&n.push(new Fe(i,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&n.push(new Fe(i,e,'"glyphs" url must include a "{range}" token'))),n}function Oc(t,e=fe){return $i(xi({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:Gh,"*":()=>[]}}))}const $h=t=>$i(zc(t)),Zh=t=>$i(hl(t));function $i(t){return t.slice().sort((e,i)=>e.line&&i.line?e.line-i.line:0)}function Fc(t,e){let i=!1;if(e&&e.length)for(const n of e)t.fire(new Sr(new Error(n.message))),i=!0;return i}var qh=ur,ir=3;function ur(t,e,i){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var s=new Int32Array(this.arrayBuffer);t=s[0],this.d=(e=s[1])+2*(i=s[2]);for(var c=0;c=x[S+0]&&n>=x[S+1])?(u[w]=!0,c.push(_[w])):u[w]=!1}}},ur.prototype._forEachCell=function(t,e,i,n,s,c,u,p){for(var m=this._convertToCellCoord(t),_=this._convertToCellCoord(e),x=this._convertToCellCoord(i),b=this._convertToCellCoord(n),w=m;w<=x;w++)for(var S=_;S<=b;S++){var M=this.d*S+w;if((!p||p(this._convertFromCellCoord(w),this._convertFromCellCoord(S),this._convertFromCellCoord(w+1),this._convertFromCellCoord(S+1)))&&s.call(this,t,e,i,n,M,c,u,p))return}},ur.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},ur.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},ur.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=ir+this.cells.length+1+1,i=0,n=0;n=0||(s[c]=lo(t[c],e)));t instanceof Error&&(s.message=t.message)}if(s.$name)throw new Error("$name property is reserved for worker serialization logic.");return n!=="Object"&&(s.$name=n),s}throw new Error("can't serialize object of type "+typeof t)}function Sn(t){if(t==null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||dl(t)||pl(t)||ArrayBuffer.isView(t)||t instanceof Se.ImageData)return t;if(Array.isArray(t))return t.map(Sn);if(typeof t=="object"){const e=t.$name||"Object",{klass:i}=Ys[e];if(!i)throw new Error(`can't deserialize unregistered class ${e}`);if(i.deserialize)return i.deserialize(t);const n=Object.create(i.prototype);for(const s of Object.keys(t))s!=="$name"&&(n[s]=Sn(t[s]));return n}throw new Error("can't deserialize object of type "+typeof t)}const Be={"Latin-1 Supplement":t=>t>=128&&t<=255,Arabic:t=>t>=1536&&t<=1791,"Arabic Supplement":t=>t>=1872&&t<=1919,"Arabic Extended-A":t=>t>=2208&&t<=2303,"Hangul Jamo":t=>t>=4352&&t<=4607,"Unified Canadian Aboriginal Syllabics":t=>t>=5120&&t<=5759,Khmer:t=>t>=6016&&t<=6143,"Unified Canadian Aboriginal Syllabics Extended":t=>t>=6320&&t<=6399,"General Punctuation":t=>t>=8192&&t<=8303,"Letterlike Symbols":t=>t>=8448&&t<=8527,"Number Forms":t=>t>=8528&&t<=8591,"Miscellaneous Technical":t=>t>=8960&&t<=9215,"Control Pictures":t=>t>=9216&&t<=9279,"Optical Character Recognition":t=>t>=9280&&t<=9311,"Enclosed Alphanumerics":t=>t>=9312&&t<=9471,"Geometric Shapes":t=>t>=9632&&t<=9727,"Miscellaneous Symbols":t=>t>=9728&&t<=9983,"Miscellaneous Symbols and Arrows":t=>t>=11008&&t<=11263,"CJK Radicals Supplement":t=>t>=11904&&t<=12031,"Kangxi Radicals":t=>t>=12032&&t<=12255,"Ideographic Description Characters":t=>t>=12272&&t<=12287,"CJK Symbols and Punctuation":t=>t>=12288&&t<=12351,Hiragana:t=>t>=12352&&t<=12447,Katakana:t=>t>=12448&&t<=12543,Bopomofo:t=>t>=12544&&t<=12591,"Hangul Compatibility Jamo":t=>t>=12592&&t<=12687,Kanbun:t=>t>=12688&&t<=12703,"Bopomofo Extended":t=>t>=12704&&t<=12735,"CJK Strokes":t=>t>=12736&&t<=12783,"Katakana Phonetic Extensions":t=>t>=12784&&t<=12799,"Enclosed CJK Letters and Months":t=>t>=12800&&t<=13055,"CJK Compatibility":t=>t>=13056&&t<=13311,"CJK Unified Ideographs Extension A":t=>t>=13312&&t<=19903,"Yijing Hexagram Symbols":t=>t>=19904&&t<=19967,"CJK Unified Ideographs":t=>t>=19968&&t<=40959,"Yi Syllables":t=>t>=40960&&t<=42127,"Yi Radicals":t=>t>=42128&&t<=42191,"Hangul Jamo Extended-A":t=>t>=43360&&t<=43391,"Hangul Syllables":t=>t>=44032&&t<=55215,"Hangul Jamo Extended-B":t=>t>=55216&&t<=55295,"Private Use Area":t=>t>=57344&&t<=63743,"CJK Compatibility Ideographs":t=>t>=63744&&t<=64255,"Arabic Presentation Forms-A":t=>t>=64336&&t<=65023,"Vertical Forms":t=>t>=65040&&t<=65055,"CJK Compatibility Forms":t=>t>=65072&&t<=65103,"Small Form Variants":t=>t>=65104&&t<=65135,"Arabic Presentation Forms-B":t=>t>=65136&&t<=65279,"Halfwidth and Fullwidth Forms":t=>t>=65280&&t<=65519};function fl(t){for(const e of t)if(ml(e.charCodeAt(0)))return!0;return!1}function Wh(t){for(const e of t)if(!Uc(e.charCodeAt(0)))return!1;return!0}function Uc(t){return!(Be.Arabic(t)||Be["Arabic Supplement"](t)||Be["Arabic Extended-A"](t)||Be["Arabic Presentation Forms-A"](t)||Be["Arabic Presentation Forms-B"](t))}function ml(t){return!(t!==746&&t!==747&&(t<4352||!(Be["Bopomofo Extended"](t)||Be.Bopomofo(t)||Be["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||Be["CJK Compatibility Ideographs"](t)||Be["CJK Compatibility"](t)||Be["CJK Radicals Supplement"](t)||Be["CJK Strokes"](t)||!(!Be["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||t===12336)||Be["CJK Unified Ideographs Extension A"](t)||Be["CJK Unified Ideographs"](t)||Be["Enclosed CJK Letters and Months"](t)||Be["Hangul Compatibility Jamo"](t)||Be["Hangul Jamo Extended-A"](t)||Be["Hangul Jamo Extended-B"](t)||Be["Hangul Jamo"](t)||Be["Hangul Syllables"](t)||Be.Hiragana(t)||Be["Ideographic Description Characters"](t)||Be.Kanbun(t)||Be["Kangxi Radicals"](t)||Be["Katakana Phonetic Extensions"](t)||Be.Katakana(t)&&t!==12540||!(!Be["Halfwidth and Fullwidth Forms"](t)||t===65288||t===65289||t===65293||t>=65306&&t<=65310||t===65339||t===65341||t===65343||t>=65371&&t<=65503||t===65507||t>=65512&&t<=65519)||!(!Be["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||Be["Unified Canadian Aboriginal Syllabics"](t)||Be["Unified Canadian Aboriginal Syllabics Extended"](t)||Be["Vertical Forms"](t)||Be["Yijing Hexagram Symbols"](t)||Be["Yi Syllables"](t)||Be["Yi Radicals"](t))))}function Vc(t){return!(ml(t)||function(e){return!!(Be["Latin-1 Supplement"](e)&&(e===167||e===169||e===174||e===177||e===188||e===189||e===190||e===215||e===247)||Be["General Punctuation"](e)&&(e===8214||e===8224||e===8225||e===8240||e===8241||e===8251||e===8252||e===8258||e===8263||e===8264||e===8265||e===8273)||Be["Letterlike Symbols"](e)||Be["Number Forms"](e)||Be["Miscellaneous Technical"](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||e===9003||e>=9085&&e<=9114||e>=9150&&e<=9165||e===9167||e>=9169&&e<=9179||e>=9186&&e<=9215)||Be["Control Pictures"](e)&&e!==9251||Be["Optical Character Recognition"](e)||Be["Enclosed Alphanumerics"](e)||Be["Geometric Shapes"](e)||Be["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||Be["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||Be["CJK Symbols and Punctuation"](e)||Be.Katakana(e)||Be["Private Use Area"](e)||Be["CJK Compatibility Forms"](e)||Be["Small Form Variants"](e)||Be["Halfwidth and Fullwidth Forms"](e)||e===8734||e===8756||e===8757||e>=9984&&e<=10087||e>=10102&&e<=10131||e===65532||e===65533)}(t))}function Nc(t){return t>=1424&&t<=2303||Be["Arabic Presentation Forms-A"](t)||Be["Arabic Presentation Forms-B"](t)}function Xh(t,e){return!(!e&&Nc(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||Be.Khmer(t))}function Hh(t){for(const e of t)if(Nc(e.charCodeAt(0)))return!0;return!1}const _l="deferred",gl="loading",yl="loaded";let co=null,l="unavailable",r=null;const o=function(t){t&&typeof t=="string"&&t.indexOf("NetworkError")>-1&&(l="error"),co&&co(t)};function h(){d.fire(new gn("pluginStateChange",{pluginStatus:l,pluginURL:r}))}const d=new Po,f=function(){return l},g=function(){if(l!==_l||!r)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");l=gl,h(),r&&$n({url:r},t=>{t?o(t):(l=yl,h())})},y={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>l===yl||y.applyArabicShaping!=null,isLoading:()=>l===gl,setState(t){l=t.pluginStatus,r=t.pluginURL},isParsed:()=>y.applyArabicShaping!=null&&y.processBidirectionalText!=null&&y.processStyledBidirectionalText!=null,getPluginURL:()=>r};class v{constructor(e,i){this.zoom=e,i?(this.now=i.now,this.fadeDuration=i.fadeDuration,this.transition=i.transition,this.pitch=i.pitch):(this.now=0,this.fadeDuration=0,this.transition={},this.pitch=0)}isSupportedScript(e){return function(i,n){for(const s of i)if(!Xh(s.charCodeAt(0),n))return!1;return!0}(e,y.isLoaded())}}class E{constructor(e,i){this.property=e,this.value=i,this.expression=function(n,s){if(Xo(n))return new Zs(n,s);if(no(n)){const c=Ko(n,s);if(c.result==="error")throw new Error(c.value.map(u=>`${u.key}: ${u.message}`).join(", "));return c.value}{let c=n;return typeof n=="string"&&s.type==="color"&&(c=Zt.parse(n)),{kind:"constant",evaluate:()=>c}}}(i===void 0?e.specification.default:i,e.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(e,i,n){return this.property.possiblyEvaluate(this,e,i,n)}}class T{constructor(e){this.property=e,this.value=new E(e,void 0)}transitioned(e,i){return new k(this.property,this.value,i,Wt({},e.transition,this.transition),e.now)}untransitioned(){return new k(this.property,this.value,null,{},0)}}class A{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return Li(this._values[e].value.value)}setValue(e,i){this._values.hasOwnProperty(e)||(this._values[e]=new T(this._values[e].property)),this._values[e].value=new E(this._values[e].property,i===null?void 0:Li(i))}getTransition(e){return Li(this._values[e].transition)}setTransition(e,i){this._values.hasOwnProperty(e)||(this._values[e]=new T(this._values[e].property)),this._values[e].transition=Li(i)||void 0}serialize(){const e={};for(const i of Object.keys(this._values)){const n=this.getValue(i);n!==void 0&&(e[i]=n);const s=this.getTransition(i);s!==void 0&&(e[`${i}-transition`]=s)}return e}transitioned(e,i){const n=new R(this._properties);for(const s of Object.keys(this._values))n._values[s]=this._values[s].transitioned(e,i._values[s]);return n}untransitioned(){const e=new R(this._properties);for(const i of Object.keys(this._values))e._values[i]=this._values[i].untransitioned();return e}}class k{constructor(e,i,n,s,c){const u=s.delay||0,p=s.duration||0;c=c||0,this.property=e,this.value=i,this.begin=c+u,this.end=this.begin+p,e.specification.transition&&(s.delay||s.duration)&&(this.prior=n)}possiblyEvaluate(e,i,n){const s=e.now||0,c=this.value.possiblyEvaluate(e,i,n),u=this.prior;if(u){if(s>this.end)return this.prior=null,c;if(this.value.isDataDriven())return this.prior=null,c;if(sthis.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const i=this.uint8;this._refreshViews(),i&&this.uint8.set(i)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}destroy(){this.int8=this.uint8=this.int16=this.uint16=this.int32=this.uint32=this.float32=null,this.arrayBuffer=null}}function te(t,e=1){let i=0,n=0;return{members:t.map(s=>{const c=J[s.type].BYTES_PER_ELEMENT,u=i=le(i,Math.max(e,c)),p=s.components||1;return n=Math.max(n,c),i+=c*p,{name:s.name,type:s.type,components:p,offset:u}}),size:le(i,Math.max(n,e)),alignment:e}}function le(t,e){return Math.ceil(t/e)*e}class Te extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,i)}emplace(e,i,n){const s=2*e;return this.int16[s+0]=i,this.int16[s+1]=n,e}}Te.prototype.bytesPerElement=4,Ue(Te,"StructArrayLayout2i4");class oe extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,n){const s=this.length;return this.resize(s+1),this.emplace(s,e,i,n)}emplace(e,i,n,s){const c=3*e;return this.int16[c+0]=i,this.int16[c+1]=n,this.int16[c+2]=s,e}}oe.prototype.bytesPerElement=6,Ue(oe,"StructArrayLayout3i6");class ge extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,n,s){const c=this.length;return this.resize(c+1),this.emplace(c,e,i,n,s)}emplace(e,i,n,s,c){const u=4*e;return this.int16[u+0]=i,this.int16[u+1]=n,this.int16[u+2]=s,this.int16[u+3]=c,e}}ge.prototype.bytesPerElement=8,Ue(ge,"StructArrayLayout4i8");class he extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c,u,p){const m=this.length;return this.resize(m+1),this.emplace(m,e,i,n,s,c,u,p)}emplace(e,i,n,s,c,u,p,m){const _=6*e,x=12*e,b=3*e;return this.int16[_+0]=i,this.int16[_+1]=n,this.uint8[x+4]=s,this.uint8[x+5]=c,this.uint8[x+6]=u,this.uint8[x+7]=p,this.float32[b+2]=m,e}}he.prototype.bytesPerElement=12,Ue(he,"StructArrayLayout2i4ub1f12");class we extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,n,s){const c=this.length;return this.resize(c+1),this.emplace(c,e,i,n,s)}emplace(e,i,n,s,c){const u=4*e;return this.float32[u+0]=i,this.float32[u+1]=n,this.float32[u+2]=s,this.float32[u+3]=c,e}}we.prototype.bytesPerElement=16,Ue(we,"StructArrayLayout4f16");class ae extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c){const u=this.length;return this.resize(u+1),this.emplace(u,e,i,n,s,c)}emplace(e,i,n,s,c,u){const p=6*e,m=3*e;return this.uint16[p+0]=i,this.uint16[p+1]=n,this.uint16[p+2]=s,this.uint16[p+3]=c,this.float32[m+2]=u,e}}ae.prototype.bytesPerElement=12,Ue(ae,"StructArrayLayout4ui1f12");class _e extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,n,s){const c=this.length;return this.resize(c+1),this.emplace(c,e,i,n,s)}emplace(e,i,n,s,c){const u=4*e;return this.uint16[u+0]=i,this.uint16[u+1]=n,this.uint16[u+2]=s,this.uint16[u+3]=c,e}}_e.prototype.bytesPerElement=8,Ue(_e,"StructArrayLayout4ui8");class Me extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c,u){const p=this.length;return this.resize(p+1),this.emplace(p,e,i,n,s,c,u)}emplace(e,i,n,s,c,u,p){const m=6*e;return this.int16[m+0]=i,this.int16[m+1]=n,this.int16[m+2]=s,this.int16[m+3]=c,this.int16[m+4]=u,this.int16[m+5]=p,e}}Me.prototype.bytesPerElement=12,Ue(Me,"StructArrayLayout6i12");class ve extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c,u,p,m,_,x,b,w){const S=this.length;return this.resize(S+1),this.emplace(S,e,i,n,s,c,u,p,m,_,x,b,w)}emplace(e,i,n,s,c,u,p,m,_,x,b,w,S){const M=12*e;return this.int16[M+0]=i,this.int16[M+1]=n,this.int16[M+2]=s,this.int16[M+3]=c,this.uint16[M+4]=u,this.uint16[M+5]=p,this.uint16[M+6]=m,this.uint16[M+7]=_,this.int16[M+8]=x,this.int16[M+9]=b,this.int16[M+10]=w,this.int16[M+11]=S,e}}ve.prototype.bytesPerElement=24,Ue(ve,"StructArrayLayout4i4ui4i24");class Ae extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c,u){const p=this.length;return this.resize(p+1),this.emplace(p,e,i,n,s,c,u)}emplace(e,i,n,s,c,u,p){const m=10*e,_=5*e;return this.int16[m+0]=i,this.int16[m+1]=n,this.int16[m+2]=s,this.float32[_+2]=c,this.float32[_+3]=u,this.float32[_+4]=p,e}}Ae.prototype.bytesPerElement=20,Ue(Ae,"StructArrayLayout3i3f20");class Ge extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.uint32[1*e+0]=i,e}}Ge.prototype.bytesPerElement=4,Ue(Ge,"StructArrayLayout1ul4");class Xe extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c,u,p,m,_,x,b,w,S){const M=this.length;return this.resize(M+1),this.emplace(M,e,i,n,s,c,u,p,m,_,x,b,w,S)}emplace(e,i,n,s,c,u,p,m,_,x,b,w,S,M){const C=20*e,D=10*e;return this.int16[C+0]=i,this.int16[C+1]=n,this.int16[C+2]=s,this.int16[C+3]=c,this.int16[C+4]=u,this.float32[D+3]=p,this.float32[D+4]=m,this.float32[D+5]=_,this.float32[D+6]=x,this.int16[C+14]=b,this.uint32[D+8]=w,this.uint16[C+18]=S,this.uint16[C+19]=M,e}}Xe.prototype.bytesPerElement=40,Ue(Xe,"StructArrayLayout5i4f1i1ul2ui40");class Ve extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c,u,p){const m=this.length;return this.resize(m+1),this.emplace(m,e,i,n,s,c,u,p)}emplace(e,i,n,s,c,u,p,m){const _=8*e;return this.int16[_+0]=i,this.int16[_+1]=n,this.int16[_+2]=s,this.int16[_+4]=c,this.int16[_+5]=u,this.int16[_+6]=p,this.int16[_+7]=m,e}}Ve.prototype.bytesPerElement=16,Ue(Ve,"StructArrayLayout3i2i2i16");class qe extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c){const u=this.length;return this.resize(u+1),this.emplace(u,e,i,n,s,c)}emplace(e,i,n,s,c,u){const p=4*e,m=8*e;return this.float32[p+0]=i,this.float32[p+1]=n,this.float32[p+2]=s,this.int16[m+6]=c,this.int16[m+7]=u,e}}qe.prototype.bytesPerElement=16,Ue(qe,"StructArrayLayout2f1f2i16");class lt extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,n,s){const c=this.length;return this.resize(c+1),this.emplace(c,e,i,n,s)}emplace(e,i,n,s,c){const u=12*e,p=3*e;return this.uint8[u+0]=i,this.uint8[u+1]=n,this.float32[p+1]=s,this.float32[p+2]=c,e}}lt.prototype.bytesPerElement=12,Ue(lt,"StructArrayLayout2ub2f12");class ot extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,n){const s=this.length;return this.resize(s+1),this.emplace(s,e,i,n)}emplace(e,i,n,s){const c=3*e;return this.float32[c+0]=i,this.float32[c+1]=n,this.float32[c+2]=s,e}}ot.prototype.bytesPerElement=12,Ue(ot,"StructArrayLayout3f12");class je extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,n){const s=this.length;return this.resize(s+1),this.emplace(s,e,i,n)}emplace(e,i,n,s){const c=3*e;return this.uint16[c+0]=i,this.uint16[c+1]=n,this.uint16[c+2]=s,e}}je.prototype.bytesPerElement=6,Ue(je,"StructArrayLayout3ui6");class wt extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c,u,p,m,_,x,b,w,S,M,C,D,U,q,V,$,X){const W=this.length;return this.resize(W+1),this.emplace(W,e,i,n,s,c,u,p,m,_,x,b,w,S,M,C,D,U,q,V,$,X)}emplace(e,i,n,s,c,u,p,m,_,x,b,w,S,M,C,D,U,q,V,$,X,W){const ce=30*e,se=15*e,me=60*e;return this.int16[ce+0]=i,this.int16[ce+1]=n,this.int16[ce+2]=s,this.float32[se+2]=c,this.float32[se+3]=u,this.uint16[ce+8]=p,this.uint16[ce+9]=m,this.uint32[se+5]=_,this.uint32[se+6]=x,this.uint32[se+7]=b,this.uint16[ce+16]=w,this.uint16[ce+17]=S,this.uint16[ce+18]=M,this.float32[se+10]=C,this.float32[se+11]=D,this.uint8[me+48]=U,this.uint8[me+49]=q,this.uint8[me+50]=V,this.uint32[se+13]=$,this.int16[ce+28]=X,this.uint8[me+58]=W,e}}wt.prototype.bytesPerElement=60,Ue(wt,"StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60");class Tt extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c,u,p,m,_,x,b,w,S,M,C,D,U,q,V,$,X,W,ce,se,me,Ee,ue,ye,xe,be){const Ce=this.length;return this.resize(Ce+1),this.emplace(Ce,e,i,n,s,c,u,p,m,_,x,b,w,S,M,C,D,U,q,V,$,X,W,ce,se,me,Ee,ue,ye,xe,be)}emplace(e,i,n,s,c,u,p,m,_,x,b,w,S,M,C,D,U,q,V,$,X,W,ce,se,me,Ee,ue,ye,xe,be,Ce){const pe=38*e,De=19*e;return this.int16[pe+0]=i,this.int16[pe+1]=n,this.int16[pe+2]=s,this.float32[De+2]=c,this.float32[De+3]=u,this.int16[pe+8]=p,this.int16[pe+9]=m,this.int16[pe+10]=_,this.int16[pe+11]=x,this.int16[pe+12]=b,this.int16[pe+13]=w,this.uint16[pe+14]=S,this.uint16[pe+15]=M,this.uint16[pe+16]=C,this.uint16[pe+17]=D,this.uint16[pe+18]=U,this.uint16[pe+19]=q,this.uint16[pe+20]=V,this.uint16[pe+21]=$,this.uint16[pe+22]=X,this.uint16[pe+23]=W,this.uint16[pe+24]=ce,this.uint16[pe+25]=se,this.uint16[pe+26]=me,this.uint16[pe+27]=Ee,this.uint16[pe+28]=ue,this.uint32[De+15]=ye,this.float32[De+16]=xe,this.float32[De+17]=be,this.float32[De+18]=Ce,e}}Tt.prototype.bytesPerElement=76,Ue(Tt,"StructArrayLayout3i2f6i15ui1ul3f76");class Et extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.float32[1*e+0]=i,e}}Et.prototype.bytesPerElement=4,Ue(Et,"StructArrayLayout1f4");class St extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c){const u=this.length;return this.resize(u+1),this.emplace(u,e,i,n,s,c)}emplace(e,i,n,s,c,u){const p=5*e;return this.float32[p+0]=i,this.float32[p+1]=n,this.float32[p+2]=s,this.float32[p+3]=c,this.float32[p+4]=u,e}}St.prototype.bytesPerElement=20,Ue(St,"StructArrayLayout5f20");class vi extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,n,s){const c=this.length;return this.resize(c+1),this.emplace(c,e,i,n,s)}emplace(e,i,n,s,c){const u=6*e;return this.uint32[3*e+0]=i,this.uint16[u+2]=n,this.uint16[u+3]=s,this.uint16[u+4]=c,e}}vi.prototype.bytesPerElement=12,Ue(vi,"StructArrayLayout1ul3ui12");class ui extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,i)}emplace(e,i,n){const s=2*e;return this.uint16[s+0]=i,this.uint16[s+1]=n,e}}ui.prototype.bytesPerElement=4,Ue(ui,"StructArrayLayout2ui4");class Zi extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.uint16[1*e+0]=i,e}}Zi.prototype.bytesPerElement=2,Ue(Zi,"StructArrayLayout1ui2");class dr extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,i)}emplace(e,i,n){const s=2*e;return this.float32[s+0]=i,this.float32[s+1]=n,e}}dr.prototype.bytesPerElement=8,Ue(dr,"StructArrayLayout2f8");class Ft extends Y{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.int16[this._pos2+3]}get tileAnchorY(){return this._structArray.int16[this._pos2+4]}get x1(){return this._structArray.float32[this._pos4+3]}get y1(){return this._structArray.float32[this._pos4+4]}get x2(){return this._structArray.float32[this._pos4+5]}get y2(){return this._structArray.float32[this._pos4+6]}get padding(){return this._structArray.int16[this._pos2+14]}get featureIndex(){return this._structArray.uint32[this._pos4+8]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+18]}get bucketIndex(){return this._structArray.uint16[this._pos2+19]}}Ft.prototype.size=40;class Mt extends Xe{get(e){return new Ft(this,e)}}Ue(Mt,"CollisionBoxArray");class yt extends Y{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+8]}get numGlyphs(){return this._structArray.uint16[this._pos2+9]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+5]}get lineStartIndex(){return this._structArray.uint32[this._pos4+6]}get lineLength(){return this._structArray.uint32[this._pos4+7]}get segment(){return this._structArray.uint16[this._pos2+16]}get lowerSize(){return this._structArray.uint16[this._pos2+17]}get upperSize(){return this._structArray.uint16[this._pos2+18]}get lineOffsetX(){return this._structArray.float32[this._pos4+10]}get lineOffsetY(){return this._structArray.float32[this._pos4+11]}get writingMode(){return this._structArray.uint8[this._pos1+48]}get placedOrientation(){return this._structArray.uint8[this._pos1+49]}set placedOrientation(e){this._structArray.uint8[this._pos1+49]=e}get hidden(){return this._structArray.uint8[this._pos1+50]}set hidden(e){this._structArray.uint8[this._pos1+50]=e}get crossTileID(){return this._structArray.uint32[this._pos4+13]}set crossTileID(e){this._structArray.uint32[this._pos4+13]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+28]}get flipState(){return this._structArray.uint8[this._pos1+58]}set flipState(e){this._structArray.uint8[this._pos1+58]=e}}yt.prototype.size=60;class Kt extends wt{get(e){return new yt(this,e)}}Ue(Kt,"PlacedSymbolArray");class Ei extends Y{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+8]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+9]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+10]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+11]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+12]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+13]}get key(){return this._structArray.uint16[this._pos2+14]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+17]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+18]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+19]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+20]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+21]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+22]}get featureIndex(){return this._structArray.uint16[this._pos2+23]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+24]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+25]}get numIconVertices(){return this._structArray.uint16[this._pos2+26]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+27]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+28]}get crossTileID(){return this._structArray.uint32[this._pos4+15]}set crossTileID(e){this._structArray.uint32[this._pos4+15]=e}get textOffset0(){return this._structArray.float32[this._pos4+16]}get textOffset1(){return this._structArray.float32[this._pos4+17]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+18]}}Ei.prototype.size=76;class Bt extends Tt{get(e){return new Ei(this,e)}}Ue(Bt,"SymbolInstanceArray");class Ii extends Et{getoffsetX(e){return this.float32[1*e+0]}}Ue(Ii,"GlyphOffsetArray");class Js extends Te{getx(e){return this.int16[2*e+0]}gety(e){return this.int16[2*e+1]}}Ue(Js,"SymbolLineVertexArray");class Mn extends Y{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]}get layoutVertexArrayOffset(){return this._structArray.uint16[this._pos2+4]}}Mn.prototype.size=12;class is extends vi{get(e){return new Mn(this,e)}}Ue(is,"FeatureIndexArray");class Lr extends ui{geta_centroid_pos0(e){return this.uint16[2*e+0]}geta_centroid_pos1(e){return this.uint16[2*e+1]}}Ue(Lr,"FillExtrusionCentroidArray");const Jr=te([{name:"a_pattern",components:4,type:"Uint16"},{name:"a_pixel_ratio",components:1,type:"Float32"}]),An=te([{name:"a_dash",components:4,type:"Uint16"}]);var Qs={exports:{}},rs={exports:{}};rs.exports=function(t,e){var i,n,s,c,u,p,m,_;for(n=t.length-(i=3&t.length),s=e,u=3432918353,p=461845907,_=0;_>>16)*u&65535)<<16)&4294967295)<<15|m>>>17))*p+(((m>>>16)*p&65535)<<16)&4294967295)<<13|s>>>19))+((5*(s>>>16)&65535)<<16)&4294967295))+((58964+(c>>>16)&65535)<<16);switch(m=0,i){case 3:m^=(255&t.charCodeAt(_+2))<<16;case 2:m^=(255&t.charCodeAt(_+1))<<8;case 1:s^=m=(65535&(m=(m=(65535&(m^=255&t.charCodeAt(_)))*u+(((m>>>16)*u&65535)<<16)&4294967295)<<15|m>>>17))*p+(((m>>>16)*p&65535)<<16)&4294967295}return s^=t.length,s=2246822507*(65535&(s^=s>>>16))+((2246822507*(s>>>16)&65535)<<16)&4294967295,s=3266489909*(65535&(s^=s>>>13))+((3266489909*(s>>>16)&65535)<<16)&4294967295,(s^=s>>>16)>>>0};var xl=rs.exports,sd={exports:{}};sd.exports=function(t,e){for(var i,n=t.length,s=e^n,c=0;n>=4;)i=1540483477*(65535&(i=255&t.charCodeAt(c)|(255&t.charCodeAt(++c))<<8|(255&t.charCodeAt(++c))<<16|(255&t.charCodeAt(++c))<<24))+((1540483477*(i>>>16)&65535)<<16),s=1540483477*(65535&s)+((1540483477*(s>>>16)&65535)<<16)^(i=1540483477*(65535&(i^=i>>>24))+((1540483477*(i>>>16)&65535)<<16)),n-=4,++c;switch(n){case 3:s^=(255&t.charCodeAt(c+2))<<16;case 2:s^=(255&t.charCodeAt(c+1))<<8;case 1:s=1540483477*(65535&(s^=255&t.charCodeAt(c)))+((1540483477*(s>>>16)&65535)<<16)}return s=1540483477*(65535&(s^=s>>>13))+((1540483477*(s>>>16)&65535)<<16),(s^=s>>>15)>>>0};var ad=xl,Nf=sd.exports;Qs.exports=ad,Qs.exports.murmur3=ad,Qs.exports.murmur2=Nf;var Kh=Yi(Qs.exports);class jc{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,i,n,s){this.ids.push(ld(e)),this.positions.push(i,n,s)}getPositions(e){const i=ld(e);let n=0,s=this.ids.length-1;for(;n>1;this.ids[u]>=i?s=u:n=u+1}const c=[];for(;this.ids[n]===i;)c.push({index:this.positions[3*n],start:this.positions[3*n+1],end:this.positions[3*n+2]}),n++;return c}static serialize(e,i){const n=new Float64Array(e.ids),s=new Uint32Array(e.positions);return Yh(n,s,0,n.length-1),i&&i.push(n.buffer,s.buffer),{ids:n,positions:s}}static deserialize(e){const i=new jc;return i.ids=e.ids,i.positions=e.positions,i.indexed=!0,i}}function ld(t){const e=+t;return!isNaN(e)&&Number.MIN_SAFE_INTEGER<=e&&e<=Number.MAX_SAFE_INTEGER?e:Kh(String(t))}function Yh(t,e,i,n){for(;i>1];let c=i-1,u=n+1;for(;;){do c++;while(t[c]s);if(c>=u)break;Gc(t,c,u),Gc(e,3*c,3*u),Gc(e,3*c+1,3*u+1),Gc(e,3*c+2,3*u+2)}u-i`u_${s}`),this.type=n}setUniform(e,i,n,s,c){i.set(e,c,s.constantOr(this.value))}getBinding(e,i){return this.type==="color"?new hd(e):new $c(e)}}class ea{constructor(e,i){this.uniformNames=i.map(n=>`u_${n}`),this.pattern=null,this.pixelRatio=1}setConstantPatternPositions(e){this.pixelRatio=e.pixelRatio||1,this.pattern=e.tl.concat(e.br)}setUniform(e,i,n,s,c){const u=c==="u_pattern"||c==="u_dash"?this.pattern:c==="u_pixel_ratio"?this.pixelRatio:null;u&&i.set(e,c,u)}getBinding(e,i){return i==="u_pattern"||i==="u_dash"?new cd(e):new $c(e)}}class Cn{constructor(e,i,n,s){this.expression=e,this.type=n,this.maxValue=0,this.paintVertexAttributes=i.map(c=>({name:`a_${c}`,type:"Float32",components:n==="color"?2:1,offset:0})),this.paintVertexArray=new s}populatePaintArray(e,i,n,s,c,u){const p=this.paintVertexArray.length,m=this.expression.evaluate(new v(0),i,{},c,s,u);this.paintVertexArray.resize(e),this._setPaintValue(p,e,m)}updatePaintArray(e,i,n,s,c){const u=this.expression.evaluate({zoom:0},n,s,void 0,c);this._setPaintValue(e,i,u)}_setPaintValue(e,i,n){if(this.type==="color"){const s=Jh(n);for(let c=e;c`u_${p}_t`),this.type=n,this.useIntegerZoom=s,this.zoom=c,this.maxValue=0,this.paintVertexAttributes=i.map(p=>({name:`a_${p}`,type:"Float32",components:n==="color"?4:2,offset:0})),this.paintVertexArray=new u}populatePaintArray(e,i,n,s,c,u){const p=this.expression.evaluate(new v(this.zoom),i,{},c,s,u),m=this.expression.evaluate(new v(this.zoom+1),i,{},c,s,u),_=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(_,e,p,m)}updatePaintArray(e,i,n,s,c){const u=this.expression.evaluate({zoom:this.zoom},n,s,void 0,c),p=this.expression.evaluate({zoom:this.zoom+1},n,s,void 0,c);this._setPaintValue(e,i,u,p)}_setPaintValue(e,i,n,s){if(this.type==="color"){const c=Jh(n),u=Jh(s);for(let p=e;p!0){this.binders={},this._buffers=[];const s=[];for(const c in e.paint._values){if(!n(c))continue;const u=e.paint.get(c);if(!(u instanceof B&&io(u.property.specification)))continue;const p=qf(c,e.type),m=u.value,_=u.property.specification.type,x=!!u.property.useIntegerZoom,b=c==="line-dasharray"||c.endsWith("pattern"),w=c==="line-dasharray"&&e.layout.get("line-cap").value.kind!=="constant";if(m.kind!=="constant"||w)if(m.kind==="source"||w||b){const S=ud(c,_,"source");this.binders[c]=b?new ho(m,p,_,S,e.id):new Cn(m,p,_,S),s.push(`/a_${c}`)}else{const S=ud(c,_,"composite");this.binders[c]=new Rr(m,p,_,x,i,S),s.push(`/z_${c}`)}else this.binders[c]=b?new ea(m.value,p):new vl(m.value,p,_),s.push(`/u_${c}`)}this.cacheKey=s.sort().join("")}getMaxValue(e){const i=this.binders[e];return i instanceof Cn||i instanceof Rr?i.maxValue:0}populatePaintArrays(e,i,n,s,c,u){for(const p in this.binders){const m=this.binders[p];(m instanceof Cn||m instanceof Rr||m instanceof ho)&&m.populatePaintArray(e,i,n,s,c,u)}}setConstantPatternPositions(e){for(const i in this.binders){const n=this.binders[i];n instanceof ea&&n.setConstantPatternPositions(e)}}updatePaintArrays(e,i,n,s,c,u){let p=!1;for(const m in e){const _=i.getPositions(m);for(const x of _){const b=n.feature(x.index);for(const w in this.binders){const S=this.binders[w];if((S instanceof Cn||S instanceof Rr||S instanceof ho)&&S.expression.isStateDependent===!0){const M=s.paint.get(w);S.expression=M.value,S.updatePaintArray(x.start,x.end,b,e[m],c,u),p=!0}}}}return p}defines(){const e=[];for(const i in this.binders){const n=this.binders[i];(n instanceof vl||n instanceof ea)&&e.push(...n.uniformNames.map(s=>`#define HAS_UNIFORM_${s}`))}return e}getBinderAttributes(){const e=[];for(const i in this.binders){const n=this.binders[i];if(n instanceof Cn||n instanceof Rr||n instanceof ho)for(let s=0;s!0){this.programConfigurations={};for(const s of e)this.programConfigurations[s.id]=new uo(s,i,n);this.needsUpload=!1,this._featureMap=new jc,this._bufferOffset=0}populatePaintArrays(e,i,n,s,c,u,p){for(const m in this.programConfigurations)this.programConfigurations[m].populatePaintArrays(e,i,s,c,u,p);i.id!==void 0&&this._featureMap.add(i.id,n,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,i,n,s,c){for(const u of n)this.needsUpload=this.programConfigurations[u.id].updatePaintArrays(e,this._featureMap,i,u,s,c)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const i in this.programConfigurations)this.programConfigurations[i].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}const Zf={"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","pixel_ratio"],"fill-pattern":["pattern","pixel_ratio"],"fill-extrusion-pattern":["pattern","pixel_ratio"],"line-dasharray":["dash"]};function qf(t,e){return Zf[t]||[t.replace(`${e}-`,"").replace(/-/g,"_")]}const Wf={"line-pattern":{source:ae,composite:ae},"fill-pattern":{source:ae,composite:ae},"fill-extrusion-pattern":{source:ae,composite:ae},"line-dasharray":{source:_e,composite:_e}},Xf={color:{source:dr,composite:we},number:{source:Et,composite:dr}};function ud(t,e,i){const n=Wf[t];return n&&n[i]||Xf[e][i]}Ue(vl,"ConstantBinder"),Ue(ea,"PatternConstantBinder"),Ue(Cn,"SourceExpressionBinder"),Ue(ho,"PatternCompositeBinder"),Ue(Rr,"CompositeExpressionBinder"),Ue(uo,"ProgramConfiguration",{omit:["_buffers"]}),Ue(ns,"ProgramConfigurationSet");const dd="-transition";class Br extends Po{constructor(e,i){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:()=>!0,needGeometry:!1,needFeature:!1},this._filterCompiled=!1,e.type!=="custom"&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type!=="background"&&e.type!=="sky"&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),i.layout&&(this._unevaluatedLayout=new O(i.layout)),i.paint)){this._transitionablePaint=new A(i.paint);for(const n in e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(const n in e.layout)this.setLayoutProperty(n,e.layout[n],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new F(i.paint)}}getLayoutProperty(e){return e==="visibility"?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,i,n={}){i!=null&&this._validate(Zh,`layers.${this.id}.layout.${e}`,e,i,n)||(e!=="visibility"?this._unevaluatedLayout.setValue(e,i):this.visibility=i)}getPaintProperty(e){return Un(e,dd)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,i,n={}){if(i!=null&&this._validate($h,`layers.${this.id}.paint.${e}`,e,i,n))return!1;if(Un(e,dd))return this._transitionablePaint.setTransition(e.slice(0,-11),i||void 0),!1;{const s=this._transitionablePaint._values[e],c=s.value.isDataDriven(),u=s.value;this._transitionablePaint.setValue(e,i),this._handleSpecialPaintPropertyUpdate(e);const p=this._transitionablePaint._values[e].value,m=p.isDataDriven(),_=Un(e,"pattern")||e==="line-dasharray";return m||c||_||this._handleOverridablePaintPropertyUpdate(e,u,p)}}_handleSpecialPaintPropertyUpdate(e){}getProgramIds(){return null}getProgramConfiguration(e){return null}_handleOverridablePaintPropertyUpdate(e,i,n){return!1}isHidden(e){return!!(this.minzoom&&e=this.maxzoom)||this.visibility==="none"}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,i){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,i)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,i)}serialize(){const e={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&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),Vn(e,(i,n)=>!(i===void 0||n==="layout"&&!Object.keys(i).length||n==="paint"&&!Object.keys(i).length))}_validate(e,i,n,s,c={}){return(!c||c.validate!==!1)&&Fc(this,e.call(Oc,{key:i,layerType:this.type,objectKey:n,value:s,styleSpec:fe,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isSky(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const e in this.paint._values){const i=this.paint.get(e);if(i instanceof B&&io(i.property.specification)&&(i.value.kind==="source"||i.value.kind==="composite")&&i.value.isStateDependent)return!0}return!1}compileFilter(){this._filterCompiled||(this._featureFilter=Xs(this.filter),this._filterCompiled=!0)}invalidateCompiledFilter(){this._filterCompiled=!1}dynamicFilter(){return this._featureFilter.dynamicFilter}dynamicFilterNeedsFeature(){return this._featureFilter.needFeature}}const Hf=te([{name:"a_pos",components:2,type:"Int16"}],4),Kf=te([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]);class Yt{constructor(e=[]){this.segments=e}prepareSegment(e,i,n,s){let c=this.segments[this.segments.length-1];return e>Yt.MAX_VERTEX_ARRAY_LENGTH&&Ut(`Max vertices per segment is ${Yt.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!c||c.vertexLength+e>Yt.MAX_VERTEX_ARRAY_LENGTH||c.sortKey!==s)&&(c={vertexOffset:i.length,primitiveOffset:n.length,vertexLength:0,primitiveLength:0},s!==void 0&&(c.sortKey=s),this.segments.push(c)),c}get(){return this.segments}destroy(){for(const e of this.segments)for(const i in e.vaos)e.vaos[i].destroy()}static simpleSegment(e,i,n,s){return new Yt([{vertexOffset:e,primitiveOffset:i,vertexLength:n,primitiveLength:s,vaos:{},sortKey:0}])}}Yt.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Ue(Yt,"SegmentVector");var Ze=8192;class po{constructor(e,i){e&&(i?this.setSouthWest(e).setNorthEast(i):e.length===4?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))}setNorthEast(e){return this._ne=e instanceof At?new At(e.lng,e.lat):At.convert(e),this}setSouthWest(e){return this._sw=e instanceof At?new At(e.lng,e.lat):At.convert(e),this}extend(e){const i=this._sw,n=this._ne;let s,c;if(e instanceof At)s=e,c=e;else{if(!(e instanceof po))return Array.isArray(e)?e.length===4||e.every(Array.isArray)?this.extend(po.convert(e)):this.extend(At.convert(e)):typeof e=="object"&&e!==null&&e.hasOwnProperty("lat")&&(e.hasOwnProperty("lon")||e.hasOwnProperty("lng"))?this.extend(At.convert(e)):this;if(s=e._sw,c=e._ne,!s||!c)return this}return i||n?(i.lng=Math.min(s.lng,i.lng),i.lat=Math.min(s.lat,i.lat),n.lng=Math.max(c.lng,n.lng),n.lat=Math.max(c.lat,n.lat)):(this._sw=new At(s.lng,s.lat),this._ne=new At(c.lng,c.lat)),this}getCenter(){return new At((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 At(this.getWest(),this.getNorth())}getSouthEast(){return new At(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(e){const{lng:i,lat:n}=At.convert(e);let s=this._sw.lng<=i&&i<=this._ne.lng;return this._sw.lng>this._ne.lng&&(s=this._sw.lng>=i&&i>=this._ne.lng),this._sw.lat<=n&&n<=this._ne.lat&&s}static convert(e){return!e||e instanceof po?e:new po(e)}}var Zc=1e-6,qi=typeof Float32Array<"u"?Float32Array:Array;function pd(){var t=new qi(9);return qi!=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}function fd(t,e,i){var n=e[0],s=e[1],c=e[2],u=e[3],p=e[4],m=e[5],_=e[6],x=e[7],b=e[8],w=i[0],S=i[1],M=i[2],C=i[3],D=i[4],U=i[5],q=i[6],V=i[7],$=i[8];return t[0]=w*n+S*u+M*_,t[1]=w*s+S*p+M*x,t[2]=w*c+S*m+M*b,t[3]=C*n+D*u+U*_,t[4]=C*s+D*p+U*x,t[5]=C*c+D*m+U*b,t[6]=q*n+V*u+$*_,t[7]=q*s+V*p+$*x,t[8]=q*c+V*m+$*b,t}function Or(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 Qh(t,e){var i=e[0],n=e[1],s=e[2],c=e[3],u=e[4],p=e[5],m=e[6],_=e[7],x=e[8],b=e[9],w=e[10],S=e[11],M=e[12],C=e[13],D=e[14],U=e[15],q=i*p-n*u,V=i*m-s*u,$=i*_-c*u,X=n*m-s*p,W=n*_-c*p,ce=s*_-c*m,se=x*C-b*M,me=x*D-w*M,Ee=x*U-S*M,ue=b*D-w*C,ye=b*U-S*C,xe=w*U-S*D,be=q*xe-V*ye+$*ue+X*Ee-W*me+ce*se;return be?(t[0]=(p*xe-m*ye+_*ue)*(be=1/be),t[1]=(s*ye-n*xe-c*ue)*be,t[2]=(C*ce-D*W+U*X)*be,t[3]=(w*W-b*ce-S*X)*be,t[4]=(m*Ee-u*xe-_*me)*be,t[5]=(i*xe-s*Ee+c*me)*be,t[6]=(D*$-M*ce-U*V)*be,t[7]=(x*ce-w*$+S*V)*be,t[8]=(u*ye-p*Ee+_*se)*be,t[9]=(n*Ee-i*ye-c*se)*be,t[10]=(M*W-C*$+U*q)*be,t[11]=(b*$-x*W-S*q)*be,t[12]=(p*me-u*ue-m*se)*be,t[13]=(i*ue-n*me+s*se)*be,t[14]=(C*V-M*X-D*q)*be,t[15]=(x*X-b*V+w*q)*be,t):null}function os(t,e,i){var n=e[0],s=e[1],c=e[2],u=e[3],p=e[4],m=e[5],_=e[6],x=e[7],b=e[8],w=e[9],S=e[10],M=e[11],C=e[12],D=e[13],U=e[14],q=e[15],V=i[0],$=i[1],X=i[2],W=i[3];return t[0]=V*n+$*p+X*b+W*C,t[1]=V*s+$*m+X*w+W*D,t[2]=V*c+$*_+X*S+W*U,t[3]=V*u+$*x+X*M+W*q,t[4]=(V=i[4])*n+($=i[5])*p+(X=i[6])*b+(W=i[7])*C,t[5]=V*s+$*m+X*w+W*D,t[6]=V*c+$*_+X*S+W*U,t[7]=V*u+$*x+X*M+W*q,t[8]=(V=i[8])*n+($=i[9])*p+(X=i[10])*b+(W=i[11])*C,t[9]=V*s+$*m+X*w+W*D,t[10]=V*c+$*_+X*S+W*U,t[11]=V*u+$*x+X*M+W*q,t[12]=(V=i[12])*n+($=i[13])*p+(X=i[14])*b+(W=i[15])*C,t[13]=V*s+$*m+X*w+W*D,t[14]=V*c+$*_+X*S+W*U,t[15]=V*u+$*x+X*M+W*q,t}function bl(t,e,i){var n,s,c,u,p,m,_,x,b,w,S,M,C=i[0],D=i[1],U=i[2];return e===t?(t[12]=e[0]*C+e[4]*D+e[8]*U+e[12],t[13]=e[1]*C+e[5]*D+e[9]*U+e[13],t[14]=e[2]*C+e[6]*D+e[10]*U+e[14],t[15]=e[3]*C+e[7]*D+e[11]*U+e[15]):(s=e[1],c=e[2],u=e[3],p=e[4],m=e[5],_=e[6],x=e[7],b=e[8],w=e[9],S=e[10],M=e[11],t[0]=n=e[0],t[1]=s,t[2]=c,t[3]=u,t[4]=p,t[5]=m,t[6]=_,t[7]=x,t[8]=b,t[9]=w,t[10]=S,t[11]=M,t[12]=n*C+p*D+b*U+e[12],t[13]=s*C+m*D+w*U+e[13],t[14]=c*C+_*D+S*U+e[14],t[15]=u*C+x*D+M*U+e[15]),t}function ss(t,e,i){var n=i[0],s=i[1],c=i[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*s,t[5]=e[5]*s,t[6]=e[6]*s,t[7]=e[7]*s,t[8]=e[8]*c,t[9]=e[9]*c,t[10]=e[10]*c,t[11]=e[11]*c,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function eu(t,e,i){var n=Math.sin(i),s=Math.cos(i),c=e[4],u=e[5],p=e[6],m=e[7],_=e[8],x=e[9],b=e[10],w=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]=c*s+_*n,t[5]=u*s+x*n,t[6]=p*s+b*n,t[7]=m*s+w*n,t[8]=_*s-c*n,t[9]=x*s-u*n,t[10]=b*s-p*n,t[11]=w*s-m*n,t}function qc(t,e,i){var n=Math.sin(i),s=Math.cos(i),c=e[0],u=e[1],p=e[2],m=e[3],_=e[8],x=e[9],b=e[10],w=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=c*s-_*n,t[1]=u*s-x*n,t[2]=p*s-b*n,t[3]=m*s-w*n,t[8]=c*n+_*s,t[9]=u*n+x*s,t[10]=p*n+b*s,t[11]=m*n+w*s,t}function md(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}function _d(t,e,i){var n,s,c,u=i[0],p=i[1],m=i[2],_=Math.hypot(u,p,m);return _0&&(c=1/Math.sqrt(c)),t[0]=e[0]*c,t[1]=e[1]*c,t[2]=e[2]*c,t}function pr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ru(t,e,i){var n=e[0],s=e[1],c=e[2],u=i[0],p=i[1],m=i[2];return t[0]=s*m-c*p,t[1]=c*u-n*m,t[2]=n*p-s*u,t}function qt(t,e,i){var n=e[0],s=e[1],c=e[2],u=i[3]*n+i[7]*s+i[11]*c+i[15];return t[0]=(i[0]*n+i[4]*s+i[8]*c+i[12])/(u=u||1),t[1]=(i[1]*n+i[5]*s+i[9]*c+i[13])/u,t[2]=(i[2]*n+i[6]*s+i[10]*c+i[14])/u,t}function xd(t,e,i){var n=i[0],s=i[1],c=i[2],u=e[0],p=e[1],m=e[2],_=s*m-c*p,x=c*u-n*m,b=n*p-s*u,w=s*b-c*x,S=c*_-n*b,M=n*x-s*_,C=2*i[3];return x*=C,b*=C,S*=2,M*=2,t[0]=u+(_*=C)+(w*=2),t[1]=p+x+S,t[2]=m+b+M,t}var Ml,Fr=iu,Jf=yd,Qf=wl;function vd(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t}function bd(t,e){var i=e[0],n=e[1],s=e[2],c=e[3],u=i*i+n*n+s*s+c*c;return u>0&&(u=1/Math.sqrt(u)),t[0]=i*u,t[1]=n*u,t[2]=s*u,t[3]=c*u,t}function as(t,e,i){var n=e[0],s=e[1],c=e[2],u=e[3];return t[0]=i[0]*n+i[4]*s+i[8]*c+i[12]*u,t[1]=i[1]*n+i[5]*s+i[9]*c+i[13]*u,t[2]=i[2]*n+i[6]*s+i[10]*c+i[14]*u,t[3]=i[3]*n+i[7]*s+i[11]*c+i[15]*u,t}function wd(){var t=new qi(4);return qi!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Td(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function Ed(t,e,i){i*=.5;var n=e[0],s=e[1],c=e[2],u=e[3],p=Math.sin(i),m=Math.cos(i);return t[0]=n*m+u*p,t[1]=s*m+c*p,t[2]=c*m-s*p,t[3]=u*m-n*p,t}function Sd(t,e,i){i*=.5;var n=e[0],s=e[1],c=e[2],u=e[3],p=Math.sin(i),m=Math.cos(i);return t[0]=n*m-c*p,t[1]=s*m+u*p,t[2]=c*m+n*p,t[3]=u*m-s*p,t}tu(),Ml=new qi(4),qi!=Float32Array&&(Ml[0]=0,Ml[1]=0,Ml[2]=0,Ml[3]=0);var em=bd;tu(),ta(1,0,0),ta(0,1,0),wd(),wd(),pd();const tm=te([{type:"Float32",name:"a_globe_pos",components:3},{type:"Float32",name:"a_uv",components:2}]),{members:Md}=tm,Ad=te([{name:"a_pos_3",components:3,type:"Int16"}]);var Al=te([{name:"a_pos",type:"Int16",components:2}]);class nu{constructor(e,i){this.pos=e,this.dir=i}intersectsPlane(e,i,n){const s=pr(i,this.dir);if(Math.abs(s)<1e-6)return!1;const c=((e[0]-this.pos[0])*i[0]+(e[1]-this.pos[1])*i[1]+(e[2]-this.pos[2])*i[2])/s;return n[0]=this.pos[0]+this.dir[0]*c,n[1]=this.pos[1]+this.dir[1]*c,n[2]=this.pos[2]+this.dir[2]*c,!0}closestPointOnSphere(e,i,n){if(function(S,M){var C=S[0],D=S[1],U=S[2],q=M[0],V=M[1],$=M[2];return Math.abs(C-q)<=Zc*Math.max(1,Math.abs(C),Math.abs(q))&&Math.abs(D-V)<=Zc*Math.max(1,Math.abs(D),Math.abs(V))&&Math.abs(U-$)<=Zc*Math.max(1,Math.abs(U),Math.abs($))}(this.pos,e)||i===0)return n[0]=n[1]=n[2]=0,!1;const[s,c,u]=this.dir,p=this.pos[0]-e[0],m=this.pos[1]-e[1],_=this.pos[2]-e[2],x=s*s+c*c+u*u,b=2*(p*s+m*c+_*u),w=b*b-4*x*(p*p+m*m+_*_-i*i);if(w<0){const S=Math.max(-b/2,0),M=p+s*S,C=m+c*S,D=_+u*S,U=Math.hypot(M,C,D);return n[0]=M*i/U,n[1]=C*i/U,n[2]=D*i/U,!1}{const S=(-b-Math.sqrt(w))/(2*x);if(S<0){const M=Math.hypot(p,m,_);return n[0]=p*i/M,n[1]=m*i/M,n[2]=_*i/M,!1}return n[0]=p+s*S,n[1]=m+c*S,n[2]=_+u*S,!0}}}class ou{constructor(e,i,n,s,c){this.TL=e,this.TR=i,this.BR=n,this.BL=s,this.horizon=c}static fromInvProjectionMatrix(e,i,n){const s=[-1,1,1],c=[1,1,1],u=[1,-1,1],p=[-1,-1,1],m=qt(s,s,e),_=qt(c,c,e),x=qt(u,u,e),b=qt(p,p,e);return new ou(m,_,x,b,i/n)}}class su{constructor(e,i){this.points=e,this.planes=i}static fromInvProjectionMatrix(e,i,n,s){const c=Math.pow(2,n),u=[[-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(m=>{const _=as([],m,e),x=1/_[3]/i*c;return function(b,w,S){return b[0]=w[0]*S[0],b[1]=w[1]*S[1],b[2]=w[2]*S[2],b[3]=w[3]*S[3],b}(_,_,[x,x,s?1/_[3]:x,x])}),p=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(m=>{const _=Ci([],ru([],Fr([],u[m[0]],u[m[1]]),Fr([],u[m[2]],u[m[1]]))),x=-pr(_,u[m[1]]);return _.concat(x)});return new su(u,p)}}class zi{static fromPoints(e){const i=[1/0,1/0,1/0],n=[-1/0,-1/0,-1/0];for(const s of e)Tl(i,i,s),El(n,n,s);return new zi(i,n)}static applyTransform(e,i){const n=e.getCorners();for(let s=0;s=0;if(u===0)return 0;u!==i.length&&(n=!1)}if(n)return 2;for(let s=0;s<3;s++){let c=Number.MAX_VALUE,u=-Number.MAX_VALUE;for(let p=0;pthis.max[s]-this.min[s])return 0}return 1}}const au=5,Id=6,Qr=Ze/Math.PI/2,im=16383,ls=64,Il=[ls,32,16],fr=-Qr,mr=Qr,rm=[new zi([fr,fr,fr],[mr,mr,mr]),new zi([fr,fr,fr],[0,0,mr]),new zi([0,fr,fr],[mr,0,mr]),new zi([fr,0,fr],[0,mr,mr]),new zi([0,0,fr],[mr,mr,mr])];function Wc(t){return t*Qr/Pl}function Cd(t,e,i,n=!0){const s=rr([],t._camera.position,t.worldSize),c=[e,i,1,1];as(c,c,t.pixelMatrixInverse),vd(c,c,1/c[3]);const u=Ci([],Fr([],c,s)),p=t.globeMatrix,m=[p[12],p[13],p[14]],_=Fr([],m,s),x=wl(_),b=Ci([],_),w=t.worldSize/(2*Math.PI),S=pr(b,u),M=Math.asin(w/x);if(M1?null:function(n,s,c,u){const p=Math.sin(c);return n*(Math.sin((1-u)*c)/p)+s*(Math.sin(u*c)/p)}(t.a[e],t.b[e],t.angle,ct(i,0,1))+t.center[e]}function en(t){if(t.z<=1)return rm[t.z+2*t.y+t.x];const e=cu(Xc(t));return zi.fromPoints(e)}function cs(t,e,i){return rr(t,t,1-i),Sl(t,t,e,i)}function zd(t,e){const i=na(e.zoom);if(i===0)return en(t);const n=Xc(t),s=cu(n),c=tn(n.getWest())*e.worldSize,u=tn(n.getEast())*e.worldSize,p=rn(n.getNorth())*e.worldSize,m=rn(n.getSouth())*e.worldSize,_=[c,p,0],x=[u,p,0],b=[c,m,0],w=[u,m,0],S=Qh([],e.globeMatrix);return qt(_,_,S),qt(x,x,S),qt(b,b,S),qt(w,w,S),s[0]=cs(s[0],b,i),s[1]=cs(s[1],w,i),s[2]=cs(s[2],x,i),s[3]=cs(s[3],_,i),zi.fromPoints(s)}function Pd(t,e,i){for(const n of t)qt(n,n,e),rr(n,n,i)}function om(t,e,i){const n=e/t.worldSize,s=t.globeMatrix;if(i.z<=1){const se=en(i).getCorners();return Pd(se,s,n),zi.fromPoints(se)}const c=Xc(i),u=cu(c);Pd(u,s,n);const p=Number.MAX_VALUE,m=[-p,-p,-p],_=[p,p,p];if(c.contains(t.center)){for(const Ee of u)Tl(_,_,Ee),El(m,m,Ee);m[2]=0;const se=t.point,me=[se.x*n,se.y*n,0];return Tl(_,_,me),El(m,m,me),new zi(_,m)}const x=[s[12]*n,s[13]*n,s[14]*n],b=c.getCenter(),w=ct(t.center.lat,-wi,wi),S=ct(b.lat,-wi,wi),M=tn(t.center.lng),C=rn(w);let D=M-tn(b.lng);const U=C-rn(S);D>.5?D-=1:D<-.5&&(D+=1);let q=0;Math.abs(D)>Math.abs(U)?q=D>=0?1:3:(q=U>=0?0:2,Sl(x,x,[s[4]*n,s[5]*n,s[6]*n],-Math.sin(dt(U>=0?c.getSouth():c.getNorth()))*Qr));const V=u[q],$=u[(q+1)%4],X=new nm(V,$,x),W=[lu(X,0)||V[0],lu(X,1)||V[1],lu(X,2)||V[2]],ce=na(t.zoom);if(ce>0){const se=function({x:Ee,y:ue,z:ye},xe,be,Ce,pe){const De=1/(1<.5?$e=-1:Ke<-.5&&($e=1),Ne=((Ne+$e)*xe-(Ce*=xe))*be+Ce,Re=((Re+$e)*xe-Ce)*be+Ce,He=(He*xe-(pe*=xe))*be+pe,ze=(ze*xe-pe)*be+pe,[[Ne,ze,0],[Re,ze,0],[Re,He,0],[Ne,He,0]]}(i,e,t._pixelsPerMercatorPixel,M,C);for(let Ee=0;EeMath.PI/2*1.01}const Rd=dt(85),sm=Math.cos(Rd),am=Math.sin(Rd),Pl=63710088e-1,Bd=2*Math.PI*Pl;class fo{constructor(e,i){if(isNaN(e)||isNaN(i))throw new Error(`Invalid LngLat object: (${e}, ${i})`);if(this.lng=+e,this.lat=+i,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new fo(oi(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const i=Math.PI/180,n=this.lat*i,s=e.lat*i,c=Math.sin(n)*Math.sin(s)+Math.cos(n)*Math.cos(s)*Math.cos((e.lng-this.lng)*i);return Pl*Math.acos(Math.min(c,1))}toBounds(e=0){const i=360*e/40075017,n=i/Math.cos(Math.PI/180*this.lat);return new po(new fo(this.lng-n,this.lat-i),new fo(this.lng+n,this.lat+i))}toEcef(e){const i=Wc(e);return ra(this.lat,this.lng,Qr+i)}static convert(e){if(e instanceof fo)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new fo(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new fo(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}var At=fo;function du(t){return Bd*Math.cos(t*Math.PI/180)}function tn(t){return(180+t)/360}function rn(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Ur(t,e){return t/du(e)}function nr(t){return 360*t-180}function bi(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}function Od(t,e){return t*du(bi(e))}const wi=85.051129;function Fd(t){return 1/Math.cos(t*Math.PI/180)}class oa{constructor(e,i,n=0){this.x=+e,this.y=+i,this.z=+n}static fromLngLat(e,i=0){const n=At.convert(e);return new oa(tn(n.lng),rn(n.lat),Ur(i,n.lat))}toLngLat(){return new At(nr(this.x),bi(this.y))}toAltitude(){return Od(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/Bd*Fd(bi(this.y))}}function pu(t,e,i,n,s,c,u,p,m){const _=(e+n)/2,x=(i+s)/2,b=new Le(_,x);p(b),function(w,S,M,C,D,U){const q=M-D,V=C-U;return Math.abs((C-S)*q-(M-w)*V)/Math.hypot(q,V)}(b.x,b.y,c.x,c.y,u.x,u.y)>=m?(pu(t,e,i,_,x,c,b,p,m),pu(t,_,x,n,s,b,u,p,m)):t.push(u)}function Ud(t,e,i){let n=t[0],s=n.x,c=n.y;e(n);const u=[n];for(let p=1;pt.x+1||nt.y+1)&&Ut("Geometry exceeds allowed extent, reduce your vector tile buffer size"),t}function Pn(t,e,i){const n=t.loadGeometry(),s=t.extent,c=Ze/s;if(e&&i&&i.projection.isReprojectedInTileSpace){const u=1<{const S=nr((e.x+w.x/s)/u),M=bi((e.y+w.y/s)/u),C=x.project(S,M);w.x=(C.x*p-m)*s,w.y=(C.y*p-_)*s};for(let w=0;w=s||M.y<0||M.y>=s||(b(M),S.push(M));n[w]=S}}for(const u of n)for(const p of u)cm(p,c);return n}function hs(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?Pn(t):[]}}function Kc(t,e,i,n,s){t.emplaceBack(2*e+(n+1)/2,2*i+(s+1)/2)}function Yc(t,e,i){t.emplaceBack(e.x,e.y,e.z,i[0]*16384,i[1]*16384,i[2]*16384)}class _u{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(i=>i.id),this.index=e.index,this.hasPattern=!1,this.projection=e.projection,this.layoutVertexArray=new Te,this.indexArray=new je,this.segments=new Yt,this.programConfigurations=new ns(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id)}populate(e,i,n,s){const c=this.layers[0],u=[];let p=null;c.type==="circle"&&(p=c.layout.get("circle-sort-key"));for(const{feature:_,id:x,index:b,sourceLayerIndex:w}of e){const S=this.layers[0]._featureFilter.needGeometry,M=hs(_,S);if(!this.layers[0]._featureFilter.filter(new v(this.zoom),M,n))continue;const C=p?p.evaluate(M,{},n):void 0,D={id:x,properties:_.properties,type:_.type,sourceLayerIndex:w,index:b,geometry:S?M.geometry:Pn(_,n,s),patterns:{},sortKey:C};u.push(D)}p&&u.sort((_,x)=>_.sortKey-x.sortKey);let m=null;s.projection.name==="globe"&&(this.globeExtVertexArray=new Me,m=s.projection);for(const _ of u){const{geometry:x,index:b,sourceLayerIndex:w}=_,S=e[b].feature;this.addFeature(_,x,b,i.availableImages,n,m),i.featureIndex.insert(S,x,b,w,this.index)}}update(e,i,n,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,n,s)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Hf.members),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.globeExtVertexArray&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,Kf.members))),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}addFeature(e,i,n,s,c,u){for(const p of i)for(const m of p){const _=m.x,x=m.y;if(_<0||_>=Ze||x<0||x>=Ze)continue;if(u){const S=u.projectTilePoint(_,x,c),M=u.upVector(c,_,x),C=this.globeExtVertexArray;Yc(C,S,M),Yc(C,S,M),Yc(C,S,M),Yc(C,S,M)}const b=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),w=b.vertexLength;Kc(this.layoutVertexArray,_,x,-1,-1),Kc(this.layoutVertexArray,_,x,1,-1),Kc(this.layoutVertexArray,_,x,1,1),Kc(this.layoutVertexArray,_,x,-1,1),this.indexArray.emplaceBack(w,w+1,w+2),this.indexArray.emplaceBack(w,w+2,w+3),b.vertexLength+=4,b.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,{},s,c)}}function Nd(t,e){for(let i=0;i1){if(gu(t,e))return!0;for(let n=0;n1?i:i.sub(e)._mult(s)._add(e))}function $d(t,e){let i,n,s,c=!1;for(let u=0;ue.y!=s.y>e.y&&e.x<(s.x-n.x)*(e.y-n.y)/(s.y-n.y)+n.x&&(c=!c)}return c}function us(t,e){let i=!1;for(let n=0,s=t.length-1;ne.y!=u.y>e.y&&e.x<(u.x-c.x)*(e.y-c.y)/(u.y-c.y)+c.x&&(i=!i)}return i}function Zd(t,e,i,n,s){for(const u of t)if(e<=u.x&&i<=u.y&&n>=u.x&&s>=u.y)return!0;const c=[new Le(e,i),new Le(e,s),new Le(n,s),new Le(n,i)];if(t.length>2){for(const u of c)if(us(t,u))return!0}for(let u=0;us.x&&e.x>s.x||t.ys.y&&e.y>s.y)return!1;const c=Ui(t,e,i[0]);return c!==Ui(t,e,i[1])||c!==Ui(t,e,i[2])||c!==Ui(t,e,i[3])}function sa(t,e,i){const n=e.paint.get(t).value;return n.kind==="constant"?n.value:i.programConfigurations.get(e.id).getMaxValue(t)}function Jc(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function qd(t,e,i,n,s){if(!e[0]&&!e[1])return t;const c=Le.convert(e)._mult(s);i==="viewport"&&c._rotate(-n);const u=[];for(let p=0;p0){const V=i.projection.upVector(_,S.x,S.y);C.x+=V[0]*x*M,C.y+=V[1]*x*M,C.z+=V[2]*x*M}const D=c?S:_m(C.x,C.y,C.z,n),U=c?t.tilespaceRays.map(V=>ym(V,M)):t.queryGeometry.screenGeometry,q=as([],[C.x,C.y,C.z,1],n);if(!u&&c?m*=q[3]/i.cameraToCenterDistance:u&&!c&&(m*=i.cameraToCenterDistance/q[3]),c){const V=bi((w.y/Ze+_.y)/(1<<_.z));m/=i.projection.pixelsPerMeter(V,1)/Ur(1,V)}if(hm(U,D,m))return!0}return!1}function _m(t,e,i,n){const s=as([],[t,e,i,1],n);return new Le(s[0]/s[3],s[1]/s[3])}const Hd=ta(0,0,0),gm=ta(0,0,1);function ym(t,e){const i=tu();return Hd[2]=e,t.intersectsPlane(Hd,gm,i),new Le(i[0],i[1])}class Kd extends _u{}function Yd(t,{width:e,height:i},n,s){if(s){if(s instanceof Uint8ClampedArray)s=new Uint8Array(s.buffer);else if(s.length!==e*i*n)throw new RangeError("mismatched image size")}else s=new Uint8Array(e*i*n);return t.width=e,t.height=i,t.data=s,t}function Jd(t,e,i){const{width:n,height:s}=e;n===t.width&&s===t.height||(xu(t,e,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,n),height:Math.min(t.height,s)},i),t.width=n,t.height=s,t.data=e.data)}function xu(t,e,i,n,s,c){if(s.width===0||s.height===0)return e;if(s.width>t.width||s.height>t.height||i.x>t.width-s.width||i.y>t.height-s.height)throw new RangeError("out of range source coordinates for image copy");if(s.width>e.width||s.height>e.height||n.x>e.width-s.width||n.y>e.height-s.height)throw new RangeError("out of range destination coordinates for image copy");const u=t.data,p=e.data;for(let m=0;m{e[t.evaluationKey]=m;const _=t.expression.evaluate(e);s.data[u+p+0]=Math.floor(255*_.r/_.a),s.data[u+p+1]=Math.floor(255*_.g/_.a),s.data[u+p+2]=Math.floor(255*_.b/_.a),s.data[u+p+3]=Math.floor(255*_.a)};if(t.clips)for(let u=0,p=0;u80*i){n=c=t[0],s=u=t[1];for(var M=i;Mc&&(c=p),m>u&&(u=m);_=(_=Math.max(c-n,u-s))!==0?32767/_:0}return kl(w,S,i,n,s,_,0),S}function Qd(t,e,i,n,s){var c,u;if(s===Eu(t,e,i,n)>0)for(c=e;c=e;c-=n)u=ip(c,t[c],t[c+1],u);return u&&eh(u,u.next)&&(Ll(u),u=u.next),u}function ds(t,e){if(!t)return t;e||(e=t);var i,n=t;do if(i=!1,n.steiner||!eh(n,n.next)&&Jt(n.prev,n,n.next)!==0)n=n.next;else{if(Ll(n),(n=e=n.prev)===n.next)break;i=!0}while(i||n!==e);return e}function kl(t,e,i,n,s,c,u){if(t){!u&&c&&function(x,b,w,S){var M=x;do M.z===0&&(M.z=wu(M.x,M.y,b,w,S)),M.prevZ=M.prev,M.nextZ=M.next,M=M.next;while(M!==x);M.prevZ.nextZ=null,M.prevZ=null,function(C){var D,U,q,V,$,X,W,ce,se=1;do{for(U=C,C=null,$=null,X=0;U;){for(X++,q=U,W=0,D=0;D0||ce>0&&q;)W!==0&&(ce===0||!q||U.z<=q.z)?(V=U,U=U.nextZ,W--):(V=q,q=q.nextZ,ce--),$?$.nextZ=V:C=V,V.prevZ=$,$=V;U=q}$.nextZ=null,se*=2}while(X>1)}(M)}(t,n,s,c);for(var p,m,_=t;t.prev!==t.next;)if(p=t.prev,m=t.next,c?Em(t,n,s,c):Tm(t))e.push(p.i/i|0),e.push(t.i/i|0),e.push(m.i/i|0),Ll(t),t=m.next,_=m.next;else if((t=m)===_){u?u===1?kl(t=Sm(ds(t),e,i),e,i,n,s,c,2):u===2&&Mm(t,e,i,n,s,c):kl(ds(t),e,i,n,s,c,1);break}}}function Tm(t){var e=t.prev,i=t,n=t.next;if(Jt(e,i,n)>=0)return!1;for(var s=e.x,c=i.x,u=n.x,p=e.y,m=i.y,_=n.y,x=sc?s>u?s:u:c>u?c:u,S=p>m?p>_?p:_:m>_?m:_,M=n.next;M!==e;){if(M.x>=x&&M.x<=w&&M.y>=b&&M.y<=S&&aa(s,p,c,m,u,_,M.x,M.y)&&Jt(M.prev,M,M.next)>=0)return!1;M=M.next}return!0}function Em(t,e,i,n){var s=t.prev,c=t,u=t.next;if(Jt(s,c,u)>=0)return!1;for(var p=s.x,m=c.x,_=u.x,x=s.y,b=c.y,w=u.y,S=pm?p>_?p:_:m>_?m:_,D=x>b?x>w?x:w:b>w?b:w,U=wu(S,M,e,i,n),q=wu(C,D,e,i,n),V=t.prevZ,$=t.nextZ;V&&V.z>=U&&$&&$.z<=q;){if(V.x>=S&&V.x<=C&&V.y>=M&&V.y<=D&&V!==s&&V!==u&&aa(p,x,m,b,_,w,V.x,V.y)&&Jt(V.prev,V,V.next)>=0||(V=V.prevZ,$.x>=S&&$.x<=C&&$.y>=M&&$.y<=D&&$!==s&&$!==u&&aa(p,x,m,b,_,w,$.x,$.y)&&Jt($.prev,$,$.next)>=0))return!1;$=$.nextZ}for(;V&&V.z>=U;){if(V.x>=S&&V.x<=C&&V.y>=M&&V.y<=D&&V!==s&&V!==u&&aa(p,x,m,b,_,w,V.x,V.y)&&Jt(V.prev,V,V.next)>=0)return!1;V=V.prevZ}for(;$&&$.z<=q;){if($.x>=S&&$.x<=C&&$.y>=M&&$.y<=D&&$!==s&&$!==u&&aa(p,x,m,b,_,w,$.x,$.y)&&Jt($.prev,$,$.next)>=0)return!1;$=$.nextZ}return!0}function Sm(t,e,i){var n=t;do{var s=n.prev,c=n.next.next;!eh(s,c)&&ep(s,n,n.next,c)&&Dl(s,c)&&Dl(c,s)&&(e.push(s.i/i|0),e.push(n.i/i|0),e.push(c.i/i|0),Ll(n),Ll(n.next),n=t=c),n=n.next}while(n!==t);return ds(n)}function Mm(t,e,i,n,s,c){var u=t;do{for(var p=u.next.next;p!==u.prev;){if(u.i!==p.i&&Pm(u,p)){var m=tp(u,p);return u=ds(u,u.next),m=ds(m,m.next),kl(u,e,i,n,s,c,0),void kl(m,e,i,n,s,c,0)}p=p.next}u=u.next}while(u!==t)}function Am(t,e){return t.x-e.x}function Im(t,e){var i=function(s,c){var u,p=c,m=s.x,_=s.y,x=-1/0;do{if(_<=p.y&&_>=p.next.y&&p.next.y!==p.y){var b=p.x+(_-p.y)*(p.next.x-p.x)/(p.next.y-p.y);if(b<=m&&b>x&&(x=b,u=p.x=p.x&&p.x>=M&&m!==p.x&&aa(_u.x||p.x===u.x&&Cm(u,p)))&&(u=p,D=w)),p=p.next;while(p!==S);return u}(t,e);if(!i)return e;var n=tp(i,t);return ds(n,n.next),ds(i,i.next)}function Cm(t,e){return Jt(t.prev,t,e.prev)<0&&Jt(e.next,t,t.next)<0}function wu(t,e,i,n,s){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*s|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*s|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function zm(t){var e=t,i=t;do(e.x=(t-u)*(c-p)&&(t-u)*(n-p)>=(i-u)*(e-p)&&(i-u)*(c-p)>=(s-u)*(n-p)}function Pm(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(i,n){var s=i;do{if(s.i!==i.i&&s.next.i!==i.i&&s.i!==n.i&&s.next.i!==n.i&&ep(s,s.next,i,n))return!0;s=s.next}while(s!==i);return!1}(t,e)&&(Dl(t,e)&&Dl(e,t)&&function(i,n){var s=i,c=!1,u=(i.x+n.x)/2,p=(i.y+n.y)/2;do s.y>p!=s.next.y>p&&s.next.y!==s.y&&u<(s.next.x-s.x)*(p-s.y)/(s.next.y-s.y)+s.x&&(c=!c),s=s.next;while(s!==i);return c}(t,e)&&(Jt(t.prev,t,e.prev)||Jt(t,e.prev,e))||eh(t,e)&&Jt(t.prev,t,t.next)>0&&Jt(e.prev,e,e.next)>0)}function Jt(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function eh(t,e){return t.x===e.x&&t.y===e.y}function ep(t,e,i,n){var s=ih(Jt(t,e,i)),c=ih(Jt(t,e,n)),u=ih(Jt(i,n,t)),p=ih(Jt(i,n,e));return s!==c&&u!==p||!(s!==0||!th(t,i,e))||!(c!==0||!th(t,n,e))||!(u!==0||!th(i,t,n))||!(p!==0||!th(i,e,n))}function th(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 ih(t){return t>0?1:t<0?-1:0}function Dl(t,e){return Jt(t.prev,t,t.next)<0?Jt(t,e,t.next)>=0&&Jt(t,t.prev,e)>=0:Jt(t,e,t.prev)<0||Jt(t,t.next,e)<0}function tp(t,e){var i=new Tu(t.i,t.x,t.y),n=new Tu(e.i,e.x,e.y),s=t.next,c=e.prev;return t.next=e,e.prev=t,i.next=s,s.prev=i,n.next=i,i.prev=n,c.next=n,n.prev=c,n}function ip(t,e,i,n){var s=new Tu(t,e,i);return n?(s.next=n.next,s.prev=n,n.next.prev=s,n.next=s):(s.prev=s,s.next=s),s}function Ll(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 Tu(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Eu(t,e,i,n){for(var s=0,c=e,u=i-n;c0&&i.holes.push(n+=t[s-1].length)}return i};var Su=Yi(bu.exports);function km(t,e,i,n,s){rp(t,e,i||0,n||t.length-1,s||Dm)}function rp(t,e,i,n,s){for(;n>i;){if(n-i>600){var c=n-i+1,u=e-i+1,p=Math.log(c),m=.5*Math.exp(2*p/3),_=.5*Math.sqrt(p*m*(c-m)/c)*(u-c/2<0?-1:1);rp(t,e,Math.max(i,Math.floor(e-u*m/c+_)),Math.min(n,Math.floor(e+(c-u)*m/c+_)),s)}var x=t[e],b=i,w=n;for(Rl(t,i,e),s(t[n],x)>0&&Rl(t,i,n);b0;)w--}s(t[i],x)===0?Rl(t,i,w):Rl(t,++w,n),w<=e&&(i=w+1),e<=w&&(n=w-1)}}function Rl(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function Dm(t,e){return te?1:0}function Mu(t,e){const i=t.length;if(i<=1)return[t];const n=[];let s,c;for(let u=0;u1)for(let u=0;ui.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Te,this.indexArray=new je,this.indexArray2=new ui,this.programConfigurations=new ns(e.layers,e.zoom),this.segments=new Yt,this.segments2=new Yt,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id),this.projection=e.projection}populate(e,i,n,s){this.hasPattern=Au("fill",this.layers,i);const c=this.layers[0].layout.get("fill-sort-key"),u=[];for(const{feature:p,id:m,index:_,sourceLayerIndex:x}of e){const b=this.layers[0]._featureFilter.needGeometry,w=hs(p,b);if(!this.layers[0]._featureFilter.filter(new v(this.zoom),w,n))continue;const S=c?c.evaluate(w,{},n,i.availableImages):void 0,M={id:m,properties:p.properties,type:p.type,sourceLayerIndex:x,index:_,geometry:b?w.geometry:Pn(p,n,s),patterns:{},sortKey:S};u.push(M)}c&&u.sort((p,m)=>p.sortKey-m.sortKey);for(const p of u){const{geometry:m,index:_,sourceLayerIndex:x}=p;if(this.hasPattern){const b=Iu("fill",this.layers,p,this.zoom,i);this.patternFeatures.push(b)}else this.addFeature(p,m,_,n,{},i.availableImages);i.featureIndex.insert(e[_].feature,m,_,x,this.index)}}update(e,i,n,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,n,s)}addFeatures(e,i,n,s,c){for(const u of this.patternFeatures)this.addFeature(u,u.geometry,u.index,i,n,s)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,wm),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),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(e,i,n,s,c,u=[]){for(const p of Mu(i,500)){let m=0;for(const M of p)m+=M.length;const _=this.segments.prepareSegment(m,this.layoutVertexArray,this.indexArray),x=_.vertexLength,b=[],w=[];for(const M of p){if(M.length===0)continue;M!==p[0]&&w.push(b.length/2);const C=this.segments2.prepareSegment(M.length,this.layoutVertexArray,this.indexArray2),D=C.vertexLength;this.layoutVertexArray.emplaceBack(M[0].x,M[0].y),this.indexArray2.emplaceBack(D+M.length-1,D),b.push(M[0].x),b.push(M[0].y);for(let U=1;U>3}if(s--,n===1||n===2)c+=t.readSVarint(),u+=t.readSVarint(),n===1&&(e&&p.push(e),e=[]),e.push(new Nm(c,u));else{if(n!==7)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&p.push(e),p},la.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,i=1,n=0,s=0,c=0,u=1/0,p=-1/0,m=1/0,_=-1/0;t.pos>3}if(n--,i===1||i===2)(s+=t.readSVarint())p&&(p=s),(c+=t.readSVarint())_&&(_=c);else if(i!==7)throw new Error("unknown command "+i)}return[u,m,p,_]},la.prototype.toGeoJSON=function(t,e,i){var n,s,c=this.extent*Math.pow(2,i),u=this.extent*t,p=this.extent*e,m=this.loadGeometry(),_=la.types[this.type];function x(S){for(var M=0;M>3;s=u===1?n.readString():u===2?n.readFloat():u===3?n.readDouble():u===4?n.readVarint64():u===5?n.readVarint():u===6?n.readSVarint():u===7?n.readBoolean():null}return s}(i))}sp.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 $m(this._pbf,e,this.extent,this._keys,this._values)};var qm=op;function Wm(t,e,i){if(t===3){var n=new qm(i,i.readVarint()+i.pos);n.length&&(e[n.name]=n)}}var Cu=nh.VectorTile=function(t,e){this.layers=t.readFields(Wm,{},e)},oh=nh.VectorTileFeature=np;function sh(t,e,i,n){const s=[],c=n===0?(u,p,m,_,x,b)=>{u.push(new Le(b,m+(b-p)/(_-p)*(x-m)))}:(u,p,m,_,x,b)=>{u.push(new Le(p+(b-m)/(x-m)*(_-p),b))};for(const u of t){const p=[];for(const m of u){if(m.length<=2)continue;const _=[];for(let w=0;we&&c(_,S,M,C,D,e):U>i?q=e&&c(_,S,M,C,D,e),q>i&&U<=i&&c(_,S,M,C,D,i)}let x=m[m.length-1];const b=n===0?x.x:x.y;b>=e&&b<=i&&_.push(x),_.length&&(x=_[_.length-1],_[0].x===x.x&&_[0].y===x.y||_.push(_[0]),p.push(_))}p.length&&s.push(p)}return s}nh.VectorTileLayer=op;const Xm=oh.types,Hm=Math.pow(2,13);function Bl(t,e,i,n,s,c,u,p){t.emplaceBack((e<<1)+u,(i<<1)+c,(Math.floor(n*Hm)<<1)+s,Math.round(p))}function Ol(t,e,i){t.emplaceBack(e.x,e.y,e.z,i[0]*16384,i[1]*16384,i[2]*16384)}class ap{constructor(){this.acc=new Le(0,0),this.polyCount=[]}startRing(e){this.currentPolyCount={edges:0,top:0},this.polyCount.push(this.currentPolyCount),this.min||(this.min=new Le(e.x,e.y),this.max=new Le(e.x,e.y))}append(e,i){this.currentPolyCount.edges++,this.acc._add(e);const n=this.min,s=this.max;e.xs.x&&(s.x=e.x),e.ys.y&&(s.y=e.y),((e.x===0||e.x===Ze)&&e.x===i.x)!=((e.y===0||e.y===Ze)&&e.y===i.y)&&this.processBorderOverlap(e,i),i.x<0!=e.x<0&&this.addBorderIntersection(0,mt(i.y,e.y,(0-i.x)/(e.x-i.x))),i.x>Ze!=e.x>Ze&&this.addBorderIntersection(1,mt(i.y,e.y,(Ze-i.x)/(e.x-i.x))),i.y<0!=e.y<0&&this.addBorderIntersection(2,mt(i.x,e.x,(0-i.y)/(e.y-i.y))),i.y>Ze!=e.y>Ze&&this.addBorderIntersection(3,mt(i.x,e.x,(Ze-i.y)/(e.y-i.y)))}addBorderIntersection(e,i){this.borders||(this.borders=[[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE]]);const n=this.borders[e];in[1]&&(n[1]=i)}processBorderOverlap(e,i){if(e.x===i.x){if(e.y===i.y)return;const n=e.x===0?0:1;this.addBorderIntersection(n,i.y),this.addBorderIntersection(n,e.y)}else{const n=e.y===0?2:3;this.addBorderIntersection(n,i.x),this.addBorderIntersection(n,e.x)}}centroid(){const e=this.polyCount.reduce((i,n)=>i+n.edges,0);return e!==0?this.acc.div(e)._round():new Le(0,0)}span(){return new Le(this.max.x-this.min.x,this.max.y-this.min.y)}intersectsCount(){return this.borders.reduce((e,i)=>e+ +(i[0]!==Number.MAX_VALUE),0)}}class Fl{constructor(e){this.zoom=e.zoom,this.canonical=e.canonical,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(i=>i.id),this.index=e.index,this.hasPattern=!1,this.edgeRadius=0,this.projection=e.projection,this.layoutVertexArray=new ge,this.centroidVertexArray=new Lr,this.indexArray=new je,this.programConfigurations=new ns(e.layers,e.zoom),this.segments=new Yt,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id),this.enableTerrain=e.enableTerrain}populate(e,i,n,s){this.features=[],this.hasPattern=Au("fill-extrusion",this.layers,i),this.featuresOnBorder=[],this.borders=[[],[],[],[]],this.borderDoneWithNeighborZ=[-1,-1,-1,-1],this.tileToMeter=function(c){const u=Math.exp(Math.PI*(1-c.y/(1<=0;U--){const q=S[U];(q.length===0||(M=q[0]).every(V=>V.x<=0)||M.every(V=>V.x>=Ze)||M.every(V=>V.y<=0)||M.every(V=>V.y>=Ze))&&S.splice(U,1)}var M;let C;if(x)C=fp(S,m,s);else{C=[];for(const U of S)C.push({polygon:U,bounds:m})}const D=w?this.edgeRadius:0;for(const{polygon:U,bounds:q}of C){let V=0,$=0;for(const W of U)w&&!W[0].equals(W[W.length-1])&&W.push(W[0]),$+=w?W.length-1:W.length;const X=this.segments.prepareSegment((w?5:4)*$,this.layoutVertexArray,this.indexArray);if(w){const W=[],ce=[];V=X.vertexLength;for(const me of U){let Ee,ue;me.length&&me!==U[0]&&ce.push(W.length/2),Ee=me[1].sub(me[0])._perp()._unit();for(let ye=1;ye4&&up(W[W.length-2],W[0],W[1]),ue=D?Km(W[W.length-2],W[0],W[1],D):0;se=W[1].sub(W[0])._perp()._unit();let ye=!0;for(let xe=1,be=0;xe0?1:0,ze=Ce.dist(pe);if(be+ze>32768&&(be=0),D){me=De.sub(pe)._perp()._unit();let Ye=cp(Ce,pe,De,lp(se,me),D);isNaN(Ye)&&(Ye=0);const We=pe.sub(Ce)._unit();Ce=Ce.add(We.mult(ue))._round(),pe=pe.add(We.mult(-Ye))._round(),ue=Ye,se=me}const $e=X.vertexLength,Ke=W.length>4&&up(Ce,pe,De);let gt=dp(be,Ee,ye);if(Bl(this.layoutVertexArray,Ce.x,Ce.y,Re,He,0,0,gt),Bl(this.layoutVertexArray,Ce.x,Ce.y,Re,He,0,1,gt),be+=ze,gt=dp(be,Ke,!ye),Ee=Ke,Bl(this.layoutVertexArray,pe.x,pe.y,Re,He,0,0,gt),Bl(this.layoutVertexArray,pe.x,pe.y,Re,He,0,1,gt),X.vertexLength+=4,this.indexArray.emplaceBack($e+0,$e+1,$e+2),this.indexArray.emplaceBack($e+1,$e+3,$e+2),X.primitiveLength+=2,D){const Ye=V+(xe===1?W.length-2:xe-2),We=xe===1?V:Ye+1;if(this.indexArray.emplaceBack($e+1,Ye,$e+3),this.indexArray.emplaceBack(Ye,We,$e+3),X.primitiveLength+=2,ce===void 0&&(ce=$e),!hp(De,W[xe],q)){const Rt=xe===W.length-1?ce:X.vertexLength;this.indexArray.emplaceBack($e+2,$e+3,Rt),this.indexArray.emplaceBack($e+3,Rt+1,Rt),this.indexArray.emplaceBack($e+3,We,Rt+1),X.primitiveLength+=3}ye=!ye}if(x){const Ye=this.layoutVertexExtArray,We=_.projectTilePoint(Ce.x,Ce.y,s),Rt=_.projectTilePoint(pe.x,pe.y,s),et=_.upVector(s,Ce.x,Ce.y),tt=_.upVector(s,pe.x,pe.y);Ol(Ye,We,et),Ol(Ye,We,et),Ol(Ye,Rt,tt),Ol(Ye,Rt,tt)}}w&&(V+=W.length-1)}}if(b&&b.polyCount.length>0){if(b.borders){b.vertexArrayOffset=this.centroidVertexArray.length;const U=b.borders,q=this.featuresOnBorder.push(b)-1;for(let V=0;V<4;V++)U[V][0]!==Number.MAX_VALUE&&this.borders[V].push(q)}this.encodeCentroid(b.borders?void 0:b.centroid(),b)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,c,u,s)}sortBorders(){for(let e=0;e<4;e++)this.borders[e].sort((i,n)=>this.featuresOnBorder[i].borders[e][0]-this.featuresOnBorder[n].borders[e][0])}encodeCentroid(e,i,n=!0){let s,c;if(e)if(e.y!==0){const p=i.span()._mult(this.tileToMeter);s=(Math.max(e.x,1)<<3)+Math.min(7,Math.round(p.x/10)),c=(Math.max(e.y,1)<<3)+Math.min(7,Math.round(p.y/10))}else s=Math.ceil(7*(e.x+450)),c=0;else s=0,c=+n;let u=n?this.centroidVertexArray.length:i.vertexArrayOffset;for(const p of i.polyCount){n&&this.centroidVertexArray.resize(this.centroidVertexArray.length+4*p.edges+p.top);for(let m=0;mi[1].x&&e.x>i[1].x||t.yi[1].y&&e.y>i[1].y}function up(t,e,i){if(t.x<0||t.x>=Ze||e.x<0||e.x>=Ze||i.x<0||i.x>=Ze)return!1;const n=i.sub(e),s=n.perp(),c=t.sub(e);return(n.x*c.x+n.y*c.y)/Math.sqrt((n.x*n.x+n.y*n.y)*(c.x*c.x+c.y*c.y))>-.866&&s.x*c.x+s.y*c.y<0}function dp(t,e,i){const n=e?2|t:-3&t;return i?1|n:-2&n}function pp(){const t=Math.PI/32,e=Math.tan(t),i=Pl;return i*Math.sqrt(1+2*e*e)-i}function fp(t,e,i){const n=1<{for(const se of W)M.push({polygon:se,bounds:ce})},D=Math.ceil(Math.log2(x)),U=Math.ceil(Math.log2(b)),q=D-U,V=[];for(let W=0;W0?0:1);for(let W=0;Wce+1?X.push({polygons:be,bounds:pe,depth:ce+1}):C(be,pe)}if(Ce.length){const pe=[new Le(se===0?xe:me.x,se===1?xe:me.y),Ee];V.length>ce+1?X.push({polygons:Ce,bounds:pe,depth:ce+1}):C(Ce,pe)}}return M}(t,e,Math.ceil((c-s)/11.25),Math.ceil((u-p)/11.25),1,(m,_,x)=>{if(m===0)return .5*(_+x);{const b=bi((i.y+_/Ze)/n);return(rn(.5*(bi((i.y+x/Ze)/n)+b))*n-i.y)*Ze}})}Ue(Fl,"FillExtrusionBucket",{omit:["layers","features"]}),Ue(ap,"PartMetadata");const Ym=new j({"fill-extrusion-edge-radius":new I(fe["layout_fill-extrusion"]["fill-extrusion-edge-radius"])});var Jm={paint:new j({"fill-extrusion-opacity":new I(fe["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new L(fe["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new I(fe["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new I(fe["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new L(fe["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new L(fe["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new L(fe["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new I(fe["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]),"fill-extrusion-ambient-occlusion-intensity":new I(fe["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-intensity"]),"fill-extrusion-ambient-occlusion-radius":new I(fe["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-radius"]),"fill-extrusion-rounded-roof":new I(fe["paint_fill-extrusion"]["fill-extrusion-rounded-roof"])}),layout:Ym};function mp(t,e,i){var n=2*Math.PI*6378137/256/Math.pow(2,i);return[t*n-2*Math.PI*6378137/2,e*n-2*Math.PI*6378137/2]}class ah{constructor(e,i,n){this.z=e,this.x=i,this.y=n,this.key=Ul(0,e,e,i,n)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,i){const n=function(c,u,p){var m=mp(256*c,256*(u=Math.pow(2,p)-u-1),p),_=mp(256*(c+1),256*(u+1),p);return m[0]+","+m[1]+","+_[0]+","+_[1]}(this.x,this.y,this.z),s=function(c,u,p){let m,_="";for(let x=c;x>0;x--)m=1<this.canonical.z?new Pi(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Pi(e,this.wrap,e,this.canonical.x>>i,this.canonical.y>>i)}calculateScaledKey(e,i=!0){if(this.overscaledZ===e&&i)return this.key;if(e>this.canonical.z)return Ul(this.wrap*+i,e,this.canonical.z,this.canonical.x,this.canonical.y);{const n=this.canonical.z-e;return Ul(this.wrap*+i,e,e,this.canonical.x>>n,this.canonical.y>>n)}}isChildOf(e){if(e.wrap!==this.wrap)return!1;const i=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ>i&&e.canonical.y===this.canonical.y>>i}children(e){if(this.overscaledZ>=e)return[new Pi(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const i=this.canonical.z+1,n=2*this.canonical.x,s=2*this.canonical.y;return[new Pi(i,this.wrap,i,n,s),new Pi(i,this.wrap,i,n+1,s),new Pi(i,this.wrap,i,n,s+1),new Pi(i,this.wrap,i,n+1,s+1)]}isLessThan(e){return this.wrape.wrap)&&(this.overscaledZe.overscaledZ)&&(this.canonical.xe.canonical.x)&&this.canonical.yi.id),this.index=e.index,this.projection=e.projection,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(i=>{this.gradients[i.id]={}}),this.layoutVertexArray=new he,this.layoutVertexArray2=new we,this.indexArray=new je,this.programConfigurations=new ns(e.layers,e.zoom),this.segments=new Yt,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id)}populate(e,i,n,s){this.hasPattern=Au("line",this.layers,i);const c=this.layers[0].layout.get("line-sort-key"),u=[];for(const{feature:x,id:b,index:w,sourceLayerIndex:S}of e){const M=this.layers[0]._featureFilter.needGeometry,C=hs(x,M);if(!this.layers[0]._featureFilter.filter(new v(this.zoom),C,n))continue;const D=c?c.evaluate(C,{},n):void 0,U={id:b,properties:x.properties,type:x.type,sourceLayerIndex:S,index:w,geometry:M?C.geometry:Pn(x,n,s),patterns:{},sortKey:D};u.push(U)}c&&u.sort((x,b)=>x.sortKey-b.sortKey);const{lineAtlas:p,featureIndex:m}=i,_=this.addConstantDashes(p);for(const x of u){const{geometry:b,index:w,sourceLayerIndex:S}=x;if(_&&this.addFeatureDashes(x,p),this.hasPattern){const M=Iu("line",this.layers,x,this.zoom,i);this.patternFeatures.push(M)}else this.addFeature(x,b,w,n,p.positions,i.availableImages);m.insert(e[w].feature,b,w,S,this.index)}}addConstantDashes(e){let i=!1;for(const n of this.layers){const s=n.paint.get("line-dasharray").value,c=n.layout.get("line-cap").value;if(s.kind!=="constant"||c.kind!=="constant")i=!0;else{const u=c.value,p=s.value;if(!p)continue;e.addDash(p,u)}}return i}addFeatureDashes(e,i){const n=this.zoom;for(const s of this.layers){const c=s.paint.get("line-dasharray").value,u=s.layout.get("line-cap").value;if(c.kind==="constant"&&u.kind==="constant")continue;let p,m;if(c.kind==="constant"){if(p=c.value,!p)continue}else p=c.evaluate({zoom:n},e);m=u.kind==="constant"?u.value:u.evaluate({zoom:n},e),i.addDash(p,m),e.patterns[s.id]=i.getKey(p,m)}}update(e,i,n,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,n,s)}addFeatures(e,i,n,s,c){for(const u of this.patternFeatures)this.addFeature(u,u.geometry,u.index,i,n,s)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,i_)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,e_),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,i,n,s,c,u){const p=this.layers[0].layout,m=p.get("line-join").evaluate(e,{}),_=p.get("line-cap").evaluate(e,{}),x=p.get("line-miter-limit"),b=p.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const w of i)this.addLine(w,e,m,_,x,b);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,c,u,s)}addLine(e,i,n,s,c,u){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineSoFar=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let U=0;U=2&&e[m-1].equals(e[m-2]);)m--;let _=0;for(;_0;if(ce&&U>_){const ue=w.dist(S);if(ue>2*x){const ye=w.sub(w.sub(S)._mult(x/ue)._round());this.updateDistance(S,ye),this.addCurrentVertex(ye,C,0,0,b),S=ye}}const me=S&&M;let Ee=me?n:p?"butt":s;if(me&&Ee==="round"&&(Xc&&(Ee="bevel"),Ee==="bevel"&&(X>2&&(Ee="flipbevel"),X100)q=D.mult(-1);else{const ue=X*C.add(D).mag()/C.sub(D).mag();q._perp()._mult(ue*(se?-1:1))}this.addCurrentVertex(w,q,0,0,b),this.addCurrentVertex(w,q.mult(-1),0,0,b)}else if(Ee==="bevel"||Ee==="fakeround"){const ue=-Math.sqrt(X*X-1),ye=se?ue:0,xe=se?0:ue;if(S&&this.addCurrentVertex(w,C,ye,xe,b),Ee==="fakeround"){const be=Math.round(180*W/Math.PI/20);for(let Ce=1;Ce2*x){const ye=w.add(M.sub(w)._mult(x/ue)._round());this.updateDistance(w,ye),this.addCurrentVertex(ye,D,0,0,b),w=ye}}}}addCurrentVertex(e,i,n,s,c,u=!1){const p=i.y*s-i.x,m=-i.y-i.x*s;this.addHalfVertex(e,i.x+i.y*n,i.y-i.x*n,u,!1,n,c),this.addHalfVertex(e,p,m,u,!0,-s,c)}addHalfVertex({x:e,y:i},n,s,c,u,p,m){this.layoutVertexArray.emplaceBack((e<<1)+(c?1:0),(i<<1)+(u?1:0),Math.round(63*n)+128,Math.round(63*s)+128,1+(p===0?0:p<0?-1:1),0,this.lineSoFar),this.lineClips&&this.layoutVertexArray2.emplaceBack(this.scaledDistance,this.lineClipsArray.length,this.lineClips.start,this.lineClips.end);const _=m.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,_),m.primitiveLength++),u?this.e2=_:this.e1=_}updateScaledDistance(){if(this.lineClips){const e=this.totalDistance/(this.lineClips.end-this.lineClips.start);this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=e*this.lineClips.start+this.distance}else this.lineSoFar=this.distance}updateDistance(e,i){this.distance+=e.dist(i),this.updateScaledDistance()}}Ue(lh,"LineBucket",{omit:["layers","patternFeatures"]});const o_=new j({"line-cap":new L(fe.layout_line["line-cap"]),"line-join":new L(fe.layout_line["line-join"]),"line-miter-limit":new I(fe.layout_line["line-miter-limit"]),"line-round-limit":new I(fe.layout_line["line-round-limit"]),"line-sort-key":new L(fe.layout_line["line-sort-key"])});var xp={paint:new j({"line-opacity":new L(fe.paint_line["line-opacity"]),"line-color":new L(fe.paint_line["line-color"]),"line-translate":new I(fe.paint_line["line-translate"]),"line-translate-anchor":new I(fe.paint_line["line-translate-anchor"]),"line-width":new L(fe.paint_line["line-width"]),"line-gap-width":new L(fe.paint_line["line-gap-width"]),"line-offset":new L(fe.paint_line["line-offset"]),"line-blur":new L(fe.paint_line["line-blur"]),"line-dasharray":new L(fe.paint_line["line-dasharray"]),"line-pattern":new L(fe.paint_line["line-pattern"]),"line-gradient":new N(fe.paint_line["line-gradient"]),"line-trim-offset":new I(fe.paint_line["line-trim-offset"])}),layout:o_};const vp=new class extends L{possiblyEvaluate(t,e){return e=new v(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,transition:e.transition}),super.possiblyEvaluate(t,e)}evaluate(t,e,i,n){return e=Wt({},e,{zoom:Math.floor(e.zoom)}),super.evaluate(t,e,i,n)}}(xp.paint.properties["line-width"].specification);function bp(t,e){return e>0?e+2*t:t}vp.useIntegerZoom=!0;const s_=te([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_tex_size",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),a_=te([{name:"a_globe_anchor",components:3,type:"Int16"},{name:"a_globe_normal",components:3,type:"Float32"}],4),l_=te([{name:"a_projected_pos",components:4,type:"Float32"}],4);te([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const c_=te([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]),h_=te([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"}]);te([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"tileAnchorX"},{type:"Int16",name:"tileAnchorY"},{type:"Float32",name:"x1"},{type:"Float32",name:"y1"},{type:"Float32",name:"x2"},{type:"Float32",name:"y2"},{type:"Int16",name:"padding"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const wp=te([{name:"a_pos",components:3,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),u_=te([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);te([{name:"triangle",components:3,type:"Uint16"}]),te([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{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"},{type:"Uint8",name:"flipState"}]),te([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{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",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),te([{type:"Float32",name:"offsetX"}]),te([{type:"Int16",name:"x"},{type:"Int16",name:"y"}]);var mi=24;const Vr=128;function zu(t,e){const{expression:i}=e;if(i.kind==="constant")return{kind:"constant",layoutSize:i.evaluate(new v(t+1))};if(i.kind==="source")return{kind:"source"};{const{zoomStops:n,interpolationType:s}=i;let c=0;for(;c{n.text=function(s,c,u){const p=c.layout.get("text-transform").evaluate(u,{});return p==="uppercase"?s=s.toLocaleUpperCase():p==="lowercase"&&(s=s.toLocaleLowerCase()),y.applyArabicShaping&&(s=y.applyArabicShaping(s)),s}(n.text,e,i)}),t}const Nl={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂","←":"↑","→":"↓"};function f_(t){return t==="︶"||t==="﹈"||t==="︸"||t==="﹄"||t==="﹂"||t==="︾"||t==="︼"||t==="︺"||t==="︘"||t==="﹀"||t==="︐"||t==="︓"||t==="︔"||t==="`"||t===" ̄"||t==="︑"||t==="︒"}function m_(t){return t==="︵"||t==="﹇"||t==="︷"||t==="﹃"||t==="﹁"||t==="︽"||t==="︻"||t==="︹"||t==="︗"||t==="︿"}var Tp=Pt,Ep=function(t,e,i,n,s){var c,u,p=8*s-n-1,m=(1<>1,x=-7,b=i?s-1:0,w=i?-1:1,S=t[e+b];for(b+=w,c=S&(1<<-x)-1,S>>=-x,x+=p;x>0;c=256*c+t[e+b],b+=w,x-=8);for(u=c&(1<<-x)-1,c>>=-x,x+=n;x>0;u=256*u+t[e+b],b+=w,x-=8);if(c===0)c=1-_;else{if(c===m)return u?NaN:1/0*(S?-1:1);u+=Math.pow(2,n),c-=_}return(S?-1:1)*u*Math.pow(2,c-n)},Sp=function(t,e,i,n,s,c){var u,p,m,_=8*c-s-1,x=(1<<_)-1,b=x>>1,w=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=n?0:c-1,M=n?1:-1,C=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(p=isNaN(e)?1:0,u=x):(u=Math.floor(Math.log(e)/Math.LN2),e*(m=Math.pow(2,-u))<1&&(u--,m*=2),(e+=u+b>=1?w/m:w*Math.pow(2,1-b))*m>=2&&(u++,m/=2),u+b>=x?(p=0,u=x):u+b>=1?(p=(e*m-1)*Math.pow(2,s),u+=b):(p=e*Math.pow(2,b-1)*Math.pow(2,s),u=0));s>=8;t[i+S]=255&p,S+=M,p/=256,s-=8);for(u=u<0;t[i+S]=255&u,S+=M,u/=256,_-=8);t[i+S-M]|=128*C};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */function Pt(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Pt.Varint=0,Pt.Fixed64=1,Pt.Bytes=2,Pt.Fixed32=5;var Pu=4294967296,Mp=1/Pu,Ap=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function Dn(t){return t.type===Pt.Bytes?t.readVarint()+t.pos:t.pos+1}function ua(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Ip(t,e,i){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(n);for(var s=i.pos-1;s>=t;s--)i.buf[s+n]=i.buf[s]}function __(t,e){for(var i=0;i>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function Cp(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}Pt.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos>3,c=this.pos;this.type=7&n,t(s,e,this),this.pos===c&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=hh(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Cp(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=hh(this.buf,this.pos)+hh(this.buf,this.pos+4)*Pu;return this.pos+=8,t},readSFixed64:function(){var t=hh(this.buf,this.pos)+Cp(this.buf,this.pos+4)*Pu;return this.pos+=8,t},readFloat:function(){var t=Ep(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Ep(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,n=this.buf;return e=127&(i=n[this.pos++]),i<128?e:(e|=(127&(i=n[this.pos++]))<<7,i<128?e:(e|=(127&(i=n[this.pos++]))<<14,i<128?e:(e|=(127&(i=n[this.pos++]))<<21,i<128?e:function(s,c,u){var p,m,_=u.buf;if(p=(112&(m=_[u.pos++]))>>4,m<128||(p|=(127&(m=_[u.pos++]))<<3,m<128)||(p|=(127&(m=_[u.pos++]))<<10,m<128)||(p|=(127&(m=_[u.pos++]))<<17,m<128)||(p|=(127&(m=_[u.pos++]))<<24,m<128)||(p|=(1&(m=_[u.pos++]))<<31,m<128))return ua(s,p,c);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&Ap?function(i,n,s){return Ap.decode(i.subarray(n,s))}(this.buf,e,t):function(i,n,s){for(var c="",u=n;u239?4:x>223?3:x>191?2:1;if(u+w>s)break;w===1?x<128&&(b=x):w===2?(192&(p=i[u+1]))==128&&(b=(31&x)<<6|63&p)<=127&&(b=null):w===3?(m=i[u+2],(192&(p=i[u+1]))==128&&(192&m)==128&&((b=(15&x)<<12|(63&p)<<6|63&m)<=2047||b>=55296&&b<=57343)&&(b=null)):w===4&&(m=i[u+2],_=i[u+3],(192&(p=i[u+1]))==128&&(192&m)==128&&(192&_)==128&&((b=(15&x)<<18|(63&p)<<12|(63&m)<<6|63&_)<=65535||b>=1114112)&&(b=null)),b===null?(b=65533,w=1):b>65535&&(b-=65536,c+=String.fromCharCode(b>>>10&1023|55296),b=56320|1023&b),c+=String.fromCharCode(b),u+=w}return c}(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!==Pt.Bytes)return t.push(this.readVarint(e));var i=Dn(this);for(t=t||[];this.pos127;);else if(e===Pt.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Pt.Fixed32)this.pos+=4;else{if(e!==Pt.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;e268435455||t<0?function(e,i){var n,s;if(e>=0?(n=e%4294967296|0,s=e/4294967296|0):(s=~(-e/4294967296),4294967295^(n=~(-e%4294967296))?n=n+1|0:(n=0,s=s+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");i.realloc(10),function(c,u,p){p.buf[p.pos++]=127&c|128,c>>>=7,p.buf[p.pos++]=127&c|128,c>>>=7,p.buf[p.pos++]=127&c|128,c>>>=7,p.buf[p.pos++]=127&c|128,p.buf[p.pos]=127&(c>>>=7)}(n,0,i),function(c,u){var p=(7&c)<<4;u.buf[u.pos++]|=p|((c>>>=3)?128:0),c&&(u.buf[u.pos++]=127&c|((c>>>=7)?128:0),c&&(u.buf[u.pos++]=127&c|((c>>>=7)?128:0),c&&(u.buf[u.pos++]=127&c|((c>>>=7)?128:0),c&&(u.buf[u.pos++]=127&c|((c>>>=7)?128:0),c&&(u.buf[u.pos++]=127&c)))))}(s,i)}(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(!!t)},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(n,s,c){for(var u,p,m=0;m55295&&u<57344){if(!p){u>56319||m+1===s.length?(n[c++]=239,n[c++]=191,n[c++]=189):p=u;continue}if(u<56320){n[c++]=239,n[c++]=191,n[c++]=189,p=u;continue}u=p-55296<<10|u-56320|65536,p=null}else p&&(n[c++]=239,n[c++]=191,n[c++]=189,p=null);u<128?n[c++]=u:(u<2048?n[c++]=u>>6|192:(u<65536?n[c++]=u>>12|224:(n[c++]=u>>18|240,n[c++]=u>>12&63|128),n[c++]=u>>6&63|128),n[c++]=63&u|128)}return c}(this.buf,t,this.pos);var i=this.pos-e;i>=128&&Ip(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),Sp(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Sp(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=128&&Ip(i,n,this),this.pos=i-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,i){this.writeTag(t,Pt.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,__,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,g_,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,v_,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,y_,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,x_,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,b_,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,w_,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,T_,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,E_,e)},writeBytesField:function(t,e){this.writeTag(t,Pt.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Pt.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Pt.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Pt.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Pt.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Pt.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Pt.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Pt.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Pt.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Pt.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,!!e)}};var uh=Yi(Tp);const ku=3;function S_(t,e,i){e.glyphs=[],t===1&&i.readMessage(M_,e)}function M_(t,e,i){if(t===3){const{id:n,bitmap:s,width:c,height:u,left:p,top:m,advance:_}=i.readMessage(A_,{});e.glyphs.push({id:n,bitmap:new kn({width:c+2*ku,height:u+2*ku},s),metrics:{width:c,height:u,left:p,top:m,advance:_}})}else t===4?e.ascender=i.readSVarint():t===5&&(e.descender=i.readSVarint())}function A_(t,e,i){t===1?e.id=i.readVarint():t===2?e.bitmap=i.readBytes():t===3?e.width=i.readVarint():t===4?e.height=i.readVarint():t===5?e.left=i.readSVarint():t===6?e.top=i.readSVarint():t===7&&(e.advance=i.readVarint())}const zp=ku;function Du(t){let e=0,i=0;for(const u of t)e+=u.w*u.h,i=Math.max(i,u.w);t.sort((u,p)=>p.h-u.h);const n=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),i),h:1/0}];let s=0,c=0;for(const u of t)for(let p=n.length-1;p>=0;p--){const m=n[p];if(!(u.w>m.w||u.h>m.h)){if(u.x=m.x,u.y=m.y,c=Math.max(c,u.y+u.h),s=Math.max(s,u.x+u.w),u.w===m.w&&u.h===m.h){const _=n.pop();pe.hasImage(n)),e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const n in e.updatedImages)this.patchUpdatedImage(this.iconPositions[n],e.getImage(n),i),this.patchUpdatedImage(this.patternPositions[n],e.getImage(n),i)}patchUpdatedImage(e,i,n){if(!e||!i||e.version===i.version)return;e.version=i.version;const[s,c]=e.tl;n.update(i.data,void 0,{x:s,y:c})}}Ue(Lu,"ImagePosition"),Ue(Pp,"ImageAtlas");const or={horizontal:1,vertical:2,horizontalOnly:3},kp=-17;class jl{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(e,i){const n=new jl;return n.scale=e||1,n.fontStack=i,n}static forImage(e){const i=new jl;return i.imageName=e,i}}class pa{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,i){const n=new pa;for(let s=0;s=0&&n>=e&&dh[this.text.charCodeAt(n)];n--)i--;this.text=this.text.substring(e,i),this.sectionIndex=this.sectionIndex.slice(e,i)}substring(e,i){const n=new pa;return n.text=this.text.substring(e,i),n.sectionIndex=this.sectionIndex.slice(e,i),n.sections=this.sections,n}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,i)=>Math.max(e,this.sections[i].scale),0)}addTextSection(e,i){this.text+=e.text,this.sections.push(jl.forText(e.scale,e.fontStack||i));const n=this.sections.length-1;for(let s=0;s=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Ru(t,e,i,n,s,c,u,p,m,_,x,b,w,S,M){const C=pa.fromFeature(t,s);b===or.vertical&&C.verticalizePunctuation(w);let D=[];const U=function(W,ce,se,me,Ee,ue){if(!W)return[];const ye=[],xe=function(De,Ne,Re,He,ze,$e){let Ke=0;for(let gt=0;gt=0;let Ce=0;for(let De=0;De0&&Gr>Ct&&(Ct=Gr)}else{const Di=se[ni.fontStack];if(!Di)continue;Di[jt]&&(Lt=Di[jt]);const pi=ce[ni.fontStack];if(!pi)continue;const Gr=pi.glyphs[jt];if(!Gr)continue;if(ti=Gr.metrics,ii=jt!==8203?mi:0,$e){const va=pi.ascender!==void 0?Math.abs(pi.ascender):0,Jl=pi.descender!==void 0?Math.abs(pi.descender):0,Ql=(va+Jl)*xt;Nt-i/2;){if(u--,u<0)return!1;p-=t[u].dist(c),c=t[u]}p+=t[u].dist(t[u+1]),u++;const m=[];let _=0;for(;pn;)_-=m.shift().angleDelta;if(_>s)return!1;u++,p+=x.dist(b)}return!0}function Vp(t){let e=0;for(let i=0;i_){const M=(_-m)/S,C=mt(b.x,w.x,M),D=mt(b.y,w.y,M),U=new Ln(C,D,0,w.angleTo(b),x);return!u||Up(t,U,p,u,e)?U:void 0}m+=S}}function k_(t,e,i,n,s,c,u,p,m){const _=Np(n,c,u),x=jp(n,s),b=x*u,w=t[0].x===0||t[0].x===m||t[0].y===0||t[0].y===m;return e-b=0&&$=0&&X=0&&w+_<=x){const W=new Ln($,X,0,q,M);W._round(),n&&!Up(t,W,c,n,s)||S.push(W)}}b+=U}return p||S.length||u||(S=Gp(t,b/2,i,n,s,c,u,!0,m)),S}function $p(t,e,i,n,s){const c=[];for(let u=0;u=n&&b.x>=n||(x.x>=n?x=new Le(n,x.y+(n-x.x)/(b.x-x.x)*(b.y-x.y))._round():b.x>=n&&(b=new Le(n,x.y+(n-x.x)/(b.x-x.x)*(b.y-x.y))._round()),x.y>=s&&b.y>=s||(x.y>=s?x=new Le(x.x+(s-x.y)/(b.y-x.y)*(b.x-x.x),s)._round():b.y>=s&&(b=new Le(x.x+(s-x.y)/(b.y-x.y)*(b.x-x.x),s)._round()),m&&x.equals(m[m.length-1])||(m=[x],c.push(m)),m.push(b)))))}}return c}Ue(Ln,"Anchor");const Gl=1e20;function Zp(t,e,i,n,s,c,u,p,m){for(let _=e;_-1);m++,c[m]=p,u[m]=_,u[m+1]=Gl}for(let p=0,m=0;p{let p=this.entries[s];p||(p=this.entries[s]={glyphs:{},requests:{},ranges:{},ascender:void 0,descender:void 0});let m=p.glyphs[c];if(m!==void 0)return void u(null,{stack:s,id:c,glyph:m});if(m=this._tinySDF(p,s,c),m)return p.glyphs[c]=m,void u(null,{stack:s,id:c,glyph:m});const _=Math.floor(c/256);if(256*_>65535)return void u(new Error("glyphs > 65535 not supported"));if(p.ranges[_])return void u(null,{stack:s,id:c,glyph:m});let x=p.requests[_];x||(x=p.requests[_]=[],fa.loadGlyphRange(s,_,this.url,this.requestManager,(b,w)=>{if(w){p.ascender=w.ascender,p.descender=w.descender;for(const S in w.glyphs)this._doesCharSupportLocalGlyph(+S)||(p.glyphs[+S]=w.glyphs[+S]);p.ranges[_]=!0}for(const S of x)S(b,w);delete p.requests[_]})),x.push((b,w)=>{b?u(b):w&&u(null,{stack:s,id:c,glyph:w.glyphs[c]||null})})},(s,c)=>{if(s)i(s);else if(c){const u={};for(const{stack:p,id:m,glyph:_}of c)u[p]===void 0&&(u[p]={}),u[p].glyphs===void 0&&(u[p].glyphs={}),u[p].glyphs[m]=_&&{id:_.id,bitmap:_.bitmap.clone(),metrics:_.metrics},u[p].ascender=this.entries[p].ascender,u[p].descender=this.entries[p].descender;i(null,u)}})}_doesCharSupportLocalGlyph(e){return this.localGlyphMode!==Ou.none&&(this.localGlyphMode===Ou.all?!!this.localFontFamily:!!this.localFontFamily&&(Be["CJK Unified Ideographs"](e)||Be["Hangul Syllables"](e)||Be.Hiragana(e)||Be.Katakana(e)||Be["CJK Symbols and Punctuation"](e)))}_tinySDF(e,i,n){const s=this.localFontFamily;if(!s||!this._doesCharSupportLocalGlyph(n))return;let c=e.tinySDF;if(!c){let C="400";/bold/i.test(i)?C="900":/medium/i.test(i)?C="500":/light/i.test(i)&&(C="200"),c=e.tinySDF=new fa.TinySDF({fontFamily:s,fontWeight:C,fontSize:24*Nr,buffer:3*Nr,radius:8*Nr}),c.fontWeight=C}if(this.localGlyphs[c.fontWeight][n])return this.localGlyphs[c.fontWeight][n];const u=String.fromCharCode(n),{data:p,width:m,height:_,glyphWidth:x,glyphHeight:b,glyphLeft:w,glyphTop:S,glyphAdvance:M}=c.draw(u);return this.localGlyphs[c.fontWeight][n]={id:n,bitmap:new kn({width:m,height:_},p),metrics:{width:x/Nr,height:b/Nr,left:w/Nr,top:S/Nr-27,advance:M/Nr,localGlyph:!0}}}}fa.loadGlyphRange=function(t,e,i,n,s){const c=256*e,u=c+255,p=n.transformRequest(n.normalizeGlyphsURL(i).replace("{fontstack}",t).replace("{range}",`${c}-${u}`),fn.Glyphs);$n(p,(m,_)=>{if(m)s(m);else if(_){const x={},b=function(w){return new uh(w).readFields(S_,{})}(_);for(const w of b.glyphs)x[w.id]=w;s(null,{glyphs:x,ascender:b.ascender,descender:b.descender})}})},fa.TinySDF=class{constructor({fontSize:t=24,buffer:e=3,radius:i=8,cutoff:n=.25,fontFamily:s="sans-serif",fontWeight:c="normal",fontStyle:u="normal"}={}){this.buffer=e,this.cutoff=n,this.radius=i;const p=this.size=t+4*e,m=this._createCanvas(p),_=this.ctx=m.getContext("2d",{willReadFrequently:!0});_.font=`${u} ${c} ${t}px ${s}`,_.textBaseline="alphabetic",_.textAlign="left",_.fillStyle="black",this.gridOuter=new Float64Array(p*p),this.gridInner=new Float64Array(p*p),this.f=new Float64Array(p),this.z=new Float64Array(p+1),this.v=new Uint16Array(p)}_createCanvas(t){const e=document.createElement("canvas");return e.width=e.height=t,e}draw(t){const{width:e,actualBoundingBoxAscent:i,actualBoundingBoxDescent:n,actualBoundingBoxLeft:s,actualBoundingBoxRight:c}=this.ctx.measureText(t),u=Math.ceil(i),p=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(c-s))),m=Math.min(this.size-this.buffer,u+Math.ceil(n)),_=p+2*this.buffer,x=m+2*this.buffer,b=Math.max(_*x,0),w=new Uint8ClampedArray(b),S={data:w,width:_,height:x,glyphWidth:p,glyphHeight:m,glyphTop:u,glyphLeft:0,glyphAdvance:e};if(p===0||m===0)return S;const{ctx:M,buffer:C,gridInner:D,gridOuter:U}=this;M.clearRect(C,C,p,m),M.fillText(t,C,C+u);const q=M.getImageData(C,C,p,m);U.fill(Gl,0,b),D.fill(0,0,b);for(let V=0;V0?ce*ce:0,D[W]=ce<0?ce*ce:0}}Zp(U,0,0,_,x,_,this.f,this.v,this.z),Zp(D,C,C,p,m,_,this.f,this.v,this.z);for(let V=0;Vue+ye[1]-ye[0],M=b.reduce(S,0),C=w.reduce(S,0),D=p-M,U=m-C;let q=0,V=M,$=0,X=C,W=0,ce=D,se=0,me=U;if(c.content&&n){const ue=c.content;q=ph(b,0,ue[0]),$=ph(w,0,ue[1]),V=ph(b,ue[0],ue[2]),X=ph(w,ue[1],ue[3]),W=ue[0]-q,se=ue[1]-$,ce=ue[2]-ue[0]-V,me=ue[3]-ue[1]-X}const Ee=(ue,ye,xe,be)=>{const Ce=fh(ue.stretch-q,V,_,t.left),pe=mh(ue.fixed-W,ce,ue.stretch,M),De=fh(ye.stretch-$,X,x,t.top),Ne=mh(ye.fixed-se,me,ye.stretch,C),Re=fh(xe.stretch-q,V,_,t.left),He=mh(xe.fixed-W,ce,xe.stretch,M),ze=fh(be.stretch-$,X,x,t.top),$e=mh(be.fixed-se,me,be.stretch,C),Ke=new Le(Ce,De),gt=new Le(Re,De),Ye=new Le(Re,ze),We=new Le(Ce,ze),Rt=new Le(pe/u,Ne/u),et=new Le(He/u,$e/u),tt=e*Math.PI/180;if(tt){const Dt=Math.sin(tt),Ct=Math.cos(tt),Nt=[Ct,-Dt,Dt,Ct];Ke._matMult(Nt),gt._matMult(Nt),We._matMult(Nt),Ye._matMult(Nt)}const It=ue.stretch+ue.fixed,kt=ye.stretch+ye.fixed;return{tl:Ke,tr:gt,bl:We,br:Ye,tex:{x:c.paddedRect.x+ma+It,y:c.paddedRect.y+ma+kt,w:xe.stretch+xe.fixed-It,h:be.stretch+be.fixed-kt},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Rt,pixelOffsetBR:et,minFontScaleX:ce/u/_,minFontScaleY:me/u/x,isSDF:i}};if(n&&(c.stretchX||c.stretchY)){const ue=Xp(b,D,M),ye=Xp(w,U,C);for(let xe=0;xe0)for(let n=(this.length>>1)-1;n>=0;n--)this._down(n)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const e=this.data[0],i=this.data.pop();return this.length--,this.length>0&&(this.data[0]=i,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:i,compare:n}=this,s=i[e];for(;e>0;){const c=e-1>>1,u=i[c];if(n(s,u)>=0)break;i[e]=u,e=c}i[e]=s}_down(e){const{data:i,compare:n}=this,s=this.length>>1,c=i[e];for(;e=0)break;i[e]=p,e=u}i[e]=c}}function R_(t,e){return te?1:0}function B_(t,e=1,i=!1){let n=1/0,s=1/0,c=-1/0,u=-1/0;const p=t[0];for(let S=0;Sc)&&(c=M.x),(!S||M.y>u)&&(u=M.y)}const m=Math.min(c-n,u-s);let _=m/2;const x=new L_([],O_);if(m===0)return new Le(n,s);for(let S=n;Sb.d||!b.d)&&(b=S,i&&console.log("found best %d after %d probes",Math.round(1e4*S.d)/1e4,w)),S.max-b.d<=e||(_=S.h/2,x.push(new _a(S.p.x-_,S.p.y-_,_,t)),x.push(new _a(S.p.x+_,S.p.y-_,_,t)),x.push(new _a(S.p.x-_,S.p.y+_,_,t)),x.push(new _a(S.p.x+_,S.p.y+_,_,t)),w+=4)}return i&&(console.log(`num probes: ${w}`),console.log(`best distance: ${b.d}`)),b.p}function O_(t,e){return e.max-t.max}class _a{constructor(e,i,n,s){this.p=new Le(e,i),this.h=n,this.d=function(c,u){let p=!1,m=1/0;for(let _=0;_c.y!=C.y>c.y&&c.x<(C.x-M.x)*(c.y-M.y)/(C.y-M.y)+M.x&&(p=!p),m=Math.min(m,Gd(c,M,C))}}return(p?1:-1)*Math.sqrt(m)}(this.p,s),this.max=this.d+this.h*Math.SQRT2}}const ga=7,Fu=Number.POSITIVE_INFINITY,F_=Math.sqrt(2);function Hp(t,[e,i]){let n=0,s=0;if(i===Fu){e<0&&(e=0);const c=e/F_;switch(t){case"top-right":case"top-left":s=c-ga;break;case"bottom-right":case"bottom-left":s=-c+ga;break;case"bottom":s=-e+ga;break;case"top":s=e-ga}switch(t){case"top-right":case"bottom-right":n=-c;break;case"top-left":case"bottom-left":n=c;break;case"left":n=e;break;case"right":n=-e}}else{switch(e=Math.abs(e),i=Math.abs(i),t){case"top-right":case"top-left":case"top":s=i-ga;break;case"bottom-right":case"bottom-left":case"bottom":s=-i+ga}switch(t){case"top-right":case"bottom-right":case"right":n=-e;break;case"top-left":case"bottom-left":case"left":n=e}}return[n,s]}function U_(t,e,i,n,s,c,u,p,m,_){t.createArrays(),t.tilePixelRatio=Ze/(512*t.overscaling),t.compareText={},t.iconsNeedLinear=!1;const x=t.layers[0].layout,b=t.layers[0]._unevaluatedLayout._values,w={};if(t.textSizeData.kind==="composite"){const{minZoom:C,maxZoom:D}=t.textSizeData;w.compositeTextSizes=[b["text-size"].possiblyEvaluate(new v(C),p),b["text-size"].possiblyEvaluate(new v(D),p)]}if(t.iconSizeData.kind==="composite"){const{minZoom:C,maxZoom:D}=t.iconSizeData;w.compositeIconSizes=[b["icon-size"].possiblyEvaluate(new v(C),p),b["icon-size"].possiblyEvaluate(new v(D),p)]}w.layoutTextSize=b["text-size"].possiblyEvaluate(new v(m+1),p),w.layoutIconSize=b["icon-size"].possiblyEvaluate(new v(m+1),p),w.textMaxSize=b["text-size"].possiblyEvaluate(new v(18),p);const S=x.get("text-rotation-alignment")==="map"&&x.get("symbol-placement")!=="point",M=x.get("text-size");for(const C of t.features){const D=x.get("text-font").evaluate(C,{},p).join(","),U=M.evaluate(C,{},p),q=w.layoutTextSize.evaluate(C,{},p),V=(w.layoutIconSize.evaluate(C,{},p),{horizontal:{},vertical:void 0}),$=C.text;let X,W=[0,0];if($){const me=$.toString(),Ee=x.get("text-letter-spacing").evaluate(C,{},p)*mi,ue=x.get("text-line-height").evaluate(C,{},p)*mi,ye=Wh(me)?Ee:0,xe=x.get("text-anchor").evaluate(C,{},p),be=x.get("text-variable-anchor");if(!be){const Re=x.get("text-radial-offset").evaluate(C,{},p);W=Re?Hp(xe,[Re*mi,Fu]):x.get("text-offset").evaluate(C,{},p).map(He=>He*mi)}let Ce=S?"center":x.get("text-justify").evaluate(C,{},p);const pe=x.get("symbol-placement")==="point",De=pe?x.get("text-max-width").evaluate(C,{},p)*mi:1/0,Ne=Re=>{t.allowVerticalPlacement&&fl(me)&&(V.vertical=Ru($,e,i,s,D,De,ue,xe,Re,ye,W,or.vertical,!0,q,U))};if(!S&&be){const Re=Ce==="auto"?be.map(ze=>Uu(ze)):[Ce];let He=!1;for(let ze=0;ze=0||!fl(me)){const Re=Ru($,e,i,s,D,De,ue,xe,Ce,ye,W,or.horizontal,!1,q,U);Re&&(V.horizontal[Ce]=Re)}Ne(pe?"left":Ce)}}let ce=!1;if(C.icon&&C.icon.name){const me=n[C.icon.name];me&&(X=z_(s[C.icon.name],x.get("icon-offset").evaluate(C,{},p),x.get("icon-anchor").evaluate(C,{},p)),ce=me.sdf,t.sdfIcons===void 0?t.sdfIcons=me.sdf:t.sdfIcons!==me.sdf&&Ut("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(me.pixelRatio!==t.pixelRatio||x.get("icon-rotate").constantOr(1)!==0)&&(t.iconsNeedLinear=!0))}const se=Yp(V.horizontal)||V.vertical;t.iconsInText||(t.iconsInText=!!se&&se.iconsInText),(se||X)&&V_(t,C,V,X,n,w,q,0,W,ce,u,p,_)}c&&t.generateCollisionDebugBuffers(m,t.collisionBoxArray)}function Uu(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 V_(t,e,i,n,s,c,u,p,m,_,x,b,w){let S=c.textMaxSize.evaluate(e,{},b);S===void 0&&(S=u);const M=t.layers[0].layout,C=M.get("icon-offset").evaluate(e,{},b),D=Yp(i.horizontal)||i.vertical,U=w.name==="globe",q=mi,V=u/q,$=t.tilePixelRatio*S/q,X=(xe=t.overscaling,t.zoom>18&&xe>2&&(xe>>=1),Math.max(Ze/(512*xe),1)*M.get("symbol-spacing")),W=M.get("text-padding")*t.tilePixelRatio,ce=M.get("icon-padding")*t.tilePixelRatio,se=dt(M.get("text-max-angle")),me=M.get("text-rotation-alignment")==="map"&&M.get("symbol-placement")!=="point",Ee=M.get("icon-rotation-alignment")==="map"&&M.get("symbol-placement")!=="point",ue=M.get("symbol-placement"),ye=X/2;var xe;const be=M.get("icon-text-fit");let Ce;n&&be!=="none"&&(t.allowVerticalPlacement&&i.vertical&&(Ce=Fp(n,i.vertical,be,M.get("icon-text-fit-padding"),C,V)),D&&(n=Fp(n,D,be,M.get("icon-text-fit-padding"),C,V)));const pe=(De,Ne,Re)=>{if(Ne.x<0||Ne.x>=Ze||Ne.y<0||Ne.y>=Ze)return;let He=null;if(U){const{x:ze,y:$e,z:Ke}=w.projectTilePoint(Ne.x,Ne.y,Re);He={anchor:new Ln(ze,$e,Ke,0,void 0),up:w.upVector(Re,Ne.x,Ne.y)}}(function(ze,$e,Ke,gt,Ye,We,Rt,et,tt,It,kt,Dt,Ct,Nt,$t,Qt,zt,ni,ei,jt,xt,ti,Lt,ki,ii){const _i=ze.addToLineVertexArray($e,gt);let di,Di,pi,Gr,va,Jl,Ql,Pf=0,kf=0,Df=0,Lf=0,ed=-1,td=-1;const an={};let Rf=Kh("");const ms=Ke?Ke.anchor:$e;let id=0,rd=0;if(tt._unevaluatedLayout.getValue("text-radial-offset")===void 0?[id,rd]=tt.layout.get("text-offset").evaluate(xt,{},ii).map(Xi=>Xi*mi):(id=tt.layout.get("text-radial-offset").evaluate(xt,{},ii)*mi,rd=Fu),ze.allowVerticalPlacement&&Ye.vertical){const Xi=Ye.vertical;if($t)Jl=Vu(Xi),et&&(Ql=Vu(et));else{const Hi=tt.layout.get("text-rotate").evaluate(xt,{},ii)+90;pi=_h(It,ms,$e,kt,Dt,Ct,Xi,Nt,Hi,Qt),et&&(Gr=_h(It,ms,$e,kt,Dt,Ct,et,ni,Hi))}}if(We){const Xi=tt.layout.get("icon-rotate").evaluate(xt,{},ii),Hi=tt.layout.get("icon-text-fit")!=="none",ec=Wp(We,Xi,Lt,Hi),od=et?Wp(et,Xi,Lt,Hi):void 0;Di=_h(It,ms,$e,kt,Dt,Ct,We,ni,Xi),Pf=4*ec.length;const Bf=ze.iconSizeData;let _s=null;Bf.kind==="source"?(_s=[Vr*tt.layout.get("icon-size").evaluate(xt,{},ii)],_s[0]>mo&&Ut(`${ze.layerIds[0]}: Value for "icon-size" is >= ${$l}. Reduce your "icon-size".`)):Bf.kind==="composite"&&(_s=[Vr*ti.compositeIconSizes[0].evaluate(xt,{},ii),Vr*ti.compositeIconSizes[1].evaluate(xt,{},ii)],(_s[0]>mo||_s[1]>mo)&&Ut(`${ze.layerIds[0]}: Value for "icon-size" is >= ${$l}. Reduce your "icon-size".`)),ze.addSymbols(ze.icon,ec,_s,jt,ei,xt,!1,Ke,$e,_i.lineStartIndex,_i.lineLength,-1,ki,ii),ed=ze.icon.placedSymbolArray.length-1,od&&(kf=4*od.length,ze.addSymbols(ze.icon,od,_s,jt,ei,xt,or.vertical,Ke,$e,_i.lineStartIndex,_i.lineLength,-1,ki,ii),td=ze.icon.placedSymbolArray.length-1)}for(const Xi in Ye.horizontal){const Hi=Ye.horizontal[Xi];di||(Rf=Kh(Hi.text),$t?va=Vu(Hi):di=_h(It,ms,$e,kt,Dt,Ct,Hi,Nt,tt.layout.get("text-rotate").evaluate(xt,{},ii),Qt));const ec=Hi.positionedLines.length===1;if(Df+=Kp(ze,Ke,$e,Hi,Rt,tt,$t,xt,Qt,_i,Ye.vertical?or.horizontal:or.horizontalOnly,ec?Object.keys(Ye.horizontal):[Xi],an,ed,ti,ki,ii),ec)break}Ye.vertical&&(Lf+=Kp(ze,Ke,$e,Ye.vertical,Rt,tt,$t,xt,Qt,_i,or.vertical,["vertical"],an,td,ti,ki,ii));let bo=-1;const nd=(Xi,Hi)=>Xi?Math.max(Xi,Hi):Hi;bo=nd(va,bo),bo=nd(Jl,bo),bo=nd(Ql,bo);const fg=bo>-1?1:0;ze.glyphOffsetArray.length>=go.MAX_GLYPHS&&Ut("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),xt.sortKey!==void 0&&ze.addToSortKeyRanges(ze.symbolInstances.length,xt.sortKey),ze.symbolInstances.emplaceBack(ms.x,ms.y,ms.z,$e.x,$e.y,an.right>=0?an.right:-1,an.center>=0?an.center:-1,an.left>=0?an.left:-1,an.vertical>=0?an.vertical:-1,ed,td,Rf,di!==void 0?di:ze.collisionBoxArray.length,di!==void 0?di+1:ze.collisionBoxArray.length,pi!==void 0?pi:ze.collisionBoxArray.length,pi!==void 0?pi+1:ze.collisionBoxArray.length,Di!==void 0?Di:ze.collisionBoxArray.length,Di!==void 0?Di+1:ze.collisionBoxArray.length,Gr||ze.collisionBoxArray.length,Gr?Gr+1:ze.collisionBoxArray.length,kt,Df,Lf,Pf,kf,fg,0,id,rd,bo)})(t,Ne,He,De,i,n,s,Ce,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,W,me,m,0,ce,Ee,C,e,c,_,x,b)};if(ue==="line")for(const De of $p(e.geometry,0,0,Ze,Ze)){const Ne=k_(De,X,se,i.vertical||D,n,q,$,t.overscaling,Ze);for(const Re of Ne)D&&N_(t,D.text,ye,Re)||pe(De,Re,b)}else if(ue==="line-center"){for(const De of e.geometry)if(De.length>1){const Ne=P_(De,se,i.vertical||D,n,q,$);Ne&&pe(De,Ne,b)}}else if(e.type==="Polygon")for(const De of Mu(e.geometry,0)){const Ne=B_(De,16);pe(De[0],new Ln(Ne.x,Ne.y,0,0,void 0),b)}else if(e.type==="LineString")for(const De of e.geometry)pe(De,new Ln(De[0].x,De[0].y,0,0,void 0),b);else if(e.type==="Point")for(const De of e.geometry)for(const Ne of De)pe([Ne],new Ln(Ne.x,Ne.y,0,0,void 0),b)}const $l=255,mo=$l*Vr;function Kp(t,e,i,n,s,c,u,p,m,_,x,b,w,S,M,C,D){const U=function($,X,W,ce,se,me,Ee,ue){const ye=[];if(X.positionedLines.length===0)return ye;const xe=ce.layout.get("text-rotate").evaluate(me,{})*Math.PI/180,be=function(Re){const He=Re[0],ze=Re[1],$e=He*ze;return $e>0?[He,-ze]:$e<0?[-He,ze]:He===0?[ze,He]:[ze,-He]}(W);let Ce=Math.abs(X.top-X.bottom);for(const Re of X.positionedLines)Ce-=Re.lineOffset;const pe=X.positionedLines.length,De=Ce/pe;let Ne=X.top-W[1];for(let Re=0;Remo&&Ut(`${t.layerIds[0]}: Value for "text-size" is >= ${$l}. Reduce your "text-size".`)):q.kind==="composite"&&(V=[Vr*M.compositeTextSizes[0].evaluate(p,{},D),Vr*M.compositeTextSizes[1].evaluate(p,{},D)],(V[0]>mo||V[1]>mo)&&Ut(`${t.layerIds[0]}: Value for "text-size" is >= ${$l}. Reduce your "text-size".`)),t.addSymbols(t.text,U,V,m,u,p,x,e,i,_.lineStartIndex,_.lineLength,S,C,D);for(const $ of b)w[$]=t.text.placedSymbolArray.length-1;return 4*U.length}function Yp(t){for(const e in t)return t[e];return null}function _h(t,e,i,n,s,c,u,p,m,_){let x=u.top,b=u.bottom,w=u.left,S=u.right;const M=u.collisionPadding;if(M&&(w-=M[0],x-=M[1],S+=M[2],b+=M[3]),m){const C=new Le(w,x),D=new Le(S,x),U=new Le(w,b),q=new Le(S,b),V=dt(m);let $=new Le(0,0);_&&($=new Le(_[0],_[1])),C._rotateAround(V,$),D._rotateAround(V,$),U._rotateAround(V,$),q._rotateAround(V,$),w=Math.min(C.x,D.x,U.x,q.x),S=Math.max(C.x,D.x,U.x,q.x),x=Math.min(C.y,D.y,U.y,q.y),b=Math.max(C.y,D.y,U.y,q.y)}return t.emplaceBack(e.x,e.y,e.z,i.x,i.y,w,x,S,b,p,n,s,c),t.length-1}function Vu(t){t.collisionPadding&&(t.top-=t.collisionPadding[1],t.bottom+=t.collisionPadding[3]);const e=t.bottom-t.top;return e>0?Math.max(10,e):null}function N_(t,e,i,n){const s=t.compareText;if(e in s){const c=s[e];for(let u=c.length-1;u>=0;u--)if(n.dist(c[u])V&&($(W,be,se,me,ye,xe),$(be,ce,ye,xe,Ee,ue))}$(b,w,n,c,s,c),$(w,S,s,c,s,u),$(S,M,s,u,n,u),$(M,b,n,u,n,c),C-=V,D-=V,U+=V,q+=V;const X=1/Math.max(U-C,q-D);return{scale:X,x:C*X,y:D*X,x2:U*X,y2:q*X,projection:e}}const j_=Or(new Float32Array(16));class _o{constructor(e){this.spec=e,this.name=e.name,this.wrap=!1,this.requiresDraping=!1,this.supportsWorldCopies=!1,this.supportsTerrain=!1,this.supportsFog=!1,this.supportsFreeCamera=!1,this.zAxisUnit="meters",this.isReprojectedInTileSpace=!0,this.unsupportedLayers=["custom"],this.center=[0,0],this.range=[3.5,7]}project(e,i){return{x:0,y:0,z:0}}unproject(e,i){return new At(0,0)}projectTilePoint(e,i,n){return{x:e,y:i,z:0}}locationPoint(e,i,n=!0){return e._coordinatePoint(e.locationCoordinate(i),n)}pixelsPerMeter(e,i){return Ur(1,e)*i}pixelSpaceConversion(e,i,n){return 1}farthestPixelDistance(e){return Jp(e,e.pixelsPerMeter)}pointCoordinate(e,i,n,s){const c=e.horizonLineFromTop(!1),u=new Le(i,Math.max(c,n));return e.rayIntersectionCoordinate(e.pointRayIntersection(u,s))}pointCoordinate3D(e,i,n){const s=new Le(i,n);if(e.elevation)return e.elevation.pointCoordinate(s);{const c=this.pointCoordinate(e,s.x,s.y,0);return[c.x,c.y,c.z]}}isPointAboveHorizon(e,i){if(e.elevation)return!this.pointCoordinate3D(e,i.x,i.y);const n=e.horizonLineFromTop();return i.y0?i<-ya+n&&(i=-ya+n):i>ya-n&&(i=ya-n);const u=c/Math.pow(yh(i),s);let p=u*Math.sin(s*e),m=c-u*Math.cos(s*e);return p=.5*(p/Math.PI+.5),m=.5*(m/Math.PI+.5),{x:p,y:this.southernCenter?m:1-m,z:0}}unproject(e,i){e=(2*e-.5)*Math.PI,this.southernCenter&&(i=1-i),i=(2*(1-i)-.5)*Math.PI;const{n,f:s}=this,c=s-i,u=Math.sign(c),p=Math.sign(n)*Math.sqrt(e*e+c*c);let m=Math.atan2(e,Math.abs(c))*u;c*n<0&&(m-=Math.PI*Math.sign(e)*u);const _=ct(si(m/n)+this.center[0],-180,180),x=ct(si(2*Math.atan(Math.pow(s/p,1/n))-ya),-wi,wi);return new At(_,this.southernCenter?-x:x)}}class Qp extends _o{constructor(e){super(e),this.wrap=!0,this.supportsWorldCopies=!0,this.supportsTerrain=!0,this.supportsFog=!0,this.supportsFreeCamera=!0,this.isReprojectedInTileSpace=!1,this.unsupportedLayers=[],this.range=null}project(e,i){return{x:tn(e),y:rn(i),z:0}}unproject(e,i){const n=nr(e),s=bi(i);return new At(n,s)}}const ef=dt(wi);class W_ extends _o{project(e,i){const n=(i=dt(i))*i,s=n*n;return{x:.5*((e=dt(e))*(.8707-.131979*n+s*(s*(.003971*n-.001529*s)-.013791))/Math.PI+.5),y:1-.5*(i*(1.007226+n*(.015085+s*(.028874*n-.044475-.005916*s)))/Math.PI+1),z:0}}unproject(e,i){e=(2*e-.5)*Math.PI;let n=i=(2*(1-i)-1)*Math.PI,s=25,c=0,u=n*n;do{u=n*n;const _=u*u;c=(n*(1.007226+u*(.015085+_*(.028874*u-.044475-.005916*_)))-i)/(1.007226+u*(.045255+_*(.259866*u-.311325-.005916*11*_))),n=ct(n-c,-ef,ef)}while(Math.abs(c)>1e-6&&--s>0);u=n*n;const p=ct(si(e/(.8707+u*(u*(u*u*u*(.003971-.001529*u)-.013791)-.131979))),-180,180),m=si(n);return new At(p,m)}}const tf=dt(wi);class X_ extends _o{project(e,i){i=dt(i),e=dt(e);const n=Math.cos(i),s=2/Math.PI,c=Math.acos(n*Math.cos(e/2)),u=Math.sin(c)/c,p=.5*(e*s+2*n*Math.sin(e/2)/u)||0,m=.5*(i+Math.sin(i)/u)||0;return{x:.5*(p/Math.PI+.5),y:1-.5*(m/Math.PI+1),z:0}}unproject(e,i){let n=e=(2*e-.5)*Math.PI,s=i=(2*(1-i)-1)*Math.PI,c=25;const u=1e-6;let p=0,m=0;do{const _=Math.cos(s),x=Math.sin(s),b=2*x*_,w=x*x,S=_*_,M=Math.cos(n/2),C=Math.sin(n/2),D=2*M*C,U=C*C,q=1-S*M*M,V=q?1/q:0,$=q?Math.acos(_*M)*Math.sqrt(1/q):0,X=.5*(2*$*_*C+2*n/Math.PI)-e,W=.5*($*x+s)-i,ce=.5*V*(S*U+$*_*M*w)+1/Math.PI,se=V*(D*b/4-$*x*C),me=.125*V*(b*C-$*x*S*D),Ee=.5*V*(w*M+$*U*_)+.5,ue=se*me-Ee*ce;p=(W*se-X*Ee)/ue,m=(X*me-W*ce)/ue,n=ct(n-p,-Math.PI,Math.PI),s=ct(s-m,-tf,tf)}while((Math.abs(p)>u||Math.abs(m)>u)&&--c>0);return new At(si(n),si(s))}}class rf extends _o{constructor(e){super(e),this.center=e.center||[0,0],this.parallels=e.parallels||[0,0],this.cosPhi=Math.max(.01,Math.cos(dt(this.parallels[0]))),this.scale=1/(2*Math.max(Math.PI*this.cosPhi,1/this.cosPhi)),this.wrap=!0,this.supportsWorldCopies=!0}project(e,i){const{scale:n,cosPhi:s}=this;return{x:dt(e)*s*n+.5,y:-Math.sin(dt(i))/s*n+.5,z:0}}unproject(e,i){const{scale:n,cosPhi:s}=this,c=-(i-.5)/n,u=ct(si((e-.5)/n)/s,-180,180),p=Math.asin(ct(c*s,-1,1)),m=ct(si(p),-wi,wi);return new At(u,m)}}class H_ extends Qp{constructor(e){super(e),this.requiresDraping=!0,this.supportsWorldCopies=!1,this.supportsFog=!0,this.zAxisUnit="pixels",this.unsupportedLayers=["debug"],this.range=[3,5]}projectTilePoint(e,i,n){const s=Cl(e,i,n);return qt(s,s,zl(en(n))),{x:s[0],y:s[1],z:s[2]}}locationPoint(e,i){const n=ra(i.lat,i.lng),s=Ci([],n),c=e.elevation?e.elevation.getAtPointOrZero(e.locationCoordinate(i),e._centerAltitude):e._centerAltitude;Sl(n,n,s,Ur(1,0)*Ze*c);const u=Or(new Float64Array(16));return os(u,e.pixelMatrix,e.globeMatrix),qt(n,n,u),new Le(n[0],n[1])}pixelsPerMeter(e,i){return Ur(1,0)*i}pixelSpaceConversion(e,i,n){const s=Ur(1,e)*i,c=mt(Ur(1,45)*i,s,n);return this.pixelsPerMeter(e,i)/c}createTileMatrix(e,i,n){const s=hu(en(n.canonical));return os(new Float64Array(16),e.globeMatrix,s)}createInversionMatrix(e,i){const{center:n}=e,s=zl(en(i));return qc(s,s,dt(n.lng)),eu(s,s,dt(n.lat)),ss(s,s,[e._pixelsPerMercatorPixel,e._pixelsPerMercatorPixel,1]),Float32Array.from(s)}pointCoordinate(e,i,n,s){return Cd(e,i,n,!0)||new oa(0,0)}pointCoordinate3D(e,i,n){const s=this.pointCoordinate(e,i,n,0);return[s.x,s.y,s.z]}isPointAboveHorizon(e,i){return!Cd(e,i.x,i.y,!1)}farthestPixelDistance(e){const i=function(s,c){const u=s.cameraToCenterDistance,p=s._centerAltitude*c,m=s._camera,_=s._camera.forward(),x=zn([],rr([],_,-u),[0,0,p]),b=s.worldSize/(2*Math.PI),w=[0,0,-b],S=s.width/s.height,M=Math.tan(s.fovAboveCenter),C=rr([],m.up(),M),D=rr([],m.right(),M*S),U=Ci([],zn([],zn([],_,C),D)),q=[];let V;if(new nu(x,U).closestPointOnSphere(w,b,q)){const $=zn([],q,w),X=Fr([],$,x);V=Math.cos(s.fovAboveCenter)*wl(X)}else{const $=Fr([],x,w),X=Fr([],w,x);Ci(X,X);const W=wl($)-b;V=Math.sqrt(W*(W+2*b));const ce=Math.acos(V/(b+W))-Math.acos(pr(_,X));V*=Math.cos(ce)}return 1.01*V}(e,this.pixelsPerMeter(e.center.lat,e.worldSize)),n=na(e.zoom);if(n>0){const s=Jp(e,Ur(1,e.center.lat)*e.worldSize),c=e.worldSize/(2*Math.PI),u=Math.max(e.width,e.height)/e.worldSize*Math.PI;return mt(i,s+c*(1-Math.cos(u)),Math.pow(n,10))}return i}upVector(e,i,n){return Cl(i,n,e,1)}upVectorScale(e){return{metersToTile:Wc(Hc(en(e)))}}}function nf(t){const e=t.parallels,i=!!e&&Math.abs(e[0]+e[1])<.01;switch(t.name){case"mercator":return new Qp(t);case"equirectangular":return new Z_(t);case"naturalEarth":return new W_(t);case"equalEarth":return new $_(t);case"winkelTripel":return new X_(t);case"albers":return i?new rf(t):new G_(t);case"lambertConformalConic":return i?new rf(t):new q_(t);case"globe":return new H_(t)}throw new Error(`Invalid projection name: ${t.name}`)}const K_=oh.types,Y_=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function xh(t,e,i,n,s,c,u,p,m,_,x,b,w){const S=p?Math.min(mo,Math.round(p[0])):0,M=p?Math.min(mo,Math.round(p[1])):0;t.emplaceBack(e,i,Math.round(32*n),Math.round(32*s),c,u,(S<<1)+(m?1:0),M,16*_,16*x,256*b,256*w)}function vh(t,e,i,n,s,c,u){t.emplaceBack(e,i,n,s,c,u)}function bh(t,e,i,n,s){t.emplaceBack(e,i,n,s),t.emplaceBack(e,i,n,s),t.emplaceBack(e,i,n,s),t.emplaceBack(e,i,n,s)}function J_(t){for(const e of t.sections)if(Hh(e.text))return!0;return!1}class Nu{constructor(e){this.layoutVertexArray=new ve,this.indexArray=new je,this.programConfigurations=e,this.segments=new Yt,this.dynamicLayoutVertexArray=new we,this.opacityVertexArray=new Ge,this.placedSymbolArray=new Kt,this.globeExtVertexArray=new Ae}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(e,i,n,s){this.isEmpty()||(n&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,s_.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,i),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,l_.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,Y_,!0),this.globeExtVertexArray.length>0&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,a_.members,!0)),this.opacityVertexBuffer.itemSize=1),(n||s)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}}Ue(Nu,"SymbolBuffers");class ju{constructor(e,i,n){this.layoutVertexArray=new e,this.layoutAttributes=i,this.indexArray=new n,this.segments=new Yt,this.collisionVertexArray=new lt,this.collisionVertexArrayExt=new ot}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,c_.members,!0),this.collisionVertexBufferExt=e.createVertexBuffer(this.collisionVertexArrayExt,h_.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy(),this.collisionVertexBufferExt.destroy())}}Ue(ju,"CollisionBuffers");class go{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(u=>u.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.fullyClipped=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Or([]),this.placementViewportMatrix=Or([]);const i=this.layers[0]._unevaluatedLayout._values;this.textSizeData=zu(this.zoom,i["text-size"]),this.iconSizeData=zu(this.zoom,i["icon-size"]);const n=this.layers[0].layout,s=n.get("symbol-sort-key"),c=n.get("symbol-z-order");this.canOverlap=n.get("text-allow-overlap")||n.get("icon-allow-overlap")||n.get("text-ignore-placement")||n.get("icon-ignore-placement"),this.sortFeaturesByKey=c!=="viewport-y"&&s.constantOr(1)!==void 0,this.sortFeaturesByY=(c==="viewport-y"||c==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,this.writingModes=n.get("text-writing-mode").map(u=>or[u]),this.stateDependentLayerIds=this.layers.filter(u=>u.isStateDependent()).map(u=>u.id),this.sourceID=e.sourceID,this.projection=e.projection}createArrays(){this.text=new Nu(new ns(this.layers,this.zoom,e=>/^text/.test(e))),this.icon=new Nu(new ns(this.layers,this.zoom,e=>/^icon/.test(e))),this.glyphOffsetArray=new Ii,this.lineVertexArray=new Js,this.symbolInstances=new Bt}calculateGlyphDependencies(e,i,n,s,c){for(let u=0;u0)&&(m.value.kind!=="constant"||m.value.value.length>0),w=x.value.kind!=="constant"||!!x.value.value||Object.keys(x.parameters).length>0,S=u.get("symbol-sort-key");if(this.features=[],!b&&!w)return;const M=i.iconDependencies,C=i.glyphDependencies,D=i.availableImages,U=new v(this.zoom);for(const{feature:q,id:V,index:$,sourceLayerIndex:X}of e){const W=c._featureFilter.needGeometry,ce=hs(q,W);if(!c._featureFilter.filter(U,ce,n))continue;if(W||(ce.geometry=Pn(q,n,s)),p&&q.type!==1&&n.z<=5){const ue=ce.geometry,ye=.98078528056,xe=(be,Ce)=>pr(Cl(be.x,be.y,n,1),Cl(Ce.x,Ce.y,n,1))=0;for(const xe of se.sections)if(xe.image)M[xe.image.name]=!0;else{const be=fl(se.toString()),Ce=xe.fontStack||ue,pe=C[Ce]=C[Ce]||{};this.calculateGlyphDependencies(xe.text,pe,ye,this.allowVerticalPlacement,be)}}}u.get("symbol-placement")==="line"&&(this.features=function(q){const V={},$={},X=[];let W=0;function ce(ue){X.push(q[ue]),W++}function se(ue,ye,xe){const be=$[ue];return delete $[ue],$[ye]=be,X[be].geometry[0].pop(),X[be].geometry[0]=X[be].geometry[0].concat(xe[0]),be}function me(ue,ye,xe){const be=V[ye];return delete V[ye],V[ue]=be,X[be].geometry[0].shift(),X[be].geometry[0]=xe[0].concat(X[be].geometry[0]),be}function Ee(ue,ye,xe){const be=xe?ye[0][ye[0].length-1]:ye[0][0];return`${ue}:${be.x}:${be.y}`}for(let ue=0;ueue.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((q,V)=>q.sortKey-V.sortKey)}update(e,i,n,s){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,i,this.layers,n,s),this.icon.programConfigurations.updatePaintArrays(e,i,this.layers,n,s))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}getProjection(){return this.projectionInstance||(this.projectionInstance=nf(this.projection)),this.projectionInstance}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,i){const n=this.lineVertexArray.length;if(e.segment!==void 0)for(const{x:s,y:c}of i)this.lineVertexArray.emplaceBack(s,c);return{lineStartIndex:n,lineLength:this.lineVertexArray.length-n}}addSymbols(e,i,n,s,c,u,p,m,_,x,b,w,S,M){const C=e.indexArray,D=e.layoutVertexArray,U=e.globeExtVertexArray,q=e.segments.prepareSegment(4*i.length,D,C,this.canOverlap?u.sortKey:void 0),V=this.glyphOffsetArray.length,$=q.vertexLength,X=this.allowVerticalPlacement&&p===or.vertical?Math.PI/2:0,W=u.text&&u.text.sections;for(let se=0;se=0?i.rightJustifiedTextSymbolIndex:i.centerJustifiedTextSymbolIndex>=0?i.centerJustifiedTextSymbolIndex:i.leftJustifiedTextSymbolIndex>=0?i.leftJustifiedTextSymbolIndex:i.verticalPlacedTextSymbolIndex>=0?i.verticalPlacedTextSymbolIndex:s),u=ch(this.textSizeData,e,c)/mi;return this.tilePixelRatio*u}getSymbolInstanceIconSize(e,i,n){const s=this.icon.placedSymbolArray.get(n),c=ch(this.iconSizeData,e,s);return this.tilePixelRatio*c}_commitDebugCollisionVertexUpdate(e,i,n){e.emplaceBack(i,-n,-n),e.emplaceBack(i,n,-n),e.emplaceBack(i,n,n),e.emplaceBack(i,-n,n)}_updateTextDebugCollisionBoxes(e,i,n,s,c,u){for(let p=s;p0}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(e,i){const n=e.placedSymbolArray.get(i),s=n.vertexStartIndex+4*n.numGlyphs;for(let c=n.vertexStartIndex;cs[p]-s[m]||c[m]-c[p]),u}addToSortKeyRanges(e,i){const n=this.sortKeyRanges[this.sortKeyRanges.length-1];n&&n.sortKey===i?n.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:i,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const i of this.symbolInstanceIndexes){const n=this.symbolInstances.get(i);this.featureSortOrder.push(n.featureIndex);const{rightJustifiedTextSymbolIndex:s,centerJustifiedTextSymbolIndex:c,leftJustifiedTextSymbolIndex:u,verticalPlacedTextSymbolIndex:p,placedIconSymbolIndex:m,verticalPlacedIconSymbolIndex:_}=n;s>=0&&this.addIndicesForPlacedSymbol(this.text,s),c>=0&&c!==s&&this.addIndicesForPlacedSymbol(this.text,c),u>=0&&u!==c&&u!==s&&this.addIndicesForPlacedSymbol(this.text,u),p>=0&&this.addIndicesForPlacedSymbol(this.text,p),m>=0&&this.addIndicesForPlacedSymbol(this.icon,m),_>=0&&this.addIndicesForPlacedSymbol(this.icon,_)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}Ue(go,"SymbolBucket",{omit:["layers","collisionBoxArray","features","compareText"]}),go.MAX_GLYPHS=65535,go.addDynamicAttributes=bh;const Q_=new j({"symbol-placement":new I(fe.layout_symbol["symbol-placement"]),"symbol-spacing":new I(fe.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new I(fe.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new L(fe.layout_symbol["symbol-sort-key"]),"symbol-z-order":new I(fe.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new I(fe.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new I(fe.layout_symbol["icon-ignore-placement"]),"icon-optional":new I(fe.layout_symbol["icon-optional"]),"icon-rotation-alignment":new I(fe.layout_symbol["icon-rotation-alignment"]),"icon-size":new L(fe.layout_symbol["icon-size"]),"icon-text-fit":new I(fe.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new I(fe.layout_symbol["icon-text-fit-padding"]),"icon-image":new L(fe.layout_symbol["icon-image"]),"icon-rotate":new L(fe.layout_symbol["icon-rotate"]),"icon-padding":new I(fe.layout_symbol["icon-padding"]),"icon-keep-upright":new I(fe.layout_symbol["icon-keep-upright"]),"icon-offset":new L(fe.layout_symbol["icon-offset"]),"icon-anchor":new L(fe.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new I(fe.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new I(fe.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new I(fe.layout_symbol["text-rotation-alignment"]),"text-field":new L(fe.layout_symbol["text-field"]),"text-font":new L(fe.layout_symbol["text-font"]),"text-size":new L(fe.layout_symbol["text-size"]),"text-max-width":new L(fe.layout_symbol["text-max-width"]),"text-line-height":new L(fe.layout_symbol["text-line-height"]),"text-letter-spacing":new L(fe.layout_symbol["text-letter-spacing"]),"text-justify":new L(fe.layout_symbol["text-justify"]),"text-radial-offset":new L(fe.layout_symbol["text-radial-offset"]),"text-variable-anchor":new I(fe.layout_symbol["text-variable-anchor"]),"text-anchor":new L(fe.layout_symbol["text-anchor"]),"text-max-angle":new I(fe.layout_symbol["text-max-angle"]),"text-writing-mode":new I(fe.layout_symbol["text-writing-mode"]),"text-rotate":new L(fe.layout_symbol["text-rotate"]),"text-padding":new I(fe.layout_symbol["text-padding"]),"text-keep-upright":new I(fe.layout_symbol["text-keep-upright"]),"text-transform":new L(fe.layout_symbol["text-transform"]),"text-offset":new L(fe.layout_symbol["text-offset"]),"text-allow-overlap":new I(fe.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new I(fe.layout_symbol["text-ignore-placement"]),"text-optional":new I(fe.layout_symbol["text-optional"])});var Gu={paint:new j({"icon-opacity":new L(fe.paint_symbol["icon-opacity"]),"icon-color":new L(fe.paint_symbol["icon-color"]),"icon-halo-color":new L(fe.paint_symbol["icon-halo-color"]),"icon-halo-width":new L(fe.paint_symbol["icon-halo-width"]),"icon-halo-blur":new L(fe.paint_symbol["icon-halo-blur"]),"icon-translate":new I(fe.paint_symbol["icon-translate"]),"icon-translate-anchor":new I(fe.paint_symbol["icon-translate-anchor"]),"text-opacity":new L(fe.paint_symbol["text-opacity"]),"text-color":new L(fe.paint_symbol["text-color"],{runtimeType:Bi,getOverride:t=>t.textColor,hasOverride:t=>!!t.textColor}),"text-halo-color":new L(fe.paint_symbol["text-halo-color"]),"text-halo-width":new L(fe.paint_symbol["text-halo-width"]),"text-halo-blur":new L(fe.paint_symbol["text-halo-blur"]),"text-translate":new I(fe.paint_symbol["text-translate"]),"text-translate-anchor":new I(fe.paint_symbol["text-translate-anchor"])}),layout:Q_};class of{constructor(e){this.type=e.property.overrides?e.property.overrides.runtimeType:qn,this.defaultValue=e}evaluate(e){if(e.formattedSection){const i=this.defaultValue.property.overrides;if(i&&i.hasOverride(e.formattedSection))return i.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Ue(of,"FormatSectionOverride",{omit:["defaultValue"]});class wh extends Br{constructor(e){super(e,Gu)}recalculate(e,i){super.recalculate(e,i),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"));const n=this.layout.get("text-writing-mode");if(n){const s=[];for(const c of n)s.indexOf(c)<0&&s.push(c);this.layout._values["text-writing-mode"]=s}else this.layout._values["text-writing-mode"]=this.layout.get("symbol-placement")==="point"?["horizontal"]:["horizontal","vertical"];this._setPaintOverrides()}getValueAndResolveTokens(e,i,n,s){const c=this.layout.get(e).evaluate(i,{},n,s),u=this._unevaluatedLayout._values[e];return u.isDataDriven()||no(u.value)||!c?c:function(p,m){return m.replace(/{([^{}]+)}/g,(_,x)=>x in p?String(p[x]):"")}(i.properties,c)}createBucket(e){return new go(e)}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(const e of Gu.paint.overridableProperties){if(!wh.hasPaintOverride(this.layout,e))continue;const i=this.paint.get(e),n=new of(i),s=new $s(n,i.property.specification);let c=null;c=i.value.kind==="constant"||i.value.kind==="source"?new rl("source",s):new Ho("composite",s,i.value.zoomStops,i.value._interpolationType),this.paint._values[e]=new B(i.property,c,i.parameters)}}_handleOverridablePaintPropertyUpdate(e,i,n){return!(!this.layout||i.isDataDriven()||n.isDataDriven())&&wh.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,i){const n=e.get("text-field"),s=Gu.paint.properties[i];let c=!1;const u=p=>{for(const m of p)if(s.overrides&&s.overrides.hasOverride(m))return void(c=!0)};if(n.value.kind==="constant"&&n.value.value instanceof Ai)u(n.value.value.sections);else if(n.value.kind==="source"){const p=_=>{c||(_ instanceof xn&&Gt(_.value)===ko?u(_.value.sections):_ instanceof Kr?u(_.sections):_.eachChild(p))},m=n.value;m._styleExpression&&p(m._styleExpression.expression)}return c}getProgramConfiguration(e){return new uo(this,e)}}var eg={paint:new j({"background-color":new I(fe.paint_background["background-color"]),"background-pattern":new I(fe.paint_background["background-pattern"]),"background-opacity":new I(fe.paint_background["background-opacity"])})},tg={paint:new j({"raster-opacity":new I(fe.paint_raster["raster-opacity"]),"raster-hue-rotate":new I(fe.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new I(fe.paint_raster["raster-brightness-min"]),"raster-brightness-max":new I(fe.paint_raster["raster-brightness-max"]),"raster-saturation":new I(fe.paint_raster["raster-saturation"]),"raster-contrast":new I(fe.paint_raster["raster-contrast"]),"raster-resampling":new I(fe.paint_raster["raster-resampling"]),"raster-fade-duration":new I(fe.paint_raster["raster-fade-duration"])})};class ig extends Br{constructor(e){super(e,{}),this.implementation=e}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}isLayerDraped(){return this.implementation.renderToTile!==void 0}shouldRedrape(){return!!this.implementation.shouldRerenderTiles&&this.implementation.shouldRerenderTiles()}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){}onAdd(e){this.implementation.onAdd&&this.implementation.onAdd(e,e.painter.context.gl)}onRemove(e){this.implementation.onRemove&&this.implementation.onRemove(e,e.painter.context.gl)}}var rg={paint:new j({"sky-type":new I(fe.paint_sky["sky-type"]),"sky-atmosphere-sun":new I(fe.paint_sky["sky-atmosphere-sun"]),"sky-atmosphere-sun-intensity":new I(fe.paint_sky["sky-atmosphere-sun-intensity"]),"sky-gradient-center":new I(fe.paint_sky["sky-gradient-center"]),"sky-gradient-radius":new I(fe.paint_sky["sky-gradient-radius"]),"sky-gradient":new N(fe.paint_sky["sky-gradient"]),"sky-atmosphere-halo-color":new I(fe.paint_sky["sky-atmosphere-halo-color"]),"sky-atmosphere-color":new I(fe.paint_sky["sky-atmosphere-color"]),"sky-opacity":new I(fe.paint_sky["sky-opacity"])})};function $u(t,e,i){const n=[0,0,1],s=Td([]);return Sd(s,s,i?-dt(t)+Math.PI:dt(t)),Ed(s,s,-dt(e)),xd(n,n,s),Ci(n,n)}const ng={circle:class extends Br{constructor(t){super(t,mm)}createBucket(t){return new _u(t)}queryRadius(t){const e=t;return sa("circle-radius",this,e)+sa("circle-stroke-width",this,e)+Jc(this.paint.get("circle-translate"))}queryIntersectsFeature(t,e,i,n,s,c,u,p){const m=Wd(this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),c.angle,t.pixelToTileUnitsFactor),_=this.paint.get("circle-radius").evaluate(e,i)+this.paint.get("circle-stroke-width").evaluate(e,i);return Xd(t,n,c,u,p,this.paint.get("circle-pitch-alignment")==="map",this.paint.get("circle-pitch-scale")==="map",m,_)}getProgramIds(){return["circle"]}getProgramConfiguration(t){return new uo(this,t)}},heatmap:class extends Br{createBucket(t){return new Kd(t)}constructor(t){super(t,xm),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){t==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=vu({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(t){return sa("heatmap-radius",this,t)}queryIntersectsFeature(t,e,i,n,s,c,u,p){const m=this.paint.get("heatmap-radius").evaluate(e,i);return Xd(t,n,c,u,p,!0,!0,new Le(0,0),m)}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}getProgramIds(){return["heatmap","heatmapTexture"]}getProgramConfiguration(t){return new uo(this,t)}},hillshade:class extends Br{constructor(t){super(t,vm)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}getProgramIds(){return["hillshade","hillshadePrepare"]}},fill:class extends Br{constructor(t){super(t,Bm)}getProgramIds(){const t=this.paint.get("fill-pattern"),e=t&&t.constantOr(1),i=[e?"fillPattern":"fill"];return this.paint.get("fill-antialias")&&i.push(e&&!this.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline"),i}getProgramConfiguration(t){return new uo(this,t)}recalculate(t,e){super.recalculate(t,e);const i=this.paint._values["fill-outline-color"];i.value.kind==="constant"&&i.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(t){return new rh(t)}queryRadius(){return Jc(this.paint.get("fill-translate"))}queryIntersectsFeature(t,e,i,n,s,c){return!t.queryGeometry.isAboveHorizon&&jd(qd(t.tilespaceGeometry,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),c.angle,t.pixelToTileUnitsFactor),n)}isTileClipped(){return!0}},"fill-extrusion":class extends Br{constructor(t){super(t,Jm)}createBucket(t){return new Fl(t)}queryRadius(){return Jc(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}getProgramIds(){return[this.paint.get("fill-extrusion-pattern").constantOr(1)?"fillExtrusionPattern":"fillExtrusion"]}getProgramConfiguration(t){return new uo(this,t)}queryIntersectsFeature(t,e,i,n,s,c,u,p,m){const _=Wd(this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),c.angle,t.pixelToTileUnitsFactor),x=this.paint.get("fill-extrusion-height").evaluate(e,i),b=this.paint.get("fill-extrusion-base").evaluate(e,i),w=[0,0],S=p&&c.elevation,M=c.elevation?c.elevation.exaggeration():1,C=t.tile.getBucket(this);if(S&&C instanceof Fl){const $=C.centroidVertexArray,X=m+1;X<$.length&&(w[0]=$.geta_centroid_pos0(X),w[1]=$.geta_centroid_pos1(X))}if(w[0]===0&&w[1]===1)return!1;c.projection.name==="globe"&&(n=fp([n],[new Le(0,0),new Le(Ze,Ze)],t.tileID.canonical).map($=>$.polygon).flat());const D=S?p:null,[U,q]=function($,X,W,ce,se,me,Ee,ue,ye,xe,be){return $.projection.name==="globe"?function(Ce,pe,De,Ne,Re,He,ze,$e,Ke,gt,Ye){const We=[],Rt=[],et=Ce.projection.upVectorScale(Ye,Ce.center.lat,Ce.worldSize).metersToTile,tt=[0,0,0,1],It=[0,0,0,1],kt=(Ct,Nt,$t,Qt)=>{Ct[0]=Nt,Ct[1]=$t,Ct[2]=Qt,Ct[3]=1},Dt=pp();De>0&&(De+=Dt),Ne+=Dt;for(const Ct of pe){const Nt=[],$t=[];for(const Qt of Ct){const zt=Qt.x+Re.x,ni=Qt.y+Re.y,ei=Ce.projection.projectTilePoint(zt,ni,Ye),jt=Ce.projection.upVector(Ye,Qt.x,Qt.y);let xt=De,ti=Ne;if(ze){const Lt=yp(zt,ni,De,Ne,ze,$e,Ke,gt);xt+=Lt.base,ti+=Lt.top}De!==0?kt(tt,ei.x+jt[0]*et*xt,ei.y+jt[1]*et*xt,ei.z+jt[2]*et*xt):kt(tt,ei.x,ei.y,ei.z),kt(It,ei.x+jt[0]*et*ti,ei.y+jt[1]*et*ti,ei.z+jt[2]*et*ti),qt(tt,tt,He),qt(It,It,He),Nt.push(new ca(tt[0],tt[1],tt[2])),$t.push(new ca(It[0],It[1],It[2]))}We.push(Nt),Rt.push($t)}return[We,Rt]}($,X,W,ce,se,me,Ee,ue,ye,xe,be):Ee?function(Ce,pe,De,Ne,Re,He,ze,$e,Ke){const gt=[],Ye=[],We=[0,0,0,1];for(const Rt of Ce){const et=[],tt=[];for(const It of Rt){const kt=It.x+Ne.x,Dt=It.y+Ne.y,Ct=yp(kt,Dt,pe,De,He,ze,$e,Ke);We[0]=kt,We[1]=Dt,We[2]=Ct.base,We[3]=1,as(We,We,Re),We[3]=Math.max(We[3],1e-5);const Nt=new ca(We[0]/We[3],We[1]/We[3],We[2]/We[3]);We[0]=kt,We[1]=Dt,We[2]=Ct.top,We[3]=1,as(We,We,Re),We[3]=Math.max(We[3],1e-5);const $t=new ca(We[0]/We[3],We[1]/We[3],We[2]/We[3]);et.push(Nt),tt.push($t)}gt.push(et),Ye.push(tt)}return[gt,Ye]}(X,W,ce,se,me,Ee,ue,ye,xe):function(Ce,pe,De,Ne,Re){const He=[],ze=[],$e=Re[8]*pe,Ke=Re[9]*pe,gt=Re[10]*pe,Ye=Re[11]*pe,We=Re[8]*De,Rt=Re[9]*De,et=Re[10]*De,tt=Re[11]*De;for(const It of Ce){const kt=[],Dt=[];for(const Ct of It){const Nt=Ct.x+Ne.x,$t=Ct.y+Ne.y,Qt=Re[0]*Nt+Re[4]*$t+Re[12],zt=Re[1]*Nt+Re[5]*$t+Re[13],ni=Re[2]*Nt+Re[6]*$t+Re[14],ei=Re[3]*Nt+Re[7]*$t+Re[15],jt=Qt+$e,xt=zt+Ke,ti=ni+gt,Lt=Math.max(ei+Ye,1e-5),ki=Qt+We,ii=zt+Rt,_i=ni+et,di=Math.max(ei+tt,1e-5);kt.push(new ca(jt/Lt,xt/Lt,ti/Lt)),Dt.push(new ca(ki/di,ii/di,_i/di))}He.push(kt),ze.push(Dt)}return[He,ze]}(X,W,ce,se,me)}(c,n,b,x,_,u,D,w,M,c.center.lat,t.tileID.canonical),V=t.queryGeometry;return function($,X,W){let ce=1/0;jd(W,X)&&(ce=gp(W,X[0]));for(let se=0;se=3){for(let M=0;M{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){this._channel=void 0,this._callback=()=>{}}}class sg{constructor(){this.tasks={},this.taskQueue=[],dn(["process"],this),this.invoker=new og(this.process),this.nextId=0}add(e,i){const n=this.nextId++,s=function({type:c,isSymbolTile:u,zoom:p}){return p=p||0,c==="message"?0:c!=="maybePrepare"||u?c!=="parseTile"||u?c==="parseTile"&&u?300-p:c==="maybePrepare"&&u?400-p:500:200-p:100-p}(i);if(s===0){Tr();try{e()}finally{}return{cancel:()=>{}}}return this.tasks[n]={fn:e,metadata:i,priority:s,id:n},this.taskQueue.push(n),this.invoker.trigger(),{cancel:()=>{delete this.tasks[n]}}}process(){Tr();try{if(this.taskQueue=this.taskQueue.filter(n=>!!this.tasks[n]),!this.taskQueue.length)return;const e=this.pick();if(e===null)return;const i=this.tasks[e];if(delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),!i)return;i.fn()}finally{}}pick(){let e=null,i=1/0;for(let s=0;s>=1)>1;){const _=i+s>>1,x=n+c>>1;1&e?(s=i,c=n,i=u,n=p):(i=s,n=c,s=u,c=p),u=_,p=x}const m=4*t;yo[m+0]=i,yo[m+1]=n,yo[m+2]=s,yo[m+3]=c}const on=new Uint16Array(2178),xo=new Uint8Array(1089),Th=new Uint16Array(1089);function lf(t){return t===0?-.03125:t===32?.03125:0}var cf=te([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);const hf={type:2,extent:Ze,loadGeometry:()=>[[new Le(0,0),new Le(Ze+1,0),new Le(Ze+1,Ze+1),new Le(0,Ze+1),new Le(0,0)]]};class Zu{constructor(e,i,n,s,c){this.tileID=e,this.uid=Fn(),this.uses=0,this.tileSize=i,this.tileZoom=n,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.isRaster=c,this.expiredRequestCount=0,this.state="loading",s&&s.transform&&(this.projection=s.transform.projection)}registerFadeDuration(e){const i=e+this.timeAdded;ic.getLayer(_)).filter(Boolean);if(m.length!==0){p.layers=m,p.stateDependentLayerIds&&(p.stateDependentLayers=p.stateDependentLayerIds.map(_=>m.filter(x=>x.id===_)[0]));for(const _ of m)u[_.id]=p}}return u}(e.buckets,i.style),this.hasSymbolBuckets=!1;for(const s in this.buckets){const c=this.buckets[s];if(c instanceof go){if(this.hasSymbolBuckets=!0,!n)break;c.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const s in this.buckets){const c=this.buckets[s];if(c instanceof go&&c.hasRTLText){this.hasRTLText=!0,y.isLoading()||y.isLoaded()||f()!=="deferred"||g();break}}this.queryPadding=0;for(const s in this.buckets){const c=this.buckets[s];this.queryPadding=Math.max(this.queryPadding,i.style.getLayer(s).queryRadius(c))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage),e.lineAtlas&&(this.lineAtlas=e.lineAtlas)}else this.collisionBoxArray=new Mt}unloadVectorData(){if(this.hasData()){for(const e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.lineAtlasTexture&&this.lineAtlasTexture.destroy(),this._tileBoundsBuffer&&(this._tileBoundsBuffer.destroy(),this._tileBoundsIndexBuffer.destroy(),this._tileBoundsSegments.destroy(),this._tileBoundsBuffer=null),this._tileDebugBuffer&&(this._tileDebugBuffer.destroy(),this._tileDebugSegments.destroy(),this._tileDebugBuffer=null),this._tileDebugIndexBuffer&&(this._tileDebugIndexBuffer.destroy(),this._tileDebugIndexBuffer=null),this._globeTileDebugBorderBuffer&&(this._globeTileDebugBorderBuffer.destroy(),this._globeTileDebugBorderBuffer=null),this._tileDebugTextBuffer&&(this._tileDebugTextBuffer.destroy(),this._tileDebugTextSegments.destroy(),this._tileDebugTextIndexBuffer.destroy(),this._tileDebugTextBuffer=null),this._globeTileDebugTextBuffer&&(this._globeTileDebugTextBuffer.destroy(),this._globeTileDebugTextBuffer=null),this.latestFeatureIndex=null,this.state="unloaded"}}getBucket(e){return this.buckets[e.id]}upload(e){for(const n in this.buckets){const s=this.buckets[n];s.uploadPending()&&s.upload(e)}const i=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Hl(e,this.imageAtlas.image,i.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Hl(e,this.glyphAtlasImage,i.ALPHA),this.glyphAtlasImage=null),this.lineAtlas&&!this.lineAtlas.uploaded&&(this.lineAtlasTexture=new Hl(e,this.lineAtlas.image,i.ALPHA),this.lineAtlas.uploaded=!0)}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,i,n,s,c,u,p,m){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({tileResult:s,pixelPosMatrix:p,transform:u,params:c,tileTransform:this.tileTransform},e,i,n):{}}querySourceFeatures(e,i){const n=this.latestFeatureIndex;if(!n||!n.rawTileData)return;const s=n.loadVTLayers(),c=i?i.sourceLayer:"",u=s._geojsonTileLayer||s[c];if(!u)return;const p=Xs(i&&i.filter),{z:m,x:_,y:x}=this.tileID.canonical,b={z:m,x:_,y:x};for(let w=0;wn)s=!1;else if(i)if(this.expirationTime=0;D--){const U=4*D,q=yo[U+0],V=yo[U+1],$=yo[U+2],X=yo[U+3],W=q+$>>1,ce=V+X>>1,se=W+ce-V,me=ce+q-W,Ee=V*nn+q,ue=X*nn+$,ye=ce*nn+W,xe=Math.hypot((on[2*Ee+0]+on[2*ue+0])/2-on[2*ye+0],(on[2*Ee+1]+on[2*ue+1])/2-on[2*ye+1])>=16;xo[ye]=xo[ye]||(xe?1:0),D<1022&&(xo[ye]=xo[ye]||xo[(V+me>>1)*nn+(q+se>>1)]||xo[(X+me>>1)*nn+($+se>>1)])}const b=new ge,w=new je;let S=0;function M(D,U){const q=U*nn+D;return Th[q]===0&&(b.emplaceBack(on[2*q+0],on[2*q+1],D*Ze/_r,U*Ze/_r),Th[q]=++S),Th[q]-1}function C(D,U,q,V,$,X){const W=D+q>>1,ce=U+V>>1;if(Math.abs(D-$)+Math.abs(U-X)>1&&xo[ce*nn+W])C($,X,D,U,W,ce),C(q,V,$,X,W,ce);else{const se=M(D,U),me=M(q,V),Ee=M($,X);w.emplaceBack(se,me,Ee)}}return C(0,0,_r,_r,_r,0),C(_r,_r,0,0,0,_r),{vertices:b,indices:w}}(this.tileID.canonical,i);s=u.vertices,c=u.indices}else{s=new ge,c=new je;for(const{x:p,y:m}of n)s.emplaceBack(p,m,0,0);const u=Su(s.int16,void 0,4);for(let p=0;p0&&(p=Qh(new Float64Array(16),i.globeMatrix)),this._makeGlobeTileDebugBorderBuffer(e,s,i,c,p,u),this._makeGlobeTileDebugTextBuffer(e,s,i,c,p,u)}_globePoint(e,i,n,s,c,u,p){let m=Cl(e,i,n);if(u){const _=1<.5?S=-1:w<-.5&&(S=1);let M=(e/Ze+n.x)/_+S,C=(i/Ze+n.y)/_;M=(M-x)*s._pixelsPerMercatorPixel+x,C=(C-b)*s._pixelsPerMercatorPixel+b;const D=[M*s.worldSize,C*s.worldSize,0];qt(D,D,u),m=cs(m,D,p)}return qt(m,m,c)}_makeGlobeTileDebugBorderBuffer(e,i,n,s,c,u){const p=new Te,m=new Zi,_=new oe,x=(w,S,M,C,D)=>{const U=(M-w)/(D-1),q=(C-S)/(D-1),V=p.length;for(let $=0;$b*S+M;for(let S=0;Se[u])return null}else{const p=1/n[u];let m=(t[u]-i[u])*p,_=(e[u]-i[u])*p;if(m>_){const x=m;m=_,_=x}if(m>s&&(s=m),_c)return null}return s}function pf(t,e,i,n,s,c,u,p,m,_,x){const b=n-t,w=s-e,S=c-i,M=u-t,C=p-e,D=m-i,U=x[1]*D-x[2]*C,q=x[2]*M-x[0]*D,V=x[0]*C-x[1]*M,$=b*U+w*q+S*V;if(Math.abs($)<1e-15)return null;const X=1/$,W=_[0]-t,ce=_[1]-e,se=_[2]-i,me=(W*U+ce*q+se*V)*X;if(me<0||me>1)return null;const Ee=ce*S-se*w,ue=se*b-W*S,ye=W*w-ce*b,xe=(x[0]*Ee+x[1]*ue+x[2]*ye)*X;return xe<0||me+xe>1?null:(M*Ee+C*ue+D*ye)*X}function ff(t,e,i){return(t-e)/(i-e)}function mf(t,e,i,n,s,c,u,p,m){const _=1<{const q=D?1:0,V=(S+1)*C-q,$=M*C,X=(M+1)*C-q;U[0]=S*C,U[1]=$,U[2]=V,U[3]=X};let b=new uf(m);const w=[];for(let S=0;S=1;m/=2){const S=p[p.length-1];b=new uf(m);for(let M=0;M0;){const{idx:M,t:C,nodex:D,nodey:U,depth:q}=S.pop();if(this.leaves[M]){mf(D,U,q,e,i,n,s,b,w);const $=1<=pe[2])return C}continue}let V=0;for(let $=0;$=_[x[se]]&&(x.splice(se,0,$),ce=!0);ce||(x[V]=$),V++}}for(let $=0;$=this.dim+1||i<-1||i>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(i+1)*this.stride+(e+1)}static pack(e,i){const n=[0,0,0,0],s=Eh.getUnpackVector(i);let c=Math.floor((e+s[3])/s[2]);return n[2]=c%256,c=Math.floor(c/256),n[1]=c%256,c=Math.floor(c/256),n[0]=c,n}getPixels(){return new Wi({width:this.stride,height:this.stride},this.pixels)}backfillBorder(e,i,n){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let s=i*this.dim,c=i*this.dim+this.dim,u=n*this.dim,p=n*this.dim+this.dim;switch(i){case-1:s=c-1;break;case 1:c=s+1}switch(n){case-1:u=p-1;break;case 1:p=u+1}const m=-i*this.dim,_=-n*this.dim;for(let x=u;x{this.remove(e,c)},n)),this.data[s].push(c),this.order.push(s),this.order.length>this.max){const u=this._getAndRemoveByKey(this.order[0]);u&&this.onRemove(u)}return this}has(e){return e.wrapped().key in this.data}getAndRemove(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}_getAndRemoveByKey(e){const i=this.data[e].shift();return i.timeout&&clearTimeout(i.timeout),this.data[e].length===0&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),i.value}getByKey(e){const i=this.data[e];return i?i[0].value:null}get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,i){if(!this.has(e))return this;const n=e.wrapped().key,s=i===void 0?0:this.data[n].indexOf(i),c=this.data[n][s];return this.data[n].splice(s,1),c.timeout&&clearTimeout(c.timeout),this.data[n].length===0&&delete this.data[n],this.onRemove(c.value),this.order.splice(this.order.indexOf(n),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){const i=this._getAndRemoveByKey(this.order[0]);i&&this.onRemove(i)}return this}filter(e){const i=[];for(const n in this.data)for(const s of this.data[n])e(s.value)||i.push(s);for(const n of i)this.remove(n.value.tileID,n)}}class xa{constructor(e,i,n){this.func=e,this.mask=i,this.range=n}}xa.ReadOnly=!1,xa.ReadWrite=!0,xa.disabled=new xa(519,xa.ReadOnly,[0,1]);const qu=7680;class Wu{constructor(e,i,n,s,c,u){this.test=e,this.ref=i,this.mask=n,this.fail=s,this.depthFail=c,this.pass=u}}Wu.disabled=new Wu({func:519,mask:0},0,0,qu,qu,qu);class sn{constructor(e,i,n){this.blendFunction=e,this.blendColor=i,this.mask=n}}sn.Replace=[1,0],sn.disabled=new sn(sn.Replace,Zt.transparent,[!1,!1,!1,!1]),sn.unblended=new sn(sn.Replace,Zt.transparent,[!0,!0,!0,!0]),sn.alphaBlended=new sn([1,771],Zt.transparent,[!0,!0,!0,!0]);const Xu=1029,Hu=2305;class jr{constructor(e,i,n){this.enable=e,this.mode=i,this.frontFace=n}}jr.disabled=new jr(!1,Xu,Hu),jr.backCCW=new jr(!0,Xu,Hu),jr.backCW=new jr(!0,Xu,2304),jr.frontCW=new jr(!0,1028,2304),jr.frontCCW=new jr(!0,1028,Hu);class fs extends Po{constructor(e,i,n){super(),this.id=e,this._onlySymbols=n,i.on("data",s=>{s.dataType==="source"&&s.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&s.dataType==="source"&&s.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform))}),i.on("error",()=>{this._sourceErrored=!0}),this._source=i,this._tiles={},this._cache=new ug(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._minTileCacheSize=i.minTileCacheSize,this._maxTileCacheSize=i.maxTileCacheSize,this._loadedParentTiles={},this._coveredTiles={},this._state=new lg,this._isRaster=this._source.type==="raster"||this._source.type==="raster-dem"||this._source.type==="custom"&&this._source._dataType==="raster"}onAdd(e){this.map=e,this._minTileCacheSize=this._minTileCacheSize===void 0&&e?e._minTileCacheSize:this._minTileCacheSize,this._maxTileCacheSize=this._maxTileCacheSize===void 0&&e?e._maxTileCacheSize:this._maxTileCacheSize}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(const e in this._tiles){const i=this._tiles[e];if(i.state!=="loaded"&&i.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform)}_loadTile(e,i){return e.isSymbolTile=this._onlySymbols,this._source.loadTile(e,i)}_unloadTile(e){if(this._source.unloadTile)return this._source.unloadTile(e,()=>{})}_abortTile(e){if(this._source.abortTile)return this._source.abortTile(e,()=>{})}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const i in this._tiles){const n=this._tiles[i];n.upload(e),n.prepare(this.map.style.imageManager)}}getIds(){return $r(this._tiles).map(e=>e.tileID).sort(xf).map(e=>e.key)}getRenderableIds(e){const i=[];for(const n in this._tiles)this._isIdRenderable(+n,e)&&i.push(this._tiles[n]);return e?i.sort((n,s)=>{const c=n.tileID,u=s.tileID,p=new Le(c.canonical.x,c.canonical.y)._rotate(this.transform.angle),m=new Le(u.canonical.x,u.canonical.y)._rotate(this.transform.angle);return c.overscaledZ-u.overscaledZ||m.y-p.y||m.x-p.x}).map(n=>n.tileID.key):i.map(n=>n.tileID).sort(xf).map(n=>n.key)}hasRenderableParent(e){const i=this.findLoadedParent(e,0);return!!i&&this._isIdRenderable(i.tileID.key)}_isIdRenderable(e,i){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(i||!this._tiles[e].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const e in this._tiles)this._tiles[e].state!=="errored"&&this._reloadTile(+e,"reloading")}}_reloadTile(e,i){const n=this._tiles[e];n&&(n.state!=="loading"&&(n.state=i),this._loadTile(n,this._tileLoaded.bind(this,n,e,i)))}_tileLoaded(e,i,n,s){if(s)if(e.state="errored",s.status!==404)this._source.fire(new Sr(s,{tile:e}));else if(this._source.type==="raster-dem"&&this.usedForTerrain&&this.map.painter.terrain){const c=this.map.painter.terrain;this.update(this.transform,c.getScaledDemTileSize(),!0),c.resetTileLookupCache(this.id)}else this.update(this.transform);else e.timeAdded=Er.now(),n==="expired"&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(i,e),this._source.type==="raster-dem"&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),this._source.fire(new gn("data",{dataType:"source",tile:e,coord:e.tileID,sourceCacheId:this.id}))}_backfillDEM(e){const i=this.getRenderableIds();for(let s=0;s1||(Math.abs(u)>1&&(Math.abs(u+m)===1?u+=m:Math.abs(u-m)===1&&(u-=m)),c.dem&&s.dem&&(s.dem.backfillBorder(c.dem,u,p),s.neighboringTiles&&s.neighboringTiles[_]&&(s.neighboringTiles[_].backfilled=!0)))}}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._tiles[e]}_retainLoadedChildren(e,i,n,s){for(const c in this._tiles){let u=this._tiles[c];if(s[c]||!u.hasData()||u.tileID.overscaledZ<=i||u.tileID.overscaledZ>n)continue;let p=u.tileID;for(;u&&u.tileID.overscaledZ>i+1;){const _=u.tileID.scaledTo(u.tileID.overscaledZ-1);u=this._tiles[_.key],u&&u.hasData()&&(p=_)}let m=p;for(;m.overscaledZ>i;)if(m=m.scaledTo(m.overscaledZ-1),e[m.key]){s[p.key]=p;break}}}findLoadedParent(e,i){if(e.key in this._loadedParentTiles){const n=this._loadedParentTiles[e.key];return n&&n.tileID.overscaledZ>=i?n:null}for(let n=e.overscaledZ-1;n>=i;n--){const s=e.scaledTo(n),c=this._getLoadedTile(s);if(c)return c}}_getLoadedTile(e){const i=this._tiles[e.key];return i&&i.hasData()?i:this._cache.getByKey(this._source.reparseOverscaled?e.wrapped().key:e.canonical.key)}updateCacheSize(e,i){i=i||this._source.tileSize;const n=Math.ceil(e.width/i)+1,s=Math.ceil(e.height/i)+1,c=Math.floor(n*s*5),u=typeof this._minTileCacheSize=="number"?Math.max(this._minTileCacheSize,c):c,p=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,u):u;this._cache.setMaxSize(p)}handleWrapJump(e){const i=Math.round((e-(this._prevLng===void 0?e:this._prevLng))/360);if(this._prevLng=e,i){const n={};for(const s in this._tiles){const c=this._tiles[s];c.tileID=c.tileID.unwrapTo(c.tileID.wrap+i),n[c.tileID.key]=c}this._tiles=n;for(const s in this._timers)clearTimeout(this._timers[s]),delete this._timers[s];for(const s in this._tiles)this._setTileReloadTimer(+s,this._tiles[s])}}update(e,i,n){if(this.transform=e,!this._sourceLoaded||this._paused||this.transform.freezeTileCoverage||this.usedForTerrain&&!n)return;let s;this.updateCacheSize(e,i),this.transform.projection.name!=="globe"&&this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?s=e.getVisibleUnwrappedCoordinates(this._source.tileID).map(p=>new Pi(p.canonical.z,p.wrap,p.canonical.z,p.canonical.x,p.canonical.y)):(s=e.coveringTiles({tileSize:i||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!n,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain}),this._source.hasTile&&(s=s.filter(p=>this._source.hasTile(p)))):s=[];const c=this._updateRetainedTiles(s);if(vf(this._source.type)&&s.length!==0){const p={},m={},_=Object.keys(c);for(const b of _){const w=c[b],S=this._tiles[b];if(!S||S.fadeEndTime&&S.fadeEndTime<=Er.now())continue;const M=this.findLoadedParent(w,Math.max(w.overscaledZ-fs.maxOverzooming,this._source.minzoom));M&&(this._addTile(M.tileID),p[M.tileID.key]=M.tileID),m[b]=w}const x=s[s.length-1].overscaledZ;for(const b in this._tiles){const w=this._tiles[b];if(c[b]||!w.hasData())continue;let S=w.tileID;for(;S.overscaledZ>x;){S=S.scaledTo(S.overscaledZ-1);const M=this._tiles[S.key];if(M&&M.hasData()&&m[S.key]){c[b]=w.tileID;break}}}for(const b in p)c[b]||(this._coveredTiles[b]=!0,c[b]=p[b])}for(const p in c)this._tiles[p].clearFadeHold();const u=function(p,m){const _=[];for(const x in p)x in m||_.push(x);return _}(this._tiles,c);for(const p of u){const m=this._tiles[p];m.hasSymbolBuckets&&!m.holdingForFade()?m.setHoldDuration(this.map._fadeDuration):m.hasSymbolBuckets&&!m.symbolFadeFinished()||this._removeTile(+p)}this._updateLoadedParentTileCache(),this._onlySymbols&&this._source.afterUpdate&&this._source.afterUpdate()}releaseSymbolFadeTiles(){for(const e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(+e)}_updateRetainedTiles(e){const i={};if(e.length===0)return i;const n={},s=e.reduce((_,x)=>Math.min(_,x.overscaledZ),1/0),c=e[0].overscaledZ,u=Math.max(c-fs.maxOverzooming,this._source.minzoom),p=Math.max(c+fs.maxUnderzooming,this._source.minzoom),m={};for(const _ of e){const x=this._addTile(_);i[_.key]=_,x.hasData()||s=this._source.maxzoom){const w=_.children(this._source.maxzoom)[0],S=this.getTile(w);if(S&&S.hasData()){i[w.key]=w;continue}}else{const w=_.children(this._source.maxzoom);if(i[w[0].key]&&i[w[1].key]&&i[w[2].key]&&i[w[3].key])continue}let b=x.wasRequested();for(let w=_.overscaledZ-1;w>=u;--w){const S=_.scaledTo(w);if(n[S.key]||(n[S.key]=!0,x=this.getTile(S),!x&&b&&(x=this._addTile(S)),x&&(i[S.key]=S,b=x.wasRequested(),x.hasData())))break}}return i}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const e in this._tiles){const i=[];let n,s=this._tiles[e].tileID;for(;s.overscaledZ>0;){if(s.key in this._loadedParentTiles){n=this._loadedParentTiles[s.key];break}i.push(s.key);const c=s.scaledTo(s.overscaledZ-1);if(n=this._getLoadedTile(c),n)break;s=c}for(const c of i)this._loadedParentTiles[c]=n}}_addTile(e){let i=this._tiles[e.key];if(i)return i;i=this._cache.getAndRemove(e),i&&(this._setTileReloadTimer(e.key,i),i.tileID=e,this._state.initializeTileState(i,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,i)));const n=!!i;if(!n){const s=this.map?this.map.painter:null;i=new Zu(e,this._source.tileSize*e.overscaleFactor(),this.transform.tileZoom,s,this._isRaster),this._loadTile(i,this._tileLoaded.bind(this,i,e.key,i.state))}return i?(i.uses++,this._tiles[e.key]=i,n||this._source.fire(new gn("dataloading",{tile:i,coord:i.tileID,dataType:"source"})),i):null}_setTileReloadTimer(e,i){e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);const n=i.getExpiryTimeout();n&&(this._timers[e]=setTimeout(()=>{this._reloadTile(e,"expired"),delete this._timers[e]},n))}_removeTile(e){const i=this._tiles[e];i&&(i.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),i.uses>0||(i.hasData()&&i.state!=="reloading"?this._cache.add(i.tileID,i,i.getExpiryTimeout()):(i.aborted=!0,this._abortTile(i),this._unloadTile(i))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const e in this._tiles)this._removeTile(+e);this._source._clear&&this._source._clear(),this._cache.reset(),this.map&&this.usedForTerrain&&this.map.painter.terrain&&this.map.painter.terrain.resetTileLookupCache(this.id)}tilesIn(e,i,n){const s=[],c=this.transform;if(!c)return s;const u=c.projection.name==="globe",p=tn(c.center.lng);for(const m in this._tiles){const _=this._tiles[m];if(n&&_.clearQueryDebugViz(),_.holdingForFade())continue;let x;if(u){const b=_.tileID.canonical;if(b.z===0){const w=[Math.abs(ct(p,...Kl(b,-1))-p),Math.abs(ct(p,...Kl(b,1))-p)];x=[0,2*w.indexOf(Math.min(...w))-1]}else{const w=[Math.abs(ct(p,...Kl(b,-1))-p),Math.abs(ct(p,...Kl(b,0))-p),Math.abs(ct(p,...Kl(b,1))-p)];x=[w.indexOf(Math.min(...w))-1]}}else x=[0];for(const b of x){const w=e.containsTile(_,c,i,b);w&&s.push(w)}}return s}getVisibleCoordinates(e){const i=this.getRenderableIds(e).map(n=>this._tiles[n].tileID);for(const n of i)n.projMatrix=this.transform.calculateProjMatrix(n.toUnwrapped());return i}hasTransition(){if(this._source.hasTransition())return!0;if(vf(this._source.type))for(const e in this._tiles){const i=this._tiles[e];if(i.fadeEndTime!==void 0&&i.fadeEndTime>=Er.now())return!0}return!1}setFeatureState(e,i,n){this._state.updateState(e=e||"_geojsonTileLayer",i,n)}removeFeatureState(e,i,n){this._state.removeFeatureState(e=e||"_geojsonTileLayer",i,n)}getFeatureState(e,i){return this._state.getState(e=e||"_geojsonTileLayer",i)}setDependencies(e,i,n){const s=this._tiles[e];s&&s.setDependencies(i,n)}reloadTilesForDependencies(e,i){for(const n in this._tiles)this._tiles[n].hasDependency(e,i)&&this._reloadTile(+n,"reloading");this._cache.filter(n=>!n.hasDependency(e,i))}_preloadTiles(e,i){if(!this._sourceLoaded){const p=()=>{this._sourceLoaded&&(this._source.off("data",p),this._preloadTiles(e,i))};return void this._source.on("data",p)}const n=new Map,s=Array.isArray(e)?e:[e],c=this.map.painter.terrain,u=this.usedForTerrain&&c?c.getScaledDemTileSize():this._source.tileSize;for(const p of s){const m=p.coveringTiles({tileSize:u,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!this.usedForTerrain,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain});for(const _ of m)n.set(_.key,_);this.usedForTerrain&&p.updateElevation(!1)}ai(Array.from(n.values()),(p,m)=>{const _=new Zu(p,this._source.tileSize*p.overscaleFactor(),this.transform.tileZoom,this.map.painter,this._isRaster);this._loadTile(_,x=>{this._source.type==="raster-dem"&&_.dem&&this._backfillDEM(_),m(x,_)})},i)}}function xf(t,e){const i=Math.abs(2*t.wrap)-+(t.wrap<0),n=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||n-i||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function vf(t){return t==="raster"||t==="image"||t==="video"||t==="custom"}function Kl(t,e){const i=1<=0&&b[3]>=0&&m.insert(p,b[0],b[1],b[2],b[3])}}loadVTLayers(){if(!this.vtLayers){this.vtLayers=new Cu(new uh(this.rawTileData)).layers,this.sourceLayerCoder=new sf(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]),this.vtFeatures={};for(const e in this.vtLayers)this.vtFeatures[e]=[]}return this.vtLayers}query(e,i,n,s){this.loadVTLayers();const c=e.params||{},u=Xs(c.filter),p=e.tileResult,m=e.transform,_=p.bufferedTilespaceBounds,x=this.grid.query(_.min.x,_.min.y,_.max.x,_.max.y,(M,C,D,U)=>Zd(p.bufferedTilespaceGeometry,M,C,D,U));x.sort(dg);let b=null;m.elevation&&x.length>0&&(b=Sh.create(m.elevation,this.tileID));const w={};let S;for(let M=0;M(U||(U=Pn(q,this.tileID.canonical,e.tileTransform)),V.queryIntersectsFeature(p,q,$,U,this.z,e.transform,e.pixelPosMatrix,b,X)))}return w}loadMatchingFeature(e,i,n,s,c,u,p,m,_){const{featureIndex:x,bucketIndex:b,sourceLayerIndex:w,layoutVertexArrayOffset:S}=i,M=this.bucketLayerIDs[b];if(s&&!function(q,V){for(let $=0;$=0)return!0;return!1}(s,M))return;const C=this.sourceLayerCoder.decode(w),D=this.vtLayers[C].feature(x);if(n.needGeometry){const q=hs(D,!0);if(!n.filter(new v(this.tileID.overscaledZ),q,this.tileID.canonical))return}else if(!n.filter(new v(this.tileID.overscaledZ),D))return;const U=this.getId(D,C);for(let q=0;q{const p=e instanceof F?e.get(u):null;return p&&p.evaluate?p.evaluate(i,n,s):p})}function dg(t,e){return e-t}Ue(bf,"FeatureIndex",{omit:["rawTileData","sourceLayerCoder"]});class Tf{constructor(e,i){this.width=e,this.height=i,this.nextRow=0,this.image=new kn({width:e,height:i}),this.positions={},this.uploaded=!1}getDash(e,i){const n=this.getKey(e,i);return this.positions[n]}trim(){const e=this.width,i=this.height=wr(this.nextRow);this.image.resize({width:e,height:i})}getKey(e,i){return e.join(",")+i}getDashRanges(e,i,n){const s=[];let c=e.length%2==1?-e[e.length-1]*n:0,u=e[0]*n,p=!0;s.push({left:c,right:u,isDash:p,zeroLength:e[0]===0});let m=e[0];for(let _=1;_1&&(m=e[++p]);const x=Math.abs(_-m.left),b=Math.abs(_-m.right),w=Math.min(x,b);let S;const M=c/n*(s+1);if(m.isDash){const C=s-Math.abs(M);S=Math.sqrt(w*w+C*C)}else S=s-Math.sqrt(w*w+M*M);this.image.data[u+_]=Math.max(0,Math.min(255,S+128))}}}addRegularDash(e,i){for(let m=e.length-1;m>=0;--m){const _=e[m],x=e[m+1];_.zeroLength?e.splice(m,1):x&&x.isDash===_.isDash&&(x.left=_.left,e.splice(m,1))}const n=e[0],s=e[e.length-1];n.isDash===s.isDash&&(n.left=s.left-this.width,s.right=n.right+this.width);const c=this.width*this.nextRow;let u=0,p=e[u];for(let m=0;m1&&(p=e[++u]);const _=Math.abs(m-p.left),x=Math.abs(m-p.right),b=Math.min(_,x);this.image.data[c+m]=Math.max(0,Math.min(255,(p.isDash?b:-b)+i+128))}}addDash(e,i){const n=this.getKey(e,i);if(this.positions[n])return this.positions[n];const s=i==="round",c=s?7:0,u=2*c+1;if(this.nextRow+u>this.height)return Ut("LineAtlas out of space"),null;e.length===0&&e.push(1);let p=0;for(let x=0;x=ye.maxzoom||ye.visibility!=="none"&&(Ku(ue,this.zoom,n),(m[ye.id]=ye.createBucket({index:p.bucketLayerIDs.length,layers:ue,zoom:this.zoom,canonical:this.canonical,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:me,sourceID:this.source,enableTerrain:this.enableTerrain,projection:this.projection.spec,availableImages:n})).populate(Ee,x,this.tileID.canonical,this.tileTransform),p.bucketLayerIDs.push(ue.map(xe=>xe.id)))}}let w,S,M,C;_.trim();const D={type:"maybePrepare",isSymbolTile:this.isSymbolTile,zoom:this.zoom},U=()=>{if(w)return c(w);if(S&&M&&C){const X=new Sf(S),W=new Pp(M,C);for(const ce in m){const se=m[ce];se instanceof go?(Ku(se.layers,this.zoom,n),U_(se,S,X.positions,M,W.iconPositions,this.showCollisionBoxes,n,this.tileID.canonical,this.tileZoom,this.projection)):se.hasPattern&&(se instanceof lh||se instanceof rh||se instanceof Fl)&&(Ku(se.layers,this.zoom,n),se.addFeatures(x,this.tileID.canonical,W.patternPositions,n,this.tileTransform))}this.status="done",c(null,{buckets:$r(m).filter(ce=>!ce.isEmpty()),featureIndex:p,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:X.image,lineAtlas:_,imageAtlas:W,glyphMap:this.returnDependencies?S:null,iconMap:this.returnDependencies?M:null,glyphPositions:this.returnDependencies?X.positions:null})}},q=pt(x.glyphDependencies,X=>Object.keys(X).map(Number));Object.keys(q).length?s.send("getGlyphs",{uid:this.uid,stacks:q},(X,W)=>{w||(w=X,S=W,U())},void 0,!1,D):S={};const V=Object.keys(x.iconDependencies);V.length?s.send("getImages",{icons:V,source:this.source,tileID:this.tileID,type:"icons"},(X,W)=>{w||(w=X,M=W,U())},void 0,!1,D):M={};const $=Object.keys(x.patternDependencies);$.length?s.send("getImages",{icons:$,source:this.source,tileID:this.tileID,type:"patterns"},(X,W)=>{w||(w=X,C=W,U())},void 0,!1,D):C={},U()}}function Ku(t,e,i){const n=new v(e);for(const s of t)s.recalculate(n,i)}class Mf{constructor(e){this.entries={},this.scheduler=e}request(e,i,n,s){const c=this.entries[e]=this.entries[e]||{callbacks:[]};if(c.result){const[u,p]=c.result;return this.scheduler?this.scheduler.add(()=>{s(u,p)},i):s(u,p),()=>{}}return c.callbacks.push(s),c.cancel||(c.cancel=n((u,p)=>{c.result=[u,p];for(const m of c.callbacks)this.scheduler?this.scheduler.add(()=>{m(u,p)},i):m(u,p);setTimeout(()=>delete this.entries[e],3e3)})),()=>{c.result||(c.callbacks=c.callbacks.filter(u=>u!==s),c.callbacks.length||(c.cancel(),delete this.entries[e]))}}}function Af(t,e,i){const n=JSON.stringify(t.request);return t.data&&(this.deduped.entries[n]={result:[null,t.data]}),this.deduped.request(n,{type:"parseTile",isSymbolTile:t.isSymbolTile,zoom:t.tileZoom},s=>{const c=$n(t.request,(u,p,m,_)=>{u?s(u):p&&s(null,{vectorTile:i?void 0:new Cu(new uh(p)),rawData:p,cacheControl:m,expires:_})});return()=>{c.cancel(),s()}},e)}const If=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class Yu{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[i,n]=new Uint8Array(e,0,2);if(i!==219)throw new Error("Data does not appear to be in a KDBush format.");const s=n>>4;if(s!==1)throw new Error(`Got v${s} data when expected v1.`);const c=If[15&n];if(!c)throw new Error("Unrecognized array type.");const[u]=new Uint16Array(e,2,1),[p]=new Uint32Array(e,4,1);return new Yu(p,u,c,e)}constructor(e,i=64,n=Float64Array,s){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+i,2),65535),this.ArrayType=n,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const c=If.indexOf(this.ArrayType),u=2*e*this.ArrayType.BYTES_PER_ELEMENT,p=e*this.IndexArrayType.BYTES_PER_ELEMENT,m=(8-p%8)%8;if(c<0)throw new Error(`Unexpected typed array class: ${n}.`);s&&s instanceof ArrayBuffer?(this.data=s,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+p+m,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+u+p+m),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+p+m,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+c]),new Uint16Array(this.data,2,1)[0]=i,new Uint32Array(this.data,4,1)[0]=e)}add(e,i){const n=this._pos>>1;return this.ids[n]=n,this.coords[this._pos++]=e,this.coords[this._pos++]=i,n}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return Ju(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,i,n,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:c,coords:u,nodeSize:p}=this,m=[0,c.length-1,0],_=[];for(;m.length;){const x=m.pop()||0,b=m.pop()||0,w=m.pop()||0;if(b-w<=p){for(let D=w;D<=b;D++){const U=u[2*D],q=u[2*D+1];U>=e&&U<=n&&q>=i&&q<=s&&_.push(c[D])}continue}const S=w+b>>1,M=u[2*S],C=u[2*S+1];M>=e&&M<=n&&C>=i&&C<=s&&_.push(c[S]),(x===0?e<=M:i<=C)&&(m.push(w),m.push(S-1),m.push(1-x)),(x===0?n>=M:s>=C)&&(m.push(S+1),m.push(b),m.push(1-x))}return _}within(e,i,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:c,nodeSize:u}=this,p=[0,s.length-1,0],m=[],_=n*n;for(;p.length;){const x=p.pop()||0,b=p.pop()||0,w=p.pop()||0;if(b-w<=u){for(let D=w;D<=b;D++)zf(c[2*D],c[2*D+1],e,i)<=_&&m.push(s[D]);continue}const S=w+b>>1,M=c[2*S],C=c[2*S+1];zf(M,C,e,i)<=_&&m.push(s[S]),(x===0?e-n<=M:i-n<=C)&&(p.push(w),p.push(S-1),p.push(1-x)),(x===0?e+n>=M:i+n>=C)&&(p.push(S+1),p.push(b),p.push(1-x))}return m}}function Ju(t,e,i,n,s,c){if(s-n<=i)return;const u=n+s>>1;Cf(t,e,u,n,s,c),Ju(t,e,i,n,u-1,1-c),Ju(t,e,i,u+1,s,1-c)}function Cf(t,e,i,n,s,c){for(;s>n;){if(s-n>600){const _=s-n+1,x=i-n+1,b=Math.log(_),w=.5*Math.exp(2*b/3),S=.5*Math.sqrt(b*w*(_-w)/_)*(x-_/2<0?-1:1);Cf(t,e,i,Math.max(n,Math.floor(i-x*w/_+S)),Math.min(s,Math.floor(i+(_-x)*w/_+S)),c)}const u=e[2*i+c];let p=n,m=s;for(Yl(t,e,n,i),e[2*s+c]>u&&Yl(t,e,n,s);pu;)m--}e[2*n+c]===u?Yl(t,e,n,m):(m++,Yl(t,e,m,s)),m<=i&&(n=m+1),i<=m&&(s=m-1)}}function Yl(t,e,i,n){Qu(t,i,n),Qu(e,2*i,2*n),Qu(e,2*i+1,2*n+1)}function Qu(t,e,i){const n=t[e];t[e]=t[i],t[i]=n}function zf(t,e,i,n){const s=t-i,c=e-n;return s*s+c*c}a.ARRAY_TYPE=qi,a.AUTH_ERR_MSG=H,a.Aabb=zi,a.Actor=class{constructor(t,e,i){this.target=t,this.parent=e,this.mapId=i,this.callbacks={},this.cancelCallbacks={},dn(["receive"],this),this.target.addEventListener("message",this.receive,!1),this.globalScope=Tr()?t:Se,this.scheduler=new sg}send(t,e,i,n,s=!1,c){const u=Math.round(1e18*Math.random()).toString(36).substring(0,10);i&&(i.metadata=c,this.callbacks[u]=i);const p=Nn(this.globalScope)?void 0:[];return this.target.postMessage({id:u,type:t,hasCallback:!!i,targetMapId:n,mustQueue:s,sourceMapId:this.mapId,data:lo(e,p)},p),{cancel:()=>{i&&delete this.callbacks[u],this.target.postMessage({id:u,type:"",targetMapId:n,sourceMapId:this.mapId})}}}receive(t){const e=t.data,i=e.id;if(i&&(!e.targetMapId||this.mapId===e.targetMapId))if(e.type===""){const n=this.cancelCallbacks[i];delete this.cancelCallbacks[i],n&&n.cancel()}else if(e.mustQueue||Tr()){const n=this.callbacks[i];this.cancelCallbacks[i]=this.scheduler.add(()=>this.processTask(i,e),n&&n.metadata||{type:"message"})}else this.processTask(i,e)}processTask(t,e){if(e.type===""){const i=this.callbacks[t];delete this.callbacks[t],i&&(e.error?i(Sn(e.error)):i(null,Sn(e.data)))}else{const i=Nn(this.globalScope)?void 0:[],n=e.hasCallback?(c,u)=>{delete this.cancelCallbacks[t],this.target.postMessage({id:t,type:"",sourceMapId:this.mapId,error:c?lo(c):null,data:lo(u,i)},i)}:c=>{},s=Sn(e.data);if(this.parent[e.type])this.parent[e.type](e.sourceMapId,s,n);else if(this.parent.getWorkerSource){const c=e.type.split(".");this.parent.getWorkerSource(e.sourceMapId,c[0],s.source)[c[1]](s,n)}else n(new Error(`Could not find function ${e.type}`))}}remove(){this.scheduler.remove(),this.target.removeEventListener("message",this.receive,!1)}},a.CanonicalTileID=ah,a.Color=Zt,a.ColorMode=sn,a.CullFaceMode=jr,a.DEMData=Eh,a.DataConstantProperty=I,a.DedupedRequest=Mf,a.DepthMode=xa,a.EXTENT=Ze,a.Elevation=class{isDataAvailableAtPoint(t){const e=this._source();if(this.isUsingMockSource()||!e||t.y<0||t.y>1)return!1;const i=e.getSource().maxzoom,n=1<1)return e;const s=n.getSource().maxzoom,c=1<{const c=this.getAtTileOffset(t,s.x,s.y),u=n.upVector(t.canonical,s.x,s.y);return rr(u,u,c*n.upVectorScale(t.canonical,e,i).metersToTile),u}}getForTilePoints(t,e,i,n){if(this.isUsingMockSource())return!1;const s=Sh.create(this,t,n);return!!s&&(e.forEach(c=>{c[2]=this.exaggeration()*s.getElevationAt(c[0],c[1],i)}),!0)}getMinMaxForTile(t){if(this.isUsingMockSource())return null;const e=this.findDEMTileFor(t);if(!e||!e.dem)return null;const i=e.dem.tree,n=e.tileID,s=1<{let w=_===c-1?_-2:_===0?_:_-1;return w+=b?24575:0,[w,x]};for(let _=0;_this._skuTokenExpiresAt}transformRequest(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}}normalizeStyleURL(t,e){if(!ee(t))return t;const i=ke(t);return i.path=`/styles/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||e)}normalizeGlyphsURL(t,e){if(!ee(t))return t;const i=ke(t);return i.path=`/fonts/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||e)}normalizeSourceURL(t,e,i,n){if(!ee(t))return t;const s=ke(t);return s.path=`/v4/${s.authority}.json`,s.params.push("secure"),i&&s.params.push(`language=${i}`),n&&s.params.push(`worldview=${n}`),this._makeAPIURL(s,this._customAccessToken||e)}normalizeSpriteURL(t,e,i,n){const s=ke(t);return ee(t)?(s.path=`/styles/v1${s.path}/sprite${e}${i}`,this._makeAPIURL(s,this._customAccessToken||n)):(s.path+=`${e}${i}`,Ie(s))}normalizeTileURL(t,e,i){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!ee(t))return t;const n=ke(t);n.path=n.path.replace(/(\.(png|jpg)\d*)(?=$)/,`${e||i&&n.authority!=="raster"&&i===512?"@2x":""}${ht.supported?".webp":"$1"}`),n.authority==="raster"?n.path=`/${it.RASTER_URL_PREFIX}${n.path}`:(n.path=n.path.replace(/^.+\/v4\//,"/"),n.path=`/${it.TILE_URL_VERSION}${n.path}`);const s=this._customAccessToken||function(c){for(const u of c){const p=u.match(/^access_token=(.*)$/);if(p)return p[1]}return null}(n.params)||it.ACCESS_TOKEN;return it.REQUIRE_ACCESS_TOKEN&&s&&this._skuToken&&n.params.push(`sku=${this._skuToken}`),this._makeAPIURL(n,s)}canonicalizeTileURL(t,e){const i=ke(t);if(!i.path.match(/^(\/v4\/|\/raster\/v1\/)/)||!i.path.match(/\.[\w]+$/))return t;let n="mapbox://";i.path.match(/^\/raster\/v1\//)?n+=`raster/${i.path.replace(`/${it.RASTER_URL_PREFIX}/`,"")}`:n+=`tiles/${i.path.replace(`/${it.TILE_URL_VERSION}/`,"")}`;let s=i.params;return e&&(s=s.filter(c=>!c.match(/^access_token=/))),s.length&&(n+=`?${s.join("&")}`),n}canonicalizeTileset(t,e){const i=!!e&&ee(e),n=[];for(const s of t.tiles||[])ne(s)?n.push(this.canonicalizeTileURL(s,i)):n.push(s);return n}_makeAPIURL(t,e){const i="See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes",n=ke(it.API_URL);if(t.protocol=n.protocol,t.authority=n.authority,t.protocol==="http"){const s=t.params.indexOf("secure");s>=0&&t.params.splice(s,1)}if(n.path!=="/"&&(t.path=`${n.path}${t.path}`),!it.REQUIRE_ACCESS_TOKEN)return Ie(t);if(e=e||it.ACCESS_TOKEN,!this._silenceAuthErrors){if(!e)throw new Error(`An API access token is required to use Mapbox GL. ${i}`);if(e[0]==="s")throw new Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${i}`)}return t.params=t.params.filter(s=>s.indexOf("access_token")===-1),t.params.push(`access_token=${e||""}`),Ie(t)}},a.ResourceType=fn,a.SegmentVector=Yt,a.SourceCache=fs,a.StencilMode=Wu,a.StructArrayLayout1ui2=Zi,a.StructArrayLayout2f1f2i16=qe,a.StructArrayLayout2i4=Te,a.StructArrayLayout2ui4=ui,a.StructArrayLayout3f12=ot,a.StructArrayLayout3ui6=je,a.StructArrayLayout4i8=ge,a.StructArrayLayout5f20=St,a.Texture=Hl,a.Tile=Zu,a.Transitionable=A,a.Uniform1f=$c,a.Uniform1i=class extends In{constructor(t){super(t),this.current=0}set(t,e,i){this.fetchUniformLocation(t,e)&&this.current!==i&&(this.current=i,this.gl.uniform1i(this.location,i))}},a.Uniform2f=class extends In{constructor(t){super(t),this.current=[0,0]}set(t,e,i){this.fetchUniformLocation(t,e)&&(i[0]===this.current[0]&&i[1]===this.current[1]||(this.current=i,this.gl.uniform2f(this.location,i[0],i[1])))}},a.Uniform3f=class extends In{constructor(t){super(t),this.current=[0,0,0]}set(t,e,i){this.fetchUniformLocation(t,e)&&(i[0]===this.current[0]&&i[1]===this.current[1]&&i[2]===this.current[2]||(this.current=i,this.gl.uniform3f(this.location,i[0],i[1],i[2])))}},a.Uniform4f=cd,a.UniformColor=hd,a.UniformMatrix2f=class extends In{constructor(t){super(t),this.current=$f}set(t,e,i){if(this.fetchUniformLocation(t,e)){for(let n=0;n<4;n++)if(i[n]!==this.current[n]){this.current=i,this.gl.uniformMatrix2fv(this.location,!1,i);break}}}},a.UniformMatrix3f=class extends In{constructor(t){super(t),this.current=Gf}set(t,e,i){if(this.fetchUniformLocation(t,e)){for(let n=0;n<9;n++)if(i[n]!==this.current[n]){this.current=i,this.gl.uniformMatrix3fv(this.location,!1,i);break}}}},a.UniformMatrix4f=class extends In{constructor(t){super(t),this.current=jf}set(t,e,i){if(this.fetchUniformLocation(t,e)){if(i[12]!==this.current[12]||i[0]!==this.current[0])return this.current=i,void this.gl.uniformMatrix4fv(this.location,!1,i);for(let n=1;n<16;n++)if(i[n]!==this.current[n]){this.current=i,this.gl.uniformMatrix4fv(this.location,!1,i);break}}}},a.UnwrappedTileID=_p,a.ValidationError=Fe,a.VectorTileFeature=oh,a.VectorTileWorkerSource=class extends Po{constructor(t,e,i,n,s){super(),this.actor=t,this.layerIndex=e,this.availableImages=i,this.loadVectorData=s||Af,this.loading={},this.loaded={},this.deduped=new Mf(t.scheduler),this.isSpriteLoaded=n,this.scheduler=t.scheduler}loadTile(t,e){const i=t.uid,n=t&&t.request,s=n&&n.collectResourceTiming,c=this.loading[i]=new pg(t);c.abort=this.loadVectorData(t,(u,p)=>{const m=!this.loading[i];if(delete this.loading[i],m||u||!p)return c.status="done",m||(this.loaded[i]=c),e(u);const _=p.rawData,x={};p.expires&&(x.expires=p.expires),p.cacheControl&&(x.cacheControl=p.cacheControl),c.vectorTile=p.vectorTile||new Cu(new uh(_));const b=()=>{c.parse(c.vectorTile,this.layerIndex,this.availableImages,this.actor,(w,S)=>{if(w||!S)return e(w);const M={};if(s){const C=Ea(n);C.length>0&&(M.resourceTiming=JSON.parse(JSON.stringify(C)))}e(null,Wt({rawTileData:_.slice(0)},S,x,M))})};this.isSpriteLoaded?b():this.once("isSpriteLoaded",()=>{this.scheduler?this.scheduler.add(b,{type:"parseTile",isSymbolTile:t.isSymbolTile,zoom:t.tileZoom}):b()}),this.loaded=this.loaded||{},this.loaded[i]=c})}reloadTile(t,e){const i=this.loaded,n=t.uid,s=this;if(i&&i[n]){const c=i[n];c.showCollisionBoxes=t.showCollisionBoxes,c.enableTerrain=!!t.enableTerrain,c.projection=t.projection,c.tileTransform=ps(t.tileID.canonical,t.projection);const u=(p,m)=>{const _=c.reloadCallback;_&&(delete c.reloadCallback,c.parse(c.vectorTile,s.layerIndex,this.availableImages,s.actor,_)),e(p,m)};c.status==="parsing"?c.reloadCallback=u:c.status==="done"&&(c.vectorTile?c.parse(c.vectorTile,this.layerIndex,this.availableImages,this.actor,u):u())}}abortTile(t,e){const i=t.uid,n=this.loading[i];n&&(n.abort&&n.abort(),delete this.loading[i]),e()}removeTile(t,e){const i=this.loaded,n=t.uid;i&&i[n]&&delete i[n],e()}},a.WritingMode=or,a.ZoomDependentExpression=Ho,a.add=zn,a.addDynamicAttributes=bh,a.adjoint=function(t,e){var i=e[0],n=e[1],s=e[2],c=e[3],u=e[4],p=e[5],m=e[6],_=e[7],x=e[8];return t[0]=u*x-p*_,t[1]=s*_-n*x,t[2]=n*p-s*u,t[3]=p*m-c*x,t[4]=i*x-s*m,t[5]=s*c-i*p,t[6]=c*_-u*m,t[7]=n*m-i*_,t[8]=i*u-n*c,t},a.asyncAll=ai,a.bezier=Eo,a.bindAll=dn,a.boundsAttributes=cf,a.bufferConvexPolygon=function(t,e){const i=[];for(let n=0;nws&&(t.getActor().send("enforceCacheSizeLimit",bs),Co=0)},a.calculateGlobeLabelMatrix=function(t,e){const{x:i,y:n}=t.point,s=Dd(i,n,t.worldSize/t._pixelsPerMercatorPixel,0,0);return os(s,s,hu(en(e)))},a.calculateGlobeMatrix=function(t){const{x:e,y:i}=t.point,{lng:n,lat:s}=t._center;return Dd(e,i,t.worldSize,n,s)},a.calculateGlobeMercatorMatrix=function(t){const e=t.pixelsPerMeter,i=e/Ur(1,t.center.lat),n=Or(new Float64Array(16));return bl(n,n,[t.point.x,t.point.y,0]),ss(n,n,[i,i,e]),Float32Array.from(n)},a.circumferenceAtLatitude=du,a.clamp=ct,a.clearTileCache=function(t){if(!Io())return;const e=Se.caches.delete(jn);t&&e.catch(t).then(()=>t())},a.clipLine=$p,a.clone=function(t){var e=new qi(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},a.clone$1=Li,a.collisionCircleLayout=u_,a.config=it,a.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},a.create=function(){var t=new qi(16);return qi!=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},a.create$1=pd,a.createExpression=oo,a.createLayout=te,a.createStyleLayer=function(t){return t.type==="custom"?new ig(t):new ng[t.type](t)},a.cross=ru,a.degToRad=dt,a.distance=function(t,e){return Math.hypot(e[0]-t[0],e[1]-t[1],e[2]-t[2])},a.div=function(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t[2]=e[2]/i[2],t},a.dot=pr,a.earthRadius=Pl,a.ease=ys,a.easeCubicInOut=gs,a.ecefToLatLng=function([t,e,i]){const n=Math.hypot(t,e,i),s=Math.atan2(t,i),c=.5*Math.PI-Math.acos(-e/n);return new At(si(s),si(c))},a.emitValidationErrors=Fc,a.endsWith=Un,a.enforceCacheSizeLimit=function(t){pn(),Vi&&Vi.then(e=>{e.keys().then(i=>{for(let n=0;nc&&(n+=(t[s]-c)*(t[s]-c)),e[s]0){const M=180/n;fd(S,S,[M/_+1,0,0,0,M/x+1,0,-.5*M/b,.5*M/w,1])}return S[2]=m,S[5]=t.x,S[8]=t.y,S},a.getImage=G,a.getJSON=function(t,e){return _n(Wt(t,{type:"json"}),e)},a.getLatitudinalLod=function(t){const e=wi-5;t=ct(t,-e,e)/e*90;const i=Math.pow(Math.abs(Math.sin(dt(t))),3);return Math.round(i*(Il.length-1))},a.getMapSessionAPI=li,a.getPerformanceMeasurement=Ea,a.getProjection=nf,a.getRTLTextPluginStatus=f,a.getReferrer=mn,a.getTilePoint=function(t,{x:e,y:i},n=0){return new Le(((e-n)*t.scale-t.x)*Ze,(i*t.scale-t.y)*Ze)},a.getTileVec3=function(t,e,i=0){return ta(((e.x-i)*t.scale-t.x)*Ze,(e.y*t.scale-t.y)*Ze,Od(e.z,e.y))},a.getVideo=function(t,e){const i=Se.document.createElement("video");i.muted=!0,i.onloadstart=function(){e(null,i)};for(let n=0;n{}}},a.globeCenterToScreenPoint=function(t){const e=[0,0,0],i=Or(new Float64Array(16));return os(i,t.pixelMatrix,t.globeMatrix),qt(e,e,i),new Le(e[0],e[1])},a.globeDenormalizeECEF=hu,a.globeECEFOrigin=function(t,e){const i=[0,0,0];return qt(i,i,zl(en(e.canonical))),qt(i,i,t),i},a.globeMetersToEcef=Wc,a.globeNormalizeECEF=zl,a.globePixelsToTileUnits=function(t,e){return Ze/(512*Math.pow(2,t))*Hc(en(e))},a.globePoleMatrixForTile=function(t,e,i){const n=Or(new Float64Array(16)),s=(e/(1<0;return n===0&&!s&&!u&&c},a.identity=Or,a.identity$1=Td,a.invert=Qh,a.isFullscreen=function(){return!!Se.document.fullscreenElement||!!Se.document.webkitFullscreenElement},a.isLngLatBehindGlobe=uu,a.isMapAuthenticated=function(t){return Ti.has(t)},a.isMapboxURL=ee,a.isSafariWithAntialiasingBug=function(t){const e=t.navigator?t.navigator.userAgent:null;return!!Nn(t)&&e&&(e.match("Version/15.4")||e.match("Version/15.5")||e.match(/CPU (OS|iPhone OS) (15_4|15_5) like Mac OS X/))},a.latFromMercatorY=bi,a.latLngToECEF=ra,a.len=Qf,a.length=wl,a.length$1=function(t){return Math.hypot(t[0],t[1],t[2],t[3])},a.lngFromMercatorX=nr,a.loadVectorTile=Af,a.makeRequest=_n,a.mapValue=function(t,e,i,n,s){return ct((t-e)/(i-e)*(s-n)+n,n,s)},a.mercatorScale=Fd,a.mercatorXfromLng=tn,a.mercatorYfromLat=rn,a.mercatorZfromAltitude=Ur,a.mul=Yf,a.mul$1=Jf,a.multiply=os,a.multiply$1=fd,a.multiply$2=yd,a.nextPowerOfTwo=wr,a.normalize=Ci,a.normalize$1=em,a.normalize$2=bd,a.number=mt,a.ortho=function(t,e,i,n,s,c,u){var p=1/(e-i),m=1/(n-s),_=1/(c-u);return t[0]=-2*p,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*m,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*_,t[11]=0,t[12]=(e+i)*p,t[13]=(s+n)*m,t[14]=(u+c)*_,t[15]=1,t},a.pbf=Tp,a.perspective=function(t,e,i,n,s){var c,u=1/Math.tan(e/2);return t[0]=u/i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,s!=null&&s!==1/0?(t[10]=(s+n)*(c=1/(n-s)),t[14]=2*s*n*c):(t[10]=-1,t[14]=-2*n),t},a.pick=function(t,e){const i={};for(let n=0;n0&&i[0]<=t.width&&i[1]>0&&i[1]<=t.height&&!uu(t,new At(t.center.lat,90)),n[0]>0&&n[0]<=t.width&&n[1]>0&&n[1]<=t.height&&!uu(t,new At(t.center.lat,-90))]},a.polygonContainsPoint=us,a.polygonIntersectsBox=Zd,a.polygonIntersectsPolygon=Nd,a.polygonizeBounds=function(t,e,i=0,n=!0){const s=new Le(i,i),c=t.sub(s),u=e.add(s),p=[c,new Le(u.x,c.y),u,new Le(c.x,u.y)];return n&&p.push(c.clone()),p},a.posAttributes=Al,a.postMapLoadEvent=Xt,a.postPerformanceEvent=ri,a.postTurnstileEvent=ft,a.potpack=Du,a.prevPowerOfTwo=function(t){return t<=1?1:Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},a.radToDeg=si,a.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],a.registerForPluginStateChange=function(t){return t({pluginStatus:l,pluginURL:r}),d.on("pluginStateChange",t),t},a.removeAuthState=function(t){Ti.delete(t)},a.renderColorRamp=vu,a.resample=Ud,a.rotateX=eu,a.rotateX$1=Ed,a.rotateY=qc,a.rotateY$1=Sd,a.rotateZ=function(t,e,i){var n=Math.sin(i),s=Math.cos(i),c=e[0],u=e[1],p=e[2],m=e[3],_=e[4],x=e[5],b=e[6],w=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]=c*s+_*n,t[1]=u*s+x*n,t[2]=p*s+b*n,t[3]=m*s+w*n,t[4]=_*s-c*n,t[5]=x*s-u*n,t[6]=b*s-p*n,t[7]=w*s-m*n,t},a.rotateZ$1=function(t,e,i){i*=.5;var n=e[0],s=e[1],c=e[2],u=e[3],p=Math.sin(i),m=Math.cos(i);return t[0]=n*m+s*p,t[1]=s*m-n*p,t[2]=c*m+u*p,t[3]=u*m-c*p,t},a.scale=ss,a.scale$1=vd,a.scale$2=rr,a.scaleAndAdd=Sl,a.set=function(t,e,i,n){return t[0]=e,t[1]=i,t[2]=n,t},a.setCacheLimits=function(t,e){bs=t,ws=e},a.setColumn=function(t,e,i){t[4*e+0]=i[0],t[4*e+1]=i[1],t[4*e+2]=i[2],t[4*e+3]=i[3]},a.setRTLTextPlugin=function(t,e,i=!1){if(l===_l||l===gl||l===yl)throw new Error("setRTLTextPlugin cannot be called multiple times.");r=Er.resolveURL(t),l=_l,co=e,h(),i||g()},a.smoothstep=On,a.spec=fe,a.squaredLength=function(t){var e=t[0],i=t[1],n=t[2];return e*e+i*i+n*n},a.storeAuthState=function(t,e){e?Ti.add(t):Ti.delete(t)},a.sub=Fr,a.subtract=iu,a.symbolSize=d_,a.tileAABB=function(t,e,i,n,s,c,u,p,m){if(m.name==="globe")return om(t,e,new ah(i,n,s));const _=ps({z:i,x:n,y:s},m);return new zi([(c+_.x/_.scale)*e,e*(_.y/_.scale),u],[(c+_.x2/_.scale)*e,e*(_.y2/_.scale),p])},a.tileCornersToBounds=Xc,a.tileTransform=ps,a.transformMat3=function(t,e,i){var n=e[0],s=e[1],c=e[2];return t[0]=n*i[0]+s*i[3]+c*i[6],t[1]=n*i[1]+s*i[4]+c*i[7],t[2]=n*i[2]+s*i[5]+c*i[8],t},a.transformMat4=qt,a.transformMat4$1=as,a.transformQuat=xd,a.transitionTileAABBinECEF=zd,a.translate=bl,a.transpose=function(t,e){if(t===e){var i=e[1],n=e[2],s=e[5];t[1]=e[3],t[2]=e[6],t[3]=i,t[5]=e[7],t[6]=n,t[7]=s}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},a.triggerPluginCompletionEvent=o,a.uniqueId=Fn,a.updateGlobeVertexNormal=function(t,e,i,n,s){const c=5*e+2;t.float32[c+0]=i,t.float32[c+1]=n,t.float32[c+2]=s},a.validateCustomStyleLayer=function(t){const e=[],i=t.id;return i===void 0&&e.push({message:`layers.${i}: missing required property "id"`}),t.render===void 0&&e.push({message:`layers.${i}: missing required method "render"`}),t.renderingMode&&t.renderingMode!=="2d"&&t.renderingMode!=="3d"&&e.push({message:`layers.${i}: property "renderingMode" must be either "2d" or "3d"`}),e},a.validateFilter=t=>$i(es(t)),a.validateFog=t=>$i(Rc(t)),a.validateLayer=t=>$i(Pc(t)),a.validateLight=t=>$i(Lc(t)),a.validateSource=t=>$i(Dc(t)),a.validateStyle=Oc,a.validateTerrain=t=>$i(ul(t)),a.values=$r,a.vectorTile=nh,a.version=xr,a.warnOnce=Ut,a.window=Se,a.wrap=oi}),wo(["./shared"],function(a){function Se(Z){if(typeof Z=="number"||typeof Z=="boolean"||typeof Z=="string"||Z==null)return JSON.stringify(Z);if(Array.isArray(Z)){let P="[";for(const G of Z)P+=`${Se(G)},`;return`${P}]`}let z="{";for(const P of Object.keys(Z).sort())z+=`${P}:${Se(Z[P])},`;return`${z}}`}function xr(Z){let z="";for(const P of a.refProperties)z+=`/${Se(Z[P])}`;return z}class Ki{constructor(z){this.keyCache={},z&&this.replace(z)}replace(z){this._layerConfigs={},this._layers={},this.update(z,[])}update(z,P){for(const H of z)this._layerConfigs[H.id]=H,(this._layers[H.id]=a.createStyleLayer(H)).compileFilter(),this.keyCache[H.id]&&delete this.keyCache[H.id];for(const H of P)delete this.keyCache[H],delete this._layerConfigs[H],delete this._layers[H];this.familiesBySource={};const G=function(H,ee){const ne={};for(let Q=0;Qthis._layers[ke.id]),ne=ee[0];if(ne.visibility==="none")continue;const re=ne.source||"";let Q=this.familiesBySource[re];Q||(Q=this.familiesBySource[re]={});const de=ne.sourceLayer||"_geojsonTileLayer";let Pe=Q[de];Pe||(Pe=Q[de]=[]),Pe.push(ee)}}}class it{loadTile(z,P){const{uid:G,encoding:H,rawImageData:ee,padding:ne,buildQuadTree:re}=z,Q=a.window.ImageBitmap&&ee instanceof a.window.ImageBitmap?this.getImageData(ee,ne):ee;P(null,new a.DEMData(G,Q,H,ne<1,re))}getImageData(z,P){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(z.width,z.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=z.width,this.offscreenCanvas.height=z.height,this.offscreenCanvasContext.drawImage(z,0,0,z.width,z.height);const G=this.offscreenCanvasContext.getImageData(-P,-P,z.width+2*P,z.height+2*P);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),G}}function ht(Z,z){if(Z.length!==0){gi(Z[0],z);for(var P=1;P=Math.abs(re)?P-Q+re:re-Q+P,P=Q}P+G>=0!=!!z&&Z.reverse()}var Si=a.getDefaultExportFromCjs(function Z(z,P){var G,H=z&&z.type;if(H==="FeatureCollection")for(G=0;G>31}function Ta(Z,z){for(var P=Z.loadGeometry(),G=Z.type,H=0,ee=0,ne=P.length,re=0;reZ},ct=Math.fround||(On=new Float32Array(1),Z=>(On[0]=+Z,On[0]));var On;const oi=3,ai=5,$r=6;class Wt{constructor(z){this.options=Object.assign(Object.create(ys),z),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(z){const{log:P,minZoom:G,maxZoom:H}=this.options;P&&console.time("total time");const ee=`prepare ${z.length} points`;P&&console.time(ee),this.points=z;const ne=[];for(let Q=0;Q=G;Q--){const de=+Date.now();re=this.trees[Q]=this._createTree(this._cluster(re,Q)),P&&console.log("z%d: %d clusters in %dms",Q,re.numItems,+Date.now()-de)}return P&&console.timeEnd("total time"),this}getClusters(z,P){let G=((z[0]+180)%360+360)%360-180;const H=Math.max(-90,Math.min(90,z[1]));let ee=z[2]===180?180:((z[2]+180)%360+360)%360-180;const ne=Math.max(-90,Math.min(90,z[3]));if(z[2]-z[0]>=360)G=-180,ee=180;else if(G>ee){const ke=this.getClusters([G,H,180,ne],P),Ie=this.getClusters([-180,H,ee,ne],P);return ke.concat(Ie)}const re=this.trees[this._limitZoom(P)],Q=re.range(qr(G),wr(ne),qr(ee),wr(H)),de=re.data,Pe=[];for(const ke of Q){const Ie=this.stride*ke;Pe.push(de[Ie+ai]>1?Zr(de,Ie,this.clusterProps):this.points[de[Ie+oi]])}return Pe}getChildren(z){const P=this._getOriginId(z),G=this._getOriginZoom(z),H="No cluster with the specified id.",ee=this.trees[G];if(!ee)throw new Error(H);const ne=ee.data;if(P*this.stride>=ne.length)throw new Error(H);const re=this.options.radius/(this.options.extent*Math.pow(2,G-1)),Q=ee.within(ne[P*this.stride],ne[P*this.stride+1],re),de=[];for(const Pe of Q){const ke=Pe*this.stride;ne[ke+4]===z&&de.push(ne[ke+ai]>1?Zr(ne,ke,this.clusterProps):this.points[ne[ke+oi]])}if(de.length===0)throw new Error(H);return de}getLeaves(z,P,G){const H=[];return this._appendLeaves(H,z,P=P||10,G=G||0,0),H}getTile(z,P,G){const H=this.trees[this._limitZoom(z)],ee=Math.pow(2,z),{extent:ne,radius:re}=this.options,Q=re/ne,de=(G-Q)/ee,Pe=(G+1+Q)/ee,ke={features:[]};return this._addTileFeatures(H.range((P-Q)/ee,de,(P+1+Q)/ee,Pe),H.data,P,G,ee,ke),P===0&&this._addTileFeatures(H.range(1-Q/ee,de,1,Pe),H.data,ee,G,ee,ke),P===ee-1&&this._addTileFeatures(H.range(0,de,Q/ee,Pe),H.data,-1,G,ee,ke),ke.features.length?ke:null}getClusterExpansionZoom(z){let P=this._getOriginZoom(z)-1;for(;P<=this.options.maxZoom;){const G=this.getChildren(z);if(P++,G.length!==1)break;z=G[0].properties.cluster_id}return P}_appendLeaves(z,P,G,H,ee){const ne=this.getChildren(P);for(const re of ne){const Q=re.properties;if(Q&&Q.cluster?ee+Q.point_count<=H?ee+=Q.point_count:ee=this._appendLeaves(z,Q.cluster_id,G,H,ee):ee1;let Pe,ke,Ie;if(de)Pe=Fn(P,Q,this.clusterProps),ke=P[Q],Ie=P[Q+1];else{const Qe=this.points[P[Q+oi]];Pe=Qe.properties;const[nt,ft]=Qe.geometry.coordinates;ke=qr(nt),Ie=wr(ft)}const Je={type:1,geometry:[[Math.round(this.options.extent*(ke*ee-G)),Math.round(this.options.extent*(Ie*ee-H))]],tags:Pe};let rt;rt=de||this.options.generateId?P[Q+oi]:this.points[P[Q+oi]].id,rt!==void 0&&(Je.id=rt),ne.features.push(Je)}}_limitZoom(z){return Math.max(this.options.minZoom,Math.min(Math.floor(+z),this.options.maxZoom+1))}_cluster(z,P){const{radius:G,extent:H,reduce:ee,minPoints:ne}=this.options,re=G/(H*Math.pow(2,P)),Q=z.data,de=[],Pe=this.stride;for(let ke=0;keP&&(nt+=Q[Vt+ai])}if(nt>Qe&&nt>=ne){let ft,Vt=Ie*Qe,Xt=Je*Qe,yi=-1;const ri=((ke/Pe|0)<<5)+(P+1)+this.points.length;for(const sr of rt){const li=sr*Pe;if(Q[li+2]<=P)continue;Q[li+2]=P;const Ti=Q[li+ai];Vt+=Q[li]*Ti,Xt+=Q[li+1]*Ti,Q[li+4]=ri,ee&&(ft||(ft=this._map(Q,ke,!0),yi=this.clusterProps.length,this.clusterProps.push(ft)),ee(ft,this._map(Q,li)))}Q[ke+4]=ri,de.push(Vt/nt,Xt/nt,1/0,ri,-1,nt),ee&&de.push(yi)}else{for(let ft=0;ft1)for(const ft of rt){const Vt=ft*Pe;if(!(Q[Vt+2]<=P)){Q[Vt+2]=P;for(let Xt=0;Xt>5}_getOriginZoom(z){return(z-this.points.length)%32}_map(z,P,G){if(z[P+ai]>1){const ne=this.clusterProps[z[P+$r]];return G?Object.assign({},ne):ne}const H=this.points[z[P+oi]].properties,ee=this.options.map(H);return G&&ee===H?Object.assign({},ee):ee}}function Zr(Z,z,P){return{type:"Feature",id:Z[z+oi],properties:Fn(Z,z,P),geometry:{type:"Point",coordinates:[(G=Z[z],360*(G-.5)),xs(Z[z+1])]}};var G}function Fn(Z,z,P){const G=Z[z+ai],H=G>=1e4?`${Math.round(G/1e3)}k`:G>=1e3?Math.round(G/100)/10+"k":G,ee=Z[z+$r],ne=ee===-1?{}:Object.assign({},P[ee]);return Object.assign(ne,{cluster:!0,cluster_id:Z[z+oi],point_count:G,point_count_abbreviated:H})}function qr(Z){return Z/360+.5}function wr(Z){const z=Math.sin(Z*Math.PI/180),P=.5-.25*Math.log((1+z)/(1-z))/Math.PI;return P<0?0:P>1?1:P}function xs(Z){const z=(180-360*Z)*Math.PI/180;return 360*Math.atan(Math.exp(z))/Math.PI-90}function dn(Z,z,P,G){for(var H,ee=G,ne=P-z>>1,re=P-z,Q=Z[z],de=Z[z+1],Pe=Z[P],ke=Z[P+1],Ie=z+3;Ieee)H=Ie,ee=Je;else if(Je===ee){var rt=Math.abs(Ie-ne);rtG&&(H-z>3&&dn(Z,z,H,G),Z[H+2]=ee,P-H>3&&dn(Z,H,P,G))}function Un(Z,z,P,G,H,ee){var ne=H-P,re=ee-G;if(ne!==0||re!==0){var Q=((Z-P)*ne+(z-G)*re)/(ne*ne+re*re);Q>1?(P=H,G=ee):Q>0&&(P+=ne*Q,G+=re*Q)}return(ne=Z-P)*ne+(re=z-G)*re}function pt(Z,z,P,G){var H={id:Z===void 0?null:Z,type:z,geometry:P,tags:G,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(ee){var ne=ee.geometry,re=ee.type;if(re==="Point"||re==="MultiPoint"||re==="LineString")Vn(ee,ne);else if(re==="Polygon"||re==="MultiLineString")for(var Q=0;Q0&&(ne+=G?(H*de-Q*ee)/2:Math.sqrt(Math.pow(Q-H,2)+Math.pow(de-ee,2))),H=Q,ee=de}var Pe=z.length-3;z[2]=1,dn(z,0,Pe,P),z[Pe+2]=1,z.size=Math.abs(ne),z.start=0,z.end=z.size}function Ui(Z,z,P,G){for(var H=0;H1?1:P}function Ri(Z,z,P,G,H,ee,ne,re){if(G/=z,ee>=(P/=z)&&ne=G)return null;for(var Q=[],de=0;de=P&&rt=G)){var Qe=[];if(Ie==="Point"||Ie==="MultiPoint")Mo(ke,Qe,P,G,H);else if(Ie==="LineString")Nn(ke,Qe,P,G,H,!1,re.lineMetrics);else if(Ie==="MultiLineString")Wr(ke,Qe,P,G,H,!1);else if(Ie==="Polygon")Wr(ke,Qe,P,G,H,!0);else if(Ie==="MultiPolygon")for(var nt=0;nt=P&&ne<=G&&(z.push(Z[ee]),z.push(Z[ee+1]),z.push(Z[ee+2]))}}function Nn(Z,z,P,G,H,ee,ne){for(var re,Q,de=Ao(Z),Pe=H===0?bs:ws,ke=Z.start,Ie=0;IeP&&(Q=Pe(de,Je,rt,nt,ft,P),ne&&(de.start=ke+re*Q)):Vt>G?Xt=P&&(Q=Pe(de,Je,rt,nt,ft,P),yi=!0),Xt>G&&Vt<=G&&(Q=Pe(de,Je,rt,nt,ft,G),yi=!0),!ee&&yi&&(ne&&(de.end=ke+re*Q),z.push(de),de=Ao(Z)),ne&&(ke+=re)}var ri=Z.length-3;Je=Z[ri],rt=Z[ri+1],Qe=Z[ri+2],(Vt=H===0?Je:rt)>=P&&Vt<=G&&jn(de,Je,rt,Qe),ri=de.length-3,ee&&ri>=3&&(de[ri]!==de[0]||de[ri+1]!==de[1])&&jn(de,de[0],de[1],de[2]),de.length&&z.push(de)}function Ao(Z){var z=[];return z.size=Z.size,z.start=Z.start,z.end=Z.end,z}function Wr(Z,z,P,G,H,ee){for(var ne=0;nene.maxX&&(ne.maxX=Pe),ke>ne.maxY&&(ne.maxY=ke)}return ne}function Co(Z,z,P,G){var H=z.geometry,ee=z.type,ne=[];if(ee==="Point"||ee==="MultiPoint")for(var re=0;re0&&z.size<(H?ne:G))P.numPoints+=z.length/3;else{for(var re=[],Q=0;Qne)&&(P.numSimplified++,re.push(z[Q]),re.push(z[Q+1])),P.numPoints++;H&&function(de,Pe){for(var ke=0,Ie=0,Je=de.length,rt=Je-2;Ie0===Pe)for(Ie=0,Je=de.length;Ie24)throw new Error("maxZoom should be in the 0-24 range");if(z.promoteId&&z.generateId)throw new Error("promoteId and generateId cannot be used together.");var G=function(H,ee){var ne=[];if(H.type==="FeatureCollection")for(var re=0;re1&&console.time("creation"),Ie=this.tiles[ke]=Gn(Z,z,P,G,Q),this.tileCoords.push({z,x:P,y:G}),de)){de>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",z,P,G,Ie.numFeatures,Ie.numPoints,Ie.numSimplified),console.timeEnd("creation"));var Je="z"+z;this.stats[Je]=(this.stats[Je]||0)+1,this.total++}if(Ie.source=Z,H){if(z===Q.maxZoom||z===H)continue;var rt=1<1&&console.time("clipping");var Qe,nt,ft,Vt,Xt,yi,ri=.5*Q.buffer/Q.extent,sr=.5-ri,li=.5+ri,Ti=1+ri;Qe=nt=ft=Vt=null,Xt=Ri(Z,Pe,P-ri,P+li,0,Ie.minX,Ie.maxX,Q),yi=Ri(Z,Pe,P+sr,P+Ti,0,Ie.minX,Ie.maxX,Q),Z=null,Xt&&(Qe=Ri(Xt,Pe,G-ri,G+li,1,Ie.minY,Ie.maxY,Q),nt=Ri(Xt,Pe,G+sr,G+Ti,1,Ie.minY,Ie.maxY,Q),Xt=null),yi&&(ft=Ri(yi,Pe,G-ri,G+li,1,Ie.minY,Ie.maxY,Q),Vt=Ri(yi,Pe,G+sr,G+Ti,1,Ie.minY,Ie.maxY,Q),yi=null),de>1&&console.timeEnd("clipping"),re.push(Qe||[],z+1,2*P,2*G),re.push(nt||[],z+1,2*P,2*G+1),re.push(ft||[],z+1,2*P+1,2*G),re.push(Vt||[],z+1,2*P+1,2*G+1)}}},Hr.prototype.getTile=function(Z,z,P){var G=this.options,H=G.extent,ee=G.debug;if(Z<0||Z>24)return null;var ne=1<1&&console.log("drilling down to z%d-%d-%d",Z,z,P);for(var Q,de=Z,Pe=z,ke=P;!Q&&de>0;)de--,Pe=Math.floor(Pe/2),ke=Math.floor(ke/2),Q=this.tiles[mn(de,Pe,ke)];return Q&&Q.source?(ee>1&&console.log("found parent tile z%d-%d-%d",de,Pe,ke),ee>1&&console.time("drilling down"),this.splitTile(Q.source,de,Pe,ke,Z,z,P),ee>1&&console.timeEnd("drilling down"),this.tiles[re]?Io(this.tiles[re],H):null):null};class $n extends a.VectorTileWorkerSource{constructor(z,P,G,H,ee){super(z,P,G,H,_n),ee&&(this.loadGeoJSON=ee)}loadData(z,P){const G=z&&z.request,H=G&&G.collectResourceTiming;this.loadGeoJSON(z,(ee,ne)=>{if(ee||!ne)return P(ee);if(typeof ne!="object")return P(new Error(`Input data given to '${z.source}' is not a valid GeoJSON object.`));{Si(ne,!0);try{if(z.filter){const Q=a.createExpression(z.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(Q.result==="error")throw new Error(Q.value.map(Pe=>`${Pe.key}: ${Pe.message}`).join(", "));ne={type:"FeatureCollection",features:ne.features.filter(Pe=>Q.value.evaluate({zoom:0},Pe))}}this._geoJSONIndex=z.cluster?new Wt(function({superclusterOptions:Q,clusterProperties:de}){if(!de||!Q)return Q;const Pe={},ke={},Ie={accumulated:null,zoom:0},Je={properties:null},rt=Object.keys(de);for(const Qe of rt){const[nt,ft]=de[Qe],Vt=a.createExpression(ft),Xt=a.createExpression(typeof nt=="string"?[nt,["accumulated"],["get",Qe]]:nt);Pe[Qe]=Vt.value,ke[Qe]=Xt.value}return Q.map=Qe=>{Je.properties=Qe;const nt={};for(const ft of rt)nt[ft]=Pe[ft].evaluate(Ie,Je);return nt},Q.reduce=(Qe,nt)=>{Je.properties=nt;for(const ft of rt)Ie.accumulated=Qe[ft],Qe[ft]=ke[ft].evaluate(Ie,Je)},Q}(z)).load(ne.features):function(Q,de){return new Hr(Q,de)}(ne,z.geojsonVtOptions)}catch(Q){return P(Q)}this.loaded={};const re={};if(H){const Q=a.getPerformanceMeasurement(G);Q&&(re.resourceTiming={},re.resourceTiming[z.source]=JSON.parse(JSON.stringify(Q)))}P(null,re)}})}reloadTile(z,P){const G=this.loaded;return G&&G[z.uid]?super.reloadTile(z,P):this.loadTile(z,P)}loadGeoJSON(z,P){if(z.request)a.getJSON(z.request,P);else{if(typeof z.data!="string")return P(new Error(`Input data given to '${z.source}' is not a valid GeoJSON object.`));try{return P(null,JSON.parse(z.data))}catch{return P(new Error(`Input data given to '${z.source}' is not a valid GeoJSON object.`))}}}getClusterExpansionZoom(z,P){try{P(null,this._geoJSONIndex.getClusterExpansionZoom(z.clusterId))}catch(G){P(G)}}getClusterChildren(z,P){try{P(null,this._geoJSONIndex.getChildren(z.clusterId))}catch(G){P(G)}}getClusterLeaves(z,P){try{P(null,this._geoJSONIndex.getLeaves(z.clusterId,z.limit,z.offset))}catch(G){P(G)}}}class Ts{constructor(z){this.self=z,this.actor=new a.Actor(z,this),this.layerIndexes={},this.availableImages={},this.isSpriteLoaded={},this.projections={},this.defaultProjection=a.getProjection({name:"mercator"}),this.workerSourceTypes={vector:a.VectorTileWorkerSource,geojson:$n},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(P,G)=>{if(this.workerSourceTypes[P])throw new Error(`Worker source with name "${P}" already registered.`);this.workerSourceTypes[P]=G},this.self.registerRTLTextPlugin=P=>{if(a.plugin.isParsed())throw new Error("RTL text plugin already registered.");a.plugin.applyArabicShaping=P.applyArabicShaping,a.plugin.processBidirectionalText=P.processBidirectionalText,a.plugin.processStyledBidirectionalText=P.processStyledBidirectionalText}}clearCaches(z,P,G){delete this.layerIndexes[z],delete this.availableImages[z],delete this.workerSources[z],delete this.demWorkerSources[z],G()}checkIfReady(z,P,G){G()}setReferrer(z,P){this.referrer=P}spriteLoaded(z,P){this.isSpriteLoaded[z]=P;for(const G in this.workerSources[z]){const H=this.workerSources[z][G];for(const ee in H)H[ee]instanceof a.VectorTileWorkerSource&&(H[ee].isSpriteLoaded=P,H[ee].fire(new a.Event("isSpriteLoaded")))}}setImages(z,P,G){this.availableImages[z]=P;for(const H in this.workerSources[z]){const ee=this.workerSources[z][H];for(const ne in ee)ee[ne].availableImages=P}G()}enableTerrain(z,P,G){this.terrain=P,G()}setProjection(z,P){this.projections[z]=a.getProjection(P)}setLayers(z,P,G){this.getLayerIndex(z).replace(P),G()}updateLayers(z,P,G){this.getLayerIndex(z).update(P.layers,P.removedIds),G()}loadTile(z,P,G){const H=this.enableTerrain?a.extend({enableTerrain:this.terrain},P):P;H.projection=this.projections[z]||this.defaultProjection,this.getWorkerSource(z,P.type,P.source).loadTile(H,G)}loadDEMTile(z,P,G){const H=this.enableTerrain?a.extend({buildQuadTree:this.terrain},P):P;this.getDEMWorkerSource(z,P.source).loadTile(H,G)}reloadTile(z,P,G){const H=this.enableTerrain?a.extend({enableTerrain:this.terrain},P):P;H.projection=this.projections[z]||this.defaultProjection,this.getWorkerSource(z,P.type,P.source).reloadTile(H,G)}abortTile(z,P,G){this.getWorkerSource(z,P.type,P.source).abortTile(P,G)}removeTile(z,P,G){this.getWorkerSource(z,P.type,P.source).removeTile(P,G)}removeSource(z,P,G){if(!this.workerSources[z]||!this.workerSources[z][P.type]||!this.workerSources[z][P.type][P.source])return;const H=this.workerSources[z][P.type][P.source];delete this.workerSources[z][P.type][P.source],H.removeSource!==void 0?H.removeSource(P,G):G()}loadWorkerSource(z,P,G){try{this.self.importScripts(P.url),G()}catch(H){G(H.toString())}}syncRTLPluginState(z,P,G){try{a.plugin.setState(P);const H=a.plugin.getPluginURL();if(a.plugin.isLoaded()&&!a.plugin.isParsed()&&H!=null){this.self.importScripts(H);const ee=a.plugin.isParsed();G(ee?void 0:new Error(`RTL Text Plugin failed to import scripts from ${H}`),ee)}}catch(H){G(H.toString())}}getAvailableImages(z){let P=this.availableImages[z];return P||(P=[]),P}getLayerIndex(z){let P=this.layerIndexes[z];return P||(P=this.layerIndexes[z]=new Ki),P}getWorkerSource(z,P,G){if(this.workerSources[z]||(this.workerSources[z]={}),this.workerSources[z][P]||(this.workerSources[z][P]={}),!this.workerSources[z][P][G]){const H={send:(ee,ne,re,Q,de,Pe)=>{this.actor.send(ee,ne,re,z,de,Pe)},scheduler:this.actor.scheduler};this.workerSources[z][P][G]=new this.workerSourceTypes[P](H,this.getLayerIndex(z),this.getAvailableImages(z),this.isSpriteLoaded[z])}return this.workerSources[z][P][G]}getDEMWorkerSource(z,P){return this.demWorkerSources[z]||(this.demWorkerSources[z]={}),this.demWorkerSources[z][P]||(this.demWorkerSources[z][P]=new it),this.demWorkerSources[z][P]}enforceCacheSizeLimit(z,P){a.enforceCacheSizeLimit(P)}getWorkerPerformanceMetrics(z,P,G){G(void 0,void 0)}}return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&(self.worker=new Ts(self)),Ts}),wo(["./shared"],function(a){function Se(l,r){if(Array.isArray(l)){if(!Array.isArray(r)||l.length!==r.length)return!1;for(let o=0;o"u"||typeof document>"u"?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var h,d,f=new Blob([""],{type:"text/javascript"}),g=URL.createObjectURL(f);try{d=new Worker(g),h=!0}catch{h=!1}return d&&d.terminate(),URL.revokeObjectURL(g),h}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var h=document.createElement("canvas");h.width=h.height=1;var d=h.getContext("2d");if(!d)return!1;var f=d.getImageData(0,0,1,1);return f&&f.width===h.width}()?(it[o=r&&r.failIfMajorPerformanceCaveat]===void 0&&(it[o]=function(h){var d,f=function(g){var y=document.createElement("canvas"),v=Object.create(Ki.webGLContextAttributes);return v.failIfMajorPerformanceCaveat=g,y.getContext("webgl",v)||y.getContext("experimental-webgl",v)}(h);if(!f)return!1;try{d=f.createShader(f.VERTEX_SHADER)}catch{return!1}return!(!d||f.isContextLost())&&(f.shaderSource(d,"void main() {}"),f.compileShader(d),f.getShaderParameter(d,f.COMPILE_STATUS)===!0)}(o)),it[o]?document.documentMode?"insufficient ECMAScript 6 support":void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var o}(l)}var it={};function ht(l,r,o){const h=a.window.document.createElement(l);return r!==void 0&&(h.className=r),o&&o.appendChild(h),h}function gi(l,r,o){const h=a.window.document.createElementNS("http://www.w3.org/2000/svg",l);for(const d of Object.keys(r))h.setAttributeNS(null,d,r[d]);return o&&o.appendChild(h),h}Ki.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};const Si=a.window.document&&a.window.document.documentElement.style,vr=Si&&Si.userSelect!==void 0?"userSelect":"WebkitUserSelect";let br;function To(){Si&&vr&&(br=Si[vr],Si[vr]="none")}function Rn(){Si&&vr&&(Si[vr]=br)}function Yi(l){l.preventDefault(),l.stopPropagation(),a.window.removeEventListener("click",Yi,!0)}function Bn(){a.window.addEventListener("click",Yi,!0),a.window.setTimeout(()=>{a.window.removeEventListener("click",Yi,!0)},0)}function Ji(l,r){const o=l.getBoundingClientRect();return Qi(l,o,r)}function hn(l,r){const o=l.getBoundingClientRect(),h=[];for(let d=0;d=0?0:l.button}function Qi(l,r,o){const h=l.offsetWidth===r.width?1:l.offsetWidth/r.width;return new a.Point((o.clientX-r.left)*h,(o.clientY-r.top)*h)}function Le(l,r){var o=r[0],h=r[1],d=r[2],f=r[3],g=o*f-d*h;return g?(l[0]=f*(g=1/g),l[1]=-h*g,l[2]=-d*g,l[3]=o*g,l):null}function ba(l){const{userImage:r}=l;return!!(r&&r.render&&r.render())&&(l.data.replace(new Uint8Array(r.data.buffer)),!0)}class wa extends a.Evented{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new a.RGBAImage({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(r){if(this.loaded!==r&&(this.loaded=r,r)){for(const{ids:o,callback:h}of this.requestors)this._notify(o,h);this.requestors=[]}}hasImage(r){return!!this.getImage(r)}getImage(r){return this.images[r]}addImage(r,o){this._validate(r,o)&&(this.images[r]=o)}_validate(r,o){let h=!0;return this._validateStretch(o.stretchX,o.data&&o.data.width)||(this.fire(new a.ErrorEvent(new Error(`Image "${r}" has invalid "stretchX" value`))),h=!1),this._validateStretch(o.stretchY,o.data&&o.data.height)||(this.fire(new a.ErrorEvent(new Error(`Image "${r}" has invalid "stretchY" value`))),h=!1),this._validateContent(o.content,o)||(this.fire(new a.ErrorEvent(new Error(`Image "${r}" has invalid "content" value`))),h=!1),h}_validateStretch(r,o){if(!r)return!0;let h=0;for(const d of r){if(d[0]{this.ready=!0})}broadcast(r,o,h){a.asyncAll(this.actors,(d,f)=>{d.send(r,o,f)},h=h||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach(r=>{r.remove()}),this.actors=[],this.workerPool.release(this.id)}}function ai(l,r,o){return r*(a.EXTENT/(l.tileSize*Math.pow(2,o-l.tileID.overscaledZ)))}oi.Actor=a.Actor;class $r{constructor(r,o,h,d){this.screenBounds=r,this.cameraPoint=o,this._screenRaycastCache={},this._cameraRaycastCache={},this.isAboveHorizon=h,this.screenGeometry=this.bufferedScreenGeometry(0),this.screenGeometryMercator=this._bufferedScreenMercator(0,d)}static createFromScreenPoints(r,o){let h,d;if(r instanceof a.Point||typeof r[0]=="number"){const f=a.Point.convert(r);h=[f],d=o.isPointAboveHorizon(f)}else{const f=a.Point.convert(r[0]),g=a.Point.convert(r[1]);h=[f,g],d=a.polygonizeBounds(f,g).every(y=>o.isPointAboveHorizon(y))}return new $r(h,o.getCameraPoint(),d,o)}isPointQuery(){return this.screenBounds.length===1}bufferedScreenGeometry(r){return a.polygonizeBounds(this.screenBounds[0],this.screenBounds.length===1?this.screenBounds[0]:this.screenBounds[1],r)}bufferedCameraGeometry(r){const o=this.screenBounds[0],h=this.screenBounds.length===1?this.screenBounds[0].add(new a.Point(1,1)):this.screenBounds[1],d=a.polygonizeBounds(o,h,0,!1);return this.cameraPoint.y>h.y&&(this.cameraPoint.x>o.x&&this.cameraPoint.x=h.x?d[2]=this.cameraPoint:this.cameraPoint.x<=o.x&&(d[3]=this.cameraPoint)),a.bufferConvexPolygon(d,r)}bufferedCameraGeometryGlobe(r){const o=this.screenBounds[0],h=this.screenBounds.length===1?this.screenBounds[0].add(new a.Point(1,1)):this.screenBounds[1],d=a.polygonizeBounds(o,h,r),f=this.cameraPoint.clone();switch(3*((f.y>o.y)+(f.y>h.y))+((f.x>o.x)+(f.x>h.x))){case 0:d[0]=f,d[4]=f.clone();break;case 1:d.splice(1,0,f);break;case 2:d[1]=f;break;case 3:d.splice(4,0,f);break;case 5:d.splice(2,0,f);break;case 6:d[3]=f;break;case 7:d.splice(3,0,f);break;case 8:d[2]=f}return d}containsTile(r,o,h,d=0){const f=r.queryPadding/o._pixelsPerMercatorPixel+1,g=h?this._bufferedCameraMercator(f,o):this._bufferedScreenMercator(f,o);let y=r.tileID.wrap+(g.unwrapped?d:0);const v=g.polygon.map(F=>a.getTilePoint(r.tileTransform,F,y));if(!a.polygonIntersectsBox(v,0,0,a.EXTENT,a.EXTENT))return;y=r.tileID.wrap+(this.screenGeometryMercator.unwrapped?d:0);const E=this.screenGeometryMercator.polygon.map(F=>a.getTileVec3(r.tileTransform,F,y)),T=E.map(F=>new a.Point(F[0],F[1])),A=o.getFreeCameraOptions().position||new a.MercatorCoordinate(0,0,0),k=a.getTileVec3(r.tileTransform,A,y),R=E.map(F=>{const I=a.sub(F,F,k);return a.normalize(I,I),new a.Ray(k,I)}),O=ai(r,1,o.zoom)*o._pixelsPerMercatorPixel;return{queryGeometry:this,tilespaceGeometry:T,tilespaceRays:R,bufferedTilespaceGeometry:v,bufferedTilespaceBounds:(B=a.getBounds(v),B.min.x=a.clamp(B.min.x,0,a.EXTENT),B.min.y=a.clamp(B.min.y,0,a.EXTENT),B.max.x=a.clamp(B.max.x,0,a.EXTENT),B.max.y=a.clamp(B.max.y,0,a.EXTENT),B),tile:r,tileID:r.tileID,pixelToTileUnitsFactor:O};var B}_bufferedScreenMercator(r,o){const h=Fn(r);if(this._screenRaycastCache[h])return this._screenRaycastCache[h];{let d;return d=o.projection.name==="globe"?this._projectAndResample(this.bufferedScreenGeometry(r),o):{polygon:this.bufferedScreenGeometry(r).map(f=>o.pointCoordinate3D(f)),unwrapped:!0},this._screenRaycastCache[h]=d,d}}_bufferedCameraMercator(r,o){const h=Fn(r);if(this._cameraRaycastCache[h])return this._cameraRaycastCache[h];{let d;return d=o.projection.name==="globe"?this._projectAndResample(this.bufferedCameraGeometryGlobe(r),o):{polygon:this.bufferedCameraGeometry(r).map(f=>o.pointCoordinate3D(f)),unwrapped:!0},this._cameraRaycastCache[h]=d,d}}_projectAndResample(r,o){const h=function(f,g){const y=a.multiply([],g.pixelMatrix,g.globeMatrix),v=[0,-a.GLOBE_RADIUS,0,1],E=[0,a.GLOBE_RADIUS,0,1],T=[0,0,0,1];a.transformMat4$1(v,v,y),a.transformMat4$1(E,E,y),a.transformMat4$1(T,T,y);const A=new a.Point(v[0]/v[3],v[1]/v[3]),k=new a.Point(E[0]/E[3],E[1]/E[3]),R=a.polygonContainsPoint(f,A)&&v[3]1?Wt(f.slice(0,F),g):[],N=Fnew a.Point(Zr(Y.x),Y.y)),N=N.map(Y=>new a.Point(Zr(Y.x),Y.y));const j=[...L];j.length===0&&j.push(N[N.length-1]);const K=a.number(j[j.length-1].y,(N.length===0?L[0]:N[0]).y,I);let J;return J=R?[new a.Point(0,K),new a.Point(0,0),new a.Point(1,0),new a.Point(1,K)]:[new a.Point(1,K),new a.Point(1,1),new a.Point(0,1),new a.Point(0,K)],j.push(...J),N.length===0?j.push(L[0]):j.push(...N),{polygon:j.map(Y=>new a.MercatorCoordinate(Y.x,Y.y)),unwrapped:!1}}(r,o);if(h)return h;const d=function(f,g){let y=!1,v=-1/0,E=0;for(let A=0;Av&&(v=f[A].x,E=A);for(let A=0;A.5&&(R.x{A.x-=1}),{polygon:f,unwrapped:y}}(Wt(r,o).map(f=>new a.Point(Zr(f.x),f.y)),o);return{polygon:d.polygon.map(f=>new a.MercatorCoordinate(f.x,f.y)),unwrapped:d.unwrapped}}}function Wt(l,r){return a.resample(l,o=>{const h=r.pointCoordinate3D(o);o.x=h.x,o.y=h.y},1/256)}function Zr(l){return l<0?1+l%1:l%1}function Fn(l){return 100*l|0}function qr(l,r,o,h,d){const f=function(g,y){if(g)return d(g);if(y){l.url&&y.tiles&&l.tiles&&delete l.tiles;const v=a.pick(a.extend(y,l),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);y.vector_layers&&(v.vectorLayers=y.vector_layers,v.vectorLayerIds=v.vectorLayers.map(E=>E.id)),v.tiles=r.canonicalizeTileset(v,l.url),d(null,v)}};return l.url?a.getJSON(r.transformRequest(r.normalizeSourceURL(l.url,null,o,h),a.ResourceType.Source),f):a.exported.frame(()=>f(null,l))}class wr{constructor(r,o,h){this.bounds=a.LngLatBounds.convert(this.validateBounds(r)),this.minzoom=o||0,this.maxzoom=h||24}validateBounds(r){return Array.isArray(r)&&r.length===4?[Math.max(-180,r[0]),Math.max(-90,r[1]),Math.min(180,r[2]),Math.min(90,r[3])]:[-180,-90,180,90]}contains(r){const o=Math.pow(2,r.z),h=Math.floor(a.mercatorXfromLng(this.bounds.getWest())*o),d=Math.floor(a.mercatorYfromLat(this.bounds.getNorth())*o),f=Math.ceil(a.mercatorXfromLng(this.bounds.getEast())*o),g=Math.ceil(a.mercatorYfromLat(this.bounds.getSouth())*o);return r.x>=h&&r.x=d&&r.y{this._tileJSONRequest=null,this._loaded=!0,d?(o&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${o}`),h&&h.length!==2&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${h}`),this.fire(new a.ErrorEvent(d))):f&&(a.extend(this,f),f.bounds&&(this.tileBounds=new wr(f.bounds,this.minzoom,this.maxzoom)),a.postTurnstileEvent(f.tiles,this.map._requestManager._customAccessToken),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"content"}))),r&&r(d)})}loaded(){return this._loaded}hasTile(r){return!this.tileBounds||this.tileBounds.contains(r.canonical)}onAdd(r){this.map=r,this.load()}reload(){this.cancelTileJSONRequest(),this.load(()=>this.map.style._clearSource(this.id))}setTiles(r){return this._options.tiles=r,this.reload(),this}setUrl(r){return this.url=r,this._options.url=r,this.reload(),this}onRemove(){this.cancelTileJSONRequest()}serialize(){return a.extend({},this._options)}loadTile(r,o){const h=this.map._requestManager.normalizeTileURL(r.tileID.canonical.url(this.tiles,this.scheme)),d={request:this.map._requestManager.transformRequest(h,a.ResourceType.Tile),data:void 0,uid:r.uid,tileID:r.tileID,tileZoom:r.tileZoom,zoom:r.tileID.overscaledZ,tileSize:this.tileSize*r.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:a.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,isSymbolTile:r.isSymbolTile};if(d.request.collectResourceTiming=this._collectResourceTiming,r.actor&&r.state!=="expired")r.state==="loading"?r.reloadCallback=o:r.request=r.actor.send("reloadTile",d,f.bind(this));else if(r.actor=this._tileWorkers[h]=this._tileWorkers[h]||this.dispatcher.getActor(),this.dispatcher.ready)r.request=r.actor.send("loadTile",d,f.bind(this),void 0,!0);else{const g=a.loadVectorTile.call({deduped:this._deduped},d,(y,v)=>{y||!v?f.call(this,y):(d.data={cacheControl:v.cacheControl,expires:v.expires,rawData:v.rawData.slice(0)},r.actor&&r.actor.send("loadTile",d,f.bind(this),void 0,!0))},!0);r.request={cancel:g}}function f(g,y){return delete r.request,r.aborted?o(null):g&&g.status!==404?o(g):(y&&y.resourceTiming&&(r.resourceTiming=y.resourceTiming),this.map._refreshExpiredTiles&&y&&r.setExpiryData(y),r.loadVectorData(y,this.map.painter),a.cacheEntryPossiblyAdded(this.dispatcher),o(null),void(r.reloadCallback&&(this.loadTile(r,r.reloadCallback),r.reloadCallback=null)))}}abortTile(r){r.request&&(r.request.cancel(),delete r.request),r.actor&&r.actor.send("abortTile",{uid:r.uid,type:this.type,source:this.id})}unloadTile(r){r.unloadVectorData(),r.actor&&r.actor.send("removeTile",{uid:r.uid,type:this.type,source:this.id})}hasTransition(){return!1}afterUpdate(){this._tileWorkers={}}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}class Ie extends a.Evented{constructor(r,o,h,d){super(),this.id=r,this.dispatcher=h,this.setEventedParent(d),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=a.extend({type:"raster"},o),a.extend(this,a.pick(o,["url","scheme","tileSize"]))}load(r){this._loaded=!1,this.fire(new a.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=qr(this._options,this.map._requestManager,null,null,(o,h)=>{this._tileJSONRequest=null,this._loaded=!0,o?this.fire(new a.ErrorEvent(o)):h&&(a.extend(this,h),h.bounds&&(this.tileBounds=new wr(h.bounds,this.minzoom,this.maxzoom)),a.postTurnstileEvent(h.tiles),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"content"}))),r&&r(o)})}loaded(){return this._loaded}onAdd(r){this.map=r,this.load()}reload(){this.cancelTileJSONRequest(),this.load(()=>this.map.style._clearSource(this.id))}setTiles(r){return this._options.tiles=r,this.reload(),this}setUrl(r){return this.url=r,this._options.url=r,this.reload(),this}onRemove(){this.cancelTileJSONRequest()}serialize(){return a.extend({},this._options)}hasTile(r){return!this.tileBounds||this.tileBounds.contains(r.canonical)}loadTile(r,o){const h=a.exported.devicePixelRatio>=2,d=this.map._requestManager.normalizeTileURL(r.tileID.canonical.url(this.tiles,this.scheme),h,this.tileSize);r.request=a.getImage(this.map._requestManager.transformRequest(d,a.ResourceType.Tile),(f,g,y,v)=>(delete r.request,r.aborted?(r.state="unloaded",o(null)):f?(r.state="errored",o(f)):g?(this.map._refreshExpiredTiles&&r.setExpiryData({cacheControl:y,expires:v}),r.setTexture(g,this.map.painter),r.state="loaded",a.cacheEntryPossiblyAdded(this.dispatcher),void o(null)):o(null)))}static loadTileData(r,o,h){r.setTexture(o,h)}static unloadTileData(r,o){r.texture&&o.saveTileTexture(r.texture)}abortTile(r,o){r.request&&(r.request.cancel(),delete r.request),o()}unloadTile(r,o){r.texture&&this.map.painter.saveTileTexture(r.texture),o()}hasTransition(){return!1}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}function Je(l,r,o,h,d,f,g,y){const v=[l,o,d,r,h,f,1,1,1],E=[g,y,1],T=a.adjoint([],v),[A,k,R]=a.transformMat3(E,E,a.transpose(T,T));return a.multiply$1(v,[A,0,0,0,k,0,0,0,R],v)}class rt extends a.Evented{constructor(r,o,h,d){super(),this.id=r,this.dispatcher=h,this.coordinates=o.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(d),this.options=o,this._dirty=!1}load(r,o){this._loaded=o||!1,this.fire(new a.Event("dataloading",{dataType:"source"})),this.url=this.options.url,this._imageRequest=a.getImage(this.map._requestManager.transformRequest(this.url,a.ResourceType.Image),(h,d)=>{if(this._imageRequest=null,this._loaded=!0,h)this.fire(new a.ErrorEvent(h));else if(d){const{HTMLImageElement:f}=a.window;this.image=d instanceof f?a.exported.getImageData(d):d,this._dirty=!0,this.width=this.image.width,this.height=this.image.height,r&&(this.coordinates=r),this._finishLoading()}})}loaded(){return this._loaded}updateImage(r){return this.image&&r.url?(this._imageRequest&&r.url!==this.options.url&&(this._imageRequest.cancel(),this._imageRequest=null),this.options.url=r.url,this.load(r.coordinates,this._loaded),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(r){this.map=r,this.load()}onRemove(){this._imageRequest&&(this._imageRequest.cancel(),this._imageRequest=null),this.texture&&this.texture.destroy()}setCoordinates(r){this.coordinates=r,this._boundsArray=void 0;const o=r.map(a.MercatorCoordinate.fromLngLat);return this.tileID=function(h){let d=1/0,f=1/0,g=-1/0,y=-1/0;for(const A of h)d=Math.min(d,A.x),f=Math.min(f,A.y),g=Math.max(g,A.x),y=Math.max(y,A.y);const v=Math.max(g-d,y-f),E=Math.max(0,Math.floor(-Math.log(v)/Math.LN2)),T=Math.pow(2,E);return new a.CanonicalTileID(E,Math.floor((d+g)/2*T),Math.floor((f+y)/2*T))}(o),this.minzoom=this.maxzoom=this.tileID.z,this.fire(new a.Event("data",{dataType:"source",sourceDataType:"content"})),this}_clear(){this._boundsArray=void 0}_prepareData(r){for(const v in this.tiles){const E=this.tiles[v];E.state!=="loaded"&&(E.state="loaded",E.texture=this.texture)}if(this._boundsArray)return;const o=a.tileTransform(this.tileID,this.map.transform.projection),[h,d,f,g]=this.coordinates.map(v=>{const E=o.projection.project(v[0],v[1]);return a.getTilePoint(o,E)._round()});this.perspectiveTransform=function(v,E,T,A,k,R,O,B,F,I){const L=Je(0,0,v,0,0,E,v,E),N=Je(T,A,k,R,O,B,F,I);return a.multiply$1(N,a.adjoint(L,L),N),[N[6]/N[8]*v/a.EXTENT,N[7]/N[8]*E/a.EXTENT]}(this.width,this.height,h.x,h.y,d.x,d.y,g.x,g.y,f.x,f.y);const y=this._boundsArray=new a.StructArrayLayout4i8;y.emplaceBack(h.x,h.y,0,0),y.emplaceBack(d.x,d.y,a.EXTENT,0),y.emplaceBack(g.x,g.y,0,a.EXTENT),y.emplaceBack(f.x,f.y,a.EXTENT,a.EXTENT),this.boundsBuffer&&this.boundsBuffer.destroy(),this.boundsBuffer=r.createVertexBuffer(y,a.boundsAttributes.members),this.boundsSegments=a.SegmentVector.simpleSegment(0,0,4,2)}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const r=this.map.painter.context,o=r.gl;this._dirty&&(this.texture?this.texture.update(this.image):(this.texture=new a.Texture(r,this.image,o.RGBA),this.texture.bind(o.LINEAR,o.CLAMP_TO_EDGE)),this._dirty=!1),this._prepareData(r)}loadTile(r,o){this.tileID&&this.tileID.equals(r.tileID.canonical)?(this.tiles[String(r.tileID.wrap)]=r,r.buckets={},o(null)):(r.state="errored",o(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}const Qe={vector:ke,raster:Ie,"raster-dem":class extends Ie{constructor(l,r,o,h){super(l,r,o,h),this.type="raster-dem",this.maxzoom=22,this._options=a.extend({type:"raster-dem"},r),this.encoding=r.encoding||"mapbox"}loadTile(l,r){const o=this.map._requestManager.normalizeTileURL(l.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize);function h(d,f){d&&(l.state="errored",r(d)),f&&(l.dem=f,l.dem.onDeserialize(),l.needsHillshadePrepare=!0,l.needsDEMTextureUpload=!0,l.state="loaded",r(null))}l.request=a.getImage(this.map._requestManager.transformRequest(o,a.ResourceType.Tile),(function(d,f,g,y){if(delete l.request,l.aborted)l.state="unloaded",r(null);else if(d)l.state="errored",r(d);else if(f){this.map._refreshExpiredTiles&&l.setExpiryData({cacheControl:g,expires:y});const v=a.window.ImageBitmap&&f instanceof a.window.ImageBitmap&&(Gn==null&&(Gn=a.window.OffscreenCanvas&&new a.window.OffscreenCanvas(1,1).getContext("2d")&&typeof a.window.createImageBitmap=="function"),Gn),E=1-(f.width-a.prevPowerOfTwo(f.width))/2;E<1||l.neighboringTiles||(l.neighboringTiles=this._getNeighboringTiles(l.tileID));const T=v?f:a.exported.getImageData(f,E),A={uid:l.uid,coord:l.tileID,source:this.id,rawImageData:T,encoding:this.encoding,padding:E};l.actor&&l.state!=="expired"||(l.actor=this.dispatcher.getActor(),l.actor.send("loadDEMTile",A,h.bind(this),void 0,!0))}}).bind(this))}_getNeighboringTiles(l){const r=l.canonical,o=Math.pow(2,r.z),h=(r.x-1+o)%o,d=r.x===0?l.wrap-1:l.wrap,f=(r.x+1+o)%o,g=r.x+1===o?l.wrap+1:l.wrap,y={};return y[new a.OverscaledTileID(l.overscaledZ,d,r.z,h,r.y).key]={backfilled:!1},y[new a.OverscaledTileID(l.overscaledZ,g,r.z,f,r.y).key]={backfilled:!1},r.y>0&&(y[new a.OverscaledTileID(l.overscaledZ,d,r.z,h,r.y-1).key]={backfilled:!1},y[new a.OverscaledTileID(l.overscaledZ,l.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},y[new a.OverscaledTileID(l.overscaledZ,g,r.z,f,r.y-1).key]={backfilled:!1}),r.y+1{if(this._loaded=!0,this._pendingLoad=null,o)this.fire(new a.ErrorEvent(o));else{const d={dataType:"source",sourceDataType:this._metadataFired?"content":"metadata"};this._collectResourceTiming&&h&&h.resourceTiming&&h.resourceTiming[this.id]&&(d.resourceTiming=h.resourceTiming[this.id]),this.fire(new a.Event("data",d)),this._metadataFired=!0}this._coalesce&&(this._updateWorkerData(),this._coalesce=!1)})}loaded(){return this._loaded}loadTile(l,r){const o=l.actor?"reloadTile":"loadTile";l.actor=this.actor,l.request=this.actor.send(o,{type:this.type,uid:l.uid,tileID:l.tileID,tileZoom:l.tileZoom,zoom:l.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:a.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(h,d)=>(delete l.request,l.unloadVectorData(),l.aborted?r(null):h?r(h):(l.loadVectorData(d,this.map.painter,o==="reloadTile"),r(null))),void 0,o==="loadTile")}abortTile(l){l.request&&(l.request.cancel(),delete l.request),l.aborted=!0}unloadTile(l){l.unloadVectorData(),this.actor.send("removeTile",{uid:l.uid,type:this.type,source:this.id})}onRemove(){this._pendingLoad&&this._pendingLoad.cancel()}serialize(){return a.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}},video:class extends rt{constructor(l,r,o,h){super(l,r,o,h),this.roundZoom=!0,this.type="video",this.options=r}load(){this._loaded=!1;const l=this.options;this.urls=[];for(const r of l.urls)this.urls.push(this.map._requestManager.transformRequest(r,a.ResourceType.Source).url);a.getVideo(this.urls,(r,o)=>{this._loaded=!0,r?this.fire(new a.ErrorEvent(r)):o&&(this.video=o,this.video.loop=!0,this.video.setAttribute("playsinline",""),this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(l){if(this.video){const r=this.video.seekable;lr.end(0)?this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${this.id}`,null,`Playback for this video can be set only between the ${r.start(0)} and ${r.end(0)}-second mark.`))):this.video.currentTime=l}}getVideo(){return this.video}onAdd(l){this.map||(this.map=l,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const l=this.map.painter.context,r=l.gl;this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new a.Texture(l,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),this.width=this.video.videoWidth,this.height=this.video.videoHeight),this._prepareData(l)}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},image:rt,canvas:class extends rt{constructor(l,r,o,h){super(l,r,o,h),r.coordinates?Array.isArray(r.coordinates)&&r.coordinates.length===4&&!r.coordinates.some(d=>!Array.isArray(d)||d.length!==2||d.some(f=>typeof f!="number"))||this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${l}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${l}`,null,'missing required property "coordinates"'))),r.animate&&typeof r.animate!="boolean"&&this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${l}`,null,'optional "animate" property must be a boolean value'))),r.canvas?typeof r.canvas=="string"||r.canvas instanceof a.window.HTMLCanvasElement||this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${l}`,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 a.ErrorEvent(new a.ValidationError(`sources.${l}`,null,'missing required property "canvas"'))),this.options=r,this.animate=r.animate===void 0||r.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof a.window.HTMLCanvasElement?this.options.canvas:a.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new a.ErrorEvent(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(l){this.map=l,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let l=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,l=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,l=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const r=this.map.painter.context;this.texture?(l||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new a.Texture(r,this.canvas,r.gl.RGBA,{premultiply:!0}),this._prepareData(r)}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const l of[this.canvas.width,this.canvas.height])if(isNaN(l)||l<=0)return!0;return!1}},custom:class extends a.Evented{constructor(l,r,o,h){super(),this.id=l,this.type="custom",this._dataType="raster",this._dispatcher=o,this._implementation=r,this.setEventedParent(h),this.scheme="xyz",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this._loaded=!1,this.roundZoom=!0,this._implementation||this.fire(new a.ErrorEvent(new Error(`Missing implementation for ${this.id} custom source`))),this._implementation.loadTile||this.fire(new a.ErrorEvent(new Error(`Missing loadTile implementation for ${this.id} custom source`))),this._implementation.bounds&&(this.tileBounds=new wr(this._implementation.bounds,this.minzoom,this.maxzoom)),r.update=this._update.bind(this),r.clearTiles=this._clearTiles.bind(this),r.coveringTiles=this._coveringTiles.bind(this),a.extend(this,a.pick(r,["dataType","scheme","minzoom","maxzoom","tileSize","attribution","minTileCacheSize","maxTileCacheSize"]))}serialize(){return a.pick(this,["type","scheme","minzoom","maxzoom","tileSize","attribution"])}load(){this._loaded=!0,this.fire(new a.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"content"}))}loaded(){return this._loaded}onAdd(l){this._map=l,this._loaded=!1,this.fire(new a.Event("dataloading",{dataType:"source"})),this._implementation.onAdd&&this._implementation.onAdd(l),this.load()}onRemove(l){this._implementation.onRemove&&this._implementation.onRemove(l)}hasTile(l){if(this._implementation.hasTile){const{x:r,y:o,z:h}=l.canonical;return this._implementation.hasTile({x:r,y:o,z:h})}return!this.tileBounds||this.tileBounds.contains(l.canonical)}loadTile(l,r){const{x:o,y:h,z:d}=l.tileID.canonical,f=new a.window.AbortController;l.request=Promise.resolve(this._implementation.loadTile({x:o,y:h,z:d},{signal:f.signal})).then((function(g){return delete l.request,l.aborted?(l.state="unloaded",r(null)):g===void 0?(l.state="errored",r(null)):g===null?(this.loadTileData(l,{width:this.tileSize,height:this.tileSize,data:null}),l.state="loaded",r(null)):function(y){return y instanceof a.window.ImageData||y instanceof a.window.HTMLCanvasElement||y instanceof a.window.ImageBitmap||y instanceof a.window.HTMLImageElement}(g)?(this.loadTileData(l,g),l.state="loaded",void r(null)):(l.state="errored",r(new Error(`Can't infer data type for ${this.id}, only raster data supported at the moment`)))}).bind(this)).catch(g=>{g.code!==20&&(l.state="errored",r(g))}),l.request.cancel=()=>f.abort()}loadTileData(l,r){Ie.loadTileData(l,r,this._map.painter)}unloadTileData(l){Ie.unloadTileData(l,this._map.painter)}unloadTile(l,r){if(this.unloadTileData(l),this._implementation.unloadTile){const{x:o,y:h,z:d}=l.tileID.canonical;this._implementation.unloadTile({x:o,y:h,z:d})}r()}abortTile(l,r){l.request&&l.request.cancel&&(l.request.cancel(),delete l.request),r()}hasTransition(){return!1}_coveringTiles(){return this._map.transform.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,roundZoom:this.roundZoom}).map(l=>({x:l.canonical.x,y:l.canonical.y,z:l.canonical.z}))}_clearTiles(){this._map.style._clearSource(this.id)}_update(){this.fire(new a.Event("data",{dataType:"source",sourceDataType:"content"}))}}},nt=function(l,r,o,h){const d=new Qe[r.type](l,r,o,h);if(d.id!==l)throw new Error(`Expected Source id to be ${l} instead of ${d.id}`);return a.bindAll(["load","abort","unload","serialize","prepare"],d),d};function ft(l,r){const o=a.identity([]);return a.scale(o,o,[.5*l.width,.5*-l.height,1]),a.translate(o,o,[1,-1,0]),a.multiply(o,o,l.calculateProjMatrix(r.toUnwrapped())),Float32Array.from(o)}function Vt(l,r,o,h,d,f,g,y=!1){const v=l.tilesIn(h,g,y);v.sort(yi);const E=[];for(const A of v)E.push({wrappedTileID:A.tile.tileID.wrapped().key,queryResults:A.tile.queryRenderedFeatures(r,o,l._state,A,d,f,ft(l.transform,A.tile.tileID),y)});const T=function(A){const k={},R={};for(const O of A){const B=O.queryResults,F=O.wrappedTileID,I=R[F]=R[F]||{};for(const L in B){const N=B[L],j=I[L]=I[L]||{},K=k[L]=k[L]||[];for(const J of N)j[J.featureIndex]||(j[J.featureIndex]=!0,K.push(J))}}return k}(E);for(const A in T)T[A].forEach(k=>{const R=k.feature,O=R.layer;O&&O.type!=="background"&&O.type!=="sky"&&(R.source=O.source,O["source-layer"]&&(R.sourceLayer=O["source-layer"]),R.state=R.id!==void 0?l.getFeatureState(O["source-layer"],R.id):{})});return T}function Xt(l,r){const o=l.getRenderableIds().map(f=>l.getTileByID(f)),h=[],d={};for(let f=0;f{o.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[sr]}numActive(){return Object.keys(this.active).length}}let Ti;function Zn(){return Ti||(Ti=new li),Ti}function Ah(l,r){const o={};for(const h in l)h!=="ref"&&(o[h]=l[h]);return a.refProperties.forEach(h=>{h in r&&(o[h]=r[h])}),o}function tc(l){l=l.slice();const r=Object.create(null);for(let o=0;o0?(d-g)/y:0;return this.points[f].mult(1-v).add(this.points[o].mult(v))}}class gn{constructor(r,o,h){const d=this.boxCells=[],f=this.circleCells=[];this.xCellCount=Math.ceil(r/h),this.yCellCount=Math.ceil(o/h);for(let g=0;gthis.width||d<0||o>this.height)return!f&&[];const y=[];if(r<=0&&o<=0&&this.width<=h&&this.height<=d){if(f)return!0;for(let v=0;v0:y}_queryCircle(r,o,h,d,f){const g=r-h,y=r+h,v=o-h,E=o+h;if(y<0||g>this.width||E<0||v>this.height)return!d&&[];const T=[];return this._forEachCell(g,v,y,E,this._queryCellCircle,T,{hitTest:d,circle:{x:r,y:o,radius:h},seenUids:{box:{},circle:{}}},f),d?T.length>0:T}query(r,o,h,d,f){return this._query(r,o,h,d,!1,f)}hitTest(r,o,h,d,f){return this._query(r,o,h,d,!0,f)}hitTestCircle(r,o,h,d){return this._queryCircle(r,o,h,!0,d)}_queryCell(r,o,h,d,f,g,y,v){const E=y.seenUids,T=this.boxCells[f];if(T!==null){const k=this.bboxes;for(const R of T)if(!E.box[R]){E.box[R]=!0;const O=4*R;if(r<=k[O+2]&&o<=k[O+3]&&h>=k[O+0]&&d>=k[O+1]&&(!v||v(this.boxKeys[R]))){if(y.hitTest)return g.push(!0),!0;g.push({key:this.boxKeys[R],x1:k[O],y1:k[O+1],x2:k[O+2],y2:k[O+3]})}}}const A=this.circleCells[f];if(A!==null){const k=this.circles;for(const R of A)if(!E.circle[R]){E.circle[R]=!0;const O=3*R;if(this._circleAndRectCollide(k[O],k[O+1],k[O+2],r,o,h,d)&&(!v||v(this.circleKeys[R]))){if(y.hitTest)return g.push(!0),!0;{const B=k[O],F=k[O+1],I=k[O+2];g.push({key:this.circleKeys[R],x1:B-I,y1:F-I,x2:B+I,y2:F+I})}}}}}_queryCellCircle(r,o,h,d,f,g,y,v){const E=y.circle,T=y.seenUids,A=this.boxCells[f];if(A!==null){const R=this.bboxes;for(const O of A)if(!T.box[O]){T.box[O]=!0;const B=4*O;if(this._circleAndRectCollide(E.x,E.y,E.radius,R[B+0],R[B+1],R[B+2],R[B+3])&&(!v||v(this.boxKeys[O])))return g.push(!0),!0}}const k=this.circleCells[f];if(k!==null){const R=this.circles;for(const O of k)if(!T.circle[O]){T.circle[O]=!0;const B=3*O;if(this._circlesCollide(R[B],R[B+1],R[B+2],E.x,E.y,E.radius)&&(!v||v(this.circleKeys[O])))return g.push(!0),!0}}}_forEachCell(r,o,h,d,f,g,y,v){const E=this._convertToXCellCoord(r),T=this._convertToYCellCoord(o),A=this._convertToXCellCoord(h),k=this._convertToYCellCoord(d);for(let R=E;R<=A;R++)for(let O=T;O<=k;O++)if(f.call(this,r,o,h,d,this.xCellCount*O+R,g,y,v))return}_convertToXCellCoord(r){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(r*this.xScale)))}_convertToYCellCoord(r){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(r*this.yScale)))}_circlesCollide(r,o,h,d,f,g){const y=d-r,v=f-o,E=h+g;return E*E>y*y+v*v}_circleAndRectCollide(r,o,h,d,f,g,y){const v=(g-d)/2,E=Math.abs(r-(d+v));if(E>v+h)return!1;const T=(y-f)/2,A=Math.abs(o-(f+T));if(A>T+h)return!1;if(E<=v||A<=T)return!0;const k=E-v,R=A-T;return k*k+R*R<=h*h}}const Sr={unknown:0,flipRequired:1,flipNotRequired:2},Po=Math.tan(85*Math.PI/180);function fe(l,r,o,h,d,f,g){const y=a.create();if(o)if(f.name==="globe"){const v=a.calculateGlobeLabelMatrix(d,r);a.multiply(y,y,v)}else{const v=Le([],g);y[0]=v[0],y[1]=v[1],y[4]=v[2],y[5]=v[3],h||a.rotateZ(y,y,d.angle)}else a.multiply(y,d.labelPlaneMatrix,l);return y}function Mr(l,r,o,h,d,f,g){const y=fe(l,r,o,h,d,f,g);return f.name==="globe"&&o||(y[2]=y[6]=y[10]=y[14]=0),y}function Ht(l,r,o,h,d,f,g){if(o){if(f.name==="globe"){const y=fe(l,r,o,h,d,f,g);return a.invert(y,y),a.multiply(y,l,y),y}{const y=a.clone(l),v=a.identity([]);return v[0]=g[0],v[1]=g[1],v[4]=g[2],v[5]=g[3],a.multiply(y,y,v),h||a.rotateZ(y,y,-d.angle),y}}return d.glCoordMatrix}function ci(l,r,o,h){const d=[l,r,o,1];o?a.transformMat4$1(d,d,h):at(d,d,h);const f=d[3];return d[0]/=f,d[1]/=f,d[2]/=f,d}function ic(l,r){return Math.min(.5+l/r*.5,1.5)}function lr(l,r){const o=l[0]/l[3],h=l[1]/l[3];return o>=-r[0]&&o<=r[0]&&h>=-r[1]&&h<=r[1]}function Ia(l,r,o,h,d,f,g,y,v,E){const T=o.transform,A=h?l.textSizeData:l.iconSizeData,k=a.evaluateSizeForZoom(A,o.transform.zoom),R=T.projection.name==="globe",O=[256/o.width*2+1,256/o.height*2+1],B=h?l.text.dynamicLayoutVertexArray:l.icon.dynamicLayoutVertexArray;B.clear();let F=null;R&&(F=h?l.text.globeExtVertexArray:l.icon.globeExtVertexArray);const I=l.lineVertexArray,L=h?l.text.placedSymbolArray:l.icon.placedSymbolArray,N=o.transform.width/o.transform.height;let j,K=!1;for(let J=0;JMath.abs(o)?{useVertical:!0}:l===a.WritingMode.vertical?h>0?{needsFlipping:!0}:null:r!==Sr.unknown&&function(d,f){return d===0||Math.abs(f/d)>Po}(o,h)?r===Sr.flipRequired?{needsFlipping:!0}:null:o<0?{needsFlipping:!0}:null}function Oe(l,r,o,h,d,f,g,y,v,E,T,A,k,R,O,B,F,I,L){const N=r/24,j=l.lineOffsetX*N,K=l.lineOffsetY*N,{lineStartIndex:J,glyphStartIndex:Y,numGlyphs:ie,segment:te,writingMode:le,flipState:Te}=l,oe=J+l.lineLength,ge=he=>{if(T){const[Me,ve,Ae]=he.up,Ge=E.length;a.updateGlobeVertexNormal(T,Ge+0,Me,ve,Ae),a.updateGlobeVertexNormal(T,Ge+1,Me,ve,Ae),a.updateGlobeVertexNormal(T,Ge+2,Me,ve,Ae),a.updateGlobeVertexNormal(T,Ge+3,Me,ve,Ae)}const[we,ae,_e]=he.point;a.addDynamicAttributes(E,we,ae,_e,he.angle)};if(ie>1){const he=rc(N,y,j,K,o,A,k,l,v,f,R,B,!1,F,I,L);if(!he)return{notEnoughRoom:!0};if(h&&!o){let[we,ae,_e]=he.first.point,[Me,ve,Ae]=he.last.point;[we,ae]=ci(we,ae,_e,g),[Me,ve]=ci(Me,ve,Ae,g);const Ge=qn(le,Te,(Me-we)*O,ve-ae);if(l.flipState=Ge&&Ge.needsFlipping?Sr.flipRequired:Sr.flipNotRequired,Ge)return Ge}ge(he.first);for(let we=Y+1;we0?Me:st(k,_e,we,1,d,void 0,F,I.canonical),Ae=qn(le,Te,(ve[0]-we[0])*O,ve[1]-we[1]);if(l.flipState=Ae&&Ae.needsFlipping?Sr.flipRequired:Sr.flipNotRequired,Ae)return Ae}const he=Bi(N*y.getoffsetX(Y),j,K,o,A,k,te,J,oe,v,f,R,B,!1,!1,F,I,L);if(!he)return{notEnoughRoom:!0};ge(he)}return{}}function ut(l,r,o,h,d){const{x:f,y:g,z:y}=h.projectTilePoint(l.x,l.y,r);if(!d)return ci(f,g,y,o);const[v,E,T]=d(l);return ci(f+v,g+E,y+T,o)}function st(l,r,o,h,d,f,g,y){const v=ut(l.sub(r)._unit()._add(l),y,d,g,f);return a.sub(v,o,v),a.normalize(v,v),a.scaleAndAdd(v,o,v,h)}function Bi(l,r,o,h,d,f,g,y,v,E,T,A,k,R,O,B,F,I){const L=h?l-r:l+r;let N=L>0?1:-1,j=0;h&&(N*=-1,j=Math.PI),N<0&&(j+=Math.PI);let K=y+g+(N>0?0:1)|0,J=d,Y=d,ie=0,te=0;const le=Math.abs(L),Te=[],oe=[];let ge=f,he=ge;const we=()=>st(he,ge,Y,le-ie+1,T,k,B,F.canonical);for(;ie+te<=le;){if(K+=N,K=v)return null;if(Y=J,he=ge,Te.push(Y),R&&oe.push(he),ge=new a.Point(E.getx(K),E.gety(K)),J=A[K],!J){const qe=ut(ge,F.canonical,T,B,k);J=qe[3]>0?A[K]=qe:we()}ie+=te,te=a.distance(Y,J)}O&&k&&(A[K]&&(J=we(),te=a.distance(Y,J)),A[K]=J);const ae=(le-ie)/te,_e=ge.sub(he)._mult(ae)._add(he),Me=a.sub([],J,Y),ve=a.scaleAndAdd([],Y,Me,ae);let Ae=[0,0,1],Ge=Me[0],Xe=Me[1];if(I&&(Ae=B.upVector(F.canonical,_e.x,_e.y),Ae[0]!==0||Ae[1]!==0||Ae[2]!==1)){const qe=[Ae[2],0,-Ae[0]],lt=a.cross([],Ae,qe);a.normalize(qe,qe),a.normalize(lt,lt),Ge=a.dot(Me,qe),Xe=a.dot(Me,lt)}if(o){const qe=a.cross([],Ae,Me);a.normalize(qe,qe),a.scaleAndAdd(ve,ve,qe,o*N)}const Ve=j+Math.atan2(Xe,Ge);return Te.push(ve),R&&oe.push(_e),{point:ve,angle:Ve,path:Te,tilePath:oe,up:Ae}}function er(l,r){const o=r.length,h=o+4*l;r.resize(h),r.float32.fill(-1/0,4*o,4*h)}function at(l,r,o){const h=r[0],d=r[1];return l[0]=o[0]*h+o[4]*d+o[12],l[1]=o[1]*h+o[5]*d+o[13],l[3]=o[3]*h+o[7]*d+o[15],l}const Oi=100;class ko{constructor(r,o,h=new gn(r.width+200,r.height+200,25),d=new gn(r.width+200,r.height+200,25)){this.transform=r,this.grid=h,this.ignoredGrid=d,this.pitchfactor=Math.cos(r._pitch)*r.cameraToCenterDistance,this.screenRightBoundary=r.width+Oi,this.screenBottomBoundary=r.height+Oi,this.gridRightBoundary=r.width+200,this.gridBottomBoundary=r.height+200,this.fogState=o}placeCollisionBox(r,o,h,d,f,g,y,v){let E=h.projectedAnchorX,T=h.projectedAnchorY,A=h.projectedAnchorZ;const k=h.elevation,R=h.tileID,O=r.getProjection();if(k&&R){const[J,Y,ie]=O.upVector(R.canonical,h.tileAnchorX,h.tileAnchorY),te=O.upVectorScale(R.canonical,this.transform.center.lat,this.transform.worldSize).metersToTile;E+=J*k*te,T+=Y*k*te,A+=ie*k*te}const B=this.projectAndGetPerspectiveRatio(y,E,T,A,h.tileID,O.name==="globe"||!!k||this.transform.pitch>0,O),F=g*B.perspectiveRatio,I=(h.x1*o+d.x-h.padding)*F+B.point.x,L=(h.y1*o+d.y-h.padding)*F+B.point.y,N=(h.x2*o+d.x+h.padding)*F+B.point.x,j=(h.y2*o+d.y+h.padding)*F+B.point.y,K=B.perspectiveRatio<=.55||B.occluded;return!this.isInsideGrid(I,L,N,j)||!f&&this.grid.hitTest(I,L,N,j,v)||K?{box:[],offscreen:!1,occluded:B.occluded}:{box:[I,L,N,j],offscreen:this.isOffscreen(I,L,N,j),occluded:!1}}placeCollisionCircles(r,o,h,d,f,g,y,v,E,T,A,k,R,O,B){const F=[],I=this.transform.elevation,L=r.getProjection(),N=I?I.getAtTileOffsetFunc(B,this.transform.center.lat,this.transform.worldSize,L):null,j=new a.Point(h.tileAnchorX,h.tileAnchorY);let{x:K,y:J,z:Y}=L.projectTilePoint(j.x,j.y,B.canonical);if(N){const[_e,Me,ve]=N(j);K+=_e,J+=Me,Y+=ve}const ie=L.name==="globe",te=this.projectAndGetPerspectiveRatio(y,K,J,Y,B,ie||!!I||this.transform.pitch>0,L),{perspectiveRatio:le}=te,Te=(A?g/le:g*le)/a.ONE_EM,oe=ci(K,J,Y,v),ge=te.signedDistanceFromCamera>0?rc(Te,f,h.lineOffsetX*Te,h.lineOffsetY*Te,!1,oe,j,h,d,v,{},I&&!A?N:null,A&&!!I,L,B,A):null;let he=!1,we=!1,ae=!0;if(ge&&!te.occluded){const _e=.5*R*le+O,Me=new a.Point(-100,-100),ve=new a.Point(this.screenRightBoundary,this.screenBottomBoundary),Ae=new Aa,{first:Ge,last:Xe}=ge,Ve=Ge.path.length;let qe=[];for(let je=Ve-1;je>=1;je--)qe.push(Ge.path[je]);for(let je=1;je(N&&!ie&&(Tt=N(Etje[3]<=0)&&(qe=[]));let ot=[];if(qe.length>0){let je=1/0,wt=-1/0,Tt=1/0,Et=-1/0;for(const St of qe)je=Math.min(je,St[0]),Tt=Math.min(Tt,St[1]),wt=Math.max(wt,St[0]),Et=Math.max(Et,St[1]);wt>=Me.x&&je<=ve.x&&Et>=Me.y&&Tt<=ve.y&&(ot=[qe.map(St=>new a.Point(St[0],St[1]))],(jeve.x||Ttve.y)&&(ot=a.clipLine(ot,Me.x,Me.y,ve.x,ve.y)))}for(const je of ot){Ae.reset(je,.25*_e);let wt=0;wt=Ae.length<=.5*_e?1:Math.ceil(Ae.paddedLength/lt)+1;for(let Tt=0;Tt0?(a.transformMat4$1(v,v,r),this.fogState&&f&&y.name!=="globe"&&(E=function(k,R,O,B,F,I){const L=I.calculateFogTileMatrix(F),N=[R,O,B];return a.transformMat4(N,N,L),Eo(k,N,I.pitch,I._fov)}(this.fogState,o,h,d,f.toUnwrapped(),this.transform)>.9)):at(v,v,r);const T=v[3];return{point:new a.Point((v[0]/T+1)/2*this.transform.width+Oi,(-v[1]/T+1)/2*this.transform.height+Oi),perspectiveRatio:Math.min(.5+this.transform.getCameraToCenterDistance(y)/T*.5,1.5),signedDistanceFromCamera:T,occluded:g&&v[2]>T||E}}isOffscreen(r,o,h,d){return h=this.screenRightBoundary||dthis.screenBottomBoundary}isInsideGrid(r,o,h,d){return h>=0&&r=0&&oh.collisionGroupID===o}}return this.collisionGroups[r]}}function Ro(l,r,o,h,d){const{horizontalAlign:f,verticalAlign:g}=a.getAnchorAlignment(l),y=-(f-.5)*r,v=-(g-.5)*o,E=a.evaluateVariableOffset(l,h);return new a.Point(y+E[0]*d,v+E[1]*d)}function Bo(l,r,o,h,d){const f=new a.Point(l,r);return o&&f._rotate(h?d:-d),f}class Ss{constructor(r,o,h,d,f){this.transform=r.clone(),this.projection=r.projection.name,this.collisionIndex=new ko(this.transform,f),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=o,this.retainedQueryData={},this.collisionGroups=new oc(h),this.collisionCircleArrays={},this.prevPlacement=d,d&&(d.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(r,o,h,d){const f=h.getBucket(o),g=h.latestFeatureIndex;if(!f||!g||o.id!==f.layerIds[0])return;const y=f.layers[0].layout,v=h.collisionBoxArray,E=Math.pow(2,this.transform.zoom-h.tileID.overscaledZ),T=h.tileSize/a.EXTENT,A=h.tileID.toUnwrapped();this.transform.setProjection(f.projection);const k=(R=h.tileID,O=f.getProjection(),B=this.transform,O.name===this.projection?B.calculateProjMatrix(R.toUnwrapped()):yn(B,O,R));var R,O,B;const F=y.get("text-pitch-alignment")==="map",I=y.get("text-rotation-alignment")==="map";o.compileFilter();const L=o.dynamicFilter(),N=o.dynamicFilterNeedsFeature(),j=this.transform.calculatePixelsToTileUnitsMatrix(h),K=Mr(k,h.tileID.canonical,F,I,this.transform,f.getProjection(),j);let J=null;if(F){const te=Ht(k,h.tileID.canonical,F,I,this.transform,f.getProjection(),j);J=a.multiply([],this.transform.labelPlaneMatrix,te)}let Y=null;L&&h.latestFeatureIndex&&(Y={unwrappedTileID:A,dynamicFilter:L,dynamicFilterNeedsFeature:N,featureIndex:h.latestFeatureIndex}),this.retainedQueryData[f.bucketInstanceId]=new Ca(f.bucketInstanceId,g,f.sourceLayerIndex,f.index,h.tileID);const ie={bucket:f,layout:y,posMatrix:k,textLabelPlaneMatrix:K,labelToScreenMatrix:J,clippingData:Y,scale:E,textPixelRatio:T,holdingForFade:h.holdingForFade(),collisionBoxArray:v,partiallyEvaluatedTextSize:a.evaluateSizeForZoom(f.textSizeData,this.transform.zoom),partiallyEvaluatedIconSize:a.evaluateSizeForZoom(f.iconSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(f.sourceID)};if(d)for(const te of f.sortKeyRanges){const{sortKey:le,symbolInstanceStart:Te,symbolInstanceEnd:oe}=te;r.push({sortKey:le,symbolInstanceStart:Te,symbolInstanceEnd:oe,parameters:ie})}else r.push({symbolInstanceStart:0,symbolInstanceEnd:f.symbolInstances.length,parameters:ie})}attemptAnchorPlacement(r,o,h,d,f,g,y,v,E,T,A,k,R,O,B,F,I,L){const{textOffset0:N,textOffset1:j,crossTileID:K}=k,J=[N,j],Y=Ro(r,h,d,J,f),ie=this.collisionIndex.placeCollisionBox(O,f,o,Bo(Y.x,Y.y,g,y,this.transform.angle),A,v,E,T.predicate);if(F){const te=O.getSymbolInstanceIconSize(L,this.transform.zoom,k.placedIconSymbolIndex);if(this.collisionIndex.placeCollisionBox(O,te,F,Bo(Y.x,Y.y,g,y,this.transform.angle),A,v,E,T.predicate).box.length===0)return}if(ie.box.length>0){let te;return this.prevPlacement&&this.prevPlacement.variableOffsets[K]&&this.prevPlacement.placements[K]&&this.prevPlacement.placements[K].text&&(te=this.prevPlacement.variableOffsets[K].anchor),this.variableOffsets[K]={textOffset:J,width:h,height:d,anchor:r,textScale:f,prevAnchor:te},this.markUsedJustification(O,r,k,B),O.allowVerticalPlacement&&(this.markUsedOrientation(O,B,k),this.placedOrientations[K]=B),{shift:Y,placedGlyphBoxes:ie}}}placeLayerBucketPart(r,o,h,d){const{bucket:f,layout:g,posMatrix:y,textLabelPlaneMatrix:v,labelToScreenMatrix:E,clippingData:T,textPixelRatio:A,holdingForFade:k,collisionBoxArray:R,partiallyEvaluatedTextSize:O,partiallyEvaluatedIconSize:B,collisionGroup:F}=r.parameters,I=g.get("text-optional"),L=g.get("icon-optional"),N=g.get("text-allow-overlap"),j=g.get("icon-allow-overlap"),K=g.get("text-rotation-alignment")==="map",J=g.get("text-pitch-alignment")==="map",Y=g.get("icon-text-fit")!=="none",ie=g.get("symbol-z-order")==="viewport-y";this.transform.setProjection(f.projection);let te=N&&(j||!f.hasIconData()||L),le=j&&(N||!f.hasTextData()||I);!f.collisionArrays&&R&&f.deserializeCollisionBoxes(R),h&&d&&f.updateCollisionDebugBuffers(this.transform.zoom,R);const Te=(oe,ge,he)=>{const{crossTileID:we,numVerticalGlyphVertices:ae}=oe;if(T){const Ft={zoom:this.transform.zoom,pitch:this.transform.pitch};let Mt=null;if(T.dynamicFilterNeedsFeature){const yt=this.retainedQueryData[f.bucketInstanceId];Mt=T.featureIndex.loadFeature({featureIndex:oe.featureIndex,bucketIndex:yt.bucketIndex,sourceLayerIndex:yt.sourceLayerIndex,layoutVertexArrayOffset:0})}if(!(0,T.dynamicFilter)(Ft,Mt,this.retainedQueryData[f.bucketInstanceId].tileID.canonical,new a.Point(oe.tileAnchorX,oe.tileAnchorY),this.transform.calculateDistanceTileData(T.unwrappedTileID)))return this.placements[we]=new Do(!1,!1,!1,!0),void o.add(we)}if(o.has(we))return;if(k)return void(this.placements[we]=new Do(!1,!1,!1));let _e=!1,Me=!1,ve=!0,Ae=!1,Ge=!1,Xe=null,Ve={box:null,offscreen:null,occluded:null},qe={box:null,offscreen:null,occluded:null},lt=null,ot=null,je=null,wt=0,Tt=0,Et=0;he.textFeatureIndex?wt=he.textFeatureIndex:oe.useRuntimeCollisionCircles&&(wt=oe.featureIndex),he.verticalTextFeatureIndex&&(Tt=he.verticalTextFeatureIndex);const St=Ft=>{Ft.tileID=this.retainedQueryData[f.bucketInstanceId].tileID;const Mt=this.transform.elevation;(Mt||Ft.elevation)&&(Ft.elevation=Mt?Mt.getAtTileOffset(Ft.tileID,Ft.tileAnchorX,Ft.tileAnchorY):0)},vi=he.textBox;if(vi){St(vi);const Ft=yt=>{let Kt=a.WritingMode.horizontal;if(f.allowVerticalPlacement&&!yt&&this.prevPlacement){const Ei=this.prevPlacement.placedOrientations[we];Ei&&(this.placedOrientations[we]=Ei,Kt=Ei,this.markUsedOrientation(f,Kt,oe))}return Kt},Mt=(yt,Kt)=>{if(f.allowVerticalPlacement&&ae>0&&he.verticalTextBox){for(const Ei of f.writingModes)if(Ei===a.WritingMode.vertical?(Ve=Kt(),qe=Ve):Ve=yt(),Ve&&Ve.box&&Ve.box.length)break}else Ve=yt()};if(g.get("text-variable-anchor")){let yt=g.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[we]){const Bt=this.prevPlacement.variableOffsets[we];yt.indexOf(Bt.anchor)>0&&(yt=yt.filter(Ii=>Ii!==Bt.anchor),yt.unshift(Bt.anchor))}const Kt=(Bt,Ii,Js)=>{const Mn=f.getSymbolInstanceTextSize(O,oe,this.transform.zoom,ge),is=(Bt.x2-Bt.x1)*Mn+2*Bt.padding,Lr=(Bt.y2-Bt.y1)*Mn+2*Bt.padding,Jr=Y&&!j?Ii:null;Jr&&St(Jr);let An={box:[],offscreen:!1,occluded:!1};const Qs=N?2*yt.length:yt.length;for(let rs=0;rs=yt.length,oe,ge,f,Js,Jr,O,B);if(xl&&(An=xl.placedGlyphBoxes,An&&An.box&&An.box.length)){_e=!0,Xe=xl.shift;break}}return An};Mt(()=>Kt(vi,he.iconBox,a.WritingMode.horizontal),()=>{const Bt=he.verticalTextBox;return Bt&&St(Bt),f.allowVerticalPlacement&&!(Ve&&Ve.box&&Ve.box.length)&&ae>0&&Bt?Kt(Bt,he.verticalIconBox,a.WritingMode.vertical):{box:null,offscreen:null,occluded:null}}),Ve&&(_e=Ve.box,ve=Ve.offscreen,Ae=Ve.occluded);const Ei=Ft(!(!Ve||!Ve.box));if(!_e&&this.prevPlacement){const Bt=this.prevPlacement.variableOffsets[we];Bt&&(this.variableOffsets[we]=Bt,this.markUsedJustification(f,Bt.anchor,oe,Ei))}}else{const yt=(Kt,Ei)=>{const Bt=f.getSymbolInstanceTextSize(O,oe,this.transform.zoom,ge),Ii=this.collisionIndex.placeCollisionBox(f,Bt,Kt,new a.Point(0,0),N,A,y,F.predicate);return Ii&&Ii.box&&Ii.box.length&&(this.markUsedOrientation(f,Ei,oe),this.placedOrientations[we]=Ei),Ii};Mt(()=>yt(vi,a.WritingMode.horizontal),()=>{const Kt=he.verticalTextBox;return f.allowVerticalPlacement&&ae>0&&Kt?(St(Kt),yt(Kt,a.WritingMode.vertical)):{box:null,offscreen:null,occluded:null}}),Ft(!!(Ve&&Ve.box&&Ve.box.length))}}if(lt=Ve,_e=lt&<.box&<.box.length>0,ve=lt&<.offscreen,Ae=lt&<.occluded,oe.useRuntimeCollisionCircles){const Ft=f.text.placedSymbolArray.get(oe.centerJustifiedTextSymbolIndex>=0?oe.centerJustifiedTextSymbolIndex:oe.verticalPlacedTextSymbolIndex),Mt=a.evaluateSizeForFeature(f.textSizeData,O,Ft),yt=g.get("text-padding");ot=this.collisionIndex.placeCollisionCircles(f,N,Ft,f.lineVertexArray,f.glyphOffsetArray,Mt,y,v,E,h,J,F.predicate,oe.collisionCircleDiameter*Mt/a.ONE_EM,yt,this.retainedQueryData[f.bucketInstanceId].tileID),_e=N||ot.circles.length>0&&!ot.collisionDetected,ve=ve&&ot.offscreen,Ae=ot.occluded}if(he.iconFeatureIndex&&(Et=he.iconFeatureIndex),he.iconBox){const Ft=Mt=>{St(Mt);const yt=Y&&Xe?Bo(Xe.x,Xe.y,K,J,this.transform.angle):new a.Point(0,0),Kt=f.getSymbolInstanceIconSize(B,this.transform.zoom,oe.placedIconSymbolIndex);return this.collisionIndex.placeCollisionBox(f,Kt,Mt,yt,j,A,y,F.predicate)};qe&&qe.box&&qe.box.length&&he.verticalIconBox?(je=Ft(he.verticalIconBox),Me=je.box.length>0):(je=Ft(he.iconBox),Me=je.box.length>0),ve=ve&&je.offscreen,Ge=je.occluded}const ui=I||oe.numHorizontalGlyphVertices===0&&ae===0,Zi=L||oe.numIconVertices===0;if(ui||Zi?Zi?ui||(Me=Me&&_e):_e=Me&&_e:Me=_e=Me&&_e,_e&<&<.box&&this.collisionIndex.insertCollisionBox(lt.box,g.get("text-ignore-placement"),f.bucketInstanceId,qe&&qe.box&&Tt?Tt:wt,F.ID),Me&&je&&this.collisionIndex.insertCollisionBox(je.box,g.get("icon-ignore-placement"),f.bucketInstanceId,Et,F.ID),ot&&(_e&&this.collisionIndex.insertCollisionCircles(ot.circles,g.get("text-ignore-placement"),f.bucketInstanceId,wt,F.ID),h)){const Ft=f.bucketInstanceId;let Mt=this.collisionCircleArrays[Ft];Mt===void 0&&(Mt=this.collisionCircleArrays[Ft]=new Lo);for(let yt=0;yt=0;--ge){const he=oe[ge];Te(f.symbolInstances.get(he),he,f.collisionArrays[he])}}else for(let oe=r.symbolInstanceStart;oe=0&&(r.text.placedSymbolArray.get(f).crossTileID=A>=0&&f!==A?0:E),g>=0&&(r.text.placedSymbolArray.get(g).crossTileID=A>=0&&g!==A?0:E),y>=0&&(r.text.placedSymbolArray.get(y).crossTileID=A>=0&&y!==A?0:E),v>=0&&(r.text.placedSymbolArray.get(v).crossTileID=A>=0&&v!==A?0:E)}markUsedOrientation(r,o,h){const d=o===a.WritingMode.horizontal||o===a.WritingMode.horizontalOnly?o:0,f=o===a.WritingMode.vertical?o:0,{leftJustifiedTextSymbolIndex:g,centerJustifiedTextSymbolIndex:y,rightJustifiedTextSymbolIndex:v,verticalPlacedTextSymbolIndex:E}=h,T=r.text.placedSymbolArray;g>=0&&(T.get(g).placedOrientation=d),y>=0&&(T.get(y).placedOrientation=d),v>=0&&(T.get(v).placedOrientation=d),E>=0&&(T.get(E).placedOrientation=f)}commit(r){this.commitTime=r,this.zoomAtLastRecencyCheck=this.transform.zoom;const o=this.prevPlacement;let h=!1;this.prevZoomAdjustment=o?o.zoomAdjustment(this.transform.zoom):0;const d=o?o.symbolFadeChange(r):1,f=o?o.opacities:{},g=o?o.variableOffsets:{},y=o?o.placedOrientations:{};for(const v in this.placements){const E=this.placements[v],T=f[v];T?(this.opacities[v]=new Ar(T,d,E.text,E.icon,null,E.clipped),h=h||E.text!==T.text.placed||E.icon!==T.icon.placed):(this.opacities[v]=new Ar(null,d,E.text,E.icon,E.skipFade,E.clipped),h=h||E.text||E.icon)}for(const v in f){const E=f[v];if(!this.opacities[v]){const T=new Ar(E,d,!1,!1);T.isHidden()||(this.opacities[v]=T,h=h||E.text.placed||E.icon.placed)}}for(const v in g)this.variableOffsets[v]||!this.opacities[v]||this.opacities[v].isHidden()||(this.variableOffsets[v]=g[v]);for(const v in y)this.placedOrientations[v]||!this.opacities[v]||this.opacities[v].isHidden()||(this.placedOrientations[v]=y[v]);h?this.lastPlacementChangeTime=r:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=o?o.lastPlacementChangeTime:r)}updateLayerOpacities(r,o){const h=new Set;for(const d of o){const f=d.getBucket(r);f&&d.latestFeatureIndex&&r.id===f.layerIds[0]&&this.updateBucketOpacities(f,h,d.collisionBoxArray)}}updateBucketOpacities(r,o,h){r.hasTextData()&&r.text.opacityVertexArray.clear(),r.hasIconData()&&r.icon.opacityVertexArray.clear(),r.hasIconCollisionBoxData()&&r.iconCollisionBox.collisionVertexArray.clear(),r.hasTextCollisionBoxData()&&r.textCollisionBox.collisionVertexArray.clear();const d=r.layers[0].layout,f=!!r.layers[0].dynamicFilter(),g=new Ar(null,0,!1,!1,!0),y=d.get("text-allow-overlap"),v=d.get("icon-allow-overlap"),E=d.get("text-variable-anchor"),T=d.get("text-rotation-alignment")==="map",A=d.get("text-pitch-alignment")==="map",k=d.get("icon-text-fit")!=="none",R=new Ar(null,0,y&&(v||!r.hasIconData()||d.get("icon-optional")),v&&(y||!r.hasTextData()||d.get("text-optional")),!0);!r.collisionArrays&&h&&(r.hasIconCollisionBoxData()||r.hasTextCollisionBoxData())&&r.deserializeCollisionBoxes(h);const O=(F,I,L)=>{for(let N=0;N0||N>0,te=K>0,le=this.placedOrientations[j],Te=le===a.WritingMode.vertical,oe=le===a.WritingMode.horizontal||le===a.WritingMode.horizontalOnly;if(!ie&&!te||Y.isHidden()||B++,ie){const ge=Oo(Y.text);O(r.text,L,Te?Gt:ge),O(r.text,N,oe?Gt:ge);const he=Y.text.isHidden(),{leftJustifiedTextSymbolIndex:we,centerJustifiedTextSymbolIndex:ae,rightJustifiedTextSymbolIndex:_e,verticalPlacedTextSymbolIndex:Me}=I,ve=r.text.placedSymbolArray,Ae=he||Te?1:0;we>=0&&(ve.get(we).hidden=Ae),ae>=0&&(ve.get(ae).hidden=Ae),_e>=0&&(ve.get(_e).hidden=Ae),Me>=0&&(ve.get(Me).hidden=he||oe?1:0);const Ge=this.variableOffsets[j];Ge&&this.markUsedJustification(r,Ge.anchor,I,le);const Xe=this.placedOrientations[j];Xe&&(this.markUsedJustification(r,"left",I,Xe),this.markUsedOrientation(r,Xe,I))}if(te){const ge=Oo(Y.icon),{placedIconSymbolIndex:he,verticalPlacedIconSymbolIndex:we}=I,ae=r.icon.placedSymbolArray,_e=Y.icon.isHidden()?1:0;he>=0&&(O(r.icon,K,Te?Gt:ge),ae.get(he).hidden=_e),we>=0&&(O(r.icon,I.numVerticalIconVertices,oe?Gt:ge),ae.get(we).hidden=_e)}if(r.hasIconCollisionBoxData()||r.hasTextCollisionBoxData()){const ge=r.collisionArrays[F];if(ge){let he=new a.Point(0,0),we=!0;if(ge.textBox||ge.verticalTextBox){if(E){const _e=this.variableOffsets[j];_e?(he=Ro(_e.anchor,_e.width,_e.height,_e.textOffset,_e.textScale),T&&he._rotate(A?this.transform.angle:-this.transform.angle)):we=!1}f&&(we=!Y.clipped),ge.textBox&&Wn(r.textCollisionBox.collisionVertexArray,Y.text.placed,!we||Te,he.x,he.y),ge.verticalTextBox&&Wn(r.textCollisionBox.collisionVertexArray,Y.text.placed,!we||oe,he.x,he.y)}const ae=we&&!!(!oe&&ge.verticalIconBox);ge.iconBox&&Wn(r.iconCollisionBox.collisionVertexArray,Y.icon.placed,ae,k?he.x:0,k?he.y:0),ge.verticalIconBox&&Wn(r.iconCollisionBox.collisionVertexArray,Y.icon.placed,!ae,k?he.x:0,k?he.y:0)}}}if(r.fullyClipped=B===0,r.sortFeatures(this.transform.angle),this.retainedQueryData[r.bucketInstanceId]&&(this.retainedQueryData[r.bucketInstanceId].featureSortOrder=r.featureSortOrder),r.hasTextData()&&r.text.opacityVertexBuffer&&r.text.opacityVertexBuffer.updateData(r.text.opacityVertexArray),r.hasIconData()&&r.icon.opacityVertexBuffer&&r.icon.opacityVertexBuffer.updateData(r.icon.opacityVertexArray),r.hasIconCollisionBoxData()&&r.iconCollisionBox.collisionVertexBuffer&&r.iconCollisionBox.collisionVertexBuffer.updateData(r.iconCollisionBox.collisionVertexArray),r.hasTextCollisionBoxData()&&r.textCollisionBox.collisionVertexBuffer&&r.textCollisionBox.collisionVertexBuffer.updateData(r.textCollisionBox.collisionVertexArray),r.bucketInstanceId in this.collisionCircleArrays){const F=this.collisionCircleArrays[r.bucketInstanceId];r.placementInvProjMatrix=F.invProjMatrix,r.placementViewportMatrix=F.viewportMatrix,r.collisionCircleArray=F.circles,delete this.collisionCircleArrays[r.bucketInstanceId]}}symbolFadeChange(r){return this.fadeDuration===0?1:(r-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(r){return Math.max(0,(this.transform.zoom-r)/1.5)}hasTransitions(r){return this.stale||r-this.lastPlacementChangeTimer}setStale(){this.stale=!0}}function Wn(l,r,o,h,d){l.emplaceBack(r?1:0,o?1:0,h||0,d||0),l.emplaceBack(r?1:0,o?1:0,h||0,d||0),l.emplaceBack(r?1:0,o?1:0,h||0,d||0),l.emplaceBack(r?1:0,o?1:0,h||0,d||0)}const Mi=Math.pow(2,25),Zt=Math.pow(2,24),za=Math.pow(2,17),Pa=Math.pow(2,16),Ai=Math.pow(2,9),ji=Math.pow(2,8),sc=Math.pow(2,1);function Oo(l){if(l.opacity===0&&!l.placed)return 0;if(l.opacity===1&&l.placed)return 4294967295;const r=l.placed?1:0,o=Math.floor(127*l.opacity);return o*Mi+r*Zt+o*za+r*Pa+o*Ai+r*ji+o*sc+r}const Gt=0;class Fo{constructor(r){this._sortAcrossTiles=r.layout.get("symbol-z-order")!=="viewport-y"&&r.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs=new Set,this._bucketParts=[]}continuePlacement(r,o,h,d,f){const g=this._bucketParts;for(;this._currentTileIndexy.sortKey-v.sortKey));this._currentPartIndex{const g=a.exported.now()-d;return!this._forceFullPlacement&&g>2};for(;this._currentPlacementIndex>=0;){const g=o[r[this._currentPlacementIndex]],y=this.placement.collisionIndex.transform.zoom;if(g.type==="symbol"&&(!g.minzoom||g.minzoom<=y)&&(!g.maxzoom||g.maxzoom>y)){if(this._inProgressLayer||(this._inProgressLayer=new Fo(g)),this._inProgressLayer.continuePlacement(h[g.source],this.placement,this._showCollisionBoxes,g,f))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(r){return this.placement.commit(r),this.placement}}const xn=512/a.EXTENT/2;class fi{constructor(r,o,h){this.tileID=r,this.bucketInstanceId=h,this.index=new a.KDBush(o.length,16,Int32Array),this.keys=[],this.crossTileIDs=[];const d=r.canonical.x*a.EXTENT,f=r.canonical.y*a.EXTENT;for(let g=0;gr.overscaledZ)for(const y in g){const v=g[y];v.tileID.isChildOf(r)&&v.findMatches(o.symbolInstances,r,d)}else{const y=g[r.scaledTo(Number(f)).key];y&&y.findMatches(o.symbolInstances,r,d)}}for(let f=0;f{o[h]=!0});for(const h in this.layerIndexes)o[h]||delete this.layerIndexes[h]}}const Kr=(l,r)=>a.emitValidationErrors(l,r&&r.filter(o=>o.identifier!=="source.canvas")),Ms=a.pick(vt,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setTerrain","setFog","setProjection"]),Ih=a.pick(vt,["setCenter","setZoom","setBearing","setPitch"]),Ra={version:8,layers:[],sources:{}},Xn={fill:!0,line:!0,background:!0,hillshade:!0,raster:!0};class cr extends a.Evented{constructor(r,o={}){super(),this.map=r,this.dispatcher=new oi(Zn(),this),this.imageManager=new wa,this.imageManager.setEventedParent(this),this.glyphManager=new a.GlyphManager(r._requestManager,o.localFontFamily?a.LocalGlyphMode.all:o.localIdeographFontFamily?a.LocalGlyphMode.ideographs:a.LocalGlyphMode.none,o.localFontFamily||o.localIdeographFontFamily),this.crossTileSymbolIndex=new Ir,this._layers={},this._num3DLayers=0,this._numSymbolLayers=0,this._numCircleLayers=0,this._serializedLayers={},this._sourceCaches={},this._otherSourceCaches={},this._symbolSourceCaches={},this._loaded=!1,this._availableImages=[],this._order=[],this._drapedFirstOrder=[],this._markersNeedUpdate=!1,this._resetUpdates(),this.dispatcher.broadcast("setReferrer",a.getReferrer());const h=this;this._rtlTextPluginCallback=cr.registerForPluginStateChange(d=>{h.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:d.pluginStatus,pluginURL:d.pluginURL},(f,g)=>{if(a.triggerPluginCompletionEvent(f),g&&g.every(y=>y))for(const y in h._sourceCaches){const v=h._sourceCaches[y],E=v.getSource().type;E!=="vector"&&E!=="geojson"||v.reload()}})}),this.on("data",d=>{if(d.dataType!=="source"||d.sourceDataType!=="metadata")return;const f=this.getSource(d.sourceId);if(f&&f.vectorLayerIds)for(const g in this._layers){const y=this._layers[g];y.source===f.id&&this._validateLayer(y)}})}loadURL(r,o={}){this.fire(new a.Event("dataloading",{dataType:"style"}));const h=typeof o.validate=="boolean"?o.validate:!a.isMapboxURL(r);r=this.map._requestManager.normalizeStyleURL(r,o.accessToken);const d=this.map._requestManager.transformRequest(r,a.ResourceType.Style);this._request=a.getJSON(d,(f,g)=>{this._request=null,f?this.fire(new a.ErrorEvent(f)):g&&this._load(g,h)})}loadJSON(r,o={}){this.fire(new a.Event("dataloading",{dataType:"style"})),this._request=a.exported.frame(()=>{this._request=null,this._load(r,o.validate!==!1)})}loadEmpty(){this.fire(new a.Event("dataloading",{dataType:"style"})),this._load(Ra,!1)}_updateLayerCount(r,o){const h=o?1:-1;r.is3D()&&(this._num3DLayers+=h),r.type==="circle"&&(this._numCircleLayers+=h),r.type==="symbol"&&(this._numSymbolLayers+=h)}_load(r,o){if(o&&Kr(this,a.validateStyle(r)))return;this._loaded=!0,this.stylesheet=a.clone$1(r),this._updateMapProjection();for(const d in r.sources)this.addSource(d,r.sources[d],{validate:!1});this._changed=!1,r.sprite?this._loadSprite(r.sprite):(this.imageManager.setLoaded(!0),this.dispatcher.broadcast("spriteLoaded",!0)),this.glyphManager.setURL(r.glyphs);const h=tc(this.stylesheet.layers);this._order=h.map(d=>d.id),this._layers={},this._serializedLayers={};for(const d of h){const f=a.createStyleLayer(d);f.setEventedParent(this,{layer:{id:f.id}}),this._layers[f.id]=f,this._serializedLayers[f.id]=f.serialize(),this._updateLayerCount(f,!0)}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new si(this.stylesheet.light),this.stylesheet.terrain&&!this.terrainSetForDrapingOnly()&&this._createTerrain(this.stylesheet.terrain,1),this.stylesheet.fog&&this._createFog(this.stylesheet.fog),this._updateDrapeFirstLayers(),this.fire(new a.Event("data",{dataType:"style"})),this.fire(new a.Event("style.load"))}terrainSetForDrapingOnly(){return!!this.terrain&&this.terrain.drapeRenderMode===0}setProjection(r){r?this.stylesheet.projection=r:delete this.stylesheet.projection,this._updateMapProjection()}applyProjectionUpdate(){this._loaded&&(this.dispatcher.broadcast("setProjection",this.map.transform.projectionOptions),this.map.transform.projection.requiresDraping?this.getTerrain()||this.stylesheet.terrain||this.setTerrainForDraping():this.terrainSetForDrapingOnly()&&this.setTerrain(null))}_updateMapProjection(){this.map._useExplicitProjection?this.applyProjectionUpdate():this.map._prioritizeAndUpdateProjection(null,this.stylesheet.projection)}_loadSprite(r){this._spriteRequest=function(o,h,d){let f,g,y;const v=a.exported.devicePixelRatio>1?"@2x":"";let E=a.getJSON(h.transformRequest(h.normalizeSpriteURL(o,v,".json"),a.ResourceType.SpriteJSON),(k,R)=>{E=null,y||(y=k,f=R,A())}),T=a.getImage(h.transformRequest(h.normalizeSpriteURL(o,v,".png"),a.ResourceType.SpriteImage),(k,R)=>{T=null,y||(y=k,g=R,A())});function A(){if(y)d(y);else if(f&&g){const k=a.exported.getImageData(g),R={};for(const O in f){const{width:B,height:F,x:I,y:L,sdf:N,pixelRatio:j,stretchX:K,stretchY:J,content:Y}=f[O],ie=new a.RGBAImage({width:B,height:F});a.RGBAImage.copy(k,ie,{x:I,y:L},{x:0,y:0},{width:B,height:F}),R[O]={data:ie,pixelRatio:j,sdf:N,stretchX:K,stretchY:J,content:Y}}d(null,R)}}return{cancel(){E&&(E.cancel(),E=null),T&&(T.cancel(),T=null)}}}(r,this.map._requestManager,(o,h)=>{if(this._spriteRequest=null,o)this.fire(new a.ErrorEvent(o));else if(h)for(const d in h)this.imageManager.addImage(d,h[d]);this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),this.dispatcher.broadcast("setImages",this._availableImages),this.dispatcher.broadcast("spriteLoaded",!0),this.fire(new a.Event("data",{dataType:"style"}))})}_validateLayer(r){const o=this.getSource(r.source);if(!o)return;const h=r.sourceLayer;h&&(o.type==="geojson"||o.vectorLayerIds&&o.vectorLayerIds.indexOf(h)===-1)&&this.fire(new a.ErrorEvent(new Error(`Source layer "${h}" does not exist on source "${o.id}" as specified by style layer "${r.id}"`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const r in this._sourceCaches)if(!this._sourceCaches[r].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeLayers(r){const o=[];for(const h of r){const d=this._layers[h];d.type!=="custom"&&o.push(d.serialize())}return o}hasTransitions(){if(this.light&&this.light.hasTransition()||this.fog&&this.fog.hasTransition())return!0;for(const r in this._sourceCaches)if(this._sourceCaches[r].hasTransition())return!0;for(const r in this._layers)if(this._layers[r].hasTransition())return!0;return!1}get order(){return this.map._optimizeForTerrain&&this.terrain?this._drapedFirstOrder:this._order}isLayerDraped(r){return!!this.terrain&&(typeof r.isLayerDraped=="function"?r.isLayerDraped():Xn[r.type])}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading")}update(r){if(!this._loaded)return;const o=this._changed;if(this._changed){const d=Object.keys(this._updatedLayers),f=Object.keys(this._removedLayers);(d.length||f.length)&&this._updateWorkerLayers(d,f);for(const g in this._updatedSources){const y=this._updatedSources[g];y==="reload"?this._reloadSource(g):y==="clear"&&this._clearSource(g)}this._updateTilesForChangedImages();for(const g in this._updatedPaintProps)this._layers[g].updateTransitions(r);this.light.updateTransitions(r),this.fog&&this.fog.updateTransitions(r),this._resetUpdates()}const h={};for(const d in this._sourceCaches){const f=this._sourceCaches[d];h[d]=f.used,f.used=!1}for(const d of this._order){const f=this._layers[d];if(f.recalculate(r,this._availableImages),!f.isHidden(r.zoom)){const y=this._getLayerSourceCache(f);y&&(y.used=!0)}const g=this.map.painter;if(g){const y=f.getProgramIds();if(!y)continue;const v=f.getProgramConfiguration(r.zoom);for(const E of y)g.useProgram(E,v)}}for(const d in h){const f=this._sourceCaches[d];h[d]!==f.used&&f.getSource().fire(new a.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:f.getSource().id}))}this.light.recalculate(r),this.terrain&&this.terrain.recalculate(r),this.fog&&this.fog.recalculate(r),this.z=r.zoom,this._markersNeedUpdate&&(this._updateMarkersOpacity(),this._markersNeedUpdate=!1),o&&this.fire(new a.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){const r=Object.keys(this._changedImages);if(r.length){for(const o in this._sourceCaches)this._sourceCaches[o].reloadTilesForDependencies(["icons","patterns"],r);this._changedImages={}}}_updateWorkerLayers(r,o){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(r),removedIds:o})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}}setState(r){if(this._checkLoaded(),Kr(this,a.validateStyle(r)))return!1;(r=a.clone$1(r)).layers=tc(r.layers);const o=function(d,f){if(!d)return[{command:vt.setStyle,args:[f]}];let g=[];try{if(!Se(d.version,f.version))return[{command:vt.setStyle,args:[f]}];Se(d.center,f.center)||g.push({command:vt.setCenter,args:[f.center]}),Se(d.zoom,f.zoom)||g.push({command:vt.setZoom,args:[f.zoom]}),Se(d.bearing,f.bearing)||g.push({command:vt.setBearing,args:[f.bearing]}),Se(d.pitch,f.pitch)||g.push({command:vt.setPitch,args:[f.pitch]}),Se(d.sprite,f.sprite)||g.push({command:vt.setSprite,args:[f.sprite]}),Se(d.glyphs,f.glyphs)||g.push({command:vt.setGlyphs,args:[f.glyphs]}),Se(d.transition,f.transition)||g.push({command:vt.setTransition,args:[f.transition]}),Se(d.light,f.light)||g.push({command:vt.setLight,args:[f.light]}),Se(d.fog,f.fog)||g.push({command:vt.setFog,args:[f.fog]}),Se(d.projection,f.projection)||g.push({command:vt.setProjection,args:[f.projection]});const y={},v=[];(function(A,k,R,O){let B;for(B in k=k||{},A=A||{})A.hasOwnProperty(B)&&(k.hasOwnProperty(B)||zo(B,R,O));for(B in k){if(!k.hasOwnProperty(B))continue;const F=k[B];A.hasOwnProperty(B)?Se(A[B],F)||(A[B].type==="geojson"&&F.type==="geojson"&&Es(A,k,B)?R.push({command:vt.setGeoJSONSourceData,args:[B,F.data]}):Sa(B,k,R,O)):Ea(B,k,R)}})(d.sources,f.sources,v,y);const E=[];d.layers&&d.layers.forEach(A=>{A.source&&y[A.source]?g.push({command:vt.removeLayer,args:[A.id]}):E.push(A)});let T=d.terrain;T&&y[T.source]&&(g.push({command:vt.setTerrain,args:[void 0]}),T=void 0),g=g.concat(v),Se(T,f.terrain)||g.push({command:vt.setTerrain,args:[f.terrain]}),function(A,k,R){k=k||[];const O=(A=A||[]).map(Er),B=k.map(Er),F=A.reduce(Ma,{}),I=k.reduce(Ma,{}),L=O.slice(),N=Object.create(null);let j,K,J,Y,ie,te,le;for(j=0,K=0;j!(d.command in Ih));if(o.length===0)return!1;const h=o.filter(d=>!(d.command in Ms));if(h.length>0)throw new Error(`Unimplemented: ${h.map(d=>d.command).join(", ")}.`);return o.forEach(d=>{d.command!=="setTransition"&&d.command!=="setProjection"&&this[d.command].apply(this,d.args)}),this.stylesheet=r,this._updateMapProjection(),!0}addImage(r,o){return this.getImage(r)?this.fire(new a.ErrorEvent(new Error("An image with this name already exists."))):(this.imageManager.addImage(r,o),this._afterImageUpdated(r),this)}updateImage(r,o){this.imageManager.updateImage(r,o)}getImage(r){return this.imageManager.getImage(r)}removeImage(r){return this.getImage(r)?(this.imageManager.removeImage(r),this._afterImageUpdated(r),this):this.fire(new a.ErrorEvent(new Error("No image with this name exists.")))}_afterImageUpdated(r){this._availableImages=this.imageManager.listImages(),this._changedImages[r]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new a.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this._availableImages.slice()}addSource(r,o,h={}){if(this._checkLoaded(),this.getSource(r)!==void 0)throw new Error("There is already a source with this ID");if(!o.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(o).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(o.type)>=0&&this._validate(a.validateSource,`sources.${r}`,o,null,h))return;this.map&&this.map._collectResourceTiming&&(o.collectResourceTiming=!0);const d=nt(r,o,this.dispatcher,this);d.setEventedParent(this,()=>({isSourceLoaded:this._isSourceCacheLoaded(r),source:d.serialize(),sourceId:r}));const f=g=>{const y=(g?"symbol:":"other:")+r,v=this._sourceCaches[y]=new a.SourceCache(y,d,g);(g?this._symbolSourceCaches:this._otherSourceCaches)[r]=v,v.style=this,v.onAdd(this.map)};f(!1),o.type!=="vector"&&o.type!=="geojson"||f(!0),d.onAdd&&d.onAdd(this.map),this._changed=!0}removeSource(r){this._checkLoaded();const o=this.getSource(r);if(!o)throw new Error("There is no source with this ID");for(const d in this._layers)if(this._layers[d].source===r)return this.fire(new a.ErrorEvent(new Error(`Source "${r}" cannot be removed while layer "${d}" is using it.`)));if(this.terrain&&this.terrain.get().source===r)return this.fire(new a.ErrorEvent(new Error(`Source "${r}" cannot be removed while terrain is using it.`)));const h=this._getSourceCaches(r);for(const d of h)delete this._sourceCaches[d.id],delete this._updatedSources[d.id],d.fire(new a.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:d.getSource().id})),d.setEventedParent(null),d.clearTiles();return delete this._otherSourceCaches[r],delete this._symbolSourceCaches[r],o.setEventedParent(null),o.onRemove&&o.onRemove(this.map),this._changed=!0,this}setGeoJSONSourceData(r,o){this._checkLoaded(),this.getSource(r).setData(o),this._changed=!0}getSource(r){const o=this._getSourceCache(r);return o&&o.getSource()}_getSources(){const r=[];for(const o in this._otherSourceCaches){const h=this._getSourceCache(o);h&&r.push(h.getSource())}return r}addLayer(r,o,h={}){this._checkLoaded();const d=r.id;if(this.getLayer(d))return void this.fire(new a.ErrorEvent(new Error(`Layer with id "${d}" already exists on this map`)));let f;if(r.type==="custom"){if(Kr(this,a.validateCustomStyleLayer(r)))return;f=a.createStyleLayer(r)}else{if(typeof r.source=="object"&&(this.addSource(d,r.source),r=a.clone$1(r),r=a.extend(r,{source:d})),this._validate(a.validateLayer,`layers.${d}`,r,{arrayIndex:-1},h))return;f=a.createStyleLayer(r),this._validateLayer(f),f.setEventedParent(this,{layer:{id:d}}),this._serializedLayers[f.id]=f.serialize(),this._updateLayerCount(f,!0)}const g=o?this._order.indexOf(o):this._order.length;if(o&&g===-1)return void this.fire(new a.ErrorEvent(new Error(`Layer with id "${o}" does not exist on this map.`)));this._order.splice(g,0,d),this._layerOrderChanged=!0,this._layers[d]=f;const y=this._getLayerSourceCache(f);if(this._removedLayers[d]&&f.source&&y&&f.type!=="custom"){const v=this._removedLayers[d];delete this._removedLayers[d],v.type!==f.type?this._updatedSources[f.source]="clear":(this._updatedSources[f.source]="reload",y.pause())}this._updateLayer(f),f.onAdd&&f.onAdd(this.map),this._updateDrapeFirstLayers()}moveLayer(r,o){if(this._checkLoaded(),this._changed=!0,!this._layers[r])return void this.fire(new a.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style and cannot be moved.`)));if(r===o)return;const h=this._order.indexOf(r);this._order.splice(h,1);const d=o?this._order.indexOf(o):this._order.length;o&&d===-1?this.fire(new a.ErrorEvent(new Error(`Layer with id "${o}" does not exist on this map.`))):(this._order.splice(d,0,r),this._layerOrderChanged=!0,this._updateDrapeFirstLayers())}removeLayer(r){this._checkLoaded();const o=this._layers[r];if(!o)return void this.fire(new a.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style and cannot be removed.`)));o.setEventedParent(null),this._updateLayerCount(o,!1);const h=this._order.indexOf(r);this._order.splice(h,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[r]=o,delete this._layers[r],delete this._serializedLayers[r],delete this._updatedLayers[r],delete this._updatedPaintProps[r],o.onRemove&&o.onRemove(this.map),this._updateDrapeFirstLayers()}getLayer(r){return this._layers[r]}hasLayer(r){return r in this._layers}hasLayerType(r){for(const o in this._layers)if(this._layers[o].type===r)return!0;return!1}setLayerZoomRange(r,o,h){this._checkLoaded();const d=this.getLayer(r);d?d.minzoom===o&&d.maxzoom===h||(o!=null&&(d.minzoom=o),h!=null&&(d.maxzoom=h),this._updateLayer(d)):this.fire(new a.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style and cannot have zoom extent.`)))}setFilter(r,o,h={}){this._checkLoaded();const d=this.getLayer(r);if(d){if(!Se(d.filter,o))return o==null?(d.filter=void 0,void this._updateLayer(d)):void(this._validate(a.validateFilter,`layers.${d.id}.filter`,o,{layerType:d.type},h)||(d.filter=a.clone$1(o),this._updateLayer(d)))}else this.fire(new a.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style and cannot be filtered.`)))}getFilter(r){const o=this.getLayer(r);return o&&a.clone$1(o.filter)}setLayoutProperty(r,o,h,d={}){this._checkLoaded();const f=this.getLayer(r);f?Se(f.getLayoutProperty(o),h)||(f.setLayoutProperty(o,h,d),this._updateLayer(f)):this.fire(new a.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style and cannot be styled.`)))}getLayoutProperty(r,o){const h=this.getLayer(r);if(h)return h.getLayoutProperty(o);this.fire(new a.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style.`)))}setPaintProperty(r,o,h,d={}){this._checkLoaded();const f=this.getLayer(r);f?Se(f.getPaintProperty(o),h)||(f.setPaintProperty(o,h,d)&&this._updateLayer(f),this._changed=!0,this._updatedPaintProps[r]=!0):this.fire(new a.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style and cannot be styled.`)))}getPaintProperty(r,o){const h=this.getLayer(r);return h&&h.getPaintProperty(o)}setFeatureState(r,o){this._checkLoaded();const h=r.source,d=r.sourceLayer,f=this.getSource(h);if(!f)return void this.fire(new a.ErrorEvent(new Error(`The source '${h}' does not exist in the map's style.`)));const g=f.type;if(g==="geojson"&&d)return void this.fire(new a.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));if(g==="vector"&&!d)return void this.fire(new a.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));r.id===void 0&&this.fire(new a.ErrorEvent(new Error("The feature id parameter must be provided.")));const y=this._getSourceCaches(h);for(const v of y)v.setFeatureState(d,r.id,o)}removeFeatureState(r,o){this._checkLoaded();const h=r.source,d=this.getSource(h);if(!d)return void this.fire(new a.ErrorEvent(new Error(`The source '${h}' does not exist in the map's style.`)));const f=d.type,g=f==="vector"?r.sourceLayer:void 0;if(f==="vector"&&!g)return void this.fire(new a.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));if(o&&typeof r.id!="string"&&typeof r.id!="number")return void this.fire(new a.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));const y=this._getSourceCaches(h);for(const v of y)v.removeFeatureState(g,r.id,o)}getFeatureState(r){this._checkLoaded();const o=r.source,h=r.sourceLayer,d=this.getSource(o);if(d){if(d.type!=="vector"||h)return r.id===void 0&&this.fire(new a.ErrorEvent(new Error("The feature id parameter must be provided."))),this._getSourceCaches(o)[0].getFeatureState(h,r.id);this.fire(new a.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new a.ErrorEvent(new Error(`The source '${o}' does not exist in the map's style.`)))}getTransition(){return a.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){const r={};for(const o in this._sourceCaches){const h=this._sourceCaches[o].getSource();r[h.id]||(r[h.id]=h.serialize())}return a.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,terrain:this.getTerrain()||void 0,fog:this.stylesheet.fog,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,projection:this.stylesheet.projection,sources:r,layers:this._serializeLayers(this._order)},o=>o!==void 0)}_updateLayer(r){this._updatedLayers[r.id]=!0;const o=this._getLayerSourceCache(r);r.source&&!this._updatedSources[r.source]&&o&&o.getSource().type!=="raster"&&(this._updatedSources[r.source]="reload",o.pause()),this._changed=!0,r.invalidateCompiledFilter()}_flattenAndSortRenderedFeatures(r){const o=g=>this._layers[g].type==="fill-extrusion",h={},d=[];for(let g=this._order.length-1;g>=0;g--){const y=this._order[g];if(o(y)){h[y]=g;for(const v of r){const E=v[y];if(E)for(const T of E)d.push(T)}}}d.sort((g,y)=>y.intersectionZ-g.intersectionZ);const f=[];for(let g=this._order.length-1;g>=0;g--){const y=this._order[g];if(o(y))for(let v=d.length-1;v>=0;v--){const E=d[v].feature;if(h[E.layer.id]{const E=this.getLayer(v);return E&&E.is3D()}):this.has3DLayers(),y=$r.createFromScreenPoints(r,h);for(const v in this._sourceCaches){const E=this._sourceCaches[v].getSource().id;o.layers&&!d[E]||f.push(Vt(this._sourceCaches[v],this._layers,this._serializedLayers,y,o,h,g,!!this.map._showQueryGeometry))}return this.placement&&f.push(function(v,E,T,A,k,R,O){const B={},F=R.queryRenderedSymbols(A),I=[];for(const L of Object.keys(F).map(Number))I.push(O[L]);I.sort(yi);for(const L of I){const N=L.featureIndex.lookupSymbolFeatures(F[L.bucketInstanceId],E,L.bucketIndex,L.sourceLayerIndex,k.filter,k.layers,k.availableImages,v);for(const j in N){const K=B[j]=B[j]||[],J=N[j];J.sort((Y,ie)=>{const te=L.featureSortOrder;if(te){const le=te.indexOf(Y.featureIndex);return te.indexOf(ie.featureIndex)-le}return ie.featureIndex-Y.featureIndex});for(const Y of J)K.push(Y)}}for(const L in B)B[L].forEach(N=>{const j=N.feature,K=T(v[L]);if(!K)return;const J=K.getFeatureState(j.layer["source-layer"],j.id);j.source=j.layer.source,j.layer["source-layer"]&&(j.sourceLayer=j.layer["source-layer"]),j.state=J});return B}(this._layers,this._serializedLayers,this._getLayerSourceCache.bind(this),y.screenGeometry,o,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(f)}querySourceFeatures(r,o){o&&o.filter&&this._validate(a.validateFilter,"querySourceFeatures.filter",o.filter,null,o);const h=this._getSourceCaches(r);let d=[];for(const f of h)d=d.concat(Xt(f,o));return d}addSourceType(r,o,h){return cr.getSourceType(r)?h(new Error(`A source type called "${r}" already exists.`)):(cr.setSourceType(r,o),o.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:r,url:o.workerSourceURL},h):h(null,null))}getLight(){return this.light.getLight()}setLight(r,o={}){this._checkLoaded();const h=this.light.getLight();let d=!1;for(const g in r)if(!Se(r[g],h[g])){d=!0;break}if(!d)return;const f=this._setTransitionParameters({duration:300,delay:0});this.light.setLight(r,o),this.light.updateTransitions(f)}getTerrain(){return this.terrain&&this.terrain.drapeRenderMode===1?this.terrain.get():null}setTerrainForDraping(){this.setTerrain({source:"",exaggeration:0},0)}setTerrain(r,o=1){if(this._checkLoaded(),!r)return delete this.terrain,delete this.stylesheet.terrain,this.dispatcher.broadcast("enableTerrain",!1),this._force3DLayerUpdate(),void(this._markersNeedUpdate=!0);let h=r;if(o===1){if(typeof h.source=="object"){const d="terrain-dem-src";this.addSource(d,h.source),h=a.clone$1(h),h=a.extend(h,{source:d})}if(this._validate(a.validateTerrain,"terrain",h))return}if(!this.terrain||this.terrain&&o!==this.terrain.drapeRenderMode){if(!h)return;this._createTerrain(h,o)}else{const d=this.terrain,f=d.get();for(const g of Object.keys(a.spec.terrain))!h.hasOwnProperty(g)&&a.spec.terrain[g].default&&(h[g]=a.spec.terrain[g].default);for(const g in h)if(!Se(h[g],f[g])){d.set(h),this.stylesheet.terrain=h;const y=this._setTransitionParameters({duration:0});d.updateTransitions(y);break}}this._updateDrapeFirstLayers(),this._markersNeedUpdate=!0}_createFog(r){const o=this.fog=new On(r,this.map.transform);this.stylesheet.fog=r;const h=this._setTransitionParameters({duration:0});o.updateTransitions(h)}_updateMarkersOpacity(){this.map._markers.length!==0&&this.map._requestDomTask(()=>{for(const r of this.map._markers)r._evaluateOpacity()})}getFog(){return this.fog?this.fog.get():null}setFog(r){if(this._checkLoaded(),!r)return delete this.fog,delete this.stylesheet.fog,void(this._markersNeedUpdate=!0);if(this.fog){const o=this.fog,h=o.get();Object.keys(r).length===0&&o.set(r);for(const d in r)if(!Se(r[d],h[d])){o.set(r),this.stylesheet.fog=r;const f=this._setTransitionParameters({duration:0});o.updateTransitions(f);break}}else this._createFog(r);this._markersNeedUpdate=!0}_setTransitionParameters(r){return{now:a.exported.now(),transition:a.extend(r,this.stylesheet.transition)}}_updateDrapeFirstLayers(){if(!this.map._optimizeForTerrain||!this.terrain)return;const r=this._order.filter(h=>this.isLayerDraped(this._layers[h])),o=this._order.filter(h=>!this.isLayerDraped(this._layers[h]));this._drapedFirstOrder=[],this._drapedFirstOrder.push(...r),this._drapedFirstOrder.push(...o)}_createTerrain(r,o){const h=this.terrain=new gs(r,o);this.stylesheet.terrain=r,this.dispatcher.broadcast("enableTerrain",!this.terrainSetForDrapingOnly()),this._force3DLayerUpdate();const d=this._setTransitionParameters({duration:0});h.updateTransitions(d)}_force3DLayerUpdate(){for(const r in this._layers){const o=this._layers[r];o.type==="fill-extrusion"&&this._updateLayer(o)}}_forceSymbolLayerUpdate(){for(const r in this._layers){const o=this._layers[r];o.type==="symbol"&&this._updateLayer(o)}}_validate(r,o,h,d,f={}){return(!f||f.validate!==!1)&&Kr(this,r.call(a.validateStyle,a.extend({key:o,style:this.serialize(),value:h,styleSpec:a.spec},d)))}_remove(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),a.evented.off("pluginStateChange",this._rtlTextPluginCallback);for(const r in this._layers)this._layers[r].setEventedParent(null);for(const r in this._sourceCaches)this._sourceCaches[r].clearTiles(),this._sourceCaches[r].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()}_clearSource(r){const o=this._getSourceCaches(r);for(const h of o)h.clearTiles()}_reloadSource(r){const o=this._getSourceCaches(r);for(const h of o)h.resume(),h.reload()}_reloadSources(){for(const r of this._getSources())r.reload&&r.reload()}_updateSources(r){for(const o in this._sourceCaches)this._sourceCaches[o].update(r)}_generateCollisionBoxes(){for(const r in this._sourceCaches){const o=this._sourceCaches[r];o.resume(),o.reload()}}_updatePlacement(r,o,h,d,f=!1){let g=!1,y=!1;const v={};for(const E of this._order){const T=this._layers[E];if(T.type!=="symbol")continue;if(!v[T.source]){const k=this._getLayerSourceCache(T);if(!k)continue;v[T.source]=k.getRenderableIds(!0).map(R=>k.getTileByID(R)).sort((R,O)=>O.tileID.overscaledZ-R.tileID.overscaledZ||(R.tileID.isLessThan(O.tileID)?-1:1))}const A=this.crossTileSymbolIndex.addLayer(T,v[T.source],r.center.lng,r.projection);g=g||A}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),f=f||this._layerOrderChanged||h===0,this._layerOrderChanged&&this.fire(new a.Event("neworder")),(f||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(a.exported.now(),r.zoom))&&(this.pauseablePlacement=new ka(r,this._order,f,o,h,d,this.placement,this.fog&&r.projection.supportsFog?this.fog.state:null),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,v),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(a.exported.now()),y=!0),g&&this.pauseablePlacement.placement.setStale()),y||g)for(const E of this._order){const T=this._layers[E];T.type==="symbol"&&this.placement.updateLayerOpacities(T,v[T.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(a.exported.now())}_releaseSymbolFadeTiles(){for(const r in this._sourceCaches)this._sourceCaches[r].releaseSymbolFadeTiles()}getImages(r,o,h){this.imageManager.getImages(o.icons,h),this._updateTilesForChangedImages();const d=f=>{f&&f.setDependencies(o.tileID.key,o.type,o.icons)};d(this._otherSourceCaches[o.source]),d(this._symbolSourceCaches[o.source])}getGlyphs(r,o,h){this.glyphManager.getGlyphs(o.stacks,h)}getResource(r,o,h){return a.makeRequest(o,h)}_getSourceCache(r){return this._otherSourceCaches[r]}_getLayerSourceCache(r){return r.type==="symbol"?this._symbolSourceCaches[r.source]:this._otherSourceCaches[r.source]}_getSourceCaches(r){const o=[];return this._otherSourceCaches[r]&&o.push(this._otherSourceCaches[r]),this._symbolSourceCaches[r]&&o.push(this._symbolSourceCaches[r]),o}_isSourceCacheLoaded(r){const o=this._getSourceCaches(r);return o.length===0?(this.fire(new a.ErrorEvent(new Error(`There is no source with ID '${r}'`))),!1):o.every(h=>h.loaded())}has3DLayers(){return this._num3DLayers>0}hasSymbolLayers(){return this._numSymbolLayers>0}hasCircleLayers(){return this._numCircleLayers>0}_clearWorkerCaches(){this.dispatcher.broadcast("clearCaches")}destroy(){this._clearWorkerCaches(),this.terrainSetForDrapingOnly()&&(delete this.terrain,delete this.stylesheet.terrain)}}cr.getSourceType=function(l){return Qe[l]},cr.setSourceType=function(l,r){Qe[l]=r},cr.registerForPluginStateChange=a.registerForPluginStateChange;var Ba=` -#define EPSILON 0.0000001 -#define PI 3.141592653589793 -#define EXTENT 8192.0 -#define HALF_PI PI/2.0 -#define QUARTER_PI PI/4.0 -#define RAD_TO_DEG 180.0/PI -#define DEG_TO_RAD PI/180.0 -#define GLOBE_RADIUS EXTENT/PI/2.0`,vn="attribute highp vec3 a_pos_3f;uniform lowp mat4 u_matrix;varying highp vec3 v_uv;void main() {const mat3 half_neg_pi_around_x=mat3(1.0,0.0, 0.0,0.0,0.0,-1.0,0.0,1.0, 0.0);v_uv=half_neg_pi_around_x*a_pos_3f;vec4 pos=u_matrix*vec4(a_pos_3f,1.0);gl_Position=pos.xyww;}",Cr=` -#define ELEVATION_SCALE 7.0 -#define ELEVATION_OFFSET 450.0 -#ifdef PROJECTION_GLOBE_VIEW -uniform vec3 u_tile_tl_up;uniform vec3 u_tile_tr_up;uniform vec3 u_tile_br_up;uniform vec3 u_tile_bl_up;uniform float u_tile_up_scale;vec3 elevationVector(vec2 pos) {vec2 uv=pos/EXTENT;vec3 up=normalize(mix( -mix(u_tile_tl_up,u_tile_tr_up,uv.xxx),mix(u_tile_bl_up,u_tile_br_up,uv.xxx),uv.yyy));return up*u_tile_up_scale;} -#else -vec3 elevationVector(vec2 pos) { return vec3(0,0,1); } -#endif -const float skirtOffset=24575.0;vec3 decomposeToPosAndSkirt(vec2 posWithComposedSkirt) -{float skirt=float(posWithComposedSkirt.x >=skirtOffset);vec2 pos=posWithComposedSkirt-vec2(skirt*skirtOffset,0.0);return vec3(pos,skirt);} -#ifdef TERRAIN -#ifdef TERRAIN_DEM_FLOAT_FORMAT -uniform highp sampler2D u_dem;uniform highp sampler2D u_dem_prev; -#else -uniform sampler2D u_dem;uniform sampler2D u_dem_prev; -#endif -uniform vec4 u_dem_unpack;uniform vec2 u_dem_tl;uniform vec2 u_dem_tl_prev;uniform float u_dem_scale;uniform float u_dem_scale_prev;uniform float u_dem_size;uniform float u_dem_lerp;uniform float u_exaggeration;uniform float u_meter_to_dem;uniform mat4 u_label_plane_matrix_inv;uniform sampler2D u_depth;uniform vec2 u_depth_size_inv;vec4 tileUvToDemSample(vec2 uv,float dem_size,float dem_scale,vec2 dem_tl) {vec2 pos=dem_size*(uv*dem_scale+dem_tl)+1.0;vec2 f=fract(pos);return vec4((pos-f+0.5)/(dem_size+2.0),f);}float decodeElevation(vec4 v) {return dot(vec4(v.xyz*255.0,-1.0),u_dem_unpack);}float currentElevation(vec2 apos) { -#ifdef TERRAIN_DEM_FLOAT_FORMAT -vec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale+u_dem_tl)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture2D(u_dem,pos).a; -#else -float dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale,u_dem_tl);vec2 pos=r.xy;vec2 f=r.zw;float tl=decodeElevation(texture2D(u_dem,pos)); -#ifdef TERRAIN_DEM_NEAREST_FILTER -return u_exaggeration*tl; -#endif -float tr=decodeElevation(texture2D(u_dem,pos+vec2(dd,0.0)));float bl=decodeElevation(texture2D(u_dem,pos+vec2(0.0,dd)));float br=decodeElevation(texture2D(u_dem,pos+vec2(dd,dd)));return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y); -#endif -}float prevElevation(vec2 apos) { -#ifdef TERRAIN_DEM_FLOAT_FORMAT -vec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale_prev+u_dem_tl_prev)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture2D(u_dem_prev,pos).a; -#else -float dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale_prev,u_dem_tl_prev);vec2 pos=r.xy;vec2 f=r.zw;float tl=decodeElevation(texture2D(u_dem_prev,pos));float tr=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,0.0)));float bl=decodeElevation(texture2D(u_dem_prev,pos+vec2(0.0,dd)));float br=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,dd)));return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y); -#endif -} -#ifdef TERRAIN_VERTEX_MORPHING -float elevation(vec2 apos) { -#ifdef ZERO_EXAGGERATION -return 0.0; -#endif -float nextElevation=currentElevation(apos);float prevElevation=prevElevation(apos);return mix(prevElevation,nextElevation,u_dem_lerp);} -#else -float elevation(vec2 apos) { -#ifdef ZERO_EXAGGERATION -return 0.0; -#endif -return currentElevation(apos);} -#endif -highp float unpack_depth(highp vec4 rgba_depth) -{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}bool isOccluded(vec4 frag) {vec3 coord=frag.xyz/frag.w;float depth=unpack_depth(texture2D(u_depth,(coord.xy+1.0)*0.5));return coord.z > depth+0.0005;}float occlusionFade(vec4 frag) {vec3 coord=frag.xyz/frag.w;vec3 df=vec3(5.0*u_depth_size_inv,0.0);vec2 uv=0.5*coord.xy+0.5;vec4 depth=vec4( -unpack_depth(texture2D(u_depth,uv-df.xz)),unpack_depth(texture2D(u_depth,uv+df.xz)),unpack_depth(texture2D(u_depth,uv-df.zy)),unpack_depth(texture2D(u_depth,uv+df.zy)) -);return dot(vec4(0.25),vec4(1.0)-clamp(300.0*(vec4(coord.z-0.001)-depth),0.0,1.0));}vec4 fourSample(vec2 pos,vec2 off) { -#ifdef TERRAIN_DEM_FLOAT_FORMAT -float tl=texture2D(u_dem,pos).a;float tr=texture2D(u_dem,pos+vec2(off.x,0.0)).a;float bl=texture2D(u_dem,pos+vec2(0.0,off.y)).a;float br=texture2D(u_dem,pos+off).a; -#else -vec4 demtl=vec4(texture2D(u_dem,pos).xyz*255.0,-1.0);float tl=dot(demtl,u_dem_unpack);vec4 demtr=vec4(texture2D(u_dem,pos+vec2(off.x,0.0)).xyz*255.0,-1.0);float tr=dot(demtr,u_dem_unpack);vec4 dembl=vec4(texture2D(u_dem,pos+vec2(0.0,off.y)).xyz*255.0,-1.0);float bl=dot(dembl,u_dem_unpack);vec4 dembr=vec4(texture2D(u_dem,pos+off).xyz*255.0,-1.0);float br=dot(dembr,u_dem_unpack); -#endif -return vec4(tl,tr,bl,br);}float flatElevation(vec2 pack) {vec2 apos=floor(pack/8.0);vec2 span=10.0*(pack-apos*8.0);vec2 uvTex=(apos-vec2(1.0,1.0))/8190.0;float size=u_dem_size+2.0;float dd=1.0/size;vec2 pos=u_dem_size*(uvTex*u_dem_scale+u_dem_tl)+1.0;vec2 f=fract(pos);pos=(pos-f+0.5)*dd;vec4 h=fourSample(pos,vec2(dd));float z=mix(mix(h.x,h.y,f.x),mix(h.z,h.w,f.x),f.y);vec2 w=floor(0.5*(span*u_meter_to_dem-1.0));vec2 d=dd*w;h=fourSample(pos-d,2.0*d+vec2(dd));vec4 diff=abs(h.xzxy-h.ywzw);vec2 slope=min(vec2(0.25),u_meter_to_dem*0.5*(diff.xz+diff.yw)/(2.0*w+vec2(1.0)));vec2 fix=slope*span;float base=z+max(fix.x,fix.y);return u_exaggeration*base;}float elevationFromUint16(float word) {return u_exaggeration*(word/ELEVATION_SCALE-ELEVATION_OFFSET);} -#else -float elevation(vec2 pos) { return 0.0; }bool isOccluded(vec4 frag) { return false; }float occlusionFade(vec4 frag) { return 1.0; } -#endif`,Uo=`#ifdef FOG -uniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump mat4 u_fog_matrix;varying vec3 v_fog_pos;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}vec3 fog_position(vec3 pos) {return (u_fog_matrix*vec4(pos,1.0)).xyz;}vec3 fog_position(vec2 pos) {return fog_position(vec3(pos,0.0));}float fog(vec3 pos) {float depth=length(pos);float opacity=fog_opacity(fog_range(depth));return opacity*fog_horizon_blending(pos/depth);} -#endif`,zr=`#ifdef FOG -uniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump float u_fog_temporal_offset;varying vec3 v_fog_pos;uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform highp vec2 u_viewport;uniform float u_globe_transition;uniform int u_is_globe;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}float globe_glow_progress() {highp vec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix( -mix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);highp vec3 dir=normalize(ray_dir);highp vec3 closest_point=dot(u_globe_pos,dir)*dir;highp float sdf=length(closest_point-u_globe_pos)/u_globe_radius;return sdf+PI*0.5;}float fog_opacity(vec3 pos) {float depth=length(pos);return fog_opacity(fog_range(depth));}vec3 fog_apply(vec3 color,vec3 pos) {float depth=length(pos);float opacity;if (u_is_globe==1) {float glow_progress=globe_glow_progress();float t=mix(glow_progress,depth,u_globe_transition);opacity=fog_opacity(fog_range(t));} else {opacity=fog_opacity(fog_range(depth));opacity*=fog_horizon_blending(pos/depth);}return mix(color,u_fog_color.rgb,opacity);}vec4 fog_apply_from_vert(vec4 color,float fog_opac) {float alpha=EPSILON+color.a;color.rgb=mix(color.rgb/alpha,u_fog_color.rgb,fog_opac)*alpha;return color;}vec3 fog_apply_sky_gradient(vec3 camera_ray,vec3 sky_color) {float horizon_blend=fog_horizon_blending(normalize(camera_ray));return mix(sky_color,u_fog_color.rgb,horizon_blend);}vec4 fog_apply_premultiplied(vec4 color,vec3 pos) {float alpha=EPSILON+color.a;color.rgb=fog_apply(color.rgb/alpha,pos)*alpha;return color;}vec3 fog_dither(vec3 color) {vec2 dither_seed=gl_FragCoord.xy+u_fog_temporal_offset;return dither(color,dither_seed);}vec4 fog_dither(vec4 color) {return vec4(fog_dither(color.rgb),color.a);} -#endif`;let As={},Hn={};const Vo=[];Kn(Ba,Vo),Kn(Cr,Vo),Kn(Uo,Vo),Kn(zr,Vo),As=bt("",Cr),Hn=bt(zr,Uo);const ac=bt(` -#if __VERSION__ >=300 -#define varying in -#define gl_FragColor glFragColor -#define texture2D texture -#define textureCube texture -out vec4 glFragColor; -#endif -highp vec3 hash(highp vec2 p) {highp vec3 p3=fract(p.xyx*vec3(443.8975,397.2973,491.1871));p3+=dot(p3,p3.yxz+19.19);return fract((p3.xxy+p3.yzz)*p3.zyx);}vec3 dither(vec3 color,highp vec2 seed) {vec3 rnd=hash(seed)+hash(seed+0.59374)-0.5;return color+rnd/255.0;}highp float unpack_depth(highp vec4 rgba_depth) -{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}highp vec4 pack_depth(highp float ndc_z) {highp float depth=ndc_z*0.5+0.5;const highp vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);const highp vec4 bit_mask =vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);highp vec4 res=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;}`,` -#if __VERSION__ >=300 -#define attribute in -#define varying out -#define texture2D texture -#endif -float wrap(float n,float min,float max) {float d=max-min;float w=mod(mod(n-min,d)+d,d)+min;return (w==min) ? max : w;} -#ifdef PROJECTION_GLOBE_VIEW -vec3 mercator_tile_position(mat4 matrix,vec2 tile_anchor,vec3 tile_id,vec2 mercator_center) { -#ifndef PROJECTED_POS_ON_VIEWPORT -float tiles=tile_id.z;vec2 mercator=(tile_anchor/EXTENT+tile_id.xy)/tiles;mercator-=mercator_center;mercator.x=wrap(mercator.x,-0.5,0.5);vec4 mercator_tile=vec4(mercator.xy*EXTENT,EXTENT/(2.0*PI),1.0);mercator_tile=matrix*mercator_tile;return mercator_tile.xyz; -#else -return vec3(0.0); -#endif -}vec3 mix_globe_mercator(vec3 globe,vec3 mercator,float t) {return mix(globe,mercator,t);}mat3 globe_mercator_surface_vectors(vec3 pos_normal,vec3 up_dir,float zoom_transition) {vec3 normal=zoom_transition==0.0 ? pos_normal : normalize(mix(pos_normal,up_dir,zoom_transition));vec3 xAxis=normalize(vec3(normal.z,0.0,-normal.x));vec3 yAxis=normalize(cross(normal,xAxis));return mat3(xAxis,yAxis,normal);} -#endif -vec2 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 -);}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;}const vec4 AWAY=vec4(-1000.0,-1000.0,-1000.0,1);//Normalized device coordinate that is not rendered.`),Is=Ba,Oa=` -#ifdef GL_ES -precision mediump float; -#else - -#if !defined(lowp) -#define lowp -#endif - -#if !defined(mediump) -#define mediump -#endif - -#if !defined(highp) -#define highp -#endif - -#endif`;var Fa={background:bt(`uniform vec4 u_color;uniform float u_opacity; -#ifdef LIGHTING_3D_MODE -varying vec4 v_color; -#endif -void main() {vec4 out_color; -#ifdef LIGHTING_3D_MODE -out_color=v_color; -#else -out_color=u_color; -#endif -#ifdef FOG -out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); -#endif -gl_FragColor=out_color*u_opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec2 a_pos;uniform mat4 u_matrix; -#ifdef LIGHTING_3D_MODE -uniform vec4 u_color;varying vec4 v_color; -#endif -void main() {gl_Position=u_matrix*vec4(a_pos,0,1); -#ifdef LIGHTING_3D_MODE -v_color=apply_lighting(u_color); -#endif -#ifdef FOG -v_fog_pos=fog_position(a_pos); -#endif -}`),backgroundPattern:bt(`uniform vec2 u_pattern_tl;uniform vec2 u_pattern_br;uniform vec2 u_texsize;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos;void main() {vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(u_pattern_tl/u_texsize,u_pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos); -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color); -#endif -#ifdef FOG -out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); -#endif -gl_FragColor=out_color*u_opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_pattern_size;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_pattern_size,u_tile_units_to_pixels,a_pos); -#ifdef FOG -v_fog_pos=fog_position(a_pos); -#endif -}`),circle:bt(`varying vec3 v_data;varying float v_visibility; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define mediump float radius -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define highp vec4 stroke_color -#pragma mapbox: define mediump float stroke_width -#pragma mapbox: define lowp float stroke_opacity -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize mediump float radius -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize highp vec4 stroke_color -#pragma mapbox: initialize mediump float stroke_width -#pragma mapbox: initialize lowp float stroke_opacity -vec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);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) -);vec4 out_color=mix(color*opacity,stroke_color*stroke_opacity,color_t); -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color); -#endif -#ifdef FOG -out_color=fog_apply_premultiplied(out_color,v_fog_pos); -#endif -gl_FragColor=out_color*(v_visibility*opacity_t); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`#define NUM_VISIBILITY_RINGS 2 -#define INV_SQRT2 0.70710678 -#define ELEVATION_BIAS 0.0001 -#define NUM_SAMPLES_PER_RING 16 -uniform mat4 u_matrix;uniform mat2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos; -#ifdef PROJECTION_GLOBE_VIEW -attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir; -#endif -varying vec3 v_data;varying float v_visibility; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define mediump float radius -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define highp vec4 stroke_color -#pragma mapbox: define mediump float stroke_width -#pragma mapbox: define lowp float stroke_opacity -vec2 calc_offset(vec2 extrusion,float radius,float stroke_width, float view_scale) {return extrusion*(radius+stroke_width)*u_extrude_scale*view_scale;}float cantilevered_elevation(vec2 pos,float radius,float stroke_width,float view_scale) {vec2 c1=pos+calc_offset(vec2(-1,-1),radius,stroke_width,view_scale);vec2 c2=pos+calc_offset(vec2(1,-1),radius,stroke_width,view_scale);vec2 c3=pos+calc_offset(vec2(1,1),radius,stroke_width,view_scale);vec2 c4=pos+calc_offset(vec2(-1,1),radius,stroke_width,view_scale);float h1=elevation(c1)+ELEVATION_BIAS;float h2=elevation(c2)+ELEVATION_BIAS;float h3=elevation(c3)+ELEVATION_BIAS;float h4=elevation(c4)+ELEVATION_BIAS;return max(h4,max(h3,max(h1,h2)));}float circle_elevation(vec2 pos) { -#if defined(TERRAIN) -return elevation(pos)+ELEVATION_BIAS; -#else -return 0.0; -#endif -}vec4 project_vertex(vec2 extrusion,vec4 world_center,vec4 projected_center,float radius,float stroke_width, float view_scale,mat3 surface_vectors) {vec2 sample_offset=calc_offset(extrusion,radius,stroke_width,view_scale); -#ifdef PITCH_WITH_MAP -#ifdef PROJECTION_GLOBE_VIEW -return u_matrix*( world_center+vec4(sample_offset.x*surface_vectors[0]+sample_offset.y*surface_vectors[1],0) ); -#else -return u_matrix*( world_center+vec4(sample_offset,0,0) ); -#endif -#else -return projected_center+vec4(sample_offset,0,0); -#endif -}float get_sample_step() { -#ifdef PITCH_WITH_MAP -return 2.0*PI/float(NUM_SAMPLES_PER_RING); -#else -return PI/float(NUM_SAMPLES_PER_RING); -#endif -}void main(void) { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize mediump float radius -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize highp vec4 stroke_color -#pragma mapbox: initialize mediump float stroke_width -#pragma mapbox: initialize lowp float stroke_opacity -vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);vec4 world_center;mat3 surface_vectors; -#ifdef PROJECTION_GLOBE_VIEW -vec3 pos_normal_3=a_pos_normal_3/16384.0;surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(circle_center)*circle_elevation(circle_center);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*circle_elevation(circle_center);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,circle_center,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;vec3 pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);world_center=vec4(pos,1); -#else -surface_vectors=mat3(1.0);float height=circle_elevation(circle_center);world_center=vec4(circle_center,height,1); -#endif -vec4 projected_center=u_matrix*world_center;float view_scale=0.0; -#ifdef PITCH_WITH_MAP -#ifdef SCALE_WITH_MAP -view_scale=1.0; -#else -view_scale=projected_center.w/u_camera_to_center_distance; -#endif -#else -#ifdef SCALE_WITH_MAP -view_scale=u_camera_to_center_distance; -#else -view_scale=projected_center.w; -#endif -#endif -gl_Position=project_vertex(extrude,world_center,projected_center,radius,stroke_width,view_scale,surface_vectors);float visibility=0.0; -#ifdef TERRAIN -float step=get_sample_step();vec4 occlusion_world_center;vec4 occlusion_projected_center; -#ifdef PITCH_WITH_MAP -float cantilevered_height=cantilevered_elevation(circle_center,radius,stroke_width,view_scale);occlusion_world_center=vec4(circle_center,cantilevered_height,1);occlusion_projected_center=u_matrix*occlusion_world_center; -#else -occlusion_world_center=world_center;occlusion_projected_center=projected_center; -#endif -for(int ring=0; ring < NUM_VISIBILITY_RINGS; ring++) {float scale=(float(ring)+1.0)/float(NUM_VISIBILITY_RINGS);for(int i=0; i < NUM_SAMPLES_PER_RING; i++) {vec2 extrusion=vec2(cos(step*float(i)),-sin(step*float(i)))*scale;vec4 frag_pos=project_vertex(extrusion,occlusion_world_center,occlusion_projected_center,radius,stroke_width,view_scale,surface_vectors);visibility+=float(!isOccluded(frag_pos));}}visibility/=float(NUM_VISIBILITY_RINGS)*float(NUM_SAMPLES_PER_RING); -#else -visibility=1.0; -#endif -#ifdef PROJECTION_GLOBE_VIEW -visibility=1.0; -#endif -v_visibility=visibility;lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur); -#ifdef FOG -v_fog_pos=fog_position(world_center.xyz); -#endif -}`),clippingMask:bt("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:bt(`uniform highp float u_intensity;varying vec2 v_extrude; -#pragma mapbox: define highp float weight -#define GAUSS_COEF 0.3989422804014327 -void main() { -#pragma mapbox: initialize highp float weight -float 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); -#ifdef FOG -if (u_is_globe==0) {gl_FragColor.r*=pow(1.0-fog_opacity(v_fog_pos),2.0);} -#endif -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos; -#ifdef PROJECTION_GLOBE_VIEW -attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir; -#endif -varying vec2 v_extrude; -#pragma mapbox: define highp float weight -#pragma mapbox: define mediump float radius -const highp float ZERO=1.0/255.0/16.0; -#define GAUSS_COEF 0.3989422804014327 -void main(void) { -#pragma mapbox: initialize highp float weight -#pragma mapbox: initialize mediump float radius -vec2 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;vec2 tilePos=floor(a_pos*0.5);vec3 pos; -#ifdef PROJECTION_GLOBE_VIEW -vec3 pos_normal_3=a_pos_normal_3/16384.0;mat3 surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(tilePos)*elevation(tilePos);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*elevation(tilePos);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,tilePos,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition); -#else -pos=vec3(tilePos+extrude,elevation(tilePos)); -#endif -gl_Position=u_matrix*vec4(pos,1); -#ifdef FOG -v_fog_pos=fog_position(pos); -#endif -}`),heatmapTexture:bt(`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; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(0.0); -#endif -}`,"attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=a_pos*0.5+0.5;}"),collisionBox:bt("varying float v_placed;varying float v_notUsed;void main() {vec4 red =vec4(1.0,0.0,0.0,1.0);vec4 blue=vec4(0.0,0.0,1.0,0.5);gl_FragColor =mix(red,blue,step(0.5,v_placed))*0.5;gl_FragColor*=mix(1.0,0.1,step(0.5,v_notUsed));}",`attribute vec3 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;attribute float a_size_scale;attribute vec2 a_padding;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_pos+elevationVector(a_anchor_pos)*elevation(a_anchor_pos),1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp( -0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,1.5);gl_Position=projectedPoint;gl_Position.xy+=(a_extrude*a_size_scale+a_shift+a_padding)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}`),collisionCircle:bt("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_2f;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_2f;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:bt("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; -#ifdef PROJECTION_GLOBE_VIEW -attribute vec3 a_pos_3; -#endif -varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {float h=elevation(a_pos);v_uv=a_pos/8192.0; -#ifdef PROJECTION_GLOBE_VIEW -gl_Position=u_matrix*vec4(a_pos_3+elevationVector(a_pos)*h,1); -#else -gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,h,1); -#endif -}`),fill:bt(`#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float opacity -vec4 out_color=color; -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color); -#endif -#ifdef FOG -out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); -#endif -gl_FragColor=out_color*opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec2 a_pos;uniform mat4 u_matrix; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float opacity -gl_Position=u_matrix*vec4(a_pos,0,1); -#ifdef FOG -v_fog_pos=fog_position(a_pos); -#endif -}`),fillOutline:bt(`varying vec2 v_pos; -#pragma mapbox: define highp vec4 outline_color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 outline_color -#pragma mapbox: initialize lowp float opacity -float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=outline_color; -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color); -#endif -#ifdef FOG -out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); -#endif -gl_FragColor=out_color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos; -#pragma mapbox: define highp vec4 outline_color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 outline_color -#pragma mapbox: initialize lowp float opacity -gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world; -#ifdef FOG -v_fog_pos=fog_position(a_pos); -#endif -}`),fillOutlinePattern:bt(`uniform vec2 u_texsize;uniform sampler2D u_image;varying vec2 v_pos;varying vec2 v_pos_world; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern -vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);float dist=length(v_pos_world-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=texture2D(u_image,pos); -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color); -#endif -#ifdef FOG -out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); -#endif -gl_FragColor=out_color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;varying vec2 v_pos_world; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern -#pragma mapbox: define lowp float pixel_ratio -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern -#pragma mapbox: initialize lowp float pixel_ratio -vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);v_pos_world=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world; -#ifdef FOG -v_fog_pos=fog_position(a_pos); -#endif -}`),fillPattern:bt(`uniform vec2 u_texsize;uniform sampler2D u_image;varying vec2 v_pos; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern -vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos); -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color); -#endif -#ifdef FOG -out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); -#endif -gl_FragColor=out_color*opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern -#pragma mapbox: define lowp float pixel_ratio -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern -#pragma mapbox: initialize lowp float pixel_ratio -vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos); -#ifdef FOG -v_fog_pos=fog_position(a_pos); -#endif -}`),fillExtrusion:bt(`varying vec4 v_color; -#ifdef RENDER_SHADOWS -varying highp vec4 v_pos_light_view_0;varying highp vec4 v_pos_light_view_1;varying float v_depth; -#endif -#ifdef FAUX_AO -uniform lowp vec2 u_ao;varying vec3 v_ao; -#endif -#ifdef ZERO_ROOF_RADIUS -varying vec4 v_roof_color; -#endif -#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) -varying highp vec3 v_normal; -#endif -void main() { -#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) -vec3 normal=v_normal; -#endif -float z;vec4 color; -#ifdef ZERO_ROOF_RADIUS -z=float(normal.z > 0.00001);color=mix(v_color,v_roof_color,z); -#else -color=v_color; -#endif -#ifdef FAUX_AO -float intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x; -#ifdef ZERO_ROOF_RADIUS -concave*=(1.0-z); -#endif -float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);color.rgb=color.rgb*shade; -#endif -#ifdef RENDER_SHADOWS -#ifdef ZERO_ROOF_RADIUS -normal=mix(normal,vec3(0.0,0.0,1.0),z); -#endif -color.xyz=shadowed_color_normal(color.xyz,normalize(normal),v_pos_light_view_0,v_pos_light_view_1,v_depth); -#endif -#ifdef FOG -color=fog_dither(fog_apply_premultiplied(color,v_fog_pos)); -#endif -gl_FragColor=color; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`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;uniform float u_edge_radius;attribute vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos; -#ifdef PROJECTION_GLOBE_VIEW -attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift; -#endif -varying vec4 v_color; -#ifdef RENDER_SHADOWS -uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;varying highp vec4 v_pos_light_view_0;varying highp vec4 v_pos_light_view_1;varying float v_depth; -#endif -#ifdef ZERO_ROOF_RADIUS -varying vec4 v_roof_color; -#endif -#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) -varying highp vec3 v_normal; -#endif -#ifdef FAUX_AO -uniform lowp vec2 u_ao;varying vec3 v_ao; -#endif -#pragma mapbox: define highp float base -#pragma mapbox: define highp float height -#pragma mapbox: define highp vec4 color -void main() { -#pragma mapbox: initialize highp float base -#pragma mapbox: initialize highp float height -#pragma mapbox: initialize highp vec4 color -vec4 pos_nx=floor(a_pos_normal_ed*0.5);vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0)); -#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) -v_normal=normal; -#endif -base=max(0.0,base);height=max(0.0,top_up_ny.y==0.0 && top_up_ny.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0); -#if defined(HAS_CENTROID) || defined(TERRAIN) -centroid_pos=a_centroid_pos; -#endif -float ele=0.0;float h=0.0;float c_ele;vec3 pos; -#ifdef TERRAIN -bool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);pos=vec3(pos_nx.xy,h); -#else -h=t > 0.0 ? height : base;pos=vec3(pos_nx.xy,h); -#endif -#ifdef PROJECTION_GLOBE_VIEW -float lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*h);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,pos.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*pos.z;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition); -#endif -float hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(pos,1),AWAY,hidden); -#ifdef RENDER_SHADOWS -v_pos_light_view_0=u_light_matrix_0*vec4(pos,1);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1);v_depth=gl_Position.w; -#endif -float NdotL=0.0;float colorvalue=0.0; -#ifdef LIGHTING_3D_MODE -NdotL=calculate_NdotL(normal); -#else -colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),NdotL); -#endif -if (normal.y !=0.0) {float r=0.84; -#ifndef LIGHTING_3D_MODE -r=mix(0.7,0.98,1.0-u_lightintensity); -#endif -NdotL*=( -(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}v_color=vec4(0.0,0.0,0.0,1.0); -#ifdef FAUX_AO -float concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height; -#ifdef TERRAIN -top_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height); -#endif -v_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]); -#ifdef PROJECTION_GLOBE_VIEW -top_height+=u_height_lift; -#endif -gl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w; -#endif -#ifdef LIGHTING_3D_MODE -v_color=apply_lighting(color,NdotL); -#else -v_color.rgb+=clamp(color.rgb*NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0)); -#endif -v_color*=u_opacity; -#ifdef ZERO_ROOF_RADIUS -v_roof_color=vec4(0.0,0.0,0.0,1.0); -#ifdef LIGHTING_3D_MODE -v_roof_color=apply_lighting(color,calculate_NdotL(vec3(0.0,0.0,1.0))); -#else -float roofNdotL=clamp(u_lightpos.z,0.0,1.0);roofNdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),roofNdotL);v_roof_color.rgb+=clamp(color.rgb*roofNdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0)); -#endif -v_roof_color*=u_opacity; -#endif -#ifdef FOG -v_fog_pos=fog_position(pos); -#endif -}`),fillExtrusionPattern:bt(`uniform vec2 u_texsize;uniform sampler2D u_image; -#ifdef FAUX_AO -uniform lowp vec2 u_ao;varying vec3 v_ao; -#endif -#ifdef LIGHTING_3D_MODE -varying float v_NdotL; -#endif -varying vec2 v_pos;varying vec4 v_lighting;uniform lowp float u_opacity; -#pragma mapbox: define lowp float base -#pragma mapbox: define lowp float height -#pragma mapbox: define lowp vec4 pattern -#pragma mapbox: define lowp float pixel_ratio -void main() { -#pragma mapbox: initialize lowp float base -#pragma mapbox: initialize lowp float height -#pragma mapbox: initialize mediump vec4 pattern -#pragma mapbox: initialize lowp float pixel_ratio -vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos); -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color,v_NdotL)*u_opacity; -#else -out_color=out_color*v_lighting; -#endif -#ifdef FAUX_AO -float intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);out_color.rgb=out_color.rgb*shade; -#endif -#ifdef FOG -out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); -#endif -gl_FragColor=out_color; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform float u_tile_units_to_pixels;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 vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos; -#ifdef PROJECTION_GLOBE_VIEW -attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift; -#endif -varying vec2 v_pos;varying vec4 v_lighting; -#ifdef FAUX_AO -uniform lowp vec2 u_ao;varying vec3 v_ao; -#endif -#ifdef LIGHTING_3D_MODE -varying float v_NdotL; -#endif -#pragma mapbox: define lowp float base -#pragma mapbox: define lowp float height -#pragma mapbox: define lowp vec4 pattern -#pragma mapbox: define lowp float pixel_ratio -void main() { -#pragma mapbox: initialize lowp float base -#pragma mapbox: initialize lowp float height -#pragma mapbox: initialize mediump vec4 pattern -#pragma mapbox: initialize lowp float pixel_ratio -vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec4 pos_nx=floor(a_pos_normal_ed*0.5);mediump vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;mediump vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));float edgedistance=a_pos_normal_ed.w;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;base=max(0.0,base);height=max(0.0,height);float t=top_up_ny.x;float z=t > 0.0 ? height : base;vec2 centroid_pos=vec2(0.0); -#if defined(HAS_CENTROID) || defined(TERRAIN) -centroid_pos=a_centroid_pos; -#endif -float ele=0.0;float h=z;vec3 p;float c_ele; -#ifdef TERRAIN -bool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);p=vec3(pos_nx.xy,h); -#else -p=vec3(pos_nx.xy,z); -#endif -#ifdef PROJECTION_GLOBE_VIEW -float lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*(p.z+lift));vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,p.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*p.z;p=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition); -#endif -float hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(p,1),AWAY,hidden);vec2 pos=normal.z==1.0 -? pos_nx.xy -: vec2(edgedistance,z*u_height_factor);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float NdotL=0.0; -#ifdef LIGHTING_3D_MODE -NdotL=calculate_NdotL(normal); -#else -NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),NdotL); -#endif -if (normal.y !=0.0) {float r=0.84; -#ifndef LIGHTING_3D_MODE -r=mix(0.7,0.98,1.0-u_lightintensity); -#endif -NdotL*=( -(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));} -#ifdef FAUX_AO -float concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height; -#ifdef TERRAIN -top_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height); -#endif -v_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]); -#ifdef PROJECTION_GLOBE_VIEW -top_height+=u_height_lift; -#endif -gl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w; -#endif -#ifdef LIGHTING_3D_MODE -v_NdotL=NdotL; -#else -v_lighting.rgb+=clamp(NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity; -#endif -#ifdef FOG -v_fog_pos=fog_position(p); -#endif -}`),hillshadePrepare:bt(`#ifdef GL_ES -precision highp float; -#endif -uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord) { -#ifdef TERRAIN_DEM_FLOAT_FORMAT -return texture2D(u_image,coord).a/4.0; -#else -vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0; -#endif -}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y));float b=getElevation(v_pos+vec2(0,-epsilon.y));float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y));float d=getElevation(v_pos+vec2(-epsilon.x,0));float e=getElevation(v_pos+vec2(epsilon.x,0));float f=getElevation(v_pos+vec2(-epsilon.x,epsilon.y));float g=getElevation(v_pos+vec2(0,epsilon.y));float h=getElevation(v_pos+vec2(epsilon.x,epsilon.y));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+e+e+h)-(a+d+d+f),(f+g+g+h)-(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); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,"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:bt(`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;void 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; -#ifdef LIGHTING_3D_MODE -gl_FragColor=apply_lighting(gl_FragColor); -#endif -#ifdef FOG -gl_FragColor=fog_dither(fog_apply_premultiplied(gl_FragColor,v_fog_pos)); -#endif -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`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; -#ifdef FOG -v_fog_pos=fog_position(a_pos); -#endif -}`),line:bt(`uniform lowp float u_device_pixel_ratio;uniform float u_alpha_discard_threshold;uniform highp vec2 u_trim_offset;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec4 v_uv; -#ifdef RENDER_LINE_DASH -uniform sampler2D u_dash_image;varying vec2 v_tex; -#endif -#ifdef RENDER_LINE_GRADIENT -uniform sampler2D u_gradient_image; -#endif -uniform float u_border_width;uniform vec4 u_border_color;float luminance(vec3 c) {return (c.r+c.r+c.b+c.g+c.g+c.g)*0.1667;} -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float floorwidth -#pragma mapbox: define lowp vec4 dash -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -float linearstep(float edge0,float edge1,float x) {return clamp((x-edge0)/(edge1-edge0),0.0,1.0);}void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float floorwidth -#pragma mapbox: initialize lowp vec4 dash -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -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); -#ifdef RENDER_LINE_DASH -float sdfdist=texture2D(u_dash_image,v_tex).a;float sdfgamma=1.0/(2.0*u_device_pixel_ratio)/dash.z;alpha*=linearstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist); -#endif -highp vec4 out_color; -#ifdef RENDER_LINE_GRADIENT -out_color=texture2D(u_gradient_image,v_uv.xy); -#else -out_color=color; -#endif -float trimmed=1.0; -#ifdef RENDER_LINE_TRIM_OFFSET -highp float start=v_uv[2];highp float end=v_uv[3];highp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=(start+(v_uv.x)*(end-start));if (trim_end > trim_start) {if (line_progress <=trim_end && line_progress >=trim_start) {out_color=vec4(0,0,0,0);trimmed=0.0;}} -#endif -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color); -#endif -#ifdef FOG -out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); -#endif -#ifdef RENDER_LINE_ALPHA_DISCARD -if (alpha < u_alpha_discard_threshold) {discard;} -#endif -#ifdef RENDER_LINE_BORDER -float edgeBlur=(u_border_width+1.0/u_device_pixel_ratio);float alpha2=clamp(min(dist-(v_width2.t-edgeBlur),v_width2.s-dist)/edgeBlur,0.0,1.0);if (alpha2 < 1.) {float smoothAlpha=smoothstep(0.6,1.0,alpha2); -#ifdef RENDER_LINE_BORDER_AUTO -float Y=(out_color.a > 0.01) ? luminance(out_color.rgb/out_color.a) : 1.;float adjustment=(Y > 0.) ? 0.5/Y : 0.45;if (out_color.a > 0.25 && Y < 0.25) {vec3 borderColor=(Y > 0.) ? out_color.rgb : vec3(1,1,1)*out_color.a;out_color.rgb=out_color.rgb+borderColor*(adjustment*(1.0-smoothAlpha));} else {out_color.rgb*=(0.6 +0.4*smoothAlpha);} -#else -out_color.rgb=mix(u_border_color.rgb*u_border_color.a*trimmed,out_color.rgb,smoothAlpha); -#endif -} -#endif -gl_FragColor=out_color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,` -#define EXTRUDE_SCALE 0.015873016 -attribute vec2 a_pos_normal;attribute vec4 a_data; -#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET) -attribute highp vec4 a_packed; -#endif -#ifdef RENDER_LINE_DASH -attribute float a_linesofar; -#endif -uniform mat4 u_matrix;uniform mat2 u_pixels_to_tile_units;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 vec4 v_uv; -#ifdef RENDER_LINE_DASH -uniform vec2 u_texsize;uniform float u_tile_units_to_pixels;varying vec2 v_tex; -#endif -#ifdef RENDER_LINE_GRADIENT -uniform float u_image_height; -#endif -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float floorwidth -#pragma mapbox: define lowp vec4 dash -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define mediump float gapwidth -#pragma mapbox: define lowp float offset -#pragma mapbox: define mediump float width -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float floorwidth -#pragma mapbox: initialize lowp vec4 dash -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump float gapwidth -#pragma mapbox: initialize lowp float offset -#pragma mapbox: initialize mediump float width -float 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;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*EXTRUDE_SCALE;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*EXTRUDE_SCALE*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist*u_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude; -#ifndef RENDER_TO_TEXTURE -float 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; -#else -v_gamma_scale=1.0; -#endif -#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET) -float a_uv_x=a_packed[0];float a_split_index=a_packed[1];highp float a_clip_start=a_packed[2];highp float a_clip_end=a_packed[3]; -#ifdef RENDER_LINE_GRADIENT -highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec4(a_uv_x,a_split_index*texel_height-half_texel_height,a_clip_start,a_clip_end); -#else -v_uv=vec4(a_uv_x,0.0,a_clip_start,a_clip_end); -#endif -#endif -#ifdef RENDER_LINE_DASH -float scale=dash.z==0.0 ? 0.0 : u_tile_units_to_pixels/dash.z;float height=dash.y;v_tex=vec2(a_linesofar*scale/floorwidth,(-normal.y*height+dash.x+0.5)/u_texsize.y); -#endif -v_width2=vec2(outset,inset); -#ifdef FOG -v_fog_pos=fog_position(pos); -#endif -}`),linePattern:bt(`uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_tile_units_to_pixels;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; -#pragma mapbox: define lowp vec4 pattern -#pragma mapbox: define lowp float pixel_ratio -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize mediump vec4 pattern -#pragma mapbox: initialize lowp float pixel_ratio -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;vec2 pattern_size=vec2(display_size.x/u_tile_units_to_pixels,display_size.y);float aspect=display_size.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=mod(v_linesofar/pattern_size.x*aspect,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(x,y));vec4 color=texture2D(u_image,pos); -#ifdef LIGHTING_3D_MODE -color=apply_lighting(color); -#endif -#ifdef FOG -color=fog_dither(fog_apply_premultiplied(color,v_fog_pos)); -#endif -gl_FragColor=color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,` -#define scale 0.015873016 -attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_linesofar;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mat2 u_pixels_to_tile_units;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; -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float offset -#pragma mapbox: define mediump float gapwidth -#pragma mapbox: define mediump float width -#pragma mapbox: define lowp float floorwidth -#pragma mapbox: define lowp vec4 pattern -#pragma mapbox: define lowp float pixel_ratio -void main() { -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float offset -#pragma mapbox: initialize mediump float gapwidth -#pragma mapbox: initialize mediump float width -#pragma mapbox: initialize lowp float floorwidth -#pragma mapbox: initialize mediump vec4 pattern -#pragma mapbox: initialize lowp float pixel_ratio -float 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;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_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude; -#ifndef RENDER_TO_TEXTURE -float 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; -#else -v_gamma_scale=1.0; -#endif -v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth; -#ifdef FOG -v_fog_pos=fog_position(pos); -#endif -}`),raster:bt(`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);vec3 out_color=mix(u_high_vec,u_low_vec,rgb); -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color); -#endif -#ifdef FOG -out_color=fog_dither(fog_apply(out_color,v_fog_pos)); -#endif -gl_FragColor=vec4(out_color*color.a,color.a); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform vec2 u_perspective_transform;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {float w=1.0+dot(a_texture_pos,u_perspective_transform);gl_Position=u_matrix*vec4(a_pos*w,0,w);v_pos0=a_texture_pos/8192.0;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent; -#ifdef FOG -v_fog_pos=fog_position(a_pos); -#endif -}`),symbolIcon:bt(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize lowp float opacity -lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_pixeloffset;attribute vec4 a_projected_pos;attribute float a_fade_opacity; -#ifdef PROJECTION_GLOBE_VIEW -attribute vec3 a_globe_anchor;attribute vec3 a_globe_normal; -#endif -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 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 vec3 u_up_vector; -#ifdef PROJECTION_GLOBE_VIEW -uniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix; -#endif -varying vec2 v_tex;varying float v_fade_opacity; -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize lowp float opacity -vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_min_font_scale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[3];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 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos; -#ifdef PROJECTION_GLOBE_VIEW -mercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0; -#else -world_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0; -#endif -vec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ? -camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp( -0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjected_point; -#ifdef PROJECTION_GLOBE_VIEW -vec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetProjected_point=u_matrix*vec4(a_globe_anchor+displacement,1); -#else -offsetProjected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1); -#endif -vec2 a=projected_point.xy/projected_point.w;vec2 b=offsetProjected_point.xy/offsetProjected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos; -#ifdef PROJECTION_GLOBE_VIEW -vec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0); -#else -projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0); -#endif -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);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*max(a_min_font_scale,font_scale)+a_pxoffset/16.0); -#ifdef TERRAIN -#ifdef PITCH_WITH_MAP_TERRAIN -vec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy); -#endif -#endif -float occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade; -#ifdef PROJECTION_GLOBE_VIEW -vec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); -#else -gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); -#endif -float projection_transition_fade=1.0; -#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW) -projection_transition_fade=1.0-step(EPSILON,u_zoom_transition); -#endif -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;v_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change))*projection_transition_fade;}`),symbolSDF:bt(`#define SDF_PX 8.0 -uniform 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; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -float 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 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); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_pixeloffset;attribute vec4 a_projected_pos;attribute float a_fade_opacity; -#ifdef PROJECTION_GLOBE_VIEW -attribute vec3 a_globe_anchor;attribute vec3 a_globe_normal; -#endif -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_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 vec3 u_up_vector; -#ifdef PROJECTION_GLOBE_VIEW -uniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix; -#endif -varying vec2 v_data0;varying vec3 v_data1; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[3];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 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos; -#ifdef PROJECTION_GLOBE_VIEW -mercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0; -#else -world_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0; -#endif -vec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ? -camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp( -0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetprojected_point; -#ifdef PROJECTION_GLOBE_VIEW -vec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetprojected_point=u_matrix*vec4(a_globe_anchor+displacement,1); -#else -offsetprojected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1); -#endif -vec2 a=projected_point.xy/projected_point.w;vec2 b=offsetprojected_point.xy/offsetprojected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos; -#ifdef PROJECTION_GLOBE_VIEW -vec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0); -#else -projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0); -#endif -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);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset); -#ifdef TERRAIN -#ifdef PITCH_WITH_MAP_TERRAIN -vec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy); -#endif -#endif -float occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade; -#ifdef PROJECTION_GLOBE_VIEW -vec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); -#else -gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); -#endif -float gamma_scale=gl_Position.w;float projection_transition_fade=1.0; -#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW) -projection_transition_fade=1.0-step(EPSILON,u_zoom_transition); -#endif -vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity*projection_transition_fade);}`),symbolTextAndIcon:bt(`#define SDF_PX 8.0 -#define SDF 1.0 -#define ICON 0.0 -uniform 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; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -float 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; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -return;}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); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_projected_pos;attribute float a_fade_opacity; -#ifdef PROJECTION_GLOBE_VIEW -attribute vec3 a_globe_anchor;attribute vec3 a_globe_normal; -#endif -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_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 vec3 u_up_vector;uniform vec2 u_texsize_icon; -#ifdef PROJECTION_GLOBE_VIEW -uniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix; -#endif -varying vec4 v_data0;varying vec4 v_data1; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[3];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 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos; -#ifdef PROJECTION_GLOBE_VIEW -mercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0; -#else -world_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0; -#endif -vec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ? -camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp( -0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offset_projected_point=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projected_point.xy/projected_point.w;vec2 b=offset_projected_point.xy/offset_projected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos; -#ifdef PROJECTION_GLOBE_VIEW -vec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0); -#else -projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0); -#endif -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);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*font_scale); -#ifdef TERRAIN -#ifdef PITCH_WITH_MAP_TERRAIN -vec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy); -#endif -#endif -float occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade; -#ifdef PROJECTION_GLOBE_VIEW -vec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); -#else -gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); -#endif -float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));float projection_transition_fade=1.0; -#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW) -projection_transition_fade=1.0-step(EPSILON,u_zoom_transition); -#endif -v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity*projection_transition_fade,is_sdf);}`),terrainRaster:bt(`uniform sampler2D u_image0;varying vec2 v_pos0; -#ifdef FOG -varying float v_fog_opacity; -#endif -#ifdef RENDER_SHADOWS -varying vec4 v_pos_light_view_0;varying vec4 v_pos_light_view_1;varying float v_depth; -#endif -void main() {vec4 color=texture2D(u_image0,v_pos0); -#ifdef RENDER_SHADOWS -color.xyz=shadowed_color(color.xyz,v_pos_light_view_0,v_pos_light_view_1,v_depth); -#endif -#ifdef FOG -#ifdef ZERO_EXAGGERATION -color=fog_dither(fog_apply_premultiplied(color,v_fog_pos)); -#else -color=fog_dither(fog_apply_from_vert(color,v_fog_opacity)); -#endif -#endif -gl_FragColor=color; -#ifdef TERRAIN_WIREFRAME -gl_FragColor=vec4(1.0,0.0,0.0,0.8); -#endif -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform float u_skirt_height;attribute vec2 a_pos;varying vec2 v_pos0; -#ifdef FOG -varying float v_fog_opacity; -#endif -#ifdef RENDER_SHADOWS -uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;varying vec4 v_pos_light_view_0;varying vec4 v_pos_light_view_1;varying float v_depth; -#endif -const float wireframeOffset=0.00015;void main() {vec3 decomposedPosAndSkirt=decomposeToPosAndSkirt(a_pos);float skirt=decomposedPosAndSkirt.z;vec2 decodedPos=decomposedPosAndSkirt.xy;float elevation=elevation(decodedPos)-skirt*u_skirt_height; -#ifdef TERRAIN_WIREFRAME -elevation+=wireframeOffset; -#endif -v_pos0=decodedPos/8192.0;gl_Position=u_matrix*vec4(decodedPos,elevation,1.0); -#ifdef FOG -#ifdef ZERO_EXAGGERATION -v_fog_pos=fog_position(decodedPos); -#else -v_fog_opacity=fog(fog_position(vec3(decodedPos,elevation))); -#endif -#endif -#ifdef RENDER_SHADOWS -vec3 pos=vec3(decodedPos,elevation);v_pos_light_view_0=u_light_matrix_0*vec4(pos,1.);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1.);v_depth=gl_Position.w; -#endif -}`),terrainDepth:bt(`#ifdef GL_ES -precision highp float; -#endif -varying float v_depth;void main() {gl_FragColor=pack_depth(v_depth);}`,"uniform mat4 u_matrix;attribute vec2 a_pos;varying float v_depth;void main() {float elevation=elevation(a_pos);gl_Position=u_matrix*vec4(a_pos,elevation,1.0);v_depth=gl_Position.z/gl_Position.w;}"),skybox:bt(` -varying lowp vec3 v_uv;uniform lowp samplerCube u_cubemap;uniform lowp float u_opacity;uniform highp float u_temporal_offset;uniform highp vec3 u_sun_direction;float sun_disk(highp vec3 ray_direction,highp vec3 sun_direction) {highp float cos_angle=dot(normalize(ray_direction),sun_direction);const highp float cos_sun_angular_diameter=0.99996192306;const highp float smoothstep_delta=1e-5;return smoothstep( -cos_sun_angular_diameter-smoothstep_delta,cos_sun_angular_diameter+smoothstep_delta,cos_angle);}float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec3 uv=v_uv;const float y_bias=0.015;uv.y+=y_bias;uv.y=pow(abs(uv.y),1.0/5.0);uv.y=map(uv.y,0.0,1.0,-1.0,1.0);vec3 sky_color=textureCube(u_cubemap,uv).rgb; -#ifdef FOG -sky_color=fog_apply_sky_gradient(v_uv.xzy,sky_color); -#endif -sky_color.rgb=dither(sky_color.rgb,gl_FragCoord.xy+u_temporal_offset);sky_color+=0.1*sun_disk(v_uv,u_sun_direction);gl_FragColor=vec4(sky_color*u_opacity,u_opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,vn),skyboxGradient:bt(`varying highp vec3 v_uv;uniform lowp sampler2D u_color_ramp;uniform highp vec3 u_center_direction;uniform lowp float u_radius;uniform lowp float u_opacity;uniform highp float u_temporal_offset;void main() {float progress=acos(dot(normalize(v_uv),u_center_direction))/u_radius;vec4 color=texture2D(u_color_ramp,vec2(progress,0.5)); -#ifdef FOG -color.rgb=fog_apply_sky_gradient(v_uv.xzy,color.rgb/color.a)*color.a; -#endif -color*=u_opacity;color.rgb=dither(color.rgb,gl_FragCoord.xy+u_temporal_offset);gl_FragColor=color; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,vn),skyboxCapture:bt(` -varying highp vec3 v_position;uniform highp float u_sun_intensity;uniform highp float u_luminance;uniform lowp vec3 u_sun_direction;uniform highp vec4 u_color_tint_r;uniform highp vec4 u_color_tint_m; -#ifdef GL_ES -precision highp float; -#endif -#define BETA_R vec3(5.5e-6,13.0e-6,22.4e-6) -#define BETA_M vec3(21e-6,21e-6,21e-6) -#define MIE_G 0.76 -#define DENSITY_HEIGHT_SCALE_R 8000.0 -#define DENSITY_HEIGHT_SCALE_M 1200.0 -#define PLANET_RADIUS 6360e3 -#define ATMOSPHERE_RADIUS 6420e3 -#define SAMPLE_STEPS 10 -#define DENSITY_STEPS 4 -float ray_sphere_exit(vec3 orig,vec3 dir,float radius) {float a=dot(dir,dir);float b=2.0*dot(dir,orig);float c=dot(orig,orig)-radius*radius;float d=sqrt(b*b-4.0*a*c);return (-b+d)/(2.0*a);}vec3 extinction(vec2 density) {return exp(-vec3(BETA_R*u_color_tint_r.a*density.x+BETA_M*u_color_tint_m.a*density.y));}vec2 local_density(vec3 point) {float height=max(length(point)-PLANET_RADIUS,0.0);float exp_r=exp(-height/DENSITY_HEIGHT_SCALE_R);float exp_m=exp(-height/DENSITY_HEIGHT_SCALE_M);return vec2(exp_r,exp_m);}float phase_ray(float cos_angle) {return (3.0/(16.0*PI))*(1.0+cos_angle*cos_angle);}float phase_mie(float cos_angle) {return (3.0/(8.0*PI))*((1.0-MIE_G*MIE_G)*(1.0+cos_angle*cos_angle))/((2.0+MIE_G*MIE_G)*pow(1.0+MIE_G*MIE_G-2.0*MIE_G*cos_angle,1.5));}vec2 density_to_atmosphere(vec3 point,vec3 light_dir) {float ray_len=ray_sphere_exit(point,light_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(DENSITY_STEPS);vec2 density_point_to_atmosphere=vec2(0.0);for (int i=0; i < DENSITY_STEPS;++i) {vec3 point_on_ray=point+light_dir*((float(i)+0.5)*step_len);density_point_to_atmosphere+=local_density(point_on_ray)*step_len;;}return density_point_to_atmosphere;}vec3 atmosphere(vec3 ray_dir,vec3 sun_direction,float sun_intensity) {vec2 density_orig_to_point=vec2(0.0);vec3 scatter_r=vec3(0.0);vec3 scatter_m=vec3(0.0);vec3 origin=vec3(0.0,PLANET_RADIUS,0.0);float ray_len=ray_sphere_exit(origin,ray_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(SAMPLE_STEPS);for (int i=0; i < SAMPLE_STEPS;++i) {vec3 point_on_ray=origin+ray_dir*((float(i)+0.5)*step_len);vec2 density=local_density(point_on_ray)*step_len;density_orig_to_point+=density;vec2 density_point_to_atmosphere=density_to_atmosphere(point_on_ray,sun_direction);vec2 density_orig_to_atmosphere=density_orig_to_point+density_point_to_atmosphere;vec3 extinction=extinction(density_orig_to_atmosphere);scatter_r+=density.x*extinction;scatter_m+=density.y*extinction;}float cos_angle=dot(ray_dir,sun_direction);float phase_r=phase_ray(cos_angle);float phase_m=phase_mie(cos_angle);vec3 beta_r=BETA_R*u_color_tint_r.rgb*u_color_tint_r.a;vec3 beta_m=BETA_M*u_color_tint_m.rgb*u_color_tint_m.a;return (scatter_r*phase_r*beta_r+scatter_m*phase_m*beta_m)*sun_intensity;}const float A=0.15;const float B=0.50;const float C=0.10;const float D=0.20;const float E=0.02;const float F=0.30;vec3 uncharted2_tonemap(vec3 x) {return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;}void main() {vec3 ray_direction=v_position;ray_direction.y=pow(ray_direction.y,5.0);const float y_bias=0.015;ray_direction.y+=y_bias;vec3 color=atmosphere(normalize(ray_direction),u_sun_direction,u_sun_intensity);float white_scale=1.0748724675633854;color=uncharted2_tonemap((log2(2.0/pow(u_luminance,4.0)))*color)*white_scale;gl_FragColor=vec4(color,1.0);}`,"attribute highp vec3 a_pos_3f;uniform mat3 u_matrix_3f;varying highp vec3 v_position;float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec4 pos=vec4(u_matrix_3f*a_pos_3f,1.0);v_position=pos.xyz;v_position.y*=-1.0;v_position.y=map(v_position.y,-1.0,1.0,0.0,1.0);gl_Position=vec4(a_pos_3f.xy,0.0,1.0);}"),globeRaster:bt(`uniform sampler2D u_image0;varying vec2 v_pos0; -#ifndef FOG -uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform vec2 u_viewport; -#endif -void main() {vec4 color; -#ifdef CUSTOM_ANTIALIASING -vec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix( -mix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);vec3 dir=normalize(ray_dir);vec3 closest_point=dot(u_globe_pos,dir)*dir;float norm_dist_from_center=1.0-length(closest_point-u_globe_pos)/u_globe_radius;const float antialias_pixel=2.0;float antialias_factor=antialias_pixel*fwidth(norm_dist_from_center);float antialias=smoothstep(0.0,antialias_factor,norm_dist_from_center);vec4 raster=texture2D(u_image0,v_pos0);color=vec4(raster.rgb*antialias,raster.a*antialias); -#else -color=texture2D(u_image0,v_pos0); -#endif -#ifdef FOG -color=fog_dither(fog_apply_premultiplied(color,v_fog_pos)); -#endif -gl_FragColor=color; -#ifdef TERRAIN_WIREFRAME -gl_FragColor=vec4(1.0,0.0,0.0,0.8); -#endif -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_proj_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform float u_zoom_transition;uniform vec2 u_merc_center;uniform mat3 u_grid_matrix;uniform float u_skirt_height; -#ifdef GLOBE_POLES -attribute vec3 a_globe_pos;attribute vec2 a_uv; -#else -attribute vec2 a_pos; -#endif -varying vec2 v_pos0;const float wireframeOffset=1e3;float mercatorXfromLng(float lng) {return (180.0+lng)/360.0;}float mercatorYfromLat(float lat) {return (180.0-(RAD_TO_DEG*log(tan(QUARTER_PI+lat/2.0*DEG_TO_RAD))))/360.0;}vec3 latLngToECEF(vec2 latLng) {latLng=DEG_TO_RAD*latLng;float cosLat=cos(latLng[0]);float sinLat=sin(latLng[0]);float cosLng=cos(latLng[1]);float sinLng=sin(latLng[1]);float sx=cosLat*sinLng*GLOBE_RADIUS;float sy=-sinLat*GLOBE_RADIUS;float sz=cosLat*cosLng*GLOBE_RADIUS;return vec3(sx,sy,sz);}void main() { -#ifdef GLOBE_POLES -vec3 globe_pos=a_globe_pos;vec2 uv=a_uv; -#else -float tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];vec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float uvY=mercatorY*tiles-idy;float mercatorX=mercatorXfromLng(latLng[1]);float uvX=mercatorX*tiles-idx;vec3 globe_pos=latLngToECEF(latLng.xy);vec2 merc_pos=vec2(mercatorX,mercatorY);vec2 uv=vec2(uvX,uvY); -#endif -v_pos0=uv;vec2 tile_pos=uv*EXTENT;vec3 globe_derived_up_vector=normalize(globe_pos)*u_tile_up_scale; -#ifdef GLOBE_POLES -vec3 up_vector=globe_derived_up_vector; -#else -vec3 up_vector=elevationVector(tile_pos); -#endif -float height=elevation(tile_pos); -#ifdef TERRAIN_WIREFRAME -height+=wireframeOffset; -#endif -globe_pos+=up_vector*height; -#ifndef GLOBE_POLES -globe_pos-=globe_derived_up_vector*u_skirt_height*decomposed_pos_and_skirt.z; -#endif -#ifdef GLOBE_POLES -vec4 interpolated_pos=u_globe_matrix*vec4(globe_pos,1.0); -#else -vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {merc_world_pos=vec4(merc_pos,height-u_skirt_height*decomposed_pos_and_skirt.z,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition),1.0); -#endif -gl_Position=u_proj_matrix*interpolated_pos; -#ifdef FOG -v_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz); -#endif -}`),globeAtmosphere:bt(`uniform float u_transition;uniform highp float u_fadeout_range;uniform highp float u_temporal_offset;uniform vec3 u_start_color;uniform vec4 u_color;uniform vec4 u_space_color;uniform vec4 u_high_color;uniform float u_star_intensity;uniform float u_star_size;uniform float u_star_density;uniform float u_horizon_angle;uniform mat4 u_rotation_matrix;varying highp vec3 v_ray_dir;varying highp vec3 v_horizon_dir;highp float random(highp vec3 p) {p=fract(p*vec3(23.2342,97.1231,91.2342));p+=dot(p.zxy,p.yxz+123.1234);return fract(p.x*p.y);}float stars(vec3 p,float scale,vec2 offset) {vec2 uv_scale=(u_viewport/u_star_size)*scale;vec3 position=vec3(p.xy*uv_scale+offset*u_viewport,p.z);vec3 q=fract(position)-0.5;vec3 id=floor(position);float random_visibility=step(random(id),u_star_density);float circle=smoothstep(0.5+u_star_intensity,0.5,length(q));return circle*random_visibility;}void main() {highp vec3 dir=normalize(v_ray_dir);float globe_pos_dot_dir; -#ifdef PROJECTION_GLOBE_VIEW -globe_pos_dot_dir=dot(u_globe_pos,dir);highp vec3 closest_point_forward=abs(globe_pos_dot_dir)*dir;float norm_dist_from_center=length(closest_point_forward-u_globe_pos)/u_globe_radius;if (norm_dist_from_center < 0.98) {discard;return;} -#endif -highp vec3 horizon_dir=normalize(v_horizon_dir);float horizon_angle_mercator=dir.y < horizon_dir.y ? -0.0 : max(acos(dot(dir,horizon_dir)),0.0);float horizon_angle; -#ifdef PROJECTION_GLOBE_VIEW -highp vec3 closest_point=globe_pos_dot_dir*dir;float closest_point_to_center=length(closest_point-u_globe_pos);float theta=asin(clamp(closest_point_to_center/length(u_globe_pos),-1.0,1.0));horizon_angle=globe_pos_dot_dir < 0.0 ? -PI-theta-u_horizon_angle : theta-u_horizon_angle;float angle_t=pow(u_transition,10.0);horizon_angle=mix(horizon_angle,horizon_angle_mercator,angle_t); -#else -horizon_angle=horizon_angle_mercator; -#endif -horizon_angle/=PI;float t=exp(-horizon_angle/u_fadeout_range);float alpha_0=u_color.a;float alpha_1=u_high_color.a;float alpha_2=u_space_color.a;vec3 color_stop_0=u_color.rgb;vec3 color_stop_1=u_high_color.rgb;vec3 color_stop_2=u_space_color.rgb;vec3 c0=mix(color_stop_2,color_stop_1,alpha_1);vec3 c1=mix(c0,color_stop_0,alpha_0);vec3 c2=mix(c0,c1,t);vec3 c =mix(color_stop_2,c2,t);float a0=mix(alpha_2,1.0,alpha_1);float a1=mix(a0,1.0,alpha_0);float a2=mix(a0,a1,t);float a =mix(alpha_2,a2,t);vec2 uv=gl_FragCoord.xy/u_viewport-0.5;float aspect_ratio=u_viewport.x/u_viewport.y;vec4 uv_dir=vec4(normalize(vec3(uv.x*aspect_ratio,uv.y,1.0)),1.0);uv_dir=u_rotation_matrix*uv_dir;vec3 n=abs(uv_dir.xyz);vec2 uv_remap=(n.x > n.y && n.x > n.z) ? uv_dir.yz/uv_dir.x: -(n.y > n.x && n.y > n.z) ? uv_dir.zx/uv_dir.y: -uv_dir.xy/uv_dir.z;uv_remap.x/=aspect_ratio;vec3 D=vec3(uv_remap,1.0);highp float star_field=0.0;if (u_star_intensity > 0.0) {star_field+=stars(D,1.2,vec2(0.0,0.0));star_field+=stars(D,1.0,vec2(1.0,0.0));star_field+=stars(D,0.8,vec2(0.0,1.0));star_field+=stars(D,0.6,vec2(1.0,1.0));star_field*=(1.0-pow(t,0.25+(1.0-u_high_color.a)*0.75));c+=star_field*alpha_2;}c=dither(c,gl_FragCoord.xy+u_temporal_offset);gl_FragColor=vec4(c,a);}`,`attribute vec3 a_pos;attribute vec2 a_uv;uniform vec3 u_frustum_tl;uniform vec3 u_frustum_tr;uniform vec3 u_frustum_br;uniform vec3 u_frustum_bl;uniform float u_horizon;varying highp vec3 v_ray_dir;varying highp vec3 v_horizon_dir;void main() {v_ray_dir=mix( -mix(u_frustum_tl,u_frustum_tr,a_uv.x),mix(u_frustum_bl,u_frustum_br,a_uv.x),a_uv.y);v_horizon_dir=mix( -mix(u_frustum_tl,u_frustum_bl,u_horizon),mix(u_frustum_tr,u_frustum_br,u_horizon),a_uv.x);gl_Position=vec4(a_pos,1.0);}`)};function Kn(l,r){const o=l.replace(/\s*\/\/[^\n]*\n/g,` -`).split(` -`);for(let h of o)if(h=h.trim(),h[0]==="#"&&h.includes("if")&&!h.includes("endif")){h=h.replace("#","").replace(/ifdef|ifndef|elif|if/g,"").replace(/!|defined|\(|\)|\|\||&&/g,"").replace(/\s+/g," ").trim();const d=h.split(" ");for(const f of d)r.includes(f)||r.push(f)}}function bt(l,r){const o=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,h=r.match(/attribute (highp |mediump |lowp )?([\w]+) ([\w]+)/g),d={},f=[...Vo];return Kn(l,f),Kn(r,f),{fragmentSource:l=l.replace(o,(g,y,v,E,T)=>(d[T]=!0,y==="define"?` -#ifndef HAS_UNIFORM_u_${T} -varying ${v} ${E} ${T}; -#else -uniform ${v} ${E} u_${T}; -#endif -`:` -#ifdef HAS_UNIFORM_u_${T} - ${v} ${E} ${T} = u_${T}; -#endif -`)),vertexSource:r=r.replace(o,(g,y,v,E,T)=>{const A=E==="float"?"vec2":"vec4",k=T.match(/color/)?"color":A;return d[T]?y==="define"?` -#ifndef HAS_UNIFORM_u_${T} -uniform lowp float u_${T}_t; -attribute ${v} ${A} a_${T}; -varying ${v} ${E} ${T}; -#else -uniform ${v} ${E} u_${T}; -#endif -`:k==="vec4"?` -#ifndef HAS_UNIFORM_u_${T} - ${T} = a_${T}; -#else - ${v} ${E} ${T} = u_${T}; -#endif -`:` -#ifndef HAS_UNIFORM_u_${T} - ${T} = unpack_mix_${k}(a_${T}, u_${T}_t); -#else - ${v} ${E} ${T} = u_${T}; -#endif -`:y==="define"?` -#ifndef HAS_UNIFORM_u_${T} -uniform lowp float u_${T}_t; -attribute ${v} ${A} a_${T}; -#else -uniform ${v} ${E} u_${T}; -#endif -`:k==="vec4"?` -#ifndef HAS_UNIFORM_u_${T} - ${v} ${E} ${T} = a_${T}; -#else - ${v} ${E} ${T} = u_${T}; -#endif -`:` -#ifndef HAS_UNIFORM_u_${T} - ${v} ${E} ${T} = unpack_mix_${k}(a_${T}, u_${T}_t); -#else - ${v} ${E} ${T} = u_${T}; -#endif -`}),staticAttributes:h,usedDefines:f}}class Ch{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffers=[],this.vao=null}bind(r,o,h,d,f,g,y){this.context=r;let v=this.boundPaintVertexBuffers.length!==d.length;for(let T=0;!v&&T{const N=I.paint.get("hillshade-shadow-color"),j=I.paint.get("hillshade-highlight-color"),K=I.paint.get("hillshade-accent-color");let J=I.paint.get("hillshade-illumination-direction")*(Math.PI/180);I.paint.get("hillshade-illumination-anchor")==="viewport"&&(J-=B.transform.angle);const Y=!B.options.moving;return{u_matrix:L||B.transform.calculateProjMatrix(F.tileID.toUnwrapped(),Y),u_image:0,u_latrange:Ua(0,F.tileID),u_light:[I.paint.get("hillshade-exaggeration"),J],u_shadow:N,u_highlight:j,u_accent:K}})(l,o,h,l.terrain?r.projMatrix:null);l.prepareDrawProgram(y,T,r.toUnwrapped());const{tileBoundsBuffer:k,tileBoundsIndexBuffer:R,tileBoundsSegments:O}=l.getTileBoundsBuffers(o);T.draw(y,v.TRIANGLES,d,f,g,a.CullFaceMode.disabled,A,h.id,k,R,O)}function Va(l,r,o){if(!r.needsDEMTextureUpload)return;const h=l.context,d=h.gl;h.pixelStoreUnpackPremultiplyAlpha.set(!1),r.demTexture=r.demTexture||l.getTileTexture(o.stride);const f=o.getPixels();r.demTexture?r.demTexture.update(f,{premultiply:!1}):r.demTexture=new a.Texture(h,f,d.RGBA,{premultiply:!1}),r.needsDEMTextureUpload=!1}function cc(l,r,o,h,d,f){const g=l.context,y=g.gl;if(!r.dem)return;const v=r.dem;if(g.activeTexture.set(y.TEXTURE1),Va(l,r,v),!r.demTexture)return;r.demTexture.bind(y.NEAREST,y.CLAMP_TO_EDGE);const E=v.dim;g.activeTexture.set(y.TEXTURE0);let T=r.fbo;if(!T){const O=new a.Texture(g,{width:E,height:E,data:null},y.RGBA);O.bind(y.LINEAR,y.CLAMP_TO_EDGE),T=r.fbo=g.createFramebuffer(E,E,!0),T.colorAttachment.set(O.texture)}g.bindFramebuffer.set(T.framebuffer),g.viewport.set([0,0,E,E]);const{tileBoundsBuffer:A,tileBoundsIndexBuffer:k,tileBoundsSegments:R}=l.getMercatorTileBoundsBuffers();l.useProgram("hillshadePrepare").draw(g,y.TRIANGLES,h,d,f,a.CullFaceMode.disabled,((O,B)=>{const F=B.stride,I=a.create();return a.ortho(I,0,a.EXTENT,-a.EXTENT,0,0,1),a.translate(I,I,[0,-a.EXTENT,0]),{u_matrix:I,u_image:1,u_dimension:[F,F],u_zoom:O.overscaledZ,u_unpack:B.unpackVector}})(r.tileID,v),o.id,A,k,R),r.needsHillshadePrepare=!1}const Na=l=>({u_matrix:new a.UniformMatrix4f(l),u_image0:new a.Uniform1i(l),u_skirt_height:new a.Uniform1f(l)}),Yn=(l,r)=>({u_matrix:l,u_image0:0,u_skirt_height:r}),Cs=(l,r,o,h,d,f,g,y,v,E,T,A,k,R,O)=>({u_proj_matrix:Float32Array.from(l),u_globe_matrix:r,u_normalize_matrix:Float32Array.from(h),u_merc_matrix:o,u_zoom_transition:d,u_merc_center:f,u_image0:0,u_frustum_tl:g,u_frustum_tr:y,u_frustum_br:v,u_frustum_bl:E,u_globe_pos:T,u_globe_radius:A,u_viewport:k,u_grid_matrix:O?Float32Array.from(O):new Float32Array(9),u_skirt_height:R});function Jn(l,r){return l!=null&&r!=null&&!(!l.hasData()||!r.hasData())&&l.demTexture!=null&&r.demTexture!=null&&l.tileID.key!==r.tileID.key}const Pr=new class{constructor(){this.operations={}}newMorphing(l,r,o,h,d){if(l in this.operations){const f=this.operations[l];f.to.tileID.key!==o.tileID.key&&(f.queued=o)}else this.operations[l]={startTime:h,phase:0,duration:d,from:r,to:o,queued:null}}getMorphValuesForProxy(l){if(!(l in this.operations))return null;const r=this.operations[l];return{from:r.from,to:r.to,phase:r.phase}}update(l){for(const r in this.operations){const o=this.operations[r];for(o.phase=(l-o.startTime)/o.duration;o.phase>=1||!this._validOp(o);)if(!this._nextOp(o,l)){delete this.operations[r];break}}}_nextOp(l,r){return!!l.queued&&(l.from=l.to,l.to=l.queued,l.queued=null,l.phase=0,l.startTime=r,!0)}_validOp(l){return l.from.hasData()&&l.to.hasData()}},bn={0:null,1:"TERRAIN_VERTEX_MORPHING",2:"TERRAIN_WIREFRAME"};function zs(l){return 6*Math.pow(1.5,22-l)}function hc(l,r){const o=1<({u_matrix:l});function ja(l,r,o,h,d){if(d>0){const f=a.exported.now(),g=(f-l.timeAdded)/d,y=r?(f-r.timeAdded)/d:-1,v=o.getSource(),E=h.coveringZoomLevel({tileSize:v.tileSize,roundZoom:v.roundZoom}),T=!r||Math.abs(r.tileID.overscaledZ-E)>Math.abs(l.tileID.overscaledZ-E),A=T&&l.refreshedUponExpiration?1:a.clamp(T?g:1-y,0,1);return l.refreshedUponExpiration&&g>=1&&(l.refreshedUponExpiration=!1),r?{opacity:1,mix:1-A}:{opacity:A,mix:0}}return{opacity:1,mix:0}}class Ga extends a.SourceCache{constructor(r){const o={type:"raster-dem",maxzoom:r.transform.maxZoom},h=new oi(Zn(),null),d=nt("mock-dem",o,h,r.style);super("mock-dem",d,!1),d.setEventedParent(this),this._sourceLoaded=!0}_loadTile(r,o){r.state="loaded",o(null)}}class Ps extends a.SourceCache{constructor(r){const o=nt("proxy",{type:"geojson",maxzoom:r.transform.maxZoom},new oi(Zn(),null),r.style);super("proxy",o,!1),o.setEventedParent(this),this.map=this.getSource().map=r,this.used=this._sourceLoaded=!0,this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}update(r,o,h){if(r.freezeTileCoverage)return;this.transform=r;const d=r.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}).reduce((f,g)=>{if(f[g.key]="",!this._tiles[g.key]){const y=new a.Tile(g,this._source.tileSize*g.overscaleFactor(),r.tileZoom);y.state="loaded",this._tiles[g.key]=y}return f},{});for(const f in this._tiles)f in d||(this.freeFBO(f),this._tiles[f].unloadVectorData(),delete this._tiles[f])}freeFBO(r){const o=this.proxyCachedFBO[r];if(o!==void 0){const h=Object.values(o);this.renderCachePool.push(...h),delete this.proxyCachedFBO[r]}}deallocRenderCache(){this.renderCache.forEach(r=>r.fb.destroy()),this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}}class ks extends a.OverscaledTileID{constructor(r,o,h){super(r.overscaledZ,r.wrap,r.canonical.z,r.canonical.x,r.canonical.y),this.proxyTileKey=o,this.projMatrix=h}}class $a extends a.Elevation{constructor(r,o){super(),this.painter=r,this.terrainTileForTile={},this.prevTerrainTileForTile={};const[h,d,f]=function(v){const E=new a.StructArrayLayout2i4,T=new a.StructArrayLayout3ui6,A=131;E.reserve(17161),T.reserve(33800);const k=a.EXTENT/128,R=a.EXTENT+k/2,O=R+k;for(let F=-k;FR||F<0||F>R?24575:0,N=a.clamp(Math.round(I),0,a.EXTENT),j=a.clamp(Math.round(F),0,a.EXTENT);E.emplaceBack(N+L,j)}const B=(F,I)=>{const L=I*A+F;T.emplaceBack(L+1,L,L+A),T.emplaceBack(L+A,L+A+1,L+1)};for(let F=1;F<129;F++)for(let I=1;I<129;I++)B(I,F);return[0,129].forEach(F=>{for(let I=0;I<130;I++)B(I,F),B(F,I)}),[E,T,32768]}(),g=r.context;this.gridBuffer=g.createVertexBuffer(h,a.posAttributes.members),this.gridIndexBuffer=g.createIndexBuffer(d),this.gridSegments=a.SegmentVector.simpleSegment(0,0,h.length,d.length),this.gridNoSkirtSegments=a.SegmentVector.simpleSegment(0,0,h.length,f),this.proxyCoords=[],this.proxiedCoords={},this._visibleDemTiles=[],this._drapedRenderBatches=[],this._sourceTilesOverlap={},this.proxySourceCache=new Ps(o.map),this.orthoMatrix=a.create(),a.ortho(this.orthoMatrix,this.painter.transform.projection.name==="globe"?.015:0,a.EXTENT,0,a.EXTENT,0,1);const y=g.gl;this._overlapStencilMode=new a.StencilMode({func:y.GEQUAL,mask:255},0,255,y.KEEP,y.KEEP,y.REPLACE),this._previousZoom=r.transform.zoom,this.pool=[],this._findCoveringTileCache={},this._tilesDirty={},this.style=o,this._useVertexMorphing=!0,this._exaggeration=1,this._mockSourceCache=new Ga(o.map)}set style(r){r.on("data",this._onStyleDataEvent.bind(this)),r.on("neworder",this._checkRenderCacheEfficiency.bind(this)),this._style=r,this._checkRenderCacheEfficiency(),this._style.map.on("moveend",()=>{this._clearLineLayersFromRenderCache()})}update(r,o,h){if(r&&r.terrain){this._style!==r&&(this.style=r),this.enabled=!0;const d=r.terrain.properties;this.sourceCache=r.terrain.drapeRenderMode===0?this._mockSourceCache:r._getSourceCache(d.get("source")),this._exaggeration=d.get("exaggeration");const f=()=>{this.sourceCache.used&&a.warnOnce(`Raster DEM source '${this.sourceCache.id}' is used both for terrain and as layer source. -This leads to lower resolution of hillshade. For full hillshade resolution but higher memory consumption, define another raster DEM source.`);const g=this.getScaledDemTileSize();this.sourceCache.update(o,g,!0),this.resetTileLookupCache(this.sourceCache.id)};this.sourceCache.usedForTerrain||(this.resetTileLookupCache(this.sourceCache.id),this.sourceCache.usedForTerrain=!0,f(),this._initializing=!0),f(),o.updateElevation(!0,h),this.resetTileLookupCache(this.proxySourceCache.id),this.proxySourceCache.update(o),this._emptyDEMTextureDirty=!0}else this._disable()}resetTileLookupCache(r){this._findCoveringTileCache[r]={}}getScaledDemTileSize(){return this.sourceCache.getSource().tileSize/128*this.proxySourceCache.getSource().tileSize}_checkRenderCacheEfficiency(){const r=this.renderCacheEfficiency(this._style);this._style.map._optimizeForTerrain||r.efficiency!==100&&a.warnOnce(`Terrain render cache efficiency is not optimal (${r.efficiency}%) and performance - may be affected negatively, consider placing all background, fill and line layers before layer - with id '${r.firstUndrapedLayer}' or create a map using optimizeForTerrain: true option.`)}_onStyleDataEvent(r){r.coord&&r.dataType==="source"?this._clearRenderCacheForTile(r.sourceCacheId,r.coord):r.dataType==="style"&&(this._invalidateRenderCache=!0)}_disable(){if(this.enabled&&(this.enabled=!1,this._sharedDepthStencil=void 0,this.proxySourceCache.deallocRenderCache(),this._style))for(const r in this._style._sourceCaches)this._style._sourceCaches[r].usedForTerrain=!1}destroy(){this._disable(),this._emptyDEMTexture&&this._emptyDEMTexture.destroy(),this._emptyDepthBufferTexture&&this._emptyDepthBufferTexture.destroy(),this.pool.forEach(r=>r.fb.destroy()),this.pool=[],this._depthFBO&&(this._depthFBO.destroy(),this._depthFBO=void 0,this._depthTexture=void 0)}_source(){return this.enabled?this.sourceCache:null}isUsingMockSource(){return this.sourceCache===this._mockSourceCache}exaggeration(){return this._exaggeration}get visibleDemTiles(){return this._visibleDemTiles}get drapeBufferSize(){const r=2*this.proxySourceCache.getSource().tileSize;return[r,r]}set useVertexMorphing(r){this._useVertexMorphing=r}updateTileBinding(r){if(!this.enabled)return;this.prevTerrainTileForTile=this.terrainTileForTile;const o=this.proxySourceCache,h=this.painter.transform;this._initializing&&(this._initializing=h._centerAltitude===0&&this.getAtPointOrZero(a.MercatorCoordinate.fromLngLat(h.center),-1)===-1,this._emptyDEMTextureDirty=!this._initializing);const d=this.proxyCoords=o.getIds().map(v=>{const E=o.getTileByID(v).tileID;return E.projMatrix=h.calculateProjMatrix(E.toUnwrapped()),E});(function(v,E){const T=E.transform.pointCoordinate(E.transform.getCameraPoint()),A=new a.Point(T.x,T.y);v.sort((k,R)=>{if(R.overscaledZ-k.overscaledZ)return R.overscaledZ-k.overscaledZ;const O=new a.Point(k.canonical.x+(1<{this.proxyToSource[v.key]={}}),this.terrainTileForTile={};const g=this._style._sourceCaches;for(const v in g){const E=g[v];if(!E.used||(E!==this.sourceCache&&this.resetTileLookupCache(E.id),this._setupProxiedCoordsForOrtho(E,r[v],f),E.usedForTerrain))continue;const T=r[v];E.getSource().reparseOverscaled&&this._assignTerrainTiles(T)}this.proxiedCoords[o.id]=d.map(v=>new ks(v,v.key,this.orthoMatrix)),this._assignTerrainTiles(d),this._prepareDEMTextures(),this._setupDrapedRenderBatches(),this._initFBOPool(),this._setupRenderCache(f),this.renderingToTexture=!1,this._updateTimestamp=a.exported.now();const y={};this._visibleDemTiles=[];for(const v of this.proxyCoords){const E=this.terrainTileForTile[v.key];if(!E)continue;const T=E.tileID.key;T in y||(this._visibleDemTiles.push(E),y[T]=T)}}_assignTerrainTiles(r){this._initializing||r.forEach(o=>{if(this.terrainTileForTile[o.key])return;const h=this._findTileCoveringTileID(o,this.sourceCache);h&&(this.terrainTileForTile[o.key]=h)})}_prepareDEMTextures(){const r=this.painter.context,o=r.gl;for(const h in this.terrainTileForTile){const d=this.terrainTileForTile[h],f=d.dem;!f||d.demTexture&&!d.needsDEMTextureUpload||(r.activeTexture.set(o.TEXTURE1),Va(this.painter,d,f))}}_prepareDemTileUniforms(r,o,h,d){if(!o||o.demTexture==null)return!1;const f=r.tileID.canonical,g=Math.pow(2,o.tileID.canonical.z-f.z),y=d||"";return h[`u_dem_tl${y}`]=[f.x*g%1,f.y*g%1],h[`u_dem_scale${y}`]=g,!0}get emptyDEMTexture(){return!this._emptyDEMTextureDirty&&this._emptyDEMTexture?this._emptyDEMTexture:this._updateEmptyDEMTexture()}get emptyDepthBufferTexture(){const r=this.painter.context,o=r.gl;if(!this._emptyDepthBufferTexture){const h=new a.RGBAImage({width:1,height:1},Uint8Array.of(255,255,255,255));this._emptyDepthBufferTexture=new a.Texture(r,h,o.RGBA,{premultiply:!1})}return this._emptyDepthBufferTexture}_getLoadedAreaMinimum(){let r=0;const o=this._visibleDemTiles.reduce((h,d)=>{if(!d.dem)return h;const f=d.dem.tree.minimums[0];return f>0&&r++,h+f},0);return r?o/r:0}_updateEmptyDEMTexture(){const r=this.painter.context,o=r.gl;r.activeTexture.set(o.TEXTURE2);const h=this._getLoadedAreaMinimum(),d=new a.RGBAImage({width:1,height:1},new Uint8Array(a.DEMData.pack(h,this.sourceCache.getSource().encoding)));this._emptyDEMTextureDirty=!1;let f=this._emptyDEMTexture;return f?f.update(d,{premultiply:!1}):f=this._emptyDEMTexture=new a.Texture(r,d,o.RGBA,{premultiply:!1}),f}setupElevationDraw(r,o,h){const d=this.painter.context,f=d.gl,g=(y=this.sourceCache.getSource().encoding,{u_dem:2,u_dem_prev:4,u_dem_unpack:a.DEMData.getUnpackVector(y),u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_exaggeration:0});var y;g.u_dem_size=this.sourceCache.getSource().tileSize,g.u_exaggeration=this.exaggeration();let v=null,E=null,T=1;if(h&&h.morphing&&this._useVertexMorphing){const A=h.morphing.srcDemTile,k=h.morphing.dstDemTile;T=h.morphing.phase,A&&k&&(this._prepareDemTileUniforms(r,A,g,"_prev")&&(E=A),this._prepareDemTileUniforms(r,k,g)&&(v=k))}if(E&&v?(d.activeTexture.set(f.TEXTURE2),v.demTexture.bind(f.NEAREST,f.CLAMP_TO_EDGE,f.NEAREST),d.activeTexture.set(f.TEXTURE4),E.demTexture.bind(f.NEAREST,f.CLAMP_TO_EDGE,f.NEAREST),g.u_dem_lerp=T):(v=this.terrainTileForTile[r.tileID.key],d.activeTexture.set(f.TEXTURE2),(this._prepareDemTileUniforms(r,v,g)?v.demTexture:this.emptyDEMTexture).bind(f.NEAREST,f.CLAMP_TO_EDGE)),d.activeTexture.set(f.TEXTURE3),h&&h.useDepthForOcclusion?(this._depthTexture&&this._depthTexture.bind(f.NEAREST,f.CLAMP_TO_EDGE),this._depthFBO&&(g.u_depth_size_inv=[1/this._depthFBO.width,1/this._depthFBO.height])):(this.emptyDepthBufferTexture.bind(f.NEAREST,f.CLAMP_TO_EDGE),g.u_depth_size_inv=[1,1]),h&&h.useMeterToDem&&v){const A=(1<{if(I===we)return;const _e=[bn[we],"PROJECTION_GLOBE_VIEW"];j&&_e.push("CUSTOM_ANTIALIASING"),ae&&_e.push(bn[L]),F=E.useProgram("globeRaster",null,_e),I=we},J=E.colorModeForRenderPass(),Y=new a.DepthMode(B.LEQUAL,a.DepthMode.ReadWrite,E.depthRangeFor3D);Pr.update(R);const ie=a.calculateGlobeMercatorMatrix(N),te=[a.mercatorXfromLng(N.center.lng),a.mercatorYfromLat(N.center.lat)],le=L?[!1,!0]:[!1],Te=E.globeSharedBuffers,oe=[N.width*a.exported.devicePixelRatio,N.height*a.exported.devicePixelRatio],ge=Float32Array.from(N.globeMatrix),he={useDenormalizedUpVectorScale:!0};if(le.forEach(we=>{const ae=E.transform,_e=zs(ae.zoom)*T.exaggeration();I=-1;const Me=we?B.LINES:B.TRIANGLES;for(const ve of k){const Ae=A.getTile(ve),Ge=a.StencilMode.disabled,Xe=T.prevTerrainTileForTile[ve.key],Ve=T.terrainTileForTile[ve.key];Jn(Xe,Ve)&&Pr.newMorphing(ve.key,Xe,Ve,R,250),O.activeTexture.set(B.TEXTURE0),Ae.texture.bind(B.LINEAR,B.CLAMP_TO_EDGE);const qe=Pr.getMorphValuesForProxy(ve.key),lt=qe?1:0;qe&&a.extend$1(he,{morphing:{srcDemTile:qe.from,dstDemTile:qe.to,phase:a.easeCubicInOut(qe.phase)}});const ot=a.tileCornersToBounds(ve.canonical),je=a.getLatitudinalLod(ot.getCenter().lat),wt=a.getGridMatrix(ve.canonical,ot,je,ae.worldSize/ae._pixelsPerMercatorPixel),Tt=a.globeNormalizeECEF(a.globeTileBounds(ve.canonical)),Et=Cs(ae.projMatrix,ge,ie,Tt,a.globeToMercatorTransition(ae.zoom),te,ae.frustumCorners.TL,ae.frustumCorners.TR,ae.frustumCorners.BR,ae.frustumCorners.BL,ae.globeCenterInViewSpace,ae.globeRadius,oe,_e,wt);if(K(lt,we),T.setupElevationDraw(Ae,F,he),E.prepareDrawProgram(O,F,ve.toUnwrapped()),Te){const[St,vi,ui]=we?Te.getWirefameBuffers(E.context,je):Te.getGridBuffers(je,_e!==0);F.draw(O,Me,Y,Ge,J,a.CullFaceMode.backCCW,Et,"globe_raster",St,vi,ui)}}}),Te){const we=["GLOBE_POLES","PROJECTION_GLOBE_VIEW"];j&&we.push("CUSTOM_ANTIALIASING"),F=E.useProgram("globeRaster",null,we);for(const ae of k){const{x:_e,y:Me,z:ve}=ae.canonical,Ae=Me===0,Ge=Me===(1<Et.draw(O,B.TRIANGLES,Y,a.StencilMode.disabled,J,a.CullFaceMode.disabled,Cs(N.projMatrix,je,je,wt,0,te,N.frustumCorners.TL,N.frustumCorners.TR,N.frustumCorners.BR,N.frustumCorners.BL,N.globeCenterInViewSpace,N.globeRadius,oe,0),"globe_pole_raster",St,qe,lt);T.setupElevationDraw(ot,F,he),E.prepareDrawProgram(O,F,ae.toUnwrapped()),Ae&&Tt(F,Xe),Ge&&(je=a.scale(a.create(),je,[1,-1,1]),Tt(F,Ve))}}}})(d,f,g,y,v);else{const E=d.context,T=E.gl;let A,k;const R=d.options.showTerrainWireframe?2:0,O=(N,j)=>{if(k===N)return;const K=[bn[N]];j&&K.push(bn[R]),A=d.useProgram("terrainRaster",null,K),k=N},B=d.colorModeForRenderPass(),F=new a.DepthMode(T.LEQUAL,a.DepthMode.ReadWrite,d.depthRangeFor3D);Pr.update(v);const I=d.transform,L=zs(I.zoom)*f.exaggeration();(R?[!1,!0]:[!1]).forEach(N=>{k=-1;const j=N?T.LINES:T.TRIANGLES,[K,J]=N?f.getWirefameBuffer():[f.gridIndexBuffer,f.gridSegments];for(const Y of y){const ie=g.getTile(Y),te=a.StencilMode.disabled,le=f.prevTerrainTileForTile[Y.key],Te=f.terrainTileForTile[Y.key];Jn(le,Te)&&Pr.newMorphing(Y.key,le,Te,v,250),E.activeTexture.set(T.TEXTURE0),ie.texture.bind(T.LINEAR,T.CLAMP_TO_EDGE,T.LINEAR_MIPMAP_NEAREST);const oe=Pr.getMorphValuesForProxy(Y.key),ge=oe?1:0;let he;oe&&(he={morphing:{srcDemTile:oe.from,dstDemTile:oe.to,phase:a.easeCubicInOut(oe.phase)}});const we=Yn(Y.projMatrix,hc(Y.canonical,I.renderWorldCopies)?L/10:L);O(ge,N),f.setupElevationDraw(ie,A,he),d.prepareDrawProgram(E,A,Y.toUnwrapped()),A.draw(E,j,F,te,B,a.CullFaceMode.backCCW,we,"terrain_raster",f.gridBuffer,K,J)}})}}(o,this,this.proxySourceCache,r,this._updateTimestamp),this.renderingToTexture=!0,o.gpuTimingDeferredRenderEnd(),r.splice(0,r.length))}renderBatch(r){if(this._drapedRenderBatches.length===0)return r+1;this.renderingToTexture=!0;const o=this.painter,h=this.painter.context,d=this.proxySourceCache,f=this.proxiedCoords[d.id],g=this._drapedRenderBatches.shift(),y=[],v=o.style.order;let E=0;for(const T of f){const A=d.getTileByID(T.proxyTileKey),k=d.proxyCachedFBO[T.key]?d.proxyCachedFBO[T.key][r]:void 0,R=k!==void 0?d.renderCache[k]:this.pool[E++],O=k!==void 0;if(A.texture=R.tex,O&&!R.dirty){y.push(A.tileID);continue}let B;h.bindFramebuffer.set(R.fb.framebuffer),this.renderedToTile=!1,R.dirty&&(h.clear({color:a.Color.transparent,stencil:0}),R.dirty=!1);for(let F=g.start;F<=g.end;++F){const I=o.style._layers[v[F]];if(I.isHidden(o.transform.zoom))continue;const L=o.style._getLayerSourceCache(I),N=L?this.proxyToSource[T.key][L.id]:[T];if(!N)continue;const j=N;h.viewport.set([0,0,R.fb.width,R.fb.height]),B!==(L?L.id:null)&&(this._setupStencil(R,N,I,L),B=L?L.id:null),o.renderLayer(o,L,I,j)}this.renderedToTile?(R.dirty=!0,y.push(A.tileID)):O||--E,E===5&&(E=0,this.renderToBackBuffer(y))}return this.renderToBackBuffer(y),this.renderingToTexture=!1,h.bindFramebuffer.set(null),h.viewport.set([0,0,o.width,o.height]),g.end+1}postRender(){}renderCacheEfficiency(r){const o=r.order.length;if(o===0)return{efficiency:100};let h,d=0,f=0,g=!1;for(let y=0;yo.dem).forEach(o=>{r=Math.min(r,o.dem.tree.minimums[0])}),r===0?r:(r-30)*this._exaggeration}raycast(r,o,h){if(!this._visibleDemTiles)return null;const d=this._visibleDemTiles.filter(f=>f.dem).map(f=>{const g=f.tileID,y=1<(f.t!==null?f.t:Number.MAX_VALUE)-(g.t!==null?g.t:Number.MAX_VALUE));for(const f of d){if(f.t==null)return null;const g=f.tile.dem.tree.raycast(f.minx,f.miny,f.maxx,f.maxy,r,o,h);if(g!=null)return g}return null}_createFBO(){const r=this.painter.context,o=r.gl,h=this.drapeBufferSize;r.activeTexture.set(o.TEXTURE0);const d=new a.Texture(r,{width:h[0],height:h[1],data:null},o.RGBA);d.bind(o.LINEAR,o.CLAMP_TO_EDGE);const f=r.createFramebuffer(h[0],h[1],!1);return f.colorAttachment.set(d.texture),f.depthAttachment=new Q(r,f.framebuffer),this._sharedDepthStencil===void 0?(this._sharedDepthStencil=r.createRenderbuffer(r.gl.DEPTH_STENCIL,h[0],h[1]),this._stencilRef=0,f.depthAttachment.set(this._sharedDepthStencil),r.clear({stencil:0})):f.depthAttachment.set(this._sharedDepthStencil),r.extTextureFilterAnisotropic&&!r.extTextureFilterAnisotropicForceOff&&o.texParameterf(o.TEXTURE_2D,r.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,r.extTextureFilterAnisotropicMax),{fb:f,tex:d,dirty:!1}}_initFBOPool(){for(;this.pool.length{const o=this._style._layers[r],h=o.isHidden(this.painter.transform.zoom);return o.type==="custom"?!h&&o.shouldRedrape():!h&&o.hasTransition()})}_clearLineLayersFromRenderCache(){let r=!1;for(const h of this._style._getSources())if(h instanceof ke){r=!0;break}if(!r)return;const o={};for(let h=0;ho.renderCachePool.length){const g=Object.values(o.proxyCachedFBO);o.proxyCachedFBO={};for(let y=0;y=0;g--){const y=h[g];if(o.getTileByID(y.key),o.proxyCachedFBO[y.key]!==void 0){const v=r[y.key],E=this.proxyToSource[y.key];let T=0;for(const A in E){const k=E[A],R=v[A];if(!R||R.length!==k.length||k.some((O,B)=>O!==R[B]||d[A]&&d[A].hasOwnProperty(O.key))){T=-1;break}++T}for(const A in o.proxyCachedFBO[y.key])o.renderCache[o.proxyCachedFBO[y.key][A]].dirty=T<0||T!==Object.values(v).length}}const f=[...this._drapedRenderBatches];f.sort((g,y)=>y.end-y.start-(g.end-g.start));for(const g of f)for(const y of h){if(o.proxyCachedFBO[y.key])continue;let v=o.renderCachePool.pop();v===void 0&&o.renderCache.length<50&&(v=o.renderCache.length,o.renderCache.push(this._createFBO())),v!==void 0&&(o.proxyCachedFBO[y.key]={},o.proxyCachedFBO[y.key][g.start]=v,o.renderCache[v].dirty=!0)}this._tilesDirty={}}_setupStencil(r,o,h,d){if(!d||!this._sourceTilesOverlap[d.id])return void(this._overlapStencilType&&(this._overlapStencilType=!1));const f=this.painter.context,g=f.gl;if(o.length<=1)return void(this._overlapStencilType=!1);let y;if(h.isTileClipped())y=o.length,this._overlapStencilMode.test={func:g.EQUAL,mask:255},this._overlapStencilType="Clip";else{if(!(o[0].overscaledZ>o[o.length-1].overscaledZ))return void(this._overlapStencilType=!1);y=1,this._overlapStencilMode.test={func:g.GREATER,mask:255},this._overlapStencilType="Mask"}this._stencilRef+y>255&&(f.clear({stencil:0}),this._stencilRef=0),this._stencilRef+=y,this._overlapStencilMode.ref=this._stencilRef,h.isTileClipped()&&this._renderTileClippingMasks(o,this._overlapStencilMode.ref)}clipOrMaskOverlapStencilType(){return this._overlapStencilType==="Clip"||this._overlapStencilType==="Mask"}stencilModeForRTTOverlap(r){return this.renderingToTexture&&this._overlapStencilType?(this._overlapStencilType==="Clip"&&(this._overlapStencilMode.ref=this.painter._tileClippingMaskIDs[r.key]),this._overlapStencilMode):a.StencilMode.disabled}_renderTileClippingMasks(r,o){const h=this.painter,d=this.painter.context,f=d.gl;h._tileClippingMaskIDs={},d.setColorMode(a.ColorMode.disabled),d.setDepthMode(a.DepthMode.disabled);const g=h.useProgram("clippingMask");for(const y of r){const v=h._tileClippingMaskIDs[y.key]=--o;g.draw(d,f.TRIANGLES,a.DepthMode.disabled,new a.StencilMode({func:f.ALWAYS,mask:0},v,255,f.KEEP,f.KEEP,f.REPLACE),a.ColorMode.disabled,a.CullFaceMode.disabled,No(y.projMatrix),"$clipping",h.tileExtentBuffer,h.quadTriangleIndexBuffer,h.tileExtentSegments)}}pointCoordinate(r){const o=this.painter.transform;if(r.x<0||r.x>o.width||r.y<0||r.y>o.height)return null;const h=[r.x,r.y,1,1];a.transformMat4$1(h,h,o.pixelMatrixInverse),a.scale$1(h,h,1/h[3]),h[0]/=o.worldSize,h[1]/=o.worldSize;const d=o._camera.position,f=a.mercatorZfromAltitude(1,o.center.lat),g=[d[0],d[1],d[2]/f,0],y=a.subtract([],h.slice(0,3),g);a.normalize(y,y);const v=this.raycast(g,y,this._exaggeration);return v!==null&&v?(a.scaleAndAdd(g,g,y,v),g[3]=g[2],g[2]*=f,g):null}drawDepth(){const r=this.painter,o=r.context,h=this.proxySourceCache,d=Math.ceil(r.width),f=Math.ceil(r.height);if(!this._depthFBO||this._depthFBO.width===d&&this._depthFBO.height===f||(this._depthFBO.destroy(),this._depthFBO=void 0,this._depthTexture=void 0),!this._depthFBO){const g=o.gl,y=o.createFramebuffer(d,f,!0);o.activeTexture.set(g.TEXTURE0);const v=new a.Texture(o,{width:d,height:f,data:null},g.RGBA);v.bind(g.NEAREST,g.CLAMP_TO_EDGE),y.colorAttachment.set(v.texture);const E=o.createRenderbuffer(o.gl.DEPTH_COMPONENT16,d,f);y.depthAttachment.set(E),this._depthFBO=y,this._depthTexture=v}o.bindFramebuffer.set(this._depthFBO.framebuffer),o.viewport.set([0,0,d,f]),function(g,y,v,E){if(g.transform.projection.name==="globe")return;const T=g.context,A=T.gl;T.clear({depth:1});const k=g.useProgram("terrainDepth"),R=new a.DepthMode(A.LESS,a.DepthMode.ReadWrite,g.depthRangeFor3D);for(const O of E){const B=v.getTile(O),F=Yn(O.projMatrix,0);y.setupElevationDraw(B,k),k.draw(T,A.TRIANGLES,R,a.StencilMode.disabled,a.ColorMode.unblended,a.CullFaceMode.backCCW,F,"terrain_depth",y.gridBuffer,y.gridIndexBuffer,y.gridNoSkirtSegments)}}(r,this,h,this.proxyCoords)}_setupProxiedCoordsForOrtho(r,o,h){if(r.getSource()instanceof rt)return this._setupProxiedCoordsForImageSource(r,o,h);this._findCoveringTileCache[r.id]=this._findCoveringTileCache[r.id]||{};const d=this.proxiedCoords[r.id]=[],f=this.proxyCoords;for(let y=0;y(T.min.x=Math.min(T.min.x,A.x-y.x),T.min.y=Math.min(T.min.y,A.y-y.y),T.max.x=Math.max(T.max.x,A.x-y.x),T.max.y=Math.max(T.max.y,A.y-y.y),T),{min:new a.Point(Number.MAX_VALUE,Number.MAX_VALUE),max:new a.Point(-Number.MAX_VALUE,-Number.MAX_VALUE)}),E=(T,A)=>{const k=T.wrap+T.canonical.x/(1<B+v.max.x||R+OF+v.max.y};for(let T=0;Tg.key===o.tileID.key);if(f)return f}if(o.tileID.key!==r.key){const f=r.canonical.z-o.tileID.canonical.z;let g,y,v;d=a.create();const E=o.tileID.wrap-r.wrap<0?(g=a.EXTENT>>f,y=g*((o.tileID.canonical.x<=A){const k=r.canonical.z-A;o.getSource().reparseOverscaled?(y=Math.max(r.canonical.z+2,o.transform.tileZoom),g=new a.OverscaledTileID(y,r.wrap,A,r.canonical.x>>k,r.canonical.y>>k)):k!==0&&(y=A,g=new a.OverscaledTileID(y,r.wrap,A,r.canonical.x>>k,r.canonical.y>>k))}g.key!==r.key&&(E.push(g.key),h=o.getTile(g))}const T=A=>{E.forEach(k=>{d[k]=A}),E.length=0};for(y-=1;y>=v&&(!h||!h.hasData());y--){h&&T(h.tileID.key);const A=g.calculateScaledKey(y);if(h=o.getTileByID(A),h&&h.hasData())break;const k=d[A];if(k===null)break;k===void 0?E.push(A):h=o.getTileByID(k)}return T(h?h.tileID.key:null),h&&h.hasData()?h:null}findDEMTileFor(r){return this.enabled?this._findTileCoveringTileID(r,this.sourceCache):null}prepareDrawTile(){this.renderedToTile=!0}_clearRenderCacheForTile(r,o){let h=this._tilesDirty[r];h||(h=this._tilesDirty[r]={}),h[o.key]=!0}getWirefameBuffer(){if(!this.wireframeSegments){const r=function(o){let h=0;const d=new a.StructArrayLayout2ui4,f=131;for(let g=1;g<129;g++){for(let y=1;y<129;y++)h=g*f+y,d.emplaceBack(h,h+1),d.emplaceBack(h,h+f),d.emplaceBack(h+1,h+f),g===128&&d.emplaceBack(h+f,h+f+1);d.emplaceBack(h+1,h+1+f)}return d}();this.wireframeIndexBuffer=this.painter.context.createIndexBuffer(r),this.wireframeSegments=a.SegmentVector.simpleSegment(0,0,this.gridBuffer.length,r.length)}return[this.wireframeIndexBuffer,this.wireframeSegments]}}class mt{static cacheKey(r,o,h,d){let f=`${o}${d?d.cacheKey:""}`;for(const g of h)r.usedDefines.includes(g)&&(f+=`/${g}`);return f}constructor(r,o,h,d,f,g){const y=r.gl;this.program=y.createProgram();const v=function(I){const L=[];for(let N=0;N`#define ${I}`));const k=r.isWebGL2?`#version 300 es -`:"",R=k+A.concat(r.extStandardDerivatives&&k.length===0?`#extension GL_OES_standard_derivatives : enable -`.concat(Oa):Oa,Oa,Is,ac.fragmentSource,Hn.fragmentSource,h.fragmentSource).join(` -`),O=k+A.concat(` -#ifdef GL_ES -precision highp float; -#else - -#if !defined(lowp) -#define lowp -#endif - -#if !defined(mediump) -#define mediump -#endif - -#if !defined(highp) -#define highp -#endif - -#endif`,Is,ac.vertexSource,Hn.vertexSource,As.vertexSource,h.vertexSource).join(` -`),B=y.createShader(y.FRAGMENT_SHADER);if(y.isContextLost())return void(this.failedToCreate=!0);y.shaderSource(B,R),y.compileShader(B),y.attachShader(this.program,B);const F=y.createShader(y.VERTEX_SHADER);if(y.isContextLost())this.failedToCreate=!0;else{y.shaderSource(F,O),y.compileShader(F),y.attachShader(this.program,F),this.attributes={},this.numAttributes=T.length;for(let I=0;I({u_dem:new a.Uniform1i(I),u_dem_prev:new a.Uniform1i(I),u_dem_unpack:new a.Uniform4f(I),u_dem_tl:new a.Uniform2f(I),u_dem_scale:new a.Uniform1f(I),u_dem_tl_prev:new a.Uniform2f(I),u_dem_scale_prev:new a.Uniform1f(I),u_dem_size:new a.Uniform1f(I),u_dem_lerp:new a.Uniform1f(I),u_exaggeration:new a.Uniform1f(I),u_depth:new a.Uniform1i(I),u_depth_size_inv:new a.Uniform2f(I),u_meter_to_dem:new a.Uniform1f(I),u_label_plane_matrix_inv:new a.UniformMatrix4f(I)}))(r)),g.includes("GLOBE")&&(this.globeUniforms=(I=>({u_tile_tl_up:new a.Uniform3f(I),u_tile_tr_up:new a.Uniform3f(I),u_tile_br_up:new a.Uniform3f(I),u_tile_bl_up:new a.Uniform3f(I),u_tile_up_scale:new a.Uniform1f(I)}))(r)),g.includes("FOG")&&(this.fogUniforms=(I=>({u_fog_matrix:new a.UniformMatrix4f(I),u_fog_range:new a.Uniform2f(I),u_fog_color:new a.Uniform4f(I),u_fog_horizon_blend:new a.Uniform1f(I),u_fog_temporal_offset:new a.Uniform1f(I),u_frustum_tl:new a.Uniform3f(I),u_frustum_tr:new a.Uniform3f(I),u_frustum_br:new a.Uniform3f(I),u_frustum_bl:new a.Uniform3f(I),u_globe_pos:new a.Uniform3f(I),u_globe_radius:new a.Uniform1f(I),u_globe_transition:new a.Uniform1f(I),u_is_globe:new a.Uniform1i(I),u_viewport:new a.Uniform2f(I)}))(r))}}setTerrainUniformValues(r,o){if(!this.terrainUniforms)return;const h=this.terrainUniforms;if(!this.failedToCreate){r.program.set(this.program);for(const d in o)h[d]&&h[d].set(this.program,d,o[d])}}setGlobeUniformValues(r,o){if(!this.globeUniforms)return;const h=this.globeUniforms;if(!this.failedToCreate){r.program.set(this.program);for(const d in o)h[d]&&h[d].set(this.program,d,o[d])}}setFogUniformValues(r,o){if(!this.fogUniforms)return;const h=this.fogUniforms;if(!this.failedToCreate){r.program.set(this.program);for(const d in o)h[d].set(this.program,d,o[d])}}draw(r,o,h,d,f,g,y,v,E,T,A,k,R,O,B){const F=r.gl;if(this.failedToCreate)return;r.program.set(this.program),r.setDepthMode(h),r.setStencilMode(d),r.setColorMode(f),r.setCullFace(g);for(const L of Object.keys(this.fixedUniforms))this.fixedUniforms[L].set(this.program,L,y[L]);O&&O.setUniforms(this.program,r,this.binderUniforms,k,{zoom:R});const I={[F.LINES]:2,[F.TRIANGLES]:3,[F.LINE_STRIP]:1}[o];for(const L of A.get()){const N=L.vaos||(L.vaos={});(N[v]||(N[v]=new Ch)).bind(r,this,E,O?O.getPaintVertexBuffers():[],T,L.vertexOffset,B||[]),F.drawElements(o,L.primitiveLength*I,F.UNSIGNED_SHORT,L.primitiveOffset*I*2)}}}function jo(l,r){const o=Math.pow(2,r.tileID.overscaledZ),h=r.tileSize*Math.pow(2,l.transform.tileZoom)/o,d=h*(r.tileID.canonical.x+r.tileID.wrap*o),f=h*r.tileID.canonical.y;return{u_image:0,u_texsize:r.imageAtlasTexture.size,u_tile_units_to_pixels:1/ai(r,1,l.transform.tileZoom),u_pixel_coord_upper:[d>>16,f>>16],u_pixel_coord_lower:[65535&d,65535&f]}}const uc=a.create(),Za=(l,r,o,h,d,f,g,y,v,E,T)=>{const A=r.style.light,k=A.properties.get("position"),R=[k.x,k.y,k.z],O=a.create$1();A.properties.get("anchor")==="viewport"&&(a.fromRotation(O,-r.transform.angle),a.transformMat3(R,R,O));const B=A.properties.get("color"),F=r.transform,I={u_matrix:l,u_lightpos:R,u_lightintensity:A.properties.get("intensity"),u_lightcolor:[B.r,B.g,B.b],u_vertical_gradient:+o,u_opacity:h,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:uc,u_merc_center:[0,0],u_up_dir:[0,0,0],u_height_lift:0,u_ao:d,u_edge_radius:f};return F.projection.name==="globe"&&(I.u_tile_id=[g.canonical.x,g.canonical.y,1<{const k=Za(l,r,o,h,d,f,g,v,E,T,A),R={u_height_factor:-Math.pow(2,g.overscaledZ)/y.tileSize/8};return a.extend(k,jo(r,y),R)},wn=l=>({u_matrix:l}),qa=(l,r,o)=>a.extend(wn(l),jo(r,o)),zh=(l,r)=>({u_matrix:l,u_world:r}),Ph=(l,r,o,h)=>a.extend(qa(l,r,o),{u_world:h}),kh=a.create(),Wa=(l,r,o,h,d,f)=>{const g=l.transform,y=g.projection.name==="globe";let v;if(f.paint.get("circle-pitch-alignment")==="map")if(y){const T=a.globePixelsToTileUnits(g.zoom,r.canonical)*g._pixelsPerMercatorPixel;v=Float32Array.from([T,0,0,T])}else v=g.calculatePixelsToTileUnitsMatrix(o);else v=new Float32Array([g.pixelsToGLUnits[0],0,0,g.pixelsToGLUnits[1]]);const E={u_camera_to_center_distance:g.cameraToCenterDistance,u_matrix:l.translatePosMatrix(r.projMatrix,o,f.paint.get("circle-translate"),f.paint.get("circle-translate-anchor")),u_device_pixel_ratio:a.exported.devicePixelRatio,u_extrude_scale:v,u_inv_rot_matrix:kh,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(y){E.u_inv_rot_matrix=h,E.u_merc_center=d,E.u_tile_id=[r.canonical.x,r.canonical.y,1<{const r=[];return l.paint.get("circle-pitch-alignment")==="map"&&r.push("PITCH_WITH_MAP"),l.paint.get("circle-pitch-scale")==="map"&&r.push("SCALE_WITH_MAP"),r},Ha=(l,r,o,h)=>{const d=a.EXTENT/o.tileSize;return{u_matrix:l,u_camera_to_center_distance:r.getCameraToCenterDistance(h),u_extrude_scale:[r.pixelsToGLUnits[0]/d,r.pixelsToGLUnits[1]/d]}},Ds=(l,r,o=1)=>({u_matrix:l,u_color:r,u_overlay:0,u_overlay_scale:o}),pc=a.create(),fc=(l,r,o,h,d,f,g)=>{const y=l.transform,v=y.projection.name==="globe",E=v?a.globePixelsToTileUnits(y.zoom,r.canonical)*y._pixelsPerMercatorPixel:ai(o,1,f),T={u_matrix:r.projMatrix,u_extrude_scale:E,u_intensity:g,u_inv_rot_matrix:pc,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(v){T.u_inv_rot_matrix=h,T.u_merc_center=d,T.u_tile_id=[r.canonical.x,r.canonical.y,1<{const y=l.transform,v=y.calculatePixelsToTileUnitsMatrix(r);return{u_matrix:Ka(l,r,o,h),u_pixels_to_tile_units:v,u_device_pixel_ratio:f,u_units_to_pixels:[1/y.pixelsToGLUnits[0],1/y.pixelsToGLUnits[1]],u_dash_image:0,u_gradient_image:1,u_image_height:d,u_texsize:$o(o)?r.lineAtlasTexture.size:[0,0],u_tile_units_to_pixels:Qn(r,l.transform),u_alpha_discard_threshold:0,u_trim_offset:g}},Go=(l,r,o,h,d)=>{const f=l.transform;return{u_matrix:Ka(l,r,o,h),u_texsize:r.imageAtlasTexture.size,u_pixels_to_tile_units:f.calculatePixelsToTileUnitsMatrix(r),u_device_pixel_ratio:d,u_image:0,u_tile_units_to_pixels:Qn(r,f),u_units_to_pixels:[1/f.pixelsToGLUnits[0],1/f.pixelsToGLUnits[1]],u_alpha_discard_threshold:0}};function Qn(l,r){return 1/ai(l,1,r.tileZoom)}function Ka(l,r,o,h){return l.translatePosMatrix(h||r.tileID.projMatrix,r,o.paint.get("line-translate"),o.paint.get("line-translate-anchor"))}function $o(l){const r=l.paint.get("line-dasharray").value;return r.value||r.kind!=="constant"}const Ya=(l,r,o,h,d,f)=>{return{u_matrix:l,u_tl_parent:r,u_scale_parent:o,u_fade_t:h.mix,u_opacity:h.opacity*d.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:d.paint.get("raster-brightness-min"),u_brightness_high:d.paint.get("raster-brightness-max"),u_saturation_factor:(y=d.paint.get("raster-saturation"),y>0?1-1/(1.001-y):-y),u_contrast_factor:(g=d.paint.get("raster-contrast"),g>0?1/(1-g):1+g),u_spin_weights:hr(d.paint.get("raster-hue-rotate")),u_perspective_transform:f};var g,y};function hr(l){l*=Math.PI/180;const r=Math.sin(l),o=Math.cos(l);return[(2*o+1)/3,(-Math.sqrt(3)*r-o+1)/3,(Math.sqrt(3)*r-o+1)/3]}const Ls=a.create(),Ja=(l,r,o,h,d,f,g,y,v,E,T,A,k,R,O,B)=>{const F=d.transform,I={u_is_size_zoom_constant:+(l==="constant"||l==="source"),u_is_size_feature_constant:+(l==="constant"||l==="camera"),u_size_t:r?r.uSizeT:0,u_size:r?r.uSize:0,u_camera_to_center_distance:F.cameraToCenterDistance,u_rotate_symbol:+o,u_aspect_ratio:F.width/F.height,u_fade_change:d.options.fadeDuration?d.symbolFadeChange:1,u_matrix:f,u_label_plane_matrix:g,u_coord_matrix:y,u_is_text:+v,u_pitch_with_map:+h,u_texsize:E,u_texture:0,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:Ls,u_merc_center:[0,0],u_camera_forward:[0,0,0],u_ecef_origin:[0,0,0],u_tile_matrix:Ls,u_up_vector:[0,-1,0]};return B.name==="globe"&&(I.u_tile_id=[T.canonical.x,T.canonical.y,1<a.extend(Ja(l,r,o,h,d,f,g,y,v,E,A,k,R,O,B,F),{u_gamma_scale:h?d.transform.cameraToCenterDistance*Math.cos(d.terrain?0:d.transform._pitch):1,u_device_pixel_ratio:a.exported.devicePixelRatio,u_is_halo:+T}),mc=(l,r,o,h,d,f,g,y,v,E,T,A,k,R,O,B)=>a.extend(Rs(l,r,o,h,d,f,g,y,!0,v,!0,T,A,k,R,O,B),{u_texsize_icon:E,u_texture_icon:1}),Qa=(l,r,o)=>({u_matrix:l,u_opacity:r,u_color:o}),Lh=(l,r,o,h,d)=>a.extend(function(f,g,y){const v=g.imageManager.getPattern(f.toString()),{width:E,height:T}=g.imageManager.getPixelSize(),A=Math.pow(2,y.tileID.overscaledZ),k=y.tileSize*Math.pow(2,g.transform.tileZoom)/A,R=k*(y.tileID.canonical.x+y.tileID.wrap*A),O=k*y.tileID.canonical.y;return{u_image:0,u_pattern_tl:v.tl,u_pattern_br:v.br,u_texsize:[E,T],u_pattern_size:v.displaySize,u_tile_units_to_pixels:1/ai(y,1,g.transform.tileZoom),u_pixel_coord_upper:[R>>16,O>>16],u_pixel_coord_lower:[65535&R,65535&O]}}(h,o,d),{u_matrix:l,u_opacity:r}),el={fillExtrusion:l=>({u_matrix:new a.UniformMatrix4f(l),u_lightpos:new a.Uniform3f(l),u_lightintensity:new a.Uniform1f(l),u_lightcolor:new a.Uniform3f(l),u_vertical_gradient:new a.Uniform1f(l),u_opacity:new a.Uniform1f(l),u_edge_radius:new a.Uniform1f(l),u_ao:new a.Uniform2f(l),u_tile_id:new a.Uniform3f(l),u_zoom_transition:new a.Uniform1f(l),u_inv_rot_matrix:new a.UniformMatrix4f(l),u_merc_center:new a.Uniform2f(l),u_up_dir:new a.Uniform3f(l),u_height_lift:new a.Uniform1f(l)}),fillExtrusionPattern:l=>({u_matrix:new a.UniformMatrix4f(l),u_lightpos:new a.Uniform3f(l),u_lightintensity:new a.Uniform1f(l),u_lightcolor:new a.Uniform3f(l),u_vertical_gradient:new a.Uniform1f(l),u_height_factor:new a.Uniform1f(l),u_edge_radius:new a.Uniform1f(l),u_ao:new a.Uniform2f(l),u_tile_id:new a.Uniform3f(l),u_zoom_transition:new a.Uniform1f(l),u_inv_rot_matrix:new a.UniformMatrix4f(l),u_merc_center:new a.Uniform2f(l),u_up_dir:new a.Uniform3f(l),u_height_lift:new a.Uniform1f(l),u_image:new a.Uniform1i(l),u_texsize:new a.Uniform2f(l),u_pixel_coord_upper:new a.Uniform2f(l),u_pixel_coord_lower:new a.Uniform2f(l),u_tile_units_to_pixels:new a.Uniform1f(l),u_opacity:new a.Uniform1f(l)}),fill:l=>({u_matrix:new a.UniformMatrix4f(l)}),fillPattern:l=>({u_matrix:new a.UniformMatrix4f(l),u_image:new a.Uniform1i(l),u_texsize:new a.Uniform2f(l),u_pixel_coord_upper:new a.Uniform2f(l),u_pixel_coord_lower:new a.Uniform2f(l),u_tile_units_to_pixels:new a.Uniform1f(l)}),fillOutline:l=>({u_matrix:new a.UniformMatrix4f(l),u_world:new a.Uniform2f(l)}),fillOutlinePattern:l=>({u_matrix:new a.UniformMatrix4f(l),u_world:new a.Uniform2f(l),u_image:new a.Uniform1i(l),u_texsize:new a.Uniform2f(l),u_pixel_coord_upper:new a.Uniform2f(l),u_pixel_coord_lower:new a.Uniform2f(l),u_tile_units_to_pixels:new a.Uniform1f(l)}),circle:l=>({u_camera_to_center_distance:new a.Uniform1f(l),u_extrude_scale:new a.UniformMatrix2f(l),u_device_pixel_ratio:new a.Uniform1f(l),u_matrix:new a.UniformMatrix4f(l),u_inv_rot_matrix:new a.UniformMatrix4f(l),u_merc_center:new a.Uniform2f(l),u_tile_id:new a.Uniform3f(l),u_zoom_transition:new a.Uniform1f(l),u_up_dir:new a.Uniform3f(l)}),collisionBox:l=>({u_matrix:new a.UniformMatrix4f(l),u_camera_to_center_distance:new a.Uniform1f(l),u_extrude_scale:new a.Uniform2f(l)}),collisionCircle:l=>({u_matrix:new a.UniformMatrix4f(l),u_inv_matrix:new a.UniformMatrix4f(l),u_camera_to_center_distance:new a.Uniform1f(l),u_viewport_size:new a.Uniform2f(l)}),debug:l=>({u_color:new a.UniformColor(l),u_matrix:new a.UniformMatrix4f(l),u_overlay:new a.Uniform1i(l),u_overlay_scale:new a.Uniform1f(l)}),clippingMask:l=>({u_matrix:new a.UniformMatrix4f(l)}),heatmap:l=>({u_extrude_scale:new a.Uniform1f(l),u_intensity:new a.Uniform1f(l),u_matrix:new a.UniformMatrix4f(l),u_inv_rot_matrix:new a.UniformMatrix4f(l),u_merc_center:new a.Uniform2f(l),u_tile_id:new a.Uniform3f(l),u_zoom_transition:new a.Uniform1f(l),u_up_dir:new a.Uniform3f(l)}),heatmapTexture:l=>({u_image:new a.Uniform1i(l),u_color_ramp:new a.Uniform1i(l),u_opacity:new a.Uniform1f(l)}),hillshade:l=>({u_matrix:new a.UniformMatrix4f(l),u_image:new a.Uniform1i(l),u_latrange:new a.Uniform2f(l),u_light:new a.Uniform2f(l),u_shadow:new a.UniformColor(l),u_highlight:new a.UniformColor(l),u_accent:new a.UniformColor(l)}),hillshadePrepare:l=>({u_matrix:new a.UniformMatrix4f(l),u_image:new a.Uniform1i(l),u_dimension:new a.Uniform2f(l),u_zoom:new a.Uniform1f(l),u_unpack:new a.Uniform4f(l)}),line:l=>({u_matrix:new a.UniformMatrix4f(l),u_pixels_to_tile_units:new a.UniformMatrix2f(l),u_device_pixel_ratio:new a.Uniform1f(l),u_units_to_pixels:new a.Uniform2f(l),u_dash_image:new a.Uniform1i(l),u_gradient_image:new a.Uniform1i(l),u_image_height:new a.Uniform1f(l),u_texsize:new a.Uniform2f(l),u_tile_units_to_pixels:new a.Uniform1f(l),u_alpha_discard_threshold:new a.Uniform1f(l),u_trim_offset:new a.Uniform2f(l)}),linePattern:l=>({u_matrix:new a.UniformMatrix4f(l),u_texsize:new a.Uniform2f(l),u_pixels_to_tile_units:new a.UniformMatrix2f(l),u_device_pixel_ratio:new a.Uniform1f(l),u_image:new a.Uniform1i(l),u_units_to_pixels:new a.Uniform2f(l),u_tile_units_to_pixels:new a.Uniform1f(l),u_alpha_discard_threshold:new a.Uniform1f(l)}),raster:l=>({u_matrix:new a.UniformMatrix4f(l),u_tl_parent:new a.Uniform2f(l),u_scale_parent:new a.Uniform1f(l),u_fade_t:new a.Uniform1f(l),u_opacity:new a.Uniform1f(l),u_image0:new a.Uniform1i(l),u_image1:new a.Uniform1i(l),u_brightness_low:new a.Uniform1f(l),u_brightness_high:new a.Uniform1f(l),u_saturation_factor:new a.Uniform1f(l),u_contrast_factor:new a.Uniform1f(l),u_spin_weights:new a.Uniform3f(l),u_perspective_transform:new a.Uniform2f(l)}),symbolIcon:l=>({u_is_size_zoom_constant:new a.Uniform1i(l),u_is_size_feature_constant:new a.Uniform1i(l),u_size_t:new a.Uniform1f(l),u_size:new a.Uniform1f(l),u_camera_to_center_distance:new a.Uniform1f(l),u_rotate_symbol:new a.Uniform1i(l),u_aspect_ratio:new a.Uniform1f(l),u_fade_change:new a.Uniform1f(l),u_matrix:new a.UniformMatrix4f(l),u_label_plane_matrix:new a.UniformMatrix4f(l),u_coord_matrix:new a.UniformMatrix4f(l),u_is_text:new a.Uniform1i(l),u_pitch_with_map:new a.Uniform1i(l),u_texsize:new a.Uniform2f(l),u_tile_id:new a.Uniform3f(l),u_zoom_transition:new a.Uniform1f(l),u_inv_rot_matrix:new a.UniformMatrix4f(l),u_merc_center:new a.Uniform2f(l),u_camera_forward:new a.Uniform3f(l),u_tile_matrix:new a.UniformMatrix4f(l),u_up_vector:new a.Uniform3f(l),u_ecef_origin:new a.Uniform3f(l),u_texture:new a.Uniform1i(l)}),symbolSDF:l=>({u_is_size_zoom_constant:new a.Uniform1i(l),u_is_size_feature_constant:new a.Uniform1i(l),u_size_t:new a.Uniform1f(l),u_size:new a.Uniform1f(l),u_camera_to_center_distance:new a.Uniform1f(l),u_rotate_symbol:new a.Uniform1i(l),u_aspect_ratio:new a.Uniform1f(l),u_fade_change:new a.Uniform1f(l),u_matrix:new a.UniformMatrix4f(l),u_label_plane_matrix:new a.UniformMatrix4f(l),u_coord_matrix:new a.UniformMatrix4f(l),u_is_text:new a.Uniform1i(l),u_pitch_with_map:new a.Uniform1i(l),u_texsize:new a.Uniform2f(l),u_texture:new a.Uniform1i(l),u_gamma_scale:new a.Uniform1f(l),u_device_pixel_ratio:new a.Uniform1f(l),u_tile_id:new a.Uniform3f(l),u_zoom_transition:new a.Uniform1f(l),u_inv_rot_matrix:new a.UniformMatrix4f(l),u_merc_center:new a.Uniform2f(l),u_camera_forward:new a.Uniform3f(l),u_tile_matrix:new a.UniformMatrix4f(l),u_up_vector:new a.Uniform3f(l),u_ecef_origin:new a.Uniform3f(l),u_is_halo:new a.Uniform1i(l)}),symbolTextAndIcon:l=>({u_is_size_zoom_constant:new a.Uniform1i(l),u_is_size_feature_constant:new a.Uniform1i(l),u_size_t:new a.Uniform1f(l),u_size:new a.Uniform1f(l),u_camera_to_center_distance:new a.Uniform1f(l),u_rotate_symbol:new a.Uniform1i(l),u_aspect_ratio:new a.Uniform1f(l),u_fade_change:new a.Uniform1f(l),u_matrix:new a.UniformMatrix4f(l),u_label_plane_matrix:new a.UniformMatrix4f(l),u_coord_matrix:new a.UniformMatrix4f(l),u_is_text:new a.Uniform1i(l),u_pitch_with_map:new a.Uniform1i(l),u_texsize:new a.Uniform2f(l),u_texsize_icon:new a.Uniform2f(l),u_texture:new a.Uniform1i(l),u_texture_icon:new a.Uniform1i(l),u_gamma_scale:new a.Uniform1f(l),u_device_pixel_ratio:new a.Uniform1f(l),u_is_halo:new a.Uniform1i(l)}),background:l=>({u_matrix:new a.UniformMatrix4f(l),u_opacity:new a.Uniform1f(l),u_color:new a.UniformColor(l)}),backgroundPattern:l=>({u_matrix:new a.UniformMatrix4f(l),u_opacity:new a.Uniform1f(l),u_image:new a.Uniform1i(l),u_pattern_tl:new a.Uniform2f(l),u_pattern_br:new a.Uniform2f(l),u_texsize:new a.Uniform2f(l),u_pattern_size:new a.Uniform2f(l),u_pixel_coord_upper:new a.Uniform2f(l),u_pixel_coord_lower:new a.Uniform2f(l),u_tile_units_to_pixels:new a.Uniform1f(l)}),terrainRaster:Na,terrainDepth:Na,skybox:l=>({u_matrix:new a.UniformMatrix4f(l),u_sun_direction:new a.Uniform3f(l),u_cubemap:new a.Uniform1i(l),u_opacity:new a.Uniform1f(l),u_temporal_offset:new a.Uniform1f(l)}),skyboxGradient:l=>({u_matrix:new a.UniformMatrix4f(l),u_color_ramp:new a.Uniform1i(l),u_center_direction:new a.Uniform3f(l),u_radius:new a.Uniform1f(l),u_opacity:new a.Uniform1f(l),u_temporal_offset:new a.Uniform1f(l)}),skyboxCapture:l=>({u_matrix_3f:new a.UniformMatrix3f(l),u_sun_direction:new a.Uniform3f(l),u_sun_intensity:new a.Uniform1f(l),u_color_tint_r:new a.Uniform4f(l),u_color_tint_m:new a.Uniform4f(l),u_luminance:new a.Uniform1f(l)}),globeRaster:l=>({u_proj_matrix:new a.UniformMatrix4f(l),u_globe_matrix:new a.UniformMatrix4f(l),u_normalize_matrix:new a.UniformMatrix4f(l),u_merc_matrix:new a.UniformMatrix4f(l),u_zoom_transition:new a.Uniform1f(l),u_merc_center:new a.Uniform2f(l),u_image0:new a.Uniform1i(l),u_grid_matrix:new a.UniformMatrix3f(l),u_skirt_height:new a.Uniform1f(l),u_frustum_tl:new a.Uniform3f(l),u_frustum_tr:new a.Uniform3f(l),u_frustum_br:new a.Uniform3f(l),u_frustum_bl:new a.Uniform3f(l),u_globe_pos:new a.Uniform3f(l),u_globe_radius:new a.Uniform1f(l),u_viewport:new a.Uniform2f(l)}),globeAtmosphere:l=>({u_frustum_tl:new a.Uniform3f(l),u_frustum_tr:new a.Uniform3f(l),u_frustum_br:new a.Uniform3f(l),u_frustum_bl:new a.Uniform3f(l),u_horizon:new a.Uniform1f(l),u_transition:new a.Uniform1f(l),u_fadeout_range:new a.Uniform1f(l),u_color:new a.Uniform4f(l),u_high_color:new a.Uniform4f(l),u_space_color:new a.Uniform4f(l),u_star_intensity:new a.Uniform1f(l),u_star_density:new a.Uniform1f(l),u_star_size:new a.Uniform1f(l),u_temporal_offset:new a.Uniform1f(l),u_horizon_angle:new a.Uniform1f(l),u_rotation_matrix:new a.UniformMatrix4f(l)})};let Bs;function Zo(l,r,o,h,d,f,g){const y=l.context,v=y.gl,E=l.transform,T=l.useProgram("collisionBox"),A=[];let k=0,R=0;for(let j=0;j0){const oe=a.create(),ge=te;a.mul(oe,Y.placementInvProjMatrix,E.glCoordMatrix),a.mul(oe,oe,Y.placementViewportMatrix),A.push({circleArray:Te,circleOffset:R,transform:ge,invTransform:oe,projection:Y.getProjection()}),k+=Te.length/4,R=k}le&&(l.terrain&&l.terrain.setupElevationDraw(J,T),T.draw(y,v.LINES,a.DepthMode.disabled,a.StencilMode.disabled,l.colorModeForRenderPass(),a.CullFaceMode.disabled,Ha(te,E,J,Y.getProjection()),o.id,le.layoutVertexBuffer,le.indexBuffer,le.segments,null,E.zoom,null,[le.collisionVertexBuffer,le.collisionVertexBufferExt]))}if(!g||!A.length)return;const O=l.useProgram("collisionCircle"),B=new a.StructArrayLayout2f1f2i16;B.resize(4*k),B._trim();let F=0;for(const j of A)for(let K=0;K=0&&(O[j.associatedIconIndex]={x:oe,y:ge,z:he,angle:ve})}else er(Y,k)}if(T){R.clear();const N=l.icon.placedSymbolArray;for(let j=0;joe.sortKey-ge.sortKey);for(const oe of te){const ge=oe.state;if(l.terrain&&l.terrain.setupElevationDraw(ge.tile,ge.program,{useDepthForOcclusion:!ie,labelPlaneMatrixInv:ge.labelPlaneMatrixInv}),k.activeTexture.set(R.TEXTURE0),ge.atlasTexture.bind(ge.atlasInterpolation,R.CLAMP_TO_EDGE),ge.atlasTextureIcon&&(k.activeTexture.set(R.TEXTURE1),ge.atlasTextureIcon&&ge.atlasTextureIcon.bind(ge.atlasInterpolationIcon,R.CLAMP_TO_EDGE)),ge.isSDF){const he=ge.uniformValues;ge.hasHalo&&(he.u_is_halo=1,qo(ge.buffers,oe.segments,o,l,ge.program,K,T,A,he)),he.u_is_halo=0}qo(ge.buffers,oe.segments,o,l,ge.program,K,T,A,ge.uniformValues)}}function qo(l,r,o,h,d,f,g,y,v){const E=h.context,T=[l.dynamicLayoutVertexBuffer,l.opacityVertexBuffer,l.globeExtVertexBuffer];d.draw(E,E.gl.TRIANGLES,f,g,y,a.CullFaceMode.disabled,v,o.id,l.layoutVertexBuffer,l.indexBuffer,r,o.paint,h.transform.zoom,l.programConfigurations.get(o.id),T)}function yc(l,r,o,h,d,f,g){const y=l.context.gl,v=o.paint.get("fill-pattern"),E=v&&v.constantOr(1);let T,A,k,R,O;g?(A=E&&!o.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",T=y.LINES):(A=E?"fillPattern":"fill",T=y.TRIANGLES);for(const B of h){const F=r.getTile(B);if(E&&!F.patternsLoaded())continue;const I=F.getBucket(o);if(!I)continue;l.prepareDrawTile();const L=I.programConfigurations.get(o.id),N=l.useProgram(A,L);E&&(l.context.activeTexture.set(y.TEXTURE0),F.imageAtlasTexture.bind(y.LINEAR,y.CLAMP_TO_EDGE),L.updatePaintBuffers());const j=v.constantOr(null);if(j&&F.imageAtlas){const J=F.imageAtlas.patternPositions[j.toString()];J&&L.setConstantPatternPositions(J)}const K=l.translatePosMatrix(B.projMatrix,F,o.paint.get("fill-translate"),o.paint.get("fill-translate-anchor"));if(g){R=I.indexBuffer2,O=I.segments2;const J=l.terrain&&l.terrain.renderingToTexture?l.terrain.drapeBufferSize:[y.drawingBufferWidth,y.drawingBufferHeight];k=A==="fillOutlinePattern"&&E?Ph(K,l,F,J):zh(K,J)}else R=I.indexBuffer,O=I.segments,k=E?qa(K,l,F):wn(K);l.prepareDrawProgram(l.context,N,B.toUnwrapped()),N.draw(l.context,T,d,l.stencilModeForClipping(B),f,a.CullFaceMode.disabled,k,o.id,I.layoutVertexBuffer,R,O,o.paint,l.transform.zoom,L)}}function Os(l,r,o,h,d,f,g){const y=l.context,v=y.gl,E=l.transform,T=o.paint.get("fill-extrusion-pattern"),A=T.constantOr(1),k=o.paint.get("fill-extrusion-opacity"),R=[o.paint.get("fill-extrusion-ambient-occlusion-intensity"),o.paint.get("fill-extrusion-ambient-occlusion-radius")],O=o.layout.get("fill-extrusion-edge-radius"),B=O>0&&!o.paint.get("fill-extrusion-rounded-roof"),F=B?0:O,I=E.projection.name==="globe"?a.fillExtrusionHeightLift():0,L=E.projection.name==="globe",N=L?a.globeToMercatorTransition(E.zoom):0,j=[a.mercatorXfromLng(E.center.lng),a.mercatorYfromLat(E.center.lat)],K=[];L&&K.push("PROJECTION_GLOBE_VIEW"),R[0]>0&&K.push("FAUX_AO"),B&&K.push("ZERO_ROOF_RADIUS");for(const J of h){const Y=r.getTile(J),ie=Y.getBucket(o);if(!ie||ie.projection.name!==E.projection.name)continue;const te=ie.programConfigurations.get(o.id),le=l.useProgram(A?"fillExtrusionPattern":"fillExtrusion",te,K);if(l.terrain){const _e=l.terrain;if(l.style.terrainSetForDrapingOnly())_e.setupElevationDraw(Y,le,{useMeterToDem:!0});else{if(!ie.enableTerrain)continue;if(_e.setupElevationDraw(Y,le,{useMeterToDem:!0}),xc(y,r,J,ie,o,_e),!ie.centroidVertexBuffer){const Me=le.attributes.a_centroid_pos;Me!==void 0&&v.vertexAttrib2f(Me,0,0)}}}A&&(l.context.activeTexture.set(v.TEXTURE0),Y.imageAtlasTexture.bind(v.LINEAR,v.CLAMP_TO_EDGE),te.updatePaintBuffers());const Te=T.constantOr(null);if(Te&&Y.imageAtlas){const _e=Y.imageAtlas.patternPositions[Te.toString()];_e&&te.setConstantPatternPositions(_e)}const oe=l.translatePosMatrix(J.projMatrix,Y,o.paint.get("fill-extrusion-translate"),o.paint.get("fill-extrusion-translate-anchor")),ge=E.projection.createInversionMatrix(E,J.canonical),he=o.paint.get("fill-extrusion-vertical-gradient"),we=A?dc(oe,l,he,k,R,F,J,Y,I,N,j,ge):Za(oe,l,he,k,R,F,J,I,N,j,ge);l.prepareDrawProgram(y,le,J.toUnwrapped());const ae=[];l.terrain&&ae.push(ie.centroidVertexBuffer),L&&ae.push(ie.layoutVertexExtBuffer),le.draw(y,y.gl.TRIANGLES,d,f,g,a.CullFaceMode.backCCW,we,o.id,ie.layoutVertexBuffer,ie.indexBuffer,ie.segments,o.paint,l.transform.zoom,te,ae)}}function xc(l,r,o,h,d,f){const g=[I=>{let L=I.canonical.x-1,N=I.wrap;return L<0&&(L=(1<{let L=I.canonical.x+1,N=I.wrap;return L===1<new a.OverscaledTileID(I.overscaledZ,I.wrap,I.canonical.z,I.canonical.x,(I.canonical.y===0?1<new a.OverscaledTileID(I.overscaledZ,I.wrap,I.canonical.z,I.canonical.x,I.canonical.y===(1<{const L=r.getSource().minzoom,N=K=>{const J=r.getTileByID(K);if(J&&J.hasData())return J.getBucket(d)},j=[0,-1,1];for(const K of j){if(I.overscaledZ+K(v[0]=Math.min(I.min.y,L.min.y),v[1]=Math.max(I.max.y,L.max.y),v[2]=a.EXTENT-L.min.x>I.max.x?L.min.x-a.EXTENT:I.max.x,v),T=(I,L)=>(v[0]=Math.min(I.min.x,L.min.x),v[1]=Math.max(I.max.x,L.max.x),v[2]=a.EXTENT-L.min.y>I.max.y?L.min.y-a.EXTENT:I.max.y,v),A=[(I,L)=>E(I,L),(I,L)=>E(L,I),(I,L)=>T(I,L),(I,L)=>T(L,I)],k=new a.Point(0,0);let R,O,B;const F=(I,L,N,j,K)=>{const J=[[j?N:I,j?I:N,0],[j?N:L,j?L:N,0]],Y=K<0?a.EXTENT+K:K,ie=[j?Y:(I+L)/2,j?(I+L)/2:Y,0];return N===0&&K<0||N!==0&&K>0?f.getForTilePoints(B,[ie],!0,O):J.push(ie),f.getForTilePoints(o,J,!0,R),Math.max(J[0][2],J[1][2],ie[2])/f.exaggeration()};for(let I=0;I<4;I++){const L=(I<2?1:5)-I,N=h.borders[I];if(N.length===0)continue;const j=B=g[I](o),K=y(j);if(!(K&&K instanceof a.FillExtrusionBucket&&K.enableTerrain)||h.borderDoneWithNeighborZ[I]===K.canonical.z&&K.borderDoneWithNeighborZ[L]===h.canonical.z||(O=f.findDEMTileFor(j),!O||!O.dem))continue;if(!R){const te=f.findDEMTileFor(o);if(!te||!te.dem)return;R=te}const J=K.borders[L];let Y=0;const ie=K.borderDoneWithNeighborZ[L]!==h.canonical.z;if(h.canonical.z===K.canonical.z){for(let te=0;teTe[0]+3));)ie&&K.encodeCentroid(void 0,oe,!1),Y++;if(oe&&YTe[1]-3)&&(he++,++Y!==J.length);)oe=K.featuresOnBorder[J[Y]];if(oe=K.featuresOnBorder[J[ge]],le.intersectsCount()>1||oe.intersectsCount()>1||he!==1){he!==1&&(Y=ge),h.encodeCentroid(void 0,le,!1),ie&&K.encodeCentroid(void 0,oe,!1);continue}const we=A[I](le,oe),ae=I%2?a.EXTENT-1:0;k.x=F(we[0],Math.min(a.EXTENT-1,we[1]),ae,I<2,we[2]),k.y=0,h.encodeCentroid(k,le,!1),ie&&K.encodeCentroid(k,oe,!1)}else h.encodeCentroid(void 0,le,!1)}h.borderDoneWithNeighborZ[I]=K.canonical.z,h.needsCentroidUpdate=!0,ie&&(K.borderDoneWithNeighborZ[L]=h.canonical.z,K.needsCentroidUpdate=!0)}else{for(const te of N)h.encodeCentroid(void 0,h.featuresOnBorder[te],!1);if(ie){for(const te of J)K.encodeCentroid(void 0,K.featuresOnBorder[te],!1);K.borderDoneWithNeighborZ[L]=h.canonical.z,K.needsCentroidUpdate=!0}h.borderDoneWithNeighborZ[I]=K.canonical.z,h.needsCentroidUpdate=!0}}(h.needsCentroidUpdate||!h.centroidVertexBuffer&&h.centroidVertexArray.length!==0)&&h.uploadCentroid(l)}const eo=new a.Color(1,0,0,1),Bh=new a.Color(0,1,0,1),Oh=new a.Color(0,0,1,1),Fh=new a.Color(1,0,1,1),Uh=new a.Color(0,1,1,1);function Vh(l,r,o){const h=l.context,d=l.transform,f=h.gl,g=d.projection.name==="globe",y=g?["PROJECTION_GLOBE_VIEW"]:null;let v=o.projMatrix;if(g&&a.globeToMercatorTransition(d.zoom)>0){const le=a.transitionTileAABBinECEF(o.canonical,d),Te=a.globeDenormalizeECEF(le);v=a.multiply(new Float32Array(16),d.globeMatrix,Te),a.multiply(v,d.projMatrix,v)}const E=l.useProgram("debug",null,y),T=r.getTileByID(o.key);l.terrain&&l.terrain.setupElevationDraw(T,E);const A=a.DepthMode.disabled,k=a.StencilMode.disabled,R=l.colorModeForRenderPass(),O="$debug";h.activeTexture.set(f.TEXTURE0),l.emptyTexture.bind(f.LINEAR,f.CLAMP_TO_EDGE),g?T._makeGlobeTileDebugBuffers(l.context,d):T._makeDebugTileBoundsBuffers(l.context,d.projection);const B=T._tileDebugBuffer||l.debugBuffer,F=T._tileDebugIndexBuffer||l.debugIndexBuffer,I=T._tileDebugSegments||l.debugSegments;E.draw(h,f.LINE_STRIP,A,k,R,a.CullFaceMode.disabled,Ds(v,a.Color.red),O,B,F,I,null,null,null,[T._globeTileDebugBorderBuffer]);const L=T.latestRawTileData,N=Math.floor((L&&L.byteLength||0)/1024),j=r.getTile(o).tileSize,K=512/Math.min(j,512)*(o.overscaledZ/d.zoom)*.5;let J=o.canonical.toString();o.overscaledZ!==o.canonical.z&&(J+=` => ${o.overscaledZ}`),J+=` ${N}kb`,function(le,Te){le.initDebugOverlayCanvas();const oe=le.debugOverlayCanvas,ge=le.context.gl,he=le.debugOverlayCanvas.getContext("2d");he.clearRect(0,0,oe.width,oe.height),he.shadowColor="white",he.shadowBlur=2,he.lineWidth=1.5,he.strokeStyle="white",he.textBaseline="top",he.font="bold 36px Open Sans, sans-serif",he.fillText(Te,5,5),he.strokeText(Te,5,5),le.debugOverlayTexture.update(oe),le.debugOverlayTexture.bind(ge.LINEAR,ge.CLAMP_TO_EDGE)}(l,J);const Y=T._tileDebugTextBuffer||l.debugBuffer,ie=T._tileDebugTextIndexBuffer||l.quadTriangleIndexBuffer,te=T._tileDebugTextSegments||l.debugSegments;E.draw(h,f.TRIANGLES,A,k,a.ColorMode.alphaBlended,a.CullFaceMode.disabled,Ds(v,a.Color.transparent,K),O,Y,ie,te,null,null,null,[T._globeTileDebugTextBuffer])}function vc(l,r,o,h){to(l,0,r+o/2,l.transform.width,o,h)}function Fs(l,r,o,h){to(l,r-o/2,0,o,l.transform.height,h)}function to(l,r,o,h,d,f){const g=l.context,y=g.gl;y.enable(y.SCISSOR_TEST),y.scissor(r*a.exported.devicePixelRatio,o*a.exported.devicePixelRatio,h*a.exported.devicePixelRatio,d*a.exported.devicePixelRatio),g.clear({color:f}),y.disable(y.SCISSOR_TEST)}const bc=a.createLayout([{name:"a_pos_3f",components:3,type:"Float32"}]),{members:wc}=bc;function kr(l,r,o,h){l.emplaceBack(r,o,h)}class Us{constructor(r){this.vertexArray=new a.StructArrayLayout3f12,this.indices=new a.StructArrayLayout3ui6,kr(this.vertexArray,-1,-1,1),kr(this.vertexArray,1,-1,1),kr(this.vertexArray,-1,1,1),kr(this.vertexArray,1,1,1),kr(this.vertexArray,-1,-1,-1),kr(this.vertexArray,1,-1,-1),kr(this.vertexArray,-1,1,-1),kr(this.vertexArray,1,1,-1),this.indices.emplaceBack(5,1,3),this.indices.emplaceBack(3,7,5),this.indices.emplaceBack(6,2,0),this.indices.emplaceBack(0,4,6),this.indices.emplaceBack(2,6,7),this.indices.emplaceBack(7,3,2),this.indices.emplaceBack(5,4,0),this.indices.emplaceBack(0,1,5),this.indices.emplaceBack(0,2,3),this.indices.emplaceBack(3,1,0),this.indices.emplaceBack(7,6,4),this.indices.emplaceBack(4,5,7),this.vertexBuffer=r.createVertexBuffer(this.vertexArray,wc),this.indexBuffer=r.createIndexBuffer(this.indices),this.segment=a.SegmentVector.simpleSegment(0,0,36,12)}}function Gi(l,r,o,h,d,f){const g=l.gl,y=r.paint.get("sky-atmosphere-color"),v=r.paint.get("sky-atmosphere-halo-color"),E=r.paint.get("sky-atmosphere-sun-intensity"),T=((A,k,R,O,B)=>({u_matrix_3f:A,u_sun_direction:k,u_sun_intensity:R,u_color_tint_r:[O.r,O.g,O.b,O.a],u_color_tint_m:[B.r,B.g,B.b,B.a],u_luminance:5e-5}))(a.fromMat4(a.create$1(),h),d,E,y,v);g.framebufferTexture2D(g.FRAMEBUFFER,g.COLOR_ATTACHMENT0,g.TEXTURE_CUBE_MAP_POSITIVE_X+f,r.skyboxTexture,0),o.draw(l,g.TRIANGLES,a.DepthMode.disabled,a.StencilMode.disabled,a.ColorMode.unblended,a.CullFaceMode.frontCW,T,"skyboxCapture",r.skyboxGeometry.vertexBuffer,r.skyboxGeometry.indexBuffer,r.skyboxGeometry.segment)}const Wo=a.createLayout([{type:"Float32",name:"a_pos",components:3},{type:"Float32",name:"a_uv",components:2}]);class Tc{constructor(r){const o=new a.StructArrayLayout5f20;o.emplaceBack(-1,1,1,0,0),o.emplaceBack(1,1,1,1,0),o.emplaceBack(1,-1,1,1,1),o.emplaceBack(-1,-1,1,0,1);const h=new a.StructArrayLayout3ui6;h.emplaceBack(0,1,2),h.emplaceBack(2,3,0),this.vertexBuffer=r.createVertexBuffer(o,Wo.members),this.indexBuffer=r.createIndexBuffer(h),this.segments=a.SegmentVector.simpleSegment(0,0,4,2)}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy()}}const Tn={symbol:function(l,r,o,h,d){if(l.renderPass!=="translucent")return;const f=a.StencilMode.disabled,g=l.colorModeForRenderPass();o.layout.get("text-variable-anchor")&&function(y,v,E,T,A,k,R){const O=v.transform,B=A==="map",F=k==="map";for(const I of y){const L=T.getTile(I),N=L.getBucket(E);if(!N||!N.text||!N.text.segments.get().length)continue;const j=a.evaluateSizeForZoom(N.textSizeData,O.zoom),K=Ot(I,N.getProjection(),O),J=O.calculatePixelsToTileUnitsMatrix(L),Y=fe(K,L.tileID.canonical,F,B,O,N.getProjection(),J),ie=E.layout.get("icon-text-fit")!=="none"&&N.hasIconData();if(j){const te=Math.pow(2,O.zoom-L.tileID.overscaledZ);Rh(N,B,F,R,a.symbolSize,O,Y,I,te,j,ie)}}}(h,l,o,r,o.layout.get("text-rotation-alignment"),o.layout.get("text-pitch-alignment"),d),o.paint.get("icon-opacity").constantOr(1)!==0&&gc(l,r,o,h,!1,o.paint.get("icon-translate"),o.paint.get("icon-translate-anchor"),o.layout.get("icon-rotation-alignment"),o.layout.get("icon-pitch-alignment"),o.layout.get("icon-keep-upright"),f,g),o.paint.get("text-opacity").constantOr(1)!==0&&gc(l,r,o,h,!0,o.paint.get("text-translate"),o.paint.get("text-translate-anchor"),o.layout.get("text-rotation-alignment"),o.layout.get("text-pitch-alignment"),o.layout.get("text-keep-upright"),f,g),r.map.showCollisionBoxes&&(Zo(l,r,o,h,o.paint.get("text-translate"),o.paint.get("text-translate-anchor"),!0),Zo(l,r,o,h,o.paint.get("icon-translate"),o.paint.get("icon-translate-anchor"),!1))},circle:function(l,r,o,h){if(l.renderPass!=="translucent")return;const d=o.paint.get("circle-opacity"),f=o.paint.get("circle-stroke-width"),g=o.paint.get("circle-stroke-opacity"),y=o.layout.get("circle-sort-key").constantOr(1)!==void 0;if(d.constantOr(1)===0&&(f.constantOr(1)===0||g.constantOr(1)===0))return;const v=l.context,E=v.gl,T=l.transform,A=l.depthModeForSublayer(0,a.DepthMode.ReadOnly),k=a.StencilMode.disabled,R=l.colorModeForRenderPass(),O=T.projection.name==="globe",B=[a.mercatorXfromLng(T.center.lng),a.mercatorYfromLat(T.center.lat)],F=[];for(let L=0;LL.sortKey-N.sortKey);const I={useDepthForOcclusion:!O};for(const L of F){const{programConfiguration:N,program:j,layoutVertexBuffer:K,globeExtVertexBuffer:J,indexBuffer:Y,uniformValues:ie,tile:te}=L.state,le=L.segments;l.terrain&&l.terrain.setupElevationDraw(te,j,I),l.prepareDrawProgram(v,j,te.tileID.toUnwrapped()),j.draw(v,E.TRIANGLES,A,k,R,a.CullFaceMode.disabled,ie,o.id,K,Y,le,o.paint,T.zoom,N,[J])}},heatmap:function(l,r,o,h){if(o.paint.get("heatmap-opacity")!==0)if(l.renderPass==="offscreen"){const d=l.context,f=d.gl,g=a.StencilMode.disabled,y=new a.ColorMode([f.ONE,f.ONE],a.Color.transparent,[!0,!0,!0,!0]);(function(R,O,B,F){const I=R.gl,L=O.width*F,N=O.height*F;R.activeTexture.set(I.TEXTURE1),R.viewport.set([0,0,L,N]);let j=B.heatmapFbo;if(!j||j&&(j.width!==L||j.height!==N)){j&&j.destroy();const K=I.createTexture();I.bindTexture(I.TEXTURE_2D,K),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_WRAP_S,I.CLAMP_TO_EDGE),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_WRAP_T,I.CLAMP_TO_EDGE),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_MIN_FILTER,I.LINEAR),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_MAG_FILTER,I.LINEAR),j=B.heatmapFbo=R.createFramebuffer(L,N,!1),function(J,Y,ie,te,le,Te){const oe=J.gl;oe.texImage2D(oe.TEXTURE_2D,0,J.isWebGL2&&J.extRenderToTextureHalfFloat?oe.RGBA16F:oe.RGBA,le,Te,0,oe.RGBA,J.extRenderToTextureHalfFloat?J.isWebGL2?oe.HALF_FLOAT:J.extTextureHalfFloat.HALF_FLOAT_OES:oe.UNSIGNED_BYTE,null),te.colorAttachment.set(ie)}(R,0,K,j,L,N)}else I.bindTexture(I.TEXTURE_2D,j.colorAttachment.get()),R.bindFramebuffer.set(j.framebuffer)})(d,l,o,l.transform.projection.name==="globe"?.5:.25),d.clear({color:a.Color.transparent});const v=l.transform,E=v.projection.name==="globe",T=E?["PROJECTION_GLOBE_VIEW"]:null,A=E?a.CullFaceMode.frontCCW:a.CullFaceMode.disabled,k=[a.mercatorXfromLng(v.center.lng),a.mercatorYfromLat(v.center.lat)];for(let R=0;R({u_image:0,u_color_ramp:1,u_opacity:A.paint.get("heatmap-opacity")}))(0,f),f.id,d.viewportBuffer,d.quadTriangleIndexBuffer,d.viewportSegments,f.paint,d.transform.zoom)}(l,o))},line:function(l,r,o,h){if(l.renderPass!=="translucent")return;const d=o.paint.get("line-opacity"),f=o.paint.get("line-width");if(d.constantOr(1)===0||f.constantOr(1)===0)return;const g=l.depthModeForSublayer(0,a.DepthMode.ReadOnly),y=l.colorModeForRenderPass(),v=l.terrain&&l.terrain.renderingToTexture?1:a.exported.devicePixelRatio,E=o.paint.get("line-dasharray"),T=E.constantOr(1),A=o.layout.get("line-cap"),k=o.paint.get("line-pattern"),R=k.constantOr(1),O=o.paint.get("line-gradient"),B=R?"linePattern":"line",F=l.context,I=F.gl,L=(j=>{const K=[];$o(j)&&K.push("RENDER_LINE_DASH"),j.paint.get("line-gradient")&&K.push("RENDER_LINE_GRADIENT");const J=j.paint.get("line-trim-offset");J[0]===0&&J[1]===0||K.push("RENDER_LINE_TRIM_OFFSET");const Y=j.paint.get("line-pattern").constantOr(1),ie=j.paint.get("line-opacity").constantOr(1)!==1;return!Y&&ie&&K.push("RENDER_LINE_ALPHA_DISCARD"),K})(o);let N=L.includes("RENDER_LINE_ALPHA_DISCARD");l.terrain&&l.terrain.clipOrMaskOverlapStencilType()&&(N=!1);for(const j of h){const K=r.getTile(j);if(R&&!K.patternsLoaded())continue;const J=K.getBucket(o);if(!J)continue;l.prepareDrawTile();const Y=J.programConfigurations.get(o.id),ie=l.useProgram(B,Y,L),te=k.constantOr(null);if(te&&K.imageAtlas){const _e=K.imageAtlas.patternPositions[te.toString()];_e&&Y.setConstantPatternPositions(_e)}const le=E.constantOr(null),Te=A.constantOr(null);if(!R&&le&&Te&&K.lineAtlas){const _e=K.lineAtlas.getDash(le,Te);_e&&Y.setConstantPatternPositions(_e)}let[oe,ge]=o.paint.get("line-trim-offset");(Te==="round"||Te==="square")&&oe!==ge&&(oe===0&&(oe-=1),ge===1&&(ge+=1));const he=l.terrain?j.projMatrix:null,we=R?Go(l,K,o,he,v):Dh(l,K,o,he,J.lineClipsArray.length,v,[oe,ge]);if(O){const _e=J.gradients[o.id];let Me=_e.texture;if(o.gradientVersion!==_e.version){let ve=256;if(o.stepInterpolant){const Ae=r.getSource().maxzoom,Ge=j.canonical.z===Ae?Math.ceil(1<{ie.draw(F,I.TRIANGLES,g,_e,y,a.CullFaceMode.disabled,we,o.id,J.layoutVertexBuffer,J.indexBuffer,J.segments,o.paint,l.transform.zoom,Y,[J.layoutVertexBuffer2])};if(N){const _e=l.stencilModeForClipping(j).ref;_e===0&&l.terrain&&F.clear({stencil:0});const Me={func:I.EQUAL,mask:255};we.u_alpha_discard_threshold=.8,ae(new a.StencilMode(Me,_e,255,I.KEEP,I.KEEP,I.INVERT)),we.u_alpha_discard_threshold=0,ae(new a.StencilMode(Me,_e,255,I.KEEP,I.KEEP,I.KEEP))}else ae(l.stencilModeForClipping(j))}N&&(l.resetStencilClippingMasks(),l.terrain&&F.clear({stencil:0}))},fill:function(l,r,o,h){const d=o.paint.get("fill-color"),f=o.paint.get("fill-opacity");if(f.constantOr(1)===0)return;const g=l.colorModeForRenderPass(),y=o.paint.get("fill-pattern"),v=l.opaquePassEnabledForLayer()&&!y.constantOr(1)&&d.constantOr(a.Color.transparent).a===1&&f.constantOr(0)===1?"opaque":"translucent";if(l.renderPass===v){const E=l.depthModeForSublayer(1,l.renderPass==="opaque"?a.DepthMode.ReadWrite:a.DepthMode.ReadOnly);yc(l,r,o,h,E,g,!1)}if(l.renderPass==="translucent"&&o.paint.get("fill-antialias")){const E=l.depthModeForSublayer(o.getPaintProperty("fill-outline-color")?2:0,a.DepthMode.ReadOnly);yc(l,r,o,h,E,g,!0)}},"fill-extrusion":function(l,r,o,h){const d=o.paint.get("fill-extrusion-opacity");if(d!==0&&l.renderPass==="translucent"){const f=new a.DepthMode(l.context.gl.LEQUAL,a.DepthMode.ReadWrite,l.depthRangeFor3D);if(d!==1||o.paint.get("fill-extrusion-pattern").constantOr(1))Os(l,r,o,h,f,a.StencilMode.disabled,a.ColorMode.disabled),Os(l,r,o,h,f,l.stencilModeFor3D(),l.colorModeForRenderPass()),l.resetStencilClippingMasks();else{const g=l.colorModeForRenderPass();Os(l,r,o,h,f,a.StencilMode.disabled,g)}}},hillshade:function(l,r,o,h){if(l.renderPass!=="offscreen"&&l.renderPass!=="translucent")return;const d=l.context,f=l.depthModeForSublayer(0,a.DepthMode.ReadOnly),g=l.colorModeForRenderPass(),y=l.terrain&&l.terrain.renderingToTexture,[v,E]=l.renderPass!=="translucent"||y?[{},h]:l.stencilConfigForOverlap(h);for(const T of E){const A=r.getTile(T);if(A.needsHillshadePrepare&&l.renderPass==="offscreen")cc(l,A,o,f,a.StencilMode.disabled,g);else if(l.renderPass==="translucent"){const k=y&&l.terrain?l.terrain.stencilModeForRTTOverlap(T):v[T.overscaledZ];lc(l,T,A,o,f,k,g)}}d.viewport.set([0,0,l.width,l.height]),l.resetStencilClippingMasks()},raster:function(l,r,o,h,d,f){if(l.renderPass!=="translucent"||o.paint.get("raster-opacity")===0||!h.length)return;const g=l.context,y=g.gl,v=r.getSource(),E=l.useProgram("raster"),T=l.colorModeForRenderPass(),A=l.terrain&&l.terrain.renderingToTexture,[k,R]=v instanceof rt||A?[{},h]:l.stencilConfigForOverlap(h),O=R[R.length-1].overscaledZ,B=!l.options.moving;for(const F of R){const I=A?a.DepthMode.disabled:l.depthModeForSublayer(F.overscaledZ-O,o.paint.get("raster-opacity")===1?a.DepthMode.ReadWrite:a.DepthMode.ReadOnly,y.LESS),L=F.toUnwrapped(),N=r.getTile(F);if(A&&(!N||!N.hasData()))continue;const j=A?F.projMatrix:l.transform.calculateProjMatrix(L,B),K=l.terrain&&A?l.terrain.stencilModeForRTTOverlap(F):k[F.overscaledZ],J=f?0:o.paint.get("raster-fade-duration");N.registerFadeDuration(J);const Y=r.findLoadedParent(F,0),ie=ja(N,Y,r,l.transform,J);let te,le;l.terrain&&l.terrain.prepareDrawTile();const Te=o.paint.get("raster-resampling")==="nearest"?y.NEAREST:y.LINEAR;g.activeTexture.set(y.TEXTURE0),N.texture.bind(Te,y.CLAMP_TO_EDGE),g.activeTexture.set(y.TEXTURE1),Y?(Y.texture.bind(Te,y.CLAMP_TO_EDGE),te=Math.pow(2,Y.tileID.overscaledZ-N.tileID.overscaledZ),le=[N.tileID.canonical.x*te%1,N.tileID.canonical.y*te%1]):N.texture.bind(Te,y.CLAMP_TO_EDGE),N.texture.useMipmap&&g.extTextureFilterAnisotropic&&l.transform.pitch>20&&y.texParameterf(y.TEXTURE_2D,g.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,g.extTextureFilterAnisotropicMax);const oe=Ya(j,le||[0,0],te||1,ie,o,v instanceof rt?v.perspectiveTransform:[0,0]);if(l.prepareDrawProgram(g,E,L),v instanceof rt)v.boundsBuffer&&v.boundsSegments&&E.draw(g,y.TRIANGLES,I,a.StencilMode.disabled,T,a.CullFaceMode.disabled,oe,o.id,v.boundsBuffer,l.quadTriangleIndexBuffer,v.boundsSegments);else{const{tileBoundsBuffer:ge,tileBoundsIndexBuffer:he,tileBoundsSegments:we}=l.getTileBoundsBuffers(N);E.draw(g,y.TRIANGLES,I,K,T,a.CullFaceMode.disabled,oe,o.id,ge,he,we)}}l.resetStencilClippingMasks()},background:function(l,r,o,h){const d=o.paint.get("background-color"),f=o.paint.get("background-opacity");if(f===0)return;const g=l.context,y=g.gl,v=l.transform,E=v.tileSize,T=o.paint.get("background-pattern");if(l.isPatternMissing(T))return;const A=!T&&d.a===1&&f===1&&l.opaquePassEnabledForLayer()?"opaque":"translucent";if(l.renderPass!==A)return;const k=a.StencilMode.disabled,R=l.depthModeForSublayer(0,A==="opaque"?a.DepthMode.ReadWrite:a.DepthMode.ReadOnly),O=l.colorModeForRenderPass(),B=l.useProgram(T?"backgroundPattern":"background");let F,I=h;I||(F=l.getBackgroundTiles(),I=Object.values(F).map(L=>L.tileID)),T&&(g.activeTexture.set(y.TEXTURE0),l.imageManager.bind(l.context));for(const L of I){const N=L.toUnwrapped(),j=h?L.projMatrix:l.transform.calculateProjMatrix(N);l.prepareDrawTile();const K=r?r.getTile(L):F?F[L.key]:new a.Tile(L,E,v.zoom,l),J=T?Lh(j,f,l,T,{tileID:L,tileSize:E}):Qa(j,f,d);l.prepareDrawProgram(g,B,N);const{tileBoundsBuffer:Y,tileBoundsIndexBuffer:ie,tileBoundsSegments:te}=l.getTileBoundsBuffers(K);B.draw(g,y.TRIANGLES,R,k,O,a.CullFaceMode.disabled,J,o.id,Y,ie,te)}},sky:function(l,r,o){const h=l.transform,d=h.projection.name==="mercator"||h.projection.name==="globe"?1:a.smoothstep(7,8,h.zoom),f=o.paint.get("sky-opacity")*d;if(f===0)return;const g=l.context,y=o.paint.get("sky-type"),v=new a.DepthMode(g.gl.LEQUAL,a.DepthMode.ReadOnly,[0,1]),E=l.frameCounter/1e3%1;y==="atmosphere"?l.renderPass==="offscreen"?o.needsSkyboxCapture(l)&&(function(T,A,k,R){const O=T.context,B=O.gl;let F=A.skyboxFbo;if(!F){F=A.skyboxFbo=O.createFramebuffer(32,32,!1),A.skyboxGeometry=new Us(O),A.skyboxTexture=O.gl.createTexture(),B.bindTexture(B.TEXTURE_CUBE_MAP,A.skyboxTexture),B.texParameteri(B.TEXTURE_CUBE_MAP,B.TEXTURE_WRAP_S,B.CLAMP_TO_EDGE),B.texParameteri(B.TEXTURE_CUBE_MAP,B.TEXTURE_WRAP_T,B.CLAMP_TO_EDGE),B.texParameteri(B.TEXTURE_CUBE_MAP,B.TEXTURE_MIN_FILTER,B.LINEAR),B.texParameteri(B.TEXTURE_CUBE_MAP,B.TEXTURE_MAG_FILTER,B.LINEAR);for(let j=0;j<6;++j)B.texImage2D(B.TEXTURE_CUBE_MAP_POSITIVE_X+j,0,B.RGBA,32,32,0,B.RGBA,B.UNSIGNED_BYTE,null)}O.bindFramebuffer.set(F.framebuffer),O.viewport.set([0,0,32,32]);const I=A.getCenter(T,!0),L=T.useProgram("skyboxCapture"),N=new Float64Array(16);a.identity(N),a.rotateY(N,N,.5*-Math.PI),Gi(O,A,L,N,I,0),a.identity(N),a.rotateY(N,N,.5*Math.PI),Gi(O,A,L,N,I,1),a.identity(N),a.rotateX(N,N,.5*-Math.PI),Gi(O,A,L,N,I,2),a.identity(N),a.rotateX(N,N,.5*Math.PI),Gi(O,A,L,N,I,3),a.identity(N),Gi(O,A,L,N,I,4),a.identity(N),a.rotateY(N,N,Math.PI),Gi(O,A,L,N,I,5),O.viewport.set([0,0,T.width,T.height])}(l,o),o.markSkyboxValid(l)):l.renderPass==="sky"&&function(T,A,k,R,O){const B=T.context,F=B.gl,I=T.transform,L=T.useProgram("skybox");B.activeTexture.set(F.TEXTURE0),F.bindTexture(F.TEXTURE_CUBE_MAP,A.skyboxTexture);const N=((j,K,J,Y,ie)=>({u_matrix:j,u_sun_direction:K,u_cubemap:0,u_opacity:Y,u_temporal_offset:ie}))(I.skyboxMatrix,A.getCenter(T,!1),0,R,O);T.prepareDrawProgram(B,L),L.draw(B,F.TRIANGLES,k,a.StencilMode.disabled,T.colorModeForRenderPass(),a.CullFaceMode.backCW,N,"skybox",A.skyboxGeometry.vertexBuffer,A.skyboxGeometry.indexBuffer,A.skyboxGeometry.segment)}(l,o,v,f,E):y==="gradient"&&l.renderPass==="sky"&&function(T,A,k,R,O){const B=T.context,F=B.gl,I=T.transform,L=T.useProgram("skyboxGradient");A.skyboxGeometry||(A.skyboxGeometry=new Us(B)),B.activeTexture.set(F.TEXTURE0);let N=A.colorRampTexture;N||(N=A.colorRampTexture=new a.Texture(B,A.colorRamp,F.RGBA)),N.bind(F.LINEAR,F.CLAMP_TO_EDGE);const j=((K,J,Y,ie,te)=>({u_matrix:K,u_color_ramp:0,u_center_direction:J,u_radius:a.degToRad(Y),u_opacity:ie,u_temporal_offset:te}))(I.skyboxMatrix,A.getCenter(T,!1),A.paint.get("sky-gradient-radius"),R,O);T.prepareDrawProgram(B,L),L.draw(B,F.TRIANGLES,k,a.StencilMode.disabled,T.colorModeForRenderPass(),a.CullFaceMode.backCW,j,"skyboxGradient",A.skyboxGeometry.vertexBuffer,A.skyboxGeometry.indexBuffer,A.skyboxGeometry.segment)}(l,o,v,f,E)},debug:function(l,r,o){for(let h=0;hd)return void(this.transform.fogCullDistSq=null);const f=h+.78*(d-h);this.transform.fogCullDistSq=f*f}get terrain(){return this.transform._terrainEnabled()&&this._terrain&&this._terrain.enabled?this._terrain:null}resize(r,o){if(this.width=r*a.exported.devicePixelRatio,this.height=o*a.exported.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const h of this.style.order)this.style._layers[h].resize()}setup(){const r=this.context,o=new a.StructArrayLayout2i4;o.emplaceBack(0,0),o.emplaceBack(a.EXTENT,0),o.emplaceBack(0,a.EXTENT),o.emplaceBack(a.EXTENT,a.EXTENT),this.tileExtentBuffer=r.createVertexBuffer(o,a.posAttributes.members),this.tileExtentSegments=a.SegmentVector.simpleSegment(0,0,4,2);const h=new a.StructArrayLayout2i4;h.emplaceBack(0,0),h.emplaceBack(a.EXTENT,0),h.emplaceBack(0,a.EXTENT),h.emplaceBack(a.EXTENT,a.EXTENT),this.debugBuffer=r.createVertexBuffer(h,a.posAttributes.members),this.debugSegments=a.SegmentVector.simpleSegment(0,0,4,5);const d=new a.StructArrayLayout2i4;d.emplaceBack(-1,-1),d.emplaceBack(1,-1),d.emplaceBack(-1,1),d.emplaceBack(1,1),this.viewportBuffer=r.createVertexBuffer(d,a.posAttributes.members),this.viewportSegments=a.SegmentVector.simpleSegment(0,0,4,2);const f=new a.StructArrayLayout4i8;f.emplaceBack(0,0,0,0),f.emplaceBack(a.EXTENT,0,a.EXTENT,0),f.emplaceBack(0,a.EXTENT,0,a.EXTENT),f.emplaceBack(a.EXTENT,a.EXTENT,a.EXTENT,a.EXTENT),this.mercatorBoundsBuffer=r.createVertexBuffer(f,a.boundsAttributes.members),this.mercatorBoundsSegments=a.SegmentVector.simpleSegment(0,0,4,2);const g=new a.StructArrayLayout3ui6;g.emplaceBack(0,1,2),g.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=r.createIndexBuffer(g);const y=new a.StructArrayLayout1ui2;for(const E of[0,1,3,2,0])y.emplaceBack(E);this.debugIndexBuffer=r.createIndexBuffer(y),this.emptyTexture=new a.Texture(r,new a.RGBAImage({width:1,height:1},Uint8Array.of(0,0,0,0)),r.gl.RGBA),this.identityMat=a.create();const v=this.context.gl;this.stencilClearMode=new a.StencilMode({func:v.ALWAYS,mask:0},0,255,v.ZERO,v.ZERO,v.ZERO),this.loadTimeStamps.push(a.window.performance.now()),this.atmosphereBuffer=new Tc(this.context)}getMercatorTileBoundsBuffers(){return{tileBoundsBuffer:this.mercatorBoundsBuffer,tileBoundsIndexBuffer:this.quadTriangleIndexBuffer,tileBoundsSegments:this.mercatorBoundsSegments}}getTileBoundsBuffers(r){return r._makeTileBoundsBuffers(this.context,this.transform.projection),r._tileBoundsBuffer?{tileBoundsBuffer:r._tileBoundsBuffer,tileBoundsIndexBuffer:r._tileBoundsIndexBuffer,tileBoundsSegments:r._tileBoundsSegments}:this.getMercatorTileBoundsBuffers()}clearStencil(){const r=this.context,o=r.gl;this.nextStencilID=1,this.currentStencilSource=void 0,this._tileClippingMaskIDs={},this.useProgram("clippingMask").draw(r,o.TRIANGLES,a.DepthMode.disabled,this.stencilClearMode,a.ColorMode.disabled,a.CullFaceMode.disabled,No(this.identityMat),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}resetStencilClippingMasks(){this.terrain||(this.currentStencilSource=void 0,this._tileClippingMaskIDs={})}_renderTileClippingMasks(r,o,h){if(!o||this.currentStencilSource===o.id||!r.isTileClipped()||!h||h.length===0)return;if(this._tileClippingMaskIDs&&!this.terrain){let y=!1;for(const v of h)if(this._tileClippingMaskIDs[v.key]===void 0){y=!0;break}if(!y)return}this.currentStencilSource=o.id;const d=this.context,f=d.gl;this.nextStencilID+h.length>256&&this.clearStencil(),d.setColorMode(a.ColorMode.disabled),d.setDepthMode(a.DepthMode.disabled);const g=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const y of h){const v=o.getTile(y),E=this._tileClippingMaskIDs[y.key]=this.nextStencilID++,{tileBoundsBuffer:T,tileBoundsIndexBuffer:A,tileBoundsSegments:k}=this.getTileBoundsBuffers(v);g.draw(d,f.TRIANGLES,a.DepthMode.disabled,new a.StencilMode({func:f.ALWAYS,mask:0},E,255,f.KEEP,f.KEEP,f.REPLACE),a.ColorMode.disabled,a.CullFaceMode.disabled,No(y.projMatrix),"$clipping",T,A,k)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const r=this.nextStencilID++,o=this.context.gl;return new a.StencilMode({func:o.NOTEQUAL,mask:255},r,255,o.KEEP,o.KEEP,o.REPLACE)}stencilModeForClipping(r){if(this.terrain)return this.terrain.stencilModeForRTTOverlap(r);const o=this.context.gl;return new a.StencilMode({func:o.EQUAL,mask:255},this._tileClippingMaskIDs[r.key],0,o.KEEP,o.KEEP,o.REPLACE)}stencilConfigForOverlap(r){const o=this.context.gl,h=r.sort((g,y)=>y.overscaledZ-g.overscaledZ),d=h[h.length-1].overscaledZ,f=h[0].overscaledZ-d+1;if(f>1){this.currentStencilSource=void 0,this.nextStencilID+f>256&&this.clearStencil();const g={};for(let y=0;y=0;this.currentLayer--){const E=this.style._layers[h[this.currentLayer]],T=r._getLayerSourceCache(E);if(E.isSky())continue;const A=T?g[T.id]:void 0;this._renderTileClippingMasks(E,T,A),this.renderLayer(this,T,E,A)}if(this.style.fog&&this.transform.projection.supportsFog&&function(E,T){const A=E.context,k=A.gl,R=E.transform,O=new a.DepthMode(k.LEQUAL,a.DepthMode.ReadOnly,[0,1]),B=E.useProgram("globeAtmosphere",null,R.projection.name==="globe"?["PROJECTION_GLOBE_VIEW","FOG"]:["FOG"]),F=a.globeToMercatorTransition(R.zoom),I=T.properties.get("color").toArray01(),L=T.properties.get("high-color").toArray01(),N=T.properties.get("space-color").toArray01PremultipliedAlpha(),j=a.identity$1([]);a.rotateY$1(j,j,-a.degToRad(R._center.lng)),a.rotateX$1(j,j,a.degToRad(R._center.lat)),a.rotateZ$1(j,j,R.angle),a.rotateX$1(j,j,-R._pitch);const K=a.fromQuat(new Float32Array(16),j),J=a.mapValue(T.properties.get("star-intensity"),0,1,0,.25),Y=5e-4,ie=a.mapValue(T.properties.get("horizon-blend"),0,1,Y,.25),te=a.globeUseCustomAntiAliasing(E,A,R)&&ie===Y?R.worldSize/(2*Math.PI*1.025)-1:R.globeRadius,le=E.frameCounter/1e3%1,Te=a.length(R.globeCenterInViewSpace),oe=Math.sqrt(Math.pow(Te,2)-Math.pow(te,2)),ge=Math.acos(oe/Te),he=((ae,_e,Me,ve,Ae,Ge,Xe,Ve,qe,lt,ot,je,wt,Tt)=>({u_frustum_tl:ae,u_frustum_tr:_e,u_frustum_br:Me,u_frustum_bl:ve,u_horizon:Ae,u_transition:Ge,u_fadeout_range:Xe,u_color:Ve,u_high_color:qe,u_space_color:lt,u_star_intensity:ot,u_star_size:5*a.exported.devicePixelRatio,u_star_density:0,u_temporal_offset:je,u_horizon_angle:wt,u_rotation_matrix:Tt}))(R.frustumCorners.TL,R.frustumCorners.TR,R.frustumCorners.BR,R.frustumCorners.BL,R.frustumCorners.horizon,F,ie,I,L,N,J,le,ge,K);E.prepareDrawProgram(A,B);const we=E.atmosphereBuffer;we&&B.draw(A,k.TRIANGLES,O,a.StencilMode.disabled,a.ColorMode.alphaBlended,a.CullFaceMode.backCW,he,"skybox",we.vertexBuffer,we.indexBuffer,we.segments)}(this,this.style.fog),this.renderPass="sky",(a.globeToMercatorTransition(this.transform.zoom)>0||this.transform.projection.name!=="globe")&&this.transform.isHorizonVisible())for(this.currentLayer=0;this.currentLayer{const A=r._getLayerSourceCache(T);A&&!T.isHidden(this.transform.zoom)&&(!E||E.getSource().maxzoom0?o.pop():null}isPatternMissing(r){return r===null||r!==void 0&&!this.imageManager.getPattern(r.toString())}terrainRenderModeElevated(){return this.style&&!!this.style.getTerrain()&&!!this.terrain&&!this.terrain.renderingToTexture}currentGlobalDefines(){const r=this.terrain&&this.terrain.renderingToTexture,o=this.terrain&&this.terrain.exaggeration()===0,h=this.style&&this.style.fog,d=[];return this.terrainRenderModeElevated()&&d.push("TERRAIN"),this.transform.projection.name==="globe"&&d.push("GLOBE"),o&&d.push("ZERO_EXAGGERATION"),h&&!r&&h.getOpacity(this.transform.pitch)!==0&&d.push("FOG"),r&&d.push("RENDER_TO_TEXTURE"),this._showOverdrawInspector&&d.push("OVERDRAW_INSPECTOR"),d}useProgram(r,o,h){this.cache=this.cache||{};const d=h||[],f=this.currentGlobalDefines().concat(d),g=mt.cacheKey(Fa[r],r,f,o);return this.cache[g]||(this.cache[g]=new mt(this.context,r,Fa[r],o,el[r],f)),this.cache[g]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.frontFace.setDefault(),this.context.cullFaceSide.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const r=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(r.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=a.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new a.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this._terrain&&this._terrain.destroy(),this.globeSharedBuffers&&this.globeSharedBuffers.destroy(),this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.atmosphereBuffer&&this.atmosphereBuffer.destroy()}prepareDrawTile(){this.terrain&&this.terrain.prepareDrawTile()}prepareDrawProgram(r,o,h){if(this.terrain&&this.terrain.renderingToTexture)return;const d=this.style.fog;if(d){const f=d.getOpacity(this.transform.pitch),g=((y,v,E,T,A,k,R,O,B,F,I)=>{const L=y.transform,N=v.properties.get("color").toArray01();N[3]=T;const j=y.frameCounter/1e3%1;return{u_fog_matrix:E?L.calculateFogTileMatrix(E):y.identityMat,u_fog_range:v.getFovAdjustedRange(L._fov),u_fog_color:N,u_fog_horizon_blend:v.properties.get("horizon-blend"),u_fog_temporal_offset:j,u_frustum_tl:A,u_frustum_tr:k,u_frustum_br:R,u_frustum_bl:O,u_globe_pos:B,u_globe_radius:F,u_viewport:I,u_globe_transition:a.globeToMercatorTransition(L.zoom),u_is_globe:+(L.projection.name==="globe")}})(this,d,h,f,this.transform.frustumCorners.TL,this.transform.frustumCorners.TR,this.transform.frustumCorners.BR,this.transform.frustumCorners.BL,this.transform.globeCenterInViewSpace,this.transform.globeRadius,[this.transform.width*a.exported.devicePixelRatio,this.transform.height*a.exported.devicePixelRatio]);o.setFogUniformValues(r,g)}}setTileLoadedFlag(r){this.tileLoaded=r}saveCanvasCopy(){const r=this.canvasCopy();r&&(this.frameCopies.push(r),this.tileLoaded=!1)}canvasCopy(){const r=this.context.gl,o=r.createTexture();return r.bindTexture(r.TEXTURE_2D,o),r.copyTexImage2D(r.TEXTURE_2D,0,r.RGBA,0,0,r.drawingBufferWidth,r.drawingBufferHeight,0),o}getCanvasCopiesAndTimestamps(){return{canvasCopies:this.frameCopies,timeStamps:this.loadTimeStamps}}averageElevationNeedsEasing(){if(!this.transform._elevation)return!1;const r=this.style&&this.style.fog;return!!r&&r.getOpacity(this.transform.pitch)!==0}getBackgroundTiles(){const r=this._backgroundTiles,o=this._backgroundTiles={},h=this.transform.coveringTiles({tileSize:512});for(const d of h)o[d.key]=r[d.key]||new a.Tile(d,512,this.transform.tileZoom,this);return o}clearBackgroundTiles(){this._backgroundTiles={}}}class Vs{constructor(r=0,o=0,h=0,d=0){if(isNaN(r)||r<0||isNaN(o)||o<0||isNaN(h)||h<0||isNaN(d)||d<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=r,this.bottom=o,this.left=h,this.right=d}interpolate(r,o,h){return o.top!=null&&r.top!=null&&(this.top=a.number(r.top,o.top,h)),o.bottom!=null&&r.bottom!=null&&(this.bottom=a.number(r.bottom,o.bottom,h)),o.left!=null&&r.left!=null&&(this.left=a.number(r.left,o.left,h)),o.right!=null&&r.right!=null&&(this.right=a.number(r.right,o.right,h)),this}getCenter(r,o){const h=a.clamp((this.left+r-this.right)/2,0,r),d=a.clamp((this.top+o-this.bottom)/2,0,o);return new a.Point(h,d)}equals(r){return this.top===r.top&&this.bottom===r.bottom&&this.left===r.left&&this.right===r.right}clone(){return new Vs(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function Ns(l,r){const o=a.getColumn(l,3);a.fromQuat(l,r),a.setColumn(l,3,o)}function _t(l,r){const o=a.identity$1([]);return a.rotateZ$1(o,o,-r),a.rotateX$1(o,o,-l),o}function Xo(l,r){const o=[l[0],l[1],0],h=[r[0],r[1],0];if(a.length(o)>=1e-15){const g=a.normalize([],o);a.scale$2(h,g,a.dot(h,g)),r[0]=h[0],r[1]=h[1]}const d=a.cross([],r,l);if(a.len(d)<1e-15)return null;const f=Math.atan2(-d[1],d[0]);return _t(Math.atan2(Math.sqrt(l[0]*l[0]+l[1]*l[1]),-l[2]),f)}class Ec{constructor(r,o){this.position=r,this.orientation=o}get position(){return this._position}set position(r){if(r){const o=r instanceof a.MercatorCoordinate?r:new a.MercatorCoordinate(r[0],r[1],r[2]);this._renderWorldCopies&&(o.x=a.wrap(o.x,0,1)),this._position=o}else this._position=null}lookAtPoint(r,o){if(this.orientation=null,!this.position)return;const h=this.position,d=this._elevation?this._elevation.getAtPointOrZero(a.MercatorCoordinate.fromLngLat(r)):0,f=a.MercatorCoordinate.fromLngLat(r,d),g=[f.x-h.x,f.y-h.y,f.z-h.z];o||(o=[0,0,1]),o[2]=Math.abs(o[2]),this.orientation=Xo(g,o)}setPitchBearing(r,o){this.orientation=_t(a.degToRad(r),a.degToRad(-o))}}class js{constructor(r,o){this._transform=a.identity([]),this.orientation=o,this.position=r}get mercatorPosition(){const r=this.position;return new a.MercatorCoordinate(r[0],r[1],r[2])}get position(){const r=a.getColumn(this._transform,3);return[r[0],r[1],r[2]]}set position(r){var o;r&&a.setColumn(this._transform,3,[(o=r)[0],o[1],o[2],1])}get orientation(){return this._orientation}set orientation(r){this._orientation=r||a.identity$1([]),r&&Ns(this._transform,this._orientation)}getPitchBearing(){const r=this.forward(),o=this.right();return{bearing:Math.atan2(-o[1],o[0]),pitch:Math.atan2(Math.sqrt(r[0]*r[0]+r[1]*r[1]),-r[2])}}setPitchBearing(r,o){this._orientation=_t(r,o),Ns(this._transform,this._orientation)}forward(){const r=a.getColumn(this._transform,2);return[-r[0],-r[1],-r[2]]}up(){const r=a.getColumn(this._transform,1);return[-r[0],-r[1],-r[2]]}right(){const r=a.getColumn(this._transform,0);return[r[0],r[1],r[2]]}getCameraToWorld(r,o){const h=new Float64Array(16);return a.invert(h,this.getWorldToCamera(r,o)),h}getWorldToCameraPosition(r,o,h){const d=this.position;a.scale$2(d,d,-r);const f=new Float64Array(16);return a.fromScaling(f,[h,h,h]),a.translate(f,f,d),f[10]*=o,f}getWorldToCamera(r,o){const h=new Float64Array(16),d=new Float64Array(4),f=this.position;return a.conjugate(d,this._orientation),a.scale$2(f,f,-r),a.fromQuat(h,d),a.translate(h,h,f),h[1]*=-1,h[5]*=-1,h[9]*=-1,h[13]*=-1,h[8]*=o,h[9]*=o,h[10]*=o,h[11]*=o,h}getCameraToClipPerspective(r,o,h,d){const f=new Float64Array(16);return a.perspective(f,r,o,h,d),f}getDistanceToElevation(r,o=!1){const h=r===0?0:a.mercatorZfromAltitude(r,o?a.latFromMercatorY(this.position[1]):this.position[1]),d=this.forward();return(h-this.position[2])/d[2]}clone(){return new js([...this.position],[...this.orientation])}}function ro(l,r){const o=Gs(l.projection,l.zoom,l.width,l.height),h=function(f,g,y,v,E){const T=new a.LngLat(y.lng-180*Dr,y.lat),A=new a.LngLat(y.lng+180*Dr,y.lat),k=f.project(T.lng,T.lat),R=f.project(A.lng,A.lat),O=-Math.atan2(R.y-k.y,R.x-k.x),B=a.MercatorCoordinate.fromLngLat(y);B.y=a.clamp(B.y,-1+Dr,1-Dr);const F=B.toLngLat(),I=f.project(F.lng,F.lat),L=a.MercatorCoordinate.fromLngLat(F);L.x+=Dr;const N=L.toLngLat(),j=f.project(N.lng,N.lat),K=$s(j.x-I.x,j.y-I.y,O),J=a.MercatorCoordinate.fromLngLat(F);J.y+=Dr;const Y=J.toLngLat(),ie=f.project(Y.lng,Y.lat),te=$s(ie.x-I.x,ie.y-I.y,O),le=Math.abs(K.x)/Math.abs(te.y),Te=a.identity([]);a.rotateZ(Te,Te,-O*(1-(E?0:v)));const oe=a.identity([]);return a.scale(oe,oe,[1,1-(1-le)*v,1]),oe[4]=-te.x/te.y*v,a.rotateZ(oe,oe,O),a.multiply(oe,Te,oe),oe}(l.projection,0,l.center,o,r),d=Sc(l);return a.scale(h,h,[d,d,1]),h}function Sc(l){const r=l.projection,o=Gs(l.projection,l.zoom,l.width,l.height),h=Mc(r,l.center),d=Mc(r,a.LngLat.convert(r.center));return Math.pow(2,h*o+(1-o)*d)}function Gs(l,r,o,h,d=1/0){const f=l.range;if(!f)return 0;const g=Math.min(d,Math.max(o,h)),y=Math.log(g/1024)/Math.LN2;return a.smoothstep(f[0]+y,f[1]+y,r)}const Dr=1/4e4;function Mc(l,r){const o=a.clamp(r.lat,-a.MAX_MERCATOR_LATITUDE,a.MAX_MERCATOR_LATITUDE),h=new a.LngLat(r.lng-180*Dr,o),d=new a.LngLat(r.lng+180*Dr,o),f=l.project(h.lng,o),g=l.project(d.lng,o),y=a.MercatorCoordinate.fromLngLat(h),v=a.MercatorCoordinate.fromLngLat(d),E=g.x-f.x,T=g.y-f.y,A=v.x-y.x,k=v.y-y.y,R=Math.sqrt((A*A+k*k)/(E*E+T*T));return Math.log(R)/Math.LN2}function $s(l,r,o){const h=Math.cos(o),d=Math.sin(o);return{x:l*h-r*d,y:l*d+r*h}}class no{constructor(r,o,h,d,f,g,y){this.tileSize=512,this._renderWorldCopies=f===void 0||f,this._minZoom=r||0,this._maxZoom=o||22,this._minPitch=h??0,this._maxPitch=d??60,this.setProjection(g),this.setMaxBounds(y),this.width=0,this.height=0,this._center=new a.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._nearZ=0,this._farZ=0,this._unmodified=!0,this._edgeInsets=new Vs,this._projMatrixCache={},this._alignedProjMatrixCache={},this._fogTileMatrixCache={},this._distanceTileDataCache={},this._camera=new js,this._centerAltitude=0,this._averageElevation=0,this.cameraElevationReference="ground",this._pixelsPerMercatorPixel=1,this.globeRadius=0,this.globeCenterInViewSpace=[0,0,0],this._horizonShift=.1}clone(){const r=new no(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies,this.getProjection());return r._elevation=this._elevation,r._centerAltitude=this._centerAltitude,r._centerAltitudeValidForExaggeration=this._centerAltitudeValidForExaggeration,r.tileSize=this.tileSize,r.mercatorFromTransition=this.mercatorFromTransition,r.width=this.width,r.height=this.height,r.cameraElevationReference=this.cameraElevationReference,r._center=this._center,r._setZoom(this.zoom),r._seaLevelZoom=this._seaLevelZoom,r.angle=this.angle,r._fov=this._fov,r._pitch=this._pitch,r._nearZ=this._nearZ,r._farZ=this._farZ,r._averageElevation=this._averageElevation,r._unmodified=this._unmodified,r._edgeInsets=this._edgeInsets.clone(),r._camera=this._camera.clone(),r._calcMatrices(),r.freezeTileCoverage=this.freezeTileCoverage,r.frustumCorners=this.frustumCorners,r}get elevation(){return this._elevation}set elevation(r){this._elevation!==r&&(this._elevation=r,this._updateCameraOnTerrain(),this._calcMatrices())}updateElevation(r,o=!1){const h=this._elevation&&this._elevation.exaggeration()!==this._centerAltitudeValidForExaggeration;(this._seaLevelZoom==null||h)&&this._updateCameraOnTerrain(),(r||h)&&this._constrainCamera(o),this._calcMatrices()}getProjection(){return a.pick(this.projection,["name","center","parallels"])}setProjection(r){this.projectionOptions=r||{name:"mercator"};const o=this.projection?this.getProjection():void 0;this.projection=a.getProjection(this.projectionOptions);const h=!Se(o,this.getProjection());return h&&this._calcMatrices(),this.mercatorFromTransition=!1,h}setMercatorFromTransition(){const r=this.projection.name;this.mercatorFromTransition=!0,this.projectionOptions={name:"mercator"},this.projection=a.getProjection({name:"mercator"});const o=r!==this.projection.name;return o&&this._calcMatrices(),o}get minZoom(){return this._minZoom}set minZoom(r){this._minZoom!==r&&(this._minZoom=r,this.zoom=Math.max(this.zoom,r))}get maxZoom(){return this._maxZoom}set maxZoom(r){this._maxZoom!==r&&(this._maxZoom=r,this.zoom=Math.min(this.zoom,r))}get minPitch(){return this._minPitch}set minPitch(r){this._minPitch!==r&&(this._minPitch=r,this.pitch=Math.max(this.pitch,r))}get maxPitch(){return this._maxPitch}set maxPitch(r){this._maxPitch!==r&&(this._maxPitch=r,this.pitch=Math.min(this.pitch,r))}get renderWorldCopies(){return this._renderWorldCopies&&this.projection.supportsWorldCopies===!0}set renderWorldCopies(r){r===void 0?r=!0:r===null&&(r=!1),this._renderWorldCopies=r}get worldSize(){return this.tileSize*this.scale}get cameraWorldSizeForFog(){const r=Math.max(this._camera.getDistanceToElevation(this._averageElevation),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(r))}get cameraWorldSize(){const r=Math.max(this._camera.getDistanceToElevation(this._averageElevation,!0),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(r))}get pixelsPerMeter(){return this.projection.pixelsPerMeter(this.center.lat,this.worldSize)}get cameraPixelsPerMeter(){return a.mercatorZfromAltitude(this.center.lat,this.cameraWorldSizeForFog)}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new a.Point(this.width,this.height)}get bearing(){return a.wrap(this.rotation,-180,180)}set bearing(r){this.rotation=r}get rotation(){return-this.angle/Math.PI*180}set rotation(r){const o=-r*Math.PI/180;var h;this.angle!==o&&(this._unmodified=!1,this.angle=o,this._calcMatrices(),this.rotationMatrix=(h=new a.ARRAY_TYPE(4),a.ARRAY_TYPE!=Float32Array&&(h[1]=0,h[2]=0),h[0]=1,h[3]=1,h),function(d,f,g){var y=f[0],v=f[1],E=f[2],T=f[3],A=Math.sin(g),k=Math.cos(g);d[0]=y*k+E*A,d[1]=v*k+T*A,d[2]=y*-A+E*k,d[3]=v*-A+T*k}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(r){const o=a.clamp(r,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==o&&(this._unmodified=!1,this._pitch=o,this._calcMatrices())}get aspect(){return this.width/this.height}get fov(){return this._fov/Math.PI*180}get fovX(){return this._fov}get fovY(){const r=1/Math.tan(.5*this.fovX);return 2*Math.atan(1/this.aspect/r)}set fov(r){r=Math.max(.01,Math.min(60,r)),this._fov!==r&&(this._unmodified=!1,this._fov=a.degToRad(r),this._calcMatrices())}get averageElevation(){return this._averageElevation}set averageElevation(r){this._averageElevation=r,this._calcFogMatrices(),this._distanceTileDataCache={}}get zoom(){return this._zoom}set zoom(r){const o=Math.min(Math.max(r,this.minZoom),this.maxZoom);this._zoom!==o&&(this._unmodified=!1,this._setZoom(o),this._updateSeaLevelZoom(),this._constrain(),this._calcMatrices())}_setZoom(r){this._zoom=r,this.scale=this.zoomScale(r),this.tileZoom=Math.floor(r),this.zoomFraction=r-this.tileZoom}_updateCameraOnTerrain(){if(!this._elevation||!this._elevation.isDataAvailableAtPoint(this.locationCoordinate(this.center)))return this._centerAltitude=0,this._seaLevelZoom=null,void(this._centerAltitudeValidForExaggeration=void 0);const r=this._elevation;this._centerAltitude=r.getAtPointOrZero(this.locationCoordinate(this.center)),this._centerAltitudeValidForExaggeration=r.exaggeration(),this._updateSeaLevelZoom()}_updateSeaLevelZoom(){this._centerAltitudeValidForExaggeration!==void 0&&(this._seaLevelZoom=this._zoomFromMercatorZ((this.pixelsPerMeter*this._centerAltitude+this.cameraToCenterDistance)/this.worldSize))}sampleAverageElevation(){if(!this._elevation)return 0;const r=this._elevation,o=[[.5,.2],[.3,.5],[.5,.5],[.7,.5],[.5,.8]],h=this.horizonLineFromTop();let d=0,f=0;for(let g=0;gr.maxzoom&&(o=r.maxzoom);const g=this.locationCoordinate(this.center),y=this.center.lat,v=1<{const Me=new a.MercatorCoordinate(ae.x+25e-6,ae.y,ae.z),ve=new a.MercatorCoordinate(ae.x,ae.y+25e-6,ae.z),Ae=ae.toLngLat(),Ge=Me.toLngLat(),Xe=ve.toLngLat(),Ve=this.locationCoordinate(Ae),qe=this.locationCoordinate(Ge),lt=this.locationCoordinate(Xe),ot=Math.hypot(qe.x-Ve.x,qe.y-Ve.y),je=Math.hypot(lt.x-Ve.x,lt.y-Ve.y);return Math.sqrt(ot*je)*K/25e-6},Y=ae=>{const _e=N,Me=j;return{aabb:a.tileAABB(this,v,0,0,0,ae,Me,_e,this.projection),zoom:0,x:0,y:0,minZ:Me,maxZ:_e,wrap:ae,fullyVisible:!1}},ie=[];let te=[];const le=o,Te=r.reparseOverscaled?h:o,oe=ae=>ae*ae,ge=oe((B-this._centerAltitude)*O),he=ae=>{if(!this._elevation||!ae.tileID||!f)return;const _e=this._elevation.getMinMaxForTile(ae.tileID),Me=ae.aabb;_e?(Me.min[2]=_e.min,Me.max[2]=_e.max,Me.center[2]=(Me.min[2]+Me.max[2])/2):(ae.shouldSplit=we(ae),ae.shouldSplit||(Me.min[2]=Me.max[2]=Me.center[2]=this._centerAltitude))},we=ae=>{if(ae.zoom=.9)return!0}else if(d&&(ve=oe(ae.aabb.distanceZ(F)*O)),this.projection.isReprojectedInTileSpace&&h<=5){const Ve=Math.pow(2,ae.zoom),qe=J(new a.MercatorCoordinate((ae.x+.5)/Ve,(ae.y+.5)/Ve));Ae=qe>.85?1:qe}const Ge=_e*_e+Me*Me+ve,Xe=oe((1<{if(qe*oe(.707)0;){const ae=ie.pop(),_e=ae.x,Me=ae.y;let ve=ae.fullyVisible;if(!ve){const Ae=ae.aabb.intersects(k);if(Ae===0)continue;ve=Ae===2}if(ae.zoom!==le&&we(ae))for(let Ae=0;Ae<4;Ae++){const Ge=(_e<<1)+Ae%2,Xe=(Me<<1)+(Ae>>1),Ve={aabb:f?ae.aabb.quadrant(Ae):a.tileAABB(this,v,ae.zoom+1,Ge,Xe,ae.wrap,ae.minZ,ae.maxZ,this.projection),zoom:ae.zoom+1,x:Ge,y:Xe,wrap:ae.wrap,fullyVisible:ve,tileID:void 0,shouldSplit:void 0,minZ:ae.minZ,maxZ:ae.maxZ};d&&!T&&(Ve.tileID=new a.OverscaledTileID(ae.zoom+1===le?Te:ae.zoom+1,ae.wrap,ae.zoom+1,Ge,Xe),he(Ve)),ie.push(Ve)}else{const Ae=ae.zoom===le?Te:ae.zoom;if(r.minzoom&&r.minzoom>Ae)continue;const Ge=E[0]-(.5+_e+(ae.wrap<{const ve=[0,0,0,1],Ae=[a.EXTENT,a.EXTENT,0,1],Ge=this.calculateFogTileMatrix(Me.tileID.toUnwrapped());a.transformMat4$1(ve,ve,Ge),a.transformMat4$1(Ae,Ae,Ge);const Xe=a.getAABBPointSquareDist(ve,Ae);if(Xe===0)return!0;let Ve=!1;const qe=this._elevation;if(qe&&Xe>ae&&_e!==0){const lt=this.calculateProjMatrix(Me.tileID.toUnwrapped());let ot;r.isTerrainDEM||(ot=qe.getMinMaxForTile(Me.tileID)),ot||(ot={min:j,max:N});const je=a.furthestTileCorner(this.rotation),wt=[je[0]*a.EXTENT,je[1]*a.EXTENT,ot.max];a.transformMat4(wt,wt,lt),Ve=(1-wt[1])*this.height*.5<_e}return Xeae.distanceSq-_e.distanceSq).map(ae=>ae.tileID)}resize(r,o){this.width=r,this.height=o,this.pixelsToGLUnits=[2/r,-2/o],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(r){return Math.pow(2,r)}scaleZoom(r){return Math.log(r)/Math.LN2}project(r){const o=a.clamp(r.lat,-a.MAX_MERCATOR_LATITUDE,a.MAX_MERCATOR_LATITUDE),h=this.projection.project(r.lng,o);return new a.Point(h.x*this.worldSize,h.y*this.worldSize)}unproject(r){return this.projection.unproject(r.x/this.worldSize,r.y/this.worldSize)}get point(){return this.project(this.center)}get pointMerc(){return this.point._div(this.worldSize)}get pixelsPerMeterRatio(){return this.pixelsPerMeter/a.mercatorZfromAltitude(1,this.center.lat)/this.worldSize}setLocationAtPoint(r,o){let h,d;const f=this.centerPoint;if(this.projection.name==="globe"){const y=this.worldSize;h=(o.x-f.x)/y,d=(o.y-f.y)/y}else{const y=this.pointCoordinate(o),v=this.pointCoordinate(f);h=y.x-v.x,d=y.y-v.y}const g=this.locationCoordinate(r);this.setLocation(new a.MercatorCoordinate(g.x-h,g.y-d))}setLocation(r){this.center=this.coordinateLocation(r),this.projection.wrap&&(this.center=this.center.wrap())}locationPoint(r){return this.projection.locationPoint(this,r)}locationPoint3D(r){return this.projection.locationPoint(this,r,!0)}pointLocation(r){return this.coordinateLocation(this.pointCoordinate(r))}pointLocation3D(r){return this.coordinateLocation(this.pointCoordinate3D(r))}locationCoordinate(r,o){const h=o?a.mercatorZfromAltitude(o,r.lat):void 0,d=this.projection.project(r.lng,r.lat);return new a.MercatorCoordinate(d.x,d.y,h)}coordinateLocation(r){return this.projection.unproject(r.x,r.y)}pointRayIntersection(r,o){const h=o??this._centerAltitude,d=[r.x,r.y,0,1],f=[r.x,r.y,1,1];a.transformMat4$1(d,d,this.pixelMatrixInverse),a.transformMat4$1(f,f,this.pixelMatrixInverse);const g=f[3];a.scale$1(d,d,1/d[3]),a.scale$1(f,f,1/g);const y=d[2],v=f[2];return{p0:d,p1:f,t:y===v?0:(h-y)/(v-y)}}screenPointToMercatorRay(r){const o=[r.x,r.y,0,1],h=[r.x,r.y,1,1];return a.transformMat4$1(o,o,this.pixelMatrixInverse),a.transformMat4$1(h,h,this.pixelMatrixInverse),a.scale$1(o,o,1/o[3]),a.scale$1(h,h,1/h[3]),o[2]=a.mercatorZfromAltitude(o[2],this._center.lat)*this.worldSize,h[2]=a.mercatorZfromAltitude(h[2],this._center.lat)*this.worldSize,a.scale$1(o,o,1/this.worldSize),a.scale$1(h,h,1/this.worldSize),new a.Ray([o[0],o[1],o[2]],a.normalize([],a.sub([],h,o)))}rayIntersectionCoordinate(r){const{p0:o,p1:h,t:d}=r,f=a.mercatorZfromAltitude(o[2],this._center.lat),g=a.mercatorZfromAltitude(h[2],this._center.lat);return new a.MercatorCoordinate(a.number(o[0],h[0],d)/this.worldSize,a.number(o[1],h[1],d)/this.worldSize,a.number(f,g,d))}pointCoordinate(r,o=this._centerAltitude){return this.projection.pointCoordinate(this,r.x,r.y,o)}pointCoordinate3D(r){if(!this.elevation)return this.pointCoordinate(r);let o=this.projection.pointCoordinate3D(this,r.x,r.y);if(o)return new a.MercatorCoordinate(o[0],o[1],o[2]);let h=0,d=this.horizonLineFromTop();if(r.y>d)return this.pointCoordinate(r);const f=.02*d,g=r.clone();for(let y=0;y<10&&d-h>f;y++){g.y=a.number(h,d,.66);const v=this.projection.pointCoordinate3D(this,g.x,g.y);v?(d=g.y,o=v):h=g.y}return o?new a.MercatorCoordinate(o[0],o[1],o[2]):this.pointCoordinate(r)}isPointAboveHorizon(r){return this.projection.isPointAboveHorizon(this,r)}isPointOnSurface(r){if(r.y<0||r.y>this.height||r.x<0||r.x>this.width)return!1;if(this.elevation||this.zoom>=a.GLOBE_ZOOM_THRESHOLD_MAX)return!this.isPointAboveHorizon(r);const o=this.pointCoordinate(r);return o.y>=0&&o.y<=1}_coordinatePoint(r,o){const h=o&&this.elevation?this.elevation.getAtPointOrZero(r,this._centerAltitude):this._centerAltitude,d=[r.x*this.worldSize,r.y*this.worldSize,h+r.toAltitude(),1];return a.transformMat4$1(d,d,this.pixelMatrix),d[3]>0?new a.Point(d[0]/d[3],d[1]/d[3]):new a.Point(Number.MAX_VALUE,Number.MAX_VALUE)}_getBoundsNonRectangular(){const{top:r,left:o}=this._edgeInsets,h=this.height-this._edgeInsets.bottom,d=this.width-this._edgeInsets.right,f=this.pointLocation3D(new a.Point(o,r)),g=this.pointLocation3D(new a.Point(d,r)),y=this.pointLocation3D(new a.Point(d,h)),v=this.pointLocation3D(new a.Point(o,h));let E=Math.min(f.lng,g.lng,y.lng,v.lng),T=Math.max(f.lng,g.lng,y.lng,v.lng),A=Math.min(f.lat,g.lat,y.lat,v.lat),k=Math.max(f.lat,g.lat,y.lat,v.lat);const R=Math.pow(2,-this.zoom)/16*270,O=this.projection.name==="globe"?1:4,B=(F,I,L,N,j)=>{const K=(F+L)/2,J=(I+N)/2,Y=new a.Point(K,J),{lng:ie,lat:te}=this.pointLocation3D(Y),le=Math.max(0,E-ie,A-te,ie-T,te-k);E=Math.min(E,ie),T=Math.max(T,ie),A=Math.min(A,te),k=Math.max(k,te),(jR)&&(B(F,I,K,J,j+1),B(K,J,L,N,j+1))};if(B(o,r,d,r,1),B(d,r,d,h,1),B(d,h,o,h,1),B(o,h,o,r,1),this.projection.name==="globe"){const[F,I]=a.polesInViewport(this);F?(k=90,T=180,E=-180):I&&(A=-90,T=180,E=-180)}return new a.LngLatBounds(new a.LngLat(E,A),new a.LngLat(T,k))}_getBoundsRectangular(r,o){const{top:h,left:d}=this._edgeInsets,f=this.height-this._edgeInsets.bottom,g=this.width-this._edgeInsets.right,y=new a.Point(d,h),v=new a.Point(g,h),E=new a.Point(g,f),T=new a.Point(d,f);let A=this.pointCoordinate(y,r),k=this.pointCoordinate(v,r);const R=this.pointCoordinate(E,o),O=this.pointCoordinate(T,o),B=(F,I)=>(I.y-F.y)/(I.x-F.x);return A.y>1&&k.y>=0?A=new a.MercatorCoordinate((1-O.y)/B(O,A)+O.x,1):A.y<0&&k.y<=1&&(A=new a.MercatorCoordinate(-O.y/B(O,A)+O.x,0)),k.y>1&&A.y>=0?k=new a.MercatorCoordinate((1-R.y)/B(R,k)+R.x,1):k.y<0&&A.y<=1&&(k=new a.MercatorCoordinate(-R.y/B(R,k)+R.x,0)),new a.LngLatBounds().extend(this.coordinateLocation(A)).extend(this.coordinateLocation(k)).extend(this.coordinateLocation(O)).extend(this.coordinateLocation(R))}_getBoundsRectangularTerrain(){const r=this.elevation;if(!r.visibleDemTiles.length||r.isUsingMockSource())return this._getBoundsRectangular(0,0);const o=r.visibleDemTiles.reduce((h,d)=>{if(d.dem){const f=d.dem.tree;h.min=Math.min(h.min,f.minimums[0]),h.max=Math.max(h.max,f.maximums[0])}return h},{min:Number.MAX_VALUE,max:0});return this._getBoundsRectangular(o.min*r.exaggeration(),o.max*r.exaggeration())}getBounds(){return this.projection.name==="mercator"||this.projection.name==="equirectangular"?this._terrainEnabled()?this._getBoundsRectangularTerrain():this._getBoundsRectangular(0,0):this._getBoundsNonRectangular()}horizonLineFromTop(r=!0){const o=this.height/2/Math.tan(this._fov/2)/Math.tan(Math.max(this._pitch,.1))+this.centerOffset.y,h=this.height/2-o*(1-this._horizonShift);return r?Math.max(0,h):h}getMaxBounds(){return this.maxBounds}setMaxBounds(r){this.maxBounds=r,this.minLat=-a.MAX_MERCATOR_LATITUDE,this.maxLat=a.MAX_MERCATOR_LATITUDE,this.minLng=-180,this.maxLng=180,r&&(this.minLat=r.getSouth(),this.maxLat=r.getNorth(),this.minLng=r.getWest(),this.maxLng=r.getEast(),this.maxLngA&&(y=A-E),A-TR&&(g=R-v),R-k.5?N-1:N,j>.5?j-1:j,0]),this.alignedProjMatrix=K,y=a.create(),a.scale(y,y,[this.width/2,-this.height/2,1]),a.translate(y,y,[1,-1,0]),this.labelPlaneMatrix=y,y=a.create(),a.scale(y,y,[1,-1,1]),a.translate(y,y,[-1,-1,0]),a.scale(y,y,[2/this.width,2/this.height,1]),this.glCoordMatrix=y,this.pixelMatrix=a.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),this._calcFogMatrices(),this._distanceTileDataCache={},y=a.invert(new Float64Array(16),this.pixelMatrix),!y)throw new Error("failed to invert matrix");if(this.pixelMatrixInverse=y,this.projection.name==="globe"||this.mercatorFromTransition){this.globeMatrix=a.calculateGlobeMatrix(this);const J=[this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]];this.globeCenterInViewSpace=a.transformMat4(J,J,f),this.globeRadius=this.worldSize/2/Math.PI-1}else this.globeMatrix=y;this._projMatrixCache={},this._alignedProjMatrixCache={},this._pixelsToTileUnitsCache={}}_calcFogMatrices(){this._fogTileMatrixCache={};const r=this.cameraWorldSizeForFog,o=this.cameraPixelsPerMeter,h=this._camera.position,d=1/this.height/this._pixelsPerMercatorPixel,f=[r,r,o];a.scale$2(f,f,d),a.scale$2(h,h,-1),a.multiply$2(h,h,f);const g=a.create();a.translate(g,g,h),a.scale(g,g,f),this.mercatorFogMatrix=g,this.worldToFogMatrix=this._camera.getWorldToCameraPosition(r,o,d)}_computeCameraPosition(r){const o=(r=r||this.pixelsPerMeter)/this.pixelsPerMeter,h=this._camera.forward(),d=this.point,f=this._mercatorZfromZoom(this._seaLevelZoom?this._seaLevelZoom:this._zoom)*o-r/this.worldSize*this._centerAltitude;return[d.x/this.worldSize-h[0]*f,d.y/this.worldSize-h[1]*f,r/this.worldSize*this._centerAltitude-h[2]*f]}_updateCameraState(){this.height&&(this._camera.setPitchBearing(this._pitch,this.angle),this._camera.position=this._computeCameraPosition())}_translateCameraConstrained(r){const o=this._maxCameraBoundsDistance()*Math.cos(this._pitch),h=this._camera.position[2],d=r[2];let f=1;this.projection.wrap&&(this.center=this.center.wrap()),d>0&&(f=Math.min((o-h)/d,1)),this._camera.position=a.scaleAndAdd([],this._camera.position,r,f),this._updateStateFromCamera()}_updateStateFromCamera(){const r=this._camera.position,o=this._camera.forward(),{pitch:h,bearing:d}=this._camera.getPitchBearing(),f=a.mercatorZfromAltitude(this._centerAltitude,this.center.lat)*this._pixelsPerMercatorPixel,g=this._mercatorZfromZoom(this._maxZoom)*Math.cos(a.degToRad(this._maxPitch)),y=Math.max((r[2]-f)/Math.cos(h),g),v=this._zoomFromMercatorZ(y);a.scaleAndAdd(r,r,o,y),this._pitch=a.clamp(h,a.degToRad(this.minPitch),a.degToRad(this.maxPitch)),this.angle=a.wrap(d,-Math.PI,Math.PI),this._setZoom(a.clamp(v,this._minZoom,this._maxZoom)),this._updateSeaLevelZoom(),this._center=this.coordinateLocation(new a.MercatorCoordinate(r[0],r[1],r[2])),this._unmodified=!1,this._constrain(),this._calcMatrices()}_worldSizeFromZoom(r){return Math.pow(2,r)*this.tileSize}_mercatorZfromZoom(r){return this.cameraToCenterDistance/this._worldSizeFromZoom(r)}_minimumHeightOverTerrain(){const r=Math.min((this._seaLevelZoom!=null?this._seaLevelZoom:this._zoom)+4,this._maxZoom);return this._mercatorZfromZoom(r)}_zoomFromMercatorZ(r){return this.scaleZoom(this.cameraToCenterDistance/(r*this.tileSize))}zoomFromMercatorZAdjusted(r){let o=0,h=a.GLOBE_ZOOM_THRESHOLD_MAX,d=0,f=1/0;for(;h-o>1e-6&&h>o;){const g=o+.5*(h-o),y=this.tileSize*Math.pow(2,g),v=this.getCameraToCenterDistance(this.projection,g,y),E=this.scaleZoom(v/(r*this.tileSize)),T=Math.abs(g-E);TE||k.y>1)return!0}return!1}isHorizonVisible(){return this.pitch+a.radToDeg(this.fovAboveCenter)>88||this.anyCornerOffEdge(new a.Point(0,0),new a.Point(this.width,this.height))}zoomDeltaToMovement(r,o){const h=a.length(a.sub([],this._camera.position,r)),d=this._zoomFromMercatorZ(h)+o;return h-this._mercatorZfromZoom(d)}getCameraPoint(){if(this.projection.name==="globe"){const r=function([o,h,d],f){const g=[o,h,d,1];a.transformMat4$1(g,g,f);const y=g[3]=Math.max(g[3],1e-6);return g[0]/=y,g[1]/=y,g[2]/=y,g}([this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]],this.pixelMatrix);return new a.Point(r[0],r[1])}{const r=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new a.Point(0,r))}}getCameraToCenterDistance(r,o=this.zoom,h=this.worldSize){const d=Gs(r,o,this.width,this.height,1024),f=r.pixelSpaceConversion(this.center.lat,h,d);return .5/Math.tan(.5*this._fov)*this.height*f}getWorldToCameraMatrix(){const r=this._camera.getWorldToCamera(this.worldSize,this.projection.zAxisUnit==="meters"?this.pixelsPerMeter:1);return this.projection.name==="globe"&&a.multiply(r,r,this.globeMatrix),r}}function oo(l,r){let o=!1,h=null;const d=()=>{h=null,o&&(l(),h=setTimeout(d,r),o=!1)};return()=>(o=!0,h||d(),h)}class rl{constructor(r){this._hashName=r&&encodeURIComponent(r),a.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=oo(this._updateHashUnthrottled.bind(this),300)}addTo(r){return this._map=r,a.window.addEventListener("hashchange",this._onHashChange,!1),r.on("moveend",this._updateHash),this}remove(){return this._map?(this._map.off("moveend",this._updateHash),a.window.removeEventListener("hashchange",this._onHashChange,!1),clearTimeout(this._updateHash()),this._map=void 0,this):this}getHashString(){const r=this._map;if(!r)return"";const o=Ho(r);if(this._hashName){const h=this._hashName;let d=!1;const f=a.window.location.hash.slice(1).split("&").map(g=>{const y=g.split("=")[0];return y===h?(d=!0,`${y}=${o}`):g}).filter(g=>g);return d||f.push(`${h}=${o}`),`#${f.join("&")}`}return`#${o}`}_getCurrentHash(){const r=a.window.location.hash.replace("#","");if(this._hashName){let o;return r.split("&").map(h=>h.split("=")).forEach(h=>{h[0]===this._hashName&&(o=h)}),(o&&o[1]||"").split("/")}return r.split("/")}_onHashChange(){const r=this._map;if(!r)return!1;const o=this._getCurrentHash();if(o.length>=3&&!o.some(h=>isNaN(h))){const h=r.dragRotate.isEnabled()&&r.touchZoomRotate.isEnabled()?+(o[3]||0):r.getBearing();return r.jumpTo({center:[+o[2],+o[1]],zoom:+o[0],bearing:h,pitch:+(o[4]||0)}),!0}return!1}_updateHashUnthrottled(){const r=a.window.location.href.replace(/(#.+)?$/,this.getHashString());a.window.history.replaceState(a.window.history.state,null,r)}}function Ho(l,r){const o=l.getCenter(),h=Math.round(100*l.getZoom())/100,d=Math.ceil((h*Math.LN2+Math.log(512/360/.5))/Math.LN10),f=Math.pow(10,d),g=Math.round(o.lng*f)/f,y=Math.round(o.lat*f)/f,v=l.getBearing(),E=l.getPitch();let T=r?`/${g}/${y}/${h}`:`${h}/${y}/${g}`;return(v||E)&&(T+="/"+Math.round(10*v)/10),E&&(T+=`/${Math.round(E)}`),T}const Ko={linearity:.3,easing:a.bezier(0,0,.3,1)},Zs=a.extend({deceleration:2500,maxSpeed:1400},Ko),qs=a.extend({deceleration:20,maxSpeed:1400},Ko),Fe=a.extend({deceleration:1e3,maxSpeed:360},Ko),tr=a.extend({deceleration:1e3,maxSpeed:90},Ko);class Ac{constructor(r){this._map=r,this.clear()}clear(){this._inertiaBuffer=[]}record(r){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:a.exported.now(),settings:r})}_drainInertiaBuffer(){const r=this._inertiaBuffer,o=a.exported.now();for(;r.length>0&&o-r[0].time>160;)r.shift()}_onMoveEnd(r){if(this._map._prefersReducedMotion()||(this._drainInertiaBuffer(),this._inertiaBuffer.length<2))return;const o={zoom:0,bearing:0,pitch:0,pan:new a.Point(0,0),pinchAround:void 0,around:void 0};for(const{settings:f}of this._inertiaBuffer)o.zoom+=f.zoomDelta||0,o.bearing+=f.bearingDelta||0,o.pitch+=f.pitchDelta||0,f.panDelta&&o.pan._add(f.panDelta),f.around&&(o.around=f.around),f.pinchAround&&(o.pinchAround=f.pinchAround);const h=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,d={};if(o.pan.mag()){const f=Jo(o.pan.mag(),h,a.extend({},Zs,r||{}));d.offset=o.pan.mult(f.amount/o.pan.mag()),d.center=this._map.transform.center,Yo(d,f)}if(o.zoom){const f=Jo(o.zoom,h,qs);d.zoom=this._map.transform.zoom+f.amount,Yo(d,f)}if(o.bearing){const f=Jo(o.bearing,h,Fe);d.bearing=this._map.transform.bearing+a.clamp(f.amount,-179,179),Yo(d,f)}if(o.pitch){const f=Jo(o.pitch,h,tr);d.pitch=this._map.transform.pitch+f.amount,Yo(d,f)}if(d.zoom||d.bearing){const f=o.pinchAround===void 0?o.around:o.pinchAround;d.around=f?this._map.unproject(f):this._map.getCenter()}return this.clear(),d.noMoveStart=!0,d}}function Yo(l,r){(!l.duration||l.durationo.unproject(v)),y=f.reduce((v,E,T,A)=>v.add(E.div(A.length)),new a.Point(0,0));super(r,{points:f,point:y,lngLats:g,lngLat:o.unproject(y),originalEvent:h}),this._defaultPrevented=!1}}class Ws extends a.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(r,o,h){super(r,{originalEvent:h}),this._defaultPrevented=!1}}class nl{constructor(r,o){this._map=r,this._clickTolerance=o.clickTolerance}reset(){this._mousedownPos=void 0}wheel(r){return this._firePreventable(new Ws(r.type,this._map,r))}mousedown(r,o){return this._mousedownPos=o,this._firePreventable(new hi(r.type,this._map,r))}mouseup(r){this._map.fire(new hi(r.type,this._map,r))}preclick(r){const o=a.extend({},r);o.type="preclick",this._map.fire(new hi(o.type,this._map,o))}click(r,o){this._mousedownPos&&this._mousedownPos.dist(o)>=this._clickTolerance||(this.preclick(r),this._map.fire(new hi(r.type,this._map,r)))}dblclick(r){return this._firePreventable(new hi(r.type,this._map,r))}mouseover(r){this._map.fire(new hi(r.type,this._map,r))}mouseout(r){this._map.fire(new hi(r.type,this._map,r))}touchstart(r){return this._firePreventable(new Qo(r.type,this._map,r))}touchmove(r){this._map.fire(new Qo(r.type,this._map,r))}touchend(r){this._map.fire(new Qo(r.type,this._map,r))}touchcancel(r){this._map.fire(new Qo(r.type,this._map,r))}_firePreventable(r){if(this._map.fire(r),r.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Xs{constructor(r){this._map=r}reset(){this._delayContextMenu=!1,this._contextMenuEvent=void 0}mousemove(r){this._map.fire(new hi(r.type,this._map,r))}mousedown(){this._delayContextMenu=!0}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new hi("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(r){this._delayContextMenu?this._contextMenuEvent=r:this._map.fire(new hi(r.type,this._map,r)),this._map.listens("contextmenu")&&r.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Ic{constructor(r,o){this._map=r,this._el=r.getCanvasContainer(),this._container=r.getContainer(),this._clickTolerance=o.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(r,o){this.isEnabled()&&r.shiftKey&&r.button===0&&(To(),this._startPos=this._lastPos=o,this._active=!0)}mousemoveWindow(r,o){if(!this._active)return;const h=o,d=this._startPos,f=this._lastPos;if(!d||!f||f.equals(h)||!this._box&&h.dist(d){this._box&&(this._box.style.transform=`translate(${g}px,${v}px)`,this._box.style.width=y-g+"px",this._box.style.height=E-v+"px")})}mouseupWindow(r,o){if(!this._active)return;const h=this._startPos,d=o;if(h&&r.button===0){if(this.reset(),Bn(),h.x!==d.x||h.y!==d.y)return this._map.fire(new a.Event("boxzoomend",{originalEvent:r})),{cameraAnimation:f=>f.fitScreenCoordinates(h,d,this._map.getBearing(),{linear:!1})};this._fireEvent("boxzoomcancel",r)}}keydown(r){this._active&&r.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",r))}blur(){this.reset()}reset(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.remove(),this._box=null),Rn(),delete this._startPos,delete this._lastPos}_fireEvent(r,o){return this._map.fire(new a.Event(r,{originalEvent:o}))}}function Hs(l,r){const o={};for(let h=0;hthis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===0&&(this.startTime=r.timeStamp),h.length===this.numTouches&&(this.centroid=function(d){const f=new a.Point(0,0);for(const g of d)f._add(g);return f.div(d.length)}(o),this.touches=Hs(h,o)))}touchmove(r,o,h){if(this.aborted||!this.centroid)return;const d=Hs(h,o);for(const f in this.touches){const g=d[f];(!g||g.dist(this.touches[f])>30)&&(this.aborted=!0)}}touchend(r,o,h){if((!this.centroid||r.timeStamp-this.startTime>500)&&(this.aborted=!0),h.length===0){const d=!this.aborted&&this.centroid;if(this.reset(),d)return d}}}class ol{constructor(r){this.singleTap=new so(r),this.numTaps=r.numTaps,this.reset()}reset(){this.lastTime=1/0,this.lastTap=void 0,this.count=0,this.singleTap.reset()}touchstart(r,o,h){this.singleTap.touchstart(r,o,h)}touchmove(r,o,h){this.singleTap.touchmove(r,o,h)}touchend(r,o,h){const d=this.singleTap.touchend(r,o,h);if(d){const f=r.timeStamp-this.lastTime<500,g=!this.lastTap||this.lastTap.dist(d)<30;if(f&&g||this.reset(),this.count++,this.lastTime=r.timeStamp,this.lastTap=d,this.count===this.numTaps)return this.reset(),d}}}class Nh{constructor(){this._zoomIn=new ol({numTouches:1,numTaps:2}),this._zoomOut=new ol({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(r,o,h){this._zoomIn.touchstart(r,o,h),this._zoomOut.touchstart(r,o,h)}touchmove(r,o,h){this._zoomIn.touchmove(r,o,h),this._zoomOut.touchmove(r,o,h)}touchend(r,o,h){const d=this._zoomIn.touchend(r,o,h),f=this._zoomOut.touchend(r,o,h);return d?(this._active=!0,r.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:g=>g.easeTo({duration:300,zoom:g.getZoom()+1,around:g.unproject(d)},{originalEvent:r})}):f?(this._active=!0,r.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:g=>g.easeTo({duration:300,zoom:g.getZoom()-1,around:g.unproject(f)},{originalEvent:r})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}const Cc={0:1,2:2};class ao{constructor(r){this.reset(),this._clickTolerance=r.clickTolerance||1}blur(){this.reset()}reset(){this._active=!1,this._moved=!1,this._lastPoint=void 0,this._eventButton=void 0}_correctButton(r,o){return!1}_move(r,o){return{}}mousedown(r,o){if(this._lastPoint)return;const h=un(r);this._correctButton(r,h)&&(this._lastPoint=o,this._eventButton=h)}mousemoveWindow(r,o){const h=this._lastPoint;if(h){if(r.preventDefault(),this._eventButton!=null&&function(d,f){const g=Cc[f];return d.buttons===void 0||(d.buttons&g)!==g}(r,this._eventButton))this.reset();else if(this._moved||!(o.dist(h)0&&(this._active=!0);const d=Hs(h,o),f=new a.Point(0,0),g=new a.Point(0,0);let y=0;for(const E in d){const T=d[E],A=this._touches[E];A&&(f._add(T),g._add(T.sub(A)),y++,d[E]=T)}if(this._touches=d,y{this._alertContainer.classList.remove("mapboxgl-touch-pan-blocker-show"),this._alertContainer.setAttribute("role","null")},500)}}class es{constructor(){this.reset()}reset(){this._active=!1,this._firstTwoTouches=void 0}_start(r){}_move(r,o,h){return{}}touchstart(r,o,h){this._firstTwoTouches||h.length<2||(this._firstTwoTouches=[h[0].identifier,h[1].identifier],this._start([o[0],o[1]]))}touchmove(r,o,h){const d=this._firstTwoTouches;if(!d)return;r.preventDefault();const[f,g]=d,y=ts(h,o,f),v=ts(h,o,g);if(!y||!v)return;const E=this._aroundCenter?null:y.add(v).div(2);return this._move([y,v],E,r)}touchend(r,o,h){if(!this._firstTwoTouches)return;const[d,f]=this._firstTwoTouches,g=ts(h,o,d),y=ts(h,o,f);g&&y||(this._active&&Bn(),this.reset())}touchcancel(){this.reset()}enable(r){this._enabled=!0,this._aroundCenter=!!r&&r.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function ts(l,r,o){for(let h=0;hMath.abs(l.x)}class kc extends es{constructor(r){super(),this._map=r}reset(){super.reset(),this._valid=void 0,this._firstMove=void 0,this._lastPoints=void 0}_start(r){this._lastPoints=r,Yr(r[0].sub(r[1]))&&(this._valid=!1)}_move(r,o,h){const d=this._lastPoints;if(!d)return;const f=r[0].sub(d[0]),g=r[1].sub(d[1]);return this._map._cooperativeGestures&&!a.isFullscreen()&&h.touches.length<3||(this._valid=this.gestureBeginsVertically(f,g,h.timeStamp),!this._valid)?void 0:(this._lastPoints=r,this._active=!0,{pitchDelta:(f.y+g.y)/2*-.5})}gestureBeginsVertically(r,o,h){if(this._valid!==void 0)return this._valid;const d=r.mag()>=2,f=o.mag()>=2;if(!d&&!f)return;if(!d||!f)return this._firstMove==null&&(this._firstMove=h),h-this._firstMove<100&&void 0;const g=r.y>0==o.y>0;return Yr(r)&&Yr(o)&&g}}const Dc={panStep:100,bearingStep:15,pitchStep:10};class jh{constructor(){const r=Dc;this._panStep=r.panStep,this._bearingStep=r.bearingStep,this._pitchStep=r.pitchStep,this._rotationDisabled=!1}blur(){this.reset()}reset(){this._active=!1}keydown(r){if(r.altKey||r.ctrlKey||r.metaKey)return;let o=0,h=0,d=0,f=0,g=0;switch(r.keyCode){case 61:case 107:case 171:case 187:o=1;break;case 189:case 109:case 173:o=-1;break;case 37:r.shiftKey?h=-1:(r.preventDefault(),f=-1);break;case 39:r.shiftKey?h=1:(r.preventDefault(),f=1);break;case 38:r.shiftKey?d=1:(r.preventDefault(),g=-1);break;case 40:r.shiftKey?d=-1:(r.preventDefault(),g=1);break;default:return}return this._rotationDisabled&&(h=0,d=0),{cameraAnimation:y=>{const v=y.getZoom();y.easeTo({duration:300,easeId:"keyboardHandler",easing:Lc,zoom:o?Math.round(v)+o*(r.shiftKey?2:1):v,bearing:y.getBearing()+h*this._bearingStep,pitch:y.getPitch()+d*this._pitchStep,offset:[-f*this._panStep,-g*this._panStep],center:y.getCenter()},{originalEvent:r})}}}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 Lc(l){return l*(2-l)}const ul=4.000244140625;class Rc{constructor(r,o){this._map=r,this._el=r.getCanvasContainer(),this._handler=o,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,a.bindAll(["_onTimeout","_addScrollZoomBlocker","_showBlockerAlert"],this)}setZoomRate(r){this._defaultZoomRate=r}setWheelZoomRate(r){this._wheelZoomRate=r}isEnabled(){return!!this._enabled}isActive(){return this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(r){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!r&&r.around==="center",this._map._cooperativeGestures&&this._addScrollZoomBlocker())}disable(){this.isEnabled()&&(this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove()))}wheel(r){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!(r.ctrlKey||r.metaKey||this.isZooming()||a.isFullscreen()))return void this._showBlockerAlert();this._alertContainer.style.visibility!=="hidden"&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}let o=r.deltaMode===a.window.WheelEvent.DOM_DELTA_LINE?40*r.deltaY:r.deltaY;const h=a.exported.now(),d=h-(this._lastWheelEventTime||0);this._lastWheelEventTime=h,o!==0&&o%ul==0?this._type="wheel":o!==0&&Math.abs(o)<4?this._type="trackpad":d>400?(this._type=null,this._lastValue=o,this._timeout=setTimeout(this._onTimeout,40,r)):this._type||(this._type=Math.abs(d*o)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,o+=this._lastValue)),r.shiftKey&&o&&(o/=4),this._type&&(this._lastWheelEvent=r,this._delta-=o,this._active||this._start(r)),r.preventDefault()}_onTimeout(r){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(r)}_start(r){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 o=Ji(this._el,r);this._aroundPoint=this._aroundCenter?this._map.transform.centerPoint:o,this._aroundCoord=this._map.transform.pointCoordinate3D(this._aroundPoint),this._targetZoom=void 0,this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const r=this._map.transform;this._type==="wheel"&&r.projection.wrap&&(r._center.lng>=180||r._center.lng<=-180)&&(this._prevEase=null,this._easing=null,this._lastWheelEvent=null,this._lastWheelEventTime=0);const o=()=>r._terrainEnabled()&&this._aroundCoord?r.computeZoomRelativeTo(this._aroundCoord):r.zoom;if(this._delta!==0){const v=this._type==="wheel"&&Math.abs(this._delta)>ul?this._wheelZoomRate:this._defaultZoomRate;let E=2/(1+Math.exp(-Math.abs(this._delta*v)));this._delta<0&&E!==0&&(E=1/E);const T=o(),A=Math.pow(2,T),k=typeof this._targetZoom=="number"?r.zoomScale(this._targetZoom):A;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(k*E))),this._type==="wheel"&&(this._startZoom=T,this._easing=this._smoothOutEasing(200)),this._delta=0}const h=typeof this._targetZoom=="number"?this._targetZoom:o(),d=this._startZoom,f=this._easing;let g,y=!1;if(this._type==="wheel"&&d&&f){const v=Math.min((a.exported.now()-this._lastWheelEventTime)/200,1),E=f(v);g=a.number(d,h,E),v<1?this._frameId||(this._frameId=!0):y=!0}else g=h,y=!0;return this._active=!0,y&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!y,zoomDelta:g-o(),around:this._aroundPoint,aroundCoord:this._aroundCoord,originalEvent:this._lastWheelEvent}}_smoothOutEasing(r){let o=a.ease;if(this._prevEase){const h=this._prevEase,d=(a.exported.now()-h.start)/h.duration,f=h.easing(d+.01)-h.easing(d),g=.27/Math.sqrt(f*f+1e-4)*.01,y=Math.sqrt(.0729-g*g);o=a.bezier(g,y,.25,1)}return this._prevEase={start:a.exported.now(),duration:r,easing:o},o}blur(){this.reset()}reset(){this._active=!1}_addScrollZoomBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=ht("div","mapboxgl-scroll-zoom-blocker",this._map._container),this._alertContainer.textContent=/(Mac|iPad)/i.test(a.window.navigator.userAgent)?this._map._getUIString("ScrollZoomBlocker.CmdMessage"):this._map._getUIString("ScrollZoomBlocker.CtrlMessage"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=setTimeout(()=>{this._alertContainer.classList.remove("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","null")},200)}}class Bc{constructor(r,o){this._clickZoom=r,this._tapZoom=o}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 xi{constructor(){this.reset()}reset(){this._active=!1}blur(){this.reset()}dblclick(r,o){return r.preventDefault(),{cameraAnimation:h=>{h.easeTo({duration:300,zoom:h.getZoom()+(r.shiftKey?-1:1),around:h.unproject(o)},{originalEvent:r})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Gh{constructor(){this._tap=new ol({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,this._swipePoint=void 0,this._swipeTouch=0,this._tapTime=0,this._tap.reset()}touchstart(r,o,h){this._swipePoint||(this._tapTime&&r.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?h.length>0&&(this._swipePoint=o[0],this._swipeTouch=h[0].identifier):this._tap.touchstart(r,o,h))}touchmove(r,o,h){if(this._tapTime){if(this._swipePoint){if(h[0].identifier!==this._swipeTouch)return;const d=o[0],f=d.y-this._swipePoint.y;return this._swipePoint=d,r.preventDefault(),this._active=!0,{zoomDelta:f/128}}}else this._tap.touchmove(r,o,h)}touchend(r,o,h){this._tapTime?this._swipePoint&&h.length===0&&this.reset():this._tap.touchend(r,o,h)&&(this._tapTime=r.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Oc{constructor(r,o,h){this._el=r,this._mousePan=o,this._touchPan=h}enable(r){this._inertiaOptions=r||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class $h{constructor(r,o,h){this._pitchWithRotate=r.pitchWithRotate,this._mouseRotate=o,this._mousePitch=h}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 Zh{constructor(r,o,h,d){this._el=r,this._touchZoom=o,this._touchRotate=h,this._tapDragZoom=d,this._rotationDisabled=!1,this._enabled=!0}enable(r){this._touchZoom.enable(r),this._rotationDisabled||this._touchRotate.enable(r),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-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()}}const $i=l=>l.zoom||l.drag||l.pitch||l.rotate;class Fc extends a.Event{}class qh{constructor(){this.constants=[1,1,.01],this.radius=0}setup(r,o){const h=a.sub([],o,r);this.radius=a.length(h[2]<0?a.div([],h,this.constants):[h[0],h[1],0])}projectRay(r){a.div(r,r,this.constants),a.normalize(r,r),a.mul$1(r,r,this.constants);const o=a.scale$2([],r,this.radius);if(o[2]>0){const h=a.scale$2([],[0,0,1],a.dot(o,[0,0,1])),d=a.scale$2([],a.normalize([],[o[0],o[1],0]),this.radius),f=a.add([],o,a.scale$2([],a.sub([],a.add([],d,h),o),2));o[0]=f[0],o[1]=f[1]}return o}}function ir(l){return l.panDelta&&l.panDelta.mag()||l.zoomDelta||l.bearingDelta||l.pitchDelta}class ur{constructor(r,o){this._map=r,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Ac(r),this._bearingSnap=o.bearingSnap,this._previousActiveHandlers={},this._trackingEllipsoid=new qh,this._dragOrigin=null,this._eventsInProgress={},this._addDefaultHandlers(o),a.bindAll(["handleEvent","handleWindowEvent"],this);const h=this._el;this._listeners=[[h,"touchstart",{passive:!0}],[h,"touchmove",{passive:!1}],[h,"touchend",void 0],[h,"touchcancel",void 0],[h,"mousedown",void 0],[h,"mousemove",void 0],[h,"mouseup",void 0],[a.window.document,"mousemove",{capture:!0}],[a.window.document,"mouseup",void 0],[h,"mouseover",void 0],[h,"mouseout",void 0],[h,"dblclick",void 0],[h,"click",void 0],[h,"keydown",{capture:!1}],[h,"keyup",void 0],[h,"wheel",{passive:!1}],[h,"contextmenu",void 0],[a.window,"blur",void 0]];for(const[d,f,g]of this._listeners)d.addEventListener(f,d===a.window.document?this.handleWindowEvent:this.handleEvent,g)}destroy(){for(const[r,o,h]of this._listeners)r.removeEventListener(o,r===a.window.document?this.handleWindowEvent:this.handleEvent,h)}_addDefaultHandlers(r){const o=this._map,h=o.getCanvasContainer();this._add("mapEvent",new nl(o,r));const d=o.boxZoom=new Ic(o,r);this._add("boxZoom",d);const f=new Nh,g=new xi;o.doubleClickZoom=new Bc(g,f),this._add("tapZoom",f),this._add("clickZoom",g);const y=new Gh;this._add("tapDragZoom",y);const v=o.touchPitch=new kc(o);this._add("touchPitch",v);const E=new al(r),T=new ll(r);o.dragRotate=new $h(r,E,T),this._add("mouseRotate",E,["mousePitch"]),this._add("mousePitch",T,["mouseRotate"]);const A=new sl(r),k=new Ks(o,r);o.dragPan=new Oc(h,A,k),this._add("mousePan",A),this._add("touchPan",k,["touchZoom","touchRotate"]);const R=new Pc,O=new zc;o.touchZoomRotate=new Zh(h,O,R,y),this._add("touchRotate",R,["touchPan","touchZoom"]),this._add("touchZoom",O,["touchPan","touchRotate"]),this._add("blockableMapEvent",new Xs(o));const B=o.scrollZoom=new Rc(o,this);this._add("scrollZoom",B,["mousePan"]);const F=o.keyboard=new jh;this._add("keyboard",F);for(const I of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])r.interactive&&r[I]&&o[I].enable(r[I])}_add(r,o,h){this._handlers.push({handlerName:r,handler:o,allowed:h}),this._handlersById[r]=o}stop(r){if(!this._updatingCamera){for(const{handler:o}of this._handlers)o.reset();this._inertia.clear(),this._fireEvents({},{},r),this._changes=[]}}isActive(){for(const{handler:r}of this._handlers)if(r.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!$i(this._eventsInProgress)||this.isZooming()}_isDragging(){return!!this._eventsInProgress.drag}_blockedByActive(r,o,h){for(const d in r)if(d!==h&&(!o||o.indexOf(d)<0))return!0;return!1}handleWindowEvent(r){this.handleEvent(r,`${r.type}Window`)}_getMapTouches(r){const o=[];for(const h of r)this._el.contains(h.target)&&o.push(h);return o}handleEvent(r,o){this._updatingCamera=!0;const h=r.type==="renderFrame",d=h?void 0:r,f={needsRenderFrame:!1},g={},y={},v=r.touches?this._getMapTouches(r.touches):void 0,E=v?hn(this._el,v):h?void 0:Ji(this._el,r);for(const{handlerName:k,handler:R,allowed:O}of this._handlers){if(!R.isEnabled())continue;let B;this._blockedByActive(y,O,k)?R.reset():R[o||r.type]&&(B=R[o||r.type](r,E,v),this.mergeHandlerResult(f,g,B,k,d),B&&B.needsRenderFrame&&this._triggerRenderFrame()),(B||R.isActive())&&(y[k]=R)}const T={};for(const k in this._previousActiveHandlers)y[k]||(T[k]=d);this._previousActiveHandlers=y,(Object.keys(T).length||ir(f))&&(this._changes.push([f,g,T]),this._triggerRenderFrame()),(Object.keys(y).length||ir(f))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:A}=f;A&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],A(this._map))}mergeHandlerResult(r,o,h,d,f){if(!h)return;a.extend(r,h);const g={handlerName:d,originalEvent:h.originalEvent||f};h.zoomDelta!==void 0&&(o.zoom=g),h.panDelta!==void 0&&(o.drag=g),h.pitchDelta!==void 0&&(o.pitch=g),h.bearingDelta!==void 0&&(o.rotate=g)}_applyChanges(){const r={},o={},h={};for(const[d,f,g]of this._changes)d.panDelta&&(r.panDelta=(r.panDelta||new a.Point(0,0))._add(d.panDelta)),d.zoomDelta&&(r.zoomDelta=(r.zoomDelta||0)+d.zoomDelta),d.bearingDelta&&(r.bearingDelta=(r.bearingDelta||0)+d.bearingDelta),d.pitchDelta&&(r.pitchDelta=(r.pitchDelta||0)+d.pitchDelta),d.around!==void 0&&(r.around=d.around),d.aroundCoord!==void 0&&(r.aroundCoord=d.aroundCoord),d.pinchAround!==void 0&&(r.pinchAround=d.pinchAround),d.noInertia&&(r.noInertia=d.noInertia),a.extend(o,f),a.extend(h,g);this._updateMapTransform(r,o,h),this._changes=[]}_updateMapTransform(r,o,h){const d=this._map,f=d.transform,g=L=>[L.x,L.y,L.z];if((L=>{const N=this._eventsInProgress.drag;return N&&!this._handlersById[N.handlerName].isActive()})()&&!ir(r)){const L=f.zoom;f.cameraElevationReference="sea",f.recenterOnTerrain(),f.cameraElevationReference="ground",L!==f.zoom&&this._map._update(!0)}if(f._isCameraConstrained&&d._stop(!0),!ir(r))return void this._fireEvents(o,h,!0);let{panDelta:y,zoomDelta:v,bearingDelta:E,pitchDelta:T,around:A,aroundCoord:k,pinchAround:R}=r;f._isCameraConstrained&&(v>0&&(v=0),f._isCameraConstrained=!1),R!==void 0&&(A=R),(v||(L=>o[L]&&!this._eventsInProgress[L])("drag"))&&A&&(this._dragOrigin=g(f.pointCoordinate3D(A)),this._trackingEllipsoid.setup(f._camera.position,this._dragOrigin)),f.cameraElevationReference="sea",d._stop(!0),A=A||d.transform.centerPoint,E&&(f.bearing+=E),T&&(f.pitch+=T),f._updateCameraState();const O=[0,0,0];if(y)if(f.projection.name==="mercator"){const L=this._trackingEllipsoid.projectRay(f.screenPointToMercatorRay(A).dir),N=this._trackingEllipsoid.projectRay(f.screenPointToMercatorRay(A.sub(y)).dir);O[0]=N[0]-L[0],O[1]=N[1]-L[1]}else{const L=f.pointCoordinate(A);if(f.projection.name==="globe"){y=y.rotate(-f.angle);const N=f._pixelsPerMercatorPixel/f.worldSize;O[0]=-y.x*a.mercatorScale(a.latFromMercatorY(L.y))*N,O[1]=-y.y*a.mercatorScale(f.center.lat)*N}else{const N=f.pointCoordinate(A.sub(y));L&&N&&(O[0]=N.x-L.x,O[1]=N.y-L.y)}}const B=f.zoom,F=[0,0,0];if(v){const L=g(k||f.pointCoordinate3D(A)),N={dir:a.normalize([],a.sub([],L,f._camera.position))};if(N.dir[2]<0){const j=f.zoomDeltaToMovement(L,v);a.scale$2(F,N.dir,j)}}const I=a.add(O,O,F);f._translateCameraConstrained(I),v&&Math.abs(f.zoom-B)>1e-4&&f.recenterOnTerrain(),f.cameraElevationReference="ground",this._map._update(),r.noInertia||this._inertia.record(r),this._fireEvents(o,h,!0)}_fireEvents(r,o,h){const d=$i(this._eventsInProgress),f=$i(r),g={};for(const T in r){const{originalEvent:A}=r[T];this._eventsInProgress[T]||(g[`${T}start`]=A),this._eventsInProgress[T]=r[T]}!d&&f&&this._fireEvent("movestart",f.originalEvent);for(const T in g)this._fireEvent(T,g[T]);f&&this._fireEvent("move",f.originalEvent);for(const T in r){const{originalEvent:A}=r[T];this._fireEvent(T,A)}const y={};let v;for(const T in this._eventsInProgress){const{handlerName:A,originalEvent:k}=this._eventsInProgress[T];this._handlersById[A].isActive()||(delete this._eventsInProgress[T],v=o[A]||k,y[`${T}end`]=v)}for(const T in y)this._fireEvent(T,y[T]);const E=$i(this._eventsInProgress);if(h&&(d||f)&&!E){this._updatingCamera=!0;const T=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),A=k=>k!==0&&-this._bearingSnap{this._frameId=void 0,this.handleEvent(new Fc("renderFrame",{timeStamp:r})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}const En="map.setFreeCameraOptions(...) and map.getFreeCameraOptions() are not yet supported for non-mercator projections.";class Ys extends a.Evented{constructor(r,o){super(),this._moving=!1,this._zooming=!1,this.transform=r,this._bearingSnap=o.bearingSnap,this._respectPrefersReducedMotion=o.respectPrefersReducedMotion!==!1,a.bindAll(["_renderFrameCallback"],this)}getCenter(){return new a.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(r,o){return this.jumpTo({center:r},o)}panBy(r,o,h){return r=a.Point.convert(r).mult(-1),this.panTo(this.transform.center,a.extend({offset:r},o),h)}panTo(r,o,h){return this.easeTo(a.extend({center:r},o),h)}getZoom(){return this.transform.zoom}setZoom(r,o){return this.jumpTo({zoom:r},o),this}zoomTo(r,o,h){return this.easeTo(a.extend({zoom:r},o),h)}zoomIn(r,o){return this.zoomTo(this.getZoom()+1,r,o),this}zoomOut(r,o){return this.zoomTo(this.getZoom()-1,r,o),this}getBearing(){return this.transform.bearing}setBearing(r,o){return this.jumpTo({bearing:r},o),this}getPadding(){return this.transform.padding}setPadding(r,o){return this.jumpTo({padding:r},o),this}rotateTo(r,o,h){return this.easeTo(a.extend({bearing:r},o),h)}resetNorth(r,o){return this.rotateTo(0,a.extend({duration:1e3},r),o),this}resetNorthPitch(r,o){return this.easeTo(a.extend({bearing:0,pitch:0,duration:1e3},r),o),this}snapToNorth(r,o){return Math.abs(this.getBearing())r.aspect?h/(2*Math.tan(.5*r.fovX)*r.aspect):d/(2*Math.tan(.5*r.fovY)*r.aspect)}_cameraForBoundsOnGlobe(r,o,h,d,f,g){const y=r.clone(),v=this._extendCameraOptions(g);y.bearing=d,y.pitch=f;const E=a.LngLat.convert(o),T=a.LngLat.convert(h),A=.5*(E.lat+T.lat),k=.5*(E.lng+T.lng),R=a.latLngToECEF(A,k),O=a.normalize([],R),B=a.normalize([],a.cross([],O,[0,1,0])),F=a.cross([],B,O),I=[B[0],B[1],B[2],0,F[0],F[1],F[2],0,O[0],O[1],O[2],0,0,0,0,1],L=[R,a.latLngToECEF(E.lat,E.lng),a.latLngToECEF(T.lat,E.lng),a.latLngToECEF(T.lat,T.lng),a.latLngToECEF(E.lat,T.lng),a.latLngToECEF(A,E.lng),a.latLngToECEF(A,T.lng),a.latLngToECEF(E.lat,k),a.latLngToECEF(T.lat,k)];let N=a.Aabb.fromPoints(L.map(ve=>[a.dot(B,ve),a.dot(F,ve),a.dot(O,ve)]));const j=a.transformMat4([],N.center,I);a.squaredLength(j)===0&&a.set(j,0,0,1),a.normalize(j,j),a.scale$2(j,j,a.GLOBE_RADIUS),y.center=a.ecefToLatLng(j);const K=y.getWorldToCameraMatrix(),J=a.invert(new Float64Array(16),K);N=a.Aabb.applyTransform(N,a.multiply([],K,I)),a.transformMat4(j,j,K);const Y=.5*(N.max[2]-N.min[2]),ie=this._minimumAABBFrustumDistance(y,N),te=a.scale$2([],[0,0,1],Y),le=a.add(te,j,te),Te=ie+(y.pitch===0?0:a.distance(j,le)),oe=y.globeCenterInViewSpace,ge=a.sub([],j,[oe[0],oe[1],oe[2]]);a.normalize(ge,ge),a.scale$2(ge,ge,Te);const he=a.add([],j,ge);a.transformMat4(he,he,J);const we=a.earthRadius/a.GLOBE_RADIUS,ae=a.length(he),_e=a.mercatorZfromAltitude(Math.max(ae*we-a.earthRadius,Number.EPSILON),0),Me=Math.min(y.zoomFromMercatorZAdjusted(_e),v.maxZoom);return Me>.5*(a.GLOBE_ZOOM_THRESHOLD_MIN+a.GLOBE_ZOOM_THRESHOLD_MAX)?(y.setProjection({name:"mercator"}),y.zoom=Me,this._cameraForBounds(y,o,h,d,f,g)):{center:y.center,zoom:Me,bearing:d,pitch:f}}queryTerrainElevation(r,o){const h=this.transform.elevation;return h?(o=a.extend({},{exaggerated:!0},o),h.getAtPoint(a.MercatorCoordinate.fromLngLat(r),null,o.exaggerated)):null}_cameraForBounds(r,o,h,d,f,g){if(r.projection.name==="globe")return this._cameraForBoundsOnGlobe(r,o,h,d,f,g);const y=r.clone(),v=this._extendCameraOptions(g),E=y.padding;y.bearing=d,y.pitch=f;const T=a.LngLat.convert(o),A=a.LngLat.convert(h),k=new a.LngLat(T.lng,A.lat),R=new a.LngLat(A.lng,T.lat),O=y.project(T),B=y.project(A),F=this.queryTerrainElevation(T),I=this.queryTerrainElevation(A),L=this.queryTerrainElevation(k),N=this.queryTerrainElevation(R),j=[[O.x,O.y,Math.min(F||0,I||0,L||0,N||0)],[B.x,B.y,Math.max(F||0,I||0,L||0,N||0)]];let K=a.Aabb.fromPoints(j);const J=y.getWorldToCameraMatrix(),Y=a.invert(new Float64Array(16),J);K=a.Aabb.applyTransform(K,J);const ie=a.sub([],K.max,K.min),te=E.left||0,le=E.right||0,Te=E.bottom||0,oe=E.top||0,{left:ge,right:he,top:we,bottom:ae}=v.padding,_e=.5*(te+le),Me=.5*(oe+Te),ve=Math.min(y.scaleZoom(y.scale*Math.min((y.width-(te+le+ge+he))/ie[0],(y.height-(Te+oe+ae+we))/ie[1])),v.maxZoom),Ae=y.scale/y.zoomScale(ve);K=new a.Aabb([K.min[0]-(ge+_e)*Ae,K.min[1]-(ae+Me)*Ae,K.min[2]],[K.max[0]+(he+_e)*Ae,K.max[1]+(we+Me)*Ae,K.max[2]]);const Ge=.5*ie[2],Xe=this._minimumAABBFrustumDistance(y,K),Ve=[0,0,1,0];a.transformMat4$1(Ve,Ve,J),a.normalize$2(Ve,Ve);const qe=a.scale$2([],Ve,Xe+Ge),lt=a.add([],K.center,qe),ot=(typeof v.offset.x=="number"&&typeof v.offset.y=="number"?new a.Point(v.offset.x,v.offset.y):a.Point.convert(v.offset)).rotate(-a.degToRad(d));K.center[0]-=ot.x*Ae,K.center[1]+=ot.y*Ae,a.transformMat4(K.center,K.center,Y),a.transformMat4(lt,lt,Y);const je=[K.center[0],K.center[1],lt[2]*y.pixelsPerMeter];a.scale$2(je,je,1/y.worldSize);const wt=a.lngFromMercatorX(je[0]),Tt=a.latFromMercatorY(je[1]),Et=Math.min(y._zoomFromMercatorZ(je[2]),v.maxZoom),St=new a.LngLat(wt,Tt);return y.mercatorFromTransition&&Et<.5*(a.GLOBE_ZOOM_THRESHOLD_MIN+a.GLOBE_ZOOM_THRESHOLD_MAX)?(y.setProjection({name:"globe"}),y.zoom=Et,this._cameraForBounds(y,o,h,d,f,g)):{center:St,zoom:Et,bearing:d,pitch:f}}fitBounds(r,o,h){const d=this.cameraForBounds(r,o);return this._fitInternal(d,o,h)}fitScreenCoordinates(r,o,h,d,f){const g=a.Point.convert(r),y=a.Point.convert(o),v=new a.Point(Math.min(g.x,y.x),Math.min(g.y,y.y)),E=new a.Point(Math.max(g.x,y.x),Math.max(g.y,y.y));if(this.transform.projection.name==="mercator"&&this.transform.anyCornerOffEdge(g,y))return this;const T=this.transform.pointLocation3D(v),A=this.transform.pointLocation3D(E),k=this.transform.pointLocation3D(new a.Point(v.x,E.y)),R=this.transform.pointLocation3D(new a.Point(E.x,v.y)),O=[Math.min(T.lng,A.lng,k.lng,R.lng),Math.min(T.lat,A.lat,k.lat,R.lat)],B=[Math.max(T.lng,A.lng,k.lng,R.lng),Math.max(T.lat,A.lat,k.lat,R.lat)],F=d&&d.pitch?d.pitch:this.getPitch(),I=this._cameraForBounds(this.transform,O,B,h,F,d);return this._fitInternal(I,d,f)}_fitInternal(r,o,h){return r?(delete(o=a.extend(r,o)).padding,o.linear?this.easeTo(o,h):this.flyTo(o,h)):this}jumpTo(r,o){this.stop();const h=r.preloadOnly?this.transform.clone():this.transform;let d=!1,f=!1,g=!1;return"zoom"in r&&h.zoom!==+r.zoom&&(d=!0,h.zoom=+r.zoom),r.center!==void 0&&(h.center=a.LngLat.convert(r.center)),"bearing"in r&&h.bearing!==+r.bearing&&(f=!0,h.bearing=+r.bearing),"pitch"in r&&h.pitch!==+r.pitch&&(g=!0,h.pitch=+r.pitch),r.padding==null||h.isPaddingEqual(r.padding)||(h.padding=r.padding),r.preloadOnly?(this._preloadTiles(h),this):(this.fire(new a.Event("movestart",o)).fire(new a.Event("move",o)),d&&this.fire(new a.Event("zoomstart",o)).fire(new a.Event("zoom",o)).fire(new a.Event("zoomend",o)),f&&this.fire(new a.Event("rotatestart",o)).fire(new a.Event("rotate",o)).fire(new a.Event("rotateend",o)),g&&this.fire(new a.Event("pitchstart",o)).fire(new a.Event("pitch",o)).fire(new a.Event("pitchend",o)),this.fire(new a.Event("moveend",o)))}getFreeCameraOptions(){return this.transform.projection.supportsFreeCamera||a.warnOnce(En),this.transform.getFreeCameraOptions()}setFreeCameraOptions(r,o){const h=this.transform;if(!h.projection.supportsFreeCamera)return a.warnOnce(En),this;this.stop();const d=h.zoom,f=h.pitch,g=h.bearing;h.setFreeCameraOptions(r);const y=d!==h.zoom,v=f!==h.pitch,E=g!==h.bearing;return this.fire(new a.Event("movestart",o)).fire(new a.Event("move",o)),y&&this.fire(new a.Event("zoomstart",o)).fire(new a.Event("zoom",o)).fire(new a.Event("zoomend",o)),E&&this.fire(new a.Event("rotatestart",o)).fire(new a.Event("rotate",o)).fire(new a.Event("rotateend",o)),v&&this.fire(new a.Event("pitchstart",o)).fire(new a.Event("pitch",o)).fire(new a.Event("pitchend",o)),this.fire(new a.Event("moveend",o)),this}easeTo(r,o){this._stop(!1,r.easeId),((r=a.extend({offset:[0,0],duration:500,easing:a.ease},r)).animate===!1||this._prefersReducedMotion(r))&&(r.duration=0);const h=this.transform,d=this.getZoom(),f=this.getBearing(),g=this.getPitch(),y=this.getPadding(),v="zoom"in r?+r.zoom:d,E="bearing"in r?this._normalizeBearing(r.bearing,f):f,T="pitch"in r?+r.pitch:g,A="padding"in r?r.padding:h.padding,k=a.Point.convert(r.offset);let R,O,B;if(h.projection.name==="globe"){const te=a.MercatorCoordinate.fromLngLat(h.center),le=k.rotate(-h.angle);te.x+=le.x/h.worldSize,te.y+=le.y/h.worldSize;const Te=te.toLngLat(),oe=a.LngLat.convert(r.center||Te);this._normalizeCenter(oe),R=h.centerPoint.add(le),O=new a.Point(te.x,te.y).mult(h.worldSize),B=new a.Point(a.mercatorXfromLng(oe.lng),a.mercatorYfromLat(oe.lat)).mult(h.worldSize).sub(O)}else{R=h.centerPoint.add(k);const te=h.pointLocation(R),le=a.LngLat.convert(r.center||te);this._normalizeCenter(le),O=h.project(te),B=h.project(le).sub(O)}const F=h.zoomScale(v-d);let I,L;r.around&&(I=a.LngLat.convert(r.around),L=h.locationPoint(I));const N=this._zooming||v!==d,j=this._rotating||f!==E,K=this._pitching||T!==g,J=!h.isPaddingEqual(A),Y=te=>le=>{if(N&&(te.zoom=a.number(d,v,le)),j&&(te.bearing=a.number(f,E,le)),K&&(te.pitch=a.number(g,T,le)),J&&(te.interpolatePadding(y,A,le),R=te.centerPoint.add(k)),I)te.setLocationAtPoint(I,L);else{const Te=te.zoomScale(te.zoom-d),oe=v>d?Math.min(2,F):Math.max(.5,F),ge=Math.pow(oe,1-le),he=te.unproject(O.add(B.mult(le*ge)).mult(Te));te.setLocationAtPoint(te.renderWorldCopies?he.wrap():he,R)}return r.preloadOnly||this._fireMoveEvents(o),te};if(r.preloadOnly){const te=this._emulate(Y,r.duration,h);return this._preloadTiles(te),this}const ie={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=N,this._rotating=j,this._pitching=K,this._padding=J,this._easeId=r.easeId,this._prepareEase(o,r.noMoveStart,ie),this._ease(Y(h),te=>{h.recenterOnTerrain(),this._afterEase(o,te)},r),this}_prepareEase(r,o,h={}){this._moving=!0,this.transform.cameraElevationReference="sea",o||h.moving||this.fire(new a.Event("movestart",r)),this._zooming&&!h.zooming&&this.fire(new a.Event("zoomstart",r)),this._rotating&&!h.rotating&&this.fire(new a.Event("rotatestart",r)),this._pitching&&!h.pitching&&this.fire(new a.Event("pitchstart",r))}_fireMoveEvents(r){this.fire(new a.Event("move",r)),this._zooming&&this.fire(new a.Event("zoom",r)),this._rotating&&this.fire(new a.Event("rotate",r)),this._pitching&&this.fire(new a.Event("pitch",r))}_afterEase(r,o){if(this._easeId&&o&&this._easeId===o)return;this._easeId=void 0,this.transform.cameraElevationReference="ground";const h=this._zooming,d=this._rotating,f=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,h&&this.fire(new a.Event("zoomend",r)),d&&this.fire(new a.Event("rotateend",r)),f&&this.fire(new a.Event("pitchend",r)),this.fire(new a.Event("moveend",r))}flyTo(r,o){if(this._prefersReducedMotion(r)){const ve=a.pick(r,["center","zoom","bearing","pitch","around"]);return this.jumpTo(ve,o)}this.stop(),r=a.extend({offset:[0,0],speed:1.2,curve:1.42,easing:a.ease},r);const h=this.transform,d=this.getZoom(),f=this.getBearing(),g=this.getPitch(),y=this.getPadding(),v="zoom"in r?a.clamp(+r.zoom,h.minZoom,h.maxZoom):d,E="bearing"in r?this._normalizeBearing(r.bearing,f):f,T="pitch"in r?+r.pitch:g,A="padding"in r?r.padding:h.padding,k=h.zoomScale(v-d),R=a.Point.convert(r.offset);let O=h.centerPoint.add(R);const B=h.pointLocation(O),F=a.LngLat.convert(r.center||B);this._normalizeCenter(F);const I=h.project(B),L=h.project(F).sub(I);let N=r.curve;const j=Math.max(h.width,h.height),K=j/k,J=L.mag();if("minZoom"in r){const ve=a.clamp(Math.min(r.minZoom,d,v),h.minZoom,h.maxZoom),Ae=j/h.zoomScale(ve-d);N=Math.sqrt(Ae/J*2)}const Y=N*N;function ie(ve){const Ae=(K*K-j*j+(ve?-1:1)*Y*Y*J*J)/(2*(ve?K:j)*Y*J);return Math.log(Math.sqrt(Ae*Ae+1)-Ae)}function te(ve){return(Math.exp(ve)-Math.exp(-ve))/2}function le(ve){return(Math.exp(ve)+Math.exp(-ve))/2}const Te=ie(0);let oe=function(ve){return le(Te)/le(Te+N*ve)},ge=function(ve){return j*((le(Te)*(te(Ae=Te+N*ve)/le(Ae))-te(Te))/Y)/J;var Ae},he=(ie(1)-Te)/N;if(Math.abs(J)<1e-6||!isFinite(he)){if(Math.abs(j-K)<1e-6)return this.easeTo(r,o);const ve=Kr.maxDuration&&(r.duration=0);const we=f!==E,ae=T!==g,_e=!h.isPaddingEqual(A),Me=ve=>Ae=>{const Ge=Ae*he,Xe=1/oe(Ge);ve.zoom=Ae===1?v:d+ve.scaleZoom(Xe),we&&(ve.bearing=a.number(f,E,Ae)),ae&&(ve.pitch=a.number(g,T,Ae)),_e&&(ve.interpolatePadding(y,A,Ae),O=ve.centerPoint.add(R));const Ve=Ae===1?F:ve.unproject(I.add(L.mult(ge(Ge))).mult(Xe));return ve.setLocationAtPoint(ve.renderWorldCopies?Ve.wrap():Ve,O),ve._updateCameraOnTerrain(),r.preloadOnly||this._fireMoveEvents(o),ve};if(r.preloadOnly){const ve=this._emulate(Me,r.duration,h);return this._preloadTiles(ve),this}return this._zooming=!0,this._rotating=we,this._pitching=ae,this._padding=_e,this._prepareEase(o,!1),this._ease(Me(h),()=>this._afterEase(o),r),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(r,o){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),this._easeFrameId=void 0,this._onEaseFrame=void 0),this._onEaseEnd){const h=this._onEaseEnd;this._onEaseEnd=void 0,h.call(this,o)}if(!r){const h=this.handlers;h&&h.stop(!1)}return this}_ease(r,o,h){h.animate===!1||h.duration===0?(r(1),o()):(this._easeStart=a.exported.now(),this._easeOptions=h,this._onEaseFrame=r,this._onEaseEnd=o,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const r=Math.min((a.exported.now()-this._easeStart)/this._easeOptions.duration,1),o=this._onEaseFrame;o&&o(this._easeOptions.easing(r)),r<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(r,o){r=a.wrap(r,-180,180);const h=Math.abs(r-o);return Math.abs(r-360-o)180?-360:h<-180?360:0}_prefersReducedMotion(r){return this._respectPrefersReducedMotion&&a.exported.prefersReducedMotion&&!(r&&r.essential)}_emulate(r,o,h){const d=Math.ceil(15*o/1e3),f=[],g=r(h.clone());for(let y=0;y<=d;y++){const v=g(y/d);f.push(v.clone())}return f}}class Ue{constructor(r={}){this.options=r,a.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)}getDefaultPosition(){return"bottom-right"}onAdd(r){const o=this.options&&this.options.compact;return this._map=r,this._container=ht("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=ht("button","mapboxgl-ctrl-attrib-button",this._container),ht("span","mapboxgl-ctrl-icon",this._compactButton).setAttribute("aria-hidden","true"),this._compactButton.type="button",this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=ht("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),o&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),o===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0}_setElementTitle(r,o){const h=this._map._getUIString(`AttributionControl.${o}`);r.setAttribute("aria-label",h),r.removeAttribute("title"),r.firstElementChild&&r.firstElementChild.setAttribute("title",h)}_toggleAttribution(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","true"))}_updateEditLink(){let r=this._editLink;r||(r=this._editLink=this._container.querySelector(".mapbox-improve-map"));const o=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||a.config.ACCESS_TOKEN}];if(r){const h=o.reduce((d,f,g)=>(f.value&&(d+=`${f.key}=${f.value}${gd.length-f.length),r=r.filter((d,f)=>{for(let g=f+1;g=0)return!1;return!0}),this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?r=[...this.options.customAttribution,...r]:r.unshift(this.options.customAttribution));const h=r.join(" | ");h!==this._attribHTML&&(this._attribHTML=h,r.length?(this._innerContainer.innerHTML=h,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")}}class dl{constructor(){a.bindAll(["_updateLogo","_updateCompact"],this)}onAdd(r){this._map=r,this._container=ht("div","mapboxgl-ctrl");const o=ht("a","mapboxgl-ctrl-logo");return o.target="_blank",o.rel="noopener nofollow",o.href="https://www.mapbox.com/",o.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),o.setAttribute("rel","noopener nofollow"),this._container.appendChild(o),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)}getDefaultPosition(){return"bottom-left"}_updateLogo(r){r&&r.sourceDataType!=="metadata"||(this._container.style.display=this._logoRequired()?"block":"none")}_logoRequired(){if(!this._map.style)return!0;const r=this._map.style._sourceCaches;if(Object.entries(r).length===0)return!0;for(const o in r){const h=r[o].getSource();if(h.hasOwnProperty("mapbox_logo")&&!h.mapbox_logo)return!1}return!0}_updateCompact(){const r=this._container.children;if(r.length){const o=r[0];this._map.getCanvasContainer().offsetWidth<250?o.classList.add("mapboxgl-compact"):o.classList.remove("mapboxgl-compact")}}}class pl{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(r){const o=++this._id;return this._queue.push({callback:r,id:o,cancelled:!1}),o}remove(r){const o=this._currentlyRunning,h=o?this._queue.concat(o):this._queue;for(const d of h)if(d.id===r)return void(d.cancelled=!0)}run(r=0){const o=this._currentlyRunning=this._queue;this._queue=[];for(const h of o)if(!h.cancelled&&(h.callback(r),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}function lo(l,r,o){if(l=new a.LngLat(l.lng,l.lat),r){const h=new a.LngLat(l.lng-360,l.lat),d=new a.LngLat(l.lng+360,l.lat),f=360*Math.ceil(Math.abs(l.lng-o.center.lng)/360),g=o.locationPoint(l).distSqr(r),y=r.x<0||r.y<0||r.x>o.width||r.y>o.height;o.locationPoint(h).distSqr(r)180;){const h=o.locationPoint(l);if(h.x>=0&&h.y>=0&&h.x<=o.width&&h.y<=o.height)break;l.lng>o.center.lng?l.lng-=360:l.lng+=360}return l}const Sn={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%)"};class Be extends a.Evented{constructor(r,o){if(super(),(r instanceof a.window.HTMLElement||o)&&(r=a.extend({element:r},o)),a.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress","_clearFadeTimer"],this),this._anchor=r&&r.anchor||"center",this._color=r&&r.color||"#3FB1CE",this._scale=r&&r.scale||1,this._draggable=r&&r.draggable||!1,this._clickTolerance=r&&r.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=r&&r.rotation||0,this._rotationAlignment=r&&r.rotationAlignment||"auto",this._pitchAlignment=r&&r.pitchAlignment&&r.pitchAlignment||"auto",this._updateMoving=()=>this._update(!0),this._occludedOpacity=r&&r.occludedOpacity||.2,r&&r.element)this._element=r.element,this._offset=a.Point.convert(r&&r.offset||[0,0]);else{this._defaultMarker=!0,this._element=ht("div");const d=41,f=27,g=gi("svg",{display:"block",height:d*this._scale+"px",width:f*this._scale+"px",viewBox:`0 0 ${f} ${d}`},this._element),y=gi("radialGradient",{id:"shadowGradient"},gi("defs",{},g));gi("stop",{offset:"10%","stop-opacity":.4},y),gi("stop",{offset:"100%","stop-opacity":.05},y),gi("ellipse",{cx:13.5,cy:34.8,rx:10.5,ry:5.25,fill:"url(#shadowGradient)"},g),gi("path",{fill:this._color,d:"M27,13.5C27,19.07 20.25,27 14.75,34.5C14.02,35.5 12.98,35.5 12.25,34.5C6.75,27 0,19.22 0,13.5C0,6.04 6.04,0 13.5,0C20.96,0 27,6.04 27,13.5Z"},g),gi("path",{opacity:.25,d:"M13.5,0C6.04,0 0,6.04 0,13.5C0,19.22 6.75,27 12.25,34.5C13,35.52 14.02,35.5 14.75,34.5C20.25,27 27,19.07 27,13.5C27,6.04 20.96,0 13.5,0ZM13.5,1C20.42,1 26,6.58 26,13.5C26,15.9 24.5,19.18 22.22,22.74C19.95,26.3 16.71,30.14 13.94,33.91C13.74,34.18 13.61,34.32 13.5,34.44C13.39,34.32 13.26,34.18 13.06,33.91C10.28,30.13 7.41,26.31 5.02,22.77C2.62,19.23 1,15.95 1,13.5C1,6.58 6.58,1 13.5,1Z"},g),gi("circle",{fill:"white",cx:13.5,cy:13.5,r:5.5},g),this._offset=a.Point.convert(r&&r.offset||[0,-14])}this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label","Map marker"),this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",d=>{d.preventDefault()}),this._element.addEventListener("mousedown",d=>{d.preventDefault()});const h=this._element.classList;for(const d in Sn)h.remove(`mapboxgl-marker-anchor-${d}`);h.add(`mapboxgl-marker-anchor-${this._anchor}`),this._popup=null}addTo(r){return r===this._map||(this.remove(),this._map=r,r.getCanvasContainer().appendChild(this._element),r.on("move",this._updateMoving),r.on("moveend",this._update),r.on("remove",this._clearFadeTimer),r._addMarker(this),this.setDraggable(this._draggable),this._update(),r.on("click",this._onMapClick)),this}remove(){const r=this._map;return r&&(r.off("click",this._onMapClick),r.off("move",this._updateMoving),r.off("moveend",this._update),r.off("mousedown",this._addDragHandler),r.off("touchstart",this._addDragHandler),r.off("mouseup",this._onUp),r.off("touchend",this._onUp),r.off("mousemove",this._onMove),r.off("touchmove",this._onMove),r.off("remove",this._clearFadeTimer),r._removeMarker(this),this._map=void 0),this._clearFadeTimer(),this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(r){return this._lngLat=a.LngLat.convert(r),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(!0),this}getElement(){return this._element}setPopup(r){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeAttribute("role"),this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),r){if(!("offset"in r.options)){const d=Math.sqrt(Math.pow(13.5,2)/2);r.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[d,-1*(38.1-13.5+d)],"bottom-right":[-d,-1*(38.1-13.5+d)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=r,r._marker=this,this._lngLat&&this._popup.setLngLat(this._lngLat),this._element.setAttribute("role","button"),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress),this._element.setAttribute("aria-expanded","false")}return this}_onKeyPress(r){const o=r.code,h=r.charCode||r.keyCode;o!=="Space"&&o!=="Enter"&&h!==32&&h!==13||this.togglePopup()}_onMapClick(r){const o=r.originalEvent.target,h=this._element;this._popup&&(o===h||h.contains(o))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const r=this._popup;return r?(r.isOpen()?(r.remove(),this._element.setAttribute("aria-expanded","false")):this._map&&(r.addTo(this._map),this._element.setAttribute("aria-expanded","true")),this):this}_behindTerrain(){const r=this._map,o=this._pos;if(!r||!o)return!1;const h=r.unproject(o),d=r.getFreeCameraOptions();if(!d.position)return!1;const f=d.position.toLngLat();return f.distanceTo(h)<.9*f.distanceTo(this._lngLat)}_evaluateOpacity(){const r=this._map;if(!r)return;const o=this._pos;if(!o||o.x<0||o.x>r.transform.width||o.y<0||o.y>r.transform.height)return void this._clearFadeTimer();const h=r.unproject(o);let d;r._showingGlobe()&&a.isLngLatBehindGlobe(r.transform,this._lngLat)?d=0:(d=1-r._queryFogOpacity(h),r.transform._terrainEnabled()&&r.getTerrain()&&this._behindTerrain()&&(d*=this._occludedOpacity)),this._element.style.opacity=`${d}`,this._element.style.pointerEvents=d>0?"auto":"none",this._popup&&this._popup._setOpacity(d),this._fadeTimer=null}_clearFadeTimer(){this._fadeTimer&&(clearTimeout(this._fadeTimer),this._fadeTimer=null)}_updateDOM(){const r=this._pos;if(!r||!this._map)return;const o=this._offset.mult(this._scale);this._element.style.transform=` - translate(${r.x}px,${r.y}px) - ${Sn[this._anchor]} - ${this._calculateXYTransform()} ${this._calculateZTransform()} - translate(${o.x}px,${o.y}px) - `}_calculateXYTransform(){const r=this._pos,o=this._map,h=this.getPitchAlignment();if(!o||!r||h!=="map")return"";if(!o._showingGlobe()){const v=o.getPitch();return v?`rotateX(${v}deg)`:""}const d=a.radToDeg(a.globeTiltAtLngLat(o.transform,this._lngLat)),f=r.sub(a.globeCenterToScreenPoint(o.transform)),g=Math.abs(f.x)+Math.abs(f.y);if(g===0)return"";const y=d/g;return`rotateX(${-f.y*y}deg) rotateY(${f.x*y}deg)`}_calculateZTransform(){const r=this._pos,o=this._map;if(!o||!r)return"";let h=0;const d=this.getRotationAlignment();if(d==="map")if(o._showingGlobe()){const f=o.project(new a.LngLat(this._lngLat.lng,this._lngLat.lat+.001)),g=o.project(new a.LngLat(this._lngLat.lng,this._lngLat.lat-.001)).sub(f);h=a.radToDeg(Math.atan2(g.y,g.x))-90}else h=-o.getBearing();else if(d==="horizon"){const f=a.smoothstep(4,6,o.getZoom()),g=a.globeCenterToScreenPoint(o.transform);g.y+=f*o.transform.height;const y=r.sub(g),v=a.radToDeg(Math.atan2(y.y,y.x));h=(v>90?v-270:v+90)*(1-f)}return h+=this._rotation,h?`rotateZ(${h}deg)`:""}_update(r){a.window.cancelAnimationFrame(this._updateFrameId);const o=this._map;o&&(o.transform.renderWorldCopies&&(this._lngLat=lo(this._lngLat,this._pos,o.transform)),this._pos=o.project(this._lngLat),r===!0?this._updateFrameId=a.window.requestAnimationFrame(()=>{this._element&&this._pos&&this._anchor&&(this._pos=this._pos.round(),this._updateDOM())}):this._pos=this._pos.round(),o._requestDomTask(()=>{this._map&&(this._element&&this._pos&&this._anchor&&this._updateDOM(),(o._showingGlobe()||o.getTerrain()||o.getFog())&&!this._fadeTimer&&(this._fadeTimer=setTimeout(this._evaluateOpacity.bind(this),60)))}))}getOffset(){return this._offset}setOffset(r){return this._offset=a.Point.convert(r),this._update(),this}_onMove(r){const o=this._map;if(!o)return;const h=this._pointerdownPos,d=this._positionDelta;if(h&&d){if(!this._isDragging){const f=this._clickTolerance||o._clickTolerance;if(r.point.dist(h)=this._endTime)return this._end;const o=a.easeCubicInOut((r-this._startTime)/(this._endTime-this._startTime));return this._start*(1-o)+this._end*o}isEasing(r){return r>=this._startTime&&r<=this._endTime}jumpTo(r){this._startTime=-1/0,this._endTime=-1/0,this._start=r,this._end=r}easeTo(r,o,h){this._start=this.getValue(o),this._end=r,this._startTime=o,this._endTime=o+h}}const Vc={"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":"Mapbox logo","Map.Title":"Map","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScrollZoomBlocker.CtrlMessage":"Use ctrl + scroll to zoom the map","ScrollZoomBlocker.CmdMessage":"Use ⌘ + scroll to zoom the map","TouchPanBlocker.Message":"Use two fingers to move the map"},Nc={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:85,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,performanceMetricsCollection:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,optimizeForTerrain:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,minTileCacheSize:null,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",localFontFamily:null,transformRequest:null,accessToken:null,fadeDuration:300,respectPrefersReducedMotion:!0,crossSourceCollisions:!0},Xh={showCompass:!0,showZoom:!0,visualizePitch:!1};class Hh{constructor(r,o,h=!1){this._clickTolerance=10,this.element=o,this.mouseRotate=new al({clickTolerance:r.dragRotate._mouseRotate._clickTolerance}),this.map=r,h&&(this.mousePitch=new ll({clickTolerance:r.dragRotate._mousePitch._clickTolerance})),a.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),o.addEventListener("mousedown",this.mousedown),o.addEventListener("touchstart",this.touchstart,{passive:!1}),o.addEventListener("touchmove",this.touchmove),o.addEventListener("touchend",this.touchend),o.addEventListener("touchcancel",this.reset)}down(r,o){this.mouseRotate.mousedown(r,o),this.mousePitch&&this.mousePitch.mousedown(r,o),To()}move(r,o){const h=this.map,d=this.mouseRotate.mousemoveWindow(r,o),f=d&&d.bearingDelta;if(f&&h.setBearing(h.getBearing()+f),this.mousePitch){const g=this.mousePitch.mousemoveWindow(r,o),y=g&&g.pitchDelta;y&&h.setPitch(h.getPitch()+y)}}off(){const r=this.element;r.removeEventListener("mousedown",this.mousedown),r.removeEventListener("touchstart",this.touchstart,{passive:!1}),r.removeEventListener("touchmove",this.touchmove),r.removeEventListener("touchend",this.touchend),r.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){Rn(),a.window.removeEventListener("mousemove",this.mousemove),a.window.removeEventListener("mouseup",this.mouseup)}mousedown(r){this.down(a.extend({},r,{ctrlKey:!0,preventDefault:()=>r.preventDefault()}),Ji(this.element,r)),a.window.addEventListener("mousemove",this.mousemove),a.window.addEventListener("mouseup",this.mouseup)}mousemove(r){this.move(r,Ji(this.element,r))}mouseup(r){this.mouseRotate.mouseupWindow(r),this.mousePitch&&this.mousePitch.mouseupWindow(r),this.offTemp()}touchstart(r){r.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=hn(this.element,r.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>r.preventDefault()},this._startPos))}touchmove(r){r.targetTouches.length!==1?this.reset():(this._lastPos=hn(this.element,r.targetTouches)[0],this.move({preventDefault:()=>r.preventDefault()},this._lastPos))}touchend(r){r.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)l.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(l.minPitch!=null&&l.maxPitch!=null&&l.minPitch>l.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(l.minPitch!=null&&l.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(l.maxPitch!=null&&l.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(l.antialias&&a.isSafariWithAntialiasingBug(a.window)&&(l.antialias=!1,a.warnOnce("Antialiasing is disabled for this WebGL context to avoid browser bug: https://github.com/mapbox/mapbox-gl-js/issues/11609")),super(new no(l.minZoom,l.maxZoom,l.minPitch,l.maxPitch,l.renderWorldCopies),l),this._interactive=l.interactive,this._minTileCacheSize=l.minTileCacheSize,this._maxTileCacheSize=l.maxTileCacheSize,this._failIfMajorPerformanceCaveat=l.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=l.preserveDrawingBuffer,this._antialias=l.antialias,this._useWebGL2=l.useWebGL2,this._trackResize=l.trackResize,this._bearingSnap=l.bearingSnap,this._refreshExpiredTiles=l.refreshExpiredTiles,this._fadeDuration=l.fadeDuration,this._isInitialLoad=!0,this._crossSourceCollisions=l.crossSourceCollisions,this._collectResourceTiming=l.collectResourceTiming,this._optimizeForTerrain=l.optimizeForTerrain,this._language=this._parseLanguage(l.language),this._worldview=l.worldview,this._renderTaskQueue=new pl,this._domRenderTaskQueue=new pl,this._controls=[],this._markers=[],this._popups=[],this._mapId=a.uniqueId(),this._locale=a.extend({},Vc,l.locale),this._clickTolerance=l.clickTolerance,this._cooperativeGestures=l.cooperativeGestures,this._performanceMetricsCollection=l.performanceMetricsCollection,this._containerWidth=0,this._containerHeight=0,this._averageElevationLastSampledAt=-1/0,this._averageElevationExaggeration=0,this._averageElevation=new ml(0),this._interactionRange=[1/0,-1/0],this._visibilityHidden=0,this._useExplicitProjection=!1,this._requestManager=new a.RequestManager(l.transformRequest,l.accessToken,l.testMode),this._silenceAuthErrors=!!l.testMode,typeof l.container=="string"){if(this._container=a.window.document.getElementById(l.container),!this._container)throw new Error(`Container '${l.container}' not found.`)}else{if(!(l.container instanceof a.window.HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=l.container}if(this._container.childNodes.length>0&&a.warnOnce("The map container element should be empty, otherwise the map's interactivity will be negatively impacted. If you want to display a message when WebGL is not supported, use the Mapbox GL Supported plugin instead."),l.maxBounds&&this.setMaxBounds(l.maxBounds),a.bindAll(["_onWindowOnline","_onWindowResize","_onVisibilityChange","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),a.window!==void 0&&(a.window.addEventListener("online",this._onWindowOnline,!1),a.window.addEventListener("resize",this._onWindowResize,!1),a.window.addEventListener("orientationchange",this._onWindowResize,!1),a.window.addEventListener("webkitfullscreenchange",this._onWindowResize,!1),a.window.addEventListener("visibilitychange",this._onVisibilityChange,!1)),this.handlers=new ur(this,l),this._localFontFamily=l.localFontFamily,this._localIdeographFontFamily=l.localIdeographFontFamily,l.style&&this.setStyle(l.style,{localFontFamily:this._localFontFamily,localIdeographFontFamily:this._localIdeographFontFamily}),l.projection&&this.setProjection(l.projection),this._hash=l.hash&&new rl(typeof l.hash=="string"&&l.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:l.center,zoom:l.zoom,bearing:l.bearing,pitch:l.pitch}),l.bounds&&(this.resize(),this.fitBounds(l.bounds,a.extend({},l.fitBoundsOptions,{duration:0})))),this.resize(),l.attributionControl&&this.addControl(new Ue({customAttribution:l.customAttribution})),this._logoControl=new dl,this.addControl(this._logoControl,l.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",r=>{this._update(r.dataType==="style"),this.fire(new a.Event(`${r.dataType}data`,r))}),this.on("dataloading",r=>{this.fire(new a.Event(`${r.dataType}dataloading`,r))})}_getMapId(){return this._mapId}addControl(l,r){if(r===void 0&&(r=l.getDefaultPosition?l.getDefaultPosition():"top-right"),!l||!l.onAdd)return this.fire(new a.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const o=l.onAdd(this);this._controls.push(l);const h=this._controlPositions[r];return r.indexOf("bottom")!==-1?h.insertBefore(o,h.firstChild):h.appendChild(o),this}removeControl(l){if(!l||!l.onRemove)return this.fire(new a.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const r=this._controls.indexOf(l);return r>-1&&this._controls.splice(r,1),l.onRemove(this),this}hasControl(l){return this._controls.indexOf(l)>-1}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}resize(l){if(this._updateContainerDimensions(),this._containerWidth===this.transform.width&&this._containerHeight===this.transform.height)return this;this._resizeCanvas(this._containerWidth,this._containerHeight),this.transform.resize(this._containerWidth,this._containerHeight),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight));const r=!this._moving;return r&&this.fire(new a.Event("movestart",l)).fire(new a.Event("move",l)),this.fire(new a.Event("resize",l)),r&&this.fire(new a.Event("moveend",l)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()||null}setMaxBounds(l){return this.transform.setMaxBounds(a.LngLatBounds.convert(l)),this._update()}setMinZoom(l){if((l=l??-2)>=-2&&l<=this.transform.maxZoom)return this.transform.minZoom=l,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=l,this._update(),this.getZoom()>l?this.setZoom(l):this.fire(new a.Event("zoomstart")).fire(new a.Event("zoom")).fire(new a.Event("zoomend")),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(l){if((l=l??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(l>=0&&l<=this.transform.maxPitch)return this.transform.minPitch=l,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(l>=this.transform.minPitch)return this.transform.maxPitch=l,this._update(),this.getPitch()>l?this.setPitch(l):this.fire(new a.Event("pitchstart")).fire(new a.Event("pitch")).fire(new a.Event("pitchend")),this;throw new Error("maxPitch must be greater than or equal to minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(l){return this.transform.renderWorldCopies=l,this.transform.renderWorldCopies||this._forceMarkerAndPopupUpdate(!0),this._update()}getLanguage(){return this._language}_parseLanguage(l){return l==="auto"?a.window.navigator.language:Array.isArray(l)?l.length===0?void 0:l.map(r=>r==="auto"?a.window.navigator.language:r):l}setLanguage(l){const r=this._parseLanguage(l);if(!this.style||r===this._language)return this;this._language=r,this.style._reloadSources();for(const o of this._controls)o._setLanguage&&o._setLanguage(this._language);return this}getWorldview(){return this._worldview}setWorldview(l){return this.style&&l!==this._worldview?(this._worldview=l,this.style._reloadSources(),this):this}getProjection(){return this.transform.mercatorFromTransition?{name:"globe",center:[0,0]}:this.transform.getProjection()}_showingGlobe(){return this.transform.projection.name==="globe"}setProjection(l){return this._lazyInitEmptyStyle(),l?typeof l=="string"&&(l={name:l}):l=null,this._useExplicitProjection=!!l,this._prioritizeAndUpdateProjection(l,this.style.stylesheet?this.style.stylesheet.projection:null)}_updateProjectionTransition(){if(this.getProjection().name!=="globe")return;const l=this.transform,r=l.projection.name;let o;r==="globe"&&l.zoom>=a.GLOBE_ZOOM_THRESHOLD_MAX?(l.setMercatorFromTransition(),o=!0):r==="mercator"&&l.zoom=a.GLOBE_ZOOM_THRESHOLD_MAX?this.transform.setMercatorFromTransition():this.transform.setProjection(l),this.style.applyProjectionUpdate(),r){this.painter.clearBackgroundTiles();for(const o in this.style._sourceCaches)this.style._sourceCaches[o].clearTiles();this._update(!0),this._forceMarkerAndPopupUpdate(!0)}return this}project(l){return this.transform.locationPoint3D(a.LngLat.convert(l))}unproject(l){return this.transform.pointLocation3D(a.Point.convert(l))}isMoving(){return this._moving||this.handlers&&this.handlers.isMoving()||!1}isZooming(){return this._zooming||this.handlers&&this.handlers.isZooming()||!1}isRotating(){return this._rotating||this.handlers&&this.handlers.isRotating()||!1}_isDragging(){return this.handlers&&this.handlers._isDragging()||!1}_createDelegatedListener(l,r,o){if(l==="mouseenter"||l==="mouseover"){let h=!1;const d=g=>{const y=r.filter(E=>this.getLayer(E)),v=y.length?this.queryRenderedFeatures(g.point,{layers:y}):[];v.length?h||(h=!0,o.call(this,new hi(l,this,g.originalEvent,{features:v}))):h=!1},f=()=>{h=!1};return{layers:new Set(r),listener:o,delegates:{mousemove:d,mouseout:f}}}if(l==="mouseleave"||l==="mouseout"){let h=!1;const d=g=>{const y=r.filter(v=>this.getLayer(v));(y.length?this.queryRenderedFeatures(g.point,{layers:y}):[]).length?h=!0:h&&(h=!1,o.call(this,new hi(l,this,g.originalEvent)))},f=g=>{h&&(h=!1,o.call(this,new hi(l,this,g.originalEvent)))};return{layers:new Set(r),listener:o,delegates:{mousemove:d,mouseout:f}}}{const h=d=>{const f=r.filter(y=>this.getLayer(y)),g=f.length?this.queryRenderedFeatures(d.point,{layers:f}):[];g.length&&(d.features=g,o.call(this,d),delete d.features)};return{layers:new Set(r),listener:o,delegates:{[l]:h}}}}on(l,r,o){if(o===void 0)return super.on(l,r);Array.isArray(r)||(r=[r]);const h=this._createDelegatedListener(l,r,o);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[l]=this._delegatedListeners[l]||[],this._delegatedListeners[l].push(h);for(const d in h.delegates)this.on(d,h.delegates[d]);return this}once(l,r,o){if(o===void 0)return super.once(l,r);Array.isArray(r)||(r=[r]);const h=this._createDelegatedListener(l,r,o);for(const d in h.delegates)this.once(d,h.delegates[d]);return this}off(l,r,o){if(o===void 0)return super.off(l,r);r=new Set(Array.isArray(r)?r:[r]);const h=(f,g)=>{if(f.size!==g.size)return!1;for(const y of f)if(!g.has(y))return!1;return!0},d=this._delegatedListeners?this._delegatedListeners[l]:void 0;return d&&(f=>{for(let g=0;g{d?this.fire(new a.ErrorEvent(d)):f&&this._updateDiff(f,r)})}else typeof l=="object"&&this._updateDiff(l,r)}_updateDiff(l,r){try{this.style.setState(l)&&this._update(!0)}catch(o){a.warnOnce(`Unable to perform style diff: ${o.message||o.error||o}. Rebuilding the style from scratch.`),this._updateStyle(l,r)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():(a.warnOnce("There is no style added to the map."),!1)}addSource(l,r){return this._lazyInitEmptyStyle(),this.style.addSource(l,r),this._update(!0)}isSourceLoaded(l){return!!this.style&&this.style._isSourceCacheLoaded(l)}areTilesLoaded(){const l=this.style&&this.style._sourceCaches;for(const r in l){const o=l[r]._tiles;for(const h in o){const d=o[h];if(d.state!=="loaded"&&d.state!=="errored")return!1}}return!0}addSourceType(l,r,o){this._lazyInitEmptyStyle(),this.style.addSourceType(l,r,o)}removeSource(l){return this.style.removeSource(l),this._updateTerrain(),this._update(!0)}getSource(l){return this.style.getSource(l)}addImage(l,r,{pixelRatio:o=1,sdf:h=!1,stretchX:d,stretchY:f,content:g}={}){if(this._lazyInitEmptyStyle(),r instanceof a.window.HTMLImageElement||a.window.ImageBitmap&&r instanceof a.window.ImageBitmap){const{width:y,height:v,data:E}=a.exported.getImageData(r);this.style.addImage(l,{data:new a.RGBAImage({width:y,height:v},E),pixelRatio:o,stretchX:d,stretchY:f,content:g,sdf:h,version:0})}else if(r.width===void 0||r.height===void 0)this.fire(new a.ErrorEvent(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`")));else{const{width:y,height:v}=r,E=r;this.style.addImage(l,{data:new a.RGBAImage({width:y,height:v},new Uint8Array(E.data)),pixelRatio:o,stretchX:d,stretchY:f,content:g,sdf:h,version:0,userImage:E}),E.onAdd&&E.onAdd(this,l)}}updateImage(l,r){const o=this.style.getImage(l);if(!o)return void this.fire(new a.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const h=r instanceof a.window.HTMLImageElement||a.window.ImageBitmap&&r instanceof a.window.ImageBitmap?a.exported.getImageData(r):r,{width:d,height:f}=h;d!==void 0&&f!==void 0?d===o.data.width&&f===o.data.height?(o.data.replace(h.data,!(r instanceof a.window.HTMLImageElement||a.window.ImageBitmap&&r instanceof a.window.ImageBitmap)),this.style.updateImage(l,o)):this.fire(new a.ErrorEvent(new Error(`The width and height of the updated image (${d}, ${f}) - must be that same as the previous version of the image - (${o.data.width}, ${o.data.height})`))):this.fire(new a.ErrorEvent(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`")))}hasImage(l){return l?!!this.style.getImage(l):(this.fire(new a.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(l){this.style.removeImage(l)}loadImage(l,r){a.getImage(this._requestManager.transformRequest(l,a.ResourceType.Image),(o,h)=>{r(o,h instanceof a.window.HTMLImageElement?a.exported.getImageData(h):h)})}listImages(){return this.style.listImages()}addLayer(l,r){return this._lazyInitEmptyStyle(),this.style.addLayer(l,r),this._update(!0)}moveLayer(l,r){return this.style.moveLayer(l,r),this._update(!0)}removeLayer(l){return this.style.removeLayer(l),this._update(!0)}getLayer(l){return this.style.getLayer(l)}setLayerZoomRange(l,r,o){return this.style.setLayerZoomRange(l,r,o),this._update(!0)}setFilter(l,r,o={}){return this.style.setFilter(l,r,o),this._update(!0)}getFilter(l){return this.style.getFilter(l)}setPaintProperty(l,r,o,h={}){return this.style.setPaintProperty(l,r,o,h),this._update(!0)}getPaintProperty(l,r){return this.style.getPaintProperty(l,r)}setLayoutProperty(l,r,o,h={}){return this.style.setLayoutProperty(l,r,o,h),this._update(!0)}getLayoutProperty(l,r){return this.style.getLayoutProperty(l,r)}setLight(l,r={}){return this._lazyInitEmptyStyle(),this.style.setLight(l,r),this._update(!0)}getLight(){return this.style.getLight()}setTerrain(l){return this._lazyInitEmptyStyle(),!l&&this.transform.projection.requiresDraping?this.style.setTerrainForDraping():this.style.setTerrain(l),this._averageElevationLastSampledAt=-1/0,this._update(!0)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(l){return this._lazyInitEmptyStyle(),this.style.setFog(l),this._update(!0)}getFog(){return this.style?this.style.getFog():null}_queryFogOpacity(l){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(a.LngLat.convert(l),this.transform):0}setFeatureState(l,r){return this.style.setFeatureState(l,r),this._update()}removeFeatureState(l,r){return this.style.removeFeatureState(l,r),this._update()}getFeatureState(l){return this.style.getFeatureState(l)}_updateContainerDimensions(){if(!this._container)return;const l=this._container.getBoundingClientRect().width||400,r=this._container.getBoundingClientRect().height||300;let o,h,d,f=this._container;for(;f&&(!h||!d);){const g=a.window.getComputedStyle(f).transform;g&&g!=="none"&&(o=g.match(/matrix.*\((.+)\)/)[1].split(", "),o[0]&&o[0]!=="0"&&o[0]!=="1"&&(h=o[0]),o[3]&&o[3]!=="0"&&o[3]!=="1"&&(d=o[3])),f=f.parentElement}this._containerWidth=h?Math.abs(l/h):l,this._containerHeight=d?Math.abs(r/d):r}_detectMissingCSS(){a.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")!=="rgb(250, 128, 114)"&&a.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")}_setupContainer(){const l=this._container;l.classList.add("mapboxgl-map"),(this._missingCSSCanary=ht("div","mapboxgl-canary",l)).style.visibility="hidden",this._detectMissingCSS();const r=this._canvasContainer=ht("div","mapboxgl-canvas-container",l);this._interactive&&r.classList.add("mapboxgl-interactive"),this._canvas=ht("canvas","mapboxgl-canvas",r),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region"),this._updateContainerDimensions(),this._resizeCanvas(this._containerWidth,this._containerHeight);const o=this._controlContainer=ht("div","mapboxgl-control-container",l),h=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(d=>{h[d]=ht("div",`mapboxgl-ctrl-${d}`,o)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(l,r){const o=a.exported.devicePixelRatio||1;this._canvas.width=o*Math.ceil(l),this._canvas.height=o*Math.ceil(r),this._canvas.style.width=`${l}px`,this._canvas.style.height=`${r}px`}_addMarker(l){this._markers.push(l)}_removeMarker(l){const r=this._markers.indexOf(l);r!==-1&&this._markers.splice(r,1)}_addPopup(l){this._popups.push(l)}_removePopup(l){const r=this._popups.indexOf(l);r!==-1&&this._popups.splice(r,1)}_setupPainter(){const l=a.extend({},xr.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),r=this._useWebGL2&&this._canvas.getContext("webgl2",l),o=r||this._canvas.getContext("webgl",l)||this._canvas.getContext("experimental-webgl",l);o?(this._useWebGL2&&!r&&a.warnOnce("Failed to create WebGL 2 context. Using WebGL 1."),a.storeAuthState(o,!0),this.painter=new io(o,this.transform,!!r),this.on("data",h=>{h.dataType==="source"&&this.painter.setTileLoadedFlag(!0)}),a.exported$1.testSupport(o)):this.fire(new a.ErrorEvent(new Error("Failed to initialize WebGL")))}_contextLost(l){l.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new a.Event("webglcontextlost",{originalEvent:l}))}_contextRestored(l){this._setupPainter(),this.resize(),this._update(),this.fire(new a.Event("webglcontextrestored",{originalEvent:l}))}_onMapScroll(l){if(l.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(l){return this.style?(this._styleDirty=this._styleDirty||l,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(l){return this._update(),this._renderTaskQueue.add(l)}_cancelRenderFrame(l){this._renderTaskQueue.remove(l)}_requestDomTask(l){!this.loaded()||this.loaded()&&!this.isMoving()?l():this._domRenderTaskQueue.add(l)}_render(l){let r;const o=this.painter.context.extTimerQuery,h=a.exported.now();if(this.listens("gpu-timing-frame")&&(r=o.createQueryEXT(),o.beginQueryEXT(o.TIME_ELAPSED_EXT,r)),this.painter.context.setDirty(),this.painter.setBaseState(),(this.isMoving()||this.isRotating()||this.isZooming())&&(this._interactionRange[0]=Math.min(this._interactionRange[0],a.window.performance.now()),this._interactionRange[1]=Math.max(this._interactionRange[1],a.window.performance.now())),this._renderTaskQueue.run(l),this._domRenderTaskQueue.run(l),this._removed)return;this._updateProjectionTransition();const d=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;const y=this.transform.zoom,v=this.transform.pitch,E=a.exported.now(),T=new a.EvaluationParameters(y,{now:E,fadeDuration:d,pitch:v,transition:this.style.getTransition()});this.style.update(T)}this.style&&this.style.fog&&this.style.fog.hasTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0);let f=!1;if(this.style&&this._sourcesDirty?(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),f=this._updateAverageElevation(h),this.style._updateSources(this.transform),this._forceMarkerAndPopupUpdate()):f=this._updateAverageElevation(h),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,d,this._crossSourceCollisions),this.style&&this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showTerrainWireframe:this.showTerrainWireframe,showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,showTileAABBs:this.showTileAABBs,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:d,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),gpuTimingDeferredRender:!!this.listens("gpu-timing-deferred-render"),speedIndexTiming:this.speedIndexTiming}),this.fire(new a.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new a.Event("load"))),this.style&&this.style.hasTransitions()&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),r){const y=a.exported.now()-h;o.endQueryEXT(o.TIME_ELAPSED_EXT,r),setTimeout(()=>{const v=o.getQueryObjectEXT(r,o.QUERY_RESULT_EXT)/1e6;o.deleteQueryEXT(r),this.fire(new a.Event("gpu-timing-frame",{cpuTime:y,gpuTime:v})),a.window.performance.mark("frame-gpu",{startTime:h,detail:{gpuTime:v}})},50)}if(this.listens("gpu-timing-layer")){const y=this.painter.collectGpuTimers();setTimeout(()=>{const v=this.painter.queryGpuTimers(y);this.fire(new a.Event("gpu-timing-layer",{layerTimes:v}))},50)}if(this.listens("gpu-timing-deferred-render")){const y=this.painter.collectDeferredRenderGpuQueries();setTimeout(()=>{const v=this.painter.queryGpuTimeDeferredRender(y);this.fire(new a.Event("gpu-timing-deferred-render",{gpuTime:v}))},50)}const g=this._sourcesDirty||this._styleDirty||this._placementDirty||f;if(g||this._repaint)this.triggerRepaint();else{const y=!this.isMoving()&&this.loaded();if(y&&(f=this._updateAverageElevation(h,!0)),f)this.triggerRepaint();else if(this._triggerFrame(!1),y&&(this.fire(new a.Event("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){const v=this._calculateSpeedIndex();this.fire(new a.Event("speedindexcompleted",{speedIndex:v})),this.speedIndexTiming=!1}}!this._loaded||this._fullyLoaded||g||(this._fullyLoaded=!0,a.LivePerformanceUtils.mark(a.PerformanceMarkers.fullLoad),this._performanceMetricsCollection&&a.postPerformanceEvent(this._requestManager._customAccessToken,{width:this.painter.width,height:this.painter.height,interactionRange:this._interactionRange,visibilityHidden:this._visibilityHidden,terrainEnabled:!!this.painter.style.getTerrain(),fogEnabled:!!this.painter.style.getFog(),projection:this.getProjection().name,zoom:this.transform.zoom,renderer:this.painter.context.renderer,vendor:this.painter.context.vendor}),this._authenticate())}_forceMarkerAndPopupUpdate(l){for(const r of this._markers)l&&!this.getRenderWorldCopies()&&(r._lngLat=r._lngLat.wrap()),r._update();for(const r of this._popups)!l||this.getRenderWorldCopies()||r._trackPointer||(r._lngLat=r._lngLat.wrap()),r._update()}_updateAverageElevation(l,r=!1){const o=h=>(this.transform.averageElevation=h,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return this.transform.averageElevation!==0&&o(0);if((r||l-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(l)){const h=this.transform.averageElevation;let d=this.transform.sampleAverageElevation(),f=!1;this.transform.elevation&&(f=this.transform.elevation.exaggeration()!==this._averageElevationExaggeration,this._averageElevationExaggeration=this.transform.elevation.exaggeration()),isNaN(d)?d=0:this._averageElevationLastSampledAt=l;const g=Math.abs(h-d);if(g>1){if(this._isInitialLoad||f)return this._averageElevation.jumpTo(d),o(d);this._averageElevation.easeTo(d,l,300)}else if(g>1e-4)return this._averageElevation.jumpTo(d),o(d)}return!!this._averageElevation.isEasing(l)&&o(this._averageElevation.getValue(l))}_authenticate(){a.getMapSessionAPI(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,l=>{if(l&&(l.message===a.AUTH_ERR_MSG||l.status===401)){const r=this.painter.context.gl;a.storeAuthState(r,!1),this._logoControl instanceof dl&&this._logoControl._updateLogo(),r&&r.clear(r.DEPTH_BUFFER_BIT|r.COLOR_BUFFER_BIT|r.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new a.ErrorEvent(new Error("A valid Mapbox access token is required to use Mapbox GL JS. To create an account or a new access token, visit https://account.mapbox.com/")))}}),a.postMapLoadEvent(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,()=>{})}_updateTerrain(){const l=this._isDragging();this.painter.updateTerrain(this.style,l)}_calculateSpeedIndex(){const l=this.painter.canvasCopy(),r=this.painter.getCanvasCopiesAndTimestamps();r.timeStamps.push(performance.now());const o=this.painter.context.gl,h=o.createFramebuffer();function d(f){o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,f,0);const g=new Uint8Array(o.drawingBufferWidth*o.drawingBufferHeight*4);return o.readPixels(0,0,o.drawingBufferWidth,o.drawingBufferHeight,o.RGBA,o.UNSIGNED_BYTE,g),g}return o.bindFramebuffer(o.FRAMEBUFFER,h),this._canvasPixelComparison(d(l),r.canvasCopies.map(d),r.timeStamps)}_canvasPixelComparison(l,r,o){let h=o[1]-o[0];const d=l.length/4;for(let f=0;f{const o=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,o&&this._render(r)}))}_preloadTiles(l){const r=this.style?Object.values(this.style._sourceCaches):[];return a.asyncAll(r,(o,h)=>o._preloadTiles(l,h),()=>{this.triggerRepaint()}),this}_onWindowOnline(){this._update()}_onWindowResize(l){this._trackResize&&this.resize({originalEvent:l})._update()}_onVisibilityChange(){a.window.document.visibilityState==="hidden"&&this._visibilityHidden++}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(l){this._showTileBoundaries!==l&&(this._showTileBoundaries=l,this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(l){this._showTerrainWireframe!==l&&(this._showTerrainWireframe=l,this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(l){this._speedIndexTiming!==l&&(this._speedIndexTiming=l,this._update())}get showPadding(){return!!this._showPadding}set showPadding(l){this._showPadding!==l&&(this._showPadding=l,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(l){this._showCollisionBoxes!==l&&(this._showCollisionBoxes=l,l?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(l){this._showOverdrawInspector!==l&&(this._showOverdrawInspector=l,this._update())}get repaint(){return!!this._repaint}set repaint(l){this._repaint!==l&&(this._repaint=l,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(l){this._vertices=l,this._update()}get showTileAABBs(){return!!this._showTileAABBs}set showTileAABBs(l){this._showTileAABBs!==l&&(this._showTileAABBs=l,l&&this._update())}_setCacheLimits(l,r){a.setCacheLimits(l,r)}get version(){return a.version}},NavigationControl:class{constructor(l){this.options=a.extend({},Xh,l),this._container=ht("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",r=>r.preventDefault()),this.options.showZoom&&(a.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",r=>{this._map&&this._map.zoomIn({},{originalEvent:r})}),ht("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",r=>{this._map&&this._map.zoomOut({},{originalEvent:r})}),ht("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(a.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",r=>{const o=this._map;o&&(this.options.visualizePitch?o.resetNorthPitch({},{originalEvent:r}):o.resetNorth({},{originalEvent:r}))}),this._compassIcon=ht("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const l=this._map;if(!l)return;const r=l.getZoom(),o=r===l.getMaxZoom(),h=r===l.getMinZoom();this._zoomInButton.disabled=o,this._zoomOutButton.disabled=h,this._zoomInButton.setAttribute("aria-disabled",o.toString()),this._zoomOutButton.setAttribute("aria-disabled",h.toString())}_rotateCompassArrow(){const l=this._map;if(!l)return;const r=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(l.transform.pitch*(Math.PI/180)),.5)}) rotateX(${l.transform.pitch}deg) rotateZ(${l.transform.angle*(180/Math.PI)}deg)`:`rotate(${l.transform.angle*(180/Math.PI)}deg)`;l._requestDomTask(()=>{this._compassIcon&&(this._compassIcon.style.transform=r)})}onAdd(l){return this._map=l,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),l.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&l.on("pitch",this._rotateCompassArrow),l.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Hh(l,this._compass,this.options.visualizePitch)),this._container}onRemove(){const l=this._map;l&&(this._container.remove(),this.options.showZoom&&l.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&l.off("pitch",this._rotateCompassArrow),l.off("rotate",this._rotateCompassArrow),this._handler&&this._handler.off(),this._handler=void 0),this._map=void 0)}_createButton(l,r){const o=ht("button",l,this._container);return o.type="button",o.addEventListener("click",r),o}_setButtonTitle(l,r){if(!this._map)return;const o=this._map._getUIString(`NavigationControl.${r}`);l.setAttribute("aria-label",o),l.firstElementChild&&l.firstElementChild.setAttribute("title",o)}},GeolocateControl:class extends a.Evented{constructor(l){super(),this.options=a.extend({geolocation:a.window.navigator.geolocation},_l,l),a.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation","_onDeviceOrientation"],this),this._updateMarkerRotationThrottled=oo(this._updateMarkerRotation,20),this._numberOfWatches=0}onAdd(l){return this._map=l,this._container=ht("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkGeolocationSupport(this._setupUI),this._container}onRemove(){this._geolocationWatchID!==void 0&&(this.options.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("zoom",this._onZoom),this._map=void 0,this._numberOfWatches=0,this._noTimeout=!1}_checkGeolocationSupport(l){const r=(o=!!this.options.geolocation)=>{this._supportsGeolocation=o,l(o)};this._supportsGeolocation!==void 0?l(this._supportsGeolocation):a.window.navigator.permissions!==void 0?a.window.navigator.permissions.query({name:"geolocation"}).then(o=>r(o.state!=="denied")).catch(()=>r()):r()}_isOutOfMapMaxBounds(l){const r=this._map.getMaxBounds(),o=l.coords;return!!r&&(o.longituder.getEast()||o.latituder.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}}_onSuccess(l){if(this._map){if(this._isOutOfMapMaxBounds(l))return this._setErrorState(),this.fire(new a.Event("outofmaxbounds",l)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=l,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(l),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(l),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new a.Event("geolocate",l)),this._finish()}}_updateCamera(l){const r=new a.LngLat(l.coords.longitude,l.coords.latitude),o=l.coords.accuracy,h=this._map.getBearing(),d=a.extend({bearing:h},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(o),d,{geolocateSource:!0})}_updateMarker(l){if(l){const r=new a.LngLat(l.coords.longitude,l.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=l.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const l=this._map.transform,r=a.mercatorZfromAltitude(1,l._center.lat)*l.worldSize,o=Math.ceil(2*this._accuracy*r);this._circleElement.style.width=`${o}px`,this._circleElement.style.height=`${o}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_updateMarkerRotation(){this._userLocationDotMarker&&typeof this._heading=="number"?(this._userLocationDotMarker.setRotation(this._heading),this._dotElement.classList.add("mapboxgl-user-location-show-heading")):(this._dotElement.classList.remove("mapboxgl-user-location-show-heading"),this._userLocationDotMarker.setRotation(0))}_onError(l){if(this._map){if(this.options.trackUserLocation)if(l.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.setAttribute("aria-label",r),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",r),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(l.code===3&&this._noTimeout)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new a.Event("error",l)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(l){if(this._map!==void 0){if(this._container.addEventListener("contextmenu",r=>r.preventDefault()),this._geolocateButton=ht("button","mapboxgl-ctrl-geolocate",this._container),ht("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",l===!1){a.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");const r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.setAttribute("aria-label",r),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",r)}else{const r=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.setAttribute("aria-label",r),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",r)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=ht("div","mapboxgl-user-location"),this._dotElement.appendChild(ht("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(ht("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new Be({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=ht("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Be({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",r=>{r.geolocateSource||this._watchState!=="ACTIVE_LOCK"||r.originalEvent&&r.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this.fire(new a.Event("trackuserlocationend")))})}}_onDeviceOrientation(l){this._userLocationDotMarker&&(l.webkitCompassHeading?this._heading=l.webkitCompassHeading:l.absolute===!0&&(this._heading=-1*l.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return a.warnOnce("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 a.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._numberOfWatches--,this._noTimeout=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new a.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new a.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let l;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._numberOfWatches++,this._numberOfWatches>1?(l={maximumAge:6e5,timeout:0},this._noTimeout=!0):(l=this.options.positionOptions,this._noTimeout=!1),this._geolocationWatchID=this.options.geolocation.watchPosition(this._onSuccess,this._onError,l),this.options.showUserHeading&&this._addDeviceOrientationListener()}}else this.options.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_addDeviceOrientationListener(){const l=()=>{a.window.addEventListener("ondeviceorientationabsolute"in a.window?"deviceorientationabsolute":"deviceorientation",this._onDeviceOrientation)};a.window.DeviceMotionEvent!==void 0&&typeof a.window.DeviceMotionEvent.requestPermission=="function"?DeviceOrientationEvent.requestPermission().then(r=>{r==="granted"&&l()}).catch(console.error):l()}_clearWatch(){this.options.geolocation.clearWatch(this._geolocationWatchID),a.window.removeEventListener("deviceorientation",this._onDeviceOrientation),a.window.removeEventListener("deviceorientationabsolute",this._onDeviceOrientation),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:Ue,ScaleControl:class{constructor(l){this.options=a.extend({},gl,l),this._isNumberFormatSupported=function(){try{return new Intl.NumberFormat("en",{style:"unit",unitDisplay:"short",unit:"meter"}),!0}catch{return!1}}(),a.bindAll(["_update","_setScale","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_update(){const l=this.options.maxWidth||100,r=this._map,o=r._containerHeight/2,h=r._containerWidth/2-l/2,d=r.unproject([h,o]),f=r.unproject([h+l,o]),g=d.distanceTo(f);if(this.options.unit==="imperial"){const y=3.2808*g;y>5280?this._setScale(l,y/5280,"mile"):this._setScale(l,y,"foot")}else this.options.unit==="nautical"?this._setScale(l,g/1852,"nautical-mile"):g>=1e3?this._setScale(l,g/1e3,"kilometer"):this._setScale(l,g,"meter")}_setScale(l,r,o){this._map._requestDomTask(()=>{const h=function(f){const g=Math.pow(10,`${Math.floor(f)}`.length-1);let y=f/g;return y=y>=10?10:y>=5?5:y>=3?3:y>=2?2:y>=1?1:function(v){const E=Math.pow(10,Math.ceil(-Math.log(v)/Math.LN10));return Math.round(v*E)/E}(y),g*y}(r),d=h/r;this._container.innerHTML=this._isNumberFormatSupported&&o!=="nautical-mile"?new Intl.NumberFormat(this._language,{style:"unit",unitDisplay:"short",unit:o}).format(h):`${h} ${yl[o]}`,this._container.style.width=l*d+"px"})}onAdd(l){return this._map=l,this._language=l.getLanguage(),this._container=ht("div","mapboxgl-ctrl mapboxgl-ctrl-scale",l.getContainer()),this._container.dir="auto",this._map.on("move",this._update),this._update(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._update),this._map=void 0}_setLanguage(l){this._language=l,this._update()}setUnit(l){this.options.unit=l,this._update()}},FullscreenControl:class{constructor(l){this._fullscreen=!1,l&&l.container&&(l.container instanceof a.window.HTMLElement?this._container=l.container:a.warnOnce("Full screen control 'container' must be a DOM element.")),a.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in a.window.document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in a.window.document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(l){return this._map=l,this._container||(this._container=this._map.getContainer()),this._controlContainer=ht("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",a.warnOnce("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,a.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!a.window.document.fullscreenEnabled&&!a.window.document.webkitFullscreenEnabled)}_setupUI(){const l=this._fullscreenButton=ht("button","mapboxgl-ctrl-fullscreen",this._controlContainer);ht("span","mapboxgl-ctrl-icon",l).setAttribute("aria-hidden","true"),l.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),a.window.document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const l=this._getTitle();this._fullscreenButton.setAttribute("aria-label",l),this._fullscreenButton.firstElementChild&&this._fullscreenButton.firstElementChild.setAttribute("title",l)}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(a.window.document.fullscreenElement||a.window.document.webkitFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?a.window.document.exitFullscreen?a.window.document.exitFullscreen():a.window.document.webkitCancelFullScreen&&a.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},Popup:class extends a.Evented{constructor(l){super(),this.options=a.extend(Object.create(fl),l),a.bindAll(["_update","_onClose","remove","_onMouseEvent"],this),this._classList=new Set(l&&l.className?l.className.trim().split(/\s+/):[])}addTo(l){return this._map&&this.remove(),this._map=l,this.options.closeOnClick&&l.on("preclick",this._onClose),this.options.closeOnMove&&l.on("move",this._onClose),l.on("remove",this.remove),this._update(),l._addPopup(this),this._focusFirstElement(),this._trackPointer?(l.on("mousemove",this._onMouseEvent),l.on("mouseup",this._onMouseEvent),l._canvasContainer.classList.add("mapboxgl-track-pointer")):l.on("move",this._update),this.fire(new a.Event("open")),this}isOpen(){return!!this._map}remove(){this._content&&this._content.remove(),this._container&&(this._container.remove(),this._container=void 0);const l=this._map;return l&&(l.off("move",this._update),l.off("move",this._onClose),l.off("preclick",this._onClose),l.off("click",this._onClose),l.off("remove",this.remove),l.off("mousemove",this._onMouseEvent),l.off("mouseup",this._onMouseEvent),l.off("drag",this._onMouseEvent),l._canvasContainer&&l._canvasContainer.classList.remove("mapboxgl-track-pointer"),l._removePopup(this),this._map=void 0),this.fire(new a.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(l){this._lngLat=a.LngLat.convert(l),this._pos=null,this._trackPointer=!1,this._update();const r=this._map;return r&&(r.on("move",this._update),r.off("mousemove",this._onMouseEvent),r._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}trackPointer(){this._trackPointer=!0,this._pos=null,this._update();const l=this._map;return l&&(l.off("move",this._update),l.on("mousemove",this._onMouseEvent),l.on("drag",this._onMouseEvent),l._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(l){return this.setDOMContent(a.window.document.createTextNode(l))}setHTML(l){const r=a.window.document.createDocumentFragment(),o=a.window.document.createElement("body");let h;for(o.innerHTML=l;h=o.firstChild,h;)r.appendChild(h);return this.setDOMContent(r)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(l){return this.options.maxWidth=l,this._update(),this}setDOMContent(l){let r=this._content;if(r)for(;r.hasChildNodes();)r.firstChild&&r.removeChild(r.firstChild);else r=this._content=ht("div","mapboxgl-popup-content",this._container||void 0);if(r.appendChild(l),this.options.closeButton){const o=this._closeButton=ht("button","mapboxgl-popup-close-button",r);o.type="button",o.setAttribute("aria-label","Close popup"),o.setAttribute("aria-hidden","true"),o.innerHTML="×",o.addEventListener("click",this._onClose)}return this._update(),this._focusFirstElement(),this}addClassName(l){return this._classList.add(l),this._updateClassList(),this}removeClassName(l){return this._classList.delete(l),this._updateClassList(),this}setOffset(l){return this.options.offset=l,this._update(),this}toggleClassName(l){let r;return this._classList.delete(l)?r=!1:(this._classList.add(l),r=!0),this._updateClassList(),r}_onMouseEvent(l){this._update(l.point)}_getAnchor(l){if(this.options.anchor)return this.options.anchor;const r=this._map,o=this._container,h=this._pos;if(!r||!o||!h)return"bottom";const d=o.offsetWidth,f=o.offsetHeight,g=h.xr.transform.width-d/2;if(h.y+lr.transform.height-f){if(g)return"bottom-left";if(y)return"bottom-right"}return g?"left":y?"right":"bottom"}_updateClassList(){const l=this._container;if(!l)return;const r=[...this._classList];r.push("mapboxgl-popup"),this._anchor&&r.push(`mapboxgl-popup-anchor-${this._anchor}`),this._trackPointer&&r.push("mapboxgl-popup-track-pointer"),l.className=r.join(" ")}_update(l){const r=this._map,o=this._content;if(!r||!this._lngLat&&!this._trackPointer||!o)return;let h=this._container;if(h||(h=this._container=ht("div","mapboxgl-popup",r.getContainer()),this._tip=ht("div","mapboxgl-popup-tip",h),h.appendChild(o)),this.options.maxWidth&&h.style.maxWidth!==this.options.maxWidth&&(h.style.maxWidth=this.options.maxWidth),r.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=lo(this._lngLat,this._pos,r.transform)),!this._trackPointer||l){const d=this._pos=this._trackPointer&&l?l:r.project(this._lngLat),f=Uc(this.options.offset),g=this._anchor=this._getAnchor(f.y),y=Uc(this.options.offset,g),v=d.add(y).round();r._requestDomTask(()=>{this._container&&g&&(this._container.style.transform=`${Sn[g]} translate(${v.x}px,${v.y}px)`)})}if(!this._marker&&r._showingGlobe()){const d=a.isLngLatBehindGlobe(r.transform,this._lngLat)?0:1;this._setOpacity(d)}this._updateClassList()}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const l=this._container.querySelector(Wh);l&&l.focus()}_onClose(){this.remove()}_setOpacity(l){this._container&&(this._container.style.opacity=`${l}`),this._content&&(this._content.style.pointerEvents=l?"auto":"none")}},Marker:Be,Style:cr,LngLat:a.LngLat,LngLatBounds:a.LngLatBounds,Point:a.Point,MercatorCoordinate:a.MercatorCoordinate,FreeCameraOptions:Ec,Evented:a.Evented,config:a.config,prewarm:function(){Zn().acquire(sr)},clearPrewarmedResources:function(){const l=Ti;l&&(l.isPreloaded()&&l.numActive()===1?(l.release(sr),Ti=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()"))},get accessToken(){return a.config.ACCESS_TOKEN},set accessToken(l){a.config.ACCESS_TOKEN=l},get baseApiUrl(){return a.config.API_URL},set baseApiUrl(l){a.config.API_URL=l},get workerCount(){return li.workerCount},set workerCount(l){li.workerCount=l},get maxParallelImageRequests(){return a.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(l){a.config.MAX_PARALLEL_IMAGE_REQUESTS=l},clearStorage(l){a.clearTileCache(l)},workerUrl:"",workerClass:null,setNow:a.exported.setNow,restoreNow:a.exported.restoreNow};return co});var Vf=cn;return Vf})})(Of);var Uf=Of.exports;const yg=gg(Uf),xg=mg({__proto__:null,default:yg},[Uf]);export{xg as m}; diff --git a/docs/frontend/dist/config.json b/docs/frontend/dist/config.json new file mode 100644 index 0000000..3acad23 --- /dev/null +++ b/docs/frontend/dist/config.json @@ -0,0 +1,13 @@ +{ + "environment": "dev", + "region": "us-east-1", + "apiUrl": "https://d6q5pgqgx5oy5.cloudfront.net", + "cognito": { + "clientId": "5eusi16g0o2q1g1rr5ehgudodm", + "domain": "authcori.auth.us-east-1.amazoncognito.com", + "identityPoolId": "us-east-1:2194a76a-fa3d-4c33-999e-e3c4b2b049ee", + "userPoolId": "us-east-1_QeA4600FA" + }, + "buildTime": "2022-05-20T13:23:42.602Z", + "version": "1.0.0" +} diff --git a/docs/frontend/dist/favicon.ico b/docs/frontend/dist/favicon.ico new file mode 100644 index 0000000..2708f3f Binary files /dev/null and b/docs/frontend/dist/favicon.ico differ diff --git a/docs/frontend/dist/index.html b/docs/frontend/dist/index.html new file mode 100644 index 0000000..fd42238 --- /dev/null +++ b/docs/frontend/dist/index.html @@ -0,0 +1,33 @@ + + + + + + + + + + + Rural Innovation Network | CORI + + + + + + + + + + + + +
+ + + diff --git a/docs/frontend/dist/logo192.png b/docs/frontend/dist/logo192.png new file mode 100644 index 0000000..e69de29 diff --git a/docs/frontend/dist/logo512.png b/docs/frontend/dist/logo512.png new file mode 100644 index 0000000..e69de29 diff --git a/docs/frontend/dist/manifest.json b/docs/frontend/dist/manifest.json new file mode 100644 index 0000000..74bbae7 --- /dev/null +++ b/docs/frontend/dist/manifest.json @@ -0,0 +1,15 @@ +{ + "short_name": "Frontend App | CORI/RISI", + "name": "Frontend by Rural Innovation Strategies, Inc.", + "icons": [ + { + "src": "favicon.ico", + "sizes": "64x64 32x32 24x24 16x16", + "type": "image/x-icon" + } + ], + "start_url": ".", + "display": "standalone", + "theme_color": "#000000", + "background_color": "#ffffff" +} diff --git a/docs/frontend/dist/robots.txt b/docs/frontend/dist/robots.txt new file mode 100644 index 0000000..e9e57dc --- /dev/null +++ b/docs/frontend/dist/robots.txt @@ -0,0 +1,3 @@ +# https://www.robotstxt.org/robotstxt.html +User-agent: * +Disallow: diff --git a/docs/index.html b/docs/index.html index 8d1a6ac..f30e486 100644 --- a/docs/index.html +++ b/docs/index.html @@ -172,8 +172,6 @@

Rural Innovation Network

-

This is a Quarto website.

-

To learn more about Quarto websites visit https://quarto.org/docs/websites.

@@ -602,41 +600,34 @@

Rural Innovation Network

- - - - - - - Frontend App | CORI/RISI - - - - - - - - - - - - - - - - - + + + + + + + + Rural Innovation Network | CORI + + + + + + + + + + -
- - +
+ diff --git a/docs/search.json b/docs/search.json index 6638d1e..5da6b2e 100644 --- a/docs/search.json +++ b/docs/search.json @@ -1,17 +1,10 @@ [ - { - "objectID": "index.html", - "href": "index.html", - "title": "Rural Innovation Network", - "section": "", - "text": "This is a Quarto website.\nTo learn more about Quarto websites visit https://quarto.org/docs/websites." - }, { "objectID": "cisco/eda.html", "href": "cisco/eda.html", "title": "Exploratory data analysis for impact evaluation", "section": "", - "text": "Full table view may require scrolling to the right =>", + "text": "Note: Some enrolled learners have completed both courses simultaneously\n\n\n\n\n\n\n\n\n\n\nNote: Full table view may require scrolling to the right =>", "crumbs": [ "Rural Innovation Network data", "Cisco", @@ -23,7 +16,7 @@ "href": "cisco/eda.html#simple-eda", "title": "Exploratory data analysis for impact evaluation", "section": "", - "text": "Full table view may require scrolling to the right =>", + "text": "Note: Some enrolled learners have completed both courses simultaneously\n\n\n\n\n\n\n\n\n\n\nNote: Full table view may require scrolling to the right =>", "crumbs": [ "Rural Innovation Network data", "Cisco", @@ -35,7 +28,7 @@ "href": "cisco/eda.html#original-data-about-all-cisco-learners-in-rin-communities", "title": "Exploratory data analysis for impact evaluation", "section": "Original data about all Cisco learners in RIN communities", - "text": "Original data about all Cisco learners in RIN communities\n\n\n\n\n\n\n\nExpansion of learner demographics and motivation responses", + "text": "Original data about all Cisco learners in RIN communities\n\n\n\n\n\n\n\nExpansion of learner demographics and motivation responses\nDownload CSV table of expansion of individual impact variables (i.e., demographic categories as boolean flags)", "crumbs": [ "Rural Innovation Network data", "Cisco", diff --git a/docs/site_libs/bootstrap/bootstrap.min.css b/docs/site_libs/bootstrap/bootstrap.min.css index 387f302..3c65f72 100644 --- a/docs/site_libs/bootstrap/bootstrap.min.css +++ b/docs/site_libs/bootstrap/bootstrap.min.css @@ -1,4 +1,4 @@ -@import"https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;700&display=swap";body{background-color:#16343e !important}header#quarto-header{background-color:#16343e}header#quarto-header nav.navbar{text-shadow:-1px -1px 0 rgba(0,0,0,.3)}header#quarto-header nav.navbar[data-bs-theme=dark]{background-color:#16343e}header#quarto-header nav.navbar[data-bs-theme=dark] .navbar-brand{min-width:7em;min-height:3.5em;background-image:url(assets/images/Full-Logo_CORI_Cream.svg);background-size:calc(100% - 1em);background-position:left top;background-repeat:no-repeat;padding-left:.5em}header#quarto-header nav.navbar[data-bs-theme=dark] .navbar-brand .navbar-title{display:none}header#quarto-header nav.navbar[data-bs-theme=dark] .nav-link:hover,header#quarto-header nav.navbar[data-bs-theme=dark] .nav-link.active:hover{color:#fff}header#quarto-header nav.navbar[data-bs-theme=dark] .nav-link .menu-text,header#quarto-header nav.navbar[data-bs-theme=dark] .nav-link i,header#quarto-header nav.navbar[data-bs-theme=dark] .nav-link.active .menu-text,header#quarto-header nav.navbar[data-bs-theme=dark] .nav-link.active i{color:#fbf8e9}header#quarto-header nav.navbar[data-bs-theme=dark] .nav-link .menu-text:hover,header#quarto-header nav.navbar[data-bs-theme=dark] .nav-link i:hover,header#quarto-header nav.navbar[data-bs-theme=dark] .nav-link.active .menu-text:hover,header#quarto-header nav.navbar[data-bs-theme=dark] .nav-link.active i:hover{color:#fff}header#quarto-header * a:visited{color:#fff !important}header#quarto-header * a:hover{color:#7a7a7a !important;text-shadow:none}header#quarto-header * a.nav-link{font-variant:small-caps}header#quarto-header * a .navbar-title{font-weight:bold}div.quarto-title-banner{background-color:#16343e}div.quarto-title,div.quarto-title .title,div.quarto-title .title{color:#fff}header#title-block-header{background-color:#fff;margin-bottom:0}header .quarto-title-breadcrumbs .breadcrumb{background-color:rgba(163,226,181,.75)}header .quarto-title-breadcrumbs .breadcrumb li.breadcrumb-item::before{color:#59666a}header .quarto-title-breadcrumbs .breadcrumb li a{color:#59666a}header .quarto-title-breadcrumbs .breadcrumb li:last-of-type a{color:#16343e}div#listing-listing{margin-top:4em}div#quarto-content{margin:0;padding:0;width:100vw;background-color:#fff}div#quarto-content>*{padding-top:0}div#quarto-content nav#quarto-sidebar{z-index:2}div#quarto-content nav#quarto-sidebar .mt-2.flex-shrink-0.align-items-center{display:none}div#quarto-content nav#quarto-sidebar .sidebar-menu-container{padding-top:1em}div#quarto-content div.quarto-about-jolla{margin-top:0}div#quarto-content div.quarto-about-jolla * a#github-profile-logo{display:none}div#quarto-content div.quarto-about-jolla img.about-image{margin-bottom:-2.5em;object-fit:contain}div#quarto-content div.quarto-about-jolla img.about-image.round{border-radius:0 !important}div#quarto-content div.quarto-about-jolla div.quarto-title .title{color:#7a7a7a}div#quarto-content div.quarto-about-jolla main#quarto-document-content{margin-top:0}div#quarto-content div.quarto-about-jolla main#quarto-document-content p{text-align:justify}div#quarto-content main#quarto-document-content{margin-top:0}div#quarto-content main#quarto-document-content div.quarto-title .title,div#quarto-content main#quarto-document-content div.quarto-title .title{color:#59666a}div#quarto-content main#quarto-document-content code{color:#00835d}div#quarto-content main#quarto-document-content p{margin:2.5% 7.5% 2.5% 0}div#quarto-content main#quarto-document-content p img{margin:0 3.75%}div#quarto-content main#quarto-document-content blockquote,div#quarto-content main#quarto-document-content blockquote p{margin:0}div#quarto-content #redoc{position:absolute;margin:0;padding:0;width:100%;background-color:#fff}/*! +@import"https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;700&display=swap";body{background-color:#16343e !important}header#quarto-header{background-color:#16343e}header#quarto-header nav.navbar{text-shadow:-1px -1px 0 rgba(0,0,0,.3)}header#quarto-header nav.navbar[data-bs-theme=dark]{background-color:#16343e}header#quarto-header nav.navbar[data-bs-theme=dark] .navbar-brand{min-width:7em;min-height:3.5em;background-image:url("assets/images/Full-Logo_CORI_Cream.svg");background-size:calc(100% - 1em);background-position:left top;background-repeat:no-repeat;padding-left:.5em}header#quarto-header nav.navbar[data-bs-theme=dark] .navbar-brand .navbar-title{display:none}header#quarto-header nav.navbar[data-bs-theme=dark] .navbar-brand-container{min-width:196px}header#quarto-header nav.navbar[data-bs-theme=dark] .nav-link:hover,header#quarto-header nav.navbar[data-bs-theme=dark] .nav-link.active:hover{color:#fff}header#quarto-header nav.navbar[data-bs-theme=dark] .nav-link .menu-text,header#quarto-header nav.navbar[data-bs-theme=dark] .nav-link i,header#quarto-header nav.navbar[data-bs-theme=dark] .nav-link.active .menu-text,header#quarto-header nav.navbar[data-bs-theme=dark] .nav-link.active i{color:#fbf8e9}header#quarto-header nav.navbar[data-bs-theme=dark] .nav-link .menu-text:hover,header#quarto-header nav.navbar[data-bs-theme=dark] .nav-link i:hover,header#quarto-header nav.navbar[data-bs-theme=dark] .nav-link.active .menu-text:hover,header#quarto-header nav.navbar[data-bs-theme=dark] .nav-link.active i:hover{color:#fff}header#quarto-header * a:visited{color:#fff !important}header#quarto-header * a:hover{color:#7a7a7a !important;text-shadow:none}header#quarto-header * a.nav-link{font-variant:small-caps}header#quarto-header * a .navbar-title{font-weight:bold}header#title-block-header{margin-bottom:0;margin-top:10px;background-color:rgba(0,0,0,0) !important;z-index:2}header .quarto-title-breadcrumbs .breadcrumb{background-color:rgba(163,226,181,.75)}header .quarto-title-breadcrumbs .breadcrumb li.breadcrumb-item::before{color:#59666a}header .quarto-title-breadcrumbs .breadcrumb li a{color:#59666a}header .quarto-title-breadcrumbs .breadcrumb li:last-of-type a{color:#16343e}div.quarto-title-banner{background-color:#16343e}div.quarto-title,div.quarto-title .title,div.quarto-title .title{color:#fff}div#listing-listing{margin-top:4em}div#quarto-content{margin:0;padding:0;width:100vw;background-color:#fff}div#quarto-content>*{padding-top:0}div#quarto-content nav#quarto-sidebar{z-index:2}div#quarto-content nav#quarto-sidebar .mt-2.flex-shrink-0.align-items-center{display:none}div#quarto-content nav#quarto-sidebar .sidebar-menu-container{padding-top:1em}div#quarto-content div.quarto-about-jolla{margin-top:0}div#quarto-content div.quarto-about-jolla * a#github-profile-logo{display:none}div#quarto-content div.quarto-about-jolla img.about-image{margin-bottom:-2.5em;object-fit:contain}div#quarto-content div.quarto-about-jolla img.about-image.round{border-radius:0 !important}div#quarto-content div.quarto-about-jolla div.quarto-title .title{color:#7a7a7a}div#quarto-content div.quarto-about-jolla main#quarto-document-content{margin-top:0}div#quarto-content div.quarto-about-jolla main#quarto-document-content p{text-align:justify}div#quarto-content main#quarto-document-content{margin-top:0}div#quarto-content main#quarto-document-content div.quarto-title .title,div#quarto-content main#quarto-document-content div.quarto-title .title{color:#59666a}div#quarto-content main#quarto-document-content code{color:#00835d}div#quarto-content main#quarto-document-content p{margin:2.5% 7.5% 2.5% 0}div#quarto-content main#quarto-document-content p img{margin:0 3.75%}div#quarto-content main#quarto-document-content blockquote,div#quarto-content main#quarto-document-content blockquote p{margin:0}div#quarto-content #redoc{position:absolute;margin:0;padding:0;width:100%;background-color:#fff}.content#app{position:absolute;top:92px;left:225px}.content#app>div{width:calc(100vw - 225px);height:calc(100vh - 92px)}.content#app>div .mapboxgl-map{width:100%;height:100%}/*! * Bootstrap v5.3.1 (https://getbootstrap.com/) * Copyright 2011-2023 The Bootstrap Authors * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) diff --git a/frontend b/frontend index 47c8b5a..66f79b3 160000 --- a/frontend +++ b/frontend @@ -1 +1 @@ -Subproject commit 47c8b5a9537d84742021d49db1ece7b8fd7393dd +Subproject commit 66f79b3459f69ebcccf67bc5bb3954b5389a2dd6 diff --git a/index.qmd b/index.qmd index 4b9e4c3..f1fc1ce 100644 --- a/index.qmd +++ b/index.qmd @@ -4,26 +4,17 @@ favicon: "./assets/favicon.ico" resources: - "./assets" - "./favicon.ico" - - "./frontend/dist/assets" + - "./frontend/dist" include-after-body: - file: "./frontend/dist/index.html" -# - text: | -# - -# include-before-body: # text: | # +# include-before-body: +# text: | +# +# ---- - -This is a Quarto website. -To learn more about Quarto websites visit . +--- diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..c6aac60 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,32632 @@ +{ + "name": "@cori-risi/rural-innovation-network", + "version": "0.0.1", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@cori-risi/rural-innovation-network", + "version": "0.0.1", + "license": "ISC", + "workspaces": [ + "cisco", + "frontend" + ], + "dependencies": { + "@cori-risi/cori.data.api": "file:../cori.data.api" + } + }, + "../cori.data.api": { + "name": "@cori-risi/cori.data.api", + "version": "1.0.1", + "license": "ISC", + "dependencies": { + "@cori-risi/cori.data.api": "file:" + }, + "devDependencies": { + "@babel/preset-env": "^7.24.8", + "@babel/preset-react": "^7.24.7", + "@babel/preset-typescript": "^7.24.7", + "@rollup/plugin-commonjs": "^26.0.1", + "@rollup/plugin-json": "^6.1.0", + "@rollup/plugin-node-resolve": "^15.2.3", + "@rollup/plugin-terser": "^0.4.4", + "@rollup/plugin-typescript": "^11.1.6", + "@types/axios": "^0.14.0", + "@types/d3": "^7.4.3", + "@types/jest": "^29.5.12", + "@types/mapbox__mapbox-gl-geocoder": "^4.7.2", + "@types/react": "^18.3.3", + "@types/react-dom": "^18.3.0", + "autoprefixer": "^10.4.19", + "identity-obj-proxy": "^3.0.0", + "jest-environment-jsdom": "^29.7.0", + "path": "^0.12.7", + "rollup": "^4.18.0", + "rollup-plugin-dts": "^6.1.1", + "rollup-plugin-import-css": "^3.5.0", + "rollup-plugin-peer-deps-external": "^2.2.4", + "rollup-plugin-postcss": "^4.0.2", + "rollup-plugin-postcss-modules": "^2.1.1", + "rollup-plugin-typescript2": "^0.36.0", + "ts-jest": "~29.2.2", + "tslib": "^2.6.3", + "typedoc": "^0.26.5", + "typedoc-github-wiki-theme": "^2.0.0", + "typedoc-plugin-markdown": "^4.2.3", + "typescript": "^5.2.2", + "typescript-plugin-css-modules": "^5.1.0" + }, + "peerDependencies": { + "@aws-amplify/auth": "^6.0.2", + "@aws-amplify/ui-react": "^6.1.2", + "@deck.gl/mapbox": "^9.0.21", + "@mapbox/mapbox-gl-geocoder": "^4.7.2", + "arquero": "^5.4.1", + "aws-amplify": "^6.0.2", + "axios": "^1.7.2", + "d3": "^7.9.0", + "d3-textwrap": "^3.0.0", + "html-to-image": "^1.11.11", + "mapbox-gl": "^2.0.0", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "react-map-gl": "^7.1.7", + "react-markdown": "^9.0.1" + } + }, + "../cori.data.api/node_modules/@adobe/css-tools": { + "version": "4.3.3", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/@ampproject/remapping": { + "version": "2.3.0", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "../cori.data.api/node_modules/@aws-amplify/analytics": { + "version": "7.0.49", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-sdk/client-firehose": "3.621.0", + "@aws-sdk/client-kinesis": "3.621.0", + "@aws-sdk/client-personalize-events": "3.621.0", + "@smithy/util-utf8": "2.0.0", + "tslib": "^2.5.0" + }, + "peerDependencies": { + "@aws-amplify/core": "^6.1.0" + } + }, + "../cori.data.api/node_modules/@aws-amplify/analytics/node_modules/@smithy/util-utf8": { + "version": "2.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/util-buffer-from": "^2.0.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "../cori.data.api/node_modules/@aws-amplify/api": { + "version": "6.0.51", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-amplify/api-graphql": "4.3.2", + "@aws-amplify/api-rest": "4.0.49", + "tslib": "^2.5.0" + } + }, + "../cori.data.api/node_modules/@aws-amplify/api-graphql": { + "version": "4.3.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-amplify/api-rest": "4.0.49", + "@aws-amplify/core": "6.4.2", + "@aws-amplify/data-schema": "^1.5.0", + "@aws-sdk/types": "3.387.0", + "graphql": "15.8.0", + "rxjs": "^7.8.1", + "tslib": "^2.5.0", + "uuid": "^9.0.0" + } + }, + "../cori.data.api/node_modules/@aws-amplify/api-graphql/node_modules/@aws-sdk/types": { + "version": "3.387.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^2.1.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "../cori.data.api/node_modules/@aws-amplify/api-rest": { + "version": "4.0.49", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.5.0" + }, + "peerDependencies": { + "@aws-amplify/core": "^6.1.0" + } + }, + "../cori.data.api/node_modules/@aws-amplify/auth": { + "version": "6.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.5.0" + }, + "peerDependencies": { + "@aws-amplify/core": "^6.1.0" + } + }, + "../cori.data.api/node_modules/@aws-amplify/core": { + "version": "6.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/types": "3.398.0", + "@smithy/util-hex-encoding": "2.0.0", + "@types/uuid": "^9.0.0", + "js-cookie": "^3.0.5", + "rxjs": "^7.8.1", + "tslib": "^2.5.0", + "uuid": "^9.0.0" + } + }, + "../cori.data.api/node_modules/@aws-amplify/data-schema": { + "version": "1.6.1", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-amplify/data-schema-types": "*", + "@smithy/util-base64": "^3.0.0", + "@types/aws-lambda": "^8.10.134", + "@types/json-schema": "^7.0.15", + "rxjs": "^7.8.1" + } + }, + "../cori.data.api/node_modules/@aws-amplify/data-schema-types": { + "version": "1.1.1", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "graphql": "15.8.0", + "rxjs": "^7.8.1" + } + }, + "../cori.data.api/node_modules/@aws-amplify/datastore": { + "version": "5.0.51", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-amplify/api": "6.0.51", + "buffer": "4.9.2", + "idb": "5.0.6", + "immer": "9.0.6", + "rxjs": "^7.8.1", + "ulid": "^2.3.0" + }, + "peerDependencies": { + "@aws-amplify/core": "^6.1.0" + } + }, + "../cori.data.api/node_modules/@aws-amplify/notifications": { + "version": "2.0.49", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "lodash": "^4.17.21", + "tslib": "^2.5.0" + }, + "peerDependencies": { + "@aws-amplify/core": "^6.1.0" + } + }, + "../cori.data.api/node_modules/@aws-amplify/storage": { + "version": "6.6.7", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-sdk/types": "3.398.0", + "@smithy/md5-js": "2.0.7", + "buffer": "4.9.2", + "fast-xml-parser": "^4.4.1", + "tslib": "^2.5.0" + }, + "peerDependencies": { + "@aws-amplify/core": "^6.1.0" + } + }, + "../cori.data.api/node_modules/@aws-amplify/ui": { + "version": "6.6.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "csstype": "^3.1.1", + "lodash": "4.17.21", + "tslib": "^2.5.2" + }, + "peerDependencies": { + "aws-amplify": "^6.3.2", + "xstate": "^4.33.6" + }, + "peerDependenciesMeta": { + "xstate": { + "optional": true + } + } + }, + "../cori.data.api/node_modules/@aws-amplify/ui-react": { + "version": "6.5.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-amplify/ui": "6.6.0", + "@aws-amplify/ui-react-core": "3.0.24", + "@radix-ui/react-direction": "1.0.0", + "@radix-ui/react-dropdown-menu": "1.0.0", + "@radix-ui/react-slider": "1.0.0", + "@xstate/react": "^3.2.2", + "lodash": "4.17.21", + "qrcode": "1.5.0", + "tslib": "^2.5.2" + }, + "peerDependencies": { + "aws-amplify": "^6.3.2", + "react": "^16.14.0 || ^17.0 || ^18.0", + "react-dom": "^16.14.0 || ^17.0 || ^18.0" + }, + "peerDependenciesMeta": { + "aws-amplify": { + "optional": true + } + } + }, + "../cori.data.api/node_modules/@aws-amplify/ui-react-core": { + "version": "3.0.24", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-amplify/ui": "6.6.0", + "@xstate/react": "^3.2.2", + "lodash": "4.17.21", + "react-hook-form": "^7.43.5", + "xstate": "^4.33.6" + }, + "peerDependencies": { + "aws-amplify": "^6.3.2", + "react": "^16.14.0 || ^17.0 || ^18.0" + } + }, + "../cori.data.api/node_modules/@aws-crypto/crc32": { + "version": "5.2.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-crypto/util": "^5.2.0", + "@aws-sdk/types": "^3.222.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-crypto/sha256-browser": { + "version": "5.2.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-crypto/sha256-js": "^5.2.0", + "@aws-crypto/supports-web-crypto": "^5.2.0", + "@aws-crypto/util": "^5.2.0", + "@aws-sdk/types": "^3.222.0", + "@aws-sdk/util-locate-window": "^3.0.0", + "@smithy/util-utf8": "^2.0.0", + "tslib": "^2.6.2" + } + }, + "../cori.data.api/node_modules/@aws-crypto/sha256-js": { + "version": "5.2.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-crypto/util": "^5.2.0", + "@aws-sdk/types": "^3.222.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-crypto/supports-web-crypto": { + "version": "5.2.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + } + }, + "../cori.data.api/node_modules/@aws-crypto/util": { + "version": "5.2.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-sdk/types": "^3.222.0", + "@smithy/util-utf8": "^2.0.0", + "tslib": "^2.6.2" + } + }, + "../cori.data.api/node_modules/@aws-sdk/client-firehose": { + "version": "3.621.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "3.621.0", + "@aws-sdk/client-sts": "3.621.0", + "@aws-sdk/core": "3.621.0", + "@aws-sdk/credential-provider-node": "3.621.0", + "@aws-sdk/middleware-host-header": "3.620.0", + "@aws-sdk/middleware-logger": "3.609.0", + "@aws-sdk/middleware-recursion-detection": "3.620.0", + "@aws-sdk/middleware-user-agent": "3.620.0", + "@aws-sdk/region-config-resolver": "3.614.0", + "@aws-sdk/types": "3.609.0", + "@aws-sdk/util-endpoints": "3.614.0", + "@aws-sdk/util-user-agent-browser": "3.609.0", + "@aws-sdk/util-user-agent-node": "3.614.0", + "@smithy/config-resolver": "^3.0.5", + "@smithy/core": "^2.3.1", + "@smithy/fetch-http-handler": "^3.2.4", + "@smithy/hash-node": "^3.0.3", + "@smithy/invalid-dependency": "^3.0.3", + "@smithy/middleware-content-length": "^3.0.5", + "@smithy/middleware-endpoint": "^3.1.0", + "@smithy/middleware-retry": "^3.0.13", + "@smithy/middleware-serde": "^3.0.3", + "@smithy/middleware-stack": "^3.0.3", + "@smithy/node-config-provider": "^3.1.4", + "@smithy/node-http-handler": "^3.1.4", + "@smithy/protocol-http": "^4.1.0", + "@smithy/smithy-client": "^3.1.11", + "@smithy/types": "^3.3.0", + "@smithy/url-parser": "^3.0.3", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.13", + "@smithy/util-defaults-mode-node": "^3.0.13", + "@smithy/util-endpoints": "^2.0.5", + "@smithy/util-middleware": "^3.0.3", + "@smithy/util-retry": "^3.0.3", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/client-firehose/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/client-firehose/node_modules/@smithy/is-array-buffer": { + "version": "3.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/client-firehose/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/client-firehose/node_modules/@smithy/util-buffer-from": { + "version": "3.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/is-array-buffer": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/client-firehose/node_modules/@smithy/util-utf8": { + "version": "3.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/util-buffer-from": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/client-kinesis": { + "version": "3.621.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "3.621.0", + "@aws-sdk/client-sts": "3.621.0", + "@aws-sdk/core": "3.621.0", + "@aws-sdk/credential-provider-node": "3.621.0", + "@aws-sdk/middleware-host-header": "3.620.0", + "@aws-sdk/middleware-logger": "3.609.0", + "@aws-sdk/middleware-recursion-detection": "3.620.0", + "@aws-sdk/middleware-user-agent": "3.620.0", + "@aws-sdk/region-config-resolver": "3.614.0", + "@aws-sdk/types": "3.609.0", + "@aws-sdk/util-endpoints": "3.614.0", + "@aws-sdk/util-user-agent-browser": "3.609.0", + "@aws-sdk/util-user-agent-node": "3.614.0", + "@smithy/config-resolver": "^3.0.5", + "@smithy/core": "^2.3.1", + "@smithy/eventstream-serde-browser": "^3.0.5", + "@smithy/eventstream-serde-config-resolver": "^3.0.3", + "@smithy/eventstream-serde-node": "^3.0.4", + "@smithy/fetch-http-handler": "^3.2.4", + "@smithy/hash-node": "^3.0.3", + "@smithy/invalid-dependency": "^3.0.3", + "@smithy/middleware-content-length": "^3.0.5", + "@smithy/middleware-endpoint": "^3.1.0", + "@smithy/middleware-retry": "^3.0.13", + "@smithy/middleware-serde": "^3.0.3", + "@smithy/middleware-stack": "^3.0.3", + "@smithy/node-config-provider": "^3.1.4", + "@smithy/node-http-handler": "^3.1.4", + "@smithy/protocol-http": "^4.1.0", + "@smithy/smithy-client": "^3.1.11", + "@smithy/types": "^3.3.0", + "@smithy/url-parser": "^3.0.3", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.13", + "@smithy/util-defaults-mode-node": "^3.0.13", + "@smithy/util-endpoints": "^2.0.5", + "@smithy/util-middleware": "^3.0.3", + "@smithy/util-retry": "^3.0.3", + "@smithy/util-utf8": "^3.0.0", + "@smithy/util-waiter": "^3.1.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/client-kinesis/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/client-kinesis/node_modules/@smithy/is-array-buffer": { + "version": "3.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/client-kinesis/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/client-kinesis/node_modules/@smithy/util-buffer-from": { + "version": "3.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/is-array-buffer": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/client-kinesis/node_modules/@smithy/util-utf8": { + "version": "3.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/util-buffer-from": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/client-personalize-events": { + "version": "3.621.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "3.621.0", + "@aws-sdk/client-sts": "3.621.0", + "@aws-sdk/core": "3.621.0", + "@aws-sdk/credential-provider-node": "3.621.0", + "@aws-sdk/middleware-host-header": "3.620.0", + "@aws-sdk/middleware-logger": "3.609.0", + "@aws-sdk/middleware-recursion-detection": "3.620.0", + "@aws-sdk/middleware-user-agent": "3.620.0", + "@aws-sdk/region-config-resolver": "3.614.0", + "@aws-sdk/types": "3.609.0", + "@aws-sdk/util-endpoints": "3.614.0", + "@aws-sdk/util-user-agent-browser": "3.609.0", + "@aws-sdk/util-user-agent-node": "3.614.0", + "@smithy/config-resolver": "^3.0.5", + "@smithy/core": "^2.3.1", + "@smithy/fetch-http-handler": "^3.2.4", + "@smithy/hash-node": "^3.0.3", + "@smithy/invalid-dependency": "^3.0.3", + "@smithy/middleware-content-length": "^3.0.5", + "@smithy/middleware-endpoint": "^3.1.0", + "@smithy/middleware-retry": "^3.0.13", + "@smithy/middleware-serde": "^3.0.3", + "@smithy/middleware-stack": "^3.0.3", + "@smithy/node-config-provider": "^3.1.4", + "@smithy/node-http-handler": "^3.1.4", + "@smithy/protocol-http": "^4.1.0", + "@smithy/smithy-client": "^3.1.11", + "@smithy/types": "^3.3.0", + "@smithy/url-parser": "^3.0.3", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.13", + "@smithy/util-defaults-mode-node": "^3.0.13", + "@smithy/util-endpoints": "^2.0.5", + "@smithy/util-middleware": "^3.0.3", + "@smithy/util-retry": "^3.0.3", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/client-personalize-events/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/client-personalize-events/node_modules/@smithy/is-array-buffer": { + "version": "3.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/client-personalize-events/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/client-personalize-events/node_modules/@smithy/util-buffer-from": { + "version": "3.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/is-array-buffer": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/client-personalize-events/node_modules/@smithy/util-utf8": { + "version": "3.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/util-buffer-from": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/client-sso": { + "version": "3.621.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.621.0", + "@aws-sdk/middleware-host-header": "3.620.0", + "@aws-sdk/middleware-logger": "3.609.0", + "@aws-sdk/middleware-recursion-detection": "3.620.0", + "@aws-sdk/middleware-user-agent": "3.620.0", + "@aws-sdk/region-config-resolver": "3.614.0", + "@aws-sdk/types": "3.609.0", + "@aws-sdk/util-endpoints": "3.614.0", + "@aws-sdk/util-user-agent-browser": "3.609.0", + "@aws-sdk/util-user-agent-node": "3.614.0", + "@smithy/config-resolver": "^3.0.5", + "@smithy/core": "^2.3.1", + "@smithy/fetch-http-handler": "^3.2.4", + "@smithy/hash-node": "^3.0.3", + "@smithy/invalid-dependency": "^3.0.3", + "@smithy/middleware-content-length": "^3.0.5", + "@smithy/middleware-endpoint": "^3.1.0", + "@smithy/middleware-retry": "^3.0.13", + "@smithy/middleware-serde": "^3.0.3", + "@smithy/middleware-stack": "^3.0.3", + "@smithy/node-config-provider": "^3.1.4", + "@smithy/node-http-handler": "^3.1.4", + "@smithy/protocol-http": "^4.1.0", + "@smithy/smithy-client": "^3.1.11", + "@smithy/types": "^3.3.0", + "@smithy/url-parser": "^3.0.3", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.13", + "@smithy/util-defaults-mode-node": "^3.0.13", + "@smithy/util-endpoints": "^2.0.5", + "@smithy/util-middleware": "^3.0.3", + "@smithy/util-retry": "^3.0.3", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/client-sso-oidc": { + "version": "3.621.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.621.0", + "@aws-sdk/credential-provider-node": "3.621.0", + "@aws-sdk/middleware-host-header": "3.620.0", + "@aws-sdk/middleware-logger": "3.609.0", + "@aws-sdk/middleware-recursion-detection": "3.620.0", + "@aws-sdk/middleware-user-agent": "3.620.0", + "@aws-sdk/region-config-resolver": "3.614.0", + "@aws-sdk/types": "3.609.0", + "@aws-sdk/util-endpoints": "3.614.0", + "@aws-sdk/util-user-agent-browser": "3.609.0", + "@aws-sdk/util-user-agent-node": "3.614.0", + "@smithy/config-resolver": "^3.0.5", + "@smithy/core": "^2.3.1", + "@smithy/fetch-http-handler": "^3.2.4", + "@smithy/hash-node": "^3.0.3", + "@smithy/invalid-dependency": "^3.0.3", + "@smithy/middleware-content-length": "^3.0.5", + "@smithy/middleware-endpoint": "^3.1.0", + "@smithy/middleware-retry": "^3.0.13", + "@smithy/middleware-serde": "^3.0.3", + "@smithy/middleware-stack": "^3.0.3", + "@smithy/node-config-provider": "^3.1.4", + "@smithy/node-http-handler": "^3.1.4", + "@smithy/protocol-http": "^4.1.0", + "@smithy/smithy-client": "^3.1.11", + "@smithy/types": "^3.3.0", + "@smithy/url-parser": "^3.0.3", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.13", + "@smithy/util-defaults-mode-node": "^3.0.13", + "@smithy/util-endpoints": "^2.0.5", + "@smithy/util-middleware": "^3.0.3", + "@smithy/util-retry": "^3.0.3", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.621.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/is-array-buffer": { + "version": "3.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/util-buffer-from": { + "version": "3.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/is-array-buffer": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/util-utf8": { + "version": "3.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/util-buffer-from": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/client-sso/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/client-sso/node_modules/@smithy/is-array-buffer": { + "version": "3.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/client-sso/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/client-sso/node_modules/@smithy/util-buffer-from": { + "version": "3.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/is-array-buffer": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/client-sso/node_modules/@smithy/util-utf8": { + "version": "3.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/util-buffer-from": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/client-sts": { + "version": "3.621.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "3.621.0", + "@aws-sdk/core": "3.621.0", + "@aws-sdk/credential-provider-node": "3.621.0", + "@aws-sdk/middleware-host-header": "3.620.0", + "@aws-sdk/middleware-logger": "3.609.0", + "@aws-sdk/middleware-recursion-detection": "3.620.0", + "@aws-sdk/middleware-user-agent": "3.620.0", + "@aws-sdk/region-config-resolver": "3.614.0", + "@aws-sdk/types": "3.609.0", + "@aws-sdk/util-endpoints": "3.614.0", + "@aws-sdk/util-user-agent-browser": "3.609.0", + "@aws-sdk/util-user-agent-node": "3.614.0", + "@smithy/config-resolver": "^3.0.5", + "@smithy/core": "^2.3.1", + "@smithy/fetch-http-handler": "^3.2.4", + "@smithy/hash-node": "^3.0.3", + "@smithy/invalid-dependency": "^3.0.3", + "@smithy/middleware-content-length": "^3.0.5", + "@smithy/middleware-endpoint": "^3.1.0", + "@smithy/middleware-retry": "^3.0.13", + "@smithy/middleware-serde": "^3.0.3", + "@smithy/middleware-stack": "^3.0.3", + "@smithy/node-config-provider": "^3.1.4", + "@smithy/node-http-handler": "^3.1.4", + "@smithy/protocol-http": "^4.1.0", + "@smithy/smithy-client": "^3.1.11", + "@smithy/types": "^3.3.0", + "@smithy/url-parser": "^3.0.3", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.13", + "@smithy/util-defaults-mode-node": "^3.0.13", + "@smithy/util-endpoints": "^2.0.5", + "@smithy/util-middleware": "^3.0.3", + "@smithy/util-retry": "^3.0.3", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/client-sts/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/client-sts/node_modules/@smithy/is-array-buffer": { + "version": "3.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/client-sts/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/client-sts/node_modules/@smithy/util-buffer-from": { + "version": "3.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/is-array-buffer": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/client-sts/node_modules/@smithy/util-utf8": { + "version": "3.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/util-buffer-from": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/core": { + "version": "3.621.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/core": "^2.3.1", + "@smithy/node-config-provider": "^3.1.4", + "@smithy/protocol-http": "^4.1.0", + "@smithy/signature-v4": "^4.1.0", + "@smithy/smithy-client": "^3.1.11", + "@smithy/types": "^3.3.0", + "@smithy/util-middleware": "^3.0.3", + "fast-xml-parser": "4.4.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/core/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/core/node_modules/fast-xml-parser": { + "version": "4.4.1", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + }, + { + "type": "paypal", + "url": "https://paypal.me/naturalintelligence" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "strnum": "^1.0.5" + }, + "bin": { + "fxparser": "src/cli/cli.js" + } + }, + "../cori.data.api/node_modules/@aws-sdk/credential-provider-env": { + "version": "3.620.1", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-sdk/types": "3.609.0", + "@smithy/property-provider": "^3.1.3", + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/credential-provider-env/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/credential-provider-env/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/credential-provider-http": { + "version": "3.621.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-sdk/types": "3.609.0", + "@smithy/fetch-http-handler": "^3.2.4", + "@smithy/node-http-handler": "^3.1.4", + "@smithy/property-provider": "^3.1.3", + "@smithy/protocol-http": "^4.1.0", + "@smithy/smithy-client": "^3.1.11", + "@smithy/types": "^3.3.0", + "@smithy/util-stream": "^3.1.3", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/credential-provider-http/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/credential-provider-ini": { + "version": "3.621.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-sdk/credential-provider-env": "3.620.1", + "@aws-sdk/credential-provider-http": "3.621.0", + "@aws-sdk/credential-provider-process": "3.620.1", + "@aws-sdk/credential-provider-sso": "3.621.0", + "@aws-sdk/credential-provider-web-identity": "3.621.0", + "@aws-sdk/types": "3.609.0", + "@smithy/credential-provider-imds": "^3.2.0", + "@smithy/property-provider": "^3.1.3", + "@smithy/shared-ini-file-loader": "^3.1.4", + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.621.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/credential-provider-ini/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/credential-provider-ini/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/credential-provider-node": { + "version": "3.621.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-sdk/credential-provider-env": "3.620.1", + "@aws-sdk/credential-provider-http": "3.621.0", + "@aws-sdk/credential-provider-ini": "3.621.0", + "@aws-sdk/credential-provider-process": "3.620.1", + "@aws-sdk/credential-provider-sso": "3.621.0", + "@aws-sdk/credential-provider-web-identity": "3.621.0", + "@aws-sdk/types": "3.609.0", + "@smithy/credential-provider-imds": "^3.2.0", + "@smithy/property-provider": "^3.1.3", + "@smithy/shared-ini-file-loader": "^3.1.4", + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/credential-provider-node/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/credential-provider-node/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/credential-provider-process": { + "version": "3.620.1", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-sdk/types": "3.609.0", + "@smithy/property-provider": "^3.1.3", + "@smithy/shared-ini-file-loader": "^3.1.4", + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/credential-provider-process/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/credential-provider-process/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/credential-provider-sso": { + "version": "3.621.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-sdk/client-sso": "3.621.0", + "@aws-sdk/token-providers": "3.614.0", + "@aws-sdk/types": "3.609.0", + "@smithy/property-provider": "^3.1.3", + "@smithy/shared-ini-file-loader": "^3.1.4", + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/credential-provider-sso/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/credential-provider-web-identity": { + "version": "3.621.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-sdk/types": "3.609.0", + "@smithy/property-provider": "^3.1.3", + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.621.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/middleware-host-header": { + "version": "3.620.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-sdk/types": "3.609.0", + "@smithy/protocol-http": "^4.1.0", + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/middleware-host-header/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/middleware-host-header/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/middleware-logger": { + "version": "3.609.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-sdk/types": "3.609.0", + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/middleware-logger/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/middleware-logger/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/middleware-recursion-detection": { + "version": "3.620.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-sdk/types": "3.609.0", + "@smithy/protocol-http": "^4.1.0", + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/middleware-recursion-detection/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/middleware-recursion-detection/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/middleware-user-agent": { + "version": "3.620.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-sdk/types": "3.609.0", + "@aws-sdk/util-endpoints": "3.614.0", + "@smithy/protocol-http": "^4.1.0", + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/middleware-user-agent/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/middleware-user-agent/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/region-config-resolver": { + "version": "3.614.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-sdk/types": "3.609.0", + "@smithy/node-config-provider": "^3.1.4", + "@smithy/types": "^3.3.0", + "@smithy/util-config-provider": "^3.0.0", + "@smithy/util-middleware": "^3.0.3", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/region-config-resolver/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/region-config-resolver/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/token-providers": { + "version": "3.614.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-sdk/types": "3.609.0", + "@smithy/property-provider": "^3.1.3", + "@smithy/shared-ini-file-loader": "^3.1.4", + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sso-oidc": "^3.614.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/token-providers/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/token-providers/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/types": { + "version": "3.398.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^2.2.2", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/util-endpoints": { + "version": "3.614.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-sdk/types": "3.609.0", + "@smithy/types": "^3.3.0", + "@smithy/util-endpoints": "^2.0.5", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/util-endpoints/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/util-endpoints/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/util-locate-window": { + "version": "3.568.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/util-user-agent-browser": { + "version": "3.609.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-sdk/types": "3.609.0", + "@smithy/types": "^3.3.0", + "bowser": "^2.11.0", + "tslib": "^2.6.2" + } + }, + "../cori.data.api/node_modules/@aws-sdk/util-user-agent-browser/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/util-user-agent-browser/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/util-user-agent-node": { + "version": "3.614.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-sdk/types": "3.609.0", + "@smithy/node-config-provider": "^3.1.4", + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "aws-crt": ">=1.0.0" + }, + "peerDependenciesMeta": { + "aws-crt": { + "optional": true + } + } + }, + "../cori.data.api/node_modules/@aws-sdk/util-user-agent-node/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@aws-sdk/util-user-agent-node/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@babel/code-frame": { + "version": "7.24.7", + "license": "MIT", + "dependencies": { + "@babel/highlight": "^7.24.7", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "../cori.data.api/node_modules/@babel/compat-data": { + "version": "7.25.4", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "../cori.data.api/node_modules/@babel/core": { + "version": "7.25.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.24.7", + "@babel/generator": "^7.25.0", + "@babel/helper-compilation-targets": "^7.25.2", + "@babel/helper-module-transforms": "^7.25.2", + "@babel/helpers": "^7.25.0", + "@babel/parser": "^7.25.0", + "@babel/template": "^7.25.0", + "@babel/traverse": "^7.25.2", + "@babel/types": "^7.25.2", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "../cori.data.api/node_modules/@babel/generator": { + "version": "7.25.6", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.25.6", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", + "jsesc": "^2.5.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "../cori.data.api/node_modules/@babel/helper-annotate-as-pure": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "../cori.data.api/node_modules/@babel/helper-builder-binary-assignment-operator-visitor": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "../cori.data.api/node_modules/@babel/helper-compilation-targets": { + "version": "7.25.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.25.2", + "@babel/helper-validator-option": "^7.24.8", + "browserslist": "^4.23.1", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "../cori.data.api/node_modules/@babel/helper-create-class-features-plugin": { + "version": "7.25.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.24.7", + "@babel/helper-member-expression-to-functions": "^7.24.8", + "@babel/helper-optimise-call-expression": "^7.24.7", + "@babel/helper-replace-supers": "^7.25.0", + "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7", + "@babel/traverse": "^7.25.4", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "../cori.data.api/node_modules/@babel/helper-create-regexp-features-plugin": { + "version": "7.25.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.24.7", + "regexpu-core": "^5.3.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "../cori.data.api/node_modules/@babel/helper-define-polyfill-provider": { + "version": "0.6.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-compilation-targets": "^7.22.6", + "@babel/helper-plugin-utils": "^7.22.5", + "debug": "^4.1.1", + "lodash.debounce": "^4.0.8", + "resolve": "^1.14.2" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + } + }, + "../cori.data.api/node_modules/@babel/helper-member-expression-to-functions": { + "version": "7.24.8", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.24.8", + "@babel/types": "^7.24.8" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "../cori.data.api/node_modules/@babel/helper-module-imports": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "../cori.data.api/node_modules/@babel/helper-module-transforms": { + "version": "7.25.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.24.7", + "@babel/helper-simple-access": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", + "@babel/traverse": "^7.25.2" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "../cori.data.api/node_modules/@babel/helper-optimise-call-expression": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "../cori.data.api/node_modules/@babel/helper-plugin-utils": { + "version": "7.24.8", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "../cori.data.api/node_modules/@babel/helper-remap-async-to-generator": { + "version": "7.25.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.24.7", + "@babel/helper-wrap-function": "^7.25.0", + "@babel/traverse": "^7.25.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "../cori.data.api/node_modules/@babel/helper-replace-supers": { + "version": "7.25.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-member-expression-to-functions": "^7.24.8", + "@babel/helper-optimise-call-expression": "^7.24.7", + "@babel/traverse": "^7.25.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "../cori.data.api/node_modules/@babel/helper-simple-access": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "../cori.data.api/node_modules/@babel/helper-skip-transparent-expression-wrappers": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "../cori.data.api/node_modules/@babel/helper-string-parser": { + "version": "7.24.8", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "../cori.data.api/node_modules/@babel/helper-validator-identifier": { + "version": "7.24.7", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "../cori.data.api/node_modules/@babel/helper-validator-option": { + "version": "7.24.8", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "../cori.data.api/node_modules/@babel/helper-wrap-function": { + "version": "7.25.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.25.0", + "@babel/traverse": "^7.25.0", + "@babel/types": "^7.25.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "../cori.data.api/node_modules/@babel/helpers": { + "version": "7.25.6", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/template": "^7.25.0", + "@babel/types": "^7.25.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "../cori.data.api/node_modules/@babel/highlight": { + "version": "7.24.7", + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.24.7", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "../cori.data.api/node_modules/@babel/parser": { + "version": "7.25.6", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.25.6" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-bugfix-firefox-class-in-computed-class-key": { + "version": "7.25.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/traverse": "^7.25.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-bugfix-safari-class-field-initializer-scope": { + "version": "7.25.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.8" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { + "version": "7.25.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.8" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7", + "@babel/plugin-transform-optional-chaining": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.13.0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": { + "version": "7.25.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/traverse": "^7.25.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-proposal-private-property-in-object": { + "version": "7.21.0-placeholder-for-preset-env.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-syntax-bigint": { + "version": "7.8.3", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-syntax-class-properties": { + "version": "7.12.13", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-syntax-class-static-block": { + "version": "7.14.5", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-syntax-dynamic-import": { + "version": "7.8.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-syntax-export-namespace-from": { + "version": "7.8.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-syntax-import-assertions": { + "version": "7.25.6", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.8" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-syntax-import-attributes": { + "version": "7.25.6", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.8" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-syntax-import-meta": { + "version": "7.10.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-syntax-jsx": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-syntax-private-property-in-object": { + "version": "7.14.5", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-syntax-top-level-await": { + "version": "7.14.5", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-syntax-typescript": { + "version": "7.25.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.8" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-syntax-unicode-sets-regex": { + "version": "7.18.6", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.18.6", + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-arrow-functions": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-async-generator-functions": { + "version": "7.25.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/helper-remap-async-to-generator": "^7.25.0", + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/traverse": "^7.25.4" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-async-to-generator": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-remap-async-to-generator": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-block-scoped-functions": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-block-scoping": { + "version": "7.25.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.8" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-class-properties": { + "version": "7.25.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.25.4", + "@babel/helper-plugin-utils": "^7.24.8" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-class-static-block": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/plugin-syntax-class-static-block": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.12.0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-classes": { + "version": "7.25.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.24.7", + "@babel/helper-compilation-targets": "^7.25.2", + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/helper-replace-supers": "^7.25.0", + "@babel/traverse": "^7.25.4", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-computed-properties": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/template": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-destructuring": { + "version": "7.24.8", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.8" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-dotall-regex": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-duplicate-keys": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-duplicate-named-capturing-groups-regex": { + "version": "7.25.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.25.0", + "@babel/helper-plugin-utils": "^7.24.8" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-dynamic-import": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/plugin-syntax-dynamic-import": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-exponentiation-operator": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-export-namespace-from": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/plugin-syntax-export-namespace-from": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-for-of": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-function-name": { + "version": "7.25.1", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-compilation-targets": "^7.24.8", + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/traverse": "^7.25.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-json-strings": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/plugin-syntax-json-strings": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-literals": { + "version": "7.25.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.8" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-logical-assignment-operators": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-member-expression-literals": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-modules-amd": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-transforms": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-modules-commonjs": { + "version": "7.24.8", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-transforms": "^7.24.8", + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/helper-simple-access": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-modules-systemjs": { + "version": "7.25.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-transforms": "^7.25.0", + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/helper-validator-identifier": "^7.24.7", + "@babel/traverse": "^7.25.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-modules-umd": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-transforms": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-named-capturing-groups-regex": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-new-target": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-nullish-coalescing-operator": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-numeric-separator": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/plugin-syntax-numeric-separator": "^7.10.4" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-object-rest-spread": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-compilation-targets": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-transform-parameters": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-object-super": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-replace-supers": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-optional-catch-binding": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-optional-chaining": { + "version": "7.24.8", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7", + "@babel/plugin-syntax-optional-chaining": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-parameters": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-private-methods": { + "version": "7.25.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.25.4", + "@babel/helper-plugin-utils": "^7.24.8" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-private-property-in-object": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.24.7", + "@babel/helper-create-class-features-plugin": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-property-literals": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-react-display-name": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-react-jsx": { + "version": "7.25.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.24.7", + "@babel/helper-module-imports": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/plugin-syntax-jsx": "^7.24.7", + "@babel/types": "^7.25.2" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-react-jsx-development": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/plugin-transform-react-jsx": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-react-pure-annotations": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-regenerator": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7", + "regenerator-transform": "^0.15.2" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-reserved-words": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-shorthand-properties": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-spread": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-sticky-regex": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-template-literals": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-typeof-symbol": { + "version": "7.24.8", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.8" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-typescript": { + "version": "7.25.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.24.7", + "@babel/helper-create-class-features-plugin": "^7.25.0", + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7", + "@babel/plugin-syntax-typescript": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-unicode-escapes": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-unicode-property-regex": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-unicode-regex": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/plugin-transform-unicode-sets-regex": { + "version": "7.25.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.25.2", + "@babel/helper-plugin-utils": "^7.24.8" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "../cori.data.api/node_modules/@babel/preset-env": { + "version": "7.25.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.25.4", + "@babel/helper-compilation-targets": "^7.25.2", + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/helper-validator-option": "^7.24.8", + "@babel/plugin-bugfix-firefox-class-in-computed-class-key": "^7.25.3", + "@babel/plugin-bugfix-safari-class-field-initializer-scope": "^7.25.0", + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.25.0", + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.24.7", + "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": "^7.25.0", + "@babel/plugin-proposal-private-property-in-object": "7.21.0-placeholder-for-preset-env.2", + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-class-properties": "^7.12.13", + "@babel/plugin-syntax-class-static-block": "^7.14.5", + "@babel/plugin-syntax-dynamic-import": "^7.8.3", + "@babel/plugin-syntax-export-namespace-from": "^7.8.3", + "@babel/plugin-syntax-import-assertions": "^7.24.7", + "@babel/plugin-syntax-import-attributes": "^7.24.7", + "@babel/plugin-syntax-import-meta": "^7.10.4", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.10.4", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5", + "@babel/plugin-syntax-top-level-await": "^7.14.5", + "@babel/plugin-syntax-unicode-sets-regex": "^7.18.6", + "@babel/plugin-transform-arrow-functions": "^7.24.7", + "@babel/plugin-transform-async-generator-functions": "^7.25.4", + "@babel/plugin-transform-async-to-generator": "^7.24.7", + "@babel/plugin-transform-block-scoped-functions": "^7.24.7", + "@babel/plugin-transform-block-scoping": "^7.25.0", + "@babel/plugin-transform-class-properties": "^7.25.4", + "@babel/plugin-transform-class-static-block": "^7.24.7", + "@babel/plugin-transform-classes": "^7.25.4", + "@babel/plugin-transform-computed-properties": "^7.24.7", + "@babel/plugin-transform-destructuring": "^7.24.8", + "@babel/plugin-transform-dotall-regex": "^7.24.7", + "@babel/plugin-transform-duplicate-keys": "^7.24.7", + "@babel/plugin-transform-duplicate-named-capturing-groups-regex": "^7.25.0", + "@babel/plugin-transform-dynamic-import": "^7.24.7", + "@babel/plugin-transform-exponentiation-operator": "^7.24.7", + "@babel/plugin-transform-export-namespace-from": "^7.24.7", + "@babel/plugin-transform-for-of": "^7.24.7", + "@babel/plugin-transform-function-name": "^7.25.1", + "@babel/plugin-transform-json-strings": "^7.24.7", + "@babel/plugin-transform-literals": "^7.25.2", + "@babel/plugin-transform-logical-assignment-operators": "^7.24.7", + "@babel/plugin-transform-member-expression-literals": "^7.24.7", + "@babel/plugin-transform-modules-amd": "^7.24.7", + "@babel/plugin-transform-modules-commonjs": "^7.24.8", + "@babel/plugin-transform-modules-systemjs": "^7.25.0", + "@babel/plugin-transform-modules-umd": "^7.24.7", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.24.7", + "@babel/plugin-transform-new-target": "^7.24.7", + "@babel/plugin-transform-nullish-coalescing-operator": "^7.24.7", + "@babel/plugin-transform-numeric-separator": "^7.24.7", + "@babel/plugin-transform-object-rest-spread": "^7.24.7", + "@babel/plugin-transform-object-super": "^7.24.7", + "@babel/plugin-transform-optional-catch-binding": "^7.24.7", + "@babel/plugin-transform-optional-chaining": "^7.24.8", + "@babel/plugin-transform-parameters": "^7.24.7", + "@babel/plugin-transform-private-methods": "^7.25.4", + "@babel/plugin-transform-private-property-in-object": "^7.24.7", + "@babel/plugin-transform-property-literals": "^7.24.7", + "@babel/plugin-transform-regenerator": "^7.24.7", + "@babel/plugin-transform-reserved-words": "^7.24.7", + "@babel/plugin-transform-shorthand-properties": "^7.24.7", + "@babel/plugin-transform-spread": "^7.24.7", + "@babel/plugin-transform-sticky-regex": "^7.24.7", + "@babel/plugin-transform-template-literals": "^7.24.7", + "@babel/plugin-transform-typeof-symbol": "^7.24.8", + "@babel/plugin-transform-unicode-escapes": "^7.24.7", + "@babel/plugin-transform-unicode-property-regex": "^7.24.7", + "@babel/plugin-transform-unicode-regex": "^7.24.7", + "@babel/plugin-transform-unicode-sets-regex": "^7.25.4", + "@babel/preset-modules": "0.1.6-no-external-plugins", + "babel-plugin-polyfill-corejs2": "^0.4.10", + "babel-plugin-polyfill-corejs3": "^0.10.6", + "babel-plugin-polyfill-regenerator": "^0.6.1", + "core-js-compat": "^3.37.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/preset-modules": { + "version": "0.1.6-no-external-plugins", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/types": "^7.4.4", + "esutils": "^2.0.2" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0 || ^8.0.0-0 <8.0.0" + } + }, + "../cori.data.api/node_modules/@babel/preset-react": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-validator-option": "^7.24.7", + "@babel/plugin-transform-react-display-name": "^7.24.7", + "@babel/plugin-transform-react-jsx": "^7.24.7", + "@babel/plugin-transform-react-jsx-development": "^7.24.7", + "@babel/plugin-transform-react-pure-annotations": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/preset-typescript": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-validator-option": "^7.24.7", + "@babel/plugin-syntax-jsx": "^7.24.7", + "@babel/plugin-transform-modules-commonjs": "^7.24.7", + "@babel/plugin-transform-typescript": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "../cori.data.api/node_modules/@babel/regjsgen": { + "version": "0.8.0", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/@babel/runtime": { + "version": "7.25.6", + "license": "MIT", + "dependencies": { + "regenerator-runtime": "^0.14.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "../cori.data.api/node_modules/@babel/template": { + "version": "7.25.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.24.7", + "@babel/parser": "^7.25.0", + "@babel/types": "^7.25.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "../cori.data.api/node_modules/@babel/traverse": { + "version": "7.25.6", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.24.7", + "@babel/generator": "^7.25.6", + "@babel/parser": "^7.25.6", + "@babel/template": "^7.25.0", + "@babel/types": "^7.25.6", + "debug": "^4.3.1", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "../cori.data.api/node_modules/@babel/types": { + "version": "7.25.6", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.24.8", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "../cori.data.api/node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "dev": true, + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/@cori-risi/cori.data.api": { + "resolved": "../cori.data.api", + "link": true + }, + "../cori.data.api/node_modules/@deck.gl/core": { + "version": "9.0.30", + "license": "MIT", + "peer": true, + "dependencies": { + "@loaders.gl/core": "^4.2.0", + "@loaders.gl/images": "^4.2.0", + "@luma.gl/constants": "~9.0.27", + "@luma.gl/core": "~9.0.27", + "@luma.gl/engine": "~9.0.27", + "@luma.gl/shadertools": "~9.0.27", + "@luma.gl/webgl": "~9.0.27", + "@math.gl/core": "^4.0.0", + "@math.gl/sun": "^4.0.0", + "@math.gl/web-mercator": "^4.0.0", + "@probe.gl/env": "^4.0.9", + "@probe.gl/log": "^4.0.9", + "@probe.gl/stats": "^4.0.9", + "@types/offscreencanvas": "^2019.6.4", + "gl-matrix": "^3.0.0", + "mjolnir.js": "^2.7.0" + } + }, + "../cori.data.api/node_modules/@deck.gl/mapbox": { + "version": "9.0.30", + "license": "MIT", + "peer": true, + "dependencies": { + "@luma.gl/constants": "~9.0.27", + "@math.gl/web-mercator": "^4.0.0" + }, + "peerDependencies": { + "@deck.gl/core": "^9.0.0", + "@luma.gl/core": "~9.0.0" + } + }, + "../cori.data.api/node_modules/@floating-ui/core": { + "version": "0.7.3", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/@floating-ui/dom": { + "version": "0.5.4", + "license": "MIT", + "peer": true, + "dependencies": { + "@floating-ui/core": "^0.7.3" + } + }, + "../cori.data.api/node_modules/@floating-ui/react-dom": { + "version": "0.7.2", + "license": "MIT", + "peer": true, + "dependencies": { + "@floating-ui/dom": "^0.5.3", + "use-isomorphic-layout-effect": "^1.1.1" + }, + "peerDependencies": { + "react": ">=16.8.0", + "react-dom": ">=16.8.0" + } + }, + "../cori.data.api/node_modules/@isaacs/cliui": { + "version": "8.0.2", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/@jest/console": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "../cori.data.api/node_modules/@jest/console/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "../cori.data.api/node_modules/@jest/console/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "../cori.data.api/node_modules/@jest/console/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/@jest/console/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/@jest/core": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/reporters": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-changed-files": "^29.7.0", + "jest-config": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-resolve-dependencies": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "jest-watcher": "^29.7.0", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "../cori.data.api/node_modules/@jest/core/node_modules/ansi-regex": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/@jest/core/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "../cori.data.api/node_modules/@jest/core/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "../cori.data.api/node_modules/@jest/core/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/@jest/core/node_modules/strip-ansi": { + "version": "6.0.1", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/@jest/core/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/@jest/environment": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "../cori.data.api/node_modules/@jest/expect": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "expect": "^29.7.0", + "jest-snapshot": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "../cori.data.api/node_modules/@jest/expect-utils": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "jest-get-type": "^29.6.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "../cori.data.api/node_modules/@jest/fake-timers": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@sinonjs/fake-timers": "^10.0.2", + "@types/node": "*", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "../cori.data.api/node_modules/@jest/globals": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/types": "^29.6.3", + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "../cori.data.api/node_modules/@jest/reporters": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@bcoe/v8-coverage": "^0.2.3", + "@jest/console": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "@types/node": "*", + "chalk": "^4.0.0", + "collect-v8-coverage": "^1.0.0", + "exit": "^0.1.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-instrument": "^6.0.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.1.3", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "slash": "^3.0.0", + "string-length": "^4.0.1", + "strip-ansi": "^6.0.0", + "v8-to-istanbul": "^9.0.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "../cori.data.api/node_modules/@jest/reporters/node_modules/ansi-regex": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/@jest/reporters/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "../cori.data.api/node_modules/@jest/reporters/node_modules/brace-expansion": { + "version": "1.1.11", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "../cori.data.api/node_modules/@jest/reporters/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "../cori.data.api/node_modules/@jest/reporters/node_modules/glob": { + "version": "7.2.3", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "../cori.data.api/node_modules/@jest/reporters/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/@jest/reporters/node_modules/minimatch": { + "version": "3.1.2", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "../cori.data.api/node_modules/@jest/reporters/node_modules/strip-ansi": { + "version": "6.0.1", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/@jest/reporters/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/@jest/schemas": { + "version": "29.6.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@sinclair/typebox": "^0.27.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "../cori.data.api/node_modules/@jest/source-map": { + "version": "29.6.3", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.18", + "callsites": "^3.0.0", + "graceful-fs": "^4.2.9" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "../cori.data.api/node_modules/@jest/test-result": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "collect-v8-coverage": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "../cori.data.api/node_modules/@jest/test-sequencer": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/test-result": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "../cori.data.api/node_modules/@jest/transform": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "babel-plugin-istanbul": "^6.1.1", + "chalk": "^4.0.0", + "convert-source-map": "^2.0.0", + "fast-json-stable-stringify": "^2.1.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "micromatch": "^4.0.4", + "pirates": "^4.0.4", + "slash": "^3.0.0", + "write-file-atomic": "^4.0.2" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "../cori.data.api/node_modules/@jest/transform/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "../cori.data.api/node_modules/@jest/transform/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "../cori.data.api/node_modules/@jest/transform/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/@jest/transform/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/@jest/types": { + "version": "29.6.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^17.0.8", + "chalk": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "../cori.data.api/node_modules/@jest/types/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "../cori.data.api/node_modules/@jest/types/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "../cori.data.api/node_modules/@jest/types/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/@jest/types/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/@jridgewell/gen-mapping": { + "version": "0.3.5", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "../cori.data.api/node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "../cori.data.api/node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "../cori.data.api/node_modules/@jridgewell/source-map": { + "version": "0.3.6", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" + } + }, + "../cori.data.api/node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "../cori.data.api/node_modules/@loaders.gl/core": { + "version": "4.2.4", + "license": "MIT", + "peer": true, + "dependencies": { + "@loaders.gl/loader-utils": "4.2.4", + "@loaders.gl/schema": "4.2.4", + "@loaders.gl/worker-utils": "4.2.4", + "@probe.gl/log": "^4.0.2" + } + }, + "../cori.data.api/node_modules/@loaders.gl/images": { + "version": "4.2.4", + "license": "MIT", + "peer": true, + "dependencies": { + "@loaders.gl/loader-utils": "4.2.4" + }, + "peerDependencies": { + "@loaders.gl/core": "^4.0.0" + } + }, + "../cori.data.api/node_modules/@loaders.gl/loader-utils": { + "version": "4.2.4", + "license": "MIT", + "peer": true, + "dependencies": { + "@loaders.gl/schema": "4.2.4", + "@loaders.gl/worker-utils": "4.2.4", + "@probe.gl/stats": "^4.0.2" + }, + "peerDependencies": { + "@loaders.gl/core": "^4.0.0" + } + }, + "../cori.data.api/node_modules/@loaders.gl/schema": { + "version": "4.2.4", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/geojson": "^7946.0.7" + }, + "peerDependencies": { + "@loaders.gl/core": "^4.0.0" + } + }, + "../cori.data.api/node_modules/@loaders.gl/worker-utils": { + "version": "4.2.4", + "license": "MIT", + "peer": true, + "peerDependencies": { + "@loaders.gl/core": "^4.0.0" + } + }, + "../cori.data.api/node_modules/@luma.gl/constants": { + "version": "9.0.27", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/@luma.gl/core": { + "version": "9.0.27", + "license": "MIT", + "peer": true, + "dependencies": { + "@math.gl/types": "^4.0.0", + "@probe.gl/env": "^4.0.2", + "@probe.gl/log": "^4.0.2", + "@probe.gl/stats": "^4.0.2", + "@types/offscreencanvas": "^2019.6.4" + } + }, + "../cori.data.api/node_modules/@luma.gl/engine": { + "version": "9.0.27", + "license": "MIT", + "peer": true, + "dependencies": { + "@luma.gl/shadertools": "9.0.27", + "@math.gl/core": "^4.0.0", + "@probe.gl/log": "^4.0.2", + "@probe.gl/stats": "^4.0.2" + }, + "peerDependencies": { + "@luma.gl/core": "^9.0.0" + } + }, + "../cori.data.api/node_modules/@luma.gl/shadertools": { + "version": "9.0.27", + "license": "MIT", + "peer": true, + "dependencies": { + "@math.gl/core": "^4.0.0", + "@math.gl/types": "^4.0.0", + "wgsl_reflect": "^1.0.1" + }, + "peerDependencies": { + "@luma.gl/core": "^9.0.0" + } + }, + "../cori.data.api/node_modules/@luma.gl/webgl": { + "version": "9.0.27", + "license": "MIT", + "peer": true, + "dependencies": { + "@luma.gl/constants": "9.0.27", + "@probe.gl/env": "^4.0.2" + }, + "peerDependencies": { + "@luma.gl/core": "^9.0.0" + } + }, + "../cori.data.api/node_modules/@mapbox/fusspot": { + "version": "0.4.0", + "license": "BSD 2-Clause", + "peer": true, + "dependencies": { + "is-plain-obj": "^1.1.0", + "xtend": "^4.0.1" + } + }, + "../cori.data.api/node_modules/@mapbox/geojson-rewind": { + "version": "0.5.2", + "license": "ISC", + "peer": true, + "dependencies": { + "get-stream": "^6.0.1", + "minimist": "^1.2.6" + }, + "bin": { + "geojson-rewind": "geojson-rewind" + } + }, + "../cori.data.api/node_modules/@mapbox/geojson-rewind/node_modules/get-stream": { + "version": "6.0.1", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../cori.data.api/node_modules/@mapbox/jsonlint-lines-primitives": { + "version": "2.0.2", + "peer": true, + "engines": { + "node": ">= 0.6" + } + }, + "../cori.data.api/node_modules/@mapbox/mapbox-gl-geocoder": { + "version": "4.7.4", + "license": "ISC", + "peer": true, + "dependencies": { + "@mapbox/mapbox-sdk": "^0.13.2", + "lodash.debounce": "^4.0.6", + "nanoid": "^2.0.1", + "subtag": "^0.5.0", + "suggestions": "^1.6.0", + "xtend": "^4.0.1" + }, + "engines": { + "node": ">=6" + }, + "peerDependencies": { + "mapbox-gl": ">= 0.47.0 < 3.0.0" + } + }, + "../cori.data.api/node_modules/@mapbox/mapbox-gl-supported": { + "version": "2.0.1", + "license": "BSD-3-Clause", + "peer": true + }, + "../cori.data.api/node_modules/@mapbox/mapbox-sdk": { + "version": "0.13.7", + "license": "BSD-2-Clause", + "peer": true, + "dependencies": { + "@mapbox/fusspot": "^0.4.0", + "@mapbox/parse-mapbox-token": "^0.2.0", + "@mapbox/polyline": "^1.0.0", + "eventemitter3": "^3.1.0", + "form-data": "^3.0.0", + "got": "^11.8.5", + "is-plain-obj": "^1.1.0", + "xtend": "^4.0.1" + }, + "engines": { + "node": ">=6" + } + }, + "../cori.data.api/node_modules/@mapbox/parse-mapbox-token": { + "version": "0.2.0", + "license": "BSD-2-Clause", + "peer": true, + "dependencies": { + "base-64": "^0.1.0" + } + }, + "../cori.data.api/node_modules/@mapbox/point-geometry": { + "version": "0.1.0", + "license": "ISC", + "peer": true + }, + "../cori.data.api/node_modules/@mapbox/polyline": { + "version": "1.2.1", + "peer": true, + "dependencies": { + "meow": "^9.0.0" + }, + "bin": { + "polyline": "bin/polyline.bin.js" + } + }, + "../cori.data.api/node_modules/@mapbox/tiny-sdf": { + "version": "2.0.6", + "license": "BSD-2-Clause", + "peer": true + }, + "../cori.data.api/node_modules/@mapbox/unitbezier": { + "version": "0.0.1", + "license": "BSD-2-Clause", + "peer": true + }, + "../cori.data.api/node_modules/@mapbox/vector-tile": { + "version": "1.3.1", + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "@mapbox/point-geometry": "~0.1.0" + } + }, + "../cori.data.api/node_modules/@mapbox/whoots-js": { + "version": "3.1.0", + "license": "ISC", + "peer": true, + "engines": { + "node": ">=6.0.0" + } + }, + "../cori.data.api/node_modules/@maplibre/maplibre-gl-style-spec": { + "version": "19.3.3", + "license": "ISC", + "peer": true, + "dependencies": { + "@mapbox/jsonlint-lines-primitives": "~2.0.2", + "@mapbox/unitbezier": "^0.0.1", + "json-stringify-pretty-compact": "^3.0.0", + "minimist": "^1.2.8", + "rw": "^1.3.3", + "sort-object": "^3.0.3" + }, + "bin": { + "gl-style-format": "dist/gl-style-format.mjs", + "gl-style-migrate": "dist/gl-style-migrate.mjs", + "gl-style-validate": "dist/gl-style-validate.mjs" + } + }, + "../cori.data.api/node_modules/@math.gl/core": { + "version": "4.1.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@math.gl/types": "4.1.0" + } + }, + "../cori.data.api/node_modules/@math.gl/sun": { + "version": "4.1.0", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/@math.gl/types": { + "version": "4.1.0", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/@math.gl/web-mercator": { + "version": "4.1.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@math.gl/core": "4.1.0" + } + }, + "../cori.data.api/node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "../cori.data.api/node_modules/@probe.gl/env": { + "version": "4.0.9", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/@probe.gl/log": { + "version": "4.0.9", + "license": "MIT", + "peer": true, + "dependencies": { + "@probe.gl/env": "4.0.9" + } + }, + "../cori.data.api/node_modules/@probe.gl/stats": { + "version": "4.0.9", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/@radix-ui/number": { + "version": "1.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.13.10" + } + }, + "../cori.data.api/node_modules/@radix-ui/primitive": { + "version": "1.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.13.10" + } + }, + "../cori.data.api/node_modules/@radix-ui/react-arrow": { + "version": "1.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/react-primitive": "1.0.0" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + } + }, + "../cori.data.api/node_modules/@radix-ui/react-collection": { + "version": "1.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/react-compose-refs": "1.0.0", + "@radix-ui/react-context": "1.0.0", + "@radix-ui/react-primitive": "1.0.0", + "@radix-ui/react-slot": "1.0.0" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + } + }, + "../cori.data.api/node_modules/@radix-ui/react-compose-refs": { + "version": "1.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.13.10" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0" + } + }, + "../cori.data.api/node_modules/@radix-ui/react-context": { + "version": "1.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.13.10" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0" + } + }, + "../cori.data.api/node_modules/@radix-ui/react-direction": { + "version": "1.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.13.10" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0" + } + }, + "../cori.data.api/node_modules/@radix-ui/react-dismissable-layer": { + "version": "1.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/primitive": "1.0.0", + "@radix-ui/react-compose-refs": "1.0.0", + "@radix-ui/react-primitive": "1.0.0", + "@radix-ui/react-use-callback-ref": "1.0.0", + "@radix-ui/react-use-escape-keydown": "1.0.0" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + } + }, + "../cori.data.api/node_modules/@radix-ui/react-dropdown-menu": { + "version": "1.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/primitive": "1.0.0", + "@radix-ui/react-compose-refs": "1.0.0", + "@radix-ui/react-context": "1.0.0", + "@radix-ui/react-id": "1.0.0", + "@radix-ui/react-menu": "1.0.0", + "@radix-ui/react-primitive": "1.0.0", + "@radix-ui/react-use-controllable-state": "1.0.0" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + } + }, + "../cori.data.api/node_modules/@radix-ui/react-focus-guards": { + "version": "1.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.13.10" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0" + } + }, + "../cori.data.api/node_modules/@radix-ui/react-focus-scope": { + "version": "1.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/react-compose-refs": "1.0.0", + "@radix-ui/react-primitive": "1.0.0", + "@radix-ui/react-use-callback-ref": "1.0.0" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + } + }, + "../cori.data.api/node_modules/@radix-ui/react-id": { + "version": "1.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/react-use-layout-effect": "1.0.0" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0" + } + }, + "../cori.data.api/node_modules/@radix-ui/react-menu": { + "version": "1.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/primitive": "1.0.0", + "@radix-ui/react-collection": "1.0.0", + "@radix-ui/react-compose-refs": "1.0.0", + "@radix-ui/react-context": "1.0.0", + "@radix-ui/react-direction": "1.0.0", + "@radix-ui/react-dismissable-layer": "1.0.0", + "@radix-ui/react-focus-guards": "1.0.0", + "@radix-ui/react-focus-scope": "1.0.0", + "@radix-ui/react-id": "1.0.0", + "@radix-ui/react-popper": "1.0.0", + "@radix-ui/react-portal": "1.0.0", + "@radix-ui/react-presence": "1.0.0", + "@radix-ui/react-primitive": "1.0.0", + "@radix-ui/react-roving-focus": "1.0.0", + "@radix-ui/react-slot": "1.0.0", + "@radix-ui/react-use-callback-ref": "1.0.0", + "aria-hidden": "^1.1.1", + "react-remove-scroll": "2.5.4" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + } + }, + "../cori.data.api/node_modules/@radix-ui/react-popper": { + "version": "1.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.13.10", + "@floating-ui/react-dom": "0.7.2", + "@radix-ui/react-arrow": "1.0.0", + "@radix-ui/react-compose-refs": "1.0.0", + "@radix-ui/react-context": "1.0.0", + "@radix-ui/react-primitive": "1.0.0", + "@radix-ui/react-use-layout-effect": "1.0.0", + "@radix-ui/react-use-rect": "1.0.0", + "@radix-ui/react-use-size": "1.0.0", + "@radix-ui/rect": "1.0.0" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + } + }, + "../cori.data.api/node_modules/@radix-ui/react-portal": { + "version": "1.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/react-primitive": "1.0.0" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + } + }, + "../cori.data.api/node_modules/@radix-ui/react-presence": { + "version": "1.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/react-compose-refs": "1.0.0", + "@radix-ui/react-use-layout-effect": "1.0.0" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + } + }, + "../cori.data.api/node_modules/@radix-ui/react-primitive": { + "version": "1.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/react-slot": "1.0.0" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + } + }, + "../cori.data.api/node_modules/@radix-ui/react-roving-focus": { + "version": "1.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/primitive": "1.0.0", + "@radix-ui/react-collection": "1.0.0", + "@radix-ui/react-compose-refs": "1.0.0", + "@radix-ui/react-context": "1.0.0", + "@radix-ui/react-direction": "1.0.0", + "@radix-ui/react-id": "1.0.0", + "@radix-ui/react-primitive": "1.0.0", + "@radix-ui/react-use-callback-ref": "1.0.0", + "@radix-ui/react-use-controllable-state": "1.0.0" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + } + }, + "../cori.data.api/node_modules/@radix-ui/react-slider": { + "version": "1.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/number": "1.0.0", + "@radix-ui/primitive": "1.0.0", + "@radix-ui/react-collection": "1.0.0", + "@radix-ui/react-compose-refs": "1.0.0", + "@radix-ui/react-context": "1.0.0", + "@radix-ui/react-direction": "1.0.0", + "@radix-ui/react-primitive": "1.0.0", + "@radix-ui/react-use-controllable-state": "1.0.0", + "@radix-ui/react-use-layout-effect": "1.0.0", + "@radix-ui/react-use-previous": "1.0.0", + "@radix-ui/react-use-size": "1.0.0" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + } + }, + "../cori.data.api/node_modules/@radix-ui/react-slot": { + "version": "1.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/react-compose-refs": "1.0.0" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0" + } + }, + "../cori.data.api/node_modules/@radix-ui/react-use-callback-ref": { + "version": "1.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.13.10" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0" + } + }, + "../cori.data.api/node_modules/@radix-ui/react-use-controllable-state": { + "version": "1.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/react-use-callback-ref": "1.0.0" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0" + } + }, + "../cori.data.api/node_modules/@radix-ui/react-use-escape-keydown": { + "version": "1.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/react-use-callback-ref": "1.0.0" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0" + } + }, + "../cori.data.api/node_modules/@radix-ui/react-use-layout-effect": { + "version": "1.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.13.10" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0" + } + }, + "../cori.data.api/node_modules/@radix-ui/react-use-previous": { + "version": "1.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.13.10" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0" + } + }, + "../cori.data.api/node_modules/@radix-ui/react-use-rect": { + "version": "1.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/rect": "1.0.0" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0" + } + }, + "../cori.data.api/node_modules/@radix-ui/react-use-size": { + "version": "1.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/react-use-layout-effect": "1.0.0" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0" + } + }, + "../cori.data.api/node_modules/@radix-ui/rect": { + "version": "1.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.13.10" + } + }, + "../cori.data.api/node_modules/@rollup/plugin-commonjs": { + "version": "26.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.0.1", + "commondir": "^1.0.1", + "estree-walker": "^2.0.2", + "glob": "^10.4.1", + "is-reference": "1.2.1", + "magic-string": "^0.30.3" + }, + "engines": { + "node": ">=16.0.0 || 14 >= 14.17" + }, + "peerDependencies": { + "rollup": "^2.68.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "../cori.data.api/node_modules/@rollup/plugin-json": { + "version": "6.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.1.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "../cori.data.api/node_modules/@rollup/plugin-node-resolve": { + "version": "15.2.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.0.1", + "@types/resolve": "1.20.2", + "deepmerge": "^4.2.2", + "is-module": "^1.0.0", + "resolve": "^1.22.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^2.78.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "../cori.data.api/node_modules/@rollup/plugin-terser": { + "version": "0.4.4", + "dev": true, + "license": "MIT", + "dependencies": { + "serialize-javascript": "^6.0.1", + "smob": "^1.0.0", + "terser": "^5.17.4" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "../cori.data.api/node_modules/@rollup/plugin-typescript": { + "version": "11.1.6", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.1.0", + "resolve": "^1.22.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^2.14.0||^3.0.0||^4.0.0", + "tslib": "*", + "typescript": ">=3.7.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + }, + "tslib": { + "optional": true + } + } + }, + "../cori.data.api/node_modules/@rollup/pluginutils": { + "version": "5.1.1", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "estree-walker": "^2.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "../cori.data.api/node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.22.4", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "../cori.data.api/node_modules/@shikijs/core": { + "version": "1.18.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@shikijs/engine-javascript": "1.18.0", + "@shikijs/engine-oniguruma": "1.18.0", + "@shikijs/types": "1.18.0", + "@shikijs/vscode-textmate": "^9.2.2", + "@types/hast": "^3.0.4", + "hast-util-to-html": "^9.0.3" + } + }, + "../cori.data.api/node_modules/@shikijs/engine-javascript": { + "version": "1.18.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@shikijs/types": "1.18.0", + "@shikijs/vscode-textmate": "^9.2.2", + "oniguruma-to-js": "0.4.3" + } + }, + "../cori.data.api/node_modules/@shikijs/engine-oniguruma": { + "version": "1.18.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@shikijs/types": "1.18.0", + "@shikijs/vscode-textmate": "^9.2.2" + } + }, + "../cori.data.api/node_modules/@shikijs/types": { + "version": "1.18.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@shikijs/vscode-textmate": "^9.2.2", + "@types/hast": "^3.0.4" + } + }, + "../cori.data.api/node_modules/@shikijs/vscode-textmate": { + "version": "9.2.2", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/@sinclair/typebox": { + "version": "0.27.8", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/@sindresorhus/is": { + "version": "4.6.0", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/is?sponsor=1" + } + }, + "../cori.data.api/node_modules/@sinonjs/commons": { + "version": "3.0.1", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "type-detect": "4.0.8" + } + }, + "../cori.data.api/node_modules/@sinonjs/fake-timers": { + "version": "10.3.0", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sinonjs/commons": "^3.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/abort-controller": { + "version": "3.1.4", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^3.4.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/abort-controller/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/config-resolver": { + "version": "3.0.8", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/node-config-provider": "^3.1.7", + "@smithy/types": "^3.4.2", + "@smithy/util-config-provider": "^3.0.0", + "@smithy/util-middleware": "^3.0.6", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/config-resolver/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/core": { + "version": "2.4.5", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/middleware-endpoint": "^3.1.3", + "@smithy/middleware-retry": "^3.0.20", + "@smithy/middleware-serde": "^3.0.6", + "@smithy/protocol-http": "^4.1.3", + "@smithy/smithy-client": "^3.3.4", + "@smithy/types": "^3.4.2", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-middleware": "^3.0.6", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/core/node_modules/@smithy/is-array-buffer": { + "version": "3.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/core/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/core/node_modules/@smithy/util-buffer-from": { + "version": "3.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/is-array-buffer": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/core/node_modules/@smithy/util-utf8": { + "version": "3.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/util-buffer-from": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/credential-provider-imds": { + "version": "3.2.3", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/node-config-provider": "^3.1.7", + "@smithy/property-provider": "^3.1.6", + "@smithy/types": "^3.4.2", + "@smithy/url-parser": "^3.0.6", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/credential-provider-imds/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/eventstream-codec": { + "version": "3.1.5", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-crypto/crc32": "5.2.0", + "@smithy/types": "^3.4.2", + "@smithy/util-hex-encoding": "^3.0.0", + "tslib": "^2.6.2" + } + }, + "../cori.data.api/node_modules/@smithy/eventstream-codec/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/eventstream-codec/node_modules/@smithy/util-hex-encoding": { + "version": "3.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/eventstream-serde-browser": { + "version": "3.0.9", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/eventstream-serde-universal": "^3.0.8", + "@smithy/types": "^3.4.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/eventstream-serde-browser/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/eventstream-serde-config-resolver": { + "version": "3.0.6", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^3.4.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/eventstream-serde-config-resolver/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/eventstream-serde-node": { + "version": "3.0.8", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/eventstream-serde-universal": "^3.0.8", + "@smithy/types": "^3.4.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/eventstream-serde-node/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/eventstream-serde-universal": { + "version": "3.0.8", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/eventstream-codec": "^3.1.5", + "@smithy/types": "^3.4.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/eventstream-serde-universal/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/fetch-http-handler": { + "version": "3.2.8", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/protocol-http": "^4.1.3", + "@smithy/querystring-builder": "^3.0.6", + "@smithy/types": "^3.4.2", + "@smithy/util-base64": "^3.0.0", + "tslib": "^2.6.2" + } + }, + "../cori.data.api/node_modules/@smithy/fetch-http-handler/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/hash-node": { + "version": "3.0.6", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^3.4.2", + "@smithy/util-buffer-from": "^3.0.0", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/hash-node/node_modules/@smithy/is-array-buffer": { + "version": "3.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/hash-node/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/hash-node/node_modules/@smithy/util-buffer-from": { + "version": "3.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/is-array-buffer": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/hash-node/node_modules/@smithy/util-utf8": { + "version": "3.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/util-buffer-from": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/invalid-dependency": { + "version": "3.0.6", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^3.4.2", + "tslib": "^2.6.2" + } + }, + "../cori.data.api/node_modules/@smithy/invalid-dependency/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/is-array-buffer": { + "version": "2.2.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/md5-js": { + "version": "2.0.7", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^2.3.1", + "@smithy/util-utf8": "^2.0.0", + "tslib": "^2.5.0" + } + }, + "../cori.data.api/node_modules/@smithy/middleware-content-length": { + "version": "3.0.8", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/protocol-http": "^4.1.3", + "@smithy/types": "^3.4.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/middleware-content-length/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/middleware-endpoint": { + "version": "3.1.3", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/middleware-serde": "^3.0.6", + "@smithy/node-config-provider": "^3.1.7", + "@smithy/shared-ini-file-loader": "^3.1.7", + "@smithy/types": "^3.4.2", + "@smithy/url-parser": "^3.0.6", + "@smithy/util-middleware": "^3.0.6", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/middleware-endpoint/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/middleware-retry": { + "version": "3.0.20", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/node-config-provider": "^3.1.7", + "@smithy/protocol-http": "^4.1.3", + "@smithy/service-error-classification": "^3.0.6", + "@smithy/smithy-client": "^3.3.4", + "@smithy/types": "^3.4.2", + "@smithy/util-middleware": "^3.0.6", + "@smithy/util-retry": "^3.0.6", + "tslib": "^2.6.2", + "uuid": "^9.0.1" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/middleware-retry/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/middleware-serde": { + "version": "3.0.6", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^3.4.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/middleware-serde/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/middleware-stack": { + "version": "3.0.6", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^3.4.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/middleware-stack/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/node-config-provider": { + "version": "3.1.7", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/property-provider": "^3.1.6", + "@smithy/shared-ini-file-loader": "^3.1.7", + "@smithy/types": "^3.4.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/node-config-provider/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/node-http-handler": { + "version": "3.2.3", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/abort-controller": "^3.1.4", + "@smithy/protocol-http": "^4.1.3", + "@smithy/querystring-builder": "^3.0.6", + "@smithy/types": "^3.4.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/node-http-handler/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/property-provider": { + "version": "3.1.6", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^3.4.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/property-provider/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/protocol-http": { + "version": "4.1.3", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^3.4.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/protocol-http/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/querystring-builder": { + "version": "3.0.6", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^3.4.2", + "@smithy/util-uri-escape": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/querystring-builder/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/querystring-parser": { + "version": "3.0.6", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^3.4.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/querystring-parser/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/service-error-classification": { + "version": "3.0.6", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^3.4.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/service-error-classification/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/shared-ini-file-loader": { + "version": "3.1.7", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^3.4.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/shared-ini-file-loader/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/signature-v4": { + "version": "4.1.4", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/is-array-buffer": "^3.0.0", + "@smithy/protocol-http": "^4.1.3", + "@smithy/types": "^3.4.2", + "@smithy/util-hex-encoding": "^3.0.0", + "@smithy/util-middleware": "^3.0.6", + "@smithy/util-uri-escape": "^3.0.0", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/signature-v4/node_modules/@smithy/is-array-buffer": { + "version": "3.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/signature-v4/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/signature-v4/node_modules/@smithy/util-buffer-from": { + "version": "3.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/is-array-buffer": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/signature-v4/node_modules/@smithy/util-hex-encoding": { + "version": "3.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/signature-v4/node_modules/@smithy/util-utf8": { + "version": "3.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/util-buffer-from": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/smithy-client": { + "version": "3.3.4", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/middleware-endpoint": "^3.1.3", + "@smithy/middleware-stack": "^3.0.6", + "@smithy/protocol-http": "^4.1.3", + "@smithy/types": "^3.4.2", + "@smithy/util-stream": "^3.1.8", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/smithy-client/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/types": { + "version": "2.12.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/url-parser": { + "version": "3.0.6", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/querystring-parser": "^3.0.6", + "@smithy/types": "^3.4.2", + "tslib": "^2.6.2" + } + }, + "../cori.data.api/node_modules/@smithy/url-parser/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/util-base64": { + "version": "3.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/util-buffer-from": "^3.0.0", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/util-base64/node_modules/@smithy/is-array-buffer": { + "version": "3.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/util-base64/node_modules/@smithy/util-buffer-from": { + "version": "3.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/is-array-buffer": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/util-base64/node_modules/@smithy/util-utf8": { + "version": "3.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/util-buffer-from": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/util-body-length-browser": { + "version": "3.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + } + }, + "../cori.data.api/node_modules/@smithy/util-body-length-node": { + "version": "3.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/util-buffer-from": { + "version": "2.2.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/is-array-buffer": "^2.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/util-config-provider": { + "version": "3.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/util-defaults-mode-browser": { + "version": "3.0.20", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/property-provider": "^3.1.6", + "@smithy/smithy-client": "^3.3.4", + "@smithy/types": "^3.4.2", + "bowser": "^2.11.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">= 10.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/util-defaults-mode-browser/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/util-defaults-mode-node": { + "version": "3.0.20", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/config-resolver": "^3.0.8", + "@smithy/credential-provider-imds": "^3.2.3", + "@smithy/node-config-provider": "^3.1.7", + "@smithy/property-provider": "^3.1.6", + "@smithy/smithy-client": "^3.3.4", + "@smithy/types": "^3.4.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">= 10.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/util-defaults-mode-node/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/util-endpoints": { + "version": "2.1.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/node-config-provider": "^3.1.7", + "@smithy/types": "^3.4.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/util-endpoints/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/util-hex-encoding": { + "version": "2.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/util-middleware": { + "version": "3.0.6", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/types": "^3.4.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/util-middleware/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/util-retry": { + "version": "3.0.6", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/service-error-classification": "^3.0.6", + "@smithy/types": "^3.4.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/util-retry/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/util-stream": { + "version": "3.1.8", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/fetch-http-handler": "^3.2.8", + "@smithy/node-http-handler": "^3.2.3", + "@smithy/types": "^3.4.2", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-buffer-from": "^3.0.0", + "@smithy/util-hex-encoding": "^3.0.0", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/util-stream/node_modules/@smithy/is-array-buffer": { + "version": "3.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/util-stream/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/util-stream/node_modules/@smithy/util-buffer-from": { + "version": "3.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/is-array-buffer": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/util-stream/node_modules/@smithy/util-hex-encoding": { + "version": "3.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/util-stream/node_modules/@smithy/util-utf8": { + "version": "3.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/util-buffer-from": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/util-uri-escape": { + "version": "3.0.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/util-utf8": { + "version": "2.3.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/util-buffer-from": "^2.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/util-waiter": { + "version": "3.1.5", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@smithy/abort-controller": "^3.1.4", + "@smithy/types": "^3.4.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@smithy/util-waiter/node_modules/@smithy/types": { + "version": "3.4.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "../cori.data.api/node_modules/@swc/helpers": { + "version": "0.5.13", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "../cori.data.api/node_modules/@szmarczak/http-timer": { + "version": "4.0.6", + "license": "MIT", + "peer": true, + "dependencies": { + "defer-to-connect": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "../cori.data.api/node_modules/@tootallnate/once": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10" + } + }, + "../cori.data.api/node_modules/@trysound/sax": { + "version": "0.2.0", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10.13.0" + } + }, + "../cori.data.api/node_modules/@types/aws-lambda": { + "version": "8.10.145", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/@types/axios": { + "version": "0.14.0", + "dev": true, + "license": "MIT", + "dependencies": { + "axios": "*" + } + }, + "../cori.data.api/node_modules/@types/babel__core": { + "version": "7.20.5", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "../cori.data.api/node_modules/@types/babel__generator": { + "version": "7.6.8", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "../cori.data.api/node_modules/@types/babel__template": { + "version": "7.4.4", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "../cori.data.api/node_modules/@types/babel__traverse": { + "version": "7.20.6", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/types": "^7.20.7" + } + }, + "../cori.data.api/node_modules/@types/cacheable-request": { + "version": "6.0.3", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/http-cache-semantics": "*", + "@types/keyv": "^3.1.4", + "@types/node": "*", + "@types/responselike": "^1.0.0" + } + }, + "../cori.data.api/node_modules/@types/command-line-args": { + "version": "5.2.3", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/@types/command-line-usage": { + "version": "5.0.4", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/@types/d3": { + "version": "7.4.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/d3-array": "*", + "@types/d3-axis": "*", + "@types/d3-brush": "*", + "@types/d3-chord": "*", + "@types/d3-color": "*", + "@types/d3-contour": "*", + "@types/d3-delaunay": "*", + "@types/d3-dispatch": "*", + "@types/d3-drag": "*", + "@types/d3-dsv": "*", + "@types/d3-ease": "*", + "@types/d3-fetch": "*", + "@types/d3-force": "*", + "@types/d3-format": "*", + "@types/d3-geo": "*", + "@types/d3-hierarchy": "*", + "@types/d3-interpolate": "*", + "@types/d3-path": "*", + "@types/d3-polygon": "*", + "@types/d3-quadtree": "*", + "@types/d3-random": "*", + "@types/d3-scale": "*", + "@types/d3-scale-chromatic": "*", + "@types/d3-selection": "*", + "@types/d3-shape": "*", + "@types/d3-time": "*", + "@types/d3-time-format": "*", + "@types/d3-timer": "*", + "@types/d3-transition": "*", + "@types/d3-zoom": "*" + } + }, + "../cori.data.api/node_modules/@types/d3-array": { + "version": "3.2.1", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/@types/d3-axis": { + "version": "3.0.6", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/d3-selection": "*" + } + }, + "../cori.data.api/node_modules/@types/d3-brush": { + "version": "3.0.6", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/d3-selection": "*" + } + }, + "../cori.data.api/node_modules/@types/d3-chord": { + "version": "3.0.6", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/@types/d3-color": { + "version": "3.1.3", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/@types/d3-contour": { + "version": "3.0.6", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/d3-array": "*", + "@types/geojson": "*" + } + }, + "../cori.data.api/node_modules/@types/d3-delaunay": { + "version": "6.0.4", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/@types/d3-dispatch": { + "version": "3.0.6", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/@types/d3-drag": { + "version": "3.0.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/d3-selection": "*" + } + }, + "../cori.data.api/node_modules/@types/d3-dsv": { + "version": "3.0.7", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/@types/d3-ease": { + "version": "3.0.2", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/@types/d3-fetch": { + "version": "3.0.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/d3-dsv": "*" + } + }, + "../cori.data.api/node_modules/@types/d3-force": { + "version": "3.0.10", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/@types/d3-format": { + "version": "3.0.4", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/@types/d3-geo": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/geojson": "*" + } + }, + "../cori.data.api/node_modules/@types/d3-hierarchy": { + "version": "3.1.7", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/@types/d3-interpolate": { + "version": "3.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/d3-color": "*" + } + }, + "../cori.data.api/node_modules/@types/d3-path": { + "version": "3.1.0", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/@types/d3-polygon": { + "version": "3.0.2", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/@types/d3-quadtree": { + "version": "3.0.6", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/@types/d3-random": { + "version": "3.0.3", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/@types/d3-scale": { + "version": "4.0.8", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/d3-time": "*" + } + }, + "../cori.data.api/node_modules/@types/d3-scale-chromatic": { + "version": "3.0.3", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/@types/d3-selection": { + "version": "3.0.10", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/@types/d3-shape": { + "version": "3.1.6", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/d3-path": "*" + } + }, + "../cori.data.api/node_modules/@types/d3-time": { + "version": "3.0.3", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/@types/d3-time-format": { + "version": "4.0.3", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/@types/d3-timer": { + "version": "3.0.2", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/@types/d3-transition": { + "version": "3.0.8", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/d3-selection": "*" + } + }, + "../cori.data.api/node_modules/@types/d3-zoom": { + "version": "3.0.8", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/d3-interpolate": "*", + "@types/d3-selection": "*" + } + }, + "../cori.data.api/node_modules/@types/debug": { + "version": "4.1.12", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/ms": "*" + } + }, + "../cori.data.api/node_modules/@types/estree": { + "version": "1.0.6", + "license": "MIT" + }, + "../cori.data.api/node_modules/@types/estree-jsx": { + "version": "1.0.5", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/estree": "*" + } + }, + "../cori.data.api/node_modules/@types/geojson": { + "version": "7946.0.14", + "license": "MIT" + }, + "../cori.data.api/node_modules/@types/graceful-fs": { + "version": "4.1.9", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/node": "*" + } + }, + "../cori.data.api/node_modules/@types/hammerjs": { + "version": "2.0.45", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/@types/hast": { + "version": "3.0.4", + "license": "MIT", + "dependencies": { + "@types/unist": "*" + } + }, + "../cori.data.api/node_modules/@types/http-cache-semantics": { + "version": "4.0.4", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.6", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/@types/istanbul-lib-report": { + "version": "3.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/istanbul-lib-coverage": "*" + } + }, + "../cori.data.api/node_modules/@types/istanbul-reports": { + "version": "3.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/istanbul-lib-report": "*" + } + }, + "../cori.data.api/node_modules/@types/jest": { + "version": "29.5.12", + "dev": true, + "license": "MIT", + "dependencies": { + "expect": "^29.0.0", + "pretty-format": "^29.0.0" + } + }, + "../cori.data.api/node_modules/@types/jsdom": { + "version": "20.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "@types/tough-cookie": "*", + "parse5": "^7.0.0" + } + }, + "../cori.data.api/node_modules/@types/json-schema": { + "version": "7.0.15", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/@types/keyv": { + "version": "3.1.4", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/node": "*" + } + }, + "../cori.data.api/node_modules/@types/mapbox__mapbox-gl-geocoder": { + "version": "4.7.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/geojson": "*", + "@types/mapbox-gl": "*" + } + }, + "../cori.data.api/node_modules/@types/mapbox-gl": { + "version": "3.4.0", + "license": "MIT", + "dependencies": { + "@types/geojson": "*" + } + }, + "../cori.data.api/node_modules/@types/mdast": { + "version": "4.0.4", + "license": "MIT", + "dependencies": { + "@types/unist": "*" + } + }, + "../cori.data.api/node_modules/@types/minimist": { + "version": "1.2.5", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/@types/ms": { + "version": "0.7.34", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/@types/node": { + "version": "20.16.5", + "license": "MIT", + "dependencies": { + "undici-types": "~6.19.2" + } + }, + "../cori.data.api/node_modules/@types/normalize-package-data": { + "version": "2.4.4", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/@types/offscreencanvas": { + "version": "2019.7.3", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/@types/postcss-modules-local-by-default": { + "version": "4.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "postcss": "^8.0.0" + } + }, + "../cori.data.api/node_modules/@types/postcss-modules-scope": { + "version": "3.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "postcss": "^8.0.0" + } + }, + "../cori.data.api/node_modules/@types/prop-types": { + "version": "15.7.13", + "license": "MIT" + }, + "../cori.data.api/node_modules/@types/react": { + "version": "18.3.8", + "license": "MIT", + "dependencies": { + "@types/prop-types": "*", + "csstype": "^3.0.2" + } + }, + "../cori.data.api/node_modules/@types/react-dom": { + "version": "18.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/react": "*" + } + }, + "../cori.data.api/node_modules/@types/resolve": { + "version": "1.20.2", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/@types/responselike": { + "version": "1.0.3", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/node": "*" + } + }, + "../cori.data.api/node_modules/@types/stack-utils": { + "version": "2.0.3", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/@types/tough-cookie": { + "version": "4.0.5", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/@types/unist": { + "version": "3.0.3", + "license": "MIT" + }, + "../cori.data.api/node_modules/@types/uuid": { + "version": "9.0.8", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/@types/yargs": { + "version": "17.0.33", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "../cori.data.api/node_modules/@types/yargs-parser": { + "version": "21.0.3", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "license": "ISC" + }, + "../cori.data.api/node_modules/@xstate/react": { + "version": "3.2.2", + "license": "MIT", + "peer": true, + "dependencies": { + "use-isomorphic-layout-effect": "^1.1.2", + "use-sync-external-store": "^1.0.0" + }, + "peerDependencies": { + "@xstate/fsm": "^2.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "xstate": "^4.37.2" + }, + "peerDependenciesMeta": { + "@xstate/fsm": { + "optional": true + }, + "xstate": { + "optional": true + } + } + }, + "../cori.data.api/node_modules/abab": { + "version": "2.0.6", + "dev": true, + "license": "BSD-3-Clause" + }, + "../cori.data.api/node_modules/acorn": { + "version": "8.12.1", + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "../cori.data.api/node_modules/acorn-globals": { + "version": "7.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "acorn": "^8.1.0", + "acorn-walk": "^8.0.2" + } + }, + "../cori.data.api/node_modules/acorn-walk": { + "version": "8.3.4", + "dev": true, + "license": "MIT", + "dependencies": { + "acorn": "^8.11.0" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "../cori.data.api/node_modules/agent-base": { + "version": "6.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "../cori.data.api/node_modules/ansi-escapes": { + "version": "4.3.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../cori.data.api/node_modules/ansi-regex": { + "version": "6.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "../cori.data.api/node_modules/ansi-styles": { + "version": "5.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "../cori.data.api/node_modules/anymatch": { + "version": "3.1.3", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "../cori.data.api/node_modules/apache-arrow": { + "version": "15.0.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@swc/helpers": "^0.5.2", + "@types/command-line-args": "^5.2.1", + "@types/command-line-usage": "^5.0.2", + "@types/node": "^20.6.0", + "command-line-args": "^5.2.1", + "command-line-usage": "^7.0.1", + "flatbuffers": "^23.5.26", + "json-bignum": "^0.0.3", + "tslib": "^2.6.2" + }, + "bin": { + "arrow2csv": "bin/arrow2csv.cjs" + } + }, + "../cori.data.api/node_modules/argparse": { + "version": "1.0.10", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "../cori.data.api/node_modules/aria-hidden": { + "version": "1.2.4", + "license": "MIT", + "peer": true, + "dependencies": { + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "../cori.data.api/node_modules/arquero": { + "version": "5.4.1", + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "acorn": "^8.12.0", + "apache-arrow": "^15.0.2", + "node-fetch": "^2.7.0" + } + }, + "../cori.data.api/node_modules/arr-union": { + "version": "3.1.0", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "../cori.data.api/node_modules/array-back": { + "version": "3.1.0", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "../cori.data.api/node_modules/arrify": { + "version": "1.0.1", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "../cori.data.api/node_modules/assign-symbols": { + "version": "1.0.0", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "../cori.data.api/node_modules/async": { + "version": "3.2.6", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/asynckit": { + "version": "0.4.0", + "license": "MIT" + }, + "../cori.data.api/node_modules/autoprefixer": { + "version": "10.4.20", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/autoprefixer" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "browserslist": "^4.23.3", + "caniuse-lite": "^1.0.30001646", + "fraction.js": "^4.3.7", + "normalize-range": "^0.1.2", + "picocolors": "^1.0.1", + "postcss-value-parser": "^4.2.0" + }, + "bin": { + "autoprefixer": "bin/autoprefixer" + }, + "engines": { + "node": "^10 || ^12 || >=14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "../cori.data.api/node_modules/aws-amplify": { + "version": "6.6.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@aws-amplify/analytics": "7.0.49", + "@aws-amplify/api": "6.0.51", + "@aws-amplify/auth": "6.4.2", + "@aws-amplify/core": "6.4.2", + "@aws-amplify/datastore": "5.0.51", + "@aws-amplify/notifications": "2.0.49", + "@aws-amplify/storage": "6.6.7", + "tslib": "^2.5.0" + } + }, + "../cori.data.api/node_modules/axios": { + "version": "1.7.7", + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "../cori.data.api/node_modules/axios/node_modules/form-data": { + "version": "4.0.0", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "../cori.data.api/node_modules/babel-jest": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/transform": "^29.7.0", + "@types/babel__core": "^7.1.14", + "babel-plugin-istanbul": "^6.1.1", + "babel-preset-jest": "^29.6.3", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.8.0" + } + }, + "../cori.data.api/node_modules/babel-jest/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "../cori.data.api/node_modules/babel-jest/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "../cori.data.api/node_modules/babel-jest/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/babel-jest/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/babel-plugin-istanbul": { + "version": "6.1.1", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.0.0", + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-instrument": "^5.0.4", + "test-exclude": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument": { + "version": "5.2.1", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/babel-plugin-jest-hoist": { + "version": "29.6.3", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/template": "^7.3.3", + "@babel/types": "^7.3.3", + "@types/babel__core": "^7.1.14", + "@types/babel__traverse": "^7.0.6" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "../cori.data.api/node_modules/babel-plugin-polyfill-corejs2": { + "version": "0.4.11", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.22.6", + "@babel/helper-define-polyfill-provider": "^0.6.2", + "semver": "^6.3.1" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + } + }, + "../cori.data.api/node_modules/babel-plugin-polyfill-corejs3": { + "version": "0.10.6", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-define-polyfill-provider": "^0.6.2", + "core-js-compat": "^3.38.0" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + } + }, + "../cori.data.api/node_modules/babel-plugin-polyfill-regenerator": { + "version": "0.6.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-define-polyfill-provider": "^0.6.2" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + } + }, + "../cori.data.api/node_modules/babel-preset-current-node-syntax": { + "version": "1.1.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-bigint": "^7.8.3", + "@babel/plugin-syntax-class-properties": "^7.12.13", + "@babel/plugin-syntax-class-static-block": "^7.14.5", + "@babel/plugin-syntax-import-attributes": "^7.24.7", + "@babel/plugin-syntax-import-meta": "^7.10.4", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.10.4", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5", + "@babel/plugin-syntax-top-level-await": "^7.14.5" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "../cori.data.api/node_modules/babel-preset-jest": { + "version": "29.6.3", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "babel-plugin-jest-hoist": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "../cori.data.api/node_modules/bail": { + "version": "2.0.2", + "license": "MIT", + "peer": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "../cori.data.api/node_modules/balanced-match": { + "version": "1.0.2", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/base-64": { + "version": "0.1.0", + "peer": true + }, + "../cori.data.api/node_modules/base64-js": { + "version": "1.5.1", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/boolbase": { + "version": "1.0.0", + "dev": true, + "license": "ISC" + }, + "../cori.data.api/node_modules/bowser": { + "version": "2.11.0", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/brace-expansion": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "../cori.data.api/node_modules/braces": { + "version": "3.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/browserslist": { + "version": "4.23.3", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "caniuse-lite": "^1.0.30001646", + "electron-to-chromium": "^1.5.4", + "node-releases": "^2.0.18", + "update-browserslist-db": "^1.1.0" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "../cori.data.api/node_modules/bs-logger": { + "version": "0.2.6", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-json-stable-stringify": "2.x" + }, + "engines": { + "node": ">= 6" + } + }, + "../cori.data.api/node_modules/bser": { + "version": "2.1.1", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "node-int64": "^0.4.0" + } + }, + "../cori.data.api/node_modules/buffer": { + "version": "4.9.2", + "license": "MIT", + "peer": true, + "dependencies": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4", + "isarray": "^1.0.0" + } + }, + "../cori.data.api/node_modules/buffer-from": { + "version": "1.1.2", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/bytewise": { + "version": "1.1.0", + "license": "MIT", + "peer": true, + "dependencies": { + "bytewise-core": "^1.2.2", + "typewise": "^1.0.3" + } + }, + "../cori.data.api/node_modules/bytewise-core": { + "version": "1.2.3", + "license": "MIT", + "peer": true, + "dependencies": { + "typewise-core": "^1.2" + } + }, + "../cori.data.api/node_modules/cacheable-lookup": { + "version": "5.0.4", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=10.6.0" + } + }, + "../cori.data.api/node_modules/cacheable-request": { + "version": "7.0.4", + "license": "MIT", + "peer": true, + "dependencies": { + "clone-response": "^1.0.2", + "get-stream": "^5.1.0", + "http-cache-semantics": "^4.0.0", + "keyv": "^4.0.0", + "lowercase-keys": "^2.0.0", + "normalize-url": "^6.0.1", + "responselike": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/callsites": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "../cori.data.api/node_modules/camelcase": { + "version": "5.3.1", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "../cori.data.api/node_modules/camelcase-keys": { + "version": "6.2.2", + "license": "MIT", + "peer": true, + "dependencies": { + "camelcase": "^5.3.1", + "map-obj": "^4.0.0", + "quick-lru": "^4.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../cori.data.api/node_modules/camelcase-keys/node_modules/quick-lru": { + "version": "4.0.1", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/caniuse-api": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "browserslist": "^4.0.0", + "caniuse-lite": "^1.0.0", + "lodash.memoize": "^4.1.2", + "lodash.uniq": "^4.5.0" + } + }, + "../cori.data.api/node_modules/caniuse-lite": { + "version": "1.0.30001663", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "../cori.data.api/node_modules/ccount": { + "version": "2.0.1", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "../cori.data.api/node_modules/chalk": { + "version": "2.4.2", + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "../cori.data.api/node_modules/chalk-template": { + "version": "0.4.0", + "license": "MIT", + "peer": true, + "dependencies": { + "chalk": "^4.1.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/chalk-template?sponsor=1" + } + }, + "../cori.data.api/node_modules/chalk-template/node_modules/ansi-styles": { + "version": "4.3.0", + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "../cori.data.api/node_modules/chalk-template/node_modules/chalk": { + "version": "4.1.2", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "../cori.data.api/node_modules/chalk-template/node_modules/has-flag": { + "version": "4.0.0", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/chalk-template/node_modules/supports-color": { + "version": "7.2.0", + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/chalk/node_modules/ansi-styles": { + "version": "3.2.1", + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "../cori.data.api/node_modules/chalk/node_modules/color-convert": { + "version": "1.9.3", + "license": "MIT", + "dependencies": { + "color-name": "1.1.3" + } + }, + "../cori.data.api/node_modules/chalk/node_modules/color-name": { + "version": "1.1.3", + "license": "MIT" + }, + "../cori.data.api/node_modules/char-regex": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=10" + } + }, + "../cori.data.api/node_modules/character-entities": { + "version": "2.0.2", + "license": "MIT", + "peer": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "../cori.data.api/node_modules/character-entities-html4": { + "version": "2.1.0", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "../cori.data.api/node_modules/character-entities-legacy": { + "version": "3.0.0", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "../cori.data.api/node_modules/character-reference-invalid": { + "version": "2.0.1", + "license": "MIT", + "peer": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "../cori.data.api/node_modules/chokidar": { + "version": "4.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "../cori.data.api/node_modules/ci-info": { + "version": "3.9.0", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/cjs-module-lexer": { + "version": "1.4.1", + "dev": true, + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/cliui": { + "version": "8.0.1", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/cliui/node_modules/ansi-regex": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/cliui/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "../cori.data.api/node_modules/cliui/node_modules/emoji-regex": { + "version": "8.0.0", + "dev": true, + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/cliui/node_modules/string-width": { + "version": "4.2.3", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/cliui/node_modules/strip-ansi": { + "version": "6.0.1", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/cliui/node_modules/wrap-ansi": { + "version": "7.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "../cori.data.api/node_modules/clone-response": { + "version": "1.0.3", + "license": "MIT", + "peer": true, + "dependencies": { + "mimic-response": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../cori.data.api/node_modules/co": { + "version": "4.6.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "iojs": ">= 1.0.0", + "node": ">= 0.12.0" + } + }, + "../cori.data.api/node_modules/collect-v8-coverage": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/color-convert": { + "version": "2.0.1", + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "../cori.data.api/node_modules/color-name": { + "version": "1.1.4", + "license": "MIT" + }, + "../cori.data.api/node_modules/colord": { + "version": "2.9.3", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/combined-stream": { + "version": "1.0.8", + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "../cori.data.api/node_modules/comma-separated-tokens": { + "version": "2.0.3", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "../cori.data.api/node_modules/command-line-args": { + "version": "5.2.1", + "license": "MIT", + "peer": true, + "dependencies": { + "array-back": "^3.1.0", + "find-replace": "^3.0.0", + "lodash.camelcase": "^4.3.0", + "typical": "^4.0.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "../cori.data.api/node_modules/command-line-usage": { + "version": "7.0.3", + "license": "MIT", + "peer": true, + "dependencies": { + "array-back": "^6.2.2", + "chalk-template": "^0.4.0", + "table-layout": "^4.1.0", + "typical": "^7.1.1" + }, + "engines": { + "node": ">=12.20.0" + } + }, + "../cori.data.api/node_modules/command-line-usage/node_modules/array-back": { + "version": "6.2.2", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12.17" + } + }, + "../cori.data.api/node_modules/command-line-usage/node_modules/typical": { + "version": "7.2.0", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12.17" + } + }, + "../cori.data.api/node_modules/commander": { + "version": "7.2.0", + "license": "MIT", + "engines": { + "node": ">= 10" + } + }, + "../cori.data.api/node_modules/commondir": { + "version": "1.0.1", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/concat-map": { + "version": "0.0.1", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/concat-with-sourcemaps": { + "version": "1.1.0", + "dev": true, + "license": "ISC", + "dependencies": { + "source-map": "^0.6.1" + } + }, + "../cori.data.api/node_modules/convert-source-map": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/copy-anything": { + "version": "2.0.6", + "dev": true, + "license": "MIT", + "dependencies": { + "is-what": "^3.14.1" + }, + "funding": { + "url": "https://github.com/sponsors/mesqueeb" + } + }, + "../cori.data.api/node_modules/core-js-compat": { + "version": "3.38.1", + "dev": true, + "license": "MIT", + "dependencies": { + "browserslist": "^4.23.3" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, + "../cori.data.api/node_modules/create-jest": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "prompts": "^2.0.1" + }, + "bin": { + "create-jest": "bin/create-jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "../cori.data.api/node_modules/create-jest/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "../cori.data.api/node_modules/create-jest/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "../cori.data.api/node_modules/create-jest/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/create-jest/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/cross-spawn": { + "version": "7.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "../cori.data.api/node_modules/css-declaration-sorter": { + "version": "6.4.1", + "dev": true, + "license": "ISC", + "engines": { + "node": "^10 || ^12 || >=14" + }, + "peerDependencies": { + "postcss": "^8.0.9" + } + }, + "../cori.data.api/node_modules/css-select": { + "version": "4.3.0", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "boolbase": "^1.0.0", + "css-what": "^6.0.1", + "domhandler": "^4.3.1", + "domutils": "^2.8.0", + "nth-check": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "../cori.data.api/node_modules/css-tree": { + "version": "1.1.3", + "dev": true, + "license": "MIT", + "dependencies": { + "mdn-data": "2.0.14", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "../cori.data.api/node_modules/css-what": { + "version": "6.1.0", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "../cori.data.api/node_modules/csscolorparser": { + "version": "1.0.3", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/cssesc": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "bin": { + "cssesc": "bin/cssesc" + }, + "engines": { + "node": ">=4" + } + }, + "../cori.data.api/node_modules/cssnano": { + "version": "5.1.15", + "dev": true, + "license": "MIT", + "dependencies": { + "cssnano-preset-default": "^5.2.14", + "lilconfig": "^2.0.3", + "yaml": "^1.10.2" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/cssnano" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "../cori.data.api/node_modules/cssnano-preset-default": { + "version": "5.2.14", + "dev": true, + "license": "MIT", + "dependencies": { + "css-declaration-sorter": "^6.3.1", + "cssnano-utils": "^3.1.0", + "postcss-calc": "^8.2.3", + "postcss-colormin": "^5.3.1", + "postcss-convert-values": "^5.1.3", + "postcss-discard-comments": "^5.1.2", + "postcss-discard-duplicates": "^5.1.0", + "postcss-discard-empty": "^5.1.1", + "postcss-discard-overridden": "^5.1.0", + "postcss-merge-longhand": "^5.1.7", + "postcss-merge-rules": "^5.1.4", + "postcss-minify-font-values": "^5.1.0", + "postcss-minify-gradients": "^5.1.1", + "postcss-minify-params": "^5.1.4", + "postcss-minify-selectors": "^5.2.1", + "postcss-normalize-charset": "^5.1.0", + "postcss-normalize-display-values": "^5.1.0", + "postcss-normalize-positions": "^5.1.1", + "postcss-normalize-repeat-style": "^5.1.1", + "postcss-normalize-string": "^5.1.0", + "postcss-normalize-timing-functions": "^5.1.0", + "postcss-normalize-unicode": "^5.1.1", + "postcss-normalize-url": "^5.1.0", + "postcss-normalize-whitespace": "^5.1.1", + "postcss-ordered-values": "^5.1.3", + "postcss-reduce-initial": "^5.1.2", + "postcss-reduce-transforms": "^5.1.0", + "postcss-svgo": "^5.1.0", + "postcss-unique-selectors": "^5.1.1" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "../cori.data.api/node_modules/cssnano-utils": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "../cori.data.api/node_modules/csso": { + "version": "4.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "css-tree": "^1.1.2" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "../cori.data.api/node_modules/cssom": { + "version": "0.5.0", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/cssstyle": { + "version": "2.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "cssom": "~0.3.6" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/cssstyle/node_modules/cssom": { + "version": "0.3.8", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/csstype": { + "version": "3.1.3", + "license": "MIT" + }, + "../cori.data.api/node_modules/d3": { + "version": "7.9.0", + "license": "ISC", + "peer": true, + "dependencies": { + "d3-array": "3", + "d3-axis": "3", + "d3-brush": "3", + "d3-chord": "3", + "d3-color": "3", + "d3-contour": "4", + "d3-delaunay": "6", + "d3-dispatch": "3", + "d3-drag": "3", + "d3-dsv": "3", + "d3-ease": "3", + "d3-fetch": "3", + "d3-force": "3", + "d3-format": "3", + "d3-geo": "3", + "d3-hierarchy": "3", + "d3-interpolate": "3", + "d3-path": "3", + "d3-polygon": "3", + "d3-quadtree": "3", + "d3-random": "3", + "d3-scale": "4", + "d3-scale-chromatic": "3", + "d3-selection": "3", + "d3-shape": "3", + "d3-time": "3", + "d3-time-format": "4", + "d3-timer": "3", + "d3-transition": "3", + "d3-zoom": "3" + }, + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/d3-array": { + "version": "3.2.4", + "license": "ISC", + "peer": true, + "dependencies": { + "internmap": "1 - 2" + }, + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/d3-axis": { + "version": "3.0.0", + "license": "ISC", + "peer": true, + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/d3-brush": { + "version": "3.0.0", + "license": "ISC", + "peer": true, + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-drag": "2 - 3", + "d3-interpolate": "1 - 3", + "d3-selection": "3", + "d3-transition": "3" + }, + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/d3-chord": { + "version": "3.0.1", + "license": "ISC", + "peer": true, + "dependencies": { + "d3-path": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/d3-color": { + "version": "3.1.0", + "license": "ISC", + "peer": true, + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/d3-contour": { + "version": "4.0.2", + "license": "ISC", + "peer": true, + "dependencies": { + "d3-array": "^3.2.0" + }, + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/d3-delaunay": { + "version": "6.0.4", + "license": "ISC", + "peer": true, + "dependencies": { + "delaunator": "5" + }, + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/d3-dispatch": { + "version": "3.0.1", + "license": "ISC", + "peer": true, + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/d3-drag": { + "version": "3.0.0", + "license": "ISC", + "peer": true, + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-selection": "3" + }, + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/d3-dsv": { + "version": "3.0.1", + "license": "ISC", + "peer": true, + "dependencies": { + "commander": "7", + "iconv-lite": "0.6", + "rw": "1" + }, + "bin": { + "csv2json": "bin/dsv2json.js", + "csv2tsv": "bin/dsv2dsv.js", + "dsv2dsv": "bin/dsv2dsv.js", + "dsv2json": "bin/dsv2json.js", + "json2csv": "bin/json2dsv.js", + "json2dsv": "bin/json2dsv.js", + "json2tsv": "bin/json2dsv.js", + "tsv2csv": "bin/dsv2dsv.js", + "tsv2json": "bin/dsv2json.js" + }, + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/d3-ease": { + "version": "3.0.1", + "license": "BSD-3-Clause", + "peer": true, + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/d3-fetch": { + "version": "3.0.1", + "license": "ISC", + "peer": true, + "dependencies": { + "d3-dsv": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/d3-force": { + "version": "3.0.0", + "license": "ISC", + "peer": true, + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-quadtree": "1 - 3", + "d3-timer": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/d3-format": { + "version": "3.1.0", + "license": "ISC", + "peer": true, + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/d3-geo": { + "version": "3.1.1", + "license": "ISC", + "peer": true, + "dependencies": { + "d3-array": "2.5.0 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/d3-hierarchy": { + "version": "3.1.2", + "license": "ISC", + "peer": true, + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/d3-interpolate": { + "version": "3.0.1", + "license": "ISC", + "peer": true, + "dependencies": { + "d3-color": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/d3-path": { + "version": "3.1.0", + "license": "ISC", + "peer": true, + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/d3-polygon": { + "version": "3.0.1", + "license": "ISC", + "peer": true, + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/d3-quadtree": { + "version": "3.0.1", + "license": "ISC", + "peer": true, + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/d3-random": { + "version": "3.0.1", + "license": "ISC", + "peer": true, + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/d3-scale": { + "version": "4.0.2", + "license": "ISC", + "peer": true, + "dependencies": { + "d3-array": "2.10.0 - 3", + "d3-format": "1 - 3", + "d3-interpolate": "1.2.0 - 3", + "d3-time": "2.1.1 - 3", + "d3-time-format": "2 - 4" + }, + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/d3-scale-chromatic": { + "version": "3.1.0", + "license": "ISC", + "peer": true, + "dependencies": { + "d3-color": "1 - 3", + "d3-interpolate": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/d3-selection": { + "version": "3.0.0", + "license": "ISC", + "peer": true, + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/d3-shape": { + "version": "3.2.0", + "license": "ISC", + "peer": true, + "dependencies": { + "d3-path": "^3.1.0" + }, + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/d3-textwrap": { + "version": "3.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "d3-selection": "^1.0.2" + } + }, + "../cori.data.api/node_modules/d3-textwrap/node_modules/d3-selection": { + "version": "1.4.2", + "license": "BSD-3-Clause", + "peer": true + }, + "../cori.data.api/node_modules/d3-time": { + "version": "3.1.0", + "license": "ISC", + "peer": true, + "dependencies": { + "d3-array": "2 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/d3-time-format": { + "version": "4.1.0", + "license": "ISC", + "peer": true, + "dependencies": { + "d3-time": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/d3-timer": { + "version": "3.0.1", + "license": "ISC", + "peer": true, + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/d3-transition": { + "version": "3.0.1", + "license": "ISC", + "peer": true, + "dependencies": { + "d3-color": "1 - 3", + "d3-dispatch": "1 - 3", + "d3-ease": "1 - 3", + "d3-interpolate": "1 - 3", + "d3-timer": "1 - 3" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "d3-selection": "2 - 3" + } + }, + "../cori.data.api/node_modules/d3-zoom": { + "version": "3.0.0", + "license": "ISC", + "peer": true, + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-drag": "2 - 3", + "d3-interpolate": "1 - 3", + "d3-selection": "2 - 3", + "d3-transition": "2 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/data-urls": { + "version": "3.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "abab": "^2.0.6", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^11.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/debug": { + "version": "4.3.7", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "../cori.data.api/node_modules/decamelize": { + "version": "1.2.0", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "../cori.data.api/node_modules/decamelize-keys": { + "version": "1.1.1", + "license": "MIT", + "peer": true, + "dependencies": { + "decamelize": "^1.1.0", + "map-obj": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../cori.data.api/node_modules/decamelize-keys/node_modules/map-obj": { + "version": "1.0.1", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "../cori.data.api/node_modules/decimal.js": { + "version": "10.4.3", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/decode-named-character-reference": { + "version": "1.0.2", + "license": "MIT", + "peer": true, + "dependencies": { + "character-entities": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "../cori.data.api/node_modules/decompress-response": { + "version": "6.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "mimic-response": "^3.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../cori.data.api/node_modules/decompress-response/node_modules/mimic-response": { + "version": "3.1.0", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../cori.data.api/node_modules/dedent": { + "version": "1.5.3", + "dev": true, + "license": "MIT", + "peer": true, + "peerDependencies": { + "babel-plugin-macros": "^3.1.0" + }, + "peerDependenciesMeta": { + "babel-plugin-macros": { + "optional": true + } + } + }, + "../cori.data.api/node_modules/deepmerge": { + "version": "4.3.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "../cori.data.api/node_modules/defer-to-connect": { + "version": "2.0.1", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=10" + } + }, + "../cori.data.api/node_modules/delaunator": { + "version": "5.0.1", + "license": "ISC", + "peer": true, + "dependencies": { + "robust-predicates": "^3.0.2" + } + }, + "../cori.data.api/node_modules/delayed-stream": { + "version": "1.0.0", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "../cori.data.api/node_modules/dequal": { + "version": "2.0.3", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "../cori.data.api/node_modules/detect-newline": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/detect-node-es": { + "version": "1.1.0", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/devlop": { + "version": "1.1.0", + "license": "MIT", + "dependencies": { + "dequal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "../cori.data.api/node_modules/diff-sequences": { + "version": "29.6.3", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "../cori.data.api/node_modules/dijkstrajs": { + "version": "1.0.3", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/dom-serializer": { + "version": "1.4.1", + "dev": true, + "license": "MIT", + "dependencies": { + "domelementtype": "^2.0.1", + "domhandler": "^4.2.0", + "entities": "^2.0.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "../cori.data.api/node_modules/dom-serializer/node_modules/entities": { + "version": "2.2.0", + "dev": true, + "license": "BSD-2-Clause", + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "../cori.data.api/node_modules/domelementtype": { + "version": "2.3.0", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "license": "BSD-2-Clause" + }, + "../cori.data.api/node_modules/domexception": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/domhandler": { + "version": "4.3.1", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "domelementtype": "^2.2.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "../cori.data.api/node_modules/domutils": { + "version": "2.8.0", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "dom-serializer": "^1.0.1", + "domelementtype": "^2.2.0", + "domhandler": "^4.2.0" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, + "../cori.data.api/node_modules/dotenv": { + "version": "16.4.5", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "../cori.data.api/node_modules/earcut": { + "version": "2.2.4", + "license": "ISC", + "peer": true + }, + "../cori.data.api/node_modules/eastasianwidth": { + "version": "0.2.0", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/ejs": { + "version": "3.1.10", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "jake": "^10.8.5" + }, + "bin": { + "ejs": "bin/cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "../cori.data.api/node_modules/electron-to-chromium": { + "version": "1.5.27", + "dev": true, + "license": "ISC" + }, + "../cori.data.api/node_modules/emittery": { + "version": "0.13.1", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sindresorhus/emittery?sponsor=1" + } + }, + "../cori.data.api/node_modules/emoji-regex": { + "version": "9.2.2", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/encode-utf8": { + "version": "1.0.3", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/end-of-stream": { + "version": "1.4.4", + "license": "MIT", + "peer": true, + "dependencies": { + "once": "^1.4.0" + } + }, + "../cori.data.api/node_modules/entities": { + "version": "4.5.0", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "../cori.data.api/node_modules/errno": { + "version": "0.1.8", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "prr": "~1.0.1" + }, + "bin": { + "errno": "cli.js" + } + }, + "../cori.data.api/node_modules/error-ex": { + "version": "1.3.2", + "license": "MIT", + "peer": true, + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "../cori.data.api/node_modules/escalade": { + "version": "3.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "../cori.data.api/node_modules/escape-string-regexp": { + "version": "1.0.5", + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "../cori.data.api/node_modules/escodegen": { + "version": "2.1.0", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=6.0" + }, + "optionalDependencies": { + "source-map": "~0.6.1" + } + }, + "../cori.data.api/node_modules/esprima": { + "version": "4.0.1", + "dev": true, + "license": "BSD-2-Clause", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "../cori.data.api/node_modules/estraverse": { + "version": "5.3.0", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "../cori.data.api/node_modules/estree-util-is-identifier-name": { + "version": "3.0.0", + "license": "MIT", + "peer": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "../cori.data.api/node_modules/estree-walker": { + "version": "2.0.2", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/esutils": { + "version": "2.0.3", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "../cori.data.api/node_modules/eventemitter3": { + "version": "3.1.2", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/execa": { + "version": "5.1.1", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "../cori.data.api/node_modules/execa/node_modules/get-stream": { + "version": "6.0.1", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../cori.data.api/node_modules/execa/node_modules/signal-exit": { + "version": "3.0.7", + "dev": true, + "license": "ISC", + "peer": true + }, + "../cori.data.api/node_modules/exit": { + "version": "0.1.2", + "dev": true, + "peer": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "../cori.data.api/node_modules/expect": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/expect-utils": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "../cori.data.api/node_modules/extend": { + "version": "3.0.2", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/extend-shallow": { + "version": "2.0.1", + "license": "MIT", + "peer": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "../cori.data.api/node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/fast-xml-parser": { + "version": "4.5.0", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + }, + { + "type": "paypal", + "url": "https://paypal.me/naturalintelligence" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "strnum": "^1.0.5" + }, + "bin": { + "fxparser": "src/cli/cli.js" + } + }, + "../cori.data.api/node_modules/fb-watchman": { + "version": "2.0.2", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "bser": "2.1.1" + } + }, + "../cori.data.api/node_modules/filelist": { + "version": "1.0.4", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "minimatch": "^5.0.1" + } + }, + "../cori.data.api/node_modules/filelist/node_modules/minimatch": { + "version": "5.1.6", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "../cori.data.api/node_modules/fill-range": { + "version": "7.1.1", + "dev": true, + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/find-cache-dir": { + "version": "3.3.2", + "dev": true, + "license": "MIT", + "dependencies": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/avajs/find-cache-dir?sponsor=1" + } + }, + "../cori.data.api/node_modules/find-cache-dir/node_modules/make-dir": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../cori.data.api/node_modules/find-replace": { + "version": "3.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "array-back": "^3.0.1" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "../cori.data.api/node_modules/find-up": { + "version": "4.1.0", + "license": "MIT", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/flatbuffers": { + "version": "23.5.26", + "license": "SEE LICENSE IN LICENSE", + "peer": true + }, + "../cori.data.api/node_modules/follow-redirects": { + "version": "1.15.9", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "../cori.data.api/node_modules/foreground-child": { + "version": "3.3.0", + "dev": true, + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "../cori.data.api/node_modules/form-data": { + "version": "3.0.1", + "license": "MIT", + "peer": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "../cori.data.api/node_modules/fraction.js": { + "version": "4.3.7", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + }, + "funding": { + "type": "patreon", + "url": "https://github.com/sponsors/rawify" + } + }, + "../cori.data.api/node_modules/fs-extra": { + "version": "10.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/fs.realpath": { + "version": "1.0.0", + "dev": true, + "license": "ISC" + }, + "../cori.data.api/node_modules/fsevents": { + "version": "2.3.3", + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "../cori.data.api/node_modules/function-bind": { + "version": "1.1.2", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "../cori.data.api/node_modules/fuzzy": { + "version": "0.1.3", + "peer": true, + "engines": { + "node": ">= 0.6.0" + } + }, + "../cori.data.api/node_modules/generic-names": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "loader-utils": "^3.2.0" + } + }, + "../cori.data.api/node_modules/gensync": { + "version": "1.0.0-beta.2", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6.9.0" + } + }, + "../cori.data.api/node_modules/geojson-vt": { + "version": "3.2.1", + "license": "ISC", + "peer": true + }, + "../cori.data.api/node_modules/get-caller-file": { + "version": "2.0.5", + "license": "ISC", + "peer": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "../cori.data.api/node_modules/get-nonce": { + "version": "1.0.1", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "../cori.data.api/node_modules/get-package-type": { + "version": "0.1.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8.0.0" + } + }, + "../cori.data.api/node_modules/get-stream": { + "version": "5.2.0", + "license": "MIT", + "peer": true, + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../cori.data.api/node_modules/get-value": { + "version": "2.0.6", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "../cori.data.api/node_modules/gl-matrix": { + "version": "3.4.3", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/glob": { + "version": "10.4.5", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "../cori.data.api/node_modules/globals": { + "version": "11.12.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "../cori.data.api/node_modules/got": { + "version": "11.8.6", + "license": "MIT", + "peer": true, + "dependencies": { + "@sindresorhus/is": "^4.0.0", + "@szmarczak/http-timer": "^4.0.5", + "@types/cacheable-request": "^6.0.1", + "@types/responselike": "^1.0.0", + "cacheable-lookup": "^5.0.3", + "cacheable-request": "^7.0.2", + "decompress-response": "^6.0.0", + "http2-wrapper": "^1.0.0-beta.5.2", + "lowercase-keys": "^2.0.0", + "p-cancelable": "^2.0.0", + "responselike": "^2.0.0" + }, + "engines": { + "node": ">=10.19.0" + }, + "funding": { + "url": "https://github.com/sindresorhus/got?sponsor=1" + } + }, + "../cori.data.api/node_modules/graceful-fs": { + "version": "4.2.11", + "dev": true, + "license": "ISC" + }, + "../cori.data.api/node_modules/graphql": { + "version": "15.8.0", + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 10.x" + } + }, + "../cori.data.api/node_modules/grid-index": { + "version": "1.1.0", + "license": "ISC", + "peer": true + }, + "../cori.data.api/node_modules/hammerjs": { + "version": "2.0.8", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.8.0" + } + }, + "../cori.data.api/node_modules/hard-rejection": { + "version": "2.1.0", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "../cori.data.api/node_modules/harmony-reflect": { + "version": "1.6.2", + "dev": true, + "license": "(Apache-2.0 OR MPL-1.1)" + }, + "../cori.data.api/node_modules/has-flag": { + "version": "3.0.0", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "../cori.data.api/node_modules/hasown": { + "version": "2.0.2", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "../cori.data.api/node_modules/hast-util-to-html": { + "version": "9.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "ccount": "^2.0.0", + "comma-separated-tokens": "^2.0.0", + "hast-util-whitespace": "^3.0.0", + "html-void-elements": "^3.0.0", + "mdast-util-to-hast": "^13.0.0", + "property-information": "^6.0.0", + "space-separated-tokens": "^2.0.0", + "stringify-entities": "^4.0.0", + "zwitch": "^2.0.4" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "../cori.data.api/node_modules/hast-util-to-jsx-runtime": { + "version": "2.3.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/estree": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "comma-separated-tokens": "^2.0.0", + "devlop": "^1.0.0", + "estree-util-is-identifier-name": "^3.0.0", + "hast-util-whitespace": "^3.0.0", + "mdast-util-mdx-expression": "^2.0.0", + "mdast-util-mdx-jsx": "^3.0.0", + "mdast-util-mdxjs-esm": "^2.0.0", + "property-information": "^6.0.0", + "space-separated-tokens": "^2.0.0", + "style-to-object": "^1.0.0", + "unist-util-position": "^5.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "../cori.data.api/node_modules/hast-util-whitespace": { + "version": "3.0.0", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "../cori.data.api/node_modules/hosted-git-info": { + "version": "4.1.0", + "license": "ISC", + "peer": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "../cori.data.api/node_modules/hosted-git-info/node_modules/lru-cache": { + "version": "6.0.0", + "license": "ISC", + "peer": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "../cori.data.api/node_modules/hosted-git-info/node_modules/yallist": { + "version": "4.0.0", + "license": "ISC", + "peer": true + }, + "../cori.data.api/node_modules/html-encoding-sniffer": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "whatwg-encoding": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/html-escaper": { + "version": "2.0.2", + "dev": true, + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/html-to-image": { + "version": "1.11.11", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/html-url-attributes": { + "version": "3.0.0", + "license": "MIT", + "peer": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "../cori.data.api/node_modules/html-void-elements": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "../cori.data.api/node_modules/http-cache-semantics": { + "version": "4.1.1", + "license": "BSD-2-Clause", + "peer": true + }, + "../cori.data.api/node_modules/http-proxy-agent": { + "version": "5.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@tootallnate/once": "2", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "../cori.data.api/node_modules/http2-wrapper": { + "version": "1.0.3", + "license": "MIT", + "peer": true, + "dependencies": { + "quick-lru": "^5.1.1", + "resolve-alpn": "^1.0.0" + }, + "engines": { + "node": ">=10.19.0" + } + }, + "../cori.data.api/node_modules/https-proxy-agent": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "../cori.data.api/node_modules/human-signals": { + "version": "2.1.0", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "engines": { + "node": ">=10.17.0" + } + }, + "../cori.data.api/node_modules/iconv-lite": { + "version": "0.6.3", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "../cori.data.api/node_modules/icss-replace-symbols": { + "version": "1.1.0", + "dev": true, + "license": "ISC" + }, + "../cori.data.api/node_modules/icss-utils": { + "version": "5.1.0", + "dev": true, + "license": "ISC", + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "../cori.data.api/node_modules/idb": { + "version": "5.0.6", + "license": "ISC", + "peer": true + }, + "../cori.data.api/node_modules/identity-obj-proxy": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "harmony-reflect": "^1.4.6" + }, + "engines": { + "node": ">=4" + } + }, + "../cori.data.api/node_modules/ieee754": { + "version": "1.2.1", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause", + "peer": true + }, + "../cori.data.api/node_modules/image-size": { + "version": "0.5.5", + "dev": true, + "license": "MIT", + "optional": true, + "bin": { + "image-size": "bin/image-size.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "../cori.data.api/node_modules/immer": { + "version": "9.0.6", + "license": "MIT", + "peer": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/immer" + } + }, + "../cori.data.api/node_modules/immutable": { + "version": "4.3.7", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/import-cwd": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "import-from": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/import-from": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/import-local": { + "version": "3.2.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + }, + "bin": { + "import-local-fixture": "fixtures/cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../cori.data.api/node_modules/imurmurhash": { + "version": "0.1.4", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.8.19" + } + }, + "../cori.data.api/node_modules/indent-string": { + "version": "4.0.0", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/inflight": { + "version": "1.0.6", + "dev": true, + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "../cori.data.api/node_modules/inherits": { + "version": "2.0.3", + "dev": true, + "license": "ISC" + }, + "../cori.data.api/node_modules/inline-style-parser": { + "version": "0.2.4", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/internmap": { + "version": "2.0.3", + "license": "ISC", + "peer": true, + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/invariant": { + "version": "2.2.4", + "license": "MIT", + "peer": true, + "dependencies": { + "loose-envify": "^1.0.0" + } + }, + "../cori.data.api/node_modules/is-alphabetical": { + "version": "2.0.1", + "license": "MIT", + "peer": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "../cori.data.api/node_modules/is-alphanumerical": { + "version": "2.0.1", + "license": "MIT", + "peer": true, + "dependencies": { + "is-alphabetical": "^2.0.0", + "is-decimal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "../cori.data.api/node_modules/is-arrayish": { + "version": "0.2.1", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/is-core-module": { + "version": "2.15.1", + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "../cori.data.api/node_modules/is-decimal": { + "version": "2.0.1", + "license": "MIT", + "peer": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "../cori.data.api/node_modules/is-extendable": { + "version": "0.1.1", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "../cori.data.api/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/is-generator-fn": { + "version": "2.1.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "../cori.data.api/node_modules/is-hexadecimal": { + "version": "2.0.1", + "license": "MIT", + "peer": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "../cori.data.api/node_modules/is-module": { + "version": "1.0.0", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/is-number": { + "version": "7.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "../cori.data.api/node_modules/is-plain-obj": { + "version": "1.1.0", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "../cori.data.api/node_modules/is-plain-object": { + "version": "2.0.4", + "license": "MIT", + "peer": true, + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "../cori.data.api/node_modules/is-potential-custom-element-name": { + "version": "1.0.1", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/is-reference": { + "version": "1.2.1", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "*" + } + }, + "../cori.data.api/node_modules/is-stream": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../cori.data.api/node_modules/is-what": { + "version": "3.14.1", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/isarray": { + "version": "1.0.0", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/isexe": { + "version": "2.0.0", + "dev": true, + "license": "ISC" + }, + "../cori.data.api/node_modules/isobject": { + "version": "3.0.1", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "../cori.data.api/node_modules/istanbul-lib-coverage": { + "version": "3.2.2", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/istanbul-lib-instrument": { + "version": "6.0.3", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "@babel/core": "^7.23.9", + "@babel/parser": "^7.23.9", + "@istanbuljs/schema": "^0.1.3", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=10" + } + }, + "../cori.data.api/node_modules/istanbul-lib-instrument/node_modules/semver": { + "version": "7.6.3", + "dev": true, + "license": "ISC", + "peer": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "../cori.data.api/node_modules/istanbul-lib-report": { + "version": "3.0.1", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "../cori.data.api/node_modules/istanbul-lib-report/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/istanbul-lib-report/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/istanbul-lib-source-maps": { + "version": "4.0.1", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=10" + } + }, + "../cori.data.api/node_modules/istanbul-reports": { + "version": "3.1.7", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/jackspeak": { + "version": "3.4.3", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "../cori.data.api/node_modules/jake": { + "version": "10.9.2", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "async": "^3.2.3", + "chalk": "^4.0.2", + "filelist": "^1.0.4", + "minimatch": "^3.1.2" + }, + "bin": { + "jake": "bin/cli.js" + }, + "engines": { + "node": ">=10" + } + }, + "../cori.data.api/node_modules/jake/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "../cori.data.api/node_modules/jake/node_modules/brace-expansion": { + "version": "1.1.11", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "../cori.data.api/node_modules/jake/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "../cori.data.api/node_modules/jake/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/jake/node_modules/minimatch": { + "version": "3.1.2", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "../cori.data.api/node_modules/jake/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/jest": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/core": "^29.7.0", + "@jest/types": "^29.6.3", + "import-local": "^3.0.2", + "jest-cli": "^29.7.0" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "../cori.data.api/node_modules/jest-changed-files": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "execa": "^5.0.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "../cori.data.api/node_modules/jest-circus": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "co": "^4.6.0", + "dedent": "^1.0.0", + "is-generator-fn": "^2.0.0", + "jest-each": "^29.7.0", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0", + "pretty-format": "^29.7.0", + "pure-rand": "^6.0.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "../cori.data.api/node_modules/jest-circus/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "../cori.data.api/node_modules/jest-circus/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "../cori.data.api/node_modules/jest-circus/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/jest-circus/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/jest-cli": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/core": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "create-jest": "^29.7.0", + "exit": "^0.1.2", + "import-local": "^3.0.2", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "yargs": "^17.3.1" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "../cori.data.api/node_modules/jest-cli/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "../cori.data.api/node_modules/jest-cli/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "../cori.data.api/node_modules/jest-cli/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/jest-cli/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/jest-config": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/test-sequencer": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-jest": "^29.7.0", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "deepmerge": "^4.2.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-circus": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "micromatch": "^4.0.4", + "parse-json": "^5.2.0", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@types/node": "*", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "ts-node": { + "optional": true + } + } + }, + "../cori.data.api/node_modules/jest-config/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "../cori.data.api/node_modules/jest-config/node_modules/brace-expansion": { + "version": "1.1.11", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "../cori.data.api/node_modules/jest-config/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "../cori.data.api/node_modules/jest-config/node_modules/glob": { + "version": "7.2.3", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "../cori.data.api/node_modules/jest-config/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/jest-config/node_modules/minimatch": { + "version": "3.1.2", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "../cori.data.api/node_modules/jest-config/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/jest-diff": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "diff-sequences": "^29.6.3", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "../cori.data.api/node_modules/jest-diff/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "../cori.data.api/node_modules/jest-diff/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "../cori.data.api/node_modules/jest-diff/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/jest-diff/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/jest-docblock": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "detect-newline": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "../cori.data.api/node_modules/jest-each": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "jest-util": "^29.7.0", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "../cori.data.api/node_modules/jest-each/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "../cori.data.api/node_modules/jest-each/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "../cori.data.api/node_modules/jest-each/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/jest-each/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/jest-environment-jsdom": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/jsdom": "^20.0.0", + "@types/node": "*", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0", + "jsdom": "^20.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "canvas": "^2.5.0" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } + } + }, + "../cori.data.api/node_modules/jest-environment-node": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "../cori.data.api/node_modules/jest-get-type": { + "version": "29.6.3", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "../cori.data.api/node_modules/jest-haste-map": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/types": "^29.6.3", + "@types/graceful-fs": "^4.1.3", + "@types/node": "*", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "graceful-fs": "^4.2.9", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "micromatch": "^4.0.4", + "walker": "^1.0.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "optionalDependencies": { + "fsevents": "^2.3.2" + } + }, + "../cori.data.api/node_modules/jest-leak-detector": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "../cori.data.api/node_modules/jest-matcher-utils": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "../cori.data.api/node_modules/jest-matcher-utils/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "../cori.data.api/node_modules/jest-matcher-utils/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "../cori.data.api/node_modules/jest-matcher-utils/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/jest-matcher-utils/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/jest-message-util": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@jest/types": "^29.6.3", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "../cori.data.api/node_modules/jest-message-util/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "../cori.data.api/node_modules/jest-message-util/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "../cori.data.api/node_modules/jest-message-util/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/jest-message-util/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/jest-mock": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "../cori.data.api/node_modules/jest-pnp-resolver": { + "version": "1.2.3", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + }, + "peerDependencies": { + "jest-resolve": "*" + }, + "peerDependenciesMeta": { + "jest-resolve": { + "optional": true + } + } + }, + "../cori.data.api/node_modules/jest-regex-util": { + "version": "29.6.3", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "../cori.data.api/node_modules/jest-resolve": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-pnp-resolver": "^1.2.2", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "resolve": "^1.20.0", + "resolve.exports": "^2.0.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "../cori.data.api/node_modules/jest-resolve-dependencies": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "jest-regex-util": "^29.6.3", + "jest-snapshot": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "../cori.data.api/node_modules/jest-resolve/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "../cori.data.api/node_modules/jest-resolve/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "../cori.data.api/node_modules/jest-resolve/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/jest-resolve/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/jest-runner": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/environment": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "graceful-fs": "^4.2.9", + "jest-docblock": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-leak-detector": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-resolve": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-util": "^29.7.0", + "jest-watcher": "^29.7.0", + "jest-worker": "^29.7.0", + "p-limit": "^3.1.0", + "source-map-support": "0.5.13" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "../cori.data.api/node_modules/jest-runner/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "../cori.data.api/node_modules/jest-runner/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "../cori.data.api/node_modules/jest-runner/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/jest-runner/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/jest-runtime": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/globals": "^29.7.0", + "@jest/source-map": "^29.6.3", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "cjs-module-lexer": "^1.0.0", + "collect-v8-coverage": "^1.0.0", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "slash": "^3.0.0", + "strip-bom": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "../cori.data.api/node_modules/jest-runtime/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "../cori.data.api/node_modules/jest-runtime/node_modules/brace-expansion": { + "version": "1.1.11", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "../cori.data.api/node_modules/jest-runtime/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "../cori.data.api/node_modules/jest-runtime/node_modules/glob": { + "version": "7.2.3", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "../cori.data.api/node_modules/jest-runtime/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/jest-runtime/node_modules/minimatch": { + "version": "3.1.2", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "../cori.data.api/node_modules/jest-runtime/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/jest-snapshot": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/core": "^7.11.6", + "@babel/generator": "^7.7.2", + "@babel/plugin-syntax-jsx": "^7.7.2", + "@babel/plugin-syntax-typescript": "^7.7.2", + "@babel/types": "^7.3.3", + "@jest/expect-utils": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0", + "chalk": "^4.0.0", + "expect": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "natural-compare": "^1.4.0", + "pretty-format": "^29.7.0", + "semver": "^7.5.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "../cori.data.api/node_modules/jest-snapshot/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "../cori.data.api/node_modules/jest-snapshot/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "../cori.data.api/node_modules/jest-snapshot/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/jest-snapshot/node_modules/semver": { + "version": "7.6.3", + "dev": true, + "license": "ISC", + "peer": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "../cori.data.api/node_modules/jest-snapshot/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/jest-util": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "../cori.data.api/node_modules/jest-util/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "../cori.data.api/node_modules/jest-util/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "../cori.data.api/node_modules/jest-util/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/jest-util/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/jest-validate": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/types": "^29.6.3", + "camelcase": "^6.2.0", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "leven": "^3.1.0", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "../cori.data.api/node_modules/jest-validate/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "../cori.data.api/node_modules/jest-validate/node_modules/camelcase": { + "version": "6.3.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../cori.data.api/node_modules/jest-validate/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "../cori.data.api/node_modules/jest-validate/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/jest-validate/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/jest-watcher": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "jest-util": "^29.7.0", + "string-length": "^4.0.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "../cori.data.api/node_modules/jest-watcher/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "../cori.data.api/node_modules/jest-watcher/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "../cori.data.api/node_modules/jest-watcher/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/jest-watcher/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/jest-worker": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/node": "*", + "jest-util": "^29.7.0", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "../cori.data.api/node_modules/jest-worker/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/jest-worker/node_modules/supports-color": { + "version": "8.1.1", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "../cori.data.api/node_modules/js-cookie": { + "version": "3.0.5", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=14" + } + }, + "../cori.data.api/node_modules/js-tokens": { + "version": "4.0.0", + "license": "MIT" + }, + "../cori.data.api/node_modules/js-yaml": { + "version": "3.14.1", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "../cori.data.api/node_modules/jsdom": { + "version": "20.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "abab": "^2.0.6", + "acorn": "^8.8.1", + "acorn-globals": "^7.0.0", + "cssom": "^0.5.0", + "cssstyle": "^2.3.0", + "data-urls": "^3.0.2", + "decimal.js": "^10.4.2", + "domexception": "^4.0.0", + "escodegen": "^2.0.0", + "form-data": "^4.0.0", + "html-encoding-sniffer": "^3.0.0", + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.1", + "is-potential-custom-element-name": "^1.0.1", + "nwsapi": "^2.2.2", + "parse5": "^7.1.1", + "saxes": "^6.0.0", + "symbol-tree": "^3.2.4", + "tough-cookie": "^4.1.2", + "w3c-xmlserializer": "^4.0.0", + "webidl-conversions": "^7.0.0", + "whatwg-encoding": "^2.0.0", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^11.0.0", + "ws": "^8.11.0", + "xml-name-validator": "^4.0.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "canvas": "^2.5.0" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } + } + }, + "../cori.data.api/node_modules/jsdom/node_modules/form-data": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "../cori.data.api/node_modules/jsesc": { + "version": "2.5.2", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=4" + } + }, + "../cori.data.api/node_modules/json-bignum": { + "version": "0.0.3", + "peer": true, + "engines": { + "node": ">=0.8" + } + }, + "../cori.data.api/node_modules/json-buffer": { + "version": "3.0.1", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/json-stringify-pretty-compact": { + "version": "3.0.0", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/json5": { + "version": "2.2.3", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "../cori.data.api/node_modules/jsonfile": { + "version": "6.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "../cori.data.api/node_modules/kdbush": { + "version": "4.0.2", + "license": "ISC", + "peer": true + }, + "../cori.data.api/node_modules/keyv": { + "version": "4.5.4", + "license": "MIT", + "peer": true, + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "../cori.data.api/node_modules/kind-of": { + "version": "6.0.3", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "../cori.data.api/node_modules/kleur": { + "version": "3.0.3", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "../cori.data.api/node_modules/less": { + "version": "4.2.0", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "copy-anything": "^2.0.1", + "parse-node-version": "^1.0.1", + "tslib": "^2.3.0" + }, + "bin": { + "lessc": "bin/lessc" + }, + "engines": { + "node": ">=6" + }, + "optionalDependencies": { + "errno": "^0.1.1", + "graceful-fs": "^4.1.2", + "image-size": "~0.5.0", + "make-dir": "^2.1.0", + "mime": "^1.4.1", + "needle": "^3.1.0", + "source-map": "~0.6.0" + } + }, + "../cori.data.api/node_modules/less/node_modules/make-dir": { + "version": "2.1.0", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "pify": "^4.0.1", + "semver": "^5.6.0" + }, + "engines": { + "node": ">=6" + } + }, + "../cori.data.api/node_modules/less/node_modules/pify": { + "version": "4.0.1", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=6" + } + }, + "../cori.data.api/node_modules/less/node_modules/semver": { + "version": "5.7.2", + "dev": true, + "license": "ISC", + "optional": true, + "bin": { + "semver": "bin/semver" + } + }, + "../cori.data.api/node_modules/leven": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "../cori.data.api/node_modules/lilconfig": { + "version": "2.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "../cori.data.api/node_modules/lines-and-columns": { + "version": "1.2.4", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/linkify-it": { + "version": "5.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "uc.micro": "^2.0.0" + } + }, + "../cori.data.api/node_modules/loader-utils": { + "version": "3.3.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 12.13.0" + } + }, + "../cori.data.api/node_modules/locate-path": { + "version": "5.0.0", + "license": "MIT", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/lodash": { + "version": "4.17.21", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/lodash.camelcase": { + "version": "4.3.0", + "license": "MIT" + }, + "../cori.data.api/node_modules/lodash.debounce": { + "version": "4.0.8", + "license": "MIT" + }, + "../cori.data.api/node_modules/lodash.memoize": { + "version": "4.1.2", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/lodash.uniq": { + "version": "4.5.0", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/longest-streak": { + "version": "3.1.0", + "license": "MIT", + "peer": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "../cori.data.api/node_modules/loose-envify": { + "version": "1.4.0", + "license": "MIT", + "peer": true, + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "../cori.data.api/node_modules/lowercase-keys": { + "version": "2.0.0", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/lru-cache": { + "version": "5.1.1", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "../cori.data.api/node_modules/lunr": { + "version": "2.3.9", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/magic-string": { + "version": "0.30.11", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0" + } + }, + "../cori.data.api/node_modules/make-dir": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../cori.data.api/node_modules/make-dir/node_modules/semver": { + "version": "7.6.3", + "dev": true, + "license": "ISC", + "peer": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "../cori.data.api/node_modules/make-error": { + "version": "1.3.6", + "dev": true, + "license": "ISC" + }, + "../cori.data.api/node_modules/makeerror": { + "version": "1.0.12", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "tmpl": "1.0.5" + } + }, + "../cori.data.api/node_modules/map-obj": { + "version": "4.3.0", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../cori.data.api/node_modules/mapbox-gl": { + "version": "2.15.0", + "license": "SEE LICENSE IN LICENSE.txt", + "peer": true, + "dependencies": { + "@mapbox/geojson-rewind": "^0.5.2", + "@mapbox/jsonlint-lines-primitives": "^2.0.2", + "@mapbox/mapbox-gl-supported": "^2.0.1", + "@mapbox/point-geometry": "^0.1.0", + "@mapbox/tiny-sdf": "^2.0.6", + "@mapbox/unitbezier": "^0.0.1", + "@mapbox/vector-tile": "^1.3.1", + "@mapbox/whoots-js": "^3.1.0", + "csscolorparser": "~1.0.3", + "earcut": "^2.2.4", + "geojson-vt": "^3.2.1", + "gl-matrix": "^3.4.3", + "grid-index": "^1.1.0", + "kdbush": "^4.0.1", + "murmurhash-js": "^1.0.0", + "pbf": "^3.2.1", + "potpack": "^2.0.0", + "quickselect": "^2.0.0", + "rw": "^1.3.3", + "supercluster": "^8.0.0", + "tinyqueue": "^2.0.3", + "vt-pbf": "^3.1.3" + } + }, + "../cori.data.api/node_modules/markdown-it": { + "version": "14.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1", + "entities": "^4.4.0", + "linkify-it": "^5.0.0", + "mdurl": "^2.0.0", + "punycode.js": "^2.3.1", + "uc.micro": "^2.1.0" + }, + "bin": { + "markdown-it": "bin/markdown-it.mjs" + } + }, + "../cori.data.api/node_modules/markdown-it/node_modules/argparse": { + "version": "2.0.1", + "dev": true, + "license": "Python-2.0" + }, + "../cori.data.api/node_modules/mdast-util-from-markdown": { + "version": "2.0.1", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark": "^4.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-decode-string": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "../cori.data.api/node_modules/mdast-util-mdx-expression": { + "version": "2.0.1", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "../cori.data.api/node_modules/mdast-util-mdx-jsx": { + "version": "3.1.3", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "ccount": "^2.0.0", + "devlop": "^1.1.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0", + "parse-entities": "^4.0.0", + "stringify-entities": "^4.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "../cori.data.api/node_modules/mdast-util-mdxjs-esm": { + "version": "2.0.1", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "../cori.data.api/node_modules/mdast-util-phrasing": { + "version": "4.1.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/mdast": "^4.0.0", + "unist-util-is": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "../cori.data.api/node_modules/mdast-util-to-hast": { + "version": "13.2.0", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "@ungap/structured-clone": "^1.0.0", + "devlop": "^1.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "trim-lines": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "../cori.data.api/node_modules/mdast-util-to-markdown": { + "version": "2.1.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "longest-streak": "^3.0.0", + "mdast-util-phrasing": "^4.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark-util-decode-string": "^2.0.0", + "unist-util-visit": "^5.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "../cori.data.api/node_modules/mdast-util-to-string": { + "version": "4.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/mdast": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "../cori.data.api/node_modules/mdn-data": { + "version": "2.0.14", + "dev": true, + "license": "CC0-1.0" + }, + "../cori.data.api/node_modules/mdurl": { + "version": "2.0.0", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/meow": { + "version": "9.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/minimist": "^1.2.0", + "camelcase-keys": "^6.2.2", + "decamelize": "^1.2.0", + "decamelize-keys": "^1.1.0", + "hard-rejection": "^2.1.0", + "minimist-options": "4.1.0", + "normalize-package-data": "^3.0.0", + "read-pkg-up": "^7.0.1", + "redent": "^3.0.0", + "trim-newlines": "^3.0.0", + "type-fest": "^0.18.0", + "yargs-parser": "^20.2.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../cori.data.api/node_modules/meow/node_modules/type-fest": { + "version": "0.18.1", + "license": "(MIT OR CC0-1.0)", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../cori.data.api/node_modules/merge-stream": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/micromark": { + "version": "4.0.0", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "@types/debug": "^4.0.0", + "debug": "^4.0.0", + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "micromark-core-commonmark": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-combine-extensions": "^2.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-encode": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "micromark-util-subtokenize": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "../cori.data.api/node_modules/micromark-core-commonmark": { + "version": "2.0.1", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "micromark-factory-destination": "^2.0.0", + "micromark-factory-label": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-factory-title": "^2.0.0", + "micromark-factory-whitespace": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-classify-character": "^2.0.0", + "micromark-util-html-tag-name": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-subtokenize": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "../cori.data.api/node_modules/micromark-factory-destination": { + "version": "2.0.0", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "../cori.data.api/node_modules/micromark-factory-label": { + "version": "2.0.0", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "devlop": "^1.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "../cori.data.api/node_modules/micromark-factory-space": { + "version": "2.0.0", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "../cori.data.api/node_modules/micromark-factory-title": { + "version": "2.0.0", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "../cori.data.api/node_modules/micromark-factory-whitespace": { + "version": "2.0.0", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "../cori.data.api/node_modules/micromark-util-character": { + "version": "2.1.0", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "../cori.data.api/node_modules/micromark-util-chunked": { + "version": "2.0.0", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } + }, + "../cori.data.api/node_modules/micromark-util-classify-character": { + "version": "2.0.0", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "../cori.data.api/node_modules/micromark-util-combine-extensions": { + "version": "2.0.0", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "micromark-util-chunked": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "../cori.data.api/node_modules/micromark-util-decode-numeric-character-reference": { + "version": "2.0.1", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } + }, + "../cori.data.api/node_modules/micromark-util-decode-string": { + "version": "2.0.0", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "decode-named-character-reference": "^1.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-symbol": "^2.0.0" + } + }, + "../cori.data.api/node_modules/micromark-util-encode": { + "version": "2.0.0", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "../cori.data.api/node_modules/micromark-util-html-tag-name": { + "version": "2.0.0", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/micromark-util-normalize-identifier": { + "version": "2.0.0", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } + }, + "../cori.data.api/node_modules/micromark-util-resolve-all": { + "version": "2.0.0", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "micromark-util-types": "^2.0.0" + } + }, + "../cori.data.api/node_modules/micromark-util-sanitize-uri": { + "version": "2.0.0", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-encode": "^2.0.0", + "micromark-util-symbol": "^2.0.0" + } + }, + "../cori.data.api/node_modules/micromark-util-subtokenize": { + "version": "2.0.1", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "devlop": "^1.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "../cori.data.api/node_modules/micromark-util-symbol": { + "version": "2.0.0", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "../cori.data.api/node_modules/micromark-util-types": { + "version": "2.0.0", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "../cori.data.api/node_modules/micromatch": { + "version": "4.0.8", + "dev": true, + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "../cori.data.api/node_modules/mime": { + "version": "1.6.0", + "dev": true, + "license": "MIT", + "optional": true, + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "../cori.data.api/node_modules/mime-db": { + "version": "1.52.0", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "../cori.data.api/node_modules/mime-types": { + "version": "2.1.35", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "../cori.data.api/node_modules/mimic-fn": { + "version": "2.1.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "../cori.data.api/node_modules/mimic-response": { + "version": "1.0.1", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=4" + } + }, + "../cori.data.api/node_modules/min-indent": { + "version": "1.0.1", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=4" + } + }, + "../cori.data.api/node_modules/minimatch": { + "version": "9.0.5", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "../cori.data.api/node_modules/minimist": { + "version": "1.2.8", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "../cori.data.api/node_modules/minimist-options": { + "version": "4.1.0", + "license": "MIT", + "peer": true, + "dependencies": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0", + "kind-of": "^6.0.3" + }, + "engines": { + "node": ">= 6" + } + }, + "../cori.data.api/node_modules/minipass": { + "version": "7.1.2", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "../cori.data.api/node_modules/mjolnir.js": { + "version": "2.7.3", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/hammerjs": "^2.0.41", + "hammerjs": "^2.0.8" + }, + "engines": { + "node": ">= 4", + "npm": ">= 3" + } + }, + "../cori.data.api/node_modules/ms": { + "version": "2.1.3", + "license": "MIT" + }, + "../cori.data.api/node_modules/murmurhash-js": { + "version": "1.0.0", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/nanoid": { + "version": "2.1.11", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/natural-compare": { + "version": "1.4.0", + "dev": true, + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/needle": { + "version": "3.3.1", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "iconv-lite": "^0.6.3", + "sax": "^1.2.4" + }, + "bin": { + "needle": "bin/needle" + }, + "engines": { + "node": ">= 4.4.x" + } + }, + "../cori.data.api/node_modules/node-fetch": { + "version": "2.7.0", + "license": "MIT", + "peer": true, + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "../cori.data.api/node_modules/node-fetch/node_modules/tr46": { + "version": "0.0.3", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/node-fetch/node_modules/webidl-conversions": { + "version": "3.0.1", + "license": "BSD-2-Clause", + "peer": true + }, + "../cori.data.api/node_modules/node-fetch/node_modules/whatwg-url": { + "version": "5.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "../cori.data.api/node_modules/node-int64": { + "version": "0.4.0", + "dev": true, + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/node-releases": { + "version": "2.0.18", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/normalize-package-data": { + "version": "3.0.3", + "license": "BSD-2-Clause", + "peer": true, + "dependencies": { + "hosted-git-info": "^4.0.1", + "is-core-module": "^2.5.0", + "semver": "^7.3.4", + "validate-npm-package-license": "^3.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "../cori.data.api/node_modules/normalize-package-data/node_modules/semver": { + "version": "7.6.3", + "license": "ISC", + "peer": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "../cori.data.api/node_modules/normalize-path": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "../cori.data.api/node_modules/normalize-range": { + "version": "0.1.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "../cori.data.api/node_modules/normalize-url": { + "version": "6.1.0", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../cori.data.api/node_modules/npm-run-path": { + "version": "4.0.1", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/nth-check": { + "version": "2.1.1", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "boolbase": "^1.0.0" + }, + "funding": { + "url": "https://github.com/fb55/nth-check?sponsor=1" + } + }, + "../cori.data.api/node_modules/nwsapi": { + "version": "2.2.12", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/once": { + "version": "1.4.0", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "../cori.data.api/node_modules/onetime": { + "version": "5.1.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../cori.data.api/node_modules/oniguruma-to-js": { + "version": "0.4.3", + "dev": true, + "license": "MIT", + "dependencies": { + "regex": "^4.3.2" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "../cori.data.api/node_modules/p-cancelable": { + "version": "2.1.1", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/p-finally": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "../cori.data.api/node_modules/p-limit": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../cori.data.api/node_modules/p-locate": { + "version": "4.1.0", + "license": "MIT", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/p-locate/node_modules/p-limit": { + "version": "2.3.0", + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../cori.data.api/node_modules/p-queue": { + "version": "6.6.2", + "dev": true, + "license": "MIT", + "dependencies": { + "eventemitter3": "^4.0.4", + "p-timeout": "^3.2.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../cori.data.api/node_modules/p-queue/node_modules/eventemitter3": { + "version": "4.0.7", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/p-timeout": { + "version": "3.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "p-finally": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/p-try": { + "version": "2.2.0", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "../cori.data.api/node_modules/package-json-from-dist": { + "version": "1.0.0", + "dev": true, + "license": "BlueOak-1.0.0" + }, + "../cori.data.api/node_modules/parse-entities": { + "version": "4.0.1", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/unist": "^2.0.0", + "character-entities": "^2.0.0", + "character-entities-legacy": "^3.0.0", + "character-reference-invalid": "^2.0.0", + "decode-named-character-reference": "^1.0.0", + "is-alphanumerical": "^2.0.0", + "is-decimal": "^2.0.0", + "is-hexadecimal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "../cori.data.api/node_modules/parse-entities/node_modules/@types/unist": { + "version": "2.0.11", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/parse-json": { + "version": "5.2.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../cori.data.api/node_modules/parse-node-version": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "../cori.data.api/node_modules/parse5": { + "version": "7.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "entities": "^4.4.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "../cori.data.api/node_modules/path": { + "version": "0.12.7", + "dev": true, + "license": "MIT", + "dependencies": { + "process": "^0.11.1", + "util": "^0.10.3" + } + }, + "../cori.data.api/node_modules/path-exists": { + "version": "4.0.0", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/path-is-absolute": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "../cori.data.api/node_modules/path-key": { + "version": "3.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/path-parse": { + "version": "1.0.7", + "license": "MIT" + }, + "../cori.data.api/node_modules/path-scurry": { + "version": "1.11.1", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "../cori.data.api/node_modules/path-scurry/node_modules/lru-cache": { + "version": "10.4.3", + "dev": true, + "license": "ISC" + }, + "../cori.data.api/node_modules/pbf": { + "version": "3.3.0", + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "ieee754": "^1.1.12", + "resolve-protobuf-schema": "^2.1.0" + }, + "bin": { + "pbf": "bin/pbf" + } + }, + "../cori.data.api/node_modules/picocolors": { + "version": "1.1.0", + "license": "ISC" + }, + "../cori.data.api/node_modules/picomatch": { + "version": "2.3.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "../cori.data.api/node_modules/pify": { + "version": "5.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../cori.data.api/node_modules/pirates": { + "version": "4.0.6", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 6" + } + }, + "../cori.data.api/node_modules/pkg-dir": { + "version": "4.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/pngjs": { + "version": "5.0.0", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=10.13.0" + } + }, + "../cori.data.api/node_modules/postcss": { + "version": "8.4.47", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.7", + "picocolors": "^1.1.0", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "../cori.data.api/node_modules/postcss-calc": { + "version": "8.2.4", + "dev": true, + "license": "MIT", + "dependencies": { + "postcss-selector-parser": "^6.0.9", + "postcss-value-parser": "^4.2.0" + }, + "peerDependencies": { + "postcss": "^8.2.2" + } + }, + "../cori.data.api/node_modules/postcss-colormin": { + "version": "5.3.1", + "dev": true, + "license": "MIT", + "dependencies": { + "browserslist": "^4.21.4", + "caniuse-api": "^3.0.0", + "colord": "^2.9.1", + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "../cori.data.api/node_modules/postcss-convert-values": { + "version": "5.1.3", + "dev": true, + "license": "MIT", + "dependencies": { + "browserslist": "^4.21.4", + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "../cori.data.api/node_modules/postcss-discard-comments": { + "version": "5.1.2", + "dev": true, + "license": "MIT", + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "../cori.data.api/node_modules/postcss-discard-duplicates": { + "version": "5.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "../cori.data.api/node_modules/postcss-discard-empty": { + "version": "5.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "../cori.data.api/node_modules/postcss-discard-overridden": { + "version": "5.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "../cori.data.api/node_modules/postcss-load-config": { + "version": "3.1.4", + "dev": true, + "license": "MIT", + "dependencies": { + "lilconfig": "^2.0.5", + "yaml": "^1.10.2" + }, + "engines": { + "node": ">= 10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + "peerDependencies": { + "postcss": ">=8.0.9", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "postcss": { + "optional": true + }, + "ts-node": { + "optional": true + } + } + }, + "../cori.data.api/node_modules/postcss-merge-longhand": { + "version": "5.1.7", + "dev": true, + "license": "MIT", + "dependencies": { + "postcss-value-parser": "^4.2.0", + "stylehacks": "^5.1.1" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "../cori.data.api/node_modules/postcss-merge-rules": { + "version": "5.1.4", + "dev": true, + "license": "MIT", + "dependencies": { + "browserslist": "^4.21.4", + "caniuse-api": "^3.0.0", + "cssnano-utils": "^3.1.0", + "postcss-selector-parser": "^6.0.5" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "../cori.data.api/node_modules/postcss-minify-font-values": { + "version": "5.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "../cori.data.api/node_modules/postcss-minify-gradients": { + "version": "5.1.1", + "dev": true, + "license": "MIT", + "dependencies": { + "colord": "^2.9.1", + "cssnano-utils": "^3.1.0", + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "../cori.data.api/node_modules/postcss-minify-params": { + "version": "5.1.4", + "dev": true, + "license": "MIT", + "dependencies": { + "browserslist": "^4.21.4", + "cssnano-utils": "^3.1.0", + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "../cori.data.api/node_modules/postcss-minify-selectors": { + "version": "5.2.1", + "dev": true, + "license": "MIT", + "dependencies": { + "postcss-selector-parser": "^6.0.5" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "../cori.data.api/node_modules/postcss-modules": { + "version": "4.3.1", + "dev": true, + "license": "MIT", + "dependencies": { + "generic-names": "^4.0.0", + "icss-replace-symbols": "^1.1.0", + "lodash.camelcase": "^4.3.0", + "postcss-modules-extract-imports": "^3.0.0", + "postcss-modules-local-by-default": "^4.0.0", + "postcss-modules-scope": "^3.0.0", + "postcss-modules-values": "^4.0.0", + "string-hash": "^1.1.1" + }, + "peerDependencies": { + "postcss": "^8.0.0" + } + }, + "../cori.data.api/node_modules/postcss-modules-extract-imports": { + "version": "3.1.0", + "dev": true, + "license": "ISC", + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "../cori.data.api/node_modules/postcss-modules-local-by-default": { + "version": "4.0.5", + "dev": true, + "license": "MIT", + "dependencies": { + "icss-utils": "^5.0.0", + "postcss-selector-parser": "^6.0.2", + "postcss-value-parser": "^4.1.0" + }, + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "../cori.data.api/node_modules/postcss-modules-scope": { + "version": "3.2.0", + "dev": true, + "license": "ISC", + "dependencies": { + "postcss-selector-parser": "^6.0.4" + }, + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "../cori.data.api/node_modules/postcss-modules-values": { + "version": "4.0.0", + "dev": true, + "license": "ISC", + "dependencies": { + "icss-utils": "^5.0.0" + }, + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "../cori.data.api/node_modules/postcss-normalize-charset": { + "version": "5.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "../cori.data.api/node_modules/postcss-normalize-display-values": { + "version": "5.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "../cori.data.api/node_modules/postcss-normalize-positions": { + "version": "5.1.1", + "dev": true, + "license": "MIT", + "dependencies": { + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "../cori.data.api/node_modules/postcss-normalize-repeat-style": { + "version": "5.1.1", + "dev": true, + "license": "MIT", + "dependencies": { + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "../cori.data.api/node_modules/postcss-normalize-string": { + "version": "5.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "../cori.data.api/node_modules/postcss-normalize-timing-functions": { + "version": "5.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "../cori.data.api/node_modules/postcss-normalize-unicode": { + "version": "5.1.1", + "dev": true, + "license": "MIT", + "dependencies": { + "browserslist": "^4.21.4", + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "../cori.data.api/node_modules/postcss-normalize-url": { + "version": "5.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "normalize-url": "^6.0.1", + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "../cori.data.api/node_modules/postcss-normalize-whitespace": { + "version": "5.1.1", + "dev": true, + "license": "MIT", + "dependencies": { + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "../cori.data.api/node_modules/postcss-ordered-values": { + "version": "5.1.3", + "dev": true, + "license": "MIT", + "dependencies": { + "cssnano-utils": "^3.1.0", + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "../cori.data.api/node_modules/postcss-reduce-initial": { + "version": "5.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "browserslist": "^4.21.4", + "caniuse-api": "^3.0.0" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "../cori.data.api/node_modules/postcss-reduce-transforms": { + "version": "5.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "../cori.data.api/node_modules/postcss-selector-parser": { + "version": "6.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "../cori.data.api/node_modules/postcss-svgo": { + "version": "5.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "postcss-value-parser": "^4.2.0", + "svgo": "^2.7.0" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "../cori.data.api/node_modules/postcss-unique-selectors": { + "version": "5.1.1", + "dev": true, + "license": "MIT", + "dependencies": { + "postcss-selector-parser": "^6.0.5" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "../cori.data.api/node_modules/postcss-value-parser": { + "version": "4.2.0", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/postcss/node_modules/nanoid": { + "version": "3.3.7", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "../cori.data.api/node_modules/potpack": { + "version": "2.0.0", + "license": "ISC", + "peer": true + }, + "../cori.data.api/node_modules/pretty-format": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "../cori.data.api/node_modules/process": { + "version": "0.11.10", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6.0" + } + }, + "../cori.data.api/node_modules/promise.series": { + "version": "0.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12" + } + }, + "../cori.data.api/node_modules/prompts": { + "version": "2.4.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 6" + } + }, + "../cori.data.api/node_modules/property-information": { + "version": "6.5.0", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "../cori.data.api/node_modules/protocol-buffers-schema": { + "version": "3.6.0", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/proxy-from-env": { + "version": "1.1.0", + "license": "MIT" + }, + "../cori.data.api/node_modules/prr": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "optional": true + }, + "../cori.data.api/node_modules/psl": { + "version": "1.9.0", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/pump": { + "version": "3.0.2", + "license": "MIT", + "peer": true, + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "../cori.data.api/node_modules/punycode": { + "version": "2.3.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "../cori.data.api/node_modules/punycode.js": { + "version": "2.3.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "../cori.data.api/node_modules/pure-rand": { + "version": "6.1.0", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ], + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/qrcode": { + "version": "1.5.0", + "license": "MIT", + "peer": true, + "dependencies": { + "dijkstrajs": "^1.0.1", + "encode-utf8": "^1.0.3", + "pngjs": "^5.0.0", + "yargs": "^15.3.1" + }, + "bin": { + "qrcode": "bin/qrcode" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "../cori.data.api/node_modules/qrcode/node_modules/ansi-regex": { + "version": "5.0.1", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/qrcode/node_modules/ansi-styles": { + "version": "4.3.0", + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "../cori.data.api/node_modules/qrcode/node_modules/cliui": { + "version": "6.0.0", + "license": "ISC", + "peer": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "../cori.data.api/node_modules/qrcode/node_modules/emoji-regex": { + "version": "8.0.0", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/qrcode/node_modules/string-width": { + "version": "4.2.3", + "license": "MIT", + "peer": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/qrcode/node_modules/strip-ansi": { + "version": "6.0.1", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/qrcode/node_modules/wrap-ansi": { + "version": "6.2.0", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/qrcode/node_modules/y18n": { + "version": "4.0.3", + "license": "ISC", + "peer": true + }, + "../cori.data.api/node_modules/qrcode/node_modules/yargs": { + "version": "15.4.1", + "license": "MIT", + "peer": true, + "dependencies": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/qrcode/node_modules/yargs-parser": { + "version": "18.1.3", + "license": "ISC", + "peer": true, + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" + } + }, + "../cori.data.api/node_modules/querystringify": { + "version": "2.2.0", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/quick-lru": { + "version": "5.1.1", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../cori.data.api/node_modules/quickselect": { + "version": "2.0.0", + "license": "ISC", + "peer": true + }, + "../cori.data.api/node_modules/randombytes": { + "version": "2.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "../cori.data.api/node_modules/react": { + "version": "18.3.1", + "license": "MIT", + "peer": true, + "dependencies": { + "loose-envify": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "../cori.data.api/node_modules/react-dom": { + "version": "18.3.1", + "license": "MIT", + "peer": true, + "dependencies": { + "loose-envify": "^1.1.0", + "scheduler": "^0.23.2" + }, + "peerDependencies": { + "react": "^18.3.1" + } + }, + "../cori.data.api/node_modules/react-hook-form": { + "version": "7.53.0", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/react-hook-form" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17 || ^18 || ^19" + } + }, + "../cori.data.api/node_modules/react-is": { + "version": "18.3.1", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/react-map-gl": { + "version": "7.1.7", + "license": "MIT", + "peer": true, + "dependencies": { + "@maplibre/maplibre-gl-style-spec": "^19.2.1", + "@types/mapbox-gl": ">=1.0.0" + }, + "peerDependencies": { + "mapbox-gl": ">=1.13.0", + "maplibre-gl": ">=1.13.0", + "react": ">=16.3.0", + "react-dom": ">=16.3.0" + }, + "peerDependenciesMeta": { + "mapbox-gl": { + "optional": true + }, + "maplibre-gl": { + "optional": true + } + } + }, + "../cori.data.api/node_modules/react-markdown": { + "version": "9.0.1", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/hast": "^3.0.0", + "devlop": "^1.0.0", + "hast-util-to-jsx-runtime": "^2.0.0", + "html-url-attributes": "^3.0.0", + "mdast-util-to-hast": "^13.0.0", + "remark-parse": "^11.0.0", + "remark-rehype": "^11.0.0", + "unified": "^11.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "peerDependencies": { + "@types/react": ">=18", + "react": ">=18" + } + }, + "../cori.data.api/node_modules/react-remove-scroll": { + "version": "2.5.4", + "license": "MIT", + "peer": true, + "dependencies": { + "react-remove-scroll-bar": "^2.3.3", + "react-style-singleton": "^2.2.1", + "tslib": "^2.1.0", + "use-callback-ref": "^1.3.0", + "use-sidecar": "^1.1.2" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "../cori.data.api/node_modules/react-remove-scroll-bar": { + "version": "2.3.6", + "license": "MIT", + "peer": true, + "dependencies": { + "react-style-singleton": "^2.2.1", + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "../cori.data.api/node_modules/react-style-singleton": { + "version": "2.2.1", + "license": "MIT", + "peer": true, + "dependencies": { + "get-nonce": "^1.0.0", + "invariant": "^2.2.4", + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "../cori.data.api/node_modules/read-pkg": { + "version": "5.2.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/read-pkg-up": { + "version": "7.0.1", + "license": "MIT", + "peer": true, + "dependencies": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../cori.data.api/node_modules/read-pkg-up/node_modules/type-fest": { + "version": "0.8.1", + "license": "(MIT OR CC0-1.0)", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/read-pkg/node_modules/hosted-git-info": { + "version": "2.8.9", + "license": "ISC", + "peer": true + }, + "../cori.data.api/node_modules/read-pkg/node_modules/normalize-package-data": { + "version": "2.5.0", + "license": "BSD-2-Clause", + "peer": true, + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "../cori.data.api/node_modules/read-pkg/node_modules/semver": { + "version": "5.7.2", + "license": "ISC", + "peer": true, + "bin": { + "semver": "bin/semver" + } + }, + "../cori.data.api/node_modules/read-pkg/node_modules/type-fest": { + "version": "0.6.0", + "license": "(MIT OR CC0-1.0)", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/readdirp": { + "version": "4.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, + "../cori.data.api/node_modules/redent": { + "version": "3.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "indent-string": "^4.0.0", + "strip-indent": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/regenerate": { + "version": "1.4.2", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/regenerate-unicode-properties": { + "version": "10.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "regenerate": "^1.4.2" + }, + "engines": { + "node": ">=4" + } + }, + "../cori.data.api/node_modules/regenerator-runtime": { + "version": "0.14.1", + "license": "MIT" + }, + "../cori.data.api/node_modules/regenerator-transform": { + "version": "0.15.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.8.4" + } + }, + "../cori.data.api/node_modules/regex": { + "version": "4.3.2", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/regexpu-core": { + "version": "5.3.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/regjsgen": "^0.8.0", + "regenerate": "^1.4.2", + "regenerate-unicode-properties": "^10.1.0", + "regjsparser": "^0.9.1", + "unicode-match-property-ecmascript": "^2.0.0", + "unicode-match-property-value-ecmascript": "^2.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "../cori.data.api/node_modules/regjsparser": { + "version": "0.9.1", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "jsesc": "~0.5.0" + }, + "bin": { + "regjsparser": "bin/parser" + } + }, + "../cori.data.api/node_modules/regjsparser/node_modules/jsesc": { + "version": "0.5.0", + "dev": true, + "bin": { + "jsesc": "bin/jsesc" + } + }, + "../cori.data.api/node_modules/remark-parse": { + "version": "11.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-from-markdown": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "../cori.data.api/node_modules/remark-rehype": { + "version": "11.1.1", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "mdast-util-to-hast": "^13.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "../cori.data.api/node_modules/require-directory": { + "version": "2.1.1", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "../cori.data.api/node_modules/require-main-filename": { + "version": "2.0.0", + "license": "ISC", + "peer": true + }, + "../cori.data.api/node_modules/requires-port": { + "version": "1.0.0", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/reserved-words": { + "version": "0.1.2", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/resolve": { + "version": "1.22.8", + "license": "MIT", + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "../cori.data.api/node_modules/resolve-alpn": { + "version": "1.2.1", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/resolve-cwd": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/resolve-from": { + "version": "5.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/resolve-protobuf-schema": { + "version": "2.1.0", + "license": "MIT", + "peer": true, + "dependencies": { + "protocol-buffers-schema": "^3.3.1" + } + }, + "../cori.data.api/node_modules/resolve.exports": { + "version": "2.0.2", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=10" + } + }, + "../cori.data.api/node_modules/responselike": { + "version": "2.0.1", + "license": "MIT", + "peer": true, + "dependencies": { + "lowercase-keys": "^2.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../cori.data.api/node_modules/robust-predicates": { + "version": "3.0.2", + "license": "Unlicense", + "peer": true + }, + "../cori.data.api/node_modules/rollup": { + "version": "4.22.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.5" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.22.4", + "@rollup/rollup-android-arm64": "4.22.4", + "@rollup/rollup-darwin-arm64": "4.22.4", + "@rollup/rollup-darwin-x64": "4.22.4", + "@rollup/rollup-linux-arm-gnueabihf": "4.22.4", + "@rollup/rollup-linux-arm-musleabihf": "4.22.4", + "@rollup/rollup-linux-arm64-gnu": "4.22.4", + "@rollup/rollup-linux-arm64-musl": "4.22.4", + "@rollup/rollup-linux-powerpc64le-gnu": "4.22.4", + "@rollup/rollup-linux-riscv64-gnu": "4.22.4", + "@rollup/rollup-linux-s390x-gnu": "4.22.4", + "@rollup/rollup-linux-x64-gnu": "4.22.4", + "@rollup/rollup-linux-x64-musl": "4.22.4", + "@rollup/rollup-win32-arm64-msvc": "4.22.4", + "@rollup/rollup-win32-ia32-msvc": "4.22.4", + "@rollup/rollup-win32-x64-msvc": "4.22.4", + "fsevents": "~2.3.2" + } + }, + "../cori.data.api/node_modules/rollup-plugin-dts": { + "version": "6.1.1", + "dev": true, + "license": "LGPL-3.0-only", + "dependencies": { + "magic-string": "^0.30.10" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/Swatinem" + }, + "optionalDependencies": { + "@babel/code-frame": "^7.24.2" + }, + "peerDependencies": { + "rollup": "^3.29.4 || ^4", + "typescript": "^4.5 || ^5.0" + } + }, + "../cori.data.api/node_modules/rollup-plugin-import-css": { + "version": "3.5.1", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.0.4" + }, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "rollup": "^2.x.x || ^3.x.x || ^4.x.x" + } + }, + "../cori.data.api/node_modules/rollup-plugin-peer-deps-external": { + "version": "2.2.4", + "dev": true, + "license": "MIT", + "peerDependencies": { + "rollup": "*" + } + }, + "../cori.data.api/node_modules/rollup-plugin-postcss": { + "version": "4.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "concat-with-sourcemaps": "^1.1.0", + "cssnano": "^5.0.1", + "import-cwd": "^3.0.0", + "p-queue": "^6.6.2", + "pify": "^5.0.0", + "postcss-load-config": "^3.0.0", + "postcss-modules": "^4.0.0", + "promise.series": "^0.2.0", + "resolve": "^1.19.0", + "rollup-pluginutils": "^2.8.2", + "safe-identifier": "^0.4.2", + "style-inject": "^0.3.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "postcss": "8.x" + } + }, + "../cori.data.api/node_modules/rollup-plugin-postcss-modules": { + "version": "2.1.1", + "dev": true, + "license": "GPL-3.0", + "dependencies": { + "camelcase": "^6.0.0 || ^7.0.0", + "postcss-modules": "^6.0.0", + "reserved-words": "^0.1.2", + "rollup-plugin-postcss": "^4.0.2" + }, + "peerDependencies": { + "postcss": "^8.0.0" + } + }, + "../cori.data.api/node_modules/rollup-plugin-postcss-modules/node_modules/camelcase": { + "version": "7.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../cori.data.api/node_modules/rollup-plugin-postcss-modules/node_modules/postcss-modules": { + "version": "6.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "generic-names": "^4.0.0", + "icss-utils": "^5.1.0", + "lodash.camelcase": "^4.3.0", + "postcss-modules-extract-imports": "^3.0.0", + "postcss-modules-local-by-default": "^4.0.0", + "postcss-modules-scope": "^3.0.0", + "postcss-modules-values": "^4.0.0", + "string-hash": "^1.1.1" + }, + "peerDependencies": { + "postcss": "^8.0.0" + } + }, + "../cori.data.api/node_modules/rollup-plugin-postcss/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "../cori.data.api/node_modules/rollup-plugin-postcss/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "../cori.data.api/node_modules/rollup-plugin-postcss/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/rollup-plugin-postcss/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/rollup-plugin-typescript2": { + "version": "0.36.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^4.1.2", + "find-cache-dir": "^3.3.2", + "fs-extra": "^10.0.0", + "semver": "^7.5.4", + "tslib": "^2.6.2" + }, + "peerDependencies": { + "rollup": ">=1.26.3", + "typescript": ">=2.4.0" + } + }, + "../cori.data.api/node_modules/rollup-plugin-typescript2/node_modules/@rollup/pluginutils": { + "version": "4.2.1", + "dev": true, + "license": "MIT", + "dependencies": { + "estree-walker": "^2.0.1", + "picomatch": "^2.2.2" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "../cori.data.api/node_modules/rollup-plugin-typescript2/node_modules/semver": { + "version": "7.6.3", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "../cori.data.api/node_modules/rollup-pluginutils": { + "version": "2.8.2", + "dev": true, + "license": "MIT", + "dependencies": { + "estree-walker": "^0.6.1" + } + }, + "../cori.data.api/node_modules/rollup-pluginutils/node_modules/estree-walker": { + "version": "0.6.1", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/rollup/node_modules/@types/estree": { + "version": "1.0.5", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/rw": { + "version": "1.3.3", + "license": "BSD-3-Clause", + "peer": true + }, + "../cori.data.api/node_modules/rxjs": { + "version": "7.8.1", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.1.0" + } + }, + "../cori.data.api/node_modules/safe-buffer": { + "version": "5.2.1", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "../cori.data.api/node_modules/safe-identifier": { + "version": "0.4.2", + "dev": true, + "license": "ISC" + }, + "../cori.data.api/node_modules/safer-buffer": { + "version": "2.1.2", + "license": "MIT" + }, + "../cori.data.api/node_modules/sass": { + "version": "1.79.3", + "dev": true, + "license": "MIT", + "dependencies": { + "chokidar": "^4.0.0", + "immutable": "^4.0.0", + "source-map-js": ">=0.6.2 <2.0.0" + }, + "bin": { + "sass": "sass.js" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "../cori.data.api/node_modules/sax": { + "version": "1.4.1", + "dev": true, + "license": "ISC", + "optional": true + }, + "../cori.data.api/node_modules/saxes": { + "version": "6.0.0", + "dev": true, + "license": "ISC", + "dependencies": { + "xmlchars": "^2.2.0" + }, + "engines": { + "node": ">=v12.22.7" + } + }, + "../cori.data.api/node_modules/scheduler": { + "version": "0.23.2", + "license": "MIT", + "peer": true, + "dependencies": { + "loose-envify": "^1.1.0" + } + }, + "../cori.data.api/node_modules/semver": { + "version": "6.3.1", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "../cori.data.api/node_modules/serialize-javascript": { + "version": "6.0.2", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "../cori.data.api/node_modules/set-blocking": { + "version": "2.0.0", + "license": "ISC", + "peer": true + }, + "../cori.data.api/node_modules/set-value": { + "version": "2.0.1", + "license": "MIT", + "peer": true, + "dependencies": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "../cori.data.api/node_modules/shebang-command": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/shebang-regex": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/shiki": { + "version": "1.18.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@shikijs/core": "1.18.0", + "@shikijs/engine-javascript": "1.18.0", + "@shikijs/engine-oniguruma": "1.18.0", + "@shikijs/types": "1.18.0", + "@shikijs/vscode-textmate": "^9.2.2", + "@types/hast": "^3.0.4" + } + }, + "../cori.data.api/node_modules/signal-exit": { + "version": "4.1.0", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "../cori.data.api/node_modules/sisteransi": { + "version": "1.0.5", + "dev": true, + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/slash": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/smob": { + "version": "1.5.0", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/sort-asc": { + "version": "0.2.0", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "../cori.data.api/node_modules/sort-desc": { + "version": "0.2.0", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "../cori.data.api/node_modules/sort-object": { + "version": "3.0.3", + "license": "MIT", + "peer": true, + "dependencies": { + "bytewise": "^1.1.0", + "get-value": "^2.0.2", + "is-extendable": "^0.1.1", + "sort-asc": "^0.2.0", + "sort-desc": "^0.2.0", + "union-value": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "../cori.data.api/node_modules/source-map": { + "version": "0.6.1", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "../cori.data.api/node_modules/source-map-js": { + "version": "1.2.1", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "../cori.data.api/node_modules/source-map-support": { + "version": "0.5.13", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "../cori.data.api/node_modules/space-separated-tokens": { + "version": "2.0.2", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "../cori.data.api/node_modules/spdx-correct": { + "version": "3.2.0", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "../cori.data.api/node_modules/spdx-exceptions": { + "version": "2.5.0", + "license": "CC-BY-3.0", + "peer": true + }, + "../cori.data.api/node_modules/spdx-expression-parse": { + "version": "3.0.1", + "license": "MIT", + "peer": true, + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "../cori.data.api/node_modules/spdx-license-ids": { + "version": "3.0.20", + "license": "CC0-1.0", + "peer": true + }, + "../cori.data.api/node_modules/split-string": { + "version": "3.1.0", + "license": "MIT", + "peer": true, + "dependencies": { + "extend-shallow": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "../cori.data.api/node_modules/split-string/node_modules/extend-shallow": { + "version": "3.0.2", + "license": "MIT", + "peer": true, + "dependencies": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "../cori.data.api/node_modules/split-string/node_modules/is-extendable": { + "version": "1.0.1", + "license": "MIT", + "peer": true, + "dependencies": { + "is-plain-object": "^2.0.4" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "../cori.data.api/node_modules/sprintf-js": { + "version": "1.0.3", + "dev": true, + "license": "BSD-3-Clause", + "peer": true + }, + "../cori.data.api/node_modules/stable": { + "version": "0.1.8", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/stack-utils": { + "version": "2.0.6", + "dev": true, + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "../cori.data.api/node_modules/stack-utils/node_modules/escape-string-regexp": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/string-hash": { + "version": "1.1.3", + "dev": true, + "license": "CC0-1.0" + }, + "../cori.data.api/node_modules/string-length": { + "version": "4.0.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "char-regex": "^1.0.2", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "../cori.data.api/node_modules/string-length/node_modules/ansi-regex": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/string-length/node_modules/strip-ansi": { + "version": "6.0.1", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/string-width": { + "version": "5.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../cori.data.api/node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/string-width-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/string-width-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/stringify-entities": { + "version": "4.0.4", + "license": "MIT", + "dependencies": { + "character-entities-html4": "^2.0.0", + "character-entities-legacy": "^3.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "../cori.data.api/node_modules/strip-ansi": { + "version": "7.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "../cori.data.api/node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/strip-bom": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/strip-final-newline": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "../cori.data.api/node_modules/strip-indent": { + "version": "3.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "min-indent": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/strip-json-comments": { + "version": "3.1.1", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../cori.data.api/node_modules/strnum": { + "version": "1.0.5", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/style-inject": { + "version": "0.3.0", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/style-to-object": { + "version": "1.0.8", + "license": "MIT", + "peer": true, + "dependencies": { + "inline-style-parser": "0.2.4" + } + }, + "../cori.data.api/node_modules/stylehacks": { + "version": "5.1.1", + "dev": true, + "license": "MIT", + "dependencies": { + "browserslist": "^4.21.4", + "postcss-selector-parser": "^6.0.4" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "../cori.data.api/node_modules/stylus": { + "version": "0.62.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@adobe/css-tools": "~4.3.1", + "debug": "^4.3.2", + "glob": "^7.1.6", + "sax": "~1.3.0", + "source-map": "^0.7.3" + }, + "bin": { + "stylus": "bin/stylus" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://opencollective.com/stylus" + } + }, + "../cori.data.api/node_modules/stylus/node_modules/brace-expansion": { + "version": "1.1.11", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "../cori.data.api/node_modules/stylus/node_modules/glob": { + "version": "7.2.3", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "../cori.data.api/node_modules/stylus/node_modules/minimatch": { + "version": "3.1.2", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "../cori.data.api/node_modules/stylus/node_modules/sax": { + "version": "1.3.0", + "dev": true, + "license": "ISC" + }, + "../cori.data.api/node_modules/stylus/node_modules/source-map": { + "version": "0.7.4", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">= 8" + } + }, + "../cori.data.api/node_modules/subtag": { + "version": "0.5.0", + "license": "ISC", + "peer": true + }, + "../cori.data.api/node_modules/suggestions": { + "version": "1.7.1", + "license": "ISC", + "peer": true, + "dependencies": { + "fuzzy": "^0.1.1", + "xtend": "^4.0.0" + } + }, + "../cori.data.api/node_modules/supercluster": { + "version": "8.0.1", + "license": "ISC", + "peer": true, + "dependencies": { + "kdbush": "^4.0.2" + } + }, + "../cori.data.api/node_modules/supports-color": { + "version": "5.5.0", + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "../cori.data.api/node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "../cori.data.api/node_modules/svgo": { + "version": "2.8.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@trysound/sax": "0.2.0", + "commander": "^7.2.0", + "css-select": "^4.1.3", + "css-tree": "^1.1.3", + "csso": "^4.2.0", + "picocolors": "^1.0.0", + "stable": "^0.1.8" + }, + "bin": { + "svgo": "bin/svgo" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "../cori.data.api/node_modules/symbol-tree": { + "version": "3.2.4", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/table-layout": { + "version": "4.1.1", + "license": "MIT", + "peer": true, + "dependencies": { + "array-back": "^6.2.2", + "wordwrapjs": "^5.1.0" + }, + "engines": { + "node": ">=12.17" + } + }, + "../cori.data.api/node_modules/table-layout/node_modules/array-back": { + "version": "6.2.2", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12.17" + } + }, + "../cori.data.api/node_modules/terser": { + "version": "5.33.0", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.8.2", + "commander": "^2.20.0", + "source-map-support": "~0.5.20" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=10" + } + }, + "../cori.data.api/node_modules/terser/node_modules/commander": { + "version": "2.20.3", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/terser/node_modules/source-map-support": { + "version": "0.5.21", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "../cori.data.api/node_modules/test-exclude": { + "version": "6.0.0", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/test-exclude/node_modules/brace-expansion": { + "version": "1.1.11", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "../cori.data.api/node_modules/test-exclude/node_modules/glob": { + "version": "7.2.3", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "../cori.data.api/node_modules/test-exclude/node_modules/minimatch": { + "version": "3.1.2", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "../cori.data.api/node_modules/tinyqueue": { + "version": "2.0.3", + "license": "ISC", + "peer": true + }, + "../cori.data.api/node_modules/tmpl": { + "version": "1.0.5", + "dev": true, + "license": "BSD-3-Clause", + "peer": true + }, + "../cori.data.api/node_modules/to-fast-properties": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "../cori.data.api/node_modules/to-regex-range": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "../cori.data.api/node_modules/tough-cookie": { + "version": "4.1.4", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "psl": "^1.1.33", + "punycode": "^2.1.1", + "universalify": "^0.2.0", + "url-parse": "^1.5.3" + }, + "engines": { + "node": ">=6" + } + }, + "../cori.data.api/node_modules/tough-cookie/node_modules/universalify": { + "version": "0.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4.0.0" + } + }, + "../cori.data.api/node_modules/tr46": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "punycode": "^2.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/trim-lines": { + "version": "3.0.1", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "../cori.data.api/node_modules/trim-newlines": { + "version": "3.0.1", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/trough": { + "version": "2.2.0", + "license": "MIT", + "peer": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "../cori.data.api/node_modules/ts-jest": { + "version": "29.2.5", + "dev": true, + "license": "MIT", + "dependencies": { + "bs-logger": "^0.2.6", + "ejs": "^3.1.10", + "fast-json-stable-stringify": "^2.1.0", + "jest-util": "^29.0.0", + "json5": "^2.2.3", + "lodash.memoize": "^4.1.2", + "make-error": "^1.3.6", + "semver": "^7.6.3", + "yargs-parser": "^21.1.1" + }, + "bin": { + "ts-jest": "cli.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0" + }, + "peerDependencies": { + "@babel/core": ">=7.0.0-beta.0 <8", + "@jest/transform": "^29.0.0", + "@jest/types": "^29.0.0", + "babel-jest": "^29.0.0", + "jest": "^29.0.0", + "typescript": ">=4.3 <6" + }, + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "@jest/transform": { + "optional": true + }, + "@jest/types": { + "optional": true + }, + "babel-jest": { + "optional": true + }, + "esbuild": { + "optional": true + } + } + }, + "../cori.data.api/node_modules/ts-jest/node_modules/semver": { + "version": "7.6.3", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "../cori.data.api/node_modules/ts-jest/node_modules/yargs-parser": { + "version": "21.1.1", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/tsconfig-paths": { + "version": "4.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "json5": "^2.2.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "../cori.data.api/node_modules/tsconfig-paths/node_modules/strip-bom": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "../cori.data.api/node_modules/tslib": { + "version": "2.7.0", + "license": "0BSD" + }, + "../cori.data.api/node_modules/type-detect": { + "version": "4.0.8", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "../cori.data.api/node_modules/type-fest": { + "version": "0.21.3", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../cori.data.api/node_modules/typedoc": { + "version": "0.26.7", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "lunr": "^2.3.9", + "markdown-it": "^14.1.0", + "minimatch": "^9.0.5", + "shiki": "^1.16.2", + "yaml": "^2.5.1" + }, + "bin": { + "typedoc": "bin/typedoc" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x" + } + }, + "../cori.data.api/node_modules/typedoc-github-wiki-theme": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "peerDependencies": { + "typedoc-plugin-markdown": ">=4.0.0" + } + }, + "../cori.data.api/node_modules/typedoc-plugin-markdown": { + "version": "4.2.8", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "typedoc": "0.26.x" + } + }, + "../cori.data.api/node_modules/typedoc/node_modules/yaml": { + "version": "2.5.1", + "dev": true, + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14" + } + }, + "../cori.data.api/node_modules/typescript": { + "version": "5.5.4", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "../cori.data.api/node_modules/typescript-plugin-css-modules": { + "version": "5.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/postcss-modules-local-by-default": "^4.0.2", + "@types/postcss-modules-scope": "^3.0.4", + "dotenv": "^16.4.2", + "icss-utils": "^5.1.0", + "less": "^4.2.0", + "lodash.camelcase": "^4.3.0", + "postcss": "^8.4.35", + "postcss-load-config": "^3.1.4", + "postcss-modules-extract-imports": "^3.0.0", + "postcss-modules-local-by-default": "^4.0.4", + "postcss-modules-scope": "^3.1.1", + "reserved-words": "^0.1.2", + "sass": "^1.70.0", + "source-map-js": "^1.0.2", + "stylus": "^0.62.0", + "tsconfig-paths": "^4.2.0" + }, + "peerDependencies": { + "typescript": ">=4.0.0" + } + }, + "../cori.data.api/node_modules/typewise": { + "version": "1.0.3", + "license": "MIT", + "peer": true, + "dependencies": { + "typewise-core": "^1.2.0" + } + }, + "../cori.data.api/node_modules/typewise-core": { + "version": "1.2.0", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/typical": { + "version": "4.0.0", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/uc.micro": { + "version": "2.1.0", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/ulid": { + "version": "2.3.0", + "license": "MIT", + "peer": true, + "bin": { + "ulid": "bin/cli.js" + } + }, + "../cori.data.api/node_modules/undici-types": { + "version": "6.19.8", + "license": "MIT" + }, + "../cori.data.api/node_modules/unicode-canonical-property-names-ecmascript": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "../cori.data.api/node_modules/unicode-match-property-ecmascript": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "unicode-canonical-property-names-ecmascript": "^2.0.0", + "unicode-property-aliases-ecmascript": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "../cori.data.api/node_modules/unicode-match-property-value-ecmascript": { + "version": "2.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "../cori.data.api/node_modules/unicode-property-aliases-ecmascript": { + "version": "2.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "../cori.data.api/node_modules/unified": { + "version": "11.0.5", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "../cori.data.api/node_modules/unified/node_modules/is-plain-obj": { + "version": "4.1.0", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../cori.data.api/node_modules/union-value": { + "version": "1.0.1", + "license": "MIT", + "peer": true, + "dependencies": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "../cori.data.api/node_modules/unist-util-is": { + "version": "6.0.0", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "../cori.data.api/node_modules/unist-util-position": { + "version": "5.0.0", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "../cori.data.api/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "../cori.data.api/node_modules/unist-util-visit": { + "version": "5.0.0", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "../cori.data.api/node_modules/unist-util-visit-parents": { + "version": "6.0.1", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "../cori.data.api/node_modules/universalify": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10.0.0" + } + }, + "../cori.data.api/node_modules/update-browserslist-db": { + "version": "1.1.0", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.1.2", + "picocolors": "^1.0.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "../cori.data.api/node_modules/url-parse": { + "version": "1.5.10", + "dev": true, + "license": "MIT", + "dependencies": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, + "../cori.data.api/node_modules/use-callback-ref": { + "version": "1.3.2", + "license": "MIT", + "peer": true, + "dependencies": { + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "../cori.data.api/node_modules/use-isomorphic-layout-effect": { + "version": "1.1.2", + "license": "MIT", + "peer": true, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "../cori.data.api/node_modules/use-sidecar": { + "version": "1.1.2", + "license": "MIT", + "peer": true, + "dependencies": { + "detect-node-es": "^1.1.0", + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "^16.9.0 || ^17.0.0 || ^18.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "../cori.data.api/node_modules/use-sync-external-store": { + "version": "1.2.2", + "license": "MIT", + "peer": true, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, + "../cori.data.api/node_modules/util": { + "version": "0.10.4", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "2.0.3" + } + }, + "../cori.data.api/node_modules/util-deprecate": { + "version": "1.0.2", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/uuid": { + "version": "9.0.1", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "peer": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "../cori.data.api/node_modules/v8-to-istanbul": { + "version": "9.3.0", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^2.0.0" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "../cori.data.api/node_modules/validate-npm-package-license": { + "version": "3.0.4", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "../cori.data.api/node_modules/vfile": { + "version": "6.0.3", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "../cori.data.api/node_modules/vfile-message": { + "version": "4.0.2", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "../cori.data.api/node_modules/vt-pbf": { + "version": "3.1.3", + "license": "MIT", + "peer": true, + "dependencies": { + "@mapbox/point-geometry": "0.1.0", + "@mapbox/vector-tile": "^1.3.1", + "pbf": "^3.2.1" + } + }, + "../cori.data.api/node_modules/w3c-xmlserializer": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "xml-name-validator": "^4.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "../cori.data.api/node_modules/walker": { + "version": "1.0.8", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "makeerror": "1.0.12" + } + }, + "../cori.data.api/node_modules/webidl-conversions": { + "version": "7.0.0", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/wgsl_reflect": { + "version": "1.0.12", + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/whatwg-encoding": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "iconv-lite": "0.6.3" + }, + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/whatwg-mimetype": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/whatwg-url": { + "version": "11.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "tr46": "^3.0.0", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/which": { + "version": "2.0.2", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "../cori.data.api/node_modules/which-module": { + "version": "2.0.1", + "license": "ISC", + "peer": true + }, + "../cori.data.api/node_modules/wordwrapjs": { + "version": "5.1.0", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12.17" + } + }, + "../cori.data.api/node_modules/wrap-ansi": { + "version": "8.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "../cori.data.api/node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "../cori.data.api/node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "../cori.data.api/node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "6.2.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "../cori.data.api/node_modules/wrappy": { + "version": "1.0.2", + "license": "ISC" + }, + "../cori.data.api/node_modules/write-file-atomic": { + "version": "4.0.2", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.7" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "../cori.data.api/node_modules/write-file-atomic/node_modules/signal-exit": { + "version": "3.0.7", + "dev": true, + "license": "ISC", + "peer": true + }, + "../cori.data.api/node_modules/ws": { + "version": "8.18.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "../cori.data.api/node_modules/xml-name-validator": { + "version": "4.0.0", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/xmlchars": { + "version": "2.2.0", + "dev": true, + "license": "MIT" + }, + "../cori.data.api/node_modules/xstate": { + "version": "4.38.3", + "license": "MIT", + "peer": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/xstate" + } + }, + "../cori.data.api/node_modules/xtend": { + "version": "4.0.2", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.4" + } + }, + "../cori.data.api/node_modules/y18n": { + "version": "5.0.8", + "dev": true, + "license": "ISC", + "peer": true, + "engines": { + "node": ">=10" + } + }, + "../cori.data.api/node_modules/yallist": { + "version": "3.1.1", + "dev": true, + "license": "ISC" + }, + "../cori.data.api/node_modules/yaml": { + "version": "1.10.2", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 6" + } + }, + "../cori.data.api/node_modules/yargs": { + "version": "17.7.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/yargs-parser": { + "version": "20.2.9", + "license": "ISC", + "peer": true, + "engines": { + "node": ">=10" + } + }, + "../cori.data.api/node_modules/yargs/node_modules/ansi-regex": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/yargs/node_modules/emoji-regex": { + "version": "8.0.0", + "dev": true, + "license": "MIT", + "peer": true + }, + "../cori.data.api/node_modules/yargs/node_modules/string-width": { + "version": "4.2.3", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/yargs/node_modules/strip-ansi": { + "version": "6.0.1", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "../cori.data.api/node_modules/yargs/node_modules/yargs-parser": { + "version": "21.1.1", + "dev": true, + "license": "ISC", + "peer": true, + "engines": { + "node": ">=12" + } + }, + "../cori.data.api/node_modules/yocto-queue": { + "version": "0.1.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../cori.data.api/node_modules/zwitch": { + "version": "2.0.4", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "cisco": { + "name": "@cori-risi/cisco", + "version": "0.0.1", + "license": "ISC" + }, + "frontend": { + "name": "@cori-risi/frontend", + "version": "1.0.1", + "dependencies": { + "@apollo/client": "^3.7.17", + "@aws-amplify/api": "^6.0.9", + "@aws-amplify/auth": "^6.0.9", + "@aws-amplify/core": "^6.0.9", + "@aws-amplify/geo": "^3.0.13", + "@aws-amplify/ui": "^6.0.1", + "@aws-amplify/ui-react": "^6.1.2", + "@cori-risi/cori.data.api": "github:ruralinnovation/cori.data.api", + "@deck.gl/core": "^9.0.21", + "@deck.gl/layers": "^9.0.21", + "@deck.gl/mapbox": "^9.0.21", + "@deck.gl/react": "^9.0.21", + "@emotion/react": "^11.11.3", + "@emotion/styled": "^11.11.0", + "@mapbox/mapbox-gl-geocoder": "^4.7.2", + "@mui/icons-material": "^5.15.10", + "@mui/material": "^5.15.3", + "@reduxjs/toolkit": "^2.0.1", + "aws-amplify": "^6.0.2", + "axios": "^1.7.2", + "d3": "^7.9.0", + "d3-format": "^3.1.0", + "deck.gl": "^9.0.19", + "mapbox-gl": "^2.0.0", + "mui": "^0.0.1", + "mui-datatables": "^4.3.0", + "normalize.css": "^8.0.1", + "parse-url": "^9.2.0", + "prop-types": "^15.8.1", + "query-string": "^8.1.0", + "react": "^18.3.1", + "react-dom": "^18.3.1", + "react-map-gl": "^7.1.0", + "redux": "^5.0.0" + }, + "devDependencies": { + "@babel/plugin-transform-react-jsx": "^7.24.7", + "@babel/preset-env": "^7.24.8", + "@babel/preset-react": "^7.24.7", + "@babel/preset-typescript": "^7.24.7", + "@types/d3": "^7.4.3", + "@types/jest": "^29.5.12", + "@types/mapbox__mapbox-gl-geocoder": "^4.7.2", + "@types/react": "^18.3.1", + "@types/react-dom": "^18.3.0", + "events": "^3.3.0", + "identity-obj-proxy": "^3.0.0", + "jest-environment-jsdom": "^29.7.0", + "ts-jest": "~29.2.2", + "typescript": "^4.0.0", + "vite": "^4.0.0" + } + }, + "frontend/node_modules/@cori-risi/cori.data.api": { + "version": "1.0.1", + "resolved": "git+ssh://git@github.com/ruralinnovation/cori.data.api.git#2dcb6cf304e5e7732ed281d8cfed484b49cd9ee7", + "license": "ISC", + "peerDependencies": { + "@aws-amplify/auth": "^6.0.2", + "@aws-amplify/ui-react": "^6.1.2", + "@deck.gl/mapbox": "^9.0.21", + "@mapbox/mapbox-gl-geocoder": "^4.7.2", + "arquero": "^5.4.1", + "aws-amplify": "^6.0.2", + "axios": "^1.7.2", + "d3": "^7.9.0", + "d3-textwrap": "^3.0.0", + "html-to-image": "^1.11.11", + "mapbox-gl": "^2.0.0", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "react-map-gl": "^7.1.7", + "react-markdown": "^9.0.1" + } + }, + "node_modules/@ampproject/remapping": { + "version": "2.3.0", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@apollo/client": { + "version": "3.11.8", + "license": "MIT", + "dependencies": { + "@graphql-typed-document-node/core": "^3.1.1", + "@wry/caches": "^1.0.0", + "@wry/equality": "^0.5.6", + "@wry/trie": "^0.5.0", + "graphql-tag": "^2.12.6", + "hoist-non-react-statics": "^3.3.2", + "optimism": "^0.18.0", + "prop-types": "^15.7.2", + "rehackt": "^0.1.0", + "response-iterator": "^0.2.6", + "symbol-observable": "^4.0.0", + "ts-invariant": "^0.10.3", + "tslib": "^2.3.0", + "zen-observable-ts": "^1.2.5" + }, + "peerDependencies": { + "graphql": "^15.0.0 || ^16.0.0", + "graphql-ws": "^5.5.5", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc <19.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc <19.0.0", + "subscriptions-transport-ws": "^0.9.0 || ^0.11.0" + }, + "peerDependenciesMeta": { + "graphql-ws": { + "optional": true + }, + "react": { + "optional": true + }, + "react-dom": { + "optional": true + }, + "subscriptions-transport-ws": { + "optional": true + } + } + }, + "node_modules/@arcgis/core": { + "version": "4.30.9", + "license": "SEE LICENSE IN copyright.txt", + "peer": true, + "dependencies": { + "@esri/arcgis-html-sanitizer": "~4.0.3", + "@esri/calcite-colors": "~6.1.0", + "@esri/calcite-components": "^2.8.5", + "@vaadin/grid": "~24.3.13", + "@zip.js/zip.js": "~2.7.44", + "luxon": "~3.4.4", + "marked": "~12.0.2", + "sortablejs": "~1.15.2" + } + }, + "node_modules/@aws-amplify/analytics": { + "version": "7.0.47", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/client-firehose": "3.621.0", + "@aws-sdk/client-kinesis": "3.621.0", + "@aws-sdk/client-personalize-events": "3.621.0", + "@smithy/util-utf8": "2.0.0", + "tslib": "^2.5.0" + }, + "peerDependencies": { + "@aws-amplify/core": "^6.1.0" + } + }, + "node_modules/@aws-amplify/analytics/node_modules/@smithy/is-array-buffer": { + "version": "2.2.0", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-amplify/analytics/node_modules/@smithy/util-buffer-from": { + "version": "2.2.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/is-array-buffer": "^2.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-amplify/analytics/node_modules/@smithy/util-utf8": { + "version": "2.0.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/util-buffer-from": "^2.0.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-amplify/api": { + "version": "6.0.49", + "license": "Apache-2.0", + "dependencies": { + "@aws-amplify/api-graphql": "4.3.0", + "@aws-amplify/api-rest": "4.0.47", + "tslib": "^2.5.0" + } + }, + "node_modules/@aws-amplify/api-graphql": { + "version": "4.3.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-amplify/api-rest": "4.0.47", + "@aws-amplify/core": "6.4.0", + "@aws-amplify/data-schema": "^1.0.0", + "@aws-sdk/types": "3.387.0", + "graphql": "15.8.0", + "rxjs": "^7.8.1", + "tslib": "^2.5.0", + "uuid": "^9.0.0" + } + }, + "node_modules/@aws-amplify/api-graphql/node_modules/graphql": { + "version": "15.8.0", + "license": "MIT", + "engines": { + "node": ">= 10.x" + } + }, + "node_modules/@aws-amplify/api-rest": { + "version": "4.0.47", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.5.0" + }, + "peerDependencies": { + "@aws-amplify/core": "^6.1.0" + } + }, + "node_modules/@aws-amplify/auth": { + "version": "6.4.0", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.5.0" + }, + "peerDependencies": { + "@aws-amplify/core": "^6.1.0" + } + }, + "node_modules/@aws-amplify/core": { + "version": "6.4.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/types": "3.398.0", + "@smithy/util-hex-encoding": "2.0.0", + "@types/uuid": "^9.0.0", + "js-cookie": "^3.0.5", + "rxjs": "^7.8.1", + "tslib": "^2.5.0", + "uuid": "^9.0.0" + } + }, + "node_modules/@aws-amplify/core/node_modules/@aws-sdk/types": { + "version": "3.398.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^2.2.2", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-amplify/core/node_modules/@smithy/types": { + "version": "2.12.0", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-amplify/data-schema": { + "version": "1.4.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-amplify/data-schema-types": "*", + "@types/aws-lambda": "^8.10.134", + "rxjs": "^7.8.1" + } + }, + "node_modules/@aws-amplify/data-schema-types": { + "version": "1.1.1", + "license": "Apache-2.0", + "dependencies": { + "graphql": "15.8.0", + "rxjs": "^7.8.1" + } + }, + "node_modules/@aws-amplify/data-schema-types/node_modules/graphql": { + "version": "15.8.0", + "license": "MIT", + "engines": { + "node": ">= 10.x" + } + }, + "node_modules/@aws-amplify/datastore": { + "version": "5.0.49", + "license": "Apache-2.0", + "dependencies": { + "@aws-amplify/api": "6.0.49", + "buffer": "4.9.2", + "idb": "5.0.6", + "immer": "9.0.6", + "rxjs": "^7.8.1", + "ulid": "^2.3.0" + }, + "peerDependencies": { + "@aws-amplify/core": "^6.1.0" + } + }, + "node_modules/@aws-amplify/datastore/node_modules/immer": { + "version": "9.0.6", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/immer" + } + }, + "node_modules/@aws-amplify/geo": { + "version": "3.0.47", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/client-location": "3.621.0", + "@turf/boolean-clockwise": "6.5.0", + "camelcase-keys": "6.2.2", + "tslib": "^2.5.0" + }, + "peerDependencies": { + "@aws-amplify/core": "^6.1.0" + } + }, + "node_modules/@aws-amplify/notifications": { + "version": "2.0.47", + "license": "Apache-2.0", + "dependencies": { + "lodash": "^4.17.21", + "tslib": "^2.5.0" + }, + "peerDependencies": { + "@aws-amplify/core": "^6.1.0" + } + }, + "node_modules/@aws-amplify/storage": { + "version": "6.6.5", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.398.0", + "@smithy/md5-js": "2.0.7", + "buffer": "4.9.2", + "fast-xml-parser": "^4.4.1", + "tslib": "^2.5.0" + }, + "peerDependencies": { + "@aws-amplify/core": "^6.1.0" + } + }, + "node_modules/@aws-amplify/storage/node_modules/@aws-sdk/types": { + "version": "3.398.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^2.2.2", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-amplify/storage/node_modules/@smithy/types": { + "version": "2.12.0", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-amplify/ui": { + "version": "6.2.0", + "license": "Apache-2.0", + "dependencies": { + "csstype": "^3.1.1", + "lodash": "4.17.21", + "tslib": "^2.5.2" + }, + "peerDependencies": { + "aws-amplify": "^6.3.2", + "xstate": "^4.33.6" + }, + "peerDependenciesMeta": { + "xstate": { + "optional": true + } + } + }, + "node_modules/@aws-amplify/ui-react": { + "version": "6.2.1", + "license": "Apache-2.0", + "dependencies": { + "@aws-amplify/ui": "6.2.0", + "@aws-amplify/ui-react-core": "3.0.19", + "@radix-ui/react-direction": "1.0.0", + "@radix-ui/react-dropdown-menu": "1.0.0", + "@radix-ui/react-slider": "1.0.0", + "@xstate/react": "^3.2.2", + "lodash": "4.17.21", + "qrcode": "1.5.0", + "tslib": "^2.5.2" + }, + "peerDependencies": { + "aws-amplify": "^6.3.2", + "react": "^16.14.0 || ^17.0 || ^18.0", + "react-dom": "^16.14.0 || ^17.0 || ^18.0" + }, + "peerDependenciesMeta": { + "aws-amplify": { + "optional": true + } + } + }, + "node_modules/@aws-amplify/ui-react-core": { + "version": "3.0.19", + "license": "Apache-2.0", + "dependencies": { + "@aws-amplify/ui": "6.2.0", + "@xstate/react": "^3.2.2", + "lodash": "4.17.21", + "react-hook-form": "^7.43.5", + "xstate": "^4.33.6" + }, + "peerDependencies": { + "aws-amplify": "^6.3.2", + "react": "^16.14.0 || ^17.0 || ^18.0" + } + }, + "node_modules/@aws-crypto/crc32": { + "version": "5.2.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/util": "^5.2.0", + "@aws-sdk/types": "^3.222.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-crypto/sha256-browser": { + "version": "5.2.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-js": "^5.2.0", + "@aws-crypto/supports-web-crypto": "^5.2.0", + "@aws-crypto/util": "^5.2.0", + "@aws-sdk/types": "^3.222.0", + "@aws-sdk/util-locate-window": "^3.0.0", + "@smithy/util-utf8": "^2.0.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-crypto/sha256-js": { + "version": "5.2.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/util": "^5.2.0", + "@aws-sdk/types": "^3.222.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-crypto/supports-web-crypto": { + "version": "5.2.0", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-crypto/util": { + "version": "5.2.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "^3.222.0", + "@smithy/util-utf8": "^2.0.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-sdk/client-firehose": { + "version": "3.621.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "3.621.0", + "@aws-sdk/client-sts": "3.621.0", + "@aws-sdk/core": "3.621.0", + "@aws-sdk/credential-provider-node": "3.621.0", + "@aws-sdk/middleware-host-header": "3.620.0", + "@aws-sdk/middleware-logger": "3.609.0", + "@aws-sdk/middleware-recursion-detection": "3.620.0", + "@aws-sdk/middleware-user-agent": "3.620.0", + "@aws-sdk/region-config-resolver": "3.614.0", + "@aws-sdk/types": "3.609.0", + "@aws-sdk/util-endpoints": "3.614.0", + "@aws-sdk/util-user-agent-browser": "3.609.0", + "@aws-sdk/util-user-agent-node": "3.614.0", + "@smithy/config-resolver": "^3.0.5", + "@smithy/core": "^2.3.1", + "@smithy/fetch-http-handler": "^3.2.4", + "@smithy/hash-node": "^3.0.3", + "@smithy/invalid-dependency": "^3.0.3", + "@smithy/middleware-content-length": "^3.0.5", + "@smithy/middleware-endpoint": "^3.1.0", + "@smithy/middleware-retry": "^3.0.13", + "@smithy/middleware-serde": "^3.0.3", + "@smithy/middleware-stack": "^3.0.3", + "@smithy/node-config-provider": "^3.1.4", + "@smithy/node-http-handler": "^3.1.4", + "@smithy/protocol-http": "^4.1.0", + "@smithy/smithy-client": "^3.1.11", + "@smithy/types": "^3.3.0", + "@smithy/url-parser": "^3.0.3", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.13", + "@smithy/util-defaults-mode-node": "^3.0.13", + "@smithy/util-endpoints": "^2.0.5", + "@smithy/util-middleware": "^3.0.3", + "@smithy/util-retry": "^3.0.3", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-firehose/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-firehose/node_modules/@smithy/util-utf8": { + "version": "3.0.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/util-buffer-from": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-kinesis": { + "version": "3.621.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "3.621.0", + "@aws-sdk/client-sts": "3.621.0", + "@aws-sdk/core": "3.621.0", + "@aws-sdk/credential-provider-node": "3.621.0", + "@aws-sdk/middleware-host-header": "3.620.0", + "@aws-sdk/middleware-logger": "3.609.0", + "@aws-sdk/middleware-recursion-detection": "3.620.0", + "@aws-sdk/middleware-user-agent": "3.620.0", + "@aws-sdk/region-config-resolver": "3.614.0", + "@aws-sdk/types": "3.609.0", + "@aws-sdk/util-endpoints": "3.614.0", + "@aws-sdk/util-user-agent-browser": "3.609.0", + "@aws-sdk/util-user-agent-node": "3.614.0", + "@smithy/config-resolver": "^3.0.5", + "@smithy/core": "^2.3.1", + "@smithy/eventstream-serde-browser": "^3.0.5", + "@smithy/eventstream-serde-config-resolver": "^3.0.3", + "@smithy/eventstream-serde-node": "^3.0.4", + "@smithy/fetch-http-handler": "^3.2.4", + "@smithy/hash-node": "^3.0.3", + "@smithy/invalid-dependency": "^3.0.3", + "@smithy/middleware-content-length": "^3.0.5", + "@smithy/middleware-endpoint": "^3.1.0", + "@smithy/middleware-retry": "^3.0.13", + "@smithy/middleware-serde": "^3.0.3", + "@smithy/middleware-stack": "^3.0.3", + "@smithy/node-config-provider": "^3.1.4", + "@smithy/node-http-handler": "^3.1.4", + "@smithy/protocol-http": "^4.1.0", + "@smithy/smithy-client": "^3.1.11", + "@smithy/types": "^3.3.0", + "@smithy/url-parser": "^3.0.3", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.13", + "@smithy/util-defaults-mode-node": "^3.0.13", + "@smithy/util-endpoints": "^2.0.5", + "@smithy/util-middleware": "^3.0.3", + "@smithy/util-retry": "^3.0.3", + "@smithy/util-utf8": "^3.0.0", + "@smithy/util-waiter": "^3.1.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-kinesis/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-kinesis/node_modules/@smithy/util-utf8": { + "version": "3.0.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/util-buffer-from": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-location": { + "version": "3.621.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "3.621.0", + "@aws-sdk/client-sts": "3.621.0", + "@aws-sdk/core": "3.621.0", + "@aws-sdk/credential-provider-node": "3.621.0", + "@aws-sdk/middleware-host-header": "3.620.0", + "@aws-sdk/middleware-logger": "3.609.0", + "@aws-sdk/middleware-recursion-detection": "3.620.0", + "@aws-sdk/middleware-user-agent": "3.620.0", + "@aws-sdk/region-config-resolver": "3.614.0", + "@aws-sdk/types": "3.609.0", + "@aws-sdk/util-endpoints": "3.614.0", + "@aws-sdk/util-user-agent-browser": "3.609.0", + "@aws-sdk/util-user-agent-node": "3.614.0", + "@smithy/config-resolver": "^3.0.5", + "@smithy/core": "^2.3.1", + "@smithy/fetch-http-handler": "^3.2.4", + "@smithy/hash-node": "^3.0.3", + "@smithy/invalid-dependency": "^3.0.3", + "@smithy/middleware-content-length": "^3.0.5", + "@smithy/middleware-endpoint": "^3.1.0", + "@smithy/middleware-retry": "^3.0.13", + "@smithy/middleware-serde": "^3.0.3", + "@smithy/middleware-stack": "^3.0.3", + "@smithy/node-config-provider": "^3.1.4", + "@smithy/node-http-handler": "^3.1.4", + "@smithy/protocol-http": "^4.1.0", + "@smithy/smithy-client": "^3.1.11", + "@smithy/types": "^3.3.0", + "@smithy/url-parser": "^3.0.3", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.13", + "@smithy/util-defaults-mode-node": "^3.0.13", + "@smithy/util-endpoints": "^2.0.5", + "@smithy/util-middleware": "^3.0.3", + "@smithy/util-retry": "^3.0.3", + "@smithy/util-stream": "^3.1.3", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-location/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-location/node_modules/@smithy/util-utf8": { + "version": "3.0.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/util-buffer-from": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-personalize-events": { + "version": "3.621.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "3.621.0", + "@aws-sdk/client-sts": "3.621.0", + "@aws-sdk/core": "3.621.0", + "@aws-sdk/credential-provider-node": "3.621.0", + "@aws-sdk/middleware-host-header": "3.620.0", + "@aws-sdk/middleware-logger": "3.609.0", + "@aws-sdk/middleware-recursion-detection": "3.620.0", + "@aws-sdk/middleware-user-agent": "3.620.0", + "@aws-sdk/region-config-resolver": "3.614.0", + "@aws-sdk/types": "3.609.0", + "@aws-sdk/util-endpoints": "3.614.0", + "@aws-sdk/util-user-agent-browser": "3.609.0", + "@aws-sdk/util-user-agent-node": "3.614.0", + "@smithy/config-resolver": "^3.0.5", + "@smithy/core": "^2.3.1", + "@smithy/fetch-http-handler": "^3.2.4", + "@smithy/hash-node": "^3.0.3", + "@smithy/invalid-dependency": "^3.0.3", + "@smithy/middleware-content-length": "^3.0.5", + "@smithy/middleware-endpoint": "^3.1.0", + "@smithy/middleware-retry": "^3.0.13", + "@smithy/middleware-serde": "^3.0.3", + "@smithy/middleware-stack": "^3.0.3", + "@smithy/node-config-provider": "^3.1.4", + "@smithy/node-http-handler": "^3.1.4", + "@smithy/protocol-http": "^4.1.0", + "@smithy/smithy-client": "^3.1.11", + "@smithy/types": "^3.3.0", + "@smithy/url-parser": "^3.0.3", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.13", + "@smithy/util-defaults-mode-node": "^3.0.13", + "@smithy/util-endpoints": "^2.0.5", + "@smithy/util-middleware": "^3.0.3", + "@smithy/util-retry": "^3.0.3", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-personalize-events/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-personalize-events/node_modules/@smithy/util-utf8": { + "version": "3.0.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/util-buffer-from": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-sso": { + "version": "3.621.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.621.0", + "@aws-sdk/middleware-host-header": "3.620.0", + "@aws-sdk/middleware-logger": "3.609.0", + "@aws-sdk/middleware-recursion-detection": "3.620.0", + "@aws-sdk/middleware-user-agent": "3.620.0", + "@aws-sdk/region-config-resolver": "3.614.0", + "@aws-sdk/types": "3.609.0", + "@aws-sdk/util-endpoints": "3.614.0", + "@aws-sdk/util-user-agent-browser": "3.609.0", + "@aws-sdk/util-user-agent-node": "3.614.0", + "@smithy/config-resolver": "^3.0.5", + "@smithy/core": "^2.3.1", + "@smithy/fetch-http-handler": "^3.2.4", + "@smithy/hash-node": "^3.0.3", + "@smithy/invalid-dependency": "^3.0.3", + "@smithy/middleware-content-length": "^3.0.5", + "@smithy/middleware-endpoint": "^3.1.0", + "@smithy/middleware-retry": "^3.0.13", + "@smithy/middleware-serde": "^3.0.3", + "@smithy/middleware-stack": "^3.0.3", + "@smithy/node-config-provider": "^3.1.4", + "@smithy/node-http-handler": "^3.1.4", + "@smithy/protocol-http": "^4.1.0", + "@smithy/smithy-client": "^3.1.11", + "@smithy/types": "^3.3.0", + "@smithy/url-parser": "^3.0.3", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.13", + "@smithy/util-defaults-mode-node": "^3.0.13", + "@smithy/util-endpoints": "^2.0.5", + "@smithy/util-middleware": "^3.0.3", + "@smithy/util-retry": "^3.0.3", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-sso-oidc": { + "version": "3.621.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.621.0", + "@aws-sdk/credential-provider-node": "3.621.0", + "@aws-sdk/middleware-host-header": "3.620.0", + "@aws-sdk/middleware-logger": "3.609.0", + "@aws-sdk/middleware-recursion-detection": "3.620.0", + "@aws-sdk/middleware-user-agent": "3.620.0", + "@aws-sdk/region-config-resolver": "3.614.0", + "@aws-sdk/types": "3.609.0", + "@aws-sdk/util-endpoints": "3.614.0", + "@aws-sdk/util-user-agent-browser": "3.609.0", + "@aws-sdk/util-user-agent-node": "3.614.0", + "@smithy/config-resolver": "^3.0.5", + "@smithy/core": "^2.3.1", + "@smithy/fetch-http-handler": "^3.2.4", + "@smithy/hash-node": "^3.0.3", + "@smithy/invalid-dependency": "^3.0.3", + "@smithy/middleware-content-length": "^3.0.5", + "@smithy/middleware-endpoint": "^3.1.0", + "@smithy/middleware-retry": "^3.0.13", + "@smithy/middleware-serde": "^3.0.3", + "@smithy/middleware-stack": "^3.0.3", + "@smithy/node-config-provider": "^3.1.4", + "@smithy/node-http-handler": "^3.1.4", + "@smithy/protocol-http": "^4.1.0", + "@smithy/smithy-client": "^3.1.11", + "@smithy/types": "^3.3.0", + "@smithy/url-parser": "^3.0.3", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.13", + "@smithy/util-defaults-mode-node": "^3.0.13", + "@smithy/util-endpoints": "^2.0.5", + "@smithy/util-middleware": "^3.0.3", + "@smithy/util-retry": "^3.0.3", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.621.0" + } + }, + "node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/util-utf8": { + "version": "3.0.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/util-buffer-from": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-sso/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-sso/node_modules/@smithy/util-utf8": { + "version": "3.0.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/util-buffer-from": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-sts": { + "version": "3.621.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "3.621.0", + "@aws-sdk/core": "3.621.0", + "@aws-sdk/credential-provider-node": "3.621.0", + "@aws-sdk/middleware-host-header": "3.620.0", + "@aws-sdk/middleware-logger": "3.609.0", + "@aws-sdk/middleware-recursion-detection": "3.620.0", + "@aws-sdk/middleware-user-agent": "3.620.0", + "@aws-sdk/region-config-resolver": "3.614.0", + "@aws-sdk/types": "3.609.0", + "@aws-sdk/util-endpoints": "3.614.0", + "@aws-sdk/util-user-agent-browser": "3.609.0", + "@aws-sdk/util-user-agent-node": "3.614.0", + "@smithy/config-resolver": "^3.0.5", + "@smithy/core": "^2.3.1", + "@smithy/fetch-http-handler": "^3.2.4", + "@smithy/hash-node": "^3.0.3", + "@smithy/invalid-dependency": "^3.0.3", + "@smithy/middleware-content-length": "^3.0.5", + "@smithy/middleware-endpoint": "^3.1.0", + "@smithy/middleware-retry": "^3.0.13", + "@smithy/middleware-serde": "^3.0.3", + "@smithy/middleware-stack": "^3.0.3", + "@smithy/node-config-provider": "^3.1.4", + "@smithy/node-http-handler": "^3.1.4", + "@smithy/protocol-http": "^4.1.0", + "@smithy/smithy-client": "^3.1.11", + "@smithy/types": "^3.3.0", + "@smithy/url-parser": "^3.0.3", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.13", + "@smithy/util-defaults-mode-node": "^3.0.13", + "@smithy/util-endpoints": "^2.0.5", + "@smithy/util-middleware": "^3.0.3", + "@smithy/util-retry": "^3.0.3", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-sts/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-sts/node_modules/@smithy/util-utf8": { + "version": "3.0.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/util-buffer-from": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/core": { + "version": "3.621.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/core": "^2.3.1", + "@smithy/node-config-provider": "^3.1.4", + "@smithy/protocol-http": "^4.1.0", + "@smithy/signature-v4": "^4.1.0", + "@smithy/smithy-client": "^3.1.11", + "@smithy/types": "^3.3.0", + "@smithy/util-middleware": "^3.0.3", + "fast-xml-parser": "4.4.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-env": { + "version": "3.620.1", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.609.0", + "@smithy/property-provider": "^3.1.3", + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-env/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-http": { + "version": "3.621.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.609.0", + "@smithy/fetch-http-handler": "^3.2.4", + "@smithy/node-http-handler": "^3.1.4", + "@smithy/property-provider": "^3.1.3", + "@smithy/protocol-http": "^4.1.0", + "@smithy/smithy-client": "^3.1.11", + "@smithy/types": "^3.3.0", + "@smithy/util-stream": "^3.1.3", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-http/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-ini": { + "version": "3.621.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/credential-provider-env": "3.620.1", + "@aws-sdk/credential-provider-http": "3.621.0", + "@aws-sdk/credential-provider-process": "3.620.1", + "@aws-sdk/credential-provider-sso": "3.621.0", + "@aws-sdk/credential-provider-web-identity": "3.621.0", + "@aws-sdk/types": "3.609.0", + "@smithy/credential-provider-imds": "^3.2.0", + "@smithy/property-provider": "^3.1.3", + "@smithy/shared-ini-file-loader": "^3.1.4", + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.621.0" + } + }, + "node_modules/@aws-sdk/credential-provider-ini/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-node": { + "version": "3.621.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/credential-provider-env": "3.620.1", + "@aws-sdk/credential-provider-http": "3.621.0", + "@aws-sdk/credential-provider-ini": "3.621.0", + "@aws-sdk/credential-provider-process": "3.620.1", + "@aws-sdk/credential-provider-sso": "3.621.0", + "@aws-sdk/credential-provider-web-identity": "3.621.0", + "@aws-sdk/types": "3.609.0", + "@smithy/credential-provider-imds": "^3.2.0", + "@smithy/property-provider": "^3.1.3", + "@smithy/shared-ini-file-loader": "^3.1.4", + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-node/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-process": { + "version": "3.620.1", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.609.0", + "@smithy/property-provider": "^3.1.3", + "@smithy/shared-ini-file-loader": "^3.1.4", + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-process/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-sso": { + "version": "3.621.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/client-sso": "3.621.0", + "@aws-sdk/token-providers": "3.614.0", + "@aws-sdk/types": "3.609.0", + "@smithy/property-provider": "^3.1.3", + "@smithy/shared-ini-file-loader": "^3.1.4", + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-web-identity": { + "version": "3.621.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.609.0", + "@smithy/property-provider": "^3.1.3", + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.621.0" + } + }, + "node_modules/@aws-sdk/credential-provider-web-identity/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/middleware-host-header": { + "version": "3.620.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.609.0", + "@smithy/protocol-http": "^4.1.0", + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/middleware-host-header/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/middleware-logger": { + "version": "3.609.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.609.0", + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/middleware-logger/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/middleware-recursion-detection": { + "version": "3.620.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.609.0", + "@smithy/protocol-http": "^4.1.0", + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/middleware-recursion-detection/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/middleware-user-agent": { + "version": "3.620.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.609.0", + "@aws-sdk/util-endpoints": "3.614.0", + "@smithy/protocol-http": "^4.1.0", + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/middleware-user-agent/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/region-config-resolver": { + "version": "3.614.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.609.0", + "@smithy/node-config-provider": "^3.1.4", + "@smithy/types": "^3.3.0", + "@smithy/util-config-provider": "^3.0.0", + "@smithy/util-middleware": "^3.0.3", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/region-config-resolver/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/token-providers": { + "version": "3.614.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.609.0", + "@smithy/property-provider": "^3.1.3", + "@smithy/shared-ini-file-loader": "^3.1.4", + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sso-oidc": "^3.614.0" + } + }, + "node_modules/@aws-sdk/token-providers/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/types": { + "version": "3.387.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^2.1.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/types/node_modules/@smithy/types": { + "version": "2.12.0", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/util-endpoints": { + "version": "3.614.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.609.0", + "@smithy/types": "^3.3.0", + "@smithy/util-endpoints": "^2.0.5", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/util-endpoints/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/util-locate-window": { + "version": "3.568.0", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/util-user-agent-browser": { + "version": "3.609.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.609.0", + "@smithy/types": "^3.3.0", + "bowser": "^2.11.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-sdk/util-user-agent-browser/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/util-user-agent-node": { + "version": "3.614.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.609.0", + "@smithy/node-config-provider": "^3.1.4", + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "aws-crt": ">=1.0.0" + }, + "peerDependenciesMeta": { + "aws-crt": { + "optional": true + } + } + }, + "node_modules/@aws-sdk/util-user-agent-node/node_modules/@aws-sdk/types": { + "version": "3.609.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.24.7", + "license": "MIT", + "dependencies": { + "@babel/highlight": "^7.24.7", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.25.4", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.25.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.24.7", + "@babel/generator": "^7.25.0", + "@babel/helper-compilation-targets": "^7.25.2", + "@babel/helper-module-transforms": "^7.25.2", + "@babel/helpers": "^7.25.0", + "@babel/parser": "^7.25.0", + "@babel/template": "^7.25.0", + "@babel/traverse": "^7.25.2", + "@babel/types": "^7.25.2", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/generator": { + "version": "7.25.6", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.25.6", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", + "jsesc": "^2.5.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-annotate-as-pure": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-builder-binary-assignment-operator-visitor": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.25.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.25.2", + "@babel/helper-validator-option": "^7.24.8", + "browserslist": "^4.23.1", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-create-class-features-plugin": { + "version": "7.25.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.24.7", + "@babel/helper-member-expression-to-functions": "^7.24.8", + "@babel/helper-optimise-call-expression": "^7.24.7", + "@babel/helper-replace-supers": "^7.25.0", + "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7", + "@babel/traverse": "^7.25.4", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-create-regexp-features-plugin": { + "version": "7.25.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.24.7", + "regexpu-core": "^5.3.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-define-polyfill-provider": { + "version": "0.6.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-compilation-targets": "^7.22.6", + "@babel/helper-plugin-utils": "^7.22.5", + "debug": "^4.1.1", + "lodash.debounce": "^4.0.8", + "resolve": "^1.14.2" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + } + }, + "node_modules/@babel/helper-member-expression-to-functions": { + "version": "7.24.8", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.24.8", + "@babel/types": "^7.24.8" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.24.7", + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.25.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.24.7", + "@babel/helper-simple-access": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", + "@babel/traverse": "^7.25.2" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-optimise-call-expression": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.24.8", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-remap-async-to-generator": { + "version": "7.25.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.24.7", + "@babel/helper-wrap-function": "^7.25.0", + "@babel/traverse": "^7.25.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-replace-supers": { + "version": "7.25.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-member-expression-to-functions": "^7.24.8", + "@babel/helper-optimise-call-expression": "^7.24.7", + "@babel/traverse": "^7.25.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-simple-access": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-skip-transparent-expression-wrappers": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.24.8", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.24.7", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.24.8", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-wrap-function": { + "version": "7.25.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.25.0", + "@babel/traverse": "^7.25.0", + "@babel/types": "^7.25.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.25.6", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/template": "^7.25.0", + "@babel/types": "^7.25.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.24.7", + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.24.7", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.25.6", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.25.6" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-bugfix-firefox-class-in-computed-class-key": { + "version": "7.25.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/traverse": "^7.25.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-bugfix-safari-class-field-initializer-scope": { + "version": "7.25.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.8" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { + "version": "7.25.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.8" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7", + "@babel/plugin-transform-optional-chaining": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.13.0" + } + }, + "node_modules/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": { + "version": "7.25.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/traverse": "^7.25.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-proposal-private-property-in-object": { + "version": "7.21.0-placeholder-for-preset-env.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-bigint": { + "version": "7.8.3", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-class-properties": { + "version": "7.12.13", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-class-static-block": { + "version": "7.14.5", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-dynamic-import": { + "version": "7.8.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-export-namespace-from": { + "version": "7.8.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-assertions": { + "version": "7.25.6", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.8" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-attributes": { + "version": "7.25.6", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.8" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-meta": { + "version": "7.10.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-jsx": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-private-property-in-object": { + "version": "7.14.5", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-top-level-await": { + "version": "7.14.5", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-typescript": { + "version": "7.25.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.8" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-unicode-sets-regex": { + "version": "7.18.6", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.18.6", + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-transform-arrow-functions": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-async-generator-functions": { + "version": "7.25.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/helper-remap-async-to-generator": "^7.25.0", + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/traverse": "^7.25.4" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-async-to-generator": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-remap-async-to-generator": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-block-scoped-functions": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-block-scoping": { + "version": "7.25.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.8" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-class-properties": { + "version": "7.25.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.25.4", + "@babel/helper-plugin-utils": "^7.24.8" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-class-static-block": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/plugin-syntax-class-static-block": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.12.0" + } + }, + "node_modules/@babel/plugin-transform-classes": { + "version": "7.25.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.24.7", + "@babel/helper-compilation-targets": "^7.25.2", + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/helper-replace-supers": "^7.25.0", + "@babel/traverse": "^7.25.4", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-computed-properties": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/template": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-destructuring": { + "version": "7.24.8", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.8" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-dotall-regex": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-duplicate-keys": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-duplicate-named-capturing-groups-regex": { + "version": "7.25.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.25.0", + "@babel/helper-plugin-utils": "^7.24.8" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-transform-dynamic-import": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/plugin-syntax-dynamic-import": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-exponentiation-operator": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-export-namespace-from": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/plugin-syntax-export-namespace-from": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-for-of": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-function-name": { + "version": "7.25.1", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-compilation-targets": "^7.24.8", + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/traverse": "^7.25.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-json-strings": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/plugin-syntax-json-strings": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-literals": { + "version": "7.25.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.8" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-logical-assignment-operators": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-member-expression-literals": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-amd": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-transforms": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-commonjs": { + "version": "7.24.8", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-transforms": "^7.24.8", + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/helper-simple-access": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-systemjs": { + "version": "7.25.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-transforms": "^7.25.0", + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/helper-validator-identifier": "^7.24.7", + "@babel/traverse": "^7.25.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-umd": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-transforms": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-named-capturing-groups-regex": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-transform-new-target": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-nullish-coalescing-operator": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-numeric-separator": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/plugin-syntax-numeric-separator": "^7.10.4" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-object-rest-spread": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-compilation-targets": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-transform-parameters": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-object-super": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-replace-supers": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-optional-catch-binding": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-optional-chaining": { + "version": "7.24.8", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7", + "@babel/plugin-syntax-optional-chaining": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-parameters": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-private-methods": { + "version": "7.25.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.25.4", + "@babel/helper-plugin-utils": "^7.24.8" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-private-property-in-object": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.24.7", + "@babel/helper-create-class-features-plugin": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-property-literals": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-display-name": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx": { + "version": "7.25.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.24.7", + "@babel/helper-module-imports": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/plugin-syntax-jsx": "^7.24.7", + "@babel/types": "^7.25.2" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-development": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/plugin-transform-react-jsx": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-pure-annotations": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-regenerator": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7", + "regenerator-transform": "^0.15.2" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-reserved-words": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-shorthand-properties": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-spread": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-sticky-regex": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-template-literals": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-typeof-symbol": { + "version": "7.24.8", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.8" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-typescript": { + "version": "7.25.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.24.7", + "@babel/helper-create-class-features-plugin": "^7.25.0", + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7", + "@babel/plugin-syntax-typescript": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-unicode-escapes": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-unicode-property-regex": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-unicode-regex": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-unicode-sets-regex": { + "version": "7.25.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.25.2", + "@babel/helper-plugin-utils": "^7.24.8" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/preset-env": { + "version": "7.25.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.25.4", + "@babel/helper-compilation-targets": "^7.25.2", + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/helper-validator-option": "^7.24.8", + "@babel/plugin-bugfix-firefox-class-in-computed-class-key": "^7.25.3", + "@babel/plugin-bugfix-safari-class-field-initializer-scope": "^7.25.0", + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.25.0", + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.24.7", + "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": "^7.25.0", + "@babel/plugin-proposal-private-property-in-object": "7.21.0-placeholder-for-preset-env.2", + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-class-properties": "^7.12.13", + "@babel/plugin-syntax-class-static-block": "^7.14.5", + "@babel/plugin-syntax-dynamic-import": "^7.8.3", + "@babel/plugin-syntax-export-namespace-from": "^7.8.3", + "@babel/plugin-syntax-import-assertions": "^7.24.7", + "@babel/plugin-syntax-import-attributes": "^7.24.7", + "@babel/plugin-syntax-import-meta": "^7.10.4", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.10.4", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5", + "@babel/plugin-syntax-top-level-await": "^7.14.5", + "@babel/plugin-syntax-unicode-sets-regex": "^7.18.6", + "@babel/plugin-transform-arrow-functions": "^7.24.7", + "@babel/plugin-transform-async-generator-functions": "^7.25.4", + "@babel/plugin-transform-async-to-generator": "^7.24.7", + "@babel/plugin-transform-block-scoped-functions": "^7.24.7", + "@babel/plugin-transform-block-scoping": "^7.25.0", + "@babel/plugin-transform-class-properties": "^7.25.4", + "@babel/plugin-transform-class-static-block": "^7.24.7", + "@babel/plugin-transform-classes": "^7.25.4", + "@babel/plugin-transform-computed-properties": "^7.24.7", + "@babel/plugin-transform-destructuring": "^7.24.8", + "@babel/plugin-transform-dotall-regex": "^7.24.7", + "@babel/plugin-transform-duplicate-keys": "^7.24.7", + "@babel/plugin-transform-duplicate-named-capturing-groups-regex": "^7.25.0", + "@babel/plugin-transform-dynamic-import": "^7.24.7", + "@babel/plugin-transform-exponentiation-operator": "^7.24.7", + "@babel/plugin-transform-export-namespace-from": "^7.24.7", + "@babel/plugin-transform-for-of": "^7.24.7", + "@babel/plugin-transform-function-name": "^7.25.1", + "@babel/plugin-transform-json-strings": "^7.24.7", + "@babel/plugin-transform-literals": "^7.25.2", + "@babel/plugin-transform-logical-assignment-operators": "^7.24.7", + "@babel/plugin-transform-member-expression-literals": "^7.24.7", + "@babel/plugin-transform-modules-amd": "^7.24.7", + "@babel/plugin-transform-modules-commonjs": "^7.24.8", + "@babel/plugin-transform-modules-systemjs": "^7.25.0", + "@babel/plugin-transform-modules-umd": "^7.24.7", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.24.7", + "@babel/plugin-transform-new-target": "^7.24.7", + "@babel/plugin-transform-nullish-coalescing-operator": "^7.24.7", + "@babel/plugin-transform-numeric-separator": "^7.24.7", + "@babel/plugin-transform-object-rest-spread": "^7.24.7", + "@babel/plugin-transform-object-super": "^7.24.7", + "@babel/plugin-transform-optional-catch-binding": "^7.24.7", + "@babel/plugin-transform-optional-chaining": "^7.24.8", + "@babel/plugin-transform-parameters": "^7.24.7", + "@babel/plugin-transform-private-methods": "^7.25.4", + "@babel/plugin-transform-private-property-in-object": "^7.24.7", + "@babel/plugin-transform-property-literals": "^7.24.7", + "@babel/plugin-transform-regenerator": "^7.24.7", + "@babel/plugin-transform-reserved-words": "^7.24.7", + "@babel/plugin-transform-shorthand-properties": "^7.24.7", + "@babel/plugin-transform-spread": "^7.24.7", + "@babel/plugin-transform-sticky-regex": "^7.24.7", + "@babel/plugin-transform-template-literals": "^7.24.7", + "@babel/plugin-transform-typeof-symbol": "^7.24.8", + "@babel/plugin-transform-unicode-escapes": "^7.24.7", + "@babel/plugin-transform-unicode-property-regex": "^7.24.7", + "@babel/plugin-transform-unicode-regex": "^7.24.7", + "@babel/plugin-transform-unicode-sets-regex": "^7.25.4", + "@babel/preset-modules": "0.1.6-no-external-plugins", + "babel-plugin-polyfill-corejs2": "^0.4.10", + "babel-plugin-polyfill-corejs3": "^0.10.6", + "babel-plugin-polyfill-regenerator": "^0.6.1", + "core-js-compat": "^3.37.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/preset-modules": { + "version": "0.1.6-no-external-plugins", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/types": "^7.4.4", + "esutils": "^2.0.2" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0 || ^8.0.0-0 <8.0.0" + } + }, + "node_modules/@babel/preset-react": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-validator-option": "^7.24.7", + "@babel/plugin-transform-react-display-name": "^7.24.7", + "@babel/plugin-transform-react-jsx": "^7.24.7", + "@babel/plugin-transform-react-jsx-development": "^7.24.7", + "@babel/plugin-transform-react-pure-annotations": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/preset-typescript": { + "version": "7.24.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-validator-option": "^7.24.7", + "@babel/plugin-syntax-jsx": "^7.24.7", + "@babel/plugin-transform-modules-commonjs": "^7.24.7", + "@babel/plugin-transform-typescript": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/regjsgen": { + "version": "0.8.0", + "dev": true, + "license": "MIT" + }, + "node_modules/@babel/runtime": { + "version": "7.25.6", + "license": "MIT", + "dependencies": { + "regenerator-runtime": "^0.14.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/runtime-corejs3": { + "version": "7.25.6", + "license": "MIT", + "dependencies": { + "core-js-pure": "^3.30.2", + "regenerator-runtime": "^0.14.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/template": { + "version": "7.25.0", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.24.7", + "@babel/parser": "^7.25.0", + "@babel/types": "^7.25.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.25.6", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.24.7", + "@babel/generator": "^7.25.6", + "@babel/parser": "^7.25.6", + "@babel/template": "^7.25.0", + "@babel/types": "^7.25.6", + "debug": "^4.3.1", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.25.6", + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.24.8", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/@cori-risi/cisco": { + "resolved": "cisco", + "link": true + }, + "node_modules/@cori-risi/cori.data.api": { + "resolved": "../cori.data.api", + "link": true + }, + "node_modules/@cori-risi/frontend": { + "resolved": "frontend", + "link": true + }, + "node_modules/@deck.gl/aggregation-layers": { + "version": "9.0.29", + "license": "MIT", + "dependencies": { + "@luma.gl/constants": "~9.0.27", + "@luma.gl/shadertools": "~9.0.27", + "@math.gl/web-mercator": "^4.0.0", + "d3-hexbin": "^0.2.1" + }, + "peerDependencies": { + "@deck.gl/core": "^9.0.0", + "@deck.gl/layers": "^9.0.0", + "@luma.gl/core": "~9.0.0", + "@luma.gl/engine": "~9.0.0" + } + }, + "node_modules/@deck.gl/arcgis": { + "version": "9.0.29", + "license": "MIT", + "dependencies": { + "@luma.gl/constants": "~9.0.27", + "esri-loader": "^3.7.0" + }, + "peerDependencies": { + "@arcgis/core": "^4.0.0", + "@deck.gl/core": "^9.0.0", + "@luma.gl/core": "~9.0.0", + "@luma.gl/engine": "~9.0.0" + } + }, + "node_modules/@deck.gl/carto": { + "version": "9.0.29", + "license": "MIT", + "dependencies": { + "@loaders.gl/gis": "^4.2.0", + "@loaders.gl/loader-utils": "^4.2.0", + "@loaders.gl/mvt": "^4.2.0", + "@loaders.gl/schema": "^4.2.0", + "@loaders.gl/tiles": "^4.2.0", + "@luma.gl/core": "~9.0.27", + "@luma.gl/shadertools": "~9.0.27", + "@math.gl/web-mercator": "^4.0.0", + "@types/d3-array": "^3.0.2", + "@types/d3-color": "^1.4.2", + "@types/d3-scale": "^3.0.0", + "cartocolor": "^5.0.2", + "d3-array": "^3.2.0", + "d3-color": "^3.1.0", + "d3-format": "^3.1.0", + "d3-scale": "^4.0.0", + "earcut": "^2.2.4", + "h3-js": "^4.1.0", + "moment-timezone": "^0.5.33", + "pbf": "^3.2.1", + "quadbin": "^0.2.0" + }, + "peerDependencies": { + "@deck.gl/aggregation-layers": "^9.0.0", + "@deck.gl/core": "^9.0.0", + "@deck.gl/extensions": "^9.0.0", + "@deck.gl/geo-layers": "^9.0.0", + "@deck.gl/layers": "^9.0.0", + "@loaders.gl/core": "^4.2.0" + } + }, + "node_modules/@deck.gl/carto/node_modules/@types/d3-color": { + "version": "1.4.5", + "license": "MIT" + }, + "node_modules/@deck.gl/carto/node_modules/@types/d3-scale": { + "version": "3.3.5", + "license": "MIT", + "dependencies": { + "@types/d3-time": "^2" + } + }, + "node_modules/@deck.gl/carto/node_modules/@types/d3-time": { + "version": "2.1.4", + "license": "MIT" + }, + "node_modules/@deck.gl/core": { + "version": "9.0.29", + "license": "MIT", + "dependencies": { + "@loaders.gl/core": "^4.2.0", + "@loaders.gl/images": "^4.2.0", + "@luma.gl/constants": "~9.0.27", + "@luma.gl/core": "~9.0.27", + "@luma.gl/engine": "~9.0.27", + "@luma.gl/shadertools": "~9.0.27", + "@luma.gl/webgl": "~9.0.27", + "@math.gl/core": "^4.0.0", + "@math.gl/sun": "^4.0.0", + "@math.gl/web-mercator": "^4.0.0", + "@probe.gl/env": "^4.0.9", + "@probe.gl/log": "^4.0.9", + "@probe.gl/stats": "^4.0.9", + "@types/offscreencanvas": "^2019.6.4", + "gl-matrix": "^3.0.0", + "mjolnir.js": "^2.7.0" + } + }, + "node_modules/@deck.gl/extensions": { + "version": "9.0.29", + "license": "MIT", + "dependencies": { + "@luma.gl/constants": "~9.0.27", + "@luma.gl/shadertools": "~9.0.27", + "@math.gl/core": "^4.0.0" + }, + "peerDependencies": { + "@deck.gl/core": "^9.0.0", + "@luma.gl/core": "~9.0.0", + "@luma.gl/engine": "~9.0.0" + } + }, + "node_modules/@deck.gl/geo-layers": { + "version": "9.0.29", + "license": "MIT", + "dependencies": { + "@loaders.gl/3d-tiles": "^4.2.0", + "@loaders.gl/gis": "^4.2.0", + "@loaders.gl/loader-utils": "^4.2.0", + "@loaders.gl/mvt": "^4.2.0", + "@loaders.gl/schema": "^4.2.0", + "@loaders.gl/terrain": "^4.2.0", + "@loaders.gl/tiles": "^4.2.0", + "@loaders.gl/wms": "^4.2.0", + "@luma.gl/gltf": "~9.0.27", + "@luma.gl/shadertools": "~9.0.27", + "@math.gl/core": "^4.0.0", + "@math.gl/culling": "^4.0.0", + "@math.gl/web-mercator": "^4.0.0", + "@types/geojson": "^7946.0.8", + "h3-js": "^4.1.0", + "long": "^3.2.0" + }, + "peerDependencies": { + "@deck.gl/core": "^9.0.0", + "@deck.gl/extensions": "^9.0.0", + "@deck.gl/layers": "^9.0.0", + "@deck.gl/mesh-layers": "^9.0.0", + "@loaders.gl/core": "^4.2.0", + "@luma.gl/core": "~9.0.0", + "@luma.gl/engine": "~9.0.0" + } + }, + "node_modules/@deck.gl/google-maps": { + "version": "9.0.29", + "license": "MIT", + "dependencies": { + "@luma.gl/constants": "~9.0.27", + "@math.gl/core": "^4.0.0", + "@types/google.maps": "^3.48.6" + }, + "peerDependencies": { + "@deck.gl/core": "^9.0.0", + "@luma.gl/core": "~9.0.0" + } + }, + "node_modules/@deck.gl/json": { + "version": "9.0.29", + "license": "MIT", + "dependencies": { + "expression-eval": "^5.0.0" + }, + "peerDependencies": { + "@deck.gl/core": "^9.0.0" + } + }, + "node_modules/@deck.gl/layers": { + "version": "9.0.29", + "license": "MIT", + "dependencies": { + "@loaders.gl/images": "^4.2.0", + "@loaders.gl/schema": "^4.2.0", + "@mapbox/tiny-sdf": "^2.0.5", + "@math.gl/core": "^4.0.0", + "@math.gl/polygon": "^4.0.0", + "@math.gl/web-mercator": "^4.0.0", + "earcut": "^2.2.4" + }, + "peerDependencies": { + "@deck.gl/core": "^9.0.0", + "@loaders.gl/core": "^4.2.0", + "@luma.gl/core": "~9.0.0", + "@luma.gl/engine": "~9.0.0" + } + }, + "node_modules/@deck.gl/mapbox": { + "version": "9.0.29", + "license": "MIT", + "dependencies": { + "@luma.gl/constants": "~9.0.27", + "@math.gl/web-mercator": "^4.0.0" + }, + "peerDependencies": { + "@deck.gl/core": "^9.0.0", + "@luma.gl/core": "~9.0.0" + } + }, + "node_modules/@deck.gl/mesh-layers": { + "version": "9.0.29", + "license": "MIT", + "dependencies": { + "@loaders.gl/gltf": "^4.2.0", + "@luma.gl/gltf": "~9.0.27", + "@luma.gl/shadertools": "~9.0.27" + }, + "peerDependencies": { + "@deck.gl/core": "^9.0.0", + "@luma.gl/core": "~9.0.0", + "@luma.gl/engine": "~9.0.0" + } + }, + "node_modules/@deck.gl/react": { + "version": "9.0.29", + "license": "MIT", + "peerDependencies": { + "@deck.gl/core": "^9.0.0", + "react": ">=16.3.0", + "react-dom": ">=16.3.0" + } + }, + "node_modules/@deck.gl/widgets": { + "version": "9.0.29", + "license": "MIT", + "dependencies": { + "preact": "^10.17.0" + }, + "peerDependencies": { + "@deck.gl/core": "^9.0.0" + } + }, + "node_modules/@emotion/babel-plugin": { + "version": "11.12.0", + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.16.7", + "@babel/runtime": "^7.18.3", + "@emotion/hash": "^0.9.2", + "@emotion/memoize": "^0.9.0", + "@emotion/serialize": "^1.2.0", + "babel-plugin-macros": "^3.1.0", + "convert-source-map": "^1.5.0", + "escape-string-regexp": "^4.0.0", + "find-root": "^1.1.0", + "source-map": "^0.5.7", + "stylis": "4.2.0" + } + }, + "node_modules/@emotion/babel-plugin/node_modules/convert-source-map": { + "version": "1.9.0", + "license": "MIT" + }, + "node_modules/@emotion/cache": { + "version": "11.13.1", + "license": "MIT", + "dependencies": { + "@emotion/memoize": "^0.9.0", + "@emotion/sheet": "^1.4.0", + "@emotion/utils": "^1.4.0", + "@emotion/weak-memoize": "^0.4.0", + "stylis": "4.2.0" + } + }, + "node_modules/@emotion/hash": { + "version": "0.9.2", + "license": "MIT" + }, + "node_modules/@emotion/is-prop-valid": { + "version": "1.3.0", + "license": "MIT", + "dependencies": { + "@emotion/memoize": "^0.9.0" + } + }, + "node_modules/@emotion/memoize": { + "version": "0.9.0", + "license": "MIT" + }, + "node_modules/@emotion/react": { + "version": "11.13.3", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.18.3", + "@emotion/babel-plugin": "^11.12.0", + "@emotion/cache": "^11.13.0", + "@emotion/serialize": "^1.3.1", + "@emotion/use-insertion-effect-with-fallbacks": "^1.1.0", + "@emotion/utils": "^1.4.0", + "@emotion/weak-memoize": "^0.4.0", + "hoist-non-react-statics": "^3.3.1" + }, + "peerDependencies": { + "react": ">=16.8.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@emotion/serialize": { + "version": "1.3.1", + "license": "MIT", + "dependencies": { + "@emotion/hash": "^0.9.2", + "@emotion/memoize": "^0.9.0", + "@emotion/unitless": "^0.10.0", + "@emotion/utils": "^1.4.0", + "csstype": "^3.0.2" + } + }, + "node_modules/@emotion/sheet": { + "version": "1.4.0", + "license": "MIT" + }, + "node_modules/@emotion/styled": { + "version": "11.13.0", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.18.3", + "@emotion/babel-plugin": "^11.12.0", + "@emotion/is-prop-valid": "^1.3.0", + "@emotion/serialize": "^1.3.0", + "@emotion/use-insertion-effect-with-fallbacks": "^1.1.0", + "@emotion/utils": "^1.4.0" + }, + "peerDependencies": { + "@emotion/react": "^11.0.0-rc.0", + "react": ">=16.8.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@emotion/unitless": { + "version": "0.10.0", + "license": "MIT" + }, + "node_modules/@emotion/use-insertion-effect-with-fallbacks": { + "version": "1.1.0", + "license": "MIT", + "peerDependencies": { + "react": ">=16.8.0" + } + }, + "node_modules/@emotion/utils": { + "version": "1.4.0", + "license": "MIT" + }, + "node_modules/@emotion/weak-memoize": { + "version": "0.4.0", + "license": "MIT" + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.18.20", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esri/arcgis-html-sanitizer": { + "version": "4.0.3", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "xss": "1.0.13" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@esri/calcite-colors": { + "version": "6.1.0", + "license": "SEE LICENSE IN README.md", + "peer": true + }, + "node_modules/@esri/calcite-components": { + "version": "2.12.1", + "license": "SEE LICENSE.md", + "peer": true, + "dependencies": { + "@esri/calcite-ui-icons": "3.31.0", + "@floating-ui/dom": "1.6.10", + "@stencil/core": "4.20.0", + "@types/color": "3.0.6", + "@types/sortablejs": "1.15.7", + "color": "4.2.3", + "composed-offset-position": "0.0.6", + "dayjs": "1.11.12", + "focus-trap": "7.5.4", + "interactjs": "1.10.27", + "lodash-es": "4.17.21", + "sortablejs": "1.15.1", + "timezone-groups": "0.9.1", + "type-fest": "4.18.2" + } + }, + "node_modules/@esri/calcite-components/node_modules/@floating-ui/core": { + "version": "1.6.7", + "license": "MIT", + "peer": true, + "dependencies": { + "@floating-ui/utils": "^0.2.7" + } + }, + "node_modules/@esri/calcite-components/node_modules/@floating-ui/dom": { + "version": "1.6.10", + "license": "MIT", + "peer": true, + "dependencies": { + "@floating-ui/core": "^1.6.0", + "@floating-ui/utils": "^0.2.7" + } + }, + "node_modules/@esri/calcite-components/node_modules/sortablejs": { + "version": "1.15.1", + "license": "MIT", + "peer": true + }, + "node_modules/@esri/calcite-ui-icons": { + "version": "3.31.0", + "license": "SEE LICENSE.md", + "peer": true, + "bin": { + "spriter": "bin/spriter.js" + } + }, + "node_modules/@floating-ui/core": { + "version": "0.7.3", + "license": "MIT" + }, + "node_modules/@floating-ui/dom": { + "version": "0.5.4", + "license": "MIT", + "dependencies": { + "@floating-ui/core": "^0.7.3" + } + }, + "node_modules/@floating-ui/react-dom": { + "version": "0.7.2", + "license": "MIT", + "dependencies": { + "@floating-ui/dom": "^0.5.3", + "use-isomorphic-layout-effect": "^1.1.1" + }, + "peerDependencies": { + "react": ">=16.8.0", + "react-dom": ">=16.8.0" + } + }, + "node_modules/@floating-ui/utils": { + "version": "0.2.7", + "license": "MIT", + "peer": true + }, + "node_modules/@graphql-typed-document-node/core": { + "version": "3.2.0", + "license": "MIT", + "peerDependencies": { + "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" + } + }, + "node_modules/@interactjs/types": { + "version": "1.10.27", + "license": "MIT", + "peer": true + }, + "node_modules/@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/resolve-from": { + "version": "5.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/console": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/console/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@jest/console/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@jest/console/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@jest/console/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/@jest/console/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/console/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/core": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/reporters": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-changed-files": "^29.7.0", + "jest-config": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-resolve-dependencies": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "jest-watcher": "^29.7.0", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/@jest/core/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@jest/core/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@jest/core/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@jest/core/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/@jest/core/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/core/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/environment": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/expect": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "expect": "^29.7.0", + "jest-snapshot": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/expect-utils": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "jest-get-type": "^29.6.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/fake-timers": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@sinonjs/fake-timers": "^10.0.2", + "@types/node": "*", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/globals": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/types": "^29.6.3", + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/reporters": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@bcoe/v8-coverage": "^0.2.3", + "@jest/console": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "@types/node": "*", + "chalk": "^4.0.0", + "collect-v8-coverage": "^1.0.0", + "exit": "^0.1.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-instrument": "^6.0.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.1.3", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "slash": "^3.0.0", + "string-length": "^4.0.1", + "strip-ansi": "^6.0.0", + "v8-to-istanbul": "^9.0.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/@jest/reporters/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@jest/reporters/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@jest/reporters/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@jest/reporters/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/@jest/reporters/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/reporters/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/schemas": { + "version": "29.6.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@sinclair/typebox": "^0.27.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/source-map": { + "version": "29.6.3", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.18", + "callsites": "^3.0.0", + "graceful-fs": "^4.2.9" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/test-result": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "collect-v8-coverage": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/test-sequencer": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/test-result": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/transform": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "babel-plugin-istanbul": "^6.1.1", + "chalk": "^4.0.0", + "convert-source-map": "^2.0.0", + "fast-json-stable-stringify": "^2.1.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "micromatch": "^4.0.4", + "pirates": "^4.0.4", + "slash": "^3.0.0", + "write-file-atomic": "^4.0.2" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/transform/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@jest/transform/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@jest/transform/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@jest/transform/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/@jest/transform/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/transform/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/types": { + "version": "29.6.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^17.0.8", + "chalk": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/types/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@jest/types/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@jest/types/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@jest/types/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/@jest/types/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/types/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.5", + "license": "MIT", + "dependencies": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@lit-labs/ssr-dom-shim": { + "version": "1.2.1", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/@lit/reactive-element": { + "version": "2.0.4", + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "@lit-labs/ssr-dom-shim": "^1.2.0" + } + }, + "node_modules/@loaders.gl/3d-tiles": { + "version": "4.2.3", + "license": "MIT", + "dependencies": { + "@loaders.gl/compression": "4.2.3", + "@loaders.gl/crypto": "4.2.3", + "@loaders.gl/draco": "4.2.3", + "@loaders.gl/gltf": "4.2.3", + "@loaders.gl/images": "4.2.3", + "@loaders.gl/loader-utils": "4.2.3", + "@loaders.gl/math": "4.2.3", + "@loaders.gl/tiles": "4.2.3", + "@loaders.gl/zip": "4.2.3", + "@math.gl/core": "^4.0.1", + "@math.gl/culling": "^4.0.1", + "@math.gl/geospatial": "^4.0.1", + "@probe.gl/log": "^4.0.4", + "long": "^5.2.1" + }, + "peerDependencies": { + "@loaders.gl/core": "^4.0.0" + } + }, + "node_modules/@loaders.gl/3d-tiles/node_modules/long": { + "version": "5.2.3", + "license": "Apache-2.0" + }, + "node_modules/@loaders.gl/compression": { + "version": "4.2.3", + "license": "MIT", + "dependencies": { + "@loaders.gl/loader-utils": "4.2.3", + "@loaders.gl/worker-utils": "4.2.3", + "@types/brotli": "^1.3.0", + "@types/pako": "^1.0.1", + "fflate": "0.7.4", + "lzo-wasm": "^0.0.4", + "pako": "1.0.11", + "snappyjs": "^0.6.1" + }, + "optionalDependencies": { + "brotli": "^1.3.2", + "lz4js": "^0.2.0", + "zstd-codec": "^0.1" + }, + "peerDependencies": { + "@loaders.gl/core": "^4.0.0" + } + }, + "node_modules/@loaders.gl/core": { + "version": "4.2.3", + "license": "MIT", + "dependencies": { + "@loaders.gl/loader-utils": "4.2.3", + "@loaders.gl/schema": "4.2.3", + "@loaders.gl/worker-utils": "4.2.3", + "@probe.gl/log": "^4.0.2" + } + }, + "node_modules/@loaders.gl/crypto": { + "version": "4.2.3", + "license": "MIT", + "dependencies": { + "@loaders.gl/loader-utils": "4.2.3", + "@loaders.gl/worker-utils": "4.2.3", + "@types/crypto-js": "^4.0.2" + }, + "peerDependencies": { + "@loaders.gl/core": "^4.0.0" + } + }, + "node_modules/@loaders.gl/draco": { + "version": "4.2.3", + "license": "MIT", + "dependencies": { + "@loaders.gl/loader-utils": "4.2.3", + "@loaders.gl/schema": "4.2.3", + "@loaders.gl/worker-utils": "4.2.3", + "draco3d": "1.5.7" + }, + "peerDependencies": { + "@loaders.gl/core": "^4.0.0" + } + }, + "node_modules/@loaders.gl/gis": { + "version": "4.2.3", + "license": "MIT", + "dependencies": { + "@loaders.gl/loader-utils": "4.2.3", + "@loaders.gl/schema": "4.2.3", + "@mapbox/vector-tile": "^1.3.1", + "@math.gl/polygon": "^4.0.0", + "pbf": "^3.2.1" + }, + "peerDependencies": { + "@loaders.gl/core": "^4.0.0" + } + }, + "node_modules/@loaders.gl/gltf": { + "version": "4.2.3", + "license": "MIT", + "dependencies": { + "@loaders.gl/draco": "4.2.3", + "@loaders.gl/images": "4.2.3", + "@loaders.gl/loader-utils": "4.2.3", + "@loaders.gl/schema": "4.2.3", + "@loaders.gl/textures": "4.2.3", + "@math.gl/core": "^4.0.0" + }, + "peerDependencies": { + "@loaders.gl/core": "^4.0.0" + } + }, + "node_modules/@loaders.gl/images": { + "version": "4.2.3", + "license": "MIT", + "dependencies": { + "@loaders.gl/loader-utils": "4.2.3" + }, + "peerDependencies": { + "@loaders.gl/core": "^4.0.0" + } + }, + "node_modules/@loaders.gl/loader-utils": { + "version": "4.2.3", + "license": "MIT", + "dependencies": { + "@loaders.gl/schema": "4.2.3", + "@loaders.gl/worker-utils": "4.2.3", + "@probe.gl/stats": "^4.0.2" + }, + "peerDependencies": { + "@loaders.gl/core": "^4.0.0" + } + }, + "node_modules/@loaders.gl/math": { + "version": "4.2.3", + "license": "MIT", + "dependencies": { + "@loaders.gl/images": "4.2.3", + "@loaders.gl/loader-utils": "4.2.3", + "@math.gl/core": "^4.0.0" + }, + "peerDependencies": { + "@loaders.gl/core": "^4.0.0" + } + }, + "node_modules/@loaders.gl/mvt": { + "version": "4.2.3", + "license": "MIT", + "dependencies": { + "@loaders.gl/gis": "4.2.3", + "@loaders.gl/images": "4.2.3", + "@loaders.gl/loader-utils": "4.2.3", + "@loaders.gl/schema": "4.2.3", + "@math.gl/polygon": "^4.0.0", + "pbf": "^3.2.1" + }, + "peerDependencies": { + "@loaders.gl/core": "^4.0.0" + } + }, + "node_modules/@loaders.gl/schema": { + "version": "4.2.3", + "license": "MIT", + "dependencies": { + "@types/geojson": "^7946.0.7" + }, + "peerDependencies": { + "@loaders.gl/core": "^4.0.0" + } + }, + "node_modules/@loaders.gl/terrain": { + "version": "4.2.3", + "license": "MIT", + "dependencies": { + "@loaders.gl/images": "4.2.3", + "@loaders.gl/loader-utils": "4.2.3", + "@loaders.gl/schema": "4.2.3", + "@mapbox/martini": "^0.2.0" + }, + "peerDependencies": { + "@loaders.gl/core": "^4.0.0" + } + }, + "node_modules/@loaders.gl/textures": { + "version": "4.2.3", + "license": "MIT", + "dependencies": { + "@loaders.gl/images": "4.2.3", + "@loaders.gl/loader-utils": "4.2.3", + "@loaders.gl/schema": "4.2.3", + "@loaders.gl/worker-utils": "4.2.3", + "@math.gl/types": "^4.0.1", + "ktx-parse": "^0.0.4", + "texture-compressor": "^1.0.2" + }, + "peerDependencies": { + "@loaders.gl/core": "^4.0.0" + } + }, + "node_modules/@loaders.gl/tiles": { + "version": "4.2.3", + "license": "MIT", + "dependencies": { + "@loaders.gl/loader-utils": "4.2.3", + "@loaders.gl/math": "4.2.3", + "@math.gl/core": "^4.0.0", + "@math.gl/culling": "^4.0.0", + "@math.gl/geospatial": "^4.0.0", + "@math.gl/web-mercator": "^4.0.0", + "@probe.gl/stats": "^4.0.2" + }, + "peerDependencies": { + "@loaders.gl/core": "^4.0.0" + } + }, + "node_modules/@loaders.gl/wms": { + "version": "4.2.3", + "license": "MIT", + "dependencies": { + "@loaders.gl/images": "4.2.3", + "@loaders.gl/loader-utils": "4.2.3", + "@loaders.gl/schema": "4.2.3", + "@loaders.gl/xml": "4.2.3", + "@turf/rewind": "^5.1.5", + "deep-strict-equal": "^0.2.0" + }, + "peerDependencies": { + "@loaders.gl/core": "^4.0.0" + } + }, + "node_modules/@loaders.gl/worker-utils": { + "version": "4.2.3", + "license": "MIT", + "peerDependencies": { + "@loaders.gl/core": "^4.0.0" + } + }, + "node_modules/@loaders.gl/xml": { + "version": "4.2.3", + "license": "MIT", + "dependencies": { + "@loaders.gl/loader-utils": "4.2.3", + "@loaders.gl/schema": "4.2.3", + "fast-xml-parser": "^4.2.5" + }, + "peerDependencies": { + "@loaders.gl/core": "^4.0.0" + } + }, + "node_modules/@loaders.gl/zip": { + "version": "4.2.3", + "license": "MIT", + "dependencies": { + "@loaders.gl/compression": "4.2.3", + "@loaders.gl/crypto": "4.2.3", + "@loaders.gl/loader-utils": "4.2.3", + "jszip": "^3.1.5", + "md5": "^2.3.0" + }, + "peerDependencies": { + "@loaders.gl/core": "^4.0.0" + } + }, + "node_modules/@luma.gl/constants": { + "version": "9.0.27", + "license": "MIT" + }, + "node_modules/@luma.gl/core": { + "version": "9.0.27", + "license": "MIT", + "dependencies": { + "@math.gl/types": "^4.0.0", + "@probe.gl/env": "^4.0.2", + "@probe.gl/log": "^4.0.2", + "@probe.gl/stats": "^4.0.2", + "@types/offscreencanvas": "^2019.6.4" + } + }, + "node_modules/@luma.gl/engine": { + "version": "9.0.27", + "license": "MIT", + "dependencies": { + "@luma.gl/shadertools": "9.0.27", + "@math.gl/core": "^4.0.0", + "@probe.gl/log": "^4.0.2", + "@probe.gl/stats": "^4.0.2" + }, + "peerDependencies": { + "@luma.gl/core": "^9.0.0" + } + }, + "node_modules/@luma.gl/gltf": { + "version": "9.0.27", + "license": "MIT", + "dependencies": { + "@loaders.gl/textures": "^4.2.0", + "@luma.gl/shadertools": "9.0.27", + "@math.gl/core": "^4.0.0" + }, + "peerDependencies": { + "@loaders.gl/core": "^4.2.0", + "@luma.gl/core": "^9.0.0", + "@luma.gl/engine": "^9.0.0" + } + }, + "node_modules/@luma.gl/shadertools": { + "version": "9.0.27", + "license": "MIT", + "dependencies": { + "@math.gl/core": "^4.0.0", + "@math.gl/types": "^4.0.0", + "wgsl_reflect": "^1.0.1" + }, + "peerDependencies": { + "@luma.gl/core": "^9.0.0" + } + }, + "node_modules/@luma.gl/webgl": { + "version": "9.0.27", + "license": "MIT", + "dependencies": { + "@luma.gl/constants": "9.0.27", + "@probe.gl/env": "^4.0.2" + }, + "peerDependencies": { + "@luma.gl/core": "^9.0.0" + } + }, + "node_modules/@mapbox/fusspot": { + "version": "0.4.0", + "license": "BSD 2-Clause", + "dependencies": { + "is-plain-obj": "^1.1.0", + "xtend": "^4.0.1" + } + }, + "node_modules/@mapbox/geojson-rewind": { + "version": "0.5.2", + "license": "ISC", + "dependencies": { + "get-stream": "^6.0.1", + "minimist": "^1.2.6" + }, + "bin": { + "geojson-rewind": "geojson-rewind" + } + }, + "node_modules/@mapbox/geojson-rewind/node_modules/get-stream": { + "version": "6.0.1", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@mapbox/jsonlint-lines-primitives": { + "version": "2.0.2", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/@mapbox/mapbox-gl-geocoder": { + "version": "4.7.4", + "license": "ISC", + "dependencies": { + "@mapbox/mapbox-sdk": "^0.13.2", + "lodash.debounce": "^4.0.6", + "nanoid": "^2.0.1", + "subtag": "^0.5.0", + "suggestions": "^1.6.0", + "xtend": "^4.0.1" + }, + "engines": { + "node": ">=6" + }, + "peerDependencies": { + "mapbox-gl": ">= 0.47.0 < 3.0.0" + } + }, + "node_modules/@mapbox/mapbox-gl-supported": { + "version": "2.0.1", + "license": "BSD-3-Clause" + }, + "node_modules/@mapbox/mapbox-sdk": { + "version": "0.13.7", + "license": "BSD-2-Clause", + "dependencies": { + "@mapbox/fusspot": "^0.4.0", + "@mapbox/parse-mapbox-token": "^0.2.0", + "@mapbox/polyline": "^1.0.0", + "eventemitter3": "^3.1.0", + "form-data": "^3.0.0", + "got": "^11.8.5", + "is-plain-obj": "^1.1.0", + "xtend": "^4.0.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@mapbox/martini": { + "version": "0.2.0", + "license": "ISC" + }, + "node_modules/@mapbox/parse-mapbox-token": { + "version": "0.2.0", + "license": "BSD-2-Clause", + "dependencies": { + "base-64": "^0.1.0" + } + }, + "node_modules/@mapbox/point-geometry": { + "version": "0.1.0", + "license": "ISC" + }, + "node_modules/@mapbox/polyline": { + "version": "1.2.1", + "dependencies": { + "meow": "^9.0.0" + }, + "bin": { + "polyline": "bin/polyline.bin.js" + } + }, + "node_modules/@mapbox/tile-cover": { + "version": "3.0.1", + "license": "MIT", + "dependencies": { + "tilebelt": "^1.0.1" + } + }, + "node_modules/@mapbox/tiny-sdf": { + "version": "2.0.6", + "license": "BSD-2-Clause" + }, + "node_modules/@mapbox/unitbezier": { + "version": "0.0.1", + "license": "BSD-2-Clause" + }, + "node_modules/@mapbox/vector-tile": { + "version": "1.3.1", + "license": "BSD-3-Clause", + "dependencies": { + "@mapbox/point-geometry": "~0.1.0" + } + }, + "node_modules/@mapbox/whoots-js": { + "version": "3.1.0", + "license": "ISC", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@maplibre/maplibre-gl-style-spec": { + "version": "19.3.3", + "license": "ISC", + "dependencies": { + "@mapbox/jsonlint-lines-primitives": "~2.0.2", + "@mapbox/unitbezier": "^0.0.1", + "json-stringify-pretty-compact": "^3.0.0", + "minimist": "^1.2.8", + "rw": "^1.3.3", + "sort-object": "^3.0.3" + }, + "bin": { + "gl-style-format": "dist/gl-style-format.mjs", + "gl-style-migrate": "dist/gl-style-migrate.mjs", + "gl-style-validate": "dist/gl-style-validate.mjs" + } + }, + "node_modules/@math.gl/core": { + "version": "4.0.1", + "license": "MIT", + "dependencies": { + "@math.gl/types": "4.0.1" + } + }, + "node_modules/@math.gl/culling": { + "version": "4.0.1", + "license": "MIT", + "dependencies": { + "@math.gl/core": "4.0.1" + } + }, + "node_modules/@math.gl/geospatial": { + "version": "4.0.1", + "license": "MIT", + "dependencies": { + "@math.gl/core": "4.0.1" + } + }, + "node_modules/@math.gl/polygon": { + "version": "4.0.1", + "license": "MIT", + "dependencies": { + "@math.gl/core": "4.0.1" + } + }, + "node_modules/@math.gl/sun": { + "version": "4.0.1", + "license": "MIT" + }, + "node_modules/@math.gl/types": { + "version": "4.0.1", + "license": "MIT" + }, + "node_modules/@math.gl/web-mercator": { + "version": "4.0.1", + "license": "MIT" + }, + "node_modules/@mui/core-downloads-tracker": { + "version": "5.16.7", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui-org" + } + }, + "node_modules/@mui/icons-material": { + "version": "5.16.7", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.23.9" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui-org" + }, + "peerDependencies": { + "@mui/material": "^5.0.0", + "@types/react": "^17.0.0 || ^18.0.0", + "react": "^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@mui/material": { + "version": "5.16.7", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.23.9", + "@mui/core-downloads-tracker": "^5.16.7", + "@mui/system": "^5.16.7", + "@mui/types": "^7.2.15", + "@mui/utils": "^5.16.6", + "@popperjs/core": "^2.11.8", + "@types/react-transition-group": "^4.4.10", + "clsx": "^2.1.0", + "csstype": "^3.1.3", + "prop-types": "^15.8.1", + "react-is": "^18.3.1", + "react-transition-group": "^4.4.5" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui-org" + }, + "peerDependencies": { + "@emotion/react": "^11.5.0", + "@emotion/styled": "^11.3.0", + "@types/react": "^17.0.0 || ^18.0.0", + "react": "^17.0.0 || ^18.0.0", + "react-dom": "^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@emotion/react": { + "optional": true + }, + "@emotion/styled": { + "optional": true + }, + "@types/react": { + "optional": true + } + } + }, + "node_modules/@mui/private-theming": { + "version": "5.16.6", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.23.9", + "@mui/utils": "^5.16.6", + "prop-types": "^15.8.1" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui-org" + }, + "peerDependencies": { + "@types/react": "^17.0.0 || ^18.0.0", + "react": "^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@mui/styled-engine": { + "version": "5.16.6", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.23.9", + "@emotion/cache": "^11.11.0", + "csstype": "^3.1.3", + "prop-types": "^15.8.1" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui-org" + }, + "peerDependencies": { + "@emotion/react": "^11.4.1", + "@emotion/styled": "^11.3.0", + "react": "^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@emotion/react": { + "optional": true + }, + "@emotion/styled": { + "optional": true + } + } + }, + "node_modules/@mui/system": { + "version": "5.16.7", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.23.9", + "@mui/private-theming": "^5.16.6", + "@mui/styled-engine": "^5.16.6", + "@mui/types": "^7.2.15", + "@mui/utils": "^5.16.6", + "clsx": "^2.1.0", + "csstype": "^3.1.3", + "prop-types": "^15.8.1" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui-org" + }, + "peerDependencies": { + "@emotion/react": "^11.5.0", + "@emotion/styled": "^11.3.0", + "@types/react": "^17.0.0 || ^18.0.0", + "react": "^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@emotion/react": { + "optional": true + }, + "@emotion/styled": { + "optional": true + }, + "@types/react": { + "optional": true + } + } + }, + "node_modules/@mui/types": { + "version": "7.2.16", + "license": "MIT", + "peerDependencies": { + "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@mui/utils": { + "version": "5.16.6", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.23.9", + "@mui/types": "^7.2.15", + "@types/prop-types": "^15.7.12", + "clsx": "^2.1.1", + "prop-types": "^15.8.1", + "react-is": "^18.3.1" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui-org" + }, + "peerDependencies": { + "@types/react": "^17.0.0 || ^18.0.0", + "react": "^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@open-wc/dedupe-mixin": { + "version": "1.4.0", + "license": "MIT", + "peer": true + }, + "node_modules/@polymer/polymer": { + "version": "3.5.1", + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "@webcomponents/shadycss": "^1.9.1" + } + }, + "node_modules/@popperjs/core": { + "version": "2.11.8", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/popperjs" + } + }, + "node_modules/@probe.gl/env": { + "version": "4.0.9", + "license": "MIT" + }, + "node_modules/@probe.gl/log": { + "version": "4.0.9", + "license": "MIT", + "dependencies": { + "@probe.gl/env": "4.0.9" + } + }, + "node_modules/@probe.gl/stats": { + "version": "4.0.9", + "license": "MIT" + }, + "node_modules/@radix-ui/number": { + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.13.10" + } + }, + "node_modules/@radix-ui/primitive": { + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.13.10" + } + }, + "node_modules/@radix-ui/react-arrow": { + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/react-primitive": "1.0.0" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + } + }, + "node_modules/@radix-ui/react-collection": { + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/react-compose-refs": "1.0.0", + "@radix-ui/react-context": "1.0.0", + "@radix-ui/react-primitive": "1.0.0", + "@radix-ui/react-slot": "1.0.0" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + } + }, + "node_modules/@radix-ui/react-compose-refs": { + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.13.10" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0" + } + }, + "node_modules/@radix-ui/react-context": { + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.13.10" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0" + } + }, + "node_modules/@radix-ui/react-direction": { + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.13.10" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0" + } + }, + "node_modules/@radix-ui/react-dismissable-layer": { + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/primitive": "1.0.0", + "@radix-ui/react-compose-refs": "1.0.0", + "@radix-ui/react-primitive": "1.0.0", + "@radix-ui/react-use-callback-ref": "1.0.0", + "@radix-ui/react-use-escape-keydown": "1.0.0" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + } + }, + "node_modules/@radix-ui/react-dropdown-menu": { + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/primitive": "1.0.0", + "@radix-ui/react-compose-refs": "1.0.0", + "@radix-ui/react-context": "1.0.0", + "@radix-ui/react-id": "1.0.0", + "@radix-ui/react-menu": "1.0.0", + "@radix-ui/react-primitive": "1.0.0", + "@radix-ui/react-use-controllable-state": "1.0.0" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + } + }, + "node_modules/@radix-ui/react-focus-guards": { + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.13.10" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0" + } + }, + "node_modules/@radix-ui/react-focus-scope": { + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/react-compose-refs": "1.0.0", + "@radix-ui/react-primitive": "1.0.0", + "@radix-ui/react-use-callback-ref": "1.0.0" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + } + }, + "node_modules/@radix-ui/react-id": { + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/react-use-layout-effect": "1.0.0" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0" + } + }, + "node_modules/@radix-ui/react-menu": { + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/primitive": "1.0.0", + "@radix-ui/react-collection": "1.0.0", + "@radix-ui/react-compose-refs": "1.0.0", + "@radix-ui/react-context": "1.0.0", + "@radix-ui/react-direction": "1.0.0", + "@radix-ui/react-dismissable-layer": "1.0.0", + "@radix-ui/react-focus-guards": "1.0.0", + "@radix-ui/react-focus-scope": "1.0.0", + "@radix-ui/react-id": "1.0.0", + "@radix-ui/react-popper": "1.0.0", + "@radix-ui/react-portal": "1.0.0", + "@radix-ui/react-presence": "1.0.0", + "@radix-ui/react-primitive": "1.0.0", + "@radix-ui/react-roving-focus": "1.0.0", + "@radix-ui/react-slot": "1.0.0", + "@radix-ui/react-use-callback-ref": "1.0.0", + "aria-hidden": "^1.1.1", + "react-remove-scroll": "2.5.4" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + } + }, + "node_modules/@radix-ui/react-popper": { + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@floating-ui/react-dom": "0.7.2", + "@radix-ui/react-arrow": "1.0.0", + "@radix-ui/react-compose-refs": "1.0.0", + "@radix-ui/react-context": "1.0.0", + "@radix-ui/react-primitive": "1.0.0", + "@radix-ui/react-use-layout-effect": "1.0.0", + "@radix-ui/react-use-rect": "1.0.0", + "@radix-ui/react-use-size": "1.0.0", + "@radix-ui/rect": "1.0.0" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + } + }, + "node_modules/@radix-ui/react-portal": { + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/react-primitive": "1.0.0" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + } + }, + "node_modules/@radix-ui/react-presence": { + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/react-compose-refs": "1.0.0", + "@radix-ui/react-use-layout-effect": "1.0.0" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + } + }, + "node_modules/@radix-ui/react-primitive": { + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/react-slot": "1.0.0" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + } + }, + "node_modules/@radix-ui/react-roving-focus": { + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/primitive": "1.0.0", + "@radix-ui/react-collection": "1.0.0", + "@radix-ui/react-compose-refs": "1.0.0", + "@radix-ui/react-context": "1.0.0", + "@radix-ui/react-direction": "1.0.0", + "@radix-ui/react-id": "1.0.0", + "@radix-ui/react-primitive": "1.0.0", + "@radix-ui/react-use-callback-ref": "1.0.0", + "@radix-ui/react-use-controllable-state": "1.0.0" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + } + }, + "node_modules/@radix-ui/react-slider": { + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/number": "1.0.0", + "@radix-ui/primitive": "1.0.0", + "@radix-ui/react-collection": "1.0.0", + "@radix-ui/react-compose-refs": "1.0.0", + "@radix-ui/react-context": "1.0.0", + "@radix-ui/react-direction": "1.0.0", + "@radix-ui/react-primitive": "1.0.0", + "@radix-ui/react-use-controllable-state": "1.0.0", + "@radix-ui/react-use-layout-effect": "1.0.0", + "@radix-ui/react-use-previous": "1.0.0", + "@radix-ui/react-use-size": "1.0.0" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + } + }, + "node_modules/@radix-ui/react-slot": { + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/react-compose-refs": "1.0.0" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0" + } + }, + "node_modules/@radix-ui/react-use-callback-ref": { + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.13.10" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0" + } + }, + "node_modules/@radix-ui/react-use-controllable-state": { + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/react-use-callback-ref": "1.0.0" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0" + } + }, + "node_modules/@radix-ui/react-use-escape-keydown": { + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/react-use-callback-ref": "1.0.0" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0" + } + }, + "node_modules/@radix-ui/react-use-layout-effect": { + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.13.10" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0" + } + }, + "node_modules/@radix-ui/react-use-previous": { + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.13.10" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0" + } + }, + "node_modules/@radix-ui/react-use-rect": { + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/rect": "1.0.0" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0" + } + }, + "node_modules/@radix-ui/react-use-size": { + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/react-use-layout-effect": "1.0.0" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0" + } + }, + "node_modules/@radix-ui/rect": { + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.13.10" + } + }, + "node_modules/@react-dnd/asap": { + "version": "4.0.1", + "license": "MIT" + }, + "node_modules/@react-dnd/invariant": { + "version": "2.0.0", + "license": "MIT" + }, + "node_modules/@react-dnd/shallowequal": { + "version": "2.0.0", + "license": "MIT" + }, + "node_modules/@reduxjs/toolkit": { + "version": "2.2.7", + "license": "MIT", + "dependencies": { + "immer": "^10.0.3", + "redux": "^5.0.1", + "redux-thunk": "^3.1.0", + "reselect": "^5.1.0" + }, + "peerDependencies": { + "react": "^16.9.0 || ^17.0.0 || ^18", + "react-redux": "^7.2.1 || ^8.1.3 || ^9.0.0" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + }, + "react-redux": { + "optional": true + } + } + }, + "node_modules/@sinclair/typebox": { + "version": "0.27.8", + "dev": true, + "license": "MIT" + }, + "node_modules/@sindresorhus/is": { + "version": "4.6.0", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/is?sponsor=1" + } + }, + "node_modules/@sinonjs/commons": { + "version": "3.0.1", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "type-detect": "4.0.8" + } + }, + "node_modules/@sinonjs/fake-timers": { + "version": "10.3.0", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sinonjs/commons": "^3.0.0" + } + }, + "node_modules/@smithy/abort-controller": { + "version": "3.1.1", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/config-resolver": { + "version": "3.0.5", + "license": "Apache-2.0", + "dependencies": { + "@smithy/node-config-provider": "^3.1.4", + "@smithy/types": "^3.3.0", + "@smithy/util-config-provider": "^3.0.0", + "@smithy/util-middleware": "^3.0.3", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/core": { + "version": "2.4.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/middleware-endpoint": "^3.1.0", + "@smithy/middleware-retry": "^3.0.15", + "@smithy/middleware-serde": "^3.0.3", + "@smithy/protocol-http": "^4.1.0", + "@smithy/smithy-client": "^3.2.0", + "@smithy/types": "^3.3.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-middleware": "^3.0.3", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/core/node_modules/@smithy/util-utf8": { + "version": "3.0.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/util-buffer-from": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/credential-provider-imds": { + "version": "3.2.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/node-config-provider": "^3.1.4", + "@smithy/property-provider": "^3.1.3", + "@smithy/types": "^3.3.0", + "@smithy/url-parser": "^3.0.3", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/eventstream-codec": { + "version": "3.1.2", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/crc32": "5.2.0", + "@smithy/types": "^3.3.0", + "@smithy/util-hex-encoding": "^3.0.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@smithy/eventstream-codec/node_modules/@smithy/util-hex-encoding": { + "version": "3.0.0", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/eventstream-serde-browser": { + "version": "3.0.6", + "license": "Apache-2.0", + "dependencies": { + "@smithy/eventstream-serde-universal": "^3.0.5", + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/eventstream-serde-config-resolver": { + "version": "3.0.3", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/eventstream-serde-node": { + "version": "3.0.5", + "license": "Apache-2.0", + "dependencies": { + "@smithy/eventstream-serde-universal": "^3.0.5", + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/eventstream-serde-universal": { + "version": "3.0.5", + "license": "Apache-2.0", + "dependencies": { + "@smithy/eventstream-codec": "^3.1.2", + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/fetch-http-handler": { + "version": "3.2.4", + "license": "Apache-2.0", + "dependencies": { + "@smithy/protocol-http": "^4.1.0", + "@smithy/querystring-builder": "^3.0.3", + "@smithy/types": "^3.3.0", + "@smithy/util-base64": "^3.0.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@smithy/hash-node": { + "version": "3.0.3", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^3.3.0", + "@smithy/util-buffer-from": "^3.0.0", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/hash-node/node_modules/@smithy/util-utf8": { + "version": "3.0.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/util-buffer-from": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/invalid-dependency": { + "version": "3.0.3", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@smithy/is-array-buffer": { + "version": "3.0.0", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/md5-js": { + "version": "2.0.7", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^2.3.1", + "@smithy/util-utf8": "^2.0.0", + "tslib": "^2.5.0" + } + }, + "node_modules/@smithy/md5-js/node_modules/@smithy/types": { + "version": "2.12.0", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/middleware-content-length": { + "version": "3.0.5", + "license": "Apache-2.0", + "dependencies": { + "@smithy/protocol-http": "^4.1.0", + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/middleware-endpoint": { + "version": "3.1.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/middleware-serde": "^3.0.3", + "@smithy/node-config-provider": "^3.1.4", + "@smithy/shared-ini-file-loader": "^3.1.4", + "@smithy/types": "^3.3.0", + "@smithy/url-parser": "^3.0.3", + "@smithy/util-middleware": "^3.0.3", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/middleware-retry": { + "version": "3.0.15", + "license": "Apache-2.0", + "dependencies": { + "@smithy/node-config-provider": "^3.1.4", + "@smithy/protocol-http": "^4.1.0", + "@smithy/service-error-classification": "^3.0.3", + "@smithy/smithy-client": "^3.2.0", + "@smithy/types": "^3.3.0", + "@smithy/util-middleware": "^3.0.3", + "@smithy/util-retry": "^3.0.3", + "tslib": "^2.6.2", + "uuid": "^9.0.1" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/middleware-serde": { + "version": "3.0.3", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/middleware-stack": { + "version": "3.0.3", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/node-config-provider": { + "version": "3.1.4", + "license": "Apache-2.0", + "dependencies": { + "@smithy/property-provider": "^3.1.3", + "@smithy/shared-ini-file-loader": "^3.1.4", + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/node-http-handler": { + "version": "3.1.4", + "license": "Apache-2.0", + "dependencies": { + "@smithy/abort-controller": "^3.1.1", + "@smithy/protocol-http": "^4.1.0", + "@smithy/querystring-builder": "^3.0.3", + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/property-provider": { + "version": "3.1.3", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/protocol-http": { + "version": "4.1.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/querystring-builder": { + "version": "3.0.3", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^3.3.0", + "@smithy/util-uri-escape": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/querystring-parser": { + "version": "3.0.3", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/service-error-classification": { + "version": "3.0.3", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^3.3.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/shared-ini-file-loader": { + "version": "3.1.4", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/signature-v4": { + "version": "4.1.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/is-array-buffer": "^3.0.0", + "@smithy/protocol-http": "^4.1.0", + "@smithy/types": "^3.3.0", + "@smithy/util-hex-encoding": "^3.0.0", + "@smithy/util-middleware": "^3.0.3", + "@smithy/util-uri-escape": "^3.0.0", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/signature-v4/node_modules/@smithy/util-hex-encoding": { + "version": "3.0.0", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/signature-v4/node_modules/@smithy/util-utf8": { + "version": "3.0.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/util-buffer-from": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/smithy-client": { + "version": "3.2.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/middleware-endpoint": "^3.1.0", + "@smithy/middleware-stack": "^3.0.3", + "@smithy/protocol-http": "^4.1.0", + "@smithy/types": "^3.3.0", + "@smithy/util-stream": "^3.1.3", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/types": { + "version": "3.3.0", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/url-parser": { + "version": "3.0.3", + "license": "Apache-2.0", + "dependencies": { + "@smithy/querystring-parser": "^3.0.3", + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@smithy/util-base64": { + "version": "3.0.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/util-buffer-from": "^3.0.0", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/util-base64/node_modules/@smithy/util-utf8": { + "version": "3.0.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/util-buffer-from": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/util-body-length-browser": { + "version": "3.0.0", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + } + }, + "node_modules/@smithy/util-body-length-node": { + "version": "3.0.0", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/util-buffer-from": { + "version": "3.0.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/is-array-buffer": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/util-config-provider": { + "version": "3.0.0", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/util-defaults-mode-browser": { + "version": "3.0.15", + "license": "Apache-2.0", + "dependencies": { + "@smithy/property-provider": "^3.1.3", + "@smithy/smithy-client": "^3.2.0", + "@smithy/types": "^3.3.0", + "bowser": "^2.11.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/@smithy/util-defaults-mode-node": { + "version": "3.0.15", + "license": "Apache-2.0", + "dependencies": { + "@smithy/config-resolver": "^3.0.5", + "@smithy/credential-provider-imds": "^3.2.0", + "@smithy/node-config-provider": "^3.1.4", + "@smithy/property-provider": "^3.1.3", + "@smithy/smithy-client": "^3.2.0", + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/@smithy/util-endpoints": { + "version": "2.0.5", + "license": "Apache-2.0", + "dependencies": { + "@smithy/node-config-provider": "^3.1.4", + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/util-hex-encoding": { + "version": "2.0.0", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/util-middleware": { + "version": "3.0.3", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/util-retry": { + "version": "3.0.3", + "license": "Apache-2.0", + "dependencies": { + "@smithy/service-error-classification": "^3.0.3", + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/util-stream": { + "version": "3.1.3", + "license": "Apache-2.0", + "dependencies": { + "@smithy/fetch-http-handler": "^3.2.4", + "@smithy/node-http-handler": "^3.1.4", + "@smithy/types": "^3.3.0", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-buffer-from": "^3.0.0", + "@smithy/util-hex-encoding": "^3.0.0", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/util-stream/node_modules/@smithy/util-hex-encoding": { + "version": "3.0.0", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/util-stream/node_modules/@smithy/util-utf8": { + "version": "3.0.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/util-buffer-from": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/util-uri-escape": { + "version": "3.0.0", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/util-utf8": { + "version": "2.3.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/util-buffer-from": "^2.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/util-utf8/node_modules/@smithy/is-array-buffer": { + "version": "2.2.0", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from": { + "version": "2.2.0", + "license": "Apache-2.0", + "dependencies": { + "@smithy/is-array-buffer": "^2.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/util-waiter": { + "version": "3.1.2", + "license": "Apache-2.0", + "dependencies": { + "@smithy/abort-controller": "^3.1.1", + "@smithy/types": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@stencil/core": { + "version": "4.20.0", + "license": "MIT", + "peer": true, + "bin": { + "stencil": "bin/stencil" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.10.0" + } + }, + "node_modules/@swc/helpers": { + "version": "0.5.13", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@szmarczak/http-timer": { + "version": "4.0.6", + "license": "MIT", + "dependencies": { + "defer-to-connect": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@tootallnate/once": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10" + } + }, + "node_modules/@turf/boolean-clockwise": { + "version": "6.5.0", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@turf/clone": { + "version": "5.1.5", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^5.1.5" + } + }, + "node_modules/@turf/clone/node_modules/@turf/helpers": { + "version": "5.1.5", + "license": "MIT" + }, + "node_modules/@turf/helpers": { + "version": "6.5.0", + "license": "MIT", + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@turf/invariant": { + "version": "6.5.0", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@turf/meta": { + "version": "5.2.0", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^5.1.5" + } + }, + "node_modules/@turf/meta/node_modules/@turf/helpers": { + "version": "5.1.5", + "license": "MIT" + }, + "node_modules/@turf/rewind": { + "version": "5.1.5", + "license": "MIT", + "dependencies": { + "@turf/boolean-clockwise": "^5.1.5", + "@turf/clone": "^5.1.5", + "@turf/helpers": "^5.1.5", + "@turf/invariant": "^5.1.5", + "@turf/meta": "^5.1.5" + } + }, + "node_modules/@turf/rewind/node_modules/@turf/boolean-clockwise": { + "version": "5.1.5", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^5.1.5", + "@turf/invariant": "^5.1.5" + } + }, + "node_modules/@turf/rewind/node_modules/@turf/helpers": { + "version": "5.1.5", + "license": "MIT" + }, + "node_modules/@turf/rewind/node_modules/@turf/invariant": { + "version": "5.2.0", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^5.1.5" + } + }, + "node_modules/@types/aws-lambda": { + "version": "8.10.145", + "license": "MIT" + }, + "node_modules/@types/babel__core": { + "version": "7.20.5", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "node_modules/@types/babel__generator": { + "version": "7.6.8", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.4", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.20.6", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/types": "^7.20.7" + } + }, + "node_modules/@types/brotli": { + "version": "1.3.4", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/cacheable-request": { + "version": "6.0.3", + "license": "MIT", + "dependencies": { + "@types/http-cache-semantics": "*", + "@types/keyv": "^3.1.4", + "@types/node": "*", + "@types/responselike": "^1.0.0" + } + }, + "node_modules/@types/color": { + "version": "3.0.6", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/color-convert": "*" + } + }, + "node_modules/@types/color-convert": { + "version": "2.0.3", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/color-name": "*" + } + }, + "node_modules/@types/color-name": { + "version": "1.1.4", + "license": "MIT", + "peer": true + }, + "node_modules/@types/command-line-args": { + "version": "5.2.3", + "license": "MIT", + "peer": true + }, + "node_modules/@types/command-line-usage": { + "version": "5.0.4", + "license": "MIT", + "peer": true + }, + "node_modules/@types/crypto-js": { + "version": "4.2.2", + "license": "MIT" + }, + "node_modules/@types/d3": { + "version": "7.4.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/d3-array": "*", + "@types/d3-axis": "*", + "@types/d3-brush": "*", + "@types/d3-chord": "*", + "@types/d3-color": "*", + "@types/d3-contour": "*", + "@types/d3-delaunay": "*", + "@types/d3-dispatch": "*", + "@types/d3-drag": "*", + "@types/d3-dsv": "*", + "@types/d3-ease": "*", + "@types/d3-fetch": "*", + "@types/d3-force": "*", + "@types/d3-format": "*", + "@types/d3-geo": "*", + "@types/d3-hierarchy": "*", + "@types/d3-interpolate": "*", + "@types/d3-path": "*", + "@types/d3-polygon": "*", + "@types/d3-quadtree": "*", + "@types/d3-random": "*", + "@types/d3-scale": "*", + "@types/d3-scale-chromatic": "*", + "@types/d3-selection": "*", + "@types/d3-shape": "*", + "@types/d3-time": "*", + "@types/d3-time-format": "*", + "@types/d3-timer": "*", + "@types/d3-transition": "*", + "@types/d3-zoom": "*" + } + }, + "node_modules/@types/d3-array": { + "version": "3.2.1", + "license": "MIT" + }, + "node_modules/@types/d3-axis": { + "version": "3.0.6", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/d3-selection": "*" + } + }, + "node_modules/@types/d3-brush": { + "version": "3.0.6", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/d3-selection": "*" + } + }, + "node_modules/@types/d3-chord": { + "version": "3.0.6", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/d3-color": { + "version": "3.1.3", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/d3-contour": { + "version": "3.0.6", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/d3-array": "*", + "@types/geojson": "*" + } + }, + "node_modules/@types/d3-delaunay": { + "version": "6.0.4", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/d3-dispatch": { + "version": "3.0.6", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/d3-drag": { + "version": "3.0.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/d3-selection": "*" + } + }, + "node_modules/@types/d3-dsv": { + "version": "3.0.7", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/d3-ease": { + "version": "3.0.2", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/d3-fetch": { + "version": "3.0.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/d3-dsv": "*" + } + }, + "node_modules/@types/d3-force": { + "version": "3.0.10", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/d3-format": { + "version": "3.0.4", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/d3-geo": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/geojson": "*" + } + }, + "node_modules/@types/d3-hierarchy": { + "version": "3.1.7", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/d3-interpolate": { + "version": "3.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/d3-color": "*" + } + }, + "node_modules/@types/d3-path": { + "version": "3.1.0", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/d3-polygon": { + "version": "3.0.2", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/d3-quadtree": { + "version": "3.0.6", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/d3-random": { + "version": "3.0.3", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/d3-scale": { + "version": "4.0.8", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/d3-time": "*" + } + }, + "node_modules/@types/d3-scale-chromatic": { + "version": "3.0.3", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/d3-selection": { + "version": "3.0.10", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/d3-shape": { + "version": "3.1.6", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/d3-path": "*" + } + }, + "node_modules/@types/d3-time": { + "version": "3.0.3", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/d3-time-format": { + "version": "4.0.3", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/d3-timer": { + "version": "3.0.2", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/d3-transition": { + "version": "3.0.8", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/d3-selection": "*" + } + }, + "node_modules/@types/d3-zoom": { + "version": "3.0.8", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/d3-interpolate": "*", + "@types/d3-selection": "*" + } + }, + "node_modules/@types/debug": { + "version": "4.1.12", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/ms": "*" + } + }, + "node_modules/@types/estree": { + "version": "1.0.6", + "license": "MIT", + "peer": true + }, + "node_modules/@types/estree-jsx": { + "version": "1.0.5", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/estree": "*" + } + }, + "node_modules/@types/geojson": { + "version": "7946.0.14", + "license": "MIT" + }, + "node_modules/@types/google.maps": { + "version": "3.57.0", + "license": "MIT" + }, + "node_modules/@types/graceful-fs": { + "version": "4.1.9", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/hammerjs": { + "version": "2.0.45", + "license": "MIT" + }, + "node_modules/@types/hast": { + "version": "3.0.4", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/@types/hoist-non-react-statics": { + "version": "3.3.5", + "license": "MIT", + "dependencies": { + "@types/react": "*", + "hoist-non-react-statics": "^3.3.0" + } + }, + "node_modules/@types/http-cache-semantics": { + "version": "4.0.4", + "license": "MIT" + }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.6", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/istanbul-lib-report": { + "version": "3.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/istanbul-lib-coverage": "*" + } + }, + "node_modules/@types/istanbul-reports": { + "version": "3.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/istanbul-lib-report": "*" + } + }, + "node_modules/@types/jest": { + "version": "29.5.12", + "dev": true, + "license": "MIT", + "dependencies": { + "expect": "^29.0.0", + "pretty-format": "^29.0.0" + } + }, + "node_modules/@types/jsdom": { + "version": "20.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "@types/tough-cookie": "*", + "parse5": "^7.0.0" + } + }, + "node_modules/@types/keyv": { + "version": "3.1.4", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/mapbox__mapbox-gl-geocoder": { + "version": "4.7.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/geojson": "*", + "@types/mapbox-gl": "*" + } + }, + "node_modules/@types/mapbox-gl": { + "version": "3.4.0", + "license": "MIT", + "dependencies": { + "@types/geojson": "*" + } + }, + "node_modules/@types/mdast": { + "version": "4.0.4", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/@types/minimist": { + "version": "1.2.5", + "license": "MIT" + }, + "node_modules/@types/ms": { + "version": "0.7.34", + "license": "MIT", + "peer": true + }, + "node_modules/@types/node": { + "version": "20.16.5", + "license": "MIT", + "dependencies": { + "undici-types": "~6.19.2" + } + }, + "node_modules/@types/normalize-package-data": { + "version": "2.4.4", + "license": "MIT" + }, + "node_modules/@types/offscreencanvas": { + "version": "2019.7.3", + "license": "MIT" + }, + "node_modules/@types/pako": { + "version": "1.0.7", + "license": "MIT" + }, + "node_modules/@types/parse-json": { + "version": "4.0.2", + "license": "MIT" + }, + "node_modules/@types/parse-path": { + "version": "7.0.3", + "license": "MIT" + }, + "node_modules/@types/prop-types": { + "version": "15.7.12", + "license": "MIT" + }, + "node_modules/@types/react": { + "version": "18.3.5", + "license": "MIT", + "dependencies": { + "@types/prop-types": "*", + "csstype": "^3.0.2" + } + }, + "node_modules/@types/react-dom": { + "version": "18.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/react": "*" + } + }, + "node_modules/@types/react-transition-group": { + "version": "4.4.11", + "license": "MIT", + "dependencies": { + "@types/react": "*" + } + }, + "node_modules/@types/responselike": { + "version": "1.0.3", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/sortablejs": { + "version": "1.15.7", + "license": "MIT", + "peer": true + }, + "node_modules/@types/stack-utils": { + "version": "2.0.3", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/tough-cookie": { + "version": "4.0.5", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/trusted-types": { + "version": "2.0.7", + "license": "MIT", + "peer": true + }, + "node_modules/@types/unist": { + "version": "3.0.3", + "license": "MIT", + "peer": true + }, + "node_modules/@types/uuid": { + "version": "9.0.8", + "license": "MIT" + }, + "node_modules/@types/yargs": { + "version": "17.0.33", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/@types/yargs-parser": { + "version": "21.0.3", + "dev": true, + "license": "MIT" + }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "license": "ISC", + "peer": true + }, + "node_modules/@vaadin/a11y-base": { + "version": "24.3.21", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@open-wc/dedupe-mixin": "^1.3.0", + "@polymer/polymer": "^3.0.0", + "@vaadin/component-base": "~24.3.21", + "lit": "^3.0.0" + } + }, + "node_modules/@vaadin/checkbox": { + "version": "24.3.21", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@open-wc/dedupe-mixin": "^1.3.0", + "@polymer/polymer": "^3.0.0", + "@vaadin/a11y-base": "~24.3.21", + "@vaadin/component-base": "~24.3.21", + "@vaadin/field-base": "~24.3.21", + "@vaadin/vaadin-lumo-styles": "~24.3.21", + "@vaadin/vaadin-material-styles": "~24.3.21", + "@vaadin/vaadin-themable-mixin": "~24.3.21", + "lit": "^3.0.0" + } + }, + "node_modules/@vaadin/component-base": { + "version": "24.3.21", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@open-wc/dedupe-mixin": "^1.3.0", + "@polymer/polymer": "^3.0.0", + "@vaadin/vaadin-development-mode-detector": "^2.0.0", + "@vaadin/vaadin-usage-statistics": "^2.1.0", + "lit": "^3.0.0" + } + }, + "node_modules/@vaadin/field-base": { + "version": "24.3.21", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@open-wc/dedupe-mixin": "^1.3.0", + "@polymer/polymer": "^3.0.0", + "@vaadin/a11y-base": "~24.3.21", + "@vaadin/component-base": "~24.3.21", + "lit": "^3.0.0" + } + }, + "node_modules/@vaadin/grid": { + "version": "24.3.21", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@open-wc/dedupe-mixin": "^1.3.0", + "@polymer/polymer": "^3.0.0", + "@vaadin/a11y-base": "~24.3.21", + "@vaadin/checkbox": "~24.3.21", + "@vaadin/component-base": "~24.3.21", + "@vaadin/lit-renderer": "~24.3.21", + "@vaadin/text-field": "~24.3.21", + "@vaadin/vaadin-lumo-styles": "~24.3.21", + "@vaadin/vaadin-material-styles": "~24.3.21", + "@vaadin/vaadin-themable-mixin": "~24.3.21" + } + }, + "node_modules/@vaadin/icon": { + "version": "24.3.21", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@open-wc/dedupe-mixin": "^1.3.0", + "@polymer/polymer": "^3.0.0", + "@vaadin/component-base": "~24.3.21", + "@vaadin/vaadin-lumo-styles": "~24.3.21", + "@vaadin/vaadin-themable-mixin": "~24.3.21", + "lit": "^3.0.0" + } + }, + "node_modules/@vaadin/input-container": { + "version": "24.3.21", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@polymer/polymer": "^3.0.0", + "@vaadin/component-base": "~24.3.21", + "@vaadin/vaadin-lumo-styles": "~24.3.21", + "@vaadin/vaadin-material-styles": "~24.3.21", + "@vaadin/vaadin-themable-mixin": "~24.3.21", + "lit": "^3.0.0" + } + }, + "node_modules/@vaadin/lit-renderer": { + "version": "24.3.21", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "lit": "^3.0.0" + } + }, + "node_modules/@vaadin/text-field": { + "version": "24.3.21", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@open-wc/dedupe-mixin": "^1.3.0", + "@polymer/polymer": "^3.0.0", + "@vaadin/a11y-base": "~24.3.21", + "@vaadin/component-base": "~24.3.21", + "@vaadin/field-base": "~24.3.21", + "@vaadin/input-container": "~24.3.21", + "@vaadin/vaadin-lumo-styles": "~24.3.21", + "@vaadin/vaadin-material-styles": "~24.3.21", + "@vaadin/vaadin-themable-mixin": "~24.3.21", + "lit": "^3.0.0" + } + }, + "node_modules/@vaadin/vaadin-development-mode-detector": { + "version": "2.0.7", + "license": "Apache-2.0", + "peer": true + }, + "node_modules/@vaadin/vaadin-lumo-styles": { + "version": "24.3.21", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@polymer/polymer": "^3.0.0", + "@vaadin/component-base": "~24.3.21", + "@vaadin/icon": "~24.3.21", + "@vaadin/vaadin-themable-mixin": "~24.3.21" + } + }, + "node_modules/@vaadin/vaadin-material-styles": { + "version": "24.3.21", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@polymer/polymer": "^3.0.0", + "@vaadin/component-base": "~24.3.21", + "@vaadin/vaadin-themable-mixin": "~24.3.21" + } + }, + "node_modules/@vaadin/vaadin-themable-mixin": { + "version": "24.3.21", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@open-wc/dedupe-mixin": "^1.3.0", + "lit": "^3.0.0" + } + }, + "node_modules/@vaadin/vaadin-usage-statistics": { + "version": "2.1.3", + "hasInstallScript": true, + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@vaadin/vaadin-development-mode-detector": "^2.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, + "node_modules/@webcomponents/shadycss": { + "version": "1.11.2", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/@wry/caches": { + "version": "1.0.1", + "license": "MIT", + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@wry/context": { + "version": "0.7.4", + "license": "MIT", + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@wry/equality": { + "version": "0.5.7", + "license": "MIT", + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@wry/trie": { + "version": "0.5.0", + "license": "MIT", + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@xstate/react": { + "version": "3.2.2", + "license": "MIT", + "dependencies": { + "use-isomorphic-layout-effect": "^1.1.2", + "use-sync-external-store": "^1.0.0" + }, + "peerDependencies": { + "@xstate/fsm": "^2.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "xstate": "^4.37.2" + }, + "peerDependenciesMeta": { + "@xstate/fsm": { + "optional": true + }, + "xstate": { + "optional": true + } + } + }, + "node_modules/@zip.js/zip.js": { + "version": "2.7.52", + "license": "BSD-3-Clause", + "peer": true, + "engines": { + "bun": ">=0.7.0", + "deno": ">=1.0.0", + "node": ">=16.5.0" + } + }, + "node_modules/abab": { + "version": "2.0.6", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/acorn": { + "version": "8.12.1", + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-globals": { + "version": "7.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "acorn": "^8.1.0", + "acorn-walk": "^8.0.2" + } + }, + "node_modules/acorn-walk": { + "version": "8.3.3", + "dev": true, + "license": "MIT", + "dependencies": { + "acorn": "^8.11.0" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/agent-base": { + "version": "6.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-escapes/node_modules/type-fest": { + "version": "0.21.3", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "3.2.1", + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/apache-arrow": { + "version": "15.0.2", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@swc/helpers": "^0.5.2", + "@types/command-line-args": "^5.2.1", + "@types/command-line-usage": "^5.0.2", + "@types/node": "^20.6.0", + "command-line-args": "^5.2.1", + "command-line-usage": "^7.0.1", + "flatbuffers": "^23.5.26", + "json-bignum": "^0.0.3", + "tslib": "^2.6.2" + }, + "bin": { + "arrow2csv": "bin/arrow2csv.cjs" + } + }, + "node_modules/argparse": { + "version": "1.0.10", + "license": "MIT", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/aria-hidden": { + "version": "1.2.4", + "license": "MIT", + "dependencies": { + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/arquero": { + "version": "5.4.1", + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "acorn": "^8.12.0", + "apache-arrow": "^15.0.2", + "node-fetch": "^2.7.0" + } + }, + "node_modules/arr-union": { + "version": "3.1.0", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/array-back": { + "version": "3.1.0", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/arrify": { + "version": "1.0.1", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/assign-symbols": { + "version": "1.0.0", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/async": { + "version": "3.2.6", + "dev": true, + "license": "MIT" + }, + "node_modules/asynckit": { + "version": "0.4.0", + "license": "MIT" + }, + "node_modules/aws-amplify": { + "version": "6.6.0", + "license": "Apache-2.0", + "dependencies": { + "@aws-amplify/analytics": "7.0.47", + "@aws-amplify/api": "6.0.49", + "@aws-amplify/auth": "6.4.0", + "@aws-amplify/core": "6.4.0", + "@aws-amplify/datastore": "5.0.49", + "@aws-amplify/notifications": "2.0.47", + "@aws-amplify/storage": "6.6.5", + "tslib": "^2.5.0" + } + }, + "node_modules/axios": { + "version": "1.7.7", + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/axios/node_modules/form-data": { + "version": "4.0.0", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/babel-jest": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/transform": "^29.7.0", + "@types/babel__core": "^7.1.14", + "babel-plugin-istanbul": "^6.1.1", + "babel-preset-jest": "^29.6.3", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.8.0" + } + }, + "node_modules/babel-jest/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/babel-jest/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/babel-jest/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/babel-jest/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/babel-jest/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-jest/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-istanbul": { + "version": "6.1.1", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.0.0", + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-instrument": "^5.0.4", + "test-exclude": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument": { + "version": "5.2.1", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-jest-hoist": { + "version": "29.6.3", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/template": "^7.3.3", + "@babel/types": "^7.3.3", + "@types/babel__core": "^7.1.14", + "@types/babel__traverse": "^7.0.6" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/babel-plugin-macros": { + "version": "3.1.0", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.12.5", + "cosmiconfig": "^7.0.0", + "resolve": "^1.19.0" + }, + "engines": { + "node": ">=10", + "npm": ">=6" + } + }, + "node_modules/babel-plugin-polyfill-corejs2": { + "version": "0.4.11", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.22.6", + "@babel/helper-define-polyfill-provider": "^0.6.2", + "semver": "^6.3.1" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + } + }, + "node_modules/babel-plugin-polyfill-corejs3": { + "version": "0.10.6", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-define-polyfill-provider": "^0.6.2", + "core-js-compat": "^3.38.0" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + } + }, + "node_modules/babel-plugin-polyfill-regenerator": { + "version": "0.6.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-define-polyfill-provider": "^0.6.2" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + } + }, + "node_modules/babel-preset-current-node-syntax": { + "version": "1.1.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-bigint": "^7.8.3", + "@babel/plugin-syntax-class-properties": "^7.12.13", + "@babel/plugin-syntax-class-static-block": "^7.14.5", + "@babel/plugin-syntax-import-attributes": "^7.24.7", + "@babel/plugin-syntax-import-meta": "^7.10.4", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.10.4", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5", + "@babel/plugin-syntax-top-level-await": "^7.14.5" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/babel-preset-jest": { + "version": "29.6.3", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "babel-plugin-jest-hoist": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/bail": { + "version": "2.0.2", + "license": "MIT", + "peer": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "dev": true, + "license": "MIT" + }, + "node_modules/base-64": { + "version": "0.1.0" + }, + "node_modules/base64-js": { + "version": "1.5.1", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/bowser": { + "version": "2.11.0", + "license": "MIT" + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/brotli": { + "version": "1.3.3", + "license": "MIT", + "optional": true, + "dependencies": { + "base64-js": "^1.1.2" + } + }, + "node_modules/browserslist": { + "version": "4.23.3", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "caniuse-lite": "^1.0.30001646", + "electron-to-chromium": "^1.5.4", + "node-releases": "^2.0.18", + "update-browserslist-db": "^1.1.0" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/bs-logger": { + "version": "0.2.6", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-json-stable-stringify": "2.x" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/bser": { + "version": "2.1.1", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "node-int64": "^0.4.0" + } + }, + "node_modules/buf-compare": { + "version": "1.0.1", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/buffer": { + "version": "4.9.2", + "license": "MIT", + "dependencies": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4", + "isarray": "^1.0.0" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/bytewise": { + "version": "1.1.0", + "license": "MIT", + "dependencies": { + "bytewise-core": "^1.2.2", + "typewise": "^1.0.3" + } + }, + "node_modules/bytewise-core": { + "version": "1.2.3", + "license": "MIT", + "dependencies": { + "typewise-core": "^1.2" + } + }, + "node_modules/cacheable-lookup": { + "version": "5.0.4", + "license": "MIT", + "engines": { + "node": ">=10.6.0" + } + }, + "node_modules/cacheable-request": { + "version": "7.0.4", + "license": "MIT", + "dependencies": { + "clone-response": "^1.0.2", + "get-stream": "^5.1.0", + "http-cache-semantics": "^4.0.0", + "keyv": "^4.0.0", + "lowercase-keys": "^2.0.0", + "normalize-url": "^6.0.1", + "responselike": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase-keys": { + "version": "6.2.2", + "license": "MIT", + "dependencies": { + "camelcase": "^5.3.1", + "map-obj": "^4.0.0", + "quick-lru": "^4.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001657", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/cartocolor": { + "version": "5.0.2", + "license": "CC-BY-4.0", + "dependencies": { + "colorbrewer": "1.5.6" + } + }, + "node_modules/ccount": { + "version": "2.0.1", + "license": "MIT", + "peer": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/chalk": { + "version": "2.4.2", + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chalk-template": { + "version": "0.4.0", + "license": "MIT", + "peer": true, + "dependencies": { + "chalk": "^4.1.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/chalk-template?sponsor=1" + } + }, + "node_modules/chalk-template/node_modules/ansi-styles": { + "version": "4.3.0", + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/chalk-template/node_modules/chalk": { + "version": "4.1.2", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chalk-template/node_modules/color-convert": { + "version": "2.0.1", + "license": "MIT", + "peer": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/chalk-template/node_modules/color-name": { + "version": "1.1.4", + "license": "MIT", + "peer": true + }, + "node_modules/chalk-template/node_modules/has-flag": { + "version": "4.0.0", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/chalk-template/node_modules/supports-color": { + "version": "7.2.0", + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/chalk/node_modules/escape-string-regexp": { + "version": "1.0.5", + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/char-regex": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/character-entities": { + "version": "2.0.2", + "license": "MIT", + "peer": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-entities-html4": { + "version": "2.1.0", + "license": "MIT", + "peer": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-entities-legacy": { + "version": "3.0.0", + "license": "MIT", + "peer": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-reference-invalid": { + "version": "2.0.1", + "license": "MIT", + "peer": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/charenc": { + "version": "0.0.2", + "license": "BSD-3-Clause", + "engines": { + "node": "*" + } + }, + "node_modules/ci-info": { + "version": "3.9.0", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/cjs-module-lexer": { + "version": "1.4.0", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/cliui": { + "version": "8.0.1", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/clone-response": { + "version": "1.0.3", + "license": "MIT", + "dependencies": { + "mimic-response": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/clsx": { + "version": "2.1.1", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/co": { + "version": "4.6.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "iojs": ">= 1.0.0", + "node": ">= 0.12.0" + } + }, + "node_modules/collect-v8-coverage": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/color": { + "version": "4.2.3", + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1", + "color-string": "^1.9.0" + }, + "engines": { + "node": ">=12.5.0" + } + }, + "node_modules/color-convert": { + "version": "1.9.3", + "license": "MIT", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "license": "MIT" + }, + "node_modules/color-string": { + "version": "1.9.1", + "license": "MIT", + "peer": true, + "dependencies": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, + "node_modules/color/node_modules/color-convert": { + "version": "2.0.1", + "license": "MIT", + "peer": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color/node_modules/color-name": { + "version": "1.1.4", + "license": "MIT", + "peer": true + }, + "node_modules/colorbrewer": { + "version": "1.5.6", + "license": [ + { + "type": "Apache-Style", + "url": "https://github.com/saikocat/colorbrewer/blob/master/LICENSE.txt" + } + ] + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/comma-separated-tokens": { + "version": "2.0.3", + "license": "MIT", + "peer": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/command-line-args": { + "version": "5.2.1", + "license": "MIT", + "peer": true, + "dependencies": { + "array-back": "^3.1.0", + "find-replace": "^3.0.0", + "lodash.camelcase": "^4.3.0", + "typical": "^4.0.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/command-line-usage": { + "version": "7.0.3", + "license": "MIT", + "peer": true, + "dependencies": { + "array-back": "^6.2.2", + "chalk-template": "^0.4.0", + "table-layout": "^4.1.0", + "typical": "^7.1.1" + }, + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/command-line-usage/node_modules/array-back": { + "version": "6.2.2", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12.17" + } + }, + "node_modules/command-line-usage/node_modules/typical": { + "version": "7.2.0", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12.17" + } + }, + "node_modules/commander": { + "version": "7.2.0", + "license": "MIT", + "engines": { + "node": ">= 10" + } + }, + "node_modules/composed-offset-position": { + "version": "0.0.6", + "license": "MIT", + "peer": true, + "peerDependencies": { + "@floating-ui/utils": "^0.2.5" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "dev": true, + "license": "MIT" + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/core-assert": { + "version": "0.2.1", + "license": "MIT", + "dependencies": { + "buf-compare": "^1.0.0", + "is-error": "^2.2.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/core-js-compat": { + "version": "3.38.1", + "dev": true, + "license": "MIT", + "dependencies": { + "browserslist": "^4.23.3" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, + "node_modules/core-js-pure": { + "version": "3.38.1", + "hasInstallScript": true, + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "license": "MIT" + }, + "node_modules/cosmiconfig": { + "version": "7.1.0", + "license": "MIT", + "dependencies": { + "@types/parse-json": "^4.0.0", + "import-fresh": "^3.2.1", + "parse-json": "^5.0.0", + "path-type": "^4.0.0", + "yaml": "^1.10.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/create-jest": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "prompts": "^2.0.1" + }, + "bin": { + "create-jest": "bin/create-jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/create-jest/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/create-jest/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/create-jest/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/create-jest/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/create-jest/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/create-jest/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/crypt": { + "version": "0.0.2", + "license": "BSD-3-Clause", + "engines": { + "node": "*" + } + }, + "node_modules/csscolorparser": { + "version": "1.0.3", + "license": "MIT" + }, + "node_modules/cssfilter": { + "version": "0.0.10", + "license": "MIT", + "peer": true + }, + "node_modules/cssom": { + "version": "0.5.0", + "dev": true, + "license": "MIT" + }, + "node_modules/cssstyle": { + "version": "2.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "cssom": "~0.3.6" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cssstyle/node_modules/cssom": { + "version": "0.3.8", + "dev": true, + "license": "MIT" + }, + "node_modules/csstype": { + "version": "3.1.3", + "license": "MIT" + }, + "node_modules/d3": { + "version": "7.9.0", + "license": "ISC", + "dependencies": { + "d3-array": "3", + "d3-axis": "3", + "d3-brush": "3", + "d3-chord": "3", + "d3-color": "3", + "d3-contour": "4", + "d3-delaunay": "6", + "d3-dispatch": "3", + "d3-drag": "3", + "d3-dsv": "3", + "d3-ease": "3", + "d3-fetch": "3", + "d3-force": "3", + "d3-format": "3", + "d3-geo": "3", + "d3-hierarchy": "3", + "d3-interpolate": "3", + "d3-path": "3", + "d3-polygon": "3", + "d3-quadtree": "3", + "d3-random": "3", + "d3-scale": "4", + "d3-scale-chromatic": "3", + "d3-selection": "3", + "d3-shape": "3", + "d3-time": "3", + "d3-time-format": "4", + "d3-timer": "3", + "d3-transition": "3", + "d3-zoom": "3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-array": { + "version": "3.2.4", + "license": "ISC", + "dependencies": { + "internmap": "1 - 2" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-axis": { + "version": "3.0.0", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-brush": { + "version": "3.0.0", + "license": "ISC", + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-drag": "2 - 3", + "d3-interpolate": "1 - 3", + "d3-selection": "3", + "d3-transition": "3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-chord": { + "version": "3.0.1", + "license": "ISC", + "dependencies": { + "d3-path": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-color": { + "version": "3.1.0", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-contour": { + "version": "4.0.2", + "license": "ISC", + "dependencies": { + "d3-array": "^3.2.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-delaunay": { + "version": "6.0.4", + "license": "ISC", + "dependencies": { + "delaunator": "5" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-dispatch": { + "version": "3.0.1", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-drag": { + "version": "3.0.0", + "license": "ISC", + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-selection": "3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-dsv": { + "version": "3.0.1", + "license": "ISC", + "dependencies": { + "commander": "7", + "iconv-lite": "0.6", + "rw": "1" + }, + "bin": { + "csv2json": "bin/dsv2json.js", + "csv2tsv": "bin/dsv2dsv.js", + "dsv2dsv": "bin/dsv2dsv.js", + "dsv2json": "bin/dsv2json.js", + "json2csv": "bin/json2dsv.js", + "json2dsv": "bin/json2dsv.js", + "json2tsv": "bin/json2dsv.js", + "tsv2csv": "bin/dsv2dsv.js", + "tsv2json": "bin/dsv2json.js" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-ease": { + "version": "3.0.1", + "license": "BSD-3-Clause", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-fetch": { + "version": "3.0.1", + "license": "ISC", + "dependencies": { + "d3-dsv": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-force": { + "version": "3.0.0", + "license": "ISC", + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-quadtree": "1 - 3", + "d3-timer": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-format": { + "version": "3.1.0", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-geo": { + "version": "3.1.1", + "license": "ISC", + "dependencies": { + "d3-array": "2.5.0 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-hexbin": { + "version": "0.2.2", + "license": "BSD-3-Clause" + }, + "node_modules/d3-hierarchy": { + "version": "3.1.2", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-interpolate": { + "version": "3.0.1", + "license": "ISC", + "dependencies": { + "d3-color": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-path": { + "version": "3.1.0", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-polygon": { + "version": "3.0.1", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-quadtree": { + "version": "3.0.1", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-random": { + "version": "3.0.1", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-scale": { + "version": "4.0.2", + "license": "ISC", + "dependencies": { + "d3-array": "2.10.0 - 3", + "d3-format": "1 - 3", + "d3-interpolate": "1.2.0 - 3", + "d3-time": "2.1.1 - 3", + "d3-time-format": "2 - 4" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-scale-chromatic": { + "version": "3.1.0", + "license": "ISC", + "dependencies": { + "d3-color": "1 - 3", + "d3-interpolate": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-selection": { + "version": "3.0.0", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-shape": { + "version": "3.2.0", + "license": "ISC", + "dependencies": { + "d3-path": "^3.1.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-textwrap": { + "version": "3.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "d3-selection": "^1.0.2" + } + }, + "node_modules/d3-textwrap/node_modules/d3-selection": { + "version": "1.4.2", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/d3-time": { + "version": "3.1.0", + "license": "ISC", + "dependencies": { + "d3-array": "2 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-time-format": { + "version": "4.1.0", + "license": "ISC", + "dependencies": { + "d3-time": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-timer": { + "version": "3.0.1", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-transition": { + "version": "3.0.1", + "license": "ISC", + "dependencies": { + "d3-color": "1 - 3", + "d3-dispatch": "1 - 3", + "d3-ease": "1 - 3", + "d3-interpolate": "1 - 3", + "d3-timer": "1 - 3" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "d3-selection": "2 - 3" + } + }, + "node_modules/d3-zoom": { + "version": "3.0.0", + "license": "ISC", + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-drag": "2 - 3", + "d3-interpolate": "1 - 3", + "d3-selection": "2 - 3", + "d3-transition": "2 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/data-urls": { + "version": "3.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "abab": "^2.0.6", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^11.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/dayjs": { + "version": "1.11.12", + "license": "MIT", + "peer": true + }, + "node_modules/debug": { + "version": "4.3.6", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decamelize": { + "version": "1.2.0", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/decamelize-keys": { + "version": "1.1.1", + "license": "MIT", + "dependencies": { + "decamelize": "^1.1.0", + "map-obj": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/decamelize-keys/node_modules/map-obj": { + "version": "1.0.1", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/decimal.js": { + "version": "10.4.3", + "dev": true, + "license": "MIT" + }, + "node_modules/deck.gl": { + "version": "9.0.29", + "license": "MIT", + "dependencies": { + "@deck.gl/aggregation-layers": "9.0.29", + "@deck.gl/arcgis": "9.0.29", + "@deck.gl/carto": "9.0.29", + "@deck.gl/core": "9.0.29", + "@deck.gl/extensions": "9.0.29", + "@deck.gl/geo-layers": "9.0.29", + "@deck.gl/google-maps": "9.0.29", + "@deck.gl/json": "9.0.29", + "@deck.gl/layers": "9.0.29", + "@deck.gl/mapbox": "9.0.29", + "@deck.gl/mesh-layers": "9.0.29", + "@deck.gl/react": "9.0.29", + "@deck.gl/widgets": "9.0.29", + "@loaders.gl/core": "^4.2.0", + "@luma.gl/core": "~9.0.27", + "@luma.gl/engine": "~9.0.27" + }, + "peerDependencies": { + "@arcgis/core": "^4.0.0", + "react": ">=16.3.0", + "react-dom": ">=16.3.0" + }, + "peerDependenciesMeta": { + "@arcgis/core": { + "optional": true + }, + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } + } + }, + "node_modules/decode-named-character-reference": { + "version": "1.0.2", + "license": "MIT", + "peer": true, + "dependencies": { + "character-entities": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/decode-uri-component": { + "version": "0.4.1", + "license": "MIT", + "engines": { + "node": ">=14.16" + } + }, + "node_modules/decompress-response": { + "version": "6.0.0", + "license": "MIT", + "dependencies": { + "mimic-response": "^3.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/decompress-response/node_modules/mimic-response": { + "version": "3.1.0", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/dedent": { + "version": "1.5.3", + "dev": true, + "license": "MIT", + "peer": true, + "peerDependencies": { + "babel-plugin-macros": "^3.1.0" + }, + "peerDependenciesMeta": { + "babel-plugin-macros": { + "optional": true + } + } + }, + "node_modules/deep-strict-equal": { + "version": "0.2.0", + "license": "MIT", + "dependencies": { + "core-assert": "^0.2.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/deepmerge": { + "version": "4.3.1", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/defer-to-connect": { + "version": "2.0.1", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/delaunator": { + "version": "5.0.1", + "license": "ISC", + "dependencies": { + "robust-predicates": "^3.0.2" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/dequal": { + "version": "2.0.3", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/detect-newline": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/detect-node-es": { + "version": "1.1.0", + "license": "MIT" + }, + "node_modules/devlop": { + "version": "1.1.0", + "license": "MIT", + "peer": true, + "dependencies": { + "dequal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/diff-sequences": { + "version": "29.6.3", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/dijkstrajs": { + "version": "1.0.3", + "license": "MIT" + }, + "node_modules/dnd-core": { + "version": "11.1.3", + "license": "MIT", + "dependencies": { + "@react-dnd/asap": "^4.0.0", + "@react-dnd/invariant": "^2.0.0", + "redux": "^4.0.4" + } + }, + "node_modules/dnd-core/node_modules/redux": { + "version": "4.2.1", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.9.2" + } + }, + "node_modules/dom-helpers": { + "version": "5.2.1", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.8.7", + "csstype": "^3.0.2" + } + }, + "node_modules/domexception": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/draco3d": { + "version": "1.5.7", + "license": "Apache-2.0" + }, + "node_modules/earcut": { + "version": "2.2.4", + "license": "ISC" + }, + "node_modules/ejs": { + "version": "3.1.10", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "jake": "^10.8.5" + }, + "bin": { + "ejs": "bin/cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.5.14", + "dev": true, + "license": "ISC" + }, + "node_modules/emittery": { + "version": "0.13.1", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sindresorhus/emittery?sponsor=1" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "license": "MIT" + }, + "node_modules/encode-utf8": { + "version": "1.0.3", + "license": "MIT" + }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "license": "MIT", + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/entities": { + "version": "4.5.0", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/error-ex": { + "version": "1.3.2", + "license": "MIT", + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/esbuild": { + "version": "0.18.20", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/android-arm": "0.18.20", + "@esbuild/android-arm64": "0.18.20", + "@esbuild/android-x64": "0.18.20", + "@esbuild/darwin-arm64": "0.18.20", + "@esbuild/darwin-x64": "0.18.20", + "@esbuild/freebsd-arm64": "0.18.20", + "@esbuild/freebsd-x64": "0.18.20", + "@esbuild/linux-arm": "0.18.20", + "@esbuild/linux-arm64": "0.18.20", + "@esbuild/linux-ia32": "0.18.20", + "@esbuild/linux-loong64": "0.18.20", + "@esbuild/linux-mips64el": "0.18.20", + "@esbuild/linux-ppc64": "0.18.20", + "@esbuild/linux-riscv64": "0.18.20", + "@esbuild/linux-s390x": "0.18.20", + "@esbuild/linux-x64": "0.18.20", + "@esbuild/netbsd-x64": "0.18.20", + "@esbuild/openbsd-x64": "0.18.20", + "@esbuild/sunos-x64": "0.18.20", + "@esbuild/win32-arm64": "0.18.20", + "@esbuild/win32-ia32": "0.18.20", + "@esbuild/win32-x64": "0.18.20" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/escodegen": { + "version": "2.1.0", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=6.0" + }, + "optionalDependencies": { + "source-map": "~0.6.1" + } + }, + "node_modules/escodegen/node_modules/source-map": { + "version": "0.6.1", + "dev": true, + "license": "BSD-3-Clause", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "dev": true, + "license": "BSD-2-Clause", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/esri-loader": { + "version": "3.7.0", + "license": "Apache-2.0" + }, + "node_modules/estraverse": { + "version": "5.3.0", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estree-util-is-identifier-name": { + "version": "3.0.0", + "license": "MIT", + "peer": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eventemitter3": { + "version": "3.1.2", + "license": "MIT" + }, + "node_modules/events": { + "version": "3.3.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.x" + } + }, + "node_modules/execa": { + "version": "5.1.1", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/execa/node_modules/get-stream": { + "version": "6.0.1", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/exit": { + "version": "0.1.2", + "dev": true, + "peer": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/expect": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/expect-utils": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/expression-eval": { + "version": "5.0.1", + "license": "MIT", + "dependencies": { + "jsep": "^0.3.0" + } + }, + "node_modules/extend": { + "version": "3.0.2", + "license": "MIT", + "peer": true + }, + "node_modules/extend-shallow": { + "version": "2.0.1", + "license": "MIT", + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-xml-parser": { + "version": "4.4.1", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + }, + { + "type": "paypal", + "url": "https://paypal.me/naturalintelligence" + } + ], + "license": "MIT", + "dependencies": { + "strnum": "^1.0.5" + }, + "bin": { + "fxparser": "src/cli/cli.js" + } + }, + "node_modules/fb-watchman": { + "version": "2.0.2", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "bser": "2.1.1" + } + }, + "node_modules/fflate": { + "version": "0.7.4", + "license": "MIT" + }, + "node_modules/filelist": { + "version": "1.0.4", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "minimatch": "^5.0.1" + } + }, + "node_modules/filelist/node_modules/brace-expansion": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/filelist/node_modules/minimatch": { + "version": "5.1.6", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "dev": true, + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/filter-obj": { + "version": "5.1.0", + "license": "MIT", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/find-replace": { + "version": "3.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "array-back": "^3.0.1" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/find-root": { + "version": "1.1.0", + "license": "MIT" + }, + "node_modules/find-up": { + "version": "4.1.0", + "license": "MIT", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/flatbuffers": { + "version": "23.5.26", + "license": "SEE LICENSE IN LICENSE", + "peer": true + }, + "node_modules/focus-trap": { + "version": "7.5.4", + "license": "MIT", + "peer": true, + "dependencies": { + "tabbable": "^6.2.0" + } + }, + "node_modules/follow-redirects": { + "version": "1.15.8", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "3.0.1", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "dev": true, + "license": "ISC", + "peer": true + }, + "node_modules/fsevents": { + "version": "2.3.3", + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/fuzzy": { + "version": "0.1.3", + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/geojson-vt": { + "version": "3.2.1", + "license": "ISC" + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-nonce": { + "version": "1.0.1", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/get-package-type": { + "version": "0.1.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/get-stream": { + "version": "5.2.0", + "license": "MIT", + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-value": { + "version": "2.0.6", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gl-matrix": { + "version": "3.4.3", + "license": "MIT" + }, + "node_modules/glob": { + "version": "7.2.3", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/globals": { + "version": "11.12.0", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/got": { + "version": "11.8.6", + "license": "MIT", + "dependencies": { + "@sindresorhus/is": "^4.0.0", + "@szmarczak/http-timer": "^4.0.5", + "@types/cacheable-request": "^6.0.1", + "@types/responselike": "^1.0.0", + "cacheable-lookup": "^5.0.3", + "cacheable-request": "^7.0.2", + "decompress-response": "^6.0.0", + "http2-wrapper": "^1.0.0-beta.5.2", + "lowercase-keys": "^2.0.0", + "p-cancelable": "^2.0.0", + "responselike": "^2.0.0" + }, + "engines": { + "node": ">=10.19.0" + }, + "funding": { + "url": "https://github.com/sindresorhus/got?sponsor=1" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "dev": true, + "license": "ISC" + }, + "node_modules/graphql": { + "version": "16.9.0", + "license": "MIT", + "peer": true, + "engines": { + "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0" + } + }, + "node_modules/graphql-tag": { + "version": "2.12.6", + "license": "MIT", + "dependencies": { + "tslib": "^2.1.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "graphql": "^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0" + } + }, + "node_modules/grid-index": { + "version": "1.1.0", + "license": "ISC" + }, + "node_modules/h3-js": { + "version": "4.1.0", + "license": "Apache-2.0", + "engines": { + "node": ">=4", + "npm": ">=3", + "yarn": ">=1.3.0" + } + }, + "node_modules/hammerjs": { + "version": "2.0.8", + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/hard-rejection": { + "version": "2.1.0", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/harmony-reflect": { + "version": "1.6.2", + "dev": true, + "license": "(Apache-2.0 OR MPL-1.1)" + }, + "node_modules/has-flag": { + "version": "3.0.0", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hast-util-to-jsx-runtime": { + "version": "2.3.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/estree": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "comma-separated-tokens": "^2.0.0", + "devlop": "^1.0.0", + "estree-util-is-identifier-name": "^3.0.0", + "hast-util-whitespace": "^3.0.0", + "mdast-util-mdx-expression": "^2.0.0", + "mdast-util-mdx-jsx": "^3.0.0", + "mdast-util-mdxjs-esm": "^2.0.0", + "property-information": "^6.0.0", + "space-separated-tokens": "^2.0.0", + "style-to-object": "^1.0.0", + "unist-util-position": "^5.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-whitespace": { + "version": "3.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/hast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hoist-non-react-statics": { + "version": "3.3.2", + "license": "BSD-3-Clause", + "dependencies": { + "react-is": "^16.7.0" + } + }, + "node_modules/hoist-non-react-statics/node_modules/react-is": { + "version": "16.13.1", + "license": "MIT" + }, + "node_modules/hosted-git-info": { + "version": "4.1.0", + "license": "ISC", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/hosted-git-info/node_modules/lru-cache": { + "version": "6.0.0", + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/hosted-git-info/node_modules/yallist": { + "version": "4.0.0", + "license": "ISC" + }, + "node_modules/html-encoding-sniffer": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "whatwg-encoding": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/html-to-image": { + "version": "1.11.11", + "license": "MIT", + "peer": true + }, + "node_modules/html-url-attributes": { + "version": "3.0.0", + "license": "MIT", + "peer": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/http-cache-semantics": { + "version": "4.1.1", + "license": "BSD-2-Clause" + }, + "node_modules/http-proxy-agent": { + "version": "5.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@tootallnate/once": "2", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/http2-wrapper": { + "version": "1.0.3", + "license": "MIT", + "dependencies": { + "quick-lru": "^5.1.1", + "resolve-alpn": "^1.0.0" + }, + "engines": { + "node": ">=10.19.0" + } + }, + "node_modules/http2-wrapper/node_modules/quick-lru": { + "version": "5.1.1", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/https-proxy-agent": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/human-signals": { + "version": "2.1.0", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "engines": { + "node": ">=10.17.0" + } + }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/idb": { + "version": "5.0.6", + "license": "ISC" + }, + "node_modules/identity-obj-proxy": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "harmony-reflect": "^1.4.6" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/image-size": { + "version": "0.7.5", + "license": "MIT", + "bin": { + "image-size": "bin/image-size.js" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/immediate": { + "version": "3.0.6", + "license": "MIT" + }, + "node_modules/immer": { + "version": "10.1.1", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/immer" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-local": { + "version": "3.2.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + }, + "bin": { + "import-local-fixture": "fixtures/cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "license": "ISC" + }, + "node_modules/inline-style-parser": { + "version": "0.2.4", + "license": "MIT", + "peer": true + }, + "node_modules/interactjs": { + "version": "1.10.27", + "license": "MIT", + "peer": true, + "dependencies": { + "@interactjs/types": "1.10.27" + } + }, + "node_modules/internmap": { + "version": "2.0.3", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/invariant": { + "version": "2.2.4", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.0.0" + } + }, + "node_modules/is-alphabetical": { + "version": "2.0.1", + "license": "MIT", + "peer": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-alphanumerical": { + "version": "2.0.1", + "license": "MIT", + "peer": true, + "dependencies": { + "is-alphabetical": "^2.0.0", + "is-decimal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "license": "MIT" + }, + "node_modules/is-buffer": { + "version": "1.1.6", + "license": "MIT" + }, + "node_modules/is-core-module": { + "version": "2.15.1", + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-decimal": { + "version": "2.0.1", + "license": "MIT", + "peer": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-error": { + "version": "2.2.2", + "license": "MIT" + }, + "node_modules/is-extendable": { + "version": "0.1.1", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-generator-fn": { + "version": "2.1.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/is-hexadecimal": { + "version": "2.0.1", + "license": "MIT", + "peer": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-plain-obj": { + "version": "1.1.0", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-plain-object": { + "version": "2.0.4", + "license": "MIT", + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-potential-custom-element-name": { + "version": "1.0.1", + "dev": true, + "license": "MIT" + }, + "node_modules/is-stream": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isarray": { + "version": "1.0.0", + "license": "MIT" + }, + "node_modules/isexe": { + "version": "2.0.0", + "dev": true, + "license": "ISC", + "peer": true + }, + "node_modules/isobject": { + "version": "3.0.1", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.2", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-instrument": { + "version": "6.0.3", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "@babel/core": "^7.23.9", + "@babel/parser": "^7.23.9", + "@istanbuljs/schema": "^0.1.3", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-instrument/node_modules/semver": { + "version": "7.6.3", + "dev": true, + "license": "ISC", + "peer": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-report/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-report/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-source-maps": { + "version": "4.0.1", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-source-maps/node_modules/source-map": { + "version": "0.6.1", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/istanbul-reports": { + "version": "3.1.7", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jake": { + "version": "10.9.2", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "async": "^3.2.3", + "chalk": "^4.0.2", + "filelist": "^1.0.4", + "minimatch": "^3.1.2" + }, + "bin": { + "jake": "bin/cli.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/jake/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jake/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jake/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jake/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/jake/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/jake/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/core": "^29.7.0", + "@jest/types": "^29.6.3", + "import-local": "^3.0.2", + "jest-cli": "^29.7.0" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/jest-changed-files": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "execa": "^5.0.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-circus": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "co": "^4.6.0", + "dedent": "^1.0.0", + "is-generator-fn": "^2.0.0", + "jest-each": "^29.7.0", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0", + "pretty-format": "^29.7.0", + "pure-rand": "^6.0.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-circus/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-circus/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-circus/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-circus/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/jest-circus/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-circus/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-cli": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/core": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "create-jest": "^29.7.0", + "exit": "^0.1.2", + "import-local": "^3.0.2", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "yargs": "^17.3.1" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/jest-cli/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-cli/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-cli/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-cli/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/jest-cli/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-cli/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-config": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/test-sequencer": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-jest": "^29.7.0", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "deepmerge": "^4.2.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-circus": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "micromatch": "^4.0.4", + "parse-json": "^5.2.0", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@types/node": "*", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "ts-node": { + "optional": true + } + } + }, + "node_modules/jest-config/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-config/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-config/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-config/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/jest-config/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-config/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-diff": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "diff-sequences": "^29.6.3", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-diff/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-diff/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-diff/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-diff/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/jest-diff/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-diff/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-docblock": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "detect-newline": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-each": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "jest-util": "^29.7.0", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-each/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-each/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-each/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-each/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/jest-each/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-each/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-environment-jsdom": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/jsdom": "^20.0.0", + "@types/node": "*", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0", + "jsdom": "^20.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "canvas": "^2.5.0" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } + } + }, + "node_modules/jest-environment-node": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-get-type": { + "version": "29.6.3", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-haste-map": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/types": "^29.6.3", + "@types/graceful-fs": "^4.1.3", + "@types/node": "*", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "graceful-fs": "^4.2.9", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "micromatch": "^4.0.4", + "walker": "^1.0.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "optionalDependencies": { + "fsevents": "^2.3.2" + } + }, + "node_modules/jest-leak-detector": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-matcher-utils": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-matcher-utils/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-matcher-utils/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-matcher-utils/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-matcher-utils/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/jest-matcher-utils/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-matcher-utils/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-message-util": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@jest/types": "^29.6.3", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-message-util/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-message-util/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-message-util/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-message-util/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/jest-message-util/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-message-util/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-mock": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-pnp-resolver": { + "version": "1.2.3", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + }, + "peerDependencies": { + "jest-resolve": "*" + }, + "peerDependenciesMeta": { + "jest-resolve": { + "optional": true + } + } + }, + "node_modules/jest-regex-util": { + "version": "29.6.3", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-resolve": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-pnp-resolver": "^1.2.2", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "resolve": "^1.20.0", + "resolve.exports": "^2.0.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-resolve-dependencies": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "jest-regex-util": "^29.6.3", + "jest-snapshot": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-resolve/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-resolve/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-resolve/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-resolve/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/jest-resolve/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-resolve/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-runner": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/environment": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "graceful-fs": "^4.2.9", + "jest-docblock": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-leak-detector": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-resolve": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-util": "^29.7.0", + "jest-watcher": "^29.7.0", + "jest-worker": "^29.7.0", + "p-limit": "^3.1.0", + "source-map-support": "0.5.13" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-runner/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-runner/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-runner/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-runner/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/jest-runner/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-runner/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-runtime": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/globals": "^29.7.0", + "@jest/source-map": "^29.6.3", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "cjs-module-lexer": "^1.0.0", + "collect-v8-coverage": "^1.0.0", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "slash": "^3.0.0", + "strip-bom": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-runtime/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-runtime/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-runtime/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-runtime/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/jest-runtime/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-runtime/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-snapshot": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/core": "^7.11.6", + "@babel/generator": "^7.7.2", + "@babel/plugin-syntax-jsx": "^7.7.2", + "@babel/plugin-syntax-typescript": "^7.7.2", + "@babel/types": "^7.3.3", + "@jest/expect-utils": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0", + "chalk": "^4.0.0", + "expect": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "natural-compare": "^1.4.0", + "pretty-format": "^29.7.0", + "semver": "^7.5.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-snapshot/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-snapshot/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-snapshot/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-snapshot/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/jest-snapshot/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-snapshot/node_modules/semver": { + "version": "7.6.3", + "dev": true, + "license": "ISC", + "peer": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/jest-snapshot/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-util": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-util/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-util/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-util/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-util/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/jest-util/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-util/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-validate": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/types": "^29.6.3", + "camelcase": "^6.2.0", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "leven": "^3.1.0", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-validate/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-validate/node_modules/camelcase": { + "version": "6.3.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-validate/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-validate/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-validate/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/jest-validate/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-validate/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-watcher": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "jest-util": "^29.7.0", + "string-length": "^4.0.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-watcher/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-watcher/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-watcher/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-watcher/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/jest-watcher/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-watcher/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-worker": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/node": "*", + "jest-util": "^29.7.0", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-worker/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-worker/node_modules/supports-color": { + "version": "8.1.1", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/js-cookie": { + "version": "3.0.5", + "license": "MIT", + "engines": { + "node": ">=14" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "license": "MIT" + }, + "node_modules/js-yaml": { + "version": "3.14.1", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsdom": { + "version": "20.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "abab": "^2.0.6", + "acorn": "^8.8.1", + "acorn-globals": "^7.0.0", + "cssom": "^0.5.0", + "cssstyle": "^2.3.0", + "data-urls": "^3.0.2", + "decimal.js": "^10.4.2", + "domexception": "^4.0.0", + "escodegen": "^2.0.0", + "form-data": "^4.0.0", + "html-encoding-sniffer": "^3.0.0", + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.1", + "is-potential-custom-element-name": "^1.0.1", + "nwsapi": "^2.2.2", + "parse5": "^7.1.1", + "saxes": "^6.0.0", + "symbol-tree": "^3.2.4", + "tough-cookie": "^4.1.2", + "w3c-xmlserializer": "^4.0.0", + "webidl-conversions": "^7.0.0", + "whatwg-encoding": "^2.0.0", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^11.0.0", + "ws": "^8.11.0", + "xml-name-validator": "^4.0.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "canvas": "^2.5.0" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } + } + }, + "node_modules/jsdom/node_modules/form-data": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/jsep": { + "version": "0.3.5", + "license": "MIT", + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/jsesc": { + "version": "2.5.2", + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/json-bignum": { + "version": "0.0.3", + "peer": true, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "license": "MIT" + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "license": "MIT" + }, + "node_modules/json-stringify-pretty-compact": { + "version": "3.0.0", + "license": "MIT" + }, + "node_modules/json5": { + "version": "2.2.3", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jszip": { + "version": "3.10.1", + "license": "(MIT OR GPL-3.0-or-later)", + "dependencies": { + "lie": "~3.3.0", + "pako": "~1.0.2", + "readable-stream": "~2.3.6", + "setimmediate": "^1.0.5" + } + }, + "node_modules/kdbush": { + "version": "4.0.2", + "license": "ISC" + }, + "node_modules/keyv": { + "version": "4.5.4", + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/kind-of": { + "version": "6.0.3", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/kleur": { + "version": "3.0.3", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/ktx-parse": { + "version": "0.0.4", + "license": "MIT" + }, + "node_modules/leven": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/lie": { + "version": "3.3.0", + "license": "MIT", + "dependencies": { + "immediate": "~3.0.5" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "license": "MIT" + }, + "node_modules/lit": { + "version": "3.2.0", + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "@lit/reactive-element": "^2.0.4", + "lit-element": "^4.1.0", + "lit-html": "^3.2.0" + } + }, + "node_modules/lit-element": { + "version": "4.1.0", + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "@lit-labs/ssr-dom-shim": "^1.2.0", + "@lit/reactive-element": "^2.0.4", + "lit-html": "^3.2.0" + } + }, + "node_modules/lit-html": { + "version": "3.2.0", + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "@types/trusted-types": "^2.0.2" + } + }, + "node_modules/locate-path": { + "version": "5.0.0", + "license": "MIT", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "license": "MIT" + }, + "node_modules/lodash-es": { + "version": "4.17.21", + "license": "MIT", + "peer": true + }, + "node_modules/lodash.assignwith": { + "version": "4.2.0", + "license": "MIT" + }, + "node_modules/lodash.camelcase": { + "version": "4.3.0", + "license": "MIT", + "peer": true + }, + "node_modules/lodash.clonedeep": { + "version": "4.5.0", + "license": "MIT" + }, + "node_modules/lodash.debounce": { + "version": "4.0.8", + "license": "MIT" + }, + "node_modules/lodash.find": { + "version": "4.6.0", + "license": "MIT" + }, + "node_modules/lodash.get": { + "version": "4.4.2", + "license": "MIT" + }, + "node_modules/lodash.isequal": { + "version": "4.5.0", + "license": "MIT" + }, + "node_modules/lodash.isundefined": { + "version": "3.0.1", + "license": "MIT" + }, + "node_modules/lodash.memoize": { + "version": "4.1.2", + "license": "MIT" + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "license": "MIT" + }, + "node_modules/lodash.throttle": { + "version": "4.1.1", + "license": "MIT" + }, + "node_modules/long": { + "version": "3.2.0", + "license": "Apache-2.0", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/longest-streak": { + "version": "3.1.0", + "license": "MIT", + "peer": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "license": "MIT", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/lowercase-keys": { + "version": "2.0.0", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/luxon": { + "version": "3.4.4", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/lz4js": { + "version": "0.2.0", + "license": "ISC", + "optional": true + }, + "node_modules/lzo-wasm": { + "version": "0.0.4", + "license": "BSD-2-Clause" + }, + "node_modules/make-dir": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "7.6.3", + "dev": true, + "license": "ISC", + "peer": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/make-error": { + "version": "1.3.6", + "dev": true, + "license": "ISC" + }, + "node_modules/makeerror": { + "version": "1.0.12", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "tmpl": "1.0.5" + } + }, + "node_modules/map-obj": { + "version": "4.3.0", + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mapbox-gl": { + "version": "2.15.0", + "license": "SEE LICENSE IN LICENSE.txt", + "dependencies": { + "@mapbox/geojson-rewind": "^0.5.2", + "@mapbox/jsonlint-lines-primitives": "^2.0.2", + "@mapbox/mapbox-gl-supported": "^2.0.1", + "@mapbox/point-geometry": "^0.1.0", + "@mapbox/tiny-sdf": "^2.0.6", + "@mapbox/unitbezier": "^0.0.1", + "@mapbox/vector-tile": "^1.3.1", + "@mapbox/whoots-js": "^3.1.0", + "csscolorparser": "~1.0.3", + "earcut": "^2.2.4", + "geojson-vt": "^3.2.1", + "gl-matrix": "^3.4.3", + "grid-index": "^1.1.0", + "kdbush": "^4.0.1", + "murmurhash-js": "^1.0.0", + "pbf": "^3.2.1", + "potpack": "^2.0.0", + "quickselect": "^2.0.0", + "rw": "^1.3.3", + "supercluster": "^8.0.0", + "tinyqueue": "^2.0.3", + "vt-pbf": "^3.1.3" + } + }, + "node_modules/marked": { + "version": "12.0.2", + "license": "MIT", + "peer": true, + "bin": { + "marked": "bin/marked.js" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/md5": { + "version": "2.3.0", + "license": "BSD-3-Clause", + "dependencies": { + "charenc": "0.0.2", + "crypt": "0.0.2", + "is-buffer": "~1.1.6" + } + }, + "node_modules/mdast-util-from-markdown": { + "version": "2.0.1", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark": "^4.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-decode-string": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx-expression": { + "version": "2.0.1", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx-jsx": { + "version": "3.1.3", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "ccount": "^2.0.0", + "devlop": "^1.1.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0", + "parse-entities": "^4.0.0", + "stringify-entities": "^4.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdxjs-esm": { + "version": "2.0.1", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-phrasing": { + "version": "4.1.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/mdast": "^4.0.0", + "unist-util-is": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-hast": { + "version": "13.2.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "@ungap/structured-clone": "^1.0.0", + "devlop": "^1.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "trim-lines": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-markdown": { + "version": "2.1.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "longest-streak": "^3.0.0", + "mdast-util-phrasing": "^4.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark-util-decode-string": "^2.0.0", + "unist-util-visit": "^5.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-string": { + "version": "4.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/mdast": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/meow": { + "version": "9.0.0", + "license": "MIT", + "dependencies": { + "@types/minimist": "^1.2.0", + "camelcase-keys": "^6.2.2", + "decamelize": "^1.2.0", + "decamelize-keys": "^1.1.0", + "hard-rejection": "^2.1.0", + "minimist-options": "4.1.0", + "normalize-package-data": "^3.0.0", + "read-pkg-up": "^7.0.1", + "redent": "^3.0.0", + "trim-newlines": "^3.0.0", + "type-fest": "^0.18.0", + "yargs-parser": "^20.2.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/meow/node_modules/type-fest": { + "version": "0.18.1", + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/micromark": { + "version": "4.0.0", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "@types/debug": "^4.0.0", + "debug": "^4.0.0", + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "micromark-core-commonmark": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-combine-extensions": "^2.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-encode": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "micromark-util-subtokenize": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-core-commonmark": { + "version": "2.0.1", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "micromark-factory-destination": "^2.0.0", + "micromark-factory-label": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-factory-title": "^2.0.0", + "micromark-factory-whitespace": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-classify-character": "^2.0.0", + "micromark-util-html-tag-name": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-subtokenize": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-destination": { + "version": "2.0.0", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-label": { + "version": "2.0.0", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "devlop": "^1.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-space": { + "version": "2.0.0", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-title": { + "version": "2.0.0", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-whitespace": { + "version": "2.0.0", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-character": { + "version": "2.1.0", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-chunked": { + "version": "2.0.0", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-classify-character": { + "version": "2.0.0", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-combine-extensions": { + "version": "2.0.0", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "micromark-util-chunked": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-decode-numeric-character-reference": { + "version": "2.0.1", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-decode-string": { + "version": "2.0.0", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "decode-named-character-reference": "^1.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-encode": { + "version": "2.0.0", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true + }, + "node_modules/micromark-util-html-tag-name": { + "version": "2.0.0", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true + }, + "node_modules/micromark-util-normalize-identifier": { + "version": "2.0.0", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-resolve-all": { + "version": "2.0.0", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-sanitize-uri": { + "version": "2.0.0", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-encode": "^2.0.0", + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-subtokenize": { + "version": "2.0.1", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "devlop": "^1.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-symbol": { + "version": "2.0.0", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true + }, + "node_modules/micromark-util-types": { + "version": "2.0.0", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true + }, + "node_modules/micromatch": { + "version": "4.0.8", + "dev": true, + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/mimic-response": { + "version": "1.0.1", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/min-indent": { + "version": "1.0.1", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/minimist-options": { + "version": "4.1.0", + "license": "MIT", + "dependencies": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0", + "kind-of": "^6.0.3" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/mjolnir.js": { + "version": "2.7.3", + "license": "MIT", + "dependencies": { + "@types/hammerjs": "^2.0.41", + "hammerjs": "^2.0.8" + }, + "engines": { + "node": ">= 4", + "npm": ">= 3" + } + }, + "node_modules/moment": { + "version": "2.30.1", + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/moment-timezone": { + "version": "0.5.45", + "license": "MIT", + "dependencies": { + "moment": "^2.29.4" + }, + "engines": { + "node": "*" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "license": "MIT" + }, + "node_modules/mui": { + "version": "0.0.1", + "license": "MIT" + }, + "node_modules/mui-datatables": { + "version": "4.3.0", + "license": "MIT", + "dependencies": { + "@babel/runtime-corejs3": "^7.12.1", + "@emotion/cache": "^11.7.1", + "clsx": "^1.1.1", + "lodash.assignwith": "^4.2.0", + "lodash.clonedeep": "^4.5.0", + "lodash.debounce": "^4.0.8", + "lodash.find": "^4.6.0", + "lodash.get": "^4.4.2", + "lodash.isequal": "^4.5.0", + "lodash.isundefined": "^3.0.1", + "lodash.memoize": "^4.1.2", + "lodash.merge": "^4.6.2", + "prop-types": "^15.7.2", + "react-dnd": "^11.1.3", + "react-dnd-html5-backend": "^11.1.3", + "react-sortable-tree-patch-react-17": "^2.9.0", + "react-to-print": "^2.8.0", + "tss-react": "^3.6.0" + }, + "peerDependencies": { + "@emotion/react": "^11.10.5", + "@mui/icons-material": "^5.11.0", + "@mui/material": "^5.11.0", + "react": "^16.8.0 || ^17.0.2 || ^18.2.0", + "react-dom": "^16.8.0 || ^17.0.2 || ^18.2.0" + } + }, + "node_modules/mui-datatables/node_modules/clsx": { + "version": "1.2.1", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/murmurhash-js": { + "version": "1.0.0", + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "2.1.11", + "license": "MIT" + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/node-fetch": { + "version": "2.7.0", + "license": "MIT", + "peer": true, + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-fetch/node_modules/tr46": { + "version": "0.0.3", + "license": "MIT", + "peer": true + }, + "node_modules/node-fetch/node_modules/webidl-conversions": { + "version": "3.0.1", + "license": "BSD-2-Clause", + "peer": true + }, + "node_modules/node-fetch/node_modules/whatwg-url": { + "version": "5.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/node-int64": { + "version": "0.4.0", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/node-releases": { + "version": "2.0.18", + "dev": true, + "license": "MIT" + }, + "node_modules/normalize-package-data": { + "version": "3.0.3", + "license": "BSD-2-Clause", + "dependencies": { + "hosted-git-info": "^4.0.1", + "is-core-module": "^2.5.0", + "semver": "^7.3.4", + "validate-npm-package-license": "^3.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/normalize-package-data/node_modules/semver": { + "version": "7.6.3", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/normalize-url": { + "version": "6.1.0", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/normalize.css": { + "version": "8.0.1", + "license": "MIT" + }, + "node_modules/npm-run-path": { + "version": "4.0.1", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/nwsapi": { + "version": "2.2.12", + "dev": true, + "license": "MIT" + }, + "node_modules/object-assign": { + "version": "4.1.1", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/once": { + "version": "1.4.0", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onetime": { + "version": "5.1.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/optimism": { + "version": "0.18.0", + "license": "MIT", + "dependencies": { + "@wry/caches": "^1.0.0", + "@wry/context": "^0.7.0", + "@wry/trie": "^0.4.3", + "tslib": "^2.3.0" + } + }, + "node_modules/optimism/node_modules/@wry/trie": { + "version": "0.4.3", + "license": "MIT", + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-cancelable": { + "version": "2.1.1", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "4.1.0", + "license": "MIT", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-locate/node_modules/p-limit": { + "version": "2.3.0", + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/pako": { + "version": "1.0.11", + "license": "(MIT AND Zlib)" + }, + "node_modules/parent-module": { + "version": "1.0.1", + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-entities": { + "version": "4.0.1", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/unist": "^2.0.0", + "character-entities": "^2.0.0", + "character-entities-legacy": "^3.0.0", + "character-reference-invalid": "^2.0.0", + "decode-named-character-reference": "^1.0.0", + "is-alphanumerical": "^2.0.0", + "is-decimal": "^2.0.0", + "is-hexadecimal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/parse-entities/node_modules/@types/unist": { + "version": "2.0.11", + "license": "MIT", + "peer": true + }, + "node_modules/parse-json": { + "version": "5.2.0", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parse-path": { + "version": "7.0.0", + "license": "MIT", + "dependencies": { + "protocols": "^2.0.0" + } + }, + "node_modules/parse-url": { + "version": "9.2.0", + "license": "MIT", + "dependencies": { + "@types/parse-path": "^7.0.0", + "parse-path": "^7.0.0" + }, + "engines": { + "node": ">=14.13.0" + } + }, + "node_modules/parse5": { + "version": "7.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "entities": "^4.4.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "license": "MIT" + }, + "node_modules/path-type": { + "version": "4.0.0", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/pbf": { + "version": "3.3.0", + "license": "BSD-3-Clause", + "dependencies": { + "ieee754": "^1.1.12", + "resolve-protobuf-schema": "^2.1.0" + }, + "bin": { + "pbf": "bin/pbf" + } + }, + "node_modules/performance-now": { + "version": "2.1.0", + "license": "MIT" + }, + "node_modules/picocolors": { + "version": "1.1.0", + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pirates": { + "version": "4.0.6", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/pkg-dir": { + "version": "4.2.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pngjs": { + "version": "5.0.0", + "license": "MIT", + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/postcss": { + "version": "8.4.45", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.7", + "picocolors": "^1.0.1", + "source-map-js": "^1.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/postcss/node_modules/nanoid": { + "version": "3.3.7", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/potpack": { + "version": "2.0.0", + "license": "ISC" + }, + "node_modules/preact": { + "version": "10.23.2", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/preact" + } + }, + "node_modules/pretty-format": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "license": "MIT" + }, + "node_modules/prompts": { + "version": "2.4.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/prop-types": { + "version": "15.8.1", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.13.1" + } + }, + "node_modules/prop-types/node_modules/react-is": { + "version": "16.13.1", + "license": "MIT" + }, + "node_modules/property-information": { + "version": "6.5.0", + "license": "MIT", + "peer": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/protocol-buffers-schema": { + "version": "3.6.0", + "license": "MIT" + }, + "node_modules/protocols": { + "version": "2.0.1", + "license": "MIT" + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "license": "MIT" + }, + "node_modules/psl": { + "version": "1.9.0", + "dev": true, + "license": "MIT" + }, + "node_modules/pump": { + "version": "3.0.0", + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/pure-rand": { + "version": "6.1.0", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ], + "license": "MIT", + "peer": true + }, + "node_modules/qrcode": { + "version": "1.5.0", + "license": "MIT", + "dependencies": { + "dijkstrajs": "^1.0.1", + "encode-utf8": "^1.0.3", + "pngjs": "^5.0.0", + "yargs": "^15.3.1" + }, + "bin": { + "qrcode": "bin/qrcode" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/qrcode/node_modules/ansi-styles": { + "version": "4.3.0", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/qrcode/node_modules/cliui": { + "version": "6.0.0", + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "node_modules/qrcode/node_modules/color-convert": { + "version": "2.0.1", + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/qrcode/node_modules/color-name": { + "version": "1.1.4", + "license": "MIT" + }, + "node_modules/qrcode/node_modules/wrap-ansi": { + "version": "6.2.0", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/qrcode/node_modules/y18n": { + "version": "4.0.3", + "license": "ISC" + }, + "node_modules/qrcode/node_modules/yargs": { + "version": "15.4.1", + "license": "MIT", + "dependencies": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/qrcode/node_modules/yargs-parser": { + "version": "18.1.3", + "license": "ISC", + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/quadbin": { + "version": "0.2.0", + "license": "MIT", + "dependencies": { + "@mapbox/tile-cover": "3.0.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/query-string": { + "version": "8.2.0", + "license": "MIT", + "dependencies": { + "decode-uri-component": "^0.4.1", + "filter-obj": "^5.1.0", + "split-on-first": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/querystringify": { + "version": "2.2.0", + "dev": true, + "license": "MIT" + }, + "node_modules/quick-lru": { + "version": "4.0.1", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/quickselect": { + "version": "2.0.0", + "license": "ISC" + }, + "node_modules/raf": { + "version": "3.4.1", + "license": "MIT", + "dependencies": { + "performance-now": "^2.1.0" + } + }, + "node_modules/react": { + "version": "18.3.1", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-display-name": { + "version": "0.2.5", + "license": "MIT" + }, + "node_modules/react-dnd": { + "version": "11.1.3", + "license": "MIT", + "dependencies": { + "@react-dnd/shallowequal": "^2.0.0", + "@types/hoist-non-react-statics": "^3.3.1", + "dnd-core": "^11.1.3", + "hoist-non-react-statics": "^3.3.0" + }, + "peerDependencies": { + "react": ">= 16.9.0", + "react-dom": ">= 16.9.0" + } + }, + "node_modules/react-dnd-html5-backend": { + "version": "11.1.3", + "license": "MIT", + "dependencies": { + "dnd-core": "^11.1.3" + } + }, + "node_modules/react-dom": { + "version": "18.3.1", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0", + "scheduler": "^0.23.2" + }, + "peerDependencies": { + "react": "^18.3.1" + } + }, + "node_modules/react-hook-form": { + "version": "7.53.0", + "license": "MIT", + "engines": { + "node": ">=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/react-hook-form" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17 || ^18 || ^19" + } + }, + "node_modules/react-is": { + "version": "18.3.1", + "license": "MIT" + }, + "node_modules/react-lifecycles-compat": { + "version": "3.0.4", + "license": "MIT" + }, + "node_modules/react-map-gl": { + "version": "7.1.7", + "license": "MIT", + "dependencies": { + "@maplibre/maplibre-gl-style-spec": "^19.2.1", + "@types/mapbox-gl": ">=1.0.0" + }, + "peerDependencies": { + "mapbox-gl": ">=1.13.0", + "maplibre-gl": ">=1.13.0", + "react": ">=16.3.0", + "react-dom": ">=16.3.0" + }, + "peerDependenciesMeta": { + "mapbox-gl": { + "optional": true + }, + "maplibre-gl": { + "optional": true + } + } + }, + "node_modules/react-markdown": { + "version": "9.0.1", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/hast": "^3.0.0", + "devlop": "^1.0.0", + "hast-util-to-jsx-runtime": "^2.0.0", + "html-url-attributes": "^3.0.0", + "mdast-util-to-hast": "^13.0.0", + "remark-parse": "^11.0.0", + "remark-rehype": "^11.0.0", + "unified": "^11.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "peerDependencies": { + "@types/react": ">=18", + "react": ">=18" + } + }, + "node_modules/react-remove-scroll": { + "version": "2.5.4", + "license": "MIT", + "dependencies": { + "react-remove-scroll-bar": "^2.3.3", + "react-style-singleton": "^2.2.1", + "tslib": "^2.1.0", + "use-callback-ref": "^1.3.0", + "use-sidecar": "^1.1.2" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/react-remove-scroll-bar": { + "version": "2.3.6", + "license": "MIT", + "dependencies": { + "react-style-singleton": "^2.2.1", + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/react-sortable-tree-patch-react-17": { + "version": "2.9.0", + "license": "MIT", + "dependencies": { + "lodash.isequal": "^4.5.0", + "prop-types": "^15.6.1", + "react": "^17.0.0", + "react-dnd": "^11.1.3", + "react-dnd-html5-backend": "^11.1.3", + "react-dnd-scrollzone-patch-react-17": "^1.0.2", + "react-dom": "^17.0.0", + "react-lifecycles-compat": "^3.0.4", + "react-virtualized": "^9.21.2" + }, + "peerDependencies": { + "react": "^17.0.0", + "react-dnd": "^11.1.3", + "react-dom": "^17.0.0" + } + }, + "node_modules/react-sortable-tree-patch-react-17/node_modules/react": { + "version": "17.0.2", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-sortable-tree-patch-react-17/node_modules/react-dnd-scrollzone-patch-react-17": { + "version": "1.0.2", + "license": "MIT", + "dependencies": { + "hoist-non-react-statics": "^3.1.0", + "lodash.throttle": "^4.0.1", + "prop-types": "^15.5.9", + "raf": "^3.2.0", + "react-display-name": "^0.2.0" + }, + "peerDependencies": { + "react": "^17.0.1", + "react-dnd": "^11.1.3", + "react-dom": "^17.0.1" + } + }, + "node_modules/react-sortable-tree-patch-react-17/node_modules/react-dom": { + "version": "17.0.2", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1", + "scheduler": "^0.20.2" + }, + "peerDependencies": { + "react": "17.0.2" + } + }, + "node_modules/react-sortable-tree-patch-react-17/node_modules/scheduler": { + "version": "0.20.2", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1" + } + }, + "node_modules/react-style-singleton": { + "version": "2.2.1", + "license": "MIT", + "dependencies": { + "get-nonce": "^1.0.0", + "invariant": "^2.2.4", + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/react-to-print": { + "version": "2.15.1", + "license": "MIT", + "peerDependencies": { + "react": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0" + } + }, + "node_modules/react-transition-group": { + "version": "4.4.5", + "license": "BSD-3-Clause", + "dependencies": { + "@babel/runtime": "^7.5.5", + "dom-helpers": "^5.0.1", + "loose-envify": "^1.4.0", + "prop-types": "^15.6.2" + }, + "peerDependencies": { + "react": ">=16.6.0", + "react-dom": ">=16.6.0" + } + }, + "node_modules/react-virtualized": { + "version": "9.22.5", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.7.2", + "clsx": "^1.0.4", + "dom-helpers": "^5.1.3", + "loose-envify": "^1.4.0", + "prop-types": "^15.7.2", + "react-lifecycles-compat": "^3.0.4" + }, + "peerDependencies": { + "react": "^15.3.0 || ^16.0.0-alpha || ^17.0.0 || ^18.0.0", + "react-dom": "^15.3.0 || ^16.0.0-alpha || ^17.0.0 || ^18.0.0" + } + }, + "node_modules/react-virtualized/node_modules/clsx": { + "version": "1.2.1", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/read-pkg": { + "version": "5.2.0", + "license": "MIT", + "dependencies": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg-up": { + "version": "7.0.1", + "license": "MIT", + "dependencies": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg-up/node_modules/type-fest": { + "version": "0.8.1", + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg/node_modules/hosted-git-info": { + "version": "2.8.9", + "license": "ISC" + }, + "node_modules/read-pkg/node_modules/normalize-package-data": { + "version": "2.5.0", + "license": "BSD-2-Clause", + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "node_modules/read-pkg/node_modules/semver": { + "version": "5.7.2", + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/read-pkg/node_modules/type-fest": { + "version": "0.6.0", + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=8" + } + }, + "node_modules/readable-stream": { + "version": "2.3.8", + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/redent": { + "version": "3.0.0", + "license": "MIT", + "dependencies": { + "indent-string": "^4.0.0", + "strip-indent": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/redux": { + "version": "5.0.1", + "license": "MIT" + }, + "node_modules/redux-thunk": { + "version": "3.1.0", + "license": "MIT", + "peerDependencies": { + "redux": "^5.0.0" + } + }, + "node_modules/regenerate": { + "version": "1.4.2", + "dev": true, + "license": "MIT" + }, + "node_modules/regenerate-unicode-properties": { + "version": "10.1.1", + "dev": true, + "license": "MIT", + "dependencies": { + "regenerate": "^1.4.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/regenerator-runtime": { + "version": "0.14.1", + "license": "MIT" + }, + "node_modules/regenerator-transform": { + "version": "0.15.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.8.4" + } + }, + "node_modules/regexpu-core": { + "version": "5.3.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/regjsgen": "^0.8.0", + "regenerate": "^1.4.2", + "regenerate-unicode-properties": "^10.1.0", + "regjsparser": "^0.9.1", + "unicode-match-property-ecmascript": "^2.0.0", + "unicode-match-property-value-ecmascript": "^2.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/regjsparser": { + "version": "0.9.1", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "jsesc": "~0.5.0" + }, + "bin": { + "regjsparser": "bin/parser" + } + }, + "node_modules/regjsparser/node_modules/jsesc": { + "version": "0.5.0", + "dev": true, + "bin": { + "jsesc": "bin/jsesc" + } + }, + "node_modules/rehackt": { + "version": "0.1.0", + "license": "MIT", + "peerDependencies": { + "@types/react": "*", + "react": "*" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "react": { + "optional": true + } + } + }, + "node_modules/remark-parse": { + "version": "11.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-from-markdown": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-rehype": { + "version": "11.1.1", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "mdast-util-to-hast": "^13.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-main-filename": { + "version": "2.0.0", + "license": "ISC" + }, + "node_modules/requires-port": { + "version": "1.0.0", + "dev": true, + "license": "MIT" + }, + "node_modules/reselect": { + "version": "5.1.1", + "license": "MIT" + }, + "node_modules/resolve": { + "version": "1.22.8", + "license": "MIT", + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-alpn": { + "version": "1.2.1", + "license": "MIT" + }, + "node_modules/resolve-cwd": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-cwd/node_modules/resolve-from": { + "version": "5.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/resolve-protobuf-schema": { + "version": "2.1.0", + "license": "MIT", + "dependencies": { + "protocol-buffers-schema": "^3.3.1" + } + }, + "node_modules/resolve.exports": { + "version": "2.0.2", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/response-iterator": { + "version": "0.2.6", + "license": "MIT", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/responselike": { + "version": "2.0.1", + "license": "MIT", + "dependencies": { + "lowercase-keys": "^2.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/robust-predicates": { + "version": "3.0.2", + "license": "Unlicense" + }, + "node_modules/rollup": { + "version": "3.29.4", + "dev": true, + "license": "MIT", + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=14.18.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/rw": { + "version": "1.3.3", + "license": "BSD-3-Clause" + }, + "node_modules/rxjs": { + "version": "7.8.1", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "license": "MIT" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "license": "MIT" + }, + "node_modules/saxes": { + "version": "6.0.0", + "dev": true, + "license": "ISC", + "dependencies": { + "xmlchars": "^2.2.0" + }, + "engines": { + "node": ">=v12.22.7" + } + }, + "node_modules/scheduler": { + "version": "0.23.2", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0" + } + }, + "node_modules/semver": { + "version": "6.3.1", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "license": "ISC" + }, + "node_modules/set-value": { + "version": "2.0.1", + "license": "MIT", + "dependencies": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/setimmediate": { + "version": "1.0.5", + "license": "MIT" + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "dev": true, + "license": "ISC", + "peer": true + }, + "node_modules/simple-swizzle": { + "version": "0.2.2", + "license": "MIT", + "peer": true, + "dependencies": { + "is-arrayish": "^0.3.1" + } + }, + "node_modules/simple-swizzle/node_modules/is-arrayish": { + "version": "0.3.2", + "license": "MIT", + "peer": true + }, + "node_modules/sisteransi": { + "version": "1.0.5", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/slash": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/snappyjs": { + "version": "0.6.1", + "license": "MIT" + }, + "node_modules/sort-asc": { + "version": "0.2.0", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sort-desc": { + "version": "0.2.0", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sort-object": { + "version": "3.0.3", + "license": "MIT", + "dependencies": { + "bytewise": "^1.1.0", + "get-value": "^2.0.2", + "is-extendable": "^0.1.1", + "sort-asc": "^0.2.0", + "sort-desc": "^0.2.0", + "union-value": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sortablejs": { + "version": "1.15.3", + "license": "MIT", + "peer": true + }, + "node_modules/source-map": { + "version": "0.5.7", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-js": { + "version": "1.2.0", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.13", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/source-map-support/node_modules/source-map": { + "version": "0.6.1", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/space-separated-tokens": { + "version": "2.0.2", + "license": "MIT", + "peer": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/spdx-correct": { + "version": "3.2.0", + "license": "Apache-2.0", + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.5.0", + "license": "CC-BY-3.0" + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "license": "MIT", + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.20", + "license": "CC0-1.0" + }, + "node_modules/split-on-first": { + "version": "3.0.0", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/split-string": { + "version": "3.1.0", + "license": "MIT", + "dependencies": { + "extend-shallow": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/split-string/node_modules/extend-shallow": { + "version": "3.0.2", + "license": "MIT", + "dependencies": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/split-string/node_modules/is-extendable": { + "version": "1.0.1", + "license": "MIT", + "dependencies": { + "is-plain-object": "^2.0.4" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "license": "BSD-3-Clause" + }, + "node_modules/stack-utils": { + "version": "2.0.6", + "dev": true, + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/stack-utils/node_modules/escape-string-regexp": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/string_decoder": { + "version": "1.1.1", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/string-length": { + "version": "4.0.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "char-regex": "^1.0.2", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/stringify-entities": { + "version": "4.0.4", + "license": "MIT", + "peer": true, + "dependencies": { + "character-entities-html4": "^2.0.0", + "character-entities-legacy": "^3.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-final-newline": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/strip-indent": { + "version": "3.0.0", + "license": "MIT", + "dependencies": { + "min-indent": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/strnum": { + "version": "1.0.5", + "license": "MIT" + }, + "node_modules/style-to-object": { + "version": "1.0.8", + "license": "MIT", + "peer": true, + "dependencies": { + "inline-style-parser": "0.2.4" + } + }, + "node_modules/stylis": { + "version": "4.2.0", + "license": "MIT" + }, + "node_modules/subtag": { + "version": "0.5.0", + "license": "ISC" + }, + "node_modules/suggestions": { + "version": "1.7.1", + "license": "ISC", + "dependencies": { + "fuzzy": "^0.1.1", + "xtend": "^4.0.0" + } + }, + "node_modules/supercluster": { + "version": "8.0.1", + "license": "ISC", + "dependencies": { + "kdbush": "^4.0.2" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/symbol-observable": { + "version": "4.0.0", + "license": "MIT", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/symbol-tree": { + "version": "3.2.4", + "dev": true, + "license": "MIT" + }, + "node_modules/tabbable": { + "version": "6.2.0", + "license": "MIT", + "peer": true + }, + "node_modules/table-layout": { + "version": "4.1.1", + "license": "MIT", + "peer": true, + "dependencies": { + "array-back": "^6.2.2", + "wordwrapjs": "^5.1.0" + }, + "engines": { + "node": ">=12.17" + } + }, + "node_modules/table-layout/node_modules/array-back": { + "version": "6.2.2", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12.17" + } + }, + "node_modules/test-exclude": { + "version": "6.0.0", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/texture-compressor": { + "version": "1.0.2", + "license": "MIT", + "dependencies": { + "argparse": "^1.0.10", + "image-size": "^0.7.4" + }, + "bin": { + "texture-compressor": "bin/texture-compressor.js" + } + }, + "node_modules/tilebelt": { + "version": "1.0.1", + "license": "MIT" + }, + "node_modules/timezone-groups": { + "version": "0.9.1", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=18.12.0" + } + }, + "node_modules/tinyqueue": { + "version": "2.0.3", + "license": "ISC" + }, + "node_modules/tmpl": { + "version": "1.0.5", + "dev": true, + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/tough-cookie": { + "version": "4.1.4", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "psl": "^1.1.33", + "punycode": "^2.1.1", + "universalify": "^0.2.0", + "url-parse": "^1.5.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/tr46": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "punycode": "^2.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/trim-lines": { + "version": "3.0.1", + "license": "MIT", + "peer": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/trim-newlines": { + "version": "3.0.1", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/trough": { + "version": "2.2.0", + "license": "MIT", + "peer": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/ts-invariant": { + "version": "0.10.3", + "license": "MIT", + "dependencies": { + "tslib": "^2.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ts-jest": { + "version": "29.2.5", + "dev": true, + "license": "MIT", + "dependencies": { + "bs-logger": "^0.2.6", + "ejs": "^3.1.10", + "fast-json-stable-stringify": "^2.1.0", + "jest-util": "^29.0.0", + "json5": "^2.2.3", + "lodash.memoize": "^4.1.2", + "make-error": "^1.3.6", + "semver": "^7.6.3", + "yargs-parser": "^21.1.1" + }, + "bin": { + "ts-jest": "cli.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0" + }, + "peerDependencies": { + "@babel/core": ">=7.0.0-beta.0 <8", + "@jest/transform": "^29.0.0", + "@jest/types": "^29.0.0", + "babel-jest": "^29.0.0", + "jest": "^29.0.0", + "typescript": ">=4.3 <6" + }, + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "@jest/transform": { + "optional": true + }, + "@jest/types": { + "optional": true + }, + "babel-jest": { + "optional": true + }, + "esbuild": { + "optional": true + } + } + }, + "node_modules/ts-jest/node_modules/semver": { + "version": "7.6.3", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/ts-jest/node_modules/yargs-parser": { + "version": "21.1.1", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/tslib": { + "version": "2.7.0", + "license": "0BSD" + }, + "node_modules/tss-react": { + "version": "3.7.1", + "license": "MIT", + "dependencies": { + "@emotion/cache": "*", + "@emotion/serialize": "*", + "@emotion/utils": "*" + }, + "peerDependencies": { + "@emotion/react": "^11.4.1", + "@emotion/server": "^11.4.0", + "react": "^16.8.0 || ^17.0.2 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@emotion/server": { + "optional": true + } + } + }, + "node_modules/type-detect": { + "version": "4.0.8", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/type-fest": { + "version": "4.18.2", + "license": "(MIT OR CC0-1.0)", + "peer": true, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typescript": { + "version": "4.9.5", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/typewise": { + "version": "1.0.3", + "license": "MIT", + "dependencies": { + "typewise-core": "^1.2.0" + } + }, + "node_modules/typewise-core": { + "version": "1.2.0", + "license": "MIT" + }, + "node_modules/typical": { + "version": "4.0.0", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ulid": { + "version": "2.3.0", + "license": "MIT", + "bin": { + "ulid": "bin/cli.js" + } + }, + "node_modules/undici-types": { + "version": "6.19.8", + "license": "MIT" + }, + "node_modules/unicode-canonical-property-names-ecmascript": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-match-property-ecmascript": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "unicode-canonical-property-names-ecmascript": "^2.0.0", + "unicode-property-aliases-ecmascript": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-match-property-value-ecmascript": { + "version": "2.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-property-aliases-ecmascript": { + "version": "2.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/unified": { + "version": "11.0.5", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unified/node_modules/is-plain-obj": { + "version": "4.1.0", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/union-value": { + "version": "1.0.1", + "license": "MIT", + "dependencies": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unist-util-is": { + "version": "6.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-position": { + "version": "5.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-visit": { + "version": "5.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-visit-parents": { + "version": "6.0.1", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/universalify": { + "version": "0.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.1.0", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.1.2", + "picocolors": "^1.0.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/url-parse": { + "version": "1.5.10", + "dev": true, + "license": "MIT", + "dependencies": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, + "node_modules/use-callback-ref": { + "version": "1.3.2", + "license": "MIT", + "dependencies": { + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/use-isomorphic-layout-effect": { + "version": "1.1.2", + "license": "MIT", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/use-sidecar": { + "version": "1.1.2", + "license": "MIT", + "dependencies": { + "detect-node-es": "^1.1.0", + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "^16.9.0 || ^17.0.0 || ^18.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/use-sync-external-store": { + "version": "1.2.2", + "license": "MIT", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "license": "MIT" + }, + "node_modules/uuid": { + "version": "9.0.1", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/v8-to-istanbul": { + "version": "9.3.0", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^2.0.0" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "license": "Apache-2.0", + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "node_modules/vfile": { + "version": "6.0.3", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/unist": "^3.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-message": { + "version": "4.0.2", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vite": { + "version": "4.5.5", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.18.10", + "postcss": "^8.4.27", + "rollup": "^3.27.1" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + }, + "peerDependencies": { + "@types/node": ">= 14", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/vt-pbf": { + "version": "3.1.3", + "license": "MIT", + "dependencies": { + "@mapbox/point-geometry": "0.1.0", + "@mapbox/vector-tile": "^1.3.1", + "pbf": "^3.2.1" + } + }, + "node_modules/w3c-xmlserializer": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "xml-name-validator": "^4.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/walker": { + "version": "1.0.8", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "makeerror": "1.0.12" + } + }, + "node_modules/webidl-conversions": { + "version": "7.0.0", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + } + }, + "node_modules/wgsl_reflect": { + "version": "1.0.10", + "license": "MIT" + }, + "node_modules/whatwg-encoding": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "iconv-lite": "0.6.3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/whatwg-mimetype": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "node_modules/whatwg-url": { + "version": "11.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "tr46": "^3.0.0", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/which": { + "version": "2.0.2", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/which-module": { + "version": "2.0.1", + "license": "ISC" + }, + "node_modules/wordwrapjs": { + "version": "5.1.0", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12.17" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/wrappy": { + "version": "1.0.2", + "license": "ISC" + }, + "node_modules/write-file-atomic": { + "version": "4.0.2", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.7" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/ws": { + "version": "8.18.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/xml-name-validator": { + "version": "4.0.0", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12" + } + }, + "node_modules/xmlchars": { + "version": "2.2.0", + "dev": true, + "license": "MIT" + }, + "node_modules/xss": { + "version": "1.0.13", + "license": "MIT", + "peer": true, + "dependencies": { + "commander": "^2.20.3", + "cssfilter": "0.0.10" + }, + "bin": { + "xss": "bin/xss" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/xss/node_modules/commander": { + "version": "2.20.3", + "license": "MIT", + "peer": true + }, + "node_modules/xstate": { + "version": "4.38.3", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/xstate" + } + }, + "node_modules/xtend": { + "version": "4.0.2", + "license": "MIT", + "engines": { + "node": ">=0.4" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "dev": true, + "license": "ISC", + "peer": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "dev": true, + "license": "ISC" + }, + "node_modules/yaml": { + "version": "1.10.2", + "license": "ISC", + "engines": { + "node": ">= 6" + } + }, + "node_modules/yargs": { + "version": "17.7.2", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "20.2.9", + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs/node_modules/yargs-parser": { + "version": "21.1.1", + "dev": true, + "license": "ISC", + "peer": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/zen-observable": { + "version": "0.8.15", + "license": "MIT" + }, + "node_modules/zen-observable-ts": { + "version": "1.2.5", + "license": "MIT", + "dependencies": { + "zen-observable": "0.8.15" + } + }, + "node_modules/zstd-codec": { + "version": "0.1.5", + "license": "MIT", + "optional": true + }, + "node_modules/zwitch": { + "version": "2.0.4", + "license": "MIT", + "peer": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + } + } +} diff --git a/package.json b/package.json index 8bcbfee..4bccfe9 100644 --- a/package.json +++ b/package.json @@ -17,13 +17,18 @@ "url": "git+ssh://git@github.com/ruralinnovation/wiki" }, "scripts": { - "build": "npm run package -w cisco && quarto render --output-dir docs", + "build": "npm run build --ws && npm run package -w cisco && quarto render --output-dir docs", + "build:frontend": "npm run build -w @cori-risi/frontend && cp -LR frontend/dist/assets ./", "clean": "rm -rf _site/*", + "dev": "npm run build:frontend && quarto render --output-dir _site", "package": "R CMD build --no-manual", - "preview": "quarto render --output-dir _site && python -m http.server -d _site 3000" + "preview": "npm run dev && python -m http.server -d _site 3000" }, "workspaces": [ "cisco", "frontend" - ] + ], + "dependencies": { + "@cori-risi/cori.data.api": "file:../cori.data.api" + } } diff --git a/src/custom.scss b/src/custom.scss index 10f75d6..e932a04 100644 --- a/src/custom.scss +++ b/src/custom.scss @@ -25,80 +25,77 @@ body { background-color: #16343E !important; } -header#quarto-header { - background-color: #16343E; +header { - nav.navbar { - //font-family: $font-family-sans-serif; - text-shadow: -1px -1px 0 rgba(0,0,0,.3); + &#quarto-header { + background-color: #16343E; - &[data-bs-theme="dark"] { - background-color: #16343E; + nav.navbar { + //font-family: $font-family-sans-serif; + text-shadow: -1px -1px 0 rgba(0,0,0,.3); - .navbar-brand { - min-width: 7em; - min-height: 3.5em; - background-image: url(assets/images/Full-Logo_CORI_Cream.svg); - background-size: calc(100% - 1em); - background-position: left top; - background-repeat: no-repeat; - padding-left: 0.5em; + &[data-bs-theme="dark"] { + background-color: #16343E; - .navbar-title { - display: none; - } - } + .navbar-brand { + min-width: 7em; + min-height: 3.5em; + background-image: url('assets/images/Full-Logo_CORI_Cream.svg'); + background-size: calc(100% - 1em); + background-position: left top; + background-repeat: no-repeat; + padding-left: 0.5em; - .nav-link, .nav-link.active { + .navbar-title { + display: none; + } + } - &:hover { - color: #FFF; + .navbar-brand-container { + min-width: 196px; } - .menu-text, i { - color: #FBF8E9; + .nav-link, .nav-link.active { &:hover { color: #FFF; } + + .menu-text, i { + color: #FBF8E9; + + &:hover { + color: #FFF; + } + } } } } -} - - * a:visited { - color: #FFF !important; - } - * a:hover { - color: #7a7a7a !important; - text-shadow: none; - } - * a.nav-link { - font-variant: small-caps; - } - - * a .navbar-title { - //font-family: $font-family-sans-serif; - font-weight: bold; - } + * a:visited { + color: #FFF !important; + } + * a:hover { + color: #7a7a7a !important; + text-shadow: none; + } -} + * a.nav-link { + font-variant: small-caps; + } -div.quarto-title-banner { - background-color: #16343E; -} + * a .navbar-title { + //font-family: $font-family-sans-serif; + font-weight: bold; + } -div.quarto-title { - &, & .title, .title { - color: #fff; } -} -header { &#title-block-header { - background-color: #FFF; margin-bottom: 0; + margin-top: 10px; + background-color: transparent !important; + z-index: 2; } .quarto-title-breadcrumbs .breadcrumb { @@ -125,6 +122,16 @@ header { } } +div.quarto-title-banner { + background-color: #16343E; +} + +div.quarto-title { + &, & .title, .title { + color: #fff; + } +} + div#listing-listing { margin-top: 4em; } @@ -227,3 +234,21 @@ div#quarto-content { } } + +.content { + &#app { + position: absolute; + top: 92px; + left: 225px; + + &>div { + width: calc(100vw - 225px); + height: calc(100vh - 92px); + + .mapboxgl-map { + width: 100%; + height: 100%; + } + } + } +}