@basemaps/landing 6.41.0 → 6.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/README.md +21 -0
- package/build/__tests__/map.config.test.js +0 -19
- package/build/__tests__/map.config.test.js.map +1 -1
- package/build/components/debug.js +3 -3
- package/build/components/debug.js.map +1 -1
- package/build/components/layer.switcher.dropdown.d.ts.map +1 -1
- package/build/components/layer.switcher.dropdown.js +26 -2
- package/build/components/layer.switcher.dropdown.js.map +1 -1
- package/build/components/layout.header.d.ts.map +1 -1
- package/build/components/layout.header.js +1 -1
- package/build/components/layout.header.js.map +1 -1
- package/build/components/map.d.ts.map +1 -1
- package/build/components/map.js +6 -3
- package/build/components/map.js.map +1 -1
- package/build/config.d.ts +2 -0
- package/build/config.d.ts.map +1 -1
- package/build/config.js +5 -0
- package/build/config.js.map +1 -1
- package/build/config.map.d.ts.map +1 -1
- package/build/config.map.js +15 -10
- package/build/config.map.js.map +1 -1
- package/build/url.d.ts +0 -13
- package/build/url.d.ts.map +1 -1
- package/build/url.js +1 -39
- package/build/url.js.map +1 -1
- package/package.json +7 -7
- package/dist/android-chrome-192x192.png +0 -0
- package/dist/android-chrome-512x512.png +0 -0
- package/dist/apple-touch-icon.png +0 -0
- package/dist/assets/fonts/OpenSans-Bold.woff2 +0 -0
- package/dist/assets/fonts/OpenSans-Italic.woff2 +0 -0
- package/dist/assets/fonts/OpenSans-Light.woff2 +0 -0
- package/dist/assets/fonts/OpenSans-Regular.woff2 +0 -0
- package/dist/assets/fonts/OpenSans-SemiBold.woff2 +0 -0
- package/dist/assets/logo-linz.svg +0 -256
- package/dist/assets/logo-nz-govt.svg +0 -11
- package/dist/basemaps-card.jpeg +0 -0
- package/dist/examples/index.html +0 -33
- package/dist/examples/index.leaflet.xyz.3857.html +0 -43
- package/dist/examples/index.maplibre.compare.3857.html +0 -111
- package/dist/examples/index.maplibre.opacity.3857.html +0 -218
- package/dist/examples/index.maplibre.vector.3857.html +0 -48
- package/dist/examples/index.openlayers.attribution.wmts.3857.html +0 -55
- package/dist/examples/index.openlayers.wmts.3857.html +0 -49
- package/dist/examples/index.openlayers.xyz.3857.html +0 -49
- package/dist/favicon-16x16.png +0 -0
- package/dist/favicon-32x32.png +0 -0
- package/dist/favicon.ico +0 -0
- package/dist/index-6.41.0-04bd3d24eee59f30.css +0 -6280
- package/dist/index-6.41.0-ae3950c364b06ab8.js +0 -59403
- package/dist/index-6.41.0-dce2cbdab3dc8de4.js +0 -624
- package/dist/index.css +0 -6280
- package/dist/index.html +0 -26
- package/dist/index.js +0 -624
- package/dist/json-schema/stac-basemaps-extension/1.0/schema.json +0 -144
- package/dist/lib/attribution-6.41.0-a06a4339e5df297e.js +0 -10
- package/dist/lib/attribution-6.41.0-f0099e1099a7c0ac.js +0 -2330
- package/dist/lib/attribution.js +0 -10
|
@@ -1,624 +0,0 @@
|
|
|
1
|
-
"use strict";var P3=Object.create;var ub=Object.defineProperty;var k3=Object.getOwnPropertyDescriptor;var z3=Object.getOwnPropertyNames;var L3=Object.getPrototypeOf,R3=Object.prototype.hasOwnProperty;var Vt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var D3=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of z3(t))!R3.call(e,u)&&u!==r&&ub(e,u,{get:()=>t[u],enumerable:!(a=k3(t,u))||a.enumerable});return e};var Lt=(e,t,r)=>(r=e!=null?P3(L3(e)):{},D3(t||!e||!e.__esModule?ub(r,"default",{value:e,enumerable:!0}):r,e));var _b=Vt(ui=>{"use strict";var Zh=Symbol.for("react.element"),B3=Symbol.for("react.portal"),N3=Symbol.for("react.fragment"),F3=Symbol.for("react.strict_mode"),O3=Symbol.for("react.profiler"),G3=Symbol.for("react.provider"),V3=Symbol.for("react.context"),U3=Symbol.for("react.forward_ref"),W3=Symbol.for("react.suspense"),Z3=Symbol.for("react.memo"),j3=Symbol.for("react.lazy"),cb=Symbol.iterator;function H3(e){return e===null||typeof e!="object"?null:(e=cb&&e[cb]||e["@@iterator"],typeof e=="function"?e:null)}var pb={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},fb=Object.assign,mb={};function Vu(e,t,r){this.props=e,this.context=t,this.refs=mb,this.updater=r||pb}Vu.prototype.isReactComponent={};Vu.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")};Vu.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function gb(){}gb.prototype=Vu.prototype;function q0(e,t,r){this.props=e,this.context=t,this.refs=mb,this.updater=r||pb}var J0=q0.prototype=new gb;J0.constructor=q0;fb(J0,Vu.prototype);J0.isPureReactComponent=!0;var hb=Array.isArray,yb=Object.prototype.hasOwnProperty,Q0={current:null},vb={key:!0,ref:!0,__self:!0,__source:!0};function xb(e,t,r){var a,u={},o=null,m=null;if(t!=null)for(a in t.ref!==void 0&&(m=t.ref),t.key!==void 0&&(o=""+t.key),t)yb.call(t,a)&&!vb.hasOwnProperty(a)&&(u[a]=t[a]);var v=arguments.length-2;if(v===1)u.children=r;else if(1<v){for(var b=Array(v),C=0;C<v;C++)b[C]=arguments[C+2];u.children=b}if(e&&e.defaultProps)for(a in v=e.defaultProps,v)u[a]===void 0&&(u[a]=v[a]);return{$$typeof:Zh,type:e,key:o,ref:m,props:u,_owner:Q0.current}}function X3(e,t){return{$$typeof:Zh,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function K0(e){return typeof e=="object"&&e!==null&&e.$$typeof===Zh}function $3(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var db=/\/+/g;function Y0(e,t){return typeof e=="object"&&e!==null&&e.key!=null?$3(""+e.key):t.toString(36)}function hf(e,t,r,a,u){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var m=!1;if(e===null)m=!0;else switch(o){case"string":case"number":m=!0;break;case"object":switch(e.$$typeof){case Zh:case B3:m=!0}}if(m)return m=e,u=u(m),e=a===""?"."+Y0(m,0):a,hb(u)?(r="",e!=null&&(r=e.replace(db,"$&/")+"/"),hf(u,t,r,"",function(C){return C})):u!=null&&(K0(u)&&(u=X3(u,r+(!u.key||m&&m.key===u.key?"":(""+u.key).replace(db,"$&/")+"/")+e)),t.push(u)),1;if(m=0,a=a===""?".":a+":",hb(e))for(var v=0;v<e.length;v++){o=e[v];var b=a+Y0(o,v);m+=hf(o,t,r,b,u)}else if(b=H3(e),typeof b=="function")for(e=b.call(e),v=0;!(o=e.next()).done;)o=o.value,b=a+Y0(o,v++),m+=hf(o,t,r,b,u);else if(o==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return m}function cf(e,t,r){if(e==null)return e;var a=[],u=0;return hf(e,a,"","",function(o){return t.call(r,o,u++)}),a}function Y3(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Dn={current:null},df={transition:null},q3={ReactCurrentDispatcher:Dn,ReactCurrentBatchConfig:df,ReactCurrentOwner:Q0};ui.Children={map:cf,forEach:function(e,t,r){cf(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return cf(e,function(){t++}),t},toArray:function(e){return cf(e,function(t){return t})||[]},only:function(e){if(!K0(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ui.Component=Vu;ui.Fragment=N3;ui.Profiler=O3;ui.PureComponent=q0;ui.StrictMode=F3;ui.Suspense=W3;ui.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=q3;ui.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var a=fb({},e.props),u=e.key,o=e.ref,m=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,m=Q0.current),t.key!==void 0&&(u=""+t.key),e.type&&e.type.defaultProps)var v=e.type.defaultProps;for(b in t)yb.call(t,b)&&!vb.hasOwnProperty(b)&&(a[b]=t[b]===void 0&&v!==void 0?v[b]:t[b])}var b=arguments.length-2;if(b===1)a.children=r;else if(1<b){v=Array(b);for(var C=0;C<b;C++)v[C]=arguments[C+2];a.children=v}return{$$typeof:Zh,type:e.type,key:u,ref:o,props:a,_owner:m}};ui.createContext=function(e){return e={$$typeof:V3,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:G3,_context:e},e.Consumer=e};ui.createElement=xb;ui.createFactory=function(e){var t=xb.bind(null,e);return t.type=e,t};ui.createRef=function(){return{current:null}};ui.forwardRef=function(e){return{$$typeof:U3,render:e}};ui.isValidElement=K0;ui.lazy=function(e){return{$$typeof:j3,_payload:{_status:-1,_result:e},_init:Y3}};ui.memo=function(e,t){return{$$typeof:Z3,type:e,compare:t===void 0?null:t}};ui.startTransition=function(e){var t=df.transition;df.transition={};try{e()}finally{df.transition=t}};ui.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};ui.useCallback=function(e,t){return Dn.current.useCallback(e,t)};ui.useContext=function(e){return Dn.current.useContext(e)};ui.useDebugValue=function(){};ui.useDeferredValue=function(e){return Dn.current.useDeferredValue(e)};ui.useEffect=function(e,t){return Dn.current.useEffect(e,t)};ui.useId=function(){return Dn.current.useId()};ui.useImperativeHandle=function(e,t,r){return Dn.current.useImperativeHandle(e,t,r)};ui.useInsertionEffect=function(e,t){return Dn.current.useInsertionEffect(e,t)};ui.useLayoutEffect=function(e,t){return Dn.current.useLayoutEffect(e,t)};ui.useMemo=function(e,t){return Dn.current.useMemo(e,t)};ui.useReducer=function(e,t,r){return Dn.current.useReducer(e,t,r)};ui.useRef=function(e){return Dn.current.useRef(e)};ui.useState=function(e){return Dn.current.useState(e)};ui.useSyncExternalStore=function(e,t,r){return Dn.current.useSyncExternalStore(e,t,r)};ui.useTransition=function(){return Dn.current.useTransition()};ui.version="18.2.0"});var Ir=Vt((fB,bb)=>{"use strict";bb.exports=_b()});var kb=Vt(Yi=>{"use strict";function ry(e,t){var r=e.length;e.push(t);e:for(;0<r;){var a=r-1>>>1,u=e[a];if(0<pf(u,t))e[a]=t,e[r]=u,r=a;else break e}}function Go(e){return e.length===0?null:e[0]}function mf(e){if(e.length===0)return null;var t=e[0],r=e.pop();if(r!==t){e[0]=r;e:for(var a=0,u=e.length,o=u>>>1;a<o;){var m=2*(a+1)-1,v=e[m],b=m+1,C=e[b];if(0>pf(v,r))b<u&&0>pf(C,v)?(e[a]=C,e[b]=r,a=b):(e[a]=v,e[m]=r,a=m);else if(b<u&&0>pf(C,r))e[a]=C,e[b]=r,a=b;else break e}}return t}function pf(e,t){var r=e.sortIndex-t.sortIndex;return r!==0?r:e.id-t.id}typeof performance=="object"&&typeof performance.now=="function"?(wb=performance,Yi.unstable_now=function(){return wb.now()}):(ey=Date,Ib=ey.now(),Yi.unstable_now=function(){return ey.now()-Ib});var wb,ey,Ib,ns=[],Ea=[],J3=1,Eo=null,yn=3,gf=!1,Ml=!1,Hh=!1,Mb=typeof setTimeout=="function"?setTimeout:null,Eb=typeof clearTimeout=="function"?clearTimeout:null,Sb=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function ny(e){for(var t=Go(Ea);t!==null;){if(t.callback===null)mf(Ea);else if(t.startTime<=e)mf(Ea),t.sortIndex=t.expirationTime,ry(ns,t);else break;t=Go(Ea)}}function oy(e){if(Hh=!1,ny(e),!Ml)if(Go(ns)!==null)Ml=!0,ay(sy);else{var t=Go(Ea);t!==null&&ly(oy,t.startTime-e)}}function sy(e,t){Ml=!1,Hh&&(Hh=!1,Eb(Xh),Xh=-1),gf=!0;var r=yn;try{for(ny(t),Eo=Go(ns);Eo!==null&&(!(Eo.expirationTime>t)||e&&!Pb());){var a=Eo.callback;if(typeof a=="function"){Eo.callback=null,yn=Eo.priorityLevel;var u=a(Eo.expirationTime<=t);t=Yi.unstable_now(),typeof u=="function"?Eo.callback=u:Eo===Go(ns)&&mf(ns),ny(t)}else mf(ns);Eo=Go(ns)}if(Eo!==null)var o=!0;else{var m=Go(Ea);m!==null&&ly(oy,m.startTime-t),o=!1}return o}finally{Eo=null,yn=r,gf=!1}}var yf=!1,ff=null,Xh=-1,Tb=5,Ab=-1;function Pb(){return!(Yi.unstable_now()-Ab<Tb)}function ty(){if(ff!==null){var e=Yi.unstable_now();Ab=e;var t=!0;try{t=ff(!0,e)}finally{t?jh():(yf=!1,ff=null)}}else yf=!1}var jh;typeof Sb=="function"?jh=function(){Sb(ty)}:typeof MessageChannel<"u"?(iy=new MessageChannel,Cb=iy.port2,iy.port1.onmessage=ty,jh=function(){Cb.postMessage(null)}):jh=function(){Mb(ty,0)};var iy,Cb;function ay(e){ff=e,yf||(yf=!0,jh())}function ly(e,t){Xh=Mb(function(){e(Yi.unstable_now())},t)}Yi.unstable_IdlePriority=5;Yi.unstable_ImmediatePriority=1;Yi.unstable_LowPriority=4;Yi.unstable_NormalPriority=3;Yi.unstable_Profiling=null;Yi.unstable_UserBlockingPriority=2;Yi.unstable_cancelCallback=function(e){e.callback=null};Yi.unstable_continueExecution=function(){Ml||gf||(Ml=!0,ay(sy))};Yi.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Tb=0<e?Math.floor(1e3/e):5};Yi.unstable_getCurrentPriorityLevel=function(){return yn};Yi.unstable_getFirstCallbackNode=function(){return Go(ns)};Yi.unstable_next=function(e){switch(yn){case 1:case 2:case 3:var t=3;break;default:t=yn}var r=yn;yn=t;try{return e()}finally{yn=r}};Yi.unstable_pauseExecution=function(){};Yi.unstable_requestPaint=function(){};Yi.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=yn;yn=e;try{return t()}finally{yn=r}};Yi.unstable_scheduleCallback=function(e,t,r){var a=Yi.unstable_now();switch(typeof r=="object"&&r!==null?(r=r.delay,r=typeof r=="number"&&0<r?a+r:a):r=a,e){case 1:var u=-1;break;case 2:u=250;break;case 5:u=1073741823;break;case 4:u=1e4;break;default:u=5e3}return u=r+u,e={id:J3++,callback:t,priorityLevel:e,startTime:r,expirationTime:u,sortIndex:-1},r>a?(e.sortIndex=r,ry(Ea,e),Go(ns)===null&&e===Go(Ea)&&(Hh?(Eb(Xh),Xh=-1):Hh=!0,ly(oy,r-a))):(e.sortIndex=u,ry(ns,e),Ml||gf||(Ml=!0,ay(sy))),e};Yi.unstable_shouldYield=Pb;Yi.unstable_wrapCallback=function(e){var t=yn;return function(){var r=yn;yn=t;try{return e.apply(this,arguments)}finally{yn=r}}}});var Lb=Vt((gB,zb)=>{"use strict";zb.exports=kb()});var OI=Vt(mo=>{"use strict";var Gw=Ir(),po=Lb();function Qe(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Vw=new Set,md={};function Ol(e,t){lc(e,t),lc(e+"Capture",t)}function lc(e,t){for(md[e]=t,e=0;e<t.length;e++)Vw.add(t[e])}var Vs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ky=Object.prototype.hasOwnProperty,Q3=/^[: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]*$/,Rb={},Db={};function K3(e){return ky.call(Db,e)?!0:ky.call(Rb,e)?!1:Q3.test(e)?Db[e]=!0:(Rb[e]=!0,!1)}function e4(e,t,r,a){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return a?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function t4(e,t,r,a){if(t===null||typeof t>"u"||e4(e,t,r,a))return!0;if(a)return!1;if(r!==null)switch(r.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 Fn(e,t,r,a,u,o,m){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=a,this.attributeNamespace=u,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=m}var cn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){cn[e]=new Fn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];cn[t]=new Fn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){cn[e]=new Fn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){cn[e]=new Fn(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){cn[e]=new Fn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){cn[e]=new Fn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){cn[e]=new Fn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){cn[e]=new Fn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){cn[e]=new Fn(e,5,!1,e.toLowerCase(),null,!1,!1)});var Iv=/[\-:]([a-z])/g;function Sv(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(Iv,Sv);cn[t]=new Fn(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(Iv,Sv);cn[t]=new Fn(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(Iv,Sv);cn[t]=new Fn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){cn[e]=new Fn(e,1,!1,e.toLowerCase(),null,!1,!1)});cn.xlinkHref=new Fn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){cn[e]=new Fn(e,1,!1,e.toLowerCase(),null,!0,!0)});function Cv(e,t,r,a){var u=cn.hasOwnProperty(t)?cn[t]:null;(u!==null?u.type!==0:a||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(t4(t,r,u,a)&&(r=null),a||u===null?K3(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):u.mustUseProperty?e[u.propertyName]=r===null?u.type===3?!1:"":r:(t=u.attributeName,a=u.attributeNamespace,r===null?e.removeAttribute(t):(u=u.type,r=u===3||u===4&&r===!0?"":""+r,a?e.setAttributeNS(a,t,r):e.setAttribute(t,r))))}var js=Gw.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,vf=Symbol.for("react.element"),Zu=Symbol.for("react.portal"),ju=Symbol.for("react.fragment"),Mv=Symbol.for("react.strict_mode"),zy=Symbol.for("react.profiler"),Uw=Symbol.for("react.provider"),Ww=Symbol.for("react.context"),Ev=Symbol.for("react.forward_ref"),Ly=Symbol.for("react.suspense"),Ry=Symbol.for("react.suspense_list"),Tv=Symbol.for("react.memo"),Aa=Symbol.for("react.lazy");Symbol.for("react.scope");Symbol.for("react.debug_trace_mode");var Zw=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden");Symbol.for("react.cache");Symbol.for("react.tracing_marker");var Bb=Symbol.iterator;function $h(e){return e===null||typeof e!="object"?null:(e=Bb&&e[Bb]||e["@@iterator"],typeof e=="function"?e:null)}var fr=Object.assign,uy;function id(e){if(uy===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);uy=t&&t[1]||""}return`
|
|
2
|
-
`+uy+e}var cy=!1;function hy(e,t){if(!e||cy)return"";cy=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(C){var a=C}Reflect.construct(e,[],t)}else{try{t.call()}catch(C){a=C}e.call(t.prototype)}else{try{throw Error()}catch(C){a=C}e()}}catch(C){if(C&&a&&typeof C.stack=="string"){for(var u=C.stack.split(`
|
|
3
|
-
`),o=a.stack.split(`
|
|
4
|
-
`),m=u.length-1,v=o.length-1;1<=m&&0<=v&&u[m]!==o[v];)v--;for(;1<=m&&0<=v;m--,v--)if(u[m]!==o[v]){if(m!==1||v!==1)do if(m--,v--,0>v||u[m]!==o[v]){var b=`
|
|
5
|
-
`+u[m].replace(" at new "," at ");return e.displayName&&b.includes("<anonymous>")&&(b=b.replace("<anonymous>",e.displayName)),b}while(1<=m&&0<=v);break}}}finally{cy=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?id(e):""}function i4(e){switch(e.tag){case 5:return id(e.type);case 16:return id("Lazy");case 13:return id("Suspense");case 19:return id("SuspenseList");case 0:case 2:case 15:return e=hy(e.type,!1),e;case 11:return e=hy(e.type.render,!1),e;case 1:return e=hy(e.type,!0),e;default:return""}}function Dy(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 ju:return"Fragment";case Zu:return"Portal";case zy:return"Profiler";case Mv:return"StrictMode";case Ly:return"Suspense";case Ry:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ww:return(e.displayName||"Context")+".Consumer";case Uw:return(e._context.displayName||"Context")+".Provider";case Ev:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Tv:return t=e.displayName||null,t!==null?t:Dy(e.type)||"Memo";case Aa:t=e._payload,e=e._init;try{return Dy(e(t))}catch{}}return null}function r4(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 Dy(t);case 8:return t===Mv?"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 Wa(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function jw(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function n4(e){var t=jw(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),a=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var u=r.get,o=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(m){a=""+m,o.call(this,m)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return a},setValue:function(m){a=""+m},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function xf(e){e._valueTracker||(e._valueTracker=n4(e))}function Hw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),a="";return e&&(a=jw(e)?e.checked?"true":"false":e.value),e=a,e!==r?(t.setValue(e),!0):!1}function Xf(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 By(e,t){var r=t.checked;return fr({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Nb(e,t){var r=t.defaultValue==null?"":t.defaultValue,a=t.checked!=null?t.checked:t.defaultChecked;r=Wa(t.value!=null?t.value:r),e._wrapperState={initialChecked:a,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Xw(e,t){t=t.checked,t!=null&&Cv(e,"checked",t,!1)}function Ny(e,t){Xw(e,t);var r=Wa(t.value),a=t.type;if(r!=null)a==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(a==="submit"||a==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Fy(e,t.type,r):t.hasOwnProperty("defaultValue")&&Fy(e,t.type,Wa(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Fb(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var a=t.type;if(!(a!=="submit"&&a!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Fy(e,t,r){(t!=="number"||Xf(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var rd=Array.isArray;function ic(e,t,r,a){if(e=e.options,t){t={};for(var u=0;u<r.length;u++)t["$"+r[u]]=!0;for(r=0;r<e.length;r++)u=t.hasOwnProperty("$"+e[r].value),e[r].selected!==u&&(e[r].selected=u),u&&a&&(e[r].defaultSelected=!0)}else{for(r=""+Wa(r),t=null,u=0;u<e.length;u++){if(e[u].value===r){e[u].selected=!0,a&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function Oy(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(Qe(91));return fr({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Ob(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(Qe(92));if(rd(r)){if(1<r.length)throw Error(Qe(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Wa(r)}}function $w(e,t){var r=Wa(t.value),a=Wa(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),a!=null&&(e.defaultValue=""+a)}function Gb(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Yw(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Gy(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Yw(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var _f,qw=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,a,u){MSApp.execUnsafeLocalFunction(function(){return e(t,r,a,u)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(_f=_f||document.createElement("div"),_f.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=_f.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function gd(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var sd={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},o4=["Webkit","ms","Moz","O"];Object.keys(sd).forEach(function(e){o4.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),sd[t]=sd[e]})});function Jw(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||sd.hasOwnProperty(e)&&sd[e]?(""+t).trim():t+"px"}function Qw(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var a=r.indexOf("--")===0,u=Jw(r,t[r],a);r==="float"&&(r="cssFloat"),a?e.setProperty(r,u):e[r]=u}}var s4=fr({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 Vy(e,t){if(t){if(s4[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Qe(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Qe(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Qe(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Qe(62))}}function Uy(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 Wy=null;function Av(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Zy=null,rc=null,nc=null;function Vb(e){if(e=Rd(e)){if(typeof Zy!="function")throw Error(Qe(280));var t=e.stateNode;t&&(t=bm(t),Zy(e.stateNode,e.type,t))}}function Kw(e){rc?nc?nc.push(e):nc=[e]:rc=e}function e2(){if(rc){var e=rc,t=nc;if(nc=rc=null,Vb(e),t)for(e=0;e<t.length;e++)Vb(t[e])}}function t2(e,t){return e(t)}function i2(){}var dy=!1;function r2(e,t,r){if(dy)return e(t,r);dy=!0;try{return t2(e,t,r)}finally{dy=!1,(rc!==null||nc!==null)&&(i2(),e2())}}function yd(e,t){var r=e.stateNode;if(r===null)return null;var a=bm(r);if(a===null)return null;r=a[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(Qe(231,t,typeof r));return r}var jy=!1;if(Vs)try{Uu={},Object.defineProperty(Uu,"passive",{get:function(){jy=!0}}),window.addEventListener("test",Uu,Uu),window.removeEventListener("test",Uu,Uu)}catch{jy=!1}var Uu;function a4(e,t,r,a,u,o,m,v,b){var C=Array.prototype.slice.call(arguments,3);try{t.apply(r,C)}catch(T){this.onError(T)}}var ad=!1,$f=null,Yf=!1,Hy=null,l4={onError:function(e){ad=!0,$f=e}};function u4(e,t,r,a,u,o,m,v,b){ad=!1,$f=null,a4.apply(l4,arguments)}function c4(e,t,r,a,u,o,m,v,b){if(u4.apply(this,arguments),ad){if(ad){var C=$f;ad=!1,$f=null}else throw Error(Qe(198));Yf||(Yf=!0,Hy=C)}}function Gl(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function n2(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Ub(e){if(Gl(e)!==e)throw Error(Qe(188))}function h4(e){var t=e.alternate;if(!t){if(t=Gl(e),t===null)throw Error(Qe(188));return t!==e?null:e}for(var r=e,a=t;;){var u=r.return;if(u===null)break;var o=u.alternate;if(o===null){if(a=u.return,a!==null){r=a;continue}break}if(u.child===o.child){for(o=u.child;o;){if(o===r)return Ub(u),e;if(o===a)return Ub(u),t;o=o.sibling}throw Error(Qe(188))}if(r.return!==a.return)r=u,a=o;else{for(var m=!1,v=u.child;v;){if(v===r){m=!0,r=u,a=o;break}if(v===a){m=!0,a=u,r=o;break}v=v.sibling}if(!m){for(v=o.child;v;){if(v===r){m=!0,r=o,a=u;break}if(v===a){m=!0,a=o,r=u;break}v=v.sibling}if(!m)throw Error(Qe(189))}}if(r.alternate!==a)throw Error(Qe(190))}if(r.tag!==3)throw Error(Qe(188));return r.stateNode.current===r?e:t}function o2(e){return e=h4(e),e!==null?s2(e):null}function s2(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=s2(e);if(t!==null)return t;e=e.sibling}return null}var a2=po.unstable_scheduleCallback,Wb=po.unstable_cancelCallback,d4=po.unstable_shouldYield,p4=po.unstable_requestPaint,kr=po.unstable_now,f4=po.unstable_getCurrentPriorityLevel,Pv=po.unstable_ImmediatePriority,l2=po.unstable_UserBlockingPriority,qf=po.unstable_NormalPriority,m4=po.unstable_LowPriority,u2=po.unstable_IdlePriority,ym=null,ls=null;function g4(e){if(ls&&typeof ls.onCommitFiberRoot=="function")try{ls.onCommitFiberRoot(ym,e,void 0,(e.current.flags&128)===128)}catch{}}var jo=Math.clz32?Math.clz32:x4,y4=Math.log,v4=Math.LN2;function x4(e){return e>>>=0,e===0?32:31-(y4(e)/v4|0)|0}var bf=64,wf=4194304;function nd(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 Jf(e,t){var r=e.pendingLanes;if(r===0)return 0;var a=0,u=e.suspendedLanes,o=e.pingedLanes,m=r&268435455;if(m!==0){var v=m&~u;v!==0?a=nd(v):(o&=m,o!==0&&(a=nd(o)))}else m=r&~u,m!==0?a=nd(m):o!==0&&(a=nd(o));if(a===0)return 0;if(t!==0&&t!==a&&(t&u)===0&&(u=a&-a,o=t&-t,u>=o||u===16&&(o&4194240)!==0))return t;if((a&4)!==0&&(a|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=a;0<t;)r=31-jo(t),u=1<<r,a|=e[r],t&=~u;return a}function _4(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 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 t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function b4(e,t){for(var r=e.suspendedLanes,a=e.pingedLanes,u=e.expirationTimes,o=e.pendingLanes;0<o;){var m=31-jo(o),v=1<<m,b=u[m];b===-1?((v&r)===0||(v&a)!==0)&&(u[m]=_4(v,t)):b<=t&&(e.expiredLanes|=v),o&=~v}}function Xy(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function c2(){var e=bf;return bf<<=1,(bf&4194240)===0&&(bf=64),e}function py(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function zd(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-jo(t),e[t]=r}function w4(e,t){var r=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 a=e.eventTimes;for(e=e.expirationTimes;0<r;){var u=31-jo(r),o=1<<u;t[u]=0,a[u]=-1,e[u]=-1,r&=~o}}function kv(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var a=31-jo(r),u=1<<a;u&t|e[a]&t&&(e[a]|=t),r&=~u}}var Di=0;function h2(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var d2,zv,p2,f2,m2,$y=!1,If=[],Da=null,Ba=null,Na=null,vd=new Map,xd=new Map,ka=[],I4="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Zb(e,t){switch(e){case"focusin":case"focusout":Da=null;break;case"dragenter":case"dragleave":Ba=null;break;case"mouseover":case"mouseout":Na=null;break;case"pointerover":case"pointerout":vd.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":xd.delete(t.pointerId)}}function Yh(e,t,r,a,u,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:r,eventSystemFlags:a,nativeEvent:o,targetContainers:[u]},t!==null&&(t=Rd(t),t!==null&&zv(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function S4(e,t,r,a,u){switch(t){case"focusin":return Da=Yh(Da,e,t,r,a,u),!0;case"dragenter":return Ba=Yh(Ba,e,t,r,a,u),!0;case"mouseover":return Na=Yh(Na,e,t,r,a,u),!0;case"pointerover":var o=u.pointerId;return vd.set(o,Yh(vd.get(o)||null,e,t,r,a,u)),!0;case"gotpointercapture":return o=u.pointerId,xd.set(o,Yh(xd.get(o)||null,e,t,r,a,u)),!0}return!1}function g2(e){var t=Al(e.target);if(t!==null){var r=Gl(t);if(r!==null){if(t=r.tag,t===13){if(t=n2(r),t!==null){e.blockedOn=t,m2(e.priority,function(){p2(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Nf(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Yy(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var a=new r.constructor(r.type,r);Wy=a,r.target.dispatchEvent(a),Wy=null}else return t=Rd(r),t!==null&&zv(t),e.blockedOn=r,!1;t.shift()}return!0}function jb(e,t,r){Nf(e)&&r.delete(t)}function C4(){$y=!1,Da!==null&&Nf(Da)&&(Da=null),Ba!==null&&Nf(Ba)&&(Ba=null),Na!==null&&Nf(Na)&&(Na=null),vd.forEach(jb),xd.forEach(jb)}function qh(e,t){e.blockedOn===t&&(e.blockedOn=null,$y||($y=!0,po.unstable_scheduleCallback(po.unstable_NormalPriority,C4)))}function _d(e){function t(u){return qh(u,e)}if(0<If.length){qh(If[0],e);for(var r=1;r<If.length;r++){var a=If[r];a.blockedOn===e&&(a.blockedOn=null)}}for(Da!==null&&qh(Da,e),Ba!==null&&qh(Ba,e),Na!==null&&qh(Na,e),vd.forEach(t),xd.forEach(t),r=0;r<ka.length;r++)a=ka[r],a.blockedOn===e&&(a.blockedOn=null);for(;0<ka.length&&(r=ka[0],r.blockedOn===null);)g2(r),r.blockedOn===null&&ka.shift()}var oc=js.ReactCurrentBatchConfig,Qf=!0;function M4(e,t,r,a){var u=Di,o=oc.transition;oc.transition=null;try{Di=1,Lv(e,t,r,a)}finally{Di=u,oc.transition=o}}function E4(e,t,r,a){var u=Di,o=oc.transition;oc.transition=null;try{Di=4,Lv(e,t,r,a)}finally{Di=u,oc.transition=o}}function Lv(e,t,r,a){if(Qf){var u=Yy(e,t,r,a);if(u===null)_y(e,t,a,Kf,r),Zb(e,a);else if(S4(u,e,t,r,a))a.stopPropagation();else if(Zb(e,a),t&4&&-1<I4.indexOf(e)){for(;u!==null;){var o=Rd(u);if(o!==null&&d2(o),o=Yy(e,t,r,a),o===null&&_y(e,t,a,Kf,r),o===u)break;u=o}u!==null&&a.stopPropagation()}else _y(e,t,a,null,r)}}var Kf=null;function Yy(e,t,r,a){if(Kf=null,e=Av(a),e=Al(e),e!==null)if(t=Gl(e),t===null)e=null;else if(r=t.tag,r===13){if(e=n2(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Kf=e,null}function y2(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(f4()){case Pv:return 1;case l2:return 4;case qf:case m4:return 16;case u2:return 536870912;default:return 16}default:return 16}}var La=null,Rv=null,Ff=null;function v2(){if(Ff)return Ff;var e,t=Rv,r=t.length,a,u="value"in La?La.value:La.textContent,o=u.length;for(e=0;e<r&&t[e]===u[e];e++);var m=r-e;for(a=1;a<=m&&t[r-a]===u[o-a];a++);return Ff=u.slice(e,1<a?1-a:void 0)}function Of(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Sf(){return!0}function Hb(){return!1}function fo(e){function t(r,a,u,o,m){this._reactName=r,this._targetInst=u,this.type=a,this.nativeEvent=o,this.target=m,this.currentTarget=null;for(var v in e)e.hasOwnProperty(v)&&(r=e[v],this[v]=r?r(o):o[v]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Sf:Hb,this.isPropagationStopped=Hb,this}return fr(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Sf)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Sf)},persist:function(){},isPersistent:Sf}),t}var mc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Dv=fo(mc),Ld=fr({},mc,{view:0,detail:0}),T4=fo(Ld),fy,my,Jh,vm=fr({},Ld,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Bv,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Jh&&(Jh&&e.type==="mousemove"?(fy=e.screenX-Jh.screenX,my=e.screenY-Jh.screenY):my=fy=0,Jh=e),fy)},movementY:function(e){return"movementY"in e?e.movementY:my}}),Xb=fo(vm),A4=fr({},vm,{dataTransfer:0}),P4=fo(A4),k4=fr({},Ld,{relatedTarget:0}),gy=fo(k4),z4=fr({},mc,{animationName:0,elapsedTime:0,pseudoElement:0}),L4=fo(z4),R4=fr({},mc,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),D4=fo(R4),B4=fr({},mc,{data:0}),$b=fo(B4),N4={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},F4={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},O4={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function G4(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=O4[e])?!!t[e]:!1}function Bv(){return G4}var V4=fr({},Ld,{key:function(e){if(e.key){var t=N4[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Of(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?F4[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Bv,charCode:function(e){return e.type==="keypress"?Of(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Of(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),U4=fo(V4),W4=fr({},vm,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Yb=fo(W4),Z4=fr({},Ld,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bv}),j4=fo(Z4),H4=fr({},mc,{propertyName:0,elapsedTime:0,pseudoElement:0}),X4=fo(H4),$4=fr({},vm,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Y4=fo($4),q4=[9,13,27,32],Nv=Vs&&"CompositionEvent"in window,ld=null;Vs&&"documentMode"in document&&(ld=document.documentMode);var J4=Vs&&"TextEvent"in window&&!ld,x2=Vs&&(!Nv||ld&&8<ld&&11>=ld),qb=String.fromCharCode(32),Jb=!1;function _2(e,t){switch(e){case"keyup":return q4.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function b2(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Hu=!1;function Q4(e,t){switch(e){case"compositionend":return b2(t);case"keypress":return t.which!==32?null:(Jb=!0,qb);case"textInput":return e=t.data,e===qb&&Jb?null:e;default:return null}}function K4(e,t){if(Hu)return e==="compositionend"||!Nv&&_2(e,t)?(e=v2(),Ff=Rv=La=null,Hu=!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.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return x2&&t.locale!=="ko"?null:t.data;default:return null}}var eP={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Qb(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!eP[e.type]:t==="textarea"}function w2(e,t,r,a){Kw(a),t=em(t,"onChange"),0<t.length&&(r=new Dv("onChange","change",null,r,a),e.push({event:r,listeners:t}))}var ud=null,bd=null;function tP(e){L2(e,0)}function xm(e){var t=Yu(e);if(Hw(t))return e}function iP(e,t){if(e==="change")return t}var I2=!1;Vs&&(Vs?(Mf="oninput"in document,Mf||(yy=document.createElement("div"),yy.setAttribute("oninput","return;"),Mf=typeof yy.oninput=="function"),Cf=Mf):Cf=!1,I2=Cf&&(!document.documentMode||9<document.documentMode));var Cf,Mf,yy;function Kb(){ud&&(ud.detachEvent("onpropertychange",S2),bd=ud=null)}function S2(e){if(e.propertyName==="value"&&xm(bd)){var t=[];w2(t,bd,e,Av(e)),r2(tP,t)}}function rP(e,t,r){e==="focusin"?(Kb(),ud=t,bd=r,ud.attachEvent("onpropertychange",S2)):e==="focusout"&&Kb()}function nP(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return xm(bd)}function oP(e,t){if(e==="click")return xm(t)}function sP(e,t){if(e==="input"||e==="change")return xm(t)}function aP(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Xo=typeof Object.is=="function"?Object.is:aP;function wd(e,t){if(Xo(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;for(a=0;a<r.length;a++){var u=r[a];if(!ky.call(t,u)||!Xo(e[u],t[u]))return!1}return!0}function ew(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function tw(e,t){var r=ew(e);e=0;for(var a;r;){if(r.nodeType===3){if(a=e+r.textContent.length,e<=t&&a>=t)return{node:r,offset:t-e};e=a}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=ew(r)}}function C2(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?C2(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function M2(){for(var e=window,t=Xf();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Xf(e.document)}return t}function Fv(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 lP(e){var t=M2(),r=e.focusedElem,a=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&C2(r.ownerDocument.documentElement,r)){if(a!==null&&Fv(r)){if(t=a.start,e=a.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var u=r.textContent.length,o=Math.min(a.start,u);a=a.end===void 0?o:Math.min(a.end,u),!e.extend&&o>a&&(u=a,a=o,o=u),u=tw(r,o);var m=tw(r,a);u&&m&&(e.rangeCount!==1||e.anchorNode!==u.node||e.anchorOffset!==u.offset||e.focusNode!==m.node||e.focusOffset!==m.offset)&&(t=t.createRange(),t.setStart(u.node,u.offset),e.removeAllRanges(),o>a?(e.addRange(t),e.extend(m.node,m.offset)):(t.setEnd(m.node,m.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var uP=Vs&&"documentMode"in document&&11>=document.documentMode,Xu=null,qy=null,cd=null,Jy=!1;function iw(e,t,r){var a=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Jy||Xu==null||Xu!==Xf(a)||(a=Xu,"selectionStart"in a&&Fv(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),cd&&wd(cd,a)||(cd=a,a=em(qy,"onSelect"),0<a.length&&(t=new Dv("onSelect","select",null,t,r),e.push({event:t,listeners:a}),t.target=Xu)))}function Ef(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var $u={animationend:Ef("Animation","AnimationEnd"),animationiteration:Ef("Animation","AnimationIteration"),animationstart:Ef("Animation","AnimationStart"),transitionend:Ef("Transition","TransitionEnd")},vy={},E2={};Vs&&(E2=document.createElement("div").style,"AnimationEvent"in window||(delete $u.animationend.animation,delete $u.animationiteration.animation,delete $u.animationstart.animation),"TransitionEvent"in window||delete $u.transitionend.transition);function _m(e){if(vy[e])return vy[e];if(!$u[e])return e;var t=$u[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in E2)return vy[e]=t[r];return e}var T2=_m("animationend"),A2=_m("animationiteration"),P2=_m("animationstart"),k2=_m("transitionend"),z2=new Map,rw="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function ja(e,t){z2.set(e,t),Ol(t,[e])}for(Tf=0;Tf<rw.length;Tf++)Af=rw[Tf],nw=Af.toLowerCase(),ow=Af[0].toUpperCase()+Af.slice(1),ja(nw,"on"+ow);var Af,nw,ow,Tf;ja(T2,"onAnimationEnd");ja(A2,"onAnimationIteration");ja(P2,"onAnimationStart");ja("dblclick","onDoubleClick");ja("focusin","onFocus");ja("focusout","onBlur");ja(k2,"onTransitionEnd");lc("onMouseEnter",["mouseout","mouseover"]);lc("onMouseLeave",["mouseout","mouseover"]);lc("onPointerEnter",["pointerout","pointerover"]);lc("onPointerLeave",["pointerout","pointerover"]);Ol("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ol("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ol("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ol("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ol("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ol("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var od="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),cP=new Set("cancel close invalid load scroll toggle".split(" ").concat(od));function sw(e,t,r){var a=e.type||"unknown-event";e.currentTarget=r,c4(a,t,void 0,e),e.currentTarget=null}function L2(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var a=e[r],u=a.event;a=a.listeners;e:{var o=void 0;if(t)for(var m=a.length-1;0<=m;m--){var v=a[m],b=v.instance,C=v.currentTarget;if(v=v.listener,b!==o&&u.isPropagationStopped())break e;sw(u,v,C),o=b}else for(m=0;m<a.length;m++){if(v=a[m],b=v.instance,C=v.currentTarget,v=v.listener,b!==o&&u.isPropagationStopped())break e;sw(u,v,C),o=b}}}if(Yf)throw e=Hy,Yf=!1,Hy=null,e}function Ki(e,t){var r=t[iv];r===void 0&&(r=t[iv]=new Set);var a=e+"__bubble";r.has(a)||(R2(t,e,2,!1),r.add(a))}function xy(e,t,r){var a=0;t&&(a|=4),R2(r,e,a,t)}var Pf="_reactListening"+Math.random().toString(36).slice(2);function Id(e){if(!e[Pf]){e[Pf]=!0,Vw.forEach(function(r){r!=="selectionchange"&&(cP.has(r)||xy(r,!1,e),xy(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Pf]||(t[Pf]=!0,xy("selectionchange",!1,t))}}function R2(e,t,r,a){switch(y2(t)){case 1:var u=M4;break;case 4:u=E4;break;default:u=Lv}r=u.bind(null,t,r,e),u=void 0,!jy||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),a?u!==void 0?e.addEventListener(t,r,{capture:!0,passive:u}):e.addEventListener(t,r,!0):u!==void 0?e.addEventListener(t,r,{passive:u}):e.addEventListener(t,r,!1)}function _y(e,t,r,a,u){var o=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var m=a.tag;if(m===3||m===4){var v=a.stateNode.containerInfo;if(v===u||v.nodeType===8&&v.parentNode===u)break;if(m===4)for(m=a.return;m!==null;){var b=m.tag;if((b===3||b===4)&&(b=m.stateNode.containerInfo,b===u||b.nodeType===8&&b.parentNode===u))return;m=m.return}for(;v!==null;){if(m=Al(v),m===null)return;if(b=m.tag,b===5||b===6){a=o=m;continue e}v=v.parentNode}}a=a.return}r2(function(){var C=o,T=Av(r),B=[];e:{var W=z2.get(e);if(W!==void 0){var q=Dv,ee=e;switch(e){case"keypress":if(Of(r)===0)break e;case"keydown":case"keyup":q=U4;break;case"focusin":ee="focus",q=gy;break;case"focusout":ee="blur",q=gy;break;case"beforeblur":case"afterblur":q=gy;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":q=Xb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":q=P4;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":q=j4;break;case T2:case A2:case P2:q=L4;break;case k2:q=X4;break;case"scroll":q=T4;break;case"wheel":q=Y4;break;case"copy":case"cut":case"paste":q=D4;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":q=Yb}var le=(t&4)!==0,de=!le&&e==="scroll",H=le?W!==null?W+"Capture":null:W;le=[];for(var Q=C,te;Q!==null;){te=Q;var ve=te.stateNode;if(te.tag===5&&ve!==null&&(te=ve,H!==null&&(ve=yd(Q,H),ve!=null&&le.push(Sd(Q,ve,te)))),de)break;Q=Q.return}0<le.length&&(W=new q(W,ee,null,r,T),B.push({event:W,listeners:le}))}}if((t&7)===0){e:{if(W=e==="mouseover"||e==="pointerover",q=e==="mouseout"||e==="pointerout",W&&r!==Wy&&(ee=r.relatedTarget||r.fromElement)&&(Al(ee)||ee[Us]))break e;if((q||W)&&(W=T.window===T?T:(W=T.ownerDocument)?W.defaultView||W.parentWindow:window,q?(ee=r.relatedTarget||r.toElement,q=C,ee=ee?Al(ee):null,ee!==null&&(de=Gl(ee),ee!==de||ee.tag!==5&&ee.tag!==6)&&(ee=null)):(q=null,ee=C),q!==ee)){if(le=Xb,ve="onMouseLeave",H="onMouseEnter",Q="mouse",(e==="pointerout"||e==="pointerover")&&(le=Yb,ve="onPointerLeave",H="onPointerEnter",Q="pointer"),de=q==null?W:Yu(q),te=ee==null?W:Yu(ee),W=new le(ve,Q+"leave",q,r,T),W.target=de,W.relatedTarget=te,ve=null,Al(T)===C&&(le=new le(H,Q+"enter",ee,r,T),le.target=te,le.relatedTarget=de,ve=le),de=ve,q&&ee)t:{for(le=q,H=ee,Q=0,te=le;te;te=Wu(te))Q++;for(te=0,ve=H;ve;ve=Wu(ve))te++;for(;0<Q-te;)le=Wu(le),Q--;for(;0<te-Q;)H=Wu(H),te--;for(;Q--;){if(le===H||H!==null&&le===H.alternate)break t;le=Wu(le),H=Wu(H)}le=null}else le=null;q!==null&&aw(B,W,q,le,!1),ee!==null&&de!==null&&aw(B,de,ee,le,!0)}}e:{if(W=C?Yu(C):window,q=W.nodeName&&W.nodeName.toLowerCase(),q==="select"||q==="input"&&W.type==="file")var Me=iP;else if(Qb(W))if(I2)Me=sP;else{Me=nP;var Ce=rP}else(q=W.nodeName)&&q.toLowerCase()==="input"&&(W.type==="checkbox"||W.type==="radio")&&(Me=oP);if(Me&&(Me=Me(e,C))){w2(B,Me,r,T);break e}Ce&&Ce(e,W,C),e==="focusout"&&(Ce=W._wrapperState)&&Ce.controlled&&W.type==="number"&&Fy(W,"number",W.value)}switch(Ce=C?Yu(C):window,e){case"focusin":(Qb(Ce)||Ce.contentEditable==="true")&&(Xu=Ce,qy=C,cd=null);break;case"focusout":cd=qy=Xu=null;break;case"mousedown":Jy=!0;break;case"contextmenu":case"mouseup":case"dragend":Jy=!1,iw(B,r,T);break;case"selectionchange":if(uP)break;case"keydown":case"keyup":iw(B,r,T)}var Be;if(Nv)e:{switch(e){case"compositionstart":var Fe="onCompositionStart";break e;case"compositionend":Fe="onCompositionEnd";break e;case"compositionupdate":Fe="onCompositionUpdate";break e}Fe=void 0}else Hu?_2(e,r)&&(Fe="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(Fe="onCompositionStart");Fe&&(x2&&r.locale!=="ko"&&(Hu||Fe!=="onCompositionStart"?Fe==="onCompositionEnd"&&Hu&&(Be=v2()):(La=T,Rv="value"in La?La.value:La.textContent,Hu=!0)),Ce=em(C,Fe),0<Ce.length&&(Fe=new $b(Fe,e,null,r,T),B.push({event:Fe,listeners:Ce}),Be?Fe.data=Be:(Be=b2(r),Be!==null&&(Fe.data=Be)))),(Be=J4?Q4(e,r):K4(e,r))&&(C=em(C,"onBeforeInput"),0<C.length&&(T=new $b("onBeforeInput","beforeinput",null,r,T),B.push({event:T,listeners:C}),T.data=Be))}L2(B,t)})}function Sd(e,t,r){return{instance:e,listener:t,currentTarget:r}}function em(e,t){for(var r=t+"Capture",a=[];e!==null;){var u=e,o=u.stateNode;u.tag===5&&o!==null&&(u=o,o=yd(e,r),o!=null&&a.unshift(Sd(e,o,u)),o=yd(e,t),o!=null&&a.push(Sd(e,o,u))),e=e.return}return a}function Wu(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function aw(e,t,r,a,u){for(var o=t._reactName,m=[];r!==null&&r!==a;){var v=r,b=v.alternate,C=v.stateNode;if(b!==null&&b===a)break;v.tag===5&&C!==null&&(v=C,u?(b=yd(r,o),b!=null&&m.unshift(Sd(r,b,v))):u||(b=yd(r,o),b!=null&&m.push(Sd(r,b,v)))),r=r.return}m.length!==0&&e.push({event:t,listeners:m})}var hP=/\r\n?/g,dP=/\u0000|\uFFFD/g;function lw(e){return(typeof e=="string"?e:""+e).replace(hP,`
|
|
6
|
-
`).replace(dP,"")}function kf(e,t,r){if(t=lw(t),lw(e)!==t&&r)throw Error(Qe(425))}function tm(){}var Qy=null,Ky=null;function ev(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var tv=typeof setTimeout=="function"?setTimeout:void 0,pP=typeof clearTimeout=="function"?clearTimeout:void 0,uw=typeof Promise=="function"?Promise:void 0,fP=typeof queueMicrotask=="function"?queueMicrotask:typeof uw<"u"?function(e){return uw.resolve(null).then(e).catch(mP)}:tv;function mP(e){setTimeout(function(){throw e})}function by(e,t){var r=t,a=0;do{var u=r.nextSibling;if(e.removeChild(r),u&&u.nodeType===8)if(r=u.data,r==="/$"){if(a===0){e.removeChild(u),_d(t);return}a--}else r!=="$"&&r!=="$?"&&r!=="$!"||a++;r=u}while(r);_d(t)}function Fa(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function cw(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var gc=Math.random().toString(36).slice(2),as="__reactFiber$"+gc,Cd="__reactProps$"+gc,Us="__reactContainer$"+gc,iv="__reactEvents$"+gc,gP="__reactListeners$"+gc,yP="__reactHandles$"+gc;function Al(e){var t=e[as];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Us]||r[as]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=cw(e);e!==null;){if(r=e[as])return r;e=cw(e)}return t}e=r,r=e.parentNode}return null}function Rd(e){return e=e[as]||e[Us],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Yu(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(Qe(33))}function bm(e){return e[Cd]||null}var rv=[],qu=-1;function Ha(e){return{current:e}}function er(e){0>qu||(e.current=rv[qu],rv[qu]=null,qu--)}function qi(e,t){qu++,rv[qu]=e.current,e.current=t}var Za={},bn=Ha(Za),qn=Ha(!1),Rl=Za;function uc(e,t){var r=e.type.contextTypes;if(!r)return Za;var a=e.stateNode;if(a&&a.__reactInternalMemoizedUnmaskedChildContext===t)return a.__reactInternalMemoizedMaskedChildContext;var u={},o;for(o in r)u[o]=t[o];return a&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=u),u}function Jn(e){return e=e.childContextTypes,e!=null}function im(){er(qn),er(bn)}function hw(e,t,r){if(bn.current!==Za)throw Error(Qe(168));qi(bn,t),qi(qn,r)}function D2(e,t,r){var a=e.stateNode;if(t=t.childContextTypes,typeof a.getChildContext!="function")return r;a=a.getChildContext();for(var u in a)if(!(u in t))throw Error(Qe(108,r4(e)||"Unknown",u));return fr({},r,a)}function rm(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Za,Rl=bn.current,qi(bn,e),qi(qn,qn.current),!0}function dw(e,t,r){var a=e.stateNode;if(!a)throw Error(Qe(169));r?(e=D2(e,t,Rl),a.__reactInternalMemoizedMergedChildContext=e,er(qn),er(bn),qi(bn,e)):er(qn),qi(qn,r)}var Ns=null,wm=!1,wy=!1;function B2(e){Ns===null?Ns=[e]:Ns.push(e)}function vP(e){wm=!0,B2(e)}function Xa(){if(!wy&&Ns!==null){wy=!0;var e=0,t=Di;try{var r=Ns;for(Di=1;e<r.length;e++){var a=r[e];do a=a(!0);while(a!==null)}Ns=null,wm=!1}catch(u){throw Ns!==null&&(Ns=Ns.slice(e+1)),a2(Pv,Xa),u}finally{Di=t,wy=!1}}return null}var Ju=[],Qu=0,nm=null,om=0,To=[],Ao=0,Dl=null,Fs=1,Os="";function El(e,t){Ju[Qu++]=om,Ju[Qu++]=nm,nm=e,om=t}function N2(e,t,r){To[Ao++]=Fs,To[Ao++]=Os,To[Ao++]=Dl,Dl=e;var a=Fs;e=Os;var u=32-jo(a)-1;a&=~(1<<u),r+=1;var o=32-jo(t)+u;if(30<o){var m=u-u%5;o=(a&(1<<m)-1).toString(32),a>>=m,u-=m,Fs=1<<32-jo(t)+u|r<<u|a,Os=o+e}else Fs=1<<o|r<<u|a,Os=e}function Ov(e){e.return!==null&&(El(e,1),N2(e,1,0))}function Gv(e){for(;e===nm;)nm=Ju[--Qu],Ju[Qu]=null,om=Ju[--Qu],Ju[Qu]=null;for(;e===Dl;)Dl=To[--Ao],To[Ao]=null,Os=To[--Ao],To[Ao]=null,Fs=To[--Ao],To[Ao]=null}var ho=null,co=null,ar=!1,Zo=null;function F2(e,t){var r=Po(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function pw(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,ho=e,co=Fa(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ho=e,co=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Dl!==null?{id:Fs,overflow:Os}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=Po(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,ho=e,co=null,!0):!1;default:return!1}}function nv(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ov(e){if(ar){var t=co;if(t){var r=t;if(!pw(e,t)){if(nv(e))throw Error(Qe(418));t=Fa(r.nextSibling);var a=ho;t&&pw(e,t)?F2(a,r):(e.flags=e.flags&-4097|2,ar=!1,ho=e)}}else{if(nv(e))throw Error(Qe(418));e.flags=e.flags&-4097|2,ar=!1,ho=e}}}function fw(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ho=e}function zf(e){if(e!==ho)return!1;if(!ar)return fw(e),ar=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!ev(e.type,e.memoizedProps)),t&&(t=co)){if(nv(e))throw O2(),Error(Qe(418));for(;t;)F2(e,t),t=Fa(t.nextSibling)}if(fw(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Qe(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){co=Fa(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}co=null}}else co=ho?Fa(e.stateNode.nextSibling):null;return!0}function O2(){for(var e=co;e;)e=Fa(e.nextSibling)}function cc(){co=ho=null,ar=!1}function Vv(e){Zo===null?Zo=[e]:Zo.push(e)}var xP=js.ReactCurrentBatchConfig;function Uo(e,t){if(e&&e.defaultProps){t=fr({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}var sm=Ha(null),am=null,Ku=null,Uv=null;function Wv(){Uv=Ku=am=null}function Zv(e){var t=sm.current;er(sm),e._currentValue=t}function sv(e,t,r){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===r)break;e=e.return}}function sc(e,t){am=e,Uv=Ku=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Yn=!0),e.firstContext=null)}function zo(e){var t=e._currentValue;if(Uv!==e)if(e={context:e,memoizedValue:t,next:null},Ku===null){if(am===null)throw Error(Qe(308));Ku=e,am.dependencies={lanes:0,firstContext:e}}else Ku=Ku.next=e;return t}var Pl=null;function jv(e){Pl===null?Pl=[e]:Pl.push(e)}function G2(e,t,r,a){var u=t.interleaved;return u===null?(r.next=r,jv(t)):(r.next=u.next,u.next=r),t.interleaved=r,Ws(e,a)}function Ws(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Pa=!1;function Hv(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function V2(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 Gs(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Oa(e,t,r){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(wi&2)!==0){var u=a.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),a.pending=t,Ws(e,r)}return u=a.interleaved,u===null?(t.next=t,jv(a)):(t.next=u.next,u.next=t),a.interleaved=t,Ws(e,r)}function Gf(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var a=t.lanes;a&=e.pendingLanes,r|=a,t.lanes=r,kv(e,r)}}function mw(e,t){var r=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,r===a)){var u=null,o=null;if(r=r.firstBaseUpdate,r!==null){do{var m={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};o===null?u=o=m:o=o.next=m,r=r.next}while(r!==null);o===null?u=o=t:o=o.next=t}else u=o=t;r={baseState:a.baseState,firstBaseUpdate:u,lastBaseUpdate:o,shared:a.shared,effects:a.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function lm(e,t,r,a){var u=e.updateQueue;Pa=!1;var o=u.firstBaseUpdate,m=u.lastBaseUpdate,v=u.shared.pending;if(v!==null){u.shared.pending=null;var b=v,C=b.next;b.next=null,m===null?o=C:m.next=C,m=b;var T=e.alternate;T!==null&&(T=T.updateQueue,v=T.lastBaseUpdate,v!==m&&(v===null?T.firstBaseUpdate=C:v.next=C,T.lastBaseUpdate=b))}if(o!==null){var B=u.baseState;m=0,T=C=b=null,v=o;do{var W=v.lane,q=v.eventTime;if((a&W)===W){T!==null&&(T=T.next={eventTime:q,lane:0,tag:v.tag,payload:v.payload,callback:v.callback,next:null});e:{var ee=e,le=v;switch(W=t,q=r,le.tag){case 1:if(ee=le.payload,typeof ee=="function"){B=ee.call(q,B,W);break e}B=ee;break e;case 3:ee.flags=ee.flags&-65537|128;case 0:if(ee=le.payload,W=typeof ee=="function"?ee.call(q,B,W):ee,W==null)break e;B=fr({},B,W);break e;case 2:Pa=!0}}v.callback!==null&&v.lane!==0&&(e.flags|=64,W=u.effects,W===null?u.effects=[v]:W.push(v))}else q={eventTime:q,lane:W,tag:v.tag,payload:v.payload,callback:v.callback,next:null},T===null?(C=T=q,b=B):T=T.next=q,m|=W;if(v=v.next,v===null){if(v=u.shared.pending,v===null)break;W=v,v=W.next,W.next=null,u.lastBaseUpdate=W,u.shared.pending=null}}while(1);if(T===null&&(b=B),u.baseState=b,u.firstBaseUpdate=C,u.lastBaseUpdate=T,t=u.shared.interleaved,t!==null){u=t;do m|=u.lane,u=u.next;while(u!==t)}else o===null&&(u.shared.lanes=0);Nl|=m,e.lanes=m,e.memoizedState=B}}function gw(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var a=e[t],u=a.callback;if(u!==null){if(a.callback=null,a=r,typeof u!="function")throw Error(Qe(191,u));u.call(a)}}}var U2=new Gw.Component().refs;function av(e,t,r,a){t=e.memoizedState,r=r(a,t),r=r==null?t:fr({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Im={isMounted:function(e){return(e=e._reactInternals)?Gl(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var a=Nn(),u=Va(e),o=Gs(a,u);o.payload=t,r!=null&&(o.callback=r),t=Oa(e,o,u),t!==null&&(Ho(t,e,u,a),Gf(t,e,u))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var a=Nn(),u=Va(e),o=Gs(a,u);o.tag=1,o.payload=t,r!=null&&(o.callback=r),t=Oa(e,o,u),t!==null&&(Ho(t,e,u,a),Gf(t,e,u))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Nn(),a=Va(e),u=Gs(r,a);u.tag=2,t!=null&&(u.callback=t),t=Oa(e,u,a),t!==null&&(Ho(t,e,a,r),Gf(t,e,a))}};function yw(e,t,r,a,u,o,m){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,o,m):t.prototype&&t.prototype.isPureReactComponent?!wd(r,a)||!wd(u,o):!0}function W2(e,t,r){var a=!1,u=Za,o=t.contextType;return typeof o=="object"&&o!==null?o=zo(o):(u=Jn(t)?Rl:bn.current,a=t.contextTypes,o=(a=a!=null)?uc(e,u):Za),t=new t(r,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Im,e.stateNode=t,t._reactInternals=e,a&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=u,e.__reactInternalMemoizedMaskedChildContext=o),t}function vw(e,t,r,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,a),t.state!==e&&Im.enqueueReplaceState(t,t.state,null)}function lv(e,t,r,a){var u=e.stateNode;u.props=r,u.state=e.memoizedState,u.refs=U2,Hv(e);var o=t.contextType;typeof o=="object"&&o!==null?u.context=zo(o):(o=Jn(t)?Rl:bn.current,u.context=uc(e,o)),u.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(av(e,t,o,r),u.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(t=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),t!==u.state&&Im.enqueueReplaceState(u,u.state,null),lm(e,r,u,a),u.state=e.memoizedState),typeof u.componentDidMount=="function"&&(e.flags|=4194308)}function Qh(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(Qe(309));var a=r.stateNode}if(!a)throw Error(Qe(147,e));var u=a,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(m){var v=u.refs;v===U2&&(v=u.refs={}),m===null?delete v[o]:v[o]=m},t._stringRef=o,t)}if(typeof e!="string")throw Error(Qe(284));if(!r._owner)throw Error(Qe(290,e))}return e}function Lf(e,t){throw e=Object.prototype.toString.call(t),Error(Qe(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function xw(e){var t=e._init;return t(e._payload)}function Z2(e){function t(H,Q){if(e){var te=H.deletions;te===null?(H.deletions=[Q],H.flags|=16):te.push(Q)}}function r(H,Q){if(!e)return null;for(;Q!==null;)t(H,Q),Q=Q.sibling;return null}function a(H,Q){for(H=new Map;Q!==null;)Q.key!==null?H.set(Q.key,Q):H.set(Q.index,Q),Q=Q.sibling;return H}function u(H,Q){return H=Ua(H,Q),H.index=0,H.sibling=null,H}function o(H,Q,te){return H.index=te,e?(te=H.alternate,te!==null?(te=te.index,te<Q?(H.flags|=2,Q):te):(H.flags|=2,Q)):(H.flags|=1048576,Q)}function m(H){return e&&H.alternate===null&&(H.flags|=2),H}function v(H,Q,te,ve){return Q===null||Q.tag!==6?(Q=Ay(te,H.mode,ve),Q.return=H,Q):(Q=u(Q,te),Q.return=H,Q)}function b(H,Q,te,ve){var Me=te.type;return Me===ju?T(H,Q,te.props.children,ve,te.key):Q!==null&&(Q.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===Aa&&xw(Me)===Q.type)?(ve=u(Q,te.props),ve.ref=Qh(H,Q,te),ve.return=H,ve):(ve=Hf(te.type,te.key,te.props,null,H.mode,ve),ve.ref=Qh(H,Q,te),ve.return=H,ve)}function C(H,Q,te,ve){return Q===null||Q.tag!==4||Q.stateNode.containerInfo!==te.containerInfo||Q.stateNode.implementation!==te.implementation?(Q=Py(te,H.mode,ve),Q.return=H,Q):(Q=u(Q,te.children||[]),Q.return=H,Q)}function T(H,Q,te,ve,Me){return Q===null||Q.tag!==7?(Q=Ll(te,H.mode,ve,Me),Q.return=H,Q):(Q=u(Q,te),Q.return=H,Q)}function B(H,Q,te){if(typeof Q=="string"&&Q!==""||typeof Q=="number")return Q=Ay(""+Q,H.mode,te),Q.return=H,Q;if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case vf:return te=Hf(Q.type,Q.key,Q.props,null,H.mode,te),te.ref=Qh(H,null,Q),te.return=H,te;case Zu:return Q=Py(Q,H.mode,te),Q.return=H,Q;case Aa:var ve=Q._init;return B(H,ve(Q._payload),te)}if(rd(Q)||$h(Q))return Q=Ll(Q,H.mode,te,null),Q.return=H,Q;Lf(H,Q)}return null}function W(H,Q,te,ve){var Me=Q!==null?Q.key:null;if(typeof te=="string"&&te!==""||typeof te=="number")return Me!==null?null:v(H,Q,""+te,ve);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case vf:return te.key===Me?b(H,Q,te,ve):null;case Zu:return te.key===Me?C(H,Q,te,ve):null;case Aa:return Me=te._init,W(H,Q,Me(te._payload),ve)}if(rd(te)||$h(te))return Me!==null?null:T(H,Q,te,ve,null);Lf(H,te)}return null}function q(H,Q,te,ve,Me){if(typeof ve=="string"&&ve!==""||typeof ve=="number")return H=H.get(te)||null,v(Q,H,""+ve,Me);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case vf:return H=H.get(ve.key===null?te:ve.key)||null,b(Q,H,ve,Me);case Zu:return H=H.get(ve.key===null?te:ve.key)||null,C(Q,H,ve,Me);case Aa:var Ce=ve._init;return q(H,Q,te,Ce(ve._payload),Me)}if(rd(ve)||$h(ve))return H=H.get(te)||null,T(Q,H,ve,Me,null);Lf(Q,ve)}return null}function ee(H,Q,te,ve){for(var Me=null,Ce=null,Be=Q,Fe=Q=0,qe=null;Be!==null&&Fe<te.length;Fe++){Be.index>Fe?(qe=Be,Be=null):qe=Be.sibling;var ht=W(H,Be,te[Fe],ve);if(ht===null){Be===null&&(Be=qe);break}e&&Be&&ht.alternate===null&&t(H,Be),Q=o(ht,Q,Fe),Ce===null?Me=ht:Ce.sibling=ht,Ce=ht,Be=qe}if(Fe===te.length)return r(H,Be),ar&&El(H,Fe),Me;if(Be===null){for(;Fe<te.length;Fe++)Be=B(H,te[Fe],ve),Be!==null&&(Q=o(Be,Q,Fe),Ce===null?Me=Be:Ce.sibling=Be,Ce=Be);return ar&&El(H,Fe),Me}for(Be=a(H,Be);Fe<te.length;Fe++)qe=q(Be,H,Fe,te[Fe],ve),qe!==null&&(e&&qe.alternate!==null&&Be.delete(qe.key===null?Fe:qe.key),Q=o(qe,Q,Fe),Ce===null?Me=qe:Ce.sibling=qe,Ce=qe);return e&&Be.forEach(function(Tt){return t(H,Tt)}),ar&&El(H,Fe),Me}function le(H,Q,te,ve){var Me=$h(te);if(typeof Me!="function")throw Error(Qe(150));if(te=Me.call(te),te==null)throw Error(Qe(151));for(var Ce=Me=null,Be=Q,Fe=Q=0,qe=null,ht=te.next();Be!==null&&!ht.done;Fe++,ht=te.next()){Be.index>Fe?(qe=Be,Be=null):qe=Be.sibling;var Tt=W(H,Be,ht.value,ve);if(Tt===null){Be===null&&(Be=qe);break}e&&Be&&Tt.alternate===null&&t(H,Be),Q=o(Tt,Q,Fe),Ce===null?Me=Tt:Ce.sibling=Tt,Ce=Tt,Be=qe}if(ht.done)return r(H,Be),ar&&El(H,Fe),Me;if(Be===null){for(;!ht.done;Fe++,ht=te.next())ht=B(H,ht.value,ve),ht!==null&&(Q=o(ht,Q,Fe),Ce===null?Me=ht:Ce.sibling=ht,Ce=ht);return ar&&El(H,Fe),Me}for(Be=a(H,Be);!ht.done;Fe++,ht=te.next())ht=q(Be,H,Fe,ht.value,ve),ht!==null&&(e&&ht.alternate!==null&&Be.delete(ht.key===null?Fe:ht.key),Q=o(ht,Q,Fe),Ce===null?Me=ht:Ce.sibling=ht,Ce=ht);return e&&Be.forEach(function(Gt){return t(H,Gt)}),ar&&El(H,Fe),Me}function de(H,Q,te,ve){if(typeof te=="object"&&te!==null&&te.type===ju&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case vf:e:{for(var Me=te.key,Ce=Q;Ce!==null;){if(Ce.key===Me){if(Me=te.type,Me===ju){if(Ce.tag===7){r(H,Ce.sibling),Q=u(Ce,te.props.children),Q.return=H,H=Q;break e}}else if(Ce.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===Aa&&xw(Me)===Ce.type){r(H,Ce.sibling),Q=u(Ce,te.props),Q.ref=Qh(H,Ce,te),Q.return=H,H=Q;break e}r(H,Ce);break}else t(H,Ce);Ce=Ce.sibling}te.type===ju?(Q=Ll(te.props.children,H.mode,ve,te.key),Q.return=H,H=Q):(ve=Hf(te.type,te.key,te.props,null,H.mode,ve),ve.ref=Qh(H,Q,te),ve.return=H,H=ve)}return m(H);case Zu:e:{for(Ce=te.key;Q!==null;){if(Q.key===Ce)if(Q.tag===4&&Q.stateNode.containerInfo===te.containerInfo&&Q.stateNode.implementation===te.implementation){r(H,Q.sibling),Q=u(Q,te.children||[]),Q.return=H,H=Q;break e}else{r(H,Q);break}else t(H,Q);Q=Q.sibling}Q=Py(te,H.mode,ve),Q.return=H,H=Q}return m(H);case Aa:return Ce=te._init,de(H,Q,Ce(te._payload),ve)}if(rd(te))return ee(H,Q,te,ve);if($h(te))return le(H,Q,te,ve);Lf(H,te)}return typeof te=="string"&&te!==""||typeof te=="number"?(te=""+te,Q!==null&&Q.tag===6?(r(H,Q.sibling),Q=u(Q,te),Q.return=H,H=Q):(r(H,Q),Q=Ay(te,H.mode,ve),Q.return=H,H=Q),m(H)):r(H,Q)}return de}var hc=Z2(!0),j2=Z2(!1),Dd={},us=Ha(Dd),Md=Ha(Dd),Ed=Ha(Dd);function kl(e){if(e===Dd)throw Error(Qe(174));return e}function Xv(e,t){switch(qi(Ed,t),qi(Md,e),qi(us,Dd),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Gy(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Gy(t,e)}er(us),qi(us,t)}function dc(){er(us),er(Md),er(Ed)}function H2(e){kl(Ed.current);var t=kl(us.current),r=Gy(t,e.type);t!==r&&(qi(Md,e),qi(us,r))}function $v(e){Md.current===e&&(er(us),er(Md))}var dr=Ha(0);function um(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Iy=[];function Yv(){for(var e=0;e<Iy.length;e++)Iy[e]._workInProgressVersionPrimary=null;Iy.length=0}var Vf=js.ReactCurrentDispatcher,Sy=js.ReactCurrentBatchConfig,Bl=0,pr=null,Vr=null,Jr=null,cm=!1,hd=!1,Td=0,_P=0;function vn(){throw Error(Qe(321))}function qv(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Xo(e[r],t[r]))return!1;return!0}function Jv(e,t,r,a,u,o){if(Bl=o,pr=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Vf.current=e===null||e.memoizedState===null?SP:CP,e=r(a,u),hd){o=0;do{if(hd=!1,Td=0,25<=o)throw Error(Qe(301));o+=1,Jr=Vr=null,t.updateQueue=null,Vf.current=MP,e=r(a,u)}while(hd)}if(Vf.current=hm,t=Vr!==null&&Vr.next!==null,Bl=0,Jr=Vr=pr=null,cm=!1,t)throw Error(Qe(300));return e}function Qv(){var e=Td!==0;return Td=0,e}function ss(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Jr===null?pr.memoizedState=Jr=e:Jr=Jr.next=e,Jr}function Lo(){if(Vr===null){var e=pr.alternate;e=e!==null?e.memoizedState:null}else e=Vr.next;var t=Jr===null?pr.memoizedState:Jr.next;if(t!==null)Jr=t,Vr=e;else{if(e===null)throw Error(Qe(310));Vr=e,e={memoizedState:Vr.memoizedState,baseState:Vr.baseState,baseQueue:Vr.baseQueue,queue:Vr.queue,next:null},Jr===null?pr.memoizedState=Jr=e:Jr=Jr.next=e}return Jr}function Ad(e,t){return typeof t=="function"?t(e):t}function Cy(e){var t=Lo(),r=t.queue;if(r===null)throw Error(Qe(311));r.lastRenderedReducer=e;var a=Vr,u=a.baseQueue,o=r.pending;if(o!==null){if(u!==null){var m=u.next;u.next=o.next,o.next=m}a.baseQueue=u=o,r.pending=null}if(u!==null){o=u.next,a=a.baseState;var v=m=null,b=null,C=o;do{var T=C.lane;if((Bl&T)===T)b!==null&&(b=b.next={lane:0,action:C.action,hasEagerState:C.hasEagerState,eagerState:C.eagerState,next:null}),a=C.hasEagerState?C.eagerState:e(a,C.action);else{var B={lane:T,action:C.action,hasEagerState:C.hasEagerState,eagerState:C.eagerState,next:null};b===null?(v=b=B,m=a):b=b.next=B,pr.lanes|=T,Nl|=T}C=C.next}while(C!==null&&C!==o);b===null?m=a:b.next=v,Xo(a,t.memoizedState)||(Yn=!0),t.memoizedState=a,t.baseState=m,t.baseQueue=b,r.lastRenderedState=a}if(e=r.interleaved,e!==null){u=e;do o=u.lane,pr.lanes|=o,Nl|=o,u=u.next;while(u!==e)}else u===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function My(e){var t=Lo(),r=t.queue;if(r===null)throw Error(Qe(311));r.lastRenderedReducer=e;var a=r.dispatch,u=r.pending,o=t.memoizedState;if(u!==null){r.pending=null;var m=u=u.next;do o=e(o,m.action),m=m.next;while(m!==u);Xo(o,t.memoizedState)||(Yn=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),r.lastRenderedState=o}return[o,a]}function X2(){}function $2(e,t){var r=pr,a=Lo(),u=t(),o=!Xo(a.memoizedState,u);if(o&&(a.memoizedState=u,Yn=!0),a=a.queue,Kv(J2.bind(null,r,a,e),[e]),a.getSnapshot!==t||o||Jr!==null&&Jr.memoizedState.tag&1){if(r.flags|=2048,Pd(9,q2.bind(null,r,a,u,t),void 0,null),Qr===null)throw Error(Qe(349));(Bl&30)!==0||Y2(r,t,u)}return u}function Y2(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=pr.updateQueue,t===null?(t={lastEffect:null,stores:null},pr.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function q2(e,t,r,a){t.value=r,t.getSnapshot=a,Q2(t)&&K2(e)}function J2(e,t,r){return r(function(){Q2(t)&&K2(e)})}function Q2(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Xo(e,r)}catch{return!0}}function K2(e){var t=Ws(e,1);t!==null&&Ho(t,e,1,-1)}function _w(e){var t=ss();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ad,lastRenderedState:e},t.queue=e,e=e.dispatch=IP.bind(null,pr,e),[t.memoizedState,e]}function Pd(e,t,r,a){return e={tag:e,create:t,destroy:r,deps:a,next:null},t=pr.updateQueue,t===null?(t={lastEffect:null,stores:null},pr.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(a=r.next,r.next=e,e.next=a,t.lastEffect=e)),e}function eI(){return Lo().memoizedState}function Uf(e,t,r,a){var u=ss();pr.flags|=e,u.memoizedState=Pd(1|t,r,void 0,a===void 0?null:a)}function Sm(e,t,r,a){var u=Lo();a=a===void 0?null:a;var o=void 0;if(Vr!==null){var m=Vr.memoizedState;if(o=m.destroy,a!==null&&qv(a,m.deps)){u.memoizedState=Pd(t,r,o,a);return}}pr.flags|=e,u.memoizedState=Pd(1|t,r,o,a)}function bw(e,t){return Uf(8390656,8,e,t)}function Kv(e,t){return Sm(2048,8,e,t)}function tI(e,t){return Sm(4,2,e,t)}function iI(e,t){return Sm(4,4,e,t)}function rI(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function nI(e,t,r){return r=r!=null?r.concat([e]):null,Sm(4,4,rI.bind(null,t,e),r)}function e1(){}function oI(e,t){var r=Lo();t=t===void 0?null:t;var a=r.memoizedState;return a!==null&&t!==null&&qv(t,a[1])?a[0]:(r.memoizedState=[e,t],e)}function sI(e,t){var r=Lo();t=t===void 0?null:t;var a=r.memoizedState;return a!==null&&t!==null&&qv(t,a[1])?a[0]:(e=e(),r.memoizedState=[e,t],e)}function aI(e,t,r){return(Bl&21)===0?(e.baseState&&(e.baseState=!1,Yn=!0),e.memoizedState=r):(Xo(r,t)||(r=c2(),pr.lanes|=r,Nl|=r,e.baseState=!0),t)}function bP(e,t){var r=Di;Di=r!==0&&4>r?r:4,e(!0);var a=Sy.transition;Sy.transition={};try{e(!1),t()}finally{Di=r,Sy.transition=a}}function lI(){return Lo().memoizedState}function wP(e,t,r){var a=Va(e);if(r={lane:a,action:r,hasEagerState:!1,eagerState:null,next:null},uI(e))cI(t,r);else if(r=G2(e,t,r,a),r!==null){var u=Nn();Ho(r,e,a,u),hI(r,t,a)}}function IP(e,t,r){var a=Va(e),u={lane:a,action:r,hasEagerState:!1,eagerState:null,next:null};if(uI(e))cI(t,u);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var m=t.lastRenderedState,v=o(m,r);if(u.hasEagerState=!0,u.eagerState=v,Xo(v,m)){var b=t.interleaved;b===null?(u.next=u,jv(t)):(u.next=b.next,b.next=u),t.interleaved=u;return}}catch{}finally{}r=G2(e,t,u,a),r!==null&&(u=Nn(),Ho(r,e,a,u),hI(r,t,a))}}function uI(e){var t=e.alternate;return e===pr||t!==null&&t===pr}function cI(e,t){hd=cm=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function hI(e,t,r){if((r&4194240)!==0){var a=t.lanes;a&=e.pendingLanes,r|=a,t.lanes=r,kv(e,r)}}var hm={readContext:zo,useCallback:vn,useContext:vn,useEffect:vn,useImperativeHandle:vn,useInsertionEffect:vn,useLayoutEffect:vn,useMemo:vn,useReducer:vn,useRef:vn,useState:vn,useDebugValue:vn,useDeferredValue:vn,useTransition:vn,useMutableSource:vn,useSyncExternalStore:vn,useId:vn,unstable_isNewReconciler:!1},SP={readContext:zo,useCallback:function(e,t){return ss().memoizedState=[e,t===void 0?null:t],e},useContext:zo,useEffect:bw,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Uf(4194308,4,rI.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Uf(4194308,4,e,t)},useInsertionEffect:function(e,t){return Uf(4,2,e,t)},useMemo:function(e,t){var r=ss();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var a=ss();return t=r!==void 0?r(t):t,a.memoizedState=a.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},a.queue=e,e=e.dispatch=wP.bind(null,pr,e),[a.memoizedState,e]},useRef:function(e){var t=ss();return e={current:e},t.memoizedState=e},useState:_w,useDebugValue:e1,useDeferredValue:function(e){return ss().memoizedState=e},useTransition:function(){var e=_w(!1),t=e[0];return e=bP.bind(null,e[1]),ss().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var a=pr,u=ss();if(ar){if(r===void 0)throw Error(Qe(407));r=r()}else{if(r=t(),Qr===null)throw Error(Qe(349));(Bl&30)!==0||Y2(a,t,r)}u.memoizedState=r;var o={value:r,getSnapshot:t};return u.queue=o,bw(J2.bind(null,a,o,e),[e]),a.flags|=2048,Pd(9,q2.bind(null,a,o,r,t),void 0,null),r},useId:function(){var e=ss(),t=Qr.identifierPrefix;if(ar){var r=Os,a=Fs;r=(a&~(1<<32-jo(a)-1)).toString(32)+r,t=":"+t+"R"+r,r=Td++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=_P++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},CP={readContext:zo,useCallback:oI,useContext:zo,useEffect:Kv,useImperativeHandle:nI,useInsertionEffect:tI,useLayoutEffect:iI,useMemo:sI,useReducer:Cy,useRef:eI,useState:function(){return Cy(Ad)},useDebugValue:e1,useDeferredValue:function(e){var t=Lo();return aI(t,Vr.memoizedState,e)},useTransition:function(){var e=Cy(Ad)[0],t=Lo().memoizedState;return[e,t]},useMutableSource:X2,useSyncExternalStore:$2,useId:lI,unstable_isNewReconciler:!1},MP={readContext:zo,useCallback:oI,useContext:zo,useEffect:Kv,useImperativeHandle:nI,useInsertionEffect:tI,useLayoutEffect:iI,useMemo:sI,useReducer:My,useRef:eI,useState:function(){return My(Ad)},useDebugValue:e1,useDeferredValue:function(e){var t=Lo();return Vr===null?t.memoizedState=e:aI(t,Vr.memoizedState,e)},useTransition:function(){var e=My(Ad)[0],t=Lo().memoizedState;return[e,t]},useMutableSource:X2,useSyncExternalStore:$2,useId:lI,unstable_isNewReconciler:!1};function pc(e,t){try{var r="",a=t;do r+=i4(a),a=a.return;while(a);var u=r}catch(o){u=`
|
|
7
|
-
Error generating stack: `+o.message+`
|
|
8
|
-
`+o.stack}return{value:e,source:t,stack:u,digest:null}}function Ey(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function uv(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var EP=typeof WeakMap=="function"?WeakMap:Map;function dI(e,t,r){r=Gs(-1,r),r.tag=3,r.payload={element:null};var a=t.value;return r.callback=function(){pm||(pm=!0,xv=a),uv(e,t)},r}function pI(e,t,r){r=Gs(-1,r),r.tag=3;var a=e.type.getDerivedStateFromError;if(typeof a=="function"){var u=t.value;r.payload=function(){return a(u)},r.callback=function(){uv(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(r.callback=function(){uv(e,t),typeof a!="function"&&(Ga===null?Ga=new Set([this]):Ga.add(this));var m=t.stack;this.componentDidCatch(t.value,{componentStack:m!==null?m:""})}),r}function ww(e,t,r){var a=e.pingCache;if(a===null){a=e.pingCache=new EP;var u=new Set;a.set(t,u)}else u=a.get(t),u===void 0&&(u=new Set,a.set(t,u));u.has(r)||(u.add(r),e=VP.bind(null,e,t,r),t.then(e,e))}function Iw(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Sw(e,t,r,a,u){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=Gs(-1,1),t.tag=2,Oa(r,t,1))),r.lanes|=1),e):(e.flags|=65536,e.lanes=u,e)}var TP=js.ReactCurrentOwner,Yn=!1;function Bn(e,t,r,a){t.child=e===null?j2(t,null,r,a):hc(t,e.child,r,a)}function Cw(e,t,r,a,u){r=r.render;var o=t.ref;return sc(t,u),a=Jv(e,t,r,a,o,u),r=Qv(),e!==null&&!Yn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~u,Zs(e,t,u)):(ar&&r&&Ov(t),t.flags|=1,Bn(e,t,a,u),t.child)}function Mw(e,t,r,a,u){if(e===null){var o=r.type;return typeof o=="function"&&!l1(o)&&o.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=o,fI(e,t,o,a,u)):(e=Hf(r.type,null,a,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,(e.lanes&u)===0){var m=o.memoizedProps;if(r=r.compare,r=r!==null?r:wd,r(m,a)&&e.ref===t.ref)return Zs(e,t,u)}return t.flags|=1,e=Ua(o,a),e.ref=t.ref,e.return=t,t.child=e}function fI(e,t,r,a,u){if(e!==null){var o=e.memoizedProps;if(wd(o,a)&&e.ref===t.ref)if(Yn=!1,t.pendingProps=a=o,(e.lanes&u)!==0)(e.flags&131072)!==0&&(Yn=!0);else return t.lanes=e.lanes,Zs(e,t,u)}return cv(e,t,r,a,u)}function mI(e,t,r){var a=t.pendingProps,u=a.children,o=e!==null?e.memoizedState:null;if(a.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},qi(tc,uo),uo|=r;else{if((r&1073741824)===0)return e=o!==null?o.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,qi(tc,uo),uo|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},a=o!==null?o.baseLanes:r,qi(tc,uo),uo|=a}else o!==null?(a=o.baseLanes|r,t.memoizedState=null):a=r,qi(tc,uo),uo|=a;return Bn(e,t,u,r),t.child}function gI(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function cv(e,t,r,a,u){var o=Jn(r)?Rl:bn.current;return o=uc(t,o),sc(t,u),r=Jv(e,t,r,a,o,u),a=Qv(),e!==null&&!Yn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~u,Zs(e,t,u)):(ar&&a&&Ov(t),t.flags|=1,Bn(e,t,r,u),t.child)}function Ew(e,t,r,a,u){if(Jn(r)){var o=!0;rm(t)}else o=!1;if(sc(t,u),t.stateNode===null)Wf(e,t),W2(t,r,a),lv(t,r,a,u),a=!0;else if(e===null){var m=t.stateNode,v=t.memoizedProps;m.props=v;var b=m.context,C=r.contextType;typeof C=="object"&&C!==null?C=zo(C):(C=Jn(r)?Rl:bn.current,C=uc(t,C));var T=r.getDerivedStateFromProps,B=typeof T=="function"||typeof m.getSnapshotBeforeUpdate=="function";B||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(v!==a||b!==C)&&vw(t,m,a,C),Pa=!1;var W=t.memoizedState;m.state=W,lm(t,a,m,u),b=t.memoizedState,v!==a||W!==b||qn.current||Pa?(typeof T=="function"&&(av(t,r,T,a),b=t.memoizedState),(v=Pa||yw(t,r,v,a,W,b,C))?(B||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(t.flags|=4194308)):(typeof m.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=b),m.props=a,m.state=b,m.context=C,a=v):(typeof m.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{m=t.stateNode,V2(e,t),v=t.memoizedProps,C=t.type===t.elementType?v:Uo(t.type,v),m.props=C,B=t.pendingProps,W=m.context,b=r.contextType,typeof b=="object"&&b!==null?b=zo(b):(b=Jn(r)?Rl:bn.current,b=uc(t,b));var q=r.getDerivedStateFromProps;(T=typeof q=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(v!==B||W!==b)&&vw(t,m,a,b),Pa=!1,W=t.memoizedState,m.state=W,lm(t,a,m,u);var ee=t.memoizedState;v!==B||W!==ee||qn.current||Pa?(typeof q=="function"&&(av(t,r,q,a),ee=t.memoizedState),(C=Pa||yw(t,r,C,a,W,ee,b)||!1)?(T||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(a,ee,b),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(a,ee,b)),typeof m.componentDidUpdate=="function"&&(t.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof m.componentDidUpdate!="function"||v===e.memoizedProps&&W===e.memoizedState||(t.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||v===e.memoizedProps&&W===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=ee),m.props=a,m.state=ee,m.context=b,a=C):(typeof m.componentDidUpdate!="function"||v===e.memoizedProps&&W===e.memoizedState||(t.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||v===e.memoizedProps&&W===e.memoizedState||(t.flags|=1024),a=!1)}return hv(e,t,r,a,o,u)}function hv(e,t,r,a,u,o){gI(e,t);var m=(t.flags&128)!==0;if(!a&&!m)return u&&dw(t,r,!1),Zs(e,t,o);a=t.stateNode,TP.current=t;var v=m&&typeof r.getDerivedStateFromError!="function"?null:a.render();return t.flags|=1,e!==null&&m?(t.child=hc(t,e.child,null,o),t.child=hc(t,null,v,o)):Bn(e,t,v,o),t.memoizedState=a.state,u&&dw(t,r,!0),t.child}function yI(e){var t=e.stateNode;t.pendingContext?hw(e,t.pendingContext,t.pendingContext!==t.context):t.context&&hw(e,t.context,!1),Xv(e,t.containerInfo)}function Tw(e,t,r,a,u){return cc(),Vv(u),t.flags|=256,Bn(e,t,r,a),t.child}var dv={dehydrated:null,treeContext:null,retryLane:0};function pv(e){return{baseLanes:e,cachePool:null,transitions:null}}function vI(e,t,r){var a=t.pendingProps,u=dr.current,o=!1,m=(t.flags&128)!==0,v;if((v=m)||(v=e!==null&&e.memoizedState===null?!1:(u&2)!==0),v?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(u|=1),qi(dr,u&1),e===null)return ov(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(m=a.children,e=a.fallback,o?(a=t.mode,o=t.child,m={mode:"hidden",children:m},(a&1)===0&&o!==null?(o.childLanes=0,o.pendingProps=m):o=Em(m,a,0,null),e=Ll(e,a,r,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=pv(r),t.memoizedState=dv,e):t1(t,m));if(u=e.memoizedState,u!==null&&(v=u.dehydrated,v!==null))return AP(e,t,m,a,v,u,r);if(o){o=a.fallback,m=t.mode,u=e.child,v=u.sibling;var b={mode:"hidden",children:a.children};return(m&1)===0&&t.child!==u?(a=t.child,a.childLanes=0,a.pendingProps=b,t.deletions=null):(a=Ua(u,b),a.subtreeFlags=u.subtreeFlags&14680064),v!==null?o=Ua(v,o):(o=Ll(o,m,r,null),o.flags|=2),o.return=t,a.return=t,a.sibling=o,t.child=a,a=o,o=t.child,m=e.child.memoizedState,m=m===null?pv(r):{baseLanes:m.baseLanes|r,cachePool:null,transitions:m.transitions},o.memoizedState=m,o.childLanes=e.childLanes&~r,t.memoizedState=dv,a}return o=e.child,e=o.sibling,a=Ua(o,{mode:"visible",children:a.children}),(t.mode&1)===0&&(a.lanes=r),a.return=t,a.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=a,t.memoizedState=null,a}function t1(e,t){return t=Em({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Rf(e,t,r,a){return a!==null&&Vv(a),hc(t,e.child,null,r),e=t1(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function AP(e,t,r,a,u,o,m){if(r)return t.flags&256?(t.flags&=-257,a=Ey(Error(Qe(422))),Rf(e,t,m,a)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=a.fallback,u=t.mode,a=Em({mode:"visible",children:a.children},u,0,null),o=Ll(o,u,m,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,(t.mode&1)!==0&&hc(t,e.child,null,m),t.child.memoizedState=pv(m),t.memoizedState=dv,o);if((t.mode&1)===0)return Rf(e,t,m,null);if(u.data==="$!"){if(a=u.nextSibling&&u.nextSibling.dataset,a)var v=a.dgst;return a=v,o=Error(Qe(419)),a=Ey(o,a,void 0),Rf(e,t,m,a)}if(v=(m&e.childLanes)!==0,Yn||v){if(a=Qr,a!==null){switch(m&-m){case 4:u=2;break;case 16:u=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:u=32;break;case 536870912:u=268435456;break;default:u=0}u=(u&(a.suspendedLanes|m))!==0?0:u,u!==0&&u!==o.retryLane&&(o.retryLane=u,Ws(e,u),Ho(a,e,u,-1))}return a1(),a=Ey(Error(Qe(421))),Rf(e,t,m,a)}return u.data==="$?"?(t.flags|=128,t.child=e.child,t=UP.bind(null,e),u._reactRetry=t,null):(e=o.treeContext,co=Fa(u.nextSibling),ho=t,ar=!0,Zo=null,e!==null&&(To[Ao++]=Fs,To[Ao++]=Os,To[Ao++]=Dl,Fs=e.id,Os=e.overflow,Dl=t),t=t1(t,a.children),t.flags|=4096,t)}function Aw(e,t,r){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),sv(e.return,t,r)}function Ty(e,t,r,a,u){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:r,tailMode:u}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=a,o.tail=r,o.tailMode=u)}function xI(e,t,r){var a=t.pendingProps,u=a.revealOrder,o=a.tail;if(Bn(e,t,a.children,r),a=dr.current,(a&2)!==0)a=a&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Aw(e,r,t);else if(e.tag===19)Aw(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}a&=1}if(qi(dr,a),(t.mode&1)===0)t.memoizedState=null;else switch(u){case"forwards":for(r=t.child,u=null;r!==null;)e=r.alternate,e!==null&&um(e)===null&&(u=r),r=r.sibling;r=u,r===null?(u=t.child,t.child=null):(u=r.sibling,r.sibling=null),Ty(t,!1,u,r,o);break;case"backwards":for(r=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&um(e)===null){t.child=u;break}e=u.sibling,u.sibling=r,r=u,u=e}Ty(t,!0,r,null,o);break;case"together":Ty(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Wf(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Zs(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Nl|=t.lanes,(r&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(Qe(153));if(t.child!==null){for(e=t.child,r=Ua(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Ua(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function PP(e,t,r){switch(t.tag){case 3:yI(t),cc();break;case 5:H2(t);break;case 1:Jn(t.type)&&rm(t);break;case 4:Xv(t,t.stateNode.containerInfo);break;case 10:var a=t.type._context,u=t.memoizedProps.value;qi(sm,a._currentValue),a._currentValue=u;break;case 13:if(a=t.memoizedState,a!==null)return a.dehydrated!==null?(qi(dr,dr.current&1),t.flags|=128,null):(r&t.child.childLanes)!==0?vI(e,t,r):(qi(dr,dr.current&1),e=Zs(e,t,r),e!==null?e.sibling:null);qi(dr,dr.current&1);break;case 19:if(a=(r&t.childLanes)!==0,(e.flags&128)!==0){if(a)return xI(e,t,r);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),qi(dr,dr.current),a)break;return null;case 22:case 23:return t.lanes=0,mI(e,t,r)}return Zs(e,t,r)}var _I,fv,bI,wI;_I=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};fv=function(){};bI=function(e,t,r,a){var u=e.memoizedProps;if(u!==a){e=t.stateNode,kl(us.current);var o=null;switch(r){case"input":u=By(e,u),a=By(e,a),o=[];break;case"select":u=fr({},u,{value:void 0}),a=fr({},a,{value:void 0}),o=[];break;case"textarea":u=Oy(e,u),a=Oy(e,a),o=[];break;default:typeof u.onClick!="function"&&typeof a.onClick=="function"&&(e.onclick=tm)}Vy(r,a);var m;r=null;for(C in u)if(!a.hasOwnProperty(C)&&u.hasOwnProperty(C)&&u[C]!=null)if(C==="style"){var v=u[C];for(m in v)v.hasOwnProperty(m)&&(r||(r={}),r[m]="")}else C!=="dangerouslySetInnerHTML"&&C!=="children"&&C!=="suppressContentEditableWarning"&&C!=="suppressHydrationWarning"&&C!=="autoFocus"&&(md.hasOwnProperty(C)?o||(o=[]):(o=o||[]).push(C,null));for(C in a){var b=a[C];if(v=u?.[C],a.hasOwnProperty(C)&&b!==v&&(b!=null||v!=null))if(C==="style")if(v){for(m in v)!v.hasOwnProperty(m)||b&&b.hasOwnProperty(m)||(r||(r={}),r[m]="");for(m in b)b.hasOwnProperty(m)&&v[m]!==b[m]&&(r||(r={}),r[m]=b[m])}else r||(o||(o=[]),o.push(C,r)),r=b;else C==="dangerouslySetInnerHTML"?(b=b?b.__html:void 0,v=v?v.__html:void 0,b!=null&&v!==b&&(o=o||[]).push(C,b)):C==="children"?typeof b!="string"&&typeof b!="number"||(o=o||[]).push(C,""+b):C!=="suppressContentEditableWarning"&&C!=="suppressHydrationWarning"&&(md.hasOwnProperty(C)?(b!=null&&C==="onScroll"&&Ki("scroll",e),o||v===b||(o=[])):(o=o||[]).push(C,b))}r&&(o=o||[]).push("style",r);var C=o;(t.updateQueue=C)&&(t.flags|=4)}};wI=function(e,t,r,a){r!==a&&(t.flags|=4)};function Kh(e,t){if(!ar)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var a=null;r!==null;)r.alternate!==null&&(a=r),r=r.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function xn(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,a=0;if(t)for(var u=e.child;u!==null;)r|=u.lanes|u.childLanes,a|=u.subtreeFlags&14680064,a|=u.flags&14680064,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)r|=u.lanes|u.childLanes,a|=u.subtreeFlags,a|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=a,e.childLanes=r,t}function kP(e,t,r){var a=t.pendingProps;switch(Gv(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xn(t),null;case 1:return Jn(t.type)&&im(),xn(t),null;case 3:return a=t.stateNode,dc(),er(qn),er(bn),Yv(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(zf(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Zo!==null&&(wv(Zo),Zo=null))),fv(e,t),xn(t),null;case 5:$v(t);var u=kl(Ed.current);if(r=t.type,e!==null&&t.stateNode!=null)bI(e,t,r,a,u),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!a){if(t.stateNode===null)throw Error(Qe(166));return xn(t),null}if(e=kl(us.current),zf(t)){a=t.stateNode,r=t.type;var o=t.memoizedProps;switch(a[as]=t,a[Cd]=o,e=(t.mode&1)!==0,r){case"dialog":Ki("cancel",a),Ki("close",a);break;case"iframe":case"object":case"embed":Ki("load",a);break;case"video":case"audio":for(u=0;u<od.length;u++)Ki(od[u],a);break;case"source":Ki("error",a);break;case"img":case"image":case"link":Ki("error",a),Ki("load",a);break;case"details":Ki("toggle",a);break;case"input":Nb(a,o),Ki("invalid",a);break;case"select":a._wrapperState={wasMultiple:!!o.multiple},Ki("invalid",a);break;case"textarea":Ob(a,o),Ki("invalid",a)}Vy(r,o),u=null;for(var m in o)if(o.hasOwnProperty(m)){var v=o[m];m==="children"?typeof v=="string"?a.textContent!==v&&(o.suppressHydrationWarning!==!0&&kf(a.textContent,v,e),u=["children",v]):typeof v=="number"&&a.textContent!==""+v&&(o.suppressHydrationWarning!==!0&&kf(a.textContent,v,e),u=["children",""+v]):md.hasOwnProperty(m)&&v!=null&&m==="onScroll"&&Ki("scroll",a)}switch(r){case"input":xf(a),Fb(a,o,!0);break;case"textarea":xf(a),Gb(a);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(a.onclick=tm)}a=u,t.updateQueue=a,a!==null&&(t.flags|=4)}else{m=u.nodeType===9?u:u.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Yw(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=m.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof a.is=="string"?e=m.createElement(r,{is:a.is}):(e=m.createElement(r),r==="select"&&(m=e,a.multiple?m.multiple=!0:a.size&&(m.size=a.size))):e=m.createElementNS(e,r),e[as]=t,e[Cd]=a,_I(e,t,!1,!1),t.stateNode=e;e:{switch(m=Uy(r,a),r){case"dialog":Ki("cancel",e),Ki("close",e),u=a;break;case"iframe":case"object":case"embed":Ki("load",e),u=a;break;case"video":case"audio":for(u=0;u<od.length;u++)Ki(od[u],e);u=a;break;case"source":Ki("error",e),u=a;break;case"img":case"image":case"link":Ki("error",e),Ki("load",e),u=a;break;case"details":Ki("toggle",e),u=a;break;case"input":Nb(e,a),u=By(e,a),Ki("invalid",e);break;case"option":u=a;break;case"select":e._wrapperState={wasMultiple:!!a.multiple},u=fr({},a,{value:void 0}),Ki("invalid",e);break;case"textarea":Ob(e,a),u=Oy(e,a),Ki("invalid",e);break;default:u=a}Vy(r,u),v=u;for(o in v)if(v.hasOwnProperty(o)){var b=v[o];o==="style"?Qw(e,b):o==="dangerouslySetInnerHTML"?(b=b?b.__html:void 0,b!=null&&qw(e,b)):o==="children"?typeof b=="string"?(r!=="textarea"||b!=="")&&gd(e,b):typeof b=="number"&&gd(e,""+b):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(md.hasOwnProperty(o)?b!=null&&o==="onScroll"&&Ki("scroll",e):b!=null&&Cv(e,o,b,m))}switch(r){case"input":xf(e),Fb(e,a,!1);break;case"textarea":xf(e),Gb(e);break;case"option":a.value!=null&&e.setAttribute("value",""+Wa(a.value));break;case"select":e.multiple=!!a.multiple,o=a.value,o!=null?ic(e,!!a.multiple,o,!1):a.defaultValue!=null&&ic(e,!!a.multiple,a.defaultValue,!0);break;default:typeof u.onClick=="function"&&(e.onclick=tm)}switch(r){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}}a&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return xn(t),null;case 6:if(e&&t.stateNode!=null)wI(e,t,e.memoizedProps,a);else{if(typeof a!="string"&&t.stateNode===null)throw Error(Qe(166));if(r=kl(Ed.current),kl(us.current),zf(t)){if(a=t.stateNode,r=t.memoizedProps,a[as]=t,(o=a.nodeValue!==r)&&(e=ho,e!==null))switch(e.tag){case 3:kf(a.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&kf(a.nodeValue,r,(e.mode&1)!==0)}o&&(t.flags|=4)}else a=(r.nodeType===9?r:r.ownerDocument).createTextNode(a),a[as]=t,t.stateNode=a}return xn(t),null;case 13:if(er(dr),a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ar&&co!==null&&(t.mode&1)!==0&&(t.flags&128)===0)O2(),cc(),t.flags|=98560,o=!1;else if(o=zf(t),a!==null&&a.dehydrated!==null){if(e===null){if(!o)throw Error(Qe(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(Qe(317));o[as]=t}else cc(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;xn(t),o=!1}else Zo!==null&&(wv(Zo),Zo=null),o=!0;if(!o)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=r,t):(a=a!==null,a!==(e!==null&&e.memoizedState!==null)&&a&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(dr.current&1)!==0?Ur===0&&(Ur=3):a1())),t.updateQueue!==null&&(t.flags|=4),xn(t),null);case 4:return dc(),fv(e,t),e===null&&Id(t.stateNode.containerInfo),xn(t),null;case 10:return Zv(t.type._context),xn(t),null;case 17:return Jn(t.type)&&im(),xn(t),null;case 19:if(er(dr),o=t.memoizedState,o===null)return xn(t),null;if(a=(t.flags&128)!==0,m=o.rendering,m===null)if(a)Kh(o,!1);else{if(Ur!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(m=um(e),m!==null){for(t.flags|=128,Kh(o,!1),a=m.updateQueue,a!==null&&(t.updateQueue=a,t.flags|=4),t.subtreeFlags=0,a=r,r=t.child;r!==null;)o=r,e=a,o.flags&=14680066,m=o.alternate,m===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=m.childLanes,o.lanes=m.lanes,o.child=m.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=m.memoizedProps,o.memoizedState=m.memoizedState,o.updateQueue=m.updateQueue,o.type=m.type,e=m.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return qi(dr,dr.current&1|2),t.child}e=e.sibling}o.tail!==null&&kr()>fc&&(t.flags|=128,a=!0,Kh(o,!1),t.lanes=4194304)}else{if(!a)if(e=um(m),e!==null){if(t.flags|=128,a=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Kh(o,!0),o.tail===null&&o.tailMode==="hidden"&&!m.alternate&&!ar)return xn(t),null}else 2*kr()-o.renderingStartTime>fc&&r!==1073741824&&(t.flags|=128,a=!0,Kh(o,!1),t.lanes=4194304);o.isBackwards?(m.sibling=t.child,t.child=m):(r=o.last,r!==null?r.sibling=m:t.child=m,o.last=m)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=kr(),t.sibling=null,r=dr.current,qi(dr,a?r&1|2:r&1),t):(xn(t),null);case 22:case 23:return s1(),a=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==a&&(t.flags|=8192),a&&(t.mode&1)!==0?(uo&1073741824)!==0&&(xn(t),t.subtreeFlags&6&&(t.flags|=8192)):xn(t),null;case 24:return null;case 25:return null}throw Error(Qe(156,t.tag))}function zP(e,t){switch(Gv(t),t.tag){case 1:return Jn(t.type)&&im(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return dc(),er(qn),er(bn),Yv(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return $v(t),null;case 13:if(er(dr),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Qe(340));cc()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return er(dr),null;case 4:return dc(),null;case 10:return Zv(t.type._context),null;case 22:case 23:return s1(),null;case 24:return null;default:return null}}var Df=!1,_n=!1,LP=typeof WeakSet=="function"?WeakSet:Set,_t=null;function ec(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(a){Sr(e,t,a)}else r.current=null}function mv(e,t,r){try{r()}catch(a){Sr(e,t,a)}}var Pw=!1;function RP(e,t){if(Qy=Qf,e=M2(),Fv(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var a=r.getSelection&&r.getSelection();if(a&&a.rangeCount!==0){r=a.anchorNode;var u=a.anchorOffset,o=a.focusNode;a=a.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break e}var m=0,v=-1,b=-1,C=0,T=0,B=e,W=null;t:for(;;){for(var q;B!==r||u!==0&&B.nodeType!==3||(v=m+u),B!==o||a!==0&&B.nodeType!==3||(b=m+a),B.nodeType===3&&(m+=B.nodeValue.length),(q=B.firstChild)!==null;)W=B,B=q;for(;;){if(B===e)break t;if(W===r&&++C===u&&(v=m),W===o&&++T===a&&(b=m),(q=B.nextSibling)!==null)break;B=W,W=B.parentNode}B=q}r=v===-1||b===-1?null:{start:v,end:b}}else r=null}r=r||{start:0,end:0}}else r=null;for(Ky={focusedElem:e,selectionRange:r},Qf=!1,_t=t;_t!==null;)if(t=_t,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,_t=e;else for(;_t!==null;){t=_t;try{var ee=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(ee!==null){var le=ee.memoizedProps,de=ee.memoizedState,H=t.stateNode,Q=H.getSnapshotBeforeUpdate(t.elementType===t.type?le:Uo(t.type,le),de);H.__reactInternalSnapshotBeforeUpdate=Q}break;case 3:var te=t.stateNode.containerInfo;te.nodeType===1?te.textContent="":te.nodeType===9&&te.documentElement&&te.removeChild(te.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Qe(163))}}catch(ve){Sr(t,t.return,ve)}if(e=t.sibling,e!==null){e.return=t.return,_t=e;break}_t=t.return}return ee=Pw,Pw=!1,ee}function dd(e,t,r){var a=t.updateQueue;if(a=a!==null?a.lastEffect:null,a!==null){var u=a=a.next;do{if((u.tag&e)===e){var o=u.destroy;u.destroy=void 0,o!==void 0&&mv(t,r,o)}u=u.next}while(u!==a)}}function Cm(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var a=r.create;r.destroy=a()}r=r.next}while(r!==t)}}function gv(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function II(e){var t=e.alternate;t!==null&&(e.alternate=null,II(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[as],delete t[Cd],delete t[iv],delete t[gP],delete t[yP])),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 SI(e){return e.tag===5||e.tag===3||e.tag===4}function kw(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||SI(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 yv(e,t,r){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=tm));else if(a!==4&&(e=e.child,e!==null))for(yv(e,t,r),e=e.sibling;e!==null;)yv(e,t,r),e=e.sibling}function vv(e,t,r){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(a!==4&&(e=e.child,e!==null))for(vv(e,t,r),e=e.sibling;e!==null;)vv(e,t,r),e=e.sibling}var ln=null,Wo=!1;function Ta(e,t,r){for(r=r.child;r!==null;)CI(e,t,r),r=r.sibling}function CI(e,t,r){if(ls&&typeof ls.onCommitFiberUnmount=="function")try{ls.onCommitFiberUnmount(ym,r)}catch{}switch(r.tag){case 5:_n||ec(r,t);case 6:var a=ln,u=Wo;ln=null,Ta(e,t,r),ln=a,Wo=u,ln!==null&&(Wo?(e=ln,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):ln.removeChild(r.stateNode));break;case 18:ln!==null&&(Wo?(e=ln,r=r.stateNode,e.nodeType===8?by(e.parentNode,r):e.nodeType===1&&by(e,r),_d(e)):by(ln,r.stateNode));break;case 4:a=ln,u=Wo,ln=r.stateNode.containerInfo,Wo=!0,Ta(e,t,r),ln=a,Wo=u;break;case 0:case 11:case 14:case 15:if(!_n&&(a=r.updateQueue,a!==null&&(a=a.lastEffect,a!==null))){u=a=a.next;do{var o=u,m=o.destroy;o=o.tag,m!==void 0&&((o&2)!==0||(o&4)!==0)&&mv(r,t,m),u=u.next}while(u!==a)}Ta(e,t,r);break;case 1:if(!_n&&(ec(r,t),a=r.stateNode,typeof a.componentWillUnmount=="function"))try{a.props=r.memoizedProps,a.state=r.memoizedState,a.componentWillUnmount()}catch(v){Sr(r,t,v)}Ta(e,t,r);break;case 21:Ta(e,t,r);break;case 22:r.mode&1?(_n=(a=_n)||r.memoizedState!==null,Ta(e,t,r),_n=a):Ta(e,t,r);break;default:Ta(e,t,r)}}function zw(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new LP),t.forEach(function(a){var u=WP.bind(null,e,a);r.has(a)||(r.add(a),a.then(u,u))})}}function Vo(e,t){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var u=r[a];try{var o=e,m=t,v=m;e:for(;v!==null;){switch(v.tag){case 5:ln=v.stateNode,Wo=!1;break e;case 3:ln=v.stateNode.containerInfo,Wo=!0;break e;case 4:ln=v.stateNode.containerInfo,Wo=!0;break e}v=v.return}if(ln===null)throw Error(Qe(160));CI(o,m,u),ln=null,Wo=!1;var b=u.alternate;b!==null&&(b.return=null),u.return=null}catch(C){Sr(u,t,C)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)MI(t,e),t=t.sibling}function MI(e,t){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Vo(t,e),os(e),a&4){try{dd(3,e,e.return),Cm(3,e)}catch(le){Sr(e,e.return,le)}try{dd(5,e,e.return)}catch(le){Sr(e,e.return,le)}}break;case 1:Vo(t,e),os(e),a&512&&r!==null&&ec(r,r.return);break;case 5:if(Vo(t,e),os(e),a&512&&r!==null&&ec(r,r.return),e.flags&32){var u=e.stateNode;try{gd(u,"")}catch(le){Sr(e,e.return,le)}}if(a&4&&(u=e.stateNode,u!=null)){var o=e.memoizedProps,m=r!==null?r.memoizedProps:o,v=e.type,b=e.updateQueue;if(e.updateQueue=null,b!==null)try{v==="input"&&o.type==="radio"&&o.name!=null&&Xw(u,o),Uy(v,m);var C=Uy(v,o);for(m=0;m<b.length;m+=2){var T=b[m],B=b[m+1];T==="style"?Qw(u,B):T==="dangerouslySetInnerHTML"?qw(u,B):T==="children"?gd(u,B):Cv(u,T,B,C)}switch(v){case"input":Ny(u,o);break;case"textarea":$w(u,o);break;case"select":var W=u._wrapperState.wasMultiple;u._wrapperState.wasMultiple=!!o.multiple;var q=o.value;q!=null?ic(u,!!o.multiple,q,!1):W!==!!o.multiple&&(o.defaultValue!=null?ic(u,!!o.multiple,o.defaultValue,!0):ic(u,!!o.multiple,o.multiple?[]:"",!1))}u[Cd]=o}catch(le){Sr(e,e.return,le)}}break;case 6:if(Vo(t,e),os(e),a&4){if(e.stateNode===null)throw Error(Qe(162));u=e.stateNode,o=e.memoizedProps;try{u.nodeValue=o}catch(le){Sr(e,e.return,le)}}break;case 3:if(Vo(t,e),os(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{_d(t.containerInfo)}catch(le){Sr(e,e.return,le)}break;case 4:Vo(t,e),os(e);break;case 13:Vo(t,e),os(e),u=e.child,u.flags&8192&&(o=u.memoizedState!==null,u.stateNode.isHidden=o,!o||u.alternate!==null&&u.alternate.memoizedState!==null||(n1=kr())),a&4&&zw(e);break;case 22:if(T=r!==null&&r.memoizedState!==null,e.mode&1?(_n=(C=_n)||T,Vo(t,e),_n=C):Vo(t,e),os(e),a&8192){if(C=e.memoizedState!==null,(e.stateNode.isHidden=C)&&!T&&(e.mode&1)!==0)for(_t=e,T=e.child;T!==null;){for(B=_t=T;_t!==null;){switch(W=_t,q=W.child,W.tag){case 0:case 11:case 14:case 15:dd(4,W,W.return);break;case 1:ec(W,W.return);var ee=W.stateNode;if(typeof ee.componentWillUnmount=="function"){a=W,r=W.return;try{t=a,ee.props=t.memoizedProps,ee.state=t.memoizedState,ee.componentWillUnmount()}catch(le){Sr(a,r,le)}}break;case 5:ec(W,W.return);break;case 22:if(W.memoizedState!==null){Rw(B);continue}}q!==null?(q.return=W,_t=q):Rw(B)}T=T.sibling}e:for(T=null,B=e;;){if(B.tag===5){if(T===null){T=B;try{u=B.stateNode,C?(o=u.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(v=B.stateNode,b=B.memoizedProps.style,m=b!=null&&b.hasOwnProperty("display")?b.display:null,v.style.display=Jw("display",m))}catch(le){Sr(e,e.return,le)}}}else if(B.tag===6){if(T===null)try{B.stateNode.nodeValue=C?"":B.memoizedProps}catch(le){Sr(e,e.return,le)}}else if((B.tag!==22&&B.tag!==23||B.memoizedState===null||B===e)&&B.child!==null){B.child.return=B,B=B.child;continue}if(B===e)break e;for(;B.sibling===null;){if(B.return===null||B.return===e)break e;T===B&&(T=null),B=B.return}T===B&&(T=null),B.sibling.return=B.return,B=B.sibling}}break;case 19:Vo(t,e),os(e),a&4&&zw(e);break;case 21:break;default:Vo(t,e),os(e)}}function os(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(SI(r)){var a=r;break e}r=r.return}throw Error(Qe(160))}switch(a.tag){case 5:var u=a.stateNode;a.flags&32&&(gd(u,""),a.flags&=-33);var o=kw(e);vv(e,o,u);break;case 3:case 4:var m=a.stateNode.containerInfo,v=kw(e);yv(e,v,m);break;default:throw Error(Qe(161))}}catch(b){Sr(e,e.return,b)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function DP(e,t,r){_t=e,EI(e,t,r)}function EI(e,t,r){for(var a=(e.mode&1)!==0;_t!==null;){var u=_t,o=u.child;if(u.tag===22&&a){var m=u.memoizedState!==null||Df;if(!m){var v=u.alternate,b=v!==null&&v.memoizedState!==null||_n;v=Df;var C=_n;if(Df=m,(_n=b)&&!C)for(_t=u;_t!==null;)m=_t,b=m.child,m.tag===22&&m.memoizedState!==null?Dw(u):b!==null?(b.return=m,_t=b):Dw(u);for(;o!==null;)_t=o,EI(o,t,r),o=o.sibling;_t=u,Df=v,_n=C}Lw(e,t,r)}else(u.subtreeFlags&8772)!==0&&o!==null?(o.return=u,_t=o):Lw(e,t,r)}}function Lw(e){for(;_t!==null;){var t=_t;if((t.flags&8772)!==0){var r=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:_n||Cm(5,t);break;case 1:var a=t.stateNode;if(t.flags&4&&!_n)if(r===null)a.componentDidMount();else{var u=t.elementType===t.type?r.memoizedProps:Uo(t.type,r.memoizedProps);a.componentDidUpdate(u,r.memoizedState,a.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&gw(t,o,a);break;case 3:var m=t.updateQueue;if(m!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}gw(t,m,r)}break;case 5:var v=t.stateNode;if(r===null&&t.flags&4){r=v;var b=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":b.autoFocus&&r.focus();break;case"img":b.src&&(r.src=b.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var C=t.alternate;if(C!==null){var T=C.memoizedState;if(T!==null){var B=T.dehydrated;B!==null&&_d(B)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Qe(163))}_n||t.flags&512&&gv(t)}catch(W){Sr(t,t.return,W)}}if(t===e){_t=null;break}if(r=t.sibling,r!==null){r.return=t.return,_t=r;break}_t=t.return}}function Rw(e){for(;_t!==null;){var t=_t;if(t===e){_t=null;break}var r=t.sibling;if(r!==null){r.return=t.return,_t=r;break}_t=t.return}}function Dw(e){for(;_t!==null;){var t=_t;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Cm(4,t)}catch(b){Sr(t,r,b)}break;case 1:var a=t.stateNode;if(typeof a.componentDidMount=="function"){var u=t.return;try{a.componentDidMount()}catch(b){Sr(t,u,b)}}var o=t.return;try{gv(t)}catch(b){Sr(t,o,b)}break;case 5:var m=t.return;try{gv(t)}catch(b){Sr(t,m,b)}}}catch(b){Sr(t,t.return,b)}if(t===e){_t=null;break}var v=t.sibling;if(v!==null){v.return=t.return,_t=v;break}_t=t.return}}var BP=Math.ceil,dm=js.ReactCurrentDispatcher,i1=js.ReactCurrentOwner,ko=js.ReactCurrentBatchConfig,wi=0,Qr=null,Nr=null,un=0,uo=0,tc=Ha(0),Ur=0,kd=null,Nl=0,Mm=0,r1=0,pd=null,$n=null,n1=0,fc=1/0,Bs=null,pm=!1,xv=null,Ga=null,Bf=!1,Ra=null,fm=0,fd=0,_v=null,Zf=-1,jf=0;function Nn(){return(wi&6)!==0?kr():Zf!==-1?Zf:Zf=kr()}function Va(e){return(e.mode&1)===0?1:(wi&2)!==0&&un!==0?un&-un:xP.transition!==null?(jf===0&&(jf=c2()),jf):(e=Di,e!==0||(e=window.event,e=e===void 0?16:y2(e.type)),e)}function Ho(e,t,r,a){if(50<fd)throw fd=0,_v=null,Error(Qe(185));zd(e,r,a),((wi&2)===0||e!==Qr)&&(e===Qr&&((wi&2)===0&&(Mm|=r),Ur===4&&za(e,un)),Qn(e,a),r===1&&wi===0&&(t.mode&1)===0&&(fc=kr()+500,wm&&Xa()))}function Qn(e,t){var r=e.callbackNode;b4(e,t);var a=Jf(e,e===Qr?un:0);if(a===0)r!==null&&Wb(r),e.callbackNode=null,e.callbackPriority=0;else if(t=a&-a,e.callbackPriority!==t){if(r!=null&&Wb(r),t===1)e.tag===0?vP(Bw.bind(null,e)):B2(Bw.bind(null,e)),fP(function(){(wi&6)===0&&Xa()}),r=null;else{switch(h2(a)){case 1:r=Pv;break;case 4:r=l2;break;case 16:r=qf;break;case 536870912:r=u2;break;default:r=qf}r=DI(r,TI.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function TI(e,t){if(Zf=-1,jf=0,(wi&6)!==0)throw Error(Qe(327));var r=e.callbackNode;if(ac()&&e.callbackNode!==r)return null;var a=Jf(e,e===Qr?un:0);if(a===0)return null;if((a&30)!==0||(a&e.expiredLanes)!==0||t)t=mm(e,a);else{t=a;var u=wi;wi|=2;var o=PI();(Qr!==e||un!==t)&&(Bs=null,fc=kr()+500,zl(e,t));do try{OP();break}catch(v){AI(e,v)}while(1);Wv(),dm.current=o,wi=u,Nr!==null?t=0:(Qr=null,un=0,t=Ur)}if(t!==0){if(t===2&&(u=Xy(e),u!==0&&(a=u,t=bv(e,u))),t===1)throw r=kd,zl(e,0),za(e,a),Qn(e,kr()),r;if(t===6)za(e,a);else{if(u=e.current.alternate,(a&30)===0&&!NP(u)&&(t=mm(e,a),t===2&&(o=Xy(e),o!==0&&(a=o,t=bv(e,o))),t===1))throw r=kd,zl(e,0),za(e,a),Qn(e,kr()),r;switch(e.finishedWork=u,e.finishedLanes=a,t){case 0:case 1:throw Error(Qe(345));case 2:Tl(e,$n,Bs);break;case 3:if(za(e,a),(a&130023424)===a&&(t=n1+500-kr(),10<t)){if(Jf(e,0)!==0)break;if(u=e.suspendedLanes,(u&a)!==a){Nn(),e.pingedLanes|=e.suspendedLanes&u;break}e.timeoutHandle=tv(Tl.bind(null,e,$n,Bs),t);break}Tl(e,$n,Bs);break;case 4:if(za(e,a),(a&4194240)===a)break;for(t=e.eventTimes,u=-1;0<a;){var m=31-jo(a);o=1<<m,m=t[m],m>u&&(u=m),a&=~o}if(a=u,a=kr()-a,a=(120>a?120:480>a?480:1080>a?1080:1920>a?1920:3e3>a?3e3:4320>a?4320:1960*BP(a/1960))-a,10<a){e.timeoutHandle=tv(Tl.bind(null,e,$n,Bs),a);break}Tl(e,$n,Bs);break;case 5:Tl(e,$n,Bs);break;default:throw Error(Qe(329))}}}return Qn(e,kr()),e.callbackNode===r?TI.bind(null,e):null}function bv(e,t){var r=pd;return e.current.memoizedState.isDehydrated&&(zl(e,t).flags|=256),e=mm(e,t),e!==2&&(t=$n,$n=r,t!==null&&wv(t)),e}function wv(e){$n===null?$n=e:$n.push.apply($n,e)}function NP(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var a=0;a<r.length;a++){var u=r[a],o=u.getSnapshot;u=u.value;try{if(!Xo(o(),u))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function za(e,t){for(t&=~r1,t&=~Mm,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-jo(t),a=1<<r;e[r]=-1,t&=~a}}function Bw(e){if((wi&6)!==0)throw Error(Qe(327));ac();var t=Jf(e,0);if((t&1)===0)return Qn(e,kr()),null;var r=mm(e,t);if(e.tag!==0&&r===2){var a=Xy(e);a!==0&&(t=a,r=bv(e,a))}if(r===1)throw r=kd,zl(e,0),za(e,t),Qn(e,kr()),r;if(r===6)throw Error(Qe(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Tl(e,$n,Bs),Qn(e,kr()),null}function o1(e,t){var r=wi;wi|=1;try{return e(t)}finally{wi=r,wi===0&&(fc=kr()+500,wm&&Xa())}}function Fl(e){Ra!==null&&Ra.tag===0&&(wi&6)===0&&ac();var t=wi;wi|=1;var r=ko.transition,a=Di;try{if(ko.transition=null,Di=1,e)return e()}finally{Di=a,ko.transition=r,wi=t,(wi&6)===0&&Xa()}}function s1(){uo=tc.current,er(tc)}function zl(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,pP(r)),Nr!==null)for(r=Nr.return;r!==null;){var a=r;switch(Gv(a),a.tag){case 1:a=a.type.childContextTypes,a!=null&&im();break;case 3:dc(),er(qn),er(bn),Yv();break;case 5:$v(a);break;case 4:dc();break;case 13:er(dr);break;case 19:er(dr);break;case 10:Zv(a.type._context);break;case 22:case 23:s1()}r=r.return}if(Qr=e,Nr=e=Ua(e.current,null),un=uo=t,Ur=0,kd=null,r1=Mm=Nl=0,$n=pd=null,Pl!==null){for(t=0;t<Pl.length;t++)if(r=Pl[t],a=r.interleaved,a!==null){r.interleaved=null;var u=a.next,o=r.pending;if(o!==null){var m=o.next;o.next=u,a.next=m}r.pending=a}Pl=null}return e}function AI(e,t){do{var r=Nr;try{if(Wv(),Vf.current=hm,cm){for(var a=pr.memoizedState;a!==null;){var u=a.queue;u!==null&&(u.pending=null),a=a.next}cm=!1}if(Bl=0,Jr=Vr=pr=null,hd=!1,Td=0,i1.current=null,r===null||r.return===null){Ur=1,kd=t,Nr=null;break}e:{var o=e,m=r.return,v=r,b=t;if(t=un,v.flags|=32768,b!==null&&typeof b=="object"&&typeof b.then=="function"){var C=b,T=v,B=T.tag;if((T.mode&1)===0&&(B===0||B===11||B===15)){var W=T.alternate;W?(T.updateQueue=W.updateQueue,T.memoizedState=W.memoizedState,T.lanes=W.lanes):(T.updateQueue=null,T.memoizedState=null)}var q=Iw(m);if(q!==null){q.flags&=-257,Sw(q,m,v,o,t),q.mode&1&&ww(o,C,t),t=q,b=C;var ee=t.updateQueue;if(ee===null){var le=new Set;le.add(b),t.updateQueue=le}else ee.add(b);break e}else{if((t&1)===0){ww(o,C,t),a1();break e}b=Error(Qe(426))}}else if(ar&&v.mode&1){var de=Iw(m);if(de!==null){(de.flags&65536)===0&&(de.flags|=256),Sw(de,m,v,o,t),Vv(pc(b,v));break e}}o=b=pc(b,v),Ur!==4&&(Ur=2),pd===null?pd=[o]:pd.push(o),o=m;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var H=dI(o,b,t);mw(o,H);break e;case 1:v=b;var Q=o.type,te=o.stateNode;if((o.flags&128)===0&&(typeof Q.getDerivedStateFromError=="function"||te!==null&&typeof te.componentDidCatch=="function"&&(Ga===null||!Ga.has(te)))){o.flags|=65536,t&=-t,o.lanes|=t;var ve=pI(o,v,t);mw(o,ve);break e}}o=o.return}while(o!==null)}zI(r)}catch(Me){t=Me,Nr===r&&r!==null&&(Nr=r=r.return);continue}break}while(1)}function PI(){var e=dm.current;return dm.current=hm,e===null?hm:e}function a1(){(Ur===0||Ur===3||Ur===2)&&(Ur=4),Qr===null||(Nl&268435455)===0&&(Mm&268435455)===0||za(Qr,un)}function mm(e,t){var r=wi;wi|=2;var a=PI();(Qr!==e||un!==t)&&(Bs=null,zl(e,t));do try{FP();break}catch(u){AI(e,u)}while(1);if(Wv(),wi=r,dm.current=a,Nr!==null)throw Error(Qe(261));return Qr=null,un=0,Ur}function FP(){for(;Nr!==null;)kI(Nr)}function OP(){for(;Nr!==null&&!d4();)kI(Nr)}function kI(e){var t=RI(e.alternate,e,uo);e.memoizedProps=e.pendingProps,t===null?zI(e):Nr=t,i1.current=null}function zI(e){var t=e;do{var r=t.alternate;if(e=t.return,(t.flags&32768)===0){if(r=kP(r,t,uo),r!==null){Nr=r;return}}else{if(r=zP(r,t),r!==null){r.flags&=32767,Nr=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ur=6,Nr=null;return}}if(t=t.sibling,t!==null){Nr=t;return}Nr=t=e}while(t!==null);Ur===0&&(Ur=5)}function Tl(e,t,r){var a=Di,u=ko.transition;try{ko.transition=null,Di=1,GP(e,t,r,a)}finally{ko.transition=u,Di=a}return null}function GP(e,t,r,a){do ac();while(Ra!==null);if((wi&6)!==0)throw Error(Qe(327));r=e.finishedWork;var u=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(Qe(177));e.callbackNode=null,e.callbackPriority=0;var o=r.lanes|r.childLanes;if(w4(e,o),e===Qr&&(Nr=Qr=null,un=0),(r.subtreeFlags&2064)===0&&(r.flags&2064)===0||Bf||(Bf=!0,DI(qf,function(){return ac(),null})),o=(r.flags&15990)!==0,(r.subtreeFlags&15990)!==0||o){o=ko.transition,ko.transition=null;var m=Di;Di=1;var v=wi;wi|=4,i1.current=null,RP(e,r),MI(r,e),lP(Ky),Qf=!!Qy,Ky=Qy=null,e.current=r,DP(r,e,u),p4(),wi=v,Di=m,ko.transition=o}else e.current=r;if(Bf&&(Bf=!1,Ra=e,fm=u),o=e.pendingLanes,o===0&&(Ga=null),g4(r.stateNode,a),Qn(e,kr()),t!==null)for(a=e.onRecoverableError,r=0;r<t.length;r++)u=t[r],a(u.value,{componentStack:u.stack,digest:u.digest});if(pm)throw pm=!1,e=xv,xv=null,e;return(fm&1)!==0&&e.tag!==0&&ac(),o=e.pendingLanes,(o&1)!==0?e===_v?fd++:(fd=0,_v=e):fd=0,Xa(),null}function ac(){if(Ra!==null){var e=h2(fm),t=ko.transition,r=Di;try{if(ko.transition=null,Di=16>e?16:e,Ra===null)var a=!1;else{if(e=Ra,Ra=null,fm=0,(wi&6)!==0)throw Error(Qe(331));var u=wi;for(wi|=4,_t=e.current;_t!==null;){var o=_t,m=o.child;if((_t.flags&16)!==0){var v=o.deletions;if(v!==null){for(var b=0;b<v.length;b++){var C=v[b];for(_t=C;_t!==null;){var T=_t;switch(T.tag){case 0:case 11:case 15:dd(8,T,o)}var B=T.child;if(B!==null)B.return=T,_t=B;else for(;_t!==null;){T=_t;var W=T.sibling,q=T.return;if(II(T),T===C){_t=null;break}if(W!==null){W.return=q,_t=W;break}_t=q}}}var ee=o.alternate;if(ee!==null){var le=ee.child;if(le!==null){ee.child=null;do{var de=le.sibling;le.sibling=null,le=de}while(le!==null)}}_t=o}}if((o.subtreeFlags&2064)!==0&&m!==null)m.return=o,_t=m;else e:for(;_t!==null;){if(o=_t,(o.flags&2048)!==0)switch(o.tag){case 0:case 11:case 15:dd(9,o,o.return)}var H=o.sibling;if(H!==null){H.return=o.return,_t=H;break e}_t=o.return}}var Q=e.current;for(_t=Q;_t!==null;){m=_t;var te=m.child;if((m.subtreeFlags&2064)!==0&&te!==null)te.return=m,_t=te;else e:for(m=Q;_t!==null;){if(v=_t,(v.flags&2048)!==0)try{switch(v.tag){case 0:case 11:case 15:Cm(9,v)}}catch(Me){Sr(v,v.return,Me)}if(v===m){_t=null;break e}var ve=v.sibling;if(ve!==null){ve.return=v.return,_t=ve;break e}_t=v.return}}if(wi=u,Xa(),ls&&typeof ls.onPostCommitFiberRoot=="function")try{ls.onPostCommitFiberRoot(ym,e)}catch{}a=!0}return a}finally{Di=r,ko.transition=t}}return!1}function Nw(e,t,r){t=pc(r,t),t=dI(e,t,1),e=Oa(e,t,1),t=Nn(),e!==null&&(zd(e,1,t),Qn(e,t))}function Sr(e,t,r){if(e.tag===3)Nw(e,e,r);else for(;t!==null;){if(t.tag===3){Nw(t,e,r);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Ga===null||!Ga.has(a))){e=pc(r,e),e=pI(t,e,1),t=Oa(t,e,1),e=Nn(),t!==null&&(zd(t,1,e),Qn(t,e));break}}t=t.return}}function VP(e,t,r){var a=e.pingCache;a!==null&&a.delete(t),t=Nn(),e.pingedLanes|=e.suspendedLanes&r,Qr===e&&(un&r)===r&&(Ur===4||Ur===3&&(un&130023424)===un&&500>kr()-n1?zl(e,0):r1|=r),Qn(e,t)}function LI(e,t){t===0&&((e.mode&1)===0?t=1:(t=wf,wf<<=1,(wf&130023424)===0&&(wf=4194304)));var r=Nn();e=Ws(e,t),e!==null&&(zd(e,t,r),Qn(e,r))}function UP(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),LI(e,r)}function WP(e,t){var r=0;switch(e.tag){case 13:var a=e.stateNode,u=e.memoizedState;u!==null&&(r=u.retryLane);break;case 19:a=e.stateNode;break;default:throw Error(Qe(314))}a!==null&&a.delete(t),LI(e,r)}var RI;RI=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||qn.current)Yn=!0;else{if((e.lanes&r)===0&&(t.flags&128)===0)return Yn=!1,PP(e,t,r);Yn=(e.flags&131072)!==0}else Yn=!1,ar&&(t.flags&1048576)!==0&&N2(t,om,t.index);switch(t.lanes=0,t.tag){case 2:var a=t.type;Wf(e,t),e=t.pendingProps;var u=uc(t,bn.current);sc(t,r),u=Jv(null,t,a,e,u,r);var o=Qv();return t.flags|=1,typeof u=="object"&&u!==null&&typeof u.render=="function"&&u.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Jn(a)?(o=!0,rm(t)):o=!1,t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,Hv(t),u.updater=Im,t.stateNode=u,u._reactInternals=t,lv(t,a,e,r),t=hv(null,t,a,!0,o,r)):(t.tag=0,ar&&o&&Ov(t),Bn(null,t,u,r),t=t.child),t;case 16:a=t.elementType;e:{switch(Wf(e,t),e=t.pendingProps,u=a._init,a=u(a._payload),t.type=a,u=t.tag=jP(a),e=Uo(a,e),u){case 0:t=cv(null,t,a,e,r);break e;case 1:t=Ew(null,t,a,e,r);break e;case 11:t=Cw(null,t,a,e,r);break e;case 14:t=Mw(null,t,a,Uo(a.type,e),r);break e}throw Error(Qe(306,a,""))}return t;case 0:return a=t.type,u=t.pendingProps,u=t.elementType===a?u:Uo(a,u),cv(e,t,a,u,r);case 1:return a=t.type,u=t.pendingProps,u=t.elementType===a?u:Uo(a,u),Ew(e,t,a,u,r);case 3:e:{if(yI(t),e===null)throw Error(Qe(387));a=t.pendingProps,o=t.memoizedState,u=o.element,V2(e,t),lm(t,a,null,r);var m=t.memoizedState;if(a=m.element,o.isDehydrated)if(o={element:a,isDehydrated:!1,cache:m.cache,pendingSuspenseBoundaries:m.pendingSuspenseBoundaries,transitions:m.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){u=pc(Error(Qe(423)),t),t=Tw(e,t,a,r,u);break e}else if(a!==u){u=pc(Error(Qe(424)),t),t=Tw(e,t,a,r,u);break e}else for(co=Fa(t.stateNode.containerInfo.firstChild),ho=t,ar=!0,Zo=null,r=j2(t,null,a,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(cc(),a===u){t=Zs(e,t,r);break e}Bn(e,t,a,r)}t=t.child}return t;case 5:return H2(t),e===null&&ov(t),a=t.type,u=t.pendingProps,o=e!==null?e.memoizedProps:null,m=u.children,ev(a,u)?m=null:o!==null&&ev(a,o)&&(t.flags|=32),gI(e,t),Bn(e,t,m,r),t.child;case 6:return e===null&&ov(t),null;case 13:return vI(e,t,r);case 4:return Xv(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=hc(t,null,a,r):Bn(e,t,a,r),t.child;case 11:return a=t.type,u=t.pendingProps,u=t.elementType===a?u:Uo(a,u),Cw(e,t,a,u,r);case 7:return Bn(e,t,t.pendingProps,r),t.child;case 8:return Bn(e,t,t.pendingProps.children,r),t.child;case 12:return Bn(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(a=t.type._context,u=t.pendingProps,o=t.memoizedProps,m=u.value,qi(sm,a._currentValue),a._currentValue=m,o!==null)if(Xo(o.value,m)){if(o.children===u.children&&!qn.current){t=Zs(e,t,r);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var v=o.dependencies;if(v!==null){m=o.child;for(var b=v.firstContext;b!==null;){if(b.context===a){if(o.tag===1){b=Gs(-1,r&-r),b.tag=2;var C=o.updateQueue;if(C!==null){C=C.shared;var T=C.pending;T===null?b.next=b:(b.next=T.next,T.next=b),C.pending=b}}o.lanes|=r,b=o.alternate,b!==null&&(b.lanes|=r),sv(o.return,r,t),v.lanes|=r;break}b=b.next}}else if(o.tag===10)m=o.type===t.type?null:o.child;else if(o.tag===18){if(m=o.return,m===null)throw Error(Qe(341));m.lanes|=r,v=m.alternate,v!==null&&(v.lanes|=r),sv(m,r,t),m=o.sibling}else m=o.child;if(m!==null)m.return=o;else for(m=o;m!==null;){if(m===t){m=null;break}if(o=m.sibling,o!==null){o.return=m.return,m=o;break}m=m.return}o=m}Bn(e,t,u.children,r),t=t.child}return t;case 9:return u=t.type,a=t.pendingProps.children,sc(t,r),u=zo(u),a=a(u),t.flags|=1,Bn(e,t,a,r),t.child;case 14:return a=t.type,u=Uo(a,t.pendingProps),u=Uo(a.type,u),Mw(e,t,a,u,r);case 15:return fI(e,t,t.type,t.pendingProps,r);case 17:return a=t.type,u=t.pendingProps,u=t.elementType===a?u:Uo(a,u),Wf(e,t),t.tag=1,Jn(a)?(e=!0,rm(t)):e=!1,sc(t,r),W2(t,a,u),lv(t,a,u,r),hv(null,t,a,!0,e,r);case 19:return xI(e,t,r);case 22:return mI(e,t,r)}throw Error(Qe(156,t.tag))};function DI(e,t){return a2(e,t)}function ZP(e,t,r,a){this.tag=e,this.key=r,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=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Po(e,t,r,a){return new ZP(e,t,r,a)}function l1(e){return e=e.prototype,!(!e||!e.isReactComponent)}function jP(e){if(typeof e=="function")return l1(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ev)return 11;if(e===Tv)return 14}return 2}function Ua(e,t){var r=e.alternate;return r===null?(r=Po(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Hf(e,t,r,a,u,o){var m=2;if(a=e,typeof e=="function")l1(e)&&(m=1);else if(typeof e=="string")m=5;else e:switch(e){case ju:return Ll(r.children,u,o,t);case Mv:m=8,u|=8;break;case zy:return e=Po(12,r,t,u|2),e.elementType=zy,e.lanes=o,e;case Ly:return e=Po(13,r,t,u),e.elementType=Ly,e.lanes=o,e;case Ry:return e=Po(19,r,t,u),e.elementType=Ry,e.lanes=o,e;case Zw:return Em(r,u,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Uw:m=10;break e;case Ww:m=9;break e;case Ev:m=11;break e;case Tv:m=14;break e;case Aa:m=16,a=null;break e}throw Error(Qe(130,e==null?e:typeof e,""))}return t=Po(m,r,t,u),t.elementType=e,t.type=a,t.lanes=o,t}function Ll(e,t,r,a){return e=Po(7,e,a,t),e.lanes=r,e}function Em(e,t,r,a){return e=Po(22,e,a,t),e.elementType=Zw,e.lanes=r,e.stateNode={isHidden:!1},e}function Ay(e,t,r){return e=Po(6,e,null,t),e.lanes=r,e}function Py(e,t,r){return t=Po(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function HP(e,t,r,a,u){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=py(0),this.expirationTimes=py(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=py(0),this.identifierPrefix=a,this.onRecoverableError=u,this.mutableSourceEagerHydrationData=null}function u1(e,t,r,a,u,o,m,v,b){return e=new HP(e,t,r,v,b),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Po(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:a,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Hv(o),e}function XP(e,t,r){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Zu,key:a==null?null:""+a,children:e,containerInfo:t,implementation:r}}function BI(e){if(!e)return Za;e=e._reactInternals;e:{if(Gl(e)!==e||e.tag!==1)throw Error(Qe(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Jn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(Qe(171))}if(e.tag===1){var r=e.type;if(Jn(r))return D2(e,r,t)}return t}function NI(e,t,r,a,u,o,m,v,b){return e=u1(r,a,!0,e,u,o,m,v,b),e.context=BI(null),r=e.current,a=Nn(),u=Va(r),o=Gs(a,u),o.callback=t??null,Oa(r,o,u),e.current.lanes=u,zd(e,u,a),Qn(e,a),e}function Tm(e,t,r,a){var u=t.current,o=Nn(),m=Va(u);return r=BI(r),t.context===null?t.context=r:t.pendingContext=r,t=Gs(o,m),t.payload={element:e},a=a===void 0?null:a,a!==null&&(t.callback=a),e=Oa(u,t,m),e!==null&&(Ho(e,u,m,o),Gf(e,u,m)),m}function gm(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Fw(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function c1(e,t){Fw(e,t),(e=e.alternate)&&Fw(e,t)}function $P(){return null}var FI=typeof reportError=="function"?reportError:function(e){console.error(e)};function h1(e){this._internalRoot=e}Am.prototype.render=h1.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Qe(409));Tm(e,t,null,null)};Am.prototype.unmount=h1.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Fl(function(){Tm(null,e,null,null)}),t[Us]=null}};function Am(e){this._internalRoot=e}Am.prototype.unstable_scheduleHydration=function(e){if(e){var t=f2();e={blockedOn:null,target:e,priority:t};for(var r=0;r<ka.length&&t!==0&&t<ka[r].priority;r++);ka.splice(r,0,e),r===0&&g2(e)}};function d1(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Pm(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Ow(){}function YP(e,t,r,a,u){if(u){if(typeof a=="function"){var o=a;a=function(){var C=gm(m);o.call(C)}}var m=NI(t,a,e,0,null,!1,!1,"",Ow);return e._reactRootContainer=m,e[Us]=m.current,Id(e.nodeType===8?e.parentNode:e),Fl(),m}for(;u=e.lastChild;)e.removeChild(u);if(typeof a=="function"){var v=a;a=function(){var C=gm(b);v.call(C)}}var b=u1(e,0,!1,null,null,!1,!1,"",Ow);return e._reactRootContainer=b,e[Us]=b.current,Id(e.nodeType===8?e.parentNode:e),Fl(function(){Tm(t,b,r,a)}),b}function km(e,t,r,a,u){var o=r._reactRootContainer;if(o){var m=o;if(typeof u=="function"){var v=u;u=function(){var b=gm(m);v.call(b)}}Tm(t,m,e,u)}else m=YP(r,t,e,u,a);return gm(m)}d2=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=nd(t.pendingLanes);r!==0&&(kv(t,r|1),Qn(t,kr()),(wi&6)===0&&(fc=kr()+500,Xa()))}break;case 13:Fl(function(){var a=Ws(e,1);if(a!==null){var u=Nn();Ho(a,e,1,u)}}),c1(e,1)}};zv=function(e){if(e.tag===13){var t=Ws(e,134217728);if(t!==null){var r=Nn();Ho(t,e,134217728,r)}c1(e,134217728)}};p2=function(e){if(e.tag===13){var t=Va(e),r=Ws(e,t);if(r!==null){var a=Nn();Ho(r,e,t,a)}c1(e,t)}};f2=function(){return Di};m2=function(e,t){var r=Di;try{return Di=e,t()}finally{Di=r}};Zy=function(e,t,r){switch(t){case"input":if(Ny(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var a=r[t];if(a!==e&&a.form===e.form){var u=bm(a);if(!u)throw Error(Qe(90));Hw(a),Ny(a,u)}}}break;case"textarea":$w(e,r);break;case"select":t=r.value,t!=null&&ic(e,!!r.multiple,t,!1)}};t2=o1;i2=Fl;var qP={usingClientEntryPoint:!1,Events:[Rd,Yu,bm,Kw,e2,o1]},ed={findFiberByHostInstance:Al,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},JP={bundleType:ed.bundleType,version:ed.version,rendererPackageName:ed.rendererPackageName,rendererConfig:ed.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:js.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=o2(e),e===null?null:e.stateNode},findFiberByHostInstance:ed.findFiberByHostInstance||$P,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(td=__REACT_DEVTOOLS_GLOBAL_HOOK__,!td.isDisabled&&td.supportsFiber))try{ym=td.inject(JP),ls=td}catch{}var td;mo.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=qP;mo.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d1(t))throw Error(Qe(200));return XP(e,t,null,r)};mo.createRoot=function(e,t){if(!d1(e))throw Error(Qe(299));var r=!1,a="",u=FI;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onRecoverableError!==void 0&&(u=t.onRecoverableError)),t=u1(e,1,!1,null,null,r,!1,a,u),e[Us]=t.current,Id(e.nodeType===8?e.parentNode:e),new h1(t)};mo.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(Qe(188)):(e=Object.keys(e).join(","),Error(Qe(268,e)));return e=o2(t),e=e===null?null:e.stateNode,e};mo.flushSync=function(e){return Fl(e)};mo.hydrate=function(e,t,r){if(!Pm(t))throw Error(Qe(200));return km(null,e,t,!0,r)};mo.hydrateRoot=function(e,t,r){if(!d1(e))throw Error(Qe(405));var a=r!=null&&r.hydratedSources||null,u=!1,o="",m=FI;if(r!=null&&(r.unstable_strictMode===!0&&(u=!0),r.identifierPrefix!==void 0&&(o=r.identifierPrefix),r.onRecoverableError!==void 0&&(m=r.onRecoverableError)),t=NI(t,null,e,1,r??null,u,!1,o,m),e[Us]=t.current,Id(e),a)for(e=0;e<a.length;e++)r=a[e],u=r._getVersion,u=u(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,u]:t.mutableSourceEagerHydrationData.push(r,u);return new Am(t)};mo.render=function(e,t,r){if(!Pm(t))throw Error(Qe(200));return km(null,e,t,!1,r)};mo.unmountComponentAtNode=function(e){if(!Pm(e))throw Error(Qe(40));return e._reactRootContainer?(Fl(function(){km(null,null,e,!1,function(){e._reactRootContainer=null,e[Us]=null})}),!0):!1};mo.unstable_batchedUpdates=o1;mo.unstable_renderSubtreeIntoContainer=function(e,t,r,a){if(!Pm(r))throw Error(Qe(200));if(e==null||e._reactInternals===void 0)throw Error(Qe(38));return km(e,t,r,!1,a)};mo.version="18.2.0-next-9e3b772b8-20220608"});var zm=Vt((vB,VI)=>{"use strict";function GI(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(GI)}catch(e){console.error(e)}}GI(),VI.exports=OI()});var WI=Vt(p1=>{"use strict";var UI=zm();p1.createRoot=UI.createRoot,p1.hydrateRoot=UI.hydrateRoot;var xB});var ZI=Vt(()=>{});var KI=Vt(Rm=>{"use strict";Object.defineProperty(Rm,"__esModule",{value:!0});Rm.Nztm2000Quad=void 0;Rm.Nztm2000Quad={type:"TileMatrixSetType",title:"LINZ NZTM2000 Map Tile Grid V2",abstract:"",identifier:"NZTM2000Quad",supportedCRS:"https://www.opengis.net/def/crs/EPSG/0/2193",boundingBox:{type:"BoundingBoxType",crs:"https://www.opengis.net/def/crs/EPSG/0/2193",lowerCorner:[419435.9938,-32605867284e-4],upperCorner:[104381901652e-4,6758167443e-3]},tileMatrix:[{type:"TileMatrixType",identifier:"0",scaleDenominator:139770566007179e-6,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:1,matrixHeight:1},{type:"TileMatrixType",identifier:"1",scaleDenominator:698852830035895e-7,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:2,matrixHeight:2},{type:"TileMatrixType",identifier:"2",scaleDenominator:3494264150179475e-8,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:4,matrixHeight:4},{type:"TileMatrixType",identifier:"3",scaleDenominator:17471320750897374e-9,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:8,matrixHeight:8},{type:"TileMatrixType",identifier:"4",scaleDenominator:8735660375448687e-9,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:16,matrixHeight:16},{type:"TileMatrixType",identifier:"5",scaleDenominator:4.3678301877243435e6,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:32,matrixHeight:32},{type:"TileMatrixType",identifier:"6",scaleDenominator:2.1839150938621718e6,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:64,matrixHeight:64},{type:"TileMatrixType",identifier:"7",scaleDenominator:1.0919575469310859e6,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:128,matrixHeight:128},{type:"TileMatrixType",identifier:"8",scaleDenominator:545978.7734655429,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:256,matrixHeight:256},{type:"TileMatrixType",identifier:"9",scaleDenominator:272989.38673277147,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:512,matrixHeight:512},{type:"TileMatrixType",identifier:"10",scaleDenominator:136494.69336638573,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:1024,matrixHeight:1024},{type:"TileMatrixType",identifier:"11",scaleDenominator:68247.34668319287,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:2048,matrixHeight:2048},{type:"TileMatrixType",identifier:"12",scaleDenominator:34123.67334159643,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:4096,matrixHeight:4096},{type:"TileMatrixType",identifier:"13",scaleDenominator:17061.836670798217,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:8192,matrixHeight:8192},{type:"TileMatrixType",identifier:"14",scaleDenominator:8530.918335399108,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:16384,matrixHeight:16384},{type:"TileMatrixType",identifier:"15",scaleDenominator:4265.459167699554,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:32768,matrixHeight:32768},{type:"TileMatrixType",identifier:"16",scaleDenominator:2132.729583849777,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:65536,matrixHeight:65536},{type:"TileMatrixType",identifier:"17",scaleDenominator:1066.3647919248886,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:131072,matrixHeight:131072},{type:"TileMatrixType",identifier:"18",scaleDenominator:533.1823959624443,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:262144,matrixHeight:262144},{type:"TileMatrixType",identifier:"19",scaleDenominator:266.59119798122214,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:524288,matrixHeight:524288},{type:"TileMatrixType",identifier:"20",scaleDenominator:133.29559899061107,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:1048576,matrixHeight:1048576},{type:"TileMatrixType",identifier:"21",scaleDenominator:66.64779949530553,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:2097152,matrixHeight:2097152}]}});var eS=Vt(Dm=>{"use strict";Object.defineProperty(Dm,"__esModule",{value:!0});Dm.Nztm2000=void 0;Dm.Nztm2000={type:"TileMatrixSetType",title:"LINZ NZTM2000 Map Tile Grid",abstract:"See https://www.linz.govt.nz/data/linz-data-service/guides-and-documentation/nztm2000-map-tile-service-schema",identifier:"NZTM2000",supportedCRS:"https://www.opengis.net/def/crs/EPSG/0/2193",boundingBox:{type:"BoundingBoxType",crs:"https://www.opengis.net/def/crs/EPSG/0/2193",lowerCorner:[3087e3,274e3],upperCorner:[7173e3,3327e3]},tileMatrix:[{type:"TileMatrixType",identifier:"0",scaleDenominator:32e6,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:2,matrixHeight:4},{type:"TileMatrixType",identifier:"1",scaleDenominator:16e6,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:4,matrixHeight:8},{type:"TileMatrixType",identifier:"2",scaleDenominator:8e6,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:8,matrixHeight:16},{type:"TileMatrixType",identifier:"3",scaleDenominator:4e6,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:16,matrixHeight:32},{type:"TileMatrixType",identifier:"4",scaleDenominator:2e6,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:32,matrixHeight:64},{type:"TileMatrixType",identifier:"5",scaleDenominator:1e6,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:64,matrixHeight:128},{type:"TileMatrixType",identifier:"6",scaleDenominator:5e5,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:128,matrixHeight:256},{type:"TileMatrixType",identifier:"7",scaleDenominator:25e4,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:256,matrixHeight:512},{type:"TileMatrixType",identifier:"8",scaleDenominator:1e5,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:640,matrixHeight:1280},{type:"TileMatrixType",identifier:"9",scaleDenominator:5e4,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:1280,matrixHeight:2560},{type:"TileMatrixType",identifier:"10",scaleDenominator:25e3,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:2560,matrixHeight:5120},{type:"TileMatrixType",identifier:"11",scaleDenominator:1e4,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:6400,matrixHeight:12800},{type:"TileMatrixType",identifier:"12",scaleDenominator:5e3,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:12800,matrixHeight:25600},{type:"TileMatrixType",identifier:"13",scaleDenominator:2500,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:25600,matrixHeight:51200},{type:"TileMatrixType",identifier:"14",scaleDenominator:1e3,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:64e3,matrixHeight:128e3},{type:"TileMatrixType",identifier:"15",scaleDenominator:500,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:128e3,matrixHeight:256e3},{type:"TileMatrixType",identifier:"16",scaleDenominator:250,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:256e3,matrixHeight:512e3}]}});var tS=Vt(xc=>{"use strict";Object.defineProperty(xc,"__esModule",{value:!0});xc.Nztm2000=xc.Nztm2000Quad=void 0;var s5=KI();Object.defineProperty(xc,"Nztm2000Quad",{enumerable:!0,get:function(){return s5.Nztm2000Quad}});var a5=eS();Object.defineProperty(xc,"Nztm2000",{enumerable:!0,get:function(){return a5.Nztm2000}})});var rS=Vt((tN,iS)=>{"use strict";iS.exports=Nm;Nm.polyline=Nm;Nm.polygon=l5;function Nm(e,t,r){var a=e.length,u=_c(e[0],t),o=[],m,v,b,C,T;for(r||(r=[]),m=1;m<a;m++){for(v=e[m-1],b=e[m],C=T=_c(b,t);;)if(u|C){if(u&C)break;u?(v=x1(v,b,u,t),u=_c(v,t)):(b=x1(v,b,C,t),C=_c(b,t))}else{o.push(v),C!==T?(o.push(b),m<a-1&&(r.push(o),o=[])):m===a-1&&o.push(b);break}u=T}return o.length&&r.push(o),r}function l5(e,t){var r,a,u,o,m,v,b;for(a=1;a<=8;a*=2){for(r=[],u=e[e.length-1],o=!(_c(u,t)&a),m=0;m<e.length;m++)v=e[m],b=!(_c(v,t)&a),b!==o&&r.push(x1(u,v,a,t)),b&&r.push(v),u=v,o=b;if(e=r,!e.length)break}return r}function x1(e,t,r,a){return r&8?[e[0]+(t[0]-e[0])*(a[3]-e[1])/(t[1]-e[1]),a[3]]:r&4?[e[0]+(t[0]-e[0])*(a[1]-e[1])/(t[1]-e[1]),a[1]]:r&2?[a[2],e[1]+(t[1]-e[1])*(a[2]-e[0])/(t[0]-e[0])]:r&1?[a[0],e[1]+(t[1]-e[1])*(a[0]-e[0])/(t[0]-e[0])]:null}function _c(e,t){var r=0;return e[0]<t[0]?r|=1:e[0]>t[2]&&(r|=2),e[1]<t[1]?r|=4:e[1]>t[3]&&(r|=8),r}});var nS=Vt((_1,b1)=>{(function(e,t){typeof _1=="object"&&typeof b1<"u"?b1.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.polygonClipping=t())})(_1,function(){"use strict";function e(_e,V){if(!(_e instanceof V))throw new TypeError("Cannot call a class as a function")}function t(_e,V){for(var F=0;F<V.length;F++){var U=V[F];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(_e,U.key,U)}}function r(_e,V,F){return V&&t(_e.prototype,V),F&&t(_e,F),_e}var a=function(){function _e(V,F){this.next=null,this.key=V,this.data=F,this.left=null,this.right=null}return _e}();function u(_e,V){return _e>V?1:_e<V?-1:0}function o(_e,V,F){for(var U=new a(null,null),K=U,he=U;;){var Se=F(_e,V.key);if(Se<0){if(V.left===null)break;if(F(_e,V.left.key)<0){var Ve=V.left;if(V.left=Ve.right,Ve.right=V,V=Ve,V.left===null)break}he.left=V,he=V,V=V.left}else if(Se>0){if(V.right===null)break;if(F(_e,V.right.key)>0){var Ve=V.right;if(V.right=Ve.left,Ve.left=V,V=Ve,V.right===null)break}K.right=V,K=V,V=V.right}else break}return K.right=V.left,he.left=V.right,V.left=U.right,V.right=U.left,V}function m(_e,V,F,U){var K=new a(_e,V);if(F===null)return K.left=K.right=null,K;F=o(_e,F,U);var he=U(_e,F.key);return he<0?(K.left=F.left,K.right=F,F.left=null):he>=0&&(K.right=F.right,K.left=F,F.right=null),K}function v(_e,V,F){var U=null,K=null;if(V){V=o(_e,V,F);var he=F(V.key,_e);he===0?(U=V.left,K=V.right):he<0?(K=V.right,V.right=null,U=V):(U=V.left,V.left=null,K=V)}return{left:U,right:K}}function b(_e,V,F){return V===null?_e:(_e===null||(V=o(_e.key,V,F),V.left=_e),V)}function C(_e,V,F,U,K){if(_e){U(""+V+(F?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ")+K(_e)+`
|
|
9
|
-
`);var he=V+(F?" ":"\u2502 ");_e.left&&C(_e.left,he,!1,U,K),_e.right&&C(_e.right,he,!0,U,K)}}var T=function(){function _e(V){V===void 0&&(V=u),this._root=null,this._size=0,this._comparator=V}return _e.prototype.insert=function(V,F){return this._size++,this._root=m(V,F,this._root,this._comparator)},_e.prototype.add=function(V,F){var U=new a(V,F);this._root===null&&(U.left=U.right=null,this._size++,this._root=U);var K=this._comparator,he=o(V,this._root,K),Se=K(V,he.key);return Se===0?this._root=he:(Se<0?(U.left=he.left,U.right=he,he.left=null):Se>0&&(U.right=he.right,U.left=he,he.right=null),this._size++,this._root=U),this._root},_e.prototype.remove=function(V){this._root=this._remove(V,this._root,this._comparator)},_e.prototype._remove=function(V,F,U){var K;if(F===null)return null;F=o(V,F,U);var he=U(V,F.key);return he===0?(F.left===null?K=F.right:(K=o(V,F.left,U),K.right=F.right),this._size--,K):F},_e.prototype.pop=function(){var V=this._root;if(V){for(;V.left;)V=V.left;return this._root=o(V.key,this._root,this._comparator),this._root=this._remove(V.key,this._root,this._comparator),{key:V.key,data:V.data}}return null},_e.prototype.findStatic=function(V){for(var F=this._root,U=this._comparator;F;){var K=U(V,F.key);if(K===0)return F;K<0?F=F.left:F=F.right}return null},_e.prototype.find=function(V){return this._root&&(this._root=o(V,this._root,this._comparator),this._comparator(V,this._root.key)!==0)?null:this._root},_e.prototype.contains=function(V){for(var F=this._root,U=this._comparator;F;){var K=U(V,F.key);if(K===0)return!0;K<0?F=F.left:F=F.right}return!1},_e.prototype.forEach=function(V,F){for(var U=this._root,K=[],he=!1;!he;)U!==null?(K.push(U),U=U.left):K.length!==0?(U=K.pop(),V.call(F,U),U=U.right):he=!0;return this},_e.prototype.range=function(V,F,U,K){for(var he=[],Se=this._comparator,Ve=this._root,He;he.length!==0||Ve;)if(Ve)he.push(Ve),Ve=Ve.left;else{if(Ve=he.pop(),He=Se(Ve.key,F),He>0)break;if(Se(Ve.key,V)>=0&&U.call(K,Ve))return this;Ve=Ve.right}return this},_e.prototype.keys=function(){var V=[];return this.forEach(function(F){var U=F.key;return V.push(U)}),V},_e.prototype.values=function(){var V=[];return this.forEach(function(F){var U=F.data;return V.push(U)}),V},_e.prototype.min=function(){return this._root?this.minNode(this._root).key:null},_e.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},_e.prototype.minNode=function(V){if(V===void 0&&(V=this._root),V)for(;V.left;)V=V.left;return V},_e.prototype.maxNode=function(V){if(V===void 0&&(V=this._root),V)for(;V.right;)V=V.right;return V},_e.prototype.at=function(V){for(var F=this._root,U=!1,K=0,he=[];!U;)if(F)he.push(F),F=F.left;else if(he.length>0){if(F=he.pop(),K===V)return F;K++,F=F.right}else U=!0;return null},_e.prototype.next=function(V){var F=this._root,U=null;if(V.right){for(U=V.right;U.left;)U=U.left;return U}for(var K=this._comparator;F;){var he=K(V.key,F.key);if(he===0)break;he<0?(U=F,F=F.left):F=F.right}return U},_e.prototype.prev=function(V){var F=this._root,U=null;if(V.left!==null){for(U=V.left;U.right;)U=U.right;return U}for(var K=this._comparator;F;){var he=K(V.key,F.key);if(he===0)break;he<0?F=F.left:(U=F,F=F.right)}return U},_e.prototype.clear=function(){return this._root=null,this._size=0,this},_e.prototype.toList=function(){return q(this._root)},_e.prototype.load=function(V,F,U){F===void 0&&(F=[]),U===void 0&&(U=!1);var K=V.length,he=this._comparator;if(U&&de(V,F,0,K-1,he),this._root===null)this._root=B(V,F,0,K),this._size=K;else{var Se=le(this.toList(),W(V,F),he);K=this._size+K,this._root=ee({head:Se},0,K)}return this},_e.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(_e.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(_e.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),_e.prototype.toString=function(V){V===void 0&&(V=function(K){return String(K.key)});var F=[];return C(this._root,"",!0,function(U){return F.push(U)},V),F.join("")},_e.prototype.update=function(V,F,U){var K=this._comparator,he=v(V,this._root,K),Se=he.left,Ve=he.right;K(V,F)<0?Ve=m(F,U,Ve,K):Se=m(F,U,Se,K),this._root=b(Se,Ve,K)},_e.prototype.split=function(V){return v(V,this._root,this._comparator)},_e}();function B(_e,V,F,U){var K=U-F;if(K>0){var he=F+Math.floor(K/2),Se=_e[he],Ve=V[he],He=new a(Se,Ve);return He.left=B(_e,V,F,he),He.right=B(_e,V,he+1,U),He}return null}function W(_e,V){for(var F=new a(null,null),U=F,K=0;K<_e.length;K++)U=U.next=new a(_e[K],V[K]);return U.next=null,F.next}function q(_e){for(var V=_e,F=[],U=!1,K=new a(null,null),he=K;!U;)V?(F.push(V),V=V.left):F.length>0?(V=he=he.next=F.pop(),V=V.right):U=!0;return he.next=null,K.next}function ee(_e,V,F){var U=F-V;if(U>0){var K=V+Math.floor(U/2),he=ee(_e,V,K),Se=_e.head;return Se.left=he,_e.head=_e.head.next,Se.right=ee(_e,K+1,F),Se}return null}function le(_e,V,F){for(var U=new a(null,null),K=U,he=_e,Se=V;he!==null&&Se!==null;)F(he.key,Se.key)<0?(K.next=he,he=he.next):(K.next=Se,Se=Se.next),K=K.next;return he!==null?K.next=he:Se!==null&&(K.next=Se),U.next}function de(_e,V,F,U,K){if(!(F>=U)){for(var he=_e[F+U>>1],Se=F-1,Ve=U+1;;){do Se++;while(K(_e[Se],he)<0);do Ve--;while(K(_e[Ve],he)>0);if(Se>=Ve)break;var He=_e[Se];_e[Se]=_e[Ve],_e[Ve]=He,He=V[Se],V[Se]=V[Ve],V[Ve]=He}de(_e,V,F,Ve,K),de(_e,V,Ve+1,U,K)}}var H=function(V,F){return V.ll.x<=F.x&&F.x<=V.ur.x&&V.ll.y<=F.y&&F.y<=V.ur.y},Q=function(V,F){if(F.ur.x<V.ll.x||V.ur.x<F.ll.x||F.ur.y<V.ll.y||V.ur.y<F.ll.y)return null;var U=V.ll.x<F.ll.x?F.ll.x:V.ll.x,K=V.ur.x<F.ur.x?V.ur.x:F.ur.x,he=V.ll.y<F.ll.y?F.ll.y:V.ll.y,Se=V.ur.y<F.ur.y?V.ur.y:F.ur.y;return{ll:{x:U,y:he},ur:{x:K,y:Se}}},te=Number.EPSILON;te===void 0&&(te=Math.pow(2,-52));var ve=te*te,Me=function(V,F){if(-te<V&&V<te&&-te<F&&F<te)return 0;var U=V-F;return U*U<ve*V*F?0:V<F?-1:1},Ce=function(){function _e(){e(this,_e),this.reset()}return r(_e,[{key:"reset",value:function(){this.xRounder=new Be,this.yRounder=new Be}},{key:"round",value:function(F,U){return{x:this.xRounder.round(F),y:this.yRounder.round(U)}}}]),_e}(),Be=function(){function _e(){e(this,_e),this.tree=new T,this.round(0)}return r(_e,[{key:"round",value:function(F){var U=this.tree.add(F),K=this.tree.prev(U);if(K!==null&&Me(U.key,K.key)===0)return this.tree.remove(F),K.key;var he=this.tree.next(U);return he!==null&&Me(U.key,he.key)===0?(this.tree.remove(F),he.key):F}}]),_e}(),Fe=new Ce,qe=function(V,F){return V.x*F.y-V.y*F.x},ht=function(V,F){return V.x*F.x+V.y*F.y},Tt=function(V,F,U){var K={x:F.x-V.x,y:F.y-V.y},he={x:U.x-V.x,y:U.y-V.y},Se=qe(K,he);return Me(Se,0)},Gt=function(V){return Math.sqrt(ht(V,V))},Jt=function(V,F,U){var K={x:F.x-V.x,y:F.y-V.y},he={x:U.x-V.x,y:U.y-V.y};return qe(he,K)/Gt(he)/Gt(K)},at=function(V,F,U){var K={x:F.x-V.x,y:F.y-V.y},he={x:U.x-V.x,y:U.y-V.y};return ht(he,K)/Gt(he)/Gt(K)},jt=function(V,F,U){return F.y===0?null:{x:V.x+F.x/F.y*(U-V.y),y:U}},zi=function(V,F,U){return F.x===0?null:{x:U,y:V.y+F.y/F.x*(U-V.x)}},Ii=function(V,F,U,K){if(F.x===0)return zi(U,K,V.x);if(K.x===0)return zi(V,F,U.x);if(F.y===0)return jt(U,K,V.y);if(K.y===0)return jt(V,F,U.y);var he=qe(F,K);if(he==0)return null;var Se={x:U.x-V.x,y:U.y-V.y},Ve=qe(Se,F)/he,He=qe(Se,K)/he,ye=V.x+He*F.x,Re=U.x+Ve*K.x,ie=V.y+He*F.y,Xe=U.y+Ve*K.y,$e=(ye+Re)/2,ft=(ie+Xe)/2;return{x:$e,y:ft}},Ht=function(){r(_e,null,[{key:"compare",value:function(F,U){var K=_e.comparePoints(F.point,U.point);return K!==0?K:(F.point!==U.point&&F.link(U),F.isLeft!==U.isLeft?F.isLeft?1:-1:Xi.compare(F.segment,U.segment))}},{key:"comparePoints",value:function(F,U){return F.x<U.x?-1:F.x>U.x?1:F.y<U.y?-1:F.y>U.y?1:0}}]);function _e(V,F){e(this,_e),V.events===void 0?V.events=[this]:V.events.push(this),this.point=V,this.isLeft=F}return r(_e,[{key:"link",value:function(F){if(F.point===this.point)throw new Error("Tried to link already linked events");for(var U=F.point.events,K=0,he=U.length;K<he;K++){var Se=U[K];this.point.events.push(Se),Se.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var F=this.point.events.length,U=0;U<F;U++){var K=this.point.events[U];if(K.segment.consumedBy===void 0)for(var he=U+1;he<F;he++){var Se=this.point.events[he];Se.consumedBy===void 0&&K.otherSE.point.events===Se.otherSE.point.events&&K.segment.consume(Se.segment)}}}},{key:"getAvailableLinkedEvents",value:function(){for(var F=[],U=0,K=this.point.events.length;U<K;U++){var he=this.point.events[U];he!==this&&!he.segment.ringOut&&he.segment.isInResult()&&F.push(he)}return F}},{key:"getLeftmostComparator",value:function(F){var U=this,K=new Map,he=function(Ve){var He=Ve.otherSE;K.set(Ve,{sine:Jt(U.point,F.point,He.point),cosine:at(U.point,F.point,He.point)})};return function(Se,Ve){K.has(Se)||he(Se),K.has(Ve)||he(Ve);var He=K.get(Se),ye=He.sine,Re=He.cosine,ie=K.get(Ve),Xe=ie.sine,$e=ie.cosine;return ye>=0&&Xe>=0?Re<$e?1:Re>$e?-1:0:ye<0&&Xe<0?Re<$e?-1:Re>$e?1:0:Xe<ye?-1:Xe>ye?1:0}}}]),_e}(),ur=0,Xi=function(){r(_e,null,[{key:"compare",value:function(F,U){var K=F.leftSE.point.x,he=U.leftSE.point.x,Se=F.rightSE.point.x,Ve=U.rightSE.point.x;if(Ve<K)return 1;if(Se<he)return-1;var He=F.leftSE.point.y,ye=U.leftSE.point.y,Re=F.rightSE.point.y,ie=U.rightSE.point.y;if(K<he){if(ye<He&&ye<Re)return 1;if(ye>He&&ye>Re)return-1;var Xe=F.comparePoint(U.leftSE.point);if(Xe<0)return 1;if(Xe>0)return-1;var $e=U.comparePoint(F.rightSE.point);return $e!==0?$e:-1}if(K>he){if(He<ye&&He<ie)return-1;if(He>ye&&He>ie)return 1;var ft=U.comparePoint(F.leftSE.point);if(ft!==0)return ft;var ut=F.comparePoint(U.rightSE.point);return ut<0?1:ut>0?-1:1}if(He<ye)return-1;if(He>ye)return 1;if(Se<Ve){var Xt=U.comparePoint(F.rightSE.point);if(Xt!==0)return Xt}if(Se>Ve){var At=F.comparePoint(U.rightSE.point);if(At<0)return 1;if(At>0)return-1}if(Se!==Ve){var Ue=Re-He,It=Se-K,yt=ie-ye,ni=Ve-he;if(Ue>It&&yt<ni)return 1;if(Ue<It&&yt>ni)return-1}return Se>Ve?1:Se<Ve||Re<ie?-1:Re>ie?1:F.id<U.id?-1:F.id>U.id?1:0}}]);function _e(V,F,U,K){e(this,_e),this.id=++ur,this.leftSE=V,V.segment=this,V.otherSE=F,this.rightSE=F,F.segment=this,F.otherSE=V,this.rings=U,this.windings=K}return r(_e,[{key:"replaceRightSE",value:function(F){this.rightSE=F,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var F=this.leftSE.point.y,U=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:F<U?F:U},ur:{x:this.rightSE.point.x,y:F>U?F:U}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(F){return F.x===this.leftSE.point.x&&F.y===this.leftSE.point.y||F.x===this.rightSE.point.x&&F.y===this.rightSE.point.y}},{key:"comparePoint",value:function(F){if(this.isAnEndpoint(F))return 0;var U=this.leftSE.point,K=this.rightSE.point,he=this.vector();if(U.x===K.x)return F.x===U.x?0:F.x<U.x?1:-1;var Se=(F.y-U.y)/he.y,Ve=U.x+Se*he.x;if(F.x===Ve)return 0;var He=(F.x-U.x)/he.x,ye=U.y+He*he.y;return F.y===ye?0:F.y<ye?-1:1}},{key:"getIntersection",value:function(F){var U=this.bbox(),K=F.bbox(),he=Q(U,K);if(he===null)return null;var Se=this.leftSE.point,Ve=this.rightSE.point,He=F.leftSE.point,ye=F.rightSE.point,Re=H(U,He)&&this.comparePoint(He)===0,ie=H(K,Se)&&F.comparePoint(Se)===0,Xe=H(U,ye)&&this.comparePoint(ye)===0,$e=H(K,Ve)&&F.comparePoint(Ve)===0;if(ie&&Re)return $e&&!Xe?Ve:!$e&&Xe?ye:null;if(ie)return Xe&&Se.x===ye.x&&Se.y===ye.y?null:Se;if(Re)return $e&&Ve.x===He.x&&Ve.y===He.y?null:He;if($e&&Xe)return null;if($e)return Ve;if(Xe)return ye;var ft=Ii(Se,this.vector(),He,F.vector());return ft===null||!H(he,ft)?null:Fe.round(ft.x,ft.y)}},{key:"split",value:function(F){var U=[],K=F.events!==void 0,he=new Ht(F,!0),Se=new Ht(F,!1),Ve=this.rightSE;this.replaceRightSE(Se),U.push(Se),U.push(he);var He=new _e(he,Ve,this.rings.slice(),this.windings.slice());return Ht.comparePoints(He.leftSE.point,He.rightSE.point)>0&&He.swapEvents(),Ht.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),K&&(he.checkForConsuming(),Se.checkForConsuming()),U}},{key:"swapEvents",value:function(){var F=this.rightSE;this.rightSE=this.leftSE,this.leftSE=F,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var U=0,K=this.windings.length;U<K;U++)this.windings[U]*=-1}},{key:"consume",value:function(F){for(var U=this,K=F;U.consumedBy;)U=U.consumedBy;for(;K.consumedBy;)K=K.consumedBy;var he=_e.compare(U,K);if(he!==0){if(he>0){var Se=U;U=K,K=Se}if(U.prev===K){var Ve=U;U=K,K=Ve}for(var He=0,ye=K.rings.length;He<ye;He++){var Re=K.rings[He],ie=K.windings[He],Xe=U.rings.indexOf(Re);Xe===-1?(U.rings.push(Re),U.windings.push(ie)):U.windings[Xe]+=ie}K.rings=null,K.windings=null,K.consumedBy=U,K.leftSE.consumedBy=U.leftSE,K.rightSE.consumedBy=U.rightSE}}},{key:"prevInResult",value:function(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}},{key:"beforeState",value:function(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{var F=this.prev.consumedBy||this.prev;this._beforeState=F.afterState()}return this._beforeState}},{key:"afterState",value:function(){if(this._afterState!==void 0)return this._afterState;var F=this.beforeState();this._afterState={rings:F.rings.slice(0),windings:F.windings.slice(0),multiPolys:[]};for(var U=this._afterState.rings,K=this._afterState.windings,he=this._afterState.multiPolys,Se=0,Ve=this.rings.length;Se<Ve;Se++){var He=this.rings[Se],ye=this.windings[Se],Re=U.indexOf(He);Re===-1?(U.push(He),K.push(ye)):K[Re]+=ye}for(var ie=[],Xe=[],$e=0,ft=U.length;$e<ft;$e++)if(K[$e]!==0){var ut=U[$e],Xt=ut.poly;if(Xe.indexOf(Xt)===-1)if(ut.isExterior)ie.push(Xt);else{Xe.indexOf(Xt)===-1&&Xe.push(Xt);var At=ie.indexOf(ut.poly);At!==-1&&ie.splice(At,1)}}for(var Ue=0,It=ie.length;Ue<It;Ue++){var yt=ie[Ue].multiPoly;he.indexOf(yt)===-1&&he.push(yt)}return this._afterState}},{key:"isInResult",value:function(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;var F=this.beforeState().multiPolys,U=this.afterState().multiPolys;switch(ri.type){case"union":{var K=F.length===0,he=U.length===0;this._isInResult=K!==he;break}case"intersection":{var Se,Ve;F.length<U.length?(Se=F.length,Ve=U.length):(Se=U.length,Ve=F.length),this._isInResult=Ve===ri.numMultiPolys&&Se<Ve;break}case"xor":{var He=Math.abs(F.length-U.length);this._isInResult=He%2===1;break}case"difference":{var ye=function(ie){return ie.length===1&&ie[0].isSubject};this._isInResult=ye(F)!==ye(U);break}default:throw new Error("Unrecognized operation type found ".concat(ri.type))}return this._isInResult}}],[{key:"fromRing",value:function(F,U,K){var he,Se,Ve,He=Ht.comparePoints(F,U);if(He<0)he=F,Se=U,Ve=1;else if(He>0)he=U,Se=F,Ve=-1;else throw new Error("Tried to create degenerate segment at [".concat(F.x,", ").concat(F.y,"]"));var ye=new Ht(he,!0),Re=new Ht(Se,!1);return new _e(ye,Re,[K],[Ve])}}]),_e}(),si=function(){function _e(V,F,U){if(e(this,_e),!Array.isArray(V)||V.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=F,this.isExterior=U,this.segments=[],typeof V[0][0]!="number"||typeof V[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var K=Fe.round(V[0][0],V[0][1]);this.bbox={ll:{x:K.x,y:K.y},ur:{x:K.x,y:K.y}};for(var he=K,Se=1,Ve=V.length;Se<Ve;Se++){if(typeof V[Se][0]!="number"||typeof V[Se][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var He=Fe.round(V[Se][0],V[Se][1]);He.x===he.x&&He.y===he.y||(this.segments.push(Xi.fromRing(he,He,this)),He.x<this.bbox.ll.x&&(this.bbox.ll.x=He.x),He.y<this.bbox.ll.y&&(this.bbox.ll.y=He.y),He.x>this.bbox.ur.x&&(this.bbox.ur.x=He.x),He.y>this.bbox.ur.y&&(this.bbox.ur.y=He.y),he=He)}(K.x!==he.x||K.y!==he.y)&&this.segments.push(Xi.fromRing(he,K,this))}return r(_e,[{key:"getSweepEvents",value:function(){for(var F=[],U=0,K=this.segments.length;U<K;U++){var he=this.segments[U];F.push(he.leftSE),F.push(he.rightSE)}return F}}]),_e}(),ii=function(){function _e(V,F){if(e(this,_e),!Array.isArray(V))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new si(V[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(var U=1,K=V.length;U<K;U++){var he=new si(V[U],this,!1);he.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=he.bbox.ll.x),he.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=he.bbox.ll.y),he.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=he.bbox.ur.x),he.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=he.bbox.ur.y),this.interiorRings.push(he)}this.multiPoly=F}return r(_e,[{key:"getSweepEvents",value:function(){for(var F=this.exteriorRing.getSweepEvents(),U=0,K=this.interiorRings.length;U<K;U++)for(var he=this.interiorRings[U].getSweepEvents(),Se=0,Ve=he.length;Se<Ve;Se++)F.push(he[Se]);return F}}]),_e}(),_i=function(){function _e(V,F){if(e(this,_e),!Array.isArray(V))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof V[0][0][0]=="number"&&(V=[V])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var U=0,K=V.length;U<K;U++){var he=new ii(V[U],this);he.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=he.bbox.ll.x),he.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=he.bbox.ll.y),he.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=he.bbox.ur.x),he.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=he.bbox.ur.y),this.polys.push(he)}this.isSubject=F}return r(_e,[{key:"getSweepEvents",value:function(){for(var F=[],U=0,K=this.polys.length;U<K;U++)for(var he=this.polys[U].getSweepEvents(),Se=0,Ve=he.length;Se<Ve;Se++)F.push(he[Se]);return F}}]),_e}(),Ei=function(){r(_e,null,[{key:"factory",value:function(F){for(var U=[],K=0,he=F.length;K<he;K++){var Se=F[K];if(!(!Se.isInResult()||Se.ringOut)){for(var Ve=null,He=Se.leftSE,ye=Se.rightSE,Re=[He],ie=He.point,Xe=[];Ve=He,He=ye,Re.push(He),He.point!==ie;)for(;;){var $e=He.getAvailableLinkedEvents();if($e.length===0){var ft=Re[0].point,ut=Re[Re.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(ft.x,",")+" ".concat(ft.y,"]. Last matching segment found ends at")+" [".concat(ut.x,", ").concat(ut.y,"]."))}if($e.length===1){ye=$e[0].otherSE;break}for(var Xt=null,At=0,Ue=Xe.length;At<Ue;At++)if(Xe[At].point===He.point){Xt=At;break}if(Xt!==null){var It=Xe.splice(Xt)[0],yt=Re.splice(It.index);yt.unshift(yt[0].otherSE),U.push(new _e(yt.reverse()));continue}Xe.push({index:Re.length,point:He.point});var ni=He.getLeftmostComparator(Ve);ye=$e.sort(ni)[0].otherSE;break}U.push(new _e(Re))}}return U}}]);function _e(V){e(this,_e),this.events=V;for(var F=0,U=V.length;F<U;F++)V[F].segment.ringOut=this;this.poly=null}return r(_e,[{key:"getGeom",value:function(){for(var F=this.events[0].point,U=[F],K=1,he=this.events.length-1;K<he;K++){var Se=this.events[K].point,Ve=this.events[K+1].point;Tt(Se,F,Ve)!==0&&(U.push(Se),F=Se)}if(U.length===1)return null;var He=U[0],ye=U[1];Tt(He,F,ye)===0&&U.shift(),U.push(U[0]);for(var Re=this.isExteriorRing()?1:-1,ie=this.isExteriorRing()?0:U.length-1,Xe=this.isExteriorRing()?U.length:-1,$e=[],ft=ie;ft!=Xe;ft+=Re)$e.push([U[ft].x,U[ft].y]);return $e}},{key:"isExteriorRing",value:function(){if(this._isExteriorRing===void 0){var F=this.enclosingRing();this._isExteriorRing=F?!F.isExteriorRing():!0}return this._isExteriorRing}},{key:"enclosingRing",value:function(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}},{key:"_calcEnclosingRing",value:function(){for(var F=this.events[0],U=1,K=this.events.length;U<K;U++){var he=this.events[U];Ht.compare(F,he)>0&&(F=he)}for(var Se=F.segment.prevInResult(),Ve=Se?Se.prevInResult():null;;){if(!Se)return null;if(!Ve)return Se.ringOut;if(Ve.ringOut!==Se.ringOut)return Ve.ringOut.enclosingRing()!==Se.ringOut?Se.ringOut:Se.ringOut.enclosingRing();Se=Ve.prevInResult(),Ve=Se?Se.prevInResult():null}}}]),_e}(),Li=function(){function _e(V){e(this,_e),this.exteriorRing=V,V.poly=this,this.interiorRings=[]}return r(_e,[{key:"addInterior",value:function(F){this.interiorRings.push(F),F.poly=this}},{key:"getGeom",value:function(){var F=[this.exteriorRing.getGeom()];if(F[0]===null)return null;for(var U=0,K=this.interiorRings.length;U<K;U++){var he=this.interiorRings[U].getGeom();he!==null&&F.push(he)}return F}}]),_e}(),Fi=function(){function _e(V){e(this,_e),this.rings=V,this.polys=this._composePolys(V)}return r(_e,[{key:"getGeom",value:function(){for(var F=[],U=0,K=this.polys.length;U<K;U++){var he=this.polys[U].getGeom();he!==null&&F.push(he)}return F}},{key:"_composePolys",value:function(F){for(var U=[],K=0,he=F.length;K<he;K++){var Se=F[K];if(!Se.poly)if(Se.isExteriorRing())U.push(new Li(Se));else{var Ve=Se.enclosingRing();Ve.poly||U.push(new Li(Ve)),Ve.poly.addInterior(Se)}}return U}}]),_e}(),Ji=function(){function _e(V){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Xi.compare;e(this,_e),this.queue=V,this.tree=new T(F),this.segments=[]}return r(_e,[{key:"process",value:function(F){var U=F.segment,K=[];if(F.consumedBy)return F.isLeft?this.queue.remove(F.otherSE):this.tree.remove(U),K;var he=F.isLeft?this.tree.insert(U):this.tree.find(U);if(!he)throw new Error("Unable to find segment #".concat(U.id," ")+"[".concat(U.leftSE.point.x,", ").concat(U.leftSE.point.y,"] -> ")+"[".concat(U.rightSE.point.x,", ").concat(U.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var Se=he,Ve=he,He=void 0,ye=void 0;He===void 0;)Se=this.tree.prev(Se),Se===null?He=null:Se.key.consumedBy===void 0&&(He=Se.key);for(;ye===void 0;)Ve=this.tree.next(Ve),Ve===null?ye=null:Ve.key.consumedBy===void 0&&(ye=Ve.key);if(F.isLeft){var Re=null;if(He){var ie=He.getIntersection(U);if(ie!==null&&(U.isAnEndpoint(ie)||(Re=ie),!He.isAnEndpoint(ie)))for(var Xe=this._splitSafely(He,ie),$e=0,ft=Xe.length;$e<ft;$e++)K.push(Xe[$e])}var ut=null;if(ye){var Xt=ye.getIntersection(U);if(Xt!==null&&(U.isAnEndpoint(Xt)||(ut=Xt),!ye.isAnEndpoint(Xt)))for(var At=this._splitSafely(ye,Xt),Ue=0,It=At.length;Ue<It;Ue++)K.push(At[Ue])}if(Re!==null||ut!==null){var yt=null;if(Re===null)yt=ut;else if(ut===null)yt=Re;else{var ni=Ht.comparePoints(Re,ut);yt=ni<=0?Re:ut}this.queue.remove(U.rightSE),K.push(U.rightSE);for(var gi=U.split(yt),St=0,tr=gi.length;St<tr;St++)K.push(gi[St])}K.length>0?(this.tree.remove(U),K.push(F)):(this.segments.push(U),U.prev=He)}else{if(He&&ye){var ci=He.getIntersection(ye);if(ci!==null){if(!He.isAnEndpoint(ci))for(var Ri=this._splitSafely(He,ci),hi=0,Ft=Ri.length;hi<Ft;hi++)K.push(Ri[hi]);if(!ye.isAnEndpoint(ci))for(var di=this._splitSafely(ye,ci),ir=0,Ti=di.length;ir<Ti;ir++)K.push(di[ir])}}this.tree.remove(U)}return K}},{key:"_splitSafely",value:function(F,U){this.tree.remove(F);var K=F.rightSE;this.queue.remove(K);var he=F.split(U);return he.push(K),F.consumedBy===void 0&&this.tree.insert(F),he}}]),_e}(),Mr=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,tn=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,oo=function(){function _e(){e(this,_e)}return r(_e,[{key:"run",value:function(F,U,K){ri.type=F,Fe.reset();for(var he=[new _i(U,!0)],Se=0,Ve=K.length;Se<Ve;Se++)he.push(new _i(K[Se],!1));if(ri.numMultiPolys=he.length,ri.type==="difference")for(var He=he[0],ye=1;ye<he.length;)Q(he[ye].bbox,He.bbox)!==null?ye++:he.splice(ye,1);if(ri.type==="intersection"){for(var Re=0,ie=he.length;Re<ie;Re++)for(var Xe=he[Re],$e=Re+1,ft=he.length;$e<ft;$e++)if(Q(Xe.bbox,he[$e].bbox)===null)return[]}for(var ut=new T(Ht.compare),Xt=0,At=he.length;Xt<At;Xt++)for(var Ue=he[Xt].getSweepEvents(),It=0,yt=Ue.length;It<yt;It++)if(ut.insert(Ue[It]),ut.size>Mr)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var ni=new Ji(ut),gi=ut.size,St=ut.pop();St;){var tr=St.key;if(ut.size===gi){var ci=tr.segment;throw new Error("Unable to pop() ".concat(tr.isLeft?"left":"right"," SweepEvent ")+"[".concat(tr.point.x,", ").concat(tr.point.y,"] from segment #").concat(ci.id," ")+"[".concat(ci.leftSE.point.x,", ").concat(ci.leftSE.point.y,"] -> ")+"[".concat(ci.rightSE.point.x,", ").concat(ci.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(ut.size>Mr)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(ni.segments.length>tn)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var Ri=ni.process(tr),hi=0,Ft=Ri.length;hi<Ft;hi++){var di=Ri[hi];di.consumedBy===void 0&&ut.insert(di)}gi=ut.size,St=ut.pop()}Fe.reset();var ir=Ei.factory(ni.segments),Ti=new Fi(ir);return Ti.getGeom()}}]),_e}(),ri=new oo,Hr=function(V){for(var F=arguments.length,U=new Array(F>1?F-1:0),K=1;K<F;K++)U[K-1]=arguments[K];return ri.run("union",V,U)},hn=function(V){for(var F=arguments.length,U=new Array(F>1?F-1:0),K=1;K<F;K++)U[K-1]=arguments[K];return ri.run("intersection",V,U)},rn=function(V){for(var F=arguments.length,U=new Array(F>1?F-1:0),K=1;K<F;K++)U[K-1]=arguments[K];return ri.run("xor",V,U)},Lr=function(V){for(var F=arguments.length,U=new Array(F>1?F-1:0),K=1;K<F;K++)U[K-1]=arguments[K];return ri.run("difference",V,U)},es={union:Hr,intersection:hn,xor:rn,difference:Lr};return es})});var XC=Vt(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});ta.once=ta.Emitter=ta.ALL_EVENTS=void 0;ta.ALL_EVENTS=Symbol("ALL_EVENTS");function KL(e,t){return e.add(t),function(){return e.delete(t)}}function HC(e,...t){if(e)for(let{fn:r}of e)r(...t)}var O1=class{constructor(){this.$=Object.create(null)}on(t,r){let a=this.$[t]=this.$[t]||new Set;return KL(a,{fn:r})}emit(t,...r){HC(this.$[t],...r),HC(this.$[ta.ALL_EVENTS],{type:t,args:r})}};ta.Emitter=O1;function e6(e,t,r){let a=e.on(t,function(...o){return a(),r(...o)});return a}ta.once=e6});var ig=Vt((V1,U1)=>{(function(e,t){typeof V1=="object"&&typeof U1<"u"?U1.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.maplibregl=t())})(V1,function(){"use strict";var e,t,r;function a(o,m){if(!e)e=m;else if(!t)t=m;else{var v="var sharedChunk = {}; ("+e+")(sharedChunk); ("+t+")(sharedChunk);",b={};e(b),r=m(b),typeof window<"u"&&(r.workerUrl=window.URL.createObjectURL(new Blob([v],{type:"text/javascript"})))}}a(["exports"],function(o){"use strict";var m=v;function v(s,i,l,h){this.cx=3*s,this.bx=3*(l-s)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*i,this.by=3*(h-i)-this.cy,this.ay=1-this.cy-this.by,this.p1x=s,this.p1y=i,this.p2x=l,this.p2y=h}function b(s,i,l,h){let p=new m(s,i,l,h);return function(y){return p.solve(y)}}v.prototype={sampleCurveX:function(s){return((this.ax*s+this.bx)*s+this.cx)*s},sampleCurveY:function(s){return((this.ay*s+this.by)*s+this.cy)*s},sampleCurveDerivativeX:function(s){return(3*this.ax*s+2*this.bx)*s+this.cx},solveCurveX:function(s,i){if(i===void 0&&(i=1e-6),s<0)return 0;if(s>1)return 1;for(var l=s,h=0;h<8;h++){var p=this.sampleCurveX(l)-s;if(Math.abs(p)<i)return l;var y=this.sampleCurveDerivativeX(l);if(Math.abs(y)<1e-6)break;l-=p/y}var x=0,w=1;for(l=s,h=0;h<20&&(p=this.sampleCurveX(l),!(Math.abs(p-s)<i));h++)s>p?x=l:w=l,l=.5*(w-x)+x;return l},solve:function(s,i){return this.sampleCurveY(this.solveCurveX(s,i))}};let C=b(.25,.1,.25,1);function T(s,i,l){return Math.min(l,Math.max(i,s))}function B(s,i,l){let h=l-i,p=((s-i)%h+h)%h+i;return p===i?l:p}function W(s,...i){for(let l of i)for(let h in l)s[h]=l[h];return s}let q=1;function ee(s,i){s.forEach(l=>{i[l]&&(i[l]=i[l].bind(i))})}function le(s,i,l){let h={};for(let p in s)h[p]=i.call(l||this,s[p],p,s);return h}function de(s,i,l){let h={};for(let p in s)i.call(l||this,s[p],p,s)&&(h[p]=s[p]);return h}function H(s){return Array.isArray(s)?s.map(H):typeof s=="object"&&s?le(s,H):s}let Q={};function te(s){Q[s]||(typeof console<"u"&&console.warn(s),Q[s]=!0)}function ve(s,i,l){return(l.y-s.y)*(i.x-s.x)>(i.y-s.y)*(l.x-s.x)}function Me(s){let i=0;for(let l,h,p=0,y=s.length,x=y-1;p<y;x=p++)l=s[p],h=s[x],i+=(h.x-l.x)*(l.y+h.y);return i}function Ce(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}function Be(s){let i={};if(s.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(l,h,p,y)=>{let x=p||y;return i[h]=!x||x.toLowerCase(),""}),i["max-age"]){let l=parseInt(i["max-age"],10);isNaN(l)?delete i["max-age"]:i["max-age"]=l}return i}let Fe,qe,ht=null;function Tt(s){if(ht==null){let i=s.navigator?s.navigator.userAgent:null;ht=!!s.safari||!(!i||!(/\b(iPad|iPhone|iPod)\b/.test(i)||i.match("Safari")&&!i.match("Chrome")))}return ht}function Gt(s){return typeof ImageBitmap<"u"&&s instanceof ImageBitmap}let Jt={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frame(s){let i=requestAnimationFrame(s);return{cancel:()=>cancelAnimationFrame(i)}},getImageData(s,i=0){let l=window.document.createElement("canvas"),h=l.getContext("2d");if(!h)throw new Error("failed to create canvas 2d context");return l.width=s.width,l.height=s.height,h.drawImage(s,0,0,s.width,s.height),h.getImageData(-i,-i,s.width+2*i,s.height+2*i)},resolveURL:s=>(Fe||(Fe=document.createElement("a")),Fe.href=s,Fe.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(qe==null&&(qe=matchMedia("(prefers-reduced-motion: reduce)")),qe.matches)}};var at=jt;function jt(s,i){this.x=s,this.y=i}jt.prototype={clone:function(){return new jt(this.x,this.y)},add:function(s){return this.clone()._add(s)},sub:function(s){return this.clone()._sub(s)},multByPoint:function(s){return this.clone()._multByPoint(s)},divByPoint:function(s){return this.clone()._divByPoint(s)},mult:function(s){return this.clone()._mult(s)},div:function(s){return this.clone()._div(s)},rotate:function(s){return this.clone()._rotate(s)},rotateAround:function(s,i){return this.clone()._rotateAround(s,i)},matMult:function(s){return this.clone()._matMult(s)},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(s){return this.x===s.x&&this.y===s.y},dist:function(s){return Math.sqrt(this.distSqr(s))},distSqr:function(s){var i=s.x-this.x,l=s.y-this.y;return i*i+l*l},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(s){return Math.atan2(this.y-s.y,this.x-s.x)},angleWith:function(s){return this.angleWithSep(s.x,s.y)},angleWithSep:function(s,i){return Math.atan2(this.x*i-this.y*s,this.x*s+this.y*i)},_matMult:function(s){var i=s[2]*this.x+s[3]*this.y;return this.x=s[0]*this.x+s[1]*this.y,this.y=i,this},_add:function(s){return this.x+=s.x,this.y+=s.y,this},_sub:function(s){return this.x-=s.x,this.y-=s.y,this},_mult:function(s){return this.x*=s,this.y*=s,this},_div:function(s){return this.x/=s,this.y/=s,this},_multByPoint:function(s){return this.x*=s.x,this.y*=s.y,this},_divByPoint:function(s){return this.x/=s.x,this.y/=s.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var s=this.y;return this.y=this.x,this.x=-s,this},_rotate:function(s){var i=Math.cos(s),l=Math.sin(s),h=l*this.x+i*this.y;return this.x=i*this.x-l*this.y,this.y=h,this},_rotateAround:function(s,i){var l=Math.cos(s),h=Math.sin(s),p=i.y+h*(this.x-i.x)+l*(this.y-i.y);return this.x=i.x+l*(this.x-i.x)-h*(this.y-i.y),this.y=p,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},jt.convert=function(s){return s instanceof jt?s:Array.isArray(s)?new jt(s[0],s[1]):s};let zi={MAX_PARALLEL_IMAGE_REQUESTS:16,REGISTERED_PROTOCOLS:{}},Ii="mapbox-tiles",Ht,ur,Xi=500,si=50;function ii(){typeof caches>"u"||Ht||(Ht=caches.open(Ii))}let _i=1/0,Ei={supported:!1,testSupport:function(s){!Ji&&Fi&&(Mr?tn(s):Li=s)}},Li,Fi,Ji=!1,Mr=!1;function tn(s){let i=s.createTexture();s.bindTexture(s.TEXTURE_2D,i);try{if(s.texImage2D(s.TEXTURE_2D,0,s.RGBA,s.RGBA,s.UNSIGNED_BYTE,Fi),s.isContextLost())return;Ei.supported=!0}catch{}s.deleteTexture(i),Ji=!0}typeof document<"u"&&(Fi=document.createElement("img"),Fi.onload=function(){Li&&tn(Li),Li=null,Mr=!0},Fi.onerror=function(){Ji=!0,Li=null},Fi.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");let oo={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(oo);class ri extends Error{constructor(i,l,h,p){super(`AJAXError: ${l} (${i}): ${h}`),this.status=i,this.statusText=l,this.url=h,this.body=p}}let Hr=Ce()?()=>self.worker&&self.worker.referrer:()=>(window.location.protocol==="blob:"?window.parent:window).location.href;function hn(s,i){let l=new AbortController,h=new Request(s.url,{method:s.method||"GET",body:s.body,credentials:s.credentials,headers:s.headers,referrer:Hr(),signal:l.signal}),p=!1,y=!1;return s.type==="json"&&h.headers.set("Accept","application/json"),((x,w,S)=>{if(y)return;let A=Date.now();fetch(h).then(z=>z.ok?((R,N,G)=>{(s.type==="arrayBuffer"?R.arrayBuffer():s.type==="json"?R.json():R.text()).then(Z=>{y||(N&&G&&function(se,ae,be){if(ii(),!Ht)return;let Te={status:ae.status,statusText:ae.statusText,headers:new Headers};ae.headers.forEach((Le,We)=>Te.headers.set(We,Le));let Ee=Be(ae.headers.get("Cache-Control")||"");Ee["no-store"]||(Ee["max-age"]&&Te.headers.set("Expires",new Date(be+1e3*Ee["max-age"]).toUTCString()),new Date(Te.headers.get("Expires")).getTime()-be<42e4||function(Le,We){if(ur===void 0)try{new Response(new ReadableStream),ur=!0}catch{ur=!1}ur?We(Le.body):Le.blob().then(We)}(ae,Le=>{let We=new Response(Le,Te);ii(),Ht&&Ht.then(Oe=>Oe.put(function(pt){let bt=pt.indexOf("?");return bt<0?pt:pt.slice(0,bt)}(se.url),We)).catch(Oe=>te(Oe.message))}))}(h,N,G),p=!0,i(null,Z,R.headers.get("Cache-Control"),R.headers.get("Expires")))}).catch(Z=>{y||i(new Error(Z.message))})})(z,null,A):z.blob().then(R=>i(new ri(z.status,z.statusText,s.url,R)))).catch(z=>{z.code!==20&&i(new Error(z.message))})})(),{cancel:()=>{y=!0,p||l.abort()}}}let rn=function(s,i){if(/:\/\//.test(s.url)&&!/^https?:|^file:/.test(s.url)){if(Ce()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",s,i);if(!Ce()){let h=s.url.substring(0,s.url.indexOf("://"));return(zi.REGISTERED_PROTOCOLS[h]||hn)(s,i)}}if(!(/^file:/.test(l=s.url)||/^file:/.test(Hr())&&!/^\w+:/.test(l))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return hn(s,i);if(Ce()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",s,i,void 0,!0)}var l;return function(h,p){let y=new XMLHttpRequest;y.open(h.method||"GET",h.url,!0),h.type==="arrayBuffer"&&(y.responseType="arraybuffer");for(let x in h.headers)y.setRequestHeader(x,h.headers[x]);return h.type==="json"&&(y.responseType="text",y.setRequestHeader("Accept","application/json")),y.withCredentials=h.credentials==="include",y.onerror=()=>{p(new Error(y.statusText))},y.onload=()=>{if((y.status>=200&&y.status<300||y.status===0)&&y.response!==null){let x=y.response;if(h.type==="json")try{x=JSON.parse(y.response)}catch(w){return p(w)}p(null,x,y.getResponseHeader("Cache-Control"),y.getResponseHeader("Expires"))}else{let x=new Blob([y.response],{type:y.getResponseHeader("Content-Type")});p(new ri(y.status,y.statusText,h.url,x))}},y.send(h.body),{cancel:()=>y.abort()}}(s,i)},Lr=function(s,i){return rn(W(s,{type:"arrayBuffer"}),i)};function es(s){let i=window.document.createElement("a");return i.href=s,i.protocol===window.document.location.protocol&&i.host===window.document.location.host}let _e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=",V,F;V=[],F=0;let U=function(s,i){if(Ei.supported&&(s.headers||(s.headers={}),s.headers.accept="image/webp,*/*"),F>=zi.MAX_PARALLEL_IMAGE_REQUESTS){let y={requestParameters:s,callback:i,cancelled:!1,cancel(){this.cancelled=!0}};return V.push(y),y}F++;let l=!1,h=()=>{if(!l)for(l=!0,F--;V.length&&F<zi.MAX_PARALLEL_IMAGE_REQUESTS;){let y=V.shift(),{requestParameters:x,callback:w,cancelled:S}=y;S||(y.cancel=U(x,w).cancel)}},p=Lr(s,(y,x,w,S)=>{h(),y?i(y):x&&function(A,z){typeof createImageBitmap=="function"?function(R,N){let G=new Blob([new Uint8Array(R)],{type:"image/png"});createImageBitmap(G).then(Z=>{N(null,Z)}).catch(Z=>{N(new Error(`Could not load image because of ${Z.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})}(A,z):function(R,N){let G=new Image;G.onload=()=>{N(null,G),URL.revokeObjectURL(G.src),G.onload=null,window.requestAnimationFrame(()=>{G.src=_e})},G.onerror=()=>N(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));let Z=new Blob([new Uint8Array(R)],{type:"image/png"});G.src=R.byteLength?URL.createObjectURL(Z):_e}(A,z)}(x,(A,z)=>{A!=null?i(A):z!=null&&i(null,z,{cacheControl:w,expires:S})})});return{cancel:()=>{p.cancel(),h()}}};function K(s,i,l){l[s]&&l[s].indexOf(i)!==-1||(l[s]=l[s]||[],l[s].push(i))}function he(s,i,l){if(l&&l[s]){let h=l[s].indexOf(i);h!==-1&&l[s].splice(h,1)}}class Se{constructor(i,l={}){W(this,l),this.type=i}}class Ve extends Se{constructor(i,l={}){super("error",W({error:i},l))}}class He{on(i,l){return this._listeners=this._listeners||{},K(i,l,this._listeners),this}off(i,l){return he(i,l,this._listeners),he(i,l,this._oneTimeListeners),this}once(i,l){return this._oneTimeListeners=this._oneTimeListeners||{},K(i,l,this._oneTimeListeners),this}fire(i,l){typeof i=="string"&&(i=new Se(i,l||{}));let h=i.type;if(this.listens(h)){i.target=this;let p=this._listeners&&this._listeners[h]?this._listeners[h].slice():[];for(let w of p)w.call(this,i);let y=this._oneTimeListeners&&this._oneTimeListeners[h]?this._oneTimeListeners[h].slice():[];for(let w of y)he(h,w,this._oneTimeListeners),w.call(this,i);let x=this._eventedParent;x&&(W(i,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),x.fire(i))}else i instanceof Ve&&console.error(i.error);return this}listens(i){return this._listeners&&this._listeners[i]&&this._listeners[i].length>0||this._oneTimeListeners&&this._oneTimeListeners[i]&&this._oneTimeListeners[i].length>0||this._eventedParent&&this._eventedParent.listens(i)}setEventedParent(i,l){return this._eventedParent=i,this._eventedParentData=l,this}}var ye={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,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:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},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:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};class Re{constructor(i,l,h,p){this.message=(i?`${i}: `:"")+h,p&&(this.identifier=p),l!=null&&l.__line__&&(this.line=l.__line__)}}function ie(s){let i=s.value;return i?[new Re(s.key,i,"constants have been deprecated as of v8")]:[]}function Xe(s,...i){for(let l of i)for(let h in l)s[h]=l[h];return s}function $e(s){return s instanceof Number||s instanceof String||s instanceof Boolean?s.valueOf():s}function ft(s){if(Array.isArray(s))return s.map(ft);if(s instanceof Object&&!(s instanceof Number||s instanceof String||s instanceof Boolean)){let i={};for(let l in s)i[l]=ft(s[l]);return i}return $e(s)}class ut extends Error{constructor(i,l){super(l),this.message=l,this.key=i}}class Xt{constructor(i,l=[]){this.parent=i,this.bindings={};for(let[h,p]of l)this.bindings[h]=p}concat(i){return new Xt(this,i)}get(i){if(this.bindings[i])return this.bindings[i];if(this.parent)return this.parent.get(i);throw new Error(`${i} not found in scope.`)}has(i){return!!this.bindings[i]||!!this.parent&&this.parent.has(i)}}let At={kind:"null"},Ue={kind:"number"},It={kind:"string"},yt={kind:"boolean"},ni={kind:"color"},gi={kind:"object"},St={kind:"value"},tr={kind:"collator"},ci={kind:"formatted"},Ri={kind:"resolvedImage"};function hi(s,i){return{kind:"array",itemType:s,N:i}}function Ft(s){if(s.kind==="array"){let i=Ft(s.itemType);return typeof s.N=="number"?`array<${i}, ${s.N}>`:s.itemType.kind==="value"?"array":`array<${i}>`}return s.kind}let di=[At,Ue,It,yt,ni,ci,gi,hi(St),Ri];function ir(s,i){if(i.kind==="error")return null;if(s.kind==="array"){if(i.kind==="array"&&(i.N===0&&i.itemType.kind==="value"||!ir(s.itemType,i.itemType))&&(typeof s.N!="number"||s.N===i.N))return null}else{if(s.kind===i.kind)return null;if(s.kind==="value"){for(let l of di)if(!ir(l,i))return null}}return`Expected ${Ft(s)} but found ${Ft(i)} instead.`}function Ti(s,i){return i.some(l=>l.kind===s.kind)}function Er(s,i){return i.some(l=>l==="null"?s===null:l==="array"?Array.isArray(s):l==="object"?s&&!Array.isArray(s)&&typeof s=="object":l===typeof s)}var rr,Ai={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 sa(s){return(s=Math.round(s))<0?0:s>255?255:s}function aa(s){return sa(s[s.length-1]==="%"?parseFloat(s)/100*255:parseInt(s))}function Y(s){return(i=s[s.length-1]==="%"?parseFloat(s)/100:parseFloat(s))<0?0:i>1?1:i;var i}function P(s,i,l){return l<0?l+=1:l>1&&(l-=1),6*l<1?s+(i-s)*l*6:2*l<1?i:3*l<2?s+(i-s)*(2/3-l)*6:s}try{rr={}.parseCSSColor=function(s){var i,l=s.replace(/ /g,"").toLowerCase();if(l in Ai)return Ai[l].slice();if(l[0]==="#")return l.length===4?(i=parseInt(l.substr(1),16))>=0&&i<=4095?[(3840&i)>>4|(3840&i)>>8,240&i|(240&i)>>4,15&i|(15&i)<<4,1]:null:l.length===7&&(i=parseInt(l.substr(1),16))>=0&&i<=16777215?[(16711680&i)>>16,(65280&i)>>8,255&i,1]:null;var h=l.indexOf("("),p=l.indexOf(")");if(h!==-1&&p+1===l.length){var y=l.substr(0,h),x=l.substr(h+1,p-(h+1)).split(","),w=1;switch(y){case"rgba":if(x.length!==4)return null;w=Y(x.pop());case"rgb":return x.length!==3?null:[aa(x[0]),aa(x[1]),aa(x[2]),w];case"hsla":if(x.length!==4)return null;w=Y(x.pop());case"hsl":if(x.length!==3)return null;var S=(parseFloat(x[0])%360+360)%360/360,A=Y(x[1]),z=Y(x[2]),R=z<=.5?z*(A+1):z+A-z*A,N=2*z-R;return[sa(255*P(N,R,S+1/3)),sa(255*P(N,R,S)),sa(255*P(N,R,S-1/3)),w];default:return null}}return null}}catch{}class L{constructor(i,l,h,p=1){this.r=i,this.g=l,this.b=h,this.a=p}static parse(i){if(!i)return;if(i instanceof L)return i;if(typeof i!="string")return;let l=rr(i);return l?new L(l[0]/255*l[3],l[1]/255*l[3],l[2]/255*l[3],l[3]):void 0}toString(){let[i,l,h,p]=this.toArray();return`rgba(${Math.round(i)},${Math.round(l)},${Math.round(h)},${p})`}toArray(){let{r:i,g:l,b:h,a:p}=this;return p===0?[0,0,0,0]:[255*i/p,255*l/p,255*h/p,p]}}L.black=new L(0,0,0,1),L.white=new L(1,1,1,1),L.transparent=new L(0,0,0,0),L.red=new L(1,0,0,1);class j{constructor(i,l,h){this.sensitivity=i?l?"variant":"case":l?"accent":"base",this.locale=h,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(i,l){return this.collator.compare(i,l)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class J{constructor(i,l,h,p,y){this.text=i,this.image=l,this.scale=h,this.fontStack=p,this.textColor=y}}class re{constructor(i){this.sections=i}static fromString(i){return new re([new J(i,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(i=>i.text.length!==0||i.image&&i.image.name.length!==0)}static factory(i){return i instanceof re?i:re.fromString(i)}toString(){return this.sections.length===0?"":this.sections.map(i=>i.text).join("")}serialize(){let i=["format"];for(let l of this.sections){if(l.image){i.push(["image",l.image.name]);continue}i.push(l.text);let h={};l.fontStack&&(h["text-font"]=["literal",l.fontStack.split(",")]),l.scale&&(h["font-scale"]=l.scale),l.textColor&&(h["text-color"]=["rgba"].concat(l.textColor.toArray())),i.push(h)}return i}}class pe{constructor(i){this.name=i.name,this.available=i.available}toString(){return this.name}static fromString(i){return i?new pe({name:i,available:!1}):null}serialize(){return["image",this.name]}}function ue(s,i,l,h){return typeof s=="number"&&s>=0&&s<=255&&typeof i=="number"&&i>=0&&i<=255&&typeof l=="number"&&l>=0&&l<=255?h===void 0||typeof h=="number"&&h>=0&&h<=1?null:`Invalid rgba value [${[s,i,l,h].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof h=="number"?[s,i,l,h]:[s,i,l]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function ce(s){if(s===null||typeof s=="string"||typeof s=="boolean"||typeof s=="number"||s instanceof L||s instanceof j||s instanceof re||s instanceof pe)return!0;if(Array.isArray(s)){for(let i of s)if(!ce(i))return!1;return!0}if(typeof s=="object"){for(let i in s)if(!ce(s[i]))return!1;return!0}return!1}function fe(s){if(s===null)return At;if(typeof s=="string")return It;if(typeof s=="boolean")return yt;if(typeof s=="number")return Ue;if(s instanceof L)return ni;if(s instanceof j)return tr;if(s instanceof re)return ci;if(s instanceof pe)return Ri;if(Array.isArray(s)){let i=s.length,l;for(let h of s){let p=fe(h);if(l){if(l===p)continue;l=St;break}l=p}return hi(l||St,i)}return gi}function ke(s){let i=typeof s;return s===null?"":i==="string"||i==="number"||i==="boolean"?String(s):s instanceof L||s instanceof re||s instanceof pe?s.toString():JSON.stringify(s)}class Ge{constructor(i,l){this.type=i,this.value=l}static parse(i,l){if(i.length!==2)return l.error(`'literal' expression requires exactly one argument, but found ${i.length-1} instead.`);if(!ce(i[1]))return l.error("invalid value");let h=i[1],p=fe(h),y=l.expectedType;return p.kind!=="array"||p.N!==0||!y||y.kind!=="array"||typeof y.N=="number"&&y.N!==0||(p=y),new Ge(p,h)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof L?["rgba"].concat(this.value.toArray()):this.value instanceof re?this.value.serialize():this.value}}class Ae{constructor(i){this.name="ExpressionEvaluationError",this.message=i}toJSON(){return this.message}}let gt={string:It,number:Ue,boolean:yt,object:gi};class lt{constructor(i,l){this.type=i,this.args=l}static parse(i,l){if(i.length<2)return l.error("Expected at least one argument.");let h,p=1,y=i[0];if(y==="array"){let w,S;if(i.length>2){let A=i[1];if(typeof A!="string"||!(A in gt)||A==="object")return l.error('The item type argument of "array" must be one of string, number, boolean',1);w=gt[A],p++}else w=St;if(i.length>3){if(i[2]!==null&&(typeof i[2]!="number"||i[2]<0||i[2]!==Math.floor(i[2])))return l.error('The length argument to "array" must be a positive integer literal',2);S=i[2],p++}h=hi(w,S)}else h=gt[y];let x=[];for(;p<i.length;p++){let w=l.parse(i[p],p,St);if(!w)return null;x.push(w)}return new lt(h,x)}evaluate(i){for(let l=0;l<this.args.length;l++){let h=this.args[l].evaluate(i);if(!ir(this.type,fe(h)))return h;if(l===this.args.length-1)throw new Ae(`Expected value to be of type ${Ft(this.type)}, but found ${Ft(fe(h))} instead.`)}return null}eachChild(i){this.args.forEach(i)}outputDefined(){return this.args.every(i=>i.outputDefined())}serialize(){let i=this.type,l=[i.kind];if(i.kind==="array"){let h=i.itemType;if(h.kind==="string"||h.kind==="number"||h.kind==="boolean"){l.push(h.kind);let p=i.N;(typeof p=="number"||this.args.length>1)&&l.push(p)}}return l.concat(this.args.map(h=>h.serialize()))}}class xt{constructor(i){this.type=ci,this.sections=i}static parse(i,l){if(i.length<2)return l.error("Expected at least one argument.");let h=i[1];if(!Array.isArray(h)&&typeof h=="object")return l.error("First argument must be an image or text section.");let p=[],y=!1;for(let x=1;x<=i.length-1;++x){let w=i[x];if(y&&typeof w=="object"&&!Array.isArray(w)){y=!1;let S=null;if(w["font-scale"]&&(S=l.parse(w["font-scale"],1,Ue),!S))return null;let A=null;if(w["text-font"]&&(A=l.parse(w["text-font"],1,hi(It)),!A))return null;let z=null;if(w["text-color"]&&(z=l.parse(w["text-color"],1,ni),!z))return null;let R=p[p.length-1];R.scale=S,R.font=A,R.textColor=z}else{let S=l.parse(i[x],1,St);if(!S)return null;let A=S.type.kind;if(A!=="string"&&A!=="value"&&A!=="null"&&A!=="resolvedImage")return l.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");y=!0,p.push({content:S,scale:null,font:null,textColor:null})}}return new xt(p)}evaluate(i){return new re(this.sections.map(l=>{let h=l.content.evaluate(i);return fe(h)===Ri?new J("",h,null,null,null):new J(ke(h),null,l.scale?l.scale.evaluate(i):null,l.font?l.font.evaluate(i).join(","):null,l.textColor?l.textColor.evaluate(i):null)}))}eachChild(i){for(let l of this.sections)i(l.content),l.scale&&i(l.scale),l.font&&i(l.font),l.textColor&&i(l.textColor)}outputDefined(){return!1}serialize(){let i=["format"];for(let l of this.sections){i.push(l.content.serialize());let h={};l.scale&&(h["font-scale"]=l.scale.serialize()),l.font&&(h["text-font"]=l.font.serialize()),l.textColor&&(h["text-color"]=l.textColor.serialize()),i.push(h)}return i}}class Ct{constructor(i){this.type=Ri,this.input=i}static parse(i,l){if(i.length!==2)return l.error("Expected two arguments.");let h=l.parse(i[1],1,It);return h?new Ct(h):l.error("No image name provided.")}evaluate(i){let l=this.input.evaluate(i),h=pe.fromString(l);return h&&i.availableImages&&(h.available=i.availableImages.indexOf(l)>-1),h}eachChild(i){i(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}let oi={"to-boolean":yt,"to-color":ni,"to-number":Ue,"to-string":It};class Yt{constructor(i,l){this.type=i,this.args=l}static parse(i,l){if(i.length<2)return l.error("Expected at least one argument.");let h=i[0];if((h==="to-boolean"||h==="to-string")&&i.length!==2)return l.error("Expected one argument.");let p=oi[h],y=[];for(let x=1;x<i.length;x++){let w=l.parse(i[x],x,St);if(!w)return null;y.push(w)}return new Yt(p,y)}evaluate(i){if(this.type.kind==="boolean")return Boolean(this.args[0].evaluate(i));if(this.type.kind==="color"){let l,h;for(let p of this.args){if(l=p.evaluate(i),h=null,l instanceof L)return l;if(typeof l=="string"){let y=i.parseColor(l);if(y)return y}else if(Array.isArray(l)&&(h=l.length<3||l.length>4?`Invalid rbga value ${JSON.stringify(l)}: expected an array containing either three or four numeric values.`:ue(l[0],l[1],l[2],l[3]),!h))return new L(l[0]/255,l[1]/255,l[2]/255,l[3])}throw new Ae(h||`Could not parse color from value '${typeof l=="string"?l:String(JSON.stringify(l))}'`)}if(this.type.kind==="number"){let l=null;for(let h of this.args){if(l=h.evaluate(i),l===null)return 0;let p=Number(l);if(!isNaN(p))return p}throw new Ae(`Could not convert ${JSON.stringify(l)} to number.`)}return this.type.kind==="formatted"?re.fromString(ke(this.args[0].evaluate(i))):this.type.kind==="resolvedImage"?pe.fromString(ke(this.args[0].evaluate(i))):ke(this.args[0].evaluate(i))}eachChild(i){this.args.forEach(i)}outputDefined(){return this.args.every(i=>i.outputDefined())}serialize(){if(this.type.kind==="formatted")return new xt([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new Ct(this.args[0]).serialize();let i=[`to-${this.type.kind}`];return this.eachChild(l=>{i.push(l.serialize())}),i}}let Wt=["Unknown","Point","LineString","Polygon"];class Nt{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Wt[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(i){let l=this._parseColorCache[i];return l||(l=this._parseColorCache[i]=L.parse(i)),l}}class Dt{constructor(i,l,h,p){this.name=i,this.type=l,this._evaluate=h,this.args=p}evaluate(i){return this._evaluate(i,this.args)}eachChild(i){this.args.forEach(i)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map(i=>i.serialize()))}static parse(i,l){let h=i[0],p=Dt.definitions[h];if(!p)return l.error(`Unknown expression "${h}". If you wanted a literal array, use ["literal", [...]].`,0);let y=Array.isArray(p)?p[0]:p.type,x=Array.isArray(p)?[[p[1],p[2]]]:p.overloads,w=x.filter(([A])=>!Array.isArray(A)||A.length===i.length-1),S=null;for(let[A,z]of w){S=new ru(l.registry,l.path,null,l.scope);let R=[],N=!1;for(let G=1;G<i.length;G++){let Z=i[G],se=Array.isArray(A)?A[G-1]:A.type,ae=S.parse(Z,1+R.length,se);if(!ae){N=!0;break}R.push(ae)}if(!N)if(Array.isArray(A)&&A.length!==R.length)S.error(`Expected ${A.length} arguments, but found ${R.length} instead.`);else{for(let G=0;G<R.length;G++){let Z=Array.isArray(A)?A[G]:A.type,se=R[G];S.concat(G+1).checkSubtype(Z,se.type)}if(S.errors.length===0)return new Dt(h,y,z,R)}}if(w.length===1)l.errors.push(...S.errors);else{let A=(w.length?w:x).map(([R])=>{return N=R,Array.isArray(N)?`(${N.map(Ft).join(", ")})`:`(${Ft(N.type)}...)`;var N}).join(" | "),z=[];for(let R=1;R<i.length;R++){let N=l.parse(i[R],1+z.length);if(!N)return null;z.push(Ft(N.type))}l.error(`Expected arguments of type ${A}, but found (${z.join(", ")}) instead.`)}return null}static register(i,l){Dt.definitions=l;for(let h in l)i[h]=Dt}}class cr{constructor(i,l,h){this.type=tr,this.locale=h,this.caseSensitive=i,this.diacriticSensitive=l}static parse(i,l){if(i.length!==2)return l.error("Expected one argument.");let h=i[1];if(typeof h!="object"||Array.isArray(h))return l.error("Collator options argument must be an object.");let p=l.parse(h["case-sensitive"]!==void 0&&h["case-sensitive"],1,yt);if(!p)return null;let y=l.parse(h["diacritic-sensitive"]!==void 0&&h["diacritic-sensitive"],1,yt);if(!y)return null;let x=null;return h.locale&&(x=l.parse(h.locale,1,It),!x)?null:new cr(p,y,x)}evaluate(i){return new j(this.caseSensitive.evaluate(i),this.diacriticSensitive.evaluate(i),this.locale?this.locale.evaluate(i):null)}eachChild(i){i(this.caseSensitive),i(this.diacriticSensitive),this.locale&&i(this.locale)}outputDefined(){return!1}serialize(){let i={};return i["case-sensitive"]=this.caseSensitive.serialize(),i["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(i.locale=this.locale.serialize()),["collator",i]}}let nr=8192;function Rr(s,i){s[0]=Math.min(s[0],i[0]),s[1]=Math.min(s[1],i[1]),s[2]=Math.max(s[2],i[0]),s[3]=Math.max(s[3],i[1])}function Fr(s,i){return!(s[0]<=i[0]||s[2]>=i[2]||s[1]<=i[1]||s[3]>=i[3])}function Wc(s,i){let l=(180+s[0])/360,h=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+s[1]*Math.PI/360)))/360,p=Math.pow(2,i.z);return[Math.round(l*p*nr),Math.round(h*p*nr)]}function Zc(s,i,l){let h=s[0]-i[0],p=s[1]-i[1],y=s[0]-l[0],x=s[1]-l[1];return h*x-y*p==0&&h*y<=0&&p*x<=0}function Pi(s,i){let l=!1;for(let x=0,w=i.length;x<w;x++){let S=i[x];for(let A=0,z=S.length;A<z-1;A++){if(Zc(s,S[A],S[A+1]))return!1;(p=S[A])[1]>(h=s)[1]!=(y=S[A+1])[1]>h[1]&&h[0]<(y[0]-p[0])*(h[1]-p[1])/(y[1]-p[1])+p[0]&&(l=!l)}}var h,p,y;return l}function Zg(s,i){for(let l=0;l<i.length;l++)if(Pi(s,i[l]))return!0;return!1}function jc(s,i,l,h){let p=h[0]-l[0],y=h[1]-l[1],x=(s[0]-l[0])*y-p*(s[1]-l[1]),w=(i[0]-l[0])*y-p*(i[1]-l[1]);return x>0&&w<0||x<0&&w>0}function jg(s,i,l){for(let A of l)for(let z=0;z<A.length-1;++z)if((w=[(x=A[z+1])[0]-(y=A[z])[0],x[1]-y[1]])[0]*(S=[(p=i)[0]-(h=s)[0],p[1]-h[1]])[1]-w[1]*S[0]!=0&&jc(h,p,y,x)&&jc(y,x,h,p))return!0;var h,p,y,x,w,S;return!1}function Hc(s,i){for(let l=0;l<s.length;++l)if(!Pi(s[l],i))return!1;for(let l=0;l<s.length-1;++l)if(jg(s[l],s[l+1],i))return!1;return!0}function up(s,i){for(let l=0;l<i.length;l++)if(Hc(s,i[l]))return!0;return!1}function Xc(s,i,l){let h=[];for(let p=0;p<s.length;p++){let y=[];for(let x=0;x<s[p].length;x++){let w=Wc(s[p][x],l);Rr(i,w),y.push(w)}h.push(y)}return h}function $c(s,i,l){let h=[];for(let p=0;p<s.length;p++){let y=Xc(s[p],i,l);h.push(y)}return h}function Yc(s,i,l,h){if(s[0]<l[0]||s[0]>l[2]){let p=.5*h,y=s[0]-l[0]>p?-h:l[0]-s[0]>p?h:0;y===0&&(y=s[0]-l[2]>p?-h:l[2]-s[0]>p?h:0),s[0]+=y}Rr(i,s)}function cp(s,i,l,h){let p=Math.pow(2,h.z)*nr,y=[h.x*nr,h.y*nr],x=[];for(let w of s)for(let S of w){let A=[S.x+y[0],S.y+y[1]];Yc(A,i,l,p),x.push(A)}return x}function hp(s,i,l,h){let p=Math.pow(2,h.z)*nr,y=[h.x*nr,h.y*nr],x=[];for(let S of s){let A=[];for(let z of S){let R=[z.x+y[0],z.y+y[1]];Rr(i,R),A.push(R)}x.push(A)}if(i[2]-i[0]<=p/2){(w=i)[0]=w[1]=1/0,w[2]=w[3]=-1/0;for(let S of x)for(let A of S)Yc(A,i,l,p)}var w;return x}class xs{constructor(i,l){this.type=yt,this.geojson=i,this.geometries=l}static parse(i,l){if(i.length!==2)return l.error(`'within' expression requires exactly one argument, but found ${i.length-1} instead.`);if(ce(i[1])){let h=i[1];if(h.type==="FeatureCollection")for(let p=0;p<h.features.length;++p){let y=h.features[p].geometry.type;if(y==="Polygon"||y==="MultiPolygon")return new xs(h,h.features[p].geometry)}else if(h.type==="Feature"){let p=h.geometry.type;if(p==="Polygon"||p==="MultiPolygon")return new xs(h,h.geometry)}else if(h.type==="Polygon"||h.type==="MultiPolygon")return new xs(h,h)}return l.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(i){if(i.geometry()!=null&&i.canonicalID()!=null){if(i.geometryType()==="Point")return function(l,h){let p=[1/0,1/0,-1/0,-1/0],y=[1/0,1/0,-1/0,-1/0],x=l.canonicalID();if(h.type==="Polygon"){let w=Xc(h.coordinates,y,x),S=cp(l.geometry(),p,y,x);if(!Fr(p,y))return!1;for(let A of S)if(!Pi(A,w))return!1}if(h.type==="MultiPolygon"){let w=$c(h.coordinates,y,x),S=cp(l.geometry(),p,y,x);if(!Fr(p,y))return!1;for(let A of S)if(!Zg(A,w))return!1}return!0}(i,this.geometries);if(i.geometryType()==="LineString")return function(l,h){let p=[1/0,1/0,-1/0,-1/0],y=[1/0,1/0,-1/0,-1/0],x=l.canonicalID();if(h.type==="Polygon"){let w=Xc(h.coordinates,y,x),S=hp(l.geometry(),p,y,x);if(!Fr(p,y))return!1;for(let A of S)if(!Hc(A,w))return!1}if(h.type==="MultiPolygon"){let w=$c(h.coordinates,y,x),S=hp(l.geometry(),p,y,x);if(!Fr(p,y))return!1;for(let A of S)if(!up(A,w))return!1}return!0}(i,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}function tu(s){if(s instanceof Dt&&(s.name==="get"&&s.args.length===1||s.name==="feature-state"||s.name==="has"&&s.args.length===1||s.name==="properties"||s.name==="geometry-type"||s.name==="id"||/^filter-/.test(s.name))||s instanceof xs)return!1;let i=!0;return s.eachChild(l=>{i&&!tu(l)&&(i=!1)}),i}function la(s){if(s instanceof Dt&&s.name==="feature-state")return!1;let i=!0;return s.eachChild(l=>{i&&!la(l)&&(i=!1)}),i}function rl(s,i){if(s instanceof Dt&&i.indexOf(s.name)>=0)return!1;let l=!0;return s.eachChild(h=>{l&&!rl(h,i)&&(l=!1)}),l}class iu{constructor(i,l){this.type=l.type,this.name=i,this.boundExpression=l}static parse(i,l){if(i.length!==2||typeof i[1]!="string")return l.error("'var' expression requires exactly one string literal argument.");let h=i[1];return l.scope.has(h)?new iu(h,l.scope.get(h)):l.error(`Unknown variable "${h}". Make sure "${h}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(i){return this.boundExpression.evaluate(i)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}class ru{constructor(i,l=[],h,p=new Xt,y=[]){this.registry=i,this.path=l,this.key=l.map(x=>`[${x}]`).join(""),this.scope=p,this.errors=y,this.expectedType=h}parse(i,l,h,p,y={}){return l?this.concat(l,h,p)._parse(i,y):this._parse(i,y)}_parse(i,l){function h(p,y,x){return x==="assert"?new lt(y,[p]):x==="coerce"?new Yt(y,[p]):p}if(i!==null&&typeof i!="string"&&typeof i!="boolean"&&typeof i!="number"||(i=["literal",i]),Array.isArray(i)){if(i.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let p=i[0];if(typeof p!="string")return this.error(`Expression name must be a string, but found ${typeof p} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let y=this.registry[p];if(y){let x=y.parse(i,this);if(!x)return null;if(this.expectedType){let w=this.expectedType,S=x.type;if(w.kind!=="string"&&w.kind!=="number"&&w.kind!=="boolean"&&w.kind!=="object"&&w.kind!=="array"||S.kind!=="value")if(w.kind!=="color"&&w.kind!=="formatted"&&w.kind!=="resolvedImage"||S.kind!=="value"&&S.kind!=="string"){if(this.checkSubtype(w,S))return null}else x=h(x,w,l.typeAnnotation||"coerce");else x=h(x,w,l.typeAnnotation||"assert")}if(!(x instanceof Ge)&&x.type.kind!=="resolvedImage"&&nl(x)){let w=new Nt;try{x=new Ge(x.type,x.evaluate(w))}catch(S){return this.error(S.message),null}}return x}return this.error(`Unknown expression "${p}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(i===void 0?"'undefined' value invalid. Use null instead.":typeof i=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof i} instead.`)}concat(i,l,h){let p=typeof i=="number"?this.path.concat(i):this.path,y=h?this.scope.concat(h):this.scope;return new ru(this.registry,p,l||null,y,this.errors)}error(i,...l){let h=`${this.key}${l.map(p=>`[${p}]`).join("")}`;this.errors.push(new ut(h,i))}checkSubtype(i,l){let h=ir(i,l);return h&&this.error(h),h}}function nl(s){if(s instanceof iu)return nl(s.boundExpression);if(s instanceof Dt&&s.name==="error"||s instanceof cr||s instanceof xs)return!1;let i=s instanceof Yt||s instanceof lt,l=!0;return s.eachChild(h=>{l=i?l&&nl(h):l&&h instanceof Ge}),!!l&&tu(s)&&rl(s,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function nu(s,i){let l=s.length-1,h,p,y=0,x=l,w=0;for(;y<=x;)if(w=Math.floor((y+x)/2),h=s[w],p=s[w+1],h<=i){if(w===l||i<p)return w;y=w+1}else{if(!(h>i))throw new Ae("Input is not a number.");x=w-1}return 0}class ol{constructor(i,l,h){this.type=i,this.input=l,this.labels=[],this.outputs=[];for(let[p,y]of h)this.labels.push(p),this.outputs.push(y)}static parse(i,l){if(i.length-1<4)return l.error(`Expected at least 4 arguments, but found only ${i.length-1}.`);if((i.length-1)%2!=0)return l.error("Expected an even number of arguments.");let h=l.parse(i[1],1,Ue);if(!h)return null;let p=[],y=null;l.expectedType&&l.expectedType.kind!=="value"&&(y=l.expectedType);for(let x=1;x<i.length;x+=2){let w=x===1?-1/0:i[x],S=i[x+1],A=x,z=x+1;if(typeof w!="number")return l.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',A);if(p.length&&p[p.length-1][0]>=w)return l.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',A);let R=l.parse(S,z,y);if(!R)return null;y=y||R.type,p.push([w,R])}return new ol(y,h,p)}evaluate(i){let l=this.labels,h=this.outputs;if(l.length===1)return h[0].evaluate(i);let p=this.input.evaluate(i);if(p<=l[0])return h[0].evaluate(i);let y=l.length;return p>=l[y-1]?h[y-1].evaluate(i):h[nu(l,p)].evaluate(i)}eachChild(i){i(this.input);for(let l of this.outputs)i(l)}outputDefined(){return this.outputs.every(i=>i.outputDefined())}serialize(){let i=["step",this.input.serialize()];for(let l=0;l<this.labels.length;l++)l>0&&i.push(this.labels[l]),i.push(this.outputs[l].serialize());return i}}function vr(s,i,l){return s*(1-l)+i*l}var sl=Object.freeze({__proto__:null,number:vr,color:function(s,i,l){return new L(vr(s.r,i.r,l),vr(s.g,i.g,l),vr(s.b,i.b,l),vr(s.a,i.a,l))},array:function(s,i,l){return s.map((h,p)=>vr(h,i[p],l))}});let qc=.95047,dp=1.08883,pp=4/29,ou=6/29,Jc=3*ou*ou,Hg=Math.PI/180,Xg=180/Math.PI;function Qc(s){return s>.008856451679035631?Math.pow(s,1/3):s/Jc+pp}function Kc(s){return s>ou?s*s*s:Jc*(s-pp)}function eh(s){return 255*(s<=.0031308?12.92*s:1.055*Math.pow(s,1/2.4)-.055)}function th(s){return(s/=255)<=.04045?s/12.92:Math.pow((s+.055)/1.055,2.4)}function fp(s){let i=th(s.r),l=th(s.g),h=th(s.b),p=Qc((.4124564*i+.3575761*l+.1804375*h)/qc),y=Qc((.2126729*i+.7151522*l+.072175*h)/1);return{l:116*y-16,a:500*(p-y),b:200*(y-Qc((.0193339*i+.119192*l+.9503041*h)/dp)),alpha:s.a}}function pi(s){let i=(s.l+16)/116,l=isNaN(s.a)?i:i+s.a/500,h=isNaN(s.b)?i:i-s.b/200;return i=1*Kc(i),l=qc*Kc(l),h=dp*Kc(h),new L(eh(3.2404542*l-1.5371385*i-.4985314*h),eh(-.969266*l+1.8760108*i+.041556*h),eh(.0556434*l-.2040259*i+1.0572252*h),s.alpha)}function $g(s,i,l){let h=i-s;return s+l*(h>180||h<-180?h-360*Math.round(h/360):h)}let al={forward:fp,reverse:pi,interpolate:function(s,i,l){return{l:vr(s.l,i.l,l),a:vr(s.a,i.a,l),b:vr(s.b,i.b,l),alpha:vr(s.alpha,i.alpha,l)}}},ll={forward:function(s){let{l:i,a:l,b:h}=fp(s),p=Math.atan2(h,l)*Xg;return{h:p<0?p+360:p,c:Math.sqrt(l*l+h*h),l:i,alpha:s.a}},reverse:function(s){let i=s.h*Hg,l=s.c;return pi({l:s.l,a:Math.cos(i)*l,b:Math.sin(i)*l,alpha:s.alpha})},interpolate:function(s,i,l){return{h:$g(s.h,i.h,l),c:vr(s.c,i.c,l),l:vr(s.l,i.l,l),alpha:vr(s.alpha,i.alpha,l)}}};var mp=Object.freeze({__proto__:null,lab:al,hcl:ll});class Mn{constructor(i,l,h,p,y){this.type=i,this.operator=l,this.interpolation=h,this.input=p,this.labels=[],this.outputs=[];for(let[x,w]of y)this.labels.push(x),this.outputs.push(w)}static interpolationFactor(i,l,h,p){let y=0;if(i.name==="exponential")y=ih(l,i.base,h,p);else if(i.name==="linear")y=ih(l,1,h,p);else if(i.name==="cubic-bezier"){let x=i.controlPoints;y=new m(x[0],x[1],x[2],x[3]).solve(ih(l,1,h,p))}return y}static parse(i,l){let[h,p,y,...x]=i;if(!Array.isArray(p)||p.length===0)return l.error("Expected an interpolation type expression.",1);if(p[0]==="linear")p={name:"linear"};else if(p[0]==="exponential"){let A=p[1];if(typeof A!="number")return l.error("Exponential interpolation requires a numeric base.",1,1);p={name:"exponential",base:A}}else{if(p[0]!=="cubic-bezier")return l.error(`Unknown interpolation type ${String(p[0])}`,1,0);{let A=p.slice(1);if(A.length!==4||A.some(z=>typeof z!="number"||z<0||z>1))return l.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);p={name:"cubic-bezier",controlPoints:A}}}if(i.length-1<4)return l.error(`Expected at least 4 arguments, but found only ${i.length-1}.`);if((i.length-1)%2!=0)return l.error("Expected an even number of arguments.");if(y=l.parse(y,2,Ue),!y)return null;let w=[],S=null;h==="interpolate-hcl"||h==="interpolate-lab"?S=ni:l.expectedType&&l.expectedType.kind!=="value"&&(S=l.expectedType);for(let A=0;A<x.length;A+=2){let z=x[A],R=x[A+1],N=A+3,G=A+4;if(typeof z!="number")return l.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',N);if(w.length&&w[w.length-1][0]>=z)return l.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',N);let Z=l.parse(R,G,S);if(!Z)return null;S=S||Z.type,w.push([z,Z])}return S.kind==="number"||S.kind==="color"||S.kind==="array"&&S.itemType.kind==="number"&&typeof S.N=="number"?new Mn(S,h,p,y,w):l.error(`Type ${Ft(S)} is not interpolatable.`)}evaluate(i){let l=this.labels,h=this.outputs;if(l.length===1)return h[0].evaluate(i);let p=this.input.evaluate(i);if(p<=l[0])return h[0].evaluate(i);let y=l.length;if(p>=l[y-1])return h[y-1].evaluate(i);let x=nu(l,p),w=Mn.interpolationFactor(this.interpolation,p,l[x],l[x+1]),S=h[x].evaluate(i),A=h[x+1].evaluate(i);return this.operator==="interpolate"?sl[this.type.kind.toLowerCase()](S,A,w):this.operator==="interpolate-hcl"?ll.reverse(ll.interpolate(ll.forward(S),ll.forward(A),w)):al.reverse(al.interpolate(al.forward(S),al.forward(A),w))}eachChild(i){i(this.input);for(let l of this.outputs)i(l)}outputDefined(){return this.outputs.every(i=>i.outputDefined())}serialize(){let i;i=this.interpolation.name==="linear"?["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);let l=[this.operator,i,this.input.serialize()];for(let h=0;h<this.labels.length;h++)l.push(this.labels[h],this.outputs[h].serialize());return l}}function ih(s,i,l,h){let p=h-l,y=s-l;return p===0?0:i===1?y/p:(Math.pow(i,y)-1)/(Math.pow(i,p)-1)}class su{constructor(i,l){this.type=i,this.args=l}static parse(i,l){if(i.length<2)return l.error("Expectected at least one argument.");let h=null,p=l.expectedType;p&&p.kind!=="value"&&(h=p);let y=[];for(let w of i.slice(1)){let S=l.parse(w,1+y.length,h,void 0,{typeAnnotation:"omit"});if(!S)return null;h=h||S.type,y.push(S)}let x=p&&y.some(w=>ir(p,w.type));return new su(x?St:h,y)}evaluate(i){let l,h=null,p=0;for(let y of this.args)if(p++,h=y.evaluate(i),h&&h instanceof pe&&!h.available&&(l||(l=h.name),h=null,p===this.args.length&&(h=l)),h!==null)break;return h}eachChild(i){this.args.forEach(i)}outputDefined(){return this.args.every(i=>i.outputDefined())}serialize(){let i=["coalesce"];return this.eachChild(l=>{i.push(l.serialize())}),i}}class au{constructor(i,l){this.type=l.type,this.bindings=[].concat(i),this.result=l}evaluate(i){return this.result.evaluate(i)}eachChild(i){for(let l of this.bindings)i(l[1]);i(this.result)}static parse(i,l){if(i.length<4)return l.error(`Expected at least 3 arguments, but found ${i.length-1} instead.`);let h=[];for(let y=1;y<i.length-1;y+=2){let x=i[y];if(typeof x!="string")return l.error(`Expected string, but found ${typeof x} instead.`,y);if(/[^a-zA-Z0-9_]/.test(x))return l.error("Variable names must contain only alphanumeric characters or '_'.",y);let w=l.parse(i[y+1],y+1);if(!w)return null;h.push([x,w])}let p=l.parse(i[i.length-1],i.length-1,l.expectedType,h);return p?new au(h,p):null}outputDefined(){return this.result.outputDefined()}serialize(){let i=["let"];for(let[l,h]of this.bindings)i.push(l,h.serialize());return i.push(this.result.serialize()),i}}class rh{constructor(i,l,h){this.type=i,this.index=l,this.input=h}static parse(i,l){if(i.length!==3)return l.error(`Expected 2 arguments, but found ${i.length-1} instead.`);let h=l.parse(i[1],1,Ue),p=l.parse(i[2],2,hi(l.expectedType||St));return h&&p?new rh(p.type.itemType,h,p):null}evaluate(i){let l=this.index.evaluate(i),h=this.input.evaluate(i);if(l<0)throw new Ae(`Array index out of bounds: ${l} < 0.`);if(l>=h.length)throw new Ae(`Array index out of bounds: ${l} > ${h.length-1}.`);if(l!==Math.floor(l))throw new Ae(`Array index must be an integer, but found ${l} instead.`);return h[l]}eachChild(i){i(this.index),i(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}class nh{constructor(i,l){this.type=yt,this.needle=i,this.haystack=l}static parse(i,l){if(i.length!==3)return l.error(`Expected 2 arguments, but found ${i.length-1} instead.`);let h=l.parse(i[1],1,St),p=l.parse(i[2],2,St);return h&&p?Ti(h.type,[yt,It,Ue,At,St])?new nh(h,p):l.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ft(h.type)} instead`):null}evaluate(i){let l=this.needle.evaluate(i),h=this.haystack.evaluate(i);if(!h)return!1;if(!Er(l,["boolean","string","number","null"]))throw new Ae(`Expected first argument to be of type boolean, string, number or null, but found ${Ft(fe(l))} instead.`);if(!Er(h,["string","array"]))throw new Ae(`Expected second argument to be of type array or string, but found ${Ft(fe(h))} instead.`);return h.indexOf(l)>=0}eachChild(i){i(this.needle),i(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}class lu{constructor(i,l,h){this.type=Ue,this.needle=i,this.haystack=l,this.fromIndex=h}static parse(i,l){if(i.length<=2||i.length>=5)return l.error(`Expected 3 or 4 arguments, but found ${i.length-1} instead.`);let h=l.parse(i[1],1,St),p=l.parse(i[2],2,St);if(!h||!p)return null;if(!Ti(h.type,[yt,It,Ue,At,St]))return l.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ft(h.type)} instead`);if(i.length===4){let y=l.parse(i[3],3,Ue);return y?new lu(h,p,y):null}return new lu(h,p)}evaluate(i){let l=this.needle.evaluate(i),h=this.haystack.evaluate(i);if(!Er(l,["boolean","string","number","null"]))throw new Ae(`Expected first argument to be of type boolean, string, number or null, but found ${Ft(fe(l))} instead.`);if(!Er(h,["string","array"]))throw new Ae(`Expected second argument to be of type array or string, but found ${Ft(fe(h))} instead.`);if(this.fromIndex){let p=this.fromIndex.evaluate(i);return h.indexOf(l,p)}return h.indexOf(l)}eachChild(i){i(this.needle),i(this.haystack),this.fromIndex&&i(this.fromIndex)}outputDefined(){return!1}serialize(){if(this.fromIndex!=null&&this.fromIndex!==void 0){let i=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),i]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}class oh{constructor(i,l,h,p,y,x){this.inputType=i,this.type=l,this.input=h,this.cases=p,this.outputs=y,this.otherwise=x}static parse(i,l){if(i.length<5)return l.error(`Expected at least 4 arguments, but found only ${i.length-1}.`);if(i.length%2!=1)return l.error("Expected an even number of arguments.");let h,p;l.expectedType&&l.expectedType.kind!=="value"&&(p=l.expectedType);let y={},x=[];for(let A=2;A<i.length-1;A+=2){let z=i[A],R=i[A+1];Array.isArray(z)||(z=[z]);let N=l.concat(A);if(z.length===0)return N.error("Expected at least one branch label.");for(let Z of z){if(typeof Z!="number"&&typeof Z!="string")return N.error("Branch labels must be numbers or strings.");if(typeof Z=="number"&&Math.abs(Z)>Number.MAX_SAFE_INTEGER)return N.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof Z=="number"&&Math.floor(Z)!==Z)return N.error("Numeric branch labels must be integer values.");if(h){if(N.checkSubtype(h,fe(Z)))return null}else h=fe(Z);if(y[String(Z)]!==void 0)return N.error("Branch labels must be unique.");y[String(Z)]=x.length}let G=l.parse(R,A,p);if(!G)return null;p=p||G.type,x.push(G)}let w=l.parse(i[1],1,St);if(!w)return null;let S=l.parse(i[i.length-1],i.length-1,p);return S?w.type.kind!=="value"&&l.concat(1).checkSubtype(h,w.type)?null:new oh(h,p,w,y,x,S):null}evaluate(i){let l=this.input.evaluate(i);return(fe(l)===this.inputType&&this.outputs[this.cases[l]]||this.otherwise).evaluate(i)}eachChild(i){i(this.input),this.outputs.forEach(i),i(this.otherwise)}outputDefined(){return this.outputs.every(i=>i.outputDefined())&&this.otherwise.outputDefined()}serialize(){let i=["match",this.input.serialize()],l=Object.keys(this.cases).sort(),h=[],p={};for(let x of l){let w=p[this.cases[x]];w===void 0?(p[this.cases[x]]=h.length,h.push([this.cases[x],[x]])):h[w][1].push(x)}let y=x=>this.inputType.kind==="number"?Number(x):x;for(let[x,w]of h)i.push(w.length===1?y(w[0]):w.map(y)),i.push(this.outputs[x].serialize());return i.push(this.otherwise.serialize()),i}}class sh{constructor(i,l,h){this.type=i,this.branches=l,this.otherwise=h}static parse(i,l){if(i.length<4)return l.error(`Expected at least 3 arguments, but found only ${i.length-1}.`);if(i.length%2!=0)return l.error("Expected an odd number of arguments.");let h;l.expectedType&&l.expectedType.kind!=="value"&&(h=l.expectedType);let p=[];for(let x=1;x<i.length-1;x+=2){let w=l.parse(i[x],x,yt);if(!w)return null;let S=l.parse(i[x+1],x+1,h);if(!S)return null;p.push([w,S]),h=h||S.type}let y=l.parse(i[i.length-1],i.length-1,h);return y?new sh(h,p,y):null}evaluate(i){for(let[l,h]of this.branches)if(l.evaluate(i))return h.evaluate(i);return this.otherwise.evaluate(i)}eachChild(i){for(let[l,h]of this.branches)i(l),i(h);i(this.otherwise)}outputDefined(){return this.branches.every(([i,l])=>l.outputDefined())&&this.otherwise.outputDefined()}serialize(){let i=["case"];return this.eachChild(l=>{i.push(l.serialize())}),i}}class uu{constructor(i,l,h,p){this.type=i,this.input=l,this.beginIndex=h,this.endIndex=p}static parse(i,l){if(i.length<=2||i.length>=5)return l.error(`Expected 3 or 4 arguments, but found ${i.length-1} instead.`);let h=l.parse(i[1],1,St),p=l.parse(i[2],2,Ue);if(!h||!p)return null;if(!Ti(h.type,[hi(St),It,St]))return l.error(`Expected first argument to be of type array or string, but found ${Ft(h.type)} instead`);if(i.length===4){let y=l.parse(i[3],3,Ue);return y?new uu(h.type,h,p,y):null}return new uu(h.type,h,p)}evaluate(i){let l=this.input.evaluate(i),h=this.beginIndex.evaluate(i);if(!Er(l,["string","array"]))throw new Ae(`Expected first argument to be of type array or string, but found ${Ft(fe(l))} instead.`);if(this.endIndex){let p=this.endIndex.evaluate(i);return l.slice(h,p)}return l.slice(h)}eachChild(i){i(this.input),i(this.beginIndex),this.endIndex&&i(this.endIndex)}outputDefined(){return!1}serialize(){if(this.endIndex!=null&&this.endIndex!==void 0){let i=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),i]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}function gp(s,i){return s==="=="||s==="!="?i.kind==="boolean"||i.kind==="string"||i.kind==="number"||i.kind==="null"||i.kind==="value":i.kind==="string"||i.kind==="number"||i.kind==="value"}function yp(s,i,l,h){return h.compare(i,l)===0}function ua(s,i,l){let h=s!=="=="&&s!=="!=";return class qC{constructor(y,x,w){this.type=yt,this.lhs=y,this.rhs=x,this.collator=w,this.hasUntypedArgument=y.type.kind==="value"||x.type.kind==="value"}static parse(y,x){if(y.length!==3&&y.length!==4)return x.error("Expected two or three arguments.");let w=y[0],S=x.parse(y[1],1,St);if(!S)return null;if(!gp(w,S.type))return x.concat(1).error(`"${w}" comparisons are not supported for type '${Ft(S.type)}'.`);let A=x.parse(y[2],2,St);if(!A)return null;if(!gp(w,A.type))return x.concat(2).error(`"${w}" comparisons are not supported for type '${Ft(A.type)}'.`);if(S.type.kind!==A.type.kind&&S.type.kind!=="value"&&A.type.kind!=="value")return x.error(`Cannot compare types '${Ft(S.type)}' and '${Ft(A.type)}'.`);h&&(S.type.kind==="value"&&A.type.kind!=="value"?S=new lt(A.type,[S]):S.type.kind!=="value"&&A.type.kind==="value"&&(A=new lt(S.type,[A])));let z=null;if(y.length===4){if(S.type.kind!=="string"&&A.type.kind!=="string"&&S.type.kind!=="value"&&A.type.kind!=="value")return x.error("Cannot use collator to compare non-string types.");if(z=x.parse(y[3],3,tr),!z)return null}return new qC(S,A,z)}evaluate(y){let x=this.lhs.evaluate(y),w=this.rhs.evaluate(y);if(h&&this.hasUntypedArgument){let S=fe(x),A=fe(w);if(S.kind!==A.kind||S.kind!=="string"&&S.kind!=="number")throw new Ae(`Expected arguments for "${s}" to be (string, string) or (number, number), but found (${S.kind}, ${A.kind}) instead.`)}if(this.collator&&!h&&this.hasUntypedArgument){let S=fe(x),A=fe(w);if(S.kind!=="string"||A.kind!=="string")return i(y,x,w)}return this.collator?l(y,x,w,this.collator.evaluate(y)):i(y,x,w)}eachChild(y){y(this.lhs),y(this.rhs),this.collator&&y(this.collator)}outputDefined(){return!0}serialize(){let y=[s];return this.eachChild(x=>{y.push(x.serialize())}),y}}}let Yg=ua("==",function(s,i,l){return i===l},yp),qg=ua("!=",function(s,i,l){return i!==l},function(s,i,l,h){return!yp(0,i,l,h)}),Jg=ua("<",function(s,i,l){return i<l},function(s,i,l,h){return h.compare(i,l)<0}),Qg=ua(">",function(s,i,l){return i>l},function(s,i,l,h){return h.compare(i,l)>0}),Kg=ua("<=",function(s,i,l){return i<=l},function(s,i,l,h){return h.compare(i,l)<=0}),e0=ua(">=",function(s,i,l){return i>=l},function(s,i,l,h){return h.compare(i,l)>=0});class ah{constructor(i,l,h,p,y){this.type=It,this.number=i,this.locale=l,this.currency=h,this.minFractionDigits=p,this.maxFractionDigits=y}static parse(i,l){if(i.length!==3)return l.error("Expected two arguments.");let h=l.parse(i[1],1,Ue);if(!h)return null;let p=i[2];if(typeof p!="object"||Array.isArray(p))return l.error("NumberFormat options argument must be an object.");let y=null;if(p.locale&&(y=l.parse(p.locale,1,It),!y))return null;let x=null;if(p.currency&&(x=l.parse(p.currency,1,It),!x))return null;let w=null;if(p["min-fraction-digits"]&&(w=l.parse(p["min-fraction-digits"],1,Ue),!w))return null;let S=null;return p["max-fraction-digits"]&&(S=l.parse(p["max-fraction-digits"],1,Ue),!S)?null:new ah(h,y,x,w,S)}evaluate(i){return new Intl.NumberFormat(this.locale?this.locale.evaluate(i):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(i):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(i):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(i):void 0}).format(this.number.evaluate(i))}eachChild(i){i(this.number),this.locale&&i(this.locale),this.currency&&i(this.currency),this.minFractionDigits&&i(this.minFractionDigits),this.maxFractionDigits&&i(this.maxFractionDigits)}outputDefined(){return!1}serialize(){let i={};return this.locale&&(i.locale=this.locale.serialize()),this.currency&&(i.currency=this.currency.serialize()),this.minFractionDigits&&(i["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(i["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),i]}}class lh{constructor(i){this.type=Ue,this.input=i}static parse(i,l){if(i.length!==2)return l.error(`Expected 1 argument, but found ${i.length-1} instead.`);let h=l.parse(i[1],1);return h?h.type.kind!=="array"&&h.type.kind!=="string"&&h.type.kind!=="value"?l.error(`Expected argument of type string or array, but found ${Ft(h.type)} instead.`):new lh(h):null}evaluate(i){let l=this.input.evaluate(i);if(typeof l=="string"||Array.isArray(l))return l.length;throw new Ae(`Expected value to be of type string or array, but found ${Ft(fe(l))} instead.`)}eachChild(i){i(this.input)}outputDefined(){return!1}serialize(){let i=["length"];return this.eachChild(l=>{i.push(l.serialize())}),i}}let ca={"==":Yg,"!=":qg,">":Qg,"<":Jg,">=":e0,"<=":Kg,array:lt,at:rh,boolean:lt,case:sh,coalesce:su,collator:cr,format:xt,image:Ct,in:nh,"index-of":lu,interpolate:Mn,"interpolate-hcl":Mn,"interpolate-lab":Mn,length:lh,let:au,literal:Ge,match:oh,number:lt,"number-format":ah,object:lt,slice:uu,step:ol,string:lt,"to-boolean":Yt,"to-color":Yt,"to-number":Yt,"to-string":Yt,var:iu,within:xs};function vp(s,[i,l,h,p]){i=i.evaluate(s),l=l.evaluate(s),h=h.evaluate(s);let y=p?p.evaluate(s):1,x=ue(i,l,h,y);if(x)throw new Ae(x);return new L(i/255*y,l/255*y,h/255*y,y)}function xp(s,i){return s in i}function uh(s,i){let l=i[s];return l===void 0?null:l}function _s(s){return{type:s}}function _p(s){return{result:"success",value:s}}function bs(s){return{result:"error",value:s}}function ha(s){return s["property-type"]==="data-driven"||s["property-type"]==="cross-faded-data-driven"}function bp(s){return!!s.expression&&s.expression.parameters.indexOf("zoom")>-1}function ch(s){return!!s.expression&&s.expression.interpolated}function Rt(s){return s instanceof Number?"number":s instanceof String?"string":s instanceof Boolean?"boolean":Array.isArray(s)?"array":s===null?"null":typeof s}function cu(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)}function bi(s){return s}function hu(s,i){let l=i.type==="color",h=s.stops&&typeof s.stops[0][0]=="object",p=h||!(h||s.property!==void 0),y=s.type||(ch(i)?"exponential":"interval");if(l&&((s=Xe({},s)).stops&&(s.stops=s.stops.map(A=>[A[0],L.parse(A[1])])),s.default=L.parse(s.default?s.default:i.default)),s.colorSpace&&s.colorSpace!=="rgb"&&!mp[s.colorSpace])throw new Error(`Unknown color space: ${s.colorSpace}`);let x,w,S;if(y==="exponential")x=hh;else if(y==="interval")x=du;else if(y==="categorical"){x=or,w=Object.create(null);for(let A of s.stops)w[A[0]]=A[1];S=typeof s.stops[0][0]}else{if(y!=="identity")throw new Error(`Unknown function type "${y}"`);x=t0}if(h){let A={},z=[];for(let G=0;G<s.stops.length;G++){let Z=s.stops[G],se=Z[0].zoom;A[se]===void 0&&(A[se]={zoom:se,type:s.type,property:s.property,default:s.default,stops:[]},z.push(se)),A[se].stops.push([Z[0].value,Z[1]])}let R=[];for(let G of z)R.push([A[G].zoom,hu(A[G],i)]);let N={name:"linear"};return{kind:"composite",interpolationType:N,interpolationFactor:Mn.interpolationFactor.bind(void 0,N),zoomStops:R.map(G=>G[0]),evaluate:({zoom:G},Z)=>hh({stops:R,base:s.base},i,G).evaluate(G,Z)}}if(p){let A=y==="exponential"?{name:"exponential",base:s.base!==void 0?s.base:1}:null;return{kind:"camera",interpolationType:A,interpolationFactor:Mn.interpolationFactor.bind(void 0,A),zoomStops:s.stops.map(z=>z[0]),evaluate:({zoom:z})=>x(s,i,z,w,S)}}return{kind:"source",evaluate(A,z){let R=z&&z.properties?z.properties[s.property]:void 0;return R===void 0?Vi(s.default,i.default):x(s,i,R,w,S)}}}function Vi(s,i,l){return s!==void 0?s:i!==void 0?i:l!==void 0?l:void 0}function or(s,i,l,h,p){return Vi(typeof l===p?h[l]:void 0,s.default,i.default)}function du(s,i,l){if(Rt(l)!=="number")return Vi(s.default,i.default);let h=s.stops.length;if(h===1||l<=s.stops[0][0])return s.stops[0][1];if(l>=s.stops[h-1][0])return s.stops[h-1][1];let p=nu(s.stops.map(y=>y[0]),l);return s.stops[p][1]}function hh(s,i,l){let h=s.base!==void 0?s.base:1;if(Rt(l)!=="number")return Vi(s.default,i.default);let p=s.stops.length;if(p===1||l<=s.stops[0][0])return s.stops[0][1];if(l>=s.stops[p-1][0])return s.stops[p-1][1];let y=nu(s.stops.map(z=>z[0]),l),x=function(z,R,N,G){let Z=G-N,se=z-N;return Z===0?0:R===1?se/Z:(Math.pow(R,se)-1)/(Math.pow(R,Z)-1)}(l,h,s.stops[y][0],s.stops[y+1][0]),w=s.stops[y][1],S=s.stops[y+1][1],A=sl[i.type]||bi;if(s.colorSpace&&s.colorSpace!=="rgb"){let z=mp[s.colorSpace];A=(R,N)=>z.reverse(z.interpolate(z.forward(R),z.forward(N),x))}return typeof w.evaluate=="function"?{evaluate(...z){let R=w.evaluate.apply(void 0,z),N=S.evaluate.apply(void 0,z);if(R!==void 0&&N!==void 0)return A(R,N,x)}}:A(w,S,x)}function t0(s,i,l){return i.type==="color"?l=L.parse(l):i.type==="formatted"?l=re.fromString(l.toString()):i.type==="resolvedImage"?l=pe.fromString(l.toString()):Rt(l)===i.type||i.type==="enum"&&i.values[l]||(l=void 0),Vi(l,s.default,i.default)}Dt.register(ca,{error:[{kind:"error"},[It],(s,[i])=>{throw new Ae(i.evaluate(s))}],typeof:[It,[St],(s,[i])=>Ft(fe(i.evaluate(s)))],"to-rgba":[hi(Ue,4),[ni],(s,[i])=>i.evaluate(s).toArray()],rgb:[ni,[Ue,Ue,Ue],vp],rgba:[ni,[Ue,Ue,Ue,Ue],vp],has:{type:yt,overloads:[[[It],(s,[i])=>xp(i.evaluate(s),s.properties())],[[It,gi],(s,[i,l])=>xp(i.evaluate(s),l.evaluate(s))]]},get:{type:St,overloads:[[[It],(s,[i])=>uh(i.evaluate(s),s.properties())],[[It,gi],(s,[i,l])=>uh(i.evaluate(s),l.evaluate(s))]]},"feature-state":[St,[It],(s,[i])=>uh(i.evaluate(s),s.featureState||{})],properties:[gi,[],s=>s.properties()],"geometry-type":[It,[],s=>s.geometryType()],id:[St,[],s=>s.id()],zoom:[Ue,[],s=>s.globals.zoom],"heatmap-density":[Ue,[],s=>s.globals.heatmapDensity||0],"line-progress":[Ue,[],s=>s.globals.lineProgress||0],accumulated:[St,[],s=>s.globals.accumulated===void 0?null:s.globals.accumulated],"+":[Ue,_s(Ue),(s,i)=>{let l=0;for(let h of i)l+=h.evaluate(s);return l}],"*":[Ue,_s(Ue),(s,i)=>{let l=1;for(let h of i)l*=h.evaluate(s);return l}],"-":{type:Ue,overloads:[[[Ue,Ue],(s,[i,l])=>i.evaluate(s)-l.evaluate(s)],[[Ue],(s,[i])=>-i.evaluate(s)]]},"/":[Ue,[Ue,Ue],(s,[i,l])=>i.evaluate(s)/l.evaluate(s)],"%":[Ue,[Ue,Ue],(s,[i,l])=>i.evaluate(s)%l.evaluate(s)],ln2:[Ue,[],()=>Math.LN2],pi:[Ue,[],()=>Math.PI],e:[Ue,[],()=>Math.E],"^":[Ue,[Ue,Ue],(s,[i,l])=>Math.pow(i.evaluate(s),l.evaluate(s))],sqrt:[Ue,[Ue],(s,[i])=>Math.sqrt(i.evaluate(s))],log10:[Ue,[Ue],(s,[i])=>Math.log(i.evaluate(s))/Math.LN10],ln:[Ue,[Ue],(s,[i])=>Math.log(i.evaluate(s))],log2:[Ue,[Ue],(s,[i])=>Math.log(i.evaluate(s))/Math.LN2],sin:[Ue,[Ue],(s,[i])=>Math.sin(i.evaluate(s))],cos:[Ue,[Ue],(s,[i])=>Math.cos(i.evaluate(s))],tan:[Ue,[Ue],(s,[i])=>Math.tan(i.evaluate(s))],asin:[Ue,[Ue],(s,[i])=>Math.asin(i.evaluate(s))],acos:[Ue,[Ue],(s,[i])=>Math.acos(i.evaluate(s))],atan:[Ue,[Ue],(s,[i])=>Math.atan(i.evaluate(s))],min:[Ue,_s(Ue),(s,i)=>Math.min(...i.map(l=>l.evaluate(s)))],max:[Ue,_s(Ue),(s,i)=>Math.max(...i.map(l=>l.evaluate(s)))],abs:[Ue,[Ue],(s,[i])=>Math.abs(i.evaluate(s))],round:[Ue,[Ue],(s,[i])=>{let l=i.evaluate(s);return l<0?-Math.round(-l):Math.round(l)}],floor:[Ue,[Ue],(s,[i])=>Math.floor(i.evaluate(s))],ceil:[Ue,[Ue],(s,[i])=>Math.ceil(i.evaluate(s))],"filter-==":[yt,[It,St],(s,[i,l])=>s.properties()[i.value]===l.value],"filter-id-==":[yt,[St],(s,[i])=>s.id()===i.value],"filter-type-==":[yt,[It],(s,[i])=>s.geometryType()===i.value],"filter-<":[yt,[It,St],(s,[i,l])=>{let h=s.properties()[i.value],p=l.value;return typeof h==typeof p&&h<p}],"filter-id-<":[yt,[St],(s,[i])=>{let l=s.id(),h=i.value;return typeof l==typeof h&&l<h}],"filter->":[yt,[It,St],(s,[i,l])=>{let h=s.properties()[i.value],p=l.value;return typeof h==typeof p&&h>p}],"filter-id->":[yt,[St],(s,[i])=>{let l=s.id(),h=i.value;return typeof l==typeof h&&l>h}],"filter-<=":[yt,[It,St],(s,[i,l])=>{let h=s.properties()[i.value],p=l.value;return typeof h==typeof p&&h<=p}],"filter-id-<=":[yt,[St],(s,[i])=>{let l=s.id(),h=i.value;return typeof l==typeof h&&l<=h}],"filter->=":[yt,[It,St],(s,[i,l])=>{let h=s.properties()[i.value],p=l.value;return typeof h==typeof p&&h>=p}],"filter-id->=":[yt,[St],(s,[i])=>{let l=s.id(),h=i.value;return typeof l==typeof h&&l>=h}],"filter-has":[yt,[St],(s,[i])=>i.value in s.properties()],"filter-has-id":[yt,[],s=>s.id()!==null&&s.id()!==void 0],"filter-type-in":[yt,[hi(It)],(s,[i])=>i.value.indexOf(s.geometryType())>=0],"filter-id-in":[yt,[hi(St)],(s,[i])=>i.value.indexOf(s.id())>=0],"filter-in-small":[yt,[It,hi(St)],(s,[i,l])=>l.value.indexOf(s.properties()[i.value])>=0],"filter-in-large":[yt,[It,hi(St)],(s,[i,l])=>function(h,p,y,x){for(;y<=x;){let w=y+x>>1;if(p[w]===h)return!0;p[w]>h?x=w-1:y=w+1}return!1}(s.properties()[i.value],l.value,0,l.value.length-1)],all:{type:yt,overloads:[[[yt,yt],(s,[i,l])=>i.evaluate(s)&&l.evaluate(s)],[_s(yt),(s,i)=>{for(let l of i)if(!l.evaluate(s))return!1;return!0}]]},any:{type:yt,overloads:[[[yt,yt],(s,[i,l])=>i.evaluate(s)||l.evaluate(s)],[_s(yt),(s,i)=>{for(let l of i)if(l.evaluate(s))return!0;return!1}]]},"!":[yt,[yt],(s,[i])=>!i.evaluate(s)],"is-supported-script":[yt,[It],(s,[i])=>{let l=s.globals&&s.globals.isSupportedScript;return!l||l(i.evaluate(s))}],upcase:[It,[It],(s,[i])=>i.evaluate(s).toUpperCase()],downcase:[It,[It],(s,[i])=>i.evaluate(s).toLowerCase()],concat:[It,_s(St),(s,i)=>i.map(l=>ke(l.evaluate(s))).join("")],"resolved-locale":[It,[tr],(s,[i])=>i.evaluate(s).resolvedLocale()]});class dh{constructor(i,l){this.expression=i,this._warningHistory={},this._evaluator=new Nt,this._defaultValue=l?function(h){return h.type==="color"&&cu(h.default)?new L(0,0,0,0):h.type==="color"?L.parse(h.default)||null:h.default===void 0?null:h.default}(l):null,this._enumValues=l&&l.type==="enum"?l.values:null}evaluateWithoutErrorHandling(i,l,h,p,y,x){return this._evaluator.globals=i,this._evaluator.feature=l,this._evaluator.featureState=h,this._evaluator.canonical=p,this._evaluator.availableImages=y||null,this._evaluator.formattedSection=x,this.expression.evaluate(this._evaluator)}evaluate(i,l,h,p,y,x){this._evaluator.globals=i,this._evaluator.feature=l||null,this._evaluator.featureState=h||null,this._evaluator.canonical=p,this._evaluator.availableImages=y||null,this._evaluator.formattedSection=x||null;try{let w=this.expression.evaluate(this._evaluator);if(w==null||typeof w=="number"&&w!=w)return this._defaultValue;if(this._enumValues&&!(w in this._enumValues))throw new Ae(`Expected value to be one of ${Object.keys(this._enumValues).map(S=>JSON.stringify(S)).join(", ")}, but found ${JSON.stringify(w)} instead.`);return w}catch(w){return this._warningHistory[w.message]||(this._warningHistory[w.message]=!0,typeof console<"u"&&console.warn(w.message)),this._defaultValue}}}function pu(s){return Array.isArray(s)&&s.length>0&&typeof s[0]=="string"&&s[0]in ca}function fu(s,i){let l=new ru(ca,[],i?function(p){let y={color:ni,string:It,number:Ue,enum:It,boolean:yt,formatted:ci,resolvedImage:Ri};return p.type==="array"?hi(y[p.value]||St,p.length):y[p.type]}(i):void 0),h=l.parse(s,void 0,void 0,void 0,i&&i.type==="string"?{typeAnnotation:"coerce"}:void 0);return h?_p(new dh(h,i)):bs(l.errors)}class mu{constructor(i,l){this.kind=i,this._styleExpression=l,this.isStateDependent=i!=="constant"&&!la(l.expression)}evaluateWithoutErrorHandling(i,l,h,p,y,x){return this._styleExpression.evaluateWithoutErrorHandling(i,l,h,p,y,x)}evaluate(i,l,h,p,y,x){return this._styleExpression.evaluate(i,l,h,p,y,x)}}class gu{constructor(i,l,h,p){this.kind=i,this.zoomStops=h,this._styleExpression=l,this.isStateDependent=i!=="camera"&&!la(l.expression),this.interpolationType=p}evaluateWithoutErrorHandling(i,l,h,p,y,x){return this._styleExpression.evaluateWithoutErrorHandling(i,l,h,p,y,x)}evaluate(i,l,h,p,y,x){return this._styleExpression.evaluate(i,l,h,p,y,x)}interpolationFactor(i,l,h){return this.interpolationType?Mn.interpolationFactor(this.interpolationType,i,l,h):0}}function ph(s,i){let l=fu(s,i);if(l.result==="error")return l;let h=l.value.expression,p=tu(h);if(!p&&!ha(i))return bs([new ut("","data expressions not supported")]);let y=rl(h,["zoom"]);if(!y&&!bp(i))return bs([new ut("","zoom expressions not supported")]);let x=yu(h);return x||y?x instanceof ut?bs([x]):x instanceof Mn&&!ch(i)?bs([new ut("",'"interpolate" expressions cannot be used with this property')]):_p(x?new gu(p?"camera":"composite",l.value,x.labels,x instanceof Mn?x.interpolation:void 0):new mu(p?"constant":"source",l.value)):bs([new ut("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class da{constructor(i,l){this._parameters=i,this._specification=l,Xe(this,hu(this._parameters,this._specification))}static deserialize(i){return new da(i._parameters,i._specification)}static serialize(i){return{_parameters:i._parameters,_specification:i._specification}}}function yu(s){let i=null;if(s instanceof au)i=yu(s.result);else if(s instanceof su){for(let l of s.args)if(i=yu(l),i)break}else(s instanceof ol||s instanceof Mn)&&s.input instanceof Dt&&s.input.name==="zoom"&&(i=s);return i instanceof ut||s.eachChild(l=>{let h=yu(l);h instanceof ut?i=h:!i&&h?i=new ut("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):i&&h&&i!==h&&(i=new ut("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),i}function so(s){let i=s.key,l=s.value,h=s.valueSpec||{},p=s.objectElementValidators||{},y=s.style,x=s.styleSpec,w=[],S=Rt(l);if(S!=="object")return[new Re(i,l,`object expected, ${S} found`)];for(let A in l){let z=A.split(".")[0],R=h[z]||h["*"],N;if(p[z])N=p[z];else if(h[z])N=dn;else if(p["*"])N=p["*"];else{if(!h["*"]){w.push(new Re(i,l[A],`unknown property "${A}"`));continue}N=dn}w=w.concat(N({key:(i&&`${i}.`)+A,value:l[A],valueSpec:R,style:y,styleSpec:x,object:l,objectKey:A},l))}for(let A in h)p[A]||h[A].required&&h[A].default===void 0&&l[A]===void 0&&w.push(new Re(i,l,`missing required property "${A}"`));return w}function wp(s){let i=s.value,l=s.valueSpec,h=s.style,p=s.styleSpec,y=s.key,x=s.arrayElementValidator||dn;if(Rt(i)!=="array")return[new Re(y,i,`array expected, ${Rt(i)} found`)];if(l.length&&i.length!==l.length)return[new Re(y,i,`array length ${l.length} expected, length ${i.length} found`)];if(l["min-length"]&&i.length<l["min-length"])return[new Re(y,i,`array length at least ${l["min-length"]} expected, length ${i.length} found`)];let w={type:l.value,values:l.values};p.$version<7&&(w.function=l.function),Rt(l.value)==="object"&&(w=l.value);let S=[];for(let A=0;A<i.length;A++)S=S.concat(x({array:i,arrayIndex:A,value:i[A],valueSpec:w,style:h,styleSpec:p,key:`${y}[${A}]`}));return S}function Ip(s){let i=s.key,l=s.value,h=s.valueSpec,p=Rt(l);return p==="number"&&l!=l&&(p="NaN"),p!=="number"?[new Re(i,l,`number expected, ${p} found`)]:"minimum"in h&&l<h.minimum?[new Re(i,l,`${l} is less than the minimum value ${h.minimum}`)]:"maximum"in h&&l>h.maximum?[new Re(i,l,`${l} is greater than the maximum value ${h.maximum}`)]:[]}function Sp(s){let i=s.valueSpec,l=$e(s.value.type),h,p,y,x={},w=l!=="categorical"&&s.value.property===void 0,S=!w,A=Rt(s.value.stops)==="array"&&Rt(s.value.stops[0])==="array"&&Rt(s.value.stops[0][0])==="object",z=so({key:s.key,value:s.value,valueSpec:s.styleSpec.function,style:s.style,styleSpec:s.styleSpec,objectElementValidators:{stops:function(G){if(l==="identity")return[new Re(G.key,G.value,'identity function may not have a "stops" property')];let Z=[],se=G.value;return Z=Z.concat(wp({key:G.key,value:se,valueSpec:G.valueSpec,style:G.style,styleSpec:G.styleSpec,arrayElementValidator:R})),Rt(se)==="array"&&se.length===0&&Z.push(new Re(G.key,se,"array must have at least one stop")),Z},default:function(G){return dn({key:G.key,value:G.value,valueSpec:i,style:G.style,styleSpec:G.styleSpec})}}});return l==="identity"&&w&&z.push(new Re(s.key,s.value,'missing required property "property"')),l==="identity"||s.value.stops||z.push(new Re(s.key,s.value,'missing required property "stops"')),l==="exponential"&&s.valueSpec.expression&&!ch(s.valueSpec)&&z.push(new Re(s.key,s.value,"exponential functions not supported")),s.styleSpec.$version>=8&&(S&&!ha(s.valueSpec)?z.push(new Re(s.key,s.value,"property functions not supported")):w&&!bp(s.valueSpec)&&z.push(new Re(s.key,s.value,"zoom functions not supported"))),l!=="categorical"&&!A||s.value.property!==void 0||z.push(new Re(s.key,s.value,'"property" property is required')),z;function R(G){let Z=[],se=G.value,ae=G.key;if(Rt(se)!=="array")return[new Re(ae,se,`array expected, ${Rt(se)} found`)];if(se.length!==2)return[new Re(ae,se,`array length 2 expected, length ${se.length} found`)];if(A){if(Rt(se[0])!=="object")return[new Re(ae,se,`object expected, ${Rt(se[0])} found`)];if(se[0].zoom===void 0)return[new Re(ae,se,"object stop key must have zoom")];if(se[0].value===void 0)return[new Re(ae,se,"object stop key must have value")];if(y&&y>$e(se[0].zoom))return[new Re(ae,se[0].zoom,"stop zoom values must appear in ascending order")];$e(se[0].zoom)!==y&&(y=$e(se[0].zoom),p=void 0,x={}),Z=Z.concat(so({key:`${ae}[0]`,value:se[0],valueSpec:{zoom:{}},style:G.style,styleSpec:G.styleSpec,objectElementValidators:{zoom:Ip,value:N}}))}else Z=Z.concat(N({key:`${ae}[0]`,value:se[0],valueSpec:{},style:G.style,styleSpec:G.styleSpec},se));return pu(ft(se[1]))?Z.concat([new Re(`${ae}[1]`,se[1],"expressions are not allowed in function stops.")]):Z.concat(dn({key:`${ae}[1]`,value:se[1],valueSpec:i,style:G.style,styleSpec:G.styleSpec}))}function N(G,Z){let se=Rt(G.value),ae=$e(G.value),be=G.value!==null?G.value:Z;if(h){if(se!==h)return[new Re(G.key,be,`${se} stop domain type must match previous stop domain type ${h}`)]}else h=se;if(se!=="number"&&se!=="string"&&se!=="boolean")return[new Re(G.key,be,"stop domain value must be a number, string, or boolean")];if(se!=="number"&&l!=="categorical"){let Te=`number expected, ${se} found`;return ha(i)&&l===void 0&&(Te+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Re(G.key,be,Te)]}return l!=="categorical"||se!=="number"||isFinite(ae)&&Math.floor(ae)===ae?l!=="categorical"&&se==="number"&&p!==void 0&&ae<p?[new Re(G.key,be,"stop domain values must appear in ascending order")]:(p=ae,l==="categorical"&&ae in x?[new Re(G.key,be,"stop domain values must be unique")]:(x[ae]=!0,[])):[new Re(G.key,be,`integer expected, found ${ae}`)]}}function pa(s){let i=(s.expressionContext==="property"?ph:fu)(ft(s.value),s.valueSpec);if(i.result==="error")return i.value.map(h=>new Re(`${s.key}${h.key}`,s.value,h.message));let l=i.value.expression||i.value._styleExpression.expression;if(s.expressionContext==="property"&&s.propertyKey==="text-font"&&!l.outputDefined())return[new Re(s.key,s.value,`Invalid data expression for "${s.propertyKey}". Output values must be contained as literals within the expression.`)];if(s.expressionContext==="property"&&s.propertyType==="layout"&&!la(l))return[new Re(s.key,s.value,'"feature-state" data expressions are not supported with layout properties.')];if(s.expressionContext==="filter"&&!la(l))return[new Re(s.key,s.value,'"feature-state" data expressions are not supported with filters.')];if(s.expressionContext&&s.expressionContext.indexOf("cluster")===0){if(!rl(l,["zoom","feature-state"]))return[new Re(s.key,s.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(s.expressionContext==="cluster-initial"&&!tu(l))return[new Re(s.key,s.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function vu(s){let i=s.key,l=s.value,h=s.valueSpec,p=[];return Array.isArray(h.values)?h.values.indexOf($e(l))===-1&&p.push(new Re(i,l,`expected one of [${h.values.join(", ")}], ${JSON.stringify(l)} found`)):Object.keys(h.values).indexOf($e(l))===-1&&p.push(new Re(i,l,`expected one of [${Object.keys(h.values).join(", ")}], ${JSON.stringify(l)} found`)),p}function fh(s){if(s===!0||s===!1)return!0;if(!Array.isArray(s)||s.length===0)return!1;switch(s[0]){case"has":return s.length>=2&&s[1]!=="$id"&&s[1]!=="$type";case"in":return s.length>=3&&(typeof s[1]!="string"||Array.isArray(s[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return s.length!==3||Array.isArray(s[1])||Array.isArray(s[2]);case"any":case"all":for(let i of s.slice(1))if(!fh(i)&&typeof i!="boolean")return!1;return!0;default:return!0}}let Cp={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function xu(s){if(s==null)return{filter:()=>!0,needGeometry:!1};fh(s)||(s=ul(s));let i=fu(s,Cp);if(i.result==="error")throw new Error(i.value.map(l=>`${l.key}: ${l.message}`).join(", "));return{filter:(l,h,p)=>i.value.evaluate(l,h,{},p),needGeometry:Mp(s)}}function _u(s,i){return s<i?-1:s>i?1:0}function Mp(s){if(!Array.isArray(s))return!1;if(s[0]==="within")return!0;for(let i=1;i<s.length;i++)if(Mp(s[i]))return!0;return!1}function ul(s){if(!s)return!0;let i=s[0];return s.length<=1?i!=="any":i==="=="?mh(s[1],s[2],"=="):i==="!="?fa(mh(s[1],s[2],"==")):i==="<"||i===">"||i==="<="||i===">="?mh(s[1],s[2],i):i==="any"?(l=s.slice(1),["any"].concat(l.map(ul))):i==="all"?["all"].concat(s.slice(1).map(ul)):i==="none"?["all"].concat(s.slice(1).map(ul).map(fa)):i==="in"?bu(s[1],s.slice(2)):i==="!in"?fa(bu(s[1],s.slice(2))):i==="has"?wu(s[1]):i==="!has"?fa(wu(s[1])):i!=="within"||s;var l}function mh(s,i,l){switch(s){case"$type":return[`filter-type-${l}`,i];case"$id":return[`filter-id-${l}`,i];default:return[`filter-${l}`,s,i]}}function bu(s,i){if(i.length===0)return!1;switch(s){case"$type":return["filter-type-in",["literal",i]];case"$id":return["filter-id-in",["literal",i]];default:return i.length>200&&!i.some(l=>typeof l!=typeof i[0])?["filter-in-large",s,["literal",i.sort(_u)]]:["filter-in-small",s,["literal",i]]}}function wu(s){switch(s){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",s]}}function fa(s){return["!",s]}function cl(s){return fh(ft(s.value))?pa(Xe({},s,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Ep(s)}function Ep(s){let i=s.value,l=s.key;if(Rt(i)!=="array")return[new Re(l,i,`array expected, ${Rt(i)} found`)];let h=s.styleSpec,p,y=[];if(i.length<1)return[new Re(l,i,"filter array must have at least 1 element")];switch(y=y.concat(vu({key:`${l}[0]`,value:i[0],valueSpec:h.filter_operator,style:s.style,styleSpec:s.styleSpec})),$e(i[0])){case"<":case"<=":case">":case">=":i.length>=2&&$e(i[1])==="$type"&&y.push(new Re(l,i,`"$type" cannot be use with operator "${i[0]}"`));case"==":case"!=":i.length!==3&&y.push(new Re(l,i,`filter array for operator "${i[0]}" must have 3 elements`));case"in":case"!in":i.length>=2&&(p=Rt(i[1]),p!=="string"&&y.push(new Re(`${l}[1]`,i[1],`string expected, ${p} found`)));for(let x=2;x<i.length;x++)p=Rt(i[x]),$e(i[1])==="$type"?y=y.concat(vu({key:`${l}[${x}]`,value:i[x],valueSpec:h.geometry_type,style:s.style,styleSpec:s.styleSpec})):p!=="string"&&p!=="number"&&p!=="boolean"&&y.push(new Re(`${l}[${x}]`,i[x],`string, number, or boolean expected, ${p} found`));break;case"any":case"all":case"none":for(let x=1;x<i.length;x++)y=y.concat(Ep({key:`${l}[${x}]`,value:i[x],style:s.style,styleSpec:s.styleSpec}));break;case"has":case"!has":p=Rt(i[1]),i.length!==2?y.push(new Re(l,i,`filter array for "${i[0]}" operator must have 2 elements`)):p!=="string"&&y.push(new Re(`${l}[1]`,i[1],`string expected, ${p} found`));break;case"within":p=Rt(i[1]),i.length!==2?y.push(new Re(l,i,`filter array for "${i[0]}" operator must have 2 elements`)):p!=="object"&&y.push(new Re(`${l}[1]`,i[1],`object expected, ${p} found`))}return y}function hl(s,i){let l=s.key,h=s.style,p=s.styleSpec,y=s.value,x=s.objectKey,w=p[`${i}_${s.layerType}`];if(!w)return[];let S=x.match(/^(.*)-transition$/);if(i==="paint"&&S&&w[S[1]]&&w[S[1]].transition)return dn({key:l,value:y,valueSpec:p.transition,style:h,styleSpec:p});let A=s.valueSpec||w[x];if(!A)return[new Re(l,y,`unknown property "${x}"`)];let z;if(Rt(y)==="string"&&ha(A)&&!A.tokens&&(z=/^{([^}]+)}$/.exec(y)))return[new Re(l,y,`"${x}" does not support interpolation syntax
|
|
10
|
-
Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(z[1])} }\`.`)];let R=[];return s.layerType==="symbol"&&(x==="text-field"&&h&&!h.glyphs&&R.push(new Re(l,y,'use of "text-field" requires a style "glyphs" property')),x==="text-font"&&cu(ft(y))&&$e(y.type)==="identity"&&R.push(new Re(l,y,'"text-font" does not support identity functions'))),R.concat(dn({key:s.key,value:y,valueSpec:A,style:h,styleSpec:p,expressionContext:"property",propertyType:i,propertyKey:x}))}function Tp(s){return hl(s,"paint")}function Ap(s){return hl(s,"layout")}function Pp(s){let i=[],l=s.value,h=s.key,p=s.style,y=s.styleSpec;l.type||l.ref||i.push(new Re(h,l,'either "type" or "ref" is required'));let x=$e(l.type),w=$e(l.ref);if(l.id){let S=$e(l.id);for(let A=0;A<s.arrayIndex;A++){let z=p.layers[A];$e(z.id)===S&&i.push(new Re(h,l.id,`duplicate layer id "${l.id}", previously used at line ${z.id.__line__}`))}}if("ref"in l){let S;["type","source","source-layer","filter","layout"].forEach(A=>{A in l&&i.push(new Re(h,l[A],`"${A}" is prohibited for ref layers`))}),p.layers.forEach(A=>{$e(A.id)===w&&(S=A)}),S?S.ref?i.push(new Re(h,l.ref,"ref cannot reference another ref layer")):x=$e(S.type):i.push(new Re(h,l.ref,`ref layer "${w}" not found`))}else if(x!=="background")if(l.source){let S=p.sources&&p.sources[l.source],A=S&&$e(S.type);S?A==="vector"&&x==="raster"?i.push(new Re(h,l.source,`layer "${l.id}" requires a raster source`)):A==="raster"&&x!=="raster"?i.push(new Re(h,l.source,`layer "${l.id}" requires a vector source`)):A!=="vector"||l["source-layer"]?A==="raster-dem"&&x!=="hillshade"?i.push(new Re(h,l.source,"raster-dem source can only be used with layer type 'hillshade'.")):x!=="line"||!l.paint||!l.paint["line-gradient"]||A==="geojson"&&S.lineMetrics||i.push(new Re(h,l,`layer "${l.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):i.push(new Re(h,l,`layer "${l.id}" must specify a "source-layer"`)):i.push(new Re(h,l.source,`source "${l.source}" not found`))}else i.push(new Re(h,l,'missing required property "source"'));return i=i.concat(so({key:h,value:l,valueSpec:y.layer,style:s.style,styleSpec:s.styleSpec,objectElementValidators:{"*":()=>[],type:()=>dn({key:`${h}.type`,value:l.type,valueSpec:y.layer.type,style:s.style,styleSpec:s.styleSpec,object:l,objectKey:"type"}),filter:cl,layout:S=>so({layer:l,key:S.key,value:S.value,style:S.style,styleSpec:S.styleSpec,objectElementValidators:{"*":A=>Ap(Xe({layerType:x},A))}}),paint:S=>so({layer:l,key:S.key,value:S.value,style:S.style,styleSpec:S.styleSpec,objectElementValidators:{"*":A=>Tp(Xe({layerType:x},A))}})}})),i}function ma(s){let i=s.value,l=s.key,h=Rt(i);return h!=="string"?[new Re(l,i,`string expected, ${h} found`)]:[]}let kp={promoteId:function({key:s,value:i}){if(Rt(i)==="string")return ma({key:s,value:i});{let l=[];for(let h in i)l.push(...ma({key:`${s}.${h}`,value:i[h]}));return l}}};function dl(s){let i=s.value,l=s.key,h=s.styleSpec,p=s.style;if(!i.type)return[new Re(l,i,'"type" is required')];let y=$e(i.type),x;switch(y){case"vector":case"raster":case"raster-dem":return x=so({key:l,value:i,valueSpec:h[`source_${y.replace("-","_")}`],style:s.style,styleSpec:h,objectElementValidators:kp}),x;case"geojson":if(x=so({key:l,value:i,valueSpec:h.source_geojson,style:p,styleSpec:h,objectElementValidators:kp}),i.cluster)for(let w in i.clusterProperties){let[S,A]=i.clusterProperties[w],z=typeof S=="string"?[S,["accumulated"],["get",w]]:S;x.push(...pa({key:`${l}.${w}.map`,value:A,expressionContext:"cluster-map"})),x.push(...pa({key:`${l}.${w}.reduce`,value:z,expressionContext:"cluster-reduce"}))}return x;case"video":return so({key:l,value:i,valueSpec:h.source_video,style:p,styleSpec:h});case"image":return so({key:l,value:i,valueSpec:h.source_image,style:p,styleSpec:h});case"canvas":return[new Re(l,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return vu({key:`${l}.type`,value:i.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:p,styleSpec:h})}}function pl(s){let i=s.value,l=s.styleSpec,h=l.light,p=s.style,y=[],x=Rt(i);if(i===void 0)return y;if(x!=="object")return y=y.concat([new Re("light",i,`object expected, ${x} found`)]),y;for(let w in i){let S=w.match(/^(.*)-transition$/);y=y.concat(S&&h[S[1]]&&h[S[1]].transition?dn({key:w,value:i[w],valueSpec:l.transition,style:p,styleSpec:l}):h[w]?dn({key:w,value:i[w],valueSpec:h[w],style:p,styleSpec:l}):[new Re(w,i[w],`unknown property "${w}"`)])}return y}let En={"*":()=>[],array:wp,boolean:function(s){let i=s.value,l=s.key,h=Rt(i);return h!=="boolean"?[new Re(l,i,`boolean expected, ${h} found`)]:[]},number:Ip,color:function(s){let i=s.key,l=s.value,h=Rt(l);return h!=="string"?[new Re(i,l,`color expected, ${h} found`)]:rr(l)===null?[new Re(i,l,`color expected, "${l}" found`)]:[]},constants:ie,enum:vu,filter:cl,function:Sp,layer:Pp,object:so,source:dl,light:pl,string:ma,formatted:function(s){return ma(s).length===0?[]:pa(s)},resolvedImage:function(s){return ma(s).length===0?[]:pa(s)}};function dn(s){let i=s.value,l=s.valueSpec,h=s.styleSpec;return l.expression&&cu($e(i))?Sp(s):l.expression&&pu(ft(i))?pa(s):l.type&&En[l.type]?En[l.type](s):so(Xe({},s,{valueSpec:l.type?h[l.type]:l}))}function i0(s){let i=s.value,l=s.key,h=ma(s);return h.length||(i.indexOf("{fontstack}")===-1&&h.push(new Re(l,i,'"glyphs" url must include a "{fontstack}" token')),i.indexOf("{range}")===-1&&h.push(new Re(l,i,'"glyphs" url must include a "{range}" token'))),h}function ws(s,i=ye){let l=[];return l=l.concat(dn({key:"",value:s,valueSpec:i.$root,styleSpec:i,style:s,objectElementValidators:{glyphs:i0,"*":()=>[]}})),s.constants&&(l=l.concat(ie({key:"constants",value:s.constants,style:s,styleSpec:i}))),zp(l)}function zp(s){return[].concat(s).sort((i,l)=>i.line-l.line)}function ga(s){return function(...i){return zp(s.apply(this,i))}}ws.source=ga(dl),ws.light=ga(pl),ws.layer=ga(Pp),ws.filter=ga(cl),ws.paintProperty=ga(Tp),ws.layoutProperty=ga(Ap);let Is=ws,r0=Is.light,gh=Is.paintProperty,n0=Is.layoutProperty;function Lp(s,i){let l=!1;if(i&&i.length)for(let h of i)s.fire(new Ve(new Error(h.message))),l=!0;return l}class Ss{constructor(i,l,h){let p=this.cells=[];if(i instanceof ArrayBuffer){this.arrayBuffer=i;let x=new Int32Array(this.arrayBuffer);i=x[0],this.d=(l=x[1])+2*(h=x[2]);for(let S=0;S<this.d*this.d;S++){let A=x[3+S],z=x[3+S+1];p.push(A===z?null:x.subarray(A,z))}let w=x[3+p.length+1];this.keys=x.subarray(x[3+p.length],w),this.bboxes=x.subarray(w),this.insert=this._insertReadonly}else{this.d=l+2*h;for(let x=0;x<this.d*this.d;x++)p.push([]);this.keys=[],this.bboxes=[]}this.n=l,this.extent=i,this.padding=h,this.scale=l/i,this.uid=0;let y=h/l*i;this.min=-y,this.max=i+y}insert(i,l,h,p,y){this._forEachCell(l,h,p,y,this._insertCell,this.uid++,void 0,void 0),this.keys.push(i),this.bboxes.push(l),this.bboxes.push(h),this.bboxes.push(p),this.bboxes.push(y)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(i,l,h,p,y,x){this.cells[y].push(x)}query(i,l,h,p,y){let x=this.min,w=this.max;if(i<=x&&l<=x&&w<=h&&w<=p&&!y)return Array.prototype.slice.call(this.keys);{let S=[];return this._forEachCell(i,l,h,p,this._queryCell,S,{},y),S}}_queryCell(i,l,h,p,y,x,w,S){let A=this.cells[y];if(A!==null){let z=this.keys,R=this.bboxes;for(let N=0;N<A.length;N++){let G=A[N];if(w[G]===void 0){let Z=4*G;(S?S(R[Z+0],R[Z+1],R[Z+2],R[Z+3]):i<=R[Z+2]&&l<=R[Z+3]&&h>=R[Z+0]&&p>=R[Z+1])?(w[G]=!0,x.push(z[G])):w[G]=!1}}}}_forEachCell(i,l,h,p,y,x,w,S){let A=this._convertToCellCoord(i),z=this._convertToCellCoord(l),R=this._convertToCellCoord(h),N=this._convertToCellCoord(p);for(let G=A;G<=R;G++)for(let Z=z;Z<=N;Z++){let se=this.d*Z+G;if((!S||S(this._convertFromCellCoord(G),this._convertFromCellCoord(Z),this._convertFromCellCoord(G+1),this._convertFromCellCoord(Z+1)))&&y.call(this,i,l,h,p,se,x,w,S))return}}_convertFromCellCoord(i){return(i-this.padding)/this.scale}_convertToCellCoord(i){return Math.max(0,Math.min(this.d-1,Math.floor(i*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let i=this.cells,l=3+this.cells.length+1+1,h=0;for(let x=0;x<this.cells.length;x++)h+=this.cells[x].length;let p=new Int32Array(l+h+this.keys.length+this.bboxes.length);p[0]=this.extent,p[1]=this.n,p[2]=this.padding;let y=l;for(let x=0;x<i.length;x++){let w=i[x];p[3+x]=y,p.set(w,y),y+=w.length}return p[3+i.length]=y,p.set(this.keys,y),y+=this.keys.length,p[3+i.length+1]=y,p.set(this.bboxes,y),y+=this.bboxes.length,p.buffer}static serialize(i,l){let h=i.toArrayBuffer();return l&&l.push(h),{buffer:h}}static deserialize(i){return new Ss(i.buffer)}}let ya={};function dt(s,i,l={}){Object.defineProperty(i,"_classRegistryKey",{value:s,writeable:!1}),ya[s]={klass:i,omit:l.omit||[],shallow:l.shallow||[]}}dt("Object",Object),dt("TransferableGridIndex",Ss),dt("Color",L),dt("Error",Error),dt("AJAXError",ri),dt("ResolvedImage",pe),dt("StylePropertyFunction",da),dt("StyleExpression",dh,{omit:["_evaluator"]}),dt("ZoomDependentExpression",gu),dt("ZoomConstantExpression",mu),dt("CompoundExpression",Dt,{omit:["_evaluate"]});for(let s in ca)ca[s]._classRegistryKey||dt(`Expression_${s}`,ca[s]);function yh(s){return s&&typeof ArrayBuffer<"u"&&(s instanceof ArrayBuffer||s.constructor&&s.constructor.name==="ArrayBuffer")}function fl(s,i){if(s==null||typeof s=="boolean"||typeof s=="number"||typeof s=="string"||s instanceof Boolean||s instanceof Number||s instanceof String||s instanceof Date||s instanceof RegExp||s instanceof Blob)return s;if(yh(s)||Gt(s))return i&&i.push(s),s;if(ArrayBuffer.isView(s)){let l=s;return i&&i.push(l.buffer),l}if(s instanceof ImageData)return i&&i.push(s.data.buffer),s;if(Array.isArray(s)){let l=[];for(let h of s)l.push(fl(h,i));return l}if(typeof s=="object"){let l=s.constructor,h=l._classRegistryKey;if(!h)throw new Error("can't serialize object of unregistered class");let p=l.serialize?l.serialize(s,i):{};if(!l.serialize){for(let y in s){if(!s.hasOwnProperty(y)||ya[h].omit.indexOf(y)>=0)continue;let x=s[y];p[y]=ya[h].shallow.indexOf(y)>=0?x:fl(x,i)}s instanceof Error&&(p.message=s.message)}if(p.$name)throw new Error("$name property is reserved for worker serialization logic.");return h!=="Object"&&(p.$name=h),p}throw new Error("can't serialize object of type "+typeof s)}function Cs(s){if(s==null||typeof s=="boolean"||typeof s=="number"||typeof s=="string"||s instanceof Boolean||s instanceof Number||s instanceof String||s instanceof Date||s instanceof RegExp||s instanceof Blob||yh(s)||Gt(s)||ArrayBuffer.isView(s)||s instanceof ImageData)return s;if(Array.isArray(s))return s.map(Cs);if(typeof s=="object"){let i=s.$name||"Object";if(!ya[i])throw new Error(`can't deserialize unregistered class ${i}`);let{klass:l}=ya[i];if(!l)throw new Error(`can't deserialize unregistered class ${i}`);if(l.deserialize)return l.deserialize(s);let h=Object.create(l.prototype);for(let p of Object.keys(s)){if(p==="$name")continue;let y=s[p];h[p]=ya[i].shallow.indexOf(p)>=0?y:Cs(y)}return h}throw new Error("can't deserialize object of type "+typeof s)}class ml{constructor(){this.first=!0}update(i,l){let h=Math.floor(i);return this.first?(this.first=!1,this.lastIntegerZoom=h,this.lastIntegerZoomTime=0,this.lastZoom=i,this.lastFloorZoom=h,!0):(this.lastFloorZoom>h?(this.lastIntegerZoom=h+1,this.lastIntegerZoomTime=l):this.lastFloorZoom<h&&(this.lastIntegerZoom=h,this.lastIntegerZoomTime=l),i!==this.lastZoom&&(this.lastZoom=i,this.lastFloorZoom=h,!0))}}let it={"Latin-1 Supplement":s=>s>=128&&s<=255,Arabic:s=>s>=1536&&s<=1791,"Arabic Supplement":s=>s>=1872&&s<=1919,"Arabic Extended-A":s=>s>=2208&&s<=2303,"Hangul Jamo":s=>s>=4352&&s<=4607,"Unified Canadian Aboriginal Syllabics":s=>s>=5120&&s<=5759,Khmer:s=>s>=6016&&s<=6143,"Unified Canadian Aboriginal Syllabics Extended":s=>s>=6320&&s<=6399,"General Punctuation":s=>s>=8192&&s<=8303,"Letterlike Symbols":s=>s>=8448&&s<=8527,"Number Forms":s=>s>=8528&&s<=8591,"Miscellaneous Technical":s=>s>=8960&&s<=9215,"Control Pictures":s=>s>=9216&&s<=9279,"Optical Character Recognition":s=>s>=9280&&s<=9311,"Enclosed Alphanumerics":s=>s>=9312&&s<=9471,"Geometric Shapes":s=>s>=9632&&s<=9727,"Miscellaneous Symbols":s=>s>=9728&&s<=9983,"Miscellaneous Symbols and Arrows":s=>s>=11008&&s<=11263,"CJK Radicals Supplement":s=>s>=11904&&s<=12031,"Kangxi Radicals":s=>s>=12032&&s<=12255,"Ideographic Description Characters":s=>s>=12272&&s<=12287,"CJK Symbols and Punctuation":s=>s>=12288&&s<=12351,Hiragana:s=>s>=12352&&s<=12447,Katakana:s=>s>=12448&&s<=12543,Bopomofo:s=>s>=12544&&s<=12591,"Hangul Compatibility Jamo":s=>s>=12592&&s<=12687,Kanbun:s=>s>=12688&&s<=12703,"Bopomofo Extended":s=>s>=12704&&s<=12735,"CJK Strokes":s=>s>=12736&&s<=12783,"Katakana Phonetic Extensions":s=>s>=12784&&s<=12799,"Enclosed CJK Letters and Months":s=>s>=12800&&s<=13055,"CJK Compatibility":s=>s>=13056&&s<=13311,"CJK Unified Ideographs Extension A":s=>s>=13312&&s<=19903,"Yijing Hexagram Symbols":s=>s>=19904&&s<=19967,"CJK Unified Ideographs":s=>s>=19968&&s<=40959,"Yi Syllables":s=>s>=40960&&s<=42127,"Yi Radicals":s=>s>=42128&&s<=42191,"Hangul Jamo Extended-A":s=>s>=43360&&s<=43391,"Hangul Syllables":s=>s>=44032&&s<=55215,"Hangul Jamo Extended-B":s=>s>=55216&&s<=55295,"Private Use Area":s=>s>=57344&&s<=63743,"CJK Compatibility Ideographs":s=>s>=63744&&s<=64255,"Arabic Presentation Forms-A":s=>s>=64336&&s<=65023,"Vertical Forms":s=>s>=65040&&s<=65055,"CJK Compatibility Forms":s=>s>=65072&&s<=65103,"Small Form Variants":s=>s>=65104&&s<=65135,"Arabic Presentation Forms-B":s=>s>=65136&&s<=65279,"Halfwidth and Fullwidth Forms":s=>s>=65280&&s<=65519};function vh(s){for(let i of s)if(gl(i.charCodeAt(0)))return!0;return!1}function Rp(s){for(let i of s)if(!o0(i.charCodeAt(0)))return!1;return!0}function o0(s){return!(it.Arabic(s)||it["Arabic Supplement"](s)||it["Arabic Extended-A"](s)||it["Arabic Presentation Forms-A"](s)||it["Arabic Presentation Forms-B"](s))}function gl(s){return!(s!==746&&s!==747&&(s<4352||!(it["Bopomofo Extended"](s)||it.Bopomofo(s)||it["CJK Compatibility Forms"](s)&&!(s>=65097&&s<=65103)||it["CJK Compatibility Ideographs"](s)||it["CJK Compatibility"](s)||it["CJK Radicals Supplement"](s)||it["CJK Strokes"](s)||!(!it["CJK Symbols and Punctuation"](s)||s>=12296&&s<=12305||s>=12308&&s<=12319||s===12336)||it["CJK Unified Ideographs Extension A"](s)||it["CJK Unified Ideographs"](s)||it["Enclosed CJK Letters and Months"](s)||it["Hangul Compatibility Jamo"](s)||it["Hangul Jamo Extended-A"](s)||it["Hangul Jamo Extended-B"](s)||it["Hangul Jamo"](s)||it["Hangul Syllables"](s)||it.Hiragana(s)||it["Ideographic Description Characters"](s)||it.Kanbun(s)||it["Kangxi Radicals"](s)||it["Katakana Phonetic Extensions"](s)||it.Katakana(s)&&s!==12540||!(!it["Halfwidth and Fullwidth Forms"](s)||s===65288||s===65289||s===65293||s>=65306&&s<=65310||s===65339||s===65341||s===65343||s>=65371&&s<=65503||s===65507||s>=65512&&s<=65519)||!(!it["Small Form Variants"](s)||s>=65112&&s<=65118||s>=65123&&s<=65126)||it["Unified Canadian Aboriginal Syllabics"](s)||it["Unified Canadian Aboriginal Syllabics Extended"](s)||it["Vertical Forms"](s)||it["Yijing Hexagram Symbols"](s)||it["Yi Syllables"](s)||it["Yi Radicals"](s))))}function Dp(s){return!(gl(s)||function(i){return!!(it["Latin-1 Supplement"](i)&&(i===167||i===169||i===174||i===177||i===188||i===189||i===190||i===215||i===247)||it["General Punctuation"](i)&&(i===8214||i===8224||i===8225||i===8240||i===8241||i===8251||i===8252||i===8258||i===8263||i===8264||i===8265||i===8273)||it["Letterlike Symbols"](i)||it["Number Forms"](i)||it["Miscellaneous Technical"](i)&&(i>=8960&&i<=8967||i>=8972&&i<=8991||i>=8996&&i<=9e3||i===9003||i>=9085&&i<=9114||i>=9150&&i<=9165||i===9167||i>=9169&&i<=9179||i>=9186&&i<=9215)||it["Control Pictures"](i)&&i!==9251||it["Optical Character Recognition"](i)||it["Enclosed Alphanumerics"](i)||it["Geometric Shapes"](i)||it["Miscellaneous Symbols"](i)&&!(i>=9754&&i<=9759)||it["Miscellaneous Symbols and Arrows"](i)&&(i>=11026&&i<=11055||i>=11088&&i<=11097||i>=11192&&i<=11243)||it["CJK Symbols and Punctuation"](i)||it.Katakana(i)||it["Private Use Area"](i)||it["CJK Compatibility Forms"](i)||it["Small Form Variants"](i)||it["Halfwidth and Fullwidth Forms"](i)||i===8734||i===8756||i===8757||i>=9984&&i<=10087||i>=10102&&i<=10131||i===65532||i===65533)}(s))}function Bp(s){return s>=1424&&s<=2303||it["Arabic Presentation Forms-A"](s)||it["Arabic Presentation Forms-B"](s)}function s0(s,i){return!(!i&&Bp(s)||s>=2304&&s<=3583||s>=3840&&s<=4255||it.Khmer(s))}function a0(s){for(let i of s)if(Bp(i.charCodeAt(0)))return!0;return!1}let Iu="deferred",xh="loading",_h="loaded",bh=null,pn="unavailable",ts=null,Np=function(s){s&&typeof s=="string"&&s.indexOf("NetworkError")>-1&&(pn="error"),bh&&bh(s)};function wh(){va.fire(new Se("pluginStateChange",{pluginStatus:pn,pluginURL:ts}))}let va=new He,Ih=function(){return pn},Su=function(){if(pn!==Iu||!ts)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");pn=xh,wh(),ts&&Lr({url:ts},s=>{s?Np(s):(pn=_h,wh())})},Zn={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>pn===_h||Zn.applyArabicShaping!=null,isLoading:()=>pn===xh,setState(s){pn=s.pluginStatus,ts=s.pluginURL},isParsed:()=>Zn.applyArabicShaping!=null&&Zn.processBidirectionalText!=null&&Zn.processStyledBidirectionalText!=null,getPluginURL:()=>ts};class Ui{constructor(i,l){this.zoom=i,l?(this.now=l.now,this.fadeDuration=l.fadeDuration,this.zoomHistory=l.zoomHistory,this.transition=l.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new ml,this.transition={})}isSupportedScript(i){return function(l,h){for(let p of l)if(!s0(p.charCodeAt(0),h))return!1;return!0}(i,Zn.isLoaded())}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let i=this.zoom,l=i-Math.floor(i),h=this.crossFadingFactor();return i>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:l+(1-l)*h}:{fromScale:.5,toScale:1,t:1-(1-h)*l}}}class Cu{constructor(i,l){this.property=i,this.value=l,this.expression=function(h,p){if(cu(h))return new da(h,p);if(pu(h)){let y=ph(h,p);if(y.result==="error")throw new Error(y.value.map(x=>`${x.key}: ${x.message}`).join(", "));return y.value}{let y=h;return typeof h=="string"&&p.type==="color"&&(y=L.parse(h)),{kind:"constant",evaluate:()=>y}}}(l===void 0?i.specification.default:l,i.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(i,l,h){return this.property.possiblyEvaluate(this,i,l,h)}}class Mu{constructor(i){this.property=i,this.value=new Cu(i,void 0)}transitioned(i,l){return new Fp(this.property,this.value,l,W({},i.transition,this.transition),i.now)}untransitioned(){return new Fp(this.property,this.value,null,{},0)}}class Sh{constructor(i){this._properties=i,this._values=Object.create(i.defaultTransitionablePropertyValues)}getValue(i){return H(this._values[i].value.value)}setValue(i,l){Object.prototype.hasOwnProperty.call(this._values,i)||(this._values[i]=new Mu(this._values[i].property)),this._values[i].value=new Cu(this._values[i].property,l===null?void 0:H(l))}getTransition(i){return H(this._values[i].transition)}setTransition(i,l){Object.prototype.hasOwnProperty.call(this._values,i)||(this._values[i]=new Mu(this._values[i].property)),this._values[i].transition=H(l)||void 0}serialize(){let i={};for(let l of Object.keys(this._values)){let h=this.getValue(l);h!==void 0&&(i[l]=h);let p=this.getTransition(l);p!==void 0&&(i[`${l}-transition`]=p)}return i}transitioned(i,l){let h=new Op(this._properties);for(let p of Object.keys(this._values))h._values[p]=this._values[p].transitioned(i,l._values[p]);return h}untransitioned(){let i=new Op(this._properties);for(let l of Object.keys(this._values))i._values[l]=this._values[l].untransitioned();return i}}class Fp{constructor(i,l,h,p,y){this.property=i,this.value=l,this.begin=y+p.delay||0,this.end=this.begin+p.duration||0,i.specification.transition&&(p.delay||p.duration)&&(this.prior=h)}possiblyEvaluate(i,l,h){let p=i.now||0,y=this.value.possiblyEvaluate(i,l,h),x=this.prior;if(x){if(p>this.end)return this.prior=null,y;if(this.value.isDataDriven())return this.prior=null,y;if(p<this.begin)return x.possiblyEvaluate(i,l,h);{let w=(p-this.begin)/(this.end-this.begin);return this.property.interpolate(x.possiblyEvaluate(i,l,h),y,function(S){if(S<=0)return 0;if(S>=1)return 1;let A=S*S,z=A*S;return 4*(S<.5?z:3*(S-A)+z-.75)}(w))}}return y}}class Op{constructor(i){this._properties=i,this._values=Object.create(i.defaultTransitioningPropertyValues)}possiblyEvaluate(i,l,h){let p=new Eu(this._properties);for(let y of Object.keys(this._values))p._values[y]=this._values[y].possiblyEvaluate(i,l,h);return p}hasTransition(){for(let i of Object.keys(this._values))if(this._values[i].prior)return!0;return!1}}class l0{constructor(i){this._properties=i,this._values=Object.create(i.defaultPropertyValues)}getValue(i){return H(this._values[i].value)}setValue(i,l){this._values[i]=new Cu(this._values[i].property,l===null?void 0:H(l))}serialize(){let i={};for(let l of Object.keys(this._values)){let h=this.getValue(l);h!==void 0&&(i[l]=h)}return i}possiblyEvaluate(i,l,h){let p=new Eu(this._properties);for(let y of Object.keys(this._values))p._values[y]=this._values[y].possiblyEvaluate(i,l,h);return p}}class _o{constructor(i,l,h){this.property=i,this.value=l,this.parameters=h}isConstant(){return this.value.kind==="constant"}constantOr(i){return this.value.kind==="constant"?this.value.value:i}evaluate(i,l,h,p){return this.property.evaluate(this.value,this.parameters,i,l,h,p)}}class Eu{constructor(i){this._properties=i,this._values=Object.create(i.defaultPossiblyEvaluatedValues)}get(i){return this._values[i]}}class vt{constructor(i){this.specification=i}possiblyEvaluate(i,l){return i.expression.evaluate(l)}interpolate(i,l,h){let p=sl[this.specification.type];return p?p(i,l,h):i}}class Mt{constructor(i,l){this.specification=i,this.overrides=l}possiblyEvaluate(i,l,h,p){return new _o(this,i.expression.kind==="constant"||i.expression.kind==="camera"?{kind:"constant",value:i.expression.evaluate(l,null,{},h,p)}:i.expression,l)}interpolate(i,l,h){if(i.value.kind!=="constant"||l.value.kind!=="constant")return i;if(i.value.value===void 0||l.value.value===void 0)return new _o(this,{kind:"constant",value:void 0},i.parameters);let p=sl[this.specification.type];return p?new _o(this,{kind:"constant",value:p(i.value.value,l.value.value,h)},i.parameters):i}evaluate(i,l,h,p,y,x){return i.kind==="constant"?i.value:i.evaluate(l,h,p,y,x)}}class yl extends Mt{possiblyEvaluate(i,l,h,p){if(i.value===void 0)return new _o(this,{kind:"constant",value:void 0},l);if(i.expression.kind==="constant"){let y=i.expression.evaluate(l,null,{},h,p),x=i.property.specification.type==="resolvedImage"&&typeof y!="string"?y.name:y,w=this._calculate(x,x,x,l);return new _o(this,{kind:"constant",value:w},l)}if(i.expression.kind==="camera"){let y=this._calculate(i.expression.evaluate({zoom:l.zoom-1}),i.expression.evaluate({zoom:l.zoom}),i.expression.evaluate({zoom:l.zoom+1}),l);return new _o(this,{kind:"constant",value:y},l)}return new _o(this,i.expression,l)}evaluate(i,l,h,p,y,x){if(i.kind==="source"){let w=i.evaluate(l,h,p,y,x);return this._calculate(w,w,w,l)}return i.kind==="composite"?this._calculate(i.evaluate({zoom:Math.floor(l.zoom)-1},h,p),i.evaluate({zoom:Math.floor(l.zoom)},h,p),i.evaluate({zoom:Math.floor(l.zoom)+1},h,p),l):i.value}_calculate(i,l,h,p){return p.zoom>p.zoomHistory.lastIntegerZoom?{from:i,to:l}:{from:h,to:l}}interpolate(i){return i}}class vl{constructor(i){this.specification=i}possiblyEvaluate(i,l,h,p){if(i.value!==void 0){if(i.expression.kind==="constant"){let y=i.expression.evaluate(l,null,{},h,p);return this._calculate(y,y,y,l)}return this._calculate(i.expression.evaluate(new Ui(Math.floor(l.zoom-1),l)),i.expression.evaluate(new Ui(Math.floor(l.zoom),l)),i.expression.evaluate(new Ui(Math.floor(l.zoom+1),l)),l)}}_calculate(i,l,h,p){return p.zoom>p.zoomHistory.lastIntegerZoom?{from:i,to:l}:{from:h,to:l}}interpolate(i){return i}}class Ch{constructor(i){this.specification=i}possiblyEvaluate(i,l,h,p){return!!i.expression.evaluate(l,null,{},h,p)}interpolate(){return!1}}class Tr{constructor(i){this.properties=i,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let l in i){let h=i[l];h.specification.overridable&&this.overridableProperties.push(l);let p=this.defaultPropertyValues[l]=new Cu(h,void 0),y=this.defaultTransitionablePropertyValues[l]=new Mu(h);this.defaultTransitioningPropertyValues[l]=y.untransitioned(),this.defaultPossiblyEvaluatedValues[l]=p.possiblyEvaluate({})}}}dt("DataDrivenProperty",Mt),dt("DataConstantProperty",vt),dt("CrossFadedDataDrivenProperty",yl),dt("CrossFadedProperty",vl),dt("ColorRampProperty",Ch);let Ms="-transition";class fn extends He{constructor(i,l){if(super(),this.id=i.id,this.type=i.type,this._featureFilter={filter:()=>!0,needGeometry:!1},i.type!=="custom"&&(this.metadata=(i=i).metadata,this.minzoom=i.minzoom,this.maxzoom=i.maxzoom,i.type!=="background"&&(this.source=i.source,this.sourceLayer=i["source-layer"],this.filter=i.filter),l.layout&&(this._unevaluatedLayout=new l0(l.layout)),l.paint)){this._transitionablePaint=new Sh(l.paint);for(let h in i.paint)this.setPaintProperty(h,i.paint[h],{validate:!1});for(let h in i.layout)this.setLayoutProperty(h,i.layout[h],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Eu(l.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(i){return i==="visibility"?this.visibility:this._unevaluatedLayout.getValue(i)}setLayoutProperty(i,l,h={}){l!=null&&this._validate(n0,`layers.${this.id}.layout.${i}`,i,l,h)||(i!=="visibility"?this._unevaluatedLayout.setValue(i,l):this.visibility=l)}getPaintProperty(i){return i.endsWith(Ms)?this._transitionablePaint.getTransition(i.slice(0,-Ms.length)):this._transitionablePaint.getValue(i)}setPaintProperty(i,l,h={}){if(l!=null&&this._validate(gh,`layers.${this.id}.paint.${i}`,i,l,h))return!1;if(i.endsWith(Ms))return this._transitionablePaint.setTransition(i.slice(0,-Ms.length),l||void 0),!1;{let p=this._transitionablePaint._values[i],y=p.property.specification["property-type"]==="cross-faded-data-driven",x=p.value.isDataDriven(),w=p.value;this._transitionablePaint.setValue(i,l),this._handleSpecialPaintPropertyUpdate(i);let S=this._transitionablePaint._values[i].value;return S.isDataDriven()||x||y||this._handleOverridablePaintPropertyUpdate(i,w,S)}}_handleSpecialPaintPropertyUpdate(i){}_handleOverridablePaintPropertyUpdate(i,l,h){return!1}isHidden(i){return!!(this.minzoom&&i<this.minzoom)||!!(this.maxzoom&&i>=this.maxzoom)||this.visibility==="none"}updateTransitions(i){this._transitioningPaint=this._transitionablePaint.transitioned(i,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(i,l){i.getCrossfadeParameters&&(this._crossfadeParameters=i.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(i,void 0,l)),this.paint=this._transitioningPaint.possiblyEvaluate(i,void 0,l)}serialize(){let i={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&&(i.layout=i.layout||{},i.layout.visibility=this.visibility),de(i,(l,h)=>!(l===void 0||h==="layout"&&!Object.keys(l).length||h==="paint"&&!Object.keys(l).length))}_validate(i,l,h,p,y={}){return(!y||y.validate!==!1)&&Lp(this,i.call(Is,{key:l,layerType:this.type,objectKey:h,value:p,styleSpec:ye,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let i in this.paint._values){let l=this.paint.get(i);if(l instanceof _o&&ha(l.property.specification)&&(l.value.kind==="source"||l.value.kind==="composite")&&l.value.isStateDependent)return!0}return!1}}let u0={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class xl{constructor(i,l){this._structArray=i,this._pos1=l*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Oi{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(i,l){return i._trim(),l&&(i.isTransferred=!0,l.push(i.arrayBuffer)),{length:i.length,arrayBuffer:i.arrayBuffer}}static deserialize(i){let l=Object.create(this.prototype);return l.arrayBuffer=i.arrayBuffer,l.length=i.length,l.capacity=i.arrayBuffer.byteLength/l.bytesPerElement,l._refreshViews(),l}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(i){this.reserve(i),this.length=i}reserve(i){if(i>this.capacity){this.capacity=Math.max(i,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let l=this.uint8;this._refreshViews(),l&&this.uint8.set(l)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function Ar(s,i=1){let l=0,h=0;return{members:s.map(p=>{let y=u0[p.type].BYTES_PER_ELEMENT,x=l=Gp(l,Math.max(i,y)),w=p.components||1;return h=Math.max(h,y),l+=y*w,{name:p.name,type:p.type,components:w,offset:x}}),size:Gp(l,Math.max(h,i)),alignment:i}}function Gp(s,i){return Math.ceil(s/i)*i}class xa extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(i,l){let h=this.length;return this.resize(h+1),this.emplace(h,i,l)}emplace(i,l,h){let p=2*i;return this.int16[p+0]=l,this.int16[p+1]=h,i}}xa.prototype.bytesPerElement=4,dt("StructArrayLayout2i4",xa);class _l extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(i,l,h,p){let y=this.length;return this.resize(y+1),this.emplace(y,i,l,h,p)}emplace(i,l,h,p,y){let x=4*i;return this.int16[x+0]=l,this.int16[x+1]=h,this.int16[x+2]=p,this.int16[x+3]=y,i}}_l.prototype.bytesPerElement=8,dt("StructArrayLayout4i8",_l);class f extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(i,l,h,p,y,x){let w=this.length;return this.resize(w+1),this.emplace(w,i,l,h,p,y,x)}emplace(i,l,h,p,y,x,w){let S=6*i;return this.int16[S+0]=l,this.int16[S+1]=h,this.int16[S+2]=p,this.int16[S+3]=y,this.int16[S+4]=x,this.int16[S+5]=w,i}}f.prototype.bytesPerElement=12,dt("StructArrayLayout2i4i12",f);class n extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(i,l,h,p,y,x){let w=this.length;return this.resize(w+1),this.emplace(w,i,l,h,p,y,x)}emplace(i,l,h,p,y,x,w){let S=4*i,A=8*i;return this.int16[S+0]=l,this.int16[S+1]=h,this.uint8[A+4]=p,this.uint8[A+5]=y,this.uint8[A+6]=x,this.uint8[A+7]=w,i}}n.prototype.bytesPerElement=8,dt("StructArrayLayout2i4ub8",n);class c extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(i,l){let h=this.length;return this.resize(h+1),this.emplace(h,i,l)}emplace(i,l,h){let p=2*i;return this.float32[p+0]=l,this.float32[p+1]=h,i}}c.prototype.bytesPerElement=8,dt("StructArrayLayout2f8",c);class d extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(i,l,h,p,y,x,w,S,A,z){let R=this.length;return this.resize(R+1),this.emplace(R,i,l,h,p,y,x,w,S,A,z)}emplace(i,l,h,p,y,x,w,S,A,z,R){let N=10*i;return this.uint16[N+0]=l,this.uint16[N+1]=h,this.uint16[N+2]=p,this.uint16[N+3]=y,this.uint16[N+4]=x,this.uint16[N+5]=w,this.uint16[N+6]=S,this.uint16[N+7]=A,this.uint16[N+8]=z,this.uint16[N+9]=R,i}}d.prototype.bytesPerElement=20,dt("StructArrayLayout10ui20",d);class g extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(i,l,h,p,y,x,w,S,A,z,R,N){let G=this.length;return this.resize(G+1),this.emplace(G,i,l,h,p,y,x,w,S,A,z,R,N)}emplace(i,l,h,p,y,x,w,S,A,z,R,N,G){let Z=12*i;return this.int16[Z+0]=l,this.int16[Z+1]=h,this.int16[Z+2]=p,this.int16[Z+3]=y,this.uint16[Z+4]=x,this.uint16[Z+5]=w,this.uint16[Z+6]=S,this.uint16[Z+7]=A,this.int16[Z+8]=z,this.int16[Z+9]=R,this.int16[Z+10]=N,this.int16[Z+11]=G,i}}g.prototype.bytesPerElement=24,dt("StructArrayLayout4i4ui4i24",g);class _ extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(i,l,h){let p=this.length;return this.resize(p+1),this.emplace(p,i,l,h)}emplace(i,l,h,p){let y=3*i;return this.float32[y+0]=l,this.float32[y+1]=h,this.float32[y+2]=p,i}}_.prototype.bytesPerElement=12,dt("StructArrayLayout3f12",_);class I extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(i){let l=this.length;return this.resize(l+1),this.emplace(l,i)}emplace(i,l){return this.uint32[1*i+0]=l,i}}I.prototype.bytesPerElement=4,dt("StructArrayLayout1ul4",I);class M extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(i,l,h,p,y,x,w,S,A){let z=this.length;return this.resize(z+1),this.emplace(z,i,l,h,p,y,x,w,S,A)}emplace(i,l,h,p,y,x,w,S,A,z){let R=10*i,N=5*i;return this.int16[R+0]=l,this.int16[R+1]=h,this.int16[R+2]=p,this.int16[R+3]=y,this.int16[R+4]=x,this.int16[R+5]=w,this.uint32[N+3]=S,this.uint16[R+8]=A,this.uint16[R+9]=z,i}}M.prototype.bytesPerElement=20,dt("StructArrayLayout6i1ul2ui20",M);class E extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(i,l,h,p,y,x){let w=this.length;return this.resize(w+1),this.emplace(w,i,l,h,p,y,x)}emplace(i,l,h,p,y,x,w){let S=6*i;return this.int16[S+0]=l,this.int16[S+1]=h,this.int16[S+2]=p,this.int16[S+3]=y,this.int16[S+4]=x,this.int16[S+5]=w,i}}E.prototype.bytesPerElement=12,dt("StructArrayLayout2i2i2i12",E);class k extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(i,l,h,p,y){let x=this.length;return this.resize(x+1),this.emplace(x,i,l,h,p,y)}emplace(i,l,h,p,y,x){let w=4*i,S=8*i;return this.float32[w+0]=l,this.float32[w+1]=h,this.float32[w+2]=p,this.int16[S+6]=y,this.int16[S+7]=x,i}}k.prototype.bytesPerElement=16,dt("StructArrayLayout2f1f2i16",k);class D extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(i,l,h,p){let y=this.length;return this.resize(y+1),this.emplace(y,i,l,h,p)}emplace(i,l,h,p,y){let x=12*i,w=3*i;return this.uint8[x+0]=l,this.uint8[x+1]=h,this.float32[w+1]=p,this.float32[w+2]=y,i}}D.prototype.bytesPerElement=12,dt("StructArrayLayout2ub2f12",D);class O extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(i,l,h){let p=this.length;return this.resize(p+1),this.emplace(p,i,l,h)}emplace(i,l,h,p){let y=3*i;return this.uint16[y+0]=l,this.uint16[y+1]=h,this.uint16[y+2]=p,i}}O.prototype.bytesPerElement=6,dt("StructArrayLayout3ui6",O);class X extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(i,l,h,p,y,x,w,S,A,z,R,N,G,Z,se,ae,be){let Te=this.length;return this.resize(Te+1),this.emplace(Te,i,l,h,p,y,x,w,S,A,z,R,N,G,Z,se,ae,be)}emplace(i,l,h,p,y,x,w,S,A,z,R,N,G,Z,se,ae,be,Te){let Ee=24*i,Le=12*i,We=48*i;return this.int16[Ee+0]=l,this.int16[Ee+1]=h,this.uint16[Ee+2]=p,this.uint16[Ee+3]=y,this.uint32[Le+2]=x,this.uint32[Le+3]=w,this.uint32[Le+4]=S,this.uint16[Ee+10]=A,this.uint16[Ee+11]=z,this.uint16[Ee+12]=R,this.float32[Le+7]=N,this.float32[Le+8]=G,this.uint8[We+36]=Z,this.uint8[We+37]=se,this.uint8[We+38]=ae,this.uint32[Le+10]=be,this.int16[Ee+22]=Te,i}}X.prototype.bytesPerElement=48,dt("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",X);class oe extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(i,l,h,p,y,x,w,S,A,z,R,N,G,Z,se,ae,be,Te,Ee,Le,We,Oe,pt,bt,nt,ot,tt,ct){let st=this.length;return this.resize(st+1),this.emplace(st,i,l,h,p,y,x,w,S,A,z,R,N,G,Z,se,ae,be,Te,Ee,Le,We,Oe,pt,bt,nt,ot,tt,ct)}emplace(i,l,h,p,y,x,w,S,A,z,R,N,G,Z,se,ae,be,Te,Ee,Le,We,Oe,pt,bt,nt,ot,tt,ct,st){let Ye=34*i,Et=17*i;return this.int16[Ye+0]=l,this.int16[Ye+1]=h,this.int16[Ye+2]=p,this.int16[Ye+3]=y,this.int16[Ye+4]=x,this.int16[Ye+5]=w,this.int16[Ye+6]=S,this.int16[Ye+7]=A,this.uint16[Ye+8]=z,this.uint16[Ye+9]=R,this.uint16[Ye+10]=N,this.uint16[Ye+11]=G,this.uint16[Ye+12]=Z,this.uint16[Ye+13]=se,this.uint16[Ye+14]=ae,this.uint16[Ye+15]=be,this.uint16[Ye+16]=Te,this.uint16[Ye+17]=Ee,this.uint16[Ye+18]=Le,this.uint16[Ye+19]=We,this.uint16[Ye+20]=Oe,this.uint16[Ye+21]=pt,this.uint16[Ye+22]=bt,this.uint32[Et+12]=nt,this.float32[Et+13]=ot,this.float32[Et+14]=tt,this.float32[Et+15]=ct,this.float32[Et+16]=st,i}}oe.prototype.bytesPerElement=68,dt("StructArrayLayout8i15ui1ul4f68",oe);class $ extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(i){let l=this.length;return this.resize(l+1),this.emplace(l,i)}emplace(i,l){return this.float32[1*i+0]=l,i}}$.prototype.bytesPerElement=4,dt("StructArrayLayout1f4",$);class ne extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(i,l,h){let p=this.length;return this.resize(p+1),this.emplace(p,i,l,h)}emplace(i,l,h,p){let y=3*i;return this.int16[y+0]=l,this.int16[y+1]=h,this.int16[y+2]=p,i}}ne.prototype.bytesPerElement=6,dt("StructArrayLayout3i6",ne);class me extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(i,l,h){let p=this.length;return this.resize(p+1),this.emplace(p,i,l,h)}emplace(i,l,h,p){let y=4*i;return this.uint32[2*i+0]=l,this.uint16[y+2]=h,this.uint16[y+3]=p,i}}me.prototype.bytesPerElement=8,dt("StructArrayLayout1ul2ui8",me);class ge extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(i,l){let h=this.length;return this.resize(h+1),this.emplace(h,i,l)}emplace(i,l,h){let p=2*i;return this.uint16[p+0]=l,this.uint16[p+1]=h,i}}ge.prototype.bytesPerElement=4,dt("StructArrayLayout2ui4",ge);class we extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(i){let l=this.length;return this.resize(l+1),this.emplace(l,i)}emplace(i,l){return this.uint16[1*i+0]=l,i}}we.prototype.bytesPerElement=2,dt("StructArrayLayout1ui2",we);class xe extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(i,l,h,p){let y=this.length;return this.resize(y+1),this.emplace(y,i,l,h,p)}emplace(i,l,h,p,y){let x=4*i;return this.float32[x+0]=l,this.float32[x+1]=h,this.float32[x+2]=p,this.float32[x+3]=y,i}}xe.prototype.bytesPerElement=16,dt("StructArrayLayout4f16",xe);class Ne extends xl{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new at(this.anchorPointX,this.anchorPointY)}}Ne.prototype.size=20;class Pe extends M{get(i){return new Ne(this,i)}}dt("CollisionBoxArray",Pe);class ze extends xl{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(i){this._structArray.uint8[this._pos1+37]=i}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(i){this._structArray.uint8[this._pos1+38]=i}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(i){this._structArray.uint32[this._pos4+10]=i}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}ze.prototype.size=48;class je extends X{get(i){return new ze(this,i)}}dt("PlacedSymbolArray",je);class Ke extends xl{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(i){this._structArray.uint32[this._pos4+12]=i}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get textOffset0(){return this._structArray.float32[this._pos4+14]}get textOffset1(){return this._structArray.float32[this._pos4+15]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+16]}}Ke.prototype.size=68;class De extends oe{get(i){return new Ke(this,i)}}dt("SymbolInstanceArray",De);class mt extends ${getoffsetX(i){return this.float32[1*i+0]}}dt("GlyphOffsetArray",mt);class rt extends ne{getx(i){return this.int16[3*i+0]}gety(i){return this.int16[3*i+1]}gettileUnitDistanceFromAnchor(i){return this.int16[3*i+2]}}dt("SymbolLineVertexArray",rt);class Pt extends xl{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]}}Pt.prototype.size=8;class ei extends me{get(i){return new Pt(this,i)}}dt("FeatureIndexArray",ei);class Zt extends xa{}class Qt extends xa{}class Qi extends f{}class zt extends n{}class ai extends c{}class Si extends d{}class Or extends g{}class Tn extends _{}class jn extends I{}class Hn extends E{}class is extends D{}class mn extends O{}class bo extends ge{}let Es=Ar([{name:"a_pos",components:2,type:"Int16"}],4),{members:An}=Es;class li{constructor(i=[]){this.segments=i}prepareSegment(i,l,h,p){let y=this.segments[this.segments.length-1];return i>li.MAX_VERTEX_ARRAY_LENGTH&&te(`Max vertices per segment is ${li.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${i}`),(!y||y.vertexLength+i>li.MAX_VERTEX_ARRAY_LENGTH||y.sortKey!==p)&&(y={vertexOffset:l.length,primitiveOffset:h.length,vertexLength:0,primitiveLength:0},p!==void 0&&(y.sortKey=p),this.segments.push(y)),y}get(){return this.segments}destroy(){for(let i of this.segments)for(let l in i.vaos)i.vaos[l].destroy()}static simpleSegment(i,l,h,p){return new li([{vertexOffset:i,primitiveOffset:l,vertexLength:h,primitiveLength:p,vaos:{},sortKey:0}])}}function yi(s,i){return 256*(s=T(Math.floor(s),0,255))+T(Math.floor(i),0,255)}li.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,dt("SegmentVector",li);let xr=Ar([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var nn={exports:{}},Wi={exports:{}};Wi.exports=function(s,i){var l,h,p,y,x,w,S,A;for(h=s.length-(l=3&s.length),p=i,x=3432918353,w=461845907,A=0;A<h;)S=255&s.charCodeAt(A)|(255&s.charCodeAt(++A))<<8|(255&s.charCodeAt(++A))<<16|(255&s.charCodeAt(++A))<<24,++A,p=27492+(65535&(y=5*(65535&(p=(p^=S=(65535&(S=(S=(65535&S)*x+(((S>>>16)*x&65535)<<16)&4294967295)<<15|S>>>17))*w+(((S>>>16)*w&65535)<<16)&4294967295)<<13|p>>>19))+((5*(p>>>16)&65535)<<16)&4294967295))+((58964+(y>>>16)&65535)<<16);switch(S=0,l){case 3:S^=(255&s.charCodeAt(A+2))<<16;case 2:S^=(255&s.charCodeAt(A+1))<<8;case 1:p^=S=(65535&(S=(S=(65535&(S^=255&s.charCodeAt(A)))*x+(((S>>>16)*x&65535)<<16)&4294967295)<<15|S>>>17))*w+(((S>>>16)*w&65535)<<16)&4294967295}return p^=s.length,p=2246822507*(65535&(p^=p>>>16))+((2246822507*(p>>>16)&65535)<<16)&4294967295,p=3266489909*(65535&(p^=p>>>13))+((3266489909*(p>>>16)&65535)<<16)&4294967295,(p^=p>>>16)>>>0};var Ts={exports:{}};Ts.exports=function(s,i){for(var l,h=s.length,p=i^h,y=0;h>=4;)l=1540483477*(65535&(l=255&s.charCodeAt(y)|(255&s.charCodeAt(++y))<<8|(255&s.charCodeAt(++y))<<16|(255&s.charCodeAt(++y))<<24))+((1540483477*(l>>>16)&65535)<<16),p=1540483477*(65535&p)+((1540483477*(p>>>16)&65535)<<16)^(l=1540483477*(65535&(l^=l>>>24))+((1540483477*(l>>>16)&65535)<<16)),h-=4,++y;switch(h){case 3:p^=(255&s.charCodeAt(y+2))<<16;case 2:p^=(255&s.charCodeAt(y+1))<<8;case 1:p=1540483477*(65535&(p^=255&s.charCodeAt(y)))+((1540483477*(p>>>16)&65535)<<16)}return p=1540483477*(65535&(p^=p>>>13))+((1540483477*(p>>>16)&65535)<<16),(p^=p>>>15)>>>0};var wo=Wi.exports,Tu=Ts.exports;nn.exports=wo,nn.exports.murmur3=wo,nn.exports.murmur2=Tu;var Mh=nn.exports;class Au{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(i,l,h,p){this.ids.push(Vp(i)),this.positions.push(l,h,p)}getPositions(i){let l=Vp(i),h=0,p=this.ids.length-1;for(;h<p;){let x=h+p>>1;this.ids[x]>=l?p=x:h=x+1}let y=[];for(;this.ids[h]===l;)y.push({index:this.positions[3*h],start:this.positions[3*h+1],end:this.positions[3*h+2]}),h++;return y}static serialize(i,l){let h=new Float64Array(i.ids),p=new Uint32Array(i.positions);return As(h,p,0,h.length-1),l&&l.push(h.buffer,p.buffer),{ids:h,positions:p}}static deserialize(i){let l=new Au;return l.ids=i.ids,l.positions=i.positions,l.indexed=!0,l}}function Vp(s){let i=+s;return!isNaN(i)&&i<=Number.MAX_SAFE_INTEGER?i:Mh(String(s))}function As(s,i,l,h){for(;l<h;){let p=s[l+h>>1],y=l-1,x=h+1;for(;;){do y++;while(s[y]<p);do x--;while(s[x]>p);if(y>=x)break;Pu(s,y,x),Pu(i,3*y,3*x),Pu(i,3*y+1,3*x+1),Pu(i,3*y+2,3*x+2)}x-l<h-x?(As(s,i,l,x),l=x+1):(As(s,i,x+1,h),h=x)}}function Pu(s,i,l){let h=s[i];s[i]=s[l],s[l]=h}dt("FeaturePositionMap",Au);class Io{constructor(i,l){this.gl=i.gl,this.location=l}}class _a extends Io{constructor(i,l){super(i,l),this.current=0}set(i){this.current!==i&&(this.current=i,this.gl.uniform1f(this.location,i))}}class Wx extends Io{constructor(i,l){super(i,l),this.current=[0,0,0,0]}set(i){i[0]===this.current[0]&&i[1]===this.current[1]&&i[2]===this.current[2]&&i[3]===this.current[3]||(this.current=i,this.gl.uniform4f(this.location,i[0],i[1],i[2],i[3]))}}class Zx extends Io{constructor(i,l){super(i,l),this.current=L.transparent}set(i){i.r===this.current.r&&i.g===this.current.g&&i.b===this.current.b&&i.a===this.current.a||(this.current=i,this.gl.uniform4f(this.location,i.r,i.g,i.b,i.a))}}let WT=new Float32Array(16);function c0(s){return[yi(255*s.r,255*s.g),yi(255*s.b,255*s.a)]}class Eh{constructor(i,l,h){this.value=i,this.uniformNames=l.map(p=>`u_${p}`),this.type=h}setUniform(i,l,h){i.set(h.constantOr(this.value))}getBinding(i,l,h){return this.type==="color"?new Zx(i,l):new _a(i,l)}}class ku{constructor(i,l){this.uniformNames=l.map(h=>`u_${h}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(i,l){this.pixelRatioFrom=l.pixelRatio,this.pixelRatioTo=i.pixelRatio,this.patternFrom=l.tlbr,this.patternTo=i.tlbr}setUniform(i,l,h,p){let y=p==="u_pattern_to"?this.patternTo:p==="u_pattern_from"?this.patternFrom:p==="u_pixel_ratio_to"?this.pixelRatioTo:p==="u_pixel_ratio_from"?this.pixelRatioFrom:null;y&&i.set(y)}getBinding(i,l,h){return h.substr(0,9)==="u_pattern"?new Wx(i,l):new _a(i,l)}}class Ps{constructor(i,l,h,p){this.expression=i,this.type=h,this.maxValue=0,this.paintVertexAttributes=l.map(y=>({name:`a_${y}`,type:"Float32",components:h==="color"?2:1,offset:0})),this.paintVertexArray=new p}populatePaintArray(i,l,h,p,y){let x=this.paintVertexArray.length,w=this.expression.evaluate(new Ui(0),l,{},p,[],y);this.paintVertexArray.resize(i),this._setPaintValue(x,i,w)}updatePaintArray(i,l,h,p){let y=this.expression.evaluate({zoom:0},h,p);this._setPaintValue(i,l,y)}_setPaintValue(i,l,h){if(this.type==="color"){let p=c0(h);for(let y=i;y<l;y++)this.paintVertexArray.emplace(y,p[0],p[1])}else{for(let p=i;p<l;p++)this.paintVertexArray.emplace(p,h);this.maxValue=Math.max(this.maxValue,Math.abs(h))}}upload(i){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=i.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class Bo{constructor(i,l,h,p,y,x){this.expression=i,this.uniformNames=l.map(w=>`u_${w}_t`),this.type=h,this.useIntegerZoom=p,this.zoom=y,this.maxValue=0,this.paintVertexAttributes=l.map(w=>({name:`a_${w}`,type:"Float32",components:h==="color"?4:2,offset:0})),this.paintVertexArray=new x}populatePaintArray(i,l,h,p,y){let x=this.expression.evaluate(new Ui(this.zoom),l,{},p,[],y),w=this.expression.evaluate(new Ui(this.zoom+1),l,{},p,[],y),S=this.paintVertexArray.length;this.paintVertexArray.resize(i),this._setPaintValue(S,i,x,w)}updatePaintArray(i,l,h,p){let y=this.expression.evaluate({zoom:this.zoom},h,p),x=this.expression.evaluate({zoom:this.zoom+1},h,p);this._setPaintValue(i,l,y,x)}_setPaintValue(i,l,h,p){if(this.type==="color"){let y=c0(h),x=c0(p);for(let w=i;w<l;w++)this.paintVertexArray.emplace(w,y[0],y[1],x[0],x[1])}else{for(let y=i;y<l;y++)this.paintVertexArray.emplace(y,h,p);this.maxValue=Math.max(this.maxValue,Math.abs(h),Math.abs(p))}}upload(i){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=i.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(i,l){let h=this.useIntegerZoom?Math.floor(l.zoom):l.zoom,p=T(this.expression.interpolationFactor(h,this.zoom,this.zoom+1),0,1);i.set(p)}getBinding(i,l,h){return new _a(i,l)}}class ba{constructor(i,l,h,p,y,x){this.expression=i,this.type=l,this.useIntegerZoom=h,this.zoom=p,this.layerId=x,this.zoomInPaintVertexArray=new y,this.zoomOutPaintVertexArray=new y}populatePaintArray(i,l,h){let p=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(i),this.zoomOutPaintVertexArray.resize(i),this._setPaintValues(p,i,l.patterns&&l.patterns[this.layerId],h)}updatePaintArray(i,l,h,p,y){this._setPaintValues(i,l,h.patterns&&h.patterns[this.layerId],y)}_setPaintValues(i,l,h,p){if(!p||!h)return;let{min:y,mid:x,max:w}=h,S=p[y],A=p[x],z=p[w];if(S&&A&&z)for(let R=i;R<l;R++)this.zoomInPaintVertexArray.emplace(R,A.tl[0],A.tl[1],A.br[0],A.br[1],S.tl[0],S.tl[1],S.br[0],S.br[1],A.pixelRatio,S.pixelRatio),this.zoomOutPaintVertexArray.emplace(R,A.tl[0],A.tl[1],A.br[0],A.br[1],z.tl[0],z.tl[1],z.br[0],z.br[1],A.pixelRatio,z.pixelRatio)}upload(i){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=i.createVertexBuffer(this.zoomInPaintVertexArray,xr.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=i.createVertexBuffer(this.zoomOutPaintVertexArray,xr.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class jx{constructor(i,l,h){this.binders={},this._buffers=[];let p=[];for(let y in i.paint._values){if(!h(y))continue;let x=i.paint.get(y);if(!(x instanceof _o&&ha(x.property.specification)))continue;let w=ZT(y,i.type),S=x.value,A=x.property.specification.type,z=x.property.useIntegerZoom,R=x.property.specification["property-type"],N=R==="cross-faded"||R==="cross-faded-data-driven";if(S.kind==="constant")this.binders[y]=N?new ku(S.value,w):new Eh(S.value,w,A),p.push(`/u_${y}`);else if(S.kind==="source"||N){let G=Hx(y,A,"source");this.binders[y]=N?new ba(S,A,z,l,G,i.id):new Ps(S,w,A,G),p.push(`/a_${y}`)}else{let G=Hx(y,A,"composite");this.binders[y]=new Bo(S,w,A,z,l,G),p.push(`/z_${y}`)}}this.cacheKey=p.sort().join("")}getMaxValue(i){let l=this.binders[i];return l instanceof Ps||l instanceof Bo?l.maxValue:0}populatePaintArrays(i,l,h,p,y){for(let x in this.binders){let w=this.binders[x];(w instanceof Ps||w instanceof Bo||w instanceof ba)&&w.populatePaintArray(i,l,h,p,y)}}setConstantPatternPositions(i,l){for(let h in this.binders){let p=this.binders[h];p instanceof ku&&p.setConstantPatternPositions(i,l)}}updatePaintArrays(i,l,h,p,y){let x=!1;for(let w in i){let S=l.getPositions(w);for(let A of S){let z=h.feature(A.index);for(let R in this.binders){let N=this.binders[R];if((N instanceof Ps||N instanceof Bo||N instanceof ba)&&N.expression.isStateDependent===!0){let G=p.paint.get(R);N.expression=G.value,N.updatePaintArray(A.start,A.end,z,i[w],y),x=!0}}}}return x}defines(){let i=[];for(let l in this.binders){let h=this.binders[l];(h instanceof Eh||h instanceof ku)&&i.push(...h.uniformNames.map(p=>`#define HAS_UNIFORM_${p}`))}return i}getBinderAttributes(){let i=[];for(let l in this.binders){let h=this.binders[l];if(h instanceof Ps||h instanceof Bo)for(let p=0;p<h.paintVertexAttributes.length;p++)i.push(h.paintVertexAttributes[p].name);else if(h instanceof ba)for(let p=0;p<xr.members.length;p++)i.push(xr.members[p].name)}return i}getBinderUniforms(){let i=[];for(let l in this.binders){let h=this.binders[l];if(h instanceof Eh||h instanceof ku||h instanceof Bo)for(let p of h.uniformNames)i.push(p)}return i}getPaintVertexBuffers(){return this._buffers}getUniforms(i,l){let h=[];for(let p in this.binders){let y=this.binders[p];if(y instanceof Eh||y instanceof ku||y instanceof Bo){for(let x of y.uniformNames)if(l[x]){let w=y.getBinding(i,l[x],x);h.push({name:x,property:p,binding:w})}}}return h}setUniforms(i,l,h,p){for(let{name:y,property:x,binding:w}of l)this.binders[x].setUniform(w,p,h.get(x),y)}updatePaintBuffers(i){this._buffers=[];for(let l in this.binders){let h=this.binders[l];if(i&&h instanceof ba){let p=i.fromScale===2?h.zoomInPaintVertexBuffer:h.zoomOutPaintVertexBuffer;p&&this._buffers.push(p)}else(h instanceof Ps||h instanceof Bo)&&h.paintVertexBuffer&&this._buffers.push(h.paintVertexBuffer)}}upload(i){for(let l in this.binders){let h=this.binders[l];(h instanceof Ps||h instanceof Bo||h instanceof ba)&&h.upload(i)}this.updatePaintBuffers()}destroy(){for(let i in this.binders){let l=this.binders[i];(l instanceof Ps||l instanceof Bo||l instanceof ba)&&l.destroy()}}}class bl{constructor(i,l,h=()=>!0){this.programConfigurations={};for(let p of i)this.programConfigurations[p.id]=new jx(p,l,h);this.needsUpload=!1,this._featureMap=new Au,this._bufferOffset=0}populatePaintArrays(i,l,h,p,y,x){for(let w in this.programConfigurations)this.programConfigurations[w].populatePaintArrays(i,l,p,y,x);l.id!==void 0&&this._featureMap.add(l.id,h,this._bufferOffset,i),this._bufferOffset=i,this.needsUpload=!0}updatePaintArrays(i,l,h,p){for(let y of h)this.needsUpload=this.programConfigurations[y.id].updatePaintArrays(i,this._featureMap,l,y,p)||this.needsUpload}get(i){return this.programConfigurations[i]}upload(i){if(this.needsUpload){for(let l in this.programConfigurations)this.programConfigurations[l].upload(i);this.needsUpload=!1}}destroy(){for(let i in this.programConfigurations)this.programConfigurations[i].destroy()}}function ZT(s,i){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[s]||[s.replace(`${i}-`,"").replace(/-/g,"_")]}function Hx(s,i,l){let h={color:{source:c,composite:xe},number:{source:$,composite:c}},p=function(y){return{"line-pattern":{source:Si,composite:Si},"fill-pattern":{source:Si,composite:Si},"fill-extrusion-pattern":{source:Si,composite:Si}}[y]}(s);return p&&p[l]||h[i][l]}dt("ConstantBinder",Eh),dt("CrossFadedConstantBinder",ku),dt("SourceExpressionBinder",Ps),dt("CrossFadedCompositeBinder",ba),dt("CompositeExpressionBinder",Bo),dt("ProgramConfiguration",jx,{omit:["_buffers"]}),dt("ProgramConfigurationSet",bl);var Pr=8192;let h0=Math.pow(2,14)-1,Xx=-h0-1;function wl(s){let i=Pr/s.extent,l=s.loadGeometry();for(let h=0;h<l.length;h++){let p=l[h];for(let y=0;y<p.length;y++){let x=p[y],w=Math.round(x.x*i),S=Math.round(x.y*i);x.x=T(w,Xx,h0),x.y=T(S,Xx,h0),(w<x.x||w>x.x+1||S<x.y||S>x.y+1)&&te("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return l}function Il(s,i){return{type:s.type,id:s.id,properties:s.properties,geometry:i?wl(s):[]}}function Up(s,i,l,h,p){s.emplaceBack(2*i+(h+1)/2,2*l+(p+1)/2)}class d0{constructor(i){this.zoom=i.zoom,this.overscaling=i.overscaling,this.layers=i.layers,this.layerIds=this.layers.map(l=>l.id),this.index=i.index,this.hasPattern=!1,this.layoutVertexArray=new Zt,this.indexArray=new mn,this.segments=new li,this.programConfigurations=new bl(i.layers,i.zoom),this.stateDependentLayerIds=this.layers.filter(l=>l.isStateDependent()).map(l=>l.id)}populate(i,l,h){let p=this.layers[0],y=[],x=null,w=!1;p.type==="circle"&&(x=p.layout.get("circle-sort-key"),w=!x.isConstant());for(let{feature:S,id:A,index:z,sourceLayerIndex:R}of i){let N=this.layers[0]._featureFilter.needGeometry,G=Il(S,N);if(!this.layers[0]._featureFilter.filter(new Ui(this.zoom),G,h))continue;let Z=w?x.evaluate(G,{},h):void 0,se={id:A,properties:S.properties,type:S.type,sourceLayerIndex:R,index:z,geometry:N?G.geometry:wl(S),patterns:{},sortKey:Z};y.push(se)}w&&y.sort((S,A)=>S.sortKey-A.sortKey);for(let S of y){let{geometry:A,index:z,sourceLayerIndex:R}=S,N=i[z].feature;this.addFeature(S,A,z,h),l.featureIndex.insert(N,A,z,R,this.index)}}update(i,l,h){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(i,l,this.stateDependentLayers,h)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(i){this.uploaded||(this.layoutVertexBuffer=i.createVertexBuffer(this.layoutVertexArray,An),this.indexBuffer=i.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(i),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(i,l,h,p){for(let y of l)for(let x of y){let w=x.x,S=x.y;if(w<0||w>=Pr||S<0||S>=Pr)continue;let A=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,i.sortKey),z=A.vertexLength;Up(this.layoutVertexArray,w,S,-1,-1),Up(this.layoutVertexArray,w,S,1,-1),Up(this.layoutVertexArray,w,S,1,1),Up(this.layoutVertexArray,w,S,-1,1),this.indexArray.emplaceBack(z,z+1,z+2),this.indexArray.emplaceBack(z,z+3,z+2),A.vertexLength+=4,A.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,i,h,{},p)}}function $x(s,i){for(let l=0;l<s.length;l++)if(zu(i,s[l]))return!0;for(let l=0;l<i.length;l++)if(zu(s,i[l]))return!0;return!!p0(s,i)}function jT(s,i,l){return!!zu(s,i)||!!f0(i,s,l)}function Yx(s,i){if(s.length===1)return Jx(i,s[0]);for(let l=0;l<i.length;l++){let h=i[l];for(let p=0;p<h.length;p++)if(zu(s,h[p]))return!0}for(let l=0;l<s.length;l++)if(Jx(i,s[l]))return!0;for(let l=0;l<i.length;l++)if(p0(s,i[l]))return!0;return!1}function HT(s,i,l){if(s.length>1){if(p0(s,i))return!0;for(let h=0;h<i.length;h++)if(f0(i[h],s,l))return!0}for(let h=0;h<s.length;h++)if(f0(s[h],i,l))return!0;return!1}function p0(s,i){if(s.length===0||i.length===0)return!1;for(let l=0;l<s.length-1;l++){let h=s[l],p=s[l+1];for(let y=0;y<i.length-1;y++)if(XT(h,p,i[y],i[y+1]))return!0}return!1}function XT(s,i,l,h){return ve(s,l,h)!==ve(i,l,h)&&ve(s,i,l)!==ve(s,i,h)}function f0(s,i,l){let h=l*l;if(i.length===1)return s.distSqr(i[0])<h;for(let p=1;p<i.length;p++)if(qx(s,i[p-1],i[p])<h)return!0;return!1}function qx(s,i,l){let h=i.distSqr(l);if(h===0)return s.distSqr(i);let p=((s.x-i.x)*(l.x-i.x)+(s.y-i.y)*(l.y-i.y))/h;return s.distSqr(p<0?i:p>1?l:l.sub(i)._mult(p)._add(i))}function Jx(s,i){let l,h,p,y=!1;for(let x=0;x<s.length;x++){l=s[x];for(let w=0,S=l.length-1;w<l.length;S=w++)h=l[w],p=l[S],h.y>i.y!=p.y>i.y&&i.x<(p.x-h.x)*(i.y-h.y)/(p.y-h.y)+h.x&&(y=!y)}return y}function zu(s,i){let l=!1;for(let h=0,p=s.length-1;h<s.length;p=h++){let y=s[h],x=s[p];y.y>i.y!=x.y>i.y&&i.x<(x.x-y.x)*(i.y-y.y)/(x.y-y.y)+y.x&&(l=!l)}return l}function $T(s,i,l){let h=l[0],p=l[2];if(s.x<h.x&&i.x<h.x||s.x>p.x&&i.x>p.x||s.y<h.y&&i.y<h.y||s.y>p.y&&i.y>p.y)return!1;let y=ve(s,i,l[0]);return y!==ve(s,i,l[1])||y!==ve(s,i,l[2])||y!==ve(s,i,l[3])}function Th(s,i,l){let h=i.paint.get(s).value;return h.kind==="constant"?h.value:l.programConfigurations.get(i.id).getMaxValue(s)}function Wp(s){return Math.sqrt(s[0]*s[0]+s[1]*s[1])}function Zp(s,i,l,h,p){if(!i[0]&&!i[1])return s;let y=at.convert(i)._mult(p);l==="viewport"&&y._rotate(-h);let x=[];for(let w=0;w<s.length;w++)x.push(s[w].sub(y));return x}dt("CircleBucket",d0,{omit:["layers"]});let YT=new Tr({"circle-sort-key":new Mt(ye.layout_circle["circle-sort-key"])});var qT={paint:new Tr({"circle-radius":new Mt(ye.paint_circle["circle-radius"]),"circle-color":new Mt(ye.paint_circle["circle-color"]),"circle-blur":new Mt(ye.paint_circle["circle-blur"]),"circle-opacity":new Mt(ye.paint_circle["circle-opacity"]),"circle-translate":new vt(ye.paint_circle["circle-translate"]),"circle-translate-anchor":new vt(ye.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new vt(ye.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new vt(ye.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Mt(ye.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Mt(ye.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Mt(ye.paint_circle["circle-stroke-opacity"])}),layout:YT},Lu=typeof Float32Array<"u"?Float32Array:Array;function m0(s){return s[0]=1,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=1,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=1,s[11]=0,s[12]=0,s[13]=0,s[14]=0,s[15]=1,s}function Qx(s,i,l){var h=i[0],p=i[1],y=i[2],x=i[3],w=i[4],S=i[5],A=i[6],z=i[7],R=i[8],N=i[9],G=i[10],Z=i[11],se=i[12],ae=i[13],be=i[14],Te=i[15],Ee=l[0],Le=l[1],We=l[2],Oe=l[3];return s[0]=Ee*h+Le*w+We*R+Oe*se,s[1]=Ee*p+Le*S+We*N+Oe*ae,s[2]=Ee*y+Le*A+We*G+Oe*be,s[3]=Ee*x+Le*z+We*Z+Oe*Te,s[4]=(Ee=l[4])*h+(Le=l[5])*w+(We=l[6])*R+(Oe=l[7])*se,s[5]=Ee*p+Le*S+We*N+Oe*ae,s[6]=Ee*y+Le*A+We*G+Oe*be,s[7]=Ee*x+Le*z+We*Z+Oe*Te,s[8]=(Ee=l[8])*h+(Le=l[9])*w+(We=l[10])*R+(Oe=l[11])*se,s[9]=Ee*p+Le*S+We*N+Oe*ae,s[10]=Ee*y+Le*A+We*G+Oe*be,s[11]=Ee*x+Le*z+We*Z+Oe*Te,s[12]=(Ee=l[12])*h+(Le=l[13])*w+(We=l[14])*R+(Oe=l[15])*se,s[13]=Ee*p+Le*S+We*N+Oe*ae,s[14]=Ee*y+Le*A+We*G+Oe*be,s[15]=Ee*x+Le*z+We*Z+Oe*Te,s}Math.hypot||(Math.hypot=function(){for(var s=0,i=arguments.length;i--;)s+=arguments[i]*arguments[i];return Math.sqrt(s)});var Ah,JT=Qx;function jp(s,i,l){var h=i[0],p=i[1],y=i[2],x=i[3];return s[0]=l[0]*h+l[4]*p+l[8]*y+l[12]*x,s[1]=l[1]*h+l[5]*p+l[9]*y+l[13]*x,s[2]=l[2]*h+l[6]*p+l[10]*y+l[14]*x,s[3]=l[3]*h+l[7]*p+l[11]*y+l[15]*x,s}function Kx(s,i){let l=jp([],[s.x,s.y,0,1],i);return new at(l[0]/l[3],l[1]/l[3])}Ah=new Lu(4),Lu!=Float32Array&&(Ah[0]=0,Ah[1]=0,Ah[2]=0,Ah[3]=0);class e_ extends d0{}dt("HeatmapBucket",e_,{omit:["layers"]});var QT={paint:new Tr({"heatmap-radius":new Mt(ye.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Mt(ye.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new vt(ye.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Ch(ye.paint_heatmap["heatmap-color"]),"heatmap-opacity":new vt(ye.paint_heatmap["heatmap-opacity"])})};function g0(s,{width:i,height:l},h,p){if(p){if(p instanceof Uint8ClampedArray)p=new Uint8Array(p.buffer);else if(p.length!==i*l*h)throw new RangeError(`mismatched image size. expected: ${p.length} but got: ${i*l*h}`)}else p=new Uint8Array(i*l*h);return s.width=i,s.height=l,s.data=p,s}function t_(s,{width:i,height:l},h){if(i===s.width&&l===s.height)return;let p=g0({},{width:i,height:l},h);y0(s,p,{x:0,y:0},{x:0,y:0},{width:Math.min(s.width,i),height:Math.min(s.height,l)},h),s.width=i,s.height=l,s.data=p.data}function y0(s,i,l,h,p,y){if(p.width===0||p.height===0)return i;if(p.width>s.width||p.height>s.height||l.x>s.width-p.width||l.y>s.height-p.height)throw new RangeError("out of range source coordinates for image copy");if(p.width>i.width||p.height>i.height||h.x>i.width-p.width||h.y>i.height-p.height)throw new RangeError("out of range destination coordinates for image copy");let x=s.data,w=i.data;for(let S=0;S<p.height;S++){let A=((l.y+S)*s.width+l.x)*y,z=((h.y+S)*i.width+h.x)*y;for(let R=0;R<p.width*y;R++)w[z+R]=x[A+R]}return i}class Ph{constructor(i,l){g0(this,i,1,l)}resize(i){t_(this,i,1)}clone(){return new Ph({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(i,l,h,p,y){y0(i,l,h,p,y,1)}}class ao{constructor(i,l){g0(this,i,4,l)}resize(i){t_(this,i,4)}replace(i,l){l?this.data.set(i):this.data=i instanceof Uint8ClampedArray?new Uint8Array(i.buffer):i}clone(){return new ao({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(i,l,h,p,y){y0(i,l,h,p,y,4)}}function i_(s){let i={},l=s.resolution||256,h=s.clips?s.clips.length:1,p=s.image||new ao({width:l,height:h}),y=(x,w,S)=>{i[s.evaluationKey]=S;let A=s.expression.evaluate(i);p.data[x+w+0]=Math.floor(255*A.r/A.a),p.data[x+w+1]=Math.floor(255*A.g/A.a),p.data[x+w+2]=Math.floor(255*A.b/A.a),p.data[x+w+3]=Math.floor(255*A.a)};if(s.clips)for(let x=0,w=0;x<h;++x,w+=4*l)for(let S=0,A=0;S<l;S++,A+=4){let z=S/(l-1),{start:R,end:N}=s.clips[x];y(w,A,R*(1-z)+N*z)}else for(let x=0,w=0;x<l;x++,w+=4)y(0,w,x/(l-1));return p}dt("AlphaImage",Ph),dt("RGBAImage",ao);var KT={paint:new Tr({"hillshade-illumination-direction":new vt(ye.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new vt(ye.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new vt(ye.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new vt(ye.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new vt(ye.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new vt(ye.paint_hillshade["hillshade-accent-color"])})};let eA=Ar([{name:"a_pos",components:2,type:"Int16"}],4),{members:tA}=eA;var v0={exports:{}};function Hp(s,i,l){l=l||2;var h,p,y,x,w,S,A,z=i&&i.length,R=z?i[0]*l:s.length,N=r_(s,0,R,l,!0),G=[];if(!N||N.next===N.prev)return G;if(z&&(N=function(se,ae,be,Te){var Ee,Le,We,Oe=[];for(Ee=0,Le=ae.length;Ee<Le;Ee++)(We=r_(se,ae[Ee]*Te,Ee<Le-1?ae[Ee+1]*Te:se.length,Te,!1))===We.next&&(We.steiner=!0),Oe.push(uA(We));for(Oe.sort(sA),Ee=0;Ee<Oe.length;Ee++)be=wa(be=aA(Oe[Ee],be),be.next);return be}(s,i,N,l)),s.length>80*l){h=y=s[0],p=x=s[1];for(var Z=l;Z<R;Z+=l)(w=s[Z])<h&&(h=w),(S=s[Z+1])<p&&(p=S),w>y&&(y=w),S>x&&(x=S);A=(A=Math.max(y-h,x-p))!==0?1/A:0}return kh(N,G,l,h,p,A),G}function r_(s,i,l,h,p){var y,x;if(p===b0(s,i,l,h)>0)for(y=i;y<l;y+=h)x=s_(y,s[y],s[y+1],x);else for(y=l-h;y>=i;y-=h)x=s_(y,s[y],s[y+1],x);return x&&Xp(x,x.next)&&(Lh(x),x=x.next),x}function wa(s,i){if(!s)return s;i||(i=s);var l,h=s;do if(l=!1,h.steiner||!Xp(h,h.next)&&hr(h.prev,h,h.next)!==0)h=h.next;else{if(Lh(h),(h=i=h.prev)===h.next)break;l=!0}while(l||h!==i);return i}function kh(s,i,l,h,p,y,x){if(s){!x&&y&&function(z,R,N,G){var Z=z;do Z.z===null&&(Z.z=x0(Z.x,Z.y,R,N,G)),Z.prevZ=Z.prev,Z.nextZ=Z.next,Z=Z.next;while(Z!==z);Z.prevZ.nextZ=null,Z.prevZ=null,function(se){var ae,be,Te,Ee,Le,We,Oe,pt,bt=1;do{for(be=se,se=null,Le=null,We=0;be;){for(We++,Te=be,Oe=0,ae=0;ae<bt&&(Oe++,Te=Te.nextZ);ae++);for(pt=bt;Oe>0||pt>0&&Te;)Oe!==0&&(pt===0||!Te||be.z<=Te.z)?(Ee=be,be=be.nextZ,Oe--):(Ee=Te,Te=Te.nextZ,pt--),Le?Le.nextZ=Ee:se=Ee,Ee.prevZ=Le,Le=Ee;be=Te}Le.nextZ=null,bt*=2}while(We>1)}(Z)}(s,h,p,y);for(var w,S,A=s;s.prev!==s.next;)if(w=s.prev,S=s.next,y?rA(s,h,p,y):iA(s))i.push(w.i/l),i.push(s.i/l),i.push(S.i/l),Lh(s),s=S.next,A=S.next;else if((s=S)===A){x?x===1?kh(s=nA(wa(s),i,l),i,l,h,p,y,2):x===2&&oA(s,i,l,h,p,y):kh(wa(s),i,l,h,p,y,1);break}}}function iA(s){var i=s.prev,l=s,h=s.next;if(hr(i,l,h)>=0)return!1;for(var p=s.next.next;p!==s.prev;){if(Ru(i.x,i.y,l.x,l.y,h.x,h.y,p.x,p.y)&&hr(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function rA(s,i,l,h){var p=s.prev,y=s,x=s.next;if(hr(p,y,x)>=0)return!1;for(var w=p.x>y.x?p.x>x.x?p.x:x.x:y.x>x.x?y.x:x.x,S=p.y>y.y?p.y>x.y?p.y:x.y:y.y>x.y?y.y:x.y,A=x0(p.x<y.x?p.x<x.x?p.x:x.x:y.x<x.x?y.x:x.x,p.y<y.y?p.y<x.y?p.y:x.y:y.y<x.y?y.y:x.y,i,l,h),z=x0(w,S,i,l,h),R=s.prevZ,N=s.nextZ;R&&R.z>=A&&N&&N.z<=z;){if(R!==s.prev&&R!==s.next&&Ru(p.x,p.y,y.x,y.y,x.x,x.y,R.x,R.y)&&hr(R.prev,R,R.next)>=0||(R=R.prevZ,N!==s.prev&&N!==s.next&&Ru(p.x,p.y,y.x,y.y,x.x,x.y,N.x,N.y)&&hr(N.prev,N,N.next)>=0))return!1;N=N.nextZ}for(;R&&R.z>=A;){if(R!==s.prev&&R!==s.next&&Ru(p.x,p.y,y.x,y.y,x.x,x.y,R.x,R.y)&&hr(R.prev,R,R.next)>=0)return!1;R=R.prevZ}for(;N&&N.z<=z;){if(N!==s.prev&&N!==s.next&&Ru(p.x,p.y,y.x,y.y,x.x,x.y,N.x,N.y)&&hr(N.prev,N,N.next)>=0)return!1;N=N.nextZ}return!0}function nA(s,i,l){var h=s;do{var p=h.prev,y=h.next.next;!Xp(p,y)&&n_(p,h,h.next,y)&&zh(p,y)&&zh(y,p)&&(i.push(p.i/l),i.push(h.i/l),i.push(y.i/l),Lh(h),Lh(h.next),h=s=y),h=h.next}while(h!==s);return wa(h)}function oA(s,i,l,h,p,y){var x=s;do{for(var w=x.next.next;w!==x.prev;){if(x.i!==w.i&&cA(x,w)){var S=o_(x,w);return x=wa(x,x.next),S=wa(S,S.next),kh(x,i,l,h,p,y),void kh(S,i,l,h,p,y)}w=w.next}x=x.next}while(x!==s)}function sA(s,i){return s.x-i.x}function aA(s,i){var l=function(y,x){var w,S=x,A=y.x,z=y.y,R=-1/0;do{if(z<=S.y&&z>=S.next.y&&S.next.y!==S.y){var N=S.x+(z-S.y)*(S.next.x-S.x)/(S.next.y-S.y);if(N<=A&&N>R){if(R=N,N===A){if(z===S.y)return S;if(z===S.next.y)return S.next}w=S.x<S.next.x?S:S.next}}S=S.next}while(S!==x);if(!w)return null;if(A===R)return w;var G,Z=w,se=w.x,ae=w.y,be=1/0;S=w;do A>=S.x&&S.x>=se&&A!==S.x&&Ru(z<ae?A:R,z,se,ae,z<ae?R:A,z,S.x,S.y)&&(G=Math.abs(z-S.y)/(A-S.x),zh(S,y)&&(G<be||G===be&&(S.x>w.x||S.x===w.x&&lA(w,S)))&&(w=S,be=G)),S=S.next;while(S!==Z);return w}(s,i);if(!l)return i;var h=o_(l,s),p=wa(l,l.next);return wa(h,h.next),i===l?p:i}function lA(s,i){return hr(s.prev,s,i.prev)<0&&hr(i.next,s,s.next)<0}function x0(s,i,l,h,p){return(s=1431655765&((s=858993459&((s=252645135&((s=16711935&((s=32767*(s-l)*p)|s<<8))|s<<4))|s<<2))|s<<1))|(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=32767*(i-h)*p)|i<<8))|i<<4))|i<<2))|i<<1))<<1}function uA(s){var i=s,l=s;do(i.x<l.x||i.x===l.x&&i.y<l.y)&&(l=i),i=i.next;while(i!==s);return l}function Ru(s,i,l,h,p,y,x,w){return(p-x)*(i-w)-(s-x)*(y-w)>=0&&(s-x)*(h-w)-(l-x)*(i-w)>=0&&(l-x)*(y-w)-(p-x)*(h-w)>=0}function cA(s,i){return s.next.i!==i.i&&s.prev.i!==i.i&&!function(l,h){var p=l;do{if(p.i!==l.i&&p.next.i!==l.i&&p.i!==h.i&&p.next.i!==h.i&&n_(p,p.next,l,h))return!0;p=p.next}while(p!==l);return!1}(s,i)&&(zh(s,i)&&zh(i,s)&&function(l,h){var p=l,y=!1,x=(l.x+h.x)/2,w=(l.y+h.y)/2;do p.y>w!=p.next.y>w&&p.next.y!==p.y&&x<(p.next.x-p.x)*(w-p.y)/(p.next.y-p.y)+p.x&&(y=!y),p=p.next;while(p!==l);return y}(s,i)&&(hr(s.prev,s,i.prev)||hr(s,i.prev,i))||Xp(s,i)&&hr(s.prev,s,s.next)>0&&hr(i.prev,i,i.next)>0)}function hr(s,i,l){return(i.y-s.y)*(l.x-i.x)-(i.x-s.x)*(l.y-i.y)}function Xp(s,i){return s.x===i.x&&s.y===i.y}function n_(s,i,l,h){var p=Yp(hr(s,i,l)),y=Yp(hr(s,i,h)),x=Yp(hr(l,h,s)),w=Yp(hr(l,h,i));return p!==y&&x!==w||!(p!==0||!$p(s,l,i))||!(y!==0||!$p(s,h,i))||!(x!==0||!$p(l,s,h))||!(w!==0||!$p(l,i,h))}function $p(s,i,l){return i.x<=Math.max(s.x,l.x)&&i.x>=Math.min(s.x,l.x)&&i.y<=Math.max(s.y,l.y)&&i.y>=Math.min(s.y,l.y)}function Yp(s){return s>0?1:s<0?-1:0}function zh(s,i){return hr(s.prev,s,s.next)<0?hr(s,i,s.next)>=0&&hr(s,s.prev,i)>=0:hr(s,i,s.prev)<0||hr(s,s.next,i)<0}function o_(s,i){var l=new _0(s.i,s.x,s.y),h=new _0(i.i,i.x,i.y),p=s.next,y=i.prev;return s.next=i,i.prev=s,l.next=p,p.prev=l,h.next=l,l.prev=h,y.next=h,h.prev=y,h}function s_(s,i,l,h){var p=new _0(s,i,l);return h?(p.next=h.next,p.prev=h,h.next.prev=p,h.next=p):(p.prev=p,p.next=p),p}function Lh(s){s.next.prev=s.prev,s.prev.next=s.next,s.prevZ&&(s.prevZ.nextZ=s.nextZ),s.nextZ&&(s.nextZ.prevZ=s.prevZ)}function _0(s,i,l){this.i=s,this.x=i,this.y=l,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function b0(s,i,l,h){for(var p=0,y=i,x=l-h;y<l;y+=h)p+=(s[x]-s[y])*(s[y+1]+s[x+1]),x=y;return p}v0.exports=Hp,v0.exports.default=Hp,Hp.deviation=function(s,i,l,h){var p=i&&i.length,y=Math.abs(b0(s,0,p?i[0]*l:s.length,l));if(p)for(var x=0,w=i.length;x<w;x++)y-=Math.abs(b0(s,i[x]*l,x<w-1?i[x+1]*l:s.length,l));var S=0;for(x=0;x<h.length;x+=3){var A=h[x]*l,z=h[x+1]*l,R=h[x+2]*l;S+=Math.abs((s[A]-s[R])*(s[z+1]-s[A+1])-(s[A]-s[z])*(s[R+1]-s[A+1]))}return y===0&&S===0?0:Math.abs((S-y)/y)},Hp.flatten=function(s){for(var i=s[0][0].length,l={vertices:[],holes:[],dimensions:i},h=0,p=0;p<s.length;p++){for(var y=0;y<s[p].length;y++)for(var x=0;x<i;x++)l.vertices.push(s[p][y][x]);p>0&&l.holes.push(h+=s[p-1].length)}return l};var a_=v0.exports;function hA(s,i,l,h,p){l_(s,i,l||0,h||s.length-1,p||dA)}function l_(s,i,l,h,p){for(;h>l;){if(h-l>600){var y=h-l+1,x=i-l+1,w=Math.log(y),S=.5*Math.exp(2*w/3),A=.5*Math.sqrt(w*S*(y-S)/y)*(x-y/2<0?-1:1);l_(s,i,Math.max(l,Math.floor(i-x*S/y+A)),Math.min(h,Math.floor(i+(y-x)*S/y+A)),p)}var z=s[i],R=l,N=h;for(Rh(s,l,i),p(s[h],z)>0&&Rh(s,l,h);R<N;){for(Rh(s,R,N),R++,N--;p(s[R],z)<0;)R++;for(;p(s[N],z)>0;)N--}p(s[l],z)===0?Rh(s,l,N):Rh(s,++N,h),N<=i&&(l=N+1),i<=N&&(h=N-1)}}function Rh(s,i,l){var h=s[i];s[i]=s[l],s[l]=h}function dA(s,i){return s<i?-1:s>i?1:0}function w0(s,i){let l=s.length;if(l<=1)return[s];let h=[],p,y;for(let x=0;x<l;x++){let w=Me(s[x]);w!==0&&(s[x].area=Math.abs(w),y===void 0&&(y=w<0),y===w<0?(p&&h.push(p),p=[s[x]]):p.push(s[x]))}if(p&&h.push(p),i>1)for(let x=0;x<h.length;x++)h[x].length<=i||(hA(h[x],i,1,h[x].length-1,pA),h[x]=h[x].slice(0,i));return h}function pA(s,i){return i.area-s.area}function I0(s,i,l){let h=l.patternDependencies,p=!1;for(let y of i){let x=y.paint.get(`${s}-pattern`);x.isConstant()||(p=!0);let w=x.constantOr(null);w&&(p=!0,h[w.to]=!0,h[w.from]=!0)}return p}function S0(s,i,l,h,p){let y=p.patternDependencies;for(let x of i){let w=x.paint.get(`${s}-pattern`).value;if(w.kind!=="constant"){let S=w.evaluate({zoom:h-1},l,{},p.availableImages),A=w.evaluate({zoom:h},l,{},p.availableImages),z=w.evaluate({zoom:h+1},l,{},p.availableImages);S=S&&S.name?S.name:S,A=A&&A.name?A.name:A,z=z&&z.name?z.name:z,y[S]=!0,y[A]=!0,y[z]=!0,l.patterns[x.id]={min:S,mid:A,max:z}}}return l}class C0{constructor(i){this.zoom=i.zoom,this.overscaling=i.overscaling,this.layers=i.layers,this.layerIds=this.layers.map(l=>l.id),this.index=i.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Qt,this.indexArray=new mn,this.indexArray2=new bo,this.programConfigurations=new bl(i.layers,i.zoom),this.segments=new li,this.segments2=new li,this.stateDependentLayerIds=this.layers.filter(l=>l.isStateDependent()).map(l=>l.id)}populate(i,l,h){this.hasPattern=I0("fill",this.layers,l);let p=this.layers[0].layout.get("fill-sort-key"),y=!p.isConstant(),x=[];for(let{feature:w,id:S,index:A,sourceLayerIndex:z}of i){let R=this.layers[0]._featureFilter.needGeometry,N=Il(w,R);if(!this.layers[0]._featureFilter.filter(new Ui(this.zoom),N,h))continue;let G=y?p.evaluate(N,{},h,l.availableImages):void 0,Z={id:S,properties:w.properties,type:w.type,sourceLayerIndex:z,index:A,geometry:R?N.geometry:wl(w),patterns:{},sortKey:G};x.push(Z)}y&&x.sort((w,S)=>w.sortKey-S.sortKey);for(let w of x){let{geometry:S,index:A,sourceLayerIndex:z}=w;if(this.hasPattern){let R=S0("fill",this.layers,w,this.zoom,l);this.patternFeatures.push(R)}else this.addFeature(w,S,A,h,{});l.featureIndex.insert(i[A].feature,S,A,z,this.index)}}update(i,l,h){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(i,l,this.stateDependentLayers,h)}addFeatures(i,l,h){for(let p of this.patternFeatures)this.addFeature(p,p.geometry,p.index,l,h)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(i){this.uploaded||(this.layoutVertexBuffer=i.createVertexBuffer(this.layoutVertexArray,tA),this.indexBuffer=i.createIndexBuffer(this.indexArray),this.indexBuffer2=i.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(i),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(i,l,h,p,y){for(let x of w0(l,500)){let w=0;for(let G of x)w+=G.length;let S=this.segments.prepareSegment(w,this.layoutVertexArray,this.indexArray),A=S.vertexLength,z=[],R=[];for(let G of x){if(G.length===0)continue;G!==x[0]&&R.push(z.length/2);let Z=this.segments2.prepareSegment(G.length,this.layoutVertexArray,this.indexArray2),se=Z.vertexLength;this.layoutVertexArray.emplaceBack(G[0].x,G[0].y),this.indexArray2.emplaceBack(se+G.length-1,se),z.push(G[0].x),z.push(G[0].y);for(let ae=1;ae<G.length;ae++)this.layoutVertexArray.emplaceBack(G[ae].x,G[ae].y),this.indexArray2.emplaceBack(se+ae-1,se+ae),z.push(G[ae].x),z.push(G[ae].y);Z.vertexLength+=G.length,Z.primitiveLength+=G.length}let N=a_(z,R);for(let G=0;G<N.length;G+=3)this.indexArray.emplaceBack(A+N[G],A+N[G+1],A+N[G+2]);S.vertexLength+=w,S.primitiveLength+=N.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,i,h,y,p)}}dt("FillBucket",C0,{omit:["layers","patternFeatures"]});let fA=new Tr({"fill-sort-key":new Mt(ye.layout_fill["fill-sort-key"])});var mA={paint:new Tr({"fill-antialias":new vt(ye.paint_fill["fill-antialias"]),"fill-opacity":new Mt(ye.paint_fill["fill-opacity"]),"fill-color":new Mt(ye.paint_fill["fill-color"]),"fill-outline-color":new Mt(ye.paint_fill["fill-outline-color"]),"fill-translate":new vt(ye.paint_fill["fill-translate"]),"fill-translate-anchor":new vt(ye.paint_fill["fill-translate-anchor"]),"fill-pattern":new yl(ye.paint_fill["fill-pattern"])}),layout:fA};let gA=Ar([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),{members:yA}=gA;var Ia={},vA=at,u_=Du;function Du(s,i,l,h,p){this.properties={},this.extent=l,this.type=0,this._pbf=s,this._geometry=-1,this._keys=h,this._values=p,s.readFields(xA,this,i)}function xA(s,i,l){s==1?i.id=l.readVarint():s==2?function(h,p){for(var y=h.readVarint()+h.pos;h.pos<y;){var x=p._keys[h.readVarint()],w=p._values[h.readVarint()];p.properties[x]=w}}(l,i):s==3?i.type=l.readVarint():s==4&&(i._geometry=l.pos)}function _A(s){for(var i,l,h=0,p=0,y=s.length,x=y-1;p<y;x=p++)h+=((l=s[x]).x-(i=s[p]).x)*(i.y+l.y);return h}Du.types=["Unknown","Point","LineString","Polygon"],Du.prototype.loadGeometry=function(){var s=this._pbf;s.pos=this._geometry;for(var i,l=s.readVarint()+s.pos,h=1,p=0,y=0,x=0,w=[];s.pos<l;){if(p<=0){var S=s.readVarint();h=7&S,p=S>>3}if(p--,h===1||h===2)y+=s.readSVarint(),x+=s.readSVarint(),h===1&&(i&&w.push(i),i=[]),i.push(new vA(y,x));else{if(h!==7)throw new Error("unknown command "+h);i&&i.push(i[0].clone())}}return i&&w.push(i),w},Du.prototype.bbox=function(){var s=this._pbf;s.pos=this._geometry;for(var i=s.readVarint()+s.pos,l=1,h=0,p=0,y=0,x=1/0,w=-1/0,S=1/0,A=-1/0;s.pos<i;){if(h<=0){var z=s.readVarint();l=7&z,h=z>>3}if(h--,l===1||l===2)(p+=s.readSVarint())<x&&(x=p),p>w&&(w=p),(y+=s.readSVarint())<S&&(S=y),y>A&&(A=y);else if(l!==7)throw new Error("unknown command "+l)}return[x,S,w,A]},Du.prototype.toGeoJSON=function(s,i,l){var h,p,y=this.extent*Math.pow(2,l),x=this.extent*s,w=this.extent*i,S=this.loadGeometry(),A=Du.types[this.type];function z(G){for(var Z=0;Z<G.length;Z++){var se=G[Z];G[Z]=[360*(se.x+x)/y-180,360/Math.PI*Math.atan(Math.exp((180-360*(se.y+w)/y)*Math.PI/180))-90]}}switch(this.type){case 1:var R=[];for(h=0;h<S.length;h++)R[h]=S[h][0];z(S=R);break;case 2:for(h=0;h<S.length;h++)z(S[h]);break;case 3:for(S=function(G){var Z=G.length;if(Z<=1)return[G];for(var se,ae,be=[],Te=0;Te<Z;Te++){var Ee=_A(G[Te]);Ee!==0&&(ae===void 0&&(ae=Ee<0),ae===Ee<0?(se&&be.push(se),se=[G[Te]]):se.push(G[Te]))}return se&&be.push(se),be}(S),h=0;h<S.length;h++)for(p=0;p<S[h].length;p++)z(S[h][p])}S.length===1?S=S[0]:A="Multi"+A;var N={type:"Feature",geometry:{type:A,coordinates:S},properties:this.properties};return"id"in this&&(N.id=this.id),N};var bA=u_,c_=h_;function h_(s,i){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=s,this._keys=[],this._values=[],this._features=[],s.readFields(wA,this,i),this.length=this._features.length}function wA(s,i,l){s===15?i.version=l.readVarint():s===1?i.name=l.readString():s===5?i.extent=l.readVarint():s===2?i._features.push(l.pos):s===3?i._keys.push(l.readString()):s===4&&i._values.push(function(h){for(var p=null,y=h.readVarint()+h.pos;h.pos<y;){var x=h.readVarint()>>3;p=x===1?h.readString():x===2?h.readFloat():x===3?h.readDouble():x===4?h.readVarint64():x===5?h.readVarint():x===6?h.readSVarint():x===7?h.readBoolean():null}return p}(l))}h_.prototype.feature=function(s){if(s<0||s>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[s];var i=this._pbf.readVarint()+this._pbf.pos;return new bA(this._pbf,i,this.extent,this._keys,this._values)};var IA=c_;function SA(s,i,l){if(s===3){var h=new IA(l,l.readVarint()+l.pos);h.length&&(i[h.name]=h)}}Ia.VectorTile=function(s,i){this.layers=s.readFields(SA,{},i)},Ia.VectorTileFeature=u_,Ia.VectorTileLayer=c_;let CA=Ia.VectorTileFeature.types,M0=Math.pow(2,13);function Dh(s,i,l,h,p,y,x,w){s.emplaceBack(i,l,2*Math.floor(h*M0)+x,p*M0*2,y*M0*2,Math.round(w))}class E0{constructor(i){this.zoom=i.zoom,this.overscaling=i.overscaling,this.layers=i.layers,this.layerIds=this.layers.map(l=>l.id),this.index=i.index,this.hasPattern=!1,this.layoutVertexArray=new Qi,this.indexArray=new mn,this.programConfigurations=new bl(i.layers,i.zoom),this.segments=new li,this.stateDependentLayerIds=this.layers.filter(l=>l.isStateDependent()).map(l=>l.id)}populate(i,l,h){this.features=[],this.hasPattern=I0("fill-extrusion",this.layers,l);for(let{feature:p,id:y,index:x,sourceLayerIndex:w}of i){let S=this.layers[0]._featureFilter.needGeometry,A=Il(p,S);if(!this.layers[0]._featureFilter.filter(new Ui(this.zoom),A,h))continue;let z={id:y,sourceLayerIndex:w,index:x,geometry:S?A.geometry:wl(p),properties:p.properties,type:p.type,patterns:{}};this.hasPattern?this.features.push(S0("fill-extrusion",this.layers,z,this.zoom,l)):this.addFeature(z,z.geometry,x,h,{}),l.featureIndex.insert(p,z.geometry,x,w,this.index,!0)}}addFeatures(i,l,h){for(let p of this.features){let{geometry:y}=p;this.addFeature(p,y,p.index,l,h)}}update(i,l,h){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(i,l,this.stateDependentLayers,h)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(i){this.uploaded||(this.layoutVertexBuffer=i.createVertexBuffer(this.layoutVertexArray,yA),this.indexBuffer=i.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(i),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(i,l,h,p,y){for(let x of w0(l,500)){let w=0;for(let G of x)w+=G.length;let S=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(let G of x){if(G.length===0||EA(G))continue;let Z=0;for(let se=0;se<G.length;se++){let ae=G[se];if(se>=1){let be=G[se-1];if(!MA(ae,be)){S.vertexLength+4>li.MAX_VERTEX_ARRAY_LENGTH&&(S=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let Te=ae.sub(be)._perp()._unit(),Ee=be.dist(ae);Z+Ee>32768&&(Z=0),Dh(this.layoutVertexArray,ae.x,ae.y,Te.x,Te.y,0,0,Z),Dh(this.layoutVertexArray,ae.x,ae.y,Te.x,Te.y,0,1,Z),Z+=Ee,Dh(this.layoutVertexArray,be.x,be.y,Te.x,Te.y,0,0,Z),Dh(this.layoutVertexArray,be.x,be.y,Te.x,Te.y,0,1,Z);let Le=S.vertexLength;this.indexArray.emplaceBack(Le,Le+2,Le+1),this.indexArray.emplaceBack(Le+1,Le+2,Le+3),S.vertexLength+=4,S.primitiveLength+=2}}}}if(S.vertexLength+w>li.MAX_VERTEX_ARRAY_LENGTH&&(S=this.segments.prepareSegment(w,this.layoutVertexArray,this.indexArray)),CA[i.type]!=="Polygon")continue;let A=[],z=[],R=S.vertexLength;for(let G of x)if(G.length!==0){G!==x[0]&&z.push(A.length/2);for(let Z=0;Z<G.length;Z++){let se=G[Z];Dh(this.layoutVertexArray,se.x,se.y,0,0,1,1,0),A.push(se.x),A.push(se.y)}}let N=a_(A,z);for(let G=0;G<N.length;G+=3)this.indexArray.emplaceBack(R+N[G],R+N[G+2],R+N[G+1]);S.primitiveLength+=N.length/3,S.vertexLength+=w}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,i,h,y,p)}}function MA(s,i){return s.x===i.x&&(s.x<0||s.x>Pr)||s.y===i.y&&(s.y<0||s.y>Pr)}function EA(s){return s.every(i=>i.x<0)||s.every(i=>i.x>Pr)||s.every(i=>i.y<0)||s.every(i=>i.y>Pr)}dt("FillExtrusionBucket",E0,{omit:["layers","features"]});var TA={paint:new Tr({"fill-extrusion-opacity":new vt(ye["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Mt(ye["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new vt(ye["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new vt(ye["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new yl(ye["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Mt(ye["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Mt(ye["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new vt(ye["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})};function Bh(s,i){return s.x*i.x+s.y*i.y}function d_(s,i){if(s.length===1){let l=0,h=i[l++],p;for(;!p||h.equals(p);)if(p=i[l++],!p)return 1/0;for(;l<i.length;l++){let y=i[l],x=s[0],w=p.sub(h),S=y.sub(h),A=x.sub(h),z=Bh(w,w),R=Bh(w,S),N=Bh(S,S),G=Bh(A,w),Z=Bh(A,S),se=z*N-R*R,ae=(N*G-R*Z)/se,be=(z*Z-R*G)/se,Te=h.z*(1-ae-be)+p.z*ae+y.z*be;if(isFinite(Te))return Te}return 1/0}{let l=1/0;for(let h of i)l=Math.min(l,h.z);return l}}let AA=Ar([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:PA}=AA,kA=Ar([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:zA}=kA,LA=Ia.VectorTileFeature.types,RA=Math.cos(Math.PI/180*37.5),p_=Math.pow(2,14)/.5;class T0{constructor(i){this.zoom=i.zoom,this.overscaling=i.overscaling,this.layers=i.layers,this.layerIds=this.layers.map(l=>l.id),this.index=i.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(l=>{this.gradients[l.id]={}}),this.layoutVertexArray=new zt,this.layoutVertexArray2=new ai,this.indexArray=new mn,this.programConfigurations=new bl(i.layers,i.zoom),this.segments=new li,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(l=>l.isStateDependent()).map(l=>l.id)}populate(i,l,h){this.hasPattern=I0("line",this.layers,l);let p=this.layers[0].layout.get("line-sort-key"),y=!p.isConstant(),x=[];for(let{feature:w,id:S,index:A,sourceLayerIndex:z}of i){let R=this.layers[0]._featureFilter.needGeometry,N=Il(w,R);if(!this.layers[0]._featureFilter.filter(new Ui(this.zoom),N,h))continue;let G=y?p.evaluate(N,{},h):void 0,Z={id:S,properties:w.properties,type:w.type,sourceLayerIndex:z,index:A,geometry:R?N.geometry:wl(w),patterns:{},sortKey:G};x.push(Z)}y&&x.sort((w,S)=>w.sortKey-S.sortKey);for(let w of x){let{geometry:S,index:A,sourceLayerIndex:z}=w;if(this.hasPattern){let R=S0("line",this.layers,w,this.zoom,l);this.patternFeatures.push(R)}else this.addFeature(w,S,A,h,{});l.featureIndex.insert(i[A].feature,S,A,z,this.index)}}update(i,l,h){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(i,l,this.stateDependentLayers,h)}addFeatures(i,l,h){for(let p of this.patternFeatures)this.addFeature(p,p.geometry,p.index,l,h)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(i){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=i.createVertexBuffer(this.layoutVertexArray2,zA)),this.layoutVertexBuffer=i.createVertexBuffer(this.layoutVertexArray,PA),this.indexBuffer=i.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(i),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(i){if(i.properties&&Object.prototype.hasOwnProperty.call(i.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(i.properties,"mapbox_clip_end"))return{start:+i.properties.mapbox_clip_start,end:+i.properties.mapbox_clip_end}}addFeature(i,l,h,p,y){let x=this.layers[0].layout,w=x.get("line-join").evaluate(i,{}),S=x.get("line-cap"),A=x.get("line-miter-limit"),z=x.get("line-round-limit");this.lineClips=this.lineFeatureClips(i);for(let R of l)this.addLine(R,i,w,S,A,z);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,i,h,y,p)}addLine(i,l,h,p,y,x){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let be=0;be<i.length-1;be++)this.totalDistance+=i[be].dist(i[be+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let w=LA[l.type]==="Polygon",S=i.length;for(;S>=2&&i[S-1].equals(i[S-2]);)S--;let A=0;for(;A<S-1&&i[A].equals(i[A+1]);)A++;if(S<(w?3:2))return;h==="bevel"&&(y=1.05);let z=this.overscaling<=16?122880/(512*this.overscaling):0,R=this.segments.prepareSegment(10*S,this.layoutVertexArray,this.indexArray),N,G,Z,se,ae;this.e1=this.e2=-1,w&&(N=i[S-2],ae=i[A].sub(N)._unit()._perp());for(let be=A;be<S;be++){if(Z=be===S-1?w?i[A+1]:void 0:i[be+1],Z&&i[be].equals(Z))continue;ae&&(se=ae),N&&(G=N),N=i[be],ae=Z?Z.sub(N)._unit()._perp():se,se=se||ae;let Te=se.add(ae);Te.x===0&&Te.y===0||Te._unit();let Ee=se.x*ae.x+se.y*ae.y,Le=Te.x*ae.x+Te.y*ae.y,We=Le!==0?1/Le:1/0,Oe=2*Math.sqrt(2-2*Le),pt=Le<RA&&G&&Z,bt=se.x*ae.y-se.y*ae.x>0;if(pt&&be>A){let tt=N.dist(G);if(tt>2*z){let ct=N.sub(N.sub(G)._mult(z/tt)._round());this.updateDistance(G,ct),this.addCurrentVertex(ct,se,0,0,R),G=ct}}let nt=G&&Z,ot=nt?h:w?"butt":p;if(nt&&ot==="round"&&(We<x?ot="miter":We<=2&&(ot="fakeround")),ot==="miter"&&We>y&&(ot="bevel"),ot==="bevel"&&(We>2&&(ot="flipbevel"),We<y&&(ot="miter")),G&&this.updateDistance(G,N),ot==="miter")Te._mult(We),this.addCurrentVertex(N,Te,0,0,R);else if(ot==="flipbevel"){if(We>100)Te=ae.mult(-1);else{let tt=We*se.add(ae).mag()/se.sub(ae).mag();Te._perp()._mult(tt*(bt?-1:1))}this.addCurrentVertex(N,Te,0,0,R),this.addCurrentVertex(N,Te.mult(-1),0,0,R)}else if(ot==="bevel"||ot==="fakeround"){let tt=-Math.sqrt(We*We-1),ct=bt?tt:0,st=bt?0:tt;if(G&&this.addCurrentVertex(N,se,ct,st,R),ot==="fakeround"){let Ye=Math.round(180*Oe/Math.PI/20);for(let Et=1;Et<Ye;Et++){let wt=Et/Ye;if(wt!==.5){let vi=wt-.5;wt+=wt*vi*(wt-1)*((1.0904+Ee*(Ee*(3.55645-1.43519*Ee)-3.2452))*vi*vi+(.848013+Ee*(.215638*Ee-1.06021)))}let Kt=ae.sub(se)._mult(wt)._add(se)._unit()._mult(bt?-1:1);this.addHalfVertex(N,Kt.x,Kt.y,!1,bt,0,R)}}Z&&this.addCurrentVertex(N,ae,-ct,-st,R)}else if(ot==="butt")this.addCurrentVertex(N,Te,0,0,R);else if(ot==="square"){let tt=G?1:-1;this.addCurrentVertex(N,Te,tt,tt,R)}else ot==="round"&&(G&&(this.addCurrentVertex(N,se,0,0,R),this.addCurrentVertex(N,se,1,1,R,!0)),Z&&(this.addCurrentVertex(N,ae,-1,-1,R,!0),this.addCurrentVertex(N,ae,0,0,R)));if(pt&&be<S-1){let tt=N.dist(Z);if(tt>2*z){let ct=N.add(Z.sub(N)._mult(z/tt)._round());this.updateDistance(N,ct),this.addCurrentVertex(ct,ae,0,0,R),N=ct}}}}addCurrentVertex(i,l,h,p,y,x=!1){let w=l.y*p-l.x,S=-l.y-l.x*p;this.addHalfVertex(i,l.x+l.y*h,l.y-l.x*h,x,!1,h,y),this.addHalfVertex(i,w,S,x,!0,-p,y),this.distance>p_/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(i,l,h,p,y,x))}addHalfVertex({x:i,y:l},h,p,y,x,w,S){let A=.5*(this.lineClips?this.scaledDistance*(p_-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((i<<1)+(y?1:0),(l<<1)+(x?1:0),Math.round(63*h)+128,Math.round(63*p)+128,1+(w===0?0:w<0?-1:1)|(63&A)<<2,A>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);let z=S.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,z),S.primitiveLength++),x?this.e2=z:this.e1=z}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(i,l){this.distance+=i.dist(l),this.updateScaledDistance()}}dt("LineBucket",T0,{omit:["layers","patternFeatures"]});let DA=new Tr({"line-cap":new vt(ye.layout_line["line-cap"]),"line-join":new Mt(ye.layout_line["line-join"]),"line-miter-limit":new vt(ye.layout_line["line-miter-limit"]),"line-round-limit":new vt(ye.layout_line["line-round-limit"]),"line-sort-key":new Mt(ye.layout_line["line-sort-key"])});var f_={paint:new Tr({"line-opacity":new Mt(ye.paint_line["line-opacity"]),"line-color":new Mt(ye.paint_line["line-color"]),"line-translate":new vt(ye.paint_line["line-translate"]),"line-translate-anchor":new vt(ye.paint_line["line-translate-anchor"]),"line-width":new Mt(ye.paint_line["line-width"]),"line-gap-width":new Mt(ye.paint_line["line-gap-width"]),"line-offset":new Mt(ye.paint_line["line-offset"]),"line-blur":new Mt(ye.paint_line["line-blur"]),"line-dasharray":new vl(ye.paint_line["line-dasharray"]),"line-pattern":new yl(ye.paint_line["line-pattern"]),"line-gradient":new Ch(ye.paint_line["line-gradient"])}),layout:DA};let m_=new class extends Mt{possiblyEvaluate(s,i){return i=new Ui(Math.floor(i.zoom),{now:i.now,fadeDuration:i.fadeDuration,zoomHistory:i.zoomHistory,transition:i.transition}),super.possiblyEvaluate(s,i)}evaluate(s,i,l,h){return i=W({},i,{zoom:Math.floor(i.zoom)}),super.evaluate(s,i,l,h)}}(f_.paint.properties["line-width"].specification);function g_(s,i){return i>0?i+2*s:s}m_.useIntegerZoom=!0;let BA=Ar([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),NA=Ar([{name:"a_projected_pos",components:3,type:"Float32"}],4);Ar([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);let FA=Ar([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);Ar([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);let y_=Ar([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),OA=Ar([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function GA(s,i,l){return s.sections.forEach(h=>{h.text=function(p,y,x){let w=y.layout.get("text-transform").evaluate(x,{});return w==="uppercase"?p=p.toLocaleUpperCase():w==="lowercase"&&(p=p.toLocaleLowerCase()),Zn.applyArabicShaping&&(p=Zn.applyArabicShaping(p)),p}(h.text,i,l)}),s}Ar([{name:"triangle",components:3,type:"Uint16"}]),Ar([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Ar([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Ar([{type:"Float32",name:"offsetX"}]),Ar([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);let Nh={"!":"\uFE15","#":"\uFF03",$:"\uFF04","%":"\uFF05","&":"\uFF06","(":"\uFE35",")":"\uFE36","*":"\uFF0A","+":"\uFF0B",",":"\uFE10","-":"\uFE32",".":"\u30FB","/":"\uFF0F",":":"\uFE13",";":"\uFE14","<":"\uFE3F","=":"\uFF1D",">":"\uFE40","?":"\uFE16","@":"\uFF20","[":"\uFE47","\\":"\uFF3C","]":"\uFE48","^":"\uFF3E",_:"\uFE33","`":"\uFF40","{":"\uFE37","|":"\u2015","}":"\uFE38","~":"\uFF5E","\xA2":"\uFFE0","\xA3":"\uFFE1","\xA5":"\uFFE5","\xA6":"\uFFE4","\xAC":"\uFFE2","\xAF":"\uFFE3","\u2013":"\uFE32","\u2014":"\uFE31","\u2018":"\uFE43","\u2019":"\uFE44","\u201C":"\uFE41","\u201D":"\uFE42","\u2026":"\uFE19","\u2027":"\u30FB","\u20A9":"\uFFE6","\u3001":"\uFE11","\u3002":"\uFE12","\u3008":"\uFE3F","\u3009":"\uFE40","\u300A":"\uFE3D","\u300B":"\uFE3E","\u300C":"\uFE41","\u300D":"\uFE42","\u300E":"\uFE43","\u300F":"\uFE44","\u3010":"\uFE3B","\u3011":"\uFE3C","\u3014":"\uFE39","\u3015":"\uFE3A","\u3016":"\uFE17","\u3017":"\uFE18","\uFF01":"\uFE15","\uFF08":"\uFE35","\uFF09":"\uFE36","\uFF0C":"\uFE10","\uFF0D":"\uFE32","\uFF0E":"\u30FB","\uFF1A":"\uFE13","\uFF1B":"\uFE14","\uFF1C":"\uFE3F","\uFF1E":"\uFE40","\uFF1F":"\uFE16","\uFF3B":"\uFE47","\uFF3D":"\uFE48","\uFF3F":"\uFE33","\uFF5B":"\uFE37","\uFF5C":"\u2015","\uFF5D":"\uFE38","\uFF5F":"\uFE35","\uFF60":"\uFE36","\uFF61":"\uFE12","\uFF62":"\uFE41","\uFF63":"\uFE42"};var Gr=24,A0=Ci,v_=function(s,i,l,h,p){var y,x,w=8*p-h-1,S=(1<<w)-1,A=S>>1,z=-7,R=l?p-1:0,N=l?-1:1,G=s[i+R];for(R+=N,y=G&(1<<-z)-1,G>>=-z,z+=w;z>0;y=256*y+s[i+R],R+=N,z-=8);for(x=y&(1<<-z)-1,y>>=-z,z+=h;z>0;x=256*x+s[i+R],R+=N,z-=8);if(y===0)y=1-A;else{if(y===S)return x?NaN:1/0*(G?-1:1);x+=Math.pow(2,h),y-=A}return(G?-1:1)*x*Math.pow(2,y-h)},x_=function(s,i,l,h,p,y){var x,w,S,A=8*y-p-1,z=(1<<A)-1,R=z>>1,N=p===23?Math.pow(2,-24)-Math.pow(2,-77):0,G=h?0:y-1,Z=h?1:-1,se=i<0||i===0&&1/i<0?1:0;for(i=Math.abs(i),isNaN(i)||i===1/0?(w=isNaN(i)?1:0,x=z):(x=Math.floor(Math.log(i)/Math.LN2),i*(S=Math.pow(2,-x))<1&&(x--,S*=2),(i+=x+R>=1?N/S:N*Math.pow(2,1-R))*S>=2&&(x++,S/=2),x+R>=z?(w=0,x=z):x+R>=1?(w=(i*S-1)*Math.pow(2,p),x+=R):(w=i*Math.pow(2,R-1)*Math.pow(2,p),x=0));p>=8;s[l+G]=255&w,G+=Z,w/=256,p-=8);for(x=x<<p|w,A+=p;A>0;s[l+G]=255&x,G+=Z,x/=256,A-=8);s[l+G-Z]|=128*se};function Ci(s){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(s)?s:new Uint8Array(s||0),this.pos=0,this.type=0,this.length=this.buf.length}Ci.Varint=0,Ci.Fixed64=1,Ci.Bytes=2,Ci.Fixed32=5;var Sa,P0=4294967296,__=1/P0,b_=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function ks(s){return s.type===Ci.Bytes?s.readVarint()+s.pos:s.pos+1}function Bu(s,i,l){return l?4294967296*i+(s>>>0):4294967296*(i>>>0)+(s>>>0)}function w_(s,i,l){var h=i<=16383?1:i<=2097151?2:i<=268435455?3:Math.floor(Math.log(i)/(7*Math.LN2));l.realloc(h);for(var p=l.pos-1;p>=s;p--)l.buf[p+h]=l.buf[p]}function VA(s,i){for(var l=0;l<s.length;l++)i.writeVarint(s[l])}function UA(s,i){for(var l=0;l<s.length;l++)i.writeSVarint(s[l])}function WA(s,i){for(var l=0;l<s.length;l++)i.writeFloat(s[l])}function ZA(s,i){for(var l=0;l<s.length;l++)i.writeDouble(s[l])}function jA(s,i){for(var l=0;l<s.length;l++)i.writeBoolean(s[l])}function HA(s,i){for(var l=0;l<s.length;l++)i.writeFixed32(s[l])}function XA(s,i){for(var l=0;l<s.length;l++)i.writeSFixed32(s[l])}function $A(s,i){for(var l=0;l<s.length;l++)i.writeFixed64(s[l])}function YA(s,i){for(var l=0;l<s.length;l++)i.writeSFixed64(s[l])}function qp(s,i){return(s[i]|s[i+1]<<8|s[i+2]<<16)+16777216*s[i+3]}function Nu(s,i,l){s[l]=i,s[l+1]=i>>>8,s[l+2]=i>>>16,s[l+3]=i>>>24}function I_(s,i){return(s[i]|s[i+1]<<8|s[i+2]<<16)+(s[i+3]<<24)}function qA(s,i,l){s===1&&l.readMessage(JA,i)}function JA(s,i,l){if(s===3){let{id:h,bitmap:p,width:y,height:x,left:w,top:S,advance:A}=l.readMessage(QA,{});i.push({id:h,bitmap:new Ph({width:y+6,height:x+6},p),metrics:{width:y,height:x,left:w,top:S,advance:A}})}}function QA(s,i,l){s===1?i.id=l.readVarint():s===2?i.bitmap=l.readBytes():s===3?i.width=l.readVarint():s===4?i.height=l.readVarint():s===5?i.left=l.readSVarint():s===6?i.top=l.readSVarint():s===7&&(i.advance=l.readVarint())}function S_(s){let i=0,l=0;for(let x of s)i+=x.w*x.h,l=Math.max(l,x.w);s.sort((x,w)=>w.h-x.h);let h=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(i/.95)),l),h:1/0}],p=0,y=0;for(let x of s)for(let w=h.length-1;w>=0;w--){let S=h[w];if(!(x.w>S.w||x.h>S.h)){if(x.x=S.x,x.y=S.y,y=Math.max(y,x.y+x.h),p=Math.max(p,x.x+x.w),x.w===S.w&&x.h===S.h){let A=h.pop();w<h.length&&(h[w]=A)}else x.h===S.h?(S.x+=x.w,S.w-=x.w):x.w===S.w?(S.y+=x.h,S.h-=x.h):(h.push({x:S.x+x.w,y:S.y,w:S.w-x.w,h:x.h}),S.y+=x.h,S.h-=x.h);break}}return{w:p,h:y,fill:i/(p*y)||0}}Ci.prototype={destroy:function(){this.buf=null},readFields:function(s,i,l){for(l=l||this.length;this.pos<l;){var h=this.readVarint(),p=h>>3,y=this.pos;this.type=7&h,s(p,i,this),this.pos===y&&this.skip(h)}return i},readMessage:function(s,i){return this.readFields(s,i,this.readVarint()+this.pos)},readFixed32:function(){var s=qp(this.buf,this.pos);return this.pos+=4,s},readSFixed32:function(){var s=I_(this.buf,this.pos);return this.pos+=4,s},readFixed64:function(){var s=qp(this.buf,this.pos)+qp(this.buf,this.pos+4)*P0;return this.pos+=8,s},readSFixed64:function(){var s=qp(this.buf,this.pos)+I_(this.buf,this.pos+4)*P0;return this.pos+=8,s},readFloat:function(){var s=v_(this.buf,this.pos,!0,23,4);return this.pos+=4,s},readDouble:function(){var s=v_(this.buf,this.pos,!0,52,8);return this.pos+=8,s},readVarint:function(s){var i,l,h=this.buf;return i=127&(l=h[this.pos++]),l<128?i:(i|=(127&(l=h[this.pos++]))<<7,l<128?i:(i|=(127&(l=h[this.pos++]))<<14,l<128?i:(i|=(127&(l=h[this.pos++]))<<21,l<128?i:function(p,y,x){var w,S,A=x.buf;if(w=(112&(S=A[x.pos++]))>>4,S<128||(w|=(127&(S=A[x.pos++]))<<3,S<128)||(w|=(127&(S=A[x.pos++]))<<10,S<128)||(w|=(127&(S=A[x.pos++]))<<17,S<128)||(w|=(127&(S=A[x.pos++]))<<24,S<128)||(w|=(1&(S=A[x.pos++]))<<31,S<128))return Bu(p,w,y);throw new Error("Expected varint not more than 10 bytes")}(i|=(15&(l=h[this.pos]))<<28,s,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var s=this.readVarint();return s%2==1?(s+1)/-2:s/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var s=this.readVarint()+this.pos,i=this.pos;return this.pos=s,s-i>=12&&b_?function(l,h,p){return b_.decode(l.subarray(h,p))}(this.buf,i,s):function(l,h,p){for(var y="",x=h;x<p;){var w,S,A,z=l[x],R=null,N=z>239?4:z>223?3:z>191?2:1;if(x+N>p)break;N===1?z<128&&(R=z):N===2?(192&(w=l[x+1]))==128&&(R=(31&z)<<6|63&w)<=127&&(R=null):N===3?(S=l[x+2],(192&(w=l[x+1]))==128&&(192&S)==128&&((R=(15&z)<<12|(63&w)<<6|63&S)<=2047||R>=55296&&R<=57343)&&(R=null)):N===4&&(S=l[x+2],A=l[x+3],(192&(w=l[x+1]))==128&&(192&S)==128&&(192&A)==128&&((R=(15&z)<<18|(63&w)<<12|(63&S)<<6|63&A)<=65535||R>=1114112)&&(R=null)),R===null?(R=65533,N=1):R>65535&&(R-=65536,y+=String.fromCharCode(R>>>10&1023|55296),R=56320|1023&R),y+=String.fromCharCode(R),x+=N}return y}(this.buf,i,s)},readBytes:function(){var s=this.readVarint()+this.pos,i=this.buf.subarray(this.pos,s);return this.pos=s,i},readPackedVarint:function(s,i){if(this.type!==Ci.Bytes)return s.push(this.readVarint(i));var l=ks(this);for(s=s||[];this.pos<l;)s.push(this.readVarint(i));return s},readPackedSVarint:function(s){if(this.type!==Ci.Bytes)return s.push(this.readSVarint());var i=ks(this);for(s=s||[];this.pos<i;)s.push(this.readSVarint());return s},readPackedBoolean:function(s){if(this.type!==Ci.Bytes)return s.push(this.readBoolean());var i=ks(this);for(s=s||[];this.pos<i;)s.push(this.readBoolean());return s},readPackedFloat:function(s){if(this.type!==Ci.Bytes)return s.push(this.readFloat());var i=ks(this);for(s=s||[];this.pos<i;)s.push(this.readFloat());return s},readPackedDouble:function(s){if(this.type!==Ci.Bytes)return s.push(this.readDouble());var i=ks(this);for(s=s||[];this.pos<i;)s.push(this.readDouble());return s},readPackedFixed32:function(s){if(this.type!==Ci.Bytes)return s.push(this.readFixed32());var i=ks(this);for(s=s||[];this.pos<i;)s.push(this.readFixed32());return s},readPackedSFixed32:function(s){if(this.type!==Ci.Bytes)return s.push(this.readSFixed32());var i=ks(this);for(s=s||[];this.pos<i;)s.push(this.readSFixed32());return s},readPackedFixed64:function(s){if(this.type!==Ci.Bytes)return s.push(this.readFixed64());var i=ks(this);for(s=s||[];this.pos<i;)s.push(this.readFixed64());return s},readPackedSFixed64:function(s){if(this.type!==Ci.Bytes)return s.push(this.readSFixed64());var i=ks(this);for(s=s||[];this.pos<i;)s.push(this.readSFixed64());return s},skip:function(s){var i=7&s;if(i===Ci.Varint)for(;this.buf[this.pos++]>127;);else if(i===Ci.Bytes)this.pos=this.readVarint()+this.pos;else if(i===Ci.Fixed32)this.pos+=4;else{if(i!==Ci.Fixed64)throw new Error("Unimplemented type: "+i);this.pos+=8}},writeTag:function(s,i){this.writeVarint(s<<3|i)},realloc:function(s){for(var i=this.length||16;i<this.pos+s;)i*=2;if(i!==this.length){var l=new Uint8Array(i);l.set(this.buf),this.buf=l,this.length=i}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(s){this.realloc(4),Nu(this.buf,s,this.pos),this.pos+=4},writeSFixed32:function(s){this.realloc(4),Nu(this.buf,s,this.pos),this.pos+=4},writeFixed64:function(s){this.realloc(8),Nu(this.buf,-1&s,this.pos),Nu(this.buf,Math.floor(s*__),this.pos+4),this.pos+=8},writeSFixed64:function(s){this.realloc(8),Nu(this.buf,-1&s,this.pos),Nu(this.buf,Math.floor(s*__),this.pos+4),this.pos+=8},writeVarint:function(s){(s=+s||0)>268435455||s<0?function(i,l){var h,p;if(i>=0?(h=i%4294967296|0,p=i/4294967296|0):(p=~(-i/4294967296),4294967295^(h=~(-i%4294967296))?h=h+1|0:(h=0,p=p+1|0)),i>=18446744073709552e3||i<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");l.realloc(10),function(y,x,w){w.buf[w.pos++]=127&y|128,y>>>=7,w.buf[w.pos++]=127&y|128,y>>>=7,w.buf[w.pos++]=127&y|128,y>>>=7,w.buf[w.pos++]=127&y|128,w.buf[w.pos]=127&(y>>>=7)}(h,0,l),function(y,x){var w=(7&y)<<4;x.buf[x.pos++]|=w|((y>>>=3)?128:0),y&&(x.buf[x.pos++]=127&y|((y>>>=7)?128:0),y&&(x.buf[x.pos++]=127&y|((y>>>=7)?128:0),y&&(x.buf[x.pos++]=127&y|((y>>>=7)?128:0),y&&(x.buf[x.pos++]=127&y|((y>>>=7)?128:0),y&&(x.buf[x.pos++]=127&y)))))}(p,l)}(s,this):(this.realloc(4),this.buf[this.pos++]=127&s|(s>127?128:0),s<=127||(this.buf[this.pos++]=127&(s>>>=7)|(s>127?128:0),s<=127||(this.buf[this.pos++]=127&(s>>>=7)|(s>127?128:0),s<=127||(this.buf[this.pos++]=s>>>7&127))))},writeSVarint:function(s){this.writeVarint(s<0?2*-s-1:2*s)},writeBoolean:function(s){this.writeVarint(Boolean(s))},writeString:function(s){s=String(s),this.realloc(4*s.length),this.pos++;var i=this.pos;this.pos=function(h,p,y){for(var x,w,S=0;S<p.length;S++){if((x=p.charCodeAt(S))>55295&&x<57344){if(!w){x>56319||S+1===p.length?(h[y++]=239,h[y++]=191,h[y++]=189):w=x;continue}if(x<56320){h[y++]=239,h[y++]=191,h[y++]=189,w=x;continue}x=w-55296<<10|x-56320|65536,w=null}else w&&(h[y++]=239,h[y++]=191,h[y++]=189,w=null);x<128?h[y++]=x:(x<2048?h[y++]=x>>6|192:(x<65536?h[y++]=x>>12|224:(h[y++]=x>>18|240,h[y++]=x>>12&63|128),h[y++]=x>>6&63|128),h[y++]=63&x|128)}return y}(this.buf,s,this.pos);var l=this.pos-i;l>=128&&w_(i,l,this),this.pos=i-1,this.writeVarint(l),this.pos+=l},writeFloat:function(s){this.realloc(4),x_(this.buf,s,this.pos,!0,23,4),this.pos+=4},writeDouble:function(s){this.realloc(8),x_(this.buf,s,this.pos,!0,52,8),this.pos+=8},writeBytes:function(s){var i=s.length;this.writeVarint(i),this.realloc(i);for(var l=0;l<i;l++)this.buf[this.pos++]=s[l]},writeRawMessage:function(s,i){this.pos++;var l=this.pos;s(i,this);var h=this.pos-l;h>=128&&w_(l,h,this),this.pos=l-1,this.writeVarint(h),this.pos+=h},writeMessage:function(s,i,l){this.writeTag(s,Ci.Bytes),this.writeRawMessage(i,l)},writePackedVarint:function(s,i){i.length&&this.writeMessage(s,VA,i)},writePackedSVarint:function(s,i){i.length&&this.writeMessage(s,UA,i)},writePackedBoolean:function(s,i){i.length&&this.writeMessage(s,jA,i)},writePackedFloat:function(s,i){i.length&&this.writeMessage(s,WA,i)},writePackedDouble:function(s,i){i.length&&this.writeMessage(s,ZA,i)},writePackedFixed32:function(s,i){i.length&&this.writeMessage(s,HA,i)},writePackedSFixed32:function(s,i){i.length&&this.writeMessage(s,XA,i)},writePackedFixed64:function(s,i){i.length&&this.writeMessage(s,$A,i)},writePackedSFixed64:function(s,i){i.length&&this.writeMessage(s,YA,i)},writeBytesField:function(s,i){this.writeTag(s,Ci.Bytes),this.writeBytes(i)},writeFixed32Field:function(s,i){this.writeTag(s,Ci.Fixed32),this.writeFixed32(i)},writeSFixed32Field:function(s,i){this.writeTag(s,Ci.Fixed32),this.writeSFixed32(i)},writeFixed64Field:function(s,i){this.writeTag(s,Ci.Fixed64),this.writeFixed64(i)},writeSFixed64Field:function(s,i){this.writeTag(s,Ci.Fixed64),this.writeSFixed64(i)},writeVarintField:function(s,i){this.writeTag(s,Ci.Varint),this.writeVarint(i)},writeSVarintField:function(s,i){this.writeTag(s,Ci.Varint),this.writeSVarint(i)},writeStringField:function(s,i){this.writeTag(s,Ci.Bytes),this.writeString(i)},writeFloatField:function(s,i){this.writeTag(s,Ci.Fixed32),this.writeFloat(i)},writeDoubleField:function(s,i){this.writeTag(s,Ci.Fixed64),this.writeDouble(i)},writeBooleanField:function(s,i){this.writeVarintField(s,Boolean(i))}};class k0{constructor(i,{pixelRatio:l,version:h,stretchX:p,stretchY:y,content:x}){this.paddedRect=i,this.pixelRatio=l,this.stretchX=p,this.stretchY=y,this.content=x,this.version=h}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}}class C_{constructor(i,l){let h={},p={};this.haveRenderCallbacks=[];let y=[];this.addImages(i,h,y),this.addImages(l,p,y);let{w:x,h:w}=S_(y),S=new ao({width:x||1,height:w||1});for(let A in i){let z=i[A],R=h[A].paddedRect;ao.copy(z.data,S,{x:0,y:0},{x:R.x+1,y:R.y+1},z.data)}for(let A in l){let z=l[A],R=p[A].paddedRect,N=R.x+1,G=R.y+1,Z=z.data.width,se=z.data.height;ao.copy(z.data,S,{x:0,y:0},{x:N,y:G},z.data),ao.copy(z.data,S,{x:0,y:se-1},{x:N,y:G-1},{width:Z,height:1}),ao.copy(z.data,S,{x:0,y:0},{x:N,y:G+se},{width:Z,height:1}),ao.copy(z.data,S,{x:Z-1,y:0},{x:N-1,y:G},{width:1,height:se}),ao.copy(z.data,S,{x:0,y:0},{x:N+Z,y:G},{width:1,height:se})}this.image=S,this.iconPositions=h,this.patternPositions=p}addImages(i,l,h){for(let p in i){let y=i[p],x={x:0,y:0,w:y.data.width+2,h:y.data.height+2};h.push(x),l[p]=new k0(x,y),y.hasRenderCallback&&this.haveRenderCallbacks.push(p)}}patchUpdatedImages(i,l){i.dispatchRenderCallbacks(this.haveRenderCallbacks);for(let h in i.updatedImages)this.patchUpdatedImage(this.iconPositions[h],i.getImage(h),l),this.patchUpdatedImage(this.patternPositions[h],i.getImage(h),l)}patchUpdatedImage(i,l,h){if(!i||!l||i.version===l.version)return;i.version=l.version;let[p,y]=i.tl;h.update(l.data,void 0,{x:p,y})}}dt("ImagePosition",k0),dt("ImageAtlas",C_),o.WritingMode=void 0,(Sa=o.WritingMode||(o.WritingMode={}))[Sa.none=0]="none",Sa[Sa.horizontal=1]="horizontal",Sa[Sa.vertical=2]="vertical",Sa[Sa.horizontalOnly=3]="horizontalOnly";let Jp=-17;class Fh{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(i,l){let h=new Fh;return h.scale=i||1,h.fontStack=l,h}static forImage(i){let l=new Fh;return l.imageName=i,l}}class Fu{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(i,l){let h=new Fu;for(let p=0;p<i.sections.length;p++){let y=i.sections[p];y.image?h.addImageSection(y):h.addTextSection(y,l)}return h}length(){return this.text.length}getSection(i){return this.sections[this.sectionIndex[i]]}getSectionIndex(i){return this.sectionIndex[i]}getCharCode(i){return this.text.charCodeAt(i)}verticalizePunctuation(){this.text=function(i){let l="";for(let h=0;h<i.length;h++){let p=i.charCodeAt(h+1)||null,y=i.charCodeAt(h-1)||null;l+=p&&Dp(p)&&!Nh[i[h+1]]||y&&Dp(y)&&!Nh[i[h-1]]||!Nh[i[h]]?i[h]:Nh[i[h]]}return l}(this.text)}trim(){let i=0;for(let h=0;h<this.text.length&&Kp[this.text.charCodeAt(h)];h++)i++;let l=this.text.length;for(let h=this.text.length-1;h>=0&&h>=i&&Kp[this.text.charCodeAt(h)];h--)l--;this.text=this.text.substring(i,l),this.sectionIndex=this.sectionIndex.slice(i,l)}substring(i,l){let h=new Fu;return h.text=this.text.substring(i,l),h.sectionIndex=this.sectionIndex.slice(i,l),h.sections=this.sections,h}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((i,l)=>Math.max(i,this.sections[l].scale),0)}addTextSection(i,l){this.text+=i.text,this.sections.push(Fh.forText(i.scale,i.fontStack||l));let h=this.sections.length-1;for(let p=0;p<i.text.length;++p)this.sectionIndex.push(h)}addImageSection(i){let l=i.image?i.image.name:"";if(l.length===0)return void te("Can't add FormattedSection with an empty image.");let h=this.getNextImageSectionCharCode();h?(this.text+=String.fromCharCode(h),this.sections.push(Fh.forImage(l)),this.sectionIndex.push(this.sections.length-1)):te("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Qp(s,i,l,h,p,y,x,w,S,A,z,R,N,G,Z,se){let ae=Fu.fromFeature(s,p),be;R===o.WritingMode.vertical&&ae.verticalizePunctuation();let{processBidirectionalText:Te,processStyledBidirectionalText:Ee}=Zn;if(Te&&ae.sections.length===1){be=[];let Oe=Te(ae.toString(),z0(ae,A,y,i,h,G,Z));for(let pt of Oe){let bt=new Fu;bt.text=pt,bt.sections=ae.sections;for(let nt=0;nt<pt.length;nt++)bt.sectionIndex.push(0);be.push(bt)}}else if(Ee){be=[];let Oe=Ee(ae.text,ae.sectionIndex,z0(ae,A,y,i,h,G,Z));for(let pt of Oe){let bt=new Fu;bt.text=pt[0],bt.sectionIndex=pt[1],bt.sections=ae.sections,be.push(bt)}}else be=function(Oe,pt){let bt=[],nt=Oe.text,ot=0;for(let tt of pt)bt.push(Oe.substring(ot,tt)),ot=tt;return ot<nt.length&&bt.push(Oe.substring(ot,nt.length)),bt}(ae,z0(ae,A,y,i,h,G,Z));let Le=[],We={positionedLines:Le,text:ae.toString(),top:z[1],bottom:z[1],left:z[0],right:z[0],writingMode:R,iconsInText:!1,verticalizable:!1};return function(Oe,pt,bt,nt,ot,tt,ct,st,Ye,Et,wt,Kt){let vi=0,Zi=Jp,ji=0,Xr=0,_r=st==="right"?1:st==="left"?0:.5,br=0;for(let wr of ot){wr.trim();let Yr=wr.getMaxScale(),sn=(Yr-1)*Gr,gn={positionedGlyphs:[],lineOffset:0};Oe.positionedLines[br]=gn;let kn=gn.positionedGlyphs,zn=0;if(!wr.length()){Zi+=tt,++br;continue}for(let Br=0;Br<wr.length();Br++){let $t=wr.getSection(Br),Xn=wr.getSectionIndex(Br),qr=wr.getCharCode(Br),an=0,Co=null,No=null,Fo=null,Ls=Gr,Mo=!(Ye===o.WritingMode.horizontal||!wt&&!gl(qr)||wt&&(Kp[qr]||(Dr=qr,it.Arabic(Dr)||it["Arabic Supplement"](Dr)||it["Arabic Extended-A"](Dr)||it["Arabic Presentation Forms-A"](Dr)||it["Arabic Presentation Forms-B"](Dr))));if($t.imageName){let lo=nt[$t.imageName];if(!lo)continue;Fo=$t.imageName,Oe.iconsInText=Oe.iconsInText||!0,No=lo.paddedRect;let Ln=lo.displaySize;$t.scale=$t.scale*Gr/Kt,Co={width:Ln[0],height:Ln[1],left:1,top:-3,advance:Mo?Ln[1]:Ln[0]},an=sn+(Gr-Ln[1]*$t.scale),Ls=Co.advance;let Rs=Mo?Ln[0]*$t.scale-Gr*Yr:Ln[1]*$t.scale-Gr*Yr;Rs>0&&Rs>zn&&(zn=Rs)}else{let lo=bt[$t.fontStack],Ln=lo&&lo[qr];if(Ln&&Ln.rect)No=Ln.rect,Co=Ln.metrics;else{let Rs=pt[$t.fontStack],Vh=Rs&&Rs[qr];if(!Vh)continue;Co=Vh.metrics}an=(Yr-$t.scale)*Gr}Mo?(Oe.verticalizable=!0,kn.push({glyph:qr,imageName:Fo,x:vi,y:Zi+an,vertical:Mo,scale:$t.scale,fontStack:$t.fontStack,sectionIndex:Xn,metrics:Co,rect:No}),vi+=Ls*$t.scale+Et):(kn.push({glyph:qr,imageName:Fo,x:vi,y:Zi+an,vertical:Mo,scale:$t.scale,fontStack:$t.fontStack,sectionIndex:Xn,metrics:Co,rect:No}),vi+=Co.advance*$t.scale+Et)}kn.length!==0&&(ji=Math.max(vi-Et,ji),t3(kn,0,kn.length-1,_r,zn)),vi=0;let $i=tt*Yr+zn;gn.lineOffset=Math.max(zn,sn),Zi+=$i,Xr=Math.max($i,Xr),++br}var Dr;let $r=Zi-Jp,{horizontalAlign:on,verticalAlign:Pn}=L0(ct);(function(wr,Yr,sn,gn,kn,zn,$i,Br,$t){let Xn=(Yr-sn)*kn,qr=0;qr=zn!==$i?-Br*gn-Jp:(-gn*$t+.5)*$i;for(let an of wr)for(let Co of an.positionedGlyphs)Co.x+=Xn,Co.y+=qr})(Oe.positionedLines,_r,on,Pn,ji,Xr,tt,$r,ot.length),Oe.top+=-Pn*$r,Oe.bottom=Oe.top+$r,Oe.left+=-on*ji,Oe.right=Oe.left+ji}(We,i,l,h,be,x,w,S,R,A,N,se),!function(Oe){for(let pt of Oe)if(pt.positionedGlyphs.length!==0)return!1;return!0}(Le)&&We}let Kp={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},KA={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function M_(s,i,l,h,p,y){if(i.imageName){let x=h[i.imageName];return x?x.displaySize[0]*i.scale*Gr/y+p:0}{let x=l[i.fontStack],w=x&&x[s];return w?w.metrics.advance*i.scale+p:0}}function E_(s,i,l,h){let p=Math.pow(s-i,2);return h?s<i?p/2:2*p:p+Math.abs(l)*l}function e3(s,i,l){let h=0;return s===10&&(h-=1e4),l&&(h+=150),s!==40&&s!==65288||(h+=50),i!==41&&i!==65289||(h+=50),h}function T_(s,i,l,h,p,y){let x=null,w=E_(i,l,p,y);for(let S of h){let A=E_(i-S.x,l,p,y)+S.badness;A<=w&&(x=S,w=A)}return{index:s,x:i,priorBreak:x,badness:w}}function A_(s){return s?A_(s.priorBreak).concat(s.index):[]}function z0(s,i,l,h,p,y,x){if(y!=="point")return[];if(!s)return[];let w=[],S=function(N,G,Z,se,ae,be){let Te=0;for(let Ee=0;Ee<N.length();Ee++){let Le=N.getSection(Ee);Te+=M_(N.getCharCode(Ee),Le,se,ae,G,be)}return Te/Math.max(1,Math.ceil(Te/Z))}(s,i,l,h,p,x),A=s.text.indexOf("\u200B")>=0,z=0;for(let N=0;N<s.length();N++){let G=s.getSection(N),Z=s.getCharCode(N);if(Kp[Z]||(z+=M_(Z,G,h,p,i,x)),N<s.length()-1){let se=!((R=Z)<11904||!(it["Bopomofo Extended"](R)||it.Bopomofo(R)||it["CJK Compatibility Forms"](R)||it["CJK Compatibility Ideographs"](R)||it["CJK Compatibility"](R)||it["CJK Radicals Supplement"](R)||it["CJK Strokes"](R)||it["CJK Symbols and Punctuation"](R)||it["CJK Unified Ideographs Extension A"](R)||it["CJK Unified Ideographs"](R)||it["Enclosed CJK Letters and Months"](R)||it["Halfwidth and Fullwidth Forms"](R)||it.Hiragana(R)||it["Ideographic Description Characters"](R)||it["Kangxi Radicals"](R)||it["Katakana Phonetic Extensions"](R)||it.Katakana(R)||it["Vertical Forms"](R)||it["Yi Radicals"](R)||it["Yi Syllables"](R)));(KA[Z]||se||G.imageName)&&w.push(T_(N+1,z,S,w,e3(Z,s.getCharCode(N+1),se&&A),!1))}}var R;return A_(T_(s.length(),z,S,w,0,!0))}function L0(s){let i=.5,l=.5;switch(s){case"right":case"top-right":case"bottom-right":i=1;break;case"left":case"top-left":case"bottom-left":i=0}switch(s){case"bottom":case"bottom-right":case"bottom-left":l=1;break;case"top":case"top-right":case"top-left":l=0}return{horizontalAlign:i,verticalAlign:l}}function t3(s,i,l,h,p){if(!h&&!p)return;let y=s[l],x=(s[l].x+y.metrics.advance*y.scale)*h;for(let w=i;w<=l;w++)s[w].x-=x,s[w].y+=p}function i3(s,i,l){let{horizontalAlign:h,verticalAlign:p}=L0(l),y=i[0]-s.displaySize[0]*h,x=i[1]-s.displaySize[1]*p;return{image:s,top:x,bottom:x+s.displaySize[1],left:y,right:y+s.displaySize[0]}}function P_(s,i,l,h,p,y){let x=s.image,w;if(x.content){let ae=x.content,be=x.pixelRatio||1;w=[ae[0]/be,ae[1]/be,x.displaySize[0]-ae[2]/be,x.displaySize[1]-ae[3]/be]}let S=i.left*y,A=i.right*y,z,R,N,G;l==="width"||l==="both"?(G=p[0]+S-h[3],R=p[0]+A+h[1]):(G=p[0]+(S+A-x.displaySize[0])/2,R=G+x.displaySize[0]);let Z=i.top*y,se=i.bottom*y;return l==="height"||l==="both"?(z=p[1]+Z-h[0],N=p[1]+se+h[2]):(z=p[1]+(Z+se-x.displaySize[1])/2,N=z+x.displaySize[1]),{image:x,top:z,right:R,bottom:N,left:G,collisionPadding:w}}let zs=128;function k_(s,i){let{expression:l}=i;if(l.kind==="constant")return{kind:"constant",layoutSize:l.evaluate(new Ui(s+1))};if(l.kind==="source")return{kind:"source"};{let{zoomStops:h,interpolationType:p}=l,y=0;for(;y<h.length&&h[y]<=s;)y++;y=Math.max(0,y-1);let x=y;for(;x<h.length&&h[x]<s+1;)x++;x=Math.min(h.length-1,x);let w=h[y],S=h[x];return l.kind==="composite"?{kind:"composite",minZoom:w,maxZoom:S,interpolationType:p}:{kind:"camera",minZoom:w,maxZoom:S,minSize:l.evaluate(new Ui(w)),maxSize:l.evaluate(new Ui(S)),interpolationType:p}}}class Ca extends at{constructor(i,l,h,p){super(i,l),this.angle=h,p!==void 0&&(this.segment=p)}clone(){return new Ca(this.x,this.y,this.angle,this.segment)}}function z_(s,i,l,h,p){if(i.segment===void 0)return!0;let y=i,x=i.segment+1,w=0;for(;w>-l/2;){if(x--,x<0)return!1;w-=s[x].dist(y),y=s[x]}w+=s[x].dist(s[x+1]),x++;let S=[],A=0;for(;w<l/2;){let z=s[x],R=s[x+1];if(!R)return!1;let N=s[x-1].angleTo(z)-z.angleTo(R);for(N=Math.abs((N+3*Math.PI)%(2*Math.PI)-Math.PI),S.push({distance:w,angleDelta:N}),A+=N;w-S[0].distance>h;)A-=S.shift().angleDelta;if(A>p)return!1;x++,w+=z.dist(R)}return!0}function L_(s){let i=0;for(let l=0;l<s.length-1;l++)i+=s[l].dist(s[l+1]);return i}function R_(s,i,l){return s?.6*i*l:0}function D_(s,i){return Math.max(s?s.right-s.left:0,i?i.right-i.left:0)}function r3(s,i,l,h,p,y){let x=R_(l,p,y),w=D_(l,h)*y,S=0,A=L_(s)/2;for(let z=0;z<s.length-1;z++){let R=s[z],N=s[z+1],G=R.dist(N);if(S+G>A){let Z=(A-S)/G,se=vr(R.x,N.x,Z),ae=vr(R.y,N.y,Z),be=new Ca(se,ae,N.angleTo(R),z);return be._round(),!x||z_(s,be,w,x,i)?be:void 0}S+=G}}function n3(s,i,l,h,p,y,x,w,S){let A=R_(h,y,x),z=D_(h,p),R=z*x,N=s[0].x===0||s[0].x===S||s[0].y===0||s[0].y===S;return i-R<i/4&&(i=R+i/4),B_(s,N?i/2*w%i:(z/2+2*y)*x*w%i,i,A,l,R,N,!1,S)}function B_(s,i,l,h,p,y,x,w,S){let A=y/2,z=L_(s),R=0,N=i-l,G=[];for(let Z=0;Z<s.length-1;Z++){let se=s[Z],ae=s[Z+1],be=se.dist(ae),Te=ae.angleTo(se);for(;N+l<R+be;){N+=l;let Ee=(N-R)/be,Le=vr(se.x,ae.x,Ee),We=vr(se.y,ae.y,Ee);if(Le>=0&&Le<S&&We>=0&&We<S&&N-A>=0&&N+A<=z){let Oe=new Ca(Le,We,Te,Z);Oe._round(),h&&!z_(s,Oe,y,h,p)||G.push(Oe)}}R+=be}return w||G.length||x||(G=B_(s,R/2,l,h,p,y,x,!0,S)),G}function N_(s,i,l,h,p){let y=[];for(let x=0;x<s.length;x++){let w=s[x],S;for(let A=0;A<w.length-1;A++){let z=w[A],R=w[A+1];z.x<i&&R.x<i||(z.x<i?z=new at(i,z.y+(i-z.x)/(R.x-z.x)*(R.y-z.y))._round():R.x<i&&(R=new at(i,z.y+(i-z.x)/(R.x-z.x)*(R.y-z.y))._round()),z.y<l&&R.y<l||(z.y<l?z=new at(z.x+(l-z.y)/(R.y-z.y)*(R.x-z.x),l)._round():R.y<l&&(R=new at(z.x+(l-z.y)/(R.y-z.y)*(R.x-z.x),l)._round()),z.x>=h&&R.x>=h||(z.x>=h?z=new at(h,z.y+(h-z.x)/(R.x-z.x)*(R.y-z.y))._round():R.x>=h&&(R=new at(h,z.y+(h-z.x)/(R.x-z.x)*(R.y-z.y))._round()),z.y>=p&&R.y>=p||(z.y>=p?z=new at(z.x+(p-z.y)/(R.y-z.y)*(R.x-z.x),p)._round():R.y>=p&&(R=new at(z.x+(p-z.y)/(R.y-z.y)*(R.x-z.x),p)._round()),S&&z.equals(S[S.length-1])||(S=[z],y.push(S)),S.push(R)))))}}return y}function F_(s,i,l,h){let p=[],y=s.image,x=y.pixelRatio,w=y.paddedRect.w-2,S=y.paddedRect.h-2,A=s.right-s.left,z=s.bottom-s.top,R=y.stretchX||[[0,w]],N=y.stretchY||[[0,S]],G=(tt,ct)=>tt+ct[1]-ct[0],Z=R.reduce(G,0),se=N.reduce(G,0),ae=w-Z,be=S-se,Te=0,Ee=Z,Le=0,We=se,Oe=0,pt=ae,bt=0,nt=be;if(y.content&&h){let tt=y.content;Te=ef(R,0,tt[0]),Le=ef(N,0,tt[1]),Ee=ef(R,tt[0],tt[2]),We=ef(N,tt[1],tt[3]),Oe=tt[0]-Te,bt=tt[1]-Le,pt=tt[2]-tt[0]-Ee,nt=tt[3]-tt[1]-We}let ot=(tt,ct,st,Ye)=>{let Et=tf(tt.stretch-Te,Ee,A,s.left),wt=rf(tt.fixed-Oe,pt,tt.stretch,Z),Kt=tf(ct.stretch-Le,We,z,s.top),vi=rf(ct.fixed-bt,nt,ct.stretch,se),Zi=tf(st.stretch-Te,Ee,A,s.left),ji=rf(st.fixed-Oe,pt,st.stretch,Z),Xr=tf(Ye.stretch-Le,We,z,s.top),_r=rf(Ye.fixed-bt,nt,Ye.stretch,se),br=new at(Et,Kt),Dr=new at(Zi,Kt),$r=new at(Zi,Xr),on=new at(Et,Xr),Pn=new at(wt/x,vi/x),wr=new at(ji/x,_r/x),Yr=i*Math.PI/180;if(Yr){let kn=Math.sin(Yr),zn=Math.cos(Yr),$i=[zn,-kn,kn,zn];br._matMult($i),Dr._matMult($i),on._matMult($i),$r._matMult($i)}let sn=tt.stretch+tt.fixed,gn=ct.stretch+ct.fixed;return{tl:br,tr:Dr,bl:on,br:$r,tex:{x:y.paddedRect.x+1+sn,y:y.paddedRect.y+1+gn,w:st.stretch+st.fixed-sn,h:Ye.stretch+Ye.fixed-gn},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Pn,pixelOffsetBR:wr,minFontScaleX:pt/x/A,minFontScaleY:nt/x/z,isSDF:l}};if(h&&(y.stretchX||y.stretchY)){let tt=O_(R,ae,Z),ct=O_(N,be,se);for(let st=0;st<tt.length-1;st++){let Ye=tt[st],Et=tt[st+1];for(let wt=0;wt<ct.length-1;wt++)p.push(ot(Ye,ct[wt],Et,ct[wt+1]))}}else p.push(ot({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:w+1},{fixed:0,stretch:S+1}));return p}function ef(s,i,l){let h=0;for(let p of s)h+=Math.max(i,Math.min(l,p[1]))-Math.max(i,Math.min(l,p[0]));return h}function O_(s,i,l){let h=[{fixed:-1,stretch:0}];for(let[p,y]of s){let x=h[h.length-1];h.push({fixed:p-x.stretch,stretch:x.stretch}),h.push({fixed:p-x.stretch,stretch:x.stretch+(y-p)})}return h.push({fixed:i+1,stretch:l}),h}function tf(s,i,l,h){return s/i*l+h}function rf(s,i,l,h){return s-i*l/h}dt("Anchor",Ca);class nf{constructor(i,l,h,p,y,x,w,S,A,z){if(this.boxStartIndex=i.length,A){let R=x.top,N=x.bottom,G=x.collisionPadding;G&&(R-=G[1],N+=G[3]);let Z=N-R;Z>0&&(Z=Math.max(10,Z),this.circleDiameter=Z)}else{let R=x.top*w-S,N=x.bottom*w+S,G=x.left*w-S,Z=x.right*w+S,se=x.collisionPadding;if(se&&(G-=se[0]*w,R-=se[1]*w,Z+=se[2]*w,N+=se[3]*w),z){let ae=new at(G,R),be=new at(Z,R),Te=new at(G,N),Ee=new at(Z,N),Le=z*Math.PI/180;ae._rotate(Le),be._rotate(Le),Te._rotate(Le),Ee._rotate(Le),G=Math.min(ae.x,be.x,Te.x,Ee.x),Z=Math.max(ae.x,be.x,Te.x,Ee.x),R=Math.min(ae.y,be.y,Te.y,Ee.y),N=Math.max(ae.y,be.y,Te.y,Ee.y)}i.emplaceBack(l.x,l.y,G,R,Z,N,h,p,y)}this.boxEndIndex=i.length}}class o3{constructor(i=[],l=s3){if(this.data=i,this.length=this.data.length,this.compare=l,this.length>0)for(let h=(this.length>>1)-1;h>=0;h--)this._down(h)}push(i){this.data.push(i),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;let i=this.data[0],l=this.data.pop();return this.length--,this.length>0&&(this.data[0]=l,this._down(0)),i}peek(){return this.data[0]}_up(i){let{data:l,compare:h}=this,p=l[i];for(;i>0;){let y=i-1>>1,x=l[y];if(h(p,x)>=0)break;l[i]=x,i=y}l[i]=p}_down(i){let{data:l,compare:h}=this,p=this.length>>1,y=l[i];for(;i<p;){let x=1+(i<<1),w=l[x],S=x+1;if(S<this.length&&h(l[S],w)<0&&(x=S,w=l[S]),h(w,y)>=0)break;l[i]=w,i=x}l[i]=y}}function s3(s,i){return s<i?-1:s>i?1:0}function a3(s,i=1,l=!1){let h=1/0,p=1/0,y=-1/0,x=-1/0,w=s[0];for(let G=0;G<w.length;G++){let Z=w[G];(!G||Z.x<h)&&(h=Z.x),(!G||Z.y<p)&&(p=Z.y),(!G||Z.x>y)&&(y=Z.x),(!G||Z.y>x)&&(x=Z.y)}let S=Math.min(y-h,x-p),A=S/2,z=new o3([],l3);if(S===0)return new at(h,p);for(let G=h;G<y;G+=S)for(let Z=p;Z<x;Z+=S)z.push(new Ou(G+A,Z+A,A,s));let R=function(G){let Z=0,se=0,ae=0,be=G[0];for(let Te=0,Ee=be.length,Le=Ee-1;Te<Ee;Le=Te++){let We=be[Te],Oe=be[Le],pt=We.x*Oe.y-Oe.x*We.y;se+=(We.x+Oe.x)*pt,ae+=(We.y+Oe.y)*pt,Z+=3*pt}return new Ou(se/Z,ae/Z,0,G)}(s),N=z.length;for(;z.length;){let G=z.pop();(G.d>R.d||!R.d)&&(R=G,l&&console.log("found best %d after %d probes",Math.round(1e4*G.d)/1e4,N)),G.max-R.d<=i||(A=G.h/2,z.push(new Ou(G.p.x-A,G.p.y-A,A,s)),z.push(new Ou(G.p.x+A,G.p.y-A,A,s)),z.push(new Ou(G.p.x-A,G.p.y+A,A,s)),z.push(new Ou(G.p.x+A,G.p.y+A,A,s)),N+=4)}return l&&(console.log(`num probes: ${N}`),console.log(`best distance: ${R.d}`)),R.p}function l3(s,i){return i.max-s.max}function Ou(s,i,l,h){this.p=new at(s,i),this.h=l,this.d=function(p,y){let x=!1,w=1/0;for(let S=0;S<y.length;S++){let A=y[S];for(let z=0,R=A.length,N=R-1;z<R;N=z++){let G=A[z],Z=A[N];G.y>p.y!=Z.y>p.y&&p.x<(Z.x-G.x)*(p.y-G.y)/(Z.y-G.y)+G.x&&(x=!x),w=Math.min(w,qx(p,G,Z))}}return(x?1:-1)*Math.sqrt(w)}(this.p,h),this.max=this.d+this.h*Math.SQRT2}let R0=Number.POSITIVE_INFINITY;function G_(s,i){return i[1]!==R0?function(l,h,p){let y=0,x=0;switch(h=Math.abs(h),p=Math.abs(p),l){case"top-right":case"top-left":case"top":x=p-7;break;case"bottom-right":case"bottom-left":case"bottom":x=7-p}switch(l){case"top-right":case"bottom-right":case"right":y=-h;break;case"top-left":case"bottom-left":case"left":y=h}return[y,x]}(s,i[0],i[1]):function(l,h){let p=0,y=0;h<0&&(h=0);let x=h/Math.sqrt(2);switch(l){case"top-right":case"top-left":y=x-7;break;case"bottom-right":case"bottom-left":y=7-x;break;case"bottom":y=7-h;break;case"top":y=h-7}switch(l){case"top-right":case"bottom-right":p=-x;break;case"top-left":case"bottom-left":p=x;break;case"left":p=h;break;case"right":p=-h}return[p,y]}(s,i[0])}function D0(s){switch(s){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function u3(s,i,l,h,p,y,x,w,S,A,z){let R=y.textMaxSize.evaluate(i,{});R===void 0&&(R=x);let N=s.layers[0].layout,G=N.get("icon-offset").evaluate(i,{},z),Z=U_(l.horizontal),se=x/24,ae=s.tilePixelRatio*se,be=s.tilePixelRatio*R/24,Te=s.tilePixelRatio*w,Ee=s.tilePixelRatio*N.get("symbol-spacing"),Le=N.get("text-padding")*s.tilePixelRatio,We=N.get("icon-padding")*s.tilePixelRatio,Oe=N.get("text-max-angle")/180*Math.PI,pt=N.get("text-rotation-alignment")!=="viewport"&&N.get("symbol-placement")!=="point",bt=N.get("icon-rotation-alignment")==="map"&&N.get("symbol-placement")!=="point",nt=N.get("symbol-placement"),ot=Ee/2,tt=N.get("icon-text-fit"),ct;h&&tt!=="none"&&(s.allowVerticalPlacement&&l.vertical&&(ct=P_(h,l.vertical,tt,N.get("icon-text-fit-padding"),G,se)),Z&&(h=P_(h,Z,tt,N.get("icon-text-fit-padding"),G,se)));let st=(Ye,Et)=>{Et.x<0||Et.x>=Pr||Et.y<0||Et.y>=Pr||function(wt,Kt,vi,Zi,ji,Xr,_r,br,Dr,$r,on,Pn,wr,Yr,sn,gn,kn,zn,$i,Br,$t,Xn,qr,an,Co){let No=wt.addToLineVertexArray(Kt,vi),Fo,Ls,Mo,lo,Ln=0,Rs=0,Vh=0,nb=0,j0=-1,H0=-1,Ds={},ob=Mh(""),X0=0,$0=0;if(br._unevaluatedLayout.getValue("text-radial-offset")===void 0?[X0,$0]=br.layout.get("text-offset").evaluate($t,{},an).map(Rn=>Rn*Gr):(X0=br.layout.get("text-radial-offset").evaluate($t,{},an)*Gr,$0=R0),wt.allowVerticalPlacement&&Zi.vertical){let Rn=br.layout.get("text-rotate").evaluate($t,{},an)+90;Mo=new nf(Dr,Kt,$r,on,Pn,Zi.vertical,wr,Yr,sn,Rn),_r&&(lo=new nf(Dr,Kt,$r,on,Pn,_r,kn,zn,sn,Rn))}if(ji){let Rn=br.layout.get("icon-rotate").evaluate($t,{}),rs=br.layout.get("icon-text-fit")!=="none",Uh=F_(ji,Rn,qr,rs),Wh=_r?F_(_r,Rn,qr,rs):void 0;Ls=new nf(Dr,Kt,$r,on,Pn,ji,kn,zn,!1,Rn),Ln=4*Uh.length;let lb=wt.iconSizeData,Cl=null;lb.kind==="source"?(Cl=[zs*br.layout.get("icon-size").evaluate($t,{})],Cl[0]>Ma&&te(`${wt.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):lb.kind==="composite"&&(Cl=[zs*Xn.compositeIconSizes[0].evaluate($t,{},an),zs*Xn.compositeIconSizes[1].evaluate($t,{},an)],(Cl[0]>Ma||Cl[1]>Ma)&&te(`${wt.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),wt.addSymbols(wt.icon,Uh,Cl,Br,$i,$t,o.WritingMode.none,Kt,No.lineStartIndex,No.lineLength,-1,an),j0=wt.icon.placedSymbolArray.length-1,Wh&&(Rs=4*Wh.length,wt.addSymbols(wt.icon,Wh,Cl,Br,$i,$t,o.WritingMode.vertical,Kt,No.lineStartIndex,No.lineLength,-1,an),H0=wt.icon.placedSymbolArray.length-1)}let sb=Object.keys(Zi.horizontal);for(let Rn of sb){let rs=Zi.horizontal[Rn];if(!Fo){ob=Mh(rs.text);let Wh=br.layout.get("text-rotate").evaluate($t,{},an);Fo=new nf(Dr,Kt,$r,on,Pn,rs,wr,Yr,sn,Wh)}let Uh=rs.positionedLines.length===1;if(Vh+=V_(wt,Kt,rs,Xr,br,sn,$t,gn,No,Zi.vertical?o.WritingMode.horizontal:o.WritingMode.horizontalOnly,Uh?sb:[Rn],Ds,j0,Xn,an),Uh)break}Zi.vertical&&(nb+=V_(wt,Kt,Zi.vertical,Xr,br,sn,$t,gn,No,o.WritingMode.vertical,["vertical"],Ds,H0,Xn,an));let w3=Fo?Fo.boxStartIndex:wt.collisionBoxArray.length,I3=Fo?Fo.boxEndIndex:wt.collisionBoxArray.length,S3=Mo?Mo.boxStartIndex:wt.collisionBoxArray.length,C3=Mo?Mo.boxEndIndex:wt.collisionBoxArray.length,M3=Ls?Ls.boxStartIndex:wt.collisionBoxArray.length,E3=Ls?Ls.boxEndIndex:wt.collisionBoxArray.length,T3=lo?lo.boxStartIndex:wt.collisionBoxArray.length,A3=lo?lo.boxEndIndex:wt.collisionBoxArray.length,Oo=-1,uf=(Rn,rs)=>Rn&&Rn.circleDiameter?Math.max(Rn.circleDiameter,rs):rs;Oo=uf(Fo,Oo),Oo=uf(Mo,Oo),Oo=uf(Ls,Oo),Oo=uf(lo,Oo);let ab=Oo>-1?1:0;ab&&(Oo*=Co/Gr),wt.glyphOffsetArray.length>=Gu.MAX_GLYPHS&&te("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),$t.sortKey!==void 0&&wt.addToSortKeyRanges(wt.symbolInstances.length,$t.sortKey),wt.symbolInstances.emplaceBack(Kt.x,Kt.y,Ds.right>=0?Ds.right:-1,Ds.center>=0?Ds.center:-1,Ds.left>=0?Ds.left:-1,Ds.vertical||-1,j0,H0,ob,w3,I3,S3,C3,M3,E3,T3,A3,$r,Vh,nb,Ln,Rs,ab,0,wr,X0,$0,Oo)}(s,Et,Ye,l,h,p,ct,s.layers[0],s.collisionBoxArray,i.index,i.sourceLayerIndex,s.index,ae,Le,pt,S,Te,We,bt,G,i,y,A,z,x)};if(nt==="line")for(let Ye of N_(i.geometry,0,0,Pr,Pr)){let Et=n3(Ye,Ee,Oe,l.vertical||Z,h,24,be,s.overscaling,Pr);for(let wt of Et){let Kt=Z;Kt&&c3(s,Kt.text,ot,wt)||st(Ye,wt)}}else if(nt==="line-center"){for(let Ye of i.geometry)if(Ye.length>1){let Et=r3(Ye,Oe,l.vertical||Z,h,24,be);Et&&st(Ye,Et)}}else if(i.type==="Polygon")for(let Ye of w0(i.geometry,0)){let Et=a3(Ye,16);st(Ye[0],new Ca(Et.x,Et.y,0))}else if(i.type==="LineString")for(let Ye of i.geometry)st(Ye,new Ca(Ye[0].x,Ye[0].y,0));else if(i.type==="Point")for(let Ye of i.geometry)for(let Et of Ye)st([Et],new Ca(Et.x,Et.y,0))}let Ma=32640;function V_(s,i,l,h,p,y,x,w,S,A,z,R,N,G,Z){let se=function(Te,Ee,Le,We,Oe,pt,bt,nt){let ot=We.layout.get("text-rotate").evaluate(pt,{})*Math.PI/180,tt=[];for(let ct of Ee.positionedLines)for(let st of ct.positionedGlyphs){if(!st.rect)continue;let Ye=st.rect||{},Et=4,wt=!0,Kt=1,vi=0,Zi=(Oe||nt)&&st.vertical,ji=st.metrics.advance*st.scale/2;if(nt&&Ee.verticalizable){let $i=(st.scale-1)*Gr,Br=(Gr-st.metrics.width*st.scale)/2;vi=ct.lineOffset/2-(st.imageName?-Br:$i)}if(st.imageName){let $i=bt[st.imageName];wt=$i.sdf,Kt=$i.pixelRatio,Et=1/Kt}let Xr=Oe?[st.x+ji,st.y]:[0,0],_r=Oe?[0,0]:[st.x+ji+Le[0],st.y+Le[1]-vi],br=[0,0];Zi&&(br=_r,_r=[0,0]);let Dr=(st.metrics.left-Et)*st.scale-ji+_r[0],$r=(-st.metrics.top-Et)*st.scale+_r[1],on=Dr+Ye.w*st.scale/Kt,Pn=$r+Ye.h*st.scale/Kt,wr=new at(Dr,$r),Yr=new at(on,$r),sn=new at(Dr,Pn),gn=new at(on,Pn);if(Zi){let $i=new at(-ji,ji-Jp),Br=-Math.PI/2,$t=12-ji,Xn=new at(22-$t,-(st.imageName?$t:0)),qr=new at(...br);wr._rotateAround(Br,$i)._add(Xn)._add(qr),Yr._rotateAround(Br,$i)._add(Xn)._add(qr),sn._rotateAround(Br,$i)._add(Xn)._add(qr),gn._rotateAround(Br,$i)._add(Xn)._add(qr)}if(ot){let $i=Math.sin(ot),Br=Math.cos(ot),$t=[Br,-$i,$i,Br];wr._matMult($t),Yr._matMult($t),sn._matMult($t),gn._matMult($t)}let kn=new at(0,0),zn=new at(0,0);tt.push({tl:wr,tr:Yr,bl:sn,br:gn,tex:Ye,writingMode:Ee.writingMode,glyphOffset:Xr,sectionIndex:st.sectionIndex,isSDF:wt,pixelOffsetTL:kn,pixelOffsetBR:zn,minFontScaleX:0,minFontScaleY:0})}return tt}(0,l,w,p,y,x,h,s.allowVerticalPlacement),ae=s.textSizeData,be=null;ae.kind==="source"?(be=[zs*p.layout.get("text-size").evaluate(x,{})],be[0]>Ma&&te(`${s.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):ae.kind==="composite"&&(be=[zs*G.compositeTextSizes[0].evaluate(x,{},Z),zs*G.compositeTextSizes[1].evaluate(x,{},Z)],(be[0]>Ma||be[1]>Ma)&&te(`${s.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),s.addSymbols(s.text,se,be,w,y,x,A,i,S.lineStartIndex,S.lineLength,N,Z);for(let Te of z)R[Te]=s.text.placedSymbolArray.length-1;return 4*se.length}function U_(s){for(let i in s)return s[i];return null}function c3(s,i,l,h){let p=s.compareText;if(i in p){let y=p[i];for(let x=y.length-1;x>=0;x--)if(h.dist(y[x])<l)return!0}else p[i]=[];return p[i].push(h),!1}let h3=Ia.VectorTileFeature.types,d3=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function of(s,i,l,h,p,y,x,w,S,A,z,R,N){let G=w?Math.min(Ma,Math.round(w[0])):0,Z=w?Math.min(Ma,Math.round(w[1])):0;s.emplaceBack(i,l,Math.round(32*h),Math.round(32*p),y,x,(G<<1)+(S?1:0),Z,16*A,16*z,256*R,256*N)}function B0(s,i,l){s.emplaceBack(i.x,i.y,l),s.emplaceBack(i.x,i.y,l),s.emplaceBack(i.x,i.y,l),s.emplaceBack(i.x,i.y,l)}function p3(s){for(let i of s.sections)if(a0(i.text))return!0;return!1}class N0{constructor(i){this.layoutVertexArray=new Or,this.indexArray=new mn,this.programConfigurations=i,this.segments=new li,this.dynamicLayoutVertexArray=new Tn,this.opacityVertexArray=new jn,this.placedSymbolArray=new je}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(i,l,h,p){this.isEmpty()||(h&&(this.layoutVertexBuffer=i.createVertexBuffer(this.layoutVertexArray,BA.members),this.indexBuffer=i.createIndexBuffer(this.indexArray,l),this.dynamicLayoutVertexBuffer=i.createVertexBuffer(this.dynamicLayoutVertexArray,NA.members,!0),this.opacityVertexBuffer=i.createVertexBuffer(this.opacityVertexArray,d3,!0),this.opacityVertexBuffer.itemSize=1),(h||p)&&this.programConfigurations.upload(i))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}dt("SymbolBuffers",N0);class F0{constructor(i,l,h){this.layoutVertexArray=new i,this.layoutAttributes=l,this.indexArray=new h,this.segments=new li,this.collisionVertexArray=new is}upload(i){this.layoutVertexBuffer=i.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=i.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=i.createVertexBuffer(this.collisionVertexArray,FA.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}dt("CollisionBuffers",F0);class Gu{constructor(i){this.collisionBoxArray=i.collisionBoxArray,this.zoom=i.zoom,this.overscaling=i.overscaling,this.layers=i.layers,this.layerIds=this.layers.map(x=>x.id),this.index=i.index,this.pixelRatio=i.pixelRatio,this.sourceLayerIndex=i.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=m0([]),this.placementViewportMatrix=m0([]);let l=this.layers[0]._unevaluatedLayout._values;this.textSizeData=k_(this.zoom,l["text-size"]),this.iconSizeData=k_(this.zoom,l["icon-size"]);let h=this.layers[0].layout,p=h.get("symbol-sort-key"),y=h.get("symbol-z-order");this.canOverlap=G0(h,"text-overlap","text-allow-overlap")!=="never"||G0(h,"icon-overlap","icon-allow-overlap")!=="never"||h.get("text-ignore-placement")||h.get("icon-ignore-placement"),this.sortFeaturesByKey=y!=="viewport-y"&&!p.isConstant(),this.sortFeaturesByY=(y==="viewport-y"||y==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,h.get("symbol-placement")==="point"&&(this.writingModes=h.get("text-writing-mode").map(x=>o.WritingMode[x])),this.stateDependentLayerIds=this.layers.filter(x=>x.isStateDependent()).map(x=>x.id),this.sourceID=i.sourceID}createArrays(){this.text=new N0(new bl(this.layers,this.zoom,i=>/^text/.test(i))),this.icon=new N0(new bl(this.layers,this.zoom,i=>/^icon/.test(i))),this.glyphOffsetArray=new mt,this.lineVertexArray=new rt,this.symbolInstances=new De}calculateGlyphDependencies(i,l,h,p,y){for(let x=0;x<i.length;x++)if(l[i.charCodeAt(x)]=!0,(h||p)&&y){let w=Nh[i.charAt(x)];w&&(l[w.charCodeAt(0)]=!0)}}populate(i,l,h){let p=this.layers[0],y=p.layout,x=y.get("text-font"),w=y.get("text-field"),S=y.get("icon-image"),A=(w.value.kind!=="constant"||w.value.value instanceof re&&!w.value.value.isEmpty()||w.value.value.toString().length>0)&&(x.value.kind!=="constant"||x.value.value.length>0),z=S.value.kind!=="constant"||!!S.value.value||Object.keys(S.parameters).length>0,R=y.get("symbol-sort-key");if(this.features=[],!A&&!z)return;let N=l.iconDependencies,G=l.glyphDependencies,Z=l.availableImages,se=new Ui(this.zoom);for(let{feature:ae,id:be,index:Te,sourceLayerIndex:Ee}of i){let Le=p._featureFilter.needGeometry,We=Il(ae,Le);if(!p._featureFilter.filter(se,We,h))continue;let Oe,pt;if(Le||(We.geometry=wl(ae)),A){let nt=p.getValueAndResolveTokens("text-field",We,h,Z),ot=re.factory(nt);p3(ot)&&(this.hasRTLText=!0),(!this.hasRTLText||Ih()==="unavailable"||this.hasRTLText&&Zn.isParsed())&&(Oe=GA(ot,p,We))}if(z){let nt=p.getValueAndResolveTokens("icon-image",We,h,Z);pt=nt instanceof pe?nt:pe.fromString(nt)}if(!Oe&&!pt)continue;let bt=this.sortFeaturesByKey?R.evaluate(We,{},h):void 0;if(this.features.push({id:be,text:Oe,icon:pt,index:Te,sourceLayerIndex:Ee,geometry:We.geometry,properties:ae.properties,type:h3[ae.type],sortKey:bt}),pt&&(N[pt.name]=!0),Oe){let nt=x.evaluate(We,{},h).join(","),ot=y.get("text-rotation-alignment")!=="viewport"&&y.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(o.WritingMode.vertical)>=0;for(let tt of Oe.sections)if(tt.image)N[tt.image.name]=!0;else{let ct=vh(Oe.toString()),st=tt.fontStack||nt,Ye=G[st]=G[st]||{};this.calculateGlyphDependencies(tt.text,Ye,ot,this.allowVerticalPlacement,ct)}}}y.get("symbol-placement")==="line"&&(this.features=function(ae){let be={},Te={},Ee=[],Le=0;function We(nt){Ee.push(ae[nt]),Le++}function Oe(nt,ot,tt){let ct=Te[nt];return delete Te[nt],Te[ot]=ct,Ee[ct].geometry[0].pop(),Ee[ct].geometry[0]=Ee[ct].geometry[0].concat(tt[0]),ct}function pt(nt,ot,tt){let ct=be[ot];return delete be[ot],be[nt]=ct,Ee[ct].geometry[0].shift(),Ee[ct].geometry[0]=tt[0].concat(Ee[ct].geometry[0]),ct}function bt(nt,ot,tt){let ct=tt?ot[0][ot[0].length-1]:ot[0][0];return`${nt}:${ct.x}:${ct.y}`}for(let nt=0;nt<ae.length;nt++){let ot=ae[nt],tt=ot.geometry,ct=ot.text?ot.text.toString():null;if(!ct){We(nt);continue}let st=bt(ct,tt),Ye=bt(ct,tt,!0);if(st in Te&&Ye in be&&Te[st]!==be[Ye]){let Et=pt(st,Ye,tt),wt=Oe(st,Ye,Ee[Et].geometry);delete be[st],delete Te[Ye],Te[bt(ct,Ee[wt].geometry,!0)]=wt,Ee[Et].geometry=null}else st in Te?Oe(st,Ye,tt):Ye in be?pt(st,Ye,tt):(We(nt),be[st]=Le-1,Te[Ye]=Le-1)}return Ee.filter(nt=>nt.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((ae,be)=>ae.sortKey-be.sortKey)}update(i,l,h){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(i,l,this.layers,h),this.icon.programConfigurations.updatePaintArrays(i,l,this.layers,h))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(i){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(i),this.iconCollisionBox.upload(i)),this.text.upload(i,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(i,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(i,l){let h=this.lineVertexArray.length;if(i.segment!==void 0){let p=i.dist(l[i.segment+1]),y=i.dist(l[i.segment]),x={};for(let w=i.segment+1;w<l.length;w++)x[w]={x:l[w].x,y:l[w].y,tileUnitDistanceFromAnchor:p},w<l.length-1&&(p+=l[w+1].dist(l[w]));for(let w=i.segment||0;w>=0;w--)x[w]={x:l[w].x,y:l[w].y,tileUnitDistanceFromAnchor:y},w>0&&(y+=l[w-1].dist(l[w]));for(let w=0;w<l.length;w++){let S=x[w];this.lineVertexArray.emplaceBack(S.x,S.y,S.tileUnitDistanceFromAnchor)}}return{lineStartIndex:h,lineLength:this.lineVertexArray.length-h}}addSymbols(i,l,h,p,y,x,w,S,A,z,R,N){let G=i.indexArray,Z=i.layoutVertexArray,se=i.segments.prepareSegment(4*l.length,Z,G,this.canOverlap?x.sortKey:void 0),ae=this.glyphOffsetArray.length,be=se.vertexLength,Te=this.allowVerticalPlacement&&w===o.WritingMode.vertical?Math.PI/2:0,Ee=x.text&&x.text.sections;for(let Le=0;Le<l.length;Le++){let{tl:We,tr:Oe,bl:pt,br:bt,tex:nt,pixelOffsetTL:ot,pixelOffsetBR:tt,minFontScaleX:ct,minFontScaleY:st,glyphOffset:Ye,isSDF:Et,sectionIndex:wt}=l[Le],Kt=se.vertexLength,vi=Ye[1];of(Z,S.x,S.y,We.x,vi+We.y,nt.x,nt.y,h,Et,ot.x,ot.y,ct,st),of(Z,S.x,S.y,Oe.x,vi+Oe.y,nt.x+nt.w,nt.y,h,Et,tt.x,ot.y,ct,st),of(Z,S.x,S.y,pt.x,vi+pt.y,nt.x,nt.y+nt.h,h,Et,ot.x,tt.y,ct,st),of(Z,S.x,S.y,bt.x,vi+bt.y,nt.x+nt.w,nt.y+nt.h,h,Et,tt.x,tt.y,ct,st),B0(i.dynamicLayoutVertexArray,S,Te),G.emplaceBack(Kt,Kt+1,Kt+2),G.emplaceBack(Kt+1,Kt+2,Kt+3),se.vertexLength+=4,se.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(Ye[0]),Le!==l.length-1&&wt===l[Le+1].sectionIndex||i.programConfigurations.populatePaintArrays(Z.length,x,x.index,{},N,Ee&&Ee[wt])}i.placedSymbolArray.emplaceBack(S.x,S.y,ae,this.glyphOffsetArray.length-ae,be,A,z,S.segment,h?h[0]:0,h?h[1]:0,p[0],p[1],w,0,!1,0,R)}_addCollisionDebugVertex(i,l,h,p,y,x){return l.emplaceBack(0,0),i.emplaceBack(h.x,h.y,p,y,Math.round(x.x),Math.round(x.y))}addCollisionDebugVertices(i,l,h,p,y,x,w){let S=y.segments.prepareSegment(4,y.layoutVertexArray,y.indexArray),A=S.vertexLength,z=y.layoutVertexArray,R=y.collisionVertexArray,N=w.anchorX,G=w.anchorY;this._addCollisionDebugVertex(z,R,x,N,G,new at(i,l)),this._addCollisionDebugVertex(z,R,x,N,G,new at(h,l)),this._addCollisionDebugVertex(z,R,x,N,G,new at(h,p)),this._addCollisionDebugVertex(z,R,x,N,G,new at(i,p)),S.vertexLength+=4;let Z=y.indexArray;Z.emplaceBack(A,A+1),Z.emplaceBack(A+1,A+2),Z.emplaceBack(A+2,A+3),Z.emplaceBack(A+3,A),S.primitiveLength+=4}addDebugCollisionBoxes(i,l,h,p){for(let y=i;y<l;y++){let x=this.collisionBoxArray.get(y);this.addCollisionDebugVertices(x.x1,x.y1,x.x2,x.y2,p?this.textCollisionBox:this.iconCollisionBox,x.anchorPoint,h)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new F0(Hn,y_.members,bo),this.iconCollisionBox=new F0(Hn,y_.members,bo);for(let i=0;i<this.symbolInstances.length;i++){let l=this.symbolInstances.get(i);this.addDebugCollisionBoxes(l.textBoxStartIndex,l.textBoxEndIndex,l,!0),this.addDebugCollisionBoxes(l.verticalTextBoxStartIndex,l.verticalTextBoxEndIndex,l,!0),this.addDebugCollisionBoxes(l.iconBoxStartIndex,l.iconBoxEndIndex,l,!1),this.addDebugCollisionBoxes(l.verticalIconBoxStartIndex,l.verticalIconBoxEndIndex,l,!1)}}_deserializeCollisionBoxesForSymbol(i,l,h,p,y,x,w,S,A){let z={};for(let R=l;R<h;R++){let N=i.get(R);z.textBox={x1:N.x1,y1:N.y1,x2:N.x2,y2:N.y2,anchorPointX:N.anchorPointX,anchorPointY:N.anchorPointY},z.textFeatureIndex=N.featureIndex;break}for(let R=p;R<y;R++){let N=i.get(R);z.verticalTextBox={x1:N.x1,y1:N.y1,x2:N.x2,y2:N.y2,anchorPointX:N.anchorPointX,anchorPointY:N.anchorPointY},z.verticalTextFeatureIndex=N.featureIndex;break}for(let R=x;R<w;R++){let N=i.get(R);z.iconBox={x1:N.x1,y1:N.y1,x2:N.x2,y2:N.y2,anchorPointX:N.anchorPointX,anchorPointY:N.anchorPointY},z.iconFeatureIndex=N.featureIndex;break}for(let R=S;R<A;R++){let N=i.get(R);z.verticalIconBox={x1:N.x1,y1:N.y1,x2:N.x2,y2:N.y2,anchorPointX:N.anchorPointX,anchorPointY:N.anchorPointY},z.verticalIconFeatureIndex=N.featureIndex;break}return z}deserializeCollisionBoxes(i){this.collisionArrays=[];for(let l=0;l<this.symbolInstances.length;l++){let h=this.symbolInstances.get(l);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(i,h.textBoxStartIndex,h.textBoxEndIndex,h.verticalTextBoxStartIndex,h.verticalTextBoxEndIndex,h.iconBoxStartIndex,h.iconBoxEndIndex,h.verticalIconBoxStartIndex,h.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(i,l){let h=i.placedSymbolArray.get(l),p=h.vertexStartIndex+4*h.numGlyphs;for(let y=h.vertexStartIndex;y<p;y+=4)i.indexArray.emplaceBack(y,y+1,y+2),i.indexArray.emplaceBack(y+1,y+2,y+3)}getSortedSymbolIndexes(i){if(this.sortedAngle===i&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;let l=Math.sin(i),h=Math.cos(i),p=[],y=[],x=[];for(let w=0;w<this.symbolInstances.length;++w){x.push(w);let S=this.symbolInstances.get(w);p.push(0|Math.round(l*S.anchorX+h*S.anchorY)),y.push(S.featureIndex)}return x.sort((w,S)=>p[w]-p[S]||y[S]-y[w]),x}addToSortKeyRanges(i,l){let h=this.sortKeyRanges[this.sortKeyRanges.length-1];h&&h.sortKey===l?h.symbolInstanceEnd=i+1:this.sortKeyRanges.push({sortKey:l,symbolInstanceStart:i,symbolInstanceEnd:i+1})}sortFeatures(i){if(this.sortFeaturesByY&&this.sortedAngle!==i&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(i),this.sortedAngle=i,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let l of this.symbolInstanceIndexes){let h=this.symbolInstances.get(l);this.featureSortOrder.push(h.featureIndex),[h.rightJustifiedTextSymbolIndex,h.centerJustifiedTextSymbolIndex,h.leftJustifiedTextSymbolIndex].forEach((p,y,x)=>{p>=0&&x.indexOf(p)===y&&this.addIndicesForPlacedSymbol(this.text,p)}),h.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,h.verticalPlacedTextSymbolIndex),h.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,h.placedIconSymbolIndex),h.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,h.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}dt("SymbolBucket",Gu,{omit:["layers","collisionBoxArray","features","compareText"]}),Gu.MAX_GLYPHS=65535,Gu.addDynamicAttributes=B0;let f3=new Tr({"symbol-placement":new vt(ye.layout_symbol["symbol-placement"]),"symbol-spacing":new vt(ye.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new vt(ye.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Mt(ye.layout_symbol["symbol-sort-key"]),"symbol-z-order":new vt(ye.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new vt(ye.layout_symbol["icon-allow-overlap"]),"icon-overlap":new vt(ye.layout_symbol["icon-overlap"]),"icon-ignore-placement":new vt(ye.layout_symbol["icon-ignore-placement"]),"icon-optional":new vt(ye.layout_symbol["icon-optional"]),"icon-rotation-alignment":new vt(ye.layout_symbol["icon-rotation-alignment"]),"icon-size":new Mt(ye.layout_symbol["icon-size"]),"icon-text-fit":new vt(ye.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new vt(ye.layout_symbol["icon-text-fit-padding"]),"icon-image":new Mt(ye.layout_symbol["icon-image"]),"icon-rotate":new Mt(ye.layout_symbol["icon-rotate"]),"icon-padding":new vt(ye.layout_symbol["icon-padding"]),"icon-keep-upright":new vt(ye.layout_symbol["icon-keep-upright"]),"icon-offset":new Mt(ye.layout_symbol["icon-offset"]),"icon-anchor":new Mt(ye.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new vt(ye.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new vt(ye.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new vt(ye.layout_symbol["text-rotation-alignment"]),"text-field":new Mt(ye.layout_symbol["text-field"]),"text-font":new Mt(ye.layout_symbol["text-font"]),"text-size":new Mt(ye.layout_symbol["text-size"]),"text-max-width":new Mt(ye.layout_symbol["text-max-width"]),"text-line-height":new vt(ye.layout_symbol["text-line-height"]),"text-letter-spacing":new Mt(ye.layout_symbol["text-letter-spacing"]),"text-justify":new Mt(ye.layout_symbol["text-justify"]),"text-radial-offset":new Mt(ye.layout_symbol["text-radial-offset"]),"text-variable-anchor":new vt(ye.layout_symbol["text-variable-anchor"]),"text-anchor":new Mt(ye.layout_symbol["text-anchor"]),"text-max-angle":new vt(ye.layout_symbol["text-max-angle"]),"text-writing-mode":new vt(ye.layout_symbol["text-writing-mode"]),"text-rotate":new Mt(ye.layout_symbol["text-rotate"]),"text-padding":new vt(ye.layout_symbol["text-padding"]),"text-keep-upright":new vt(ye.layout_symbol["text-keep-upright"]),"text-transform":new Mt(ye.layout_symbol["text-transform"]),"text-offset":new Mt(ye.layout_symbol["text-offset"]),"text-allow-overlap":new vt(ye.layout_symbol["text-allow-overlap"]),"text-overlap":new vt(ye.layout_symbol["text-overlap"]),"text-ignore-placement":new vt(ye.layout_symbol["text-ignore-placement"]),"text-optional":new vt(ye.layout_symbol["text-optional"])});var O0={paint:new Tr({"icon-opacity":new Mt(ye.paint_symbol["icon-opacity"]),"icon-color":new Mt(ye.paint_symbol["icon-color"]),"icon-halo-color":new Mt(ye.paint_symbol["icon-halo-color"]),"icon-halo-width":new Mt(ye.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Mt(ye.paint_symbol["icon-halo-blur"]),"icon-translate":new vt(ye.paint_symbol["icon-translate"]),"icon-translate-anchor":new vt(ye.paint_symbol["icon-translate-anchor"]),"text-opacity":new Mt(ye.paint_symbol["text-opacity"]),"text-color":new Mt(ye.paint_symbol["text-color"],{runtimeType:ni,getOverride:s=>s.textColor,hasOverride:s=>!!s.textColor}),"text-halo-color":new Mt(ye.paint_symbol["text-halo-color"]),"text-halo-width":new Mt(ye.paint_symbol["text-halo-width"]),"text-halo-blur":new Mt(ye.paint_symbol["text-halo-blur"]),"text-translate":new vt(ye.paint_symbol["text-translate"]),"text-translate-anchor":new vt(ye.paint_symbol["text-translate-anchor"])}),layout:f3};class W_{constructor(i){this.type=i.property.overrides?i.property.overrides.runtimeType:At,this.defaultValue=i}evaluate(i){if(i.formattedSection){let l=this.defaultValue.property.overrides;if(l&&l.hasOverride(i.formattedSection))return l.getOverride(i.formattedSection)}return i.feature&&i.featureState?this.defaultValue.evaluate(i.feature,i.featureState):this.defaultValue.property.specification.default}eachChild(i){this.defaultValue.isConstant()||i(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}dt("FormatSectionOverride",W_,{omit:["defaultValue"]});class sf extends fn{constructor(i){super(i,O0)}recalculate(i,l){if(super.recalculate(i,l),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")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){let h=this.layout.get("text-writing-mode");if(h){let p=[];for(let y of h)p.indexOf(y)<0&&p.push(y);this.layout._values["text-writing-mode"]=p}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(i,l,h,p){let y=this.layout.get(i).evaluate(l,{},h,p),x=this._unevaluatedLayout._values[i];return x.isDataDriven()||pu(x.value)||!y?y:function(w,S){return S.replace(/{([^{}]+)}/g,(A,z)=>z in w?String(w[z]):"")}(l.properties,y)}createBucket(i){return new Gu(i)}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(let i of O0.paint.overridableProperties){if(!sf.hasPaintOverride(this.layout,i))continue;let l=this.paint.get(i),h=new W_(l),p=new dh(h,l.property.specification),y=null;y=l.value.kind==="constant"||l.value.kind==="source"?new mu("source",p):new gu("composite",p,l.value.zoomStops,l.value._interpolationType),this.paint._values[i]=new _o(l.property,y,l.parameters)}}_handleOverridablePaintPropertyUpdate(i,l,h){return!(!this.layout||l.isDataDriven()||h.isDataDriven())&&sf.hasPaintOverride(this.layout,i)}static hasPaintOverride(i,l){let h=i.get("text-field"),p=O0.paint.properties[l],y=!1,x=w=>{for(let S of w)if(p.overrides&&p.overrides.hasOverride(S))return void(y=!0)};if(h.value.kind==="constant"&&h.value.value instanceof re)x(h.value.value.sections);else if(h.value.kind==="source"){let w=A=>{y||(A instanceof Ge&&fe(A.value)===ci?x(A.value.sections):A instanceof xt?x(A.sections):A.eachChild(w))},S=h.value;S._styleExpression&&w(S._styleExpression.expression)}return y}}function G0(s,i,l){let h="never",p=s.get(i);return p?h=p:s.get(l)&&(h="always"),h}var m3={paint:new Tr({"background-color":new vt(ye.paint_background["background-color"]),"background-pattern":new vl(ye.paint_background["background-pattern"]),"background-opacity":new vt(ye.paint_background["background-opacity"])})},g3={paint:new Tr({"raster-opacity":new vt(ye.paint_raster["raster-opacity"]),"raster-hue-rotate":new vt(ye.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new vt(ye.paint_raster["raster-brightness-min"]),"raster-brightness-max":new vt(ye.paint_raster["raster-brightness-max"]),"raster-saturation":new vt(ye.paint_raster["raster-saturation"]),"raster-contrast":new vt(ye.paint_raster["raster-contrast"]),"raster-resampling":new vt(ye.paint_raster["raster-resampling"]),"raster-fade-duration":new vt(ye.paint_raster["raster-fade-duration"])})};class y3 extends fn{constructor(i){super(i,{}),this.onAdd=l=>{this.implementation.onAdd&&this.implementation.onAdd(l,l.painter.context.gl)},this.onRemove=l=>{this.implementation.onRemove&&this.implementation.onRemove(l,l.painter.context.gl)},this.implementation=i}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){}}let v3={circle:class extends fn{constructor(s){super(s,qT)}createBucket(s){return new d0(s)}queryRadius(s){let i=s;return Th("circle-radius",this,i)+Th("circle-stroke-width",this,i)+Wp(this.paint.get("circle-translate"))}queryIntersectsFeature(s,i,l,h,p,y,x,w){let S=Zp(s,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),y.angle,x),A=this.paint.get("circle-radius").evaluate(i,l)+this.paint.get("circle-stroke-width").evaluate(i,l),z=this.paint.get("circle-pitch-alignment")==="map",R=z?S:function(G,Z){return G.map(se=>Kx(se,Z))}(S,w),N=z?A*x:A;for(let G of h)for(let Z of G){let se=z?Z:Kx(Z,w),ae=N,be=jp([],[Z.x,Z.y,0,1],w);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?ae*=be[3]/y.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(ae*=y.cameraToCenterDistance/be[3]),jT(R,se,ae))return!0}return!1}},heatmap:class extends fn{constructor(s){super(s,QT),this._updateColorRamp()}createBucket(s){return new e_(s)}_handleSpecialPaintPropertyUpdate(s){s==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=i_({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(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}},hillshade:class extends fn{constructor(s){super(s,KT)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}},fill:class extends fn{constructor(s){super(s,mA)}recalculate(s,i){super.recalculate(s,i);let l=this.paint._values["fill-outline-color"];l.value.kind==="constant"&&l.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(s){return new C0(s)}queryRadius(){return Wp(this.paint.get("fill-translate"))}queryIntersectsFeature(s,i,l,h,p,y,x){return Yx(Zp(s,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),y.angle,x),h)}isTileClipped(){return!0}},"fill-extrusion":class extends fn{constructor(s){super(s,TA)}createBucket(s){return new E0(s)}queryRadius(){return Wp(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(s,i,l,h,p,y,x,w){let S=Zp(s,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),y.angle,x),A=this.paint.get("fill-extrusion-height").evaluate(i,l),z=this.paint.get("fill-extrusion-base").evaluate(i,l),R=function(G,Z,se,ae){let be=[];for(let Te of G){let Ee=[Te.x,Te.y,0,1];jp(Ee,Ee,Z),be.push(new at(Ee[0]/Ee[3],Ee[1]/Ee[3]))}return be}(S,w),N=function(G,Z,se,ae){let be=[],Te=[],Ee=ae[8]*Z,Le=ae[9]*Z,We=ae[10]*Z,Oe=ae[11]*Z,pt=ae[8]*se,bt=ae[9]*se,nt=ae[10]*se,ot=ae[11]*se;for(let tt of G){let ct=[],st=[];for(let Ye of tt){let Et=Ye.x,wt=Ye.y,Kt=ae[0]*Et+ae[4]*wt+ae[12],vi=ae[1]*Et+ae[5]*wt+ae[13],Zi=ae[2]*Et+ae[6]*wt+ae[14],ji=ae[3]*Et+ae[7]*wt+ae[15],Xr=Zi+We,_r=ji+Oe,br=Kt+pt,Dr=vi+bt,$r=Zi+nt,on=ji+ot,Pn=new at((Kt+Ee)/_r,(vi+Le)/_r);Pn.z=Xr/_r,ct.push(Pn);let wr=new at(br/on,Dr/on);wr.z=$r/on,st.push(wr)}be.push(ct),Te.push(st)}return[be,Te]}(h,z,A,w);return function(G,Z,se){let ae=1/0;Yx(se,Z)&&(ae=d_(se,Z[0]));for(let be=0;be<Z.length;be++){let Te=Z[be],Ee=G[be];for(let Le=0;Le<Te.length-1;Le++){let We=Te[Le],Oe=[We,Te[Le+1],Ee[Le+1],Ee[Le],We];$x(se,Oe)&&(ae=Math.min(ae,d_(se,Oe)))}}return ae!==1/0&&ae}(N[0],N[1],R)}},line:class extends fn{constructor(s){super(s,f_),this.gradientVersion=0}_handleSpecialPaintPropertyUpdate(s){s==="line-gradient"&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof ol,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER)}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(s,i){super.recalculate(s,i),this.paint._values["line-floorwidth"]=m_.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,s)}createBucket(s){return new T0(s)}queryRadius(s){let i=s,l=g_(Th("line-width",this,i),Th("line-gap-width",this,i)),h=Th("line-offset",this,i);return l/2+Math.abs(h)+Wp(this.paint.get("line-translate"))}queryIntersectsFeature(s,i,l,h,p,y,x){let w=Zp(s,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),y.angle,x),S=x/2*g_(this.paint.get("line-width").evaluate(i,l),this.paint.get("line-gap-width").evaluate(i,l)),A=this.paint.get("line-offset").evaluate(i,l);return A&&(h=function(z,R){let N=[];for(let G=0;G<z.length;G++){let Z=z[G],se=[];for(let ae=0;ae<Z.length;ae++){let be=Z[ae-1],Te=Z[ae],Ee=Z[ae+1],Le=ae===0?new at(0,0):Te.sub(be)._unit()._perp(),We=ae===Z.length-1?new at(0,0):Ee.sub(Te)._unit()._perp(),Oe=Le._add(We)._unit(),pt=Oe.x*We.x+Oe.y*We.y;pt!==0&&Oe._mult(1/pt),se.push(Oe._mult(R)._add(Te))}N.push(se)}return N}(h,A*x)),function(z,R,N){for(let G=0;G<R.length;G++){let Z=R[G];if(z.length>=3){for(let se=0;se<Z.length;se++)if(zu(z,Z[se]))return!0}if(HT(z,Z,N))return!0}return!1}(w,h,S)}isTileClipped(){return!0}},symbol:sf,background:class extends fn{constructor(s){super(s,m3)}},raster:class extends fn{constructor(s){super(s,g3)}}};class x3{constructor(i){this._callback=i,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{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(){delete this._channel,this._callback=()=>{}}}let Z_=63710088e-1;class sr{constructor(i,l){if(isNaN(i)||isNaN(l))throw new Error(`Invalid LngLat object: (${i}, ${l})`);if(this.lng=+i,this.lat=+l,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new sr(B(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(i){let l=Math.PI/180,h=this.lat*l,p=i.lat*l,y=Math.sin(h)*Math.sin(p)+Math.cos(h)*Math.cos(p)*Math.cos((i.lng-this.lng)*l);return Z_*Math.acos(Math.min(y,1))}toBounds(i=0){let l=360*i/40075017,h=l/Math.cos(Math.PI/180*this.lat);return new Sl(new sr(this.lng-h,this.lat-l),new sr(this.lng+h,this.lat+l))}static convert(i){if(i instanceof sr)return i;if(Array.isArray(i)&&(i.length===2||i.length===3))return new sr(Number(i[0]),Number(i[1]));if(!Array.isArray(i)&&typeof i=="object"&&i!==null)return new sr(Number("lng"in i?i.lng:i.lon),Number(i.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}class Sl{constructor(i,l){i&&(l?this.setSouthWest(i).setNorthEast(l):i.length===4?this.setSouthWest([i[0],i[1]]).setNorthEast([i[2],i[3]]):this.setSouthWest(i[0]).setNorthEast(i[1]))}setNorthEast(i){return this._ne=i instanceof sr?new sr(i.lng,i.lat):sr.convert(i),this}setSouthWest(i){return this._sw=i instanceof sr?new sr(i.lng,i.lat):sr.convert(i),this}extend(i){let l=this._sw,h=this._ne,p,y;if(i instanceof sr)p=i,y=i;else{if(!(i instanceof Sl))return Array.isArray(i)?i.length===4||i.every(Array.isArray)?this.extend(Sl.convert(i)):this.extend(sr.convert(i)):this;if(p=i._sw,y=i._ne,!p||!y)return this}return l||h?(l.lng=Math.min(p.lng,l.lng),l.lat=Math.min(p.lat,l.lat),h.lng=Math.max(y.lng,h.lng),h.lat=Math.max(y.lat,h.lat)):(this._sw=new sr(p.lng,p.lat),this._ne=new sr(y.lng,y.lat)),this}getCenter(){return new sr((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 sr(this.getWest(),this.getNorth())}getSouthEast(){return new sr(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(i){let{lng:l,lat:h}=sr.convert(i),p=this._sw.lng<=l&&l<=this._ne.lng;return this._sw.lng>this._ne.lng&&(p=this._sw.lng>=l&&l>=this._ne.lng),this._sw.lat<=h&&h<=this._ne.lat&&p}static convert(i){return i instanceof Sl?i:i&&new Sl(i)}}let j_=2*Math.PI*Z_;function H_(s){return j_*Math.cos(s*Math.PI/180)}function X_(s){return(180+s)/360}function $_(s){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+s*Math.PI/360)))/360}function Y_(s,i){return s/H_(i)}function V0(s){return 360/Math.PI*Math.atan(Math.exp((180-360*s)*Math.PI/180))-90}class af{constructor(i,l,h=0){this.x=+i,this.y=+l,this.z=+h}static fromLngLat(i,l=0){let h=sr.convert(i);return new af(X_(h.lng),$_(h.lat),Y_(l,h.lat))}toLngLat(){return new sr(360*this.x-180,V0(this.y))}toAltitude(){return this.z*H_(V0(this.y))}meterInMercatorCoordinateUnits(){return 1/j_*(i=V0(this.y),1/Math.cos(i*Math.PI/180));var i}}function q_(s,i,l){var h=2*Math.PI*6378137/256/Math.pow(2,l);return[s*h-2*Math.PI*6378137/2,i*h-2*Math.PI*6378137/2]}class U0{constructor(i,l,h){this.z=i,this.x=l,this.y=h,this.key=Oh(0,i,i,l,h)}equals(i){return this.z===i.z&&this.x===i.x&&this.y===i.y}url(i,l,h){let p=(x=this.y,w=this.z,S=q_(256*(y=this.x),256*(x=Math.pow(2,w)-x-1),w),A=q_(256*(y+1),256*(x+1),w),S[0]+","+S[1]+","+A[0]+","+A[1]);var y,x,w,S,A;let z=function(R,N,G){let Z,se="";for(let ae=R;ae>0;ae--)Z=1<<ae-1,se+=(N&Z?1:0)+(G&Z?2:0);return se}(this.z,this.x,this.y);return i[(this.x+this.y)%i.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(h==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,l>1?"@2x":"").replace(/{quadkey}/g,z).replace(/{bbox-epsg-3857}/g,p)}getTilePoint(i){let l=Math.pow(2,this.z);return new at((i.x*l-this.x)*Pr,(i.y*l-this.y)*Pr)}toString(){return`${this.z}/${this.x}/${this.y}`}}class J_{constructor(i,l){this.wrap=i,this.canonical=l,this.key=Oh(i,l.z,l.z,l.x,l.y)}}class So{constructor(i,l,h,p,y){this.overscaledZ=i,this.wrap=l,this.canonical=new U0(h,+p,+y),this.key=Oh(l,i,h,p,y)}equals(i){return this.overscaledZ===i.overscaledZ&&this.wrap===i.wrap&&this.canonical.equals(i.canonical)}scaledTo(i){let l=this.canonical.z-i;return i>this.canonical.z?new So(i,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new So(i,this.wrap,i,this.canonical.x>>l,this.canonical.y>>l)}calculateScaledKey(i,l){let h=this.canonical.z-i;return i>this.canonical.z?Oh(this.wrap*+l,i,this.canonical.z,this.canonical.x,this.canonical.y):Oh(this.wrap*+l,i,i,this.canonical.x>>h,this.canonical.y>>h)}isChildOf(i){if(i.wrap!==this.wrap)return!1;let l=this.canonical.z-i.canonical.z;return i.overscaledZ===0||i.overscaledZ<this.overscaledZ&&i.canonical.x===this.canonical.x>>l&&i.canonical.y===this.canonical.y>>l}children(i){if(this.overscaledZ>=i)return[new So(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let l=this.canonical.z+1,h=2*this.canonical.x,p=2*this.canonical.y;return[new So(l,this.wrap,l,h,p),new So(l,this.wrap,l,h+1,p),new So(l,this.wrap,l,h,p+1),new So(l,this.wrap,l,h+1,p+1)]}isLessThan(i){return this.wrap<i.wrap||!(this.wrap>i.wrap)&&(this.overscaledZ<i.overscaledZ||!(this.overscaledZ>i.overscaledZ)&&(this.canonical.x<i.canonical.x||!(this.canonical.x>i.canonical.x)&&this.canonical.y<i.canonical.y))}wrapped(){return new So(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(i){return new So(this.overscaledZ,i,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new J_(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(i){return this.canonical.getTilePoint(new af(i.x-this.wrap,i.y))}}function Oh(s,i,l,h,p){(s*=2)<0&&(s=-1*s-1);let y=1<<l;return(y*y*s+y*p+h).toString(36)+l.toString(36)+i.toString(36)}dt("CanonicalTileID",U0),dt("OverscaledTileID",So,{omit:["posMatrix"]});class Q_{constructor(i,l,h){if(this.uid=i,l.height!==l.width)throw new RangeError("DEM tiles must be square");if(h&&h!=="mapbox"&&h!=="terrarium")return void te(`"${h}" is not a valid encoding type. Valid types include "mapbox" and "terrarium".`);this.stride=l.height;let p=this.dim=l.height-2;this.data=new Uint32Array(l.data.buffer),this.encoding=h||"mapbox";for(let y=0;y<p;y++)this.data[this._idx(-1,y)]=this.data[this._idx(0,y)],this.data[this._idx(p,y)]=this.data[this._idx(p-1,y)],this.data[this._idx(y,-1)]=this.data[this._idx(y,0)],this.data[this._idx(y,p)]=this.data[this._idx(y,p-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(p,-1)]=this.data[this._idx(p-1,0)],this.data[this._idx(-1,p)]=this.data[this._idx(0,p-1)],this.data[this._idx(p,p)]=this.data[this._idx(p-1,p-1)]}get(i,l){let h=new Uint8Array(this.data.buffer),p=4*this._idx(i,l);return(this.encoding==="terrarium"?this._unpackTerrarium:this._unpackMapbox)(h[p],h[p+1],h[p+2])}getUnpackVector(){return this.encoding==="terrarium"?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]}_idx(i,l){if(i<-1||i>=this.dim+1||l<-1||l>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(l+1)*this.stride+(i+1)}_unpackMapbox(i,l,h){return(256*i*256+256*l+h)/10-1e4}_unpackTerrarium(i,l,h){return 256*i+l+h/256-32768}getPixels(){return new ao({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(i,l,h){if(this.dim!==i.dim)throw new Error("dem dimension mismatch");let p=l*this.dim,y=l*this.dim+this.dim,x=h*this.dim,w=h*this.dim+this.dim;switch(l){case-1:p=y-1;break;case 1:y=p+1}switch(h){case-1:x=w-1;break;case 1:w=x+1}let S=-l*this.dim,A=-h*this.dim;for(let z=x;z<w;z++)for(let R=p;R<y;R++)this.data[this._idx(R,z)]=i.data[this._idx(R+S,z+A)]}}dt("DEMData",Q_);class K_{constructor(i){this._stringToNumber={},this._numberToString=[];for(let l=0;l<i.length;l++){let h=i[l];this._stringToNumber[h]=l,this._numberToString[l]=h}}encode(i){return this._stringToNumber[i]}decode(i){return this._numberToString[i]}}class eb{constructor(i,l,h,p,y){this.type="Feature",this._vectorTileFeature=i,i._z=l,i._x=h,i._y=p,this.properties=i.properties,this.id=y}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(i){this._geometry=i}toJSON(){let i={geometry:this.geometry};for(let l in this)l!=="_geometry"&&l!=="_vectorTileFeature"&&(i[l]=this[l]);return i}}class tb{constructor(i,l){this.tileID=i,this.x=i.canonical.x,this.y=i.canonical.y,this.z=i.canonical.z,this.grid=new Ss(Pr,16,0),this.grid3D=new Ss(Pr,16,0),this.featureIndexArray=new ei,this.promoteId=l}insert(i,l,h,p,y,x){let w=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(h,p,y);let S=x?this.grid3D:this.grid;for(let A=0;A<l.length;A++){let z=l[A],R=[1/0,1/0,-1/0,-1/0];for(let N=0;N<z.length;N++){let G=z[N];R[0]=Math.min(R[0],G.x),R[1]=Math.min(R[1],G.y),R[2]=Math.max(R[2],G.x),R[3]=Math.max(R[3],G.y)}R[0]<Pr&&R[1]<Pr&&R[2]>=0&&R[3]>=0&&S.insert(w,R[0],R[1],R[2],R[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Ia.VectorTile(new A0(this.rawTileData)).layers,this.sourceLayerCoder=new K_(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(i,l,h,p){this.loadVTLayers();let y=i.params||{},x=Pr/i.tileSize/i.scale,w=xu(y.filter),S=i.queryGeometry,A=i.queryPadding*x,z=rb(S),R=this.grid.query(z.minX-A,z.minY-A,z.maxX+A,z.maxY+A),N=rb(i.cameraQueryGeometry),G=this.grid3D.query(N.minX-A,N.minY-A,N.maxX+A,N.maxY+A,(ae,be,Te,Ee)=>function(Le,We,Oe,pt,bt){for(let ot of Le)if(We<=ot.x&&Oe<=ot.y&&pt>=ot.x&&bt>=ot.y)return!0;let nt=[new at(We,Oe),new at(We,bt),new at(pt,bt),new at(pt,Oe)];if(Le.length>2){for(let ot of nt)if(zu(Le,ot))return!0}for(let ot=0;ot<Le.length-1;ot++)if($T(Le[ot],Le[ot+1],nt))return!0;return!1}(i.cameraQueryGeometry,ae-A,be-A,Te+A,Ee+A));for(let ae of G)R.push(ae);R.sort(_3);let Z={},se;for(let ae=0;ae<R.length;ae++){let be=R[ae];if(be===se)continue;se=be;let Te=this.featureIndexArray.get(be),Ee=null;this.loadMatchingFeature(Z,Te.bucketIndex,Te.sourceLayerIndex,Te.featureIndex,w,y.layers,y.availableImages,l,h,p,(Le,We,Oe)=>(Ee||(Ee=wl(Le)),We.queryIntersectsFeature(S,Le,Oe,Ee,this.z,i.transform,x,i.pixelPosMatrix)))}return Z}loadMatchingFeature(i,l,h,p,y,x,w,S,A,z,R){let N=this.bucketLayerIDs[l];if(x&&!function(ae,be){for(let Te=0;Te<ae.length;Te++)if(be.indexOf(ae[Te])>=0)return!0;return!1}(x,N))return;let G=this.sourceLayerCoder.decode(h),Z=this.vtLayers[G].feature(p);if(y.needGeometry){let ae=Il(Z,!0);if(!y.filter(new Ui(this.tileID.overscaledZ),ae,this.tileID.canonical))return}else if(!y.filter(new Ui(this.tileID.overscaledZ),Z))return;let se=this.getId(Z,G);for(let ae=0;ae<N.length;ae++){let be=N[ae];if(x&&x.indexOf(be)<0)continue;let Te=S[be];if(!Te)continue;let Ee={};se&&z&&(Ee=z.getState(Te.sourceLayer||"_geojsonTileLayer",se));let Le=W({},A[be]);Le.paint=ib(Le.paint,Te.paint,Z,Ee,w),Le.layout=ib(Le.layout,Te.layout,Z,Ee,w);let We=!R||R(Z,Te,Ee);if(!We)continue;let Oe=new eb(Z,this.z,this.x,this.y,se);Oe.layer=Le;let pt=i[be];pt===void 0&&(pt=i[be]=[]),pt.push({featureIndex:p,feature:Oe,intersectionZ:We})}}lookupSymbolFeatures(i,l,h,p,y,x,w,S){let A={};this.loadVTLayers();let z=xu(y);for(let R of i)this.loadMatchingFeature(A,h,p,R,z,x,w,S,l);return A}hasLayer(i){for(let l of this.bucketLayerIDs)for(let h of l)if(i===h)return!0;return!1}getId(i,l){let h=i.id;return this.promoteId&&(h=i.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[l]],typeof h=="boolean"&&(h=Number(h))),h}}function ib(s,i,l,h,p){return le(s,(y,x)=>{let w=i instanceof Eu?i.get(x):null;return w&&w.evaluate?w.evaluate(l,h,p):w})}function rb(s){let i=1/0,l=1/0,h=-1/0,p=-1/0;for(let y of s)i=Math.min(i,y.x),l=Math.min(l,y.y),h=Math.max(h,y.x),p=Math.max(p,y.y);return{minX:i,minY:l,maxX:h,maxY:p}}function _3(s,i){return i-s}var W0;dt("FeatureIndex",tb,{omit:["rawTileData","sourceLayerCoder"]}),o.PerformanceMarkers=void 0,(W0=o.PerformanceMarkers||(o.PerformanceMarkers={})).create="create",W0.load="load",W0.fullLoad="fullLoad";let lf=null,Gh=[],Z0=1e3/30,b3={mark(s){performance.mark(s)},frame(s){let i=s;lf!=null&&Gh.push(i-lf),lf=i},clearMetrics(){lf=null,Gh=[],performance.clearMeasures("loadTime"),performance.clearMeasures("fullLoadTime");for(let s in o.PerformanceMarkers)performance.clearMarks(o.PerformanceMarkers[s])},getPerformanceMetrics(){performance.measure("loadTime",o.PerformanceMarkers.create,o.PerformanceMarkers.load),performance.measure("fullLoadTime",o.PerformanceMarkers.create,o.PerformanceMarkers.fullLoad);let s=performance.getEntriesByName("loadTime")[0].duration,i=performance.getEntriesByName("fullLoadTime")[0].duration,l=Gh.length,h=1/(Gh.reduce((y,x)=>y+x,0)/l/1e3),p=Gh.filter(y=>y>Z0).reduce((y,x)=>y+(x-Z0)/Z0,0);return{loadTime:s,fullLoadTime:i,fps:h,percentDroppedFrames:p/(l+p)*100}}};o.AJAXError=ri,o.ARRAY_TYPE=Lu,o.Actor=class{constructor(s,i,l){this.target=s,this.parent=i,this.mapId=l,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},ee(["receive","process"],this),this.invoker=new x3(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=Ce()?s:window}send(s,i,l,h,p=!1){let y=Math.round(1e18*Math.random()).toString(36).substring(0,10);l&&(this.callbacks[y]=l);let x=Tt(this.globalScope)?void 0:[];return this.target.postMessage({id:y,type:s,hasCallback:!!l,targetMapId:h,mustQueue:p,sourceMapId:this.mapId,data:fl(i,x)},x),{cancel:()=>{l&&delete this.callbacks[y],this.target.postMessage({id:y,type:"<cancel>",targetMapId:h,sourceMapId:this.mapId})}}}receive(s){let i=s.data,l=i.id;if(l&&(!i.targetMapId||this.mapId===i.targetMapId))if(i.type==="<cancel>"){delete this.tasks[l];let h=this.cancelCallbacks[l];delete this.cancelCallbacks[l],h&&h()}else Ce()||i.mustQueue?(this.tasks[l]=i,this.taskQueue.push(l),this.invoker.trigger()):this.processTask(l,i)}process(){if(!this.taskQueue.length)return;let s=this.taskQueue.shift(),i=this.tasks[s];delete this.tasks[s],this.taskQueue.length&&this.invoker.trigger(),i&&this.processTask(s,i)}processTask(s,i){if(i.type==="<response>"){let l=this.callbacks[s];delete this.callbacks[s],l&&(i.error?l(Cs(i.error)):l(null,Cs(i.data)))}else{let l=!1,h=Tt(this.globalScope)?void 0:[],p=i.hasCallback?(w,S)=>{l=!0,delete this.cancelCallbacks[s],this.target.postMessage({id:s,type:"<response>",sourceMapId:this.mapId,error:w?fl(w):null,data:fl(S,h)},h)}:w=>{l=!0},y=null,x=Cs(i.data);if(this.parent[i.type])y=this.parent[i.type](i.sourceMapId,x,p);else if(this.parent.getWorkerSource){let w=i.type.split(".");y=this.parent.getWorkerSource(i.sourceMapId,w[0],x.source)[w[1]](x,p)}else p(new Error(`Could not find function ${i.type}`));!l&&y&&y.cancel&&(this.cancelCallbacks[s]=y.cancel)}}remove(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)}},o.AlphaImage=Ph,o.CanonicalTileID=U0,o.CollisionBoxArray=Pe,o.CollisionCircleLayoutArray=class extends k{},o.Color=L,o.DEMData=Q_,o.DataConstantProperty=vt,o.DictionaryCoder=K_,o.EXTENT=Pr,o.ErrorEvent=Ve,o.EvaluationParameters=Ui,o.Event=Se,o.Evented=He,o.FeatureIndex=tb,o.FillBucket=C0,o.FillExtrusionBucket=E0,o.GeoJSONFeature=eb,o.ImageAtlas=C_,o.ImagePosition=k0,o.LineBucket=T0,o.LineStripIndexArray=class extends we{},o.LngLat=sr,o.LngLatBounds=Sl,o.MercatorCoordinate=af,o.ONE_EM=Gr,o.OverscaledTileID=So,o.PerformanceUtils=b3,o.PosArray=class extends xa{},o.Properties=Tr,o.QuadTriangleArray=class extends O{},o.RGBAImage=ao,o.RasterBoundsArray=class extends _l{},o.RequestPerformance=class{constructor(s){this._marks={start:[s.url,"start"].join("#"),end:[s.url,"end"].join("#"),measure:s.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let s=performance.getEntriesByName(this._marks.measure);return s.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),s=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),s}},o.ResourceType=oo,o.SegmentVector=li,o.SymbolBucket=Gu,o.Transitionable=Sh,o.TriangleIndexArray=mn,o.Uniform1f=_a,o.Uniform1i=class extends Io{constructor(s,i){super(s,i),this.current=0}set(s){this.current!==s&&(this.current=s,this.gl.uniform1i(this.location,s))}},o.Uniform2f=class extends Io{constructor(s,i){super(s,i),this.current=[0,0]}set(s){s[0]===this.current[0]&&s[1]===this.current[1]||(this.current=s,this.gl.uniform2f(this.location,s[0],s[1]))}},o.Uniform3f=class extends Io{constructor(s,i){super(s,i),this.current=[0,0,0]}set(s){s[0]===this.current[0]&&s[1]===this.current[1]&&s[2]===this.current[2]||(this.current=s,this.gl.uniform3f(this.location,s[0],s[1],s[2]))}},o.Uniform4f=Wx,o.UniformColor=Zx,o.UniformMatrix4f=class extends Io{constructor(s,i){super(s,i),this.current=WT}set(s){if(s[12]!==this.current[12]||s[0]!==this.current[0])return this.current=s,void this.gl.uniformMatrix4fv(this.location,!1,s);for(let i=1;i<16;i++)if(s[i]!==this.current[i]){this.current=s,this.gl.uniformMatrix4fv(this.location,!1,s);break}}},o.UnwrappedTileID=J_,o.ValidationError=Re,o.ZoomHistory=ml,o.addDynamicAttributes=B0,o.asyncAll=function(s,i,l){if(!s.length)return l(null,[]);let h=s.length,p=new Array(s.length),y=null;s.forEach((x,w)=>{i(x,(S,A)=>{S&&(y=S),p[w]=A,--h==0&&l(y,p)})})},o.bezier=b,o.bindAll=ee,o.cacheEntryPossiblyAdded=function(s){_i++,_i>si&&(s.getActor().send("enforceCacheSizeLimit",Xi),_i=0)},o.clamp=T,o.clearTileCache=function(s){let i=caches.delete(Ii);s&&i.catch(s).then(()=>s())},o.clipLine=N_,o.clone=function(s){var i=new Lu(16);return i[0]=s[0],i[1]=s[1],i[2]=s[2],i[3]=s[3],i[4]=s[4],i[5]=s[5],i[6]=s[6],i[7]=s[7],i[8]=s[8],i[9]=s[9],i[10]=s[10],i[11]=s[11],i[12]=s[12],i[13]=s[13],i[14]=s[14],i[15]=s[15],i},o.clone$1=H,o.collisionCircleLayout=OA,o.config=zi,o.create=function(){var s=new Lu(16);return Lu!=Float32Array&&(s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[11]=0,s[12]=0,s[13]=0,s[14]=0),s[0]=1,s[5]=1,s[10]=1,s[15]=1,s},o.createExpression=fu,o.createFilter=xu,o.createLayout=Ar,o.createStyleLayer=function(s){return s.type==="custom"?new y3(s):new v3[s.type](s)},o.dot=function(s,i){return s[0]*i[0]+s[1]*i[1]+s[2]*i[2]+s[3]*i[3]},o.ease=C,o.emitValidationErrors=Lp,o.enforceCacheSizeLimit=function(s){ii(),Ht&&Ht.then(i=>{i.keys().then(l=>{for(let h=0;h<l.length-s;h++)i.delete(l[h])})})},o.evaluateSizeForFeature=function(s,{uSize:i,uSizeT:l},{lowerSize:h,upperSize:p}){return s.kind==="source"?h/zs:s.kind==="composite"?vr(h/zs,p/zs,l):i},o.evaluateSizeForZoom=function(s,i){let l=0,h=0;if(s.kind==="constant")h=s.layoutSize;else if(s.kind!=="source"){let{interpolationType:p,minZoom:y,maxZoom:x}=s,w=p?T(Mn.interpolationFactor(p,i,y,x),0,1):0;s.kind==="camera"?h=vr(s.minSize,s.maxSize,w):l=w}return{uSizeT:l,uSize:h}},o.evaluateVariableOffset=G_,o.evented=va,o.exported=Jt,o.exported$1=Ei,o.extend=W,o.filterObject=de,o.getAnchorAlignment=L0,o.getAnchorJustification=D0,o.getArrayBuffer=Lr,o.getImage=U,o.getJSON=function(s,i){return rn(W(s,{type:"json"}),i)},o.getOverlapMode=G0,o.getRTLTextPluginStatus=Ih,o.getReferrer=Hr,o.getVideo=function(s,i){let l=window.document.createElement("video");l.muted=!0,l.onloadstart=function(){i(null,l)};for(let h=0;h<s.length;h++){let p=window.document.createElement("source");es(s[h])||(l.crossOrigin="Anonymous"),p.src=s[h],l.appendChild(p)}return{cancel:()=>{}}},o.identity=m0,o.invert=function(s,i){var l=i[0],h=i[1],p=i[2],y=i[3],x=i[4],w=i[5],S=i[6],A=i[7],z=i[8],R=i[9],N=i[10],G=i[11],Z=i[12],se=i[13],ae=i[14],be=i[15],Te=l*w-h*x,Ee=l*S-p*x,Le=l*A-y*x,We=h*S-p*w,Oe=h*A-y*w,pt=p*A-y*S,bt=z*se-R*Z,nt=z*ae-N*Z,ot=z*be-G*Z,tt=R*ae-N*se,ct=R*be-G*se,st=N*be-G*ae,Ye=Te*st-Ee*ct+Le*tt+We*ot-Oe*nt+pt*bt;return Ye?(s[0]=(w*st-S*ct+A*tt)*(Ye=1/Ye),s[1]=(p*ct-h*st-y*tt)*Ye,s[2]=(se*pt-ae*Oe+be*We)*Ye,s[3]=(N*Oe-R*pt-G*We)*Ye,s[4]=(S*ot-x*st-A*nt)*Ye,s[5]=(l*st-p*ot+y*nt)*Ye,s[6]=(ae*Le-Z*pt-be*Ee)*Ye,s[7]=(z*pt-N*Le+G*Ee)*Ye,s[8]=(x*ct-w*ot+A*bt)*Ye,s[9]=(h*ot-l*ct-y*bt)*Ye,s[10]=(Z*Oe-se*Le+be*Te)*Ye,s[11]=(R*Le-z*Oe-G*Te)*Ye,s[12]=(w*nt-x*tt-S*bt)*Ye,s[13]=(l*tt-h*nt+p*bt)*Ye,s[14]=(se*Ee-Z*We-ae*Te)*Ye,s[15]=(z*We-R*Ee+N*Te)*Ye,s):null},o.isImageBitmap=Gt,o.isSafari=Tt,o.keysDifference=function(s,i){let l=[];for(let h in s)h in i||l.push(h);return l},o.lazyLoadRTLTextPlugin=function(){Zn.isLoading()||Zn.isLoaded()||Ih()!=="deferred"||Su()},o.makeRequest=rn,o.mapObject=le,o.mercatorXfromLng=X_,o.mercatorYfromLat=$_,o.mercatorZfromAltitude=Y_,o.mul=JT,o.multiply=Qx,o.nextPowerOfTwo=function(s){return s<=1?1:Math.pow(2,Math.ceil(Math.log(s)/Math.LN2))},o.number=vr,o.ortho=function(s,i,l,h,p,y,x){var w=1/(i-l),S=1/(h-p),A=1/(y-x);return s[0]=-2*w,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=-2*S,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=2*A,s[11]=0,s[12]=(i+l)*w,s[13]=(p+h)*S,s[14]=(x+y)*A,s[15]=1,s},o.parseCacheControl=Be,o.parseGlyphPBF=function(s){return new A0(s).readFields(qA,[])},o.pbf=A0,o.performSymbolLayout=function(s,i,l,h,p,y,x){s.createArrays(),s.tilePixelRatio=Pr/(512*s.overscaling),s.compareText={},s.iconsNeedLinear=!1;let w=s.layers[0].layout,S=s.layers[0]._unevaluatedLayout._values,A={layoutIconSize:S["icon-size"].possiblyEvaluate(new Ui(s.zoom+1),x),layoutTextSize:S["text-size"].possiblyEvaluate(new Ui(s.zoom+1),x),textMaxSize:S["text-size"].possiblyEvaluate(new Ui(18))};if(s.textSizeData.kind==="composite"){let{minZoom:Z,maxZoom:se}=s.textSizeData;A.compositeTextSizes=[S["text-size"].possiblyEvaluate(new Ui(Z),x),S["text-size"].possiblyEvaluate(new Ui(se),x)]}if(s.iconSizeData.kind==="composite"){let{minZoom:Z,maxZoom:se}=s.iconSizeData;A.compositeIconSizes=[S["icon-size"].possiblyEvaluate(new Ui(Z),x),S["icon-size"].possiblyEvaluate(new Ui(se),x)]}let z=w.get("text-line-height")*Gr,R=w.get("text-rotation-alignment")!=="viewport"&&w.get("symbol-placement")!=="point",N=w.get("text-keep-upright"),G=w.get("text-size");for(let Z of s.features){let se=w.get("text-font").evaluate(Z,{},x).join(","),ae=G.evaluate(Z,{},x),be=A.layoutTextSize.evaluate(Z,{},x),Te=A.layoutIconSize.evaluate(Z,{},x),Ee={horizontal:{},vertical:void 0},Le=Z.text,We,Oe=[0,0];if(Le){let nt=Le.toString(),ot=w.get("text-letter-spacing").evaluate(Z,{},x)*Gr,tt=Rp(nt)?ot:0,ct=w.get("text-anchor").evaluate(Z,{},x),st=w.get("text-variable-anchor");if(!st){let vi=w.get("text-radial-offset").evaluate(Z,{},x);Oe=vi?G_(ct,[vi*Gr,R0]):w.get("text-offset").evaluate(Z,{},x).map(Zi=>Zi*Gr)}let Ye=R?"center":w.get("text-justify").evaluate(Z,{},x),Et=w.get("symbol-placement"),wt=Et==="point"?w.get("text-max-width").evaluate(Z,{},x)*Gr:0,Kt=()=>{s.allowVerticalPlacement&&vh(nt)&&(Ee.vertical=Qp(Le,i,l,p,se,wt,z,ct,"left",tt,Oe,o.WritingMode.vertical,!0,Et,be,ae))};if(!R&&st){let vi=Ye==="auto"?st.map(ji=>D0(ji)):[Ye],Zi=!1;for(let ji=0;ji<vi.length;ji++){let Xr=vi[ji];if(!Ee.horizontal[Xr])if(Zi)Ee.horizontal[Xr]=Ee.horizontal[0];else{let _r=Qp(Le,i,l,p,se,wt,z,"center",Xr,tt,Oe,o.WritingMode.horizontal,!1,Et,be,ae);_r&&(Ee.horizontal[Xr]=_r,Zi=_r.positionedLines.length===1)}}Kt()}else{Ye==="auto"&&(Ye=D0(ct));let vi=Qp(Le,i,l,p,se,wt,z,ct,Ye,tt,Oe,o.WritingMode.horizontal,!1,Et,be,ae);vi&&(Ee.horizontal[Ye]=vi),Kt(),vh(nt)&&R&&N&&(Ee.vertical=Qp(Le,i,l,p,se,wt,z,ct,Ye,tt,Oe,o.WritingMode.vertical,!1,Et,be,ae))}}let pt=!1;if(Z.icon&&Z.icon.name){let nt=h[Z.icon.name];nt&&(We=i3(p[Z.icon.name],w.get("icon-offset").evaluate(Z,{},x),w.get("icon-anchor").evaluate(Z,{},x)),pt=!!nt.sdf,s.sdfIcons===void 0?s.sdfIcons=pt:s.sdfIcons!==pt&&te("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(nt.pixelRatio!==s.pixelRatio||w.get("icon-rotate").constantOr(1)!==0)&&(s.iconsNeedLinear=!0))}let bt=U_(Ee.horizontal)||Ee.vertical;s.iconsInText=!!bt&&bt.iconsInText,(bt||We)&&u3(s,Z,Ee,We,h,A,be,Te,Oe,pt,x)}y&&s.generateCollisionDebugBuffers()},o.perspective=function(s,i,l,h,p){var y,x=1/Math.tan(i/2);return s[0]=x/l,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=x,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[11]=-1,s[12]=0,s[13]=0,s[15]=0,p!=null&&p!==1/0?(s[10]=(p+h)*(y=1/(h-p)),s[14]=2*p*h*y):(s[10]=-1,s[14]=-2*h),s},o.pick=function(s,i){let l={};for(let h=0;h<i.length;h++){let p=i[h];p in s&&(l[p]=s[p])}return l},o.plugin=Zn,o.pointGeometry=at,o.polygonIntersectsPolygon=$x,o.potpack=S_,o.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],o.register=dt,o.registerForPluginStateChange=function(s){return s({pluginStatus:pn,pluginURL:ts}),va.on("pluginStateChange",s),s},o.renderColorRamp=i_,o.rotateX=function(s,i,l){var h=Math.sin(l),p=Math.cos(l),y=i[4],x=i[5],w=i[6],S=i[7],A=i[8],z=i[9],R=i[10],N=i[11];return i!==s&&(s[0]=i[0],s[1]=i[1],s[2]=i[2],s[3]=i[3],s[12]=i[12],s[13]=i[13],s[14]=i[14],s[15]=i[15]),s[4]=y*p+A*h,s[5]=x*p+z*h,s[6]=w*p+R*h,s[7]=S*p+N*h,s[8]=A*p-y*h,s[9]=z*p-x*h,s[10]=R*p-w*h,s[11]=N*p-S*h,s},o.rotateZ=function(s,i,l){var h=Math.sin(l),p=Math.cos(l),y=i[0],x=i[1],w=i[2],S=i[3],A=i[4],z=i[5],R=i[6],N=i[7];return i!==s&&(s[8]=i[8],s[9]=i[9],s[10]=i[10],s[11]=i[11],s[12]=i[12],s[13]=i[13],s[14]=i[14],s[15]=i[15]),s[0]=y*p+A*h,s[1]=x*p+z*h,s[2]=w*p+R*h,s[3]=S*p+N*h,s[4]=A*p-y*h,s[5]=z*p-x*h,s[6]=R*p-w*h,s[7]=N*p-S*h,s},o.scale=function(s,i,l){var h=l[0],p=l[1],y=l[2];return s[0]=i[0]*h,s[1]=i[1]*h,s[2]=i[2]*h,s[3]=i[3]*h,s[4]=i[4]*p,s[5]=i[5]*p,s[6]=i[6]*p,s[7]=i[7]*p,s[8]=i[8]*y,s[9]=i[9]*y,s[10]=i[10]*y,s[11]=i[11]*y,s[12]=i[12],s[13]=i[13],s[14]=i[14],s[15]=i[15],s},o.scale$1=function(s,i,l){return s[0]=i[0]*l,s[1]=i[1]*l,s[2]=i[2]*l,s[3]=i[3]*l,s},o.setCacheLimits=function(s,i){Xi=s,si=i},o.setRTLTextPlugin=function(s,i,l=!1){if(pn===Iu||pn===xh||pn===_h)throw new Error("setRTLTextPlugin cannot be called multiple times.");ts=Jt.resolveURL(s),pn=Iu,bh=i,wh(),l||Su()},o.spec=ye,o.sphericalToCartesian=function([s,i,l]){return i+=90,i*=Math.PI/180,l*=Math.PI/180,{x:s*Math.cos(i)*Math.sin(l),y:s*Math.sin(i)*Math.sin(l),z:s*Math.cos(l)}},o.toEvaluationFeature=Il,o.transformMat4=jp,o.translate=function(s,i,l){var h,p,y,x,w,S,A,z,R,N,G,Z,se=l[0],ae=l[1],be=l[2];return i===s?(s[12]=i[0]*se+i[4]*ae+i[8]*be+i[12],s[13]=i[1]*se+i[5]*ae+i[9]*be+i[13],s[14]=i[2]*se+i[6]*ae+i[10]*be+i[14],s[15]=i[3]*se+i[7]*ae+i[11]*be+i[15]):(p=i[1],y=i[2],x=i[3],w=i[4],S=i[5],A=i[6],z=i[7],R=i[8],N=i[9],G=i[10],Z=i[11],s[0]=h=i[0],s[1]=p,s[2]=y,s[3]=x,s[4]=w,s[5]=S,s[6]=A,s[7]=z,s[8]=R,s[9]=N,s[10]=G,s[11]=Z,s[12]=h*se+w*ae+R*be+i[12],s[13]=p*se+S*ae+N*be+i[13],s[14]=y*se+A*ae+G*be+i[14],s[15]=x*se+z*ae+Z*be+i[15]),s},o.triggerPluginCompletionEvent=Np,o.unicodeBlockLookup=it,o.uniqueId=function(){return q++},o.validateCustomStyleLayer=function(s){let i=[],l=s.id;return l===void 0&&i.push({message:`layers.${l}: missing required property "id"`}),s.render===void 0&&i.push({message:`layers.${l}: missing required method "render"`}),s.renderingMode&&s.renderingMode!=="2d"&&s.renderingMode!=="3d"&&i.push({message:`layers.${l}: property "renderingMode" must be either "2d" or "3d"`}),i},o.validateLight=r0,o.validateStyle=Is,o.vectorTile=Ia,o.warnOnce=te,o.wrap=B}),a(["./shared"],function(o){"use strict";function m(Y){let P=typeof Y;if(P==="number"||P==="boolean"||P==="string"||Y==null)return JSON.stringify(Y);if(Array.isArray(Y)){let J="[";for(let re of Y)J+=`${m(re)},`;return`${J}]`}let L=Object.keys(Y).sort(),j="{";for(let J=0;J<L.length;J++)j+=`${JSON.stringify(L[J])}:${m(Y[L[J]])},`;return`${j}}`}function v(Y){let P="";for(let L of o.refProperties)P+=`/${m(Y[L])}`;return P}class b{constructor(P){this.keyCache={},P&&this.replace(P)}replace(P){this._layerConfigs={},this._layers={},this.update(P,[])}update(P,L){for(let J of P){this._layerConfigs[J.id]=J;let re=this._layers[J.id]=o.createStyleLayer(J);re._featureFilter=o.createFilter(re.filter),this.keyCache[J.id]&&delete this.keyCache[J.id]}for(let J of L)delete this.keyCache[J],delete this._layerConfigs[J],delete this._layers[J];this.familiesBySource={};let j=function(J,re){let pe={};for(let ce=0;ce<J.length;ce++){let fe=re&&re[J[ce].id]||v(J[ce]);re&&(re[J[ce].id]=fe);let ke=pe[fe];ke||(ke=pe[fe]=[]),ke.push(J[ce])}let ue=[];for(let ce in pe)ue.push(pe[ce]);return ue}(Object.values(this._layerConfigs),this.keyCache);for(let J of j){let re=J.map(Ge=>this._layers[Ge.id]),pe=re[0];if(pe.visibility==="none")continue;let ue=pe.source||"",ce=this.familiesBySource[ue];ce||(ce=this.familiesBySource[ue]={});let fe=pe.sourceLayer||"_geojsonTileLayer",ke=ce[fe];ke||(ke=ce[fe]=[]),ke.push(re)}}}class C{constructor(P){let L={},j=[];for(let ue in P){let ce=P[ue],fe=L[ue]={};for(let ke in ce){let Ge=ce[+ke];if(!Ge||Ge.bitmap.width===0||Ge.bitmap.height===0)continue;let Ae={x:0,y:0,w:Ge.bitmap.width+2,h:Ge.bitmap.height+2};j.push(Ae),fe[ke]={rect:Ae,metrics:Ge.metrics}}}let{w:J,h:re}=o.potpack(j),pe=new o.AlphaImage({width:J||1,height:re||1});for(let ue in P){let ce=P[ue];for(let fe in ce){let ke=ce[+fe];if(!ke||ke.bitmap.width===0||ke.bitmap.height===0)continue;let Ge=L[ue][fe].rect;o.AlphaImage.copy(ke.bitmap,pe,{x:0,y:0},{x:Ge.x+1,y:Ge.y+1},ke.bitmap)}}this.image=pe,this.positions=L}}o.register("GlyphAtlas",C);class T{constructor(P){this.tileID=new o.OverscaledTileID(P.tileID.overscaledZ,P.tileID.wrap,P.tileID.canonical.z,P.tileID.canonical.x,P.tileID.canonical.y),this.uid=P.uid,this.zoom=P.zoom,this.pixelRatio=P.pixelRatio,this.tileSize=P.tileSize,this.source=P.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=P.showCollisionBoxes,this.collectResourceTiming=!!P.collectResourceTiming,this.returnDependencies=!!P.returnDependencies,this.promoteId=P.promoteId}parse(P,L,j,J,re){this.status="parsing",this.data=P,this.collisionBoxArray=new o.CollisionBoxArray;let pe=new o.DictionaryCoder(Object.keys(P.layers).sort()),ue=new o.FeatureIndex(this.tileID,this.promoteId);ue.bucketLayerIDs=[];let ce={},fe={featureIndex:ue,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:j},ke=L.familiesBySource[this.source];for(let Wt in ke){let Nt=P.layers[Wt];if(!Nt)continue;Nt.version===1&&o.warnOnce(`Vector tile source "${this.source}" layer "${Wt}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let Dt=pe.encode(Wt),cr=[];for(let nr=0;nr<Nt.length;nr++){let Rr=Nt.feature(nr),Fr=ue.getId(Rr,Wt);cr.push({feature:Rr,id:Fr,index:nr,sourceLayerIndex:Dt})}for(let nr of ke[Wt]){let Rr=nr[0];Rr.minzoom&&this.zoom<Math.floor(Rr.minzoom)||Rr.maxzoom&&this.zoom>=Rr.maxzoom||Rr.visibility!=="none"&&(B(nr,this.zoom,j),(ce[Rr.id]=Rr.createBucket({index:ue.bucketLayerIDs.length,layers:nr,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Dt,sourceID:this.source})).populate(cr,fe,this.tileID.canonical),ue.bucketLayerIDs.push(nr.map(Fr=>Fr.id)))}}let Ge,Ae,gt,lt,xt=o.mapObject(fe.glyphDependencies,Wt=>Object.keys(Wt).map(Number));Object.keys(xt).length?J.send("getGlyphs",{uid:this.uid,stacks:xt},(Wt,Nt)=>{Ge||(Ge=Wt,Ae=Nt,Yt.call(this))}):Ae={};let Ct=Object.keys(fe.iconDependencies);Ct.length?J.send("getImages",{icons:Ct,source:this.source,tileID:this.tileID,type:"icons"},(Wt,Nt)=>{Ge||(Ge=Wt,gt=Nt,Yt.call(this))}):gt={};let oi=Object.keys(fe.patternDependencies);function Yt(){if(Ge)return re(Ge);if(Ae&>&<){let Wt=new C(Ae),Nt=new o.ImageAtlas(gt,lt);for(let Dt in ce){let cr=ce[Dt];cr instanceof o.SymbolBucket?(B(cr.layers,this.zoom,j),o.performSymbolLayout(cr,Ae,Wt.positions,gt,Nt.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):cr.hasPattern&&(cr instanceof o.LineBucket||cr instanceof o.FillBucket||cr instanceof o.FillExtrusionBucket)&&(B(cr.layers,this.zoom,j),cr.addFeatures(fe,this.tileID.canonical,Nt.patternPositions))}this.status="done",re(null,{buckets:Object.values(ce).filter(Dt=>!Dt.isEmpty()),featureIndex:ue,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Wt.image,imageAtlas:Nt,glyphMap:this.returnDependencies?Ae:null,iconMap:this.returnDependencies?gt:null,glyphPositions:this.returnDependencies?Wt.positions:null})}}oi.length?J.send("getImages",{icons:oi,source:this.source,tileID:this.tileID,type:"patterns"},(Wt,Nt)=>{Ge||(Ge=Wt,lt=Nt,Yt.call(this))}):lt={},Yt.call(this)}}function B(Y,P,L){let j=new o.EvaluationParameters(P);for(let J of Y)J.recalculate(j,L)}function W(Y,P){let L=o.getArrayBuffer(Y.request,(j,J,re,pe)=>{j?P(j):J&&P(null,{vectorTile:new o.vectorTile.VectorTile(new o.pbf(J)),rawData:J,cacheControl:re,expires:pe})});return()=>{L.cancel(),P()}}class q{constructor(P,L,j,J){this.actor=P,this.layerIndex=L,this.availableImages=j,this.loadVectorData=J||W,this.loading={},this.loaded={}}loadTile(P,L){let j=P.uid;this.loading||(this.loading={});let J=!!(P&&P.request&&P.request.collectResourceTiming)&&new o.RequestPerformance(P.request),re=this.loading[j]=new T(P);re.abort=this.loadVectorData(P,(pe,ue)=>{if(delete this.loading[j],pe||!ue)return re.status="done",this.loaded[j]=re,L(pe);let ce=ue.rawData,fe={};ue.expires&&(fe.expires=ue.expires),ue.cacheControl&&(fe.cacheControl=ue.cacheControl);let ke={};if(J){let Ge=J.finish();Ge&&(ke.resourceTiming=JSON.parse(JSON.stringify(Ge)))}re.vectorTile=ue.vectorTile,re.parse(ue.vectorTile,this.layerIndex,this.availableImages,this.actor,(Ge,Ae)=>{if(Ge||!Ae)return L(Ge);L(null,o.extend({rawTileData:ce.slice(0)},Ae,fe,ke))}),this.loaded=this.loaded||{},this.loaded[j]=re})}reloadTile(P,L){let j=this.loaded,J=P.uid,re=this;if(j&&j[J]){let pe=j[J];pe.showCollisionBoxes=P.showCollisionBoxes;let ue=(ce,fe)=>{let ke=pe.reloadCallback;ke&&(delete pe.reloadCallback,pe.parse(pe.vectorTile,re.layerIndex,this.availableImages,re.actor,ke)),L(ce,fe)};pe.status==="parsing"?pe.reloadCallback=ue:pe.status==="done"&&(pe.vectorTile?pe.parse(pe.vectorTile,this.layerIndex,this.availableImages,this.actor,ue):ue())}}abortTile(P,L){let j=this.loading,J=P.uid;j&&j[J]&&j[J].abort&&(j[J].abort(),delete j[J]),L()}removeTile(P,L){let j=this.loaded,J=P.uid;j&&j[J]&&delete j[J],L()}}class ee{constructor(){this.loaded={}}loadTile(P,L){let{uid:j,encoding:J,rawImageData:re}=P,pe=o.isImageBitmap(re)?this.getImageData(re):re,ue=new o.DEMData(j,pe,J);this.loaded=this.loaded||{},this.loaded[j]=ue,L(null,ue)}getImageData(P){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(P.width,P.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=P.width,this.offscreenCanvas.height=P.height,this.offscreenCanvasContext.drawImage(P,0,0,P.width,P.height);let L=this.offscreenCanvasContext.getImageData(-1,-1,P.width+2,P.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new o.RGBAImage({width:L.width,height:L.height},L.data)}removeTile(P){let L=this.loaded,j=P.uid;L&&L[j]&&delete L[j]}}var le=function Y(P,L){var j,J=P&&P.type;if(J==="FeatureCollection")for(j=0;j<P.features.length;j++)Y(P.features[j],L);else if(J==="GeometryCollection")for(j=0;j<P.geometries.length;j++)Y(P.geometries[j],L);else if(J==="Feature")Y(P.geometry,L);else if(J==="Polygon")de(P.coordinates,L);else if(J==="MultiPolygon")for(j=0;j<P.coordinates.length;j++)de(P.coordinates[j],L);return P};function de(Y,P){if(Y.length!==0){H(Y[0],P);for(var L=1;L<Y.length;L++)H(Y[L],!P)}}function H(Y,P){for(var L=0,j=0,J=0,re=Y.length,pe=re-1;J<re;pe=J++){var ue=(Y[J][0]-Y[pe][0])*(Y[pe][1]+Y[J][1]),ce=L+ue;j+=Math.abs(L)>=Math.abs(ue)?L-ce+ue:ue-ce+L,L=ce}L+j>=0!=!!P&&Y.reverse()}let Q=o.vectorTile.VectorTileFeature.prototype.toGeoJSON;class te{constructor(P){this._feature=P,this.extent=o.EXTENT,this.type=P.type,this.properties=P.tags,"id"in P&&!isNaN(P.id)&&(this.id=parseInt(P.id,10))}loadGeometry(){if(this._feature.type===1){let P=[];for(let L of this._feature.geometry)P.push([new o.pointGeometry(L[0],L[1])]);return P}{let P=[];for(let L of this._feature.geometry){let j=[];for(let J of L)j.push(new o.pointGeometry(J[0],J[1]));P.push(j)}return P}}toGeoJSON(P,L,j){return Q.call(this,P,L,j)}}class ve{constructor(P){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=o.EXTENT,this.length=P.length,this._features=P}feature(P){return new te(this._features[P])}}var Me={exports:{}},Ce=o.pointGeometry,Be=o.vectorTile.VectorTileFeature,Fe=qe;function qe(Y,P){this.options=P||{},this.features=Y,this.length=Y.length}function ht(Y,P){this.id=typeof Y.id=="number"?Y.id:void 0,this.type=Y.type,this.rawGeometry=Y.type===1?[Y.geometry]:Y.geometry,this.properties=Y.tags,this.extent=P||4096}qe.prototype.feature=function(Y){return new ht(this.features[Y],this.options.extent)},ht.prototype.loadGeometry=function(){var Y=this.rawGeometry;this.geometry=[];for(var P=0;P<Y.length;P++){for(var L=Y[P],j=[],J=0;J<L.length;J++)j.push(new Ce(L[J][0],L[J][1]));this.geometry.push(j)}return this.geometry},ht.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var Y=this.geometry,P=1/0,L=-1/0,j=1/0,J=-1/0,re=0;re<Y.length;re++)for(var pe=Y[re],ue=0;ue<pe.length;ue++){var ce=pe[ue];P=Math.min(P,ce.x),L=Math.max(L,ce.x),j=Math.min(j,ce.y),J=Math.max(J,ce.y)}return[P,j,L,J]},ht.prototype.toGeoJSON=Be.prototype.toGeoJSON;var Tt=o.pbf,Gt=Fe;function Jt(Y){var P=new Tt;return function(L,j){for(var J in L.layers)j.writeMessage(3,at,L.layers[J])}(Y,P),P.finish()}function at(Y,P){var L;P.writeVarintField(15,Y.version||1),P.writeStringField(1,Y.name||""),P.writeVarintField(5,Y.extent||4096);var j={keys:[],values:[],keycache:{},valuecache:{}};for(L=0;L<Y.length;L++)j.feature=Y.feature(L),P.writeMessage(2,jt,j);var J=j.keys;for(L=0;L<J.length;L++)P.writeStringField(3,J[L]);var re=j.values;for(L=0;L<re.length;L++)P.writeMessage(4,Xi,re[L])}function jt(Y,P){var L=Y.feature;L.id!==void 0&&P.writeVarintField(1,L.id),P.writeMessage(2,zi,Y),P.writeVarintField(3,L.type),P.writeMessage(4,ur,L)}function zi(Y,P){var L=Y.feature,j=Y.keys,J=Y.values,re=Y.keycache,pe=Y.valuecache;for(var ue in L.properties){var ce=L.properties[ue],fe=re[ue];if(ce!==null){fe===void 0&&(j.push(ue),re[ue]=fe=j.length-1),P.writeVarint(fe);var ke=typeof ce;ke!=="string"&&ke!=="boolean"&&ke!=="number"&&(ce=JSON.stringify(ce));var Ge=ke+":"+ce,Ae=pe[Ge];Ae===void 0&&(J.push(ce),pe[Ge]=Ae=J.length-1),P.writeVarint(Ae)}}}function Ii(Y,P){return(P<<3)+(7&Y)}function Ht(Y){return Y<<1^Y>>31}function ur(Y,P){for(var L=Y.loadGeometry(),j=Y.type,J=0,re=0,pe=L.length,ue=0;ue<pe;ue++){var ce=L[ue],fe=1;j===1&&(fe=ce.length),P.writeVarint(Ii(1,fe));for(var ke=j===3?ce.length-1:ce.length,Ge=0;Ge<ke;Ge++){Ge===1&&j!==1&&P.writeVarint(Ii(2,ke-1));var Ae=ce[Ge].x-J,gt=ce[Ge].y-re;P.writeVarint(Ht(Ae)),P.writeVarint(Ht(gt)),J+=Ae,re+=gt}j===3&&P.writeVarint(Ii(7,1))}}function Xi(Y,P){var L=typeof Y;L==="string"?P.writeStringField(1,Y):L==="boolean"?P.writeBooleanField(7,Y):L==="number"&&(Y%1!=0?P.writeDoubleField(3,Y):Y<0?P.writeSVarintField(6,Y):P.writeVarintField(5,Y))}Me.exports=Jt,Me.exports.fromVectorTileJs=Jt,Me.exports.fromGeojsonVt=function(Y,P){P=P||{};var L={};for(var j in Y)L[j]=new Gt(Y[j].features,P),L[j].name=j,L[j].version=P.version,L[j].extent=P.extent;return Jt({layers:L})},Me.exports.GeoJSONWrapper=Gt;var si=Me.exports;function ii(Y,P,L,j,J,re){if(J-j<=L)return;let pe=j+J>>1;_i(Y,P,pe,j,J,re%2),ii(Y,P,L,j,pe-1,re+1),ii(Y,P,L,pe+1,J,re+1)}function _i(Y,P,L,j,J,re){for(;J>j;){if(J-j>600){let fe=J-j+1,ke=L-j+1,Ge=Math.log(fe),Ae=.5*Math.exp(2*Ge/3),gt=.5*Math.sqrt(Ge*Ae*(fe-Ae)/fe)*(ke-fe/2<0?-1:1);_i(Y,P,L,Math.max(j,Math.floor(L-ke*Ae/fe+gt)),Math.min(J,Math.floor(L+(fe-ke)*Ae/fe+gt)),re)}let pe=P[2*L+re],ue=j,ce=J;for(Ei(Y,P,j,L),P[2*J+re]>pe&&Ei(Y,P,j,J);ue<ce;){for(Ei(Y,P,ue,ce),ue++,ce--;P[2*ue+re]<pe;)ue++;for(;P[2*ce+re]>pe;)ce--}P[2*j+re]===pe?Ei(Y,P,j,ce):(ce++,Ei(Y,P,ce,J)),ce<=L&&(j=ce+1),L<=ce&&(J=ce-1)}}function Ei(Y,P,L,j){Li(Y,L,j),Li(P,2*L,2*j),Li(P,2*L+1,2*j+1)}function Li(Y,P,L){let j=Y[P];Y[P]=Y[L],Y[L]=j}function Fi(Y,P,L,j){let J=Y-L,re=P-j;return J*J+re*re}let Ji=Y=>Y[0],Mr=Y=>Y[1];class tn{constructor(P,L=Ji,j=Mr,J=64,re=Float64Array){this.nodeSize=J,this.points=P;let pe=P.length<65536?Uint16Array:Uint32Array,ue=this.ids=new pe(P.length),ce=this.coords=new re(2*P.length);for(let fe=0;fe<P.length;fe++)ue[fe]=fe,ce[2*fe]=L(P[fe]),ce[2*fe+1]=j(P[fe]);ii(ue,ce,J,0,ue.length-1,0)}range(P,L,j,J){return function(re,pe,ue,ce,fe,ke,Ge){let Ae=[0,re.length-1,0],gt=[],lt,xt;for(;Ae.length;){let Ct=Ae.pop(),oi=Ae.pop(),Yt=Ae.pop();if(oi-Yt<=Ge){for(let Dt=Yt;Dt<=oi;Dt++)lt=pe[2*Dt],xt=pe[2*Dt+1],lt>=ue&<<=fe&&xt>=ce&&xt<=ke&>.push(re[Dt]);continue}let Wt=Math.floor((Yt+oi)/2);lt=pe[2*Wt],xt=pe[2*Wt+1],lt>=ue&<<=fe&&xt>=ce&&xt<=ke&>.push(re[Wt]);let Nt=(Ct+1)%2;(Ct===0?ue<=lt:ce<=xt)&&(Ae.push(Yt),Ae.push(Wt-1),Ae.push(Nt)),(Ct===0?fe>=lt:ke>=xt)&&(Ae.push(Wt+1),Ae.push(oi),Ae.push(Nt))}return gt}(this.ids,this.coords,P,L,j,J,this.nodeSize)}within(P,L,j){return function(J,re,pe,ue,ce,fe){let ke=[0,J.length-1,0],Ge=[],Ae=ce*ce;for(;ke.length;){let gt=ke.pop(),lt=ke.pop(),xt=ke.pop();if(lt-xt<=fe){for(let Nt=xt;Nt<=lt;Nt++)Fi(re[2*Nt],re[2*Nt+1],pe,ue)<=Ae&&Ge.push(J[Nt]);continue}let Ct=Math.floor((xt+lt)/2),oi=re[2*Ct],Yt=re[2*Ct+1];Fi(oi,Yt,pe,ue)<=Ae&&Ge.push(J[Ct]);let Wt=(gt+1)%2;(gt===0?pe-ce<=oi:ue-ce<=Yt)&&(ke.push(xt),ke.push(Ct-1),ke.push(Wt)),(gt===0?pe+ce>=oi:ue+ce>=Yt)&&(ke.push(Ct+1),ke.push(lt),ke.push(Wt))}return Ge}(this.ids,this.coords,P,L,j,this.nodeSize)}}let oo={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:Y=>Y},ri=Math.fround||(Hr=new Float32Array(1),Y=>(Hr[0]=+Y,Hr[0]));var Hr;class hn{constructor(P){this.options=K(Object.create(oo),P),this.trees=new Array(this.options.maxZoom+1)}load(P){let{log:L,minZoom:j,maxZoom:J,nodeSize:re}=this.options;L&&console.time("total time");let pe=`prepare ${P.length} points`;L&&console.time(pe),this.points=P;let ue=[];for(let ce=0;ce<P.length;ce++)P[ce].geometry&&ue.push(Lr(P[ce],ce));this.trees[J+1]=new tn(ue,he,Se,re,Float32Array),L&&console.timeEnd(pe);for(let ce=J;ce>=j;ce--){let fe=+Date.now();ue=this._cluster(ue,ce),this.trees[ce]=new tn(ue,he,Se,re,Float32Array),L&&console.log("z%d: %d clusters in %dms",ce,ue.length,+Date.now()-fe)}return L&&console.timeEnd("total time"),this}getClusters(P,L){let j=((P[0]+180)%360+360)%360-180,J=Math.max(-90,Math.min(90,P[1])),re=P[2]===180?180:((P[2]+180)%360+360)%360-180,pe=Math.max(-90,Math.min(90,P[3]));if(P[2]-P[0]>=360)j=-180,re=180;else if(j>re){let ke=this.getClusters([j,J,180,pe],L),Ge=this.getClusters([-180,J,re,pe],L);return ke.concat(Ge)}let ue=this.trees[this._limitZoom(L)],ce=ue.range(V(j),F(pe),V(re),F(J)),fe=[];for(let ke of ce){let Ge=ue.points[ke];fe.push(Ge.numPoints?es(Ge):this.points[Ge.index])}return fe}getChildren(P){let L=this._getOriginId(P),j=this._getOriginZoom(P),J="No cluster with the specified id.",re=this.trees[j];if(!re)throw new Error(J);let pe=re.points[L];if(!pe)throw new Error(J);let ue=this.options.radius/(this.options.extent*Math.pow(2,j-1)),ce=re.within(pe.x,pe.y,ue),fe=[];for(let ke of ce){let Ge=re.points[ke];Ge.parentId===P&&fe.push(Ge.numPoints?es(Ge):this.points[Ge.index])}if(fe.length===0)throw new Error(J);return fe}getLeaves(P,L,j){let J=[];return this._appendLeaves(J,P,L=L||10,j=j||0,0),J}getTile(P,L,j){let J=this.trees[this._limitZoom(P)],re=Math.pow(2,P),{extent:pe,radius:ue}=this.options,ce=ue/pe,fe=(j-ce)/re,ke=(j+1+ce)/re,Ge={features:[]};return this._addTileFeatures(J.range((L-ce)/re,fe,(L+1+ce)/re,ke),J.points,L,j,re,Ge),L===0&&this._addTileFeatures(J.range(1-ce/re,fe,1,ke),J.points,re,j,re,Ge),L===re-1&&this._addTileFeatures(J.range(0,fe,ce/re,ke),J.points,-1,j,re,Ge),Ge.features.length?Ge:null}getClusterExpansionZoom(P){let L=this._getOriginZoom(P)-1;for(;L<=this.options.maxZoom;){let j=this.getChildren(P);if(L++,j.length!==1)break;P=j[0].properties.cluster_id}return L}_appendLeaves(P,L,j,J,re){let pe=this.getChildren(L);for(let ue of pe){let ce=ue.properties;if(ce&&ce.cluster?re+ce.point_count<=J?re+=ce.point_count:re=this._appendLeaves(P,ce.cluster_id,j,J,re):re<J?re++:P.push(ue),P.length===j)break}return re}_addTileFeatures(P,L,j,J,re,pe){for(let ue of P){let ce=L[ue],fe=ce.numPoints,ke,Ge,Ae;if(fe)ke=_e(ce),Ge=ce.x,Ae=ce.y;else{let xt=this.points[ce.index];ke=xt.properties,Ge=V(xt.geometry.coordinates[0]),Ae=F(xt.geometry.coordinates[1])}let gt={type:1,geometry:[[Math.round(this.options.extent*(Ge*re-j)),Math.round(this.options.extent*(Ae*re-J))]],tags:ke},lt;fe?lt=ce.id:this.options.generateId?lt=ce.index:this.points[ce.index].id&&(lt=this.points[ce.index].id),lt!==void 0&&(gt.id=lt),pe.features.push(gt)}}_limitZoom(P){return Math.max(this.options.minZoom,Math.min(+P,this.options.maxZoom+1))}_cluster(P,L){let j=[],{radius:J,extent:re,reduce:pe,minPoints:ue}=this.options,ce=J/(re*Math.pow(2,L));for(let fe=0;fe<P.length;fe++){let ke=P[fe];if(ke.zoom<=L)continue;ke.zoom=L;let Ge=this.trees[L+1],Ae=Ge.within(ke.x,ke.y,ce),gt=ke.numPoints||1,lt=gt;for(let xt of Ae){let Ct=Ge.points[xt];Ct.zoom>L&&(lt+=Ct.numPoints||1)}if(lt>gt&<>=ue){let xt=ke.x*gt,Ct=ke.y*gt,oi=pe&>>1?this._map(ke,!0):null,Yt=(fe<<5)+(L+1)+this.points.length;for(let Wt of Ae){let Nt=Ge.points[Wt];if(Nt.zoom<=L)continue;Nt.zoom=L;let Dt=Nt.numPoints||1;xt+=Nt.x*Dt,Ct+=Nt.y*Dt,Nt.parentId=Yt,pe&&(oi||(oi=this._map(ke,!0)),pe(oi,this._map(Nt)))}ke.parentId=Yt,j.push(rn(xt/lt,Ct/lt,Yt,lt,oi))}else if(j.push(ke),lt>1)for(let xt of Ae){let Ct=Ge.points[xt];Ct.zoom<=L||(Ct.zoom=L,j.push(Ct))}}return j}_getOriginId(P){return P-this.points.length>>5}_getOriginZoom(P){return(P-this.points.length)%32}_map(P,L){if(P.numPoints)return L?K({},P.properties):P.properties;let j=this.points[P.index].properties,J=this.options.map(j);return L&&J===j?K({},J):J}}function rn(Y,P,L,j,J){return{x:ri(Y),y:ri(P),zoom:1/0,id:L,parentId:-1,numPoints:j,properties:J}}function Lr(Y,P){let[L,j]=Y.geometry.coordinates;return{x:ri(V(L)),y:ri(F(j)),zoom:1/0,index:P,parentId:-1}}function es(Y){return{type:"Feature",id:Y.id,properties:_e(Y),geometry:{type:"Point",coordinates:[(P=Y.x,360*(P-.5)),U(Y.y)]}};var P}function _e(Y){let P=Y.numPoints,L=P>=1e4?`${Math.round(P/1e3)}k`:P>=1e3?Math.round(P/100)/10+"k":P;return K(K({},Y.properties),{cluster:!0,cluster_id:Y.id,point_count:P,point_count_abbreviated:L})}function V(Y){return Y/360+.5}function F(Y){let P=Math.sin(Y*Math.PI/180),L=.5-.25*Math.log((1+P)/(1-P))/Math.PI;return L<0?0:L>1?1:L}function U(Y){let P=(180-360*Y)*Math.PI/180;return 360*Math.atan(Math.exp(P))/Math.PI-90}function K(Y,P){for(let L in P)Y[L]=P[L];return Y}function he(Y){return Y.x}function Se(Y){return Y.y}function Ve(Y,P,L,j){for(var J,re=j,pe=L-P>>1,ue=L-P,ce=Y[P],fe=Y[P+1],ke=Y[L],Ge=Y[L+1],Ae=P+3;Ae<L;Ae+=3){var gt=He(Y[Ae],Y[Ae+1],ce,fe,ke,Ge);if(gt>re)J=Ae,re=gt;else if(gt===re){var lt=Math.abs(Ae-pe);lt<ue&&(J=Ae,ue=lt)}}re>j&&(J-P>3&&Ve(Y,P,J,j),Y[J+2]=re,L-J>3&&Ve(Y,J,L,j))}function He(Y,P,L,j,J,re){var pe=J-L,ue=re-j;if(pe!==0||ue!==0){var ce=((Y-L)*pe+(P-j)*ue)/(pe*pe+ue*ue);ce>1?(L=J,j=re):ce>0&&(L+=pe*ce,j+=ue*ce)}return(pe=Y-L)*pe+(ue=P-j)*ue}function ye(Y,P,L,j){var J={id:Y===void 0?null:Y,type:P,geometry:L,tags:j,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(re){var pe=re.geometry,ue=re.type;if(ue==="Point"||ue==="MultiPoint"||ue==="LineString")Re(re,pe);else if(ue==="Polygon"||ue==="MultiLineString")for(var ce=0;ce<pe.length;ce++)Re(re,pe[ce]);else if(ue==="MultiPolygon")for(ce=0;ce<pe.length;ce++)for(var fe=0;fe<pe[ce].length;fe++)Re(re,pe[ce][fe])}(J),J}function Re(Y,P){for(var L=0;L<P.length;L+=3)Y.minX=Math.min(Y.minX,P[L]),Y.minY=Math.min(Y.minY,P[L+1]),Y.maxX=Math.max(Y.maxX,P[L]),Y.maxY=Math.max(Y.maxY,P[L+1])}function ie(Y,P,L,j){if(P.geometry){var J=P.geometry.coordinates,re=P.geometry.type,pe=Math.pow(L.tolerance/((1<<L.maxZoom)*L.extent),2),ue=[],ce=P.id;if(L.promoteId?ce=P.properties[L.promoteId]:L.generateId&&(ce=j||0),re==="Point")Xe(J,ue);else if(re==="MultiPoint")for(var fe=0;fe<J.length;fe++)Xe(J[fe],ue);else if(re==="LineString")$e(J,ue,pe,!1);else if(re==="MultiLineString"){if(L.lineMetrics){for(fe=0;fe<J.length;fe++)$e(J[fe],ue=[],pe,!1),Y.push(ye(ce,"LineString",ue,P.properties));return}ft(J,ue,pe,!1)}else if(re==="Polygon")ft(J,ue,pe,!0);else{if(re!=="MultiPolygon"){if(re==="GeometryCollection"){for(fe=0;fe<P.geometry.geometries.length;fe++)ie(Y,{id:ce,geometry:P.geometry.geometries[fe],properties:P.properties},L,j);return}throw new Error("Input data is not a valid GeoJSON object.")}for(fe=0;fe<J.length;fe++){var ke=[];ft(J[fe],ke,pe,!0),ue.push(ke)}}Y.push(ye(ce,re,ue,P.properties))}}function Xe(Y,P){P.push(ut(Y[0])),P.push(Xt(Y[1])),P.push(0)}function $e(Y,P,L,j){for(var J,re,pe=0,ue=0;ue<Y.length;ue++){var ce=ut(Y[ue][0]),fe=Xt(Y[ue][1]);P.push(ce),P.push(fe),P.push(0),ue>0&&(pe+=j?(J*fe-ce*re)/2:Math.sqrt(Math.pow(ce-J,2)+Math.pow(fe-re,2))),J=ce,re=fe}var ke=P.length-3;P[2]=1,Ve(P,0,ke,L),P[ke+2]=1,P.size=Math.abs(pe),P.start=0,P.end=P.size}function ft(Y,P,L,j){for(var J=0;J<Y.length;J++){var re=[];$e(Y[J],re,L,j),P.push(re)}}function ut(Y){return Y/360+.5}function Xt(Y){var P=Math.sin(Y*Math.PI/180),L=.5-.25*Math.log((1+P)/(1-P))/Math.PI;return L<0?0:L>1?1:L}function At(Y,P,L,j,J,re,pe,ue){if(j/=P,re>=(L/=P)&&pe<j)return Y;if(pe<L||re>=j)return null;for(var ce=[],fe=0;fe<Y.length;fe++){var ke=Y[fe],Ge=ke.geometry,Ae=ke.type,gt=J===0?ke.minX:ke.minY,lt=J===0?ke.maxX:ke.maxY;if(gt>=L&<<j)ce.push(ke);else if(!(lt<L||gt>=j)){var xt=[];if(Ae==="Point"||Ae==="MultiPoint")Ue(Ge,xt,L,j,J);else if(Ae==="LineString")It(Ge,xt,L,j,J,!1,ue.lineMetrics);else if(Ae==="MultiLineString")ni(Ge,xt,L,j,J,!1);else if(Ae==="Polygon")ni(Ge,xt,L,j,J,!0);else if(Ae==="MultiPolygon")for(var Ct=0;Ct<Ge.length;Ct++){var oi=[];ni(Ge[Ct],oi,L,j,J,!0),oi.length&&xt.push(oi)}if(xt.length){if(ue.lineMetrics&&Ae==="LineString"){for(Ct=0;Ct<xt.length;Ct++)ce.push(ye(ke.id,Ae,xt[Ct],ke.tags));continue}Ae!=="LineString"&&Ae!=="MultiLineString"||(xt.length===1?(Ae="LineString",xt=xt[0]):Ae="MultiLineString"),Ae!=="Point"&&Ae!=="MultiPoint"||(Ae=xt.length===3?"Point":"MultiPoint"),ce.push(ye(ke.id,Ae,xt,ke.tags))}}}return ce.length?ce:null}function Ue(Y,P,L,j,J){for(var re=0;re<Y.length;re+=3){var pe=Y[re+J];pe>=L&&pe<=j&&(P.push(Y[re]),P.push(Y[re+1]),P.push(Y[re+2]))}}function It(Y,P,L,j,J,re,pe){for(var ue,ce,fe=yt(Y),ke=J===0?St:tr,Ge=Y.start,Ae=0;Ae<Y.length-3;Ae+=3){var gt=Y[Ae],lt=Y[Ae+1],xt=Y[Ae+2],Ct=Y[Ae+3],oi=Y[Ae+4],Yt=J===0?gt:lt,Wt=J===0?Ct:oi,Nt=!1;pe&&(ue=Math.sqrt(Math.pow(gt-Ct,2)+Math.pow(lt-oi,2))),Yt<L?Wt>L&&(ce=ke(fe,gt,lt,Ct,oi,L),pe&&(fe.start=Ge+ue*ce)):Yt>j?Wt<j&&(ce=ke(fe,gt,lt,Ct,oi,j),pe&&(fe.start=Ge+ue*ce)):gi(fe,gt,lt,xt),Wt<L&&Yt>=L&&(ce=ke(fe,gt,lt,Ct,oi,L),Nt=!0),Wt>j&&Yt<=j&&(ce=ke(fe,gt,lt,Ct,oi,j),Nt=!0),!re&&Nt&&(pe&&(fe.end=Ge+ue*ce),P.push(fe),fe=yt(Y)),pe&&(Ge+=ue)}var Dt=Y.length-3;gt=Y[Dt],lt=Y[Dt+1],xt=Y[Dt+2],(Yt=J===0?gt:lt)>=L&&Yt<=j&&gi(fe,gt,lt,xt),Dt=fe.length-3,re&&Dt>=3&&(fe[Dt]!==fe[0]||fe[Dt+1]!==fe[1])&&gi(fe,fe[0],fe[1],fe[2]),fe.length&&P.push(fe)}function yt(Y){var P=[];return P.size=Y.size,P.start=Y.start,P.end=Y.end,P}function ni(Y,P,L,j,J,re){for(var pe=0;pe<Y.length;pe++)It(Y[pe],P,L,j,J,re,!1)}function gi(Y,P,L,j){Y.push(P),Y.push(L),Y.push(j)}function St(Y,P,L,j,J,re){var pe=(re-P)/(j-P);return Y.push(re),Y.push(L+(J-L)*pe),Y.push(1),pe}function tr(Y,P,L,j,J,re){var pe=(re-L)/(J-L);return Y.push(P+(j-P)*pe),Y.push(re),Y.push(1),pe}function ci(Y,P){for(var L=[],j=0;j<Y.length;j++){var J,re=Y[j],pe=re.type;if(pe==="Point"||pe==="MultiPoint"||pe==="LineString")J=Ri(re.geometry,P);else if(pe==="MultiLineString"||pe==="Polygon"){J=[];for(var ue=0;ue<re.geometry.length;ue++)J.push(Ri(re.geometry[ue],P))}else if(pe==="MultiPolygon")for(J=[],ue=0;ue<re.geometry.length;ue++){for(var ce=[],fe=0;fe<re.geometry[ue].length;fe++)ce.push(Ri(re.geometry[ue][fe],P));J.push(ce)}L.push(ye(re.id,pe,J,re.tags))}return L}function Ri(Y,P){var L=[];L.size=Y.size,Y.start!==void 0&&(L.start=Y.start,L.end=Y.end);for(var j=0;j<Y.length;j+=3)L.push(Y[j]+P,Y[j+1],Y[j+2]);return L}function hi(Y,P){if(Y.transformed)return Y;var L,j,J,re=1<<Y.z,pe=Y.x,ue=Y.y;for(L=0;L<Y.features.length;L++){var ce=Y.features[L],fe=ce.geometry,ke=ce.type;if(ce.geometry=[],ke===1)for(j=0;j<fe.length;j+=2)ce.geometry.push(Ft(fe[j],fe[j+1],P,re,pe,ue));else for(j=0;j<fe.length;j++){var Ge=[];for(J=0;J<fe[j].length;J+=2)Ge.push(Ft(fe[j][J],fe[j][J+1],P,re,pe,ue));ce.geometry.push(Ge)}}return Y.transformed=!0,Y}function Ft(Y,P,L,j,J,re){return[Math.round(L*(Y*j-J)),Math.round(L*(P*j-re))]}function di(Y,P,L,j,J){for(var re=P===J.maxZoom?0:J.tolerance/((1<<P)*J.extent),pe={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:L,y:j,z:P,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},ue=0;ue<Y.length;ue++){pe.numFeatures++,ir(pe,Y[ue],re,J);var ce=Y[ue].minX,fe=Y[ue].minY,ke=Y[ue].maxX,Ge=Y[ue].maxY;ce<pe.minX&&(pe.minX=ce),fe<pe.minY&&(pe.minY=fe),ke>pe.maxX&&(pe.maxX=ke),Ge>pe.maxY&&(pe.maxY=Ge)}return pe}function ir(Y,P,L,j){var J=P.geometry,re=P.type,pe=[];if(re==="Point"||re==="MultiPoint")for(var ue=0;ue<J.length;ue+=3)pe.push(J[ue]),pe.push(J[ue+1]),Y.numPoints++,Y.numSimplified++;else if(re==="LineString")Ti(pe,J,Y,L,!1,!1);else if(re==="MultiLineString"||re==="Polygon")for(ue=0;ue<J.length;ue++)Ti(pe,J[ue],Y,L,re==="Polygon",ue===0);else if(re==="MultiPolygon")for(var ce=0;ce<J.length;ce++){var fe=J[ce];for(ue=0;ue<fe.length;ue++)Ti(pe,fe[ue],Y,L,!0,ue===0)}if(pe.length){var ke=P.tags||null;if(re==="LineString"&&j.lineMetrics){for(var Ge in ke={},P.tags)ke[Ge]=P.tags[Ge];ke.mapbox_clip_start=J.start/J.size,ke.mapbox_clip_end=J.end/J.size}var Ae={geometry:pe,type:re==="Polygon"||re==="MultiPolygon"?3:re==="LineString"||re==="MultiLineString"?2:1,tags:ke};P.id!==null&&(Ae.id=P.id),Y.features.push(Ae)}}function Ti(Y,P,L,j,J,re){var pe=j*j;if(j>0&&P.size<(J?pe:j))L.numPoints+=P.length/3;else{for(var ue=[],ce=0;ce<P.length;ce+=3)(j===0||P[ce+2]>pe)&&(L.numSimplified++,ue.push(P[ce]),ue.push(P[ce+1])),L.numPoints++;J&&function(fe,ke){for(var Ge=0,Ae=0,gt=fe.length,lt=gt-2;Ae<gt;lt=Ae,Ae+=2)Ge+=(fe[Ae]-fe[lt])*(fe[Ae+1]+fe[lt+1]);if(Ge>0===ke)for(Ae=0,gt=fe.length;Ae<gt/2;Ae+=2){var xt=fe[Ae],Ct=fe[Ae+1];fe[Ae]=fe[gt-2-Ae],fe[Ae+1]=fe[gt-1-Ae],fe[gt-2-Ae]=xt,fe[gt-1-Ae]=Ct}}(ue,re),Y.push(ue)}}function Er(Y,P){var L=(P=this.options=function(J,re){for(var pe in re)J[pe]=re[pe];return J}(Object.create(this.options),P)).debug;if(L&&console.time("preprocess data"),P.maxZoom<0||P.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(P.promoteId&&P.generateId)throw new Error("promoteId and generateId cannot be used together.");var j=function(J,re){var pe=[];if(J.type==="FeatureCollection")for(var ue=0;ue<J.features.length;ue++)ie(pe,J.features[ue],re,ue);else ie(pe,J.type==="Feature"?J:{geometry:J},re);return pe}(Y,P);this.tiles={},this.tileCoords=[],L&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",P.indexMaxZoom,P.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),j=function(J,re){var pe=re.buffer/re.extent,ue=J,ce=At(J,1,-1-pe,pe,0,-1,2,re),fe=At(J,1,1-pe,2+pe,0,-1,2,re);return(ce||fe)&&(ue=At(J,1,-pe,1+pe,0,-1,2,re)||[],ce&&(ue=ci(ce,1).concat(ue)),fe&&(ue=ue.concat(ci(fe,-1)))),ue}(j,P),j.length&&this.splitTile(j,0,0,0),L&&(j.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function rr(Y,P,L){return 32*((1<<Y)*L+P)+Y}function Ai(Y,P){let L=Y.tileID.canonical;if(!this._geoJSONIndex)return P(null,null);let j=this._geoJSONIndex.getTile(L.z,L.x,L.y);if(!j)return P(null,null);let J=new ve(j.features),re=si(J);re.byteOffset===0&&re.byteLength===re.buffer.byteLength||(re=new Uint8Array(re)),P(null,{vectorTile:J,rawData:re.buffer})}Er.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Er.prototype.splitTile=function(Y,P,L,j,J,re,pe){for(var ue=[Y,P,L,j],ce=this.options,fe=ce.debug;ue.length;){j=ue.pop(),L=ue.pop(),P=ue.pop(),Y=ue.pop();var ke=1<<P,Ge=rr(P,L,j),Ae=this.tiles[Ge];if(!Ae&&(fe>1&&console.time("creation"),Ae=this.tiles[Ge]=di(Y,P,L,j,ce),this.tileCoords.push({z:P,x:L,y:j}),fe)){fe>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",P,L,j,Ae.numFeatures,Ae.numPoints,Ae.numSimplified),console.timeEnd("creation"));var gt="z"+P;this.stats[gt]=(this.stats[gt]||0)+1,this.total++}if(Ae.source=Y,J){if(P===ce.maxZoom||P===J)continue;var lt=1<<J-P;if(L!==Math.floor(re/lt)||j!==Math.floor(pe/lt))continue}else if(P===ce.indexMaxZoom||Ae.numPoints<=ce.indexMaxPoints)continue;if(Ae.source=null,Y.length!==0){fe>1&&console.time("clipping");var xt,Ct,oi,Yt,Wt,Nt,Dt=.5*ce.buffer/ce.extent,cr=.5-Dt,nr=.5+Dt,Rr=1+Dt;xt=Ct=oi=Yt=null,Wt=At(Y,ke,L-Dt,L+nr,0,Ae.minX,Ae.maxX,ce),Nt=At(Y,ke,L+cr,L+Rr,0,Ae.minX,Ae.maxX,ce),Y=null,Wt&&(xt=At(Wt,ke,j-Dt,j+nr,1,Ae.minY,Ae.maxY,ce),Ct=At(Wt,ke,j+cr,j+Rr,1,Ae.minY,Ae.maxY,ce),Wt=null),Nt&&(oi=At(Nt,ke,j-Dt,j+nr,1,Ae.minY,Ae.maxY,ce),Yt=At(Nt,ke,j+cr,j+Rr,1,Ae.minY,Ae.maxY,ce),Nt=null),fe>1&&console.timeEnd("clipping"),ue.push(xt||[],P+1,2*L,2*j),ue.push(Ct||[],P+1,2*L,2*j+1),ue.push(oi||[],P+1,2*L+1,2*j),ue.push(Yt||[],P+1,2*L+1,2*j+1)}}},Er.prototype.getTile=function(Y,P,L){var j=this.options,J=j.extent,re=j.debug;if(Y<0||Y>24)return null;var pe=1<<Y,ue=rr(Y,P=(P%pe+pe)%pe,L);if(this.tiles[ue])return hi(this.tiles[ue],J);re>1&&console.log("drilling down to z%d-%d-%d",Y,P,L);for(var ce,fe=Y,ke=P,Ge=L;!ce&&fe>0;)fe--,ke=Math.floor(ke/2),Ge=Math.floor(Ge/2),ce=this.tiles[rr(fe,ke,Ge)];return ce&&ce.source?(re>1&&console.log("found parent tile z%d-%d-%d",fe,ke,Ge),re>1&&console.time("drilling down"),this.splitTile(ce.source,fe,ke,Ge,Y,P,L),re>1&&console.timeEnd("drilling down"),this.tiles[ue]?hi(this.tiles[ue],J):null):null};class sa extends q{constructor(P,L,j,J){super(P,L,j,Ai),J&&(this.loadGeoJSON=J)}loadData(P,L){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=L,this._pendingLoadDataParams=P,this._state&&this._state!=="Idle"?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())}_loadData(){if(!this._pendingCallback||!this._pendingLoadDataParams)return;let P=this._pendingCallback,L=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;let j=!!(L&&L.request&&L.request.collectResourceTiming)&&new o.RequestPerformance(L.request);this.loadGeoJSON(L,(J,re)=>{if(J||!re)return P(J);if(typeof re!="object")return P(new Error(`Input data given to '${L.source}' is not a valid GeoJSON object.`));{le(re,!0);try{if(L.filter){let ue=o.createExpression(L.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(ue.result==="error")throw new Error(ue.value.map(fe=>`${fe.key}: ${fe.message}`).join(", "));let ce=re.features.filter(fe=>ue.value.evaluate({zoom:0},fe));re={type:"FeatureCollection",features:ce}}this._geoJSONIndex=L.cluster?new hn(function({superclusterOptions:ue,clusterProperties:ce}){if(!ce||!ue)return ue;let fe={},ke={},Ge={accumulated:null,zoom:0},Ae={properties:null},gt=Object.keys(ce);for(let lt of gt){let[xt,Ct]=ce[lt],oi=o.createExpression(Ct),Yt=o.createExpression(typeof xt=="string"?[xt,["accumulated"],["get",lt]]:xt);fe[lt]=oi.value,ke[lt]=Yt.value}return ue.map=lt=>{Ae.properties=lt;let xt={};for(let Ct of gt)xt[Ct]=fe[Ct].evaluate(Ge,Ae);return xt},ue.reduce=(lt,xt)=>{Ae.properties=xt;for(let Ct of gt)Ge.accumulated=lt[Ct],lt[Ct]=ke[Ct].evaluate(Ge,Ae)},ue}(L)).load(re.features):function(ue,ce){return new Er(ue,ce)}(re,L.geojsonVtOptions)}catch(ue){return P(ue)}this.loaded={};let pe={};if(j){let ue=j.finish();ue&&(pe.resourceTiming={},pe.resourceTiming[L.source]=JSON.parse(JSON.stringify(ue)))}P(null,pe)}})}coalesce(){this._state==="Coalescing"?this._state="Idle":this._state==="NeedsLoadData"&&(this._state="Coalescing",this._loadData())}reloadTile(P,L){let j=this.loaded;return j&&j[P.uid]?super.reloadTile(P,L):this.loadTile(P,L)}loadGeoJSON(P,L){if(P.request)o.getJSON(P.request,L);else{if(typeof P.data!="string")return L(new Error(`Input data given to '${P.source}' is not a valid GeoJSON object.`));try{return L(null,JSON.parse(P.data))}catch{return L(new Error(`Input data given to '${P.source}' is not a valid GeoJSON object.`))}}}removeSource(P,L){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),L()}getClusterExpansionZoom(P,L){try{L(null,this._geoJSONIndex.getClusterExpansionZoom(P.clusterId))}catch(j){L(j)}}getClusterChildren(P,L){try{L(null,this._geoJSONIndex.getChildren(P.clusterId))}catch(j){L(j)}}getClusterLeaves(P,L){try{L(null,this._geoJSONIndex.getLeaves(P.clusterId,P.limit,P.offset))}catch(j){L(j)}}}class aa{constructor(P){this.self=P,this.actor=new o.Actor(P,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:q,geojson:sa},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(L,j)=>{if(this.workerSourceTypes[L])throw new Error(`Worker source with name "${L}" already registered.`);this.workerSourceTypes[L]=j},this.self.registerRTLTextPlugin=L=>{if(o.plugin.isParsed())throw new Error("RTL text plugin already registered.");o.plugin.applyArabicShaping=L.applyArabicShaping,o.plugin.processBidirectionalText=L.processBidirectionalText,o.plugin.processStyledBidirectionalText=L.processStyledBidirectionalText}}setReferrer(P,L){this.referrer=L}setImages(P,L,j){this.availableImages[P]=L;for(let J in this.workerSources[P]){let re=this.workerSources[P][J];for(let pe in re)re[pe].availableImages=L}j()}setLayers(P,L,j){this.getLayerIndex(P).replace(L),j()}updateLayers(P,L,j){this.getLayerIndex(P).update(L.layers,L.removedIds),j()}loadTile(P,L,j){this.getWorkerSource(P,L.type,L.source).loadTile(L,j)}loadDEMTile(P,L,j){this.getDEMWorkerSource(P,L.source).loadTile(L,j)}reloadTile(P,L,j){this.getWorkerSource(P,L.type,L.source).reloadTile(L,j)}abortTile(P,L,j){this.getWorkerSource(P,L.type,L.source).abortTile(L,j)}removeTile(P,L,j){this.getWorkerSource(P,L.type,L.source).removeTile(L,j)}removeDEMTile(P,L){this.getDEMWorkerSource(P,L.source).removeTile(L)}removeSource(P,L,j){if(!this.workerSources[P]||!this.workerSources[P][L.type]||!this.workerSources[P][L.type][L.source])return;let J=this.workerSources[P][L.type][L.source];delete this.workerSources[P][L.type][L.source],J.removeSource!==void 0?J.removeSource(L,j):j()}loadWorkerSource(P,L,j){try{this.self.importScripts(L.url),j()}catch(J){j(J.toString())}}syncRTLPluginState(P,L,j){try{o.plugin.setState(L);let J=o.plugin.getPluginURL();if(o.plugin.isLoaded()&&!o.plugin.isParsed()&&J!=null){this.self.importScripts(J);let re=o.plugin.isParsed();j(re?void 0:new Error(`RTL Text Plugin failed to import scripts from ${J}`),re)}}catch(J){j(J.toString())}}getAvailableImages(P){let L=this.availableImages[P];return L||(L=[]),L}getLayerIndex(P){let L=this.layerIndexes[P];return L||(L=this.layerIndexes[P]=new b),L}getWorkerSource(P,L,j){if(this.workerSources[P]||(this.workerSources[P]={}),this.workerSources[P][L]||(this.workerSources[P][L]={}),!this.workerSources[P][L][j]){let J={send:(re,pe,ue)=>{this.actor.send(re,pe,ue,P)}};this.workerSources[P][L][j]=new this.workerSourceTypes[L](J,this.getLayerIndex(P),this.getAvailableImages(P))}return this.workerSources[P][L][j]}getDEMWorkerSource(P,L){return this.demWorkerSources[P]||(this.demWorkerSources[P]={}),this.demWorkerSources[P][L]||(this.demWorkerSources[P][L]=new ee),this.demWorkerSources[P][L]}enforceCacheSizeLimit(P,L){o.enforceCacheSizeLimit(L)}}return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&(self.worker=new aa(self)),aa}),a(["./shared"],function(o){"use strict";var m=v;function v(f){return!function(n){return typeof window>"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 d,g,_=new Blob([""],{type:"text/javascript"}),I=URL.createObjectURL(_);try{g=new Worker(I),d=!0}catch{d=!1}return g&&g.terminate(),URL.revokeObjectURL(I),d}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var d=document.createElement("canvas");d.width=d.height=1;var g=d.getContext("2d");if(!g)return!1;var _=g.getImageData(0,0,1,1);return _&&_.width===d.width}()?(b[c=n&&n.failIfMajorPerformanceCaveat]===void 0&&(b[c]=function(d){var g,_=function(I){var M=document.createElement("canvas"),E=Object.create(v.webGLContextAttributes);return E.failIfMajorPerformanceCaveat=I,M.getContext("webgl",E)||M.getContext("experimental-webgl",E)}(d);if(!_)return!1;try{g=_.createShader(_.VERTEX_SHADER)}catch{return!1}return!(!g||_.isContextLost())&&(_.shaderSource(g,"void main() {}"),_.compileShader(g),_.getShaderParameter(g,_.COMPILE_STATUS)===!0)}(c)),b[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}(f)}var b={};function C(f,n){if(Array.isArray(f)){if(!Array.isArray(n)||f.length!==n.length)return!1;for(let c=0;c<f.length;c++)if(!C(f[c],n[c]))return!1;return!0}if(typeof f=="object"&&f!==null&&n!==null){if(typeof n!="object"||Object.keys(f).length!==Object.keys(n).length)return!1;for(let c in f)if(!C(f[c],n[c]))return!1;return!0}return f===n}v.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};class T{static testProp(n){if(!T.docStyle)return n[0];for(let c=0;c<n.length;c++)if(n[c]in T.docStyle)return n[c];return n[0]}static create(n,c,d){let g=window.document.createElement(n);return c!==void 0&&(g.className=c),d&&d.appendChild(g),g}static createNS(n,c){return window.document.createElementNS(n,c)}static disableDrag(){T.docStyle&&T.selectProp&&(T.userSelect=T.docStyle[T.selectProp],T.docStyle[T.selectProp]="none")}static enableDrag(){T.docStyle&&T.selectProp&&(T.docStyle[T.selectProp]=T.userSelect)}static setTransform(n,c){n.style[T.transformProp]=c}static addEventListener(n,c,d,g={}){n.addEventListener(c,d,"passive"in g?g:g.capture)}static removeEventListener(n,c,d,g={}){n.removeEventListener(c,d,"passive"in g?g:g.capture)}static suppressClickInternal(n){n.preventDefault(),n.stopPropagation(),window.removeEventListener("click",T.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",T.suppressClickInternal,!0),window.setTimeout(()=>{window.removeEventListener("click",T.suppressClickInternal,!0)},0)}static mousePos(n,c){let d=n.getBoundingClientRect();return new o.pointGeometry(c.clientX-d.left-n.clientLeft,c.clientY-d.top-n.clientTop)}static touchPos(n,c){let d=n.getBoundingClientRect(),g=[];for(let _=0;_<c.length;_++)g.push(new o.pointGeometry(c[_].clientX-d.left-n.clientLeft,c[_].clientY-d.top-n.clientTop));return g}static mouseButton(n){return n.button}static remove(n){n.parentNode&&n.parentNode.removeChild(n)}}T.docStyle=typeof window<"u"&&window.document&&window.document.documentElement.style,T.selectProp=T.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),T.transformProp=T.testProp(["transform","WebkitTransform"]);class B{constructor(n){this._transformRequestFn=n}transformRequest(n,c){return this._transformRequestFn&&this._transformRequestFn(n,c)||{url:n}}normalizeSpriteURL(n,c,d){let g=function(_){let I=_.match(W);if(!I)throw new Error(`Unable to parse URL "${_}"`);return{protocol:I[1],authority:I[2],path:I[3]||"/",params:I[4]?I[4].split("&"):[]}}(n);return g.path+=`${c}${d}`,function(_){let I=_.params.length?`?${_.params.join("&")}`:"";return`${_.protocol}://${_.authority}${_.path}${I}`}(g)}setTransformRequest(n){this._transformRequestFn=n}}let W=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function q(f){var n=new o.ARRAY_TYPE(3);return n[0]=f[0],n[1]=f[1],n[2]=f[2],n}var ee,le=function(f,n,c){return f[0]=n[0]-c[0],f[1]=n[1]-c[1],f[2]=n[2]-c[2],f};ee=new o.ARRAY_TYPE(3),o.ARRAY_TYPE!=Float32Array&&(ee[0]=0,ee[1]=0,ee[2]=0);var de=function(f){var n=f[0],c=f[1];return n*n+c*c};(function(){var f=new o.ARRAY_TYPE(2);o.ARRAY_TYPE!=Float32Array&&(f[0]=0,f[1]=0)})();class H{constructor(n,c,d,g){this.context=n,this.format=d,this.texture=n.gl.createTexture(),this.update(c,g)}update(n,c,d){let{width:g,height:_}=n,I=!(this.size&&this.size[0]===g&&this.size[1]===_||d),{context:M}=this,{gl:E}=M;if(this.useMipmap=Boolean(c&&c.useMipmap),E.bindTexture(E.TEXTURE_2D,this.texture),M.pixelStoreUnpackFlipY.set(!1),M.pixelStoreUnpack.set(1),M.pixelStoreUnpackPremultiplyAlpha.set(this.format===E.RGBA&&(!c||c.premultiply!==!1)),I)this.size=[g,_],n instanceof HTMLImageElement||n instanceof HTMLCanvasElement||n instanceof HTMLVideoElement||n instanceof ImageData||o.isImageBitmap(n)?E.texImage2D(E.TEXTURE_2D,0,this.format,this.format,E.UNSIGNED_BYTE,n):E.texImage2D(E.TEXTURE_2D,0,this.format,g,_,0,this.format,E.UNSIGNED_BYTE,n.data);else{let{x:k,y:D}=d||{x:0,y:0};n instanceof HTMLImageElement||n instanceof HTMLCanvasElement||n instanceof HTMLVideoElement||n instanceof ImageData||o.isImageBitmap(n)?E.texSubImage2D(E.TEXTURE_2D,0,k,D,E.RGBA,E.UNSIGNED_BYTE,n):E.texSubImage2D(E.TEXTURE_2D,0,k,D,g,_,E.RGBA,E.UNSIGNED_BYTE,n.data)}this.useMipmap&&this.isSizePowerOfTwo()&&E.generateMipmap(E.TEXTURE_2D)}bind(n,c,d){let{context:g}=this,{gl:_}=g;_.bindTexture(_.TEXTURE_2D,this.texture),d!==_.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(d=_.LINEAR),n!==this.filter&&(_.texParameteri(_.TEXTURE_2D,_.TEXTURE_MAG_FILTER,n),_.texParameteri(_.TEXTURE_2D,_.TEXTURE_MIN_FILTER,d||n),this.filter=n),c!==this.wrap&&(_.texParameteri(_.TEXTURE_2D,_.TEXTURE_WRAP_S,c),_.texParameteri(_.TEXTURE_2D,_.TEXTURE_WRAP_T,c),this.wrap=c)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){let{gl:n}=this.context;n.deleteTexture(this.texture),this.texture=null}}function Q(f){let{userImage:n}=f;return!!(n&&n.render&&n.render())&&(f.data.replace(new Uint8Array(n.data.buffer)),!0)}class te extends o.Evented{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new o.RGBAImage({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(n){if(this.loaded!==n&&(this.loaded=n,n)){for(let{ids:c,callback:d}of this.requestors)this._notify(c,d);this.requestors=[]}}getImage(n){return this.images[n]}addImage(n,c){this._validate(n,c)&&(this.images[n]=c)}_validate(n,c){let d=!0;return this._validateStretch(c.stretchX,c.data&&c.data.width)||(this.fire(new o.ErrorEvent(new Error(`Image "${n}" has invalid "stretchX" value`))),d=!1),this._validateStretch(c.stretchY,c.data&&c.data.height)||(this.fire(new o.ErrorEvent(new Error(`Image "${n}" has invalid "stretchY" value`))),d=!1),this._validateContent(c.content,c)||(this.fire(new o.ErrorEvent(new Error(`Image "${n}" has invalid "content" value`))),d=!1),d}_validateStretch(n,c){if(!n)return!0;let d=0;for(let g of n){if(g[0]<d||g[1]<g[0]||c<g[1])return!1;d=g[1]}return!0}_validateContent(n,c){return!(n&&(n.length!==4||n[0]<0||c.data.width<n[0]||n[1]<0||c.data.height<n[1]||n[2]<0||c.data.width<n[2]||n[3]<0||c.data.height<n[3]||n[2]<n[0]||n[3]<n[1]))}updateImage(n,c){c.version=this.images[n].version+1,this.images[n]=c,this.updatedImages[n]=!0}removeImage(n){let c=this.images[n];delete this.images[n],delete this.patterns[n],c.userImage&&c.userImage.onRemove&&c.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(n,c){let d=!0;if(!this.isLoaded())for(let g of n)this.images[g]||(d=!1);this.isLoaded()||d?this._notify(n,c):this.requestors.push({ids:n,callback:c})}_notify(n,c){let d={};for(let g of n){this.images[g]||this.fire(new o.Event("styleimagemissing",{id:g}));let _=this.images[g];_?d[g]={data:_.data.clone(),pixelRatio:_.pixelRatio,sdf:_.sdf,version:_.version,stretchX:_.stretchX,stretchY:_.stretchY,content:_.content,hasRenderCallback:Boolean(_.userImage&&_.userImage.render)}:o.warnOnce(`Image "${g}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}c(null,d)}getPixelSize(){let{width:n,height:c}=this.atlasImage;return{width:n,height:c}}getPattern(n){let c=this.patterns[n],d=this.getImage(n);if(!d)return null;if(c&&c.position.version===d.version)return c.position;if(c)c.position.version=d.version;else{let g={w:d.data.width+2,h:d.data.height+2,x:0,y:0},_=new o.ImagePosition(g,d);this.patterns[n]={bin:g,position:_}}return this._updatePatternAtlas(),this.patterns[n].position}bind(n){let c=n.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new H(n,this.atlasImage,c.RGBA),this.atlasTexture.bind(c.LINEAR,c.CLAMP_TO_EDGE)}_updatePatternAtlas(){let n=[];for(let _ in this.patterns)n.push(this.patterns[_].bin);let{w:c,h:d}=o.potpack(n),g=this.atlasImage;g.resize({width:c||1,height:d||1});for(let _ in this.patterns){let{bin:I}=this.patterns[_],M=I.x+1,E=I.y+1,k=this.images[_].data,D=k.width,O=k.height;o.RGBAImage.copy(k,g,{x:0,y:0},{x:M,y:E},{width:D,height:O}),o.RGBAImage.copy(k,g,{x:0,y:O-1},{x:M,y:E-1},{width:D,height:1}),o.RGBAImage.copy(k,g,{x:0,y:0},{x:M,y:E+O},{width:D,height:1}),o.RGBAImage.copy(k,g,{x:D-1,y:0},{x:M-1,y:E},{width:1,height:O}),o.RGBAImage.copy(k,g,{x:0,y:0},{x:M+D,y:E},{width:1,height:O})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(n){for(let c of n){if(this.callbackDispatchedThisFrame[c])continue;this.callbackDispatchedThisFrame[c]=!0;let d=this.images[c];Q(d)&&this.updateImage(c,d)}}}let ve=1e20;function Me(f,n,c,d,g,_,I,M,E){for(let k=n;k<n+d;k++)Ce(f,c*_+k,_,g,I,M,E);for(let k=c;k<c+g;k++)Ce(f,k*_+n,1,d,I,M,E)}function Ce(f,n,c,d,g,_,I){_[0]=0,I[0]=-ve,I[1]=ve,g[0]=f[n];for(let M=1,E=0,k=0;M<d;M++){g[M]=f[n+M*c];let D=M*M;do{let O=_[E];k=(g[M]-g[O]+D-O*O)/(M-O)/2}while(k<=I[E]&&--E>-1);E++,_[E]=M,I[E]=k,I[E+1]=ve}for(let M=0,E=0;M<d;M++){for(;I[E+1]<M;)E++;let k=_[E],D=M-k;f[n+M*c]=g[k]+D*D}}class Be{constructor(n,c){this.requestManager=n,this.localIdeographFontFamily=c,this.entries={}}setURL(n){this.url=n}getGlyphs(n,c){let d=[];for(let g in n)for(let _ of n[g])d.push({stack:g,id:_});o.asyncAll(d,({stack:g,id:_},I)=>{let M=this.entries[g];M||(M=this.entries[g]={glyphs:{},requests:{},ranges:{}});let E=M.glyphs[_];if(E!==void 0)return void I(null,{stack:g,id:_,glyph:E});if(E=this._tinySDF(M,g,_),E)return M.glyphs[_]=E,void I(null,{stack:g,id:_,glyph:E});let k=Math.floor(_/256);if(256*k>65535)return void I(new Error("glyphs > 65535 not supported"));if(M.ranges[k])return void I(null,{stack:g,id:_,glyph:E});let D=M.requests[k];D||(D=M.requests[k]=[],Be.loadGlyphRange(g,k,this.url,this.requestManager,(O,X)=>{if(X){for(let oe in X)this._doesCharSupportLocalGlyph(+oe)||(M.glyphs[+oe]=X[+oe]);M.ranges[k]=!0}for(let oe of D)oe(O,X);delete M.requests[k]})),D.push((O,X)=>{O?I(O):X&&I(null,{stack:g,id:_,glyph:X[_]||null})})},(g,_)=>{if(g)c(g);else if(_){let I={};for(let{stack:M,id:E,glyph:k}of _)(I[M]||(I[M]={}))[E]=k&&{id:k.id,bitmap:k.bitmap.clone(),metrics:k.metrics};c(null,I)}})}_doesCharSupportLocalGlyph(n){return!!this.localIdeographFontFamily&&(o.unicodeBlockLookup["CJK Unified Ideographs"](n)||o.unicodeBlockLookup["Hangul Syllables"](n)||o.unicodeBlockLookup.Hiragana(n)||o.unicodeBlockLookup.Katakana(n))}_tinySDF(n,c,d){let g=this.localIdeographFontFamily;if(!g||!this._doesCharSupportLocalGlyph(d))return;let _=n.tinySDF;if(!_){let M="400";/bold/i.test(c)?M="900":/medium/i.test(c)?M="500":/light/i.test(c)&&(M="200"),_=n.tinySDF=new Be.TinySDF({fontSize:24,buffer:3,radius:8,cutoff:.25,fontFamily:g,fontWeight:M})}let I=_.draw(String.fromCharCode(d));return{id:d,bitmap:new o.AlphaImage({width:I.width||30,height:I.height||30},I.data),metrics:{width:I.glyphWidth||24,height:I.glyphHeight||24,left:I.glyphLeft||0,top:I.glyphTop-27||-8,advance:I.glyphAdvance||24}}}}Be.loadGlyphRange=function(f,n,c,d,g){let _=256*n,I=_+255,M=d.transformRequest(c.replace("{fontstack}",f).replace("{range}",`${_}-${I}`),o.ResourceType.Glyphs);o.getArrayBuffer(M,(E,k)=>{if(E)g(E);else if(k){let D={};for(let O of o.parseGlyphPBF(k))D[O.id]=O;g(null,D)}})},Be.TinySDF=class{constructor({fontSize:f=24,buffer:n=3,radius:c=8,cutoff:d=.25,fontFamily:g="sans-serif",fontWeight:_="normal",fontStyle:I="normal"}={}){this.buffer=n,this.cutoff=d,this.radius=c;let M=this.size=f+4*n,E=this._createCanvas(M),k=this.ctx=E.getContext("2d",{willReadFrequently:!0});k.font=`${I} ${_} ${f}px ${g}`,k.textBaseline="alphabetic",k.textAlign="left",k.fillStyle="black",this.gridOuter=new Float64Array(M*M),this.gridInner=new Float64Array(M*M),this.f=new Float64Array(M),this.z=new Float64Array(M+1),this.v=new Uint16Array(M)}_createCanvas(f){let n=document.createElement("canvas");return n.width=n.height=f,n}draw(f){let{width:n,actualBoundingBoxAscent:c,actualBoundingBoxDescent:d,actualBoundingBoxLeft:g,actualBoundingBoxRight:_}=this.ctx.measureText(f),I=Math.ceil(c),M=Math.min(this.size-this.buffer,Math.ceil(_-g)),E=Math.min(this.size-this.buffer,I+Math.ceil(d)),k=M+2*this.buffer,D=E+2*this.buffer,O=Math.max(k*D,0),X=new Uint8ClampedArray(O),oe={data:X,width:k,height:D,glyphWidth:M,glyphHeight:E,glyphTop:I,glyphLeft:0,glyphAdvance:n};if(M===0||E===0)return oe;let{ctx:$,buffer:ne,gridInner:me,gridOuter:ge}=this;$.clearRect(ne,ne,M,E),$.fillText(f,ne,ne+I);let we=$.getImageData(ne,ne,M,E);ge.fill(ve,0,O),me.fill(0,0,O);for(let xe=0;xe<E;xe++)for(let Ne=0;Ne<M;Ne++){let Pe=we.data[4*(xe*M+Ne)+3]/255;if(Pe===0)continue;let ze=(xe+ne)*k+Ne+ne;if(Pe===1)ge[ze]=0,me[ze]=ve;else{let je=.5-Pe;ge[ze]=je>0?je*je:0,me[ze]=je<0?je*je:0}}Me(ge,0,0,k,D,k,this.f,this.v,this.z),Me(me,ne,ne,M,E,k,this.f,this.v,this.z);for(let xe=0;xe<O;xe++){let Ne=Math.sqrt(ge[xe])-Math.sqrt(me[xe]);X[xe]=Math.round(255-255*(Ne/this.radius+this.cutoff))}return oe}};let Fe=new o.Properties({anchor:new o.DataConstantProperty(o.spec.light.anchor),position:new class{constructor(){this.specification=o.spec.light.position}possiblyEvaluate(f,n){return o.sphericalToCartesian(f.expression.evaluate(n))}interpolate(f,n,c){return{x:o.number(f.x,n.x,c),y:o.number(f.y,n.y,c),z:o.number(f.z,n.z,c)}}},color:new o.DataConstantProperty(o.spec.light.color),intensity:new o.DataConstantProperty(o.spec.light.intensity)}),qe="-transition";class ht extends o.Evented{constructor(n){super(),this._transitionable=new o.Transitionable(Fe),this.setLight(n),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(n,c={}){if(!this._validate(o.validateLight,n,c))for(let d in n){let g=n[d];d.endsWith(qe)?this._transitionable.setTransition(d.slice(0,-qe.length),g):this._transitionable.setValue(d,g)}}updateTransitions(n){this._transitioning=this._transitionable.transitioned(n,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(n){this.properties=this._transitioning.possiblyEvaluate(n)}_validate(n,c,d){return(!d||d.validate!==!1)&&o.emitValidationErrors(this,n.call(o.validateStyle,o.extend({value:c,style:{glyphs:!0,sprite:!0},styleSpec:o.spec})))}}class Tt{constructor(n,c){this.width=n,this.height=c,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(n,c){let d=n.join(",")+String(c);return this.dashEntry[d]||(this.dashEntry[d]=this.addDash(n,c)),this.dashEntry[d]}getDashRanges(n,c,d){let g=[],_=n.length%2==1?-n[n.length-1]*d:0,I=n[0]*d,M=!0;g.push({left:_,right:I,isDash:M,zeroLength:n[0]===0});let E=n[0];for(let k=1;k<n.length;k++){M=!M;let D=n[k];_=E*d,E+=D,I=E*d,g.push({left:_,right:I,isDash:M,zeroLength:D===0})}return g}addRoundDash(n,c,d){let g=c/2;for(let _=-d;_<=d;_++){let I=this.width*(this.nextRow+d+_),M=0,E=n[M];for(let k=0;k<this.width;k++){k/E.right>1&&(E=n[++M]);let D=Math.abs(k-E.left),O=Math.abs(k-E.right),X=Math.min(D,O),oe,$=_/d*(g+1);if(E.isDash){let ne=g-Math.abs($);oe=Math.sqrt(X*X+ne*ne)}else oe=g-Math.sqrt(X*X+$*$);this.data[I+k]=Math.max(0,Math.min(255,oe+128))}}}addRegularDash(n){for(let M=n.length-1;M>=0;--M){let E=n[M],k=n[M+1];E.zeroLength?n.splice(M,1):k&&k.isDash===E.isDash&&(k.left=E.left,n.splice(M,1))}let c=n[0],d=n[n.length-1];c.isDash===d.isDash&&(c.left=d.left-this.width,d.right=c.right+this.width);let g=this.width*this.nextRow,_=0,I=n[_];for(let M=0;M<this.width;M++){M/I.right>1&&(I=n[++_]);let E=Math.abs(M-I.left),k=Math.abs(M-I.right),D=Math.min(E,k);this.data[g+M]=Math.max(0,Math.min(255,(I.isDash?D:-D)+128))}}addDash(n,c){let d=c?7:0,g=2*d+1;if(this.nextRow+g>this.height)return o.warnOnce("LineAtlas out of space"),null;let _=0;for(let M=0;M<n.length;M++)_+=n[M];if(_!==0){let M=this.width/_,E=this.getDashRanges(n,this.width,M);c?this.addRoundDash(E,M,d):this.addRegularDash(E)}let I={y:(this.nextRow+d+.5)/this.height,height:2*d/this.height,width:_};return this.nextRow+=g,this.dirty=!0,I}bind(n){let c=n.gl;this.texture?(c.bindTexture(c.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,c.texSubImage2D(c.TEXTURE_2D,0,0,0,this.width,this.height,c.ALPHA,c.UNSIGNED_BYTE,this.data))):(this.texture=c.createTexture(),c.bindTexture(c.TEXTURE_2D,this.texture),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.REPEAT),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.REPEAT),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.LINEAR),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.LINEAR),c.texImage2D(c.TEXTURE_2D,0,c.ALPHA,this.width,this.height,0,c.ALPHA,c.UNSIGNED_BYTE,this.data))}}class Gt{constructor(n,c){this.workerPool=n,this.actors=[],this.currentActor=0,this.id=o.uniqueId();let d=this.workerPool.acquire(this.id);for(let g=0;g<d.length;g++){let _=new Gt.Actor(d[g],c,this.id);_.name=`Worker ${g}`,this.actors.push(_)}}broadcast(n,c,d){o.asyncAll(this.actors,(g,_)=>{g.send(n,c,_)},d=d||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach(n=>{n.remove()}),this.actors=[],this.workerPool.release(this.id)}}function Jt(f,n,c){let d=function(g,_){if(g)return c(g);if(_){let I=o.pick(o.extend(_,f),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);_.vector_layers&&(I.vectorLayers=_.vector_layers,I.vectorLayerIds=I.vectorLayers.map(M=>M.id)),c(null,I)}};return f.url?o.getJSON(n.transformRequest(f.url,o.ResourceType.Source),d):o.exported.frame(()=>d(null,f))}Gt.Actor=o.Actor;class at{constructor(n,c,d){this.bounds=o.LngLatBounds.convert(this.validateBounds(n)),this.minzoom=c||0,this.maxzoom=d||24}validateBounds(n){return Array.isArray(n)&&n.length===4?[Math.max(-180,n[0]),Math.max(-90,n[1]),Math.min(180,n[2]),Math.min(90,n[3])]:[-180,-90,180,90]}contains(n){let c=Math.pow(2,n.z),d=Math.floor(o.mercatorXfromLng(this.bounds.getWest())*c),g=Math.floor(o.mercatorYfromLat(this.bounds.getNorth())*c),_=Math.ceil(o.mercatorXfromLng(this.bounds.getEast())*c),I=Math.ceil(o.mercatorYfromLat(this.bounds.getSouth())*c);return n.x>=d&&n.x<_&&n.y>=g&&n.y<I}}class jt extends o.Evented{constructor(n,c,d,g){if(super(),this.id=n,this.dispatcher=d,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,o.extend(this,o.pick(c,["url","scheme","tileSize","promoteId"])),this._options=o.extend({type:"vector"},c),this._collectResourceTiming=c.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(g)}load(){this._loaded=!1,this.fire(new o.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Jt(this._options,this.map._requestManager,(n,c)=>{this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),n?this.fire(new o.ErrorEvent(n)):c&&(o.extend(this,c),c.bounds&&(this.tileBounds=new at(c.bounds,this.minzoom,this.maxzoom)),this.fire(new o.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new o.Event("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}hasTile(n){return!this.tileBounds||this.tileBounds.contains(n.canonical)}onAdd(n){this.map=n,this.load()}setSourceProperty(n){this._tileJSONRequest&&this._tileJSONRequest.cancel(),n(),this.load()}setTiles(n){return this.setSourceProperty(()=>{this._options.tiles=n}),this}setUrl(n){return this.setSourceProperty(()=>{this.url=n,this._options.url=n}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return o.extend({},this._options)}loadTile(n,c){let d=n.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),g={request:this.map._requestManager.transformRequest(d,o.ResourceType.Tile),uid:n.uid,tileID:n.tileID,zoom:n.tileID.overscaledZ,tileSize:this.tileSize*n.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function _(I,M){return delete n.request,n.aborted?c(null):I&&I.status!==404?c(I):(M&&M.resourceTiming&&(n.resourceTiming=M.resourceTiming),this.map._refreshExpiredTiles&&M&&n.setExpiryData(M),n.loadVectorData(M,this.map.painter),o.cacheEntryPossiblyAdded(this.dispatcher),c(null),void(n.reloadCallback&&(this.loadTile(n,n.reloadCallback),n.reloadCallback=null)))}g.request.collectResourceTiming=this._collectResourceTiming,n.actor&&n.state!=="expired"?n.state==="loading"?n.reloadCallback=c:n.request=n.actor.send("reloadTile",g,_.bind(this)):(n.actor=this.dispatcher.getActor(),n.request=n.actor.send("loadTile",g,_.bind(this)))}abortTile(n){n.request&&(n.request.cancel(),delete n.request),n.actor&&n.actor.send("abortTile",{uid:n.uid,type:this.type,source:this.id},void 0)}unloadTile(n){n.unloadVectorData(),n.actor&&n.actor.send("removeTile",{uid:n.uid,type:this.type,source:this.id},void 0)}hasTransition(){return!1}}class zi extends o.Evented{constructor(n,c,d,g){super(),this.id=n,this.dispatcher=d,this.setEventedParent(g),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=o.extend({type:"raster"},c),o.extend(this,o.pick(c,["url","scheme","tileSize"]))}load(){this._loaded=!1,this.fire(new o.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Jt(this._options,this.map._requestManager,(n,c)=>{this._tileJSONRequest=null,this._loaded=!0,n?this.fire(new o.ErrorEvent(n)):c&&(o.extend(this,c),c.bounds&&(this.tileBounds=new at(c.bounds,this.minzoom,this.maxzoom)),this.fire(new o.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new o.Event("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}onAdd(n){this.map=n,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return o.extend({},this._options)}hasTile(n){return!this.tileBounds||this.tileBounds.contains(n.canonical)}loadTile(n,c){let d=n.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);n.request=o.getImage(this.map._requestManager.transformRequest(d,o.ResourceType.Tile),(g,_,I)=>{if(delete n.request,n.aborted)n.state="unloaded",c(null);else if(g)n.state="errored",c(g);else if(_){this.map._refreshExpiredTiles&&n.setExpiryData(I);let M=this.map.painter.context,E=M.gl;n.texture=this.map.painter.getTileTexture(_.width),n.texture?n.texture.update(_,{useMipmap:!0}):(n.texture=new H(M,_,E.RGBA,{useMipmap:!0}),n.texture.bind(E.LINEAR,E.CLAMP_TO_EDGE,E.LINEAR_MIPMAP_NEAREST),M.extTextureFilterAnisotropic&&E.texParameterf(E.TEXTURE_2D,M.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,M.extTextureFilterAnisotropicMax)),n.state="loaded",o.cacheEntryPossiblyAdded(this.dispatcher),c(null)}})}abortTile(n,c){n.request&&(n.request.cancel(),delete n.request),c()}unloadTile(n,c){n.texture&&this.map.painter.saveTileTexture(n.texture),c()}hasTransition(){return!1}}let Ii;class Ht extends zi{constructor(n,c,d,g){super(n,c,d,g),this.type="raster-dem",this.maxzoom=22,this._options=o.extend({type:"raster-dem"},c),this.encoding=c.encoding||"mapbox"}serialize(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}}loadTile(n,c){let d=n.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);function g(_,I){_&&(n.state="errored",c(_)),I&&(n.dem=I,n.needsHillshadePrepare=!0,n.state="loaded",c(null))}n.request=o.getImage(this.map._requestManager.transformRequest(d,o.ResourceType.Tile),function(_,I){if(delete n.request,n.aborted)n.state="unloaded",c(null);else if(_)n.state="errored",c(_);else if(I){this.map._refreshExpiredTiles&&n.setExpiryData(I),delete I.cacheControl,delete I.expires;let M=o.isImageBitmap(I)&&(Ii==null&&(Ii=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),Ii)?I:o.exported.getImageData(I,1),E={uid:n.uid,coord:n.tileID,source:this.id,rawImageData:M,encoding:this.encoding};n.actor&&n.state!=="expired"||(n.actor=this.dispatcher.getActor(),n.actor.send("loadDEMTile",E,g.bind(this)))}}.bind(this)),n.neighboringTiles=this._getNeighboringTiles(n.tileID)}_getNeighboringTiles(n){let c=n.canonical,d=Math.pow(2,c.z),g=(c.x-1+d)%d,_=c.x===0?n.wrap-1:n.wrap,I=(c.x+1+d)%d,M=c.x+1===d?n.wrap+1:n.wrap,E={};return E[new o.OverscaledTileID(n.overscaledZ,_,c.z,g,c.y).key]={backfilled:!1},E[new o.OverscaledTileID(n.overscaledZ,M,c.z,I,c.y).key]={backfilled:!1},c.y>0&&(E[new o.OverscaledTileID(n.overscaledZ,_,c.z,g,c.y-1).key]={backfilled:!1},E[new o.OverscaledTileID(n.overscaledZ,n.wrap,c.z,c.x,c.y-1).key]={backfilled:!1},E[new o.OverscaledTileID(n.overscaledZ,M,c.z,I,c.y-1).key]={backfilled:!1}),c.y+1<d&&(E[new o.OverscaledTileID(n.overscaledZ,_,c.z,g,c.y+1).key]={backfilled:!1},E[new o.OverscaledTileID(n.overscaledZ,n.wrap,c.z,c.x,c.y+1).key]={backfilled:!1},E[new o.OverscaledTileID(n.overscaledZ,M,c.z,I,c.y+1).key]={backfilled:!1}),E}unloadTile(n){n.demTexture&&this.map.painter.saveTileTexture(n.demTexture),n.fbo&&(n.fbo.destroy(),delete n.fbo),n.dem&&delete n.dem,delete n.neighboringTiles,n.state="unloaded",n.actor&&n.actor.send("removeDEMTile",{uid:n.uid,source:this.id})}}class ur extends o.Evented{constructor(n,c,d,g){super(),this.id=n,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._pendingLoads=0,this.actor=d.getActor(),this.setEventedParent(g),this._data=c.data,this._options=o.extend({},c),this._collectResourceTiming=c.collectResourceTiming,c.maxzoom!==void 0&&(this.maxzoom=c.maxzoom),c.type&&(this.type=c.type),c.attribution&&(this.attribution=c.attribution),this.promoteId=c.promoteId;let _=o.EXTENT/this.tileSize;this.workerOptions=o.extend({source:this.id,cluster:c.cluster||!1,geojsonVtOptions:{buffer:(c.buffer!==void 0?c.buffer:128)*_,tolerance:(c.tolerance!==void 0?c.tolerance:.375)*_,extent:o.EXTENT,maxZoom:this.maxzoom,lineMetrics:c.lineMetrics||!1,generateId:c.generateId||!1},superclusterOptions:{maxZoom:c.clusterMaxZoom!==void 0?c.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,c.clusterMinPoints||2),extent:o.EXTENT,radius:(c.clusterRadius||50)*_,log:!1,generateId:c.generateId||!1},clusterProperties:c.clusterProperties,filter:c.filter},c.workerOptions)}load(){this._updateWorkerData("metadata")}onAdd(n){this.map=n,this.load()}setData(n){return this._data=n,this._updateWorkerData("content"),this}getClusterExpansionZoom(n,c){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:n,source:this.id},c),this}getClusterChildren(n,c){return this.actor.send("geojson.getClusterChildren",{clusterId:n,source:this.id},c),this}getClusterLeaves(n,c,d,g){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:n,limit:c,offset:d},g),this}_updateWorkerData(n){let c=o.extend({},this.workerOptions),d=this._data;typeof d=="string"?(c.request=this.map._requestManager.transformRequest(o.exported.resolveURL(d),o.ResourceType.Source),c.request.collectResourceTiming=this._collectResourceTiming):c.data=JSON.stringify(d),this._pendingLoads++,this.fire(new o.Event("dataloading",{dataType:"source"})),this.actor.send(`${this.type}.loadData`,c,(g,_)=>{if(this._pendingLoads--,this._removed||_&&_.abandoned)return;let I=null;if(_&&_.resourceTiming&&_.resourceTiming[this.id]&&(I=_.resourceTiming[this.id].slice(0)),this.actor.send(`${this.type}.coalesce`,{source:c.source},null),g)return void this.fire(new o.ErrorEvent(g));let M={dataType:"source",sourceDataType:n};this._collectResourceTiming&&I&&I.length>0&&o.extend(M,{resourceTiming:I}),this.fire(new o.Event("data",M))})}loaded(){return this._pendingLoads===0}loadTile(n,c){let d=n.actor?"reloadTile":"loadTile";n.actor=this.actor;let g={type:this.type,uid:n.uid,tileID:n.tileID,zoom:n.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};n.request=this.actor.send(d,g,(_,I)=>(delete n.request,n.unloadVectorData(),n.aborted?c(null):_?c(_):(n.loadVectorData(I,this.map.painter,d==="reloadTile"),c(null))))}abortTile(n){n.request&&(n.request.cancel(),delete n.request),n.aborted=!0}unloadTile(n){n.unloadVectorData(),this.actor.send("removeTile",{uid:n.uid,type:this.type,source:this.id})}onRemove(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})}serialize(){return o.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var Xi=o.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class si extends o.Evented{constructor(n,c,d,g){super(),this.id=n,this.dispatcher=d,this.coordinates=c.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(g),this.options=c}load(n,c){this._loaded=!1,this.fire(new o.Event("dataloading",{dataType:"source"})),this.url=this.options.url,o.getImage(this.map._requestManager.transformRequest(this.url,o.ResourceType.Image),(d,g)=>{this._loaded=!0,d?this.fire(new o.ErrorEvent(d)):g&&(this.image=g,n&&(this.coordinates=n),c&&c(),this._finishLoading())})}loaded(){return this._loaded}updateImage(n){return this.image&&n.url?(this.options.url=n.url,this.load(n.coordinates,()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new o.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(n){this.map=n,this.load()}setCoordinates(n){this.coordinates=n;let c=n.map(o.MercatorCoordinate.fromLngLat);this.tileID=function(g){let _=1/0,I=1/0,M=-1/0,E=-1/0;for(let X of g)_=Math.min(_,X.x),I=Math.min(I,X.y),M=Math.max(M,X.x),E=Math.max(E,X.y);let k=Math.max(M-_,E-I),D=Math.max(0,Math.floor(-Math.log(k)/Math.LN2)),O=Math.pow(2,D);return new o.CanonicalTileID(D,Math.floor((_+M)/2*O),Math.floor((I+E)/2*O))}(c),this.minzoom=this.maxzoom=this.tileID.z;let d=c.map(g=>this.tileID.getTilePoint(g)._round());return this._boundsArray=new o.RasterBoundsArray,this._boundsArray.emplaceBack(d[0].x,d[0].y,0,0),this._boundsArray.emplaceBack(d[1].x,d[1].y,o.EXTENT,0),this._boundsArray.emplaceBack(d[3].x,d[3].y,0,o.EXTENT),this._boundsArray.emplaceBack(d[2].x,d[2].y,o.EXTENT,o.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new o.Event("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;let n=this.map.painter.context,c=n.gl;this.boundsBuffer||(this.boundsBuffer=n.createVertexBuffer(this._boundsArray,Xi.members)),this.boundsSegments||(this.boundsSegments=o.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new H(n,this.image,c.RGBA),this.texture.bind(c.LINEAR,c.CLAMP_TO_EDGE));for(let d in this.tiles){let g=this.tiles[d];g.state!=="loaded"&&(g.state="loaded",g.texture=this.texture)}}loadTile(n,c){this.tileID&&this.tileID.equals(n.tileID.canonical)?(this.tiles[String(n.tileID.wrap)]=n,n.buckets={},c(null)):(n.state="errored",c(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class ii extends si{constructor(n,c,d,g){super(n,c,d,g),this.roundZoom=!0,this.type="video",this.options=c}load(){this._loaded=!1;let n=this.options;this.urls=[];for(let c of n.urls)this.urls.push(this.map._requestManager.transformRequest(c,o.ResourceType.Source).url);o.getVideo(this.urls,(c,d)=>{this._loaded=!0,c?this.fire(new o.ErrorEvent(c)):d&&(this.video=d,this.video.loop=!0,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(n){if(this.video){let c=this.video.seekable;n<c.start(0)||n>c.end(0)?this.fire(new o.ErrorEvent(new o.ValidationError(`sources.${this.id}`,null,`Playback for this video can be set only between the ${c.start(0)} and ${c.end(0)}-second mark.`))):this.video.currentTime=n}}getVideo(){return this.video}onAdd(n){this.map||(this.map=n,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;let n=this.map.painter.context,c=n.gl;this.boundsBuffer||(this.boundsBuffer=n.createVertexBuffer(this._boundsArray,Xi.members)),this.boundsSegments||(this.boundsSegments=o.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(c.LINEAR,c.CLAMP_TO_EDGE),c.texSubImage2D(c.TEXTURE_2D,0,0,0,c.RGBA,c.UNSIGNED_BYTE,this.video)):(this.texture=new H(n,this.video,c.RGBA),this.texture.bind(c.LINEAR,c.CLAMP_TO_EDGE));for(let d in this.tiles){let g=this.tiles[d];g.state!=="loaded"&&(g.state="loaded",g.texture=this.texture)}}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class _i extends si{constructor(n,c,d,g){super(n,c,d,g),c.coordinates?Array.isArray(c.coordinates)&&c.coordinates.length===4&&!c.coordinates.some(_=>!Array.isArray(_)||_.length!==2||_.some(I=>typeof I!="number"))||this.fire(new o.ErrorEvent(new o.ValidationError(`sources.${n}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new o.ErrorEvent(new o.ValidationError(`sources.${n}`,null,'missing required property "coordinates"'))),c.animate&&typeof c.animate!="boolean"&&this.fire(new o.ErrorEvent(new o.ValidationError(`sources.${n}`,null,'optional "animate" property must be a boolean value'))),c.canvas?typeof c.canvas=="string"||c.canvas instanceof HTMLCanvasElement||this.fire(new o.ErrorEvent(new o.ValidationError(`sources.${n}`,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 o.ErrorEvent(new o.ValidationError(`sources.${n}`,null,'missing required property "canvas"'))),this.options=c,this.animate=c.animate===void 0||c.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new o.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(n){this.map=n,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let n=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,n=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,n=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;let c=this.map.painter.context,d=c.gl;this.boundsBuffer||(this.boundsBuffer=c.createVertexBuffer(this._boundsArray,Xi.members)),this.boundsSegments||(this.boundsSegments=o.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(n||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new H(c,this.canvas,d.RGBA,{premultiply:!0});for(let g in this.tiles){let _=this.tiles[g];_.state!=="loaded"&&(_.state="loaded",_.texture=this.texture)}}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(let n of[this.canvas.width,this.canvas.height])if(isNaN(n)||n<=0)return!0;return!1}}let Ei={vector:jt,raster:zi,"raster-dem":Ht,geojson:ur,video:ii,image:si,canvas:_i};function Li(f,n){let c=o.create();return o.translate(c,c,[1,1,0]),o.scale(c,c,[.5*f.width,.5*f.height,1]),o.multiply(c,c,f.calculatePosMatrix(n.toUnwrapped()))}function Fi(f,n,c,d,g,_){let I=function(O,X,oe){if(O)for(let $ of O){let ne=X[$];if(ne&&ne.source===oe&&ne.type==="fill-extrusion")return!0}else for(let $ in X){let ne=X[$];if(ne.source===oe&&ne.type==="fill-extrusion")return!0}return!1}(g&&g.layers,n,f.id),M=_.maxPitchScaleFactor(),E=f.tilesIn(d,M,I);E.sort(Ji);let k=[];for(let O of E)k.push({wrappedTileID:O.tileID.wrapped().key,queryResults:O.tile.queryRenderedFeatures(n,c,f._state,O.queryGeometry,O.cameraQueryGeometry,O.scale,g,_,M,Li(f.transform,O.tileID))});let D=function(O){let X={},oe={};for(let $ of O){let ne=$.queryResults,me=$.wrappedTileID,ge=oe[me]=oe[me]||{};for(let we in ne){let xe=ne[we],Ne=ge[we]=ge[we]||{},Pe=X[we]=X[we]||[];for(let ze of xe)Ne[ze.featureIndex]||(Ne[ze.featureIndex]=!0,Pe.push(ze))}}return X}(k);for(let O in D)D[O].forEach(X=>{let oe=X.feature,$=f.getFeatureState(oe.layer["source-layer"],oe.id);oe.source=oe.layer.source,oe.layer["source-layer"]&&(oe.sourceLayer=oe.layer["source-layer"]),oe.state=$});return D}function Ji(f,n){let c=f.tileID,d=n.tileID;return c.overscaledZ-d.overscaledZ||c.canonical.y-d.canonical.y||c.wrap-d.wrap||c.canonical.x-d.canonical.x}class Mr{constructor(n,c){this.tileID=n,this.uid=o.uniqueId(),this.uses=0,this.tileSize=c,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(n){let c=n+this.timeAdded;c<o.exported.now()||this.fadeEndTime&&c<this.fadeEndTime||(this.fadeEndTime=c)}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}loadVectorData(n,c,d){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",n){n.featureIndex&&(this.latestFeatureIndex=n.featureIndex,n.rawTileData?(this.latestRawTileData=n.rawTileData,this.latestFeatureIndex.rawTileData=n.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=n.collisionBoxArray,this.buckets=function(g,_){let I={};if(!_)return I;for(let M of g){let E=M.layerIds.map(k=>_.getLayer(k)).filter(Boolean);if(E.length!==0){M.layers=E,M.stateDependentLayerIds&&(M.stateDependentLayers=M.stateDependentLayerIds.map(k=>E.filter(D=>D.id===k)[0]));for(let k of E)I[k.id]=M}}return I}(n.buckets,c.style),this.hasSymbolBuckets=!1;for(let g in this.buckets){let _=this.buckets[g];if(_ instanceof o.SymbolBucket){if(this.hasSymbolBuckets=!0,!d)break;_.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let g in this.buckets){let _=this.buckets[g];if(_ instanceof o.SymbolBucket&&_.hasRTLText){this.hasRTLText=!0,o.lazyLoadRTLTextPlugin();break}}this.queryPadding=0;for(let g in this.buckets){let _=this.buckets[g];this.queryPadding=Math.max(this.queryPadding,c.style.getLayer(g).queryRadius(_))}n.imageAtlas&&(this.imageAtlas=n.imageAtlas),n.glyphAtlasImage&&(this.glyphAtlasImage=n.glyphAtlasImage)}else this.collisionBoxArray=new o.CollisionBoxArray}unloadVectorData(){for(let n in this.buckets)this.buckets[n].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(n){return this.buckets[n.id]}upload(n){for(let d in this.buckets){let g=this.buckets[d];g.uploadPending()&&g.upload(n)}let c=n.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new H(n,this.imageAtlas.image,c.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new H(n,this.glyphAtlasImage,c.ALPHA),this.glyphAtlasImage=null)}prepare(n){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(n,this.imageAtlasTexture)}queryRenderedFeatures(n,c,d,g,_,I,M,E,k,D){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:g,cameraQueryGeometry:_,scale:I,tileSize:this.tileSize,pixelPosMatrix:D,transform:E,params:M,queryPadding:this.queryPadding*k},n,c,d):{}}querySourceFeatures(n,c){let d=this.latestFeatureIndex;if(!d||!d.rawTileData)return;let g=d.loadVTLayers(),_=c?c.sourceLayer:"",I=g._geojsonTileLayer||g[_];if(!I)return;let M=o.createFilter(c&&c.filter),{z:E,x:k,y:D}=this.tileID.canonical,O={z:E,x:k,y:D};for(let X=0;X<I.length;X++){let oe=I.feature(X);if(M.needGeometry){let me=o.toEvaluationFeature(oe,!0);if(!M.filter(new o.EvaluationParameters(this.tileID.overscaledZ),me,this.tileID.canonical))continue}else if(!M.filter(new o.EvaluationParameters(this.tileID.overscaledZ),oe))continue;let $=d.getId(oe,_),ne=new o.GeoJSONFeature(oe,E,k,D,$);ne.tile=O,n.push(ne)}}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(n){let c=this.expirationTime;if(n.cacheControl){let d=o.parseCacheControl(n.cacheControl);d["max-age"]&&(this.expirationTime=Date.now()+1e3*d["max-age"])}else n.expires&&(this.expirationTime=new Date(n.expires).getTime());if(this.expirationTime){let d=Date.now(),g=!1;if(this.expirationTime>d)g=!1;else if(c)if(this.expirationTime<c)g=!0;else{let _=this.expirationTime-c;_?this.expirationTime=d+Math.max(_,3e4):g=!0}else g=!0;g?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-new Date().getTime(),Math.pow(2,31)-1)}setFeatureState(n,c){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(n).length===0)return;let d=this.latestFeatureIndex.loadVTLayers();for(let g in this.buckets){if(!c.style.hasLayer(g))continue;let _=this.buckets[g],I=_.layers[0].sourceLayer||"_geojsonTileLayer",M=d[I],E=n[I];if(!M||!E||Object.keys(E).length===0)continue;_.update(E,M,this.imageAtlas&&this.imageAtlas.patternPositions||{});let k=c&&c.style&&c.style.getLayer(g);k&&(this.queryPadding=Math.max(this.queryPadding,k.queryRadius(_)))}}holdingForFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<o.exported.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(n){this.symbolFadeHoldUntil=o.exported.now()+n}setDependencies(n,c){let d={};for(let g of c)d[g]=!0;this.dependencies[n]=d}hasDependency(n,c){for(let d of n){let g=this.dependencies[d];if(g){for(let _ of c)if(g[_])return!0}}return!1}}class tn{constructor(n,c){this.max=n,this.onRemove=c,this.reset()}reset(){for(let n in this.data)for(let c of this.data[n])c.timeout&&clearTimeout(c.timeout),this.onRemove(c.value);return this.data={},this.order=[],this}add(n,c,d){let g=n.wrapped().key;this.data[g]===void 0&&(this.data[g]=[]);let _={value:c,timeout:void 0};if(d!==void 0&&(_.timeout=setTimeout(()=>{this.remove(n,_)},d)),this.data[g].push(_),this.order.push(g),this.order.length>this.max){let I=this._getAndRemoveByKey(this.order[0]);I&&this.onRemove(I)}return this}has(n){return n.wrapped().key in this.data}getAndRemove(n){return this.has(n)?this._getAndRemoveByKey(n.wrapped().key):null}_getAndRemoveByKey(n){let c=this.data[n].shift();return c.timeout&&clearTimeout(c.timeout),this.data[n].length===0&&delete this.data[n],this.order.splice(this.order.indexOf(n),1),c.value}getByKey(n){let c=this.data[n];return c?c[0].value:null}get(n){return this.has(n)?this.data[n.wrapped().key][0].value:null}remove(n,c){if(!this.has(n))return this;let d=n.wrapped().key,g=c===void 0?0:this.data[d].indexOf(c),_=this.data[d][g];return this.data[d].splice(g,1),_.timeout&&clearTimeout(_.timeout),this.data[d].length===0&&delete this.data[d],this.onRemove(_.value),this.order.splice(this.order.indexOf(d),1),this}setMaxSize(n){for(this.max=n;this.order.length>this.max;){let c=this._getAndRemoveByKey(this.order[0]);c&&this.onRemove(c)}return this}filter(n){let c=[];for(let d in this.data)for(let g of this.data[d])n(g.value)||c.push(g);for(let d of c)this.remove(d.value.tileID,d)}}class oo{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(n,c,d){let g=String(c);if(this.stateChanges[n]=this.stateChanges[n]||{},this.stateChanges[n][g]=this.stateChanges[n][g]||{},o.extend(this.stateChanges[n][g],d),this.deletedStates[n]===null){this.deletedStates[n]={};for(let _ in this.state[n])_!==g&&(this.deletedStates[n][_]=null)}else if(this.deletedStates[n]&&this.deletedStates[n][g]===null){this.deletedStates[n][g]={};for(let _ in this.state[n][g])d[_]||(this.deletedStates[n][g][_]=null)}else for(let _ in d)this.deletedStates[n]&&this.deletedStates[n][g]&&this.deletedStates[n][g][_]===null&&delete this.deletedStates[n][g][_]}removeFeatureState(n,c,d){if(this.deletedStates[n]===null)return;let g=String(c);if(this.deletedStates[n]=this.deletedStates[n]||{},d&&c!==void 0)this.deletedStates[n][g]!==null&&(this.deletedStates[n][g]=this.deletedStates[n][g]||{},this.deletedStates[n][g][d]=null);else if(c!==void 0)if(this.stateChanges[n]&&this.stateChanges[n][g])for(d in this.deletedStates[n][g]={},this.stateChanges[n][g])this.deletedStates[n][g][d]=null;else this.deletedStates[n][g]=null;else this.deletedStates[n]=null}getState(n,c){let d=String(c),g=o.extend({},(this.state[n]||{})[d],(this.stateChanges[n]||{})[d]);if(this.deletedStates[n]===null)return{};if(this.deletedStates[n]){let _=this.deletedStates[n][c];if(_===null)return{};for(let I in _)delete g[I]}return g}initializeTileState(n,c){n.setFeatureState(this.state,c)}coalesceChanges(n,c){let d={};for(let g in this.stateChanges){this.state[g]=this.state[g]||{};let _={};for(let I in this.stateChanges[g])this.state[g][I]||(this.state[g][I]={}),o.extend(this.state[g][I],this.stateChanges[g][I]),_[I]=this.state[g][I];d[g]=_}for(let g in this.deletedStates){this.state[g]=this.state[g]||{};let _={};if(this.deletedStates[g]===null)for(let I in this.state[g])_[I]={},this.state[g][I]={};else for(let I in this.deletedStates[g]){if(this.deletedStates[g][I]===null)this.state[g][I]={};else for(let M of Object.keys(this.deletedStates[g][I]))delete this.state[g][I][M];_[I]=this.state[g][I]}d[g]=d[g]||{},o.extend(d[g],_)}if(this.stateChanges={},this.deletedStates={},Object.keys(d).length!==0)for(let g in n)n[g].setFeatureState(d,c)}}class ri extends o.Evented{constructor(n,c,d){super(),this.id=n,this.dispatcher=d,this.on("data",g=>{g.dataType==="source"&&g.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&g.dataType==="source"&&g.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform))}),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=function(g,_,I,M){let E=new Ei[_.type](g,_,I,M);if(E.id!==g)throw new Error(`Expected Source id to be ${g} instead of ${E.id}`);return o.bindAll(["load","abort","unload","serialize","prepare"],E),E}(n,c,d,this),this._tiles={},this._cache=new tn(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new oo}onAdd(n){this.map=n,this._maxTileCacheSize=n?n._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(n)}onRemove(n){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(n)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(let n in this._tiles){let c=this._tiles[n];if(c.state!=="loaded"&&c.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;let n=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,n&&this.reload(),this.transform&&this.update(this.transform)}_loadTile(n,c){return this._source.loadTile(n,c)}_unloadTile(n){if(this._source.unloadTile)return this._source.unloadTile(n,()=>{})}_abortTile(n){this._source.abortTile&&this._source.abortTile(n,()=>{}),this._source.fire(new o.Event("dataabort",{tile:n,coord:n.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(n){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(let c in this._tiles){let d=this._tiles[c];d.upload(n),d.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(n=>n.tileID).sort(Hr).map(n=>n.key)}getRenderableIds(n){let c=[];for(let d in this._tiles)this._isIdRenderable(d,n)&&c.push(this._tiles[d]);return n?c.sort((d,g)=>{let _=d.tileID,I=g.tileID,M=new o.pointGeometry(_.canonical.x,_.canonical.y)._rotate(this.transform.angle),E=new o.pointGeometry(I.canonical.x,I.canonical.y)._rotate(this.transform.angle);return _.overscaledZ-I.overscaledZ||E.y-M.y||E.x-M.x}).map(d=>d.tileID.key):c.map(d=>d.tileID).sort(Hr).map(d=>d.key)}hasRenderableParent(n){let c=this.findLoadedParent(n,0);return!!c&&this._isIdRenderable(c.tileID.key)}_isIdRenderable(n,c){return this._tiles[n]&&this._tiles[n].hasData()&&!this._coveredTiles[n]&&(c||!this._tiles[n].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(let n in this._tiles)this._tiles[n].state!=="errored"&&this._reloadTile(n,"reloading")}}_reloadTile(n,c){let d=this._tiles[n];d&&(d.state!=="loading"&&(d.state=c),this._loadTile(d,this._tileLoaded.bind(this,d,n,c)))}_tileLoaded(n,c,d,g){if(g)return n.state="errored",void(g.status!==404?this._source.fire(new o.ErrorEvent(g,{tile:n})):this.update(this.transform));n.timeAdded=o.exported.now(),d==="expired"&&(n.refreshedUponExpiration=!0),this._setTileReloadTimer(c,n),this.getSource().type==="raster-dem"&&n.dem&&this._backfillDEM(n),this._state.initializeTileState(n,this.map?this.map.painter:null),n.aborted||this._source.fire(new o.Event("data",{dataType:"source",tile:n,coord:n.tileID}))}_backfillDEM(n){let c=this.getRenderableIds();for(let g=0;g<c.length;g++){let _=c[g];if(n.neighboringTiles&&n.neighboringTiles[_]){let I=this.getTileByID(_);d(n,I),d(I,n)}}function d(g,_){g.needsHillshadePrepare=!0;let I=_.tileID.canonical.x-g.tileID.canonical.x,M=_.tileID.canonical.y-g.tileID.canonical.y,E=Math.pow(2,g.tileID.canonical.z),k=_.tileID.key;I===0&&M===0||Math.abs(M)>1||(Math.abs(I)>1&&(Math.abs(I+E)===1?I+=E:Math.abs(I-E)===1&&(I-=E)),_.dem&&g.dem&&(g.dem.backfillBorder(_.dem,I,M),g.neighboringTiles&&g.neighboringTiles[k]&&(g.neighboringTiles[k].backfilled=!0)))}}getTile(n){return this.getTileByID(n.key)}getTileByID(n){return this._tiles[n]}_retainLoadedChildren(n,c,d,g){for(let _ in this._tiles){let I=this._tiles[_];if(g[_]||!I.hasData()||I.tileID.overscaledZ<=c||I.tileID.overscaledZ>d)continue;let M=I.tileID;for(;I&&I.tileID.overscaledZ>c+1;){let k=I.tileID.scaledTo(I.tileID.overscaledZ-1);I=this._tiles[k.key],I&&I.hasData()&&(M=k)}let E=M;for(;E.overscaledZ>c;)if(E=E.scaledTo(E.overscaledZ-1),n[E.key]){g[M.key]=M;break}}}findLoadedParent(n,c){if(n.key in this._loadedParentTiles){let d=this._loadedParentTiles[n.key];return d&&d.tileID.overscaledZ>=c?d:null}for(let d=n.overscaledZ-1;d>=c;d--){let g=n.scaledTo(d),_=this._getLoadedTile(g);if(_)return _}}_getLoadedTile(n){let c=this._tiles[n.key];return c&&c.hasData()?c:this._cache.getByKey(n.wrapped().key)}updateCacheSize(n){let c=Math.ceil(n.width/this._source.tileSize)+1,d=Math.ceil(n.height/this._source.tileSize)+1,g=Math.floor(c*d*5),_=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,g):g;this._cache.setMaxSize(_)}handleWrapJump(n){let c=Math.round((n-(this._prevLng===void 0?n:this._prevLng))/360);if(this._prevLng=n,c){let d={};for(let g in this._tiles){let _=this._tiles[g];_.tileID=_.tileID.unwrapTo(_.tileID.wrap+c),d[_.tileID.key]=_}this._tiles=d;for(let g in this._timers)clearTimeout(this._timers[g]),delete this._timers[g];for(let g in this._tiles)this._setTileReloadTimer(g,this._tiles[g])}}update(n){if(this.transform=n,!this._sourceLoaded||this._paused)return;let c;this.updateCacheSize(n),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?c=n.getVisibleUnwrappedCoordinates(this._source.tileID).map(E=>new o.OverscaledTileID(E.canonical.z,E.wrap,E.canonical.z,E.canonical.x,E.canonical.y)):(c=n.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(c=c.filter(E=>this._source.hasTile(E)))):c=[];let d=n.coveringZoomLevel(this._source),g=Math.max(d-ri.maxOverzooming,this._source.minzoom),_=Math.max(d+ri.maxUnderzooming,this._source.minzoom),I=this._updateRetainedTiles(c,d);if(hn(this._source.type)){let E={},k={},D=Object.keys(I);for(let O of D){let X=I[O],oe=this._tiles[O];if(!oe||oe.fadeEndTime&&oe.fadeEndTime<=o.exported.now())continue;let $=this.findLoadedParent(X,g);$&&(this._addTile($.tileID),E[$.tileID.key]=$.tileID),k[O]=X}this._retainLoadedChildren(k,d,_,I);for(let O in E)I[O]||(this._coveredTiles[O]=!0,I[O]=E[O])}for(let E in I)this._tiles[E].clearFadeHold();let M=o.keysDifference(this._tiles,I);for(let E of M){let k=this._tiles[E];k.hasSymbolBuckets&&!k.holdingForFade()?k.setHoldDuration(this.map._fadeDuration):k.hasSymbolBuckets&&!k.symbolFadeFinished()||this._removeTile(E)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(let n in this._tiles)this._tiles[n].holdingForFade()&&this._removeTile(n)}_updateRetainedTiles(n,c){let d={},g={},_=Math.max(c-ri.maxOverzooming,this._source.minzoom),I=Math.max(c+ri.maxUnderzooming,this._source.minzoom),M={};for(let E of n){let k=this._addTile(E);d[E.key]=E,k.hasData()||c<this._source.maxzoom&&(M[E.key]=E)}this._retainLoadedChildren(M,c,I,d);for(let E of n){let k=this._tiles[E.key];if(k.hasData())continue;if(c+1>this._source.maxzoom){let O=E.children(this._source.maxzoom)[0],X=this.getTile(O);if(X&&X.hasData()){d[O.key]=O;continue}}else{let O=E.children(this._source.maxzoom);if(d[O[0].key]&&d[O[1].key]&&d[O[2].key]&&d[O[3].key])continue}let D=k.wasRequested();for(let O=E.overscaledZ-1;O>=_;--O){let X=E.scaledTo(O);if(g[X.key]||(g[X.key]=!0,k=this.getTile(X),!k&&D&&(k=this._addTile(X)),k&&(d[X.key]=X,D=k.wasRequested(),k.hasData())))break}}return d}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(let n in this._tiles){let c=[],d,g=this._tiles[n].tileID;for(;g.overscaledZ>0;){if(g.key in this._loadedParentTiles){d=this._loadedParentTiles[g.key];break}c.push(g.key);let _=g.scaledTo(g.overscaledZ-1);if(d=this._getLoadedTile(_),d)break;g=_}for(let _ of c)this._loadedParentTiles[_]=d}}_addTile(n){let c=this._tiles[n.key];if(c)return c;c=this._cache.getAndRemove(n),c&&(this._setTileReloadTimer(n.key,c),c.tileID=n,this._state.initializeTileState(c,this.map?this.map.painter:null),this._cacheTimers[n.key]&&(clearTimeout(this._cacheTimers[n.key]),delete this._cacheTimers[n.key],this._setTileReloadTimer(n.key,c)));let d=c;return c||(c=new Mr(n,this._source.tileSize*n.overscaleFactor()),this._loadTile(c,this._tileLoaded.bind(this,c,n.key,c.state))),c.uses++,this._tiles[n.key]=c,d||this._source.fire(new o.Event("dataloading",{tile:c,coord:c.tileID,dataType:"source"})),c}_setTileReloadTimer(n,c){n in this._timers&&(clearTimeout(this._timers[n]),delete this._timers[n]);let d=c.getExpiryTimeout();d&&(this._timers[n]=setTimeout(()=>{this._reloadTile(n,"expired"),delete this._timers[n]},d))}_removeTile(n){let c=this._tiles[n];c&&(c.uses--,delete this._tiles[n],this._timers[n]&&(clearTimeout(this._timers[n]),delete this._timers[n]),c.uses>0||(c.hasData()&&c.state!=="reloading"?this._cache.add(c.tileID,c,c.getExpiryTimeout()):(c.aborted=!0,this._abortTile(c),this._unloadTile(c))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(let n in this._tiles)this._removeTile(n);this._cache.reset()}tilesIn(n,c,d){let g=[],_=this.transform;if(!_)return g;let I=d?_.getCameraQueryGeometry(n):n,M=n.map($=>_.pointCoordinate($)),E=I.map($=>_.pointCoordinate($)),k=this.getIds(),D=1/0,O=1/0,X=-1/0,oe=-1/0;for(let $ of E)D=Math.min(D,$.x),O=Math.min(O,$.y),X=Math.max(X,$.x),oe=Math.max(oe,$.y);for(let $=0;$<k.length;$++){let ne=this._tiles[k[$]];if(ne.holdingForFade())continue;let me=ne.tileID,ge=Math.pow(2,_.zoom-ne.tileID.overscaledZ),we=c*ne.queryPadding*o.EXTENT/ne.tileSize/ge,xe=[me.getTilePoint(new o.MercatorCoordinate(D,O)),me.getTilePoint(new o.MercatorCoordinate(X,oe))];if(xe[0].x-we<o.EXTENT&&xe[0].y-we<o.EXTENT&&xe[1].x+we>=0&&xe[1].y+we>=0){let Ne=M.map(ze=>me.getTilePoint(ze)),Pe=E.map(ze=>me.getTilePoint(ze));g.push({tile:ne,tileID:me,queryGeometry:Ne,cameraQueryGeometry:Pe,scale:ge})}}return g}getVisibleCoordinates(n){let c=this.getRenderableIds(n).map(d=>this._tiles[d].tileID);for(let d of c)d.posMatrix=this.transform.calculatePosMatrix(d.toUnwrapped());return c}hasTransition(){if(this._source.hasTransition())return!0;if(hn(this._source.type))for(let n in this._tiles){let c=this._tiles[n];if(c.fadeEndTime!==void 0&&c.fadeEndTime>=o.exported.now())return!0}return!1}setFeatureState(n,c,d){this._state.updateState(n=n||"_geojsonTileLayer",c,d)}removeFeatureState(n,c,d){this._state.removeFeatureState(n=n||"_geojsonTileLayer",c,d)}getFeatureState(n,c){return this._state.getState(n=n||"_geojsonTileLayer",c)}setDependencies(n,c,d){let g=this._tiles[n];g&&g.setDependencies(c,d)}reloadTilesForDependencies(n,c){for(let d in this._tiles)this._tiles[d].hasDependency(n,c)&&this._reloadTile(d,"reloading");this._cache.filter(d=>!d.hasDependency(n,c))}}function Hr(f,n){let c=Math.abs(2*f.wrap)-+(f.wrap<0),d=Math.abs(2*n.wrap)-+(n.wrap<0);return f.overscaledZ-n.overscaledZ||d-c||n.canonical.y-f.canonical.y||n.canonical.x-f.canonical.x}function hn(f){return f==="raster"||f==="image"||f==="video"}ri.maxOverzooming=10,ri.maxUnderzooming=3;let rn="mapboxgl_preloaded_worker_pool";class Lr{constructor(){this.active={}}acquire(n){if(!this.workers)for(this.workers=[];this.workers.length<Lr.workerCount;)this.workers.push(new Worker(_l.workerUrl));return this.active[n]=!0,this.workers.slice()}release(n){delete this.active[n],this.numActive()===0&&(this.workers.forEach(c=>{c.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[rn]}numActive(){return Object.keys(this.active).length}}let es=Math.floor(o.exported.hardwareConcurrency/2),_e;function V(){return _e||(_e=new Lr),_e}function F(f,n){let c={};for(let d in f)d!=="ref"&&(c[d]=f[d]);return o.refProperties.forEach(d=>{d in n&&(c[d]=n[d])}),c}function U(f){f=f.slice();let n=Object.create(null);for(let c=0;c<f.length;c++)n[f[c].id]=f[c];for(let c=0;c<f.length;c++)"ref"in f[c]&&(f[c]=F(f[c],n[f[c].ref]));return f}Lr.workerCount=Math.max(Math.min(es,6),1);let K={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function he(f,n,c){c.push({command:K.addSource,args:[f,n[f]]})}function Se(f,n,c){n.push({command:K.removeSource,args:[f]}),c[f]=!0}function Ve(f,n,c,d){Se(f,c,d),he(f,n,c)}function He(f,n,c){let d;for(d in f[c])if(Object.prototype.hasOwnProperty.call(f[c],d)&&d!=="data"&&!C(f[c][d],n[c][d]))return!1;for(d in n[c])if(Object.prototype.hasOwnProperty.call(n[c],d)&&d!=="data"&&!C(f[c][d],n[c][d]))return!1;return!0}function ye(f,n,c,d,g,_){let I;for(I in n=n||{},f=f||{})Object.prototype.hasOwnProperty.call(f,I)&&(C(f[I],n[I])||c.push({command:_,args:[d,I,n[I],g]}));for(I in n)Object.prototype.hasOwnProperty.call(n,I)&&!Object.prototype.hasOwnProperty.call(f,I)&&(C(f[I],n[I])||c.push({command:_,args:[d,I,n[I],g]}))}function Re(f){return f.id}function ie(f,n){return f[n.id]=n,f}class Xe{constructor(n,c){this.reset(n,c)}reset(n,c){this.points=n||[],this._distances=[0];for(let d=1;d<this.points.length;d++)this._distances[d]=this._distances[d-1]+this.points[d].dist(this.points[d-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(c||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(n){if(this.points.length===1)return this.points[0];n=o.clamp(n,0,1);let c=1,d=this._distances[c],g=n*this.paddedLength+this.padding;for(;d<g&&c<this._distances.length;)d=this._distances[++c];let _=c-1,I=this._distances[_],M=d-I,E=M>0?(g-I)/M:0;return this.points[_].mult(1-E).add(this.points[c].mult(E))}}function $e(f,n){let c=!0;return f==="always"||f!=="never"&&n!=="never"||(c=!1),c}class ft{constructor(n,c,d){let g=this.boxCells=[],_=this.circleCells=[];this.xCellCount=Math.ceil(n/d),this.yCellCount=Math.ceil(c/d);for(let I=0;I<this.xCellCount*this.yCellCount;I++)g.push([]),_.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=n,this.height=c,this.xScale=this.xCellCount/n,this.yScale=this.yCellCount/c,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(n,c,d,g,_){this._forEachCell(c,d,g,_,this._insertBoxCell,this.boxUid++),this.boxKeys.push(n),this.bboxes.push(c),this.bboxes.push(d),this.bboxes.push(g),this.bboxes.push(_)}insertCircle(n,c,d,g){this._forEachCell(c-g,d-g,c+g,d+g,this._insertCircleCell,this.circleUid++),this.circleKeys.push(n),this.circles.push(c),this.circles.push(d),this.circles.push(g)}_insertBoxCell(n,c,d,g,_,I){this.boxCells[_].push(I)}_insertCircleCell(n,c,d,g,_,I){this.circleCells[_].push(I)}_query(n,c,d,g,_,I,M){if(d<0||n>this.width||g<0||c>this.height)return[];let E=[];if(n<=0&&c<=0&&this.width<=d&&this.height<=g){if(_)return[{key:null,x1:n,y1:c,x2:d,y2:g}];for(let k=0;k<this.boxKeys.length;k++)E.push({key:this.boxKeys[k],x1:this.bboxes[4*k],y1:this.bboxes[4*k+1],x2:this.bboxes[4*k+2],y2:this.bboxes[4*k+3]});for(let k=0;k<this.circleKeys.length;k++){let D=this.circles[3*k],O=this.circles[3*k+1],X=this.circles[3*k+2];E.push({key:this.circleKeys[k],x1:D-X,y1:O-X,x2:D+X,y2:O+X})}}else this._forEachCell(n,c,d,g,this._queryCell,E,{hitTest:_,overlapMode:I,seenUids:{box:{},circle:{}}},M);return E}query(n,c,d,g){return this._query(n,c,d,g,!1,null)}hitTest(n,c,d,g,_,I){return this._query(n,c,d,g,!0,_,I).length>0}hitTestCircle(n,c,d,g,_){let I=n-d,M=n+d,E=c-d,k=c+d;if(M<0||I>this.width||k<0||E>this.height)return!1;let D=[];return this._forEachCell(I,E,M,k,this._queryCellCircle,D,{hitTest:!0,overlapMode:g,circle:{x:n,y:c,radius:d},seenUids:{box:{},circle:{}}},_),D.length>0}_queryCell(n,c,d,g,_,I,M,E){let{seenUids:k,hitTest:D,overlapMode:O}=M,X=this.boxCells[_];if(X!==null){let $=this.bboxes;for(let ne of X)if(!k.box[ne]){k.box[ne]=!0;let me=4*ne,ge=this.boxKeys[ne];if(n<=$[me+2]&&c<=$[me+3]&&d>=$[me+0]&&g>=$[me+1]&&(!E||E(ge))&&(!D||!$e(O,ge.overlapMode))&&(I.push({key:ge,x1:$[me],y1:$[me+1],x2:$[me+2],y2:$[me+3]}),D))return!0}}let oe=this.circleCells[_];if(oe!==null){let $=this.circles;for(let ne of oe)if(!k.circle[ne]){k.circle[ne]=!0;let me=3*ne,ge=this.circleKeys[ne];if(this._circleAndRectCollide($[me],$[me+1],$[me+2],n,c,d,g)&&(!E||E(ge))&&(!D||!$e(O,ge.overlapMode))){let we=$[me],xe=$[me+1],Ne=$[me+2];if(I.push({key:ge,x1:we-Ne,y1:xe-Ne,x2:we+Ne,y2:xe+Ne}),D)return!0}}}return!1}_queryCellCircle(n,c,d,g,_,I,M,E){let{circle:k,seenUids:D,overlapMode:O}=M,X=this.boxCells[_];if(X!==null){let $=this.bboxes;for(let ne of X)if(!D.box[ne]){D.box[ne]=!0;let me=4*ne,ge=this.boxKeys[ne];if(this._circleAndRectCollide(k.x,k.y,k.radius,$[me+0],$[me+1],$[me+2],$[me+3])&&(!E||E(ge))&&!$e(O,ge.overlapMode))return I.push(!0),!0}}let oe=this.circleCells[_];if(oe!==null){let $=this.circles;for(let ne of oe)if(!D.circle[ne]){D.circle[ne]=!0;let me=3*ne,ge=this.circleKeys[ne];if(this._circlesCollide($[me],$[me+1],$[me+2],k.x,k.y,k.radius)&&(!E||E(ge))&&!$e(O,ge.overlapMode))return I.push(!0),!0}}}_forEachCell(n,c,d,g,_,I,M,E){let k=this._convertToXCellCoord(n),D=this._convertToYCellCoord(c),O=this._convertToXCellCoord(d),X=this._convertToYCellCoord(g);for(let oe=k;oe<=O;oe++)for(let $=D;$<=X;$++)if(_.call(this,n,c,d,g,this.xCellCount*$+oe,I,M,E))return}_convertToXCellCoord(n){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(n*this.xScale)))}_convertToYCellCoord(n){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(n*this.yScale)))}_circlesCollide(n,c,d,g,_,I){let M=g-n,E=_-c,k=d+I;return k*k>M*M+E*E}_circleAndRectCollide(n,c,d,g,_,I,M){let E=(I-g)/2,k=Math.abs(n-(g+E));if(k>E+d)return!1;let D=(M-_)/2,O=Math.abs(c-(_+D));if(O>D+d)return!1;if(k<=E||O<=D)return!0;let X=k-E,oe=O-D;return X*X+oe*oe<=d*d}}function ut(f,n,c,d,g){let _=o.create();return n?(o.scale(_,_,[1/g,1/g,1]),c||o.rotateZ(_,_,d.angle)):o.multiply(_,d.labelPlaneMatrix,f),_}function Xt(f,n,c,d,g){if(n){let _=o.clone(f);return o.scale(_,_,[g,g,1]),c||o.rotateZ(_,_,-d.angle),_}return d.glCoordMatrix}function At(f,n){let c=[f.x,f.y,0,1];Ft(c,c,n);let d=c[3];return{point:new o.pointGeometry(c[0]/d,c[1]/d),signedDistanceFromCamera:d}}function Ue(f,n){return .5+f/n*.5}function It(f,n){let c=f[0]/f[3],d=f[1]/f[3];return c>=-n[0]&&c<=n[0]&&d>=-n[1]&&d<=n[1]}function yt(f,n,c,d,g,_,I,M,E){let k=d?f.textSizeData:f.iconSizeData,D=o.evaluateSizeForZoom(k,c.transform.zoom),O=[256/c.width*2+1,256/c.height*2+1],X=d?f.text.dynamicLayoutVertexArray:f.icon.dynamicLayoutVertexArray;X.clear();let oe=f.lineVertexArray,$=d?f.text.placedSymbolArray:f.icon.placedSymbolArray,ne=c.transform.width/c.transform.height,me=!1;for(let ge=0;ge<$.length;ge++){let we=$.get(ge);if(we.hidden||we.writingMode===o.WritingMode.vertical&&!me){hi(we.numGlyphs,X);continue}me=!1;let xe=[we.anchorX,we.anchorY,0,1];if(o.transformMat4(xe,xe,n),!It(xe,O)){hi(we.numGlyphs,X);continue}let Ne=Ue(c.transform.cameraToCenterDistance,xe[3]),Pe=o.evaluateSizeForFeature(k,D,we),ze=I?Pe/Ne:Pe*Ne,je=new o.pointGeometry(we.anchorX,we.anchorY),Ke=At(je,g).point,De={},mt=St(we,ze,!1,M,n,g,_,f.glyphOffsetArray,oe,X,Ke,je,De,ne,E);me=mt.useVertical,(mt.notEnoughRoom||me||mt.needsFlipping&&St(we,ze,!0,M,n,g,_,f.glyphOffsetArray,oe,X,Ke,je,De,ne,E).notEnoughRoom)&&hi(we.numGlyphs,X)}d?f.text.dynamicLayoutVertexBuffer.updateData(X):f.icon.dynamicLayoutVertexBuffer.updateData(X)}function ni(f,n,c,d,g,_,I,M,E,k,D,O){let X=M.glyphStartIndex+M.numGlyphs,oe=M.lineStartIndex,$=M.lineStartIndex+M.lineLength,ne=n.getoffsetX(M.glyphStartIndex),me=n.getoffsetX(X-1),ge=ci(f*ne,c,d,g,_,I,M.segment,oe,$,E,k,D,O);if(!ge)return null;let we=ci(f*me,c,d,g,_,I,M.segment,oe,$,E,k,D,O);return we?{first:ge,last:we}:null}function gi(f,n,c,d){return f===o.WritingMode.horizontal&&Math.abs(c.y-n.y)>Math.abs(c.x-n.x)*d?{useVertical:!0}:(f===o.WritingMode.vertical?n.y<c.y:n.x>c.x)?{needsFlipping:!0}:null}function St(f,n,c,d,g,_,I,M,E,k,D,O,X,oe,$){let ne=n/24,me=f.lineOffsetX*ne,ge=f.lineOffsetY*ne,we;if(f.numGlyphs>1){let xe=f.glyphStartIndex+f.numGlyphs,Ne=f.lineStartIndex,Pe=f.lineStartIndex+f.lineLength,ze=ni(ne,M,me,ge,c,D,O,f,E,_,X,$);if(!ze)return{notEnoughRoom:!0};let je=At(ze.first.point,I).point,Ke=At(ze.last.point,I).point;if(d&&!c){let De=gi(f.writingMode,je,Ke,oe);if(De)return De}we=[ze.first];for(let De=f.glyphStartIndex+1;De<xe-1;De++)we.push(ci(ne*M.getoffsetX(De),me,ge,c,D,O,f.segment,Ne,Pe,E,_,X,$));we.push(ze.last)}else{if(d&&!c){let Ne=At(O,g).point,Pe=f.lineStartIndex+f.segment+1,ze=new o.pointGeometry(E.getx(Pe),E.gety(Pe)),je=At(ze,g),Ke=je.signedDistanceFromCamera>0?je.point:tr(O,ze,Ne,1,g),De=gi(f.writingMode,Ne,Ke,oe);if(De)return De}let xe=ci(ne*M.getoffsetX(f.glyphStartIndex),me,ge,c,D,O,f.segment,f.lineStartIndex,f.lineStartIndex+f.lineLength,E,_,X,$);if(!xe)return{notEnoughRoom:!0};we=[xe]}for(let xe of we)o.addDynamicAttributes(k,xe.point,xe.angle);return{}}function tr(f,n,c,d,g){let _=At(f.add(f.sub(n)._unit()),g).point,I=c.sub(_);return c.add(I._mult(d/I.mag()))}function ci(f,n,c,d,g,_,I,M,E,k,D,O,X){let oe=d?f-n:f+n,$=oe>0?1:-1,ne=0;d&&($*=-1,ne=Math.PI),$<0&&(ne+=Math.PI);let me=$>0?M+I:M+I+1,ge=g,we=g,xe=0,Ne=0,Pe=Math.abs(oe),ze=[];for(;xe+Ne<=Pe;){if(me+=$,me<M||me>=E)return null;if(we=ge,ze.push(ge),ge=O[me],ge===void 0){let rt=new o.pointGeometry(k.getx(me),k.gety(me)),Pt=At(rt,D);if(Pt.signedDistanceFromCamera>0)ge=O[me]=Pt.point;else{let ei=me-$;ge=tr(xe===0?_:new o.pointGeometry(k.getx(ei),k.gety(ei)),rt,we,Pe-xe+1,D)}}xe+=Ne,Ne=we.dist(ge)}let je=(Pe-xe)/Ne,Ke=ge.sub(we),De=Ke.mult(je)._add(we);De._add(Ke._unit()._perp()._mult(c*$));let mt=ne+Math.atan2(ge.y-we.y,ge.x-we.x);return ze.push(De),{point:De,angle:X?mt:0,path:ze}}let Ri=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function hi(f,n){for(let c=0;c<f;c++){let d=n.length;n.resize(d+4),n.float32.set(Ri,3*d)}}function Ft(f,n,c){let d=n[0],g=n[1];return f[0]=c[0]*d+c[4]*g+c[12],f[1]=c[1]*d+c[5]*g+c[13],f[3]=c[3]*d+c[7]*g+c[15],f}let di=100;class ir{constructor(n,c=new ft(n.width+200,n.height+200,25),d=new ft(n.width+200,n.height+200,25)){this.transform=n,this.grid=c,this.ignoredGrid=d,this.pitchfactor=Math.cos(n._pitch)*n.cameraToCenterDistance,this.screenRightBoundary=n.width+di,this.screenBottomBoundary=n.height+di,this.gridRightBoundary=n.width+200,this.gridBottomBoundary=n.height+200}placeCollisionBox(n,c,d,g,_){let I=this.projectAndGetPerspectiveRatio(g,n.anchorPointX,n.anchorPointY),M=d*I.perspectiveRatio,E=n.x1*M+I.point.x,k=n.y1*M+I.point.y,D=n.x2*M+I.point.x,O=n.y2*M+I.point.y;return!this.isInsideGrid(E,k,D,O)||c!=="always"&&this.grid.hitTest(E,k,D,O,c,_)?{box:[],offscreen:!1}:{box:[E,k,D,O],offscreen:this.isOffscreen(E,k,D,O)}}placeCollisionCircles(n,c,d,g,_,I,M,E,k,D,O,X,oe){let $=[],ne=new o.pointGeometry(c.anchorX,c.anchorY),me=At(ne,I),ge=Ue(this.transform.cameraToCenterDistance,me.signedDistanceFromCamera),we=(D?_/ge:_*ge)/o.ONE_EM,xe=At(ne,M).point,Ne=ni(we,g,c.lineOffsetX*we,c.lineOffsetY*we,!1,xe,ne,c,d,M,{},!1),Pe=!1,ze=!1,je=!0;if(Ne){let Ke=.5*X*ge+oe,De=new o.pointGeometry(-100,-100),mt=new o.pointGeometry(this.screenRightBoundary,this.screenBottomBoundary),rt=new Xe,Pt=Ne.first,ei=Ne.last,Zt=[];for(let zt=Pt.path.length-1;zt>=1;zt--)Zt.push(Pt.path[zt]);for(let zt=1;zt<ei.path.length;zt++)Zt.push(ei.path[zt]);let Qt=2.5*Ke;if(E){let zt=Zt.map(ai=>At(ai,E));Zt=zt.some(ai=>ai.signedDistanceFromCamera<=0)?[]:zt.map(ai=>ai.point)}let Qi=[];if(Zt.length>0){let zt=Zt[0].clone(),ai=Zt[0].clone();for(let Si=1;Si<Zt.length;Si++)zt.x=Math.min(zt.x,Zt[Si].x),zt.y=Math.min(zt.y,Zt[Si].y),ai.x=Math.max(ai.x,Zt[Si].x),ai.y=Math.max(ai.y,Zt[Si].y);Qi=zt.x>=De.x&&ai.x<=mt.x&&zt.y>=De.y&&ai.y<=mt.y?[Zt]:ai.x<De.x||zt.x>mt.x||ai.y<De.y||zt.y>mt.y?[]:o.clipLine([Zt],De.x,De.y,mt.x,mt.y)}for(let zt of Qi){rt.reset(zt,.25*Ke);let ai=0;ai=rt.length<=.5*Ke?1:Math.ceil(rt.paddedLength/Qt)+1;for(let Si=0;Si<ai;Si++){let Or=Si/Math.max(ai-1,1),Tn=rt.lerp(Or),jn=Tn.x+di,Hn=Tn.y+di;$.push(jn,Hn,Ke,0);let is=jn-Ke,mn=Hn-Ke,bo=jn+Ke,Es=Hn+Ke;if(je=je&&this.isOffscreen(is,mn,bo,Es),ze=ze||this.isInsideGrid(is,mn,bo,Es),n!=="always"&&this.grid.hitTestCircle(jn,Hn,Ke,n,O)&&(Pe=!0,!k))return{circles:[],offscreen:!1,collisionDetected:Pe}}}}return{circles:!k&&Pe||!ze?[]:$,offscreen:je,collisionDetected:Pe}}queryRenderedSymbols(n){if(n.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};let c=[],d=1/0,g=1/0,_=-1/0,I=-1/0;for(let D of n){let O=new o.pointGeometry(D.x+di,D.y+di);d=Math.min(d,O.x),g=Math.min(g,O.y),_=Math.max(_,O.x),I=Math.max(I,O.y),c.push(O)}let M=this.grid.query(d,g,_,I).concat(this.ignoredGrid.query(d,g,_,I)),E={},k={};for(let D of M){let O=D.key;if(E[O.bucketInstanceId]===void 0&&(E[O.bucketInstanceId]={}),E[O.bucketInstanceId][O.featureIndex])continue;let X=[new o.pointGeometry(D.x1,D.y1),new o.pointGeometry(D.x2,D.y1),new o.pointGeometry(D.x2,D.y2),new o.pointGeometry(D.x1,D.y2)];o.polygonIntersectsPolygon(c,X)&&(E[O.bucketInstanceId][O.featureIndex]=!0,k[O.bucketInstanceId]===void 0&&(k[O.bucketInstanceId]=[]),k[O.bucketInstanceId].push(O.featureIndex))}return k}insertCollisionBox(n,c,d,g,_,I){(d?this.ignoredGrid:this.grid).insert({bucketInstanceId:g,featureIndex:_,collisionGroupID:I,overlapMode:c},n[0],n[1],n[2],n[3])}insertCollisionCircles(n,c,d,g,_,I){let M=d?this.ignoredGrid:this.grid,E={bucketInstanceId:g,featureIndex:_,collisionGroupID:I,overlapMode:c};for(let k=0;k<n.length;k+=4)M.insertCircle(E,n[k],n[k+1],n[k+2])}projectAndGetPerspectiveRatio(n,c,d){let g=[c,d,0,1];return Ft(g,g,n),{point:new o.pointGeometry((g[0]/g[3]+1)/2*this.transform.width+di,(-g[1]/g[3]+1)/2*this.transform.height+di),perspectiveRatio:.5+this.transform.cameraToCenterDistance/g[3]*.5}}isOffscreen(n,c,d,g){return d<di||n>=this.screenRightBoundary||g<di||c>this.screenBottomBoundary}isInsideGrid(n,c,d,g){return d>=0&&n<this.gridRightBoundary&&g>=0&&c<this.gridBottomBoundary}getViewportMatrix(){let n=o.identity([]);return o.translate(n,n,[-100,-100,0]),n}}function Ti(f,n,c){return n*(o.EXTENT/(f.tileSize*Math.pow(2,c-f.tileID.overscaledZ)))}class Er{constructor(n,c,d,g){this.opacity=n?Math.max(0,Math.min(1,n.opacity+(n.placed?c:-c))):g&&d?1:0,this.placed=d}isHidden(){return this.opacity===0&&!this.placed}}class rr{constructor(n,c,d,g,_){this.text=new Er(n?n.text:null,c,d,_),this.icon=new Er(n?n.icon:null,c,g,_)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Ai{constructor(n,c,d){this.text=n,this.icon=c,this.skipFade=d}}class sa{constructor(){this.invProjMatrix=o.create(),this.viewportMatrix=o.create(),this.circles=[]}}class aa{constructor(n,c,d,g,_){this.bucketInstanceId=n,this.featureIndex=c,this.sourceLayerIndex=d,this.bucketIndex=g,this.tileID=_}}class Y{constructor(n){this.crossSourceCollisions=n,this.maxGroupID=0,this.collisionGroups={}}get(n){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[n]){let c=++this.maxGroupID;this.collisionGroups[n]={ID:c,predicate:d=>d.collisionGroupID===c}}return this.collisionGroups[n]}}function P(f,n,c,d,g){let{horizontalAlign:_,verticalAlign:I}=o.getAnchorAlignment(f),M=-(_-.5)*n,E=-(I-.5)*c,k=o.evaluateVariableOffset(f,d);return new o.pointGeometry(M+k[0]*g,E+k[1]*g)}function L(f,n,c,d,g,_){let{x1:I,x2:M,y1:E,y2:k,anchorPointX:D,anchorPointY:O}=f,X=new o.pointGeometry(n,c);return d&&X._rotate(g?_:-_),{x1:I+X.x,y1:E+X.y,x2:M+X.x,y2:k+X.y,anchorPointX:D,anchorPointY:O}}class j{constructor(n,c,d,g){this.transform=n.clone(),this.collisionIndex=new ir(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=c,this.retainedQueryData={},this.collisionGroups=new Y(d),this.collisionCircleArrays={},this.prevPlacement=g,g&&(g.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(n,c,d,g){let _=d.getBucket(c),I=d.latestFeatureIndex;if(!_||!I||c.id!==_.layerIds[0])return;let M=d.collisionBoxArray,E=_.layers[0].layout,k=Math.pow(2,this.transform.zoom-d.tileID.overscaledZ),D=d.tileSize/o.EXTENT,O=this.transform.calculatePosMatrix(d.tileID.toUnwrapped()),X=E.get("text-pitch-alignment")==="map",oe=E.get("text-rotation-alignment")==="map",$=Ti(d,1,this.transform.zoom),ne=ut(O,X,oe,this.transform,$),me=null;if(X){let we=Xt(O,X,oe,this.transform,$);me=o.multiply([],this.transform.labelPlaneMatrix,we)}this.retainedQueryData[_.bucketInstanceId]=new aa(_.bucketInstanceId,I,_.sourceLayerIndex,_.index,d.tileID);let ge={bucket:_,layout:E,posMatrix:O,textLabelPlaneMatrix:ne,labelToScreenMatrix:me,scale:k,textPixelRatio:D,holdingForFade:d.holdingForFade(),collisionBoxArray:M,partiallyEvaluatedTextSize:o.evaluateSizeForZoom(_.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(_.sourceID)};if(g)for(let we of _.sortKeyRanges){let{sortKey:xe,symbolInstanceStart:Ne,symbolInstanceEnd:Pe}=we;n.push({sortKey:xe,symbolInstanceStart:Ne,symbolInstanceEnd:Pe,parameters:ge})}else n.push({symbolInstanceStart:0,symbolInstanceEnd:_.symbolInstances.length,parameters:ge})}attemptAnchorPlacement(n,c,d,g,_,I,M,E,k,D,O,X,oe,$,ne){let me=[X.textOffset0,X.textOffset1],ge=P(n,d,g,me,_),we=this.collisionIndex.placeCollisionBox(L(c,ge.x,ge.y,I,M,this.transform.angle),O,E,k,D.predicate);if((!ne||this.collisionIndex.placeCollisionBox(L(ne,ge.x,ge.y,I,M,this.transform.angle),O,E,k,D.predicate).box.length!==0)&&we.box.length>0){let xe;return this.prevPlacement&&this.prevPlacement.variableOffsets[X.crossTileID]&&this.prevPlacement.placements[X.crossTileID]&&this.prevPlacement.placements[X.crossTileID].text&&(xe=this.prevPlacement.variableOffsets[X.crossTileID].anchor),this.variableOffsets[X.crossTileID]={textOffset:me,width:d,height:g,anchor:n,textBoxScale:_,prevAnchor:xe},this.markUsedJustification(oe,n,X,$),oe.allowVerticalPlacement&&(this.markUsedOrientation(oe,$,X),this.placedOrientations[X.crossTileID]=$),{shift:ge,placedGlyphBoxes:we}}}placeLayerBucketPart(n,c,d){let{bucket:g,layout:_,posMatrix:I,textLabelPlaneMatrix:M,labelToScreenMatrix:E,textPixelRatio:k,holdingForFade:D,collisionBoxArray:O,partiallyEvaluatedTextSize:X,collisionGroup:oe}=n.parameters,$=_.get("text-optional"),ne=_.get("icon-optional"),me=o.getOverlapMode(_,"text-overlap","text-allow-overlap"),ge=me==="always",we=o.getOverlapMode(_,"icon-overlap","icon-allow-overlap"),xe=we==="always",Ne=_.get("text-rotation-alignment")==="map",Pe=_.get("text-pitch-alignment")==="map",ze=_.get("icon-text-fit")!=="none",je=_.get("symbol-z-order")==="viewport-y",Ke=ge&&(xe||!g.hasIconData()||ne),De=xe&&(ge||!g.hasTextData()||$);!g.collisionArrays&&O&&g.deserializeCollisionBoxes(O);let mt=(rt,Pt)=>{if(c[rt.crossTileID])return;if(D)return void(this.placements[rt.crossTileID]=new Ai(!1,!1,!1));let ei=!1,Zt=!1,Qt=!0,Qi=null,zt={box:null,offscreen:null},ai={box:null,offscreen:null},Si=null,Or=null,Tn=null,jn=0,Hn=0,is=0;Pt.textFeatureIndex?jn=Pt.textFeatureIndex:rt.useRuntimeCollisionCircles&&(jn=rt.featureIndex),Pt.verticalTextFeatureIndex&&(Hn=Pt.verticalTextFeatureIndex);let mn=Pt.textBox;if(mn){let An=yi=>{let xr=o.WritingMode.horizontal;if(g.allowVerticalPlacement&&!yi&&this.prevPlacement){let nn=this.prevPlacement.placedOrientations[rt.crossTileID];nn&&(this.placedOrientations[rt.crossTileID]=nn,xr=nn,this.markUsedOrientation(g,xr,rt))}return xr},li=(yi,xr)=>{if(g.allowVerticalPlacement&&rt.numVerticalGlyphVertices>0&&Pt.verticalTextBox){for(let nn of g.writingModes)if(nn===o.WritingMode.vertical?(zt=xr(),ai=zt):zt=yi(),zt&&zt.box&&zt.box.length)break}else zt=yi()};if(_.get("text-variable-anchor")){let yi=_.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[rt.crossTileID]){let Wi=this.prevPlacement.variableOffsets[rt.crossTileID];yi.indexOf(Wi.anchor)>0&&(yi=yi.filter(Ts=>Ts!==Wi.anchor),yi.unshift(Wi.anchor))}let xr=(Wi,Ts,wo)=>{let Tu=Wi.x2-Wi.x1,Mh=Wi.y2-Wi.y1,Au=rt.textBoxScale,Vp=ze&&we==="never"?Ts:null,As={box:[],offscreen:!1},Pu=me!=="never"?2*yi.length:yi.length;for(let Io=0;Io<Pu;++Io){let _a=this.attemptAnchorPlacement(yi[Io%yi.length],Wi,Tu,Mh,Au,Ne,Pe,k,I,oe,Io>=yi.length?me:"never",rt,g,wo,Vp);if(_a&&(As=_a.placedGlyphBoxes,As&&As.box&&As.box.length)){ei=!0,Qi=_a.shift;break}}return As};li(()=>xr(mn,Pt.iconBox,o.WritingMode.horizontal),()=>{let Wi=Pt.verticalTextBox;return g.allowVerticalPlacement&&!(zt&&zt.box&&zt.box.length)&&rt.numVerticalGlyphVertices>0&&Wi?xr(Wi,Pt.verticalIconBox,o.WritingMode.vertical):{box:null,offscreen:null}}),zt&&(ei=zt.box,Qt=zt.offscreen);let nn=An(zt&&zt.box);if(!ei&&this.prevPlacement){let Wi=this.prevPlacement.variableOffsets[rt.crossTileID];Wi&&(this.variableOffsets[rt.crossTileID]=Wi,this.markUsedJustification(g,Wi.anchor,rt,nn))}}else{let yi=(xr,nn)=>{let Wi=this.collisionIndex.placeCollisionBox(xr,me,k,I,oe.predicate);return Wi&&Wi.box&&Wi.box.length&&(this.markUsedOrientation(g,nn,rt),this.placedOrientations[rt.crossTileID]=nn),Wi};li(()=>yi(mn,o.WritingMode.horizontal),()=>{let xr=Pt.verticalTextBox;return g.allowVerticalPlacement&&rt.numVerticalGlyphVertices>0&&xr?yi(xr,o.WritingMode.vertical):{box:null,offscreen:null}}),An(zt&&zt.box&&zt.box.length)}}if(Si=zt,ei=Si&&Si.box&&Si.box.length>0,Qt=Si&&Si.offscreen,rt.useRuntimeCollisionCircles){let An=g.text.placedSymbolArray.get(rt.centerJustifiedTextSymbolIndex),li=o.evaluateSizeForFeature(g.textSizeData,X,An),yi=_.get("text-padding");Or=this.collisionIndex.placeCollisionCircles(me,An,g.lineVertexArray,g.glyphOffsetArray,li,I,M,E,d,Pe,oe.predicate,rt.collisionCircleDiameter,yi),ei=ge||Or.circles.length>0&&!Or.collisionDetected,Qt=Qt&&Or.offscreen}if(Pt.iconFeatureIndex&&(is=Pt.iconFeatureIndex),Pt.iconBox){let An=li=>{let yi=ze&&Qi?L(li,Qi.x,Qi.y,Ne,Pe,this.transform.angle):li;return this.collisionIndex.placeCollisionBox(yi,we,k,I,oe.predicate)};ai&&ai.box&&ai.box.length&&Pt.verticalIconBox?(Tn=An(Pt.verticalIconBox),Zt=Tn.box.length>0):(Tn=An(Pt.iconBox),Zt=Tn.box.length>0),Qt=Qt&&Tn.offscreen}let bo=$||rt.numHorizontalGlyphVertices===0&&rt.numVerticalGlyphVertices===0,Es=ne||rt.numIconVertices===0;if(bo||Es?Es?bo||(Zt=Zt&&ei):ei=Zt&&ei:Zt=ei=Zt&&ei,ei&&Si&&Si.box&&this.collisionIndex.insertCollisionBox(Si.box,me,_.get("text-ignore-placement"),g.bucketInstanceId,ai&&ai.box&&Hn?Hn:jn,oe.ID),Zt&&Tn&&this.collisionIndex.insertCollisionBox(Tn.box,we,_.get("icon-ignore-placement"),g.bucketInstanceId,is,oe.ID),Or&&(ei&&this.collisionIndex.insertCollisionCircles(Or.circles,me,_.get("text-ignore-placement"),g.bucketInstanceId,jn,oe.ID),d)){let An=g.bucketInstanceId,li=this.collisionCircleArrays[An];li===void 0&&(li=this.collisionCircleArrays[An]=new sa);for(let yi=0;yi<Or.circles.length;yi+=4)li.circles.push(Or.circles[yi+0]),li.circles.push(Or.circles[yi+1]),li.circles.push(Or.circles[yi+2]),li.circles.push(Or.collisionDetected?1:0)}this.placements[rt.crossTileID]=new Ai(ei||Ke,Zt||De,Qt||g.justReloaded),c[rt.crossTileID]=!0};if(je){let rt=g.getSortedSymbolIndexes(this.transform.angle);for(let Pt=rt.length-1;Pt>=0;--Pt){let ei=rt[Pt];mt(g.symbolInstances.get(ei),g.collisionArrays[ei])}}else for(let rt=n.symbolInstanceStart;rt<n.symbolInstanceEnd;rt++)mt(g.symbolInstances.get(rt),g.collisionArrays[rt]);if(d&&g.bucketInstanceId in this.collisionCircleArrays){let rt=this.collisionCircleArrays[g.bucketInstanceId];o.invert(rt.invProjMatrix,I),rt.viewportMatrix=this.collisionIndex.getViewportMatrix()}g.justReloaded=!1}markUsedJustification(n,c,d,g){let _;_=g===o.WritingMode.vertical?d.verticalPlacedTextSymbolIndex:{left:d.leftJustifiedTextSymbolIndex,center:d.centerJustifiedTextSymbolIndex,right:d.rightJustifiedTextSymbolIndex}[o.getAnchorJustification(c)];let I=[d.leftJustifiedTextSymbolIndex,d.centerJustifiedTextSymbolIndex,d.rightJustifiedTextSymbolIndex,d.verticalPlacedTextSymbolIndex];for(let M of I)M>=0&&(n.text.placedSymbolArray.get(M).crossTileID=_>=0&&M!==_?0:d.crossTileID)}markUsedOrientation(n,c,d){let g=c===o.WritingMode.horizontal||c===o.WritingMode.horizontalOnly?c:0,_=c===o.WritingMode.vertical?c:0,I=[d.leftJustifiedTextSymbolIndex,d.centerJustifiedTextSymbolIndex,d.rightJustifiedTextSymbolIndex];for(let M of I)n.text.placedSymbolArray.get(M).placedOrientation=g;d.verticalPlacedTextSymbolIndex&&(n.text.placedSymbolArray.get(d.verticalPlacedTextSymbolIndex).placedOrientation=_)}commit(n){this.commitTime=n,this.zoomAtLastRecencyCheck=this.transform.zoom;let c=this.prevPlacement,d=!1;this.prevZoomAdjustment=c?c.zoomAdjustment(this.transform.zoom):0;let g=c?c.symbolFadeChange(n):1,_=c?c.opacities:{},I=c?c.variableOffsets:{},M=c?c.placedOrientations:{};for(let E in this.placements){let k=this.placements[E],D=_[E];D?(this.opacities[E]=new rr(D,g,k.text,k.icon),d=d||k.text!==D.text.placed||k.icon!==D.icon.placed):(this.opacities[E]=new rr(null,g,k.text,k.icon,k.skipFade),d=d||k.text||k.icon)}for(let E in _){let k=_[E];if(!this.opacities[E]){let D=new rr(k,g,!1,!1);D.isHidden()||(this.opacities[E]=D,d=d||k.text.placed||k.icon.placed)}}for(let E in I)this.variableOffsets[E]||!this.opacities[E]||this.opacities[E].isHidden()||(this.variableOffsets[E]=I[E]);for(let E in M)this.placedOrientations[E]||!this.opacities[E]||this.opacities[E].isHidden()||(this.placedOrientations[E]=M[E]);d?this.lastPlacementChangeTime=n:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=c?c.lastPlacementChangeTime:n)}updateLayerOpacities(n,c){let d={};for(let g of c){let _=g.getBucket(n);_&&g.latestFeatureIndex&&n.id===_.layerIds[0]&&this.updateBucketOpacities(_,d,g.collisionBoxArray)}}updateBucketOpacities(n,c,d){n.hasTextData()&&n.text.opacityVertexArray.clear(),n.hasIconData()&&n.icon.opacityVertexArray.clear(),n.hasIconCollisionBoxData()&&n.iconCollisionBox.collisionVertexArray.clear(),n.hasTextCollisionBoxData()&&n.textCollisionBox.collisionVertexArray.clear();let g=n.layers[0].layout,_=new rr(null,0,!1,!1,!0),I=g.get("text-allow-overlap"),M=g.get("icon-allow-overlap"),E=g.get("text-variable-anchor"),k=g.get("text-rotation-alignment")==="map",D=g.get("text-pitch-alignment")==="map",O=g.get("icon-text-fit")!=="none",X=new rr(null,0,I&&(M||!n.hasIconData()||g.get("icon-optional")),M&&(I||!n.hasTextData()||g.get("text-optional")),!0);!n.collisionArrays&&d&&(n.hasIconCollisionBoxData()||n.hasTextCollisionBoxData())&&n.deserializeCollisionBoxes(d);let oe=($,ne,me)=>{for(let ge=0;ge<ne/4;ge++)$.opacityVertexArray.emplaceBack(me)};for(let $=0;$<n.symbolInstances.length;$++){let ne=n.symbolInstances.get($),{numHorizontalGlyphVertices:me,numVerticalGlyphVertices:ge,crossTileID:we}=ne,xe=this.opacities[we];c[we]?xe=_:xe||(xe=X,this.opacities[we]=xe),c[we]=!0;let Ne=ne.numIconVertices>0,Pe=this.placedOrientations[ne.crossTileID],ze=Pe===o.WritingMode.vertical,je=Pe===o.WritingMode.horizontal||Pe===o.WritingMode.horizontalOnly;if(me>0||ge>0){let Ke=Ae(xe.text);oe(n.text,me,ze?gt:Ke),oe(n.text,ge,je?gt:Ke);let De=xe.text.isHidden();[ne.rightJustifiedTextSymbolIndex,ne.centerJustifiedTextSymbolIndex,ne.leftJustifiedTextSymbolIndex].forEach(Pt=>{Pt>=0&&(n.text.placedSymbolArray.get(Pt).hidden=De||ze?1:0)}),ne.verticalPlacedTextSymbolIndex>=0&&(n.text.placedSymbolArray.get(ne.verticalPlacedTextSymbolIndex).hidden=De||je?1:0);let mt=this.variableOffsets[ne.crossTileID];mt&&this.markUsedJustification(n,mt.anchor,ne,Pe);let rt=this.placedOrientations[ne.crossTileID];rt&&(this.markUsedJustification(n,"left",ne,rt),this.markUsedOrientation(n,rt,ne))}if(Ne){let Ke=Ae(xe.icon),De=!(O&&ne.verticalPlacedIconSymbolIndex&&ze);ne.placedIconSymbolIndex>=0&&(oe(n.icon,ne.numIconVertices,De?Ke:gt),n.icon.placedSymbolArray.get(ne.placedIconSymbolIndex).hidden=xe.icon.isHidden()),ne.verticalPlacedIconSymbolIndex>=0&&(oe(n.icon,ne.numVerticalIconVertices,De?gt:Ke),n.icon.placedSymbolArray.get(ne.verticalPlacedIconSymbolIndex).hidden=xe.icon.isHidden())}if(n.hasIconCollisionBoxData()||n.hasTextCollisionBoxData()){let Ke=n.collisionArrays[$];if(Ke){let De=new o.pointGeometry(0,0);if(Ke.textBox||Ke.verticalTextBox){let rt=!0;if(E){let Pt=this.variableOffsets[we];Pt?(De=P(Pt.anchor,Pt.width,Pt.height,Pt.textOffset,Pt.textBoxScale),k&&De._rotate(D?this.transform.angle:-this.transform.angle)):rt=!1}Ke.textBox&&J(n.textCollisionBox.collisionVertexArray,xe.text.placed,!rt||ze,De.x,De.y),Ke.verticalTextBox&&J(n.textCollisionBox.collisionVertexArray,xe.text.placed,!rt||je,De.x,De.y)}let mt=Boolean(!je&&Ke.verticalIconBox);Ke.iconBox&&J(n.iconCollisionBox.collisionVertexArray,xe.icon.placed,mt,O?De.x:0,O?De.y:0),Ke.verticalIconBox&&J(n.iconCollisionBox.collisionVertexArray,xe.icon.placed,!mt,O?De.x:0,O?De.y:0)}}}if(n.sortFeatures(this.transform.angle),this.retainedQueryData[n.bucketInstanceId]&&(this.retainedQueryData[n.bucketInstanceId].featureSortOrder=n.featureSortOrder),n.hasTextData()&&n.text.opacityVertexBuffer&&n.text.opacityVertexBuffer.updateData(n.text.opacityVertexArray),n.hasIconData()&&n.icon.opacityVertexBuffer&&n.icon.opacityVertexBuffer.updateData(n.icon.opacityVertexArray),n.hasIconCollisionBoxData()&&n.iconCollisionBox.collisionVertexBuffer&&n.iconCollisionBox.collisionVertexBuffer.updateData(n.iconCollisionBox.collisionVertexArray),n.hasTextCollisionBoxData()&&n.textCollisionBox.collisionVertexBuffer&&n.textCollisionBox.collisionVertexBuffer.updateData(n.textCollisionBox.collisionVertexArray),n.bucketInstanceId in this.collisionCircleArrays){let $=this.collisionCircleArrays[n.bucketInstanceId];n.placementInvProjMatrix=$.invProjMatrix,n.placementViewportMatrix=$.viewportMatrix,n.collisionCircleArray=$.circles,delete this.collisionCircleArrays[n.bucketInstanceId]}}symbolFadeChange(n){return this.fadeDuration===0?1:(n-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(n){return Math.max(0,(this.transform.zoom-n)/1.5)}hasTransitions(n){return this.stale||n-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(n,c){let d=this.zoomAtLastRecencyCheck===c?1-this.zoomAdjustment(c):1;return this.zoomAtLastRecencyCheck=c,this.commitTime+this.fadeDuration*d>n}setStale(){this.stale=!0}}function J(f,n,c,d,g){f.emplaceBack(n?1:0,c?1:0,d||0,g||0),f.emplaceBack(n?1:0,c?1:0,d||0,g||0),f.emplaceBack(n?1:0,c?1:0,d||0,g||0),f.emplaceBack(n?1:0,c?1:0,d||0,g||0)}let re=Math.pow(2,25),pe=Math.pow(2,24),ue=Math.pow(2,17),ce=Math.pow(2,16),fe=Math.pow(2,9),ke=Math.pow(2,8),Ge=Math.pow(2,1);function Ae(f){if(f.opacity===0&&!f.placed)return 0;if(f.opacity===1&&f.placed)return 4294967295;let n=f.placed?1:0,c=Math.floor(127*f.opacity);return c*re+n*pe+c*ue+n*ce+c*fe+n*ke+c*Ge+n}let gt=0;class lt{constructor(n){this._sortAcrossTiles=n.layout.get("symbol-z-order")!=="viewport-y"&&!n.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(n,c,d,g,_){let I=this._bucketParts;for(;this._currentTileIndex<n.length;)if(c.getBucketParts(I,g,n[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,_())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,I.sort((M,E)=>M.sortKey-E.sortKey));this._currentPartIndex<I.length;)if(c.placeLayerBucketPart(I[this._currentPartIndex],this._seenCrossTileIDs,d),this._currentPartIndex++,_())return!0;return!1}}class xt{constructor(n,c,d,g,_,I,M){this.placement=new j(n,_,I,M),this._currentPlacementIndex=c.length-1,this._forceFullPlacement=d,this._showCollisionBoxes=g,this._done=!1}isDone(){return this._done}continuePlacement(n,c,d){let g=o.exported.now(),_=()=>{let I=o.exported.now()-g;return!this._forceFullPlacement&&I>2};for(;this._currentPlacementIndex>=0;){let I=c[n[this._currentPlacementIndex]],M=this.placement.collisionIndex.transform.zoom;if(I.type==="symbol"&&(!I.minzoom||I.minzoom<=M)&&(!I.maxzoom||I.maxzoom>M)){if(this._inProgressLayer||(this._inProgressLayer=new lt(I)),this._inProgressLayer.continuePlacement(d[I.source],this.placement,this._showCollisionBoxes,I,_))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(n){return this.placement.commit(n),this.placement}}let Ct=512/o.EXTENT/2;class oi{constructor(n,c,d){this.tileID=n,this.indexedSymbolInstances={},this.bucketInstanceId=d;for(let g=0;g<c.length;g++){let _=c.get(g),I=_.key;this.indexedSymbolInstances[I]||(this.indexedSymbolInstances[I]=[]),this.indexedSymbolInstances[I].push({crossTileID:_.crossTileID,coord:this.getScaledCoordinates(_,n)})}}getScaledCoordinates(n,c){let d=Ct/Math.pow(2,c.canonical.z-this.tileID.canonical.z);return{x:Math.floor((c.canonical.x*o.EXTENT+n.anchorX)*d),y:Math.floor((c.canonical.y*o.EXTENT+n.anchorY)*d)}}findMatches(n,c,d){let g=this.tileID.canonical.z<c.canonical.z?1:Math.pow(2,this.tileID.canonical.z-c.canonical.z);for(let _=0;_<n.length;_++){let I=n.get(_);if(I.crossTileID)continue;let M=this.indexedSymbolInstances[I.key];if(!M)continue;let E=this.getScaledCoordinates(I,c);for(let k of M)if(Math.abs(k.coord.x-E.x)<=g&&Math.abs(k.coord.y-E.y)<=g&&!d[k.crossTileID]){d[k.crossTileID]=!0,I.crossTileID=k.crossTileID;break}}}}class Yt{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Wt{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(n){let c=Math.round((n-this.lng)/360);if(c!==0)for(let d in this.indexes){let g=this.indexes[d],_={};for(let I in g){let M=g[I];M.tileID=M.tileID.unwrapTo(M.tileID.wrap+c),_[M.tileID.key]=M}this.indexes[d]=_}this.lng=n}addBucket(n,c,d){if(this.indexes[n.overscaledZ]&&this.indexes[n.overscaledZ][n.key]){if(this.indexes[n.overscaledZ][n.key].bucketInstanceId===c.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(n.overscaledZ,this.indexes[n.overscaledZ][n.key])}for(let _=0;_<c.symbolInstances.length;_++)c.symbolInstances.get(_).crossTileID=0;this.usedCrossTileIDs[n.overscaledZ]||(this.usedCrossTileIDs[n.overscaledZ]={});let g=this.usedCrossTileIDs[n.overscaledZ];for(let _ in this.indexes){let I=this.indexes[_];if(Number(_)>n.overscaledZ)for(let M in I){let E=I[M];E.tileID.isChildOf(n)&&E.findMatches(c.symbolInstances,n,g)}else{let M=I[n.scaledTo(Number(_)).key];M&&M.findMatches(c.symbolInstances,n,g)}}for(let _=0;_<c.symbolInstances.length;_++){let I=c.symbolInstances.get(_);I.crossTileID||(I.crossTileID=d.generate(),g[I.crossTileID]=!0)}return this.indexes[n.overscaledZ]===void 0&&(this.indexes[n.overscaledZ]={}),this.indexes[n.overscaledZ][n.key]=new oi(n,c.symbolInstances,c.bucketInstanceId),!0}removeBucketCrossTileIDs(n,c){for(let d in c.indexedSymbolInstances)for(let g of c.indexedSymbolInstances[d])delete this.usedCrossTileIDs[n][g.crossTileID]}removeStaleBuckets(n){let c=!1;for(let d in this.indexes){let g=this.indexes[d];for(let _ in g)n[g[_].bucketInstanceId]||(this.removeBucketCrossTileIDs(d,g[_]),delete g[_],c=!0)}return c}}class Nt{constructor(){this.layerIndexes={},this.crossTileIDs=new Yt,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(n,c,d){let g=this.layerIndexes[n.id];g===void 0&&(g=this.layerIndexes[n.id]=new Wt);let _=!1,I={};g.handleWrapJump(d);for(let M of c){let E=M.getBucket(n);E&&n.id===E.layerIds[0]&&(E.bucketInstanceId||(E.bucketInstanceId=++this.maxBucketInstanceId),g.addBucket(M.tileID,E,this.crossTileIDs)&&(_=!0),I[E.bucketInstanceId]=!0)}return g.removeStaleBuckets(I)&&(_=!0),_}pruneUnusedLayers(n){let c={};n.forEach(d=>{c[d]=!0});for(let d in this.layerIndexes)c[d]||delete this.layerIndexes[d]}}let Dt=(f,n)=>o.emitValidationErrors(f,n&&n.filter(c=>c.identifier!=="source.canvas")),cr=o.pick(K,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),nr=o.pick(K,["setCenter","setZoom","setBearing","setPitch"]),Rr=function(){let f={},n=o.spec.$version;for(let c in o.spec.$root){let d=o.spec.$root[c];if(d.required){let g=null;g=c==="version"?n:d.type==="array"?[]:{},g!=null&&(f[c]=g)}}return f}();class Fr extends o.Evented{constructor(n,c={}){super(),this.map=n,this.dispatcher=new Gt(V(),this),this.imageManager=new te,this.imageManager.setEventedParent(this),this.glyphManager=new Be(n._requestManager,c.localIdeographFontFamily),this.lineAtlas=new Tt(256,512),this.crossTileSymbolIndex=new Nt,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new o.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",o.getReferrer());let d=this;this._rtlTextPluginCallback=Fr.registerForPluginStateChange(g=>{d.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:g.pluginStatus,pluginURL:g.pluginURL},(_,I)=>{if(o.triggerPluginCompletionEvent(_),I&&I.every(M=>M))for(let M in d.sourceCaches)d.sourceCaches[M].reload()})}),this.on("data",g=>{if(g.dataType!=="source"||g.sourceDataType!=="metadata")return;let _=this.sourceCaches[g.sourceId];if(!_)return;let I=_.getSource();if(I&&I.vectorLayerIds)for(let M in this._layers){let E=this._layers[M];E.source===I.id&&this._validateLayer(E)}})}loadURL(n,c={}){this.fire(new o.Event("dataloading",{dataType:"style"}));let d=typeof c.validate!="boolean"||c.validate,g=this.map._requestManager.transformRequest(n,o.ResourceType.Style);this._request=o.getJSON(g,(_,I)=>{this._request=null,_?this.fire(new o.ErrorEvent(_)):I&&this._load(I,d)})}loadJSON(n,c={}){this.fire(new o.Event("dataloading",{dataType:"style"})),this._request=o.exported.frame(()=>{this._request=null,this._load(n,c.validate!==!1)})}loadEmpty(){this.fire(new o.Event("dataloading",{dataType:"style"})),this._load(Rr,!1)}_load(n,c){if(c&&Dt(this,o.validateStyle(n)))return;this._loaded=!0,this.stylesheet=n;for(let g in n.sources)this.addSource(g,n.sources[g],{validate:!1});n.sprite?this._loadSprite(n.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(n.glyphs);let d=U(this.stylesheet.layers);this._order=d.map(g=>g.id),this._layers={},this._serializedLayers={};for(let g of d)g=o.createStyleLayer(g),g.setEventedParent(this,{layer:{id:g.id}}),this._layers[g.id]=g,this._serializedLayers[g.id]=g.serialize();this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new ht(this.stylesheet.light),this.fire(new o.Event("data",{dataType:"style"})),this.fire(new o.Event("style.load"))}_loadSprite(n){this._spriteRequest=function(c,d,g,_){let I,M,E,k=g>1?"@2x":"",D=o.getJSON(d.transformRequest(d.normalizeSpriteURL(c,k,".json"),o.ResourceType.SpriteJSON),(oe,$)=>{D=null,E||(E=oe,I=$,X())}),O=o.getImage(d.transformRequest(d.normalizeSpriteURL(c,k,".png"),o.ResourceType.SpriteImage),(oe,$)=>{O=null,E||(E=oe,M=$,X())});function X(){if(E)_(E);else if(I&&M){let oe=o.exported.getImageData(M),$={};for(let ne in I){let{width:me,height:ge,x:we,y:xe,sdf:Ne,pixelRatio:Pe,stretchX:ze,stretchY:je,content:Ke}=I[ne],De=new o.RGBAImage({width:me,height:ge});o.RGBAImage.copy(oe,De,{x:we,y:xe},{x:0,y:0},{width:me,height:ge}),$[ne]={data:De,pixelRatio:Pe,sdf:Ne,stretchX:ze,stretchY:je,content:Ke}}_(null,$)}}return{cancel(){D&&(D.cancel(),D=null),O&&(O.cancel(),O=null)}}}(n,this.map._requestManager,this.map.getPixelRatio(),(c,d)=>{if(this._spriteRequest=null,c)this.fire(new o.ErrorEvent(c));else if(d)for(let g in d)this.imageManager.addImage(g,d[g]);this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new o.Event("data",{dataType:"style"}))})}_validateLayer(n){let c=this.sourceCaches[n.source];if(!c)return;let d=n.sourceLayer;if(!d)return;let g=c.getSource();(g.type==="geojson"||g.vectorLayerIds&&g.vectorLayerIds.indexOf(d)===-1)&&this.fire(new o.ErrorEvent(new Error(`Source layer "${d}" does not exist on source "${g.id}" as specified by style layer "${n.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(let n in this.sourceCaches)if(!this.sourceCaches[n].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeLayers(n){let c=[];for(let d of n){let g=this._layers[d];g.type!=="custom"&&c.push(g.serialize())}return c}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;for(let n in this.sourceCaches)if(this.sourceCaches[n].hasTransition())return!0;for(let n in this._layers)if(this._layers[n].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(n){if(!this._loaded)return;let c=this._changed;if(this._changed){let g=Object.keys(this._updatedLayers),_=Object.keys(this._removedLayers);(g.length||_.length)&&this._updateWorkerLayers(g,_);for(let I in this._updatedSources){let M=this._updatedSources[I];M==="reload"?this._reloadSource(I):M==="clear"&&this._clearSource(I)}this._updateTilesForChangedImages();for(let I in this._updatedPaintProps)this._layers[I].updateTransitions(n);this.light.updateTransitions(n),this._resetUpdates()}let d={};for(let g in this.sourceCaches){let _=this.sourceCaches[g];d[g]=_.used,_.used=!1}for(let g of this._order){let _=this._layers[g];_.recalculate(n,this._availableImages),!_.isHidden(n.zoom)&&_.source&&(this.sourceCaches[_.source].used=!0)}for(let g in d){let _=this.sourceCaches[g];d[g]!==_.used&&_.fire(new o.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:g}))}this.light.recalculate(n),this.z=n.zoom,c&&this.fire(new o.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){let n=Object.keys(this._changedImages);if(n.length){for(let c in this.sourceCaches)this.sourceCaches[c].reloadTilesForDependencies(["icons","patterns"],n);this._changedImages={}}}_updateWorkerLayers(n,c){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(n),removedIds:c})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}}setState(n){if(this._checkLoaded(),Dt(this,o.validateStyle(n)))return!1;(n=o.clone$1(n)).layers=U(n.layers);let c=function(g,_){if(!g)return[{command:K.setStyle,args:[_]}];let I=[];try{if(!C(g.version,_.version))return[{command:K.setStyle,args:[_]}];C(g.center,_.center)||I.push({command:K.setCenter,args:[_.center]}),C(g.zoom,_.zoom)||I.push({command:K.setZoom,args:[_.zoom]}),C(g.bearing,_.bearing)||I.push({command:K.setBearing,args:[_.bearing]}),C(g.pitch,_.pitch)||I.push({command:K.setPitch,args:[_.pitch]}),C(g.sprite,_.sprite)||I.push({command:K.setSprite,args:[_.sprite]}),C(g.glyphs,_.glyphs)||I.push({command:K.setGlyphs,args:[_.glyphs]}),C(g.transition,_.transition)||I.push({command:K.setTransition,args:[_.transition]}),C(g.light,_.light)||I.push({command:K.setLight,args:[_.light]});let M={},E=[];(function(D,O,X,oe){let $;for($ in O=O||{},D=D||{})Object.prototype.hasOwnProperty.call(D,$)&&(Object.prototype.hasOwnProperty.call(O,$)||Se($,X,oe));for($ in O)Object.prototype.hasOwnProperty.call(O,$)&&(Object.prototype.hasOwnProperty.call(D,$)?C(D[$],O[$])||(D[$].type==="geojson"&&O[$].type==="geojson"&&He(D,O,$)?X.push({command:K.setGeoJSONSourceData,args:[$,O[$].data]}):Ve($,O,X,oe)):he($,O,X))})(g.sources,_.sources,E,M);let k=[];g.layers&&g.layers.forEach(D=>{M[D.source]?I.push({command:K.removeLayer,args:[D.id]}):k.push(D)}),I=I.concat(E),function(D,O,X){O=O||[];let oe=(D=D||[]).map(Re),$=O.map(Re),ne=D.reduce(ie,{}),me=O.reduce(ie,{}),ge=oe.slice(),we=Object.create(null),xe,Ne,Pe,ze,je,Ke,De;for(xe=0,Ne=0;xe<oe.length;xe++)Pe=oe[xe],Object.prototype.hasOwnProperty.call(me,Pe)?Ne++:(X.push({command:K.removeLayer,args:[Pe]}),ge.splice(ge.indexOf(Pe,Ne),1));for(xe=0,Ne=0;xe<$.length;xe++)Pe=$[$.length-1-xe],ge[ge.length-1-xe]!==Pe&&(Object.prototype.hasOwnProperty.call(ne,Pe)?(X.push({command:K.removeLayer,args:[Pe]}),ge.splice(ge.lastIndexOf(Pe,ge.length-Ne),1)):Ne++,Ke=ge[ge.length-xe],X.push({command:K.addLayer,args:[me[Pe],Ke]}),ge.splice(ge.length-xe,0,Pe),we[Pe]=!0);for(xe=0;xe<$.length;xe++)if(Pe=$[xe],ze=ne[Pe],je=me[Pe],!we[Pe]&&!C(ze,je))if(C(ze.source,je.source)&&C(ze["source-layer"],je["source-layer"])&&C(ze.type,je.type)){for(De in ye(ze.layout,je.layout,X,Pe,null,K.setLayoutProperty),ye(ze.paint,je.paint,X,Pe,null,K.setPaintProperty),C(ze.filter,je.filter)||X.push({command:K.setFilter,args:[Pe,je.filter]}),C(ze.minzoom,je.minzoom)&&C(ze.maxzoom,je.maxzoom)||X.push({command:K.setLayerZoomRange,args:[Pe,je.minzoom,je.maxzoom]}),ze)Object.prototype.hasOwnProperty.call(ze,De)&&De!=="layout"&&De!=="paint"&&De!=="filter"&&De!=="metadata"&&De!=="minzoom"&&De!=="maxzoom"&&(De.indexOf("paint.")===0?ye(ze[De],je[De],X,Pe,De.slice(6),K.setPaintProperty):C(ze[De],je[De])||X.push({command:K.setLayerProperty,args:[Pe,De,je[De]]}));for(De in je)Object.prototype.hasOwnProperty.call(je,De)&&!Object.prototype.hasOwnProperty.call(ze,De)&&De!=="layout"&&De!=="paint"&&De!=="filter"&&De!=="metadata"&&De!=="minzoom"&&De!=="maxzoom"&&(De.indexOf("paint.")===0?ye(ze[De],je[De],X,Pe,De.slice(6),K.setPaintProperty):C(ze[De],je[De])||X.push({command:K.setLayerProperty,args:[Pe,De,je[De]]}))}else X.push({command:K.removeLayer,args:[Pe]}),Ke=ge[ge.lastIndexOf(Pe)+1],X.push({command:K.addLayer,args:[je,Ke]})}(k,_.layers,I)}catch(M){console.warn("Unable to compute style diff:",M),I=[{command:K.setStyle,args:[_]}]}return I}(this.serialize(),n).filter(g=>!(g.command in nr));if(c.length===0)return!1;let d=c.filter(g=>!(g.command in cr));if(d.length>0)throw new Error(`Unimplemented: ${d.map(g=>g.command).join(", ")}.`);return c.forEach(g=>{g.command!=="setTransition"&&this[g.command].apply(this,g.args)}),this.stylesheet=n,!0}addImage(n,c){if(this.getImage(n))return this.fire(new o.ErrorEvent(new Error(`An image named "${n}" already exists.`)));this.imageManager.addImage(n,c),this._afterImageUpdated(n)}updateImage(n,c){this.imageManager.updateImage(n,c)}getImage(n){return this.imageManager.getImage(n)}removeImage(n){if(!this.getImage(n))return this.fire(new o.ErrorEvent(new Error(`An image named "${n}" does not exist.`)));this.imageManager.removeImage(n),this._afterImageUpdated(n)}_afterImageUpdated(n){this._availableImages=this.imageManager.listImages(),this._changedImages[n]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new o.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(n,c,d={}){if(this._checkLoaded(),this.sourceCaches[n]!==void 0)throw new Error(`Source "${n}" already exists.`);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(o.validateStyle.source,`sources.${n}`,c,null,d))return;this.map&&this.map._collectResourceTiming&&(c.collectResourceTiming=!0);let g=this.sourceCaches[n]=new ri(n,c,this.dispatcher);g.style=this,g.setEventedParent(this,()=>({isSourceLoaded:this.loaded(),source:g.serialize(),sourceId:n})),g.onAdd(this.map),this._changed=!0}removeSource(n){if(this._checkLoaded(),this.sourceCaches[n]===void 0)throw new Error("There is no source with this ID");for(let d in this._layers)if(this._layers[d].source===n)return this.fire(new o.ErrorEvent(new Error(`Source "${n}" cannot be removed while layer "${d}" is using it.`)));let c=this.sourceCaches[n];delete this.sourceCaches[n],delete this._updatedSources[n],c.fire(new o.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:n})),c.setEventedParent(null),c.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(n,c){this._checkLoaded(),this.sourceCaches[n].getSource().setData(c),this._changed=!0}getSource(n){return this.sourceCaches[n]&&this.sourceCaches[n].getSource()}addLayer(n,c,d={}){this._checkLoaded();let g=n.id;if(this.getLayer(g))return void this.fire(new o.ErrorEvent(new Error(`Layer "${g}" already exists on this map.`)));let _;if(n.type==="custom"){if(Dt(this,o.validateCustomStyleLayer(n)))return;_=o.createStyleLayer(n)}else{if(typeof n.source=="object"&&(this.addSource(g,n.source),n=o.clone$1(n),n=o.extend(n,{source:g})),this._validate(o.validateStyle.layer,`layers.${g}`,n,{arrayIndex:-1},d))return;_=o.createStyleLayer(n),this._validateLayer(_),_.setEventedParent(this,{layer:{id:g}}),this._serializedLayers[_.id]=_.serialize()}let I=c?this._order.indexOf(c):this._order.length;if(c&&I===-1)this.fire(new o.ErrorEvent(new Error(`Cannot add layer "${g}" before non-existing layer "${c}".`)));else{if(this._order.splice(I,0,g),this._layerOrderChanged=!0,this._layers[g]=_,this._removedLayers[g]&&_.source&&_.type!=="custom"){let M=this._removedLayers[g];delete this._removedLayers[g],M.type!==_.type?this._updatedSources[_.source]="clear":(this._updatedSources[_.source]="reload",this.sourceCaches[_.source].pause())}this._updateLayer(_),_.onAdd&&_.onAdd(this.map)}}moveLayer(n,c){if(this._checkLoaded(),this._changed=!0,!this._layers[n])return void this.fire(new o.ErrorEvent(new Error(`The layer '${n}' does not exist in the map's style and cannot be moved.`)));if(n===c)return;let d=this._order.indexOf(n);this._order.splice(d,1);let g=c?this._order.indexOf(c):this._order.length;c&&g===-1?this.fire(new o.ErrorEvent(new Error(`Cannot move layer "${n}" before non-existing layer "${c}".`))):(this._order.splice(g,0,n),this._layerOrderChanged=!0)}removeLayer(n){this._checkLoaded();let c=this._layers[n];if(!c)return void this.fire(new o.ErrorEvent(new Error(`Cannot remove non-existing layer "${n}".`)));c.setEventedParent(null);let d=this._order.indexOf(n);this._order.splice(d,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[n]=c,delete this._layers[n],delete this._serializedLayers[n],delete this._updatedLayers[n],delete this._updatedPaintProps[n],c.onRemove&&c.onRemove(this.map)}getLayer(n){return this._layers[n]}hasLayer(n){return n in this._layers}setLayerZoomRange(n,c,d){this._checkLoaded();let g=this.getLayer(n);g?g.minzoom===c&&g.maxzoom===d||(c!=null&&(g.minzoom=c),d!=null&&(g.maxzoom=d),this._updateLayer(g)):this.fire(new o.ErrorEvent(new Error(`Cannot set the zoom range of non-existing layer "${n}".`)))}setFilter(n,c,d={}){this._checkLoaded();let g=this.getLayer(n);if(g){if(!C(g.filter,c))return c==null?(g.filter=void 0,void this._updateLayer(g)):void(this._validate(o.validateStyle.filter,`layers.${g.id}.filter`,c,null,d)||(g.filter=o.clone$1(c),this._updateLayer(g)))}else this.fire(new o.ErrorEvent(new Error(`Cannot filter non-existing layer "${n}".`)))}getFilter(n){return o.clone$1(this.getLayer(n).filter)}setLayoutProperty(n,c,d,g={}){this._checkLoaded();let _=this.getLayer(n);_?C(_.getLayoutProperty(c),d)||(_.setLayoutProperty(c,d,g),this._updateLayer(_)):this.fire(new o.ErrorEvent(new Error(`Cannot style non-existing layer "${n}".`)))}getLayoutProperty(n,c){let d=this.getLayer(n);if(d)return d.getLayoutProperty(c);this.fire(new o.ErrorEvent(new Error(`Cannot get style of non-existing layer "${n}".`)))}setPaintProperty(n,c,d,g={}){this._checkLoaded();let _=this.getLayer(n);_?C(_.getPaintProperty(c),d)||(_.setPaintProperty(c,d,g)&&this._updateLayer(_),this._changed=!0,this._updatedPaintProps[n]=!0):this.fire(new o.ErrorEvent(new Error(`Cannot style non-existing layer "${n}".`)))}getPaintProperty(n,c){return this.getLayer(n).getPaintProperty(c)}setFeatureState(n,c){this._checkLoaded();let d=n.source,g=n.sourceLayer,_=this.sourceCaches[d];if(_===void 0)return void this.fire(new o.ErrorEvent(new Error(`The source '${d}' does not exist in the map's style.`)));let I=_.getSource().type;I==="geojson"&&g?this.fire(new o.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):I!=="vector"||g?(n.id===void 0&&this.fire(new o.ErrorEvent(new Error("The feature id parameter must be provided."))),_.setFeatureState(g,n.id,c)):this.fire(new o.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(n,c){this._checkLoaded();let d=n.source,g=this.sourceCaches[d];if(g===void 0)return void this.fire(new o.ErrorEvent(new Error(`The source '${d}' does not exist in the map's style.`)));let _=g.getSource().type,I=_==="vector"?n.sourceLayer:void 0;_!=="vector"||I?c&&typeof n.id!="string"&&typeof n.id!="number"?this.fire(new o.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):g.removeFeatureState(I,n.id,c):this.fire(new o.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(n){this._checkLoaded();let c=n.source,d=n.sourceLayer,g=this.sourceCaches[c];if(g!==void 0)return g.getSource().type!=="vector"||d?(n.id===void 0&&this.fire(new o.ErrorEvent(new Error("The feature id parameter must be provided."))),g.getFeatureState(d,n.id)):void this.fire(new o.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new o.ErrorEvent(new Error(`The source '${c}' does not exist in the map's style.`)))}getTransition(){return o.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){return o.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,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,sources:o.mapObject(this.sourceCaches,n=>n.serialize()),layers:this._serializeLayers(this._order)},n=>n!==void 0)}_updateLayer(n){this._updatedLayers[n.id]=!0,n.source&&!this._updatedSources[n.source]&&this.sourceCaches[n.source].getSource().type!=="raster"&&(this._updatedSources[n.source]="reload",this.sourceCaches[n.source].pause()),this._changed=!0}_flattenAndSortRenderedFeatures(n){let c=I=>this._layers[I].type==="fill-extrusion",d={},g=[];for(let I=this._order.length-1;I>=0;I--){let M=this._order[I];if(c(M)){d[M]=I;for(let E of n){let k=E[M];if(k)for(let D of k)g.push(D)}}}g.sort((I,M)=>M.intersectionZ-I.intersectionZ);let _=[];for(let I=this._order.length-1;I>=0;I--){let M=this._order[I];if(c(M))for(let E=g.length-1;E>=0;E--){let k=g[E].feature;if(d[k.layer.id]<I)break;_.push(k),g.pop()}else for(let E of n){let k=E[M];if(k)for(let D of k)_.push(D.feature)}}return _}queryRenderedFeatures(n,c,d){c&&c.filter&&this._validate(o.validateStyle.filter,"queryRenderedFeatures.filter",c.filter,null,c);let g={};if(c&&c.layers){if(!Array.isArray(c.layers))return this.fire(new o.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(let I of c.layers){let M=this._layers[I];if(!M)return this.fire(new o.ErrorEvent(new Error(`The layer '${I}' does not exist in the map's style and cannot be queried for features.`))),[];g[M.source]=!0}}let _=[];c.availableImages=this._availableImages;for(let I in this.sourceCaches)c.layers&&!g[I]||_.push(Fi(this.sourceCaches[I],this._layers,this._serializedLayers,n,c,d));return this.placement&&_.push(function(I,M,E,k,D,O,X){let oe={},$=O.queryRenderedSymbols(k),ne=[];for(let me of Object.keys($).map(Number))ne.push(X[me]);ne.sort(Ji);for(let me of ne){let ge=me.featureIndex.lookupSymbolFeatures($[me.bucketInstanceId],M,me.bucketIndex,me.sourceLayerIndex,D.filter,D.layers,D.availableImages,I);for(let we in ge){let xe=oe[we]=oe[we]||[],Ne=ge[we];Ne.sort((Pe,ze)=>{let je=me.featureSortOrder;if(je){let Ke=je.indexOf(Pe.featureIndex);return je.indexOf(ze.featureIndex)-Ke}return ze.featureIndex-Pe.featureIndex});for(let Pe of Ne)xe.push(Pe)}}for(let me in oe)oe[me].forEach(ge=>{let we=ge.feature,xe=E[I[me].source].getFeatureState(we.layer["source-layer"],we.id);we.source=we.layer.source,we.layer["source-layer"]&&(we.sourceLayer=we.layer["source-layer"]),we.state=xe});return oe}(this._layers,this._serializedLayers,this.sourceCaches,n,c,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(_)}querySourceFeatures(n,c){c&&c.filter&&this._validate(o.validateStyle.filter,"querySourceFeatures.filter",c.filter,null,c);let d=this.sourceCaches[n];return d?function(g,_){let I=g.getRenderableIds().map(k=>g.getTileByID(k)),M=[],E={};for(let k=0;k<I.length;k++){let D=I[k],O=D.tileID.canonical.key;E[O]||(E[O]=!0,D.querySourceFeatures(M,_))}return M}(d,c):[]}addSourceType(n,c,d){return Fr.getSourceType(n)?d(new Error(`A source type called "${n}" already exists.`)):(Fr.setSourceType(n,c),c.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:n,url:c.workerSourceURL},d):d(null,null))}getLight(){return this.light.getLight()}setLight(n,c={}){this._checkLoaded();let d=this.light.getLight(),g=!1;for(let I in n)if(!C(n[I],d[I])){g=!0;break}if(!g)return;let _={now:o.exported.now(),transition:o.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(n,c),this.light.updateTransitions(_)}_validate(n,c,d,g,_={}){return(!_||_.validate!==!1)&&Dt(this,n.call(o.validateStyle,o.extend({key:c,style:this.serialize(),value:d,styleSpec:o.spec},g)))}_remove(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),o.evented.off("pluginStateChange",this._rtlTextPluginCallback);for(let n in this._layers)this._layers[n].setEventedParent(null);for(let n in this.sourceCaches){let c=this.sourceCaches[n];c.setEventedParent(null),c.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()}_clearSource(n){this.sourceCaches[n].clearTiles()}_reloadSource(n){this.sourceCaches[n].resume(),this.sourceCaches[n].reload()}_updateSources(n){for(let c in this.sourceCaches)this.sourceCaches[c].update(n)}_generateCollisionBoxes(){for(let n in this.sourceCaches)this._reloadSource(n)}_updatePlacement(n,c,d,g,_=!1){let I=!1,M=!1,E={};for(let k of this._order){let D=this._layers[k];if(D.type!=="symbol")continue;if(!E[D.source]){let X=this.sourceCaches[D.source];E[D.source]=X.getRenderableIds(!0).map(oe=>X.getTileByID(oe)).sort((oe,$)=>$.tileID.overscaledZ-oe.tileID.overscaledZ||(oe.tileID.isLessThan($.tileID)?-1:1))}let O=this.crossTileSymbolIndex.addLayer(D,E[D.source],n.center.lng);I=I||O}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((_=_||this._layerOrderChanged||d===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(o.exported.now(),n.zoom))&&(this.pauseablePlacement=new xt(n,this._order,_,c,d,g,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,E),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(o.exported.now()),M=!0),I&&this.pauseablePlacement.placement.setStale()),M||I)for(let k of this._order){let D=this._layers[k];D.type==="symbol"&&this.placement.updateLayerOpacities(D,E[D.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(o.exported.now())}_releaseSymbolFadeTiles(){for(let n in this.sourceCaches)this.sourceCaches[n].releaseSymbolFadeTiles()}getImages(n,c,d){this.imageManager.getImages(c.icons,d),this._updateTilesForChangedImages();let g=this.sourceCaches[c.source];g&&g.setDependencies(c.tileID.key,c.type,c.icons)}getGlyphs(n,c,d){this.glyphManager.getGlyphs(c.stacks,d)}getResource(n,c,d){return o.makeRequest(c,d)}}Fr.getSourceType=function(f){return Ei[f]},Fr.setSourceType=function(f,n){Ei[f]=n},Fr.registerForPluginStateChange=o.registerForPluginStateChange;var Wc=o.createLayout([{name:"a_pos",type:"Int16",components:2}]),Zc={prelude:Pi(`#ifdef GL_ES
|
|
11
|
-
precision mediump float;
|
|
12
|
-
#else
|
|
13
|
-
#if !defined(lowp)
|
|
14
|
-
#define lowp
|
|
15
|
-
#endif
|
|
16
|
-
#if !defined(mediump)
|
|
17
|
-
#define mediump
|
|
18
|
-
#endif
|
|
19
|
-
#if !defined(highp)
|
|
20
|
-
#define highp
|
|
21
|
-
#endif
|
|
22
|
-
#endif`,`#ifdef GL_ES
|
|
23
|
-
precision highp float;
|
|
24
|
-
#else
|
|
25
|
-
#if !defined(lowp)
|
|
26
|
-
#define lowp
|
|
27
|
-
#endif
|
|
28
|
-
#if !defined(mediump)
|
|
29
|
-
#define mediump
|
|
30
|
-
#endif
|
|
31
|
-
#if !defined(highp)
|
|
32
|
-
#define highp
|
|
33
|
-
#endif
|
|
34
|
-
#endif
|
|
35
|
-
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
|
|
36
|
-
);}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;}`),background:Pi(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;
|
|
37
|
-
#ifdef OVERDRAW_INSPECTOR
|
|
38
|
-
gl_FragColor=vec4(1.0);
|
|
39
|
-
#endif
|
|
40
|
-
}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:Pi(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;
|
|
41
|
-
#ifdef OVERDRAW_INSPECTOR
|
|
42
|
-
gl_FragColor=vec4(1.0);
|
|
43
|
-
#endif
|
|
44
|
-
}`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:Pi(`varying vec3 v_data;
|
|
45
|
-
#pragma mapbox: define highp vec4 color
|
|
46
|
-
#pragma mapbox: define mediump float radius
|
|
47
|
-
#pragma mapbox: define lowp float blur
|
|
48
|
-
#pragma mapbox: define lowp float opacity
|
|
49
|
-
#pragma mapbox: define highp vec4 stroke_color
|
|
50
|
-
#pragma mapbox: define mediump float stroke_width
|
|
51
|
-
#pragma mapbox: define lowp float stroke_opacity
|
|
52
|
-
void main() {
|
|
53
|
-
#pragma mapbox: initialize highp vec4 color
|
|
54
|
-
#pragma mapbox: initialize mediump float radius
|
|
55
|
-
#pragma mapbox: initialize lowp float blur
|
|
56
|
-
#pragma mapbox: initialize lowp float opacity
|
|
57
|
-
#pragma mapbox: initialize highp vec4 stroke_color
|
|
58
|
-
#pragma mapbox: initialize mediump float stroke_width
|
|
59
|
-
#pragma mapbox: initialize lowp float stroke_opacity
|
|
60
|
-
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));gl_FragColor=opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);
|
|
61
|
-
#ifdef OVERDRAW_INSPECTOR
|
|
62
|
-
gl_FragColor=vec4(1.0);
|
|
63
|
-
#endif
|
|
64
|
-
}`,`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;
|
|
65
|
-
#pragma mapbox: define highp vec4 color
|
|
66
|
-
#pragma mapbox: define mediump float radius
|
|
67
|
-
#pragma mapbox: define lowp float blur
|
|
68
|
-
#pragma mapbox: define lowp float opacity
|
|
69
|
-
#pragma mapbox: define highp vec4 stroke_color
|
|
70
|
-
#pragma mapbox: define mediump float stroke_width
|
|
71
|
-
#pragma mapbox: define lowp float stroke_opacity
|
|
72
|
-
void main(void) {
|
|
73
|
-
#pragma mapbox: initialize highp vec4 color
|
|
74
|
-
#pragma mapbox: initialize mediump float radius
|
|
75
|
-
#pragma mapbox: initialize lowp float blur
|
|
76
|
-
#pragma mapbox: initialize lowp float opacity
|
|
77
|
-
#pragma mapbox: initialize highp vec4 stroke_color
|
|
78
|
-
#pragma mapbox: initialize mediump float stroke_width
|
|
79
|
-
#pragma mapbox: initialize lowp float stroke_opacity
|
|
80
|
-
vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,0,1);} else {gl_Position=u_matrix*vec4(circle_center,0,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:Pi("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:Pi(`uniform highp float u_intensity;varying vec2 v_extrude;
|
|
81
|
-
#pragma mapbox: define highp float weight
|
|
82
|
-
#define GAUSS_COEF 0.3989422804014327
|
|
83
|
-
void main() {
|
|
84
|
-
#pragma mapbox: initialize highp float weight
|
|
85
|
-
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);
|
|
86
|
-
#ifdef OVERDRAW_INSPECTOR
|
|
87
|
-
gl_FragColor=vec4(1.0);
|
|
88
|
-
#endif
|
|
89
|
-
}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;
|
|
90
|
-
#pragma mapbox: define highp float weight
|
|
91
|
-
#pragma mapbox: define mediump float radius
|
|
92
|
-
const highp float ZERO=1.0/255.0/16.0;
|
|
93
|
-
#define GAUSS_COEF 0.3989422804014327
|
|
94
|
-
void main(void) {
|
|
95
|
-
#pragma mapbox: initialize highp float weight
|
|
96
|
-
#pragma mapbox: initialize mediump float radius
|
|
97
|
-
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;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}`),heatmapTexture:Pi(`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;
|
|
98
|
-
#ifdef OVERDRAW_INSPECTOR
|
|
99
|
-
gl_FragColor=vec4(0.0);
|
|
100
|
-
#endif
|
|
101
|
-
}`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:Pi("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;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_anchor_pos,0,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,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:Pi("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:Pi("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"),fill:Pi(`#pragma mapbox: define highp vec4 color
|
|
102
|
-
#pragma mapbox: define lowp float opacity
|
|
103
|
-
void main() {
|
|
104
|
-
#pragma mapbox: initialize highp vec4 color
|
|
105
|
-
#pragma mapbox: initialize lowp float opacity
|
|
106
|
-
gl_FragColor=color*opacity;
|
|
107
|
-
#ifdef OVERDRAW_INSPECTOR
|
|
108
|
-
gl_FragColor=vec4(1.0);
|
|
109
|
-
#endif
|
|
110
|
-
}`,`attribute vec2 a_pos;uniform mat4 u_matrix;
|
|
111
|
-
#pragma mapbox: define highp vec4 color
|
|
112
|
-
#pragma mapbox: define lowp float opacity
|
|
113
|
-
void main() {
|
|
114
|
-
#pragma mapbox: initialize highp vec4 color
|
|
115
|
-
#pragma mapbox: initialize lowp float opacity
|
|
116
|
-
gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:Pi(`varying vec2 v_pos;
|
|
117
|
-
#pragma mapbox: define highp vec4 outline_color
|
|
118
|
-
#pragma mapbox: define lowp float opacity
|
|
119
|
-
void main() {
|
|
120
|
-
#pragma mapbox: initialize highp vec4 outline_color
|
|
121
|
-
#pragma mapbox: initialize lowp float opacity
|
|
122
|
-
float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);
|
|
123
|
-
#ifdef OVERDRAW_INSPECTOR
|
|
124
|
-
gl_FragColor=vec4(1.0);
|
|
125
|
-
#endif
|
|
126
|
-
}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;
|
|
127
|
-
#pragma mapbox: define highp vec4 outline_color
|
|
128
|
-
#pragma mapbox: define lowp float opacity
|
|
129
|
-
void main() {
|
|
130
|
-
#pragma mapbox: initialize highp vec4 outline_color
|
|
131
|
-
#pragma mapbox: initialize lowp float opacity
|
|
132
|
-
gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:Pi(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;
|
|
133
|
-
#pragma mapbox: define lowp float opacity
|
|
134
|
-
#pragma mapbox: define lowp vec4 pattern_from
|
|
135
|
-
#pragma mapbox: define lowp vec4 pattern_to
|
|
136
|
-
void main() {
|
|
137
|
-
#pragma mapbox: initialize lowp float opacity
|
|
138
|
-
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
139
|
-
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
140
|
-
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;
|
|
141
|
-
#ifdef OVERDRAW_INSPECTOR
|
|
142
|
-
gl_FragColor=vec4(1.0);
|
|
143
|
-
#endif
|
|
144
|
-
}`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;
|
|
145
|
-
#pragma mapbox: define lowp float opacity
|
|
146
|
-
#pragma mapbox: define lowp vec4 pattern_from
|
|
147
|
-
#pragma mapbox: define lowp vec4 pattern_to
|
|
148
|
-
#pragma mapbox: define lowp float pixel_ratio_from
|
|
149
|
-
#pragma mapbox: define lowp float pixel_ratio_to
|
|
150
|
-
void main() {
|
|
151
|
-
#pragma mapbox: initialize lowp float opacity
|
|
152
|
-
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
153
|
-
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
154
|
-
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|
155
|
-
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
156
|
-
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillPattern:Pi(`#ifdef GL_ES
|
|
157
|
-
precision highp float;
|
|
158
|
-
#endif
|
|
159
|
-
uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;
|
|
160
|
-
#pragma mapbox: define lowp float opacity
|
|
161
|
-
#pragma mapbox: define lowp vec4 pattern_from
|
|
162
|
-
#pragma mapbox: define lowp vec4 pattern_to
|
|
163
|
-
void main() {
|
|
164
|
-
#pragma mapbox: initialize lowp float opacity
|
|
165
|
-
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
166
|
-
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
167
|
-
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;
|
|
168
|
-
#ifdef OVERDRAW_INSPECTOR
|
|
169
|
-
gl_FragColor=vec4(1.0);
|
|
170
|
-
#endif
|
|
171
|
-
}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;
|
|
172
|
-
#pragma mapbox: define lowp float opacity
|
|
173
|
-
#pragma mapbox: define lowp vec4 pattern_from
|
|
174
|
-
#pragma mapbox: define lowp vec4 pattern_to
|
|
175
|
-
#pragma mapbox: define lowp float pixel_ratio_from
|
|
176
|
-
#pragma mapbox: define lowp float pixel_ratio_to
|
|
177
|
-
void main() {
|
|
178
|
-
#pragma mapbox: initialize lowp float opacity
|
|
179
|
-
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
180
|
-
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
181
|
-
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|
182
|
-
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
183
|
-
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:Pi(`varying vec4 v_color;void main() {gl_FragColor=v_color;
|
|
184
|
-
#ifdef OVERDRAW_INSPECTOR
|
|
185
|
-
gl_FragColor=vec4(1.0);
|
|
186
|
-
#endif
|
|
187
|
-
}`,`uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;
|
|
188
|
-
#pragma mapbox: define highp float base
|
|
189
|
-
#pragma mapbox: define highp float height
|
|
190
|
-
#pragma mapbox: define highp vec4 color
|
|
191
|
-
void main() {
|
|
192
|
-
#pragma mapbox: initialize highp float base
|
|
193
|
-
#pragma mapbox: initialize highp float height
|
|
194
|
-
#pragma mapbox: initialize highp vec4 color
|
|
195
|
-
vec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:Pi(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;
|
|
196
|
-
#pragma mapbox: define lowp float base
|
|
197
|
-
#pragma mapbox: define lowp float height
|
|
198
|
-
#pragma mapbox: define lowp vec4 pattern_from
|
|
199
|
-
#pragma mapbox: define lowp vec4 pattern_to
|
|
200
|
-
#pragma mapbox: define lowp float pixel_ratio_from
|
|
201
|
-
#pragma mapbox: define lowp float pixel_ratio_to
|
|
202
|
-
void main() {
|
|
203
|
-
#pragma mapbox: initialize lowp float base
|
|
204
|
-
#pragma mapbox: initialize lowp float height
|
|
205
|
-
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
206
|
-
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
207
|
-
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|
208
|
-
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
209
|
-
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;
|
|
210
|
-
#ifdef OVERDRAW_INSPECTOR
|
|
211
|
-
gl_FragColor=vec4(1.0);
|
|
212
|
-
#endif
|
|
213
|
-
}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;
|
|
214
|
-
#pragma mapbox: define lowp float base
|
|
215
|
-
#pragma mapbox: define lowp float height
|
|
216
|
-
#pragma mapbox: define lowp vec4 pattern_from
|
|
217
|
-
#pragma mapbox: define lowp vec4 pattern_to
|
|
218
|
-
#pragma mapbox: define lowp float pixel_ratio_from
|
|
219
|
-
#pragma mapbox: define lowp float pixel_ratio_to
|
|
220
|
-
void main() {
|
|
221
|
-
#pragma mapbox: initialize lowp float base
|
|
222
|
-
#pragma mapbox: initialize lowp float height
|
|
223
|
-
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
224
|
-
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
225
|
-
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|
226
|
-
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
227
|
-
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0
|
|
228
|
-
? a_pos
|
|
229
|
-
: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),hillshadePrepare:Pi(`#ifdef GL_ES
|
|
230
|
-
precision highp float;
|
|
231
|
-
#endif
|
|
232
|
-
uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);
|
|
233
|
-
#ifdef OVERDRAW_INSPECTOR
|
|
234
|
-
gl_FragColor=vec4(1.0);
|
|
235
|
-
#endif
|
|
236
|
-
}`,"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:Pi(`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;
|
|
237
|
-
#define PI 3.141592653589793
|
|
238
|
-
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;
|
|
239
|
-
#ifdef OVERDRAW_INSPECTOR
|
|
240
|
-
gl_FragColor=vec4(1.0);
|
|
241
|
-
#endif
|
|
242
|
-
}`,"uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:Pi(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;
|
|
243
|
-
#pragma mapbox: define highp vec4 color
|
|
244
|
-
#pragma mapbox: define lowp float blur
|
|
245
|
-
#pragma mapbox: define lowp float opacity
|
|
246
|
-
void main() {
|
|
247
|
-
#pragma mapbox: initialize highp vec4 color
|
|
248
|
-
#pragma mapbox: initialize lowp float blur
|
|
249
|
-
#pragma mapbox: initialize lowp float opacity
|
|
250
|
-
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);gl_FragColor=color*(alpha*opacity);
|
|
251
|
-
#ifdef OVERDRAW_INSPECTOR
|
|
252
|
-
gl_FragColor=vec4(1.0);
|
|
253
|
-
#endif
|
|
254
|
-
}`,`
|
|
255
|
-
#define scale 0.015873016
|
|
256
|
-
attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;
|
|
257
|
-
#pragma mapbox: define highp vec4 color
|
|
258
|
-
#pragma mapbox: define lowp float blur
|
|
259
|
-
#pragma mapbox: define lowp float opacity
|
|
260
|
-
#pragma mapbox: define mediump float gapwidth
|
|
261
|
-
#pragma mapbox: define lowp float offset
|
|
262
|
-
#pragma mapbox: define mediump float width
|
|
263
|
-
void main() {
|
|
264
|
-
#pragma mapbox: initialize highp vec4 color
|
|
265
|
-
#pragma mapbox: initialize lowp float blur
|
|
266
|
-
#pragma mapbox: initialize lowp float opacity
|
|
267
|
-
#pragma mapbox: initialize mediump float gapwidth
|
|
268
|
-
#pragma mapbox: initialize lowp float offset
|
|
269
|
-
#pragma mapbox: initialize mediump float width
|
|
270
|
-
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;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;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;v_width2=vec2(outset,inset);}`),lineGradient:Pi(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;
|
|
271
|
-
#pragma mapbox: define lowp float blur
|
|
272
|
-
#pragma mapbox: define lowp float opacity
|
|
273
|
-
void main() {
|
|
274
|
-
#pragma mapbox: initialize lowp float blur
|
|
275
|
-
#pragma mapbox: initialize lowp float opacity
|
|
276
|
-
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);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);
|
|
277
|
-
#ifdef OVERDRAW_INSPECTOR
|
|
278
|
-
gl_FragColor=vec4(1.0);
|
|
279
|
-
#endif
|
|
280
|
-
}`,`
|
|
281
|
-
#define scale 0.015873016
|
|
282
|
-
attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;
|
|
283
|
-
#pragma mapbox: define lowp float blur
|
|
284
|
-
#pragma mapbox: define lowp float opacity
|
|
285
|
-
#pragma mapbox: define mediump float gapwidth
|
|
286
|
-
#pragma mapbox: define lowp float offset
|
|
287
|
-
#pragma mapbox: define mediump float width
|
|
288
|
-
void main() {
|
|
289
|
-
#pragma mapbox: initialize lowp float blur
|
|
290
|
-
#pragma mapbox: initialize lowp float opacity
|
|
291
|
-
#pragma mapbox: initialize mediump float gapwidth
|
|
292
|
-
#pragma mapbox: initialize lowp float offset
|
|
293
|
-
#pragma mapbox: initialize mediump float width
|
|
294
|
-
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;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;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;v_width2=vec2(outset,inset);}`),linePattern:Pi(`#ifdef GL_ES
|
|
295
|
-
precision highp float;
|
|
296
|
-
#endif
|
|
297
|
-
uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;
|
|
298
|
-
#pragma mapbox: define lowp vec4 pattern_from
|
|
299
|
-
#pragma mapbox: define lowp vec4 pattern_to
|
|
300
|
-
#pragma mapbox: define lowp float pixel_ratio_from
|
|
301
|
-
#pragma mapbox: define lowp float pixel_ratio_to
|
|
302
|
-
#pragma mapbox: define lowp float blur
|
|
303
|
-
#pragma mapbox: define lowp float opacity
|
|
304
|
-
void main() {
|
|
305
|
-
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
306
|
-
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
307
|
-
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|
308
|
-
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
309
|
-
#pragma mapbox: initialize lowp float blur
|
|
310
|
-
#pragma mapbox: initialize lowp float opacity
|
|
311
|
-
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;
|
|
312
|
-
#ifdef OVERDRAW_INSPECTOR
|
|
313
|
-
gl_FragColor=vec4(1.0);
|
|
314
|
-
#endif
|
|
315
|
-
}`,`
|
|
316
|
-
#define scale 0.015873016
|
|
317
|
-
#define LINE_DISTANCE_SCALE 2.0
|
|
318
|
-
attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;
|
|
319
|
-
#pragma mapbox: define lowp float blur
|
|
320
|
-
#pragma mapbox: define lowp float opacity
|
|
321
|
-
#pragma mapbox: define lowp float offset
|
|
322
|
-
#pragma mapbox: define mediump float gapwidth
|
|
323
|
-
#pragma mapbox: define mediump float width
|
|
324
|
-
#pragma mapbox: define lowp float floorwidth
|
|
325
|
-
#pragma mapbox: define lowp vec4 pattern_from
|
|
326
|
-
#pragma mapbox: define lowp vec4 pattern_to
|
|
327
|
-
#pragma mapbox: define lowp float pixel_ratio_from
|
|
328
|
-
#pragma mapbox: define lowp float pixel_ratio_to
|
|
329
|
-
void main() {
|
|
330
|
-
#pragma mapbox: initialize lowp float blur
|
|
331
|
-
#pragma mapbox: initialize lowp float opacity
|
|
332
|
-
#pragma mapbox: initialize lowp float offset
|
|
333
|
-
#pragma mapbox: initialize mediump float gapwidth
|
|
334
|
-
#pragma mapbox: initialize mediump float width
|
|
335
|
-
#pragma mapbox: initialize lowp float floorwidth
|
|
336
|
-
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
337
|
-
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
338
|
-
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|
339
|
-
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
340
|
-
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;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;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;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:Pi(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;
|
|
341
|
-
#pragma mapbox: define highp vec4 color
|
|
342
|
-
#pragma mapbox: define lowp float blur
|
|
343
|
-
#pragma mapbox: define lowp float opacity
|
|
344
|
-
#pragma mapbox: define mediump float width
|
|
345
|
-
#pragma mapbox: define lowp float floorwidth
|
|
346
|
-
void main() {
|
|
347
|
-
#pragma mapbox: initialize highp vec4 color
|
|
348
|
-
#pragma mapbox: initialize lowp float blur
|
|
349
|
-
#pragma mapbox: initialize lowp float opacity
|
|
350
|
-
#pragma mapbox: initialize mediump float width
|
|
351
|
-
#pragma mapbox: initialize lowp float floorwidth
|
|
352
|
-
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 sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);
|
|
353
|
-
#ifdef OVERDRAW_INSPECTOR
|
|
354
|
-
gl_FragColor=vec4(1.0);
|
|
355
|
-
#endif
|
|
356
|
-
}`,`
|
|
357
|
-
#define scale 0.015873016
|
|
358
|
-
#define LINE_DISTANCE_SCALE 2.0
|
|
359
|
-
attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;
|
|
360
|
-
#pragma mapbox: define highp vec4 color
|
|
361
|
-
#pragma mapbox: define lowp float blur
|
|
362
|
-
#pragma mapbox: define lowp float opacity
|
|
363
|
-
#pragma mapbox: define mediump float gapwidth
|
|
364
|
-
#pragma mapbox: define lowp float offset
|
|
365
|
-
#pragma mapbox: define mediump float width
|
|
366
|
-
#pragma mapbox: define lowp float floorwidth
|
|
367
|
-
void main() {
|
|
368
|
-
#pragma mapbox: initialize highp vec4 color
|
|
369
|
-
#pragma mapbox: initialize lowp float blur
|
|
370
|
-
#pragma mapbox: initialize lowp float opacity
|
|
371
|
-
#pragma mapbox: initialize mediump float gapwidth
|
|
372
|
-
#pragma mapbox: initialize lowp float offset
|
|
373
|
-
#pragma mapbox: initialize mediump float width
|
|
374
|
-
#pragma mapbox: initialize lowp float floorwidth
|
|
375
|
-
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;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;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;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),raster:Pi(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);
|
|
376
|
-
#ifdef OVERDRAW_INSPECTOR
|
|
377
|
-
gl_FragColor=vec4(1.0);
|
|
378
|
-
#endif
|
|
379
|
-
}`,"uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:Pi(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;
|
|
380
|
-
#pragma mapbox: define lowp float opacity
|
|
381
|
-
void main() {
|
|
382
|
-
#pragma mapbox: initialize lowp float opacity
|
|
383
|
-
lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;
|
|
384
|
-
#ifdef OVERDRAW_INSPECTOR
|
|
385
|
-
gl_FragColor=vec4(1.0);
|
|
386
|
-
#endif
|
|
387
|
-
}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;
|
|
388
|
-
#pragma mapbox: define lowp float opacity
|
|
389
|
-
void main() {
|
|
390
|
-
#pragma mapbox: initialize lowp float opacity
|
|
391
|
-
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
|
|
392
|
-
camera_to_anchor_distance/u_camera_to_center_distance :
|
|
393
|
-
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);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(1.0,fade_opacity[0]+fade_change));}`),symbolSDF:Pi(`#define SDF_PX 8.0
|
|
394
|
-
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;
|
|
395
|
-
#pragma mapbox: define highp vec4 fill_color
|
|
396
|
-
#pragma mapbox: define highp vec4 halo_color
|
|
397
|
-
#pragma mapbox: define lowp float opacity
|
|
398
|
-
#pragma mapbox: define lowp float halo_width
|
|
399
|
-
#pragma mapbox: define lowp float halo_blur
|
|
400
|
-
void main() {
|
|
401
|
-
#pragma mapbox: initialize highp vec4 fill_color
|
|
402
|
-
#pragma mapbox: initialize highp vec4 halo_color
|
|
403
|
-
#pragma mapbox: initialize lowp float opacity
|
|
404
|
-
#pragma mapbox: initialize lowp float halo_width
|
|
405
|
-
#pragma mapbox: initialize lowp float halo_blur
|
|
406
|
-
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);
|
|
407
|
-
#ifdef OVERDRAW_INSPECTOR
|
|
408
|
-
gl_FragColor=vec4(1.0);
|
|
409
|
-
#endif
|
|
410
|
-
}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;
|
|
411
|
-
#pragma mapbox: define highp vec4 fill_color
|
|
412
|
-
#pragma mapbox: define highp vec4 halo_color
|
|
413
|
-
#pragma mapbox: define lowp float opacity
|
|
414
|
-
#pragma mapbox: define lowp float halo_width
|
|
415
|
-
#pragma mapbox: define lowp float halo_blur
|
|
416
|
-
void main() {
|
|
417
|
-
#pragma mapbox: initialize highp vec4 fill_color
|
|
418
|
-
#pragma mapbox: initialize highp vec4 halo_color
|
|
419
|
-
#pragma mapbox: initialize lowp float opacity
|
|
420
|
-
#pragma mapbox: initialize lowp float halo_width
|
|
421
|
-
#pragma mapbox: initialize lowp float halo_blur
|
|
422
|
-
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
|
|
423
|
-
camera_to_anchor_distance/u_camera_to_center_distance :
|
|
424
|
-
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);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(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:Pi(`#define SDF_PX 8.0
|
|
425
|
-
#define SDF 1.0
|
|
426
|
-
#define ICON 0.0
|
|
427
|
-
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;
|
|
428
|
-
#pragma mapbox: define highp vec4 fill_color
|
|
429
|
-
#pragma mapbox: define highp vec4 halo_color
|
|
430
|
-
#pragma mapbox: define lowp float opacity
|
|
431
|
-
#pragma mapbox: define lowp float halo_width
|
|
432
|
-
#pragma mapbox: define lowp float halo_blur
|
|
433
|
-
void main() {
|
|
434
|
-
#pragma mapbox: initialize highp vec4 fill_color
|
|
435
|
-
#pragma mapbox: initialize highp vec4 halo_color
|
|
436
|
-
#pragma mapbox: initialize lowp float opacity
|
|
437
|
-
#pragma mapbox: initialize lowp float halo_width
|
|
438
|
-
#pragma mapbox: initialize lowp float halo_blur
|
|
439
|
-
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;
|
|
440
|
-
#ifdef OVERDRAW_INSPECTOR
|
|
441
|
-
gl_FragColor=vec4(1.0);
|
|
442
|
-
#endif
|
|
443
|
-
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);
|
|
444
|
-
#ifdef OVERDRAW_INSPECTOR
|
|
445
|
-
gl_FragColor=vec4(1.0);
|
|
446
|
-
#endif
|
|
447
|
-
}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;
|
|
448
|
-
#pragma mapbox: define highp vec4 fill_color
|
|
449
|
-
#pragma mapbox: define highp vec4 halo_color
|
|
450
|
-
#pragma mapbox: define lowp float opacity
|
|
451
|
-
#pragma mapbox: define lowp float halo_width
|
|
452
|
-
#pragma mapbox: define lowp float halo_blur
|
|
453
|
-
void main() {
|
|
454
|
-
#pragma mapbox: initialize highp vec4 fill_color
|
|
455
|
-
#pragma mapbox: initialize highp vec4 halo_color
|
|
456
|
-
#pragma mapbox: initialize lowp float opacity
|
|
457
|
-
#pragma mapbox: initialize lowp float halo_width
|
|
458
|
-
#pragma mapbox: initialize lowp float halo_blur
|
|
459
|
-
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
|
|
460
|
-
camera_to_anchor_distance/u_camera_to_center_distance :
|
|
461
|
-
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);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(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`)};function Pi(f,n){let c=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,d=n.match(/attribute ([\w]+) ([\w]+)/g),g=f.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),_=n.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),I=_?_.concat(g):g,M={};return{fragmentSource:f=f.replace(c,(E,k,D,O,X)=>(M[X]=!0,k==="define"?`
|
|
462
|
-
#ifndef HAS_UNIFORM_u_${X}
|
|
463
|
-
varying ${D} ${O} ${X};
|
|
464
|
-
#else
|
|
465
|
-
uniform ${D} ${O} u_${X};
|
|
466
|
-
#endif
|
|
467
|
-
`:`
|
|
468
|
-
#ifdef HAS_UNIFORM_u_${X}
|
|
469
|
-
${D} ${O} ${X} = u_${X};
|
|
470
|
-
#endif
|
|
471
|
-
`)),vertexSource:n=n.replace(c,(E,k,D,O,X)=>{let oe=O==="float"?"vec2":"vec4",$=X.match(/color/)?"color":oe;return M[X]?k==="define"?`
|
|
472
|
-
#ifndef HAS_UNIFORM_u_${X}
|
|
473
|
-
uniform lowp float u_${X}_t;
|
|
474
|
-
attribute ${D} ${oe} a_${X};
|
|
475
|
-
varying ${D} ${O} ${X};
|
|
476
|
-
#else
|
|
477
|
-
uniform ${D} ${O} u_${X};
|
|
478
|
-
#endif
|
|
479
|
-
`:$==="vec4"?`
|
|
480
|
-
#ifndef HAS_UNIFORM_u_${X}
|
|
481
|
-
${X} = a_${X};
|
|
482
|
-
#else
|
|
483
|
-
${D} ${O} ${X} = u_${X};
|
|
484
|
-
#endif
|
|
485
|
-
`:`
|
|
486
|
-
#ifndef HAS_UNIFORM_u_${X}
|
|
487
|
-
${X} = unpack_mix_${$}(a_${X}, u_${X}_t);
|
|
488
|
-
#else
|
|
489
|
-
${D} ${O} ${X} = u_${X};
|
|
490
|
-
#endif
|
|
491
|
-
`:k==="define"?`
|
|
492
|
-
#ifndef HAS_UNIFORM_u_${X}
|
|
493
|
-
uniform lowp float u_${X}_t;
|
|
494
|
-
attribute ${D} ${oe} a_${X};
|
|
495
|
-
#else
|
|
496
|
-
uniform ${D} ${O} u_${X};
|
|
497
|
-
#endif
|
|
498
|
-
`:$==="vec4"?`
|
|
499
|
-
#ifndef HAS_UNIFORM_u_${X}
|
|
500
|
-
${D} ${O} ${X} = a_${X};
|
|
501
|
-
#else
|
|
502
|
-
${D} ${O} ${X} = u_${X};
|
|
503
|
-
#endif
|
|
504
|
-
`:`
|
|
505
|
-
#ifndef HAS_UNIFORM_u_${X}
|
|
506
|
-
${D} ${O} ${X} = unpack_mix_${$}(a_${X}, u_${X}_t);
|
|
507
|
-
#else
|
|
508
|
-
${D} ${O} ${X} = u_${X};
|
|
509
|
-
#endif
|
|
510
|
-
`}),staticAttributes:d,staticUniforms:I}}class Zg{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(n,c,d,g,_,I,M,E){this.context=n;let k=this.boundPaintVertexBuffers.length!==g.length;for(let D=0;!k&&D<g.length;D++)this.boundPaintVertexBuffers[D]!==g[D]&&(k=!0);n.extVertexArrayObject&&this.vao&&this.boundProgram===c&&this.boundLayoutVertexBuffer===d&&!k&&this.boundIndexBuffer===_&&this.boundVertexOffset===I&&this.boundDynamicVertexBuffer===M&&this.boundDynamicVertexBuffer2===E?(n.bindVertexArrayOES.set(this.vao),M&&M.bind(),_&&_.dynamicDraw&&_.bind(),E&&E.bind()):this.freshBind(c,d,g,_,I,M,E)}freshBind(n,c,d,g,_,I,M){let E,k=n.numAttributes,D=this.context,O=D.gl;if(D.extVertexArrayObject)this.vao&&this.destroy(),this.vao=D.extVertexArrayObject.createVertexArrayOES(),D.bindVertexArrayOES.set(this.vao),E=0,this.boundProgram=n,this.boundLayoutVertexBuffer=c,this.boundPaintVertexBuffers=d,this.boundIndexBuffer=g,this.boundVertexOffset=_,this.boundDynamicVertexBuffer=I,this.boundDynamicVertexBuffer2=M;else{E=D.currentNumAttributes||0;for(let X=k;X<E;X++)O.disableVertexAttribArray(X)}c.enableAttributes(O,n);for(let X of d)X.enableAttributes(O,n);I&&I.enableAttributes(O,n),M&&M.enableAttributes(O,n),c.bind(),c.setVertexAttribPointers(O,n,_);for(let X of d)X.bind(),X.setVertexAttribPointers(O,n,_);I&&(I.bind(),I.setVertexAttribPointers(O,n,_)),g&&g.bind(),M&&(M.bind(),M.setVertexAttribPointers(O,n,_)),D.currentNumAttributes=k}destroy(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)}}function jc(f){let n=[];for(let c=0;c<f.length;c++){if(f[c]===null)continue;let d=f[c].split(" ");n.push(d.pop())}return n}class jg{constructor(n,c,d,g,_,I){let M=n.gl;this.program=M.createProgram();let E=jc(d.staticAttributes),k=g?g.getBinderAttributes():[],D=E.concat(k),O=d.staticUniforms?jc(d.staticUniforms):[],X=g?g.getBinderUniforms():[],oe=O.concat(X),$=[];for(let Pe of oe)$.indexOf(Pe)<0&&$.push(Pe);let ne=g?g.defines():[];I&&ne.push("#define OVERDRAW_INSPECTOR;");let me=ne.concat(Zc.prelude.fragmentSource,d.fragmentSource).join(`
|
|
511
|
-
`),ge=ne.concat(Zc.prelude.vertexSource,d.vertexSource).join(`
|
|
512
|
-
`),we=M.createShader(M.FRAGMENT_SHADER);if(M.isContextLost())return void(this.failedToCreate=!0);M.shaderSource(we,me),M.compileShader(we),M.attachShader(this.program,we);let xe=M.createShader(M.VERTEX_SHADER);if(M.isContextLost())return void(this.failedToCreate=!0);M.shaderSource(xe,ge),M.compileShader(xe),M.attachShader(this.program,xe),this.attributes={};let Ne={};this.numAttributes=D.length;for(let Pe=0;Pe<this.numAttributes;Pe++)D[Pe]&&(M.bindAttribLocation(this.program,Pe,D[Pe]),this.attributes[D[Pe]]=Pe);M.linkProgram(this.program),M.deleteShader(xe),M.deleteShader(we);for(let Pe=0;Pe<$.length;Pe++){let ze=$[Pe];if(ze&&!Ne[ze]){let je=M.getUniformLocation(this.program,ze);je&&(Ne[ze]=je)}}this.fixedUniforms=_(n,Ne),this.binderUniforms=g?g.getUniforms(n,Ne):[]}draw(n,c,d,g,_,I,M,E,k,D,O,X,oe,$,ne,me){let ge=n.gl;if(this.failedToCreate)return;n.program.set(this.program),n.setDepthMode(d),n.setStencilMode(g),n.setColorMode(_),n.setCullFace(I);for(let xe in this.fixedUniforms)this.fixedUniforms[xe].set(M[xe]);$&&$.setUniforms(n,this.binderUniforms,X,{zoom:oe});let we={[ge.LINES]:2,[ge.TRIANGLES]:3,[ge.LINE_STRIP]:1}[c];for(let xe of O.get()){let Ne=xe.vaos||(xe.vaos={});(Ne[E]||(Ne[E]=new Zg)).bind(n,this,k,$?$.getPaintVertexBuffers():[],D,xe.vertexOffset,ne,me),ge.drawElements(c,xe.primitiveLength*we,ge.UNSIGNED_SHORT,xe.primitiveOffset*we*2)}}}function Hc(f,n,c){let d=1/Ti(c,1,n.transform.tileZoom),g=Math.pow(2,c.tileID.overscaledZ),_=c.tileSize*Math.pow(2,n.transform.tileZoom)/g,I=_*(c.tileID.canonical.x+c.tileID.wrap*g),M=_*c.tileID.canonical.y;return{u_image:0,u_texsize:c.imageAtlasTexture.size,u_scale:[d,f.fromScale,f.toScale],u_fade:f.t,u_pixel_coord_upper:[I>>16,M>>16],u_pixel_coord_lower:[65535&I,65535&M]}}let up=(f,n,c,d)=>{let g=n.style.light,_=g.properties.get("position"),I=[_.x,_.y,_.z],M=function(){var k=new o.ARRAY_TYPE(9);return o.ARRAY_TYPE!=Float32Array&&(k[1]=0,k[2]=0,k[3]=0,k[5]=0,k[6]=0,k[7]=0),k[0]=1,k[4]=1,k[8]=1,k}();g.properties.get("anchor")==="viewport"&&function(k,D){var O=Math.sin(D),X=Math.cos(D);k[0]=X,k[1]=O,k[2]=0,k[3]=-O,k[4]=X,k[5]=0,k[6]=0,k[7]=0,k[8]=1}(M,-n.transform.angle),function(k,D,O){var X=D[0],oe=D[1],$=D[2];k[0]=X*O[0]+oe*O[3]+$*O[6],k[1]=X*O[1]+oe*O[4]+$*O[7],k[2]=X*O[2]+oe*O[5]+$*O[8]}(I,I,M);let E=g.properties.get("color");return{u_matrix:f,u_lightpos:I,u_lightintensity:g.properties.get("intensity"),u_lightcolor:[E.r,E.g,E.b],u_vertical_gradient:+c,u_opacity:d}},Xc=(f,n,c,d,g,_,I)=>o.extend(up(f,n,c,d),Hc(_,n,I),{u_height_factor:-Math.pow(2,g.overscaledZ)/I.tileSize/8}),$c=f=>({u_matrix:f}),Yc=(f,n,c,d)=>o.extend($c(f),Hc(c,n,d)),cp=(f,n)=>({u_matrix:f,u_world:n}),hp=(f,n,c,d,g)=>o.extend(Yc(f,n,c,d),{u_world:g}),xs=(f,n,c,d)=>{let g=f.transform,_,I;if(d.paint.get("circle-pitch-alignment")==="map"){let M=Ti(c,1,g.zoom);_=!0,I=[M,M]}else _=!1,I=g.pixelsToGLUnits;return{u_camera_to_center_distance:g.cameraToCenterDistance,u_scale_with_map:+(d.paint.get("circle-pitch-scale")==="map"),u_matrix:f.translatePosMatrix(n.posMatrix,c,d.paint.get("circle-translate"),d.paint.get("circle-translate-anchor")),u_pitch_with_map:+_,u_device_pixel_ratio:f.pixelRatio,u_extrude_scale:I}},tu=(f,n,c)=>{let d=Ti(c,1,n.zoom),g=Math.pow(2,n.zoom-c.tileID.overscaledZ),_=c.tileID.overscaleFactor();return{u_matrix:f,u_camera_to_center_distance:n.cameraToCenterDistance,u_pixels_to_tile_units:d,u_extrude_scale:[n.pixelsToGLUnits[0]/(d*g),n.pixelsToGLUnits[1]/(d*g)],u_overscale_factor:_}},la=(f,n,c=1)=>({u_matrix:f,u_color:n,u_overlay:0,u_overlay_scale:c}),rl=f=>({u_matrix:f}),iu=(f,n,c,d)=>({u_matrix:f,u_extrude_scale:Ti(n,1,c),u_intensity:d});function ru(f,n){let c=Math.pow(2,n.canonical.z),d=n.canonical.y;return[new o.MercatorCoordinate(0,d/c).toLngLat().lat,new o.MercatorCoordinate(0,(d+1)/c).toLngLat().lat]}let nl=(f,n,c)=>{let d=f.transform;return{u_matrix:qc(f,n,c),u_ratio:1/Ti(n,1,d.zoom),u_device_pixel_ratio:f.pixelRatio,u_units_to_pixels:[1/d.pixelsToGLUnits[0],1/d.pixelsToGLUnits[1]]}},nu=(f,n,c,d)=>o.extend(nl(f,n,c),{u_image:0,u_image_height:d}),ol=(f,n,c,d)=>{let g=f.transform,_=sl(n,g);return{u_matrix:qc(f,n,c),u_texsize:n.imageAtlasTexture.size,u_ratio:1/Ti(n,1,g.zoom),u_device_pixel_ratio:f.pixelRatio,u_image:0,u_scale:[_,d.fromScale,d.toScale],u_fade:d.t,u_units_to_pixels:[1/g.pixelsToGLUnits[0],1/g.pixelsToGLUnits[1]]}},vr=(f,n,c,d,g)=>{let _=f.lineAtlas,I=sl(n,f.transform),M=c.layout.get("line-cap")==="round",E=_.getDash(d.from,M),k=_.getDash(d.to,M),D=E.width*g.fromScale,O=k.width*g.toScale;return o.extend(nl(f,n,c),{u_patternscale_a:[I/D,-E.height/2],u_patternscale_b:[I/O,-k.height/2],u_sdfgamma:_.width/(256*Math.min(D,O)*f.pixelRatio)/2,u_image:0,u_tex_y_a:E.y,u_tex_y_b:k.y,u_mix:g.t})};function sl(f,n){return 1/Ti(f,1,n.tileZoom)}function qc(f,n,c){return f.translatePosMatrix(n.tileID.posMatrix,n,c.paint.get("line-translate"),c.paint.get("line-translate-anchor"))}let dp=(f,n,c,d,g)=>{return{u_matrix:f,u_tl_parent:n,u_scale_parent:c,u_buffer_scale:1,u_fade_t:d.mix,u_opacity:d.opacity*g.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:g.paint.get("raster-brightness-min"),u_brightness_high:g.paint.get("raster-brightness-max"),u_saturation_factor:(I=g.paint.get("raster-saturation"),I>0?1-1/(1.001-I):-I),u_contrast_factor:(_=g.paint.get("raster-contrast"),_>0?1/(1-_):1+_),u_spin_weights:pp(g.paint.get("raster-hue-rotate"))};var _,I};function pp(f){f*=Math.PI/180;let n=Math.sin(f),c=Math.cos(f);return[(2*c+1)/3,(-Math.sqrt(3)*n-c+1)/3,(Math.sqrt(3)*n-c+1)/3]}let ou=(f,n,c,d,g,_,I,M,E,k)=>{let D=g.transform;return{u_is_size_zoom_constant:+(f==="constant"||f==="source"),u_is_size_feature_constant:+(f==="constant"||f==="camera"),u_size_t:n?n.uSizeT:0,u_size:n?n.uSize:0,u_camera_to_center_distance:D.cameraToCenterDistance,u_pitch:D.pitch/360*2*Math.PI,u_rotate_symbol:+c,u_aspect_ratio:D.width/D.height,u_fade_change:g.options.fadeDuration?g.symbolFadeChange:1,u_matrix:_,u_label_plane_matrix:I,u_coord_matrix:M,u_is_text:+E,u_pitch_with_map:+d,u_texsize:k,u_texture:0}},Jc=(f,n,c,d,g,_,I,M,E,k,D)=>{let O=g.transform;return o.extend(ou(f,n,c,d,g,_,I,M,E,k),{u_gamma_scale:d?Math.cos(O._pitch)*O.cameraToCenterDistance:1,u_device_pixel_ratio:g.pixelRatio,u_is_halo:+D})},Hg=(f,n,c,d,g,_,I,M,E,k)=>o.extend(Jc(f,n,c,d,g,_,I,M,!0,E,!0),{u_texsize_icon:k,u_texture_icon:1}),Xg=(f,n,c)=>({u_matrix:f,u_opacity:n,u_color:c}),Qc=(f,n,c,d,g,_)=>o.extend(function(I,M,E,k){let D=E.imageManager.getPattern(I.from.toString()),O=E.imageManager.getPattern(I.to.toString()),{width:X,height:oe}=E.imageManager.getPixelSize(),$=Math.pow(2,k.tileID.overscaledZ),ne=k.tileSize*Math.pow(2,E.transform.tileZoom)/$,me=ne*(k.tileID.canonical.x+k.tileID.wrap*$),ge=ne*k.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:D.tl,u_pattern_br_a:D.br,u_pattern_tl_b:O.tl,u_pattern_br_b:O.br,u_texsize:[X,oe],u_mix:M.t,u_pattern_size_a:D.displaySize,u_pattern_size_b:O.displaySize,u_scale_a:M.fromScale,u_scale_b:M.toScale,u_tile_units_to_pixels:1/Ti(k,1,E.transform.tileZoom),u_pixel_coord_upper:[me>>16,ge>>16],u_pixel_coord_lower:[65535&me,65535&ge]}}(d,_,c,g),{u_matrix:f,u_opacity:n}),Kc={fillExtrusion:(f,n)=>({u_matrix:new o.UniformMatrix4f(f,n.u_matrix),u_lightpos:new o.Uniform3f(f,n.u_lightpos),u_lightintensity:new o.Uniform1f(f,n.u_lightintensity),u_lightcolor:new o.Uniform3f(f,n.u_lightcolor),u_vertical_gradient:new o.Uniform1f(f,n.u_vertical_gradient),u_opacity:new o.Uniform1f(f,n.u_opacity)}),fillExtrusionPattern:(f,n)=>({u_matrix:new o.UniformMatrix4f(f,n.u_matrix),u_lightpos:new o.Uniform3f(f,n.u_lightpos),u_lightintensity:new o.Uniform1f(f,n.u_lightintensity),u_lightcolor:new o.Uniform3f(f,n.u_lightcolor),u_vertical_gradient:new o.Uniform1f(f,n.u_vertical_gradient),u_height_factor:new o.Uniform1f(f,n.u_height_factor),u_image:new o.Uniform1i(f,n.u_image),u_texsize:new o.Uniform2f(f,n.u_texsize),u_pixel_coord_upper:new o.Uniform2f(f,n.u_pixel_coord_upper),u_pixel_coord_lower:new o.Uniform2f(f,n.u_pixel_coord_lower),u_scale:new o.Uniform3f(f,n.u_scale),u_fade:new o.Uniform1f(f,n.u_fade),u_opacity:new o.Uniform1f(f,n.u_opacity)}),fill:(f,n)=>({u_matrix:new o.UniformMatrix4f(f,n.u_matrix)}),fillPattern:(f,n)=>({u_matrix:new o.UniformMatrix4f(f,n.u_matrix),u_image:new o.Uniform1i(f,n.u_image),u_texsize:new o.Uniform2f(f,n.u_texsize),u_pixel_coord_upper:new o.Uniform2f(f,n.u_pixel_coord_upper),u_pixel_coord_lower:new o.Uniform2f(f,n.u_pixel_coord_lower),u_scale:new o.Uniform3f(f,n.u_scale),u_fade:new o.Uniform1f(f,n.u_fade)}),fillOutline:(f,n)=>({u_matrix:new o.UniformMatrix4f(f,n.u_matrix),u_world:new o.Uniform2f(f,n.u_world)}),fillOutlinePattern:(f,n)=>({u_matrix:new o.UniformMatrix4f(f,n.u_matrix),u_world:new o.Uniform2f(f,n.u_world),u_image:new o.Uniform1i(f,n.u_image),u_texsize:new o.Uniform2f(f,n.u_texsize),u_pixel_coord_upper:new o.Uniform2f(f,n.u_pixel_coord_upper),u_pixel_coord_lower:new o.Uniform2f(f,n.u_pixel_coord_lower),u_scale:new o.Uniform3f(f,n.u_scale),u_fade:new o.Uniform1f(f,n.u_fade)}),circle:(f,n)=>({u_camera_to_center_distance:new o.Uniform1f(f,n.u_camera_to_center_distance),u_scale_with_map:new o.Uniform1i(f,n.u_scale_with_map),u_pitch_with_map:new o.Uniform1i(f,n.u_pitch_with_map),u_extrude_scale:new o.Uniform2f(f,n.u_extrude_scale),u_device_pixel_ratio:new o.Uniform1f(f,n.u_device_pixel_ratio),u_matrix:new o.UniformMatrix4f(f,n.u_matrix)}),collisionBox:(f,n)=>({u_matrix:new o.UniformMatrix4f(f,n.u_matrix),u_camera_to_center_distance:new o.Uniform1f(f,n.u_camera_to_center_distance),u_pixels_to_tile_units:new o.Uniform1f(f,n.u_pixels_to_tile_units),u_extrude_scale:new o.Uniform2f(f,n.u_extrude_scale),u_overscale_factor:new o.Uniform1f(f,n.u_overscale_factor)}),collisionCircle:(f,n)=>({u_matrix:new o.UniformMatrix4f(f,n.u_matrix),u_inv_matrix:new o.UniformMatrix4f(f,n.u_inv_matrix),u_camera_to_center_distance:new o.Uniform1f(f,n.u_camera_to_center_distance),u_viewport_size:new o.Uniform2f(f,n.u_viewport_size)}),debug:(f,n)=>({u_color:new o.UniformColor(f,n.u_color),u_matrix:new o.UniformMatrix4f(f,n.u_matrix),u_overlay:new o.Uniform1i(f,n.u_overlay),u_overlay_scale:new o.Uniform1f(f,n.u_overlay_scale)}),clippingMask:(f,n)=>({u_matrix:new o.UniformMatrix4f(f,n.u_matrix)}),heatmap:(f,n)=>({u_extrude_scale:new o.Uniform1f(f,n.u_extrude_scale),u_intensity:new o.Uniform1f(f,n.u_intensity),u_matrix:new o.UniformMatrix4f(f,n.u_matrix)}),heatmapTexture:(f,n)=>({u_matrix:new o.UniformMatrix4f(f,n.u_matrix),u_world:new o.Uniform2f(f,n.u_world),u_image:new o.Uniform1i(f,n.u_image),u_color_ramp:new o.Uniform1i(f,n.u_color_ramp),u_opacity:new o.Uniform1f(f,n.u_opacity)}),hillshade:(f,n)=>({u_matrix:new o.UniformMatrix4f(f,n.u_matrix),u_image:new o.Uniform1i(f,n.u_image),u_latrange:new o.Uniform2f(f,n.u_latrange),u_light:new o.Uniform2f(f,n.u_light),u_shadow:new o.UniformColor(f,n.u_shadow),u_highlight:new o.UniformColor(f,n.u_highlight),u_accent:new o.UniformColor(f,n.u_accent)}),hillshadePrepare:(f,n)=>({u_matrix:new o.UniformMatrix4f(f,n.u_matrix),u_image:new o.Uniform1i(f,n.u_image),u_dimension:new o.Uniform2f(f,n.u_dimension),u_zoom:new o.Uniform1f(f,n.u_zoom),u_unpack:new o.Uniform4f(f,n.u_unpack)}),line:(f,n)=>({u_matrix:new o.UniformMatrix4f(f,n.u_matrix),u_ratio:new o.Uniform1f(f,n.u_ratio),u_device_pixel_ratio:new o.Uniform1f(f,n.u_device_pixel_ratio),u_units_to_pixels:new o.Uniform2f(f,n.u_units_to_pixels)}),lineGradient:(f,n)=>({u_matrix:new o.UniformMatrix4f(f,n.u_matrix),u_ratio:new o.Uniform1f(f,n.u_ratio),u_device_pixel_ratio:new o.Uniform1f(f,n.u_device_pixel_ratio),u_units_to_pixels:new o.Uniform2f(f,n.u_units_to_pixels),u_image:new o.Uniform1i(f,n.u_image),u_image_height:new o.Uniform1f(f,n.u_image_height)}),linePattern:(f,n)=>({u_matrix:new o.UniformMatrix4f(f,n.u_matrix),u_texsize:new o.Uniform2f(f,n.u_texsize),u_ratio:new o.Uniform1f(f,n.u_ratio),u_device_pixel_ratio:new o.Uniform1f(f,n.u_device_pixel_ratio),u_image:new o.Uniform1i(f,n.u_image),u_units_to_pixels:new o.Uniform2f(f,n.u_units_to_pixels),u_scale:new o.Uniform3f(f,n.u_scale),u_fade:new o.Uniform1f(f,n.u_fade)}),lineSDF:(f,n)=>({u_matrix:new o.UniformMatrix4f(f,n.u_matrix),u_ratio:new o.Uniform1f(f,n.u_ratio),u_device_pixel_ratio:new o.Uniform1f(f,n.u_device_pixel_ratio),u_units_to_pixels:new o.Uniform2f(f,n.u_units_to_pixels),u_patternscale_a:new o.Uniform2f(f,n.u_patternscale_a),u_patternscale_b:new o.Uniform2f(f,n.u_patternscale_b),u_sdfgamma:new o.Uniform1f(f,n.u_sdfgamma),u_image:new o.Uniform1i(f,n.u_image),u_tex_y_a:new o.Uniform1f(f,n.u_tex_y_a),u_tex_y_b:new o.Uniform1f(f,n.u_tex_y_b),u_mix:new o.Uniform1f(f,n.u_mix)}),raster:(f,n)=>({u_matrix:new o.UniformMatrix4f(f,n.u_matrix),u_tl_parent:new o.Uniform2f(f,n.u_tl_parent),u_scale_parent:new o.Uniform1f(f,n.u_scale_parent),u_buffer_scale:new o.Uniform1f(f,n.u_buffer_scale),u_fade_t:new o.Uniform1f(f,n.u_fade_t),u_opacity:new o.Uniform1f(f,n.u_opacity),u_image0:new o.Uniform1i(f,n.u_image0),u_image1:new o.Uniform1i(f,n.u_image1),u_brightness_low:new o.Uniform1f(f,n.u_brightness_low),u_brightness_high:new o.Uniform1f(f,n.u_brightness_high),u_saturation_factor:new o.Uniform1f(f,n.u_saturation_factor),u_contrast_factor:new o.Uniform1f(f,n.u_contrast_factor),u_spin_weights:new o.Uniform3f(f,n.u_spin_weights)}),symbolIcon:(f,n)=>({u_is_size_zoom_constant:new o.Uniform1i(f,n.u_is_size_zoom_constant),u_is_size_feature_constant:new o.Uniform1i(f,n.u_is_size_feature_constant),u_size_t:new o.Uniform1f(f,n.u_size_t),u_size:new o.Uniform1f(f,n.u_size),u_camera_to_center_distance:new o.Uniform1f(f,n.u_camera_to_center_distance),u_pitch:new o.Uniform1f(f,n.u_pitch),u_rotate_symbol:new o.Uniform1i(f,n.u_rotate_symbol),u_aspect_ratio:new o.Uniform1f(f,n.u_aspect_ratio),u_fade_change:new o.Uniform1f(f,n.u_fade_change),u_matrix:new o.UniformMatrix4f(f,n.u_matrix),u_label_plane_matrix:new o.UniformMatrix4f(f,n.u_label_plane_matrix),u_coord_matrix:new o.UniformMatrix4f(f,n.u_coord_matrix),u_is_text:new o.Uniform1i(f,n.u_is_text),u_pitch_with_map:new o.Uniform1i(f,n.u_pitch_with_map),u_texsize:new o.Uniform2f(f,n.u_texsize),u_texture:new o.Uniform1i(f,n.u_texture)}),symbolSDF:(f,n)=>({u_is_size_zoom_constant:new o.Uniform1i(f,n.u_is_size_zoom_constant),u_is_size_feature_constant:new o.Uniform1i(f,n.u_is_size_feature_constant),u_size_t:new o.Uniform1f(f,n.u_size_t),u_size:new o.Uniform1f(f,n.u_size),u_camera_to_center_distance:new o.Uniform1f(f,n.u_camera_to_center_distance),u_pitch:new o.Uniform1f(f,n.u_pitch),u_rotate_symbol:new o.Uniform1i(f,n.u_rotate_symbol),u_aspect_ratio:new o.Uniform1f(f,n.u_aspect_ratio),u_fade_change:new o.Uniform1f(f,n.u_fade_change),u_matrix:new o.UniformMatrix4f(f,n.u_matrix),u_label_plane_matrix:new o.UniformMatrix4f(f,n.u_label_plane_matrix),u_coord_matrix:new o.UniformMatrix4f(f,n.u_coord_matrix),u_is_text:new o.Uniform1i(f,n.u_is_text),u_pitch_with_map:new o.Uniform1i(f,n.u_pitch_with_map),u_texsize:new o.Uniform2f(f,n.u_texsize),u_texture:new o.Uniform1i(f,n.u_texture),u_gamma_scale:new o.Uniform1f(f,n.u_gamma_scale),u_device_pixel_ratio:new o.Uniform1f(f,n.u_device_pixel_ratio),u_is_halo:new o.Uniform1i(f,n.u_is_halo)}),symbolTextAndIcon:(f,n)=>({u_is_size_zoom_constant:new o.Uniform1i(f,n.u_is_size_zoom_constant),u_is_size_feature_constant:new o.Uniform1i(f,n.u_is_size_feature_constant),u_size_t:new o.Uniform1f(f,n.u_size_t),u_size:new o.Uniform1f(f,n.u_size),u_camera_to_center_distance:new o.Uniform1f(f,n.u_camera_to_center_distance),u_pitch:new o.Uniform1f(f,n.u_pitch),u_rotate_symbol:new o.Uniform1i(f,n.u_rotate_symbol),u_aspect_ratio:new o.Uniform1f(f,n.u_aspect_ratio),u_fade_change:new o.Uniform1f(f,n.u_fade_change),u_matrix:new o.UniformMatrix4f(f,n.u_matrix),u_label_plane_matrix:new o.UniformMatrix4f(f,n.u_label_plane_matrix),u_coord_matrix:new o.UniformMatrix4f(f,n.u_coord_matrix),u_is_text:new o.Uniform1i(f,n.u_is_text),u_pitch_with_map:new o.Uniform1i(f,n.u_pitch_with_map),u_texsize:new o.Uniform2f(f,n.u_texsize),u_texsize_icon:new o.Uniform2f(f,n.u_texsize_icon),u_texture:new o.Uniform1i(f,n.u_texture),u_texture_icon:new o.Uniform1i(f,n.u_texture_icon),u_gamma_scale:new o.Uniform1f(f,n.u_gamma_scale),u_device_pixel_ratio:new o.Uniform1f(f,n.u_device_pixel_ratio),u_is_halo:new o.Uniform1i(f,n.u_is_halo)}),background:(f,n)=>({u_matrix:new o.UniformMatrix4f(f,n.u_matrix),u_opacity:new o.Uniform1f(f,n.u_opacity),u_color:new o.UniformColor(f,n.u_color)}),backgroundPattern:(f,n)=>({u_matrix:new o.UniformMatrix4f(f,n.u_matrix),u_opacity:new o.Uniform1f(f,n.u_opacity),u_image:new o.Uniform1i(f,n.u_image),u_pattern_tl_a:new o.Uniform2f(f,n.u_pattern_tl_a),u_pattern_br_a:new o.Uniform2f(f,n.u_pattern_br_a),u_pattern_tl_b:new o.Uniform2f(f,n.u_pattern_tl_b),u_pattern_br_b:new o.Uniform2f(f,n.u_pattern_br_b),u_texsize:new o.Uniform2f(f,n.u_texsize),u_mix:new o.Uniform1f(f,n.u_mix),u_pattern_size_a:new o.Uniform2f(f,n.u_pattern_size_a),u_pattern_size_b:new o.Uniform2f(f,n.u_pattern_size_b),u_scale_a:new o.Uniform1f(f,n.u_scale_a),u_scale_b:new o.Uniform1f(f,n.u_scale_b),u_pixel_coord_upper:new o.Uniform2f(f,n.u_pixel_coord_upper),u_pixel_coord_lower:new o.Uniform2f(f,n.u_pixel_coord_lower),u_tile_units_to_pixels:new o.Uniform1f(f,n.u_tile_units_to_pixels)})};class eh{constructor(n,c,d){this.context=n;let g=n.gl;this.buffer=g.createBuffer(),this.dynamicDraw=Boolean(d),this.context.unbindVAO(),n.bindElementBuffer.set(this.buffer),g.bufferData(g.ELEMENT_ARRAY_BUFFER,c.arrayBuffer,this.dynamicDraw?g.DYNAMIC_DRAW:g.STATIC_DRAW),this.dynamicDraw||delete c.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(n){let c=this.context.gl;this.context.unbindVAO(),this.bind(),c.bufferSubData(c.ELEMENT_ARRAY_BUFFER,0,n.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let th={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class fp{constructor(n,c,d,g){this.length=c.length,this.attributes=d,this.itemSize=c.bytesPerElement,this.dynamicDraw=g,this.context=n;let _=n.gl;this.buffer=_.createBuffer(),n.bindVertexBuffer.set(this.buffer),_.bufferData(_.ARRAY_BUFFER,c.arrayBuffer,this.dynamicDraw?_.DYNAMIC_DRAW:_.STATIC_DRAW),this.dynamicDraw||delete c.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(n){let c=this.context.gl;this.bind(),c.bufferSubData(c.ARRAY_BUFFER,0,n.arrayBuffer)}enableAttributes(n,c){for(let d=0;d<this.attributes.length;d++){let g=c.attributes[this.attributes[d].name];g!==void 0&&n.enableVertexAttribArray(g)}}setVertexAttribPointers(n,c,d){for(let g=0;g<this.attributes.length;g++){let _=this.attributes[g],I=c.attributes[_.name];I!==void 0&&n.vertexAttribPointer(I,_.components,n[th[_.type]],!1,this.itemSize,_.offset+this.itemSize*(d||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class pi{constructor(n){this.gl=n.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(n){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class $g extends pi{getDefault(){return o.Color.transparent}set(n){let c=this.current;(n.r!==c.r||n.g!==c.g||n.b!==c.b||n.a!==c.a||this.dirty)&&(this.gl.clearColor(n.r,n.g,n.b,n.a),this.current=n,this.dirty=!1)}}class al extends pi{getDefault(){return 1}set(n){(n!==this.current||this.dirty)&&(this.gl.clearDepth(n),this.current=n,this.dirty=!1)}}class ll extends pi{getDefault(){return 0}set(n){(n!==this.current||this.dirty)&&(this.gl.clearStencil(n),this.current=n,this.dirty=!1)}}class mp extends pi{getDefault(){return[!0,!0,!0,!0]}set(n){let c=this.current;(n[0]!==c[0]||n[1]!==c[1]||n[2]!==c[2]||n[3]!==c[3]||this.dirty)&&(this.gl.colorMask(n[0],n[1],n[2],n[3]),this.current=n,this.dirty=!1)}}class Mn extends pi{getDefault(){return!0}set(n){(n!==this.current||this.dirty)&&(this.gl.depthMask(n),this.current=n,this.dirty=!1)}}class ih extends pi{getDefault(){return 255}set(n){(n!==this.current||this.dirty)&&(this.gl.stencilMask(n),this.current=n,this.dirty=!1)}}class su extends pi{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(n){let c=this.current;(n.func!==c.func||n.ref!==c.ref||n.mask!==c.mask||this.dirty)&&(this.gl.stencilFunc(n.func,n.ref,n.mask),this.current=n,this.dirty=!1)}}class au extends pi{getDefault(){let n=this.gl;return[n.KEEP,n.KEEP,n.KEEP]}set(n){let c=this.current;(n[0]!==c[0]||n[1]!==c[1]||n[2]!==c[2]||this.dirty)&&(this.gl.stencilOp(n[0],n[1],n[2]),this.current=n,this.dirty=!1)}}class rh extends pi{getDefault(){return!1}set(n){if(n===this.current&&!this.dirty)return;let c=this.gl;n?c.enable(c.STENCIL_TEST):c.disable(c.STENCIL_TEST),this.current=n,this.dirty=!1}}class nh extends pi{getDefault(){return[0,1]}set(n){let c=this.current;(n[0]!==c[0]||n[1]!==c[1]||this.dirty)&&(this.gl.depthRange(n[0],n[1]),this.current=n,this.dirty=!1)}}class lu extends pi{getDefault(){return!1}set(n){if(n===this.current&&!this.dirty)return;let c=this.gl;n?c.enable(c.DEPTH_TEST):c.disable(c.DEPTH_TEST),this.current=n,this.dirty=!1}}class oh extends pi{getDefault(){return this.gl.LESS}set(n){(n!==this.current||this.dirty)&&(this.gl.depthFunc(n),this.current=n,this.dirty=!1)}}class sh extends pi{getDefault(){return!1}set(n){if(n===this.current&&!this.dirty)return;let c=this.gl;n?c.enable(c.BLEND):c.disable(c.BLEND),this.current=n,this.dirty=!1}}class uu extends pi{getDefault(){let n=this.gl;return[n.ONE,n.ZERO]}set(n){let c=this.current;(n[0]!==c[0]||n[1]!==c[1]||this.dirty)&&(this.gl.blendFunc(n[0],n[1]),this.current=n,this.dirty=!1)}}class gp extends pi{getDefault(){return o.Color.transparent}set(n){let c=this.current;(n.r!==c.r||n.g!==c.g||n.b!==c.b||n.a!==c.a||this.dirty)&&(this.gl.blendColor(n.r,n.g,n.b,n.a),this.current=n,this.dirty=!1)}}class yp extends pi{getDefault(){return this.gl.FUNC_ADD}set(n){(n!==this.current||this.dirty)&&(this.gl.blendEquation(n),this.current=n,this.dirty=!1)}}class ua extends pi{getDefault(){return!1}set(n){if(n===this.current&&!this.dirty)return;let c=this.gl;n?c.enable(c.CULL_FACE):c.disable(c.CULL_FACE),this.current=n,this.dirty=!1}}class Yg extends pi{getDefault(){return this.gl.BACK}set(n){(n!==this.current||this.dirty)&&(this.gl.cullFace(n),this.current=n,this.dirty=!1)}}class qg extends pi{getDefault(){return this.gl.CCW}set(n){(n!==this.current||this.dirty)&&(this.gl.frontFace(n),this.current=n,this.dirty=!1)}}class Jg extends pi{getDefault(){return null}set(n){(n!==this.current||this.dirty)&&(this.gl.useProgram(n),this.current=n,this.dirty=!1)}}class Qg extends pi{getDefault(){return this.gl.TEXTURE0}set(n){(n!==this.current||this.dirty)&&(this.gl.activeTexture(n),this.current=n,this.dirty=!1)}}class Kg extends pi{getDefault(){let n=this.gl;return[0,0,n.drawingBufferWidth,n.drawingBufferHeight]}set(n){let c=this.current;(n[0]!==c[0]||n[1]!==c[1]||n[2]!==c[2]||n[3]!==c[3]||this.dirty)&&(this.gl.viewport(n[0],n[1],n[2],n[3]),this.current=n,this.dirty=!1)}}class e0 extends pi{getDefault(){return null}set(n){if(n===this.current&&!this.dirty)return;let c=this.gl;c.bindFramebuffer(c.FRAMEBUFFER,n),this.current=n,this.dirty=!1}}class ah extends pi{getDefault(){return null}set(n){if(n===this.current&&!this.dirty)return;let c=this.gl;c.bindRenderbuffer(c.RENDERBUFFER,n),this.current=n,this.dirty=!1}}class lh extends pi{getDefault(){return null}set(n){if(n===this.current&&!this.dirty)return;let c=this.gl;c.bindTexture(c.TEXTURE_2D,n),this.current=n,this.dirty=!1}}class ca extends pi{getDefault(){return null}set(n){if(n===this.current&&!this.dirty)return;let c=this.gl;c.bindBuffer(c.ARRAY_BUFFER,n),this.current=n,this.dirty=!1}}class vp extends pi{getDefault(){return null}set(n){let c=this.gl;c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,n),this.current=n,this.dirty=!1}}class xp extends pi{constructor(n){super(n),this.vao=n.extVertexArrayObject}getDefault(){return null}set(n){this.vao&&(n!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(n),this.current=n,this.dirty=!1)}}class uh extends pi{getDefault(){return 4}set(n){if(n===this.current&&!this.dirty)return;let c=this.gl;c.pixelStorei(c.UNPACK_ALIGNMENT,n),this.current=n,this.dirty=!1}}class _s extends pi{getDefault(){return!1}set(n){if(n===this.current&&!this.dirty)return;let c=this.gl;c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n),this.current=n,this.dirty=!1}}class _p extends pi{getDefault(){return!1}set(n){if(n===this.current&&!this.dirty)return;let c=this.gl;c.pixelStorei(c.UNPACK_FLIP_Y_WEBGL,n),this.current=n,this.dirty=!1}}class bs extends pi{constructor(n,c){super(n),this.context=n,this.parent=c}getDefault(){return null}}class ha extends bs{setDirty(){this.dirty=!0}set(n){if(n===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let c=this.gl;c.framebufferTexture2D(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,c.TEXTURE_2D,n,0),this.current=n,this.dirty=!1}}class bp extends bs{set(n){if(n===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let c=this.gl;c.framebufferRenderbuffer(c.FRAMEBUFFER,c.DEPTH_ATTACHMENT,c.RENDERBUFFER,n),this.current=n,this.dirty=!1}}class ch{constructor(n,c,d,g){this.context=n,this.width=c,this.height=d;let _=this.framebuffer=n.gl.createFramebuffer();this.colorAttachment=new ha(n,_),g&&(this.depthAttachment=new bp(n,_))}destroy(){let n=this.context.gl,c=this.colorAttachment.get();if(c&&n.deleteTexture(c),this.depthAttachment){let d=this.depthAttachment.get();d&&n.deleteRenderbuffer(d)}n.deleteFramebuffer(this.framebuffer)}}class Rt{constructor(n,c,d){this.blendFunction=n,this.blendColor=c,this.mask=d}}Rt.Replace=[1,0],Rt.disabled=new Rt(Rt.Replace,o.Color.transparent,[!1,!1,!1,!1]),Rt.unblended=new Rt(Rt.Replace,o.Color.transparent,[!0,!0,!0,!0]),Rt.alphaBlended=new Rt([1,771],o.Color.transparent,[!0,!0,!0,!0]);class cu{constructor(n){this.gl=n,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new $g(this),this.clearDepth=new al(this),this.clearStencil=new ll(this),this.colorMask=new mp(this),this.depthMask=new Mn(this),this.stencilMask=new ih(this),this.stencilFunc=new su(this),this.stencilOp=new au(this),this.stencilTest=new rh(this),this.depthRange=new nh(this),this.depthTest=new lu(this),this.depthFunc=new oh(this),this.blend=new sh(this),this.blendFunc=new uu(this),this.blendColor=new gp(this),this.blendEquation=new yp(this),this.cullFace=new ua(this),this.cullFaceSide=new Yg(this),this.frontFace=new qg(this),this.program=new Jg(this),this.activeTexture=new Qg(this),this.viewport=new Kg(this),this.bindFramebuffer=new e0(this),this.bindRenderbuffer=new ah(this),this.bindTexture=new lh(this),this.bindVertexBuffer=new ca(this),this.bindElementBuffer=new vp(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new xp(this),this.pixelStoreUnpack=new uh(this),this.pixelStoreUnpackPremultiplyAlpha=new _s(this),this.pixelStoreUnpackFlipY=new _p(this),this.extTextureFilterAnisotropic=n.getExtension("EXT_texture_filter_anisotropic")||n.getExtension("MOZ_EXT_texture_filter_anisotropic")||n.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=n.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=n.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(n.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=n.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=n.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=n.getParameter(n.MAX_TEXTURE_SIZE)}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(n,c){return new eh(this,n,c)}createVertexBuffer(n,c,d){return new fp(this,n,c,d)}createRenderbuffer(n,c,d){let g=this.gl,_=g.createRenderbuffer();return this.bindRenderbuffer.set(_),g.renderbufferStorage(g.RENDERBUFFER,n,c,d),this.bindRenderbuffer.set(null),_}createFramebuffer(n,c,d){return new ch(this,n,c,d)}clear({color:n,depth:c}){let d=this.gl,g=0;n&&(g|=d.COLOR_BUFFER_BIT,this.clearColor.set(n),this.colorMask.set([!0,!0,!0,!0])),c!==void 0&&(g|=d.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(c),this.depthMask.set(!0)),d.clear(g)}setCullFace(n){n.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(n.mode),this.frontFace.set(n.frontFace))}setDepthMode(n){n.func!==this.gl.ALWAYS||n.mask?(this.depthTest.set(!0),this.depthFunc.set(n.func),this.depthMask.set(n.mask),this.depthRange.set(n.range)):this.depthTest.set(!1)}setStencilMode(n){n.test.func!==this.gl.ALWAYS||n.mask?(this.stencilTest.set(!0),this.stencilMask.set(n.mask),this.stencilOp.set([n.fail,n.depthFail,n.pass]),this.stencilFunc.set({func:n.test.func,ref:n.ref,mask:n.test.mask})):this.stencilTest.set(!1)}setColorMode(n){C(n.blendFunction,Rt.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(n.blendFunction),this.blendColor.set(n.blendColor)),this.colorMask.set(n.mask)}unbindVAO(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)}}class bi{constructor(n,c,d){this.func=n,this.mask=c,this.range=d}}bi.ReadOnly=!1,bi.ReadWrite=!0,bi.disabled=new bi(519,bi.ReadOnly,[0,1]);let hu=7680;class Vi{constructor(n,c,d,g,_,I){this.test=n,this.ref=c,this.mask=d,this.fail=g,this.depthFail=_,this.pass=I}}Vi.disabled=new Vi({func:519,mask:0},0,0,hu,hu,hu);class or{constructor(n,c,d){this.enable=n,this.mode=c,this.frontFace=d}}let du;function hh(f,n,c,d,g,_,I){let M=f.context,E=M.gl,k=f.useProgram("collisionBox"),D=[],O=0,X=0;for(let xe=0;xe<d.length;xe++){let Ne=d[xe],Pe=n.getTile(Ne),ze=Pe.getBucket(c);if(!ze)continue;let je=Ne.posMatrix;g[0]===0&&g[1]===0||(je=f.translatePosMatrix(Ne.posMatrix,Pe,g,_));let Ke=I?ze.textCollisionBox:ze.iconCollisionBox,De=ze.collisionCircleArray;if(De.length>0){let mt=o.create(),rt=je;o.mul(mt,ze.placementInvProjMatrix,f.transform.glCoordMatrix),o.mul(mt,mt,ze.placementViewportMatrix),D.push({circleArray:De,circleOffset:X,transform:rt,invTransform:mt}),O+=De.length/4,X=O}Ke&&k.draw(M,E.LINES,bi.disabled,Vi.disabled,f.colorModeForRenderPass(),or.disabled,tu(je,f.transform,Pe),c.id,Ke.layoutVertexBuffer,Ke.indexBuffer,Ke.segments,null,f.transform.zoom,null,null,Ke.collisionVertexBuffer)}if(!I||!D.length)return;let oe=f.useProgram("collisionCircle"),$=new o.CollisionCircleLayoutArray;$.resize(4*O),$._trim();let ne=0;for(let xe of D)for(let Ne=0;Ne<xe.circleArray.length/4;Ne++){let Pe=4*Ne,ze=xe.circleArray[Pe+0],je=xe.circleArray[Pe+1],Ke=xe.circleArray[Pe+2],De=xe.circleArray[Pe+3];$.emplace(ne++,ze,je,Ke,De,0),$.emplace(ne++,ze,je,Ke,De,1),$.emplace(ne++,ze,je,Ke,De,2),$.emplace(ne++,ze,je,Ke,De,3)}(!du||du.length<2*O)&&(du=function(xe){let Ne=2*xe,Pe=new o.QuadTriangleArray;Pe.resize(Ne),Pe._trim();for(let ze=0;ze<Ne;ze++){let je=6*ze;Pe.uint16[je+0]=4*ze+0,Pe.uint16[je+1]=4*ze+1,Pe.uint16[je+2]=4*ze+2,Pe.uint16[je+3]=4*ze+2,Pe.uint16[je+4]=4*ze+3,Pe.uint16[je+5]=4*ze+0}return Pe}(O));let me=M.createIndexBuffer(du,!0),ge=M.createVertexBuffer($,o.collisionCircleLayout.members,!0);for(let xe of D){let Ne={u_matrix:xe.transform,u_inv_matrix:xe.invTransform,u_camera_to_center_distance:(we=f.transform).cameraToCenterDistance,u_viewport_size:[we.width,we.height]};oe.draw(M,E.TRIANGLES,bi.disabled,Vi.disabled,f.colorModeForRenderPass(),or.disabled,Ne,c.id,ge,me,o.SegmentVector.simpleSegment(0,2*xe.circleOffset,xe.circleArray.length,xe.circleArray.length/2),null,f.transform.zoom,null,null,null)}var we;ge.destroy(),me.destroy()}or.disabled=new or(!1,1029,2305),or.backCCW=new or(!0,1029,2305);let t0=o.identity(new Float32Array(16));function dh(f,n,c,d,g,_){let{horizontalAlign:I,verticalAlign:M}=o.getAnchorAlignment(f),E=-(I-.5)*n,k=-(M-.5)*c,D=o.evaluateVariableOffset(f,d);return new o.pointGeometry((E/g+D[0])*_,(k/g+D[1])*_)}function pu(f,n,c,d,g,_,I,M,E,k){let D=f.text.placedSymbolArray,O=f.text.dynamicLayoutVertexArray,X=f.icon.dynamicLayoutVertexArray,oe={};O.clear();for(let $=0;$<D.length;$++){let ne=D.get($),me=f.allowVerticalPlacement&&!ne.placedOrientation,ge=ne.hidden||!ne.crossTileID||me?null:d[ne.crossTileID];if(ge){let we=new o.pointGeometry(ne.anchorX,ne.anchorY),xe=At(we,c?I:_),Ne=Ue(g.cameraToCenterDistance,xe.signedDistanceFromCamera),Pe=o.evaluateSizeForFeature(f.textSizeData,E,ne)*Ne/o.ONE_EM;c&&(Pe*=f.tilePixelRatio/M);let{width:ze,height:je,anchor:Ke,textOffset:De,textBoxScale:mt}=ge,rt=dh(Ke,ze,je,De,mt,Pe),Pt=c?At(we.add(rt),_).point:xe.point.add(n?rt.rotate(-g.angle):rt),ei=f.allowVerticalPlacement&&ne.placedOrientation===o.WritingMode.vertical?Math.PI/2:0;for(let Zt=0;Zt<ne.numGlyphs;Zt++)o.addDynamicAttributes(O,Pt,ei);k&&ne.associatedIconIndex>=0&&(oe[ne.associatedIconIndex]={shiftedAnchor:Pt,angle:ei})}else hi(ne.numGlyphs,O)}if(k){X.clear();let $=f.icon.placedSymbolArray;for(let ne=0;ne<$.length;ne++){let me=$.get(ne);if(me.hidden)hi(me.numGlyphs,X);else{let ge=oe[ne];if(ge)for(let we=0;we<me.numGlyphs;we++)o.addDynamicAttributes(X,ge.shiftedAnchor,ge.angle);else hi(me.numGlyphs,X)}}f.icon.dynamicLayoutVertexBuffer.updateData(X)}f.text.dynamicLayoutVertexBuffer.updateData(O)}function fu(f,n,c){return c.iconsInText&&n?"symbolTextAndIcon":f?"symbolSDF":"symbolIcon"}function mu(f,n,c,d,g,_,I,M,E,k,D,O){let X=f.context,oe=X.gl,$=f.transform,ne=M==="map",me=E==="map",ge=M!=="viewport"&&c.layout.get("symbol-placement")!=="point",we=ne&&!me&&!ge,xe=!c.layout.get("symbol-sort-key").isConstant(),Ne=!1,Pe=f.depthModeForSublayer(0,bi.ReadOnly),ze=c.layout.get("text-variable-anchor"),je=[];for(let Ke of d){let De=n.getTile(Ke),mt=De.getBucket(c);if(!mt)continue;let rt=g?mt.text:mt.icon;if(!rt||!rt.segments.get().length)continue;let Pt=rt.programConfigurations.get(c.id),ei=g||mt.sdfIcons,Zt=g?mt.textSizeData:mt.iconSizeData,Qt=me||$.pitch!==0,Qi=f.useProgram(fu(ei,g,mt),Pt),zt=o.evaluateSizeForZoom(Zt,$.zoom),ai,Si,Or,Tn,jn=[0,0],Hn=null;if(g){if(Si=De.glyphAtlasTexture,Or=oe.LINEAR,ai=De.glyphAtlasTexture.size,mt.iconsInText){jn=De.imageAtlasTexture.size,Hn=De.imageAtlasTexture;let wo=Zt.kind==="composite"||Zt.kind==="camera";Tn=Qt||f.options.rotating||f.options.zooming||wo?oe.LINEAR:oe.NEAREST}}else{let wo=c.layout.get("icon-size").constantOr(0)!==1||mt.iconsNeedLinear;Si=De.imageAtlasTexture,Or=ei||f.options.rotating||f.options.zooming||wo||Qt?oe.LINEAR:oe.NEAREST,ai=De.imageAtlasTexture.size}let is=Ti(De,1,f.transform.zoom),mn=ut(Ke.posMatrix,me,ne,f.transform,is),bo=Xt(Ke.posMatrix,me,ne,f.transform,is),Es=ze&&mt.hasTextData(),An=c.layout.get("icon-text-fit")!=="none"&&Es&&mt.hasIconData();if(ge){let wo=c.layout.get("text-rotation-alignment")==="map";yt(mt,Ke.posMatrix,f,g,mn,bo,me,k,wo)}let li=f.translatePosMatrix(Ke.posMatrix,De,_,I),yi=ge||g&&ze||An?t0:mn,xr=f.translatePosMatrix(bo,De,_,I,!0),nn=ei&&c.paint.get(g?"text-halo-width":"icon-halo-width").constantOr(1)!==0,Wi;Wi=ei?mt.iconsInText?Hg(Zt.kind,zt,we,me,f,li,yi,xr,ai,jn):Jc(Zt.kind,zt,we,me,f,li,yi,xr,g,ai,!0):ou(Zt.kind,zt,we,me,f,li,yi,xr,g,ai);let Ts={program:Qi,buffers:rt,uniformValues:Wi,atlasTexture:Si,atlasTextureIcon:Hn,atlasInterpolation:Or,atlasInterpolationIcon:Tn,isSDF:ei,hasHalo:nn};if(xe&&mt.canOverlap){Ne=!0;let wo=rt.segments.get();for(let Tu of wo)je.push({segments:new o.SegmentVector([Tu]),sortKey:Tu.sortKey,state:Ts})}else je.push({segments:rt.segments,sortKey:0,state:Ts})}Ne&&je.sort((Ke,De)=>Ke.sortKey-De.sortKey);for(let Ke of je){let De=Ke.state;if(X.activeTexture.set(oe.TEXTURE0),De.atlasTexture.bind(De.atlasInterpolation,oe.CLAMP_TO_EDGE),De.atlasTextureIcon&&(X.activeTexture.set(oe.TEXTURE1),De.atlasTextureIcon&&De.atlasTextureIcon.bind(De.atlasInterpolationIcon,oe.CLAMP_TO_EDGE)),De.isSDF){let mt=De.uniformValues;De.hasHalo&&(mt.u_is_halo=1,gu(De.buffers,Ke.segments,c,f,De.program,Pe,D,O,mt)),mt.u_is_halo=0}gu(De.buffers,Ke.segments,c,f,De.program,Pe,D,O,De.uniformValues)}}function gu(f,n,c,d,g,_,I,M,E){let k=d.context;g.draw(k,k.gl.TRIANGLES,_,I,M,or.disabled,E,c.id,f.layoutVertexBuffer,f.indexBuffer,n,c.paint,d.transform.zoom,f.programConfigurations.get(c.id),f.dynamicLayoutVertexBuffer,f.opacityVertexBuffer)}function ph(f,n,c,d,g,_,I){let M=f.context.gl,E=c.paint.get("fill-pattern"),k=E&&E.constantOr(1),D=c.getCrossfadeParameters(),O,X,oe,$,ne;I?(X=k&&!c.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",O=M.LINES):(X=k?"fillPattern":"fill",O=M.TRIANGLES);for(let me of d){let ge=n.getTile(me);if(k&&!ge.patternsLoaded())continue;let we=ge.getBucket(c);if(!we)continue;let xe=we.programConfigurations.get(c.id),Ne=f.useProgram(X,xe);k&&(f.context.activeTexture.set(M.TEXTURE0),ge.imageAtlasTexture.bind(M.LINEAR,M.CLAMP_TO_EDGE),xe.updatePaintBuffers(D));let Pe=E.constantOr(null);if(Pe&&ge.imageAtlas){let je=ge.imageAtlas,Ke=je.patternPositions[Pe.to.toString()],De=je.patternPositions[Pe.from.toString()];Ke&&De&&xe.setConstantPatternPositions(Ke,De)}let ze=f.translatePosMatrix(me.posMatrix,ge,c.paint.get("fill-translate"),c.paint.get("fill-translate-anchor"));if(I){$=we.indexBuffer2,ne=we.segments2;let je=[M.drawingBufferWidth,M.drawingBufferHeight];oe=X==="fillOutlinePattern"&&k?hp(ze,f,D,ge,je):cp(ze,je)}else $=we.indexBuffer,ne=we.segments,oe=k?Yc(ze,f,D,ge):$c(ze);Ne.draw(f.context,O,g,f.stencilModeForClipping(me),_,or.disabled,oe,c.id,we.layoutVertexBuffer,$,ne,c.paint,f.transform.zoom,xe)}}function da(f,n,c,d,g,_,I){let M=f.context,E=M.gl,k=c.paint.get("fill-extrusion-pattern"),D=k.constantOr(1),O=c.getCrossfadeParameters(),X=c.paint.get("fill-extrusion-opacity");for(let oe of d){let $=n.getTile(oe),ne=$.getBucket(c);if(!ne)continue;let me=ne.programConfigurations.get(c.id),ge=f.useProgram(D?"fillExtrusionPattern":"fillExtrusion",me);D&&(f.context.activeTexture.set(E.TEXTURE0),$.imageAtlasTexture.bind(E.LINEAR,E.CLAMP_TO_EDGE),me.updatePaintBuffers(O));let we=k.constantOr(null);if(we&&$.imageAtlas){let ze=$.imageAtlas,je=ze.patternPositions[we.to.toString()],Ke=ze.patternPositions[we.from.toString()];je&&Ke&&me.setConstantPatternPositions(je,Ke)}let xe=f.translatePosMatrix(oe.posMatrix,$,c.paint.get("fill-extrusion-translate"),c.paint.get("fill-extrusion-translate-anchor")),Ne=c.paint.get("fill-extrusion-vertical-gradient"),Pe=D?Xc(xe,f,Ne,X,oe,O,$):up(xe,f,Ne,X);ge.draw(M,M.gl.TRIANGLES,g,_,I,or.backCCW,Pe,c.id,ne.layoutVertexBuffer,ne.indexBuffer,ne.segments,c.paint,f.transform.zoom,me)}}function yu(f,n,c,d,g,_){let I=f.context,M=I.gl,E=n.fbo;if(!E)return;let k=f.useProgram("hillshade");I.activeTexture.set(M.TEXTURE0),M.bindTexture(M.TEXTURE_2D,E.colorAttachment.get());let D=((O,X,oe)=>{let $=oe.paint.get("hillshade-shadow-color"),ne=oe.paint.get("hillshade-highlight-color"),me=oe.paint.get("hillshade-accent-color"),ge=oe.paint.get("hillshade-illumination-direction")*(Math.PI/180);oe.paint.get("hillshade-illumination-anchor")==="viewport"&&(ge-=O.transform.angle);let we=!O.options.moving;return{u_matrix:O.transform.calculatePosMatrix(X.tileID.toUnwrapped(),we),u_image:0,u_latrange:ru(0,X.tileID),u_light:[oe.paint.get("hillshade-exaggeration"),ge],u_shadow:$,u_highlight:ne,u_accent:me}})(f,n,c);k.draw(I,M.TRIANGLES,d,g,_,or.disabled,D,c.id,f.rasterBoundsBuffer,f.quadTriangleIndexBuffer,f.rasterBoundsSegments)}function so(f,n,c,d,g,_){let I=f.context,M=I.gl,E=n.dem;if(E&&E.data){let k=E.dim,D=E.stride,O=E.getPixels();if(I.activeTexture.set(M.TEXTURE1),I.pixelStoreUnpackPremultiplyAlpha.set(!1),n.demTexture=n.demTexture||f.getTileTexture(D),n.demTexture){let oe=n.demTexture;oe.update(O,{premultiply:!1}),oe.bind(M.NEAREST,M.CLAMP_TO_EDGE)}else n.demTexture=new H(I,O,M.RGBA,{premultiply:!1}),n.demTexture.bind(M.NEAREST,M.CLAMP_TO_EDGE);I.activeTexture.set(M.TEXTURE0);let X=n.fbo;if(!X){let oe=new H(I,{width:k,height:k,data:null},M.RGBA);oe.bind(M.LINEAR,M.CLAMP_TO_EDGE),X=n.fbo=I.createFramebuffer(k,k,!0),X.colorAttachment.set(oe.texture)}I.bindFramebuffer.set(X.framebuffer),I.viewport.set([0,0,k,k]),f.useProgram("hillshadePrepare").draw(I,M.TRIANGLES,d,g,_,or.disabled,((oe,$)=>{let ne=$.stride,me=o.create();return o.ortho(me,0,o.EXTENT,-o.EXTENT,0,0,1),o.translate(me,me,[0,-o.EXTENT,0]),{u_matrix:me,u_image:1,u_dimension:[ne,ne],u_zoom:oe.overscaledZ,u_unpack:$.getUnpackVector()}})(n.tileID,E),c.id,f.rasterBoundsBuffer,f.quadTriangleIndexBuffer,f.rasterBoundsSegments),n.needsHillshadePrepare=!1}}function wp(f,n,c,d,g){let _=d.paint.get("raster-fade-duration");if(_>0){let I=o.exported.now(),M=(I-f.timeAdded)/_,E=n?(I-n.timeAdded)/_:-1,k=c.getSource(),D=g.coveringZoomLevel({tileSize:k.tileSize,roundZoom:k.roundZoom}),O=!n||Math.abs(n.tileID.overscaledZ-D)>Math.abs(f.tileID.overscaledZ-D),X=O&&f.refreshedUponExpiration?1:o.clamp(O?M:1-E,0,1);return f.refreshedUponExpiration&&M>=1&&(f.refreshedUponExpiration=!1),n?{opacity:1,mix:1-X}:{opacity:X,mix:0}}return{opacity:1,mix:0}}let Ip=new o.Color(1,0,0,1),Sp=new o.Color(0,1,0,1),pa=new o.Color(0,0,1,1),vu=new o.Color(1,0,1,1),fh=new o.Color(0,1,1,1);function Cp(f,n,c,d){_u(f,0,n+c/2,f.transform.width,c,d)}function xu(f,n,c,d){_u(f,n-c/2,0,c,f.transform.height,d)}function _u(f,n,c,d,g,_){let I=f.context,M=I.gl;M.enable(M.SCISSOR_TEST),M.scissor(n*f.pixelRatio,c*f.pixelRatio,d*f.pixelRatio,g*f.pixelRatio),I.clear({color:_}),M.disable(M.SCISSOR_TEST)}function Mp(f,n,c){let d=f.context,g=d.gl,_=c.posMatrix,I=f.useProgram("debug"),M=bi.disabled,E=Vi.disabled,k=f.colorModeForRenderPass(),D="$debug";d.activeTexture.set(g.TEXTURE0),f.emptyTexture.bind(g.LINEAR,g.CLAMP_TO_EDGE),I.draw(d,g.LINE_STRIP,M,E,k,or.disabled,la(_,o.Color.red),D,f.debugBuffer,f.tileBorderIndexBuffer,f.debugSegments);let O=n.getTileByID(c.key).latestRawTileData,X=Math.floor((O&&O.byteLength||0)/1024),oe=n.getTile(c).tileSize,$=512/Math.min(oe,512)*(c.overscaledZ/f.transform.zoom)*.5,ne=c.canonical.toString();c.overscaledZ!==c.canonical.z&&(ne+=` => ${c.overscaledZ}`),function(me,ge){me.initDebugOverlayCanvas();let we=me.debugOverlayCanvas,xe=me.context.gl,Ne=me.debugOverlayCanvas.getContext("2d");Ne.clearRect(0,0,we.width,we.height),Ne.shadowColor="white",Ne.shadowBlur=2,Ne.lineWidth=1.5,Ne.strokeStyle="white",Ne.textBaseline="top",Ne.font="bold 36px Open Sans, sans-serif",Ne.fillText(ge,5,5),Ne.strokeText(ge,5,5),me.debugOverlayTexture.update(we),me.debugOverlayTexture.bind(xe.LINEAR,xe.CLAMP_TO_EDGE)}(f,`${ne} ${X}kb`),I.draw(d,g.TRIANGLES,M,E,Rt.alphaBlended,or.disabled,la(_,o.Color.transparent,$),D,f.debugBuffer,f.quadTriangleIndexBuffer,f.debugSegments)}let ul={symbol:function(f,n,c,d,g){if(f.renderPass!=="translucent")return;let _=Vi.disabled,I=f.colorModeForRenderPass();c.layout.get("text-variable-anchor")&&function(M,E,k,D,O,X,oe){let $=E.transform,ne=O==="map",me=X==="map";for(let ge of M){let we=D.getTile(ge),xe=we.getBucket(k);if(!xe||!xe.text||!xe.text.segments.get().length)continue;let Ne=o.evaluateSizeForZoom(xe.textSizeData,$.zoom),Pe=Ti(we,1,E.transform.zoom),ze=ut(ge.posMatrix,me,ne,E.transform,Pe),je=k.layout.get("icon-text-fit")!=="none"&&xe.hasIconData();if(Ne){let Ke=Math.pow(2,$.zoom-we.tileID.overscaledZ);pu(xe,ne,me,oe,$,ze,ge.posMatrix,Ke,Ne,je)}}}(d,f,c,n,c.layout.get("text-rotation-alignment"),c.layout.get("text-pitch-alignment"),g),c.paint.get("icon-opacity").constantOr(1)!==0&&mu(f,n,c,d,!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"),_,I),c.paint.get("text-opacity").constantOr(1)!==0&&mu(f,n,c,d,!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"),_,I),n.map.showCollisionBoxes&&(hh(f,n,c,d,c.paint.get("text-translate"),c.paint.get("text-translate-anchor"),!0),hh(f,n,c,d,c.paint.get("icon-translate"),c.paint.get("icon-translate-anchor"),!1))},circle:function(f,n,c,d){if(f.renderPass!=="translucent")return;let g=c.paint.get("circle-opacity"),_=c.paint.get("circle-stroke-width"),I=c.paint.get("circle-stroke-opacity"),M=!c.layout.get("circle-sort-key").isConstant();if(g.constantOr(1)===0&&(_.constantOr(1)===0||I.constantOr(1)===0))return;let E=f.context,k=E.gl,D=f.depthModeForSublayer(0,bi.ReadOnly),O=Vi.disabled,X=f.colorModeForRenderPass(),oe=[];for(let $=0;$<d.length;$++){let ne=d[$],me=n.getTile(ne),ge=me.getBucket(c);if(!ge)continue;let we=ge.programConfigurations.get(c.id),xe={programConfiguration:we,program:f.useProgram("circle",we),layoutVertexBuffer:ge.layoutVertexBuffer,indexBuffer:ge.indexBuffer,uniformValues:xs(f,ne,me,c)};if(M){let Ne=ge.segments.get();for(let Pe of Ne)oe.push({segments:new o.SegmentVector([Pe]),sortKey:Pe.sortKey,state:xe})}else oe.push({segments:ge.segments,sortKey:0,state:xe})}M&&oe.sort(($,ne)=>$.sortKey-ne.sortKey);for(let $ of oe){let{programConfiguration:ne,program:me,layoutVertexBuffer:ge,indexBuffer:we,uniformValues:xe}=$.state;me.draw(E,k.TRIANGLES,D,O,X,or.disabled,xe,c.id,ge,we,$.segments,c.paint,f.transform.zoom,ne)}},heatmap:function(f,n,c,d){if(c.paint.get("heatmap-opacity")!==0)if(f.renderPass==="offscreen"){let g=f.context,_=g.gl,I=Vi.disabled,M=new Rt([_.ONE,_.ONE],o.Color.transparent,[!0,!0,!0,!0]);(function(E,k,D){let O=E.gl;E.activeTexture.set(O.TEXTURE1),E.viewport.set([0,0,k.width/4,k.height/4]);let X=D.heatmapFbo;if(X)O.bindTexture(O.TEXTURE_2D,X.colorAttachment.get()),E.bindFramebuffer.set(X.framebuffer);else{let oe=O.createTexture();O.bindTexture(O.TEXTURE_2D,oe),O.texParameteri(O.TEXTURE_2D,O.TEXTURE_WRAP_S,O.CLAMP_TO_EDGE),O.texParameteri(O.TEXTURE_2D,O.TEXTURE_WRAP_T,O.CLAMP_TO_EDGE),O.texParameteri(O.TEXTURE_2D,O.TEXTURE_MIN_FILTER,O.LINEAR),O.texParameteri(O.TEXTURE_2D,O.TEXTURE_MAG_FILTER,O.LINEAR),X=D.heatmapFbo=E.createFramebuffer(k.width/4,k.height/4,!1),function($,ne,me,ge){let we=$.gl;we.texImage2D(we.TEXTURE_2D,0,we.RGBA,ne.width/4,ne.height/4,0,we.RGBA,$.extRenderToTextureHalfFloat?$.extTextureHalfFloat.HALF_FLOAT_OES:we.UNSIGNED_BYTE,null),ge.colorAttachment.set(me)}(E,k,oe,X)}})(g,f,c),g.clear({color:o.Color.transparent});for(let E=0;E<d.length;E++){let k=d[E];if(n.hasRenderableParent(k))continue;let D=n.getTile(k),O=D.getBucket(c);if(!O)continue;let X=O.programConfigurations.get(c.id),oe=f.useProgram("heatmap",X),{zoom:$}=f.transform;oe.draw(g,_.TRIANGLES,bi.disabled,I,M,or.disabled,iu(k.posMatrix,D,$,c.paint.get("heatmap-intensity")),c.id,O.layoutVertexBuffer,O.indexBuffer,O.segments,c.paint,f.transform.zoom,X)}g.viewport.set([0,0,f.width,f.height])}else f.renderPass==="translucent"&&(f.context.setColorMode(f.colorModeForRenderPass()),function(g,_){let I=g.context,M=I.gl,E=_.heatmapFbo;if(!E)return;I.activeTexture.set(M.TEXTURE0),M.bindTexture(M.TEXTURE_2D,E.colorAttachment.get()),I.activeTexture.set(M.TEXTURE1);let k=_.colorRampTexture;k||(k=_.colorRampTexture=new H(I,_.colorRamp,M.RGBA)),k.bind(M.LINEAR,M.CLAMP_TO_EDGE),g.useProgram("heatmapTexture").draw(I,M.TRIANGLES,bi.disabled,Vi.disabled,g.colorModeForRenderPass(),or.disabled,((D,O,X,oe)=>{let $=o.create();o.ortho($,0,D.width,D.height,0,0,1);let ne=D.context.gl;return{u_matrix:$,u_world:[ne.drawingBufferWidth,ne.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:O.paint.get("heatmap-opacity")}})(g,_),_.id,g.viewportBuffer,g.quadTriangleIndexBuffer,g.viewportSegments,_.paint,g.transform.zoom)}(f,c))},line:function(f,n,c,d){if(f.renderPass!=="translucent")return;let g=c.paint.get("line-opacity"),_=c.paint.get("line-width");if(g.constantOr(1)===0||_.constantOr(1)===0)return;let I=f.depthModeForSublayer(0,bi.ReadOnly),M=f.colorModeForRenderPass(),E=c.paint.get("line-dasharray"),k=c.paint.get("line-pattern"),D=k.constantOr(1),O=c.paint.get("line-gradient"),X=c.getCrossfadeParameters(),oe=D?"linePattern":E?"lineSDF":O?"lineGradient":"line",$=f.context,ne=$.gl,me=!0;for(let ge of d){let we=n.getTile(ge);if(D&&!we.patternsLoaded())continue;let xe=we.getBucket(c);if(!xe)continue;let Ne=xe.programConfigurations.get(c.id),Pe=f.context.program.get(),ze=f.useProgram(oe,Ne),je=me||ze.program!==Pe,Ke=k.constantOr(null);if(Ke&&we.imageAtlas){let mt=we.imageAtlas,rt=mt.patternPositions[Ke.to.toString()],Pt=mt.patternPositions[Ke.from.toString()];rt&&Pt&&Ne.setConstantPatternPositions(rt,Pt)}let De=D?ol(f,we,c,X):E?vr(f,we,c,E,X):O?nu(f,we,c,xe.lineClipsArray.length):nl(f,we,c);if(D)$.activeTexture.set(ne.TEXTURE0),we.imageAtlasTexture.bind(ne.LINEAR,ne.CLAMP_TO_EDGE),Ne.updatePaintBuffers(X);else if(E&&(je||f.lineAtlas.dirty))$.activeTexture.set(ne.TEXTURE0),f.lineAtlas.bind($);else if(O){let mt=xe.gradients[c.id],rt=mt.texture;if(c.gradientVersion!==mt.version){let Pt=256;if(c.stepInterpolant){let ei=n.getSource().maxzoom,Zt=ge.canonical.z===ei?Math.ceil(1<<f.transform.maxZoom-ge.canonical.z):1;Pt=o.clamp(o.nextPowerOfTwo(xe.maxLineLength/o.EXTENT*1024*Zt),256,$.maxTextureSize)}mt.gradient=o.renderColorRamp({expression:c.gradientExpression(),evaluationKey:"lineProgress",resolution:Pt,image:mt.gradient||void 0,clips:xe.lineClipsArray}),mt.texture?mt.texture.update(mt.gradient):mt.texture=new H($,mt.gradient,ne.RGBA),mt.version=c.gradientVersion,rt=mt.texture}$.activeTexture.set(ne.TEXTURE0),rt.bind(c.stepInterpolant?ne.NEAREST:ne.LINEAR,ne.CLAMP_TO_EDGE)}ze.draw($,ne.TRIANGLES,I,f.stencilModeForClipping(ge),M,or.disabled,De,c.id,xe.layoutVertexBuffer,xe.indexBuffer,xe.segments,c.paint,f.transform.zoom,Ne,xe.layoutVertexBuffer2),me=!1}},fill:function(f,n,c,d){let g=c.paint.get("fill-color"),_=c.paint.get("fill-opacity");if(_.constantOr(1)===0)return;let I=f.colorModeForRenderPass(),M=c.paint.get("fill-pattern"),E=f.opaquePassEnabledForLayer()&&!M.constantOr(1)&&g.constantOr(o.Color.transparent).a===1&&_.constantOr(0)===1?"opaque":"translucent";if(f.renderPass===E){let k=f.depthModeForSublayer(1,f.renderPass==="opaque"?bi.ReadWrite:bi.ReadOnly);ph(f,n,c,d,k,I,!1)}if(f.renderPass==="translucent"&&c.paint.get("fill-antialias")){let k=f.depthModeForSublayer(c.getPaintProperty("fill-outline-color")?2:0,bi.ReadOnly);ph(f,n,c,d,k,I,!0)}},"fill-extrusion":function(f,n,c,d){let g=c.paint.get("fill-extrusion-opacity");if(g!==0&&f.renderPass==="translucent"){let _=new bi(f.context.gl.LEQUAL,bi.ReadWrite,f.depthRangeFor3D);if(g!==1||c.paint.get("fill-extrusion-pattern").constantOr(1))da(f,n,c,d,_,Vi.disabled,Rt.disabled),da(f,n,c,d,_,f.stencilModeFor3D(),f.colorModeForRenderPass());else{let I=f.colorModeForRenderPass();da(f,n,c,d,_,Vi.disabled,I)}}},hillshade:function(f,n,c,d){if(f.renderPass!=="offscreen"&&f.renderPass!=="translucent")return;let g=f.context,_=f.depthModeForSublayer(0,bi.ReadOnly),I=f.colorModeForRenderPass(),[M,E]=f.renderPass==="translucent"?f.stencilConfigForOverlap(d):[{},d];for(let k of E){let D=n.getTile(k);D.needsHillshadePrepare&&f.renderPass==="offscreen"?so(f,D,c,_,Vi.disabled,I):f.renderPass==="translucent"&&yu(f,D,c,_,M[k.overscaledZ],I)}g.viewport.set([0,0,f.width,f.height])},raster:function(f,n,c,d){if(f.renderPass!=="translucent"||c.paint.get("raster-opacity")===0||!d.length)return;let g=f.context,_=g.gl,I=n.getSource(),M=f.useProgram("raster"),E=f.colorModeForRenderPass(),[k,D]=I instanceof si?[{},d]:f.stencilConfigForOverlap(d),O=D[D.length-1].overscaledZ,X=!f.options.moving;for(let oe of D){let $=f.depthModeForSublayer(oe.overscaledZ-O,c.paint.get("raster-opacity")===1?bi.ReadWrite:bi.ReadOnly,_.LESS),ne=n.getTile(oe),me=f.transform.calculatePosMatrix(oe.toUnwrapped(),X);ne.registerFadeDuration(c.paint.get("raster-fade-duration"));let ge=n.findLoadedParent(oe,0),we=wp(ne,ge,n,c,f.transform),xe,Ne,Pe=c.paint.get("raster-resampling")==="nearest"?_.NEAREST:_.LINEAR;g.activeTexture.set(_.TEXTURE0),ne.texture.bind(Pe,_.CLAMP_TO_EDGE,_.LINEAR_MIPMAP_NEAREST),g.activeTexture.set(_.TEXTURE1),ge?(ge.texture.bind(Pe,_.CLAMP_TO_EDGE,_.LINEAR_MIPMAP_NEAREST),xe=Math.pow(2,ge.tileID.overscaledZ-ne.tileID.overscaledZ),Ne=[ne.tileID.canonical.x*xe%1,ne.tileID.canonical.y*xe%1]):ne.texture.bind(Pe,_.CLAMP_TO_EDGE,_.LINEAR_MIPMAP_NEAREST);let ze=dp(me,Ne||[0,0],xe||1,we,c);I instanceof si?M.draw(g,_.TRIANGLES,$,Vi.disabled,E,or.disabled,ze,c.id,I.boundsBuffer,f.quadTriangleIndexBuffer,I.boundsSegments):M.draw(g,_.TRIANGLES,$,k[oe.overscaledZ],E,or.disabled,ze,c.id,f.rasterBoundsBuffer,f.quadTriangleIndexBuffer,f.rasterBoundsSegments)}},background:function(f,n,c){let d=c.paint.get("background-color"),g=c.paint.get("background-opacity");if(g===0)return;let _=f.context,I=_.gl,M=f.transform,E=M.tileSize,k=c.paint.get("background-pattern");if(f.isPatternMissing(k))return;let D=!k&&d.a===1&&g===1&&f.opaquePassEnabledForLayer()?"opaque":"translucent";if(f.renderPass!==D)return;let O=Vi.disabled,X=f.depthModeForSublayer(0,D==="opaque"?bi.ReadWrite:bi.ReadOnly),oe=f.colorModeForRenderPass(),$=f.useProgram(k?"backgroundPattern":"background"),ne=M.coveringTiles({tileSize:E});k&&(_.activeTexture.set(I.TEXTURE0),f.imageManager.bind(f.context));let me=c.getCrossfadeParameters();for(let ge of ne){let we=f.transform.calculatePosMatrix(ge.toUnwrapped()),xe=k?Qc(we,g,f,k,{tileID:ge,tileSize:E},me):Xg(we,g,d);$.draw(_,I.TRIANGLES,X,O,oe,or.disabled,xe,c.id,f.tileExtentBuffer,f.quadTriangleIndexBuffer,f.tileExtentSegments)}},debug:function(f,n,c){for(let d=0;d<c.length;d++)Mp(f,n,c[d])},custom:function(f,n,c){let d=f.context,g=c.implementation;if(f.renderPass==="offscreen"){let _=g.prerender;_&&(f.setCustomLayerDefaults(),d.setColorMode(f.colorModeForRenderPass()),_.call(g,d.gl,f.transform.customLayerMatrix()),d.setDirty(),f.setBaseState())}else if(f.renderPass==="translucent"){f.setCustomLayerDefaults(),d.setColorMode(f.colorModeForRenderPass()),d.setStencilMode(Vi.disabled);let _=g.renderingMode==="3d"?new bi(f.context.gl.LEQUAL,bi.ReadWrite,f.depthRangeFor3D):f.depthModeForSublayer(0,bi.ReadOnly);d.setDepthMode(_),g.render(d.gl,f.transform.customLayerMatrix()),d.setDirty(),f.setBaseState(),d.bindFramebuffer.set(null)}}};class mh{constructor(n,c){this.context=new cu(n),this.transform=c,this._tileTextures={},this.setup(),this.numSublayers=ri.maxUnderzooming+ri.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Nt,this.gpuTimers={}}resize(n,c,d){if(this.width=n*d,this.height=c*d,this.pixelRatio=d,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let g of this.style._order)this.style._layers[g].resize()}setup(){let n=this.context,c=new o.PosArray;c.emplaceBack(0,0),c.emplaceBack(o.EXTENT,0),c.emplaceBack(0,o.EXTENT),c.emplaceBack(o.EXTENT,o.EXTENT),this.tileExtentBuffer=n.createVertexBuffer(c,Wc.members),this.tileExtentSegments=o.SegmentVector.simpleSegment(0,0,4,2);let d=new o.PosArray;d.emplaceBack(0,0),d.emplaceBack(o.EXTENT,0),d.emplaceBack(0,o.EXTENT),d.emplaceBack(o.EXTENT,o.EXTENT),this.debugBuffer=n.createVertexBuffer(d,Wc.members),this.debugSegments=o.SegmentVector.simpleSegment(0,0,4,5);let g=new o.RasterBoundsArray;g.emplaceBack(0,0,0,0),g.emplaceBack(o.EXTENT,0,o.EXTENT,0),g.emplaceBack(0,o.EXTENT,0,o.EXTENT),g.emplaceBack(o.EXTENT,o.EXTENT,o.EXTENT,o.EXTENT),this.rasterBoundsBuffer=n.createVertexBuffer(g,Xi.members),this.rasterBoundsSegments=o.SegmentVector.simpleSegment(0,0,4,2);let _=new o.PosArray;_.emplaceBack(0,0),_.emplaceBack(1,0),_.emplaceBack(0,1),_.emplaceBack(1,1),this.viewportBuffer=n.createVertexBuffer(_,Wc.members),this.viewportSegments=o.SegmentVector.simpleSegment(0,0,4,2);let I=new o.LineStripIndexArray;I.emplaceBack(0),I.emplaceBack(1),I.emplaceBack(3),I.emplaceBack(2),I.emplaceBack(0),this.tileBorderIndexBuffer=n.createIndexBuffer(I);let M=new o.TriangleIndexArray;M.emplaceBack(0,1,2),M.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=n.createIndexBuffer(M),this.emptyTexture=new H(n,{width:1,height:1,data:new Uint8Array([0,0,0,0])},n.gl.RGBA);let E=this.context.gl;this.stencilClearMode=new Vi({func:E.ALWAYS,mask:0},0,255,E.ZERO,E.ZERO,E.ZERO)}clearStencil(){let n=this.context,c=n.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let d=o.create();o.ortho(d,0,this.width,this.height,0,0,1),o.scale(d,d,[c.drawingBufferWidth,c.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(n,c.TRIANGLES,bi.disabled,this.stencilClearMode,Rt.disabled,or.disabled,rl(d),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(n,c){if(this.currentStencilSource===n.source||!n.isTileClipped()||!c||!c.length)return;this.currentStencilSource=n.source;let d=this.context,g=d.gl;this.nextStencilID+c.length>256&&this.clearStencil(),d.setColorMode(Rt.disabled),d.setDepthMode(bi.disabled);let _=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(let I of c){let M=this._tileClippingMaskIDs[I.key]=this.nextStencilID++;_.draw(d,g.TRIANGLES,bi.disabled,new Vi({func:g.ALWAYS,mask:0},M,255,g.KEEP,g.KEEP,g.REPLACE),Rt.disabled,or.disabled,rl(I.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let n=this.nextStencilID++,c=this.context.gl;return new Vi({func:c.NOTEQUAL,mask:255},n,255,c.KEEP,c.KEEP,c.REPLACE)}stencilModeForClipping(n){let c=this.context.gl;return new Vi({func:c.EQUAL,mask:255},this._tileClippingMaskIDs[n.key],0,c.KEEP,c.KEEP,c.REPLACE)}stencilConfigForOverlap(n){let c=this.context.gl,d=n.sort((I,M)=>M.overscaledZ-I.overscaledZ),g=d[d.length-1].overscaledZ,_=d[0].overscaledZ-g+1;if(_>1){this.currentStencilSource=void 0,this.nextStencilID+_>256&&this.clearStencil();let I={};for(let M=0;M<_;M++)I[M+g]=new Vi({func:c.GEQUAL,mask:255},M+this.nextStencilID,255,c.KEEP,c.KEEP,c.REPLACE);return this.nextStencilID+=_,[I,d]}return[{[g]:Vi.disabled},d]}colorModeForRenderPass(){let n=this.context.gl;return this._showOverdrawInspector?new Rt([n.CONSTANT_COLOR,n.ONE],new o.Color(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?Rt.unblended:Rt.alphaBlended}depthModeForSublayer(n,c,d){if(!this.opaquePassEnabledForLayer())return bi.disabled;let g=1-((1+this.currentLayer)*this.numSublayers+n)*this.depthEpsilon;return new bi(d||this.context.gl.LEQUAL,c,[g,g])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(n,c){this.style=n,this.options=c,this.lineAtlas=n.lineAtlas,this.imageManager=n.imageManager,this.glyphManager=n.glyphManager,this.symbolFadeChange=n.placement.symbolFadeChange(o.exported.now()),this.imageManager.beginFrame();let d=this.style._order,g=this.style.sourceCaches;for(let E in g){let k=g[E];k.used&&k.prepare(this.context)}let _={},I={},M={};for(let E in g){let k=g[E];_[E]=k.getVisibleCoordinates(),I[E]=_[E].slice().reverse(),M[E]=k.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let E=0;E<d.length;E++)if(this.style._layers[d[E]].is3D()){this.opaquePassCutoff=E;break}this.renderPass="offscreen";for(let E of d){let k=this.style._layers[E];if(!k.hasOffscreenPass()||k.isHidden(this.transform.zoom))continue;let D=I[k.source];(k.type==="custom"||D.length)&&this.renderLayer(this,g[k.source],k,D)}for(this.context.bindFramebuffer.set(null),this.context.clear({color:c.showOverdrawInspector?o.Color.black:o.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=c.showOverdrawInspector,this.depthRangeFor3D=[0,1-(n._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=d.length-1;this.currentLayer>=0;this.currentLayer--){let E=this.style._layers[d[this.currentLayer]],k=g[E.source],D=_[E.source];this._renderTileClippingMasks(E,D),this.renderLayer(this,k,E,D)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<d.length;this.currentLayer++){let E=this.style._layers[d[this.currentLayer]],k=g[E.source],D=(E.type==="symbol"?M:I)[E.source];this._renderTileClippingMasks(E,_[E.source]),this.renderLayer(this,k,E,D)}if(this.options.showTileBoundaries){let E,k;Object.values(this.style._layers).forEach(D=>{D.source&&!D.isHidden(this.transform.zoom)&&(D.source!==(k&&k.id)&&(k=this.style.sourceCaches[D.source]),(!E||E.getSource().maxzoom<k.getSource().maxzoom)&&(E=k))}),E&&ul.debug(this,E,E.getVisibleCoordinates())}this.options.showPadding&&function(E){let k=E.transform.padding;Cp(E,E.transform.height-(k.top||0),3,Ip),Cp(E,k.bottom||0,3,Sp),xu(E,k.left||0,3,pa),xu(E,E.transform.width-(k.right||0),3,vu);let D=E.transform.centerPoint;(function(O,X,oe,$){_u(O,X-1,oe-10,2,20,$),_u(O,X-10,oe-1,20,2,$)})(E,D.x,E.transform.height-D.y,fh)}(this),this.context.setDefault()}renderLayer(n,c,d,g){d.isHidden(this.transform.zoom)||(d.type==="background"||d.type==="custom"||g.length)&&(this.id=d.id,this.gpuTimingStart(d),ul[d.type](n,c,d,g,this.style.placement.variableOffsets),this.gpuTimingEnd())}gpuTimingStart(n){if(!this.options.gpuTiming)return;let c=this.context.extTimerQuery,d=this.gpuTimers[n.id];d||(d=this.gpuTimers[n.id]={calls:0,cpuTime:0,query:c.createQueryEXT()}),d.calls++,c.beginQueryEXT(c.TIME_ELAPSED_EXT,d.query)}gpuTimingEnd(){if(!this.options.gpuTiming)return;let n=this.context.extTimerQuery;n.endQueryEXT(n.TIME_ELAPSED_EXT)}collectGpuTimers(){let n=this.gpuTimers;return this.gpuTimers={},n}queryGpuTimers(n){let c={};for(let d in n){let g=n[d],_=this.context.extTimerQuery,I=_.getQueryObjectEXT(g.query,_.QUERY_RESULT_EXT)/1e6;_.deleteQueryEXT(g.query),c[d]=I}return c}translatePosMatrix(n,c,d,g,_){if(!d[0]&&!d[1])return n;let I=_?g==="map"?this.transform.angle:0:g==="viewport"?-this.transform.angle:0;if(I){let k=Math.sin(I),D=Math.cos(I);d=[d[0]*D-d[1]*k,d[0]*k+d[1]*D]}let M=[_?d[0]:Ti(c,d[0],this.transform.zoom),_?d[1]:Ti(c,d[1],this.transform.zoom),0],E=new Float32Array(16);return o.translate(E,n,M),E}saveTileTexture(n){let c=this._tileTextures[n.size[0]];c?c.push(n):this._tileTextures[n.size[0]]=[n]}getTileTexture(n){let c=this._tileTextures[n];return c&&c.length>0?c.pop():null}isPatternMissing(n){if(!n)return!1;if(!n.from||!n.to)return!0;let c=this.imageManager.getPattern(n.from.toString()),d=this.imageManager.getPattern(n.to.toString());return!c||!d}useProgram(n,c){this.cache=this.cache||{};let d=`${n}${c?c.cacheKey:""}${this._showOverdrawInspector?"/overdraw":""}`;return this.cache[d]||(this.cache[d]=new jg(this.context,n,Zc[n],c,Kc[n],this._showOverdrawInspector)),this.cache[d]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){let n=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(n.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new H(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}}class bu{constructor(n,c){this.points=n,this.planes=c}static fromInvProjectionMatrix(n,c,d){let g=Math.pow(2,d),_=[[-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=>o.transformMat4([],M,n)).map(M=>o.scale$1([],M,1/M[3]/c*g)),I=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(M=>{let E=function(X,oe){var $=oe[0],ne=oe[1],me=oe[2],ge=$*$+ne*ne+me*me;return ge>0&&(ge=1/Math.sqrt(ge)),X[0]=oe[0]*ge,X[1]=oe[1]*ge,X[2]=oe[2]*ge,X}([],function(X,oe,$){var ne=oe[0],me=oe[1],ge=oe[2],we=$[0],xe=$[1],Ne=$[2];return X[0]=me*Ne-ge*xe,X[1]=ge*we-ne*Ne,X[2]=ne*xe-me*we,X}([],le([],_[M[0]],_[M[1]]),le([],_[M[2]],_[M[1]]))),k=-((D=E)[0]*(O=_[M[1]])[0]+D[1]*O[1]+D[2]*O[2]);var D,O;return E.concat(k)});return new bu(_,I)}}class wu{constructor(n,c){this.min=n,this.max=c,this.center=function(d,g,_){return d[0]=.5*g[0],d[1]=.5*g[1],d[2]=.5*g[2],d}([],function(d,g,_){return d[0]=g[0]+_[0],d[1]=g[1]+_[1],d[2]=g[2]+_[2],d}([],this.min,this.max))}quadrant(n){let c=[n%2==0,n<2],d=q(this.min),g=q(this.max);for(let _=0;_<c.length;_++)d[_]=c[_]?this.min[_]:this.center[_],g[_]=c[_]?this.center[_]:this.max[_];return g[2]=this.max[2],new wu(d,g)}distanceX(n){return Math.max(Math.min(this.max[0],n[0]),this.min[0])-n[0]}distanceY(n){return Math.max(Math.min(this.max[1],n[1]),this.min[1])-n[1]}intersects(n){let c=[[this.min[0],this.min[1],0,1],[this.max[0],this.min[1],0,1],[this.max[0],this.max[1],0,1],[this.min[0],this.max[1],0,1]],d=!0;for(let g=0;g<n.planes.length;g++){let _=n.planes[g],I=0;for(let M=0;M<c.length;M++)o.dot(_,c[M])>=0&&I++;if(I===0)return 0;I!==c.length&&(d=!1)}if(d)return 2;for(let g=0;g<3;g++){let _=Number.MAX_VALUE,I=-Number.MAX_VALUE;for(let M=0;M<n.points.length;M++){let E=n.points[M][g]-this.min[g];_=Math.min(_,E),I=Math.max(I,E)}if(I<0||_>this.max[g]-this.min[g])return 0}return 1}}class fa{constructor(n=0,c=0,d=0,g=0){if(isNaN(n)||n<0||isNaN(c)||c<0||isNaN(d)||d<0||isNaN(g)||g<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=n,this.bottom=c,this.left=d,this.right=g}interpolate(n,c,d){return c.top!=null&&n.top!=null&&(this.top=o.number(n.top,c.top,d)),c.bottom!=null&&n.bottom!=null&&(this.bottom=o.number(n.bottom,c.bottom,d)),c.left!=null&&n.left!=null&&(this.left=o.number(n.left,c.left,d)),c.right!=null&&n.right!=null&&(this.right=o.number(n.right,c.right,d)),this}getCenter(n,c){let d=o.clamp((this.left+n-this.right)/2,0,n),g=o.clamp((this.top+c-this.bottom)/2,0,c);return new o.pointGeometry(d,g)}equals(n){return this.top===n.top&&this.bottom===n.bottom&&this.left===n.left&&this.right===n.right}clone(){return new fa(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}class cl{constructor(n,c,d,g,_){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=_===void 0||!!_,this._minZoom=n||0,this._maxZoom=c||22,this._minPitch=d??0,this._maxPitch=g??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new o.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new fa,this._posMatrixCache={},this._alignedPosMatrixCache={}}clone(){let n=new cl(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return n.tileSize=this.tileSize,n.latRange=this.latRange,n.width=this.width,n.height=this.height,n._center=this._center,n.zoom=this.zoom,n.angle=this.angle,n._fov=this._fov,n._pitch=this._pitch,n._unmodified=this._unmodified,n._edgeInsets=this._edgeInsets.clone(),n._calcMatrices(),n}get minZoom(){return this._minZoom}set minZoom(n){this._minZoom!==n&&(this._minZoom=n,this.zoom=Math.max(this.zoom,n))}get maxZoom(){return this._maxZoom}set maxZoom(n){this._maxZoom!==n&&(this._maxZoom=n,this.zoom=Math.min(this.zoom,n))}get minPitch(){return this._minPitch}set minPitch(n){this._minPitch!==n&&(this._minPitch=n,this.pitch=Math.max(this.pitch,n))}get maxPitch(){return this._maxPitch}set maxPitch(n){this._maxPitch!==n&&(this._maxPitch=n,this.pitch=Math.min(this.pitch,n))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(n){n===void 0?n=!0:n===null&&(n=!1),this._renderWorldCopies=n}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new o.pointGeometry(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(n){let c=-o.wrap(n,-180,180)*Math.PI/180;this.angle!==c&&(this._unmodified=!1,this.angle=c,this._calcMatrices(),this.rotationMatrix=function(){var d=new o.ARRAY_TYPE(4);return o.ARRAY_TYPE!=Float32Array&&(d[1]=0,d[2]=0),d[0]=1,d[3]=1,d}(),function(d,g,_){var I=g[0],M=g[1],E=g[2],k=g[3],D=Math.sin(_),O=Math.cos(_);d[0]=I*O+E*D,d[1]=M*O+k*D,d[2]=I*-D+E*O,d[3]=M*-D+k*O}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(n){let c=o.clamp(n,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==c&&(this._unmodified=!1,this._pitch=c,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(n){n=Math.max(.01,Math.min(60,n)),this._fov!==n&&(this._unmodified=!1,this._fov=n/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(n){let c=Math.min(Math.max(n,this.minZoom),this.maxZoom);this._zoom!==c&&(this._unmodified=!1,this._zoom=c,this.scale=this.zoomScale(c),this.tileZoom=Math.floor(c),this.zoomFraction=c-this.tileZoom,this._constrain(),this._calcMatrices())}get center(){return this._center}set center(n){n.lat===this._center.lat&&n.lng===this._center.lng||(this._unmodified=!1,this._center=n,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(n){this._edgeInsets.equals(n)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,n,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(n){return this._edgeInsets.equals(n)}interpolatePadding(n,c,d){this._unmodified=!1,this._edgeInsets.interpolate(n,c,d),this._constrain(),this._calcMatrices()}coveringZoomLevel(n){let c=(n.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/n.tileSize));return Math.max(0,c)}getVisibleUnwrappedCoordinates(n){let c=[new o.UnwrappedTileID(0,n)];if(this._renderWorldCopies){let d=this.pointCoordinate(new o.pointGeometry(0,0)),g=this.pointCoordinate(new o.pointGeometry(this.width,0)),_=this.pointCoordinate(new o.pointGeometry(this.width,this.height)),I=this.pointCoordinate(new o.pointGeometry(0,this.height)),M=Math.floor(Math.min(d.x,g.x,_.x,I.x)),E=Math.floor(Math.max(d.x,g.x,_.x,I.x)),k=1;for(let D=M-k;D<=E+k;D++)D!==0&&c.push(new o.UnwrappedTileID(D,n))}return c}coveringTiles(n){let c=this.coveringZoomLevel(n),d=c;if(n.minzoom!==void 0&&c<n.minzoom)return[];n.maxzoom!==void 0&&c>n.maxzoom&&(c=n.maxzoom);let g=o.MercatorCoordinate.fromLngLat(this.center),_=Math.pow(2,c),I=[_*g.x,_*g.y,0],M=bu.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,c),E=n.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(E=c);let k=$=>({aabb:new wu([$*_,0,0],[($+1)*_,_,0]),zoom:0,x:0,y:0,wrap:$,fullyVisible:!1}),D=[],O=[],X=c,oe=n.reparseOverscaled?d:c;if(this._renderWorldCopies)for(let $=1;$<=3;$++)D.push(k(-$)),D.push(k($));for(D.push(k(0));D.length>0;){let $=D.pop(),ne=$.x,me=$.y,ge=$.fullyVisible;if(!ge){let ze=$.aabb.intersects(M);if(ze===0)continue;ge=ze===2}let we=$.aabb.distanceX(I),xe=$.aabb.distanceY(I),Ne=Math.max(Math.abs(we),Math.abs(xe)),Pe=3+(1<<X-$.zoom)-2;if($.zoom===X||Ne>Pe&&$.zoom>=E)O.push({tileID:new o.OverscaledTileID($.zoom===X?oe:$.zoom,$.wrap,$.zoom,ne,me),distanceSq:de([I[0]-.5-ne,I[1]-.5-me])});else for(let ze=0;ze<4;ze++){let je=(ne<<1)+ze%2,Ke=(me<<1)+(ze>>1);D.push({aabb:$.aabb.quadrant(ze),zoom:$.zoom+1,x:je,y:Ke,wrap:$.wrap,fullyVisible:ge})}}return O.sort(($,ne)=>$.distanceSq-ne.distanceSq).map($=>$.tileID)}resize(n,c){this.width=n,this.height=c,this.pixelsToGLUnits=[2/n,-2/c],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(n){return Math.pow(2,n)}scaleZoom(n){return Math.log(n)/Math.LN2}project(n){let c=o.clamp(n.lat,-this.maxValidLatitude,this.maxValidLatitude);return new o.pointGeometry(o.mercatorXfromLng(n.lng)*this.worldSize,o.mercatorYfromLat(c)*this.worldSize)}unproject(n){return new o.MercatorCoordinate(n.x/this.worldSize,n.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}setLocationAtPoint(n,c){let d=this.pointCoordinate(c),g=this.pointCoordinate(this.centerPoint),_=this.locationCoordinate(n),I=new o.MercatorCoordinate(_.x-(d.x-g.x),_.y-(d.y-g.y));this.center=this.coordinateLocation(I),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(n){return this.coordinatePoint(this.locationCoordinate(n))}pointLocation(n){return this.coordinateLocation(this.pointCoordinate(n))}locationCoordinate(n){return o.MercatorCoordinate.fromLngLat(n)}coordinateLocation(n){return n.toLngLat()}pointCoordinate(n){let c=[n.x,n.y,0,1],d=[n.x,n.y,1,1];o.transformMat4(c,c,this.pixelMatrixInverse),o.transformMat4(d,d,this.pixelMatrixInverse);let g=c[3],_=d[3],I=c[1]/g,M=d[1]/_,E=c[2]/g,k=d[2]/_,D=E===k?0:(0-E)/(k-E);return new o.MercatorCoordinate(o.number(c[0]/g,d[0]/_,D)/this.worldSize,o.number(I,M,D)/this.worldSize)}coordinatePoint(n){let c=[n.x*this.worldSize,n.y*this.worldSize,0,1];return o.transformMat4(c,c,this.pixelMatrix),new o.pointGeometry(c[0]/c[3],c[1]/c[3])}getBounds(){return new o.LngLatBounds().extend(this.pointLocation(new o.pointGeometry(0,0))).extend(this.pointLocation(new o.pointGeometry(this.width,0))).extend(this.pointLocation(new o.pointGeometry(this.width,this.height))).extend(this.pointLocation(new o.pointGeometry(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new o.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}setMaxBounds(n){n?(this.lngRange=[n.getWest(),n.getEast()],this.latRange=[n.getSouth(),n.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])}calculatePosMatrix(n,c=!1){let d=n.key,g=c?this._alignedPosMatrixCache:this._posMatrixCache;if(g[d])return g[d];let _=n.canonical,I=this.worldSize/this.zoomScale(_.z),M=_.x+Math.pow(2,_.z)*n.wrap,E=o.identity(new Float64Array(16));return o.translate(E,E,[M*I,_.y*I,0]),o.scale(E,E,[I/o.EXTENT,I/o.EXTENT,1]),o.multiply(E,c?this.alignedProjMatrix:this.projMatrix,E),g[d]=new Float32Array(E),g[d]}customLayerMatrix(){return this.mercatorMatrix.slice()}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let n,c,d,g,_=-90,I=90,M=-180,E=180,k=this.size,D=this._unmodified;if(this.latRange){let oe=this.latRange;_=o.mercatorYfromLat(oe[1])*this.worldSize,I=o.mercatorYfromLat(oe[0])*this.worldSize,n=I-_<k.y?k.y/(I-_):0}if(this.lngRange){let oe=this.lngRange;M=o.mercatorXfromLng(oe[0])*this.worldSize,E=o.mercatorXfromLng(oe[1])*this.worldSize,c=E-M<k.x?k.x/(E-M):0}let O=this.point,X=Math.max(c||0,n||0);if(X)return this.center=this.unproject(new o.pointGeometry(c?(E+M)/2:O.x,n?(I+_)/2:O.y)),this.zoom+=this.scaleZoom(X),this._unmodified=D,void(this._constraining=!1);if(this.latRange){let oe=O.y,$=k.y/2;oe-$<_&&(g=_+$),oe+$>I&&(g=I-$)}if(this.lngRange){let oe=O.x,$=k.x/2;oe-$<M&&(d=M+$),oe+$>E&&(d=E-$)}d===void 0&&g===void 0||(this.center=this.unproject(new o.pointGeometry(d!==void 0?d:O.x,g!==void 0?g:O.y))),this._unmodified=D,this._constraining=!1}_calcMatrices(){if(!this.height)return;let n=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;let c=Math.PI/2+this._pitch,d=this._fov*(.5+n.y/this.height),g=Math.sin(d)*this.cameraToCenterDistance/Math.sin(o.clamp(Math.PI-c-d,.01,Math.PI-.01)),_=this.point,I=_.x,M=_.y,E=1.01*(Math.cos(Math.PI/2-this._pitch)*g+this.cameraToCenterDistance),k=this.height/50,D=new Float64Array(16);o.perspective(D,this._fov,this.width/this.height,k,E),D[8]=2*-n.x/this.width,D[9]=2*n.y/this.height,o.scale(D,D,[1,-1,1]),o.translate(D,D,[0,0,-this.cameraToCenterDistance]),o.rotateX(D,D,this._pitch),o.rotateZ(D,D,this.angle),o.translate(D,D,[-I,-M,0]),this.mercatorMatrix=o.scale([],D,[this.worldSize,this.worldSize,this.worldSize]),o.scale(D,D,[1,1,o.mercatorZfromAltitude(1,this.center.lat)*this.worldSize]),this.projMatrix=D,this.invProjMatrix=o.invert([],this.projMatrix);let O=this.width%2/2,X=this.height%2/2,oe=Math.cos(this.angle),$=Math.sin(this.angle),ne=I-Math.round(I)+oe*O+$*X,me=M-Math.round(M)+oe*X+$*O,ge=new Float64Array(D);if(o.translate(ge,ge,[ne>.5?ne-1:ne,me>.5?me-1:me,0]),this.alignedProjMatrix=ge,D=o.create(),o.scale(D,D,[this.width/2,-this.height/2,1]),o.translate(D,D,[1,-1,0]),this.labelPlaneMatrix=D,D=o.create(),o.scale(D,D,[1,-1,1]),o.translate(D,D,[-1,-1,0]),o.scale(D,D,[2/this.width,2/this.height,1]),this.glCoordMatrix=D,this.pixelMatrix=o.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),D=o.invert(new Float64Array(16),this.pixelMatrix),!D)throw new Error("failed to invert matrix");this.pixelMatrixInverse=D,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;let n=this.pointCoordinate(new o.pointGeometry(0,0)),c=[n.x*this.worldSize,n.y*this.worldSize,0,1];return o.transformMat4(c,c,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){let n=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new o.pointGeometry(0,n))}getCameraQueryGeometry(n){let c=this.getCameraPoint();if(n.length===1)return[n[0],c];{let d=c.x,g=c.y,_=c.x,I=c.y;for(let M of n)d=Math.min(d,M.x),g=Math.min(g,M.y),_=Math.max(_,M.x),I=Math.max(I,M.y);return[new o.pointGeometry(d,g),new o.pointGeometry(_,g),new o.pointGeometry(_,I),new o.pointGeometry(d,I),new o.pointGeometry(d,g)]}}}class Ep{constructor(n){this._hashName=n&&encodeURIComponent(n),o.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=function(c,d){let g=!1,_=null,I=()=>{_=null,g&&(c(),_=setTimeout(I,300),g=!1)};return()=>(g=!0,_||I(),_)}(this._updateHashUnthrottled.bind(this))}addTo(n){return this._map=n,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this}getHashString(n){let c=this._map.getCenter(),d=Math.round(100*this._map.getZoom())/100,g=Math.ceil((d*Math.LN2+Math.log(512/360/.5))/Math.LN10),_=Math.pow(10,g),I=Math.round(c.lng*_)/_,M=Math.round(c.lat*_)/_,E=this._map.getBearing(),k=this._map.getPitch(),D="";if(D+=n?`/${I}/${M}/${d}`:`${d}/${M}/${I}`,(E||k)&&(D+="/"+Math.round(10*E)/10),k&&(D+=`/${Math.round(k)}`),this._hashName){let O=this._hashName,X=!1,oe=window.location.hash.slice(1).split("&").map($=>{let ne=$.split("=")[0];return ne===O?(X=!0,`${ne}=${D}`):$}).filter($=>$);return X||oe.push(`${O}=${D}`),`#${oe.join("&")}`}return`#${D}`}_getCurrentHash(){let n=window.location.hash.replace("#","");if(this._hashName){let c;return n.split("&").map(d=>d.split("=")).forEach(d=>{d[0]===this._hashName&&(c=d)}),(c&&c[1]||"").split("/")}return n.split("/")}_onHashChange(){let n=this._getCurrentHash();if(n.length>=3&&!n.some(c=>isNaN(c))){let c=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(n[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+n[2],+n[1]],zoom:+n[0],bearing:c,pitch:+(n[4]||0)}),!0}return!1}_updateHashUnthrottled(){let n=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,n)}catch{}}}let hl={linearity:.3,easing:o.bezier(0,0,.3,1)},Tp=o.extend({deceleration:2500,maxSpeed:1400},hl),Ap=o.extend({deceleration:20,maxSpeed:1400},hl),Pp=o.extend({deceleration:1e3,maxSpeed:360},hl),ma=o.extend({deceleration:1e3,maxSpeed:90},hl);class kp{constructor(n){this._map=n,this.clear()}clear(){this._inertiaBuffer=[]}record(n){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:o.exported.now(),settings:n})}_drainInertiaBuffer(){let n=this._inertiaBuffer,c=o.exported.now();for(;n.length>0&&c-n[0].time>160;)n.shift()}_onMoveEnd(n){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;let c={zoom:0,bearing:0,pitch:0,pan:new o.pointGeometry(0,0),pinchAround:void 0,around:void 0};for(let{settings:_}of this._inertiaBuffer)c.zoom+=_.zoomDelta||0,c.bearing+=_.bearingDelta||0,c.pitch+=_.pitchDelta||0,_.panDelta&&c.pan._add(_.panDelta),_.around&&(c.around=_.around),_.pinchAround&&(c.pinchAround=_.pinchAround);let d=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,g={};if(c.pan.mag()){let _=pl(c.pan.mag(),d,o.extend({},Tp,n||{}));g.offset=c.pan.mult(_.amount/c.pan.mag()),g.center=this._map.transform.center,dl(g,_)}if(c.zoom){let _=pl(c.zoom,d,Ap);g.zoom=this._map.transform.zoom+_.amount,dl(g,_)}if(c.bearing){let _=pl(c.bearing,d,Pp);g.bearing=this._map.transform.bearing+o.clamp(_.amount,-179,179),dl(g,_)}if(c.pitch){let _=pl(c.pitch,d,ma);g.pitch=this._map.transform.pitch+_.amount,dl(g,_)}if(g.zoom||g.bearing){let _=c.pinchAround===void 0?c.around:c.pinchAround;g.around=_?this._map.unproject(_):this._map.getCenter()}return this.clear(),o.extend(g,{noMoveStart:!0})}}function dl(f,n){(!f.duration||f.duration<n.duration)&&(f.duration=n.duration,f.easing=n.easing)}function pl(f,n,c){let{maxSpeed:d,linearity:g,deceleration:_}=c,I=o.clamp(f*g/(n/1e3),-d,d),M=Math.abs(I)/(_*g);return{easing:c.easing,duration:1e3*M,amount:I*(M/2)}}class En extends o.Event{constructor(n,c,d,g={}){let _=T.mousePos(c.getCanvasContainer(),d),I=c.unproject(_);super(n,o.extend({point:_,lngLat:I,originalEvent:d},g)),this._defaultPrevented=!1,this.target=c}preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}}class dn extends o.Event{constructor(n,c,d){let g=n==="touchend"?d.changedTouches:d.touches,_=T.touchPos(c.getCanvasContainer(),g),I=_.map(E=>c.unproject(E)),M=_.reduce((E,k,D,O)=>E.add(k.div(O.length)),new o.pointGeometry(0,0));super(n,{points:_,point:M,lngLats:I,lngLat:c.unproject(M),originalEvent:d}),this._defaultPrevented=!1}preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}}class i0 extends o.Event{constructor(n,c,d){super(n,{originalEvent:d}),this._defaultPrevented=!1}preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}}class ws{constructor(n,c){this._map=n,this._clickTolerance=c.clickTolerance}reset(){delete this._mousedownPos}wheel(n){return this._firePreventable(new i0(n.type,this._map,n))}mousedown(n,c){return this._mousedownPos=c,this._firePreventable(new En(n.type,this._map,n))}mouseup(n){this._map.fire(new En(n.type,this._map,n))}click(n,c){this._mousedownPos&&this._mousedownPos.dist(c)>=this._clickTolerance||this._map.fire(new En(n.type,this._map,n))}dblclick(n){return this._firePreventable(new En(n.type,this._map,n))}mouseover(n){this._map.fire(new En(n.type,this._map,n))}mouseout(n){this._map.fire(new En(n.type,this._map,n))}touchstart(n){return this._firePreventable(new dn(n.type,this._map,n))}touchmove(n){this._map.fire(new dn(n.type,this._map,n))}touchend(n){this._map.fire(new dn(n.type,this._map,n))}touchcancel(n){this._map.fire(new dn(n.type,this._map,n))}_firePreventable(n){if(this._map.fire(n),n.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class zp{constructor(n){this._map=n}reset(){this._delayContextMenu=!1,delete this._contextMenuEvent}mousemove(n){this._map.fire(new En(n.type,this._map,n))}mousedown(){this._delayContextMenu=!0}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new En("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(n){this._delayContextMenu?this._contextMenuEvent=n:this._map.fire(new En(n.type,this._map,n)),this._map.listens("contextmenu")&&n.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class ga{constructor(n,c){this._map=n,this._el=n.getCanvasContainer(),this._container=n.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(n,c){this.isEnabled()&&n.shiftKey&&n.button===0&&(T.disableDrag(),this._startPos=this._lastPos=c,this._active=!0)}mousemoveWindow(n,c){if(!this._active)return;let d=c;if(this._lastPos.equals(d)||!this._box&&d.dist(this._startPos)<this._clickTolerance)return;let g=this._startPos;this._lastPos=d,this._box||(this._box=T.create("div","maplibregl-boxzoom mapboxgl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair","mapboxgl-crosshair"),this._fireEvent("boxzoomstart",n));let _=Math.min(g.x,d.x),I=Math.max(g.x,d.x),M=Math.min(g.y,d.y),E=Math.max(g.y,d.y);T.setTransform(this._box,`translate(${_}px,${M}px)`),this._box.style.width=I-_+"px",this._box.style.height=E-M+"px"}mouseupWindow(n,c){if(!this._active||n.button!==0)return;let d=this._startPos,g=c;if(this.reset(),T.suppressClick(),d.x!==g.x||d.y!==g.y)return this._map.fire(new o.Event("boxzoomend",{originalEvent:n})),{cameraAnimation:_=>_.fitScreenCoordinates(d,g,this._map.getBearing(),{linear:!0})};this._fireEvent("boxzoomcancel",n)}keydown(n){this._active&&n.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",n))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair","mapboxgl-crosshair"),this._box&&(T.remove(this._box),this._box=null),T.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(n,c){return this._map.fire(new o.Event(n,{originalEvent:c}))}}function Is(f,n){let c={};for(let d=0;d<f.length;d++)c[f[d].identifier]=n[d];return c}class r0{constructor(n){this.reset(),this.numTouches=n.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(n,c,d){(this.centroid||d.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=n.timeStamp),d.length===this.numTouches&&(this.centroid=function(g){let _=new o.pointGeometry(0,0);for(let I of g)_._add(I);return _.div(g.length)}(c),this.touches=Is(d,c)))}touchmove(n,c,d){if(this.aborted||!this.centroid)return;let g=Is(d,c);for(let _ in this.touches){let I=this.touches[_],M=g[_];(!M||M.dist(I)>30)&&(this.aborted=!0)}}touchend(n,c,d){if((!this.centroid||n.timeStamp-this.startTime>500)&&(this.aborted=!0),d.length===0){let g=!this.aborted&&this.centroid;if(this.reset(),g)return g}}}class gh{constructor(n){this.singleTap=new r0(n),this.numTaps=n.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(n,c,d){this.singleTap.touchstart(n,c,d)}touchmove(n,c,d){this.singleTap.touchmove(n,c,d)}touchend(n,c,d){let g=this.singleTap.touchend(n,c,d);if(g){let _=n.timeStamp-this.lastTime<500,I=!this.lastTap||this.lastTap.dist(g)<30;if(_&&I||this.reset(),this.count++,this.lastTime=n.timeStamp,this.lastTap=g,this.count===this.numTaps)return this.reset(),g}}}class n0{constructor(){this._zoomIn=new gh({numTouches:1,numTaps:2}),this._zoomOut=new gh({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(n,c,d){this._zoomIn.touchstart(n,c,d),this._zoomOut.touchstart(n,c,d)}touchmove(n,c,d){this._zoomIn.touchmove(n,c,d),this._zoomOut.touchmove(n,c,d)}touchend(n,c,d){let g=this._zoomIn.touchend(n,c,d),_=this._zoomOut.touchend(n,c,d);return g?(this._active=!0,n.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:I=>I.easeTo({duration:300,zoom:I.getZoom()+1,around:I.unproject(g)},{originalEvent:n})}):_?(this._active=!0,n.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:I=>I.easeTo({duration:300,zoom:I.getZoom()-1,around:I.unproject(_)},{originalEvent:n})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}let Lp={0:1,2:2};class Ss{constructor(n){this.reset(),this._clickTolerance=n.clickTolerance||1}reset(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton}_correctButton(n,c){return!1}_move(n,c){return{}}mousedown(n,c){if(this._lastPoint)return;let d=T.mouseButton(n);this._correctButton(n,d)&&(this._lastPoint=c,this._eventButton=d)}mousemoveWindow(n,c){let d=this._lastPoint;if(d){if(n.preventDefault(),function(g,_){let I=Lp[_];return g.buttons===void 0||(g.buttons&I)!==I}(n,this._eventButton))this.reset();else if(this._moved||!(c.dist(d)<this._clickTolerance))return this._moved=!0,this._lastPoint=c,this._move(d,c)}}mouseupWindow(n){this._lastPoint&&T.mouseButton(n)===this._eventButton&&(this._moved&&T.suppressClick(),this.reset())}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ya extends Ss{mousedown(n,c){super.mousedown(n,c),this._lastPoint&&(this._active=!0)}_correctButton(n,c){return c===0&&!n.ctrlKey}_move(n,c){return{around:c,panDelta:c.sub(n)}}}class dt extends Ss{_correctButton(n,c){return c===0&&n.ctrlKey||c===2}_move(n,c){let d=.8*(c.x-n.x);if(d)return this._active=!0,{bearingDelta:d}}contextmenu(n){n.preventDefault()}}class yh extends Ss{_correctButton(n,c){return c===0&&n.ctrlKey||c===2}_move(n,c){let d=-.5*(c.y-n.y);if(d)return this._active=!0,{pitchDelta:d}}contextmenu(n){n.preventDefault()}}class fl{constructor(n){this._minTouches=1,this._clickTolerance=n.clickTolerance||1,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new o.pointGeometry(0,0)}touchstart(n,c,d){return this._calculateTransform(n,c,d)}touchmove(n,c,d){if(this._active&&!(d.length<this._minTouches))return n.preventDefault(),this._calculateTransform(n,c,d)}touchend(n,c,d){this._calculateTransform(n,c,d),this._active&&d.length<this._minTouches&&this.reset()}touchcancel(){this.reset()}_calculateTransform(n,c,d){d.length>0&&(this._active=!0);let g=Is(d,c),_=new o.pointGeometry(0,0),I=new o.pointGeometry(0,0),M=0;for(let k in g){let D=g[k],O=this._touches[k];O&&(_._add(D),I._add(D.sub(O)),M++,g[k]=D)}if(this._touches=g,M<this._minTouches||!I.mag())return;let E=I.div(M);return this._sum._add(E),this._sum.mag()<this._clickTolerance?void 0:{around:_.div(M),panDelta:E}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Cs{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}_start(n){}_move(n,c,d){return{}}touchstart(n,c,d){this._firstTwoTouches||d.length<2||(this._firstTwoTouches=[d[0].identifier,d[1].identifier],this._start([c[0],c[1]]))}touchmove(n,c,d){if(!this._firstTwoTouches)return;n.preventDefault();let[g,_]=this._firstTwoTouches,I=ml(d,c,g),M=ml(d,c,_);if(!I||!M)return;let E=this._aroundCenter?null:I.add(M).div(2);return this._move([I,M],E,n)}touchend(n,c,d){if(!this._firstTwoTouches)return;let[g,_]=this._firstTwoTouches,I=ml(d,c,g),M=ml(d,c,_);I&&M||(this._active&&T.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(n){this._enabled=!0,this._aroundCenter=!!n&&n.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function ml(f,n,c){for(let d=0;d<f.length;d++)if(f[d].identifier===c)return n[d]}function it(f,n){return Math.log(f/n)/Math.LN2}class vh extends Cs{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(n){this._startDistance=this._distance=n[0].dist(n[1])}_move(n,c){let d=this._distance;if(this._distance=n[0].dist(n[1]),this._active||!(Math.abs(it(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:it(this._distance,d),pinchAround:c}}}function Rp(f,n){return 180*f.angleWith(n)/Math.PI}class o0 extends Cs{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(n){this._startVector=this._vector=n[0].sub(n[1]),this._minDiameter=n[0].dist(n[1])}_move(n,c){let d=this._vector;if(this._vector=n[0].sub(n[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:Rp(this._vector,d),pinchAround:c}}_isBelowThreshold(n){this._minDiameter=Math.min(this._minDiameter,n.mag());let c=25/(Math.PI*this._minDiameter)*360,d=Rp(n,this._startVector);return Math.abs(d)<c}}function gl(f){return Math.abs(f.y)>Math.abs(f.x)}class Dp extends Cs{reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}_start(n){this._lastPoints=n,gl(n[0].sub(n[1]))&&(this._valid=!1)}_move(n,c,d){let g=n[0].sub(this._lastPoints[0]),_=n[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(g,_,d.timeStamp),this._valid)return this._lastPoints=n,this._active=!0,{pitchDelta:(g.y+_.y)/2*-.5}}gestureBeginsVertically(n,c,d){if(this._valid!==void 0)return this._valid;let g=n.mag()>=2,_=c.mag()>=2;if(!g&&!_)return;if(!g||!_)return this._firstMove===void 0&&(this._firstMove=d),d-this._firstMove<100&&void 0;let I=n.y>0==c.y>0;return gl(n)&&gl(c)&&I}}let Bp={panStep:100,bearingStep:15,pitchStep:10};class s0{constructor(){let n=Bp;this._panStep=n.panStep,this._bearingStep=n.bearingStep,this._pitchStep=n.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(n){if(n.altKey||n.ctrlKey||n.metaKey)return;let c=0,d=0,g=0,_=0,I=0;switch(n.keyCode){case 61:case 107:case 171:case 187:c=1;break;case 189:case 109:case 173:c=-1;break;case 37:n.shiftKey?d=-1:(n.preventDefault(),_=-1);break;case 39:n.shiftKey?d=1:(n.preventDefault(),_=1);break;case 38:n.shiftKey?g=1:(n.preventDefault(),I=-1);break;case 40:n.shiftKey?g=-1:(n.preventDefault(),I=1);break;default:return}return this._rotationDisabled&&(d=0,g=0),{cameraAnimation:M=>{let E=M.getZoom();M.easeTo({duration:300,easeId:"keyboardHandler",easing:a0,zoom:c?Math.round(E)+c*(n.shiftKey?2:1):E,bearing:M.getBearing()+d*this._bearingStep,pitch:M.getPitch()+g*this._pitchStep,offset:[-_*this._panStep,-I*this._panStep],center:M.getCenter()},{originalEvent:n})}}}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 a0(f){return f*(2-f)}let Iu=4.000244140625;class xh{constructor(n,c){this._map=n,this._el=n.getCanvasContainer(),this._handler=c,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,o.bindAll(["_onTimeout"],this)}setZoomRate(n){this._defaultZoomRate=n}setWheelZoomRate(n){this._wheelZoomRate=n}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(n){this.isEnabled()||(this._enabled=!0,this._aroundCenter=n&&n.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(n){if(!this.isEnabled())return;let c=n.deltaMode===WheelEvent.DOM_DELTA_LINE?40*n.deltaY:n.deltaY,d=o.exported.now(),g=d-(this._lastWheelEventTime||0);this._lastWheelEventTime=d,c!==0&&c%Iu==0?this._type="wheel":c!==0&&Math.abs(c)<4?this._type="trackpad":g>400?(this._type=null,this._lastValue=c,this._timeout=setTimeout(this._onTimeout,40,n)):this._type||(this._type=Math.abs(g*c)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,c+=this._lastValue)),n.shiftKey&&c&&(c/=4),this._type&&(this._lastWheelEvent=n,this._delta-=c,this._active||this._start(n)),n.preventDefault()}_onTimeout(n){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(n)}_start(n){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);let c=T.mousePos(this._el,n);this._around=o.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(c)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;let n=this._map.transform;if(this._delta!==0){let M=this._type==="wheel"&&Math.abs(this._delta)>Iu?this._wheelZoomRate:this._defaultZoomRate,E=2/(1+Math.exp(-Math.abs(this._delta*M)));this._delta<0&&E!==0&&(E=1/E);let k=typeof this._targetZoom=="number"?n.zoomScale(this._targetZoom):n.scale;this._targetZoom=Math.min(n.maxZoom,Math.max(n.minZoom,n.scaleZoom(k*E))),this._type==="wheel"&&(this._startZoom=n.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let c=typeof this._targetZoom=="number"?this._targetZoom:n.zoom,d=this._startZoom,g=this._easing,_,I=!1;if(this._type==="wheel"&&d&&g){let M=Math.min((o.exported.now()-this._lastWheelEventTime)/200,1),E=g(M);_=o.number(d,c,E),M<1?this._frameId||(this._frameId=!0):I=!0}else _=c,I=!0;return this._active=!0,I&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!I,zoomDelta:_-n.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(n){let c=o.ease;if(this._prevEase){let d=this._prevEase,g=(o.exported.now()-d.start)/d.duration,_=d.easing(g+.01)-d.easing(g),I=.27/Math.sqrt(_*_+1e-4)*.01,M=Math.sqrt(.0729-I*I);c=o.bezier(I,M,.25,1)}return this._prevEase={start:o.exported.now(),duration:n,easing:c},c}reset(){this._active=!1}}class _h{constructor(n,c){this._clickZoom=n,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 bh{constructor(){this.reset()}reset(){this._active=!1}dblclick(n,c){return n.preventDefault(),{cameraAnimation:d=>{d.easeTo({duration:300,zoom:d.getZoom()+(n.shiftKey?-1:1),around:d.unproject(c)},{originalEvent:n})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class pn{constructor(){this._tap=new gh({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()}touchstart(n,c,d){this._swipePoint||(this._tapTime&&n.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?d.length>0&&(this._swipePoint=c[0],this._swipeTouch=d[0].identifier):this._tap.touchstart(n,c,d))}touchmove(n,c,d){if(this._tapTime){if(this._swipePoint){if(d[0].identifier!==this._swipeTouch)return;let g=c[0],_=g.y-this._swipePoint.y;return this._swipePoint=g,n.preventDefault(),this._active=!0,{zoomDelta:_/128}}}else this._tap.touchmove(n,c,d)}touchend(n,c,d){this._tapTime?this._swipePoint&&d.length===0&&this.reset():this._tap.touchend(n,c,d)&&(this._tapTime=n.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ts{constructor(n,c,d){this._el=n,this._mousePan=c,this._touchPan=d}enable(n){this._inertiaOptions=n||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan","mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan","mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class Np{constructor(n,c,d){this._pitchWithRotate=n.pitchWithRotate,this._mouseRotate=c,this._mousePitch=d}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 wh{constructor(n,c,d,g){this._el=n,this._touchZoom=c,this._touchRotate=d,this._tapDragZoom=g,this._rotationDisabled=!1,this._enabled=!0}enable(n){this._touchZoom.enable(n),this._rotationDisabled||this._touchRotate.enable(n),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate","mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate","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()}}let va=f=>f.zoom||f.drag||f.pitch||f.rotate;class Ih extends o.Event{}function Su(f){return f.panDelta&&f.panDelta.mag()||f.zoomDelta||f.bearingDelta||f.pitchDelta}class Zn{constructor(n,c){this._map=n,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new kp(n),this._bearingSnap=c.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(c),o.bindAll(["handleEvent","handleWindowEvent"],this);let d=this._el;this._listeners=[[d,"touchstart",{passive:!0}],[d,"touchmove",{passive:!1}],[d,"touchend",void 0],[d,"touchcancel",void 0],[d,"mousedown",void 0],[d,"mousemove",void 0],[d,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[d,"mouseover",void 0],[d,"mouseout",void 0],[d,"dblclick",void 0],[d,"click",void 0],[d,"keydown",{capture:!1}],[d,"keyup",void 0],[d,"wheel",{passive:!1}],[d,"contextmenu",void 0],[window,"blur",void 0]];for(let[g,_,I]of this._listeners)T.addEventListener(g,_,g===document?this.handleWindowEvent:this.handleEvent,I)}destroy(){for(let[n,c,d]of this._listeners)T.removeEventListener(n,c,n===document?this.handleWindowEvent:this.handleEvent,d)}_addDefaultHandlers(n){let c=this._map,d=c.getCanvasContainer();this._add("mapEvent",new ws(c,n));let g=c.boxZoom=new ga(c,n);this._add("boxZoom",g);let _=new n0,I=new bh;c.doubleClickZoom=new _h(I,_),this._add("tapZoom",_),this._add("clickZoom",I);let M=new pn;this._add("tapDragZoom",M);let E=c.touchPitch=new Dp;this._add("touchPitch",E);let k=new dt(n),D=new yh(n);c.dragRotate=new Np(n,k,D),this._add("mouseRotate",k,["mousePitch"]),this._add("mousePitch",D,["mouseRotate"]);let O=new ya(n),X=new fl(n);c.dragPan=new ts(d,O,X),this._add("mousePan",O),this._add("touchPan",X,["touchZoom","touchRotate"]);let oe=new o0,$=new vh;c.touchZoomRotate=new wh(d,$,oe,M),this._add("touchRotate",oe,["touchPan","touchZoom"]),this._add("touchZoom",$,["touchPan","touchRotate"]);let ne=c.scrollZoom=new xh(c,this);this._add("scrollZoom",ne,["mousePan"]);let me=c.keyboard=new s0;this._add("keyboard",me),this._add("blockableMapEvent",new zp(c));for(let ge of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])n.interactive&&n[ge]&&c[ge].enable(n[ge])}_add(n,c,d){this._handlers.push({handlerName:n,handler:c,allowed:d}),this._handlersById[n]=c}stop(n){if(!this._updatingCamera){for(let{handler:c}of this._handlers)c.reset();this._inertia.clear(),this._fireEvents({},{},n),this._changes=[]}}isActive(){for(let{handler:n}of this._handlers)if(n.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return Boolean(va(this._eventsInProgress))||this.isZooming()}_blockedByActive(n,c,d){for(let g in n)if(g!==d&&(!c||c.indexOf(g)<0))return!0;return!1}handleWindowEvent(n){this.handleEvent(n,`${n.type}Window`)}_getMapTouches(n){let c=[];for(let d of n)this._el.contains(d.target)&&c.push(d);return c}handleEvent(n,c){if(n.type==="blur")return void this.stop(!0);this._updatingCamera=!0;let d=n.type==="renderFrame"?void 0:n,g={needsRenderFrame:!1},_={},I={},M=n.touches,E=M?this._getMapTouches(M):void 0,k=E?T.touchPos(this._el,E):T.mousePos(this._el,n);for(let{handlerName:X,handler:oe,allowed:$}of this._handlers){if(!oe.isEnabled())continue;let ne;this._blockedByActive(I,$,X)?oe.reset():oe[c||n.type]&&(ne=oe[c||n.type](n,k,E),this.mergeHandlerResult(g,_,ne,X,d),ne&&ne.needsRenderFrame&&this._triggerRenderFrame()),(ne||oe.isActive())&&(I[X]=oe)}let D={};for(let X in this._previousActiveHandlers)I[X]||(D[X]=d);this._previousActiveHandlers=I,(Object.keys(D).length||Su(g))&&(this._changes.push([g,_,D]),this._triggerRenderFrame()),(Object.keys(I).length||Su(g))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:O}=g;O&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],O(this._map))}mergeHandlerResult(n,c,d,g,_){if(!d)return;o.extend(n,d);let I={handlerName:g,originalEvent:d.originalEvent||_};d.zoomDelta!==void 0&&(c.zoom=I),d.panDelta!==void 0&&(c.drag=I),d.pitchDelta!==void 0&&(c.pitch=I),d.bearingDelta!==void 0&&(c.rotate=I)}_applyChanges(){let n={},c={},d={};for(let[g,_,I]of this._changes)g.panDelta&&(n.panDelta=(n.panDelta||new o.pointGeometry(0,0))._add(g.panDelta)),g.zoomDelta&&(n.zoomDelta=(n.zoomDelta||0)+g.zoomDelta),g.bearingDelta&&(n.bearingDelta=(n.bearingDelta||0)+g.bearingDelta),g.pitchDelta&&(n.pitchDelta=(n.pitchDelta||0)+g.pitchDelta),g.around!==void 0&&(n.around=g.around),g.pinchAround!==void 0&&(n.pinchAround=g.pinchAround),g.noInertia&&(n.noInertia=g.noInertia),o.extend(c,_),o.extend(d,I);this._updateMapTransform(n,c,d),this._changes=[]}_updateMapTransform(n,c,d){let g=this._map,_=g.transform;if(!Su(n))return this._fireEvents(c,d,!0);let{panDelta:I,zoomDelta:M,bearingDelta:E,pitchDelta:k,around:D,pinchAround:O}=n;O!==void 0&&(D=O),g._stop(!0),D=D||g.transform.centerPoint;let X=_.pointLocation(I?D.sub(I):D);E&&(_.bearing+=E),k&&(_.pitch+=k),M&&(_.zoom+=M),_.setLocationAtPoint(X,D),this._map._update(),n.noInertia||this._inertia.record(n),this._fireEvents(c,d,!0)}_fireEvents(n,c,d){let g=va(this._eventsInProgress),_=va(n),I={};for(let D in n){let{originalEvent:O}=n[D];this._eventsInProgress[D]||(I[`${D}start`]=O),this._eventsInProgress[D]=n[D]}!g&&_&&this._fireEvent("movestart",_.originalEvent);for(let D in I)this._fireEvent(D,I[D]);_&&this._fireEvent("move",_.originalEvent);for(let D in n){let{originalEvent:O}=n[D];this._fireEvent(D,O)}let M={},E;for(let D in this._eventsInProgress){let{handlerName:O,originalEvent:X}=this._eventsInProgress[D];this._handlersById[O].isActive()||(delete this._eventsInProgress[D],E=c[O]||X,M[`${D}end`]=E)}for(let D in M)this._fireEvent(D,M[D]);let k=va(this._eventsInProgress);if(d&&(g||_)&&!k){this._updatingCamera=!0;let D=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),O=X=>X!==0&&-this._bearingSnap<X&&X<this._bearingSnap;D?(O(D.bearing||this._map.getBearing())&&(D.bearing=0),this._map.easeTo(D,{originalEvent:E})):(this._map.fire(new o.Event("moveend",{originalEvent:E})),O(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}_fireEvent(n,c){this._map.fire(new o.Event(n,c?{originalEvent:c}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(n=>{delete this._frameId,this.handleEvent(new Ih("renderFrame",{timeStamp:n})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}let Ui={extend:(f,...n)=>o.extend(f,...n),run(f){f()},logToElement(f,n=!1,c="log"){let d=window.document.getElementById(c);d&&(n&&(d.innerHTML=""),d.innerHTML+=`<br>${f}`)}};class Cu extends o.Evented{constructor(n,c){super(),this._moving=!1,this._zooming=!1,this.transform=n,this._bearingSnap=c.bearingSnap,o.bindAll(["_renderFrameCallback"],this)}getCenter(){return new o.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(n,c){return this.jumpTo({center:n},c)}panBy(n,c,d){return n=o.pointGeometry.convert(n).mult(-1),this.panTo(this.transform.center,o.extend({offset:n},c),d)}panTo(n,c,d){return this.easeTo(o.extend({center:n},c),d)}getZoom(){return this.transform.zoom}setZoom(n,c){return this.jumpTo({zoom:n},c),this}zoomTo(n,c,d){return this.easeTo(o.extend({zoom:n},c),d)}zoomIn(n,c){return this.zoomTo(this.getZoom()+1,n,c),this}zoomOut(n,c){return this.zoomTo(this.getZoom()-1,n,c),this}getBearing(){return this.transform.bearing}setBearing(n,c){return this.jumpTo({bearing:n},c),this}getPadding(){return this.transform.padding}setPadding(n,c){return this.jumpTo({padding:n},c),this}rotateTo(n,c,d){return this.easeTo(o.extend({bearing:n},c),d)}resetNorth(n,c){return this.rotateTo(0,o.extend({duration:1e3},n),c),this}resetNorthPitch(n,c){return this.easeTo(o.extend({bearing:0,pitch:0,duration:1e3},n),c),this}snapToNorth(n,c){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(n,c):this}getPitch(){return this.transform.pitch}setPitch(n,c){return this.jumpTo({pitch:n},c),this}cameraForBounds(n,c){n=o.LngLatBounds.convert(n);let d=c&&c.bearing||0;return this._cameraForBoxAndBearing(n.getNorthWest(),n.getSouthEast(),d,c)}_cameraForBoxAndBearing(n,c,d,g){let _={top:0,bottom:0,right:0,left:0};if(typeof(g=o.extend({padding:_,offset:[0,0],maxZoom:this.transform.maxZoom},g)).padding=="number"){let Pe=g.padding;g.padding={top:Pe,bottom:Pe,right:Pe,left:Pe}}g.padding=o.extend(_,g.padding);let I=this.transform,M=I.padding,E=I.project(o.LngLat.convert(n)),k=I.project(o.LngLat.convert(c)),D=E.rotate(-d*Math.PI/180),O=k.rotate(-d*Math.PI/180),X=new o.pointGeometry(Math.max(D.x,O.x),Math.max(D.y,O.y)),oe=new o.pointGeometry(Math.min(D.x,O.x),Math.min(D.y,O.y)),$=X.sub(oe),ne=(I.width-(M.left+M.right+g.padding.left+g.padding.right))/$.x,me=(I.height-(M.top+M.bottom+g.padding.top+g.padding.bottom))/$.y;if(me<0||ne<0)return void o.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.");let ge=Math.min(I.scaleZoom(I.scale*Math.min(ne,me)),g.maxZoom),we=o.pointGeometry.convert(g.offset),xe=new o.pointGeometry((g.padding.left-g.padding.right)/2,(g.padding.top-g.padding.bottom)/2).rotate(d*Math.PI/180),Ne=we.add(xe).mult(I.scale/I.zoomScale(ge));return{center:I.unproject(E.add(k).div(2).sub(Ne)),zoom:ge,bearing:d}}fitBounds(n,c,d){return this._fitInternal(this.cameraForBounds(n,c),c,d)}fitScreenCoordinates(n,c,d,g,_){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(o.pointGeometry.convert(n)),this.transform.pointLocation(o.pointGeometry.convert(c)),d,g),g,_)}_fitInternal(n,c,d){return n?(delete(c=o.extend(n,c)).padding,c.linear?this.easeTo(c,d):this.flyTo(c,d)):this}jumpTo(n,c){this.stop();let d=this.transform,g=!1,_=!1,I=!1;return"zoom"in n&&d.zoom!==+n.zoom&&(g=!0,d.zoom=+n.zoom),n.center!==void 0&&(d.center=o.LngLat.convert(n.center)),"bearing"in n&&d.bearing!==+n.bearing&&(_=!0,d.bearing=+n.bearing),"pitch"in n&&d.pitch!==+n.pitch&&(I=!0,d.pitch=+n.pitch),n.padding==null||d.isPaddingEqual(n.padding)||(d.padding=n.padding),this.fire(new o.Event("movestart",c)).fire(new o.Event("move",c)),g&&this.fire(new o.Event("zoomstart",c)).fire(new o.Event("zoom",c)).fire(new o.Event("zoomend",c)),_&&this.fire(new o.Event("rotatestart",c)).fire(new o.Event("rotate",c)).fire(new o.Event("rotateend",c)),I&&this.fire(new o.Event("pitchstart",c)).fire(new o.Event("pitch",c)).fire(new o.Event("pitchend",c)),this.fire(new o.Event("moveend",c))}easeTo(n,c){this._stop(!1,n.easeId),((n=o.extend({offset:[0,0],duration:500,easing:o.ease},n)).animate===!1||!n.essential&&o.exported.prefersReducedMotion)&&(n.duration=0);let d=this.transform,g=this.getZoom(),_=this.getBearing(),I=this.getPitch(),M=this.getPadding(),E="zoom"in n?+n.zoom:g,k="bearing"in n?this._normalizeBearing(n.bearing,_):_,D="pitch"in n?+n.pitch:I,O="padding"in n?n.padding:d.padding,X=o.pointGeometry.convert(n.offset),oe=d.centerPoint.add(X),$=d.pointLocation(oe),ne=o.LngLat.convert(n.center||$);this._normalizeCenter(ne);let me=d.project($),ge=d.project(ne).sub(me),we=d.zoomScale(E-g),xe,Ne;n.around&&(xe=o.LngLat.convert(n.around),Ne=d.locationPoint(xe));let Pe={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||E!==g,this._rotating=this._rotating||_!==k,this._pitching=this._pitching||D!==I,this._padding=!d.isPaddingEqual(O),this._easeId=n.easeId,this._prepareEase(c,n.noMoveStart,Pe),this._ease(ze=>{if(this._zooming&&(d.zoom=o.number(g,E,ze)),this._rotating&&(d.bearing=o.number(_,k,ze)),this._pitching&&(d.pitch=o.number(I,D,ze)),this._padding&&(d.interpolatePadding(M,O,ze),oe=d.centerPoint.add(X)),xe)d.setLocationAtPoint(xe,Ne);else{let je=d.zoomScale(d.zoom-g),Ke=E>g?Math.min(2,we):Math.max(.5,we),De=Math.pow(Ke,1-ze),mt=d.unproject(me.add(ge.mult(ze*De)).mult(je));d.setLocationAtPoint(d.renderWorldCopies?mt.wrap():mt,oe)}this._fireMoveEvents(c)},ze=>{this._afterEase(c,ze)},n),this}_prepareEase(n,c,d={}){this._moving=!0,c||d.moving||this.fire(new o.Event("movestart",n)),this._zooming&&!d.zooming&&this.fire(new o.Event("zoomstart",n)),this._rotating&&!d.rotating&&this.fire(new o.Event("rotatestart",n)),this._pitching&&!d.pitching&&this.fire(new o.Event("pitchstart",n))}_fireMoveEvents(n){this.fire(new o.Event("move",n)),this._zooming&&this.fire(new o.Event("zoom",n)),this._rotating&&this.fire(new o.Event("rotate",n)),this._pitching&&this.fire(new o.Event("pitch",n))}_afterEase(n,c){if(this._easeId&&c&&this._easeId===c)return;delete this._easeId;let d=this._zooming,g=this._rotating,_=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,d&&this.fire(new o.Event("zoomend",n)),g&&this.fire(new o.Event("rotateend",n)),_&&this.fire(new o.Event("pitchend",n)),this.fire(new o.Event("moveend",n))}flyTo(n,c){if(!n.essential&&o.exported.prefersReducedMotion){let Qt=o.pick(n,["center","zoom","bearing","pitch","around"]);return this.jumpTo(Qt,c)}this.stop(),n=o.extend({offset:[0,0],speed:1.2,curve:1.42,easing:o.ease},n);let d=this.transform,g=this.getZoom(),_=this.getBearing(),I=this.getPitch(),M=this.getPadding(),E="zoom"in n?o.clamp(+n.zoom,d.minZoom,d.maxZoom):g,k="bearing"in n?this._normalizeBearing(n.bearing,_):_,D="pitch"in n?+n.pitch:I,O="padding"in n?n.padding:d.padding,X=d.zoomScale(E-g),oe=o.pointGeometry.convert(n.offset),$=d.centerPoint.add(oe),ne=d.pointLocation($),me=o.LngLat.convert(n.center||ne);this._normalizeCenter(me);let ge=d.project(ne),we=d.project(me).sub(ge),xe=n.curve,Ne=Math.max(d.width,d.height),Pe=Ne/X,ze=we.mag();if("minZoom"in n){let Qt=o.clamp(Math.min(n.minZoom,g,E),d.minZoom,d.maxZoom),Qi=Ne/d.zoomScale(Qt-g);xe=Math.sqrt(Qi/ze*2)}let je=xe*xe;function Ke(Qt){let Qi=(Pe*Pe-Ne*Ne+(Qt?-1:1)*je*je*ze*ze)/(2*(Qt?Pe:Ne)*je*ze);return Math.log(Math.sqrt(Qi*Qi+1)-Qi)}function De(Qt){return(Math.exp(Qt)-Math.exp(-Qt))/2}function mt(Qt){return(Math.exp(Qt)+Math.exp(-Qt))/2}let rt=Ke(0),Pt=function(Qt){return mt(rt)/mt(rt+xe*Qt)},ei=function(Qt){return Ne*((mt(rt)*(De(Qi=rt+xe*Qt)/mt(Qi))-De(rt))/je)/ze;var Qi},Zt=(Ke(1)-rt)/xe;if(Math.abs(ze)<1e-6||!isFinite(Zt)){if(Math.abs(Ne-Pe)<1e-6)return this.easeTo(n,c);let Qt=Pe<Ne?-1:1;Zt=Math.abs(Math.log(Pe/Ne))/xe,ei=function(){return 0},Pt=function(Qi){return Math.exp(Qt*xe*Qi)}}return n.duration="duration"in n?+n.duration:1e3*Zt/("screenSpeed"in n?+n.screenSpeed/xe:+n.speed),n.maxDuration&&n.duration>n.maxDuration&&(n.duration=0),this._zooming=!0,this._rotating=_!==k,this._pitching=D!==I,this._padding=!d.isPaddingEqual(O),this._prepareEase(c,!1),this._ease(Qt=>{let Qi=Qt*Zt,zt=1/Pt(Qi);d.zoom=Qt===1?E:g+d.scaleZoom(zt),this._rotating&&(d.bearing=o.number(_,k,Qt)),this._pitching&&(d.pitch=o.number(I,D,Qt)),this._padding&&(d.interpolatePadding(M,O,Qt),$=d.centerPoint.add(oe));let ai=Qt===1?me:d.unproject(ge.add(we.mult(ei(Qi))).mult(zt));d.setLocationAtPoint(d.renderWorldCopies?ai.wrap():ai,$),this._fireMoveEvents(c)},()=>this._afterEase(c),n),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(n,c){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let d=this._onEaseEnd;delete this._onEaseEnd,d.call(this,c)}if(!n){let d=this.handlers;d&&d.stop(!1)}return this}_ease(n,c,d){d.animate===!1||d.duration===0?(n(1),c()):(this._easeStart=o.exported.now(),this._easeOptions=d,this._onEaseFrame=n,this._onEaseEnd=c,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){let n=Math.min((o.exported.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(n)),n<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(n,c){n=o.wrap(n,-180,180);let d=Math.abs(n-c);return Math.abs(n-360-c)<d&&(n-=360),Math.abs(n+360-c)<d&&(n+=360),n}_normalizeCenter(n){let c=this.transform;if(!c.renderWorldCopies||c.lngRange)return;let d=n.lng-c.center.lng;n.lng+=d>180?-360:d<-180?360:0}}class Mu{constructor(n={}){this.options=n,o.bindAll(["_toggleAttribution","_updateData","_updateCompact","_updateCompactMinimize"],this)}getDefaultPosition(){return"bottom-right"}onAdd(n){return this._map=n,this._compact=this.options&&this.options.compact,this._container=T.create("details","maplibregl-ctrl maplibregl-ctrl-attrib mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=T.create("summary","maplibregl-ctrl-attrib-button mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=T.create("div","maplibregl-ctrl-attrib-inner mapboxgl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){T.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(n,c){let d=this._map._getUIString(`AttributionControl.${c}`);n.title=d,n.setAttribute("aria-label",d)}_toggleAttribution(){this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show","mapboxgl-compact-show")):(this._container.classList.add("maplibregl-compact-show","mapboxgl-compact-show"),this._container.removeAttribute("open")))}_updateData(n){!n||n.sourceDataType!=="metadata"&&n.sourceDataType!=="visibility"&&n.dataType!=="style"||this._updateAttributions()}_updateAttributions(){if(!this._map.style)return;let n=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?n=n.concat(this.options.customAttribution.map(g=>typeof g!="string"?"":g)):typeof this.options.customAttribution=="string"&&n.push(this.options.customAttribution)),this._map.style.stylesheet){let g=this._map.style.stylesheet;this.styleOwner=g.owner,this.styleId=g.id}let c=this._map.style.sourceCaches;for(let g in c){let _=c[g];if(_.used){let I=_.getSource();I.attribution&&n.indexOf(I.attribution)<0&&n.push(I.attribution)}}n=n.filter(g=>String(g).trim()),n.sort((g,_)=>g.length-_.length),n=n.filter((g,_)=>{for(let I=_+1;I<n.length;I++)if(n[I].indexOf(g)>=0)return!1;return!0});let d=n.join(" | ");d!==this._attribHTML&&(this._attribHTML=d,n.length?(this._innerContainer.innerHTML=d,this._container.classList.remove("maplibregl-attrib-empty","mapboxgl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty","mapboxgl-attrib-empty"),this._updateCompact(),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","mapboxgl-compact","maplibregl-compact-show","mapboxgl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show","mapboxgl-compact","mapboxgl-compact-show"))}_updateCompactMinimize(){this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show","mapboxgl-compact-show")}}class Sh{constructor(n={}){this.options=n,o.bindAll(["_updateCompact"],this)}getDefaultPosition(){return"bottom-left"}onAdd(n){this._map=n,this._compact=this.options&&this.options.compact,this._container=T.create("div","maplibregl-ctrl mapboxgl-ctrl");let c=T.create("a","maplibregl-ctrl-logo mapboxgl-ctrl-logo");return c.target="_blank",c.rel="noopener nofollow",c.href="https://maplibre.org/",c.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),c.setAttribute("rel","noopener nofollow"),this._container.appendChild(c),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){T.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}_updateCompact(){let n=this._container.children;if(n.length){let c=n[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&c.classList.add("maplibregl-compact","mapboxgl-compact"):c.classList.remove("maplibregl-compact","mapboxgl-compact")}}}class Fp{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(n){let c=++this._id;return this._queue.push({callback:n,id:c,cancelled:!1}),c}remove(n){let c=this._currentlyRunning,d=c?this._queue.concat(c):this._queue;for(let g of d)if(g.id===n)return void(g.cancelled=!0)}run(n=0){let c=this._currentlyRunning=this._queue;this._queue=[];for(let d of c)if(!d.cancelled&&(d.callback(n),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}let Op={"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","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm"},l0={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,maplibreLogo:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,fadeDuration:300,crossSourceCollisions:!0},_o={showCompass:!0,showZoom:!0,visualizePitch:!1};class Eu{constructor(n,c,d=!1){this._clickTolerance=10,this.element=c,this.mouseRotate=new dt({clickTolerance:n.dragRotate._mouseRotate._clickTolerance}),this.map=n,d&&(this.mousePitch=new yh({clickTolerance:n.dragRotate._mousePitch._clickTolerance})),o.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),T.addEventListener(c,"mousedown",this.mousedown),T.addEventListener(c,"touchstart",this.touchstart,{passive:!1}),T.addEventListener(c,"touchmove",this.touchmove),T.addEventListener(c,"touchend",this.touchend),T.addEventListener(c,"touchcancel",this.reset)}down(n,c){this.mouseRotate.mousedown(n,c),this.mousePitch&&this.mousePitch.mousedown(n,c),T.disableDrag()}move(n,c){let d=this.map,g=this.mouseRotate.mousemoveWindow(n,c);if(g&&g.bearingDelta&&d.setBearing(d.getBearing()+g.bearingDelta),this.mousePitch){let _=this.mousePitch.mousemoveWindow(n,c);_&&_.pitchDelta&&d.setPitch(d.getPitch()+_.pitchDelta)}}off(){let n=this.element;T.removeEventListener(n,"mousedown",this.mousedown),T.removeEventListener(n,"touchstart",this.touchstart,{passive:!1}),T.removeEventListener(n,"touchmove",this.touchmove),T.removeEventListener(n,"touchend",this.touchend),T.removeEventListener(n,"touchcancel",this.reset),this.offTemp()}offTemp(){T.enableDrag(),T.removeEventListener(window,"mousemove",this.mousemove),T.removeEventListener(window,"mouseup",this.mouseup)}mousedown(n){this.down(o.extend({},n,{ctrlKey:!0,preventDefault:()=>n.preventDefault()}),T.mousePos(this.element,n)),T.addEventListener(window,"mousemove",this.mousemove),T.addEventListener(window,"mouseup",this.mouseup)}mousemove(n){this.move(n,T.mousePos(this.element,n))}mouseup(n){this.mouseRotate.mouseupWindow(n),this.mousePitch&&this.mousePitch.mouseupWindow(n),this.offTemp()}touchstart(n){n.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=T.touchPos(this.element,n.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>n.preventDefault()},this._startPos))}touchmove(n){n.targetTouches.length!==1?this.reset():(this._lastPos=T.touchPos(this.element,n.targetTouches)[0],this.move({preventDefault:()=>n.preventDefault()},this._lastPos))}touchend(n){n.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()}reset(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()}}function vt(f,n,c){if(f=new o.LngLat(f.lng,f.lat),n){let d=new o.LngLat(f.lng-360,f.lat),g=new o.LngLat(f.lng+360,f.lat),_=c.locationPoint(f).distSqr(n);c.locationPoint(d).distSqr(n)<_?f=d:c.locationPoint(g).distSqr(n)<_&&(f=g)}for(;Math.abs(f.lng-c.center.lng)>180;){let d=c.locationPoint(f);if(d.x>=0&&d.y>=0&&d.x<=c.width&&d.y<=c.height)break;f.lng>c.center.lng?f.lng-=360:f.lng+=360}return f}let Mt={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function yl(f,n,c){let d=f.classList;for(let g in Mt)d.remove(`maplibregl-${c}-anchor-${g}`,`mapboxgl-${c}-anchor-${g}`);d.add(`maplibregl-${c}-anchor-${n}`,`mapboxgl-${c}-anchor-${n}`)}class vl extends o.Evented{constructor(n,c){if(super(),(n instanceof HTMLElement||c)&&(n=o.extend({element:n},c)),o.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=n&&n.anchor||"center",this._color=n&&n.color||"#3FB1CE",this._scale=n&&n.scale||1,this._draggable=n&&n.draggable||!1,this._clickTolerance=n&&n.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=n&&n.rotation||0,this._rotationAlignment=n&&n.rotationAlignment||"auto",this._pitchAlignment=n&&n.pitchAlignment&&n.pitchAlignment!=="auto"?n.pitchAlignment:this._rotationAlignment,n&&n.element)this._element=n.element,this._offset=o.pointGeometry.convert(n&&n.offset||[0,0]);else{this._defaultMarker=!0,this._element=T.create("div"),this._element.setAttribute("aria-label","Map marker");let d=T.createNS("http://www.w3.org/2000/svg","svg"),g=41,_=27;d.setAttributeNS(null,"display","block"),d.setAttributeNS(null,"height",`${g}px`),d.setAttributeNS(null,"width",`${_}px`),d.setAttributeNS(null,"viewBox",`0 0 ${_} ${g}`);let I=T.createNS("http://www.w3.org/2000/svg","g");I.setAttributeNS(null,"stroke","none"),I.setAttributeNS(null,"stroke-width","1"),I.setAttributeNS(null,"fill","none"),I.setAttributeNS(null,"fill-rule","evenodd");let M=T.createNS("http://www.w3.org/2000/svg","g");M.setAttributeNS(null,"fill-rule","nonzero");let E=T.createNS("http://www.w3.org/2000/svg","g");E.setAttributeNS(null,"transform","translate(3.0, 29.0)"),E.setAttributeNS(null,"fill","#000000");let k=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(let we of k){let xe=T.createNS("http://www.w3.org/2000/svg","ellipse");xe.setAttributeNS(null,"opacity","0.04"),xe.setAttributeNS(null,"cx","10.5"),xe.setAttributeNS(null,"cy","5.80029008"),xe.setAttributeNS(null,"rx",we.rx),xe.setAttributeNS(null,"ry",we.ry),E.appendChild(xe)}let D=T.createNS("http://www.w3.org/2000/svg","g");D.setAttributeNS(null,"fill",this._color);let O=T.createNS("http://www.w3.org/2000/svg","path");O.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),D.appendChild(O);let X=T.createNS("http://www.w3.org/2000/svg","g");X.setAttributeNS(null,"opacity","0.25"),X.setAttributeNS(null,"fill","#000000");let oe=T.createNS("http://www.w3.org/2000/svg","path");oe.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),X.appendChild(oe);let $=T.createNS("http://www.w3.org/2000/svg","g");$.setAttributeNS(null,"transform","translate(6.0, 7.0)"),$.setAttributeNS(null,"fill","#FFFFFF");let ne=T.createNS("http://www.w3.org/2000/svg","g");ne.setAttributeNS(null,"transform","translate(8.0, 8.0)");let me=T.createNS("http://www.w3.org/2000/svg","circle");me.setAttributeNS(null,"fill","#000000"),me.setAttributeNS(null,"opacity","0.25"),me.setAttributeNS(null,"cx","5.5"),me.setAttributeNS(null,"cy","5.5"),me.setAttributeNS(null,"r","5.4999962");let ge=T.createNS("http://www.w3.org/2000/svg","circle");ge.setAttributeNS(null,"fill","#FFFFFF"),ge.setAttributeNS(null,"cx","5.5"),ge.setAttributeNS(null,"cy","5.5"),ge.setAttributeNS(null,"r","5.4999962"),ne.appendChild(me),ne.appendChild(ge),M.appendChild(E),M.appendChild(D),M.appendChild(X),M.appendChild($),M.appendChild(ne),d.appendChild(M),d.setAttributeNS(null,"height",g*this._scale+"px"),d.setAttributeNS(null,"width",_*this._scale+"px"),this._element.appendChild(d),this._offset=o.pointGeometry.convert(n&&n.offset||[0,-14])}this._element.classList.add("maplibregl-marker","mapboxgl-marker"),this._element.addEventListener("dragstart",d=>{d.preventDefault()}),this._element.addEventListener("mousedown",d=>{d.preventDefault()}),yl(this._element,this._anchor,"marker"),this._popup=null}addTo(n){return this.remove(),this._map=n,n.getCanvasContainer().appendChild(this._element),n.on("move",this._update),n.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),T.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(n){return this._lngLat=o.LngLat.convert(n),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(n){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),n){if(!("offset"in n.options)){let g=Math.sqrt(Math.pow(13.5,2)/2);n.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[g,-1*(38.1-13.5+g)],"bottom-right":[-g,-1*(38.1-13.5+g)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=n,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}_onKeyPress(n){let c=n.code,d=n.charCode||n.keyCode;c!=="Space"&&c!=="Enter"&&d!==32&&d!==13||this.togglePopup()}_onMapClick(n){let c=n.originalEvent.target,d=this._element;this._popup&&(c===d||d.contains(c))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){let n=this._popup;return n?(n.isOpen()?n.remove():n.addTo(this._map),this):this}_update(n){if(!this._map)return;this._map.transform.renderWorldCopies&&(this._lngLat=vt(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);let c="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?c=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(c=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let d="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?d="rotateX(0deg)":this._pitchAlignment==="map"&&(d=`rotateX(${this._map.getPitch()}deg)`),n&&n.type!=="moveend"||(this._pos=this._pos.round()),T.setTransform(this._element,`${Mt[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${d} ${c}`)}getOffset(){return this._offset}setOffset(n){return this._offset=o.pointGeometry.convert(n),this._update(),this}_onMove(n){if(!this._isDragging){let c=this._clickTolerance||this._map._clickTolerance;this._isDragging=n.point.dist(this._pointerdownPos)>=c}this._isDragging&&(this._pos=n.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new o.Event("dragstart"))),this.fire(new o.Event("drag")))}_onUp(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new o.Event("dragend")),this._state="inactive"}_addDragHandler(n){this._element.contains(n.originalEvent.target)&&(n.preventDefault(),this._positionDelta=n.point.sub(this._pos).add(this._offset),this._pointerdownPos=n.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))}setDraggable(n){return this._draggable=!!n,this._map&&(n?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(n){return this._rotation=n||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(n){return this._rotationAlignment=n||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(n){return this._pitchAlignment=n&&n!=="auto"?n:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}}let Ch={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Tr,Ms=0,fn=!1,u0={maxWidth:100,unit:"metric"};function xl(f,n,c){let d=c&&c.maxWidth||100,g=f._container.clientHeight/2,_=f.unproject([0,g]),I=f.unproject([d,g]),M=_.distanceTo(I);if(c&&c.unit==="imperial"){let E=3.2808*M;E>5280?Oi(n,d,E/5280,f._getUIString("ScaleControl.Miles")):Oi(n,d,E,f._getUIString("ScaleControl.Feet"))}else c&&c.unit==="nautical"?Oi(n,d,M/1852,f._getUIString("ScaleControl.NauticalMiles")):M>=1e3?Oi(n,d,M/1e3,f._getUIString("ScaleControl.Kilometers")):Oi(n,d,M,f._getUIString("ScaleControl.Meters"))}function Oi(f,n,c,d){let g=function(_){let I=Math.pow(10,`${Math.floor(_)}`.length-1),M=_/I;return M=M>=10?10:M>=5?5:M>=3?3:M>=2?2:M>=1?1:function(E){let k=Math.pow(10,Math.ceil(-Math.log(E)/Math.LN10));return Math.round(E*k)/k}(M),I*M}(c);f.style.width=n*(g/c)+"px",f.innerHTML=`${g} ${d}`}let Ar={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Gp=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function xa(f){if(f){if(typeof f=="number"){let n=Math.round(Math.sqrt(.5*Math.pow(f,2)));return{center:new o.pointGeometry(0,0),top:new o.pointGeometry(0,f),"top-left":new o.pointGeometry(n,n),"top-right":new o.pointGeometry(-n,n),bottom:new o.pointGeometry(0,-f),"bottom-left":new o.pointGeometry(n,-n),"bottom-right":new o.pointGeometry(-n,-n),left:new o.pointGeometry(f,0),right:new o.pointGeometry(-f,0)}}if(f instanceof o.pointGeometry||Array.isArray(f)){let n=o.pointGeometry.convert(f);return{center:n,top:n,"top-left":n,"top-right":n,bottom:n,"bottom-left":n,"bottom-right":n,left:n,right:n}}return{center:o.pointGeometry.convert(f.center||[0,0]),top:o.pointGeometry.convert(f.top||[0,0]),"top-left":o.pointGeometry.convert(f["top-left"]||[0,0]),"top-right":o.pointGeometry.convert(f["top-right"]||[0,0]),bottom:o.pointGeometry.convert(f.bottom||[0,0]),"bottom-left":o.pointGeometry.convert(f["bottom-left"]||[0,0]),"bottom-right":o.pointGeometry.convert(f["bottom-right"]||[0,0]),left:o.pointGeometry.convert(f.left||[0,0]),right:o.pointGeometry.convert(f.right||[0,0])}}return xa(new o.pointGeometry(0,0))}let _l={supported:m,setRTLTextPlugin:o.setRTLTextPlugin,getRTLTextPluginStatus:o.getRTLTextPluginStatus,Map:class extends Cu{constructor(f){var n;if(o.PerformanceUtils.mark(o.PerformanceMarkers.create),(f=o.extend({},l0,f)).minZoom!=null&&f.maxZoom!=null&&f.minZoom>f.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(f.minPitch!=null&&f.maxPitch!=null&&f.minPitch>f.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(f.minPitch!=null&&f.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(f.maxPitch!=null&&f.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new cl(f.minZoom,f.maxZoom,f.minPitch,f.maxPitch,f.renderWorldCopies),{bearingSnap:f.bearingSnap}),this._interactive=f.interactive,this._maxTileCacheSize=f.maxTileCacheSize,this._failIfMajorPerformanceCaveat=f.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=f.preserveDrawingBuffer,this._antialias=f.antialias,this._trackResize=f.trackResize,this._bearingSnap=f.bearingSnap,this._refreshExpiredTiles=f.refreshExpiredTiles,this._fadeDuration=f.fadeDuration,this._crossSourceCollisions=f.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=f.collectResourceTiming,this._renderTaskQueue=new Fp,this._controls=[],this._mapId=o.uniqueId(),this._locale=o.extend({},Op,f.locale),this._clickTolerance=f.clickTolerance,this._pixelRatio=(n=f.pixelRatio)!==null&&n!==void 0?n:devicePixelRatio,this._requestManager=new B(f.transformRequest),typeof f.container=="string"){if(this._container=document.getElementById(f.container),!this._container)throw new Error(`Container '${f.container}' not found.`)}else{if(!(f.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=f.container}if(f.maxBounds&&this.setMaxBounds(f.maxBounds),o.bindAll(["_onWindowOnline","_onWindowResize","_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)),typeof window<"u"&&(addEventListener("online",this._onWindowOnline,!1),addEventListener("resize",this._onWindowResize,!1),addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new Zn(this,f),this._hash=f.hash&&new Ep(typeof f.hash=="string"&&f.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:f.center,zoom:f.zoom,bearing:f.bearing,pitch:f.pitch}),f.bounds&&(this.resize(),this.fitBounds(f.bounds,o.extend({},f.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=f.localIdeographFontFamily,f.style&&this.setStyle(f.style,{localIdeographFontFamily:f.localIdeographFontFamily}),f.attributionControl&&this.addControl(new Mu({customAttribution:f.customAttribution})),f.maplibreLogo&&this.addControl(new Sh,f.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",c=>{this._update(c.dataType==="style"),this.fire(new o.Event(`${c.dataType}data`,c))}),this.on("dataloading",c=>{this.fire(new o.Event(`${c.dataType}dataloading`,c))}),this.on("dataabort",c=>{this.fire(new o.Event("sourcedataabort",c))})}_getMapId(){return this._mapId}addControl(f,n){if(n===void 0&&(n=f.getDefaultPosition?f.getDefaultPosition():"top-right"),!f||!f.onAdd)return this.fire(new o.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let c=f.onAdd(this);this._controls.push(f);let d=this._controlPositions[n];return n.indexOf("bottom")!==-1?d.insertBefore(c,d.firstChild):d.appendChild(c),this}removeControl(f){if(!f||!f.onRemove)return this.fire(new o.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let n=this._controls.indexOf(f);return n>-1&&this._controls.splice(n,1),f.onRemove(this),this}hasControl(f){return this._controls.indexOf(f)>-1}resize(f){let n=this._containerDimensions(),c=n[0],d=n[1];this._resizeCanvas(c,d,this.getPixelRatio()),this.transform.resize(c,d),this.painter.resize(c,d,this.getPixelRatio());let g=!this._moving;return g&&(this.stop(),this.fire(new o.Event("movestart",f)).fire(new o.Event("move",f))),this.fire(new o.Event("resize",f)),g&&this.fire(new o.Event("moveend",f)),this}getPixelRatio(){return this._pixelRatio}setPixelRatio(f){let[n,c]=this._containerDimensions();this._pixelRatio=f,this._resizeCanvas(n,c,f),this.painter.resize(n,c,f)}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(f){return this.transform.setMaxBounds(o.LngLatBounds.convert(f)),this._update()}setMinZoom(f){if((f=f??-2)>=-2&&f<=this.transform.maxZoom)return this.transform.minZoom=f,this._update(),this.getZoom()<f&&this.setZoom(f),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(f){if((f=f??22)>=this.transform.minZoom)return this.transform.maxZoom=f,this._update(),this.getZoom()>f&&this.setZoom(f),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(f){if((f=f??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(f>=0&&f<=this.transform.maxPitch)return this.transform.minPitch=f,this._update(),this.getPitch()<f&&this.setPitch(f),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(f){if((f=f??60)>85)throw new Error("maxPitch must be less than or equal to 85");if(f>=this.transform.minPitch)return this.transform.maxPitch=f,this._update(),this.getPitch()>f&&this.setPitch(f),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(f){return this.transform.renderWorldCopies=f,this._update()}project(f){return this.transform.locationPoint(o.LngLat.convert(f))}unproject(f){return this.transform.pointLocation(o.pointGeometry.convert(f))}isMoving(){return this._moving||this.handlers.isMoving()}isZooming(){return this._zooming||this.handlers.isZooming()}isRotating(){return this._rotating||this.handlers.isRotating()}_createDelegatedListener(f,n,c){if(f==="mouseenter"||f==="mouseover"){let d=!1;return{layer:n,listener:c,delegates:{mousemove:_=>{let I=this.getLayer(n)?this.queryRenderedFeatures(_.point,{layers:[n]}):[];I.length?d||(d=!0,c.call(this,new En(f,this,_.originalEvent,{features:I}))):d=!1},mouseout:()=>{d=!1}}}}if(f==="mouseleave"||f==="mouseout"){let d=!1;return{layer:n,listener:c,delegates:{mousemove:I=>{(this.getLayer(n)?this.queryRenderedFeatures(I.point,{layers:[n]}):[]).length?d=!0:d&&(d=!1,c.call(this,new En(f,this,I.originalEvent)))},mouseout:I=>{d&&(d=!1,c.call(this,new En(f,this,I.originalEvent)))}}}}{let d=g=>{let _=this.getLayer(n)?this.queryRenderedFeatures(g.point,{layers:[n]}):[];_.length&&(g.features=_,c.call(this,g),delete g.features)};return{layer:n,listener:c,delegates:{[f]:d}}}}on(f,n,c){if(c===void 0)return super.on(f,n);let d=this._createDelegatedListener(f,n,c);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[f]=this._delegatedListeners[f]||[],this._delegatedListeners[f].push(d);for(let g in d.delegates)this.on(g,d.delegates[g]);return this}once(f,n,c){if(c===void 0)return super.once(f,n);let d=this._createDelegatedListener(f,n,c);for(let g in d.delegates)this.once(g,d.delegates[g]);return this}off(f,n,c){return c===void 0?super.off(f,n):(this._delegatedListeners&&this._delegatedListeners[f]&&(d=>{let g=this._delegatedListeners[f];for(let _=0;_<g.length;_++){let I=g[_];if(I.layer===n&&I.listener===c){for(let M in I.delegates)this.off(M,I.delegates[M]);return g.splice(_,1),this}}})(),this)}queryRenderedFeatures(f,n){if(!this.style)return[];let c;if(n!==void 0||f===void 0||f instanceof o.pointGeometry||Array.isArray(f)||(n=f,f=void 0),n=n||{},(f=f||[[0,0],[this.transform.width,this.transform.height]])instanceof o.pointGeometry||typeof f[0]=="number")c=[o.pointGeometry.convert(f)];else{let d=o.pointGeometry.convert(f[0]),g=o.pointGeometry.convert(f[1]);c=[d,new o.pointGeometry(g.x,d.y),g,new o.pointGeometry(d.x,g.y),d]}return this.style.queryRenderedFeatures(c,n,this.transform)}querySourceFeatures(f,n){return this.style.querySourceFeatures(f,n)}setStyle(f,n){return(n=o.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},n)).diff!==!1&&n.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&f?(this._diffStyle(f,n),this):(this._localIdeographFontFamily=n.localIdeographFontFamily,this._updateStyle(f,n))}setTransformRequest(f){return this._requestManager.setTransformRequest(f),this}_getUIString(f){let n=this._locale[f];if(n==null)throw new Error(`Missing UI string '${f}'`);return n}_updateStyle(f,n){return this.style&&(this.style.setEventedParent(null),this.style._remove()),f?(this.style=new Fr(this,n||{}),this.style.setEventedParent(this,{style:this.style}),typeof f=="string"?this.style.loadURL(f):this.style.loadJSON(f),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Fr(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(f,n){if(typeof f=="string"){let c=this._requestManager.transformRequest(f,o.ResourceType.Style);o.getJSON(c,(d,g)=>{d?this.fire(new o.ErrorEvent(d)):g&&this._updateDiff(g,n)})}else typeof f=="object"&&this._updateDiff(f,n)}_updateDiff(f,n){try{this.style.setState(f)&&this._update(!0)}catch(c){o.warnOnce(`Unable to perform style diff: ${c.message||c.error||c}. Rebuilding the style from scratch.`),this._updateStyle(f,n)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():o.warnOnce("There is no style added to the map.")}addSource(f,n){return this._lazyInitEmptyStyle(),this.style.addSource(f,n),this._update(!0)}isSourceLoaded(f){let n=this.style&&this.style.sourceCaches[f];if(n!==void 0)return n.loaded();this.fire(new o.ErrorEvent(new Error(`There is no source with ID '${f}'`)))}areTilesLoaded(){let f=this.style&&this.style.sourceCaches;for(let n in f){let c=f[n]._tiles;for(let d in c){let g=c[d];if(g.state!=="loaded"&&g.state!=="errored")return!1}}return!0}addSourceType(f,n,c){return this._lazyInitEmptyStyle(),this.style.addSourceType(f,n,c)}removeSource(f){return this.style.removeSource(f),this._update(!0)}getSource(f){return this.style.getSource(f)}addImage(f,n,{pixelRatio:c=1,sdf:d=!1,stretchX:g,stretchY:_,content:I}={}){if(this._lazyInitEmptyStyle(),n instanceof HTMLImageElement||o.isImageBitmap(n)){let{width:M,height:E,data:k}=o.exported.getImageData(n);this.style.addImage(f,{data:new o.RGBAImage({width:M,height:E},k),pixelRatio:c,stretchX:g,stretchY:_,content:I,sdf:d,version:0})}else{if(n.width===void 0||n.height===void 0)return this.fire(new o.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`")));{let{width:M,height:E,data:k}=n,D=n;this.style.addImage(f,{data:new o.RGBAImage({width:M,height:E},new Uint8Array(k)),pixelRatio:c,stretchX:g,stretchY:_,content:I,sdf:d,version:0,userImage:D}),D.onAdd&&D.onAdd(this,f)}}}updateImage(f,n){let c=this.style.getImage(f);if(!c)return this.fire(new o.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let d=n instanceof HTMLImageElement||o.isImageBitmap(n)?o.exported.getImageData(n):n,{width:g,height:_,data:I}=d;if(g===void 0||_===void 0)return this.fire(new o.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`")));if(g!==c.data.width||_!==c.data.height)return this.fire(new o.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image")));let M=!(n instanceof HTMLImageElement||o.isImageBitmap(n));c.data.replace(I,M),this.style.updateImage(f,c)}hasImage(f){return f?!!this.style.getImage(f):(this.fire(new o.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(f){this.style.removeImage(f)}loadImage(f,n){o.getImage(this._requestManager.transformRequest(f,o.ResourceType.Image),n)}listImages(){return this.style.listImages()}addLayer(f,n){return this._lazyInitEmptyStyle(),this.style.addLayer(f,n),this._update(!0)}moveLayer(f,n){return this.style.moveLayer(f,n),this._update(!0)}removeLayer(f){return this.style.removeLayer(f),this._update(!0)}getLayer(f){return this.style.getLayer(f)}setLayerZoomRange(f,n,c){return this.style.setLayerZoomRange(f,n,c),this._update(!0)}setFilter(f,n,c={}){return this.style.setFilter(f,n,c),this._update(!0)}getFilter(f){return this.style.getFilter(f)}setPaintProperty(f,n,c,d={}){return this.style.setPaintProperty(f,n,c,d),this._update(!0)}getPaintProperty(f,n){return this.style.getPaintProperty(f,n)}setLayoutProperty(f,n,c,d={}){return this.style.setLayoutProperty(f,n,c,d),this._update(!0)}getLayoutProperty(f,n){return this.style.getLayoutProperty(f,n)}setLight(f,n={}){return this._lazyInitEmptyStyle(),this.style.setLight(f,n),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(f,n){return this.style.setFeatureState(f,n),this._update()}removeFeatureState(f,n){return this.style.removeFeatureState(f,n),this._update()}getFeatureState(f){return this.style.getFeatureState(f)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let f=0,n=0;return this._container&&(f=this._container.clientWidth||400,n=this._container.clientHeight||300),[f,n]}_setupContainer(){let f=this._container;f.classList.add("maplibregl-map","mapboxgl-map");let n=this._canvasContainer=T.create("div","maplibregl-canvas-container mapboxgl-canvas-container",f);this._interactive&&n.classList.add("maplibregl-interactive","mapboxgl-interactive"),this._canvas=T.create("canvas","maplibregl-canvas mapboxgl-canvas",n),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");let c=this._containerDimensions();this._resizeCanvas(c[0],c[1],this.getPixelRatio());let d=this._controlContainer=T.create("div","maplibregl-control-container mapboxgl-control-container",f),g=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(_=>{g[_]=T.create("div",`maplibregl-ctrl-${_} mapboxgl-ctrl-${_}`,d)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(f,n,c){this._canvas.width=c*f,this._canvas.height=c*n,this._canvas.style.width=`${f}px`,this._canvas.style.height=`${n}px`}_setupPainter(){let f=o.extend({},m.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),n=this._canvas.getContext("webgl",f)||this._canvas.getContext("experimental-webgl",f);n?(this.painter=new mh(n,this.transform),o.exported$1.testSupport(n)):this.fire(new o.ErrorEvent(new Error("Failed to initialize WebGL")))}_contextLost(f){f.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new o.Event("webglcontextlost",{originalEvent:f}))}_contextRestored(f){this._setupPainter(),this.resize(),this._update(),this.fire(new o.Event("webglcontextrestored",{originalEvent:f}))}_onMapScroll(f){if(f.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(f){return this.style?(this._styleDirty=this._styleDirty||f,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(f){return this._update(),this._renderTaskQueue.add(f)}_cancelRenderFrame(f){this._renderTaskQueue.remove(f)}_render(f){let n,c=0,d=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(n=d.createQueryEXT(),d.beginQueryEXT(d.TIME_ELAPSED_EXT,n),c=o.exported.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(f),this._removed)return;let g=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let I=this.transform.zoom,M=o.exported.now();this.style.zoomHistory.update(I,M);let E=new o.EvaluationParameters(I,{now:M,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),k=E.crossFadingFactor();k===1&&k===this._crossFadingFactor||(g=!0,this._crossFadingFactor=k),this.style.update(E)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new o.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,o.PerformanceUtils.mark(o.PerformanceMarkers.load),this.fire(new o.Event("load"))),this.style&&(this.style.hasTransitions()||g)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){let I=o.exported.now()-c;d.endQueryEXT(d.TIME_ELAPSED_EXT,n),setTimeout(()=>{let M=d.getQueryObjectEXT(n,d.QUERY_RESULT_EXT)/1e6;d.deleteQueryEXT(n),this.fire(new o.Event("gpu-timing-frame",{cpuTime:I,gpuTime:M}))},50)}if(this.listens("gpu-timing-layer")){let I=this.painter.collectGpuTimers();setTimeout(()=>{let M=this.painter.queryGpuTimers(I);this.fire(new o.Event("gpu-timing-layer",{layerTimes:M}))},50)}let _=this._sourcesDirty||this._styleDirty||this._placementDirty;return _||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new o.Event("idle")),!this._loaded||this._fullyLoaded||_||(this._fullyLoaded=!0,o.PerformanceUtils.mark(o.PerformanceMarkers.fullLoad)),this}redraw(){return this.style&&(this._frame&&(this._frame.cancel(),this._frame=null),this._render(0)),this}remove(){this._hash&&this._hash.remove();for(let n of this._controls)n.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&(removeEventListener("resize",this._onWindowResize,!1),removeEventListener("orientationchange",this._onWindowResize,!1),removeEventListener("online",this._onWindowOnline,!1));let f=this.painter.context.gl.getExtension("WEBGL_lose_context");f&&f.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),T.remove(this._canvasContainer),T.remove(this._controlContainer),this._container.classList.remove("maplibregl-map","mapboxgl-map"),o.PerformanceUtils.clearMetrics(),this._removed=!0,this.fire(new o.Event("remove"))}triggerRepaint(){this.style&&!this._frame&&(this._frame=o.exported.frame(f=>{o.PerformanceUtils.frame(f),this._frame=null,this._render(f)}))}_onWindowOnline(){this._update()}_onWindowResize(f){this._trackResize&&this.resize({originalEvent:f})._update()}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(f){this._showTileBoundaries!==f&&(this._showTileBoundaries=f,this._update())}get showPadding(){return!!this._showPadding}set showPadding(f){this._showPadding!==f&&(this._showPadding=f,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(f){this._showCollisionBoxes!==f&&(this._showCollisionBoxes=f,f?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(f){this._showOverdrawInspector!==f&&(this._showOverdrawInspector=f,this._update())}get repaint(){return!!this._repaint}set repaint(f){this._repaint!==f&&(this._repaint=f,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(f){this._vertices=f,this._update()}_setCacheLimits(f,n){o.setCacheLimits(f,n)}},NavigationControl:class{constructor(f){this.options=o.extend({},_o,f),this._container=T.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",n=>n.preventDefault()),this.options.showZoom&&(o.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in mapboxgl-ctrl-zoom-in",n=>this._map.zoomIn({},{originalEvent:n})),T.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out mapboxgl-ctrl-zoom-out",n=>this._map.zoomOut({},{originalEvent:n})),T.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(o.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("maplibregl-ctrl-compass mapboxgl-ctrl-compass",n=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:n}):this._map.resetNorth({},{originalEvent:n})}),this._compassIcon=T.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){let f=this._map.getZoom(),n=f===this._map.getMaxZoom(),c=f===this._map.getMinZoom();this._zoomInButton.disabled=n,this._zoomOutButton.disabled=c,this._zoomInButton.setAttribute("aria-disabled",n.toString()),this._zoomOutButton.setAttribute("aria-disabled",c.toString())}_rotateCompassArrow(){let f=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=f}onAdd(f){return this._map=f,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Eu(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){T.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(f,n){let c=T.create("button",f,this._container);return c.type="button",c.addEventListener("click",n),c}_setButtonTitle(f,n){let c=this._map._getUIString(`NavigationControl.${n}`);f.title=c,f.setAttribute("aria-label",c)}},GeolocateControl:class extends o.Evented{constructor(f){super(),this.options=o.extend({},Ch,f),o.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}onAdd(f){var n;return this._map=f,this._container=T.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),n=this._setupUI,Tr!==void 0?n(Tr):window.navigator.permissions!==void 0?window.navigator.permissions.query({name:"geolocation"}).then(c=>{Tr=c.state!=="denied",n(Tr)}):(Tr=!!window.navigator.geolocation,n(Tr)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),T.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Ms=0,fn=!1}_isOutOfMapMaxBounds(f){let n=this._map.getMaxBounds(),c=f.coords;return n&&(c.longitude<n.getWest()||c.longitude>n.getEast()||c.latitude<n.getSouth()||c.latitude>n.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting")}}_onSuccess(f){if(this._map){if(this._isOutOfMapMaxBounds(f))return this._setErrorState(),this.fire(new o.Event("outofmaxbounds",f)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=f,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(f),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(f),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale","mapboxgl-user-location-dot-stale"),this.fire(new o.Event("geolocate",f)),this._finish()}}_updateCamera(f){let n=new o.LngLat(f.coords.longitude,f.coords.latitude),c=f.coords.accuracy,d=this._map.getBearing(),g=o.extend({bearing:d},this.options.fitBoundsOptions);this._map.fitBounds(n.toBounds(c),g,{geolocateSource:!0})}_updateMarker(f){if(f){let n=new o.LngLat(f.coords.longitude,f.coords.latitude);this._accuracyCircleMarker.setLngLat(n).addTo(this._map),this._userLocationDotMarker.setLngLat(n).addTo(this._map),this._accuracy=f.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){let f=this._map._container.clientHeight/2,n=this._map.unproject([0,f]),c=this._map.unproject([1,f]),d=n.distanceTo(c),g=Math.ceil(2*this._accuracy/d);this._circleElement.style.width=`${g}px`,this._circleElement.style.height=`${g}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_onError(f){if(this._map){if(this.options.trackUserLocation)if(f.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;let n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(f.code===3&&fn)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale","mapboxgl-user-location-dot-stale"),this.fire(new o.Event("error",f)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(f){if(this._container.addEventListener("contextmenu",n=>n.preventDefault()),this._geolocateButton=T.create("button","maplibregl-ctrl-geolocate mapboxgl-ctrl-geolocate",this._container),T.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",f===!1){o.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");let n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n)}else{let n=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=T.create("div","maplibregl-user-location-dot mapboxgl-user-location-dot"),this._userLocationDotMarker=new vl(this._dotElement),this._circleElement=T.create("div","maplibregl-user-location-accuracy-circle mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new vl({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",n=>{n.geolocateSource||this._watchState!=="ACTIVE_LOCK"||n.originalEvent&&n.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this.fire(new o.Event("trackuserlocationend")))})}trigger(){if(!this._setup)return o.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 o.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Ms--,fn=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this.fire(new o.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new o.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active")}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let f;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Ms++,Ms>1?(f={maximumAge:6e5,timeout:0},fn=!0):(f=this.options.positionOptions,fn=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,f)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:Mu,LogoControl:Sh,ScaleControl:class{constructor(f){this.options=o.extend({},u0,f),o.bindAll(["_onMove","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_onMove(){xl(this._map,this._container,this.options)}onAdd(f){return this._map=f,this._container=T.create("div","maplibregl-ctrl maplibregl-ctrl-scale mapboxgl-ctrl mapboxgl-ctrl-scale",f.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){T.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}setUnit(f){this.options.unit=f,xl(this._map,this._container,this.options)}},FullscreenControl:class{constructor(f){this._fullscreen=!1,f&&f.container&&(f.container instanceof HTMLElement?this._container=f.container:o.warnOnce("Full screen control 'container' must be a DOM element.")),o.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(f){return this._map=f,this._container||(this._container=this._map.getContainer()),this._controlContainer=T.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",o.warnOnce("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){T.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!!(document.fullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled||document.webkitFullscreenEnabled)}_setupUI(){let f=this._fullscreenButton=T.create("button","maplibregl-ctrl-fullscreen mapboxgl-ctrl-fullscreen",this._controlContainer);T.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",f).setAttribute("aria-hidden","true"),f.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){let f=this._getTitle();this._fullscreenButton.setAttribute("aria-label",f),this._fullscreenButton.title=f}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen&&window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},Popup:class extends o.Evented{constructor(f){super(),this.options=o.extend(Object.create(Ar),f),o.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}addTo(f){return this._map&&this.remove(),this._map=f,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer","mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new o.Event("open")),this}isOpen(){return!!this._map}remove(){return this._content&&T.remove(this._content),this._container&&(T.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new o.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(f){return this._lngLat=o.LngLat.convert(f),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer","mapboxgl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer","mapboxgl-track-pointer")),this}getElement(){return this._container}setText(f){return this.setDOMContent(document.createTextNode(f))}setHTML(f){let n=document.createDocumentFragment(),c=document.createElement("body"),d;for(c.innerHTML=f;d=c.firstChild,d;)n.appendChild(d);return this.setDOMContent(n)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(f){return this.options.maxWidth=f,this._update(),this}setDOMContent(f){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=T.create("div","maplibregl-popup-content mapboxgl-popup-content",this._container);return this._content.appendChild(f),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(f){this._container&&this._container.classList.add(f)}removeClassName(f){this._container&&this._container.classList.remove(f)}setOffset(f){return this.options.offset=f,this._update(),this}toggleClassName(f){if(this._container)return this._container.classList.toggle(f)}_createCloseButton(){this.options.closeButton&&(this._closeButton=T.create("button","maplibregl-popup-close-button mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_onMouseUp(f){this._update(f.point)}_onMouseMove(f){this._update(f.point)}_onDrag(f){this._update(f.point)}_update(f){if(!this._map||!this._lngLat&&!this._trackPointer||!this._content||(this._container||(this._container=T.create("div","maplibregl-popup mapboxgl-popup",this._map.getContainer()),this._tip=T.create("div","maplibregl-popup-tip mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(_=>this._container.classList.add(_)),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=vt(this._lngLat,this._pos,this._map.transform)),this._trackPointer&&!f))return;let n=this._pos=this._trackPointer&&f?f:this._map.project(this._lngLat),c=this.options.anchor,d=xa(this.options.offset);if(!c){let _=this._container.offsetWidth,I=this._container.offsetHeight,M;M=n.y+d.bottom.y<I?["top"]:n.y>this._map.transform.height-I?["bottom"]:[],n.x<_/2?M.push("left"):n.x>this._map.transform.width-_/2&&M.push("right"),c=M.length===0?"bottom":M.join("-")}let g=n.add(d[c]).round();T.setTransform(this._container,`${Mt[c]} translate(${g.x}px,${g.y}px)`),yl(this._container,c,"popup")}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let f=this._container.querySelector(Gp);f&&f.focus()}_onClose(){this.remove()}},Marker:vl,Style:Fr,LngLat:o.LngLat,LngLatBounds:o.LngLatBounds,Point:o.pointGeometry,MercatorCoordinate:o.MercatorCoordinate,Evented:o.Evented,AJAXError:o.AJAXError,config:o.config,CanvasSource:_i,GeoJSONSource:ur,ImageSource:si,RasterDEMTileSource:Ht,RasterTileSource:zi,VectorTileSource:jt,VideoSource:ii,prewarm:function(){V().acquire(rn)},clearPrewarmedResources:function(){let f=_e;f&&(f.isPreloaded()&&f.numActive()===1?(f.release(rn),_e=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 workerCount(){return Lr.workerCount},set workerCount(f){Lr.workerCount=f},get maxParallelImageRequests(){return o.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(f){o.config.MAX_PARALLEL_IMAGE_REQUESTS=f},clearStorage(f){o.clearTileCache(f)},workerUrl:"",addProtocol(f,n){o.config.REGISTERED_PROTOCOLS[f]=n},removeProtocol(f){delete o.config.REGISTERED_PROTOCOLS[f]}};return Ui.extend(_l,{isSafari:o.isSafari,getPerformanceMetrics:o.PerformanceUtils.getPerformanceMetrics}),_l});var u=r;return u})});var QC=Vt((E7,JC)=>{"use strict";function r6(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var a=0;a<e.length;a++){var u=e.charAt(a),o=u.charCodeAt(0);if(t[o]!==255)throw new TypeError(u+" is ambiguous");t[o]=a}var m=e.length,v=e.charAt(0),b=Math.log(m)/Math.log(256),C=Math.log(256)/Math.log(m);function T(q){if(q instanceof Uint8Array||(ArrayBuffer.isView(q)?q=new Uint8Array(q.buffer,q.byteOffset,q.byteLength):Array.isArray(q)&&(q=Uint8Array.from(q))),!(q instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(q.length===0)return"";for(var ee=0,le=0,de=0,H=q.length;de!==H&&q[de]===0;)de++,ee++;for(var Q=(H-de)*C+1>>>0,te=new Uint8Array(Q);de!==H;){for(var ve=q[de],Me=0,Ce=Q-1;(ve!==0||Me<le)&&Ce!==-1;Ce--,Me++)ve+=256*te[Ce]>>>0,te[Ce]=ve%m>>>0,ve=ve/m>>>0;if(ve!==0)throw new Error("Non-zero carry");le=Me,de++}for(var Be=Q-le;Be!==Q&&te[Be]===0;)Be++;for(var Fe=v.repeat(ee);Be<Q;++Be)Fe+=e.charAt(te[Be]);return Fe}function B(q){if(typeof q!="string")throw new TypeError("Expected String");if(q.length===0)return new Uint8Array;for(var ee=0,le=0,de=0;q[ee]===v;)le++,ee++;for(var H=(q.length-ee)*b+1>>>0,Q=new Uint8Array(H);q[ee];){var te=t[q.charCodeAt(ee)];if(te===255)return;for(var ve=0,Me=H-1;(te!==0||ve<de)&&Me!==-1;Me--,ve++)te+=m*Q[Me]>>>0,Q[Me]=te%256>>>0,te=te/256>>>0;if(te!==0)throw new Error("Non-zero carry");de=ve,ee++}for(var Ce=H-de;Ce!==H&&Q[Ce]===0;)Ce++;for(var Be=new Uint8Array(le+(H-Ce)),Fe=le;Ce!==H;)Be[Fe++]=Q[Ce++];return Be}function W(q){var ee=B(q);if(ee)return ee;throw new Error("Non-base"+m+" character")}return{encode:T,decodeUnsafe:B,decode:W}}JC.exports=r6});var aM=Vt(sg=>{"use strict";var l6=Ir(),u6=Symbol.for("react.element"),c6=Symbol.for("react.fragment"),h6=Object.prototype.hasOwnProperty,d6=l6.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p6={key:!0,ref:!0,__self:!0,__source:!0};function sM(e,t,r){var a,u={},o=null,m=null;r!==void 0&&(o=""+r),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(m=t.ref);for(a in t)h6.call(t,a)&&!p6.hasOwnProperty(a)&&(u[a]=t[a]);if(e&&e.defaultProps)for(a in t=e.defaultProps,t)u[a]===void 0&&(u[a]=t[a]);return{$$typeof:u6,type:e,key:o,ref:m,props:u,_owner:d6.current}}sg.Fragment=c6;sg.jsx=sM;sg.jsxs=sM});var zr=Vt((eU,lM)=>{"use strict";lM.exports=aM()});var IM=Vt(X1=>{"use strict";Object.defineProperty(X1,"__esModule",{value:!0});function _6(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function b6(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var w6=function(){function e(r){var a=this;this._insertTag=function(u){var o;a.tags.length===0?a.insertionPoint?o=a.insertionPoint.nextSibling:a.prepend?o=a.container.firstChild:o=a.before:o=a.tags[a.tags.length-1].nextSibling,a.container.insertBefore(u,o),a.tags.push(u)},this.isSpeedy=r.speedy===void 0?!0:r.speedy,this.tags=[],this.ctr=0,this.nonce=r.nonce,this.key=r.key,this.container=r.container,this.prepend=r.prepend,this.insertionPoint=r.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(a){a.forEach(this._insertTag)},t.insert=function(a){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(b6(this));var u=this.tags[this.tags.length-1];if(this.isSpeedy){var o=_6(u);try{o.insertRule(a,o.cssRules.length)}catch{}}else u.appendChild(document.createTextNode(a));this.ctr++},t.flush=function(){this.tags.forEach(function(a){return a.parentNode&&a.parentNode.removeChild(a)}),this.tags=[],this.ctr=0},e}();X1.StyleSheet=w6});var CM=Vt((yW,SM)=>{"use strict";SM.exports=IM()});var EM=Vt((mg,MM)=>{(function(e,t){typeof mg=="object"&&typeof MM<"u"?t(mg):typeof define=="function"&&define.amd?define(["exports"],t):(e=e||self,t(e.stylis={}))})(mg,function(e){"use strict";var t="-ms-",r="-moz-",a="-webkit-",u="comm",o="rule",m="decl",v="@page",b="@media",C="@import",T="@charset",B="@viewport",W="@supports",q="@document",ee="@namespace",le="@keyframes",de="@font-face",H="@counter-style",Q="@font-feature-values",te=Math.abs,ve=String.fromCharCode,Me=Object.assign;function Ce(ie,Xe){return(((Xe<<2^Tt(ie,0))<<2^Tt(ie,1))<<2^Tt(ie,2))<<2^Tt(ie,3)}function Be(ie){return ie.trim()}function Fe(ie,Xe){return(ie=Xe.exec(ie))?ie[0]:ie}function qe(ie,Xe,$e){return ie.replace(Xe,$e)}function ht(ie,Xe){return ie.indexOf(Xe)}function Tt(ie,Xe){return ie.charCodeAt(Xe)|0}function Gt(ie,Xe,$e){return ie.slice(Xe,$e)}function Jt(ie){return ie.length}function at(ie){return ie.length}function jt(ie,Xe){return Xe.push(ie),ie}function zi(ie,Xe){return ie.map(Xe).join("")}e.line=1,e.column=1,e.length=0,e.position=0,e.character=0,e.characters="";function Ii(ie,Xe,$e,ft,ut,Xt,At){return{value:ie,root:Xe,parent:$e,type:ft,props:ut,children:Xt,line:e.line,column:e.column,length:At,return:""}}function Ht(ie,Xe){return Me(Ii("",null,null,"",null,null,0),ie,{length:-ie.length},Xe)}function ur(){return e.character}function Xi(){return e.character=e.position>0?Tt(e.characters,--e.position):0,e.column--,e.character===10&&(e.column=1,e.line--),e.character}function si(){return e.character=e.position<e.length?Tt(e.characters,e.position++):0,e.column++,e.character===10&&(e.column=1,e.line++),e.character}function ii(){return Tt(e.characters,e.position)}function _i(){return e.position}function Ei(ie,Xe){return Gt(e.characters,ie,Xe)}function Li(ie){switch(ie){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Fi(ie){return e.line=e.column=1,e.length=Jt(e.characters=ie),e.position=0,[]}function Ji(ie){return e.characters="",ie}function Mr(ie){return Be(Ei(e.position-1,hn(ie===91?ie+2:ie===40?ie+1:ie)))}function tn(ie){return Ji(ri(Fi(ie)))}function oo(ie){for(;(e.character=ii())&&e.character<33;)si();return Li(ie)>2||Li(e.character)>3?"":" "}function ri(ie){for(;si();)switch(Li(e.character)){case 0:jt(Lr(e.position-1),ie);break;case 2:jt(Mr(e.character),ie);break;default:jt(ve(e.character),ie)}return ie}function Hr(ie,Xe){for(;--Xe&&si()&&!(e.character<48||e.character>102||e.character>57&&e.character<65||e.character>70&&e.character<97););return Ei(ie,_i()+(Xe<6&&ii()==32&&si()==32))}function hn(ie){for(;si();)switch(e.character){case ie:return e.position;case 34:case 39:ie!==34&&ie!==39&&hn(e.character);break;case 40:ie===41&&hn(ie);break;case 92:si();break}return e.position}function rn(ie,Xe){for(;si()&&ie+e.character!==47+10;)if(ie+e.character===42+42&&ii()===47)break;return"/*"+Ei(Xe,e.position-1)+"*"+ve(ie===47?ie:si())}function Lr(ie){for(;!Li(ii());)si();return Ei(ie,e.position)}function es(ie){return Ji(_e("",null,null,null,[""],ie=Fi(ie),0,[0],ie))}function _e(ie,Xe,$e,ft,ut,Xt,At,Ue,It){for(var yt=0,ni=0,gi=At,St=0,tr=0,ci=0,Ri=1,hi=1,Ft=1,di=0,ir="",Ti=ut,Er=Xt,rr=ft,Ai=ir;hi;)switch(ci=di,di=si()){case 40:if(ci!=108&&Ai.charCodeAt(gi-1)==58){ht(Ai+=qe(Mr(di),"&","&\f"),"&\f")!=-1&&(Ft=-1);break}case 34:case 39:case 91:Ai+=Mr(di);break;case 9:case 10:case 13:case 32:Ai+=oo(ci);break;case 92:Ai+=Hr(_i()-1,7);continue;case 47:switch(ii()){case 42:case 47:jt(F(rn(si(),_i()),Xe,$e),It);break;default:Ai+="/"}break;case 123*Ri:Ue[yt++]=Jt(Ai)*Ft;case 125*Ri:case 59:case 0:switch(di){case 0:case 125:hi=0;case 59+ni:tr>0&&Jt(Ai)-gi&&jt(tr>32?U(Ai+";",ft,$e,gi-1):U(qe(Ai," ","")+";",ft,$e,gi-2),It);break;case 59:Ai+=";";default:if(jt(rr=V(Ai,Xe,$e,yt,ni,ut,Ue,ir,Ti=[],Er=[],gi),Xt),di===123)if(ni===0)_e(Ai,Xe,rr,rr,Ti,Xt,gi,Ue,Er);else switch(St){case 100:case 109:case 115:_e(ie,rr,rr,ft&&jt(V(ie,rr,rr,0,0,ut,Ue,ir,ut,Ti=[],gi),Er),ut,Er,gi,Ue,ft?Ti:Er);break;default:_e(Ai,rr,rr,rr,[""],Er,0,Ue,Er)}}yt=ni=tr=0,Ri=Ft=1,ir=Ai="",gi=At;break;case 58:gi=1+Jt(Ai),tr=ci;default:if(Ri<1){if(di==123)--Ri;else if(di==125&&Ri++==0&&Xi()==125)continue}switch(Ai+=ve(di),di*Ri){case 38:Ft=ni>0?1:(Ai+="\f",-1);break;case 44:Ue[yt++]=(Jt(Ai)-1)*Ft,Ft=1;break;case 64:ii()===45&&(Ai+=Mr(si())),St=ii(),ni=gi=Jt(ir=Ai+=Lr(_i())),di++;break;case 45:ci===45&&Jt(Ai)==2&&(Ri=0)}}return Xt}function V(ie,Xe,$e,ft,ut,Xt,At,Ue,It,yt,ni){for(var gi=ut-1,St=ut===0?Xt:[""],tr=at(St),ci=0,Ri=0,hi=0;ci<ft;++ci)for(var Ft=0,di=Gt(ie,gi+1,gi=te(Ri=At[ci])),ir=ie;Ft<tr;++Ft)(ir=Be(Ri>0?St[Ft]+" "+di:qe(di,/&\f/g,St[Ft])))&&(It[hi++]=ir);return Ii(ie,Xe,$e,ut===0?o:Ue,It,yt,ni)}function F(ie,Xe,$e){return Ii(ie,Xe,$e,u,ve(ur()),Gt(ie,2,-2),0)}function U(ie,Xe,$e,ft){return Ii(ie,Xe,$e,m,Gt(ie,0,ft),Gt(ie,ft+1,-1),ft)}function K(ie,Xe){switch(Ce(ie,Xe)){case 5103:return a+"print-"+ie+ie;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return a+ie+ie;case 5349:case 4246:case 4810:case 6968:case 2756:return a+ie+r+ie+t+ie+ie;case 6828:case 4268:return a+ie+t+ie+ie;case 6165:return a+ie+t+"flex-"+ie+ie;case 5187:return a+ie+qe(ie,/(\w+).+(:[^]+)/,a+"box-$1$2"+t+"flex-$1$2")+ie;case 5443:return a+ie+t+"flex-item-"+qe(ie,/flex-|-self/,"")+ie;case 4675:return a+ie+t+"flex-line-pack"+qe(ie,/align-content|flex-|-self/,"")+ie;case 5548:return a+ie+t+qe(ie,"shrink","negative")+ie;case 5292:return a+ie+t+qe(ie,"basis","preferred-size")+ie;case 6060:return a+"box-"+qe(ie,"-grow","")+a+ie+t+qe(ie,"grow","positive")+ie;case 4554:return a+qe(ie,/([^-])(transform)/g,"$1"+a+"$2")+ie;case 6187:return qe(qe(qe(ie,/(zoom-|grab)/,a+"$1"),/(image-set)/,a+"$1"),ie,"")+ie;case 5495:case 3959:return qe(ie,/(image-set\([^]*)/,a+"$1$`$1");case 4968:return qe(qe(ie,/(.+:)(flex-)?(.*)/,a+"box-pack:$3"+t+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+a+ie+ie;case 4095:case 3583:case 4068:case 2532:return qe(ie,/(.+)-inline(.+)/,a+"$1$2")+ie;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Jt(ie)-1-Xe>6)switch(Tt(ie,Xe+1)){case 109:if(Tt(ie,Xe+4)!==45)break;case 102:return qe(ie,/(.+:)(.+)-([^]+)/,"$1"+a+"$2-$3$1"+r+(Tt(ie,Xe+3)==108?"$3":"$2-$3"))+ie;case 115:return~ht(ie,"stretch")?K(qe(ie,"stretch","fill-available"),Xe)+ie:ie}break;case 4949:if(Tt(ie,Xe+1)!==115)break;case 6444:switch(Tt(ie,Jt(ie)-3-(~ht(ie,"!important")&&10))){case 107:return qe(ie,":",":"+a)+ie;case 101:return qe(ie,/(.+:)([^;!]+)(;|!.+)?/,"$1"+a+(Tt(ie,14)===45?"inline-":"")+"box$3$1"+a+"$2$3$1"+t+"$2box$3")+ie}break;case 5936:switch(Tt(ie,Xe+11)){case 114:return a+ie+t+qe(ie,/[svh]\w+-[tblr]{2}/,"tb")+ie;case 108:return a+ie+t+qe(ie,/[svh]\w+-[tblr]{2}/,"tb-rl")+ie;case 45:return a+ie+t+qe(ie,/[svh]\w+-[tblr]{2}/,"lr")+ie}return a+ie+t+ie+ie}return ie}function he(ie,Xe){for(var $e="",ft=at(ie),ut=0;ut<ft;ut++)$e+=Xe(ie[ut],ut,ie,Xe)||"";return $e}function Se(ie,Xe,$e,ft){switch(ie.type){case C:case m:return ie.return=ie.return||ie.value;case u:return"";case le:return ie.return=ie.value+"{"+he(ie.children,ft)+"}";case o:ie.value=ie.props.join(",")}return Jt($e=he(ie.children,ft))?ie.return=ie.value+"{"+$e+"}":""}function Ve(ie){var Xe=at(ie);return function($e,ft,ut,Xt){for(var At="",Ue=0;Ue<Xe;Ue++)At+=ie[Ue]($e,ft,ut,Xt)||"";return At}}function He(ie){return function(Xe){Xe.root||(Xe=Xe.return)&&ie(Xe)}}function ye(ie,Xe,$e,ft){if(ie.length>-1&&!ie.return)switch(ie.type){case m:ie.return=K(ie.value,ie.length);break;case le:return he([Ht(ie,{value:qe(ie.value,"@","@"+a)})],ft);case o:if(ie.length)return zi(ie.props,function(ut){switch(Fe(ut,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return he([Ht(ie,{props:[qe(ut,/:(read-\w+)/,":"+r+"$1")]})],ft);case"::placeholder":return he([Ht(ie,{props:[qe(ut,/:(plac\w+)/,":"+a+"input-$1")]}),Ht(ie,{props:[qe(ut,/:(plac\w+)/,":"+r+"$1")]}),Ht(ie,{props:[qe(ut,/:(plac\w+)/,t+"input-$1")]})],ft)}return""})}}function Re(ie){switch(ie.type){case o:ie.props=ie.props.map(function(Xe){return zi(tn(Xe),function($e,ft,ut){switch(Tt($e,0)){case 12:return Gt($e,1,Jt($e));case 0:case 40:case 43:case 62:case 126:return $e;case 58:ut[++ft]==="global"&&(ut[ft]="",ut[++ft]="\f"+Gt(ut[ft],ft=1,-1));case 32:return ft===1?"":$e;default:switch(ft){case 0:return ie=$e,at(ut)>1?"":$e;case(ft=at(ut)-1):case 2:return ft===2?$e+ie+ie:$e+ie;default:return $e}}})})}}e.CHARSET=T,e.COMMENT=u,e.COUNTER_STYLE=H,e.DECLARATION=m,e.DOCUMENT=q,e.FONT_FACE=de,e.FONT_FEATURE_VALUES=Q,e.IMPORT=C,e.KEYFRAMES=le,e.MEDIA=b,e.MOZ=r,e.MS=t,e.NAMESPACE=ee,e.PAGE=v,e.RULESET=o,e.SUPPORTS=W,e.VIEWPORT=B,e.WEBKIT=a,e.abs=te,e.alloc=Fi,e.append=jt,e.assign=Me,e.caret=_i,e.char=ur,e.charat=Tt,e.combine=zi,e.comment=F,e.commenter=rn,e.compile=es,e.copy=Ht,e.dealloc=Ji,e.declaration=U,e.delimit=Mr,e.delimiter=hn,e.escaping=Hr,e.from=ve,e.hash=Ce,e.identifier=Lr,e.indexof=ht,e.match=Fe,e.middleware=Ve,e.namespace=Re,e.next=si,e.node=Ii,e.parse=_e,e.peek=ii,e.prefix=K,e.prefixer=ye,e.prev=Xi,e.replace=qe,e.ruleset=V,e.rulesheet=He,e.serialize=he,e.sizeof=at,e.slice=Ei,e.stringify=Se,e.strlen=Jt,e.substr=Gt,e.token=Li,e.tokenize=tn,e.tokenizer=ri,e.trim=Be,e.whitespace=oo,Object.defineProperty(e,"__esModule",{value:!0})})});var TM=Vt($1=>{"use strict";Object.defineProperty($1,"__esModule",{value:!0});var I6=function(t){var r=new WeakMap;return function(a){if(r.has(a))return r.get(a);var u=t(a);return r.set(a,u),u}};$1.default=I6});var gg=Vt((xW,AM)=>{"use strict";AM.exports=TM()});var PM=Vt(Y1=>{"use strict";Object.defineProperty(Y1,"__esModule",{value:!0});function S6(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}Y1.default=S6});var q1=Vt((bW,kM)=>{"use strict";kM.exports=PM()});var RM=Vt(J1=>{"use strict";Object.defineProperty(J1,"__esModule",{value:!0});var C6=CM(),lr=EM(),M6=gg(),E6=q1();function LM(e){return e&&e.__esModule?e:{default:e}}var T6=LM(M6),A6=LM(E6),P6=function(t,r,a){for(var u=0,o=0;u=o,o=lr.peek(),u===38&&o===12&&(r[a]=1),!lr.token(o);)lr.next();return lr.slice(t,lr.position)},k6=function(t,r){var a=-1,u=44;do switch(lr.token(u)){case 0:u===38&&lr.peek()===12&&(r[a]=1),t[a]+=P6(lr.position-1,r,a);break;case 2:t[a]+=lr.delimit(u);break;case 4:if(u===44){t[++a]=lr.peek()===58?"&\f":"",r[a]=t[a].length;break}default:t[a]+=lr.from(u)}while(u=lr.next());return t},z6=function(t,r){return lr.dealloc(k6(lr.alloc(t),r))},zM=new WeakMap,L6=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var r=t.value,a=t.parent,u=t.column===a.column&&t.line===a.line;a.type!=="rule";)if(a=a.parent,!a)return;if(!(t.props.length===1&&r.charCodeAt(0)!==58&&!zM.get(a))&&!u){zM.set(t,!0);for(var o=[],m=z6(r,o),v=a.props,b=0,C=0;b<m.length;b++)for(var T=0;T<v.length;T++,C++)t.props[C]=o[b]?m[b].replace(/&\f/g,v[T]):v[T]+" "+m[b]}}},R6=function(t){if(t.type==="decl"){var r=t.value;r.charCodeAt(0)===108&&r.charCodeAt(2)===98&&(t.return="",t.value="")}},yg=typeof document<"u",D6=yg?void 0:T6.default(function(){return A6.default(function(){var e={};return function(t){return e[t]}})}),B6=[lr.prefixer],N6=function(t){var r=t.key;if(yg&&r==="css"){var a=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(a,function(ve){var Me=ve.getAttribute("data-emotion");Me.indexOf(" ")!==-1&&(document.head.appendChild(ve),ve.setAttribute("data-s",""))})}var u=t.stylisPlugins||B6,o={},m,v=[];yg&&(m=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(ve){for(var Me=ve.getAttribute("data-emotion").split(" "),Ce=1;Ce<Me.length;Ce++)o[Me[Ce]]=!0;v.push(ve)}));var b,C=[L6,R6];if(yg){var T,B=[lr.stringify,lr.rulesheet(function(ve){T.insert(ve)})],W=lr.middleware(C.concat(u,B)),q=function(Me){return lr.serialize(lr.compile(Me),W)};b=function(Me,Ce,Be,Fe){T=Be,q(Me?Me+"{"+Ce.styles+"}":Ce.styles),Fe&&(te.inserted[Ce.name]=!0)}}else{var ee=[lr.stringify],le=lr.middleware(C.concat(u,ee)),de=function(Me){return lr.serialize(lr.compile(Me),le)},H=D6(u)(r),Q=function(Me,Ce){var Be=Ce.name;return H[Be]===void 0&&(H[Be]=de(Me?Me+"{"+Ce.styles+"}":Ce.styles)),H[Be]};b=function(Me,Ce,Be,Fe){var qe=Ce.name,ht=Q(Me,Ce);if(te.compat===void 0)return Fe&&(te.inserted[qe]=!0),ht;if(Fe)te.inserted[qe]=ht;else return ht}}var te={key:r,sheet:new C6.StyleSheet({key:r,container:m,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:o,registered:{},insert:b};return te.sheet.hydrate(v),te};J1.default=N6});var vg=Vt((IW,DM)=>{"use strict";DM.exports=RM()});var K1=Vt((SW,na)=>{function Q1(){return na.exports=Q1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},na.exports.__esModule=!0,na.exports.default=na.exports,Q1.apply(this,arguments)}na.exports=Q1,na.exports.__esModule=!0,na.exports.default=na.exports});var NM=Vt(Bi=>{"use strict";var Kr=typeof Symbol=="function"&&Symbol.for,ex=Kr?Symbol.for("react.element"):60103,tx=Kr?Symbol.for("react.portal"):60106,xg=Kr?Symbol.for("react.fragment"):60107,_g=Kr?Symbol.for("react.strict_mode"):60108,bg=Kr?Symbol.for("react.profiler"):60114,wg=Kr?Symbol.for("react.provider"):60109,Ig=Kr?Symbol.for("react.context"):60110,ix=Kr?Symbol.for("react.async_mode"):60111,Sg=Kr?Symbol.for("react.concurrent_mode"):60111,Cg=Kr?Symbol.for("react.forward_ref"):60112,Mg=Kr?Symbol.for("react.suspense"):60113,F6=Kr?Symbol.for("react.suspense_list"):60120,Eg=Kr?Symbol.for("react.memo"):60115,Tg=Kr?Symbol.for("react.lazy"):60116,O6=Kr?Symbol.for("react.block"):60121,G6=Kr?Symbol.for("react.fundamental"):60117,V6=Kr?Symbol.for("react.responder"):60118,U6=Kr?Symbol.for("react.scope"):60119;function vo(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case ex:switch(e=e.type,e){case ix:case Sg:case xg:case bg:case _g:case Mg:return e;default:switch(e=e&&e.$$typeof,e){case Ig:case Cg:case Tg:case Eg:case wg:return e;default:return t}}case tx:return t}}}function BM(e){return vo(e)===Sg}Bi.AsyncMode=ix;Bi.ConcurrentMode=Sg;Bi.ContextConsumer=Ig;Bi.ContextProvider=wg;Bi.Element=ex;Bi.ForwardRef=Cg;Bi.Fragment=xg;Bi.Lazy=Tg;Bi.Memo=Eg;Bi.Portal=tx;Bi.Profiler=bg;Bi.StrictMode=_g;Bi.Suspense=Mg;Bi.isAsyncMode=function(e){return BM(e)||vo(e)===ix};Bi.isConcurrentMode=BM;Bi.isContextConsumer=function(e){return vo(e)===Ig};Bi.isContextProvider=function(e){return vo(e)===wg};Bi.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===ex};Bi.isForwardRef=function(e){return vo(e)===Cg};Bi.isFragment=function(e){return vo(e)===xg};Bi.isLazy=function(e){return vo(e)===Tg};Bi.isMemo=function(e){return vo(e)===Eg};Bi.isPortal=function(e){return vo(e)===tx};Bi.isProfiler=function(e){return vo(e)===bg};Bi.isStrictMode=function(e){return vo(e)===_g};Bi.isSuspense=function(e){return vo(e)===Mg};Bi.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===xg||e===Sg||e===bg||e===_g||e===Mg||e===F6||typeof e=="object"&&e!==null&&(e.$$typeof===Tg||e.$$typeof===Eg||e.$$typeof===wg||e.$$typeof===Ig||e.$$typeof===Cg||e.$$typeof===G6||e.$$typeof===V6||e.$$typeof===U6||e.$$typeof===O6)};Bi.typeOf=vo});var OM=Vt((MW,FM)=>{"use strict";FM.exports=NM()});var ox=Vt((EW,jM)=>{"use strict";var rx=OM(),W6={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Z6={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},j6={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},WM={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},nx={};nx[rx.ForwardRef]=j6;nx[rx.Memo]=WM;function GM(e){return rx.isMemo(e)?WM:nx[e.$$typeof]||W6}var H6=Object.defineProperty,X6=Object.getOwnPropertyNames,VM=Object.getOwnPropertySymbols,$6=Object.getOwnPropertyDescriptor,Y6=Object.getPrototypeOf,UM=Object.prototype;function ZM(e,t,r){if(typeof t!="string"){if(UM){var a=Y6(t);a&&a!==UM&&ZM(e,a,r)}var u=X6(t);VM&&(u=u.concat(VM(t)));for(var o=GM(e),m=GM(t),v=0;v<u.length;++v){var b=u[v];if(!Z6[b]&&!(r&&r[b])&&!(m&&m[b])&&!(o&&o[b])){var C=$6(t,b);try{H6(e,b,C)}catch{}}}}return e}jM.exports=ZM});var ax=Vt(sx=>{"use strict";Object.defineProperty(sx,"__esModule",{value:!0});var q6=ox();function J6(e){return e&&e.__esModule?e:{default:e}}var Q6=J6(q6),K6=function(e,t){return Q6.default(e,t)};sx.default=K6});var XM=Vt(Qd=>{"use strict";Object.defineProperty(Qd,"__esModule",{value:!0});var lx=typeof document<"u";function eR(e,t,r){var a="";return r.split(" ").forEach(function(u){e[u]!==void 0?t.push(e[u]+";"):a+=u+" "}),a}var HM=function(t,r,a){var u=t.key+"-"+r.name;(a===!1||lx===!1&&t.compat!==void 0)&&t.registered[u]===void 0&&(t.registered[u]=r.styles)},tR=function(t,r,a){HM(t,r,a);var u=t.key+"-"+r.name;if(t.inserted[r.name]===void 0){var o="",m=r;do{var v=t.insert(r===m?"."+u:"",m,t.sheet,!0);!lx&&v!==void 0&&(o+=v),m=m.next}while(m!==void 0);if(!lx&&o.length!==0)return o}};Qd.getRegisteredStyles=eR;Qd.insertStyles=tR;Qd.registerStyles=HM});var ux=Vt((PW,$M)=>{"use strict";$M.exports=XM()});var YM=Vt(cx=>{"use strict";Object.defineProperty(cx,"__esModule",{value:!0});function iR(e){for(var t=0,r,a=0,u=e.length;u>=4;++a,u-=4)r=e.charCodeAt(a)&255|(e.charCodeAt(++a)&255)<<8|(e.charCodeAt(++a)&255)<<16|(e.charCodeAt(++a)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(u){case 3:t^=(e.charCodeAt(a+2)&255)<<16;case 2:t^=(e.charCodeAt(a+1)&255)<<8;case 1:t^=e.charCodeAt(a)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}cx.default=iR});var JM=Vt((zW,qM)=>{"use strict";qM.exports=YM()});var QM=Vt(hx=>{"use strict";Object.defineProperty(hx,"__esModule",{value:!0});var rR={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};hx.default=rR});var eE=Vt((RW,KM)=>{"use strict";KM.exports=QM()});var oE=Vt(fx=>{"use strict";Object.defineProperty(fx,"__esModule",{value:!0});var nR=JM(),oR=eE(),sR=q1();function px(e){return e&&e.__esModule?e:{default:e}}var aR=px(nR),lR=px(oR),uR=px(sR),cR=/[A-Z]|^ms/g,hR=/_EMO_([^_]+?)_([^]*?)_EMO_/g,nE=function(t){return t.charCodeAt(1)===45},tE=function(t){return t!=null&&typeof t!="boolean"},dx=uR.default(function(e){return nE(e)?e:e.replace(cR,"-$&").toLowerCase()}),iE=function(t,r){switch(t){case"animation":case"animationName":if(typeof r=="string")return r.replace(hR,function(a,u,o){return gs={name:u,styles:o,next:gs},u})}return lR.default[t]!==1&&!nE(t)&&typeof r=="number"&&r!==0?r+"px":r};function Kd(e,t,r){if(r==null)return"";if(r.__emotion_styles!==void 0)return r;switch(typeof r){case"boolean":return"";case"object":{if(r.anim===1)return gs={name:r.name,styles:r.styles,next:gs},r.name;if(r.styles!==void 0){var a=r.next;if(a!==void 0)for(;a!==void 0;)gs={name:a.name,styles:a.styles,next:gs},a=a.next;var u=r.styles+";";return u}return dR(e,t,r)}case"function":{if(e!==void 0){var o=gs,m=r(e);return gs=o,Kd(e,t,m)}break}}if(t==null)return r;var v=t[r];return v!==void 0?v:r}function dR(e,t,r){var a="";if(Array.isArray(r))for(var u=0;u<r.length;u++)a+=Kd(e,t,r[u])+";";else for(var o in r){var m=r[o];if(typeof m!="object")t!=null&&t[m]!==void 0?a+=o+"{"+t[m]+"}":tE(m)&&(a+=dx(o)+":"+iE(o,m)+";");else if(Array.isArray(m)&&typeof m[0]=="string"&&(t==null||t[m[0]]===void 0))for(var v=0;v<m.length;v++)tE(m[v])&&(a+=dx(o)+":"+iE(o,m[v])+";");else{var b=Kd(e,t,m);switch(o){case"animation":case"animationName":{a+=dx(o)+":"+b+";";break}default:a+=o+"{"+b+"}"}}}return a}var rE=/label:\s*([^\s;\n{]+)\s*(;|$)/g,gs,pR=function(t,r,a){if(t.length===1&&typeof t[0]=="object"&&t[0]!==null&&t[0].styles!==void 0)return t[0];var u=!0,o="";gs=void 0;var m=t[0];m==null||m.raw===void 0?(u=!1,o+=Kd(a,r,m)):o+=m[0];for(var v=1;v<t.length;v++)o+=Kd(a,r,t[v]),u&&(o+=m[v]);rE.lastIndex=0;for(var b="",C;(C=rE.exec(o))!==null;)b+="-"+C[1];var T=aR.default(o)+b;return{name:T,styles:o,next:gs}};fx.serializeStyles=pR});var mx=Vt((BW,sE)=>{"use strict";sE.exports=oE()});var hE=Vt(Ag=>{"use strict";Object.defineProperty(Ag,"__esModule",{value:!0});var uE=Ir();function fR(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if(r!=="default"){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}var aE=fR(uE),mR=typeof document<"u",lE=function(t){return t()},cE=aE["useInsertionEffect"]?aE["useInsertionEffect"]:!1,gR=mR&&cE||lE,yR=cE||uE.useLayoutEffect;Ag.useInsertionEffectAlwaysWithSyncFallback=gR;Ag.useInsertionEffectWithLayoutFallback=yR});var gx=Vt((FW,dE)=>{"use strict";dE.exports=hE()});var yE=Vt(no=>{"use strict";var jr=Ir(),vR=vg(),fE=K1(),xR=gg(),_R=ax(),yx=ux(),bR=mx(),wR=gx();function mE(e){return e&&e.__esModule?e:{default:e}}var gE=mE(vR),pE=mE(xR),xx=typeof document<"u",_x={}.hasOwnProperty,ep=jr.createContext(typeof HTMLElement<"u"?gE.default({key:"css"}):null),IR=ep.Provider,SR=function(){return jr.useContext(ep)};no.withEmotionCache=function(t){return jr.forwardRef(function(r,a){var u=jr.useContext(ep);return t(r,u,a)})};xx||(no.withEmotionCache=function(t){return function(r){var a=jr.useContext(ep);return a===null?(a=gE.default({key:"css"}),jr.createElement(ep.Provider,{value:a},t(r,a))):t(r,a)}});var Oc=jr.createContext({}),CR=function(){return jr.useContext(Oc)},MR=function(t,r){if(typeof r=="function"){var a=r(t);return a}return fE({},t,r)},ER=pE.default(function(e){return pE.default(function(t){return MR(e,t)})}),TR=function(t){var r=jr.useContext(Oc);return t.theme!==r&&(r=ER(r)(t.theme)),jr.createElement(Oc.Provider,{value:r},t.children)};function AR(e){var t=e.displayName||e.name||"Component",r=function(o,m){var v=jr.useContext(Oc);return jr.createElement(e,fE({theme:v,ref:m},o))},a=jr.forwardRef(r);return a.displayName="WithTheme("+t+")",_R.default(a,e)}var vx="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",PR=function(t,r){var a={};for(var u in r)_x.call(r,u)&&(a[u]=r[u]);return a[vx]=t,a},kR=function(t){var r=t.cache,a=t.serialized,u=t.isStringTag;yx.registerStyles(r,a,u);var o=wR.useInsertionEffectAlwaysWithSyncFallback(function(){return yx.insertStyles(r,a,u)});if(!xx&&o!==void 0){for(var m,v=a.name,b=a.next;b!==void 0;)v+=" "+b.name,b=b.next;return jr.createElement("style",(m={},m["data-emotion"]=r.key+" "+v,m.dangerouslySetInnerHTML={__html:o},m.nonce=r.sheet.nonce,m))}return null},zR=no.withEmotionCache(function(e,t,r){var a=e.css;typeof a=="string"&&t.registered[a]!==void 0&&(a=t.registered[a]);var u=e[vx],o=[a],m="";typeof e.className=="string"?m=yx.getRegisteredStyles(t.registered,o,e.className):e.className!=null&&(m=e.className+" ");var v=bR.serializeStyles(o,void 0,jr.useContext(Oc));m+=t.key+"-"+v.name;var b={};for(var C in e)_x.call(e,C)&&C!=="css"&&C!==vx&&(b[C]=e[C]);return b.ref=r,b.className=m,jr.createElement(jr.Fragment,null,jr.createElement(kR,{cache:t,serialized:v,isStringTag:typeof u=="string"}),jr.createElement(u,b))});no.CacheProvider=IR;no.Emotion=zR;no.ThemeContext=Oc;no.ThemeProvider=TR;no.__unsafe_useEmotionCache=SR;no.createEmotionProps=PR;no.hasOwnProperty=_x;no.isBrowser=xx;no.useTheme=CR;no.withTheme=AR});var _E=Vt(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});var ys=Ir();vg();var en=yE();K1();gg();ox();ax();var Pg=ux(),wx=mx(),bx=gx(),vE=function(t,r){var a=arguments;if(r==null||!en.hasOwnProperty.call(r,"css"))return ys.createElement.apply(void 0,a);var u=a.length,o=new Array(u);o[0]=en.Emotion,o[1]=en.createEmotionProps(t,r);for(var m=2;m<u;m++)o[m]=a[m];return ys.createElement.apply(null,o)},LR=en.withEmotionCache(function(e,t){var r=e.styles,a=wx.serializeStyles([r],void 0,ys.useContext(en.ThemeContext));if(!en.isBrowser){for(var u,o=a.name,m=a.styles,v=a.next;v!==void 0;)o+=" "+v.name,m+=v.styles,v=v.next;var b=t.compat===!0,C=t.insert("",{name:o,styles:m},t.sheet,b);return b?null:ys.createElement("style",(u={},u["data-emotion"]=t.key+"-global "+o,u.dangerouslySetInnerHTML={__html:C},u.nonce=t.sheet.nonce,u))}var T=ys.useRef();return bx.useInsertionEffectWithLayoutFallback(function(){var B=t.key+"-global",W=new t.sheet.constructor({key:B,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),q=!1,ee=document.querySelector('style[data-emotion="'+B+" "+a.name+'"]');return t.sheet.tags.length&&(W.before=t.sheet.tags[0]),ee!==null&&(q=!0,ee.setAttribute("data-emotion",B),W.hydrate([ee])),T.current=[W,q],function(){W.flush()}},[t]),bx.useInsertionEffectWithLayoutFallback(function(){var B=T.current,W=B[0],q=B[1];if(q){B[1]=!1;return}if(a.next!==void 0&&Pg.insertStyles(t,a.next,!0),W.tags.length){var ee=W.tags[W.tags.length-1].nextElementSibling;W.before=ee,W.flush()}t.insert("",a,W,!1)},[t,a.name]),null});function xE(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return wx.serializeStyles(t)}var RR=function(){var t=xE.apply(void 0,arguments),r="animation-"+t.name;return{name:r,styles:"@keyframes "+r+"{"+t.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}},DR=function e(t){for(var r=t.length,a=0,u="";a<r;a++){var o=t[a];if(o!=null){var m=void 0;switch(typeof o){case"boolean":break;case"object":{if(Array.isArray(o))m=e(o);else{m="";for(var v in o)o[v]&&v&&(m&&(m+=" "),m+=v)}break}default:m=o}m&&(u&&(u+=" "),u+=m)}}return u};function BR(e,t,r){var a=[],u=Pg.getRegisteredStyles(e,a,r);return a.length<2?r:u+t(a)}var NR=function(t){var r=t.cache,a=t.serializedArr,u=bx.useInsertionEffectAlwaysWithSyncFallback(function(){for(var m="",v=0;v<a.length;v++){var b=Pg.insertStyles(r,a[v],!1);!en.isBrowser&&b!==void 0&&(m+=b)}if(!en.isBrowser)return m});if(!en.isBrowser&&u.length!==0){var o;return ys.createElement("style",(o={},o["data-emotion"]=r.key+" "+a.map(function(m){return m.name}).join(" "),o.dangerouslySetInnerHTML={__html:u},o.nonce=r.sheet.nonce,o))}return null},FR=en.withEmotionCache(function(e,t){var r=!1,a=[],u=function(){for(var C=arguments.length,T=new Array(C),B=0;B<C;B++)T[B]=arguments[B];var W=wx.serializeStyles(T,t.registered);return a.push(W),Pg.registerStyles(t,W,!1),t.key+"-"+W.name},o=function(){for(var C=arguments.length,T=new Array(C),B=0;B<C;B++)T[B]=arguments[B];return BR(t.registered,u,DR(T))},m={css:u,cx:o,theme:ys.useContext(en.ThemeContext)},v=e.children(m);return r=!0,ys.createElement(ys.Fragment,null,ys.createElement(NR,{cache:t,serializedArr:a}),v)});Wn.CacheProvider=en.CacheProvider;Wn.ThemeContext=en.ThemeContext;Wn.ThemeProvider=en.ThemeProvider;Wn.__unsafe_useEmotionCache=en.__unsafe_useEmotionCache;Wn.useTheme=en.useTheme;Object.defineProperty(Wn,"withEmotionCache",{enumerable:!0,get:function(){return en.withEmotionCache}});Wn.withTheme=en.withTheme;Wn.ClassNames=FR;Wn.Global=LR;Wn.createElement=vE;Wn.css=xE;Wn.jsx=vE;Wn.keyframes=RR});var Ix=Vt((VW,bE)=>{"use strict";bE.exports=_E()});var Wg=Lt(Ir(),1),UT=Lt(WI(),1);var _M=Lt(Ir(),1);function Vl(e){var t=new Error(e);return t.source="ulid",t}var Lm="0123456789ABCDEFGHJKMNPQRSTVWXYZ",yc=Lm.length,f1=Math.pow(2,48)-1,m1=10,jI=16;function QP(e){var t=Math.floor(e()*yc);return t===yc&&(t=yc-1),Lm.charAt(t)}function KP(e,t){if(isNaN(e))throw new Error(e+" must be a number");if(e>f1)throw Vl("cannot encode time greater than "+f1);if(e<0)throw Vl("time must be positive");if(Number.isInteger(e)===!1)throw Vl("time must be an integer");for(var r=void 0,a="";t>0;t--)r=e%yc,a=Lm.charAt(r)+a,e=(e-r)/yc;return a}function e5(e,t){for(var r="";e>0;e--)r=QP(t)+r;return r}function HI(e){if(e.length!==m1+jI)throw Vl("malformed ulid");var t=e.substr(0,m1).split("").reverse().reduce(function(r,a,u){var o=Lm.indexOf(a);if(o===-1)throw Vl("invalid character found: "+a);return r+=o*Math.pow(yc,u)},0);if(t>f1)throw Vl("malformed ulid, timestamp too large");return t}function t5(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=arguments[1];t||(t=typeof window<"u"?window:null);var r=t&&(t.crypto||t.msCrypto);if(r)return function(){var u=new Uint8Array(1);return r.getRandomValues(u),u[0]/255};try{var a=ZI();return function(){return a.randomBytes(1).readUInt8()/255}}catch{}if(e){try{console.error("secure crypto unusable, falling back to insecure Math.random()!")}catch{}return function(){return Math.random()}}throw Vl("secure crypto unusable, insecure Math.random not allowed")}function i5(e){return e||(e=t5()),function(r){return isNaN(r)&&(r=Date.now()),KP(r,m1)+e5(jI,e)}}var XI=i5();var $I=()=>typeof localStorage<"u",YI=24*60*60*1e3,r5=30*YI,CB=91*YI;function Bd(){let e="c"+XI().toLowerCase();return $I()&&localStorage.setItem("api-key",e),e}function qI(){if(!$I())return Bd();let e=localStorage.getItem("api-key");if(e==null||!e.startsWith("c"))return Bd();try{let t=HI(e.slice(1).toUpperCase());return Date.now()-r5<t?e:Bd()}catch{return Bd()}}var Cr=class{constructor(t,r,a,u){this.x=t,this.y=r,this.width=a,this.height=u}get bottom(){return this.y+this.height}get right(){return this.x+this.width}intersects(t){return this.x<t.right&&t.x<this.right&&this.y<t.bottom&&t.y<this.bottom}containsBounds(t){return Cr.contains(this,t)}intersection(t){let r=Math.max(this.x,t.x),a=Math.min(this.x+this.width,t.x+t.width),u=Math.max(this.y,t.y),o=Math.min(this.y+this.height,t.y+t.height);return a>r&&o>u?new Cr(r,u,a-r,o-u):null}static union(t){if(t.length===0)throw new Error("Union on empty list is not allowed");let{x:r,y:a}=t[0],u=r+t[0].width,o=a+t[0].height;for(let m=1;m<t.length;++m){let v=t[m];r=Math.min(r,v.x),u=Math.max(u,v.x+v.width),a=Math.min(a,v.y),o=Math.max(o,v.y+v.height)}return new Cr(r,a,u-r,o-a)}union(t){return Cr.union([this,t])}toJson(){return{x:this.x,y:this.y,width:this.width,height:this.height}}toBbox(){return[this.x,this.y,this.right,this.bottom]}toPolygon(){return[[[this.x,this.y],[this.x,this.bottom],[this.right,this.bottom],[this.right,this.y],[this.x,this.y]]]}scale(t,r=t){return new Cr(this.x*t,this.y*r,this.width*t,this.height*r)}scaleFromCenter(t,r=t){let a=this.width*t,u=this.height*r;return new Cr(this.x-.5*(a-this.width),this.y-.5*(u-this.height),a,u)}pad(t,r=t){return new Cr(this.x-t,this.y-r,this.width+t*2,this.height+r*2)}round(t=0){let r=Math.round(this.x-t),a=Math.round(this.y-t);return new Cr(r,a,Math.round(this.right+t)-r,Math.round(this.bottom+t)-a)}add(t){return new Cr(this.x+t.x,this.y+t.y,this.width,this.height)}subtract(t){return new Cr(this.x-t.x,this.y-t.y,this.width,this.height)}static fromMultiPolygon(t){if(t.length===0)return new Cr(0,0,0,0);let r=t[0][0][0][0],a=t[0][0][0][1],u=r,o=a;for(let[m]of t)for(let[v,b]of m)v<r?r=v:v>u&&(u=v),b<a?a=b:b>o&&(o=b);return new Cr(r,a,u-r,o-a)}static fromBbox([t,r,a,u]){return new Cr(Math.min(t,a),Math.min(r,u),Math.abs(a-t),Math.abs(u-r))}static fromUpperLeftLowerRight(t,r){return new Cr(t.x,t.y,r.x-t.x,r.y-t.y)}static fromJson(t){return new Cr(t.x,t.y,t.width,t.height)}static compareArea(t,r){let a=t.width*t.height-r.width*r.height;if(a!==0)return a;let u=t.x-r.x;return u===0?t.y-r.y:u}static contains(t,r){return t.x<=r.x&&t.x+t.width>=r.x+r.width&&t.y<=r.y&&t.y+t.height>=r.y+r.height}};var fi;(function(e){e[e.Google=3857]="Google",e[e.Wgs84=4326]="Wgs84",e[e.Nztm2000=2193]="Nztm2000",e[e.Citm2000=3793]="Citm2000"})(fi||(fi={}));var g1={google:fi.Google,epsg3857:fi.Google,[fi.Google]:fi.Google,globalmercator:fi.Google,wgs84:fi.Wgs84,epsg4326:fi.Wgs84,[fi.Wgs84]:fi.Wgs84,nztm:fi.Nztm2000,epsg2193:fi.Nztm2000,[fi.Nztm2000]:fi.Nztm2000,nztm2000:fi.Nztm2000,citm:fi.Citm2000,epsg3793:fi.Citm2000,[fi.Citm2000]:fi.Citm2000,citm2000:fi.Citm2000},qt=class{constructor(t){if(this.code=t,qt.Codes.has(t))throw new Error(`Duplicate EPSG code created: ${t}`);qt.Codes.set(this.code,this)}toString(){return this.code.toString()}toJSON(){return this.code}toEpsgString(){return`EPSG:${this.code}`}toUrn(){return`urn:ogc:def:crs:EPSG::${this.code}`}static get(t){let r=qt.Codes.get(t);if(r==null)throw new Error(`Invalid EPSG:${t}`);return r}static tryGet(t){if(t!=null)return qt.Codes.get(t)}static parseCode(t){var r;return t.startsWith("urn:")?g1[t.slice(t.lastIndexOf(":")+1)]:t.startsWith("https://")?g1[t.slice(t.lastIndexOf("/")+1)]:(r=g1[t.replace(/[\W_]/g,"").toLowerCase()])!==null&&r!==void 0?r:null}static parse(t){let r=qt.parseCode(t);return r==null?null:qt.get(r)}};qt.Codes=new Map;qt.Google=new qt(fi.Google);qt.Wgs84=new qt(fi.Wgs84);qt.Nztm2000=new qt(fi.Nztm2000);qt.Citm2000=new qt(fi.Citm2000);var AB="0".charCodeAt(0),PB="1".charCodeAt(0),kB="2".charCodeAt(0),zB="3".charCodeAt(0);var vc;(function(e){e[e.Xy=0]="Xy",e[e.Yx=1]="Yx"})(vc||(vc={}));function JI(e){return e===qt.Nztm2000?vc.Yx:vc.Xy}function n5(e,t){return t.scaleDenominator-e.scaleDenominator}var $a=class{constructor(t){this.zooms=[],this.indexX=0,this.indexY=1,this.zoomConversionMap=new Map,this.def=t,this.tileSize=t.tileMatrix[0].tileHeight;let r=t.tileMatrix.slice().sort(n5),a={};for(let C of r){if(a[C.identifier])throw new Error(`Duplicate tileMatrix identifier ${C.identifier}`);if(C.tileHeight!==C.tileWidth)throw new Error("Only square tiles supported");if(C.tileHeight!==this.tileSize)throw new Error("All tiles must have the same tile size");a[C.identifier]=!0}this.zooms=r;let u=qt.parse(t.supportedCRS);if(u==null)throw new Error(`Unable to find supported projection ${t.supportedCRS}`);this.projection=u,JI(this.projection)===vc.Yx&&(this.indexX=1,this.indexY=0);let{lowerCorner:o,upperCorner:m}=t.boundingBox,v=o[this.indexX],b=o[this.indexY];this.extent=new Cr(v,b,m[this.indexX]-v,m[this.indexY]-b)}get maxZoom(){return this.zooms.length-1}get identifier(){return this.def.identifier}pixelScale(t){let r=this.zooms[t];if(r==null)throw new Error(`Zoom not found :${t}`);return r.scaleDenominator*28e-5}tileToPixels(t,r){return{x:t*this.tileSize,y:r*this.tileSize}}pixelsToTile(t,r,a){let u=Math.floor(t/this.tileSize),o=Math.floor(r/this.tileSize);return{x:u,y:o,z:a}}sourceToPixels(t,r,a){let u=this.zooms[a],o=this.pixelScale(a),m=(t-u.topLeftCorner[this.indexX])/o,v=(u.topLeftCorner[this.indexY]-r)/o;return{x:m,y:v}}pixelsToSource(t,r,a){let u=this.zooms[a],o=this.pixelScale(a),m=u.topLeftCorner[this.indexX]+t*o,v=u.topLeftCorner[this.indexY]-r*o;return{x:m,y:v}}tileToSource(t){let r=this.tileToPixels(t.x,t.y);return this.pixelsToSource(r.x,r.y,t.z)}tileToSourceBounds(t){let r=this.tileToSource(t),a=this.pixelScale(t.z)*this.tileSize;return new Cr(r.x,r.y-a,a,a)}*topLevelTiles(){let{matrixWidth:r,matrixHeight:a}=this.zooms[0];for(let u=0;u<a;++u)for(let o=0;o<r;++o)yield{x:o,y:u,z:0};return null}*coverTile(t){if(t==null)return yield*this.topLevelTiles(),null;let r=t.z+1,{matrixWidth:a,matrixHeight:u}=this.zooms[t.z],{matrixWidth:o,matrixHeight:m}=this.zooms[r],v=o/a,b=m/u,C=Math.floor(t.x*v),T=Math.floor(t.y*b),B=Math.ceil((t.x+1)*v),W=Math.ceil((t.y+1)*b);for(let q=T;q<W;++q)for(let ee=C;ee<B;++ee)yield{x:ee,y:q,z:r};return null}static tileToName(t){return`${t.z}-${t.x}-${t.y}`}static nameToTile(t){let r=t.split("-");if(r.length===3){let a=Number(r[0]),u=Number(r[1]),o=Number(r[2]);if(!(isNaN(a)||isNaN(o)||isNaN(u)))return{x:u,y:o,z:a}}throw new Error(`Invalid tile name '${t}'`)}findBestZoom(t){let r=this.zoomConversionMap.get(t);return r==null&&(r=this.convertZoomLevel(t),this.zoomConversionMap.set(t,r)),r}convertZoomLevel(t){for(let r=0;r<this.zooms.length;r++){let a=this.zooms[r].scaleDenominator-t;if(a>1e-5)continue;if(r===0)return r;let u=this.zooms[r-1].scaleDenominator-t;return Math.abs(a)<u?r:r-1}return this.maxZoom}static convertZoomLevel(t,r,a,u=!0){return r.identifier===a.identifier||(t>=r.maxZoom&&(t=r.maxZoom),u&&t===0)?t:u&&t===r.maxZoom?a.maxZoom:a.findBestZoom(r.zooms[t].scaleDenominator)}};var QI={Version:"1.0.0-beta.2",License:"CC BY 4.0",BaseMapsExtension:"https://basemaps.linz.govt.nz/json-schema/stac-basemaps-extension/1.0/schema.json"};var o5={type:"TileMatrixSetType",title:"Google Maps Compatible for the World",identifier:"WebMercatorQuad",boundingBox:{type:"BoundingBoxType",crs:"http://www.opengis.net/def/crs/EPSG/0/3857",lowerCorner:[-200375083427892e-7,-200375083427892e-7],upperCorner:[200375083427892e-7,200375083427892e-7]},supportedCRS:"https://www.opengis.net/def/crs/EPSG/0/3857",wellKnownScaleSet:"https://www.opengis.net/def/wkss/OGC/1.0/GoogleMapsCompatible",tileMatrix:[{type:"TileMatrixType",identifier:"0",scaleDenominator:559082264028717e-6,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:1,matrixHeight:1},{type:"TileMatrixType",identifier:"1",scaleDenominator:279541132014358e-6,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:2,matrixHeight:2},{type:"TileMatrixType",identifier:"2",scaleDenominator:139770566007179e-6,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:4,matrixHeight:4},{type:"TileMatrixType",identifier:"3",scaleDenominator:698852830035897e-7,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:8,matrixHeight:8},{type:"TileMatrixType",identifier:"4",scaleDenominator:349426415017948e-7,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:16,matrixHeight:16},{type:"TileMatrixType",identifier:"5",scaleDenominator:174713207508974e-7,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:32,matrixHeight:32},{type:"TileMatrixType",identifier:"6",scaleDenominator:873566037544871e-8,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:64,matrixHeight:64},{type:"TileMatrixType",identifier:"7",scaleDenominator:436783018772435e-8,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:128,matrixHeight:128},{type:"TileMatrixType",identifier:"8",scaleDenominator:218391509386217e-8,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:256,matrixHeight:256},{type:"TileMatrixType",identifier:"9",scaleDenominator:109195754693108e-8,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:512,matrixHeight:512},{type:"TileMatrixType",identifier:"10",scaleDenominator:545978.773465544,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:1024,matrixHeight:1024},{type:"TileMatrixType",identifier:"11",scaleDenominator:272989.386732772,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:2048,matrixHeight:2048},{type:"TileMatrixType",identifier:"12",scaleDenominator:136494.693366386,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:4096,matrixHeight:4096},{type:"TileMatrixType",identifier:"13",scaleDenominator:68247.346683193,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:8192,matrixHeight:8192},{type:"TileMatrixType",identifier:"14",scaleDenominator:34123.6733415964,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:16384,matrixHeight:16384},{type:"TileMatrixType",identifier:"15",scaleDenominator:17061.8366707982,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:32768,matrixHeight:32768},{type:"TileMatrixType",identifier:"16",scaleDenominator:8530.91833539913,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:65536,matrixHeight:65536},{type:"TileMatrixType",identifier:"17",scaleDenominator:4265.45916769956,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:131072,matrixHeight:131072},{type:"TileMatrixType",identifier:"18",scaleDenominator:2132.72958384978,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:262144,matrixHeight:262144},{type:"TileMatrixType",identifier:"19",scaleDenominator:1066.36479192489,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:524288,matrixHeight:524288},{type:"TileMatrixType",identifier:"20",scaleDenominator:533.182395962445,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:1048576,matrixHeight:1048576},{type:"TileMatrixType",identifier:"21",scaleDenominator:266.591197981222,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:2097152,matrixHeight:2097152},{type:"TileMatrixType",identifier:"22",scaleDenominator:133.295598990611,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:4194304,matrixHeight:4194304},{type:"TileMatrixType",identifier:"23",scaleDenominator:66.6477994953056,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:8388608,matrixHeight:8388608},{type:"TileMatrixType",identifier:"24",scaleDenominator:33.3238997476528,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:16777216,matrixHeight:16777216}]},xi=new $a(o5);var Bm=Lt(tS(),1),Hs=new $a(Bm.Nztm2000),cs=new $a(Bm.Nztm2000Quad);var hs={All:[xi,Hs,cs],Defaults:new Map([[qt.Google.code,xi],[qt.Nztm2000.code,Hs]]),get(e){let t=this.tryGet(e);if(t==null)throw new Error("Failed to lookup TileMatrixSet: "+e);return t},tryGet(e){var t,r;return e==null?null:typeof e=="number"?(t=this.Defaults.get(e))!==null&&t!==void 0?t:null:(r=this.Defaults.get(e.code))!==null&&r!==void 0?r:null},find(e,t=!0){if(e==null)return null;let r=qt.parse(e);if(r!=null)return hs.tryGet(r);if(t){for(let a of hs.All)if(a.identifier===e)return a;return null}for(let a of hs.All)if(a.identifier.toLowerCase()===e.toLowerCase())return a;return null}};var Nd;(function(e){e.Png="png",e.Jpeg="jpeg",e.Webp="webp",e.Avif="avif"})(Nd||(Nd={}));var y1;(function(e){e.MapboxVectorTiles="pbf"})(y1||(y1={}));var v1;(function(e){e.aerial="aerial"})(v1||(v1={}));var sS=Lt(rS(),1),aS=Lt(nS(),1);function oS(e){return[[[e[0],e[1]],[e[2],e[1]],[e[2],e[3]],[e[0],e[3]],[e[0],e[1]]]]}var{intersection:w1,union:nN}=aS.default;function u5(e,t){return e[0]===t[0]&&e[1]===t[1]}function c5(e,t){return w1(e,oS(t))}function I1(e,t){let r=[];for(let a of e){let u=sS.default.polygon(a[0],t);u.length!==0&&(u5(u[0],u[u.length-1])||u.push(u[0]),r.push([u]))}return c5(r,t)}var Fd=e=>(e<-360?e=-(-e%360):e>360&&(e=e%360),e<-180?360+e:e>180?e-360:e),Ul=(e,t)=>{let r=t-e;return r>180?r-360:r<-180?r+360:r},h5=(e,t)=>Fd(e+(t<e?t+360-e:t-e)),Ya={boxLonCenter(e){return Fd(e[0]+.5*(e[2]<e[0]?360+e[2]-e[0]:e[2]-e[0]))},delta:Ul,crossesAM(e,t){return Math.sign(Ul(e,t))!==Math.sign(t-e)},normLon:Fd,normExtent(e){return[Fd(e[0]),e[1],Fd(e[2]),e[3]]},union(e,t){if(t==null)return e.slice();let r=Ya.boxLonCenter(e),a=Ya.boxLonCenter(t);if(Ul(r,a)<0)return this.union(t,e);let u=e.slice(),o=h5(r,a);return Ul(o,t[0])<Ul(o,e[0])&&(u[0]=t[0]),Ul(o,t[2])>Ul(o,e[2])&&(u[2]=t[2]),t[1]<e[1]&&(u[1]=t[1]),t[3]>e[3]&&(u[3]=t[3]),u},intersects(e,t){if(e[1]>t[3]||t[1]>e[3])return!1;let r=e[0],a=t[0],u=r<e[2]?e[2]:e[2]+360,o=a<t[2]?t[2]:t[2]+360;return r<=o&&a<=u||r+360<=o&&a<=u+360||r<=o+360&&a+360<=u},ringToBbox(e){if(e.length<3)throw new Error("Invalid ring");let t=!1,r=e[0],a=r[0],u=r[1],o=a,m=u,v=a;for(let b=1;b<e.length;++b){let C=e[b],T=C[0];Ya.crossesAM(v,T)&&(t=!t),t&&(T<0?T+=360:(v+=360,b===1&&(a=o=v))),T<a?a=T:T>o&&(o=T);let W=C[1];W<u?u=W:W>m&&(m=W),v=C[0]}return[this.normLon(a),u,this.normLon(o),m]},multiPolygonToBbox(e){let t=null;for(let r of e){if(r.length===0)continue;let a=r[0];if(a.length<3)continue;let u=this.ringToBbox(a);t=t==null?u:this.union(t,u)}if(t==null)throw new Error("Invalid multipolygon");return t},bboxToMultiPolygon(e){let t=[e[0],e[1]],r=[e[2],e[1]],a=[e[0],e[3]],u=[e[2],e[3]];return e[0]<e[2]?[[[t,a,u,r,t]]]:[[[t,a,[180,u[1]],[180,r[1]],t]],[[u,r,[-180,t[1]],[-180,a[1]],u]]]}};var d5=[-180,-90,180,90],p5=[180,-90,360,90];function f5(e,t,r){return[t[0]+(r[0]-t[0])*e,t[1]+(r[1]-t[1])*e]}function m5(e){let t=[];for(let r of I1(e,d5))t.push(r);for(let r of I1(e,p5))t.push(r.map(a=>a.map(u=>[u[0]-360,u[1]])));return t}function lS(e,t,r=!0){let a=!1,u=!1,o=e.map(m=>m.map(v=>{let b=[];if(v.length===0)return b;let C=v[0],T=null,B=0;for(let W of v){let q=t(W),ee=q[0];if(T!=null){let le=Ya.crossesAM(B,ee);if(le&&(a=!0,u=!u),u&&(ee<0?q[0]=ee+360:T[0]=B+360),le){let de=(180-q[0])/(T[0]-q[0]),H=t(f5(de,W,C));b.push([180,H[1]])}}b.push(q),C=W,T=q,B=ee}return b}));return a&&r?m5(o):o}function g5(e){return{type:"Polygon",coordinates:e}}function uS(e,t={}){return{type:"Feature",geometry:g5(e),properties:t}}function cS(e,t={}){return{type:"Feature",geometry:{type:"MultiPolygon",coordinates:e},properties:t}}function hS(e){e("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),e("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),e("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),e.WGS84=e["EPSG:4326"],e["EPSG:3785"]=e["EPSG:3857"],e.GOOGLE=e["EPSG:3857"],e["EPSG:900913"]=e["EPSG:3857"],e["EPSG:102113"]=e["EPSG:3857"]}var $o=1,Yo=2,bc=3,dS=4,Od=5,S1=6378137,pS=6356752314e-3,C1=.0066943799901413165,Wl=484813681109536e-20,Ze=Math.PI/2,fS=.16666666666666666,mS=.04722222222222222,gS=.022156084656084655,Je=1e-10,mr=.017453292519943295,Kn=57.29577951308232,mi=Math.PI/4,qa=Math.PI*2,gr=3.14159265359;var On={};On.greenwich=0;On.lisbon=-9.131906111111;On.paris=2.337229166667;On.bogota=-74.080916666667;On.madrid=-3.687938888889;On.rome=12.452333333333;On.bern=7.439583333333;On.jakarta=106.807719444444;On.ferro=-17.666666666667;On.brussels=4.367975;On.stockholm=18.058277777778;On.athens=23.7163375;On.oslo=10.722916666667;var yS={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}};var vS=/[\s_\-\/\(\)]/g;function go(e,t){if(e[t])return e[t];for(var r=Object.keys(e),a=t.toLowerCase().replace(vS,""),u=-1,o,m;++u<r.length;)if(o=r[u],m=o.toLowerCase().replace(vS,""),m===a)return e[o]}function Gd(e){var t={},r=e.split("+").map(function(v){return v.trim()}).filter(function(v){return v}).reduce(function(v,b){var C=b.split("=");return C.push(!0),v[C[0].toLowerCase()]=C[1],v},{}),a,u,o,m={proj:"projName",datum:"datumCode",rf:function(v){t.rf=parseFloat(v)},lat_0:function(v){t.lat0=v*mr},lat_1:function(v){t.lat1=v*mr},lat_2:function(v){t.lat2=v*mr},lat_ts:function(v){t.lat_ts=v*mr},lon_0:function(v){t.long0=v*mr},lon_1:function(v){t.long1=v*mr},lon_2:function(v){t.long2=v*mr},alpha:function(v){t.alpha=parseFloat(v)*mr},gamma:function(v){t.rectified_grid_angle=parseFloat(v)},lonc:function(v){t.longc=v*mr},x_0:function(v){t.x0=parseFloat(v)},y_0:function(v){t.y0=parseFloat(v)},k_0:function(v){t.k0=parseFloat(v)},k:function(v){t.k0=parseFloat(v)},a:function(v){t.a=parseFloat(v)},b:function(v){t.b=parseFloat(v)},r_a:function(){t.R_A=!0},zone:function(v){t.zone=parseInt(v,10)},south:function(){t.utmSouth=!0},towgs84:function(v){t.datum_params=v.split(",").map(function(b){return parseFloat(b)})},to_meter:function(v){t.to_meter=parseFloat(v)},units:function(v){t.units=v;var b=go(yS,v);b&&(t.to_meter=b.to_meter)},from_greenwich:function(v){t.from_greenwich=v*mr},pm:function(v){var b=go(On,v);t.from_greenwich=(b||parseFloat(v))*mr},nadgrids:function(v){v==="@null"?t.datumCode="none":t.nadgrids=v},axis:function(v){var b="ewnsud";v.length===3&&b.indexOf(v.substr(0,1))!==-1&&b.indexOf(v.substr(1,1))!==-1&&b.indexOf(v.substr(2,1))!==-1&&(t.axis=v)},approx:function(){t.approx=!0}};for(a in r)u=r[a],a in m?(o=m[a],typeof o=="function"?o(u):t[o]=u):t[a]=u;return typeof t.datumCode=="string"&&t.datumCode!=="WGS84"&&(t.datumCode=t.datumCode.toLowerCase()),t}var xS=_5,Vd=1,_S=2,bS=3,Fm=4,wS=5,M1=-1,y5=/\s/,v5=/[A-Za-z]/,x5=/[A-Za-z84_]/,Om=/[,\]]/,IS=/[\d\.E\-\+]/;function Xs(e){if(typeof e!="string")throw new Error("not a string");this.text=e.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=Vd}Xs.prototype.readCharicter=function(){var e=this.text[this.place++];if(this.state!==Fm)for(;y5.test(e);){if(this.place>=this.text.length)return;e=this.text[this.place++]}switch(this.state){case Vd:return this.neutral(e);case _S:return this.keyword(e);case Fm:return this.quoted(e);case wS:return this.afterquote(e);case bS:return this.number(e);case M1:return}};Xs.prototype.afterquote=function(e){if(e==='"'){this.word+='"',this.state=Fm;return}if(Om.test(e)){this.word=this.word.trim(),this.afterItem(e);return}throw new Error(`havn't handled "`+e+'" in afterquote yet, index '+this.place)};Xs.prototype.afterItem=function(e){if(e===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=Vd;return}if(e==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=Vd,this.currentObject=this.stack.pop(),this.currentObject||(this.state=M1);return}};Xs.prototype.number=function(e){if(IS.test(e)){this.word+=e;return}if(Om.test(e)){this.word=parseFloat(this.word),this.afterItem(e);return}throw new Error(`havn't handled "`+e+'" in number yet, index '+this.place)};Xs.prototype.quoted=function(e){if(e==='"'){this.state=wS;return}this.word+=e};Xs.prototype.keyword=function(e){if(x5.test(e)){this.word+=e;return}if(e==="["){var t=[];t.push(this.word),this.level++,this.root===null?this.root=t:this.currentObject.push(t),this.stack.push(this.currentObject),this.currentObject=t,this.state=Vd;return}if(Om.test(e)){this.afterItem(e);return}throw new Error(`havn't handled "`+e+'" in keyword yet, index '+this.place)};Xs.prototype.neutral=function(e){if(v5.test(e)){this.word=e,this.state=_S;return}if(e==='"'){this.word="",this.state=Fm;return}if(IS.test(e)){this.word=e,this.state=bS;return}if(Om.test(e)){this.afterItem(e);return}throw new Error(`havn't handled "`+e+'" in neutral yet, index '+this.place)};Xs.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===M1)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function _5(e){var t=new Xs(e);return t.output()}function SS(e,t,r){Array.isArray(t)&&(r.unshift(t),t=null);var a=t?{}:e,u=r.reduce(function(o,m){return Zl(m,o),o},a);t&&(e[t]=u)}function Zl(e,t){if(!Array.isArray(e)){t[e]=!0;return}var r=e.shift();if(r==="PARAMETER"&&(r=e.shift()),e.length===1){if(Array.isArray(e[0])){t[r]={},Zl(e[0],t[r]);return}t[r]=e[0];return}if(!e.length){t[r]=!0;return}if(r==="TOWGS84"){t[r]=e;return}if(r==="AXIS"){r in t||(t[r]=[]),t[r].push(e);return}Array.isArray(r)||(t[r]={});var a;switch(r){case"UNIT":case"PRIMEM":case"VERT_DATUM":t[r]={name:e[0].toLowerCase(),convert:e[1]},e.length===3&&Zl(e[2],t[r]);return;case"SPHEROID":case"ELLIPSOID":t[r]={name:e[0],a:e[1],rf:e[2]},e.length===4&&Zl(e[3],t[r]);return;case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":e[0]=["name",e[0]],SS(t,r,e);return;default:for(a=-1;++a<e.length;)if(!Array.isArray(e[a]))return Zl(e,t[r]);return SS(t,r,e)}}var b5=.017453292519943295;function w5(e,t){var r=t[0],a=t[1];!(r in e)&&a in e&&(e[r]=e[a],t.length===3&&(e[r]=t[2](e[r])))}function $s(e){return e*b5}function I5(e){if(e.type==="GEOGCS"?e.projName="longlat":e.type==="LOCAL_CS"?(e.projName="identity",e.local=!0):typeof e.PROJECTION=="object"?e.projName=Object.keys(e.PROJECTION)[0]:e.projName=e.PROJECTION,e.AXIS){for(var t="",r=0,a=e.AXIS.length;r<a;++r){var u=[e.AXIS[r][0].toLowerCase(),e.AXIS[r][1].toLowerCase()];u[0].indexOf("north")!==-1||(u[0]==="y"||u[0]==="lat")&&u[1]==="north"?t+="n":u[0].indexOf("south")!==-1||(u[0]==="y"||u[0]==="lat")&&u[1]==="south"?t+="s":u[0].indexOf("east")!==-1||(u[0]==="x"||u[0]==="lon")&&u[1]==="east"?t+="e":(u[0].indexOf("west")!==-1||(u[0]==="x"||u[0]==="lon")&&u[1]==="west")&&(t+="w")}t.length===2&&(t+="u"),t.length===3&&(e.axis=t)}e.UNIT&&(e.units=e.UNIT.name.toLowerCase(),e.units==="metre"&&(e.units="meter"),e.UNIT.convert&&(e.type==="GEOGCS"?e.DATUM&&e.DATUM.SPHEROID&&(e.to_meter=e.UNIT.convert*e.DATUM.SPHEROID.a):e.to_meter=e.UNIT.convert));var o=e.GEOGCS;e.type==="GEOGCS"&&(o=e),o&&(o.DATUM?e.datumCode=o.DATUM.name.toLowerCase():e.datumCode=o.name.toLowerCase(),e.datumCode.slice(0,2)==="d_"&&(e.datumCode=e.datumCode.slice(2)),(e.datumCode==="new_zealand_geodetic_datum_1949"||e.datumCode==="new_zealand_1949")&&(e.datumCode="nzgd49"),(e.datumCode==="wgs_1984"||e.datumCode==="world_geodetic_system_1984")&&(e.PROJECTION==="Mercator_Auxiliary_Sphere"&&(e.sphere=!0),e.datumCode="wgs84"),e.datumCode.slice(-6)==="_ferro"&&(e.datumCode=e.datumCode.slice(0,-6)),e.datumCode.slice(-8)==="_jakarta"&&(e.datumCode=e.datumCode.slice(0,-8)),~e.datumCode.indexOf("belge")&&(e.datumCode="rnb72"),o.DATUM&&o.DATUM.SPHEROID&&(e.ellps=o.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),e.ellps.toLowerCase().slice(0,13)==="international"&&(e.ellps="intl"),e.a=o.DATUM.SPHEROID.a,e.rf=parseFloat(o.DATUM.SPHEROID.rf,10)),o.DATUM&&o.DATUM.TOWGS84&&(e.datum_params=o.DATUM.TOWGS84),~e.datumCode.indexOf("osgb_1936")&&(e.datumCode="osgb36"),~e.datumCode.indexOf("osni_1952")&&(e.datumCode="osni52"),(~e.datumCode.indexOf("tm65")||~e.datumCode.indexOf("geodetic_datum_of_1965"))&&(e.datumCode="ire65"),e.datumCode==="ch1903+"&&(e.datumCode="ch1903"),~e.datumCode.indexOf("israel")&&(e.datumCode="isr93")),e.b&&!isFinite(e.b)&&(e.b=e.a);function m(C){var T=e.to_meter||1;return C*T}var v=function(C){return w5(e,C)},b=[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",$s],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",$s],["x0","false_easting",m],["y0","false_northing",m],["long0","central_meridian",$s],["lat0","latitude_of_origin",$s],["lat0","standard_parallel_1",$s],["lat1","standard_parallel_1",$s],["lat2","standard_parallel_2",$s],["azimuth","Azimuth"],["alpha","azimuth",$s],["srsCode","name"]];b.forEach(v),!e.long0&&e.longc&&(e.projName==="Albers_Conic_Equal_Area"||e.projName==="Lambert_Azimuthal_Equal_Area")&&(e.long0=e.longc),!e.lat_ts&&e.lat1&&(e.projName==="Stereographic_South_Pole"||e.projName==="Polar Stereographic (variant B)")&&(e.lat0=$s(e.lat1>0?90:-90),e.lat_ts=e.lat1)}function Gm(e){var t=xS(e),r=t.shift(),a=t.shift();t.unshift(["name",a]),t.unshift(["type",r]);var u={};return Zl(t,u),I5(u),u}function Ro(e){var t=this;if(arguments.length===2){var r=arguments[1];typeof r=="string"?r.charAt(0)==="+"?Ro[e]=Gd(arguments[1]):Ro[e]=Gm(arguments[1]):Ro[e]=r}else if(arguments.length===1){if(Array.isArray(e))return e.map(function(a){Array.isArray(a)?Ro.apply(t,a):Ro(a)});if(typeof e=="string"){if(e in Ro)return Ro[e]}else"EPSG"in e?Ro["EPSG:"+e.EPSG]=e:"ESRI"in e?Ro["ESRI:"+e.ESRI]=e:"IAU2000"in e?Ro["IAU2000:"+e.IAU2000]=e:console.log(e);return}}hS(Ro);var wc=Ro;function S5(e){return typeof e=="string"}function C5(e){return e in wc}var M5=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function E5(e){return M5.some(function(t){return e.indexOf(t)>-1})}var T5=["3857","900913","3785","102113"];function A5(e){var t=go(e,"authority");if(!!t){var r=go(t,"epsg");return r&&T5.indexOf(r)>-1}}function P5(e){var t=go(e,"extension");if(!!t)return go(t,"proj4")}function k5(e){return e[0]==="+"}function z5(e){if(S5(e)){if(C5(e))return wc[e];if(E5(e)){var t=Gm(e);if(A5(t))return wc["EPSG:3857"];var r=P5(t);return r?Gd(r):t}if(k5(e))return Gd(e)}else return e}var CS=z5;function E1(e,t){e=e||{};var r,a;if(!t)return e;for(a in t)r=t[a],r!==void 0&&(e[a]=r);return e}function wn(e,t,r){var a=e*t;return r/Math.sqrt(1-a*a)}function ds(e){return e<0?-1:1}function et(e){return Math.abs(e)<=gr?e:e-ds(e)*qa}function Gn(e,t,r){var a=e*r,u=.5*e;return a=Math.pow((1-a)/(1+a),u),Math.tan(.5*(Ze-t))/a}function Ys(e,t){for(var r=.5*e,a,u,o=Ze-2*Math.atan(t),m=0;m<=15;m++)if(a=e*Math.sin(o),u=Ze-2*Math.atan(t*Math.pow((1-a)/(1+a),r))-o,o+=u,Math.abs(u)<=1e-10)return o;return-9999}function L5(){var e=this.b/this.a;this.es=1-e*e,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=wn(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function R5(e){var t=e.x,r=e.y;if(r*Kn>90&&r*Kn<-90&&t*Kn>180&&t*Kn<-180)return null;var a,u;if(Math.abs(Math.abs(r)-Ze)<=Je)return null;if(this.sphere)a=this.x0+this.a*this.k0*et(t-this.long0),u=this.y0+this.a*this.k0*Math.log(Math.tan(mi+.5*r));else{var o=Math.sin(r),m=Gn(this.e,r,o);a=this.x0+this.a*this.k0*et(t-this.long0),u=this.y0-this.a*this.k0*Math.log(m)}return e.x=a,e.y=u,e}function D5(e){var t=e.x-this.x0,r=e.y-this.y0,a,u;if(this.sphere)u=Ze-2*Math.atan(Math.exp(-r/(this.a*this.k0)));else{var o=Math.exp(-r/(this.a*this.k0));if(u=Ys(this.e,o),u===-9999)return null}return a=et(this.long0+t/(this.a*this.k0)),e.x=a,e.y=u,e}var B5=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"],MS={init:L5,forward:R5,inverse:D5,names:B5};function N5(){}function ES(e){return e}var F5=["longlat","identity"],TS={init:N5,forward:ES,inverse:ES,names:F5};var O5=[MS,TS],Vm={},Um=[];function AS(e,t){var r=Um.length;return e.names?(Um[r]=e,e.names.forEach(function(a){Vm[a.toLowerCase()]=r}),this):(console.log(t),!0)}function G5(e){if(!e)return!1;var t=e.toLowerCase();if(typeof Vm[t]<"u"&&Um[Vm[t]])return Um[Vm[t]]}function V5(){O5.forEach(AS)}var PS={start:V5,add:AS,get:G5};var Ut={};Ut.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"};Ut.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"};Ut.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"};Ut.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"};Ut.airy={a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"};Ut.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"};Ut.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"};Ut.mod_airy={a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"};Ut.andrae={a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"};Ut.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"};Ut.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"};Ut.bessel={a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"};Ut.bess_nam={a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"};Ut.clrk66={a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"};Ut.clrk80={a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."};Ut.clrk58={a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"};Ut.CPM={a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"};Ut.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"};Ut.engelis={a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"};Ut.evrst30={a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"};Ut.evrst48={a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"};Ut.evrst56={a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"};Ut.evrst69={a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"};Ut.evrstSS={a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"};Ut.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"};Ut.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"};Ut.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"};Ut.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"};Ut.hough={a:6378270,rf:297,ellipseName:"Hough"};Ut.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"};Ut.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"};Ut.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"};Ut.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"};Ut.new_intl={a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"};Ut.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"};Ut.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"};Ut.SEasia={a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"};Ut.walbeck={a:6376896,b:63558348467e-4,ellipseName:"Walbeck"};Ut.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"};Ut.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"};Ut.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var kS=Ut.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};Ut.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};function zS(e,t,r,a){var u=e*e,o=t*t,m=(u-o)/u,v=0;a?(e*=1-m*(fS+m*(mS+m*gS)),u=e*e,m=0):v=Math.sqrt(m);var b=(u-o)/o;return{es:m,e:v,ep2:b}}function LS(e,t,r,a,u){if(!e){var o=go(Ut,a);o||(o=kS),e=o.a,t=o.b,r=o.rf}return r&&!t&&(t=(1-1/r)*e),(r===0||Math.abs(e-t)<Je)&&(u=!0,t=e),{a:e,b:t,rf:r,sphere:u}}var Wr={};Wr.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"};Wr.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"};Wr.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"};Wr.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"};Wr.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"};Wr.potsdam={towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"};Wr.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"};Wr.hermannskogel={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"};Wr.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"};Wr.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"};Wr.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"};Wr.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"};Wr.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"};Wr.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"};Wr.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"};Wr.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"};Wr.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"};function U5(e,t,r,a,u,o,m){var v={};return e===void 0||e==="none"?v.datum_type=Od:v.datum_type=dS,t&&(v.datum_params=t.map(parseFloat),(v.datum_params[0]!==0||v.datum_params[1]!==0||v.datum_params[2]!==0)&&(v.datum_type=$o),v.datum_params.length>3&&(v.datum_params[3]!==0||v.datum_params[4]!==0||v.datum_params[5]!==0||v.datum_params[6]!==0)&&(v.datum_type=Yo,v.datum_params[3]*=Wl,v.datum_params[4]*=Wl,v.datum_params[5]*=Wl,v.datum_params[6]=v.datum_params[6]/1e6+1)),m&&(v.datum_type=bc,v.grids=m),v.a=r,v.b=a,v.es=u,v.ep2=o,v}var RS=U5;var DS={};function A1(e,t){var r=new DataView(t),a=Z5(r),u=j5(r,a);u.nSubgrids>1&&console.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var o=H5(r,u,a),m={header:u,subgrids:o};return DS[e]=m,m}function BS(e){if(e===void 0)return null;var t=e.split(",");return t.map(W5)}function W5(e){if(e.length===0)return null;var t=e[0]==="@";return t&&(e=e.slice(1)),e==="null"?{name:"null",mandatory:!t,grid:null,isNull:!0}:{name:e,mandatory:!t,grid:DS[e]||null,isNull:!1}}function Ic(e){return e/3600*Math.PI/180}function Z5(e){var t=e.getInt32(8,!1);return t===11?!1:(t=e.getInt32(8,!0),t!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function j5(e,t){return{nFields:e.getInt32(8,t),nSubgridFields:e.getInt32(24,t),nSubgrids:e.getInt32(40,t),shiftType:T1(e,56,56+8).trim(),fromSemiMajorAxis:e.getFloat64(120,t),fromSemiMinorAxis:e.getFloat64(136,t),toSemiMajorAxis:e.getFloat64(152,t),toSemiMinorAxis:e.getFloat64(168,t)}}function T1(e,t,r){return String.fromCharCode.apply(null,new Uint8Array(e.buffer.slice(t,r)))}function H5(e,t,r){for(var a=176,u=[],o=0;o<t.nSubgrids;o++){var m=$5(e,a,r),v=Y5(e,a,m,r),b=Math.round(1+(m.upperLongitude-m.lowerLongitude)/m.longitudeInterval),C=Math.round(1+(m.upperLatitude-m.lowerLatitude)/m.latitudeInterval);u.push({ll:[Ic(m.lowerLongitude),Ic(m.lowerLatitude)],del:[Ic(m.longitudeInterval),Ic(m.latitudeInterval)],lim:[b,C],count:m.gridNodeCount,cvs:X5(v)})}return u}function X5(e){return e.map(function(t){return[Ic(t.longitudeShift),Ic(t.latitudeShift)]})}function $5(e,t,r){return{name:T1(e,t+8,t+16).trim(),parent:T1(e,t+24,t+24+8).trim(),lowerLatitude:e.getFloat64(t+72,r),upperLatitude:e.getFloat64(t+88,r),lowerLongitude:e.getFloat64(t+104,r),upperLongitude:e.getFloat64(t+120,r),latitudeInterval:e.getFloat64(t+136,r),longitudeInterval:e.getFloat64(t+152,r),gridNodeCount:e.getInt32(t+168,r)}}function Y5(e,t,r,a){for(var u=t+176,o=16,m=[],v=0;v<r.gridNodeCount;v++){var b={latitudeShift:e.getFloat32(u+v*o,a),longitudeShift:e.getFloat32(u+v*o+4,a),latitudeAccuracy:e.getFloat32(u+v*o+8,a),longitudeAccuracy:e.getFloat32(u+v*o+12,a)};m.push(b)}return m}function Sc(e,t){if(!(this instanceof Sc))return new Sc(e);t=t||function(C){if(C)throw C};var r=CS(e);if(typeof r!="object"){t(e);return}var a=Sc.projections.get(r.projName);if(!a){t(e);return}if(r.datumCode&&r.datumCode!=="none"){var u=go(Wr,r.datumCode);u&&(r.datum_params=r.datum_params||(u.towgs84?u.towgs84.split(","):null),r.ellps=u.ellipse,r.datumName=u.datumName?u.datumName:r.datumCode)}r.k0=r.k0||1,r.axis=r.axis||"enu",r.ellps=r.ellps||"wgs84",r.lat1=r.lat1||r.lat0;var o=LS(r.a,r.b,r.rf,r.ellps,r.sphere),m=zS(o.a,o.b,o.rf,r.R_A),v=BS(r.nadgrids),b=r.datum||RS(r.datumCode,r.datum_params,o.a,o.b,m.es,m.ep2,v);E1(this,r),E1(this,a),this.a=o.a,this.b=o.b,this.rf=o.rf,this.sphere=o.sphere,this.es=m.es,this.e=m.e,this.ep2=m.ep2,this.datum=b,this.init(),t(null,this)}Sc.projections=PS;Sc.projections.start();var Ja=Sc;function NS(e,t){return e.datum_type!==t.datum_type||e.a!==t.a||Math.abs(e.es-t.es)>5e-11?!1:e.datum_type===$o?e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]:e.datum_type===Yo?e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]&&e.datum_params[3]===t.datum_params[3]&&e.datum_params[4]===t.datum_params[4]&&e.datum_params[5]===t.datum_params[5]&&e.datum_params[6]===t.datum_params[6]:!0}function Wm(e,t,r){var a=e.x,u=e.y,o=e.z?e.z:0,m,v,b,C;if(u<-Ze&&u>-1.001*Ze)u=-Ze;else if(u>Ze&&u<1.001*Ze)u=Ze;else{if(u<-Ze)return{x:-1/0,y:-1/0,z:e.z};if(u>Ze)return{x:1/0,y:1/0,z:e.z}}return a>Math.PI&&(a-=2*Math.PI),v=Math.sin(u),C=Math.cos(u),b=v*v,m=r/Math.sqrt(1-t*b),{x:(m+o)*C*Math.cos(a),y:(m+o)*C*Math.sin(a),z:(m*(1-t)+o)*v}}function Zm(e,t,r,a){var u=1e-12,o=u*u,m=30,v,b,C,T,B,W,q,ee,le,de,H,Q,te,ve=e.x,Me=e.y,Ce=e.z?e.z:0,Be,Fe,qe;if(v=Math.sqrt(ve*ve+Me*Me),b=Math.sqrt(ve*ve+Me*Me+Ce*Ce),v/r<u){if(Be=0,b/r<u)return Fe=Ze,qe=-a,{x:e.x,y:e.y,z:e.z}}else Be=Math.atan2(Me,ve);C=Ce/b,T=v/b,B=1/Math.sqrt(1-t*(2-t)*T*T),ee=T*(1-t)*B,le=C*B,te=0;do te++,q=r/Math.sqrt(1-t*le*le),qe=v*ee+Ce*le-q*(1-t*le*le),W=t*q/(q+qe),B=1/Math.sqrt(1-W*(2-W)*T*T),de=T*(1-W)*B,H=C*B,Q=H*ee-de*le,ee=de,le=H;while(Q*Q>o&&te<m);return Fe=Math.atan(H/Math.abs(de)),{x:Be,y:Fe,z:qe}}function FS(e,t,r){if(t===$o)return{x:e.x+r[0],y:e.y+r[1],z:e.z+r[2]};if(t===Yo){var a=r[0],u=r[1],o=r[2],m=r[3],v=r[4],b=r[5],C=r[6];return{x:C*(e.x-b*e.y+v*e.z)+a,y:C*(b*e.x+e.y-m*e.z)+u,z:C*(-v*e.x+m*e.y+e.z)+o}}}function OS(e,t,r){if(t===$o)return{x:e.x-r[0],y:e.y-r[1],z:e.z-r[2]};if(t===Yo){var a=r[0],u=r[1],o=r[2],m=r[3],v=r[4],b=r[5],C=r[6],T=(e.x-a)/C,B=(e.y-u)/C,W=(e.z-o)/C;return{x:T+b*B-v*W,y:-b*T+B+m*W,z:v*T-m*B+W}}}function jm(e){return e===$o||e===Yo}function US(e,t,r){if(NS(e,t)||e.datum_type===Od||t.datum_type===Od)return r;var a=e.a,u=e.es;if(e.datum_type===bc){var o=GS(e,!1,r);if(o!==0)return;a=S1,u=C1}var m=t.a,v=t.b,b=t.es;if(t.datum_type===bc&&(m=S1,v=pS,b=C1),u===b&&a===m&&!jm(e.datum_type)&&!jm(t.datum_type))return r;if(r=Wm(r,u,a),jm(e.datum_type)&&(r=FS(r,e.datum_type,e.datum_params)),jm(t.datum_type)&&(r=OS(r,t.datum_type,t.datum_params)),r=Zm(r,b,m,v),t.datum_type===bc){var C=GS(t,!0,r);if(C!==0)return}return r}function GS(e,t,r){if(e.grids===null||e.grids.length===0)return console.log("Grid shift grids not found"),-1;for(var a={x:-r.x,y:r.y},u={x:Number.NaN,y:Number.NaN},o=!1,m=[],v=0;v<e.grids.length;v++){var b=e.grids[v];if(m.push(b.name),b.isNull){u=a;break}if(o=b.mandatory,b.grid===null){if(b.mandatory)return console.log("Unable to find mandatory grid '"+b.name+"'"),-1;continue}var C=b.grid.subgrids[0],T=(Math.abs(C.del[1])+Math.abs(C.del[0]))/1e4,B=C.ll[0]-T,W=C.ll[1]-T,q=C.ll[0]+(C.lim[0]-1)*C.del[0]+T,ee=C.ll[1]+(C.lim[1]-1)*C.del[1]+T;if(!(W>a.y||B>a.x||ee<a.y||q<a.x)&&(u=q5(a,t,C),!isNaN(u.x)))break}return isNaN(u.x)?(console.log("Failed to find a grid shift table for location '"+-a.x*Kn+" "+a.y*Kn+" tried: '"+m+"'"),-1):(r.x=-u.x,r.y=u.y,0)}function q5(e,t,r){var a={x:Number.NaN,y:Number.NaN};if(isNaN(e.x))return a;var u={x:e.x,y:e.y};u.x-=r.ll[0],u.y-=r.ll[1],u.x=et(u.x-Math.PI)+Math.PI;var o=VS(u,r);if(t){if(isNaN(o.x))return a;o.x=u.x-o.x,o.y=u.y-o.y;var m=9,v=1e-12,b,C;do{if(C=VS(o,r),isNaN(C.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}b={x:u.x-(C.x+o.x),y:u.y-(C.y+o.y)},o.x+=b.x,o.y+=b.y}while(m--&&Math.abs(b.x)>v&&Math.abs(b.y)>v);if(m<0)return console.log("Inverse grid shift iterator failed to converge."),a;a.x=et(o.x+r.ll[0]),a.y=o.y+r.ll[1]}else isNaN(o.x)||(a.x=e.x+o.x,a.y=e.y+o.y);return a}function VS(e,t){var r={x:e.x/t.del[0],y:e.y/t.del[1]},a={x:Math.floor(r.x),y:Math.floor(r.y)},u={x:r.x-1*a.x,y:r.y-1*a.y},o={x:Number.NaN,y:Number.NaN},m;if(a.x<0||a.x>=t.lim[0]||a.y<0||a.y>=t.lim[1])return o;m=a.y*t.lim[0]+a.x;var v={x:t.cvs[m][0],y:t.cvs[m][1]};m++;var b={x:t.cvs[m][0],y:t.cvs[m][1]};m+=t.lim[0];var C={x:t.cvs[m][0],y:t.cvs[m][1]};m--;var T={x:t.cvs[m][0],y:t.cvs[m][1]},B=u.x*u.y,W=u.x*(1-u.y),q=(1-u.x)*(1-u.y),ee=(1-u.x)*u.y;return o.x=q*v.x+W*b.x+ee*T.x+B*C.x,o.y=q*v.y+W*b.y+ee*T.y+B*C.y,o}function P1(e,t,r){var a=r.x,u=r.y,o=r.z||0,m,v,b,C={};for(b=0;b<3;b++)if(!(t&&b===2&&r.z===void 0))switch(b===0?(m=a,"ew".indexOf(e.axis[b])!==-1?v="x":v="y"):b===1?(m=u,"ns".indexOf(e.axis[b])!==-1?v="y":v="x"):(m=o,v="z"),e.axis[b]){case"e":C[v]=m;break;case"w":C[v]=-m;break;case"n":C[v]=m;break;case"s":C[v]=-m;break;case"u":r[v]!==void 0&&(C.z=m);break;case"d":r[v]!==void 0&&(C.z=-m);break;default:return null}return C}function Hm(e){var t={x:e[0],y:e[1]};return e.length>2&&(t.z=e[2]),e.length>3&&(t.m=e[3]),t}function ZS(e){WS(e.x),WS(e.y)}function WS(e){if(typeof Number.isFinite=="function"){if(Number.isFinite(e))return;throw new TypeError("coordinates must be finite numbers")}if(typeof e!="number"||e!==e||!isFinite(e))throw new TypeError("coordinates must be finite numbers")}function J5(e,t){return(e.datum.datum_type===$o||e.datum.datum_type===Yo)&&t.datumCode!=="WGS84"||(t.datum.datum_type===$o||t.datum.datum_type===Yo)&&e.datumCode!=="WGS84"}function jl(e,t,r,a){var u;if(Array.isArray(r)&&(r=Hm(r)),ZS(r),e.datum&&t.datum&&J5(e,t)&&(u=new Ja("WGS84"),r=jl(e,u,r,a),e=u),a&&e.axis!=="enu"&&(r=P1(e,!1,r)),e.projName==="longlat")r={x:r.x*mr,y:r.y*mr,z:r.z||0};else if(e.to_meter&&(r={x:r.x*e.to_meter,y:r.y*e.to_meter,z:r.z||0}),r=e.inverse(r),!r)return;if(e.from_greenwich&&(r.x+=e.from_greenwich),r=US(e.datum,t.datum,r),!!r)return t.from_greenwich&&(r={x:r.x-t.from_greenwich,y:r.y,z:r.z||0}),t.projName==="longlat"?r={x:r.x*Kn,y:r.y*Kn,z:r.z||0}:(r=t.forward(r),t.to_meter&&(r={x:r.x/t.to_meter,y:r.y/t.to_meter,z:r.z||0})),a&&t.axis!=="enu"?P1(t,!0,r):r}var jS=Ja("WGS84");function k1(e,t,r,a){var u,o,m;return Array.isArray(r)?(u=jl(e,t,r,a)||{x:NaN,y:NaN},r.length>2?typeof e.name<"u"&&e.name==="geocent"||typeof t.name<"u"&&t.name==="geocent"?typeof u.z=="number"?[u.x,u.y,u.z].concat(r.splice(3)):[u.x,u.y,r[2]].concat(r.splice(3)):[u.x,u.y].concat(r.splice(2)):[u.x,u.y]):(o=jl(e,t,r,a),m=Object.keys(r),m.length===2||m.forEach(function(v){if(typeof e.name<"u"&&e.name==="geocent"||typeof t.name<"u"&&t.name==="geocent"){if(v==="x"||v==="y"||v==="z")return}else if(v==="x"||v==="y")return;o[v]=r[v]}),o)}function HS(e){return e instanceof Ja?e:e.oProj?e.oProj:Ja(e)}function Q5(e,t,r){e=HS(e);var a=!1,u;return typeof t>"u"?(t=e,e=jS,a=!0):(typeof t.x<"u"||Array.isArray(t))&&(r=t,t=e,e=jS,a=!0),t=HS(t),r?k1(e,t,r):(u={forward:function(o,m){return k1(e,t,o,m)},inverse:function(o,m){return k1(t,e,o,m)}},a&&(u.oProj=t),u)}var eo=Q5;var XS=6,YS="AJSAJS",qS="AFAFAF",Cc=65,to=73,Do=79,Ud=86,Wd=90,JS={forward:L1,inverse:K5,toPoint:R1};function L1(e,t){return t=t||5,ik(ek({lat:e[1],lon:e[0]}),t)}function K5(e){var t=D1(KS(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat,t.lon,t.lat]:[t.left,t.bottom,t.right,t.top]}function R1(e){var t=D1(KS(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function z1(e){return e*(Math.PI/180)}function $S(e){return 180*(e/Math.PI)}function ek(e){var t=e.lat,r=e.lon,a=6378137,u=.00669438,o=.9996,m,v,b,C,T,B,W,q=z1(t),ee=z1(r),le,de;de=Math.floor((r+180)/6)+1,r===180&&(de=60),t>=56&&t<64&&r>=3&&r<12&&(de=32),t>=72&&t<84&&(r>=0&&r<9?de=31:r>=9&&r<21?de=33:r>=21&&r<33?de=35:r>=33&&r<42&&(de=37)),m=(de-1)*6-180+3,le=z1(m),v=u/(1-u),b=a/Math.sqrt(1-u*Math.sin(q)*Math.sin(q)),C=Math.tan(q)*Math.tan(q),T=v*Math.cos(q)*Math.cos(q),B=Math.cos(q)*(ee-le),W=a*((1-u/4-3*u*u/64-5*u*u*u/256)*q-(3*u/8+3*u*u/32+45*u*u*u/1024)*Math.sin(2*q)+(15*u*u/256+45*u*u*u/1024)*Math.sin(4*q)-35*u*u*u/3072*Math.sin(6*q));var H=o*b*(B+(1-C+T)*B*B*B/6+(5-18*C+C*C+72*T-58*v)*B*B*B*B*B/120)+5e5,Q=o*(W+b*Math.tan(q)*(B*B/2+(5-C+9*T+4*T*T)*B*B*B*B/24+(61-58*C+C*C+600*T-330*v)*B*B*B*B*B*B/720));return t<0&&(Q+=1e7),{northing:Math.round(Q),easting:Math.round(H),zoneNumber:de,zoneLetter:tk(t)}}function D1(e){var t=e.northing,r=e.easting,a=e.zoneLetter,u=e.zoneNumber;if(u<0||u>60)return null;var o=.9996,m=6378137,v=.00669438,b,C=(1-Math.sqrt(1-v))/(1+Math.sqrt(1-v)),T,B,W,q,ee,le,de,H,Q,te=r-5e5,ve=t;a<"N"&&(ve-=1e7),de=(u-1)*6-180+3,b=v/(1-v),le=ve/o,H=le/(m*(1-v/4-3*v*v/64-5*v*v*v/256)),Q=H+(3*C/2-27*C*C*C/32)*Math.sin(2*H)+(21*C*C/16-55*C*C*C*C/32)*Math.sin(4*H)+151*C*C*C/96*Math.sin(6*H),T=m/Math.sqrt(1-v*Math.sin(Q)*Math.sin(Q)),B=Math.tan(Q)*Math.tan(Q),W=b*Math.cos(Q)*Math.cos(Q),q=m*(1-v)/Math.pow(1-v*Math.sin(Q)*Math.sin(Q),1.5),ee=te/(T*o);var Me=Q-T*Math.tan(Q)/q*(ee*ee/2-(5+3*B+10*W-4*W*W-9*b)*ee*ee*ee*ee/24+(61+90*B+298*W+45*B*B-252*b-3*W*W)*ee*ee*ee*ee*ee*ee/720);Me=$S(Me);var Ce=(ee-(1+2*B+W)*ee*ee*ee/6+(5-2*W+28*B-3*W*W+8*b+24*B*B)*ee*ee*ee*ee*ee/120)/Math.cos(Q);Ce=de+$S(Ce);var Be;if(e.accuracy){var Fe=D1({northing:e.northing+e.accuracy,easting:e.easting+e.accuracy,zoneLetter:e.zoneLetter,zoneNumber:e.zoneNumber});Be={top:Fe.lat,right:Fe.lon,bottom:Me,left:Ce}}else Be={lat:Me,lon:Ce};return Be}function tk(e){var t="Z";return 84>=e&&e>=72?t="X":72>e&&e>=64?t="W":64>e&&e>=56?t="V":56>e&&e>=48?t="U":48>e&&e>=40?t="T":40>e&&e>=32?t="S":32>e&&e>=24?t="R":24>e&&e>=16?t="Q":16>e&&e>=8?t="P":8>e&&e>=0?t="N":0>e&&e>=-8?t="M":-8>e&&e>=-16?t="L":-16>e&&e>=-24?t="K":-24>e&&e>=-32?t="J":-32>e&&e>=-40?t="H":-40>e&&e>=-48?t="G":-48>e&&e>=-56?t="F":-56>e&&e>=-64?t="E":-64>e&&e>=-72?t="D":-72>e&&e>=-80&&(t="C"),t}function ik(e,t){var r="00000"+e.easting,a="00000"+e.northing;return e.zoneNumber+e.zoneLetter+rk(e.easting,e.northing,e.zoneNumber)+r.substr(r.length-5,t)+a.substr(a.length-5,t)}function rk(e,t,r){var a=QS(r),u=Math.floor(e/1e5),o=Math.floor(t/1e5)%20;return nk(u,o,a)}function QS(e){var t=e%XS;return t===0&&(t=XS),t}function nk(e,t,r){var a=r-1,u=YS.charCodeAt(a),o=qS.charCodeAt(a),m=u+e-1,v=o+t,b=!1;m>Wd&&(m=m-Wd+Cc-1,b=!0),(m===to||u<to&&m>to||(m>to||u<to)&&b)&&m++,(m===Do||u<Do&&m>Do||(m>Do||u<Do)&&b)&&(m++,m===to&&m++),m>Wd&&(m=m-Wd+Cc-1),v>Ud?(v=v-Ud+Cc-1,b=!0):b=!1,(v===to||o<to&&v>to||(v>to||o<to)&&b)&&v++,(v===Do||o<Do&&v>Do||(v>Do||o<Do)&&b)&&(v++,v===to&&v++),v>Ud&&(v=v-Ud+Cc-1);var C=String.fromCharCode(m)+String.fromCharCode(v);return C}function KS(e){if(e&&e.length===0)throw"MGRSPoint coverting from nothing";for(var t=e.length,r=null,a="",u,o=0;!/[A-Z]/.test(u=e.charAt(o));){if(o>=2)throw"MGRSPoint bad conversion from: "+e;a+=u,o++}var m=parseInt(a,10);if(o===0||o+3>t)throw"MGRSPoint bad conversion from: "+e;var v=e.charAt(o++);if(v<="A"||v==="B"||v==="Y"||v>="Z"||v==="I"||v==="O")throw"MGRSPoint zone letter "+v+" not handled: "+e;r=e.substring(o,o+=2);for(var b=QS(m),C=ok(r.charAt(0),b),T=sk(r.charAt(1),b);T<ak(v);)T+=2e6;var B=t-o;if(B%2!==0)throw`MGRSPoint has to have an even number
|
|
513
|
-
of digits after the zone letter and two 100km letters - front
|
|
514
|
-
half for easting meters, second half for
|
|
515
|
-
northing meters`+e;var W=B/2,q=0,ee=0,le,de,H,Q,te;return W>0&&(le=1e5/Math.pow(10,W),de=e.substring(o,o+W),q=parseFloat(de)*le,H=e.substring(o+W),ee=parseFloat(H)*le),Q=q+C,te=ee+T,{easting:Q,northing:te,zoneLetter:v,zoneNumber:m,accuracy:le}}function ok(e,t){for(var r=YS.charCodeAt(t-1),a=1e5,u=!1;r!==e.charCodeAt(0);){if(r++,r===to&&r++,r===Do&&r++,r>Wd){if(u)throw"Bad character: "+e;r=Cc,u=!0}a+=1e5}return a}function sk(e,t){if(e>"V")throw"MGRSPoint given invalid Northing "+e;for(var r=qS.charCodeAt(t-1),a=0,u=!1;r!==e.charCodeAt(0);){if(r++,r===to&&r++,r===Do&&r++,r>Ud){if(u)throw"Bad character: "+e;r=Cc,u=!0}a+=1e5}return a}function ak(e){var t;switch(e){case"C":t=11e5;break;case"D":t=2e6;break;case"E":t=28e5;break;case"F":t=37e5;break;case"G":t=46e5;break;case"H":t=55e5;break;case"J":t=64e5;break;case"K":t=73e5;break;case"L":t=82e5;break;case"M":t=91e5;break;case"N":t=0;break;case"P":t=8e5;break;case"Q":t=17e5;break;case"R":t=26e5;break;case"S":t=35e5;break;case"T":t=44e5;break;case"U":t=53e5;break;case"V":t=62e5;break;case"W":t=7e6;break;case"X":t=79e5;break;default:t=-1}if(t>=0)return t;throw"Invalid zone letter: "+e}function Mc(e,t,r){if(!(this instanceof Mc))return new Mc(e,t,r);if(Array.isArray(e))this.x=e[0],this.y=e[1],this.z=e[2]||0;else if(typeof e=="object")this.x=e.x,this.y=e.y,this.z=e.z||0;else if(typeof e=="string"&&typeof t>"u"){var a=e.split(",");this.x=parseFloat(a[0],10),this.y=parseFloat(a[1],10),this.z=parseFloat(a[2],10)||0}else this.x=e,this.y=t,this.z=r||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Mc.fromMGRS=function(e){return new Mc(R1(e))};Mc.prototype.toMGRS=function(e){return L1([this.x,this.y],e)};var eC=Mc;var lk=1,uk=.25,tC=.046875,iC=.01953125,rC=.01068115234375,ck=.75,hk=.46875,dk=.013020833333333334,pk=.007120768229166667,fk=.3645833333333333,mk=.005696614583333333,gk=.3076171875;function Xm(e){var t=[];t[0]=lk-e*(uk+e*(tC+e*(iC+e*rC))),t[1]=e*(ck-e*(tC+e*(iC+e*rC)));var r=e*e;return t[2]=r*(hk-e*(dk+e*pk)),r*=e,t[3]=r*(fk-e*mk),t[4]=r*e*gk,t}function Hl(e,t,r,a){return r*=t,t*=t,a[0]*e-r*(a[1]+t*(a[2]+t*(a[3]+t*a[4])))}var yk=20;function $m(e,t,r){for(var a=1/(1-t),u=e,o=yk;o;--o){var m=Math.sin(u),v=1-t*m*m;if(v=(Hl(u,m,Math.cos(u),r)-e)*(v*Math.sqrt(v))*a,u-=v,Math.abs(v)<Je)return u}return u}function vk(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.es&&(this.en=Xm(this.es),this.ml0=Hl(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function xk(e){var t=e.x,r=e.y,a=et(t-this.long0),u,o,m,v=Math.sin(r),b=Math.cos(r);if(this.es){var T=b*a,B=Math.pow(T,2),W=this.ep2*Math.pow(b,2),q=Math.pow(W,2),ee=Math.abs(b)>Je?Math.tan(r):0,le=Math.pow(ee,2),de=Math.pow(le,2);u=1-this.es*Math.pow(v,2),T=T/Math.sqrt(u);var H=Hl(r,v,b,this.en);o=this.a*(this.k0*T*(1+B/6*(1-le+W+B/20*(5-18*le+de+14*W-58*le*W+B/42*(61+179*de-de*le-479*le)))))+this.x0,m=this.a*(this.k0*(H-this.ml0+v*a*T/2*(1+B/12*(5-le+9*W+4*q+B/30*(61+de-58*le+270*W-330*le*W+B/56*(1385+543*de-de*le-3111*le))))))+this.y0}else{var C=b*Math.sin(a);if(Math.abs(Math.abs(C)-1)<Je)return 93;if(o=.5*this.a*this.k0*Math.log((1+C)/(1-C))+this.x0,m=b*Math.cos(a)/Math.sqrt(1-Math.pow(C,2)),C=Math.abs(m),C>=1){if(C-1>Je)return 93;m=0}else m=Math.acos(m);r<0&&(m=-m),m=this.a*this.k0*(m-this.lat0)+this.y0}return e.x=o,e.y=m,e}function _k(e){var t,r,a,u,o=(e.x-this.x0)*(1/this.a),m=(e.y-this.y0)*(1/this.a);if(this.es)if(t=this.ml0+m/this.k0,r=$m(t,this.es,this.en),Math.abs(r)<Ze){var B=Math.sin(r),W=Math.cos(r),q=Math.abs(W)>Je?Math.tan(r):0,ee=this.ep2*Math.pow(W,2),le=Math.pow(ee,2),de=Math.pow(q,2),H=Math.pow(de,2);t=1-this.es*Math.pow(B,2);var Q=o*Math.sqrt(t)/this.k0,te=Math.pow(Q,2);t=t*q,a=r-t*te/(1-this.es)*.5*(1-te/12*(5+3*de-9*ee*de+ee-4*le-te/30*(61+90*de-252*ee*de+45*H+46*ee-te/56*(1385+3633*de+4095*H+1574*H*de)))),u=et(this.long0+Q*(1-te/6*(1+2*de+ee-te/20*(5+28*de+24*H+8*ee*de+6*ee-te/42*(61+662*de+1320*H+720*H*de))))/W)}else a=Ze*ds(m),u=0;else{var v=Math.exp(o/this.k0),b=.5*(v-1/v),C=this.lat0+m/this.k0,T=Math.cos(C);t=Math.sqrt((1-Math.pow(T,2))/(1+Math.pow(b,2))),a=Math.asin(t),m<0&&(a=-a),b===0&&T===0?u=0:u=et(Math.atan2(b,T)+this.long0)}return e.x=u,e.y=a,e}var bk=["Fast_Transverse_Mercator","Fast Transverse Mercator"],Ec={init:vk,forward:xk,inverse:_k,names:bk};function Ym(e){var t=Math.exp(e);return t=(t-1/t)/2,t}function Vn(e,t){e=Math.abs(e),t=Math.abs(t);var r=Math.max(e,t),a=Math.min(e,t)/(r||1);return r*Math.sqrt(1+Math.pow(a,2))}function nC(e){var t=1+e,r=t-1;return r===0?e:e*Math.log(t)/r}function oC(e){var t=Math.abs(e);return t=nC(t*(1+t/(Vn(1,t)+1))),e<0?-t:t}function qm(e,t){for(var r=2*Math.cos(2*t),a=e.length-1,u=e[a],o=0,m;--a>=0;)m=-o+r*u+e[a],o=u,u=m;return t+m*Math.sin(2*t)}function sC(e,t){for(var r=2*Math.cos(t),a=e.length-1,u=e[a],o=0,m;--a>=0;)m=-o+r*u+e[a],o=u,u=m;return Math.sin(t)*m}function aC(e){var t=Math.exp(e);return t=(t+1/t)/2,t}function B1(e,t,r){for(var a=Math.sin(t),u=Math.cos(t),o=Ym(r),m=aC(r),v=2*u*m,b=-2*a*o,C=e.length-1,T=e[C],B=0,W=0,q=0,ee,le;--C>=0;)ee=W,le=B,W=T,B=q,T=-ee+v*W-b*B+e[C],q=-le+b*W+v*B;return v=a*m,b=u*o,[v*T-b*q,v*q+b*T]}function wk(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(Ec.init.apply(this),this.forward=Ec.forward,this.inverse=Ec.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var e=this.es/(1+Math.sqrt(1-this.es)),t=e/(2-e),r=t;this.cgb[0]=t*(2+t*(-2/3+t*(-2+t*(116/45+t*(26/45+t*(-2854/675)))))),this.cbg[0]=t*(-2+t*(2/3+t*(4/3+t*(-82/45+t*(32/45+t*(4642/4725)))))),r=r*t,this.cgb[1]=r*(7/3+t*(-8/5+t*(-227/45+t*(2704/315+t*(2323/945))))),this.cbg[1]=r*(5/3+t*(-16/15+t*(-13/9+t*(904/315+t*(-1522/945))))),r=r*t,this.cgb[2]=r*(56/15+t*(-136/35+t*(-1262/105+t*(73814/2835)))),this.cbg[2]=r*(-26/15+t*(34/21+t*(8/5+t*(-12686/2835)))),r=r*t,this.cgb[3]=r*(4279/630+t*(-332/35+t*(-399572/14175))),this.cbg[3]=r*(1237/630+t*(-12/5+t*(-24832/14175))),r=r*t,this.cgb[4]=r*(4174/315+t*(-144838/6237)),this.cbg[4]=r*(-734/315+t*(109598/31185)),r=r*t,this.cgb[5]=r*(601676/22275),this.cbg[5]=r*(444337/155925),r=Math.pow(t,2),this.Qn=this.k0/(1+t)*(1+r*(1/4+r*(1/64+r/256))),this.utg[0]=t*(-.5+t*(2/3+t*(-37/96+t*(1/360+t*(81/512+t*(-96199/604800)))))),this.gtu[0]=t*(.5+t*(-2/3+t*(5/16+t*(41/180+t*(-127/288+t*(7891/37800)))))),this.utg[1]=r*(-1/48+t*(-1/15+t*(437/1440+t*(-46/105+t*(1118711/3870720))))),this.gtu[1]=r*(13/48+t*(-3/5+t*(557/1440+t*(281/630+t*(-1983433/1935360))))),r=r*t,this.utg[2]=r*(-17/480+t*(37/840+t*(209/4480+t*(-5569/90720)))),this.gtu[2]=r*(61/240+t*(-103/140+t*(15061/26880+t*(167603/181440)))),r=r*t,this.utg[3]=r*(-4397/161280+t*(11/504+t*(830251/7257600))),this.gtu[3]=r*(49561/161280+t*(-179/168+t*(6601661/7257600))),r=r*t,this.utg[4]=r*(-4583/161280+t*(108847/3991680)),this.gtu[4]=r*(34729/80640+t*(-3418889/1995840)),r=r*t,this.utg[5]=r*(-20648693/638668800),this.gtu[5]=r*(212378941/319334400);var a=qm(this.cbg,this.lat0);this.Zb=-this.Qn*(a+sC(this.gtu,2*a))}function Ik(e){var t=et(e.x-this.long0),r=e.y;r=qm(this.cbg,r);var a=Math.sin(r),u=Math.cos(r),o=Math.sin(t),m=Math.cos(t);r=Math.atan2(a,m*u),t=Math.atan2(o*u,Vn(a,u*m)),t=oC(Math.tan(t));var v=B1(this.gtu,2*r,2*t);r=r+v[0],t=t+v[1];var b,C;return Math.abs(t)<=2.623395162778?(b=this.a*(this.Qn*t)+this.x0,C=this.a*(this.Qn*r+this.Zb)+this.y0):(b=1/0,C=1/0),e.x=b,e.y=C,e}function Sk(e){var t=(e.x-this.x0)*(1/this.a),r=(e.y-this.y0)*(1/this.a);r=(r-this.Zb)/this.Qn,t=t/this.Qn;var a,u;if(Math.abs(t)<=2.623395162778){var o=B1(this.utg,2*r,2*t);r=r+o[0],t=t+o[1],t=Math.atan(Ym(t));var m=Math.sin(r),v=Math.cos(r),b=Math.sin(t),C=Math.cos(t);r=Math.atan2(m*C,Vn(b,C*v)),t=Math.atan2(b,C*v),a=et(t+this.long0),u=qm(this.cgb,r)}else a=1/0,u=1/0;return e.x=a,e.y=u,e}var Ck=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"],Tc={init:wk,forward:Ik,inverse:Sk,names:Ck};function lC(e,t){if(e===void 0){if(e=Math.floor((et(t)+Math.PI)*30/Math.PI)+1,e<0)return 0;if(e>60)return 60}return e}var Mk="etmerc";function Ek(){var e=lC(this.zone,this.long0);if(e===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(e)-183)*mr,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Tc.init.apply(this),this.forward=Tc.forward,this.inverse=Tc.inverse}var Tk=["Universal Transverse Mercator System","utm"],uC={init:Ek,names:Tk,dependsOn:Mk};function Jm(e,t){return Math.pow((1-e)/(1+e),t)}var Ak=20;function Pk(){var e=Math.sin(this.lat0),t=Math.cos(this.lat0);t*=t,this.rc=Math.sqrt(1-this.es)/(1-this.es*e*e),this.C=Math.sqrt(1+this.es*t*t/(1-this.es)),this.phic0=Math.asin(e/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+mi)/(Math.pow(Math.tan(.5*this.lat0+mi),this.C)*Jm(this.e*e,this.ratexp))}function kk(e){var t=e.x,r=e.y;return e.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*r+mi),this.C)*Jm(this.e*Math.sin(r),this.ratexp))-Ze,e.x=this.C*t,e}function zk(e){for(var t=1e-14,r=e.x/this.C,a=e.y,u=Math.pow(Math.tan(.5*a+mi)/this.K,1/this.C),o=Ak;o>0&&(a=2*Math.atan(u*Jm(this.e*Math.sin(e.y),-.5*this.e))-Ze,!(Math.abs(a-e.y)<t));--o)e.y=a;return o?(e.x=r,e.y=a,e):null}var Lk=["gauss"],Qm={init:Pk,forward:kk,inverse:zk,names:Lk};function Rk(){Qm.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))}function Dk(e){var t,r,a,u;return e.x=et(e.x-this.long0),Qm.forward.apply(this,[e]),t=Math.sin(e.y),r=Math.cos(e.y),a=Math.cos(e.x),u=this.k0*this.R2/(1+this.sinc0*t+this.cosc0*r*a),e.x=u*r*Math.sin(e.x),e.y=u*(this.cosc0*t-this.sinc0*r*a),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function Bk(e){var t,r,a,u,o;if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,o=Math.sqrt(e.x*e.x+e.y*e.y)){var m=2*Math.atan2(o,this.R2);t=Math.sin(m),r=Math.cos(m),u=Math.asin(r*this.sinc0+e.y*t*this.cosc0/o),a=Math.atan2(e.x*t,o*this.cosc0*r-e.y*this.sinc0*t)}else u=this.phic0,a=0;return e.x=a,e.y=u,Qm.inverse.apply(this,[e]),e.x=et(e.x+this.long0),e}var Nk=["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"],cC={init:Rk,forward:Dk,inverse:Bk,names:Nk};function Fk(e,t,r){return t*=r,Math.tan(.5*(Ze+e))*Math.pow((1-t)/(1+t),.5*r)}function Ok(){this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=Je&&(this.k0=.5*(1+ds(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=Je&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=Je&&(this.k0=.5*this.cons*wn(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/Gn(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=wn(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-Ze,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function Gk(e){var t=e.x,r=e.y,a=Math.sin(r),u=Math.cos(r),o,m,v,b,C,T,B=et(t-this.long0);return Math.abs(Math.abs(t-this.long0)-Math.PI)<=Je&&Math.abs(r+this.lat0)<=Je?(e.x=NaN,e.y=NaN,e):this.sphere?(o=2*this.k0/(1+this.sinlat0*a+this.coslat0*u*Math.cos(B)),e.x=this.a*o*u*Math.sin(B)+this.x0,e.y=this.a*o*(this.coslat0*a-this.sinlat0*u*Math.cos(B))+this.y0,e):(m=2*Math.atan(this.ssfn_(r,a,this.e))-Ze,b=Math.cos(m),v=Math.sin(m),Math.abs(this.coslat0)<=Je?(C=Gn(this.e,r*this.con,this.con*a),T=2*this.a*this.k0*C/this.cons,e.x=this.x0+T*Math.sin(t-this.long0),e.y=this.y0-this.con*T*Math.cos(t-this.long0),e):(Math.abs(this.sinlat0)<Je?(o=2*this.a*this.k0/(1+b*Math.cos(B)),e.y=o*v):(o=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*v+this.cosX0*b*Math.cos(B))),e.y=o*(this.cosX0*v-this.sinX0*b*Math.cos(B))+this.y0),e.x=o*b*Math.sin(B)+this.x0,e))}function Vk(e){e.x-=this.x0,e.y-=this.y0;var t,r,a,u,o,m=Math.sqrt(e.x*e.x+e.y*e.y);if(this.sphere){var v=2*Math.atan(m/(2*this.a*this.k0));return t=this.long0,r=this.lat0,m<=Je?(e.x=t,e.y=r,e):(r=Math.asin(Math.cos(v)*this.sinlat0+e.y*Math.sin(v)*this.coslat0/m),Math.abs(this.coslat0)<Je?this.lat0>0?t=et(this.long0+Math.atan2(e.x,-1*e.y)):t=et(this.long0+Math.atan2(e.x,e.y)):t=et(this.long0+Math.atan2(e.x*Math.sin(v),m*this.coslat0*Math.cos(v)-e.y*this.sinlat0*Math.sin(v))),e.x=t,e.y=r,e)}else if(Math.abs(this.coslat0)<=Je){if(m<=Je)return r=this.lat0,t=this.long0,e.x=t,e.y=r,e;e.x*=this.con,e.y*=this.con,a=m*this.cons/(2*this.a*this.k0),r=this.con*Ys(this.e,a),t=this.con*et(this.con*this.long0+Math.atan2(e.x,-1*e.y))}else u=2*Math.atan(m*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,m<=Je?o=this.X0:(o=Math.asin(Math.cos(u)*this.sinX0+e.y*Math.sin(u)*this.cosX0/m),t=et(this.long0+Math.atan2(e.x*Math.sin(u),m*this.cosX0*Math.cos(u)-e.y*this.sinX0*Math.sin(u)))),r=-1*Ys(this.e,Math.tan(.5*(Ze+o)));return e.x=t,e.y=r,e}var Uk=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],hC={init:Ok,forward:Gk,inverse:Vk,names:Uk,ssfn_:Fk};function Wk(){var e=this.lat0;this.lambda0=this.long0;var t=Math.sin(e),r=this.a,a=this.rf,u=1/a,o=2*u-Math.pow(u,2),m=this.e=Math.sqrt(o);this.R=this.k0*r*Math.sqrt(1-o)/(1-o*Math.pow(t,2)),this.alpha=Math.sqrt(1+o/(1-o)*Math.pow(Math.cos(e),4)),this.b0=Math.asin(t/this.alpha);var v=Math.log(Math.tan(Math.PI/4+this.b0/2)),b=Math.log(Math.tan(Math.PI/4+e/2)),C=Math.log((1+m*t)/(1-m*t));this.K=v-this.alpha*b+this.alpha*m/2*C}function Zk(e){var t=Math.log(Math.tan(Math.PI/4-e.y/2)),r=this.e/2*Math.log((1+this.e*Math.sin(e.y))/(1-this.e*Math.sin(e.y))),a=-this.alpha*(t+r)+this.K,u=2*(Math.atan(Math.exp(a))-Math.PI/4),o=this.alpha*(e.x-this.lambda0),m=Math.atan(Math.sin(o)/(Math.sin(this.b0)*Math.tan(u)+Math.cos(this.b0)*Math.cos(o))),v=Math.asin(Math.cos(this.b0)*Math.sin(u)-Math.sin(this.b0)*Math.cos(u)*Math.cos(o));return e.y=this.R/2*Math.log((1+Math.sin(v))/(1-Math.sin(v)))+this.y0,e.x=this.R*m+this.x0,e}function jk(e){for(var t=e.x-this.x0,r=e.y-this.y0,a=t/this.R,u=2*(Math.atan(Math.exp(r/this.R))-Math.PI/4),o=Math.asin(Math.cos(this.b0)*Math.sin(u)+Math.sin(this.b0)*Math.cos(u)*Math.cos(a)),m=Math.atan(Math.sin(a)/(Math.cos(this.b0)*Math.cos(a)-Math.sin(this.b0)*Math.tan(u))),v=this.lambda0+m/this.alpha,b=0,C=o,T=-1e3,B=0;Math.abs(C-T)>1e-7;){if(++B>20)return;b=1/this.alpha*(Math.log(Math.tan(Math.PI/4+o/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(C))/2)),T=C,C=2*Math.atan(Math.exp(b))-Math.PI/2}return e.x=v,e.y=C,e}var Hk=["somerc"],dC={init:Wk,forward:Zk,inverse:jk,names:Hk};var Ac=1e-7;function Xk(e){var t=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],r=typeof e.PROJECTION=="object"?Object.keys(e.PROJECTION)[0]:e.PROJECTION;return"no_uoff"in e||"no_off"in e||t.indexOf(r)!==-1}function $k(){var e,t,r,a,u,o,m,v,b,C,T=0,B,W=0,q=0,ee=0,le=0,de=0,H=0,Q;this.no_off=Xk(this),this.no_rot="no_rot"in this;var te=!1;"alpha"in this&&(te=!0);var ve=!1;if("rectified_grid_angle"in this&&(ve=!0),te&&(H=this.alpha),ve&&(T=this.rectified_grid_angle*mr),te||ve)W=this.longc;else if(q=this.long1,le=this.lat1,ee=this.long2,de=this.lat2,Math.abs(le-de)<=Ac||(e=Math.abs(le))<=Ac||Math.abs(e-Ze)<=Ac||Math.abs(Math.abs(this.lat0)-Ze)<=Ac||Math.abs(Math.abs(de)-Ze)<=Ac)throw new Error;var Me=1-this.es;t=Math.sqrt(Me),Math.abs(this.lat0)>Je?(v=Math.sin(this.lat0),r=Math.cos(this.lat0),e=1-this.es*v*v,this.B=r*r,this.B=Math.sqrt(1+this.es*this.B*this.B/Me),this.A=this.B*this.k0*t/e,a=this.B*t/(r*Math.sqrt(e)),u=a*a-1,u<=0?u=0:(u=Math.sqrt(u),this.lat0<0&&(u=-u)),this.E=u+=a,this.E*=Math.pow(Gn(this.e,this.lat0,v),this.B)):(this.B=1/t,this.A=this.k0,this.E=a=u=1),te||ve?(te?(B=Math.asin(Math.sin(H)/a),ve||(T=H)):(B=T,H=Math.asin(a*Math.sin(B))),this.lam0=W-Math.asin(.5*(u-1/u)*Math.tan(B))/this.B):(o=Math.pow(Gn(this.e,le,Math.sin(le)),this.B),m=Math.pow(Gn(this.e,de,Math.sin(de)),this.B),u=this.E/o,b=(m-o)/(m+o),C=this.E*this.E,C=(C-m*o)/(C+m*o),e=q-ee,e<-Math.pi?ee-=qa:e>Math.pi&&(ee+=qa),this.lam0=et(.5*(q+ee)-Math.atan(C*Math.tan(.5*this.B*(q-ee))/b)/this.B),B=Math.atan(2*Math.sin(this.B*et(q-this.lam0))/(u-1/u)),T=H=Math.asin(a*Math.sin(B))),this.singam=Math.sin(B),this.cosgam=Math.cos(B),this.sinrot=Math.sin(T),this.cosrot=Math.cos(T),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,Q=this.A*this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(a*a-1)/Math.cos(H))),this.lat0<0&&(this.u_0=-this.u_0)),u=.5*B,this.v_pole_n=this.ArB*Math.log(Math.tan(mi-u)),this.v_pole_s=this.ArB*Math.log(Math.tan(mi+u))}function Yk(e){var t={},r,a,u,o,m,v,b,C;if(e.x=e.x-this.lam0,Math.abs(Math.abs(e.y)-Ze)>Je){if(m=this.E/Math.pow(Gn(this.e,e.y,Math.sin(e.y)),this.B),v=1/m,r=.5*(m-v),a=.5*(m+v),o=Math.sin(this.B*e.x),u=(r*this.singam-o*this.cosgam)/a,Math.abs(Math.abs(u)-1)<Je)throw new Error;C=.5*this.ArB*Math.log((1-u)/(1+u)),v=Math.cos(this.B*e.x),Math.abs(v)<Ac?b=this.A*e.x:b=this.ArB*Math.atan2(r*this.cosgam+o*this.singam,v)}else C=e.y>0?this.v_pole_n:this.v_pole_s,b=this.ArB*e.y;return this.no_rot?(t.x=b,t.y=C):(b-=this.u_0,t.x=C*this.cosrot+b*this.sinrot,t.y=b*this.cosrot-C*this.sinrot),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function qk(e){var t,r,a,u,o,m,v,b={};if(e.x=(e.x-this.x0)*(1/this.a),e.y=(e.y-this.y0)*(1/this.a),this.no_rot?(r=e.y,t=e.x):(r=e.x*this.cosrot-e.y*this.sinrot,t=e.y*this.cosrot+e.x*this.sinrot+this.u_0),a=Math.exp(-this.BrA*r),u=.5*(a-1/a),o=.5*(a+1/a),m=Math.sin(this.BrA*t),v=(m*this.cosgam+u*this.singam)/o,Math.abs(Math.abs(v)-1)<Je)b.x=0,b.y=v<0?-Ze:Ze;else{if(b.y=this.E/Math.sqrt((1+v)/(1-v)),b.y=Ys(this.e,Math.pow(b.y,1/this.B)),b.y===1/0)throw new Error;b.x=-this.rB*Math.atan2(u*this.cosgam-m*this.singam,Math.cos(this.BrA*t))}return b.x+=this.lam0,b}var Jk=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"],pC={init:$k,forward:Yk,inverse:qk,names:Jk};function Qk(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<Je)){var e=this.b/this.a;this.e=Math.sqrt(1-e*e);var t=Math.sin(this.lat1),r=Math.cos(this.lat1),a=wn(this.e,t,r),u=Gn(this.e,this.lat1,t),o=Math.sin(this.lat2),m=Math.cos(this.lat2),v=wn(this.e,o,m),b=Gn(this.e,this.lat2,o),C=Gn(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>Je?this.ns=Math.log(a/v)/Math.log(u/b):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=a/(this.ns*Math.pow(u,this.ns)),this.rh=this.a*this.f0*Math.pow(C,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function Kk(e){var t=e.x,r=e.y;Math.abs(2*Math.abs(r)-Math.PI)<=Je&&(r=ds(r)*(Ze-2*Je));var a=Math.abs(Math.abs(r)-Ze),u,o;if(a>Je)u=Gn(this.e,r,Math.sin(r)),o=this.a*this.f0*Math.pow(u,this.ns);else{if(a=r*this.ns,a<=0)return null;o=0}var m=this.ns*et(t-this.long0);return e.x=this.k0*(o*Math.sin(m))+this.x0,e.y=this.k0*(this.rh-o*Math.cos(m))+this.y0,e}function ez(e){var t,r,a,u,o,m=(e.x-this.x0)/this.k0,v=this.rh-(e.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(m*m+v*v),r=1):(t=-Math.sqrt(m*m+v*v),r=-1);var b=0;if(t!==0&&(b=Math.atan2(r*m,r*v)),t!==0||this.ns>0){if(r=1/this.ns,a=Math.pow(t/(this.a*this.f0),r),u=Ys(this.e,a),u===-9999)return null}else u=-Ze;return o=et(b/this.ns+this.long0),e.x=o,e.y=u,e}var tz=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"],fC={init:Qk,forward:Kk,inverse:ez,names:tz};function iz(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function rz(e){var t,r,a,u,o,m,v,b=e.x,C=e.y,T=et(b-this.long0);return t=Math.pow((1+this.e*Math.sin(C))/(1-this.e*Math.sin(C)),this.alfa*this.e/2),r=2*(Math.atan(this.k*Math.pow(Math.tan(C/2+this.s45),this.alfa)/t)-this.s45),a=-T*this.alfa,u=Math.asin(Math.cos(this.ad)*Math.sin(r)+Math.sin(this.ad)*Math.cos(r)*Math.cos(a)),o=Math.asin(Math.cos(r)*Math.sin(a)/Math.cos(u)),m=this.n*o,v=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(u/2+this.s45),this.n),e.y=v*Math.cos(m)/1,e.x=v*Math.sin(m)/1,this.czech||(e.y*=-1,e.x*=-1),e}function nz(e){var t,r,a,u,o,m,v,b,C=e.x;e.x=e.y,e.y=C,this.czech||(e.y*=-1,e.x*=-1),m=Math.sqrt(e.x*e.x+e.y*e.y),o=Math.atan2(e.y,e.x),u=o/Math.sin(this.s0),a=2*(Math.atan(Math.pow(this.ro0/m,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),t=Math.asin(Math.cos(this.ad)*Math.sin(a)-Math.sin(this.ad)*Math.cos(a)*Math.cos(u)),r=Math.asin(Math.cos(a)*Math.sin(u)/Math.cos(t)),e.x=this.long0-r/this.alfa,v=t,b=0;var T=0;do e.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(t/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(v))/(1-this.e*Math.sin(v)),this.e/2))-this.s45),Math.abs(v-e.y)<1e-10&&(b=1),v=e.y,T+=1;while(b===0&&T<15);return T>=15?null:e}var oz=["Krovak","krovak"],mC={init:iz,forward:rz,inverse:nz,names:oz};function Zr(e,t,r,a,u){return e*u-t*Math.sin(2*u)+r*Math.sin(4*u)-a*Math.sin(6*u)}function qs(e){return 1-.25*e*(1+e/16*(3+1.25*e))}function Js(e){return .375*e*(1+.25*e*(1+.46875*e))}function Qs(e){return .05859375*e*e*(1+.75*e)}function Ks(e){return e*e*e*(35/3072)}function ea(e,t,r){var a=t*r;return e/Math.sqrt(1-a*a)}function qo(e){return Math.abs(e)<Ze?e:e-ds(e)*Math.PI}function Xl(e,t,r,a,u){var o,m;o=e/t;for(var v=0;v<15;v++)if(m=(e-(t*o-r*Math.sin(2*o)+a*Math.sin(4*o)-u*Math.sin(6*o)))/(t-2*r*Math.cos(2*o)+4*a*Math.cos(4*o)-6*u*Math.cos(6*o)),o+=m,Math.abs(m)<=1e-10)return o;return NaN}function sz(){this.sphere||(this.e0=qs(this.es),this.e1=Js(this.es),this.e2=Qs(this.es),this.e3=Ks(this.es),this.ml0=this.a*Zr(this.e0,this.e1,this.e2,this.e3,this.lat0))}function az(e){var t,r,a=e.x,u=e.y;if(a=et(a-this.long0),this.sphere)t=this.a*Math.asin(Math.cos(u)*Math.sin(a)),r=this.a*(Math.atan2(Math.tan(u),Math.cos(a))-this.lat0);else{var o=Math.sin(u),m=Math.cos(u),v=ea(this.a,this.e,o),b=Math.tan(u)*Math.tan(u),C=a*Math.cos(u),T=C*C,B=this.es*m*m/(1-this.es),W=this.a*Zr(this.e0,this.e1,this.e2,this.e3,u);t=v*C*(1-T*b*(1/6-(8-b+8*B)*T/120)),r=W-this.ml0+v*o/m*T*(.5+(5-b+6*B)*T/24)}return e.x=t+this.x0,e.y=r+this.y0,e}function lz(e){e.x-=this.x0,e.y-=this.y0;var t=e.x/this.a,r=e.y/this.a,a,u;if(this.sphere){var o=r+this.lat0;a=Math.asin(Math.sin(o)*Math.cos(t)),u=Math.atan2(Math.tan(t),Math.cos(o))}else{var m=this.ml0/this.a+r,v=Xl(m,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(v)-Ze)<=Je)return e.x=this.long0,e.y=Ze,r<0&&(e.y*=-1),e;var b=ea(this.a,this.e,Math.sin(v)),C=b*b*b/this.a/this.a*(1-this.es),T=Math.pow(Math.tan(v),2),B=t*this.a/b,W=B*B;a=v-b*Math.tan(v)/C*B*B*(.5-(1+3*T)*B*B/24),u=B*(1-W*(T/3+(1+3*T)*T*W/15))/Math.cos(v)}return e.x=et(u+this.long0),e.y=qo(a),e}var uz=["Cassini","Cassini_Soldner","cass"],gC={init:sz,forward:az,inverse:lz,names:uz};function Jo(e,t){var r;return e>1e-7?(r=e*t,(1-e*e)*(t/(1-r*r)-.5/e*Math.log((1-r)/(1+r)))):2*t}var cz=1,hz=2,dz=3,pz=4;function fz(){var e=Math.abs(this.lat0);if(Math.abs(e-Ze)<Je?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(e)<Je?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0){var t;switch(this.qp=Jo(this.e,1),this.mmf=.5/(1-this.es),this.apa=Iz(this.es),this.mode){case this.N_POLE:this.dd=1;break;case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=Jo(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function mz(e){var t,r,a,u,o,m,v,b,C,T,B=e.x,W=e.y;if(B=et(B-this.long0),this.sphere){if(o=Math.sin(W),T=Math.cos(W),a=Math.cos(B),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(r=this.mode===this.EQUIT?1+T*a:1+this.sinph0*o+this.cosph0*T*a,r<=Je)return null;r=Math.sqrt(2/r),t=r*T*Math.sin(B),r*=this.mode===this.EQUIT?o:this.cosph0*o-this.sinph0*T*a}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(a=-a),Math.abs(W+this.lat0)<Je)return null;r=mi-W*.5,r=2*(this.mode===this.S_POLE?Math.cos(r):Math.sin(r)),t=r*Math.sin(B),r*=a}}else{switch(v=0,b=0,C=0,a=Math.cos(B),u=Math.sin(B),o=Math.sin(W),m=Jo(this.e,o),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(v=m/this.qp,b=Math.sqrt(1-v*v)),this.mode){case this.OBLIQ:C=1+this.sinb1*v+this.cosb1*b*a;break;case this.EQUIT:C=1+b*a;break;case this.N_POLE:C=Ze+W,m=this.qp-m;break;case this.S_POLE:C=W-Ze,m=this.qp+m;break}if(Math.abs(C)<Je)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:C=Math.sqrt(2/C),this.mode===this.OBLIQ?r=this.ymf*C*(this.cosb1*v-this.sinb1*b*a):r=(C=Math.sqrt(2/(1+b*a)))*v*this.ymf,t=this.xmf*C*b*u;break;case this.N_POLE:case this.S_POLE:m>=0?(t=(C=Math.sqrt(m))*u,r=a*(this.mode===this.S_POLE?C:-C)):t=r=0;break}}return e.x=this.a*t+this.x0,e.y=this.a*r+this.y0,e}function gz(e){e.x-=this.x0,e.y-=this.y0;var t=e.x/this.a,r=e.y/this.a,a,u,o,m,v,b,C;if(this.sphere){var T=0,B,W=0;if(B=Math.sqrt(t*t+r*r),u=B*.5,u>1)return null;switch(u=2*Math.asin(u),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(W=Math.sin(u),T=Math.cos(u)),this.mode){case this.EQUIT:u=Math.abs(B)<=Je?0:Math.asin(r*W/B),t*=W,r=T*B;break;case this.OBLIQ:u=Math.abs(B)<=Je?this.lat0:Math.asin(T*this.sinph0+r*W*this.cosph0/B),t*=W*this.cosph0,r=(T-Math.sin(u)*this.sinph0)*B;break;case this.N_POLE:r=-r,u=Ze-u;break;case this.S_POLE:u-=Ze;break}a=r===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(t,r)}else{if(C=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(t/=this.dd,r*=this.dd,b=Math.sqrt(t*t+r*r),b<Je)return e.x=this.long0,e.y=this.lat0,e;m=2*Math.asin(.5*b/this.rq),o=Math.cos(m),t*=m=Math.sin(m),this.mode===this.OBLIQ?(C=o*this.sinb1+r*m*this.cosb1/b,v=this.qp*C,r=b*this.cosb1*o-r*this.sinb1*m):(C=r*m/b,v=this.qp*C,r=b*o)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),v=t*t+r*r,!v)return e.x=this.long0,e.y=this.lat0,e;C=1-v/this.qp,this.mode===this.S_POLE&&(C=-C)}a=Math.atan2(t,r),u=Sz(Math.asin(C),this.apa)}return e.x=et(this.long0+a),e.y=u,e}var yz=.3333333333333333,vz=.17222222222222222,xz=.10257936507936508,_z=.06388888888888888,bz=.0664021164021164,wz=.016415012942191543;function Iz(e){var t,r=[];return r[0]=e*yz,t=e*e,r[0]+=t*vz,r[1]=t*_z,t*=e,r[0]+=t*xz,r[1]+=t*bz,r[2]=t*wz,r}function Sz(e,t){var r=e+e;return e+t[0]*Math.sin(r)+t[1]*Math.sin(r+r)+t[2]*Math.sin(r+r+r)}var Cz=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],yC={init:fz,forward:mz,inverse:gz,names:Cz,S_POLE:cz,N_POLE:hz,EQUIT:dz,OBLIQ:pz};function io(e){return Math.abs(e)>1&&(e=e>1?1:-1),Math.asin(e)}function Mz(){Math.abs(this.lat1+this.lat2)<Je||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=wn(this.e3,this.sin_po,this.cos_po),this.qs1=Jo(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=wn(this.e3,this.sin_po,this.cos_po),this.qs2=Jo(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=Jo(this.e3,this.sin_po,this.cos_po),Math.abs(this.lat1-this.lat2)>Je?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function Ez(e){var t=e.x,r=e.y;this.sin_phi=Math.sin(r),this.cos_phi=Math.cos(r);var a=Jo(this.e3,this.sin_phi,this.cos_phi),u=this.a*Math.sqrt(this.c-this.ns0*a)/this.ns0,o=this.ns0*et(t-this.long0),m=u*Math.sin(o)+this.x0,v=this.rh-u*Math.cos(o)+this.y0;return e.x=m,e.y=v,e}function Tz(e){var t,r,a,u,o,m;return e.x-=this.x0,e.y=this.rh-e.y+this.y0,this.ns0>=0?(t=Math.sqrt(e.x*e.x+e.y*e.y),a=1):(t=-Math.sqrt(e.x*e.x+e.y*e.y),a=-1),u=0,t!==0&&(u=Math.atan2(a*e.x,a*e.y)),a=t*this.ns0/this.a,this.sphere?m=Math.asin((this.c-a*a)/(2*this.ns0)):(r=(this.c-a*a)/this.ns0,m=this.phi1z(this.e3,r)),o=et(u/this.ns0+this.long0),e.x=o,e.y=m,e}function Az(e,t){var r,a,u,o,m,v=io(.5*t);if(e<Je)return v;for(var b=e*e,C=1;C<=25;C++)if(r=Math.sin(v),a=Math.cos(v),u=e*r,o=1-u*u,m=.5*o*o/a*(t/(1-b)-r/o+.5/e*Math.log((1-u)/(1+u))),v=v+m,Math.abs(m)<=1e-7)return v;return null}var Pz=["Albers_Conic_Equal_Area","Albers","aea"],vC={init:Mz,forward:Ez,inverse:Tz,names:Pz,phi1z:Az};function kz(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function zz(e){var t,r,a,u,o,m,v,b,C=e.x,T=e.y;return a=et(C-this.long0),t=Math.sin(T),r=Math.cos(T),u=Math.cos(a),m=this.sin_p14*t+this.cos_p14*r*u,o=1,m>0||Math.abs(m)<=Je?(v=this.x0+this.a*o*r*Math.sin(a)/m,b=this.y0+this.a*o*(this.cos_p14*t-this.sin_p14*r*u)/m):(v=this.x0+this.infinity_dist*r*Math.sin(a),b=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*r*u)),e.x=v,e.y=b,e}function Lz(e){var t,r,a,u,o,m;return e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,(t=Math.sqrt(e.x*e.x+e.y*e.y))?(u=Math.atan2(t,this.rc),r=Math.sin(u),a=Math.cos(u),m=io(a*this.sin_p14+e.y*r*this.cos_p14/t),o=Math.atan2(e.x*r,t*this.cos_p14*a-e.y*this.sin_p14*r),o=et(this.long0+o)):(m=this.phic0,o=0),e.x=o,e.y=m,e}var Rz=["gnom"],xC={init:kz,forward:zz,inverse:Lz,names:Rz};function _C(e,t){var r=1-(1-e*e)/(2*e)*Math.log((1-e)/(1+e));if(Math.abs(Math.abs(t)-r)<1e-6)return t<0?-1*Ze:Ze;for(var a=Math.asin(.5*t),u,o,m,v,b=0;b<30;b++)if(o=Math.sin(a),m=Math.cos(a),v=e*o,u=Math.pow(1-v*v,2)/(2*m)*(t/(1-e*e)-o/(1-v*v)+.5/e*Math.log((1-v)/(1+v))),a+=u,Math.abs(u)<=1e-10)return a;return NaN}function Dz(){this.sphere||(this.k0=wn(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function Bz(e){var t=e.x,r=e.y,a,u,o=et(t-this.long0);if(this.sphere)a=this.x0+this.a*o*Math.cos(this.lat_ts),u=this.y0+this.a*Math.sin(r)/Math.cos(this.lat_ts);else{var m=Jo(this.e,Math.sin(r));a=this.x0+this.a*this.k0*o,u=this.y0+this.a*m*.5/this.k0}return e.x=a,e.y=u,e}function Nz(e){e.x-=this.x0,e.y-=this.y0;var t,r;return this.sphere?(t=et(this.long0+e.x/this.a/Math.cos(this.lat_ts)),r=Math.asin(e.y/this.a*Math.cos(this.lat_ts))):(r=_C(this.e,2*e.y*this.k0/this.a),t=et(this.long0+e.x/(this.a*this.k0))),e.x=t,e.y=r,e}var Fz=["cea"],bC={init:Dz,forward:Bz,inverse:Nz,names:Fz};function Oz(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function Gz(e){var t=e.x,r=e.y,a=et(t-this.long0),u=qo(r-this.lat0);return e.x=this.x0+this.a*a*this.rc,e.y=this.y0+this.a*u,e}function Vz(e){var t=e.x,r=e.y;return e.x=et(this.long0+(t-this.x0)/(this.a*this.rc)),e.y=qo(this.lat0+(r-this.y0)/this.a),e}var Uz=["Equirectangular","Equidistant_Cylindrical","eqc"],wC={init:Oz,forward:Gz,inverse:Vz,names:Uz};var IC=20;function Wz(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=qs(this.es),this.e1=Js(this.es),this.e2=Qs(this.es),this.e3=Ks(this.es),this.ml0=this.a*Zr(this.e0,this.e1,this.e2,this.e3,this.lat0)}function Zz(e){var t=e.x,r=e.y,a,u,o,m=et(t-this.long0);if(o=m*Math.sin(r),this.sphere)Math.abs(r)<=Je?(a=this.a*m,u=-1*this.a*this.lat0):(a=this.a*Math.sin(o)/Math.tan(r),u=this.a*(qo(r-this.lat0)+(1-Math.cos(o))/Math.tan(r)));else if(Math.abs(r)<=Je)a=this.a*m,u=-1*this.ml0;else{var v=ea(this.a,this.e,Math.sin(r))/Math.tan(r);a=v*Math.sin(o),u=this.a*Zr(this.e0,this.e1,this.e2,this.e3,r)-this.ml0+v*(1-Math.cos(o))}return e.x=a+this.x0,e.y=u+this.y0,e}function jz(e){var t,r,a,u,o,m,v,b,C;if(a=e.x-this.x0,u=e.y-this.y0,this.sphere)if(Math.abs(u+this.a*this.lat0)<=Je)t=et(a/this.a+this.long0),r=0;else{m=this.lat0+u/this.a,v=a*a/this.a/this.a+m*m,b=m;var T;for(o=IC;o;--o)if(T=Math.tan(b),C=-1*(m*(b*T+1)-b-.5*(b*b+v)*T)/((b-m)/T-1),b+=C,Math.abs(C)<=Je){r=b;break}t=et(this.long0+Math.asin(a*Math.tan(b)/this.a)/Math.sin(r))}else if(Math.abs(u+this.ml0)<=Je)r=0,t=et(this.long0+a/this.a);else{m=(this.ml0+u)/this.a,v=a*a/this.a/this.a+m*m,b=m;var B,W,q,ee,le;for(o=IC;o;--o)if(le=this.e*Math.sin(b),B=Math.sqrt(1-le*le)*Math.tan(b),W=this.a*Zr(this.e0,this.e1,this.e2,this.e3,b),q=this.e0-2*this.e1*Math.cos(2*b)+4*this.e2*Math.cos(4*b)-6*this.e3*Math.cos(6*b),ee=W/this.a,C=(m*(B*ee+1)-ee-.5*B*(ee*ee+v))/(this.es*Math.sin(2*b)*(ee*ee+v-2*m*ee)/(4*B)+(m-ee)*(B*q-2/Math.sin(2*b))-q),b-=C,Math.abs(C)<=Je){r=b;break}B=Math.sqrt(1-this.es*Math.pow(Math.sin(r),2))*Math.tan(r),t=et(this.long0+Math.asin(a*B/this.a)/Math.sin(r))}return e.x=t,e.y=r,e}var Hz=["Polyconic","poly"],SC={init:Wz,forward:Zz,inverse:jz,names:Hz};function Xz(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function $z(e){var t,r=e.x,a=e.y,u=a-this.lat0,o=r-this.long0,m=u/Wl*1e-5,v=o,b=1,C=0;for(t=1;t<=10;t++)b=b*m,C=C+this.A[t]*b;var T=C,B=v,W=1,q=0,ee,le,de=0,H=0;for(t=1;t<=6;t++)ee=W*T-q*B,le=q*T+W*B,W=ee,q=le,de=de+this.B_re[t]*W-this.B_im[t]*q,H=H+this.B_im[t]*W+this.B_re[t]*q;return e.x=H*this.a+this.x0,e.y=de*this.a+this.y0,e}function Yz(e){var t,r=e.x,a=e.y,u=r-this.x0,o=a-this.y0,m=o/this.a,v=u/this.a,b=1,C=0,T,B,W=0,q=0;for(t=1;t<=6;t++)T=b*m-C*v,B=C*m+b*v,b=T,C=B,W=W+this.C_re[t]*b-this.C_im[t]*C,q=q+this.C_im[t]*b+this.C_re[t]*C;for(var ee=0;ee<this.iterations;ee++){var le=W,de=q,H,Q,te=m,ve=v;for(t=2;t<=6;t++)H=le*W-de*q,Q=de*W+le*q,le=H,de=Q,te=te+(t-1)*(this.B_re[t]*le-this.B_im[t]*de),ve=ve+(t-1)*(this.B_im[t]*le+this.B_re[t]*de);le=1,de=0;var Me=this.B_re[1],Ce=this.B_im[1];for(t=2;t<=6;t++)H=le*W-de*q,Q=de*W+le*q,le=H,de=Q,Me=Me+t*(this.B_re[t]*le-this.B_im[t]*de),Ce=Ce+t*(this.B_im[t]*le+this.B_re[t]*de);var Be=Me*Me+Ce*Ce;W=(te*Me+ve*Ce)/Be,q=(ve*Me-te*Ce)/Be}var Fe=W,qe=q,ht=1,Tt=0;for(t=1;t<=9;t++)ht=ht*Fe,Tt=Tt+this.D[t]*ht;var Gt=this.lat0+Tt*Wl*1e5,Jt=this.long0+qe;return e.x=Jt,e.y=Gt,e}var qz=["New_Zealand_Map_Grid","nzmg"],CC={init:Xz,forward:$z,inverse:Yz,names:qz};function Jz(){}function Qz(e){var t=e.x,r=e.y,a=et(t-this.long0),u=this.x0+this.a*a,o=this.y0+this.a*Math.log(Math.tan(Math.PI/4+r/2.5))*1.25;return e.x=u,e.y=o,e}function Kz(e){e.x-=this.x0,e.y-=this.y0;var t=et(this.long0+e.x/this.a),r=2.5*(Math.atan(Math.exp(.8*e.y/this.a))-Math.PI/4);return e.x=t,e.y=r,e}var eL=["Miller_Cylindrical","mill"],MC={init:Jz,forward:Qz,inverse:Kz,names:eL};var tL=20;function iL(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=Xm(this.es)}function rL(e){var t,r,a=e.x,u=e.y;if(a=et(a-this.long0),this.sphere){if(!this.m)u=this.n!==1?Math.asin(this.n*Math.sin(u)):u;else for(var o=this.n*Math.sin(u),m=tL;m;--m){var v=(this.m*u+Math.sin(u)-o)/(this.m+Math.cos(u));if(u-=v,Math.abs(v)<Je)break}t=this.a*this.C_x*a*(this.m+Math.cos(u)),r=this.a*this.C_y*u}else{var b=Math.sin(u),C=Math.cos(u);r=this.a*Hl(u,b,C,this.en),t=this.a*a*C/Math.sqrt(1-this.es*b*b)}return e.x=t,e.y=r,e}function nL(e){var t,r,a,u;return e.x-=this.x0,a=e.x/this.a,e.y-=this.y0,t=e.y/this.a,this.sphere?(t/=this.C_y,a=a/(this.C_x*(this.m+Math.cos(t))),this.m?t=io((this.m*t+Math.sin(t))/this.n):this.n!==1&&(t=io(Math.sin(t)/this.n)),a=et(a+this.long0),t=qo(t)):(t=$m(e.y/this.a,this.es,this.en),u=Math.abs(t),u<Ze?(u=Math.sin(t),r=this.long0+e.x*Math.sqrt(1-this.es*u*u)/(this.a*Math.cos(t)),a=et(r)):u-Je<Ze&&(a=this.long0)),e.x=a,e.y=t,e}var oL=["Sinusoidal","sinu"],EC={init:iL,forward:rL,inverse:nL,names:oL};function sL(){}function aL(e){for(var t=e.x,r=e.y,a=et(t-this.long0),u=r,o=Math.PI*Math.sin(r);;){var m=-(u+Math.sin(u)-o)/(1+Math.cos(u));if(u+=m,Math.abs(m)<Je)break}u/=2,Math.PI/2-Math.abs(r)<Je&&(a=0);var v=.900316316158*this.a*a*Math.cos(u)+this.x0,b=1.4142135623731*this.a*Math.sin(u)+this.y0;return e.x=v,e.y=b,e}function lL(e){var t,r;e.x-=this.x0,e.y-=this.y0,r=e.y/(1.4142135623731*this.a),Math.abs(r)>.999999999999&&(r=.999999999999),t=Math.asin(r);var a=et(this.long0+e.x/(.900316316158*this.a*Math.cos(t)));a<-Math.PI&&(a=-Math.PI),a>Math.PI&&(a=Math.PI),r=(2*t+Math.sin(2*t))/Math.PI,Math.abs(r)>1&&(r=1);var u=Math.asin(r);return e.x=a,e.y=u,e}var uL=["Mollweide","moll"],TC={init:sL,forward:aL,inverse:lL,names:uL};function cL(){Math.abs(this.lat1+this.lat2)<Je||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=qs(this.es),this.e1=Js(this.es),this.e2=Qs(this.es),this.e3=Ks(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=wn(this.e,this.sinphi,this.cosphi),this.ml1=Zr(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<Je?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=wn(this.e,this.sinphi,this.cosphi),this.ml2=Zr(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=Zr(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function hL(e){var t=e.x,r=e.y,a;if(this.sphere)a=this.a*(this.g-r);else{var u=Zr(this.e0,this.e1,this.e2,this.e3,r);a=this.a*(this.g-u)}var o=this.ns*et(t-this.long0),m=this.x0+a*Math.sin(o),v=this.y0+this.rh-a*Math.cos(o);return e.x=m,e.y=v,e}function dL(e){e.x-=this.x0,e.y=this.rh-e.y+this.y0;var t,r,a,u;this.ns>=0?(r=Math.sqrt(e.x*e.x+e.y*e.y),t=1):(r=-Math.sqrt(e.x*e.x+e.y*e.y),t=-1);var o=0;if(r!==0&&(o=Math.atan2(t*e.x,t*e.y)),this.sphere)return u=et(this.long0+o/this.ns),a=qo(this.g-r/this.a),e.x=u,e.y=a,e;var m=this.g-r/this.a;return a=Xl(m,this.e0,this.e1,this.e2,this.e3),u=et(this.long0+o/this.ns),e.x=u,e.y=a,e}var pL=["Equidistant_Conic","eqdc"],AC={init:cL,forward:hL,inverse:dL,names:pL};function fL(){this.R=this.a}function mL(e){var t=e.x,r=e.y,a=et(t-this.long0),u,o;Math.abs(r)<=Je&&(u=this.x0+this.R*a,o=this.y0);var m=io(2*Math.abs(r/Math.PI));(Math.abs(a)<=Je||Math.abs(Math.abs(r)-Ze)<=Je)&&(u=this.x0,r>=0?o=this.y0+Math.PI*this.R*Math.tan(.5*m):o=this.y0+Math.PI*this.R*-Math.tan(.5*m));var v=.5*Math.abs(Math.PI/a-a/Math.PI),b=v*v,C=Math.sin(m),T=Math.cos(m),B=T/(C+T-1),W=B*B,q=B*(2/C-1),ee=q*q,le=Math.PI*this.R*(v*(B-ee)+Math.sqrt(b*(B-ee)*(B-ee)-(ee+b)*(W-ee)))/(ee+b);a<0&&(le=-le),u=this.x0+le;var de=b+B;return le=Math.PI*this.R*(q*de-v*Math.sqrt((ee+b)*(b+1)-de*de))/(ee+b),r>=0?o=this.y0+le:o=this.y0-le,e.x=u,e.y=o,e}function gL(e){var t,r,a,u,o,m,v,b,C,T,B,W,q;return e.x-=this.x0,e.y-=this.y0,B=Math.PI*this.R,a=e.x/B,u=e.y/B,o=a*a+u*u,m=-Math.abs(u)*(1+o),v=m-2*u*u+a*a,b=-2*m+1+2*u*u+o*o,q=u*u/b+(2*v*v*v/b/b/b-9*m*v/b/b)/27,C=(m-v*v/3/b)/b,T=2*Math.sqrt(-C/3),B=3*q/C/T,Math.abs(B)>1&&(B>=0?B=1:B=-1),W=Math.acos(B)/3,e.y>=0?r=(-T*Math.cos(W+Math.PI/3)-v/3/b)*Math.PI:r=-(-T*Math.cos(W+Math.PI/3)-v/3/b)*Math.PI,Math.abs(a)<Je?t=this.long0:t=et(this.long0+Math.PI*(o-1+Math.sqrt(1+2*(a*a-u*u)+o*o))/2/a),e.x=t,e.y=r,e}var yL=["Van_der_Grinten_I","VanDerGrinten","vandg"],PC={init:fL,forward:mL,inverse:gL,names:yL};function vL(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)}function xL(e){var t=e.x,r=e.y,a=Math.sin(e.y),u=Math.cos(e.y),o=et(t-this.long0),m,v,b,C,T,B,W,q,ee,le,de,H,Q,te,ve,Me,Ce,Be,Fe,qe,ht,Tt,Gt;return this.sphere?Math.abs(this.sin_p12-1)<=Je?(e.x=this.x0+this.a*(Ze-r)*Math.sin(o),e.y=this.y0-this.a*(Ze-r)*Math.cos(o),e):Math.abs(this.sin_p12+1)<=Je?(e.x=this.x0+this.a*(Ze+r)*Math.sin(o),e.y=this.y0+this.a*(Ze+r)*Math.cos(o),e):(Be=this.sin_p12*a+this.cos_p12*u*Math.cos(o),Me=Math.acos(Be),Ce=Me?Me/Math.sin(Me):1,e.x=this.x0+this.a*Ce*u*Math.sin(o),e.y=this.y0+this.a*Ce*(this.cos_p12*a-this.sin_p12*u*Math.cos(o)),e):(m=qs(this.es),v=Js(this.es),b=Qs(this.es),C=Ks(this.es),Math.abs(this.sin_p12-1)<=Je?(T=this.a*Zr(m,v,b,C,Ze),B=this.a*Zr(m,v,b,C,r),e.x=this.x0+(T-B)*Math.sin(o),e.y=this.y0-(T-B)*Math.cos(o),e):Math.abs(this.sin_p12+1)<=Je?(T=this.a*Zr(m,v,b,C,Ze),B=this.a*Zr(m,v,b,C,r),e.x=this.x0+(T+B)*Math.sin(o),e.y=this.y0+(T+B)*Math.cos(o),e):(W=a/u,q=ea(this.a,this.e,this.sin_p12),ee=ea(this.a,this.e,a),le=Math.atan((1-this.es)*W+this.es*q*this.sin_p12/(ee*u)),de=Math.atan2(Math.sin(o),this.cos_p12*Math.tan(le)-this.sin_p12*Math.cos(o)),de===0?Fe=Math.asin(this.cos_p12*Math.sin(le)-this.sin_p12*Math.cos(le)):Math.abs(Math.abs(de)-Math.PI)<=Je?Fe=-Math.asin(this.cos_p12*Math.sin(le)-this.sin_p12*Math.cos(le)):Fe=Math.asin(Math.sin(o)*Math.cos(le)/Math.sin(de)),H=this.e*this.sin_p12/Math.sqrt(1-this.es),Q=this.e*this.cos_p12*Math.cos(de)/Math.sqrt(1-this.es),te=H*Q,ve=Q*Q,qe=Fe*Fe,ht=qe*Fe,Tt=ht*Fe,Gt=Tt*Fe,Me=q*Fe*(1-qe*ve*(1-ve)/6+ht/8*te*(1-2*ve)+Tt/120*(ve*(4-7*ve)-3*H*H*(1-7*ve))-Gt/48*te),e.x=this.x0+Me*Math.sin(de),e.y=this.y0+Me*Math.cos(de),e))}function _L(e){e.x-=this.x0,e.y-=this.y0;var t,r,a,u,o,m,v,b,C,T,B,W,q,ee,le,de,H,Q,te,ve,Me,Ce,Be,Fe;return this.sphere?(t=Math.sqrt(e.x*e.x+e.y*e.y),t>2*Ze*this.a?void 0:(r=t/this.a,a=Math.sin(r),u=Math.cos(r),o=this.long0,Math.abs(t)<=Je?m=this.lat0:(m=io(u*this.sin_p12+e.y*a*this.cos_p12/t),v=Math.abs(this.lat0)-Ze,Math.abs(v)<=Je?this.lat0>=0?o=et(this.long0+Math.atan2(e.x,-e.y)):o=et(this.long0-Math.atan2(-e.x,e.y)):o=et(this.long0+Math.atan2(e.x*a,t*this.cos_p12*u-e.y*this.sin_p12*a))),e.x=o,e.y=m,e)):(b=qs(this.es),C=Js(this.es),T=Qs(this.es),B=Ks(this.es),Math.abs(this.sin_p12-1)<=Je?(W=this.a*Zr(b,C,T,B,Ze),t=Math.sqrt(e.x*e.x+e.y*e.y),q=W-t,m=Xl(q/this.a,b,C,T,B),o=et(this.long0+Math.atan2(e.x,-1*e.y)),e.x=o,e.y=m,e):Math.abs(this.sin_p12+1)<=Je?(W=this.a*Zr(b,C,T,B,Ze),t=Math.sqrt(e.x*e.x+e.y*e.y),q=t-W,m=Xl(q/this.a,b,C,T,B),o=et(this.long0+Math.atan2(e.x,e.y)),e.x=o,e.y=m,e):(t=Math.sqrt(e.x*e.x+e.y*e.y),de=Math.atan2(e.x,e.y),ee=ea(this.a,this.e,this.sin_p12),H=Math.cos(de),Q=this.e*this.cos_p12*H,te=-Q*Q/(1-this.es),ve=3*this.es*(1-te)*this.sin_p12*this.cos_p12*H/(1-this.es),Me=t/ee,Ce=Me-te*(1+te)*Math.pow(Me,3)/6-ve*(1+3*te)*Math.pow(Me,4)/24,Be=1-te*Ce*Ce/2-Me*Ce*Ce*Ce/6,le=Math.asin(this.sin_p12*Math.cos(Ce)+this.cos_p12*Math.sin(Ce)*H),o=et(this.long0+Math.asin(Math.sin(de)*Math.sin(Ce)/Math.cos(le))),Fe=Math.sin(le),m=Math.atan2((Fe-this.es*Be*this.sin_p12)*Math.tan(le),Fe*(1-this.es)),e.x=o,e.y=m,e))}var bL=["Azimuthal_Equidistant","aeqd"],kC={init:vL,forward:xL,inverse:_L,names:bL};function wL(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function IL(e){var t,r,a,u,o,m,v,b,C=e.x,T=e.y;return a=et(C-this.long0),t=Math.sin(T),r=Math.cos(T),u=Math.cos(a),m=this.sin_p14*t+this.cos_p14*r*u,o=1,(m>0||Math.abs(m)<=Je)&&(v=this.a*o*r*Math.sin(a),b=this.y0+this.a*o*(this.cos_p14*t-this.sin_p14*r*u)),e.x=v,e.y=b,e}function SL(e){var t,r,a,u,o,m,v;return e.x-=this.x0,e.y-=this.y0,t=Math.sqrt(e.x*e.x+e.y*e.y),r=io(t/this.a),a=Math.sin(r),u=Math.cos(r),m=this.long0,Math.abs(t)<=Je?(v=this.lat0,e.x=m,e.y=v,e):(v=io(u*this.sin_p14+e.y*a*this.cos_p14/t),o=Math.abs(this.lat0)-Ze,Math.abs(o)<=Je?(this.lat0>=0?m=et(this.long0+Math.atan2(e.x,-e.y)):m=et(this.long0-Math.atan2(-e.x,e.y)),e.x=m,e.y=v,e):(m=et(this.long0+Math.atan2(e.x*a,t*this.cos_p14*u-e.y*this.sin_p14*a)),e.x=m,e.y=v,e))}var CL=["ortho"],zC={init:wL,forward:IL,inverse:SL,names:CL};var yr={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},ki={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function ML(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=Ze-mi/2?this.face=yr.TOP:this.lat0<=-(Ze-mi/2)?this.face=yr.BOTTOM:Math.abs(this.long0)<=mi?this.face=yr.FRONT:Math.abs(this.long0)<=Ze+mi?this.face=this.long0>0?yr.RIGHT:yr.LEFT:this.face=yr.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function EL(e){var t={x:0,y:0},r,a,u,o,m,v,b={value:0};if(e.x-=this.long0,this.es!==0?r=Math.atan(this.one_minus_f_squared*Math.tan(e.y)):r=e.y,a=e.x,this.face===yr.TOP)o=Ze-r,a>=mi&&a<=Ze+mi?(b.value=ki.AREA_0,u=a-Ze):a>Ze+mi||a<=-(Ze+mi)?(b.value=ki.AREA_1,u=a>0?a-gr:a+gr):a>-(Ze+mi)&&a<=-mi?(b.value=ki.AREA_2,u=a+Ze):(b.value=ki.AREA_3,u=a);else if(this.face===yr.BOTTOM)o=Ze+r,a>=mi&&a<=Ze+mi?(b.value=ki.AREA_0,u=-a+Ze):a<mi&&a>=-mi?(b.value=ki.AREA_1,u=-a):a<-mi&&a>=-(Ze+mi)?(b.value=ki.AREA_2,u=-a-Ze):(b.value=ki.AREA_3,u=a>0?-a+gr:-a-gr);else{var C,T,B,W,q,ee,le;this.face===yr.RIGHT?a=Pc(a,+Ze):this.face===yr.BACK?a=Pc(a,+gr):this.face===yr.LEFT&&(a=Pc(a,-Ze)),W=Math.sin(r),q=Math.cos(r),ee=Math.sin(a),le=Math.cos(a),C=q*le,T=q*ee,B=W,this.face===yr.FRONT?(o=Math.acos(C),u=Km(o,B,T,b)):this.face===yr.RIGHT?(o=Math.acos(T),u=Km(o,B,-C,b)):this.face===yr.BACK?(o=Math.acos(-C),u=Km(o,B,-T,b)):this.face===yr.LEFT?(o=Math.acos(-T),u=Km(o,B,C,b)):(o=u=0,b.value=ki.AREA_0)}return v=Math.atan(12/gr*(u+Math.acos(Math.sin(u)*Math.cos(mi))-Ze)),m=Math.sqrt((1-Math.cos(o))/(Math.cos(v)*Math.cos(v))/(1-Math.cos(Math.atan(1/Math.cos(u))))),b.value===ki.AREA_1?v+=Ze:b.value===ki.AREA_2?v+=gr:b.value===ki.AREA_3&&(v+=1.5*gr),t.x=m*Math.cos(v),t.y=m*Math.sin(v),t.x=t.x*this.a+this.x0,t.y=t.y*this.a+this.y0,e.x=t.x,e.y=t.y,e}function TL(e){var t={lam:0,phi:0},r,a,u,o,m,v,b,C,T,B={value:0};if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,a=Math.atan(Math.sqrt(e.x*e.x+e.y*e.y)),r=Math.atan2(e.y,e.x),e.x>=0&&e.x>=Math.abs(e.y)?B.value=ki.AREA_0:e.y>=0&&e.y>=Math.abs(e.x)?(B.value=ki.AREA_1,r-=Ze):e.x<0&&-e.x>=Math.abs(e.y)?(B.value=ki.AREA_2,r=r<0?r+gr:r-gr):(B.value=ki.AREA_3,r+=Ze),T=gr/12*Math.tan(r),m=Math.sin(T)/(Math.cos(T)-1/Math.sqrt(2)),v=Math.atan(m),u=Math.cos(r),o=Math.tan(a),b=1-u*u*o*o*(1-Math.cos(Math.atan(1/Math.cos(v)))),b<-1?b=-1:b>1&&(b=1),this.face===yr.TOP)C=Math.acos(b),t.phi=Ze-C,B.value===ki.AREA_0?t.lam=v+Ze:B.value===ki.AREA_1?t.lam=v<0?v+gr:v-gr:B.value===ki.AREA_2?t.lam=v-Ze:t.lam=v;else if(this.face===yr.BOTTOM)C=Math.acos(b),t.phi=C-Ze,B.value===ki.AREA_0?t.lam=-v+Ze:B.value===ki.AREA_1?t.lam=-v:B.value===ki.AREA_2?t.lam=-v-Ze:t.lam=v<0?-v-gr:-v+gr;else{var W,q,ee;W=b,T=W*W,T>=1?ee=0:ee=Math.sqrt(1-T)*Math.sin(v),T+=ee*ee,T>=1?q=0:q=Math.sqrt(1-T),B.value===ki.AREA_1?(T=q,q=-ee,ee=T):B.value===ki.AREA_2?(q=-q,ee=-ee):B.value===ki.AREA_3&&(T=q,q=ee,ee=-T),this.face===yr.RIGHT?(T=W,W=-q,q=T):this.face===yr.BACK?(W=-W,q=-q):this.face===yr.LEFT&&(T=W,W=q,q=-T),t.phi=Math.acos(-ee)-Ze,t.lam=Math.atan2(q,W),this.face===yr.RIGHT?t.lam=Pc(t.lam,-Ze):this.face===yr.BACK?t.lam=Pc(t.lam,-gr):this.face===yr.LEFT&&(t.lam=Pc(t.lam,+Ze))}if(this.es!==0){var le,de,H;le=t.phi<0?1:0,de=Math.tan(t.phi),H=this.b/Math.sqrt(de*de+this.one_minus_f_squared),t.phi=Math.atan(Math.sqrt(this.a*this.a-H*H)/(this.one_minus_f*H)),le&&(t.phi=-t.phi)}return t.lam+=this.long0,e.x=t.lam,e.y=t.phi,e}function Km(e,t,r,a){var u;return e<Je?(a.value=ki.AREA_0,u=0):(u=Math.atan2(t,r),Math.abs(u)<=mi?a.value=ki.AREA_0:u>mi&&u<=Ze+mi?(a.value=ki.AREA_1,u-=Ze):u>Ze+mi||u<=-(Ze+mi)?(a.value=ki.AREA_2,u=u>=0?u-gr:u+gr):(a.value=ki.AREA_3,u+=Ze)),u}function Pc(e,t){var r=e+t;return r<-gr?r+=qa:r>+gr&&(r-=qa),r}var AL=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"],LC={init:ML,forward:EL,inverse:TL,names:AL};var N1=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],Zd=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],RC=.8487,DC=1.3523,BC=Kn/5,PL=1/BC,kc=18,eg=function(e,t){return e[0]+t*(e[1]+t*(e[2]+t*e[3]))},kL=function(e,t){return e[1]+t*(2*e[2]+t*3*e[3])};function zL(e,t,r,a){for(var u=t;a;--a){var o=e(u);if(u-=o,Math.abs(o)<r)break}return u}function LL(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function RL(e){var t=et(e.x-this.long0),r=Math.abs(e.y),a=Math.floor(r*BC);a<0?a=0:a>=kc&&(a=kc-1),r=Kn*(r-PL*a);var u={x:eg(N1[a],r)*t,y:eg(Zd[a],r)};return e.y<0&&(u.y=-u.y),u.x=u.x*this.a*RC+this.x0,u.y=u.y*this.a*DC+this.y0,u}function DL(e){var t={x:(e.x-this.x0)/(this.a*RC),y:Math.abs(e.y-this.y0)/(this.a*DC)};if(t.y>=1)t.x/=N1[kc][0],t.y=e.y<0?-Ze:Ze;else{var r=Math.floor(t.y*kc);for(r<0?r=0:r>=kc&&(r=kc-1);;)if(Zd[r][0]>t.y)--r;else if(Zd[r+1][0]<=t.y)++r;else break;var a=Zd[r],u=5*(t.y-a[0])/(Zd[r+1][0]-a[0]);u=zL(function(o){return(eg(a,o)-t.y)/kL(a,o)},u,Je,100),t.x/=eg(N1[r],u),t.y=(5*r+u)*mr,e.y<0&&(t.y=-t.y)}return t.x=et(t.x+this.long0),t}var BL=["Robinson","robin"],NC={init:LL,forward:RL,inverse:DL,names:BL};function NL(){this.name="geocent"}function FL(e){var t=Wm(e,this.es,this.a);return t}function OL(e){var t=Zm(e,this.es,this.a,this.b);return t}var GL=["Geocentric","geocentric","geocent","Geocent"],FC={init:NL,forward:FL,inverse:OL,names:GL};var In={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},jd={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function VL(){if(Object.keys(jd).forEach(function(r){if(typeof this[r]>"u")this[r]=jd[r].def;else{if(jd[r].num&&isNaN(this[r]))throw new Error("Invalid parameter value, must be numeric "+r+" = "+this[r]);jd[r].num&&(this[r]=parseFloat(this[r]))}jd[r].degrees&&(this[r]=this[r]*mr)}.bind(this)),Math.abs(Math.abs(this.lat0)-Ze)<Je?this.mode=this.lat0<0?In.S_POLE:In.N_POLE:Math.abs(this.lat0)<Je?this.mode=In.EQUIT:(this.mode=In.OBLIQ,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var e=this.tilt,t=this.azi;this.cg=Math.cos(t),this.sg=Math.sin(t),this.cw=Math.cos(e),this.sw=Math.sin(e)}function UL(e){e.x-=this.long0;var t=Math.sin(e.y),r=Math.cos(e.y),a=Math.cos(e.x),u,o;switch(this.mode){case In.OBLIQ:o=this.sinph0*t+this.cosph0*r*a;break;case In.EQUIT:o=r*a;break;case In.S_POLE:o=-t;break;case In.N_POLE:o=t;break}switch(o=this.pn1/(this.p-o),u=o*r*Math.sin(e.x),this.mode){case In.OBLIQ:o*=this.cosph0*t-this.sinph0*r*a;break;case In.EQUIT:o*=t;break;case In.N_POLE:o*=-(r*a);break;case In.S_POLE:o*=r*a;break}var m,v;return m=o*this.cg+u*this.sg,v=1/(m*this.sw*this.h1+this.cw),u=(u*this.cg-o*this.sg)*this.cw*v,o=m*v,e.x=u*this.a,e.y=o*this.a,e}function WL(e){e.x/=this.a,e.y/=this.a;var t={x:e.x,y:e.y},r,a,u;u=1/(this.pn1-e.y*this.sw),r=this.pn1*e.x*u,a=this.pn1*e.y*this.cw*u,e.x=r*this.cg+a*this.sg,e.y=a*this.cg-r*this.sg;var o=Vn(e.x,e.y);if(Math.abs(o)<Je)t.x=0,t.y=e.y;else{var m,v;switch(v=1-o*o*this.pfact,v=(this.p-Math.sqrt(v))/(this.pn1/o+o/this.pn1),m=Math.sqrt(1-v*v),this.mode){case In.OBLIQ:t.y=Math.asin(m*this.sinph0+e.y*v*this.cosph0/o),e.y=(m-this.sinph0*Math.sin(t.y))*o,e.x*=v*this.cosph0;break;case In.EQUIT:t.y=Math.asin(e.y*v/o),e.y=m*o,e.x*=v;break;case In.N_POLE:t.y=Math.asin(m),e.y=-e.y;break;case In.S_POLE:t.y=-Math.asin(m);break}t.x=Math.atan2(e.x,e.y)}return e.x=t.x+this.long0,e.y=t.y,e}var ZL=["Tilted_Perspective","tpers"],OC={init:VL,forward:UL,inverse:WL,names:ZL};function jL(){if(this.flip_axis=this.sweep==="x"?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var e=1-this.es,t=1/e;this.radius_p=Math.sqrt(e),this.radius_p2=e,this.radius_p_inv2=t,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")}function HL(e){var t=e.x,r=e.y,a,u,o,m;if(t=t-this.long0,this.shape==="ellipse"){r=Math.atan(this.radius_p2*Math.tan(r));var v=this.radius_p/Vn(this.radius_p*Math.cos(r),Math.sin(r));if(u=v*Math.cos(t)*Math.cos(r),o=v*Math.sin(t)*Math.cos(r),m=v*Math.sin(r),(this.radius_g-u)*u-o*o-m*m*this.radius_p_inv2<0)return e.x=Number.NaN,e.y=Number.NaN,e;a=this.radius_g-u,this.flip_axis?(e.x=this.radius_g_1*Math.atan(o/Vn(m,a)),e.y=this.radius_g_1*Math.atan(m/a)):(e.x=this.radius_g_1*Math.atan(o/a),e.y=this.radius_g_1*Math.atan(m/Vn(o,a)))}else this.shape==="sphere"&&(a=Math.cos(r),u=Math.cos(t)*a,o=Math.sin(t)*a,m=Math.sin(r),a=this.radius_g-u,this.flip_axis?(e.x=this.radius_g_1*Math.atan(o/Vn(m,a)),e.y=this.radius_g_1*Math.atan(m/a)):(e.x=this.radius_g_1*Math.atan(o/a),e.y=this.radius_g_1*Math.atan(m/Vn(o,a))));return e.x=e.x*this.a,e.y=e.y*this.a,e}function XL(e){var t=-1,r=0,a=0,u,o,m,v;if(e.x=e.x/this.a,e.y=e.y/this.a,this.shape==="ellipse"){this.flip_axis?(a=Math.tan(e.y/this.radius_g_1),r=Math.tan(e.x/this.radius_g_1)*Vn(1,a)):(r=Math.tan(e.x/this.radius_g_1),a=Math.tan(e.y/this.radius_g_1)*Vn(1,r));var b=a/this.radius_p;if(u=r*r+b*b+t*t,o=2*this.radius_g*t,m=o*o-4*u*this.C,m<0)return e.x=Number.NaN,e.y=Number.NaN,e;v=(-o-Math.sqrt(m))/(2*u),t=this.radius_g+v*t,r*=v,a*=v,e.x=Math.atan2(r,t),e.y=Math.atan(a*Math.cos(e.x)/t),e.y=Math.atan(this.radius_p_inv2*Math.tan(e.y))}else if(this.shape==="sphere"){if(this.flip_axis?(a=Math.tan(e.y/this.radius_g_1),r=Math.tan(e.x/this.radius_g_1)*Math.sqrt(1+a*a)):(r=Math.tan(e.x/this.radius_g_1),a=Math.tan(e.y/this.radius_g_1)*Math.sqrt(1+r*r)),u=r*r+a*a+t*t,o=2*this.radius_g*t,m=o*o-4*u*this.C,m<0)return e.x=Number.NaN,e.y=Number.NaN,e;v=(-o-Math.sqrt(m))/(2*u),t=this.radius_g+v*t,r*=v,a*=v,e.x=Math.atan2(r,t),e.y=Math.atan(a*Math.cos(e.x)/t)}return e.x=e.x+this.long0,e}var $L=["Geostationary Satellite View","Geostationary_Satellite","geos"],GC={init:jL,forward:HL,inverse:XL,names:$L};function VC(e){e.Proj.projections.add(Ec),e.Proj.projections.add(Tc),e.Proj.projections.add(uC),e.Proj.projections.add(cC),e.Proj.projections.add(hC),e.Proj.projections.add(dC),e.Proj.projections.add(pC),e.Proj.projections.add(fC),e.Proj.projections.add(mC),e.Proj.projections.add(gC),e.Proj.projections.add(yC),e.Proj.projections.add(vC),e.Proj.projections.add(xC),e.Proj.projections.add(bC),e.Proj.projections.add(wC),e.Proj.projections.add(SC),e.Proj.projections.add(CC),e.Proj.projections.add(MC),e.Proj.projections.add(EC),e.Proj.projections.add(TC),e.Proj.projections.add(AC),e.Proj.projections.add(PC),e.Proj.projections.add(kC),e.Proj.projections.add(zC),e.Proj.projections.add(LC),e.Proj.projections.add(NC),e.Proj.projections.add(FC),e.Proj.projections.add(OC),e.Proj.projections.add(GC)}eo.defaultDatum="WGS84";eo.Proj=Ja;eo.WGS84=new eo.Proj("WGS84");eo.Point=eC;eo.toPoint=Hm;eo.defs=wc;eo.nadgrid=A1;eo.transform=jl;eo.mgrs=JS;eo.version="__VERSION__";VC(eo);var zc=eo;var UC=`PROJCS["NZGD2000 / Chatham Islands TM 2000",
|
|
516
|
-
GEOGCS["NZGD2000",
|
|
517
|
-
DATUM["New_Zealand_Geodetic_Datum_2000",
|
|
518
|
-
SPHEROID["GRS 1980",6378137,298.257222101,
|
|
519
|
-
AUTHORITY["EPSG","7019"]],
|
|
520
|
-
TOWGS84[0,0,0,0,0,0,0],
|
|
521
|
-
AUTHORITY["EPSG","6167"]],
|
|
522
|
-
PRIMEM["Greenwich",0,
|
|
523
|
-
AUTHORITY["EPSG","8901"]],
|
|
524
|
-
UNIT["degree",0.01745329251994328,
|
|
525
|
-
AUTHORITY["EPSG","9122"]],
|
|
526
|
-
AUTHORITY["EPSG","4167"]],
|
|
527
|
-
UNIT["metre",1,
|
|
528
|
-
AUTHORITY["EPSG","9001"]],
|
|
529
|
-
PROJECTION["Transverse_Mercator"],
|
|
530
|
-
PARAMETER["latitude_of_origin",0],
|
|
531
|
-
PARAMETER["central_meridian",-176.5],
|
|
532
|
-
PARAMETER["scale_factor",1],
|
|
533
|
-
PARAMETER["false_easting",3500000],
|
|
534
|
-
PARAMETER["false_northing",10000000],
|
|
535
|
-
AUTHORITY["EPSG","3793"],
|
|
536
|
-
AXIS["Easting",EAST],
|
|
537
|
-
AXIS["Northing",NORTH]]`;var WC=`PROJCS["NZGD2000 / New Zealand Transverse Mercator 2000",
|
|
538
|
-
GEOGCS["NZGD2000",
|
|
539
|
-
DATUM["New_Zealand_Geodetic_Datum_2000",
|
|
540
|
-
SPHEROID["GRS 1980",6378137,298.257222101,
|
|
541
|
-
AUTHORITY["EPSG","7019"]],
|
|
542
|
-
TOWGS84[0,0,0,0,0,0,0],
|
|
543
|
-
AUTHORITY["EPSG","6167"]],
|
|
544
|
-
PRIMEM["Greenwich",0,
|
|
545
|
-
AUTHORITY["EPSG","8901"]],
|
|
546
|
-
UNIT["degree",0.0174532925199433,
|
|
547
|
-
AUTHORITY["EPSG","9122"]],
|
|
548
|
-
AUTHORITY["EPSG","4167"]],
|
|
549
|
-
PROJECTION["Transverse_Mercator"],
|
|
550
|
-
PARAMETER["latitude_of_origin",0],
|
|
551
|
-
PARAMETER["central_meridian",173],
|
|
552
|
-
PARAMETER["scale_factor",0.9996],
|
|
553
|
-
PARAMETER["false_easting",1600000],
|
|
554
|
-
PARAMETER["false_northing",10000000],
|
|
555
|
-
UNIT["metre",1,
|
|
556
|
-
AUTHORITY["EPSG","9001"]],
|
|
557
|
-
AUTHORITY["EPSG","2193"]]`;var Sn;(function(e){e[e.UInt8=1]="UInt8",e[e.UInt16=2]="UInt16",e[e.UInt32=4]="UInt32",e[e.UInt64=8]="UInt64",e[e.Double=8]="Double",e[e.Float=4]="Float"})(Sn||(Sn={}));var ZC=2**32,YL=typeof setImmediate>"u"?setTimeout:setImmediate,Un=()=>{throw new Error("Method not implemented.")},ps=class{constructor(){this.isLittleEndian=!0,this.delayMs=ps.DefaultDelayMs,this.maxChunkCount=10,this.chunks=ps.DefaultChunkCache(),this.blankFillCount=16,this.maxConcurrentRequests=50,this.toFetch=new Set,this.toFetchPromise=null,this.byteOffset=0,this.getFloat32=Un,this.getFloat64=Un,this.getInt8=Un,this.getInt16=Un,this.getInt32=Un,this.setFloat32=Un,this.setFloat64=Un,this.setInt8=Un,this.setInt16=Un,this.setInt32=Un,this.setUint8=Un,this.setUint16=Un,this.setUint32=Un,this.setBigInt64=Un,this.setBigUint64=Un}static getByteRanges(t,r=32,a=16){if(t.size===0)return{chunks:[],blankFill:[]};let u=[...t.values()].sort((b,C)=>b-C),o=[],m=[];o.push(m);let v=[];for(let b=0;b<u.length;++b){let C=u[b],T=u[b-1];if(m.length>=r)m=[C],o.push(m);else if(b===0||C===T+1)m.push(C);else if(C<T+a){for(let B=T;B<C;B++)m.push(B+1),v.push(B+1);v.pop()}else m=[C],o.push(m)}return{chunks:o,blankFill:v}}async fetchData(){if(this.toFetch.size===0)return;let t=this.toFetch;this.toFetch=new Set,this.toFetchPromise=null;let r=ps.getByteRanges(t,this.maxChunkCount,this.blankFillCount),a=[];for(let u of r.chunks){let o=u[0],m=u[u.length-1],v=o*this.chunkSize,b=m*this.chunkSize+this.chunkSize-v,C=await this.fetchBytes(v,b);if(u.length===1){a[o]=C,this.chunks.set(o,new DataView(C));continue}let T=o*this.chunkSize;for(let B of u){let W=B*this.chunkSize-T,q=C.slice(W,W+this.chunkSize);a[B]=q,this.chunks.set(B,new DataView(q))}}}async loadBytes(t,r){if(t<0)throw new Error("Offset must be positive");let a=Math.floor(t/this.chunkSize),u=Math.ceil((t+r)/this.chunkSize)-1;for(let o=a;o<=u;o++)this.chunks.has(o)||this.toFetch.add(o);if(this.toFetch.size!==0){if(this.toFetchPromise==null&&(this.toFetchPromise=new Promise(o=>YL(o,this.delayMs)).then(()=>this.fetchData())),this.toFetch.size>this.maxConcurrentRequests)throw new Error("Too many outstanding requests");await this.toFetchPromise}}getChunkId(t){return Math.floor(t/this.chunkSize)}getUint(t,r){switch(r){case Sn.UInt8:return this.getUint8(t);case Sn.UInt16:return this.getUint16(t);case Sn.UInt32:return this.getUint32(t);case Sn.UInt64:return this.getUint64(t)}}bytes(t,r){let a=this.isOneChunk(t,r);if(a){let C=this.getView(a),T=t-a*this.chunkSize;return new Uint8Array(C.buffer.slice(T,T+r))}let u=new Uint8Array(r),o=t+r,m=Math.floor(t/this.chunkSize),v=Math.ceil((t+r)/this.chunkSize)-1,b=0;for(let C=m;C<=v;C++){let T=t+b,B=C*this.chunkSize,W=this.getView(C),q=Math.min(o,B+this.chunkSize),ee=W.buffer.slice(T-B,q-B);u.set(new Uint8Array(ee),b),b+=ee.byteLength}return u}getView(t){let r=this.chunks.get(t);if(r==null)throw new Error(`Chunk:${t} is not ready`);return r}isOneChunk(t,r){let a=t+r-1,u=Math.floor(t/this.chunkSize);return Math.floor(a/this.chunkSize)-u<1?u:null}hasBytes(t,r=1){let a=Math.floor(t/this.chunkSize),u=Math.ceil((t+r)/this.chunkSize)-1;for(let o=a;o<=u;o++)if(!this.chunks.has(o))return!1;return!0}toRange(t,r){if(r==null)return`bytes=${t}`;if(t<0)throw new Error("Cannot read from remote source with negative offset and length");return`bytes=${t}-${t+r}`}parseContentRange(t){let[r,a]=t.split(" ");if(r!=="bytes")throw new Error("Failed to parse content-range: "+t);if(a==null)throw new Error("Failed to parse content-range: "+t);let[,u]=a.split("/"),o=Number(u);if(isNaN(o))throw new Error("Failed to parse content-range: "+t);return o}get buffer(){throw new Error("Method not implemented.")}get byteLength(){if(this._byteLength)return this._byteLength;throw Error(".size() has not been fetched.")}getUint8(t){let r=Math.floor(t/this.chunkSize),a=this.chunks.get(r);if(a==null)throw new Error(`Chunk:${r} is not ready`);return a.getUint8(t-r*this.chunkSize)}getUint16(t){let r=this.isOneChunk(t,Sn.UInt16);if(r!=null)return this.getView(r).getUint16(t-r*this.chunkSize,this.isLittleEndian);let a=this.getUint8(t),u=this.getUint8(t+Sn.UInt8);return this.isLittleEndian?a+(u<<8):(a<<8)+u}getUint32(t){let r=this.isOneChunk(t,Sn.UInt32);if(r!=null)return this.getView(r).getUint32(t-r*this.chunkSize,this.isLittleEndian);let a=this.getUint16(t),u=this.getUint16(t+Sn.UInt16);return this.isLittleEndian?a+u*65536:a*65536+u}getUint64(t){let r=this.isOneChunk(t,Sn.UInt64);if(r!=null){let o=this.getView(r);return Number(o.getBigUint64(t-r*this.chunkSize,this.isLittleEndian))}let a=this.getUint32(t),u=this.getUint32(t+Sn.UInt32);return this.isLittleEndian?a+u*ZC:a*ZC+u}getBigUint64(t){let r=this.isOneChunk(t,Sn.UInt64);if(r!=null)return this.getView(r).getBigUint64(t-r*this.chunkSize,this.isLittleEndian);let a=BigInt(this.getUint32(t)),u=BigInt(this.getUint32(t+Sn.UInt32));return this.isLittleEndian?a+(u<<BigInt(32)):(a<<BigInt(32))+u}getBigInt64(){throw new Error("Not implemented.")}};ps.DefaultChunkCache=()=>new Map;ps.DefaultDelayMs=1;var Hd=class extends Error{constructor(t,r,a){super(t),this.name="CompositeError",this.code=r,this.reason=a}static isCompositeError(t){return typeof t!="object"||t==null?!1:t.name==="CompositeError"}};var qL=/\/$/,JL=/^\//;function jC(e,t){return e.replace(qL,"")+"/"+t.replace(JL,"")}zc.defs(qt.Nztm2000.toEpsgString(),WC);zc.defs(qt.Citm2000.toEpsgString(),UC);var F1=new Map;function QL(e){return e==null?null:typeof e=="number"?e:"code"in e?e.code:"projection"in e?e.projection.code:null}var ro=class{constructor(t){this.epsg=t;try{this.projection=zc(t.toEpsgString(),qt.Wgs84.toEpsgString())}catch(r){throw new Hd(`Failed to create projection: ${t.toEpsgString()}, ${qt.Wgs84.toEpsgString()}`,500,r)}}static define(t,r){if(F1.get(t.code)!=null)throw new Error("Duplicate projection definition: "+t.toEpsgString());zc.defs(t.toEpsgString(),r)}static get(t){let r=this.tryGet(t);if(r==null)throw new Error(`Invalid projection: ${t}`);return r}static tryGet(t){let r=QL(t);if(r==null)return null;let a=F1.get(r);if(a!=null)return a;let u=qt.tryGet(r);return u==null||zc.defs(u.toEpsgString())==null?null:(a=new ro(u),F1.set(r,a),a)}projectMultipolygon(t,r){if(r.epsg.code===this.epsg.code)return t;let{toWgs84:a}=this,{fromWgs84:u}=r;return t.map(o=>o.map(m=>m.map(v=>u(a(v)))))}get toWgs84(){return this.projection.forward}get fromWgs84(){return this.projection.inverse}boundsToWgs84BoundingBox(t){let r=this.toWgs84([t.x,t.y]),a=this.toWgs84([t.x+t.width,t.y+t.height]);return[r[0],r[1],a[0],a[1]]}boundsToGeoJsonFeature(t,r={}){let a=[t.x,t.y],u=[t.x+t.width,t.y],o=[t.x,t.y+t.height],m=[t.x+t.width,t.y+t.height],v=lS([[[a,o,m,u,a]]],this.toWgs84),b=v.length===1?uS(v[0],r):cS(v,r);return b.bbox=this.boundsToWgs84BoundingBox(t),b}toGeoJson(t){return{type:"FeatureCollection",features:t.map(r=>this.boundsToGeoJsonFeature(r,{name:r.name}))}}static getTiffResZoom(t,r){for(let a=0;a<t.zooms.length;a++)if(t.pixelScale(a)-r<this.AllowedFloatingError)return a;return t.zooms.length-1}static tileToWgs84Bbox(t,r){let a=t.tileToSource(r),u=t.tileToSource({x:r.x+1,y:r.y+1,z:r.z}),o=this.get(t),[m,v]=o.toWgs84([a.x,u.y]),[b,C]=o.toWgs84([u.x,a.y]);return[m,v,b,C]}static tileCenterToLatLon(t,r){let a=t.tileToSource({x:r.x+.5,y:r.y+.5,z:r.z}),[u,o]=this.get(t).toWgs84([a.x,a.y]);return ro.wrapLatLon(o,u)}static wrapLatLon(t,r){let a={lat:t,lon:r},u=Math.floor(Math.abs(t)/90)%4,o=t>0?90:-90,m=t%90;switch(u){case 0:a.lat=m;break;case 1:a.lat=o-m,a.lon+=180;break;case 2:a.lat=-m,a.lon+=180;break;case 3:a.lat=-o+m;break}return(a.lon>180||a.lon<-180)&&(a.lon-=Math.floor((a.lon+180)/360)*360),a}static findAlignmentLevels(t,r,a,u=2){return Math.max(0,this.getTiffResZoom(t,a*u)-r.z)}static getImagePixelWidth(t,r,a){let u=t.tileToSource(r),o=t.tileToSource({x:r.x+1,y:r.y+1,z:r.z});return Math.round((o.x-u.x)/t.pixelScale(a))*2}};ro.AllowedFloatingError=1e-8;var tg=class{static async load(t){if(ro.tryGet(t)!=null)return qt.get(t);let r=`https://spatialreference.org/ref/epsg/${t}/ogcwkt/`,a=await this._fetch(r);if(!a.ok)throw new Error("Failed to load projection information for:"+t);let u=qt.tryGet(t);u==null&&(u=new qt(t));let o=await a.text();return ro.define(u,o),u}};tg._fetch=fetch;var xM=Lt(XC(),1);var mM=Lt(Ir(),1);function $C(e){let t=document.createElement("span");return t.textContent=e,t.innerHTML}var G1=class{constructor(t){var r,a;this.boundaries=[],this.collection=t;let u=t.summaries["linz:zoom"];this.minZoom=u.min,this.maxZoom=u.max,this.bbox=t.extent.spatial.bbox[0],this.startDate=(r=t.extent.temporal)===null||r===void 0?void 0:r.interval[0][0],this.endDate=(a=t.extent.temporal)===null||a===void 0?void 0:a.interval[0][1]}intersects(t){return t.zoom>this.maxZoom||t.zoom<this.minZoom||t.dateAfter&&t.dateBefore&&t.dateAfter>t.dateBefore||t.dateAfter&&this.endDate&&t.dateAfter>this.endDate||t.dateBefore&&this.startDate&&t.dateBefore<this.startDate||!Ya.intersects(t.extent,this.bbox)?!1:this.intersection(Ya.bboxToMultiPolygon(t.extent))}intersection(t){for(let r of this.boundaries)if(w1(r,t).length>0)return!0;return!1}addBoundary(t){t6(t),this.boundaries.push(t)}};function t6(e){for(let t of e)for(let r of t)if(r.length!==2)throw new Error("Invalid ring wrong length")}function i6(e){var t;let r=new Map,a=[];for(let u of e.collections){let o=new G1(u);a.push(o),r.set(u.id,o)}for(let u of e.features){let o=r.get((t=u.collection)!==null&&t!==void 0?t:"");if(o==null)throw new Error("Could not match feature to collection: "+u.collection);if(u.geometry.type==="Polygon")o.addBoundary(u.geometry.coordinates);else if(u.geometry.type==="MultiPolygon")for(let m of u.geometry.coordinates)o.addBoundary(m)}return a}function YC(e){var t,r;let a=(r=(t=e.extent)===null||t===void 0?void 0:t.temporal)===null||r===void 0?void 0:r.interval;if(a==null||a.length===0)return[-1,-1];let u=a[0],o=new Date(u[0]).getFullYear(),m=(u.length<2?o:new Date(u[1]).getFullYear())-1;return[o,m<o?o:m]}var Qa=class{constructor(t){this.attributions=t}static async load(t){let r=await fetch(t);if(r.ok){let a=await r.json();return Qa.fromStac(a)}throw new Error(`fetch attribution failed [${r.status}] ${r.statusText}`)}static fromStac(t){return new Qa(i6(t).reverse())}filter(t){t.zoom=Math.round(t.zoom);let r=[],{attributions:a}=this;if(a==null)return r;for(let u of a)this.isIgnored!=null&&this.isIgnored(u)||u.intersects(t)&&r.push(u);return r}renderList(t){if(t.length===0)return"";let r=$C(t[0].collection.title);if(t.length>1)if(t.length===2)r+=` & ${$C(t[1].collection.title)}`;else{let[a,u]=YC(t[1].collection);for(let o=1;o<t.length;++o){let[m,v]=YC(t[o].collection);m!==-1&&(a===-1||m<a)&&(a=m),v!==-1&&(u===-1||v>u)&&(u=v)}a===-1&&(a=u),u!==-1&&(r+=` & others ${a}-${u}`)}return r}};var Yd=Lt(ig(),1);var Dc=Lt(ig(),1),dM=Lt(Ir(),1);var KC=Lt(QC(),1),eM="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",tM=(0,KC.default)(eM),n6=new Set(eM);function iM(e){for(let t=0;t<e.length;t++)if(!n6.has(e.charAt(t)))return!1;return!0}function rg(e){let t=Object.entries(e);if(t.length===0)return"";let r=new URLSearchParams;for(let u of t)u[1]!=null&&r.set(u[0],u[1]);r.sort();let a=r.toString();return a===""?"":`?${a}`}function ng(e){if(e==null)return null;if(iM(e))return e;let r=new TextEncoder().encode(e);return tM.encode(r)}var Gi={ImageFormat:"png",toHash(e){return`#@${e.lat.toFixed(7)},${e.lon.toFixed(7)},z${e.zoom}`},parseZoom(e){return e==null||e===""?NaN:e.startsWith("z")?parseFloat(e.slice(1)):e.endsWith("z")?parseFloat(e):NaN},fromHash(e){let t={},r=e.replace("#@",""),[a,u,o]=r.split(","),m=parseFloat(a),v=parseFloat(u);!isNaN(m)&&!isNaN(v)&&(t.lat=m,t.lon=v);let b=Gi.parseZoom(o);return isNaN(b)||(t.zoom=b),t},baseUrl(){let e=Ie.BaseUrl;if(e==="")return window.location.origin;if(!e.startsWith("http"))throw new Error("BaseURL must start with http(s)://");return e},toBaseWmts(){let e=rg({api:Ie.ApiKey,config:ng(Ie.map.config)});return`${this.baseUrl()}/v1/tiles/aerial/WMTSCapabilities.xml${e}`},toImageryUrl(e,t){return`${this.baseUrl()}/v1/imagery/${e}/${t}`},toTileUrl(e){let t=new URLSearchParams;Ie.ApiKey!=null&&Ie.ApiKey!==""&&t.set("api",Ie.ApiKey),e.config!=null&&t.set("config",ng(e.config)),e.date?.before!=null&&t.set("date[before]",e.date.before),e.urlType==="style"&&(e.tileMatrix.identifier!==xi.identifier&&t.set("tileMatrix",e.tileMatrix.identifier),Gi.ImageFormat!==Nd.Webp&&t.set("format",Gi.ImageFormat));let r="?"+t.toString(),a=`${this.baseUrl()}/v1/tiles/${e.layerId}/${e.tileMatrix.identifier}`;if(e.urlType==="raster")return`${a}/{z}/{x}/{y}.${Gi.ImageFormat}${r}`;if(e.urlType==="vector-xyz")return`${a}/{z}/{x}/{y}.pbf${r}`;if(e.urlType==="style")return`${this.baseUrl()}/v1/styles/${e.style??e.layerId}.json${r}`;if(e.urlType==="wmts")return`${a}/WMTSCapabilities.xml${r}`;if(e.urlType==="attribution")return`${a}/attribution.json${r}`;if(e.urlType==="tile-wmts")return`${a}/{TileMatrix}/{TileCol}/{TileRow}.${Gi.ImageFormat}${r}`;throw new Error("Unknown url type: "+e.urlType)},toConfigUrl(e,t=Ie.map.config){let r=rg({api:Ie.ApiKey,config:t});return`${this.baseUrl()}/v1/config/${e}.json${r}`},toConfigImageryUrl(e,t,r=Ie.map.config){let a=rg({api:Ie.ApiKey,config:r});return`${this.baseUrl()}/v1/config/${e}/${t}.json${a}`}};var Xd=class{constructor(t,r=0){this.tileMatrix=t,this.extraZoomLevels=r}getStyle(t,r,a=Ie.map.config,u){return Gi.toTileUrl({urlType:"style",tileMatrix:this.tileMatrix,layerId:t,style:r,config:a,date:u})}},o6=new Xd(Hs,2),s6=new Xd(cs),nM=new Xd(xi),a6=[o6,s6,nM];function Lc(e){for(let t of a6)if(e===t.tileMatrix.identifier)return t;return nM}function rM(e){return e.identifier===xi.identifier}function fs(e,t,r){if(t.identifier===r.identifier)return e;if(!rM(t)&&!rM(r))throw new Error("Either tileMatrix or targetTileMatrix must be GoogleTms");let a=ro.get(t).fromWgs84([e.lon,e.lat]),u=t.sourceToPixels(a[0],a[1],Math.round(e.zoom)),o={x:u.x/t.tileSize,y:u.y/t.tileSize,z:Math.round(e.zoom)},m=r.tileToSource(o),v=ro.get(r).toWgs84([m.x,m.y]);return{lon:Math.round(v[0]*1e8)/1e8,lat:Math.round(v[1]*1e8)/1e8,zoom:e.zoom}}function oM(e,t){for(let r of e.features){if(r.geometry.type!=="Polygon")throw new Error("Only polygons supported");for(let a of r.geometry.coordinates)for(let u of a){let o=fs({lat:u[1],lon:u[0],zoom:t.maxZoom},t,xi);u[0]=o.lon,u[1]=o.lat}}}var Rc=Lt(Ir(),1);var ms=class{static getTileSet(t){let r=Gi.toConfigUrl(t),a=this.tileSets.get(r);return a||(a=fetch(r).then(u=>u.ok?u.json():null),this.tileSets.set(r,a),a)}static getImagery(t,r){let a=Gi.toConfigImageryUrl(t,r),u=this.imagery.get(a);return u||(u=fetch(a).then(o=>o.ok?o.json():null),this.imagery.set(a,u),u)}static getGeoJson(t){let r=hs.find(t.tileMatrix);if(r==null)return;let a=ro.get(r).toGeoJson(t.files);for(let u of a.features){u.properties=u.properties??{};let o=u.properties.name;u.properties.location=jC(t.uri,u.properties.name),u.properties.epsg=t.projection,u.properties.tileMatrix=t.tileMatrix;let m=t.files.find(v=>v.name===o);m!=null&&(u.properties.x=m.x,u.properties.y=m.y,u.properties.width=m.width,u.properties.height=m.height)}return a}};ms.tileSets=new Map,ms.imagery=new Map;var og=class{constructor(){this._layerLoading=new Map;this._source=new Map;this._styleJson=null;this.adjustTopographic=t=>{Ie.map.setDebug("debug.layer.linz-topographic",Number(t.target.value))};this.adjustOsm=t=>{Ie.map.setDebug("debug.layer.osm",Number(t.target.value))};this.adjustLinzAerial=t=>{Ie.map.setDebug("debug.layer.linz-aerial",Number(t.target.value))};this.togglePurple=t=>{let r=t.target;this.setPurple(r.checked)}}loadSourceLayer(t,r,a,u){let o=`${r}-${u}`,m=this._layerLoading.get(o);return m==null&&(m=this._loadSourceLayer(t,r,a,u),this._layerLoading.set(o,m)),m}async _loadSourceLayer(t,r,a,u){let o=`${r}_${u}`,m=`${o}_fill`;if(t.getLayer(m)!=null)return;let v=await this.fetchSourceLayer(a.id,u);if(v==null&&u==="source"&&(v=ms.getGeoJson(a)),v==null)return;Ie.map.tileMatrix.projection!==xi.projection&&oM(v,Ie.map.tileMatrix);let b=0;for(let C of v.features)C.id=b++;t.addSource(o,{type:"geojson",data:v})}async fetchSourceLayer(t,r){let a=`${t}_${r}`,u=this._source.get(a);if(u==null){let o=Gi.toImageryUrl(t,r==="source"?"source.geojson":"covering.geojson");u=fetch(o).then(m=>{if(m.ok)return m.json()}),this._source.set(a,u)}return u}get styleJson(){return this._styleJson==null&&(this._styleJson=fetch(Gi.toTileUrl({urlType:"style",tileMatrix:Ie.map.tileMatrix,layerId:"topographic",style:"topographic"})).then(t=>t.json())),this._styleJson}async adjustVector(t,r){let a=await this.styleJson;if(t.getSource("LINZ Basemaps")==null){if(r===0)return;let m=a.sources?.["LINZ Basemaps"];if(m==null)return;t.addSource("LINZ Basemaps",m),t.setStyle({...t.getStyle(),glyphs:a.glyphs,sprite:a.sprite}),t.once("style.load",()=>this.adjustVector(t,r));return}let o=a.layers?.filter(m=>m.type!=="background"&&m.source==="LINZ Basemaps")??[];if(Ie.map.layerId!=="topographic"){for(let m of o){let v=m.paint??{};m.type==="symbol"?(v["icon-opacity"]=0,v["text-opacity"]=0):v[`${m.type}-opacity`]=0,m.paint=v}if(r===0){for(let m of o)t.getLayer(m.id)!=null&&t.removeLayer(m.id);return}if(t.getLayer(o[0].id)==null){if(r===0)return;for(let m of o)t.addLayer(m)}for(let m of o)t.getLayer(m.id)!=null&&(m.type==="symbol"?(t.setPaintProperty(m.id,"icon-opacity",r),t.setPaintProperty(m.id,"text-opacity",r)):t.setPaintProperty(m.id,`${m.type}-opacity`,r))}}adjustRaster(t,r,a){t.getSource(r)==null&&t.addSource(r,{type:"raster",tiles:[this.getTileServerUrl(r)],tileSize:256});let u=t.getLayer(r)==null;if(a===0){u||t.removeLayer(r);return}if(u){t.addLayer({id:r,type:"raster",source:r,minzoom:0,maxzoom:24,paint:{"raster-opacity":0}});let o=`${Ie.map.layerId}_source_fill`;t.getLayer(o)!=null&&t.moveLayer(r,o)}t.setPaintProperty(r,"raster-opacity",a)}setPurple(t){Ie.map.setDebug("debug.background",t?"magenta":!1),t?document.body.style.backgroundColor="magenta":document.body.style.backgroundColor=""}getTileServerUrl(t){if(t==="osm")return"https://tile.openstreetmap.org/{z}/{x}/{y}.png";if(t==="linz-aerial")return Gi.toTileUrl({urlType:"raster",tileMatrix:Ie.map.tileMatrix,layerId:"aerial"});throw new Error("Unknown tile server")}};var Ot=Lt(zr(),1);function ag(e,t){return(0,Ot.jsx)("input",{className:"debug__slider",type:"range",min:"0",max:"1",step:"0.05",defaultValue:String(Ie.map.debug[`debug.layer.${e}`]),onChange:t})}var lg=class extends Rc.Component{constructor(){super(...arguments);this.debugMap=new og;this.state={};this.waitForMap=()=>{let r=this.props.map;if(r==null){setTimeout(this.waitForMap,20);return}window.MaplibreMap=r,r.resize(),Ka(r,()=>{Ie.map.on("change",()=>{if(this.props.map==null)return;let a=Gi.toHash(Ie.map.getLocation(this.props.map)),u="?"+yo.toUrl(Ie.map);window.history.replaceState(null,"",u+a),this.updateFromConfig()}),this.updateFromConfig(),Ie.map.debug["debug.screenshot"]&&r.once("idle",async()=>{await el.getCurrentAttribution(),await new Promise(u=>setTimeout(u,250));let a=document.createElement("div");a.id="map-loaded",a.style.width="1px",a.style.height="1px",document.body.appendChild(a)})})};this.toggleTileBoundary=r=>{let a=r.target;Ie.map.setDebug("debug.tile",a.checked)};this.toggleCogs=r=>{let a=r.target;Ie.map.setDebug("debug.cog",a.checked),this.setVectorShown(a.checked,"cog")};this.toggleSource=r=>{let a=r.target;Ie.map.setDebug("debug.source",a.checked),this.setVectorShown(a.checked,"source")};this._loadingConfig=Promise.resolve();this.downloadSource=async()=>{let r=this.state.imagery;if(r==null)return;let a=ms.getGeoJson(r);if(a==null)return;let u="data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(a)),o=document.createElement("a");o.setAttribute("href",u),o.setAttribute("download",r.name+".json"),document.body.appendChild(o),o.click(),o.remove()}}componentDidMount(){this.waitForMap()}updateFromConfig(){(this.state.tileSet?.id!==Ie.map.layerId||this.state.config!==Ie.map.config)&&(this._loadingConfig=this._loadingConfig.then(()=>this.loadConfig())),this.debugMap.setPurple(Ie.map.debug["debug.background"]==="magenta"),this.debugMap.adjustRaster(this.props.map,"osm",Ie.map.debug["debug.layer.osm"]),this.debugMap.adjustRaster(this.props.map,"linz-aerial",Ie.map.debug["debug.layer.linz-aerial"]),this.debugMap.adjustVector(this.props.map,Ie.map.debug["debug.layer.linz-topographic"]),this.setVectorShown(Ie.map.debug["debug.source"],"source"),this.setVectorShown(Ie.map.debug["debug.cog"],"cog"),this.renderWMTS()}async loadConfig(){let r=Ie.map.layerId;if(this.state.tileSet?.id!==r)return ms.getTileSet(r).then(a=>{if(this.setState({tileSet:a,config:Ie.map.config}),a==null||a.layers.length!==1)return;let u=Ie.map.tileMatrix.projection.code,o=a.layers[0][u];if(o!=null)return this.debugMap.fetchSourceLayer(o,"cog").then(m=>{this.setState({isCog:m!=null})}),ms.getImagery(r,o).then(m=>{this.setState({imagery:m,config:Ie.map.config})})})}render(){if(Ie.map.debug["debug.screenshot"])return null;let r=this.state.imagery?.title;return(0,Ot.jsxs)("div",{className:"debug",children:[(0,Ot.jsxs)("div",{className:"debug__info",children:[(0,Ot.jsx)("label",{className:"debug__label",children:"Id"}),(0,Ot.jsx)("div",{className:"debug__value",children:Ie.map.layerId})]}),r==null?null:(0,Ot.jsxs)("div",{className:"debug__info",children:[(0,Ot.jsx)("label",{className:"debug__label",children:"Title"}),(0,Ot.jsx)("div",{className:"debug__value",children:r})]}),this.renderWMTS(),(0,Ot.jsxs)("div",{className:"debug__info",children:[(0,Ot.jsx)("label",{className:"debug__label",children:"TileMatrix"}),(0,Ot.jsx)("div",{className:"debug__value",children:Ie.map.tileMatrix.identifier})]}),this.renderSliders(),this.renderPurple(),this.renderCogToggle(),this.renderSourceToggle(),this.renderTileToggle()]})}getWMTSLink(){return Gi.toTileUrl({urlType:"wmts",tileMatrix:Ie.map.tileMatrix,layerId:Ie.map.layerId,config:Ie.map.config,date:Ie.map.filter.date})}renderWMTS(){let r=this.state.imagery;return(0,Ot.jsxs)("div",{className:"debug__info",children:[(0,Ot.jsx)("label",{className:"debug__label"}),(0,Ot.jsxs)("div",{className:"debug__value",children:[Ie.map.tileMatrix.projection.toEpsgString()," - ",(0,Ot.jsx)("a",{href:this.getWMTSLink(),children:"WMTS "}),r==null?null:(0,Ot.jsxs)("div",{title:"Number of tiffs in imagery",children:[" - ",r.files.length," Tiffs"]})]})]})}renderPurple(){if(!Ie.map.debug["debug.screenshot"])return(0,Ot.jsxs)("div",{className:"debug__info",children:[(0,Ot.jsx)("label",{className:"debug__label",children:"Purple"}),(0,Ot.jsx)("input",{type:"checkbox",onChange:this.debugMap.togglePurple,checked:Ie.map.debug["debug.background"]==="magenta"})]})}renderCogToggle(){if(this.state.imagery==null)return null;let r=Gi.toImageryUrl(this.state.imagery.id,"covering.geojson");if(!!this.state.isCog)return(0,Ot.jsxs)(Rc.Fragment,{children:[(0,Ot.jsxs)("div",{className:"debug__info",children:[(0,Ot.jsx)("label",{className:"debug__label",children:(0,Ot.jsx)("a",{href:r,title:"Source geojson",children:"Cogs"})}),(0,Ot.jsx)("input",{type:"checkbox",onChange:this.toggleCogs,checked:Ie.map.debug["debug.cog"]})]}),this.state.featureCogId==null?null:(0,Ot.jsxs)("div",{className:"debug__info",title:String(this.state.featureCogName),children:[(0,Ot.jsx)("label",{className:"debug__label",children:"CogId"}),String(this.state.featureCogName).split("/").pop()]})]})}renderTileToggle(){return(0,Ot.jsxs)("div",{className:"debug__info",children:[(0,Ot.jsx)("label",{className:"debug__label",children:"Tile Boundaries"}),(0,Ot.jsx)("input",{type:"checkbox",onChange:this.toggleTileBoundary,checked:Ie.map.debug["debug.tile"]})]})}renderSourceToggle(){return this.state.imagery==null?null:(0,Ot.jsxs)(Rc.Fragment,{children:[(0,Ot.jsxs)("div",{className:"debug__info",children:[(0,Ot.jsx)("label",{className:"debug__label",children:(0,Ot.jsx)("a",{onClick:this.downloadSource,href:"#",title:"Source geojson",children:"Source"})}),(0,Ot.jsx)("input",{type:"checkbox",onChange:this.toggleSource,checked:Ie.map.debug["debug.source"]})]}),this.state.featureSourceId==null?null:(0,Ot.jsxs)("div",{className:"debug__info",title:String(this.state.featureSourceName),children:[(0,Ot.jsx)("label",{className:"debug__label",children:"SourceId"}),String(this.state.featureSourceName).split("/").pop()]})]})}renderSliders(){if(!Ie.map.debug["debug.screenshot"])return Ie.map.tileMatrix.identifier!==xi.identifier?(0,Ot.jsxs)("div",{className:"debug__info",children:[(0,Ot.jsx)("label",{className:"debug__label",children:"LINZ Aerial"}),ag("linz-aerial",this.debugMap.adjustLinzAerial)]}):(0,Ot.jsxs)(Rc.Fragment,{children:[(0,Ot.jsxs)("div",{className:"debug__info",children:[(0,Ot.jsx)("label",{className:"debug__label",children:"OSM"}),ag("osm",this.debugMap.adjustOsm)]}),(0,Ot.jsxs)("div",{className:"debug__info",children:[(0,Ot.jsx)("label",{className:"debug__label",children:"Topographic"}),ag("linz-topographic",this.debugMap.adjustTopographic)]}),(0,Ot.jsxs)("div",{className:"debug__info",children:[(0,Ot.jsx)("label",{className:"debug__label",children:"LINZ Aerial"}),ag("linz-aerial",this.debugMap.adjustLinzAerial)]})]})}trackMouseMove(r,a){let u=`${r}_${a}`,o=`${u}_fill`,m=this.props.map,v,b=a==="source"?"featureSource":"featureCog";m.on("click",o,C=>{let T=C.features;if(T==null||T.length===0)return;let B=T[0],W=B.properties?.location??B.properties?.name;W!=null&&navigator.clipboard.writeText(W).then(()=>{let q=document.createElement("div");q.innerText=`Copied ${W}`,q.className="toast-message",q.title=W,document.body.appendChild(q),setTimeout(()=>q.remove(),2500)})}),m.on("mousemove",o,C=>{let T=C.features;if(T==null||T.length===0)return;let B=T[0];B.id!==v&&(v!=null&&m.setFeatureState({source:u,id:v},{hover:!1}),v=B.id,this.setState({[`${b}Id`]:v,[`${b}Name`]:B.properties?.name}),m.setFeatureState({source:u,id:v},{hover:!0}))}),m.on("mouseleave",o,()=>{v!=null&&(m.setFeatureState({source:u,id:v},{hover:!1}),v=void 0,this.setState({[`${b}Id`]:void 0,[`${b}Name`]:void 0}))})}setVectorShown(r,a){let u=this.props.map;u.showTileBoundaries=Ie.map.debug["debug.tile"];let o=Ie.map.layerId,m=`${o}_${a}`,v=`${m}_fill`,b=`${m}_line`;if(r===!1){if(u.getLayer(v)==null)return;u.removeLayer(v),u.removeLayer(b);return}if(u.getLayer(b)!=null)return;let C=a==="source"?"#ff00ff":"#ff0000";this.state.imagery!=null&&this.debugMap.loadSourceLayer(this.props.map,o,this.state.imagery,a).then(()=>{u.getLayer(b)==null&&(u.addLayer({id:v,type:"fill",source:m,paint:{"fill-opacity":["case",["boolean",["feature-state","hover"],!1],.25,0],"fill-color":C}}),this.trackMouseMove(o,a),u.addLayer({id:b,type:"line",source:m,paint:{"line-color":C,"line-opacity":["case",["boolean",["feature-state","hover"],!1],1,.5],"line-width":["case",["boolean",["feature-state","hover"],!1],2,1]}}))})}};var cM=Lt(ig(),1),hM=Lt(Ir(),1);var uM=Lt(zr(),1),ug=class extends hM.Component{constructor(){super(...arguments);this._events=[];this._updateTimer=null;this.update=()=>{this._updateTimer==null&&(this._updateTimer=setTimeout(this.updateMap,1e3))};this.updateMap=()=>{this._updateTimer=null;let r=Ie.map.transformedLocation,a=this.getStyleType(),u=`${a.layerId}::${a.style}`;if(this.currentStyle!==u){let m=Lc(Ie.map.tileMatrix.identifier).getStyle(a.layerId,a.style);this.currentStyle=u,this.map.setStyle(m)}this.map.setZoom(Math.max(r.zoom-4,0)),this.map.setCenter([r.lon,r.lat]),this.forceUpdate()};this.switchLayer=()=>{let r=this.getStyleType();Ie.map.setLayerId(r.layerId,r.style),this.updateMap(),window.history.pushState(null,"",`?${yo.toUrl(Ie.map)}`)}}componentDidMount(){if(Ie.map.updateFromUrl(),this.el=document.getElementById("map-switcher-map"),this.el==null)return;let r=Ie.map,a=Lc(r.tileMatrix.identifier),u=this.getStyleType();this.currentStyle=`${u.layerId}::${u.style}`;let o=a.getStyle(u.layerId,u.style),m=r.transformedLocation;this.map=new cM.default.Map({container:this.el,style:o,center:[m.lon,m.lat],zoom:m.zoom,attributionControl:!1}),Ka(this.map,()=>{this._events.push(Ie.map.on("location",this.update),Ie.map.on("tileMatrix",this.update),Ie.map.on("layer",this.update),Ie.map.on("bounds",this.update)),this.updateMap()})}componentWillUnmount(){this.map&&this.map.remove();for(let r of this._events)r()}getStyleType(){return Ie.map.layerId!=="aerial"?{layerId:"aerial"}:{layerId:"topographic",style:"topographic"}}render(){let r=`Switch map to ${this.getStyleType().layerId}`;return(0,uM.jsx)("div",{id:"map-switcher",className:"map-switcher",onClick:this.switchLayer,title:r,children:(0,uM.jsx)("div",{id:"map-switcher-map",style:{width:"100%",height:"100%",pointerEvents:"none"}})})}};var Bc=Lt(zr(),1),W1=750;function Ka(e,t){if(e.loaded())return t();setTimeout(()=>Ka(e,t),100)}var cg=class extends dM.Component{constructor(){super(...arguments);this.ignoreNextLocationUpdate=!1;this.updateLocation=()=>{if(this.ignoreNextLocationUpdate){this.ignoreNextLocationUpdate=!1;return}let r=Ie.map.location;this.map.setZoom(r.zoom),this.map.setCenter([r.lon,r.lat])};this.updateBounds=r=>{if(Ie.map.tileMatrix!==xi){let a=Dc.default.LngLatBounds.convert(r),u=a.getNorthEast(),o=a.getSouthWest(),m=this.map.getZoom(),v=fs({lat:u.lat,lon:u.lng,zoom:m},Ie.map.tileMatrix,xi),b=fs({lat:o.lat,lon:o.lng,zoom:m},Ie.map.tileMatrix,xi);r=[[v.lon,v.lat],[b.lon,b.lat]]}this.map.fitBounds(r)};this.updateStyle=()=>{this.ensureGeoControl();let a=Lc(Ie.map.tileMatrix.identifier).getStyle(Ie.map.layerId,Ie.map.style,void 0,Ie.map.filter.date);this.map.setStyle(a),Ie.map.tileMatrix!==xi?this.map.setMaxBounds([-180,-85.06,180,85.06]):this.map.setMaxBounds(),this.forceUpdate()};this.updateVisibleLayers=r=>{if(Ie.map.visibleLayers==null&&(Ie.map.visibleLayers=r),r!==Ie.map.visibleLayers){Ie.map.visibleLayers=r;let a=`${Ie.map.styleId}before=${Ie.map.filter.date.before?.slice(0,4)}`;this.map.getSource(a)==null&&(this.map.addSource(a,{type:"raster",tiles:[Gi.toTileUrl({urlType:"raster",tileMatrix:Ie.map.tileMatrix,layerId:Ie.map.layerId,config:Ie.map.config,date:Ie.map.filter.date})],tileSize:256}),this.map.addLayer({id:a,type:"raster",source:a,paint:{"raster-opacity":0}}),this.map.moveLayer(a),this.map.setPaintProperty(a,"raster-opacity-transition",{duration:W1}),this.map.setPaintProperty(a,"raster-opacity",1))}};this.removeOldLayers=()=>{let r=this.map.getStyle().layers.filter(a=>a.id.startsWith(Ie.map.styleId));r.pop();for(let a of r)this.map.setPaintProperty(a.id,"raster-opacity-transition",{duration:W1}),this.map.setPaintProperty(a.id,"raster-opacity",0),setTimeout(()=>{this.map.removeLayer(a.id),this.map.removeSource(a.source)},W1)};this._events=[];this.updateUrlTimer=null;this.onRender=()=>{this.updateUrlTimer==null&&(this.updateUrlTimer=setTimeout(()=>this.setLocationUrl(),1e3))}}ensureGeoControl(){if(!Ie.map.debug["debug.screenshot"])if(Ie.map.tileMatrix===xi){if(this.controlGeo!=null)return;this.controlGeo=new Dc.default.GeolocateControl({}),this.map.addControl(this.controlGeo,"top-left")}else{if(this.controlGeo==null)return;this.map.removeControl(this.controlGeo)}}componentDidMount(){if(Ie.map.updateFromUrl(),this.el=document.getElementById("map"),this.el==null)throw new Error("Unable to find #map element");let r=Ie.map,u=Lc(r.tileMatrix.identifier).getStyle(r.layerId,r.style),o=fs(r.location,r.tileMatrix,xi);if(this.map=new Dc.default.Map({container:this.el,style:u,center:[o.lon,o.lat],zoom:o.zoom,attributionControl:!1}),this.mapAttr=new hg(this.map),Ie.map.debug["debug.screenshot"]!==!0){let m=new Dc.default.NavigationControl({visualizePitch:!0});this.map.addControl(m,"top-left"),Ie.map.isDebug||this.map.addControl(new Dc.default.FullscreenControl({container:this.el}))}this.map.on("render",this.onRender),this.map.on("idle",this.removeOldLayers),Ka(this.map,()=>{this._events.push(Ie.map.on("location",this.updateLocation),Ie.map.on("tileMatrix",this.updateStyle),Ie.map.on("layer",this.updateStyle),Ie.map.on("bounds",this.updateBounds),Ie.map.on("visibleLayers",this.updateVisibleLayers)),this.updateStyle(),this.forceUpdate()})}componentWillUnmount(){this.map&&this.map.remove();for(let r of this._events)r();this._events=[]}render(){let r=Ie.map.tileMatrix===xi&&!Ie.map.isDebug;return(0,Bc.jsxs)("div",{style:{flex:1,position:"relative"},children:[(0,Bc.jsx)("div",{id:"map",style:{width:"100%",height:"100%"}}),this.map&&Ie.map.isDebug?(0,Bc.jsx)(lg,{map:this.map}):void 0,this.map&&Ie.map.isDebug&&!Ie.map.debug["debug.screenshot"]&&Ie.map.debug["debug.date"]?(0,Bc.jsx)(dg,{map:this.map}):void 0,r?(0,Bc.jsx)(ug,{}):void 0]})}setLocationUrl(){this.updateUrlTimer=null;let r=Ie.map.getLocation(this.map);this.ignoreNextLocationUpdate=!0,Ie.map.setLocation(r);let a=Gi.toHash(r);window.history.replaceState(null,"",a)}};var pM=`\xA9 ${QI.License} LINZ`,$l=class{constructor(){this._attrs=new Map;this._attrsSync=new Map;this.isIgnored=t=>{let r=t.collection.title.toLowerCase();return r.startsWith("geographx")||r.includes(" dem ")}}getCurrentAttribution(){let t=Ie.map.layerKeyTms,r=this._attrs.get(t);return r==null&&(r=Qa.load(Ie.map.toTileUrl("attribution")).catch(()=>null),this._attrs.set(t,r),r.then(a=>{a!=null&&(a.isIgnored=this.isIgnored,this._attrsSync.set(Ie.map.layerKeyTms,a))})),r}filterAttributionToMap(t,r){let a=Math.round(r.getZoom()??0);a+=1;let u=$l.mapboxBoundToBbox(r.getBounds(),a,Ie.map.tileMatrix);return t.filter({extent:u,zoom:a,dateBefore:Ie.map.filter.date.before})}getAttributionByYear(t){let r=new Map;for(let a of t){if(!a.startDate||!a.endDate)continue;let u=Number(a.startDate.slice(0,4)),o=Number(a.endDate.slice(0,4));for(let m=u;m<=o;m++){let v=r.get(m)??[];v.push(a),r.set(m,v)}}return r}static mapboxBoundToBbox(t,r,a){let u={lon:t.getWest(),lat:t.getSouth(),zoom:r},o={lon:t.getEast(),lat:t.getNorth(),zoom:r},m=fs(u,xi,a),v=fs(o,xi,a);return[m.lon,m.lat,v.lon,v.lat]}},el=new $l,hg=class{constructor(t){this._raf=0;this.attributionHtml="";this.bounds=new Yd.LngLatBounds([0,0,0,0]);this.zoom=-1;this._events=[];this.resetAttribution=()=>{this.attributionHtml="",this.updateAttribution()};this.updateAttribution=()=>{if(Ie.map.isVector)return this.vectorAttribution();el.getCurrentAttribution().then(()=>this.scheduleRender())};this.renderAttribution=()=>{this._raf=0;let t=el._attrsSync.get(Ie.map.layerKeyTms);if(t==null)return this.removeAttribution();let r=el.filterAttributionToMap(t,this.map),a=r.map(o=>o.collection.id).join("_");Ie.map.emit("visibleLayers",a);let u=t.renderList(r);u===""?u=pM:u=pM+" - "+u,u!==this.attributionHtml&&(this.attributionHtml=u,this.removeAttribution(),this.attributionControl=new Yd.AttributionControl({compact:!1,customAttribution:u}),this.map.addControl(this.attributionControl,"bottom-right"))};this.map=t,t.on("move",this.updateAttribution),Ie.map.on("tileMatrix",this.resetAttribution),Ie.map.on("layer",this.resetAttribution),Ka(this.map,()=>{this._events.push(Ie.map.on("filter",this.updateAttribution)),this.resetAttribution()})}scheduleRender(){this._scheduled!=null||this._raf!==0||this.map.getZoom()===this.zoom&&this.map.getBounds()===this.bounds||(this.zoom=this.map.getZoom()??0,this.bounds=this.map.getBounds(),this._scheduled=setTimeout(()=>{this._scheduled=void 0,this._raf=requestAnimationFrame(this.renderAttribution)},200))}removeAttribution(){this.attributionControl!=null&&(this.map.removeControl(this.attributionControl),this.attributionControl=null)}vectorAttribution(){this.removeAttribution(),this.attributionControl=new Yd.AttributionControl({compact:!1}),this.map.addControl(this.attributionControl,"bottom-right")}};function fM(e){var t,r,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=fM(e[t]))&&(a&&(a+=" "),a+=r);else for(t in e)e[t]&&(a&&(a+=" "),a+=t);return a}function f6(){for(var e,t,r=0,a="";r<arguments.length;)(e=arguments[r++])&&(t=fM(e))&&(a&&(a+=" "),a+=t);return a}var Nc=f6;var Z1=Lt(zr(),1),gM="1950-01-01T00:00:00.000Z",yM=`${new Date().getFullYear().toString()}-12-31T23:59:59.999Z`,dg=class extends mM.Component{constructor(){super(...arguments);this.handleAttributionBounds=()=>{this.setState({filtered:this.getFilteredAttrs()})}}getFilteredAttrs(){if(this.state==null||this.state.attribution==null)return null;let r=Math.round(this.props.map.getZoom()??0),a=$l.mapboxBoundToBbox(this.props.map.getBounds(),r,Ie.map.tileMatrix);return this.state.attribution.filter({extent:a,zoom:r})}componentDidMount(){this.props.map.on("moveend",this.handleAttributionBounds),Ie.map.on("filter",this.handleAttributionBounds),el.getCurrentAttribution().then(r=>this.setState({attribution:r}))}render(){if(this.state==null)return;let r=this.state.filtered;if(r==null)return;let u=[...el.getAttributionByYear(r).entries()];u.sort((m,v)=>m[0]-v[0]);let o=Ie.map.filter.date.before;return(0,Z1.jsx)("div",{className:"date-range",children:u.map(m=>{let[v,b]=m,C=o?.startsWith(String(v));return(0,Z1.jsxs)("button",{title:b.map(T=>T.collection.title).join(`
|
|
558
|
-
`),onClick:()=>Ie.map.setFilterDateRange({before:String(v)}),className:Nc({"date-range__year":!0,"date-range__year--selected":C}),children:[v," - ",b.length]},v)})})}};var Fc={debug:!1,"debug.background":!1,"debug.source":!1,"debug.tile":!1,"debug.cog":!1,"debug.screenshot":!1,"debug.layer.linz-aerial":0,"debug.layer.linz-topographic":0,"debug.layer.osm":0,"debug.date":!1},qd=class{static toUrl(t,r){if(t.debug===!0){r.append("debug","true");for(let[a,u]of Object.entries(t))a==="debug"||Fc[a]===u||r.append(a,String(u))}}static fromUrl(t,r){let a=r.get("debug")!=null,u=!1;if(a===!1){for(let[o,m]of Object.entries(Fc))u=ia(t,o,m)||u;return u}return u=ia(t,"debug",!0),u=ia(t,"debug.background",r.get("debug.background"))||u,u=ia(t,"debug.tile",r.get("debug.tile")!=null)||u,u=ia(t,"debug.source",r.get("debug.source")!=null)||u,u=ia(t,"debug.cog",r.get("debug.cog")!=null)||u,u=ia(t,"debug.screenshot",r.get("debug.screenshot")!=null)||u,u=j1(t,"debug.layer.linz-aerial",r.get("debug.layer.linz-aerial"))||u,u=j1(t,"debug.layer.linz-topographic",r.get("debug.layer.linz-topographic"))||u,u=j1(t,"debug.layer.osm",r.get("debug.layer.osm"))||u,u=ia(t,"debug.date",r.get("debug.date")!=null)||u,u}};function m6(e,t=0){if(e==null)return t;let r=Number(e);return isNaN(r)?t:r}function ia(e,t,r){return r==null&&(r=Fc[t]),e[t]===r?!1:(e[t]=r,!0)}function j1(e,t,r){return ia(e,t,m6(r))}var vM={[xi.identifier]:{lat:-41.88999621,lon:174.04924373,zoom:5},[Hs.identifier]:{lat:-41.277848,lon:174.6763921,zoom:3},[cs.identifier]:{lat:-41.88999621,lon:174.04924373,zoom:3}},yo=class extends xM.Emitter{constructor(){super(...arguments);this.style=null;this.layerId="aerial";this.tileMatrix=xi;this.debug={...Fc};this.filter={date:{before:void 0}}}get layers(){return this._layers==null&&(this._layers=g6()),this._layers}get isDebug(){return this.debug.debug}get location(){return this._location==null&&(window.addEventListener("popstate",()=>{let r={...vM[this.tileMatrix.identifier],...Gi.fromHash(window.location.hash)};this.setLocation(r)}),this.updateFromUrl(),this._location={...vM[this.tileMatrix.identifier],...Gi.fromHash(window.location.hash)}),this._location}get transformedLocation(){return this.transformLocation(this.location.lat,this.location.lon,this.location.zoom)}get isVector(){return this.layerId==="topographic"}get layerKey(){return this.style==null?this.layerId:`${this.layerId}::${this.style}`}get layerKeyTms(){return`${this.layerKey}::${this.tileMatrix.identifier}`}get styleId(){return`basemaps-${Ie.map.layerId}`}getDateRangeFromUrl(r){let a=r.get("date[before]")??void 0;return a&&(a=a>yM||a<gM?void 0:a),{before:a}}updateFromUrl(r=window.location.search){let a=new URLSearchParams(r),u=a.get("s")??a.get("style"),o=a.get("c")??a.get("config"),m=a.get("i")??"aerial",v=this.getDateRangeFromUrl(a);this.filter.date.before!==v.before&&(this.filter.date=v,this.emit("filter",this.filter));let b=(a.get("p")??a.get("tileMatrix")??xi.identifier).toLowerCase(),C=hs.All.find(W=>W.identifier.toLowerCase()===b);C==null&&(C=hs.get(qt.parse(b)??qt.Google)),C.identifier===Hs.identifier&&(C=cs),qd.fromUrl(this.debug,a)&&this.emit("change");let B=yo.toUrl(this);this.config=o,this.style=u??null,this.layerId=m.startsWith("im_")?m.slice(3):m,this.tileMatrix=C,this.layerId==="topographic"&&this.style==null&&(this.style="topographic"),this.emit("tileMatrix",this.tileMatrix),this.emit("layer",this.layerId,this.style),B!==yo.toUrl(this)&&this.emit("change")}static toUrl(r){let a=new URLSearchParams;return r.style&&a.append("s",r.style),r.config&&a.append("config",ng(r.config)),r.layerId!=="aerial"&&a.append("i",r.layerId),r.tileMatrix.identifier!==xi.identifier&&a.append("p",r.tileMatrix.identifier),r.filter.date.before&&a.append("date[before]",r.filter.date.before),qd.toUrl(r.debug,a),a.toString()}toTileUrl(r,a=this.tileMatrix,u=this.layerId,o=this.style,m=this.config,v=this.filter.date){return Gi.toTileUrl({urlType:r,tileMatrix:a,layerId:u,style:o,config:m,date:v})}getLocation(r){let a=r.getCenter();if(a==null)throw new Error("Invalid Map location");let u=Math.floor((r.getZoom()??0)*1e4)/1e4;return Ie.map.transformLocation(a.lat,a.lng,u)}transformLocation(r,a,u){return fs({lat:r,lon:a,zoom:u},xi,this.tileMatrix)}setLocation(r){r.lat===this.location.lat&&r.lon===this.location.lon&&r.zoom===this.location.zoom||(this.location.lat=r.lat,this.location.lon=r.lon,this.location.zoom=r.zoom,this.emit("location",this.location),this.emit("change"))}setTileMatrix(r){this.tileMatrix.identifier!==r.identifier&&(this.emit("tileMatrix",this.tileMatrix),this.emit("change"))}setFilterDateRange(r){this.filter.date!==r&&(this.filter.date=r,this.emit("filter",this.filter),this.emit("change"))}setLayerId(r,a){this.layerId===r&&this.style===a||(this.layerId=r,this.style=a??null,this.emit("layer",this.layerId,this.style),this.emit("change"))}setDebug(r,a=Fc[r]){this.debug[r]!==a&&(this.debug[r]=a,this.emit("change"))}};async function g6(){let e=new Map,t=await fetch(Gi.toBaseWmts());if(!t.ok)return e;let u=new DOMParser().parseFromString(await t.text(),"text/xml").getElementsByTagName("Layer"),o=[];for(let m=0;m<u.length;m++){let v=u.item(m);if(v==null)continue;let b=v.getElementsByTagName("ows:Title").item(0)?.textContent,C=v.getElementsByTagName("ows:Identifier").item(0)?.textContent;if(b==null||C==null||b==="aerial")continue;let T=v.getElementsByTagName("ows:Keyword").item(0)?.textContent,B=v.getElementsByTagName("ows:WGS84BoundingBox").item(0),W=B?.getElementsByTagName("ows:UpperCorner").item(0)?.textContent?.split(" ").map(Number),q=B?.getElementsByTagName("ows:LowerCorner").item(0)?.textContent?.split(" ").map(Number),ee=v.getElementsByTagName("TileMatrixSet"),le=new Set;for(let de=0;de<ee.length;de++){let H=v6(ee.item(de)?.textContent??"");H!=null&&le.add(H.code)}W==null||q==null||W.length!==2||o.push({id:C,name:b.replace("aerial ",""),upperLeft:W,lowerRight:q,projections:le,category:T})}o.sort((m,v)=>m.name.localeCompare(v.name)),y6(e);for(let m of o)e.set(m.id,m);return e}function y6(e){e.set("aerial",{id:"aerial",name:"Aerial Imagery",projections:new Set([fi.Nztm2000,fi.Google]),category:"Basemaps"}),e.set("topographic::topographic",{id:"topographic::topographic",name:"Topographic",projections:new Set([fi.Google]),category:"Basemaps"})}function v6(e){if(e.toLowerCase().startsWith("epsg"))return qt.parse(e);let t=hs.find(e);return t==null?null:t.projection}var x6=qI(),Ie={get BaseUrl(){return""},get ApiKey(){return x6},get GoogleAnalytics(){return"UA-23232486-3"},get Version(){return"v6.41.0"},map:new yo};if(Ie.GoogleAnalytics!==""&&typeof window<"u"){window.dataLayer=window.dataLayer||[],window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date),window.gtag("config",`${Ie.GoogleAnalytics}`);let e=document.createElement("script");e.setAttribute("async",""),e.setAttribute("src",`https://www.googletagmanager.com/gtag/js?id=${Ie.GoogleAnalytics}`),document.head.appendChild(e)}function Yl(e,t,r){Ie.GoogleAnalytics!==""&&window.gtag("event",t,{event_category:e,value:r})}var H1=Lt(Ir(),1),pg=Lt(zr(),1),Jd=class extends H1.Component{render(){return(0,pg.jsx)("i",{className:"material-icons-round md-36",children:this.props.name})}},Qo=class extends H1.Component{render(){return(0,pg.jsxs)("a",{rel:"noopener",target:"_blank",href:this.props.href,style:{display:"flex"},"aria-label":this.props.ariaLabel,children:[this.props.children,this.props.icon?(0,pg.jsx)(Jd,{name:this.props.icon}):void 0]})}};var Cn=Lt(zr(),1),fg=class extends _M.Component{constructor(){super(...arguments);this._events=[]}componentDidMount(){this._events.push(Ie.map.on("change",()=>this.forceUpdate()))}componentWillUnmount(){for(let r of this._events)r();this._events=[]}render(){if(!Ie.map.isDebug)return(0,Cn.jsx)("footer",{className:"lui-footer lui-footer-small lui-hide-sm lui-hide-xs",role:"contentinfo",children:(0,Cn.jsxs)("div",{className:"lui-footer-columns",children:[(0,Cn.jsx)("div",{style:{display:"flex",alignItems:"center"},children:(0,Cn.jsx)(Qo,{href:"http://www.govt.nz/",ariaLabel:"New Zealand Government",children:(0,Cn.jsx)("img",{src:"/assets/logo-nz-govt.svg"})})}),(0,Cn.jsx)("div",{className:"justify-end",children:(0,Cn.jsxs)("ul",{className:"lui-footer-list",children:[(0,Cn.jsx)("li",{className:"lui-footer-inline-list-item",children:(0,Cn.jsx)(Qo,{href:"https://www.linz.govt.nz/contact-us",children:"Contact"})}),(0,Cn.jsx)("li",{className:"lui-footer-inline-list-item",children:(0,Cn.jsx)(Qo,{href:"https://www.linz.govt.nz/privacy",children:"Privacy"})}),(0,Cn.jsx)("li",{className:"lui-footer-inline-list-item",children:(0,Cn.jsx)(Qo,{href:"https://www.linz.govt.nz/data/linz-data/linz-basemaps/data-attribution",children:"Data Attribution"})}),(0,Cn.jsx)("li",{className:"lui-footer-inline-list-item",children:(0,Cn.jsx)(Qo,{href:"https://www.linz.govt.nz/copyright",children:"Copyright"})})]})})]})})}};var eu=Lt(Ir(),1);var wM=Lt(Ir(),1);var ql=Lt(zr(),1),ra=class extends wM.Component{constructor(){super(...arguments);this._copyTimeout=null;this.copy=()=>{Yl("Ui","copy:"+Ie.map.layerKey+":"+this.props.header.replace(/ /g,"").toLowerCase()),navigator.clipboard.writeText(this.props.value),this.setState({copied:!0}),this._copyTimeout!=null&&clearTimeout(this._copyTimeout),this._copyTimeout=setTimeout(()=>this.setState({copied:!1}),1e3)}}render(){return(0,ql.jsxs)("div",{className:"LuiDeprecatedForms",children:[(0,ql.jsx)("label",{children:this.props.header}),(0,ql.jsxs)("div",{className:Nc({"lui-menu-label":!0,"menu-copyable":!0,"menu-copyable-copied":this.state?.copied}),children:[(0,ql.jsx)("button",{className:"menu-copyable-icon-button",title:"Copy",onClick:this.copy,children:(0,ql.jsx)("i",{className:"material-icons-round",children:this.state?.copied?"check":"content_copy"})}),(0,ql.jsx)("input",{value:this.props.value,readOnly:!0})]})]})}};var GT=Lt(Ir(),1);function kt(){return kt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},kt.apply(this,arguments)}var Bt=Lt(Ix());function Sx(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Cx(e,t){if(e==null)return{};var r={},a=Object.keys(e),u,o;for(o=0;o<a.length;o++)u=a[o],!(t.indexOf(u)>=0)&&(r[u]=e[u]);return r}function vs(e,t){if(e==null)return{};var r=Cx(e,t),a,u;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(u=0;u<o.length;u++)a=o[u],!(t.indexOf(a)>=0)&&(!Object.prototype.propertyIsEnumerable.call(e,a)||(r[a]=e[a]))}return r}function Mx(e){if(Array.isArray(e))return e}function Ex(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var a=[],u=!0,o=!1,m,v;try{for(r=r.call(e);!(u=(m=r.next()).done)&&(a.push(m.value),!(t&&a.length===t));u=!0);}catch(b){o=!0,v=b}finally{try{!u&&r.return!=null&&r.return()}finally{if(o)throw v}}return a}}function Gc(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,a=new Array(t);r<t;r++)a[r]=e[r];return a}function tp(e,t){if(!!e){if(typeof e=="string")return Gc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Gc(e,t)}}function Tx(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
559
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tl(e,t){return Mx(e)||Ex(e,t)||tp(e,t)||Tx()}function ip(e){return ip=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ip(e)}function Jl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wE(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Ql(e,t,r){return t&&wE(e.prototype,t),r&&wE(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function rp(e,t){return rp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,u){return a.__proto__=u,a},rp(e,t)}function Kl(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rp(e,t)}function Ko(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var op=Lt(Ir()),CE=Lt(zm());function OR(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function IE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(u){return Object.getOwnPropertyDescriptor(e,u).enumerable})),r.push.apply(r,a)}return r}function Hi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?IE(Object(r),!0).forEach(function(a){OR(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):IE(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Lg(e){return Lg=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Lg(e)}function GR(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function VR(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function UR(e,t){return t&&(typeof t=="object"||typeof t=="function")?t:VR(e)}function Dg(e){var t=GR();return function(){var a=Lg(e),u;if(t){var o=Lg(this).constructor;u=Reflect.construct(a,arguments,o)}else u=a.apply(this,arguments);return UR(this,u)}}var WR=["className","clearValue","cx","getStyles","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],np=function(){};function ZR(e,t){return t?t[0]==="-"?e+t:e+"__"+t:e}function ME(e,t,r){var a=[r];if(t&&e)for(var u in t)t.hasOwnProperty(u)&&t[u]&&a.push("".concat(ZR(e,u)));return a.filter(function(o){return o}).map(function(o){return String(o).trim()}).join(" ")}var kx=function(t){return qR(t)?t.filter(Boolean):ip(t)==="object"&&t!==null?[t]:[]},EE=function(t){t.className,t.clearValue,t.cx,t.getStyles,t.getValue,t.hasValue,t.isMulti,t.isRtl,t.options,t.selectOption,t.selectProps,t.setValue,t.theme;var r=vs(t,WR);return Hi({},r)};function sp(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function jR(e){return sp(e)?window.innerHeight:e.clientHeight}function TE(e){return sp(e)?window.pageYOffset:e.scrollTop}function Rg(e,t){if(sp(e)){window.scrollTo(0,t);return}e.scrollTop=t}function HR(e){var t=getComputedStyle(e),r=t.position==="absolute",a=/(auto|scroll)/;if(t.position==="fixed")return document.documentElement;for(var u=e;u=u.parentElement;)if(t=getComputedStyle(u),!(r&&t.position==="static")&&a.test(t.overflow+t.overflowY+t.overflowX))return u;return document.documentElement}function XR(e,t,r,a){return r*((e=e/a-1)*e*e+1)+t}function kg(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:np,u=TE(e),o=t-u,m=10,v=0;function b(){v+=m;var C=XR(v,u,o,r);Rg(e,C),v<r?window.requestAnimationFrame(b):a(e)}b()}function AE(e,t){var r=e.getBoundingClientRect(),a=t.getBoundingClientRect(),u=t.offsetHeight/3;a.bottom+u>r.bottom?Rg(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+u,e.scrollHeight)):a.top-u<r.top&&Rg(e,Math.max(t.offsetTop-u,0))}function $R(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}function zx(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function PE(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var kE=!1,YR={get passive(){return kE=!0}},zg=typeof window<"u"?window:{};zg.addEventListener&&zg.removeEventListener&&(zg.addEventListener("p",np,YR),zg.removeEventListener("p",np,!1));var zE=kE;function LE(e){return e!=null}function qR(e){return Array.isArray(e)}function ap(e,t,r){return e?t:r}var RE=function(t){for(var r=arguments.length,a=new Array(r>1?r-1:0),u=1;u<r;u++)a[u-1]=arguments[u];var o=Object.entries(t).filter(function(m){var v=tl(m,1),b=v[0];return!a.includes(b)});return o.reduce(function(m,v){var b=tl(v,2),C=b[0],T=b[1];return m[C]=T,m},{})};function JR(e){var t=e.maxHeight,r=e.menuEl,a=e.minHeight,u=e.placement,o=e.shouldScroll,m=e.isFixedPosition,v=e.theme,b=v.spacing,C=HR(r),T={placement:"bottom",maxHeight:t};if(!r||!r.offsetParent)return T;var B=C.getBoundingClientRect(),W=B.height,q=r.getBoundingClientRect(),ee=q.bottom,le=q.height,de=q.top,H=r.offsetParent.getBoundingClientRect(),Q=H.top,te=m?window.innerHeight:jR(C),ve=TE(C),Me=parseInt(getComputedStyle(r).marginBottom,10),Ce=parseInt(getComputedStyle(r).marginTop,10),Be=Q-Ce,Fe=te-de,qe=Be+ve,ht=W-ve-de,Tt=ee-te+ve+Me,Gt=ve+de-Ce,Jt=160;switch(u){case"auto":case"bottom":if(Fe>=le)return{placement:"bottom",maxHeight:t};if(ht>=le&&!m)return o&&kg(C,Tt,Jt),{placement:"bottom",maxHeight:t};if(!m&&ht>=a||m&&Fe>=a){o&&kg(C,Tt,Jt);var at=m?Fe-Me:ht-Me;return{placement:"bottom",maxHeight:at}}if(u==="auto"||m){var jt=t,zi=m?Be:qe;return zi>=a&&(jt=Math.min(zi-Me-b.controlHeight,t)),{placement:"top",maxHeight:jt}}if(u==="bottom")return o&&Rg(C,Tt),{placement:"bottom",maxHeight:t};break;case"top":if(Be>=le)return{placement:"top",maxHeight:t};if(qe>=le&&!m)return o&&kg(C,Gt,Jt),{placement:"top",maxHeight:t};if(!m&&qe>=a||m&&Be>=a){var Ii=t;return(!m&&qe>=a||m&&Be>=a)&&(Ii=m?Be-Ce:qe-Ce),o&&kg(C,Gt,Jt),{placement:"top",maxHeight:Ii}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(u,'".'))}return T}function QR(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var Px=function(t){return t==="auto"?"bottom":t},DE=function(t){var r,a=t.placement,u=t.theme,o=u.borderRadius,m=u.spacing,v=u.colors;return r={label:"menu"},Ko(r,QR(a),"100%"),Ko(r,"backgroundColor",v.neutral0),Ko(r,"borderRadius",o),Ko(r,"boxShadow","0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)"),Ko(r,"marginBottom",m.menuGutter),Ko(r,"marginTop",m.menuGutter),Ko(r,"position","absolute"),Ko(r,"width","100%"),Ko(r,"zIndex",1),r},BE=(0,op.createContext)({getPortalPlacement:null}),Lx=function(e){Kl(r,e);var t=Dg(r);function r(){var a;Jl(this,r);for(var u=arguments.length,o=new Array(u),m=0;m<u;m++)o[m]=arguments[m];return a=t.call.apply(t,[this].concat(o)),a.state={maxHeight:a.props.maxMenuHeight,placement:null},a.context=void 0,a.getPlacement=function(v){var b=a.props,C=b.minMenuHeight,T=b.maxMenuHeight,B=b.menuPlacement,W=b.menuPosition,q=b.menuShouldScrollIntoView,ee=b.theme;if(!!v){var le=W==="fixed",de=q&&!le,H=JR({maxHeight:T,menuEl:v,minHeight:C,placement:B,shouldScroll:de,isFixedPosition:le,theme:ee}),Q=a.context.getPortalPlacement;Q&&Q(H),a.setState(H)}},a.getUpdatedProps=function(){var v=a.props.menuPlacement,b=a.state.placement||Px(v);return Hi(Hi({},a.props),{},{placement:b,maxHeight:a.state.maxHeight})},a}return Ql(r,[{key:"render",value:function(){var u=this.props.children;return u({ref:this.getPlacement,placerProps:this.getUpdatedProps()})}}]),r}(op.Component);Lx.contextType=BE;var KR=function(t){var r=t.children,a=t.className,u=t.cx,o=t.getStyles,m=t.innerRef,v=t.innerProps;return(0,Bt.jsx)("div",kt({css:o("menu",t),className:u({menu:!0},a),ref:m},v),r)},NE=function(t){var r=t.maxHeight,a=t.theme.spacing.baseUnit;return{maxHeight:r,overflowY:"auto",paddingBottom:a,paddingTop:a,position:"relative",WebkitOverflowScrolling:"touch"}},eD=function(t){var r=t.children,a=t.className,u=t.cx,o=t.getStyles,m=t.innerProps,v=t.innerRef,b=t.isMulti;return(0,Bt.jsx)("div",kt({css:o("menuList",t),className:u({"menu-list":!0,"menu-list--is-multi":b},a),ref:v},m),r)},FE=function(t){var r=t.theme,a=r.spacing.baseUnit,u=r.colors;return{color:u.neutral40,padding:"".concat(a*2,"px ").concat(a*3,"px"),textAlign:"center"}},OE=FE,GE=FE,VE=function(t){var r=t.children,a=t.className,u=t.cx,o=t.getStyles,m=t.innerProps;return(0,Bt.jsx)("div",kt({css:o("noOptionsMessage",t),className:u({"menu-notice":!0,"menu-notice--no-options":!0},a)},m),r)};VE.defaultProps={children:"No options"};var UE=function(t){var r=t.children,a=t.className,u=t.cx,o=t.getStyles,m=t.innerProps;return(0,Bt.jsx)("div",kt({css:o("loadingMessage",t),className:u({"menu-notice":!0,"menu-notice--loading":!0},a)},m),r)};UE.defaultProps={children:"Loading..."};var WE=function(t){var r=t.rect,a=t.offset,u=t.position;return{left:r.left,position:u,top:a,width:r.width,zIndex:1}},tD=function(e){Kl(r,e);var t=Dg(r);function r(){var a;Jl(this,r);for(var u=arguments.length,o=new Array(u),m=0;m<u;m++)o[m]=arguments[m];return a=t.call.apply(t,[this].concat(o)),a.state={placement:null},a.getPortalPlacement=function(v){var b=v.placement,C=Px(a.props.menuPlacement);b!==C&&a.setState({placement:b})},a}return Ql(r,[{key:"render",value:function(){var u=this.props,o=u.appendTo,m=u.children,v=u.className,b=u.controlElement,C=u.cx,T=u.innerProps,B=u.menuPlacement,W=u.menuPosition,q=u.getStyles,ee=W==="fixed";if(!o&&!ee||!b)return null;var le=this.state.placement||Px(B),de=$R(b),H=ee?0:window.pageYOffset,Q=de[le]+H,te={offset:Q,position:W,rect:de},ve=(0,Bt.jsx)("div",kt({css:q("menuPortal",te),className:C({"menu-portal":!0},v)},T),m);return(0,Bt.jsx)(BE.Provider,{value:{getPortalPlacement:this.getPortalPlacement}},o?(0,CE.createPortal)(ve,o):ve)}}]),r}(op.Component),ZE=function(t){var r=t.isDisabled,a=t.isRtl;return{label:"container",direction:a?"rtl":void 0,pointerEvents:r?"none":void 0,position:"relative"}},iD=function(t){var r=t.children,a=t.className,u=t.cx,o=t.getStyles,m=t.innerProps,v=t.isDisabled,b=t.isRtl;return(0,Bt.jsx)("div",kt({css:o("container",t),className:u({"--is-disabled":v,"--is-rtl":b},a)},m),r)},jE=function(t){var r=t.theme.spacing,a=t.isMulti,u=t.hasValue,o=t.selectProps.controlShouldRenderValue;return{alignItems:"center",display:a&&u&&o?"flex":"grid",flex:1,flexWrap:"wrap",padding:"".concat(r.baseUnit/2,"px ").concat(r.baseUnit*2,"px"),WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"}},rD=function(t){var r=t.children,a=t.className,u=t.cx,o=t.innerProps,m=t.isMulti,v=t.getStyles,b=t.hasValue;return(0,Bt.jsx)("div",kt({css:v("valueContainer",t),className:u({"value-container":!0,"value-container--is-multi":m,"value-container--has-value":b},a)},o),r)},HE=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},nD=function(t){var r=t.children,a=t.className,u=t.cx,o=t.innerProps,m=t.getStyles;return(0,Bt.jsx)("div",kt({css:m("indicatorsContainer",t),className:u({indicators:!0},a)},o),r)},SE,oD=["size"];var sD={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},XE=function(t){var r=t.size,a=vs(t,oD);return(0,Bt.jsx)("svg",kt({height:r,width:r,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:sD},a))},Rx=function(t){return(0,Bt.jsx)(XE,kt({size:20},t),(0,Bt.jsx)("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},$E=function(t){return(0,Bt.jsx)(XE,kt({size:20},t),(0,Bt.jsx)("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},YE=function(t){var r=t.isFocused,a=t.theme,u=a.spacing.baseUnit,o=a.colors;return{label:"indicatorContainer",color:r?o.neutral60:o.neutral20,display:"flex",padding:u*2,transition:"color 150ms",":hover":{color:r?o.neutral80:o.neutral40}}},qE=YE,aD=function(t){var r=t.children,a=t.className,u=t.cx,o=t.getStyles,m=t.innerProps;return(0,Bt.jsx)("div",kt({css:o("dropdownIndicator",t),className:u({indicator:!0,"dropdown-indicator":!0},a)},m),r||(0,Bt.jsx)($E,null))},JE=YE,lD=function(t){var r=t.children,a=t.className,u=t.cx,o=t.getStyles,m=t.innerProps;return(0,Bt.jsx)("div",kt({css:o("clearIndicator",t),className:u({indicator:!0,"clear-indicator":!0},a)},m),r||(0,Bt.jsx)(Rx,null))},QE=function(t){var r=t.isDisabled,a=t.theme,u=a.spacing.baseUnit,o=a.colors;return{label:"indicatorSeparator",alignSelf:"stretch",backgroundColor:r?o.neutral10:o.neutral20,marginBottom:u*2,marginTop:u*2,width:1}},uD=function(t){var r=t.className,a=t.cx,u=t.getStyles,o=t.innerProps;return(0,Bt.jsx)("span",kt({},o,{css:u("indicatorSeparator",t),className:a({"indicator-separator":!0},r)}))},cD=(0,Bt.keyframes)(SE||(SE=Sx([`
|
|
560
|
-
0%, 80%, 100% { opacity: 0; }
|
|
561
|
-
40% { opacity: 1; }
|
|
562
|
-
`]))),KE=function(t){var r=t.isFocused,a=t.size,u=t.theme,o=u.colors,m=u.spacing.baseUnit;return{label:"loadingIndicator",color:r?o.neutral60:o.neutral20,display:"flex",padding:m*2,transition:"color 150ms",alignSelf:"center",fontSize:a,lineHeight:1,marginRight:a,textAlign:"center",verticalAlign:"middle"}},Ax=function(t){var r=t.delay,a=t.offset;return(0,Bt.jsx)("span",{css:(0,Bt.css)({animation:"".concat(cD," 1s ease-in-out ").concat(r,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:a?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},eT=function(t){var r=t.className,a=t.cx,u=t.getStyles,o=t.innerProps,m=t.isRtl;return(0,Bt.jsx)("div",kt({css:u("loadingIndicator",t),className:a({indicator:!0,"loading-indicator":!0},r)},o),(0,Bt.jsx)(Ax,{delay:0,offset:m}),(0,Bt.jsx)(Ax,{delay:160,offset:!0}),(0,Bt.jsx)(Ax,{delay:320,offset:!m}))};eT.defaultProps={size:4};var tT=function(t){var r=t.isDisabled,a=t.isFocused,u=t.theme,o=u.colors,m=u.borderRadius,v=u.spacing;return{label:"control",alignItems:"center",backgroundColor:r?o.neutral5:o.neutral0,borderColor:r?o.neutral10:a?o.primary:o.neutral20,borderRadius:m,borderStyle:"solid",borderWidth:1,boxShadow:a?"0 0 0 1px ".concat(o.primary):void 0,cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:v.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms","&:hover":{borderColor:a?o.primary:o.neutral30}}},hD=function(t){var r=t.children,a=t.cx,u=t.getStyles,o=t.className,m=t.isDisabled,v=t.isFocused,b=t.innerRef,C=t.innerProps,T=t.menuIsOpen;return(0,Bt.jsx)("div",kt({ref:b,css:u("control",t),className:a({control:!0,"control--is-disabled":m,"control--is-focused":v,"control--menu-is-open":T},o)},C),r)},dD=["data"],iT=function(t){var r=t.theme.spacing;return{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},pD=function(t){var r=t.children,a=t.className,u=t.cx,o=t.getStyles,m=t.Heading,v=t.headingProps,b=t.innerProps,C=t.label,T=t.theme,B=t.selectProps;return(0,Bt.jsx)("div",kt({css:o("group",t),className:u({group:!0},a)},b),(0,Bt.jsx)(m,kt({},v,{selectProps:B,theme:T,getStyles:o,cx:u}),C),(0,Bt.jsx)("div",null,r))},rT=function(t){var r=t.theme.spacing;return{label:"group",color:"#999",cursor:"default",display:"block",fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:r.baseUnit*3,paddingRight:r.baseUnit*3,textTransform:"uppercase"}},fD=function(t){var r=t.getStyles,a=t.cx,u=t.className,o=EE(t);o.data;var m=vs(o,dD);return(0,Bt.jsx)("div",kt({css:r("groupHeading",t),className:a({"group-heading":!0},u)},m))},mD=["innerRef","isDisabled","isHidden","inputClassName"],nT=function(t){var r=t.isDisabled,a=t.value,u=t.theme,o=u.spacing,m=u.colors;return Hi({margin:o.baseUnit/2,paddingBottom:o.baseUnit/2,paddingTop:o.baseUnit/2,visibility:r?"hidden":"visible",color:m.neutral80,transform:a?"translateZ(0)":""},gD)},oT={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},gD={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Hi({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},oT)},yD=function(t){return Hi({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},oT)},vD=function(t){var r=t.className,a=t.cx,u=t.getStyles,o=t.value,m=EE(t),v=m.innerRef,b=m.isDisabled,C=m.isHidden,T=m.inputClassName,B=vs(m,mD);return(0,Bt.jsx)("div",{className:a({"input-container":!0},r),css:u("input",t),"data-value":o||""},(0,Bt.jsx)("input",kt({className:a({input:!0},T),ref:v,style:yD(C),disabled:b},B)))},sT=function(t){var r=t.theme,a=r.spacing,u=r.borderRadius,o=r.colors;return{label:"multiValue",backgroundColor:o.neutral10,borderRadius:u/2,display:"flex",margin:a.baseUnit/2,minWidth:0}},aT=function(t){var r=t.theme,a=r.borderRadius,u=r.colors,o=t.cropWithEllipsis;return{borderRadius:a/2,color:u.neutral80,fontSize:"85%",overflow:"hidden",padding:3,paddingLeft:6,textOverflow:o||o===void 0?"ellipsis":void 0,whiteSpace:"nowrap"}},lT=function(t){var r=t.theme,a=r.spacing,u=r.borderRadius,o=r.colors,m=t.isFocused;return{alignItems:"center",borderRadius:u/2,backgroundColor:m?o.dangerLight:void 0,display:"flex",paddingLeft:a.baseUnit,paddingRight:a.baseUnit,":hover":{backgroundColor:o.dangerLight,color:o.danger}}},uT=function(t){var r=t.children,a=t.innerProps;return(0,Bt.jsx)("div",a,r)},xD=uT,_D=uT;function bD(e){var t=e.children,r=e.innerProps;return(0,Bt.jsx)("div",kt({role:"button"},r),t||(0,Bt.jsx)(Rx,{size:14}))}var wD=function(t){var r=t.children,a=t.className,u=t.components,o=t.cx,m=t.data,v=t.getStyles,b=t.innerProps,C=t.isDisabled,T=t.removeProps,B=t.selectProps,W=u.Container,q=u.Label,ee=u.Remove;return(0,Bt.jsx)(Bt.ClassNames,null,function(le){var de=le.css,H=le.cx;return(0,Bt.jsx)(W,{data:m,innerProps:Hi({className:H(de(v("multiValue",t)),o({"multi-value":!0,"multi-value--is-disabled":C},a))},b),selectProps:B},(0,Bt.jsx)(q,{data:m,innerProps:{className:H(de(v("multiValueLabel",t)),o({"multi-value__label":!0},a))},selectProps:B},r),(0,Bt.jsx)(ee,{data:m,innerProps:Hi({className:H(de(v("multiValueRemove",t)),o({"multi-value__remove":!0},a)),"aria-label":"Remove ".concat(r||"option")},T),selectProps:B}))})},cT=function(t){var r=t.isDisabled,a=t.isFocused,u=t.isSelected,o=t.theme,m=o.spacing,v=o.colors;return{label:"option",backgroundColor:u?v.primary:a?v.primary25:"transparent",color:r?v.neutral20:u?v.neutral0:"inherit",cursor:"default",display:"block",fontSize:"inherit",padding:"".concat(m.baseUnit*2,"px ").concat(m.baseUnit*3,"px"),width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)",":active":{backgroundColor:r?void 0:u?v.primary:v.primary50}}},ID=function(t){var r=t.children,a=t.className,u=t.cx,o=t.getStyles,m=t.isDisabled,v=t.isFocused,b=t.isSelected,C=t.innerRef,T=t.innerProps;return(0,Bt.jsx)("div",kt({css:o("option",t),className:u({option:!0,"option--is-disabled":m,"option--is-focused":v,"option--is-selected":b},a),ref:C,"aria-disabled":m},T),r)},hT=function(t){var r=t.theme,a=r.spacing,u=r.colors;return{label:"placeholder",color:u.neutral50,gridArea:"1 / 1 / 2 / 3",marginLeft:a.baseUnit/2,marginRight:a.baseUnit/2}},SD=function(t){var r=t.children,a=t.className,u=t.cx,o=t.getStyles,m=t.innerProps;return(0,Bt.jsx)("div",kt({css:o("placeholder",t),className:u({placeholder:!0},a)},m),r)},dT=function(t){var r=t.isDisabled,a=t.theme,u=a.spacing,o=a.colors;return{label:"singleValue",color:r?o.neutral40:o.neutral80,gridArea:"1 / 1 / 2 / 3",marginLeft:u.baseUnit/2,marginRight:u.baseUnit/2,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},CD=function(t){var r=t.children,a=t.className,u=t.cx,o=t.getStyles,m=t.isDisabled,v=t.innerProps;return(0,Bt.jsx)("div",kt({css:o("singleValue",t),className:u({"single-value":!0,"single-value--is-disabled":m},a)},v),r)},MD={ClearIndicator:lD,Control:hD,DropdownIndicator:aD,DownChevron:$E,CrossIcon:Rx,Group:pD,GroupHeading:fD,IndicatorsContainer:nD,IndicatorSeparator:uD,Input:vD,LoadingIndicator:eT,Menu:KR,MenuList:eD,MenuPortal:tD,LoadingMessage:UE,NoOptionsMessage:VE,MultiValue:wD,MultiValueContainer:xD,MultiValueLabel:_D,MultiValueRemove:bD,Option:ID,Placeholder:SD,SelectContainer:iD,SingleValue:CD,ValueContainer:rD},pT=function(t){return Hi(Hi({},MD),t.components)};var oa=Lt(Ir()),ED=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function fT(e){var t=e.defaultInputValue,r=t===void 0?"":t,a=e.defaultMenuIsOpen,u=a===void 0?!1:a,o=e.defaultValue,m=o===void 0?null:o,v=e.inputValue,b=e.menuIsOpen,C=e.onChange,T=e.onInputChange,B=e.onMenuClose,W=e.onMenuOpen,q=e.value,ee=vs(e,ED),le=(0,oa.useState)(v!==void 0?v:r),de=tl(le,2),H=de[0],Q=de[1],te=(0,oa.useState)(b!==void 0?b:u),ve=tl(te,2),Me=ve[0],Ce=ve[1],Be=(0,oa.useState)(q!==void 0?q:m),Fe=tl(Be,2),qe=Fe[0],ht=Fe[1],Tt=(0,oa.useCallback)(function(Ht,ur){typeof C=="function"&&C(Ht,ur),ht(Ht)},[C]),Gt=(0,oa.useCallback)(function(Ht,ur){var Xi;typeof T=="function"&&(Xi=T(Ht,ur)),Q(Xi!==void 0?Xi:Ht)},[T]),Jt=(0,oa.useCallback)(function(){typeof W=="function"&&W(),Ce(!0)},[W]),at=(0,oa.useCallback)(function(){typeof B=="function"&&B(),Ce(!1)},[B]),jt=v!==void 0?v:H,zi=b!==void 0?b:Me,Ii=q!==void 0?q:qe;return Hi(Hi({},ee),{},{inputValue:jt,menuIsOpen:zi,onChange:Tt,onInputChange:Gt,onMenuClose:at,onMenuOpen:Jt,value:Ii})}var FT=Lt(Ir()),Vx=Lt(Ir());function Dx(e){if(Array.isArray(e))return Gc(e)}function Bx(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Nx(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
563
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Bg(e){return Dx(e)||Bx(e)||tp(e)||Nx()}var Ni=Lt(Ir()),Mi=Lt(Ir()),xo=Lt(Ix());var mT=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function TD(e,t){return!!(e===t||mT(e)&&mT(t))}function AD(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!TD(e[r],t[r]))return!1;return!0}function PD(e,t){t===void 0&&(t=AD);var r,a=[],u,o=!1;function m(){for(var v=[],b=0;b<arguments.length;b++)v[b]=arguments[b];return o&&r===this&&t(v,a)||(u=e.apply(this,v),o=!0,r=this,a=v),u}return m}var gT=PD;var kD={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},yT=function(t){return(0,xo.jsx)("span",kt({css:kD},t))},zD={guidance:function(t){var r=t.isSearchable,a=t.isMulti,u=t.isDisabled,o=t.tabSelectsValue,m=t.context;switch(m){case"menu":return"Use Up and Down to choose options".concat(u?"":", press Enter to select the currently focused option",", press Escape to exit the menu").concat(o?", press Tab to select the option and exit the menu":"",".");case"input":return"".concat(t["aria-label"]||"Select"," is focused ").concat(r?",type to refine list":"",", press Down to open the menu, ").concat(a?" press left to focus selected values":"");case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(t){var r=t.action,a=t.label,u=a===void 0?"":a,o=t.labels,m=t.isDisabled;switch(r){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(u,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return m?"option ".concat(u," is disabled. Select another option."):"option ".concat(u,", selected.");default:return""}},onFocus:function(t){var r=t.context,a=t.focused,u=t.options,o=t.label,m=o===void 0?"":o,v=t.selectValue,b=t.isDisabled,C=t.isSelected,T=function(ee,le){return ee&&ee.length?"".concat(ee.indexOf(le)+1," of ").concat(ee.length):""};if(r==="value"&&v)return"value ".concat(m," focused, ").concat(T(v,a),".");if(r==="menu"){var B=b?" disabled":"",W="".concat(C?"selected":"focused").concat(B);return"option ".concat(m," ").concat(W,", ").concat(T(u,a),".")}return""},onFilter:function(t){var r=t.inputValue,a=t.resultsMessage;return"".concat(a).concat(r?" for search term "+r:"",".")}},LD=function(t){var r=t.ariaSelection,a=t.focusedOption,u=t.focusedValue,o=t.focusableOptions,m=t.isFocused,v=t.selectValue,b=t.selectProps,C=t.id,T=b.ariaLiveMessages,B=b.getOptionLabel,W=b.inputValue,q=b.isMulti,ee=b.isOptionDisabled,le=b.isSearchable,de=b.menuIsOpen,H=b.options,Q=b.screenReaderStatus,te=b.tabSelectsValue,ve=b["aria-label"],Me=b["aria-live"],Ce=(0,Mi.useMemo)(function(){return Hi(Hi({},zD),T||{})},[T]),Be=(0,Mi.useMemo)(function(){var at="";if(r&&Ce.onChange){var jt=r.option,zi=r.options,Ii=r.removedValue,Ht=r.removedValues,ur=r.value,Xi=function(Ji){return Array.isArray(Ji)?null:Ji},si=Ii||jt||Xi(ur),ii=si?B(si):"",_i=zi||Ht||void 0,Ei=_i?_i.map(B):[],Li=Hi({isDisabled:si&&ee(si,v),label:ii,labels:Ei},r);at=Ce.onChange(Li)}return at},[r,Ce,ee,v,B]),Fe=(0,Mi.useMemo)(function(){var at="",jt=a||u,zi=!!(a&&v&&v.includes(a));if(jt&&Ce.onFocus){var Ii={focused:jt,label:B(jt),isDisabled:ee(jt,v),isSelected:zi,options:H,context:jt===a?"menu":"value",selectValue:v};at=Ce.onFocus(Ii)}return at},[a,u,B,ee,Ce,H,v]),qe=(0,Mi.useMemo)(function(){var at="";if(de&&H.length&&Ce.onFilter){var jt=Q({count:o.length});at=Ce.onFilter({inputValue:W,resultsMessage:jt})}return at},[o,W,de,Ce,H,Q]),ht=(0,Mi.useMemo)(function(){var at="";if(Ce.guidance){var jt=u?"value":de?"menu":"input";at=Ce.guidance({"aria-label":ve,context:jt,isDisabled:a&&ee(a,v),isMulti:q,isSearchable:le,tabSelectsValue:te})}return at},[ve,a,u,q,ee,le,de,Ce,v,te]),Tt="".concat(Fe," ").concat(qe," ").concat(ht),Gt=(0,xo.jsx)(Mi.Fragment,null,(0,xo.jsx)("span",{id:"aria-selection"},Be),(0,xo.jsx)("span",{id:"aria-context"},Tt)),Jt=r?.action==="initial-input-focus";return(0,xo.jsx)(Mi.Fragment,null,(0,xo.jsx)(yT,{id:C},Jt&&Gt),(0,xo.jsx)(yT,{"aria-live":Me,"aria-atomic":"false","aria-relevant":"additions text"},m&&!Jt&&Gt))},Ox=[{base:"A",letters:"A\u24B6\uFF21\xC0\xC1\xC2\u1EA6\u1EA4\u1EAA\u1EA8\xC3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\xC4\u01DE\u1EA2\xC5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F"},{base:"AA",letters:"\uA732"},{base:"AE",letters:"\xC6\u01FC\u01E2"},{base:"AO",letters:"\uA734"},{base:"AU",letters:"\uA736"},{base:"AV",letters:"\uA738\uA73A"},{base:"AY",letters:"\uA73C"},{base:"B",letters:"B\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181"},{base:"C",letters:"C\u24B8\uFF23\u0106\u0108\u010A\u010C\xC7\u1E08\u0187\u023B\uA73E"},{base:"D",letters:"D\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779"},{base:"DZ",letters:"\u01F1\u01C4"},{base:"Dz",letters:"\u01F2\u01C5"},{base:"E",letters:"E\u24BA\uFF25\xC8\xC9\xCA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\xCB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E"},{base:"F",letters:"F\u24BB\uFF26\u1E1E\u0191\uA77B"},{base:"G",letters:"G\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E"},{base:"H",letters:"H\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D"},{base:"I",letters:"I\u24BE\uFF29\xCC\xCD\xCE\u0128\u012A\u012C\u0130\xCF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197"},{base:"J",letters:"J\u24BF\uFF2A\u0134\u0248"},{base:"K",letters:"K\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2"},{base:"L",letters:"L\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780"},{base:"LJ",letters:"\u01C7"},{base:"Lj",letters:"\u01C8"},{base:"M",letters:"M\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C"},{base:"N",letters:"N\u24C3\uFF2E\u01F8\u0143\xD1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4"},{base:"NJ",letters:"\u01CA"},{base:"Nj",letters:"\u01CB"},{base:"O",letters:"O\u24C4\uFF2F\xD2\xD3\xD4\u1ED2\u1ED0\u1ED6\u1ED4\xD5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\xD6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\xD8\u01FE\u0186\u019F\uA74A\uA74C"},{base:"OI",letters:"\u01A2"},{base:"OO",letters:"\uA74E"},{base:"OU",letters:"\u0222"},{base:"P",letters:"P\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754"},{base:"Q",letters:"Q\u24C6\uFF31\uA756\uA758\u024A"},{base:"R",letters:"R\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782"},{base:"S",letters:"S\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784"},{base:"T",letters:"T\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786"},{base:"TZ",letters:"\uA728"},{base:"U",letters:"U\u24CA\uFF35\xD9\xDA\xDB\u0168\u1E78\u016A\u1E7A\u016C\xDC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244"},{base:"V",letters:"V\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245"},{base:"VY",letters:"\uA760"},{base:"W",letters:"W\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72"},{base:"X",letters:"X\u24CD\uFF38\u1E8A\u1E8C"},{base:"Y",letters:"Y\u24CE\uFF39\u1EF2\xDD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE"},{base:"Z",letters:"Z\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762"},{base:"a",letters:"a\u24D0\uFF41\u1E9A\xE0\xE1\xE2\u1EA7\u1EA5\u1EAB\u1EA9\xE3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\xE4\u01DF\u1EA3\xE5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250"},{base:"aa",letters:"\uA733"},{base:"ae",letters:"\xE6\u01FD\u01E3"},{base:"ao",letters:"\uA735"},{base:"au",letters:"\uA737"},{base:"av",letters:"\uA739\uA73B"},{base:"ay",letters:"\uA73D"},{base:"b",letters:"b\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253"},{base:"c",letters:"c\u24D2\uFF43\u0107\u0109\u010B\u010D\xE7\u1E09\u0188\u023C\uA73F\u2184"},{base:"d",letters:"d\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A"},{base:"dz",letters:"\u01F3\u01C6"},{base:"e",letters:"e\u24D4\uFF45\xE8\xE9\xEA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\xEB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD"},{base:"f",letters:"f\u24D5\uFF46\u1E1F\u0192\uA77C"},{base:"g",letters:"g\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F"},{base:"h",letters:"h\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265"},{base:"hv",letters:"\u0195"},{base:"i",letters:"i\u24D8\uFF49\xEC\xED\xEE\u0129\u012B\u012D\xEF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131"},{base:"j",letters:"j\u24D9\uFF4A\u0135\u01F0\u0249"},{base:"k",letters:"k\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3"},{base:"l",letters:"l\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747"},{base:"lj",letters:"\u01C9"},{base:"m",letters:"m\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F"},{base:"n",letters:"n\u24DD\uFF4E\u01F9\u0144\xF1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5"},{base:"nj",letters:"\u01CC"},{base:"o",letters:"o\u24DE\uFF4F\xF2\xF3\xF4\u1ED3\u1ED1\u1ED7\u1ED5\xF5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\xF6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\xF8\u01FF\u0254\uA74B\uA74D\u0275"},{base:"oi",letters:"\u01A3"},{base:"ou",letters:"\u0223"},{base:"oo",letters:"\uA74F"},{base:"p",letters:"p\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755"},{base:"q",letters:"q\u24E0\uFF51\u024B\uA757\uA759"},{base:"r",letters:"r\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783"},{base:"s",letters:"s\u24E2\uFF53\xDF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B"},{base:"t",letters:"t\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787"},{base:"tz",letters:"\uA729"},{base:"u",letters:"u\u24E4\uFF55\xF9\xFA\xFB\u0169\u1E79\u016B\u1E7B\u016D\xFC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289"},{base:"v",letters:"v\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C"},{base:"vy",letters:"\uA761"},{base:"w",letters:"w\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73"},{base:"x",letters:"x\u24E7\uFF58\u1E8B\u1E8D"},{base:"y",letters:"y\u24E8\uFF59\u1EF3\xFD\u0177\u1EF9\u0233\u1E8F\xFF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF"},{base:"z",letters:"z\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763"}],RD=new RegExp("["+Ox.map(function(e){return e.letters}).join("")+"]","g"),TT={};for(Ng=0;Ng<Ox.length;Ng++)for(Fg=Ox[Ng],Og=0;Og<Fg.letters.length;Og++)TT[Fg.letters[Og]]=Fg.base;var Fg,Og,Ng,AT=function(t){return t.replace(RD,function(r){return TT[r]})},DD=gT(AT),vT=function(t){return t.replace(/^\s+|\s+$/g,"")},BD=function(t){return"".concat(t.label," ").concat(t.value)},ND=function(t){return function(r,a){if(r.data.__isNew__)return!0;var u=Hi({ignoreCase:!0,ignoreAccents:!0,stringify:BD,trim:!0,matchFrom:"any"},t),o=u.ignoreCase,m=u.ignoreAccents,v=u.stringify,b=u.trim,C=u.matchFrom,T=b?vT(a):a,B=b?vT(v(r)):v(r);return o&&(T=T.toLowerCase(),B=B.toLowerCase()),m&&(T=DD(T),B=AT(B)),C==="start"?B.substr(0,T.length)===T:B.indexOf(T)>-1}},FD=["innerRef"];function OD(e){var t=e.innerRef,r=vs(e,FD),a=RE(r,"onExited","in","enter","exit","appear");return(0,xo.jsx)("input",kt({ref:t},a,{css:(0,xo.css)({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var GD=function(t){t.preventDefault(),t.stopPropagation()};function VD(e){var t=e.isEnabled,r=e.onBottomArrive,a=e.onBottomLeave,u=e.onTopArrive,o=e.onTopLeave,m=(0,Mi.useRef)(!1),v=(0,Mi.useRef)(!1),b=(0,Mi.useRef)(0),C=(0,Mi.useRef)(null),T=(0,Mi.useCallback)(function(de,H){if(C.current!==null){var Q=C.current,te=Q.scrollTop,ve=Q.scrollHeight,Me=Q.clientHeight,Ce=C.current,Be=H>0,Fe=ve-Me-te,qe=!1;Fe>H&&m.current&&(a&&a(de),m.current=!1),Be&&v.current&&(o&&o(de),v.current=!1),Be&&H>Fe?(r&&!m.current&&r(de),Ce.scrollTop=ve,qe=!0,m.current=!0):!Be&&-H>te&&(u&&!v.current&&u(de),Ce.scrollTop=0,qe=!0,v.current=!0),qe&&GD(de)}},[r,a,u,o]),B=(0,Mi.useCallback)(function(de){T(de,de.deltaY)},[T]),W=(0,Mi.useCallback)(function(de){b.current=de.changedTouches[0].clientY},[]),q=(0,Mi.useCallback)(function(de){var H=b.current-de.changedTouches[0].clientY;T(de,H)},[T]),ee=(0,Mi.useCallback)(function(de){if(!!de){var H=zE?{passive:!1}:!1;de.addEventListener("wheel",B,H),de.addEventListener("touchstart",W,H),de.addEventListener("touchmove",q,H)}},[q,W,B]),le=(0,Mi.useCallback)(function(de){!de||(de.removeEventListener("wheel",B,!1),de.removeEventListener("touchstart",W,!1),de.removeEventListener("touchmove",q,!1))},[q,W,B]);return(0,Mi.useEffect)(function(){if(!!t){var de=C.current;return ee(de),function(){le(de)}}},[t,ee,le]),function(de){C.current=de}}var xT=["boxSizing","height","overflow","paddingRight","position"],_T={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function bT(e){e.preventDefault()}function wT(e){e.stopPropagation()}function IT(){var e=this.scrollTop,t=this.scrollHeight,r=e+this.offsetHeight;e===0?this.scrollTop=1:r===t&&(this.scrollTop=e-1)}function ST(){return"ontouchstart"in window||navigator.maxTouchPoints}var CT=!!(typeof window<"u"&&window.document&&window.document.createElement),lp=0,Vc={capture:!1,passive:!1};function UD(e){var t=e.isEnabled,r=e.accountForScrollbars,a=r===void 0?!0:r,u=(0,Mi.useRef)({}),o=(0,Mi.useRef)(null),m=(0,Mi.useCallback)(function(b){if(!!CT){var C=document.body,T=C&&C.style;if(a&&xT.forEach(function(ee){var le=T&&T[ee];u.current[ee]=le}),a&&lp<1){var B=parseInt(u.current.paddingRight,10)||0,W=document.body?document.body.clientWidth:0,q=window.innerWidth-W+B||0;Object.keys(_T).forEach(function(ee){var le=_T[ee];T&&(T[ee]=le)}),T&&(T.paddingRight="".concat(q,"px"))}C&&ST()&&(C.addEventListener("touchmove",bT,Vc),b&&(b.addEventListener("touchstart",IT,Vc),b.addEventListener("touchmove",wT,Vc))),lp+=1}},[a]),v=(0,Mi.useCallback)(function(b){if(!!CT){var C=document.body,T=C&&C.style;lp=Math.max(lp-1,0),a&&lp<1&&xT.forEach(function(B){var W=u.current[B];T&&(T[B]=W)}),C&&ST()&&(C.removeEventListener("touchmove",bT,Vc),b&&(b.removeEventListener("touchstart",IT,Vc),b.removeEventListener("touchmove",wT,Vc)))}},[a]);return(0,Mi.useEffect)(function(){if(!!t){var b=o.current;return m(b),function(){v(b)}}},[t,m,v]),function(b){o.current=b}}var WD=function(){return document.activeElement&&document.activeElement.blur()},ZD={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function jD(e){var t=e.children,r=e.lockEnabled,a=e.captureEnabled,u=a===void 0?!0:a,o=e.onBottomArrive,m=e.onBottomLeave,v=e.onTopArrive,b=e.onTopLeave,C=VD({isEnabled:u,onBottomArrive:o,onBottomLeave:m,onTopArrive:v,onTopLeave:b}),T=UD({isEnabled:r}),B=function(q){C(q),T(q)};return(0,xo.jsx)(Mi.Fragment,null,r&&(0,xo.jsx)("div",{onClick:WD,css:ZD}),t(B))}var HD=function(t){return t.label},XD=function(t){return t.label},$D=function(t){return t.value},YD=function(t){return!!t.isDisabled},qD={clearIndicator:JE,container:ZE,control:tT,dropdownIndicator:qE,group:iT,groupHeading:rT,indicatorsContainer:HE,indicatorSeparator:QE,input:nT,loadingIndicator:KE,loadingMessage:GE,menu:DE,menuList:NE,menuPortal:WE,multiValue:sT,multiValueLabel:aT,multiValueRemove:lT,noOptionsMessage:OE,option:cT,placeholder:hT,singleValue:dT,valueContainer:jE};var JD={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},QD=4,PT=4,KD=38,eB=PT*2,tB={baseUnit:PT,controlHeight:KD,menuGutter:eB},Fx={borderRadius:QD,colors:JD,spacing:tB},iB={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:zx(),captureMenuScroll:!zx(),closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:ND(),formatGroupLabel:HD,getOptionLabel:XD,getOptionValue:$D,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:YD,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!PE(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(t){var r=t.count;return"".concat(r," result").concat(r!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0};function MT(e,t,r,a){var u=RT(e,t,r),o=DT(e,t,r),m=LT(e,t),v=Gg(e,t);return{type:"option",data:t,isDisabled:u,isSelected:o,label:m,value:v,index:a}}function kT(e,t){return e.options.map(function(r,a){if("options"in r){var u=r.options.map(function(m,v){return MT(e,m,t,v)}).filter(function(m){return ET(e,m)});return u.length>0?{type:"group",data:r,options:u,index:a}:void 0}var o=MT(e,r,t,a);return ET(e,o)?o:void 0}).filter(LE)}function zT(e){return e.reduce(function(t,r){return r.type==="group"?t.push.apply(t,Bg(r.options.map(function(a){return a.data}))):t.push(r.data),t},[])}function rB(e,t){return zT(kT(e,t))}function ET(e,t){var r=e.inputValue,a=r===void 0?"":r,u=t.data,o=t.isSelected,m=t.label,v=t.value;return(!NT(e)||!o)&&BT(e,{label:m,value:v,data:u},a)}function nB(e,t){var r=e.focusedValue,a=e.selectValue,u=a.indexOf(r);if(u>-1){var o=t.indexOf(r);if(o>-1)return r;if(u<t.length)return t[u]}return null}function oB(e,t){var r=e.focusedOption;return r&&t.indexOf(r)>-1?r:t[0]}var LT=function(t,r){return t.getOptionLabel(r)},Gg=function(t,r){return t.getOptionValue(r)};function RT(e,t,r){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,r):!1}function DT(e,t,r){if(r.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,r);var a=Gg(e,t);return r.some(function(u){return Gg(e,u)===a})}function BT(e,t,r){return e.filterOption?e.filterOption(t,r):!0}var NT=function(t){var r=t.hideSelectedOptions,a=t.isMulti;return r===void 0?a:r},sB=1,Gx=function(e){Kl(r,e);var t=Dg(r);function r(a){var u;return Jl(this,r),u=t.call(this,a),u.state={ariaSelection:null,focusedOption:null,focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0},u.blockOptionHover=!1,u.isComposing=!1,u.commonProps=void 0,u.initialTouchX=0,u.initialTouchY=0,u.instancePrefix="",u.openAfterFocus=!1,u.scrollToFocusedOptionOnUpdate=!1,u.userIsDragging=void 0,u.controlRef=null,u.getControlRef=function(o){u.controlRef=o},u.focusedOptionRef=null,u.getFocusedOptionRef=function(o){u.focusedOptionRef=o},u.menuListRef=null,u.getMenuListRef=function(o){u.menuListRef=o},u.inputRef=null,u.getInputRef=function(o){u.inputRef=o},u.focus=u.focusInput,u.blur=u.blurInput,u.onChange=function(o,m){var v=u.props,b=v.onChange,C=v.name;m.name=C,u.ariaOnChange(o,m),b(o,m)},u.setValue=function(o,m,v){var b=u.props,C=b.closeMenuOnSelect,T=b.isMulti,B=b.inputValue;u.onInputChange("",{action:"set-value",prevInputValue:B}),C&&(u.setState({inputIsHiddenAfterUpdate:!T}),u.onMenuClose()),u.setState({clearFocusValueOnUpdate:!0}),u.onChange(o,{action:m,option:v})},u.selectOption=function(o){var m=u.props,v=m.blurInputOnSelect,b=m.isMulti,C=m.name,T=u.state.selectValue,B=b&&u.isOptionSelected(o,T),W=u.isOptionDisabled(o,T);if(B){var q=u.getOptionValue(o);u.setValue(T.filter(function(ee){return u.getOptionValue(ee)!==q}),"deselect-option",o)}else if(!W)b?u.setValue([].concat(Bg(T),[o]),"select-option",o):u.setValue(o,"select-option");else{u.ariaOnChange(o,{action:"select-option",option:o,name:C});return}v&&u.blurInput()},u.removeValue=function(o){var m=u.props.isMulti,v=u.state.selectValue,b=u.getOptionValue(o),C=v.filter(function(B){return u.getOptionValue(B)!==b}),T=ap(m,C,C[0]||null);u.onChange(T,{action:"remove-value",removedValue:o}),u.focusInput()},u.clearValue=function(){var o=u.state.selectValue;u.onChange(ap(u.props.isMulti,[],null),{action:"clear",removedValues:o})},u.popValue=function(){var o=u.props.isMulti,m=u.state.selectValue,v=m[m.length-1],b=m.slice(0,m.length-1),C=ap(o,b,b[0]||null);u.onChange(C,{action:"pop-value",removedValue:v})},u.getValue=function(){return u.state.selectValue},u.cx=function(){for(var o=arguments.length,m=new Array(o),v=0;v<o;v++)m[v]=arguments[v];return ME.apply(void 0,[u.props.classNamePrefix].concat(m))},u.getOptionLabel=function(o){return LT(u.props,o)},u.getOptionValue=function(o){return Gg(u.props,o)},u.getStyles=function(o,m){var v=qD[o](m);v.boxSizing="border-box";var b=u.props.styles[o];return b?b(v,m):v},u.getElementId=function(o){return"".concat(u.instancePrefix,"-").concat(o)},u.getComponents=function(){return pT(u.props)},u.buildCategorizedOptions=function(){return kT(u.props,u.state.selectValue)},u.getCategorizedOptions=function(){return u.props.menuIsOpen?u.buildCategorizedOptions():[]},u.buildFocusableOptions=function(){return zT(u.buildCategorizedOptions())},u.getFocusableOptions=function(){return u.props.menuIsOpen?u.buildFocusableOptions():[]},u.ariaOnChange=function(o,m){u.setState({ariaSelection:Hi({value:o},m)})},u.onMenuMouseDown=function(o){o.button===0&&(o.stopPropagation(),o.preventDefault(),u.focusInput())},u.onMenuMouseMove=function(o){u.blockOptionHover=!1},u.onControlMouseDown=function(o){if(!o.defaultPrevented){var m=u.props.openMenuOnClick;u.state.isFocused?u.props.menuIsOpen?o.target.tagName!=="INPUT"&&o.target.tagName!=="TEXTAREA"&&u.onMenuClose():m&&u.openMenu("first"):(m&&(u.openAfterFocus=!0),u.focusInput()),o.target.tagName!=="INPUT"&&o.target.tagName!=="TEXTAREA"&&o.preventDefault()}},u.onDropdownIndicatorMouseDown=function(o){if(!(o&&o.type==="mousedown"&&o.button!==0)&&!u.props.isDisabled){var m=u.props,v=m.isMulti,b=m.menuIsOpen;u.focusInput(),b?(u.setState({inputIsHiddenAfterUpdate:!v}),u.onMenuClose()):u.openMenu("first"),o.preventDefault()}},u.onClearIndicatorMouseDown=function(o){o&&o.type==="mousedown"&&o.button!==0||(u.clearValue(),o.preventDefault(),u.openAfterFocus=!1,o.type==="touchend"?u.focusInput():setTimeout(function(){return u.focusInput()}))},u.onScroll=function(o){typeof u.props.closeMenuOnScroll=="boolean"?o.target instanceof HTMLElement&&sp(o.target)&&u.props.onMenuClose():typeof u.props.closeMenuOnScroll=="function"&&u.props.closeMenuOnScroll(o)&&u.props.onMenuClose()},u.onCompositionStart=function(){u.isComposing=!0},u.onCompositionEnd=function(){u.isComposing=!1},u.onTouchStart=function(o){var m=o.touches,v=m&&m.item(0);!v||(u.initialTouchX=v.clientX,u.initialTouchY=v.clientY,u.userIsDragging=!1)},u.onTouchMove=function(o){var m=o.touches,v=m&&m.item(0);if(!!v){var b=Math.abs(v.clientX-u.initialTouchX),C=Math.abs(v.clientY-u.initialTouchY),T=5;u.userIsDragging=b>T||C>T}},u.onTouchEnd=function(o){u.userIsDragging||(u.controlRef&&!u.controlRef.contains(o.target)&&u.menuListRef&&!u.menuListRef.contains(o.target)&&u.blurInput(),u.initialTouchX=0,u.initialTouchY=0)},u.onControlTouchEnd=function(o){u.userIsDragging||u.onControlMouseDown(o)},u.onClearIndicatorTouchEnd=function(o){u.userIsDragging||u.onClearIndicatorMouseDown(o)},u.onDropdownIndicatorTouchEnd=function(o){u.userIsDragging||u.onDropdownIndicatorMouseDown(o)},u.handleInputChange=function(o){var m=u.props.inputValue,v=o.currentTarget.value;u.setState({inputIsHiddenAfterUpdate:!1}),u.onInputChange(v,{action:"input-change",prevInputValue:m}),u.props.menuIsOpen||u.onMenuOpen()},u.onInputFocus=function(o){u.props.onFocus&&u.props.onFocus(o),u.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(u.openAfterFocus||u.props.openMenuOnFocus)&&u.openMenu("first"),u.openAfterFocus=!1},u.onInputBlur=function(o){var m=u.props.inputValue;if(u.menuListRef&&u.menuListRef.contains(document.activeElement)){u.inputRef.focus();return}u.props.onBlur&&u.props.onBlur(o),u.onInputChange("",{action:"input-blur",prevInputValue:m}),u.onMenuClose(),u.setState({focusedValue:null,isFocused:!1})},u.onOptionHover=function(o){u.blockOptionHover||u.state.focusedOption===o||u.setState({focusedOption:o})},u.shouldHideSelectedOptions=function(){return NT(u.props)},u.onKeyDown=function(o){var m=u.props,v=m.isMulti,b=m.backspaceRemovesValue,C=m.escapeClearsValue,T=m.inputValue,B=m.isClearable,W=m.isDisabled,q=m.menuIsOpen,ee=m.onKeyDown,le=m.tabSelectsValue,de=m.openMenuOnFocus,H=u.state,Q=H.focusedOption,te=H.focusedValue,ve=H.selectValue;if(!W&&!(typeof ee=="function"&&(ee(o),o.defaultPrevented))){switch(u.blockOptionHover=!0,o.key){case"ArrowLeft":if(!v||T)return;u.focusValue("previous");break;case"ArrowRight":if(!v||T)return;u.focusValue("next");break;case"Delete":case"Backspace":if(T)return;if(te)u.removeValue(te);else{if(!b)return;v?u.popValue():B&&u.clearValue()}break;case"Tab":if(u.isComposing||o.shiftKey||!q||!le||!Q||de&&u.isOptionSelected(Q,ve))return;u.selectOption(Q);break;case"Enter":if(o.keyCode===229)break;if(q){if(!Q||u.isComposing)return;u.selectOption(Q);break}return;case"Escape":q?(u.setState({inputIsHiddenAfterUpdate:!1}),u.onInputChange("",{action:"menu-close",prevInputValue:T}),u.onMenuClose()):B&&C&&u.clearValue();break;case" ":if(T)return;if(!q){u.openMenu("first");break}if(!Q)return;u.selectOption(Q);break;case"ArrowUp":q?u.focusOption("up"):u.openMenu("last");break;case"ArrowDown":q?u.focusOption("down"):u.openMenu("first");break;case"PageUp":if(!q)return;u.focusOption("pageup");break;case"PageDown":if(!q)return;u.focusOption("pagedown");break;case"Home":if(!q)return;u.focusOption("first");break;case"End":if(!q)return;u.focusOption("last");break;default:return}o.preventDefault()}},u.instancePrefix="react-select-"+(u.props.instanceId||++sB),u.state.selectValue=kx(a.value),u}return Ql(r,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput()}},{key:"componentDidUpdate",value:function(u){var o=this.props,m=o.isDisabled,v=o.menuIsOpen,b=this.state.isFocused;(b&&!m&&u.isDisabled||b&&v&&!u.menuIsOpen)&&this.focusInput(),b&&m&&!u.isDisabled&&this.setState({isFocused:!1},this.onMenuClose),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(AE(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(u,o){this.props.onInputChange(u,o)}},{key:"focusInput",value:function(){!this.inputRef||this.inputRef.focus()}},{key:"blurInput",value:function(){!this.inputRef||this.inputRef.blur()}},{key:"openMenu",value:function(u){var o=this,m=this.state,v=m.selectValue,b=m.isFocused,C=this.buildFocusableOptions(),T=u==="first"?0:C.length-1;if(!this.props.isMulti){var B=C.indexOf(v[0]);B>-1&&(T=B)}this.scrollToFocusedOptionOnUpdate=!(b&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:C[T]},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(u){var o=this.state,m=o.selectValue,v=o.focusedValue;if(!!this.props.isMulti){this.setState({focusedOption:null});var b=m.indexOf(v);v||(b=-1);var C=m.length-1,T=-1;if(!!m.length){switch(u){case"previous":b===0?T=0:b===-1?T=C:T=b-1;break;case"next":b>-1&&b<C&&(T=b+1);break}this.setState({inputIsHidden:T!==-1,focusedValue:m[T]})}}}},{key:"focusOption",value:function(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,m=this.state.focusedOption,v=this.getFocusableOptions();if(!!v.length){var b=0,C=v.indexOf(m);m||(C=-1),u==="up"?b=C>0?C-1:v.length-1:u==="down"?b=(C+1)%v.length:u==="pageup"?(b=C-o,b<0&&(b=0)):u==="pagedown"?(b=C+o,b>v.length-1&&(b=v.length-1)):u==="last"&&(b=v.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:v[b],focusedValue:null})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(Fx):Hi(Hi({},Fx),this.props.theme):Fx}},{key:"getCommonProps",value:function(){var u=this.clearValue,o=this.cx,m=this.getStyles,v=this.getValue,b=this.selectOption,C=this.setValue,T=this.props,B=T.isMulti,W=T.isRtl,q=T.options,ee=this.hasValue();return{clearValue:u,cx:o,getStyles:m,getValue:v,hasValue:ee,isMulti:B,isRtl:W,options:q,selectOption:b,selectProps:T,setValue:C,theme:this.getTheme()}}},{key:"hasValue",value:function(){var u=this.state.selectValue;return u.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var u=this.props,o=u.isClearable,m=u.isMulti;return o===void 0?m:o}},{key:"isOptionDisabled",value:function(u,o){return RT(this.props,u,o)}},{key:"isOptionSelected",value:function(u,o){return DT(this.props,u,o)}},{key:"filterOption",value:function(u,o){return BT(this.props,u,o)}},{key:"formatOptionLabel",value:function(u,o){if(typeof this.props.formatOptionLabel=="function"){var m=this.props.inputValue,v=this.state.selectValue;return this.props.formatOptionLabel(u,{context:o,inputValue:m,selectValue:v})}else return this.getOptionLabel(u)}},{key:"formatGroupLabel",value:function(u){return this.props.formatGroupLabel(u)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var u=this.props,o=u.isDisabled,m=u.isSearchable,v=u.inputId,b=u.inputValue,C=u.tabIndex,T=u.form,B=u.menuIsOpen,W=this.getComponents(),q=W.Input,ee=this.state,le=ee.inputIsHidden,de=ee.ariaSelection,H=this.commonProps,Q=v||this.getElementId("input"),te=Hi(Hi(Hi({"aria-autocomplete":"list","aria-expanded":B,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],role:"combobox"},B&&{"aria-controls":this.getElementId("listbox"),"aria-owns":this.getElementId("listbox")}),!m&&{"aria-readonly":!0}),this.hasValue()?de?.action==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return m?Ni.createElement(q,kt({},H,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:Q,innerRef:this.getInputRef,isDisabled:o,isHidden:le,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:C,form:T,type:"text",value:b},te)):Ni.createElement(OD,kt({id:Q,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:np,onFocus:this.onInputFocus,disabled:o,tabIndex:C,inputMode:"none",form:T,value:""},te))}},{key:"renderPlaceholderOrValue",value:function(){var u=this,o=this.getComponents(),m=o.MultiValue,v=o.MultiValueContainer,b=o.MultiValueLabel,C=o.MultiValueRemove,T=o.SingleValue,B=o.Placeholder,W=this.commonProps,q=this.props,ee=q.controlShouldRenderValue,le=q.isDisabled,de=q.isMulti,H=q.inputValue,Q=q.placeholder,te=this.state,ve=te.selectValue,Me=te.focusedValue,Ce=te.isFocused;if(!this.hasValue()||!ee)return H?null:Ni.createElement(B,kt({},W,{key:"placeholder",isDisabled:le,isFocused:Ce,innerProps:{id:this.getElementId("placeholder")}}),Q);if(de)return ve.map(function(Fe,qe){var ht=Fe===Me,Tt="".concat(u.getOptionLabel(Fe),"-").concat(u.getOptionValue(Fe));return Ni.createElement(m,kt({},W,{components:{Container:v,Label:b,Remove:C},isFocused:ht,isDisabled:le,key:Tt,index:qe,removeProps:{onClick:function(){return u.removeValue(Fe)},onTouchEnd:function(){return u.removeValue(Fe)},onMouseDown:function(Jt){Jt.preventDefault()}},data:Fe}),u.formatOptionLabel(Fe,"value"))});if(H)return null;var Be=ve[0];return Ni.createElement(T,kt({},W,{data:Be,isDisabled:le}),this.formatOptionLabel(Be,"value"))}},{key:"renderClearIndicator",value:function(){var u=this.getComponents(),o=u.ClearIndicator,m=this.commonProps,v=this.props,b=v.isDisabled,C=v.isLoading,T=this.state.isFocused;if(!this.isClearable()||!o||b||!this.hasValue()||C)return null;var B={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return Ni.createElement(o,kt({},m,{innerProps:B,isFocused:T}))}},{key:"renderLoadingIndicator",value:function(){var u=this.getComponents(),o=u.LoadingIndicator,m=this.commonProps,v=this.props,b=v.isDisabled,C=v.isLoading,T=this.state.isFocused;if(!o||!C)return null;var B={"aria-hidden":"true"};return Ni.createElement(o,kt({},m,{innerProps:B,isDisabled:b,isFocused:T}))}},{key:"renderIndicatorSeparator",value:function(){var u=this.getComponents(),o=u.DropdownIndicator,m=u.IndicatorSeparator;if(!o||!m)return null;var v=this.commonProps,b=this.props.isDisabled,C=this.state.isFocused;return Ni.createElement(m,kt({},v,{isDisabled:b,isFocused:C}))}},{key:"renderDropdownIndicator",value:function(){var u=this.getComponents(),o=u.DropdownIndicator;if(!o)return null;var m=this.commonProps,v=this.props.isDisabled,b=this.state.isFocused,C={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return Ni.createElement(o,kt({},m,{innerProps:C,isDisabled:v,isFocused:b}))}},{key:"renderMenu",value:function(){var u=this,o=this.getComponents(),m=o.Group,v=o.GroupHeading,b=o.Menu,C=o.MenuList,T=o.MenuPortal,B=o.LoadingMessage,W=o.NoOptionsMessage,q=o.Option,ee=this.commonProps,le=this.state.focusedOption,de=this.props,H=de.captureMenuScroll,Q=de.inputValue,te=de.isLoading,ve=de.loadingMessage,Me=de.minMenuHeight,Ce=de.maxMenuHeight,Be=de.menuIsOpen,Fe=de.menuPlacement,qe=de.menuPosition,ht=de.menuPortalTarget,Tt=de.menuShouldBlockScroll,Gt=de.menuShouldScrollIntoView,Jt=de.noOptionsMessage,at=de.onMenuScrollToTop,jt=de.onMenuScrollToBottom;if(!Be)return null;var zi=function(_i,Ei){var Li=_i.type,Fi=_i.data,Ji=_i.isDisabled,Mr=_i.isSelected,tn=_i.label,oo=_i.value,ri=le===Fi,Hr=Ji?void 0:function(){return u.onOptionHover(Fi)},hn=Ji?void 0:function(){return u.selectOption(Fi)},rn="".concat(u.getElementId("option"),"-").concat(Ei),Lr={id:rn,onClick:hn,onMouseMove:Hr,onMouseOver:Hr,tabIndex:-1};return Ni.createElement(q,kt({},ee,{innerProps:Lr,data:Fi,isDisabled:Ji,isSelected:Mr,key:rn,label:tn,type:Li,value:oo,isFocused:ri,innerRef:ri?u.getFocusedOptionRef:void 0}),u.formatOptionLabel(_i.data,"menu"))},Ii;if(this.hasOptions())Ii=this.getCategorizedOptions().map(function(ii){if(ii.type==="group"){var _i=ii.data,Ei=ii.options,Li=ii.index,Fi="".concat(u.getElementId("group"),"-").concat(Li),Ji="".concat(Fi,"-heading");return Ni.createElement(m,kt({},ee,{key:Fi,data:_i,options:Ei,Heading:v,headingProps:{id:Ji,data:ii.data},label:u.formatGroupLabel(ii.data)}),ii.options.map(function(Mr){return zi(Mr,"".concat(Li,"-").concat(Mr.index))}))}else if(ii.type==="option")return zi(ii,"".concat(ii.index))});else if(te){var Ht=ve({inputValue:Q});if(Ht===null)return null;Ii=Ni.createElement(B,ee,Ht)}else{var ur=Jt({inputValue:Q});if(ur===null)return null;Ii=Ni.createElement(W,ee,ur)}var Xi={minMenuHeight:Me,maxMenuHeight:Ce,menuPlacement:Fe,menuPosition:qe,menuShouldScrollIntoView:Gt},si=Ni.createElement(Lx,kt({},ee,Xi),function(ii){var _i=ii.ref,Ei=ii.placerProps,Li=Ei.placement,Fi=Ei.maxHeight;return Ni.createElement(b,kt({},ee,Xi,{innerRef:_i,innerProps:{onMouseDown:u.onMenuMouseDown,onMouseMove:u.onMenuMouseMove,id:u.getElementId("listbox")},isLoading:te,placement:Li}),Ni.createElement(jD,{captureEnabled:H,onTopArrive:at,onBottomArrive:jt,lockEnabled:Tt},function(Ji){return Ni.createElement(C,kt({},ee,{innerRef:function(tn){u.getMenuListRef(tn),Ji(tn)},isLoading:te,maxHeight:Fi,focusedOption:le}),Ii)}))});return ht||qe==="fixed"?Ni.createElement(T,kt({},ee,{appendTo:ht,controlElement:this.controlRef,menuPlacement:Fe,menuPosition:qe}),si):si}},{key:"renderFormField",value:function(){var u=this,o=this.props,m=o.delimiter,v=o.isDisabled,b=o.isMulti,C=o.name,T=this.state.selectValue;if(!(!C||v))if(b)if(m){var B=T.map(function(ee){return u.getOptionValue(ee)}).join(m);return Ni.createElement("input",{name:C,type:"hidden",value:B})}else{var W=T.length>0?T.map(function(ee,le){return Ni.createElement("input",{key:"i-".concat(le),name:C,type:"hidden",value:u.getOptionValue(ee)})}):Ni.createElement("input",{name:C,type:"hidden"});return Ni.createElement("div",null,W)}else{var q=T[0]?this.getOptionValue(T[0]):"";return Ni.createElement("input",{name:C,type:"hidden",value:q})}}},{key:"renderLiveRegion",value:function(){var u=this.commonProps,o=this.state,m=o.ariaSelection,v=o.focusedOption,b=o.focusedValue,C=o.isFocused,T=o.selectValue,B=this.getFocusableOptions();return Ni.createElement(LD,kt({},u,{id:this.getElementId("live-region"),ariaSelection:m,focusedOption:v,focusedValue:b,isFocused:C,selectValue:T,focusableOptions:B}))}},{key:"render",value:function(){var u=this.getComponents(),o=u.Control,m=u.IndicatorsContainer,v=u.SelectContainer,b=u.ValueContainer,C=this.props,T=C.className,B=C.id,W=C.isDisabled,q=C.menuIsOpen,ee=this.state.isFocused,le=this.commonProps=this.getCommonProps();return Ni.createElement(v,kt({},le,{className:T,innerProps:{id:B,onKeyDown:this.onKeyDown},isDisabled:W,isFocused:ee}),this.renderLiveRegion(),Ni.createElement(o,kt({},le,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:W,isFocused:ee,menuIsOpen:q}),Ni.createElement(b,kt({},le,{isDisabled:W}),this.renderPlaceholderOrValue(),this.renderInput()),Ni.createElement(m,kt({},le,{isDisabled:W}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(u,o){var m=o.prevProps,v=o.clearFocusValueOnUpdate,b=o.inputIsHiddenAfterUpdate,C=o.ariaSelection,T=o.isFocused,B=o.prevWasFocused,W=u.options,q=u.value,ee=u.menuIsOpen,le=u.inputValue,de=u.isMulti,H=kx(q),Q={};if(m&&(q!==m.value||W!==m.options||ee!==m.menuIsOpen||le!==m.inputValue)){var te=ee?rB(u,H):[],ve=v?nB(o,H):null,Me=oB(o,te);Q={selectValue:H,focusedOption:Me,focusedValue:ve,clearFocusValueOnUpdate:!1}}var Ce=b!=null&&u!==m?{inputIsHidden:b,inputIsHiddenAfterUpdate:void 0}:{},Be=C,Fe=T&&B;return T&&!Fe&&(Be={value:ap(de,H,H[0]||null),options:H,action:"initial-input-focus"},Fe=!B),C?.action==="initial-input-focus"&&(Be=null),Hi(Hi(Hi({},Q),Ce),{},{prevProps:u,ariaSelection:Be,prevWasFocused:Fe})}}]),r}(Mi.Component);Gx.defaultProps=iB;var aB=Lt(vg());var rj=Lt(zm()),lB=(0,Vx.forwardRef)(function(e,t){var r=fT(e);return FT.createElement(Gx,kt({ref:t},r))});var OT=lB;var il=Lt(zr(),1),Vg=class extends GT.Component{constructor(){super(...arguments);this._events=[];this.state={zoomToExtent:!0,currentLayer:"unknown"};this.onLayerChange=r=>{if(r==null)return;let[a,u]=r.value.split("::");Ie.map.setLayerId(a,u),Yl("Ui","layer:"+r.value),this.state.zoomToExtent&&Ie.map.layers.then(o=>{let m=o.get(a);m!=null&&Ie.map.emit("bounds",[m.upperLeft,m.lowerRight])}),window.history.pushState(null,"",`?${yo.toUrl(Ie.map)}`)};this.onZoomExtentChange=r=>{let a=r.target;this.setState({zoomToExtent:a.checked})}}componentDidMount(){this.setState({zoomToExtent:!0,currentLayer:Ie.map.layerKey}),Ie.map.layers.then(r=>this.setState({layers:r})),this._events.push(Ie.map.on("layer",()=>this.setState({currentLayer:Ie.map.layerKey})),Ie.map.on("tileMatrix",()=>this.forceUpdate()))}componentWillUnmount(){for(let r of this._events)r();this._events=[]}render(){let r=this.makeOptions();return(0,il.jsxs)("div",{className:"LuiDeprecatedForms",children:[(0,il.jsx)("h6",{children:"Layers"}),(0,il.jsx)(OT,{options:r.options,onChange:this.onLayerChange,value:r.current}),(0,il.jsx)("div",{className:"lui-input-group-wrapper",children:(0,il.jsxs)("div",{className:"lui-checkbox-container",children:[(0,il.jsx)("input",{type:"checkbox",onChange:this.onZoomExtentChange,checked:this.state.zoomToExtent}),(0,il.jsx)("label",{children:"Zoom to Extent"})]})})]})}makeOptions(){if(this.state.layers==null||this.state.layers.size===0)return{options:[],current:null};let r=new Map,a=this.state.currentLayer,u=null;for(let o of this.state.layers.values()){if(!o.projections.has(Ie.map.tileMatrix.projection.code))continue;let m=o.category??"Unknown",v=r.get(m)??{label:m,options:[]},b={value:o.id,label:o.name.replace(` ${o.category}`,"")};v.options.push(b),r.set(m,v),o.id===a&&(u=b)}return{options:[...r.values()],current:u}}};var ti=Lt(zr(),1),Ug=class extends eu.Component{constructor(){super(...arguments);this._events=[];this.state={isMenuOpen:!1};this.menuToggle=()=>{let r=!this.state.isMenuOpen;Yl("Ui",r?"menu:open":"menu:close"),this.setState({isMenuOpen:r})};this.contactUs=()=>{let r="Request Basemaps Developer Access",a=`
|
|
564
|
-
Give us a few key details to sign up for Developer Access to LINZ Basemaps. We will respond with your Apps' unique API key.
|
|
565
|
-
|
|
566
|
-
Your Name:
|
|
567
|
-
|
|
568
|
-
Your Email:
|
|
569
|
-
|
|
570
|
-
Your Service/App URL:
|
|
571
|
-
|
|
572
|
-
`;Yl("Ui","contact-us:click"),window.location.href=`mailto:basemaps@linz.govt.nz?subject=${encodeURI(r)}&body=${encodeURI(a)}`};this._validProjections=new Set([fi.Google,fi.Nztm2000])}componentDidMount(){this._events.push(Ie.map.on("change",()=>this.forceUpdate())),this._events.push(Ie.map.on("filter",()=>this.renderLinksTiles())),Ie.map.layers.then(r=>this.setState({layers:r}))}componentWillUnmount(){for(let r of this._events)r();this._events=[]}render(){if(!Ie.map.isDebug)return(0,ti.jsxs)("header",{className:"lui-header",children:[(0,ti.jsxs)("div",{className:"lui-header-row",children:[(0,ti.jsxs)("div",{className:"lui-header-col",children:[(0,ti.jsx)("div",{className:"lui-header-logo",children:(0,ti.jsx)("img",{className:"linz-logo",src:"/assets/logo-linz.svg"})}),(0,ti.jsx)("div",{className:"lui-header-title",children:(0,ti.jsx)("h1",{children:"Basemaps"})})]}),(0,ti.jsx)("div",{className:"lui-header-col",children:(0,ti.jsx)("div",{className:"lui-header-menu-item",children:(0,ti.jsx)("div",{className:"lui-header-menu-icon",children:(0,ti.jsx)("i",{className:"material-icons-round md-36",onClick:this.menuToggle,style:{cursor:"pointer"},children:this.state.isMenuOpen?"close":"menu"})})})})]}),(0,ti.jsxs)("div",{className:Nc({"lui-menu-drawer":!0,"lui-menu-drawer-closed":!this.state.isMenuOpen,"lui-menu-drawer-wide":!0}),"aria-hidden":this.state.isMenuOpen,children:[(0,ti.jsx)(Vg,{}),this.renderLinks(),(0,ti.jsx)("h6",{children:"Developer API Keys"}),(0,ti.jsx)("p",{children:"Contact us for free API keys with better support for public web and mobile apps."}),(0,ti.jsx)("button",{className:"lui-button lui-button-primary contact-us",onClick:this.contactUs,children:"Contact us"}),this.renderAbout()]})]})}renderAboutLi(r,a,u){return(0,ti.jsx)("li",{children:(0,ti.jsxs)(Qo,{href:a,children:[r,u??(0,ti.jsx)(Jd,{name:"launch"})]})})}renderAbout(){return(0,ti.jsxs)(eu.Fragment,{children:[(0,ti.jsx)("h6",{children:"About Basemaps"}),(0,ti.jsxs)("ul",{className:"about-links",children:[this.renderAboutLi("Get started","https://www.linz.govt.nz/data/linz-data/linz-basemaps/get-started-linz-basemaps"),this.renderAboutLi("Technical information","https://www.linz.govt.nz/data/linz-data/linz-basemaps/linz-basemaps-documentation"),this.renderAboutLi("How to use our APIs","https://www.linz.govt.nz/data/linz-data/linz-basemaps/how-use-linz-basemaps-apis"),this.renderAboutLi("Github","https://github.com/linz/basemaps",this.renderGithubLogo()),(0,ti.jsx)("li",{children:(0,ti.jsxs)(Qo,{href:"https://github.com/linz/basemaps/blob/master/CHANGELOG.md",children:["Version ",(0,ti.jsx)("span",{className:"basemaps-version",children:Ie.Version})]})})]})]})}renderGithubLogo(){return(0,ti.jsx)("svg",{style:{width:"24px",height:"24px"},viewBox:"0 0 24 24",children:(0,ti.jsx)("path",{fill:"currentColor",d:"M12,2A10,10 0 0,0 2,12C2,16.42 4.87,20.17 8.84,21.5C9.34,21.58 9.5,21.27 9.5,21C9.5,20.77 9.5,20.14 9.5,19.31C6.73,19.91 6.14,17.97 6.14,17.97C5.68,16.81 5.03,16.5 5.03,16.5C4.12,15.88 5.1,15.9 5.1,15.9C6.1,15.97 6.63,16.93 6.63,16.93C7.5,18.45 8.97,18 9.54,17.76C9.63,17.11 9.89,16.67 10.17,16.42C7.95,16.17 5.62,15.31 5.62,11.5C5.62,10.39 6,9.5 6.65,8.79C6.55,8.54 6.2,7.5 6.75,6.15C6.75,6.15 7.59,5.88 9.5,7.17C10.29,6.95 11.15,6.84 12,6.84C12.85,6.84 13.71,6.95 14.5,7.17C16.41,5.88 17.25,6.15 17.25,6.15C17.8,7.5 17.45,8.54 17.35,8.79C18,9.5 18.38,10.39 18.38,11.5C18.38,15.32 16.04,16.16 13.81,16.41C14.17,16.72 14.5,17.33 14.5,18.26C14.5,19.6 14.5,20.68 14.5,21C14.5,21.27 14.66,21.59 15.17,21.5C19.14,20.16 22,16.42 22,12A10,10 0 0,0 12,2Z"})})}renderLinks(){return(0,ti.jsxs)(eu.Fragment,{children:[(0,ti.jsx)("h6",{children:"90 day API keys"}),(0,ti.jsx)("p",{children:"API keys expire after 90 days, if a longer duration is needed please request a developer API key"}),(0,ti.jsx)(ra,{header:"Api Key",value:Ie.ApiKey}),this.renderLinksTiles()]})}validProjections(){return this.state.layers==null?this._validProjections:this.state.layers.get(Ie.map.layerId)?.projections??this._validProjections}renderLinksTiles(){if(Ie.map.isVector)return(0,ti.jsxs)(eu.Fragment,{children:[(0,ti.jsx)(ra,{header:"StyleJSON",value:Ie.map.toTileUrl("style")},"StyleJSON"),(0,ti.jsx)(ra,{header:"XYZ",value:Ie.map.toTileUrl("vector-xyz")},"XYZ")]});let r=this.validProjections(),a=[];if(r.has(fi.Nztm2000)){let u=Ie.map.toTileUrl("wmts",cs,void 0,void 0,void 0,Ie.map.filter.date);a.push((0,ti.jsx)(ra,{header:"WMTS: NZTM2000Quad",value:u},"NZTM2000Quad"))}if(r.has(fi.Google)){let u=Ie.map.toTileUrl("wmts",xi,void 0,void 0,void 0,Ie.map.filter.date),o=Ie.map.toTileUrl("raster",xi);a.push((0,ti.jsx)(ra,{header:"WMTS: WebMercatorQuad",value:u},"WebMercatorQuad")),a.push((0,ti.jsx)(ra,{header:"XYZ",value:o},"XYZ"))}return(0,ti.jsx)(eu.Fragment,{children:a})}};var uB="data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoBAAEAAwA0JaQAA3AA/vuUAAA=";function cB(){let e=document.createElement("canvas");return e.getContext&&e.getContext("2d")?e.toDataURL("image/webp").indexOf("data:image/webp")===0:!1}function hB(){let e=new Image,t=new Promise(r=>{e.onload=()=>r(!0),e.onerror=()=>r(!1)});return e.src=uB,t}function VT(){return new Promise(e=>{if(cB())return e(!0);hB().then(e)})}var Uc=Lt(zr(),1),Ux=class extends Wg.Component{render(){return(0,Uc.jsxs)(Wg.Fragment,{children:[(0,Uc.jsx)(Ug,{}),(0,Uc.jsx)(cg,{}),(0,Uc.jsx)(fg,{})]})}};document.addEventListener("DOMContentLoaded",async()=>{await await VT()&&(Gi.ImageFormat="webp"),Ie.map.updateFromUrl();let t=document.getElementById("main");if(t==null)throw new Error("Missing #main");(0,UT.createRoot)(t).render((0,Uc.jsx)(Ux,{}))});
|
|
573
|
-
/**
|
|
574
|
-
* @license React
|
|
575
|
-
* react-dom.production.min.js
|
|
576
|
-
*
|
|
577
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
578
|
-
*
|
|
579
|
-
* This source code is licensed under the MIT license found in the
|
|
580
|
-
* LICENSE file in the root directory of this source tree.
|
|
581
|
-
*/
|
|
582
|
-
/**
|
|
583
|
-
* @license React
|
|
584
|
-
* react-jsx-runtime.production.min.js
|
|
585
|
-
*
|
|
586
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
587
|
-
*
|
|
588
|
-
* This source code is licensed under the MIT license found in the
|
|
589
|
-
* LICENSE file in the root directory of this source tree.
|
|
590
|
-
*/
|
|
591
|
-
/**
|
|
592
|
-
* @license React
|
|
593
|
-
* react.production.min.js
|
|
594
|
-
*
|
|
595
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
596
|
-
*
|
|
597
|
-
* This source code is licensed under the MIT license found in the
|
|
598
|
-
* LICENSE file in the root directory of this source tree.
|
|
599
|
-
*/
|
|
600
|
-
/**
|
|
601
|
-
* @license React
|
|
602
|
-
* scheduler.production.min.js
|
|
603
|
-
*
|
|
604
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
605
|
-
*
|
|
606
|
-
* This source code is licensed under the MIT license found in the
|
|
607
|
-
* LICENSE file in the root directory of this source tree.
|
|
608
|
-
*/
|
|
609
|
-
/**
|
|
610
|
-
* splaytree v3.1.0
|
|
611
|
-
* Fast Splay tree for Node and browser
|
|
612
|
-
*
|
|
613
|
-
* @author Alexander Milevski <info@w8r.name>
|
|
614
|
-
* @license MIT
|
|
615
|
-
* @preserve
|
|
616
|
-
*/
|
|
617
|
-
/** @license React v16.13.1
|
|
618
|
-
* react-is.production.min.js
|
|
619
|
-
*
|
|
620
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
621
|
-
*
|
|
622
|
-
* This source code is licensed under the MIT license found in the
|
|
623
|
-
* LICENSE file in the root directory of this source tree.
|
|
624
|
-
*/
|