@aws/address-form-sdk-js 1.0.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.
Files changed (49) hide show
  1. package/LICENSE +175 -0
  2. package/README.md +288 -0
  3. package/dist/lib/address-form-sdk-js.css +1 -0
  4. package/dist/lib/address-form-sdk.cjs.js +1 -0
  5. package/dist/lib/components/AddressForm/form-field.d.ts +12 -0
  6. package/dist/lib/components/AddressForm/index.d.ts +47 -0
  7. package/dist/lib/components/AddressFormReact/AddressForm.d.ts +36 -0
  8. package/dist/lib/components/AddressFormReact/AddressFormAddressField.d.ts +11 -0
  9. package/dist/lib/components/AddressFormReact/AddressFormContext.d.ts +22 -0
  10. package/dist/lib/components/AddressFormReact/AddressFormCountryField.d.ts +8 -0
  11. package/dist/lib/components/AddressFormReact/AddressFormFields.d.ts +5 -0
  12. package/dist/lib/components/AddressFormReact/AddressFormMap.d.ts +5 -0
  13. package/dist/lib/components/AddressFormReact/AddressFormProvider.d.ts +12 -0
  14. package/dist/lib/components/AddressFormReact/AddressFormTextField.d.ts +8 -0
  15. package/dist/lib/components/AddressFormReact/index.d.ts +1 -0
  16. package/dist/lib/components/AddressFormReact/render.d.ts +18 -0
  17. package/dist/lib/components/AddressFormReact/utils.d.ts +2 -0
  18. package/dist/lib/components/AmazonLocationProvider/index.d.ts +9 -0
  19. package/dist/lib/components/Button/index.d.ts +7 -0
  20. package/dist/lib/components/ComponentInjector/index.d.ts +17 -0
  21. package/dist/lib/components/CountrySelect/index.d.ts +18 -0
  22. package/dist/lib/components/Flex/index.d.ts +7 -0
  23. package/dist/lib/components/FormField/index.d.ts +7 -0
  24. package/dist/lib/components/Input/index.d.ts +6 -0
  25. package/dist/lib/components/LocateButton/index.d.ts +8 -0
  26. package/dist/lib/components/Map/index.d.ts +11 -0
  27. package/dist/lib/components/Map/utils.d.ts +3 -0
  28. package/dist/lib/components/MapMarker/index.d.ts +6 -0
  29. package/dist/lib/components/Typeahead/index.d.ts +21 -0
  30. package/dist/lib/components/Typeahead/use-typeahead-query.d.ts +14 -0
  31. package/dist/lib/context/amazon-location-context.d.ts +7 -0
  32. package/dist/lib/data/countries.d.ts +6 -0
  33. package/dist/lib/hooks/use-amazon-location-context.d.ts +6 -0
  34. package/dist/lib/icons/Locate.d.ts +1 -0
  35. package/dist/lib/icons/Logo.d.ts +6 -0
  36. package/dist/lib/main.d.ts +18 -0
  37. package/dist/lib/setup-tests.d.ts +0 -0
  38. package/dist/lib/test/utils.d.ts +3 -0
  39. package/dist/lib/types/config.d.ts +5 -0
  40. package/dist/lib/utils/api.d.ts +8 -0
  41. package/dist/lib/utils/country-filter.d.ts +1 -0
  42. package/dist/lib/utils/debounce.d.ts +1 -0
  43. package/dist/lib/utils/position.d.ts +1 -0
  44. package/dist/lib/utils/queries.d.ts +17 -0
  45. package/dist/lib/utils/query-client.d.ts +2 -0
  46. package/dist/lib/utils/replace-child-elements.d.ts +7 -0
  47. package/dist/standalone/address-form-sdk.css +1 -0
  48. package/dist/standalone/address-form-sdk.umd.js +886 -0
  49. package/package.json +89 -0
@@ -0,0 +1,886 @@
1
+ (function(Wn,ti){typeof exports=="object"&&typeof module<"u"?ti(exports):typeof define=="function"&&define.amd?define(["exports"],ti):(Wn=typeof globalThis<"u"?globalThis:Wn||self,ti(Wn.AddressFormSDK={}))})(this,(function(Wn){"use strict";var iA=Object.defineProperty;var ix=Wn=>{throw TypeError(Wn)};var rA=(Wn,ti,lr)=>ti in Wn?iA(Wn,ti,{enumerable:!0,configurable:!0,writable:!0,value:lr}):Wn[ti]=lr;var st=(Wn,ti,lr)=>rA(Wn,typeof ti!="symbol"?ti+"":ti,lr),p_=(Wn,ti,lr)=>ti.has(Wn)||ix("Cannot "+lr);var Re=(Wn,ti,lr)=>(p_(Wn,ti,"read from private field"),lr?lr.call(Wn):ti.get(Wn)),an=(Wn,ti,lr)=>ti.has(Wn)?ix("Cannot add the same private member more than once"):ti instanceof WeakSet?ti.add(Wn):ti.set(Wn,lr),Ft=(Wn,ti,lr,oh)=>(p_(Wn,ti,"write to private field"),oh?oh.call(Wn,lr):ti.set(Wn,lr),lr),qn=(Wn,ti,lr)=>(p_(Wn,ti,"access private method"),lr);var s2=(Wn,ti,lr,oh)=>({set _(md){Ft(Wn,ti,md,lr)},get _(){return Re(Wn,ti,oh)}});var _h,Wy,H5,Fd,vh,gp,X5,yp,xh,_p,Y5,Nd,Q5,Ud,vp,Io,$d,Xr,cm,Vd,xl,sh,W5,ws,Vn,um,ts,jd,xp,cu,bh,hm,bp,wp,Zd,Gd,wh,Sp,fi,pg,m_,g_,y_,__,v_,x_,b_,rx,K5,dm,yc,ns,qd,_c,pd,J5,uu,bl,fm,ex,vc,tx,cr,Sh,Ch,Cp,Tp,Th,Ep,Mp,nx;function ti(n,l){for(var h=0;h<l.length;h++){const m=l[h];if(typeof m!="string"&&!Array.isArray(m)){for(const w in m)if(w!=="default"&&!(w in n)){const E=Object.getOwnPropertyDescriptor(m,w);E&&Object.defineProperty(n,w,E.get?E:{enumerable:!0,get:()=>m[w]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}function lr(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var oh={exports:{}},md={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var w_;function ox(){if(w_)return md;w_=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function h(m,w,E){var C=null;if(E!==void 0&&(C=""+E),w.key!==void 0&&(C=""+w.key),"key"in w){E={};for(var c in w)c!=="key"&&(E[c]=w[c])}else E=w;return w=E.ref,{$$typeof:n,type:m,key:C,ref:w!==void 0?w:null,props:E}}return md.Fragment=l,md.jsx=h,md.jsxs=h,md}var S_;function lx(){return S_||(S_=1,oh.exports=ox()),oh.exports}var gt=lx(),o2={exports:{}},pn={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var C_;function cx(){if(C_)return pn;C_=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),C=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),B=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),X=Symbol.for("react.activity"),Y=Symbol.iterator;function U(we){return we===null||typeof we!="object"?null:(we=Y&&we[Y]||we["@@iterator"],typeof we=="function"?we:null)}var oe={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ge=Object.assign,ye={};function Se(we,Be,pt){this.props=we,this.context=Be,this.refs=ye,this.updater=pt||oe}Se.prototype.isReactComponent={},Se.prototype.setState=function(we,Be){if(typeof we!="object"&&typeof we!="function"&&we!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,we,Be,"setState")},Se.prototype.forceUpdate=function(we){this.updater.enqueueForceUpdate(this,we,"forceUpdate")};function je(){}je.prototype=Se.prototype;function Pe(we,Be,pt){this.props=we,this.context=Be,this.refs=ye,this.updater=pt||oe}var Oe=Pe.prototype=new je;Oe.constructor=Pe,ge(Oe,Se.prototype),Oe.isPureReactComponent=!0;var Je=Array.isArray;function et(){}var ot={H:null,A:null,T:null,S:null},Rt=Object.prototype.hasOwnProperty;function Gt(we,Be,pt){var xt=pt.ref;return{$$typeof:n,type:we,key:Be,ref:xt!==void 0?xt:null,props:pt}}function Tt(we,Be){return Gt(we.type,Be,we.props)}function Ot(we){return typeof we=="object"&&we!==null&&we.$$typeof===n}function At(we){var Be={"=":"=0",":":"=2"};return"$"+we.replace(/[=:]/g,function(pt){return Be[pt]})}var Qt=/\/+/g;function sn(we,Be){return typeof we=="object"&&we!==null&&we.key!=null?At(""+we.key):Be.toString(36)}function qt(we){switch(we.status){case"fulfilled":return we.value;case"rejected":throw we.reason;default:switch(typeof we.status=="string"?we.then(et,et):(we.status="pending",we.then(function(Be){we.status==="pending"&&(we.status="fulfilled",we.value=Be)},function(Be){we.status==="pending"&&(we.status="rejected",we.reason=Be)})),we.status){case"fulfilled":return we.value;case"rejected":throw we.reason}}throw we}function $e(we,Be,pt,xt,Bt){var Lt=typeof we;(Lt==="undefined"||Lt==="boolean")&&(we=null);var Wt=!1;if(we===null)Wt=!0;else switch(Lt){case"bigint":case"string":case"number":Wt=!0;break;case"object":switch(we.$$typeof){case n:case l:Wt=!0;break;case Z:return Wt=we._init,$e(Wt(we._payload),Be,pt,xt,Bt)}}if(Wt)return Bt=Bt(we),Wt=xt===""?"."+sn(we,0):xt,Je(Bt)?(pt="",Wt!=null&&(pt=Wt.replace(Qt,"$&/")+"/"),$e(Bt,Be,pt,"",function(ka){return ka})):Bt!=null&&(Ot(Bt)&&(Bt=Tt(Bt,pt+(Bt.key==null||we&&we.key===Bt.key?"":(""+Bt.key).replace(Qt,"$&/")+"/")+Wt)),Be.push(Bt)),1;Wt=0;var Ht=xt===""?".":xt+":";if(Je(we))for(var xn=0;xn<we.length;xn++)xt=we[xn],Lt=Ht+sn(xt,xn),Wt+=$e(xt,Be,pt,Lt,Bt);else if(xn=U(we),typeof xn=="function")for(we=xn.call(we),xn=0;!(xt=we.next()).done;)xt=xt.value,Lt=Ht+sn(xt,xn++),Wt+=$e(xt,Be,pt,Lt,Bt);else if(Lt==="object"){if(typeof we.then=="function")return $e(qt(we),Be,pt,xt,Bt);throw Be=String(we),Error("Objects are not valid as a React child (found: "+(Be==="[object Object]"?"object with keys {"+Object.keys(we).join(", ")+"}":Be)+"). If you meant to render a collection of children, use an array instead.")}return Wt}function ft(we,Be,pt){if(we==null)return we;var xt=[],Bt=0;return $e(we,xt,"","",function(Lt){return Be.call(pt,Lt,Bt++)}),xt}function wt(we){if(we._status===-1){var Be=we._result;Be=Be(),Be.then(function(pt){(we._status===0||we._status===-1)&&(we._status=1,we._result=pt)},function(pt){(we._status===0||we._status===-1)&&(we._status=2,we._result=pt)}),we._status===-1&&(we._status=0,we._result=Be)}if(we._status===1)return we._result.default;throw we._result}var St=typeof reportError=="function"?reportError:function(we){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Be=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof we=="object"&&we!==null&&typeof we.message=="string"?String(we.message):String(we),error:we});if(!window.dispatchEvent(Be))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",we);return}console.error(we)},Zt={map:ft,forEach:function(we,Be,pt){ft(we,function(){Be.apply(this,arguments)},pt)},count:function(we){var Be=0;return ft(we,function(){Be++}),Be},toArray:function(we){return ft(we,function(Be){return Be})||[]},only:function(we){if(!Ot(we))throw Error("React.Children.only expected to receive a single React element child.");return we}};return pn.Activity=X,pn.Children=Zt,pn.Component=Se,pn.Fragment=h,pn.Profiler=w,pn.PureComponent=Pe,pn.StrictMode=m,pn.Suspense=D,pn.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ot,pn.__COMPILER_RUNTIME={__proto__:null,c:function(we){return ot.H.useMemoCache(we)}},pn.cache=function(we){return function(){return we.apply(null,arguments)}},pn.cacheSignal=function(){return null},pn.cloneElement=function(we,Be,pt){if(we==null)throw Error("The argument must be a React element, but you passed "+we+".");var xt=ge({},we.props),Bt=we.key;if(Be!=null)for(Lt in Be.key!==void 0&&(Bt=""+Be.key),Be)!Rt.call(Be,Lt)||Lt==="key"||Lt==="__self"||Lt==="__source"||Lt==="ref"&&Be.ref===void 0||(xt[Lt]=Be[Lt]);var Lt=arguments.length-2;if(Lt===1)xt.children=pt;else if(1<Lt){for(var Wt=Array(Lt),Ht=0;Ht<Lt;Ht++)Wt[Ht]=arguments[Ht+2];xt.children=Wt}return Gt(we.type,Bt,xt)},pn.createContext=function(we){return we={$$typeof:C,_currentValue:we,_currentValue2:we,_threadCount:0,Provider:null,Consumer:null},we.Provider=we,we.Consumer={$$typeof:E,_context:we},we},pn.createElement=function(we,Be,pt){var xt,Bt={},Lt=null;if(Be!=null)for(xt in Be.key!==void 0&&(Lt=""+Be.key),Be)Rt.call(Be,xt)&&xt!=="key"&&xt!=="__self"&&xt!=="__source"&&(Bt[xt]=Be[xt]);var Wt=arguments.length-2;if(Wt===1)Bt.children=pt;else if(1<Wt){for(var Ht=Array(Wt),xn=0;xn<Wt;xn++)Ht[xn]=arguments[xn+2];Bt.children=Ht}if(we&&we.defaultProps)for(xt in Wt=we.defaultProps,Wt)Bt[xt]===void 0&&(Bt[xt]=Wt[xt]);return Gt(we,Lt,Bt)},pn.createRef=function(){return{current:null}},pn.forwardRef=function(we){return{$$typeof:c,render:we}},pn.isValidElement=Ot,pn.lazy=function(we){return{$$typeof:Z,_payload:{_status:-1,_result:we},_init:wt}},pn.memo=function(we,Be){return{$$typeof:B,type:we,compare:Be===void 0?null:Be}},pn.startTransition=function(we){var Be=ot.T,pt={};ot.T=pt;try{var xt=we(),Bt=ot.S;Bt!==null&&Bt(pt,xt),typeof xt=="object"&&xt!==null&&typeof xt.then=="function"&&xt.then(et,St)}catch(Lt){St(Lt)}finally{Be!==null&&pt.types!==null&&(Be.types=pt.types),ot.T=Be}},pn.unstable_useCacheRefresh=function(){return ot.H.useCacheRefresh()},pn.use=function(we){return ot.H.use(we)},pn.useActionState=function(we,Be,pt){return ot.H.useActionState(we,Be,pt)},pn.useCallback=function(we,Be){return ot.H.useCallback(we,Be)},pn.useContext=function(we){return ot.H.useContext(we)},pn.useDebugValue=function(){},pn.useDeferredValue=function(we,Be){return ot.H.useDeferredValue(we,Be)},pn.useEffect=function(we,Be){return ot.H.useEffect(we,Be)},pn.useEffectEvent=function(we){return ot.H.useEffectEvent(we)},pn.useId=function(){return ot.H.useId()},pn.useImperativeHandle=function(we,Be,pt){return ot.H.useImperativeHandle(we,Be,pt)},pn.useInsertionEffect=function(we,Be){return ot.H.useInsertionEffect(we,Be)},pn.useLayoutEffect=function(we,Be){return ot.H.useLayoutEffect(we,Be)},pn.useMemo=function(we,Be){return ot.H.useMemo(we,Be)},pn.useOptimistic=function(we,Be){return ot.H.useOptimistic(we,Be)},pn.useReducer=function(we,Be,pt){return ot.H.useReducer(we,Be,pt)},pn.useRef=function(we){return ot.H.useRef(we)},pn.useState=function(we){return ot.H.useState(we)},pn.useSyncExternalStore=function(we,Be,pt){return ot.H.useSyncExternalStore(we,Be,pt)},pn.useTransition=function(){return ot.H.useTransition()},pn.version="19.2.0",pn}var T_;function mg(){return T_||(T_=1,o2.exports=cx()),o2.exports}var te=mg();const Fn=lr(te),ux=ti({__proto__:null,default:Fn},[te]);var l2={exports:{}},C1={},c2={exports:{}},u2={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var E_;function hx(){return E_||(E_=1,(function(n){function l($e,ft){var wt=$e.length;$e.push(ft);e:for(;0<wt;){var St=wt-1>>>1,Zt=$e[St];if(0<w(Zt,ft))$e[St]=ft,$e[wt]=Zt,wt=St;else break e}}function h($e){return $e.length===0?null:$e[0]}function m($e){if($e.length===0)return null;var ft=$e[0],wt=$e.pop();if(wt!==ft){$e[0]=wt;e:for(var St=0,Zt=$e.length,we=Zt>>>1;St<we;){var Be=2*(St+1)-1,pt=$e[Be],xt=Be+1,Bt=$e[xt];if(0>w(pt,wt))xt<Zt&&0>w(Bt,pt)?($e[St]=Bt,$e[xt]=wt,St=xt):($e[St]=pt,$e[Be]=wt,St=Be);else if(xt<Zt&&0>w(Bt,wt))$e[St]=Bt,$e[xt]=wt,St=xt;else break e}}return ft}function w($e,ft){var wt=$e.sortIndex-ft.sortIndex;return wt!==0?wt:$e.id-ft.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var E=performance;n.unstable_now=function(){return E.now()}}else{var C=Date,c=C.now();n.unstable_now=function(){return C.now()-c}}var D=[],B=[],Z=1,X=null,Y=3,U=!1,oe=!1,ge=!1,ye=!1,Se=typeof setTimeout=="function"?setTimeout:null,je=typeof clearTimeout=="function"?clearTimeout:null,Pe=typeof setImmediate<"u"?setImmediate:null;function Oe($e){for(var ft=h(B);ft!==null;){if(ft.callback===null)m(B);else if(ft.startTime<=$e)m(B),ft.sortIndex=ft.expirationTime,l(D,ft);else break;ft=h(B)}}function Je($e){if(ge=!1,Oe($e),!oe)if(h(D)!==null)oe=!0,et||(et=!0,At());else{var ft=h(B);ft!==null&&qt(Je,ft.startTime-$e)}}var et=!1,ot=-1,Rt=5,Gt=-1;function Tt(){return ye?!0:!(n.unstable_now()-Gt<Rt)}function Ot(){if(ye=!1,et){var $e=n.unstable_now();Gt=$e;var ft=!0;try{e:{oe=!1,ge&&(ge=!1,je(ot),ot=-1),U=!0;var wt=Y;try{t:{for(Oe($e),X=h(D);X!==null&&!(X.expirationTime>$e&&Tt());){var St=X.callback;if(typeof St=="function"){X.callback=null,Y=X.priorityLevel;var Zt=St(X.expirationTime<=$e);if($e=n.unstable_now(),typeof Zt=="function"){X.callback=Zt,Oe($e),ft=!0;break t}X===h(D)&&m(D),Oe($e)}else m(D);X=h(D)}if(X!==null)ft=!0;else{var we=h(B);we!==null&&qt(Je,we.startTime-$e),ft=!1}}break e}finally{X=null,Y=wt,U=!1}ft=void 0}}finally{ft?At():et=!1}}}var At;if(typeof Pe=="function")At=function(){Pe(Ot)};else if(typeof MessageChannel<"u"){var Qt=new MessageChannel,sn=Qt.port2;Qt.port1.onmessage=Ot,At=function(){sn.postMessage(null)}}else At=function(){Se(Ot,0)};function qt($e,ft){ot=Se(function(){$e(n.unstable_now())},ft)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function($e){$e.callback=null},n.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"):Rt=0<$e?Math.floor(1e3/$e):5},n.unstable_getCurrentPriorityLevel=function(){return Y},n.unstable_next=function($e){switch(Y){case 1:case 2:case 3:var ft=3;break;default:ft=Y}var wt=Y;Y=ft;try{return $e()}finally{Y=wt}},n.unstable_requestPaint=function(){ye=!0},n.unstable_runWithPriority=function($e,ft){switch($e){case 1:case 2:case 3:case 4:case 5:break;default:$e=3}var wt=Y;Y=$e;try{return ft()}finally{Y=wt}},n.unstable_scheduleCallback=function($e,ft,wt){var St=n.unstable_now();switch(typeof wt=="object"&&wt!==null?(wt=wt.delay,wt=typeof wt=="number"&&0<wt?St+wt:St):wt=St,$e){case 1:var Zt=-1;break;case 2:Zt=250;break;case 5:Zt=1073741823;break;case 4:Zt=1e4;break;default:Zt=5e3}return Zt=wt+Zt,$e={id:Z++,callback:ft,priorityLevel:$e,startTime:wt,expirationTime:Zt,sortIndex:-1},wt>St?($e.sortIndex=wt,l(B,$e),h(D)===null&&$e===h(B)&&(ge?(je(ot),ot=-1):ge=!0,qt(Je,wt-St))):($e.sortIndex=Zt,l(D,$e),oe||U||(oe=!0,et||(et=!0,At()))),$e},n.unstable_shouldYield=Tt,n.unstable_wrapCallback=function($e){var ft=Y;return function(){var wt=Y;Y=ft;try{return $e.apply(this,arguments)}finally{Y=wt}}}})(u2)),u2}var M_;function dx(){return M_||(M_=1,c2.exports=hx()),c2.exports}var h2={exports:{}},Ra={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var A_;function fx(){if(A_)return Ra;A_=1;var n=mg();function l(D){var B="https://react.dev/errors/"+D;if(1<arguments.length){B+="?args[]="+encodeURIComponent(arguments[1]);for(var Z=2;Z<arguments.length;Z++)B+="&args[]="+encodeURIComponent(arguments[Z])}return"Minified React error #"+D+"; visit "+B+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function h(){}var m={d:{f:h,r:function(){throw Error(l(522))},D:h,C:h,L:h,m:h,X:h,S:h,M:h},p:0,findDOMNode:null},w=Symbol.for("react.portal");function E(D,B,Z){var X=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:w,key:X==null?null:""+X,children:D,containerInfo:B,implementation:Z}}var C=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(D,B){if(D==="font")return"";if(typeof B=="string")return B==="use-credentials"?B:""}return Ra.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=m,Ra.createPortal=function(D,B){var Z=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!B||B.nodeType!==1&&B.nodeType!==9&&B.nodeType!==11)throw Error(l(299));return E(D,B,null,Z)},Ra.flushSync=function(D){var B=C.T,Z=m.p;try{if(C.T=null,m.p=2,D)return D()}finally{C.T=B,m.p=Z,m.d.f()}},Ra.preconnect=function(D,B){typeof D=="string"&&(B?(B=B.crossOrigin,B=typeof B=="string"?B==="use-credentials"?B:"":void 0):B=null,m.d.C(D,B))},Ra.prefetchDNS=function(D){typeof D=="string"&&m.d.D(D)},Ra.preinit=function(D,B){if(typeof D=="string"&&B&&typeof B.as=="string"){var Z=B.as,X=c(Z,B.crossOrigin),Y=typeof B.integrity=="string"?B.integrity:void 0,U=typeof B.fetchPriority=="string"?B.fetchPriority:void 0;Z==="style"?m.d.S(D,typeof B.precedence=="string"?B.precedence:void 0,{crossOrigin:X,integrity:Y,fetchPriority:U}):Z==="script"&&m.d.X(D,{crossOrigin:X,integrity:Y,fetchPriority:U,nonce:typeof B.nonce=="string"?B.nonce:void 0})}},Ra.preinitModule=function(D,B){if(typeof D=="string")if(typeof B=="object"&&B!==null){if(B.as==null||B.as==="script"){var Z=c(B.as,B.crossOrigin);m.d.M(D,{crossOrigin:Z,integrity:typeof B.integrity=="string"?B.integrity:void 0,nonce:typeof B.nonce=="string"?B.nonce:void 0})}}else B==null&&m.d.M(D)},Ra.preload=function(D,B){if(typeof D=="string"&&typeof B=="object"&&B!==null&&typeof B.as=="string"){var Z=B.as,X=c(Z,B.crossOrigin);m.d.L(D,Z,{crossOrigin:X,integrity:typeof B.integrity=="string"?B.integrity:void 0,nonce:typeof B.nonce=="string"?B.nonce:void 0,type:typeof B.type=="string"?B.type:void 0,fetchPriority:typeof B.fetchPriority=="string"?B.fetchPriority:void 0,referrerPolicy:typeof B.referrerPolicy=="string"?B.referrerPolicy:void 0,imageSrcSet:typeof B.imageSrcSet=="string"?B.imageSrcSet:void 0,imageSizes:typeof B.imageSizes=="string"?B.imageSizes:void 0,media:typeof B.media=="string"?B.media:void 0})}},Ra.preloadModule=function(D,B){if(typeof D=="string")if(B){var Z=c(B.as,B.crossOrigin);m.d.m(D,{as:typeof B.as=="string"&&B.as!=="script"?B.as:void 0,crossOrigin:Z,integrity:typeof B.integrity=="string"?B.integrity:void 0})}else m.d.m(D)},Ra.requestFormReset=function(D){m.d.r(D)},Ra.unstable_batchedUpdates=function(D,B){return D(B)},Ra.useFormState=function(D,B,Z){return C.H.useFormState(D,B,Z)},Ra.useFormStatus=function(){return C.H.useHostTransitionStatus()},Ra.version="19.2.0",Ra}var L_;function P_(){if(L_)return h2.exports;L_=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),h2.exports=fx(),h2.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var R_;function px(){if(R_)return C1;R_=1;var n=dx(),l=mg(),h=P_();function m(i){var o="https://react.dev/errors/"+i;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var f=2;f<arguments.length;f++)o+="&args[]="+encodeURIComponent(arguments[f])}return"Minified React error #"+i+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function w(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function E(i){var o=i,f=i;if(i.alternate)for(;o.return;)o=o.return;else{i=o;do o=i,(o.flags&4098)!==0&&(f=o.return),i=o.return;while(i)}return o.tag===3?f:null}function C(i){if(i.tag===13){var o=i.memoizedState;if(o===null&&(i=i.alternate,i!==null&&(o=i.memoizedState)),o!==null)return o.dehydrated}return null}function c(i){if(i.tag===31){var o=i.memoizedState;if(o===null&&(i=i.alternate,i!==null&&(o=i.memoizedState)),o!==null)return o.dehydrated}return null}function D(i){if(E(i)!==i)throw Error(m(188))}function B(i){var o=i.alternate;if(!o){if(o=E(i),o===null)throw Error(m(188));return o!==i?null:i}for(var f=i,v=o;;){var A=f.return;if(A===null)break;var R=A.alternate;if(R===null){if(v=A.return,v!==null){f=v;continue}break}if(A.child===R.child){for(R=A.child;R;){if(R===f)return D(A),i;if(R===v)return D(A),o;R=R.sibling}throw Error(m(188))}if(f.return!==v.return)f=A,v=R;else{for(var V=!1,ee=A.child;ee;){if(ee===f){V=!0,f=A,v=R;break}if(ee===v){V=!0,v=A,f=R;break}ee=ee.sibling}if(!V){for(ee=R.child;ee;){if(ee===f){V=!0,f=R,v=A;break}if(ee===v){V=!0,v=R,f=A;break}ee=ee.sibling}if(!V)throw Error(m(189))}}if(f.alternate!==v)throw Error(m(190))}if(f.tag!==3)throw Error(m(188));return f.stateNode.current===f?i:o}function Z(i){var o=i.tag;if(o===5||o===26||o===27||o===6)return i;for(i=i.child;i!==null;){if(o=Z(i),o!==null)return o;i=i.sibling}return null}var X=Object.assign,Y=Symbol.for("react.element"),U=Symbol.for("react.transitional.element"),oe=Symbol.for("react.portal"),ge=Symbol.for("react.fragment"),ye=Symbol.for("react.strict_mode"),Se=Symbol.for("react.profiler"),je=Symbol.for("react.consumer"),Pe=Symbol.for("react.context"),Oe=Symbol.for("react.forward_ref"),Je=Symbol.for("react.suspense"),et=Symbol.for("react.suspense_list"),ot=Symbol.for("react.memo"),Rt=Symbol.for("react.lazy"),Gt=Symbol.for("react.activity"),Tt=Symbol.for("react.memo_cache_sentinel"),Ot=Symbol.iterator;function At(i){return i===null||typeof i!="object"?null:(i=Ot&&i[Ot]||i["@@iterator"],typeof i=="function"?i:null)}var Qt=Symbol.for("react.client.reference");function sn(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===Qt?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case ge:return"Fragment";case Se:return"Profiler";case ye:return"StrictMode";case Je:return"Suspense";case et:return"SuspenseList";case Gt:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case oe:return"Portal";case Pe:return i.displayName||"Context";case je:return(i._context.displayName||"Context")+".Consumer";case Oe:var o=i.render;return i=i.displayName,i||(i=o.displayName||o.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case ot:return o=i.displayName||null,o!==null?o:sn(i.type)||"Memo";case Rt:o=i._payload,i=i._init;try{return sn(i(o))}catch{}}return null}var qt=Array.isArray,$e=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ft=h.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,wt={pending:!1,data:null,method:null,action:null},St=[],Zt=-1;function we(i){return{current:i}}function Be(i){0>Zt||(i.current=St[Zt],St[Zt]=null,Zt--)}function pt(i,o){Zt++,St[Zt]=i.current,i.current=o}var xt=we(null),Bt=we(null),Lt=we(null),Wt=we(null);function Ht(i,o){switch(pt(Lt,o),pt(Bt,i),pt(xt,null),o.nodeType){case 9:case 11:i=(i=o.documentElement)&&(i=i.namespaceURI)?rg(i):0;break;default:if(i=o.tagName,o=o.namespaceURI)o=rg(o),i=rc(o,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}Be(xt),pt(xt,i)}function xn(){Be(xt),Be(Bt),Be(Lt)}function ka(i){i.memoizedState!==null&&pt(Wt,i);var o=xt.current,f=rc(o,i.type);o!==f&&(pt(Bt,i),pt(xt,f))}function ai(i){Bt.current===i&&(Be(xt),Be(Bt)),Wt.current===i&&(Be(Wt),qe._currentValue=wt)}var kr,Mi;function si(i){if(kr===void 0)try{throw Error()}catch(f){var o=f.stack.trim().match(/\n( *(at )?)/);kr=o&&o[1]||"",Mi=-1<f.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<f.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+kr+i+Mi}var ca=!1;function Ba(i,o){if(!i||ca)return"";ca=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var v={DetermineComponentFrameRoot:function(){try{if(o){var at=function(){throw Error()};if(Object.defineProperty(at.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(at,[])}catch(Ye){var He=Ye}Reflect.construct(i,[],at)}else{try{at.call()}catch(Ye){He=Ye}i.call(at.prototype)}}else{try{throw Error()}catch(Ye){He=Ye}(at=i())&&typeof at.catch=="function"&&at.catch(function(){})}}catch(Ye){if(Ye&&He&&typeof Ye.stack=="string")return[Ye.stack,He.stack]}return[null,null]}};v.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var A=Object.getOwnPropertyDescriptor(v.DetermineComponentFrameRoot,"name");A&&A.configurable&&Object.defineProperty(v.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var R=v.DetermineComponentFrameRoot(),V=R[0],ee=R[1];if(V&&ee){var xe=V.split(`
44
+ `),Ge=ee.split(`
45
+ `);for(A=v=0;v<xe.length&&!xe[v].includes("DetermineComponentFrameRoot");)v++;for(;A<Ge.length&&!Ge[A].includes("DetermineComponentFrameRoot");)A++;if(v===xe.length||A===Ge.length)for(v=xe.length-1,A=Ge.length-1;1<=v&&0<=A&&xe[v]!==Ge[A];)A--;for(;1<=v&&0<=A;v--,A--)if(xe[v]!==Ge[A]){if(v!==1||A!==1)do if(v--,A--,0>A||xe[v]!==Ge[A]){var Ke=`
46
+ `+xe[v].replace(" at new "," at ");return i.displayName&&Ke.includes("<anonymous>")&&(Ke=Ke.replace("<anonymous>",i.displayName)),Ke}while(1<=v&&0<=A);break}}}finally{ca=!1,Error.prepareStackTrace=f}return(f=i?i.displayName||i.name:"")?si(f):""}function wl(i,o){switch(i.tag){case 26:case 27:case 5:return si(i.type);case 16:return si("Lazy");case 13:return i.child!==o&&o!==null?si("Suspense Fallback"):si("Suspense");case 19:return si("SuspenseList");case 0:case 15:return Ba(i.type,!1);case 11:return Ba(i.type.render,!1);case 1:return Ba(i.type,!0);case 31:return si("Activity");default:return""}}function zo(i){try{var o="",f=null;do o+=wl(i,f),f=i,i=i.return;while(i);return o}catch(v){return`
47
+ Error generating stack: `+v.message+`
48
+ `+v.stack}}var Br=Object.prototype.hasOwnProperty,Do=n.unstable_scheduleCallback,Sl=n.unstable_cancelCallback,Oo=n.unstable_shouldYield,Ss=n.unstable_requestPaint,Ji=n.unstable_now,hu=n.unstable_getCurrentPriorityLevel,ua=n.unstable_ImmediatePriority,Hs=n.unstable_UserBlockingPriority,Fr=n.unstable_NormalPriority,Ce=n.unstable_LowPriority,Q=n.unstable_IdlePriority,W=n.log,ie=n.unstable_setDisableYieldValue,he=null,me=null;function Te(i){if(typeof W=="function"&&ie(i),me&&typeof me.setStrictMode=="function")try{me.setStrictMode(he,i)}catch{}}var De=Math.clz32?Math.clz32:ct,Le=Math.log,Xe=Math.LN2;function ct(i){return i>>>=0,i===0?32:31-(Le(i)/Xe|0)|0}var Qe=256,Pt=262144,Ut=4194304;function Ie(i){var o=i&42;if(o!==0)return o;switch(i&-i){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function mn(i,o,f){var v=i.pendingLanes;if(v===0)return 0;var A=0,R=i.suspendedLanes,V=i.pingedLanes;i=i.warmLanes;var ee=v&134217727;return ee!==0?(v=ee&~R,v!==0?A=Ie(v):(V&=ee,V!==0?A=Ie(V):f||(f=ee&~i,f!==0&&(A=Ie(f))))):(ee=v&~R,ee!==0?A=Ie(ee):V!==0?A=Ie(V):f||(f=v&~i,f!==0&&(A=Ie(f)))),A===0?0:o!==0&&o!==A&&(o&R)===0&&(R=A&-A,f=o&-o,R>=f||R===32&&(f&4194048)!==0)?o:A}function En(i,o){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&o)===0}function Dt(i,o){switch(i){case 1:case 2:case 4:case 8:case 64:return o+250;case 16:case 32: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 o+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Sn(){var i=Ut;return Ut<<=1,(Ut&62914560)===0&&(Ut=4194304),i}function Ni(i){for(var o=[],f=0;31>f;f++)o.push(i);return o}function Ai(i,o){i.pendingLanes|=o,o!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function Zi(i,o,f,v,A,R){var V=i.pendingLanes;i.pendingLanes=f,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=f,i.entangledLanes&=f,i.errorRecoveryDisabledLanes&=f,i.shellSuspendCounter=0;var ee=i.entanglements,xe=i.expirationTimes,Ge=i.hiddenUpdates;for(f=V&~f;0<f;){var Ke=31-De(f),at=1<<Ke;ee[Ke]=0,xe[Ke]=-1;var He=Ge[Ke];if(He!==null)for(Ge[Ke]=null,Ke=0;Ke<He.length;Ke++){var Ye=He[Ke];Ye!==null&&(Ye.lane&=-536870913)}f&=~at}v!==0&&ur(i,v,0),R!==0&&A===0&&i.tag!==0&&(i.suspendedLanes|=R&~(V&~o))}function ur(i,o,f){i.pendingLanes|=o,i.suspendedLanes&=~o;var v=31-De(o);i.entangledLanes|=o,i.entanglements[v]=i.entanglements[v]|1073741824|f&261930}function Kn(i,o){var f=i.entangledLanes|=o;for(i=i.entanglements;f;){var v=31-De(f),A=1<<v;A&o|i[v]&o&&(i[v]|=o),f&=~A}}function Gi(i,o){var f=o&-o;return f=(f&42)!==0?1:On(f),(f&(i.suspendedLanes|o))!==0?0:f}function On(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=16;break;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:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function rt(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function is(){var i=ft.p;return i!==0?i:(i=window.event,i===void 0?32:Er(i.type))}function Yr(i,o){var f=ft.p;try{return ft.p=i,o()}finally{ft.p=f}}var qi=Math.random().toString(36).slice(2),An="__reactFiber$"+qi,ut="__reactProps$"+qi,on="__reactContainer$"+qi,cn="__reactEvents$"+qi,ha="__reactListeners$"+qi,Cs="__reactHandles$"+qi,rs="__reactResources$"+qi,rn="__reactMarker$"+qi;function ko(i){delete i[An],delete i[ut],delete i[cn],delete i[ha],delete i[Cs]}function Ts(i){var o=i[An];if(o)return o;for(var f=i.parentNode;f;){if(o=f[on]||f[An]){if(f=o.alternate,o.child!==null||f!==null&&f.child!==null)for(i=b1(i);i!==null;){if(f=i[An])return f;i=b1(i)}return o}i=f,f=i.parentNode}return null}function Fa(i){if(i=i[An]||i[on]){var o=i.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return i}return null}function Xs(i){var o=i.tag;if(o===5||o===26||o===27||o===6)return i.stateNode;throw Error(m(33))}function Qr(i){var o=i[rs];return o||(o=i[rs]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function bi(i){i[rn]=!0}var Pi=new Set,Wr={};function jn(i,o){Es(i,o),Es(i+"Capture",o)}function Es(i,o){for(Wr[i]=o,i=0;i<o.length;i++)Pi.add(o[i])}var xc=RegExp("^[: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]*$"),Mh={},Bo={};function Ys(i){return Br.call(Bo,i)?!0:Br.call(Mh,i)?!1:xc.test(i)?Bo[i]=!0:(Mh[i]=!0,!1)}function du(i,o,f){if(Ys(o))if(f===null)i.removeAttribute(o);else{switch(typeof f){case"undefined":case"function":case"symbol":i.removeAttribute(o);return;case"boolean":var v=o.toLowerCase().slice(0,5);if(v!=="data-"&&v!=="aria-"){i.removeAttribute(o);return}}i.setAttribute(o,""+f)}}function bc(i,o,f){if(f===null)i.removeAttribute(o);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(o);return}i.setAttribute(o,""+f)}}function Ms(i,o,f,v){if(v===null)i.removeAttribute(f);else{switch(typeof v){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(f);return}i.setAttributeNS(o,f,""+v)}}function br(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Hd(i){var o=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function pm(i,o,f){var v=Object.getOwnPropertyDescriptor(i.constructor.prototype,o);if(!i.hasOwnProperty(o)&&typeof v<"u"&&typeof v.get=="function"&&typeof v.set=="function"){var A=v.get,R=v.set;return Object.defineProperty(i,o,{configurable:!0,get:function(){return A.call(this)},set:function(V){f=""+V,R.call(this,V)}}),Object.defineProperty(i,o,{enumerable:v.enumerable}),{getValue:function(){return f},setValue:function(V){f=""+V},stopTracking:function(){i._valueTracker=null,delete i[o]}}}}function Xd(i){if(!i._valueTracker){var o=Hd(i)?"checked":"value";i._valueTracker=pm(i,o,""+i[o])}}function Ap(i){if(!i)return!1;var o=i._valueTracker;if(!o)return!0;var f=o.getValue(),v="";return i&&(v=Hd(i)?i.checked?"true":"false":i.value),i=v,i!==f?(o.setValue(i),!0):!1}function fu(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var Yd=/[\n"\\]/g;function hr(i){return i.replace(Yd,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function pu(i,o,f,v,A,R,V,ee){i.name="",V!=null&&typeof V!="function"&&typeof V!="symbol"&&typeof V!="boolean"?i.type=V:i.removeAttribute("type"),o!=null?V==="number"?(o===0&&i.value===""||i.value!=o)&&(i.value=""+br(o)):i.value!==""+br(o)&&(i.value=""+br(o)):V!=="submit"&&V!=="reset"||i.removeAttribute("value"),o!=null?Qs(i,V,br(o)):f!=null?Qs(i,V,br(f)):v!=null&&i.removeAttribute("value"),A==null&&R!=null&&(i.defaultChecked=!!R),A!=null&&(i.checked=A&&typeof A!="function"&&typeof A!="symbol"),ee!=null&&typeof ee!="function"&&typeof ee!="symbol"&&typeof ee!="boolean"?i.name=""+br(ee):i.removeAttribute("name")}function Qd(i,o,f,v,A,R,V,ee){if(R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"&&(i.type=R),o!=null||f!=null){if(!(R!=="submit"&&R!=="reset"||o!=null)){Xd(i);return}f=f!=null?""+br(f):"",o=o!=null?""+br(o):f,ee||o===i.value||(i.value=o),i.defaultValue=o}v=v??A,v=typeof v!="function"&&typeof v!="symbol"&&!!v,i.checked=ee?i.checked:!!v,i.defaultChecked=!!v,V!=null&&typeof V!="function"&&typeof V!="symbol"&&typeof V!="boolean"&&(i.name=V),Xd(i)}function Qs(i,o,f){o==="number"&&fu(i.ownerDocument)===i||i.defaultValue===""+f||(i.defaultValue=""+f)}function Fo(i,o,f,v){if(i=i.options,o){o={};for(var A=0;A<f.length;A++)o["$"+f[A]]=!0;for(f=0;f<i.length;f++)A=o.hasOwnProperty("$"+i[f].value),i[f].selected!==A&&(i[f].selected=A),A&&v&&(i[f].defaultSelected=!0)}else{for(f=""+br(f),o=null,A=0;A<i.length;A++){if(i[A].value===f){i[A].selected=!0,v&&(i[A].defaultSelected=!0);return}o!==null||i[A].disabled||(o=i[A])}o!==null&&(o.selected=!0)}}function Lp(i,o,f){if(o!=null&&(o=""+br(o),o!==i.value&&(i.value=o),f==null)){i.defaultValue!==o&&(i.defaultValue=o);return}i.defaultValue=f!=null?""+br(f):""}function wc(i,o,f,v){if(o==null){if(v!=null){if(f!=null)throw Error(m(92));if(qt(v)){if(1<v.length)throw Error(m(93));v=v[0]}f=v}f==null&&(f=""),o=f}f=br(o),i.defaultValue=f,v=i.textContent,v===f&&v!==""&&v!==null&&(i.value=v),Xd(i)}function As(i,o){if(o){var f=i.firstChild;if(f&&f===i.lastChild&&f.nodeType===3){f.nodeValue=o;return}}i.textContent=o}var Wd=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Lr(i,o,f){var v=o.indexOf("--")===0;f==null||typeof f=="boolean"||f===""?v?i.setProperty(o,""):o==="float"?i.cssFloat="":i[o]="":v?i.setProperty(o,f):typeof f!="number"||f===0||Wd.has(o)?o==="float"?i.cssFloat=f:i[o]=(""+f).trim():i[o]=f+"px"}function bn(i,o,f){if(o!=null&&typeof o!="object")throw Error(m(62));if(i=i.style,f!=null){for(var v in f)!f.hasOwnProperty(v)||o!=null&&o.hasOwnProperty(v)||(v.indexOf("--")===0?i.setProperty(v,""):v==="float"?i.cssFloat="":i[v]="");for(var A in o)v=o[A],o.hasOwnProperty(A)&&f[A]!==v&&Lr(i,A,v)}else for(var R in o)o.hasOwnProperty(R)&&Lr(i,R,o[R])}function No(i){if(i.indexOf("-")===-1)return!1;switch(i){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 Nr=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Cl=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function dn(i){return Cl.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function da(){}var Tl=null;function Uo(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var er=null,Ri=null;function tr(i){var o=Fa(i);if(o&&(i=o.stateNode)){var f=i[ut]||null;e:switch(i=o.stateNode,o.type){case"input":if(pu(i,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name),o=f.name,f.type==="radio"&&o!=null){for(f=i;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll('input[name="'+hr(""+o)+'"][type="radio"]'),o=0;o<f.length;o++){var v=f[o];if(v!==i&&v.form===i.form){var A=v[ut]||null;if(!A)throw Error(m(90));pu(v,A.value,A.defaultValue,A.defaultValue,A.checked,A.defaultChecked,A.type,A.name)}}for(o=0;o<f.length;o++)v=f[o],v.form===i.form&&Ap(v)}break e;case"textarea":Lp(i,f.value,f.defaultValue);break e;case"select":o=f.value,o!=null&&Fo(i,!!f.multiple,o,!1)}}}var nr=!1;function oi(i,o,f){if(nr)return i(o,f);nr=!0;try{var v=i(o);return v}finally{if(nr=!1,(er!==null||Ri!==null)&&(i1(),er&&(o=er,i=Ri,Ri=er=null,tr(o),i)))for(o=0;o<i.length;o++)tr(i[o])}}function Ls(i,o){var f=i.stateNode;if(f===null)return null;var v=f[ut]||null;if(v===null)return null;f=v[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(v=!v.disabled)||(i=i.type,v=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!v;break e;default:i=!1}if(i)return null;if(f&&typeof f!="function")throw Error(m(231,o,typeof f));return f}var Li=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ur=!1;if(Li)try{var dr={};Object.defineProperty(dr,"passive",{get:function(){Ur=!0}}),window.addEventListener("test",dr,dr),window.removeEventListener("test",dr,dr)}catch{Ur=!1}var Na=null,Zn=null,pi=null;function gn(){if(pi)return pi;var i,o=Zn,f=o.length,v,A="value"in Na?Na.value:Na.textContent,R=A.length;for(i=0;i<f&&o[i]===A[i];i++);var V=f-i;for(v=1;v<=V&&o[f-v]===A[R-v];v++);return pi=A.slice(i,1<v?1-v:void 0)}function Yt(i){var o=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&o===13&&(i=13)):i=o,i===10&&(i=13),32<=i||i===13?i:0}function Ws(){return!0}function un(){return!1}function wr(i){function o(f,v,A,R,V){this._reactName=f,this._targetInst=A,this.type=v,this.nativeEvent=R,this.target=V,this.currentTarget=null;for(var ee in i)i.hasOwnProperty(ee)&&(f=i[ee],this[ee]=f?f(R):R[ee]);return this.isDefaultPrevented=(R.defaultPrevented!=null?R.defaultPrevented:R.returnValue===!1)?Ws:un,this.isPropagationStopped=un,this}return X(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=Ws)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=Ws)},persist:function(){},isPersistent:Ws}),o}var Ii={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sc=wr(Ii),Ks=X({},Ii,{view:0,detail:0}),mu=wr(Ks),$o,El,Ml,Al=X({},Ks,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:gu,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Ml&&(Ml&&i.type==="mousemove"?($o=i.screenX-Ml.screenX,El=i.screenY-Ml.screenY):El=$o=0,Ml=i),$o)},movementY:function(i){return"movementY"in i?i.movementY:El}}),Cc=wr(Al),Ps=X({},Al,{dataTransfer:0}),fr=wr(Ps),Ll=X({},Ks,{relatedTarget:0}),Pl=wr(Ll),Vo=X({},Ii,{animationName:0,elapsedTime:0,pseudoElement:0}),pr=wr(Vo),Ah=X({},Ii,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),Lh=wr(Ah),Pp=X({},Ii,{data:0}),Rp=wr(Pp),ir={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Tc={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"},Ua={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ph(i){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(i):(i=Ua[i])?!!o[i]:!1}function gu(){return Ph}var yu=X({},Ks,{key:function(i){if(i.key){var o=ir[i.key]||i.key;if(o!=="Unidentified")return o}return i.type==="keypress"?(i=Yt(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?Tc[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:gu,charCode:function(i){return i.type==="keypress"?Yt(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Yt(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),Js=wr(yu),as=X({},Al,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Kd=wr(as),Rh=X({},Ks,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:gu}),mm=wr(Rh),Jd=X({},Ii,{propertyName:0,elapsedTime:0,pseudoElement:0}),gm=wr(Jd),Ih=X({},Al,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),ef=wr(Ih),zh=X({},Ii,{newState:0,oldState:0}),Ec=wr(zh),tf=[9,13,27,32],fa=Li&&"CompositionEvent"in window,Mc=null;Li&&"documentMode"in document&&(Mc=document.documentMode);var nf=Li&&"TextEvent"in window&&!Mc,Rl=Li&&(!fa||Mc&&8<Mc&&11>=Mc),Ac=" ",Ip=!1;function _u(i,o){switch(i){case"keyup":return tf.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zp(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var ss=!1;function Dp(i,o){switch(i){case"compositionend":return zp(o);case"keypress":return o.which!==32?null:(Ip=!0,Ac);case"textInput":return i=o.data,i===Ac&&Ip?null:i;default:return null}}function rf(i,o){if(ss)return i==="compositionend"||!fa&&_u(i,o)?(i=gn(),pi=Zn=Na=null,ss=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return Rl&&o.locale!=="ko"?null:o.data;default:return null}}var Op={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 af(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o==="input"?!!Op[i.type]:o==="textarea"}function Dh(i,o,f,v){er?Ri?Ri.push(v):Ri=[v]:er=v,o=qf(o,"onChange"),0<o.length&&(f=new Sc("onChange","change",null,f,v),i.push({event:f,listeners:o}))}var Lc=null,Pc=null;function vu(i){q0(i,0)}function xu(i){var o=Xs(i);if(Ap(o))return i}function jo(i,o){if(i==="change")return o}var sf=!1;if(Li){var Oh;if(Li){var eo="oninput"in document;if(!eo){var of=document.createElement("div");of.setAttribute("oninput","return;"),eo=typeof of.oninput=="function"}Oh=eo}else Oh=!1;sf=Oh&&(!document.documentMode||9<document.documentMode)}function bu(){Lc&&(Lc.detachEvent("onpropertychange",kp),Pc=Lc=null)}function kp(i){if(i.propertyName==="value"&&xu(Pc)){var o=[];Dh(o,Pc,i,Uo(i)),oi(vu,o)}}function Bp(i,o,f){i==="focusin"?(bu(),Lc=o,Pc=f,Lc.attachEvent("onpropertychange",kp)):i==="focusout"&&bu()}function lf(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return xu(Pc)}function Fp(i,o){if(i==="click")return xu(o)}function Np(i,o){if(i==="input"||i==="change")return xu(o)}function cf(i,o){return i===o&&(i!==0||1/i===1/o)||i!==i&&o!==o}var $r=typeof Object.is=="function"?Object.is:cf;function Zo(i,o){if($r(i,o))return!0;if(typeof i!="object"||i===null||typeof o!="object"||o===null)return!1;var f=Object.keys(i),v=Object.keys(o);if(f.length!==v.length)return!1;for(v=0;v<f.length;v++){var A=f[v];if(!Br.call(o,A)||!$r(i[A],o[A]))return!1}return!0}function Rs(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function kh(i,o){var f=Rs(i);i=0;for(var v;f;){if(f.nodeType===3){if(v=i+f.textContent.length,i<=o&&v>=o)return{node:f,offset:o-i};i=v}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=Rs(f)}}function Bh(i,o){return i&&o?i===o?!0:i&&i.nodeType===3?!1:o&&o.nodeType===3?Bh(i,o.parentNode):"contains"in i?i.contains(o):i.compareDocumentPosition?!!(i.compareDocumentPosition(o)&16):!1:!1}function Ln(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var o=fu(i.document);o instanceof i.HTMLIFrameElement;){try{var f=typeof o.contentWindow.location.href=="string"}catch{f=!1}if(f)i=o.contentWindow;else break;o=fu(i.document)}return o}function Fh(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o&&(o==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||o==="textarea"||i.contentEditable==="true")}var uf=Li&&"documentMode"in document&&11>=document.documentMode,$a=null,wu=null,Su=null,hf=!1;function Up(i,o,f){var v=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;hf||$a==null||$a!==fu(v)||(v=$a,"selectionStart"in v&&Fh(v)?v={start:v.selectionStart,end:v.selectionEnd}:(v=(v.ownerDocument&&v.ownerDocument.defaultView||window).getSelection(),v={anchorNode:v.anchorNode,anchorOffset:v.anchorOffset,focusNode:v.focusNode,focusOffset:v.focusOffset}),Su&&Zo(Su,v)||(Su=v,v=qf(wu,"onSelect"),0<v.length&&(o=new Sc("onSelect","select",null,o,f),i.push({event:o,listeners:v}),o.target=$a)))}function Il(i,o){var f={};return f[i.toLowerCase()]=o.toLowerCase(),f["Webkit"+i]="webkit"+o,f["Moz"+i]="moz"+o,f}var zl={animationend:Il("Animation","AnimationEnd"),animationiteration:Il("Animation","AnimationIteration"),animationstart:Il("Animation","AnimationStart"),transitionrun:Il("Transition","TransitionRun"),transitionstart:Il("Transition","TransitionStart"),transitioncancel:Il("Transition","TransitionCancel"),transitionend:Il("Transition","TransitionEnd")},df={},ff={};Li&&(ff=document.createElement("div").style,"AnimationEvent"in window||(delete zl.animationend.animation,delete zl.animationiteration.animation,delete zl.animationstart.animation),"TransitionEvent"in window||delete zl.transitionend.transition);function Is(i){if(df[i])return df[i];if(!zl[i])return i;var o=zl[i],f;for(f in o)if(o.hasOwnProperty(f)&&f in ff)return df[i]=o[f];return i}var Cu=Is("animationend"),Tu=Is("animationiteration"),Nh=Is("animationstart"),Dl=Is("transitionrun"),Eu=Is("transitionstart"),Rc=Is("transitioncancel"),pa=Is("transitionend"),pf=new Map,Uh="abort auxClick beforeToggle 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(" ");Uh.push("scrollEnd");function ma(i,o){pf.set(i,o),jn(o,[i])}var zs=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},Vr=[],to=0,Ol=0;function kl(){for(var i=to,o=Ol=to=0;o<i;){var f=Vr[o];Vr[o++]=null;var v=Vr[o];Vr[o++]=null;var A=Vr[o];Vr[o++]=null;var R=Vr[o];if(Vr[o++]=null,v!==null&&A!==null){var V=v.pending;V===null?A.next=A:(A.next=V.next,V.next=A),v.pending=A}R!==0&&mf(f,A,R)}}function Mu(i,o,f,v){Vr[to++]=i,Vr[to++]=o,Vr[to++]=f,Vr[to++]=v,Ol|=v,i.lanes|=v,i=i.alternate,i!==null&&(i.lanes|=v)}function Go(i,o,f,v){return Mu(i,o,f,v),qo(i)}function Va(i,o){return Mu(i,null,null,o),qo(i)}function mf(i,o,f){i.lanes|=f;var v=i.alternate;v!==null&&(v.lanes|=f);for(var A=!1,R=i.return;R!==null;)R.childLanes|=f,v=R.alternate,v!==null&&(v.childLanes|=f),R.tag===22&&(i=R.stateNode,i===null||i._visibility&1||(A=!0)),i=R,R=R.return;return i.tag===3?(R=i.stateNode,A&&o!==null&&(A=31-De(f),i=R.hiddenUpdates,v=i[A],v===null?i[A]=[o]:v.push(o),o.lane=f|536870912),R):null}function qo(i){if(50<Oi)throw Oi=0,Ff=null,Error(m(185));for(var o=i.return;o!==null;)i=o,o=i.return;return i.tag===3?i.stateNode:null}var hn={};function $h(i,o,f,v){this.tag=i,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=v,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ga(i,o,f,v){return new $h(i,o,f,v)}function Au(i){return i=i.prototype,!(!i||!i.isReactComponent)}function ya(i,o){var f=i.alternate;return f===null?(f=ga(i.tag,o,i.key,i.mode),f.elementType=i.elementType,f.type=i.type,f.stateNode=i.stateNode,f.alternate=i,i.alternate=f):(f.pendingProps=o,f.type=i.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=i.flags&65011712,f.childLanes=i.childLanes,f.lanes=i.lanes,f.child=i.child,f.memoizedProps=i.memoizedProps,f.memoizedState=i.memoizedState,f.updateQueue=i.updateQueue,o=i.dependencies,f.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},f.sibling=i.sibling,f.index=i.index,f.ref=i.ref,f.refCleanup=i.refCleanup,f}function $p(i,o){i.flags&=65011714;var f=i.alternate;return f===null?(i.childLanes=0,i.lanes=o,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=f.childLanes,i.lanes=f.lanes,i.child=f.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=f.memoizedProps,i.memoizedState=f.memoizedState,i.updateQueue=f.updateQueue,i.type=f.type,o=f.dependencies,i.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),i}function Bl(i,o,f,v,A,R){var V=0;if(v=i,typeof i=="function")Au(i)&&(V=1);else if(typeof i=="string")V=G(i,f,xt.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case Gt:return i=ga(31,f,o,A),i.elementType=Gt,i.lanes=R,i;case ge:return no(f.children,A,R,o);case ye:V=8,A|=24;break;case Se:return i=ga(12,f,o,A|2),i.elementType=Se,i.lanes=R,i;case Je:return i=ga(13,f,o,A),i.elementType=Je,i.lanes=R,i;case et:return i=ga(19,f,o,A),i.elementType=et,i.lanes=R,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case Pe:V=10;break e;case je:V=9;break e;case Oe:V=11;break e;case ot:V=14;break e;case Rt:V=16,v=null;break e}V=29,f=Error(m(130,i===null?"null":typeof i,"")),v=null}return o=ga(V,f,o,A),o.elementType=i,o.type=v,o.lanes=R,o}function no(i,o,f,v){return i=ga(7,i,v,o),i.lanes=f,i}function gf(i,o,f){return i=ga(6,i,null,o),i.lanes=f,i}function Vh(i){var o=ga(18,null,null,0);return o.stateNode=i,o}function Ic(i,o,f){return o=ga(4,i.children!==null?i.children:[],i.key,o),o.lanes=f,o.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},o}var Lu=new WeakMap;function jr(i,o){if(typeof i=="object"&&i!==null){var f=Lu.get(i);return f!==void 0?f:(o={value:i,source:o,stack:zo(o)},Lu.set(i,o),o)}return{value:i,source:o,stack:zo(o)}}var io=[],Ho=0,Fl=null,Xo=0,Pr=[],mr=0,os=null,Ds=1,Kr="";function ro(i,o){io[Ho++]=Xo,io[Ho++]=Fl,Fl=i,Xo=o}function yf(i,o,f){Pr[mr++]=Ds,Pr[mr++]=Kr,Pr[mr++]=os,os=i;var v=Ds;i=Kr;var A=32-De(v)-1;v&=~(1<<A),f+=1;var R=32-De(o)+A;if(30<R){var V=A-A%5;R=(v&(1<<V)-1).toString(32),v>>=V,A-=V,Ds=1<<32-De(o)+A|f<<A|v,Kr=R+i}else Ds=1<<R|f<<A|v,Kr=i}function Nl(i){i.return!==null&&(ro(i,1),yf(i,1,0))}function zc(i){for(;i===Fl;)Fl=io[--Ho],io[Ho]=null,Xo=io[--Ho],io[Ho]=null;for(;i===os;)os=Pr[--mr],Pr[mr]=null,Kr=Pr[--mr],Pr[mr]=null,Ds=Pr[--mr],Pr[mr]=null}function Pu(i,o){Pr[mr++]=Ds,Pr[mr++]=Kr,Pr[mr++]=os,Ds=o.id,Kr=o.overflow,os=i}var Hi=null,Hn=null,wn=!1,ls=null,_a=!1,wi=Error(m(519));function Jr(i){var o=Error(m(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Os(jr(o,i)),wi}function va(i){var o=i.stateNode,f=i.type,v=i.memoizedProps;switch(o[An]=i,o[ut]=v,f){case"dialog":Rn("cancel",o),Rn("close",o);break;case"iframe":case"object":case"embed":Rn("load",o);break;case"video":case"audio":for(f=0;f<Zf.length;f++)Rn(Zf[f],o);break;case"source":Rn("error",o);break;case"img":case"image":case"link":Rn("error",o),Rn("load",o);break;case"details":Rn("toggle",o);break;case"input":Rn("invalid",o),Qd(o,v.value,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name,!0);break;case"select":Rn("invalid",o);break;case"textarea":Rn("invalid",o),wc(o,v.value,v.defaultValue,v.children)}f=v.children,typeof f!="string"&&typeof f!="number"&&typeof f!="bigint"||o.textContent===""+f||v.suppressHydrationWarning===!0||ng(o.textContent,f)?(v.popover!=null&&(Rn("beforetoggle",o),Rn("toggle",o)),v.onScroll!=null&&Rn("scroll",o),v.onScrollEnd!=null&&Rn("scrollend",o),v.onClick!=null&&(o.onclick=da),o=!0):o=!1,o||Jr(i,!0)}function jh(i){for(Hi=i.return;Hi;)switch(Hi.tag){case 5:case 31:case 13:_a=!1;return;case 27:case 3:_a=!0;return;default:Hi=Hi.return}}function ao(i){if(i!==Hi)return!1;if(!wn)return jh(i),wn=!0,!1;var o=i.tag,f;if((f=o!==3&&o!==27)&&((f=o===5)&&(f=i.type,f=!(f!=="form"&&f!=="button")||y1(i.type,i.memoizedProps)),f=!f),f&&Hn&&Jr(i),jh(i),o===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(m(317));Hn=lg(i)}else if(o===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(m(317));Hn=lg(i)}else o===27?(o=Hn,wo(i.type)?(i=x1,x1=null,Hn=i):Hn=o):Hn=Hi?Ya(i.stateNode.nextSibling):null;return!0}function so(){Hn=Hi=null,wn=!1}function oo(){var i=ls;return i!==null&&(Ma===null?Ma=i:Ma.push.apply(Ma,i),ls=null),i}function Os(i){ls===null?ls=[i]:ls.push(i)}var Ul=we(null),ks=null,cs=null;function lo(i,o,f){pt(Ul,o._currentValue),o._currentValue=f}function us(i){i._currentValue=Ul.current,Be(Ul)}function Ru(i,o,f){for(;i!==null;){var v=i.alternate;if((i.childLanes&o)!==o?(i.childLanes|=o,v!==null&&(v.childLanes|=o)):v!==null&&(v.childLanes&o)!==o&&(v.childLanes|=o),i===f)break;i=i.return}}function Yo(i,o,f,v){var A=i.child;for(A!==null&&(A.return=i);A!==null;){var R=A.dependencies;if(R!==null){var V=A.child;R=R.firstContext;e:for(;R!==null;){var ee=R;R=A;for(var xe=0;xe<o.length;xe++)if(ee.context===o[xe]){R.lanes|=f,ee=R.alternate,ee!==null&&(ee.lanes|=f),Ru(R.return,f,i),v||(V=null);break e}R=ee.next}}else if(A.tag===18){if(V=A.return,V===null)throw Error(m(341));V.lanes|=f,R=V.alternate,R!==null&&(R.lanes|=f),Ru(V,f,i),V=null}else V=A.child;if(V!==null)V.return=A;else for(V=A;V!==null;){if(V===i){V=null;break}if(A=V.sibling,A!==null){A.return=V.return,V=A;break}V=V.return}A=V}}function ja(i,o,f,v){i=null;for(var A=o,R=!1;A!==null;){if(!R){if((A.flags&524288)!==0)R=!0;else if((A.flags&262144)!==0)break}if(A.tag===10){var V=A.alternate;if(V===null)throw Error(m(387));if(V=V.memoizedProps,V!==null){var ee=A.type;$r(A.pendingProps.value,V.value)||(i!==null?i.push(ee):i=[ee])}}else if(A===Wt.current){if(V=A.alternate,V===null)throw Error(m(387));V.memoizedState.memoizedState!==A.memoizedState.memoizedState&&(i!==null?i.push(qe):i=[qe])}A=A.return}i!==null&&Yo(o,i,f,v),o.flags|=262144}function Iu(i){for(i=i.firstContext;i!==null;){if(!$r(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Qo(i){ks=i,cs=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function gr(i){return _f(ks,i)}function zu(i,o){return ks===null&&Qo(i),_f(i,o)}function _f(i,o){var f=o._currentValue;if(o={context:o,memoizedValue:f,next:null},cs===null){if(i===null)throw Error(m(308));cs=o,i.dependencies={lanes:0,firstContext:o},i.flags|=524288}else cs=cs.next=o;return f}var Dc=typeof AbortController<"u"?AbortController:function(){var i=[],o=this.signal={aborted:!1,addEventListener:function(f,v){i.push(v)}};this.abort=function(){o.aborted=!0,i.forEach(function(f){return f()})}},Oc=n.unstable_scheduleCallback,ea=n.unstable_NormalPriority,li={$$typeof:Pe,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Du(){return{controller:new Dc,data:new Map,refCount:0}}function Rr(i){i.refCount--,i.refCount===0&&Oc(ea,function(){i.controller.abort()})}var Zr=null,Wo=0,Sr=0,xa=null;function ym(i,o){if(Zr===null){var f=Zr=[];Wo=0,Sr=Kc(),xa={status:"pending",value:void 0,then:function(v){f.push(v)}}}return Wo++,o.then(Zh,Zh),o}function Zh(){if(--Wo===0&&Zr!==null){xa!==null&&(xa.status="fulfilled");var i=Zr;Zr=null,Sr=0,xa=null;for(var o=0;o<i.length;o++)(0,i[o])()}}function _m(i,o){var f=[],v={status:"pending",value:null,reason:null,then:function(A){f.push(A)}};return i.then(function(){v.status="fulfilled",v.value=o;for(var A=0;A<f.length;A++)(0,f[A])(o)},function(A){for(v.status="rejected",v.reason=A,A=0;A<f.length;A++)(0,f[A])(void 0)}),v}var kc=$e.S;$e.S=function(i,o){k0=Ji(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&ym(i,o),kc!==null&&kc(i,o)};var Ko=we(null);function $l(){var i=Ko.current;return i!==null?i:di.pooledCache}function Za(i,o){o===null?pt(Ko,Ko.current):pt(Ko,o.pool)}function Ct(){var i=$l();return i===null?null:{parent:li._currentValue,pool:i}}var Vl=Error(m(460)),Ou=Error(m(474)),Jo=Error(m(542)),el={then:function(){}};function tl(i){return i=i.status,i==="fulfilled"||i==="rejected"}function jl(i,o,f){switch(f=i[f],f===void 0?i.push(o):f!==o&&(o.then(da,da),o=f),o.status){case"fulfilled":return o.value;case"rejected":throw i=o.reason,ku(i),i;default:if(typeof o.status=="string")o.then(da,da);else{if(i=di,i!==null&&100<i.shellSuspendCounter)throw Error(m(482));i=o,i.status="pending",i.then(function(v){if(o.status==="pending"){var A=o;A.status="fulfilled",A.value=v}},function(v){if(o.status==="pending"){var A=o;A.status="rejected",A.reason=v}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw i=o.reason,ku(i),i}throw Bs=o,Vl}}function ln(i){try{var o=i._init;return o(i._payload)}catch(f){throw f!==null&&typeof f=="object"&&typeof f.then=="function"?(Bs=f,Vl):f}}var Bs=null;function vf(){if(Bs===null)throw Error(m(459));var i=Bs;return Bs=null,i}function ku(i){if(i===Vl||i===Jo)throw Error(m(483))}var nl=null,Bc=0;function Bu(i){var o=Bc;return Bc+=1,nl===null&&(nl=[]),jl(nl,i,o)}function il(i,o){o=o.props.ref,i.ref=o!==void 0?o:null}function Fu(i,o){throw o.$$typeof===Y?Error(m(525)):(i=Object.prototype.toString.call(o),Error(m(31,i==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":i)))}function xf(i){function o(ze,Me){if(i){var Ze=ze.deletions;Ze===null?(ze.deletions=[Me],ze.flags|=16):Ze.push(Me)}}function f(ze,Me){if(!i)return null;for(;Me!==null;)o(ze,Me),Me=Me.sibling;return null}function v(ze){for(var Me=new Map;ze!==null;)ze.key!==null?Me.set(ze.key,ze):Me.set(ze.index,ze),ze=ze.sibling;return Me}function A(ze,Me){return ze=ya(ze,Me),ze.index=0,ze.sibling=null,ze}function R(ze,Me,Ze){return ze.index=Ze,i?(Ze=ze.alternate,Ze!==null?(Ze=Ze.index,Ze<Me?(ze.flags|=67108866,Me):Ze):(ze.flags|=67108866,Me)):(ze.flags|=1048576,Me)}function V(ze){return i&&ze.alternate===null&&(ze.flags|=67108866),ze}function ee(ze,Me,Ze,nt){return Me===null||Me.tag!==6?(Me=gf(Ze,ze.mode,nt),Me.return=ze,Me):(Me=A(Me,Ze),Me.return=ze,Me)}function xe(ze,Me,Ze,nt){var Xt=Ze.type;return Xt===ge?Ke(ze,Me,Ze.props.children,nt,Ze.key):Me!==null&&(Me.elementType===Xt||typeof Xt=="object"&&Xt!==null&&Xt.$$typeof===Rt&&ln(Xt)===Me.type)?(Me=A(Me,Ze.props),il(Me,Ze),Me.return=ze,Me):(Me=Bl(Ze.type,Ze.key,Ze.props,null,ze.mode,nt),il(Me,Ze),Me.return=ze,Me)}function Ge(ze,Me,Ze,nt){return Me===null||Me.tag!==4||Me.stateNode.containerInfo!==Ze.containerInfo||Me.stateNode.implementation!==Ze.implementation?(Me=Ic(Ze,ze.mode,nt),Me.return=ze,Me):(Me=A(Me,Ze.children||[]),Me.return=ze,Me)}function Ke(ze,Me,Ze,nt,Xt){return Me===null||Me.tag!==7?(Me=no(Ze,ze.mode,nt,Xt),Me.return=ze,Me):(Me=A(Me,Ze),Me.return=ze,Me)}function at(ze,Me,Ze){if(typeof Me=="string"&&Me!==""||typeof Me=="number"||typeof Me=="bigint")return Me=gf(""+Me,ze.mode,Ze),Me.return=ze,Me;if(typeof Me=="object"&&Me!==null){switch(Me.$$typeof){case U:return Ze=Bl(Me.type,Me.key,Me.props,null,ze.mode,Ze),il(Ze,Me),Ze.return=ze,Ze;case oe:return Me=Ic(Me,ze.mode,Ze),Me.return=ze,Me;case Rt:return Me=ln(Me),at(ze,Me,Ze)}if(qt(Me)||At(Me))return Me=no(Me,ze.mode,Ze,null),Me.return=ze,Me;if(typeof Me.then=="function")return at(ze,Bu(Me),Ze);if(Me.$$typeof===Pe)return at(ze,zu(ze,Me),Ze);Fu(ze,Me)}return null}function He(ze,Me,Ze,nt){var Xt=Me!==null?Me.key:null;if(typeof Ze=="string"&&Ze!==""||typeof Ze=="number"||typeof Ze=="bigint")return Xt!==null?null:ee(ze,Me,""+Ze,nt);if(typeof Ze=="object"&&Ze!==null){switch(Ze.$$typeof){case U:return Ze.key===Xt?xe(ze,Me,Ze,nt):null;case oe:return Ze.key===Xt?Ge(ze,Me,Ze,nt):null;case Rt:return Ze=ln(Ze),He(ze,Me,Ze,nt)}if(qt(Ze)||At(Ze))return Xt!==null?null:Ke(ze,Me,Ze,nt,null);if(typeof Ze.then=="function")return He(ze,Me,Bu(Ze),nt);if(Ze.$$typeof===Pe)return He(ze,Me,zu(ze,Ze),nt);Fu(ze,Ze)}return null}function Ye(ze,Me,Ze,nt,Xt){if(typeof nt=="string"&&nt!==""||typeof nt=="number"||typeof nt=="bigint")return ze=ze.get(Ze)||null,ee(Me,ze,""+nt,Xt);if(typeof nt=="object"&&nt!==null){switch(nt.$$typeof){case U:return ze=ze.get(nt.key===null?Ze:nt.key)||null,xe(Me,ze,nt,Xt);case oe:return ze=ze.get(nt.key===null?Ze:nt.key)||null,Ge(Me,ze,nt,Xt);case Rt:return nt=ln(nt),Ye(ze,Me,Ze,nt,Xt)}if(qt(nt)||At(nt))return ze=ze.get(Ze)||null,Ke(Me,ze,nt,Xt,null);if(typeof nt.then=="function")return Ye(ze,Me,Ze,Bu(nt),Xt);if(nt.$$typeof===Pe)return Ye(ze,Me,Ze,zu(Me,nt),Xt);Fu(Me,nt)}return null}function Nt(ze,Me,Ze,nt){for(var Xt=null,Qn=null,Et=Me,Jt=Me=0,_n=null;Et!==null&&Jt<Ze.length;Jt++){Et.index>Jt?(_n=Et,Et=null):_n=Et.sibling;var vn=He(ze,Et,Ze[Jt],nt);if(vn===null){Et===null&&(Et=_n);break}i&&Et&&vn.alternate===null&&o(ze,Et),Me=R(vn,Me,Jt),Qn===null?Xt=vn:Qn.sibling=vn,Qn=vn,Et=_n}if(Jt===Ze.length)return f(ze,Et),wn&&ro(ze,Jt),Xt;if(Et===null){for(;Jt<Ze.length;Jt++)Et=at(ze,Ze[Jt],nt),Et!==null&&(Me=R(Et,Me,Jt),Qn===null?Xt=Et:Qn.sibling=Et,Qn=Et);return wn&&ro(ze,Jt),Xt}for(Et=v(Et);Jt<Ze.length;Jt++)_n=Ye(Et,ze,Jt,Ze[Jt],nt),_n!==null&&(i&&_n.alternate!==null&&Et.delete(_n.key===null?Jt:_n.key),Me=R(_n,Me,Jt),Qn===null?Xt=_n:Qn.sibling=_n,Qn=_n);return i&&Et.forEach(function(Ka){return o(ze,Ka)}),wn&&ro(ze,Jt),Xt}function nn(ze,Me,Ze,nt){if(Ze==null)throw Error(m(151));for(var Xt=null,Qn=null,Et=Me,Jt=Me=0,_n=null,vn=Ze.next();Et!==null&&!vn.done;Jt++,vn=Ze.next()){Et.index>Jt?(_n=Et,Et=null):_n=Et.sibling;var Ka=He(ze,Et,vn.value,nt);if(Ka===null){Et===null&&(Et=_n);break}i&&Et&&Ka.alternate===null&&o(ze,Et),Me=R(Ka,Me,Jt),Qn===null?Xt=Ka:Qn.sibling=Ka,Qn=Ka,Et=_n}if(vn.done)return f(ze,Et),wn&&ro(ze,Jt),Xt;if(Et===null){for(;!vn.done;Jt++,vn=Ze.next())vn=at(ze,vn.value,nt),vn!==null&&(Me=R(vn,Me,Jt),Qn===null?Xt=vn:Qn.sibling=vn,Qn=vn);return wn&&ro(ze,Jt),Xt}for(Et=v(Et);!vn.done;Jt++,vn=Ze.next())vn=Ye(Et,ze,Jt,vn.value,nt),vn!==null&&(i&&vn.alternate!==null&&Et.delete(vn.key===null?Jt:vn.key),Me=R(vn,Me,Jt),Qn===null?Xt=vn:Qn.sibling=vn,Qn=vn);return i&&Et.forEach(function(yl){return o(ze,yl)}),wn&&ro(ze,Jt),Xt}function yi(ze,Me,Ze,nt){if(typeof Ze=="object"&&Ze!==null&&Ze.type===ge&&Ze.key===null&&(Ze=Ze.props.children),typeof Ze=="object"&&Ze!==null){switch(Ze.$$typeof){case U:e:{for(var Xt=Ze.key;Me!==null;){if(Me.key===Xt){if(Xt=Ze.type,Xt===ge){if(Me.tag===7){f(ze,Me.sibling),nt=A(Me,Ze.props.children),nt.return=ze,ze=nt;break e}}else if(Me.elementType===Xt||typeof Xt=="object"&&Xt!==null&&Xt.$$typeof===Rt&&ln(Xt)===Me.type){f(ze,Me.sibling),nt=A(Me,Ze.props),il(nt,Ze),nt.return=ze,ze=nt;break e}f(ze,Me);break}else o(ze,Me);Me=Me.sibling}Ze.type===ge?(nt=no(Ze.props.children,ze.mode,nt,Ze.key),nt.return=ze,ze=nt):(nt=Bl(Ze.type,Ze.key,Ze.props,null,ze.mode,nt),il(nt,Ze),nt.return=ze,ze=nt)}return V(ze);case oe:e:{for(Xt=Ze.key;Me!==null;){if(Me.key===Xt)if(Me.tag===4&&Me.stateNode.containerInfo===Ze.containerInfo&&Me.stateNode.implementation===Ze.implementation){f(ze,Me.sibling),nt=A(Me,Ze.children||[]),nt.return=ze,ze=nt;break e}else{f(ze,Me);break}else o(ze,Me);Me=Me.sibling}nt=Ic(Ze,ze.mode,nt),nt.return=ze,ze=nt}return V(ze);case Rt:return Ze=ln(Ze),yi(ze,Me,Ze,nt)}if(qt(Ze))return Nt(ze,Me,Ze,nt);if(At(Ze)){if(Xt=At(Ze),typeof Xt!="function")throw Error(m(150));return Ze=Xt.call(Ze),nn(ze,Me,Ze,nt)}if(typeof Ze.then=="function")return yi(ze,Me,Bu(Ze),nt);if(Ze.$$typeof===Pe)return yi(ze,Me,zu(ze,Ze),nt);Fu(ze,Ze)}return typeof Ze=="string"&&Ze!==""||typeof Ze=="number"||typeof Ze=="bigint"?(Ze=""+Ze,Me!==null&&Me.tag===6?(f(ze,Me.sibling),nt=A(Me,Ze),nt.return=ze,ze=nt):(f(ze,Me),nt=gf(Ze,ze.mode,nt),nt.return=ze,ze=nt),V(ze)):f(ze,Me)}return function(ze,Me,Ze,nt){try{Bc=0;var Xt=yi(ze,Me,Ze,nt);return nl=null,Xt}catch(Et){if(Et===Vl||Et===Jo)throw Et;var Qn=ga(29,Et,null,ze.mode);return Qn.lanes=nt,Qn.return=ze,Qn}finally{}}}var rl=xf(!0),bf=xf(!1),co=!1;function Fs(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Xn(i,o){i=i.updateQueue,o.updateQueue===i&&(o.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function uo(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function Ga(i,o,f){var v=i.updateQueue;if(v===null)return null;if(v=v.shared,(Bn&2)!==0){var A=v.pending;return A===null?o.next=o:(o.next=A.next,A.next=o),v.pending=o,o=qo(i),mf(i,null,f),o}return Mu(i,v,o,f),qo(i)}function al(i,o,f){if(o=o.updateQueue,o!==null&&(o=o.shared,(f&4194048)!==0)){var v=o.lanes;v&=i.pendingLanes,f|=v,o.lanes=f,Kn(i,f)}}function Nu(i,o){var f=i.updateQueue,v=i.alternate;if(v!==null&&(v=v.updateQueue,f===v)){var A=null,R=null;if(f=f.firstBaseUpdate,f!==null){do{var V={lane:f.lane,tag:f.tag,payload:f.payload,callback:null,next:null};R===null?A=R=V:R=R.next=V,f=f.next}while(f!==null);R===null?A=R=o:R=R.next=o}else A=R=o;f={baseState:v.baseState,firstBaseUpdate:A,lastBaseUpdate:R,shared:v.shared,callbacks:v.callbacks},i.updateQueue=f;return}i=f.lastBaseUpdate,i===null?f.firstBaseUpdate=o:i.next=o,f.lastBaseUpdate=o}var Zl=!1;function Fc(){if(Zl){var i=xa;if(i!==null)throw i}}function Gl(i,o,f,v){Zl=!1;var A=i.updateQueue;co=!1;var R=A.firstBaseUpdate,V=A.lastBaseUpdate,ee=A.shared.pending;if(ee!==null){A.shared.pending=null;var xe=ee,Ge=xe.next;xe.next=null,V===null?R=Ge:V.next=Ge,V=xe;var Ke=i.alternate;Ke!==null&&(Ke=Ke.updateQueue,ee=Ke.lastBaseUpdate,ee!==V&&(ee===null?Ke.firstBaseUpdate=Ge:ee.next=Ge,Ke.lastBaseUpdate=xe))}if(R!==null){var at=A.baseState;V=0,Ke=Ge=xe=null,ee=R;do{var He=ee.lane&-536870913,Ye=He!==ee.lane;if(Ye?(In&He)===He:(v&He)===He){He!==0&&He===Sr&&(Zl=!0),Ke!==null&&(Ke=Ke.next={lane:0,tag:ee.tag,payload:ee.payload,callback:null,next:null});e:{var Nt=i,nn=ee;He=o;var yi=f;switch(nn.tag){case 1:if(Nt=nn.payload,typeof Nt=="function"){at=Nt.call(yi,at,He);break e}at=Nt;break e;case 3:Nt.flags=Nt.flags&-65537|128;case 0:if(Nt=nn.payload,He=typeof Nt=="function"?Nt.call(yi,at,He):Nt,He==null)break e;at=X({},at,He);break e;case 2:co=!0}}He=ee.callback,He!==null&&(i.flags|=64,Ye&&(i.flags|=8192),Ye=A.callbacks,Ye===null?A.callbacks=[He]:Ye.push(He))}else Ye={lane:He,tag:ee.tag,payload:ee.payload,callback:ee.callback,next:null},Ke===null?(Ge=Ke=Ye,xe=at):Ke=Ke.next=Ye,V|=He;if(ee=ee.next,ee===null){if(ee=A.shared.pending,ee===null)break;Ye=ee,ee=Ye.next,Ye.next=null,A.lastBaseUpdate=Ye,A.shared.pending=null}}while(!0);Ke===null&&(xe=at),A.baseState=xe,A.firstBaseUpdate=Ge,A.lastBaseUpdate=Ke,R===null&&(A.shared.lanes=0),Yc|=V,i.lanes=V,i.memoizedState=at}}function hs(i,o){if(typeof i!="function")throw Error(m(191,i));i.call(o)}function Uu(i,o){var f=i.callbacks;if(f!==null)for(i.callbacks=null,i=0;i<f.length;i++)hs(f[i],o)}var Mt=we(null),$t=we(0);function ql(i,o){i=dl,pt($t,i),pt(Mt,o),dl=i|o.baseLanes}function Gh(){pt($t,dl),pt(Mt,Mt.current)}function Nc(){dl=$t.current,Be(Mt),Be($t)}var ci=we(null),ba=null;function yr(i){var o=i.alternate;pt(mi,mi.current&1),pt(ci,i),ba===null&&(o===null||Mt.current!==null||o.memoizedState!==null)&&(ba=i)}function ho(i){pt(mi,mi.current),pt(ci,i),ba===null&&(ba=i)}function Vp(i){i.tag===22?(pt(mi,mi.current),pt(ci,i),ba===null&&(ba=i)):sl()}function sl(){pt(mi,mi.current),pt(ci,ci.current)}function wa(i){Be(ci),ba===i&&(ba=null),Be(mi)}var mi=we(0);function ui(i){for(var o=i;o!==null;){if(o.tag===13){var f=o.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||og(f)||eu(f)))return o}else if(o.tag===19&&(o.memoizedProps.revealOrder==="forwards"||o.memoizedProps.revealOrder==="backwards"||o.memoizedProps.revealOrder==="unstable_legacy-backwards"||o.memoizedProps.revealOrder==="together")){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var Yn=0,tn=null,kn=null,_i=null,Hl=!1,Ns=!1,fo=!1,ds=0,fs=0,ol=null,qh=0;function ni(){throw Error(m(321))}function $u(i,o){if(o===null)return!1;for(var f=0;f<o.length&&f<i.length;f++)if(!$r(i[f],o[f]))return!1;return!0}function Vu(i,o,f,v,A,R){return Yn=R,tn=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,$e.H=i===null||i.memoizedState===null?Xh:$s,fo=!1,R=f(v,A),fo=!1,Ns&&(R=Hh(o,f,v,A)),ju(i),R}function ju(i){$e.H=Yl;var o=kn!==null&&kn.next!==null;if(Yn=0,_i=kn=tn=null,Hl=!1,fs=0,ol=null,o)throw Error(m(300));i===null||rr||(i=i.dependencies,i!==null&&Iu(i)&&(rr=!0))}function Hh(i,o,f,v){tn=i;var A=0;do{if(Ns&&(ol=null),fs=0,Ns=!1,25<=A)throw Error(m(301));if(A+=1,_i=kn=null,i.updateQueue!=null){var R=i.updateQueue;R.lastEffect=null,R.events=null,R.stores=null,R.memoCache!=null&&(R.memoCache.index=0)}$e.H=Yh,R=o(f,v)}while(Ns);return R}function y(){var i=$e.H,o=i.useState()[0];return o=typeof o.then=="function"?L(o):o,i=i.useState()[0],(kn!==null?kn.memoizedState:null)!==i&&(tn.flags|=1024),o}function e(){var i=ds!==0;return ds=0,i}function s(i,o,f){o.updateQueue=i.updateQueue,o.flags&=-2053,i.lanes&=~f}function d(i){if(Hl){for(i=i.memoizedState;i!==null;){var o=i.queue;o!==null&&(o.pending=null),i=i.next}Hl=!1}Yn=0,_i=kn=tn=null,Ns=!1,fs=ds=0,ol=null}function g(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _i===null?tn.memoizedState=_i=i:_i=_i.next=i,_i}function _(){if(kn===null){var i=tn.alternate;i=i!==null?i.memoizedState:null}else i=kn.next;var o=_i===null?tn.memoizedState:_i.next;if(o!==null)_i=o,kn=i;else{if(i===null)throw tn.alternate===null?Error(m(467)):Error(m(310));kn=i,i={memoizedState:kn.memoizedState,baseState:kn.baseState,baseQueue:kn.baseQueue,queue:kn.queue,next:null},_i===null?tn.memoizedState=_i=i:_i=_i.next=i}return _i}function S(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function L(i){var o=fs;return fs+=1,ol===null&&(ol=[]),i=jl(ol,i,o),o=tn,(_i===null?o.memoizedState:_i.next)===null&&(o=o.alternate,$e.H=o===null||o.memoizedState===null?Xh:$s),i}function P(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return L(i);if(i.$$typeof===Pe)return gr(i)}throw Error(m(438,String(i)))}function O(i){var o=null,f=tn.updateQueue;if(f!==null&&(o=f.memoCache),o==null){var v=tn.alternate;v!==null&&(v=v.updateQueue,v!==null&&(v=v.memoCache,v!=null&&(o={data:v.data.map(function(A){return A.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),f===null&&(f=S(),tn.updateQueue=f),f.memoCache=o,f=o.data[o.index],f===void 0)for(f=o.data[o.index]=Array(i),v=0;v<i;v++)f[v]=Tt;return o.index++,f}function k(i,o){return typeof o=="function"?o(i):o}function $(i){var o=_();return N(o,kn,i)}function N(i,o,f){var v=i.queue;if(v===null)throw Error(m(311));v.lastRenderedReducer=f;var A=i.baseQueue,R=v.pending;if(R!==null){if(A!==null){var V=A.next;A.next=R.next,R.next=V}o.baseQueue=A=R,v.pending=null}if(R=i.baseState,A===null)i.memoizedState=R;else{o=A.next;var ee=V=null,xe=null,Ge=o,Ke=!1;do{var at=Ge.lane&-536870913;if(at!==Ge.lane?(In&at)===at:(Yn&at)===at){var He=Ge.revertLane;if(He===0)xe!==null&&(xe=xe.next={lane:0,revertLane:0,gesture:null,action:Ge.action,hasEagerState:Ge.hasEagerState,eagerState:Ge.eagerState,next:null}),at===Sr&&(Ke=!0);else if((Yn&He)===He){Ge=Ge.next,He===Sr&&(Ke=!0);continue}else at={lane:0,revertLane:Ge.revertLane,gesture:null,action:Ge.action,hasEagerState:Ge.hasEagerState,eagerState:Ge.eagerState,next:null},xe===null?(ee=xe=at,V=R):xe=xe.next=at,tn.lanes|=He,Yc|=He;at=Ge.action,fo&&f(R,at),R=Ge.hasEagerState?Ge.eagerState:f(R,at)}else He={lane:at,revertLane:Ge.revertLane,gesture:Ge.gesture,action:Ge.action,hasEagerState:Ge.hasEagerState,eagerState:Ge.eagerState,next:null},xe===null?(ee=xe=He,V=R):xe=xe.next=He,tn.lanes|=at,Yc|=at;Ge=Ge.next}while(Ge!==null&&Ge!==o);if(xe===null?V=R:xe.next=ee,!$r(R,i.memoizedState)&&(rr=!0,Ke&&(f=xa,f!==null)))throw f;i.memoizedState=R,i.baseState=V,i.baseQueue=xe,v.lastRenderedState=R}return A===null&&(v.lanes=0),[i.memoizedState,v.dispatch]}function q(i){var o=_(),f=o.queue;if(f===null)throw Error(m(311));f.lastRenderedReducer=i;var v=f.dispatch,A=f.pending,R=o.memoizedState;if(A!==null){f.pending=null;var V=A=A.next;do R=i(R,V.action),V=V.next;while(V!==A);$r(R,o.memoizedState)||(rr=!0),o.memoizedState=R,o.baseQueue===null&&(o.baseState=R),f.lastRenderedState=R}return[R,v]}function K(i,o,f){var v=tn,A=_(),R=wn;if(R){if(f===void 0)throw Error(m(407));f=f()}else f=o();var V=!$r((kn||A).memoizedState,f);if(V&&(A.memoizedState=f,rr=!0),A=A.queue,yn(se.bind(null,v,A,i),[i]),A.getSnapshot!==o||V||_i!==null&&_i.memoizedState.tag&1){if(v.flags|=2048,Mn(9,{destroy:void 0},ae.bind(null,v,A,f,o),null),di===null)throw Error(m(349));R||(Yn&127)!==0||re(v,o,f)}return f}function re(i,o,f){i.flags|=16384,i={getSnapshot:o,value:f},o=tn.updateQueue,o===null?(o=S(),tn.updateQueue=o,o.stores=[i]):(f=o.stores,f===null?o.stores=[i]:f.push(i))}function ae(i,o,f,v){o.value=f,o.getSnapshot=v,ce(o)&&de(i)}function se(i,o,f){return f(function(){ce(o)&&de(i)})}function ce(i){var o=i.getSnapshot;i=i.value;try{var f=o();return!$r(i,f)}catch{return!0}}function de(i){var o=Va(i,2);o!==null&&ra(o,i,2)}function ue(i){var o=g();if(typeof i=="function"){var f=i;if(i=f(),fo){Te(!0);try{f()}finally{Te(!1)}}}return o.memoizedState=o.baseState=i,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:k,lastRenderedState:i},o}function _e(i,o,f,v){return i.baseState=f,N(i,kn,typeof v=="function"?v:k)}function be(i,o,f,v,A){if(ia(i))throw Error(m(485));if(i=o.action,i!==null){var R={payload:A,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(V){R.listeners.push(V)}};$e.T!==null?f(!0):R.isTransition=!1,v(R),f=o.pending,f===null?(R.next=o.pending=R,fe(o,R)):(R.next=f.next,o.pending=f.next=R)}}function fe(i,o){var f=o.action,v=o.payload,A=i.state;if(o.isTransition){var R=$e.T,V={};$e.T=V;try{var ee=f(A,v),xe=$e.S;xe!==null&&xe(V,ee),Ee(i,o,ee)}catch(Ge){ke(i,o,Ge)}finally{R!==null&&V.types!==null&&(R.types=V.types),$e.T=R}}else try{R=f(A,v),Ee(i,o,R)}catch(Ge){ke(i,o,Ge)}}function Ee(i,o,f){f!==null&&typeof f=="object"&&typeof f.then=="function"?f.then(function(v){Ve(i,o,v)},function(v){return ke(i,o,v)}):Ve(i,o,f)}function Ve(i,o,f){o.status="fulfilled",o.value=f,Ne(o),i.state=f,o=i.pending,o!==null&&(f=o.next,f===o?i.pending=null:(f=f.next,o.next=f,fe(i,f)))}function ke(i,o,f){var v=i.pending;if(i.pending=null,v!==null){v=v.next;do o.status="rejected",o.reason=f,Ne(o),o=o.next;while(o!==v)}i.action=null}function Ne(i){i=i.listeners;for(var o=0;o<i.length;o++)(0,i[o])()}function Ue(i,o){return o}function ht(i,o){if(wn){var f=di.formState;if(f!==null){e:{var v=tn;if(wn){if(Hn){t:{for(var A=Hn,R=_a;A.nodeType!==8;){if(!R){A=null;break t}if(A=Ya(A.nextSibling),A===null){A=null;break t}}R=A.data,A=R==="F!"||R==="F"?A:null}if(A){Hn=Ya(A.nextSibling),v=A.data==="F!";break e}}Jr(v)}v=!1}v&&(o=f[0])}}return f=g(),f.memoizedState=f.baseState=o,v={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ue,lastRenderedState:o},f.queue=v,f=$c.bind(null,tn,v),v.dispatch=f,v=ue(!1),R=gs.bind(null,tn,!1,v.queue),v=g(),A={state:o,dispatch:null,action:i,pending:null},v.queue=A,f=be.bind(null,tn,A,R,f),A.dispatch=f,v.memoizedState=i,[o,f,!1]}function dt(i){var o=_();return tt(o,kn,i)}function tt(i,o,f){if(o=N(i,o,Ue)[0],i=$(k)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var v=L(o)}catch(V){throw V===Vl?Jo:V}else v=o;o=_();var A=o.queue,R=A.dispatch;return f!==o.memoizedState&&(tn.flags|=2048,Mn(9,{destroy:void 0},It.bind(null,A,f),null)),[v,R,i]}function It(i,o){i.action=o}function en(i){var o=_(),f=kn;if(f!==null)return tt(o,f,i);_(),o=o.memoizedState,f=_();var v=f.queue.dispatch;return f.memoizedState=i,[o,v,!1]}function Mn(i,o,f,v){return i={tag:i,create:f,deps:v,inst:o,next:null},o=tn.updateQueue,o===null&&(o=S(),tn.updateQueue=o),f=o.lastEffect,f===null?o.lastEffect=i.next=i:(v=f.next,f.next=i,i.next=v,o.lastEffect=i),i}function Nn(){return _().memoizedState}function Un(i,o,f,v){var A=g();tn.flags|=i,A.memoizedState=Mn(1|o,{destroy:void 0},f,v===void 0?null:v)}function hi(i,o,f,v){var A=_();v=v===void 0?null:v;var R=A.memoizedState.inst;kn!==null&&v!==null&&$u(v,kn.memoizedState.deps)?A.memoizedState=Mn(o,R,f,v):(tn.flags|=i,A.memoizedState=Mn(1|o,R,f,v))}function ii(i,o){Un(8390656,8,i,o)}function yn(i,o){hi(2048,8,i,o)}function vi(i){tn.flags|=4;var o=tn.updateQueue;if(o===null)o=S(),tn.updateQueue=o,o.events=[i];else{var f=o.events;f===null?o.events=[i]:f.push(i)}}function _r(i){var o=_().memoizedState;return vi({ref:o,nextImpl:i}),function(){if((Bn&2)!==0)throw Error(m(440));return o.impl.apply(void 0,arguments)}}function zi(i,o){return hi(4,2,i,o)}function Di(i,o){return hi(4,4,i,o)}function Ir(i,o){if(typeof o=="function"){i=i();var f=o(i);return function(){typeof f=="function"?f():o(null)}}if(o!=null)return i=i(),o.current=i,function(){o.current=null}}function po(i,o,f){f=f!=null?f.concat([i]):null,hi(4,4,Ir.bind(null,o,i),f)}function Sa(){}function mo(i,o){var f=_();o=o===void 0?null:o;var v=f.memoizedState;return o!==null&&$u(o,v[1])?v[0]:(f.memoizedState=[i,o],i)}function ll(i,o){var f=_();o=o===void 0?null:o;var v=f.memoizedState;if(o!==null&&$u(o,v[1]))return v[0];if(v=i(),fo){Te(!0);try{i()}finally{Te(!1)}}return f.memoizedState=[v,o],v}function Uc(i,o,f){return f===void 0||(Yn&1073741824)!==0&&(In&261930)===0?i.memoizedState=o:(i.memoizedState=f,i=Fm(),tn.lanes|=i,Yc|=i,f)}function Xl(i,o,f,v){return $r(f,o)?f:Mt.current!==null?(i=Uc(i,f,v),$r(i,o)||(rr=!0),i):(Yn&42)===0||(Yn&1073741824)!==0&&(In&261930)===0?(rr=!0,i.memoizedState=f):(i=Fm(),tn.lanes|=i,Yc|=i,o)}function Us(i,o,f,v,A){var R=ft.p;ft.p=R!==0&&8>R?R:8;var V=$e.T,ee={};$e.T=ee,gs(i,!1,o,f);try{var xe=A(),Ge=$e.S;if(Ge!==null&&Ge(ee,xe),xe!==null&&typeof xe=="object"&&typeof xe.then=="function"){var Ke=_m(xe,v);ms(i,o,Ke,Xa(i))}else ms(i,o,v,Xa(i))}catch(at){ms(i,o,{then:function(){},status:"rejected",reason:at},Xa())}finally{ft.p=R,V!==null&&ee.types!==null&&(V.types=ee.types),$e.T=V}}function Ca(){}function qa(i,o,f,v){if(i.tag!==5)throw Error(m(476));var A=ps(i).queue;Us(i,A,o,wt,f===null?Ca:function(){return ta(i),f(v)})}function ps(i){var o=i.memoizedState;if(o!==null)return o;o={memoizedState:wt,baseState:wt,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:k,lastRenderedState:wt},next:null};var f={};return o.next={memoizedState:f,baseState:f,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:k,lastRenderedState:f},next:null},i.memoizedState=o,i=i.alternate,i!==null&&(i.memoizedState=o),o}function ta(i){var o=ps(i);o.next===null&&(o=i.alternate.memoizedState),ms(i,o.next.queue,{},Xa())}function Si(){return gr(qe)}function Xi(){return _().memoizedState}function na(){return _().memoizedState}function vr(i){for(var o=i.return;o!==null;){switch(o.tag){case 24:case 3:var f=Xa();i=uo(f);var v=Ga(o,i,f);v!==null&&(ra(v,o,f),al(v,o,f)),o={cache:Du()},i.payload=o;return}o=o.return}}function wf(i,o,f){var v=Xa();f={lane:v,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},ia(i)?go(o,f):(f=Go(i,o,f,v),f!==null&&(ra(f,i,v),yo(f,o,v)))}function $c(i,o,f){var v=Xa();ms(i,o,f,v)}function ms(i,o,f,v){var A={lane:v,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null};if(ia(i))go(o,A);else{var R=i.alternate;if(i.lanes===0&&(R===null||R.lanes===0)&&(R=o.lastRenderedReducer,R!==null))try{var V=o.lastRenderedState,ee=R(V,f);if(A.hasEagerState=!0,A.eagerState=ee,$r(ee,V))return Mu(i,o,A,0),di===null&&kl(),!1}catch{}finally{}if(f=Go(i,o,A,v),f!==null)return ra(f,i,v),yo(f,o,v),!0}return!1}function gs(i,o,f,v){if(v={lane:2,revertLane:Kc(),gesture:null,action:v,hasEagerState:!1,eagerState:null,next:null},ia(i)){if(o)throw Error(m(479))}else o=Go(i,f,v,2),o!==null&&ra(o,i,2)}function ia(i){var o=i.alternate;return i===tn||o!==null&&o===tn}function go(i,o){Ns=Hl=!0;var f=i.pending;f===null?o.next=o:(o.next=f.next,f.next=o),i.pending=o}function yo(i,o,f){if((f&4194048)!==0){var v=o.lanes;v&=i.pendingLanes,f|=v,o.lanes=f,Kn(i,f)}}var Yl={readContext:gr,use:P,useCallback:ni,useContext:ni,useEffect:ni,useImperativeHandle:ni,useLayoutEffect:ni,useInsertionEffect:ni,useMemo:ni,useReducer:ni,useRef:ni,useState:ni,useDebugValue:ni,useDeferredValue:ni,useTransition:ni,useSyncExternalStore:ni,useId:ni,useHostTransitionStatus:ni,useFormState:ni,useActionState:ni,useOptimistic:ni,useMemoCache:ni,useCacheRefresh:ni};Yl.useEffectEvent=ni;var Xh={readContext:gr,use:P,useCallback:function(i,o){return g().memoizedState=[i,o===void 0?null:o],i},useContext:gr,useEffect:ii,useImperativeHandle:function(i,o,f){f=f!=null?f.concat([i]):null,Un(4194308,4,Ir.bind(null,o,i),f)},useLayoutEffect:function(i,o){return Un(4194308,4,i,o)},useInsertionEffect:function(i,o){Un(4,2,i,o)},useMemo:function(i,o){var f=g();o=o===void 0?null:o;var v=i();if(fo){Te(!0);try{i()}finally{Te(!1)}}return f.memoizedState=[v,o],v},useReducer:function(i,o,f){var v=g();if(f!==void 0){var A=f(o);if(fo){Te(!0);try{f(o)}finally{Te(!1)}}}else A=o;return v.memoizedState=v.baseState=A,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:A},v.queue=i,i=i.dispatch=wf.bind(null,tn,i),[v.memoizedState,i]},useRef:function(i){var o=g();return i={current:i},o.memoizedState=i},useState:function(i){i=ue(i);var o=i.queue,f=$c.bind(null,tn,o);return o.dispatch=f,[i.memoizedState,f]},useDebugValue:Sa,useDeferredValue:function(i,o){var f=g();return Uc(f,i,o)},useTransition:function(){var i=ue(!1);return i=Us.bind(null,tn,i.queue,!0,!1),g().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,o,f){var v=tn,A=g();if(wn){if(f===void 0)throw Error(m(407));f=f()}else{if(f=o(),di===null)throw Error(m(349));(In&127)!==0||re(v,o,f)}A.memoizedState=f;var R={value:f,getSnapshot:o};return A.queue=R,ii(se.bind(null,v,R,i),[i]),v.flags|=2048,Mn(9,{destroy:void 0},ae.bind(null,v,R,f,o),null),f},useId:function(){var i=g(),o=di.identifierPrefix;if(wn){var f=Kr,v=Ds;f=(v&~(1<<32-De(v)-1)).toString(32)+f,o="_"+o+"R_"+f,f=ds++,0<f&&(o+="H"+f.toString(32)),o+="_"}else f=qh++,o="_"+o+"r_"+f.toString(32)+"_";return i.memoizedState=o},useHostTransitionStatus:Si,useFormState:ht,useActionState:ht,useOptimistic:function(i){var o=g();o.memoizedState=o.baseState=i;var f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=f,o=gs.bind(null,tn,!0,f),f.dispatch=o,[i,o]},useMemoCache:O,useCacheRefresh:function(){return g().memoizedState=vr.bind(null,tn)},useEffectEvent:function(i){var o=g(),f={impl:i};return o.memoizedState=f,function(){if((Bn&2)!==0)throw Error(m(440));return f.impl.apply(void 0,arguments)}}},$s={readContext:gr,use:P,useCallback:mo,useContext:gr,useEffect:yn,useImperativeHandle:po,useInsertionEffect:zi,useLayoutEffect:Di,useMemo:ll,useReducer:$,useRef:Nn,useState:function(){return $(k)},useDebugValue:Sa,useDeferredValue:function(i,o){var f=_();return Xl(f,kn.memoizedState,i,o)},useTransition:function(){var i=$(k)[0],o=_().memoizedState;return[typeof i=="boolean"?i:L(i),o]},useSyncExternalStore:K,useId:Xi,useHostTransitionStatus:Si,useFormState:dt,useActionState:dt,useOptimistic:function(i,o){var f=_();return _e(f,kn,i,o)},useMemoCache:O,useCacheRefresh:na};$s.useEffectEvent=_r;var Yh={readContext:gr,use:P,useCallback:mo,useContext:gr,useEffect:yn,useImperativeHandle:po,useInsertionEffect:zi,useLayoutEffect:Di,useMemo:ll,useReducer:q,useRef:Nn,useState:function(){return q(k)},useDebugValue:Sa,useDeferredValue:function(i,o){var f=_();return kn===null?Uc(f,i,o):Xl(f,kn.memoizedState,i,o)},useTransition:function(){var i=q(k)[0],o=_().memoizedState;return[typeof i=="boolean"?i:L(i),o]},useSyncExternalStore:K,useId:Xi,useHostTransitionStatus:Si,useFormState:en,useActionState:en,useOptimistic:function(i,o){var f=_();return kn!==null?_e(f,kn,i,o):(f.baseState=i,[i,f.queue.dispatch])},useMemoCache:O,useCacheRefresh:na};Yh.useEffectEvent=_r;function Zu(i,o,f,v){o=i.memoizedState,f=f(v,o),f=f==null?o:X({},o,f),i.memoizedState=f,i.lanes===0&&(i.updateQueue.baseState=f)}var Ql={enqueueSetState:function(i,o,f){i=i._reactInternals;var v=Xa(),A=uo(v);A.payload=o,f!=null&&(A.callback=f),o=Ga(i,A,v),o!==null&&(ra(o,i,v),al(o,i,v))},enqueueReplaceState:function(i,o,f){i=i._reactInternals;var v=Xa(),A=uo(v);A.tag=1,A.payload=o,f!=null&&(A.callback=f),o=Ga(i,A,v),o!==null&&(ra(o,i,v),al(o,i,v))},enqueueForceUpdate:function(i,o){i=i._reactInternals;var f=Xa(),v=uo(f);v.tag=2,o!=null&&(v.callback=o),o=Ga(i,v,f),o!==null&&(ra(o,i,f),al(o,i,f))}};function vm(i,o,f,v,A,R,V){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(v,R,V):o.prototype&&o.prototype.isPureReactComponent?!Zo(f,v)||!Zo(A,R):!0}function Vc(i,o,f,v){i=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(f,v),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(f,v),o.state!==i&&Ql.enqueueReplaceState(o,o.state,null)}function ys(i,o){var f=o;if("ref"in o){f={};for(var v in o)v!=="ref"&&(f[v]=o[v])}if(i=i.defaultProps){f===o&&(f=X({},f));for(var A in i)f[A]===void 0&&(f[A]=i[A])}return f}function xm(i){zs(i)}function v0(i){console.error(i)}function jp(i){zs(i)}function Sf(i,o){try{var f=i.onUncaughtError;f(o.value,{componentStack:o.stack})}catch(v){setTimeout(function(){throw v})}}function Cf(i,o,f){try{var v=i.onCaughtError;v(f.value,{componentStack:f.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(A){setTimeout(function(){throw A})}}function Zp(i,o,f){return f=uo(f),f.tag=3,f.payload={element:null},f.callback=function(){Sf(i,o)},f}function x0(i){return i=uo(i),i.tag=3,i}function Gp(i,o,f,v){var A=f.type.getDerivedStateFromError;if(typeof A=="function"){var R=v.value;i.payload=function(){return A(R)},i.callback=function(){Cf(o,f,v)}}var V=f.stateNode;V!==null&&typeof V.componentDidCatch=="function"&&(i.callback=function(){Cf(o,f,v),typeof A!="function"&&(tc===null?tc=new Set([this]):tc.add(this));var ee=v.stack;this.componentDidCatch(v.value,{componentStack:ee!==null?ee:""})})}function Ky(i,o,f,v,A){if(f.flags|=32768,v!==null&&typeof v=="object"&&typeof v.then=="function"){if(o=f.alternate,o!==null&&ja(o,f,A,!0),f=ci.current,f!==null){switch(f.tag){case 31:case 13:return ba===null?r1():f.alternate===null&&Yi===0&&(Yi=3),f.flags&=-257,f.flags|=65536,f.lanes=A,v===el?f.flags|=16384:(o=f.updateQueue,o===null?f.updateQueue=new Set([v]):o.add(v),$f(i,v,A)),!1;case 22:return f.flags|=65536,v===el?f.flags|=16384:(o=f.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([v])},f.updateQueue=o):(f=o.retryQueue,f===null?o.retryQueue=new Set([v]):f.add(v)),$f(i,v,A)),!1}throw Error(m(435,f.tag))}return $f(i,v,A),r1(),!1}if(wn)return o=ci.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=A,v!==wi&&(i=Error(m(422),{cause:v}),Os(jr(i,f)))):(v!==wi&&(o=Error(m(423),{cause:v}),Os(jr(o,f))),i=i.current.alternate,i.flags|=65536,A&=-A,i.lanes|=A,v=jr(v,f),A=Zp(i.stateNode,v,A),Nu(i,A),Yi!==4&&(Yi=2)),!1;var R=Error(m(520),{cause:v});if(R=jr(R,f),Ju===null?Ju=[R]:Ju.push(R),Yi!==4&&(Yi=2),o===null)return!0;v=jr(v,f),f=o;do{switch(f.tag){case 3:return f.flags|=65536,i=A&-A,f.lanes|=i,i=Zp(f.stateNode,v,i),Nu(f,i),!1;case 1:if(o=f.type,R=f.stateNode,(f.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||R!==null&&typeof R.componentDidCatch=="function"&&(tc===null||!tc.has(R))))return f.flags|=65536,A&=-A,f.lanes|=A,A=x0(A),Gp(A,i,f,v),Nu(f,A),!1}f=f.return}while(f!==null);return!1}var Tf=Error(m(461)),rr=!1;function zr(i,o,f,v){o.child=i===null?bf(o,null,f,v):rl(o,i.child,f,v)}function Gu(i,o,f,v,A){f=f.render;var R=o.ref;if("ref"in v){var V={};for(var ee in v)ee!=="ref"&&(V[ee]=v[ee])}else V=v;return Qo(o),v=Vu(i,o,f,V,R,A),ee=e(),i!==null&&!rr?(s(i,o,A),_o(i,o,A)):(wn&&ee&&Nl(o),o.flags|=1,zr(i,o,v,A),o.child)}function b0(i,o,f,v,A){if(i===null){var R=f.type;return typeof R=="function"&&!Au(R)&&R.defaultProps===void 0&&f.compare===null?(o.tag=15,o.type=R,qu(i,o,R,v,A)):(i=Bl(f.type,null,v,o,o.mode,A),i.ref=o.ref,i.return=o,o.child=i)}if(R=i.child,!Tm(i,A)){var V=R.memoizedProps;if(f=f.compare,f=f!==null?f:Zo,f(V,v)&&i.ref===o.ref)return _o(i,o,A)}return o.flags|=1,i=ya(R,v),i.ref=o.ref,i.return=o,o.child=i}function qu(i,o,f,v,A){if(i!==null){var R=i.memoizedProps;if(Zo(R,v)&&i.ref===o.ref)if(rr=!1,o.pendingProps=v=R,Tm(i,A))(i.flags&131072)!==0&&(rr=!0);else return o.lanes=i.lanes,_o(i,o,A)}return Af(i,o,f,v,A)}function Ef(i,o,f,v){var A=v.children,R=i!==null?i.memoizedState:null;if(i===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),v.mode==="hidden"){if((o.flags&128)!==0){if(R=R!==null?R.baseLanes|f:f,i!==null){for(v=o.child=i.child,A=0;v!==null;)A=A|v.lanes|v.childLanes,v=v.sibling;v=A&~R}else v=0,o.child=null;return w0(i,o,R,f,v)}if((f&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},i!==null&&Za(o,R!==null?R.cachePool:null),R!==null?ql(o,R):Gh(),Vp(o);else return v=o.lanes=536870912,w0(i,o,R!==null?R.baseLanes|f:f,f,v)}else R!==null?(Za(o,R.cachePool),ql(o,R),sl(),o.memoizedState=null):(i!==null&&Za(o,null),Gh(),sl());return zr(i,o,A,f),o.child}function jc(i,o){return i!==null&&i.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function w0(i,o,f,v,A){var R=$l();return R=R===null?null:{parent:li._currentValue,pool:R},o.memoizedState={baseLanes:f,cachePool:R},i!==null&&Za(o,null),Gh(),Vp(o),i!==null&&ja(i,o,v,!0),o.childLanes=A,null}function qp(i,o){return o=Pf({mode:o.mode,children:o.children},i.mode),o.ref=i.ref,i.child=o,o.return=i,o}function S0(i,o,f){return rl(o,i.child,null,f),i=qp(o,o.pendingProps),i.flags|=2,wa(o),o.memoizedState=null,i}function Jy(i,o,f){var v=o.pendingProps,A=(o.flags&128)!==0;if(o.flags&=-129,i===null){if(wn){if(v.mode==="hidden")return i=qp(o,v),o.lanes=536870912,jc(null,i);if(ho(o),(i=Hn)?(i=J0(i,_a),i=i!==null&&i.data==="&"?i:null,i!==null&&(o.memoizedState={dehydrated:i,treeContext:os!==null?{id:Ds,overflow:Kr}:null,retryLane:536870912,hydrationErrors:null},f=Vh(i),f.return=o,o.child=f,Hi=o,Hn=null)):i=null,i===null)throw Jr(o);return o.lanes=536870912,null}return qp(o,v)}var R=i.memoizedState;if(R!==null){var V=R.dehydrated;if(ho(o),A)if(o.flags&256)o.flags&=-257,o=S0(i,o,f);else if(o.memoizedState!==null)o.child=i.child,o.flags|=128,o=null;else throw Error(m(558));else if(rr||ja(i,o,f,!1),A=(f&i.childLanes)!==0,rr||A){if(v=di,v!==null&&(V=Gi(v,f),V!==0&&V!==R.retryLane))throw R.retryLane=V,Va(i,V),ra(v,i,V),Tf;r1(),o=S0(i,o,f)}else i=R.treeContext,Hn=Ya(V.nextSibling),Hi=o,wn=!0,ls=null,_a=!1,i!==null&&Pu(o,i),o=qp(o,v),o.flags|=4096;return o}return i=ya(i.child,{mode:v.mode,children:v.children}),i.ref=o.ref,o.child=i,i.return=o,i}function Mf(i,o){var f=o.ref;if(f===null)i!==null&&i.ref!==null&&(o.flags|=4194816);else{if(typeof f!="function"&&typeof f!="object")throw Error(m(284));(i===null||i.ref!==f)&&(o.flags|=4194816)}}function Af(i,o,f,v,A){return Qo(o),f=Vu(i,o,f,v,void 0,A),v=e(),i!==null&&!rr?(s(i,o,A),_o(i,o,A)):(wn&&v&&Nl(o),o.flags|=1,zr(i,o,f,A),o.child)}function bm(i,o,f,v,A,R){return Qo(o),o.updateQueue=null,f=Hh(o,v,f,A),ju(i),v=e(),i!==null&&!rr?(s(i,o,R),_o(i,o,R)):(wn&&v&&Nl(o),o.flags|=1,zr(i,o,f,R),o.child)}function wm(i,o,f,v,A){if(Qo(o),o.stateNode===null){var R=hn,V=f.contextType;typeof V=="object"&&V!==null&&(R=gr(V)),R=new f(v,R),o.memoizedState=R.state!==null&&R.state!==void 0?R.state:null,R.updater=Ql,o.stateNode=R,R._reactInternals=o,R=o.stateNode,R.props=v,R.state=o.memoizedState,R.refs={},Fs(o),V=f.contextType,R.context=typeof V=="object"&&V!==null?gr(V):hn,R.state=o.memoizedState,V=f.getDerivedStateFromProps,typeof V=="function"&&(Zu(o,f,V,v),R.state=o.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof R.getSnapshotBeforeUpdate=="function"||typeof R.UNSAFE_componentWillMount!="function"&&typeof R.componentWillMount!="function"||(V=R.state,typeof R.componentWillMount=="function"&&R.componentWillMount(),typeof R.UNSAFE_componentWillMount=="function"&&R.UNSAFE_componentWillMount(),V!==R.state&&Ql.enqueueReplaceState(R,R.state,null),Gl(o,v,R,A),Fc(),R.state=o.memoizedState),typeof R.componentDidMount=="function"&&(o.flags|=4194308),v=!0}else if(i===null){R=o.stateNode;var ee=o.memoizedProps,xe=ys(f,ee);R.props=xe;var Ge=R.context,Ke=f.contextType;V=hn,typeof Ke=="object"&&Ke!==null&&(V=gr(Ke));var at=f.getDerivedStateFromProps;Ke=typeof at=="function"||typeof R.getSnapshotBeforeUpdate=="function",ee=o.pendingProps!==ee,Ke||typeof R.UNSAFE_componentWillReceiveProps!="function"&&typeof R.componentWillReceiveProps!="function"||(ee||Ge!==V)&&Vc(o,R,v,V),co=!1;var He=o.memoizedState;R.state=He,Gl(o,v,R,A),Fc(),Ge=o.memoizedState,ee||He!==Ge||co?(typeof at=="function"&&(Zu(o,f,at,v),Ge=o.memoizedState),(xe=co||vm(o,f,xe,v,He,Ge,V))?(Ke||typeof R.UNSAFE_componentWillMount!="function"&&typeof R.componentWillMount!="function"||(typeof R.componentWillMount=="function"&&R.componentWillMount(),typeof R.UNSAFE_componentWillMount=="function"&&R.UNSAFE_componentWillMount()),typeof R.componentDidMount=="function"&&(o.flags|=4194308)):(typeof R.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=v,o.memoizedState=Ge),R.props=v,R.state=Ge,R.context=V,v=xe):(typeof R.componentDidMount=="function"&&(o.flags|=4194308),v=!1)}else{R=o.stateNode,Xn(i,o),V=o.memoizedProps,Ke=ys(f,V),R.props=Ke,at=o.pendingProps,He=R.context,Ge=f.contextType,xe=hn,typeof Ge=="object"&&Ge!==null&&(xe=gr(Ge)),ee=f.getDerivedStateFromProps,(Ge=typeof ee=="function"||typeof R.getSnapshotBeforeUpdate=="function")||typeof R.UNSAFE_componentWillReceiveProps!="function"&&typeof R.componentWillReceiveProps!="function"||(V!==at||He!==xe)&&Vc(o,R,v,xe),co=!1,He=o.memoizedState,R.state=He,Gl(o,v,R,A),Fc();var Ye=o.memoizedState;V!==at||He!==Ye||co||i!==null&&i.dependencies!==null&&Iu(i.dependencies)?(typeof ee=="function"&&(Zu(o,f,ee,v),Ye=o.memoizedState),(Ke=co||vm(o,f,Ke,v,He,Ye,xe)||i!==null&&i.dependencies!==null&&Iu(i.dependencies))?(Ge||typeof R.UNSAFE_componentWillUpdate!="function"&&typeof R.componentWillUpdate!="function"||(typeof R.componentWillUpdate=="function"&&R.componentWillUpdate(v,Ye,xe),typeof R.UNSAFE_componentWillUpdate=="function"&&R.UNSAFE_componentWillUpdate(v,Ye,xe)),typeof R.componentDidUpdate=="function"&&(o.flags|=4),typeof R.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof R.componentDidUpdate!="function"||V===i.memoizedProps&&He===i.memoizedState||(o.flags|=4),typeof R.getSnapshotBeforeUpdate!="function"||V===i.memoizedProps&&He===i.memoizedState||(o.flags|=1024),o.memoizedProps=v,o.memoizedState=Ye),R.props=v,R.state=Ye,R.context=xe,v=Ke):(typeof R.componentDidUpdate!="function"||V===i.memoizedProps&&He===i.memoizedState||(o.flags|=4),typeof R.getSnapshotBeforeUpdate!="function"||V===i.memoizedProps&&He===i.memoizedState||(o.flags|=1024),v=!1)}return R=v,Mf(i,o),v=(o.flags&128)!==0,R||v?(R=o.stateNode,f=v&&typeof f.getDerivedStateFromError!="function"?null:R.render(),o.flags|=1,i!==null&&v?(o.child=rl(o,i.child,null,A),o.child=rl(o,null,f,A)):zr(i,o,f,A),o.memoizedState=R.state,i=o.child):i=_o(i,o,A),i}function C0(i,o,f,v){return so(),o.flags|=256,zr(i,o,f,v),o.child}var Sm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Hp(i){return{baseLanes:i,cachePool:Ct()}}function Xp(i,o,f){return i=i!==null?i.childLanes&~f:0,o&&(i|=vs),i}function T0(i,o,f){var v=o.pendingProps,A=!1,R=(o.flags&128)!==0,V;if((V=R)||(V=i!==null&&i.memoizedState===null?!1:(mi.current&2)!==0),V&&(A=!0,o.flags&=-129),V=(o.flags&32)!==0,o.flags&=-33,i===null){if(wn){if(A?yr(o):sl(),(i=Hn)?(i=J0(i,_a),i=i!==null&&i.data!=="&"?i:null,i!==null&&(o.memoizedState={dehydrated:i,treeContext:os!==null?{id:Ds,overflow:Kr}:null,retryLane:536870912,hydrationErrors:null},f=Vh(i),f.return=o,o.child=f,Hi=o,Hn=null)):i=null,i===null)throw Jr(o);return eu(i)?o.lanes=32:o.lanes=536870912,null}var ee=v.children;return v=v.fallback,A?(sl(),A=o.mode,ee=Pf({mode:"hidden",children:ee},A),v=no(v,A,f,null),ee.return=o,v.return=o,ee.sibling=v,o.child=ee,v=o.child,v.memoizedState=Hp(f),v.childLanes=Xp(i,V,f),o.memoizedState=Sm,jc(null,v)):(yr(o),Lf(o,ee))}var xe=i.memoizedState;if(xe!==null&&(ee=xe.dehydrated,ee!==null)){if(R)o.flags&256?(yr(o),o.flags&=-257,o=Rf(i,o,f)):o.memoizedState!==null?(sl(),o.child=i.child,o.flags|=128,o=null):(sl(),ee=v.fallback,A=o.mode,v=Pf({mode:"visible",children:v.children},A),ee=no(ee,A,f,null),ee.flags|=2,v.return=o,ee.return=o,v.sibling=ee,o.child=v,rl(o,i.child,null,f),v=o.child,v.memoizedState=Hp(f),v.childLanes=Xp(i,V,f),o.memoizedState=Sm,o=jc(null,v));else if(yr(o),eu(ee)){if(V=ee.nextSibling&&ee.nextSibling.dataset,V)var Ge=V.dgst;V=Ge,v=Error(m(419)),v.stack="",v.digest=V,Os({value:v,source:null,stack:null}),o=Rf(i,o,f)}else if(rr||ja(i,o,f,!1),V=(f&i.childLanes)!==0,rr||V){if(V=di,V!==null&&(v=Gi(V,f),v!==0&&v!==xe.retryLane))throw xe.retryLane=v,Va(i,v),ra(V,i,v),Tf;og(ee)||r1(),o=Rf(i,o,f)}else og(ee)?(o.flags|=192,o.child=i.child,o=null):(i=xe.treeContext,Hn=Ya(ee.nextSibling),Hi=o,wn=!0,ls=null,_a=!1,i!==null&&Pu(o,i),o=Lf(o,v.children),o.flags|=4096);return o}return A?(sl(),ee=v.fallback,A=o.mode,xe=i.child,Ge=xe.sibling,v=ya(xe,{mode:"hidden",children:v.children}),v.subtreeFlags=xe.subtreeFlags&65011712,Ge!==null?ee=ya(Ge,ee):(ee=no(ee,A,f,null),ee.flags|=2),ee.return=o,v.return=o,v.sibling=ee,o.child=v,jc(null,v),v=o.child,ee=i.child.memoizedState,ee===null?ee=Hp(f):(A=ee.cachePool,A!==null?(xe=li._currentValue,A=A.parent!==xe?{parent:xe,pool:xe}:A):A=Ct(),ee={baseLanes:ee.baseLanes|f,cachePool:A}),v.memoizedState=ee,v.childLanes=Xp(i,V,f),o.memoizedState=Sm,jc(i.child,v)):(yr(o),f=i.child,i=f.sibling,f=ya(f,{mode:"visible",children:v.children}),f.return=o,f.sibling=null,i!==null&&(V=o.deletions,V===null?(o.deletions=[i],o.flags|=16):V.push(i)),o.child=f,o.memoizedState=null,f)}function Lf(i,o){return o=Pf({mode:"visible",children:o},i.mode),o.return=i,i.child=o}function Pf(i,o){return i=ga(22,i,null,o),i.lanes=0,i}function Rf(i,o,f){return rl(o,i.child,null,f),i=Lf(o,o.pendingProps.children),i.flags|=2,o.memoizedState=null,i}function Qh(i,o,f){i.lanes|=o;var v=i.alternate;v!==null&&(v.lanes|=o),Ru(i.return,o,f)}function Gr(i,o,f,v,A,R){var V=i.memoizedState;V===null?i.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:v,tail:f,tailMode:A,treeForkCount:R}:(V.isBackwards=o,V.rendering=null,V.renderingStartTime=0,V.last=v,V.tail=f,V.tailMode=A,V.treeForkCount=R)}function Cm(i,o,f){var v=o.pendingProps,A=v.revealOrder,R=v.tail;v=v.children;var V=mi.current,ee=(V&2)!==0;if(ee?(V=V&1|2,o.flags|=128):V&=1,pt(mi,V),zr(i,o,v,f),v=wn?Xo:0,!ee&&i!==null&&(i.flags&128)!==0)e:for(i=o.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Qh(i,f,o);else if(i.tag===19)Qh(i,f,o);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===o)break e;for(;i.sibling===null;){if(i.return===null||i.return===o)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(A){case"forwards":for(f=o.child,A=null;f!==null;)i=f.alternate,i!==null&&ui(i)===null&&(A=f),f=f.sibling;f=A,f===null?(A=o.child,o.child=null):(A=f.sibling,f.sibling=null),Gr(o,!1,A,f,R,v);break;case"backwards":case"unstable_legacy-backwards":for(f=null,A=o.child,o.child=null;A!==null;){if(i=A.alternate,i!==null&&ui(i)===null){o.child=A;break}i=A.sibling,A.sibling=f,f=A,A=i}Gr(o,!0,f,null,R,v);break;case"together":Gr(o,!1,null,null,void 0,v);break;default:o.memoizedState=null}return o.child}function _o(i,o,f){if(i!==null&&(o.dependencies=i.dependencies),Yc|=o.lanes,(f&o.childLanes)===0)if(i!==null){if(ja(i,o,f,!1),(f&o.childLanes)===0)return null}else return null;if(i!==null&&o.child!==i.child)throw Error(m(153));if(o.child!==null){for(i=o.child,f=ya(i,i.pendingProps),o.child=f,f.return=o;i.sibling!==null;)i=i.sibling,f=f.sibling=ya(i,i.pendingProps),f.return=o;f.sibling=null}return o.child}function Tm(i,o){return(i.lanes&o)!==0?!0:(i=i.dependencies,!!(i!==null&&Iu(i)))}function E0(i,o,f){switch(o.tag){case 3:Ht(o,o.stateNode.containerInfo),lo(o,li,i.memoizedState.cache),so();break;case 27:case 5:ka(o);break;case 4:Ht(o,o.stateNode.containerInfo);break;case 10:lo(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,ho(o),null;break;case 13:var v=o.memoizedState;if(v!==null)return v.dehydrated!==null?(yr(o),o.flags|=128,null):(f&o.child.childLanes)!==0?T0(i,o,f):(yr(o),i=_o(i,o,f),i!==null?i.sibling:null);yr(o);break;case 19:var A=(i.flags&128)!==0;if(v=(f&o.childLanes)!==0,v||(ja(i,o,f,!1),v=(f&o.childLanes)!==0),A){if(v)return Cm(i,o,f);o.flags|=128}if(A=o.memoizedState,A!==null&&(A.rendering=null,A.tail=null,A.lastEffect=null),pt(mi,mi.current),v)break;return null;case 22:return o.lanes=0,Ef(i,o,f,o.pendingProps);case 24:lo(o,li,i.memoizedState.cache)}return _o(i,o,f)}function M0(i,o,f){if(i!==null)if(i.memoizedProps!==o.pendingProps)rr=!0;else{if(!Tm(i,f)&&(o.flags&128)===0)return rr=!1,E0(i,o,f);rr=(i.flags&131072)!==0}else rr=!1,wn&&(o.flags&1048576)!==0&&yf(o,Xo,o.index);switch(o.lanes=0,o.tag){case 16:e:{var v=o.pendingProps;if(i=ln(o.elementType),o.type=i,typeof i=="function")Au(i)?(v=ys(i,v),o.tag=1,o=wm(null,o,i,v,f)):(o.tag=0,o=Af(null,o,i,v,f));else{if(i!=null){var A=i.$$typeof;if(A===Oe){o.tag=11,o=Gu(null,o,i,v,f);break e}else if(A===ot){o.tag=14,o=b0(null,o,i,v,f);break e}}throw o=sn(i)||i,Error(m(306,o,""))}}return o;case 0:return Af(i,o,o.type,o.pendingProps,f);case 1:return v=o.type,A=ys(v,o.pendingProps),wm(i,o,v,A,f);case 3:e:{if(Ht(o,o.stateNode.containerInfo),i===null)throw Error(m(387));v=o.pendingProps;var R=o.memoizedState;A=R.element,Xn(i,o),Gl(o,v,null,f);var V=o.memoizedState;if(v=V.cache,lo(o,li,v),v!==R.cache&&Yo(o,[li],f,!0),Fc(),v=V.element,R.isDehydrated)if(R={element:v,isDehydrated:!1,cache:V.cache},o.updateQueue.baseState=R,o.memoizedState=R,o.flags&256){o=C0(i,o,v,f);break e}else if(v!==A){A=jr(Error(m(424)),o),Os(A),o=C0(i,o,v,f);break e}else{switch(i=o.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(Hn=Ya(i.firstChild),Hi=o,wn=!0,ls=null,_a=!0,f=bf(o,null,v,f),o.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling}else{if(so(),v===A){o=_o(i,o,f);break e}zr(i,o,v,f)}o=o.child}return o;case 26:return Mf(i,o),i===null?(f=r2(o.type,null,o.pendingProps,null))?o.memoizedState=f:wn||(f=o.type,i=o.pendingProps,v=g1(Lt.current).createElement(f),v[An]=o,v[ut]=i,sr(v,f,i),bi(v),o.stateNode=v):o.memoizedState=r2(o.type,i.memoizedProps,o.pendingProps,i.memoizedState),null;case 27:return ka(o),i===null&&wn&&(v=o.stateNode=e2(o.type,o.pendingProps,Lt.current),Hi=o,_a=!0,A=Hn,wo(o.type)?(x1=A,Hn=Ya(v.firstChild)):Hn=A),zr(i,o,o.pendingProps.children,f),Mf(i,o),i===null&&(o.flags|=4194304),o.child;case 5:return i===null&&wn&&((A=v=Hn)&&(v=v1(v,o.type,o.pendingProps,_a),v!==null?(o.stateNode=v,Hi=o,Hn=Ya(v.firstChild),_a=!1,A=!0):A=!1),A||Jr(o)),ka(o),A=o.type,R=o.pendingProps,V=i!==null?i.memoizedProps:null,v=R.children,y1(A,R)?v=null:V!==null&&y1(A,V)&&(o.flags|=32),o.memoizedState!==null&&(A=Vu(i,o,y,null,null,f),qe._currentValue=A),Mf(i,o),zr(i,o,v,f),o.child;case 6:return i===null&&wn&&((i=f=Hn)&&(f=f_(f,o.pendingProps,_a),f!==null?(o.stateNode=f,Hi=o,Hn=null,i=!0):i=!1),i||Jr(o)),null;case 13:return T0(i,o,f);case 4:return Ht(o,o.stateNode.containerInfo),v=o.pendingProps,i===null?o.child=rl(o,null,v,f):zr(i,o,v,f),o.child;case 11:return Gu(i,o,o.type,o.pendingProps,f);case 7:return zr(i,o,o.pendingProps,f),o.child;case 8:return zr(i,o,o.pendingProps.children,f),o.child;case 12:return zr(i,o,o.pendingProps.children,f),o.child;case 10:return v=o.pendingProps,lo(o,o.type,v.value),zr(i,o,v.children,f),o.child;case 9:return A=o.type._context,v=o.pendingProps.children,Qo(o),A=gr(A),v=v(A),o.flags|=1,zr(i,o,v,f),o.child;case 14:return b0(i,o,o.type,o.pendingProps,f);case 15:return qu(i,o,o.type,o.pendingProps,f);case 19:return Cm(i,o,f);case 31:return Jy(i,o,f);case 22:return Ef(i,o,f,o.pendingProps);case 24:return Qo(o),v=gr(li),i===null?(A=$l(),A===null&&(A=di,R=Du(),A.pooledCache=R,R.refCount++,R!==null&&(A.pooledCacheLanes|=f),A=R),o.memoizedState={parent:v,cache:A},Fs(o),lo(o,li,A)):((i.lanes&f)!==0&&(Xn(i,o),Gl(o,null,null,f),Fc()),A=i.memoizedState,R=o.memoizedState,A.parent!==v?(A={parent:v,cache:v},o.memoizedState=A,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=A),lo(o,li,v)):(v=R.cache,lo(o,li,v),v!==A.cache&&Yo(o,[li],f,!0))),zr(i,o,o.pendingProps.children,f),o.child;case 29:throw o.pendingProps}throw Error(m(156,o.tag))}function Wl(i){i.flags|=4}function Yp(i,o,f,v,A){if((o=(i.mode&32)!==0)&&(o=!1),o){if(i.flags|=16777216,(A&335544128)===A)if(i.stateNode.complete)i.flags|=8192;else if(F0())i.flags|=8192;else throw Bs=el,Ou}else i.flags&=-16777217}function A0(i,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!H(o))if(F0())i.flags|=8192;else throw Bs=el,Ou}function Wh(i,o){o!==null&&(i.flags|=4),i.flags&16384&&(o=i.tag!==22?Sn():536870912,i.lanes|=o,Ku|=o)}function Kh(i,o){if(!wn)switch(i.tailMode){case"hidden":o=i.tail;for(var f=null;o!==null;)o.alternate!==null&&(f=o),o=o.sibling;f===null?i.tail=null:f.sibling=null;break;case"collapsed":f=i.tail;for(var v=null;f!==null;)f.alternate!==null&&(v=f),f=f.sibling;v===null?o||i.tail===null?i.tail=null:i.tail.sibling=null:v.sibling=null}}function Ci(i){var o=i.alternate!==null&&i.alternate.child===i.child,f=0,v=0;if(o)for(var A=i.child;A!==null;)f|=A.lanes|A.childLanes,v|=A.subtreeFlags&65011712,v|=A.flags&65011712,A.return=i,A=A.sibling;else for(A=i.child;A!==null;)f|=A.lanes|A.childLanes,v|=A.subtreeFlags,v|=A.flags,A.return=i,A=A.sibling;return i.subtreeFlags|=v,i.childLanes=f,o}function e_(i,o,f){var v=o.pendingProps;switch(zc(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ci(o),null;case 1:return Ci(o),null;case 3:return f=o.stateNode,v=null,i!==null&&(v=i.memoizedState.cache),o.memoizedState.cache!==v&&(o.flags|=2048),us(li),xn(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(i===null||i.child===null)&&(ao(o)?Wl(o):i===null||i.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,oo())),Ci(o),null;case 26:var A=o.type,R=o.memoizedState;return i===null?(Wl(o),R!==null?(Ci(o),A0(o,R)):(Ci(o),Yp(o,A,null,v,f))):R?R!==i.memoizedState?(Wl(o),Ci(o),A0(o,R)):(Ci(o),o.flags&=-16777217):(i=i.memoizedProps,i!==v&&Wl(o),Ci(o),Yp(o,A,i,v,f)),null;case 27:if(ai(o),f=Lt.current,A=o.type,i!==null&&o.stateNode!=null)i.memoizedProps!==v&&Wl(o);else{if(!v){if(o.stateNode===null)throw Error(m(166));return Ci(o),null}i=xt.current,ao(o)?va(o):(i=e2(A,v,f),o.stateNode=i,Wl(o))}return Ci(o),null;case 5:if(ai(o),A=o.type,i!==null&&o.stateNode!=null)i.memoizedProps!==v&&Wl(o);else{if(!v){if(o.stateNode===null)throw Error(m(166));return Ci(o),null}if(R=xt.current,ao(o))va(o);else{var V=g1(Lt.current);switch(R){case 1:R=V.createElementNS("http://www.w3.org/2000/svg",A);break;case 2:R=V.createElementNS("http://www.w3.org/1998/Math/MathML",A);break;default:switch(A){case"svg":R=V.createElementNS("http://www.w3.org/2000/svg",A);break;case"math":R=V.createElementNS("http://www.w3.org/1998/Math/MathML",A);break;case"script":R=V.createElement("div"),R.innerHTML="<script><\/script>",R=R.removeChild(R.firstChild);break;case"select":R=typeof v.is=="string"?V.createElement("select",{is:v.is}):V.createElement("select"),v.multiple?R.multiple=!0:v.size&&(R.size=v.size);break;default:R=typeof v.is=="string"?V.createElement(A,{is:v.is}):V.createElement(A)}}R[An]=o,R[ut]=v;e:for(V=o.child;V!==null;){if(V.tag===5||V.tag===6)R.appendChild(V.stateNode);else if(V.tag!==4&&V.tag!==27&&V.child!==null){V.child.return=V,V=V.child;continue}if(V===o)break e;for(;V.sibling===null;){if(V.return===null||V.return===o)break e;V=V.return}V.sibling.return=V.return,V=V.sibling}o.stateNode=R;e:switch(sr(R,A,v),A){case"button":case"input":case"select":case"textarea":v=!!v.autoFocus;break e;case"img":v=!0;break e;default:v=!1}v&&Wl(o)}}return Ci(o),Yp(o,o.type,i===null?null:i.memoizedProps,o.pendingProps,f),null;case 6:if(i&&o.stateNode!=null)i.memoizedProps!==v&&Wl(o);else{if(typeof v!="string"&&o.stateNode===null)throw Error(m(166));if(i=Lt.current,ao(o)){if(i=o.stateNode,f=o.memoizedProps,v=null,A=Hi,A!==null)switch(A.tag){case 27:case 5:v=A.memoizedProps}i[An]=o,i=!!(i.nodeValue===f||v!==null&&v.suppressHydrationWarning===!0||ng(i.nodeValue,f)),i||Jr(o,!0)}else i=g1(i).createTextNode(v),i[An]=o,o.stateNode=i}return Ci(o),null;case 31:if(f=o.memoizedState,i===null||i.memoizedState!==null){if(v=ao(o),f!==null){if(i===null){if(!v)throw Error(m(318));if(i=o.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(m(557));i[An]=o}else so(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Ci(o),i=!1}else f=oo(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=f),i=!0;if(!i)return o.flags&256?(wa(o),o):(wa(o),null);if((o.flags&128)!==0)throw Error(m(558))}return Ci(o),null;case 13:if(v=o.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(A=ao(o),v!==null&&v.dehydrated!==null){if(i===null){if(!A)throw Error(m(318));if(A=o.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(m(317));A[An]=o}else so(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Ci(o),A=!1}else A=oo(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=A),A=!0;if(!A)return o.flags&256?(wa(o),o):(wa(o),null)}return wa(o),(o.flags&128)!==0?(o.lanes=f,o):(f=v!==null,i=i!==null&&i.memoizedState!==null,f&&(v=o.child,A=null,v.alternate!==null&&v.alternate.memoizedState!==null&&v.alternate.memoizedState.cachePool!==null&&(A=v.alternate.memoizedState.cachePool.pool),R=null,v.memoizedState!==null&&v.memoizedState.cachePool!==null&&(R=v.memoizedState.cachePool.pool),R!==A&&(v.flags|=2048)),f!==i&&f&&(o.child.flags|=8192),Wh(o,o.updateQueue),Ci(o),null);case 4:return xn(),i===null&&h1(o.stateNode.containerInfo),Ci(o),null;case 10:return us(o.type),Ci(o),null;case 19:if(Be(mi),v=o.memoizedState,v===null)return Ci(o),null;if(A=(o.flags&128)!==0,R=v.rendering,R===null)if(A)Kh(v,!1);else{if(Yi!==0||i!==null&&(i.flags&128)!==0)for(i=o.child;i!==null;){if(R=ui(i),R!==null){for(o.flags|=128,Kh(v,!1),i=R.updateQueue,o.updateQueue=i,Wh(o,i),o.subtreeFlags=0,i=f,f=o.child;f!==null;)$p(f,i),f=f.sibling;return pt(mi,mi.current&1|2),wn&&ro(o,v.treeForkCount),o.child}i=i.sibling}v.tail!==null&&Ji()>eh&&(o.flags|=128,A=!0,Kh(v,!1),o.lanes=4194304)}else{if(!A)if(i=ui(R),i!==null){if(o.flags|=128,A=!0,i=i.updateQueue,o.updateQueue=i,Wh(o,i),Kh(v,!0),v.tail===null&&v.tailMode==="hidden"&&!R.alternate&&!wn)return Ci(o),null}else 2*Ji()-v.renderingStartTime>eh&&f!==536870912&&(o.flags|=128,A=!0,Kh(v,!1),o.lanes=4194304);v.isBackwards?(R.sibling=o.child,o.child=R):(i=v.last,i!==null?i.sibling=R:o.child=R,v.last=R)}return v.tail!==null?(i=v.tail,v.rendering=i,v.tail=i.sibling,v.renderingStartTime=Ji(),i.sibling=null,f=mi.current,pt(mi,A?f&1|2:f&1),wn&&ro(o,v.treeForkCount),i):(Ci(o),null);case 22:case 23:return wa(o),Nc(),v=o.memoizedState!==null,i!==null?i.memoizedState!==null!==v&&(o.flags|=8192):v&&(o.flags|=8192),v?(f&536870912)!==0&&(o.flags&128)===0&&(Ci(o),o.subtreeFlags&6&&(o.flags|=8192)):Ci(o),f=o.updateQueue,f!==null&&Wh(o,f.retryQueue),f=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),v=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(v=o.memoizedState.cachePool.pool),v!==f&&(o.flags|=2048),i!==null&&Be(Ko),null;case 24:return f=null,i!==null&&(f=i.memoizedState.cache),o.memoizedState.cache!==f&&(o.flags|=2048),us(li),Ci(o),null;case 25:return null;case 30:return null}throw Error(m(156,o.tag))}function t_(i,o){switch(zc(o),o.tag){case 1:return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 3:return us(li),xn(),i=o.flags,(i&65536)!==0&&(i&128)===0?(o.flags=i&-65537|128,o):null;case 26:case 27:case 5:return ai(o),null;case 31:if(o.memoizedState!==null){if(wa(o),o.alternate===null)throw Error(m(340));so()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 13:if(wa(o),i=o.memoizedState,i!==null&&i.dehydrated!==null){if(o.alternate===null)throw Error(m(340));so()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 19:return Be(mi),null;case 4:return xn(),null;case 10:return us(o.type),null;case 22:case 23:return wa(o),Nc(),i!==null&&Be(Ko),i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 24:return us(li),null;case 25:return null;default:return null}}function L0(i,o){switch(zc(o),o.tag){case 3:us(li),xn();break;case 26:case 27:case 5:ai(o);break;case 4:xn();break;case 31:o.memoizedState!==null&&wa(o);break;case 13:wa(o);break;case 19:Be(mi);break;case 10:us(o.type);break;case 22:case 23:wa(o),Nc(),i!==null&&Be(Ko);break;case 24:us(li)}}function Zc(i,o){try{var f=o.updateQueue,v=f!==null?f.lastEffect:null;if(v!==null){var A=v.next;f=A;do{if((f.tag&i)===i){v=void 0;var R=f.create,V=f.inst;v=R(),V.destroy=v}f=f.next}while(f!==A)}}catch(ee){Jn(o,o.return,ee)}}function cl(i,o,f){try{var v=o.updateQueue,A=v!==null?v.lastEffect:null;if(A!==null){var R=A.next;v=R;do{if((v.tag&i)===i){var V=v.inst,ee=V.destroy;if(ee!==void 0){V.destroy=void 0,A=o;var xe=f,Ge=ee;try{Ge()}catch(Ke){Jn(A,xe,Ke)}}}v=v.next}while(v!==R)}}catch(Ke){Jn(o,o.return,Ke)}}function Em(i){var o=i.updateQueue;if(o!==null){var f=i.stateNode;try{Uu(o,f)}catch(v){Jn(i,i.return,v)}}}function Gc(i,o,f){f.props=ys(i.type,i.memoizedProps),f.state=i.memoizedState;try{f.componentWillUnmount()}catch(v){Jn(i,o,v)}}function Kl(i,o){try{var f=i.ref;if(f!==null){switch(i.tag){case 26:case 27:case 5:var v=i.stateNode;break;case 30:v=i.stateNode;break;default:v=i.stateNode}typeof f=="function"?i.refCleanup=f(v):f.current=v}}catch(A){Jn(i,o,A)}}function ul(i,o){var f=i.ref,v=i.refCleanup;if(f!==null)if(typeof v=="function")try{v()}catch(A){Jn(i,o,A)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof f=="function")try{f(null)}catch(A){Jn(i,o,A)}else f.current=null}function P0(i){var o=i.type,f=i.memoizedProps,v=i.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":f.autoFocus&&v.focus();break e;case"img":f.src?v.src=f.src:f.srcSet&&(v.srcset=f.srcSet)}}catch(A){Jn(i,i.return,A)}}function Mm(i,o,f){try{var v=i.stateNode;ih(v,i.type,f,o),v[ut]=o}catch(A){Jn(i,i.return,A)}}function R0(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&wo(i.type)||i.tag===4}function Am(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||R0(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&wo(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Lm(i,o,f){var v=i.tag;if(v===5||v===6)i=i.stateNode,o?(f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f).insertBefore(i,o):(o=f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f,o.appendChild(i),f=f._reactRootContainer,f!=null||o.onclick!==null||(o.onclick=da));else if(v!==4&&(v===27&&wo(i.type)&&(f=i.stateNode,o=null),i=i.child,i!==null))for(Lm(i,o,f),i=i.sibling;i!==null;)Lm(i,o,f),i=i.sibling}function Qp(i,o,f){var v=i.tag;if(v===5||v===6)i=i.stateNode,o?f.insertBefore(i,o):f.appendChild(i);else if(v!==4&&(v===27&&wo(i.type)&&(f=i.stateNode),i=i.child,i!==null))for(Qp(i,o,f),i=i.sibling;i!==null;)Qp(i,o,f),i=i.sibling}function Wp(i){var o=i.stateNode,f=i.memoizedProps;try{for(var v=i.type,A=o.attributes;A.length;)o.removeAttributeNode(A[0]);sr(o,v,f),o[An]=i,o[ut]=f}catch(R){Jn(i,i.return,R)}}var Jl=!1,ar=!1,Hu=!1,I0=typeof WeakSet=="function"?WeakSet:Set,Cn=null;function Jh(i,o){if(i=i.containerInfo,p1=jt,i=Ln(i),Fh(i)){if("selectionStart"in i)var f={start:i.selectionStart,end:i.selectionEnd};else e:{f=(f=i.ownerDocument)&&f.defaultView||window;var v=f.getSelection&&f.getSelection();if(v&&v.rangeCount!==0){f=v.anchorNode;var A=v.anchorOffset,R=v.focusNode;v=v.focusOffset;try{f.nodeType,R.nodeType}catch{f=null;break e}var V=0,ee=-1,xe=-1,Ge=0,Ke=0,at=i,He=null;t:for(;;){for(var Ye;at!==f||A!==0&&at.nodeType!==3||(ee=V+A),at!==R||v!==0&&at.nodeType!==3||(xe=V+v),at.nodeType===3&&(V+=at.nodeValue.length),(Ye=at.firstChild)!==null;)He=at,at=Ye;for(;;){if(at===i)break t;if(He===f&&++Ge===A&&(ee=V),He===R&&++Ke===v&&(xe=V),(Ye=at.nextSibling)!==null)break;at=He,He=at.parentNode}at=Ye}f=ee===-1||xe===-1?null:{start:ee,end:xe}}else f=null}f=f||{start:0,end:0}}else f=null;for(m1={focusedElem:i,selectionRange:f},jt=!1,Cn=o;Cn!==null;)if(o=Cn,i=o.child,(o.subtreeFlags&1028)!==0&&i!==null)i.return=o,Cn=i;else for(;Cn!==null;){switch(o=Cn,R=o.alternate,i=o.flags,o.tag){case 0:if((i&4)!==0&&(i=o.updateQueue,i=i!==null?i.events:null,i!==null))for(f=0;f<i.length;f++)A=i[f],A.ref.impl=A.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&R!==null){i=void 0,f=o,A=R.memoizedProps,R=R.memoizedState,v=f.stateNode;try{var Nt=ys(f.type,A);i=v.getSnapshotBeforeUpdate(Nt,R),v.__reactInternalSnapshotBeforeUpdate=i}catch(nn){Jn(f,f.return,nn)}}break;case 3:if((i&1024)!==0){if(i=o.stateNode.containerInfo,f=i.nodeType,f===9)hd(i);else if(f===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":hd(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(m(163))}if(i=o.sibling,i!==null){i.return=o.return,Cn=i;break}Cn=o.return}}function Pm(i,o,f){var v=f.flags;switch(f.tag){case 0:case 11:case 15:ec(i,f),v&4&&Zc(5,f);break;case 1:if(ec(i,f),v&4)if(i=f.stateNode,o===null)try{i.componentDidMount()}catch(V){Jn(f,f.return,V)}else{var A=ys(f.type,o.memoizedProps);o=o.memoizedState;try{i.componentDidUpdate(A,o,i.__reactInternalSnapshotBeforeUpdate)}catch(V){Jn(f,f.return,V)}}v&64&&Em(f),v&512&&Kl(f,f.return);break;case 3:if(ec(i,f),v&64&&(i=f.updateQueue,i!==null)){if(o=null,f.child!==null)switch(f.child.tag){case 27:case 5:o=f.child.stateNode;break;case 1:o=f.child.stateNode}try{Uu(i,o)}catch(V){Jn(f,f.return,V)}}break;case 27:o===null&&v&4&&Wp(f);case 26:case 5:ec(i,f),o===null&&v&4&&P0(f),v&512&&Kl(f,f.return);break;case 12:ec(i,f);break;case 31:ec(i,f),v&4&&ed(i,f);break;case 13:ec(i,f),v&4&&Kp(i,f),v&64&&(i=f.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(f=s_.bind(null,f),Or(i,f))));break;case 22:if(v=f.memoizedState!==null||Jl,!v){o=o!==null&&o.memoizedState!==null||ar,A=Jl;var R=ar;Jl=v,(ar=o)&&!R?_s(i,f,(f.subtreeFlags&8772)!==0):ec(i,f),Jl=A,ar=R}break;case 30:break;default:ec(i,f)}}function If(i){var o=i.alternate;o!==null&&(i.alternate=null,If(o)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(o=i.stateNode,o!==null&&ko(o)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var xi=null,Dr=!1;function hl(i,o,f){for(f=f.child;f!==null;)Rm(i,o,f),f=f.sibling}function Rm(i,o,f){if(me&&typeof me.onCommitFiberUnmount=="function")try{me.onCommitFiberUnmount(he,f)}catch{}switch(f.tag){case 26:ar||ul(f,o),hl(i,o,f),f.memoizedState?f.memoizedState.count--:f.stateNode&&(f=f.stateNode,f.parentNode.removeChild(f));break;case 27:ar||ul(f,o);var v=xi,A=Dr;wo(f.type)&&(xi=f.stateNode,Dr=!1),hl(i,o,f),dd(f.stateNode),xi=v,Dr=A;break;case 5:ar||ul(f,o);case 6:if(v=xi,A=Dr,xi=null,hl(i,o,f),xi=v,Dr=A,xi!==null)if(Dr)try{(xi.nodeType===9?xi.body:xi.nodeName==="HTML"?xi.ownerDocument.body:xi).removeChild(f.stateNode)}catch(R){Jn(f,o,R)}else try{xi.removeChild(f.stateNode)}catch(R){Jn(f,o,R)}break;case 18:xi!==null&&(Dr?(i=xi,sg(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,f.stateNode),sa(i)):sg(xi,f.stateNode));break;case 4:v=xi,A=Dr,xi=f.stateNode.containerInfo,Dr=!0,hl(i,o,f),xi=v,Dr=A;break;case 0:case 11:case 14:case 15:cl(2,f,o),ar||cl(4,f,o),hl(i,o,f);break;case 1:ar||(ul(f,o),v=f.stateNode,typeof v.componentWillUnmount=="function"&&Gc(f,o,v)),hl(i,o,f);break;case 21:hl(i,o,f);break;case 22:ar=(v=ar)||f.memoizedState!==null,hl(i,o,f),ar=v;break;default:hl(i,o,f)}}function ed(i,o){if(o.memoizedState===null&&(i=o.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{sa(i)}catch(f){Jn(o,o.return,f)}}}function Kp(i,o){if(o.memoizedState===null&&(i=o.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{sa(i)}catch(f){Jn(o,o.return,f)}}function td(i){switch(i.tag){case 31:case 13:case 19:var o=i.stateNode;return o===null&&(o=i.stateNode=new I0),o;case 22:return i=i.stateNode,o=i._retryCache,o===null&&(o=i._retryCache=new I0),o;default:throw Error(m(435,i.tag))}}function Xu(i,o){var f=td(i);o.forEach(function(v){if(!f.has(v)){f.add(v);var A=o_.bind(null,i,v);v.then(A,A)}})}function Cr(i,o){var f=o.deletions;if(f!==null)for(var v=0;v<f.length;v++){var A=f[v],R=i,V=o,ee=V;e:for(;ee!==null;){switch(ee.tag){case 27:if(wo(ee.type)){xi=ee.stateNode,Dr=!1;break e}break;case 5:xi=ee.stateNode,Dr=!1;break e;case 3:case 4:xi=ee.stateNode.containerInfo,Dr=!0;break e}ee=ee.return}if(xi===null)throw Error(m(160));Rm(R,V,A),xi=null,Dr=!1,R=A.alternate,R!==null&&(R.return=null),A.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)z0(o,i),o=o.sibling}var Ta=null;function z0(i,o){var f=i.alternate,v=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:Cr(o,i),Ea(i),v&4&&(cl(3,i,i.return),Zc(3,i),cl(5,i,i.return));break;case 1:Cr(o,i),Ea(i),v&512&&(ar||f===null||ul(f,f.return)),v&64&&Jl&&(i=i.updateQueue,i!==null&&(v=i.callbacks,v!==null&&(f=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=f===null?v:f.concat(v))));break;case 26:var A=Ta;if(Cr(o,i),Ea(i),v&512&&(ar||f===null||ul(f,f.return)),v&4){var R=f!==null?f.memoizedState:null;if(v=i.memoizedState,f===null)if(v===null)if(i.stateNode===null){e:{v=i.type,f=i.memoizedProps,A=A.ownerDocument||A;t:switch(v){case"title":R=A.getElementsByTagName("title")[0],(!R||R[rn]||R[An]||R.namespaceURI==="http://www.w3.org/2000/svg"||R.hasAttribute("itemprop"))&&(R=A.createElement(v),A.head.insertBefore(R,A.querySelector("head > title"))),sr(R,v,f),R[An]=i,bi(R),v=R;break e;case"link":var V=F("link","href",A).get(v+(f.href||""));if(V){for(var ee=0;ee<V.length;ee++)if(R=V[ee],R.getAttribute("href")===(f.href==null||f.href===""?null:f.href)&&R.getAttribute("rel")===(f.rel==null?null:f.rel)&&R.getAttribute("title")===(f.title==null?null:f.title)&&R.getAttribute("crossorigin")===(f.crossOrigin==null?null:f.crossOrigin)){V.splice(ee,1);break t}}R=A.createElement(v),sr(R,v,f),A.head.appendChild(R);break;case"meta":if(V=F("meta","content",A).get(v+(f.content||""))){for(ee=0;ee<V.length;ee++)if(R=V[ee],R.getAttribute("content")===(f.content==null?null:""+f.content)&&R.getAttribute("name")===(f.name==null?null:f.name)&&R.getAttribute("property")===(f.property==null?null:f.property)&&R.getAttribute("http-equiv")===(f.httpEquiv==null?null:f.httpEquiv)&&R.getAttribute("charset")===(f.charSet==null?null:f.charSet)){V.splice(ee,1);break t}}R=A.createElement(v),sr(R,v,f),A.head.appendChild(R);break;default:throw Error(m(468,v))}R[An]=i,bi(R),v=R}i.stateNode=v}else j(A,i.type,i.stateNode);else i.stateNode=b(A,v,i.memoizedProps);else R!==v?(R===null?f.stateNode!==null&&(f=f.stateNode,f.parentNode.removeChild(f)):R.count--,v===null?j(A,i.type,i.stateNode):b(A,v,i.memoizedProps)):v===null&&i.stateNode!==null&&Mm(i,i.memoizedProps,f.memoizedProps)}break;case 27:Cr(o,i),Ea(i),v&512&&(ar||f===null||ul(f,f.return)),f!==null&&v&4&&Mm(i,i.memoizedProps,f.memoizedProps);break;case 5:if(Cr(o,i),Ea(i),v&512&&(ar||f===null||ul(f,f.return)),i.flags&32){A=i.stateNode;try{As(A,"")}catch(Nt){Jn(i,i.return,Nt)}}v&4&&i.stateNode!=null&&(A=i.memoizedProps,Mm(i,A,f!==null?f.memoizedProps:A)),v&1024&&(Hu=!0);break;case 6:if(Cr(o,i),Ea(i),v&4){if(i.stateNode===null)throw Error(m(162));v=i.memoizedProps,f=i.stateNode;try{f.nodeValue=v}catch(Nt){Jn(i,i.return,Nt)}}break;case 3:if(z=null,A=Ta,Ta=Yf(o.containerInfo),Cr(o,i),Ta=A,Ea(i),v&4&&f!==null&&f.memoizedState.isDehydrated)try{sa(o.containerInfo)}catch(Nt){Jn(i,i.return,Nt)}Hu&&(Hu=!1,qc(i));break;case 4:v=Ta,Ta=Yf(i.stateNode.containerInfo),Cr(o,i),Ea(i),Ta=v;break;case 12:Cr(o,i),Ea(i);break;case 31:Cr(o,i),Ea(i),v&4&&(v=i.updateQueue,v!==null&&(i.updateQueue=null,Xu(i,v)));break;case 13:Cr(o,i),Ea(i),i.child.flags&8192&&i.memoizedState!==null!=(f!==null&&f.memoizedState!==null)&&(Bf=Ji()),v&4&&(v=i.updateQueue,v!==null&&(i.updateQueue=null,Xu(i,v)));break;case 22:A=i.memoizedState!==null;var xe=f!==null&&f.memoizedState!==null,Ge=Jl,Ke=ar;if(Jl=Ge||A,ar=Ke||xe,Cr(o,i),ar=Ke,Jl=Ge,Ea(i),v&8192)e:for(o=i.stateNode,o._visibility=A?o._visibility&-2:o._visibility|1,A&&(f===null||xe||Jl||ar||Hc(i)),f=null,o=i;;){if(o.tag===5||o.tag===26){if(f===null){xe=f=o;try{if(R=xe.stateNode,A)V=R.style,typeof V.setProperty=="function"?V.setProperty("display","none","important"):V.display="none";else{ee=xe.stateNode;var at=xe.memoizedProps.style,He=at!=null&&at.hasOwnProperty("display")?at.display:null;ee.style.display=He==null||typeof He=="boolean"?"":(""+He).trim()}}catch(Nt){Jn(xe,xe.return,Nt)}}}else if(o.tag===6){if(f===null){xe=o;try{xe.stateNode.nodeValue=A?"":xe.memoizedProps}catch(Nt){Jn(xe,xe.return,Nt)}}}else if(o.tag===18){if(f===null){xe=o;try{var Ye=xe.stateNode;A?Xf(Ye,!0):Xf(xe.stateNode,!1)}catch(Nt){Jn(xe,xe.return,Nt)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===i)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===i)break e;for(;o.sibling===null;){if(o.return===null||o.return===i)break e;f===o&&(f=null),o=o.return}f===o&&(f=null),o.sibling.return=o.return,o=o.sibling}v&4&&(v=i.updateQueue,v!==null&&(f=v.retryQueue,f!==null&&(v.retryQueue=null,Xu(i,f))));break;case 19:Cr(o,i),Ea(i),v&4&&(v=i.updateQueue,v!==null&&(i.updateQueue=null,Xu(i,v)));break;case 30:break;case 21:break;default:Cr(o,i),Ea(i)}}function Ea(i){var o=i.flags;if(o&2){try{for(var f,v=i.return;v!==null;){if(R0(v)){f=v;break}v=v.return}if(f==null)throw Error(m(160));switch(f.tag){case 27:var A=f.stateNode,R=Am(i);Qp(i,R,A);break;case 5:var V=f.stateNode;f.flags&32&&(As(V,""),f.flags&=-33);var ee=Am(i);Qp(i,ee,V);break;case 3:case 4:var xe=f.stateNode.containerInfo,Ge=Am(i);Lm(i,Ge,xe);break;default:throw Error(m(161))}}catch(Ke){Jn(i,i.return,Ke)}i.flags&=-3}o&4096&&(i.flags&=-4097)}function qc(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var o=i;qc(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),i=i.sibling}}function ec(i,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)Pm(i,o.alternate,o),o=o.sibling}function Hc(i){for(i=i.child;i!==null;){var o=i;switch(o.tag){case 0:case 11:case 14:case 15:cl(4,o,o.return),Hc(o);break;case 1:ul(o,o.return);var f=o.stateNode;typeof f.componentWillUnmount=="function"&&Gc(o,o.return,f),Hc(o);break;case 27:dd(o.stateNode);case 26:case 5:ul(o,o.return),Hc(o);break;case 22:o.memoizedState===null&&Hc(o);break;case 30:Hc(o);break;default:Hc(o)}i=i.sibling}}function _s(i,o,f){for(f=f&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var v=o.alternate,A=i,R=o,V=R.flags;switch(R.tag){case 0:case 11:case 15:_s(A,R,f),Zc(4,R);break;case 1:if(_s(A,R,f),v=R,A=v.stateNode,typeof A.componentDidMount=="function")try{A.componentDidMount()}catch(Ge){Jn(v,v.return,Ge)}if(v=R,A=v.updateQueue,A!==null){var ee=v.stateNode;try{var xe=A.shared.hiddenCallbacks;if(xe!==null)for(A.shared.hiddenCallbacks=null,A=0;A<xe.length;A++)hs(xe[A],ee)}catch(Ge){Jn(v,v.return,Ge)}}f&&V&64&&Em(R),Kl(R,R.return);break;case 27:Wp(R);case 26:case 5:_s(A,R,f),f&&v===null&&V&4&&P0(R),Kl(R,R.return);break;case 12:_s(A,R,f);break;case 31:_s(A,R,f),f&&V&4&&ed(A,R);break;case 13:_s(A,R,f),f&&V&4&&Kp(A,R);break;case 22:R.memoizedState===null&&_s(A,R,f),Kl(R,R.return);break;case 30:break;default:_s(A,R,f)}o=o.sibling}}function zf(i,o){var f=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),i=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(i=o.memoizedState.cachePool.pool),i!==f&&(i!=null&&i.refCount++,f!=null&&Rr(f))}function Jp(i,o){i=null,o.alternate!==null&&(i=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==i&&(o.refCount++,i!=null&&Rr(i))}function Vs(i,o,f,v){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)D0(i,o,f,v),o=o.sibling}function D0(i,o,f,v){var A=o.flags;switch(o.tag){case 0:case 11:case 15:Vs(i,o,f,v),A&2048&&Zc(9,o);break;case 1:Vs(i,o,f,v);break;case 3:Vs(i,o,f,v),A&2048&&(i=null,o.alternate!==null&&(i=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==i&&(o.refCount++,i!=null&&Rr(i)));break;case 12:if(A&2048){Vs(i,o,f,v),i=o.stateNode;try{var R=o.memoizedProps,V=R.id,ee=R.onPostCommit;typeof ee=="function"&&ee(V,o.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(xe){Jn(o,o.return,xe)}}else Vs(i,o,f,v);break;case 31:Vs(i,o,f,v);break;case 13:Vs(i,o,f,v);break;case 23:break;case 22:R=o.stateNode,V=o.alternate,o.memoizedState!==null?R._visibility&2?Vs(i,o,f,v):Df(i,o):R._visibility&2?Vs(i,o,f,v):(R._visibility|=2,nd(i,o,f,v,(o.subtreeFlags&10256)!==0||!1)),A&2048&&zf(V,o);break;case 24:Vs(i,o,f,v),A&2048&&Jp(o.alternate,o);break;default:Vs(i,o,f,v)}}function nd(i,o,f,v,A){for(A=A&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var R=i,V=o,ee=f,xe=v,Ge=V.flags;switch(V.tag){case 0:case 11:case 15:nd(R,V,ee,xe,A),Zc(8,V);break;case 23:break;case 22:var Ke=V.stateNode;V.memoizedState!==null?Ke._visibility&2?nd(R,V,ee,xe,A):Df(R,V):(Ke._visibility|=2,nd(R,V,ee,xe,A)),A&&Ge&2048&&zf(V.alternate,V);break;case 24:nd(R,V,ee,xe,A),A&&Ge&2048&&Jp(V.alternate,V);break;default:nd(R,V,ee,xe,A)}o=o.sibling}}function Df(i,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var f=i,v=o,A=v.flags;switch(v.tag){case 22:Df(f,v),A&2048&&zf(v.alternate,v);break;case 24:Df(f,v),A&2048&&Jp(v.alternate,v);break;default:Df(f,v)}o=o.sibling}}var Of=8192;function id(i,o,f){if(i.subtreeFlags&Of)for(i=i.child;i!==null;)Yu(i,o,f),i=i.sibling}function Yu(i,o,f){switch(i.tag){case 26:id(i,o,f),i.flags&Of&&i.memoizedState!==null&&J(f,Ta,i.memoizedState,i.memoizedProps);break;case 5:id(i,o,f);break;case 3:case 4:var v=Ta;Ta=Yf(i.stateNode.containerInfo),id(i,o,f),Ta=v;break;case 22:i.memoizedState===null&&(v=i.alternate,v!==null&&v.memoizedState!==null?(v=Of,Of=16777216,id(i,o,f),Of=v):id(i,o,f));break;default:id(i,o,f)}}function O0(i){var o=i.alternate;if(o!==null&&(i=o.child,i!==null)){o.child=null;do o=i.sibling,i.sibling=null,i=o;while(i!==null)}}function kf(i){var o=i.deletions;if((i.flags&16)!==0){if(o!==null)for(var f=0;f<o.length;f++){var v=o[f];Cn=v,zm(v,i)}O0(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Im(i),i=i.sibling}function Im(i){switch(i.tag){case 0:case 11:case 15:kf(i),i.flags&2048&&cl(9,i,i.return);break;case 3:kf(i);break;case 12:kf(i);break;case 22:var o=i.stateNode;i.memoizedState!==null&&o._visibility&2&&(i.return===null||i.return.tag!==13)?(o._visibility&=-3,e1(i)):kf(i);break;default:kf(i)}}function e1(i){var o=i.deletions;if((i.flags&16)!==0){if(o!==null)for(var f=0;f<o.length;f++){var v=o[f];Cn=v,zm(v,i)}O0(i)}for(i=i.child;i!==null;){switch(o=i,o.tag){case 0:case 11:case 15:cl(8,o,o.return),e1(o);break;case 22:f=o.stateNode,f._visibility&2&&(f._visibility&=-3,e1(o));break;default:e1(o)}i=i.sibling}}function zm(i,o){for(;Cn!==null;){var f=Cn;switch(f.tag){case 0:case 11:case 15:cl(8,f,o);break;case 23:case 22:if(f.memoizedState!==null&&f.memoizedState.cachePool!==null){var v=f.memoizedState.cachePool.pool;v!=null&&v.refCount++}break;case 24:Rr(f.memoizedState.cache)}if(v=f.child,v!==null)v.return=f,Cn=v;else e:for(f=i;Cn!==null;){v=Cn;var A=v.sibling,R=v.return;if(If(v),v===f){Cn=null;break e}if(A!==null){A.return=R,Cn=A;break e}Cn=R}}}var n_={getCacheForType:function(i){var o=gr(li),f=o.data.get(i);return f===void 0&&(f=i(),o.data.set(i,f)),f},cacheSignal:function(){return gr(li).controller.signal}},Dm=typeof WeakMap=="function"?WeakMap:Map,Bn=0,di=null,Pn=null,In=0,ri=0,Ha=null,Xc=!1,rd=!1,Qu=!1,dl=0,Yi=0,Yc=0,Wu=0,Om=0,vs=0,Ku=0,Ju=null,Ma=null,t1=!1,Bf=0,k0=0,eh=1/0,n1=null,tc=null,Tr=0,Qc=null,ad=null,fl=0,km=0,Bm=null,sd=null,Oi=0,Ff=null;function Xa(){return(Bn&2)!==0&&In!==0?In&-In:$e.T!==null?Kc():is()}function Fm(){if(vs===0)if((In&536870912)===0||wn){var i=Pt;Pt<<=1,(Pt&3932160)===0&&(Pt=262144),vs=i}else vs=536870912;return i=ci.current,i!==null&&(i.flags|=32),vs}function ra(i,o,f){(i===di&&(ri===2||ri===9)||i.cancelPendingCommit!==null)&&(od(i,0),Wc(i,In,vs,!1)),Ai(i,f),((Bn&2)===0||i!==di)&&(i===di&&((Bn&2)===0&&(Wu|=f),Yi===4&&Wc(i,In,vs,!1)),xo(i))}function th(i,o,f){if((Bn&6)!==0)throw Error(m(327));var v=!f&&(o&127)===0&&(o&i.expiredLanes)===0||En(i,o),A=v?$0(i,o):$m(i,o,!0),R=v;do{if(A===0){rd&&!v&&Wc(i,o,0,!1);break}else{if(f=i.current.alternate,R&&!i_(f)){A=$m(i,o,!1),R=!1;continue}if(A===2){if(R=o,i.errorRecoveryDisabledLanes&R)var V=0;else V=i.pendingLanes&-536870913,V=V!==0?V:V&536870912?536870912:0;if(V!==0){o=V;e:{var ee=i;A=Ju;var xe=ee.current.memoizedState.isDehydrated;if(xe&&(od(ee,V).flags|=256),V=$m(ee,V,!1),V!==2){if(Qu&&!xe){ee.errorRecoveryDisabledLanes|=R,Wu|=R,A=4;break e}R=Ma,Ma=A,R!==null&&(Ma===null?Ma=R:Ma.push.apply(Ma,R))}A=V}if(R=!1,A!==2)continue}}if(A===1){od(i,0),Wc(i,o,0,!0);break}e:{switch(v=i,R=A,R){case 0:case 1:throw Error(m(345));case 4:if((o&4194048)!==o)break;case 6:Wc(v,o,vs,!Xc);break e;case 2:Ma=null;break;case 3:case 5:break;default:throw Error(m(329))}if((o&62914560)===o&&(A=Bf+300-Ji(),10<A)){if(Wc(v,o,vs,!Xc),mn(v,0,!0)!==0)break e;fl=o,v.timeoutHandle=ag(Nm.bind(null,v,f,Ma,n1,t1,o,vs,Wu,Ku,Xc,R,"Throttled",-0,0),A);break e}Nm(v,f,Ma,n1,t1,o,vs,Wu,Ku,Xc,R,null,-0,0)}}break}while(!0);xo(i)}function Nm(i,o,f,v,A,R,V,ee,xe,Ge,Ke,at,He,Ye){if(i.timeoutHandle=-1,at=o.subtreeFlags,at&8192||(at&16785408)===16785408){at={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:da},Yu(o,R,at);var Nt=(R&62914560)===R?Bf-Ji():(R&4194048)===R?k0-Ji():0;if(Nt=le(at,Nt),Nt!==null){fl=R,i.cancelPendingCommit=Nt(Uf.bind(null,i,o,R,f,v,A,V,ee,xe,Ke,at,null,He,Ye)),Wc(i,R,V,!Ge);return}}Uf(i,o,R,f,v,A,V,ee,xe)}function i_(i){for(var o=i;;){var f=o.tag;if((f===0||f===11||f===15)&&o.flags&16384&&(f=o.updateQueue,f!==null&&(f=f.stores,f!==null)))for(var v=0;v<f.length;v++){var A=f[v],R=A.getSnapshot;A=A.value;try{if(!$r(R(),A))return!1}catch{return!1}}if(f=o.child,o.subtreeFlags&16384&&f!==null)f.return=o,o=f;else{if(o===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function Wc(i,o,f,v){o&=~Om,o&=~Wu,i.suspendedLanes|=o,i.pingedLanes&=~o,v&&(i.warmLanes|=o),v=i.expirationTimes;for(var A=o;0<A;){var R=31-De(A),V=1<<R;v[R]=-1,A&=~V}f!==0&&ur(i,f,o)}function i1(){return(Bn&6)===0?(nh(0),!1):!0}function Um(){if(Pn!==null){if(ri===0)var i=Pn.return;else i=Pn,cs=ks=null,d(i),nl=null,Bc=0,i=Pn;for(;i!==null;)L0(i.alternate,i),i=i.return;Pn=null}}function od(i,o){var f=i.timeoutHandle;f!==-1&&(i.timeoutHandle=-1,d_(f)),f=i.cancelPendingCommit,f!==null&&(i.cancelPendingCommit=null,f()),fl=0,Um(),di=i,Pn=f=ya(i.current,null),In=o,ri=0,Ha=null,Xc=!1,rd=En(i,o),Qu=!1,Ku=vs=Om=Wu=Yc=Yi=0,Ma=Ju=null,t1=!1,(o&8)!==0&&(o|=o&32);var v=i.entangledLanes;if(v!==0)for(i=i.entanglements,v&=o;0<v;){var A=31-De(v),R=1<<A;o|=i[A],v&=~R}return dl=o,kl(),f}function B0(i,o){tn=null,$e.H=Yl,o===Vl||o===Jo?(o=vf(),ri=3):o===Ou?(o=vf(),ri=4):ri=o===Tf?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,Ha=o,Pn===null&&(Yi=1,Sf(i,jr(o,i.current)))}function F0(){var i=ci.current;return i===null?!0:(In&4194048)===In?ba===null:(In&62914560)===In||(In&536870912)!==0?i===ba:!1}function N0(){var i=$e.H;return $e.H=Yl,i===null?Yl:i}function U0(){var i=$e.A;return $e.A=n_,i}function r1(){Yi=4,Xc||(In&4194048)!==In&&ci.current!==null||(rd=!0),(Yc&134217727)===0&&(Wu&134217727)===0||di===null||Wc(di,In,vs,!1)}function $m(i,o,f){var v=Bn;Bn|=2;var A=N0(),R=U0();(di!==i||In!==o)&&(n1=null,od(i,o)),o=!1;var V=Yi;e:do try{if(ri!==0&&Pn!==null){var ee=Pn,xe=Ha;switch(ri){case 8:Um(),V=6;break e;case 3:case 2:case 9:case 6:ci.current===null&&(o=!0);var Ge=ri;if(ri=0,Ha=null,pl(i,ee,xe,Ge),f&&rd){V=0;break e}break;default:Ge=ri,ri=0,Ha=null,pl(i,ee,xe,Ge)}}r_(),V=Yi;break}catch(Ke){B0(i,Ke)}while(!0);return o&&i.shellSuspendCounter++,cs=ks=null,Bn=v,$e.H=A,$e.A=R,Pn===null&&(di=null,In=0,kl()),V}function r_(){for(;Pn!==null;)jm(Pn)}function $0(i,o){var f=Bn;Bn|=2;var v=N0(),A=U0();di!==i||In!==o?(n1=null,eh=Ji()+500,od(i,o)):rd=En(i,o);e:do try{if(ri!==0&&Pn!==null){o=Pn;var R=Ha;t:switch(ri){case 1:ri=0,Ha=null,pl(i,o,R,1);break;case 2:case 9:if(tl(R)){ri=0,Ha=null,nc(o);break}o=function(){ri!==2&&ri!==9||di!==i||(ri=7),xo(i)},R.then(o,o);break e;case 3:ri=7;break e;case 4:ri=5;break e;case 7:tl(R)?(ri=0,Ha=null,nc(o)):(ri=0,Ha=null,pl(i,o,R,7));break;case 5:var V=null;switch(Pn.tag){case 26:V=Pn.memoizedState;case 5:case 27:var ee=Pn;if(V?H(V):ee.stateNode.complete){ri=0,Ha=null;var xe=ee.sibling;if(xe!==null)Pn=xe;else{var Ge=ee.return;Ge!==null?(Pn=Ge,ic(Ge)):Pn=null}break t}}ri=0,Ha=null,pl(i,o,R,5);break;case 6:ri=0,Ha=null,pl(i,o,R,6);break;case 8:Um(),Yi=6;break e;default:throw Error(m(462))}}Vm();break}catch(Ke){B0(i,Ke)}while(!0);return cs=ks=null,$e.H=v,$e.A=A,Bn=f,Pn!==null?0:(di=null,In=0,kl(),Yi)}function Vm(){for(;Pn!==null&&!Oo();)jm(Pn)}function jm(i){var o=M0(i.alternate,i,dl);i.memoizedProps=i.pendingProps,o===null?ic(i):Pn=o}function nc(i){var o=i,f=o.alternate;switch(o.tag){case 15:case 0:o=bm(f,o,o.pendingProps,o.type,void 0,In);break;case 11:o=bm(f,o,o.pendingProps,o.type.render,o.ref,In);break;case 5:d(o);default:L0(f,o),o=Pn=$p(o,dl),o=M0(f,o,dl)}i.memoizedProps=i.pendingProps,o===null?ic(i):Pn=o}function pl(i,o,f,v){cs=ks=null,d(o),nl=null,Bc=0;var A=o.return;try{if(Ky(i,A,o,f,In)){Yi=1,Sf(i,jr(f,i.current)),Pn=null;return}}catch(R){if(A!==null)throw Pn=A,R;Yi=1,Sf(i,jr(f,i.current)),Pn=null;return}o.flags&32768?(wn||v===1?i=!0:rd||(In&536870912)!==0?i=!1:(Xc=i=!0,(v===2||v===9||v===3||v===6)&&(v=ci.current,v!==null&&v.tag===13&&(v.flags|=16384))),Nf(o,i)):ic(o)}function ic(i){var o=i;do{if((o.flags&32768)!==0){Nf(o,Xc);return}i=o.return;var f=e_(o.alternate,o,dl);if(f!==null){Pn=f;return}if(o=o.sibling,o!==null){Pn=o;return}Pn=o=i}while(o!==null);Yi===0&&(Yi=5)}function Nf(i,o){do{var f=t_(i.alternate,i);if(f!==null){f.flags&=32767,Pn=f;return}if(f=i.return,f!==null&&(f.flags|=32768,f.subtreeFlags=0,f.deletions=null),!o&&(i=i.sibling,i!==null)){Pn=i;return}Pn=i=f}while(i!==null);Yi=6,Pn=null}function Uf(i,o,f,v,A,R,V,ee,xe){i.cancelPendingCommit=null;do a1();while(Tr!==0);if((Bn&6)!==0)throw Error(m(327));if(o!==null){if(o===i.current)throw Error(m(177));if(R=o.lanes|o.childLanes,R|=Ol,Zi(i,f,R,V,ee,xe),i===di&&(Pn=di=null,In=0),ad=o,Qc=i,fl=f,km=R,Bm=A,sd=v,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,l_(Fr,function(){return qm(),null})):(i.callbackNode=null,i.callbackPriority=0),v=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||v){v=$e.T,$e.T=null,A=ft.p,ft.p=2,V=Bn,Bn|=4;try{Jh(i,o,f)}finally{Bn=V,ft.p=A,$e.T=v}}Tr=1,V0(),j0(),Zm()}}function V0(){if(Tr===1){Tr=0;var i=Qc,o=ad,f=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||f){f=$e.T,$e.T=null;var v=ft.p;ft.p=2;var A=Bn;Bn|=4;try{z0(o,i);var R=m1,V=Ln(i.containerInfo),ee=R.focusedElem,xe=R.selectionRange;if(V!==ee&&ee&&ee.ownerDocument&&Bh(ee.ownerDocument.documentElement,ee)){if(xe!==null&&Fh(ee)){var Ge=xe.start,Ke=xe.end;if(Ke===void 0&&(Ke=Ge),"selectionStart"in ee)ee.selectionStart=Ge,ee.selectionEnd=Math.min(Ke,ee.value.length);else{var at=ee.ownerDocument||document,He=at&&at.defaultView||window;if(He.getSelection){var Ye=He.getSelection(),Nt=ee.textContent.length,nn=Math.min(xe.start,Nt),yi=xe.end===void 0?nn:Math.min(xe.end,Nt);!Ye.extend&&nn>yi&&(V=yi,yi=nn,nn=V);var ze=kh(ee,nn),Me=kh(ee,yi);if(ze&&Me&&(Ye.rangeCount!==1||Ye.anchorNode!==ze.node||Ye.anchorOffset!==ze.offset||Ye.focusNode!==Me.node||Ye.focusOffset!==Me.offset)){var Ze=at.createRange();Ze.setStart(ze.node,ze.offset),Ye.removeAllRanges(),nn>yi?(Ye.addRange(Ze),Ye.extend(Me.node,Me.offset)):(Ze.setEnd(Me.node,Me.offset),Ye.addRange(Ze))}}}}for(at=[],Ye=ee;Ye=Ye.parentNode;)Ye.nodeType===1&&at.push({element:Ye,left:Ye.scrollLeft,top:Ye.scrollTop});for(typeof ee.focus=="function"&&ee.focus(),ee=0;ee<at.length;ee++){var nt=at[ee];nt.element.scrollLeft=nt.left,nt.element.scrollTop=nt.top}}jt=!!p1,m1=p1=null}finally{Bn=A,ft.p=v,$e.T=f}}i.current=o,Tr=2}}function j0(){if(Tr===2){Tr=0;var i=Qc,o=ad,f=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||f){f=$e.T,$e.T=null;var v=ft.p;ft.p=2;var A=Bn;Bn|=4;try{Pm(i,o.alternate,o)}finally{Bn=A,ft.p=v,$e.T=f}}Tr=3}}function Zm(){if(Tr===4||Tr===3){Tr=0,Ss();var i=Qc,o=ad,f=fl,v=sd;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?Tr=5:(Tr=0,ad=Qc=null,Gm(i,i.pendingLanes));var A=i.pendingLanes;if(A===0&&(tc=null),rt(f),o=o.stateNode,me&&typeof me.onCommitFiberRoot=="function")try{me.onCommitFiberRoot(he,o,void 0,(o.current.flags&128)===128)}catch{}if(v!==null){o=$e.T,A=ft.p,ft.p=2,$e.T=null;try{for(var R=i.onRecoverableError,V=0;V<v.length;V++){var ee=v[V];R(ee.value,{componentStack:ee.stack})}}finally{$e.T=o,ft.p=A}}(fl&3)!==0&&a1(),xo(i),A=i.pendingLanes,(f&261930)!==0&&(A&42)!==0?i===Ff?Oi++:(Oi=0,Ff=i):Oi=0,nh(0)}}function Gm(i,o){(i.pooledCacheLanes&=o)===0&&(o=i.pooledCache,o!=null&&(i.pooledCache=null,Rr(o)))}function a1(){return V0(),j0(),Zm(),qm()}function qm(){if(Tr!==5)return!1;var i=Qc,o=km;km=0;var f=rt(fl),v=$e.T,A=ft.p;try{ft.p=32>f?32:f,$e.T=null,f=Bm,Bm=null;var R=Qc,V=fl;if(Tr=0,ad=Qc=null,fl=0,(Bn&6)!==0)throw Error(m(331));var ee=Bn;if(Bn|=4,Im(R.current),D0(R,R.current,V,f),Bn=ee,nh(0,!1),me&&typeof me.onPostCommitFiberRoot=="function")try{me.onPostCommitFiberRoot(he,R)}catch{}return!0}finally{ft.p=A,$e.T=v,Gm(i,o)}}function Hm(i,o,f){o=jr(f,o),o=Zp(i.stateNode,o,2),i=Ga(i,o,2),i!==null&&(Ai(i,2),xo(i))}function Jn(i,o,f){if(i.tag===3)Hm(i,i,f);else for(;o!==null;){if(o.tag===3){Hm(o,i,f);break}else if(o.tag===1){var v=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof v.componentDidCatch=="function"&&(tc===null||!tc.has(v))){i=jr(f,i),f=x0(2),v=Ga(o,f,2),v!==null&&(Gp(f,v,o,i),Ai(v,2),xo(v));break}}o=o.return}}function $f(i,o,f){var v=i.pingCache;if(v===null){v=i.pingCache=new Dm;var A=new Set;v.set(o,A)}else A=v.get(o),A===void 0&&(A=new Set,v.set(o,A));A.has(f)||(Qu=!0,A.add(f),i=a_.bind(null,i,o,f),o.then(i,i))}function a_(i,o,f){var v=i.pingCache;v!==null&&v.delete(o),i.pingedLanes|=i.suspendedLanes&f,i.warmLanes&=~f,di===i&&(In&f)===f&&(Yi===4||Yi===3&&(In&62914560)===In&&300>Ji()-Bf?(Bn&2)===0&&od(i,0):Om|=f,Ku===In&&(Ku=0)),xo(i)}function Xm(i,o){o===0&&(o=Sn()),i=Va(i,o),i!==null&&(Ai(i,o),xo(i))}function s_(i){var o=i.memoizedState,f=0;o!==null&&(f=o.retryLane),Xm(i,f)}function o_(i,o){var f=0;switch(i.tag){case 31:case 13:var v=i.stateNode,A=i.memoizedState;A!==null&&(f=A.retryLane);break;case 19:v=i.stateNode;break;case 22:v=i.stateNode._retryCache;break;default:throw Error(m(314))}v!==null&&v.delete(o),Xm(i,f)}function l_(i,o){return Do(i,o)}var s1=null,ld=null,o1=!1,Vf=!1,vo=!1,Aa=0;function xo(i){i!==ld&&i.next===null&&(ld===null?s1=ld=i:ld=ld.next=i),Vf=!0,o1||(o1=!0,Ym())}function nh(i,o){if(!vo&&Vf){vo=!0;do for(var f=!1,v=s1;v!==null;){if(i!==0){var A=v.pendingLanes;if(A===0)var R=0;else{var V=v.suspendedLanes,ee=v.pingedLanes;R=(1<<31-De(42|i)+1)-1,R&=A&~(V&~ee),R=R&201326741?R&201326741|1:R?R|2:0}R!==0&&(f=!0,c1(v,R))}else R=In,R=mn(v,v===di?R:0,v.cancelPendingCommit!==null||v.timeoutHandle!==-1),(R&3)===0||En(v,R)||(f=!0,c1(v,R));v=v.next}while(f);vo=!1}}function c_(){jf()}function jf(){Vf=o1=!1;var i=0;Aa!==0&&Y0()&&(i=Aa);for(var o=Ji(),f=null,v=s1;v!==null;){var A=v.next,R=l1(v,o);R===0?(v.next=null,f===null?s1=A:f.next=A,A===null&&(ld=f)):(f=v,(i!==0||(R&3)!==0)&&(Vf=!0)),v=A}Tr!==0&&Tr!==5||nh(i),Aa!==0&&(Aa=0)}function l1(i,o){for(var f=i.suspendedLanes,v=i.pingedLanes,A=i.expirationTimes,R=i.pendingLanes&-62914561;0<R;){var V=31-De(R),ee=1<<V,xe=A[V];xe===-1?((ee&f)===0||(ee&v)!==0)&&(A[V]=Dt(ee,o)):xe<=o&&(i.expiredLanes|=ee),R&=~ee}if(o=di,f=In,f=mn(i,i===o?f:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),v=i.callbackNode,f===0||i===o&&(ri===2||ri===9)||i.cancelPendingCommit!==null)return v!==null&&v!==null&&Sl(v),i.callbackNode=null,i.callbackPriority=0;if((f&3)===0||En(i,f)){if(o=f&-f,o===i.callbackPriority)return o;switch(v!==null&&Sl(v),rt(f)){case 2:case 8:f=Hs;break;case 32:f=Fr;break;case 268435456:f=Q;break;default:f=Fr}return v=Z0.bind(null,i),f=Do(f,v),i.callbackPriority=o,i.callbackNode=f,o}return v!==null&&v!==null&&Sl(v),i.callbackPriority=2,i.callbackNode=null,2}function Z0(i,o){if(Tr!==0&&Tr!==5)return i.callbackNode=null,i.callbackPriority=0,null;var f=i.callbackNode;if(a1()&&i.callbackNode!==f)return null;var v=In;return v=mn(i,i===di?v:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),v===0?null:(th(i,v,o),l1(i,Ji()),i.callbackNode!=null&&i.callbackNode===f?Z0.bind(null,i):null)}function c1(i,o){if(a1())return null;th(i,o,!0)}function Ym(){W0(function(){(Bn&6)!==0?Do(ua,c_):jf()})}function Kc(){if(Aa===0){var i=Sr;i===0&&(i=Qe,Qe<<=1,(Qe&261888)===0&&(Qe=256)),Aa=i}return Aa}function Qm(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:dn(""+i)}function Wm(i,o){var f=o.ownerDocument.createElement("input");return f.name=o.name,f.value=o.value,i.id&&f.setAttribute("form",i.id),o.parentNode.insertBefore(f,o),i=new FormData(i),f.parentNode.removeChild(f),i}function Km(i,o,f,v,A){if(o==="submit"&&f&&f.stateNode===A){var R=Qm((A[ut]||null).action),V=v.submitter;V&&(o=(o=V[ut]||null)?Qm(o.formAction):V.getAttribute("formAction"),o!==null&&(R=o,V=null));var ee=new Sc("action","action",null,v,A);i.push({event:ee,listeners:[{instance:null,listener:function(){if(v.defaultPrevented){if(Aa!==0){var xe=V?Wm(A,V):new FormData(A);qa(f,{pending:!0,data:xe,method:A.method,action:R},null,xe)}}else typeof R=="function"&&(ee.preventDefault(),xe=V?Wm(A,V):new FormData(A),qa(f,{pending:!0,data:xe,method:A.method,action:R},R,xe))},currentTarget:A}]})}}for(var u1=0;u1<Uh.length;u1++){var cd=Uh[u1],G0=cd.toLowerCase(),u_=cd[0].toUpperCase()+cd.slice(1);ma(G0,"on"+u_)}ma(Cu,"onAnimationEnd"),ma(Tu,"onAnimationIteration"),ma(Nh,"onAnimationStart"),ma("dblclick","onDoubleClick"),ma("focusin","onFocus"),ma("focusout","onBlur"),ma(Dl,"onTransitionRun"),ma(Eu,"onTransitionStart"),ma(Rc,"onTransitionCancel"),ma(pa,"onTransitionEnd"),Es("onMouseEnter",["mouseout","mouseover"]),Es("onMouseLeave",["mouseout","mouseover"]),Es("onPointerEnter",["pointerout","pointerover"]),Es("onPointerLeave",["pointerout","pointerover"]),jn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),jn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),jn("onBeforeInput",["compositionend","keypress","textInput","paste"]),jn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),jn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),jn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Zf="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(" "),h_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Zf));function q0(i,o){o=(o&4)!==0;for(var f=0;f<i.length;f++){var v=i[f],A=v.event;v=v.listeners;e:{var R=void 0;if(o)for(var V=v.length-1;0<=V;V--){var ee=v[V],xe=ee.instance,Ge=ee.currentTarget;if(ee=ee.listener,xe!==R&&A.isPropagationStopped())break e;R=ee,A.currentTarget=Ge;try{R(A)}catch(Ke){zs(Ke)}A.currentTarget=null,R=xe}else for(V=0;V<v.length;V++){if(ee=v[V],xe=ee.instance,Ge=ee.currentTarget,ee=ee.listener,xe!==R&&A.isPropagationStopped())break e;R=ee,A.currentTarget=Ge;try{R(A)}catch(Ke){zs(Ke)}A.currentTarget=null,R=xe}}}}function Rn(i,o){var f=o[cn];f===void 0&&(f=o[cn]=new Set);var v=i+"__bubble";f.has(v)||(Jm(o,i,2,!1),f.add(v))}function Gf(i,o,f){var v=0;o&&(v|=4),Jm(f,i,v,o)}var bo="_reactListening"+Math.random().toString(36).slice(2);function h1(i){if(!i[bo]){i[bo]=!0,Pi.forEach(function(f){f!=="selectionchange"&&(h_.has(f)||Gf(f,!1,i),Gf(f,!0,i))});var o=i.nodeType===9?i:i.ownerDocument;o===null||o[bo]||(o[bo]=!0,Gf("selectionchange",!1,o))}}function Jm(i,o,f,v){switch(Er(o)){case 2:var A=Kt;break;case 8:A=Vt;break;default:A=zt}f=A.bind(null,o,f,i),A=void 0,!Ur||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(A=!0),v?A!==void 0?i.addEventListener(o,f,{capture:!0,passive:A}):i.addEventListener(o,f,!0):A!==void 0?i.addEventListener(o,f,{passive:A}):i.addEventListener(o,f,!1)}function d1(i,o,f,v,A){var R=v;if((o&1)===0&&(o&2)===0&&v!==null)e:for(;;){if(v===null)return;var V=v.tag;if(V===3||V===4){var ee=v.stateNode.containerInfo;if(ee===A)break;if(V===4)for(V=v.return;V!==null;){var xe=V.tag;if((xe===3||xe===4)&&V.stateNode.containerInfo===A)return;V=V.return}for(;ee!==null;){if(V=Ts(ee),V===null)return;if(xe=V.tag,xe===5||xe===6||xe===26||xe===27){v=R=V;continue e}ee=ee.parentNode}}v=v.return}oi(function(){var Ge=R,Ke=Uo(f),at=[];e:{var He=pf.get(i);if(He!==void 0){var Ye=Sc,Nt=i;switch(i){case"keypress":if(Yt(f)===0)break e;case"keydown":case"keyup":Ye=Js;break;case"focusin":Nt="focus",Ye=Pl;break;case"focusout":Nt="blur",Ye=Pl;break;case"beforeblur":case"afterblur":Ye=Pl;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ye=Cc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ye=fr;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ye=mm;break;case Cu:case Tu:case Nh:Ye=pr;break;case pa:Ye=gm;break;case"scroll":case"scrollend":Ye=mu;break;case"wheel":Ye=ef;break;case"copy":case"cut":case"paste":Ye=Lh;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ye=Kd;break;case"toggle":case"beforetoggle":Ye=Ec}var nn=(o&4)!==0,yi=!nn&&(i==="scroll"||i==="scrollend"),ze=nn?He!==null?He+"Capture":null:He;nn=[];for(var Me=Ge,Ze;Me!==null;){var nt=Me;if(Ze=nt.stateNode,nt=nt.tag,nt!==5&&nt!==26&&nt!==27||Ze===null||ze===null||(nt=Ls(Me,ze),nt!=null&&nn.push(ud(Me,nt,Ze))),yi)break;Me=Me.return}0<nn.length&&(He=new Ye(He,Nt,null,f,Ke),at.push({event:He,listeners:nn}))}}if((o&7)===0){e:{if(He=i==="mouseover"||i==="pointerover",Ye=i==="mouseout"||i==="pointerout",He&&f!==Tl&&(Nt=f.relatedTarget||f.fromElement)&&(Ts(Nt)||Nt[on]))break e;if((Ye||He)&&(He=Ke.window===Ke?Ke:(He=Ke.ownerDocument)?He.defaultView||He.parentWindow:window,Ye?(Nt=f.relatedTarget||f.toElement,Ye=Ge,Nt=Nt?Ts(Nt):null,Nt!==null&&(yi=E(Nt),nn=Nt.tag,Nt!==yi||nn!==5&&nn!==27&&nn!==6)&&(Nt=null)):(Ye=null,Nt=Ge),Ye!==Nt)){if(nn=Cc,nt="onMouseLeave",ze="onMouseEnter",Me="mouse",(i==="pointerout"||i==="pointerover")&&(nn=Kd,nt="onPointerLeave",ze="onPointerEnter",Me="pointer"),yi=Ye==null?He:Xs(Ye),Ze=Nt==null?He:Xs(Nt),He=new nn(nt,Me+"leave",Ye,f,Ke),He.target=yi,He.relatedTarget=Ze,nt=null,Ts(Ke)===Ge&&(nn=new nn(ze,Me+"enter",Nt,f,Ke),nn.target=Ze,nn.relatedTarget=yi,nt=nn),yi=nt,Ye&&Nt)t:{for(nn=eg,ze=Ye,Me=Nt,Ze=0,nt=ze;nt;nt=nn(nt))Ze++;nt=0;for(var Xt=Me;Xt;Xt=nn(Xt))nt++;for(;0<Ze-nt;)ze=nn(ze),Ze--;for(;0<nt-Ze;)Me=nn(Me),nt--;for(;Ze--;){if(ze===Me||Me!==null&&ze===Me.alternate){nn=ze;break t}ze=nn(ze),Me=nn(Me)}nn=null}else nn=null;Ye!==null&&tg(at,He,Ye,nn,!1),Nt!==null&&yi!==null&&tg(at,yi,Nt,nn,!0)}}e:{if(He=Ge?Xs(Ge):window,Ye=He.nodeName&&He.nodeName.toLowerCase(),Ye==="select"||Ye==="input"&&He.type==="file")var Qn=jo;else if(af(He))if(sf)Qn=Np;else{Qn=lf;var Et=Bp}else Ye=He.nodeName,!Ye||Ye.toLowerCase()!=="input"||He.type!=="checkbox"&&He.type!=="radio"?Ge&&No(Ge.elementType)&&(Qn=jo):Qn=Fp;if(Qn&&(Qn=Qn(i,Ge))){Dh(at,Qn,f,Ke);break e}Et&&Et(i,He,Ge),i==="focusout"&&Ge&&He.type==="number"&&Ge.memoizedProps.value!=null&&Qs(He,"number",He.value)}switch(Et=Ge?Xs(Ge):window,i){case"focusin":(af(Et)||Et.contentEditable==="true")&&($a=Et,wu=Ge,Su=null);break;case"focusout":Su=wu=$a=null;break;case"mousedown":hf=!0;break;case"contextmenu":case"mouseup":case"dragend":hf=!1,Up(at,f,Ke);break;case"selectionchange":if(uf)break;case"keydown":case"keyup":Up(at,f,Ke)}var Jt;if(fa)e:{switch(i){case"compositionstart":var _n="onCompositionStart";break e;case"compositionend":_n="onCompositionEnd";break e;case"compositionupdate":_n="onCompositionUpdate";break e}_n=void 0}else ss?_u(i,f)&&(_n="onCompositionEnd"):i==="keydown"&&f.keyCode===229&&(_n="onCompositionStart");_n&&(Rl&&f.locale!=="ko"&&(ss||_n!=="onCompositionStart"?_n==="onCompositionEnd"&&ss&&(Jt=gn()):(Na=Ke,Zn="value"in Na?Na.value:Na.textContent,ss=!0)),Et=qf(Ge,_n),0<Et.length&&(_n=new Rp(_n,i,null,f,Ke),at.push({event:_n,listeners:Et}),Jt?_n.data=Jt:(Jt=zp(f),Jt!==null&&(_n.data=Jt)))),(Jt=nf?Dp(i,f):rf(i,f))&&(_n=qf(Ge,"onBeforeInput"),0<_n.length&&(Et=new Rp("onBeforeInput","beforeinput",null,f,Ke),at.push({event:Et,listeners:_n}),Et.data=Jt)),Km(at,i,Ge,f,Ke)}q0(at,o)})}function ud(i,o,f){return{instance:i,listener:o,currentTarget:f}}function qf(i,o){for(var f=o+"Capture",v=[];i!==null;){var A=i,R=A.stateNode;if(A=A.tag,A!==5&&A!==26&&A!==27||R===null||(A=Ls(i,f),A!=null&&v.unshift(ud(i,A,R)),A=Ls(i,o),A!=null&&v.push(ud(i,A,R))),i.tag===3)return v;i=i.return}return[]}function eg(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function tg(i,o,f,v,A){for(var R=o._reactName,V=[];f!==null&&f!==v;){var ee=f,xe=ee.alternate,Ge=ee.stateNode;if(ee=ee.tag,xe!==null&&xe===v)break;ee!==5&&ee!==26&&ee!==27||Ge===null||(xe=Ge,A?(Ge=Ls(f,R),Ge!=null&&V.unshift(ud(f,Ge,xe))):A||(Ge=Ls(f,R),Ge!=null&&V.push(ud(f,Ge,xe)))),f=f.return}V.length!==0&&i.push({event:o,listeners:V})}var Hf=/\r\n?/g,H0=/\u0000|\uFFFD/g;function f1(i){return(typeof i=="string"?i:""+i).replace(Hf,`
49
+ `).replace(H0,"")}function ng(i,o){return o=f1(o),f1(i)===o}function Tn(i,o,f,v,A,R){switch(f){case"children":typeof v=="string"?o==="body"||o==="textarea"&&v===""||As(i,v):(typeof v=="number"||typeof v=="bigint")&&o!=="body"&&As(i,""+v);break;case"className":bc(i,"class",v);break;case"tabIndex":bc(i,"tabindex",v);break;case"dir":case"role":case"viewBox":case"width":case"height":bc(i,f,v);break;case"style":bn(i,v,R);break;case"data":if(o!=="object"){bc(i,"data",v);break}case"src":case"href":if(v===""&&(o!=="a"||f!=="href")){i.removeAttribute(f);break}if(v==null||typeof v=="function"||typeof v=="symbol"||typeof v=="boolean"){i.removeAttribute(f);break}v=dn(""+v),i.setAttribute(f,v);break;case"action":case"formAction":if(typeof v=="function"){i.setAttribute(f,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof R=="function"&&(f==="formAction"?(o!=="input"&&Tn(i,o,"name",A.name,A,null),Tn(i,o,"formEncType",A.formEncType,A,null),Tn(i,o,"formMethod",A.formMethod,A,null),Tn(i,o,"formTarget",A.formTarget,A,null)):(Tn(i,o,"encType",A.encType,A,null),Tn(i,o,"method",A.method,A,null),Tn(i,o,"target",A.target,A,null)));if(v==null||typeof v=="symbol"||typeof v=="boolean"){i.removeAttribute(f);break}v=dn(""+v),i.setAttribute(f,v);break;case"onClick":v!=null&&(i.onclick=da);break;case"onScroll":v!=null&&Rn("scroll",i);break;case"onScrollEnd":v!=null&&Rn("scrollend",i);break;case"dangerouslySetInnerHTML":if(v!=null){if(typeof v!="object"||!("__html"in v))throw Error(m(61));if(f=v.__html,f!=null){if(A.children!=null)throw Error(m(60));i.innerHTML=f}}break;case"multiple":i.multiple=v&&typeof v!="function"&&typeof v!="symbol";break;case"muted":i.muted=v&&typeof v!="function"&&typeof v!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(v==null||typeof v=="function"||typeof v=="boolean"||typeof v=="symbol"){i.removeAttribute("xlink:href");break}f=dn(""+v),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",f);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":v!=null&&typeof v!="function"&&typeof v!="symbol"?i.setAttribute(f,""+v):i.removeAttribute(f);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":v&&typeof v!="function"&&typeof v!="symbol"?i.setAttribute(f,""):i.removeAttribute(f);break;case"capture":case"download":v===!0?i.setAttribute(f,""):v!==!1&&v!=null&&typeof v!="function"&&typeof v!="symbol"?i.setAttribute(f,v):i.removeAttribute(f);break;case"cols":case"rows":case"size":case"span":v!=null&&typeof v!="function"&&typeof v!="symbol"&&!isNaN(v)&&1<=v?i.setAttribute(f,v):i.removeAttribute(f);break;case"rowSpan":case"start":v==null||typeof v=="function"||typeof v=="symbol"||isNaN(v)?i.removeAttribute(f):i.setAttribute(f,v);break;case"popover":Rn("beforetoggle",i),Rn("toggle",i),du(i,"popover",v);break;case"xlinkActuate":Ms(i,"http://www.w3.org/1999/xlink","xlink:actuate",v);break;case"xlinkArcrole":Ms(i,"http://www.w3.org/1999/xlink","xlink:arcrole",v);break;case"xlinkRole":Ms(i,"http://www.w3.org/1999/xlink","xlink:role",v);break;case"xlinkShow":Ms(i,"http://www.w3.org/1999/xlink","xlink:show",v);break;case"xlinkTitle":Ms(i,"http://www.w3.org/1999/xlink","xlink:title",v);break;case"xlinkType":Ms(i,"http://www.w3.org/1999/xlink","xlink:type",v);break;case"xmlBase":Ms(i,"http://www.w3.org/XML/1998/namespace","xml:base",v);break;case"xmlLang":Ms(i,"http://www.w3.org/XML/1998/namespace","xml:lang",v);break;case"xmlSpace":Ms(i,"http://www.w3.org/XML/1998/namespace","xml:space",v);break;case"is":du(i,"is",v);break;case"innerText":case"textContent":break;default:(!(2<f.length)||f[0]!=="o"&&f[0]!=="O"||f[1]!=="n"&&f[1]!=="N")&&(f=Nr.get(f)||f,du(i,f,v))}}function Jc(i,o,f,v,A,R){switch(f){case"style":bn(i,v,R);break;case"dangerouslySetInnerHTML":if(v!=null){if(typeof v!="object"||!("__html"in v))throw Error(m(61));if(f=v.__html,f!=null){if(A.children!=null)throw Error(m(60));i.innerHTML=f}}break;case"children":typeof v=="string"?As(i,v):(typeof v=="number"||typeof v=="bigint")&&As(i,""+v);break;case"onScroll":v!=null&&Rn("scroll",i);break;case"onScrollEnd":v!=null&&Rn("scrollend",i);break;case"onClick":v!=null&&(i.onclick=da);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Wr.hasOwnProperty(f))e:{if(f[0]==="o"&&f[1]==="n"&&(A=f.endsWith("Capture"),o=f.slice(2,A?f.length-7:void 0),R=i[ut]||null,R=R!=null?R[f]:null,typeof R=="function"&&i.removeEventListener(o,R,A),typeof v=="function")){typeof R!="function"&&R!==null&&(f in i?i[f]=null:i.hasAttribute(f)&&i.removeAttribute(f)),i.addEventListener(o,v,A);break e}f in i?i[f]=v:v===!0?i.setAttribute(f,""):du(i,f,v)}}}function sr(i,o,f){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Rn("error",i),Rn("load",i);var v=!1,A=!1,R;for(R in f)if(f.hasOwnProperty(R)){var V=f[R];if(V!=null)switch(R){case"src":v=!0;break;case"srcSet":A=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(m(137,o));default:Tn(i,o,R,V,f,null)}}A&&Tn(i,o,"srcSet",f.srcSet,f,null),v&&Tn(i,o,"src",f.src,f,null);return;case"input":Rn("invalid",i);var ee=R=V=A=null,xe=null,Ge=null;for(v in f)if(f.hasOwnProperty(v)){var Ke=f[v];if(Ke!=null)switch(v){case"name":A=Ke;break;case"type":V=Ke;break;case"checked":xe=Ke;break;case"defaultChecked":Ge=Ke;break;case"value":R=Ke;break;case"defaultValue":ee=Ke;break;case"children":case"dangerouslySetInnerHTML":if(Ke!=null)throw Error(m(137,o));break;default:Tn(i,o,v,Ke,f,null)}}Qd(i,R,ee,xe,Ge,V,A,!1);return;case"select":Rn("invalid",i),v=V=R=null;for(A in f)if(f.hasOwnProperty(A)&&(ee=f[A],ee!=null))switch(A){case"value":R=ee;break;case"defaultValue":V=ee;break;case"multiple":v=ee;default:Tn(i,o,A,ee,f,null)}o=R,f=V,i.multiple=!!v,o!=null?Fo(i,!!v,o,!1):f!=null&&Fo(i,!!v,f,!0);return;case"textarea":Rn("invalid",i),R=A=v=null;for(V in f)if(f.hasOwnProperty(V)&&(ee=f[V],ee!=null))switch(V){case"value":v=ee;break;case"defaultValue":A=ee;break;case"children":R=ee;break;case"dangerouslySetInnerHTML":if(ee!=null)throw Error(m(91));break;default:Tn(i,o,V,ee,f,null)}wc(i,v,A,R);return;case"option":for(xe in f)if(f.hasOwnProperty(xe)&&(v=f[xe],v!=null))switch(xe){case"selected":i.selected=v&&typeof v!="function"&&typeof v!="symbol";break;default:Tn(i,o,xe,v,f,null)}return;case"dialog":Rn("beforetoggle",i),Rn("toggle",i),Rn("cancel",i),Rn("close",i);break;case"iframe":case"object":Rn("load",i);break;case"video":case"audio":for(v=0;v<Zf.length;v++)Rn(Zf[v],i);break;case"image":Rn("error",i),Rn("load",i);break;case"details":Rn("toggle",i);break;case"embed":case"source":case"link":Rn("error",i),Rn("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Ge in f)if(f.hasOwnProperty(Ge)&&(v=f[Ge],v!=null))switch(Ge){case"children":case"dangerouslySetInnerHTML":throw Error(m(137,o));default:Tn(i,o,Ge,v,f,null)}return;default:if(No(o)){for(Ke in f)f.hasOwnProperty(Ke)&&(v=f[Ke],v!==void 0&&Jc(i,o,Ke,v,f,void 0));return}}for(ee in f)f.hasOwnProperty(ee)&&(v=f[ee],v!=null&&Tn(i,o,ee,v,f,null))}function ih(i,o,f,v){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var A=null,R=null,V=null,ee=null,xe=null,Ge=null,Ke=null;for(Ye in f){var at=f[Ye];if(f.hasOwnProperty(Ye)&&at!=null)switch(Ye){case"checked":break;case"value":break;case"defaultValue":xe=at;default:v.hasOwnProperty(Ye)||Tn(i,o,Ye,null,v,at)}}for(var He in v){var Ye=v[He];if(at=f[He],v.hasOwnProperty(He)&&(Ye!=null||at!=null))switch(He){case"type":R=Ye;break;case"name":A=Ye;break;case"checked":Ge=Ye;break;case"defaultChecked":Ke=Ye;break;case"value":V=Ye;break;case"defaultValue":ee=Ye;break;case"children":case"dangerouslySetInnerHTML":if(Ye!=null)throw Error(m(137,o));break;default:Ye!==at&&Tn(i,o,He,Ye,v,at)}}pu(i,V,ee,xe,Ge,Ke,R,A);return;case"select":Ye=V=ee=He=null;for(R in f)if(xe=f[R],f.hasOwnProperty(R)&&xe!=null)switch(R){case"value":break;case"multiple":Ye=xe;default:v.hasOwnProperty(R)||Tn(i,o,R,null,v,xe)}for(A in v)if(R=v[A],xe=f[A],v.hasOwnProperty(A)&&(R!=null||xe!=null))switch(A){case"value":He=R;break;case"defaultValue":ee=R;break;case"multiple":V=R;default:R!==xe&&Tn(i,o,A,R,v,xe)}o=ee,f=V,v=Ye,He!=null?Fo(i,!!f,He,!1):!!v!=!!f&&(o!=null?Fo(i,!!f,o,!0):Fo(i,!!f,f?[]:"",!1));return;case"textarea":Ye=He=null;for(ee in f)if(A=f[ee],f.hasOwnProperty(ee)&&A!=null&&!v.hasOwnProperty(ee))switch(ee){case"value":break;case"children":break;default:Tn(i,o,ee,null,v,A)}for(V in v)if(A=v[V],R=f[V],v.hasOwnProperty(V)&&(A!=null||R!=null))switch(V){case"value":He=A;break;case"defaultValue":Ye=A;break;case"children":break;case"dangerouslySetInnerHTML":if(A!=null)throw Error(m(91));break;default:A!==R&&Tn(i,o,V,A,v,R)}Lp(i,He,Ye);return;case"option":for(var Nt in f)if(He=f[Nt],f.hasOwnProperty(Nt)&&He!=null&&!v.hasOwnProperty(Nt))switch(Nt){case"selected":i.selected=!1;break;default:Tn(i,o,Nt,null,v,He)}for(xe in v)if(He=v[xe],Ye=f[xe],v.hasOwnProperty(xe)&&He!==Ye&&(He!=null||Ye!=null))switch(xe){case"selected":i.selected=He&&typeof He!="function"&&typeof He!="symbol";break;default:Tn(i,o,xe,He,v,Ye)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var nn in f)He=f[nn],f.hasOwnProperty(nn)&&He!=null&&!v.hasOwnProperty(nn)&&Tn(i,o,nn,null,v,He);for(Ge in v)if(He=v[Ge],Ye=f[Ge],v.hasOwnProperty(Ge)&&He!==Ye&&(He!=null||Ye!=null))switch(Ge){case"children":case"dangerouslySetInnerHTML":if(He!=null)throw Error(m(137,o));break;default:Tn(i,o,Ge,He,v,Ye)}return;default:if(No(o)){for(var yi in f)He=f[yi],f.hasOwnProperty(yi)&&He!==void 0&&!v.hasOwnProperty(yi)&&Jc(i,o,yi,void 0,v,He);for(Ke in v)He=v[Ke],Ye=f[Ke],!v.hasOwnProperty(Ke)||He===Ye||He===void 0&&Ye===void 0||Jc(i,o,Ke,He,v,Ye);return}}for(var ze in f)He=f[ze],f.hasOwnProperty(ze)&&He!=null&&!v.hasOwnProperty(ze)&&Tn(i,o,ze,null,v,He);for(at in v)He=v[at],Ye=f[at],!v.hasOwnProperty(at)||He===Ye||He==null&&Ye==null||Tn(i,o,at,He,v,Ye)}function ig(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function X0(){if(typeof performance.getEntriesByType=="function"){for(var i=0,o=0,f=performance.getEntriesByType("resource"),v=0;v<f.length;v++){var A=f[v],R=A.transferSize,V=A.initiatorType,ee=A.duration;if(R&&ee&&ig(V)){for(V=0,ee=A.responseEnd,v+=1;v<f.length;v++){var xe=f[v],Ge=xe.startTime;if(Ge>ee)break;var Ke=xe.transferSize,at=xe.initiatorType;Ke&&ig(at)&&(xe=xe.responseEnd,V+=Ke*(xe<ee?1:(ee-Ge)/(xe-Ge)))}if(--v,o+=8*(R+V)/(A.duration/1e3),i++,10<i)break}}if(0<i)return o/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var p1=null,m1=null;function g1(i){return i.nodeType===9?i:i.ownerDocument}function rg(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function rc(i,o){if(i===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&o==="foreignObject"?0:i}function y1(i,o){return i==="textarea"||i==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var _1=null;function Y0(){var i=window.event;return i&&i.type==="popstate"?i===_1?!1:(_1=i,!0):(_1=null,!1)}var ag=typeof setTimeout=="function"?setTimeout:void 0,d_=typeof clearTimeout=="function"?clearTimeout:void 0,Q0=typeof Promise=="function"?Promise:void 0,W0=typeof queueMicrotask=="function"?queueMicrotask:typeof Q0<"u"?function(i){return Q0.resolve(null).then(i).catch(K0)}:ag;function K0(i){setTimeout(function(){throw i})}function wo(i){return i==="head"}function sg(i,o){var f=o,v=0;do{var A=f.nextSibling;if(i.removeChild(f),A&&A.nodeType===8)if(f=A.data,f==="/$"||f==="/&"){if(v===0){i.removeChild(A),sa(o);return}v--}else if(f==="$"||f==="$?"||f==="$~"||f==="$!"||f==="&")v++;else if(f==="html")dd(i.ownerDocument.documentElement);else if(f==="head"){f=i.ownerDocument.head,dd(f);for(var R=f.firstChild;R;){var V=R.nextSibling,ee=R.nodeName;R[rn]||ee==="SCRIPT"||ee==="STYLE"||ee==="LINK"&&R.rel.toLowerCase()==="stylesheet"||f.removeChild(R),R=V}}else f==="body"&&dd(i.ownerDocument.body);f=A}while(f);sa(o)}function Xf(i,o){var f=i;i=0;do{var v=f.nextSibling;if(f.nodeType===1?o?(f._stashedDisplay=f.style.display,f.style.display="none"):(f.style.display=f._stashedDisplay||"",f.getAttribute("style")===""&&f.removeAttribute("style")):f.nodeType===3&&(o?(f._stashedText=f.nodeValue,f.nodeValue=""):f.nodeValue=f._stashedText||""),v&&v.nodeType===8)if(f=v.data,f==="/$"){if(i===0)break;i--}else f!=="$"&&f!=="$?"&&f!=="$~"&&f!=="$!"||i++;f=v}while(f)}function hd(i){var o=i.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var f=o;switch(o=o.nextSibling,f.nodeName){case"HTML":case"HEAD":case"BODY":hd(f),ko(f);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(f.rel.toLowerCase()==="stylesheet")continue}i.removeChild(f)}}function v1(i,o,f,v){for(;i.nodeType===1;){var A=f;if(i.nodeName.toLowerCase()!==o.toLowerCase()){if(!v&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(v){if(!i[rn])switch(o){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(R=i.getAttribute("rel"),R==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(R!==A.rel||i.getAttribute("href")!==(A.href==null||A.href===""?null:A.href)||i.getAttribute("crossorigin")!==(A.crossOrigin==null?null:A.crossOrigin)||i.getAttribute("title")!==(A.title==null?null:A.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(R=i.getAttribute("src"),(R!==(A.src==null?null:A.src)||i.getAttribute("type")!==(A.type==null?null:A.type)||i.getAttribute("crossorigin")!==(A.crossOrigin==null?null:A.crossOrigin))&&R&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(o==="input"&&i.type==="hidden"){var R=A.name==null?null:""+A.name;if(A.type==="hidden"&&i.getAttribute("name")===R)return i}else return i;if(i=Ya(i.nextSibling),i===null)break}return null}function f_(i,o,f){if(o==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!f||(i=Ya(i.nextSibling),i===null))return null;return i}function J0(i,o){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!o||(i=Ya(i.nextSibling),i===null))return null;return i}function og(i){return i.data==="$?"||i.data==="$~"}function eu(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function Or(i,o){var f=i.ownerDocument;if(i.data==="$~")i._reactRetry=o;else if(i.data!=="$?"||f.readyState!=="loading")o();else{var v=function(){o(),f.removeEventListener("DOMContentLoaded",v)};f.addEventListener("DOMContentLoaded",v),i._reactRetry=v}}function Ya(i){for(;i!=null;i=i.nextSibling){var o=i.nodeType;if(o===1||o===3)break;if(o===8){if(o=i.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return i}var x1=null;function lg(i){i=i.nextSibling;for(var o=0;i;){if(i.nodeType===8){var f=i.data;if(f==="/$"||f==="/&"){if(o===0)return Ya(i.nextSibling);o--}else f!=="$"&&f!=="$!"&&f!=="$?"&&f!=="$~"&&f!=="&"||o++}i=i.nextSibling}return null}function b1(i){i=i.previousSibling;for(var o=0;i;){if(i.nodeType===8){var f=i.data;if(f==="$"||f==="$!"||f==="$?"||f==="$~"||f==="&"){if(o===0)return i;o--}else f!=="/$"&&f!=="/&"||o++}i=i.previousSibling}return null}function e2(i,o,f){switch(o=g1(f),i){case"html":if(i=o.documentElement,!i)throw Error(m(452));return i;case"head":if(i=o.head,!i)throw Error(m(453));return i;case"body":if(i=o.body,!i)throw Error(m(454));return i;default:throw Error(m(451))}}function dd(i){for(var o=i.attributes;o.length;)i.removeAttributeNode(o[0]);ko(i)}var xs=new Map,t2=new Set;function Yf(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var So=ft.d;ft.d={f:cg,r:n2,D:i2,C:ug,L:S1,m:Qf,X:dg,S:hg,M:fg};function cg(){var i=So.f(),o=i1();return i||o}function n2(i){var o=Fa(i);o!==null&&o.tag===5&&o.type==="form"?ta(o):So.r(i)}var ml=typeof document>"u"?null:document;function w1(i,o,f){var v=ml;if(v&&typeof o=="string"&&o){var A=hr(o);A='link[rel="'+i+'"][href="'+A+'"]',typeof f=="string"&&(A+='[crossorigin="'+f+'"]'),t2.has(A)||(t2.add(A),i={rel:i,crossOrigin:f,href:o},v.querySelector(A)===null&&(o=v.createElement("link"),sr(o,"link",i),bi(o),v.head.appendChild(o)))}}function i2(i){So.D(i),w1("dns-prefetch",i,null)}function ug(i,o){So.C(i,o),w1("preconnect",i,o)}function S1(i,o,f){So.L(i,o,f);var v=ml;if(v&&i&&o){var A='link[rel="preload"][as="'+hr(o)+'"]';o==="image"&&f&&f.imageSrcSet?(A+='[imagesrcset="'+hr(f.imageSrcSet)+'"]',typeof f.imageSizes=="string"&&(A+='[imagesizes="'+hr(f.imageSizes)+'"]')):A+='[href="'+hr(i)+'"]';var R=A;switch(o){case"style":R=a(i);break;case"script":R=p(i)}xs.has(R)||(i=X({rel:"preload",href:o==="image"&&f&&f.imageSrcSet?void 0:i,as:o},f),xs.set(R,i),v.querySelector(A)!==null||o==="style"&&v.querySelector(t(R))||o==="script"&&v.querySelector(x(R))||(o=v.createElement("link"),sr(o,"link",i),bi(o),v.head.appendChild(o)))}}function Qf(i,o){So.m(i,o);var f=ml;if(f&&i){var v=o&&typeof o.as=="string"?o.as:"script",A='link[rel="modulepreload"][as="'+hr(v)+'"][href="'+hr(i)+'"]',R=A;switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":R=p(i)}if(!xs.has(R)&&(i=X({rel:"modulepreload",href:i},o),xs.set(R,i),f.querySelector(A)===null)){switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(f.querySelector(x(R)))return}v=f.createElement("link"),sr(v,"link",i),bi(v),f.head.appendChild(v)}}}function hg(i,o,f){So.S(i,o,f);var v=ml;if(v&&i){var A=Qr(v).hoistableStyles,R=a(i);o=o||"default";var V=A.get(R);if(!V){var ee={loading:0,preload:null};if(V=v.querySelector(t(R)))ee.loading=5;else{i=X({rel:"stylesheet",href:i,"data-precedence":o},f),(f=xs.get(R))&&M(i,f);var xe=V=v.createElement("link");bi(xe),sr(xe,"link",i),xe._p=new Promise(function(Ge,Ke){xe.onload=Ge,xe.onerror=Ke}),xe.addEventListener("load",function(){ee.loading|=1}),xe.addEventListener("error",function(){ee.loading|=2}),ee.loading|=4,T(V,o,v)}V={type:"stylesheet",instance:V,count:1,state:ee},A.set(R,V)}}}function dg(i,o){So.X(i,o);var f=ml;if(f&&i){var v=Qr(f).hoistableScripts,A=p(i),R=v.get(A);R||(R=f.querySelector(x(A)),R||(i=X({src:i,async:!0},o),(o=xs.get(A))&&I(i,o),R=f.createElement("script"),bi(R),sr(R,"link",i),f.head.appendChild(R)),R={type:"script",instance:R,count:1,state:null},v.set(A,R))}}function fg(i,o){So.M(i,o);var f=ml;if(f&&i){var v=Qr(f).hoistableScripts,A=p(i),R=v.get(A);R||(R=f.querySelector(x(A)),R||(i=X({src:i,async:!0,type:"module"},o),(o=xs.get(A))&&I(i,o),R=f.createElement("script"),bi(R),sr(R,"link",i),f.head.appendChild(R)),R={type:"script",instance:R,count:1,state:null},v.set(A,R))}}function r2(i,o,f,v){var A=(A=Lt.current)?Yf(A):null;if(!A)throw Error(m(446));switch(i){case"meta":case"title":return null;case"style":return typeof f.precedence=="string"&&typeof f.href=="string"?(o=a(f.href),f=Qr(A).hoistableStyles,v=f.get(o),v||(v={type:"style",instance:null,count:0,state:null},f.set(o,v)),v):{type:"void",instance:null,count:0,state:null};case"link":if(f.rel==="stylesheet"&&typeof f.href=="string"&&typeof f.precedence=="string"){i=a(f.href);var R=Qr(A).hoistableStyles,V=R.get(i);if(V||(A=A.ownerDocument||A,V={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},R.set(i,V),(R=A.querySelector(t(i)))&&!R._p&&(V.instance=R,V.state.loading=5),xs.has(i)||(f={rel:"preload",as:"style",href:f.href,crossOrigin:f.crossOrigin,integrity:f.integrity,media:f.media,hrefLang:f.hrefLang,referrerPolicy:f.referrerPolicy},xs.set(i,f),R||u(A,i,f,V.state))),o&&v===null)throw Error(m(528,""));return V}if(o&&v!==null)throw Error(m(529,""));return null;case"script":return o=f.async,f=f.src,typeof f=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=p(f),f=Qr(A).hoistableScripts,v=f.get(o),v||(v={type:"script",instance:null,count:0,state:null},f.set(o,v)),v):{type:"void",instance:null,count:0,state:null};default:throw Error(m(444,i))}}function a(i){return'href="'+hr(i)+'"'}function t(i){return'link[rel="stylesheet"]['+i+"]"}function r(i){return X({},i,{"data-precedence":i.precedence,precedence:null})}function u(i,o,f,v){i.querySelector('link[rel="preload"][as="style"]['+o+"]")?v.loading=1:(o=i.createElement("link"),v.preload=o,o.addEventListener("load",function(){return v.loading|=1}),o.addEventListener("error",function(){return v.loading|=2}),sr(o,"link",f),bi(o),i.head.appendChild(o))}function p(i){return'[src="'+hr(i)+'"]'}function x(i){return"script[async]"+i}function b(i,o,f){if(o.count++,o.instance===null)switch(o.type){case"style":var v=i.querySelector('style[data-href~="'+hr(f.href)+'"]');if(v)return o.instance=v,bi(v),v;var A=X({},f,{"data-href":f.href,"data-precedence":f.precedence,href:null,precedence:null});return v=(i.ownerDocument||i).createElement("style"),bi(v),sr(v,"style",A),T(v,f.precedence,i),o.instance=v;case"stylesheet":A=a(f.href);var R=i.querySelector(t(A));if(R)return o.state.loading|=4,o.instance=R,bi(R),R;v=r(f),(A=xs.get(A))&&M(v,A),R=(i.ownerDocument||i).createElement("link"),bi(R);var V=R;return V._p=new Promise(function(ee,xe){V.onload=ee,V.onerror=xe}),sr(R,"link",v),o.state.loading|=4,T(R,f.precedence,i),o.instance=R;case"script":return R=p(f.src),(A=i.querySelector(x(R)))?(o.instance=A,bi(A),A):(v=f,(A=xs.get(R))&&(v=X({},f),I(v,A)),i=i.ownerDocument||i,A=i.createElement("script"),bi(A),sr(A,"link",v),i.head.appendChild(A),o.instance=A);case"void":return null;default:throw Error(m(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(v=o.instance,o.state.loading|=4,T(v,f.precedence,i));return o.instance}function T(i,o,f){for(var v=f.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),A=v.length?v[v.length-1]:null,R=A,V=0;V<v.length;V++){var ee=v[V];if(ee.dataset.precedence===o)R=ee;else if(R!==A)break}R?R.parentNode.insertBefore(i,R.nextSibling):(o=f.nodeType===9?f.head:f,o.insertBefore(i,o.firstChild))}function M(i,o){i.crossOrigin==null&&(i.crossOrigin=o.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=o.referrerPolicy),i.title==null&&(i.title=o.title)}function I(i,o){i.crossOrigin==null&&(i.crossOrigin=o.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=o.referrerPolicy),i.integrity==null&&(i.integrity=o.integrity)}var z=null;function F(i,o,f){if(z===null){var v=new Map,A=z=new Map;A.set(f,v)}else A=z,v=A.get(f),v||(v=new Map,A.set(f,v));if(v.has(i))return v;for(v.set(i,null),f=f.getElementsByTagName(i),A=0;A<f.length;A++){var R=f[A];if(!(R[rn]||R[An]||i==="link"&&R.getAttribute("rel")==="stylesheet")&&R.namespaceURI!=="http://www.w3.org/2000/svg"){var V=R.getAttribute(o)||"";V=i+V;var ee=v.get(V);ee?ee.push(R):v.set(V,[R])}}return v}function j(i,o,f){i=i.ownerDocument||i,i.head.insertBefore(f,o==="title"?i.querySelector("head > title"):null)}function G(i,o,f){if(f===1||o.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;switch(o.rel){case"stylesheet":return i=o.disabled,typeof o.precedence=="string"&&i==null;default:return!0}case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function H(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function J(i,o,f,v){if(f.type==="stylesheet"&&(typeof v.media!="string"||matchMedia(v.media).matches!==!1)&&(f.state.loading&4)===0){if(f.instance===null){var A=a(v.href),R=o.querySelector(t(A));if(R){o=R._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(i.count++,i=Ae.bind(i),o.then(i,i)),f.state.loading|=4,f.instance=R,bi(R);return}R=o.ownerDocument||o,v=r(v),(A=xs.get(A))&&M(v,A),R=R.createElement("link"),bi(R);var V=R;V._p=new Promise(function(ee,xe){V.onload=ee,V.onerror=xe}),sr(R,"link",v),f.instance=R}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(f,o),(o=f.state.preload)&&(f.state.loading&3)===0&&(i.count++,f=Ae.bind(i),o.addEventListener("load",f),o.addEventListener("error",f))}}var ne=0;function le(i,o){return i.stylesheets&&i.count===0&&ve(i,i.stylesheets),0<i.count||0<i.imgCount?function(f){var v=setTimeout(function(){if(i.stylesheets&&ve(i,i.stylesheets),i.unsuspend){var R=i.unsuspend;i.unsuspend=null,R()}},6e4+o);0<i.imgBytes&&ne===0&&(ne=62500*X0());var A=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&ve(i,i.stylesheets),i.unsuspend)){var R=i.unsuspend;i.unsuspend=null,R()}},(i.imgBytes>ne?50:800)+o);return i.unsuspend=f,function(){i.unsuspend=null,clearTimeout(v),clearTimeout(A)}}:null}function Ae(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ve(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var pe=null;function ve(i,o){i.stylesheets=null,i.unsuspend!==null&&(i.count++,pe=new Map,o.forEach(Fe,i),pe=null,Ae.call(i))}function Fe(i,o){if(!(o.state.loading&4)){var f=pe.get(i);if(f)var v=f.get(null);else{f=new Map,pe.set(i,f);for(var A=i.querySelectorAll("link[data-precedence],style[data-precedence]"),R=0;R<A.length;R++){var V=A[R];(V.nodeName==="LINK"||V.getAttribute("media")!=="not all")&&(f.set(V.dataset.precedence,V),v=V)}v&&f.set(null,v)}A=o.instance,V=A.getAttribute("data-precedence"),R=f.get(V)||v,R===v&&f.set(null,A),f.set(V,A),this.count++,v=Ae.bind(this),A.addEventListener("load",v),A.addEventListener("error",v),R?R.parentNode.insertBefore(A,R.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(A,i.firstChild)),o.state.loading|=4}}var qe={$$typeof:Pe,Provider:null,Consumer:null,_currentValue:wt,_currentValue2:wt,_threadCount:0};function it(i,o,f,v,A,R,V,ee,xe){this.tag=1,this.containerInfo=i,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ni(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ni(0),this.hiddenUpdates=Ni(null),this.identifierPrefix=v,this.onUncaughtError=A,this.onCaughtError=R,this.onRecoverableError=V,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=xe,this.incompleteTransitions=new Map}function bt(i,o,f,v,A,R,V,ee,xe,Ge,Ke,at){return i=new it(i,o,f,V,xe,Ge,Ke,at,ee),o=1,R===!0&&(o|=24),R=ga(3,null,null,o),i.current=R,R.stateNode=i,o=Du(),o.refCount++,i.pooledCache=o,o.refCount++,R.memoizedState={element:v,isDehydrated:f,cache:o},Fs(R),i}function mt(i){return i?(i=hn,i):hn}function _t(i,o,f,v,A,R){A=mt(A),v.context===null?v.context=A:v.pendingContext=A,v=uo(o),v.payload={element:f},R=R===void 0?null:R,R!==null&&(v.callback=R),f=Ga(i,v,o),f!==null&&(ra(f,i,o),al(f,i,o))}function kt(i,o){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var f=i.retryLane;i.retryLane=f!==0&&f<o?f:o}}function yt(i,o){kt(i,o),(i=i.alternate)&&kt(i,o)}function vt(i){if(i.tag===13||i.tag===31){var o=Va(i,67108864);o!==null&&ra(o,i,67108864),yt(i,67108864)}}function We(i){if(i.tag===13||i.tag===31){var o=Xa();o=On(o);var f=Va(i,o);f!==null&&ra(f,i,o),yt(i,o)}}var jt=!0;function Kt(i,o,f,v){var A=$e.T;$e.T=null;var R=ft.p;try{ft.p=2,zt(i,o,f,v)}finally{ft.p=R,$e.T=A}}function Vt(i,o,f,v){var A=$e.T;$e.T=null;var R=ft.p;try{ft.p=8,zt(i,o,f,v)}finally{ft.p=R,$e.T=A}}function zt(i,o,f,v){if(jt){var A=fn(v);if(A===null)d1(i,o,v,gi,f),Qa(i,v);else if(Pa(A,i,o,f,v))v.stopPropagation();else if(Qa(i,v),o&4&&-1<aa.indexOf(i)){for(;A!==null;){var R=Fa(A);if(R!==null)switch(R.tag){case 3:if(R=R.stateNode,R.current.memoizedState.isDehydrated){var V=Ie(R.pendingLanes);if(V!==0){var ee=R;for(ee.pendingLanes|=2,ee.entangledLanes|=2;V;){var xe=1<<31-De(V);ee.entanglements[1]|=xe,V&=~xe}xo(R),(Bn&6)===0&&(eh=Ji()+500,nh(0))}}break;case 31:case 13:ee=Va(R,2),ee!==null&&ra(ee,R,2),i1(),yt(R,2)}if(R=fn(v),R===null&&d1(i,o,v,gi,f),R===A)break;A=R}A!==null&&v.stopPropagation()}else d1(i,o,v,null,f)}}function fn(i){return i=Uo(i),Ui(i)}var gi=null;function Ui(i){if(gi=null,i=Ts(i),i!==null){var o=E(i);if(o===null)i=null;else{var f=o.tag;if(f===13){if(i=C(o),i!==null)return i;i=null}else if(f===31){if(i=c(o),i!==null)return i;i=null}else if(f===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;i=null}else o!==i&&(i=null)}}return gi=i,null}function Er(i){switch(i){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(hu()){case ua:return 2;case Hs:return 8;case Fr:case Ce:return 32;case Q:return 268435456;default:return 32}default:return 32}}var La=!1,Qi=null,Ti=null,Gn=null,ki=new Map,$i=new Map,Ei=[],aa="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".split(" ");function Qa(i,o){switch(i){case"focusin":case"focusout":Qi=null;break;case"dragenter":case"dragleave":Ti=null;break;case"mouseover":case"mouseout":Gn=null;break;case"pointerover":case"pointerout":ki.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":$i.delete(o.pointerId)}}function Bi(i,o,f,v,A,R){return i===null||i.nativeEvent!==R?(i={blockedOn:o,domEventName:f,eventSystemFlags:v,nativeEvent:R,targetContainers:[A]},o!==null&&(o=Fa(o),o!==null&&vt(o)),i):(i.eventSystemFlags|=v,o=i.targetContainers,A!==null&&o.indexOf(A)===-1&&o.push(A),i)}function Pa(i,o,f,v,A){switch(o){case"focusin":return Qi=Bi(Qi,i,o,f,v,A),!0;case"dragenter":return Ti=Bi(Ti,i,o,f,v,A),!0;case"mouseover":return Gn=Bi(Gn,i,o,f,v,A),!0;case"pointerover":var R=A.pointerId;return ki.set(R,Bi(ki.get(R)||null,i,o,f,v,A)),!0;case"gotpointercapture":return R=A.pointerId,$i.set(R,Bi($i.get(R)||null,i,o,f,v,A)),!0}return!1}function Wi(i){var o=Ts(i.target);if(o!==null){var f=E(o);if(f!==null){if(o=f.tag,o===13){if(o=C(f),o!==null){i.blockedOn=o,Yr(i.priority,function(){We(f)});return}}else if(o===31){if(o=c(f),o!==null){i.blockedOn=o,Yr(i.priority,function(){We(f)});return}}else if(o===3&&f.stateNode.current.memoizedState.isDehydrated){i.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Vi(i){if(i.blockedOn!==null)return!1;for(var o=i.targetContainers;0<o.length;){var f=fn(i.nativeEvent);if(f===null){f=i.nativeEvent;var v=new f.constructor(f.type,f);Tl=v,f.target.dispatchEvent(v),Tl=null}else return o=Fa(f),o!==null&&vt(o),i.blockedOn=f,!1;o.shift()}return!0}function or(i,o,f){Vi(i)&&f.delete(o)}function Ki(){La=!1,Qi!==null&&Vi(Qi)&&(Qi=null),Ti!==null&&Vi(Ti)&&(Ti=null),Gn!==null&&Vi(Gn)&&(Gn=null),ki.forEach(or),$i.forEach(or)}function ei(i,o){i.blockedOn===o&&(i.blockedOn=null,La||(La=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,Ki)))}var Wa=null;function rh(i){Wa!==i&&(Wa=i,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Wa===i&&(Wa=null);for(var o=0;o<i.length;o+=3){var f=i[o],v=i[o+1],A=i[o+2];if(typeof v!="function"){if(Ui(v||f)===null)continue;break}var R=Fa(f);R!==null&&(i.splice(o,3),o-=3,qa(R,{pending:!0,data:A,method:f.method,action:v},v,A))}}))}function sa(i){function o(xe){return ei(xe,i)}Qi!==null&&ei(Qi,i),Ti!==null&&ei(Ti,i),Gn!==null&&ei(Gn,i),ki.forEach(o),$i.forEach(o);for(var f=0;f<Ei.length;f++){var v=Ei[f];v.blockedOn===i&&(v.blockedOn=null)}for(;0<Ei.length&&(f=Ei[0],f.blockedOn===null);)Wi(f),f.blockedOn===null&&Ei.shift();if(f=(i.ownerDocument||i).$$reactFormReplay,f!=null)for(v=0;v<f.length;v+=3){var A=f[v],R=f[v+1],V=A[ut]||null;if(typeof R=="function")V||rh(f);else if(V){var ee=null;if(R&&R.hasAttribute("formAction")){if(A=R,V=R[ut]||null)ee=V.formAction;else if(Ui(A)!==null)continue}else ee=V.action;typeof ee=="function"?f[v+1]=ee:(f.splice(v,3),v-=3),rh(f)}}}function a2(){function i(R){R.canIntercept&&R.info==="react-transition"&&R.intercept({handler:function(){return new Promise(function(V){return A=V})},focusReset:"manual",scroll:"manual"})}function o(){A!==null&&(A(),A=null),v||setTimeout(f,20)}function f(){if(!v&&!navigation.transition){var R=navigation.currentEntry;R&&R.url!=null&&navigation.navigate(R.url,{state:R.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var v=!1,A=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(f,100),function(){v=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),A!==null&&(A(),A=null)}}}function tu(i){this._internalRoot=i}gl.prototype.render=tu.prototype.render=function(i){var o=this._internalRoot;if(o===null)throw Error(m(409));var f=o.current,v=Xa();_t(f,v,i,o,null,null)},gl.prototype.unmount=tu.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var o=i.containerInfo;_t(i.current,2,null,i,null,null),i1(),o[on]=null}};function gl(i){this._internalRoot=i}gl.prototype.unstable_scheduleHydration=function(i){if(i){var o=is();i={blockedOn:null,target:i,priority:o};for(var f=0;f<Ei.length&&o!==0&&o<Ei[f].priority;f++);Ei.splice(f,0,i),f===0&&Wi(i)}};var ah=l.version;if(ah!=="19.2.0")throw Error(m(527,ah,"19.2.0"));ft.findDOMNode=function(i){var o=i._reactInternals;if(o===void 0)throw typeof i.render=="function"?Error(m(188)):(i=Object.keys(i).join(","),Error(m(268,i)));return i=B(o),i=i!==null?Z(i):null,i=i===null?null:i.stateNode,i};var fd={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:$e,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ac=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ac.isDisabled&&ac.supportsFiber)try{he=ac.inject(fd),me=ac}catch{}}return C1.createRoot=function(i,o){if(!w(i))throw Error(m(299));var f=!1,v="",A=xm,R=v0,V=jp;return o!=null&&(o.unstable_strictMode===!0&&(f=!0),o.identifierPrefix!==void 0&&(v=o.identifierPrefix),o.onUncaughtError!==void 0&&(A=o.onUncaughtError),o.onCaughtError!==void 0&&(R=o.onCaughtError),o.onRecoverableError!==void 0&&(V=o.onRecoverableError)),o=bt(i,1,!1,null,null,f,v,null,A,R,V,a2),i[on]=o.current,h1(i),new tu(o)},C1.hydrateRoot=function(i,o,f){if(!w(i))throw Error(m(299));var v=!1,A="",R=xm,V=v0,ee=jp,xe=null;return f!=null&&(f.unstable_strictMode===!0&&(v=!0),f.identifierPrefix!==void 0&&(A=f.identifierPrefix),f.onUncaughtError!==void 0&&(R=f.onUncaughtError),f.onCaughtError!==void 0&&(V=f.onCaughtError),f.onRecoverableError!==void 0&&(ee=f.onRecoverableError),f.formState!==void 0&&(xe=f.formState)),o=bt(i,1,!0,o,f??null,v,A,xe,R,V,ee,a2),o.context=mt(null),f=o.current,v=Xa(),v=On(v),A=uo(v),A.callback=null,Ga(f,A,v),f=v,o.current.lanes=f,Ai(o,f),xo(o),i[on]=o.current,h1(i),new gl(o)},C1.version="19.2.0",C1}var I_;function mx(){if(I_)return l2.exports;I_=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),l2.exports=px(),l2.exports}var gx=mx(),T1=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(n){return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},yx={setTimeout:(n,l)=>setTimeout(n,l),clearTimeout:n=>clearTimeout(n),setInterval:(n,l)=>setInterval(n,l),clearInterval:n=>clearInterval(n)},_x=(H5=class{constructor(){an(this,_h,yx);an(this,Wy,!1)}setTimeoutProvider(n){Ft(this,_h,n)}setTimeout(n,l){return Re(this,_h).setTimeout(n,l)}clearTimeout(n){Re(this,_h).clearTimeout(n)}setInterval(n,l){return Re(this,_h).setInterval(n,l)}clearInterval(n){Re(this,_h).clearInterval(n)}},_h=new WeakMap,Wy=new WeakMap,H5),gd=new _x;function vx(n){setTimeout(n,0)}var yd=typeof window>"u"||"Deno"in globalThis;function bs(){}function xx(n,l){return typeof n=="function"?n(l):n}function d2(n){return typeof n=="number"&&n>=0&&n!==1/0}function z_(n,l){return Math.max(n+(l||0)-Date.now(),0)}function lh(n,l){return typeof n=="function"?n(l):n}function Co(n,l){return typeof n=="function"?n(l):n}function D_(n,l){const{type:h="all",exact:m,fetchStatus:w,predicate:E,queryKey:C,stale:c}=n;if(C){if(m){if(l.queryHash!==f2(C,l.options))return!1}else if(!M1(l.queryKey,C))return!1}if(h!=="all"){const D=l.isActive();if(h==="active"&&!D||h==="inactive"&&D)return!1}return!(typeof c=="boolean"&&l.isStale()!==c||w&&w!==l.state.fetchStatus||E&&!E(l))}function O_(n,l){const{exact:h,status:m,predicate:w,mutationKey:E}=n;if(E){if(!l.options.mutationKey)return!1;if(h){if(E1(l.options.mutationKey)!==E1(E))return!1}else if(!M1(l.options.mutationKey,E))return!1}return!(m&&l.state.status!==m||w&&!w(l))}function f2(n,l){return((l==null?void 0:l.queryKeyHashFn)||E1)(n)}function E1(n){return JSON.stringify(n,(l,h)=>m2(h)?Object.keys(h).sort().reduce((m,w)=>(m[w]=h[w],m),{}):h)}function M1(n,l){return n===l?!0:typeof n!=typeof l?!1:n&&l&&typeof n=="object"&&typeof l=="object"?Object.keys(l).every(h=>M1(n[h],l[h])):!1}var bx=Object.prototype.hasOwnProperty;function k_(n,l){if(n===l)return n;const h=B_(n)&&B_(l);if(!h&&!(m2(n)&&m2(l)))return l;const w=(h?n:Object.keys(n)).length,E=h?l:Object.keys(l),C=E.length,c=h?new Array(C):{};let D=0;for(let B=0;B<C;B++){const Z=h?B:E[B],X=n[Z],Y=l[Z];if(X===Y){c[Z]=X,(h?B<w:bx.call(n,Z))&&D++;continue}if(X===null||Y===null||typeof X!="object"||typeof Y!="object"){c[Z]=Y;continue}const U=k_(X,Y);c[Z]=U,U===X&&D++}return w===C&&D===w?n:c}function p2(n,l){if(!l||Object.keys(n).length!==Object.keys(l).length)return!1;for(const h in n)if(n[h]!==l[h])return!1;return!0}function B_(n){return Array.isArray(n)&&n.length===Object.keys(n).length}function m2(n){if(!F_(n))return!1;const l=n.constructor;if(l===void 0)return!0;const h=l.prototype;return!(!F_(h)||!h.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(n)!==Object.prototype)}function F_(n){return Object.prototype.toString.call(n)==="[object Object]"}function wx(n){return new Promise(l=>{gd.setTimeout(l,n)})}function g2(n,l,h){return typeof h.structuralSharing=="function"?h.structuralSharing(n,l):h.structuralSharing!==!1?k_(n,l):l}function Sx(n,l,h=0){const m=[...n,l];return h&&m.length>h?m.slice(1):m}function Cx(n,l,h=0){const m=[l,...n];return h&&m.length>h?m.slice(0,-1):m}var y2=Symbol();function N_(n,l){return!n.queryFn&&(l!=null&&l.initialPromise)?()=>l.initialPromise:!n.queryFn||n.queryFn===y2?()=>Promise.reject(new Error(`Missing queryFn: '${n.queryHash}'`)):n.queryFn}function Tx(n,l){return typeof n=="function"?n(...l):!!n}var Ex=(X5=class extends T1{constructor(){super();an(this,Fd);an(this,vh);an(this,gp);Ft(this,gp,l=>{if(!yd&&window.addEventListener){const h=()=>l();return window.addEventListener("visibilitychange",h,!1),()=>{window.removeEventListener("visibilitychange",h)}}})}onSubscribe(){Re(this,vh)||this.setEventListener(Re(this,gp))}onUnsubscribe(){var l;this.hasListeners()||((l=Re(this,vh))==null||l.call(this),Ft(this,vh,void 0))}setEventListener(l){var h;Ft(this,gp,l),(h=Re(this,vh))==null||h.call(this),Ft(this,vh,l(m=>{typeof m=="boolean"?this.setFocused(m):this.onFocus()}))}setFocused(l){Re(this,Fd)!==l&&(Ft(this,Fd,l),this.onFocus())}onFocus(){const l=this.isFocused();this.listeners.forEach(h=>{h(l)})}isFocused(){var l;return typeof Re(this,Fd)=="boolean"?Re(this,Fd):((l=globalThis.document)==null?void 0:l.visibilityState)!=="hidden"}},Fd=new WeakMap,vh=new WeakMap,gp=new WeakMap,X5),_2=new Ex;function v2(){let n,l;const h=new Promise((w,E)=>{n=w,l=E});h.status="pending",h.catch(()=>{});function m(w){Object.assign(h,w),delete h.resolve,delete h.reject}return h.resolve=w=>{m({status:"fulfilled",value:w}),n(w)},h.reject=w=>{m({status:"rejected",reason:w}),l(w)},h}var Mx=vx;function Ax(){let n=[],l=0,h=c=>{c()},m=c=>{c()},w=Mx;const E=c=>{l?n.push(c):w(()=>{h(c)})},C=()=>{const c=n;n=[],c.length&&w(()=>{m(()=>{c.forEach(D=>{h(D)})})})};return{batch:c=>{let D;l++;try{D=c()}finally{l--,l||C()}return D},batchCalls:c=>(...D)=>{E(()=>{c(...D)})},schedule:E,setNotifyFunction:c=>{h=c},setBatchNotifyFunction:c=>{m=c},setScheduler:c=>{w=c}}}var oa=Ax(),Lx=(Y5=class extends T1{constructor(){super();an(this,yp,!0);an(this,xh);an(this,_p);Ft(this,_p,l=>{if(!yd&&window.addEventListener){const h=()=>l(!0),m=()=>l(!1);return window.addEventListener("online",h,!1),window.addEventListener("offline",m,!1),()=>{window.removeEventListener("online",h),window.removeEventListener("offline",m)}}})}onSubscribe(){Re(this,xh)||this.setEventListener(Re(this,_p))}onUnsubscribe(){var l;this.hasListeners()||((l=Re(this,xh))==null||l.call(this),Ft(this,xh,void 0))}setEventListener(l){var h;Ft(this,_p,l),(h=Re(this,xh))==null||h.call(this),Ft(this,xh,l(this.setOnline.bind(this)))}setOnline(l){Re(this,yp)!==l&&(Ft(this,yp,l),this.listeners.forEach(m=>{m(l)}))}isOnline(){return Re(this,yp)}},yp=new WeakMap,xh=new WeakMap,_p=new WeakMap,Y5),gg=new Lx;function Px(n){return Math.min(1e3*2**n,3e4)}function U_(n){return(n??"online")==="online"?gg.isOnline():!0}var x2=class extends Error{constructor(n){super("CancelledError"),this.revert=n==null?void 0:n.revert,this.silent=n==null?void 0:n.silent}};function $_(n){let l=!1,h=0,m;const w=v2(),E=()=>w.status!=="pending",C=ge=>{var ye;if(!E()){const Se=new x2(ge);Y(Se),(ye=n.onCancel)==null||ye.call(n,Se)}},c=()=>{l=!0},D=()=>{l=!1},B=()=>_2.isFocused()&&(n.networkMode==="always"||gg.isOnline())&&n.canRun(),Z=()=>U_(n.networkMode)&&n.canRun(),X=ge=>{E()||(m==null||m(),w.resolve(ge))},Y=ge=>{E()||(m==null||m(),w.reject(ge))},U=()=>new Promise(ge=>{var ye;m=Se=>{(E()||B())&&ge(Se)},(ye=n.onPause)==null||ye.call(n)}).then(()=>{var ge;m=void 0,E()||(ge=n.onContinue)==null||ge.call(n)}),oe=()=>{if(E())return;let ge;const ye=h===0?n.initialPromise:void 0;try{ge=ye??n.fn()}catch(Se){ge=Promise.reject(Se)}Promise.resolve(ge).then(X).catch(Se=>{var et;if(E())return;const je=n.retry??(yd?0:3),Pe=n.retryDelay??Px,Oe=typeof Pe=="function"?Pe(h,Se):Pe,Je=je===!0||typeof je=="number"&&h<je||typeof je=="function"&&je(h,Se);if(l||!Je){Y(Se);return}h++,(et=n.onFail)==null||et.call(n,h,Se),wx(Oe).then(()=>B()?void 0:U()).then(()=>{l?Y(Se):oe()})})};return{promise:w,status:()=>w.status,cancel:C,continue:()=>(m==null||m(),w),cancelRetry:c,continueRetry:D,canStart:Z,start:()=>(Z()?oe():U().then(oe),w)}}var V_=(Q5=class{constructor(){an(this,Nd)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),d2(this.gcTime)&&Ft(this,Nd,gd.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(n){this.gcTime=Math.max(this.gcTime||0,n??(yd?1/0:300*1e3))}clearGcTimeout(){Re(this,Nd)&&(gd.clearTimeout(Re(this,Nd)),Ft(this,Nd,void 0))}},Nd=new WeakMap,Q5),Rx=(W5=class extends V_{constructor(l){super();an(this,xl);an(this,Ud);an(this,vp);an(this,Io);an(this,$d);an(this,Xr);an(this,cm);an(this,Vd);Ft(this,Vd,!1),Ft(this,cm,l.defaultOptions),this.setOptions(l.options),this.observers=[],Ft(this,$d,l.client),Ft(this,Io,Re(this,$d).getQueryCache()),this.queryKey=l.queryKey,this.queryHash=l.queryHash,Ft(this,Ud,Z_(this.options)),this.state=l.state??Re(this,Ud),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var l;return(l=Re(this,Xr))==null?void 0:l.promise}setOptions(l){if(this.options={...Re(this,cm),...l},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const h=Z_(this.options);h.data!==void 0&&(this.setData(h.data,{updatedAt:h.dataUpdatedAt,manual:!0}),Ft(this,Ud,h))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Re(this,Io).remove(this)}setData(l,h){const m=g2(this.state.data,l,this.options);return qn(this,xl,sh).call(this,{data:m,type:"success",dataUpdatedAt:h==null?void 0:h.updatedAt,manual:h==null?void 0:h.manual}),m}setState(l,h){qn(this,xl,sh).call(this,{type:"setState",state:l,setStateOptions:h})}cancel(l){var m,w;const h=(m=Re(this,Xr))==null?void 0:m.promise;return(w=Re(this,Xr))==null||w.cancel(l),h?h.then(bs).catch(bs):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Re(this,Ud))}isActive(){return this.observers.some(l=>Co(l.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===y2||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(l=>lh(l.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(l=>l.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(l=0){return this.state.data===void 0?!0:l==="static"?!1:this.state.isInvalidated?!0:!z_(this.state.dataUpdatedAt,l)}onFocus(){var h;const l=this.observers.find(m=>m.shouldFetchOnWindowFocus());l==null||l.refetch({cancelRefetch:!1}),(h=Re(this,Xr))==null||h.continue()}onOnline(){var h;const l=this.observers.find(m=>m.shouldFetchOnReconnect());l==null||l.refetch({cancelRefetch:!1}),(h=Re(this,Xr))==null||h.continue()}addObserver(l){this.observers.includes(l)||(this.observers.push(l),this.clearGcTimeout(),Re(this,Io).notify({type:"observerAdded",query:this,observer:l}))}removeObserver(l){this.observers.includes(l)&&(this.observers=this.observers.filter(h=>h!==l),this.observers.length||(Re(this,Xr)&&(Re(this,Vd)?Re(this,Xr).cancel({revert:!0}):Re(this,Xr).cancelRetry()),this.scheduleGc()),Re(this,Io).notify({type:"observerRemoved",query:this,observer:l}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||qn(this,xl,sh).call(this,{type:"invalidate"})}async fetch(l,h){var D,B,Z,X,Y,U,oe,ge,ye,Se,je,Pe;if(this.state.fetchStatus!=="idle"&&((D=Re(this,Xr))==null?void 0:D.status())!=="rejected"){if(this.state.data!==void 0&&(h!=null&&h.cancelRefetch))this.cancel({silent:!0});else if(Re(this,Xr))return Re(this,Xr).continueRetry(),Re(this,Xr).promise}if(l&&this.setOptions(l),!this.options.queryFn){const Oe=this.observers.find(Je=>Je.options.queryFn);Oe&&this.setOptions(Oe.options)}const m=new AbortController,w=Oe=>{Object.defineProperty(Oe,"signal",{enumerable:!0,get:()=>(Ft(this,Vd,!0),m.signal)})},E=()=>{const Oe=N_(this.options,h),et=(()=>{const ot={client:Re(this,$d),queryKey:this.queryKey,meta:this.meta};return w(ot),ot})();return Ft(this,Vd,!1),this.options.persister?this.options.persister(Oe,et,this):Oe(et)},c=(()=>{const Oe={fetchOptions:h,options:this.options,queryKey:this.queryKey,client:Re(this,$d),state:this.state,fetchFn:E};return w(Oe),Oe})();(B=this.options.behavior)==null||B.onFetch(c,this),Ft(this,vp,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((Z=c.fetchOptions)==null?void 0:Z.meta))&&qn(this,xl,sh).call(this,{type:"fetch",meta:(X=c.fetchOptions)==null?void 0:X.meta}),Ft(this,Xr,$_({initialPromise:h==null?void 0:h.initialPromise,fn:c.fetchFn,onCancel:Oe=>{Oe instanceof x2&&Oe.revert&&this.setState({...Re(this,vp),fetchStatus:"idle"}),m.abort()},onFail:(Oe,Je)=>{qn(this,xl,sh).call(this,{type:"failed",failureCount:Oe,error:Je})},onPause:()=>{qn(this,xl,sh).call(this,{type:"pause"})},onContinue:()=>{qn(this,xl,sh).call(this,{type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0}));try{const Oe=await Re(this,Xr).start();if(Oe===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(Oe),(U=(Y=Re(this,Io).config).onSuccess)==null||U.call(Y,Oe,this),(ge=(oe=Re(this,Io).config).onSettled)==null||ge.call(oe,Oe,this.state.error,this),Oe}catch(Oe){if(Oe instanceof x2){if(Oe.silent)return Re(this,Xr).promise;if(Oe.revert){if(this.state.data===void 0)throw Oe;return this.state.data}}throw qn(this,xl,sh).call(this,{type:"error",error:Oe}),(Se=(ye=Re(this,Io).config).onError)==null||Se.call(ye,Oe,this),(Pe=(je=Re(this,Io).config).onSettled)==null||Pe.call(je,this.state.data,Oe,this),Oe}finally{this.scheduleGc()}}},Ud=new WeakMap,vp=new WeakMap,Io=new WeakMap,$d=new WeakMap,Xr=new WeakMap,cm=new WeakMap,Vd=new WeakMap,xl=new WeakSet,sh=function(l){const h=m=>{switch(l.type){case"failed":return{...m,fetchFailureCount:l.failureCount,fetchFailureReason:l.error};case"pause":return{...m,fetchStatus:"paused"};case"continue":return{...m,fetchStatus:"fetching"};case"fetch":return{...m,...j_(m.data,this.options),fetchMeta:l.meta??null};case"success":const w={...m,data:l.data,dataUpdateCount:m.dataUpdateCount+1,dataUpdatedAt:l.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!l.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Ft(this,vp,l.manual?w:void 0),w;case"error":const E=l.error;return{...m,error:E,errorUpdateCount:m.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:m.fetchFailureCount+1,fetchFailureReason:E,fetchStatus:"idle",status:"error"};case"invalidate":return{...m,isInvalidated:!0};case"setState":return{...m,...l.state}}};this.state=h(this.state),oa.batch(()=>{this.observers.forEach(m=>{m.onQueryUpdate()}),Re(this,Io).notify({query:this,type:"updated",action:l})})},W5);function j_(n,l){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:U_(l.networkMode)?"fetching":"paused",...n===void 0&&{error:null,status:"pending"}}}function Z_(n){const l=typeof n.initialData=="function"?n.initialData():n.initialData,h=l!==void 0,m=h?typeof n.initialDataUpdatedAt=="function"?n.initialDataUpdatedAt():n.initialDataUpdatedAt:0;return{data:l,dataUpdateCount:0,dataUpdatedAt:h?m??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:h?"success":"pending",fetchStatus:"idle"}}var Ix=(K5=class extends T1{constructor(l,h){super();an(this,fi);an(this,ws);an(this,Vn);an(this,um);an(this,ts);an(this,jd);an(this,xp);an(this,cu);an(this,bh);an(this,hm);an(this,bp);an(this,wp);an(this,Zd);an(this,Gd);an(this,wh);an(this,Sp,new Set);this.options=h,Ft(this,ws,l),Ft(this,bh,null),Ft(this,cu,v2()),this.bindMethods(),this.setOptions(h)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Re(this,Vn).addObserver(this),G_(Re(this,Vn),this.options)?qn(this,fi,pg).call(this):this.updateResult(),qn(this,fi,__).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return b2(Re(this,Vn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return b2(Re(this,Vn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,qn(this,fi,v_).call(this),qn(this,fi,x_).call(this),Re(this,Vn).removeObserver(this)}setOptions(l){const h=this.options,m=Re(this,Vn);if(this.options=Re(this,ws).defaultQueryOptions(l),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Co(this.options.enabled,Re(this,Vn))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");qn(this,fi,b_).call(this),Re(this,Vn).setOptions(this.options),h._defaulted&&!p2(this.options,h)&&Re(this,ws).getQueryCache().notify({type:"observerOptionsUpdated",query:Re(this,Vn),observer:this});const w=this.hasListeners();w&&q_(Re(this,Vn),m,this.options,h)&&qn(this,fi,pg).call(this),this.updateResult(),w&&(Re(this,Vn)!==m||Co(this.options.enabled,Re(this,Vn))!==Co(h.enabled,Re(this,Vn))||lh(this.options.staleTime,Re(this,Vn))!==lh(h.staleTime,Re(this,Vn)))&&qn(this,fi,m_).call(this);const E=qn(this,fi,g_).call(this);w&&(Re(this,Vn)!==m||Co(this.options.enabled,Re(this,Vn))!==Co(h.enabled,Re(this,Vn))||E!==Re(this,wh))&&qn(this,fi,y_).call(this,E)}getOptimisticResult(l){const h=Re(this,ws).getQueryCache().build(Re(this,ws),l),m=this.createResult(h,l);return Dx(this,m)&&(Ft(this,ts,m),Ft(this,xp,this.options),Ft(this,jd,Re(this,Vn).state)),m}getCurrentResult(){return Re(this,ts)}trackResult(l,h){return new Proxy(l,{get:(m,w)=>(this.trackProp(w),h==null||h(w),w==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&Re(this,cu).status==="pending"&&Re(this,cu).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(m,w))})}trackProp(l){Re(this,Sp).add(l)}getCurrentQuery(){return Re(this,Vn)}refetch({...l}={}){return this.fetch({...l})}fetchOptimistic(l){const h=Re(this,ws).defaultQueryOptions(l),m=Re(this,ws).getQueryCache().build(Re(this,ws),h);return m.fetch().then(()=>this.createResult(m,h))}fetch(l){return qn(this,fi,pg).call(this,{...l,cancelRefetch:l.cancelRefetch??!0}).then(()=>(this.updateResult(),Re(this,ts)))}createResult(l,h){var Gt;const m=Re(this,Vn),w=this.options,E=Re(this,ts),C=Re(this,jd),c=Re(this,xp),B=l!==m?l.state:Re(this,um),{state:Z}=l;let X={...Z},Y=!1,U;if(h._optimisticResults){const Tt=this.hasListeners(),Ot=!Tt&&G_(l,h),At=Tt&&q_(l,m,h,w);(Ot||At)&&(X={...X,...j_(Z.data,l.options)}),h._optimisticResults==="isRestoring"&&(X.fetchStatus="idle")}let{error:oe,errorUpdatedAt:ge,status:ye}=X;U=X.data;let Se=!1;if(h.placeholderData!==void 0&&U===void 0&&ye==="pending"){let Tt;E!=null&&E.isPlaceholderData&&h.placeholderData===(c==null?void 0:c.placeholderData)?(Tt=E.data,Se=!0):Tt=typeof h.placeholderData=="function"?h.placeholderData((Gt=Re(this,wp))==null?void 0:Gt.state.data,Re(this,wp)):h.placeholderData,Tt!==void 0&&(ye="success",U=g2(E==null?void 0:E.data,Tt,h),Y=!0)}if(h.select&&U!==void 0&&!Se)if(E&&U===(C==null?void 0:C.data)&&h.select===Re(this,hm))U=Re(this,bp);else try{Ft(this,hm,h.select),U=h.select(U),U=g2(E==null?void 0:E.data,U,h),Ft(this,bp,U),Ft(this,bh,null)}catch(Tt){Ft(this,bh,Tt)}Re(this,bh)&&(oe=Re(this,bh),U=Re(this,bp),ge=Date.now(),ye="error");const je=X.fetchStatus==="fetching",Pe=ye==="pending",Oe=ye==="error",Je=Pe&&je,et=U!==void 0,Rt={status:ye,fetchStatus:X.fetchStatus,isPending:Pe,isSuccess:ye==="success",isError:Oe,isInitialLoading:Je,isLoading:Je,data:U,dataUpdatedAt:X.dataUpdatedAt,error:oe,errorUpdatedAt:ge,failureCount:X.fetchFailureCount,failureReason:X.fetchFailureReason,errorUpdateCount:X.errorUpdateCount,isFetched:X.dataUpdateCount>0||X.errorUpdateCount>0,isFetchedAfterMount:X.dataUpdateCount>B.dataUpdateCount||X.errorUpdateCount>B.errorUpdateCount,isFetching:je,isRefetching:je&&!Pe,isLoadingError:Oe&&!et,isPaused:X.fetchStatus==="paused",isPlaceholderData:Y,isRefetchError:Oe&&et,isStale:w2(l,h),refetch:this.refetch,promise:Re(this,cu),isEnabled:Co(h.enabled,l)!==!1};if(this.options.experimental_prefetchInRender){const Tt=Qt=>{Rt.status==="error"?Qt.reject(Rt.error):Rt.data!==void 0&&Qt.resolve(Rt.data)},Ot=()=>{const Qt=Ft(this,cu,Rt.promise=v2());Tt(Qt)},At=Re(this,cu);switch(At.status){case"pending":l.queryHash===m.queryHash&&Tt(At);break;case"fulfilled":(Rt.status==="error"||Rt.data!==At.value)&&Ot();break;case"rejected":(Rt.status!=="error"||Rt.error!==At.reason)&&Ot();break}}return Rt}updateResult(){const l=Re(this,ts),h=this.createResult(Re(this,Vn),this.options);if(Ft(this,jd,Re(this,Vn).state),Ft(this,xp,this.options),Re(this,jd).data!==void 0&&Ft(this,wp,Re(this,Vn)),p2(h,l))return;Ft(this,ts,h);const m=()=>{if(!l)return!0;const{notifyOnChangeProps:w}=this.options,E=typeof w=="function"?w():w;if(E==="all"||!E&&!Re(this,Sp).size)return!0;const C=new Set(E??Re(this,Sp));return this.options.throwOnError&&C.add("error"),Object.keys(Re(this,ts)).some(c=>{const D=c;return Re(this,ts)[D]!==l[D]&&C.has(D)})};qn(this,fi,rx).call(this,{listeners:m()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&qn(this,fi,__).call(this)}},ws=new WeakMap,Vn=new WeakMap,um=new WeakMap,ts=new WeakMap,jd=new WeakMap,xp=new WeakMap,cu=new WeakMap,bh=new WeakMap,hm=new WeakMap,bp=new WeakMap,wp=new WeakMap,Zd=new WeakMap,Gd=new WeakMap,wh=new WeakMap,Sp=new WeakMap,fi=new WeakSet,pg=function(l){qn(this,fi,b_).call(this);let h=Re(this,Vn).fetch(this.options,l);return l!=null&&l.throwOnError||(h=h.catch(bs)),h},m_=function(){qn(this,fi,v_).call(this);const l=lh(this.options.staleTime,Re(this,Vn));if(yd||Re(this,ts).isStale||!d2(l))return;const m=z_(Re(this,ts).dataUpdatedAt,l)+1;Ft(this,Zd,gd.setTimeout(()=>{Re(this,ts).isStale||this.updateResult()},m))},g_=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Re(this,Vn)):this.options.refetchInterval)??!1},y_=function(l){qn(this,fi,x_).call(this),Ft(this,wh,l),!(yd||Co(this.options.enabled,Re(this,Vn))===!1||!d2(Re(this,wh))||Re(this,wh)===0)&&Ft(this,Gd,gd.setInterval(()=>{(this.options.refetchIntervalInBackground||_2.isFocused())&&qn(this,fi,pg).call(this)},Re(this,wh)))},__=function(){qn(this,fi,m_).call(this),qn(this,fi,y_).call(this,qn(this,fi,g_).call(this))},v_=function(){Re(this,Zd)&&(gd.clearTimeout(Re(this,Zd)),Ft(this,Zd,void 0))},x_=function(){Re(this,Gd)&&(gd.clearInterval(Re(this,Gd)),Ft(this,Gd,void 0))},b_=function(){const l=Re(this,ws).getQueryCache().build(Re(this,ws),this.options);if(l===Re(this,Vn))return;const h=Re(this,Vn);Ft(this,Vn,l),Ft(this,um,l.state),this.hasListeners()&&(h==null||h.removeObserver(this),l.addObserver(this))},rx=function(l){oa.batch(()=>{l.listeners&&this.listeners.forEach(h=>{h(Re(this,ts))}),Re(this,ws).getQueryCache().notify({query:Re(this,Vn),type:"observerResultsUpdated"})})},K5);function zx(n,l){return Co(l.enabled,n)!==!1&&n.state.data===void 0&&!(n.state.status==="error"&&l.retryOnMount===!1)}function G_(n,l){return zx(n,l)||n.state.data!==void 0&&b2(n,l,l.refetchOnMount)}function b2(n,l,h){if(Co(l.enabled,n)!==!1&&lh(l.staleTime,n)!=="static"){const m=typeof h=="function"?h(n):h;return m==="always"||m!==!1&&w2(n,l)}return!1}function q_(n,l,h,m){return(n!==l||Co(m.enabled,n)===!1)&&(!h.suspense||n.state.status!=="error")&&w2(n,h)}function w2(n,l){return Co(l.enabled,n)!==!1&&n.isStaleByTime(lh(l.staleTime,n))}function Dx(n,l){return!p2(n.getCurrentResult(),l)}function H_(n){return{onFetch:(l,h)=>{var Z,X,Y,U,oe;const m=l.options,w=(Y=(X=(Z=l.fetchOptions)==null?void 0:Z.meta)==null?void 0:X.fetchMore)==null?void 0:Y.direction,E=((U=l.state.data)==null?void 0:U.pages)||[],C=((oe=l.state.data)==null?void 0:oe.pageParams)||[];let c={pages:[],pageParams:[]},D=0;const B=async()=>{let ge=!1;const ye=Pe=>{Object.defineProperty(Pe,"signal",{enumerable:!0,get:()=>(l.signal.aborted?ge=!0:l.signal.addEventListener("abort",()=>{ge=!0}),l.signal)})},Se=N_(l.options,l.fetchOptions),je=async(Pe,Oe,Je)=>{if(ge)return Promise.reject();if(Oe==null&&Pe.pages.length)return Promise.resolve(Pe);const ot=(()=>{const Ot={client:l.client,queryKey:l.queryKey,pageParam:Oe,direction:Je?"backward":"forward",meta:l.options.meta};return ye(Ot),Ot})(),Rt=await Se(ot),{maxPages:Gt}=l.options,Tt=Je?Cx:Sx;return{pages:Tt(Pe.pages,Rt,Gt),pageParams:Tt(Pe.pageParams,Oe,Gt)}};if(w&&E.length){const Pe=w==="backward",Oe=Pe?Ox:X_,Je={pages:E,pageParams:C},et=Oe(m,Je);c=await je(Je,et,Pe)}else{const Pe=n??E.length;do{const Oe=D===0?C[0]??m.initialPageParam:X_(m,c);if(D>0&&Oe==null)break;c=await je(c,Oe),D++}while(D<Pe)}return c};l.options.persister?l.fetchFn=()=>{var ge,ye;return(ye=(ge=l.options).persister)==null?void 0:ye.call(ge,B,{client:l.client,queryKey:l.queryKey,meta:l.options.meta,signal:l.signal},h)}:l.fetchFn=B}}}function X_(n,{pages:l,pageParams:h}){const m=l.length-1;return l.length>0?n.getNextPageParam(l[m],l,h[m],h):void 0}function Ox(n,{pages:l,pageParams:h}){var m;return l.length>0?(m=n.getPreviousPageParam)==null?void 0:m.call(n,l[0],l,h[0],h):void 0}var kx=(J5=class extends V_{constructor(l){super();an(this,_c);an(this,dm);an(this,yc);an(this,ns);an(this,qd);Ft(this,dm,l.client),this.mutationId=l.mutationId,Ft(this,ns,l.mutationCache),Ft(this,yc,[]),this.state=l.state||Bx(),this.setOptions(l.options),this.scheduleGc()}setOptions(l){this.options=l,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(l){Re(this,yc).includes(l)||(Re(this,yc).push(l),this.clearGcTimeout(),Re(this,ns).notify({type:"observerAdded",mutation:this,observer:l}))}removeObserver(l){Ft(this,yc,Re(this,yc).filter(h=>h!==l)),this.scheduleGc(),Re(this,ns).notify({type:"observerRemoved",mutation:this,observer:l})}optionalRemove(){Re(this,yc).length||(this.state.status==="pending"?this.scheduleGc():Re(this,ns).remove(this))}continue(){var l;return((l=Re(this,qd))==null?void 0:l.continue())??this.execute(this.state.variables)}async execute(l){var C,c,D,B,Z,X,Y,U,oe,ge,ye,Se,je,Pe,Oe,Je,et,ot,Rt,Gt;const h=()=>{qn(this,_c,pd).call(this,{type:"continue"})},m={client:Re(this,dm),meta:this.options.meta,mutationKey:this.options.mutationKey};Ft(this,qd,$_({fn:()=>this.options.mutationFn?this.options.mutationFn(l,m):Promise.reject(new Error("No mutationFn found")),onFail:(Tt,Ot)=>{qn(this,_c,pd).call(this,{type:"failed",failureCount:Tt,error:Ot})},onPause:()=>{qn(this,_c,pd).call(this,{type:"pause"})},onContinue:h,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Re(this,ns).canRun(this)}));const w=this.state.status==="pending",E=!Re(this,qd).canStart();try{if(w)h();else{qn(this,_c,pd).call(this,{type:"pending",variables:l,isPaused:E}),await((c=(C=Re(this,ns).config).onMutate)==null?void 0:c.call(C,l,this,m));const Ot=await((B=(D=this.options).onMutate)==null?void 0:B.call(D,l,m));Ot!==this.state.context&&qn(this,_c,pd).call(this,{type:"pending",context:Ot,variables:l,isPaused:E})}const Tt=await Re(this,qd).start();return await((X=(Z=Re(this,ns).config).onSuccess)==null?void 0:X.call(Z,Tt,l,this.state.context,this,m)),await((U=(Y=this.options).onSuccess)==null?void 0:U.call(Y,Tt,l,this.state.context,m)),await((ge=(oe=Re(this,ns).config).onSettled)==null?void 0:ge.call(oe,Tt,null,this.state.variables,this.state.context,this,m)),await((Se=(ye=this.options).onSettled)==null?void 0:Se.call(ye,Tt,null,l,this.state.context,m)),qn(this,_c,pd).call(this,{type:"success",data:Tt}),Tt}catch(Tt){try{throw await((Pe=(je=Re(this,ns).config).onError)==null?void 0:Pe.call(je,Tt,l,this.state.context,this,m)),await((Je=(Oe=this.options).onError)==null?void 0:Je.call(Oe,Tt,l,this.state.context,m)),await((ot=(et=Re(this,ns).config).onSettled)==null?void 0:ot.call(et,void 0,Tt,this.state.variables,this.state.context,this,m)),await((Gt=(Rt=this.options).onSettled)==null?void 0:Gt.call(Rt,void 0,Tt,l,this.state.context,m)),Tt}finally{qn(this,_c,pd).call(this,{type:"error",error:Tt})}}finally{Re(this,ns).runNext(this)}}},dm=new WeakMap,yc=new WeakMap,ns=new WeakMap,qd=new WeakMap,_c=new WeakSet,pd=function(l){const h=m=>{switch(l.type){case"failed":return{...m,failureCount:l.failureCount,failureReason:l.error};case"pause":return{...m,isPaused:!0};case"continue":return{...m,isPaused:!1};case"pending":return{...m,context:l.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:l.isPaused,status:"pending",variables:l.variables,submittedAt:Date.now()};case"success":return{...m,data:l.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...m,data:void 0,error:l.error,failureCount:m.failureCount+1,failureReason:l.error,isPaused:!1,status:"error"}}};this.state=h(this.state),oa.batch(()=>{Re(this,yc).forEach(m=>{m.onMutationUpdate(l)}),Re(this,ns).notify({mutation:this,type:"updated",action:l})})},J5);function Bx(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Fx=(ex=class extends T1{constructor(l={}){super();an(this,uu);an(this,bl);an(this,fm);this.config=l,Ft(this,uu,new Set),Ft(this,bl,new Map),Ft(this,fm,0)}build(l,h,m){const w=new kx({client:l,mutationCache:this,mutationId:++s2(this,fm)._,options:l.defaultMutationOptions(h),state:m});return this.add(w),w}add(l){Re(this,uu).add(l);const h=yg(l);if(typeof h=="string"){const m=Re(this,bl).get(h);m?m.push(l):Re(this,bl).set(h,[l])}this.notify({type:"added",mutation:l})}remove(l){if(Re(this,uu).delete(l)){const h=yg(l);if(typeof h=="string"){const m=Re(this,bl).get(h);if(m)if(m.length>1){const w=m.indexOf(l);w!==-1&&m.splice(w,1)}else m[0]===l&&Re(this,bl).delete(h)}}this.notify({type:"removed",mutation:l})}canRun(l){const h=yg(l);if(typeof h=="string"){const m=Re(this,bl).get(h),w=m==null?void 0:m.find(E=>E.state.status==="pending");return!w||w===l}else return!0}runNext(l){var m;const h=yg(l);if(typeof h=="string"){const w=(m=Re(this,bl).get(h))==null?void 0:m.find(E=>E!==l&&E.state.isPaused);return(w==null?void 0:w.continue())??Promise.resolve()}else return Promise.resolve()}clear(){oa.batch(()=>{Re(this,uu).forEach(l=>{this.notify({type:"removed",mutation:l})}),Re(this,uu).clear(),Re(this,bl).clear()})}getAll(){return Array.from(Re(this,uu))}find(l){const h={exact:!0,...l};return this.getAll().find(m=>O_(h,m))}findAll(l={}){return this.getAll().filter(h=>O_(l,h))}notify(l){oa.batch(()=>{this.listeners.forEach(h=>{h(l)})})}resumePausedMutations(){const l=this.getAll().filter(h=>h.state.isPaused);return oa.batch(()=>Promise.all(l.map(h=>h.continue().catch(bs))))}},uu=new WeakMap,bl=new WeakMap,fm=new WeakMap,ex);function yg(n){var l;return(l=n.options.scope)==null?void 0:l.id}var Nx=(tx=class extends T1{constructor(l={}){super();an(this,vc);this.config=l,Ft(this,vc,new Map)}build(l,h,m){const w=h.queryKey,E=h.queryHash??f2(w,h);let C=this.get(E);return C||(C=new Rx({client:l,queryKey:w,queryHash:E,options:l.defaultQueryOptions(h),state:m,defaultOptions:l.getQueryDefaults(w)}),this.add(C)),C}add(l){Re(this,vc).has(l.queryHash)||(Re(this,vc).set(l.queryHash,l),this.notify({type:"added",query:l}))}remove(l){const h=Re(this,vc).get(l.queryHash);h&&(l.destroy(),h===l&&Re(this,vc).delete(l.queryHash),this.notify({type:"removed",query:l}))}clear(){oa.batch(()=>{this.getAll().forEach(l=>{this.remove(l)})})}get(l){return Re(this,vc).get(l)}getAll(){return[...Re(this,vc).values()]}find(l){const h={exact:!0,...l};return this.getAll().find(m=>D_(h,m))}findAll(l={}){const h=this.getAll();return Object.keys(l).length>0?h.filter(m=>D_(l,m)):h}notify(l){oa.batch(()=>{this.listeners.forEach(h=>{h(l)})})}onFocus(){oa.batch(()=>{this.getAll().forEach(l=>{l.onFocus()})})}onOnline(){oa.batch(()=>{this.getAll().forEach(l=>{l.onOnline()})})}},vc=new WeakMap,tx),Ux=(nx=class{constructor(n={}){an(this,cr);an(this,Sh);an(this,Ch);an(this,Cp);an(this,Tp);an(this,Th);an(this,Ep);an(this,Mp);Ft(this,cr,n.queryCache||new Nx),Ft(this,Sh,n.mutationCache||new Fx),Ft(this,Ch,n.defaultOptions||{}),Ft(this,Cp,new Map),Ft(this,Tp,new Map),Ft(this,Th,0)}mount(){s2(this,Th)._++,Re(this,Th)===1&&(Ft(this,Ep,_2.subscribe(async n=>{n&&(await this.resumePausedMutations(),Re(this,cr).onFocus())})),Ft(this,Mp,gg.subscribe(async n=>{n&&(await this.resumePausedMutations(),Re(this,cr).onOnline())})))}unmount(){var n,l;s2(this,Th)._--,Re(this,Th)===0&&((n=Re(this,Ep))==null||n.call(this),Ft(this,Ep,void 0),(l=Re(this,Mp))==null||l.call(this),Ft(this,Mp,void 0))}isFetching(n){return Re(this,cr).findAll({...n,fetchStatus:"fetching"}).length}isMutating(n){return Re(this,Sh).findAll({...n,status:"pending"}).length}getQueryData(n){var h;const l=this.defaultQueryOptions({queryKey:n});return(h=Re(this,cr).get(l.queryHash))==null?void 0:h.state.data}ensureQueryData(n){const l=this.defaultQueryOptions(n),h=Re(this,cr).build(this,l),m=h.state.data;return m===void 0?this.fetchQuery(n):(n.revalidateIfStale&&h.isStaleByTime(lh(l.staleTime,h))&&this.prefetchQuery(l),Promise.resolve(m))}getQueriesData(n){return Re(this,cr).findAll(n).map(({queryKey:l,state:h})=>{const m=h.data;return[l,m]})}setQueryData(n,l,h){const m=this.defaultQueryOptions({queryKey:n}),w=Re(this,cr).get(m.queryHash),E=w==null?void 0:w.state.data,C=xx(l,E);if(C!==void 0)return Re(this,cr).build(this,m).setData(C,{...h,manual:!0})}setQueriesData(n,l,h){return oa.batch(()=>Re(this,cr).findAll(n).map(({queryKey:m})=>[m,this.setQueryData(m,l,h)]))}getQueryState(n){var h;const l=this.defaultQueryOptions({queryKey:n});return(h=Re(this,cr).get(l.queryHash))==null?void 0:h.state}removeQueries(n){const l=Re(this,cr);oa.batch(()=>{l.findAll(n).forEach(h=>{l.remove(h)})})}resetQueries(n,l){const h=Re(this,cr);return oa.batch(()=>(h.findAll(n).forEach(m=>{m.reset()}),this.refetchQueries({type:"active",...n},l)))}cancelQueries(n,l={}){const h={revert:!0,...l},m=oa.batch(()=>Re(this,cr).findAll(n).map(w=>w.cancel(h)));return Promise.all(m).then(bs).catch(bs)}invalidateQueries(n,l={}){return oa.batch(()=>(Re(this,cr).findAll(n).forEach(h=>{h.invalidate()}),(n==null?void 0:n.refetchType)==="none"?Promise.resolve():this.refetchQueries({...n,type:(n==null?void 0:n.refetchType)??(n==null?void 0:n.type)??"active"},l)))}refetchQueries(n,l={}){const h={...l,cancelRefetch:l.cancelRefetch??!0},m=oa.batch(()=>Re(this,cr).findAll(n).filter(w=>!w.isDisabled()&&!w.isStatic()).map(w=>{let E=w.fetch(void 0,h);return h.throwOnError||(E=E.catch(bs)),w.state.fetchStatus==="paused"?Promise.resolve():E}));return Promise.all(m).then(bs)}fetchQuery(n){const l=this.defaultQueryOptions(n);l.retry===void 0&&(l.retry=!1);const h=Re(this,cr).build(this,l);return h.isStaleByTime(lh(l.staleTime,h))?h.fetch(l):Promise.resolve(h.state.data)}prefetchQuery(n){return this.fetchQuery(n).then(bs).catch(bs)}fetchInfiniteQuery(n){return n.behavior=H_(n.pages),this.fetchQuery(n)}prefetchInfiniteQuery(n){return this.fetchInfiniteQuery(n).then(bs).catch(bs)}ensureInfiniteQueryData(n){return n.behavior=H_(n.pages),this.ensureQueryData(n)}resumePausedMutations(){return gg.isOnline()?Re(this,Sh).resumePausedMutations():Promise.resolve()}getQueryCache(){return Re(this,cr)}getMutationCache(){return Re(this,Sh)}getDefaultOptions(){return Re(this,Ch)}setDefaultOptions(n){Ft(this,Ch,n)}setQueryDefaults(n,l){Re(this,Cp).set(E1(n),{queryKey:n,defaultOptions:l})}getQueryDefaults(n){const l=[...Re(this,Cp).values()],h={};return l.forEach(m=>{M1(n,m.queryKey)&&Object.assign(h,m.defaultOptions)}),h}setMutationDefaults(n,l){Re(this,Tp).set(E1(n),{mutationKey:n,defaultOptions:l})}getMutationDefaults(n){const l=[...Re(this,Tp).values()],h={};return l.forEach(m=>{M1(n,m.mutationKey)&&Object.assign(h,m.defaultOptions)}),h}defaultQueryOptions(n){if(n._defaulted)return n;const l={...Re(this,Ch).queries,...this.getQueryDefaults(n.queryKey),...n,_defaulted:!0};return l.queryHash||(l.queryHash=f2(l.queryKey,l)),l.refetchOnReconnect===void 0&&(l.refetchOnReconnect=l.networkMode!=="always"),l.throwOnError===void 0&&(l.throwOnError=!!l.suspense),!l.networkMode&&l.persister&&(l.networkMode="offlineFirst"),l.queryFn===y2&&(l.enabled=!1),l}defaultMutationOptions(n){return n!=null&&n._defaulted?n:{...Re(this,Ch).mutations,...(n==null?void 0:n.mutationKey)&&this.getMutationDefaults(n.mutationKey),...n,_defaulted:!0}}clear(){Re(this,cr).clear(),Re(this,Sh).clear()}},cr=new WeakMap,Sh=new WeakMap,Ch=new WeakMap,Cp=new WeakMap,Tp=new WeakMap,Th=new WeakMap,Ep=new WeakMap,Mp=new WeakMap,nx),Y_=te.createContext(void 0),S2=n=>{const l=te.useContext(Y_);if(!l)throw new Error("No QueryClient set, use QueryClientProvider to set one");return l},$x=({client:n,children:l})=>(te.useEffect(()=>(n.mount(),()=>{n.unmount()}),[n]),gt.jsx(Y_.Provider,{value:n,children:l})),Q_=te.createContext(!1),Vx=()=>te.useContext(Q_);Q_.Provider;function jx(){let n=!1;return{clearReset:()=>{n=!1},reset:()=>{n=!0},isReset:()=>n}}var Zx=te.createContext(jx()),Gx=()=>te.useContext(Zx),qx=(n,l)=>{(n.suspense||n.throwOnError||n.experimental_prefetchInRender)&&(l.isReset()||(n.retryOnMount=!1))},Hx=n=>{te.useEffect(()=>{n.clearReset()},[n])},Xx=({result:n,errorResetBoundary:l,throwOnError:h,query:m,suspense:w})=>n.isError&&!l.isReset()&&!n.isFetching&&m&&(w&&n.data===void 0||Tx(h,[n.error,m])),Yx=n=>{if(n.suspense){const h=w=>w==="static"?w:Math.max(w??1e3,1e3),m=n.staleTime;n.staleTime=typeof m=="function"?(...w)=>h(m(...w)):h(m),typeof n.gcTime=="number"&&(n.gcTime=Math.max(n.gcTime,1e3))}},Qx=(n,l)=>n.isLoading&&n.isFetching&&!l,Wx=(n,l)=>(n==null?void 0:n.suspense)&&l.isPending,W_=(n,l,h)=>l.fetchOptimistic(n).catch(()=>{h.clearReset()});function Kx(n,l,h){var X,Y,U,oe,ge;const m=Vx(),w=Gx(),E=S2(),C=E.defaultQueryOptions(n);(Y=(X=E.getDefaultOptions().queries)==null?void 0:X._experimental_beforeQuery)==null||Y.call(X,C),C._optimisticResults=m?"isRestoring":"optimistic",Yx(C),qx(C,w),Hx(w);const c=!E.getQueryCache().get(C.queryHash),[D]=te.useState(()=>new l(E,C)),B=D.getOptimisticResult(C),Z=!m&&n.subscribed!==!1;if(te.useSyncExternalStore(te.useCallback(ye=>{const Se=Z?D.subscribe(oa.batchCalls(ye)):bs;return D.updateResult(),Se},[D,Z]),()=>D.getCurrentResult(),()=>D.getCurrentResult()),te.useEffect(()=>{D.setOptions(C)},[C,D]),Wx(C,B))throw W_(C,D,w);if(Xx({result:B,errorResetBoundary:w,throwOnError:C.throwOnError,query:E.getQueryCache().get(C.queryHash),suspense:C.suspense}))throw B.error;if((oe=(U=E.getDefaultOptions().queries)==null?void 0:U._experimental_afterQuery)==null||oe.call(U,C,B),C.experimental_prefetchInRender&&!yd&&Qx(B,m)){const ye=c?W_(C,D,w):(ge=E.getQueryCache().get(C.queryHash))==null?void 0:ge.promise;ye==null||ye.catch(bs).finally(()=>{D.updateResult()})}return C.notifyOnChangeProps?B:D.trackResult(B)}function Jx(n,l){return Kx(n,Ix)}const K_=te.createContext(void 0),eb=n=>({setHttpHandler(l){n.httpHandler=l},httpHandler(){return n.httpHandler},updateHttpClientConfig(l,h){var m;(m=n.httpHandler)==null||m.updateHttpClientConfig(l,h)},httpHandlerConfigs(){return n.httpHandler.httpHandlerConfigs()}}),tb=n=>({httpHandler:n.httpHandler()});var A1;(function(n){n.HTTP="http",n.HTTPS="https"})(A1||(A1={}));var _g;(function(n){n.MD5="md5",n.CRC32="crc32",n.CRC32C="crc32c",n.SHA1="sha1",n.SHA256="sha256"})(_g||(_g={}));const C2="__smithy_context";class To{constructor(l){st(this,"method");st(this,"protocol");st(this,"hostname");st(this,"port");st(this,"path");st(this,"query");st(this,"headers");st(this,"username");st(this,"password");st(this,"fragment");st(this,"body");this.method=l.method||"GET",this.hostname=l.hostname||"localhost",this.port=l.port,this.query=l.query||{},this.headers=l.headers||{},this.body=l.body,this.protocol=l.protocol?l.protocol.slice(-1)!==":"?`${l.protocol}:`:l.protocol:"https:",this.path=l.path?l.path.charAt(0)!=="/"?`/${l.path}`:l.path:"/",this.username=l.username,this.password=l.password,this.fragment=l.fragment}static clone(l){const h=new To({...l,headers:{...l.headers}});return h.query&&(h.query=nb(h.query)),h}static isInstance(l){if(!l)return!1;const h=l;return"method"in h&&"protocol"in h&&"hostname"in h&&"path"in h&&typeof h.query=="object"&&typeof h.headers=="object"}clone(){return To.clone(this)}}function nb(n){return Object.keys(n).reduce((l,h)=>{const m=n[h];return{...l,[h]:Array.isArray(m)?[...m]:m}},{})}class L1{constructor(l){st(this,"statusCode");st(this,"reason");st(this,"headers");st(this,"body");this.statusCode=l.statusCode,this.reason=l.reason,this.headers=l.headers||{},this.body=l.body}static isInstance(l){if(!l)return!1;const h=l;return typeof h.statusCode=="number"&&typeof h.headers=="object"}}function aA(n){return n}const ib=n=>l=>async h=>{if(!To.isInstance(h.request))return l(h);const{request:m}=h,{handlerProtocol:w=""}=n.requestHandler.metadata||{};if(w.indexOf("h2")>=0&&!m.headers[":authority"])delete m.headers.host,m.headers[":authority"]=m.hostname+(m.port?":"+m.port:"");else if(!m.headers.host){let E=m.hostname;m.port!=null&&(E+=`:${m.port}`),m.headers.host=E}return l(h)},rb={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},ab=n=>({applyToStack:l=>{l.add(ib(n),rb)}}),sb=()=>(n,l)=>async h=>{var m,w;try{const E=await n(h),{clientName:C,commandName:c,logger:D,dynamoDbDocumentClientOptions:B={}}=l,{overrideInputFilterSensitiveLog:Z,overrideOutputFilterSensitiveLog:X}=B,Y=Z??l.inputFilterSensitiveLog,U=X??l.outputFilterSensitiveLog,{$metadata:oe,...ge}=E.output;return(m=D==null?void 0:D.info)==null||m.call(D,{clientName:C,commandName:c,input:Y(h.input),output:U(ge),metadata:oe}),E}catch(E){const{clientName:C,commandName:c,logger:D,dynamoDbDocumentClientOptions:B={}}=l,{overrideInputFilterSensitiveLog:Z}=B,X=Z??l.inputFilterSensitiveLog;throw(w=D==null?void 0:D.error)==null||w.call(D,{clientName:C,commandName:c,input:X(h.input),error:E,metadata:E.$metadata}),E}},ob={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},lb=n=>({applyToStack:l=>{l.add(sb(),ob)}}),cb={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},ub=()=>n=>async l=>n(l),hb=n=>({applyToStack:l=>{l.add(ub(),cb)}}),vg=n=>n[C2]||(n[C2]={}),nu=n=>{if(typeof n=="function")return n;const l=Promise.resolve(n);return()=>l},db=(n,l)=>{if(!l||l.length===0)return n;const h=[];for(const m of l)for(const w of n)w.schemeId.split("#")[1]===m&&h.push(w);for(const m of n)h.find(({schemeId:w})=>w===m.schemeId)||h.push(m);return h};function fb(n){const l=new Map;for(const h of n)l.set(h.schemeId,h);return l}const pb=(n,l)=>(h,m)=>async w=>{var X;const E=n.httpAuthSchemeProvider(await l.httpAuthSchemeParametersProvider(n,m,w.input)),C=n.authSchemePreference?await n.authSchemePreference():[],c=db(E,C),D=fb(n.httpAuthSchemes),B=vg(m),Z=[];for(const Y of c){const U=D.get(Y.schemeId);if(!U){Z.push(`HttpAuthScheme \`${Y.schemeId}\` was not enabled for this service.`);continue}const oe=U.identityProvider(await l.identityProviderConfigProvider(n));if(!oe){Z.push(`HttpAuthScheme \`${Y.schemeId}\` did not have an IdentityProvider configured.`);continue}const{identityProperties:ge={},signingProperties:ye={}}=((X=Y.propertiesExtractor)==null?void 0:X.call(Y,n,m))||{};Y.identityProperties=Object.assign(Y.identityProperties||{},ge),Y.signingProperties=Object.assign(Y.signingProperties||{},ye),B.selectedHttpAuthScheme={httpAuthOption:Y,identity:await oe(Y.identityProperties),signer:U.signer};break}if(!B.selectedHttpAuthScheme)throw new Error(Z.join(`
50
+ `));return h(w)},mb={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"},gb=(n,{httpAuthSchemeParametersProvider:l,identityProviderConfigProvider:h})=>({applyToStack:m=>{m.addRelativeTo(pb(n,{httpAuthSchemeParametersProvider:l,identityProviderConfigProvider:h}),mb)}}),yb=(n,l)=>(h,m)=>async w=>{var C,c,D,B;const{response:E}=await h(w);try{const Z=await l(E,n);return{response:E,output:Z}}catch(Z){if(Object.defineProperty(Z,"$response",{value:E}),!("$metadata"in Z)){const X="Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.";try{Z.message+=`
51
+ `+X}catch{!m.logger||((c=(C=m.logger)==null?void 0:C.constructor)==null?void 0:c.name)==="NoOpLogger"?console.warn(X):(B=(D=m.logger)==null?void 0:D.warn)==null||B.call(D,X)}typeof Z.$responseBodyText<"u"&&Z.$response&&(Z.$response.body=Z.$responseBodyText);try{if(L1.isInstance(E)){const{headers:Y={}}=E,U=Object.entries(Y);Z.$metadata={httpStatusCode:E.statusCode,requestId:T2(/^x-[\w-]+-request-?id$/,U),extendedRequestId:T2(/^x-[\w-]+-id-2$/,U),cfId:T2(/^x-[\w-]+-cf-id$/,U)}}}catch{}}throw Z}},T2=(n,l)=>(l.find(([h])=>h.match(n))||[void 0,void 0])[1],_b=(n,l)=>(h,m)=>async w=>{var D;const E=n,C=(D=m.endpointV2)!=null&&D.url&&E.urlParser?async()=>E.urlParser(m.endpointV2.url):E.endpoint;if(!C)throw new Error("No valid endpoint provider available.");const c=await l(w.input,{...n,endpoint:C});return h({...w,request:c})},vb={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},J_={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function xg(n,l,h){return{applyToStack:m=>{m.add(yb(n,h),vb),m.add(_b(n,l),J_)}}}const xb=n=>l=>{throw l},bb=(n,l)=>{},wb=n=>(l,h)=>async m=>{if(!To.isInstance(m.request))return l(m);const E=vg(h).selectedHttpAuthScheme;if(!E)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:C={}},identity:c,signer:D}=E,B=await l({...m,request:await D.sign(m.request,c,C)}).catch((D.errorHandler||xb)(C));return(D.successHandler||bb)(B.response,C),B},Sb={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:"retryMiddleware"},Cb=n=>({applyToStack:l=>{l.addRelativeTo(wb(),Sb)}}),P1=n=>{if(typeof n=="function")return n;const l=Promise.resolve(n);return()=>l},ev="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",tv=Object.entries(ev).reduce((n,[l,h])=>(n[h]=Number(l),n),{}),Tb=ev.split(""),Wf=6,R1=8,Eb=63,E2=n=>{let l=n.length/4*3;n.slice(-2)==="=="?l-=2:n.slice(-1)==="="&&l--;const h=new ArrayBuffer(l),m=new DataView(h);for(let w=0;w<n.length;w+=4){let E=0,C=0;for(let B=w,Z=w+3;B<=Z;B++)if(n[B]!=="="){if(!(n[B]in tv))throw new TypeError(`Invalid character ${n[B]} in base64 string.`);E|=tv[n[B]]<<(Z-B)*Wf,C+=Wf}else E>>=Wf;const c=w/4*3;E>>=C%R1;const D=Math.floor(C/R1);for(let B=0;B<D;B++){const Z=(D-B-1)*R1;m.setUint8(c+B,(E&255<<Z)>>Z)}}return new Uint8Array(h)},Kf=n=>new TextEncoder().encode(n),I1=n=>typeof n=="string"?Kf(n):ArrayBuffer.isView(n)?new Uint8Array(n.buffer,n.byteOffset,n.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(n),M2=n=>{if(typeof n=="string")return n;if(typeof n!="object"||typeof n.byteOffset!="number"||typeof n.byteLength!="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return new TextDecoder("utf-8").decode(n)};function nv(n){let l;typeof n=="string"?l=Kf(n):l=n;const h=typeof l=="object"&&typeof l.length=="number",m=typeof l=="object"&&typeof l.byteOffset=="number"&&typeof l.byteLength=="number";if(!h&&!m)throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");let w="";for(let E=0;E<l.length;E+=3){let C=0,c=0;for(let B=E,Z=Math.min(E+3,l.length);B<Z;B++)C|=l[B]<<(Z-B-1)*R1,c+=R1;const D=Math.ceil(c/Wf);C<<=D*Wf-c;for(let B=1;B<=D;B++){const Z=(D-B)*Wf;w+=Tb[(C&Eb<<Z)>>Z]}w+="==".slice(0,4-D)}return w}class _d extends Uint8Array{static fromString(l,h="utf-8"){if(typeof l=="string")return h==="base64"?_d.mutate(E2(l)):_d.mutate(Kf(l));throw new Error(`Unsupported conversion from ${typeof l} to Uint8ArrayBlobAdapter.`)}static mutate(l){return Object.setPrototypeOf(l,_d.prototype),l}transformToString(l="utf-8"){return l==="base64"?nv(this):M2(this)}}const vd=n=>encodeURIComponent(n).replace(/[!'()*]/g,Mb),Mb=n=>`%${n.charCodeAt(0).toString(16).toUpperCase()}`;function Ab(n){const l=[];for(let h of Object.keys(n).sort()){const m=n[h];if(h=vd(h),Array.isArray(m))for(let w=0,E=m.length;w<E;w++)l.push(`${h}=${vd(m[w])}`);else{let w=h;(m||typeof m=="string")&&(w+=`=${vd(m)}`),l.push(w)}}return l.join("&")}function iv(n,l){return new Request(n,l)}function Lb(n=0){return new Promise((l,h)=>{n&&setTimeout(()=>{const m=new Error(`Request did not complete within ${n} ms`);m.name="TimeoutError",h(m)},n)})}const A2={supported:void 0};class L2{constructor(l){st(this,"config");st(this,"configProvider");typeof l=="function"?this.configProvider=l().then(h=>h||{}):(this.config=l??{},this.configProvider=Promise.resolve(this.config)),A2.supported===void 0&&(A2.supported=typeof Request<"u"&&"keepalive"in iv("https://[::1]"))}static create(l){return typeof(l==null?void 0:l.handle)=="function"?l:new L2(l)}destroy(){}async handle(l,{abortSignal:h,requestTimeout:m}={}){var je;this.config||(this.config=await this.configProvider);const w=m??this.config.requestTimeout,E=this.config.keepAlive===!0,C=this.config.credentials;if(h!=null&&h.aborted){const Pe=new Error("Request aborted");return Pe.name="AbortError",Promise.reject(Pe)}let c=l.path;const D=Ab(l.query||{});D&&(c+=`?${D}`),l.fragment&&(c+=`#${l.fragment}`);let B="";if(l.username!=null||l.password!=null){const Pe=l.username??"",Oe=l.password??"";B=`${Pe}:${Oe}@`}const{port:Z,method:X}=l,Y=`${l.protocol}//${B}${l.hostname}${Z?`:${Z}`:""}${c}`,U=X==="GET"||X==="HEAD"?void 0:l.body,oe={body:U,headers:new Headers(l.headers),method:X,credentials:C};(je=this.config)!=null&&je.cache&&(oe.cache=this.config.cache),U&&(oe.duplex="half"),typeof AbortController<"u"&&(oe.signal=h),A2.supported&&(oe.keepalive=E),typeof this.config.requestInit=="function"&&Object.assign(oe,this.config.requestInit(l));let ge=()=>{};const ye=iv(Y,oe),Se=[fetch(ye).then(Pe=>{const Oe=Pe.headers,Je={};for(const ot of Oe.entries())Je[ot[0]]=ot[1];return Pe.body!=null?{response:new L1({headers:Je,reason:Pe.statusText,statusCode:Pe.status,body:Pe.body})}:Pe.blob().then(ot=>({response:new L1({headers:Je,reason:Pe.statusText,statusCode:Pe.status,body:ot})}))}),Lb(w)];return h&&Se.push(new Promise((Pe,Oe)=>{const Je=()=>{const et=new Error("Request aborted");et.name="AbortError",Oe(et)};if(typeof h.addEventListener=="function"){const et=h;et.addEventListener("abort",Je,{once:!0}),ge=()=>et.removeEventListener("abort",Je)}else h.onabort=Je})),Promise.race(Se).finally(ge)}updateHttpClientConfig(l,h){this.config=void 0,this.configProvider=this.configProvider.then(m=>(m[l]=h,m))}httpHandlerConfigs(){return this.config??{}}}const Pb=async n=>{var l;return typeof Blob=="function"&&n instanceof Blob||((l=n.constructor)==null?void 0:l.name)==="Blob"?Blob.prototype.arrayBuffer!==void 0?new Uint8Array(await n.arrayBuffer()):Rb(n):Ib(n)};async function Rb(n){const l=await zb(n),h=E2(l);return new Uint8Array(h)}async function Ib(n){const l=[],h=n.getReader();let m=!1,w=0;for(;!m;){const{done:c,value:D}=await h.read();D&&(l.push(D),w+=D.length),m=c}const E=new Uint8Array(w);let C=0;for(const c of l)E.set(c,C),C+=c.length;return E}function zb(n){return new Promise((l,h)=>{const m=new FileReader;m.onloadend=()=>{if(m.readyState!==2)return h(new Error("Reader aborted too early"));const w=m.result??"",E=w.indexOf(","),C=E>-1?E+1:w.length;l(w.substring(C))},m.onabort=()=>h(new Error("Read aborted")),m.onerror=()=>h(m.error),m.readAsDataURL(n)})}const rv={},P2={};for(let n=0;n<256;n++){let l=n.toString(16).toLowerCase();l.length===1&&(l=`0${l}`),rv[n]=l,P2[l]=n}function Db(n){if(n.length%2!==0)throw new Error("Hex encoded strings must have an even number length");const l=new Uint8Array(n.length/2);for(let h=0;h<n.length;h+=2){const m=n.slice(h,h+2).toLowerCase();if(m in P2)l[h/2]=P2[m];else throw new Error(`Cannot decode unrecognized sequence ${m} as hexadecimal`)}return l}function xd(n){let l="";for(let h=0;h<n.byteLength;h++)l+=rv[n[h]];return l}const Ob=async(n=new Uint8Array,l)=>{if(n instanceof Uint8Array)return _d.mutate(n);if(!n)return _d.mutate(new Uint8Array);const h=l.streamCollector(n);return _d.mutate(await h)};function av(n){return encodeURIComponent(n).replace(/[!'()*]/g,function(l){return"%"+l.charCodeAt(0).toString(16).toUpperCase()})}const R2=n=>typeof n=="function"?n():n;function bg(n){if(typeof n=="object")return n;n=n|0;const l={};let h=0;for(const m of["httpLabel","idempotent","idempotencyToken","sensitive","httpPayload","httpResponseCode","httpQueryParams"])(n>>h++&1)===1&&(l[m]=1);return l}const Eh=class Eh{constructor(l,h){st(this,"ref");st(this,"memberName");st(this,"symbol",Eh.symbol);st(this,"name");st(this,"schema");st(this,"_isMemberSchema");st(this,"traits");st(this,"memberTraits");st(this,"normalizedTraits");this.ref=l,this.memberName=h;const m=[];let w=l,E=l;for(this._isMemberSchema=!1;I2(w);)m.push(w[1]),w=w[0],E=R2(w),this._isMemberSchema=!0;if(m.length>0){this.memberTraits={};for(let C=m.length-1;C>=0;--C){const c=m[C];Object.assign(this.memberTraits,bg(c))}}else this.memberTraits=0;if(E instanceof Eh){const C=this.memberTraits;Object.assign(this,E),this.memberTraits=Object.assign({},C,E.getMemberTraits(),this.getMemberTraits()),this.normalizedTraits=void 0,this.memberName=h??E.memberName;return}if(this.schema=R2(E),kb(this.schema)?(this.name=`${this.schema[1]}#${this.schema[2]}`,this.traits=this.schema[3]):(this.name=this.memberName??String(E),this.traits=0),this._isMemberSchema&&!h)throw new Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(!0)} missing member name.`)}static[Symbol.hasInstance](l){const h=this.prototype.isPrototypeOf(l);return!h&&typeof l=="object"&&l!==null?l.symbol===this.symbol:h}static of(l){const h=R2(l);if(h instanceof Eh)return h;if(I2(h)){const[m,w]=h;if(m instanceof Eh)return Object.assign(m.getMergedTraits(),bg(w)),m;throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(l,null,2)}.`)}return new Eh(h)}getSchema(){const l=this.schema;return l[0]===0?l[4]:l}getName(l=!1){const{name:h}=this;return!l&&h&&h.includes("#")?h.split("#")[1]:h||void 0}getMemberName(){return this.memberName}isMemberSchema(){return this._isMemberSchema}isListSchema(){const l=this.getSchema();return typeof l=="number"?l>=64&&l<128:l[0]===1}isMapSchema(){const l=this.getSchema();return typeof l=="number"?l>=128&&l<=255:l[0]===2}isStructSchema(){const l=this.getSchema();return l[0]===3||l[0]===-3}isBlobSchema(){const l=this.getSchema();return l===21||l===42}isTimestampSchema(){const l=this.getSchema();return typeof l=="number"&&l>=4&&l<=7}isUnitSchema(){return this.getSchema()==="unit"}isDocumentSchema(){return this.getSchema()===15}isStringSchema(){return this.getSchema()===0}isBooleanSchema(){return this.getSchema()===2}isNumericSchema(){return this.getSchema()===1}isBigIntegerSchema(){return this.getSchema()===17}isBigDecimalSchema(){return this.getSchema()===19}isStreaming(){const{streaming:l}=this.getMergedTraits();return!!l||this.getSchema()===42}isIdempotencyToken(){const l=E=>(E&4)===4||!!(E!=null&&E.idempotencyToken),{normalizedTraits:h,traits:m,memberTraits:w}=this;return l(h)||l(m)||l(w)}getMergedTraits(){return this.normalizedTraits??(this.normalizedTraits={...this.getOwnTraits(),...this.getMemberTraits()})}getMemberTraits(){return bg(this.memberTraits)}getOwnTraits(){return bg(this.traits)}getKeySchema(){const[l,h]=[this.isDocumentSchema(),this.isMapSchema()];if(!l&&!h)throw new Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(!0)}`);const m=this.getSchema(),w=l?15:m[4]??0;return D1([w,0],"key")}getValueSchema(){const l=this.getSchema(),[h,m,w]=[this.isDocumentSchema(),this.isMapSchema(),this.isListSchema()],E=typeof l=="number"?63&l:l&&typeof l=="object"&&(m||w)?l[3+l[0]]:h?15:void 0;if(E!=null)return D1([E,0],m?"value":"member");throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no value member.`)}getMemberSchema(l){const h=this.getSchema();if(this.isStructSchema()&&h[4].includes(l)){const m=h[4].indexOf(l),w=h[5][m];return D1(I2(w)?w:[w,0],l)}if(this.isDocumentSchema())return D1([15,0],l);throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no no member=${l}.`)}getMemberSchemas(){const l={};try{for(const[h,m]of this.structIterator())l[h]=m}catch{}return l}getEventStreamMember(){if(this.isStructSchema()){for(const[l,h]of this.structIterator())if(h.isStreaming()&&h.isStructSchema())return l}return""}*structIterator(){if(this.isUnitSchema())return;if(!this.isStructSchema())throw new Error("@smithy/core/schema - cannot iterate non-struct schema.");const l=this.getSchema();for(let h=0;h<l[4].length;++h)yield[l[4][h],D1([l[5][h],0],l[4][h])]}};st(Eh,"symbol",Symbol.for("@smithy/nor"));let z1=Eh;function D1(n,l){if(n instanceof z1)return Object.assign(n,{memberName:l,_isMemberSchema:!0});const h=z1;return new h(n,l)}const I2=n=>Array.isArray(n)&&n.length===2,kb=n=>Array.isArray(n)&&n.length>=5,sv=n=>{if(n!=null){if(typeof n=="number"){if((n===0||n===1)&&Eg.warn(Tg(`Expected boolean, got ${typeof n}: ${n}`)),n===0)return!1;if(n===1)return!0}if(typeof n=="string"){const l=n.toLowerCase();if((l==="false"||l==="true")&&Eg.warn(Tg(`Expected boolean, got ${typeof n}: ${n}`)),l==="false")return!1;if(l==="true")return!0}if(typeof n=="boolean")return n;throw new TypeError(`Expected boolean, got ${typeof n}: ${n}`)}},Bb=n=>{if(n!=null){if(typeof n=="string"){const l=parseFloat(n);if(!Number.isNaN(l))return String(l)!==String(n)&&Eg.warn(Tg(`Expected number but observed string: ${n}`)),l}if(typeof n=="number")return n;throw new TypeError(`Expected number, got ${typeof n}: ${n}`)}},wg=n=>{if(n!=null){if(Number.isInteger(n)&&!Number.isNaN(n))return n;throw new TypeError(`Expected integer, got ${typeof n}: ${n}`)}},Sg=(n,l)=>{if(n==null)throw new TypeError(`Expected a non-null value for ${l}`);return n},Cg=n=>{if(n==null)return;if(typeof n=="object"&&!Array.isArray(n))return n;const l=Array.isArray(n)?"array":typeof n;throw new TypeError(`Expected object, got ${l}: ${n}`)},Fi=n=>{if(n!=null){if(typeof n=="string")return n;if(["boolean","number","bigint"].includes(typeof n))return Eg.warn(Tg(`Expected string, got ${typeof n}: ${n}`)),String(n);throw new TypeError(`Expected string, got ${typeof n}: ${n}`)}},ov=n=>typeof n=="string"?Fb(n):Bb(n),Fb=n=>{switch(n){case"NaN":return NaN;case"Infinity":return 1/0;case"-Infinity":return-1/0;default:throw new Error(`Unable to parse float value: ${n}`)}},Tg=n=>String(new TypeError(n).stack||n).split(`
52
+ `).slice(0,5).filter(l=>!l.includes("stackTraceWarning")).join(`
53
+ `),Eg={warn:console.warn},lv=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Ia=Array.from({length:256},(n,l)=>l.toString(16).padStart(2,"0")),Nb=()=>{if(lv)return lv();const n=new Uint8Array(16);return crypto.getRandomValues(n),n[6]=n[6]&15|64,n[8]=n[8]&63|128,Ia[n[0]]+Ia[n[1]]+Ia[n[2]]+Ia[n[3]]+"-"+Ia[n[4]]+Ia[n[5]]+"-"+Ia[n[6]]+Ia[n[7]]+"-"+Ia[n[8]]+Ia[n[9]]+"-"+Ia[n[10]]+Ia[n[11]]+Ia[n[12]]+Ia[n[13]]+Ia[n[14]]+Ia[n[15]]},Ub=(n,l,h,m,w,E)=>{if(l!=null&&l[h]!==void 0){const C=m();if(C.length<=0)throw new Error("Empty value provided for input HTTP label: "+h+".");n=n.replace(w,E?C.split("/").map(c=>av(c)).join("/"):av(C))}else throw new Error("No value provided for input HTTP label: "+h+".");return n};function Mg(n,l){return new $b(n,l)}class $b{constructor(l,h){st(this,"input");st(this,"context");st(this,"query",{});st(this,"method","");st(this,"headers",{});st(this,"path","");st(this,"body",null);st(this,"hostname","");st(this,"resolvePathStack",[]);this.input=l,this.context=h}async build(){const{hostname:l,protocol:h="https",port:m,path:w}=await this.context.endpoint();this.path=w;for(const E of this.resolvePathStack)E(this.path);return new To({protocol:h,hostname:this.hostname||l,port:m,method:this.method,path:this.path,query:this.query,body:this.body,headers:this.headers})}hn(l){return this.hostname=l,this}bp(l){return this.resolvePathStack.push(h=>{this.path=`${h!=null&&h.endsWith("/")?h.slice(0,-1):h||""}`+l}),this}p(l,h,m,w){return this.resolvePathStack.push(E=>{this.path=Ub(E,this.input,l,h,m,w)}),this}h(l){return this.headers=l,this}q(l){return this.query=l,this}b(l){return this.body=l,this}m(l){return this.method=l,this}}function Vb(n,l,h){n.__smithy_context?n.__smithy_context.features||(n.__smithy_context.features={}):n.__smithy_context={features:{}},n.__smithy_context.features[l]=h}class jb{constructor(l){st(this,"authSchemes",new Map);for(const[h,m]of Object.entries(l))m!==void 0&&this.authSchemes.set(h,m)}getIdentityProvider(l){return this.authSchemes.get(l)}}const Zb=(n=>function(h){return cv(h)&&h.expiration.getTime()-Date.now()<n})(3e5),cv=n=>n.expiration!==void 0,Gb=(n,l,h)=>{if(n===void 0)return;const m=typeof n!="function"?async()=>Promise.resolve(n):n;let w,E,C,c=!1;const D=async B=>{E||(E=m(B));try{w=await E,C=!0,c=!1}finally{E=void 0}return w};return l===void 0?async B=>((!C||B!=null&&B.forceRefresh)&&(w=await D(B)),w):async B=>((!C||B!=null&&B.forceRefresh)&&(w=await D(B)),c?w:h(w)?(l(w)&&await D(B),w):(c=!0,w))},qb=void 0;function Hb(n){return n===void 0?!0:typeof n=="string"&&n.length<=50}function Xb(n){const l=P1(n.userAgentAppId??qb),{customUserAgent:h}=n;return Object.assign(n,{customUserAgent:typeof h=="string"?[[h]]:h,userAgentAppId:async()=>{var w,E;const m=await l();if(!Hb(m)){const C=((E=(w=n.logger)==null?void 0:w.constructor)==null?void 0:E.name)==="NoOpLogger"||!n.logger?console:n.logger;typeof m!="string"?C==null||C.warn("userAgentAppId must be a string or undefined."):m.length>50&&(C==null||C.warn("The provided userAgentAppId exceeds the maximum length of 50 characters."))}return m}})}class Yb{constructor({size:l,params:h}){st(this,"capacity");st(this,"data",new Map);st(this,"parameters",[]);this.capacity=l??50,h&&(this.parameters=h)}get(l,h){const m=this.hash(l);if(m===!1)return h();if(!this.data.has(m)){if(this.data.size>this.capacity+10){const w=this.data.keys();let E=0;for(;;){const{value:C,done:c}=w.next();if(this.data.delete(C),c||++E>10)break}}this.data.set(m,h())}return this.data.get(m)}size(){return this.data.size}hash(l){let h="";const{parameters:m}=this;if(m.length===0)return!1;for(const w of m){const E=String(l[w]??"");if(E.includes("|;"))return!1;h+=E+"|;"}return h}}const Qb=new RegExp("^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$"),uv=n=>Qb.test(n)||n.startsWith("[")&&n.endsWith("]"),Wb=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),z2=(n,l=!1)=>{if(!l)return Wb.test(n);const h=n.split(".");for(const m of h)if(!z2(m))return!1;return!0},Ag={},O1="endpoints";function ch(n){return typeof n!="object"||n==null?n:"ref"in n?`$${ch(n.ref)}`:"fn"in n?`${n.fn}(${(n.argv||[]).map(ch).join(", ")})`:JSON.stringify(n,null,2)}class js extends Error{constructor(l){super(l),this.name="EndpointError"}}const Kb=(n,l)=>n===l,Jb=n=>{const l=n.split("."),h=[];for(const m of l){const w=m.indexOf("[");if(w!==-1){if(m.indexOf("]")!==m.length-1)throw new js(`Path: '${n}' does not end with ']'`);const E=m.slice(w+1,-1);if(Number.isNaN(parseInt(E)))throw new js(`Invalid array index: '${E}' in path: '${n}'`);w!==0&&h.push(m.slice(0,w)),h.push(E)}else h.push(m)}return h},hv=(n,l)=>Jb(l).reduce((h,m)=>{if(typeof h!="object")throw new js(`Index '${m}' in '${l}' not found in '${JSON.stringify(n)}'`);return Array.isArray(h)?h[parseInt(m)]:h[m]},n),e6=n=>n!=null,t6=n=>!n,D2={[A1.HTTP]:80,[A1.HTTPS]:443},n6={booleanEquals:Kb,getAttr:hv,isSet:e6,isValidHostLabel:z2,not:t6,parseURL:n=>{const l=(()=>{try{if(n instanceof URL)return n;if(typeof n=="object"&&"hostname"in n){const{hostname:Y,port:U,protocol:oe="",path:ge="",query:ye={}}=n,Se=new URL(`${oe}//${Y}${U?`:${U}`:""}${ge}`);return Se.search=Object.entries(ye).map(([je,Pe])=>`${je}=${Pe}`).join("&"),Se}return new URL(n)}catch{return null}})();if(!l)return console.error(`Unable to parse ${JSON.stringify(n)} as a whatwg URL.`),null;const h=l.href,{host:m,hostname:w,pathname:E,protocol:C,search:c}=l;if(c)return null;const D=C.slice(0,-1);if(!Object.values(A1).includes(D))return null;const B=uv(w),Z=h.includes(`${m}:${D2[D]}`)||typeof n=="string"&&n.includes(`${m}:${D2[D]}`),X=`${m}${Z?`:${D2[D]}`:""}`;return{scheme:D,authority:X,path:E,normalizedPath:E.endsWith("/")?E:`${E}/`,isIp:B}},stringEquals:(n,l)=>n===l,substring:(n,l,h,m)=>l>=h||n.length<h?null:m?n.substring(n.length-h,n.length-l):n.substring(l,h),uriEncode:n=>encodeURIComponent(n).replace(/[!*'()]/g,l=>`%${l.charCodeAt(0).toString(16).toUpperCase()}`)},dv=(n,l)=>{const h=[],m={...l.endpointParams,...l.referenceRecord};let w=0;for(;w<n.length;){const E=n.indexOf("{",w);if(E===-1){h.push(n.slice(w));break}h.push(n.slice(w,E));const C=n.indexOf("}",E);if(C===-1){h.push(n.slice(E));break}n[E+1]==="{"&&n[C+1]==="}"&&(h.push(n.slice(E+1,C)),w=C+2);const c=n.substring(E+1,C);if(c.includes("#")){const[D,B]=c.split("#");h.push(hv(m[D],B))}else h.push(m[c]);w=C+1}return h.join("")},i6=({ref:n},l)=>({...l.endpointParams,...l.referenceRecord})[n],Lg=(n,l,h)=>{if(typeof n=="string")return dv(n,h);if(n.fn)return pv.callFunction(n,h);if(n.ref)return i6(n,h);throw new js(`'${l}': ${String(n)} is not a string, function or reference.`)},fv=({fn:n,argv:l},h)=>{const m=l.map(E=>["boolean","number"].includes(typeof E)?E:pv.evaluateExpression(E,"arg",h)),w=n.split(".");return w[0]in Ag&&w[1]!=null?Ag[w[0]][w[1]](...m):n6[n](...m)},pv={evaluateExpression:Lg,callFunction:fv},r6=({assign:n,...l},h)=>{var w,E;if(n&&n in h.referenceRecord)throw new js(`'${n}' is already defined in Reference Record.`);const m=fv(l,h);return(E=(w=h.logger)==null?void 0:w.debug)==null||E.call(w,`${O1} evaluateCondition: ${ch(l)} = ${ch(m)}`),{result:m===""?!0:!!m,...n!=null&&{toAssign:{name:n,value:m}}}},O2=(n=[],l)=>{var m,w;const h={};for(const E of n){const{result:C,toAssign:c}=r6(E,{...l,referenceRecord:{...l.referenceRecord,...h}});if(!C)return{result:C};c&&(h[c.name]=c.value,(w=(m=l.logger)==null?void 0:m.debug)==null||w.call(m,`${O1} assign: ${c.name} := ${ch(c.value)}`))}return{result:!0,referenceRecord:h}},a6=(n,l)=>Object.entries(n).reduce((h,[m,w])=>({...h,[m]:w.map(E=>{const C=Lg(E,"Header value entry",l);if(typeof C!="string")throw new js(`Header '${m}' value '${C}' is not a string`);return C})}),{}),mv=(n,l)=>Object.entries(n).reduce((h,[m,w])=>({...h,[m]:yv.getEndpointProperty(w,l)}),{}),gv=(n,l)=>{if(Array.isArray(n))return n.map(h=>gv(h,l));switch(typeof n){case"string":return dv(n,l);case"object":if(n===null)throw new js(`Unexpected endpoint property: ${n}`);return yv.getEndpointProperties(n,l);case"boolean":return n;default:throw new js(`Unexpected endpoint property type: ${typeof n}`)}},yv={getEndpointProperty:gv,getEndpointProperties:mv},s6=(n,l)=>{const h=Lg(n,"Endpoint URL",l);if(typeof h=="string")try{return new URL(h)}catch(m){throw console.error(`Failed to construct URL with ${h}`,m),m}throw new js(`Endpoint URL must be a string, got ${typeof h}`)},o6=(n,l)=>{var Z,X;const{conditions:h,endpoint:m}=n,{result:w,referenceRecord:E}=O2(h,l);if(!w)return;const C={...l,referenceRecord:{...l.referenceRecord,...E}},{url:c,properties:D,headers:B}=m;return(X=(Z=l.logger)==null?void 0:Z.debug)==null||X.call(Z,`${O1} Resolving endpoint from template: ${ch(m)}`),{...B!=null&&{headers:a6(B,C)},...D!=null&&{properties:mv(D,C)},url:s6(c,C)}},l6=(n,l)=>{const{conditions:h,error:m}=n,{result:w,referenceRecord:E}=O2(h,l);if(w)throw new js(Lg(m,"Error",{...l,referenceRecord:{...l.referenceRecord,...E}}))},_v=(n,l)=>{for(const h of n)if(h.type==="endpoint"){const m=o6(h,l);if(m)return m}else if(h.type==="error")l6(h,l);else if(h.type==="tree"){const m=vv.evaluateTreeRule(h,l);if(m)return m}else throw new js(`Unknown endpoint rule: ${h}`);throw new js("Rules evaluation failed")},vv={evaluateRules:_v,evaluateTreeRule:(n,l)=>{const{conditions:h,rules:m}=n,{result:w,referenceRecord:E}=O2(h,l);if(w)return vv.evaluateRules(m,{...l,referenceRecord:{...l.referenceRecord,...E}})}},c6=(n,l)=>{var B,Z,X,Y;const{endpointParams:h,logger:m}=l,{parameters:w,rules:E}=n;(Z=(B=l.logger)==null?void 0:B.debug)==null||Z.call(B,`${O1} Initial EndpointParams: ${ch(h)}`);const C=Object.entries(w).filter(([,U])=>U.default!=null).map(([U,oe])=>[U,oe.default]);if(C.length>0)for(const[U,oe]of C)h[U]=h[U]??oe;const c=Object.entries(w).filter(([,U])=>U.required).map(([U])=>U);for(const U of c)if(h[U]==null)throw new js(`Missing required parameter: '${U}'`);const D=_v(E,{endpointParams:h,logger:m,referenceRecord:{}});return(Y=(X=l.logger)==null?void 0:X.debug)==null||Y.call(X,`${O1} Resolved endpoint: ${ch(D)}`),D},xv=(n,l=!1)=>{if(l){for(const h of n.split("."))if(!xv(h))return!1;return!0}return!(!z2(n)||n.length<3||n.length>63||n!==n.toLowerCase()||uv(n))},bv=":",u6="/",h6=n=>{const l=n.split(bv);if(l.length<6)return null;const[h,m,w,E,C,...c]=l;if(h!=="arn"||m===""||w===""||c.join(bv)==="")return null;const D=c.map(B=>B.split(u6)).flat();return{partition:m,service:w,region:E,accountId:C,resourceId:D}};let d6={partitions:[{id:"aws",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-east-1",name:"aws",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",regions:{"af-south-1":{description:"Africa (Cape Town)"},"ap-east-1":{description:"Asia Pacific (Hong Kong)"},"ap-east-2":{description:"Asia Pacific (Taipei)"},"ap-northeast-1":{description:"Asia Pacific (Tokyo)"},"ap-northeast-2":{description:"Asia Pacific (Seoul)"},"ap-northeast-3":{description:"Asia Pacific (Osaka)"},"ap-south-1":{description:"Asia Pacific (Mumbai)"},"ap-south-2":{description:"Asia Pacific (Hyderabad)"},"ap-southeast-1":{description:"Asia Pacific (Singapore)"},"ap-southeast-2":{description:"Asia Pacific (Sydney)"},"ap-southeast-3":{description:"Asia Pacific (Jakarta)"},"ap-southeast-4":{description:"Asia Pacific (Melbourne)"},"ap-southeast-5":{description:"Asia Pacific (Malaysia)"},"ap-southeast-6":{description:"Asia Pacific (New Zealand)"},"ap-southeast-7":{description:"Asia Pacific (Thailand)"},"aws-global":{description:"aws global region"},"ca-central-1":{description:"Canada (Central)"},"ca-west-1":{description:"Canada West (Calgary)"},"eu-central-1":{description:"Europe (Frankfurt)"},"eu-central-2":{description:"Europe (Zurich)"},"eu-north-1":{description:"Europe (Stockholm)"},"eu-south-1":{description:"Europe (Milan)"},"eu-south-2":{description:"Europe (Spain)"},"eu-west-1":{description:"Europe (Ireland)"},"eu-west-2":{description:"Europe (London)"},"eu-west-3":{description:"Europe (Paris)"},"il-central-1":{description:"Israel (Tel Aviv)"},"me-central-1":{description:"Middle East (UAE)"},"me-south-1":{description:"Middle East (Bahrain)"},"mx-central-1":{description:"Mexico (Central)"},"sa-east-1":{description:"South America (Sao Paulo)"},"us-east-1":{description:"US East (N. Virginia)"},"us-east-2":{description:"US East (Ohio)"},"us-west-1":{description:"US West (N. California)"},"us-west-2":{description:"US West (Oregon)"}}},{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn",dualStackDnsSuffix:"api.amazonwebservices.com.cn",implicitGlobalRegion:"cn-northwest-1",name:"aws-cn",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:{"aws-cn-global":{description:"aws-cn global region"},"cn-north-1":{description:"China (Beijing)"},"cn-northwest-1":{description:"China (Ningxia)"}}},{id:"aws-eusc",outputs:{dnsSuffix:"amazonaws.eu",dualStackDnsSuffix:"api.amazonwebservices.eu",implicitGlobalRegion:"eusc-de-east-1",name:"aws-eusc",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eusc\\-(de)\\-\\w+\\-\\d+$",regions:{"eusc-de-east-1":{description:"EU (Germany)"}}},{id:"aws-iso",outputs:{dnsSuffix:"c2s.ic.gov",dualStackDnsSuffix:"api.aws.ic.gov",implicitGlobalRegion:"us-iso-east-1",name:"aws-iso",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",regions:{"aws-iso-global":{description:"aws-iso global region"},"us-iso-east-1":{description:"US ISO East"},"us-iso-west-1":{description:"US ISO WEST"}}},{id:"aws-iso-b",outputs:{dnsSuffix:"sc2s.sgov.gov",dualStackDnsSuffix:"api.aws.scloud",implicitGlobalRegion:"us-isob-east-1",name:"aws-iso-b",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",regions:{"aws-iso-b-global":{description:"aws-iso-b global region"},"us-isob-east-1":{description:"US ISOB East (Ohio)"}}},{id:"aws-iso-e",outputs:{dnsSuffix:"cloud.adc-e.uk",dualStackDnsSuffix:"api.cloud-aws.adc-e.uk",implicitGlobalRegion:"eu-isoe-west-1",name:"aws-iso-e",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eu\\-isoe\\-\\w+\\-\\d+$",regions:{"aws-iso-e-global":{description:"aws-iso-e global region"},"eu-isoe-west-1":{description:"EU ISOE West"}}},{id:"aws-iso-f",outputs:{dnsSuffix:"csp.hci.ic.gov",dualStackDnsSuffix:"api.aws.hci.ic.gov",implicitGlobalRegion:"us-isof-south-1",name:"aws-iso-f",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isof\\-\\w+\\-\\d+$",regions:{"aws-iso-f-global":{description:"aws-iso-f global region"},"us-isof-east-1":{description:"US ISOF EAST"},"us-isof-south-1":{description:"US ISOF SOUTH"}}},{id:"aws-us-gov",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-gov-west-1",name:"aws-us-gov",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-gov\\-\\w+\\-\\d+$",regions:{"aws-us-gov-global":{description:"aws-us-gov global region"},"us-gov-east-1":{description:"AWS GovCloud (US-East)"},"us-gov-west-1":{description:"AWS GovCloud (US-West)"}}}]};const wv={isVirtualHostableS3Bucket:xv,parseArn:h6,partition:n=>{const{partitions:l}=d6;for(const m of l){const{regions:w,outputs:E}=m;for(const[C,c]of Object.entries(w))if(C===n)return{...E,...c}}for(const m of l){const{regionRegex:w,outputs:E}=m;if(new RegExp(w).test(n))return{...E}}const h=l.find(m=>m.id==="aws");if(!h)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...h.outputs}}};Ag.aws=wv;function f6(n){const l={};if(n=n.replace(/^\?/,""),n)for(const h of n.split("&")){let[m,w=null]=h.split("=");m=decodeURIComponent(m),w&&(w=decodeURIComponent(w)),m in l?Array.isArray(l[m])?l[m].push(w):l[m]=[l[m],w]:l[m]=w}return l}const Pg=n=>{if(typeof n=="string")return Pg(new URL(n));const{hostname:l,pathname:h,port:m,protocol:w,search:E}=n;let C;return E&&(C=f6(E)),{hostname:l,port:m?parseInt(m):void 0,protocol:w,path:h,query:C}};function p6(n,l,h){return n.$source||(n.$source={}),n.$source[l]=h,n}function sc(n,l,h){n.__aws_sdk_context?n.__aws_sdk_context.features||(n.__aws_sdk_context.features={}):n.__aws_sdk_context={features:{}},n.__aws_sdk_context.features[l]=h}const Sv=n=>{var l,h;return L1.isInstance(n)?((l=n.headers)==null?void 0:l.date)??((h=n.headers)==null?void 0:h.Date):void 0},Cv=n=>new Date(Date.now()+n),m6=(n,l)=>Math.abs(Cv(l).getTime()-n)>=3e5,Tv=(n,l)=>{const h=Date.parse(n);return m6(h,l)?h-Date.now():l},k1=(n,l)=>{if(!l)throw new Error(`Property \`${n}\` is not resolved for AWS SDK SigV4Auth`);return l},g6=async n=>{var B,Z,X;const l=k1("context",n.context),h=k1("config",n.config),m=(X=(Z=(B=l.endpointV2)==null?void 0:B.properties)==null?void 0:Z.authSchemes)==null?void 0:X[0],E=await k1("signer",h.signer)(m),C=n==null?void 0:n.signingRegion,c=n==null?void 0:n.signingRegionSet,D=n==null?void 0:n.signingName;return{config:h,signer:E,signingRegion:C,signingRegionSet:c,signingName:D}};class y6{async sign(l,h,m){var X;if(!To.isInstance(l))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const w=await g6(m),{config:E,signer:C}=w;let{signingRegion:c,signingName:D}=w;const B=m.context;if(((X=B==null?void 0:B.authSchemes)==null?void 0:X.length)??!1){const[Y,U]=B.authSchemes;(Y==null?void 0:Y.name)==="sigv4a"&&(U==null?void 0:U.name)==="sigv4"&&(c=(U==null?void 0:U.signingRegion)??c,D=(U==null?void 0:U.signingName)??D)}return await C.sign(l,{signingDate:Cv(E.systemClockOffset),signingRegion:c,signingService:D})}errorHandler(l){return h=>{const m=h.ServerTime??Sv(h.$response);if(m){const w=k1("config",l.config),E=w.systemClockOffset;w.systemClockOffset=Tv(m,w.systemClockOffset),w.systemClockOffset!==E&&h.$metadata&&(h.$metadata.clockSkewCorrected=!0)}throw h}}successHandler(l,h){const m=Sv(l);if(m){const w=k1("config",h.config);w.systemClockOffset=Tv(m,w.systemClockOffset)}}}const _6=(n,l,h)=>{let m,w,E,C=!1;const c=async()=>{w||(w=n());try{m=await w,E=!0,C=!1}finally{w=void 0}return m};return async D=>((!E||D!=null&&D.forceRefresh)&&(m=await c()),m)},v6="X-Amz-Algorithm",x6="X-Amz-Credential",Ev="X-Amz-Date",b6="X-Amz-SignedHeaders",w6="X-Amz-Expires",Mv="X-Amz-Signature",Av="X-Amz-Security-Token",Lv="authorization",Pv=Ev.toLowerCase(),S6=[Lv,Pv,"date"],C6=Mv.toLowerCase(),k2="x-amz-content-sha256",T6=Av.toLowerCase(),E6={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},M6=/^proxy-/,A6=/^sec-/,B2="AWS4-HMAC-SHA256",L6="AWS4-HMAC-SHA256-PAYLOAD",P6="UNSIGNED-PAYLOAD",R6=50,Rv="aws4_request",I6=3600*24*7,Rg={},F2=[],N2=(n,l,h)=>`${n}/${l}/${h}/${Rv}`,z6=async(n,l,h,m,w)=>{const E=await Iv(n,l.secretAccessKey,l.accessKeyId),C=`${h}:${m}:${w}:${xd(E)}:${l.sessionToken}`;if(C in Rg)return Rg[C];for(F2.push(C);F2.length>R6;)delete Rg[F2.shift()];let c=`AWS4${l.secretAccessKey}`;for(const D of[h,m,w,Rv])c=await Iv(n,c,D);return Rg[C]=c},Iv=(n,l,h)=>{const m=new n(l);return m.update(I1(h)),m.digest()},zv=({headers:n},l,h)=>{const m={};for(const w of Object.keys(n).sort()){if(n[w]==null)continue;const E=w.toLowerCase();(E in E6||l!=null&&l.has(E)||M6.test(E)||A6.test(E))&&(!h||h&&!h.has(E))||(m[E]=n[w].trim().replace(/\s+/g," "))}return m},D6=n=>typeof ArrayBuffer=="function"&&n instanceof ArrayBuffer||Object.prototype.toString.call(n)==="[object ArrayBuffer]",U2=async({headers:n,body:l},h)=>{for(const m of Object.keys(n))if(m.toLowerCase()===k2)return n[m];if(l==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";if(typeof l=="string"||ArrayBuffer.isView(l)||D6(l)){const m=new h;return m.update(I1(l)),xd(await m.digest())}return P6};class O6{format(l){const h=[];for(const E of Object.keys(l)){const C=Kf(E);h.push(Uint8Array.from([C.byteLength]),C,this.formatHeaderValue(l[E]))}const m=new Uint8Array(h.reduce((E,C)=>E+C.byteLength,0));let w=0;for(const E of h)m.set(E,w),w+=E.byteLength;return m}formatHeaderValue(l){switch(l.type){case"boolean":return Uint8Array.from([l.value?0:1]);case"byte":return Uint8Array.from([2,l.value]);case"short":const h=new DataView(new ArrayBuffer(3));return h.setUint8(0,3),h.setInt16(1,l.value,!1),new Uint8Array(h.buffer);case"integer":const m=new DataView(new ArrayBuffer(5));return m.setUint8(0,4),m.setInt32(1,l.value,!1),new Uint8Array(m.buffer);case"long":const w=new Uint8Array(9);return w[0]=5,w.set(l.value.bytes,1),w;case"binary":const E=new DataView(new ArrayBuffer(3+l.value.byteLength));E.setUint8(0,6),E.setUint16(1,l.value.byteLength,!1);const C=new Uint8Array(E.buffer);return C.set(l.value,3),C;case"string":const c=Kf(l.value),D=new DataView(new ArrayBuffer(3+c.byteLength));D.setUint8(0,7),D.setUint16(1,c.byteLength,!1);const B=new Uint8Array(D.buffer);return B.set(c,3),B;case"timestamp":const Z=new Uint8Array(9);return Z[0]=8,Z.set($2.fromNumber(l.value.valueOf()).bytes,1),Z;case"uuid":if(!k6.test(l.value))throw new Error(`Invalid UUID received: ${l.value}`);const X=new Uint8Array(17);return X[0]=9,X.set(Db(l.value.replace(/\-/g,"")),1),X}}}var Dv;(function(n){n[n.boolTrue=0]="boolTrue",n[n.boolFalse=1]="boolFalse",n[n.byte=2]="byte",n[n.short=3]="short",n[n.integer=4]="integer",n[n.long=5]="long",n[n.byteArray=6]="byteArray",n[n.string=7]="string",n[n.timestamp=8]="timestamp",n[n.uuid=9]="uuid"})(Dv||(Dv={}));const k6=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;class $2{constructor(l){st(this,"bytes");if(this.bytes=l,l.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(l){if(l>9223372036854776e3||l<-9223372036854776e3)throw new Error(`${l} is too large (or, if negative, too small) to represent as an Int64`);const h=new Uint8Array(8);for(let m=7,w=Math.abs(Math.round(l));m>-1&&w>0;m--,w/=256)h[m]=w;return l<0&&Ov(h),new $2(h)}valueOf(){const l=this.bytes.slice(0),h=l[0]&128;return h&&Ov(l),parseInt(xd(l),16)*(h?-1:1)}toString(){return String(this.valueOf())}}function Ov(n){for(let l=0;l<8;l++)n[l]^=255;for(let l=7;l>-1&&(n[l]++,n[l]===0);l--);}const B6=(n,l)=>{n=n.toLowerCase();for(const h of Object.keys(l))if(n===h.toLowerCase())return!0;return!1},F6=(n,l={})=>{var w,E;const{headers:h,query:m={}}=To.clone(n);for(const C of Object.keys(h)){const c=C.toLowerCase();(c.slice(0,6)==="x-amz-"&&!((w=l.unhoistableHeaders)!=null&&w.has(c))||(E=l.hoistableHeaders)!=null&&E.has(c))&&(m[C]=h[C],delete h[C])}return{...n,headers:h,query:m}},kv=n=>{n=To.clone(n);for(const l of Object.keys(n.headers))S6.indexOf(l.toLowerCase())>-1&&delete n.headers[l];return n},N6=({query:n={}})=>{const l=[],h={};for(const m of Object.keys(n)){if(m.toLowerCase()===C6)continue;const w=vd(m);l.push(w);const E=n[m];typeof E=="string"?h[w]=`${w}=${vd(E)}`:Array.isArray(E)&&(h[w]=E.slice(0).reduce((C,c)=>C.concat([`${w}=${vd(c)}`]),[]).sort().join("&"))}return l.sort().map(m=>h[m]).filter(m=>m).join("&")},U6=n=>$6(n).toISOString().replace(/\.\d{3}Z$/,"Z"),$6=n=>typeof n=="number"?new Date(n*1e3):typeof n=="string"?Number(n)?new Date(Number(n)*1e3):new Date(n):n;class V6{constructor({applyChecksum:l,credentials:h,region:m,service:w,sha256:E,uriEscapePath:C=!0}){st(this,"service");st(this,"regionProvider");st(this,"credentialProvider");st(this,"sha256");st(this,"uriEscapePath");st(this,"applyChecksum");this.service=w,this.sha256=E,this.uriEscapePath=C,this.applyChecksum=typeof l=="boolean"?l:!0,this.regionProvider=nu(m),this.credentialProvider=nu(h)}createCanonicalRequest(l,h,m){const w=Object.keys(h).sort();return`${l.method}
54
+ ${this.getCanonicalPath(l)}
55
+ ${N6(l)}
56
+ ${w.map(E=>`${E}:${h[E]}`).join(`
57
+ `)}
58
+
59
+ ${w.join(";")}
60
+ ${m}`}async createStringToSign(l,h,m,w){const E=new this.sha256;E.update(I1(m));const C=await E.digest();return`${w}
61
+ ${l}
62
+ ${h}
63
+ ${xd(C)}`}getCanonicalPath({path:l}){if(this.uriEscapePath){const h=[];for(const E of l.split("/"))(E==null?void 0:E.length)!==0&&E!=="."&&(E===".."?h.pop():h.push(E));const m=`${l!=null&&l.startsWith("/")?"/":""}${h.join("/")}${h.length>0&&(l!=null&&l.endsWith("/"))?"/":""}`;return vd(m).replace(/%2F/g,"/")}return l}validateResolvedCredentials(l){if(typeof l!="object"||typeof l.accessKeyId!="string"||typeof l.secretAccessKey!="string")throw new Error("Resolved credential object is not valid")}formatDate(l){const h=U6(l).replace(/[\-:]/g,"");return{longDate:h,shortDate:h.slice(0,8)}}getCanonicalHeaderList(l){return Object.keys(l).sort().join(";")}}class Bv extends V6{constructor({applyChecksum:h,credentials:m,region:w,service:E,sha256:C,uriEscapePath:c=!0}){super({applyChecksum:h,credentials:m,region:w,service:E,sha256:C,uriEscapePath:c});st(this,"headerFormatter",new O6)}async presign(h,m={}){const{signingDate:w=new Date,expiresIn:E=3600,unsignableHeaders:C,unhoistableHeaders:c,signableHeaders:D,hoistableHeaders:B,signingRegion:Z,signingService:X}=m,Y=await this.credentialProvider();this.validateResolvedCredentials(Y);const U=Z??await this.regionProvider(),{longDate:oe,shortDate:ge}=this.formatDate(w);if(E>I6)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const ye=N2(ge,U,X??this.service),Se=F6(kv(h),{unhoistableHeaders:c,hoistableHeaders:B});Y.sessionToken&&(Se.query[Av]=Y.sessionToken),Se.query[v6]=B2,Se.query[x6]=`${Y.accessKeyId}/${ye}`,Se.query[Ev]=oe,Se.query[w6]=E.toString(10);const je=zv(Se,C,D);return Se.query[b6]=this.getCanonicalHeaderList(je),Se.query[Mv]=await this.getSignature(oe,ye,this.getSigningKey(Y,U,ge,X),this.createCanonicalRequest(Se,je,await U2(h,this.sha256))),Se}async sign(h,m){return typeof h=="string"?this.signString(h,m):h.headers&&h.payload?this.signEvent(h,m):h.message?this.signMessage(h,m):this.signRequest(h,m)}async signEvent({headers:h,payload:m},{signingDate:w=new Date,priorSignature:E,signingRegion:C,signingService:c}){const D=C??await this.regionProvider(),{shortDate:B,longDate:Z}=this.formatDate(w),X=N2(B,D,c??this.service),Y=await U2({headers:{},body:m},this.sha256),U=new this.sha256;U.update(h);const oe=xd(await U.digest()),ge=[L6,Z,X,E,oe,Y].join(`
64
+ `);return this.signString(ge,{signingDate:w,signingRegion:D,signingService:c})}async signMessage(h,{signingDate:m=new Date,signingRegion:w,signingService:E}){return this.signEvent({headers:this.headerFormatter.format(h.message.headers),payload:h.message.body},{signingDate:m,signingRegion:w,signingService:E,priorSignature:h.priorSignature}).then(c=>({message:h.message,signature:c}))}async signString(h,{signingDate:m=new Date,signingRegion:w,signingService:E}={}){const C=await this.credentialProvider();this.validateResolvedCredentials(C);const c=w??await this.regionProvider(),{shortDate:D}=this.formatDate(m),B=new this.sha256(await this.getSigningKey(C,c,D,E));return B.update(I1(h)),xd(await B.digest())}async signRequest(h,{signingDate:m=new Date,signableHeaders:w,unsignableHeaders:E,signingRegion:C,signingService:c}={}){const D=await this.credentialProvider();this.validateResolvedCredentials(D);const B=C??await this.regionProvider(),Z=kv(h),{longDate:X,shortDate:Y}=this.formatDate(m),U=N2(Y,B,c??this.service);Z.headers[Pv]=X,D.sessionToken&&(Z.headers[T6]=D.sessionToken);const oe=await U2(Z,this.sha256);!B6(k2,Z.headers)&&this.applyChecksum&&(Z.headers[k2]=oe);const ge=zv(Z,E,w),ye=await this.getSignature(X,U,this.getSigningKey(D,B,Y,c),this.createCanonicalRequest(Z,ge,oe));return Z.headers[Lv]=`${B2} Credential=${D.accessKeyId}/${U}, SignedHeaders=${this.getCanonicalHeaderList(ge)}, Signature=${ye}`,Z}async getSignature(h,m,w,E){const C=await this.createStringToSign(h,m,E,B2),c=new this.sha256(await w);return c.update(I1(C)),xd(await c.digest())}getSigningKey(h,m,w,E){return z6(this.sha256,h,w,m,E||this.service)}}const j6=n=>{let l=n.credentials,h=!!n.credentials,m;Object.defineProperty(n,"credentials",{set(B){B&&B!==l&&B!==m&&(h=!0),l=B;const Z=Z6(n,{credentials:l,credentialDefaultProvider:n.credentialDefaultProvider}),X=G6(n,Z);h&&!X.attributed?(m=async Y=>X(Y).then(U=>p6(U,"CREDENTIALS_CODE","e")),m.memoized=X.memoized,m.configBound=X.configBound,m.attributed=!0):m=X},get(){return m},enumerable:!0,configurable:!0}),n.credentials=l;const{signingEscapePath:w=!0,systemClockOffset:E=n.systemClockOffset||0,sha256:C}=n;let c;return n.signer?c=P1(n.signer):n.regionInfoProvider?c=()=>P1(n.region)().then(async B=>[await n.regionInfoProvider(B,{useFipsEndpoint:await n.useFipsEndpoint(),useDualstackEndpoint:await n.useDualstackEndpoint()})||{},B]).then(([B,Z])=>{const{signingRegion:X,signingService:Y}=B;n.signingRegion=n.signingRegion||X||Z,n.signingName=n.signingName||Y||n.serviceId;const U={...n,credentials:n.credentials,region:n.signingRegion,service:n.signingName,sha256:C,uriEscapePath:w},oe=n.signerConstructor||Bv;return new oe(U)}):c=async B=>{B=Object.assign({},{name:"sigv4",signingName:n.signingName||n.defaultSigningName,signingRegion:await P1(n.region)(),properties:{}},B);const Z=B.signingRegion,X=B.signingName;n.signingRegion=n.signingRegion||Z,n.signingName=n.signingName||X||n.serviceId;const Y={...n,credentials:n.credentials,region:n.signingRegion,service:n.signingName,sha256:C,uriEscapePath:w},U=n.signerConstructor||Bv;return new U(Y)},Object.assign(n,{systemClockOffset:E,signingEscapePath:w,signer:c})};function Z6(n,{credentials:l,credentialDefaultProvider:h}){let m;return l?l!=null&&l.memoized?m=l:m=Gb(l,Zb,cv):h?m=P1(h(Object.assign({},n,{parentClientConfig:n}))):m=async()=>{throw new Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.")},m.memoized=!0,m}function G6(n,l){if(l.configBound)return l;const h=async m=>l({...m,callerClientConfig:n});return h.memoized=l.memoized,h.configBound=!0,h}const Fv=typeof TextEncoder=="function"?new TextEncoder:null,q6=n=>{if(typeof n=="string"){if(Fv)return Fv.encode(n).byteLength;let l=n.length;for(let h=l-1;h>=0;h--){const m=n.charCodeAt(h);m>127&&m<=2047?l++:m>2047&&m<=65535&&(l+=2),m>=56320&&m<=57343&&h--}return l}else{if(typeof n.byteLength=="number")return n.byteLength;if(typeof n.size=="number")return n.size}throw new Error(`Body Length computation failed for ${n}`)},bd=(n,l)=>{const h=[];if(n&&h.push(n),l)for(const m of l)h.push(m);return h},uh=(n,l)=>`${n||"anonymous"}${l&&l.length>0?` (a.k.a. ${l.join(",")})`:""}`,Ig=()=>{let n=[],l=[],h=!1;const m=new Set,w=X=>X.sort((Y,U)=>Nv[U.step]-Nv[Y.step]||Uv[U.priority||"normal"]-Uv[Y.priority||"normal"]),E=X=>{let Y=!1;const U=oe=>{const ge=bd(oe.name,oe.aliases);if(ge.includes(X)){Y=!0;for(const ye of ge)m.delete(ye);return!1}return!0};return n=n.filter(U),l=l.filter(U),Y},C=X=>{let Y=!1;const U=oe=>{if(oe.middleware===X){Y=!0;for(const ge of bd(oe.name,oe.aliases))m.delete(ge);return!1}return!0};return n=n.filter(U),l=l.filter(U),Y},c=X=>{var Y;return n.forEach(U=>{X.add(U.middleware,{...U})}),l.forEach(U=>{X.addRelativeTo(U.middleware,{...U})}),(Y=X.identifyOnResolve)==null||Y.call(X,Z.identifyOnResolve()),X},D=X=>{const Y=[];return X.before.forEach(U=>{U.before.length===0&&U.after.length===0?Y.push(U):Y.push(...D(U))}),Y.push(X),X.after.reverse().forEach(U=>{U.before.length===0&&U.after.length===0?Y.push(U):Y.push(...D(U))}),Y},B=(X=!1)=>{const Y=[],U=[],oe={};return n.forEach(ye=>{const Se={...ye,before:[],after:[]};for(const je of bd(Se.name,Se.aliases))oe[je]=Se;Y.push(Se)}),l.forEach(ye=>{const Se={...ye,before:[],after:[]};for(const je of bd(Se.name,Se.aliases))oe[je]=Se;U.push(Se)}),U.forEach(ye=>{if(ye.toMiddleware){const Se=oe[ye.toMiddleware];if(Se===void 0){if(X)return;throw new Error(`${ye.toMiddleware} is not found when adding ${uh(ye.name,ye.aliases)} middleware ${ye.relation} ${ye.toMiddleware}`)}ye.relation==="after"&&Se.after.push(ye),ye.relation==="before"&&Se.before.push(ye)}}),w(Y).map(D).reduce((ye,Se)=>(ye.push(...Se),ye),[])},Z={add:(X,Y={})=>{const{name:U,override:oe,aliases:ge}=Y,ye={step:"initialize",priority:"normal",middleware:X,...Y},Se=bd(U,ge);if(Se.length>0){if(Se.some(je=>m.has(je))){if(!oe)throw new Error(`Duplicate middleware name '${uh(U,ge)}'`);for(const je of Se){const Pe=n.findIndex(Je=>{var et;return Je.name===je||((et=Je.aliases)==null?void 0:et.some(ot=>ot===je))});if(Pe===-1)continue;const Oe=n[Pe];if(Oe.step!==ye.step||ye.priority!==Oe.priority)throw new Error(`"${uh(Oe.name,Oe.aliases)}" middleware with ${Oe.priority} priority in ${Oe.step} step cannot be overridden by "${uh(U,ge)}" middleware with ${ye.priority} priority in ${ye.step} step.`);n.splice(Pe,1)}}for(const je of Se)m.add(je)}n.push(ye)},addRelativeTo:(X,Y)=>{const{name:U,override:oe,aliases:ge}=Y,ye={middleware:X,...Y},Se=bd(U,ge);if(Se.length>0){if(Se.some(je=>m.has(je))){if(!oe)throw new Error(`Duplicate middleware name '${uh(U,ge)}'`);for(const je of Se){const Pe=l.findIndex(Je=>{var et;return Je.name===je||((et=Je.aliases)==null?void 0:et.some(ot=>ot===je))});if(Pe===-1)continue;const Oe=l[Pe];if(Oe.toMiddleware!==ye.toMiddleware||Oe.relation!==ye.relation)throw new Error(`"${uh(Oe.name,Oe.aliases)}" middleware ${Oe.relation} "${Oe.toMiddleware}" middleware cannot be overridden by "${uh(U,ge)}" middleware ${ye.relation} "${ye.toMiddleware}" middleware.`);l.splice(Pe,1)}}for(const je of Se)m.add(je)}l.push(ye)},clone:()=>c(Ig()),use:X=>{X.applyToStack(Z)},remove:X=>typeof X=="string"?E(X):C(X),removeByTag:X=>{let Y=!1;const U=oe=>{const{tags:ge,name:ye,aliases:Se}=oe;if(ge&&ge.includes(X)){const je=bd(ye,Se);for(const Pe of je)m.delete(Pe);return Y=!0,!1}return!0};return n=n.filter(U),l=l.filter(U),Y},concat:X=>{var U;const Y=c(Ig());return Y.use(X),Y.identifyOnResolve(h||Y.identifyOnResolve()||(((U=X.identifyOnResolve)==null?void 0:U.call(X))??!1)),Y},applyToStack:c,identify:()=>B(!0).map(X=>{const Y=X.step??X.relation+" "+X.toMiddleware;return uh(X.name,X.aliases)+" - "+Y}),identifyOnResolve(X){return typeof X=="boolean"&&(h=X),h},resolve:(X,Y)=>{for(const U of B().map(oe=>oe.middleware).reverse())X=U(X,Y);return h&&console.log(Z.identify()),X}};return Z},Nv={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},Uv={high:3,normal:2,low:1};class H6{constructor(l){st(this,"config");st(this,"middlewareStack",Ig());st(this,"initConfig");st(this,"handlers");this.config=l}send(l,h,m){const w=typeof h!="function"?h:void 0,E=typeof h=="function"?h:m,C=w===void 0&&this.config.cacheMiddleware===!0;let c;if(C){this.handlers||(this.handlers=new WeakMap);const D=this.handlers;D.has(l.constructor)?c=D.get(l.constructor):(c=l.resolveMiddleware(this.middlewareStack,this.config,w),D.set(l.constructor,c))}else delete this.handlers,c=l.resolveMiddleware(this.middlewareStack,this.config,w);if(E)c(l).then(D=>E(null,D.output),D=>E(D)).catch(()=>{});else return c(l).then(D=>D.output)}destroy(){var l,h,m;(m=(h=(l=this.config)==null?void 0:l.requestHandler)==null?void 0:h.destroy)==null||m.call(h),delete this.handlers}}const V2="***SensitiveInformation***";function j2(n,l){if(l==null)return l;const h=z1.of(n);if(h.getMergedTraits().sensitive)return V2;if(h.isListSchema()){if(!!h.getValueSchema().getMergedTraits().sensitive)return V2}else if(h.isMapSchema()){if(!!h.getKeySchema().getMergedTraits().sensitive||!!h.getValueSchema().getMergedTraits().sensitive)return V2}else if(h.isStructSchema()&&typeof l=="object"){const m=l,w={};for(const[E,C]of h.structIterator())m[E]!=null&&(w[E]=j2(C,m[E]));return w}return l}class B1{constructor(){st(this,"middlewareStack",Ig());st(this,"schema")}static classBuilder(){return new X6}resolveMiddlewareWithContext(l,h,m,{middlewareFn:w,clientName:E,commandName:C,inputFilterSensitiveLog:c,outputFilterSensitiveLog:D,smithyContext:B,additionalContext:Z,CommandCtor:X}){for(const ye of w.bind(this)(X,l,h,m))this.middlewareStack.use(ye);const Y=l.concat(this.middlewareStack),{logger:U}=h,oe={logger:U,clientName:E,commandName:C,inputFilterSensitiveLog:c,outputFilterSensitiveLog:D,[C2]:{commandInstance:this,...B},...Z},{requestHandler:ge}=h;return Y.resolve(ye=>ge.handle(ye.request,m||{}),oe)}}class X6{constructor(){st(this,"_init",()=>{});st(this,"_ep",{});st(this,"_middlewareFn",()=>[]);st(this,"_commandName","");st(this,"_clientName","");st(this,"_additionalContext",{});st(this,"_smithyContext",{});st(this,"_inputFilterSensitiveLog");st(this,"_outputFilterSensitiveLog");st(this,"_serializer",null);st(this,"_deserializer",null);st(this,"_operationSchema")}init(l){this._init=l}ep(l){return this._ep=l,this}m(l){return this._middlewareFn=l,this}s(l,h,m={}){return this._smithyContext={service:l,operation:h,...m},this}c(l={}){return this._additionalContext=l,this}n(l,h){return this._clientName=l,this._commandName=h,this}f(l=m=>m,h=m=>m){return this._inputFilterSensitiveLog=l,this._outputFilterSensitiveLog=h,this}ser(l){return this._serializer=l,this}de(l){return this._deserializer=l,this}sc(l){return this._operationSchema=l,this._smithyContext.operationSchema=l,this}build(){const l=this;let h;return h=class extends B1{constructor(...[w]){super();st(this,"input");st(this,"serialize",l._serializer);st(this,"deserialize",l._deserializer);this.input=w??{},l._init(this),this.schema=l._operationSchema}static getEndpointParameterInstructions(){return l._ep}resolveMiddleware(w,E,C){const c=l._operationSchema,D=(c==null?void 0:c[4])??(c==null?void 0:c.input),B=(c==null?void 0:c[5])??(c==null?void 0:c.output);return this.resolveMiddlewareWithContext(w,E,C,{CommandCtor:h,middlewareFn:l._middlewareFn,clientName:l._clientName,commandName:l._commandName,inputFilterSensitiveLog:l._inputFilterSensitiveLog??(c?j2.bind(null,D):Z=>Z),outputFilterSensitiveLog:l._outputFilterSensitiveLog??(c?j2.bind(null,B):Z=>Z),smithyContext:l._smithyContext,additionalContext:l._additionalContext})}}}}const lt="***SensitiveInformation***";class Jf extends Error{constructor(h){super(h.message);st(this,"$fault");st(this,"$response");st(this,"$retryable");st(this,"$metadata");Object.setPrototypeOf(this,Object.getPrototypeOf(this).constructor.prototype),this.name=h.name,this.$fault=h.$fault,this.$metadata=h.$metadata}static isInstance(h){if(!h)return!1;const m=h;return Jf.prototype.isPrototypeOf(m)||!!m.$fault&&!!m.$metadata&&(m.$fault==="client"||m.$fault==="server")}static[Symbol.hasInstance](h){if(!h)return!1;const m=h;return this===Jf?Jf.isInstance(h):Jf.isInstance(h)?m.name&&this.name?this.prototype.isPrototypeOf(h)||m.name===this.name:this.prototype.isPrototypeOf(h):!1}}const F1=(n,l={})=>{Object.entries(l).filter(([,m])=>m!==void 0).forEach(([m,w])=>{(n[m]==null||n[m]==="")&&(n[m]=w)});const h=n.message||n.Message||"UnknownError";return n.message=h,delete n.Message,n},Y6=({output:n,parsedBody:l,exceptionCtor:h,errorCode:m})=>{const w=W6(n),E=w.httpStatusCode?w.httpStatusCode+"":void 0,C=new h({name:(l==null?void 0:l.code)||(l==null?void 0:l.Code)||m||E||"UnknownError",$fault:"client",$metadata:w});throw F1(C,l)},Q6=n=>({output:l,parsedBody:h,errorCode:m})=>{Y6({output:l,parsedBody:h,exceptionCtor:n,errorCode:m})},W6=n=>({httpStatusCode:n.statusCode,requestId:n.headers["x-amzn-requestid"]??n.headers["x-amzn-request-id"]??n.headers["x-amz-request-id"],extendedRequestId:n.headers["x-amz-id-2"],cfId:n.headers["x-amz-cf-id"]}),K6=n=>{switch(n){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:3e4};default:return{}}},J6=n=>{const l=[];for(const h in _g){const m=_g[h];n[m]!==void 0&&l.push({algorithmId:()=>m,checksumConstructor:()=>n[m]})}return{addChecksumAlgorithm(h){l.push(h)},checksumAlgorithms(){return l}}},e8=n=>{const l={};return n.checksumAlgorithms().forEach(h=>{l[h.algorithmId()]=h.checksumConstructor()}),l},t8=n=>({setRetryStrategy(l){n.retryStrategy=l},retryStrategy(){return n.retryStrategy}}),n8=n=>{const l={};return l.retryStrategy=n.retryStrategy(),l},i8=n=>Object.assign(J6(n),t8(n)),r8=n=>Object.assign(e8(n),n8(n));class $v{trace(){}debug(){}info(){}warn(){}error(){}}function Eo(n,l,h){let m,w;m={},w=n;for(const E of Object.keys(w)){if(!Array.isArray(w[E])){m[E]=w[E];continue}Vv(m,null,w,E)}return m}const xr=(n,l)=>{const h={};for(const m in l)Vv(h,n,l,m);return h},Vv=(n,l,h,m)=>{if(l!==null){let C=h[m];typeof C=="function"&&(C=[,C]);const[c=a8,D=s8,B=m]=C;(typeof c=="function"&&c(l[B])||typeof c!="function"&&c)&&(n[m]=D(l[B]));return}let[w,E]=h[m];if(typeof E=="function"){let C;const c=w===void 0&&(C=E())!=null,D=typeof w=="function"&&!!w(void 0)||typeof w!="function"&&!!w;c?n[m]=C:D&&(n[m]=E())}else{const C=w===void 0&&E!=null,c=typeof w=="function"&&!!w(E)||typeof w!="function"&&!!w;(C||c)&&(n[m]=E)}},a8=n=>n!=null,s8=n=>n,jv=n=>{if(n!==n)return"NaN";switch(n){case 1/0:return"Infinity";case-1/0:return"-Infinity";default:return n}},zn=n=>{if(n==null)return{};if(Array.isArray(n))return n.filter(l=>l!=null).map(zn);if(typeof n=="object"){const l={};for(const h of Object.keys(n))n[h]!=null&&(l[h]=zn(n[h]));return l}return n},o8=(n,l)=>Ob(n,l).then(h=>((l==null?void 0:l.utf8Encoder)??M2)(h)),N1=(n,l)=>o8(n,l).then(h=>{if(h.length)try{return JSON.parse(h)}catch(m){throw(m==null?void 0:m.name)==="SyntaxError"&&Object.defineProperty(m,"$responseBodyText",{value:h}),m}return{}}),l8=async(n,l)=>{const h=await N1(n,l);return h.message=h.message??h.Message,h},c8=(n,l)=>{const h=(E,C)=>Object.keys(E).find(c=>c.toLowerCase()===C.toLowerCase()),m=E=>{let C=E;return typeof C=="number"&&(C=C.toString()),C.indexOf(",")>=0&&(C=C.split(",")[0]),C.indexOf(":")>=0&&(C=C.split(":")[0]),C.indexOf("#")>=0&&(C=C.split("#")[1]),C},w=h(n.headers,"x-amzn-errortype");if(w!==void 0)return m(n.headers[w]);if(l&&typeof l=="object"){const E=h(l,"code");if(E&&l[E]!==void 0)return m(l[E]);if(l.__type!==void 0)return m(l.__type)}},u8=/\d{12}\.ddb/;async function h8(n,l,h){var E,C,c,D,B,Z,X;const m=h.request;if(((E=m==null?void 0:m.headers)==null?void 0:E["smithy-protocol"])==="rpc-v2-cbor"&&sc(n,"PROTOCOL_RPC_V2_CBOR","M"),typeof l.retryStrategy=="function"){const Y=await l.retryStrategy();typeof Y.acquireInitialRetryToken=="function"?(c=(C=Y.constructor)==null?void 0:C.name)!=null&&c.includes("Adaptive")?sc(n,"RETRY_MODE_ADAPTIVE","F"):sc(n,"RETRY_MODE_STANDARD","E"):sc(n,"RETRY_MODE_LEGACY","D")}if(typeof l.accountIdEndpointMode=="function"){const Y=n.endpointV2;switch(String((D=Y==null?void 0:Y.url)==null?void 0:D.hostname).match(u8)&&sc(n,"ACCOUNT_ID_ENDPOINT","O"),await((B=l.accountIdEndpointMode)==null?void 0:B.call(l))){case"disabled":sc(n,"ACCOUNT_ID_MODE_DISABLED","Q");break;case"preferred":sc(n,"ACCOUNT_ID_MODE_PREFERRED","P");break;case"required":sc(n,"ACCOUNT_ID_MODE_REQUIRED","R");break}}const w=(X=(Z=n.__smithy_context)==null?void 0:Z.selectedHttpAuthScheme)==null?void 0:X.identity;if(w!=null&&w.$source){const Y=w;Y.accountId&&sc(n,"RESOLVED_ACCOUNT_ID","T");for(const[U,oe]of Object.entries(Y.$source??{}))sc(n,U,oe)}}const Zv="user-agent",Z2="x-amz-user-agent",Gv=" ",G2="/",d8=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g,f8=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w\#]/g,qv="-",p8=1024;function m8(n){let l="";for(const h in n){const m=n[h];if(l.length+m.length+1<=p8){l.length?l+=","+m:l+=m;continue}break}return l}const g8=n=>(l,h)=>async m=>{var U,oe,ge,ye;const{request:w}=m;if(!To.isInstance(w))return l(m);const{headers:E}=w,C=((U=h==null?void 0:h.userAgent)==null?void 0:U.map(zg))||[],c=(await n.defaultUserAgentProvider()).map(zg);await h8(h,n,m);const D=h;c.push(`m/${m8(Object.assign({},(oe=h.__smithy_context)==null?void 0:oe.features,(ge=D.__aws_sdk_context)==null?void 0:ge.features))}`);const B=((ye=n==null?void 0:n.customUserAgent)==null?void 0:ye.map(zg))||[],Z=await n.userAgentAppId();Z&&c.push(zg([`app/${Z}`]));const X=[].concat([...c,...C,...B]).join(Gv),Y=[...c.filter(Se=>Se.startsWith("aws-sdk-")),...B].join(Gv);return n.runtime!=="browser"?(Y&&(E[Z2]=E[Z2]?`${E[Zv]} ${Y}`:Y),E[Zv]=X):E[Z2]=X,l({...m,request:w})},zg=n=>{var C;const l=n[0].split(G2).map(c=>c.replace(d8,qv)).join(G2),h=(C=n[1])==null?void 0:C.replace(f8,qv),m=l.indexOf(G2),w=l.substring(0,m);let E=l.substring(m+1);return w==="api"&&(E=E.toLowerCase()),[w,E,h].filter(c=>c&&c.length>0).reduce((c,D,B)=>{switch(B){case 0:return D;case 1:return`${c}/${D}`;default:return`${c}#${D}`}},"")},y8={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},_8=n=>({applyToStack:l=>{l.add(g8(n),y8)}}),v8=!1,x8=!1,Hv=n=>typeof n=="string"&&(n.startsWith("fips-")||n.endsWith("-fips")),Xv=n=>Hv(n)?["fips-aws-global","aws-fips"].includes(n)?"us-east-1":n.replace(/fips-(dkr-|prod-)?|-fips/,""):n,b8=n=>{const{region:l,useFipsEndpoint:h}=n;if(!l)throw new Error("Region is missing");return Object.assign(n,{region:async()=>{if(typeof l=="string")return Xv(l);const m=await l();return Xv(m)},useFipsEndpoint:async()=>{const m=typeof l=="string"?l:await l();return Hv(m)?!0:typeof h!="function"?Promise.resolve(!!h):h()}})},Yv="content-length";function w8(n){return l=>async h=>{const m=h.request;if(To.isInstance(m)){const{body:w,headers:E}=m;if(w&&Object.keys(E).map(C=>C.toLowerCase()).indexOf(Yv)===-1)try{const C=n(w);m.headers={...m.headers,[Yv]:String(C)}}catch{}}return l({...h,request:m})}}const S8={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},C8=n=>({applyToStack:l=>{l.add(w8(n.bodyLengthChecker),S8)}}),T8=async n=>{const l=(n==null?void 0:n.Bucket)||"";if(typeof n.Bucket=="string"&&(n.Bucket=l.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"))),P8(l)){if(n.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else(!L8(l)||l.indexOf(".")!==-1&&!String(n.Endpoint).startsWith("http:")||l.toLowerCase()!==l||l.length<3)&&(n.ForcePathStyle=!0);return n.DisableMultiRegionAccessPoints&&(n.disableMultiRegionAccessPoints=!0,n.DisableMRAP=!0),n},E8=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,M8=/(\d+\.){3}\d+/,A8=/\.\./,L8=n=>E8.test(n)&&!M8.test(n)&&!A8.test(n),P8=n=>{const[l,h,m,,,w]=n.split(":"),E=l==="arn"&&n.split(":").length>=6,C=!!(E&&h&&m&&w);if(E&&!C)throw new Error(`Invalid ARN: ${n} was an invalid ARN.`);return C},R8=(n,l,h)=>{const m=async()=>{const w=h[n]??h[l];return typeof w=="function"?w():w};return n==="credentialScope"||l==="CredentialScope"?async()=>{const w=typeof h.credentials=="function"?await h.credentials():h.credentials;return(w==null?void 0:w.credentialScope)??(w==null?void 0:w.CredentialScope)}:n==="accountId"||l==="AccountId"?async()=>{const w=typeof h.credentials=="function"?await h.credentials():h.credentials;return(w==null?void 0:w.accountId)??(w==null?void 0:w.AccountId)}:n==="endpoint"||l==="endpoint"?async()=>{if(h.isCustomEndpoint===!1)return;const w=await m();if(w&&typeof w=="object"){if("url"in w)return w.url.href;if("hostname"in w){const{protocol:E,hostname:C,port:c,path:D}=w;return`${E}//${C}${c?":"+c:""}${D}`}}return w}:m},Qv=async n=>{},Wv=n=>typeof n=="object"?"url"in n?Pg(n.url):n:Pg(n),I8=async(n,l,h,m)=>{if(!h.isCustomEndpoint){let C;h.serviceConfiguredEndpoint?C=await h.serviceConfiguredEndpoint():C=await Qv(h.serviceId),C&&(h.endpoint=()=>Promise.resolve(Wv(C)),h.isCustomEndpoint=!0)}const w=await z8(n,l,h);if(typeof h.endpointProvider!="function")throw new Error("config.endpointProvider is not set.");return h.endpointProvider(w,m)},z8=async(n,l,h)=>{var E;const m={},w=((E=l==null?void 0:l.getEndpointParameterInstructions)==null?void 0:E.call(l))||{};for(const[C,c]of Object.entries(w))switch(c.type){case"staticContextParams":m[C]=c.value;break;case"contextParams":m[C]=n[c.name];break;case"clientContextParams":case"builtInParams":m[C]=await R8(c.name,C,h)();break;case"operationContextParams":m[C]=c.get(n);break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(c))}return Object.keys(w).length===0&&Object.assign(m,h),String(h.serviceId).toLowerCase()==="s3"&&await T8(m),m},D8=({config:n,instructions:l})=>(h,m)=>async w=>{var c,D,B;n.isCustomEndpoint&&Vb(m,"ENDPOINT_OVERRIDE","N");const E=await I8(w.input,{getEndpointParameterInstructions(){return l}},{...n},m);m.endpointV2=E,m.authSchemes=(c=E.properties)==null?void 0:c.authSchemes;const C=(D=m.authSchemes)==null?void 0:D[0];if(C){m.signing_region=C.signingRegion,m.signing_service=C.signingName;const Z=vg(m),X=(B=Z==null?void 0:Z.selectedHttpAuthScheme)==null?void 0:B.httpAuthOption;X&&(X.signingProperties=Object.assign(X.signingProperties||{},{signing_region:C.signingRegion,signingRegion:C.signingRegion,signing_service:C.signingName,signingName:C.signingName,signingRegionSet:C.signingRegionSet},C.properties))}return h({...w})},O8={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:J_.name},Dg=(n,l)=>({applyToStack:h=>{h.addRelativeTo(D8({config:n,instructions:l}),O8)}}),k8=n=>{const l=n.tls??!0,{endpoint:h,useDualstackEndpoint:m,useFipsEndpoint:w}=n,E=h!=null?async()=>Wv(await nu(h)()):void 0,c=Object.assign(n,{endpoint:E,tls:l,isCustomEndpoint:!!h,useDualstackEndpoint:nu(m??!1),useFipsEndpoint:nu(w??!1)});let D;return c.serviceConfiguredEndpoint=async()=>(n.serviceId&&!D&&(D=Qv(n.serviceId)),D),c};var ep;(function(n){n.STANDARD="standard",n.ADAPTIVE="adaptive"})(ep||(ep={}));const Og=3,B8=ep.STANDARD,F8=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],N8=["TimeoutError","RequestTimeout","RequestTimeoutException"],U8=[500,502,503,504],$8=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],V8=["EHOSTUNREACH","ENETUNREACH","ENOTFOUND"],j8=n=>(n==null?void 0:n.$retryable)!==void 0,Z8=n=>{var l;return(l=n.$metadata)==null?void 0:l.clockSkewCorrected},G8=n=>{const l=new Set(["Failed to fetch","NetworkError when attempting to fetch resource","The Internet connection appears to be offline","Load failed","Network request failed"]);return n&&n instanceof TypeError?l.has(n.message):!1},Kv=n=>{var l,h;return((l=n.$metadata)==null?void 0:l.httpStatusCode)===429||F8.includes(n.name)||((h=n.$retryable)==null?void 0:h.throttling)==!0},q2=(n,l=0)=>{var h;return j8(n)||Z8(n)||N8.includes(n.name)||$8.includes((n==null?void 0:n.code)||"")||V8.includes((n==null?void 0:n.code)||"")||U8.includes(((h=n.$metadata)==null?void 0:h.httpStatusCode)||0)||G8(n)||n.cause!==void 0&&l<=10&&q2(n.cause,l+1)},q8=n=>{var l;if(((l=n.$metadata)==null?void 0:l.httpStatusCode)!==void 0){const h=n.$metadata.httpStatusCode;return 500<=h&&h<=599&&!q2(n)}return!1},_0=class _0{constructor(l){st(this,"beta");st(this,"minCapacity");st(this,"minFillRate");st(this,"scaleConstant");st(this,"smooth");st(this,"currentCapacity",0);st(this,"enabled",!1);st(this,"lastMaxRate",0);st(this,"measuredTxRate",0);st(this,"requestCount",0);st(this,"fillRate");st(this,"lastThrottleTime");st(this,"lastTimestamp",0);st(this,"lastTxRateBucket");st(this,"maxCapacity");st(this,"timeWindow",0);this.beta=(l==null?void 0:l.beta)??.7,this.minCapacity=(l==null?void 0:l.minCapacity)??1,this.minFillRate=(l==null?void 0:l.minFillRate)??.5,this.scaleConstant=(l==null?void 0:l.scaleConstant)??.4,this.smooth=(l==null?void 0:l.smooth)??.8;const h=this.getCurrentTimeInSeconds();this.lastThrottleTime=h,this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}getCurrentTimeInSeconds(){return Date.now()/1e3}async getSendToken(){return this.acquireTokenBucket(1)}async acquireTokenBucket(l){if(this.enabled){if(this.refillTokenBucket(),l>this.currentCapacity){const h=(l-this.currentCapacity)/this.fillRate*1e3;await new Promise(m=>_0.setTimeoutFn(m,h))}this.currentCapacity=this.currentCapacity-l}}refillTokenBucket(){const l=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=l;return}const h=(l-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+h),this.lastTimestamp=l}updateClientSendingRate(l){let h;if(this.updateMeasuredRate(),Kv(l)){const w=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=w,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),h=this.cubicThrottle(w),this.enableTokenBucket()}else this.calculateTimeWindow(),h=this.cubicSuccess(this.getCurrentTimeInSeconds());const m=Math.min(h,2*this.measuredTxRate);this.updateTokenBucketRate(m)}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))}cubicThrottle(l){return this.getPrecise(l*this.beta)}cubicSuccess(l){return this.getPrecise(this.scaleConstant*Math.pow(l-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(l){this.refillTokenBucket(),this.fillRate=Math.max(l,this.minFillRate),this.maxCapacity=Math.max(l,this.minCapacity),this.currentCapacity=Math.min(this.currentCapacity,this.maxCapacity)}updateMeasuredRate(){const l=this.getCurrentTimeInSeconds(),h=Math.floor(l*2)/2;if(this.requestCount++,h>this.lastTxRateBucket){const m=this.requestCount/(h-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(m*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=h}}getPrecise(l){return parseFloat(l.toFixed(8))}};st(_0,"setTimeoutFn",setTimeout);let H2=_0;const X2=100,Jv=20*1e3,H8=500,e3=500,X8=5,Y8=10,Q8=1,W8="amz-sdk-invocation-id",K8="amz-sdk-request",J8=()=>{let n=X2;return{computeNextBackoffDelay:m=>Math.floor(Math.min(Jv,Math.random()*2**m*n)),setDelayBase:m=>{n=m}}},t3=({retryDelay:n,retryCount:l,retryCost:h})=>({getRetryCount:()=>l,getRetryDelay:()=>Math.min(Jv,n),getRetryCost:()=>h});class n3{constructor(l){st(this,"maxAttempts");st(this,"mode",ep.STANDARD);st(this,"capacity",e3);st(this,"retryBackoffStrategy",J8());st(this,"maxAttemptsProvider");this.maxAttempts=l,this.maxAttemptsProvider=typeof l=="function"?l:async()=>l}async acquireInitialRetryToken(l){return t3({retryDelay:X2,retryCount:0})}async refreshRetryTokenForRetry(l,h){const m=await this.getMaxAttempts();if(this.shouldRetry(l,h,m)){const w=h.errorType;this.retryBackoffStrategy.setDelayBase(w==="THROTTLING"?H8:X2);const E=this.retryBackoffStrategy.computeNextBackoffDelay(l.getRetryCount()),C=h.retryAfterHint?Math.max(h.retryAfterHint.getTime()-Date.now()||0,E):E,c=this.getCapacityCost(w);return this.capacity-=c,t3({retryDelay:C,retryCount:l.getRetryCount()+1,retryCost:c})}throw new Error("No retry token available")}recordSuccess(l){this.capacity=Math.max(e3,this.capacity+(l.getRetryCost()??Q8))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch{return console.warn(`Max attempts provider could not resolve. Using default of ${Og}`),Og}}shouldRetry(l,h,m){return l.getRetryCount()+1<m&&this.capacity>=this.getCapacityCost(h.errorType)&&this.isRetryableError(h.errorType)}getCapacityCost(l){return l==="TRANSIENT"?Y8:X8}isRetryableError(l){return l==="THROTTLING"||l==="TRANSIENT"}}class e7{constructor(l,h){st(this,"maxAttemptsProvider");st(this,"rateLimiter");st(this,"standardRetryStrategy");st(this,"mode",ep.ADAPTIVE);this.maxAttemptsProvider=l;const{rateLimiter:m}=h??{};this.rateLimiter=m??new H2,this.standardRetryStrategy=new n3(l)}async acquireInitialRetryToken(l){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(l)}async refreshRetryTokenForRetry(l,h){return this.rateLimiter.updateClientSendingRate(h),this.standardRetryStrategy.refreshRetryTokenForRetry(l,h)}recordSuccess(l){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(l)}}const t7=n=>n instanceof Error?n:n instanceof Object?Object.assign(new Error,n):typeof n=="string"?new Error(n):new Error(`AWS SDK error wrapper for ${n}`),n7=n=>{const{retryStrategy:l,retryMode:h,maxAttempts:m}=n,w=nu(m??Og);return Object.assign(n,{maxAttempts:w,retryStrategy:async()=>l||(await nu(h)()===ep.ADAPTIVE?new e7(w):new n3(w))})},i7=n=>(n==null?void 0:n.body)instanceof ReadableStream,r7=n=>(l,h)=>async m=>{var C;let w=await n.retryStrategy();const E=await n.maxAttempts();if(a7(w)){w=w;let c=await w.acquireInitialRetryToken(h.partition_id),D=new Error,B=0,Z=0;const{request:X}=m,Y=To.isInstance(X);for(Y&&(X.headers[W8]=Nb());;)try{Y&&(X.headers[K8]=`attempt=${B+1}; max=${E}`);const{response:U,output:oe}=await l(m);return w.recordSuccess(c),oe.$metadata.attempts=B+1,oe.$metadata.totalRetryDelay=Z,{response:U,output:oe}}catch(U){const oe=s7(U);if(D=t7(U),Y&&i7(X))throw(C=h.logger instanceof $v?console:h.logger)==null||C.warn("An error was encountered in a non-retryable streaming request."),D;try{c=await w.refreshRetryTokenForRetry(c,oe)}catch{throw D.$metadata||(D.$metadata={}),D.$metadata.attempts=B+1,D.$metadata.totalRetryDelay=Z,D}B=c.getRetryCount();const ge=c.getRetryDelay();Z+=ge,await new Promise(ye=>setTimeout(ye,ge))}}else return w=w,w!=null&&w.mode&&(h.userAgent=[...h.userAgent||[],["cfg/retry-mode",w.mode]]),w.retry(l,m)},a7=n=>typeof n.acquireInitialRetryToken<"u"&&typeof n.refreshRetryTokenForRetry<"u"&&typeof n.recordSuccess<"u",s7=n=>{const l={error:n,errorType:o7(n)},h=u7(n.$response);return h&&(l.retryAfterHint=h),l},o7=n=>Kv(n)?"THROTTLING":q2(n)?"TRANSIENT":q8(n)?"SERVER_ERROR":"CLIENT_ERROR",l7={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},c7=n=>({applyToStack:l=>{l.add(r7(n),l7)}}),u7=n=>{if(!L1.isInstance(n))return;const l=Object.keys(n.headers).find(E=>E.toLowerCase()==="retry-after");if(!l)return;const h=n.headers[l],m=Number(h);return Number.isNaN(m)?new Date(h):new Date(m*1e3)},h7=async(n,l,h)=>({operation:vg(l).operation,region:await nu(n.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function d7(n){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"geo-places",region:n.region},propertiesExtractor:(l,h)=>({signingProperties:{config:l,context:h}})}}const f7=n=>{const l=[];switch(n.operation){default:l.push(d7(n))}return l},p7=n=>{const l=j6(n);return Object.assign(l,{authSchemePreference:nu(n.authSchemePreference??[])})},m7=n=>Object.assign(n,{useDualstackEndpoint:n.useDualstackEndpoint??!1,useFipsEndpoint:n.useFipsEndpoint??!1,defaultSigningName:"geo-places"}),kg={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},g7={version:"3.911.0"},y7=n=>new TextEncoder().encode(n);var _7=typeof Buffer<"u"&&Buffer.from?function(n){return Buffer.from(n,"utf8")}:y7;function U1(n){return n instanceof Uint8Array?n:typeof n=="string"?_7(n):ArrayBuffer.isView(n)?new Uint8Array(n.buffer,n.byteOffset,n.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(n)}function Y2(n){return typeof n=="string"?n.length===0:n.byteLength===0}var i3={name:"SHA-256"},r3={name:"HMAC",hash:i3},v7=new Uint8Array([227,176,196,66,152,252,28,20,154,251,244,200,153,111,185,36,39,174,65,228,100,155,147,76,164,149,153,27,120,82,184,85]);const x7={};function Bg(){return typeof window<"u"?window:typeof self<"u"?self:x7}var b7=(function(){function n(l){this.toHash=new Uint8Array(0),this.secret=l,this.reset()}return n.prototype.update=function(l){if(!Y2(l)){var h=U1(l),m=new Uint8Array(this.toHash.byteLength+h.byteLength);m.set(this.toHash,0),m.set(h,this.toHash.byteLength),this.toHash=m}},n.prototype.digest=function(){var l=this;return this.key?this.key.then(function(h){return Bg().crypto.subtle.sign(r3,h,l.toHash).then(function(m){return new Uint8Array(m)})}):Y2(this.toHash)?Promise.resolve(v7):Promise.resolve().then(function(){return Bg().crypto.subtle.digest(i3,l.toHash)}).then(function(h){return Promise.resolve(new Uint8Array(h))})},n.prototype.reset=function(){var l=this;this.toHash=new Uint8Array(0),this.secret&&this.secret!==void 0&&(this.key=new Promise(function(h,m){Bg().crypto.subtle.importKey("raw",U1(l.secret),r3,!1,["sign"]).then(h,m)}),this.key.catch(function(){}))},n})();function w7(n,l,h,m){function w(E){return E instanceof h?E:new h(function(C){C(E)})}return new(h||(h=Promise))(function(E,C){function c(Z){try{B(m.next(Z))}catch(X){C(X)}}function D(Z){try{B(m.throw(Z))}catch(X){C(X)}}function B(Z){Z.done?E(Z.value):w(Z.value).then(c,D)}B((m=m.apply(n,l||[])).next())})}function S7(n,l){var h={label:0,sent:function(){if(E[0]&1)throw E[1];return E[1]},trys:[],ops:[]},m,w,E,C=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return C.next=c(0),C.throw=c(1),C.return=c(2),typeof Symbol=="function"&&(C[Symbol.iterator]=function(){return this}),C;function c(B){return function(Z){return D([B,Z])}}function D(B){if(m)throw new TypeError("Generator is already executing.");for(;C&&(C=0,B[0]&&(h=0)),h;)try{if(m=1,w&&(E=B[0]&2?w.return:B[0]?w.throw||((E=w.return)&&E.call(w),0):w.next)&&!(E=E.call(w,B[1])).done)return E;switch(w=0,E&&(B=[B[0]&2,E.value]),B[0]){case 0:case 1:E=B;break;case 4:return h.label++,{value:B[1],done:!1};case 5:h.label++,w=B[1],B=[0];continue;case 7:B=h.ops.pop(),h.trys.pop();continue;default:if(E=h.trys,!(E=E.length>0&&E[E.length-1])&&(B[0]===6||B[0]===2)){h=0;continue}if(B[0]===3&&(!E||B[1]>E[0]&&B[1]<E[3])){h.label=B[1];break}if(B[0]===6&&h.label<E[1]){h.label=E[1],E=B;break}if(E&&h.label<E[2]){h.label=E[2],h.ops.push(B);break}E[2]&&h.ops.pop(),h.trys.pop();continue}B=l.call(n,h)}catch(Z){B=[6,Z],w=0}finally{m=E=0}if(B[0]&5)throw B[1];return{value:B[0]?B[1]:void 0,done:!0}}}typeof SuppressedError=="function"&&SuppressedError;var Mo=64,C7=32,T7=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),E7=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],M7=Math.pow(2,53)-1,Fg=(function(){function n(){this.state=Int32Array.from(E7),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return n.prototype.update=function(l){if(this.finished)throw new Error("Attempted to update an already finished hash.");var h=0,m=l.byteLength;if(this.bytesHashed+=m,this.bytesHashed*8>M7)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;m>0;)this.buffer[this.bufferLength++]=l[h++],m--,this.bufferLength===Mo&&(this.hashBuffer(),this.bufferLength=0)},n.prototype.digest=function(){if(!this.finished){var l=this.bytesHashed*8,h=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),m=this.bufferLength;if(h.setUint8(this.bufferLength++,128),m%Mo>=Mo-8){for(var w=this.bufferLength;w<Mo;w++)h.setUint8(w,0);this.hashBuffer(),this.bufferLength=0}for(var w=this.bufferLength;w<Mo-8;w++)h.setUint8(w,0);h.setUint32(Mo-8,Math.floor(l/4294967296),!0),h.setUint32(Mo-4,l),this.hashBuffer(),this.finished=!0}for(var E=new Uint8Array(C7),w=0;w<8;w++)E[w*4]=this.state[w]>>>24&255,E[w*4+1]=this.state[w]>>>16&255,E[w*4+2]=this.state[w]>>>8&255,E[w*4+3]=this.state[w]>>>0&255;return E},n.prototype.hashBuffer=function(){for(var l=this,h=l.buffer,m=l.state,w=m[0],E=m[1],C=m[2],c=m[3],D=m[4],B=m[5],Z=m[6],X=m[7],Y=0;Y<Mo;Y++){if(Y<16)this.temp[Y]=(h[Y*4]&255)<<24|(h[Y*4+1]&255)<<16|(h[Y*4+2]&255)<<8|h[Y*4+3]&255;else{var U=this.temp[Y-2],oe=(U>>>17|U<<15)^(U>>>19|U<<13)^U>>>10;U=this.temp[Y-15];var ge=(U>>>7|U<<25)^(U>>>18|U<<14)^U>>>3;this.temp[Y]=(oe+this.temp[Y-7]|0)+(ge+this.temp[Y-16]|0)}var ye=(((D>>>6|D<<26)^(D>>>11|D<<21)^(D>>>25|D<<7))+(D&B^~D&Z)|0)+(X+(T7[Y]+this.temp[Y]|0)|0)|0,Se=((w>>>2|w<<30)^(w>>>13|w<<19)^(w>>>22|w<<10))+(w&E^w&C^E&C)|0;X=Z,Z=B,B=D,D=c+ye|0,c=C,C=E,E=w,w=ye+Se|0}m[0]+=w,m[1]+=E,m[2]+=C,m[3]+=c,m[4]+=D,m[5]+=B,m[6]+=Z,m[7]+=X},n})(),A7=(function(){function n(l){this.secret=l,this.hash=new Fg,this.reset()}return n.prototype.update=function(l){if(!(Y2(l)||this.error))try{this.hash.update(U1(l))}catch(h){this.error=h}},n.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},n.prototype.digest=function(){return w7(this,void 0,void 0,function(){return S7(this,function(l){return[2,this.digestSync()]})})},n.prototype.reset=function(){if(this.hash=new Fg,this.secret){this.outer=new Fg;var l=L7(this.secret),h=new Uint8Array(Mo);h.set(l);for(var m=0;m<Mo;m++)l[m]^=54,h[m]^=92;this.hash.update(l),this.outer.update(h);for(var m=0;m<l.byteLength;m++)l[m]=0}},n})();function L7(n){var l=U1(n);if(l.byteLength>Mo){var h=new Fg;h.update(l),l=h.digest()}var m=new Uint8Array(Mo);return m.set(l),m}var P7=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];function R7(n){if(I7(n)&&typeof n.crypto.subtle=="object"){var l=n.crypto.subtle;return z7(l)}return!1}function I7(n){if(typeof n=="object"&&typeof n.crypto=="object"){var l=n.crypto.getRandomValues;return typeof l=="function"}return!1}function z7(n){return n&&P7.every(function(l){return typeof n[l]=="function"})}var D7=(function(){function n(l){R7(Bg())?this.hash=new b7(l):this.hash=new A7(l)}return n.prototype.update=function(l,h){this.hash.update(U1(l))},n.prototype.digest=function(){return this.hash.digest()},n.prototype.reset=function(){this.hash.reset()},n})();const O7=({serviceId:n,clientVersion:l})=>async h=>{var U,oe,ge;const m=typeof window<"u"?window.navigator:void 0,w=(m==null?void 0:m.userAgent)??"",E=((U=m==null?void 0:m.userAgentData)==null?void 0:U.platform)??a3.os(w)??"other",C=void 0,c=((oe=m==null?void 0:m.userAgentData)==null?void 0:oe.brands)??[],D=c[c.length-1],B=(D==null?void 0:D.brand)??a3.browser(w)??"unknown",Z=(D==null?void 0:D.version)??"unknown",X=[["aws-sdk-js",l],["ua","2.1"],[`os/${E}`,C],["lang/js"],["md/browser",`${B}_${Z}`]];n&&X.push([`api/${n}`,l]);const Y=await((ge=h==null?void 0:h.userAgentAppId)==null?void 0:ge.call(h));return Y&&X.push([`app/${Y}`]),X},a3={os(n){if(/iPhone|iPad|iPod/.test(n))return"iOS";if(/Macintosh|Mac OS X/.test(n))return"macOS";if(/Windows NT/.test(n))return"Windows";if(/Android/.test(n))return"Android";if(/Linux/.test(n))return"Linux"},browser(n){if(/EdgiOS|EdgA|Edg\//.test(n))return"Microsoft Edge";if(/Firefox\//.test(n))return"Firefox";if(/Chrome\//.test(n))return"Chrome";if(/Safari\//.test(n))return"Safari"}},k7=n=>()=>Promise.reject(n),s3="required",za="fn",Da="argv",oc="ref",iu="url",ru="properties",au="headers",o3=!0,l3="isSet",wd="booleanEquals",tp="error",Zs="endpoint",_l="tree",$1="PartitionResult",c3={[s3]:!0,default:!1,type:"Boolean"},u3={[s3]:!1,type:"String"},h3={[oc]:"Endpoint"},Sd={[za]:wd,[Da]:[{[oc]:"UseFIPS"},!0]},Cd={[za]:wd,[Da]:[{[oc]:"UseDualStack"},!0]},lc={},Ng={[za]:"stringEquals",[Da]:[{[za]:"getAttr",[Da]:[{[oc]:$1},"name"]},"aws"]},V1={[za]:wd,[Da]:[{[oc]:"UseFIPS"},!1]},j1={[za]:wd,[Da]:[{[oc]:"UseDualStack"},!1]},d3={[iu]:"https://places.geo.{Region}.{PartitionResult#dnsSuffix}/v2",[ru]:{},[au]:{}},f3={[iu]:"https://places.geo-fips.{Region}.{PartitionResult#dualStackDnsSuffix}/v2",[ru]:{},[au]:{}},p3={[iu]:"https://places.geo-fips.{Region}.{PartitionResult#dnsSuffix}/v2",[ru]:{},[au]:{}},m3={[iu]:"https://places.geo.{Region}.{PartitionResult#dualStackDnsSuffix}/v2",[ru]:{},[au]:{}},Ug={[za]:"stringEquals",[Da]:[{[za]:"getAttr",[Da]:[{[oc]:$1},"name"]},"aws-us-gov"]},g3={[za]:"getAttr",[Da]:[{[oc]:$1},"supportsFIPS"]},y3={[za]:wd,[Da]:[!0,{[za]:"getAttr",[Da]:[{[oc]:$1},"supportsDualStack"]}]},_3=[{[oc]:"Region"}],B7={parameters:{UseDualStack:c3,UseFIPS:c3,Endpoint:u3,Region:u3},rules:[{conditions:[{[za]:l3,[Da]:[h3]}],rules:[{conditions:[Sd],error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:tp},{rules:[{conditions:[Cd],error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:tp},{endpoint:{[iu]:h3,[ru]:lc,[au]:lc},type:Zs}],type:_l}],type:_l},{rules:[{conditions:[{[za]:l3,[Da]:_3}],rules:[{conditions:[{[za]:"aws.partition",[Da]:_3,assign:$1}],rules:[{conditions:[Ng,V1,j1],endpoint:d3,type:Zs},{conditions:[Ng,Sd,Cd],endpoint:f3,type:Zs},{conditions:[Ng,Sd,j1],endpoint:p3,type:Zs},{conditions:[Ng,V1,Cd],endpoint:m3,type:Zs},{conditions:[Ug,V1,j1],endpoint:d3,type:Zs},{conditions:[Ug,Sd,Cd],endpoint:f3,type:Zs},{conditions:[Ug,Sd,j1],endpoint:p3,type:Zs},{conditions:[Ug,V1,Cd],endpoint:m3,type:Zs},{conditions:[Sd,Cd],rules:[{conditions:[{[za]:wd,[Da]:[o3,g3]},y3],rules:[{endpoint:{[iu]:"https://geo-places-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",[ru]:lc,[au]:lc},type:Zs}],type:_l},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:tp}],type:_l},{conditions:[Sd,j1],rules:[{conditions:[{[za]:wd,[Da]:[g3,o3]}],rules:[{endpoint:{[iu]:"https://geo-places-fips.{Region}.{PartitionResult#dnsSuffix}",[ru]:lc,[au]:lc},type:Zs}],type:_l},{error:"FIPS is enabled but this partition does not support FIPS",type:tp}],type:_l},{conditions:[V1,Cd],rules:[{conditions:[y3],rules:[{endpoint:{[iu]:"https://geo-places.{Region}.{PartitionResult#dualStackDnsSuffix}",[ru]:lc,[au]:lc},type:Zs}],type:_l},{error:"DualStack is enabled but this partition does not support DualStack",type:tp}],type:_l},{endpoint:{[iu]:"https://geo-places.{Region}.{PartitionResult#dnsSuffix}",[ru]:lc,[au]:lc},type:Zs}],type:_l}],type:_l},{error:"Invalid Configuration: Missing Region",type:tp}],type:_l}]},F7=new Yb({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),N7=(n,l={})=>F7.get(n,()=>c6(B7,{endpointParams:n,logger:l.logger}));Ag.aws=wv;const U7=n=>({apiVersion:"2020-11-19",base64Decoder:(n==null?void 0:n.base64Decoder)??E2,base64Encoder:(n==null?void 0:n.base64Encoder)??nv,disableHostPrefix:(n==null?void 0:n.disableHostPrefix)??!1,endpointProvider:(n==null?void 0:n.endpointProvider)??N7,extensions:(n==null?void 0:n.extensions)??[],httpAuthSchemeProvider:(n==null?void 0:n.httpAuthSchemeProvider)??f7,httpAuthSchemes:(n==null?void 0:n.httpAuthSchemes)??[{schemeId:"aws.auth#sigv4",identityProvider:l=>l.getIdentityProvider("aws.auth#sigv4"),signer:new y6}],logger:(n==null?void 0:n.logger)??new $v,serviceId:(n==null?void 0:n.serviceId)??"Geo Places",urlParser:(n==null?void 0:n.urlParser)??Pg,utf8Decoder:(n==null?void 0:n.utf8Decoder)??Kf,utf8Encoder:(n==null?void 0:n.utf8Encoder)??M2}),$7=["in-region","cross-region","mobile","standard","legacy"],V7=({defaultsMode:n}={})=>_6(async()=>{const l=typeof n=="function"?await n():n;switch(l==null?void 0:l.toLowerCase()){case"auto":return Promise.resolve(j7()?"mobile":"standard");case"mobile":case"in-region":case"cross-region":case"standard":case"legacy":return Promise.resolve(l==null?void 0:l.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${$7.join(", ")}, got ${l}`)}}),j7=()=>{var l;const n=window==null?void 0:window.navigator;if(n!=null&&n.connection){const{effectiveType:h,rtt:m,downlink:w}=n==null?void 0:n.connection;if(typeof h=="string"&&h!=="4g"||Number(m)>100||Number(w)<10)return!0}return((l=n==null?void 0:n.userAgentData)==null?void 0:l.mobile)||typeof(n==null?void 0:n.maxTouchPoints)=="number"&&(n==null?void 0:n.maxTouchPoints)>1},Z7=n=>{const l=V7(n),h=()=>l().then(K6),m=U7(n);return{...m,...n,runtime:"browser",defaultsMode:l,bodyLengthChecker:(n==null?void 0:n.bodyLengthChecker)??q6,credentialDefaultProvider:(n==null?void 0:n.credentialDefaultProvider)??(w=>()=>Promise.reject(new Error("Credential is missing"))),defaultUserAgentProvider:(n==null?void 0:n.defaultUserAgentProvider)??O7({serviceId:m.serviceId,clientVersion:g7.version}),maxAttempts:(n==null?void 0:n.maxAttempts)??Og,region:(n==null?void 0:n.region)??k7("Region is missing"),requestHandler:L2.create((n==null?void 0:n.requestHandler)??h),retryMode:(n==null?void 0:n.retryMode)??(async()=>(await h()).retryMode||B8),sha256:(n==null?void 0:n.sha256)??D7,streamCollector:(n==null?void 0:n.streamCollector)??Pb,useDualstackEndpoint:(n==null?void 0:n.useDualstackEndpoint)??(()=>Promise.resolve(v8)),useFipsEndpoint:(n==null?void 0:n.useFipsEndpoint)??(()=>Promise.resolve(x8))}},G7=n=>({setRegion(l){n.region=l},region(){return n.region}}),q7=n=>({region:n.region()}),H7=n=>{const l=n.httpAuthSchemes;let h=n.httpAuthSchemeProvider,m=n.credentials;return{setHttpAuthScheme(w){const E=l.findIndex(C=>C.schemeId===w.schemeId);E===-1?l.push(w):l.splice(E,1,w)},httpAuthSchemes(){return l},setHttpAuthSchemeProvider(w){h=w},httpAuthSchemeProvider(){return h},setCredentials(w){m=w},credentials(){return m}}},X7=n=>({httpAuthSchemes:n.httpAuthSchemes(),httpAuthSchemeProvider:n.httpAuthSchemeProvider(),credentials:n.credentials()}),Y7=(n,l)=>{const h=Object.assign(G7(n),i8(n),eb(n),H7(n));return l.forEach(m=>m.configure(h)),Object.assign(n,q7(h),r8(h),tb(h),X7(h))};class Q7 extends H6{constructor(...[h]){const m=Z7(h||{});super(m);st(this,"config");this.initConfig=m;const w=m7(m),E=Xb(w),C=n7(E),c=b8(C),D=c,B=k8(D),Z=p7(B),X=Y7(Z,(h==null?void 0:h.extensions)||[]);this.config=X,this.middlewareStack.use(_8(this.config)),this.middlewareStack.use(c7(this.config)),this.middlewareStack.use(C8(this.config)),this.middlewareStack.use(ab(this.config)),this.middlewareStack.use(lb(this.config)),this.middlewareStack.use(hb(this.config)),this.middlewareStack.use(gb(this.config,{httpAuthSchemeParametersProvider:h7,identityProviderConfigProvider:async Y=>new jb({"aws.auth#sigv4":Y.credentials})})),this.middlewareStack.use(Cb(this.config))}destroy(){super.destroy()}}class Td extends Jf{constructor(l){super(l),Object.setPrototypeOf(this,Td.prototype)}}class Q2 extends Td{constructor(h){super({name:"AccessDeniedException",$fault:"client",...h});st(this,"name","AccessDeniedException");st(this,"$fault","client");st(this,"Message");Object.setPrototypeOf(this,Q2.prototype),this.Message=h.Message}}class W2 extends Td{constructor(h){super({name:"InternalServerException",$fault:"server",...h});st(this,"name","InternalServerException");st(this,"$fault","server");st(this,"$retryable",{});st(this,"Message");Object.setPrototypeOf(this,W2.prototype),this.Message=h.Message}}class K2 extends Td{constructor(h){super({name:"ThrottlingException",$fault:"client",...h});st(this,"name","ThrottlingException");st(this,"$fault","client");st(this,"$retryable",{});st(this,"Message");Object.setPrototypeOf(this,K2.prototype),this.Message=h.Message}}class J2 extends Td{constructor(h){super({name:"ValidationException",$fault:"client",...h});st(this,"name","ValidationException");st(this,"$fault","client");st(this,"Message");st(this,"Reason");st(this,"FieldList");Object.setPrototypeOf(this,J2.prototype),this.Message=h.Message,this.Reason=h.Reason,this.FieldList=h.FieldList}}const Z1=n=>({...n,...n.Position&&{Position:lt}}),np=n=>({...n,...n.Id&&{Id:lt},...n.Name&&{Name:lt},...n.LocalizedName&&{LocalizedName:lt},...n.Primary&&{Primary:lt}}),v3=n=>({...n,...n.Restricted&&{Restricted:lt},...n.Categories&&{Categories:n.Categories.map(l=>np(l))}}),W7=n=>({...n,...n.Code2&&{Code2:lt},...n.Code3&&{Code3:lt},...n.Name&&{Name:lt}}),K7=n=>({...n,...n.Code&&{Code:lt},...n.Name&&{Name:lt}}),J7=n=>({...n,...n.Number&&{Number:lt}}),e9=n=>({...n,...n.BaseName&&{BaseName:lt},...n.Type&&{Type:lt},...n.Prefix&&{Prefix:lt},...n.Suffix&&{Suffix:lt},...n.Direction&&{Direction:lt}}),t9=n=>({...n,...n.Code&&{Code:lt},...n.Name&&{Name:lt}}),ip=n=>({...n,...n.Label&&{Label:lt},...n.Country&&{Country:W7(n.Country)},...n.Region&&{Region:K7(n.Region)},...n.SubRegion&&{SubRegion:t9(n.SubRegion)},...n.Locality&&{Locality:lt},...n.District&&{District:lt},...n.SubDistrict&&{SubDistrict:lt},...n.PostalCode&&{PostalCode:lt},...n.Block&&{Block:lt},...n.SubBlock&&{SubBlock:lt},...n.Street&&{Street:lt},...n.StreetComponents&&{StreetComponents:n.StreetComponents.map(l=>e9(l))},...n.AddressNumber&&{AddressNumber:lt},...n.Building&&{Building:lt},...n.SecondaryAddressComponents&&{SecondaryAddressComponents:n.SecondaryAddressComponents.map(l=>J7(l))}}),cc=n=>({...n,...n.Value&&{Value:lt},...n.Preferred&&{Preferred:lt}}),n9=n=>({...n,...n.Country&&{Country:n.Country.map(l=>cc(l))},...n.Region&&{Region:n.Region.map(l=>cc(l))},...n.SubRegion&&{SubRegion:n.SubRegion.map(l=>cc(l))},...n.Locality&&{Locality:n.Locality.map(l=>cc(l))},...n.District&&{District:n.District.map(l=>cc(l))},...n.SubDistrict&&{SubDistrict:n.SubDistrict.map(l=>cc(l))},...n.Block&&{Block:n.Block.map(l=>cc(l))},...n.SubBlock&&{SubBlock:n.SubBlock.map(l=>cc(l))},...n.Street&&{Street:n.Street.map(l=>cc(l))}}),i9=n=>({...n,...n.BoundingBox&&{BoundingBox:lt},...n.Circle&&{Circle:lt},...n.IncludeCountries&&{IncludeCountries:lt}}),r9=n=>({...n,...n.QueryText&&{QueryText:lt},...n.BiasPosition&&{BiasPosition:lt},...n.Filter&&{Filter:i9(n.Filter)},...n.PoliticalView&&{PoliticalView:lt},...n.Key&&{Key:lt}}),Mr=n=>({...n,...n.Value&&{Value:lt}}),a9=n=>({...n,...n.Code&&{Code:n.Code.map(l=>Mr(l))},...n.Name&&{Name:n.Name.map(l=>Mr(l))}}),s9=n=>({...n,...n.Code&&{Code:n.Code.map(l=>Mr(l))},...n.Name&&{Name:n.Name.map(l=>Mr(l))}}),o9=n=>({...n,...n.Code&&{Code:n.Code.map(l=>Mr(l))},...n.Name&&{Name:n.Name.map(l=>Mr(l))}}),l9=n=>({...n,...n.Label&&{Label:n.Label.map(l=>Mr(l))},...n.Country&&{Country:a9(n.Country)},...n.Region&&{Region:s9(n.Region)},...n.SubRegion&&{SubRegion:o9(n.SubRegion)},...n.Locality&&{Locality:n.Locality.map(l=>Mr(l))},...n.District&&{District:n.District.map(l=>Mr(l))},...n.SubDistrict&&{SubDistrict:n.SubDistrict.map(l=>Mr(l))},...n.Street&&{Street:n.Street.map(l=>Mr(l))},...n.Block&&{Block:n.Block.map(l=>Mr(l))},...n.SubBlock&&{SubBlock:n.SubBlock.map(l=>Mr(l))},...n.Intersection&&{Intersection:n.Intersection.map(l=>l.map(h=>Mr(h)))},...n.PostalCode&&{PostalCode:n.PostalCode.map(l=>Mr(l))},...n.AddressNumber&&{AddressNumber:n.AddressNumber.map(l=>Mr(l))},...n.Building&&{Building:n.Building.map(l=>Mr(l))}}),c9=n=>({...n,...n.Title&&{Title:n.Title.map(l=>Mr(l))},...n.Address&&{Address:l9(n.Address)}}),u9=n=>({...n,...n.PlaceId&&{PlaceId:lt},...n.PlaceType&&{PlaceType:lt},...n.Title&&{Title:lt},...n.Address&&{Address:ip(n.Address)},...n.Distance&&{Distance:lt},...n.PoliticalView&&{PoliticalView:lt},...n.Highlights&&{Highlights:c9(n.Highlights)}}),h9=n=>({...n,...n.ResultItems&&{ResultItems:n.ResultItems.map(l=>u9(l))}}),x3=n=>({...n,...n.Name&&{Name:lt},...n.Id&&{Id:lt}}),$g=n=>({...n,...n.Label&&{Label:lt},...n.Value&&{Value:lt},...n.Categories&&{Categories:n.Categories.map(l=>np(l))}}),d9=n=>({...n,...n.Phones&&{Phones:n.Phones.map(l=>$g(l))},...n.Faxes&&{Faxes:n.Faxes.map(l=>$g(l))},...n.Websites&&{Websites:n.Websites.map(l=>$g(l))},...n.Emails&&{Emails:n.Emails.map(l=>$g(l))}}),ey=n=>({...n,...n.LocalizedName&&{LocalizedName:lt},...n.Id&&{Id:lt},...n.Primary&&{Primary:lt}}),f9=n=>({...n,...n.PlaceId&&{PlaceId:lt},...n.Title&&{Title:lt},...n.Address&&{Address:ip(n.Address)},...n.Position&&{Position:lt},...n.Distance&&{Distance:lt},...n.RouteDistance&&{RouteDistance:lt},...n.MapView&&{MapView:lt},...n.AccessPoints&&{AccessPoints:n.AccessPoints.map(l=>Z1(l))}}),b3=n=>({...n,...n.PlaceId&&{PlaceId:lt},...n.PlaceType&&{PlaceType:lt},...n.Title&&{Title:lt},...n.Address&&{Address:ip(n.Address)},...n.Position&&{Position:lt},...n.AccessPoints&&{AccessPoints:n.AccessPoints.map(l=>Z1(l))}}),p9=n=>({...n,...n.ZipClassificationCode&&{ZipClassificationCode:lt}}),m9=n=>({...n,...n.RecordTypeCode&&{RecordTypeCode:lt}}),w3=n=>({...n,...n.PostalCode&&{PostalCode:lt},...n.PostalAuthority&&{PostalAuthority:lt},...n.PostalCodeType&&{PostalCodeType:lt},...n.UspsZip&&{UspsZip:p9(n.UspsZip)},...n.UspsZipPlus4&&{UspsZipPlus4:m9(n.UspsZipPlus4)}}),ty=n=>({...n,...n.Name&&{Name:lt},...n.Offset&&{Offset:lt},...n.OffsetSeconds&&{OffsetSeconds:lt}}),g9=n=>({...n,...n.PlaceId&&{PlaceId:lt},...n.PoliticalView&&{PoliticalView:lt},...n.Key&&{Key:lt}}),y9=n=>({...n,...n.OpenTime&&{OpenTime:lt},...n.OpenDuration&&{OpenDuration:lt},...n.Recurrence&&{Recurrence:lt}}),_9=n=>({...n,...n.Display&&{Display:lt},...n.OpenNow&&{OpenNow:lt},...n.Components&&{Components:n.Components.map(l=>y9(l))},...n.Categories&&{Categories:n.Categories.map(l=>np(l))}}),S3=n=>({...n,...n.Title&&{Title:n.Title.map(l=>cc(l))},...n.Address&&{Address:n9(n.Address)}}),v9=n=>({...n,...n.PlaceId&&{PlaceId:lt},...n.PlaceType&&{PlaceType:lt},...n.Title&&{Title:lt},...n.Address&&{Address:ip(n.Address)},...n.AddressNumberCorrected&&{AddressNumberCorrected:lt},...n.PostalCodeDetails&&{PostalCodeDetails:n.PostalCodeDetails.map(l=>w3(l))},...n.Position&&{Position:lt},...n.MapView&&{MapView:lt},...n.Categories&&{Categories:n.Categories.map(l=>np(l))},...n.FoodTypes&&{FoodTypes:n.FoodTypes.map(l=>ey(l))},...n.BusinessChains&&{BusinessChains:n.BusinessChains.map(l=>x3(l))},...n.Contacts&&{Contacts:d9(n.Contacts)},...n.OpeningHours&&{OpeningHours:n.OpeningHours.map(l=>_9(l))},...n.AccessPoints&&{AccessPoints:n.AccessPoints.map(l=>Z1(l))},...n.AccessRestrictions&&{AccessRestrictions:n.AccessRestrictions.map(l=>v3(l))},...n.TimeZone&&{TimeZone:ty(n.TimeZone)},...n.PoliticalView&&{PoliticalView:lt},...n.Phonemes&&{Phonemes:S3(n.Phonemes)},...n.MainAddress&&{MainAddress:b3(n.MainAddress)},...n.SecondaryAddresses&&{SecondaryAddresses:n.SecondaryAddresses.map(l=>b3(l))}}),x9=n=>({...n,...n.QueryPosition&&{QueryPosition:lt},...n.QueryRadius&&{QueryRadius:lt},...n.PoliticalView&&{PoliticalView:lt},...n.Key&&{Key:lt}}),b9=n=>({...n,...n.PlaceId&&{PlaceId:lt},...n.PlaceType&&{PlaceType:lt},...n.Title&&{Title:lt},...n.Address&&{Address:ip(n.Address)},...n.AddressNumberCorrected&&{AddressNumberCorrected:lt},...n.PostalCodeDetails&&{PostalCodeDetails:n.PostalCodeDetails.map(l=>w3(l))},...n.Position&&{Position:lt},...n.Distance&&{Distance:lt},...n.MapView&&{MapView:lt},...n.Categories&&{Categories:n.Categories.map(l=>np(l))},...n.FoodTypes&&{FoodTypes:n.FoodTypes.map(l=>ey(l))},...n.AccessPoints&&{AccessPoints:n.AccessPoints.map(l=>Z1(l))},...n.TimeZone&&{TimeZone:ty(n.TimeZone)},...n.PoliticalView&&{PoliticalView:lt},...n.Intersections&&{Intersections:n.Intersections.map(l=>f9(l))}}),w9=n=>({...n,...n.ResultItems&&{ResultItems:n.ResultItems.map(l=>b9(l))}}),S9=n=>({...n,...n.BoundingBox&&{BoundingBox:lt},...n.Circle&&{Circle:lt},...n.IncludeCountries&&{IncludeCountries:lt}}),C9=n=>({...n,...n.QueryText&&{QueryText:lt},...n.BiasPosition&&{BiasPosition:lt},...n.Filter&&{Filter:S9(n.Filter)},...n.PoliticalView&&{PoliticalView:lt},...n.Key&&{Key:lt}}),T9=n=>({...n,...n.RefinedTerm&&{RefinedTerm:lt},...n.OriginalTerm&&{OriginalTerm:lt}}),E9=n=>({...n,...n.Label&&{Label:n.Label.map(l=>Mr(l))}}),M9=n=>({...n,...n.Title&&{Title:n.Title.map(l=>Mr(l))},...n.Address&&{Address:E9(n.Address)}}),A9=n=>({...n,...n.PlaceId&&{PlaceId:lt},...n.PlaceType&&{PlaceType:lt},...n.Address&&{Address:ip(n.Address)},...n.Position&&{Position:lt},...n.Distance&&{Distance:lt},...n.MapView&&{MapView:lt},...n.Categories&&{Categories:n.Categories.map(l=>np(l))},...n.FoodTypes&&{FoodTypes:n.FoodTypes.map(l=>ey(l))},...n.BusinessChains&&{BusinessChains:n.BusinessChains.map(l=>x3(l))},...n.AccessPoints&&{AccessPoints:n.AccessPoints.map(l=>Z1(l))},...n.AccessRestrictions&&{AccessRestrictions:n.AccessRestrictions.map(l=>v3(l))},...n.TimeZone&&{TimeZone:ty(n.TimeZone)},...n.PoliticalView&&{PoliticalView:lt},...n.Phonemes&&{Phonemes:S3(n.Phonemes)}}),L9=n=>({...n,...n.QueryId&&{QueryId:lt}}),P9=n=>({...n,...n.Title&&{Title:lt},...n.Place&&{Place:A9(n.Place)},...n.Query&&{Query:L9(n.Query)},...n.Highlights&&{Highlights:M9(n.Highlights)}}),R9=n=>({...n,...n.ResultItems&&{ResultItems:n.ResultItems.map(l=>P9(l))},...n.QueryRefinements&&{QueryRefinements:n.QueryRefinements.map(l=>T9(l))}}),I9=async(n,l)=>{const h=Mg(n,l),m={"content-type":"application/json"};h.bp("/autocomplete");const w=Eo({[Hg]:[,n[Gg]]});let E;return E=JSON.stringify(xr(n,{AdditionalFeatures:C=>zn(C),BiasPosition:C=>jg(C),Filter:C=>G9(C),IntendedUse:[],Language:[],MaxResults:[],PoliticalView:[],PostalCodeMode:[],QueryText:[]})),h.m("POST").h(m).q(w).b(E),h.build()},z9=async(n,l)=>{const h=Mg(n,l),m={};h.bp("/place/{PlaceId}"),h.p("PlaceId",()=>n.PlaceId,"{PlaceId}",!1);const w=Eo({[lw]:[()=>n.AdditionalFeatures!==void 0,()=>n[rw]||[]],[uw]:[,n[sw]],[hw]:[,n[ow]],[cw]:[,n[aw]],[Hg]:[,n[Gg]]});return h.m("GET").h(m).q(w).b(void 0),h.build()},D9=async(n,l)=>{const h=Mg(n,l),m={"content-type":"application/json"};h.bp("/reverse-geocode");const w=Eo({[Hg]:[,n[Gg]]});let E;return E=JSON.stringify(xr(n,{AdditionalFeatures:C=>zn(C),Filter:C=>zn(C),IntendedUse:[],Language:[],MaxResults:[],PoliticalView:[],QueryPosition:C=>jg(C),QueryRadius:[]})),h.m("POST").h(m).q(w).b(E),h.build()},O9=async(n,l)=>{const h=Mg(n,l),m={"content-type":"application/json"};h.bp("/suggest");const w=Eo({[Hg]:[,n[Gg]]});let E;return E=JSON.stringify(xr(n,{AdditionalFeatures:C=>zn(C),BiasPosition:C=>jg(C),Filter:C=>q9(C),IntendedUse:[],Language:[],MaxQueryRefinements:[],MaxResults:[],PoliticalView:[],QueryText:[]})),h.m("POST").h(m).q(w).b(E),h.build()},k9=async(n,l)=>{if(n.statusCode!==200&&n.statusCode>=300)return Vg(n,l);const h=Eo({$metadata:hh(n),[qg]:[,n.headers[Xg]]}),m=Sg(Cg(await N1(n.body,l)),"body"),w=xr(m,{ResultItems:zn});return Object.assign(h,w),h},B9=async(n,l)=>{if(n.statusCode!==200&&n.statusCode>=300)return Vg(n,l);const h=Eo({$metadata:hh(n),[qg]:[,n.headers[Xg]]}),m=Sg(Cg(await N1(n.body,l)),"body"),w=xr(m,{AccessPoints:E=>G1(E),AccessRestrictions:zn,Address:zn,AddressNumberCorrected:sv,BusinessChains:zn,Categories:zn,Contacts:zn,FoodTypes:zn,MainAddress:E=>E3(E),MapView:E=>Zg(E),OpeningHours:zn,Phonemes:zn,PlaceId:Fi,PlaceType:Fi,PoliticalView:Fi,Position:E=>rp(E),PostalCodeDetails:zn,SecondaryAddresses:E=>Q9(E),TimeZone:zn,Title:Fi});return Object.assign(h,w),h},F9=async(n,l)=>{if(n.statusCode!==200&&n.statusCode>=300)return Vg(n,l);const h=Eo({$metadata:hh(n),[qg]:[,n.headers[Xg]]}),m=Sg(Cg(await N1(n.body,l)),"body"),w=xr(m,{ResultItems:E=>K9(E)});return Object.assign(h,w),h},N9=async(n,l)=>{if(n.statusCode!==200&&n.statusCode>=300)return Vg(n,l);const h=Eo({$metadata:hh(n),[qg]:[,n.headers[Xg]]}),m=Sg(Cg(await N1(n.body,l)),"body"),w=xr(m,{QueryRefinements:zn,ResultItems:E=>tw(E)});return Object.assign(h,w),h},Vg=async(n,l)=>{const h={...n,body:await l8(n.body,l)},m=c8(n,h.body);switch(m){case"AccessDeniedException":case"com.amazonaws.geoplaces#AccessDeniedException":throw await $9(h);case"InternalServerException":case"com.amazonaws.geoplaces#InternalServerException":throw await V9(h);case"ThrottlingException":case"com.amazonaws.geoplaces#ThrottlingException":throw await j9(h);case"ValidationException":case"com.amazonaws.geoplaces#ValidationException":throw await Z9(h);default:const w=h.body;return U9({output:n,parsedBody:w,errorCode:m})}},U9=Q6(Td),$9=async(n,l)=>{const h=Eo({}),m=n.body,w=xr(m,{Message:[,Fi,"message"]});Object.assign(h,w);const E=new Q2({$metadata:hh(n),...h});return F1(E,n.body)},V9=async(n,l)=>{const h=Eo({}),m=n.body,w=xr(m,{Message:[,Fi,"message"]});Object.assign(h,w);const E=new W2({$metadata:hh(n),...h});return F1(E,n.body)},j9=async(n,l)=>{const h=Eo({}),m=n.body,w=xr(m,{Message:[,Fi,"message"]});Object.assign(h,w);const E=new K2({$metadata:hh(n),...h});return F1(E,n.body)},Z9=async(n,l)=>{const h=Eo({}),m=n.body,w=xr(m,{FieldList:[,C=>iw(C),"fieldList"],Message:[,Fi,"message"],Reason:[,Fi,"reason"]});Object.assign(h,w);const E=new J2({$metadata:hh(n),...h});return F1(E,n.body)},G9=(n,l)=>xr(n,{BoundingBox:h=>C3(h),Circle:h=>T3(h),IncludeCountries:zn,IncludePlaceTypes:zn}),C3=(n,l)=>n.filter(h=>h!=null).map(h=>jv(h)),T3=(n,l)=>xr(n,{Center:h=>jg(h),Radius:[]}),jg=(n,l)=>n.filter(h=>h!=null).map(h=>jv(h)),q9=(n,l)=>xr(n,{BoundingBox:h=>C3(h),Circle:h=>T3(h),IncludeCountries:zn}),H9=(n,l)=>xr(n,{Position:h=>rp(h)}),G1=(n,l)=>(n||[]).filter(m=>m!=null).map(m=>H9(m)),Zg=(n,l)=>(n||[]).filter(m=>m!=null).map(m=>ov(m)),X9=(n,l)=>xr(n,{AccessPoints:h=>G1(h),Address:zn,Distance:wg,MapView:h=>Zg(h),PlaceId:Fi,Position:h=>rp(h),RouteDistance:wg,Title:Fi}),Y9=(n,l)=>(n||[]).filter(m=>m!=null).map(m=>X9(m)),rp=(n,l)=>(n||[]).filter(m=>m!=null).map(m=>ov(m)),E3=(n,l)=>xr(n,{AccessPoints:h=>G1(h),Address:zn,PlaceId:Fi,PlaceType:Fi,Position:h=>rp(h),Title:Fi}),Q9=(n,l)=>(n||[]).filter(m=>m!=null).map(m=>E3(m)),W9=(n,l)=>xr(n,{AccessPoints:h=>G1(h),Address:zn,AddressNumberCorrected:sv,Categories:zn,Distance:wg,FoodTypes:zn,Intersections:h=>Y9(h),MapView:h=>Zg(h),PlaceId:Fi,PlaceType:Fi,PoliticalView:Fi,Position:h=>rp(h),PostalCodeDetails:zn,TimeZone:zn,Title:Fi}),K9=(n,l)=>(n||[]).filter(m=>m!=null).map(m=>W9(m)),J9=(n,l)=>xr(n,{AccessPoints:h=>G1(h),AccessRestrictions:zn,Address:zn,BusinessChains:zn,Categories:zn,Distance:wg,FoodTypes:zn,MapView:h=>Zg(h),Phonemes:zn,PlaceId:Fi,PlaceType:Fi,PoliticalView:Fi,Position:h=>rp(h),TimeZone:zn}),ew=(n,l)=>xr(n,{Highlights:zn,Place:h=>J9(h),Query:zn,SuggestResultItemType:Fi,Title:Fi}),tw=(n,l)=>(n||[]).filter(m=>m!=null).map(m=>ew(m)),nw=(n,l)=>xr(n,{Message:[,Fi,"message"],Name:[,Fi,"name"]}),iw=(n,l)=>(n||[]).filter(m=>m!=null).map(m=>nw(m)),hh=n=>({httpStatusCode:n.statusCode,requestId:n.headers["x-amzn-requestid"]??n.headers["x-amzn-request-id"]??n.headers["x-amz-request-id"],extendedRequestId:n.headers["x-amz-id-2"],cfId:n.headers["x-amz-cf-id"]}),rw="AdditionalFeatures",aw="IntendedUse",Gg="Key",sw="Language",qg="PricingBucket",ow="PoliticalView",lw="additional-features",cw="intended-use",Hg="key",uw="language",hw="political-view",Xg="x-amz-geo-pricing-bucket";class dw extends B1.classBuilder().ep(kg).m(function(l,h,m,w){return[xg(m,this.serialize,this.deserialize),Dg(m,l.getEndpointParameterInstructions())]}).s("PlacesService","Autocomplete",{}).n("GeoPlacesClient","AutocompleteCommand").f(r9,h9).ser(I9).de(k9).build(){}class fw extends B1.classBuilder().ep(kg).m(function(l,h,m,w){return[xg(m,this.serialize,this.deserialize),Dg(m,l.getEndpointParameterInstructions())]}).s("PlacesService","GetPlace",{}).n("GeoPlacesClient","GetPlaceCommand").f(g9,v9).ser(z9).de(B9).build(){}class pw extends B1.classBuilder().ep(kg).m(function(l,h,m,w){return[xg(m,this.serialize,this.deserialize),Dg(m,l.getEndpointParameterInstructions())]}).s("PlacesService","ReverseGeocode",{}).n("GeoPlacesClient","ReverseGeocodeCommand").f(x9,w9).ser(D9).de(F9).build(){}class mw extends B1.classBuilder().ep(kg).m(function(l,h,m,w){return[xg(m,this.serialize,this.deserialize),Dg(m,l.getEndpointParameterInstructions())]}).s("PlacesService","Suggest",{}).n("GeoPlacesClient","SuggestCommand").f(C9,R9).ser(O9).de(N9).build(){}function gw(n,l){const h={signer:{sign:async m=>{var w;return m.query=Object.assign({key:n},(w=m.query)!==null&&w!==void 0?w:{}),m}},credentials:(async()=>({}))};return l&&(h.region=l),{getLocationClientConfig:()=>h,getClientConfig:()=>h}}let M3;const yw=(n,l)=>(M3=gw(n,l),new Q7({...M3.getClientConfig(),customUserAgent:"aws-geo-client-src/1.0+AddressForm"})),_w=async(n,l)=>{const h=new dw(l);return await n.send(h)},vw=async(n,l)=>{const h=new mw(l);return await n.send(h)},xw=async(n,l)=>{const h=new fw(l);return await n.send(h)},bw=async(n,l)=>{const h=new pw(l);return await n.send(h)},ww=new Ux({defaultOptions:{queries:{staleTime:1800*1e3}}});function Sw({apiKey:n,region:l,children:h,client:m}){const w=te.useMemo(()=>{if(!n||!l)throw new Error("Please provide both `apiKey` and `region` props to <AmazonLocationProvider> component.");return{apiKey:n,region:l,client:m||yw(n,l)}},[n,l,m]);return gt.jsx(K_.Provider,{value:w,children:gt.jsx($x,{client:ww,children:h})})}var la=P_();const Cw=({selector:n,replacements:l})=>{const[h,m]=te.useState([]),w=te.useRef(l);return w.current=l,te.useEffect(()=>{const E=document.querySelector(n);if(!E){m([]);return}const C=w.current.map(({selector:c,component:D})=>{var Y;const B=E.querySelector(c);if(!B)return null;const Z=document.createElement("div");(Y=B.parentElement)==null||Y.insertBefore(Z,B);const X=B.cloneNode(!0);return B.remove(),{container:Z,component:D,originalElement:X}}).filter(Boolean);return m(C),()=>{C.forEach(({container:c})=>{c.remove()})}},[n]),gt.jsx(gt.Fragment,{children:h.map(({container:E,component:C,originalElement:c},D)=>la.createPortal(C(c),E,D))})};function A3(n){var l,h,m="";if(typeof n=="string"||typeof n=="number")m+=n;else if(typeof n=="object")if(Array.isArray(n)){var w=n.length;for(l=0;l<w;l++)n[l]&&(h=A3(n[l]))&&(m&&(m+=" "),m+=h)}else for(h in n)n[h]&&(m&&(m+=" "),m+=h);return m}function ny(){for(var n,l,h=0,m="",w=arguments.length;h<w;h++)(n=arguments[h])&&(l=A3(n))&&(m&&(m+=" "),m+=l);return m}const Tw=(n,l,h)=>n&&l?[l]:h;var Ew="wj05t11 wj05t10",Mw="wj05t12 wj05t10",Aw="wj05t13",Lw="wj05t14";const L3=typeof document<"u"?Fn.useLayoutEffect:()=>{};var iy;const Pw=(iy=Fn.useInsertionEffect)!==null&&iy!==void 0?iy:L3;function Rw(n){const l=te.useRef(null);return Pw(()=>{l.current=n},[n]),te.useCallback((...h)=>{const m=l.current;return m==null?void 0:m(...h)},[])}const dh=n=>{var l;return(l=n==null?void 0:n.ownerDocument)!==null&&l!==void 0?l:document},Ed=n=>n&&"window"in n&&n.window===n?n:dh(n).defaultView||window;function Iw(n){return n!==null&&typeof n=="object"&&"nodeType"in n&&typeof n.nodeType=="number"}function zw(n){return Iw(n)&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in n}let Dw=!1;function ry(){return Dw}function P3(n,l){if(!ry())return l&&n?n.contains(l):!1;if(!n||!l)return!1;let h=l;for(;h!==null;){if(h===n)return!0;h.tagName==="SLOT"&&h.assignedSlot?h=h.assignedSlot.parentNode:zw(h)?h=h.host:h=h.parentNode}return!1}const ay=(n=document)=>{var l;if(!ry())return n.activeElement;let h=n.activeElement;for(;h&&"shadowRoot"in h&&(!((l=h.shadowRoot)===null||l===void 0)&&l.activeElement);)h=h.shadowRoot.activeElement;return h};function R3(n){return ry()&&n.target.shadowRoot&&n.composedPath?n.composedPath()[0]:n.target}function Ow(n){var l;if(typeof window>"u"||window.navigator==null)return!1;let h=(l=window.navigator.userAgentData)===null||l===void 0?void 0:l.brands;return Array.isArray(h)&&h.some(m=>n.test(m.brand))||n.test(window.navigator.userAgent)}function kw(n){var l;return typeof window<"u"&&window.navigator!=null?n.test(((l=window.navigator.userAgentData)===null||l===void 0?void 0:l.platform)||window.navigator.platform):!1}function I3(n){let l=null;return()=>(l==null&&(l=n()),l)}const Bw=I3(function(){return kw(/^Mac/i)}),Fw=I3(function(){return Ow(/Android/i)});function z3(){let n=te.useRef(new Map),l=te.useCallback((w,E,C,c)=>{let D=c!=null&&c.once?(...B)=>{n.current.delete(C),C(...B)}:C;n.current.set(C,{type:E,eventTarget:w,fn:D,options:c}),w.addEventListener(E,D,c)},[]),h=te.useCallback((w,E,C,c)=>{var D;let B=((D=n.current.get(C))===null||D===void 0?void 0:D.fn)||C;w.removeEventListener(E,B,c),n.current.delete(C)},[]),m=te.useCallback(()=>{n.current.forEach((w,E)=>{h(w.eventTarget,w.type,E,w.options)})},[h]);return te.useEffect(()=>m,[m]),{addGlobalListener:l,removeGlobalListener:h,removeAllGlobalListeners:m}}function Nw(n){return n.pointerType===""&&n.isTrusted?!0:Fw()&&n.pointerType?n.type==="click"&&n.buttons===1:n.detail===0&&!n.pointerType}function D3(n){let l=n;return l.nativeEvent=n,l.isDefaultPrevented=()=>l.defaultPrevented,l.isPropagationStopped=()=>l.cancelBubble,l.persist=()=>{},l}function Uw(n,l){Object.defineProperty(n,"target",{value:l}),Object.defineProperty(n,"currentTarget",{value:l})}function O3(n){let l=te.useRef({isFocused:!1,observer:null});L3(()=>{const m=l.current;return()=>{m.observer&&(m.observer.disconnect(),m.observer=null)}},[]);let h=Rw(m=>{n==null||n(m)});return te.useCallback(m=>{if(m.target instanceof HTMLButtonElement||m.target instanceof HTMLInputElement||m.target instanceof HTMLTextAreaElement||m.target instanceof HTMLSelectElement){l.current.isFocused=!0;let w=m.target,E=C=>{if(l.current.isFocused=!1,w.disabled){let c=D3(C);h(c)}l.current.observer&&(l.current.observer.disconnect(),l.current.observer=null)};w.addEventListener("focusout",E,{once:!0}),l.current.observer=new MutationObserver(()=>{if(l.current.isFocused&&w.disabled){var C;(C=l.current.observer)===null||C===void 0||C.disconnect();let c=w===document.activeElement?null:document.activeElement;w.dispatchEvent(new FocusEvent("blur",{relatedTarget:c})),w.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:c}))}}),l.current.observer.observe(w,{attributes:!0,attributeFilter:["disabled"]})}},[h])}let $w=!1,q1=null,sy=new Set,H1=new Map,Md=!1,oy=!1;const Vw={Tab:!0,Escape:!0};function ly(n,l){for(let h of sy)h(n,l)}function jw(n){return!(n.metaKey||!Bw()&&n.altKey||n.ctrlKey||n.key==="Control"||n.key==="Shift"||n.key==="Meta")}function Yg(n){Md=!0,jw(n)&&(q1="keyboard",ly("keyboard",n))}function ap(n){q1="pointer",(n.type==="mousedown"||n.type==="pointerdown")&&(Md=!0,ly("pointer",n))}function k3(n){Nw(n)&&(Md=!0,q1="virtual")}function B3(n){n.target===window||n.target===document||$w||!n.isTrusted||(!Md&&!oy&&(q1="virtual",ly("virtual",n)),Md=!1,oy=!1)}function F3(){Md=!1,oy=!0}function cy(n){if(typeof window>"u"||typeof document>"u"||H1.get(Ed(n)))return;const l=Ed(n),h=dh(n);let m=l.HTMLElement.prototype.focus;l.HTMLElement.prototype.focus=function(){Md=!0,m.apply(this,arguments)},h.addEventListener("keydown",Yg,!0),h.addEventListener("keyup",Yg,!0),h.addEventListener("click",k3,!0),l.addEventListener("focus",B3,!0),l.addEventListener("blur",F3,!1),typeof PointerEvent<"u"&&(h.addEventListener("pointerdown",ap,!0),h.addEventListener("pointermove",ap,!0),h.addEventListener("pointerup",ap,!0)),l.addEventListener("beforeunload",()=>{N3(n)},{once:!0}),H1.set(l,{focus:m})}const N3=(n,l)=>{const h=Ed(n),m=dh(n);l&&m.removeEventListener("DOMContentLoaded",l),H1.has(h)&&(h.HTMLElement.prototype.focus=H1.get(h).focus,m.removeEventListener("keydown",Yg,!0),m.removeEventListener("keyup",Yg,!0),m.removeEventListener("click",k3,!0),h.removeEventListener("focus",B3,!0),h.removeEventListener("blur",F3,!1),typeof PointerEvent<"u"&&(m.removeEventListener("pointerdown",ap,!0),m.removeEventListener("pointermove",ap,!0),m.removeEventListener("pointerup",ap,!0)),H1.delete(h))};function Zw(n){const l=dh(n);let h;return l.readyState!=="loading"?cy(n):(h=()=>{cy(n)},l.addEventListener("DOMContentLoaded",h)),()=>N3(n,h)}typeof document<"u"&&Zw();function U3(){return q1!=="pointer"}const Gw=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function qw(n,l,h){let m=dh(h==null?void 0:h.target);const w=typeof window<"u"?Ed(h==null?void 0:h.target).HTMLInputElement:HTMLInputElement,E=typeof window<"u"?Ed(h==null?void 0:h.target).HTMLTextAreaElement:HTMLTextAreaElement,C=typeof window<"u"?Ed(h==null?void 0:h.target).HTMLElement:HTMLElement,c=typeof window<"u"?Ed(h==null?void 0:h.target).KeyboardEvent:KeyboardEvent;return n=n||m.activeElement instanceof w&&!Gw.has(m.activeElement.type)||m.activeElement instanceof E||m.activeElement instanceof C&&m.activeElement.isContentEditable,!(n&&l==="keyboard"&&h instanceof c&&!Vw[h.key])}function Hw(n,l,h){cy(),te.useEffect(()=>{let m=(w,E)=>{qw(!!(h!=null&&h.isTextInput),w,E)&&n(U3())};return sy.add(m),()=>{sy.delete(m)}},l)}function Xw(n){let{isDisabled:l,onFocus:h,onBlur:m,onFocusChange:w}=n;const E=te.useCallback(D=>{if(D.target===D.currentTarget)return m&&m(D),w&&w(!1),!0},[m,w]),C=O3(E),c=te.useCallback(D=>{const B=dh(D.target),Z=B?ay(B):ay();D.target===D.currentTarget&&Z===R3(D.nativeEvent)&&(h&&h(D),w&&w(!0),C(D))},[w,h,C]);return{focusProps:{onFocus:!l&&(h||w||m)?c:void 0,onBlur:!l&&(m||w)?E:void 0}}}function Yw(n){let{isDisabled:l,onBlurWithin:h,onFocusWithin:m,onFocusWithinChange:w}=n,E=te.useRef({isFocusWithin:!1}),{addGlobalListener:C,removeAllGlobalListeners:c}=z3(),D=te.useCallback(X=>{X.currentTarget.contains(X.target)&&E.current.isFocusWithin&&!X.currentTarget.contains(X.relatedTarget)&&(E.current.isFocusWithin=!1,c(),h&&h(X),w&&w(!1))},[h,w,E,c]),B=O3(D),Z=te.useCallback(X=>{if(!X.currentTarget.contains(X.target))return;const Y=dh(X.target),U=ay(Y);if(!E.current.isFocusWithin&&U===R3(X.nativeEvent)){m&&m(X),w&&w(!0),E.current.isFocusWithin=!0,B(X);let oe=X.currentTarget;C(Y,"focus",ge=>{if(E.current.isFocusWithin&&!P3(oe,ge.target)){let ye=new Y.defaultView.FocusEvent("blur",{relatedTarget:ge.target});Uw(ye,oe);let Se=D3(ye);D(Se)}},{capture:!0})}},[m,w,B,C,D]);return l?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:Z,onBlur:D}}}let uy=!1,Qg=0;function Qw(){uy=!0,setTimeout(()=>{uy=!1},50)}function $3(n){n.pointerType==="touch"&&Qw()}function Ww(){if(!(typeof document>"u"))return Qg===0&&typeof PointerEvent<"u"&&document.addEventListener("pointerup",$3),Qg++,()=>{Qg--,!(Qg>0)&&typeof PointerEvent<"u"&&document.removeEventListener("pointerup",$3)}}function hy(n){let{onHoverStart:l,onHoverChange:h,onHoverEnd:m,isDisabled:w}=n,[E,C]=te.useState(!1),c=te.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;te.useEffect(Ww,[]);let{addGlobalListener:D,removeAllGlobalListeners:B}=z3(),{hoverProps:Z,triggerHoverEnd:X}=te.useMemo(()=>{let Y=(ge,ye)=>{if(c.pointerType=ye,w||ye==="touch"||c.isHovered||!ge.currentTarget.contains(ge.target))return;c.isHovered=!0;let Se=ge.currentTarget;c.target=Se,D(dh(ge.target),"pointerover",je=>{c.isHovered&&c.target&&!P3(c.target,je.target)&&U(je,je.pointerType)},{capture:!0}),l&&l({type:"hoverstart",target:Se,pointerType:ye}),h&&h(!0),C(!0)},U=(ge,ye)=>{let Se=c.target;c.pointerType="",c.target=null,!(ye==="touch"||!c.isHovered||!Se)&&(c.isHovered=!1,B(),m&&m({type:"hoverend",target:Se,pointerType:ye}),h&&h(!1),C(!1))},oe={};return typeof PointerEvent<"u"&&(oe.onPointerEnter=ge=>{uy&&ge.pointerType==="mouse"||Y(ge,ge.pointerType)},oe.onPointerLeave=ge=>{!w&&ge.currentTarget.contains(ge.target)&&U(ge,ge.pointerType)}),{hoverProps:oe,triggerHoverEnd:U}},[l,h,m,w,c,D,B]);return te.useEffect(()=>{w&&X({currentTarget:c.target},c.pointerType)},[w]),{hoverProps:Z,isHovered:E}}function dy(n={}){let{autoFocus:l=!1,isTextInput:h,within:m}=n,w=te.useRef({isFocused:!1,isFocusVisible:l||U3()}),[E,C]=te.useState(!1),[c,D]=te.useState(()=>w.current.isFocused&&w.current.isFocusVisible),B=te.useCallback(()=>D(w.current.isFocused&&w.current.isFocusVisible),[]),Z=te.useCallback(U=>{w.current.isFocused=U,C(U),B()},[B]);Hw(U=>{w.current.isFocusVisible=U,B()},[],{isTextInput:h});let{focusProps:X}=Xw({isDisabled:m,onFocusChange:Z}),{focusWithinProps:Y}=Yw({isDisabled:!m,onFocusWithinChange:Z});return{isFocused:E,isFocusVisible:c,focusProps:m?Y:X}}var Kw=Object.defineProperty,Jw=(n,l,h)=>l in n?Kw(n,l,{enumerable:!0,configurable:!0,writable:!0,value:h}):n[l]=h,fy=(n,l,h)=>(Jw(n,typeof l!="symbol"?l+"":l,h),h);let eS=class{constructor(){fy(this,"current",this.detect()),fy(this,"handoffState","pending"),fy(this,"currentId",0)}set(l){this.current!==l&&(this.handoffState="pending",this.currentId=0,this.current=l)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},Ad=new eS;function X1(n){var l;return Ad.isServer?null:n==null?document:(l=n==null?void 0:n.ownerDocument)!=null?l:document}function tS(n){var l,h;return Ad.isServer?null:n==null?document:(h=(l=n==null?void 0:n.getRootNode)==null?void 0:l.call(n))!=null?h:document}function nS(n){var l,h;return(h=(l=tS(n))==null?void 0:l.activeElement)!=null?h:null}function V3(n){return nS(n)===n}function j3(n){typeof queueMicrotask=="function"?queueMicrotask(n):Promise.resolve().then(n).catch(l=>setTimeout(()=>{throw l}))}function Ao(){let n=[],l={addEventListener(h,m,w,E){return h.addEventListener(m,w,E),l.add(()=>h.removeEventListener(m,w,E))},requestAnimationFrame(...h){let m=requestAnimationFrame(...h);return l.add(()=>cancelAnimationFrame(m))},nextFrame(...h){return l.requestAnimationFrame(()=>l.requestAnimationFrame(...h))},setTimeout(...h){let m=setTimeout(...h);return l.add(()=>clearTimeout(m))},microTask(...h){let m={current:!0};return j3(()=>{m.current&&h[0]()}),l.add(()=>{m.current=!1})},style(h,m,w){let E=h.style.getPropertyValue(m);return Object.assign(h.style,{[m]:w}),this.add(()=>{Object.assign(h.style,{[m]:E})})},group(h){let m=Ao();return h(m),this.add(()=>m.dispose())},add(h){return n.includes(h)||n.push(h),()=>{let m=n.indexOf(h);if(m>=0)for(let w of n.splice(m,1))w()}},dispose(){for(let h of n.splice(0))h()}};return l}function sp(){let[n]=te.useState(Ao);return te.useEffect(()=>()=>n.dispose(),[n]),n}let Ar=(n,l)=>{Ad.isServer?te.useEffect(n,l):te.useLayoutEffect(n,l)};function Ld(n){let l=te.useRef(n);return Ar(()=>{l.current=n},[n]),l}let $n=function(n){let l=Ld(n);return Fn.useCallback((...h)=>l.current(...h),[l])};function iS(n){let l=n.width/2,h=n.height/2;return{top:n.clientY-h,right:n.clientX+l,bottom:n.clientY+h,left:n.clientX-l}}function rS(n,l){return!(!n||!l||n.right<l.left||n.left>l.right||n.bottom<l.top||n.top>l.bottom)}function Z3({disabled:n=!1}={}){let l=te.useRef(null),[h,m]=te.useState(!1),w=sp(),E=$n(()=>{l.current=null,m(!1),w.dispose()}),C=$n(c=>{if(w.dispose(),l.current===null){l.current=c.currentTarget,m(!0);{let D=X1(c.currentTarget);w.addEventListener(D,"pointerup",E,!1),w.addEventListener(D,"pointermove",B=>{if(l.current){let Z=iS(B);m(rS(Z,l.current.getBoundingClientRect()))}},!1),w.addEventListener(D,"pointercancel",E,!1)}}});return{pressed:h,pressProps:n?{}:{onPointerDown:C,onPointerUp:E,onClick:E}}}function fh(n){return te.useMemo(()=>n,Object.values(n))}let aS=te.createContext(void 0);function Wg(){return te.useContext(aS)}function G3(...n){return Array.from(new Set(n.flatMap(l=>typeof l=="string"?l.split(" "):[]))).filter(Boolean).join(" ")}function uc(n,l,...h){if(n in l){let w=l[n];return typeof w=="function"?w(...h):w}let m=new Error(`Tried to handle "${n}" but there is no handler defined. Only defined handlers are: ${Object.keys(l).map(w=>`"${w}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(m,uc),m}var py=(n=>(n[n.None=0]="None",n[n.RenderStrategy=1]="RenderStrategy",n[n.Static=2]="Static",n))(py||{}),sS=(n=>(n[n.Unmount=0]="Unmount",n[n.Hidden=1]="Hidden",n))(sS||{});function Lo(){let n=lS();return te.useCallback(l=>oS({mergeRefs:n,...l}),[n])}function oS({ourProps:n,theirProps:l,slot:h,defaultTag:m,features:w,visible:E=!0,name:C,mergeRefs:c}){c=c??cS;let D=q3(l,n);if(E)return Kg(D,h,m,C,c);let B=w??0;if(B&2){let{static:Z=!1,...X}=D;if(Z)return Kg(X,h,m,C,c)}if(B&1){let{unmount:Z=!0,...X}=D;return uc(Z?0:1,{0(){return null},1(){return Kg({...X,hidden:!0,style:{display:"none"}},h,m,C,c)}})}return Kg(D,h,m,C,c)}function Kg(n,l={},h,m,w){let{as:E=h,children:C,refName:c="ref",...D}=my(n,["unmount","static"]),B=n.ref!==void 0?{[c]:n.ref}:{},Z=typeof C=="function"?C(l):C;"className"in D&&D.className&&typeof D.className=="function"&&(D.className=D.className(l)),D["aria-labelledby"]&&D["aria-labelledby"]===D.id&&(D["aria-labelledby"]=void 0);let X={};if(l){let Y=!1,U=[];for(let[oe,ge]of Object.entries(l))typeof ge=="boolean"&&(Y=!0),ge===!0&&U.push(oe.replace(/([A-Z])/g,ye=>`-${ye.toLowerCase()}`));if(Y){X["data-headlessui-state"]=U.join(" ");for(let oe of U)X[`data-${oe}`]=""}}if(e0(E)&&(Object.keys(Pd(D)).length>0||Object.keys(Pd(X)).length>0))if(!te.isValidElement(Z)||Array.isArray(Z)&&Z.length>1||hS(Z)){if(Object.keys(Pd(D)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${m} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(Pd(D)).concat(Object.keys(Pd(X))).map(Y=>` - ${Y}`).join(`
65
+ `),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(Y=>` - ${Y}`).join(`
66
+ `)].join(`
67
+ `))}else{let Y=Z.props,U=Y==null?void 0:Y.className,oe=typeof U=="function"?(...Se)=>G3(U(...Se),D.className):G3(U,D.className),ge=oe?{className:oe}:{},ye=q3(Z.props,Pd(my(D,["ref"])));for(let Se in X)Se in ye&&delete X[Se];return te.cloneElement(Z,Object.assign({},ye,X,B,{ref:w(uS(Z),B.ref)},ge))}return te.createElement(E,Object.assign({},my(D,["ref"]),!e0(E)&&B,!e0(E)&&X),Z)}function lS(){let n=te.useRef([]),l=te.useCallback(h=>{for(let m of n.current)m!=null&&(typeof m=="function"?m(h):m.current=h)},[]);return(...h)=>{if(!h.every(m=>m==null))return n.current=h,l}}function cS(...n){return n.every(l=>l==null)?void 0:l=>{for(let h of n)h!=null&&(typeof h=="function"?h(l):h.current=l)}}function q3(...n){if(n.length===0)return{};if(n.length===1)return n[0];let l={},h={};for(let m of n)for(let w in m)w.startsWith("on")&&typeof m[w]=="function"?(h[w]!=null||(h[w]=[]),h[w].push(m[w])):l[w]=m[w];if(l.disabled||l["aria-disabled"])for(let m in h)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(m)&&(h[m]=[w=>{var E;return(E=w==null?void 0:w.preventDefault)==null?void 0:E.call(w)}]);for(let m in h)Object.assign(l,{[m](w,...E){let C=h[m];for(let c of C){if((w instanceof Event||(w==null?void 0:w.nativeEvent)instanceof Event)&&w.defaultPrevented)return;c(w,...E)}}});return l}function Jg(...n){if(n.length===0)return{};if(n.length===1)return n[0];let l={},h={};for(let m of n)for(let w in m)w.startsWith("on")&&typeof m[w]=="function"?(h[w]!=null||(h[w]=[]),h[w].push(m[w])):l[w]=m[w];for(let m in h)Object.assign(l,{[m](...w){let E=h[m];for(let C of E)C==null||C(...w)}});return l}function Po(n){var l;return Object.assign(te.forwardRef(n),{displayName:(l=n.displayName)!=null?l:n.name})}function Pd(n){let l=Object.assign({},n);for(let h in l)l[h]===void 0&&delete l[h];return l}function my(n,l=[]){let h=Object.assign({},n);for(let m of l)m in h&&delete h[m];return h}function uS(n){return Fn.version.split(".")[0]>="19"?n.props.ref:n.ref}function e0(n){return n===te.Fragment||n===Symbol.for("react.fragment")}function hS(n){return e0(n.type)}let dS="button";function fS(n,l){var h;let m=Wg(),{disabled:w=m||!1,autoFocus:E=!1,...C}=n,{isFocusVisible:c,focusProps:D}=dy({autoFocus:E}),{isHovered:B,hoverProps:Z}=hy({isDisabled:w}),{pressed:X,pressProps:Y}=Z3({disabled:w}),U=Jg({ref:l,type:(h=C.type)!=null?h:"button",disabled:w||void 0,autoFocus:E},D,Z,Y),oe=fh({disabled:w,hover:B,focus:c,active:X,autofocus:E});return Lo()({ourProps:U,theirProps:C,slot:oe,defaultTag:dS,name:"Button"})}let pS=Po(fS);function mS(n,l,h){let[m,w]=te.useState(h),E=n!==void 0,C=te.useRef(E),c=te.useRef(!1),D=te.useRef(!1);return E&&!C.current&&!c.current?(c.current=!0,C.current=E,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!E&&C.current&&!D.current&&(D.current=!0,C.current=E,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[E?n:m,$n(B=>(E||la.flushSync(()=>w(B)),l==null?void 0:l(B)))]}function gS(n){let[l]=te.useState(n);return l}function H3(n={},l=null,h=[]){for(let[m,w]of Object.entries(n))Y3(h,X3(l,m),w);return h}function X3(n,l){return n?n+"["+l+"]":l}function Y3(n,l,h){if(Array.isArray(h))for(let[m,w]of h.entries())Y3(n,X3(l,m.toString()),w);else h instanceof Date?n.push([l,h.toISOString()]):typeof h=="boolean"?n.push([l,h?"1":"0"]):typeof h=="string"?n.push([l,h]):typeof h=="number"?n.push([l,`${h}`]):h==null?n.push([l,""]):yS(h)&&!te.isValidElement(h)&&H3(h,l,n)}function yS(n){if(Object.prototype.toString.call(n)!=="[object Object]")return!1;let l=Object.getPrototypeOf(n);return l===null||Object.getPrototypeOf(l)===null}let _S="span";var gy=(n=>(n[n.None=1]="None",n[n.Focusable=2]="Focusable",n[n.Hidden=4]="Hidden",n))(gy||{});function vS(n,l){var h;let{features:m=1,...w}=n,E={ref:l,"aria-hidden":(m&2)===2?!0:(h=w["aria-hidden"])!=null?h:void 0,hidden:(m&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(m&4)===4&&(m&2)!==2&&{display:"none"}}};return Lo()({ourProps:E,theirProps:w,slot:{},defaultTag:_S,name:"Hidden"})}let Q3=Po(vS),xS=te.createContext(null);function bS({children:n}){let l=te.useContext(xS);if(!l)return Fn.createElement(Fn.Fragment,null,n);let{target:h}=l;return h?la.createPortal(Fn.createElement(Fn.Fragment,null,n),h):null}function wS({data:n,form:l,disabled:h,onReset:m,overrides:w}){let[E,C]=te.useState(null),c=sp();return te.useEffect(()=>{if(m&&E)return c.addEventListener(E,"reset",m)},[E,l,m]),Fn.createElement(bS,null,Fn.createElement(SS,{setForm:C,formId:l}),H3(n).map(([D,B])=>Fn.createElement(Q3,{features:gy.Hidden,...Pd({key:D,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:l,disabled:h,name:D,value:B,...w})})))}function SS({setForm:n,formId:l}){return te.useEffect(()=>{if(l){let h=document.getElementById(l);h&&n(h)}},[n,l]),l?null:Fn.createElement(Q3,{features:gy.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:h=>{if(!h)return;let m=h.closest("form");m&&n(m)}})}let CS=te.createContext(void 0);function W3(){return te.useContext(CS)}function K3(n){return typeof n!="object"||n===null?!1:"nodeType"in n}function t0(n){return K3(n)&&"tagName"in n}function ph(n){return t0(n)&&"accessKey"in n}function Rd(n){return t0(n)&&"tabIndex"in n}function TS(n){return t0(n)&&"style"in n}function ES(n){return ph(n)&&n.nodeName==="IFRAME"}function n0(n){return ph(n)&&n.nodeName==="INPUT"}function J3(n){return ph(n)&&n.nodeName==="LABEL"}function MS(n){return ph(n)&&n.nodeName==="FIELDSET"}function e4(n){return ph(n)&&n.nodeName==="LEGEND"}function AS(n){return t0(n)?n.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]'):!1}function t4(n){let l=n.parentElement,h=null;for(;l&&!MS(l);)e4(l)&&(h=l),l=l.parentElement;let m=(l==null?void 0:l.getAttribute("disabled"))==="";return m&&LS(h)?!1:m}function LS(n){if(!n)return!1;let l=n.previousElementSibling;for(;l!==null;){if(e4(l))return!1;l=l.previousElementSibling}return!0}let n4=Symbol();function PS(n,l=!0){return Object.assign(n,{[n4]:l})}function su(...n){let l=te.useRef(n);te.useEffect(()=>{l.current=n},[n]);let h=$n(m=>{for(let w of l.current)w!=null&&(typeof w=="function"?w(m):w.current=m)});return n.every(m=>m==null||(m==null?void 0:m[n4]))?void 0:h}let yy=te.createContext(null);yy.displayName="DescriptionContext";function i4(){let n=te.useContext(yy);if(n===null){let l=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(l,i4),l}return n}function RS(){var n,l;return(l=(n=te.useContext(yy))==null?void 0:n.value)!=null?l:void 0}let IS="p";function zS(n,l){let h=te.useId(),m=Wg(),{id:w=`headlessui-description-${h}`,...E}=n,C=i4(),c=su(l);Ar(()=>C.register(w),[w,C.register]);let D=fh({...C.slot,disabled:m||!1}),B={ref:c,...C.props,id:w};return Lo()({ourProps:B,theirProps:E,slot:D,defaultTag:IS,name:C.name||"Description"})}let DS=Po(zS);Object.assign(DS,{});var Ja=(n=>(n.Space=" ",n.Enter="Enter",n.Escape="Escape",n.Backspace="Backspace",n.Delete="Delete",n.ArrowLeft="ArrowLeft",n.ArrowUp="ArrowUp",n.ArrowRight="ArrowRight",n.ArrowDown="ArrowDown",n.Home="Home",n.End="End",n.PageUp="PageUp",n.PageDown="PageDown",n.Tab="Tab",n))(Ja||{});let i0=te.createContext(null);i0.displayName="LabelContext";function r4(){let n=te.useContext(i0);if(n===null){let l=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(l,r4),l}return n}function r0(n){var l,h,m;let w=(h=(l=te.useContext(i0))==null?void 0:l.value)!=null?h:void 0;return((m=n==null?void 0:n.length)!=null?m:0)>0?[w,...n].filter(Boolean).join(" "):w}function OS({inherit:n=!1}={}){let l=r0(),[h,m]=te.useState([]),w=n?[l,...h].filter(Boolean):h;return[w.length>0?w.join(" "):void 0,te.useMemo(()=>function(E){let C=$n(D=>(m(B=>[...B,D]),()=>m(B=>{let Z=B.slice(),X=Z.indexOf(D);return X!==-1&&Z.splice(X,1),Z}))),c=te.useMemo(()=>({register:C,slot:E.slot,name:E.name,props:E.props,value:E.value}),[C,E.slot,E.name,E.props,E.value]);return Fn.createElement(i0.Provider,{value:c},E.children)},[m])]}let kS="label";function BS(n,l){var h;let m=te.useId(),w=r4(),E=W3(),C=Wg(),{id:c=`headlessui-label-${m}`,htmlFor:D=E??((h=w.props)==null?void 0:h.htmlFor),passive:B=!1,...Z}=n,X=su(l);Ar(()=>w.register(c),[c,w.register]);let Y=$n(ge=>{let ye=ge.currentTarget;if(!(ge.target!==ge.currentTarget&&AS(ge.target))&&(J3(ye)&&ge.preventDefault(),w.props&&"onClick"in w.props&&typeof w.props.onClick=="function"&&w.props.onClick(ge),J3(ye))){let Se=document.getElementById(ye.htmlFor);if(Se){let je=Se.getAttribute("disabled");if(je==="true"||je==="")return;let Pe=Se.getAttribute("aria-disabled");if(Pe==="true"||Pe==="")return;(n0(Se)&&(Se.type==="file"||Se.type==="radio"||Se.type==="checkbox")||Se.role==="radio"||Se.role==="checkbox"||Se.role==="switch")&&Se.click(),Se.focus({preventScroll:!0})}}}),U=fh({...w.slot,disabled:C||!1}),oe={ref:X,...w.props,id:c,htmlFor:D,onClick:Y};return B&&("onClick"in oe&&(delete oe.htmlFor,delete oe.onClick),"onClick"in Z&&delete Z.onClick),Lo()({ourProps:oe,theirProps:Z,slot:U,defaultTag:D?kS:"div",name:w.name||"Label"})}let FS=Po(BS),NS=Object.assign(FS,{});function op(n,l,h){let m=h.initialDeps??[],w;function E(){var C,c,D,B;let Z;h.key&&((C=h.debug)!=null&&C.call(h))&&(Z=Date.now());const X=n();if(!(X.length!==m.length||X.some((oe,ge)=>m[ge]!==oe)))return w;m=X;let U;if(h.key&&((c=h.debug)!=null&&c.call(h))&&(U=Date.now()),w=l(...X),h.key&&((D=h.debug)!=null&&D.call(h))){const oe=Math.round((Date.now()-Z)*100)/100,ge=Math.round((Date.now()-U)*100)/100,ye=ge/16,Se=(je,Pe)=>{for(je=String(je);je.length<Pe;)je=" "+je;return je};console.info(`%c⏱ ${Se(ge,5)} /${Se(oe,5)} ms`,`
68
+ font-size: .6rem;
69
+ font-weight: bold;
70
+ color: hsl(${Math.max(0,Math.min(120-120*ye,120))}deg 100% 31%);`,h==null?void 0:h.key)}return(B=h==null?void 0:h.onChange)==null||B.call(h,w),w}return E.updateDeps=C=>{m=C},E}function a4(n,l){if(n===void 0)throw new Error("Unexpected undefined");return n}const US=(n,l)=>Math.abs(n-l)<1.01,$S=(n,l,h)=>{let m;return function(...w){n.clearTimeout(m),m=n.setTimeout(()=>l.apply(this,w),h)}},s4=n=>{const{offsetWidth:l,offsetHeight:h}=n;return{width:l,height:h}},VS=n=>n,jS=n=>{const l=Math.max(n.startIndex-n.overscan,0),h=Math.min(n.endIndex+n.overscan,n.count-1),m=[];for(let w=l;w<=h;w++)m.push(w);return m},ZS=(n,l)=>{const h=n.scrollElement;if(!h)return;const m=n.targetWindow;if(!m)return;const w=C=>{const{width:c,height:D}=C;l({width:Math.round(c),height:Math.round(D)})};if(w(s4(h)),!m.ResizeObserver)return()=>{};const E=new m.ResizeObserver(C=>{const c=()=>{const D=C[0];if(D!=null&&D.borderBoxSize){const B=D.borderBoxSize[0];if(B){w({width:B.inlineSize,height:B.blockSize});return}}w(s4(h))};n.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()});return E.observe(h,{box:"border-box"}),()=>{E.unobserve(h)}},o4={passive:!0},l4=typeof window>"u"?!0:"onscrollend"in window,GS=(n,l)=>{const h=n.scrollElement;if(!h)return;const m=n.targetWindow;if(!m)return;let w=0;const E=n.options.useScrollendEvent&&l4?()=>{}:$S(m,()=>{l(w,!1)},n.options.isScrollingResetDelay),C=Z=>()=>{const{horizontal:X,isRtl:Y}=n.options;w=X?h.scrollLeft*(Y&&-1||1):h.scrollTop,E(),l(w,Z)},c=C(!0),D=C(!1);D(),h.addEventListener("scroll",c,o4);const B=n.options.useScrollendEvent&&l4;return B&&h.addEventListener("scrollend",D,o4),()=>{h.removeEventListener("scroll",c),B&&h.removeEventListener("scrollend",D)}},qS=(n,l,h)=>{if(l!=null&&l.borderBoxSize){const m=l.borderBoxSize[0];if(m)return Math.round(m[h.options.horizontal?"inlineSize":"blockSize"])}return n[h.options.horizontal?"offsetWidth":"offsetHeight"]},HS=(n,{adjustments:l=0,behavior:h},m)=>{var w,E;const C=n+l;(E=(w=m.scrollElement)==null?void 0:w.scrollTo)==null||E.call(w,{[m.options.horizontal?"left":"top"]:C,behavior:h})};class XS{constructor(l){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let h=null;const m=()=>h||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:h=new this.targetWindow.ResizeObserver(w=>{w.forEach(E=>{const C=()=>{this._measureElement(E.target,E)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(C):C()})}));return{disconnect:()=>{var w;(w=m())==null||w.disconnect(),h=null},observe:w=>{var E;return(E=m())==null?void 0:E.observe(w,{box:"border-box"})},unobserve:w=>{var E;return(E=m())==null?void 0:E.unobserve(w)}}})(),this.range=null,this.setOptions=h=>{Object.entries(h).forEach(([m,w])=>{typeof w>"u"&&delete h[m]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:VS,rangeExtractor:jS,onChange:()=>{},measureElement:qS,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...h}},this.notify=h=>{var m,w;(w=(m=this.options).onChange)==null||w.call(m,this,h)},this.maybeNotify=op(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),h=>{this.notify(h)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(h=>h()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var h;const m=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==m){if(this.cleanup(),!m){this.maybeNotify();return}this.scrollElement=m,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((h=this.scrollElement)==null?void 0:h.window)??null,this.elementsCache.forEach(w=>{this.observer.observe(w)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,w=>{this.scrollRect=w,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(w,E)=>{this.scrollAdjustments=0,this.scrollDirection=E?this.getScrollOffset()<w?"forward":"backward":null,this.scrollOffset=w,this.isScrolling=E,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(h,m)=>{const w=new Map,E=new Map;for(let C=m-1;C>=0;C--){const c=h[C];if(w.has(c.lane))continue;const D=E.get(c.lane);if(D==null||c.end>D.end?E.set(c.lane,c):c.end<D.end&&w.set(c.lane,!0),w.size===this.options.lanes)break}return E.size===this.options.lanes?Array.from(E.values()).sort((C,c)=>C.end===c.end?C.index-c.index:C.end-c.end)[0]:void 0},this.getMeasurementOptions=op(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(h,m,w,E,C)=>(this.pendingMeasuredCacheIndexes=[],{count:h,paddingStart:m,scrollMargin:w,getItemKey:E,enabled:C}),{key:!1}),this.getMeasurements=op(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:h,paddingStart:m,scrollMargin:w,getItemKey:E,enabled:C},c)=>{if(!C)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(Z=>{this.itemSizeCache.set(Z.key,Z.size)}));const D=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const B=this.measurementsCache.slice(0,D);for(let Z=D;Z<h;Z++){const X=E(Z),Y=this.options.lanes===1?B[Z-1]:this.getFurthestMeasurement(B,Z),U=Y?Y.end+this.options.gap:m+w,oe=c.get(X),ge=typeof oe=="number"?oe:this.options.estimateSize(Z),ye=U+ge,Se=Y?Y.lane:Z%this.options.lanes;B[Z]={index:Z,start:U,size:ge,end:ye,key:X,lane:Se}}return this.measurementsCache=B,B},{key:!1,debug:()=>this.options.debug}),this.calculateRange=op(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(h,m,w,E)=>this.range=h.length>0&&m>0?YS({measurements:h,outerSize:m,scrollOffset:w,lanes:E}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=op(()=>{let h=null,m=null;const w=this.calculateRange();return w&&(h=w.startIndex,m=w.endIndex),this.maybeNotify.updateDeps([this.isScrolling,h,m]),[this.options.rangeExtractor,this.options.overscan,this.options.count,h,m]},(h,m,w,E,C)=>E===null||C===null?[]:h({startIndex:E,endIndex:C,overscan:m,count:w}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=h=>{const m=this.options.indexAttribute,w=h.getAttribute(m);return w?parseInt(w,10):(console.warn(`Missing attribute name '${m}={index}' on measured element.`),-1)},this._measureElement=(h,m)=>{const w=this.indexFromElement(h),E=this.measurementsCache[w];if(!E)return;const C=E.key,c=this.elementsCache.get(C);c!==h&&(c&&this.observer.unobserve(c),this.observer.observe(h),this.elementsCache.set(C,h)),h.isConnected&&this.resizeItem(w,this.options.measureElement(h,m,this))},this.resizeItem=(h,m)=>{const w=this.measurementsCache[h];if(!w)return;const E=this.itemSizeCache.get(w.key)??w.size,C=m-E;C!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(w,C,this):w.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=C,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(w.index),this.itemSizeCache=new Map(this.itemSizeCache.set(w.key,m)),this.notify(!1))},this.measureElement=h=>{if(!h){this.elementsCache.forEach((m,w)=>{m.isConnected||(this.observer.unobserve(m),this.elementsCache.delete(w))});return}this._measureElement(h,void 0)},this.getVirtualItems=op(()=>[this.getVirtualIndexes(),this.getMeasurements()],(h,m)=>{const w=[];for(let E=0,C=h.length;E<C;E++){const c=h[E],D=m[c];w.push(D)}return w},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=h=>{const m=this.getMeasurements();if(m.length!==0)return a4(m[c4(0,m.length-1,w=>a4(m[w]).start,h)])},this.getOffsetForAlignment=(h,m,w=0)=>{const E=this.getSize(),C=this.getScrollOffset();m==="auto"&&(m=h>=C+E?"end":"start"),m==="center"?h+=(w-E)/2:m==="end"&&(h-=E);const c=this.getTotalSize()+this.options.scrollMargin-E;return Math.max(Math.min(c,h),0)},this.getOffsetForIndex=(h,m="auto")=>{h=Math.max(0,Math.min(h,this.options.count-1));const w=this.measurementsCache[h];if(!w)return;const E=this.getSize(),C=this.getScrollOffset();if(m==="auto")if(w.end>=C+E-this.options.scrollPaddingEnd)m="end";else if(w.start<=C+this.options.scrollPaddingStart)m="start";else return[C,m];const c=m==="end"?w.end+this.options.scrollPaddingEnd:w.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(c,m,w.size),m]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(h,{align:m="start",behavior:w}={})=>{w==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(h,m),{adjustments:void 0,behavior:w})},this.scrollToIndex=(h,{align:m="auto",behavior:w}={})=>{w==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),h=Math.max(0,Math.min(h,this.options.count-1));let E=0;const C=10,c=B=>{if(!this.targetWindow)return;const Z=this.getOffsetForIndex(h,B);if(!Z){console.warn("Failed to get offset for index:",h);return}const[X,Y]=Z;this._scrollToOffset(X,{adjustments:void 0,behavior:w}),this.targetWindow.requestAnimationFrame(()=>{const U=this.getScrollOffset(),oe=this.getOffsetForIndex(h,Y);if(!oe){console.warn("Failed to get offset for index:",h);return}US(oe[0],U)||D(Y)})},D=B=>{this.targetWindow&&(E++,E<C?this.targetWindow.requestAnimationFrame(()=>c(B)):console.warn(`Failed to scroll to index ${h} after ${C} attempts.`))};c(m)},this.scrollBy=(h,{behavior:m}={})=>{m==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+h,{adjustments:void 0,behavior:m})},this.getTotalSize=()=>{var h;const m=this.getMeasurements();let w;if(m.length===0)w=this.options.paddingStart;else if(this.options.lanes===1)w=((h=m[m.length-1])==null?void 0:h.end)??0;else{const E=Array(this.options.lanes).fill(null);let C=m.length-1;for(;C>=0&&E.some(c=>c===null);){const c=m[C];E[c.lane]===null&&(E[c.lane]=c.end),C--}w=Math.max(...E.filter(c=>c!==null))}return Math.max(w-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(h,{adjustments:m,behavior:w})=>{this.options.scrollToFn(h,{behavior:w,adjustments:m},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(l)}}const c4=(n,l,h,m)=>{for(;n<=l;){const w=(n+l)/2|0,E=h(w);if(E<m)n=w+1;else if(E>m)l=w-1;else return w}return n>0?n-1:0};function YS({measurements:n,outerSize:l,scrollOffset:h,lanes:m}){const w=n.length-1,E=D=>n[D].start;if(n.length<=m)return{startIndex:0,endIndex:w};let C=c4(0,w,E,h),c=C;if(m===1)for(;c<w&&n[c].end<h+l;)c++;else if(m>1){const D=Array(m).fill(0);for(;c<w&&D.some(Z=>Z<h+l);){const Z=n[c];D[Z.lane]=Z.end,c++}const B=Array(m).fill(h+l);for(;C>=0&&B.some(Z=>Z>=h);){const Z=n[C];B[Z.lane]=Z.start,C--}C=Math.max(0,C-C%m),c=Math.min(w,c+(m-1-c%m))}return{startIndex:C,endIndex:c}}const u4=typeof document<"u"?te.useLayoutEffect:te.useEffect;function QS(n){const l=te.useReducer(()=>({}),{})[1],h={...n,onChange:(w,E)=>{var C;E?la.flushSync(l):l(),(C=n.onChange)==null||C.call(n,w,E)}},[m]=te.useState(()=>new XS(h));return m.setOptions(h),u4(()=>m._didMount(),[]),u4(()=>m._willUpdate()),m}function WS(n){return QS({observeElementRect:ZS,observeElementOffset:GS,scrollToFn:HS,...n})}function KS(n,l){return n!==null&&l!==null&&typeof n=="object"&&typeof l=="object"&&"id"in n&&"id"in l?n.id===l.id:n===l}function JS(n=KS){return te.useCallback((l,h)=>{if(typeof n=="string"){let m=n;return(l==null?void 0:l[m])===(h==null?void 0:h[m])}return n(l,h)},[n])}function h4(n){if(n===null)return{width:0,height:0};let{width:l,height:h}=n.getBoundingClientRect();return{width:l,height:h}}function d4(n,l,h=!1){let[m,w]=te.useState(()=>h4(l));return Ar(()=>{if(!l||!n)return;let E=Ao();return E.requestAnimationFrame(function C(){E.requestAnimationFrame(C),w(c=>{let D=h4(l);return D.width===c.width&&D.height===c.height?c:D})}),()=>{E.dispose()}},[l,n]),h?{width:`${m.width}px`,height:`${m.height}px`}:m}var _y=(n=>(n[n.Left=0]="Left",n[n.Right=2]="Right",n))(_y||{});function eC(n){let l=te.useRef(null),h=$n(w=>{l.current=w.pointerType,!t4(w.currentTarget)&&w.pointerType==="mouse"&&w.button===_y.Left&&(w.preventDefault(),n(w))}),m=$n(w=>{l.current!=="mouse"&&(t4(w.currentTarget)||n(w))});return{onPointerDown:h,onClick:m}}let f4=class extends Map{constructor(l){super(),this.factory=l}get(l){let h=super.get(l);return h===void 0&&(h=this.factory(l),this.set(l,h)),h}};var tC=Object.defineProperty,nC=(n,l,h)=>l in n?tC(n,l,{enumerable:!0,configurable:!0,writable:!0,value:h}):n[l]=h,iC=(n,l,h)=>(nC(n,l+"",h),h),p4=(n,l,h)=>{if(!l.has(n))throw TypeError("Cannot "+h)},Ro=(n,l,h)=>(p4(n,l,"read from private field"),h?h.call(n):l.get(n)),vy=(n,l,h)=>{if(l.has(n))throw TypeError("Cannot add the same private member more than once");l instanceof WeakSet?l.add(n):l.set(n,h)},m4=(n,l,h,m)=>(p4(n,l,"write to private field"),l.set(n,h),h),hc,Y1,Q1;let g4=class{constructor(l){vy(this,hc,{}),vy(this,Y1,new f4(()=>new Set)),vy(this,Q1,new Set),iC(this,"disposables",Ao()),m4(this,hc,l),Ad.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return Ro(this,hc)}subscribe(l,h){if(Ad.isServer)return()=>{};let m={selector:l,callback:h,current:l(Ro(this,hc))};return Ro(this,Q1).add(m),this.disposables.add(()=>{Ro(this,Q1).delete(m)})}on(l,h){return Ad.isServer?()=>{}:(Ro(this,Y1).get(l).add(h),this.disposables.add(()=>{Ro(this,Y1).get(l).delete(h)}))}send(l){let h=this.reduce(Ro(this,hc),l);if(h!==Ro(this,hc)){m4(this,hc,h);for(let m of Ro(this,Q1)){let w=m.selector(Ro(this,hc));y4(m.current,w)||(m.current=w,m.callback(w))}for(let m of Ro(this,Y1).get(l.type))m(Ro(this,hc),l)}}};hc=new WeakMap,Y1=new WeakMap,Q1=new WeakMap;function y4(n,l){return Object.is(n,l)?!0:typeof n!="object"||n===null||typeof l!="object"||l===null?!1:Array.isArray(n)&&Array.isArray(l)?n.length!==l.length?!1:xy(n[Symbol.iterator](),l[Symbol.iterator]()):n instanceof Map&&l instanceof Map||n instanceof Set&&l instanceof Set?n.size!==l.size?!1:xy(n.entries(),l.entries()):_4(n)&&_4(l)?xy(Object.entries(n)[Symbol.iterator](),Object.entries(l)[Symbol.iterator]()):!1}function xy(n,l){do{let h=n.next(),m=l.next();if(h.done&&m.done)return!0;if(h.done||m.done||!Object.is(h.value,m.value))return!1}while(!0)}function _4(n){if(Object.prototype.toString.call(n)!=="[object Object]")return!1;let l=Object.getPrototypeOf(n);return l===null||Object.getPrototypeOf(l)===null}var rC=Object.defineProperty,aC=(n,l,h)=>l in n?rC(n,l,{enumerable:!0,configurable:!0,writable:!0,value:h}):n[l]=h,v4=(n,l,h)=>(aC(n,typeof l!="symbol"?l+"":l,h),h),x4=(n=>(n[n.Push=0]="Push",n[n.Pop=1]="Pop",n))(x4||{});let sC={0(n,l){let h=l.id,m=n.stack,w=n.stack.indexOf(h);if(w!==-1){let E=n.stack.slice();return E.splice(w,1),E.push(h),m=E,{...n,stack:m}}return{...n,stack:[...n.stack,h]}},1(n,l){let h=l.id,m=n.stack.indexOf(h);if(m===-1)return n;let w=n.stack.slice();return w.splice(m,1),{...n,stack:w}}},oC=class ax extends g4{constructor(){super(...arguments),v4(this,"actions",{push:l=>this.send({type:0,id:l}),pop:l=>this.send({type:1,id:l})}),v4(this,"selectors",{isTop:(l,h)=>l.stack[l.stack.length-1]===h,inStack:(l,h)=>l.stack.includes(h)})}static new(){return new ax({stack:[]})}reduce(l,h){return uc(h.type,sC,l,h)}};const by=new f4(()=>oC.new());var wy={exports:{}},Sy={};/**
71
+ * @license React
72
+ * use-sync-external-store-with-selector.production.js
73
+ *
74
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
75
+ *
76
+ * This source code is licensed under the MIT license found in the
77
+ * LICENSE file in the root directory of this source tree.
78
+ */var b4;function lC(){if(b4)return Sy;b4=1;var n=mg();function l(D,B){return D===B&&(D!==0||1/D===1/B)||D!==D&&B!==B}var h=typeof Object.is=="function"?Object.is:l,m=n.useSyncExternalStore,w=n.useRef,E=n.useEffect,C=n.useMemo,c=n.useDebugValue;return Sy.useSyncExternalStoreWithSelector=function(D,B,Z,X,Y){var U=w(null);if(U.current===null){var oe={hasValue:!1,value:null};U.current=oe}else oe=U.current;U=C(function(){function ye(Je){if(!Se){if(Se=!0,je=Je,Je=X(Je),Y!==void 0&&oe.hasValue){var et=oe.value;if(Y(et,Je))return Pe=et}return Pe=Je}if(et=Pe,h(je,Je))return et;var ot=X(Je);return Y!==void 0&&Y(et,ot)?(je=Je,et):(je=Je,Pe=ot)}var Se=!1,je,Pe,Oe=Z===void 0?null:Z;return[function(){return ye(B())},Oe===null?void 0:function(){return ye(Oe())}]},[B,Z,X,Y]);var ge=m(D,U[0],U[1]);return E(function(){oe.hasValue=!0,oe.value=ge},[ge]),c(ge),ge},Sy}var w4;function cC(){return w4||(w4=1,wy.exports=lC()),wy.exports}var uC=cC();function qr(n,l,h=y4){return uC.useSyncExternalStoreWithSelector($n(m=>n.subscribe(hC,m)),$n(()=>n.state),$n(()=>n.state),$n(l),h)}function hC(n){return n}function S4(n,l){let h=te.useId(),m=by.get(l),[w,E]=qr(m,te.useCallback(C=>[m.selectors.isTop(C,h),m.selectors.inStack(C,h)],[m,h]));return Ar(()=>{if(n)return m.actions.push(h),()=>m.actions.pop(h)},[m,n,h]),n?E?w:!0:!1}let Cy=new Map,W1=new Map;function C4(n){var l;let h=(l=W1.get(n))!=null?l:0;return W1.set(n,h+1),h!==0?()=>T4(n):(Cy.set(n,{"aria-hidden":n.getAttribute("aria-hidden"),inert:n.inert}),n.setAttribute("aria-hidden","true"),n.inert=!0,()=>T4(n))}function T4(n){var l;let h=(l=W1.get(n))!=null?l:1;if(h===1?W1.delete(n):W1.set(n,h-1),h!==1)return;let m=Cy.get(n);m&&(m["aria-hidden"]===null?n.removeAttribute("aria-hidden"):n.setAttribute("aria-hidden",m["aria-hidden"]),n.inert=m.inert,Cy.delete(n))}function dC(n,{allowed:l,disallowed:h}={}){let m=S4(n,"inert-others");Ar(()=>{var w,E;if(!m)return;let C=Ao();for(let D of(w=h==null?void 0:h())!=null?w:[])D&&C.add(C4(D));let c=(E=l==null?void 0:l())!=null?E:[];for(let D of c){if(!D)continue;let B=X1(D);if(!B)continue;let Z=D.parentElement;for(;Z&&Z!==B.body;){for(let X of Z.children)c.some(Y=>X.contains(Y))||C.add(C4(X));Z=Z.parentElement}}return C.dispose},[m,l,h])}function fC(n,l,h){let m=Ld(w=>{let E=w.getBoundingClientRect();E.x===0&&E.y===0&&E.width===0&&E.height===0&&h()});te.useEffect(()=>{if(!n)return;let w=l===null?null:ph(l)?l:l.current;if(!w)return;let E=Ao();if(typeof ResizeObserver<"u"){let C=new ResizeObserver(()=>m.current(w));C.observe(w),E.add(()=>C.disconnect())}if(typeof IntersectionObserver<"u"){let C=new IntersectionObserver(()=>m.current(w));C.observe(w),E.add(()=>C.disconnect())}return()=>E.dispose()},[l,m,n])}let Ty=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","details>summary","textarea:not([disabled])"].map(n=>`${n}:not([tabindex='-1'])`).join(",");var pC=(n=>(n[n.First=1]="First",n[n.Previous=2]="Previous",n[n.Next=4]="Next",n[n.Last=8]="Last",n[n.WrapAround=16]="WrapAround",n[n.NoScroll=32]="NoScroll",n[n.AutoFocus=64]="AutoFocus",n))(pC||{}),mC=(n=>(n[n.Error=0]="Error",n[n.Overflow=1]="Overflow",n[n.Success=2]="Success",n[n.Underflow=3]="Underflow",n))(mC||{}),gC=(n=>(n[n.Previous=-1]="Previous",n[n.Next=1]="Next",n))(gC||{}),E4=(n=>(n[n.Strict=0]="Strict",n[n.Loose=1]="Loose",n))(E4||{});function yC(n,l=0){var h;return n===((h=X1(n))==null?void 0:h.body)?!1:uc(l,{0(){return n.matches(Ty)},1(){let m=n;for(;m!==null;){if(m.matches(Ty))return!0;m=m.parentElement}return!1}})}var _C=(n=>(n[n.Keyboard=0]="Keyboard",n[n.Mouse=1]="Mouse",n))(_C||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",n=>{n.metaKey||n.altKey||n.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",n=>{n.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:n.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function vC(n,l=h=>h){return n.slice().sort((h,m)=>{let w=l(h),E=l(m);if(w===null||E===null)return 0;let C=w.compareDocumentPosition(E);return C&Node.DOCUMENT_POSITION_FOLLOWING?-1:C&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function M4(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function xC(){return/Android/gi.test(window.navigator.userAgent)}function Ey(){return M4()||xC()}function lp(n,l,h,m){let w=Ld(h);te.useEffect(()=>{if(!n)return;function E(C){w.current(C)}return document.addEventListener(l,E,m),()=>document.removeEventListener(l,E,m)},[n,l,m])}function bC(n,l,h,m){let w=Ld(h);te.useEffect(()=>{if(!n)return;function E(C){w.current(C)}return window.addEventListener(l,E,m),()=>window.removeEventListener(l,E,m)},[n,l,m])}const A4=30;function wC(n,l,h){let m=Ld(h),w=te.useCallback(function(c,D){if(c.defaultPrevented)return;let B=D(c);if(B===null||!B.getRootNode().contains(B)||!B.isConnected)return;let Z=(function X(Y){return typeof Y=="function"?X(Y()):Array.isArray(Y)||Y instanceof Set?Y:[Y]})(l);for(let X of Z)if(X!==null&&(X.contains(B)||c.composed&&c.composedPath().includes(X)))return;return!yC(B,E4.Loose)&&B.tabIndex!==-1&&c.preventDefault(),m.current(c,B)},[m,l]),E=te.useRef(null);lp(n,"pointerdown",c=>{var D,B;Ey()||(E.current=((B=(D=c.composedPath)==null?void 0:D.call(c))==null?void 0:B[0])||c.target)},!0),lp(n,"pointerup",c=>{if(Ey()||!E.current)return;let D=E.current;return E.current=null,w(c,()=>D)},!0);let C=te.useRef({x:0,y:0});lp(n,"touchstart",c=>{C.current.x=c.touches[0].clientX,C.current.y=c.touches[0].clientY},!0),lp(n,"touchend",c=>{let D={x:c.changedTouches[0].clientX,y:c.changedTouches[0].clientY};if(!(Math.abs(D.x-C.current.x)>=A4||Math.abs(D.y-C.current.y)>=A4))return w(c,()=>Rd(c.target)?c.target:null)},!0),bC(n,"blur",c=>w(c,()=>ES(window.document.activeElement)?window.document.activeElement:null),!0)}function My(...n){return te.useMemo(()=>X1(...n),[...n])}var SC=(n=>(n[n.Ignore=0]="Ignore",n[n.Select=1]="Select",n[n.Close=2]="Close",n))(SC||{});const K1={Ignore:{kind:0},Select:n=>({kind:1,target:n}),Close:{kind:2}},CC=200,L4=5;function TC(n,{trigger:l,action:h,close:m,select:w}){let E=te.useRef(null),C=te.useRef(null),c=te.useRef(null);lp(n&&l!==null,"pointerdown",D=>{K3(D==null?void 0:D.target)&&l!=null&&l.contains(D.target)&&(C.current=D.x,c.current=D.y,E.current=D.timeStamp)}),lp(n&&l!==null,"pointerup",D=>{var B,Z;let X=E.current;if(X===null||(E.current=null,!Rd(D.target))||Math.abs(D.x-((B=C.current)!=null?B:D.x))<L4&&Math.abs(D.y-((Z=c.current)!=null?Z:D.y))<L4)return;let Y=h(D);switch(Y.kind){case 0:return;case 1:{D.timeStamp-X>CC&&(w(Y.target),m());break}case 2:{m();break}}},{capture:!0})}function EC(n,l,h,m){let w=Ld(h);te.useEffect(()=>{n=n??window;function E(C){w.current(C)}return n.addEventListener(l,E,m),()=>n.removeEventListener(l,E,m)},[n,l,m])}function P4(n){let l=te.useRef({value:"",selectionStart:null,selectionEnd:null});return EC(n,"blur",h=>{let m=h.target;n0(m)&&(l.current={value:m.value,selectionStart:m.selectionStart,selectionEnd:m.selectionEnd})}),$n(()=>{if(!V3(n)&&n0(n)&&n.isConnected){if(n.focus({preventScroll:!0}),n.value!==l.current.value)n.setSelectionRange(n.value.length,n.value.length);else{let{selectionStart:h,selectionEnd:m}=l.current;h!==null&&m!==null&&n.setSelectionRange(h,m)}l.current={value:"",selectionStart:null,selectionEnd:null}}})}function MC(n,l){return te.useMemo(()=>{var h;if(n.type)return n.type;let m=(h=n.as)!=null?h:"button";if(typeof m=="string"&&m.toLowerCase()==="button"||(l==null?void 0:l.tagName)==="BUTTON"&&!l.hasAttribute("type"))return"button"},[n.type,n.as,l])}function AC(n){return te.useSyncExternalStore(n.subscribe,n.getSnapshot,n.getSnapshot)}function LC(n,l){let h=n(),m=new Set;return{getSnapshot(){return h},subscribe(w){return m.add(w),()=>m.delete(w)},dispatch(w,...E){let C=l[w].call(h,...E);C&&(h=C,m.forEach(c=>c()))}}}function PC(){let n;return{before({doc:l}){var h;let m=l.documentElement,w=(h=l.defaultView)!=null?h:window;n=Math.max(0,w.innerWidth-m.clientWidth)},after({doc:l,d:h}){let m=l.documentElement,w=Math.max(0,m.clientWidth-m.offsetWidth),E=Math.max(0,n-w);h.style(m,"paddingRight",`${E}px`)}}}function RC(){return M4()?{before({doc:n,d:l,meta:h}){function m(w){for(let E of h().containers)for(let C of E())if(C.contains(w))return!0;return!1}l.microTask(()=>{var w;if(window.getComputedStyle(n.documentElement).scrollBehavior!=="auto"){let c=Ao();c.style(n.documentElement,"scrollBehavior","auto"),l.add(()=>l.microTask(()=>c.dispose()))}let E=(w=window.scrollY)!=null?w:window.pageYOffset,C=null;l.addEventListener(n,"click",c=>{if(Rd(c.target))try{let D=c.target.closest("a");if(!D)return;let{hash:B}=new URL(D.href),Z=n.querySelector(B);Rd(Z)&&!m(Z)&&(C=Z)}catch{}},!0),l.group(c=>{l.addEventListener(n,"touchstart",D=>{if(c.dispose(),Rd(D.target)&&TS(D.target))if(m(D.target)){let B=D.target;for(;B.parentElement&&m(B.parentElement);)B=B.parentElement;c.style(B,"overscrollBehavior","contain")}else c.style(D.target,"touchAction","none")})}),l.addEventListener(n,"touchmove",c=>{if(Rd(c.target)){if(n0(c.target))return;if(m(c.target)){let D=c.target;for(;D.parentElement&&D.dataset.headlessuiPortal!==""&&!(D.scrollHeight>D.clientHeight||D.scrollWidth>D.clientWidth);)D=D.parentElement;D.dataset.headlessuiPortal===""&&c.preventDefault()}else c.preventDefault()}},{passive:!1}),l.add(()=>{var c;let D=(c=window.scrollY)!=null?c:window.pageYOffset;E!==D&&window.scrollTo(0,E),C&&C.isConnected&&(C.scrollIntoView({block:"nearest"}),C=null)})})}}:{}}function IC(){return{before({doc:n,d:l}){l.style(n.documentElement,"overflow","hidden")}}}function R4(n){let l={};for(let h of n)Object.assign(l,h(l));return l}let Id=LC(()=>new Map,{PUSH(n,l){var h;let m=(h=this.get(n))!=null?h:{doc:n,count:0,d:Ao(),meta:new Set,computedMeta:{}};return m.count++,m.meta.add(l),m.computedMeta=R4(m.meta),this.set(n,m),this},POP(n,l){let h=this.get(n);return h&&(h.count--,h.meta.delete(l),h.computedMeta=R4(h.meta)),this},SCROLL_PREVENT(n){let l={doc:n.doc,d:n.d,meta(){return n.computedMeta}},h=[RC(),PC(),IC()];h.forEach(({before:m})=>m==null?void 0:m(l)),h.forEach(({after:m})=>m==null?void 0:m(l))},SCROLL_ALLOW({d:n}){n.dispose()},TEARDOWN({doc:n}){this.delete(n)}});Id.subscribe(()=>{let n=Id.getSnapshot(),l=new Map;for(let[h]of n)l.set(h,h.documentElement.style.overflow);for(let h of n.values()){let m=l.get(h.doc)==="hidden",w=h.count!==0;(w&&!m||!w&&m)&&Id.dispatch(h.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",h),h.count===0&&Id.dispatch("TEARDOWN",h)}});function zC(n,l,h=()=>({containers:[]})){let m=AC(Id),w=l?m.get(l):void 0,E=w?w.count>0:!1;return Ar(()=>{if(!(!l||!n))return Id.dispatch("PUSH",l,h),()=>Id.dispatch("POP",l,h)},[n,l]),E}function DC(n,l,h=()=>[document.body]){let m=S4(n,"scroll-lock");zC(m,l,w=>{var E;return{containers:[...(E=w.containers)!=null?E:[],h]}})}function I4(n){return[n.screenX,n.screenY]}function OC(){let n=te.useRef([-1,-1]);return{wasMoved(l){let h=I4(l);return n.current[0]===h[0]&&n.current[1]===h[1]?!1:(n.current=h,!0)},update(l){n.current=I4(l)}}}function kC(n=0){let[l,h]=te.useState(n),m=te.useCallback(D=>h(D),[]),w=te.useCallback(D=>h(B=>B|D),[]),E=te.useCallback(D=>(l&D)===D,[l]),C=te.useCallback(D=>h(B=>B&~D),[]),c=te.useCallback(D=>h(B=>B^D),[]);return{flags:l,setFlag:m,addFlag:w,hasFlag:E,removeFlag:C,toggleFlag:c}}var z4,D4;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((z4=process==null?void 0:process.env)==null?void 0:z4.NODE_ENV)==="test"&&typeof((D4=Element==null?void 0:Element.prototype)==null?void 0:D4.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(`
79
+ `)),[]});var BC=(n=>(n[n.None=0]="None",n[n.Closed=1]="Closed",n[n.Enter=2]="Enter",n[n.Leave=4]="Leave",n))(BC||{});function FC(n){let l={};for(let h in n)n[h]===!0&&(l[`data-${h}`]="");return l}function NC(n,l,h,m){let[w,E]=te.useState(h),{hasFlag:C,addFlag:c,removeFlag:D}=kC(n&&w?3:0),B=te.useRef(!1),Z=te.useRef(!1),X=sp();return Ar(()=>{var Y;if(n){if(h&&E(!0),!l){h&&c(3);return}return(Y=void 0)==null||Y.call(m,h),UC(l,{inFlight:B,prepare(){Z.current?Z.current=!1:Z.current=B.current,B.current=!0,!Z.current&&(h?(c(3),D(4)):(c(4),D(2)))},run(){Z.current?h?(D(3),c(4)):(D(4),c(3)):h?D(1):c(1)},done(){var U;Z.current&&jC(l)||(B.current=!1,D(7),h||E(!1),(U=void 0)==null||U.call(m,h))}})}},[n,h,l,X]),n?[w,{closed:C(1),enter:C(2),leave:C(4),transition:C(2)||C(4)}]:[h,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function UC(n,{prepare:l,run:h,done:m,inFlight:w}){let E=Ao();return VC(n,{prepare:l,inFlight:w}),E.nextFrame(()=>{h(),E.requestAnimationFrame(()=>{E.add($C(n,m))})}),E.dispose}function $C(n,l){var h,m;let w=Ao();if(!n)return w.dispose;let E=!1;w.add(()=>{E=!0});let C=(m=(h=n.getAnimations)==null?void 0:h.call(n).filter(c=>c instanceof CSSTransition))!=null?m:[];return C.length===0?(l(),w.dispose):(Promise.allSettled(C.map(c=>c.finished)).then(()=>{E||l()}),w.dispose)}function VC(n,{inFlight:l,prepare:h}){if(l!=null&&l.current){h();return}let m=n.style.transition;n.style.transition="none",h(),n.offsetHeight,n.style.transition=m}function jC(n){var l,h;return((h=(l=n.getAnimations)==null?void 0:l.call(n))!=null?h:[]).some(m=>m instanceof CSSTransition&&m.playState!=="finished")}function ZC(n,{container:l,accept:h,walk:m}){let w=te.useRef(h),E=te.useRef(m);te.useEffect(()=>{w.current=h,E.current=m},[h,m]),Ar(()=>{if(!l||!n)return;let C=X1(l);if(!C)return;let c=w.current,D=E.current,B=Object.assign(X=>c(X),{acceptNode:c}),Z=C.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,B,!1);for(;Z.nextNode();)D(Z.currentNode)},[l,n,w,E])}function O4(n,l){let h=te.useRef([]),m=$n(n);te.useEffect(()=>{let w=[...h.current];for(let[E,C]of l.entries())if(h.current[E]!==C){let c=m(l,w);return h.current=l,c}},[m,...l])}function a0(){return typeof window<"u"}function cp(n){return k4(n)?(n.nodeName||"").toLowerCase():"#document"}function Gs(n){var l;return(n==null||(l=n.ownerDocument)==null?void 0:l.defaultView)||window}function dc(n){var l;return(l=(k4(n)?n.ownerDocument:n.document)||window.document)==null?void 0:l.documentElement}function k4(n){return a0()?n instanceof Node||n instanceof Gs(n).Node:!1}function es(n){return a0()?n instanceof Element||n instanceof Gs(n).Element:!1}function fc(n){return a0()?n instanceof HTMLElement||n instanceof Gs(n).HTMLElement:!1}function B4(n){return!a0()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof Gs(n).ShadowRoot}const GC=new Set(["inline","contents"]);function J1(n){const{overflow:l,overflowX:h,overflowY:m,display:w}=vl(n);return/auto|scroll|overlay|hidden|clip/.test(l+m+h)&&!GC.has(w)}const qC=new Set(["table","td","th"]);function HC(n){return qC.has(cp(n))}const XC=[":popover-open",":modal"];function s0(n){return XC.some(l=>{try{return n.matches(l)}catch{return!1}})}const YC=["transform","translate","scale","rotate","perspective"],QC=["transform","translate","scale","rotate","perspective","filter"],WC=["paint","layout","strict","content"];function Ay(n){const l=Ly(),h=es(n)?vl(n):n;return YC.some(m=>h[m]?h[m]!=="none":!1)||(h.containerType?h.containerType!=="normal":!1)||!l&&(h.backdropFilter?h.backdropFilter!=="none":!1)||!l&&(h.filter?h.filter!=="none":!1)||QC.some(m=>(h.willChange||"").includes(m))||WC.some(m=>(h.contain||"").includes(m))}function KC(n){let l=mh(n);for(;fc(l)&&!up(l);){if(Ay(l))return l;if(s0(l))return null;l=mh(l)}return null}function Ly(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const JC=new Set(["html","body","#document"]);function up(n){return JC.has(cp(n))}function vl(n){return Gs(n).getComputedStyle(n)}function o0(n){return es(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function mh(n){if(cp(n)==="html")return n;const l=n.assignedSlot||n.parentNode||B4(n)&&n.host||dc(n);return B4(l)?l.host:l}function F4(n){const l=mh(n);return up(l)?n.ownerDocument?n.ownerDocument.body:n.body:fc(l)&&J1(l)?l:F4(l)}function em(n,l,h){var m;l===void 0&&(l=[]),h===void 0&&(h=!0);const w=F4(n),E=w===((m=n.ownerDocument)==null?void 0:m.body),C=Gs(w);if(E){const c=Py(C);return l.concat(C,C.visualViewport||[],J1(w)?w:[],c&&h?em(c):[])}return l.concat(w,em(w,[],h))}function Py(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function eT(){const n=navigator.userAgentData;return n&&Array.isArray(n.brands)?n.brands.map(l=>{let{brand:h,version:m}=l;return h+"/"+m}).join(" "):navigator.userAgent}const zd=Math.min,Oa=Math.max,tm=Math.round,l0=Math.floor,pc=n=>({x:n,y:n}),tT={left:"right",right:"left",bottom:"top",top:"bottom"},nT={start:"end",end:"start"};function N4(n,l,h){return Oa(n,zd(l,h))}function hp(n,l){return typeof n=="function"?n(l):n}function gh(n){return n.split("-")[0]}function nm(n){return n.split("-")[1]}function U4(n){return n==="x"?"y":"x"}function $4(n){return n==="y"?"height":"width"}const iT=new Set(["top","bottom"]);function ou(n){return iT.has(gh(n))?"y":"x"}function V4(n){return U4(ou(n))}function rT(n,l,h){h===void 0&&(h=!1);const m=nm(n),w=V4(n),E=$4(w);let C=w==="x"?m===(h?"end":"start")?"right":"left":m==="start"?"bottom":"top";return l.reference[E]>l.floating[E]&&(C=c0(C)),[C,c0(C)]}function aT(n){const l=c0(n);return[Ry(n),l,Ry(l)]}function Ry(n){return n.replace(/start|end/g,l=>nT[l])}const j4=["left","right"],Z4=["right","left"],sT=["top","bottom"],oT=["bottom","top"];function lT(n,l,h){switch(n){case"top":case"bottom":return h?l?Z4:j4:l?j4:Z4;case"left":case"right":return l?sT:oT;default:return[]}}function cT(n,l,h,m){const w=nm(n);let E=lT(gh(n),h==="start",m);return w&&(E=E.map(C=>C+"-"+w),l&&(E=E.concat(E.map(Ry)))),E}function c0(n){return n.replace(/left|right|bottom|top/g,l=>tT[l])}function uT(n){return{top:0,right:0,bottom:0,left:0,...n}}function hT(n){return typeof n!="number"?uT(n):{top:n,right:n,bottom:n,left:n}}function u0(n){const{x:l,y:h,width:m,height:w}=n;return{width:m,height:w,top:h,left:l,right:l+m,bottom:h+w,x:l,y:h}}function G4(n,l,h){let{reference:m,floating:w}=n;const E=ou(l),C=V4(l),c=$4(C),D=gh(l),B=E==="y",Z=m.x+m.width/2-w.width/2,X=m.y+m.height/2-w.height/2,Y=m[c]/2-w[c]/2;let U;switch(D){case"top":U={x:Z,y:m.y-w.height};break;case"bottom":U={x:Z,y:m.y+m.height};break;case"right":U={x:m.x+m.width,y:X};break;case"left":U={x:m.x-w.width,y:X};break;default:U={x:m.x,y:m.y}}switch(nm(l)){case"start":U[C]-=Y*(h&&B?-1:1);break;case"end":U[C]+=Y*(h&&B?-1:1);break}return U}const dT=async(n,l,h)=>{const{placement:m="bottom",strategy:w="absolute",middleware:E=[],platform:C}=h,c=E.filter(Boolean),D=await(C.isRTL==null?void 0:C.isRTL(l));let B=await C.getElementRects({reference:n,floating:l,strategy:w}),{x:Z,y:X}=G4(B,m,D),Y=m,U={},oe=0;for(let ge=0;ge<c.length;ge++){const{name:ye,fn:Se}=c[ge],{x:je,y:Pe,data:Oe,reset:Je}=await Se({x:Z,y:X,initialPlacement:m,placement:Y,strategy:w,middlewareData:U,rects:B,platform:C,elements:{reference:n,floating:l}});Z=je??Z,X=Pe??X,U={...U,[ye]:{...U[ye],...Oe}},Je&&oe<=50&&(oe++,typeof Je=="object"&&(Je.placement&&(Y=Je.placement),Je.rects&&(B=Je.rects===!0?await C.getElementRects({reference:n,floating:l,strategy:w}):Je.rects),{x:Z,y:X}=G4(B,Y,D)),ge=-1)}return{x:Z,y:X,placement:Y,strategy:w,middlewareData:U}};async function h0(n,l){var h;l===void 0&&(l={});const{x:m,y:w,platform:E,rects:C,elements:c,strategy:D}=n,{boundary:B="clippingAncestors",rootBoundary:Z="viewport",elementContext:X="floating",altBoundary:Y=!1,padding:U=0}=hp(l,n),oe=hT(U),ye=c[Y?X==="floating"?"reference":"floating":X],Se=u0(await E.getClippingRect({element:(h=await(E.isElement==null?void 0:E.isElement(ye)))==null||h?ye:ye.contextElement||await(E.getDocumentElement==null?void 0:E.getDocumentElement(c.floating)),boundary:B,rootBoundary:Z,strategy:D})),je=X==="floating"?{x:m,y:w,width:C.floating.width,height:C.floating.height}:C.reference,Pe=await(E.getOffsetParent==null?void 0:E.getOffsetParent(c.floating)),Oe=await(E.isElement==null?void 0:E.isElement(Pe))?await(E.getScale==null?void 0:E.getScale(Pe))||{x:1,y:1}:{x:1,y:1},Je=u0(E.convertOffsetParentRelativeRectToViewportRelativeRect?await E.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:je,offsetParent:Pe,strategy:D}):je);return{top:(Se.top-Je.top+oe.top)/Oe.y,bottom:(Je.bottom-Se.bottom+oe.bottom)/Oe.y,left:(Se.left-Je.left+oe.left)/Oe.x,right:(Je.right-Se.right+oe.right)/Oe.x}}const fT=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(l){var h,m;const{placement:w,middlewareData:E,rects:C,initialPlacement:c,platform:D,elements:B}=l,{mainAxis:Z=!0,crossAxis:X=!0,fallbackPlacements:Y,fallbackStrategy:U="bestFit",fallbackAxisSideDirection:oe="none",flipAlignment:ge=!0,...ye}=hp(n,l);if((h=E.arrow)!=null&&h.alignmentOffset)return{};const Se=gh(w),je=ou(c),Pe=gh(c)===c,Oe=await(D.isRTL==null?void 0:D.isRTL(B.floating)),Je=Y||(Pe||!ge?[c0(c)]:aT(c)),et=oe!=="none";!Y&&et&&Je.push(...cT(c,ge,oe,Oe));const ot=[c,...Je],Rt=await h0(l,ye),Gt=[];let Tt=((m=E.flip)==null?void 0:m.overflows)||[];if(Z&&Gt.push(Rt[Se]),X){const sn=rT(w,C,Oe);Gt.push(Rt[sn[0]],Rt[sn[1]])}if(Tt=[...Tt,{placement:w,overflows:Gt}],!Gt.every(sn=>sn<=0)){var Ot,At;const sn=(((Ot=E.flip)==null?void 0:Ot.index)||0)+1,qt=ot[sn];if(qt&&(!(X==="alignment"?je!==ou(qt):!1)||Tt.every(wt=>ou(wt.placement)===je?wt.overflows[0]>0:!0)))return{data:{index:sn,overflows:Tt},reset:{placement:qt}};let $e=(At=Tt.filter(ft=>ft.overflows[0]<=0).sort((ft,wt)=>ft.overflows[1]-wt.overflows[1])[0])==null?void 0:At.placement;if(!$e)switch(U){case"bestFit":{var Qt;const ft=(Qt=Tt.filter(wt=>{if(et){const St=ou(wt.placement);return St===je||St==="y"}return!0}).map(wt=>[wt.placement,wt.overflows.filter(St=>St>0).reduce((St,Zt)=>St+Zt,0)]).sort((wt,St)=>wt[1]-St[1])[0])==null?void 0:Qt[0];ft&&($e=ft);break}case"initialPlacement":$e=c;break}if(w!==$e)return{reset:{placement:$e}}}return{}}}},pT=new Set(["left","top"]);async function mT(n,l){const{placement:h,platform:m,elements:w}=n,E=await(m.isRTL==null?void 0:m.isRTL(w.floating)),C=gh(h),c=nm(h),D=ou(h)==="y",B=pT.has(C)?-1:1,Z=E&&D?-1:1,X=hp(l,n);let{mainAxis:Y,crossAxis:U,alignmentAxis:oe}=typeof X=="number"?{mainAxis:X,crossAxis:0,alignmentAxis:null}:{mainAxis:X.mainAxis||0,crossAxis:X.crossAxis||0,alignmentAxis:X.alignmentAxis};return c&&typeof oe=="number"&&(U=c==="end"?oe*-1:oe),D?{x:U*Z,y:Y*B}:{x:Y*B,y:U*Z}}const gT=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(l){var h,m;const{x:w,y:E,placement:C,middlewareData:c}=l,D=await mT(l,n);return C===((h=c.offset)==null?void 0:h.placement)&&(m=c.arrow)!=null&&m.alignmentOffset?{}:{x:w+D.x,y:E+D.y,data:{...D,placement:C}}}}},yT=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(l){const{x:h,y:m,placement:w}=l,{mainAxis:E=!0,crossAxis:C=!1,limiter:c={fn:ye=>{let{x:Se,y:je}=ye;return{x:Se,y:je}}},...D}=hp(n,l),B={x:h,y:m},Z=await h0(l,D),X=ou(gh(w)),Y=U4(X);let U=B[Y],oe=B[X];if(E){const ye=Y==="y"?"top":"left",Se=Y==="y"?"bottom":"right",je=U+Z[ye],Pe=U-Z[Se];U=N4(je,U,Pe)}if(C){const ye=X==="y"?"top":"left",Se=X==="y"?"bottom":"right",je=oe+Z[ye],Pe=oe-Z[Se];oe=N4(je,oe,Pe)}const ge=c.fn({...l,[Y]:U,[X]:oe});return{...ge,data:{x:ge.x-h,y:ge.y-m,enabled:{[Y]:E,[X]:C}}}}}},_T=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(l){var h,m;const{placement:w,rects:E,platform:C,elements:c}=l,{apply:D=()=>{},...B}=hp(n,l),Z=await h0(l,B),X=gh(w),Y=nm(w),U=ou(w)==="y",{width:oe,height:ge}=E.floating;let ye,Se;X==="top"||X==="bottom"?(ye=X,Se=Y===(await(C.isRTL==null?void 0:C.isRTL(c.floating))?"start":"end")?"left":"right"):(Se=X,ye=Y==="end"?"top":"bottom");const je=ge-Z.top-Z.bottom,Pe=oe-Z.left-Z.right,Oe=zd(ge-Z[ye],je),Je=zd(oe-Z[Se],Pe),et=!l.middlewareData.shift;let ot=Oe,Rt=Je;if((h=l.middlewareData.shift)!=null&&h.enabled.x&&(Rt=Pe),(m=l.middlewareData.shift)!=null&&m.enabled.y&&(ot=je),et&&!Y){const Tt=Oa(Z.left,0),Ot=Oa(Z.right,0),At=Oa(Z.top,0),Qt=Oa(Z.bottom,0);U?Rt=oe-2*(Tt!==0||Ot!==0?Tt+Ot:Oa(Z.left,Z.right)):ot=ge-2*(At!==0||Qt!==0?At+Qt:Oa(Z.top,Z.bottom))}await D({...l,availableWidth:Rt,availableHeight:ot});const Gt=await C.getDimensions(c.floating);return oe!==Gt.width||ge!==Gt.height?{reset:{rects:!0}}:{}}}};function q4(n){const l=vl(n);let h=parseFloat(l.width)||0,m=parseFloat(l.height)||0;const w=fc(n),E=w?n.offsetWidth:h,C=w?n.offsetHeight:m,c=tm(h)!==E||tm(m)!==C;return c&&(h=E,m=C),{width:h,height:m,$:c}}function Iy(n){return es(n)?n:n.contextElement}function dp(n){const l=Iy(n);if(!fc(l))return pc(1);const h=l.getBoundingClientRect(),{width:m,height:w,$:E}=q4(l);let C=(E?tm(h.width):h.width)/m,c=(E?tm(h.height):h.height)/w;return(!C||!Number.isFinite(C))&&(C=1),(!c||!Number.isFinite(c))&&(c=1),{x:C,y:c}}const vT=pc(0);function H4(n){const l=Gs(n);return!Ly()||!l.visualViewport?vT:{x:l.visualViewport.offsetLeft,y:l.visualViewport.offsetTop}}function xT(n,l,h){return l===void 0&&(l=!1),!h||l&&h!==Gs(n)?!1:l}function Dd(n,l,h,m){l===void 0&&(l=!1),h===void 0&&(h=!1);const w=n.getBoundingClientRect(),E=Iy(n);let C=pc(1);l&&(m?es(m)&&(C=dp(m)):C=dp(n));const c=xT(E,h,m)?H4(E):pc(0);let D=(w.left+c.x)/C.x,B=(w.top+c.y)/C.y,Z=w.width/C.x,X=w.height/C.y;if(E){const Y=Gs(E),U=m&&es(m)?Gs(m):m;let oe=Y,ge=Py(oe);for(;ge&&m&&U!==oe;){const ye=dp(ge),Se=ge.getBoundingClientRect(),je=vl(ge),Pe=Se.left+(ge.clientLeft+parseFloat(je.paddingLeft))*ye.x,Oe=Se.top+(ge.clientTop+parseFloat(je.paddingTop))*ye.y;D*=ye.x,B*=ye.y,Z*=ye.x,X*=ye.y,D+=Pe,B+=Oe,oe=Gs(ge),ge=Py(oe)}}return u0({width:Z,height:X,x:D,y:B})}function d0(n,l){const h=o0(n).scrollLeft;return l?l.left+h:Dd(dc(n)).left+h}function X4(n,l){const h=n.getBoundingClientRect(),m=h.left+l.scrollLeft-d0(n,h),w=h.top+l.scrollTop;return{x:m,y:w}}function bT(n){let{elements:l,rect:h,offsetParent:m,strategy:w}=n;const E=w==="fixed",C=dc(m),c=l?s0(l.floating):!1;if(m===C||c&&E)return h;let D={scrollLeft:0,scrollTop:0},B=pc(1);const Z=pc(0),X=fc(m);if((X||!X&&!E)&&((cp(m)!=="body"||J1(C))&&(D=o0(m)),fc(m))){const U=Dd(m);B=dp(m),Z.x=U.x+m.clientLeft,Z.y=U.y+m.clientTop}const Y=C&&!X&&!E?X4(C,D):pc(0);return{width:h.width*B.x,height:h.height*B.y,x:h.x*B.x-D.scrollLeft*B.x+Z.x+Y.x,y:h.y*B.y-D.scrollTop*B.y+Z.y+Y.y}}function wT(n){return Array.from(n.getClientRects())}function ST(n){const l=dc(n),h=o0(n),m=n.ownerDocument.body,w=Oa(l.scrollWidth,l.clientWidth,m.scrollWidth,m.clientWidth),E=Oa(l.scrollHeight,l.clientHeight,m.scrollHeight,m.clientHeight);let C=-h.scrollLeft+d0(n);const c=-h.scrollTop;return vl(m).direction==="rtl"&&(C+=Oa(l.clientWidth,m.clientWidth)-w),{width:w,height:E,x:C,y:c}}const Y4=25;function CT(n,l){const h=Gs(n),m=dc(n),w=h.visualViewport;let E=m.clientWidth,C=m.clientHeight,c=0,D=0;if(w){E=w.width,C=w.height;const Z=Ly();(!Z||Z&&l==="fixed")&&(c=w.offsetLeft,D=w.offsetTop)}const B=d0(m);if(B<=0){const Z=m.ownerDocument,X=Z.body,Y=getComputedStyle(X),U=Z.compatMode==="CSS1Compat"&&parseFloat(Y.marginLeft)+parseFloat(Y.marginRight)||0,oe=Math.abs(m.clientWidth-X.clientWidth-U);oe<=Y4&&(E-=oe)}else B<=Y4&&(E+=B);return{width:E,height:C,x:c,y:D}}const TT=new Set(["absolute","fixed"]);function ET(n,l){const h=Dd(n,!0,l==="fixed"),m=h.top+n.clientTop,w=h.left+n.clientLeft,E=fc(n)?dp(n):pc(1),C=n.clientWidth*E.x,c=n.clientHeight*E.y,D=w*E.x,B=m*E.y;return{width:C,height:c,x:D,y:B}}function Q4(n,l,h){let m;if(l==="viewport")m=CT(n,h);else if(l==="document")m=ST(dc(n));else if(es(l))m=ET(l,h);else{const w=H4(n);m={x:l.x-w.x,y:l.y-w.y,width:l.width,height:l.height}}return u0(m)}function W4(n,l){const h=mh(n);return h===l||!es(h)||up(h)?!1:vl(h).position==="fixed"||W4(h,l)}function MT(n,l){const h=l.get(n);if(h)return h;let m=em(n,[],!1).filter(c=>es(c)&&cp(c)!=="body"),w=null;const E=vl(n).position==="fixed";let C=E?mh(n):n;for(;es(C)&&!up(C);){const c=vl(C),D=Ay(C);!D&&c.position==="fixed"&&(w=null),(E?!D&&!w:!D&&c.position==="static"&&!!w&&TT.has(w.position)||J1(C)&&!D&&W4(n,C))?m=m.filter(Z=>Z!==C):w=c,C=mh(C)}return l.set(n,m),m}function AT(n){let{element:l,boundary:h,rootBoundary:m,strategy:w}=n;const C=[...h==="clippingAncestors"?s0(l)?[]:MT(l,this._c):[].concat(h),m],c=C[0],D=C.reduce((B,Z)=>{const X=Q4(l,Z,w);return B.top=Oa(X.top,B.top),B.right=zd(X.right,B.right),B.bottom=zd(X.bottom,B.bottom),B.left=Oa(X.left,B.left),B},Q4(l,c,w));return{width:D.right-D.left,height:D.bottom-D.top,x:D.left,y:D.top}}function LT(n){const{width:l,height:h}=q4(n);return{width:l,height:h}}function PT(n,l,h){const m=fc(l),w=dc(l),E=h==="fixed",C=Dd(n,!0,E,l);let c={scrollLeft:0,scrollTop:0};const D=pc(0);function B(){D.x=d0(w)}if(m||!m&&!E)if((cp(l)!=="body"||J1(w))&&(c=o0(l)),m){const U=Dd(l,!0,E,l);D.x=U.x+l.clientLeft,D.y=U.y+l.clientTop}else w&&B();E&&!m&&w&&B();const Z=w&&!m&&!E?X4(w,c):pc(0),X=C.left+c.scrollLeft-D.x-Z.x,Y=C.top+c.scrollTop-D.y-Z.y;return{x:X,y:Y,width:C.width,height:C.height}}function zy(n){return vl(n).position==="static"}function K4(n,l){if(!fc(n)||vl(n).position==="fixed")return null;if(l)return l(n);let h=n.offsetParent;return dc(n)===h&&(h=h.ownerDocument.body),h}function J4(n,l){const h=Gs(n);if(s0(n))return h;if(!fc(n)){let w=mh(n);for(;w&&!up(w);){if(es(w)&&!zy(w))return w;w=mh(w)}return h}let m=K4(n,l);for(;m&&HC(m)&&zy(m);)m=K4(m,l);return m&&up(m)&&zy(m)&&!Ay(m)?h:m||KC(n)||h}const RT=async function(n){const l=this.getOffsetParent||J4,h=this.getDimensions,m=await h(n.floating);return{reference:PT(n.reference,await l(n.floating),n.strategy),floating:{x:0,y:0,width:m.width,height:m.height}}};function IT(n){return vl(n).direction==="rtl"}const zT={convertOffsetParentRelativeRectToViewportRelativeRect:bT,getDocumentElement:dc,getClippingRect:AT,getOffsetParent:J4,getElementRects:RT,getClientRects:wT,getDimensions:LT,getScale:dp,isElement:es,isRTL:IT};function e5(n,l){return n.x===l.x&&n.y===l.y&&n.width===l.width&&n.height===l.height}function DT(n,l){let h=null,m;const w=dc(n);function E(){var c;clearTimeout(m),(c=h)==null||c.disconnect(),h=null}function C(c,D){c===void 0&&(c=!1),D===void 0&&(D=1),E();const B=n.getBoundingClientRect(),{left:Z,top:X,width:Y,height:U}=B;if(c||l(),!Y||!U)return;const oe=l0(X),ge=l0(w.clientWidth-(Z+Y)),ye=l0(w.clientHeight-(X+U)),Se=l0(Z),Pe={rootMargin:-oe+"px "+-ge+"px "+-ye+"px "+-Se+"px",threshold:Oa(0,zd(1,D))||1};let Oe=!0;function Je(et){const ot=et[0].intersectionRatio;if(ot!==D){if(!Oe)return C();ot?C(!1,ot):m=setTimeout(()=>{C(!1,1e-7)},1e3)}ot===1&&!e5(B,n.getBoundingClientRect())&&C(),Oe=!1}try{h=new IntersectionObserver(Je,{...Pe,root:w.ownerDocument})}catch{h=new IntersectionObserver(Je,Pe)}h.observe(n)}return C(!0),E}function OT(n,l,h,m){m===void 0&&(m={});const{ancestorScroll:w=!0,ancestorResize:E=!0,elementResize:C=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:D=!1}=m,B=Iy(n),Z=w||E?[...B?em(B):[],...em(l)]:[];Z.forEach(Se=>{w&&Se.addEventListener("scroll",h,{passive:!0}),E&&Se.addEventListener("resize",h)});const X=B&&c?DT(B,h):null;let Y=-1,U=null;C&&(U=new ResizeObserver(Se=>{let[je]=Se;je&&je.target===B&&U&&(U.unobserve(l),cancelAnimationFrame(Y),Y=requestAnimationFrame(()=>{var Pe;(Pe=U)==null||Pe.observe(l)})),h()}),B&&!D&&U.observe(B),U.observe(l));let oe,ge=D?Dd(n):null;D&&ye();function ye(){const Se=Dd(n);ge&&!e5(ge,Se)&&h(),ge=Se,oe=requestAnimationFrame(ye)}return h(),()=>{var Se;Z.forEach(je=>{w&&je.removeEventListener("scroll",h),E&&je.removeEventListener("resize",h)}),X==null||X(),(Se=U)==null||Se.disconnect(),U=null,D&&cancelAnimationFrame(oe)}}const Dy=h0,kT=gT,BT=yT,FT=fT,NT=_T,UT=(n,l,h)=>{const m=new Map,w={platform:zT,...h},E={...w.platform,_c:m};return dT(n,l,{...w,platform:E})};var $T=typeof document<"u",VT=function(){},f0=$T?te.useLayoutEffect:VT;function p0(n,l){if(n===l)return!0;if(typeof n!=typeof l)return!1;if(typeof n=="function"&&n.toString()===l.toString())return!0;let h,m,w;if(n&&l&&typeof n=="object"){if(Array.isArray(n)){if(h=n.length,h!==l.length)return!1;for(m=h;m--!==0;)if(!p0(n[m],l[m]))return!1;return!0}if(w=Object.keys(n),h=w.length,h!==Object.keys(l).length)return!1;for(m=h;m--!==0;)if(!{}.hasOwnProperty.call(l,w[m]))return!1;for(m=h;m--!==0;){const E=w[m];if(!(E==="_owner"&&n.$$typeof)&&!p0(n[E],l[E]))return!1}return!0}return n!==n&&l!==l}function t5(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function n5(n,l){const h=t5(n);return Math.round(l*h)/h}function Oy(n){const l=te.useRef(n);return f0(()=>{l.current=n}),l}function jT(n){n===void 0&&(n={});const{placement:l="bottom",strategy:h="absolute",middleware:m=[],platform:w,elements:{reference:E,floating:C}={},transform:c=!0,whileElementsMounted:D,open:B}=n,[Z,X]=te.useState({x:0,y:0,strategy:h,placement:l,middlewareData:{},isPositioned:!1}),[Y,U]=te.useState(m);p0(Y,m)||U(m);const[oe,ge]=te.useState(null),[ye,Se]=te.useState(null),je=te.useCallback(wt=>{wt!==et.current&&(et.current=wt,ge(wt))},[]),Pe=te.useCallback(wt=>{wt!==ot.current&&(ot.current=wt,Se(wt))},[]),Oe=E||oe,Je=C||ye,et=te.useRef(null),ot=te.useRef(null),Rt=te.useRef(Z),Gt=D!=null,Tt=Oy(D),Ot=Oy(w),At=Oy(B),Qt=te.useCallback(()=>{if(!et.current||!ot.current)return;const wt={placement:l,strategy:h,middleware:Y};Ot.current&&(wt.platform=Ot.current),UT(et.current,ot.current,wt).then(St=>{const Zt={...St,isPositioned:At.current!==!1};sn.current&&!p0(Rt.current,Zt)&&(Rt.current=Zt,la.flushSync(()=>{X(Zt)}))})},[Y,l,h,Ot,At]);f0(()=>{B===!1&&Rt.current.isPositioned&&(Rt.current.isPositioned=!1,X(wt=>({...wt,isPositioned:!1})))},[B]);const sn=te.useRef(!1);f0(()=>(sn.current=!0,()=>{sn.current=!1}),[]),f0(()=>{if(Oe&&(et.current=Oe),Je&&(ot.current=Je),Oe&&Je){if(Tt.current)return Tt.current(Oe,Je,Qt);Qt()}},[Oe,Je,Qt,Tt,Gt]);const qt=te.useMemo(()=>({reference:et,floating:ot,setReference:je,setFloating:Pe}),[je,Pe]),$e=te.useMemo(()=>({reference:Oe,floating:Je}),[Oe,Je]),ft=te.useMemo(()=>{const wt={position:h,left:0,top:0};if(!$e.floating)return wt;const St=n5($e.floating,Z.x),Zt=n5($e.floating,Z.y);return c?{...wt,transform:"translate("+St+"px, "+Zt+"px)",...t5($e.floating)>=1.5&&{willChange:"transform"}}:{position:h,left:St,top:Zt}},[h,c,$e.floating,Z.x,Z.y]);return te.useMemo(()=>({...Z,update:Qt,refs:qt,elements:$e,floatingStyles:ft}),[Z,Qt,qt,$e,ft])}const i5=(n,l)=>({...kT(n),options:[n,l]}),ZT=(n,l)=>({...BT(n),options:[n,l]}),GT=(n,l)=>({...FT(n),options:[n,l]}),qT=(n,l)=>({...NT(n),options:[n,l]}),r5={...ux},HT=r5.useInsertionEffect||(n=>n());function a5(n){const l=te.useRef(()=>{});return HT(()=>{l.current=n}),te.useCallback(function(){for(var h=arguments.length,m=new Array(h),w=0;w<h;w++)m[w]=arguments[w];return l.current==null?void 0:l.current(...m)},[])}var ky=typeof document<"u"?te.useLayoutEffect:te.useEffect;let s5=!1,XT=0;const o5=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+XT++;function YT(){const[n,l]=te.useState(()=>s5?o5():void 0);return ky(()=>{n==null&&l(o5())},[]),te.useEffect(()=>{s5=!0},[]),n}const QT=r5.useId||YT;function WT(){const n=new Map;return{emit(l,h){var m;(m=n.get(l))==null||m.forEach(w=>w(h))},on(l,h){n.set(l,[...n.get(l)||[],h])},off(l,h){var m;n.set(l,((m=n.get(l))==null?void 0:m.filter(w=>w!==h))||[])}}}const KT=te.createContext(null),JT=te.createContext(null),eE=()=>{var n;return((n=te.useContext(KT))==null?void 0:n.id)||null},tE=()=>te.useContext(JT),nE="data-floating-ui-focusable";function iE(n){const{open:l=!1,onOpenChange:h,elements:m}=n,w=QT(),E=te.useRef({}),[C]=te.useState(()=>WT()),c=eE()!=null,[D,B]=te.useState(m.reference),Z=a5((U,oe,ge)=>{E.current.openEvent=U?oe:void 0,C.emit("openchange",{open:U,event:oe,reason:ge,nested:c}),h==null||h(U,oe,ge)}),X=te.useMemo(()=>({setPositionReference:B}),[]),Y=te.useMemo(()=>({reference:D||m.reference||null,floating:m.floating||null,domReference:m.reference}),[D,m.reference,m.floating]);return te.useMemo(()=>({dataRef:E,open:l,onOpenChange:Z,elements:Y,events:C,floatingId:w,refs:X}),[l,Z,Y,C,w,X])}function rE(n){n===void 0&&(n={});const{nodeId:l}=n,h=iE({...n,elements:{reference:null,floating:null,...n.elements}}),m=n.rootContext||h,w=m.elements,[E,C]=te.useState(null),[c,D]=te.useState(null),Z=(w==null?void 0:w.domReference)||E,X=te.useRef(null),Y=tE();ky(()=>{Z&&(X.current=Z)},[Z]);const U=jT({...n,elements:{...w,...c&&{reference:c}}}),oe=te.useCallback(Pe=>{const Oe=es(Pe)?{getBoundingClientRect:()=>Pe.getBoundingClientRect(),contextElement:Pe}:Pe;D(Oe),U.refs.setReference(Oe)},[U.refs]),ge=te.useCallback(Pe=>{(es(Pe)||Pe===null)&&(X.current=Pe,C(Pe)),(es(U.refs.reference.current)||U.refs.reference.current===null||Pe!==null&&!es(Pe))&&U.refs.setReference(Pe)},[U.refs]),ye=te.useMemo(()=>({...U.refs,setReference:ge,setPositionReference:oe,domReference:X}),[U.refs,ge,oe]),Se=te.useMemo(()=>({...U.elements,domReference:Z}),[U.elements,Z]),je=te.useMemo(()=>({...U,...m,refs:ye,elements:Se,nodeId:l}),[U,ye,Se,l,m]);return ky(()=>{m.dataRef.current.floatingContext=je;const Pe=Y==null?void 0:Y.nodesRef.current.find(Oe=>Oe.id===l);Pe&&(Pe.context=je)}),te.useMemo(()=>({...U,context:je,refs:ye,elements:Se}),[U,ye,Se,je])}const l5="active",c5="selected";function By(n,l,h){const m=new Map,w=h==="item";let E=n;if(w&&n){const{[l5]:C,[c5]:c,...D}=n;E=D}return{...h==="floating"&&{tabIndex:-1,[nE]:""},...E,...l.map(C=>{const c=C?C[h]:null;return typeof c=="function"?n?c(n):null:c}).concat(n).reduce((C,c)=>(c&&Object.entries(c).forEach(D=>{let[B,Z]=D;if(!(w&&[l5,c5].includes(B)))if(B.indexOf("on")===0){if(m.has(B)||m.set(B,[]),typeof Z=="function"){var X;(X=m.get(B))==null||X.push(Z),C[B]=function(){for(var Y,U=arguments.length,oe=new Array(U),ge=0;ge<U;ge++)oe[ge]=arguments[ge];return(Y=m.get(B))==null?void 0:Y.map(ye=>ye(...oe)).find(ye=>ye!==void 0)}}}else C[B]=Z}),C),{})}}function aE(n){n===void 0&&(n=[]);const l=n.map(c=>c==null?void 0:c.reference),h=n.map(c=>c==null?void 0:c.floating),m=n.map(c=>c==null?void 0:c.item),w=te.useCallback(c=>By(c,n,"reference"),l),E=te.useCallback(c=>By(c,n,"floating"),h),C=te.useCallback(c=>By(c,n,"item"),m);return te.useMemo(()=>({getReferenceProps:w,getFloatingProps:E,getItemProps:C}),[w,E,C])}function u5(n,l){return{...n,rects:{...n.rects,floating:{...n.rects.floating,height:l}}}}const sE=n=>({name:"inner",options:n,async fn(l){const{listRef:h,overflowRef:m,onFallbackChange:w,offset:E=0,index:C=0,minItemsVisible:c=4,referenceOverflowThreshold:D=0,scrollRef:B,...Z}=hp(n,l),{rects:X,elements:{floating:Y}}=l,U=h.current[C],oe=(B==null?void 0:B.current)||Y,ge=Y.clientTop||oe.clientTop,ye=Y.clientTop!==0,Se=oe.clientTop!==0,je=Y===oe;if(!U)return{};const Pe={...l,...await i5(-U.offsetTop-Y.clientTop-X.reference.height/2-U.offsetHeight/2-E).fn(l)},Oe=await Dy(u5(Pe,oe.scrollHeight+ge+Y.clientTop),Z),Je=await Dy(Pe,{...Z,elementContext:"reference"}),et=Oa(0,Oe.top),ot=Pe.y+et,Tt=(oe.scrollHeight>oe.clientHeight?Ot=>Ot:tm)(Oa(0,oe.scrollHeight+(ye&&je||Se?ge*2:0)-et-Oa(0,Oe.bottom)));if(oe.style.maxHeight=Tt+"px",oe.scrollTop=et,w){const Ot=oe.offsetHeight<U.offsetHeight*zd(c,h.current.length)-1||Je.top>=-D||Je.bottom>=-D;la.flushSync(()=>w(Ot))}return m&&(m.current=await Dy(u5({...Pe,y:ot},oe.offsetHeight+ge+Y.clientTop),Z)),{y:ot}}});function oE(n,l){const{open:h,elements:m}=n,{enabled:w=!0,overflowRef:E,scrollRef:C,onChange:c}=l,D=a5(c),B=te.useRef(!1),Z=te.useRef(null),X=te.useRef(null);te.useEffect(()=>{if(!w)return;function U(ge){if(ge.ctrlKey||!oe||E.current==null)return;const ye=ge.deltaY,Se=E.current.top>=-.5,je=E.current.bottom>=-.5,Pe=oe.scrollHeight-oe.clientHeight,Oe=ye<0?-1:1,Je=ye<0?"max":"min";oe.scrollHeight<=oe.clientHeight||(!Se&&ye>0||!je&&ye<0?(ge.preventDefault(),la.flushSync(()=>{D(et=>et+Math[Je](ye,Pe*Oe))})):/firefox/i.test(eT())&&(oe.scrollTop+=ye))}const oe=(C==null?void 0:C.current)||m.floating;if(h&&oe)return oe.addEventListener("wheel",U),requestAnimationFrame(()=>{Z.current=oe.scrollTop,E.current!=null&&(X.current={...E.current})}),()=>{Z.current=null,X.current=null,oe.removeEventListener("wheel",U)}},[w,h,m.floating,E,C,D]);const Y=te.useMemo(()=>({onKeyDown(){B.current=!0},onWheel(){B.current=!1},onPointerMove(){B.current=!1},onScroll(){const U=(C==null?void 0:C.current)||m.floating;if(!(!E.current||!U||!B.current)){if(Z.current!==null){const oe=U.scrollTop-Z.current;(E.current.bottom<-.5&&oe<-1||E.current.top<-.5&&oe>1)&&la.flushSync(()=>D(ge=>ge+oe))}requestAnimationFrame(()=>{Z.current=U.scrollTop})}}}),[m.floating,D,E,C]);return te.useMemo(()=>w?{floating:Y}:{},[w,Y])}let im=te.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});im.displayName="FloatingContext";let Fy=te.createContext(null);Fy.displayName="PlacementContext";function lE(n){return te.useMemo(()=>n?typeof n=="string"?{to:n}:n:null,[n])}function cE(){return te.useContext(im).setReference}function uE(){let{getFloatingProps:n,slot:l}=te.useContext(im);return te.useCallback((...h)=>Object.assign({},n(...h),{"data-anchor":l.anchor}),[n,l])}function hE(n=null){n===!1&&(n=null),typeof n=="string"&&(n={to:n});let l=te.useContext(Fy),h=te.useMemo(()=>n,[JSON.stringify(n,(w,E)=>{var C;return(C=E==null?void 0:E.outerHTML)!=null?C:E})]);Ar(()=>{l==null||l(h??null)},[l,h]);let m=te.useContext(im);return te.useMemo(()=>[m.setFloating,n?m.styles:{}],[m.setFloating,n,m.styles])}let h5=4;function dE({children:n,enabled:l=!0}){let[h,m]=te.useState(null),[w,E]=te.useState(0),C=te.useRef(null),[c,D]=te.useState(null);fE(c);let B=l&&h!==null&&c!==null,{to:Z="bottom",gap:X=0,offset:Y=0,padding:U=0,inner:oe}=pE(h,c),[ge,ye="center"]=Z.split(" ");Ar(()=>{B&&E(0)},[B]);let{refs:Se,floatingStyles:je,context:Pe}=rE({open:B,placement:ge==="selection"?ye==="center"?"bottom":`bottom-${ye}`:ye==="center"?`${ge}`:`${ge}-${ye}`,strategy:"absolute",transform:!1,middleware:[i5({mainAxis:ge==="selection"?0:X,crossAxis:Y}),ZT({padding:U}),ge!=="selection"&&GT({padding:U}),ge==="selection"&&oe?sE({...oe,padding:U,overflowRef:C,offset:w,minItemsVisible:h5,referenceOverflowThreshold:U,onFallbackChange(Ot){var At,Qt;if(!Ot)return;let sn=Pe.elements.floating;if(!sn)return;let qt=parseFloat(getComputedStyle(sn).scrollPaddingBottom)||0,$e=Math.min(h5,sn.childElementCount),ft=0,wt=0;for(let St of(Qt=(At=Pe.elements.floating)==null?void 0:At.childNodes)!=null?Qt:[])if(ph(St)){let Zt=St.offsetTop,we=Zt+St.clientHeight+qt,Be=sn.scrollTop,pt=Be+sn.clientHeight;if(Zt>=Be&&we<=pt)$e--;else{wt=Math.max(0,Math.min(we,pt)-Math.max(Zt,Be)),ft=St.clientHeight;break}}$e>=1&&E(St=>{let Zt=ft*$e-wt+qt;return St>=Zt?St:Zt})}}):null,qT({padding:U,apply({availableWidth:Ot,availableHeight:At,elements:Qt}){Object.assign(Qt.floating.style,{overflow:"auto",maxWidth:`${Ot}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${At}px)`})}})].filter(Boolean),whileElementsMounted:OT}),[Oe=ge,Je=ye]=Pe.placement.split("-");ge==="selection"&&(Oe="selection");let et=te.useMemo(()=>({anchor:[Oe,Je].filter(Boolean).join(" ")}),[Oe,Je]),ot=oE(Pe,{overflowRef:C,onChange:E}),{getReferenceProps:Rt,getFloatingProps:Gt}=aE([ot]),Tt=$n(Ot=>{D(Ot),Se.setFloating(Ot)});return te.createElement(Fy.Provider,{value:m},te.createElement(im.Provider,{value:{setFloating:Tt,setReference:Se.setReference,styles:je,getReferenceProps:Rt,getFloatingProps:Gt,slot:et}},n))}function fE(n){Ar(()=>{if(!n)return;let l=new MutationObserver(()=>{let h=window.getComputedStyle(n).maxHeight,m=parseFloat(h);if(isNaN(m))return;let w=parseInt(h);isNaN(w)||m!==w&&(n.style.maxHeight=`${Math.ceil(m)}px`)});return l.observe(n,{attributes:!0,attributeFilter:["style"]}),()=>{l.disconnect()}},[n])}function pE(n,l){var h,m,w;let E=Ny((h=n==null?void 0:n.gap)!=null?h:"var(--anchor-gap, 0)",l),C=Ny((m=n==null?void 0:n.offset)!=null?m:"var(--anchor-offset, 0)",l),c=Ny((w=n==null?void 0:n.padding)!=null?w:"var(--anchor-padding, 0)",l);return{...n,gap:E,offset:C,padding:c}}function Ny(n,l,h=void 0){let m=sp(),w=$n((D,B)=>{if(D==null)return[h,null];if(typeof D=="number")return[D,null];if(typeof D=="string"){if(!B)return[h,null];let Z=f5(D,B);return[Z,X=>{let Y=d5(D);{let U=Y.map(oe=>window.getComputedStyle(B).getPropertyValue(oe));m.requestAnimationFrame(function oe(){m.nextFrame(oe);let ge=!1;for(let[Se,je]of Y.entries()){let Pe=window.getComputedStyle(B).getPropertyValue(je);if(U[Se]!==Pe){U[Se]=Pe,ge=!0;break}}if(!ge)return;let ye=f5(D,B);Z!==ye&&(X(ye),Z=ye)})}return m.dispose}]}return[h,null]}),E=te.useMemo(()=>w(n,l)[0],[n,l]),[C=E,c]=te.useState();return Ar(()=>{let[D,B]=w(n,l);if(c(D),!!B)return B(c)},[n,l]),C}function d5(n){let l=/var\((.*)\)/.exec(n);if(l){let h=l[1].indexOf(",");if(h===-1)return[l[1]];let m=l[1].slice(0,h).trim(),w=l[1].slice(h+1).trim();return w?[m,...d5(w)]:[m]}return[]}function f5(n,l){let h=document.createElement("div");l.appendChild(h),h.style.setProperty("margin-top","0px","important"),h.style.setProperty("margin-top",n,"important");let m=parseFloat(window.getComputedStyle(h).marginTop)||0;return l.removeChild(h),m}function mE({children:n,freeze:l},h){let m=Uy(l,n);return te.isValidElement(m)?te.cloneElement(m,{ref:h}):Fn.createElement(Fn.Fragment,null,m)}const gE=Fn.forwardRef(mE);function Uy(n,l){let[h,m]=te.useState(l);return!n&&h!==l&&m(l),n?h:l}let $y=te.createContext(null);$y.displayName="OpenClosedContext";var rm=(n=>(n[n.Open=1]="Open",n[n.Closed=2]="Closed",n[n.Closing=4]="Closing",n[n.Opening=8]="Opening",n))(rm||{});function yE(){return te.useContext($y)}function _E({value:n,children:l}){return Fn.createElement($y.Provider,{value:n},l)}function vE(n){function l(){document.readyState!=="loading"&&(n(),document.removeEventListener("DOMContentLoaded",l))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",l),l())}let Od=[];vE(()=>{function n(l){if(!Rd(l.target)||l.target===document.body||Od[0]===l.target)return;let h=l.target;h=h.closest(Ty),Od.unshift(h??l.target),Od=Od.filter(m=>m!=null&&m.isConnected),Od.splice(10)}window.addEventListener("click",n,{capture:!0}),window.addEventListener("mousedown",n,{capture:!0}),window.addEventListener("focus",n,{capture:!0}),document.body.addEventListener("click",n,{capture:!0}),document.body.addEventListener("mousedown",n,{capture:!0}),document.body.addEventListener("focus",n,{capture:!0})});function xE(n){throw new Error("Unexpected object: "+n)}var Hr=(n=>(n[n.First=0]="First",n[n.Previous=1]="Previous",n[n.Next=2]="Next",n[n.Last=3]="Last",n[n.Specific=4]="Specific",n[n.Nothing=5]="Nothing",n))(Hr||{});function p5(n,l){let h=l.resolveItems();if(h.length<=0)return null;let m=l.resolveActiveIndex(),w=m??-1;switch(n.focus){case 0:{for(let E=0;E<h.length;++E)if(!l.resolveDisabled(h[E],E,h))return E;return m}case 1:{w===-1&&(w=h.length);for(let E=w-1;E>=0;--E)if(!l.resolveDisabled(h[E],E,h))return E;return m}case 2:{for(let E=w+1;E<h.length;++E)if(!l.resolveDisabled(h[E],E,h))return E;return m}case 3:{for(let E=h.length-1;E>=0;--E)if(!l.resolveDisabled(h[E],E,h))return E;return m}case 4:{for(let E=0;E<h.length;++E)if(l.resolveId(h[E],E,h)===n.id)return E;return m}case 5:return null;default:xE(n)}}function m5(n){let l=$n(n),h=te.useRef(!1);te.useEffect(()=>(h.current=!1,()=>{h.current=!0,j3(()=>{h.current&&l()})}),[l])}let bE=te.createContext(!1);function wE(){return te.useContext(bE)}function SE(n){let l=wE(),h=te.useContext(y5),[m,w]=te.useState(()=>{var E;if(!l&&h!==null)return(E=h.current)!=null?E:null;if(Ad.isServer)return null;let C=n==null?void 0:n.getElementById("headlessui-portal-root");if(C)return C;if(n===null)return null;let c=n.createElement("div");return c.setAttribute("id","headlessui-portal-root"),n.body.appendChild(c)});return te.useEffect(()=>{m!==null&&(n!=null&&n.body.contains(m)||n==null||n.body.appendChild(m))},[m,n]),te.useEffect(()=>{l||h!==null&&w(h.current)},[h,w,l]),m}let g5=te.Fragment,CE=Po(function(n,l){let{ownerDocument:h=null,...m}=n,w=te.useRef(null),E=su(PS(Y=>{w.current=Y}),l),C=My(w.current),c=h??C,D=SE(c),B=te.useContext(AE),Z=sp(),X=Lo();return m5(()=>{var Y;D&&D.childNodes.length<=0&&((Y=D.parentElement)==null||Y.removeChild(D))}),D?la.createPortal(Fn.createElement("div",{"data-headlessui-portal":"",ref:Y=>{Z.dispose(),B&&Y&&Z.add(B.register(Y))}},X({ourProps:{ref:E},theirProps:m,slot:{},defaultTag:g5,name:"Portal"})),D):null});function TE(n,l){let h=su(l),{enabled:m=!0,ownerDocument:w,...E}=n,C=Lo();return m?Fn.createElement(CE,{...E,ownerDocument:w,ref:h}):C({ourProps:{ref:h},theirProps:E,slot:{},defaultTag:g5,name:"Portal"})}let EE=te.Fragment,y5=te.createContext(null);function ME(n,l){let{target:h,...m}=n,w={ref:su(l)},E=Lo();return Fn.createElement(y5.Provider,{value:h},E({ourProps:w,theirProps:m,defaultTag:EE,name:"Popover.Group"}))}let AE=te.createContext(null),LE=Po(TE),PE=Po(ME),RE=Object.assign(LE,{Group:PE});const am={Idle:{kind:"Idle"},Tracked:n=>({kind:"Tracked",position:n}),Moved:{kind:"Moved"}};function _5(n){let l=n.getBoundingClientRect();return`${l.x},${l.y}`}function IE(n,l,h){let m=Ao();if(l.kind==="Tracked"){let w=function(){E!==_5(n)&&(m.dispose(),h())},{position:E}=l,C=new ResizeObserver(w);C.observe(n),m.add(()=>C.disconnect()),m.addEventListener(window,"scroll",w,{passive:!0}),m.addEventListener(window,"resize",w)}return()=>m.dispose()}var zE=Object.defineProperty,DE=(n,l,h)=>l in n?zE(n,l,{enumerable:!0,configurable:!0,writable:!0,value:h}):n[l]=h,v5=(n,l,h)=>(DE(n,typeof l!="symbol"?l+"":l,h),h),Dn=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(Dn||{}),qs=(n=>(n[n.Single=0]="Single",n[n.Multi=1]="Multi",n))(qs||{}),mc=(n=>(n[n.Pointer=0]="Pointer",n[n.Focus=1]="Focus",n[n.Other=2]="Other",n))(mc||{}),x5=(n=>(n[n.OpenCombobox=0]="OpenCombobox",n[n.CloseCombobox=1]="CloseCombobox",n[n.GoToOption=2]="GoToOption",n[n.SetTyping=3]="SetTyping",n[n.RegisterOption=4]="RegisterOption",n[n.UnregisterOption=5]="UnregisterOption",n[n.DefaultToFirstOption=6]="DefaultToFirstOption",n[n.SetActivationTrigger=7]="SetActivationTrigger",n[n.UpdateVirtualConfiguration=8]="UpdateVirtualConfiguration",n[n.SetInputElement=9]="SetInputElement",n[n.SetButtonElement=10]="SetButtonElement",n[n.SetOptionsElement=11]="SetOptionsElement",n[n.MarkInputAsMoved=12]="MarkInputAsMoved",n))(x5||{});function Vy(n,l=h=>h){let h=n.activeOptionIndex!==null?n.options[n.activeOptionIndex]:null,m=l(n.options.slice()),w=m.length>0&&m[0].dataRef.current.order!==null?m.sort((C,c)=>C.dataRef.current.order-c.dataRef.current.order):vC(m,C=>C.dataRef.current.domRef.current),E=h?w.indexOf(h):null;return E===-1&&(E=null),{options:w,activeOptionIndex:E}}let OE={1(n){var l;if((l=n.dataRef.current)!=null&&l.disabled||n.comboboxState===1)return n;let h=n.inputElement?am.Tracked(_5(n.inputElement)):n.inputPositionState;return{...n,activeOptionIndex:null,comboboxState:1,isTyping:!1,activationTrigger:2,inputPositionState:h,__demoMode:!1}},0(n){var l,h;if((l=n.dataRef.current)!=null&&l.disabled||n.comboboxState===0)return n;if((h=n.dataRef.current)!=null&&h.value){let m=n.dataRef.current.calculateIndex(n.dataRef.current.value);if(m!==-1)return{...n,activeOptionIndex:m,comboboxState:0,__demoMode:!1,inputPositionState:am.Idle}}return{...n,comboboxState:0,inputPositionState:am.Idle,__demoMode:!1}},3(n,l){return n.isTyping===l.isTyping?n:{...n,isTyping:l.isTyping}},2(n,l){var h,m,w,E;if((h=n.dataRef.current)!=null&&h.disabled||n.optionsElement&&!((m=n.dataRef.current)!=null&&m.optionsPropsRef.current.static)&&n.comboboxState===1)return n;if(n.virtual){let{options:B,disabled:Z}=n.virtual,X=l.focus===Hr.Specific?l.idx:p5(l,{resolveItems:()=>B,resolveActiveIndex:()=>{var U,oe;return(oe=(U=n.activeOptionIndex)!=null?U:B.findIndex(ge=>!Z(ge)))!=null?oe:null},resolveDisabled:Z,resolveId(){throw new Error("Function not implemented.")}}),Y=(w=l.trigger)!=null?w:2;return n.activeOptionIndex===X&&n.activationTrigger===Y?n:{...n,activeOptionIndex:X,activationTrigger:Y,isTyping:!1,__demoMode:!1}}let C=Vy(n);if(C.activeOptionIndex===null){let B=C.options.findIndex(Z=>!Z.dataRef.current.disabled);B!==-1&&(C.activeOptionIndex=B)}let c=l.focus===Hr.Specific?l.idx:p5(l,{resolveItems:()=>C.options,resolveActiveIndex:()=>C.activeOptionIndex,resolveId:B=>B.id,resolveDisabled:B=>B.dataRef.current.disabled}),D=(E=l.trigger)!=null?E:2;return n.activeOptionIndex===c&&n.activationTrigger===D?n:{...n,...C,isTyping:!1,activeOptionIndex:c,activationTrigger:D,__demoMode:!1}},4:(n,l)=>{var h,m,w,E;if((h=n.dataRef.current)!=null&&h.virtual)return{...n,options:[...n.options,l.payload]};let C=l.payload,c=Vy(n,B=>(B.push(C),B));n.activeOptionIndex===null&&(w=(m=n.dataRef.current).isSelected)!=null&&w.call(m,l.payload.dataRef.current.value)&&(c.activeOptionIndex=c.options.indexOf(C));let D={...n,...c,activationTrigger:2};return(E=n.dataRef.current)!=null&&E.__demoMode&&n.dataRef.current.value===void 0&&(D.activeOptionIndex=0),D},5:(n,l)=>{var h;if((h=n.dataRef.current)!=null&&h.virtual)return{...n,options:n.options.filter(w=>w.id!==l.id)};let m=Vy(n,w=>{let E=w.findIndex(C=>C.id===l.id);return E!==-1&&w.splice(E,1),w});return{...n,...m,activationTrigger:2}},6:(n,l)=>n.defaultToFirstOption===l.value?n:{...n,defaultToFirstOption:l.value},7:(n,l)=>n.activationTrigger===l.trigger?n:{...n,activationTrigger:l.trigger},8:(n,l)=>{var h,m;if(n.virtual===null)return{...n,virtual:{options:l.options,disabled:(h=l.disabled)!=null?h:()=>!1}};if(n.virtual.options===l.options&&n.virtual.disabled===l.disabled)return n;let w=n.activeOptionIndex;if(n.activeOptionIndex!==null){let E=l.options.indexOf(n.virtual.options[n.activeOptionIndex]);E!==-1?w=E:w=null}return{...n,activeOptionIndex:w,virtual:{options:l.options,disabled:(m=l.disabled)!=null?m:()=>!1}}},9:(n,l)=>n.inputElement===l.element?n:{...n,inputElement:l.element},10:(n,l)=>n.buttonElement===l.element?n:{...n,buttonElement:l.element},11:(n,l)=>n.optionsElement===l.element?n:{...n,optionsElement:l.element},12(n){return n.inputPositionState.kind!=="Tracked"?n:{...n,inputPositionState:am.Moved}}};class jy extends g4{constructor(l){super(l),v5(this,"actions",{onChange:h=>{let{onChange:m,compare:w,mode:E,value:C}=this.state.dataRef.current;return uc(E,{0:()=>m==null?void 0:m(h),1:()=>{let c=C.slice(),D=c.findIndex(B=>w(B,h));return D===-1?c.push(h):c.splice(D,1),m==null?void 0:m(c)}})},registerOption:(h,m)=>(this.send({type:4,payload:{id:h,dataRef:m}}),()=>{this.state.activeOptionIndex===this.state.dataRef.current.calculateIndex(m.current.value)&&this.send({type:6,value:!0}),this.send({type:5,id:h})}),goToOption:(h,m)=>(this.send({type:6,value:!1}),this.send({type:2,...h,trigger:m})),setIsTyping:h=>{this.send({type:3,isTyping:h})},closeCombobox:()=>{var h,m;this.send({type:1}),this.send({type:6,value:!1}),(m=(h=this.state.dataRef.current).onClose)==null||m.call(h)},openCombobox:()=>{this.send({type:0}),this.send({type:6,value:!0})},setActivationTrigger:h=>{this.send({type:7,trigger:h})},selectActiveOption:()=>{let h=this.selectors.activeOptionIndex(this.state);if(h!==null){if(this.actions.setIsTyping(!1),this.state.virtual)this.actions.onChange(this.state.virtual.options[h]);else{let{dataRef:m}=this.state.options[h];this.actions.onChange(m.current.value)}this.actions.goToOption({focus:Hr.Specific,idx:h})}},setInputElement:h=>{this.send({type:9,element:h})},setButtonElement:h=>{this.send({type:10,element:h})},setOptionsElement:h=>{this.send({type:11,element:h})}}),v5(this,"selectors",{activeDescendantId:h=>{var m,w;let E=this.selectors.activeOptionIndex(h);if(E!==null)return h.virtual?(w=h.options.find(C=>!C.dataRef.current.disabled&&h.dataRef.current.compare(C.dataRef.current.value,h.virtual.options[E])))==null?void 0:w.id:(m=h.options[E])==null?void 0:m.id},activeOptionIndex:h=>{if(h.defaultToFirstOption&&h.activeOptionIndex===null&&(h.virtual?h.virtual.options.length>0:h.options.length>0)){if(h.virtual){let{options:w,disabled:E}=h.virtual,C=w.findIndex(c=>{var D;return!((D=E==null?void 0:E(c))!=null&&D)});if(C!==-1)return C}let m=h.options.findIndex(w=>!w.dataRef.current.disabled);if(m!==-1)return m}return h.activeOptionIndex},activeOption:h=>{var m,w;let E=this.selectors.activeOptionIndex(h);return E===null?null:h.virtual?h.virtual.options[E??0]:(w=(m=h.options[E])==null?void 0:m.dataRef.current.value)!=null?w:null},isActive:(h,m,w)=>{var E;let C=this.selectors.activeOptionIndex(h);return C===null?!1:h.virtual?C===h.dataRef.current.calculateIndex(m):((E=h.options[C])==null?void 0:E.id)===w},shouldScrollIntoView:(h,m,w)=>!(h.virtual||h.__demoMode||h.comboboxState!==0||h.activationTrigger===0||!this.selectors.isActive(h,m,w)),didInputMove(h){return h.inputPositionState.kind==="Moved"}});{let h=this.state.id,m=by.get(null);this.disposables.add(m.on(x4.Push,w=>{!m.selectors.isTop(w,h)&&this.state.comboboxState===0&&this.actions.closeCombobox()})),this.on(0,()=>m.actions.push(h)),this.on(1,()=>m.actions.pop(h))}this.disposables.group(h=>{this.on(1,m=>{m.inputElement&&(h.dispose(),h.add(IE(m.inputElement,m.inputPositionState,()=>{this.send({type:12})})))})})}static new({id:l,virtual:h=null,__demoMode:m=!1}){var w;return new jy({id:l,dataRef:{current:{}},comboboxState:m?0:1,isTyping:!1,options:[],virtual:h?{options:h.options,disabled:(w=h.disabled)!=null?w:()=>!1}:null,activeOptionIndex:null,activationTrigger:2,inputElement:null,buttonElement:null,optionsElement:null,__demoMode:m,inputPositionState:am.Idle})}reduce(l,h){return uc(h.type,OE,l,h)}}const b5=te.createContext(null);function sm(n){let l=te.useContext(b5);if(l===null){let h=new Error(`<${n} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(h,w5),h}return l}function w5({id:n,virtual:l=null,__demoMode:h=!1}){let m=te.useMemo(()=>jy.new({id:n,virtual:l,__demoMode:h}),[]);return m5(()=>m.dispose()),m}let om=te.createContext(null);om.displayName="ComboboxDataContext";function fp(n){let l=te.useContext(om);if(l===null){let h=new Error(`<${n} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(h,fp),h}return l}let S5=te.createContext(null);function kE(n){let l=sm("VirtualProvider"),h=fp("VirtualProvider"),{options:m}=h.virtual,w=qr(l,U=>U.optionsElement),[E,C]=te.useMemo(()=>{let U=w;if(!U)return[0,0];let oe=window.getComputedStyle(U);return[parseFloat(oe.paddingBlockStart||oe.paddingTop),parseFloat(oe.paddingBlockEnd||oe.paddingBottom)]},[w]),c=WS({enabled:m.length!==0,scrollPaddingStart:E,scrollPaddingEnd:C,count:m.length,estimateSize(){return 40},getScrollElement(){return l.state.optionsElement},overscan:12}),[D,B]=te.useState(0);Ar(()=>{B(U=>U+1)},[m]);let Z=c.getVirtualItems(),X=qr(l,U=>U.activationTrigger===mc.Pointer),Y=qr(l,l.selectors.activeOptionIndex);return Z.length===0?null:Fn.createElement(S5.Provider,{value:c},Fn.createElement("div",{style:{position:"relative",width:"100%",height:`${c.getTotalSize()}px`},ref:U=>{U&&(X||Y!==null&&m.length>Y&&c.scrollToIndex(Y))}},Z.map(U=>{var oe;return Fn.createElement(te.Fragment,{key:U.key},Fn.cloneElement((oe=n.children)==null?void 0:oe.call(n,{...n.slot,option:m[U.index]}),{key:`${D}-${U.key}`,"data-index":U.index,"aria-setsize":m.length,"aria-posinset":U.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${U.start}px)`,overflowAnchor:"none"}}))})))}let BE=te.Fragment;function FE(n,l){let h=te.useId(),m=Wg(),{value:w,defaultValue:E,onChange:C,form:c,name:D,by:B,invalid:Z=!1,disabled:X=m||!1,onClose:Y,__demoMode:U=!1,multiple:oe=!1,immediate:ge=!1,virtual:ye=null,nullable:Se,...je}=n,Pe=gS(E),[Oe=oe?[]:void 0,Je]=mS(w,C,Pe),et=w5({id:h,virtual:ye,__demoMode:U}),ot=te.useRef({static:!1,hold:!1}),Rt=JS(B),Gt=$n(Ht=>ye?B===null?ye.options.indexOf(Ht):ye.options.findIndex(xn=>Rt(xn,Ht)):et.state.options.findIndex(xn=>Rt(xn.dataRef.current.value,Ht))),Tt=te.useCallback(Ht=>uc(Qt.mode,{[qs.Multi]:()=>Oe.some(xn=>Rt(xn,Ht)),[qs.Single]:()=>Rt(Oe,Ht)}),[Oe]),Ot=qr(et,Ht=>Ht.virtual),At=$n(()=>Y==null?void 0:Y()),Qt=te.useMemo(()=>({__demoMode:U,immediate:ge,optionsPropsRef:ot,value:Oe,defaultValue:Pe,disabled:X,invalid:Z,mode:oe?qs.Multi:qs.Single,virtual:ye?Ot:null,onChange:Je,isSelected:Tt,calculateIndex:Gt,compare:Rt,onClose:At}),[U,ge,ot,Oe,Pe,X,Z,oe,ye,Ot,Je,Tt,Gt,Rt,At]);Ar(()=>{var Ht;ye&&et.send({type:x5.UpdateVirtualConfiguration,options:ye.options,disabled:(Ht=ye.disabled)!=null?Ht:null})},[ye,ye==null?void 0:ye.options,ye==null?void 0:ye.disabled]),Ar(()=>{et.state.dataRef.current=Qt},[Qt]);let[sn,qt,$e,ft]=qr(et,Ht=>[Ht.comboboxState,Ht.buttonElement,Ht.inputElement,Ht.optionsElement]),wt=by.get(null),St=qr(wt,te.useCallback(Ht=>wt.selectors.isTop(Ht,h),[wt,h]));wC(St,[qt,$e,ft],()=>et.actions.closeCombobox());let Zt=qr(et,et.selectors.activeOptionIndex),we=qr(et,et.selectors.activeOption),Be=fh({open:sn===Dn.Open,disabled:X,invalid:Z,activeIndex:Zt,activeOption:we,value:Oe}),[pt,xt]=OS(),Bt=l===null?{}:{ref:l},Lt=te.useCallback(()=>{if(Pe!==void 0)return Je==null?void 0:Je(Pe)},[Je,Pe]),Wt=Lo();return Fn.createElement(xt,{value:pt,props:{htmlFor:$e==null?void 0:$e.id},slot:{open:sn===Dn.Open,disabled:X}},Fn.createElement(dE,null,Fn.createElement(om.Provider,{value:Qt},Fn.createElement(b5.Provider,{value:et},Fn.createElement(_E,{value:uc(sn,{[Dn.Open]:rm.Open,[Dn.Closed]:rm.Closed})},D!=null&&Fn.createElement(wS,{disabled:X,data:Oe!=null?{[D]:Oe}:{},form:c,onReset:Lt}),Wt({ourProps:Bt,theirProps:je,slot:Be,defaultTag:BE,name:"Combobox"}))))))}let NE="input";function UE(n,l){var h,m;let w=sm("Combobox.Input"),E=fp("Combobox.Input"),C=te.useId(),c=W3(),{id:D=c||`headlessui-combobox-input-${C}`,onChange:B,displayValue:Z,disabled:X=E.disabled||!1,autoFocus:Y=!1,type:U="text",...oe}=n,ge=te.useRef(null),ye=su(ge,l,cE(),w.actions.setInputElement),[Se,je]=qr(w,Be=>[Be.comboboxState,Be.isTyping]),Pe=sp(),Oe=$n(()=>{w.actions.onChange(null),w.state.optionsElement&&(w.state.optionsElement.scrollTop=0),w.actions.goToOption({focus:Hr.Nothing})}),Je=te.useMemo(()=>{var Be;return typeof Z=="function"&&E.value!==void 0?(Be=Z(E.value))!=null?Be:"":typeof E.value=="string"?E.value:""},[E.value,Z]);O4(([Be,pt],[xt,Bt])=>{if(w.state.isTyping)return;let Lt=ge.current;Lt&&((Bt===Dn.Open&&pt===Dn.Closed||Be!==xt)&&(Lt.value=Be),requestAnimationFrame(()=>{if(w.state.isTyping||!Lt||V3(Lt))return;let{selectionStart:Wt,selectionEnd:Ht}=Lt;Math.abs((Ht??0)-(Wt??0))===0&&Wt===0&&Lt.setSelectionRange(Lt.value.length,Lt.value.length)}))},[Je,Se,je]),O4(([Be],[pt])=>{if(Be===Dn.Open&&pt===Dn.Closed){if(w.state.isTyping)return;let xt=ge.current;if(!xt)return;let Bt=xt.value,{selectionStart:Lt,selectionEnd:Wt,selectionDirection:Ht}=xt;xt.value="",xt.value=Bt,Ht!==null?xt.setSelectionRange(Lt,Wt,Ht):xt.setSelectionRange(Lt,Wt)}},[Se]);let et=te.useRef(!1),ot=$n(()=>{et.current=!0}),Rt=$n(()=>{Pe.nextFrame(()=>{et.current=!1})}),Gt=$n(Be=>{switch(w.actions.setIsTyping(!0),Be.key){case Ja.Enter:if(w.state.comboboxState!==Dn.Open||et.current)return;if(Be.preventDefault(),Be.stopPropagation(),w.selectors.activeOptionIndex(w.state)===null){w.actions.closeCombobox();return}w.actions.selectActiveOption(),E.mode===qs.Single&&w.actions.closeCombobox();break;case Ja.ArrowDown:return Be.preventDefault(),Be.stopPropagation(),uc(w.state.comboboxState,{[Dn.Open]:()=>w.actions.goToOption({focus:Hr.Next}),[Dn.Closed]:()=>w.actions.openCombobox()});case Ja.ArrowUp:return Be.preventDefault(),Be.stopPropagation(),uc(w.state.comboboxState,{[Dn.Open]:()=>w.actions.goToOption({focus:Hr.Previous}),[Dn.Closed]:()=>{la.flushSync(()=>w.actions.openCombobox()),E.value||w.actions.goToOption({focus:Hr.Last})}});case Ja.Home:if(w.state.comboboxState===Dn.Closed||Be.shiftKey)break;return Be.preventDefault(),Be.stopPropagation(),w.actions.goToOption({focus:Hr.First});case Ja.PageUp:return Be.preventDefault(),Be.stopPropagation(),w.actions.goToOption({focus:Hr.First});case Ja.End:if(w.state.comboboxState===Dn.Closed||Be.shiftKey)break;return Be.preventDefault(),Be.stopPropagation(),w.actions.goToOption({focus:Hr.Last});case Ja.PageDown:return Be.preventDefault(),Be.stopPropagation(),w.actions.goToOption({focus:Hr.Last});case Ja.Escape:return w.state.comboboxState!==Dn.Open?void 0:(Be.preventDefault(),w.state.optionsElement&&!E.optionsPropsRef.current.static&&Be.stopPropagation(),E.mode===qs.Single&&E.value===null&&Oe(),w.actions.closeCombobox());case Ja.Tab:if(w.actions.setIsTyping(!1),w.state.comboboxState!==Dn.Open)return;E.mode===qs.Single&&w.state.activationTrigger!==mc.Focus&&w.actions.selectActiveOption(),w.actions.closeCombobox();break}}),Tt=$n(Be=>{B==null||B(Be),E.mode===qs.Single&&Be.target.value===""&&Oe(),w.actions.openCombobox()}),Ot=$n(Be=>{var pt,xt,Bt;let Lt=(pt=Be.relatedTarget)!=null?pt:Od.find(Wt=>Wt!==Be.currentTarget);if(!((xt=w.state.optionsElement)!=null&&xt.contains(Lt))&&!((Bt=w.state.buttonElement)!=null&&Bt.contains(Lt))&&w.state.comboboxState===Dn.Open)return Be.preventDefault(),E.mode===qs.Single&&E.value===null&&Oe(),w.actions.closeCombobox()}),At=$n(Be=>{var pt,xt,Bt;let Lt=(pt=Be.relatedTarget)!=null?pt:Od.find(Wt=>Wt!==Be.currentTarget);(xt=w.state.buttonElement)!=null&&xt.contains(Lt)||(Bt=w.state.optionsElement)!=null&&Bt.contains(Lt)||E.disabled||E.immediate&&w.state.comboboxState!==Dn.Open&&Pe.microTask(()=>{la.flushSync(()=>w.actions.openCombobox()),w.actions.setActivationTrigger(mc.Focus)})}),Qt=r0(),sn=RS(),{isFocused:qt,focusProps:$e}=dy({autoFocus:Y}),{isHovered:ft,hoverProps:wt}=hy({isDisabled:X}),St=qr(w,Be=>Be.optionsElement),Zt=fh({open:Se===Dn.Open,disabled:X,invalid:E.invalid,hover:ft,focus:qt,autofocus:Y}),we=Jg({ref:ye,id:D,role:"combobox",type:U,"aria-controls":St==null?void 0:St.id,"aria-expanded":Se===Dn.Open,"aria-activedescendant":qr(w,w.selectors.activeDescendantId),"aria-labelledby":Qt,"aria-describedby":sn,"aria-autocomplete":"list",defaultValue:(m=(h=n.defaultValue)!=null?h:E.defaultValue!==void 0?Z==null?void 0:Z(E.defaultValue):null)!=null?m:E.defaultValue,disabled:X||void 0,autoFocus:Y,onCompositionStart:ot,onCompositionEnd:Rt,onKeyDown:Gt,onChange:Tt,onFocus:At,onBlur:Ot},$e,wt);return Lo()({ourProps:we,theirProps:oe,slot:Zt,defaultTag:NE,name:"Combobox.Input"})}let $E="button";function VE(n,l){let h=sm("Combobox.Button"),m=fp("Combobox.Button"),[w,E]=te.useState(null),C=su(l,E,h.actions.setButtonElement),c=te.useId(),{id:D=`headlessui-combobox-button-${c}`,disabled:B=m.disabled||!1,autoFocus:Z=!1,...X}=n,[Y,U,oe]=qr(h,At=>[At.comboboxState,At.inputElement,At.optionsElement]),ge=P4(U),ye=Y===Dn.Open;TC(ye,{trigger:w,action:te.useCallback(At=>{if(w!=null&&w.contains(At.target)||U!=null&&U.contains(At.target))return K1.Ignore;let Qt=At.target.closest('[role="option"]:not([data-disabled])');return ph(Qt)?K1.Select(Qt):oe!=null&&oe.contains(At.target)?K1.Ignore:K1.Close},[w,U,oe]),close:h.actions.closeCombobox,select:h.actions.selectActiveOption});let Se=$n(At=>{switch(At.key){case Ja.Space:case Ja.Enter:At.preventDefault(),At.stopPropagation(),h.state.comboboxState===Dn.Closed&&la.flushSync(()=>h.actions.openCombobox()),ge();return;case Ja.ArrowDown:At.preventDefault(),At.stopPropagation(),h.state.comboboxState===Dn.Closed&&(la.flushSync(()=>h.actions.openCombobox()),h.state.dataRef.current.value||h.actions.goToOption({focus:Hr.First})),ge();return;case Ja.ArrowUp:At.preventDefault(),At.stopPropagation(),h.state.comboboxState===Dn.Closed&&(la.flushSync(()=>h.actions.openCombobox()),h.state.dataRef.current.value||h.actions.goToOption({focus:Hr.Last})),ge();return;case Ja.Escape:if(h.state.comboboxState!==Dn.Open)return;At.preventDefault(),h.state.optionsElement&&!m.optionsPropsRef.current.static&&At.stopPropagation(),la.flushSync(()=>h.actions.closeCombobox()),ge();return;default:return}}),je=eC(()=>{h.state.comboboxState===Dn.Open?h.actions.closeCombobox():h.actions.openCombobox(),ge()}),Pe=r0([D]),{isFocusVisible:Oe,focusProps:Je}=dy({autoFocus:Z}),{isHovered:et,hoverProps:ot}=hy({isDisabled:B}),{pressed:Rt,pressProps:Gt}=Z3({disabled:B}),Tt=fh({open:Y===Dn.Open,active:Rt||Y===Dn.Open,disabled:B,invalid:m.invalid,value:m.value,hover:et,focus:Oe}),Ot=Jg({ref:C,id:D,type:MC(n,w),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":oe==null?void 0:oe.id,"aria-expanded":Y===Dn.Open,"aria-labelledby":Pe,disabled:B||void 0,autoFocus:Z,onKeyDown:Se},je,Je,ot,Gt);return Lo()({ourProps:Ot,theirProps:X,slot:Tt,defaultTag:$E,name:"Combobox.Button"})}let jE="div",ZE=py.RenderStrategy|py.Static;function GE(n,l){var h,m,w;let E=te.useId(),{id:C=`headlessui-combobox-options-${E}`,hold:c=!1,anchor:D,portal:B=!1,modal:Z=!0,transition:X=!1,...Y}=n,U=sm("Combobox.Options"),oe=fp("Combobox.Options"),ge=lE(D);ge&&(B=!0);let[ye,Se]=hE(ge),[je,Pe]=te.useState(null),Oe=uE(),Je=su(l,ge?ye:null,U.actions.setOptionsElement,Pe),[et,ot,Rt,Gt,Tt]=qr(U,ai=>[ai.comboboxState,ai.inputElement,ai.buttonElement,ai.optionsElement,ai.activationTrigger]),Ot=My(ot||Rt),At=My(Gt),Qt=yE(),[sn,qt]=NC(X,je,Qt!==null?(Qt&rm.Open)===rm.Open:et===Dn.Open);fC(sn,ot,U.actions.closeCombobox);let $e=oe.__demoMode?!1:Z&&et===Dn.Open;DC($e,At);let ft=oe.__demoMode?!1:Z&&et===Dn.Open;dC(ft,{allowed:te.useCallback(()=>[ot,Rt,Gt],[ot,Rt,Gt])});let wt=qr(U,U.selectors.didInputMove)?!1:sn;Ar(()=>{var ai;oe.optionsPropsRef.current.static=(ai=n.static)!=null?ai:!1},[oe.optionsPropsRef,n.static]),Ar(()=>{oe.optionsPropsRef.current.hold=c},[oe.optionsPropsRef,c]),ZC(et===Dn.Open,{container:Gt,accept(ai){return ai.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:ai.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(ai){ai.setAttribute("role","none")}});let St=r0([Rt==null?void 0:Rt.id]),Zt=fh({open:et===Dn.Open,option:void 0}),we=$n(()=>{U.actions.setActivationTrigger(mc.Pointer)}),Be=$n(ai=>{ai.preventDefault(),U.actions.setActivationTrigger(mc.Pointer)}),pt=Jg(ge?Oe():{},{"aria-labelledby":St,role:"listbox","aria-multiselectable":oe.mode===qs.Multi?!0:void 0,id:C,ref:Je,style:{...Y.style,...Se,"--input-width":d4(sn,ot,!0).width,"--button-width":d4(sn,Rt,!0).width},onWheel:Tt===mc.Pointer?void 0:we,onMouseDown:Be,...FC(qt)}),xt=sn&&et===Dn.Closed&&!n.static,Bt=Uy(xt,(h=oe.virtual)==null?void 0:h.options),Lt=Uy(xt,oe.value),Wt=te.useCallback(ai=>oe.compare(Lt,ai),[oe.compare,Lt]),Ht=te.useMemo(()=>{if(!oe.virtual)return oe;if(Bt===void 0)throw new Error("Missing `options` in virtual mode");return Bt!==oe.virtual.options?{...oe,virtual:{...oe.virtual,options:Bt}}:oe},[oe,Bt,(m=oe.virtual)==null?void 0:m.options]);oe.virtual&&Object.assign(Y,{children:Fn.createElement(om.Provider,{value:Ht},Fn.createElement(kE,{slot:Zt},Y.children))});let xn=Lo(),ka=te.useMemo(()=>oe.mode===qs.Multi?oe:{...oe,isSelected:Wt},[oe,Wt]);return Fn.createElement(RE,{enabled:B?n.static||sn:!1,ownerDocument:Ot},Fn.createElement(om.Provider,{value:ka},xn({ourProps:pt,theirProps:{...Y,children:Fn.createElement(gE,{freeze:xt},typeof Y.children=="function"?(w=Y.children)==null?void 0:w.call(Y,Zt):Y.children)},slot:Zt,defaultTag:jE,features:ZE,visible:wt,name:"Combobox.Options"})))}let qE="div";function HE(n,l){var h,m,w;let E=fp("Combobox.Option"),C=sm("Combobox.Option"),c=te.useId(),{id:D=`headlessui-combobox-option-${c}`,value:B,disabled:Z=(w=(m=(h=E.virtual)==null?void 0:h.disabled)==null?void 0:m.call(h,B))!=null?w:!1,order:X=null,...Y}=n,[U]=qr(C,qt=>[qt.inputElement]),oe=P4(U),ge=qr(C,te.useCallback(qt=>C.selectors.isActive(qt,B,D),[B,D])),ye=E.isSelected(B),Se=te.useRef(null),je=Ld({disabled:Z,value:B,domRef:Se,order:X}),Pe=te.useContext(S5),Oe=su(l,Se,Pe?Pe.measureElement:null),Je=$n(()=>{C.actions.setIsTyping(!1),C.actions.onChange(B)});Ar(()=>C.actions.registerOption(D,je),[je,D]);let et=qr(C,te.useCallback(qt=>C.selectors.shouldScrollIntoView(qt,B,D),[B,D]));Ar(()=>{if(et)return Ao().requestAnimationFrame(()=>{var qt,$e;($e=(qt=Se.current)==null?void 0:qt.scrollIntoView)==null||$e.call(qt,{block:"nearest"})})},[et,Se]);let ot=$n(qt=>{qt.preventDefault(),qt.button===_y.Left&&(Z||(Je(),Ey()||requestAnimationFrame(()=>oe()),E.mode===qs.Single&&C.actions.closeCombobox()))}),Rt=$n(()=>{if(Z)return C.actions.goToOption({focus:Hr.Nothing});let qt=E.calculateIndex(B);C.actions.goToOption({focus:Hr.Specific,idx:qt})}),Gt=OC(),Tt=$n(qt=>Gt.update(qt)),Ot=$n(qt=>{if(!Gt.wasMoved(qt)||Z||ge&&C.state.activationTrigger===mc.Pointer)return;let $e=E.calculateIndex(B);C.actions.goToOption({focus:Hr.Specific,idx:$e},mc.Pointer)}),At=$n(qt=>{Gt.wasMoved(qt)&&(Z||ge&&(E.optionsPropsRef.current.hold||C.state.activationTrigger===mc.Pointer&&C.actions.goToOption({focus:Hr.Nothing})))}),Qt=fh({active:ge,focus:ge,selected:ye,disabled:Z}),sn={id:D,ref:Oe,role:"option",tabIndex:Z===!0?void 0:-1,"aria-disabled":Z===!0?!0:void 0,"aria-selected":ye,disabled:void 0,onMouseDown:ot,onFocus:Rt,onPointerEnter:Tt,onMouseEnter:Tt,onPointerMove:Ot,onMouseMove:Ot,onPointerLeave:At,onMouseLeave:At};return Lo()({ourProps:sn,theirProps:Y,slot:Qt,defaultTag:qE,name:"Combobox.Option"})}let XE=Po(FE),YE=Po(VE),Zy=Po(UE),QE=NS,Gy=Po(GE),pp=Po(HE),C5=Object.assign(XE,{Input:Zy,Button:YE,Label:QE,Options:Gy,Option:pp});function kd({children:n,className:l="",variant:h="primary",size:m="medium",disabled:w,...E}){const C=m==="small"?Aw:m==="large"?Lw:"";return gt.jsx(pS,{className:`${h==="primary"?Ew:Mw} ${C} ${l||""}`,disabled:w,...E,children:n})}const T5=[{code:"AF",name:"Afghanistan",position:[69.10221,34.53313]},{code:"AX",name:"Aland Islands",position:[-57.85802,-51.69671]},{code:"AL",name:"Albania",position:[19.82517,41.32232]},{code:"DZ",name:"Algeria",position:[3.05929,36.77156]},{code:"AS",name:"American Samoa",position:[-170.7035,-14.27272]},{code:"AD",name:"Andorra",position:[1.52604,42.50514]},{code:"AO",name:"Angola",position:[13.23287,-8.81567]},{code:"AI",name:"Anguilla",position:[-63.0517,18.21537]},{code:"AQ",name:"Antarctica",position:[20.67103,-80.41318]},{code:"AG",name:"Antigua and Barbuda",position:[-61.84158,17.11632]},{code:"AR",name:"Argentina",position:[-58.37344,-34.6085]},{code:"AM",name:"Armenia",position:[44.51402,40.17795]},{code:"AW",name:"Aruba",position:[-70.03488,12.52367]},{code:"AU",name:"Australia",position:[149.1266,-35.3065]},{code:"AT",name:"Austria",position:[16.36842,48.20263]},{code:"AZ",name:"Azerbaijan",position:[49.87222,40.41066]},{code:"BS",name:"Bahamas, The",position:[-77.34079,25.0771]},{code:"BH",name:"Bahrain",position:[50.57604,26.22952]},{code:"BD",name:"Bangladesh",position:[90.39958,23.71323]},{code:"BB",name:"Barbados",position:[-59.6127,13.112]},{code:"BY",name:"Belarus",position:[27.56545,53.90374]},{code:"BE",name:"Belgium",position:[4.35608,50.84439]},{code:"BZ",name:"Belize",position:[-88.77043,17.25414]},{code:"BJ",name:"Benin",position:[2.6138,6.48812]},{code:"BM",name:"Bermuda",position:[-64.78414,32.29362]},{code:"BT",name:"Bhutan",position:[89.63399,27.47531]},{code:"BO",name:"Bolivia",position:[-68.13379,-16.49909]},{code:"BQ",name:"Bonaire, Saint Eustatius and Saba"},{code:"BA",name:"Bosnia and Herzegovina",position:[18.43583,43.85945]},{code:"BW",name:"Botswana",position:[25.91903,-24.65528]},{code:"BV",name:"Bouvet Island",position:[-21.93419,64.14748]},{code:"BR",name:"Brazil",position:[-47.92877,-15.77855]},{code:"IO",name:"British Indian Ocean Territory",position:[72.36922,-7.268]},{code:"BN",name:"Brunei Darussalam",position:[114.94043,4.8919]},{code:"BG",name:"Bulgaria",position:[23.32433,42.69718]},{code:"BF",name:"Burkina Faso",position:[-1.52711,12.36857]},{code:"BI",name:"Burundi",position:[29.92956,-3.42705]},{code:"KH",name:"Cambodia",position:[104.87914,11.56261]},{code:"CM",name:"Cameroon",position:[11.52025,3.84675]},{code:"CA",name:"Canada",position:[-75.69122,45.42177]},{code:"IC",name:"Canary Islands",position:[-81.38176,19.29657]},{code:"CV",name:"Cape Verde",position:[-23.50941,14.9155]},{code:"KY",name:"Cayman Islands",position:[-81.38176,19.29657]},{code:"CF",name:"Central African Republic",position:[18.5586,4.39669]},{code:"TD",name:"Chad",position:[15.04912,12.11315]},{code:"CL",name:"Chile",position:[-70.65003,-33.43723]},{code:"CN",name:"China",position:[116.38765,39.90657]},{code:"CX",name:"Christmas Island",position:[105.67326,-10.42496]},{code:"CC",name:"Cocos (Keeling) Islands",position:[96.82122,-12.15772]},{code:"CO",name:"Colombia",position:[-74.06942,4.61496]},{code:"KM",name:"Comoros",position:[43.25918,-11.69222]},{code:"CG",name:"Congo",position:[15.26039,-4.27935]},{code:"CD",name:"Congo, The Democratic Republic of the",position:[15.28932,-4.31047]},{code:"CK",name:"Cook Islands",position:[-159.76823,-21.20975]},{code:"CR",name:"Costa Rica",position:[-84.0857,9.92975]},{code:"CI",name:"Cote D'ivoire",position:[-5.28024,6.82161]},{code:"HR",name:"Croatia",position:[15.96757,45.80724]},{code:"CW",name:"Curaçao",position:[-68.93271,12.10363]},{code:"CY",name:"Cyprus",position:[33.3649,35.17216]},{code:"CZ",name:"Czech Republic",position:[14.43299,50.07914]},{code:"DK",name:"Denmark",position:[12.56755,55.67567]},{code:"DJ",name:"Djibouti",position:[43.14487,11.58807]},{code:"DM",name:"Dominica",position:[-61.38608,15.30198]},{code:"DO",name:"Dominican Republic",position:[-69.89139,18.47185]},{code:"EC",name:"Ecuador",position:[-78.54967,-.30991]},{code:"EG",name:"Egypt",position:[31.23525,30.04427]},{code:"SV",name:"El Salvador",position:[-89.20681,13.69967]},{code:"GQ",name:"Equatorial Guinea",position:[8.77948,3.75614]},{code:"ER",name:"Eritrea",position:[38.93691,15.33638]},{code:"EE",name:"Estonia",position:[24.75254,59.43642]},{code:"ET",name:"Ethiopia",position:[38.76286,9.01358]},{code:"FK",name:"Falkland Islands (Malvinas)",position:[-57.85802,-51.69671]},{code:"FO",name:"Faroe Islands",position:[-6.7728,62.0097]},{code:"FJ",name:"Fiji",position:[178.42325,-18.14127]},{code:"FI",name:"Finland",position:[24.93265,60.17116]},{code:"FR",name:"France",position:[2.3414,48.85717]},{code:"GF",name:"French Guiana",position:[-53.23431,3.92588]},{code:"PF",name:"French Polynesia",position:[-149.57464,-17.54472]},{code:"TF",name:"French Southern Territories"},{code:"GA",name:"Gabon",position:[9.44644,.39327]},{code:"GM",name:"Gambia, The",position:[-16.57475,13.45359]},{code:"GE",name:"Georgia",position:[44.7961,41.70907]},{code:"DE",name:"Germany",position:[13.37691,52.51604]},{code:"GH",name:"Ghana",position:[-.23262,5.57888]},{code:"GI",name:"Gibraltar",position:[-5.35442,36.14606]},{code:"GR",name:"Greece",position:[23.7364,37.97614]},{code:"GL",name:"Greenland",position:[-51.72924,64.17942]},{code:"GD",name:"Grenada",position:[-61.75398,12.05209]},{code:"GP",name:"Guadeloupe",position:[-61.73434,15.9987]},{code:"GU",name:"Guam",position:[144.75419,13.47356]},{code:"GT",name:"Guatemala",position:[-90.46711,14.63325]},{code:"GG",name:"Guernsey",position:[-2.53517,49.4571]},{code:"GN",name:"Guinea",position:[-13.70539,9.51198]},{code:"GW",name:"Guinea-Bissau",position:[-15.59854,11.85946]},{code:"GY",name:"Guyana",position:[-58.16125,6.80857]},{code:"HT",name:"Haiti",position:[-72.33562,18.54495]},{code:"HM",name:"Heard Island and the McDonald Islands"},{code:"VA",name:"Holy See"},{code:"HN",name:"Honduras",position:[-87.20548,14.08192]},{code:"HK",name:"Hong Kong",position:[114.14774,22.36022]},{code:"HU",name:"Hungary",position:[19.05508,47.49972]},{code:"IS",name:"Iceland",position:[-21.93419,64.14748]},{code:"IN",name:"India",position:[77.21676,28.63141]},{code:"ID",name:"Indonesia",position:[106.82648,-6.17148]},{code:"IQ",name:"Iraq",position:[44.39307,33.3421]},{code:"IE",name:"Ireland",position:[-6.24828,53.34807]},{code:"IM",name:"Isle of Man",position:[-4.53874,54.22821]},{code:"IL",name:"Israel",position:[35.21882,31.78001]},{code:"IT",name:"Italy",position:[12.49563,41.90325]},{code:"JM",name:"Jamaica",position:[-76.78827,17.97092]},{code:"JP",name:"Japan",position:[139.69172,35.6895]},{code:"JE",name:"Jersey",position:[-2.1111,49.18425]},{code:"JO",name:"Jordan",position:[35.94042,31.9518]},{code:"KZ",name:"Kazakhstan",position:[71.4283,51.12771]},{code:"KE",name:"Kenya",position:[36.82379,-1.28353]},{code:"KI",name:"Kiribati",position:[172.93646,1.35548]},{code:"XK",name:"Kosovo",position:[21.16242,42.6718]},{code:"KW",name:"Kuwait",position:[47.97162,29.37332]},{code:"KG",name:"Kyrgyzstan",position:[74.60354,42.88434]},{code:"LA",name:"Lao People's Democratic Republic",position:[102.61893,17.9518]},{code:"LV",name:"Latvia",position:[24.11481,56.94596]},{code:"LB",name:"Lebanon",position:[35.50678,33.89607]},{code:"LS",name:"Lesotho",position:[27.49302,-29.31619]},{code:"LR",name:"Liberia",position:[-10.80213,6.31672]},{code:"LY",name:"Libya",position:[13.18104,32.89534]},{code:"LI",name:"Liechtenstein",position:[9.52164,47.13881]},{code:"LT",name:"Lithuania",position:[25.2698,54.69062]},{code:"LU",name:"Luxembourg",position:[6.12966,49.6096]},{code:"MO",name:"Macao",position:[113.57266,22.16495]},{code:"MK",name:"North Macedonia",position:[21.43029,41.99468]},{code:"MG",name:"Madagascar",position:[47.52736,-18.91004]},{code:"MW",name:"Malawi",position:[33.77027,-13.98558]},{code:"MY",name:"Malaysia",position:[101.69404,3.14789]},{code:"MV",name:"Maldives",position:[73.50928,4.17524]},{code:"ML",name:"Mali",position:[-8.00005,12.65039]},{code:"MT",name:"Malta",position:[14.5118,35.89353]},{code:"MH",name:"Marshall Islands",position:[171.37138,7.10941]},{code:"MQ",name:"Martinique",position:[-61.01838,14.65313]},{code:"MR",name:"Mauritania",position:[-15.97248,18.09193]},{code:"MU",name:"Mauritius",position:[57.51491,-20.16545]},{code:"YT",name:"Mayotte",position:[45.23009,-12.78395]},{code:"MX",name:"Mexico",position:[-99.13315,19.43195]},{code:"FM",name:"Micronesia, Federated States of",position:[158.15775,6.91773]},{code:"MD",name:"Moldova, Republic of",position:[28.83456,47.02316]},{code:"MC",name:"Monaco",position:[7.41754,43.73286]},{code:"MN",name:"Mongolia",position:[106.91809,47.92218]},{code:"ME",name:"Montenegro",position:[19.26389,42.43544]},{code:"MS",name:"Montserrat",position:[-62.21527,16.7039]},{code:"MA",name:"Morocco",position:[-6.83612,34.01791]},{code:"MZ",name:"Mozambique",position:[32.57327,-25.97457]},{code:"MM",name:"Myanmar",position:[96.07529,19.72682]},{code:"NA",name:"Namibia",position:[17.09074,-22.5716]},{code:"NR",name:"Nauru",position:[166.91714,-.54187]},{code:"NP",name:"Nepal",position:[85.32227,27.69329]},{code:"NL",name:"Netherlands",position:[4.90787,52.36993]},{code:"AN",name:"Netherlands Antilles",position:[4.90787,52.36993]},{code:"NC",name:"New Caledonia",position:[166.46132,-22.24293]},{code:"NZ",name:"New Zealand",position:[174.77686,-41.28949]},{code:"NI",name:"Nicaragua",position:[-86.24082,12.1172]},{code:"NE",name:"Niger",position:[2.11633,13.51627]},{code:"NG",name:"Nigeria",position:[7.46228,9.06344]},{code:"NU",name:"Niue",position:[-169.91999,-19.01916]},{code:"NF",name:"Norfolk Island",position:[167.9585,-29.05713]},{code:"MP",name:"Northern Mariana Islands",position:[145.72108,15.20756]},{code:"NO",name:"Norway",position:[10.75,59.91234]},{code:"OM",name:"Oman",position:[58.59122,23.61524]},{code:"PK",name:"Pakistan",position:[73.07544,33.70964]},{code:"PW",name:"Palau",position:[134.62193,7.50137]},{code:"PS",name:"Palestinian Territories"},{code:"PA",name:"Panama",position:[-79.53539,8.95241]},{code:"PG",name:"Papua New Guinea",position:[147.20381,-9.45508]},{code:"PY",name:"Paraguay",position:[-57.62776,-25.29738]},{code:"PE",name:"Peru",position:[-77.0268,-12.05618]},{code:"PH",name:"Philippines",position:[120.98626,14.60488]},{code:"PN",name:"Pitcairn",position:[-130.10084,-25.0665]},{code:"PL",name:"Poland",position:[21.01037,52.2356]},{code:"PT",name:"Portugal",position:[-9.14952,38.72633]},{code:"PR",name:"Puerto Rico",position:[-66.11692,18.46536]},{code:"QA",name:"Qatar",position:[51.51966,25.29424]},{code:"KR",name:"Republic of Korea",position:[126.99989,37.55886]},{code:"RE",name:"Reunion",position:[55.45851,-20.89077]},{code:"RO",name:"Romania",position:[26.10298,44.43429]},{code:"RU",name:"Russian Federation",position:[37.61502,55.75696]},{code:"RW",name:"Rwanda",position:[30.03176,-1.97576]},{code:"BL",name:"Saint Barthelemy",position:[-62.8298,17.90281]},{code:"SH",name:"Saint Helena, Ascension and Tristan da Cunha",position:[-5.71691,-15.92632]},{code:"KN",name:"Saint Kitts and Nevis",position:[-62.72264,17.29697]},{code:"LC",name:"Saint Lucia",position:[-60.98964,14.01177]},{code:"MF",name:"Saint Martin",position:[-63.0446,18.02547]},{code:"PM",name:"Saint Pierre and Miquelon",position:[-56.17258,46.77902]},{code:"VC",name:"Saint Vincent and the Grenadines",position:[-61.22768,13.15648]},{code:"WS",name:"Samoa",position:[-171.75674,-13.83689]},{code:"SM",name:"San Marino",position:[12.44287,43.93947]},{code:"ST",name:"Sao Tome and Principe",position:[6.73118,.33973]},{code:"SA",name:"Saudi Arabia",position:[46.68723,24.68208]},{code:"SN",name:"Senegal",position:[-17.43662,14.66927]},{code:"RS",name:"Serbia",position:[20.46329,44.8131]},{code:"SC",name:"Seychelles",position:[55.45228,-4.62278]},{code:"SL",name:"Sierra Leone",position:[-13.23469,8.48686]},{code:"SG",name:"Singapore",position:[103.85238,1.29087]},{code:"SX",name:"Sint Maarten",position:[-63.0446,18.02547]},{code:"SK",name:"Slovakia",position:[17.10699,48.14924]},{code:"SI",name:"Slovenia",position:[14.50282,46.05062]},{code:"SB",name:"Solomon Islands",position:[159.92237,-9.4384]},{code:"SO",name:"Somalia",position:[45.34156,2.03812]},{code:"ZA",name:"South Africa",position:[28.18832,-25.74579]},{code:"GS",name:"South Georgia and the South Sandwich Islands",position:[-36.50747,-54.28039]},{code:"ES",name:"Spain",position:[-3.68756,40.42024]},{code:"LK",name:"Sri Lanka",position:[79.90079,6.88398]},{code:"SR",name:"Suriname",position:[-55.16543,5.82031]},{code:"SJ",name:"Svalbard and Jan Mayen"},{code:"SZ",name:"Swaziland",position:[31.1411,-26.32604]},{code:"SE",name:"Sweden",position:[18.06682,59.33257]},{code:"CH",name:"Switzerland",position:[7.44046,46.94843]},{code:"TW",name:"Taiwan",position:[121.56355,25.03737]},{code:"TJ",name:"Tajikistan",position:[68.77152,38.56792]},{code:"TZ",name:"Tanzania, United Republic of",position:[35.74689,-6.17351]},{code:"TH",name:"Thailand",position:[100.50482,13.75336]},{code:"TL",name:"Timor-leste",position:[125.57033,-8.55409]},{code:"TG",name:"Togo",position:[1.22958,6.13969]},{code:"TK",name:"Tokelau",position:[-172.51546,-8.54248]},{code:"TO",name:"Tonga",position:[-175.20344,-21.13352]},{code:"TT",name:"Trinidad and Tobago",position:[-61.51604,10.66103]},{code:"TN",name:"Tunisia",position:[10.1827,36.80001]},{code:"TR",name:"Turkey",position:[32.85393,39.92121]},{code:"TM",name:"Turkmenistan",position:[58.39014,37.95121]},{code:"TC",name:"Turks and Caicos Islands",position:[-71.14584,21.46914]},{code:"TV",name:"Tuvalu",position:[179.19934,-8.51809]},{code:"UG",name:"Uganda",position:[32.57501,.31589]},{code:"UA",name:"Ukraine",position:[30.52428,50.45056]},{code:"AE",name:"United Arab Emirates",position:[54.37173,24.46918]},{code:"GB",name:"United Kingdom",position:[-.12721,51.50643]},{code:"US",name:"United States",position:[-77.03196,38.89036]},{code:"UM",name:"United States Minor Outlying Islands"},{code:"UY",name:"Uruguay",position:[-56.16294,-34.87418]},{code:"UZ",name:"Uzbekistan",position:[69.24134,41.32569]},{code:"VU",name:"Vanuatu",position:[168.32084,-17.73313]},{code:"VE",name:"Venezuela",position:[-66.91772,10.50555]},{code:"VN",name:"Vietnam",position:[105.85462,21.02884]},{code:"VG",name:"Virgin Islands, British",position:[-64.93216,18.34055]},{code:"VI",name:"Virgin Islands, U.S.",position:[-64.93216,18.34055]},{code:"WF",name:"Wallis and Futuna",position:[-176.17617,-13.27658]},{code:"EH",name:"Western Sahara",position:[-13.13949,24.6585]},{code:"YE",name:"Yemen",position:[44.21122,15.3667]},{code:"ZM",name:"Zambia",position:[28.27873,-15.42562]},{code:"ZW",name:"Zimbabwe",position:[31.04994,-17.8244]}];var WE="_2gchlm0";function m0({className:n="",placeholder:l="",disabled:h,...m}){return gt.jsx("input",{className:`${WE} ${n||""}`,disabled:h,placeholder:l,...m})}var E5="_4p016s0",M5="_4p016s1",A5="_4p016s2",L5="_4p016s3",P5="_4p016s4",R5="_4p016s5",KE="_4p016s6",JE="_4p016s7",eM="_7984xj0";const tM=({id:n,value:l,onChange:h,allowedCountries:m,multiple:w=!1,...E})=>{const[C,c]=te.useState(""),[D]=te.useState(m),B=te.useMemo(()=>D?T5.filter(ye=>D.includes(ye.code)):T5,[D]),Z=te.useMemo(()=>{const ye=Array.isArray(l)?l:[l];return B.filter(Se=>ye.includes(Se.code))},[l,B]),X=te.useMemo(()=>C.trim().length>0?B.filter(ye=>ye.name.toLowerCase().includes(C.toLowerCase())):B,[B,C]),Y=ye=>Z.find(({code:Se})=>Se===ye.code),U=C||Z.map(ye=>ye.name).join(", "),oe=ye=>{if(w){const Se=Array.isArray(ye)?ye:[];h(Se.map(je=>je.code))}else{const Se=Array.isArray(ye)?ye[0]:ye;h((Se==null?void 0:Se.code)??null)}},ge=ye=>{ye.target.value||oe(null),c(ye.target.value)};return gt.jsxs(C5,{immediate:!0,multiple:w,onClose:()=>c(""),value:Z,onChange:oe,children:[gt.jsx(Zy,{id:n,as:m0,"aria-label":"Country",value:U,onChange:ge,...E}),gt.jsx(Gy,{anchor:"bottom",className:P5,hidden:X.length===0,children:X.map(ye=>gt.jsx(pp,{value:ye,className:ny(A5,Y(ye)&&eM),children:ye.name},ye.code))})]})};var nM="_3ddc150";function qy({id:n,label:l,children:h,className:m=""}){return gt.jsxs("div",{className:`${nM} ${m||""}`,children:[gt.jsx("label",{htmlFor:n,children:l}),h]})}const iM=te.createContext(null);function rM(n,l){const h=Array.isArray(n)?n[0]:n?n.x:0,m=Array.isArray(n)?n[1]:n?n.y:0,w=Array.isArray(l)?l[0]:l?l.x:0,E=Array.isArray(l)?l[1]:l?l.y:0;return h===w&&m===E}function gc(n,l){if(n===l)return!0;if(!n||!l)return!1;if(Array.isArray(n)){if(!Array.isArray(l)||n.length!==l.length)return!1;for(let h=0;h<n.length;h++)if(!gc(n[h],l[h]))return!1;return!0}else if(Array.isArray(l))return!1;if(typeof n=="object"&&typeof l=="object"){const h=Object.keys(n),m=Object.keys(l);if(h.length!==m.length)return!1;for(const w of h)if(!l.hasOwnProperty(w)||!gc(n[w],l[w]))return!1;return!0}return!1}function I5(n){return{longitude:n.center.lng,latitude:n.center.lat,zoom:n.zoom,pitch:n.pitch,bearing:n.bearing,padding:n.padding}}function z5(n,l){const h=l.viewState||l,m={};if("longitude"in h&&"latitude"in h&&(h.longitude!==n.center.lng||h.latitude!==n.center.lat)){const w=n.center.constructor;m.center=new w(h.longitude,h.latitude)}return"zoom"in h&&h.zoom!==n.zoom&&(m.zoom=h.zoom),"bearing"in h&&h.bearing!==n.bearing&&(m.bearing=h.bearing),"pitch"in h&&h.pitch!==n.pitch&&(m.pitch=h.pitch),h.padding&&n.padding&&!gc(h.padding,n.padding)&&(m.padding=h.padding),m}const aM=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function D5(n){if(!n)return null;if(typeof n=="string"||("toJS"in n&&(n=n.toJS()),!n.layers))return n;const l={};for(const m of n.layers)l[m.id]=m;const h=n.layers.map(m=>{let w=null;"interactive"in m&&(w=Object.assign({},m),delete w.interactive);const E=l[m.ref];if(E){w=w||Object.assign({},m),delete w.ref;for(const C of aM)C in E&&(w[C]=E[C])}return w||m});return{...n,layers:h}}const O5={version:8,sources:{},layers:[]},k5={mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",click:"onClick",dblclick:"onDblClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mouseout:"onMouseOut",contextmenu:"onContextMenu",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",touchcancel:"onTouchCancel"},B5={movestart:"onMoveStart",move:"onMove",moveend:"onMoveEnd",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",zoomstart:"onZoomStart",zoom:"onZoom",zoomend:"onZoomEnd",rotatestart:"onRotateStart",rotate:"onRotate",rotateend:"onRotateEnd",pitchstart:"onPitchStart",pitch:"onPitch",pitchend:"onPitchEnd"},F5={wheel:"onWheel",boxzoomstart:"onBoxZoomStart",boxzoomend:"onBoxZoomEnd",boxzoomcancel:"onBoxZoomCancel",resize:"onResize",load:"onLoad",render:"onRender",idle:"onIdle",remove:"onRemove",data:"onData",styledata:"onStyleData",sourcedata:"onSourceData",error:"onError"},sM=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],oM=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class mp{constructor(l,h,m){this._map=null,this._internalUpdate=!1,this._hoveredFeatures=null,this._propsedCameraUpdate=null,this._styleComponents={},this._onEvent=w=>{const E=this.props[F5[w.type]];E?E(w):w.type==="error"&&console.error(w.error)},this._onCameraEvent=w=>{if(this._internalUpdate)return;w.viewState=this._propsedCameraUpdate||I5(this._map.transform);const E=this.props[B5[w.type]];E&&E(w)},this._onCameraUpdate=w=>this._internalUpdate?w:(this._propsedCameraUpdate=I5(w),z5(w,this.props)),this._onPointerEvent=w=>{(w.type==="mousemove"||w.type==="mouseout")&&this._updateHover(w);const E=this.props[k5[w.type]];E&&(this.props.interactiveLayerIds&&w.type!=="mouseover"&&w.type!=="mouseout"&&(w.features=this._hoveredFeatures||this._queryRenderedFeatures(w.point)),E(w),delete w.features)},this._MapClass=l,this.props=h,this._initialize(m)}get map(){return this._map}setProps(l){const h=this.props;this.props=l;const m=this._updateSettings(l,h),w=this._updateSize(l),E=this._updateViewState(l);this._updateStyle(l,h),this._updateStyleComponents(l),this._updateHandlers(l,h),(m||w||E&&!this._map.isMoving())&&this.redraw()}static reuse(l,h){const m=mp.savedMaps.pop();if(!m)return null;const w=m.map,E=w.getContainer();for(h.className=E.className;E.childNodes.length>0;)h.appendChild(E.childNodes[0]);w._container=h;const C=w._resizeObserver;C&&(C.disconnect(),C.observe(h)),m.setProps({...l,styleDiffing:!1}),w.resize();const{initialViewState:c}=l;return c&&(c.bounds?w.fitBounds(c.bounds,{...c.fitBoundsOptions,duration:0}):m._updateViewState(c)),w.isStyleLoaded()?w.fire("load"):w.once("style.load",()=>w.fire("load")),w._update(),m}_initialize(l){const{props:h}=this,{mapStyle:m=O5}=h,w={...h,...h.initialViewState,container:l,style:D5(m)},E=w.initialViewState||w.viewState||w;if(Object.assign(w,{center:[E.longitude||0,E.latitude||0],zoom:E.zoom||0,pitch:E.pitch||0,bearing:E.bearing||0}),h.gl){const c=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=c,h.gl)}const C=new this._MapClass(w);E.padding&&C.setPadding(E.padding),h.cursor&&(C.getCanvas().style.cursor=h.cursor),C.transformCameraUpdate=this._onCameraUpdate,C.on("style.load",()=>{var c;this._styleComponents={light:C.getLight(),sky:C.getSky(),projection:(c=C.getProjection)==null?void 0:c.call(C),terrain:C.getTerrain()},this._updateStyleComponents(this.props)}),C.on("sourcedata",()=>{this._updateStyleComponents(this.props)});for(const c in k5)C.on(c,this._onPointerEvent);for(const c in B5)C.on(c,this._onCameraEvent);for(const c in F5)C.on(c,this._onEvent);this._map=C}recycle(){const h=this.map.getContainer().querySelector("[mapboxgl-children]");h==null||h.remove(),mp.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const l=this._map;l.style&&(l._frame&&(l._frame.cancel(),l._frame=null),l._render())}_updateSize(l){const{viewState:h}=l;if(h){const m=this._map;if(h.width!==m.transform.width||h.height!==m.transform.height)return m.resize(),!0}return!1}_updateViewState(l){const h=this._map,m=h.transform;if(!h.isMoving()){const E=z5(m,l);if(Object.keys(E).length>0)return this._internalUpdate=!0,h.jumpTo(E),this._internalUpdate=!1,!0}return!1}_updateSettings(l,h){const m=this._map;let w=!1;for(const E of sM)if(E in l&&!gc(l[E],h[E])){w=!0;const C=m[`set${E[0].toUpperCase()}${E.slice(1)}`];C==null||C.call(m,l[E])}return w}_updateStyle(l,h){if(l.cursor!==h.cursor&&(this._map.getCanvas().style.cursor=l.cursor||""),l.mapStyle!==h.mapStyle){const{mapStyle:m=O5,styleDiffing:w=!0}=l,E={diff:w};"localIdeographFontFamily"in l&&(E.localIdeographFontFamily=l.localIdeographFontFamily),this._map.setStyle(D5(m),E)}}_updateStyleComponents({light:l,projection:h,sky:m,terrain:w}){var c,D;const E=this._map,C=this._styleComponents;E.style._loaded&&(l&&!gc(l,C.light)&&(C.light=l,E.setLight(l)),h&&!gc(h,C.projection)&&h!==((c=C.projection)==null?void 0:c.type)&&(C.projection=typeof h=="string"?{type:h}:h,(D=E.setProjection)==null||D.call(E,C.projection)),m&&!gc(m,C.sky)&&(C.sky=m,E.setSky(m)),w!==void 0&&!gc(w,C.terrain)&&(!w||E.getSource(w.source))&&(C.terrain=w,E.setTerrain(w)))}_updateHandlers(l,h){const m=this._map;for(const w of oM){const E=l[w]??!0,C=h[w]??!0;gc(E,C)||(E?m[w].enable(E):m[w].disable())}}_queryRenderedFeatures(l){const h=this._map,{interactiveLayerIds:m=[]}=this.props;try{return h.queryRenderedFeatures(l,{layers:m.filter(h.getLayer.bind(h))})}catch{return[]}}_updateHover(l){var w;const{props:h}=this;if(h.interactiveLayerIds&&(h.onMouseMove||h.onMouseEnter||h.onMouseLeave)){const E=l.type,C=((w=this._hoveredFeatures)==null?void 0:w.length)>0,c=this._queryRenderedFeatures(l.point),D=c.length>0;!D&&C&&(l.type="mouseleave",this._onPointerEvent(l)),this._hoveredFeatures=c,D&&!C&&(l.type="mouseenter",this._onPointerEvent(l)),l.type=E}else this._hoveredFeatures=null}}mp.savedMaps=[];const lM=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function cM(n){if(!n)return null;const l=n.map,h={getMap:()=>l};for(const m of uM(l))!(m in h)&&!lM.includes(m)&&(h[m]=l[m].bind(l));return h}function uM(n){const l=new Set;let h=n;for(;h;){for(const m of Object.getOwnPropertyNames(h))m[0]!=="_"&&typeof n[m]=="function"&&m!=="fire"&&m!=="setEventedParent"&&l.add(m);h=Object.getPrototypeOf(h)}return Array.from(l)}const hM=typeof document<"u"?te.useLayoutEffect:te.useEffect;function dM(n,l){const{RTLTextPlugin:h,maxParallelImageRequests:m,workerCount:w,workerUrl:E}=l;if(h&&n.getRTLTextPluginStatus&&n.getRTLTextPluginStatus()==="unavailable"){const{pluginUrl:C,lazy:c=!0}=typeof h=="string"?{pluginUrl:h}:h;n.setRTLTextPlugin(C,D=>{D&&console.error(D)},c)}m!==void 0&&n.setMaxParallelImageRequests(m),w!==void 0&&n.setWorkerCount(w),E!==void 0&&n.setWorkerUrl(E)}const g0=te.createContext(null);function fM(n,l){const h=te.useContext(iM),[m,w]=te.useState(null),E=te.useRef(),{current:C}=te.useRef({mapLib:null,map:null});te.useEffect(()=>{const B=n.mapLib;let Z=!0,X;return Promise.resolve(B||Promise.resolve().then(()=>nA)).then(Y=>{if(!Z)return;if(!Y)throw new Error("Invalid mapLib");const U="Map"in Y?Y:Y.default;if(!U.Map)throw new Error("Invalid mapLib");dM(U,n),n.reuseMaps&&(X=mp.reuse(n,E.current)),X||(X=new mp(U.Map,n,E.current)),C.map=cM(X),C.mapLib=U,w(X),h==null||h.onMapMount(C.map,n.id)}).catch(Y=>{const{onError:U}=n;U?U({type:"error",target:null,originalEvent:null,error:Y}):console.error(Y)}),()=>{Z=!1,X&&(h==null||h.onMapUnmount(n.id),n.reuseMaps?X.recycle():X.destroy())}},[]),hM(()=>{m&&m.setProps(n)}),te.useImperativeHandle(l,()=>C.map,[m]);const c=te.useMemo(()=>({position:"relative",width:"100%",height:"100%",...n.style}),[n.style]),D={height:"100%"};return te.createElement("div",{id:n.id,ref:E,style:c},m&&te.createElement(g0.Provider,{value:C},te.createElement("div",{"mapboxgl-children":"",style:D},n.children)))}const pM=te.forwardRef(fM),mM=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function lu(n,l){if(!n||!l)return;const h=n.style;for(const m in l){const w=l[m];Number.isFinite(w)&&!mM.test(m)?h[m]=`${w}px`:h[m]=w}}function N5(n,l){if(n===l)return null;const h=U5(n),m=U5(l),w=[];for(const E of m)h.has(E)||w.push(E);for(const E of h)m.has(E)||w.push(E);return w.length===0?null:w}function U5(n){return new Set(n?n.trim().split(/\s+/):[])}const gM=te.memo(te.forwardRef((n,l)=>{const{map:h,mapLib:m}=te.useContext(g0),w=te.useRef({props:n}),E=te.useMemo(()=>{let Se=!1;te.Children.forEach(n.children,Oe=>{Oe&&(Se=!0)});const je={...n,element:Se?document.createElement("div"):void 0},Pe=new m.Marker(je);return Pe.setLngLat([n.longitude,n.latitude]),Pe.getElement().addEventListener("click",Oe=>{var Je,et;(et=(Je=w.current.props).onClick)==null||et.call(Je,{type:"click",target:Pe,originalEvent:Oe})}),Pe.on("dragstart",Oe=>{var et,ot;const Je=Oe;Je.lngLat=E.getLngLat(),(ot=(et=w.current.props).onDragStart)==null||ot.call(et,Je)}),Pe.on("drag",Oe=>{var et,ot;const Je=Oe;Je.lngLat=E.getLngLat(),(ot=(et=w.current.props).onDrag)==null||ot.call(et,Je)}),Pe.on("dragend",Oe=>{var et,ot;const Je=Oe;Je.lngLat=E.getLngLat(),(ot=(et=w.current.props).onDragEnd)==null||ot.call(et,Je)}),Pe},[]);te.useEffect(()=>(E.addTo(h.getMap()),()=>{E.remove()}),[]);const{longitude:C,latitude:c,offset:D,style:B,draggable:Z=!1,popup:X=null,rotation:Y=0,rotationAlignment:U="auto",pitchAlignment:oe="auto"}=n;te.useEffect(()=>{lu(E.getElement(),B)},[B]),te.useImperativeHandle(l,()=>E,[]);const ge=w.current.props;(E.getLngLat().lng!==C||E.getLngLat().lat!==c)&&E.setLngLat([C,c]),D&&!rM(E.getOffset(),D)&&E.setOffset(D),E.isDraggable()!==Z&&E.setDraggable(Z),E.getRotation()!==Y&&E.setRotation(Y),E.getRotationAlignment()!==U&&E.setRotationAlignment(U),E.getPitchAlignment()!==oe&&E.setPitchAlignment(oe),E.getPopup()!==X&&E.setPopup(X);const ye=N5(ge.className,n.className);if(ye)for(const Se of ye)E.toggleClassName(Se);return w.current.props=n,la.createPortal(n.children,E.getElement())}));te.memo(te.forwardRef((n,l)=>{const{map:h,mapLib:m}=te.useContext(g0),w=te.useMemo(()=>document.createElement("div"),[]),E=te.useRef({props:n}),C=te.useMemo(()=>{const c={...n},D=new m.Popup(c);return D.setLngLat([n.longitude,n.latitude]),D.once("open",B=>{var Z,X;(X=(Z=E.current.props).onOpen)==null||X.call(Z,B)}),D},[]);if(te.useEffect(()=>{const c=D=>{var B,Z;(Z=(B=E.current.props).onClose)==null||Z.call(B,D)};return C.on("close",c),C.setDOMContent(w).addTo(h.getMap()),()=>{C.off("close",c),C.isOpen()&&C.remove()}},[]),te.useEffect(()=>{lu(C.getElement(),n.style)},[n.style]),te.useImperativeHandle(l,()=>C,[]),C.isOpen()){const c=E.current.props;(C.getLngLat().lng!==n.longitude||C.getLngLat().lat!==n.latitude)&&C.setLngLat([n.longitude,n.latitude]),n.offset&&!gc(c.offset,n.offset)&&C.setOffset(n.offset),(c.anchor!==n.anchor||c.maxWidth!==n.maxWidth)&&(C.options.anchor=n.anchor,C.setMaxWidth(n.maxWidth));const D=N5(c.className,n.className);if(D)for(const B of D)C.toggleClassName(B);E.current.props=n}return la.createPortal(n.children,w)}));function Bd(n,l,h,m){const w=te.useContext(g0),E=te.useMemo(()=>n(w),[]);return te.useEffect(()=>{const C=l,c=null,D=typeof l=="function"?l:null,{map:B}=w;return B.hasControl(E)||(B.addControl(E,C==null?void 0:C.position),c&&c(w)),()=>{D&&D(w),B.hasControl(E)&&B.removeControl(E)}},[]),E}function yM(n){const l=Bd(({mapLib:h})=>new h.AttributionControl(n),{position:n.position});return te.useEffect(()=>{lu(l._container,n.style)},[n.style]),null}te.memo(yM);function _M(n){const l=Bd(({mapLib:h})=>new h.FullscreenControl({container:n.containerId&&document.getElementById(n.containerId)}),{position:n.position});return te.useEffect(()=>{lu(l._controlContainer,n.style)},[n.style]),null}te.memo(_M);function vM(n,l){const h=te.useRef({props:n}),m=Bd(({mapLib:w})=>{const E=new w.GeolocateControl(n),C=E._setupUI;return E._setupUI=()=>{E._container.hasChildNodes()||C()},E.on("geolocate",c=>{var D,B;(B=(D=h.current.props).onGeolocate)==null||B.call(D,c)}),E.on("error",c=>{var D,B;(B=(D=h.current.props).onError)==null||B.call(D,c)}),E.on("outofmaxbounds",c=>{var D,B;(B=(D=h.current.props).onOutOfMaxBounds)==null||B.call(D,c)}),E.on("trackuserlocationstart",c=>{var D,B;(B=(D=h.current.props).onTrackUserLocationStart)==null||B.call(D,c)}),E.on("trackuserlocationend",c=>{var D,B;(B=(D=h.current.props).onTrackUserLocationEnd)==null||B.call(D,c)}),E},{position:n.position});return h.current.props=n,te.useImperativeHandle(l,()=>m,[]),te.useEffect(()=>{lu(m._container,n.style)},[n.style]),null}te.memo(te.forwardRef(vM));function xM(n){const l=Bd(({mapLib:h})=>new h.NavigationControl(n),{position:n.position});return te.useEffect(()=>{lu(l._container,n.style)},[n.style]),null}const bM=te.memo(xM);function wM(n){const l=Bd(({mapLib:E})=>new E.ScaleControl(n),{position:n.position}),h=te.useRef(n),m=h.current;h.current=n;const{style:w}=n;return n.maxWidth!==void 0&&n.maxWidth!==m.maxWidth&&(l.options.maxWidth=n.maxWidth),n.unit!==void 0&&n.unit!==m.unit&&l.setUnit(n.unit),te.useEffect(()=>{lu(l._container,w)},[w]),null}te.memo(wM);function SM(n){const l=Bd(({mapLib:h})=>new h.TerrainControl(n),{position:n.position});return te.useEffect(()=>{lu(l._container,n.style)},[n.style]),null}te.memo(SM);function CM(n){const l=Bd(({mapLib:h})=>new h.LogoControl(n),{position:n.position});return te.useEffect(()=>{lu(l._container,n.style)},[n.style]),null}te.memo(CM);function Hy(){const n=te.useContext(K_);if(!n)throw new Error("Please wrap this component with <AmazonLocationProvider> component.");return n}const TM=({mode:n,...l})=>gt.jsx("a",{...l,href:"https://aws.amazon.com/location/",target:"_blank",rel:"noreferrer",children:n==="Light"?gt.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"133",height:"23",viewBox:"0 0 198 34",children:gt.jsxs("g",{fill:"none",children:[gt.jsx("path",{fill:"#232F3E",d:"M49.5904644,23.7160494 L48.2966653,20.0087901 L42.5352163,20.0087901 L41.2818484,23.7160494 L39.1592093,23.7160494 L44.3344056,9.75338272 L46.5581228,9.75338272 L51.7333191,23.7160494 L49.5904644,23.7160494 Z M43.0608222,18.4573827 L47.7710594,18.4573827 L45.405833,11.6070123 L43.0608222,18.4573827 Z M66.531146,23.7160494 L66.531146,16.7850864 C66.531146,16.1134815 66.4031138,15.6164938 66.1470494,15.2941235 C65.890985,14.9717531 65.4866728,14.8105679 64.9341128,14.8105679 C63.9502864,14.8105679 62.9597215,15.1127901 61.962418,15.7172346 C61.9758951,15.8112593 61.9826336,15.912 61.9826336,16.0194568 C61.9826336,16.1269136 61.9826336,16.2343704 61.9826336,16.3418272 L61.9826336,23.7160494 L59.9812882,23.7160494 L59.9812882,16.7850864 C59.9812882,16.1134815 59.853256,15.6164938 59.5971916,15.2941235 C59.3411272,14.9717531 58.936815,14.8105679 58.384255,14.8105679 C57.3599974,14.8105679 56.376171,15.1060741 55.4327758,15.6970864 L55.4327758,23.7160494 L53.4314304,23.7160494 L53.4314304,13.5009383 L55.109326,13.5009383 L55.3114821,14.5284938 C56.6052812,13.6419753 57.8653876,13.198716 59.0918013,13.198716 C60.3451692,13.198716 61.1942248,13.6755556 61.6389683,14.6292346 C62.9731985,13.6755556 64.3074288,13.198716 65.6416591,13.198716 C66.5715772,13.198716 67.2858621,13.460642 67.7845139,13.9844938 C68.2831656,14.5083457 68.5324915,15.2538272 68.5324915,16.2209383 L68.5324915,23.7160494 L66.531146,23.7160494 Z M77.5082225,23.7160494 L77.3464977,22.6683457 C76.861323,23.0847407 76.3256093,23.4071111 75.7393566,23.6354568 C75.1531039,23.8638025 74.5702205,23.9779753 73.9907063,23.9779753 C73.0338341,23.9779753 72.2690101,23.7059753 71.6962345,23.1619753 C71.1234589,22.6179753 70.8370711,21.889284 70.8370711,20.9759012 C70.8370711,19.995358 71.187475,19.2129383 71.8882828,18.628642 C72.5890906,18.0443457 73.5324858,17.7521975 74.7184683,17.7521975 C75.5001386,17.7521975 76.3491942,17.8663704 77.2656352,18.094716 L77.2656352,16.7649383 C77.2656352,16.0396049 77.1005411,15.5291852 76.7703528,15.233679 C76.4401644,14.9381728 75.8774966,14.7904198 75.0823493,14.7904198 C73.936798,14.7904198 72.7508155,14.9986173 71.5244018,15.4150123 L71.5244018,14.004642 C72.0095765,13.7494321 72.6025677,13.5513086 73.3033755,13.4102716 C74.0041834,13.2692346 74.7117297,13.198716 75.4260147,13.198716 C76.7063367,13.198716 77.6497318,13.464 78.2562001,13.9945679 C78.8626684,14.5251358 79.1659026,15.3344198 79.1659026,16.4224198 L79.1659026,23.7160494 L77.5082225,23.7160494 Z M74.475881,22.4668642 C75.392322,22.4668642 76.3222401,22.1243457 77.2656352,21.4393086 L77.2656352,19.3841975 C76.5648274,19.2095802 75.8505425,19.1222716 75.1227805,19.1222716 C73.5998712,19.1222716 72.8384165,19.7065679 72.8384165,20.8751605 C72.8384165,21.3855802 72.9799258,21.7784691 73.2629443,22.0538272 C73.5459629,22.3291852 73.9502751,22.4668642 74.475881,22.4668642 Z M81.3694042,23.7160494 L81.3694042,22.1847901 L87.2521468,15.0724938 L81.5715603,15.0724938 L81.5715603,13.5009383 L89.475864,13.5009383 L89.475864,15.0120494 L83.5122589,22.1444938 L89.5365108,22.1444938 L89.5365108,23.7160494 L81.3694042,23.7160494 Z M95.9246438,24.0182716 C94.3882574,24.0182716 93.1887978,23.5414321 92.3262651,22.5877531 C91.4637324,21.6340741 91.032466,20.3042963 91.032466,18.5984198 C91.032466,16.9059753 91.4637324,15.5829136 92.3262651,14.6292346 C93.1887978,13.6755556 94.3882574,13.198716 95.9246438,13.198716 C97.4610302,13.198716 98.6604897,13.6755556 99.5230224,14.6292346 C100.385555,15.5829136 100.816822,16.9059753 100.816822,18.5984198 C100.816822,20.3042963 100.385555,21.6340741 99.5230224,22.5877531 C98.6604897,23.5414321 97.4610302,24.0182716 95.9246438,24.0182716 Z M95.9246438,22.4064198 C97.8249112,22.4064198 98.7750448,21.1370864 98.7750448,18.5984198 C98.7750448,16.0731852 97.8249112,14.8105679 95.9246438,14.8105679 C94.0243764,14.8105679 93.0742427,16.0731852 93.0742427,18.5984198 C93.0742427,21.1370864 94.0243764,22.4064198 95.9246438,22.4064198 Z M110.21708,23.7160494 L110.21708,16.8858272 C110.21708,16.1739259 110.072202,15.6500741 109.782445,15.3142716 C109.492688,14.9784691 109.037836,14.8105679 108.417891,14.8105679 C107.353202,14.8105679 106.308729,15.1530864 105.284471,15.8381235 L105.284471,23.7160494 L103.283126,23.7160494 L103.283126,13.5009383 L104.961022,13.5009383 L105.163178,14.6292346 C106.4435,13.6755556 107.791207,13.198716 109.2063,13.198716 C110.190126,13.198716 110.938104,13.457284 111.450233,13.9744198 C111.962361,14.4915556 112.218426,15.2403951 112.218426,16.2209383 L112.218426,23.7160494 L110.21708,23.7160494 Z M120.668551,23.7160494 L120.668551,9.75338272 L122.730543,9.75338272 L122.730543,22.0236049 L129.341048,22.0236049 L129.341048,23.7160494 L120.668551,23.7160494 Z M135.425947,24.0182716 C133.88956,24.0182716 132.690101,23.5414321 131.827568,22.5877531 C130.965035,21.6340741 130.533769,20.3042963 130.533769,18.5984198 C130.533769,16.9059753 130.965035,15.5829136 131.827568,14.6292346 C132.690101,13.6755556 133.88956,13.198716 135.425947,13.198716 C136.962333,13.198716 138.161793,13.6755556 139.024325,14.6292346 C139.886858,15.5829136 140.318125,16.9059753 140.318125,18.5984198 C140.318125,20.3042963 139.886858,21.6340741 139.024325,22.5877531 C138.161793,23.5414321 136.962333,24.0182716 135.425947,24.0182716 Z M135.425947,22.4064198 C137.326214,22.4064198 138.276348,21.1370864 138.276348,18.5984198 C138.276348,16.0731852 137.326214,14.8105679 135.425947,14.8105679 C133.525679,14.8105679 132.575546,16.0731852 132.575546,18.5984198 C132.575546,21.1370864 133.525679,22.4064198 135.425947,22.4064198 Z M149.880108,23.3332346 C149.098438,23.7361975 148.195474,23.937679 147.171217,23.937679 C145.580922,23.937679 144.364616,23.4843457 143.522299,22.577679 C142.679982,21.6710123 142.258823,20.3580247 142.258823,18.638716 C142.258823,16.9328395 142.693459,15.6131358 143.56273,14.6796049 C144.432001,13.7460741 145.661784,13.2793086 147.252079,13.2793086 C148.155043,13.2793086 149.004099,13.467358 149.799246,13.8434568 L149.799246,15.2739753 C149.031053,15.0321975 148.276337,14.9113086 147.535098,14.9113086 C146.403023,14.9113086 145.58766,15.1967407 145.089009,15.7676049 C144.590357,16.3384691 144.341031,17.2484938 144.341031,18.497679 L144.341031,18.7596049 C144.341031,19.9819259 144.593726,20.8785185 145.099116,21.4493827 C145.604507,22.0202469 146.403023,22.305679 147.494666,22.305679 C148.222428,22.305679 149.017576,22.171358 149.880108,21.902716 L149.880108,23.3332346 Z M158.128077,23.7160494 L157.966353,22.6683457 C157.481178,23.0847407 156.945464,23.4071111 156.359212,23.6354568 C155.772959,23.8638025 155.190075,23.9779753 154.610561,23.9779753 C153.653689,23.9779753 152.888865,23.7059753 152.316089,23.1619753 C151.743314,22.6179753 151.456926,21.889284 151.456926,20.9759012 C151.456926,19.995358 151.80733,19.2129383 152.508138,18.628642 C153.208946,18.0443457 154.152341,17.7521975 155.338323,17.7521975 C156.119993,17.7521975 156.969049,17.8663704 157.88549,18.094716 L157.88549,16.7649383 C157.88549,16.0396049 157.720396,15.5291852 157.390208,15.233679 C157.060019,14.9381728 156.497352,14.7904198 155.702204,14.7904198 C154.556653,14.7904198 153.37067,14.9986173 152.144257,15.4150123 L152.144257,14.004642 C152.629431,13.7494321 153.222423,13.5513086 153.92323,13.4102716 C154.624038,13.2692346 155.331585,13.198716 156.04587,13.198716 C157.326192,13.198716 158.269587,13.464 158.876055,13.9945679 C159.482523,14.5251358 159.785758,15.3344198 159.785758,16.4224198 L159.785758,23.7160494 L158.128077,23.7160494 Z M155.095736,22.4668642 C156.012177,22.4668642 156.942095,22.1243457 157.88549,21.4393086 L157.88549,19.3841975 C157.184682,19.2095802 156.470397,19.1222716 155.742635,19.1222716 C154.219726,19.1222716 153.458271,19.7065679 153.458271,20.8751605 C153.458271,21.3855802 153.599781,21.7784691 153.882799,22.0538272 C154.165818,22.3291852 154.57013,22.4668642 155.095736,22.4668642 Z M168.518901,23.4742716 C167.858525,23.7294815 167.110547,23.8570864 166.274968,23.8570864 C164.361224,23.8570864 163.404352,22.9034074 163.404352,20.9960494 L163.404352,15.0724938 L161.544516,15.0724938 L161.544516,13.7830123 L163.464999,13.5412346 L163.768233,10.6399012 L165.405697,10.6399012 L165.405697,13.5009383 L168.438039,13.5009383 L168.438039,15.0724938 L165.405697,15.0724938 L165.405697,20.8953086 C165.405697,21.3922963 165.516883,21.7415309 165.739255,21.9430123 C165.961627,22.1444938 166.342354,22.2452346 166.881437,22.2452346 C167.433997,22.2452346 167.979818,22.1780741 168.518901,22.0437531 L168.518901,23.4742716 Z M170.580894,23.7160494 L170.580894,13.5009383 L172.582239,13.5009383 L172.582239,23.7160494 L170.580894,23.7160494 Z M171.591674,11.6876049 C171.200839,11.6876049 170.894236,11.5767901 170.671864,11.3551605 C170.449492,11.1335309 170.338306,10.8413827 170.338306,10.478716 C170.338306,10.1160494 170.449492,9.82390123 170.671864,9.6022716 C170.894236,9.38064198 171.200839,9.26982716 171.591674,9.26982716 C171.982509,9.26982716 172.289113,9.38064198 172.511484,9.6022716 C172.733856,9.82390123 172.845042,10.1160494 172.845042,10.478716 C172.845042,10.8413827 172.733856,11.1335309 172.511484,11.3551605 C172.289113,11.5767901 171.982509,11.6876049 171.591674,11.6876049 Z M180.021584,24.0182716 C178.485197,24.0182716 177.285738,23.5414321 176.423205,22.5877531 C175.560672,21.6340741 175.129406,20.3042963 175.129406,18.5984198 C175.129406,16.9059753 175.560672,15.5829136 176.423205,14.6292346 C177.285738,13.6755556 178.485197,13.198716 180.021584,13.198716 C181.55797,13.198716 182.75743,13.6755556 183.619962,14.6292346 C184.482495,15.5829136 184.913761,16.9059753 184.913761,18.5984198 C184.913761,20.3042963 184.482495,21.6340741 183.619962,22.5877531 C182.75743,23.5414321 181.55797,24.0182716 180.021584,24.0182716 Z M180.021584,22.4064198 C181.921851,22.4064198 182.871985,21.1370864 182.871985,18.5984198 C182.871985,16.0731852 181.921851,14.8105679 180.021584,14.8105679 C178.121316,14.8105679 177.171183,16.0731852 177.171183,18.5984198 C177.171183,21.1370864 178.121316,22.4064198 180.021584,22.4064198 Z M194.31402,23.7160494 L194.31402,16.8858272 C194.31402,16.1739259 194.169142,15.6500741 193.879385,15.3142716 C193.589628,14.9784691 193.134776,14.8105679 192.514831,14.8105679 C191.450142,14.8105679 190.405669,15.1530864 189.381411,15.8381235 L189.381411,23.7160494 L187.380066,23.7160494 L187.380066,13.5009383 L189.057962,13.5009383 L189.260118,14.6292346 C190.54044,13.6755556 191.888147,13.198716 193.30324,13.198716 C194.287066,13.198716 195.035044,13.457284 195.547173,13.9744198 C196.059301,14.4915556 196.315366,15.2403951 196.315366,16.2209383 L196.315366,23.7160494 L194.31402,23.7160494 Z"}),gt.jsx("path",{fill:"#FFF",d:"M45.9668162,8.07437037 L47.7317091,8.07437037 L48.138381,9.1715702 L51.7451115,18.902321 L51.7467962,11.8219259 L56.4957188,11.8219259 L56.5294727,11.9965432 L56.9274515,11.8607039 C57.5024083,11.6799954 58.0794674,11.5701804 58.6578133,11.5334827 L59.0918013,11.5197037 C60.1472223,11.5197037 61.0712814,11.7793437 61.8090624,12.2879588 L62.0095878,12.4381235 L62.2838708,12.302079 C63.2440584,11.8496386 64.2230021,11.5899628 65.2154921,11.5321133 L65.6416591,11.5197037 C67.0058848,11.5197037 68.1650592,11.9447692 69.0066548,12.8288961 C69.3058071,13.1431664 69.5474563,13.4964821 69.7338656,13.8846825 L69.8397676,14.1288889 L69.8397676,12.9922785 L70.7380843,12.5197491 C71.3763553,12.184008 72.1201835,11.9354886 72.9699387,11.764476 C73.7804825,11.6013547 74.5997264,11.5197037 75.4260147,11.5197037 C77.0791717,11.5197037 78.408159,11.8934167 79.36753,12.732721 C79.5352458,12.8794469 79.688251,13.0370593 79.8267904,13.2049697 L79.886926,13.2843457 L79.886926,11.8219259 L91.1604982,11.8219259 L91.1604982,13.4153086 L91.3389394,13.2311154 C92.4225909,12.176117 93.8369968,11.6105637 95.5029584,11.5297981 L95.9246438,11.5197037 C97.9165376,11.5197037 99.5750194,12.1790254 100.774324,13.5050644 C101.043225,13.8023805 101.279995,14.1228859 101.485144,14.4656208 L101.598492,14.6712099 L101.598492,11.8219259 L106.371477,11.8219259 L106.409807,12.0351605 L106.594726,11.9655473 C107.297791,11.7191585 108.020709,11.5738041 108.760456,11.5321968 L109.2063,11.5197037 C110.609627,11.5197037 111.79059,11.9279499 112.649209,12.7949637 C113.501845,13.6559353 113.90306,14.8292574 113.90306,16.2209383 L113.90306,25.3950617 L108.532446,25.3950617 L108.532446,16.8858272 C108.532446,16.7128362 108.522353,16.5898453 108.513898,16.5120009 L108.508861,16.4862222 L108.417891,16.4895802 C107.970173,16.4895802 107.520368,16.5820287 107.06124,16.7749171 L106.969106,16.8153086 L106.969106,25.3950617 L101.598492,25.3950617 L101.598492,22.5474568 L101.440991,22.8231587 C101.311167,23.0338269 101.16919,23.2358313 101.014934,23.4289462 L100.774324,23.7119232 C99.5750194,25.0379623 97.9165376,25.697284 95.9246438,25.697284 C94.0750281,25.697284 92.5128952,25.1287872 91.3389394,23.9858723 L91.221145,23.8638025 L91.221145,25.3950617 L76.0629429,25.3950617 L76.0493293,25.3060741 L75.9627015,25.3383735 C75.4416162,25.5072763 74.9156301,25.6098477 74.3873274,25.6441201 L73.9907063,25.6569877 C72.6215606,25.6569877 71.438118,25.2361112 70.5340596,24.3774717 C70.4503124,24.2979319 70.3703736,24.2159415 70.2942429,24.1315852 L70.215441,24.0384198 L70.2171257,25.3950617 L64.8465118,25.3950617 L64.8465118,16.7850864 C64.8465118,16.7123925 64.8447019,16.6488274 64.8420661,16.5941496 L64.8347194,16.4929383 L64.6492066,16.5025907 C64.3622271,16.5286958 64.0688496,16.594337 63.7674701,16.7017848 L63.6655832,16.7414321 L63.6672678,25.3950617 L58.296654,25.3950617 L58.296654,16.7850864 C58.296654,16.7123925 58.2948441,16.6488274 58.2922083,16.5941496 L58.2848615,16.4929383 L58.0858295,16.5020492 C57.7887535,16.5270485 57.495456,16.5898228 57.2035088,16.692029 L57.1157254,16.726321 L57.11741,25.3950617 L51.7467962,25.3950617 L48.3927926,25.3950617 L47.9993327,24.2676396 L47.0972057,21.6861235 L43.7447836,21.6861235 L42.878289,24.2521853 L42.4918999,25.3950617 L36.7409871,25.3950617 L37.5789511,23.1342369 L42.7541474,9.1715702 L43.1608193,8.07437037 L44.8330573,8.07437037 L45.9668162,8.07437037 Z M180.021584,13.198716 C178.485197,13.198716 177.285738,13.6755556 176.423205,14.6292346 C175.560672,15.5829136 175.129406,16.9059753 175.129406,18.5984198 C175.129406,20.3042963 175.560672,21.6340741 176.423205,22.5877531 C177.285738,23.5414321 178.485197,24.0182716 180.021584,24.0182716 C181.55797,24.0182716 182.75743,23.5414321 183.619962,22.5877531 C184.482495,21.6340741 184.913761,20.3042963 184.913761,18.5984198 C184.913761,16.9059753 184.482495,15.5829136 183.619962,14.6292346 C182.75743,13.6755556 181.55797,13.198716 180.021584,13.198716 Z M95.9246438,13.198716 C94.3882574,13.198716 93.1887978,13.6755556 92.3262651,14.6292346 C91.4637324,15.5829136 91.032466,16.9059753 91.032466,18.5984198 C91.032466,20.3042963 91.4637324,21.6340741 92.3262651,22.5877531 C93.1887978,23.5414321 94.3882574,24.0182716 95.9246438,24.0182716 C97.4610302,24.0182716 98.6604897,23.5414321 99.5230224,22.5877531 C100.385555,21.6340741 100.816822,20.3042963 100.816822,18.5984198 C100.816822,16.9059753 100.385555,15.5829136 99.5230224,14.6292346 C98.6604897,13.6755556 97.4610302,13.198716 95.9246438,13.198716 Z M135.425947,13.198716 C133.88956,13.198716 132.690101,13.6755556 131.827568,14.6292346 C130.965035,15.5829136 130.533769,16.9059753 130.533769,18.5984198 C130.533769,20.3042963 130.965035,21.6340741 131.827568,22.5877531 C132.690101,23.5414321 133.88956,24.0182716 135.425947,24.0182716 C136.962333,24.0182716 138.161793,23.5414321 139.024325,22.5877531 C139.886858,21.6340741 140.318125,20.3042963 140.318125,18.5984198 C140.318125,16.9059753 139.886858,15.5829136 139.024325,14.6292346 C138.161793,13.6755556 136.962333,13.198716 135.425947,13.198716 Z M75.4260147,13.198716 C74.7117297,13.198716 74.0041834,13.2692346 73.3033755,13.4102716 C72.6025677,13.5513086 72.0095765,13.7494321 71.5244018,14.004642 L71.5244018,15.4150123 C72.7508155,14.9986173 73.936798,14.7904198 75.0823493,14.7904198 C75.8774966,14.7904198 76.4401644,14.9381728 76.7703528,15.233679 C77.1005411,15.5291852 77.2656352,16.0396049 77.2656352,16.7649383 L77.2656352,18.094716 C76.3491942,17.8663704 75.5001386,17.7521975 74.7184683,17.7521975 C73.5324858,17.7521975 72.5890906,18.0443457 71.8882828,18.628642 C71.187475,19.2129383 70.8370711,19.995358 70.8370711,20.9759012 C70.8370711,21.889284 71.1234589,22.6179753 71.6962345,23.1619753 C72.2690101,23.7059753 73.0338341,23.9779753 73.9907063,23.9779753 C74.5702205,23.9779753 75.1531039,23.8638025 75.7393566,23.6354568 C76.3256093,23.4071111 76.861323,23.0847407 77.3464977,22.6683457 L77.5082225,23.7160494 L79.1659026,23.7160494 L79.1659026,16.4224198 C79.1659026,15.3344198 78.8626684,14.5251358 78.2562001,13.9945679 C77.6497318,13.464 76.7063367,13.198716 75.4260147,13.198716 Z M156.04587,13.198716 C155.331585,13.198716 154.624038,13.2692346 153.92323,13.4102716 C153.222423,13.5513086 152.629431,13.7494321 152.144257,14.004642 L152.144257,15.4150123 C153.37067,14.9986173 154.556653,14.7904198 155.702204,14.7904198 C156.497352,14.7904198 157.060019,14.9381728 157.390208,15.233679 C157.720396,15.5291852 157.88549,16.0396049 157.88549,16.7649383 L157.88549,18.094716 C156.969049,17.8663704 156.119993,17.7521975 155.338323,17.7521975 C154.152341,17.7521975 153.208946,18.0443457 152.508138,18.628642 C151.80733,19.2129383 151.456926,19.995358 151.456926,20.9759012 C151.456926,21.889284 151.743314,22.6179753 152.316089,23.1619753 C152.888865,23.7059753 153.653689,23.9779753 154.610561,23.9779753 C155.190075,23.9779753 155.772959,23.8638025 156.359212,23.6354568 C156.945464,23.4071111 157.481178,23.0847407 157.966353,22.6683457 L158.128077,23.7160494 L159.785758,23.7160494 L159.785758,16.4224198 C159.785758,15.3344198 159.482523,14.5251358 158.876055,13.9945679 C158.269587,13.464 157.326192,13.198716 156.04587,13.198716 Z M147.252079,13.2793086 C145.661784,13.2793086 144.432001,13.7460741 143.56273,14.6796049 C142.693459,15.6131358 142.258823,16.9328395 142.258823,18.638716 C142.258823,20.3580247 142.679982,21.6710123 143.522299,22.577679 C144.364616,23.4843457 145.580922,23.937679 147.171217,23.937679 C148.195474,23.937679 149.098438,23.7361975 149.880108,23.3332346 L149.880108,21.902716 C149.017576,22.171358 148.222428,22.305679 147.494666,22.305679 C146.403023,22.305679 145.604507,22.0202469 145.099116,21.4493827 C144.593726,20.8785185 144.341031,19.9819259 144.341031,18.7596049 L144.341031,18.497679 C144.341031,17.2484938 144.590357,16.3384691 145.089009,15.7676049 C145.58766,15.1967407 146.403023,14.9113086 147.535098,14.9113086 C148.276337,14.9113086 149.031053,15.0321975 149.799246,15.2739753 L149.799246,13.8434568 C149.004099,13.467358 148.155043,13.2793086 147.252079,13.2793086 Z M165.405697,10.6399012 L163.768233,10.6399012 L163.464999,13.5412346 L161.544516,13.7830123 L161.544516,15.0724938 L163.404352,15.0724938 L163.404352,20.9960494 C163.404352,22.9034074 164.361224,23.8570864 166.274968,23.8570864 C167.110547,23.8570864 167.858525,23.7294815 168.518901,23.4742716 L168.518901,22.0437531 C167.979818,22.1780741 167.433997,22.2452346 166.881437,22.2452346 C166.342354,22.2452346 165.961627,22.1444938 165.739255,21.9430123 C165.516883,21.7415309 165.405697,21.3922963 165.405697,20.8953086 L165.405697,15.0724938 L168.438039,15.0724938 L168.438039,13.5009383 L165.405697,13.5009383 L165.405697,10.6399012 Z M65.6416591,13.198716 C64.3074288,13.198716 62.9731985,13.6755556 61.6389683,14.6292346 C61.1942248,13.6755556 60.3451692,13.198716 59.0918013,13.198716 C57.8653876,13.198716 56.6052812,13.6419753 55.3114821,14.5284938 L55.109326,13.5009383 L53.4314304,13.5009383 L53.4314304,23.7160494 L55.4327758,23.7160494 L55.4327758,15.6970864 C56.376171,15.1060741 57.3599974,14.8105679 58.384255,14.8105679 C58.936815,14.8105679 59.3411272,14.9717531 59.5971916,15.2941235 C59.853256,15.6164938 59.9812882,16.1134815 59.9812882,16.7850864 L59.9812882,23.7160494 L61.9826336,23.7160494 L61.9826336,16.0194568 C61.9826336,15.912 61.9758951,15.8112593 61.962418,15.7172346 C62.9597215,15.1127901 63.9502864,14.8105679 64.9341128,14.8105679 C65.4866728,14.8105679 65.890985,14.9717531 66.1470494,15.2941235 C66.4031138,15.6164938 66.531146,16.1134815 66.531146,16.7850864 L66.531146,23.7160494 L68.5324915,23.7160494 L68.5324915,16.2209383 C68.5324915,15.2538272 68.2831656,14.5083457 67.7845139,13.9844938 C67.2858621,13.460642 66.5715772,13.198716 65.6416591,13.198716 Z M109.2063,13.198716 C107.791207,13.198716 106.4435,13.6755556 105.163178,14.6292346 L104.961022,13.5009383 L103.283126,13.5009383 L103.283126,23.7160494 L105.284471,23.7160494 L105.284471,15.8381235 C106.308729,15.1530864 107.353202,14.8105679 108.417891,14.8105679 C109.037836,14.8105679 109.492688,14.9784691 109.782445,15.3142716 C110.072202,15.6500741 110.21708,16.1739259 110.21708,16.8858272 L110.21708,23.7160494 L112.218426,23.7160494 L112.218426,16.2209383 C112.218426,15.2403951 111.962361,14.4915556 111.450233,13.9744198 C110.938104,13.457284 110.190126,13.198716 109.2063,13.198716 Z M89.475864,13.5009383 L81.5715603,13.5009383 L81.5715603,15.0724938 L87.2521468,15.0724938 L81.3694042,22.1847901 L81.3694042,23.7160494 L89.5365108,23.7160494 L89.5365108,22.1444938 L83.5122589,22.1444938 L89.475864,15.0120494 L89.475864,13.5009383 Z M193.30324,13.198716 C191.888147,13.198716 190.54044,13.6755556 189.260118,14.6292346 L189.057962,13.5009383 L187.380066,13.5009383 L187.380066,23.7160494 L189.381411,23.7160494 L189.381411,15.8381235 C190.405669,15.1530864 191.450142,14.8105679 192.514831,14.8105679 C193.134776,14.8105679 193.589628,14.9784691 193.879385,15.3142716 C194.169142,15.6500741 194.31402,16.1739259 194.31402,16.8858272 L194.31402,23.7160494 L196.315366,23.7160494 L196.315366,16.2209383 C196.315366,15.2403951 196.059301,14.4915556 195.547173,13.9744198 C195.035044,13.457284 194.287066,13.198716 193.30324,13.198716 Z M172.582239,13.5009383 L170.580894,13.5009383 L170.580894,23.7160494 L172.582239,23.7160494 L172.582239,13.5009383 Z M122.730543,9.75338272 L120.668551,9.75338272 L120.668551,23.7160494 L129.341048,23.7160494 L129.341048,22.0236049 L122.730543,22.0236049 L122.730543,9.75338272 Z M46.5581228,9.75338272 L44.3344056,9.75338272 L39.1592093,23.7160494 L41.2818484,23.7160494 L42.5352163,20.0087901 L48.2966653,20.0087901 L49.5904644,23.7160494 L51.7333191,23.7160494 L46.5581228,9.75338272 Z M155.742635,19.1222716 C156.470397,19.1222716 157.184682,19.2095802 157.88549,19.3841975 L157.88549,21.4393086 C156.942095,22.1243457 156.012177,22.4668642 155.095736,22.4668642 C154.57013,22.4668642 154.165818,22.3291852 153.882799,22.0538272 C153.599781,21.7784691 153.458271,21.3855802 153.458271,20.8751605 C153.458271,19.7065679 154.219726,19.1222716 155.742635,19.1222716 Z M75.1227805,19.1222716 C75.8505425,19.1222716 76.5648274,19.2095802 77.2656352,19.3841975 L77.2656352,21.4393086 C76.3222401,22.1243457 75.392322,22.4668642 74.475881,22.4668642 C73.9502751,22.4668642 73.5459629,22.3291852 73.2629443,22.0538272 C72.9799258,21.7784691 72.8384165,21.3855802 72.8384165,20.8751605 C72.8384165,19.7065679 73.5998712,19.1222716 75.1227805,19.1222716 Z M180.021584,14.8105679 C181.921851,14.8105679 182.871985,16.0731852 182.871985,18.5984198 C182.871985,21.1370864 181.921851,22.4064198 180.021584,22.4064198 C178.121316,22.4064198 177.171183,21.1370864 177.171183,18.5984198 C177.171183,16.0731852 178.121316,14.8105679 180.021584,14.8105679 Z M135.425947,14.8105679 C137.326214,14.8105679 138.276348,16.0731852 138.276348,18.5984198 C138.276348,21.1370864 137.326214,22.4064198 135.425947,22.4064198 C133.525679,22.4064198 132.575546,21.1370864 132.575546,18.5984198 C132.575546,16.0731852 133.525679,14.8105679 135.425947,14.8105679 Z M95.9246438,14.8105679 C97.8249112,14.8105679 98.7750448,16.0731852 98.7750448,18.5984198 C98.7750448,21.1370864 97.8249112,22.4064198 95.9246438,22.4064198 C94.0243764,22.4064198 93.0742427,21.1370864 93.0742427,18.5984198 C93.0742427,16.0731852 94.0243764,14.8105679 95.9246438,14.8105679 Z M95.9246438,16.4895802 C95.0772727,16.4895802 94.7588769,16.9126914 94.7588769,18.5984198 C94.7588769,20.2987589 95.079733,20.7274074 95.9246438,20.7274074 C96.7695545,20.7274074 97.0904106,20.2987589 97.0904106,18.5984198 C97.0904106,16.9126914 96.7720148,16.4895802 95.9246438,16.4895802 Z M180.021584,16.4895802 C179.174213,16.4895802 178.855817,16.9126914 178.855817,18.5984198 C178.855817,20.2987589 179.176673,20.7274074 180.021584,20.7274074 C180.866494,20.7274074 181.187351,20.2987589 181.187351,18.5984198 C181.187351,16.9126914 180.868955,16.4895802 180.021584,16.4895802 Z M135.425947,16.4895802 C134.578576,16.4895802 134.26018,16.9126914 134.26018,18.5984198 C134.26018,20.2987589 134.581036,20.7274074 135.425947,20.7274074 C136.270858,20.7274074 136.591714,20.2987589 136.591714,18.5984198 C136.591714,16.9126914 136.273318,16.4895802 135.425947,16.4895802 Z M147.535098,16.590321 C146.848754,16.590321 146.496141,16.7137592 146.359599,16.8700746 C146.171131,17.0858357 146.025665,17.6167773 146.025665,18.497679 L146.025665,18.7596049 C146.025665,19.6094033 146.1699,20.1211644 146.362319,20.3385118 C146.510674,20.5060859 146.848007,20.6266667 147.494666,20.6266667 C148.041763,20.6266667 148.669901,20.5205579 149.377624,20.3001324 L149.836308,20.1565432 L149.877326,19.9168291 C150.063579,19.0142787 150.496271,18.2203753 151.165282,17.5755596 L151.25477,17.4919506 L150.457938,17.2417778 L149.29195,16.8750524 C148.806026,16.7221149 148.335019,16.6316493 147.876594,16.6015806 L147.535098,16.590321 Z M168.896259,16.7498272 L167.090331,16.7498272 L167.090331,20.5561481 L167.29417,20.5494439 C167.431154,20.538252 167.567584,20.5214545 167.703571,20.4990322 L168.110317,20.4148719 L168.896259,20.2186667 L168.896259,16.7498272 Z M89.3815245,17.7471605 L87.1089529,20.4654815 L89.5179798,20.4654815 L89.4862767,20.3024176 C89.4167997,19.8995899 89.3736629,19.479045 89.3564369,19.0415442 L89.3478318,18.5984198 C89.3478318,18.4383295 89.3511566,18.2803538 89.3578251,18.1245282 L89.3815245,17.7471605 Z M83.6790377,16.7515062 L80.8505368,16.7515062 L80.8505368,20.1699753 L83.6790377,16.7515062 Z M45.405833,11.6070123 L47.7710594,18.4573827 L43.0608222,18.4573827 L45.405833,11.6070123 Z M171.591674,9.26982716 C171.200839,9.26982716 170.894236,9.38064198 170.671864,9.6022716 C170.449492,9.82390123 170.338306,10.1160494 170.338306,10.478716 C170.338306,10.8413827 170.449492,11.1335309 170.671864,11.3551605 C170.894236,11.5767901 171.200839,11.6876049 171.591674,11.6876049 C171.982509,11.6876049 172.289113,11.5767901 172.511484,11.3551605 C172.733856,11.1335309 172.845042,10.8413827 172.845042,10.478716 C172.845042,10.1160494 172.733856,9.82390123 172.511484,9.6022716 C172.289113,9.38064198 171.982509,9.26982716 171.591674,9.26982716 Z M159.859881,12.6295309 L159.859881,12.3027439 L161.333397,12.1172367 L161.926928,12.0401975 L162.092665,10.4659453 L162.249966,8.96088889 L167.090331,8.96088889 L167.090331,11.8202469 L168.958591,11.8202469 L168.860119,11.6009048 C168.756821,11.3397253 168.692344,11.0616059 168.666561,10.7719784 L168.653672,10.478716 C168.653672,9.68752657 168.928538,8.96529735 169.480648,8.41503059 C170.04005,7.85749526 170.777904,7.59081481 171.591674,7.59081481 C172.405445,7.59081481 173.143298,7.85749526 173.702701,8.41503059 C174.25481,8.96529735 174.529676,9.68752657 174.529676,10.478716 C174.529676,10.8743108 174.46096,11.2526655 174.323229,11.6009048 L174.221388,11.8219259 L174.266873,11.8219259 L174.266873,14.8122469 L174.461083,14.4656208 C174.597849,14.2371309 174.748669,14.0185207 174.913694,13.8100747 L175.171903,13.5050644 C176.371208,12.1790254 178.02969,11.5197037 180.021584,11.5197037 C182.013477,11.5197037 183.671959,12.1790254 184.871264,13.5050644 C185.140165,13.8023805 185.376935,14.1228859 185.582084,14.4656208 L185.695432,14.6712099 L185.695432,11.8219259 L190.468417,11.8219259 L190.506747,12.0351605 L190.691666,11.9655473 C191.394731,11.7191585 192.117649,11.5738041 192.857396,11.5321968 L193.30324,11.5197037 C194.706567,11.5197037 195.88753,11.9279499 196.746149,12.7949637 C197.598784,13.6559353 198,14.8292574 198,16.2209383 L198,25.3950617 L192.629386,25.3950617 L192.629386,16.8858272 C192.629386,16.7128362 192.619293,16.5898453 192.610838,16.5120009 L192.605801,16.4862222 L192.514831,16.4895802 C192.067113,16.4895802 191.617308,16.5820287 191.15818,16.7749171 L191.066046,16.8153086 L191.066046,25.3950617 L185.695432,25.3950617 L185.695432,22.5474568 L185.537931,22.8231587 C185.408107,23.0338269 185.26613,23.2358313 185.111874,23.4289462 L184.871264,23.7119232 C183.671959,25.0379623 182.013477,25.697284 180.021584,25.697284 C178.02969,25.697284 176.371208,25.0379623 175.171903,23.7119232 C174.838768,23.3435851 174.555006,22.939238 174.319598,22.5006867 L174.266873,22.3980247 L174.266873,25.3950617 L168.896259,25.3950617 L168.896259,25.1197037 L168.688742,25.19235 C168.093214,25.3769631 167.458181,25.4861944 166.786017,25.5225025 L166.274968,25.5360988 C163.430826,25.5360988 161.719718,23.8307003 161.719718,20.9960494 L161.719718,16.7498272 L161.468707,16.7498272 L161.470392,25.3950617 L156.682798,25.3950617 L156.669184,25.3060741 L156.582556,25.3383735 C156.061471,25.5072763 155.535485,25.6098477 155.007182,25.6441201 L154.610561,25.6569877 C153.365883,25.6569877 152.274679,25.3091559 151.407332,24.6008052 L151.288463,24.4951111 L150.654068,24.824563 C149.75193,25.289629 148.744897,25.5473028 147.647178,25.6044546 L147.171217,25.6166914 C145.139986,25.6166914 143.472265,24.9951095 142.28618,23.7184135 C141.954589,23.3614899 141.672724,22.9662105 141.439239,22.5343847 L141.273312,22.2066173 L141.127933,22.5006867 C140.951377,22.8296002 140.747621,23.1392738 140.516237,23.4289462 L140.275628,23.7119232 C139.076322,25.0379623 137.417841,25.697284 135.425947,25.697284 C133.718609,25.697284 132.256227,25.2128844 131.118,24.2394278 L131.025682,24.1559506 L131.025682,25.3950617 L118.983917,25.3950617 L118.983917,8.07437037 L124.415178,8.07437037 L124.415178,20.3429136 L128.995698,20.3429136 L128.98758,20.3024176 C128.918103,19.8995899 128.874966,19.479045 128.85774,19.0415442 L128.849135,18.5984198 C128.849135,16.5172462 129.41103,14.7934342 130.576266,13.5050644 C131.775571,12.1790254 133.434053,11.5197037 135.425947,11.5197037 C137.417841,11.5197037 139.076322,12.1790254 140.275628,13.5050644 C140.634162,13.9014859 140.935575,14.3391327 141.181074,14.8157302 L141.296897,15.0607407 L141.462158,14.7376201 C141.64145,14.4106479 141.848401,14.1035153 142.083468,13.8170307 L142.327925,13.5374588 C143.537646,12.2383105 145.218617,11.6002963 147.252079,11.6002963 C148.403251,11.6002963 149.499143,11.8430152 150.521523,12.3265937 L151.153692,12.6261728 L151.357939,12.5197491 C151.868556,12.2511562 152.446729,12.0383852 153.092649,11.8764621 L153.589794,11.764476 C154.400337,11.6013547 155.219581,11.5197037 156.04587,11.5197037 C157.561263,11.5197037 158.804265,11.8337264 159.739868,12.5325415 L159.859881,12.6295309 Z"}),gt.jsx("path",{fill:"#232F3E",d:"M18.7277903,7.06660317 C18.6844725,7.1648254 18.6709357,7.27330159 18.6893458,7.37907937 L19.1474309,9.98412698 L14.9889278,9.98412698 L15.4248126,7.3747619 C15.4426811,7.27006349 15.4286029,7.16320635 15.3858266,7.06660317 L13.5583594,2.96825397 L20.5552575,2.96825397 L18.7277903,7.06660317 Z M21.8428773,2.13444444 C21.742705,1.98171429 21.5721414,1.88888889 21.3885825,1.88888889 L12.7250344,1.88888889 C12.5414755,1.88888889 12.3709118,1.98171429 12.2707396,2.13444444 C12.1711088,2.28771429 12.1554061,2.48092063 12.2301292,2.64768254 L14.3299567,7.35695238 L13.8155585,10.4353016 C13.7890264,10.5918095 13.8334271,10.7515556 13.9363067,10.8729841 C14.0391863,10.993873 14.190257,11.0634921 14.3494496,11.0634921 L16.5153367,11.0634921 L16.5153367,16.4603175 L17.5982802,16.4603175 L17.5982802,11.0634921 L19.7923238,11.0634921 C19.9525994,11.0634921 20.1042115,10.9927937 20.2065496,10.8708254 C20.3099708,10.7488571 20.3532885,10.5874921 20.3256734,10.4304444 L19.7847431,7.35479365 L21.8834877,2.64768254 C21.9582108,2.48092063 21.9425081,2.28771429 21.8428773,2.13444444 L21.8428773,2.13444444 Z M26.1806075,21.7384127 L24.8594165,22.3698413 L17.0568084,26.1152381 L9.25420041,22.3698413 L7.93300932,21.7384127 L3.76909152,19.7415873 L7.90593574,18.0631746 L16.8239756,22.3428571 C16.8943669,22.3806349 16.9755877,22.3968254 17.0568084,22.3968254 C17.1380292,22.3968254 17.21925,22.3806349 17.2896413,22.3428571 L26.2076811,18.0631746 L30.3445254,19.7415873 L26.1806075,21.7384127 Z M30.3445254,24.5987302 L17.0568084,30.972381 L3.76909152,24.5987302 L7.90593574,22.9203175 L16.8239756,27.2 C16.8943669,27.2377778 16.9755877,27.2539683 17.0568084,27.2539683 C17.1380292,27.2539683 17.21925,27.2377778 17.2896413,27.2 L26.2076811,22.9203175 L30.3445254,24.5987302 Z M32.2183606,19.6822222 C32.2126029,19.4663492 32.077235,19.2774603 31.8823052,19.1965079 L27.5288722,17.4263492 L31.9093787,15.3269841 C32.1043086,15.2352381 32.2234324,15.0355556 32.2183606,14.8250794 C32.2126029,14.6092063 32.077235,14.4203175 31.8823052,14.3393651 L21.3615089,10.0704762 L21.3939972,10.2431746 C21.4481444,10.572381 21.3994119,10.9015873 21.264044,11.1930159 L30.3445254,14.8844444 L26.1806075,16.8812698 L24.8594165,17.5126984 L17.0568084,21.2580952 L9.25420041,17.5126984 L7.93300932,16.8812698 L3.76909152,14.8844444 L12.8766465,11.187619 C12.7466932,10.8961905 12.6925461,10.5777778 12.7466932,10.2593651 L12.7791816,10.0596825 L2.23131173,14.3393651 C2.0363819,14.4203175 1.90101396,14.6092063 1.89525627,14.8250794 C1.89018452,15.0355556 2.00930831,15.2352381 2.20423814,15.3269841 L6.58474465,17.4263492 L2.23131173,19.1965079 C2.0363819,19.2774603 1.90101396,19.4663492 1.89525627,19.6822222 C1.89018452,19.8926984 2.00930831,20.092381 2.20423814,20.184127 L6.58474465,22.2834921 L2.23131173,24.0536508 C2.0363819,24.1346032 1.90101396,24.3234921 1.89525627,24.5393651 C1.89018452,24.7498413 2.00930831,24.9495238 2.20423814,25.0412698 L16.8239756,32.0571429 C16.8943669,32.0949206 16.9755877,32.1111111 17.0568084,32.1111111 C17.1380292,32.1111111 17.21925,32.0949206 17.2896413,32.0571429 L31.9093787,25.0412698 C32.1043086,24.9495238 32.2234324,24.7498413 32.2183606,24.5393651 C32.2126029,24.3234921 32.077235,24.1346032 31.8823052,24.0536508 L27.5288722,22.2834921 L31.9093787,20.184127 C32.1043086,20.092381 32.2234324,19.8926984 32.2183606,19.6822222 L32.2183606,19.6822222 Z"}),gt.jsx("path",{fill:"#FFF",d:"M21.3885825,0 C22.21275,0 22.9794826,0.41521042 23.4292278,1.10092555 C23.8815068,1.79667269 23.9508181,2.66617834 23.6153978,3.41473846 L21.7501994,7.59585185 L21.8647545,8.24898765 L21.894644,8.25732125 L22.0761281,8.32101243 L32.6112538,12.5957838 C33.4931142,12.9620115 34.087228,13.8121837 34.1130278,14.7797286 C34.1360376,15.734629 33.5939281,16.6230479 32.7306851,17.0292919 L32.1983007,17.2837531 L32.6112538,17.4529267 C33.4196258,17.7886354 33.9862108,18.5309919 34.0948056,19.3939122 L34.1129048,19.6320284 C34.1360376,20.5917718 33.5939281,21.4801907 32.7306851,21.8864347 L32.1983007,22.1411358 L32.6112538,22.3100695 C33.4196258,22.6457782 33.9862108,23.3881348 34.0949003,24.2547855 L34.1130278,24.4940143 C34.1360376,25.4489147 33.5939281,26.3373336 32.7315739,26.7431513 L18.1881846,33.7202426 C17.8281291,33.913478 17.4408282,34 17.0568084,34 C16.6727887,34 16.2854877,33.913478 16.0017804,33.7590244 L1.39494826,26.7492848 C0.519688805,26.3373336 -0.0224206916,25.4489147 0.00071203729,24.4891712 C0.0263888781,23.5264694 0.620502707,22.6762972 1.51540152,22.3047114 L1.91700076,22.1411358 L1.39494826,21.892142 C0.592627093,21.51452 0.0702444326,20.7365329 0.00657042212,19.8702438 L0.00071203729,19.6320283 C0.0263888781,18.6693265 0.620502707,17.8191543 1.51540152,17.4475686 L1.91700076,17.2837531 L1.39494826,17.0349991 C0.592627093,16.6573772 0.0702444326,15.87939 0.00657042212,15.013101 L0.00071203729,14.7748854 C0.0263888781,13.8121837 0.620502707,12.9620115 1.51672004,12.5898902 L12.0645899,8.31020764 C12.1241491,8.28604212 12.1838641,8.26510601 12.2435893,8.24728374 L12.2606548,8.24059259 L12.3667868,7.60424691 L10.4996402,3.41791787 C10.2002256,2.74970496 10.2217218,1.98844227 10.5478452,1.33887687 L10.6843891,1.10092555 C11.1341342,0.41521042 11.9008669,0 12.7250344,0 L21.3885825,0 Z M12.7791816,10.0596825 L2.23131173,14.3393651 C2.0363819,14.4203175 1.90101396,14.6092063 1.89510052,14.8250794 C1.89018452,15.0355556 2.00930831,15.2352381 2.20423814,15.3269841 L6.58474465,17.4263492 L2.23131173,19.1965079 C2.0363819,19.2774603 1.90101396,19.4663492 1.89510052,19.6822222 C1.89018452,19.8926984 2.00930831,20.092381 2.20423814,20.184127 L6.58474465,22.2834921 L2.23131173,24.0536508 C2.0363819,24.1346032 1.90101396,24.3234921 1.89510052,24.5393651 C1.89018452,24.7498413 2.00930831,24.9495238 2.20423814,25.0412698 L16.8239756,32.0571429 C16.8943669,32.0949206 16.9755877,32.1111111 17.0568084,32.1111111 C17.1380292,32.1111111 17.21925,32.0949206 17.2896413,32.0571429 L31.9093787,25.0412698 C32.1043086,24.9495238 32.2234324,24.7498413 32.2185164,24.5393651 C32.2126029,24.3234921 32.077235,24.1346032 31.8823052,24.0536508 L27.5288722,22.2834921 L31.9093787,20.184127 C32.1043086,20.092381 32.2234324,19.8926984 32.2185164,19.6822222 C32.2126029,19.4663492 32.077235,19.2774603 31.8823052,19.1965079 L27.5288722,17.4263492 L31.9093787,15.3269841 C32.1043086,15.2352381 32.2234324,15.0355556 32.2185164,14.8250794 C32.2126029,14.6092063 32.077235,14.4203175 31.8823052,14.3393651 L21.3615089,10.0704762 L21.3939972,10.2431746 C21.4481444,10.572381 21.3994119,10.9015873 21.264044,11.1930159 L30.3445254,14.8844444 L26.1806075,16.8812698 L24.8594165,17.5126984 L17.0568084,21.2580952 L9.25420041,17.5126984 L7.93300932,16.8812698 L3.76909152,14.8844444 L12.8766465,11.187619 C12.7466932,10.8961905 12.6925461,10.5777778 12.7466932,10.2593651 L12.7791816,10.0596825 Z M26.2076811,22.9203175 L30.3445254,24.5987302 L17.0568084,30.972381 L3.76909152,24.5987302 L7.90593574,22.9203175 L16.8239756,27.2 C16.8943669,27.2377778 16.9755877,27.2539683 17.0568084,27.2539683 C17.1380292,27.2539683 17.21925,27.2377778 17.2896413,27.2 L26.2076811,22.9203175 Z M26.2076811,18.0631746 L30.3445254,19.7415873 L26.1806075,21.7384127 L24.8594165,22.3698413 L17.0568084,26.1152381 L9.25420041,22.3698413 L7.93300932,21.7384127 L3.76909152,19.7415873 L7.90593574,18.0631746 L16.8239756,22.3428571 C16.8943669,22.3806349 16.9755877,22.3968254 17.0568084,22.3968254 C17.1380292,22.3968254 17.21925,22.3806349 17.2896413,22.3428571 L26.2076811,18.0631746 Z M13.7313405,12.8696296 L13.5914927,12.9369906 L8.43990444,15.0271605 L8.75246586,15.1780768 L10.0765737,15.8109024 L17.0551238,19.1608889 L24.0399599,15.8095054 L25.3588798,15.1791641 L25.6753971,15.0254815 L20.5482677,12.9420097 L20.4008073,12.8713086 L20.2656497,12.9061426 C20.1883527,12.921399 20.1100917,12.9329586 20.0311197,12.9407041 L19.7923238,12.952381 L19.4927895,12.9519012 L19.4934937,16.4603175 C19.4934937,17.433975 18.754342,18.2355706 17.8047846,18.3381226 L17.5982802,18.3492063 L16.5153367,18.3492063 C15.4686392,18.3492063 14.6201232,17.503522 14.6201232,16.4603175 L14.6191427,12.9519012 L14.3494496,12.952381 C14.1705398,12.952381 13.9938762,12.9327953 13.8222391,12.894864 L13.7313405,12.8696296 Z M21.3885825,1.88888889 L12.7250344,1.88888889 C12.5414755,1.88888889 12.3709118,1.98171429 12.2707396,2.13444444 C12.1711088,2.28771429 12.1554061,2.48092063 12.2301292,2.64768254 L14.3299567,7.35695238 L13.8155585,10.4353016 C13.7890264,10.5918095 13.8334271,10.7515556 13.9363067,10.8729841 C14.0391863,10.993873 14.190257,11.0634921 14.3494496,11.0634921 L16.5153367,11.0634921 L16.5153367,16.4603175 L17.5982802,16.4603175 L17.5982802,11.0634921 L19.7923238,11.0634921 C19.9525994,11.0634921 20.1042115,10.9927937 20.2065496,10.8708254 C20.3099708,10.7488571 20.3532885,10.5874921 20.3256734,10.4304444 L19.7847431,7.35479365 L21.8834877,2.64768254 C21.9582108,2.48092063 21.9425081,2.28771429 21.8428773,2.13444444 C21.742705,1.98171429 21.5721414,1.88888889 21.3885825,1.88888889 Z M20.5552575,2.96825397 L18.7277903,7.06660317 C18.6844725,7.1648254 18.6709357,7.27330159 18.6893458,7.37907937 L19.1474309,9.98412698 L14.9889278,9.98412698 L15.4248126,7.3747619 C15.4426811,7.27006349 15.4286029,7.16320635 15.3858266,7.06660317 L13.5583594,2.96825397 L20.5552575,2.96825397 Z M17.6380072,4.8557037 L16.473925,4.8557037 L17.0551238,6.1602963 L17.6380072,4.8557037 Z"})]})}):gt.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"133",height:"23",viewBox:"0 0 198 34",children:gt.jsxs("g",{fill:"none",children:[gt.jsx("path",{fill:"#FFF",d:"M49.5904644,23.7160494 L48.2966653,20.0087901 L42.5352163,20.0087901 L41.2818484,23.7160494 L39.1592093,23.7160494 L44.3344056,9.75338272 L46.5581228,9.75338272 L51.7333191,23.7160494 L49.5904644,23.7160494 Z M43.0608222,18.4573827 L47.7710594,18.4573827 L45.405833,11.6070123 L43.0608222,18.4573827 Z M66.531146,23.7160494 L66.531146,16.7850864 C66.531146,16.1134815 66.4031138,15.6164938 66.1470494,15.2941235 C65.890985,14.9717531 65.4866728,14.8105679 64.9341128,14.8105679 C63.9502864,14.8105679 62.9597215,15.1127901 61.962418,15.7172346 C61.9758951,15.8112593 61.9826336,15.912 61.9826336,16.0194568 C61.9826336,16.1269136 61.9826336,16.2343704 61.9826336,16.3418272 L61.9826336,23.7160494 L59.9812882,23.7160494 L59.9812882,16.7850864 C59.9812882,16.1134815 59.853256,15.6164938 59.5971916,15.2941235 C59.3411272,14.9717531 58.936815,14.8105679 58.384255,14.8105679 C57.3599974,14.8105679 56.376171,15.1060741 55.4327758,15.6970864 L55.4327758,23.7160494 L53.4314304,23.7160494 L53.4314304,13.5009383 L55.109326,13.5009383 L55.3114821,14.5284938 C56.6052812,13.6419753 57.8653876,13.198716 59.0918013,13.198716 C60.3451692,13.198716 61.1942248,13.6755556 61.6389683,14.6292346 C62.9731985,13.6755556 64.3074288,13.198716 65.6416591,13.198716 C66.5715772,13.198716 67.2858621,13.460642 67.7845139,13.9844938 C68.2831656,14.5083457 68.5324915,15.2538272 68.5324915,16.2209383 L68.5324915,23.7160494 L66.531146,23.7160494 Z M77.5082225,23.7160494 L77.3464977,22.6683457 C76.861323,23.0847407 76.3256093,23.4071111 75.7393566,23.6354568 C75.1531039,23.8638025 74.5702205,23.9779753 73.9907063,23.9779753 C73.0338341,23.9779753 72.2690101,23.7059753 71.6962345,23.1619753 C71.1234589,22.6179753 70.8370711,21.889284 70.8370711,20.9759012 C70.8370711,19.995358 71.187475,19.2129383 71.8882828,18.628642 C72.5890906,18.0443457 73.5324858,17.7521975 74.7184683,17.7521975 C75.5001386,17.7521975 76.3491942,17.8663704 77.2656352,18.094716 L77.2656352,16.7649383 C77.2656352,16.0396049 77.1005411,15.5291852 76.7703528,15.233679 C76.4401644,14.9381728 75.8774966,14.7904198 75.0823493,14.7904198 C73.936798,14.7904198 72.7508155,14.9986173 71.5244018,15.4150123 L71.5244018,14.004642 C72.0095765,13.7494321 72.6025677,13.5513086 73.3033755,13.4102716 C74.0041834,13.2692346 74.7117297,13.198716 75.4260147,13.198716 C76.7063367,13.198716 77.6497318,13.464 78.2562001,13.9945679 C78.8626684,14.5251358 79.1659026,15.3344198 79.1659026,16.4224198 L79.1659026,23.7160494 L77.5082225,23.7160494 Z M74.475881,22.4668642 C75.392322,22.4668642 76.3222401,22.1243457 77.2656352,21.4393086 L77.2656352,19.3841975 C76.5648274,19.2095802 75.8505425,19.1222716 75.1227805,19.1222716 C73.5998712,19.1222716 72.8384165,19.7065679 72.8384165,20.8751605 C72.8384165,21.3855802 72.9799258,21.7784691 73.2629443,22.0538272 C73.5459629,22.3291852 73.9502751,22.4668642 74.475881,22.4668642 Z M81.3694042,23.7160494 L81.3694042,22.1847901 L87.2521468,15.0724938 L81.5715603,15.0724938 L81.5715603,13.5009383 L89.475864,13.5009383 L89.475864,15.0120494 L83.5122589,22.1444938 L89.5365108,22.1444938 L89.5365108,23.7160494 L81.3694042,23.7160494 Z M95.9246438,24.0182716 C94.3882574,24.0182716 93.1887978,23.5414321 92.3262651,22.5877531 C91.4637324,21.6340741 91.032466,20.3042963 91.032466,18.5984198 C91.032466,16.9059753 91.4637324,15.5829136 92.3262651,14.6292346 C93.1887978,13.6755556 94.3882574,13.198716 95.9246438,13.198716 C97.4610302,13.198716 98.6604897,13.6755556 99.5230224,14.6292346 C100.385555,15.5829136 100.816822,16.9059753 100.816822,18.5984198 C100.816822,20.3042963 100.385555,21.6340741 99.5230224,22.5877531 C98.6604897,23.5414321 97.4610302,24.0182716 95.9246438,24.0182716 Z M95.9246438,22.4064198 C97.8249112,22.4064198 98.7750448,21.1370864 98.7750448,18.5984198 C98.7750448,16.0731852 97.8249112,14.8105679 95.9246438,14.8105679 C94.0243764,14.8105679 93.0742427,16.0731852 93.0742427,18.5984198 C93.0742427,21.1370864 94.0243764,22.4064198 95.9246438,22.4064198 Z M110.21708,23.7160494 L110.21708,16.8858272 C110.21708,16.1739259 110.072202,15.6500741 109.782445,15.3142716 C109.492688,14.9784691 109.037836,14.8105679 108.417891,14.8105679 C107.353202,14.8105679 106.308729,15.1530864 105.284471,15.8381235 L105.284471,23.7160494 L103.283126,23.7160494 L103.283126,13.5009383 L104.961022,13.5009383 L105.163178,14.6292346 C106.4435,13.6755556 107.791207,13.198716 109.2063,13.198716 C110.190126,13.198716 110.938104,13.457284 111.450233,13.9744198 C111.962361,14.4915556 112.218426,15.2403951 112.218426,16.2209383 L112.218426,23.7160494 L110.21708,23.7160494 Z M120.668551,23.7160494 L120.668551,9.75338272 L122.730543,9.75338272 L122.730543,22.0236049 L129.341048,22.0236049 L129.341048,23.7160494 L120.668551,23.7160494 Z M135.425947,24.0182716 C133.88956,24.0182716 132.690101,23.5414321 131.827568,22.5877531 C130.965035,21.6340741 130.533769,20.3042963 130.533769,18.5984198 C130.533769,16.9059753 130.965035,15.5829136 131.827568,14.6292346 C132.690101,13.6755556 133.88956,13.198716 135.425947,13.198716 C136.962333,13.198716 138.161793,13.6755556 139.024325,14.6292346 C139.886858,15.5829136 140.318125,16.9059753 140.318125,18.5984198 C140.318125,20.3042963 139.886858,21.6340741 139.024325,22.5877531 C138.161793,23.5414321 136.962333,24.0182716 135.425947,24.0182716 Z M135.425947,22.4064198 C137.326214,22.4064198 138.276348,21.1370864 138.276348,18.5984198 C138.276348,16.0731852 137.326214,14.8105679 135.425947,14.8105679 C133.525679,14.8105679 132.575546,16.0731852 132.575546,18.5984198 C132.575546,21.1370864 133.525679,22.4064198 135.425947,22.4064198 Z M149.880108,23.3332346 C149.098438,23.7361975 148.195474,23.937679 147.171217,23.937679 C145.580922,23.937679 144.364616,23.4843457 143.522299,22.577679 C142.679982,21.6710123 142.258823,20.3580247 142.258823,18.638716 C142.258823,16.9328395 142.693459,15.6131358 143.56273,14.6796049 C144.432001,13.7460741 145.661784,13.2793086 147.252079,13.2793086 C148.155043,13.2793086 149.004099,13.467358 149.799246,13.8434568 L149.799246,15.2739753 C149.031053,15.0321975 148.276337,14.9113086 147.535098,14.9113086 C146.403023,14.9113086 145.58766,15.1967407 145.089009,15.7676049 C144.590357,16.3384691 144.341031,17.2484938 144.341031,18.497679 L144.341031,18.7596049 C144.341031,19.9819259 144.593726,20.8785185 145.099116,21.4493827 C145.604507,22.0202469 146.403023,22.305679 147.494666,22.305679 C148.222428,22.305679 149.017576,22.171358 149.880108,21.902716 L149.880108,23.3332346 Z M158.128077,23.7160494 L157.966353,22.6683457 C157.481178,23.0847407 156.945464,23.4071111 156.359212,23.6354568 C155.772959,23.8638025 155.190075,23.9779753 154.610561,23.9779753 C153.653689,23.9779753 152.888865,23.7059753 152.316089,23.1619753 C151.743314,22.6179753 151.456926,21.889284 151.456926,20.9759012 C151.456926,19.995358 151.80733,19.2129383 152.508138,18.628642 C153.208946,18.0443457 154.152341,17.7521975 155.338323,17.7521975 C156.119993,17.7521975 156.969049,17.8663704 157.88549,18.094716 L157.88549,16.7649383 C157.88549,16.0396049 157.720396,15.5291852 157.390208,15.233679 C157.060019,14.9381728 156.497352,14.7904198 155.702204,14.7904198 C154.556653,14.7904198 153.37067,14.9986173 152.144257,15.4150123 L152.144257,14.004642 C152.629431,13.7494321 153.222423,13.5513086 153.92323,13.4102716 C154.624038,13.2692346 155.331585,13.198716 156.04587,13.198716 C157.326192,13.198716 158.269587,13.464 158.876055,13.9945679 C159.482523,14.5251358 159.785758,15.3344198 159.785758,16.4224198 L159.785758,23.7160494 L158.128077,23.7160494 Z M155.095736,22.4668642 C156.012177,22.4668642 156.942095,22.1243457 157.88549,21.4393086 L157.88549,19.3841975 C157.184682,19.2095802 156.470397,19.1222716 155.742635,19.1222716 C154.219726,19.1222716 153.458271,19.7065679 153.458271,20.8751605 C153.458271,21.3855802 153.599781,21.7784691 153.882799,22.0538272 C154.165818,22.3291852 154.57013,22.4668642 155.095736,22.4668642 Z M168.518901,23.4742716 C167.858525,23.7294815 167.110547,23.8570864 166.274968,23.8570864 C164.361224,23.8570864 163.404352,22.9034074 163.404352,20.9960494 L163.404352,15.0724938 L161.544516,15.0724938 L161.544516,13.7830123 L163.464999,13.5412346 L163.768233,10.6399012 L165.405697,10.6399012 L165.405697,13.5009383 L168.438039,13.5009383 L168.438039,15.0724938 L165.405697,15.0724938 L165.405697,20.8953086 C165.405697,21.3922963 165.516883,21.7415309 165.739255,21.9430123 C165.961627,22.1444938 166.342354,22.2452346 166.881437,22.2452346 C167.433997,22.2452346 167.979818,22.1780741 168.518901,22.0437531 L168.518901,23.4742716 Z M170.580894,23.7160494 L170.580894,13.5009383 L172.582239,13.5009383 L172.582239,23.7160494 L170.580894,23.7160494 Z M171.591674,11.6876049 C171.200839,11.6876049 170.894236,11.5767901 170.671864,11.3551605 C170.449492,11.1335309 170.338306,10.8413827 170.338306,10.478716 C170.338306,10.1160494 170.449492,9.82390123 170.671864,9.6022716 C170.894236,9.38064198 171.200839,9.26982716 171.591674,9.26982716 C171.982509,9.26982716 172.289113,9.38064198 172.511484,9.6022716 C172.733856,9.82390123 172.845042,10.1160494 172.845042,10.478716 C172.845042,10.8413827 172.733856,11.1335309 172.511484,11.3551605 C172.289113,11.5767901 171.982509,11.6876049 171.591674,11.6876049 Z M180.021584,24.0182716 C178.485197,24.0182716 177.285738,23.5414321 176.423205,22.5877531 C175.560672,21.6340741 175.129406,20.3042963 175.129406,18.5984198 C175.129406,16.9059753 175.560672,15.5829136 176.423205,14.6292346 C177.285738,13.6755556 178.485197,13.198716 180.021584,13.198716 C181.55797,13.198716 182.75743,13.6755556 183.619962,14.6292346 C184.482495,15.5829136 184.913761,16.9059753 184.913761,18.5984198 C184.913761,20.3042963 184.482495,21.6340741 183.619962,22.5877531 C182.75743,23.5414321 181.55797,24.0182716 180.021584,24.0182716 Z M180.021584,22.4064198 C181.921851,22.4064198 182.871985,21.1370864 182.871985,18.5984198 C182.871985,16.0731852 181.921851,14.8105679 180.021584,14.8105679 C178.121316,14.8105679 177.171183,16.0731852 177.171183,18.5984198 C177.171183,21.1370864 178.121316,22.4064198 180.021584,22.4064198 Z M194.31402,23.7160494 L194.31402,16.8858272 C194.31402,16.1739259 194.169142,15.6500741 193.879385,15.3142716 C193.589628,14.9784691 193.134776,14.8105679 192.514831,14.8105679 C191.450142,14.8105679 190.405669,15.1530864 189.381411,15.8381235 L189.381411,23.7160494 L187.380066,23.7160494 L187.380066,13.5009383 L189.057962,13.5009383 L189.260118,14.6292346 C190.54044,13.6755556 191.888147,13.198716 193.30324,13.198716 C194.287066,13.198716 195.035044,13.457284 195.547173,13.9744198 C196.059301,14.4915556 196.315366,15.2403951 196.315366,16.2209383 L196.315366,23.7160494 L194.31402,23.7160494 Z"}),gt.jsx("path",{fill:"#232F3E",d:"M45.9668162,8.07437037 L47.7317091,8.07437037 L48.138381,9.1715702 L51.7451115,18.902321 L51.7467962,11.8219259 L56.4957188,11.8219259 L56.5294727,11.9965432 L56.9274515,11.8607039 C57.5024083,11.6799954 58.0794674,11.5701804 58.6578133,11.5334827 L59.0918013,11.5197037 C60.1472223,11.5197037 61.0712814,11.7793437 61.8090624,12.2879588 L62.0095878,12.4381235 L62.2838708,12.302079 C63.2440584,11.8496386 64.2230021,11.5899628 65.2154921,11.5321133 L65.6416591,11.5197037 C67.0058848,11.5197037 68.1650592,11.9447692 69.0066548,12.8288961 C69.3058071,13.1431664 69.5474563,13.4964821 69.7338656,13.8846825 L69.8397676,14.1288889 L69.8397676,12.9922785 L70.7380843,12.5197491 C71.3763553,12.184008 72.1201835,11.9354886 72.9699387,11.764476 C73.7804825,11.6013547 74.5997264,11.5197037 75.4260147,11.5197037 C77.0791717,11.5197037 78.408159,11.8934167 79.36753,12.732721 C79.5352458,12.8794469 79.688251,13.0370593 79.8267904,13.2049697 L79.886926,13.2843457 L79.886926,11.8219259 L91.1604982,11.8219259 L91.1604982,13.4153086 L91.3389394,13.2311154 C92.4225909,12.176117 93.8369968,11.6105637 95.5029584,11.5297981 L95.9246438,11.5197037 C97.9165376,11.5197037 99.5750194,12.1790254 100.774324,13.5050644 C101.043225,13.8023805 101.279995,14.1228859 101.485144,14.4656208 L101.598492,14.6712099 L101.598492,11.8219259 L106.371477,11.8219259 L106.409807,12.0351605 L106.594726,11.9655473 C107.297791,11.7191585 108.020709,11.5738041 108.760456,11.5321968 L109.2063,11.5197037 C110.609627,11.5197037 111.79059,11.9279499 112.649209,12.7949637 C113.501845,13.6559353 113.90306,14.8292574 113.90306,16.2209383 L113.90306,25.3950617 L108.532446,25.3950617 L108.532446,16.8858272 C108.532446,16.7128362 108.522353,16.5898453 108.513898,16.5120009 L108.508861,16.4862222 L108.417891,16.4895802 C107.970173,16.4895802 107.520368,16.5820287 107.06124,16.7749171 L106.969106,16.8153086 L106.969106,25.3950617 L101.598492,25.3950617 L101.598492,22.5474568 L101.440991,22.8231587 C101.311167,23.0338269 101.16919,23.2358313 101.014934,23.4289462 L100.774324,23.7119232 C99.5750194,25.0379623 97.9165376,25.697284 95.9246438,25.697284 C94.0750281,25.697284 92.5128952,25.1287872 91.3389394,23.9858723 L91.221145,23.8638025 L91.221145,25.3950617 L76.0629429,25.3950617 L76.0493293,25.3060741 L75.9627015,25.3383735 C75.4416162,25.5072763 74.9156301,25.6098477 74.3873274,25.6441201 L73.9907063,25.6569877 C72.6215606,25.6569877 71.438118,25.2361112 70.5340596,24.3774717 C70.4503124,24.2979319 70.3703736,24.2159415 70.2942429,24.1315852 L70.215441,24.0384198 L70.2171257,25.3950617 L64.8465118,25.3950617 L64.8465118,16.7850864 C64.8465118,16.7123925 64.8447019,16.6488274 64.8420661,16.5941496 L64.8347194,16.4929383 L64.6492066,16.5025907 C64.3622271,16.5286958 64.0688496,16.594337 63.7674701,16.7017848 L63.6655832,16.7414321 L63.6672678,25.3950617 L58.296654,25.3950617 L58.296654,16.7850864 C58.296654,16.7123925 58.2948441,16.6488274 58.2922083,16.5941496 L58.2848615,16.4929383 L58.0858295,16.5020492 C57.7887535,16.5270485 57.495456,16.5898228 57.2035088,16.692029 L57.1157254,16.726321 L57.11741,25.3950617 L51.7467962,25.3950617 L48.3927926,25.3950617 L47.9993327,24.2676396 L47.0972057,21.6861235 L43.7447836,21.6861235 L42.878289,24.2521853 L42.4918999,25.3950617 L36.7409871,25.3950617 L37.5789511,23.1342369 L42.7541474,9.1715702 L43.1608193,8.07437037 L44.8330573,8.07437037 L45.9668162,8.07437037 Z M180.021584,13.198716 C178.485197,13.198716 177.285738,13.6755556 176.423205,14.6292346 C175.560672,15.5829136 175.129406,16.9059753 175.129406,18.5984198 C175.129406,20.3042963 175.560672,21.6340741 176.423205,22.5877531 C177.285738,23.5414321 178.485197,24.0182716 180.021584,24.0182716 C181.55797,24.0182716 182.75743,23.5414321 183.619962,22.5877531 C184.482495,21.6340741 184.913761,20.3042963 184.913761,18.5984198 C184.913761,16.9059753 184.482495,15.5829136 183.619962,14.6292346 C182.75743,13.6755556 181.55797,13.198716 180.021584,13.198716 Z M95.9246438,13.198716 C94.3882574,13.198716 93.1887978,13.6755556 92.3262651,14.6292346 C91.4637324,15.5829136 91.032466,16.9059753 91.032466,18.5984198 C91.032466,20.3042963 91.4637324,21.6340741 92.3262651,22.5877531 C93.1887978,23.5414321 94.3882574,24.0182716 95.9246438,24.0182716 C97.4610302,24.0182716 98.6604897,23.5414321 99.5230224,22.5877531 C100.385555,21.6340741 100.816822,20.3042963 100.816822,18.5984198 C100.816822,16.9059753 100.385555,15.5829136 99.5230224,14.6292346 C98.6604897,13.6755556 97.4610302,13.198716 95.9246438,13.198716 Z M135.425947,13.198716 C133.88956,13.198716 132.690101,13.6755556 131.827568,14.6292346 C130.965035,15.5829136 130.533769,16.9059753 130.533769,18.5984198 C130.533769,20.3042963 130.965035,21.6340741 131.827568,22.5877531 C132.690101,23.5414321 133.88956,24.0182716 135.425947,24.0182716 C136.962333,24.0182716 138.161793,23.5414321 139.024325,22.5877531 C139.886858,21.6340741 140.318125,20.3042963 140.318125,18.5984198 C140.318125,16.9059753 139.886858,15.5829136 139.024325,14.6292346 C138.161793,13.6755556 136.962333,13.198716 135.425947,13.198716 Z M75.4260147,13.198716 C74.7117297,13.198716 74.0041834,13.2692346 73.3033755,13.4102716 C72.6025677,13.5513086 72.0095765,13.7494321 71.5244018,14.004642 L71.5244018,15.4150123 C72.7508155,14.9986173 73.936798,14.7904198 75.0823493,14.7904198 C75.8774966,14.7904198 76.4401644,14.9381728 76.7703528,15.233679 C77.1005411,15.5291852 77.2656352,16.0396049 77.2656352,16.7649383 L77.2656352,18.094716 C76.3491942,17.8663704 75.5001386,17.7521975 74.7184683,17.7521975 C73.5324858,17.7521975 72.5890906,18.0443457 71.8882828,18.628642 C71.187475,19.2129383 70.8370711,19.995358 70.8370711,20.9759012 C70.8370711,21.889284 71.1234589,22.6179753 71.6962345,23.1619753 C72.2690101,23.7059753 73.0338341,23.9779753 73.9907063,23.9779753 C74.5702205,23.9779753 75.1531039,23.8638025 75.7393566,23.6354568 C76.3256093,23.4071111 76.861323,23.0847407 77.3464977,22.6683457 L77.5082225,23.7160494 L79.1659026,23.7160494 L79.1659026,16.4224198 C79.1659026,15.3344198 78.8626684,14.5251358 78.2562001,13.9945679 C77.6497318,13.464 76.7063367,13.198716 75.4260147,13.198716 Z M156.04587,13.198716 C155.331585,13.198716 154.624038,13.2692346 153.92323,13.4102716 C153.222423,13.5513086 152.629431,13.7494321 152.144257,14.004642 L152.144257,15.4150123 C153.37067,14.9986173 154.556653,14.7904198 155.702204,14.7904198 C156.497352,14.7904198 157.060019,14.9381728 157.390208,15.233679 C157.720396,15.5291852 157.88549,16.0396049 157.88549,16.7649383 L157.88549,18.094716 C156.969049,17.8663704 156.119993,17.7521975 155.338323,17.7521975 C154.152341,17.7521975 153.208946,18.0443457 152.508138,18.628642 C151.80733,19.2129383 151.456926,19.995358 151.456926,20.9759012 C151.456926,21.889284 151.743314,22.6179753 152.316089,23.1619753 C152.888865,23.7059753 153.653689,23.9779753 154.610561,23.9779753 C155.190075,23.9779753 155.772959,23.8638025 156.359212,23.6354568 C156.945464,23.4071111 157.481178,23.0847407 157.966353,22.6683457 L158.128077,23.7160494 L159.785758,23.7160494 L159.785758,16.4224198 C159.785758,15.3344198 159.482523,14.5251358 158.876055,13.9945679 C158.269587,13.464 157.326192,13.198716 156.04587,13.198716 Z M147.252079,13.2793086 C145.661784,13.2793086 144.432001,13.7460741 143.56273,14.6796049 C142.693459,15.6131358 142.258823,16.9328395 142.258823,18.638716 C142.258823,20.3580247 142.679982,21.6710123 143.522299,22.577679 C144.364616,23.4843457 145.580922,23.937679 147.171217,23.937679 C148.195474,23.937679 149.098438,23.7361975 149.880108,23.3332346 L149.880108,21.902716 C149.017576,22.171358 148.222428,22.305679 147.494666,22.305679 C146.403023,22.305679 145.604507,22.0202469 145.099116,21.4493827 C144.593726,20.8785185 144.341031,19.9819259 144.341031,18.7596049 L144.341031,18.497679 C144.341031,17.2484938 144.590357,16.3384691 145.089009,15.7676049 C145.58766,15.1967407 146.403023,14.9113086 147.535098,14.9113086 C148.276337,14.9113086 149.031053,15.0321975 149.799246,15.2739753 L149.799246,13.8434568 C149.004099,13.467358 148.155043,13.2793086 147.252079,13.2793086 Z M165.405697,10.6399012 L163.768233,10.6399012 L163.464999,13.5412346 L161.544516,13.7830123 L161.544516,15.0724938 L163.404352,15.0724938 L163.404352,20.9960494 C163.404352,22.9034074 164.361224,23.8570864 166.274968,23.8570864 C167.110547,23.8570864 167.858525,23.7294815 168.518901,23.4742716 L168.518901,22.0437531 C167.979818,22.1780741 167.433997,22.2452346 166.881437,22.2452346 C166.342354,22.2452346 165.961627,22.1444938 165.739255,21.9430123 C165.516883,21.7415309 165.405697,21.3922963 165.405697,20.8953086 L165.405697,15.0724938 L168.438039,15.0724938 L168.438039,13.5009383 L165.405697,13.5009383 L165.405697,10.6399012 Z M65.6416591,13.198716 C64.3074288,13.198716 62.9731985,13.6755556 61.6389683,14.6292346 C61.1942248,13.6755556 60.3451692,13.198716 59.0918013,13.198716 C57.8653876,13.198716 56.6052812,13.6419753 55.3114821,14.5284938 L55.109326,13.5009383 L53.4314304,13.5009383 L53.4314304,23.7160494 L55.4327758,23.7160494 L55.4327758,15.6970864 C56.376171,15.1060741 57.3599974,14.8105679 58.384255,14.8105679 C58.936815,14.8105679 59.3411272,14.9717531 59.5971916,15.2941235 C59.853256,15.6164938 59.9812882,16.1134815 59.9812882,16.7850864 L59.9812882,23.7160494 L61.9826336,23.7160494 L61.9826336,16.0194568 C61.9826336,15.912 61.9758951,15.8112593 61.962418,15.7172346 C62.9597215,15.1127901 63.9502864,14.8105679 64.9341128,14.8105679 C65.4866728,14.8105679 65.890985,14.9717531 66.1470494,15.2941235 C66.4031138,15.6164938 66.531146,16.1134815 66.531146,16.7850864 L66.531146,23.7160494 L68.5324915,23.7160494 L68.5324915,16.2209383 C68.5324915,15.2538272 68.2831656,14.5083457 67.7845139,13.9844938 C67.2858621,13.460642 66.5715772,13.198716 65.6416591,13.198716 Z M109.2063,13.198716 C107.791207,13.198716 106.4435,13.6755556 105.163178,14.6292346 L104.961022,13.5009383 L103.283126,13.5009383 L103.283126,23.7160494 L105.284471,23.7160494 L105.284471,15.8381235 C106.308729,15.1530864 107.353202,14.8105679 108.417891,14.8105679 C109.037836,14.8105679 109.492688,14.9784691 109.782445,15.3142716 C110.072202,15.6500741 110.21708,16.1739259 110.21708,16.8858272 L110.21708,23.7160494 L112.218426,23.7160494 L112.218426,16.2209383 C112.218426,15.2403951 111.962361,14.4915556 111.450233,13.9744198 C110.938104,13.457284 110.190126,13.198716 109.2063,13.198716 Z M89.475864,13.5009383 L81.5715603,13.5009383 L81.5715603,15.0724938 L87.2521468,15.0724938 L81.3694042,22.1847901 L81.3694042,23.7160494 L89.5365108,23.7160494 L89.5365108,22.1444938 L83.5122589,22.1444938 L89.475864,15.0120494 L89.475864,13.5009383 Z M193.30324,13.198716 C191.888147,13.198716 190.54044,13.6755556 189.260118,14.6292346 L189.057962,13.5009383 L187.380066,13.5009383 L187.380066,23.7160494 L189.381411,23.7160494 L189.381411,15.8381235 C190.405669,15.1530864 191.450142,14.8105679 192.514831,14.8105679 C193.134776,14.8105679 193.589628,14.9784691 193.879385,15.3142716 C194.169142,15.6500741 194.31402,16.1739259 194.31402,16.8858272 L194.31402,23.7160494 L196.315366,23.7160494 L196.315366,16.2209383 C196.315366,15.2403951 196.059301,14.4915556 195.547173,13.9744198 C195.035044,13.457284 194.287066,13.198716 193.30324,13.198716 Z M172.582239,13.5009383 L170.580894,13.5009383 L170.580894,23.7160494 L172.582239,23.7160494 L172.582239,13.5009383 Z M122.730543,9.75338272 L120.668551,9.75338272 L120.668551,23.7160494 L129.341048,23.7160494 L129.341048,22.0236049 L122.730543,22.0236049 L122.730543,9.75338272 Z M46.5581228,9.75338272 L44.3344056,9.75338272 L39.1592093,23.7160494 L41.2818484,23.7160494 L42.5352163,20.0087901 L48.2966653,20.0087901 L49.5904644,23.7160494 L51.7333191,23.7160494 L46.5581228,9.75338272 Z M155.742635,19.1222716 C156.470397,19.1222716 157.184682,19.2095802 157.88549,19.3841975 L157.88549,21.4393086 C156.942095,22.1243457 156.012177,22.4668642 155.095736,22.4668642 C154.57013,22.4668642 154.165818,22.3291852 153.882799,22.0538272 C153.599781,21.7784691 153.458271,21.3855802 153.458271,20.8751605 C153.458271,19.7065679 154.219726,19.1222716 155.742635,19.1222716 Z M75.1227805,19.1222716 C75.8505425,19.1222716 76.5648274,19.2095802 77.2656352,19.3841975 L77.2656352,21.4393086 C76.3222401,22.1243457 75.392322,22.4668642 74.475881,22.4668642 C73.9502751,22.4668642 73.5459629,22.3291852 73.2629443,22.0538272 C72.9799258,21.7784691 72.8384165,21.3855802 72.8384165,20.8751605 C72.8384165,19.7065679 73.5998712,19.1222716 75.1227805,19.1222716 Z M180.021584,14.8105679 C181.921851,14.8105679 182.871985,16.0731852 182.871985,18.5984198 C182.871985,21.1370864 181.921851,22.4064198 180.021584,22.4064198 C178.121316,22.4064198 177.171183,21.1370864 177.171183,18.5984198 C177.171183,16.0731852 178.121316,14.8105679 180.021584,14.8105679 Z M135.425947,14.8105679 C137.326214,14.8105679 138.276348,16.0731852 138.276348,18.5984198 C138.276348,21.1370864 137.326214,22.4064198 135.425947,22.4064198 C133.525679,22.4064198 132.575546,21.1370864 132.575546,18.5984198 C132.575546,16.0731852 133.525679,14.8105679 135.425947,14.8105679 Z M95.9246438,14.8105679 C97.8249112,14.8105679 98.7750448,16.0731852 98.7750448,18.5984198 C98.7750448,21.1370864 97.8249112,22.4064198 95.9246438,22.4064198 C94.0243764,22.4064198 93.0742427,21.1370864 93.0742427,18.5984198 C93.0742427,16.0731852 94.0243764,14.8105679 95.9246438,14.8105679 Z M95.9246438,16.4895802 C95.0772727,16.4895802 94.7588769,16.9126914 94.7588769,18.5984198 C94.7588769,20.2987589 95.079733,20.7274074 95.9246438,20.7274074 C96.7695545,20.7274074 97.0904106,20.2987589 97.0904106,18.5984198 C97.0904106,16.9126914 96.7720148,16.4895802 95.9246438,16.4895802 Z M180.021584,16.4895802 C179.174213,16.4895802 178.855817,16.9126914 178.855817,18.5984198 C178.855817,20.2987589 179.176673,20.7274074 180.021584,20.7274074 C180.866494,20.7274074 181.187351,20.2987589 181.187351,18.5984198 C181.187351,16.9126914 180.868955,16.4895802 180.021584,16.4895802 Z M135.425947,16.4895802 C134.578576,16.4895802 134.26018,16.9126914 134.26018,18.5984198 C134.26018,20.2987589 134.581036,20.7274074 135.425947,20.7274074 C136.270858,20.7274074 136.591714,20.2987589 136.591714,18.5984198 C136.591714,16.9126914 136.273318,16.4895802 135.425947,16.4895802 Z M147.535098,16.590321 C146.848754,16.590321 146.496141,16.7137592 146.359599,16.8700746 C146.171131,17.0858357 146.025665,17.6167773 146.025665,18.497679 L146.025665,18.7596049 C146.025665,19.6094033 146.1699,20.1211644 146.362319,20.3385118 C146.510674,20.5060859 146.848007,20.6266667 147.494666,20.6266667 C148.041763,20.6266667 148.669901,20.5205579 149.377624,20.3001324 L149.836308,20.1565432 L149.877326,19.9168291 C150.063579,19.0142787 150.496271,18.2203753 151.165282,17.5755596 L151.25477,17.4919506 L150.457938,17.2417778 L149.29195,16.8750524 C148.806026,16.7221149 148.335019,16.6316493 147.876594,16.6015806 L147.535098,16.590321 Z M168.896259,16.7498272 L167.090331,16.7498272 L167.090331,20.5561481 L167.29417,20.5494439 C167.431154,20.538252 167.567584,20.5214545 167.703571,20.4990322 L168.110317,20.4148719 L168.896259,20.2186667 L168.896259,16.7498272 Z M89.3815245,17.7471605 L87.1089529,20.4654815 L89.5179798,20.4654815 L89.4862767,20.3024176 C89.4167997,19.8995899 89.3736629,19.479045 89.3564369,19.0415442 L89.3478318,18.5984198 C89.3478318,18.4383295 89.3511566,18.2803538 89.3578251,18.1245282 L89.3815245,17.7471605 Z M83.6790377,16.7515062 L80.8505368,16.7515062 L80.8505368,20.1699753 L83.6790377,16.7515062 Z M45.405833,11.6070123 L47.7710594,18.4573827 L43.0608222,18.4573827 L45.405833,11.6070123 Z M171.591674,9.26982716 C171.200839,9.26982716 170.894236,9.38064198 170.671864,9.6022716 C170.449492,9.82390123 170.338306,10.1160494 170.338306,10.478716 C170.338306,10.8413827 170.449492,11.1335309 170.671864,11.3551605 C170.894236,11.5767901 171.200839,11.6876049 171.591674,11.6876049 C171.982509,11.6876049 172.289113,11.5767901 172.511484,11.3551605 C172.733856,11.1335309 172.845042,10.8413827 172.845042,10.478716 C172.845042,10.1160494 172.733856,9.82390123 172.511484,9.6022716 C172.289113,9.38064198 171.982509,9.26982716 171.591674,9.26982716 Z M159.859881,12.6295309 L159.859881,12.3027439 L161.333397,12.1172367 L161.926928,12.0401975 L162.092665,10.4659453 L162.249966,8.96088889 L167.090331,8.96088889 L167.090331,11.8202469 L168.958591,11.8202469 L168.860119,11.6009048 C168.756821,11.3397253 168.692344,11.0616059 168.666561,10.7719784 L168.653672,10.478716 C168.653672,9.68752657 168.928538,8.96529735 169.480648,8.41503059 C170.04005,7.85749526 170.777904,7.59081481 171.591674,7.59081481 C172.405445,7.59081481 173.143298,7.85749526 173.702701,8.41503059 C174.25481,8.96529735 174.529676,9.68752657 174.529676,10.478716 C174.529676,10.8743108 174.46096,11.2526655 174.323229,11.6009048 L174.221388,11.8219259 L174.266873,11.8219259 L174.266873,14.8122469 L174.461083,14.4656208 C174.597849,14.2371309 174.748669,14.0185207 174.913694,13.8100747 L175.171903,13.5050644 C176.371208,12.1790254 178.02969,11.5197037 180.021584,11.5197037 C182.013477,11.5197037 183.671959,12.1790254 184.871264,13.5050644 C185.140165,13.8023805 185.376935,14.1228859 185.582084,14.4656208 L185.695432,14.6712099 L185.695432,11.8219259 L190.468417,11.8219259 L190.506747,12.0351605 L190.691666,11.9655473 C191.394731,11.7191585 192.117649,11.5738041 192.857396,11.5321968 L193.30324,11.5197037 C194.706567,11.5197037 195.88753,11.9279499 196.746149,12.7949637 C197.598784,13.6559353 198,14.8292574 198,16.2209383 L198,25.3950617 L192.629386,25.3950617 L192.629386,16.8858272 C192.629386,16.7128362 192.619293,16.5898453 192.610838,16.5120009 L192.605801,16.4862222 L192.514831,16.4895802 C192.067113,16.4895802 191.617308,16.5820287 191.15818,16.7749171 L191.066046,16.8153086 L191.066046,25.3950617 L185.695432,25.3950617 L185.695432,22.5474568 L185.537931,22.8231587 C185.408107,23.0338269 185.26613,23.2358313 185.111874,23.4289462 L184.871264,23.7119232 C183.671959,25.0379623 182.013477,25.697284 180.021584,25.697284 C178.02969,25.697284 176.371208,25.0379623 175.171903,23.7119232 C174.838768,23.3435851 174.555006,22.939238 174.319598,22.5006867 L174.266873,22.3980247 L174.266873,25.3950617 L168.896259,25.3950617 L168.896259,25.1197037 L168.688742,25.19235 C168.093214,25.3769631 167.458181,25.4861944 166.786017,25.5225025 L166.274968,25.5360988 C163.430826,25.5360988 161.719718,23.8307003 161.719718,20.9960494 L161.719718,16.7498272 L161.468707,16.7498272 L161.470392,25.3950617 L156.682798,25.3950617 L156.669184,25.3060741 L156.582556,25.3383735 C156.061471,25.5072763 155.535485,25.6098477 155.007182,25.6441201 L154.610561,25.6569877 C153.365883,25.6569877 152.274679,25.3091559 151.407332,24.6008052 L151.288463,24.4951111 L150.654068,24.824563 C149.75193,25.289629 148.744897,25.5473028 147.647178,25.6044546 L147.171217,25.6166914 C145.139986,25.6166914 143.472265,24.9951095 142.28618,23.7184135 C141.954589,23.3614899 141.672724,22.9662105 141.439239,22.5343847 L141.273312,22.2066173 L141.127933,22.5006867 C140.951377,22.8296002 140.747621,23.1392738 140.516237,23.4289462 L140.275628,23.7119232 C139.076322,25.0379623 137.417841,25.697284 135.425947,25.697284 C133.718609,25.697284 132.256227,25.2128844 131.118,24.2394278 L131.025682,24.1559506 L131.025682,25.3950617 L118.983917,25.3950617 L118.983917,8.07437037 L124.415178,8.07437037 L124.415178,20.3429136 L128.995698,20.3429136 L128.98758,20.3024176 C128.918103,19.8995899 128.874966,19.479045 128.85774,19.0415442 L128.849135,18.5984198 C128.849135,16.5172462 129.41103,14.7934342 130.576266,13.5050644 C131.775571,12.1790254 133.434053,11.5197037 135.425947,11.5197037 C137.417841,11.5197037 139.076322,12.1790254 140.275628,13.5050644 C140.634162,13.9014859 140.935575,14.3391327 141.181074,14.8157302 L141.296897,15.0607407 L141.462158,14.7376201 C141.64145,14.4106479 141.848401,14.1035153 142.083468,13.8170307 L142.327925,13.5374588 C143.537646,12.2383105 145.218617,11.6002963 147.252079,11.6002963 C148.403251,11.6002963 149.499143,11.8430152 150.521523,12.3265937 L151.153692,12.6261728 L151.357939,12.5197491 C151.868556,12.2511562 152.446729,12.0383852 153.092649,11.8764621 L153.589794,11.764476 C154.400337,11.6013547 155.219581,11.5197037 156.04587,11.5197037 C157.561263,11.5197037 158.804265,11.8337264 159.739868,12.5325415 L159.859881,12.6295309 Z"}),gt.jsx("path",{fill:"#FFF",d:"M18.7277903,7.06660317 C18.6844725,7.1648254 18.6709357,7.27330159 18.6893458,7.37907937 L19.1474309,9.98412698 L14.9889278,9.98412698 L15.4248126,7.3747619 C15.4426811,7.27006349 15.4286029,7.16320635 15.3858266,7.06660317 L13.5583594,2.96825397 L20.5552575,2.96825397 L18.7277903,7.06660317 Z M21.8428773,2.13444444 C21.742705,1.98171429 21.5721414,1.88888889 21.3885825,1.88888889 L12.7250344,1.88888889 C12.5414755,1.88888889 12.3709118,1.98171429 12.2707396,2.13444444 C12.1711088,2.28771429 12.1554061,2.48092063 12.2301292,2.64768254 L14.3299567,7.35695238 L13.8155585,10.4353016 C13.7890264,10.5918095 13.8334271,10.7515556 13.9363067,10.8729841 C14.0391863,10.993873 14.190257,11.0634921 14.3494496,11.0634921 L16.5153367,11.0634921 L16.5153367,16.4603175 L17.5982802,16.4603175 L17.5982802,11.0634921 L19.7923238,11.0634921 C19.9525994,11.0634921 20.1042115,10.9927937 20.2065496,10.8708254 C20.3099708,10.7488571 20.3532885,10.5874921 20.3256734,10.4304444 L19.7847431,7.35479365 L21.8834877,2.64768254 C21.9582108,2.48092063 21.9425081,2.28771429 21.8428773,2.13444444 L21.8428773,2.13444444 Z M26.1806075,21.7384127 L24.8594165,22.3698413 L17.0568084,26.1152381 L9.25420041,22.3698413 L7.93300932,21.7384127 L3.76909152,19.7415873 L7.90593574,18.0631746 L16.8239756,22.3428571 C16.8943669,22.3806349 16.9755877,22.3968254 17.0568084,22.3968254 C17.1380292,22.3968254 17.21925,22.3806349 17.2896413,22.3428571 L26.2076811,18.0631746 L30.3445254,19.7415873 L26.1806075,21.7384127 Z M30.3445254,24.5987302 L17.0568084,30.972381 L3.76909152,24.5987302 L7.90593574,22.9203175 L16.8239756,27.2 C16.8943669,27.2377778 16.9755877,27.2539683 17.0568084,27.2539683 C17.1380292,27.2539683 17.21925,27.2377778 17.2896413,27.2 L26.2076811,22.9203175 L30.3445254,24.5987302 Z M32.2183606,19.6822222 C32.2126029,19.4663492 32.077235,19.2774603 31.8823052,19.1965079 L27.5288722,17.4263492 L31.9093787,15.3269841 C32.1043086,15.2352381 32.2234324,15.0355556 32.2183606,14.8250794 C32.2126029,14.6092063 32.077235,14.4203175 31.8823052,14.3393651 L21.3615089,10.0704762 L21.3939972,10.2431746 C21.4481444,10.572381 21.3994119,10.9015873 21.264044,11.1930159 L30.3445254,14.8844444 L26.1806075,16.8812698 L24.8594165,17.5126984 L17.0568084,21.2580952 L9.25420041,17.5126984 L7.93300932,16.8812698 L3.76909152,14.8844444 L12.8766465,11.187619 C12.7466932,10.8961905 12.6925461,10.5777778 12.7466932,10.2593651 L12.7791816,10.0596825 L2.23131173,14.3393651 C2.0363819,14.4203175 1.90101396,14.6092063 1.89525627,14.8250794 C1.89018452,15.0355556 2.00930831,15.2352381 2.20423814,15.3269841 L6.58474465,17.4263492 L2.23131173,19.1965079 C2.0363819,19.2774603 1.90101396,19.4663492 1.89525627,19.6822222 C1.89018452,19.8926984 2.00930831,20.092381 2.20423814,20.184127 L6.58474465,22.2834921 L2.23131173,24.0536508 C2.0363819,24.1346032 1.90101396,24.3234921 1.89525627,24.5393651 C1.89018452,24.7498413 2.00930831,24.9495238 2.20423814,25.0412698 L16.8239756,32.0571429 C16.8943669,32.0949206 16.9755877,32.1111111 17.0568084,32.1111111 C17.1380292,32.1111111 17.21925,32.0949206 17.2896413,32.0571429 L31.9093787,25.0412698 C32.1043086,24.9495238 32.2234324,24.7498413 32.2183606,24.5393651 C32.2126029,24.3234921 32.077235,24.1346032 31.8823052,24.0536508 L27.5288722,22.2834921 L31.9093787,20.184127 C32.1043086,20.092381 32.2234324,19.8926984 32.2183606,19.6822222 L32.2183606,19.6822222 Z"}),gt.jsx("path",{fill:"#232F3E",d:"M21.3885825,0 C22.21275,0 22.9794826,0.41521042 23.4292278,1.10092555 C23.8815068,1.79667269 23.9508181,2.66617834 23.6153978,3.41473846 L21.7501994,7.59585185 L21.8647545,8.24898765 L21.894644,8.25732125 L22.0761281,8.32101243 L32.6112538,12.5957838 C33.4931142,12.9620115 34.087228,13.8121837 34.1130278,14.7797286 C34.1360376,15.734629 33.5939281,16.6230479 32.7306851,17.0292919 L32.1983007,17.2837531 L32.6112538,17.4529267 C33.4196258,17.7886354 33.9862108,18.5309919 34.0948056,19.3939122 L34.1129048,19.6320284 C34.1360376,20.5917718 33.5939281,21.4801907 32.7306851,21.8864347 L32.1983007,22.1411358 L32.6112538,22.3100695 C33.4196258,22.6457782 33.9862108,23.3881348 34.0949003,24.2547855 L34.1130278,24.4940143 C34.1360376,25.4489147 33.5939281,26.3373336 32.7315739,26.7431513 L18.1881846,33.7202426 C17.8281291,33.913478 17.4408282,34 17.0568084,34 C16.6727887,34 16.2854877,33.913478 16.0017804,33.7590244 L1.39494826,26.7492848 C0.519688805,26.3373336 -0.0224206916,25.4489147 0.00071203729,24.4891712 C0.0263888781,23.5264694 0.620502707,22.6762972 1.51540152,22.3047114 L1.91700076,22.1411358 L1.39494826,21.892142 C0.592627093,21.51452 0.0702444326,20.7365329 0.00657042212,19.8702438 L0.00071203729,19.6320283 C0.0263888781,18.6693265 0.620502707,17.8191543 1.51540152,17.4475686 L1.91700076,17.2837531 L1.39494826,17.0349991 C0.592627093,16.6573772 0.0702444326,15.87939 0.00657042212,15.013101 L0.00071203729,14.7748854 C0.0263888781,13.8121837 0.620502707,12.9620115 1.51672004,12.5898902 L12.0645899,8.31020764 C12.1241491,8.28604212 12.1838641,8.26510601 12.2435893,8.24728374 L12.2606548,8.24059259 L12.3667868,7.60424691 L10.4996402,3.41791787 C10.2002256,2.74970496 10.2217218,1.98844227 10.5478452,1.33887687 L10.6843891,1.10092555 C11.1341342,0.41521042 11.9008669,0 12.7250344,0 L21.3885825,0 Z M12.7791816,10.0596825 L2.23131173,14.3393651 C2.0363819,14.4203175 1.90101396,14.6092063 1.89510052,14.8250794 C1.89018452,15.0355556 2.00930831,15.2352381 2.20423814,15.3269841 L6.58474465,17.4263492 L2.23131173,19.1965079 C2.0363819,19.2774603 1.90101396,19.4663492 1.89510052,19.6822222 C1.89018452,19.8926984 2.00930831,20.092381 2.20423814,20.184127 L6.58474465,22.2834921 L2.23131173,24.0536508 C2.0363819,24.1346032 1.90101396,24.3234921 1.89510052,24.5393651 C1.89018452,24.7498413 2.00930831,24.9495238 2.20423814,25.0412698 L16.8239756,32.0571429 C16.8943669,32.0949206 16.9755877,32.1111111 17.0568084,32.1111111 C17.1380292,32.1111111 17.21925,32.0949206 17.2896413,32.0571429 L31.9093787,25.0412698 C32.1043086,24.9495238 32.2234324,24.7498413 32.2185164,24.5393651 C32.2126029,24.3234921 32.077235,24.1346032 31.8823052,24.0536508 L27.5288722,22.2834921 L31.9093787,20.184127 C32.1043086,20.092381 32.2234324,19.8926984 32.2185164,19.6822222 C32.2126029,19.4663492 32.077235,19.2774603 31.8823052,19.1965079 L27.5288722,17.4263492 L31.9093787,15.3269841 C32.1043086,15.2352381 32.2234324,15.0355556 32.2185164,14.8250794 C32.2126029,14.6092063 32.077235,14.4203175 31.8823052,14.3393651 L21.3615089,10.0704762 L21.3939972,10.2431746 C21.4481444,10.572381 21.3994119,10.9015873 21.264044,11.1930159 L30.3445254,14.8844444 L26.1806075,16.8812698 L24.8594165,17.5126984 L17.0568084,21.2580952 L9.25420041,17.5126984 L7.93300932,16.8812698 L3.76909152,14.8844444 L12.8766465,11.187619 C12.7466932,10.8961905 12.6925461,10.5777778 12.7466932,10.2593651 L12.7791816,10.0596825 Z M26.2076811,22.9203175 L30.3445254,24.5987302 L17.0568084,30.972381 L3.76909152,24.5987302 L7.90593574,22.9203175 L16.8239756,27.2 C16.8943669,27.2377778 16.9755877,27.2539683 17.0568084,27.2539683 C17.1380292,27.2539683 17.21925,27.2377778 17.2896413,27.2 L26.2076811,22.9203175 Z M26.2076811,18.0631746 L30.3445254,19.7415873 L26.1806075,21.7384127 L24.8594165,22.3698413 L17.0568084,26.1152381 L9.25420041,22.3698413 L7.93300932,21.7384127 L3.76909152,19.7415873 L7.90593574,18.0631746 L16.8239756,22.3428571 C16.8943669,22.3806349 16.9755877,22.3968254 17.0568084,22.3968254 C17.1380292,22.3968254 17.21925,22.3806349 17.2896413,22.3428571 L26.2076811,18.0631746 Z M13.7313405,12.8696296 L13.5914927,12.9369906 L8.43990444,15.0271605 L8.75246586,15.1780768 L10.0765737,15.8109024 L17.0551238,19.1608889 L24.0399599,15.8095054 L25.3588798,15.1791641 L25.6753971,15.0254815 L20.5482677,12.9420097 L20.4008073,12.8713086 L20.2656497,12.9061426 C20.1883527,12.921399 20.1100917,12.9329586 20.0311197,12.9407041 L19.7923238,12.952381 L19.4927895,12.9519012 L19.4934937,16.4603175 C19.4934937,17.433975 18.754342,18.2355706 17.8047846,18.3381226 L17.5982802,18.3492063 L16.5153367,18.3492063 C15.4686392,18.3492063 14.6201232,17.503522 14.6201232,16.4603175 L14.6191427,12.9519012 L14.3494496,12.952381 C14.1705398,12.952381 13.9938762,12.9327953 13.8222391,12.894864 L13.7313405,12.8696296 Z M21.3885825,1.88888889 L12.7250344,1.88888889 C12.5414755,1.88888889 12.3709118,1.98171429 12.2707396,2.13444444 C12.1711088,2.28771429 12.1554061,2.48092063 12.2301292,2.64768254 L14.3299567,7.35695238 L13.8155585,10.4353016 C13.7890264,10.5918095 13.8334271,10.7515556 13.9363067,10.8729841 C14.0391863,10.993873 14.190257,11.0634921 14.3494496,11.0634921 L16.5153367,11.0634921 L16.5153367,16.4603175 L17.5982802,16.4603175 L17.5982802,11.0634921 L19.7923238,11.0634921 C19.9525994,11.0634921 20.1042115,10.9927937 20.2065496,10.8708254 C20.3099708,10.7488571 20.3532885,10.5874921 20.3256734,10.4304444 L19.7847431,7.35479365 L21.8834877,2.64768254 C21.9582108,2.48092063 21.9425081,2.28771429 21.8428773,2.13444444 C21.742705,1.98171429 21.5721414,1.88888889 21.3885825,1.88888889 Z M20.5552575,2.96825397 L18.7277903,7.06660317 C18.6844725,7.1648254 18.6709357,7.27330159 18.6893458,7.37907937 L19.1474309,9.98412698 L14.9889278,9.98412698 L15.4248126,7.3747619 C15.4426811,7.27006349 15.4286029,7.16320635 15.3858266,7.06660317 L13.5583594,2.96825397 L20.5552575,2.96825397 Z M17.6380072,4.8557037 L16.473925,4.8557037 L17.0551238,6.1602963 L17.6380072,4.8557037 Z"})]})})});var EM="_1fsvfqq0";const MM=(n,l="Standard")=>{if(Array.isArray(n)){const[h]=n;return h??l}if(typeof n=="string")try{return new URL(n).pathname.slice(1)||l}catch{return l}return l},AM=(n,l="Light")=>{if(Array.isArray(n)){const[,h]=n;return h??l}if(typeof n=="string")try{return new URL(n).searchParams.get("color-scheme")==="Dark"?"Dark":l}catch{return l}return l};function LM({mapStyle:n=["Standard","Light"],politicalView:l,showNavigationControl:h=!0,children:m,...w}){const{apiKey:E,region:C}=Hy();return gt.jsxs(pM,{mapStyle:PM(n,C,E,l),validateStyle:!1,style:{width:"100%",height:"100%",borderRadius:4},...w,children:[h&&gt.jsx(bM,{}),gt.jsx("div",{className:EM,children:gt.jsx(TM,{mode:RM(n)})}),m]})}const PM=(n,l,h,m)=>{if(Array.isArray(n)){const[w,E="Light"]=n;let C=`https://maps.geo.${l}.amazonaws.com/v2/styles/${w}/descriptor?key=${h}`;return E&&(w==="Standard"||w==="Monochrome")&&(C+=`&color-scheme=${E}`),m&&(C+=`&political-view=${m}`),C}return n},RM=n=>{const l=MM(n),h=AM(n);return l==="Standard"||l==="Monochrome"?h??"Light":"Dark"};var IM="_1dcgrg20",zM="_1dcgrg21",Xy="_1dcgrg22";function DM({adjustablePosition:n=!0,markerPosition:l,onSaveMarkerPosition:h}){const m=te.useRef(null),[w,E]=te.useState(!1),C=()=>{E(!0)},c=()=>{if(h&&m.current){const B=m.current.getLngLat();h([B.lng,B.lat]),E(!1)}},D=()=>{m.current&&l&&m.current.setLngLat(l),E(!1)};if(l)return gt.jsxs("div",{className:IM,children:[n&&gt.jsx(gt.Fragment,{children:w?gt.jsxs("div",{className:zM,children:[gt.jsx(kd,{className:Xy,size:"small",onClick:c,children:"Set location"}),gt.jsx(kd,{className:Xy,size:"small",variant:"secondary",onClick:D,children:"Cancel"})]}):gt.jsx(kd,{className:Xy,size:"small",onClick:C,children:"Adjust marker"})}),gt.jsx(gM,{draggable:n&&w,longitude:l[0],latitude:l[1],anchor:"bottom",color:"black",ref:m})]})}function OM(n,l){const[h,m]=te.useState(n);return te.useEffect(()=>{if(l<=0){m(n);return}const w=setTimeout(()=>{m(n)},l);return()=>clearTimeout(w)},[n,l]),h}const kM=(n,l)=>({queryKey:["getPlace",l],queryFn:()=>xw(n,l)}),BM=(n,l)=>({queryKey:["reverseGeocode",l],queryFn:()=>bw(n,l)}),FM=()=>gt.jsx("svg",{width:"16px",height:"16px",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:gt.jsx("g",{id:"UI-Kit",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:gt.jsx("g",{id:"Icons",transform:"translate(-88.000000, -224.000000)",fill:"currentColor",children:gt.jsx("g",{id:"Row-3",transform:"translate(40.000000, 224.000000)",children:gt.jsx("g",{id:"Icon/navigation-2-solid",transform:"translate(50.000200, 3.999357)",children:gt.jsx("path",{d:"M11.6668003,18.0006433 C11.6458003,18.0006433 11.6258003,17.9996433 11.6058003,17.9986433 C11.1538003,17.9716433 10.7768003,17.6436433 10.6868003,17.1996433 L9.1488003,9.63264325 C9.0688003,9.23864325 8.7618003,8.93164325 8.3678003,8.85164325 L0.800800303,7.31264325 C0.356800303,7.22364325 0.0288003026,6.84664325 0.00180030261,6.39464325 C-0.0251996974,5.94164325 0.253800303,5.52764325 0.683800303,5.38564325 L16.6838003,0.0526432528 C17.0428003,-0.0693567472 17.4388003,0.0246432528 17.7068003,0.293643253 C17.9748003,0.561643253 18.0678003,0.957643253 17.9488003,1.31664325 L12.6148003,17.3166433 C12.4788003,17.7276433 12.0948003,18.0006433 11.6668003,18.0006433",id:"Icon-Сolor"})})})})})});var NM="t0m72k0";function $5({onLocate:n,className:l="",...h}){const[m,w]=te.useState(!1),E=S2(),{client:C}=Hy(),c=D=>{if(D.preventDefault(),!navigator.geolocation){console.error("Geolocation is not supported by your browser"),w(!0);return}navigator.geolocation.getCurrentPosition(async B=>{var X,Y;const Z=await E.ensureQueryData(BM(C,{QueryPosition:[B.coords.longitude,B.coords.latitude]}));if(Z.ResultItems&&Z.ResultItems.length>0){const U=(X=Z.ResultItems[0].Address)==null?void 0:X.AddressNumber,oe=(Y=Z.ResultItems[0].Address)==null?void 0:Y.Street,ge=U&&oe?`${U} ${oe}`:"";n({addressLineOneField:ge,fullAddress:Z.ResultItems[0].Address,position:Z.ResultItems[0].Position})}},B=>{console.error(`Error getting location: ${B.message}`),w(!0)})};return gt.jsx("button",{onClick:c,className:`${NM} ${l||""}`,...h,disabled:m,"data-testid":"aws-current-location",children:gt.jsx(FM,{})})}const UM=({client:n,apiName:l,apiInput:h,enabled:m})=>Jx({enabled:m,queryKey:["typeahead",l,h],queryFn:()=>{if(l==="autocomplete")return $M(n,{QueryText:"",...h});if(l==="suggest")return VM(n,{QueryText:"",...h});throw new Error(`Invalid value for typeahead api name: '${l}'`)}}),$M=async(n,l)=>{var m;return((m=(await _w(n,l)).ResultItems)==null?void 0:m.filter(w=>{var E;return w.PlaceId&&((E=w.Address)==null?void 0:E.Label)}).map(w=>({placeId:w.PlaceId,title:w.Address.Label})))??[]},VM=async(n,l)=>{var m;return((m=(await vw(n,{...l,BiasPosition:l.BiasPosition??[0,0]})).ResultItems)==null?void 0:m.filter(w=>{var E;return((E=w.Place)==null?void 0:E.PlaceId)&&w.Title}).map(w=>{var E,C;return{placeId:w.Place.PlaceId,title:((C=(E=w.Place)==null?void 0:E.Address)==null?void 0:C.Label)??w.Title}}))??[]},jM=({apiName:n,...l})=>n?gt.jsx(ZM,{...l,apiName:n}):gt.jsx(GM,{...l,apiName:null}),ZM=({id:n,name:l,placeholder:h,className:m,value:w,onChange:E,apiName:C,apiInput:c,onSelect:D,showCurrentLocation:B=!0,debounce:Z=300})=>{const X=OM(w,Z),{client:Y}=Hy(),U=S2(),oe=X.length>=2,{data:ge=[],isLoading:ye}=UM({client:Y,apiName:C,apiInput:{QueryText:X,MaxResults:5,...c},enabled:oe}),Se=async Pe=>{var Rt,Gt,Tt,Ot;if(!Pe)return;const Oe=await U.ensureQueryData(kM(Y,{PlaceId:Pe.placeId,Language:c==null?void 0:c.Language,PoliticalView:c==null?void 0:c.PoliticalView})),[Je,et]=Oe.Position??[],ot=[(Rt=Oe.Address)==null?void 0:Rt.AddressNumber,(Gt=Oe.Address)==null?void 0:Gt.Street].filter(Boolean).join(" ");E((ot||((Tt=Oe.Address)==null?void 0:Tt.Label))??Pe.title),D({addressLineOneField:((Ot=Oe.Address)==null?void 0:Ot.Label)??"",fullAddress:Oe.Address,position:Oe.Position?[Je,et]:void 0}),U.invalidateQueries({queryKey:["typeahead"]}),U.invalidateQueries({queryKey:["getPlace"]})},je=Pe=>{E(Pe.addressLineOneField??""),D(Pe)};return gt.jsxs("div",{className:ny(m,E5),children:[gt.jsxs(C5,{onChange:Se,children:[gt.jsx(Zy,{as:m0,id:n,name:l,placeholder:h,value:w,onChange:Pe=>E(Pe.target.value),className:M5,autoComplete:"off"}),oe&&gt.jsxs(Gy,{transition:!0,anchor:"bottom start",className:P5,"data-testid":`aws-typeahead-results-${C}`,modal:!1,children:[ye&&gt.jsx(pp,{value:null,className:L5,disabled:!0,children:"Loading..."}),ge.length===0&&!ye&&gt.jsx(pp,{value:null,className:L5,disabled:!0,children:"No results"}),ge.map(Pe=>gt.jsx(pp,{value:Pe,className:A5,children:Pe.title},Pe.placeId)),gt.jsx(pp,{value:null,className:KE,disabled:!0,children:gt.jsx("a",{className:JE,href:"https://aws.amazon.com/location/",target:"_blank",rel:"noreferrer",children:"Powered by Amazon Location"})})]})]}),B&&gt.jsx($5,{onLocate:je,className:R5})]})},GM=({id:n,name:l,placeholder:h,className:m,value:w,onChange:E,onSelect:C,showCurrentLocation:c=!0})=>{const D=B=>{E(B.addressLineOneField??""),C(B)};return gt.jsxs("div",{className:ny(m,E5),children:[gt.jsx(m0,{id:n,name:l,placeholder:h,value:w,onChange:B=>E(B.target.value),className:M5,autoComplete:"off"}),c&&gt.jsx($5,{onLocate:D,className:R5})]})},V5=te.createContext(void 0),lm=()=>{const n=te.useContext(V5);if(!n)throw new Error("Address form context is not initialized.");return n},j5=te.memo(({name:n,className:l,label:h,placeholder:m})=>{const w=lm(),E=te.useId();return gt.jsx(qy,{id:E,label:h,children:gt.jsx(tM,{id:E,name:n,className:l,placeholder:m,multiple:!1,value:w.data[n]??null,allowedCountries:w.allowedCountries,onChange:C=>w.setData({[n]:C??void 0})})})}),qM=(n,l)=>{const h=m=>{if(te.isValidElement(m)){const w=m.props;for(const E of l){const C=E.search.props;if(m.type===E.search.type&&Object.entries(C).every(([D,B])=>w[D]===B)){const D={...w};return Object.keys(C).forEach(B=>delete D[B]),E.replace(D)}}if(w.children)return te.cloneElement(m,{children:te.Children.map(w.children,h)})}return m};return te.Children.map(n,h)},yh=te.memo(({name:n,className:l,label:h,placeholder:m})=>{const w=lm(),E=te.useId();return gt.jsx(qy,{id:E,label:h,children:gt.jsx(m0,{id:E,name:n,className:l,placeholder:m,value:w.data[n]??"",onChange:C=>w.setData({[n]:C.target.value})})})}),Yy=(n,l)=>{if(l in n)return n[l]!=="false"},Qy=(n,l)=>{if(l in n)return String(n[l])},ji={ADDRESS_LINE_ONE:"addressLineOne",ADDRESS_LINE_TWO:"addressLineTwo",CITY:"city",PROVINCE:"province",POSTAL_CODE:"postalCode",COUNTRY:"country"};te.memo(({children:n})=>qM(n,[{search:gt.jsx("input",{"data-type":"address-form",name:ji.ADDRESS_LINE_ONE}),replace:({"aria-label":l,placeholder:h,className:m,...w})=>gt.jsx(Z5,{name:ji.ADDRESS_LINE_ONE,label:l??"Address",placeholder:h??"Enter address",className:m,apiName:Qy(w,"data-api-name")??"autocomplete",showCurrentLocation:Yy(w,"data-show-current-location")??!0})},{search:gt.jsx("input",{"data-type":"address-form",name:ji.ADDRESS_LINE_TWO}),replace:({"aria-label":l,placeholder:h,className:m})=>gt.jsx(yh,{name:ji.ADDRESS_LINE_TWO,label:l??"Address Line 2",placeholder:h??"Apartment, suite, etc.",className:m})},{search:gt.jsx("input",{"data-type":"address-form",name:ji.CITY}),replace:({"aria-label":l,placeholder:h,className:m})=>gt.jsx(yh,{name:ji.CITY,label:l??"City",placeholder:h,className:m})},{search:gt.jsx("input",{"data-type":"address-form",name:ji.PROVINCE}),replace:({"aria-label":l,placeholder:h,className:m})=>gt.jsx(yh,{name:ji.PROVINCE,label:l??"Province/State",placeholder:h,className:m})},{search:gt.jsx("input",{"data-type":"address-form",name:ji.POSTAL_CODE}),replace:({"aria-label":l,placeholder:h,className:m})=>gt.jsx(yh,{name:ji.POSTAL_CODE,label:l??"Postal/Zip code",placeholder:h,className:m})},{search:gt.jsx("input",{"data-type":"address-form",name:ji.COUNTRY}),replace:({"aria-label":l,placeholder:h,className:m})=>gt.jsx(j5,{name:ji.COUNTRY,label:l??"Country",className:m,placeholder:h})},{search:gt.jsx("button",{"data-type":"address-form",type:"submit"}),replace:l=>gt.jsx(kd,{...l,type:"submit"})},{search:gt.jsx("button",{"data-type":"address-form",type:"reset"}),replace:l=>gt.jsx(kd,{...l,type:"reset",variant:"secondary"})}]));const HM=({adjustablePosition:n,children:l,...h})=>{const m=lm(),w=E=>{m.setData({adjustedPosition:E.join(",")})};return gt.jsxs(LM,{...h,children:[gt.jsx(DM,{adjustablePosition:n,markerPosition:XM(m.data.adjustedPosition??m.data.originalPosition??""),onSaveMarkerPosition:w}),l]})},XM=n=>{const[l=0,h=0]=n.split(",").map(Number);return[l,h]},YM=({apiKey:n,region:l,children:h,language:m,politicalView:w,showCurrentCountryResultsOnly:E,allowedCountries:C,placeTypes:c})=>{const[D,B]=te.useState({}),[Z,X]=te.useState(),Y=te.useMemo(()=>({apiKey:n,region:l,data:D,setData:U=>B(oe=>({...oe,...U})),mapViewState:Z,setMapViewState:X,language:m,politicalView:w,showCurrentCountryResultsOnly:E,allowedCountries:C,placeTypes:c}),[C,n,D,m,Z,c,w,l,E]);return gt.jsx(V5.Provider,{value:Y,children:h})},Z5=te.memo(({name:n,label:l,className:h,showCurrentLocation:m,apiName:w,placeholder:E})=>{const C=lm(),c=QM(w),D=te.useId(),B=Z=>{var X,Y,U,oe,ge,ye,Se;if(C.setData({addressLineOne:Z.addressLineOneField,city:(X=Z.fullAddress)==null?void 0:X.Locality,postalCode:(Y=Z.fullAddress)==null?void 0:Y.PostalCode,province:(oe=(U=Z.fullAddress)==null?void 0:U.Region)==null?void 0:oe.Name,country:(ye=(ge=Z.fullAddress)==null?void 0:ge.Country)==null?void 0:ye.Code2,originalPosition:(Se=Z.position)==null?void 0:Se.join(",")}),Z.position){const[je,Pe]=Z.position;C.setMapViewState({longitude:je,latitude:Pe,zoom:15}),C.setData({originalPosition:[je,Pe].join(",")})}};return gt.jsx(qy,{id:D,label:l,children:gt.jsx(jM,{id:D,name:n,placeholder:E,className:h,showCurrentLocation:m,apiName:c,apiInput:{PoliticalView:C.politicalView,Language:C.language,BiasPosition:C.mapViewState?[C.mapViewState.longitude,C.mapViewState.latitude]:void 0,Filter:{IncludePlaceTypes:C.placeTypes,IncludeCountries:Tw(C.showCurrentCountryResultsOnly,C.data.country,C.allowedCountries)}},value:C.data.addressLineOne??"",onChange:Z=>C.setData({addressLineOne:Z}),onSelect:B})})}),QM=n=>{if(n===""||n===null)return null;if(n==="autocomplete"||n==="suggest")return n;throw new Error(`Invalid apiName: "${n}". Must be "autocomplete", "suggest", or null.`)},WM=({root:n,...l})=>{const h=document.querySelector(n);if(!h)throw new Error(`Address form could not be initialized. No form element found matching selector "${n}". Please ensure the form exists in the DOM before calling render().`);const m=document.createElement("div"),w=gx.createRoot(m);h.appendChild(m),w.render(gt.jsx(Sw,{apiKey:l.apiKey,region:l.region,children:gt.jsxs(YM,{apiKey:l.apiKey,region:l.region,language:l.language,politicalView:l.politicalView,showCurrentCountryResultsOnly:l.showCurrentCountryResultsOnly,allowedCountries:l.allowedCountries,placeTypes:l.placeTypes,children:[gt.jsx(KM,{selector:n,onSubmit:l.onSubmit,preventDefaultOnSubmit:l.preventDefaultOnSubmit}),gt.jsx(Cw,{selector:n,replacements:[{selector:`input[data-type="address-form"][name="${ji.ADDRESS_LINE_ONE}"]`,component:E=>gt.jsx(Z5,{name:ji.ADDRESS_LINE_ONE,label:E.ariaLabel??"Address",placeholder:E.getAttribute("placeholder")??"Enter address",className:E.className||void 0,apiName:Qy(E.dataset,"apiName")??"autocomplete",showCurrentLocation:Yy(E.dataset,"showCurrentLocation")??!0})},{selector:`input[data-type="address-form"][name="${ji.ADDRESS_LINE_TWO}"]`,component:E=>gt.jsx(yh,{name:ji.ADDRESS_LINE_TWO,label:E.ariaLabel??"Address Line 2",placeholder:E.getAttribute("placeholder")??"Apartment, suite, etc.",className:E.className||void 0})},{selector:`input[data-type="address-form"][name="${ji.CITY}"]`,component:E=>gt.jsx(yh,{name:ji.CITY,label:E.ariaLabel??"City",placeholder:E.getAttribute("placeholder")??void 0,className:E.className||void 0})},{selector:`input[data-type="address-form"][name="${ji.PROVINCE}"]`,component:E=>gt.jsx(yh,{name:ji.PROVINCE,label:E.ariaLabel??"Province/State",placeholder:E.getAttribute("placeholder")??void 0,className:E.className||void 0})},{selector:`input[data-type="address-form"][name="${ji.POSTAL_CODE}"]`,component:E=>gt.jsx(yh,{name:ji.POSTAL_CODE,label:E.ariaLabel??"Postal/Zip code",placeholder:E.getAttribute("placeholder")??void 0,className:E.className||void 0})},{selector:`input[data-type="address-form"][name="${ji.COUNTRY}"]`,component:E=>gt.jsx(j5,{name:ji.COUNTRY,label:E.ariaLabel??"Country",placeholder:E.getAttribute("placeholder")??void 0,className:E.className||void 0})},{selector:'div[data-type="address-form"][data-map-style]',component:E=>gt.jsx(HM,{mapStyle:JM(Qy(E.dataset,"mapStyle")),adjustablePosition:Yy(E.dataset,"adjustablePosition")})},{selector:'button[data-type="address-form"][type="submit"]',component:E=>gt.jsx(kd,{type:"submit",className:E.className||void 0,children:E.textContent})},{selector:'button[data-type="address-form"][type="reset"]',component:E=>gt.jsx(kd,{type:"reset",variant:"secondary",className:E.className||void 0,children:E.textContent})}]})]})}))},KM=({selector:n,onSubmit:l,preventDefaultOnSubmit:h=!0})=>{const{data:m,setData:w}=lm();return te.useEffect(()=>{const E=document.querySelector(n);if(!E)return;const C=D=>{h&&D.preventDefault(),l&&l(Object.assign(D,{data:m}))},c=()=>{w({})};return E.addEventListener("submit",C),E.addEventListener("reset",c),()=>{E.removeEventListener("submit",C),E.removeEventListener("reset",c)}},[n,m,w,l,h]),null},JM=n=>{if(!n)return["Standard","Light"];const[l,h]=n.split(","),m=["Standard","Monochrome","Hybrid","Satellite"],w=["Light","Dark"],E=B=>m.includes(B),C=B=>w.includes(B),c=E(l)?l:"Standard";return(C(h)?h:"Light")==="Dark"?c==="Standard"||c==="Monochrome"?[c,"Dark"]:["Standard","Dark"]:[c,"Light"]};var y0={exports:{}};/**
80
+ * MapLibre GL JS
81
+ * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v5.9.0/LICENSE.txt
82
+ */var eA=y0.exports,G5;function tA(){return G5||(G5=1,(function(n,l){(function(h,m){n.exports=m()})(eA,(function(){var h={},m={};function w(C,c,D){if(m[C]=D,C==="index"){var B="var sharedModule = {}; ("+m.shared+")(sharedModule); ("+m.worker+")(sharedModule);",Z={};return m.shared(Z),m.index(h,Z),typeof window<"u"&&h.setWorkerUrl(window.URL.createObjectURL(new Blob([B],{type:"text/javascript"}))),h}}w("shared",["exports"],(function(C){function c(a,t,r,u){return new(r||(r=Promise))((function(p,x){function b(I){try{M(u.next(I))}catch(z){x(z)}}function T(I){try{M(u.throw(I))}catch(z){x(z)}}function M(I){var z;I.done?p(I.value):(z=I.value,z instanceof r?z:new r((function(F){F(z)}))).then(b,T)}M((u=u.apply(a,t||[])).next())}))}function D(a,t){this.x=a,this.y=t}function B(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var Z,X;typeof SuppressedError=="function"&&SuppressedError,D.prototype={clone(){return new D(this.x,this.y)},add(a){return this.clone()._add(a)},sub(a){return this.clone()._sub(a)},multByPoint(a){return this.clone()._multByPoint(a)},divByPoint(a){return this.clone()._divByPoint(a)},mult(a){return this.clone()._mult(a)},div(a){return this.clone()._div(a)},rotate(a){return this.clone()._rotate(a)},rotateAround(a,t){return this.clone()._rotateAround(a,t)},matMult(a){return this.clone()._matMult(a)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(a){return this.x===a.x&&this.y===a.y},dist(a){return Math.sqrt(this.distSqr(a))},distSqr(a){const t=a.x-this.x,r=a.y-this.y;return t*t+r*r},angle(){return Math.atan2(this.y,this.x)},angleTo(a){return Math.atan2(this.y-a.y,this.x-a.x)},angleWith(a){return this.angleWithSep(a.x,a.y)},angleWithSep(a,t){return Math.atan2(this.x*t-this.y*a,this.x*a+this.y*t)},_matMult(a){const t=a[2]*this.x+a[3]*this.y;return this.x=a[0]*this.x+a[1]*this.y,this.y=t,this},_add(a){return this.x+=a.x,this.y+=a.y,this},_sub(a){return this.x-=a.x,this.y-=a.y,this},_mult(a){return this.x*=a,this.y*=a,this},_div(a){return this.x/=a,this.y/=a,this},_multByPoint(a){return this.x*=a.x,this.y*=a.y,this},_divByPoint(a){return this.x/=a.x,this.y/=a.y,this},_unit(){return this._div(this.mag()),this},_perp(){const a=this.y;return this.y=this.x,this.x=-a,this},_rotate(a){const t=Math.cos(a),r=Math.sin(a),u=r*this.x+t*this.y;return this.x=t*this.x-r*this.y,this.y=u,this},_rotateAround(a,t){const r=Math.cos(a),u=Math.sin(a),p=t.y+u*(this.x-t.x)+r*(this.y-t.y);return this.x=t.x+r*(this.x-t.x)-u*(this.y-t.y),this.y=p,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:D},D.convert=function(a){if(a instanceof D)return a;if(Array.isArray(a))return new D(+a[0],+a[1]);if(a.x!==void 0&&a.y!==void 0)return new D(+a.x,+a.y);throw new Error("Expected [x, y] or {x, y} point format")};var Y=(function(){if(X)return Z;function a(t,r,u,p){this.cx=3*t,this.bx=3*(u-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*r,this.by=3*(p-r)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=r,this.p2x=u,this.p2y=p}return X=1,Z=a,a.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,r){if(r===void 0&&(r=1e-6),t<0)return 0;if(t>1)return 1;for(var u=t,p=0;p<8;p++){var x=this.sampleCurveX(u)-t;if(Math.abs(x)<r)return u;var b=this.sampleCurveDerivativeX(u);if(Math.abs(b)<1e-6)break;u-=x/b}var T=0,M=1;for(u=t,p=0;p<20&&(x=this.sampleCurveX(u),!(Math.abs(x-t)<r));p++)t>x?T=u:M=u,u=.5*(M-T)+T;return u},solve:function(t,r){return this.sampleCurveY(this.solveCurveX(t,r))}},Z})(),U=B(Y);let oe,ge;function ye(){return oe==null&&(oe=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),oe}function Se(){if(ge==null&&(ge=!1,ye())){const t=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(t){for(let u=0;u<25;u++){const p=4*u;t.fillStyle=`rgb(${p},${p+1},${p+2})`,t.fillRect(u%5,Math.floor(u/5),1,1)}const r=t.getImageData(0,0,5,5).data;for(let u=0;u<100;u++)if(u%4!=3&&r[u]!==u){ge=!0;break}}}return ge||!1}var je=1e-6,Pe=typeof Float32Array<"u"?Float32Array:Array;function Oe(){var a=new Pe(9);return Pe!=Float32Array&&(a[1]=0,a[2]=0,a[3]=0,a[5]=0,a[6]=0,a[7]=0),a[0]=1,a[4]=1,a[8]=1,a}function Je(a){return a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=1,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=1,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a}function et(){var a=new Pe(3);return Pe!=Float32Array&&(a[0]=0,a[1]=0,a[2]=0),a}function ot(a){var t=a[0],r=a[1],u=a[2];return Math.sqrt(t*t+r*r+u*u)}function Rt(a,t,r){var u=new Pe(3);return u[0]=a,u[1]=t,u[2]=r,u}function Gt(a,t,r){return a[0]=t[0]+r[0],a[1]=t[1]+r[1],a[2]=t[2]+r[2],a}function Tt(a,t,r){return a[0]=t[0]*r,a[1]=t[1]*r,a[2]=t[2]*r,a}function Ot(a,t,r){var u=t[0],p=t[1],x=t[2],b=r[0],T=r[1],M=r[2];return a[0]=p*M-x*T,a[1]=x*b-u*M,a[2]=u*T-p*b,a}var At,Qt=ot;function sn(a,t,r){var u=t[0],p=t[1],x=t[2],b=t[3];return a[0]=r[0]*u+r[4]*p+r[8]*x+r[12]*b,a[1]=r[1]*u+r[5]*p+r[9]*x+r[13]*b,a[2]=r[2]*u+r[6]*p+r[10]*x+r[14]*b,a[3]=r[3]*u+r[7]*p+r[11]*x+r[15]*b,a}function qt(){var a=new Pe(4);return Pe!=Float32Array&&(a[0]=0,a[1]=0,a[2]=0),a[3]=1,a}function $e(a,t,r,u){var p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"zyx",x=Math.PI/360;t*=x,u*=x,r*=x;var b=Math.sin(t),T=Math.cos(t),M=Math.sin(r),I=Math.cos(r),z=Math.sin(u),F=Math.cos(u);switch(p){case"xyz":a[0]=b*I*F+T*M*z,a[1]=T*M*F-b*I*z,a[2]=T*I*z+b*M*F,a[3]=T*I*F-b*M*z;break;case"xzy":a[0]=b*I*F-T*M*z,a[1]=T*M*F-b*I*z,a[2]=T*I*z+b*M*F,a[3]=T*I*F+b*M*z;break;case"yxz":a[0]=b*I*F+T*M*z,a[1]=T*M*F-b*I*z,a[2]=T*I*z-b*M*F,a[3]=T*I*F+b*M*z;break;case"yzx":a[0]=b*I*F+T*M*z,a[1]=T*M*F+b*I*z,a[2]=T*I*z-b*M*F,a[3]=T*I*F-b*M*z;break;case"zxy":a[0]=b*I*F-T*M*z,a[1]=T*M*F+b*I*z,a[2]=T*I*z+b*M*F,a[3]=T*I*F-b*M*z;break;case"zyx":a[0]=b*I*F-T*M*z,a[1]=T*M*F+b*I*z,a[2]=T*I*z-b*M*F,a[3]=T*I*F+b*M*z;break;default:throw new Error("Unknown angle order "+p)}return a}function ft(){var a=new Pe(2);return Pe!=Float32Array&&(a[0]=0,a[1]=0),a}function wt(a,t){var r=new Pe(2);return r[0]=a,r[1]=t,r}et(),At=new Pe(4),Pe!=Float32Array&&(At[0]=0,At[1]=0,At[2]=0,At[3]=0),et(),Rt(1,0,0),Rt(0,1,0),qt(),qt(),Oe(),ft();const St=8192;function Zt(a,t,r){return t*(St/(a.tileSize*Math.pow(2,r-a.tileID.overscaledZ)))}function we(a,t){return(a%t+t)%t}function Be(a,t,r){return a*(1-r)+t*r}function pt(a){if(a<=0)return 0;if(a>=1)return 1;const t=a*a,r=t*a;return 4*(a<.5?r:3*(a-t)+r-.75)}function xt(a,t,r,u){const p=new U(a,t,r,u);return x=>p.solve(x)}const Bt=xt(.25,.1,.25,1);function Lt(a,t,r){return Math.min(r,Math.max(t,a))}function Wt(a,t,r){const u=r-t,p=((a-t)%u+u)%u+t;return p===t?r:p}function Ht(a,...t){for(const r of t)for(const u in r)a[u]=r[u];return a}let xn=1;function ka(a,t,r){const u={};for(const p in a)u[p]=t.call(this,a[p],p,a);return u}function ai(a,t,r){const u={};for(const p in a)t.call(this,a[p],p,a)&&(u[p]=a[p]);return u}function kr(a){return Array.isArray(a)?a.map(kr):typeof a=="object"&&a?ka(a,kr):a}const Mi={};function si(a){Mi[a]||(typeof console<"u"&&console.warn(a),Mi[a]=!0)}function ca(a,t,r){return(r.y-a.y)*(t.x-a.x)>(t.y-a.y)*(r.x-a.x)}function Ba(a){return typeof WorkerGlobalScope<"u"&&a!==void 0&&a instanceof WorkerGlobalScope}let wl=null;function zo(a){if(wl==null){const t=a.navigator?a.navigator.userAgent:null;wl=!!a.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return wl}function Br(a){return typeof ImageBitmap<"u"&&a instanceof ImageBitmap}const Do="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Sl(a,t,r,u,p){return c(this,void 0,void 0,(function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const x=new VideoFrame(a,{timestamp:0});try{const b=x==null?void 0:x.format;if(!b||!b.startsWith("BGR")&&!b.startsWith("RGB"))throw new Error(`Unrecognized format ${b}`);const T=b.startsWith("BGR"),M=new Uint8ClampedArray(u*p*4);if(yield x.copyTo(M,(function(I,z,F,j,G){const H=4*Math.max(-z,0),J=(Math.max(0,F)-F)*j*4+H,ne=4*j,le=Math.max(0,z),Ae=Math.max(0,F);return{rect:{x:le,y:Ae,width:Math.min(I.width,z+j)-le,height:Math.min(I.height,F+G)-Ae},layout:[{offset:J,stride:ne}]}})(a,t,r,u,p)),T)for(let I=0;I<M.length;I+=4){const z=M[I];M[I]=M[I+2],M[I+2]=z}return M}finally{x.close()}}))}let Oo,Ss;function Ji(a,t,r,u){return a.addEventListener(t,r,u),{unsubscribe:()=>{a.removeEventListener(t,r,u)}}}function hu(a){return a*Math.PI/180}function ua(a){return a/Math.PI*180}const Hs={touchstart:!0,touchmove:!0,touchmoveWindow:!0,touchend:!0,touchcancel:!0},Fr={dblclick:!0,click:!0,mouseover:!0,mouseout:!0,mousedown:!0,mousemove:!0,mousemoveWindow:!0,mouseup:!0,mouseupWindow:!0,contextmenu:!0,wheel:!0},Ce="AbortError";function Q(){return new Error(Ce)}const W={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function ie(a){return W.REGISTERED_PROTOCOLS[a.substring(0,a.indexOf("://"))]}const he="global-dispatcher";class me extends Error{constructor(t,r,u,p){super(`AJAXError: ${r} (${t}): ${u}`),this.status=t,this.statusText=r,this.url=u,this.body=p}}const Te=()=>Ba(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,De=function(a,t){if(/:\/\//.test(a.url)&&!/^https?:|^file:/.test(a.url)){const u=ie(a.url);if(u)return u(a,t);if(Ba(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:a,targetMapId:he},t)}if(!(/^file:/.test(r=a.url)||/^file:/.test(Te())&&!/^\w+:/.test(r))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return(function(u,p){return c(this,void 0,void 0,(function*(){const x=new Request(u.url,{method:u.method||"GET",body:u.body,credentials:u.credentials,headers:u.headers,cache:u.cache,referrer:Te(),signal:p.signal});let b,T;u.type!=="json"||x.headers.has("Accept")||x.headers.set("Accept","application/json");try{b=yield fetch(x)}catch(I){throw new me(0,I.message,u.url,new Blob)}if(!b.ok){const I=yield b.blob();throw new me(b.status,b.statusText,u.url,I)}T=u.type==="arrayBuffer"||u.type==="image"?b.arrayBuffer():u.type==="json"?b.json():b.text();const M=yield T;if(p.signal.aborted)throw Q();return{data:M,cacheControl:b.headers.get("Cache-Control"),expires:b.headers.get("Expires")}}))})(a,t);if(Ba(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:a,mustQueue:!0,targetMapId:he},t)}var r;return(function(u,p){return new Promise(((x,b)=>{var T;const M=new XMLHttpRequest;M.open(u.method||"GET",u.url,!0),u.type!=="arrayBuffer"&&u.type!=="image"||(M.responseType="arraybuffer");for(const I in u.headers)M.setRequestHeader(I,u.headers[I]);u.type==="json"&&(M.responseType="text",!((T=u.headers)===null||T===void 0)&&T.Accept||M.setRequestHeader("Accept","application/json")),M.withCredentials=u.credentials==="include",M.onerror=()=>{b(new Error(M.statusText))},M.onload=()=>{if(!p.signal.aborted)if((M.status>=200&&M.status<300||M.status===0)&&M.response!==null){let I=M.response;if(u.type==="json")try{I=JSON.parse(M.response)}catch(z){return void b(z)}x({data:I,cacheControl:M.getResponseHeader("Cache-Control"),expires:M.getResponseHeader("Expires")})}else{const I=new Blob([M.response],{type:M.getResponseHeader("Content-Type")});b(new me(M.status,M.statusText,u.url,I))}},p.signal.addEventListener("abort",(()=>{M.abort(),b(Q())})),M.send(u.body)}))})(a,t)};function Le(a){if(!a||a.indexOf("://")<=0||a.indexOf("data:image/")===0||a.indexOf("blob:")===0)return!0;const t=new URL(a),r=window.location;return t.protocol===r.protocol&&t.host===r.host}function Xe(a,t,r){r[a]&&r[a].indexOf(t)!==-1||(r[a]=r[a]||[],r[a].push(t))}function ct(a,t,r){if(r&&r[a]){const u=r[a].indexOf(t);u!==-1&&r[a].splice(u,1)}}class Qe{constructor(t,r={}){Ht(this,r),this.type=t}}class Pt extends Qe{constructor(t,r={}){super("error",Ht({error:t},r))}}class Ut{on(t,r){return this._listeners=this._listeners||{},Xe(t,r,this._listeners),{unsubscribe:()=>{this.off(t,r)}}}off(t,r){return ct(t,r,this._listeners),ct(t,r,this._oneTimeListeners),this}once(t,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},Xe(t,r,this._oneTimeListeners),this):new Promise((u=>this.once(t,u)))}fire(t,r){typeof t=="string"&&(t=new Qe(t,r||{}));const u=t.type;if(this.listens(u)){t.target=this;const p=this._listeners&&this._listeners[u]?this._listeners[u].slice():[];for(const T of p)T.call(this,t);const x=this._oneTimeListeners&&this._oneTimeListeners[u]?this._oneTimeListeners[u].slice():[];for(const T of x)ct(u,T,this._oneTimeListeners),T.call(this,t);const b=this._eventedParent;b&&(Ht(t,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),b.fire(t))}else t instanceof Pt&&console.error(t.error);return this}listens(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)}setEventedParent(t,r){return this._eventedParent=t,this._eventedParentData=r,this}}var Ie={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},"font-faces":{type:"array",value:"fontFaces"},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:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},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_color-relief","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:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"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"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","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","feature"]},"property-type":"cross-faded-data-driven"},"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:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,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:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",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"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};const mn=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function En(a,t){const r={};for(const u in a)u!=="ref"&&(r[u]=a[u]);return mn.forEach((u=>{u in t&&(r[u]=t[u])})),r}function Dt(a,t){if(Array.isArray(a)){if(!Array.isArray(t)||a.length!==t.length)return!1;for(let r=0;r<a.length;r++)if(!Dt(a[r],t[r]))return!1;return!0}if(typeof a=="object"&&a!==null&&t!==null){if(typeof t!="object"||Object.keys(a).length!==Object.keys(t).length)return!1;for(const r in a)if(!Dt(a[r],t[r]))return!1;return!0}return a===t}function Sn(a,t){a.push(t)}function Ni(a,t,r){Sn(r,{command:"addSource",args:[a,t[a]]})}function Ai(a,t,r){Sn(t,{command:"removeSource",args:[a]}),r[a]=!0}function Zi(a,t,r,u){Ai(a,r,u),Ni(a,t,r)}function ur(a,t,r){let u;for(u in a[r])if(Object.prototype.hasOwnProperty.call(a[r],u)&&u!=="data"&&!Dt(a[r][u],t[r][u]))return!1;for(u in t[r])if(Object.prototype.hasOwnProperty.call(t[r],u)&&u!=="data"&&!Dt(a[r][u],t[r][u]))return!1;return!0}function Kn(a,t,r,u,p,x){a=a||{},t=t||{};for(const b in a)Object.prototype.hasOwnProperty.call(a,b)&&(Dt(a[b],t[b])||r.push({command:x,args:[u,b,t[b],p]}));for(const b in t)Object.prototype.hasOwnProperty.call(t,b)&&!Object.prototype.hasOwnProperty.call(a,b)&&(Dt(a[b],t[b])||r.push({command:x,args:[u,b,t[b],p]}))}function Gi(a){return a.id}function On(a,t){return a[t.id]=t,a}class rt{constructor(t,r,u,p){this.message=(t?`${t}: `:"")+u,p&&(this.identifier=p),r!=null&&r.__line__&&(this.line=r.__line__)}}function is(a,...t){for(const r of t)for(const u in r)a[u]=r[u];return a}class Yr extends Error{constructor(t,r){super(r),this.message=r,this.key=t}}class qi{constructor(t,r=[]){this.parent=t,this.bindings={};for(const[u,p]of r)this.bindings[u]=p}concat(t){return new qi(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(`${t} not found in scope.`)}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}const An={kind:"null"},ut={kind:"number"},on={kind:"string"},cn={kind:"boolean"},ha={kind:"color"},Cs={kind:"projectionDefinition"},rs={kind:"object"},rn={kind:"value"},ko={kind:"collator"},Ts={kind:"formatted"},Fa={kind:"padding"},Xs={kind:"colorArray"},Qr={kind:"numberArray"},bi={kind:"resolvedImage"},Pi={kind:"variableAnchorOffsetCollection"};function Wr(a,t){return{kind:"array",itemType:a,N:t}}function jn(a){if(a.kind==="array"){const t=jn(a.itemType);return typeof a.N=="number"?`array<${t}, ${a.N}>`:a.itemType.kind==="value"?"array":`array<${t}>`}return a.kind}const Es=[An,ut,on,cn,ha,Cs,Ts,rs,Wr(rn),Fa,Qr,Xs,bi,Pi];function xc(a,t){if(t.kind==="error")return null;if(a.kind==="array"){if(t.kind==="array"&&(t.N===0&&t.itemType.kind==="value"||!xc(a.itemType,t.itemType))&&(typeof a.N!="number"||a.N===t.N))return null}else{if(a.kind===t.kind)return null;if(a.kind==="value"){for(const r of Es)if(!xc(r,t))return null}}return`Expected ${jn(a)} but found ${jn(t)} instead.`}function Mh(a,t){return t.some((r=>r.kind===a.kind))}function Bo(a,t){return t.some((r=>r==="null"?a===null:r==="array"?Array.isArray(a):r==="object"?a&&!Array.isArray(a)&&typeof a=="object":r===typeof a))}function Ys(a,t){return a.kind==="array"&&t.kind==="array"?a.itemType.kind===t.itemType.kind&&typeof a.N=="number":a.kind===t.kind}const du=.96422,bc=.82521,Ms=4/29,br=6/29,Hd=3*br*br,pm=br*br*br,Xd=Math.PI/180,Ap=180/Math.PI;function fu(a){return(a%=360)<0&&(a+=360),a}function Yd([a,t,r,u]){let p,x;const b=pu((.2225045*(a=hr(a))+.7168786*(t=hr(t))+.0606169*(r=hr(r)))/1);a===t&&t===r?p=x=b:(p=pu((.4360747*a+.3850649*t+.1430804*r)/du),x=pu((.0139322*a+.0971045*t+.7141733*r)/bc));const T=116*b-16;return[T<0?0:T,500*(p-b),200*(b-x),u]}function hr(a){return a<=.04045?a/12.92:Math.pow((a+.055)/1.055,2.4)}function pu(a){return a>pm?Math.pow(a,1/3):a/Hd+Ms}function Qd([a,t,r,u]){let p=(a+16)/116,x=isNaN(t)?p:p+t/500,b=isNaN(r)?p:p-r/200;return p=1*Fo(p),x=du*Fo(x),b=bc*Fo(b),[Qs(3.1338561*x-1.6168667*p-.4906146*b),Qs(-.9787684*x+1.9161415*p+.033454*b),Qs(.0719453*x-.2289914*p+1.4052427*b),u]}function Qs(a){return(a=a<=.00304?12.92*a:1.055*Math.pow(a,1/2.4)-.055)<0?0:a>1?1:a}function Fo(a){return a>br?a*a*a:Hd*(a-Ms)}const Lp=Object.hasOwn||function(a,t){return Object.prototype.hasOwnProperty.call(a,t)};function wc(a,t){return Lp(a,t)?a[t]:void 0}function As(a){return parseInt(a.padEnd(2,a),16)/255}function Wd(a,t){return Lr(t?a/100:a,0,1)}function Lr(a,t,r){return Math.min(Math.max(t,a),r)}function bn(a){return!a.some(Number.isNaN)}const No={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function Nr(a,t,r){return a+r*(t-a)}function Cl(a,t,r){return a.map(((u,p)=>Nr(u,t[p],r)))}class dn{constructor(t,r,u,p=1,x=!0){this.r=t,this.g=r,this.b=u,this.a=p,x||(this.r*=p,this.g*=p,this.b*=p,p||this.overwriteGetter("rgb",[t,r,u,p]))}static parse(t){if(t instanceof dn)return t;if(typeof t!="string")return;const r=(function(u){if((u=u.toLowerCase().trim())==="transparent")return[0,0,0,0];const p=wc(No,u);if(p){const[b,T,M]=p;return[b/255,T/255,M/255,1]}if(u.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(u)){const b=u.length<6?1:2;let T=1;return[As(u.slice(T,T+=b)),As(u.slice(T,T+=b)),As(u.slice(T,T+=b)),As(u.slice(T,T+b)||"ff")]}if(u.startsWith("rgb")){const b=u.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(b){const[T,M,I,z,F,j,G,H,J,ne,le,Ae]=b,pe=[z||" ",G||" ",ne].join("");if(pe===" "||pe===" /"||pe===",,"||pe===",,,"){const ve=[I,j,J].join(""),Fe=ve==="%%%"?100:ve===""?255:0;if(Fe){const qe=[Lr(+M/Fe,0,1),Lr(+F/Fe,0,1),Lr(+H/Fe,0,1),le?Wd(+le,Ae):1];if(bn(qe))return qe}}return}}const x=u.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(x){const[b,T,M,I,z,F,j,G,H]=x,J=[M||" ",z||" ",j].join("");if(J===" "||J===" /"||J===",,"||J===",,,"){const ne=[+T,Lr(+I,0,100),Lr(+F,0,100),G?Wd(+G,H):1];if(bn(ne))return(function([le,Ae,pe,ve]){function Fe(qe){const it=(qe+le/30)%12,bt=Ae*Math.min(pe,1-pe);return pe-bt*Math.max(-1,Math.min(it-3,9-it,1))}return le=fu(le),Ae/=100,pe/=100,[Fe(0),Fe(8),Fe(4),ve]})(ne)}}})(t);return r?new dn(...r,!1):void 0}get rgb(){const{r:t,g:r,b:u,a:p}=this,x=p||1/0;return this.overwriteGetter("rgb",[t/x,r/x,u/x,p])}get hcl(){return this.overwriteGetter("hcl",(function(t){const[r,u,p,x]=Yd(t),b=Math.sqrt(u*u+p*p);return[Math.round(1e4*b)?fu(Math.atan2(p,u)*Ap):NaN,b,r,x]})(this.rgb))}get lab(){return this.overwriteGetter("lab",Yd(this.rgb))}overwriteGetter(t,r){return Object.defineProperty(this,t,{value:r}),r}toString(){const[t,r,u,p]=this.rgb;return`rgba(${[t,r,u].map((x=>Math.round(255*x))).join(",")},${p})`}static interpolate(t,r,u,p="rgb"){switch(p){case"rgb":{const[x,b,T,M]=Cl(t.rgb,r.rgb,u);return new dn(x,b,T,M,!1)}case"hcl":{const[x,b,T,M]=t.hcl,[I,z,F,j]=r.hcl;let G,H;if(isNaN(x)||isNaN(I))isNaN(x)?isNaN(I)?G=NaN:(G=I,T!==1&&T!==0||(H=z)):(G=x,F!==1&&F!==0||(H=b));else{let pe=I-x;I>x&&pe>180?pe-=360:I<x&&x-I>180&&(pe+=360),G=x+u*pe}const[J,ne,le,Ae]=(function([pe,ve,Fe,qe]){return pe=isNaN(pe)?0:pe*Xd,Qd([Fe,Math.cos(pe)*ve,Math.sin(pe)*ve,qe])})([G,H??Nr(b,z,u),Nr(T,F,u),Nr(M,j,u)]);return new dn(J,ne,le,Ae,!1)}case"lab":{const[x,b,T,M]=Qd(Cl(t.lab,r.lab,u));return new dn(x,b,T,M,!1)}}}}dn.black=new dn(0,0,0,1),dn.white=new dn(1,1,1,1),dn.transparent=new dn(0,0,0,0),dn.red=new dn(1,0,0,1);class da{constructor(t,r,u){this.sensitivity=t?r?"variant":"case":r?"accent":"base",this.locale=u,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,r){return this.collator.compare(t,r)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}const Tl=["bottom","center","top"];class Uo{constructor(t,r,u,p,x,b){this.text=t,this.image=r,this.scale=u,this.fontStack=p,this.textColor=x,this.verticalAlign=b}}class er{constructor(t){this.sections=t}static fromString(t){return new er([new Uo(t,null,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some((t=>t.text.length!==0||t.image&&t.image.name.length!==0))}static factory(t){return t instanceof er?t:er.fromString(t)}toString(){return this.sections.length===0?"":this.sections.map((t=>t.text)).join("")}}class Ri{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Ri)return t;if(typeof t=="number")return new Ri([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(const r of t)if(typeof r!="number")return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]]}return new Ri(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,r,u){return new Ri(Cl(t.values,r.values,u))}}class tr{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof tr)return t;if(typeof t=="number")return new tr([t]);if(Array.isArray(t)){for(const r of t)if(typeof r!="number")return;return new tr(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,r,u){return new tr(Cl(t.values,r.values,u))}}class nr{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof nr)return t;if(typeof t=="string"){const u=dn.parse(t);return u?new nr([u]):void 0}if(!Array.isArray(t))return;const r=[];for(const u of t){if(typeof u!="string")return;const p=dn.parse(u);if(!p)return;r.push(p)}return new nr(r)}toString(){return JSON.stringify(this.values)}static interpolate(t,r,u,p="rgb"){const x=[];if(t.values.length!=r.values.length)throw new Error(`colorArray: Arrays have mismatched length (${t.values.length} vs. ${r.values.length}), cannot interpolate.`);for(let b=0;b<t.values.length;b++)x.push(dn.interpolate(t.values[b],r.values[b],u,p));return new nr(x)}}class oi extends Error{constructor(t){super(t),this.name="RuntimeError"}toJSON(){return this.message}}const Ls=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Li{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Li)return t;if(Array.isArray(t)&&!(t.length<1)&&t.length%2==0){for(let r=0;r<t.length;r+=2){const u=t[r],p=t[r+1];if(typeof u!="string"||!Ls.has(u)||!Array.isArray(p)||p.length!==2||typeof p[0]!="number"||typeof p[1]!="number")return}return new Li(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,r,u){const p=t.values,x=r.values;if(p.length!==x.length)throw new oi(`Cannot interpolate values of different length. from: ${t.toString()}, to: ${r.toString()}`);const b=[];for(let T=0;T<p.length;T+=2){if(p[T]!==x[T])throw new oi(`Cannot interpolate values containing mismatched anchors. from[${T}]: ${p[T]}, to[${T}]: ${x[T]}`);b.push(p[T]);const[M,I]=p[T+1],[z,F]=x[T+1];b.push([Nr(M,z,u),Nr(I,F,u)])}return new Li(b)}}class Ur{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new Ur({name:t,available:!1}):null}}class dr{constructor(t,r,u){this.from=t,this.to=r,this.transition=u}static interpolate(t,r,u){return new dr(t,r,u)}static parse(t){return t instanceof dr?t:Array.isArray(t)&&t.length===3&&typeof t[0]=="string"&&typeof t[1]=="string"&&typeof t[2]=="number"?new dr(t[0],t[1],t[2]):typeof t=="object"&&typeof t.from=="string"&&typeof t.to=="string"&&typeof t.transition=="number"?new dr(t.from,t.to,t.transition):typeof t=="string"?new dr(t,t,1):void 0}}function Na(a,t,r,u){return typeof a=="number"&&a>=0&&a<=255&&typeof t=="number"&&t>=0&&t<=255&&typeof r=="number"&&r>=0&&r<=255?u===void 0||typeof u=="number"&&u>=0&&u<=1?null:`Invalid rgba value [${[a,t,r,u].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof u=="number"?[a,t,r,u]:[a,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Zn(a){if(a===null||typeof a=="string"||typeof a=="boolean"||typeof a=="number"||a instanceof dr||a instanceof dn||a instanceof da||a instanceof er||a instanceof Ri||a instanceof tr||a instanceof nr||a instanceof Li||a instanceof Ur)return!0;if(Array.isArray(a)){for(const t of a)if(!Zn(t))return!1;return!0}if(typeof a=="object"){for(const t in a)if(!Zn(a[t]))return!1;return!0}return!1}function pi(a){if(a===null)return An;if(typeof a=="string")return on;if(typeof a=="boolean")return cn;if(typeof a=="number")return ut;if(a instanceof dn)return ha;if(a instanceof dr)return Cs;if(a instanceof da)return ko;if(a instanceof er)return Ts;if(a instanceof Ri)return Fa;if(a instanceof tr)return Qr;if(a instanceof nr)return Xs;if(a instanceof Li)return Pi;if(a instanceof Ur)return bi;if(Array.isArray(a)){const t=a.length;let r;for(const u of a){const p=pi(u);if(r){if(r===p)continue;r=rn;break}r=p}return Wr(r||rn,t)}return rs}function gn(a){const t=typeof a;return a===null?"":t==="string"||t==="number"||t==="boolean"?String(a):a instanceof dn||a instanceof dr||a instanceof er||a instanceof Ri||a instanceof tr||a instanceof nr||a instanceof Li||a instanceof Ur?a.toString():JSON.stringify(a)}class Yt{constructor(t,r){this.type=t,this.value=r}static parse(t,r){if(t.length!==2)return r.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!Zn(t[1]))return r.error("invalid value");const u=t[1];let p=pi(u);const x=r.expectedType;return p.kind!=="array"||p.N!==0||!x||x.kind!=="array"||typeof x.N=="number"&&x.N!==0||(p=x),new Yt(p,u)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}const Ws={string:on,number:ut,boolean:cn,object:rs};class un{constructor(t,r){this.type=t,this.args=r}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let u,p=1;const x=t[0];if(x==="array"){let T,M;if(t.length>2){const I=t[1];if(typeof I!="string"||!(I in Ws)||I==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);T=Ws[I],p++}else T=rn;if(t.length>3){if(t[2]!==null&&(typeof t[2]!="number"||t[2]<0||t[2]!==Math.floor(t[2])))return r.error('The length argument to "array" must be a positive integer literal',2);M=t[2],p++}u=Wr(T,M)}else{if(!Ws[x])throw new Error(`Types doesn't contain name = ${x}`);u=Ws[x]}const b=[];for(;p<t.length;p++){const T=r.parse(t[p],p,rn);if(!T)return null;b.push(T)}return new un(u,b)}evaluate(t){for(let r=0;r<this.args.length;r++){const u=this.args[r].evaluate(t);if(!xc(this.type,pi(u)))return u;if(r===this.args.length-1)throw new oi(`Expected value to be of type ${jn(this.type)}, but found ${jn(pi(u))} instead.`)}throw new Error}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}}const wr={"to-boolean":cn,"to-color":ha,"to-number":ut,"to-string":on};class Ii{constructor(t,r){this.type=t,this.args=r}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");const u=t[0];if(!wr[u])throw new Error(`Can't parse ${u} as it is not part of the known types`);if((u==="to-boolean"||u==="to-string")&&t.length!==2)return r.error("Expected one argument.");const p=wr[u],x=[];for(let b=1;b<t.length;b++){const T=r.parse(t[b],b,rn);if(!T)return null;x.push(T)}return new Ii(p,x)}evaluate(t){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(t);case"color":{let r,u;for(const p of this.args){if(r=p.evaluate(t),u=null,r instanceof dn)return r;if(typeof r=="string"){const x=t.parseColor(r);if(x)return x}else if(Array.isArray(r)&&(u=r.length<3||r.length>4?`Invalid rgba value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:Na(r[0],r[1],r[2],r[3]),!u))return new dn(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new oi(u||`Could not parse color from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"padding":{let r;for(const u of this.args){r=u.evaluate(t);const p=Ri.parse(r);if(p)return p}throw new oi(`Could not parse padding from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"numberArray":{let r;for(const u of this.args){r=u.evaluate(t);const p=tr.parse(r);if(p)return p}throw new oi(`Could not parse numberArray from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"colorArray":{let r;for(const u of this.args){r=u.evaluate(t);const p=nr.parse(r);if(p)return p}throw new oi(`Could not parse colorArray from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"variableAnchorOffsetCollection":{let r;for(const u of this.args){r=u.evaluate(t);const p=Li.parse(r);if(p)return p}throw new oi(`Could not parse variableAnchorOffsetCollection from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"number":{let r=null;for(const u of this.args){if(r=u.evaluate(t),r===null)return 0;const p=Number(r);if(!isNaN(p))return p}throw new oi(`Could not convert ${JSON.stringify(r)} to number.`)}case"formatted":return er.fromString(gn(this.args[0].evaluate(t)));case"resolvedImage":return Ur.fromString(gn(this.args[0].evaluate(t)));case"projectionDefinition":return this.args[0].evaluate(t);default:return gn(this.args[0].evaluate(t))}}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}}const Sc=["Unknown","Point","LineString","Polygon"];class Ks{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,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"?Sc[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(t){let r=this._parseColorCache.get(t);return r||(r=dn.parse(t),this._parseColorCache.set(t,r)),r}}class mu{constructor(t,r,u=[],p,x=new qi,b=[]){this.registry=t,this.path=u,this.key=u.map((T=>`[${T}]`)).join(""),this.scope=x,this.errors=b,this.expectedType=p,this._isConstant=r}parse(t,r,u,p,x={}){return r?this.concat(r,u,p)._parse(t,x):this._parse(t,x)}_parse(t,r){function u(p,x,b){return b==="assert"?new un(x,[p]):b==="coerce"?new Ii(x,[p]):p}if(t!==null&&typeof t!="string"&&typeof t!="boolean"&&typeof t!="number"||(t=["literal",t]),Array.isArray(t)){if(t.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const p=t[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;const x=this.registry[p];if(x){let b=x.parse(t,this);if(!b)return null;if(this.expectedType){const T=this.expectedType,M=b.type;if(T.kind!=="string"&&T.kind!=="number"&&T.kind!=="boolean"&&T.kind!=="object"&&T.kind!=="array"||M.kind!=="value"){if(T.kind==="projectionDefinition"&&["string","array"].includes(M.kind)||["color","formatted","resolvedImage"].includes(T.kind)&&["value","string"].includes(M.kind)||["padding","numberArray"].includes(T.kind)&&["value","number","array"].includes(M.kind)||T.kind==="colorArray"&&["value","string","array"].includes(M.kind)||T.kind==="variableAnchorOffsetCollection"&&["value","array"].includes(M.kind))b=u(b,T,r.typeAnnotation||"coerce");else if(this.checkSubtype(T,M))return null}else b=u(b,T,r.typeAnnotation||"assert")}if(!(b instanceof Yt)&&b.type.kind!=="resolvedImage"&&this._isConstant(b)){const T=new Ks;try{b=new Yt(b.type,b.evaluate(T))}catch(M){return this.error(M.message),null}}return b}return this.error(`Unknown expression "${p}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(t===void 0?"'undefined' value invalid. Use null instead.":typeof t=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof t} instead.`)}concat(t,r,u){const p=typeof t=="number"?this.path.concat(t):this.path,x=u?this.scope.concat(u):this.scope;return new mu(this.registry,this._isConstant,p,r||null,x,this.errors)}error(t,...r){const u=`${this.key}${r.map((p=>`[${p}]`)).join("")}`;this.errors.push(new Yr(u,t))}checkSubtype(t,r){const u=xc(t,r);return u&&this.error(u),u}}class $o{constructor(t,r){this.type=r.type,this.bindings=[].concat(t),this.result=r}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const r of this.bindings)t(r[1]);t(this.result)}static parse(t,r){if(t.length<4)return r.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const u=[];for(let x=1;x<t.length-1;x+=2){const b=t[x];if(typeof b!="string")return r.error(`Expected string, but found ${typeof b} instead.`,x);if(/[^a-zA-Z0-9_]/.test(b))return r.error("Variable names must contain only alphanumeric characters or '_'.",x);const T=r.parse(t[x+1],x+1);if(!T)return null;u.push([b,T])}const p=r.parse(t[t.length-1],t.length-1,r.expectedType,u);return p?new $o(u,p):null}outputDefined(){return this.result.outputDefined()}}class El{constructor(t,r){this.type=r.type,this.name=t,this.boundExpression=r}static parse(t,r){if(t.length!==2||typeof t[1]!="string")return r.error("'var' expression requires exactly one string literal argument.");const u=t[1];return r.scope.has(u)?new El(u,r.scope.get(u)):r.error(`Unknown variable "${u}". Make sure "${u}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}}class Ml{constructor(t,r,u){this.type=t,this.index=r,this.input=u}static parse(t,r){if(t.length!==3)return r.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const u=r.parse(t[1],1,ut),p=r.parse(t[2],2,Wr(r.expectedType||rn));return u&&p?new Ml(p.type.itemType,u,p):null}evaluate(t){const r=this.index.evaluate(t),u=this.input.evaluate(t);if(r<0)throw new oi(`Array index out of bounds: ${r} < 0.`);if(r>=u.length)throw new oi(`Array index out of bounds: ${r} > ${u.length-1}.`);if(r!==Math.floor(r))throw new oi(`Array index must be an integer, but found ${r} instead.`);return u[r]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}}class Al{constructor(t,r){this.type=cn,this.needle=t,this.haystack=r}static parse(t,r){if(t.length!==3)return r.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const u=r.parse(t[1],1,rn),p=r.parse(t[2],2,rn);return u&&p?Mh(u.type,[cn,on,ut,An,rn])?new Al(u,p):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${jn(u.type)} instead`):null}evaluate(t){const r=this.needle.evaluate(t),u=this.haystack.evaluate(t);if(!u)return!1;if(!Bo(r,["boolean","string","number","null"]))throw new oi(`Expected first argument to be of type boolean, string, number or null, but found ${jn(pi(r))} instead.`);if(!Bo(u,["string","array"]))throw new oi(`Expected second argument to be of type array or string, but found ${jn(pi(u))} instead.`);return u.indexOf(r)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}}class Cc{constructor(t,r,u){this.type=ut,this.needle=t,this.haystack=r,this.fromIndex=u}static parse(t,r){if(t.length<=2||t.length>=5)return r.error(`Expected 2 or 3 arguments, but found ${t.length-1} instead.`);const u=r.parse(t[1],1,rn),p=r.parse(t[2],2,rn);if(!u||!p)return null;if(!Mh(u.type,[cn,on,ut,An,rn]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${jn(u.type)} instead`);if(t.length===4){const x=r.parse(t[3],3,ut);return x?new Cc(u,p,x):null}return new Cc(u,p)}evaluate(t){const r=this.needle.evaluate(t),u=this.haystack.evaluate(t);if(!Bo(r,["boolean","string","number","null"]))throw new oi(`Expected first argument to be of type boolean, string, number or null, but found ${jn(pi(r))} instead.`);let p;if(this.fromIndex&&(p=this.fromIndex.evaluate(t)),Bo(u,["string"])){const x=u.indexOf(r,p);return x===-1?-1:[...u.slice(0,x)].length}if(Bo(u,["array"]))return u.indexOf(r,p);throw new oi(`Expected second argument to be of type array or string, but found ${jn(pi(u))} instead.`)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}}class Ps{constructor(t,r,u,p,x,b){this.inputType=t,this.type=r,this.input=u,this.cases=p,this.outputs=x,this.otherwise=b}static parse(t,r){if(t.length<5)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return r.error("Expected an even number of arguments.");let u,p;r.expectedType&&r.expectedType.kind!=="value"&&(p=r.expectedType);const x={},b=[];for(let I=2;I<t.length-1;I+=2){let z=t[I];const F=t[I+1];Array.isArray(z)||(z=[z]);const j=r.concat(I);if(z.length===0)return j.error("Expected at least one branch label.");for(const H of z){if(typeof H!="number"&&typeof H!="string")return j.error("Branch labels must be numbers or strings.");if(typeof H=="number"&&Math.abs(H)>Number.MAX_SAFE_INTEGER)return j.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof H=="number"&&Math.floor(H)!==H)return j.error("Numeric branch labels must be integer values.");if(u){if(j.checkSubtype(u,pi(H)))return null}else u=pi(H);if(x[String(H)]!==void 0)return j.error("Branch labels must be unique.");x[String(H)]=b.length}const G=r.parse(F,I,p);if(!G)return null;p=p||G.type,b.push(G)}const T=r.parse(t[1],1,rn);if(!T)return null;const M=r.parse(t[t.length-1],t.length-1,p);return M?T.type.kind!=="value"&&r.concat(1).checkSubtype(u,T.type)?null:new Ps(u,p,T,x,b,M):null}evaluate(t){const r=this.input.evaluate(t);return(pi(r)===this.inputType&&this.outputs[this.cases[r]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))&&this.otherwise.outputDefined()}}class fr{constructor(t,r,u){this.type=t,this.branches=r,this.otherwise=u}static parse(t,r){if(t.length<4)return r.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return r.error("Expected an odd number of arguments.");let u;r.expectedType&&r.expectedType.kind!=="value"&&(u=r.expectedType);const p=[];for(let b=1;b<t.length-1;b+=2){const T=r.parse(t[b],b,cn);if(!T)return null;const M=r.parse(t[b+1],b+1,u);if(!M)return null;p.push([T,M]),u=u||M.type}const x=r.parse(t[t.length-1],t.length-1,u);if(!x)return null;if(!u)throw new Error("Can't infer output type");return new fr(u,p,x)}evaluate(t){for(const[r,u]of this.branches)if(r.evaluate(t))return u.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(const[r,u]of this.branches)t(r),t(u);t(this.otherwise)}outputDefined(){return this.branches.every((([t,r])=>r.outputDefined()))&&this.otherwise.outputDefined()}}class Ll{constructor(t,r,u,p){this.type=t,this.input=r,this.beginIndex=u,this.endIndex=p}static parse(t,r){if(t.length<=2||t.length>=5)return r.error(`Expected 2 or 3 arguments, but found ${t.length-1} instead.`);const u=r.parse(t[1],1,rn),p=r.parse(t[2],2,ut);if(!u||!p)return null;if(!Mh(u.type,[Wr(rn),on,rn]))return r.error(`Expected first argument to be of type array or string, but found ${jn(u.type)} instead`);if(t.length===4){const x=r.parse(t[3],3,ut);return x?new Ll(u.type,u,p,x):null}return new Ll(u.type,u,p)}evaluate(t){const r=this.input.evaluate(t),u=this.beginIndex.evaluate(t);let p;if(this.endIndex&&(p=this.endIndex.evaluate(t)),Bo(r,["string"]))return[...r].slice(u,p).join("");if(Bo(r,["array"]))return r.slice(u,p);throw new oi(`Expected first argument to be of type array or string, but found ${jn(pi(r))} instead.`)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}}function Pl(a,t){const r=a.length-1;let u,p,x=0,b=r,T=0;for(;x<=b;)if(T=Math.floor((x+b)/2),u=a[T],p=a[T+1],u<=t){if(T===r||t<p)return T;x=T+1}else{if(!(u>t))throw new oi("Input is not a number.");b=T-1}return 0}class Vo{constructor(t,r,u){this.type=t,this.input=r,this.labels=[],this.outputs=[];for(const[p,x]of u)this.labels.push(p),this.outputs.push(x)}static parse(t,r){if(t.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return r.error("Expected an even number of arguments.");const u=r.parse(t[1],1,ut);if(!u)return null;const p=[];let x=null;r.expectedType&&r.expectedType.kind!=="value"&&(x=r.expectedType);for(let b=1;b<t.length;b+=2){const T=b===1?-1/0:t[b],M=t[b+1],I=b,z=b+1;if(typeof T!="number")return r.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',I);if(p.length&&p[p.length-1][0]>=T)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',I);const F=r.parse(M,z,x);if(!F)return null;x=x||F.type,p.push([T,F])}return new Vo(x,u,p)}evaluate(t){const r=this.labels,u=this.outputs;if(r.length===1)return u[0].evaluate(t);const p=this.input.evaluate(t);if(p<=r[0])return u[0].evaluate(t);const x=r.length;return p>=r[x-1]?u[x-1].evaluate(t):u[Pl(r,p)].evaluate(t)}eachChild(t){t(this.input);for(const r of this.outputs)t(r)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}}function pr(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var Ah,Lh,Pp=(function(){if(Lh)return Ah;function a(t,r,u,p){this.cx=3*t,this.bx=3*(u-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*r,this.by=3*(p-r)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=r,this.p2x=u,this.p2y=p}return Lh=1,Ah=a,a.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,r){if(r===void 0&&(r=1e-6),t<0)return 0;if(t>1)return 1;for(var u=t,p=0;p<8;p++){var x=this.sampleCurveX(u)-t;if(Math.abs(x)<r)return u;var b=this.sampleCurveDerivativeX(u);if(Math.abs(b)<1e-6)break;u-=x/b}var T=0,M=1;for(u=t,p=0;p<20&&(x=this.sampleCurveX(u),!(Math.abs(x-t)<r));p++)t>x?T=u:M=u,u=.5*(M-T)+T;return u},solve:function(t,r){return this.sampleCurveY(this.solveCurveX(t,r))}},Ah})(),Rp=pr(Pp);class ir{constructor(t,r,u,p,x){this.type=t,this.operator=r,this.interpolation=u,this.input=p,this.labels=[],this.outputs=[];for(const[b,T]of x)this.labels.push(b),this.outputs.push(T)}static interpolationFactor(t,r,u,p){let x=0;if(t.name==="exponential")x=Tc(r,t.base,u,p);else if(t.name==="linear")x=Tc(r,1,u,p);else if(t.name==="cubic-bezier"){const b=t.controlPoints;x=new Rp(b[0],b[1],b[2],b[3]).solve(Tc(r,1,u,p))}return x}static parse(t,r){let[u,p,x,...b]=t;if(!Array.isArray(p)||p.length===0)return r.error("Expected an interpolation type expression.",1);if(p[0]==="linear")p={name:"linear"};else if(p[0]==="exponential"){const I=p[1];if(typeof I!="number")return r.error("Exponential interpolation requires a numeric base.",1,1);p={name:"exponential",base:I}}else{if(p[0]!=="cubic-bezier")return r.error(`Unknown interpolation type ${String(p[0])}`,1,0);{const I=p.slice(1);if(I.length!==4||I.some((z=>typeof z!="number"||z<0||z>1)))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);p={name:"cubic-bezier",controlPoints:I}}}if(t.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(x=r.parse(x,2,ut),!x)return null;const T=[];let M=null;u!=="interpolate-hcl"&&u!=="interpolate-lab"||r.expectedType==Xs?r.expectedType&&r.expectedType.kind!=="value"&&(M=r.expectedType):M=ha;for(let I=0;I<b.length;I+=2){const z=b[I],F=b[I+1],j=I+3,G=I+4;if(typeof z!="number")return r.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',j);if(T.length&&T[T.length-1][0]>=z)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',j);const H=r.parse(F,G,M);if(!H)return null;M=M||H.type,T.push([z,H])}return Ys(M,ut)||Ys(M,Cs)||Ys(M,ha)||Ys(M,Fa)||Ys(M,Qr)||Ys(M,Xs)||Ys(M,Pi)||Ys(M,Wr(ut))?new ir(M,u,p,x,T):r.error(`Type ${jn(M)} is not interpolatable.`)}evaluate(t){const r=this.labels,u=this.outputs;if(r.length===1)return u[0].evaluate(t);const p=this.input.evaluate(t);if(p<=r[0])return u[0].evaluate(t);const x=r.length;if(p>=r[x-1])return u[x-1].evaluate(t);const b=Pl(r,p),T=ir.interpolationFactor(this.interpolation,p,r[b],r[b+1]),M=u[b].evaluate(t),I=u[b+1].evaluate(t);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return Nr(M,I,T);case"color":return dn.interpolate(M,I,T);case"padding":return Ri.interpolate(M,I,T);case"colorArray":return nr.interpolate(M,I,T);case"numberArray":return tr.interpolate(M,I,T);case"variableAnchorOffsetCollection":return Li.interpolate(M,I,T);case"array":return Cl(M,I,T);case"projectionDefinition":return dr.interpolate(M,I,T)}case"interpolate-hcl":switch(this.type.kind){case"color":return dn.interpolate(M,I,T,"hcl");case"colorArray":return nr.interpolate(M,I,T,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return dn.interpolate(M,I,T,"lab");case"colorArray":return nr.interpolate(M,I,T,"lab")}}}eachChild(t){t(this.input);for(const r of this.outputs)t(r)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}}function Tc(a,t,r,u){const p=u-r,x=a-r;return p===0?0:t===1?x/p:(Math.pow(t,x)-1)/(Math.pow(t,p)-1)}const Ua={color:dn.interpolate,number:Nr,padding:Ri.interpolate,numberArray:tr.interpolate,colorArray:nr.interpolate,variableAnchorOffsetCollection:Li.interpolate,array:Cl};class Ph{constructor(t,r){this.type=t,this.args=r}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let u=null;const p=r.expectedType;p&&p.kind!=="value"&&(u=p);const x=[];for(const T of t.slice(1)){const M=r.parse(T,1+x.length,u,void 0,{typeAnnotation:"omit"});if(!M)return null;u=u||M.type,x.push(M)}if(!u)throw new Error("No output type");const b=p&&x.some((T=>xc(p,T.type)));return new Ph(b?rn:u,x)}evaluate(t){let r,u=null,p=0;for(const x of this.args)if(p++,u=x.evaluate(t),u&&u instanceof Ur&&!u.available&&(r||(r=u.name),u=null,p===this.args.length&&(u=r)),u!==null)break;return u}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}}function gu(a,t){return a==="=="||a==="!="?t.kind==="boolean"||t.kind==="string"||t.kind==="number"||t.kind==="null"||t.kind==="value":t.kind==="string"||t.kind==="number"||t.kind==="value"}function yu(a,t,r,u){return u.compare(t,r)===0}function Js(a,t,r){const u=a!=="=="&&a!=="!=";return class sx{constructor(x,b,T){this.type=cn,this.lhs=x,this.rhs=b,this.collator=T,this.hasUntypedArgument=x.type.kind==="value"||b.type.kind==="value"}static parse(x,b){if(x.length!==3&&x.length!==4)return b.error("Expected two or three arguments.");const T=x[0];let M=b.parse(x[1],1,rn);if(!M)return null;if(!gu(T,M.type))return b.concat(1).error(`"${T}" comparisons are not supported for type '${jn(M.type)}'.`);let I=b.parse(x[2],2,rn);if(!I)return null;if(!gu(T,I.type))return b.concat(2).error(`"${T}" comparisons are not supported for type '${jn(I.type)}'.`);if(M.type.kind!==I.type.kind&&M.type.kind!=="value"&&I.type.kind!=="value")return b.error(`Cannot compare types '${jn(M.type)}' and '${jn(I.type)}'.`);u&&(M.type.kind==="value"&&I.type.kind!=="value"?M=new un(I.type,[M]):M.type.kind!=="value"&&I.type.kind==="value"&&(I=new un(M.type,[I])));let z=null;if(x.length===4){if(M.type.kind!=="string"&&I.type.kind!=="string"&&M.type.kind!=="value"&&I.type.kind!=="value")return b.error("Cannot use collator to compare non-string types.");if(z=b.parse(x[3],3,ko),!z)return null}return new sx(M,I,z)}evaluate(x){const b=this.lhs.evaluate(x),T=this.rhs.evaluate(x);if(u&&this.hasUntypedArgument){const M=pi(b),I=pi(T);if(M.kind!==I.kind||M.kind!=="string"&&M.kind!=="number")throw new oi(`Expected arguments for "${a}" to be (string, string) or (number, number), but found (${M.kind}, ${I.kind}) instead.`)}if(this.collator&&!u&&this.hasUntypedArgument){const M=pi(b),I=pi(T);if(M.kind!=="string"||I.kind!=="string")return t(x,b,T)}return this.collator?r(x,b,T,this.collator.evaluate(x)):t(x,b,T)}eachChild(x){x(this.lhs),x(this.rhs),this.collator&&x(this.collator)}outputDefined(){return!0}}}const as=Js("==",(function(a,t,r){return t===r}),yu),Kd=Js("!=",(function(a,t,r){return t!==r}),(function(a,t,r,u){return!yu(0,t,r,u)})),Rh=Js("<",(function(a,t,r){return t<r}),(function(a,t,r,u){return u.compare(t,r)<0})),mm=Js(">",(function(a,t,r){return t>r}),(function(a,t,r,u){return u.compare(t,r)>0})),Jd=Js("<=",(function(a,t,r){return t<=r}),(function(a,t,r,u){return u.compare(t,r)<=0})),gm=Js(">=",(function(a,t,r){return t>=r}),(function(a,t,r,u){return u.compare(t,r)>=0}));class Ih{constructor(t,r,u){this.type=ko,this.locale=u,this.caseSensitive=t,this.diacriticSensitive=r}static parse(t,r){if(t.length!==2)return r.error("Expected one argument.");const u=t[1];if(typeof u!="object"||Array.isArray(u))return r.error("Collator options argument must be an object.");const p=r.parse(u["case-sensitive"]!==void 0&&u["case-sensitive"],1,cn);if(!p)return null;const x=r.parse(u["diacritic-sensitive"]!==void 0&&u["diacritic-sensitive"],1,cn);if(!x)return null;let b=null;return u.locale&&(b=r.parse(u.locale,1,on),!b)?null:new Ih(p,x,b)}evaluate(t){return new da(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}}class ef{constructor(t,r,u,p,x){this.type=on,this.number=t,this.locale=r,this.currency=u,this.minFractionDigits=p,this.maxFractionDigits=x}static parse(t,r){if(t.length!==3)return r.error("Expected two arguments.");const u=r.parse(t[1],1,ut);if(!u)return null;const p=t[2];if(typeof p!="object"||Array.isArray(p))return r.error("NumberFormat options argument must be an object.");let x=null;if(p.locale&&(x=r.parse(p.locale,1,on),!x))return null;let b=null;if(p.currency&&(b=r.parse(p.currency,1,on),!b))return null;let T=null;if(p["min-fraction-digits"]&&(T=r.parse(p["min-fraction-digits"],1,ut),!T))return null;let M=null;return p["max-fraction-digits"]&&(M=r.parse(p["max-fraction-digits"],1,ut),!M)?null:new ef(u,x,b,T,M)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}}class zh{constructor(t){this.type=Ts,this.sections=t}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");const u=t[1];if(!Array.isArray(u)&&typeof u=="object")return r.error("First argument must be an image or text section.");const p=[];let x=!1;for(let b=1;b<=t.length-1;++b){const T=t[b];if(x&&typeof T=="object"&&!Array.isArray(T)){x=!1;let M=null;if(T["font-scale"]&&(M=r.parse(T["font-scale"],1,ut),!M))return null;let I=null;if(T["text-font"]&&(I=r.parse(T["text-font"],1,Wr(on)),!I))return null;let z=null;if(T["text-color"]&&(z=r.parse(T["text-color"],1,ha),!z))return null;let F=null;if(T["vertical-align"]){if(typeof T["vertical-align"]=="string"&&!Tl.includes(T["vertical-align"]))return r.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${T["vertical-align"]}' instead.`);if(F=r.parse(T["vertical-align"],1,on),!F)return null}const j=p[p.length-1];j.scale=M,j.font=I,j.textColor=z,j.verticalAlign=F}else{const M=r.parse(t[b],1,rn);if(!M)return null;const I=M.type.kind;if(I!=="string"&&I!=="value"&&I!=="null"&&I!=="resolvedImage")return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");x=!0,p.push({content:M,scale:null,font:null,textColor:null,verticalAlign:null})}}return new zh(p)}evaluate(t){return new er(this.sections.map((r=>{const u=r.content.evaluate(t);return pi(u)===bi?new Uo("",u,null,null,null,r.verticalAlign?r.verticalAlign.evaluate(t):null):new Uo(gn(u),null,r.scale?r.scale.evaluate(t):null,r.font?r.font.evaluate(t).join(","):null,r.textColor?r.textColor.evaluate(t):null,r.verticalAlign?r.verticalAlign.evaluate(t):null)})))}eachChild(t){for(const r of this.sections)t(r.content),r.scale&&t(r.scale),r.font&&t(r.font),r.textColor&&t(r.textColor),r.verticalAlign&&t(r.verticalAlign)}outputDefined(){return!1}}class Ec{constructor(t){this.type=bi,this.input=t}static parse(t,r){if(t.length!==2)return r.error("Expected two arguments.");const u=r.parse(t[1],1,on);return u?new Ec(u):r.error("No image name provided.")}evaluate(t){const r=this.input.evaluate(t),u=Ur.fromString(r);return u&&t.availableImages&&(u.available=t.availableImages.indexOf(r)>-1),u}eachChild(t){t(this.input)}outputDefined(){return!1}}class tf{constructor(t){this.type=ut,this.input=t}static parse(t,r){if(t.length!==2)return r.error(`Expected 1 argument, but found ${t.length-1} instead.`);const u=r.parse(t[1],1);return u?u.type.kind!=="array"&&u.type.kind!=="string"&&u.type.kind!=="value"?r.error(`Expected argument of type string or array, but found ${jn(u.type)} instead.`):new tf(u):null}evaluate(t){const r=this.input.evaluate(t);if(typeof r=="string")return[...r].length;if(Array.isArray(r))return r.length;throw new oi(`Expected value to be of type string or array, but found ${jn(pi(r))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}}const fa=8192;function Mc(a,t){const r=(180+a[0])/360,u=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+a[1]*Math.PI/360)))/360,p=Math.pow(2,t.z);return[Math.round(r*p*fa),Math.round(u*p*fa)]}function nf(a,t){const r=Math.pow(2,t.z);return[(p=(a[0]/fa+t.x)/r,360*p-180),(u=(a[1]/fa+t.y)/r,360/Math.PI*Math.atan(Math.exp((180-360*u)*Math.PI/180))-90)];var u,p}function Rl(a,t){a[0]=Math.min(a[0],t[0]),a[1]=Math.min(a[1],t[1]),a[2]=Math.max(a[2],t[0]),a[3]=Math.max(a[3],t[1])}function Ac(a,t){return!(a[0]<=t[0]||a[2]>=t[2]||a[1]<=t[1]||a[3]>=t[3])}function Ip(a,t,r){const u=a[0]-t[0],p=a[1]-t[1],x=a[0]-r[0],b=a[1]-r[1];return u*b-x*p==0&&u*x<=0&&p*b<=0}function _u(a,t,r,u){return(p=[u[0]-r[0],u[1]-r[1]])[0]*(x=[t[0]-a[0],t[1]-a[1]])[1]-p[1]*x[0]!=0&&!(!af(a,t,r,u)||!af(r,u,a,t));var p,x}function zp(a,t,r){for(const u of r)for(let p=0;p<u.length-1;++p)if(_u(a,t,u[p],u[p+1]))return!0;return!1}function ss(a,t,r=!1){let u=!1;for(const T of t)for(let M=0;M<T.length-1;M++){if(Ip(a,T[M],T[M+1]))return r;(x=T[M])[1]>(p=a)[1]!=(b=T[M+1])[1]>p[1]&&p[0]<(b[0]-x[0])*(p[1]-x[1])/(b[1]-x[1])+x[0]&&(u=!u)}var p,x,b;return u}function Dp(a,t){for(const r of t)if(ss(a,r))return!0;return!1}function rf(a,t){for(const r of a)if(!ss(r,t))return!1;for(let r=0;r<a.length-1;++r)if(zp(a[r],a[r+1],t))return!1;return!0}function Op(a,t){for(const r of t)if(rf(a,r))return!0;return!1}function af(a,t,r,u){const p=u[0]-r[0],x=u[1]-r[1],b=(a[0]-r[0])*x-p*(a[1]-r[1]),T=(t[0]-r[0])*x-p*(t[1]-r[1]);return b>0&&T<0||b<0&&T>0}function Dh(a,t,r){const u=[];for(let p=0;p<a.length;p++){const x=[];for(let b=0;b<a[p].length;b++){const T=Mc(a[p][b],r);Rl(t,T),x.push(T)}u.push(x)}return u}function Lc(a,t,r){const u=[];for(let p=0;p<a.length;p++){const x=Dh(a[p],t,r);u.push(x)}return u}function Pc(a,t,r,u){if(a[0]<r[0]||a[0]>r[2]){const p=.5*u;let x=a[0]-r[0]>p?-u:r[0]-a[0]>p?u:0;x===0&&(x=a[0]-r[2]>p?-u:r[2]-a[0]>p?u:0),a[0]+=x}Rl(t,a)}function vu(a,t,r,u){const p=Math.pow(2,u.z)*fa,x=[u.x*fa,u.y*fa],b=[];for(const T of a)for(const M of T){const I=[M.x+x[0],M.y+x[1]];Pc(I,t,r,p),b.push(I)}return b}function xu(a,t,r,u){const p=Math.pow(2,u.z)*fa,x=[u.x*fa,u.y*fa],b=[];for(const M of a){const I=[];for(const z of M){const F=[z.x+x[0],z.y+x[1]];Rl(t,F),I.push(F)}b.push(I)}if(t[2]-t[0]<=p/2){(T=t)[0]=T[1]=1/0,T[2]=T[3]=-1/0;for(const M of b)for(const I of M)Pc(I,t,r,p)}var T;return b}class jo{constructor(t,r){this.type=cn,this.geojson=t,this.geometries=r}static parse(t,r){if(t.length!==2)return r.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Zn(t[1])){const u=t[1];if(u.type==="FeatureCollection"){const p=[];for(const x of u.features){const{type:b,coordinates:T}=x.geometry;b==="Polygon"&&p.push(T),b==="MultiPolygon"&&p.push(...T)}if(p.length)return new jo(u,{type:"MultiPolygon",coordinates:p})}else if(u.type==="Feature"){const p=u.geometry.type;if(p==="Polygon"||p==="MultiPolygon")return new jo(u,u.geometry)}else if(u.type==="Polygon"||u.type==="MultiPolygon")return new jo(u,u)}return r.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(t.geometry()!=null&&t.canonicalID()!=null){if(t.geometryType()==="Point")return(function(r,u){const p=[1/0,1/0,-1/0,-1/0],x=[1/0,1/0,-1/0,-1/0],b=r.canonicalID();if(u.type==="Polygon"){const T=Dh(u.coordinates,x,b),M=vu(r.geometry(),p,x,b);if(!Ac(p,x))return!1;for(const I of M)if(!ss(I,T))return!1}if(u.type==="MultiPolygon"){const T=Lc(u.coordinates,x,b),M=vu(r.geometry(),p,x,b);if(!Ac(p,x))return!1;for(const I of M)if(!Dp(I,T))return!1}return!0})(t,this.geometries);if(t.geometryType()==="LineString")return(function(r,u){const p=[1/0,1/0,-1/0,-1/0],x=[1/0,1/0,-1/0,-1/0],b=r.canonicalID();if(u.type==="Polygon"){const T=Dh(u.coordinates,x,b),M=xu(r.geometry(),p,x,b);if(!Ac(p,x))return!1;for(const I of M)if(!rf(I,T))return!1}if(u.type==="MultiPolygon"){const T=Lc(u.coordinates,x,b),M=xu(r.geometry(),p,x,b);if(!Ac(p,x))return!1;for(const I of M)if(!Op(I,T))return!1}return!0})(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let sf=class{constructor(a=[],t=(r,u)=>r<u?-1:r>u?1:0){if(this.data=a,this.length=this.data.length,this.compare=t,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(a){this.data.push(a),this._up(this.length++)}pop(){if(this.length===0)return;const a=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),a}peek(){return this.data[0]}_up(a){const{data:t,compare:r}=this,u=t[a];for(;a>0;){const p=a-1>>1,x=t[p];if(r(u,x)>=0)break;t[a]=x,a=p}t[a]=u}_down(a){const{data:t,compare:r}=this,u=this.length>>1,p=t[a];for(;a<u;){let x=1+(a<<1);const b=x+1;if(b<this.length&&r(t[b],t[x])<0&&(x=b),r(t[x],p)>=0)break;t[a]=t[x],a=x}t[a]=p}};function Oh(a,t,r=0,u=a.length-1,p=of){for(;u>r;){if(u-r>600){const M=u-r+1,I=t-r+1,z=Math.log(M),F=.5*Math.exp(2*z/3),j=.5*Math.sqrt(z*F*(M-F)/M)*(I-M/2<0?-1:1);Oh(a,t,Math.max(r,Math.floor(t-I*F/M+j)),Math.min(u,Math.floor(t+(M-I)*F/M+j)),p)}const x=a[t];let b=r,T=u;for(eo(a,r,t),p(a[u],x)>0&&eo(a,r,u);b<T;){for(eo(a,b,T),b++,T--;p(a[b],x)<0;)b++;for(;p(a[T],x)>0;)T--}p(a[r],x)===0?eo(a,r,T):(T++,eo(a,T,u)),T<=t&&(r=T+1),t<=T&&(u=T-1)}}function eo(a,t,r){const u=a[t];a[t]=a[r],a[r]=u}function of(a,t){return a<t?-1:a>t?1:0}function bu(a,t){if(a.length<=1)return[a];const r=[];let u,p;for(const x of a){const b=Bp(x);b!==0&&(x.area=Math.abs(b),p===void 0&&(p=b<0),p===b<0?(u&&r.push(u),u=[x]):u.push(x))}if(u&&r.push(u),t>1)for(let x=0;x<r.length;x++)r[x].length<=t||(Oh(r[x],t,1,r[x].length-1,kp),r[x]=r[x].slice(0,t));return r}function kp(a,t){return t.area-a.area}function Bp(a){let t=0;for(let r,u,p=0,x=a.length,b=x-1;p<x;b=p++)r=a[p],u=a[b],t+=(u.x-r.x)*(r.y+u.y);return t}const lf=1/298.257223563,Fp=lf*(2-lf),Np=Math.PI/180;class cf{constructor(t){const r=6378.137*Np*1e3,u=Math.cos(t*Np),p=1/(1-Fp*(1-u*u)),x=Math.sqrt(p);this.kx=r*x*u,this.ky=r*x*p*(1-Fp)}distance(t,r){const u=this.wrap(t[0]-r[0])*this.kx,p=(t[1]-r[1])*this.ky;return Math.sqrt(u*u+p*p)}pointOnLine(t,r){let u,p,x,b,T=1/0;for(let M=0;M<t.length-1;M++){let I=t[M][0],z=t[M][1],F=this.wrap(t[M+1][0]-I)*this.kx,j=(t[M+1][1]-z)*this.ky,G=0;F===0&&j===0||(G=(this.wrap(r[0]-I)*this.kx*F+(r[1]-z)*this.ky*j)/(F*F+j*j),G>1?(I=t[M+1][0],z=t[M+1][1]):G>0&&(I+=F/this.kx*G,z+=j/this.ky*G)),F=this.wrap(r[0]-I)*this.kx,j=(r[1]-z)*this.ky;const H=F*F+j*j;H<T&&(T=H,u=I,p=z,x=M,b=G)}return{point:[u,p],index:x,t:Math.max(0,Math.min(1,b))}}wrap(t){for(;t<-180;)t+=360;for(;t>180;)t-=360;return t}}function $r(a,t){return t[0]-a[0]}function Zo(a){return a[1]-a[0]+1}function Rs(a,t){return a[1]>=a[0]&&a[1]<t}function kh(a,t){if(a[0]>a[1])return[null,null];const r=Zo(a);if(t){if(r===2)return[a,null];const p=Math.floor(r/2);return[[a[0],a[0]+p],[a[0]+p,a[1]]]}if(r===1)return[a,null];const u=Math.floor(r/2)-1;return[[a[0],a[0]+u],[a[0]+u+1,a[1]]]}function Bh(a,t){if(!Rs(t,a.length))return[1/0,1/0,-1/0,-1/0];const r=[1/0,1/0,-1/0,-1/0];for(let u=t[0];u<=t[1];++u)Rl(r,a[u]);return r}function Ln(a){const t=[1/0,1/0,-1/0,-1/0];for(const r of a)for(const u of r)Rl(t,u);return t}function Fh(a){return a[0]!==-1/0&&a[1]!==-1/0&&a[2]!==1/0&&a[3]!==1/0}function uf(a,t,r){if(!Fh(a)||!Fh(t))return NaN;let u=0,p=0;return a[2]<t[0]&&(u=t[0]-a[2]),a[0]>t[2]&&(u=a[0]-t[2]),a[1]>t[3]&&(p=a[1]-t[3]),a[3]<t[1]&&(p=t[1]-a[3]),r.distance([0,0],[u,p])}function $a(a,t,r){const u=r.pointOnLine(t,a);return r.distance(a,u.point)}function wu(a,t,r,u,p){const x=Math.min($a(a,[r,u],p),$a(t,[r,u],p)),b=Math.min($a(r,[a,t],p),$a(u,[a,t],p));return Math.min(x,b)}function Su(a,t,r,u,p){if(!Rs(t,a.length)||!Rs(u,r.length))return 1/0;let x=1/0;for(let b=t[0];b<t[1];++b){const T=a[b],M=a[b+1];for(let I=u[0];I<u[1];++I){const z=r[I],F=r[I+1];if(_u(T,M,z,F))return 0;x=Math.min(x,wu(T,M,z,F,p))}}return x}function hf(a,t,r,u,p){if(!Rs(t,a.length)||!Rs(u,r.length))return NaN;let x=1/0;for(let b=t[0];b<=t[1];++b)for(let T=u[0];T<=u[1];++T)if(x=Math.min(x,p.distance(a[b],r[T])),x===0)return x;return x}function Up(a,t,r){if(ss(a,t,!0))return 0;let u=1/0;for(const p of t){const x=p[0],b=p[p.length-1];if(x!==b&&(u=Math.min(u,$a(a,[b,x],r)),u===0))return u;const T=r.pointOnLine(p,a);if(u=Math.min(u,r.distance(a,T.point)),u===0)return u}return u}function Il(a,t,r,u){if(!Rs(t,a.length))return NaN;for(let x=t[0];x<=t[1];++x)if(ss(a[x],r,!0))return 0;let p=1/0;for(let x=t[0];x<t[1];++x){const b=a[x],T=a[x+1];for(const M of r)for(let I=0,z=M.length,F=z-1;I<z;F=I++){const j=M[F],G=M[I];if(_u(b,T,j,G))return 0;p=Math.min(p,wu(b,T,j,G,u))}}return p}function zl(a,t){for(const r of a)for(const u of r)if(ss(u,t,!0))return!0;return!1}function df(a,t,r,u=1/0){const p=Ln(a),x=Ln(t);if(u!==1/0&&uf(p,x,r)>=u)return u;if(Ac(p,x)){if(zl(a,t))return 0}else if(zl(t,a))return 0;let b=1/0;for(const T of a)for(let M=0,I=T.length,z=I-1;M<I;z=M++){const F=T[z],j=T[M];for(const G of t)for(let H=0,J=G.length,ne=J-1;H<J;ne=H++){const le=G[ne],Ae=G[H];if(_u(F,j,le,Ae))return 0;b=Math.min(b,wu(F,j,le,Ae,r))}}return b}function ff(a,t,r,u,p,x){if(!x)return;const b=uf(Bh(u,x),p,r);b<t&&a.push([b,x,[0,0]])}function Is(a,t,r,u,p,x,b){if(!x||!b)return;const T=uf(Bh(u,x),Bh(p,b),r);T<t&&a.push([T,x,b])}function Cu(a,t,r,u,p=1/0){let x=Math.min(u.distance(a[0],r[0][0]),p);if(x===0)return x;const b=new sf([[0,[0,a.length-1],[0,0]]],$r),T=Ln(r);for(;b.length>0;){const M=b.pop();if(M[0]>=x)continue;const I=M[1],z=t?50:100;if(Zo(I)<=z){if(!Rs(I,a.length))return NaN;if(t){const F=Il(a,I,r,u);if(isNaN(F)||F===0)return F;x=Math.min(x,F)}else for(let F=I[0];F<=I[1];++F){const j=Up(a[F],r,u);if(x=Math.min(x,j),x===0)return 0}}else{const F=kh(I,t);ff(b,x,u,a,T,F[0]),ff(b,x,u,a,T,F[1])}}return x}function Tu(a,t,r,u,p,x=1/0){let b=Math.min(x,p.distance(a[0],r[0]));if(b===0)return b;const T=new sf([[0,[0,a.length-1],[0,r.length-1]]],$r);for(;T.length>0;){const M=T.pop();if(M[0]>=b)continue;const I=M[1],z=M[2],F=t?50:100,j=u?50:100;if(Zo(I)<=F&&Zo(z)<=j){if(!Rs(I,a.length)&&Rs(z,r.length))return NaN;let G;if(t&&u)G=Su(a,I,r,z,p),b=Math.min(b,G);else if(t&&!u){const H=a.slice(I[0],I[1]+1);for(let J=z[0];J<=z[1];++J)if(G=$a(r[J],H,p),b=Math.min(b,G),b===0)return b}else if(!t&&u){const H=r.slice(z[0],z[1]+1);for(let J=I[0];J<=I[1];++J)if(G=$a(a[J],H,p),b=Math.min(b,G),b===0)return b}else G=hf(a,I,r,z,p),b=Math.min(b,G)}else{const G=kh(I,t),H=kh(z,u);Is(T,b,p,a,r,G[0],H[0]),Is(T,b,p,a,r,G[0],H[1]),Is(T,b,p,a,r,G[1],H[0]),Is(T,b,p,a,r,G[1],H[1])}}return b}function Nh(a){return a.type==="MultiPolygon"?a.coordinates.map((t=>({type:"Polygon",coordinates:t}))):a.type==="MultiLineString"?a.coordinates.map((t=>({type:"LineString",coordinates:t}))):a.type==="MultiPoint"?a.coordinates.map((t=>({type:"Point",coordinates:t}))):[a]}class Dl{constructor(t,r){this.type=ut,this.geojson=t,this.geometries=r}static parse(t,r){if(t.length!==2)return r.error(`'distance' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Zn(t[1])){const u=t[1];if(u.type==="FeatureCollection")return new Dl(u,u.features.map((p=>Nh(p.geometry))).flat());if(u.type==="Feature")return new Dl(u,Nh(u.geometry));if("type"in u&&"coordinates"in u)return new Dl(u,Nh(u))}return r.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(t.geometry()!=null&&t.canonicalID()!=null){if(t.geometryType()==="Point")return(function(r,u){const p=r.geometry(),x=p.flat().map((M=>nf([M.x,M.y],r.canonical)));if(p.length===0)return NaN;const b=new cf(x[0][1]);let T=1/0;for(const M of u){switch(M.type){case"Point":T=Math.min(T,Tu(x,!1,[M.coordinates],!1,b,T));break;case"LineString":T=Math.min(T,Tu(x,!1,M.coordinates,!0,b,T));break;case"Polygon":T=Math.min(T,Cu(x,!1,M.coordinates,b,T))}if(T===0)return T}return T})(t,this.geometries);if(t.geometryType()==="LineString")return(function(r,u){const p=r.geometry(),x=p.flat().map((M=>nf([M.x,M.y],r.canonical)));if(p.length===0)return NaN;const b=new cf(x[0][1]);let T=1/0;for(const M of u){switch(M.type){case"Point":T=Math.min(T,Tu(x,!0,[M.coordinates],!1,b,T));break;case"LineString":T=Math.min(T,Tu(x,!0,M.coordinates,!0,b,T));break;case"Polygon":T=Math.min(T,Cu(x,!0,M.coordinates,b,T))}if(T===0)return T}return T})(t,this.geometries);if(t.geometryType()==="Polygon")return(function(r,u){const p=r.geometry();if(p.length===0||p[0].length===0)return NaN;const x=bu(p,0).map((M=>M.map((I=>I.map((z=>nf([z.x,z.y],r.canonical))))))),b=new cf(x[0][0][0][1]);let T=1/0;for(const M of u)for(const I of x){switch(M.type){case"Point":T=Math.min(T,Cu([M.coordinates],!1,I,b,T));break;case"LineString":T=Math.min(T,Cu(M.coordinates,!0,I,b,T));break;case"Polygon":T=Math.min(T,df(I,M.coordinates,b,T))}if(T===0)return T}return T})(t,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}class Eu{constructor(t){this.type=rn,this.key=t}static parse(t,r){if(t.length!==2)return r.error(`Expected 1 argument, but found ${t.length-1} instead.`);const u=t[1];return u==null?r.error("Global state property must be defined."):typeof u!="string"?r.error(`Global state property must be string, but found ${typeof t[1]} instead.`):new Eu(u)}evaluate(t){var r;const u=(r=t.globals)===null||r===void 0?void 0:r.globalState;return u&&Object.keys(u).length!==0?wc(u,this.key):null}eachChild(){}outputDefined(){return!1}}const Rc={"==":as,"!=":Kd,">":mm,"<":Rh,">=":gm,"<=":Jd,array:un,at:Ml,boolean:un,case:fr,coalesce:Ph,collator:Ih,format:zh,image:Ec,in:Al,"index-of":Cc,interpolate:ir,"interpolate-hcl":ir,"interpolate-lab":ir,length:tf,let:$o,literal:Yt,match:Ps,number:un,"number-format":ef,object:un,slice:Ll,step:Vo,string:un,"to-boolean":Ii,"to-color":Ii,"to-number":Ii,"to-string":Ii,var:El,within:jo,distance:Dl,"global-state":Eu};class pa{constructor(t,r,u,p){this.name=t,this.type=r,this._evaluate=u,this.args=p}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}static parse(t,r){const u=t[0],p=pa.definitions[u];if(!p)return r.error(`Unknown expression "${u}". If you wanted a literal array, use ["literal", [...]].`,0);const x=Array.isArray(p)?p[0]:p.type,b=Array.isArray(p)?[[p[1],p[2]]]:p.overloads,T=b.filter((([I])=>!Array.isArray(I)||I.length===t.length-1));let M=null;for(const[I,z]of T){M=new mu(r.registry,Vr,r.path,null,r.scope);const F=[];let j=!1;for(let G=1;G<t.length;G++){const H=t[G],J=Array.isArray(I)?I[G-1]:I.type,ne=M.parse(H,1+F.length,J);if(!ne){j=!0;break}F.push(ne)}if(!j)if(Array.isArray(I)&&I.length!==F.length)M.error(`Expected ${I.length} arguments, but found ${F.length} instead.`);else{for(let G=0;G<F.length;G++){const H=Array.isArray(I)?I[G]:I.type,J=F[G];M.concat(G+1).checkSubtype(H,J.type)}if(M.errors.length===0)return new pa(u,x,z,F)}}if(T.length===1)r.errors.push(...M.errors);else{const I=(T.length?T:b).map((([F])=>{return j=F,Array.isArray(j)?`(${j.map(jn).join(", ")})`:`(${jn(j.type)}...)`;var j})).join(" | "),z=[];for(let F=1;F<t.length;F++){const j=r.parse(t[F],1+z.length);if(!j)return null;z.push(jn(j.type))}r.error(`Expected arguments of type ${I}, but found (${z.join(", ")}) instead.`)}return null}static register(t,r){pa.definitions=r;for(const u in r)t[u]=pa}}function pf(a,[t,r,u,p]){t=t.evaluate(a),r=r.evaluate(a),u=u.evaluate(a);const x=p?p.evaluate(a):1,b=Na(t,r,u,x);if(b)throw new oi(b);return new dn(t/255,r/255,u/255,x,!1)}function Uh(a,t){return a in t}function ma(a,t){const r=t[a];return r===void 0?null:r}function zs(a){return{type:a}}function Vr(a){if(a instanceof El)return Vr(a.boundExpression);if(a instanceof pa&&a.name==="error"||a instanceof Ih||a instanceof jo||a instanceof Dl||a instanceof Eu)return!1;const t=a instanceof Ii||a instanceof un;let r=!0;return a.eachChild((u=>{r=t?r&&Vr(u):r&&u instanceof Yt})),!!r&&to(a)&&kl(a,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"])}function to(a){if(a instanceof pa&&(a.name==="get"&&a.args.length===1||a.name==="feature-state"||a.name==="has"&&a.args.length===1||a.name==="properties"||a.name==="geometry-type"||a.name==="id"||/^filter-/.test(a.name))||a instanceof jo||a instanceof Dl)return!1;let t=!0;return a.eachChild((r=>{t&&!to(r)&&(t=!1)})),t}function Ol(a){if(a instanceof pa&&a.name==="feature-state")return!1;let t=!0;return a.eachChild((r=>{t&&!Ol(r)&&(t=!1)})),t}function kl(a,t){if(a instanceof pa&&t.indexOf(a.name)>=0)return!1;let r=!0;return a.eachChild((u=>{r&&!kl(u,t)&&(r=!1)})),r}function Mu(a){return{result:"success",value:a}}function Go(a){return{result:"error",value:a}}function Va(a){return a["property-type"]==="data-driven"||a["property-type"]==="cross-faded-data-driven"}function mf(a){return!!a.expression&&a.expression.parameters.indexOf("zoom")>-1}function qo(a){return!!a.expression&&a.expression.interpolated}function hn(a){return a instanceof Number?"number":a instanceof String?"string":a instanceof Boolean?"boolean":Array.isArray(a)?"array":a===null?"null":typeof a}function $h(a){return typeof a=="object"&&a!==null&&!Array.isArray(a)&&pi(a)===rs}function ga(a){return a}function Au(a,t){const r=a.stops&&typeof a.stops[0][0]=="object",u=r||!(r||a.property!==void 0),p=a.type||(qo(t)?"exponential":"interval"),x=(function(z){switch(z.type){case"color":return dn.parse;case"padding":return Ri.parse;case"numberArray":return tr.parse;case"colorArray":return nr.parse;default:return null}})(t);if(x&&((a=is({},a)).stops&&(a.stops=a.stops.map((z=>[z[0],x(z[1])]))),a.default=x(a.default?a.default:t.default)),a.colorSpace&&(b=a.colorSpace)!=="rgb"&&b!=="hcl"&&b!=="lab")throw new Error(`Unknown color space: "${a.colorSpace}"`);var b;const T=(function(z){switch(z){case"exponential":return no;case"interval":return Bl;case"categorical":return $p;case"identity":return gf;default:throw new Error(`Unknown function type "${z}"`)}})(p);let M,I;if(p==="categorical"){M=Object.create(null);for(const z of a.stops)M[z[0]]=z[1];I=typeof a.stops[0][0]}if(r){const z={},F=[];for(let H=0;H<a.stops.length;H++){const J=a.stops[H],ne=J[0].zoom;z[ne]===void 0&&(z[ne]={zoom:ne,type:a.type,property:a.property,default:a.default,stops:[]},F.push(ne)),z[ne].stops.push([J[0].value,J[1]])}const j=[];for(const H of F)j.push([z[H].zoom,Au(z[H],t)]);const G={name:"linear"};return{kind:"composite",interpolationType:G,interpolationFactor:ir.interpolationFactor.bind(void 0,G),zoomStops:j.map((H=>H[0])),evaluate:({zoom:H},J)=>no({stops:j,base:a.base},t,H).evaluate(H,J)}}if(u){const z=p==="exponential"?{name:"exponential",base:a.base!==void 0?a.base:1}:null;return{kind:"camera",interpolationType:z,interpolationFactor:ir.interpolationFactor.bind(void 0,z),zoomStops:a.stops.map((F=>F[0])),evaluate:({zoom:F})=>T(a,t,F,M,I)}}return{kind:"source",evaluate(z,F){const j=F&&F.properties?F.properties[a.property]:void 0;return j===void 0?ya(a.default,t.default):T(a,t,j,M,I)}}}function ya(a,t,r){return a!==void 0?a:t!==void 0?t:r!==void 0?r:void 0}function $p(a,t,r,u,p){return ya(typeof r===p?u[r]:void 0,a.default,t.default)}function Bl(a,t,r){if(hn(r)!=="number")return ya(a.default,t.default);const u=a.stops.length;if(u===1||r<=a.stops[0][0])return a.stops[0][1];if(r>=a.stops[u-1][0])return a.stops[u-1][1];const p=Pl(a.stops.map((x=>x[0])),r);return a.stops[p][1]}function no(a,t,r){const u=a.base!==void 0?a.base:1;if(hn(r)!=="number")return ya(a.default,t.default);const p=a.stops.length;if(p===1||r<=a.stops[0][0])return a.stops[0][1];if(r>=a.stops[p-1][0])return a.stops[p-1][1];const x=Pl(a.stops.map((z=>z[0])),r),b=(function(z,F,j,G){const H=G-j,J=z-j;return H===0?0:F===1?J/H:(Math.pow(F,J)-1)/(Math.pow(F,H)-1)})(r,u,a.stops[x][0],a.stops[x+1][0]),T=a.stops[x][1],M=a.stops[x+1][1],I=Ua[t.type]||ga;return typeof T.evaluate=="function"?{evaluate(...z){const F=T.evaluate.apply(void 0,z),j=M.evaluate.apply(void 0,z);if(F!==void 0&&j!==void 0)return I(F,j,b,a.colorSpace)}}:I(T,M,b,a.colorSpace)}function gf(a,t,r){switch(t.type){case"color":r=dn.parse(r);break;case"formatted":r=er.fromString(r.toString());break;case"resolvedImage":r=Ur.fromString(r.toString());break;case"padding":r=Ri.parse(r);break;case"colorArray":r=nr.parse(r);break;case"numberArray":r=tr.parse(r);break;default:hn(r)===t.type||t.type==="enum"&&t.values[r]||(r=void 0)}return ya(r,a.default,t.default)}pa.register(Rc,{error:[{kind:"error"},[on],(a,[t])=>{throw new oi(t.evaluate(a))}],typeof:[on,[rn],(a,[t])=>jn(pi(t.evaluate(a)))],"to-rgba":[Wr(ut,4),[ha],(a,[t])=>{const[r,u,p,x]=t.evaluate(a).rgb;return[255*r,255*u,255*p,x]}],rgb:[ha,[ut,ut,ut],pf],rgba:[ha,[ut,ut,ut,ut],pf],has:{type:cn,overloads:[[[on],(a,[t])=>Uh(t.evaluate(a),a.properties())],[[on,rs],(a,[t,r])=>Uh(t.evaluate(a),r.evaluate(a))]]},get:{type:rn,overloads:[[[on],(a,[t])=>ma(t.evaluate(a),a.properties())],[[on,rs],(a,[t,r])=>ma(t.evaluate(a),r.evaluate(a))]]},"feature-state":[rn,[on],(a,[t])=>ma(t.evaluate(a),a.featureState||{})],properties:[rs,[],a=>a.properties()],"geometry-type":[on,[],a=>a.geometryType()],id:[rn,[],a=>a.id()],zoom:[ut,[],a=>a.globals.zoom],"heatmap-density":[ut,[],a=>a.globals.heatmapDensity||0],elevation:[ut,[],a=>a.globals.elevation||0],"line-progress":[ut,[],a=>a.globals.lineProgress||0],accumulated:[rn,[],a=>a.globals.accumulated===void 0?null:a.globals.accumulated],"+":[ut,zs(ut),(a,t)=>{let r=0;for(const u of t)r+=u.evaluate(a);return r}],"*":[ut,zs(ut),(a,t)=>{let r=1;for(const u of t)r*=u.evaluate(a);return r}],"-":{type:ut,overloads:[[[ut,ut],(a,[t,r])=>t.evaluate(a)-r.evaluate(a)],[[ut],(a,[t])=>-t.evaluate(a)]]},"/":[ut,[ut,ut],(a,[t,r])=>t.evaluate(a)/r.evaluate(a)],"%":[ut,[ut,ut],(a,[t,r])=>t.evaluate(a)%r.evaluate(a)],ln2:[ut,[],()=>Math.LN2],pi:[ut,[],()=>Math.PI],e:[ut,[],()=>Math.E],"^":[ut,[ut,ut],(a,[t,r])=>Math.pow(t.evaluate(a),r.evaluate(a))],sqrt:[ut,[ut],(a,[t])=>Math.sqrt(t.evaluate(a))],log10:[ut,[ut],(a,[t])=>Math.log(t.evaluate(a))/Math.LN10],ln:[ut,[ut],(a,[t])=>Math.log(t.evaluate(a))],log2:[ut,[ut],(a,[t])=>Math.log(t.evaluate(a))/Math.LN2],sin:[ut,[ut],(a,[t])=>Math.sin(t.evaluate(a))],cos:[ut,[ut],(a,[t])=>Math.cos(t.evaluate(a))],tan:[ut,[ut],(a,[t])=>Math.tan(t.evaluate(a))],asin:[ut,[ut],(a,[t])=>Math.asin(t.evaluate(a))],acos:[ut,[ut],(a,[t])=>Math.acos(t.evaluate(a))],atan:[ut,[ut],(a,[t])=>Math.atan(t.evaluate(a))],min:[ut,zs(ut),(a,t)=>Math.min(...t.map((r=>r.evaluate(a))))],max:[ut,zs(ut),(a,t)=>Math.max(...t.map((r=>r.evaluate(a))))],abs:[ut,[ut],(a,[t])=>Math.abs(t.evaluate(a))],round:[ut,[ut],(a,[t])=>{const r=t.evaluate(a);return r<0?-Math.round(-r):Math.round(r)}],floor:[ut,[ut],(a,[t])=>Math.floor(t.evaluate(a))],ceil:[ut,[ut],(a,[t])=>Math.ceil(t.evaluate(a))],"filter-==":[cn,[on,rn],(a,[t,r])=>a.properties()[t.value]===r.value],"filter-id-==":[cn,[rn],(a,[t])=>a.id()===t.value],"filter-type-==":[cn,[on],(a,[t])=>a.geometryType()===t.value],"filter-<":[cn,[on,rn],(a,[t,r])=>{const u=a.properties()[t.value],p=r.value;return typeof u==typeof p&&u<p}],"filter-id-<":[cn,[rn],(a,[t])=>{const r=a.id(),u=t.value;return typeof r==typeof u&&r<u}],"filter->":[cn,[on,rn],(a,[t,r])=>{const u=a.properties()[t.value],p=r.value;return typeof u==typeof p&&u>p}],"filter-id->":[cn,[rn],(a,[t])=>{const r=a.id(),u=t.value;return typeof r==typeof u&&r>u}],"filter-<=":[cn,[on,rn],(a,[t,r])=>{const u=a.properties()[t.value],p=r.value;return typeof u==typeof p&&u<=p}],"filter-id-<=":[cn,[rn],(a,[t])=>{const r=a.id(),u=t.value;return typeof r==typeof u&&r<=u}],"filter->=":[cn,[on,rn],(a,[t,r])=>{const u=a.properties()[t.value],p=r.value;return typeof u==typeof p&&u>=p}],"filter-id->=":[cn,[rn],(a,[t])=>{const r=a.id(),u=t.value;return typeof r==typeof u&&r>=u}],"filter-has":[cn,[rn],(a,[t])=>t.value in a.properties()],"filter-has-id":[cn,[],a=>a.id()!==null&&a.id()!==void 0],"filter-type-in":[cn,[Wr(on)],(a,[t])=>t.value.indexOf(a.geometryType())>=0],"filter-id-in":[cn,[Wr(rn)],(a,[t])=>t.value.indexOf(a.id())>=0],"filter-in-small":[cn,[on,Wr(rn)],(a,[t,r])=>r.value.indexOf(a.properties()[t.value])>=0],"filter-in-large":[cn,[on,Wr(rn)],(a,[t,r])=>(function(u,p,x,b){for(;x<=b;){const T=x+b>>1;if(p[T]===u)return!0;p[T]>u?b=T-1:x=T+1}return!1})(a.properties()[t.value],r.value,0,r.value.length-1)],all:{type:cn,overloads:[[[cn,cn],(a,[t,r])=>t.evaluate(a)&&r.evaluate(a)],[zs(cn),(a,t)=>{for(const r of t)if(!r.evaluate(a))return!1;return!0}]]},any:{type:cn,overloads:[[[cn,cn],(a,[t,r])=>t.evaluate(a)||r.evaluate(a)],[zs(cn),(a,t)=>{for(const r of t)if(r.evaluate(a))return!0;return!1}]]},"!":[cn,[cn],(a,[t])=>!t.evaluate(a)],"is-supported-script":[cn,[on],(a,[t])=>{const r=a.globals&&a.globals.isSupportedScript;return!r||r(t.evaluate(a))}],upcase:[on,[on],(a,[t])=>t.evaluate(a).toUpperCase()],downcase:[on,[on],(a,[t])=>t.evaluate(a).toLowerCase()],concat:[on,zs(rn),(a,t)=>t.map((r=>gn(r.evaluate(a)))).join("")],"resolved-locale":[on,[ko],(a,[t])=>t.evaluate(a).resolvedLocale()]});class Vh{constructor(t,r,u){this.expression=t,this._warningHistory={},this._evaluator=new Ks,this._defaultValue=r?(function(p){if(p.type==="color"&&$h(p.default))return new dn(0,0,0,0);switch(p.type){case"color":return dn.parse(p.default)||null;case"padding":return Ri.parse(p.default)||null;case"numberArray":return tr.parse(p.default)||null;case"colorArray":return nr.parse(p.default)||null;case"variableAnchorOffsetCollection":return Li.parse(p.default)||null;case"projectionDefinition":return dr.parse(p.default)||null;default:return p.default===void 0?null:p.default}})(r):null,this._enumValues=r&&r.type==="enum"?r.values:null,this._globalState=u}evaluateWithoutErrorHandling(t,r,u,p,x,b){return this._globalState&&(t=mr(t,this._globalState)),this._evaluator.globals=t,this._evaluator.feature=r,this._evaluator.featureState=u,this._evaluator.canonical=p,this._evaluator.availableImages=x||null,this._evaluator.formattedSection=b,this.expression.evaluate(this._evaluator)}evaluate(t,r,u,p,x,b){this._globalState&&(t=mr(t,this._globalState)),this._evaluator.globals=t,this._evaluator.feature=r||null,this._evaluator.featureState=u||null,this._evaluator.canonical=p,this._evaluator.availableImages=x||null,this._evaluator.formattedSection=b||null;try{const T=this.expression.evaluate(this._evaluator);if(T==null||typeof T=="number"&&T!=T)return this._defaultValue;if(this._enumValues&&!(T in this._enumValues))throw new oi(`Expected value to be one of ${Object.keys(this._enumValues).map((M=>JSON.stringify(M))).join(", ")}, but found ${JSON.stringify(T)} instead.`);return T}catch(T){return this._warningHistory[T.message]||(this._warningHistory[T.message]=!0,typeof console<"u"&&console.warn(T.message)),this._defaultValue}}}function Ic(a){return Array.isArray(a)&&a.length>0&&typeof a[0]=="string"&&a[0]in Rc}function Lu(a,t,r){const u=new mu(Rc,Vr,[],t?(function(x){const b={color:ha,string:on,number:ut,enum:on,boolean:cn,formatted:Ts,padding:Fa,numberArray:Qr,colorArray:Xs,projectionDefinition:Cs,resolvedImage:bi,variableAnchorOffsetCollection:Pi};return x.type==="array"?Wr(b[x.value]||rn,x.length):b[x.type]})(t):void 0),p=u.parse(a,void 0,void 0,void 0,t&&t.type==="string"?{typeAnnotation:"coerce"}:void 0);return p?Mu(new Vh(p,t,r)):Go(u.errors)}class jr{constructor(t,r,u){this.kind=t,this._styleExpression=r,this.isStateDependent=t!=="constant"&&!Ol(r.expression),this.globalStateRefs=Pr(r.expression),this._globalState=u}evaluateWithoutErrorHandling(t,r,u,p,x,b){return this._globalState&&(t=mr(t,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(t,r,u,p,x,b)}evaluate(t,r,u,p,x,b){return this._globalState&&(t=mr(t,this._globalState)),this._styleExpression.evaluate(t,r,u,p,x,b)}}class io{constructor(t,r,u,p,x){this.kind=t,this.zoomStops=u,this._styleExpression=r,this.isStateDependent=t!=="camera"&&!Ol(r.expression),this.globalStateRefs=Pr(r.expression),this.interpolationType=p,this._globalState=x}evaluateWithoutErrorHandling(t,r,u,p,x,b){return this._globalState&&(t=mr(t,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(t,r,u,p,x,b)}evaluate(t,r,u,p,x,b){return this._globalState&&(t=mr(t,this._globalState)),this._styleExpression.evaluate(t,r,u,p,x,b)}interpolationFactor(t,r,u){return this.interpolationType?ir.interpolationFactor(this.interpolationType,t,r,u):0}}function Ho(a,t,r){const u=Lu(a,t,r);if(u.result==="error")return u;const p=u.value.expression,x=to(p);if(!x&&!Va(t))return Go([new Yr("","data expressions not supported")]);const b=kl(p,["zoom"]);if(!b&&!mf(t))return Go([new Yr("","zoom expressions not supported")]);const T=Xo(p);return T||b?T instanceof Yr?Go([T]):T instanceof ir&&!qo(t)?Go([new Yr("",'"interpolate" expressions cannot be used with this property')]):Mu(T?new io(x?"camera":"composite",u.value,T.labels,T instanceof ir?T.interpolation:void 0,r):new jr(x?"constant":"source",u.value,r)):Go([new Yr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Fl{constructor(t,r){this._parameters=t,this._specification=r,is(this,Au(this._parameters,this._specification))}static deserialize(t){return new Fl(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function Xo(a){let t=null;if(a instanceof $o)t=Xo(a.result);else if(a instanceof Ph){for(const r of a.args)if(t=Xo(r),t)break}else(a instanceof Vo||a instanceof ir)&&a.input instanceof pa&&a.input.name==="zoom"&&(t=a);return t instanceof Yr||a.eachChild((r=>{const u=Xo(r);u instanceof Yr?t=u:!t&&u?t=new Yr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&u&&t!==u&&(t=new Yr("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),t}function Pr(a,t=new Set){return a instanceof Eu&&t.add(a.key),a.eachChild((r=>{Pr(r,t)})),t}function mr(a,t){const{zoom:r,heatmapDensity:u,elevation:p,lineProgress:x,isSupportedScript:b,accumulated:T}=a??{};return{zoom:r,heatmapDensity:u,elevation:p,lineProgress:x,isSupportedScript:b,accumulated:T,globalState:t}}function os(a){if(a===!0||a===!1)return!0;if(!Array.isArray(a)||a.length===0)return!1;switch(a[0]){case"has":return a.length>=2&&a[1]!=="$id"&&a[1]!=="$type";case"in":return a.length>=3&&(typeof a[1]!="string"||Array.isArray(a[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return a.length!==3||Array.isArray(a[1])||Array.isArray(a[2]);case"any":case"all":for(const t of a.slice(1))if(!os(t)&&typeof t!="boolean")return!1;return!0;default:return!0}}const Ds={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Kr(a,t){if(a==null)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};os(a)||(a=Nl(a));const r=Lu(a,Ds,t);if(r.result==="error")throw new Error(r.value.map((u=>`${u.key}: ${u.message}`)).join(", "));return{filter:(u,p,x)=>r.value.evaluate(u,p,{},x),needGeometry:yf(a),getGlobalStateRefs:()=>Pr(r.value.expression)}}function ro(a,t){return a<t?-1:a>t?1:0}function yf(a){if(!Array.isArray(a))return!1;if(a[0]==="within"||a[0]==="distance")return!0;for(let t=1;t<a.length;t++)if(yf(a[t]))return!0;return!1}function Nl(a){if(!a)return!0;const t=a[0];return a.length<=1?t!=="any":t==="=="?zc(a[1],a[2],"=="):t==="!="?Hn(zc(a[1],a[2],"==")):t==="<"||t===">"||t==="<="||t===">="?zc(a[1],a[2],t):t==="any"?(r=a.slice(1),["any"].concat(r.map(Nl))):t==="all"?["all"].concat(a.slice(1).map(Nl)):t==="none"?["all"].concat(a.slice(1).map(Nl).map(Hn)):t==="in"?Pu(a[1],a.slice(2)):t==="!in"?Hn(Pu(a[1],a.slice(2))):t==="has"?Hi(a[1]):t!=="!has"||Hn(Hi(a[1]));var r}function zc(a,t,r){switch(a){case"$type":return[`filter-type-${r}`,t];case"$id":return[`filter-id-${r}`,t];default:return[`filter-${r}`,a,t]}}function Pu(a,t){if(t.length===0)return!1;switch(a){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some((r=>typeof r!=typeof t[0]))?["filter-in-large",a,["literal",t.sort(ro)]]:["filter-in-small",a,["literal",t]]}}function Hi(a){switch(a){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",a]}}function Hn(a){return["!",a]}function wn(a){const t=typeof a;if(t==="number"||t==="boolean"||t==="string"||a==null)return JSON.stringify(a);if(Array.isArray(a)){let p="[";for(const x of a)p+=`${wn(x)},`;return`${p}]`}const r=Object.keys(a).sort();let u="{";for(let p=0;p<r.length;p++)u+=`${JSON.stringify(r[p])}:${wn(a[r[p]])},`;return`${u}}`}function ls(a){let t="";for(const r of mn)t+=`/${wn(a[r])}`;return t}function _a(a){const t=a.value;return t?[new rt(a.key,t,"constants have been deprecated as of v8")]:[]}function wi(a){return a instanceof Number||a instanceof String||a instanceof Boolean?a.valueOf():a}function Jr(a){if(Array.isArray(a))return a.map(Jr);if(a instanceof Object&&!(a instanceof Number||a instanceof String||a instanceof Boolean)){const t={};for(const r in a)t[r]=Jr(a[r]);return t}return wi(a)}function va(a){const t=a.key,r=a.value,u=a.valueSpec||{},p=a.objectElementValidators||{},x=a.style,b=a.styleSpec,T=a.validateSpec;let M=[];const I=hn(r);if(I!=="object")return[new rt(t,r,`object expected, ${I} found`)];for(const z in r){const F=z.split(".")[0],j=wc(u,F)||u["*"];let G;if(wc(p,F))G=p[F];else if(wc(u,F))G=T;else if(p["*"])G=p["*"];else{if(!u["*"]){M.push(new rt(t,r[z],`unknown property "${z}"`));continue}G=T}M=M.concat(G({key:(t&&`${t}.`)+z,value:r[z],valueSpec:j,style:x,styleSpec:b,object:r,objectKey:z,validateSpec:T},r))}for(const z in u)p[z]||u[z].required&&u[z].default===void 0&&r[z]===void 0&&M.push(new rt(t,r,`missing required property "${z}"`));return M}function jh(a){const t=a.value,r=a.valueSpec,u=a.style,p=a.styleSpec,x=a.key,b=a.arrayElementValidator||a.validateSpec;if(hn(t)!=="array")return[new rt(x,t,`array expected, ${hn(t)} found`)];if(r.length&&t.length!==r.length)return[new rt(x,t,`array length ${r.length} expected, length ${t.length} found`)];if(r["min-length"]&&t.length<r["min-length"])return[new rt(x,t,`array length at least ${r["min-length"]} expected, length ${t.length} found`)];let T={type:r.value,values:r.values};p.$version<7&&(T.function=r.function),hn(r.value)==="object"&&(T=r.value);let M=[];for(let I=0;I<t.length;I++)M=M.concat(b({array:t,arrayIndex:I,value:t[I],valueSpec:T,validateSpec:a.validateSpec,style:u,styleSpec:p,key:`${x}[${I}]`}));return M}function ao(a){const t=a.key,r=a.value,u=a.valueSpec;let p=hn(r);return p==="number"&&r!=r&&(p="NaN"),p!=="number"?[new rt(t,r,`number expected, ${p} found`)]:"minimum"in u&&r<u.minimum?[new rt(t,r,`${r} is less than the minimum value ${u.minimum}`)]:"maximum"in u&&r>u.maximum?[new rt(t,r,`${r} is greater than the maximum value ${u.maximum}`)]:[]}function so(a){const t=a.valueSpec,r=wi(a.value.type);let u,p,x,b={};const T=r!=="categorical"&&a.value.property===void 0,M=!T,I=hn(a.value.stops)==="array"&&hn(a.value.stops[0])==="array"&&hn(a.value.stops[0][0])==="object",z=va({key:a.key,value:a.value,valueSpec:a.styleSpec.function,validateSpec:a.validateSpec,style:a.style,styleSpec:a.styleSpec,objectElementValidators:{stops:function(G){if(r==="identity")return[new rt(G.key,G.value,'identity function may not have a "stops" property')];let H=[];const J=G.value;return H=H.concat(jh({key:G.key,value:J,valueSpec:G.valueSpec,validateSpec:G.validateSpec,style:G.style,styleSpec:G.styleSpec,arrayElementValidator:F})),hn(J)==="array"&&J.length===0&&H.push(new rt(G.key,J,"array must have at least one stop")),H},default:function(G){return G.validateSpec({key:G.key,value:G.value,valueSpec:t,validateSpec:G.validateSpec,style:G.style,styleSpec:G.styleSpec})}}});return r==="identity"&&T&&z.push(new rt(a.key,a.value,'missing required property "property"')),r==="identity"||a.value.stops||z.push(new rt(a.key,a.value,'missing required property "stops"')),r==="exponential"&&a.valueSpec.expression&&!qo(a.valueSpec)&&z.push(new rt(a.key,a.value,"exponential functions not supported")),a.styleSpec.$version>=8&&(M&&!Va(a.valueSpec)?z.push(new rt(a.key,a.value,"property functions not supported")):T&&!mf(a.valueSpec)&&z.push(new rt(a.key,a.value,"zoom functions not supported"))),r!=="categorical"&&!I||a.value.property!==void 0||z.push(new rt(a.key,a.value,'"property" property is required')),z;function F(G){let H=[];const J=G.value,ne=G.key;if(hn(J)!=="array")return[new rt(ne,J,`array expected, ${hn(J)} found`)];if(J.length!==2)return[new rt(ne,J,`array length 2 expected, length ${J.length} found`)];if(I){if(hn(J[0])!=="object")return[new rt(ne,J,`object expected, ${hn(J[0])} found`)];if(J[0].zoom===void 0)return[new rt(ne,J,"object stop key must have zoom")];if(J[0].value===void 0)return[new rt(ne,J,"object stop key must have value")];if(x&&x>wi(J[0].zoom))return[new rt(ne,J[0].zoom,"stop zoom values must appear in ascending order")];wi(J[0].zoom)!==x&&(x=wi(J[0].zoom),p=void 0,b={}),H=H.concat(va({key:`${ne}[0]`,value:J[0],valueSpec:{zoom:{}},validateSpec:G.validateSpec,style:G.style,styleSpec:G.styleSpec,objectElementValidators:{zoom:ao,value:j}}))}else H=H.concat(j({key:`${ne}[0]`,value:J[0],validateSpec:G.validateSpec,style:G.style,styleSpec:G.styleSpec},J));return Ic(Jr(J[1]))?H.concat([new rt(`${ne}[1]`,J[1],"expressions are not allowed in function stops.")]):H.concat(G.validateSpec({key:`${ne}[1]`,value:J[1],valueSpec:t,validateSpec:G.validateSpec,style:G.style,styleSpec:G.styleSpec}))}function j(G,H){const J=hn(G.value),ne=wi(G.value),le=G.value!==null?G.value:H;if(u){if(J!==u)return[new rt(G.key,le,`${J} stop domain type must match previous stop domain type ${u}`)]}else u=J;if(J!=="number"&&J!=="string"&&J!=="boolean")return[new rt(G.key,le,"stop domain value must be a number, string, or boolean")];if(J!=="number"&&r!=="categorical"){let Ae=`number expected, ${J} found`;return Va(t)&&r===void 0&&(Ae+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new rt(G.key,le,Ae)]}return r!=="categorical"||J!=="number"||isFinite(ne)&&Math.floor(ne)===ne?r!=="categorical"&&J==="number"&&p!==void 0&&ne<p?[new rt(G.key,le,"stop domain values must appear in ascending order")]:(p=ne,r==="categorical"&&ne in b?[new rt(G.key,le,"stop domain values must be unique")]:(b[ne]=!0,[])):[new rt(G.key,le,`integer expected, found ${ne}`)]}}function oo(a){const t=(a.expressionContext==="property"?Ho:Lu)(Jr(a.value),a.valueSpec);if(t.result==="error")return t.value.map((u=>new rt(`${a.key}${u.key}`,a.value,u.message)));const r=t.value.expression||t.value._styleExpression.expression;if(a.expressionContext==="property"&&a.propertyKey==="text-font"&&!r.outputDefined())return[new rt(a.key,a.value,`Invalid data expression for "${a.propertyKey}". Output values must be contained as literals within the expression.`)];if(a.expressionContext==="property"&&a.propertyType==="layout"&&!Ol(r))return[new rt(a.key,a.value,'"feature-state" data expressions are not supported with layout properties.')];if(a.expressionContext==="filter"&&!Ol(r))return[new rt(a.key,a.value,'"feature-state" data expressions are not supported with filters.')];if(a.expressionContext&&a.expressionContext.indexOf("cluster")===0){if(!kl(r,["zoom","feature-state"]))return[new rt(a.key,a.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(a.expressionContext==="cluster-initial"&&!to(r))return[new rt(a.key,a.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Os(a){const t=a.key,r=a.value,u=hn(r);return u!=="string"?[new rt(t,r,`color expected, ${u} found`)]:dn.parse(String(r))?[]:[new rt(t,r,`color expected, "${r}" found`)]}function Ul(a){const t=a.key,r=a.value,u=a.valueSpec,p=[];return Array.isArray(u.values)?u.values.indexOf(wi(r))===-1&&p.push(new rt(t,r,`expected one of [${u.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(u.values).indexOf(wi(r))===-1&&p.push(new rt(t,r,`expected one of [${Object.keys(u.values).join(", ")}], ${JSON.stringify(r)} found`)),p}function ks(a){return os(Jr(a.value))?oo(is({},a,{expressionContext:"filter",valueSpec:{value:"boolean"}})):cs(a)}function cs(a){const t=a.value,r=a.key;if(hn(t)!=="array")return[new rt(r,t,`array expected, ${hn(t)} found`)];const u=a.styleSpec;let p,x=[];if(t.length<1)return[new rt(r,t,"filter array must have at least 1 element")];switch(x=x.concat(Ul({key:`${r}[0]`,value:t[0],valueSpec:u.filter_operator,style:a.style,styleSpec:a.styleSpec})),wi(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&wi(t[1])==="$type"&&x.push(new rt(r,t,`"$type" cannot be use with operator "${t[0]}"`));case"==":case"!=":t.length!==3&&x.push(new rt(r,t,`filter array for operator "${t[0]}" must have 3 elements`));case"in":case"!in":t.length>=2&&(p=hn(t[1]),p!=="string"&&x.push(new rt(`${r}[1]`,t[1],`string expected, ${p} found`)));for(let b=2;b<t.length;b++)p=hn(t[b]),wi(t[1])==="$type"?x=x.concat(Ul({key:`${r}[${b}]`,value:t[b],valueSpec:u.geometry_type,style:a.style,styleSpec:a.styleSpec})):p!=="string"&&p!=="number"&&p!=="boolean"&&x.push(new rt(`${r}[${b}]`,t[b],`string, number, or boolean expected, ${p} found`));break;case"any":case"all":case"none":for(let b=1;b<t.length;b++)x=x.concat(cs({key:`${r}[${b}]`,value:t[b],style:a.style,styleSpec:a.styleSpec}));break;case"has":case"!has":p=hn(t[1]),t.length!==2?x.push(new rt(r,t,`filter array for "${t[0]}" operator must have 2 elements`)):p!=="string"&&x.push(new rt(`${r}[1]`,t[1],`string expected, ${p} found`))}return x}function lo(a,t){const r=a.key,u=a.validateSpec,p=a.style,x=a.styleSpec,b=a.value,T=a.objectKey,M=x[`${t}_${a.layerType}`];if(!M)return[];const I=T.match(/^(.*)-transition$/);if(t==="paint"&&I&&M[I[1]]&&M[I[1]].transition)return u({key:r,value:b,valueSpec:x.transition,style:p,styleSpec:x});const z=a.valueSpec||M[T];if(!z)return[new rt(r,b,`unknown property "${T}"`)];let F;if(hn(b)==="string"&&Va(z)&&!z.tokens&&(F=/^{([^}]+)}$/.exec(b)))return[new rt(r,b,`"${T}" does not support interpolation syntax
83
+ Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(F[1])} }\`.`)];const j=[];return a.layerType==="symbol"&&(T==="text-field"&&p&&!p.glyphs&&j.push(new rt(r,b,'use of "text-field" requires a style "glyphs" property')),T==="text-font"&&$h(Jr(b))&&wi(b.type)==="identity"&&j.push(new rt(r,b,'"text-font" does not support identity functions'))),j.concat(u({key:a.key,value:b,valueSpec:z,style:p,styleSpec:x,expressionContext:"property",propertyType:t,propertyKey:T}))}function us(a){return lo(a,"paint")}function Ru(a){return lo(a,"layout")}function Yo(a){let t=[];const r=a.value,u=a.key,p=a.style,x=a.styleSpec;if(hn(r)!=="object")return[new rt(u,r,`object expected, ${hn(r)} found`)];r.type||r.ref||t.push(new rt(u,r,'either "type" or "ref" is required'));let b=wi(r.type);const T=wi(r.ref);if(r.id){const M=wi(r.id);for(let I=0;I<a.arrayIndex;I++){const z=p.layers[I];wi(z.id)===M&&t.push(new rt(u,r.id,`duplicate layer id "${r.id}", previously used at line ${z.id.__line__}`))}}if("ref"in r){let M;["type","source","source-layer","filter","layout"].forEach((I=>{I in r&&t.push(new rt(u,r[I],`"${I}" is prohibited for ref layers`))})),p.layers.forEach((I=>{wi(I.id)===T&&(M=I)})),M?M.ref?t.push(new rt(u,r.ref,"ref cannot reference another ref layer")):b=wi(M.type):t.push(new rt(u,r.ref,`ref layer "${T}" not found`))}else if(b!=="background")if(r.source){const M=p.sources&&p.sources[r.source],I=M&&wi(M.type);M?I==="vector"&&b==="raster"?t.push(new rt(u,r.source,`layer "${r.id}" requires a raster source`)):I!=="raster-dem"&&b==="hillshade"||I!=="raster-dem"&&b==="color-relief"?t.push(new rt(u,r.source,`layer "${r.id}" requires a raster-dem source`)):I==="raster"&&b!=="raster"?t.push(new rt(u,r.source,`layer "${r.id}" requires a vector source`)):I!=="vector"||r["source-layer"]?I==="raster-dem"&&b!=="hillshade"&&b!=="color-relief"?t.push(new rt(u,r.source,"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.")):b!=="line"||!r.paint||!r.paint["line-gradient"]||I==="geojson"&&M.lineMetrics||t.push(new rt(u,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):t.push(new rt(u,r,`layer "${r.id}" must specify a "source-layer"`)):t.push(new rt(u,r.source,`source "${r.source}" not found`))}else t.push(new rt(u,r,'missing required property "source"'));return t=t.concat(va({key:u,value:r,valueSpec:x.layer,style:a.style,styleSpec:a.styleSpec,validateSpec:a.validateSpec,objectElementValidators:{"*":()=>[],type:()=>a.validateSpec({key:`${u}.type`,value:r.type,valueSpec:x.layer.type,style:a.style,styleSpec:a.styleSpec,validateSpec:a.validateSpec,object:r,objectKey:"type"}),filter:ks,layout:M=>va({layer:r,key:M.key,value:M.value,style:M.style,styleSpec:M.styleSpec,validateSpec:M.validateSpec,objectElementValidators:{"*":I=>Ru(is({layerType:b},I))}}),paint:M=>va({layer:r,key:M.key,value:M.value,style:M.style,styleSpec:M.styleSpec,validateSpec:M.validateSpec,objectElementValidators:{"*":I=>us(is({layerType:b},I))}})}})),t}function ja(a){const t=a.value,r=a.key,u=hn(t);return u!=="string"?[new rt(r,t,`string expected, ${u} found`)]:[]}const Iu={promoteId:function({key:a,value:t}){if(hn(t)==="string")return ja({key:a,value:t});{const r=[];for(const u in t)r.push(...ja({key:`${a}.${u}`,value:t[u]}));return r}}};function Qo(a){const t=a.value,r=a.key,u=a.styleSpec,p=a.style,x=a.validateSpec;if(!t.type)return[new rt(r,t,'"type" is required')];const b=wi(t.type);let T;switch(b){case"vector":case"raster":return T=va({key:r,value:t,valueSpec:u[`source_${b.replace("-","_")}`],style:a.style,styleSpec:u,objectElementValidators:Iu,validateSpec:x}),T;case"raster-dem":return T=(function(M){var I;const z=(I=M.sourceName)!==null&&I!==void 0?I:"",F=M.value,j=M.styleSpec,G=j.source_raster_dem,H=M.style;let J=[];const ne=hn(F);if(F===void 0)return J;if(ne!=="object")return J.push(new rt("source_raster_dem",F,`object expected, ${ne} found`)),J;const le=wi(F.encoding)==="custom",Ae=["redFactor","greenFactor","blueFactor","baseShift"],pe=M.value.encoding?`"${M.value.encoding}"`:"Default";for(const ve in F)!le&&Ae.includes(ve)?J.push(new rt(ve,F[ve],`In "${z}": "${ve}" is only valid when "encoding" is set to "custom". ${pe} encoding found`)):G[ve]?J=J.concat(M.validateSpec({key:ve,value:F[ve],valueSpec:G[ve],validateSpec:M.validateSpec,style:H,styleSpec:j})):J.push(new rt(ve,F[ve],`unknown property "${ve}"`));return J})({sourceName:r,value:t,style:a.style,styleSpec:u,validateSpec:x}),T;case"geojson":if(T=va({key:r,value:t,valueSpec:u.source_geojson,style:p,styleSpec:u,validateSpec:x,objectElementValidators:Iu}),t.cluster)for(const M in t.clusterProperties){const[I,z]=t.clusterProperties[M],F=typeof I=="string"?[I,["accumulated"],["get",M]]:I;T.push(...oo({key:`${r}.${M}.map`,value:z,expressionContext:"cluster-map"})),T.push(...oo({key:`${r}.${M}.reduce`,value:F,expressionContext:"cluster-reduce"}))}return T;case"video":return va({key:r,value:t,valueSpec:u.source_video,style:p,validateSpec:x,styleSpec:u});case"image":return va({key:r,value:t,valueSpec:u.source_image,style:p,validateSpec:x,styleSpec:u});case"canvas":return[new rt(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Ul({key:`${r}.type`,value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function gr(a){const t=a.value,r=a.styleSpec,u=r.light,p=a.style;let x=[];const b=hn(t);if(t===void 0)return x;if(b!=="object")return x=x.concat([new rt("light",t,`object expected, ${b} found`)]),x;for(const T in t){const M=T.match(/^(.*)-transition$/);x=x.concat(M&&u[M[1]]&&u[M[1]].transition?a.validateSpec({key:T,value:t[T],valueSpec:r.transition,validateSpec:a.validateSpec,style:p,styleSpec:r}):u[T]?a.validateSpec({key:T,value:t[T],valueSpec:u[T],validateSpec:a.validateSpec,style:p,styleSpec:r}):[new rt(T,t[T],`unknown property "${T}"`)])}return x}function zu(a){const t=a.value,r=a.styleSpec,u=r.sky,p=a.style,x=hn(t);if(t===void 0)return[];if(x!=="object")return[new rt("sky",t,`object expected, ${x} found`)];let b=[];for(const T in t)b=b.concat(u[T]?a.validateSpec({key:T,value:t[T],valueSpec:u[T],style:p,styleSpec:r}):[new rt(T,t[T],`unknown property "${T}"`)]);return b}function _f(a){const t=a.value,r=a.styleSpec,u=r.terrain,p=a.style;let x=[];const b=hn(t);if(t===void 0)return x;if(b!=="object")return x=x.concat([new rt("terrain",t,`object expected, ${b} found`)]),x;for(const T in t)x=x.concat(u[T]?a.validateSpec({key:T,value:t[T],valueSpec:u[T],validateSpec:a.validateSpec,style:p,styleSpec:r}):[new rt(T,t[T],`unknown property "${T}"`)]);return x}function Dc(a){let t=[];const r=a.value,u=a.key;if(Array.isArray(r)){const p=[],x=[];for(const b in r)r[b].id&&p.includes(r[b].id)&&t.push(new rt(u,r,`all the sprites' ids must be unique, but ${r[b].id} is duplicated`)),p.push(r[b].id),r[b].url&&x.includes(r[b].url)&&t.push(new rt(u,r,`all the sprites' URLs must be unique, but ${r[b].url} is duplicated`)),x.push(r[b].url),t=t.concat(va({key:`${u}[${b}]`,value:r[b],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:a.validateSpec}));return t}return ja({key:u,value:r})}function Oc(a){return t=a.value,t&&t.constructor===Object?[]:[new rt(a.key,a.value,`object expected, ${hn(a.value)} found`)];var t}const ea={"*":()=>[],array:jh,boolean:function(a){const t=a.value,r=a.key,u=hn(t);return u!=="boolean"?[new rt(r,t,`boolean expected, ${u} found`)]:[]},number:ao,color:Os,constants:_a,enum:Ul,filter:ks,function:so,layer:Yo,object:va,source:Qo,light:gr,sky:zu,terrain:_f,projection:function(a){const t=a.value,r=a.styleSpec,u=r.projection,p=a.style,x=hn(t);if(t===void 0)return[];if(x!=="object")return[new rt("projection",t,`object expected, ${x} found`)];let b=[];for(const T in t)b=b.concat(u[T]?a.validateSpec({key:T,value:t[T],valueSpec:u[T],style:p,styleSpec:r}):[new rt(T,t[T],`unknown property "${T}"`)]);return b},projectionDefinition:function(a){const t=a.key;let r=a.value;r=r instanceof String?r.valueOf():r;const u=hn(r);return u!=="array"||(function(p){return Array.isArray(p)&&p.length===3&&typeof p[0]=="string"&&typeof p[1]=="string"&&typeof p[2]=="number"})(r)||(function(p){return!!["interpolate","step","literal"].includes(p[0])})(r)?["array","string"].includes(u)?[]:[new rt(t,r,`projection expected, invalid type "${u}" found`)]:[new rt(t,r,`projection expected, invalid array ${JSON.stringify(r)} found`)]},string:ja,formatted:function(a){return ja(a).length===0?[]:oo(a)},resolvedImage:function(a){return ja(a).length===0?[]:oo(a)},padding:function(a){const t=a.key,r=a.value;if(hn(r)==="array"){if(r.length<1||r.length>4)return[new rt(t,r,`padding requires 1 to 4 values; ${r.length} values found`)];const u={type:"number"};let p=[];for(let x=0;x<r.length;x++)p=p.concat(a.validateSpec({key:`${t}[${x}]`,value:r[x],validateSpec:a.validateSpec,valueSpec:u}));return p}return ao({key:t,value:r,valueSpec:{}})},numberArray:function(a){const t=a.key,r=a.value;if(hn(r)==="array"){const u={type:"number"};if(r.length<1)return[new rt(t,r,"array length at least 1 expected, length 0 found")];let p=[];for(let x=0;x<r.length;x++)p=p.concat(a.validateSpec({key:`${t}[${x}]`,value:r[x],validateSpec:a.validateSpec,valueSpec:u}));return p}return ao({key:t,value:r,valueSpec:{}})},colorArray:function(a){const t=a.key,r=a.value;if(hn(r)==="array"){if(r.length<1)return[new rt(t,r,"array length at least 1 expected, length 0 found")];let u=[];for(let p=0;p<r.length;p++)u=u.concat(Os({key:`${t}[${p}]`,value:r[p]}));return u}return Os({key:t,value:r})},variableAnchorOffsetCollection:function(a){const t=a.key,r=a.value,u=hn(r),p=a.styleSpec;if(u!=="array"||r.length<1||r.length%2!=0)return[new rt(t,r,"variableAnchorOffsetCollection requires a non-empty array of even length")];let x=[];for(let b=0;b<r.length;b+=2)x=x.concat(Ul({key:`${t}[${b}]`,value:r[b],valueSpec:p.layout_symbol["text-anchor"]})),x=x.concat(jh({key:`${t}[${b+1}]`,value:r[b+1],valueSpec:{length:2,value:"number"},validateSpec:a.validateSpec,style:a.style,styleSpec:p}));return x},sprite:Dc,state:Oc};function li(a){const t=a.value,r=a.valueSpec,u=a.styleSpec;return a.validateSpec=li,r.expression&&$h(wi(t))?so(a):r.expression&&Ic(Jr(t))?oo(a):r.type&&ea[r.type]?ea[r.type](a):va(is({},a,{valueSpec:r.type?u[r.type]:r}))}function Du(a){const t=a.value,r=a.key,u=ja(a);return u.length||(t.indexOf("{fontstack}")===-1&&u.push(new rt(r,t,'"glyphs" url must include a "{fontstack}" token')),t.indexOf("{range}")===-1&&u.push(new rt(r,t,'"glyphs" url must include a "{range}" token'))),u}function Rr(a,t=Ie){let r=[];return r=r.concat(li({key:"",value:a,valueSpec:t.$root,styleSpec:t,style:a,validateSpec:li,objectElementValidators:{glyphs:Du,"*":()=>[]}})),a.constants&&(r=r.concat(_a({key:"constants",value:a.constants}))),Wo(r)}function Zr(a){return function(t){return a(Object.assign({},t,{validateSpec:li}))}}function Wo(a){return[].concat(a).sort(((t,r)=>t.line-r.line))}function Sr(a){return function(...t){return Wo(a.apply(this,t))}}Rr.source=Sr(Zr(Qo)),Rr.sprite=Sr(Zr(Dc)),Rr.glyphs=Sr(Zr(Du)),Rr.light=Sr(Zr(gr)),Rr.sky=Sr(Zr(zu)),Rr.terrain=Sr(Zr(_f)),Rr.state=Sr(Zr(Oc)),Rr.layer=Sr(Zr(Yo)),Rr.filter=Sr(Zr(ks)),Rr.paintProperty=Sr(Zr(us)),Rr.layoutProperty=Sr(Zr(Ru));const xa=Rr,ym=xa.light,Zh=xa.sky,_m=xa.paintProperty,kc=xa.layoutProperty;function Ko(a,t){let r=!1;if(t&&t.length)for(const u of t)a.fire(new Pt(new Error(u.message))),r=!0;return r}class $l{constructor(t,r,u){const p=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;const b=new Int32Array(this.arrayBuffer);t=b[0],this.d=(r=b[1])+2*(u=b[2]);for(let M=0;M<this.d*this.d;M++){const I=b[3+M],z=b[3+M+1];p.push(I===z?null:b.subarray(I,z))}const T=b[3+p.length+1];this.keys=b.subarray(b[3+p.length],T),this.bboxes=b.subarray(T),this.insert=this._insertReadonly}else{this.d=r+2*u;for(let b=0;b<this.d*this.d;b++)p.push([]);this.keys=[],this.bboxes=[]}this.n=r,this.extent=t,this.padding=u,this.scale=r/t,this.uid=0;const x=u/r*t;this.min=-x,this.max=t+x}insert(t,r,u,p,x){this._forEachCell(r,u,p,x,this._insertCell,this.uid++,void 0,void 0),this.keys.push(t),this.bboxes.push(r),this.bboxes.push(u),this.bboxes.push(p),this.bboxes.push(x)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(t,r,u,p,x,b){this.cells[x].push(b)}query(t,r,u,p,x){const b=this.min,T=this.max;if(t<=b&&r<=b&&T<=u&&T<=p&&!x)return Array.prototype.slice.call(this.keys);{const M=[];return this._forEachCell(t,r,u,p,this._queryCell,M,{},x),M}}_queryCell(t,r,u,p,x,b,T,M){const I=this.cells[x];if(I!==null){const z=this.keys,F=this.bboxes;for(let j=0;j<I.length;j++){const G=I[j];if(T[G]===void 0){const H=4*G;(M?M(F[H+0],F[H+1],F[H+2],F[H+3]):t<=F[H+2]&&r<=F[H+3]&&u>=F[H+0]&&p>=F[H+1])?(T[G]=!0,b.push(z[G])):T[G]=!1}}}}_forEachCell(t,r,u,p,x,b,T,M){const I=this._convertToCellCoord(t),z=this._convertToCellCoord(r),F=this._convertToCellCoord(u),j=this._convertToCellCoord(p);for(let G=I;G<=F;G++)for(let H=z;H<=j;H++){const J=this.d*H+G;if((!M||M(this._convertFromCellCoord(G),this._convertFromCellCoord(H),this._convertFromCellCoord(G+1),this._convertFromCellCoord(H+1)))&&x.call(this,t,r,u,p,J,b,T,M))return}}_convertFromCellCoord(t){return(t-this.padding)/this.scale}_convertToCellCoord(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const t=this.cells,r=3+this.cells.length+1+1;let u=0;for(let b=0;b<this.cells.length;b++)u+=this.cells[b].length;const p=new Int32Array(r+u+this.keys.length+this.bboxes.length);p[0]=this.extent,p[1]=this.n,p[2]=this.padding;let x=r;for(let b=0;b<t.length;b++){const T=t[b];p[3+b]=x,p.set(T,x),x+=T.length}return p[3+t.length]=x,p.set(this.keys,x),x+=this.keys.length,p[3+t.length+1]=x,p.set(this.bboxes,x),x+=this.bboxes.length,p.buffer}static serialize(t,r){const u=t.toArrayBuffer();return r&&r.push(u),{buffer:u}}static deserialize(t){return new $l(t.buffer)}}const Za={};function Ct(a,t,r={}){if(Za[a])throw new Error(`${a} is already registered.`);Object.defineProperty(t,"_classRegistryKey",{value:a,writeable:!1}),Za[a]={klass:t,omit:r.omit||[],shallow:r.shallow||[]}}Ct("Object",Object),Ct("Set",Set),Ct("TransferableGridIndex",$l),Ct("Color",dn),Ct("Error",Error),Ct("AJAXError",me),Ct("ResolvedImage",Ur),Ct("StylePropertyFunction",Fl),Ct("StyleExpression",Vh,{omit:["_evaluator"]}),Ct("ZoomDependentExpression",io),Ct("ZoomConstantExpression",jr),Ct("CompoundExpression",pa,{omit:["_evaluate"]});for(const a in Rc)Rc[a]._classRegistryKey||Ct(`Expression_${a}`,Rc[a]);function Vl(a){return a&&typeof ArrayBuffer<"u"&&(a instanceof ArrayBuffer||a.constructor&&a.constructor.name==="ArrayBuffer")}function Ou(a){return a.$name||a.constructor._classRegistryKey}function Jo(a){return!(function(t){if(t===null||typeof t!="object")return!1;const r=Ou(t);return!(!r||r==="Object")})(a)&&(a==null||typeof a=="boolean"||typeof a=="number"||typeof a=="string"||a instanceof Boolean||a instanceof Number||a instanceof String||a instanceof Date||a instanceof RegExp||a instanceof Blob||a instanceof Error||Vl(a)||Br(a)||ArrayBuffer.isView(a)||a instanceof ImageData)}function el(a,t){if(Jo(a))return(Vl(a)||Br(a))&&t&&t.push(a),ArrayBuffer.isView(a)&&t&&t.push(a.buffer),a instanceof ImageData&&t&&t.push(a.data.buffer),a;if(Array.isArray(a)){const x=[];for(const b of a)x.push(el(b,t));return x}if(typeof a!="object")throw new Error("can't serialize object of type "+typeof a);const r=Ou(a);if(!r)throw new Error(`can't serialize object of unregistered class ${a.constructor.name}`);if(!Za[r])throw new Error(`${r} is not registered.`);const{klass:u}=Za[r],p=u.serialize?u.serialize(a,t):{};if(u.serialize){if(t&&p===t[t.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(const x in a){if(!a.hasOwnProperty(x)||Za[r].omit.indexOf(x)>=0)continue;const b=a[x];p[x]=Za[r].shallow.indexOf(x)>=0?b:el(b,t)}a instanceof Error&&(p.message=a.message)}if(p.$name)throw new Error("$name property is reserved for worker serialization logic.");return r!=="Object"&&(p.$name=r),p}function tl(a){if(Jo(a))return a;if(Array.isArray(a))return a.map(tl);if(typeof a!="object")throw new Error("can't deserialize object of type "+typeof a);const t=Ou(a)||"Object";if(!Za[t])throw new Error(`can't deserialize unregistered class ${t}`);const{klass:r}=Za[t];if(!r)throw new Error(`can't deserialize unregistered class ${t}`);if(r.deserialize)return r.deserialize(a);const u=Object.create(r.prototype);for(const p of Object.keys(a)){if(p==="$name")continue;const x=a[p];u[p]=Za[t].shallow.indexOf(p)>=0?x:tl(x)}return u}class jl{constructor(){this.first=!0}update(t,r){const u=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=u,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=u,!0):(this.lastFloorZoom>u?(this.lastIntegerZoom=u+1,this.lastIntegerZoomTime=r):this.lastFloorZoom<u&&(this.lastIntegerZoom=u,this.lastIntegerZoomTime=r),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=u,!0))}}const ln={"Latin-1 Supplement":a=>a>=128&&a<=255,"Hangul Jamo":a=>a>=4352&&a<=4607,Khmer:a=>a>=6016&&a<=6143,"General Punctuation":a=>a>=8192&&a<=8303,"Letterlike Symbols":a=>a>=8448&&a<=8527,"Number Forms":a=>a>=8528&&a<=8591,"Miscellaneous Technical":a=>a>=8960&&a<=9215,"Control Pictures":a=>a>=9216&&a<=9279,"Optical Character Recognition":a=>a>=9280&&a<=9311,"Enclosed Alphanumerics":a=>a>=9312&&a<=9471,"Geometric Shapes":a=>a>=9632&&a<=9727,"Miscellaneous Symbols":a=>a>=9728&&a<=9983,"Miscellaneous Symbols and Arrows":a=>a>=11008&&a<=11263,"Ideographic Description Characters":a=>a>=12272&&a<=12287,"CJK Symbols and Punctuation":a=>a>=12288&&a<=12351,Hiragana:a=>a>=12352&&a<=12447,Katakana:a=>a>=12448&&a<=12543,Kanbun:a=>a>=12688&&a<=12703,"CJK Strokes":a=>a>=12736&&a<=12783,"Enclosed CJK Letters and Months":a=>a>=12800&&a<=13055,"CJK Compatibility":a=>a>=13056&&a<=13311,"Yijing Hexagram Symbols":a=>a>=19904&&a<=19967,"CJK Unified Ideographs":a=>a>=19968&&a<=40959,"Hangul Syllables":a=>a>=44032&&a<=55215,"Private Use Area":a=>a>=57344&&a<=63743,"Vertical Forms":a=>a>=65040&&a<=65055,"CJK Compatibility Forms":a=>a>=65072&&a<=65103,"Small Form Variants":a=>a>=65104&&a<=65135,"Halfwidth and Fullwidth Forms":a=>a>=65280&&a<=65519};function Bs(a){for(const t of a)if(il(t.charCodeAt(0)))return!0;return!1}function vf(a){for(const t of a)if(!Bc(t.charCodeAt(0)))return!1;return!0}function ku(a){const t=a.map((r=>{try{return new RegExp(`\\p{sc=${r}}`,"u").source}catch{return null}})).filter((r=>r));return new RegExp(t.join("|"),"u")}const nl=ku(["Arab","Dupl","Mong","Ougr","Syrc"]);function Bc(a){return!nl.test(String.fromCodePoint(a))}const Bu=ku(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function il(a){return!(a!==746&&a!==747&&(a<4352||!(ln["CJK Compatibility Forms"](a)&&!(a>=65097&&a<=65103)||ln["CJK Compatibility"](a)||ln["CJK Strokes"](a)||!(!ln["CJK Symbols and Punctuation"](a)||a>=12296&&a<=12305||a>=12308&&a<=12319||a===12336)||ln["Enclosed CJK Letters and Months"](a)||ln["Ideographic Description Characters"](a)||ln.Kanbun(a)||ln.Katakana(a)&&a!==12540||!(!ln["Halfwidth and Fullwidth Forms"](a)||a===65288||a===65289||a===65293||a>=65306&&a<=65310||a===65339||a===65341||a===65343||a>=65371&&a<=65503||a===65507||a>=65512&&a<=65519)||!(!ln["Small Form Variants"](a)||a>=65112&&a<=65118||a>=65123&&a<=65126)||ln["Vertical Forms"](a)||ln["Yijing Hexagram Symbols"](a)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(a))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(a))||Bu.test(String.fromCodePoint(a)))))}function Fu(a){return!(il(a)||(function(t){return!!(ln["Latin-1 Supplement"](t)&&(t===167||t===169||t===174||t===177||t===188||t===189||t===190||t===215||t===247)||ln["General Punctuation"](t)&&(t===8214||t===8224||t===8225||t===8240||t===8241||t===8251||t===8252||t===8258||t===8263||t===8264||t===8265||t===8273)||ln["Letterlike Symbols"](t)||ln["Number Forms"](t)||ln["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||t===9003||t>=9085&&t<=9114||t>=9150&&t<=9165||t===9167||t>=9169&&t<=9179||t>=9186&&t<=9215)||ln["Control Pictures"](t)&&t!==9251||ln["Optical Character Recognition"](t)||ln["Enclosed Alphanumerics"](t)||ln["Geometric Shapes"](t)||ln["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||ln["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||ln["CJK Symbols and Punctuation"](t)||ln.Katakana(t)||ln["Private Use Area"](t)||ln["CJK Compatibility Forms"](t)||ln["Small Form Variants"](t)||ln["Halfwidth and Fullwidth Forms"](t)||t===8734||t===8756||t===8757||t>=9984&&t<=10087||t>=10102&&t<=10131||t===65532||t===65533)})(a))}const xf=ku(["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"]);function rl(a){return xf.test(String.fromCodePoint(a))}function bf(a,t){return!(!t&&rl(a)||a>=2304&&a<=3583||a>=3840&&a<=4255||ln.Khmer(a))}function co(a){for(const t of a)if(rl(t.charCodeAt(0)))return!0;return!1}const Fs=new class{constructor(){this.TIMEOUT=5e3,this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null,this.loadScriptResolve=()=>{}}setState(a){this.pluginStatus=a.pluginStatus,this.pluginURL=a.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(a){if(Fs.isParsed())throw new Error("RTL text plugin already registered.");this.applyArabicShaping=a.applyArabicShaping,this.processBidirectionalText=a.processBidirectionalText,this.processStyledBidirectionalText=a.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getRTLTextPluginStatus(){return this.pluginStatus}syncState(a,t){return c(this,void 0,void 0,(function*(){if(this.isParsed())return this.getState();if(a.pluginStatus!=="loading")return this.setState(a),a;const r=a.pluginURL,u=new Promise((x=>{this.loadScriptResolve=x}));t(r);const p=new Promise((x=>setTimeout((()=>x()),this.TIMEOUT)));if(yield Promise.race([u,p]),this.isParsed()){const x={pluginStatus:"loaded",pluginURL:r};return this.setState(x),x}throw this.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${r}`)}))}};class Xn{constructor(t,r){this.isSupportedScript=uo,this.zoom=t,r?(this.now=r.now||0,this.fadeDuration=r.fadeDuration||0,this.zoomHistory=r.zoomHistory||new jl,this.transition=r.transition||{}):(this.now=0,this.fadeDuration=0,this.zoomHistory=new jl,this.transition={})}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const t=this.zoom,r=t-Math.floor(t),u=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:r+(1-r)*u}:{fromScale:.5,toScale:1,t:1-(1-u)*r}}}function uo(a){return(function(t,r){for(const u of t)if(!bf(u.charCodeAt(0),r))return!1;return!0})(a,Fs.getRTLTextPluginStatus()==="loaded")}class Ga{constructor(t,r,u){this.property=t,this.value=r,this.expression=(function(p,x,b){if($h(p))return new Fl(p,x);if(Ic(p)){const T=Ho(p,x,b);if(T.result==="error")throw new Error(T.value.map((M=>`${M.key}: ${M.message}`)).join(", "));return T.value}{let T=p;return x.type==="color"&&typeof p=="string"?T=dn.parse(p):x.type!=="padding"||typeof p!="number"&&!Array.isArray(p)?x.type!=="numberArray"||typeof p!="number"&&!Array.isArray(p)?x.type!=="colorArray"||typeof p!="string"&&!Array.isArray(p)?x.type==="variableAnchorOffsetCollection"&&Array.isArray(p)?T=Li.parse(p):x.type==="projectionDefinition"&&typeof p=="string"&&(T=dr.parse(p)):T=nr.parse(p):T=tr.parse(p):T=Ri.parse(p),{globalStateRefs:new Set,_globalState:null,kind:"constant",evaluate:()=>T}}})(r===void 0?t.specification.default:r,t.specification,u)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}possiblyEvaluate(t,r,u){return this.property.possiblyEvaluate(this,t,r,u)}}class al{constructor(t,r){this.property=t,this.value=new Ga(t,void 0,r)}transitioned(t,r){return new Zl(this.property,this.value,r,Ht({},t.transition,this.transition),t.now)}untransitioned(){return new Zl(this.property,this.value,null,{},0)}}class Nu{constructor(t,r){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues),this._globalState=r}getValue(t){return kr(this._values[t].value.value)}setValue(t,r){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new al(this._values[t].property,this._globalState)),this._values[t].value=new Ga(this._values[t].property,r===null?void 0:kr(r),this._globalState)}getTransition(t){return kr(this._values[t].transition)}setTransition(t,r){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new al(this._values[t].property,this._globalState)),this._values[t].transition=kr(r)||void 0}serialize(){const t={};for(const r of Object.keys(this._values)){const u=this.getValue(r);u!==void 0&&(t[r]=u);const p=this.getTransition(r);p!==void 0&&(t[`${r}-transition`]=p)}return t}transitioned(t,r){const u=new Fc(this._properties);for(const p of Object.keys(this._values))u._values[p]=this._values[p].transitioned(t,r._values[p]);return u}untransitioned(){const t=new Fc(this._properties);for(const r of Object.keys(this._values))t._values[r]=this._values[r].untransitioned();return t}}class Zl{constructor(t,r,u,p,x){this.property=t,this.value=r,this.begin=x+p.delay||0,this.end=this.begin+p.duration||0,t.specification.transition&&(p.delay||p.duration)&&(this.prior=u)}possiblyEvaluate(t,r,u){const p=t.now||0,x=this.value.possiblyEvaluate(t,r,u),b=this.prior;if(b){if(p>this.end)return this.prior=null,x;if(this.value.isDataDriven())return this.prior=null,x;if(p<this.begin)return b.possiblyEvaluate(t,r,u);{const T=(p-this.begin)/(this.end-this.begin);return this.property.interpolate(b.possiblyEvaluate(t,r,u),x,pt(T))}}return x}}class Fc{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)}possiblyEvaluate(t,r,u){const p=new Uu(this._properties);for(const x of Object.keys(this._values))p._values[x]=this._values[x].possiblyEvaluate(t,r,u);return p}hasTransition(){for(const t of Object.keys(this._values))if(this._values[t].prior)return!0;return!1}}class Gl{constructor(t,r){this._properties=t,this._values=Object.create(t.defaultPropertyValues),this._globalState=r}hasValue(t){return this._values[t].value!==void 0}getValue(t){return kr(this._values[t].value)}setValue(t,r){this._values[t]=new Ga(this._values[t].property,r===null?void 0:kr(r),this._globalState)}serialize(){const t={};for(const r of Object.keys(this._values)){const u=this.getValue(r);u!==void 0&&(t[r]=u)}return t}possiblyEvaluate(t,r,u){const p=new Uu(this._properties);for(const x of Object.keys(this._values))p._values[x]=this._values[x].possiblyEvaluate(t,r,u);return p}}class hs{constructor(t,r,u){this.property=t,this.value=r,this.parameters=u}isConstant(){return this.value.kind==="constant"}constantOr(t){return this.value.kind==="constant"?this.value.value:t}evaluate(t,r,u,p){return this.property.evaluate(this.value,this.parameters,t,r,u,p)}}class Uu{constructor(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)}get(t){return this._values[t]}}class Mt{constructor(t){this.specification=t}possiblyEvaluate(t,r){if(t.isDataDriven())throw new Error("Value should not be data driven");return t.expression.evaluate(r)}interpolate(t,r,u){const p=Ua[this.specification.type];return p?p(t,r,u):t}}class $t{constructor(t,r){this.specification=t,this.overrides=r}possiblyEvaluate(t,r,u,p){return new hs(this,t.expression.kind==="constant"||t.expression.kind==="camera"?{kind:"constant",value:t.expression.evaluate(r,null,{},u,p)}:t.expression,r)}interpolate(t,r,u){if(t.value.kind!=="constant"||r.value.kind!=="constant")return t;if(t.value.value===void 0||r.value.value===void 0)return new hs(this,{kind:"constant",value:void 0},t.parameters);const p=Ua[this.specification.type];if(p){const x=p(t.value.value,r.value.value,u);return new hs(this,{kind:"constant",value:x},t.parameters)}return t}evaluate(t,r,u,p,x,b){return t.kind==="constant"?t.value:t.evaluate(r,u,p,x,b)}}class ql extends $t{possiblyEvaluate(t,r,u,p){if(t.value===void 0)return new hs(this,{kind:"constant",value:void 0},r);if(t.expression.kind==="constant"){const x=t.expression.evaluate(r,null,{},u,p),b=t.property.specification.type==="resolvedImage"&&typeof x!="string"?x.name:x,T=this._calculate(b,b,b,r);return new hs(this,{kind:"constant",value:T},r)}if(t.expression.kind==="camera"){const x=this._calculate(t.expression.evaluate({zoom:r.zoom-1}),t.expression.evaluate({zoom:r.zoom}),t.expression.evaluate({zoom:r.zoom+1}),r);return new hs(this,{kind:"constant",value:x},r)}return new hs(this,t.expression,r)}evaluate(t,r,u,p,x,b){if(t.kind==="source"){const T=t.evaluate(r,u,p,x,b);return this._calculate(T,T,T,r)}return t.kind==="composite"?this._calculate(t.evaluate({zoom:Math.floor(r.zoom)-1},u,p),t.evaluate({zoom:Math.floor(r.zoom)},u,p),t.evaluate({zoom:Math.floor(r.zoom)+1},u,p),r):t.value}_calculate(t,r,u,p){return p.zoom>p.zoomHistory.lastIntegerZoom?{from:t,to:r}:{from:u,to:r}}interpolate(t){return t}}class Gh{constructor(t){this.specification=t}possiblyEvaluate(t,r,u,p){if(t.value!==void 0){if(t.expression.kind==="constant"){const x=t.expression.evaluate(r,null,{},u,p);return this._calculate(x,x,x,r)}return this._calculate(t.expression.evaluate(new Xn(Math.floor(r.zoom-1),r)),t.expression.evaluate(new Xn(Math.floor(r.zoom),r)),t.expression.evaluate(new Xn(Math.floor(r.zoom+1),r)),r)}}_calculate(t,r,u,p){return p.zoom>p.zoomHistory.lastIntegerZoom?{from:t,to:r}:{from:u,to:r}}interpolate(t){return t}}class Nc{constructor(t){this.specification=t}possiblyEvaluate(t,r,u,p){return!!t.expression.evaluate(r,null,{},u,p)}interpolate(){return!1}}class ci{constructor(t){this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const r in t){const u=t[r];u.specification.overridable&&this.overridableProperties.push(r);const p=this.defaultPropertyValues[r]=new Ga(u,void 0,void 0),x=this.defaultTransitionablePropertyValues[r]=new al(u,void 0);this.defaultTransitioningPropertyValues[r]=x.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=p.possiblyEvaluate({})}}}Ct("DataDrivenProperty",$t),Ct("DataConstantProperty",Mt),Ct("CrossFadedDataDrivenProperty",ql),Ct("CrossFadedProperty",Gh),Ct("ColorRampProperty",Nc);const ba="-transition";class yr extends Ut{constructor(t,r,u){if(super(),this.id=t.id,this.type=t.type,this._globalState=u,this._featureFilter={filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set},t.type!=="custom"&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,t.type!=="background"&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter,this._featureFilter=Kr(t.filter,u)),r.layout&&(this._unevaluatedLayout=new Gl(r.layout,u)),r.paint)){this._transitionablePaint=new Nu(r.paint,u);for(const p in t.paint)this.setPaintProperty(p,t.paint[p],{validate:!1});for(const p in t.layout)this.setLayoutProperty(p,t.layout[p],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Uu(r.paint)}}setFilter(t){this.filter=t,this._featureFilter=Kr(t,this._globalState)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(t){return t==="visibility"?this.visibility:this._unevaluatedLayout.getValue(t)}getLayoutAffectingGlobalStateRefs(){const t=new Set;if(this._unevaluatedLayout)for(const r in this._unevaluatedLayout._values){const u=this._unevaluatedLayout._values[r];for(const p of u.getGlobalStateRefs())t.add(p)}for(const r of this._featureFilter.getGlobalStateRefs())t.add(r);return t}getPaintAffectingGlobalStateRefs(){var t;const r=new globalThis.Map;if(this._transitionablePaint)for(const u in this._transitionablePaint._values){const p=this._transitionablePaint._values[u].value;for(const x of p.getGlobalStateRefs()){const b=(t=r.get(x))!==null&&t!==void 0?t:[];b.push({name:u,value:p.value}),r.set(x,b)}}return r}setLayoutProperty(t,r,u={}){r!=null&&this._validate(kc,`layers.${this.id}.layout.${t}`,t,r,u)||(t!=="visibility"?this._unevaluatedLayout.setValue(t,r):this.visibility=r)}getPaintProperty(t){return t.endsWith(ba)?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)}setPaintProperty(t,r,u={}){if(r!=null&&this._validate(_m,`layers.${this.id}.paint.${t}`,t,r,u))return!1;if(t.endsWith(ba))return this._transitionablePaint.setTransition(t.slice(0,-11),r||void 0),!1;{const p=this._transitionablePaint._values[t],x=p.property.specification["property-type"]==="cross-faded-data-driven",b=p.value.isDataDriven(),T=p.value;this._transitionablePaint.setValue(t,r),this._handleSpecialPaintPropertyUpdate(t);const M=this._transitionablePaint._values[t].value;return M.isDataDriven()||b||x||this._handleOverridablePaintPropertyUpdate(t,T,M)}}_handleSpecialPaintPropertyUpdate(t){}_handleOverridablePaintPropertyUpdate(t,r,u){return!1}isHidden(t){return!!(this.minzoom&&t<this.minzoom)||!!(this.maxzoom&&t>=this.maxzoom)||this.visibility==="none"}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(t,r){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,r)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,r)}serialize(){const t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),ai(t,((r,u)=>!(r===void 0||u==="layout"&&!Object.keys(r).length||u==="paint"&&!Object.keys(r).length)))}_validate(t,r,u,p,x={}){return(!x||x.validate!==!1)&&Ko(this,t.call(xa,{key:r,layerType:this.type,objectKey:u,value:p,styleSpec:Ie,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const t in this.paint._values){const r=this.paint.get(t);if(r instanceof hs&&Va(r.property.specification)&&(r.value.kind==="source"||r.value.kind==="composite")&&r.value.isStateDependent)return!0}return!1}}let ho;var Vp={get paint(){return ho=ho||new ci({"raster-opacity":new Mt(Ie.paint_raster["raster-opacity"]),"raster-hue-rotate":new Mt(Ie.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Mt(Ie.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Mt(Ie.paint_raster["raster-brightness-max"]),"raster-saturation":new Mt(Ie.paint_raster["raster-saturation"]),"raster-contrast":new Mt(Ie.paint_raster["raster-contrast"]),"raster-resampling":new Mt(Ie.paint_raster["raster-resampling"]),"raster-fade-duration":new Mt(Ie.paint_raster["raster-fade-duration"])})}};class sl extends yr{constructor(t,r){super(t,Vp,r)}}const wa={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class mi{constructor(t,r){this._structArray=t,this._pos1=r*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class ui{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(t,r){return t._trim(),r&&(t.isTransferred=!0,r.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){const r=Object.create(this.prototype);return r.arrayBuffer=t.arrayBuffer,r.length=t.length,r.capacity=t.arrayBuffer.byteLength/r.bytesPerElement,r._refreshViews(),r}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(t){this.reserve(t),this.length=t}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const r=this.uint8;this._refreshViews(),r&&this.uint8.set(r)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function Yn(a,t=1){let r=0,u=0;return{members:a.map((p=>{const x=wa[p.type].BYTES_PER_ELEMENT,b=r=tn(r,Math.max(t,x)),T=p.components||1;return u=Math.max(u,x),r+=x*T,{name:p.name,type:p.type,components:T,offset:b}})),size:tn(r,Math.max(u,t)),alignment:t}}function tn(a,t){return Math.ceil(a/t)*t}class kn extends ui{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r){const u=this.length;return this.resize(u+1),this.emplace(u,t,r)}emplace(t,r,u){const p=2*t;return this.int16[p+0]=r,this.int16[p+1]=u,t}}kn.prototype.bytesPerElement=4,Ct("StructArrayLayout2i4",kn);class _i extends ui{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,u){const p=this.length;return this.resize(p+1),this.emplace(p,t,r,u)}emplace(t,r,u,p){const x=3*t;return this.int16[x+0]=r,this.int16[x+1]=u,this.int16[x+2]=p,t}}_i.prototype.bytesPerElement=6,Ct("StructArrayLayout3i6",_i);class Hl extends ui{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,u,p){const x=this.length;return this.resize(x+1),this.emplace(x,t,r,u,p)}emplace(t,r,u,p,x){const b=4*t;return this.int16[b+0]=r,this.int16[b+1]=u,this.int16[b+2]=p,this.int16[b+3]=x,t}}Hl.prototype.bytesPerElement=8,Ct("StructArrayLayout4i8",Hl);class Ns extends ui{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,u,p,x,b){const T=this.length;return this.resize(T+1),this.emplace(T,t,r,u,p,x,b)}emplace(t,r,u,p,x,b,T){const M=6*t;return this.int16[M+0]=r,this.int16[M+1]=u,this.int16[M+2]=p,this.int16[M+3]=x,this.int16[M+4]=b,this.int16[M+5]=T,t}}Ns.prototype.bytesPerElement=12,Ct("StructArrayLayout2i4i12",Ns);class fo extends ui{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,u,p,x,b){const T=this.length;return this.resize(T+1),this.emplace(T,t,r,u,p,x,b)}emplace(t,r,u,p,x,b,T){const M=4*t,I=8*t;return this.int16[M+0]=r,this.int16[M+1]=u,this.uint8[I+4]=p,this.uint8[I+5]=x,this.uint8[I+6]=b,this.uint8[I+7]=T,t}}fo.prototype.bytesPerElement=8,Ct("StructArrayLayout2i4ub8",fo);class ds extends ui{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r){const u=this.length;return this.resize(u+1),this.emplace(u,t,r)}emplace(t,r,u){const p=2*t;return this.float32[p+0]=r,this.float32[p+1]=u,t}}ds.prototype.bytesPerElement=8,Ct("StructArrayLayout2f8",ds);class fs extends ui{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,u,p,x,b,T,M,I,z){const F=this.length;return this.resize(F+1),this.emplace(F,t,r,u,p,x,b,T,M,I,z)}emplace(t,r,u,p,x,b,T,M,I,z,F){const j=10*t;return this.uint16[j+0]=r,this.uint16[j+1]=u,this.uint16[j+2]=p,this.uint16[j+3]=x,this.uint16[j+4]=b,this.uint16[j+5]=T,this.uint16[j+6]=M,this.uint16[j+7]=I,this.uint16[j+8]=z,this.uint16[j+9]=F,t}}fs.prototype.bytesPerElement=20,Ct("StructArrayLayout10ui20",fs);class ol extends ui{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,u,p,x,b,T,M){const I=this.length;return this.resize(I+1),this.emplace(I,t,r,u,p,x,b,T,M)}emplace(t,r,u,p,x,b,T,M,I){const z=8*t;return this.uint16[z+0]=r,this.uint16[z+1]=u,this.uint16[z+2]=p,this.uint16[z+3]=x,this.uint16[z+4]=b,this.uint16[z+5]=T,this.uint16[z+6]=M,this.uint16[z+7]=I,t}}ol.prototype.bytesPerElement=16,Ct("StructArrayLayout8ui16",ol);class qh extends ui{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,u,p,x,b,T,M,I,z,F,j){const G=this.length;return this.resize(G+1),this.emplace(G,t,r,u,p,x,b,T,M,I,z,F,j)}emplace(t,r,u,p,x,b,T,M,I,z,F,j,G){const H=12*t;return this.int16[H+0]=r,this.int16[H+1]=u,this.int16[H+2]=p,this.int16[H+3]=x,this.uint16[H+4]=b,this.uint16[H+5]=T,this.uint16[H+6]=M,this.uint16[H+7]=I,this.int16[H+8]=z,this.int16[H+9]=F,this.int16[H+10]=j,this.int16[H+11]=G,t}}qh.prototype.bytesPerElement=24,Ct("StructArrayLayout4i4ui4i24",qh);class ni extends ui{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,u){const p=this.length;return this.resize(p+1),this.emplace(p,t,r,u)}emplace(t,r,u,p){const x=3*t;return this.float32[x+0]=r,this.float32[x+1]=u,this.float32[x+2]=p,t}}ni.prototype.bytesPerElement=12,Ct("StructArrayLayout3f12",ni);class $u extends ui{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){const r=this.length;return this.resize(r+1),this.emplace(r,t)}emplace(t,r){return this.uint32[1*t+0]=r,t}}$u.prototype.bytesPerElement=4,Ct("StructArrayLayout1ul4",$u);class Vu extends ui{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,u,p,x,b,T,M,I){const z=this.length;return this.resize(z+1),this.emplace(z,t,r,u,p,x,b,T,M,I)}emplace(t,r,u,p,x,b,T,M,I,z){const F=10*t,j=5*t;return this.int16[F+0]=r,this.int16[F+1]=u,this.int16[F+2]=p,this.int16[F+3]=x,this.int16[F+4]=b,this.int16[F+5]=T,this.uint32[j+3]=M,this.uint16[F+8]=I,this.uint16[F+9]=z,t}}Vu.prototype.bytesPerElement=20,Ct("StructArrayLayout6i1ul2ui20",Vu);class ju extends ui{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,u,p,x,b){const T=this.length;return this.resize(T+1),this.emplace(T,t,r,u,p,x,b)}emplace(t,r,u,p,x,b,T){const M=6*t;return this.int16[M+0]=r,this.int16[M+1]=u,this.int16[M+2]=p,this.int16[M+3]=x,this.int16[M+4]=b,this.int16[M+5]=T,t}}ju.prototype.bytesPerElement=12,Ct("StructArrayLayout2i2i2i12",ju);class Hh extends ui{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,u,p,x){const b=this.length;return this.resize(b+1),this.emplace(b,t,r,u,p,x)}emplace(t,r,u,p,x,b){const T=4*t,M=8*t;return this.float32[T+0]=r,this.float32[T+1]=u,this.float32[T+2]=p,this.int16[M+6]=x,this.int16[M+7]=b,t}}Hh.prototype.bytesPerElement=16,Ct("StructArrayLayout2f1f2i16",Hh);class y extends ui{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,u,p,x,b){const T=this.length;return this.resize(T+1),this.emplace(T,t,r,u,p,x,b)}emplace(t,r,u,p,x,b,T){const M=16*t,I=4*t,z=8*t;return this.uint8[M+0]=r,this.uint8[M+1]=u,this.float32[I+1]=p,this.float32[I+2]=x,this.int16[z+6]=b,this.int16[z+7]=T,t}}y.prototype.bytesPerElement=16,Ct("StructArrayLayout2ub2f2i16",y);class e extends ui{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,u){const p=this.length;return this.resize(p+1),this.emplace(p,t,r,u)}emplace(t,r,u,p){const x=3*t;return this.uint16[x+0]=r,this.uint16[x+1]=u,this.uint16[x+2]=p,t}}e.prototype.bytesPerElement=6,Ct("StructArrayLayout3ui6",e);class s extends ui{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,u,p,x,b,T,M,I,z,F,j,G,H,J,ne,le){const Ae=this.length;return this.resize(Ae+1),this.emplace(Ae,t,r,u,p,x,b,T,M,I,z,F,j,G,H,J,ne,le)}emplace(t,r,u,p,x,b,T,M,I,z,F,j,G,H,J,ne,le,Ae){const pe=24*t,ve=12*t,Fe=48*t;return this.int16[pe+0]=r,this.int16[pe+1]=u,this.uint16[pe+2]=p,this.uint16[pe+3]=x,this.uint32[ve+2]=b,this.uint32[ve+3]=T,this.uint32[ve+4]=M,this.uint16[pe+10]=I,this.uint16[pe+11]=z,this.uint16[pe+12]=F,this.float32[ve+7]=j,this.float32[ve+8]=G,this.uint8[Fe+36]=H,this.uint8[Fe+37]=J,this.uint8[Fe+38]=ne,this.uint32[ve+10]=le,this.int16[pe+22]=Ae,t}}s.prototype.bytesPerElement=48,Ct("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",s);class d extends ui{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,u,p,x,b,T,M,I,z,F,j,G,H,J,ne,le,Ae,pe,ve,Fe,qe,it,bt,mt,_t,kt,yt){const vt=this.length;return this.resize(vt+1),this.emplace(vt,t,r,u,p,x,b,T,M,I,z,F,j,G,H,J,ne,le,Ae,pe,ve,Fe,qe,it,bt,mt,_t,kt,yt)}emplace(t,r,u,p,x,b,T,M,I,z,F,j,G,H,J,ne,le,Ae,pe,ve,Fe,qe,it,bt,mt,_t,kt,yt,vt){const We=32*t,jt=16*t;return this.int16[We+0]=r,this.int16[We+1]=u,this.int16[We+2]=p,this.int16[We+3]=x,this.int16[We+4]=b,this.int16[We+5]=T,this.int16[We+6]=M,this.int16[We+7]=I,this.uint16[We+8]=z,this.uint16[We+9]=F,this.uint16[We+10]=j,this.uint16[We+11]=G,this.uint16[We+12]=H,this.uint16[We+13]=J,this.uint16[We+14]=ne,this.uint16[We+15]=le,this.uint16[We+16]=Ae,this.uint16[We+17]=pe,this.uint16[We+18]=ve,this.uint16[We+19]=Fe,this.uint16[We+20]=qe,this.uint16[We+21]=it,this.uint16[We+22]=bt,this.uint32[jt+12]=mt,this.float32[jt+13]=_t,this.float32[jt+14]=kt,this.uint16[We+30]=yt,this.uint16[We+31]=vt,t}}d.prototype.bytesPerElement=64,Ct("StructArrayLayout8i15ui1ul2f2ui64",d);class g extends ui{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){const r=this.length;return this.resize(r+1),this.emplace(r,t)}emplace(t,r){return this.float32[1*t+0]=r,t}}g.prototype.bytesPerElement=4,Ct("StructArrayLayout1f4",g);class _ extends ui{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,u){const p=this.length;return this.resize(p+1),this.emplace(p,t,r,u)}emplace(t,r,u,p){const x=3*t;return this.uint16[6*t+0]=r,this.float32[x+1]=u,this.float32[x+2]=p,t}}_.prototype.bytesPerElement=12,Ct("StructArrayLayout1ui2f12",_);class S extends ui{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,u){const p=this.length;return this.resize(p+1),this.emplace(p,t,r,u)}emplace(t,r,u,p){const x=4*t;return this.uint32[2*t+0]=r,this.uint16[x+2]=u,this.uint16[x+3]=p,t}}S.prototype.bytesPerElement=8,Ct("StructArrayLayout1ul2ui8",S);class L extends ui{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r){const u=this.length;return this.resize(u+1),this.emplace(u,t,r)}emplace(t,r,u){const p=2*t;return this.uint16[p+0]=r,this.uint16[p+1]=u,t}}L.prototype.bytesPerElement=4,Ct("StructArrayLayout2ui4",L);class P extends ui{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){const r=this.length;return this.resize(r+1),this.emplace(r,t)}emplace(t,r){return this.uint16[1*t+0]=r,t}}P.prototype.bytesPerElement=2,Ct("StructArrayLayout1ui2",P);class O extends ui{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,u,p){const x=this.length;return this.resize(x+1),this.emplace(x,t,r,u,p)}emplace(t,r,u,p,x){const b=4*t;return this.float32[b+0]=r,this.float32[b+1]=u,this.float32[b+2]=p,this.float32[b+3]=x,t}}O.prototype.bytesPerElement=16,Ct("StructArrayLayout4f16",O);class k extends mi{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 D(this.anchorPointX,this.anchorPointY)}}k.prototype.size=20;class $ extends Vu{get(t){return new k(this,t)}}Ct("CollisionBoxArray",$);class N extends mi{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(t){this._structArray.uint8[this._pos1+37]=t}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(t){this._structArray.uint8[this._pos1+38]=t}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(t){this._structArray.uint32[this._pos4+10]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}N.prototype.size=48;class q extends s{get(t){return new N(this,t)}}Ct("PlacedSymbolArray",q);class K extends mi{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(t){this._structArray.uint32[this._pos4+12]=t}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}K.prototype.size=64;class re extends d{get(t){return new K(this,t)}}Ct("SymbolInstanceArray",re);class ae extends g{getoffsetX(t){return this.float32[1*t+0]}}Ct("GlyphOffsetArray",ae);class se extends _i{getx(t){return this.int16[3*t+0]}gety(t){return this.int16[3*t+1]}gettileUnitDistanceFromAnchor(t){return this.int16[3*t+2]}}Ct("SymbolLineVertexArray",se);class ce extends mi{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}ce.prototype.size=12;class de extends _{get(t){return new ce(this,t)}}Ct("TextAnchorOffsetArray",de);class ue extends mi{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]}}ue.prototype.size=8;class _e extends S{get(t){return new ue(this,t)}}Ct("FeatureIndexArray",_e);class be extends kn{}class fe extends kn{}class Ee extends kn{}class Ve extends Ns{}class ke extends fo{}class Ne extends ds{}class Ue extends fs{}class ht extends ol{}class dt extends qh{}class tt extends ni{}class It extends $u{}class en extends ju{}class Mn extends y{}class Nn extends e{}class Un extends L{}const hi=Yn([{name:"a_pos",components:2,type:"Int16"}],4),{members:ii}=hi;class yn{constructor(t=[]){this._forceNewSegmentOnNextPrepare=!1,this.segments=t}prepareSegment(t,r,u,p){const x=this.segments[this.segments.length-1];return t>yn.MAX_VERTEX_ARRAY_LENGTH&&si(`Max vertices per segment is ${yn.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}. Consider using the \`fillLargeMeshArrays\` function if you require meshes with more than ${yn.MAX_VERTEX_ARRAY_LENGTH} vertices.`),this._forceNewSegmentOnNextPrepare||!x||x.vertexLength+t>yn.MAX_VERTEX_ARRAY_LENGTH||x.sortKey!==p?this.createNewSegment(r,u,p):x}createNewSegment(t,r,u){const p={vertexOffset:t.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0,vaos:{}};return u!==void 0&&(p.sortKey=u),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(p),p}getOrCreateLatestSegment(t,r,u){return this.prepareSegment(0,t,r,u)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(const t of this.segments)for(const r in t.vaos)t.vaos[r].destroy()}static simpleSegment(t,r,u,p){return new yn([{vertexOffset:t,primitiveOffset:r,vertexLength:u,primitiveLength:p,vaos:{},sortKey:0}])}}function vi(a,t){return 256*(a=Lt(Math.floor(a),0,255))+Lt(Math.floor(t),0,255)}yn.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Ct("SegmentVector",yn);const _r=Yn([{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"}]),zi=Yn([{name:"a_dasharray_from",components:4,type:"Uint16"},{name:"a_dasharray_to",components:4,type:"Uint16"}]);var Di,Ir,po,Sa={exports:{}},mo={exports:{}},ll={exports:{}},Uc=(function(){if(po)return Sa.exports;po=1;var a=(Di||(Di=1,mo.exports=function(r,u){var p,x,b,T,M,I,z,F;for(x=r.length-(p=3&r.length),b=u,M=3432918353,I=461845907,F=0;F<x;)z=255&r.charCodeAt(F)|(255&r.charCodeAt(++F))<<8|(255&r.charCodeAt(++F))<<16|(255&r.charCodeAt(++F))<<24,++F,b=27492+(65535&(T=5*(65535&(b=(b^=z=(65535&(z=(z=(65535&z)*M+(((z>>>16)*M&65535)<<16)&4294967295)<<15|z>>>17))*I+(((z>>>16)*I&65535)<<16)&4294967295)<<13|b>>>19))+((5*(b>>>16)&65535)<<16)&4294967295))+((58964+(T>>>16)&65535)<<16);switch(z=0,p){case 3:z^=(255&r.charCodeAt(F+2))<<16;case 2:z^=(255&r.charCodeAt(F+1))<<8;case 1:b^=z=(65535&(z=(z=(65535&(z^=255&r.charCodeAt(F)))*M+(((z>>>16)*M&65535)<<16)&4294967295)<<15|z>>>17))*I+(((z>>>16)*I&65535)<<16)&4294967295}return b^=r.length,b=2246822507*(65535&(b^=b>>>16))+((2246822507*(b>>>16)&65535)<<16)&4294967295,b=3266489909*(65535&(b^=b>>>13))+((3266489909*(b>>>16)&65535)<<16)&4294967295,(b^=b>>>16)>>>0}),mo.exports),t=(Ir||(Ir=1,ll.exports=function(r,u){for(var p,x=r.length,b=u^x,T=0;x>=4;)p=1540483477*(65535&(p=255&r.charCodeAt(T)|(255&r.charCodeAt(++T))<<8|(255&r.charCodeAt(++T))<<16|(255&r.charCodeAt(++T))<<24))+((1540483477*(p>>>16)&65535)<<16),b=1540483477*(65535&b)+((1540483477*(b>>>16)&65535)<<16)^(p=1540483477*(65535&(p^=p>>>24))+((1540483477*(p>>>16)&65535)<<16)),x-=4,++T;switch(x){case 3:b^=(255&r.charCodeAt(T+2))<<16;case 2:b^=(255&r.charCodeAt(T+1))<<8;case 1:b=1540483477*(65535&(b^=255&r.charCodeAt(T)))+((1540483477*(b>>>16)&65535)<<16)}return b=1540483477*(65535&(b^=b>>>13))+((1540483477*(b>>>16)&65535)<<16),(b^=b>>>15)>>>0}),ll.exports);return Sa.exports=a,Sa.exports.murmur3=a,Sa.exports.murmur2=t,Sa.exports})(),Xl=B(Uc);class Us{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(t,r,u,p){this.ids.push(Ca(t)),this.positions.push(r,u,p)}getPositions(t){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const r=Ca(t);let u=0,p=this.ids.length-1;for(;u<p;){const b=u+p>>1;this.ids[b]>=r?p=b:u=b+1}const x=[];for(;this.ids[u]===r;)x.push({index:this.positions[3*u],start:this.positions[3*u+1],end:this.positions[3*u+2]}),u++;return x}static serialize(t,r){const u=new Float64Array(t.ids),p=new Uint32Array(t.positions);return qa(u,p,0,u.length-1),r&&r.push(u.buffer,p.buffer),{ids:u,positions:p}}static deserialize(t){const r=new Us;return r.ids=t.ids,r.positions=t.positions,r.indexed=!0,r}}function Ca(a){const t=+a;return!isNaN(t)&&t<=Number.MAX_SAFE_INTEGER?t:Xl(String(a))}function qa(a,t,r,u){for(;r<u;){const p=a[r+u>>1];let x=r-1,b=u+1;for(;;){do x++;while(a[x]<p);do b--;while(a[b]>p);if(x>=b)break;ps(a,x,b),ps(t,3*x,3*b),ps(t,3*x+1,3*b+1),ps(t,3*x+2,3*b+2)}b-r<u-b?(qa(a,t,r,b),r=b+1):(qa(a,t,b+1,u),u=b)}}function ps(a,t,r){const u=a[t];a[t]=a[r],a[r]=u}Ct("FeaturePositionMap",Us);class ta{constructor(t,r){this.gl=t.gl,this.location=r}}class Si extends ta{constructor(t,r){super(t,r),this.current=0}set(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))}}class Xi extends ta{constructor(t,r){super(t,r),this.current=[0,0,0,0]}set(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]&&t[3]===this.current[3]||(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))}}class na extends ta{constructor(t,r){super(t,r),this.current=dn.transparent}set(t){t.r===this.current.r&&t.g===this.current.g&&t.b===this.current.b&&t.a===this.current.a||(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))}}const vr=new Float32Array(16);function wf(a){return[vi(255*a.r,255*a.g),vi(255*a.b,255*a.a)]}class $c{constructor(t,r,u){this.value=t,this.uniformNames=r.map((p=>`u_${p}`)),this.type=u}setUniform(t,r,u){t.set(u.constantOr(this.value))}getBinding(t,r,u){return this.type==="color"?new na(t,r):new Si(t,r)}}class ms{constructor(t,r){this.uniformNames=r.map((u=>`u_${u}`)),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(t,r){this.pixelRatioFrom=r.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=r.tlbr,this.patternTo=t.tlbr}setConstantDashPositions(t,r){this.dashTo=[0,t.y,t.height,t.width],this.dashFrom=[0,r.y,r.height,r.width]}setUniform(t,r,u,p){let x=null;p==="u_pattern_to"?x=this.patternTo:p==="u_pattern_from"?x=this.patternFrom:p==="u_dasharray_to"?x=this.dashTo:p==="u_dasharray_from"?x=this.dashFrom:p==="u_pixel_ratio_to"?x=this.pixelRatioTo:p==="u_pixel_ratio_from"&&(x=this.pixelRatioFrom),x!==null&&t.set(x)}getBinding(t,r,u){return u.substr(0,9)==="u_pattern"||u.substr(0,12)==="u_dasharray_"?new Xi(t,r):new Si(t,r)}}class gs{constructor(t,r,u,p){this.expression=t,this.type=u,this.maxValue=0,this.paintVertexAttributes=r.map((x=>({name:`a_${x}`,type:"Float32",components:u==="color"?2:1,offset:0}))),this.paintVertexArray=new p}populatePaintArray(t,r,u){const p=this.paintVertexArray.length,x=this.expression.evaluate(new Xn(0,u),r,{},u.canonical,[],u.formattedSection);this.paintVertexArray.resize(t),this._setPaintValue(p,t,x)}updatePaintArray(t,r,u,p,x){const b=this.expression.evaluate(new Xn(0,x),u,p);this._setPaintValue(t,r,b)}_setPaintValue(t,r,u){if(this.type==="color"){const p=wf(u);for(let x=t;x<r;x++)this.paintVertexArray.emplace(x,p[0],p[1])}else{for(let p=t;p<r;p++)this.paintVertexArray.emplace(p,u);this.maxValue=Math.max(this.maxValue,Math.abs(u))}}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class ia{constructor(t,r,u,p,x,b){this.expression=t,this.uniformNames=r.map((T=>`u_${T}_t`)),this.type=u,this.useIntegerZoom=p,this.zoom=x,this.maxValue=0,this.paintVertexAttributes=r.map((T=>({name:`a_${T}`,type:"Float32",components:u==="color"?4:2,offset:0}))),this.paintVertexArray=new b}populatePaintArray(t,r,u){const p=this.expression.evaluate(new Xn(this.zoom,u),r,{},u.canonical,[],u.formattedSection),x=this.expression.evaluate(new Xn(this.zoom+1,u),r,{},u.canonical,[],u.formattedSection),b=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(b,t,p,x)}updatePaintArray(t,r,u,p,x){const b=this.expression.evaluate(new Xn(this.zoom,x),u,p),T=this.expression.evaluate(new Xn(this.zoom+1,x),u,p);this._setPaintValue(t,r,b,T)}_setPaintValue(t,r,u,p){if(this.type==="color"){const x=wf(u),b=wf(p);for(let T=t;T<r;T++)this.paintVertexArray.emplace(T,x[0],x[1],b[0],b[1])}else{for(let x=t;x<r;x++)this.paintVertexArray.emplace(x,u,p);this.maxValue=Math.max(this.maxValue,Math.abs(u),Math.abs(p))}}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(t,r){const u=this.useIntegerZoom?Math.floor(r.zoom):r.zoom,p=Lt(this.expression.interpolationFactor(u,this.zoom,this.zoom+1),0,1);t.set(p)}getBinding(t,r,u){return new Si(t,r)}}class go{constructor(t,r,u,p,x,b){this.expression=t,this.type=r,this.useIntegerZoom=u,this.zoom=p,this.layerId=b,this.zoomInPaintVertexArray=new x,this.zoomOutPaintVertexArray=new x}populatePaintArray(t,r,u){const p=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(p,t,this.getPositionIds(r),u)}updatePaintArray(t,r,u,p,x){this._setPaintValues(t,r,this.getPositionIds(u),x)}_setPaintValues(t,r,u,p){const x=this.getPositions(p);if(!x||!u)return;const b=x[u.min],T=x[u.mid],M=x[u.max];if(b&&T&&M)for(let I=t;I<r;I++)this.emplace(this.zoomInPaintVertexArray,I,T,b),this.emplace(this.zoomOutPaintVertexArray,I,T,M)}upload(t){if(this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer){const r=this.getVertexAttributes();this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,r,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,r,this.expression.isStateDependent)}}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class yo extends go{getPositions(t){return t.imagePositions}getPositionIds(t){return t.patterns&&t.patterns[this.layerId]}getVertexAttributes(){return _r.members}emplace(t,r,u,p){t.emplace(r,u.tlbr[0],u.tlbr[1],u.tlbr[2],u.tlbr[3],p.tlbr[0],p.tlbr[1],p.tlbr[2],p.tlbr[3],u.pixelRatio,p.pixelRatio)}}class Yl extends go{getPositions(t){return t.dashPositions}getPositionIds(t){return t.dashes&&t.dashes[this.layerId]}getVertexAttributes(){return zi.members}emplace(t,r,u,p){t.emplace(r,0,u.y,u.height,u.width,0,p.y,p.height,p.width)}}class Xh{constructor(t,r,u){this.binders={},this._buffers=[];const p=[];for(const x in t.paint._values){if(!u(x))continue;const b=t.paint.get(x);if(!(b instanceof hs&&Va(b.property.specification)))continue;const T=Yh(x,t.type),M=b.value,I=b.property.specification.type,z=b.property.useIntegerZoom,F=b.property.specification["property-type"],j=F==="cross-faded"||F==="cross-faded-data-driven";if(M.kind==="constant")this.binders[x]=j?new ms(M.value,T):new $c(M.value,T,I),p.push(`/u_${x}`);else if(M.kind==="source"||j){const G=Zu(x,I,"source");this.binders[x]=j?x==="line-dasharray"?new Yl(M,I,z,r,G,t.id):new yo(M,I,z,r,G,t.id):new gs(M,T,I,G),p.push(`/a_${x}`)}else{const G=Zu(x,I,"composite");this.binders[x]=new ia(M,T,I,z,r,G),p.push(`/z_${x}`)}}this.cacheKey=p.sort().join("")}getMaxValue(t){const r=this.binders[t];return r instanceof gs||r instanceof ia?r.maxValue:0}populatePaintArrays(t,r,u){for(const p in this.binders){const x=this.binders[p];(x instanceof gs||x instanceof ia||x instanceof go)&&x.populatePaintArray(t,r,u)}}setConstantPatternPositions(t,r){for(const u in this.binders){const p=this.binders[u];p instanceof ms&&p.setConstantPatternPositions(t,r)}}setConstantDashPositions(t,r){for(const u in this.binders){const p=this.binders[u];p instanceof ms&&p.setConstantDashPositions(t,r)}}updatePaintArrays(t,r,u,p,x){let b=!1;for(const T in t){const M=r.getPositions(T);for(const I of M){const z=u.feature(I.index);for(const F in this.binders){const j=this.binders[F];if((j instanceof gs||j instanceof ia||j instanceof go)&&j.expression.isStateDependent===!0){const G=p.paint.get(F);j.expression=G.value,j.updatePaintArray(I.start,I.end,z,t[T],x),b=!0}}}}return b}defines(){const t=[];for(const r in this.binders){const u=this.binders[r];(u instanceof $c||u instanceof ms)&&t.push(...u.uniformNames.map((p=>`#define HAS_UNIFORM_${p}`)))}return t}getBinderAttributes(){const t=[];for(const r in this.binders){const u=this.binders[r];if(u instanceof gs||u instanceof ia)for(let p=0;p<u.paintVertexAttributes.length;p++)t.push(u.paintVertexAttributes[p].name);else if(u instanceof go){const p=u.getVertexAttributes();for(const x of p)t.push(x.name)}}return t}getBinderUniforms(){const t=[];for(const r in this.binders){const u=this.binders[r];if(u instanceof $c||u instanceof ms||u instanceof ia)for(const p of u.uniformNames)t.push(p)}return t}getPaintVertexBuffers(){return this._buffers}getUniforms(t,r){const u=[];for(const p in this.binders){const x=this.binders[p];if(x instanceof $c||x instanceof ms||x instanceof ia){for(const b of x.uniformNames)if(r[b]){const T=x.getBinding(t,r[b],b);u.push({name:b,property:p,binding:T})}}}return u}setUniforms(t,r,u,p){for(const{name:x,property:b,binding:T}of r)this.binders[b].setUniform(T,p,u.get(b),x)}updatePaintBuffers(t){this._buffers=[];for(const r in this.binders){const u=this.binders[r];if(t&&u instanceof go){const p=t.fromScale===2?u.zoomInPaintVertexBuffer:u.zoomOutPaintVertexBuffer;p&&this._buffers.push(p)}else(u instanceof gs||u instanceof ia)&&u.paintVertexBuffer&&this._buffers.push(u.paintVertexBuffer)}}upload(t){for(const r in this.binders){const u=this.binders[r];(u instanceof gs||u instanceof ia||u instanceof go)&&u.upload(t)}this.updatePaintBuffers()}destroy(){for(const t in this.binders){const r=this.binders[t];(r instanceof gs||r instanceof ia||r instanceof go)&&r.destroy()}}}class $s{constructor(t,r,u=()=>!0){this.programConfigurations={};for(const p of t)this.programConfigurations[p.id]=new Xh(p,r,u);this.needsUpload=!1,this._featureMap=new Us,this._bufferOffset=0}populatePaintArrays(t,r,u,p){for(const x in this.programConfigurations)this.programConfigurations[x].populatePaintArrays(t,r,p);r.id!==void 0&&this._featureMap.add(r.id,u,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,r,u,p){for(const x of u)this.needsUpload=this.programConfigurations[x.id].updatePaintArrays(t,this._featureMap,r,x,p)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(const r in this.programConfigurations)this.programConfigurations[r].upload(t);this.needsUpload=!1}}destroy(){for(const t in this.programConfigurations)this.programConfigurations[t].destroy()}}function Yh(a,t){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-dasharray":["dasharray_to","dasharray_from"],"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"]}[a]||[a.replace(`${t}-`,"").replace(/-/g,"_")]}function Zu(a,t,r){const u={color:{source:ds,composite:O},number:{source:g,composite:ds}},p=(function(x){return{"line-pattern":{source:Ue,composite:Ue},"fill-pattern":{source:Ue,composite:Ue},"fill-extrusion-pattern":{source:Ue,composite:Ue},"line-dasharray":{source:ht,composite:ht}}[x]})(a);return p&&p[r]||u[t][r]}Ct("ConstantBinder",$c),Ct("CrossFadedConstantBinder",ms),Ct("SourceExpressionBinder",gs),Ct("CrossFadedPatternBinder",yo),Ct("CrossFadedDasharrayBinder",Yl),Ct("CompositeExpressionBinder",ia),Ct("ProgramConfiguration",Xh,{omit:["_buffers"]}),Ct("ProgramConfigurationSet",$s);const Ql=Math.pow(2,14)-1,vm=-Ql-1;function Vc(a){const t=St/a.extent,r=a.loadGeometry();for(let u=0;u<r.length;u++){const p=r[u];for(let x=0;x<p.length;x++){const b=p[x],T=Math.round(b.x*t),M=Math.round(b.y*t);b.x=Lt(T,vm,Ql),b.y=Lt(M,vm,Ql),(T<b.x||T>b.x+1||M<b.y||M>b.y+1)&&si("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}function ys(a,t){return{type:a.type,id:a.id,properties:a.properties,geometry:t?Vc(a):[]}}const xm=-32768;function v0(a,t,r,u,p){a.emplaceBack(xm+8*t+u,xm+8*r+p)}class jp{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((r=>r.id)),this.index=t.index,this.hasDependencies=!1,this.layoutVertexArray=new fe,this.indexArray=new Nn,this.segments=new yn,this.programConfigurations=new $s(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((r=>r.isStateDependent())).map((r=>r.id))}populate(t,r,u){const p=this.layers[0],x=[];let b=null,T=!1,M=p.type==="heatmap";if(p.type==="circle"){const z=p;b=z.layout.get("circle-sort-key"),T=!b.isConstant(),M=M||z.paint.get("circle-pitch-alignment")==="map"}const I=M?r.subdivisionGranularity.circle:1;for(const{feature:z,id:F,index:j,sourceLayerIndex:G}of t){const H=this.layers[0]._featureFilter.needGeometry,J=ys(z,H);if(!this.layers[0]._featureFilter.filter(new Xn(this.zoom),J,u))continue;const ne=T?b.evaluate(J,{},u):void 0,le={id:F,properties:z.properties,type:z.type,sourceLayerIndex:G,index:j,geometry:H?J.geometry:Vc(z),patterns:{},sortKey:ne};x.push(le)}T&&x.sort(((z,F)=>z.sortKey-F.sortKey));for(const z of x){const{geometry:F,index:j,sourceLayerIndex:G}=z,H=t[j].feature;this.addFeature(z,F,j,u,I),r.featureIndex.insert(H,F,j,G,this.index)}}update(t,r,u){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,r,this.stateDependentLayers,{imagePositions:u})}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ii),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(t,r,u,p,x=1){let b;switch(x){case 1:b=[0,7];break;case 3:b=[0,2,5,7];break;case 5:b=[0,1,3,4,6,7];break;case 7:b=[0,1,2,3,4,5,6,7];break;default:throw new Error(`Invalid circle bucket granularity: ${x}; valid values are 1, 3, 5, 7.`)}const T=b.length;for(const M of r)for(const I of M){const z=I.x,F=I.y;if(z<0||z>=St||F<0||F>=St)continue;const j=this.segments.prepareSegment(T*T,this.layoutVertexArray,this.indexArray,t.sortKey),G=j.vertexLength;for(let H=0;H<T;H++)for(let J=0;J<T;J++)v0(this.layoutVertexArray,z,F,b[J],b[H]);for(let H=0;H<T-1;H++)for(let J=0;J<T-1;J++){const ne=G+H*T+J,le=G+(H+1)*T+J;this.indexArray.emplaceBack(ne,le+1,ne+1),this.indexArray.emplaceBack(ne,le,le+1)}j.vertexLength+=T*T,j.primitiveLength+=(T-1)*(T-1)*2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,u,{imagePositions:{},canonical:p})}}function Sf(a,t){for(let r=0;r<a.length;r++)if(Gu(t,a[r]))return!0;for(let r=0;r<t.length;r++)if(Gu(a,t[r]))return!0;return!!Gp(a,t)}function Cf(a,t,r){return!!Gu(a,t)||!!Tf(t,a,r)}function Zp(a,t){if(a.length===1)return zr(t,a[0]);for(let r=0;r<t.length;r++){const u=t[r];for(let p=0;p<u.length;p++)if(Gu(a,u[p]))return!0}for(let r=0;r<a.length;r++)if(zr(t,a[r]))return!0;for(let r=0;r<t.length;r++)if(Gp(a,t[r]))return!0;return!1}function x0(a,t,r){if(a.length>1){if(Gp(a,t))return!0;for(let u=0;u<t.length;u++)if(Tf(t[u],a,r))return!0}for(let u=0;u<a.length;u++)if(Tf(a[u],t,r))return!0;return!1}function Gp(a,t){if(a.length===0||t.length===0)return!1;for(let r=0;r<a.length-1;r++){const u=a[r],p=a[r+1];for(let x=0;x<t.length-1;x++)if(Ky(u,p,t[x],t[x+1]))return!0}return!1}function Ky(a,t,r,u){return ca(a,r,u)!==ca(t,r,u)&&ca(a,t,r)!==ca(a,t,u)}function Tf(a,t,r){const u=r*r;if(t.length===1)return a.distSqr(t[0])<u;for(let p=1;p<t.length;p++)if(rr(a,t[p-1],t[p])<u)return!0;return!1}function rr(a,t,r){const u=t.distSqr(r);if(u===0)return a.distSqr(t);const p=((a.x-t.x)*(r.x-t.x)+(a.y-t.y)*(r.y-t.y))/u;return a.distSqr(p<0?t:p>1?r:r.sub(t)._mult(p)._add(t))}function zr(a,t){let r,u,p,x=!1;for(let b=0;b<a.length;b++){r=a[b];for(let T=0,M=r.length-1;T<r.length;M=T++)u=r[T],p=r[M],u.y>t.y!=p.y>t.y&&t.x<(p.x-u.x)*(t.y-u.y)/(p.y-u.y)+u.x&&(x=!x)}return x}function Gu(a,t){let r=!1;for(let u=0,p=a.length-1;u<a.length;p=u++){const x=a[u],b=a[p];x.y>t.y!=b.y>t.y&&t.x<(b.x-x.x)*(t.y-x.y)/(b.y-x.y)+x.x&&(r=!r)}return r}function b0(a,t,r){const u=r[0],p=r[2];if(a.x<u.x&&t.x<u.x||a.x>p.x&&t.x>p.x||a.y<u.y&&t.y<u.y||a.y>p.y&&t.y>p.y)return!1;const x=ca(a,t,r[0]);return x!==ca(a,t,r[1])||x!==ca(a,t,r[2])||x!==ca(a,t,r[3])}function qu(a,t,r){const u=t.paint.get(a).value;return u.kind==="constant"?u.value:r.programConfigurations.get(t.id).getMaxValue(a)}function Ef(a){return Math.sqrt(a[0]*a[0]+a[1]*a[1])}function jc(a,t,r,u,p){if(!t[0]&&!t[1])return a;const x=D.convert(t)._mult(p);r==="viewport"&&x._rotate(-u);const b=[];for(let T=0;T<a.length;T++)b.push(a[T].sub(x));return b}function w0({queryGeometry:a,size:t},r){return Cf(a,r,t)}function qp({queryGeometry:a,size:t,transform:r,unwrappedTileID:u,getElevation:p},x){return Cf(a,x,t*(r.projectTileCoordinates(x.x,x.y,u,p).signedDistanceFromCamera/r.cameraToCenterDistance))}function S0({queryGeometry:a,size:t,transform:r,unwrappedTileID:u,getElevation:p},x){const b=r.projectTileCoordinates(x.x,x.y,u,p).signedDistanceFromCamera,T=t*(r.cameraToCenterDistance/b);return Cf(a,Af(x,r,u,p),T)}function Jy({queryGeometry:a,size:t,transform:r,unwrappedTileID:u,getElevation:p},x){return Cf(a,Af(x,r,u,p),t)}function Mf({queryGeometry:a,size:t,transform:r,unwrappedTileID:u,getElevation:p,pitchAlignment:x="map",pitchScale:b="map"},T){const M=x==="map"?b==="map"?w0:qp:b==="map"?S0:Jy,I={queryGeometry:a,size:t,transform:r,unwrappedTileID:u,getElevation:p};for(const z of T)for(const F of z)if(M(I,F))return!0;return!1}function Af(a,t,r,u){const p=t.projectTileCoordinates(a.x,a.y,r,u).point;return new D((.5*p.x+.5)*t.width,(.5*-p.y+.5)*t.height)}let bm,wm;Ct("CircleBucket",jp,{omit:["layers"]});var C0={get paint(){return wm=wm||new ci({"circle-radius":new $t(Ie.paint_circle["circle-radius"]),"circle-color":new $t(Ie.paint_circle["circle-color"]),"circle-blur":new $t(Ie.paint_circle["circle-blur"]),"circle-opacity":new $t(Ie.paint_circle["circle-opacity"]),"circle-translate":new Mt(Ie.paint_circle["circle-translate"]),"circle-translate-anchor":new Mt(Ie.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Mt(Ie.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Mt(Ie.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new $t(Ie.paint_circle["circle-stroke-width"]),"circle-stroke-color":new $t(Ie.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new $t(Ie.paint_circle["circle-stroke-opacity"])})},get layout(){return bm=bm||new ci({"circle-sort-key":new $t(Ie.layout_circle["circle-sort-key"])})}};class Sm extends yr{constructor(t,r){super(t,C0,r)}createBucket(t){return new jp(t)}queryRadius(t){const r=t;return qu("circle-radius",this,r)+qu("circle-stroke-width",this,r)+Ef(this.paint.get("circle-translate"))}queryIntersectsFeature({queryGeometry:t,feature:r,featureState:u,geometry:p,transform:x,pixelsToTileUnits:b,unwrappedTileID:T,getElevation:M}){const I=jc(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),-x.bearingInRadians,b),z=this.paint.get("circle-radius").evaluate(r,u)+this.paint.get("circle-stroke-width").evaluate(r,u),F=this.paint.get("circle-pitch-scale"),j=this.paint.get("circle-pitch-alignment");let G,H;return j==="map"?(G=I,H=z*b):(G=(function(J,ne,le,Ae){return J.map((pe=>Af(pe,ne,le,Ae)))})(I,x,T,M),H=z),Mf({queryGeometry:G,size:H,transform:x,unwrappedTileID:T,getElevation:M,pitchAlignment:j,pitchScale:F},p)}}class Hp extends jp{}let Xp;Ct("HeatmapBucket",Hp,{omit:["layers"]});var T0={get paint(){return Xp=Xp||new ci({"heatmap-radius":new $t(Ie.paint_heatmap["heatmap-radius"]),"heatmap-weight":new $t(Ie.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Mt(Ie.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Nc(Ie.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Mt(Ie.paint_heatmap["heatmap-opacity"])})}};function Lf(a,{width:t,height:r},u,p){if(p){if(p instanceof Uint8ClampedArray)p=new Uint8Array(p.buffer);else if(p.length!==t*r*u)throw new RangeError(`mismatched image size. expected: ${p.length} but got: ${t*r*u}`)}else p=new Uint8Array(t*r*u);return a.width=t,a.height=r,a.data=p,a}function Pf(a,{width:t,height:r},u){if(t===a.width&&r===a.height)return;const p=Lf({},{width:t,height:r},u);Rf(a,p,{x:0,y:0},{x:0,y:0},{width:Math.min(a.width,t),height:Math.min(a.height,r)},u),a.width=t,a.height=r,a.data=p.data}function Rf(a,t,r,u,p,x){if(p.width===0||p.height===0)return t;if(p.width>a.width||p.height>a.height||r.x>a.width-p.width||r.y>a.height-p.height)throw new RangeError("out of range source coordinates for image copy");if(p.width>t.width||p.height>t.height||u.x>t.width-p.width||u.y>t.height-p.height)throw new RangeError("out of range destination coordinates for image copy");const b=a.data,T=t.data;if(b===T)throw new Error("srcData equals dstData, so image is already copied");for(let M=0;M<p.height;M++){const I=((r.y+M)*a.width+r.x)*x,z=((u.y+M)*t.width+u.x)*x;for(let F=0;F<p.width*x;F++)T[z+F]=b[I+F]}return t}class Qh{constructor(t,r){Lf(this,t,1,r)}resize(t){Pf(this,t,1)}clone(){return new Qh({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,r,u,p,x){Rf(t,r,u,p,x,1)}}class Gr{constructor(t,r){Lf(this,t,4,r)}resize(t){Pf(this,t,4)}replace(t,r){r?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t}clone(){return new Gr({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,r,u,p,x){Rf(t,r,u,p,x,4)}setPixel(t,r,u){const p=4*(t*this.width+r);this.data[p+0]=Math.round(255*u.r/u.a),this.data[p+1]=Math.round(255*u.g/u.a),this.data[p+2]=Math.round(255*u.b/u.a),this.data[p+3]=Math.round(255*u.a)}}function Cm(a){const t={},r=a.resolution||256,u=a.clips?a.clips.length:1,p=a.image||new Gr({width:r,height:u});if(Math.log(r)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${r}`);const x=(b,T,M)=>{t[a.evaluationKey]=M;const I=a.expression.evaluate(t);p.setPixel(b/4/r,T/4,I)};if(a.clips)for(let b=0,T=0;b<u;++b,T+=4*r)for(let M=0,I=0;M<r;M++,I+=4){const z=M/(r-1),{start:F,end:j}=a.clips[b];x(T,I,F*(1-z)+j*z)}else for(let b=0,T=0;b<r;b++,T+=4)x(0,T,b/(r-1));return p}Ct("AlphaImage",Qh),Ct("RGBAImage",Gr);const _o="big-fb";class Tm extends yr{createBucket(t){return new Hp(t)}constructor(t,r){super(t,T0,r),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){t==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Cm({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(_o)&&this.heatmapFbos.delete(_o)}queryRadius(t){return qu("heatmap-radius",this,t)}queryIntersectsFeature({queryGeometry:t,feature:r,featureState:u,geometry:p,transform:x,pixelsToTileUnits:b,unwrappedTileID:T,getElevation:M}){return Mf({queryGeometry:t,size:this.paint.get("heatmap-radius").evaluate(r,u)*b,transform:x,unwrappedTileID:T,getElevation:M},p)}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}}let E0;var M0={get paint(){return E0=E0||new ci({"hillshade-illumination-direction":new Mt(Ie.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-altitude":new Mt(Ie.paint_hillshade["hillshade-illumination-altitude"]),"hillshade-illumination-anchor":new Mt(Ie.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Mt(Ie.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Mt(Ie.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Mt(Ie.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Mt(Ie.paint_hillshade["hillshade-accent-color"]),"hillshade-method":new Mt(Ie.paint_hillshade["hillshade-method"])})}};class Wl extends yr{constructor(t,r){super(t,M0,r),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let t=this.paint.get("hillshade-illumination-direction").values,r=this.paint.get("hillshade-illumination-altitude").values,u=this.paint.get("hillshade-highlight-color").values,p=this.paint.get("hillshade-shadow-color").values;const x=Math.max(t.length,r.length,u.length,p.length);t=t.concat(Array(x-t.length).fill(t.at(-1))),r=r.concat(Array(x-r.length).fill(r.at(-1))),u=u.concat(Array(x-u.length).fill(u.at(-1))),p=p.concat(Array(x-p.length).fill(p.at(-1)));const b=r.map(hu);return{directionRadians:t.map(hu),altitudeRadians:b,shadowColor:p,highlightColor:u}}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}}let Yp;var A0={get paint(){return Yp=Yp||new ci({"color-relief-opacity":new Mt(Ie["paint_color-relief"]["color-relief-opacity"]),"color-relief-color":new Nc(Ie["paint_color-relief"]["color-relief-color"])})}};class Wh{constructor(t,r,u,p){this.context=t,this.format=u,this.texture=t.gl.createTexture(),this.update(r,p)}update(t,r,u){const{width:p,height:x}=t,b=!(this.size&&this.size[0]===p&&this.size[1]===x||u),{context:T}=this,{gl:M}=T;if(this.useMipmap=!!(r&&r.useMipmap),M.bindTexture(M.TEXTURE_2D,this.texture),T.pixelStoreUnpackFlipY.set(!1),T.pixelStoreUnpack.set(1),T.pixelStoreUnpackPremultiplyAlpha.set(this.format===M.RGBA&&(!r||r.premultiply!==!1)),b)this.size=[p,x],t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||Br(t)?M.texImage2D(M.TEXTURE_2D,0,this.format,this.format,M.UNSIGNED_BYTE,t):M.texImage2D(M.TEXTURE_2D,0,this.format,p,x,0,this.format,M.UNSIGNED_BYTE,t.data);else{const{x:I,y:z}=u||{x:0,y:0};t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||Br(t)?M.texSubImage2D(M.TEXTURE_2D,0,I,z,M.RGBA,M.UNSIGNED_BYTE,t):M.texSubImage2D(M.TEXTURE_2D,0,I,z,p,x,M.RGBA,M.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&M.generateMipmap(M.TEXTURE_2D),T.pixelStoreUnpackFlipY.setDefault(),T.pixelStoreUnpack.setDefault(),T.pixelStoreUnpackPremultiplyAlpha.setDefault()}bind(t,r,u){const{context:p}=this,{gl:x}=p;x.bindTexture(x.TEXTURE_2D,this.texture),u!==x.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(u=x.LINEAR),t!==this.filter&&(x.texParameteri(x.TEXTURE_2D,x.TEXTURE_MAG_FILTER,t),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_MIN_FILTER,u||t),this.filter=t),r!==this.wrap&&(x.texParameteri(x.TEXTURE_2D,x.TEXTURE_WRAP_S,r),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_WRAP_T,r),this.wrap=r)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null}}class Kh{constructor(t,r,u,p=1,x=1,b=1,T=0){if(this.uid=t,r.height!==r.width)throw new RangeError("DEM tiles must be square");if(u&&!["mapbox","terrarium","custom"].includes(u))return void si(`"${u}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=r.height;const M=this.dim=r.height-2;switch(this.data=new Uint32Array(r.data.buffer),u){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=p,this.greenFactor=x,this.blueFactor=b,this.baseShift=T;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let I=0;I<M;I++)this.data[this._idx(-1,I)]=this.data[this._idx(0,I)],this.data[this._idx(M,I)]=this.data[this._idx(M-1,I)],this.data[this._idx(I,-1)]=this.data[this._idx(I,0)],this.data[this._idx(I,M)]=this.data[this._idx(I,M-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(M,-1)]=this.data[this._idx(M-1,0)],this.data[this._idx(-1,M)]=this.data[this._idx(0,M-1)],this.data[this._idx(M,M)]=this.data[this._idx(M-1,M-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let I=0;I<M;I++)for(let z=0;z<M;z++){const F=this.get(I,z);F>this.max&&(this.max=F),F<this.min&&(this.min=F)}}get(t,r){const u=new Uint8Array(this.data.buffer),p=4*this._idx(t,r);return this.unpack(u[p],u[p+1],u[p+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(t,r){if(t<-1||t>=this.dim+1||r<-1||r>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(r+1)*this.stride+(t+1)}unpack(t,r,u){return t*this.redFactor+r*this.greenFactor+u*this.blueFactor-this.baseShift}pack(t){return Ci(t,this.getUnpackVector())}getPixels(){return new Gr({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(t,r,u){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");let p=r*this.dim,x=r*this.dim+this.dim,b=u*this.dim,T=u*this.dim+this.dim;switch(r){case-1:p=x-1;break;case 1:x=p+1}switch(u){case-1:b=T-1;break;case 1:T=b+1}const M=-r*this.dim,I=-u*this.dim;for(let z=b;z<T;z++)for(let F=p;F<x;F++)this.data[this._idx(F,z)]=t.data[this._idx(F+M,z+I)]}}function Ci(a,t){const r=t[0],u=t[1],p=t[2],x=t[3],b=Math.min(r,u,p),T=Math.round((a+x)/b);return{r:Math.floor(T*b/r)%256,g:Math.floor(T*b/u)%256,b:Math.floor(T*b/p)%256}}Ct("DEMData",Kh);class e_ extends yr{constructor(t,r){super(t,A0,r)}_createColorRamp(t){const r={elevationStops:[],colorStops:[]},u=this._transitionablePaint._values["color-relief-color"].value.expression;if(u instanceof jr&&u._styleExpression.expression instanceof ir){this.colorRampExpression=u;const b=u._styleExpression.expression;r.elevationStops=b.labels,r.colorStops=[];for(const T of r.elevationStops)r.colorStops.push(b.evaluate({globals:{elevation:T}}))}if(r.elevationStops.length<1&&(r.elevationStops=[0],r.colorStops=[dn.transparent]),r.elevationStops.length<2&&(r.elevationStops.push(r.elevationStops[0]+1),r.colorStops.push(r.colorStops[0])),r.elevationStops.length<=t)return r;const p={elevationStops:[],colorStops:[]},x=(r.elevationStops.length-1)/(t-1);for(let b=0;b<r.elevationStops.length-.5;b+=x)p.elevationStops.push(r.elevationStops[Math.round(b)]),p.colorStops.push(r.colorStops[Math.round(b)]);return si(`Too many colors in specification of ${this.id} color-relief layer, may not render properly.`),p}_colorRampChanged(){return this.colorRampExpression!=this._transitionablePaint._values["color-relief-color"].value.expression}getColorRampTextures(t,r,u){if(this.colorRampTextures&&!this._colorRampChanged())return this.colorRampTextures;const p=this._createColorRamp(r),x=new Gr({width:p.colorStops.length,height:1}),b=new Gr({width:p.colorStops.length,height:1});for(let T=0;T<p.elevationStops.length;T++){const M=Ci(p.elevationStops[T],u);b.setPixel(0,T,new dn(M.r/255,M.g/255,M.b/255,1)),x.setPixel(0,T,p.colorStops[T])}return this.colorRampTextures={elevationTexture:new Wh(t,b,t.gl.RGBA),colorTexture:new Wh(t,x,t.gl.RGBA)},this.colorRampTextures}hasOffscreenPass(){return this.visibility!=="none"&&!!this.colorRampTextures}}const t_=Yn([{name:"a_pos",components:2,type:"Int16"}],4),{members:L0}=t_;function Zc(a,t,r){const u=r.patternDependencies;let p=!1;for(const x of t){const b=x.paint.get(`${a}-pattern`);b.isConstant()||(p=!0);const T=b.constantOr(null);T&&(p=!0,u[T.to]=!0,u[T.from]=!0)}return p}function cl(a,t,r,u,p){const{zoom:x}=u,b=p.patternDependencies;for(const T of t){const M=T.paint.get(`${a}-pattern`).value;if(M.kind!=="constant"){let I=M.evaluate({zoom:x-1},r,{},p.availableImages),z=M.evaluate({zoom:x},r,{},p.availableImages),F=M.evaluate({zoom:x+1},r,{},p.availableImages);I=I&&I.name?I.name:I,z=z&&z.name?z.name:z,F=F&&F.name?F.name:F,b[I]=!0,b[z]=!0,b[F]=!0,r.patterns[T.id]={min:I,mid:z,max:F}}}return r}function Em(a,t,r,u,p){let x;if(p===(function(b,T,M,I){let z=0;for(let F=T,j=M-I;F<M;F+=I)z+=(b[j]-b[F])*(b[F+1]+b[j+1]),j=F;return z})(a,t,r,u)>0)for(let b=t;b<r;b+=u)x=Rm(b/u|0,a[b],a[b+1],x);else for(let b=r-u;b>=t;b-=u)x=Rm(b/u|0,a[b],a[b+1],x);return x&&Jh(x,x.next)&&(ed(x),x=x.next),x}function Gc(a,t){if(!a)return a;t||(t=a);let r,u=a;do if(r=!1,u.steiner||!Jh(u,u.next)&&Cn(u.prev,u,u.next)!==0)u=u.next;else{if(ed(u),u=t=u.prev,u===u.next)break;r=!0}while(r||u!==t);return t}function Kl(a,t,r,u,p,x,b){if(!a)return;!b&&x&&(function(M,I,z,F){let j=M;do j.z===0&&(j.z=Wp(j.x,j.y,I,z,F)),j.prevZ=j.prev,j.nextZ=j.next,j=j.next;while(j!==M);j.prevZ.nextZ=null,j.prevZ=null,(function(G){let H,J=1;do{let ne,le=G;G=null;let Ae=null;for(H=0;le;){H++;let pe=le,ve=0;for(let qe=0;qe<J&&(ve++,pe=pe.nextZ,pe);qe++);let Fe=J;for(;ve>0||Fe>0&&pe;)ve!==0&&(Fe===0||!pe||le.z<=pe.z)?(ne=le,le=le.nextZ,ve--):(ne=pe,pe=pe.nextZ,Fe--),Ae?Ae.nextZ=ne:G=ne,ne.prevZ=Ae,Ae=ne;le=pe}Ae.nextZ=null,J*=2}while(H>1)})(j)})(a,u,p,x);let T=a;for(;a.prev!==a.next;){const M=a.prev,I=a.next;if(x?P0(a,u,p,x):ul(a))t.push(M.i,a.i,I.i),ed(a),a=I.next,T=I.next;else if((a=I)===T){b?b===1?Kl(a=Mm(Gc(a),t),t,r,u,p,x,2):b===2&&R0(a,t,r,u,p,x):Kl(Gc(a),t,r,u,p,x,1);break}}}function ul(a){const t=a.prev,r=a,u=a.next;if(Cn(t,r,u)>=0)return!1;const p=t.x,x=r.x,b=u.x,T=t.y,M=r.y,I=u.y,z=Math.min(p,x,b),F=Math.min(T,M,I),j=Math.max(p,x,b),G=Math.max(T,M,I);let H=u.next;for(;H!==t;){if(H.x>=z&&H.x<=j&&H.y>=F&&H.y<=G&&Hu(p,T,x,M,b,I,H.x,H.y)&&Cn(H.prev,H,H.next)>=0)return!1;H=H.next}return!0}function P0(a,t,r,u){const p=a.prev,x=a,b=a.next;if(Cn(p,x,b)>=0)return!1;const T=p.x,M=x.x,I=b.x,z=p.y,F=x.y,j=b.y,G=Math.min(T,M,I),H=Math.min(z,F,j),J=Math.max(T,M,I),ne=Math.max(z,F,j),le=Wp(G,H,t,r,u),Ae=Wp(J,ne,t,r,u);let pe=a.prevZ,ve=a.nextZ;for(;pe&&pe.z>=le&&ve&&ve.z<=Ae;){if(pe.x>=G&&pe.x<=J&&pe.y>=H&&pe.y<=ne&&pe!==p&&pe!==b&&Hu(T,z,M,F,I,j,pe.x,pe.y)&&Cn(pe.prev,pe,pe.next)>=0||(pe=pe.prevZ,ve.x>=G&&ve.x<=J&&ve.y>=H&&ve.y<=ne&&ve!==p&&ve!==b&&Hu(T,z,M,F,I,j,ve.x,ve.y)&&Cn(ve.prev,ve,ve.next)>=0))return!1;ve=ve.nextZ}for(;pe&&pe.z>=le;){if(pe.x>=G&&pe.x<=J&&pe.y>=H&&pe.y<=ne&&pe!==p&&pe!==b&&Hu(T,z,M,F,I,j,pe.x,pe.y)&&Cn(pe.prev,pe,pe.next)>=0)return!1;pe=pe.prevZ}for(;ve&&ve.z<=Ae;){if(ve.x>=G&&ve.x<=J&&ve.y>=H&&ve.y<=ne&&ve!==p&&ve!==b&&Hu(T,z,M,F,I,j,ve.x,ve.y)&&Cn(ve.prev,ve,ve.next)>=0)return!1;ve=ve.nextZ}return!0}function Mm(a,t){let r=a;do{const u=r.prev,p=r.next.next;!Jh(u,p)&&Pm(u,r,r.next,p)&&Dr(u,p)&&Dr(p,u)&&(t.push(u.i,r.i,p.i),ed(r),ed(r.next),r=a=p),r=r.next}while(r!==a);return Gc(r)}function R0(a,t,r,u,p,x){let b=a;do{let T=b.next.next;for(;T!==b.prev;){if(b.i!==T.i&&I0(b,T)){let M=hl(b,T);return b=Gc(b,b.next),M=Gc(M,M.next),Kl(b,t,r,u,p,x,0),void Kl(M,t,r,u,p,x,0)}T=T.next}b=b.next}while(b!==a)}function Am(a,t){let r=a.x-t.x;return r===0&&(r=a.y-t.y,r===0)&&(r=(a.next.y-a.y)/(a.next.x-a.x)-(t.next.y-t.y)/(t.next.x-t.x)),r}function Lm(a,t){const r=(function(p,x){let b=x;const T=p.x,M=p.y;let I,z=-1/0;if(Jh(p,b))return b;do{if(Jh(p,b.next))return b.next;if(M<=b.y&&M>=b.next.y&&b.next.y!==b.y){const J=b.x+(M-b.y)*(b.next.x-b.x)/(b.next.y-b.y);if(J<=T&&J>z&&(z=J,I=b.x<b.next.x?b:b.next,J===T))return I}b=b.next}while(b!==x);if(!I)return null;const F=I,j=I.x,G=I.y;let H=1/0;b=I;do{if(T>=b.x&&b.x>=j&&T!==b.x&&ar(M<G?T:z,M,j,G,M<G?z:T,M,b.x,b.y)){const J=Math.abs(M-b.y)/(T-b.x);Dr(b,p)&&(J<H||J===H&&(b.x>I.x||b.x===I.x&&Qp(I,b)))&&(I=b,H=J)}b=b.next}while(b!==F);return I})(a,t);if(!r)return t;const u=hl(r,a);return Gc(u,u.next),Gc(r,r.next)}function Qp(a,t){return Cn(a.prev,a,t.prev)<0&&Cn(t.next,a,a.next)<0}function Wp(a,t,r,u,p){return(a=1431655765&((a=858993459&((a=252645135&((a=16711935&((a=(a-r)*p|0)|a<<8))|a<<4))|a<<2))|a<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-u)*p|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Jl(a){let t=a,r=a;do(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next;while(t!==a);return r}function ar(a,t,r,u,p,x,b,T){return(p-b)*(t-T)>=(a-b)*(x-T)&&(a-b)*(u-T)>=(r-b)*(t-T)&&(r-b)*(x-T)>=(p-b)*(u-T)}function Hu(a,t,r,u,p,x,b,T){return!(a===b&&t===T)&&ar(a,t,r,u,p,x,b,T)}function I0(a,t){return a.next.i!==t.i&&a.prev.i!==t.i&&!(function(r,u){let p=r;do{if(p.i!==r.i&&p.next.i!==r.i&&p.i!==u.i&&p.next.i!==u.i&&Pm(p,p.next,r,u))return!0;p=p.next}while(p!==r);return!1})(a,t)&&(Dr(a,t)&&Dr(t,a)&&(function(r,u){let p=r,x=!1;const b=(r.x+u.x)/2,T=(r.y+u.y)/2;do p.y>T!=p.next.y>T&&p.next.y!==p.y&&b<(p.next.x-p.x)*(T-p.y)/(p.next.y-p.y)+p.x&&(x=!x),p=p.next;while(p!==r);return x})(a,t)&&(Cn(a.prev,a,t.prev)||Cn(a,t.prev,t))||Jh(a,t)&&Cn(a.prev,a,a.next)>0&&Cn(t.prev,t,t.next)>0)}function Cn(a,t,r){return(t.y-a.y)*(r.x-t.x)-(t.x-a.x)*(r.y-t.y)}function Jh(a,t){return a.x===t.x&&a.y===t.y}function Pm(a,t,r,u){const p=xi(Cn(a,t,r)),x=xi(Cn(a,t,u)),b=xi(Cn(r,u,a)),T=xi(Cn(r,u,t));return p!==x&&b!==T||!(p!==0||!If(a,r,t))||!(x!==0||!If(a,u,t))||!(b!==0||!If(r,a,u))||!(T!==0||!If(r,t,u))}function If(a,t,r){return t.x<=Math.max(a.x,r.x)&&t.x>=Math.min(a.x,r.x)&&t.y<=Math.max(a.y,r.y)&&t.y>=Math.min(a.y,r.y)}function xi(a){return a>0?1:a<0?-1:0}function Dr(a,t){return Cn(a.prev,a,a.next)<0?Cn(a,t,a.next)>=0&&Cn(a,a.prev,t)>=0:Cn(a,t,a.prev)<0||Cn(a,a.next,t)<0}function hl(a,t){const r=Kp(a.i,a.x,a.y),u=Kp(t.i,t.x,t.y),p=a.next,x=t.prev;return a.next=t,t.prev=a,r.next=p,p.prev=r,u.next=r,r.prev=u,x.next=u,u.prev=x,u}function Rm(a,t,r,u){const p=Kp(a,t,r);return u?(p.next=u.next,p.prev=u,u.next.prev=p,u.next=p):(p.prev=p,p.next=p),p}function ed(a){a.next.prev=a.prev,a.prev.next=a.next,a.prevZ&&(a.prevZ.nextZ=a.nextZ),a.nextZ&&(a.nextZ.prevZ=a.prevZ)}function Kp(a,t,r){return{i:a,x:t,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}class td{constructor(t,r){if(r>t)throw new Error("Min granularity must not be greater than base granularity.");this._baseZoomGranularity=t,this._minGranularity=r}getGranularityForZoomLevel(t){return Math.max(Math.floor(this._baseZoomGranularity/(1<<t)),this._minGranularity,1)}}class Xu{constructor(t){this.fill=t.fill,this.line=t.line,this.tile=t.tile,this.stencil=t.stencil,this.circle=t.circle}}Xu.noSubdivision=new Xu({fill:new td(0,0),line:new td(0,0),tile:new td(0,0),stencil:new td(0,0),circle:1}),Ct("SubdivisionGranularityExpression",td),Ct("SubdivisionGranularitySetting",Xu);const Cr=-32768,Ta=32767;class z0{constructor(t,r){this._vertexBuffer=[],this._vertexDictionary=new Map,this._used=!1,this._granularity=t,this._granularityCellSize=St/t,this._canonical=r}_getKey(t,r){return(t+=32768)<<16|r+32768}_vertexToIndex(t,r){if(t<-32768||r<-32768||t>32767||r>32767)throw new Error("Vertex coordinates are out of signed 16 bit integer range.");const u=0|Math.round(t),p=0|Math.round(r),x=this._getKey(u,p);if(this._vertexDictionary.has(x))return this._vertexDictionary.get(x);const b=this._vertexBuffer.length/2;return this._vertexDictionary.set(x,b),this._vertexBuffer.push(u,p),b}_subdivideTrianglesScanline(t){if(this._granularity<2)return(function(p,x){const b=[];for(let T=0;T<x.length;T+=3){const M=x[T],I=x[T+1],z=x[T+2],F=p[2*M],j=p[2*M+1];(p[2*I]-F)*(p[2*z+1]-j)-(p[2*I+1]-j)*(p[2*z]-F)>0?(b.push(M),b.push(z),b.push(I)):(b.push(M),b.push(I),b.push(z))}return b})(this._vertexBuffer,t);const r=[],u=t.length;for(let p=0;p<u;p+=3){const x=[t[p+0],t[p+1],t[p+2]],b=[this._vertexBuffer[2*t[p+0]+0],this._vertexBuffer[2*t[p+0]+1],this._vertexBuffer[2*t[p+1]+0],this._vertexBuffer[2*t[p+1]+1],this._vertexBuffer[2*t[p+2]+0],this._vertexBuffer[2*t[p+2]+1]];let T=1/0,M=1/0,I=-1/0,z=-1/0;for(let J=0;J<3;J++){const ne=b[2*J],le=b[2*J+1];T=Math.min(T,ne),I=Math.max(I,ne),M=Math.min(M,le),z=Math.max(z,le)}if(T===I||M===z)continue;const F=Math.floor(T/this._granularityCellSize),j=Math.ceil(I/this._granularityCellSize),G=Math.floor(M/this._granularityCellSize),H=Math.ceil(z/this._granularityCellSize);if(F!==j||G!==H)for(let J=G;J<H;J++){const ne=this._scanlineGenerateVertexRingForCellRow(J,b,x);ec(this._vertexBuffer,ne,r)}else r.push(...x)}return r}_scanlineGenerateVertexRingForCellRow(t,r,u){const p=t*this._granularityCellSize,x=p+this._granularityCellSize,b=[];for(let T=0;T<3;T++){const M=r[2*T],I=r[2*T+1],z=r[2*(T+1)%6],F=r[(2*(T+1)+1)%6],j=r[2*(T+2)%6],G=r[(2*(T+2)+1)%6],H=z-M,J=F-I,ne=H===0,le=J===0,Ae=(p-I)/J,pe=(x-I)/J,ve=Math.min(Ae,pe),Fe=Math.max(Ae,pe);if(!le&&(ve>=1||Fe<=0)||le&&(I<p||I>x)){F>=p&&F<=x&&b.push(u[(T+1)%3]);continue}!le&&ve>0&&b.push(this._vertexToIndex(M+H*ve,I+J*ve));const qe=M+H*Math.max(ve,0),it=M+H*Math.min(Fe,1);ne||this._generateIntraEdgeVertices(b,M,I,z,F,qe,it),!le&&Fe<1&&b.push(this._vertexToIndex(M+H*Fe,I+J*Fe)),(le||F>=p&&F<=x)&&b.push(u[(T+1)%3]),!le&&(F<=p||F>=x)&&this._generateInterEdgeVertices(b,M,I,z,F,j,G,it,p,x)}return b}_generateIntraEdgeVertices(t,r,u,p,x,b,T){const M=p-r,I=x-u,z=I===0,F=z?Math.min(r,p):Math.min(b,T),j=z?Math.max(r,p):Math.max(b,T),G=Math.floor(F/this._granularityCellSize)+1,H=Math.ceil(j/this._granularityCellSize)-1;if(z?r<p:b<T)for(let J=G;J<=H;J++){const ne=J*this._granularityCellSize;t.push(this._vertexToIndex(ne,u+I*(ne-r)/M))}else for(let J=H;J>=G;J--){const ne=J*this._granularityCellSize;t.push(this._vertexToIndex(ne,u+I*(ne-r)/M))}}_generateInterEdgeVertices(t,r,u,p,x,b,T,M,I,z){const F=x-u,j=b-p,G=T-x,H=(I-x)/G,J=(z-x)/G,ne=Math.min(H,J),le=Math.max(H,J),Ae=p+j*ne;let pe=Math.floor(Math.min(Ae,M)/this._granularityCellSize)+1,ve=Math.ceil(Math.max(Ae,M)/this._granularityCellSize)-1,Fe=M<Ae;const qe=G===0;if(qe&&(T===I||T===z))return;if(qe||ne>=1||le<=0){const bt=u-T,mt=b+(r-b)*Math.min((I-T)/bt,(z-T)/bt);pe=Math.floor(Math.min(mt,M)/this._granularityCellSize)+1,ve=Math.ceil(Math.max(mt,M)/this._granularityCellSize)-1,Fe=M<mt}const it=F>0?z:I;if(Fe)for(let bt=pe;bt<=ve;bt++)t.push(this._vertexToIndex(bt*this._granularityCellSize,it));else for(let bt=ve;bt>=pe;bt--)t.push(this._vertexToIndex(bt*this._granularityCellSize,it))}_generateOutline(t){const r=[];for(const u of t){const p=qc(u,this._granularity,!0),x=this._pointArrayToIndices(p),b=[];for(let T=1;T<x.length;T++)b.push(x[T-1]),b.push(x[T]);r.push(b)}return r}_handlePoles(t){let r=!1,u=!1;this._canonical&&(this._canonical.y===0&&(r=!0),this._canonical.y===(1<<this._canonical.z)-1&&(u=!0)),(r||u)&&this._fillPoles(t,r,u)}_ensureNoPoleVertices(){const t=this._vertexBuffer;for(let r=0;r<t.length;r+=2){const u=t[r+1];u===Cr&&(t[r+1]=-32767),u===Ta&&(t[r+1]=32766)}}_generatePoleQuad(t,r,u,p,x,b){p>x!=(b===Cr)?(t.push(r),t.push(u),t.push(this._vertexToIndex(p,b)),t.push(u),t.push(this._vertexToIndex(x,b)),t.push(this._vertexToIndex(p,b))):(t.push(u),t.push(r),t.push(this._vertexToIndex(p,b)),t.push(this._vertexToIndex(x,b)),t.push(u),t.push(this._vertexToIndex(p,b)))}_fillPoles(t,r,u){const p=this._vertexBuffer,x=St,b=t.length;for(let T=2;T<b;T+=3){const M=t[T-2],I=t[T-1],z=t[T],F=p[2*M],j=p[2*M+1],G=p[2*I],H=p[2*I+1],J=p[2*z],ne=p[2*z+1];r&&(j===0&&H===0&&this._generatePoleQuad(t,M,I,F,G,Cr),H===0&&ne===0&&this._generatePoleQuad(t,I,z,G,J,Cr),ne===0&&j===0&&this._generatePoleQuad(t,z,M,J,F,Cr)),u&&(j===x&&H===x&&this._generatePoleQuad(t,M,I,F,G,Ta),H===x&&ne===x&&this._generatePoleQuad(t,I,z,G,J,Ta),ne===x&&j===x&&this._generatePoleQuad(t,z,M,J,F,Ta))}}_initializeVertices(t){for(let r=0;r<t.length;r+=2)this._vertexToIndex(t[r],t[r+1])}subdividePolygonInternal(t,r){if(this._used)throw new Error("Subdivision: multiple use not allowed.");this._used=!0;const{flattened:u,holeIndices:p}=(function(T){const M=[],I=[];for(const z of T)if(z.length!==0){z!==T[0]&&M.push(I.length/2);for(let F=0;F<z.length;F++)I.push(z[F].x),I.push(z[F].y)}return{flattened:I,holeIndices:M}})(t);let x;this._initializeVertices(u);try{const T=(function(I,z,F=2){const j=z&&z.length,G=j?z[0]*F:I.length;let H=Em(I,0,G,F,!0);const J=[];if(!H||H.next===H.prev)return J;let ne,le,Ae;if(j&&(H=(function(pe,ve,Fe,qe){const it=[];for(let bt=0,mt=ve.length;bt<mt;bt++){const _t=Em(pe,ve[bt]*qe,bt<mt-1?ve[bt+1]*qe:pe.length,qe,!1);_t===_t.next&&(_t.steiner=!0),it.push(Jl(_t))}it.sort(Am);for(let bt=0;bt<it.length;bt++)Fe=Lm(it[bt],Fe);return Fe})(I,z,H,F)),I.length>80*F){ne=I[0],le=I[1];let pe=ne,ve=le;for(let Fe=F;Fe<G;Fe+=F){const qe=I[Fe],it=I[Fe+1];qe<ne&&(ne=qe),it<le&&(le=it),qe>pe&&(pe=qe),it>ve&&(ve=it)}Ae=Math.max(pe-ne,ve-le),Ae=Ae!==0?32767/Ae:0}return Kl(H,J,F,ne,le,Ae,0),J})(u,p),M=this._convertIndices(u,T);x=this._subdivideTrianglesScanline(M)}catch(T){console.error(T)}let b=[];return r&&(b=this._generateOutline(t)),this._ensureNoPoleVertices(),this._handlePoles(x),{verticesFlattened:this._vertexBuffer,indicesTriangles:x,indicesLineList:b}}_convertIndices(t,r){const u=[];for(let p=0;p<r.length;p++)u.push(this._vertexToIndex(t[2*r[p]],t[2*r[p]+1]));return u}_pointArrayToIndices(t){const r=[];for(let u=0;u<t.length;u++){const p=t[u];r.push(this._vertexToIndex(p.x,p.y))}return r}}function Ea(a,t,r,u=!0){return new z0(r,t).subdividePolygonInternal(a,u)}function qc(a,t,r=!1){if(!a||a.length<1)return[];if(a.length<2)return[];const u=a[0],p=a[a.length-1],x=r&&(u.x!==p.x||u.y!==p.y);if(t<2)return x?[...a,a[0]]:[...a];const b=Math.floor(St/t),T=[];T.push(new D(a[0].x,a[0].y));const M=a.length,I=x?M:M-1;for(let z=0;z<I;z++){const F=a[z],j=z<M-1?a[z+1]:a[0],G=F.x,H=F.y,J=j.x,ne=j.y,le=G!==J,Ae=H!==ne;if(!le&&!Ae)continue;const pe=J-G,ve=ne-H,Fe=Math.abs(pe),qe=Math.abs(ve);let it=G,bt=H;for(;;){const _t=pe>0?(Math.floor(it/b)+1)*b:(Math.ceil(it/b)-1)*b,kt=ve>0?(Math.floor(bt/b)+1)*b:(Math.ceil(bt/b)-1)*b,yt=Math.abs(it-_t),vt=Math.abs(bt-kt),We=Math.abs(it-J),jt=Math.abs(bt-ne),Kt=le?yt/Fe:Number.POSITIVE_INFINITY,Vt=Ae?vt/qe:Number.POSITIVE_INFINITY;if((We<=yt||!le)&&(jt<=vt||!Ae))break;if(Kt<Vt&&le||!Ae){it=_t,bt+=ve*Kt;const zt=new D(it,Math.round(bt));T[T.length-1].x===zt.x&&T[T.length-1].y===zt.y||T.push(zt)}else{it+=pe*Vt,bt=kt;const zt=new D(Math.round(it),bt);T[T.length-1].x===zt.x&&T[T.length-1].y===zt.y||T.push(zt)}}const mt=new D(J,ne);T[T.length-1].x===mt.x&&T[T.length-1].y===mt.y||T.push(mt)}return T}function ec(a,t,r){if(t.length===0)throw new Error("Subdivision vertex ring is empty.");let u=0,p=a[2*t[0]];for(let M=1;M<t.length;M++){const I=a[2*t[M]];I<p&&(p=I,u=M)}const x=t.length;let b=u,T=(b+1)%x;for(;;){const M=b-1>=0?b-1:x-1,I=(T+1)%x,z=a[2*t[M]],F=a[2*t[I]],j=a[2*t[b]],G=a[2*t[b]+1],H=a[2*t[T]+1];let J=!1;if(z<F)J=!0;else if(z>F)J=!1;else{const ne=H-G,le=-(a[2*t[T]]-j),Ae=G<H?1:-1;((z-j)*ne+(a[2*t[M]+1]-G)*le)*Ae>((F-j)*ne+(a[2*t[I]+1]-G)*le)*Ae&&(J=!0)}if(J){const ne=t[M],le=t[b],Ae=t[T];ne!==le&&ne!==Ae&&le!==Ae&&r.push(Ae,le,ne),b--,b<0&&(b=x-1)}else{const ne=t[I],le=t[b],Ae=t[T];ne!==le&&ne!==Ae&&le!==Ae&&r.push(Ae,le,ne),T++,T>=x&&(T=0)}if(M===I)break}}function Hc(a,t,r,u,p,x,b,T,M){const I=p.length/2,z=b&&T&&M;if(I<yn.MAX_VERTEX_ARRAY_LENGTH){const F=t.prepareSegment(I,r,u),j=F.vertexLength;for(let J=0;J<x.length;J+=3)u.emplaceBack(j+x[J],j+x[J+1],j+x[J+2]);let G,H;F.vertexLength+=I,F.primitiveLength+=x.length/3,z&&(H=b.prepareSegment(I,r,T),G=H.vertexLength,H.vertexLength+=I);for(let J=0;J<p.length;J+=2)a(p[J],p[J+1]);if(z)for(let J=0;J<M.length;J++){const ne=M[J];for(let le=1;le<ne.length;le+=2)T.emplaceBack(G+ne[le-1],G+ne[le]);H.primitiveLength+=ne.length/2}}else(function(F,j,G,H,J,ne){const le=[];for(let qe=0;qe<H.length/2;qe++)le.push(-1);const Ae={count:0};let pe=0,ve=F.getOrCreateLatestSegment(j,G),Fe=ve.vertexLength;for(let qe=2;qe<J.length;qe+=3){const it=J[qe-2],bt=J[qe-1],mt=J[qe];let _t=le[it]<pe,kt=le[bt]<pe,yt=le[mt]<pe;ve.vertexLength+((_t?1:0)+(kt?1:0)+(yt?1:0))>yn.MAX_VERTEX_ARRAY_LENGTH&&(ve=F.createNewSegment(j,G),pe=Ae.count,_t=!0,kt=!0,yt=!0,Fe=0);const vt=_s(le,H,ne,Ae,it,_t,ve),We=_s(le,H,ne,Ae,bt,kt,ve),jt=_s(le,H,ne,Ae,mt,yt,ve);G.emplaceBack(Fe+vt-pe,Fe+We-pe,Fe+jt-pe),ve.primitiveLength++}})(t,r,u,p,x,a),z&&(function(F,j,G,H,J,ne){const le=[];for(let qe=0;qe<H.length/2;qe++)le.push(-1);const Ae={count:0};let pe=0,ve=F.getOrCreateLatestSegment(j,G),Fe=ve.vertexLength;for(let qe=0;qe<J.length;qe++){const it=J[qe];for(let bt=1;bt<J[qe].length;bt+=2){const mt=it[bt-1],_t=it[bt];let kt=le[mt]<pe,yt=le[_t]<pe;ve.vertexLength+((kt?1:0)+(yt?1:0))>yn.MAX_VERTEX_ARRAY_LENGTH&&(ve=F.createNewSegment(j,G),pe=Ae.count,kt=!0,yt=!0,Fe=0);const vt=_s(le,H,ne,Ae,mt,kt,ve),We=_s(le,H,ne,Ae,_t,yt,ve);G.emplaceBack(Fe+vt-pe,Fe+We-pe),ve.primitiveLength++}}})(b,r,T,p,M,a),t.forceNewSegmentOnNextPrepare(),b==null||b.forceNewSegmentOnNextPrepare()}function _s(a,t,r,u,p,x,b){if(x){const T=u.count;return r(t[2*p],t[2*p+1]),a[p]=u.count,u.count++,b.vertexLength++,T}return a[p]}class zf{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((r=>r.id)),this.index=t.index,this.hasDependencies=!1,this.patternFeatures=[],this.layoutVertexArray=new Ee,this.indexArray=new Nn,this.indexArray2=new Un,this.programConfigurations=new $s(t.layers,t.zoom),this.segments=new yn,this.segments2=new yn,this.stateDependentLayerIds=this.layers.filter((r=>r.isStateDependent())).map((r=>r.id))}populate(t,r,u){this.hasDependencies=Zc("fill",this.layers,r);const p=this.layers[0].layout.get("fill-sort-key"),x=!p.isConstant(),b=[];for(const{feature:T,id:M,index:I,sourceLayerIndex:z}of t){const F=this.layers[0]._featureFilter.needGeometry,j=ys(T,F);if(!this.layers[0]._featureFilter.filter(new Xn(this.zoom),j,u))continue;const G=x?p.evaluate(j,{},u,r.availableImages):void 0,H={id:M,properties:T.properties,type:T.type,sourceLayerIndex:z,index:I,geometry:F?j.geometry:Vc(T),patterns:{},sortKey:G};b.push(H)}x&&b.sort(((T,M)=>T.sortKey-M.sortKey));for(const T of b){const{geometry:M,index:I,sourceLayerIndex:z}=T;if(this.hasDependencies){const F=cl("fill",this.layers,T,{zoom:this.zoom},r);this.patternFeatures.push(F)}else this.addFeature(T,M,I,u,{},r.subdivisionGranularity);r.featureIndex.insert(t[I].feature,M,I,z,this.index)}}update(t,r,u){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,r,this.stateDependentLayers,{imagePositions:u})}addFeatures(t,r,u){for(const p of this.patternFeatures)this.addFeature(p,p.geometry,p.index,r,u,t.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,L0),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(t,r,u,p,x,b){for(const T of bu(r,500)){const M=Ea(T,p,b.fill.getGranularityForZoomLevel(p.z)),I=this.layoutVertexArray;Hc(((z,F)=>{I.emplaceBack(z,F)}),this.segments,this.layoutVertexArray,this.indexArray,M.verticesFlattened,M.indicesTriangles,this.segments2,this.indexArray2,M.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,u,{imagePositions:x,canonical:p})}}let Jp,Vs;Ct("FillBucket",zf,{omit:["layers","patternFeatures"]});var D0={get paint(){return Vs=Vs||new ci({"fill-antialias":new Mt(Ie.paint_fill["fill-antialias"]),"fill-opacity":new $t(Ie.paint_fill["fill-opacity"]),"fill-color":new $t(Ie.paint_fill["fill-color"]),"fill-outline-color":new $t(Ie.paint_fill["fill-outline-color"]),"fill-translate":new Mt(Ie.paint_fill["fill-translate"]),"fill-translate-anchor":new Mt(Ie.paint_fill["fill-translate-anchor"]),"fill-pattern":new ql(Ie.paint_fill["fill-pattern"])})},get layout(){return Jp=Jp||new ci({"fill-sort-key":new $t(Ie.layout_fill["fill-sort-key"])})}};class nd extends yr{constructor(t,r){super(t,D0,r)}recalculate(t,r){super.recalculate(t,r);const u=this.paint._values["fill-outline-color"];u.value.kind==="constant"&&u.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(t){return new zf(t)}queryRadius(){return Ef(this.paint.get("fill-translate"))}queryIntersectsFeature({queryGeometry:t,geometry:r,transform:u,pixelsToTileUnits:p}){return Zp(jc(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),-u.bearingInRadians,p),r)}isTileClipped(){return!0}}const Df=Yn([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),Of=Yn([{name:"a_centroid",components:2,type:"Int16"}],4),{members:id}=Df;class Yu{constructor(t,r,u,p,x){this.properties={},this.extent=u,this.type=0,this.id=void 0,this._pbf=t,this._geometry=-1,this._keys=p,this._values=x,t.readFields(O0,this,r)}loadGeometry(){const t=this._pbf;t.pos=this._geometry;const r=t.readVarint()+t.pos,u=[];let p,x=1,b=0,T=0,M=0;for(;t.pos<r;){if(b<=0){const I=t.readVarint();x=7&I,b=I>>3}if(b--,x===1||x===2)T+=t.readSVarint(),M+=t.readSVarint(),x===1&&(p&&u.push(p),p=[]),p&&p.push(new D(T,M));else{if(x!==7)throw new Error(`unknown command ${x}`);p&&p.push(p[0].clone())}}return p&&u.push(p),u}bbox(){const t=this._pbf;t.pos=this._geometry;const r=t.readVarint()+t.pos;let u=1,p=0,x=0,b=0,T=1/0,M=-1/0,I=1/0,z=-1/0;for(;t.pos<r;){if(p<=0){const F=t.readVarint();u=7&F,p=F>>3}if(p--,u===1||u===2)x+=t.readSVarint(),b+=t.readSVarint(),x<T&&(T=x),x>M&&(M=x),b<I&&(I=b),b>z&&(z=b);else if(u!==7)throw new Error(`unknown command ${u}`)}return[T,I,M,z]}toGeoJSON(t,r,u){const p=this.extent*Math.pow(2,u),x=this.extent*t,b=this.extent*r,T=this.loadGeometry();function M(j){return[360*(j.x+x)/p-180,360/Math.PI*Math.atan(Math.exp((1-2*(j.y+b)/p)*Math.PI))-90]}function I(j){return j.map(M)}let z;if(this.type===1){const j=[];for(const H of T)j.push(H[0]);const G=I(j);z=j.length===1?{type:"Point",coordinates:G[0]}:{type:"MultiPoint",coordinates:G}}else if(this.type===2){const j=T.map(I);z=j.length===1?{type:"LineString",coordinates:j[0]}:{type:"MultiLineString",coordinates:j}}else{if(this.type!==3)throw new Error("unknown feature type");{const j=(function(H){const J=H.length;if(J<=1)return[H];const ne=[];let le,Ae;for(let pe=0;pe<J;pe++){const ve=kf(H[pe]);ve!==0&&(Ae===void 0&&(Ae=ve<0),Ae===ve<0?(le&&ne.push(le),le=[H[pe]]):le&&le.push(H[pe]))}return le&&ne.push(le),ne})(T),G=[];for(const H of j)G.push(H.map(I));z=G.length===1?{type:"Polygon",coordinates:G[0]}:{type:"MultiPolygon",coordinates:G}}}const F={type:"Feature",geometry:z,properties:this.properties};return this.id!=null&&(F.id=this.id),F}}function O0(a,t,r){a===1?t.id=r.readVarint():a===2?(function(u,p){const x=u.readVarint()+u.pos;for(;u.pos<x;){const b=p._keys[u.readVarint()],T=p._values[u.readVarint()];p.properties[b]=T}})(r,t):a===3?t.type=r.readVarint():a===4&&(t._geometry=r.pos)}function kf(a){let t=0;for(let r,u,p=0,x=a.length,b=x-1;p<x;b=p++)r=a[p],u=a[b],t+=(u.x-r.x)*(r.y+u.y);return t}Yu.types=["Unknown","Point","LineString","Polygon"];class Im{constructor(t,r){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(e1,this,r),this.length=this._features.length}feature(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];const r=this._pbf.readVarint()+this._pbf.pos;return new Yu(this._pbf,r,this.extent,this._keys,this._values)}}function e1(a,t,r){a===15?t.version=r.readVarint():a===1?t.name=r.readString():a===5?t.extent=r.readVarint():a===2?t._features.push(r.pos):a===3?t._keys.push(r.readString()):a===4&&t._values.push((function(u){let p=null;const x=u.readVarint()+u.pos;for(;u.pos<x;){const b=u.readVarint()>>3;p=b===1?u.readString():b===2?u.readFloat():b===3?u.readDouble():b===4?u.readVarint64():b===5?u.readVarint():b===6?u.readSVarint():b===7?u.readBoolean():null}if(p==null)throw new Error("unknown feature value");return p})(r))}class zm{constructor(t,r){this.layers=t.readFields(n_,{},r)}}function n_(a,t,r){if(a===3){const u=new Im(r,r.readVarint()+r.pos);u.length&&(t[u.name]=u)}}const Dm=Math.pow(2,13);function Bn(a,t,r,u,p,x,b,T){a.emplaceBack(t,r,2*Math.floor(u*Dm)+b,p*Dm*2,x*Dm*2,Math.round(T))}class di{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((r=>r.id)),this.index=t.index,this.hasDependencies=!1,this.layoutVertexArray=new Ve,this.centroidVertexArray=new be,this.indexArray=new Nn,this.programConfigurations=new $s(t.layers,t.zoom),this.segments=new yn,this.stateDependentLayerIds=this.layers.filter((r=>r.isStateDependent())).map((r=>r.id))}populate(t,r,u){this.features=[],this.hasDependencies=Zc("fill-extrusion",this.layers,r);for(const{feature:p,id:x,index:b,sourceLayerIndex:T}of t){const M=this.layers[0]._featureFilter.needGeometry,I=ys(p,M);if(!this.layers[0]._featureFilter.filter(new Xn(this.zoom),I,u))continue;const z={id:x,sourceLayerIndex:T,index:b,geometry:M?I.geometry:Vc(p),properties:p.properties,type:p.type,patterns:{}};this.hasDependencies?this.features.push(cl("fill-extrusion",this.layers,z,{zoom:this.zoom},r)):this.addFeature(z,z.geometry,b,u,{},r.subdivisionGranularity),r.featureIndex.insert(p,z.geometry,b,T,this.index,!0)}}addFeatures(t,r,u){for(const p of this.features){const{geometry:x}=p;this.addFeature(p,x,p.index,r,u,t.subdivisionGranularity)}}update(t,r,u){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,r,this.stateDependentLayers,{imagePositions:u})}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,id),this.centroidVertexBuffer=t.createVertexBuffer(this.centroidVertexArray,Of.members,!0),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(t,r,u,p,x,b){for(const T of bu(r,500)){const M={x:0,y:0,sampleCount:0},I=this.layoutVertexArray.length;this.processPolygon(M,p,t,T,b);const z=this.layoutVertexArray.length-I,F=Math.floor(M.x/M.sampleCount),j=Math.floor(M.y/M.sampleCount);for(let G=0;G<z;G++)this.centroidVertexArray.emplaceBack(F,j)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,u,{imagePositions:x,canonical:p})}processPolygon(t,r,u,p,x){if(p.length<1||ri(p[0]))return;for(const F of p)F.length!==0&&Pn(t,F);const b={segment:this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray)},T=x.fill.getGranularityForZoomLevel(r.z),M=Yu.types[u.type]==="Polygon";for(const F of p){if(F.length===0||ri(F))continue;const j=qc(F,T,M);this._generateSideFaces(j,b)}if(!M)return;const I=Ea(p,r,T,!1),z=this.layoutVertexArray;Hc(((F,j)=>{Bn(z,F,j,0,0,1,1,0)}),this.segments,this.layoutVertexArray,this.indexArray,I.verticesFlattened,I.indicesTriangles)}_generateSideFaces(t,r){let u=0;for(let p=1;p<t.length;p++){const x=t[p],b=t[p-1];if(In(x,b))continue;r.segment.vertexLength+4>yn.MAX_VERTEX_ARRAY_LENGTH&&(r.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const T=x.sub(b)._perp()._unit(),M=b.dist(x);u+M>32768&&(u=0),Bn(this.layoutVertexArray,x.x,x.y,T.x,T.y,0,0,u),Bn(this.layoutVertexArray,x.x,x.y,T.x,T.y,0,1,u),u+=M,Bn(this.layoutVertexArray,b.x,b.y,T.x,T.y,0,0,u),Bn(this.layoutVertexArray,b.x,b.y,T.x,T.y,0,1,u);const I=r.segment.vertexLength;this.indexArray.emplaceBack(I,I+2,I+1),this.indexArray.emplaceBack(I+1,I+2,I+3),r.segment.vertexLength+=4,r.segment.primitiveLength+=2}}}function Pn(a,t){for(let r=0;r<t.length;r++){const u=t[r];r===t.length-1&&t[0].x===u.x&&t[0].y===u.y||(a.x+=u.x,a.y+=u.y,a.sampleCount++)}}function In(a,t){return a.x===t.x&&(a.x<0||a.x>St)||a.y===t.y&&(a.y<0||a.y>St)}function ri(a){return a.every((t=>t.x<0))||a.every((t=>t.x>St))||a.every((t=>t.y<0))||a.every((t=>t.y>St))}let Ha;Ct("FillExtrusionBucket",di,{omit:["layers","features"]});var Xc={get paint(){return Ha=Ha||new ci({"fill-extrusion-opacity":new Mt(Ie["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new $t(Ie["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Mt(Ie["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Mt(Ie["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new ql(Ie["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new $t(Ie["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new $t(Ie["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Mt(Ie["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class rd extends yr{constructor(t,r){super(t,Xc,r)}createBucket(t){return new di(t)}queryRadius(){return Ef(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:t,feature:r,featureState:u,geometry:p,transform:x,pixelsToTileUnits:b,pixelPosMatrix:T}){const M=jc(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),-x.bearingInRadians,b),I=this.paint.get("fill-extrusion-height").evaluate(r,u),z=this.paint.get("fill-extrusion-base").evaluate(r,u),F=(function(G,H){const J=[];for(const ne of G){const le=[ne.x,ne.y,0,1];sn(le,le,H),J.push(new D(le[0]/le[3],le[1]/le[3]))}return J})(M,T),j=(function(G,H,J,ne){const le=[],Ae=[],pe=ne[8]*H,ve=ne[9]*H,Fe=ne[10]*H,qe=ne[11]*H,it=ne[8]*J,bt=ne[9]*J,mt=ne[10]*J,_t=ne[11]*J;for(const kt of G){const yt=[],vt=[];for(const We of kt){const jt=We.x,Kt=We.y,Vt=ne[0]*jt+ne[4]*Kt+ne[12],zt=ne[1]*jt+ne[5]*Kt+ne[13],fn=ne[2]*jt+ne[6]*Kt+ne[14],gi=ne[3]*jt+ne[7]*Kt+ne[15],Ui=fn+Fe,Er=gi+qe,La=Vt+it,Qi=zt+bt,Ti=fn+mt,Gn=gi+_t,ki=new D((Vt+pe)/Er,(zt+ve)/Er);ki.z=Ui/Er,yt.push(ki);const $i=new D(La/Gn,Qi/Gn);$i.z=Ti/Gn,vt.push($i)}le.push(yt),Ae.push(vt)}return[le,Ae]})(p,z,I,T);return(function(G,H,J){let ne=1/0;Zp(J,H)&&(ne=dl(J,H[0]));for(let le=0;le<H.length;le++){const Ae=H[le],pe=G[le];for(let ve=0;ve<Ae.length-1;ve++){const Fe=Ae[ve],qe=[Fe,Ae[ve+1],pe[ve+1],pe[ve],Fe];Sf(J,qe)&&(ne=Math.min(ne,dl(J,qe)))}}return ne!==1/0&&ne})(j[0],j[1],F)}}function Qu(a,t){return a.x*t.x+a.y*t.y}function dl(a,t){if(a.length===1){let r=0;const u=t[r++];let p;for(;!p||u.equals(p);)if(p=t[r++],!p)return 1/0;for(;r<t.length;r++){const x=t[r],b=a[0],T=p.sub(u),M=x.sub(u),I=b.sub(u),z=Qu(T,T),F=Qu(T,M),j=Qu(M,M),G=Qu(I,T),H=Qu(I,M),J=z*j-F*F,ne=(j*G-F*H)/J,le=(z*H-F*G)/J,Ae=u.z*(1-ne-le)+p.z*ne+x.z*le;if(isFinite(Ae))return Ae}return 1/0}{let r=1/0;for(const u of t)r=Math.min(r,u.z);return r}}const Yi=Yn([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:Yc}=Yi,Wu=Yn([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:Om}=Wu,vs=Math.cos(Math.PI/180*37.5),Ku=Math.pow(2,14)/.5;class Ju{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((r=>r.id)),this.index=t.index,this.hasDependencies=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((r=>{this.gradients[r.id]={}})),this.layoutVertexArray=new ke,this.layoutVertexArray2=new Ne,this.indexArray=new Nn,this.programConfigurations=new $s(t.layers,t.zoom),this.segments=new yn,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((r=>r.isStateDependent())).map((r=>r.id))}populate(t,r,u){this.hasDependencies=Zc("line",this.layers,r)||this.hasLineDasharray(this.layers);const p=this.layers[0].layout.get("line-sort-key"),x=!p.isConstant(),b=[];for(const{feature:T,id:M,index:I,sourceLayerIndex:z}of t){const F=this.layers[0]._featureFilter.needGeometry,j=ys(T,F);if(!this.layers[0]._featureFilter.filter(new Xn(this.zoom),j,u))continue;const G=x?p.evaluate(j,{},u):void 0,H={id:M,properties:T.properties,type:T.type,sourceLayerIndex:z,index:I,geometry:F?j.geometry:Vc(T),patterns:{},dashes:{},sortKey:G};b.push(H)}x&&b.sort(((T,M)=>T.sortKey-M.sortKey));for(const T of b){const{geometry:M,index:I,sourceLayerIndex:z}=T;this.hasDependencies?(Zc("line",this.layers,r)?cl("line",this.layers,T,{zoom:this.zoom},r):this.hasLineDasharray(this.layers)&&this.addLineDashDependencies(this.layers,T,this.zoom,r),this.patternFeatures.push(T)):this.addFeature(T,M,I,u,{},{},r.subdivisionGranularity),r.featureIndex.insert(t[I].feature,M,I,z,this.index)}}update(t,r,u,p){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,r,this.stateDependentLayers,{imagePositions:u,dashPositions:p})}addFeatures(t,r,u,p){for(const x of this.patternFeatures)this.addFeature(x,x.geometry,x.index,r,u,p,t.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,Om)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Yc),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(t){if(t.properties&&Object.prototype.hasOwnProperty.call(t.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(t.properties,"mapbox_clip_end"))return{start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}}addFeature(t,r,u,p,x,b,T){const M=this.layers[0].layout,I=M.get("line-join").evaluate(t,{}),z=M.get("line-cap"),F=M.get("line-miter-limit"),j=M.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(const G of r)this.addLine(G,t,I,z,F,j,p,T);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,u,{imagePositions:x,dashPositions:b,canonical:p})}addLine(t,r,u,p,x,b,T,M){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,t=qc(t,T?M.line.getGranularityForZoomLevel(T.z):1),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let pe=0;pe<t.length-1;pe++)this.totalDistance+=t[pe].dist(t[pe+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const I=Yu.types[r.type]==="Polygon";let z=t.length;for(;z>=2&&t[z-1].equals(t[z-2]);)z--;let F=0;for(;F<z-1&&t[F].equals(t[F+1]);)F++;if(z<(I?3:2))return;u==="bevel"&&(x=1.05);const j=this.overscaling<=16?122880/(512*this.overscaling):0,G=this.segments.prepareSegment(10*z,this.layoutVertexArray,this.indexArray);let H,J,ne,le,Ae;this.e1=this.e2=-1,I&&(H=t[z-2],Ae=t[F].sub(H)._unit()._perp());for(let pe=F;pe<z;pe++){if(ne=pe===z-1?I?t[F+1]:void 0:t[pe+1],ne&&t[pe].equals(ne))continue;Ae&&(le=Ae),H&&(J=H),H=t[pe],Ae=ne?ne.sub(H)._unit()._perp():le,le=le||Ae;let ve=le.add(Ae);ve.x===0&&ve.y===0||ve._unit();const Fe=le.x*Ae.x+le.y*Ae.y,qe=ve.x*Ae.x+ve.y*Ae.y,it=qe!==0?1/qe:1/0,bt=2*Math.sqrt(2-2*qe),mt=qe<vs&&J&&ne,_t=le.x*Ae.y-le.y*Ae.x>0;if(mt&&pe>F){const vt=H.dist(J);if(vt>2*j){const We=H.sub(H.sub(J)._mult(j/vt)._round());this.updateDistance(J,We),this.addCurrentVertex(We,le,0,0,G),J=We}}const kt=J&&ne;let yt=kt?u:I?"butt":p;if(kt&&yt==="round"&&(it<b?yt="miter":it<=2&&(yt="fakeround")),yt==="miter"&&it>x&&(yt="bevel"),yt==="bevel"&&(it>2&&(yt="flipbevel"),it<x&&(yt="miter")),J&&this.updateDistance(J,H),yt==="miter")ve._mult(it),this.addCurrentVertex(H,ve,0,0,G);else if(yt==="flipbevel"){if(it>100)ve=Ae.mult(-1);else{const vt=it*le.add(Ae).mag()/le.sub(Ae).mag();ve._perp()._mult(vt*(_t?-1:1))}this.addCurrentVertex(H,ve,0,0,G),this.addCurrentVertex(H,ve.mult(-1),0,0,G)}else if(yt==="bevel"||yt==="fakeround"){const vt=-Math.sqrt(it*it-1),We=_t?vt:0,jt=_t?0:vt;if(J&&this.addCurrentVertex(H,le,We,jt,G),yt==="fakeround"){const Kt=Math.round(180*bt/Math.PI/20);for(let Vt=1;Vt<Kt;Vt++){let zt=Vt/Kt;if(zt!==.5){const gi=zt-.5;zt+=zt*gi*(zt-1)*((1.0904+Fe*(Fe*(3.55645-1.43519*Fe)-3.2452))*gi*gi+(.848013+Fe*(.215638*Fe-1.06021)))}const fn=Ae.sub(le)._mult(zt)._add(le)._unit()._mult(_t?-1:1);this.addHalfVertex(H,fn.x,fn.y,!1,_t,0,G)}}ne&&this.addCurrentVertex(H,Ae,-We,-jt,G)}else if(yt==="butt")this.addCurrentVertex(H,ve,0,0,G);else if(yt==="square"){const vt=J?1:-1;this.addCurrentVertex(H,ve,vt,vt,G)}else yt==="round"&&(J&&(this.addCurrentVertex(H,le,0,0,G),this.addCurrentVertex(H,le,1,1,G,!0)),ne&&(this.addCurrentVertex(H,Ae,-1,-1,G,!0),this.addCurrentVertex(H,Ae,0,0,G)));if(mt&&pe<z-1){const vt=H.dist(ne);if(vt>2*j){const We=H.add(ne.sub(H)._mult(j/vt)._round());this.updateDistance(H,We),this.addCurrentVertex(We,Ae,0,0,G),H=We}}}}addCurrentVertex(t,r,u,p,x,b=!1){const T=r.y*p-r.x,M=-r.y-r.x*p;this.addHalfVertex(t,r.x+r.y*u,r.y-r.x*u,b,!1,u,x),this.addHalfVertex(t,T,M,b,!0,-p,x),this.distance>Ku/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,r,u,p,x,b))}addHalfVertex({x:t,y:r},u,p,x,b,T,M){const I=.5*(this.lineClips?this.scaledDistance*(Ku-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t<<1)+(x?1:0),(r<<1)+(b?1:0),Math.round(63*u)+128,Math.round(63*p)+128,1+(T===0?0:T<0?-1:1)|(63&I)<<2,I>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const z=M.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,z,this.e2),M.primitiveLength++),b?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(t,r){this.distance+=t.dist(r),this.updateScaledDistance()}hasLineDasharray(t){for(const r of t){const u=r.paint.get("line-dasharray");if(u&&!u.isConstant())return!0}return!1}addLineDashDependencies(t,r,u,p){for(const x of t){const b=x.paint.get("line-dasharray");if(!b||b.value.kind==="constant")continue;const T=x.layout.get("line-cap")==="round",M={dasharray:b.value.evaluate({zoom:u-1},r,{}),round:T},I={dasharray:b.value.evaluate({zoom:u},r,{}),round:T},z={dasharray:b.value.evaluate({zoom:u+1},r,{}),round:T},F=`${M.dasharray.join(",")},${M.round}`,j=`${I.dasharray.join(",")},${I.round}`,G=`${z.dasharray.join(",")},${z.round}`;p.dashDependencies[F]=M,p.dashDependencies[j]=I,p.dashDependencies[G]=z,r.dashes[x.id]={min:F,mid:j,max:G}}}}let Ma,t1;Ct("LineBucket",Ju,{omit:["layers","patternFeatures"]});var Bf={get paint(){return t1=t1||new ci({"line-opacity":new $t(Ie.paint_line["line-opacity"]),"line-color":new $t(Ie.paint_line["line-color"]),"line-translate":new Mt(Ie.paint_line["line-translate"]),"line-translate-anchor":new Mt(Ie.paint_line["line-translate-anchor"]),"line-width":new $t(Ie.paint_line["line-width"]),"line-gap-width":new $t(Ie.paint_line["line-gap-width"]),"line-offset":new $t(Ie.paint_line["line-offset"]),"line-blur":new $t(Ie.paint_line["line-blur"]),"line-dasharray":new ql(Ie.paint_line["line-dasharray"]),"line-pattern":new ql(Ie.paint_line["line-pattern"]),"line-gradient":new Nc(Ie.paint_line["line-gradient"])})},get layout(){return Ma=Ma||new ci({"line-cap":new Mt(Ie.layout_line["line-cap"]),"line-join":new $t(Ie.layout_line["line-join"]),"line-miter-limit":new Mt(Ie.layout_line["line-miter-limit"]),"line-round-limit":new Mt(Ie.layout_line["line-round-limit"]),"line-sort-key":new $t(Ie.layout_line["line-sort-key"])})}};class k0 extends $t{possiblyEvaluate(t,r){return r=new Xn(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),super.possiblyEvaluate(t,r)}evaluate(t,r,u,p){return r=Ht({},r,{zoom:Math.floor(r.zoom)}),super.evaluate(t,r,u,p)}}let eh;class n1 extends yr{constructor(t,r){super(t,Bf,r),this.gradientVersion=0,eh||(eh=new k0(Bf.paint.properties["line-width"].specification),eh.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(t){if(t==="line-gradient"){const r=this.gradientExpression();this.stepInterpolant=!!(function(u){return u._styleExpression!==void 0})(r)&&r._styleExpression.expression instanceof Vo,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(t,r){super.recalculate(t,r),this.paint._values["line-floorwidth"]=eh.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)}createBucket(t){return new Ju(t)}queryRadius(t){const r=t,u=tc(qu("line-width",this,r),qu("line-gap-width",this,r)),p=qu("line-offset",this,r);return u/2+Math.abs(p)+Ef(this.paint.get("line-translate"))}queryIntersectsFeature({queryGeometry:t,feature:r,featureState:u,geometry:p,transform:x,pixelsToTileUnits:b}){const T=jc(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),-x.bearingInRadians,b),M=b/2*tc(this.paint.get("line-width").evaluate(r,u),this.paint.get("line-gap-width").evaluate(r,u)),I=this.paint.get("line-offset").evaluate(r,u);return I&&(p=(function(z,F){const j=[];for(let G=0;G<z.length;G++){const H=z[G],J=[];for(let ne=0;ne<H.length;ne++){const le=H[ne-1],Ae=H[ne],pe=H[ne+1],ve=ne===0?new D(0,0):Ae.sub(le)._unit()._perp(),Fe=ne===H.length-1?new D(0,0):pe.sub(Ae)._unit()._perp(),qe=ve._add(Fe)._unit(),it=qe.x*Fe.x+qe.y*Fe.y;it!==0&&qe._mult(1/it),J.push(qe._mult(F)._add(Ae))}j.push(J)}return j})(p,I*b)),(function(z,F,j){for(let G=0;G<F.length;G++){const H=F[G];if(z.length>=3){for(let J=0;J<H.length;J++)if(Gu(z,H[J]))return!0}if(x0(z,H,j))return!0}return!1})(T,p,M)}isTileClipped(){return!0}}function tc(a,t){return t>0?t+2*a:a}const Tr=Yn([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Qc=Yn([{name:"a_projected_pos",components:3,type:"Float32"}],4);Yn([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const ad=Yn([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);Yn([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const fl=Yn([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),km=Yn([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Bm(a,t,r){return a.sections.forEach((u=>{u.text=(function(p,x,b){const T=x.layout.get("text-transform").evaluate(b,{});return T==="uppercase"?p=p.toLocaleUpperCase():T==="lowercase"&&(p=p.toLocaleLowerCase()),Fs.applyArabicShaping&&(p=Fs.applyArabicShaping(p)),p})(u.text,t,r)})),a}Yn([{name:"triangle",components:3,type:"Uint16"}]),Yn([{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"}]),Yn([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),Yn([{type:"Float32",name:"offsetX"}]),Yn([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),Yn([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const sd={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var Oi=24;const Ff=4294967296,Xa=1/Ff,Fm=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");class ra{constructor(t=new Uint8Array(16)){this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(t,r,u=this.length){for(;this.pos<u;){const p=this.readVarint(),x=p>>3,b=this.pos;this.type=7&p,t(x,r,this),this.pos===b&&this.skip(p)}return r}readMessage(t,r){return this.readFields(t,r,this.readVarint()+this.pos)}readFixed32(){const t=this.dataView.getUint32(this.pos,!0);return this.pos+=4,t}readSFixed32(){const t=this.dataView.getInt32(this.pos,!0);return this.pos+=4,t}readFixed64(){const t=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*Ff;return this.pos+=8,t}readSFixed64(){const t=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*Ff;return this.pos+=8,t}readFloat(){const t=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,t}readDouble(){const t=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,t}readVarint(t){const r=this.buf;let u,p;return p=r[this.pos++],u=127&p,p<128?u:(p=r[this.pos++],u|=(127&p)<<7,p<128?u:(p=r[this.pos++],u|=(127&p)<<14,p<128?u:(p=r[this.pos++],u|=(127&p)<<21,p<128?u:(p=r[this.pos],u|=(15&p)<<28,(function(x,b,T){const M=T.buf;let I,z;if(z=M[T.pos++],I=(112&z)>>4,z<128||(z=M[T.pos++],I|=(127&z)<<3,z<128)||(z=M[T.pos++],I|=(127&z)<<10,z<128)||(z=M[T.pos++],I|=(127&z)<<17,z<128)||(z=M[T.pos++],I|=(127&z)<<24,z<128)||(z=M[T.pos++],I|=(1&z)<<31,z<128))return th(x,I,b);throw new Error("Expected varint not more than 10 bytes")})(u,t,this)))))}readVarint64(){return this.readVarint(!0)}readSVarint(){const t=this.readVarint();return t%2==1?(t+1)/-2:t/2}readBoolean(){return!!this.readVarint()}readString(){const t=this.readVarint()+this.pos,r=this.pos;return this.pos=t,t-r>=12&&Fm?Fm.decode(this.buf.subarray(r,t)):(function(u,p,x){let b="",T=p;for(;T<x;){const M=u[T];let I,z,F,j=null,G=M>239?4:M>223?3:M>191?2:1;if(T+G>x)break;G===1?M<128&&(j=M):G===2?(I=u[T+1],(192&I)==128&&(j=(31&M)<<6|63&I,j<=127&&(j=null))):G===3?(I=u[T+1],z=u[T+2],(192&I)==128&&(192&z)==128&&(j=(15&M)<<12|(63&I)<<6|63&z,(j<=2047||j>=55296&&j<=57343)&&(j=null))):G===4&&(I=u[T+1],z=u[T+2],F=u[T+3],(192&I)==128&&(192&z)==128&&(192&F)==128&&(j=(15&M)<<18|(63&I)<<12|(63&z)<<6|63&F,(j<=65535||j>=1114112)&&(j=null))),j===null?(j=65533,G=1):j>65535&&(j-=65536,b+=String.fromCharCode(j>>>10&1023|55296),j=56320|1023&j),b+=String.fromCharCode(j),T+=G}return b})(this.buf,r,t)}readBytes(){const t=this.readVarint()+this.pos,r=this.buf.subarray(this.pos,t);return this.pos=t,r}readPackedVarint(t=[],r){const u=this.readPackedEnd();for(;this.pos<u;)t.push(this.readVarint(r));return t}readPackedSVarint(t=[]){const r=this.readPackedEnd();for(;this.pos<r;)t.push(this.readSVarint());return t}readPackedBoolean(t=[]){const r=this.readPackedEnd();for(;this.pos<r;)t.push(this.readBoolean());return t}readPackedFloat(t=[]){const r=this.readPackedEnd();for(;this.pos<r;)t.push(this.readFloat());return t}readPackedDouble(t=[]){const r=this.readPackedEnd();for(;this.pos<r;)t.push(this.readDouble());return t}readPackedFixed32(t=[]){const r=this.readPackedEnd();for(;this.pos<r;)t.push(this.readFixed32());return t}readPackedSFixed32(t=[]){const r=this.readPackedEnd();for(;this.pos<r;)t.push(this.readSFixed32());return t}readPackedFixed64(t=[]){const r=this.readPackedEnd();for(;this.pos<r;)t.push(this.readFixed64());return t}readPackedSFixed64(t=[]){const r=this.readPackedEnd();for(;this.pos<r;)t.push(this.readSFixed64());return t}readPackedEnd(){return this.type===2?this.readVarint()+this.pos:this.pos+1}skip(t){const r=7&t;if(r===0)for(;this.buf[this.pos++]>127;);else if(r===2)this.pos=this.readVarint()+this.pos;else if(r===5)this.pos+=4;else{if(r!==1)throw new Error(`Unimplemented type: ${r}`);this.pos+=8}}writeTag(t,r){this.writeVarint(t<<3|r)}realloc(t){let r=this.length||16;for(;r<this.pos+t;)r*=2;if(r!==this.length){const u=new Uint8Array(r);u.set(this.buf),this.buf=u,this.dataView=new DataView(u.buffer),this.length=r}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}writeSFixed32(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}writeFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,-1&t,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*Xa),!0),this.pos+=8}writeSFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,-1&t,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*Xa),!0),this.pos+=8}writeVarint(t){(t=+t||0)>268435455||t<0?(function(r,u){let p,x;if(r>=0?(p=r%4294967296|0,x=r/4294967296|0):(p=~(-r%4294967296),x=~(-r/4294967296),4294967295^p?p=p+1|0:(p=0,x=x+1|0)),r>=18446744073709552e3||r<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");u.realloc(10),(function(b,T,M){M.buf[M.pos++]=127&b|128,b>>>=7,M.buf[M.pos++]=127&b|128,b>>>=7,M.buf[M.pos++]=127&b|128,b>>>=7,M.buf[M.pos++]=127&b|128,M.buf[M.pos]=127&(b>>>=7)})(p,0,u),(function(b,T){const M=(7&b)<<4;T.buf[T.pos++]|=M|((b>>>=3)?128:0),b&&(T.buf[T.pos++]=127&b|((b>>>=7)?128:0),b&&(T.buf[T.pos++]=127&b|((b>>>=7)?128:0),b&&(T.buf[T.pos++]=127&b|((b>>>=7)?128:0),b&&(T.buf[T.pos++]=127&b|((b>>>=7)?128:0),b&&(T.buf[T.pos++]=127&b)))))})(x,u)})(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))}writeSVarint(t){this.writeVarint(t<0?2*-t-1:2*t)}writeBoolean(t){this.writeVarint(+t)}writeString(t){t=String(t),this.realloc(4*t.length),this.pos++;const r=this.pos;this.pos=(function(p,x,b){for(let T,M,I=0;I<x.length;I++){if(T=x.charCodeAt(I),T>55295&&T<57344){if(!M){T>56319||I+1===x.length?(p[b++]=239,p[b++]=191,p[b++]=189):M=T;continue}if(T<56320){p[b++]=239,p[b++]=191,p[b++]=189,M=T;continue}T=M-55296<<10|T-56320|65536,M=null}else M&&(p[b++]=239,p[b++]=191,p[b++]=189,M=null);T<128?p[b++]=T:(T<2048?p[b++]=T>>6|192:(T<65536?p[b++]=T>>12|224:(p[b++]=T>>18|240,p[b++]=T>>12&63|128),p[b++]=T>>6&63|128),p[b++]=63&T|128)}return b})(this.buf,t,this.pos);const u=this.pos-r;u>=128&&Nm(r,u,this),this.pos=r-1,this.writeVarint(u),this.pos+=u}writeFloat(t){this.realloc(4),this.dataView.setFloat32(this.pos,t,!0),this.pos+=4}writeDouble(t){this.realloc(8),this.dataView.setFloat64(this.pos,t,!0),this.pos+=8}writeBytes(t){const r=t.length;this.writeVarint(r),this.realloc(r);for(let u=0;u<r;u++)this.buf[this.pos++]=t[u]}writeRawMessage(t,r){this.pos++;const u=this.pos;t(r,this);const p=this.pos-u;p>=128&&Nm(u,p,this),this.pos=u-1,this.writeVarint(p),this.pos+=p}writeMessage(t,r,u){this.writeTag(t,2),this.writeRawMessage(r,u)}writePackedVarint(t,r){r.length&&this.writeMessage(t,i_,r)}writePackedSVarint(t,r){r.length&&this.writeMessage(t,Wc,r)}writePackedBoolean(t,r){r.length&&this.writeMessage(t,od,r)}writePackedFloat(t,r){r.length&&this.writeMessage(t,i1,r)}writePackedDouble(t,r){r.length&&this.writeMessage(t,Um,r)}writePackedFixed32(t,r){r.length&&this.writeMessage(t,B0,r)}writePackedSFixed32(t,r){r.length&&this.writeMessage(t,F0,r)}writePackedFixed64(t,r){r.length&&this.writeMessage(t,N0,r)}writePackedSFixed64(t,r){r.length&&this.writeMessage(t,U0,r)}writeBytesField(t,r){this.writeTag(t,2),this.writeBytes(r)}writeFixed32Field(t,r){this.writeTag(t,5),this.writeFixed32(r)}writeSFixed32Field(t,r){this.writeTag(t,5),this.writeSFixed32(r)}writeFixed64Field(t,r){this.writeTag(t,1),this.writeFixed64(r)}writeSFixed64Field(t,r){this.writeTag(t,1),this.writeSFixed64(r)}writeVarintField(t,r){this.writeTag(t,0),this.writeVarint(r)}writeSVarintField(t,r){this.writeTag(t,0),this.writeSVarint(r)}writeStringField(t,r){this.writeTag(t,2),this.writeString(r)}writeFloatField(t,r){this.writeTag(t,5),this.writeFloat(r)}writeDoubleField(t,r){this.writeTag(t,1),this.writeDouble(r)}writeBooleanField(t,r){this.writeVarintField(t,+r)}}function th(a,t,r){return r?4294967296*t+(a>>>0):4294967296*(t>>>0)+(a>>>0)}function Nm(a,t,r){const u=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(u);for(let p=r.pos-1;p>=a;p--)r.buf[p+u]=r.buf[p]}function i_(a,t){for(let r=0;r<a.length;r++)t.writeVarint(a[r])}function Wc(a,t){for(let r=0;r<a.length;r++)t.writeSVarint(a[r])}function i1(a,t){for(let r=0;r<a.length;r++)t.writeFloat(a[r])}function Um(a,t){for(let r=0;r<a.length;r++)t.writeDouble(a[r])}function od(a,t){for(let r=0;r<a.length;r++)t.writeBoolean(a[r])}function B0(a,t){for(let r=0;r<a.length;r++)t.writeFixed32(a[r])}function F0(a,t){for(let r=0;r<a.length;r++)t.writeSFixed32(a[r])}function N0(a,t){for(let r=0;r<a.length;r++)t.writeFixed64(a[r])}function U0(a,t){for(let r=0;r<a.length;r++)t.writeSFixed64(a[r])}function r1(a,t,r){a===1&&r.readMessage($m,t)}function $m(a,t,r){if(a===3){const{id:u,bitmap:p,width:x,height:b,left:T,top:M,advance:I}=r.readMessage(r_,{});t.push({id:u,bitmap:new Qh({width:x+6,height:b+6},p),metrics:{width:x,height:b,left:T,top:M,advance:I}})}}function r_(a,t,r){a===1?t.id=r.readVarint():a===2?t.bitmap=r.readBytes():a===3?t.width=r.readVarint():a===4?t.height=r.readVarint():a===5?t.left=r.readSVarint():a===6?t.top=r.readSVarint():a===7&&(t.advance=r.readVarint())}function $0(a){let t=0,r=0;for(const b of a)t+=b.w*b.h,r=Math.max(r,b.w);a.sort(((b,T)=>T.h-b.h));const u=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),r),h:1/0}];let p=0,x=0;for(const b of a)for(let T=u.length-1;T>=0;T--){const M=u[T];if(!(b.w>M.w||b.h>M.h)){if(b.x=M.x,b.y=M.y,x=Math.max(x,b.y+b.h),p=Math.max(p,b.x+b.w),b.w===M.w&&b.h===M.h){const I=u.pop();I&&T<u.length&&(u[T]=I)}else b.h===M.h?(M.x+=b.w,M.w-=b.w):b.w===M.w?(M.y+=b.h,M.h-=b.h):(u.push({x:M.x+b.w,y:M.y,w:M.w-b.w,h:b.h}),M.y+=b.h,M.h-=b.h);break}}return{w:p,h:x,fill:t/(p*x)||0}}class Vm{constructor(t,{pixelRatio:r,version:u,stretchX:p,stretchY:x,content:b,textFitWidth:T,textFitHeight:M}){this.paddedRect=t,this.pixelRatio=r,this.stretchX=p,this.stretchY=x,this.content=b,this.version=u,this.textFitWidth=T,this.textFitHeight=M}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 jm{constructor(t,r){const u={},p={};this.haveRenderCallbacks=[];const x=[];this.addImages(t,u,x),this.addImages(r,p,x);const{w:b,h:T}=$0(x),M=new Gr({width:b||1,height:T||1});for(const I in t){const z=t[I],F=u[I].paddedRect;Gr.copy(z.data,M,{x:0,y:0},{x:F.x+1,y:F.y+1},z.data)}for(const I in r){const z=r[I],F=p[I].paddedRect,j=F.x+1,G=F.y+1,H=z.data.width,J=z.data.height;Gr.copy(z.data,M,{x:0,y:0},{x:j,y:G},z.data),Gr.copy(z.data,M,{x:0,y:J-1},{x:j,y:G-1},{width:H,height:1}),Gr.copy(z.data,M,{x:0,y:0},{x:j,y:G+J},{width:H,height:1}),Gr.copy(z.data,M,{x:H-1,y:0},{x:j-1,y:G},{width:1,height:J}),Gr.copy(z.data,M,{x:0,y:0},{x:j+H,y:G},{width:1,height:J})}this.image=M,this.iconPositions=u,this.patternPositions=p}addImages(t,r,u){for(const p in t){const x=t[p],b={x:0,y:0,w:x.data.width+2,h:x.data.height+2};u.push(b),r[p]=new Vm(b,x),x.hasRenderCallback&&this.haveRenderCallbacks.push(p)}}patchUpdatedImages(t,r){t.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const u in t.updatedImages)this.patchUpdatedImage(this.iconPositions[u],t.getImage(u),r),this.patchUpdatedImage(this.patternPositions[u],t.getImage(u),r)}patchUpdatedImage(t,r,u){if(!t||!r||t.version===r.version)return;t.version=r.version;const[p,x]=t.tl;u.update(r.data,void 0,{x:p,y:x})}}var nc;Ct("ImagePosition",Vm),Ct("ImageAtlas",jm),C.ao=void 0,(nc=C.ao||(C.ao={}))[nc.none=0]="none",nc[nc.horizontal=1]="horizontal",nc[nc.vertical=2]="vertical",nc[nc.horizontalOnly=3]="horizontalOnly";class pl{constructor(){this.scale=1,this.fontStack="",this.imageName=null,this.verticalAlign="bottom"}static forText(t,r,u){const p=new pl;return p.scale=t||1,p.fontStack=r,p.verticalAlign=u||"bottom",p}static forImage(t,r){const u=new pl;return u.imageName=t,u.verticalAlign=r||"bottom",u}}class ic{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(t,r){const u=new ic;for(let p=0;p<t.sections.length;p++){const x=t.sections[p];x.image?u.addImageSection(x):u.addTextSection(x,r)}return u}length(){return this.text.length}getSection(t){return this.sections[this.sectionIndex[t]]}getSectionIndex(t){return this.sectionIndex[t]}getCharCode(t){return this.text.charCodeAt(t)}verticalizePunctuation(){this.text=(function(t){let r="";for(let u=0;u<t.length;u++){const p=t.charCodeAt(u+1)||null,x=t.charCodeAt(u-1)||null;r+=p&&Fu(p)&&!sd[t[u+1]]||x&&Fu(x)&&!sd[t[u-1]]||!sd[t[u]]?t[u]:sd[t[u]]}return r})(this.text)}trim(){let t=0;for(let u=0;u<this.text.length&&Uf[this.text.charCodeAt(u)];u++)t++;let r=this.text.length;for(let u=this.text.length-1;u>=0&&u>=t&&Uf[this.text.charCodeAt(u)];u--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)}substring(t,r){const u=new ic;return u.text=this.text.substring(t,r),u.sectionIndex=this.sectionIndex.slice(t,r),u.sections=this.sections,u}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((t,r)=>Math.max(t,this.sections[r].scale)),0)}getMaxImageSize(t){let r=0,u=0;for(let p=0;p<this.length();p++){const x=this.getSection(p);if(x.imageName){const b=t[x.imageName];if(!b)continue;const T=b.displaySize;r=Math.max(r,T[0]),u=Math.max(u,T[1])}}return{maxImageWidth:r,maxImageHeight:u}}addTextSection(t,r){this.text+=t.text,this.sections.push(pl.forText(t.scale,t.fontStack||r,t.verticalAlign));const u=this.sections.length-1;for(let p=0;p<t.text.length;++p)this.sectionIndex.push(u)}addImageSection(t){const r=t.image?t.image.name:"";if(r.length===0)return void si("Can't add FormattedSection with an empty image.");const u=this.getNextImageSectionCharCode();u?(this.text+=String.fromCharCode(u),this.sections.push(pl.forImage(r,t.verticalAlign)),this.sectionIndex.push(this.sections.length-1)):si("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Nf(a,t,r,u,p,x,b,T,M,I,z,F,j,G,H){const J=ic.fromFeature(a,p);let ne;F===C.ao.vertical&&J.verticalizePunctuation();const{processBidirectionalText:le,processStyledBidirectionalText:Ae}=Fs;if(le&&J.sections.length===1){ne=[];const Fe=le(J.toString(),Jn(J,I,x,t,u,G));for(const qe of Fe){const it=new ic;it.text=qe,it.sections=J.sections;for(let bt=0;bt<qe.length;bt++)it.sectionIndex.push(0);ne.push(it)}}else if(Ae){ne=[];const Fe=Ae(J.text,J.sectionIndex,Jn(J,I,x,t,u,G));for(const qe of Fe){const it=new ic;it.text=qe[0],it.sectionIndex=qe[1],it.sections=J.sections,ne.push(it)}}else ne=(function(Fe,qe){const it=[],bt=Fe.text;let mt=0;for(const _t of qe)it.push(Fe.substring(mt,_t)),mt=_t;return mt<bt.length&&it.push(Fe.substring(mt,bt.length)),it})(J,Jn(J,I,x,t,u,G));const pe=[],ve={positionedLines:pe,text:J.toString(),top:z[1],bottom:z[1],left:z[0],right:z[0],writingMode:F,iconsInText:!1,verticalizable:!1};return(function(Fe,qe,it,bt,mt,_t,kt,yt,vt,We,jt,Kt){let Vt=0,zt=0,fn=0,gi=0;const Ui=yt==="right"?1:yt==="left"?0:.5,Er=Oi/Kt;let La=0;for(const Gn of mt){Gn.trim();const ki=Gn.getMaxScale(),$i={positionedGlyphs:[],lineOffset:0};Fe.positionedLines[La]=$i;const Ei=$i.positionedGlyphs;let aa=0;if(!Gn.length()){zt+=_t,++La;continue}const Qa=a_(bt,Gn,Er);for(let Pa=0;Pa<Gn.length();Pa++){const Wi=Gn.getSection(Pa),Vi=Gn.getSectionIndex(Pa),or=Gn.getCharCode(Pa),Ki=s_(vt,jt,or);let ei;if(Wi.imageName){if(Fe.iconsInText=!0,Wi.scale=Wi.scale*Er,ei=l_(Wi,Ki,ki,Qa,bt),!ei)continue;aa=Math.max(aa,ei.imageOffset)}else if(ei=o_(Wi,or,Ki,Qa,qe,it),!ei)continue;const{rect:Wa,metrics:rh,baselineOffset:sa}=ei;Ei.push({glyph:or,imageName:Wi.imageName,x:Vt,y:zt+sa+-17,vertical:Ki,scale:Wi.scale,fontStack:Wi.fontStack,sectionIndex:Vi,metrics:rh,rect:Wa}),Ki?(Fe.verticalizable=!0,Vt+=(Wi.imageName?rh.advance:Oi)*Wi.scale+We):Vt+=rh.advance*Wi.scale+We}Ei.length!==0&&(fn=Math.max(Vt-We,fn),s1(Ei,0,Ei.length-1,Ui)),Vt=0,$i.lineOffset=Math.max(aa,(ki-1)*Oi);const Bi=_t*ki+aa;zt+=Bi,gi=Math.max(Bi,gi),++La}const{horizontalAlign:Qi,verticalAlign:Ti}=$f(kt);(function(Gn,ki,$i,Ei,aa,Qa,Bi,Pa,Wi){const Vi=(ki-$i)*aa;let or=0;or=Qa!==Bi?-Pa*Ei- -17:-Ei*Wi*Bi+.5*Bi;for(const Ki of Gn)for(const ei of Ki.positionedGlyphs)ei.x+=Vi,ei.y+=or})(Fe.positionedLines,Ui,Qi,Ti,fn,gi,_t,zt,mt.length),Fe.top+=-Ti*zt,Fe.bottom=Fe.top+zt,Fe.left+=-Qi*fn,Fe.right=Fe.left+fn})(ve,t,r,u,ne,b,T,M,F,I,j,H),!(function(Fe){for(const qe of Fe)if(qe.positionedGlyphs.length!==0)return!1;return!0})(pe)&&ve}const Uf={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},V0={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},j0={40:!0};function Zm(a,t,r,u,p,x){if(t.imageName){const b=u[t.imageName];return b?b.displaySize[0]*t.scale*Oi/x+p:0}{const b=r[t.fontStack],T=b&&b[a];return T?T.metrics.advance*t.scale+p:0}}function Gm(a,t,r,u){const p=Math.pow(a-t,2);return u?a<t?p/2:2*p:p+Math.abs(r)*r}function a1(a,t,r){let u=0;return a===10&&(u-=1e4),r&&(u+=150),a!==40&&a!==65288||(u+=50),t!==41&&t!==65289||(u+=50),u}function qm(a,t,r,u,p,x){let b=null,T=Gm(t,r,p,x);for(const M of u){const I=Gm(t-M.x,r,p,x)+M.badness;I<=T&&(b=M,T=I)}return{index:a,x:t,priorBreak:b,badness:T}}function Hm(a){return a?Hm(a.priorBreak).concat(a.index):[]}function Jn(a,t,r,u,p,x){if(!a)return[];const b=[],T=(function(F,j,G,H,J,ne){let le=0;for(let Ae=0;Ae<F.length();Ae++){const pe=F.getSection(Ae);le+=Zm(F.getCharCode(Ae),pe,H,J,j,ne)}return le/Math.max(1,Math.ceil(le/G))})(a,t,r,u,p,x),M=a.text.indexOf("​")>=0;let I=0;for(let F=0;F<a.length();F++){const j=a.getSection(F),G=a.getCharCode(F);if(Uf[G]||(I+=Zm(G,j,u,p,t,x)),F<a.length()-1){const H=!((z=G)<11904)&&(!!ln["CJK Compatibility Forms"](z)||!!ln["CJK Compatibility"](z)||!!ln["CJK Strokes"](z)||!!ln["CJK Symbols and Punctuation"](z)||!!ln["Enclosed CJK Letters and Months"](z)||!!ln["Halfwidth and Fullwidth Forms"](z)||!!ln["Ideographic Description Characters"](z)||!!ln["Vertical Forms"](z)||Bu.test(String.fromCodePoint(z)));(V0[G]||H||j.imageName||F!==a.length()-2&&j0[a.getCharCode(F+1)])&&b.push(qm(F+1,I,T,b,a1(G,a.getCharCode(F+1),H&&M),!1))}}var z;return Hm(qm(a.length(),I,T,b,0,!0))}function $f(a){let t=.5,r=.5;switch(a){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0}switch(a){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:t,verticalAlign:r}}function a_(a,t,r){const u=t.getMaxScale()*Oi,{maxImageWidth:p,maxImageHeight:x}=t.getMaxImageSize(a),b=Math.max(u,x*r);return{verticalLineContentWidth:Math.max(u,p*r),horizontalLineContentHeight:b}}function Xm(a){switch(a){case"top":return 0;case"center":return .5;default:return 1}}function s_(a,t,r){return!(a===C.ao.horizontal||!t&&!il(r)||t&&(Uf[r]||(u=r,new RegExp("\\p{sc=Arab}","u").test(String.fromCodePoint(u)))));var u}function o_(a,t,r,u,p,x){const b=x[a.fontStack],T=(function(I,z,F,j){if(I&&I.rect)return I;const G=z[F.fontStack],H=G&&G[j];return H?{rect:null,metrics:H.metrics}:null})(b&&b[t],p,a,t);if(T===null)return null;let M;if(r)M=u.verticalLineContentWidth-a.scale*Oi;else{const I=Xm(a.verticalAlign);M=(u.horizontalLineContentHeight-a.scale*Oi)*I}return{rect:T.rect,metrics:T.metrics,baselineOffset:M}}function l_(a,t,r,u,p){const x=p[a.imageName];if(!x)return null;const b=x.paddedRect,T=x.displaySize,M={width:T[0],height:T[1],left:1,top:-3,advance:t?T[1]:T[0]};let I;if(t)I=u.verticalLineContentWidth-T[1]*a.scale;else{const z=Xm(a.verticalAlign);I=(u.horizontalLineContentHeight-T[1]*a.scale)*z}return{rect:b,metrics:M,baselineOffset:I,imageOffset:(t?T[0]:T[1])*a.scale-Oi*r}}function s1(a,t,r,u){if(u===0)return;const p=a[r],x=(a[r].x+p.metrics.advance*p.scale)*u;for(let b=t;b<=r;b++)a[b].x-=x}function ld(a,t,r){const{horizontalAlign:u,verticalAlign:p}=$f(r),x=t[0]-a.displaySize[0]*u,b=t[1]-a.displaySize[1]*p;return{image:a,top:b,bottom:b+a.displaySize[1],left:x,right:x+a.displaySize[0]}}function o1(a){var t,r;let u=a.left,p=a.top,x=a.right-u,b=a.bottom-p;const T=(t=a.image.textFitWidth)!==null&&t!==void 0?t:"stretchOrShrink",M=(r=a.image.textFitHeight)!==null&&r!==void 0?r:"stretchOrShrink",I=(a.image.content[2]-a.image.content[0])/(a.image.content[3]-a.image.content[1]);if(M==="proportional"){if(T==="stretchOnly"&&x/b<I||T==="proportional"){const z=Math.ceil(b*I);u*=z/x,x=z}}else if(T==="proportional"&&M==="stretchOnly"&&I!==0&&x/b>I){const z=Math.ceil(x/I);p*=z/b,b=z}return{x1:u,y1:p,x2:u+x,y2:p+b}}function Vf(a,t,r,u,p,x){const b=a.image;let T;if(b.content){const ne=b.content,le=b.pixelRatio||1;T=[ne[0]/le,ne[1]/le,b.displaySize[0]-ne[2]/le,b.displaySize[1]-ne[3]/le]}const M=t.left*x,I=t.right*x;let z,F,j,G;r==="width"||r==="both"?(G=p[0]+M-u[3],F=p[0]+I+u[1]):(G=p[0]+(M+I-b.displaySize[0])/2,F=G+b.displaySize[0]);const H=t.top*x,J=t.bottom*x;return r==="height"||r==="both"?(z=p[1]+H-u[0],j=p[1]+J+u[2]):(z=p[1]+(H+J-b.displaySize[1])/2,j=z+b.displaySize[1]),{image:b,top:z,right:F,bottom:j,left:G,collisionPadding:T}}const vo=128,Aa=32640;function xo(a,t){const{expression:r}=t;if(r.kind==="constant")return{kind:"constant",layoutSize:r.evaluate(new Xn(a+1))};if(r.kind==="source")return{kind:"source"};{const{zoomStops:u,interpolationType:p}=r;let x=0;for(;x<u.length&&u[x]<=a;)x++;x=Math.max(0,x-1);let b=x;for(;b<u.length&&u[b]<a+1;)b++;b=Math.min(u.length-1,b);const T=u[x],M=u[b];return r.kind==="composite"?{kind:"composite",minZoom:T,maxZoom:M,interpolationType:p}:{kind:"camera",minZoom:T,maxZoom:M,minSize:r.evaluate(new Xn(T)),maxSize:r.evaluate(new Xn(M)),interpolationType:p}}}function nh(a,t,r){let u="never";const p=a.get(t);return p?u=p:a.get(r)&&(u="always"),u}const c_=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function jf(a,t,r,u,p,x,b,T,M,I,z,F,j){const G=T?Math.min(Aa,Math.round(T[0])):0,H=T?Math.min(Aa,Math.round(T[1])):0;a.emplaceBack(t,r,Math.round(32*u),Math.round(32*p),x,b,(G<<1)+(M?1:0),H,16*I,16*z,256*F,256*j)}function l1(a,t,r){a.emplaceBack(t.x,t.y,r),a.emplaceBack(t.x,t.y,r),a.emplaceBack(t.x,t.y,r),a.emplaceBack(t.x,t.y,r)}function Z0(a){for(const t of a.sections)if(co(t.text))return!0;return!1}class c1{constructor(t){this.layoutVertexArray=new dt,this.indexArray=new Nn,this.programConfigurations=t,this.segments=new yn,this.dynamicLayoutVertexArray=new tt,this.opacityVertexArray=new It,this.hasVisibleVertices=!1,this.placedSymbolArray=new q}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(t,r,u,p){this.isEmpty()||(u&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Tr.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,r),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,Qc.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,c_,!0),this.opacityVertexBuffer.itemSize=1),(u||p)&&this.programConfigurations.upload(t))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}Ct("SymbolBuffers",c1);class Ym{constructor(t,r,u){this.layoutVertexArray=new t,this.layoutAttributes=r,this.indexArray=new u,this.segments=new yn,this.collisionVertexArray=new Mn}upload(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,ad.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}Ct("CollisionBuffers",Ym);class Kc{constructor(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=zo(globalThis)?Math.min(t.overscaling,128):t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((b=>b.id)),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasDependencies=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[];const r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=xo(this.zoom,r["text-size"]),this.iconSizeData=xo(this.zoom,r["icon-size"]);const u=this.layers[0].layout,p=u.get("symbol-sort-key"),x=u.get("symbol-z-order");this.canOverlap=nh(u,"text-overlap","text-allow-overlap")!=="never"||nh(u,"icon-overlap","icon-allow-overlap")!=="never"||u.get("text-ignore-placement")||u.get("icon-ignore-placement"),this.sortFeaturesByKey=x!=="viewport-y"&&!p.isConstant(),this.sortFeaturesByY=(x==="viewport-y"||x==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,u.get("symbol-placement")==="point"&&(this.writingModes=u.get("text-writing-mode").map((b=>C.ao[b]))),this.stateDependentLayerIds=this.layers.filter((b=>b.isStateDependent())).map((b=>b.id)),this.sourceID=t.sourceID}createArrays(){this.text=new c1(new $s(this.layers,this.zoom,(t=>/^text/.test(t)))),this.icon=new c1(new $s(this.layers,this.zoom,(t=>/^icon/.test(t)))),this.glyphOffsetArray=new ae,this.lineVertexArray=new se,this.symbolInstances=new re,this.textAnchorOffsets=new de}calculateGlyphDependencies(t,r,u,p,x){for(let b=0;b<t.length;b++)if(r[t.charCodeAt(b)]=!0,(u||p)&&x){const T=sd[t.charAt(b)];T&&(r[T.charCodeAt(0)]=!0)}}populate(t,r,u){const p=this.layers[0],x=p.layout,b=x.get("text-font"),T=x.get("text-field"),M=x.get("icon-image"),I=(T.value.kind!=="constant"||T.value.value instanceof er&&!T.value.value.isEmpty()||T.value.value.toString().length>0)&&(b.value.kind!=="constant"||b.value.value.length>0),z=M.value.kind!=="constant"||!!M.value.value||Object.keys(M.parameters).length>0,F=x.get("symbol-sort-key");if(this.features=[],!I&&!z)return;const j=r.iconDependencies,G=r.glyphDependencies,H=r.availableImages,J=new Xn(this.zoom);for(const{feature:ne,id:le,index:Ae,sourceLayerIndex:pe}of t){const ve=p._featureFilter.needGeometry,Fe=ys(ne,ve);if(!p._featureFilter.filter(J,Fe,u))continue;let qe,it;if(ve||(Fe.geometry=Vc(ne)),I){const mt=p.getValueAndResolveTokens("text-field",Fe,u,H),_t=er.factory(mt),kt=this.hasRTLText=this.hasRTLText||Z0(_t);(!kt||Fs.getRTLTextPluginStatus()==="unavailable"||kt&&Fs.isParsed())&&(qe=Bm(_t,p,Fe))}if(z){const mt=p.getValueAndResolveTokens("icon-image",Fe,u,H);it=mt instanceof Ur?mt:Ur.fromString(mt)}if(!qe&&!it)continue;const bt=this.sortFeaturesByKey?F.evaluate(Fe,{},u):void 0;if(this.features.push({id:le,text:qe,icon:it,index:Ae,sourceLayerIndex:pe,geometry:Fe.geometry,properties:ne.properties,type:Yu.types[ne.type],sortKey:bt}),it&&(j[it.name]=!0),qe){const mt=b.evaluate(Fe,{},u).join(","),_t=x.get("text-rotation-alignment")!=="viewport"&&x.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(C.ao.vertical)>=0;for(const kt of qe.sections)if(kt.image)j[kt.image.name]=!0;else{const yt=Bs(qe.toString()),vt=kt.fontStack||mt,We=G[vt]=G[vt]||{};this.calculateGlyphDependencies(kt.text,We,_t,this.allowVerticalPlacement,yt)}}}x.get("symbol-placement")==="line"&&(this.features=(function(ne){const le={},Ae={},pe=[];let ve=0;function Fe(mt){pe.push(ne[mt]),ve++}function qe(mt,_t,kt){const yt=Ae[mt];return delete Ae[mt],Ae[_t]=yt,pe[yt].geometry[0].pop(),pe[yt].geometry[0]=pe[yt].geometry[0].concat(kt[0]),yt}function it(mt,_t,kt){const yt=le[_t];return delete le[_t],le[mt]=yt,pe[yt].geometry[0].shift(),pe[yt].geometry[0]=kt[0].concat(pe[yt].geometry[0]),yt}function bt(mt,_t,kt){const yt=kt?_t[0][_t[0].length-1]:_t[0][0];return`${mt}:${yt.x}:${yt.y}`}for(let mt=0;mt<ne.length;mt++){const _t=ne[mt],kt=_t.geometry,yt=_t.text?_t.text.toString():null;if(!yt){Fe(mt);continue}const vt=bt(yt,kt),We=bt(yt,kt,!0);if(vt in Ae&&We in le&&Ae[vt]!==le[We]){const jt=it(vt,We,kt),Kt=qe(vt,We,pe[jt].geometry);delete le[vt],delete Ae[We],Ae[bt(yt,pe[Kt].geometry,!0)]=Kt,pe[jt].geometry=null}else vt in Ae?qe(vt,We,kt):We in le?it(vt,We,kt):(Fe(mt),le[vt]=ve-1,Ae[We]=ve-1)}return pe.filter((mt=>mt.geometry))})(this.features)),this.sortFeaturesByKey&&this.features.sort(((ne,le)=>ne.sortKey-le.sortKey))}update(t,r,u){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,r,this.layers,{imagePositions:u}),this.icon.programConfigurations.updatePaintArrays(t,r,this.layers,{imagePositions:u}))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(t,r){const u=this.lineVertexArray.length;if(t.segment!==void 0){let p=t.dist(r[t.segment+1]),x=t.dist(r[t.segment]);const b={};for(let T=t.segment+1;T<r.length;T++)b[T]={x:r[T].x,y:r[T].y,tileUnitDistanceFromAnchor:p},T<r.length-1&&(p+=r[T+1].dist(r[T]));for(let T=t.segment||0;T>=0;T--)b[T]={x:r[T].x,y:r[T].y,tileUnitDistanceFromAnchor:x},T>0&&(x+=r[T-1].dist(r[T]));for(let T=0;T<r.length;T++){const M=b[T];this.lineVertexArray.emplaceBack(M.x,M.y,M.tileUnitDistanceFromAnchor)}}return{lineStartIndex:u,lineLength:this.lineVertexArray.length-u}}addSymbols(t,r,u,p,x,b,T,M,I,z,F,j){const G=t.indexArray,H=t.layoutVertexArray,J=t.segments.prepareSegment(4*r.length,H,G,this.canOverlap?b.sortKey:void 0),ne=this.glyphOffsetArray.length,le=J.vertexLength,Ae=this.allowVerticalPlacement&&T===C.ao.vertical?Math.PI/2:0,pe=b.text&&b.text.sections;for(let ve=0;ve<r.length;ve++){const{tl:Fe,tr:qe,bl:it,br:bt,tex:mt,pixelOffsetTL:_t,pixelOffsetBR:kt,minFontScaleX:yt,minFontScaleY:vt,glyphOffset:We,isSDF:jt,sectionIndex:Kt}=r[ve],Vt=J.vertexLength,zt=We[1];jf(H,M.x,M.y,Fe.x,zt+Fe.y,mt.x,mt.y,u,jt,_t.x,_t.y,yt,vt),jf(H,M.x,M.y,qe.x,zt+qe.y,mt.x+mt.w,mt.y,u,jt,kt.x,_t.y,yt,vt),jf(H,M.x,M.y,it.x,zt+it.y,mt.x,mt.y+mt.h,u,jt,_t.x,kt.y,yt,vt),jf(H,M.x,M.y,bt.x,zt+bt.y,mt.x+mt.w,mt.y+mt.h,u,jt,kt.x,kt.y,yt,vt),l1(t.dynamicLayoutVertexArray,M,Ae),G.emplaceBack(Vt,Vt+2,Vt+1),G.emplaceBack(Vt+1,Vt+2,Vt+3),J.vertexLength+=4,J.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(We[0]),ve!==r.length-1&&Kt===r[ve+1].sectionIndex||t.programConfigurations.populatePaintArrays(H.length,b,b.index,{imagePositions:{},canonical:j,formattedSection:pe&&pe[Kt]})}t.placedSymbolArray.emplaceBack(M.x,M.y,ne,this.glyphOffsetArray.length-ne,le,I,z,M.segment,u?u[0]:0,u?u[1]:0,p[0],p[1],T,0,!1,0,F)}_addCollisionDebugVertex(t,r,u,p,x,b){return r.emplaceBack(0,0),t.emplaceBack(u.x,u.y,p,x,Math.round(b.x),Math.round(b.y))}addCollisionDebugVertices(t,r,u,p,x,b,T){const M=x.segments.prepareSegment(4,x.layoutVertexArray,x.indexArray),I=M.vertexLength,z=x.layoutVertexArray,F=x.collisionVertexArray,j=T.anchorX,G=T.anchorY;this._addCollisionDebugVertex(z,F,b,j,G,new D(t,r)),this._addCollisionDebugVertex(z,F,b,j,G,new D(u,r)),this._addCollisionDebugVertex(z,F,b,j,G,new D(u,p)),this._addCollisionDebugVertex(z,F,b,j,G,new D(t,p)),M.vertexLength+=4;const H=x.indexArray;H.emplaceBack(I,I+1),H.emplaceBack(I+1,I+2),H.emplaceBack(I+2,I+3),H.emplaceBack(I+3,I),M.primitiveLength+=4}addDebugCollisionBoxes(t,r,u,p){for(let x=t;x<r;x++){const b=this.collisionBoxArray.get(x);this.addCollisionDebugVertices(b.x1,b.y1,b.x2,b.y2,p?this.textCollisionBox:this.iconCollisionBox,b.anchorPoint,u)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Ym(en,fl.members,Un),this.iconCollisionBox=new Ym(en,fl.members,Un);for(let t=0;t<this.symbolInstances.length;t++){const r=this.symbolInstances.get(t);this.addDebugCollisionBoxes(r.textBoxStartIndex,r.textBoxEndIndex,r,!0),this.addDebugCollisionBoxes(r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r,!0),this.addDebugCollisionBoxes(r.iconBoxStartIndex,r.iconBoxEndIndex,r,!1),this.addDebugCollisionBoxes(r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex,r,!1)}}_deserializeCollisionBoxesForSymbol(t,r,u,p,x,b,T,M,I){const z={};for(let F=r;F<u;F++){const j=t.get(F);z.textBox={x1:j.x1,y1:j.y1,x2:j.x2,y2:j.y2,anchorPointX:j.anchorPointX,anchorPointY:j.anchorPointY},z.textFeatureIndex=j.featureIndex;break}for(let F=p;F<x;F++){const j=t.get(F);z.verticalTextBox={x1:j.x1,y1:j.y1,x2:j.x2,y2:j.y2,anchorPointX:j.anchorPointX,anchorPointY:j.anchorPointY},z.verticalTextFeatureIndex=j.featureIndex;break}for(let F=b;F<T;F++){const j=t.get(F);z.iconBox={x1:j.x1,y1:j.y1,x2:j.x2,y2:j.y2,anchorPointX:j.anchorPointX,anchorPointY:j.anchorPointY},z.iconFeatureIndex=j.featureIndex;break}for(let F=M;F<I;F++){const j=t.get(F);z.verticalIconBox={x1:j.x1,y1:j.y1,x2:j.x2,y2:j.y2,anchorPointX:j.anchorPointX,anchorPointY:j.anchorPointY},z.verticalIconFeatureIndex=j.featureIndex;break}return z}deserializeCollisionBoxes(t){this.collisionArrays=[];for(let r=0;r<this.symbolInstances.length;r++){const u=this.symbolInstances.get(r);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,u.textBoxStartIndex,u.textBoxEndIndex,u.verticalTextBoxStartIndex,u.verticalTextBoxEndIndex,u.iconBoxStartIndex,u.iconBoxEndIndex,u.verticalIconBoxStartIndex,u.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(t,r){const u=t.placedSymbolArray.get(r),p=u.vertexStartIndex+4*u.numGlyphs;for(let x=u.vertexStartIndex;x<p;x+=4)t.indexArray.emplaceBack(x,x+2,x+1),t.indexArray.emplaceBack(x+1,x+2,x+3)}getSortedSymbolIndexes(t){if(this.sortedAngle===t&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;const r=Math.sin(t),u=Math.cos(t),p=[],x=[],b=[];for(let T=0;T<this.symbolInstances.length;++T){b.push(T);const M=this.symbolInstances.get(T);p.push(0|Math.round(r*M.anchorX+u*M.anchorY)),x.push(M.featureIndex)}return b.sort(((T,M)=>p[T]-p[M]||x[M]-x[T])),b}addToSortKeyRanges(t,r){const u=this.sortKeyRanges[this.sortKeyRanges.length-1];u&&u.sortKey===r?u.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:r,symbolInstanceStart:t,symbolInstanceEnd:t+1})}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const r of this.symbolInstanceIndexes){const u=this.symbolInstances.get(r);this.featureSortOrder.push(u.featureIndex),[u.rightJustifiedTextSymbolIndex,u.centerJustifiedTextSymbolIndex,u.leftJustifiedTextSymbolIndex].forEach(((p,x,b)=>{p>=0&&b.indexOf(p)===x&&this.addIndicesForPlacedSymbol(this.text,p)})),u.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,u.verticalPlacedTextSymbolIndex),u.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,u.placedIconSymbolIndex),u.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,u.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let Qm,Wm;Ct("SymbolBucket",Kc,{omit:["layers","collisionBoxArray","features","compareText"]}),Kc.MAX_GLYPHS=65535,Kc.addDynamicAttributes=l1;var Km={get paint(){return Wm=Wm||new ci({"icon-opacity":new $t(Ie.paint_symbol["icon-opacity"]),"icon-color":new $t(Ie.paint_symbol["icon-color"]),"icon-halo-color":new $t(Ie.paint_symbol["icon-halo-color"]),"icon-halo-width":new $t(Ie.paint_symbol["icon-halo-width"]),"icon-halo-blur":new $t(Ie.paint_symbol["icon-halo-blur"]),"icon-translate":new Mt(Ie.paint_symbol["icon-translate"]),"icon-translate-anchor":new Mt(Ie.paint_symbol["icon-translate-anchor"]),"text-opacity":new $t(Ie.paint_symbol["text-opacity"]),"text-color":new $t(Ie.paint_symbol["text-color"],{runtimeType:ha,getOverride:a=>a.textColor,hasOverride:a=>!!a.textColor}),"text-halo-color":new $t(Ie.paint_symbol["text-halo-color"]),"text-halo-width":new $t(Ie.paint_symbol["text-halo-width"]),"text-halo-blur":new $t(Ie.paint_symbol["text-halo-blur"]),"text-translate":new Mt(Ie.paint_symbol["text-translate"]),"text-translate-anchor":new Mt(Ie.paint_symbol["text-translate-anchor"])})},get layout(){return Qm=Qm||new ci({"symbol-placement":new Mt(Ie.layout_symbol["symbol-placement"]),"symbol-spacing":new Mt(Ie.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Mt(Ie.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new $t(Ie.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Mt(Ie.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Mt(Ie.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Mt(Ie.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Mt(Ie.layout_symbol["icon-ignore-placement"]),"icon-optional":new Mt(Ie.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Mt(Ie.layout_symbol["icon-rotation-alignment"]),"icon-size":new $t(Ie.layout_symbol["icon-size"]),"icon-text-fit":new Mt(Ie.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Mt(Ie.layout_symbol["icon-text-fit-padding"]),"icon-image":new $t(Ie.layout_symbol["icon-image"]),"icon-rotate":new $t(Ie.layout_symbol["icon-rotate"]),"icon-padding":new $t(Ie.layout_symbol["icon-padding"]),"icon-keep-upright":new Mt(Ie.layout_symbol["icon-keep-upright"]),"icon-offset":new $t(Ie.layout_symbol["icon-offset"]),"icon-anchor":new $t(Ie.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Mt(Ie.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Mt(Ie.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Mt(Ie.layout_symbol["text-rotation-alignment"]),"text-field":new $t(Ie.layout_symbol["text-field"]),"text-font":new $t(Ie.layout_symbol["text-font"]),"text-size":new $t(Ie.layout_symbol["text-size"]),"text-max-width":new $t(Ie.layout_symbol["text-max-width"]),"text-line-height":new Mt(Ie.layout_symbol["text-line-height"]),"text-letter-spacing":new $t(Ie.layout_symbol["text-letter-spacing"]),"text-justify":new $t(Ie.layout_symbol["text-justify"]),"text-radial-offset":new $t(Ie.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Mt(Ie.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new $t(Ie.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new $t(Ie.layout_symbol["text-anchor"]),"text-max-angle":new Mt(Ie.layout_symbol["text-max-angle"]),"text-writing-mode":new Mt(Ie.layout_symbol["text-writing-mode"]),"text-rotate":new $t(Ie.layout_symbol["text-rotate"]),"text-padding":new Mt(Ie.layout_symbol["text-padding"]),"text-keep-upright":new Mt(Ie.layout_symbol["text-keep-upright"]),"text-transform":new $t(Ie.layout_symbol["text-transform"]),"text-offset":new $t(Ie.layout_symbol["text-offset"]),"text-allow-overlap":new Mt(Ie.layout_symbol["text-allow-overlap"]),"text-overlap":new Mt(Ie.layout_symbol["text-overlap"]),"text-ignore-placement":new Mt(Ie.layout_symbol["text-ignore-placement"]),"text-optional":new Mt(Ie.layout_symbol["text-optional"])})}};class u1{constructor(t){if(t.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=t.property.overrides?t.property.overrides.runtimeType:An,this.defaultValue=t}evaluate(t){if(t.formattedSection){const r=this.defaultValue.property.overrides;if(r&&r.hasOverride(t.formattedSection))return r.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default}eachChild(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Ct("FormatSectionOverride",u1,{omit:["defaultValue"]});class cd extends yr{constructor(t,r){super(t,Km,r)}recalculate(t,r){if(super.recalculate(t,r),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"){const u=this.layout.get("text-writing-mode");if(u){const p=[];for(const x of u)p.indexOf(x)<0&&p.push(x);this.layout._values["text-writing-mode"]=p}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(t,r,u,p){const x=this.layout.get(t).evaluate(r,{},u,p),b=this._unevaluatedLayout._values[t];return b.isDataDriven()||Ic(b.value)||!x?x:(function(T,M){return M.replace(/{([^{}]+)}/g,((I,z)=>T&&z in T?String(T[z]):""))})(r.properties,x)}createBucket(t){return new Kc(t)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const t of Km.paint.overridableProperties){if(!cd.hasPaintOverride(this.layout,t))continue;const r=this.paint.get(t),u=new u1(r),p=new Vh(u,r.property.specification);let x=null;x=r.value.kind==="constant"||r.value.kind==="source"?new jr("source",p):new io("composite",p,r.value.zoomStops),this.paint._values[t]=new hs(r.property,x,r.parameters)}}_handleOverridablePaintPropertyUpdate(t,r,u){return!(!this.layout||r.isDataDriven()||u.isDataDriven())&&cd.hasPaintOverride(this.layout,t)}static hasPaintOverride(t,r){const u=t.get("text-field"),p=Km.paint.properties[r];let x=!1;const b=T=>{for(const M of T)if(p.overrides&&p.overrides.hasOverride(M))return void(x=!0)};if(u.value.kind==="constant"&&u.value.value instanceof er)b(u.value.value.sections);else if(u.value.kind==="source"||u.value.kind==="composite"){const T=I=>{x||(I instanceof Yt&&pi(I.value)===Ts?b(I.value.sections):I instanceof zh?b(I.sections):I.eachChild(T))},M=u.value;M._styleExpression&&T(M._styleExpression.expression)}return x}}let G0;var u_={get paint(){return G0=G0||new ci({"background-color":new Mt(Ie.paint_background["background-color"]),"background-pattern":new Gh(Ie.paint_background["background-pattern"]),"background-opacity":new Mt(Ie.paint_background["background-opacity"])})}};class Zf extends yr{constructor(t,r){super(t,u_,r)}}class h_ extends yr{constructor(t,r){super(t,{},r),this.onAdd=u=>{this.implementation.onAdd&&this.implementation.onAdd(u,u.painter.context.gl)},this.onRemove=u=>{this.implementation.onRemove&&this.implementation.onRemove(u,u.painter.context.gl)},this.implementation=t}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class q0{constructor(t){this._methodToThrottle=t,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((()=>{this._triggered=!1,this._methodToThrottle()}),0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}const Rn={once:!0},Gf=63710088e-1;class bo{constructor(t,r){if(isNaN(t)||isNaN(r))throw new Error(`Invalid LngLat object: (${t}, ${r})`);if(this.lng=+t,this.lat=+r,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new bo(Wt(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(t){const r=Math.PI/180,u=this.lat*r,p=t.lat*r,x=Math.sin(u)*Math.sin(p)+Math.cos(u)*Math.cos(p)*Math.cos((t.lng-this.lng)*r);return Gf*Math.acos(Math.min(x,1))}static convert(t){if(t instanceof bo)return t;if(Array.isArray(t)&&(t.length===2||t.length===3))return new bo(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&typeof t=="object"&&t!==null)return new bo(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}const h1=2*Math.PI*Gf;function Jm(a){return h1*Math.cos(a*Math.PI/180)}function d1(a){return(180+a)/360}function ud(a){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+a*Math.PI/360)))/360}function qf(a,t){return a/Jm(t)}function eg(a){return 360/Math.PI*Math.atan(Math.exp((180-360*a)*Math.PI/180))-90}function tg(a,t){return a*Jm(eg(t))}class Hf{constructor(t,r,u=0){this.x=+t,this.y=+r,this.z=+u}static fromLngLat(t,r=0){const u=bo.convert(t);return new Hf(d1(u.lng),ud(u.lat),qf(r,u.lat))}toLngLat(){return new bo(360*this.x-180,eg(this.y))}toAltitude(){return tg(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/h1*(t=eg(this.y),1/Math.cos(t*Math.PI/180));var t}}function H0(a,t,r){var u=2*Math.PI*6378137/256/Math.pow(2,r);return[a*u-2*Math.PI*6378137/2,t*u-2*Math.PI*6378137/2]}class f1{constructor(t,r,u){if(!(function(p,x,b){return!(p<0||p>25||b<0||b>=Math.pow(2,p)||x<0||x>=Math.pow(2,p))})(t,r,u))throw new Error(`x=${r}, y=${u}, z=${t} outside of bounds. 0<=x<${Math.pow(2,t)}, 0<=y<${Math.pow(2,t)} 0<=z<=25 `);this.z=t,this.x=r,this.y=u,this.key=Jc(0,t,t,r,u)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,r,u){const p=(b=this.y,T=this.z,M=H0(256*(x=this.x),256*(b=Math.pow(2,T)-b-1),T),I=H0(256*(x+1),256*(b+1),T),M[0]+","+M[1]+","+I[0]+","+I[1]);var x,b,T,M,I;const z=(function(F,j,G){let H,J="";for(let ne=F;ne>0;ne--)H=1<<ne-1,J+=(j&H?1:0)+(G&H?2:0);return J})(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(u==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,r>1?"@2x":"").replace(/{quadkey}/g,z).replace(/{bbox-epsg-3857}/g,p)}isChildOf(t){const r=this.z-t.z;return r>0&&t.x===this.x>>r&&t.y===this.y>>r}getTilePoint(t){const r=Math.pow(2,this.z);return new D((t.x*r-this.x)*St,(t.y*r-this.y)*St)}toString(){return`${this.z}/${this.x}/${this.y}`}}class ng{constructor(t,r){this.wrap=t,this.canonical=r,this.key=Jc(t,r.z,r.z,r.x,r.y)}}class Tn{constructor(t,r,u,p,x){if(this.terrainRttPosMatrix32f=null,t<u)throw new Error(`overscaledZ should be >= z; overscaledZ = ${t}; z = ${u}`);this.overscaledZ=t,this.wrap=r,this.canonical=new f1(u,+p,+x),this.key=Jc(r,t,u,p,x)}clone(){return new Tn(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)}scaledTo(t){if(t>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);const r=this.canonical.z-t;return t>this.canonical.z?new Tn(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Tn(t,this.wrap,t,this.canonical.x>>r,this.canonical.y>>r)}isOverscaled(){return this.overscaledZ>this.canonical.z}calculateScaledKey(t,r){if(t>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);const u=this.canonical.z-t;return t>this.canonical.z?Jc(this.wrap*+r,t,this.canonical.z,this.canonical.x,this.canonical.y):Jc(this.wrap*+r,t,t,this.canonical.x>>u,this.canonical.y>>u)}isChildOf(t){if(t.wrap!==this.wrap||this.overscaledZ-t.overscaledZ<=0)return!1;if(t.overscaledZ===0)return this.overscaledZ>0;const r=this.canonical.z-t.canonical.z;return!(r<0)&&t.canonical.x===this.canonical.x>>r&&t.canonical.y===this.canonical.y>>r}children(t){if(this.overscaledZ>=t)return[new Tn(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const r=this.canonical.z+1,u=2*this.canonical.x,p=2*this.canonical.y;return[new Tn(r,this.wrap,r,u,p),new Tn(r,this.wrap,r,u+1,p),new Tn(r,this.wrap,r,u,p+1),new Tn(r,this.wrap,r,u+1,p+1)]}isLessThan(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))}wrapped(){return new Tn(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(t){return new Tn(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new ng(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(t){return this.canonical.getTilePoint(new Hf(t.x-this.wrap,t.y))}}function Jc(a,t,r,u,p){(a*=2)<0&&(a=-1*a-1);const x=1<<r;return(x*x*a+x*p+u).toString(36)+r.toString(36)+t.toString(36)}function sr(a,t){return t?a.properties[t]:a.id}Ct("CanonicalTileID",f1),Ct("OverscaledTileID",Tn,{omit:["terrainRttPosMatrix32f"]});class ih{constructor(){this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0}extend(t){return this.minX=Math.min(this.minX,t.x),this.minY=Math.min(this.minY,t.y),this.maxX=Math.max(this.maxX,t.x),this.maxY=Math.max(this.maxY,t.y),this}expandBy(t){return this.minX-=t,this.minY-=t,this.maxX+=t,this.maxY+=t,(this.minX>this.maxX||this.minY>this.maxY)&&(this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0),this}shrinkBy(t){return this.expandBy(-t)}map(t){const r=new ih;return r.extend(t(new D(this.minX,this.minY))),r.extend(t(new D(this.maxX,this.minY))),r.extend(t(new D(this.minX,this.maxY))),r.extend(t(new D(this.maxX,this.maxY))),r}static fromPoints(t){const r=new ih;for(const u of t)r.extend(u);return r}contains(t){return t.x>=this.minX&&t.x<=this.maxX&&t.y>=this.minY&&t.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(t){return!this.empty()&&!t.empty()&&t.minX>=this.minX&&t.maxX<=this.maxX&&t.minY>=this.minY&&t.maxY<=this.maxY}intersects(t){return!this.empty()&&!t.empty()&&t.minX<=this.maxX&&t.maxX>=this.minX&&t.minY<=this.maxY&&t.maxY>=this.minY}}class ig{constructor(t){this._stringToNumber={},this._numberToString=[];for(let r=0;r<t.length;r++){const u=t[r];this._stringToNumber[u]=r,this._numberToString[r]=u}}encode(t){return this._stringToNumber[t]}decode(t){if(t>=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${t} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[t]}}class X0{constructor(t,r,u,p,x){this.type="Feature",this._vectorTileFeature=t,t._z=r,t._x=u,t._y=p,this.properties=t.properties,this.id=x}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(t){this._geometry=t}toJSON(){const t={geometry:this.geometry};for(const r in this)r!=="_geometry"&&r!=="_vectorTileFeature"&&(t[r]=this[r]);return t}}class p1{constructor(t,r){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new $l(St,16,0),this.grid3D=new $l(St,16,0),this.featureIndexArray=new _e,this.promoteId=r}insert(t,r,u,p,x,b){const T=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(u,p,x);const M=b?this.grid3D:this.grid;for(let I=0;I<r.length;I++){const z=r[I],F=[1/0,1/0,-1/0,-1/0];for(let j=0;j<z.length;j++){const G=z[j];F[0]=Math.min(F[0],G.x),F[1]=Math.min(F[1],G.y),F[2]=Math.max(F[2],G.x),F[3]=Math.max(F[3],G.y)}F[0]<St&&F[1]<St&&F[2]>=0&&F[3]>=0&&M.insert(T,F[0],F[1],F[2],F[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new zm(new ra(this.rawTileData)).layers,this.sourceLayerCoder=new ig(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(t,r,u,p){this.loadVTLayers();const x=t.params,b=St/t.tileSize/t.scale,T=Kr(x.filter,x.globalState),M=t.queryGeometry,I=t.queryPadding*b,z=ih.fromPoints(M),F=this.grid.query(z.minX-I,z.minY-I,z.maxX+I,z.maxY+I),j=ih.fromPoints(t.cameraQueryGeometry).expandBy(I),G=this.grid3D.query(j.minX,j.minY,j.maxX,j.maxY,((ne,le,Ae,pe)=>(function(ve,Fe,qe,it,bt){for(const _t of ve)if(Fe<=_t.x&&qe<=_t.y&&it>=_t.x&&bt>=_t.y)return!0;const mt=[new D(Fe,qe),new D(Fe,bt),new D(it,bt),new D(it,qe)];if(ve.length>2){for(const _t of mt)if(Gu(ve,_t))return!0}for(let _t=0;_t<ve.length-1;_t++)if(b0(ve[_t],ve[_t+1],mt))return!0;return!1})(t.cameraQueryGeometry,ne-I,le-I,Ae+I,pe+I)));for(const ne of G)F.push(ne);F.sort(g1);const H={};let J;for(let ne=0;ne<F.length;ne++){const le=F[ne];if(le===J)continue;J=le;const Ae=this.featureIndexArray.get(le);let pe=null;this.loadMatchingFeature(H,Ae.bucketIndex,Ae.sourceLayerIndex,Ae.featureIndex,T,x.layers,x.availableImages,r,u,p,((ve,Fe,qe)=>(pe||(pe=Vc(ve)),Fe.queryIntersectsFeature({queryGeometry:M,feature:ve,featureState:qe,geometry:pe,zoom:this.z,transform:t.transform,pixelsToTileUnits:b,pixelPosMatrix:t.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:t.getElevation}))))}return H}loadMatchingFeature(t,r,u,p,x,b,T,M,I,z,F){const j=this.bucketLayerIDs[r];if(b&&!j.some((ne=>b.has(ne))))return;const G=this.sourceLayerCoder.decode(u),H=this.vtLayers[G].feature(p);if(x.needGeometry){const ne=ys(H,!0);if(!x.filter(new Xn(this.tileID.overscaledZ),ne,this.tileID.canonical))return}else if(!x.filter(new Xn(this.tileID.overscaledZ),H))return;const J=this.getId(H,G);for(let ne=0;ne<j.length;ne++){const le=j[ne];if(b&&!b.has(le))continue;const Ae=M[le];if(!Ae)continue;let pe={};J&&z&&(pe=z.getState(Ae.sourceLayer||"_geojsonTileLayer",J));const ve=Ht({},I[le]);ve.paint=m1(ve.paint,Ae.paint,H,pe,T),ve.layout=m1(ve.layout,Ae.layout,H,pe,T);const Fe=!F||F(H,Ae,pe);if(!Fe)continue;const qe=new X0(H,this.z,this.x,this.y,J);qe.layer=ve;let it=t[le];it===void 0&&(it=t[le]=[]),it.push({featureIndex:p,feature:qe,intersectionZ:Fe})}}lookupSymbolFeatures(t,r,u,p,x,b,T,M){const I={};this.loadVTLayers();const z=Kr(x.filterSpec,x.globalState);for(const F of t)this.loadMatchingFeature(I,u,p,F,z,b,T,M,r);return I}hasLayer(t){for(const r of this.bucketLayerIDs)for(const u of r)if(t===u)return!0;return!1}getId(t,r){var u;let p=t.id;return this.promoteId&&(p=t.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[r]],typeof p=="boolean"&&(p=Number(p)),p===void 0&&(!((u=t.properties)===null||u===void 0)&&u.cluster)&&this.promoteId&&(p=Number(t.properties.cluster_id))),p}}function m1(a,t,r,u,p){return ka(a,((x,b)=>{const T=t instanceof Uu?t.get(b):null;return T&&T.evaluate?T.evaluate(r,u,p):T}))}function g1(a,t){return t-a}function rg(a,t,r,u,p){const x=[];for(let b=0;b<a.length;b++){const T=a[b];let M;for(let I=0;I<T.length-1;I++){let z=T[I],F=T[I+1];z.x<t&&F.x<t||(z.x<t?z=new D(t,z.y+(t-z.x)/(F.x-z.x)*(F.y-z.y))._round():F.x<t&&(F=new D(t,z.y+(t-z.x)/(F.x-z.x)*(F.y-z.y))._round()),z.y<r&&F.y<r||(z.y<r?z=new D(z.x+(r-z.y)/(F.y-z.y)*(F.x-z.x),r)._round():F.y<r&&(F=new D(z.x+(r-z.y)/(F.y-z.y)*(F.x-z.x),r)._round()),z.x>=u&&F.x>=u||(z.x>=u?z=new D(u,z.y+(u-z.x)/(F.x-z.x)*(F.y-z.y))._round():F.x>=u&&(F=new D(u,z.y+(u-z.x)/(F.x-z.x)*(F.y-z.y))._round()),z.y>=p&&F.y>=p||(z.y>=p?z=new D(z.x+(p-z.y)/(F.y-z.y)*(F.x-z.x),p)._round():F.y>=p&&(F=new D(z.x+(p-z.y)/(F.y-z.y)*(F.x-z.x),p)._round()),M&&z.equals(M[M.length-1])||(M=[z],x.push(M)),M.push(F)))))}}return x}Ct("FeatureIndex",p1,{omit:["rawTileData","sourceLayerCoder"]});class rc extends D{constructor(t,r,u,p){super(t,r),this.angle=u,p!==void 0&&(this.segment=p)}clone(){return new rc(this.x,this.y,this.angle,this.segment)}}function y1(a,t,r,u,p){if(t.segment===void 0||r===0)return!0;let x=t,b=t.segment+1,T=0;for(;T>-r/2;){if(b--,b<0)return!1;T-=a[b].dist(x),x=a[b]}T+=a[b].dist(a[b+1]),b++;const M=[];let I=0;for(;T<r/2;){const z=a[b],F=a[b+1];if(!F)return!1;let j=a[b-1].angleTo(z)-z.angleTo(F);for(j=Math.abs((j+3*Math.PI)%(2*Math.PI)-Math.PI),M.push({distance:T,angleDelta:j}),I+=j;T-M[0].distance>u;)I-=M.shift().angleDelta;if(I>p)return!1;b++,T+=z.dist(F)}return!0}function _1(a){let t=0;for(let r=0;r<a.length-1;r++)t+=a[r].dist(a[r+1]);return t}function Y0(a,t,r){return a?.6*t*r:0}function ag(a,t){return Math.max(a?a.right-a.left:0,t?t.right-t.left:0)}function d_(a,t,r,u,p,x){const b=Y0(r,p,x),T=ag(r,u)*x;let M=0;const I=_1(a)/2;for(let z=0;z<a.length-1;z++){const F=a[z],j=a[z+1],G=F.dist(j);if(M+G>I){const H=(I-M)/G,J=Ua.number(F.x,j.x,H),ne=Ua.number(F.y,j.y,H),le=new rc(J,ne,j.angleTo(F),z);return le._round(),!b||y1(a,le,T,b,t)?le:void 0}M+=G}}function Q0(a,t,r,u,p,x,b,T,M){const I=Y0(u,x,b),z=ag(u,p),F=z*b,j=a[0].x===0||a[0].x===M||a[0].y===0||a[0].y===M;return t-F<t/4&&(t=F+t/4),W0(a,j?t/2*T%t:(z/2+2*x)*b*T%t,t,I,r,F,j,!1,M)}function W0(a,t,r,u,p,x,b,T,M){const I=x/2,z=_1(a);let F=0,j=t-r,G=[];for(let H=0;H<a.length-1;H++){const J=a[H],ne=a[H+1],le=J.dist(ne),Ae=ne.angleTo(J);for(;j+r<F+le;){j+=r;const pe=(j-F)/le,ve=Ua.number(J.x,ne.x,pe),Fe=Ua.number(J.y,ne.y,pe);if(ve>=0&&ve<M&&Fe>=0&&Fe<M&&j-I>=0&&j+I<=z){const qe=new rc(ve,Fe,Ae,H);qe._round(),u&&!y1(a,qe,x,u,p)||G.push(qe)}}F+=le}return T||G.length||b||(G=W0(a,F/2,r,u,p,x,b,!0,M)),G}function K0(a,t,r,u){const p=[],x=a.image,b=x.pixelRatio,T=x.paddedRect.w-2,M=x.paddedRect.h-2;let I={x1:a.left,y1:a.top,x2:a.right,y2:a.bottom};const z=x.stretchX||[[0,T]],F=x.stretchY||[[0,M]],j=(We,jt)=>We+jt[1]-jt[0],G=z.reduce(j,0),H=F.reduce(j,0),J=T-G,ne=M-H;let le=0,Ae=G,pe=0,ve=H,Fe=0,qe=J,it=0,bt=ne;if(x.content&&u){const We=x.content,jt=We[2]-We[0],Kt=We[3]-We[1];(x.textFitWidth||x.textFitHeight)&&(I=o1(a)),le=wo(z,0,We[0]),pe=wo(F,0,We[1]),Ae=wo(z,We[0],We[2]),ve=wo(F,We[1],We[3]),Fe=We[0]-le,it=We[1]-pe,qe=jt-Ae,bt=Kt-ve}const mt=I.x1,_t=I.y1,kt=I.x2-mt,yt=I.y2-_t,vt=(We,jt,Kt,Vt)=>{const zt=Xf(We.stretch-le,Ae,kt,mt),fn=hd(We.fixed-Fe,qe,We.stretch,G),gi=Xf(jt.stretch-pe,ve,yt,_t),Ui=hd(jt.fixed-it,bt,jt.stretch,H),Er=Xf(Kt.stretch-le,Ae,kt,mt),La=hd(Kt.fixed-Fe,qe,Kt.stretch,G),Qi=Xf(Vt.stretch-pe,ve,yt,_t),Ti=hd(Vt.fixed-it,bt,Vt.stretch,H),Gn=new D(zt,gi),ki=new D(Er,gi),$i=new D(Er,Qi),Ei=new D(zt,Qi),aa=new D(fn/b,Ui/b),Qa=new D(La/b,Ti/b),Bi=t*Math.PI/180;if(Bi){const Vi=Math.sin(Bi),or=Math.cos(Bi),Ki=[or,-Vi,Vi,or];Gn._matMult(Ki),ki._matMult(Ki),Ei._matMult(Ki),$i._matMult(Ki)}const Pa=We.stretch+We.fixed,Wi=jt.stretch+jt.fixed;return{tl:Gn,tr:ki,bl:Ei,br:$i,tex:{x:x.paddedRect.x+1+Pa,y:x.paddedRect.y+1+Wi,w:Kt.stretch+Kt.fixed-Pa,h:Vt.stretch+Vt.fixed-Wi},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:aa,pixelOffsetBR:Qa,minFontScaleX:qe/b/kt,minFontScaleY:bt/b/yt,isSDF:r}};if(u&&(x.stretchX||x.stretchY)){const We=sg(z,J,G),jt=sg(F,ne,H);for(let Kt=0;Kt<We.length-1;Kt++){const Vt=We[Kt],zt=We[Kt+1];for(let fn=0;fn<jt.length-1;fn++)p.push(vt(Vt,jt[fn],zt,jt[fn+1]))}}else p.push(vt({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:T+1},{fixed:0,stretch:M+1}));return p}function wo(a,t,r){let u=0;for(const p of a)u+=Math.max(t,Math.min(r,p[1]))-Math.max(t,Math.min(r,p[0]));return u}function sg(a,t,r){const u=[{fixed:-1,stretch:0}];for(const[p,x]of a){const b=u[u.length-1];u.push({fixed:p-b.stretch,stretch:b.stretch}),u.push({fixed:p-b.stretch,stretch:b.stretch+(x-p)})}return u.push({fixed:t+1,stretch:r}),u}function Xf(a,t,r,u){return a/t*r+u}function hd(a,t,r,u){return a-t*r/u}Ct("Anchor",rc);class v1{constructor(t,r,u,p,x,b,T,M,I,z){var F;if(this.boxStartIndex=t.length,I){let j=b.top,G=b.bottom;const H=b.collisionPadding;H&&(j-=H[1],G+=H[3]);let J=G-j;J>0&&(J=Math.max(10,J),this.circleDiameter=J)}else{const j=!((F=b.image)===null||F===void 0)&&F.content&&(b.image.textFitWidth||b.image.textFitHeight)?o1(b):{x1:b.left,y1:b.top,x2:b.right,y2:b.bottom};j.y1=j.y1*T-M[0],j.y2=j.y2*T+M[2],j.x1=j.x1*T-M[3],j.x2=j.x2*T+M[1];const G=b.collisionPadding;if(G&&(j.x1-=G[0]*T,j.y1-=G[1]*T,j.x2+=G[2]*T,j.y2+=G[3]*T),z){const H=new D(j.x1,j.y1),J=new D(j.x2,j.y1),ne=new D(j.x1,j.y2),le=new D(j.x2,j.y2),Ae=z*Math.PI/180;H._rotate(Ae),J._rotate(Ae),ne._rotate(Ae),le._rotate(Ae),j.x1=Math.min(H.x,J.x,ne.x,le.x),j.x2=Math.max(H.x,J.x,ne.x,le.x),j.y1=Math.min(H.y,J.y,ne.y,le.y),j.y2=Math.max(H.y,J.y,ne.y,le.y)}t.emplaceBack(r.x,r.y,j.x1,j.y1,j.x2,j.y2,u,p,x)}this.boxEndIndex=t.length}}class f_{constructor(t=[],r=(u,p)=>u<p?-1:u>p?1:0){if(this.data=t,this.length=this.data.length,this.compare=r,this.length>0)for(let u=(this.length>>1)-1;u>=0;u--)this._down(u)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(this.length===0)return;const t=this.data[0],r=this.data.pop();return--this.length>0&&(this.data[0]=r,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:r,compare:u}=this,p=r[t];for(;t>0;){const x=t-1>>1,b=r[x];if(u(p,b)>=0)break;r[t]=b,t=x}r[t]=p}_down(t){const{data:r,compare:u}=this,p=this.length>>1,x=r[t];for(;t<p;){let b=1+(t<<1);const T=b+1;if(T<this.length&&u(r[T],r[b])<0&&(b=T),u(r[b],x)>=0)break;r[t]=r[b],t=b}r[t]=x}}function J0(a,t=1,r=!1){const u=ih.fromPoints(a[0]),p=Math.min(u.width(),u.height());let x=p/2;const b=new f_([],og),{minX:T,minY:M,maxX:I,maxY:z}=u;if(p===0)return new D(T,M);for(let G=T;G<I;G+=p)for(let H=M;H<z;H+=p)b.push(new eu(G+x,H+x,x,a));let F=(function(G){let H=0,J=0,ne=0;const le=G[0];for(let Ae=0,pe=le.length,ve=pe-1;Ae<pe;ve=Ae++){const Fe=le[Ae],qe=le[ve],it=Fe.x*qe.y-qe.x*Fe.y;J+=(Fe.x+qe.x)*it,ne+=(Fe.y+qe.y)*it,H+=3*it}return new eu(J/H,ne/H,0,G)})(a),j=b.length;for(;b.length;){const G=b.pop();(G.d>F.d||!F.d)&&(F=G,r&&console.log("found best %d after %d probes",Math.round(1e4*G.d)/1e4,j)),G.max-F.d<=t||(x=G.h/2,b.push(new eu(G.p.x-x,G.p.y-x,x,a)),b.push(new eu(G.p.x+x,G.p.y-x,x,a)),b.push(new eu(G.p.x-x,G.p.y+x,x,a)),b.push(new eu(G.p.x+x,G.p.y+x,x,a)),j+=4)}return r&&(console.log(`num probes: ${j}`),console.log(`best distance: ${F.d}`)),F.p}function og(a,t){return t.max-a.max}function eu(a,t,r,u){this.p=new D(a,t),this.h=r,this.d=(function(p,x){let b=!1,T=1/0;for(let M=0;M<x.length;M++){const I=x[M];for(let z=0,F=I.length,j=F-1;z<F;j=z++){const G=I[z],H=I[j];G.y>p.y!=H.y>p.y&&p.x<(H.x-G.x)*(p.y-G.y)/(H.y-G.y)+G.x&&(b=!b),T=Math.min(T,rr(p,G,H))}}return(b?1:-1)*Math.sqrt(T)})(this.p,u),this.max=this.d+this.h*Math.SQRT2}var Or;C.aE=void 0,(Or=C.aE||(C.aE={}))[Or.center=1]="center",Or[Or.left=2]="left",Or[Or.right=3]="right",Or[Or.top=4]="top",Or[Or.bottom=5]="bottom",Or[Or["top-left"]=6]="top-left",Or[Or["top-right"]=7]="top-right",Or[Or["bottom-left"]=8]="bottom-left",Or[Or["bottom-right"]=9]="bottom-right";const Ya=Number.POSITIVE_INFINITY;function x1(a,t){return t[1]!==Ya?(function(r,u,p){let x=0,b=0;switch(u=Math.abs(u),p=Math.abs(p),r){case"top-right":case"top-left":case"top":b=p-7;break;case"bottom-right":case"bottom-left":case"bottom":b=7-p}switch(r){case"top-right":case"bottom-right":case"right":x=-u;break;case"top-left":case"bottom-left":case"left":x=u}return[x,b]})(a,t[0],t[1]):(function(r,u){let p=0,x=0;u<0&&(u=0);const b=u/Math.SQRT2;switch(r){case"top-right":case"top-left":x=b-7;break;case"bottom-right":case"bottom-left":x=7-b;break;case"bottom":x=7-u;break;case"top":x=u-7}switch(r){case"top-right":case"bottom-right":p=-b;break;case"top-left":case"bottom-left":p=b;break;case"left":p=u;break;case"right":p=-u}return[p,x]})(a,t[0])}function lg(a,t,r){var u;const p=a.layout,x=(u=p.get("text-variable-anchor-offset"))===null||u===void 0?void 0:u.evaluate(t,{},r);if(x){const T=x.values,M=[];for(let I=0;I<T.length;I+=2){const z=M[I]=T[I],F=T[I+1].map((j=>j*Oi));z.startsWith("top")?F[1]-=7:z.startsWith("bottom")&&(F[1]+=7),M[I+1]=F}return new Li(M)}const b=p.get("text-variable-anchor");if(b){let T;T=a._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[p.get("text-radial-offset").evaluate(t,{},r)*Oi,Ya]:p.get("text-offset").evaluate(t,{},r).map((I=>I*Oi));const M=[];for(const I of b)M.push(I,x1(I,T));return new Li(M)}return null}function b1(a){switch(a){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function e2(a,t,r,u,p,x,b,T,M,I,z,F){let j=x.textMaxSize.evaluate(t,{});j===void 0&&(j=b);const G=a.layers[0].layout,H=G.get("icon-offset").evaluate(t,{},z),J=xs(r.horizontal),ne=b/24,le=a.tilePixelRatio*ne,Ae=a.tilePixelRatio*j/24,pe=a.tilePixelRatio*T,ve=a.tilePixelRatio*G.get("symbol-spacing"),Fe=G.get("text-padding")*a.tilePixelRatio,qe=(function(Kt,Vt,zt,fn=1){const gi=Kt.get("icon-padding").evaluate(Vt,{},zt),Ui=gi&&gi.values;return[Ui[0]*fn,Ui[1]*fn,Ui[2]*fn,Ui[3]*fn]})(G,t,z,a.tilePixelRatio),it=G.get("text-max-angle")/180*Math.PI,bt=G.get("text-rotation-alignment")!=="viewport"&&G.get("symbol-placement")!=="point",mt=G.get("icon-rotation-alignment")==="map"&&G.get("symbol-placement")!=="point",_t=G.get("symbol-placement"),kt=ve/2,yt=G.get("icon-text-fit");let vt;u&&yt!=="none"&&(a.allowVerticalPlacement&&r.vertical&&(vt=Vf(u,r.vertical,yt,G.get("icon-text-fit-padding"),H,ne)),J&&(u=Vf(u,J,yt,G.get("icon-text-fit-padding"),H,ne)));const We=z?F.line.getGranularityForZoomLevel(z.z):1,jt=(Kt,Vt)=>{Vt.x<0||Vt.x>=St||Vt.y<0||Vt.y>=St||(function(zt,fn,gi,Ui,Er,La,Qi,Ti,Gn,ki,$i,Ei,aa,Qa,Bi,Pa,Wi,Vi,or,Ki,ei,Wa,rh,sa,a2){const tu=zt.addToLineVertexArray(fn,gi);let gl,ah,fd,ac,i=0,o=0,f=0,v=0,A=-1,R=-1;const V={};let ee=Xl("");if(zt.allowVerticalPlacement&&Ui.vertical){const Et=Ti.layout.get("text-rotate").evaluate(ei,{},sa)+90;fd=new v1(Gn,fn,ki,$i,Ei,Ui.vertical,aa,Qa,Bi,Et),Qi&&(ac=new v1(Gn,fn,ki,$i,Ei,Qi,Wi,Vi,Bi,Et))}if(Er){const Et=Ti.layout.get("icon-rotate").evaluate(ei,{}),Jt=Ti.layout.get("icon-text-fit")!=="none",_n=K0(Er,Et,rh,Jt),vn=Qi?K0(Qi,Et,rh,Jt):void 0;ah=new v1(Gn,fn,ki,$i,Ei,Er,Wi,Vi,!1,Et),i=4*_n.length;const Ka=zt.iconSizeData;let yl=null;Ka.kind==="source"?(yl=[vo*Ti.layout.get("icon-size").evaluate(ei,{})],yl[0]>Aa&&si(`${zt.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):Ka.kind==="composite"&&(yl=[vo*Wa.compositeIconSizes[0].evaluate(ei,{},sa),vo*Wa.compositeIconSizes[1].evaluate(ei,{},sa)],(yl[0]>Aa||yl[1]>Aa)&&si(`${zt.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),zt.addSymbols(zt.icon,_n,yl,Ki,or,ei,C.ao.none,fn,tu.lineStartIndex,tu.lineLength,-1,sa),A=zt.icon.placedSymbolArray.length-1,vn&&(o=4*vn.length,zt.addSymbols(zt.icon,vn,yl,Ki,or,ei,C.ao.vertical,fn,tu.lineStartIndex,tu.lineLength,-1,sa),R=zt.icon.placedSymbolArray.length-1)}const xe=Object.keys(Ui.horizontal);for(const Et of xe){const Jt=Ui.horizontal[Et];if(!gl){ee=Xl(Jt.text);const vn=Ti.layout.get("text-rotate").evaluate(ei,{},sa);gl=new v1(Gn,fn,ki,$i,Ei,Jt,aa,Qa,Bi,vn)}const _n=Jt.positionedLines.length===1;if(f+=dd(zt,fn,Jt,La,Ti,Bi,ei,Pa,tu,Ui.vertical?C.ao.horizontal:C.ao.horizontalOnly,_n?xe:[Et],V,A,Wa,sa),_n)break}Ui.vertical&&(v+=dd(zt,fn,Ui.vertical,La,Ti,Bi,ei,Pa,tu,C.ao.vertical,["vertical"],V,R,Wa,sa));const Ge=gl?gl.boxStartIndex:zt.collisionBoxArray.length,Ke=gl?gl.boxEndIndex:zt.collisionBoxArray.length,at=fd?fd.boxStartIndex:zt.collisionBoxArray.length,He=fd?fd.boxEndIndex:zt.collisionBoxArray.length,Ye=ah?ah.boxStartIndex:zt.collisionBoxArray.length,Nt=ah?ah.boxEndIndex:zt.collisionBoxArray.length,nn=ac?ac.boxStartIndex:zt.collisionBoxArray.length,yi=ac?ac.boxEndIndex:zt.collisionBoxArray.length;let ze=-1;const Me=(Et,Jt)=>Et&&Et.circleDiameter?Math.max(Et.circleDiameter,Jt):Jt;ze=Me(gl,ze),ze=Me(fd,ze),ze=Me(ah,ze),ze=Me(ac,ze);const Ze=ze>-1?1:0;Ze&&(ze*=a2/Oi),zt.glyphOffsetArray.length>=Kc.MAX_GLYPHS&&si("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),ei.sortKey!==void 0&&zt.addToSortKeyRanges(zt.symbolInstances.length,ei.sortKey);const nt=lg(Ti,ei,sa),[Xt,Qn]=(function(Et,Jt){const _n=Et.length,vn=Jt==null?void 0:Jt.values;if((vn==null?void 0:vn.length)>0)for(let Ka=0;Ka<vn.length;Ka+=2){const yl=vn[Ka+1];Et.emplaceBack(C.aE[vn[Ka]],yl[0],yl[1])}return[_n,Et.length]})(zt.textAnchorOffsets,nt);zt.symbolInstances.emplaceBack(fn.x,fn.y,V.right>=0?V.right:-1,V.center>=0?V.center:-1,V.left>=0?V.left:-1,V.vertical||-1,A,R,ee,Ge,Ke,at,He,Ye,Nt,nn,yi,ki,f,v,i,o,Ze,0,aa,ze,Xt,Qn)})(a,Vt,Kt,r,u,p,vt,a.layers[0],a.collisionBoxArray,t.index,t.sourceLayerIndex,a.index,le,[Fe,Fe,Fe,Fe],bt,M,pe,qe,mt,H,t,x,I,z,b)};if(_t==="line")for(const Kt of rg(t.geometry,0,0,St,St)){const Vt=qc(Kt,We),zt=Q0(Vt,ve,it,r.vertical||J,u,24,Ae,a.overscaling,St);for(const fn of zt)J&&t2(a,J.text,kt,fn)||jt(Vt,fn)}else if(_t==="line-center"){for(const Kt of t.geometry)if(Kt.length>1){const Vt=qc(Kt,We),zt=d_(Vt,it,r.vertical||J,u,24,Ae);zt&&jt(Vt,zt)}}else if(t.type==="Polygon")for(const Kt of bu(t.geometry,0)){const Vt=J0(Kt,16);jt(qc(Kt[0],We,!0),new rc(Vt.x,Vt.y,0))}else if(t.type==="LineString")for(const Kt of t.geometry){const Vt=qc(Kt,We);jt(Vt,new rc(Vt[0].x,Vt[0].y,0))}else if(t.type==="Point")for(const Kt of t.geometry)for(const Vt of Kt)jt([Vt],new rc(Vt.x,Vt.y,0))}function dd(a,t,r,u,p,x,b,T,M,I,z,F,j,G,H){const J=(function(Ae,pe,ve,Fe,qe,it,bt,mt){const _t=Fe.layout.get("text-rotate").evaluate(it,{})*Math.PI/180,kt=[];for(const yt of pe.positionedLines)for(const vt of yt.positionedGlyphs){if(!vt.rect)continue;const We=vt.rect||{};let jt=4,Kt=!0,Vt=1,zt=0;const fn=(qe||mt)&&vt.vertical,gi=vt.metrics.advance*vt.scale/2;if(mt&&pe.verticalizable&&(zt=yt.lineOffset/2-(vt.imageName?-(Oi-vt.metrics.width*vt.scale)/2:(vt.scale-1)*Oi)),vt.imageName){const Vi=bt[vt.imageName];Kt=Vi.sdf,Vt=Vi.pixelRatio,jt=1/Vt}const Ui=qe?[vt.x+gi,vt.y]:[0,0];let Er=qe?[0,0]:[vt.x+gi+ve[0],vt.y+ve[1]-zt],La=[0,0];fn&&(La=Er,Er=[0,0]);const Qi=vt.metrics.isDoubleResolution?2:1,Ti=(vt.metrics.left-jt)*vt.scale-gi+Er[0],Gn=(-vt.metrics.top-jt)*vt.scale+Er[1],ki=Ti+We.w/Qi*vt.scale/Vt,$i=Gn+We.h/Qi*vt.scale/Vt,Ei=new D(Ti,Gn),aa=new D(ki,Gn),Qa=new D(Ti,$i),Bi=new D(ki,$i);if(fn){const Vi=new D(-gi,gi- -17),or=-Math.PI/2,Ki=12-gi,ei=new D(22-Ki,-(vt.imageName?Ki:0)),Wa=new D(...La);Ei._rotateAround(or,Vi)._add(ei)._add(Wa),aa._rotateAround(or,Vi)._add(ei)._add(Wa),Qa._rotateAround(or,Vi)._add(ei)._add(Wa),Bi._rotateAround(or,Vi)._add(ei)._add(Wa)}if(_t){const Vi=Math.sin(_t),or=Math.cos(_t),Ki=[or,-Vi,Vi,or];Ei._matMult(Ki),aa._matMult(Ki),Qa._matMult(Ki),Bi._matMult(Ki)}const Pa=new D(0,0),Wi=new D(0,0);kt.push({tl:Ei,tr:aa,bl:Qa,br:Bi,tex:We,writingMode:pe.writingMode,glyphOffset:Ui,sectionIndex:vt.sectionIndex,isSDF:Kt,pixelOffsetTL:Pa,pixelOffsetBR:Wi,minFontScaleX:0,minFontScaleY:0})}return kt})(0,r,T,p,x,b,u,a.allowVerticalPlacement),ne=a.textSizeData;let le=null;ne.kind==="source"?(le=[vo*p.layout.get("text-size").evaluate(b,{})],le[0]>Aa&&si(`${a.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):ne.kind==="composite"&&(le=[vo*G.compositeTextSizes[0].evaluate(b,{},H),vo*G.compositeTextSizes[1].evaluate(b,{},H)],(le[0]>Aa||le[1]>Aa)&&si(`${a.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),a.addSymbols(a.text,J,le,T,x,b,I,t,M.lineStartIndex,M.lineLength,j,H);for(const Ae of z)F[Ae]=a.text.placedSymbolArray.length-1;return 4*J.length}function xs(a){for(const t in a)return a[t];return null}function t2(a,t,r,u){const p=a.compareText;if(t in p){const x=p[t];for(let b=x.length-1;b>=0;b--)if(u.dist(x[b])<r)return!0}else p[t]=[];return p[t].push(u),!1}const Yf=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class So{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[r,u]=new Uint8Array(t,0,2);if(r!==219)throw new Error("Data does not appear to be in a KDBush format.");const p=u>>4;if(p!==1)throw new Error(`Got v${p} data when expected v1.`);const x=Yf[15&u];if(!x)throw new Error("Unrecognized array type.");const[b]=new Uint16Array(t,2,1),[T]=new Uint32Array(t,4,1);return new So(T,b,x,t)}constructor(t,r=64,u=Float64Array,p){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=u,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const x=Yf.indexOf(this.ArrayType),b=2*t*this.ArrayType.BYTES_PER_ELEMENT,T=t*this.IndexArrayType.BYTES_PER_ELEMENT,M=(8-T%8)%8;if(x<0)throw new Error(`Unexpected typed array class: ${u}.`);p&&p instanceof ArrayBuffer?(this.data=p,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+T+M,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+b+T+M),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+T+M,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+x]),new Uint16Array(this.data,2,1)[0]=r,new Uint32Array(this.data,4,1)[0]=t)}add(t,r){const u=this._pos>>1;return this.ids[u]=u,this.coords[this._pos++]=t,this.coords[this._pos++]=r,u}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return cg(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,r,u,p){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:x,coords:b,nodeSize:T}=this,M=[0,x.length-1,0],I=[];for(;M.length;){const z=M.pop()||0,F=M.pop()||0,j=M.pop()||0;if(F-j<=T){for(let ne=j;ne<=F;ne++){const le=b[2*ne],Ae=b[2*ne+1];le>=t&&le<=u&&Ae>=r&&Ae<=p&&I.push(x[ne])}continue}const G=j+F>>1,H=b[2*G],J=b[2*G+1];H>=t&&H<=u&&J>=r&&J<=p&&I.push(x[G]),(z===0?t<=H:r<=J)&&(M.push(j),M.push(G-1),M.push(1-z)),(z===0?u>=H:p>=J)&&(M.push(G+1),M.push(F),M.push(1-z))}return I}within(t,r,u){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:p,coords:x,nodeSize:b}=this,T=[0,p.length-1,0],M=[],I=u*u;for(;T.length;){const z=T.pop()||0,F=T.pop()||0,j=T.pop()||0;if(F-j<=b){for(let ne=j;ne<=F;ne++)i2(x[2*ne],x[2*ne+1],t,r)<=I&&M.push(p[ne]);continue}const G=j+F>>1,H=x[2*G],J=x[2*G+1];i2(H,J,t,r)<=I&&M.push(p[G]),(z===0?t-u<=H:r-u<=J)&&(T.push(j),T.push(G-1),T.push(1-z)),(z===0?t+u>=H:r+u>=J)&&(T.push(G+1),T.push(F),T.push(1-z))}return M}}function cg(a,t,r,u,p,x){if(p-u<=r)return;const b=u+p>>1;n2(a,t,b,u,p,x),cg(a,t,r,u,b-1,1-x),cg(a,t,r,b+1,p,1-x)}function n2(a,t,r,u,p,x){for(;p>u;){if(p-u>600){const I=p-u+1,z=r-u+1,F=Math.log(I),j=.5*Math.exp(2*F/3),G=.5*Math.sqrt(F*j*(I-j)/I)*(z-I/2<0?-1:1);n2(a,t,r,Math.max(u,Math.floor(r-z*j/I+G)),Math.min(p,Math.floor(r+(I-z)*j/I+G)),x)}const b=t[2*r+x];let T=u,M=p;for(ml(a,t,u,r),t[2*p+x]>b&&ml(a,t,u,p);T<M;){for(ml(a,t,T,M),T++,M--;t[2*T+x]<b;)T++;for(;t[2*M+x]>b;)M--}t[2*u+x]===b?ml(a,t,u,M):(M++,ml(a,t,M,p)),M<=r&&(u=M+1),r<=M&&(p=M-1)}}function ml(a,t,r,u){w1(a,r,u),w1(t,2*r,2*u),w1(t,2*r+1,2*u+1)}function w1(a,t,r){const u=a[t];a[t]=a[r],a[r]=u}function i2(a,t,r,u){const p=a-r,x=t-u;return p*p+x*x}var ug;C.cx=void 0,(ug=C.cx||(C.cx={})).create="create",ug.load="load",ug.fullLoad="fullLoad";let S1=null,Qf=[];const hg=1e3/60,dg="loadTime",fg="fullLoadTime",r2={mark(a){performance.mark(a)},frame(a){const t=a;S1!=null&&Qf.push(t-S1),S1=t},clearMetrics(){S1=null,Qf=[],performance.clearMeasures(dg),performance.clearMeasures(fg);for(const a in C.cx)performance.clearMarks(C.cx[a])},getPerformanceMetrics(){performance.measure(dg,C.cx.create,C.cx.load),performance.measure(fg,C.cx.create,C.cx.fullLoad);const a=performance.getEntriesByName(dg)[0].duration,t=performance.getEntriesByName(fg)[0].duration,r=Qf.length,u=1/(Qf.reduce(((x,b)=>x+b),0)/r/1e3),p=Qf.filter((x=>x>hg)).reduce(((x,b)=>x+(b-hg)/hg),0);return{loadTime:a,fullLoadTime:t,fps:u,percentDroppedFrames:p/(r+p)*100,totalFrames:r}}};C.$=St,C.A=Pe,C.B=function([a,t,r]){return t+=90,t*=Math.PI/180,r*=Math.PI/180,{x:a*Math.cos(t)*Math.sin(r),y:a*Math.sin(t)*Math.sin(r),z:a*Math.cos(r)}},C.C=Ua,C.D=Mt,C.E=Ut,C.F=Xn,C.G=Zh,C.H=zo,C.I=Vm,C.J=class{constructor(a,t){this.target=a,this.mapId=t,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new q0((()=>this.process())),this.subscription=Ji(this.target,"message",(r=>this.receive(r)),!1),this.globalScope=Ba(self)?a:window}registerMessageHandler(a,t){this.messageHandlers[a]=t}sendAsync(a,t){return new Promise(((r,u)=>{const p=Math.round(1e18*Math.random()).toString(36).substring(0,10),x=t?Ji(t.signal,"abort",(()=>{x==null||x.unsubscribe(),delete this.resolveRejects[p];const M={id:p,type:"<cancel>",origin:location.origin,targetMapId:a.targetMapId,sourceMapId:this.mapId};this.target.postMessage(M)}),Rn):null;this.resolveRejects[p]={resolve:M=>{x==null||x.unsubscribe(),r(M)},reject:M=>{x==null||x.unsubscribe(),u(M)}};const b=[],T=Object.assign(Object.assign({},a),{id:p,sourceMapId:this.mapId,origin:location.origin,data:el(a.data,b)});this.target.postMessage(T,{transfer:b})}))}receive(a){const t=a.data,r=t.id;if(!(t.origin!=="file://"&&location.origin!=="file://"&&t.origin!=="resource://android"&&location.origin!=="resource://android"&&t.origin!==location.origin||t.targetMapId&&this.mapId!==t.targetMapId)){if(t.type==="<cancel>"){delete this.tasks[r];const u=this.abortControllers[r];return delete this.abortControllers[r],void(u&&u.abort())}if(Ba(self)||t.mustQueue)return this.tasks[r]=t,this.taskQueue.push(r),void this.invoker.trigger();this.processTask(r,t)}}process(){if(this.taskQueue.length===0)return;const a=this.taskQueue.shift(),t=this.tasks[a];delete this.tasks[a],this.taskQueue.length>0&&this.invoker.trigger(),t&&this.processTask(a,t)}processTask(a,t){return c(this,void 0,void 0,(function*(){if(t.type==="<response>"){const p=this.resolveRejects[a];return delete this.resolveRejects[a],p?void(t.error?p.reject(tl(t.error)):p.resolve(tl(t.data))):void 0}if(!this.messageHandlers[t.type])return void this.completeTask(a,new Error(`Could not find a registered handler for ${t.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const r=tl(t.data),u=new AbortController;this.abortControllers[a]=u;try{const p=yield this.messageHandlers[t.type](t.sourceMapId,r,u);this.completeTask(a,null,p)}catch(p){this.completeTask(a,p)}}))}completeTask(a,t,r){const u=[];delete this.abortControllers[a];const p={id:a,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:t?el(t):null,data:el(r,u)};this.target.postMessage(p,{transfer:u})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},C.K=he,C.L=function(){var a=new Pe(16);return Pe!=Float32Array&&(a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[11]=0,a[12]=0,a[13]=0,a[14]=0),a[0]=1,a[5]=1,a[10]=1,a[15]=1,a},C.M=function(a,t,r){var u,p,x,b,T,M,I,z,F,j,G,H,J=r[0],ne=r[1],le=r[2];return t===a?(a[12]=t[0]*J+t[4]*ne+t[8]*le+t[12],a[13]=t[1]*J+t[5]*ne+t[9]*le+t[13],a[14]=t[2]*J+t[6]*ne+t[10]*le+t[14],a[15]=t[3]*J+t[7]*ne+t[11]*le+t[15]):(p=t[1],x=t[2],b=t[3],T=t[4],M=t[5],I=t[6],z=t[7],F=t[8],j=t[9],G=t[10],H=t[11],a[0]=u=t[0],a[1]=p,a[2]=x,a[3]=b,a[4]=T,a[5]=M,a[6]=I,a[7]=z,a[8]=F,a[9]=j,a[10]=G,a[11]=H,a[12]=u*J+T*ne+F*le+t[12],a[13]=p*J+M*ne+j*le+t[13],a[14]=x*J+I*ne+G*le+t[14],a[15]=b*J+z*ne+H*le+t[15]),a},C.N=function(a,t,r){var u=r[0],p=r[1],x=r[2];return a[0]=t[0]*u,a[1]=t[1]*u,a[2]=t[2]*u,a[3]=t[3]*u,a[4]=t[4]*p,a[5]=t[5]*p,a[6]=t[6]*p,a[7]=t[7]*p,a[8]=t[8]*x,a[9]=t[9]*x,a[10]=t[10]*x,a[11]=t[11]*x,a[12]=t[12],a[13]=t[13],a[14]=t[14],a[15]=t[15],a},C.O=function(a,t,r){var u=t[0],p=t[1],x=t[2],b=t[3],T=t[4],M=t[5],I=t[6],z=t[7],F=t[8],j=t[9],G=t[10],H=t[11],J=t[12],ne=t[13],le=t[14],Ae=t[15],pe=r[0],ve=r[1],Fe=r[2],qe=r[3];return a[0]=pe*u+ve*T+Fe*F+qe*J,a[1]=pe*p+ve*M+Fe*j+qe*ne,a[2]=pe*x+ve*I+Fe*G+qe*le,a[3]=pe*b+ve*z+Fe*H+qe*Ae,a[4]=(pe=r[4])*u+(ve=r[5])*T+(Fe=r[6])*F+(qe=r[7])*J,a[5]=pe*p+ve*M+Fe*j+qe*ne,a[6]=pe*x+ve*I+Fe*G+qe*le,a[7]=pe*b+ve*z+Fe*H+qe*Ae,a[8]=(pe=r[8])*u+(ve=r[9])*T+(Fe=r[10])*F+(qe=r[11])*J,a[9]=pe*p+ve*M+Fe*j+qe*ne,a[10]=pe*x+ve*I+Fe*G+qe*le,a[11]=pe*b+ve*z+Fe*H+qe*Ae,a[12]=(pe=r[12])*u+(ve=r[13])*T+(Fe=r[14])*F+(qe=r[15])*J,a[13]=pe*p+ve*M+Fe*j+qe*ne,a[14]=pe*x+ve*I+Fe*G+qe*le,a[15]=pe*b+ve*z+Fe*H+qe*Ae,a},C.P=D,C.Q=function(a,t){const r={};for(let u=0;u<t.length;u++){const p=t[u];p in a&&(r[p]=a[p])}return r},C.R=Gr,C.S=bo,C.T=Wh,C.U=ud,C.V=d1,C.W=ye,C.X=Se,C.Y=Sl,C.Z=Tn,C._=c,C.a=W,C.a$=Qt,C.a0=function(a,t){var r,u,p,x,b;if(!a)return t??{};if(!t)return a;let T=Object.assign({},a);if(t.removeAll&&(T={removeAll:!0}),t.remove){const M=new Set(t.remove);T.add&&(T.add=T.add.filter((z=>!M.has(z.id)))),T.update&&(T.update=T.update.filter((z=>!M.has(z.id))));const I=new Set(((r=a.add)!==null&&r!==void 0?r:[]).map((z=>z.id)));t.remove=t.remove.filter((z=>!I.has(z)))}if(t.remove){const M=new Set(T.remove?T.remove.concat(t.remove):t.remove);T.remove=Array.from(M.values())}if(t.add){const M=T.add?T.add.concat(t.add):t.add,I=new Map(M.map((z=>[z.id,z])));T.add=Array.from(I.values())}if(t.update){const M=new Map((u=T.update)===null||u===void 0?void 0:u.map((I=>[I.id,I])));for(const I of t.update){const z=(p=M.get(I.id))!==null&&p!==void 0?p:{id:I.id};I.newGeometry&&(z.newGeometry=I.newGeometry),I.addOrUpdateProperties&&(z.addOrUpdateProperties=((x=z.addOrUpdateProperties)!==null&&x!==void 0?x:[]).concat(I.addOrUpdateProperties)),I.removeProperties&&(z.removeProperties=((b=z.removeProperties)!==null&&b!==void 0?b:[]).concat(I.removeProperties)),I.removeAllProperties&&(z.removeAllProperties=!0),M.set(I.id,z)}T.update=Array.from(M.values())}return T.remove&&T.add&&(T.remove=T.remove.filter((M=>T.add.findIndex((I=>I.id===M))===-1))),T},C.a1=Hf,C.a2=ih,C.a3=25,C.a4=f1,C.a5=a=>{const t=window.document.createElement("video");return t.muted=!0,new Promise((r=>{t.onloadstart=()=>{r(t)};for(const u of a){const p=window.document.createElement("source");Le(u)||(t.crossOrigin="Anonymous"),p.src=u,t.appendChild(p)}}))},C.a6=rt,C.a7=function(){return xn++},C.a8=$,C.a9=Kc,C.aA=function(a){let t=1/0,r=1/0,u=-1/0,p=-1/0;for(const x of a)t=Math.min(t,x.x),r=Math.min(r,x.y),u=Math.max(u,x.x),p=Math.max(p,x.y);return[t,r,u,p]},C.aB=Oi,C.aC=Zt,C.aD=function(a,t,r,u,p=!1){if(!r[0]&&!r[1])return[0,0];const x=p?u==="map"?-a.bearingInRadians:0:u==="viewport"?a.bearingInRadians:0;if(x){const b=Math.sin(x),T=Math.cos(x);r=[r[0]*T-r[1]*b,r[0]*b+r[1]*T]}return[p?r[0]:Zt(t,r[0],a.zoom),p?r[1]:Zt(t,r[1],a.zoom)]},C.aF=nh,C.aG=b1,C.aH=$f,C.aI=So,C.aJ=Yn,C.aK=Xu,C.aL=be,C.aM=yn,C.aN=Nn,C.aO=Wt,C.aP=ua,C.aQ=tg,C.aR=Tt,C.aS=Gt,C.aT=function(a){var t=new Pe(3);return t[0]=a[0],t[1]=a[1],t[2]=a[2],t},C.aU=function(a,t,r){return a[0]=t[0]-r[0],a[1]=t[1]-r[1],a[2]=t[2]-r[2],a},C.aV=function(a,t){var r=t[0],u=t[1],p=t[2],x=r*r+u*u+p*p;return x>0&&(x=1/Math.sqrt(x)),a[0]=t[0]*x,a[1]=t[1]*x,a[2]=t[2]*x,a},C.aW=Ot,C.aX=function(a,t){return a[0]*t[0]+a[1]*t[1]+a[2]*t[2]},C.aY=function(a,t,r){return a[0]=t[0]*r[0],a[1]=t[1]*r[1],a[2]=t[2]*r[2],a[3]=t[3]*r[3],a},C.aZ=ot,C.a_=function(a,t,r){const u=t[0]*r[0]+t[1]*r[1]+t[2]*r[2];return u===0?null:(-(a[0]*r[0]+a[1]*r[1]+a[2]*r[2])-r[3])/u},C.aa=Kr,C.ab=ys,C.ac=X0,C.ad=function(a){const t={};if(a.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((r,u,p,x)=>{const b=p||x;return t[u]=!b||b.toLowerCase(),""})),t["max-age"]){const r=parseInt(t["max-age"],10);isNaN(r)?delete t["max-age"]:t["max-age"]=r}return t},C.ae=hu,C.af=function(a){return Math.pow(2,a)},C.ag=Je,C.ah=Lt,C.ai=85.051129,C.aj=qf,C.ak=function(a){return Math.log(a)/Math.LN2},C.al=function(a){var t=a[0],r=a[1];return t*t+r*r},C.am=function(a){if(!a.length)return new Set;const t=Math.max(...a.map((M=>M.canonical.z)));let r=1/0,u=-1/0,p=1/0,x=-1/0;const b=[];for(const M of a){const{x:I,y:z,z:F}=M.canonical,j=Math.pow(2,t-F),G=I*j,H=z*j;b.push({id:M,x:G,y:H}),G<r&&(r=G),G>u&&(u=G),H<p&&(p=H),H>x&&(x=H)}const T=new Set;for(const M of b)M.x!==r&&M.x!==u&&M.y!==p&&M.y!==x||T.add(M.id);return T},C.an=function(a,t){let r=0,u=0;if(a.kind==="constant")u=a.layoutSize;else if(a.kind!=="source"){const{interpolationType:p,minZoom:x,maxZoom:b}=a,T=p?Lt(ir.interpolationFactor(p,t,x,b),0,1):0;a.kind==="camera"?u=Ua.number(a.minSize,a.maxSize,T):r=T}return{uSizeT:r,uSize:u}},C.ap=function(a,{uSize:t,uSizeT:r},{lowerSize:u,upperSize:p}){return a.kind==="source"?u/vo:a.kind==="composite"?Ua.number(u/vo,p/vo,r):t},C.aq=function(a,t){var r=t[0],u=t[1],p=t[2],x=t[3],b=t[4],T=t[5],M=t[6],I=t[7],z=t[8],F=t[9],j=t[10],G=t[11],H=t[12],J=t[13],ne=t[14],le=t[15],Ae=r*T-u*b,pe=r*M-p*b,ve=r*I-x*b,Fe=u*M-p*T,qe=u*I-x*T,it=p*I-x*M,bt=z*J-F*H,mt=z*ne-j*H,_t=z*le-G*H,kt=F*ne-j*J,yt=F*le-G*J,vt=j*le-G*ne,We=Ae*vt-pe*yt+ve*kt+Fe*_t-qe*mt+it*bt;return We?(a[0]=(T*vt-M*yt+I*kt)*(We=1/We),a[1]=(p*yt-u*vt-x*kt)*We,a[2]=(J*it-ne*qe+le*Fe)*We,a[3]=(j*qe-F*it-G*Fe)*We,a[4]=(M*_t-b*vt-I*mt)*We,a[5]=(r*vt-p*_t+x*mt)*We,a[6]=(ne*ve-H*it-le*pe)*We,a[7]=(z*it-j*ve+G*pe)*We,a[8]=(b*yt-T*_t+I*bt)*We,a[9]=(u*_t-r*yt-x*bt)*We,a[10]=(H*qe-J*ve+le*Ae)*We,a[11]=(F*ve-z*qe-G*Ae)*We,a[12]=(T*mt-b*kt-M*bt)*We,a[13]=(r*kt-u*mt+p*bt)*We,a[14]=(J*pe-H*Fe-ne*Ae)*We,a[15]=(z*Fe-F*pe+j*Ae)*We,a):null},C.ar=ft,C.as=function(a){var t=a[0],r=a[1];return Math.sqrt(t*t+r*r)},C.at=function(a){return a[0]=0,a[1]=0,a},C.au=function(a,t,r){return a[0]=t[0]*r,a[1]=t[1]*r,a},C.av=l1,C.aw=sn,C.ax=function(a,t,r,u){const p=t.y-a.y,x=t.x-a.x,b=u.y-r.y,T=u.x-r.x,M=b*x-T*p;if(M===0)return null;const I=(T*(a.y-r.y)-b*(a.x-r.x))/M;return new D(a.x+I*x,a.y+I*p)},C.ay=rg,C.az=Sf,C.b=Br,C.b$=class extends ta{constructor(a,t){super(a,t),this.current=new Array}set(a){if(a!=this.current){this.current=a;const t=new Float32Array(a);this.gl.uniform1fv(this.location,t)}}},C.b0=function(a,t,r){return a[0]=t[0]*r,a[1]=t[1]*r,a[2]=t[2]*r,a[3]=t[3]*r,a},C.b1=function(a,t){return a[0]*t[0]+a[1]*t[1]+a[2]*t[2]+a[3]},C.b2=ng,C.b3=Jc,C.b4=function(a,t,r,u,p){var x=1/Math.tan(t/2);if(a[0]=x/r,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=x,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[11]=-1,a[12]=0,a[13]=0,a[15]=0,p!=null&&p!==1/0){var b=1/(u-p);a[10]=(p+u)*b,a[14]=2*p*u*b}else a[10]=-1,a[14]=-2*u;return a},C.b5=function(a){var t=new Pe(16);return t[0]=a[0],t[1]=a[1],t[2]=a[2],t[3]=a[3],t[4]=a[4],t[5]=a[5],t[6]=a[6],t[7]=a[7],t[8]=a[8],t[9]=a[9],t[10]=a[10],t[11]=a[11],t[12]=a[12],t[13]=a[13],t[14]=a[14],t[15]=a[15],t},C.b6=function(a,t,r){var u=Math.sin(r),p=Math.cos(r),x=t[0],b=t[1],T=t[2],M=t[3],I=t[4],z=t[5],F=t[6],j=t[7];return t!==a&&(a[8]=t[8],a[9]=t[9],a[10]=t[10],a[11]=t[11],a[12]=t[12],a[13]=t[13],a[14]=t[14],a[15]=t[15]),a[0]=x*p+I*u,a[1]=b*p+z*u,a[2]=T*p+F*u,a[3]=M*p+j*u,a[4]=I*p-x*u,a[5]=z*p-b*u,a[6]=F*p-T*u,a[7]=j*p-M*u,a},C.b7=function(a,t,r){var u=Math.sin(r),p=Math.cos(r),x=t[4],b=t[5],T=t[6],M=t[7],I=t[8],z=t[9],F=t[10],j=t[11];return t!==a&&(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=t[3],a[12]=t[12],a[13]=t[13],a[14]=t[14],a[15]=t[15]),a[4]=x*p+I*u,a[5]=b*p+z*u,a[6]=T*p+F*u,a[7]=M*p+j*u,a[8]=I*p-x*u,a[9]=z*p-b*u,a[10]=F*p-T*u,a[11]=j*p-M*u,a},C.b8=function(){const a=new Float32Array(16);return Je(a),a},C.b9=function(){const a=new Float64Array(16);return Je(a),a},C.bA=function(a,t){const r=we(a,360),u=we(t,360),p=u-r,x=u>r?p-360:p+360;return Math.abs(p)<Math.abs(x)?p:x},C.bB=function(a){return a[0]=0,a[1]=0,a[2]=0,a},C.bC=function(a,t,r,u){const p=Math.sqrt(a*a+t*t),x=Math.sqrt(r*r+u*u);a/=p,t/=p,r/=x,u/=x;const b=Math.acos(a*r+t*u);return-t*r+a*u>0?b:-b},C.bD=function(a,t){const r=we(a,2*Math.PI),u=we(t,2*Math.PI);return Math.min(Math.abs(r-u),Math.abs(r-u+2*Math.PI),Math.abs(r-u-2*Math.PI))},C.bE=function(){const a={},t=Ie.$version;for(const r in Ie.$root){const u=Ie.$root[r];if(u.required){let p=null;p=r==="version"?t:u.type==="array"?[]:{},p!=null&&(a[r]=p)}}return a},C.bF=jl,C.bG=Te,C.bH=function a(t,r){if(Array.isArray(t)){if(!Array.isArray(r)||t.length!==r.length)return!1;for(let u=0;u<t.length;u++)if(!a(t[u],r[u]))return!1;return!0}if(typeof t=="object"&&t!==null&&r!==null){if(typeof r!="object"||Object.keys(t).length!==Object.keys(r).length)return!1;for(const u in t)if(!a(t[u],r[u]))return!1;return!0}return t===r},C.bI=function(a){a=a.slice();const t=Object.create(null);for(let r=0;r<a.length;r++)t[a[r].id]=a[r];for(let r=0;r<a.length;r++)"ref"in a[r]&&(a[r]=En(a[r],t[a[r].ref]));return a},C.bJ=function(a,t){if(a.type==="custom")return new h_(a,t);switch(a.type){case"background":return new Zf(a,t);case"circle":return new Sm(a,t);case"color-relief":return new e_(a,t);case"fill":return new nd(a,t);case"fill-extrusion":return new rd(a,t);case"heatmap":return new Tm(a,t);case"hillshade":return new Wl(a,t);case"line":return new n1(a,t);case"raster":return new sl(a,t);case"symbol":return new cd(a,t)}},C.bK=a=>a.type==="raster",C.bL=kr,C.bM=function(a,t){if(!a)return[{command:"setStyle",args:[t]}];let r=[];try{if(!Dt(a.version,t.version))return[{command:"setStyle",args:[t]}];Dt(a.center,t.center)||r.push({command:"setCenter",args:[t.center]}),Dt(a.state,t.state)||r.push({command:"setGlobalState",args:[t.state]}),Dt(a.centerAltitude,t.centerAltitude)||r.push({command:"setCenterAltitude",args:[t.centerAltitude]}),Dt(a.zoom,t.zoom)||r.push({command:"setZoom",args:[t.zoom]}),Dt(a.bearing,t.bearing)||r.push({command:"setBearing",args:[t.bearing]}),Dt(a.pitch,t.pitch)||r.push({command:"setPitch",args:[t.pitch]}),Dt(a.roll,t.roll)||r.push({command:"setRoll",args:[t.roll]}),Dt(a.sprite,t.sprite)||r.push({command:"setSprite",args:[t.sprite]}),Dt(a.glyphs,t.glyphs)||r.push({command:"setGlyphs",args:[t.glyphs]}),Dt(a.transition,t.transition)||r.push({command:"setTransition",args:[t.transition]}),Dt(a.light,t.light)||r.push({command:"setLight",args:[t.light]}),Dt(a.terrain,t.terrain)||r.push({command:"setTerrain",args:[t.terrain]}),Dt(a.sky,t.sky)||r.push({command:"setSky",args:[t.sky]}),Dt(a.projection,t.projection)||r.push({command:"setProjection",args:[t.projection]});const u={},p=[];(function(b,T,M,I){let z;for(z in T=T||{},b=b||{})Object.prototype.hasOwnProperty.call(b,z)&&(Object.prototype.hasOwnProperty.call(T,z)||Ai(z,M,I));for(z in T)Object.prototype.hasOwnProperty.call(T,z)&&(Object.prototype.hasOwnProperty.call(b,z)?Dt(b[z],T[z])||(b[z].type==="geojson"&&T[z].type==="geojson"&&ur(b,T,z)?Sn(M,{command:"setGeoJSONSourceData",args:[z,T[z].data]}):Zi(z,T,M,I)):Ni(z,T,M))})(a.sources,t.sources,p,u);const x=[];a.layers&&a.layers.forEach((b=>{"source"in b&&u[b.source]?r.push({command:"removeLayer",args:[b.id]}):x.push(b)})),r=r.concat(p),(function(b,T,M){T=T||[];const I=(b=b||[]).map(Gi),z=T.map(Gi),F=b.reduce(On,{}),j=T.reduce(On,{}),G=I.slice(),H=Object.create(null);let J,ne,le,Ae,pe;for(let ve=0,Fe=0;ve<I.length;ve++)J=I[ve],Object.prototype.hasOwnProperty.call(j,J)?Fe++:(Sn(M,{command:"removeLayer",args:[J]}),G.splice(G.indexOf(J,Fe),1));for(let ve=0,Fe=0;ve<z.length;ve++)J=z[z.length-1-ve],G[G.length-1-ve]!==J&&(Object.prototype.hasOwnProperty.call(F,J)?(Sn(M,{command:"removeLayer",args:[J]}),G.splice(G.lastIndexOf(J,G.length-Fe),1)):Fe++,Ae=G[G.length-ve],Sn(M,{command:"addLayer",args:[j[J],Ae]}),G.splice(G.length-ve,0,J),H[J]=!0);for(let ve=0;ve<z.length;ve++)if(J=z[ve],ne=F[J],le=j[J],!H[J]&&!Dt(ne,le))if(Dt(ne.source,le.source)&&Dt(ne["source-layer"],le["source-layer"])&&Dt(ne.type,le.type)){for(pe in Kn(ne.layout,le.layout,M,J,null,"setLayoutProperty"),Kn(ne.paint,le.paint,M,J,null,"setPaintProperty"),Dt(ne.filter,le.filter)||Sn(M,{command:"setFilter",args:[J,le.filter]}),Dt(ne.minzoom,le.minzoom)&&Dt(ne.maxzoom,le.maxzoom)||Sn(M,{command:"setLayerZoomRange",args:[J,le.minzoom,le.maxzoom]}),ne)Object.prototype.hasOwnProperty.call(ne,pe)&&pe!=="layout"&&pe!=="paint"&&pe!=="filter"&&pe!=="metadata"&&pe!=="minzoom"&&pe!=="maxzoom"&&(pe.indexOf("paint.")===0?Kn(ne[pe],le[pe],M,J,pe.slice(6),"setPaintProperty"):Dt(ne[pe],le[pe])||Sn(M,{command:"setLayerProperty",args:[J,pe,le[pe]]}));for(pe in le)Object.prototype.hasOwnProperty.call(le,pe)&&!Object.prototype.hasOwnProperty.call(ne,pe)&&pe!=="layout"&&pe!=="paint"&&pe!=="filter"&&pe!=="metadata"&&pe!=="minzoom"&&pe!=="maxzoom"&&(pe.indexOf("paint.")===0?Kn(ne[pe],le[pe],M,J,pe.slice(6),"setPaintProperty"):Dt(ne[pe],le[pe])||Sn(M,{command:"setLayerProperty",args:[J,pe,le[pe]]}))}else Sn(M,{command:"removeLayer",args:[J]}),Ae=G[G.lastIndexOf(J)+1],Sn(M,{command:"addLayer",args:[le,Ae]})})(x,t.layers,r)}catch(u){console.warn("Unable to compute style diff:",u),r=[{command:"setStyle",args:[t]}]}return r},C.bN=function(a){const t=[],r=a.id;return r===void 0&&t.push({message:`layers.${r}: missing required property "id"`}),a.render===void 0&&t.push({message:`layers.${r}: missing required method "render"`}),a.renderingMode&&a.renderingMode!=="2d"&&a.renderingMode!=="3d"&&t.push({message:`layers.${r}: property "renderingMode" must be either "2d" or "3d"`}),t},C.bO=ka,C.bP=ai,C.bQ=class extends ta{constructor(a,t){super(a,t),this.current=0}set(a){this.current!==a&&(this.current=a,this.gl.uniform1i(this.location,a))}},C.bR=na,C.bS=class extends ta{constructor(a,t){super(a,t),this.current=vr}set(a){if(a[12]!==this.current[12]||a[0]!==this.current[0])return this.current=a,void this.gl.uniformMatrix4fv(this.location,!1,a);for(let t=1;t<16;t++)if(a[t]!==this.current[t]){this.current=a,this.gl.uniformMatrix4fv(this.location,!1,a);break}}},C.bT=Xi,C.bU=class extends ta{constructor(a,t){super(a,t),this.current=[0,0,0]}set(a){a[0]===this.current[0]&&a[1]===this.current[1]&&a[2]===this.current[2]||(this.current=a,this.gl.uniform3f(this.location,a[0],a[1],a[2]))}},C.bV=class extends ta{constructor(a,t){super(a,t),this.current=[0,0]}set(a){a[0]===this.current[0]&&a[1]===this.current[1]||(this.current=a,this.gl.uniform2f(this.location,a[0],a[1]))}},C.bW=Oe,C.bX=function(a,t){var r=Math.sin(t),u=Math.cos(t);return a[0]=u,a[1]=r,a[2]=0,a[3]=-r,a[4]=u,a[5]=0,a[6]=0,a[7]=0,a[8]=1,a},C.bY=function(a,t,r){var u=t[0],p=t[1],x=t[2];return a[0]=u*r[0]+p*r[3]+x*r[6],a[1]=u*r[1]+p*r[4]+x*r[7],a[2]=u*r[2]+p*r[5]+x*r[8],a},C.bZ=function(a,t,r,u,p,x,b){var T=1/(t-r),M=1/(u-p),I=1/(x-b);return a[0]=-2*T,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=-2*M,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=2*I,a[11]=0,a[12]=(t+r)*T,a[13]=(p+u)*M,a[14]=(b+x)*I,a[15]=1,a},C.b_=class extends ta{constructor(a,t){super(a,t),this.current=new Array}set(a){if(a!=this.current){this.current=a;const t=new Float32Array(4*a.length);for(let r=0;r<a.length;r++)t[4*r]=a[r].r,t[4*r+1]=a[r].g,t[4*r+2]=a[r].b,t[4*r+3]=a[r].a;this.gl.uniform4fv(this.location,t)}}},C.ba=function(){return new Float64Array(16)},C.bb=function(a,t,r){const u=new Float64Array(4);return $e(u,a,t-90,r),u},C.bc=function(a,t,r,u){var p,x,b,T,M,I=t[0],z=t[1],F=t[2],j=t[3],G=r[0],H=r[1],J=r[2],ne=r[3];return(x=I*G+z*H+F*J+j*ne)<0&&(x=-x,G=-G,H=-H,J=-J,ne=-ne),1-x>je?(p=Math.acos(x),b=Math.sin(p),T=Math.sin((1-u)*p)/b,M=Math.sin(u*p)/b):(T=1-u,M=u),a[0]=T*I+M*G,a[1]=T*z+M*H,a[2]=T*F+M*J,a[3]=T*j+M*ne,a},C.bd=function(a){const t=new Float64Array(9);var r,u,p,x,b,T,M,I,z,F,j,G,H,J,ne,le,Ae,pe;F=(p=(u=a)[0])*(M=p+p),j=(x=u[1])*M,H=(b=u[2])*M,J=b*(I=x+x),le=(T=u[3])*M,Ae=T*I,pe=T*(z=b+b),(r=t)[0]=1-(G=x*I)-(ne=b*z),r[3]=j-pe,r[6]=H+Ae,r[1]=j+pe,r[4]=1-F-ne,r[7]=J-le,r[2]=H-Ae,r[5]=J+le,r[8]=1-F-G;const ve=ua(-Math.asin(Lt(t[2],-1,1)));let Fe,qe;return Math.hypot(t[5],t[8])<.001?(Fe=0,qe=-ua(Math.atan2(t[3],t[4]))):(Fe=ua(t[5]===0&&t[8]===0?0:Math.atan2(t[5],t[8])),qe=ua(t[1]===0&&t[0]===0?0:Math.atan2(t[1],t[0]))),{roll:Fe,pitch:ve+90,bearing:qe}},C.be=function(a,t){return a.roll==t.roll&&a.pitch==t.pitch&&a.bearing==t.bearing},C.bf=dn,C.bg=Si,C.bh=Cr,C.bi=Ta,C.bj=td,C.bk=Be,C.bl=pt,C.bm=dr,C.bn=function(a,t,r,u,p){return Be(u,p,Lt((a-t)/(r-t),0,1))},C.bo=we,C.bp=function(){return new Float64Array(3)},C.bq=function(a,t,r,u){return a[0]=t[0]+r[0]*u,a[1]=t[1]+r[1]*u,a[2]=t[2]+r[2]*u,a},C.br=$e,C.bs=function(a,t,r){var u=r[0],p=r[1],x=r[2],b=r[3],T=t[0],M=t[1],I=t[2],z=p*I-x*M,F=x*T-u*I,j=u*M-p*T;return a[0]=T+b*(z+=z)+p*(j+=j)-x*(F+=F),a[1]=M+b*F+x*z-u*j,a[2]=I+b*j+u*F-p*z,a},C.bt=function(a,t,r){const u=(p=[a[0],a[1],a[2],t[0],t[1],t[2],r[0],r[1],r[2]])[0]*((z=p[8])*(b=p[4])-(T=p[5])*(I=p[7]))+p[1]*(-z*(x=p[3])+T*(M=p[6]))+p[2]*(I*x-b*M);var p,x,b,T,M,I,z;if(u===0)return null;const F=Ot([],[t[0],t[1],t[2]],[r[0],r[1],r[2]]),j=Ot([],[r[0],r[1],r[2]],[a[0],a[1],a[2]]),G=Ot([],[a[0],a[1],a[2]],[t[0],t[1],t[2]]),H=Tt([],F,-a[3]);return Gt(H,H,Tt([],j,-t[3])),Gt(H,H,Tt([],G,-r[3])),Tt(H,H,1/u),H},C.bu=Gf,C.bv=function(){return new Float64Array(4)},C.bw=function(a,t,r,u){var p=[],x=[];return p[0]=t[0]-r[0],p[1]=t[1]-r[1],p[2]=t[2]-r[2],x[0]=p[0]*Math.cos(u)-p[1]*Math.sin(u),x[1]=p[0]*Math.sin(u)+p[1]*Math.cos(u),x[2]=p[2],a[0]=x[0]+r[0],a[1]=x[1]+r[1],a[2]=x[2]+r[2],a},C.bx=function(a,t,r,u){var p=[],x=[];return p[0]=t[0]-r[0],p[1]=t[1]-r[1],p[2]=t[2]-r[2],x[0]=p[0],x[1]=p[1]*Math.cos(u)-p[2]*Math.sin(u),x[2]=p[1]*Math.sin(u)+p[2]*Math.cos(u),a[0]=x[0]+r[0],a[1]=x[1]+r[1],a[2]=x[2]+r[2],a},C.by=function(a,t,r,u){var p=[],x=[];return p[0]=t[0]-r[0],p[1]=t[1]-r[1],p[2]=t[2]-r[2],x[0]=p[2]*Math.sin(u)+p[0]*Math.cos(u),x[1]=p[1],x[2]=p[2]*Math.cos(u)-p[0]*Math.sin(u),a[0]=x[0]+r[0],a[1]=x[1]+r[1],a[2]=x[2]+r[2],a},C.bz=function(a,t,r){var u=Math.sin(r),p=Math.cos(r),x=t[0],b=t[1],T=t[2],M=t[3],I=t[8],z=t[9],F=t[10],j=t[11];return t!==a&&(a[4]=t[4],a[5]=t[5],a[6]=t[6],a[7]=t[7],a[12]=t[12],a[13]=t[13],a[14]=t[14],a[15]=t[15]),a[0]=x*p-I*u,a[1]=b*p-z*u,a[2]=T*p-F*u,a[3]=M*p-j*u,a[8]=x*u+I*p,a[9]=b*u+z*p,a[10]=T*u+F*p,a[11]=M*u+j*p,a},C.c=Q,C.c0=class extends Hh{},C.c1=km,C.c2=class extends e{},C.c3=_o,C.c4=function(a){return a<=1?1:Math.pow(2,Math.ceil(Math.log(a)/Math.LN2))},C.c5=Cm,C.c6=function(a,t,r){var u=t[0],p=t[1],x=t[2],b=r[3]*u+r[7]*p+r[11]*x+r[15];return a[0]=(r[0]*u+r[4]*p+r[8]*x+r[12])/(b=b||1),a[1]=(r[1]*u+r[5]*p+r[9]*x+r[13])/b,a[2]=(r[2]*u+r[6]*p+r[10]*x+r[14])/b,a},C.c7=class extends Hl{},C.c8=class extends P{},C.c9=function(a,t){return a[0]===t[0]&&a[1]===t[1]&&a[2]===t[2]&&a[3]===t[3]&&a[4]===t[4]&&a[5]===t[5]&&a[6]===t[6]&&a[7]===t[7]&&a[8]===t[8]&&a[9]===t[9]&&a[10]===t[10]&&a[11]===t[11]&&a[12]===t[12]&&a[13]===t[13]&&a[14]===t[14]&&a[15]===t[15]},C.cA=function(a,t){W.REGISTERED_PROTOCOLS[a]=t},C.cB=function(a){delete W.REGISTERED_PROTOCOLS[a]},C.cC=function(a,t){const r={};for(let p=0;p<a.length;p++){const x=t&&t[a[p].id]||ls(a[p]);t&&(t[a[p].id]=x);let b=r[x];b||(b=r[x]=[]),b.push(a[p])}const u=[];for(const p in r)u.push(r[p]);return u},C.cD=Ct,C.cE=ig,C.cF=p1,C.cG=jm,C.cH=function(a){a.bucket.createArrays(),a.bucket.tilePixelRatio=St/(512*a.bucket.overscaling),a.bucket.compareText={},a.bucket.iconsNeedLinear=!1;const t=a.bucket.layers[0],r=t.layout,u=t._unevaluatedLayout._values,p={layoutIconSize:u["icon-size"].possiblyEvaluate(new Xn(a.bucket.zoom+1),a.canonical),layoutTextSize:u["text-size"].possiblyEvaluate(new Xn(a.bucket.zoom+1),a.canonical),textMaxSize:u["text-size"].possiblyEvaluate(new Xn(18))};if(a.bucket.textSizeData.kind==="composite"){const{minZoom:I,maxZoom:z}=a.bucket.textSizeData;p.compositeTextSizes=[u["text-size"].possiblyEvaluate(new Xn(I),a.canonical),u["text-size"].possiblyEvaluate(new Xn(z),a.canonical)]}if(a.bucket.iconSizeData.kind==="composite"){const{minZoom:I,maxZoom:z}=a.bucket.iconSizeData;p.compositeIconSizes=[u["icon-size"].possiblyEvaluate(new Xn(I),a.canonical),u["icon-size"].possiblyEvaluate(new Xn(z),a.canonical)]}const x=r.get("text-line-height")*Oi,b=r.get("text-rotation-alignment")!=="viewport"&&r.get("symbol-placement")!=="point",T=r.get("text-keep-upright"),M=r.get("text-size");for(const I of a.bucket.features){const z=r.get("text-font").evaluate(I,{},a.canonical).join(","),F=M.evaluate(I,{},a.canonical),j=p.layoutTextSize.evaluate(I,{},a.canonical),G=p.layoutIconSize.evaluate(I,{},a.canonical),H={horizontal:{},vertical:void 0},J=I.text;let ne,le=[0,0];if(J){const ve=J.toString(),Fe=r.get("text-letter-spacing").evaluate(I,{},a.canonical)*Oi,qe=vf(ve)?Fe:0,it=r.get("text-anchor").evaluate(I,{},a.canonical),bt=lg(t,I,a.canonical);if(!bt){const yt=r.get("text-radial-offset").evaluate(I,{},a.canonical);le=yt?x1(it,[yt*Oi,Ya]):r.get("text-offset").evaluate(I,{},a.canonical).map((vt=>vt*Oi))}let mt=b?"center":r.get("text-justify").evaluate(I,{},a.canonical);const _t=r.get("symbol-placement")==="point"?r.get("text-max-width").evaluate(I,{},a.canonical)*Oi:1/0,kt=()=>{a.bucket.allowVerticalPlacement&&Bs(ve)&&(H.vertical=Nf(J,a.glyphMap,a.glyphPositions,a.imagePositions,z,_t,x,it,"left",qe,le,C.ao.vertical,!0,j,F))};if(!b&&bt){const yt=new Set;if(mt==="auto")for(let We=0;We<bt.values.length;We+=2)yt.add(b1(bt.values[We]));else yt.add(mt);let vt=!1;for(const We of yt)if(!H.horizontal[We])if(vt)H.horizontal[We]=H.horizontal[0];else{const jt=Nf(J,a.glyphMap,a.glyphPositions,a.imagePositions,z,_t,x,"center",We,qe,le,C.ao.horizontal,!1,j,F);jt&&(H.horizontal[We]=jt,vt=jt.positionedLines.length===1)}kt()}else{mt==="auto"&&(mt=b1(it));const yt=Nf(J,a.glyphMap,a.glyphPositions,a.imagePositions,z,_t,x,it,mt,qe,le,C.ao.horizontal,!1,j,F);yt&&(H.horizontal[mt]=yt),kt(),Bs(ve)&&b&&T&&(H.vertical=Nf(J,a.glyphMap,a.glyphPositions,a.imagePositions,z,_t,x,it,mt,qe,le,C.ao.vertical,!1,j,F))}}let Ae=!1;if(I.icon&&I.icon.name){const ve=a.imageMap[I.icon.name];ve&&(ne=ld(a.imagePositions[I.icon.name],r.get("icon-offset").evaluate(I,{},a.canonical),r.get("icon-anchor").evaluate(I,{},a.canonical)),Ae=!!ve.sdf,a.bucket.sdfIcons===void 0?a.bucket.sdfIcons=Ae:a.bucket.sdfIcons!==Ae&&si("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(ve.pixelRatio!==a.bucket.pixelRatio||r.get("icon-rotate").constantOr(1)!==0)&&(a.bucket.iconsNeedLinear=!0))}const pe=xs(H.horizontal)||H.vertical;a.bucket.iconsInText=!!pe&&pe.iconsInText,(pe||ne)&&e2(a.bucket,I,H,ne,a.imageMap,p,j,G,le,Ae,a.canonical,a.subdivisionGranularity)}a.showCollisionBoxes&&a.bucket.generateCollisionDebugBuffers()},C.cI=zf,C.cJ=di,C.cK=Ju,C.cL=zm,C.cM=ra,C.cN=class{constructor(a){this._marks={start:[a.url,"start"].join("#"),end:[a.url,"end"].join("#"),measure:a.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let a=performance.getEntriesByName(this._marks.measure);return a.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),a=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),a}},C.cO=function(a,t,r,u,p){return c(this,void 0,void 0,(function*(){if(Se())try{return yield Sl(a,t,r,u,p)}catch{}return(function(x,b,T,M,I){const z=x.width,F=x.height;Oo&&Ss||(Oo=new OffscreenCanvas(z,F),Ss=Oo.getContext("2d",{willReadFrequently:!0})),Oo.width=z,Oo.height=F,Ss.drawImage(x,0,0,z,F);const j=Ss.getImageData(b,T,M,I);return Ss.clearRect(0,0,z,F),j.data})(a,t,r,u,p)}))},C.cP=Kh,C.cQ=B,C.cR=Im,C.cS=Yu,C.cT=Lu,C.cU=function(a,t){const r=new Map;if(a!=null)if(a.type==="Feature")r.set(sr(a,t),a);else for(const u of a.features)r.set(sr(u,t),u);return r},C.cV=function(a,t){if(a==null)return!0;if(a.type==="Feature")return sr(a,t)!=null;if(a.type==="FeatureCollection"){const r=new Set;for(const u of a.features){const p=sr(u,t);if(p==null||r.has(p))return!1;r.add(p)}return!0}return!1},C.cW=function(a,t,r){var u,p,x,b;if(t.removeAll&&a.clear(),t.remove)for(const T of t.remove)a.delete(T);if(t.add)for(const T of t.add){const M=sr(T,r);M!=null&&a.set(M,T)}if(t.update)for(const T of t.update){let M=a.get(T.id);if(M==null)continue;const I=!T.removeAllProperties&&(((u=T.removeProperties)===null||u===void 0?void 0:u.length)>0||((p=T.addOrUpdateProperties)===null||p===void 0?void 0:p.length)>0);if((T.newGeometry||T.removeAllProperties||I)&&(M=Object.assign({},M),a.set(T.id,M),I&&(M.properties=Object.assign({},M.properties))),T.newGeometry&&(M.geometry=T.newGeometry),T.removeAllProperties)M.properties={};else if(((x=T.removeProperties)===null||x===void 0?void 0:x.length)>0)for(const z of T.removeProperties)Object.prototype.hasOwnProperty.call(M.properties,z)&&delete M.properties[z];if(((b=T.addOrUpdateProperties)===null||b===void 0?void 0:b.length)>0)for(const{key:z,value:F}of T.addOrUpdateProperties)M.properties[z]=F}},C.cX=Fs,C.ca=function(a,t){var r=a[0],u=a[1],p=a[2],x=a[3],b=a[4],T=a[5],M=a[6],I=a[7],z=a[8],F=a[9],j=a[10],G=a[11],H=a[12],J=a[13],ne=a[14],le=a[15],Ae=t[0],pe=t[1],ve=t[2],Fe=t[3],qe=t[4],it=t[5],bt=t[6],mt=t[7],_t=t[8],kt=t[9],yt=t[10],vt=t[11],We=t[12],jt=t[13],Kt=t[14],Vt=t[15];return Math.abs(r-Ae)<=je*Math.max(1,Math.abs(r),Math.abs(Ae))&&Math.abs(u-pe)<=je*Math.max(1,Math.abs(u),Math.abs(pe))&&Math.abs(p-ve)<=je*Math.max(1,Math.abs(p),Math.abs(ve))&&Math.abs(x-Fe)<=je*Math.max(1,Math.abs(x),Math.abs(Fe))&&Math.abs(b-qe)<=je*Math.max(1,Math.abs(b),Math.abs(qe))&&Math.abs(T-it)<=je*Math.max(1,Math.abs(T),Math.abs(it))&&Math.abs(M-bt)<=je*Math.max(1,Math.abs(M),Math.abs(bt))&&Math.abs(I-mt)<=je*Math.max(1,Math.abs(I),Math.abs(mt))&&Math.abs(z-_t)<=je*Math.max(1,Math.abs(z),Math.abs(_t))&&Math.abs(F-kt)<=je*Math.max(1,Math.abs(F),Math.abs(kt))&&Math.abs(j-yt)<=je*Math.max(1,Math.abs(j),Math.abs(yt))&&Math.abs(G-vt)<=je*Math.max(1,Math.abs(G),Math.abs(vt))&&Math.abs(H-We)<=je*Math.max(1,Math.abs(H),Math.abs(We))&&Math.abs(J-jt)<=je*Math.max(1,Math.abs(J),Math.abs(jt))&&Math.abs(ne-Kt)<=je*Math.max(1,Math.abs(ne),Math.abs(Kt))&&Math.abs(le-Vt)<=je*Math.max(1,Math.abs(le),Math.abs(Vt))},C.cb=function(a,t){return a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=t[3],a[4]=t[4],a[5]=t[5],a[6]=t[6],a[7]=t[7],a[8]=t[8],a[9]=t[9],a[10]=t[10],a[11]=t[11],a[12]=t[12],a[13]=t[13],a[14]=t[14],a[15]=t[15],a},C.cc=a=>a.type==="symbol",C.cd=a=>a.type==="circle",C.ce=a=>a.type==="heatmap",C.cf=a=>a.type==="line",C.cg=a=>a.type==="fill",C.ch=a=>a.type==="fill-extrusion",C.ci=a=>a.type==="hillshade",C.cj=a=>a.type==="color-relief",C.ck=a=>a.type==="background",C.cl=a=>a.type==="custom",C.cm=xt,C.cn=function(a,t,r){const u=wt(t.x-r.x,t.y-r.y),p=wt(a.x-r.x,a.y-r.y);var x,b;return ua(Math.atan2(u[0]*p[1]-u[1]*p[0],(x=u)[0]*(b=p)[0]+x[1]*b[1]))},C.co=Bt,C.cp=function(a,t){return Fr[t]&&(a instanceof MouseEvent||a instanceof WheelEvent)},C.cq=function(a,t){return Hs[t]&&"touches"in a},C.cr=function(a){return Hs[a]||Fr[a]},C.cs=function(a,t,r){var u=t[0],p=t[1];return a[0]=r[0]*u+r[4]*p+r[12],a[1]=r[1]*u+r[5]*p+r[13],a},C.ct=function(a,t){const{x:r,y:u}=Hf.fromLngLat(t);return!(a<0||a>25||u<0||u>=1||r<0||r>=1)},C.cu=function(a,t){return a[0]=t[0],a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=t[1],a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=t[2],a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a},C.cv=class extends _i{},C.cw=r2,C.cy=function(a){return a.message===Ce},C.cz=me,C.d=Le,C.e=Ht,C.f=a=>c(void 0,void 0,void 0,(function*(){if(a.byteLength===0)return createImageBitmap(new ImageData(1,1));const t=new Blob([new Uint8Array(a)],{type:"image/png"});try{return createImageBitmap(t)}catch(r){throw new Error(`Could not load image because of ${r.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}})),C.g=ie,C.h=a=>new Promise(((t,r)=>{const u=new Image;u.onload=()=>{t(u),URL.revokeObjectURL(u.src),u.onload=null,window.requestAnimationFrame((()=>{u.src=Do}))},u.onerror=()=>r(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const p=new Blob([new Uint8Array(a)],{type:"image/png"});u.src=a.byteLength?URL.createObjectURL(p):Do})),C.i=Ba,C.j=(a,t)=>De(Ht(a,{type:"json"}),t),C.k=Pt,C.l=Qe,C.m=De,C.n=(a,t)=>De(Ht(a,{type:"arrayBuffer"}),t),C.o=function(a){return new ra(a).readFields(r1,[])},C.p=$0,C.q=Qh,C.r=ci,C.s=Ji,C.t=Nu,C.u=ln,C.v=Ie,C.w=si,C.x=ym,C.y=Ko,C.z=xa})),w("worker",["./shared"],(function(C){class c{constructor(Q,W){this.keyCache={},Q&&this.replace(Q,W)}replace(Q,W){this._layerConfigs={},this._layers={},this.update(Q,[],W)}update(Q,W,ie){for(const me of Q){this._layerConfigs[me.id]=me;const Te=this._layers[me.id]=C.bJ(me,ie);Te._featureFilter=C.aa(Te.filter,ie),this.keyCache[me.id]&&delete this.keyCache[me.id]}for(const me of W)delete this.keyCache[me],delete this._layerConfigs[me],delete this._layers[me];this.familiesBySource={};const he=C.cC(Object.values(this._layerConfigs),this.keyCache);for(const me of he){const Te=me.map((Pt=>this._layers[Pt.id])),De=Te[0];if(De.visibility==="none")continue;const Le=De.source||"";let Xe=this.familiesBySource[Le];Xe||(Xe=this.familiesBySource[Le]={});const ct=De.sourceLayer||"_geojsonTileLayer";let Qe=Xe[ct];Qe||(Qe=Xe[ct]=[]),Qe.push(Te)}}}class D{constructor(Q){const W={},ie=[];for(const De in Q){const Le=Q[De],Xe=W[De]={};for(const ct in Le){const Qe=Le[+ct];if(!Qe||Qe.bitmap.width===0||Qe.bitmap.height===0)continue;const Pt={x:0,y:0,w:Qe.bitmap.width+2,h:Qe.bitmap.height+2};ie.push(Pt),Xe[ct]={rect:Pt,metrics:Qe.metrics}}}const{w:he,h:me}=C.p(ie),Te=new C.q({width:he||1,height:me||1});for(const De in Q){const Le=Q[De];for(const Xe in Le){const ct=Le[+Xe];if(!ct||ct.bitmap.width===0||ct.bitmap.height===0)continue;const Qe=W[De][Xe].rect;C.q.copy(ct.bitmap,Te,{x:0,y:0},{x:Qe.x+1,y:Qe.y+1},ct.bitmap)}}this.image=Te,this.positions=W}}C.cD("GlyphAtlas",D);class B{constructor(Q){this.tileID=new C.Z(Q.tileID.overscaledZ,Q.tileID.wrap,Q.tileID.canonical.z,Q.tileID.canonical.x,Q.tileID.canonical.y),this.uid=Q.uid,this.zoom=Q.zoom,this.pixelRatio=Q.pixelRatio,this.tileSize=Q.tileSize,this.source=Q.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=Q.showCollisionBoxes,this.collectResourceTiming=!!Q.collectResourceTiming,this.returnDependencies=!!Q.returnDependencies,this.promoteId=Q.promoteId,this.inFlightDependencies=[]}parse(Q,W,ie,he,me){return C._(this,void 0,void 0,(function*(){this.status="parsing",this.data=Q,this.collisionBoxArray=new C.a8;const Te=new C.cE(Object.keys(Q.layers).sort()),De=new C.cF(this.tileID,this.promoteId);De.bucketLayerIDs=[];const Le={},Xe={featureIndex:De,iconDependencies:{},patternDependencies:{},glyphDependencies:{},dashDependencies:{},availableImages:ie,subdivisionGranularity:me},ct=W.familiesBySource[this.source];for(const On in ct){const rt=Q.layers[On];if(!rt)continue;rt.version===1&&C.w(`Vector tile source "${this.source}" layer "${On}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const is=Te.encode(On),Yr=[];for(let qi=0;qi<rt.length;qi++){const An=rt.feature(qi),ut=De.getId(An,On);Yr.push({feature:An,id:ut,index:qi,sourceLayerIndex:is})}for(const qi of ct[On]){const An=qi[0];An.source!==this.source&&C.w(`layer.source = ${An.source} does not equal this.source = ${this.source}`),An.minzoom&&this.zoom<Math.floor(An.minzoom)||An.maxzoom&&this.zoom>=An.maxzoom||An.visibility!=="none"&&(Z(qi,this.zoom,ie),(Le[An.id]=An.createBucket({index:De.bucketLayerIDs.length,layers:qi,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:is,sourceID:this.source})).populate(Yr,Xe,this.tileID.canonical),De.bucketLayerIDs.push(qi.map((ut=>ut.id))))}}const Qe=C.bO(Xe.glyphDependencies,(On=>Object.keys(On).map(Number)));this.inFlightDependencies.forEach((On=>On==null?void 0:On.abort())),this.inFlightDependencies=[];let Pt=Promise.resolve({});if(Object.keys(Qe).length){const On=new AbortController;this.inFlightDependencies.push(On),Pt=he.sendAsync({type:"GG",data:{stacks:Qe,source:this.source,tileID:this.tileID,type:"glyphs"}},On)}const Ut=Object.keys(Xe.iconDependencies);let Ie=Promise.resolve({});if(Ut.length){const On=new AbortController;this.inFlightDependencies.push(On),Ie=he.sendAsync({type:"GI",data:{icons:Ut,source:this.source,tileID:this.tileID,type:"icons"}},On)}const mn=Object.keys(Xe.patternDependencies);let En=Promise.resolve({});if(mn.length){const On=new AbortController;this.inFlightDependencies.push(On),En=he.sendAsync({type:"GI",data:{icons:mn,source:this.source,tileID:this.tileID,type:"patterns"}},On)}const Dt=Xe.dashDependencies;let Sn=Promise.resolve({});if(Object.keys(Dt).length){const On=new AbortController;this.inFlightDependencies.push(On),Sn=he.sendAsync({type:"GDA",data:{dashes:Dt}},On)}const[Ni,Ai,Zi,ur]=yield Promise.all([Pt,Ie,En,Sn]),Kn=new D(Ni),Gi=new C.cG(Ai,Zi);for(const On in Le){const rt=Le[On];rt instanceof C.a9?(Z(rt.layers,this.zoom,ie),C.cH({bucket:rt,glyphMap:Ni,glyphPositions:Kn.positions,imageMap:Ai,imagePositions:Gi.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical,subdivisionGranularity:Xe.subdivisionGranularity})):rt.hasDependencies&&(rt instanceof C.cI||rt instanceof C.cJ||rt instanceof C.cK)&&(Z(rt.layers,this.zoom,ie),rt.addFeatures(Xe,this.tileID.canonical,Gi.patternPositions,ur))}return this.status="done",{buckets:Object.values(Le).filter((On=>!On.isEmpty())),featureIndex:De,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Kn.image,imageAtlas:Gi,dashPositions:ur,glyphMap:this.returnDependencies?Ni:null,iconMap:this.returnDependencies?Ai:null,glyphPositions:this.returnDependencies?Kn.positions:null}}))}}function Z(Ce,Q,W){const ie=new C.F(Q);for(const he of Ce)he.recalculate(ie,W)}class X{constructor(Q,W,ie){this.actor=Q,this.layerIndex=W,this.availableImages=ie,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(Q,W){return C._(this,void 0,void 0,(function*(){const ie=yield C.n(Q.request,W);try{return{vectorTile:new C.cL(new C.cM(ie.data)),rawData:ie.data,cacheControl:ie.cacheControl,expires:ie.expires}}catch(he){const me=new Uint8Array(ie.data);let Te=`Unable to parse the tile at ${Q.request.url}, `;throw Te+=me[0]===31&&me[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${he.message}`,new Error(Te)}}))}loadTile(Q){return C._(this,void 0,void 0,(function*(){const W=Q.uid,ie=!!(Q&&Q.request&&Q.request.collectResourceTiming)&&new C.cN(Q.request),he=new B(Q);this.loading[W]=he;const me=new AbortController;he.abort=me;try{const Te=yield this.loadVectorTile(Q,me);if(delete this.loading[W],!Te)return null;const De=Te.rawData,Le={};Te.expires&&(Le.expires=Te.expires),Te.cacheControl&&(Le.cacheControl=Te.cacheControl);const Xe={};if(ie){const Qe=ie.finish();Qe&&(Xe.resourceTiming=JSON.parse(JSON.stringify(Qe)))}he.vectorTile=Te.vectorTile;const ct=he.parse(Te.vectorTile,this.layerIndex,this.availableImages,this.actor,Q.subdivisionGranularity);this.loaded[W]=he,this.fetching[W]={rawTileData:De,cacheControl:Le,resourceTiming:Xe};try{const Qe=yield ct;return C.e({rawTileData:De.slice(0)},Qe,Le,Xe)}finally{delete this.fetching[W]}}catch(Te){throw delete this.loading[W],he.status="done",this.loaded[W]=he,Te}}))}reloadTile(Q){return C._(this,void 0,void 0,(function*(){const W=Q.uid;if(!this.loaded||!this.loaded[W])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const ie=this.loaded[W];if(ie.showCollisionBoxes=Q.showCollisionBoxes,ie.status==="parsing"){const he=yield ie.parse(ie.vectorTile,this.layerIndex,this.availableImages,this.actor,Q.subdivisionGranularity);let me;if(this.fetching[W]){const{rawTileData:Te,cacheControl:De,resourceTiming:Le}=this.fetching[W];delete this.fetching[W],me=C.e({rawTileData:Te.slice(0)},he,De,Le)}else me=he;return me}if(ie.status==="done"&&ie.vectorTile)return ie.parse(ie.vectorTile,this.layerIndex,this.availableImages,this.actor,Q.subdivisionGranularity)}))}abortTile(Q){return C._(this,void 0,void 0,(function*(){const W=this.loading,ie=Q.uid;W&&W[ie]&&W[ie].abort&&(W[ie].abort.abort(),delete W[ie])}))}removeTile(Q){return C._(this,void 0,void 0,(function*(){this.loaded&&this.loaded[Q.uid]&&delete this.loaded[Q.uid]}))}}class Y{constructor(){this.loaded={}}loadTile(Q){return C._(this,void 0,void 0,(function*(){const{uid:W,encoding:ie,rawImageData:he,redFactor:me,greenFactor:Te,blueFactor:De,baseShift:Le}=Q,Xe=he.width+2,ct=he.height+2,Qe=C.b(he)?new C.R({width:Xe,height:ct},yield C.cO(he,-1,-1,Xe,ct)):he,Pt=new C.cP(W,Qe,ie,me,Te,De,Le);return this.loaded=this.loaded||{},this.loaded[W]=Pt,Pt}))}removeTile(Q){const W=this.loaded,ie=Q.uid;W&&W[ie]&&delete W[ie]}}var U,oe,ge=(function(){if(oe)return U;function Ce(W,ie){if(W.length!==0){Q(W[0],ie);for(var he=1;he<W.length;he++)Q(W[he],!ie)}}function Q(W,ie){for(var he=0,me=0,Te=0,De=W.length,Le=De-1;Te<De;Le=Te++){var Xe=(W[Te][0]-W[Le][0])*(W[Le][1]+W[Te][1]),ct=he+Xe;me+=Math.abs(he)>=Math.abs(Xe)?he-ct+Xe:Xe-ct+he,he=ct}he+me>=0!=!!ie&&W.reverse()}return oe=1,U=function W(ie,he){var me,Te=ie&&ie.type;if(Te==="FeatureCollection")for(me=0;me<ie.features.length;me++)W(ie.features[me],he);else if(Te==="GeometryCollection")for(me=0;me<ie.geometries.length;me++)W(ie.geometries[me],he);else if(Te==="Feature")W(ie.geometry,he);else if(Te==="Polygon")Ce(ie.coordinates,he);else if(Te==="MultiPolygon")for(me=0;me<ie.coordinates.length;me++)Ce(ie.coordinates[me],he);return ie}})(),ye=C.cQ(ge);class Se extends C.cS{constructor(Q,W){super(new C.cM,0,W,[],[]),this.feature=Q,this.type=Q.type,this.properties=Q.tags?Q.tags:{},"id"in Q&&(typeof Q.id=="string"?this.id=parseInt(Q.id,10):typeof Q.id!="number"||isNaN(Q.id)||(this.id=Q.id))}loadGeometry(){const Q=[],W=this.feature.type===1?[this.feature.geometry]:this.feature.geometry;for(const ie of W){const he=[];for(const me of ie)he.push(new C.P(me[0],me[1]));Q.push(he)}return Q}}class je extends C.cR{constructor(Q,W){super(new C.cM),this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.version=W?W.version:1,this.extent=W?W.extent:4096,this.length=Q.length,this.features=Q}feature(Q){return new Se(this.features[Q],this.extent)}}function Pe(Ce,Q){Q.writeVarintField(15,Ce.version||1),Q.writeStringField(1,Ce.name||""),Q.writeVarintField(5,Ce.extent||4096);const W={keys:[],values:[],keycache:{},valuecache:{}};for(let me=0;me<Ce.length;me++)W.feature=Ce.feature(me),Q.writeMessage(2,Oe,W);const ie=W.keys;for(const me of ie)Q.writeStringField(3,me);const he=W.values;for(const me of he)Q.writeMessage(4,Gt,me)}function Oe(Ce,Q){if(!Ce.feature)return;const W=Ce.feature;W.id!==void 0&&Q.writeVarintField(1,W.id),Q.writeMessage(2,Je,Ce),Q.writeVarintField(3,W.type),Q.writeMessage(4,Rt,W)}function Je(Ce,Q){var W;for(const ie in(W=Ce.feature)==null?void 0:W.properties){let he=Ce.feature.properties[ie],me=Ce.keycache[ie];if(he===null)continue;me===void 0&&(Ce.keys.push(ie),me=Ce.keys.length-1,Ce.keycache[ie]=me),Q.writeVarint(me),typeof he!="string"&&typeof he!="boolean"&&typeof he!="number"&&(he=JSON.stringify(he));const Te=typeof he+":"+he;let De=Ce.valuecache[Te];De===void 0&&(Ce.values.push(he),De=Ce.values.length-1,Ce.valuecache[Te]=De),Q.writeVarint(De)}}function et(Ce,Q){return(Q<<3)+(7&Ce)}function ot(Ce){return Ce<<1^Ce>>31}function Rt(Ce,Q){const W=Ce.loadGeometry(),ie=Ce.type;let he=0,me=0;for(const Te of W){let De=1;ie===1&&(De=Te.length),Q.writeVarint(et(1,De));const Le=ie===3?Te.length-1:Te.length;for(let Xe=0;Xe<Le;Xe++){Xe===1&&ie!==1&&Q.writeVarint(et(2,Le-1));const ct=Te[Xe].x-he,Qe=Te[Xe].y-me;Q.writeVarint(ot(ct)),Q.writeVarint(ot(Qe)),he+=ct,me+=Qe}Ce.type===3&&Q.writeVarint(et(7,1))}}function Gt(Ce,Q){const W=typeof Ce;W==="string"?Q.writeStringField(1,Ce):W==="boolean"?Q.writeBooleanField(7,Ce):W==="number"&&(Ce%1!=0?Q.writeDoubleField(3,Ce):Ce<0?Q.writeSVarintField(6,Ce):Q.writeVarintField(5,Ce))}const Tt={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:Ce=>Ce},Ot=Math.fround||(At=new Float32Array(1),Ce=>(At[0]=+Ce,At[0]));var At;class Qt{constructor(Q){this.options=Object.assign(Object.create(Tt),Q),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(Q){const{log:W,minZoom:ie,maxZoom:he}=this.options;W&&console.time("total time");const me=`prepare ${Q.length} points`;W&&console.time(me),this.points=Q;const Te=[];for(let Le=0;Le<Q.length;Le++){const Xe=Q[Le];if(!Xe.geometry)continue;const[ct,Qe]=Xe.geometry.coordinates,Pt=Ot($e(ct)),Ut=Ot(ft(Qe));Te.push(Pt,Ut,1/0,Le,-1,1),this.options.reduce&&Te.push(0)}let De=this.trees[he+1]=this._createTree(Te);W&&console.timeEnd(me);for(let Le=he;Le>=ie;Le--){const Xe=+Date.now();De=this.trees[Le]=this._createTree(this._cluster(De,Le)),W&&console.log("z%d: %d clusters in %dms",Le,De.numItems,+Date.now()-Xe)}return W&&console.timeEnd("total time"),this}getClusters(Q,W){let ie=((Q[0]+180)%360+360)%360-180;const he=Math.max(-90,Math.min(90,Q[1]));let me=Q[2]===180?180:((Q[2]+180)%360+360)%360-180;const Te=Math.max(-90,Math.min(90,Q[3]));if(Q[2]-Q[0]>=360)ie=-180,me=180;else if(ie>me){const Qe=this.getClusters([ie,he,180,Te],W),Pt=this.getClusters([-180,he,me,Te],W);return Qe.concat(Pt)}const De=this.trees[this._limitZoom(W)],Le=De.range($e(ie),ft(Te),$e(me),ft(he)),Xe=De.data,ct=[];for(const Qe of Le){const Pt=this.stride*Qe;ct.push(Xe[Pt+5]>1?sn(Xe,Pt,this.clusterProps):this.points[Xe[Pt+3]])}return ct}getChildren(Q){const W=this._getOriginId(Q),ie=this._getOriginZoom(Q),he="No cluster with the specified id.",me=this.trees[ie];if(!me)throw new Error(he);const Te=me.data;if(W*this.stride>=Te.length)throw new Error(he);const De=this.options.radius/(this.options.extent*Math.pow(2,ie-1)),Le=me.within(Te[W*this.stride],Te[W*this.stride+1],De),Xe=[];for(const ct of Le){const Qe=ct*this.stride;Te[Qe+4]===Q&&Xe.push(Te[Qe+5]>1?sn(Te,Qe,this.clusterProps):this.points[Te[Qe+3]])}if(Xe.length===0)throw new Error(he);return Xe}getLeaves(Q,W,ie){const he=[];return this._appendLeaves(he,Q,W=W||10,ie=ie||0,0),he}getTile(Q,W,ie){const he=this.trees[this._limitZoom(Q)],me=Math.pow(2,Q),{extent:Te,radius:De}=this.options,Le=De/Te,Xe=(ie-Le)/me,ct=(ie+1+Le)/me,Qe={features:[]};return this._addTileFeatures(he.range((W-Le)/me,Xe,(W+1+Le)/me,ct),he.data,W,ie,me,Qe),W===0&&this._addTileFeatures(he.range(1-Le/me,Xe,1,ct),he.data,me,ie,me,Qe),W===me-1&&this._addTileFeatures(he.range(0,Xe,Le/me,ct),he.data,-1,ie,me,Qe),Qe.features.length?Qe:null}getClusterExpansionZoom(Q){let W=this._getOriginZoom(Q)-1;for(;W<=this.options.maxZoom;){const ie=this.getChildren(Q);if(W++,ie.length!==1)break;Q=ie[0].properties.cluster_id}return W}_appendLeaves(Q,W,ie,he,me){const Te=this.getChildren(W);for(const De of Te){const Le=De.properties;if(Le&&Le.cluster?me+Le.point_count<=he?me+=Le.point_count:me=this._appendLeaves(Q,Le.cluster_id,ie,he,me):me<he?me++:Q.push(De),Q.length===ie)break}return me}_createTree(Q){const W=new C.aI(Q.length/this.stride|0,this.options.nodeSize,Float32Array);for(let ie=0;ie<Q.length;ie+=this.stride)W.add(Q[ie],Q[ie+1]);return W.finish(),W.data=Q,W}_addTileFeatures(Q,W,ie,he,me,Te){for(const De of Q){const Le=De*this.stride,Xe=W[Le+5]>1;let ct,Qe,Pt;if(Xe)ct=qt(W,Le,this.clusterProps),Qe=W[Le],Pt=W[Le+1];else{const mn=this.points[W[Le+3]];ct=mn.properties;const[En,Dt]=mn.geometry.coordinates;Qe=$e(En),Pt=ft(Dt)}const Ut={type:1,geometry:[[Math.round(this.options.extent*(Qe*me-ie)),Math.round(this.options.extent*(Pt*me-he))]],tags:ct};let Ie;Ie=Xe||this.options.generateId?W[Le+3]:this.points[W[Le+3]].id,Ie!==void 0&&(Ut.id=Ie),Te.features.push(Ut)}}_limitZoom(Q){return Math.max(this.options.minZoom,Math.min(Math.floor(+Q),this.options.maxZoom+1))}_cluster(Q,W){const{radius:ie,extent:he,reduce:me,minPoints:Te}=this.options,De=ie/(he*Math.pow(2,W)),Le=Q.data,Xe=[],ct=this.stride;for(let Qe=0;Qe<Le.length;Qe+=ct){if(Le[Qe+2]<=W)continue;Le[Qe+2]=W;const Pt=Le[Qe],Ut=Le[Qe+1],Ie=Q.within(Le[Qe],Le[Qe+1],De),mn=Le[Qe+5];let En=mn;for(const Dt of Ie){const Sn=Dt*ct;Le[Sn+2]>W&&(En+=Le[Sn+5])}if(En>mn&&En>=Te){let Dt,Sn=Pt*mn,Ni=Ut*mn,Ai=-1;const Zi=(Qe/ct<<5)+(W+1)+this.points.length;for(const ur of Ie){const Kn=ur*ct;if(Le[Kn+2]<=W)continue;Le[Kn+2]=W;const Gi=Le[Kn+5];Sn+=Le[Kn]*Gi,Ni+=Le[Kn+1]*Gi,Le[Kn+4]=Zi,me&&(Dt||(Dt=this._map(Le,Qe,!0),Ai=this.clusterProps.length,this.clusterProps.push(Dt)),me(Dt,this._map(Le,Kn)))}Le[Qe+4]=Zi,Xe.push(Sn/En,Ni/En,1/0,Zi,-1,En),me&&Xe.push(Ai)}else{for(let Dt=0;Dt<ct;Dt++)Xe.push(Le[Qe+Dt]);if(En>1)for(const Dt of Ie){const Sn=Dt*ct;if(!(Le[Sn+2]<=W)){Le[Sn+2]=W;for(let Ni=0;Ni<ct;Ni++)Xe.push(Le[Sn+Ni])}}}}return Xe}_getOriginId(Q){return Q-this.points.length>>5}_getOriginZoom(Q){return(Q-this.points.length)%32}_map(Q,W,ie){if(Q[W+5]>1){const Te=this.clusterProps[Q[W+6]];return ie?Object.assign({},Te):Te}const he=this.points[Q[W+3]].properties,me=this.options.map(he);return ie&&me===he?Object.assign({},me):me}}function sn(Ce,Q,W){return{type:"Feature",id:Ce[Q+3],properties:qt(Ce,Q,W),geometry:{type:"Point",coordinates:[(ie=Ce[Q],360*(ie-.5)),wt(Ce[Q+1])]}};var ie}function qt(Ce,Q,W){const ie=Ce[Q+5],he=ie>=1e4?`${Math.round(ie/1e3)}k`:ie>=1e3?Math.round(ie/100)/10+"k":ie,me=Ce[Q+6],Te=me===-1?{}:Object.assign({},W[me]);return Object.assign(Te,{cluster:!0,cluster_id:Ce[Q+3],point_count:ie,point_count_abbreviated:he})}function $e(Ce){return Ce/360+.5}function ft(Ce){const Q=Math.sin(Ce*Math.PI/180),W=.5-.25*Math.log((1+Q)/(1-Q))/Math.PI;return W<0?0:W>1?1:W}function wt(Ce){const Q=(180-360*Ce)*Math.PI/180;return 360*Math.atan(Math.exp(Q))/Math.PI-90}function St(Ce,Q,W,ie){let he=ie;const me=Q+(W-Q>>1);let Te,De=W-Q;const Le=Ce[Q],Xe=Ce[Q+1],ct=Ce[W],Qe=Ce[W+1];for(let Pt=Q+3;Pt<W;Pt+=3){const Ut=Zt(Ce[Pt],Ce[Pt+1],Le,Xe,ct,Qe);if(Ut>he)Te=Pt,he=Ut;else if(Ut===he){const Ie=Math.abs(Pt-me);Ie<De&&(Te=Pt,De=Ie)}}he>ie&&(Te-Q>3&&St(Ce,Q,Te,ie),Ce[Te+2]=he,W-Te>3&&St(Ce,Te,W,ie))}function Zt(Ce,Q,W,ie,he,me){let Te=he-W,De=me-ie;if(Te!==0||De!==0){const Le=((Ce-W)*Te+(Q-ie)*De)/(Te*Te+De*De);Le>1?(W=he,ie=me):Le>0&&(W+=Te*Le,ie+=De*Le)}return Te=Ce-W,De=Q-ie,Te*Te+De*De}function we(Ce,Q,W,ie){const he={id:Ce??null,type:Q,geometry:W,tags:ie,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(Q==="Point"||Q==="MultiPoint"||Q==="LineString")Be(he,W);else if(Q==="Polygon")Be(he,W[0]);else if(Q==="MultiLineString")for(const me of W)Be(he,me);else if(Q==="MultiPolygon")for(const me of W)Be(he,me[0]);return he}function Be(Ce,Q){for(let W=0;W<Q.length;W+=3)Ce.minX=Math.min(Ce.minX,Q[W]),Ce.minY=Math.min(Ce.minY,Q[W+1]),Ce.maxX=Math.max(Ce.maxX,Q[W]),Ce.maxY=Math.max(Ce.maxY,Q[W+1])}function pt(Ce,Q,W,ie){if(!Q.geometry)return;const he=Q.geometry.coordinates;if(he&&he.length===0)return;const me=Q.geometry.type,Te=Math.pow(W.tolerance/((1<<W.maxZoom)*W.extent),2);let De=[],Le=Q.id;if(W.promoteId?Le=Q.properties[W.promoteId]:W.generateId&&(Le=ie||0),me==="Point")xt(he,De);else if(me==="MultiPoint")for(const Xe of he)xt(Xe,De);else if(me==="LineString")Bt(he,De,Te,!1);else if(me==="MultiLineString"){if(W.lineMetrics){for(const Xe of he)De=[],Bt(Xe,De,Te,!1),Ce.push(we(Le,"LineString",De,Q.properties));return}Lt(he,De,Te,!1)}else if(me==="Polygon")Lt(he,De,Te,!0);else{if(me!=="MultiPolygon"){if(me==="GeometryCollection"){for(const Xe of Q.geometry.geometries)pt(Ce,{id:Le,geometry:Xe,properties:Q.properties},W,ie);return}throw new Error("Input data is not a valid GeoJSON object.")}for(const Xe of he){const ct=[];Lt(Xe,ct,Te,!0),De.push(ct)}}Ce.push(we(Le,me,De,Q.properties))}function xt(Ce,Q){Q.push(Wt(Ce[0]),Ht(Ce[1]),0)}function Bt(Ce,Q,W,ie){let he,me,Te=0;for(let Le=0;Le<Ce.length;Le++){const Xe=Wt(Ce[Le][0]),ct=Ht(Ce[Le][1]);Q.push(Xe,ct,0),Le>0&&(Te+=ie?(he*ct-Xe*me)/2:Math.sqrt(Math.pow(Xe-he,2)+Math.pow(ct-me,2))),he=Xe,me=ct}const De=Q.length-3;Q[2]=1,St(Q,0,De,W),Q[De+2]=1,Q.size=Math.abs(Te),Q.start=0,Q.end=Q.size}function Lt(Ce,Q,W,ie){for(let he=0;he<Ce.length;he++){const me=[];Bt(Ce[he],me,W,ie),Q.push(me)}}function Wt(Ce){return Ce/360+.5}function Ht(Ce){const Q=Math.sin(Ce*Math.PI/180),W=.5-.25*Math.log((1+Q)/(1-Q))/Math.PI;return W<0?0:W>1?1:W}function xn(Ce,Q,W,ie,he,me,Te,De){if(ie/=Q,me>=(W/=Q)&&Te<ie)return Ce;if(Te<W||me>=ie)return null;const Le=[];for(const Xe of Ce){const ct=Xe.geometry;let Qe=Xe.type;const Pt=he===0?Xe.minX:Xe.minY,Ut=he===0?Xe.maxX:Xe.maxY;if(Pt>=W&&Ut<ie){Le.push(Xe);continue}if(Ut<W||Pt>=ie)continue;let Ie=[];if(Qe==="Point"||Qe==="MultiPoint")ka(ct,Ie,W,ie,he);else if(Qe==="LineString")ai(ct,Ie,W,ie,he,!1,De.lineMetrics);else if(Qe==="MultiLineString")Mi(ct,Ie,W,ie,he,!1);else if(Qe==="Polygon")Mi(ct,Ie,W,ie,he,!0);else if(Qe==="MultiPolygon")for(const mn of ct){const En=[];Mi(mn,En,W,ie,he,!0),En.length&&Ie.push(En)}if(Ie.length){if(De.lineMetrics&&Qe==="LineString"){for(const mn of Ie)Le.push(we(Xe.id,Qe,mn,Xe.tags));continue}Qe!=="LineString"&&Qe!=="MultiLineString"||(Ie.length===1?(Qe="LineString",Ie=Ie[0]):Qe="MultiLineString"),Qe!=="Point"&&Qe!=="MultiPoint"||(Qe=Ie.length===3?"Point":"MultiPoint"),Le.push(we(Xe.id,Qe,Ie,Xe.tags))}}return Le.length?Le:null}function ka(Ce,Q,W,ie,he){for(let me=0;me<Ce.length;me+=3){const Te=Ce[me+he];Te>=W&&Te<=ie&&si(Q,Ce[me],Ce[me+1],Ce[me+2])}}function ai(Ce,Q,W,ie,he,me,Te){let De=kr(Ce);const Le=he===0?ca:Ba;let Xe,ct,Qe=Ce.start;for(let En=0;En<Ce.length-3;En+=3){const Dt=Ce[En],Sn=Ce[En+1],Ni=Ce[En+2],Ai=Ce[En+3],Zi=Ce[En+4],ur=he===0?Dt:Sn,Kn=he===0?Ai:Zi;let Gi=!1;Te&&(Xe=Math.sqrt(Math.pow(Dt-Ai,2)+Math.pow(Sn-Zi,2))),ur<W?Kn>W&&(ct=Le(De,Dt,Sn,Ai,Zi,W),Te&&(De.start=Qe+Xe*ct)):ur>ie?Kn<ie&&(ct=Le(De,Dt,Sn,Ai,Zi,ie),Te&&(De.start=Qe+Xe*ct)):si(De,Dt,Sn,Ni),Kn<W&&ur>=W&&(ct=Le(De,Dt,Sn,Ai,Zi,W),Gi=!0),Kn>ie&&ur<=ie&&(ct=Le(De,Dt,Sn,Ai,Zi,ie),Gi=!0),!me&&Gi&&(Te&&(De.end=Qe+Xe*ct),Q.push(De),De=kr(Ce)),Te&&(Qe+=Xe)}let Pt=Ce.length-3;const Ut=Ce[Pt],Ie=Ce[Pt+1],mn=he===0?Ut:Ie;mn>=W&&mn<=ie&&si(De,Ut,Ie,Ce[Pt+2]),Pt=De.length-3,me&&Pt>=3&&(De[Pt]!==De[0]||De[Pt+1]!==De[1])&&si(De,De[0],De[1],De[2]),De.length&&Q.push(De)}function kr(Ce){const Q=[];return Q.size=Ce.size,Q.start=Ce.start,Q.end=Ce.end,Q}function Mi(Ce,Q,W,ie,he,me){for(const Te of Ce)ai(Te,Q,W,ie,he,me,!1)}function si(Ce,Q,W,ie){Ce.push(Q,W,ie)}function ca(Ce,Q,W,ie,he,me){const Te=(me-Q)/(ie-Q);return si(Ce,me,W+(he-W)*Te,1),Te}function Ba(Ce,Q,W,ie,he,me){const Te=(me-W)/(he-W);return si(Ce,Q+(ie-Q)*Te,me,1),Te}function wl(Ce,Q){const W=[];for(let ie=0;ie<Ce.length;ie++){const he=Ce[ie],me=he.type;let Te;if(me==="Point"||me==="MultiPoint"||me==="LineString")Te=zo(he.geometry,Q);else if(me==="MultiLineString"||me==="Polygon"){Te=[];for(const De of he.geometry)Te.push(zo(De,Q))}else if(me==="MultiPolygon"){Te=[];for(const De of he.geometry){const Le=[];for(const Xe of De)Le.push(zo(Xe,Q));Te.push(Le)}}W.push(we(he.id,me,Te,he.tags))}return W}function zo(Ce,Q){const W=[];W.size=Ce.size,Ce.start!==void 0&&(W.start=Ce.start,W.end=Ce.end);for(let ie=0;ie<Ce.length;ie+=3)W.push(Ce[ie]+Q,Ce[ie+1],Ce[ie+2]);return W}function Br(Ce,Q){if(Ce.transformed)return Ce;const W=1<<Ce.z,ie=Ce.x,he=Ce.y;for(const me of Ce.features){const Te=me.geometry,De=me.type;if(me.geometry=[],De===1)for(let Le=0;Le<Te.length;Le+=2)me.geometry.push(Do(Te[Le],Te[Le+1],Q,W,ie,he));else for(let Le=0;Le<Te.length;Le++){const Xe=[];for(let ct=0;ct<Te[Le].length;ct+=2)Xe.push(Do(Te[Le][ct],Te[Le][ct+1],Q,W,ie,he));me.geometry.push(Xe)}}return Ce.transformed=!0,Ce}function Do(Ce,Q,W,ie,he,me){return[Math.round(W*(Ce*ie-he)),Math.round(W*(Q*ie-me))]}function Sl(Ce,Q,W,ie,he){const me=Q===he.maxZoom?0:he.tolerance/((1<<Q)*he.extent),Te={features:[],numPoints:0,numSimplified:0,numFeatures:Ce.length,source:null,x:W,y:ie,z:Q,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(const De of Ce)Oo(Te,De,me,he);return Te}function Oo(Ce,Q,W,ie){const he=Q.geometry,me=Q.type,Te=[];if(Ce.minX=Math.min(Ce.minX,Q.minX),Ce.minY=Math.min(Ce.minY,Q.minY),Ce.maxX=Math.max(Ce.maxX,Q.maxX),Ce.maxY=Math.max(Ce.maxY,Q.maxY),me==="Point"||me==="MultiPoint")for(let De=0;De<he.length;De+=3)Te.push(he[De],he[De+1]),Ce.numPoints++,Ce.numSimplified++;else if(me==="LineString")Ss(Te,he,Ce,W,!1,!1);else if(me==="MultiLineString"||me==="Polygon")for(let De=0;De<he.length;De++)Ss(Te,he[De],Ce,W,me==="Polygon",De===0);else if(me==="MultiPolygon")for(let De=0;De<he.length;De++){const Le=he[De];for(let Xe=0;Xe<Le.length;Xe++)Ss(Te,Le[Xe],Ce,W,!0,Xe===0)}if(Te.length){let De=Q.tags||null;if(me==="LineString"&&ie.lineMetrics){De={};for(const Xe in Q.tags)De[Xe]=Q.tags[Xe];De.mapbox_clip_start=he.start/he.size,De.mapbox_clip_end=he.end/he.size}const Le={geometry:Te,type:me==="Polygon"||me==="MultiPolygon"?3:me==="LineString"||me==="MultiLineString"?2:1,tags:De};Q.id!==null&&(Le.id=Q.id),Ce.features.push(Le)}}function Ss(Ce,Q,W,ie,he,me){const Te=ie*ie;if(ie>0&&Q.size<(he?Te:ie))return void(W.numPoints+=Q.length/3);const De=[];for(let Le=0;Le<Q.length;Le+=3)(ie===0||Q[Le+2]>Te)&&(W.numSimplified++,De.push(Q[Le],Q[Le+1])),W.numPoints++;he&&(function(Le,Xe){let ct=0;for(let Qe=0,Pt=Le.length,Ut=Pt-2;Qe<Pt;Ut=Qe,Qe+=2)ct+=(Le[Qe]-Le[Ut])*(Le[Qe+1]+Le[Ut+1]);if(ct>0===Xe)for(let Qe=0,Pt=Le.length;Qe<Pt/2;Qe+=2){const Ut=Le[Qe],Ie=Le[Qe+1];Le[Qe]=Le[Pt-2-Qe],Le[Qe+1]=Le[Pt-1-Qe],Le[Pt-2-Qe]=Ut,Le[Pt-1-Qe]=Ie}})(De,me),Ce.push(De)}const Ji={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0};class hu{constructor(Q,W){const ie=(W=this.options=(function(me,Te){for(const De in Te)me[De]=Te[De];return me})(Object.create(Ji),W)).debug;if(ie&&console.time("preprocess data"),W.maxZoom<0||W.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(W.promoteId&&W.generateId)throw new Error("promoteId and generateId cannot be used together.");let he=(function(me,Te){const De=[];if(me.type==="FeatureCollection")for(let Le=0;Le<me.features.length;Le++)pt(De,me.features[Le],Te,Le);else pt(De,me.type==="Feature"?me:{geometry:me},Te);return De})(Q,W);this.tiles={},this.tileCoords=[],ie&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",W.indexMaxZoom,W.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),he=(function(me,Te){const De=Te.buffer/Te.extent;let Le=me;const Xe=xn(me,1,-1-De,De,0,-1,2,Te),ct=xn(me,1,1-De,2+De,0,-1,2,Te);return(Xe||ct)&&(Le=xn(me,1,-De,1+De,0,-1,2,Te)||[],Xe&&(Le=wl(Xe,1).concat(Le)),ct&&(Le=Le.concat(wl(ct,-1)))),Le})(he,W),he.length&&this.splitTile(he,0,0,0),ie&&(he.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}splitTile(Q,W,ie,he,me,Te,De){const Le=[Q,W,ie,he],Xe=this.options,ct=Xe.debug;for(;Le.length;){he=Le.pop(),ie=Le.pop(),W=Le.pop(),Q=Le.pop();const Qe=1<<W,Pt=ua(W,ie,he);let Ut=this.tiles[Pt];if(!Ut&&(ct>1&&console.time("creation"),Ut=this.tiles[Pt]=Sl(Q,W,ie,he,Xe),this.tileCoords.push({z:W,x:ie,y:he}),ct)){ct>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",W,ie,he,Ut.numFeatures,Ut.numPoints,Ut.numSimplified),console.timeEnd("creation"));const Gi=`z${W}`;this.stats[Gi]=(this.stats[Gi]||0)+1,this.total++}if(Ut.source=Q,me==null){if(W===Xe.indexMaxZoom||Ut.numPoints<=Xe.indexMaxPoints)continue}else{if(W===Xe.maxZoom||W===me)continue;if(me!=null){const Gi=me-W;if(ie!==Te>>Gi||he!==De>>Gi)continue}}if(Ut.source=null,Q.length===0)continue;ct>1&&console.time("clipping");const Ie=.5*Xe.buffer/Xe.extent,mn=.5-Ie,En=.5+Ie,Dt=1+Ie;let Sn=null,Ni=null,Ai=null,Zi=null,ur=xn(Q,Qe,ie-Ie,ie+En,0,Ut.minX,Ut.maxX,Xe),Kn=xn(Q,Qe,ie+mn,ie+Dt,0,Ut.minX,Ut.maxX,Xe);Q=null,ur&&(Sn=xn(ur,Qe,he-Ie,he+En,1,Ut.minY,Ut.maxY,Xe),Ni=xn(ur,Qe,he+mn,he+Dt,1,Ut.minY,Ut.maxY,Xe),ur=null),Kn&&(Ai=xn(Kn,Qe,he-Ie,he+En,1,Ut.minY,Ut.maxY,Xe),Zi=xn(Kn,Qe,he+mn,he+Dt,1,Ut.minY,Ut.maxY,Xe),Kn=null),ct>1&&console.timeEnd("clipping"),Le.push(Sn||[],W+1,2*ie,2*he),Le.push(Ni||[],W+1,2*ie,2*he+1),Le.push(Ai||[],W+1,2*ie+1,2*he),Le.push(Zi||[],W+1,2*ie+1,2*he+1)}}getTile(Q,W,ie){Q=+Q,W=+W,ie=+ie;const he=this.options,{extent:me,debug:Te}=he;if(Q<0||Q>24)return null;const De=1<<Q,Le=ua(Q,W=W+De&De-1,ie);if(this.tiles[Le])return Br(this.tiles[Le],me);Te>1&&console.log("drilling down to z%d-%d-%d",Q,W,ie);let Xe,ct=Q,Qe=W,Pt=ie;for(;!Xe&&ct>0;)ct--,Qe>>=1,Pt>>=1,Xe=this.tiles[ua(ct,Qe,Pt)];return Xe&&Xe.source?(Te>1&&(console.log("found parent tile z%d-%d-%d",ct,Qe,Pt),console.time("drilling down")),this.splitTile(Xe.source,ct,Qe,Pt,Q,W,ie),Te>1&&console.timeEnd("drilling down"),this.tiles[Le]?Br(this.tiles[Le],me):null):null}}function ua(Ce,Q,W){return 32*((1<<Ce)*W+Q)+Ce}class Hs extends X{constructor(){super(...arguments),this._dataUpdateable=new Map}loadVectorTile(Q,W){return C._(this,void 0,void 0,(function*(){const ie=Q.tileID.canonical;if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");const he=this._geoJSONIndex.getTile(ie.z,ie.x,ie.y);if(!he)return null;const me=new je(he.features,{version:2,extent:C.$});let Te=(function(De){const Le=new C.cM;return(function(Xe,ct){for(const Qe in Xe.layers)ct.writeMessage(3,Pe,Xe.layers[Qe])})(De,Le),Le.finish()})(me);return Te.byteOffset===0&&Te.byteLength===Te.buffer.byteLength||(Te=new Uint8Array(Te)),{vectorTile:me,rawData:Te.buffer}}))}loadData(Q){return C._(this,void 0,void 0,(function*(){var W;(W=this._pendingRequest)===null||W===void 0||W.abort();const ie=!!(Q&&Q.request&&Q.request.collectResourceTiming)&&new C.cN(Q.request);this._pendingRequest=new AbortController;try{this._pendingData=this.loadAndProcessGeoJSON(Q,this._pendingRequest);const he=yield this._pendingData;this._geoJSONIndex=Q.cluster?new Qt((function({superclusterOptions:Te,clusterProperties:De}){if(!De||!Te)return Te;const Le={},Xe={},ct={accumulated:null,zoom:0},Qe={properties:null},Pt=Object.keys(De);for(const Ut of Pt){const[Ie,mn]=De[Ut],En=C.cT(mn),Dt=C.cT(typeof Ie=="string"?[Ie,["accumulated"],["get",Ut]]:Ie);Le[Ut]=En.value,Xe[Ut]=Dt.value}return Te.map=Ut=>{Qe.properties=Ut;const Ie={};for(const mn of Pt)Ie[mn]=Le[mn].evaluate(ct,Qe);return Ie},Te.reduce=(Ut,Ie)=>{Qe.properties=Ie;for(const mn of Pt)ct.accumulated=Ut[mn],Ut[mn]=Xe[mn].evaluate(ct,Qe)},Te})(Q)).load(he.features):(function(Te,De){return new hu(Te,De)})(he,Q.geojsonVtOptions),this.loaded={};const me={data:he};if(ie){const Te=ie.finish();Te&&(me.resourceTiming={},me.resourceTiming[Q.source]=JSON.parse(JSON.stringify(Te)))}return me}catch(he){if(delete this._pendingRequest,C.cy(he))return{abandoned:!0};throw he}}))}getData(){return C._(this,void 0,void 0,(function*(){return this._pendingData}))}reloadTile(Q){const W=this.loaded;return W&&W[Q.uid]?super.reloadTile(Q):this.loadTile(Q)}loadAndProcessGeoJSON(Q,W){return C._(this,void 0,void 0,(function*(){let ie=yield this.loadGeoJSON(Q,W);if(delete this._pendingRequest,typeof ie!="object")throw new Error(`Input data given to '${Q.source}' is not a valid GeoJSON object.`);if(ye(ie,!0),Q.filter){const he=C.cT(Q.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(he.result==="error")throw new Error(he.value.map((Te=>`${Te.key}: ${Te.message}`)).join(", "));ie={type:"FeatureCollection",features:ie.features.filter((Te=>he.value.evaluate({zoom:0},Te)))}}return ie}))}loadGeoJSON(Q,W){return C._(this,void 0,void 0,(function*(){const{promoteId:ie}=Q;if(Q.request){const he=yield C.j(Q.request,W);return this._dataUpdateable=C.cV(he.data,ie)?C.cU(he.data,ie):void 0,he.data}if(typeof Q.data=="string")try{const he=JSON.parse(Q.data);return this._dataUpdateable=C.cV(he,ie)?C.cU(he,ie):void 0,he}catch{throw new Error(`Input data given to '${Q.source}' is not a valid GeoJSON object.`)}if(!Q.dataDiff)throw new Error(`Input data given to '${Q.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${Q.source}`);return C.cW(this._dataUpdateable,Q.dataDiff,ie),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}}))}removeSource(Q){return C._(this,void 0,void 0,(function*(){this._pendingRequest&&this._pendingRequest.abort()}))}getClusterExpansionZoom(Q){return this._geoJSONIndex.getClusterExpansionZoom(Q.clusterId)}getClusterChildren(Q){return this._geoJSONIndex.getChildren(Q.clusterId)}getClusterLeaves(Q){return this._geoJSONIndex.getLeaves(Q.clusterId,Q.limit,Q.offset)}}class Fr{constructor(Q){this.self=Q,this.actor=new C.J(Q),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.globalStates=new Map,this.self.registerWorkerSource=(W,ie)=>{if(this.externalWorkerSourceTypes[W])throw new Error(`Worker source with name "${W}" already registered.`);this.externalWorkerSourceTypes[W]=ie},this.self.addProtocol=C.cA,this.self.removeProtocol=C.cB,this.self.registerRTLTextPlugin=W=>{C.cX.setMethods(W)},this.actor.registerMessageHandler("LDT",((W,ie)=>this._getDEMWorkerSource(W,ie.source).loadTile(ie))),this.actor.registerMessageHandler("RDT",((W,ie)=>C._(this,void 0,void 0,(function*(){this._getDEMWorkerSource(W,ie.source).removeTile(ie)})))),this.actor.registerMessageHandler("GCEZ",((W,ie)=>C._(this,void 0,void 0,(function*(){return this._getWorkerSource(W,ie.type,ie.source).getClusterExpansionZoom(ie)})))),this.actor.registerMessageHandler("GCC",((W,ie)=>C._(this,void 0,void 0,(function*(){return this._getWorkerSource(W,ie.type,ie.source).getClusterChildren(ie)})))),this.actor.registerMessageHandler("GCL",((W,ie)=>C._(this,void 0,void 0,(function*(){return this._getWorkerSource(W,ie.type,ie.source).getClusterLeaves(ie)})))),this.actor.registerMessageHandler("LD",((W,ie)=>this._getWorkerSource(W,ie.type,ie.source).loadData(ie))),this.actor.registerMessageHandler("GD",((W,ie)=>this._getWorkerSource(W,ie.type,ie.source).getData())),this.actor.registerMessageHandler("LT",((W,ie)=>this._getWorkerSource(W,ie.type,ie.source).loadTile(ie))),this.actor.registerMessageHandler("RT",((W,ie)=>this._getWorkerSource(W,ie.type,ie.source).reloadTile(ie))),this.actor.registerMessageHandler("AT",((W,ie)=>this._getWorkerSource(W,ie.type,ie.source).abortTile(ie))),this.actor.registerMessageHandler("RMT",((W,ie)=>this._getWorkerSource(W,ie.type,ie.source).removeTile(ie))),this.actor.registerMessageHandler("RS",((W,ie)=>C._(this,void 0,void 0,(function*(){if(!this.workerSources[W]||!this.workerSources[W][ie.type]||!this.workerSources[W][ie.type][ie.source])return;const he=this.workerSources[W][ie.type][ie.source];delete this.workerSources[W][ie.type][ie.source],he.removeSource!==void 0&&he.removeSource(ie)})))),this.actor.registerMessageHandler("RM",(W=>C._(this,void 0,void 0,(function*(){delete this.layerIndexes[W],delete this.availableImages[W],delete this.workerSources[W],delete this.demWorkerSources[W],this.globalStates.delete(W)})))),this.actor.registerMessageHandler("SR",((W,ie)=>C._(this,void 0,void 0,(function*(){this.referrer=ie})))),this.actor.registerMessageHandler("SRPS",((W,ie)=>this._syncRTLPluginState(W,ie))),this.actor.registerMessageHandler("IS",((W,ie)=>C._(this,void 0,void 0,(function*(){this.self.importScripts(ie)})))),this.actor.registerMessageHandler("SI",((W,ie)=>this._setImages(W,ie))),this.actor.registerMessageHandler("UL",((W,ie)=>C._(this,void 0,void 0,(function*(){this._getLayerIndex(W).update(ie.layers,ie.removedIds,this._getGlobalState(W))})))),this.actor.registerMessageHandler("UGS",((W,ie)=>C._(this,void 0,void 0,(function*(){const he=this._getGlobalState(W);for(const me in ie)he[me]=ie[me]})))),this.actor.registerMessageHandler("SL",((W,ie)=>C._(this,void 0,void 0,(function*(){this._getLayerIndex(W).replace(ie,this._getGlobalState(W))}))))}_getGlobalState(Q){let W=this.globalStates.get(Q);return W||(W={},this.globalStates.set(Q,W)),W}_setImages(Q,W){return C._(this,void 0,void 0,(function*(){this.availableImages[Q]=W;for(const ie in this.workerSources[Q]){const he=this.workerSources[Q][ie];for(const me in he)he[me].availableImages=W}}))}_syncRTLPluginState(Q,W){return C._(this,void 0,void 0,(function*(){return yield C.cX.syncState(W,this.self.importScripts)}))}_getAvailableImages(Q){let W=this.availableImages[Q];return W||(W=[]),W}_getLayerIndex(Q){let W=this.layerIndexes[Q];return W||(W=this.layerIndexes[Q]=new c),W}_getWorkerSource(Q,W,ie){if(this.workerSources[Q]||(this.workerSources[Q]={}),this.workerSources[Q][W]||(this.workerSources[Q][W]={}),!this.workerSources[Q][W][ie]){const he={sendAsync:(me,Te)=>(me.targetMapId=Q,this.actor.sendAsync(me,Te))};switch(W){case"vector":this.workerSources[Q][W][ie]=new X(he,this._getLayerIndex(Q),this._getAvailableImages(Q));break;case"geojson":this.workerSources[Q][W][ie]=new Hs(he,this._getLayerIndex(Q),this._getAvailableImages(Q));break;default:this.workerSources[Q][W][ie]=new this.externalWorkerSourceTypes[W](he,this._getLayerIndex(Q),this._getAvailableImages(Q))}}return this.workerSources[Q][W][ie]}_getDEMWorkerSource(Q,W){return this.demWorkerSources[Q]||(this.demWorkerSources[Q]={}),this.demWorkerSources[Q][W]||(this.demWorkerSources[Q][W]=new Y),this.demWorkerSources[Q][W]}}return C.i(self)&&(self.worker=new Fr(self)),Fr})),w("index",["exports","./shared"],(function(C,c){var D="5.9.0";function B(){var y=new c.A(4);return c.A!=Float32Array&&(y[1]=0,y[2]=0),y[0]=1,y[3]=1,y}let Z,X;const Y={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frame(y,e,s){const d=requestAnimationFrame((_=>{g(),e(_)})),{unsubscribe:g}=c.s(y.signal,"abort",(()=>{g(),cancelAnimationFrame(d),s(c.c())}),!1)},frameAsync(y){return new Promise(((e,s)=>{this.frame(y,e,s)}))},getImageData(y,e=0){return this.getImageCanvasContext(y).getImageData(-e,-e,y.width+2*e,y.height+2*e)},getImageCanvasContext(y){const e=window.document.createElement("canvas"),s=e.getContext("2d",{willReadFrequently:!0});if(!s)throw new Error("failed to create canvas 2d context");return e.width=y.width,e.height=y.height,s.drawImage(y,0,0,y.width,y.height),s},resolveURL:y=>(Z||(Z=document.createElement("a")),Z.href=y,Z.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(X==null&&(X=matchMedia("(prefers-reduced-motion: reduce)")),X.matches)}};class U{static testProp(e){if(!U.docStyle)return e[0];for(let s=0;s<e.length;s++)if(e[s]in U.docStyle)return e[s];return e[0]}static create(e,s,d){const g=window.document.createElement(e);return s!==void 0&&(g.className=s),d&&d.appendChild(g),g}static createNS(e,s){return window.document.createElementNS(e,s)}static disableDrag(){U.docStyle&&U.selectProp&&(U.userSelect=U.docStyle[U.selectProp],U.docStyle[U.selectProp]="none")}static enableDrag(){U.docStyle&&U.selectProp&&(U.docStyle[U.selectProp]=U.userSelect)}static setTransform(e,s){e.style[U.transformProp]=s}static addEventListener(e,s,d,g={}){e.addEventListener(s,d,"passive"in g?g:g.capture)}static removeEventListener(e,s,d,g={}){e.removeEventListener(s,d,"passive"in g?g:g.capture)}static suppressClickInternal(e){e.preventDefault(),e.stopPropagation(),window.removeEventListener("click",U.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",U.suppressClickInternal,!0),window.setTimeout((()=>{window.removeEventListener("click",U.suppressClickInternal,!0)}),0)}static getScale(e){const s=e.getBoundingClientRect();return{x:s.width/e.offsetWidth||1,y:s.height/e.offsetHeight||1,boundingClientRect:s}}static getPoint(e,s,d){const g=s.boundingClientRect;return new c.P((d.clientX-g.left)/s.x-e.clientLeft,(d.clientY-g.top)/s.y-e.clientTop)}static mousePos(e,s){const d=U.getScale(e);return U.getPoint(e,d,s)}static touchPos(e,s){const d=[],g=U.getScale(e);for(let _=0;_<s.length;_++)d.push(U.getPoint(e,g,s[_]));return d}static mouseButton(e){return e.button}static remove(e){e.parentNode&&e.parentNode.removeChild(e)}static sanitize(e){const s=new DOMParser().parseFromString(e,"text/html").body||document.createElement("body"),d=s.querySelectorAll("script");for(const g of d)g.remove();return U.clean(s),s.innerHTML}static isPossiblyDangerous(e,s){const d=s.replace(/\s+/g,"").toLowerCase();return!(!["src","href","xlink:href"].includes(e)||!d.includes("javascript:")&&!d.includes("data:"))||!!e.startsWith("on")||void 0}static clean(e){const s=e.children;for(const d of s)U.removeAttributes(d),U.clean(d)}static removeAttributes(e){for(const{name:s,value:d}of e.attributes)U.isPossiblyDangerous(s,d)&&e.removeAttribute(s)}}U.docStyle=typeof window<"u"&&window.document&&window.document.documentElement.style,U.selectProp=U.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),U.transformProp=U.testProp(["transform","WebkitTransform"]);const oe={supported:!1,testSupport:function(y){!Se&&ye&&(je?Pe(y):ge=y)}};let ge,ye,Se=!1,je=!1;function Pe(y){const e=y.createTexture();y.bindTexture(y.TEXTURE_2D,e);try{if(y.texImage2D(y.TEXTURE_2D,0,y.RGBA,y.RGBA,y.UNSIGNED_BYTE,ye),y.isContextLost())return;oe.supported=!0}catch{}y.deleteTexture(e),Se=!0}var Oe;typeof document<"u"&&(ye=document.createElement("img"),ye.onload=()=>{ge&&Pe(ge),ge=null,je=!0},ye.onerror=()=>{Se=!0,ge=null},ye.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),(function(y){let e,s,d,g;y.resetRequestQueue=()=>{e=[],s=0,d=0,g={}},y.addThrottleControl=P=>{const O=d++;return g[O]=P,O},y.removeThrottleControl=P=>{delete g[P],S()},y.getImage=(P,O,k=!0)=>new Promise((($,N)=>{oe.supported&&(P.headers||(P.headers={}),P.headers.accept="image/webp,*/*"),c.e(P,{type:"image"}),e.push({abortController:O,requestParameters:P,supportImageRefresh:k,state:"queued",onError:q=>{N(q)},onSuccess:q=>{$(q)}}),S()}));const _=P=>c._(this,void 0,void 0,(function*(){P.state="running";const{requestParameters:O,supportImageRefresh:k,onError:$,onSuccess:N,abortController:q}=P,K=k===!1&&!c.i(self)&&!c.g(O.url)&&(!O.headers||Object.keys(O.headers).reduce(((se,ce)=>se&&ce==="accept"),!0));s++;const re=K?L(O,q):c.m(O,q);try{const se=yield re;delete P.abortController,P.state="completed",se.data instanceof HTMLImageElement||c.b(se.data)?N(se):se.data&&N({data:yield(ae=se.data,typeof createImageBitmap=="function"?c.f(ae):c.h(ae)),cacheControl:se.cacheControl,expires:se.expires})}catch(se){delete P.abortController,$(se)}finally{s--,S()}var ae})),S=()=>{const P=(()=>{for(const O of Object.keys(g))if(g[O]())return!0;return!1})()?c.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:c.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let O=s;O<P&&e.length>0;O++){const k=e.shift();k.abortController.signal.aborted?O--:_(k)}},L=(P,O)=>new Promise(((k,$)=>{const N=new Image,q=P.url,K=P.credentials;K&&K==="include"?N.crossOrigin="use-credentials":(K&&K==="same-origin"||!c.d(q))&&(N.crossOrigin="anonymous"),O.signal.addEventListener("abort",(()=>{N.src="",$(c.c())})),N.fetchPriority="high",N.onload=()=>{N.onerror=N.onload=null,k({data:N})},N.onerror=()=>{N.onerror=N.onload=null,O.signal.aborted||$(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."))},N.src=q}))})(Oe||(Oe={})),Oe.resetRequestQueue();class Je{constructor(e){this._transformRequestFn=e??null}transformRequest(e,s){return this._transformRequestFn&&this._transformRequestFn(e,s)||{url:e}}setTransformRequest(e){this._transformRequestFn=e}}function et(y){const e=[];if(typeof y=="string")e.push({id:"default",url:y});else if(y&&y.length>0){const s=[];for(const{id:d,url:g}of y){const _=`${d}${g}`;s.indexOf(_)===-1&&(s.push(_),e.push({id:d,url:g}))}}return e}function ot(y,e,s){try{const d=new URL(y);return d.pathname+=`${e}${s}`,d.toString()}catch{throw new Error(`Invalid sprite URL "${y}", must be absolute. Modify style specification directly or use TransformStyleFunction to correct the issue dynamically`)}}function Rt(y){const{userImage:e}=y;return!!(e&&e.render&&e.render())&&(y.data.replace(new Uint8Array(e.data.buffer)),!0)}class Gt extends c.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new c.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(e){if(this.loaded!==e&&(this.loaded=e,e)){for(const{ids:s,promiseResolve:d}of this.requestors)d(this._getImagesForIds(s));this.requestors=[]}}getImage(e){const s=this.images[e];if(s&&!s.data&&s.spriteData){const d=s.spriteData;s.data=new c.R({width:d.width,height:d.height},d.context.getImageData(d.x,d.y,d.width,d.height).data),s.spriteData=null}return s}addImage(e,s){if(this.images[e])throw new Error(`Image id ${e} already exist, use updateImage instead`);this._validate(e,s)&&(this.images[e]=s)}_validate(e,s){let d=!0;const g=s.data||s.spriteData;return this._validateStretch(s.stretchX,g&&g.width)||(this.fire(new c.k(new Error(`Image "${e}" has invalid "stretchX" value`))),d=!1),this._validateStretch(s.stretchY,g&&g.height)||(this.fire(new c.k(new Error(`Image "${e}" has invalid "stretchY" value`))),d=!1),this._validateContent(s.content,s)||(this.fire(new c.k(new Error(`Image "${e}" has invalid "content" value`))),d=!1),d}_validateStretch(e,s){if(!e)return!0;let d=0;for(const g of e){if(g[0]<d||g[1]<g[0]||s<g[1])return!1;d=g[1]}return!0}_validateContent(e,s){if(!e)return!0;if(e.length!==4)return!1;const d=s.spriteData,g=d&&d.width||s.data.width,_=d&&d.height||s.data.height;return!(e[0]<0||g<e[0]||e[1]<0||_<e[1]||e[2]<0||g<e[2]||e[3]<0||_<e[3]||e[2]<e[0]||e[3]<e[1])}updateImage(e,s,d=!0){const g=this.getImage(e);if(d&&(g.data.width!==s.data.width||g.data.height!==s.data.height))throw new Error(`size mismatch between old image (${g.data.width}x${g.data.height}) and new image (${s.data.width}x${s.data.height}).`);s.version=g.version+1,this.images[e]=s,this.updatedImages[e]=!0}removeImage(e){const s=this.images[e];delete this.images[e],delete this.patterns[e],s.userImage&&s.userImage.onRemove&&s.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(e){return new Promise(((s,d)=>{let g=!0;if(!this.isLoaded())for(const _ of e)this.images[_]||(g=!1);this.isLoaded()||g?s(this._getImagesForIds(e)):this.requestors.push({ids:e,promiseResolve:s})}))}_getImagesForIds(e){const s={};for(const d of e){let g=this.getImage(d);g||(this.fire(new c.l("styleimagemissing",{id:d})),g=this.getImage(d)),g?s[d]={data:g.data.clone(),pixelRatio:g.pixelRatio,sdf:g.sdf,version:g.version,stretchX:g.stretchX,stretchY:g.stretchY,content:g.content,textFitWidth:g.textFitWidth,textFitHeight:g.textFitHeight,hasRenderCallback:!!(g.userImage&&g.userImage.render)}:c.w(`Image "${d}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}return s}getPixelSize(){const{width:e,height:s}=this.atlasImage;return{width:e,height:s}}getPattern(e){const s=this.patterns[e],d=this.getImage(e);if(!d)return null;if(s&&s.position.version===d.version)return s.position;if(s)s.position.version=d.version;else{const g={w:d.data.width+2,h:d.data.height+2,x:0,y:0},_=new c.I(g,d);this.patterns[e]={bin:g,position:_}}return this._updatePatternAtlas(),this.patterns[e].position}bind(e){const s=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new c.T(e,this.atlasImage,s.RGBA),this.atlasTexture.bind(s.LINEAR,s.CLAMP_TO_EDGE)}_updatePatternAtlas(){const e=[];for(const _ in this.patterns)e.push(this.patterns[_].bin);const{w:s,h:d}=c.p(e),g=this.atlasImage;g.resize({width:s||1,height:d||1});for(const _ in this.patterns){const{bin:S}=this.patterns[_],L=S.x+1,P=S.y+1,O=this.getImage(_).data,k=O.width,$=O.height;c.R.copy(O,g,{x:0,y:0},{x:L,y:P},{width:k,height:$}),c.R.copy(O,g,{x:0,y:$-1},{x:L,y:P-1},{width:k,height:1}),c.R.copy(O,g,{x:0,y:0},{x:L,y:P+$},{width:k,height:1}),c.R.copy(O,g,{x:k-1,y:0},{x:L-1,y:P},{width:1,height:$}),c.R.copy(O,g,{x:0,y:0},{x:L+k,y:P},{width:1,height:$})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(e){for(const s of e){if(this.callbackDispatchedThisFrame[s])continue;this.callbackDispatchedThisFrame[s]=!0;const d=this.getImage(s);d||c.w(`Image with ID: "${s}" was not found`),Rt(d)&&this.updateImage(s,d)}}}const Tt=1e20;function Ot(y,e,s,d,g,_,S,L,P){for(let O=e;O<e+d;O++)At(y,s*_+O,_,g,S,L,P);for(let O=s;O<s+g;O++)At(y,O*_+e,1,d,S,L,P)}function At(y,e,s,d,g,_,S){_[0]=0,S[0]=-Tt,S[1]=Tt,g[0]=y[e];for(let L=1,P=0,O=0;L<d;L++){g[L]=y[e+L*s];const k=L*L;do{const $=_[P];O=(g[L]-g[$]+k-$*$)/(L-$)/2}while(O<=S[P]&&--P>-1);P++,_[P]=L,S[P]=O,S[P+1]=Tt}for(let L=0,P=0;L<d;L++){for(;S[P+1]<L;)P++;const O=_[P],k=L-O;y[e+L*s]=g[O]+k*k}}class Qt{constructor(e,s,d){this.requestManager=e,this.localIdeographFontFamily=s,this.entries={},this.lang=d}setURL(e){this.url=e}getGlyphs(e){return c._(this,void 0,void 0,(function*(){const s=[];for(const _ in e)for(const S of e[_])s.push(this._getAndCacheGlyphsPromise(_,S));const d=yield Promise.all(s),g={};for(const{stack:_,id:S,glyph:L}of d)g[_]||(g[_]={}),g[_][S]=L&&{id:L.id,bitmap:L.bitmap.clone(),metrics:L.metrics};return g}))}_getAndCacheGlyphsPromise(e,s){return c._(this,void 0,void 0,(function*(){let d=this.entries[e];d||(d=this.entries[e]={glyphs:{},requests:{},ranges:{}});let g=d.glyphs[s];if(g!==void 0)return{stack:e,id:s,glyph:g};if(g=this._tinySDF(d,e,s),g)return d.glyphs[s]=g,{stack:e,id:s,glyph:g};const _=Math.floor(s/256);if(256*_>65535)throw new Error("glyphs > 65535 not supported");if(d.ranges[_])return{stack:e,id:s,glyph:g};if(!this.url)throw new Error("glyphsUrl is not set");if(!d.requests[_]){const L=Qt.loadGlyphRange(e,_,this.url,this.requestManager);d.requests[_]=L}const S=yield d.requests[_];for(const L in S)this._doesCharSupportLocalGlyph(+L)||(d.glyphs[+L]=S[+L]);return d.ranges[_]=!0,{stack:e,id:s,glyph:S[s]||null}}))}_doesCharSupportLocalGlyph(e){return!!this.localIdeographFontFamily&&(new RegExp("\\p{Ideo}|\\p{sc=Hang}|\\p{sc=Hira}|\\p{sc=Kana}","u").test(String.fromCodePoint(e))||c.u["CJK Unified Ideographs"](e)||c.u["Hangul Syllables"](e)||c.u.Hiragana(e)||c.u.Katakana(e)||c.u["CJK Symbols and Punctuation"](e)||c.u["Halfwidth and Fullwidth Forms"](e))}_tinySDF(e,s,d){const g=this.localIdeographFontFamily;if(!g||!this._doesCharSupportLocalGlyph(d))return;let _=e.tinySDF;if(!_){let L="400";/bold/i.test(s)?L="900":/medium/i.test(s)?L="500":/light/i.test(s)&&(L="200"),_=e.tinySDF=new Qt.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,lang:this.lang,fontFamily:g,fontWeight:L})}const S=_.draw(String.fromCharCode(d));return{id:d,bitmap:new c.q({width:S.width||60,height:S.height||60},S.data),metrics:{width:S.glyphWidth/2||24,height:S.glyphHeight/2||24,left:S.glyphLeft/2+.5||0,top:S.glyphTop/2-27.5||-8,advance:S.glyphAdvance/2||24,isDoubleResolution:!0}}}}Qt.loadGlyphRange=function(y,e,s,d){return c._(this,void 0,void 0,(function*(){const g=256*e,_=g+255,S=d.transformRequest(s.replace("{fontstack}",y).replace("{range}",`${g}-${_}`),"Glyphs"),L=yield c.n(S,new AbortController);if(!L||!L.data)throw new Error(`Could not load glyph range. range: ${e}, ${g}-${_}`);const P={};for(const O of c.o(L.data))P[O.id]=O;return P}))},Qt.TinySDF=class{constructor({fontSize:y=24,buffer:e=3,radius:s=8,cutoff:d=.25,fontFamily:g="sans-serif",fontWeight:_="normal",fontStyle:S="normal",lang:L=null}={}){this.buffer=e,this.cutoff=d,this.radius=s,this.lang=L;const P=this.size=y+4*e,O=this._createCanvas(P),k=this.ctx=O.getContext("2d",{willReadFrequently:!0});k.font=`${S} ${_} ${y}px ${g}`,k.textBaseline="alphabetic",k.textAlign="left",k.fillStyle="black",this.gridOuter=new Float64Array(P*P),this.gridInner=new Float64Array(P*P),this.f=new Float64Array(P),this.z=new Float64Array(P+1),this.v=new Uint16Array(P)}_createCanvas(y){const e=document.createElement("canvas");return e.width=e.height=y,e}draw(y){const{width:e,actualBoundingBoxAscent:s,actualBoundingBoxDescent:d,actualBoundingBoxLeft:g,actualBoundingBoxRight:_}=this.ctx.measureText(y),S=Math.ceil(s),L=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(_-g))),P=Math.min(this.size-this.buffer,S+Math.ceil(d)),O=L+2*this.buffer,k=P+2*this.buffer,$=Math.max(O*k,0),N=new Uint8ClampedArray($),q={data:N,width:O,height:k,glyphWidth:L,glyphHeight:P,glyphTop:S,glyphLeft:0,glyphAdvance:e};if(L===0||P===0)return q;const{ctx:K,buffer:re,gridInner:ae,gridOuter:se}=this;this.lang&&(K.lang=this.lang),K.clearRect(re,re,L,P),K.fillText(y,re,re+S);const ce=K.getImageData(re,re,L,P);se.fill(Tt,0,$),ae.fill(0,0,$);for(let de=0;de<P;de++)for(let ue=0;ue<L;ue++){const _e=ce.data[4*(de*L+ue)+3]/255;if(_e===0)continue;const be=(de+re)*O+ue+re;if(_e===1)se[be]=0,ae[be]=Tt;else{const fe=.5-_e;se[be]=fe>0?fe*fe:0,ae[be]=fe<0?fe*fe:0}}Ot(se,0,0,O,k,O,this.f,this.v,this.z),Ot(ae,re,re,L,P,O,this.f,this.v,this.z);for(let de=0;de<$;de++){const ue=Math.sqrt(se[de])-Math.sqrt(ae[de]);N[de]=Math.round(255-255*(ue/this.radius+this.cutoff))}return q}};class sn{constructor(){this.specification=c.v.light.position}possiblyEvaluate(e,s){return c.B(e.expression.evaluate(s))}interpolate(e,s,d){return{x:c.C.number(e.x,s.x,d),y:c.C.number(e.y,s.y,d),z:c.C.number(e.z,s.z,d)}}}let qt;class $e extends c.E{constructor(e){super(),qt=qt||new c.r({anchor:new c.D(c.v.light.anchor),position:new sn,color:new c.D(c.v.light.color),intensity:new c.D(c.v.light.intensity)}),this._transitionable=new c.t(qt,void 0),this.setLight(e),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(e,s={}){if(!this._validate(c.x,e,s))for(const d in e){const g=e[d];d.endsWith("-transition")?this._transitionable.setTransition(d.slice(0,-11),g):this._transitionable.setValue(d,g)}}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(e,s,d){return(!d||d.validate!==!1)&&c.y(this,e.call(c.z,{value:s,style:{glyphs:!0,sprite:!0},styleSpec:c.v}))}}const ft=new c.r({"sky-color":new c.D(c.v.sky["sky-color"]),"horizon-color":new c.D(c.v.sky["horizon-color"]),"fog-color":new c.D(c.v.sky["fog-color"]),"fog-ground-blend":new c.D(c.v.sky["fog-ground-blend"]),"horizon-fog-blend":new c.D(c.v.sky["horizon-fog-blend"]),"sky-horizon-blend":new c.D(c.v.sky["sky-horizon-blend"]),"atmosphere-blend":new c.D(c.v.sky["atmosphere-blend"])});class wt extends c.E{constructor(e){super(),this._transitionable=new c.t(ft,void 0),this.setSky(e),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new c.F(0))}setSky(e,s={}){if(!this._validate(c.G,e,s)){e||(e={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0});for(const d in e){const g=e[d];d.endsWith("-transition")?this._transitionable.setTransition(d.slice(0,-11),g):this._transitionable.setValue(d,g)}}}getSky(){return this._transitionable.serialize()}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(e,s,d={}){return(d==null?void 0:d.validate)!==!1&&c.y(this,e.call(c.z,c.e({value:s,style:{glyphs:!0,sprite:!0},styleSpec:c.v})))}calculateFogBlendOpacity(e){return e<60?0:e<70?(e-60)/10:1}}class St{constructor(e,s){this.width=e,this.height=s,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(e,s){const d=e.join(",")+String(s);return this.dashEntry[d]||(this.dashEntry[d]=this.addDash(e,s)),this.dashEntry[d]}getDashRanges(e,s,d){const g=[];let _=e.length%2==1?-e[e.length-1]*d:0,S=e[0]*d,L=!0;g.push({left:_,right:S,isDash:L,zeroLength:e[0]===0});let P=e[0];for(let O=1;O<e.length;O++){L=!L;const k=e[O];_=P*d,P+=k,S=P*d,g.push({left:_,right:S,isDash:L,zeroLength:k===0})}return g}addRoundDash(e,s,d){const g=s/2;for(let _=-d;_<=d;_++){const S=this.width*(this.nextRow+d+_);let L=0,P=e[L];for(let O=0;O<this.width;O++){O/P.right>1&&(P=e[++L]);const k=Math.abs(O-P.left),$=Math.abs(O-P.right),N=Math.min(k,$);let q;const K=_/d*(g+1);if(P.isDash){const re=g-Math.abs(K);q=Math.sqrt(N*N+re*re)}else q=g-Math.sqrt(N*N+K*K);this.data[S+O]=Math.max(0,Math.min(255,q+128))}}}addRegularDash(e){for(let L=e.length-1;L>=0;--L){const P=e[L],O=e[L+1];P.zeroLength?e.splice(L,1):O&&O.isDash===P.isDash&&(O.left=P.left,e.splice(L,1))}const s=e[0],d=e[e.length-1];s.isDash===d.isDash&&(s.left=d.left-this.width,d.right=s.right+this.width);const g=this.width*this.nextRow;let _=0,S=e[_];for(let L=0;L<this.width;L++){L/S.right>1&&(S=e[++_]);const P=Math.abs(L-S.left),O=Math.abs(L-S.right),k=Math.min(P,O);this.data[g+L]=Math.max(0,Math.min(255,(S.isDash?k:-k)+128))}}addDash(e,s){const d=s?7:0,g=2*d+1;if(this.nextRow+g>this.height)return c.w("LineAtlas out of space"),null;let _=0;for(let L=0;L<e.length;L++)_+=e[L];if(_!==0){const L=this.width/_,P=this.getDashRanges(e,this.width,L);s?this.addRoundDash(P,L,d):this.addRegularDash(P)}const S={y:this.nextRow+d,height:2*d,width:_};return this.nextRow+=g,this.dirty=!0,S}bind(e){const s=e.gl;this.texture?(s.bindTexture(s.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,s.texSubImage2D(s.TEXTURE_2D,0,0,0,this.width,this.height,s.ALPHA,s.UNSIGNED_BYTE,this.data))):(this.texture=s.createTexture(),s.bindTexture(s.TEXTURE_2D,this.texture),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_S,s.REPEAT),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_T,s.REPEAT),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,s.LINEAR),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,s.LINEAR),s.texImage2D(s.TEXTURE_2D,0,s.ALPHA,this.width,this.height,0,s.ALPHA,s.UNSIGNED_BYTE,this.data))}}const Zt="maplibre_preloaded_worker_pool";class we{constructor(){this.active={}}acquire(e){if(!this.workers)for(this.workers=[];this.workers.length<we.workerCount;)this.workers.push(new Worker(c.a.WORKER_URL));return this.active[e]=!0,this.workers.slice()}release(e){delete this.active[e],this.numActive()===0&&(this.workers.forEach((s=>{s.terminate()})),this.workers=null)}isPreloaded(){return!!this.active[Zt]}numActive(){return Object.keys(this.active).length}}const Be=Math.floor(Y.hardwareConcurrency/2);let pt,xt;function Bt(){return pt||(pt=new we),pt}we.workerCount=c.H(globalThis)?Math.max(Math.min(Be,3),1):1;class Lt{constructor(e,s){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=s;const d=this.workerPool.acquire(s);for(let g=0;g<d.length;g++){const _=new c.J(d[g],s);_.name=`Worker ${g}`,this.actors.push(_)}if(!this.actors.length)throw new Error("No actors found")}broadcast(e,s){const d=[];for(const g of this.actors)d.push(g.sendAsync({type:e,data:s}));return Promise.all(d)}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(e=!0){this.actors.forEach((s=>{s.remove()})),this.actors=[],e&&this.workerPool.release(this.id)}registerMessageHandler(e,s){for(const d of this.actors)d.registerMessageHandler(e,s)}}function Wt(){return xt||(xt=new Lt(Bt(),c.K),xt.registerMessageHandler("GR",((y,e,s)=>c.m(e,s)))),xt}function Ht(y,e){const s=c.L();return c.M(s,s,[1,1,0]),c.N(s,s,[.5*y.width,.5*y.height,1]),y.calculatePosMatrix?c.O(s,s,y.calculatePosMatrix(e.toUnwrapped())):s}function xn(y,e,s,d,g,_,S){var L;const P=(function(N,q,K){if(N)for(const re of N){const ae=q[re];if(ae&&ae.source===K&&ae.type==="fill-extrusion")return!0}else for(const re in q){const ae=q[re];if(ae.source===K&&ae.type==="fill-extrusion")return!0}return!1})((L=g==null?void 0:g.layers)!==null&&L!==void 0?L:null,e,y.id),O=_.maxPitchScaleFactor(),k=y.tilesIn(d,O,P);k.sort(ka);const $=[];for(const N of k)$.push({wrappedTileID:N.tileID.wrapped().key,queryResults:N.tile.queryRenderedFeatures(e,s,y._state,N.queryGeometry,N.cameraQueryGeometry,N.scale,g,_,O,Ht(y.transform,N.tileID),S?(q,K)=>S(N.tileID,q,K):void 0)});return(function(N,q){for(const K in N)for(const re of N[K])ai(re,q);return N})((function(N){const q={},K={};for(const re of N){const ae=re.queryResults,se=re.wrappedTileID,ce=K[se]=K[se]||{};for(const de in ae){const ue=ae[de],_e=ce[de]=ce[de]||{},be=q[de]=q[de]||[];for(const fe of ue)_e[fe.featureIndex]||(_e[fe.featureIndex]=!0,be.push(fe))}}return q})($),y)}function ka(y,e){const s=y.tileID,d=e.tileID;return s.overscaledZ-d.overscaledZ||s.canonical.y-d.canonical.y||s.wrap-d.wrap||s.canonical.x-d.canonical.x}function ai(y,e){const s=y.feature,d=e.getFeatureState(s.layer["source-layer"],s.id);s.source=s.layer.source,s.layer["source-layer"]&&(s.sourceLayer=s.layer["source-layer"]),s.state=d}function kr(y,e,s){return c._(this,void 0,void 0,(function*(){let d=y;if(y.url?d=(yield c.j(e.transformRequest(y.url,"Source"),s)).data:yield Y.frameAsync(s),!d)return null;const g=c.Q(c.e(d,y),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in d&&d.vector_layers&&(g.vectorLayerIds=d.vector_layers.map((_=>_.id))),g}))}class Mi{constructor(e,s){e&&(s?this.setSouthWest(e).setNorthEast(s):Array.isArray(e)&&(e.length===4?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1])))}setNorthEast(e){return this._ne=e instanceof c.S?new c.S(e.lng,e.lat):c.S.convert(e),this}setSouthWest(e){return this._sw=e instanceof c.S?new c.S(e.lng,e.lat):c.S.convert(e),this}extend(e){const s=this._sw,d=this._ne;let g,_;if(e instanceof c.S)g=e,_=e;else{if(!(e instanceof Mi))return Array.isArray(e)?e.length===4||e.every(Array.isArray)?this.extend(Mi.convert(e)):this.extend(c.S.convert(e)):e&&("lng"in e||"lon"in e)&&"lat"in e?this.extend(c.S.convert(e)):this;if(g=e._sw,_=e._ne,!g||!_)return this}return s||d?(s.lng=Math.min(g.lng,s.lng),s.lat=Math.min(g.lat,s.lat),d.lng=Math.max(_.lng,d.lng),d.lat=Math.max(_.lat,d.lat)):(this._sw=new c.S(g.lng,g.lat),this._ne=new c.S(_.lng,_.lat)),this}getCenter(){return new c.S((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 c.S(this.getWest(),this.getNorth())}getSouthEast(){return new c.S(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(e){const{lng:s,lat:d}=c.S.convert(e);let g=this._sw.lng<=s&&s<=this._ne.lng;return this._sw.lng>this._ne.lng&&(g=this._sw.lng>=s&&s>=this._ne.lng),this._sw.lat<=d&&d<=this._ne.lat&&g}static convert(e){return e instanceof Mi?e:e&&new Mi(e)}static fromLngLat(e,s=0){const d=360*s/40075017,g=d/Math.cos(Math.PI/180*e.lat);return new Mi(new c.S(e.lng-g,e.lat-d),new c.S(e.lng+g,e.lat+d))}adjustAntiMeridian(){const e=new c.S(this._sw.lng,this._sw.lat),s=new c.S(this._ne.lng,this._ne.lat);return new Mi(e,e.lng>s.lng?new c.S(s.lng+360,s.lat):s)}}class si{constructor(e,s,d){this.bounds=Mi.convert(this.validateBounds(e)),this.minzoom=s||0,this.maxzoom=d||24}validateBounds(e){return Array.isArray(e)&&e.length===4?[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]:[-180,-90,180,90]}contains(e){const s=Math.pow(2,e.z),d=Math.floor(c.V(this.bounds.getWest())*s),g=Math.floor(c.U(this.bounds.getNorth())*s),_=Math.ceil(c.V(this.bounds.getEast())*s),S=Math.ceil(c.U(this.bounds.getSouth())*s);return e.x>=d&&e.x<_&&e.y>=g&&e.y<S}}class ca extends c.E{constructor(e,s,d,g){if(super(),this.id=e,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,c.e(this,c.Q(s,["url","scheme","tileSize","promoteId"])),this._options=c.e({type:"vector"},s),this._collectResourceTiming=s.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(g)}load(){return c._(this,void 0,void 0,(function*(){this._loaded=!1,this.fire(new c.l("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const e=yield kr(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),e&&(c.e(this,e),e.bounds&&(this.tileBounds=new si(e.bounds,this.minzoom,this.maxzoom)),this.fire(new c.l("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new c.l("data",{dataType:"source",sourceDataType:"content"})))}catch(e){this._tileJSONRequest=null,this._loaded=!0,this.fire(new c.k(e))}}))}loaded(){return this._loaded}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}onAdd(e){this.map=e,this.load()}setSourceProperty(e){this._tileJSONRequest&&this._tileJSONRequest.abort(),e(),this.load()}setTiles(e){return this.setSourceProperty((()=>{this._options.tiles=e})),this}setUrl(e){return this.setSourceProperty((()=>{this.url=e,this._options.url=e})),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return c.e({},this._options)}loadTile(e){return c._(this,void 0,void 0,(function*(){const s=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),d={request:this.map._requestManager.transformRequest(s,"Tile"),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity};d.request.collectResourceTiming=this._collectResourceTiming;let g="RT";if(e.actor&&e.state!=="expired"){if(e.state==="loading")return new Promise(((_,S)=>{e.reloadPromise={resolve:_,reject:S}}))}else e.actor=this.dispatcher.getActor(),g="LT";e.abortController=new AbortController;try{const _=yield e.actor.sendAsync({type:g,data:d},e.abortController);if(delete e.abortController,e.aborted)return;this._afterTileLoadWorkerResponse(e,_)}catch(_){if(delete e.abortController,e.aborted)return;if(_&&_.status!==404)throw _;this._afterTileLoadWorkerResponse(e,null)}}))}_afterTileLoadWorkerResponse(e,s){if(s&&s.resourceTiming&&(e.resourceTiming=s.resourceTiming),s&&this.map._refreshExpiredTiles&&e.setExpiryData(s),e.loadVectorData(s,this.map.painter),e.reloadPromise){const d=e.reloadPromise;e.reloadPromise=null,this.loadTile(e).then(d.resolve).catch(d.reject)}}abortTile(e){return c._(this,void 0,void 0,(function*(){e.abortController&&(e.abortController.abort(),delete e.abortController),e.actor&&(yield e.actor.sendAsync({type:"AT",data:{uid:e.uid,type:this.type,source:this.id}}))}))}unloadTile(e){return c._(this,void 0,void 0,(function*(){e.unloadVectorData(),e.actor&&(yield e.actor.sendAsync({type:"RMT",data:{uid:e.uid,type:this.type,source:this.id}}))}))}hasTransition(){return!1}}class Ba extends c.E{constructor(e,s,d,g){super(),this.id=e,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=c.e({type:"raster"},s),c.e(this,c.Q(s,["url","scheme","tileSize"]))}load(){return c._(this,arguments,void 0,(function*(e=!1){this._loaded=!1,this.fire(new c.l("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const s=yield kr(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,s&&(c.e(this,s),s.bounds&&(this.tileBounds=new si(s.bounds,this.minzoom,this.maxzoom)),this.fire(new c.l("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new c.l("data",{dataType:"source",sourceDataType:"content",sourceDataChanged:e})))}catch(s){this._tileJSONRequest=null,this._loaded=!0,this.fire(new c.k(s))}}))}loaded(){return this._loaded}onAdd(e){this.map=e,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(e){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),e(),this.load(!0)}setTiles(e){return this.setSourceProperty((()=>{this._options.tiles=e})),this}setUrl(e){return this.setSourceProperty((()=>{this.url=e,this._options.url=e})),this}serialize(){return c.e({},this._options)}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(e){return c._(this,void 0,void 0,(function*(){const s=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);e.abortController=new AbortController;try{const d=yield Oe.getImage(this.map._requestManager.transformRequest(s,"Tile"),e.abortController,this.map._refreshExpiredTiles);if(delete e.abortController,e.aborted)return void(e.state="unloaded");if(d&&d.data){this.map._refreshExpiredTiles&&(d.cacheControl||d.expires)&&e.setExpiryData({cacheControl:d.cacheControl,expires:d.expires});const g=this.map.painter.context,_=g.gl,S=d.data;e.texture=this.map.painter.getTileTexture(S.width),e.texture?e.texture.update(S,{useMipmap:!0}):(e.texture=new c.T(g,S,_.RGBA,{useMipmap:!0}),e.texture.bind(_.LINEAR,_.CLAMP_TO_EDGE,_.LINEAR_MIPMAP_NEAREST)),e.state="loaded"}}catch(d){if(delete e.abortController,e.aborted)e.state="unloaded";else if(d)throw e.state="errored",d}}))}abortTile(e){return c._(this,void 0,void 0,(function*(){e.abortController&&(e.abortController.abort(),delete e.abortController)}))}unloadTile(e){return c._(this,void 0,void 0,(function*(){e.texture&&this.map.painter.saveTileTexture(e.texture)}))}hasTransition(){return!1}}class wl extends Ba{constructor(e,s,d,g){super(e,s,d,g),this.type="raster-dem",this.maxzoom=22,this._options=c.e({type:"raster-dem"},s),this.encoding=s.encoding||"mapbox",this.redFactor=s.redFactor,this.greenFactor=s.greenFactor,this.blueFactor=s.blueFactor,this.baseShift=s.baseShift}loadTile(e){return c._(this,void 0,void 0,(function*(){const s=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),d=this.map._requestManager.transformRequest(s,"Tile");e.neighboringTiles=this._getNeighboringTiles(e.tileID),e.abortController=new AbortController;try{const g=yield Oe.getImage(d,e.abortController,this.map._refreshExpiredTiles);if(delete e.abortController,e.aborted)return void(e.state="unloaded");if(g&&g.data){const _=g.data;this.map._refreshExpiredTiles&&(g.cacheControl||g.expires)&&e.setExpiryData({cacheControl:g.cacheControl,expires:g.expires});const S=c.b(_)&&c.W()?_:yield this.readImageNow(_),L={type:this.type,uid:e.uid,source:this.id,rawImageData:S,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!e.actor||e.state==="expired"){e.actor=this.dispatcher.getActor();const P=yield e.actor.sendAsync({type:"LDT",data:L});e.dem=P,e.needsHillshadePrepare=!0,e.needsTerrainPrepare=!0,e.state="loaded"}}}catch(g){if(delete e.abortController,e.aborted)e.state="unloaded";else if(g)throw e.state="errored",g}}))}readImageNow(e){return c._(this,void 0,void 0,(function*(){if(typeof VideoFrame<"u"&&c.X()){const s=e.width+2,d=e.height+2;try{return new c.R({width:s,height:d},yield c.Y(e,-1,-1,s,d))}catch{}}return Y.getImageData(e,1)}))}_getNeighboringTiles(e){const s=e.canonical,d=Math.pow(2,s.z),g=(s.x-1+d)%d,_=s.x===0?e.wrap-1:e.wrap,S=(s.x+1+d)%d,L=s.x+1===d?e.wrap+1:e.wrap,P={};return P[new c.Z(e.overscaledZ,_,s.z,g,s.y).key]={backfilled:!1},P[new c.Z(e.overscaledZ,L,s.z,S,s.y).key]={backfilled:!1},s.y>0&&(P[new c.Z(e.overscaledZ,_,s.z,g,s.y-1).key]={backfilled:!1},P[new c.Z(e.overscaledZ,e.wrap,s.z,s.x,s.y-1).key]={backfilled:!1},P[new c.Z(e.overscaledZ,L,s.z,S,s.y-1).key]={backfilled:!1}),s.y+1<d&&(P[new c.Z(e.overscaledZ,_,s.z,g,s.y+1).key]={backfilled:!1},P[new c.Z(e.overscaledZ,e.wrap,s.z,s.x,s.y+1).key]={backfilled:!1},P[new c.Z(e.overscaledZ,L,s.z,S,s.y+1).key]={backfilled:!1}),P}unloadTile(e){return c._(this,void 0,void 0,(function*(){e.demTexture&&this.map.painter.saveTileTexture(e.demTexture),e.fbo&&(e.fbo.destroy(),delete e.fbo),e.dem&&delete e.dem,delete e.neighboringTiles,e.state="unloaded",e.actor&&(yield e.actor.sendAsync({type:"RDT",data:{type:this.type,uid:e.uid,source:this.id}}))}))}}class zo extends c.E{constructor(e,s,d,g){super(),this.id=e,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._isUpdatingWorker=!1,this._pendingWorkerUpdate={data:s.data},this.actor=d.getActor(),this.setEventedParent(g),this._data=s.data,this._options=c.e({},s),this._collectResourceTiming=s.collectResourceTiming,s.maxzoom!==void 0&&(this.maxzoom=s.maxzoom),s.type&&(this.type=s.type),s.attribution&&(this.attribution=s.attribution),this.promoteId=s.promoteId,s.clusterMaxZoom!==void 0&&this.maxzoom<=s.clusterMaxZoom&&c.w(`The maxzoom value "${this.maxzoom}" is expected to be greater than the clusterMaxZoom value "${s.clusterMaxZoom}".`),this.workerOptions=c.e({source:this.id,cluster:s.cluster||!1,geojsonVtOptions:{buffer:this._pixelsToTileUnits(s.buffer!==void 0?s.buffer:128),tolerance:this._pixelsToTileUnits(s.tolerance!==void 0?s.tolerance:.375),extent:c.$,maxZoom:this.maxzoom,lineMetrics:s.lineMetrics||!1,generateId:s.generateId||!1},superclusterOptions:{maxZoom:this._getClusterMaxZoom(s.clusterMaxZoom),minPoints:Math.max(2,s.clusterMinPoints||2),extent:c.$,radius:this._pixelsToTileUnits(s.clusterRadius||50),log:!1,generateId:s.generateId||!1},clusterProperties:s.clusterProperties,filter:s.filter},s.workerOptions),typeof this.promoteId=="string"&&(this.workerOptions.promoteId=this.promoteId)}_pixelsToTileUnits(e){return e*(c.$/this.tileSize)}_getClusterMaxZoom(e){const s=e?Math.round(e):this.maxzoom-1;return Number.isInteger(e)||e===void 0||c.w(`Integer expected for option 'clusterMaxZoom': provided value "${e}" rounded to "${s}"`),s}load(){return c._(this,void 0,void 0,(function*(){yield this._updateWorkerData()}))}onAdd(e){this.map=e,this.load()}setData(e){return this._data=e,this._pendingWorkerUpdate={data:e},this._updateWorkerData(),this}updateData(e){return this._pendingWorkerUpdate.diff=c.a0(this._pendingWorkerUpdate.diff,e),this._updateWorkerData(),this}getData(){return c._(this,void 0,void 0,(function*(){const e=c.e({type:this.type},this.workerOptions);return this.actor.sendAsync({type:"GD",data:e})}))}getCoordinatesFromGeometry(e){return e.type==="GeometryCollection"?e.geometries.map((s=>s.coordinates)).flat(1/0):e.coordinates.flat(1/0)}getBounds(){return c._(this,void 0,void 0,(function*(){const e=new Mi,s=yield this.getData();let d;switch(s.type){case"FeatureCollection":d=s.features.map((g=>this.getCoordinatesFromGeometry(g.geometry))).flat(1/0);break;case"Feature":d=this.getCoordinatesFromGeometry(s.geometry);break;default:d=this.getCoordinatesFromGeometry(s)}if(d.length==0)return e;for(let g=0;g<d.length-1;g+=2)e.extend([d[g],d[g+1]]);return e}))}setClusterOptions(e){return this.workerOptions.cluster=e.cluster,e&&(e.clusterRadius!==void 0&&(this.workerOptions.superclusterOptions.radius=this._pixelsToTileUnits(e.clusterRadius)),e.clusterMaxZoom!==void 0&&(this.workerOptions.superclusterOptions.maxZoom=this._getClusterMaxZoom(e.clusterMaxZoom))),this._updateWorkerData(),this}getClusterExpansionZoom(e){return this.actor.sendAsync({type:"GCEZ",data:{type:this.type,clusterId:e,source:this.id}})}getClusterChildren(e){return this.actor.sendAsync({type:"GCC",data:{type:this.type,clusterId:e,source:this.id}})}getClusterLeaves(e,s,d){return this.actor.sendAsync({type:"GCL",data:{type:this.type,source:this.id,clusterId:e,limit:s,offset:d}})}_updateWorkerData(){return c._(this,void 0,void 0,(function*(){if(this._isUpdatingWorker)return;const{data:e,diff:s}=this._pendingWorkerUpdate;if(!e&&!s)return void c.w(`No data or diff provided to GeoJSONSource ${this.id}.`);const d=c.e({type:this.type},this.workerOptions);e?(typeof e=="string"?(d.request=this.map._requestManager.transformRequest(Y.resolveURL(e),"Source"),d.request.collectResourceTiming=this._collectResourceTiming):d.data=JSON.stringify(e),this._pendingWorkerUpdate.data=void 0):s&&(d.dataDiff=s,this._pendingWorkerUpdate.diff=void 0),this._isUpdatingWorker=!0,this.fire(new c.l("dataloading",{dataType:"source"}));try{const g=yield this.actor.sendAsync({type:"LD",data:d});if(this._isUpdatingWorker=!1,this._removed||g.abandoned)return void this.fire(new c.l("dataabort",{dataType:"source"}));this._data=g.data;let _=null;g.resourceTiming&&g.resourceTiming[this.id]&&(_=g.resourceTiming[this.id].slice(0));const S={dataType:"source"};this._collectResourceTiming&&_&&_.length>0&&c.e(S,{resourceTiming:_}),this.fire(new c.l("data",Object.assign(Object.assign({},S),{sourceDataType:"metadata"}))),this.fire(new c.l("data",Object.assign(Object.assign({},S),{sourceDataType:"content"})))}catch(g){if(this._isUpdatingWorker=!1,this._removed)return void this.fire(new c.l("dataabort",{dataType:"source"}));this.fire(new c.k(g))}finally{(this._pendingWorkerUpdate.data||this._pendingWorkerUpdate.diff)&&this._updateWorkerData()}}))}loaded(){return!this._isUpdatingWorker&&this._pendingWorkerUpdate.data===void 0&&this._pendingWorkerUpdate.diff===void 0}loadTile(e){return c._(this,void 0,void 0,(function*(){const s=e.actor?"RT":"LT";e.actor=this.actor;const d={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity};e.abortController=new AbortController;const g=yield this.actor.sendAsync({type:s,data:d},e.abortController);delete e.abortController,e.unloadVectorData(),e.aborted||e.loadVectorData(g,this.map.painter,s==="RT")}))}abortTile(e){return c._(this,void 0,void 0,(function*(){e.abortController&&(e.abortController.abort(),delete e.abortController),e.aborted=!0}))}unloadTile(e){return c._(this,void 0,void 0,(function*(){e.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:e.uid,type:this.type,source:this.id}})}))}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return c.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}class Br extends c.E{constructor(e,s,d,g){super(),this.flippedWindingOrder=!1,this.id=e,this.dispatcher=d,this.coordinates=s.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(g),this.options=s}load(e){return c._(this,void 0,void 0,(function*(){this._loaded=!1,this.fire(new c.l("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{const s=yield Oe.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,s&&s.data&&(this.image=s.data,e&&(this.coordinates=e),this._finishLoading())}catch(s){this._request=null,this._loaded=!0,this.fire(new c.k(s))}}))}loaded(){return this._loaded}updateImage(e){return e.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=e.url,this.load(e.coordinates).finally((()=>{this.texture=null})),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new c.l("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(e){this.map=e,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(e){this.coordinates=e;const s=e.map(c.a1.fromLngLat);var d;return this.tileID=(function(g){const _=c.a2.fromPoints(g),S=_.width(),L=_.height(),P=Math.max(S,L),O=Math.max(0,Math.floor(-Math.log(P)/Math.LN2)),k=Math.pow(2,O);return new c.a4(O,Math.floor((_.minX+_.maxX)/2*k),Math.floor((_.minY+_.maxY)/2*k))})(s),this.terrainTileRanges=this._getOverlappingTileRanges(s),this.minzoom=this.maxzoom=this.tileID.z,this.tileCoords=s.map((g=>this.tileID.getTilePoint(g)._round())),this.flippedWindingOrder=((d=this.tileCoords)[1].x-d[0].x)*(d[2].y-d[0].y)-(d[1].y-d[0].y)*(d[2].x-d[0].x)<0,this.fire(new c.l("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const e=this.map.painter.context,s=e.gl;this.texture||(this.texture=new c.T(e,this.image,s.RGBA),this.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE));let d=!1;for(const g in this.tiles){const _=this.tiles[g];_.state!=="loaded"&&(_.state="loaded",_.texture=this.texture,d=!0)}d&&this.fire(new c.l("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(e){return c._(this,void 0,void 0,(function*(){this.tileID&&this.tileID.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={}):e.state="errored"}))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}_getOverlappingTileRanges(e){const{minX:s,minY:d,maxX:g,maxY:_}=c.a2.fromPoints(e),S={};for(let L=0;L<=c.a3;L++){const P=Math.pow(2,L),O=Math.floor(s*P),k=Math.floor(d*P),$=Math.floor(g*P),N=Math.floor(_*P);S[L]={minTileX:O,minTileY:k,maxTileX:$,maxTileY:N}}return S}}class Do extends Br{constructor(e,s,d,g){super(e,s,d,g),this.roundZoom=!0,this.type="video",this.options=s}load(){return c._(this,void 0,void 0,(function*(){this._loaded=!1;const e=this.options;this.urls=[];for(const s of e.urls)this.urls.push(this.map._requestManager.transformRequest(s,"Source").url);try{const s=yield c.a5(this.urls);if(this._loaded=!0,!s)return;this.video=s,this.video.loop=!0,this.video.addEventListener("playing",(()=>{this.map.triggerRepaint()})),this.map&&this.video.play(),this._finishLoading()}catch(s){this.fire(new c.k(s))}}))}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(e){if(this.video){const s=this.video.seekable;e<s.start(0)||e>s.end(0)?this.fire(new c.k(new c.a6(`sources.${this.id}`,null,`Playback for this video can be set only between the ${s.start(0)} and ${s.end(0)}-second mark.`))):this.video.currentTime=e}}getVideo(){return this.video}onAdd(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const e=this.map.painter.context,s=e.gl;this.texture?this.video.paused||(this.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE),s.texSubImage2D(s.TEXTURE_2D,0,0,0,s.RGBA,s.UNSIGNED_BYTE,this.video)):(this.texture=new c.T(e,this.video,s.RGBA),this.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE));let d=!1;for(const g in this.tiles){const _=this.tiles[g];_.state!=="loaded"&&(_.state="loaded",_.texture=this.texture,d=!0)}d&&this.fire(new c.l("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class Sl extends Br{constructor(e,s,d,g){super(e,s,d,g),s.coordinates?Array.isArray(s.coordinates)&&s.coordinates.length===4&&!s.coordinates.some((_=>!Array.isArray(_)||_.length!==2||_.some((S=>typeof S!="number"))))||this.fire(new c.k(new c.a6(`sources.${e}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new c.k(new c.a6(`sources.${e}`,null,'missing required property "coordinates"'))),s.animate&&typeof s.animate!="boolean"&&this.fire(new c.k(new c.a6(`sources.${e}`,null,'optional "animate" property must be a boolean value'))),s.canvas?typeof s.canvas=="string"||s.canvas instanceof HTMLCanvasElement||this.fire(new c.k(new c.a6(`sources.${e}`,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 c.k(new c.a6(`sources.${e}`,null,'missing required property "canvas"'))),this.options=s,this.animate=s.animate===void 0||s.animate}load(){return c._(this,void 0,void 0,(function*(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new c.k(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(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const s=this.map.painter.context,d=s.gl;this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new c.T(s,this.canvas,d.RGBA,{premultiply:!0});let g=!1;for(const _ in this.tiles){const S=this.tiles[_];S.state!=="loaded"&&(S.state="loaded",S.texture=this.texture,g=!0)}g&&this.fire(new c.l("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const e of[this.canvas.width,this.canvas.height])if(isNaN(e)||e<=0)return!0;return!1}}const Oo={},Ss=y=>{switch(y){case"geojson":return zo;case"image":return Br;case"raster":return Ba;case"raster-dem":return wl;case"vector":return ca;case"video":return Do;case"canvas":return Sl}return Oo[y]},Ji="RTLPluginLoaded";class hu extends c.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=Wt()}_syncState(e){return this.status=e,this.dispatcher.broadcast("SRPS",{pluginStatus:e,pluginURL:this.url}).catch((s=>{throw this.status="error",s}))}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(e){return c._(this,arguments,void 0,(function*(s,d=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=Y.resolveURL(s),!this.url)throw new Error(`requested url ${s} is invalid`);if(this.status==="unavailable"){if(!d)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if(this.status==="requested")return this._requestImport()}))}_requestImport(){return c._(this,void 0,void 0,(function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new c.l(Ji))}))}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let ua=null;function Hs(){return ua||(ua=new hu),ua}var Fr,Ce;(function(y){y[y.Base=0]="Base",y[y.Parent=1]="Parent"})(Fr||(Fr={})),(function(y){y[y.Departing=0]="Departing",y[y.Incoming=1]="Incoming"})(Ce||(Ce={}));class Q{constructor(e,s){this.timeAdded=0,this.fadeEndTime=0,this.fadeOpacity=1,this.tileID=e,this.uid=c.a7(),this.uses=0,this.tileSize=s,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}isRenderable(e){return this.hasData()&&(!this.fadeEndTime||this.fadeOpacity>0)&&(e||!this.holdingForSymbolFade())}setCrossFadeLogic({fadingRole:e,fadingDirection:s,fadingParentID:d,fadeEndTime:g}){this.resetFadeLogic(),this.fadingRole=e,this.fadingDirection=s,this.fadingParentID=d,this.fadeEndTime=g}setSelfFadeLogic(e){this.resetFadeLogic(),this.selfFading=!0,this.fadeEndTime=e}resetFadeLogic(){this.fadingRole=null,this.fadingDirection=null,this.fadingParentID=null,this.selfFading=!1,this.timeAdded=Y.now(),this.fadeEndTime=0,this.fadeOpacity=1}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}clearTextures(e){this.demTexture&&e.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(e,s,d){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",e){e.featureIndex&&(this.latestFeatureIndex=e.featureIndex,e.rawTileData?(this.latestRawTileData=e.rawTileData,this.latestFeatureIndex.rawTileData=e.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=e.collisionBoxArray,this.buckets=(function(g,_){const S={};if(!_)return S;for(const L of g){const P=L.layerIds.map((O=>_.getLayer(O))).filter(Boolean);if(P.length!==0){L.layers=P,L.stateDependentLayerIds&&(L.stateDependentLayers=L.stateDependentLayerIds.map((O=>P.filter((k=>k.id===O))[0])));for(const O of P)S[O.id]=L}}return S})(e.buckets,s==null?void 0:s.style),this.hasSymbolBuckets=!1;for(const g in this.buckets){const _=this.buckets[g];if(_ instanceof c.a9){if(this.hasSymbolBuckets=!0,!d)break;_.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const g in this.buckets){const _=this.buckets[g];if(_ instanceof c.a9&&_.hasRTLText){this.hasRTLText=!0,Hs().lazyLoad();break}}this.queryPadding=0;for(const g in this.buckets){const _=this.buckets[g];this.queryPadding=Math.max(this.queryPadding,s.style.getLayer(g).queryRadius(_))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage),this.dashPositions=e.dashPositions}else this.collisionBoxArray=new c.a8}unloadVectorData(){for(const e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.dashPositions&&(this.dashPositions=null),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(e){return this.buckets[e.id]}upload(e){for(const d in this.buckets){const g=this.buckets[d];g.uploadPending()&&g.upload(e)}const s=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new c.T(e,this.imageAtlas.image,s.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new c.T(e,this.glyphAtlasImage,s.ALPHA),this.glyphAtlasImage=null)}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,s,d,g,_,S,L,P,O,k,$){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:g,cameraQueryGeometry:_,scale:S,tileSize:this.tileSize,pixelPosMatrix:k,transform:P,params:L,queryPadding:this.queryPadding*O,getElevation:$},e,s,d):{}}querySourceFeatures(e,s){const d=this.latestFeatureIndex;if(!d||!d.rawTileData)return;const g=d.loadVTLayers(),_=s&&s.sourceLayer?s.sourceLayer:"",S=g._geojsonTileLayer||g[_];if(!S)return;const L=c.aa(s==null?void 0:s.filter,s==null?void 0:s.globalState),{z:P,x:O,y:k}=this.tileID.canonical,$={z:P,x:O,y:k};for(let N=0;N<S.length;N++){const q=S.feature(N);if(L.needGeometry){const ae=c.ab(q,!0);if(!L.filter(new c.F(this.tileID.overscaledZ),ae,this.tileID.canonical))continue}else if(!L.filter(new c.F(this.tileID.overscaledZ),q))continue;const K=d.getId(q,_),re=new c.ac(q,P,O,k,K);re.tile=$,e.push(re)}}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(e){const s=this.expirationTime;if(e.cacheControl){const d=c.ad(e.cacheControl);d["max-age"]&&(this.expirationTime=Date.now()+1e3*d["max-age"])}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){const d=Date.now();let g=!1;if(this.expirationTime>d)g=!1;else if(s)if(this.expirationTime<s)g=!0;else{const _=this.expirationTime-s;_?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(e,s){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(e).length===0)return;const d=this.latestFeatureIndex.loadVTLayers();for(const g in this.buckets){if(!s.style.hasLayer(g))continue;const _=this.buckets[g],S=_.layers[0].sourceLayer||"_geojsonTileLayer",L=d[S],P=e[S];if(!L||!P||Object.keys(P).length===0)continue;_.update(P,L,this.imageAtlas&&this.imageAtlas.patternPositions||{},this.dashPositions||{});const O=s&&s.style&&s.style.getLayer(g);O&&(this.queryPadding=Math.max(this.queryPadding,O.queryRadius(_)))}}holdingForSymbolFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<Y.now()}clearSymbolFadeHold(){this.symbolFadeHoldUntil=void 0}setSymbolHoldDuration(e){this.symbolFadeHoldUntil=Y.now()+e}setDependencies(e,s){const d={};for(const g of s)d[g]=!0;this.dependencies[e]=d}hasDependency(e,s){for(const d of e){const g=this.dependencies[d];if(g){for(const _ of s)if(g[_])return!0}}return!1}}class W{constructor(e,s){this.max=e,this.onRemove=s,this.reset()}reset(){for(const e in this.data)for(const s of this.data[e])s.timeout&&clearTimeout(s.timeout),this.onRemove(s.value);return this.data={},this.order=[],this}add(e,s,d){const g=e.wrapped().key;this.data[g]===void 0&&(this.data[g]=[]);const _={value:s,timeout:void 0};if(d!==void 0&&(_.timeout=setTimeout((()=>{this.remove(e,_)}),d)),this.data[g].push(_),this.order.push(g),this.order.length>this.max){const S=this._getAndRemoveByKey(this.order[0]);S&&this.onRemove(S)}return this}has(e){return e.wrapped().key in this.data}getAndRemove(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}_getAndRemoveByKey(e){const s=this.data[e].shift();return s.timeout&&clearTimeout(s.timeout),this.data[e].length===0&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),s.value}getByKey(e){const s=this.data[e];return s?s[0].value:null}get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,s){if(!this.has(e))return this;const d=e.wrapped().key,g=s===void 0?0:this.data[d].indexOf(s),_=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(e){for(this.max=e;this.order.length>this.max;){const s=this._getAndRemoveByKey(this.order[0]);s&&this.onRemove(s)}return this}filter(e){const s=[];for(const d in this.data)for(const g of this.data[d])e(g.value)||s.push(g);for(const d of s)this.remove(d.value.tileID,d)}}class ie{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(e,s,d){const g=String(s);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][g]=this.stateChanges[e][g]||{},c.e(this.stateChanges[e][g],d),this.deletedStates[e]===null){this.deletedStates[e]={};for(const _ in this.state[e])_!==g&&(this.deletedStates[e][_]=null)}else if(this.deletedStates[e]&&this.deletedStates[e][g]===null){this.deletedStates[e][g]={};for(const _ in this.state[e][g])d[_]||(this.deletedStates[e][g][_]=null)}else for(const _ in d)this.deletedStates[e]&&this.deletedStates[e][g]&&this.deletedStates[e][g][_]===null&&delete this.deletedStates[e][g][_]}removeFeatureState(e,s,d){if(this.deletedStates[e]===null)return;const g=String(s);if(this.deletedStates[e]=this.deletedStates[e]||{},d&&s!==void 0)this.deletedStates[e][g]!==null&&(this.deletedStates[e][g]=this.deletedStates[e][g]||{},this.deletedStates[e][g][d]=null);else if(s!==void 0)if(this.stateChanges[e]&&this.stateChanges[e][g])for(d in this.deletedStates[e][g]={},this.stateChanges[e][g])this.deletedStates[e][g][d]=null;else this.deletedStates[e][g]=null;else this.deletedStates[e]=null}getState(e,s){const d=String(s),g=c.e({},(this.state[e]||{})[d],(this.stateChanges[e]||{})[d]);if(this.deletedStates[e]===null)return{};if(this.deletedStates[e]){const _=this.deletedStates[e][s];if(_===null)return{};for(const S in _)delete g[S]}return g}initializeTileState(e,s){e.setFeatureState(this.state,s)}coalesceChanges(e,s){const d={};for(const g in this.stateChanges){this.state[g]=this.state[g]||{};const _={};for(const S in this.stateChanges[g])this.state[g][S]||(this.state[g][S]={}),c.e(this.state[g][S],this.stateChanges[g][S]),_[S]=this.state[g][S];d[g]=_}for(const g in this.deletedStates){this.state[g]=this.state[g]||{};const _={};if(this.deletedStates[g]===null)for(const S in this.state[g])_[S]={},this.state[g][S]={};else for(const S in this.deletedStates[g]){if(this.deletedStates[g][S]===null)this.state[g][S]={};else for(const L of Object.keys(this.deletedStates[g][S]))delete this.state[g][S][L];_[S]=this.state[g][S]}d[g]=d[g]||{},c.e(d[g],_)}if(this.stateChanges={},this.deletedStates={},Object.keys(d).length!==0)for(const g in e)e[g].setFeatureState(d,s)}}const he=89.25;function me(y,e){const s=c.ah(e.lat,-c.ai,c.ai);return new c.P(c.V(e.lng)*y,c.U(s)*y)}function Te(y,e){return new c.a1(e.x/y,e.y/y).toLngLat()}function De(y){return y.cameraToCenterDistance*Math.min(.85*Math.tan(c.ae(90-y.pitch)),Math.tan(c.ae(he-y.pitch)))}function Le(y,e){const s=y.canonical,d=e/c.af(s.z),g=s.x+Math.pow(2,s.z)*y.wrap,_=c.ag(new Float64Array(16));return c.M(_,_,[g*d,s.y*d,0]),c.N(_,_,[d/c.$,d/c.$,1]),_}function Xe(y,e,s,d,g){const _=c.a1.fromLngLat(y,e),S=g*c.aj(1,y.lat),L=S*Math.cos(c.ae(s)),P=Math.sqrt(S*S-L*L),O=P*Math.sin(c.ae(-d)),k=P*Math.cos(c.ae(-d));return new c.a1(_.x+O,_.y+k,_.z+L)}function ct(y,e,s){const d=e.intersectsFrustum(y);if(!s||d===0)return d;const g=e.intersectsPlane(s);return g===0?0:d===2&&g===2?2:1}function Qe(y,e,s){let d=0;const g=(s-e)/10;for(let _=0;_<10;_++)d+=g*Math.pow(Math.cos(e+(_+.5)/10*(s-e)),y);return d}function Pt(y,e){return function(s,d,g,_,S){const L=2*((y-1)/c.ak(Math.cos(c.ae(he-S))/Math.cos(c.ae(he)))-1),P=Math.acos(g/_),O=2*Qe(L-1,0,c.ae(S/2)),k=Math.min(c.ae(he),P+c.ae(S/2)),$=Qe(L-1,Math.min(k,P-c.ae(S/2)),k),N=Math.atan(d/g),q=Math.hypot(d,g);let K=s;return K+=c.ak(_/q/Math.max(.5,Math.cos(c.ae(S/2)))),K+=L*c.ak(Math.cos(N))/2,K-=c.ak(Math.max(1,$/O/e))/2,K}}const Ut=Pt(9.314,3);function Ie(y,e){const s=(e.roundZoom?Math.round:Math.floor)(y.zoom+c.ak(y.tileSize/e.tileSize));return Math.max(0,s)}function mn(y,e){const s=y.getCameraFrustum(),d=y.getClippingPlane(),g=y.screenPointToMercatorCoordinate(y.getCameraPoint()),_=c.a1.fromLngLat(y.center,y.elevation);g.z=_.z+Math.cos(y.pitchInRadians)*y.cameraToCenterDistance/y.worldSize;const S=y.getCoveringTilesDetailsProvider(),L=S.allowVariableZoom(y,e),P=Ie(y,e),O=e.minzoom||0,k=e.maxzoom!==void 0?e.maxzoom:y.maxZoom,$=Math.min(Math.max(0,P),k),N=Math.pow(2,$),q=[N*g.x,N*g.y,0],K=[N*_.x,N*_.y,0],re=Math.hypot(_.x-g.x,_.y-g.y),ae=Math.abs(_.z-g.z),se=Math.hypot(re,ae),ce=_e=>({zoom:0,x:0,y:0,wrap:_e,fullyVisible:!1}),de=[],ue=[];if(y.renderWorldCopies&&S.allowWorldCopies())for(let _e=1;_e<=3;_e++)de.push(ce(-_e)),de.push(ce(_e));for(de.push(ce(0));de.length>0;){const _e=de.pop(),be=_e.x,fe=_e.y;let Ee=_e.fullyVisible;const Ve={x:be,y:fe,z:_e.zoom},ke=S.getTileBoundingVolume(Ve,_e.wrap,y.elevation,e);if(!Ee){const dt=ct(s,ke,d);if(dt===0)continue;Ee=dt===2}const Ne=S.distanceToTile2d(g.x,g.y,Ve,ke);let Ue=P;L&&(Ue=(e.calculateTileZoom||Ut)(y.zoom+c.ak(y.tileSize/e.tileSize),Ne,ae,se,y.fov)),Ue=(e.roundZoom?Math.round:Math.floor)(Ue),Ue=Math.max(0,Ue);const ht=Math.min(Ue,k);if(_e.wrap=S.getWrap(_,Ve,_e.wrap),_e.zoom>=ht){if(_e.zoom<O)continue;const dt=$-_e.zoom,tt=q[0]-.5-(be<<dt),It=q[1]-.5-(fe<<dt),en=e.reparseOverscaled?Math.max(_e.zoom,Ue):_e.zoom;ue.push({tileID:new c.Z(_e.zoom===k?en:_e.zoom,_e.wrap,_e.zoom,be,fe),distanceSq:c.al([K[0]-.5-be,K[1]-.5-fe]),tileDistanceToCamera:Math.sqrt(tt*tt+It*It)})}else for(let dt=0;dt<4;dt++)de.push({zoom:_e.zoom+1,x:(be<<1)+dt%2,y:(fe<<1)+(dt>>1),wrap:_e.wrap,fullyVisible:Ee})}return ue.sort(((_e,be)=>_e.distanceSq-be.distanceSq)).map((_e=>_e.tileID))}const En=c.a2.fromPoints([new c.P(0,0),new c.P(c.$,c.$)]);class Dt extends c.E{constructor(e,s,d){super(),this.id=e,this.dispatcher=d,this.on("data",(g=>this._dataHandler(g))),this.on("dataloading",(()=>{this._sourceErrored=!1})),this.on("error",(()=>{this._sourceErrored=this._source.loaded()})),this._source=((g,_,S,L)=>{const P=new(Ss(_.type))(g,_,S,L);if(P.id!==g)throw new Error(`Expected Source id to be ${g} instead of ${P.id}`);return P})(e,s,d,this),this._tiles={},this._cache=new W(0,(g=>this._unloadTile(g))),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._rasterFadeDuration=0,this._maxFadingAncestorLevels=5,this._state=new ie,this._didEmitContent=!1,this._updated=!1}onAdd(e){this.map=e,this._maxTileCacheSize=e?e._maxTileCacheSize:null,this._maxTileCacheZoomLevels=e?e._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(e)}onRemove(e){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(e)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const e in this._tiles){const s=this._tiles[e];if(s.state!=="loaded"&&s.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(e,s,d){return c._(this,void 0,void 0,(function*(){try{yield this._source.loadTile(e),this._tileLoaded(e,s,d)}catch(g){e.state="errored",g.status!==404?this._source.fire(new c.k(g,{tile:e})):this.update(this.transform,this.terrain)}}))}_unloadTile(e){this._source.unloadTile&&this._source.unloadTile(e)}_abortTile(e){this._source.abortTile&&this._source.abortTile(e),this._source.fire(new c.l("dataabort",{tile:e,coord:e.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const s in this._tiles){const d=this._tiles[s];d.upload(e),d.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map((e=>e.tileID)).sort(Sn).map((e=>e.key))}getRenderableIds(e){const s=[];for(const d in this._tiles)this._isIdRenderable(d,e)&&s.push(this._tiles[d]);return e?s.sort(((d,g)=>{const _=d.tileID,S=g.tileID,L=new c.P(_.canonical.x,_.canonical.y)._rotate(-this.transform.bearingInRadians),P=new c.P(S.canonical.x,S.canonical.y)._rotate(-this.transform.bearingInRadians);return _.overscaledZ-S.overscaledZ||P.y-L.y||P.x-L.x})).map((d=>d.tileID.key)):s.map((d=>d.tileID)).sort(Sn).map((d=>d.key))}hasRenderableParent(e){const s=e.overscaledZ-1;if(s>=this._source.minzoom){const d=this._getLoadedTile(e.scaledTo(s));if(d)return this._isIdRenderable(d.tileID.key)}return!1}_isIdRenderable(e,s=!1){var d;return(d=this._tiles[e])===null||d===void 0?void 0:d.isRenderable(s)}reload(e){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const s in this._tiles)e?this._reloadTile(s,"expired"):this._tiles[s].state!=="errored"&&this._reloadTile(s,"reloading")}}_reloadTile(e,s){return c._(this,void 0,void 0,(function*(){const d=this._tiles[e];d&&(d.state!=="loading"&&(d.state=s),yield this._loadTile(d,e,s))}))}_tileLoaded(e,s,d){e.timeAdded=Y.now(),d==="expired"&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(s,e),this.getSource().type==="raster-dem"&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),e.aborted||this._source.fire(new c.l("data",{dataType:"source",tile:e,coord:e.tileID}))}_backfillDEM(e){const s=this.getRenderableIds();for(let g=0;g<s.length;g++){const _=s[g];if(e.neighboringTiles&&e.neighboringTiles[_]){const S=this.getTileByID(_);d(e,S),d(S,e)}}function d(g,_){g.needsHillshadePrepare=!0,g.needsTerrainPrepare=!0;let S=_.tileID.canonical.x-g.tileID.canonical.x;const L=_.tileID.canonical.y-g.tileID.canonical.y,P=Math.pow(2,g.tileID.canonical.z),O=_.tileID.key;S===0&&L===0||Math.abs(L)>1||(Math.abs(S)>1&&(Math.abs(S+P)===1?S+=P:Math.abs(S-P)===1&&(S-=P)),_.dem&&g.dem&&(g.dem.backfillBorder(_.dem,S,L),g.neighboringTiles&&g.neighboringTiles[O]&&(g.neighboringTiles[O].backfilled=!0)))}}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._tiles[e]}_retainLoadedChildren(e,s){const d=Object.values(e),g=this._getLoadedDescendents(d),_={};for(const S of d){const L=g[S.key];if(!(L!=null&&L.length)){_[S.key]=S;continue}const P=S.overscaledZ+Dt.maxUnderzooming,O=L.filter((N=>N.tileID.overscaledZ<=P));if(!O.length){_[S.key]=S;continue}const k=Math.min(...O.map((N=>N.tileID.overscaledZ))),$=O.filter((N=>N.tileID.overscaledZ===k)).map((N=>N.tileID));for(const N of $)s[N.key]=N;this._areDescendentsComplete($,k,S.overscaledZ)||(_[S.key]=S)}return _}_getLoadedDescendents(e){var s;const d={};for(const g in this._tiles){const _=this._tiles[g];if(_.hasData())for(const S of e)_.tileID.isChildOf(S)&&(d[s=S.key]||(d[s]=[])).push(_)}return d}_areDescendentsComplete(e,s,d){return e.length===1&&e[0].isOverscaled()?e[0].overscaledZ===s:Math.pow(4,s-d)===e.length}_getLoadedTile(e){const s=this._tiles[e.key];return s!=null&&s.hasData()?s:null}updateCacheSize(e){const s=Math.ceil(e.width/this._source.tileSize)+1,d=Math.ceil(e.height/this._source.tileSize)+1,g=Math.floor(s*d*(this._maxTileCacheZoomLevels===null?c.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),_=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,g):g;this._cache.setMaxSize(_)}handleWrapJump(e){const s=Math.round((e-(this._prevLng===void 0?e:this._prevLng))/360);if(this._prevLng=e,s){const d={};for(const g in this._tiles){const _=this._tiles[g];_.tileID=_.tileID.unwrapTo(_.tileID.wrap+s),d[_.tileID.key]=_}this._tiles=d;for(const g in this._timers)clearTimeout(this._timers[g]),delete this._timers[g];for(const g in this._tiles)this._setTileReloadTimer(g,this._tiles[g])}}update(e,s){if(!this._sourceLoaded||this._paused)return;let d;this.transform=e,this.terrain=s,this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this.used||this.usedForTerrain?this._source.tileID?d=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((P=>new c.Z(P.canonical.z,P.wrap,P.canonical.z,P.canonical.x,P.canonical.y))):(d=mn(e,{tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:s,calculateTileZoom:this._source.calculateTileZoom}),this._source.hasTile&&(d=d.filter((P=>this._source.hasTile(P))))):d=[],this.usedForTerrain&&(d=this._addTerrainIdealTiles(d));const g=d.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,g&&this.fire(new c.l("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const _=Ie(e,this._source),S=this._updateRetainedTiles(d,_),L=Ni(this._source.type);L&&this._rasterFadeDuration>0&&!s&&this._updateFadingTiles(d,S),L?this._cleanUpRasterTiles(S):this._cleanUpVectorTiles(S)}_cleanUpRasterTiles(e){for(const s in this._tiles)e[s]||this._removeTile(s)}_cleanUpVectorTiles(e){for(const s in this._tiles){const d=this._tiles[s];e[s]?d.clearSymbolFadeHold():d.hasSymbolBuckets?d.holdingForSymbolFade()?d.symbolFadeFinished()&&this._removeTile(s):d.setSymbolHoldDuration(this.map._fadeDuration):this._removeTile(s)}}_addTerrainIdealTiles(e){const s=[];for(const d of e)if(d.canonical.z>this._source.minzoom){const g=d.scaledTo(d.canonical.z-1);s.push(g);const _=d.scaledTo(Math.max(this._source.minzoom,Math.min(d.canonical.z,5)));s.push(_)}return e.concat(s)}releaseSymbolFadeTiles(){for(const e in this._tiles)this._tiles[e].holdingForSymbolFade()&&this._removeTile(e)}_updateRetainedTiles(e,s){var d;const g={},_={},S=Math.max(s-Dt.maxOverzooming,this._source.minzoom);let L={};for(const P of e){const O=this._addTile(P);g[P.key]=P,O.hasData()||(L[P.key]=P)}L=this._retainLoadedChildren(L,g);for(const P in L){const O=L[P];let k=this._tiles[P],$=k==null?void 0:k.wasRequested();for(let N=O.overscaledZ-1;N>=S;--N){const q=O.scaledTo(N);if(_[q.key])break;if(_[q.key]=!0,k=this.getTile(q),!k&&$&&(k=this._addTile(q)),k){const K=k.hasData();if((K||!(!((d=this.map)===null||d===void 0)&&d.cancelPendingTileRequestsWhileZooming)||$)&&(g[q.key]=q),$=k.wasRequested(),K)break}}}return g}_updateFadingTiles(e,s){const d=Y.now(),g=c.am(e);for(const _ of e){const S=this._tiles[_.key];S.fadingDirection!==Ce.Departing&&S.fadeOpacity!==0||S.resetFadeLogic(),this._updateFadingAncestor(S,s,d)||this._updateFadingDescendents(S,s,d)||this._updateFadingEdge(S,g,d)||S.resetFadeLogic()}}_updateFadingAncestor(e,s,d){if(!e.hasData())return!1;const{tileID:g,fadingRole:_,fadingDirection:S,fadingParentID:L}=e;if(_===Fr.Base&&S===Ce.Incoming&&L)return s[L.key]=L,!0;const P=Math.max(g.overscaledZ-this._maxFadingAncestorLevels,this._source.minzoom);for(let O=g.overscaledZ-1;O>=P;O--){const k=g.scaledTo(O),$=this._getLoadedTile(k);if($)return e.setCrossFadeLogic({fadingRole:Fr.Base,fadingDirection:Ce.Incoming,fadingParentID:$.tileID,fadeEndTime:d+this._rasterFadeDuration}),$.setCrossFadeLogic({fadingRole:Fr.Parent,fadingDirection:Ce.Departing,fadeEndTime:d+this._rasterFadeDuration}),s[k.key]=k,!0}return!1}_updateFadingDescendents(e,s,d){if(!e.hasData())return!1;const g=e.tileID.children(this._source.maxzoom);let _=this._updateFadingChildren(e,g,s,d);if(_)return!0;for(const S of g){const L=S.children(this._source.maxzoom);this._updateFadingChildren(e,L,s,d)&&(_=!0)}return _}_updateFadingChildren(e,s,d,g){if(s[0].overscaledZ>=this._source.maxzoom)return!1;let _=!1;for(const S of s){const L=this._getLoadedTile(S);if(!L)continue;const{fadingRole:P,fadingDirection:O,fadingParentID:k}=L;P===Fr.Base&&O===Ce.Departing&&k||(L.setCrossFadeLogic({fadingRole:Fr.Base,fadingDirection:Ce.Departing,fadingParentID:e.tileID,fadeEndTime:g+this._rasterFadeDuration}),e.setCrossFadeLogic({fadingRole:Fr.Parent,fadingDirection:Ce.Incoming,fadeEndTime:g+this._rasterFadeDuration})),d[S.key]=S,_=!0}return _}_updateFadingEdge(e,s,d){const g=e.tileID;return!!e.selfFading||!e.hasData()&&!!s.has(g)&&(e.setSelfFadeLogic(d+this._rasterFadeDuration),!0)}_addTile(e){let s=this._tiles[e.key];if(s)return s;s=this._cache.getAndRemove(e),s&&(s.resetFadeLogic(),this._setTileReloadTimer(e.key,s),s.tileID=e,this._state.initializeTileState(s,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,s)));const d=s;return s||(s=new Q(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(s,e.key,s.state)),s.uses++,this._tiles[e.key]=s,d||this._source.fire(new c.l("dataloading",{tile:s,coord:s.tileID,dataType:"source"})),s}_setTileReloadTimer(e,s){e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);const d=s.getExpiryTimeout();d&&(this._timers[e]=setTimeout((()=>{this._reloadTile(e,"expired"),delete this._timers[e]}),d))}refreshTiles(e){for(const s in this._tiles)(this._isIdRenderable(s)||this._tiles[s].state=="errored")&&e.some((d=>d.equals(this._tiles[s].tileID.canonical)))&&this._reloadTile(s,"expired")}_removeTile(e){const s=this._tiles[e];s&&(s.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),s.uses>0||(s.hasData()&&s.state!=="reloading"?this._cache.add(s.tileID,s,s.getExpiryTimeout()):(s.aborted=!0,this._abortTile(s),this._unloadTile(s))))}_dataHandler(e){e.dataType==="source"&&(e.sourceDataType!=="metadata"?e.sourceDataType==="content"&&this._sourceLoaded&&!this._paused&&(this.reload(e.sourceDataChanged),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0):this._sourceLoaded=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const e in this._tiles)this._removeTile(e);this._cache.reset()}tilesIn(e,s,d){const g=[],_=this.transform;if(!_)return g;const S=_.getCoveringTilesDetailsProvider().allowWorldCopies(),L=d?_.getCameraQueryGeometry(e):e,P=q=>_.screenPointToMercatorCoordinate(q,this.terrain),O=this.transformBbox(e,P,!S),k=this.transformBbox(L,P,!S),$=this.getIds(),N=c.a2.fromPoints(k);for(let q=0;q<$.length;q++){const K=this._tiles[$[q]];if(K.holdingForSymbolFade())continue;const re=S?[K.tileID]:[K.tileID.unwrapTo(-1),K.tileID.unwrapTo(0)],ae=Math.pow(2,_.zoom-K.tileID.overscaledZ),se=s*K.queryPadding*c.$/K.tileSize/ae;for(const ce of re){const de=N.map((ue=>ce.getTilePoint(new c.a1(ue.x,ue.y))));if(de.expandBy(se),de.intersects(En)){const ue=O.map((be=>ce.getTilePoint(be))),_e=k.map((be=>ce.getTilePoint(be)));g.push({tile:K,tileID:S?ce:ce.unwrapTo(0),queryGeometry:ue,cameraQueryGeometry:_e,scale:ae})}}}return g}transformBbox(e,s,d){let g=e.map(s);if(d){const _=c.a2.fromPoints(e);_.shrinkBy(.001*Math.min(_.width(),_.height()));const S=_.map(s);c.a2.fromPoints(g).covers(S)||(g=g.map((L=>L.x>.5?new c.a1(L.x-1,L.y,L.z):L)))}return g}getVisibleCoordinates(e){const s=this.getRenderableIds(e).map((d=>this._tiles[d].tileID));return this.transform&&this.transform.populateCache(s),s}hasTransition(){if(this._source.hasTransition())return!0;if(Ni(this._source.type)&&this._rasterFadeDuration>0){const e=Y.now();for(const s in this._tiles)if(this._tiles[s].fadeEndTime>=e)return!0}return!1}setRasterFadeDuration(e){this._rasterFadeDuration=e}setFeatureState(e,s,d){this._state.updateState(e=e||"_geojsonTileLayer",s,d)}removeFeatureState(e,s,d){this._state.removeFeatureState(e=e||"_geojsonTileLayer",s,d)}getFeatureState(e,s){return this._state.getState(e=e||"_geojsonTileLayer",s)}setDependencies(e,s,d){const g=this._tiles[e];g&&g.setDependencies(s,d)}reloadTilesForDependencies(e,s){for(const d in this._tiles)this._tiles[d].hasDependency(e,s)&&this._reloadTile(d,"reloading");this._cache.filter((d=>!d.hasDependency(e,s)))}}function Sn(y,e){const s=Math.abs(2*y.wrap)-+(y.wrap<0),d=Math.abs(2*e.wrap)-+(e.wrap<0);return y.overscaledZ-e.overscaledZ||d-s||e.canonical.y-y.canonical.y||e.canonical.x-y.canonical.x}function Ni(y){return y==="raster"||y==="image"||y==="video"}Dt.maxOverzooming=10,Dt.maxUnderzooming=3;class Ai{constructor(e,s){this.reset(e,s)}reset(e,s){this.points=e||[],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(s||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(e){if(this.points.length===1)return this.points[0];e=c.ah(e,0,1);let s=1,d=this._distances[s];const g=e*this.paddedLength+this.padding;for(;d<g&&s<this._distances.length;)d=this._distances[++s];const _=s-1,S=this._distances[_],L=d-S,P=L>0?(g-S)/L:0;return this.points[_].mult(1-P).add(this.points[s].mult(P))}}function Zi(y,e){let s=!0;return y==="always"||y!=="never"&&e!=="never"||(s=!1),s}class ur{constructor(e,s,d){const g=this.boxCells=[],_=this.circleCells=[];this.xCellCount=Math.ceil(e/d),this.yCellCount=Math.ceil(s/d);for(let S=0;S<this.xCellCount*this.yCellCount;S++)g.push([]),_.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=e,this.height=s,this.xScale=this.xCellCount/e,this.yScale=this.yCellCount/s,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(e,s,d,g,_){this._forEachCell(s,d,g,_,this._insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(s),this.bboxes.push(d),this.bboxes.push(g),this.bboxes.push(_)}insertCircle(e,s,d,g){this._forEachCell(s-g,d-g,s+g,d+g,this._insertCircleCell,this.circleUid++),this.circleKeys.push(e),this.circles.push(s),this.circles.push(d),this.circles.push(g)}_insertBoxCell(e,s,d,g,_,S){this.boxCells[_].push(S)}_insertCircleCell(e,s,d,g,_,S){this.circleCells[_].push(S)}_query(e,s,d,g,_,S,L){if(d<0||e>this.width||g<0||s>this.height)return[];const P=[];if(e<=0&&s<=0&&this.width<=d&&this.height<=g){if(_)return[{key:null,x1:e,y1:s,x2:d,y2:g}];for(let O=0;O<this.boxKeys.length;O++)P.push({key:this.boxKeys[O],x1:this.bboxes[4*O],y1:this.bboxes[4*O+1],x2:this.bboxes[4*O+2],y2:this.bboxes[4*O+3]});for(let O=0;O<this.circleKeys.length;O++){const k=this.circles[3*O],$=this.circles[3*O+1],N=this.circles[3*O+2];P.push({key:this.circleKeys[O],x1:k-N,y1:$-N,x2:k+N,y2:$+N})}}else this._forEachCell(e,s,d,g,this._queryCell,P,{hitTest:_,overlapMode:S,seenUids:{box:{},circle:{}}},L);return P}query(e,s,d,g){return this._query(e,s,d,g,!1,null)}hitTest(e,s,d,g,_,S){return this._query(e,s,d,g,!0,_,S).length>0}hitTestCircle(e,s,d,g,_){const S=e-d,L=e+d,P=s-d,O=s+d;if(L<0||S>this.width||O<0||P>this.height)return!1;const k=[];return this._forEachCell(S,P,L,O,this._queryCellCircle,k,{hitTest:!0,overlapMode:g,circle:{x:e,y:s,radius:d},seenUids:{box:{},circle:{}}},_),k.length>0}_queryCell(e,s,d,g,_,S,L,P){const{seenUids:O,hitTest:k,overlapMode:$}=L,N=this.boxCells[_];if(N!==null){const K=this.bboxes;for(const re of N)if(!O.box[re]){O.box[re]=!0;const ae=4*re,se=this.boxKeys[re];if(e<=K[ae+2]&&s<=K[ae+3]&&d>=K[ae+0]&&g>=K[ae+1]&&(!P||P(se))&&(!k||!Zi($,se.overlapMode))&&(S.push({key:se,x1:K[ae],y1:K[ae+1],x2:K[ae+2],y2:K[ae+3]}),k))return!0}}const q=this.circleCells[_];if(q!==null){const K=this.circles;for(const re of q)if(!O.circle[re]){O.circle[re]=!0;const ae=3*re,se=this.circleKeys[re];if(this._circleAndRectCollide(K[ae],K[ae+1],K[ae+2],e,s,d,g)&&(!P||P(se))&&(!k||!Zi($,se.overlapMode))){const ce=K[ae],de=K[ae+1],ue=K[ae+2];if(S.push({key:se,x1:ce-ue,y1:de-ue,x2:ce+ue,y2:de+ue}),k)return!0}}}return!1}_queryCellCircle(e,s,d,g,_,S,L,P){const{circle:O,seenUids:k,overlapMode:$}=L,N=this.boxCells[_];if(N!==null){const K=this.bboxes;for(const re of N)if(!k.box[re]){k.box[re]=!0;const ae=4*re,se=this.boxKeys[re];if(this._circleAndRectCollide(O.x,O.y,O.radius,K[ae+0],K[ae+1],K[ae+2],K[ae+3])&&(!P||P(se))&&!Zi($,se.overlapMode))return S.push(!0),!0}}const q=this.circleCells[_];if(q!==null){const K=this.circles;for(const re of q)if(!k.circle[re]){k.circle[re]=!0;const ae=3*re,se=this.circleKeys[re];if(this._circlesCollide(K[ae],K[ae+1],K[ae+2],O.x,O.y,O.radius)&&(!P||P(se))&&!Zi($,se.overlapMode))return S.push(!0),!0}}}_forEachCell(e,s,d,g,_,S,L,P){const O=this._convertToXCellCoord(e),k=this._convertToYCellCoord(s),$=this._convertToXCellCoord(d),N=this._convertToYCellCoord(g);for(let q=O;q<=$;q++)for(let K=k;K<=N;K++)if(_.call(this,e,s,d,g,this.xCellCount*K+q,S,L,P))return}_convertToXCellCoord(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))}_convertToYCellCoord(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))}_circlesCollide(e,s,d,g,_,S){const L=g-e,P=_-s,O=d+S;return O*O>L*L+P*P}_circleAndRectCollide(e,s,d,g,_,S,L){const P=(S-g)/2,O=Math.abs(e-(g+P));if(O>P+d)return!1;const k=(L-_)/2,$=Math.abs(s-(_+k));if($>k+d)return!1;if(O<=P||$<=k)return!0;const N=O-P,q=$-k;return N*N+q*q<=d*d}}function Kn(y,e,s){const d=c.L();if(!y){const{vecSouth:$,vecEast:N}=On(e),q=B();q[0]=N[0],q[1]=N[1],q[2]=$[0],q[3]=$[1],g=q,(k=(S=(_=q)[0])*(O=_[3])-(P=_[2])*(L=_[1]))&&(g[0]=O*(k=1/k),g[1]=-L*k,g[2]=-P*k,g[3]=S*k),d[0]=q[0],d[1]=q[1],d[4]=q[2],d[5]=q[3]}var g,_,S,L,P,O,k;return c.N(d,d,[1/s,1/s,1]),d}function Gi(y,e,s,d){if(y){const g=c.L();if(!e){const{vecSouth:_,vecEast:S}=On(s);g[0]=S[0],g[1]=S[1],g[4]=_[0],g[5]=_[1]}return c.N(g,g,[d,d,1]),g}return s.pixelsToClipSpaceMatrix}function On(y){const e=Math.cos(y.rollInRadians),s=Math.sin(y.rollInRadians),d=Math.cos(y.pitchInRadians),g=Math.cos(y.bearingInRadians),_=Math.sin(y.bearingInRadians),S=c.ar();S[0]=-g*d*s-_*e,S[1]=-_*d*s+g*e;const L=c.as(S);L<1e-9?c.at(S):c.au(S,S,1/L);const P=c.ar();P[0]=g*d*e-_*s,P[1]=_*d*e+g*s;const O=c.as(P);return O<1e-9?c.at(P):c.au(P,P,1/O),{vecEast:P,vecSouth:S}}function rt(y,e,s,d){let g;d?(g=[y,e,d(y,e),1],c.aw(g,g,s)):(g=[y,e,0,1],bi(g,g,s));const _=g[3];return{point:new c.P(g[0]/_,g[1]/_),signedDistanceFromCamera:_,isOccluded:!1}}function is(y,e){return .5+y/e*.5}function Yr(y,e){return y.x>=-e[0]&&y.x<=e[0]&&y.y>=-e[1]&&y.y<=e[1]}function qi(y,e,s,d,g,_,S,L,P,O,k,$,N){const q=s?y.textSizeData:y.iconSizeData,K=c.an(q,e.transform.zoom),re=[256/e.width*2+1,256/e.height*2+1],ae=s?y.text.dynamicLayoutVertexArray:y.icon.dynamicLayoutVertexArray;ae.clear();const se=y.lineVertexArray,ce=s?y.text.placedSymbolArray:y.icon.placedSymbolArray,de=e.transform.width/e.transform.height;let ue=!1;for(let _e=0;_e<ce.length;_e++){const be=ce.get(_e);if(be.hidden||be.writingMode===c.ao.vertical&&!ue){Qr(be.numGlyphs,ae);continue}ue=!1;const fe=new c.P(be.anchorX,be.anchorY),Ee={getElevation:N,pitchedLabelPlaneMatrix:d,lineVertexArray:se,pitchWithMap:_,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:e.transform,tileAnchorPoint:fe,unwrappedTileID:P,width:O,height:k,translation:$},Ve=rn(be.anchorX,be.anchorY,Ee);if(!Yr(Ve.point,re)){Qr(be.numGlyphs,ae);continue}const ke=is(e.transform.cameraToCenterDistance,Ve.signedDistanceFromCamera),Ne=c.ap(q,K,be),Ue=_?Ne*e.transform.getPitchedTextCorrection(be.anchorX,be.anchorY,P)/ke:Ne*ke,ht=on({projectionContext:Ee,pitchedLabelPlaneMatrixInverse:g,symbol:be,fontSize:Ue,flip:!1,keepUpright:S,glyphOffsetArray:y.glyphOffsetArray,dynamicLayoutVertexArray:ae,aspectRatio:de,rotateToLine:L});ue=ht.useVertical,(ht.notEnoughRoom||ue||ht.needsFlipping&&on({projectionContext:Ee,pitchedLabelPlaneMatrixInverse:g,symbol:be,fontSize:Ue,flip:!0,keepUpright:S,glyphOffsetArray:y.glyphOffsetArray,dynamicLayoutVertexArray:ae,aspectRatio:de,rotateToLine:L}).notEnoughRoom)&&Qr(be.numGlyphs,ae)}s?y.text.dynamicLayoutVertexBuffer.updateData(ae):y.icon.dynamicLayoutVertexBuffer.updateData(ae)}function An(y,e,s,d,g,_,S,L){const P=_.glyphStartIndex+_.numGlyphs,O=_.lineStartIndex,k=_.lineStartIndex+_.lineLength,$=e.getoffsetX(_.glyphStartIndex),N=e.getoffsetX(P-1),q=Fa(y*$,s,d,g,_.segment,O,k,L,S);if(!q)return null;const K=Fa(y*N,s,d,g,_.segment,O,k,L,S);return K?L.projectionCache.anyProjectionOccluded?null:{first:q,last:K}:null}function ut(y,e,s,d){return y===c.ao.horizontal&&Math.abs(s.y-e.y)>Math.abs(s.x-e.x)*d?{useVertical:!0}:(y===c.ao.vertical?e.y<s.y:e.x>s.x)?{needsFlipping:!0}:null}function on(y){const{projectionContext:e,pitchedLabelPlaneMatrixInverse:s,symbol:d,fontSize:g,flip:_,keepUpright:S,glyphOffsetArray:L,dynamicLayoutVertexArray:P,aspectRatio:O,rotateToLine:k}=y,$=g/24,N=d.lineOffsetX*$,q=d.lineOffsetY*$;let K;if(d.numGlyphs>1){const re=d.glyphStartIndex+d.numGlyphs,ae=d.lineStartIndex,se=d.lineStartIndex+d.lineLength,ce=An($,L,N,q,_,d,k,e);if(!ce)return{notEnoughRoom:!0};const de=rs(ce.first.point.x,ce.first.point.y,e,s),ue=rs(ce.last.point.x,ce.last.point.y,e,s);if(S&&!_){const _e=ut(d.writingMode,de,ue,O);if(_e)return _e}K=[ce.first];for(let _e=d.glyphStartIndex+1;_e<re-1;_e++){const be=Fa($*L.getoffsetX(_e),N,q,_,d.segment,ae,se,e,k);if(!be)return{notEnoughRoom:!0};K.push(be)}K.push(ce.last)}else{if(S&&!_){const ae=Cs(e.tileAnchorPoint.x,e.tileAnchorPoint.y,e).point,se=d.lineStartIndex+d.segment+1,ce=new c.P(e.lineVertexArray.getx(se),e.lineVertexArray.gety(se)),de=Cs(ce.x,ce.y,e),ue=de.signedDistanceFromCamera>0?de.point:cn(e.tileAnchorPoint,ce,ae,1,e),_e=rs(ae.x,ae.y,e,s),be=rs(ue.x,ue.y,e,s),fe=ut(d.writingMode,_e,be,O);if(fe)return fe}const re=Fa($*L.getoffsetX(d.glyphStartIndex),N,q,_,d.segment,d.lineStartIndex,d.lineStartIndex+d.lineLength,e,k);if(!re||e.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};K=[re]}for(const re of K)c.av(P,re.point,re.angle);return{}}function cn(y,e,s,d,g){const _=y.add(y.sub(e)._unit()),S=Cs(_.x,_.y,g).point,L=s.sub(S);return s.add(L._mult(d/L.mag()))}function ha(y,e,s){const d=e.projectionCache;if(d.projections[y])return d.projections[y];const g=new c.P(e.lineVertexArray.getx(y),e.lineVertexArray.gety(y)),_=Cs(g.x,g.y,e);if(_.signedDistanceFromCamera>0)return d.projections[y]=_.point,d.anyProjectionOccluded=d.anyProjectionOccluded||_.isOccluded,_.point;const S=y-s.direction;return cn(s.distanceFromAnchor===0?e.tileAnchorPoint:new c.P(e.lineVertexArray.getx(S),e.lineVertexArray.gety(S)),g,s.previousVertex,s.absOffsetX-s.distanceFromAnchor+1,e)}function Cs(y,e,s){const d=y+s.translation[0],g=e+s.translation[1];let _;return s.pitchWithMap?(_=rt(d,g,s.pitchedLabelPlaneMatrix,s.getElevation),_.isOccluded=!1):(_=s.transform.projectTileCoordinates(d,g,s.unwrappedTileID,s.getElevation),_.point.x=(.5*_.point.x+.5)*s.width,_.point.y=(.5*-_.point.y+.5)*s.height),_}function rs(y,e,s,d){if(s.pitchWithMap){const g=[y,e,0,1];return c.aw(g,g,d),s.transform.projectTileCoordinates(g[0]/g[3],g[1]/g[3],s.unwrappedTileID,s.getElevation).point}return{x:y/s.width*2-1,y:1-e/s.height*2}}function rn(y,e,s){return s.transform.projectTileCoordinates(y,e,s.unwrappedTileID,s.getElevation)}function ko(y,e,s){return y._unit()._perp()._mult(e*s)}function Ts(y,e,s,d,g,_,S,L,P){if(L.projectionCache.offsets[y])return L.projectionCache.offsets[y];const O=s.add(e);if(y+P.direction<d||y+P.direction>=g)return L.projectionCache.offsets[y]=O,O;const k=ha(y+P.direction,L,P),$=ko(k.sub(s),S,P.direction),N=s.add($),q=k.add($);return L.projectionCache.offsets[y]=c.ax(_,O,N,q)||O,L.projectionCache.offsets[y]}function Fa(y,e,s,d,g,_,S,L,P){const O=d?y-e:y+e;let k=O>0?1:-1,$=0;d&&(k*=-1,$=Math.PI),k<0&&($+=Math.PI);let N,q=k>0?_+g:_+g+1;L.projectionCache.cachedAnchorPoint?N=L.projectionCache.cachedAnchorPoint:(N=Cs(L.tileAnchorPoint.x,L.tileAnchorPoint.y,L).point,L.projectionCache.cachedAnchorPoint=N);let K,re,ae=N,se=N,ce=0,de=0;const ue=Math.abs(O),_e=[];let be;for(;ce+de<=ue;){if(q+=k,q<_||q>=S)return null;ce+=de,se=ae,re=K;const Ve={absOffsetX:ue,direction:k,distanceFromAnchor:ce,previousVertex:se};if(ae=ha(q,L,Ve),s===0)_e.push(se),be=ae.sub(se);else{let ke;const Ne=ae.sub(se);ke=Ne.mag()===0?ko(ha(q+k,L,Ve).sub(ae),s,k):ko(Ne,s,k),re||(re=se.add(ke)),K=Ts(q,ke,ae,_,S,re,s,L,Ve),_e.push(re),be=K.sub(re)}de=be.mag()}const fe=be._mult((ue-ce)/de)._add(re||se),Ee=$+Math.atan2(ae.y-se.y,ae.x-se.x);return _e.push(fe),{point:fe,angle:P?Ee:0,path:_e}}const Xs=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Qr(y,e){for(let s=0;s<y;s++){const d=e.length;e.resize(d+4),e.float32.set(Xs,3*d)}}function bi(y,e,s){const d=e[0],g=e[1];return y[0]=s[0]*d+s[4]*g+s[12],y[1]=s[1]*d+s[5]*g+s[13],y[3]=s[3]*d+s[7]*g+s[15],y}const Pi=100;class Wr{constructor(e,s=new ur(e.width+200,e.height+200,25),d=new ur(e.width+200,e.height+200,25)){this.transform=e,this.grid=s,this.ignoredGrid=d,this.pitchFactor=Math.cos(e.pitch*Math.PI/180)*e.cameraToCenterDistance,this.screenRightBoundary=e.width+Pi,this.screenBottomBoundary=e.height+Pi,this.gridRightBoundary=e.width+200,this.gridBottomBoundary=e.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(e,s,d,g,_,S,L,P,O,k,$,N){const q=this.projectAndGetPerspectiveRatio(e.anchorPointX+P[0],e.anchorPointY+P[1],_,k,N),K=d*q.perspectiveRatio;let re;if(S||L)re=this._projectCollisionBox(e,K,g,_,S,L,P,q,k,$,N);else{const be=q.x+($?$.x*K:0),fe=q.y+($?$.y*K:0);re={allPointsOccluded:!1,box:[be+e.x1*K,fe+e.y1*K,be+e.x2*K,fe+e.y2*K]}}const[ae,se,ce,de]=re.box,ue=S?re.allPointsOccluded:q.isOccluded;let _e=ue;return _e||(_e=q.perspectiveRatio<this.perspectiveRatioCutoff),_e||(_e=!this.isInsideGrid(ae,se,ce,de)),_e||s!=="always"&&this.grid.hitTest(ae,se,ce,de,s,O)?{box:[ae,se,ce,de],placeable:!1,offscreen:!1,occluded:ue}:{box:[ae,se,ce,de],placeable:!0,offscreen:this.isOffscreen(ae,se,ce,de),occluded:ue}}placeCollisionCircles(e,s,d,g,_,S,L,P,O,k,$,N,q,K){const re=[],ae=new c.P(s.anchorX,s.anchorY),se=this.getPerspectiveRatio(ae.x,ae.y,S,K),ce=(O?_*this.transform.getPitchedTextCorrection(s.anchorX,s.anchorY,S)/se:_*se)/c.aB,de={getElevation:K,pitchedLabelPlaneMatrix:L,lineVertexArray:d,pitchWithMap:O,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:this.transform,tileAnchorPoint:ae,unwrappedTileID:S,width:this.transform.width,height:this.transform.height,translation:q},ue=An(ce,g,s.lineOffsetX*ce,s.lineOffsetY*ce,!1,s,!1,de);let _e=!1,be=!1,fe=!0;if(ue){const Ee=.5*$*se+N,Ve=new c.P(-100,-100),ke=new c.P(this.screenRightBoundary,this.screenBottomBoundary),Ne=new Ai,Ue=ue.first,ht=ue.last;let dt=[];for(let en=Ue.path.length-1;en>=1;en--)dt.push(Ue.path[en]);for(let en=1;en<ht.path.length;en++)dt.push(ht.path[en]);const tt=2.5*Ee;if(O){const en=this.projectPathToScreenSpace(dt,de);dt=en.some((Mn=>Mn.signedDistanceFromCamera<=0))?[]:en.map((Mn=>Mn.point))}let It=[];if(dt.length>0){const en=dt[0].clone(),Mn=dt[0].clone();for(let Nn=1;Nn<dt.length;Nn++)en.x=Math.min(en.x,dt[Nn].x),en.y=Math.min(en.y,dt[Nn].y),Mn.x=Math.max(Mn.x,dt[Nn].x),Mn.y=Math.max(Mn.y,dt[Nn].y);It=en.x>=Ve.x&&Mn.x<=ke.x&&en.y>=Ve.y&&Mn.y<=ke.y?[dt]:Mn.x<Ve.x||en.x>ke.x||Mn.y<Ve.y||en.y>ke.y?[]:c.ay([dt],Ve.x,Ve.y,ke.x,ke.y)}for(const en of It){Ne.reset(en,.25*Ee);let Mn=0;Mn=Ne.length<=.5*Ee?1:Math.ceil(Ne.paddedLength/tt)+1;for(let Nn=0;Nn<Mn;Nn++){const Un=Nn/Math.max(Mn-1,1),hi=Ne.lerp(Un),ii=hi.x+Pi,yn=hi.y+Pi;re.push(ii,yn,Ee,0);const vi=ii-Ee,_r=yn-Ee,zi=ii+Ee,Di=yn+Ee;if(fe=fe&&this.isOffscreen(vi,_r,zi,Di),be=be||this.isInsideGrid(vi,_r,zi,Di),e!=="always"&&this.grid.hitTestCircle(ii,yn,Ee,e,k)&&(_e=!0,!P))return{circles:[],offscreen:!1,collisionDetected:_e}}}}return{circles:!P&&_e||!be||se<this.perspectiveRatioCutoff?[]:re,offscreen:fe,collisionDetected:_e}}projectPathToScreenSpace(e,s){const d=(function(g,_){const S=c.L();return c.aq(S,_.pitchedLabelPlaneMatrix),g.map((L=>{const P=rt(L.x,L.y,S,_.getElevation),O=_.transform.projectTileCoordinates(P.point.x,P.point.y,_.unwrappedTileID,_.getElevation);return O.point.x=(.5*O.point.x+.5)*_.width,O.point.y=(.5*-O.point.y+.5)*_.height,O}))})(e,s);return(function(g){let _=0,S=0,L=0,P=0;for(let O=0;O<g.length;O++)g[O].isOccluded?(L=O+1,P=0):(P++,P>S&&(S=P,_=L));return g.slice(_,_+S)})(d)}queryRenderedSymbols(e){if(e.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};const s=[],d=new c.a2;for(const $ of e){const N=new c.P($.x+Pi,$.y+Pi);d.extend(N),s.push(N)}const{minX:g,minY:_,maxX:S,maxY:L}=d,P=this.grid.query(g,_,S,L).concat(this.ignoredGrid.query(g,_,S,L)),O={},k={};for(const $ of P){const N=$.key;if(O[N.bucketInstanceId]===void 0&&(O[N.bucketInstanceId]={}),O[N.bucketInstanceId][N.featureIndex])continue;const q=[new c.P($.x1,$.y1),new c.P($.x2,$.y1),new c.P($.x2,$.y2),new c.P($.x1,$.y2)];c.az(s,q)&&(O[N.bucketInstanceId][N.featureIndex]=!0,k[N.bucketInstanceId]===void 0&&(k[N.bucketInstanceId]=[]),k[N.bucketInstanceId].push(N.featureIndex))}return k}insertCollisionBox(e,s,d,g,_,S){(d?this.ignoredGrid:this.grid).insert({bucketInstanceId:g,featureIndex:_,collisionGroupID:S,overlapMode:s},e[0],e[1],e[2],e[3])}insertCollisionCircles(e,s,d,g,_,S){const L=d?this.ignoredGrid:this.grid,P={bucketInstanceId:g,featureIndex:_,collisionGroupID:S,overlapMode:s};for(let O=0;O<e.length;O+=4)L.insertCircle(P,e[O],e[O+1],e[O+2])}projectAndGetPerspectiveRatio(e,s,d,g,_){if(_){let S;g?(S=[e,s,g(e,s),1],c.aw(S,S,_)):(S=[e,s,0,1],bi(S,S,_));const L=S[3];return{x:(S[0]/L+1)/2*this.transform.width+Pi,y:(-S[1]/L+1)/2*this.transform.height+Pi,perspectiveRatio:.5+this.transform.cameraToCenterDistance/L*.5,isOccluded:!1,signedDistanceFromCamera:L}}{const S=this.transform.projectTileCoordinates(e,s,d,g);return{x:(S.point.x+1)/2*this.transform.width+Pi,y:(1-S.point.y)/2*this.transform.height+Pi,perspectiveRatio:.5+this.transform.cameraToCenterDistance/S.signedDistanceFromCamera*.5,isOccluded:S.isOccluded,signedDistanceFromCamera:S.signedDistanceFromCamera}}}getPerspectiveRatio(e,s,d,g){const _=this.transform.projectTileCoordinates(e,s,d,g);return .5+this.transform.cameraToCenterDistance/_.signedDistanceFromCamera*.5}isOffscreen(e,s,d,g){return d<Pi||e>=this.screenRightBoundary||g<Pi||s>this.screenBottomBoundary}isInsideGrid(e,s,d,g){return d>=0&&e<this.gridRightBoundary&&g>=0&&s<this.gridBottomBoundary}getViewportMatrix(){const e=c.ag([]);return c.M(e,e,[-100,-100,0]),e}_projectCollisionBox(e,s,d,g,_,S,L,P,O,k,$){let N=1,q=0,K=0,re=1;const ae=e.anchorPointX+L[0],se=e.anchorPointY+L[1];if(S&&!_){const dt=this.projectAndGetPerspectiveRatio(ae+1,se,g,O,$),tt=dt.x-P.x,It=Math.atan((dt.y-P.y)/tt)+(tt<0?Math.PI:0),en=Math.sin(It),Mn=Math.cos(It);N=Mn,q=en,K=-en,re=Mn}else if(!S&&_){const dt=On(this.transform);N=dt.vecEast[0],q=dt.vecEast[1],K=dt.vecSouth[0],re=dt.vecSouth[1]}let ce=P.x,de=P.y,ue=s;_&&(ce=ae,de=se,ue=Math.pow(2,-(this.transform.zoom-d.overscaledZ)),ue*=this.transform.getPitchedTextCorrection(ae,se,g),k||(ue*=c.ah(.5+P.signedDistanceFromCamera/this.transform.cameraToCenterDistance*.5,0,4))),k&&(ce+=N*k.x*ue+K*k.y*ue,de+=q*k.x*ue+re*k.y*ue);const _e=e.x1*ue,be=e.x2*ue,fe=(_e+be)/2,Ee=e.y1*ue,Ve=e.y2*ue,ke=(Ee+Ve)/2,Ne=[{offsetX:_e,offsetY:Ee},{offsetX:fe,offsetY:Ee},{offsetX:be,offsetY:Ee},{offsetX:be,offsetY:ke},{offsetX:be,offsetY:Ve},{offsetX:fe,offsetY:Ve},{offsetX:_e,offsetY:Ve},{offsetX:_e,offsetY:ke}];let Ue=[];for(const{offsetX:dt,offsetY:tt}of Ne)Ue.push(new c.P(ce+N*dt+K*tt,de+q*dt+re*tt));let ht=!1;if(_){const dt=Ue.map((tt=>this.projectAndGetPerspectiveRatio(tt.x,tt.y,g,O,$)));ht=dt.some((tt=>!tt.isOccluded)),Ue=dt.map((tt=>new c.P(tt.x,tt.y)))}else ht=!0;return{box:c.aA(Ue),allPointsOccluded:!ht}}}class jn{constructor(e,s,d,g){this.opacity=e?Math.max(0,Math.min(1,e.opacity+(e.placed?s:-s))):g&&d?1:0,this.placed=d}isHidden(){return this.opacity===0&&!this.placed}}class Es{constructor(e,s,d,g,_){this.text=new jn(e?e.text:null,s,d,_),this.icon=new jn(e?e.icon:null,s,g,_)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class xc{constructor(e,s,d){this.text=e,this.icon=s,this.skipFade=d}}class Mh{constructor(e,s,d,g,_){this.bucketInstanceId=e,this.featureIndex=s,this.sourceLayerIndex=d,this.bucketIndex=g,this.tileID=_}}class Bo{constructor(e){this.crossSourceCollisions=e,this.maxGroupID=0,this.collisionGroups={}}get(e){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[e]){const s=++this.maxGroupID;this.collisionGroups[e]={ID:s,predicate:d=>d.collisionGroupID===s}}return this.collisionGroups[e]}}function Ys(y,e,s,d,g){const{horizontalAlign:_,verticalAlign:S}=c.aH(y);return new c.P(-(_-.5)*e+d[0]*g,-(S-.5)*s+d[1]*g)}class du{constructor(e,s,d,g,_){this.transform=e.clone(),this.terrain=s,this.collisionIndex=new Wr(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=d,this.retainedQueryData={},this.collisionGroups=new Bo(g),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=_,_&&(_.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(e){const s=this.terrain;return s?(d,g)=>s.getElevation(e,d,g):null}getBucketParts(e,s,d,g){const _=d.getBucket(s),S=d.latestFeatureIndex;if(!_||!S||s.id!==_.layerIds[0])return;const L=d.collisionBoxArray,P=_.layers[0].layout,O=_.layers[0].paint,k=Math.pow(2,this.transform.zoom-d.tileID.overscaledZ),$=d.tileSize/c.$,N=d.tileID.toUnwrapped(),q=P.get("text-rotation-alignment")==="map",K=c.aC(d,1,this.transform.zoom),re=c.aD(this.collisionIndex.transform,d,O.get("text-translate"),O.get("text-translate-anchor")),ae=c.aD(this.collisionIndex.transform,d,O.get("icon-translate"),O.get("icon-translate-anchor")),se=Kn(q,this.transform,K);this.retainedQueryData[_.bucketInstanceId]=new Mh(_.bucketInstanceId,S,_.sourceLayerIndex,_.index,d.tileID);const ce={bucket:_,layout:P,translationText:re,translationIcon:ae,unwrappedTileID:N,pitchedLabelPlaneMatrix:se,scale:k,textPixelRatio:$,holdingForFade:d.holdingForSymbolFade(),collisionBoxArray:L,partiallyEvaluatedTextSize:c.an(_.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(_.sourceID)};if(g)for(const de of _.sortKeyRanges){const{sortKey:ue,symbolInstanceStart:_e,symbolInstanceEnd:be}=de;e.push({sortKey:ue,symbolInstanceStart:_e,symbolInstanceEnd:be,parameters:ce})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:_.symbolInstances.length,parameters:ce})}attemptAnchorPlacement(e,s,d,g,_,S,L,P,O,k,$,N,q,K,re,ae,se,ce,de,ue){const _e=c.aE[e.textAnchor],be=[e.textOffset0,e.textOffset1],fe=Ys(_e,d,g,be,_),Ee=this.collisionIndex.placeCollisionBox(s,N,P,O,k,L,S,ae,$.predicate,de,fe,ue);if((!ce||this.collisionIndex.placeCollisionBox(ce,N,P,O,k,L,S,se,$.predicate,de,fe,ue).placeable)&&Ee.placeable){let Ve;if(this.prevPlacement&&this.prevPlacement.variableOffsets[q.crossTileID]&&this.prevPlacement.placements[q.crossTileID]&&this.prevPlacement.placements[q.crossTileID].text&&(Ve=this.prevPlacement.variableOffsets[q.crossTileID].anchor),q.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[q.crossTileID]={textOffset:be,width:d,height:g,anchor:_e,textBoxScale:_,prevAnchor:Ve},this.markUsedJustification(K,_e,q,re),K.allowVerticalPlacement&&(this.markUsedOrientation(K,re,q),this.placedOrientations[q.crossTileID]=re),{shift:fe,placedGlyphBoxes:Ee}}}placeLayerBucketPart(e,s,d){const{bucket:g,layout:_,translationText:S,translationIcon:L,unwrappedTileID:P,pitchedLabelPlaneMatrix:O,textPixelRatio:k,holdingForFade:$,collisionBoxArray:N,partiallyEvaluatedTextSize:q,collisionGroup:K}=e.parameters,re=_.get("text-optional"),ae=_.get("icon-optional"),se=c.aF(_,"text-overlap","text-allow-overlap"),ce=se==="always",de=c.aF(_,"icon-overlap","icon-allow-overlap"),ue=de==="always",_e=_.get("text-rotation-alignment")==="map",be=_.get("text-pitch-alignment")==="map",fe=_.get("icon-text-fit")!=="none",Ee=_.get("symbol-z-order")==="viewport-y",Ve=ce&&(ue||!g.hasIconData()||ae),ke=ue&&(ce||!g.hasTextData()||re);!g.collisionArrays&&N&&g.deserializeCollisionBoxes(N);const Ne=this.retainedQueryData[g.bucketInstanceId].tileID,Ue=this._getTerrainElevationFunc(Ne),ht=this.transform.getFastPathSimpleProjectionMatrix(Ne),dt=(tt,It,en)=>{var Mn,Nn;if(s[tt.crossTileID])return;if($)return void(this.placements[tt.crossTileID]=new xc(!1,!1,!1));let Un=!1,hi=!1,ii=!0,yn=null,vi={box:null,placeable:!1,offscreen:null,occluded:!1},_r={placeable:!1},zi=null,Di=null,Ir=null,po=0,Sa=0,mo=0;It.textFeatureIndex?po=It.textFeatureIndex:tt.useRuntimeCollisionCircles&&(po=tt.featureIndex),It.verticalTextFeatureIndex&&(Sa=It.verticalTextFeatureIndex);const ll=It.textBox;if(ll){const Ca=Si=>{let Xi=c.ao.horizontal;if(g.allowVerticalPlacement&&!Si&&this.prevPlacement){const na=this.prevPlacement.placedOrientations[tt.crossTileID];na&&(this.placedOrientations[tt.crossTileID]=na,Xi=na,this.markUsedOrientation(g,Xi,tt))}return Xi},qa=(Si,Xi)=>{if(g.allowVerticalPlacement&&tt.numVerticalGlyphVertices>0&&It.verticalTextBox){for(const na of g.writingModes)if(na===c.ao.vertical?(vi=Xi(),_r=vi):vi=Si(),vi&&vi.placeable)break}else vi=Si()},ps=tt.textAnchorOffsetStartIndex,ta=tt.textAnchorOffsetEndIndex;if(ta===ps){const Si=(Xi,na)=>{const vr=this.collisionIndex.placeCollisionBox(Xi,se,k,Ne,P,be,_e,S,K.predicate,Ue,void 0,ht);return vr&&vr.placeable&&(this.markUsedOrientation(g,na,tt),this.placedOrientations[tt.crossTileID]=na),vr};qa((()=>Si(ll,c.ao.horizontal)),(()=>{const Xi=It.verticalTextBox;return g.allowVerticalPlacement&&tt.numVerticalGlyphVertices>0&&Xi?Si(Xi,c.ao.vertical):{box:null,offscreen:null}})),Ca(vi&&vi.placeable)}else{let Si=c.aE[(Nn=(Mn=this.prevPlacement)===null||Mn===void 0?void 0:Mn.variableOffsets[tt.crossTileID])===null||Nn===void 0?void 0:Nn.anchor];const Xi=(vr,wf,$c)=>{const ms=vr.x2-vr.x1,gs=vr.y2-vr.y1,ia=tt.textBoxScale,go=fe&&de==="never"?wf:null;let yo=null,Yl=se==="never"?1:2,Xh="never";Si&&Yl++;for(let $s=0;$s<Yl;$s++){for(let Yh=ps;Yh<ta;Yh++){const Zu=g.textAnchorOffsets.get(Yh);if(Si&&Zu.textAnchor!==Si)continue;const Ql=this.attemptAnchorPlacement(Zu,vr,ms,gs,ia,_e,be,k,Ne,P,K,Xh,tt,g,$c,S,L,go,Ue);if(Ql&&(yo=Ql.placedGlyphBoxes,yo&&yo.placeable))return Un=!0,yn=Ql.shift,yo}Si?Si=null:Xh=se}return d&&!yo&&(yo={box:this.collisionIndex.placeCollisionBox(ll,"always",k,Ne,P,be,_e,S,K.predicate,Ue,void 0,ht).box,offscreen:!1,placeable:!1,occluded:!1}),yo};qa((()=>Xi(ll,It.iconBox,c.ao.horizontal)),(()=>{const vr=It.verticalTextBox;return g.allowVerticalPlacement&&(!vi||!vi.placeable)&&tt.numVerticalGlyphVertices>0&&vr?Xi(vr,It.verticalIconBox,c.ao.vertical):{box:null,occluded:!0,offscreen:null}})),vi&&(Un=vi.placeable,ii=vi.offscreen);const na=Ca(vi&&vi.placeable);if(!Un&&this.prevPlacement){const vr=this.prevPlacement.variableOffsets[tt.crossTileID];vr&&(this.variableOffsets[tt.crossTileID]=vr,this.markUsedJustification(g,vr.anchor,tt,na))}}}if(zi=vi,Un=zi&&zi.placeable,ii=zi&&zi.offscreen,tt.useRuntimeCollisionCircles&&tt.centerJustifiedTextSymbolIndex>=0){const Ca=g.text.placedSymbolArray.get(tt.centerJustifiedTextSymbolIndex),qa=c.ap(g.textSizeData,q,Ca),ps=_.get("text-padding");Di=this.collisionIndex.placeCollisionCircles(se,Ca,g.lineVertexArray,g.glyphOffsetArray,qa,P,O,d,be,K.predicate,tt.collisionCircleDiameter,ps,S,Ue),Di.circles.length&&Di.collisionDetected&&!d&&c.w("Collisions detected, but collision boxes are not shown"),Un=ce||Di.circles.length>0&&!Di.collisionDetected,ii=ii&&Di.offscreen}if(It.iconFeatureIndex&&(mo=It.iconFeatureIndex),It.iconBox){const Ca=qa=>this.collisionIndex.placeCollisionBox(qa,de,k,Ne,P,be,_e,L,K.predicate,Ue,fe&&yn?yn:void 0,ht);_r&&_r.placeable&&It.verticalIconBox?(Ir=Ca(It.verticalIconBox),hi=Ir.placeable):(Ir=Ca(It.iconBox),hi=Ir.placeable),ii=ii&&Ir.offscreen}const Uc=re||tt.numHorizontalGlyphVertices===0&&tt.numVerticalGlyphVertices===0,Xl=ae||tt.numIconVertices===0;Uc||Xl?Xl?Uc||(hi=hi&&Un):Un=hi&&Un:hi=Un=hi&&Un;const Us=hi&&Ir.placeable;if(Un&&zi.placeable&&this.collisionIndex.insertCollisionBox(zi.box,se,_.get("text-ignore-placement"),g.bucketInstanceId,_r&&_r.placeable&&Sa?Sa:po,K.ID),Us&&this.collisionIndex.insertCollisionBox(Ir.box,de,_.get("icon-ignore-placement"),g.bucketInstanceId,mo,K.ID),Di&&Un&&this.collisionIndex.insertCollisionCircles(Di.circles,se,_.get("text-ignore-placement"),g.bucketInstanceId,po,K.ID),d&&this.storeCollisionData(g.bucketInstanceId,en,It,zi,Ir,Di),tt.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(g.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[tt.crossTileID]=new xc((Un||Ve)&&!(zi!=null&&zi.occluded),(hi||ke)&&!(Ir!=null&&Ir.occluded),ii||g.justReloaded),s[tt.crossTileID]=!0};if(Ee){if(e.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");const tt=g.getSortedSymbolIndexes(-this.transform.bearingInRadians);for(let It=tt.length-1;It>=0;--It){const en=tt[It];dt(g.symbolInstances.get(en),g.collisionArrays[en],en)}}else for(let tt=e.symbolInstanceStart;tt<e.symbolInstanceEnd;tt++)dt(g.symbolInstances.get(tt),g.collisionArrays[tt],tt);g.justReloaded=!1}storeCollisionData(e,s,d,g,_,S){if(d.textBox||d.iconBox){let L,P;this.collisionBoxArrays.has(e)?L=this.collisionBoxArrays.get(e):(L=new Map,this.collisionBoxArrays.set(e,L)),L.has(s)?P=L.get(s):(P={text:null,icon:null},L.set(s,P)),d.textBox&&(P.text=g.box),d.iconBox&&(P.icon=_.box)}if(S){let L=this.collisionCircleArrays[e];L===void 0&&(L=this.collisionCircleArrays[e]=[]);for(let P=0;P<S.circles.length;P+=4)L.push(S.circles[P+0]-Pi),L.push(S.circles[P+1]-Pi),L.push(S.circles[P+2]),L.push(S.collisionDetected?1:0)}}markUsedJustification(e,s,d,g){let _;_=g===c.ao.vertical?d.verticalPlacedTextSymbolIndex:{left:d.leftJustifiedTextSymbolIndex,center:d.centerJustifiedTextSymbolIndex,right:d.rightJustifiedTextSymbolIndex}[c.aG(s)];const S=[d.leftJustifiedTextSymbolIndex,d.centerJustifiedTextSymbolIndex,d.rightJustifiedTextSymbolIndex,d.verticalPlacedTextSymbolIndex];for(const L of S)L>=0&&(e.text.placedSymbolArray.get(L).crossTileID=_>=0&&L!==_?0:d.crossTileID)}markUsedOrientation(e,s,d){const g=s===c.ao.horizontal||s===c.ao.horizontalOnly?s:0,_=s===c.ao.vertical?s:0,S=[d.leftJustifiedTextSymbolIndex,d.centerJustifiedTextSymbolIndex,d.rightJustifiedTextSymbolIndex];for(const L of S)e.text.placedSymbolArray.get(L).placedOrientation=g;d.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(d.verticalPlacedTextSymbolIndex).placedOrientation=_)}commit(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;const s=this.prevPlacement;let d=!1;this.prevZoomAdjustment=s?s.zoomAdjustment(this.transform.zoom):0;const g=s?s.symbolFadeChange(e):1,_=s?s.opacities:{},S=s?s.variableOffsets:{},L=s?s.placedOrientations:{};for(const P in this.placements){const O=this.placements[P],k=_[P];k?(this.opacities[P]=new Es(k,g,O.text,O.icon),d=d||O.text!==k.text.placed||O.icon!==k.icon.placed):(this.opacities[P]=new Es(null,g,O.text,O.icon,O.skipFade),d=d||O.text||O.icon)}for(const P in _){const O=_[P];if(!this.opacities[P]){const k=new Es(O,g,!1,!1);k.isHidden()||(this.opacities[P]=k,d=d||O.text.placed||O.icon.placed)}}for(const P in S)this.variableOffsets[P]||!this.opacities[P]||this.opacities[P].isHidden()||(this.variableOffsets[P]=S[P]);for(const P in L)this.placedOrientations[P]||!this.opacities[P]||this.opacities[P].isHidden()||(this.placedOrientations[P]=L[P]);if(s&&s.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");d?this.lastPlacementChangeTime=e:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=s?s.lastPlacementChangeTime:e)}updateLayerOpacities(e,s){const d={};for(const g of s){const _=g.getBucket(e);_&&g.latestFeatureIndex&&e.id===_.layerIds[0]&&this.updateBucketOpacities(_,g.tileID,d,g.collisionBoxArray)}}updateBucketOpacities(e,s,d,g){e.hasTextData()&&(e.text.opacityVertexArray.clear(),e.text.hasVisibleVertices=!1),e.hasIconData()&&(e.icon.opacityVertexArray.clear(),e.icon.hasVisibleVertices=!1),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear();const _=e.layers[0],S=_.layout,L=new Es(null,0,!1,!1,!0),P=S.get("text-allow-overlap"),O=S.get("icon-allow-overlap"),k=_._unevaluatedLayout.hasValue("text-variable-anchor")||_._unevaluatedLayout.hasValue("text-variable-anchor-offset"),$=S.get("text-rotation-alignment")==="map",N=S.get("text-pitch-alignment")==="map",q=S.get("icon-text-fit")!=="none",K=new Es(null,0,P&&(O||!e.hasIconData()||S.get("icon-optional")),O&&(P||!e.hasTextData()||S.get("text-optional")),!0);!e.collisionArrays&&g&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(g);const re=(se,ce,de)=>{for(let ue=0;ue<ce/4;ue++)se.opacityVertexArray.emplaceBack(de);se.hasVisibleVertices=se.hasVisibleVertices||de!==hr},ae=this.collisionBoxArrays.get(e.bucketInstanceId);for(let se=0;se<e.symbolInstances.length;se++){const ce=e.symbolInstances.get(se),{numHorizontalGlyphVertices:de,numVerticalGlyphVertices:ue,crossTileID:_e}=ce;let be=this.opacities[_e];d[_e]?be=L:be||(be=K,this.opacities[_e]=be),d[_e]=!0;const fe=ce.numIconVertices>0,Ee=this.placedOrientations[ce.crossTileID],Ve=Ee===c.ao.vertical,ke=Ee===c.ao.horizontal||Ee===c.ao.horizontalOnly;if(de>0||ue>0){const Ue=Yd(be.text);re(e.text,de,Ve?hr:Ue),re(e.text,ue,ke?hr:Ue);const ht=be.text.isHidden();[ce.rightJustifiedTextSymbolIndex,ce.centerJustifiedTextSymbolIndex,ce.leftJustifiedTextSymbolIndex].forEach((It=>{It>=0&&(e.text.placedSymbolArray.get(It).hidden=ht||Ve?1:0)})),ce.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(ce.verticalPlacedTextSymbolIndex).hidden=ht||ke?1:0);const dt=this.variableOffsets[ce.crossTileID];dt&&this.markUsedJustification(e,dt.anchor,ce,Ee);const tt=this.placedOrientations[ce.crossTileID];tt&&(this.markUsedJustification(e,"left",ce,tt),this.markUsedOrientation(e,tt,ce))}if(fe){const Ue=Yd(be.icon),ht=!(q&&ce.verticalPlacedIconSymbolIndex&&Ve);ce.placedIconSymbolIndex>=0&&(re(e.icon,ce.numIconVertices,ht?Ue:hr),e.icon.placedSymbolArray.get(ce.placedIconSymbolIndex).hidden=be.icon.isHidden()),ce.verticalPlacedIconSymbolIndex>=0&&(re(e.icon,ce.numVerticalIconVertices,ht?hr:Ue),e.icon.placedSymbolArray.get(ce.verticalPlacedIconSymbolIndex).hidden=be.icon.isHidden())}const Ne=ae&&ae.has(se)?ae.get(se):{text:null,icon:null};if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){const Ue=e.collisionArrays[se];if(Ue){let ht=new c.P(0,0);if(Ue.textBox||Ue.verticalTextBox){let dt=!0;if(k){const tt=this.variableOffsets[_e];tt?(ht=Ys(tt.anchor,tt.width,tt.height,tt.textOffset,tt.textBoxScale),$&&ht._rotate(N?-this.transform.bearingInRadians:this.transform.bearingInRadians)):dt=!1}if(Ue.textBox||Ue.verticalTextBox){let tt;Ue.textBox&&(tt=Ve),Ue.verticalTextBox&&(tt=ke),bc(e.textCollisionBox.collisionVertexArray,be.text.placed,!dt||tt,Ne.text,ht.x,ht.y)}}if(Ue.iconBox||Ue.verticalIconBox){const dt=!!(!ke&&Ue.verticalIconBox);let tt;Ue.iconBox&&(tt=dt),Ue.verticalIconBox&&(tt=!dt),bc(e.iconCollisionBox.collisionVertexArray,be.icon.placed,tt,Ne.icon,q?ht.x:0,q?ht.y:0)}}}}if(e.sortFeatures(-this.transform.bearingInRadians),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.text.opacityVertexArray.length!==e.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${e.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${e.text.layoutVertexArray.length}) / 4`);if(e.icon.opacityVertexArray.length!==e.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${e.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${e.icon.layoutVertexArray.length}) / 4`);e.bucketInstanceId in this.collisionCircleArrays&&(e.collisionCircleArray=this.collisionCircleArrays[e.bucketInstanceId],delete this.collisionCircleArrays[e.bucketInstanceId])}symbolFadeChange(e){return this.fadeDuration===0?1:(e-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(e){return Math.max(0,(this.transform.zoom-e)/1.5)}hasTransitions(e){return this.stale||e-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(e,s){const d=this.zoomAtLastRecencyCheck===s?1-this.zoomAdjustment(s):1;return this.zoomAtLastRecencyCheck=s,this.commitTime+this.fadeDuration*d>e}setStale(){this.stale=!0}}function bc(y,e,s,d,g,_){d&&d.length!==0||(d=[0,0,0,0]);const S=d[0]-Pi,L=d[1]-Pi,P=d[2]-Pi,O=d[3]-Pi;y.emplaceBack(e?1:0,s?1:0,g||0,_||0,S,L),y.emplaceBack(e?1:0,s?1:0,g||0,_||0,P,L),y.emplaceBack(e?1:0,s?1:0,g||0,_||0,P,O),y.emplaceBack(e?1:0,s?1:0,g||0,_||0,S,O)}const Ms=Math.pow(2,25),br=Math.pow(2,24),Hd=Math.pow(2,17),pm=Math.pow(2,16),Xd=Math.pow(2,9),Ap=Math.pow(2,8),fu=Math.pow(2,1);function Yd(y){if(y.opacity===0&&!y.placed)return 0;if(y.opacity===1&&y.placed)return 4294967295;const e=y.placed?1:0,s=Math.floor(127*y.opacity);return s*Ms+e*br+s*Hd+e*pm+s*Xd+e*Ap+s*fu+e}const hr=0;class pu{constructor(e){this._sortAcrossTiles=e.layout.get("symbol-z-order")!=="viewport-y"&&!e.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(e,s,d,g,_){const S=this._bucketParts;for(;this._currentTileIndex<e.length;)if(s.getBucketParts(S,g,e[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,_())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,S.sort(((L,P)=>L.sortKey-P.sortKey)));this._currentPartIndex<S.length;)if(s.placeLayerBucketPart(S[this._currentPartIndex],this._seenCrossTileIDs,d),this._currentPartIndex++,_())return!0;return!1}}class Qd{constructor(e,s,d,g,_,S,L,P){this.placement=new du(e,s,S,L,P),this._currentPlacementIndex=d.length-1,this._forceFullPlacement=g,this._showCollisionBoxes=_,this._done=!1}isDone(){return this._done}continuePlacement(e,s,d){const g=Y.now(),_=()=>!this._forceFullPlacement&&Y.now()-g>2;for(;this._currentPlacementIndex>=0;){const S=s[e[this._currentPlacementIndex]],L=this.placement.collisionIndex.transform.zoom;if(S.type==="symbol"&&(!S.minzoom||S.minzoom<=L)&&(!S.maxzoom||S.maxzoom>L)){if(this._inProgressLayer||(this._inProgressLayer=new pu(S)),this._inProgressLayer.continuePlacement(d[S.source],this.placement,this._showCollisionBoxes,S,_))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(e){return this.placement.commit(e),this.placement}}const Qs=512/c.$/2;class Fo{constructor(e,s,d){this.tileID=e,this.bucketInstanceId=d,this._symbolsByKey={};const g=new Map;for(let _=0;_<s.length;_++){const S=s.get(_),L=S.key,P=g.get(L);P?P.push(S):g.set(L,[S])}for(const[_,S]of g){const L={positions:S.map((P=>({x:Math.floor(P.anchorX*Qs),y:Math.floor(P.anchorY*Qs)}))),crossTileIDs:S.map((P=>P.crossTileID))};if(L.positions.length>128){const P=new c.aI(L.positions.length,16,Uint16Array);for(const{x:O,y:k}of L.positions)P.add(O,k);P.finish(),delete L.positions,L.index=P}this._symbolsByKey[_]=L}}getScaledCoordinates(e,s){const{x:d,y:g,z:_}=this.tileID.canonical,{x:S,y:L,z:P}=s.canonical,O=Qs/Math.pow(2,P-_),k=(L*c.$+e.anchorY)*O,$=g*c.$*Qs;return{x:Math.floor((S*c.$+e.anchorX)*O-d*c.$*Qs),y:Math.floor(k-$)}}findMatches(e,s,d){const g=this.tileID.canonical.z<s.canonical.z?1:Math.pow(2,this.tileID.canonical.z-s.canonical.z);for(let _=0;_<e.length;_++){const S=e.get(_);if(S.crossTileID)continue;const L=this._symbolsByKey[S.key];if(!L)continue;const P=this.getScaledCoordinates(S,s);if(L.index){const O=L.index.range(P.x-g,P.y-g,P.x+g,P.y+g).sort();for(const k of O){const $=L.crossTileIDs[k];if(!d[$]){d[$]=!0,S.crossTileID=$;break}}}else if(L.positions)for(let O=0;O<L.positions.length;O++){const k=L.positions[O],$=L.crossTileIDs[O];if(Math.abs(k.x-P.x)<=g&&Math.abs(k.y-P.y)<=g&&!d[$]){d[$]=!0,S.crossTileID=$;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map((({crossTileIDs:e})=>e))}}class Lp{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class wc{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(e){const s=Math.round((e-this.lng)/360);if(s!==0)for(const d in this.indexes){const g=this.indexes[d],_={};for(const S in g){const L=g[S];L.tileID=L.tileID.unwrapTo(L.tileID.wrap+s),_[L.tileID.key]=L}this.indexes[d]=_}this.lng=e}addBucket(e,s,d){if(this.indexes[e.overscaledZ]&&this.indexes[e.overscaledZ][e.key]){if(this.indexes[e.overscaledZ][e.key].bucketInstanceId===s.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(e.overscaledZ,this.indexes[e.overscaledZ][e.key])}for(let _=0;_<s.symbolInstances.length;_++)s.symbolInstances.get(_).crossTileID=0;this.usedCrossTileIDs[e.overscaledZ]||(this.usedCrossTileIDs[e.overscaledZ]={});const g=this.usedCrossTileIDs[e.overscaledZ];for(const _ in this.indexes){const S=this.indexes[_];if(Number(_)>e.overscaledZ)for(const L in S){const P=S[L];P.tileID.isChildOf(e)&&P.findMatches(s.symbolInstances,e,g)}else{const L=S[e.scaledTo(Number(_)).key];L&&L.findMatches(s.symbolInstances,e,g)}}for(let _=0;_<s.symbolInstances.length;_++){const S=s.symbolInstances.get(_);S.crossTileID||(S.crossTileID=d.generate(),g[S.crossTileID]=!0)}return this.indexes[e.overscaledZ]===void 0&&(this.indexes[e.overscaledZ]={}),this.indexes[e.overscaledZ][e.key]=new Fo(e,s.symbolInstances,s.bucketInstanceId),!0}removeBucketCrossTileIDs(e,s){for(const d of s.getCrossTileIDsLists())for(const g of d)delete this.usedCrossTileIDs[e][g]}removeStaleBuckets(e){let s=!1;for(const d in this.indexes){const g=this.indexes[d];for(const _ in g)e[g[_].bucketInstanceId]||(this.removeBucketCrossTileIDs(d,g[_]),delete g[_],s=!0)}return s}}class As{constructor(){this.layerIndexes={},this.crossTileIDs=new Lp,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(e,s,d){let g=this.layerIndexes[e.id];g===void 0&&(g=this.layerIndexes[e.id]=new wc);let _=!1;const S={};g.handleWrapJump(d);for(const L of s){const P=L.getBucket(e);P&&e.id===P.layerIds[0]&&(P.bucketInstanceId||(P.bucketInstanceId=++this.maxBucketInstanceId),g.addBucket(L.tileID,P,this.crossTileIDs)&&(_=!0),S[P.bucketInstanceId]=!0)}return g.removeStaleBuckets(S)&&(_=!0),_}pruneUnusedLayers(e){const s={};e.forEach((d=>{s[d]=!0}));for(const d in this.layerIndexes)s[d]||delete this.layerIndexes[d]}}var Wd="void main() {fragColor=vec4(1.0);}";const Lr={prelude:bn(`#ifdef GL_ES
84
+ precision mediump float;
85
+ #else
86
+ #if !defined(lowp)
87
+ #define lowp
88
+ #endif
89
+ #if !defined(mediump)
90
+ #define mediump
91
+ #endif
92
+ #if !defined(highp)
93
+ #define highp
94
+ #endif
95
+ #endif
96
+ out highp vec4 fragColor;`,`#ifdef GL_ES
97
+ precision highp float;
98
+ #else
99
+ #if !defined(lowp)
100
+ #define lowp
101
+ #endif
102
+ #if !defined(mediump)
103
+ #define mediump
104
+ #endif
105
+ #if !defined(highp)
106
+ #define highp
107
+ #endif
108
+ #endif
109
+ 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
110
+ );}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;}mat3 rotationMatrixFromAxisAngle(vec3 u,float angle) {float c=cos(angle);float s=sin(angle);float c2=1.0-c;return mat3(u.x*u.x*c2+ c,u.x*u.y*c2-u.z*s,u.x*u.z*c2+u.y*s,u.y*u.x*c2+u.z*s,u.y*u.y*c2+ c,u.y*u.z*c2-u.x*s,u.z*u.x*c2-u.y*s,u.z*u.y*c2+u.x*s,u.z*u.z*c2+ c
111
+ );}
112
+ #ifdef TERRAIN3D
113
+ uniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth;
114
+ #endif
115
+ const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) {
116
+ #ifdef TERRAIN3D
117
+ highp float d=unpack(texture(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));
118
+ #else
119
+ return 1.0;
120
+ #endif
121
+ }float calculate_visibility(vec4 pos) {
122
+ #ifdef TERRAIN3D
123
+ vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;
124
+ #else
125
+ return 1.0;
126
+ #endif
127
+ }float ele(vec2 pos) {
128
+ #ifdef TERRAIN3D
129
+ vec4 rgb=(texture(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;
130
+ #else
131
+ return 0.0;
132
+ #endif
133
+ }float get_elevation(vec2 pos) {
134
+ #ifdef TERRAIN3D
135
+ #ifdef GLOBE
136
+ if ((pos.y <-32767.5) || (pos.y > 32766.5)) {return 0.0;}
137
+ #endif
138
+ vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration;
139
+ #else
140
+ return 0.0;
141
+ #endif
142
+ }const float PI=3.141592653589793;uniform mat4 u_projection_matrix;`),projectionMercator:bn("","float projectLineThickness(float tileY) {return 1.0;}float projectCircleRadius(float tileY) {return 1.0;}vec4 projectTile(vec2 p) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);return result;}vec4 projectTile(vec2 p,vec2 rawPos) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);if (rawPos.y <-32767.5 || rawPos.y > 32766.5) {result.z=-10000000.0;}return result;}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_projection_matrix*vec4(posInTile,elevation,1.0);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {return projectTileWithElevation(posInTile,elevation);}"),projectionGlobe:bn("",`#define GLOBE_RADIUS 6371008.8
143
+ uniform highp vec4 u_projection_tile_mercator_coords;uniform highp vec4 u_projection_clipping_plane;uniform highp float u_projection_transition;uniform mat4 u_projection_fallback_matrix;vec3 globeRotateVector(vec3 vec,vec2 angles) {vec3 axisRight=vec3(vec.z,0.0,-vec.x);vec3 axisUp=cross(axisRight,vec);axisRight=normalize(axisRight);axisUp=normalize(axisUp);vec2 t=tan(angles);return normalize(vec+axisRight*t.x+axisUp*t.y);}mat3 globeGetRotationMatrix(vec3 spherePos) {vec3 axisRight=vec3(spherePos.z,0.0,-spherePos.x);vec3 axisDown=cross(axisRight,spherePos);axisRight=normalize(axisRight);axisDown=normalize(axisDown);return mat3(axisRight,axisDown,spherePos
144
+ );}float circumferenceRatioAtTileY(float tileY) {float mercator_pos_y=u_projection_tile_mercator_coords.y+u_projection_tile_mercator_coords.w*tileY;float spherical_y=2.0*atan(exp(PI-(mercator_pos_y*PI*2.0)))-PI*0.5;return cos(spherical_y);}float projectLineThickness(float tileY) {float thickness=1.0/circumferenceRatioAtTileY(tileY);
145
+ if (u_projection_transition < 0.999) {return mix(1.0,thickness,u_projection_transition);} else {return thickness;}}vec3 projectToSphere(vec2 translatedPos,vec2 rawPos) {vec2 mercator_pos=u_projection_tile_mercator_coords.xy+u_projection_tile_mercator_coords.zw*translatedPos;vec2 spherical;spherical.x=mercator_pos.x*PI*2.0+PI;spherical.y=2.0*atan(exp(PI-(mercator_pos.y*PI*2.0)))-PI*0.5;float len=cos(spherical.y);vec3 pos=vec3(sin(spherical.x)*len,sin(spherical.y),cos(spherical.x)*len
146
+ );if (rawPos.y <-32767.5) {pos=vec3(0.0,1.0,0.0);}if (rawPos.y > 32766.5) {pos=vec3(0.0,-1.0,0.0);}return pos;}vec3 projectToSphere(vec2 posInTile) {return projectToSphere(posInTile,vec2(0.0,0.0));}float globeComputeClippingZ(vec3 spherePos) {return (1.0-(dot(spherePos,u_projection_clipping_plane.xyz)+u_projection_clipping_plane.w));}vec4 interpolateProjection(vec2 posInTile,vec3 spherePos,float elevation) {vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);vec4 globePosition=u_projection_matrix*vec4(elevatedPos,1.0);globePosition.z=globeComputeClippingZ(elevatedPos)*globePosition.w;if (u_projection_transition > 0.999) {return globePosition;}vec4 flatPosition=u_projection_fallback_matrix*vec4(posInTile,elevation,1.0);const float z_globeness_threshold=0.2;vec4 result=globePosition;result.z=mix(0.0,globePosition.z,clamp((u_projection_transition-z_globeness_threshold)/(1.0-z_globeness_threshold),0.0,1.0));result.xyw=mix(flatPosition.xyw,globePosition.xyw,u_projection_transition);if ((posInTile.y <-32767.5) || (posInTile.y > 32766.5)) {result=globePosition;const float poles_hidden_anim_percentage=0.02;result.z=mix(globePosition.z,100.0,pow(max((1.0-u_projection_transition)/poles_hidden_anim_percentage,0.0),8.0));}return result;}vec4 interpolateProjectionFor3D(vec2 posInTile,vec3 spherePos,float elevation) {vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);vec4 globePosition=u_projection_matrix*vec4(elevatedPos,1.0);if (u_projection_transition > 0.999) {return globePosition;}vec4 fallbackPosition=u_projection_fallback_matrix*vec4(posInTile,elevation,1.0);return mix(fallbackPosition,globePosition,u_projection_transition);}vec4 projectTile(vec2 posInTile) {return interpolateProjection(posInTile,projectToSphere(posInTile),0.0);}vec4 projectTile(vec2 posInTile,vec2 rawPos) {return interpolateProjection(posInTile,projectToSphere(posInTile,rawPos),0.0);}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return interpolateProjection(posInTile,projectToSphere(posInTile),elevation);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {vec3 spherePos=projectToSphere(posInTile,posInTile);return interpolateProjectionFor3D(posInTile,spherePos,elevation);}`),background:bn(`uniform vec4 u_color;uniform float u_opacity;void main() {fragColor=u_color*u_opacity;
147
+ #ifdef OVERDRAW_INSPECTOR
148
+ fragColor=vec4(1.0);
149
+ #endif
150
+ }`,"in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}"),backgroundPattern:bn(`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;in vec2 v_pos_a;in 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=texture(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=texture(u_image,pos2);fragColor=mix(color1,color2,u_mix)*u_opacity;
151
+ #ifdef OVERDRAW_INSPECTOR
152
+ fragColor=vec4(1.0);
153
+ #endif
154
+ }`,"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;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;void main() {gl_Position=projectTile(a_pos);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:bn(`in vec3 v_data;in float v_visibility;
155
+ #pragma mapbox: define highp vec4 color
156
+ #pragma mapbox: define mediump float radius
157
+ #pragma mapbox: define lowp float blur
158
+ #pragma mapbox: define lowp float opacity
159
+ #pragma mapbox: define highp vec4 stroke_color
160
+ #pragma mapbox: define mediump float stroke_width
161
+ #pragma mapbox: define lowp float stroke_opacity
162
+ void main() {
163
+ #pragma mapbox: initialize highp vec4 color
164
+ #pragma mapbox: initialize mediump float radius
165
+ #pragma mapbox: initialize lowp float blur
166
+ #pragma mapbox: initialize lowp float opacity
167
+ #pragma mapbox: initialize highp vec4 stroke_color
168
+ #pragma mapbox: initialize mediump float stroke_width
169
+ #pragma mapbox: initialize lowp float stroke_opacity
170
+ vec2 extrude=v_data.xy;float extrude_length=length(extrude);float antialiased_blur=v_data.z;float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));fragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);const float epsilon=0.5/255.0;if (fragColor.r < epsilon && fragColor.g < epsilon && fragColor.b < epsilon && fragColor.a < epsilon) {discard;}
171
+ #ifdef OVERDRAW_INSPECTOR
172
+ fragColor=vec4(1.0);
173
+ #endif
174
+ }`,`uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform highp float u_globe_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;uniform vec2 u_translate;in vec2 a_pos;out vec3 v_data;out float v_visibility;
175
+ #pragma mapbox: define highp vec4 color
176
+ #pragma mapbox: define mediump float radius
177
+ #pragma mapbox: define lowp float blur
178
+ #pragma mapbox: define lowp float opacity
179
+ #pragma mapbox: define highp vec4 stroke_color
180
+ #pragma mapbox: define mediump float stroke_width
181
+ #pragma mapbox: define lowp float stroke_opacity
182
+ void main(void) {
183
+ #pragma mapbox: initialize highp vec4 color
184
+ #pragma mapbox: initialize mediump float radius
185
+ #pragma mapbox: initialize lowp float blur
186
+ #pragma mapbox: initialize lowp float opacity
187
+ #pragma mapbox: initialize highp vec4 stroke_color
188
+ #pragma mapbox: initialize mediump float stroke_width
189
+ #pragma mapbox: initialize lowp float stroke_opacity
190
+ vec2 pos_raw=a_pos+32768.0;vec2 extrude=vec2(mod(pos_raw,8.0)/7.0*2.0-1.0);vec2 circle_center=floor(pos_raw/8.0)+u_translate;float ele=get_elevation(circle_center);v_visibility=calculate_visibility(projectTileWithElevation(circle_center,ele));if (u_pitch_with_map) {
191
+ #ifdef GLOBE
192
+ vec3 center_vector=projectToSphere(circle_center);
193
+ #endif
194
+ float angle_scale=u_globe_extrude_scale;vec2 corner_position=circle_center;if (u_scale_with_map) {angle_scale*=(radius+stroke_width);corner_position+=extrude*u_extrude_scale*(radius+stroke_width);} else {
195
+ #ifdef GLOBE
196
+ vec4 projected_center=interpolateProjection(circle_center,center_vector,ele);
197
+ #else
198
+ vec4 projected_center=projectTileWithElevation(circle_center,ele);
199
+ #endif
200
+ corner_position+=extrude*u_extrude_scale*(radius+stroke_width)*(projected_center.w/u_camera_to_center_distance);angle_scale*=(radius+stroke_width)*(projected_center.w/u_camera_to_center_distance);}
201
+ #ifdef GLOBE
202
+ vec2 angles=extrude*angle_scale;vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(corner_position,corner_vector,ele);
203
+ #else
204
+ gl_Position=projectTileWithElevation(corner_position,ele);
205
+ #endif
206
+ } else {gl_Position=projectTileWithElevation(circle_center,ele);if (gl_Position.z/gl_Position.w > 1.0) {gl_Position.xy=vec2(10000.0);}if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:bn(Wd,"in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}"),heatmap:bn(`uniform highp float u_intensity;in vec2 v_extrude;
207
+ #pragma mapbox: define highp float weight
208
+ #define GAUSS_COEF 0.3989422804014327
209
+ void main() {
210
+ #pragma mapbox: initialize highp float weight
211
+ float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);fragColor=vec4(val,1.0,1.0,1.0);
212
+ #ifdef OVERDRAW_INSPECTOR
213
+ fragColor=vec4(1.0);
214
+ #endif
215
+ }`,`uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;uniform highp float u_globe_extrude_scale;in vec2 a_pos;out vec2 v_extrude;
216
+ #pragma mapbox: define highp float weight
217
+ #pragma mapbox: define mediump float radius
218
+ const highp float ZERO=1.0/255.0/16.0;
219
+ #define GAUSS_COEF 0.3989422804014327
220
+ void main(void) {
221
+ #pragma mapbox: initialize highp float weight
222
+ #pragma mapbox: initialize mediump float radius
223
+ vec2 pos_raw=a_pos+32768.0;vec2 unscaled_extrude=vec2(mod(pos_raw,8.0)/7.0*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec2 circle_center=floor(pos_raw/8.0);
224
+ #ifdef GLOBE
225
+ vec2 angles=v_extrude*radius*u_globe_extrude_scale;vec3 center_vector=projectToSphere(circle_center);vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(circle_center+extrude,corner_vector,0.0);
226
+ #else
227
+ gl_Position=projectTileFor3D(circle_center+extrude,get_elevation(circle_center));
228
+ #endif
229
+ }`),heatmapTexture:bn(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;in vec2 v_pos;void main() {float t=texture(u_image,v_pos).r;vec4 color=texture(u_color_ramp,vec2(t,0.5));fragColor=color*u_opacity;
230
+ #ifdef OVERDRAW_INSPECTOR
231
+ fragColor=vec4(0.0);
232
+ #endif
233
+ }`,"uniform mat4 u_matrix;uniform vec2 u_world;in vec2 a_pos;out 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:bn("in float v_placed;in float v_notUsed;void main() {float alpha=0.5;fragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {fragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {fragColor*=.1;}}","in vec2 a_anchor_pos;in vec2 a_placed;in vec2 a_box_real;uniform vec2 u_pixel_extrude_scale;out float v_placed;out float v_notUsed;void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:bn("in float v_radius;in vec2 v_extrude;in float v_collision;void main() {float alpha=0.5;float stroke_radius=0.9;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);fragColor=color*alpha*opacity_t;}","in vec2 a_pos;in float a_radius;in vec2 a_flags;uniform vec2 u_viewport_size;out float v_radius;out vec2 v_extrude;out float v_collision;void main() {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;float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_collision=collision;gl_Position=vec4((a_pos/u_viewport_size*2.0-1.0)*vec2(1.0,-1.0),0.0,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),colorRelief:bn(`#ifdef GL_ES
234
+ precision highp float;
235
+ #endif
236
+ uniform sampler2D u_image;uniform vec4 u_unpack;uniform sampler2D u_elevation_stops;uniform sampler2D u_color_stops;uniform int u_color_ramp_size;uniform float u_opacity;in vec2 v_pos;float getElevation(vec2 coord) {vec4 data=texture(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack);}float getElevationStop(int stop) {float x=(float(stop)+0.5)/float(u_color_ramp_size);vec4 data=texture(u_elevation_stops,vec2(x,0))*255.0;data.a=-1.0;return dot(data,u_unpack);}void main() {float el=getElevation(v_pos);int r=(u_color_ramp_size-1);int l=0;float el_l=getElevationStop(l);float el_r=getElevationStop(r);while(r-l > 1){int m=(r+l)/2;float el_m=getElevationStop(m);if(el < el_m){r=m;el_r=el_m;}else
237
+ {l=m;el_l=el_m;}}float x=(float(l)+(el-el_l)/(el_r-el_l)+0.5)/float(u_color_ramp_size);fragColor=u_opacity*texture(u_color_stops,vec2(x,0));
238
+ #ifdef OVERDRAW_INSPECTOR
239
+ fragColor=vec4(1.0);
240
+ #endif
241
+ }`,"uniform vec2 u_dimension;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=projectTile(a_pos,a_pos);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_pos/8192.0)*scale+epsilon;if (a_pos.y <-32767.5) {v_pos.y=0.0;}if (a_pos.y > 32766.5) {v_pos.y=1.0;}}"),debug:bn("uniform highp vec4 u_color;uniform sampler2D u_overlay;in vec2 v_uv;void main() {vec4 overlay_color=texture(u_overlay,v_uv);fragColor=mix(u_color,overlay_color,overlay_color.a);}","in vec2 a_pos;out vec2 v_uv;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=projectTileWithElevation(a_pos*u_overlay_scale,get_elevation(a_pos));}"),depth:bn(Wd,`in vec2 a_pos;void main() {
242
+ #ifdef GLOBE
243
+ gl_Position=projectTileFor3D(a_pos,0.0);
244
+ #else
245
+ gl_Position=u_projection_matrix*vec4(a_pos,0.0,1.0);
246
+ #endif
247
+ }`),fill:bn(`#pragma mapbox: define highp vec4 color
248
+ #pragma mapbox: define lowp float opacity
249
+ void main() {
250
+ #pragma mapbox: initialize highp vec4 color
251
+ #pragma mapbox: initialize lowp float opacity
252
+ fragColor=color*opacity;
253
+ #ifdef OVERDRAW_INSPECTOR
254
+ fragColor=vec4(1.0);
255
+ #endif
256
+ }`,`uniform vec2 u_fill_translate;in vec2 a_pos;
257
+ #pragma mapbox: define highp vec4 color
258
+ #pragma mapbox: define lowp float opacity
259
+ void main() {
260
+ #pragma mapbox: initialize highp vec4 color
261
+ #pragma mapbox: initialize lowp float opacity
262
+ gl_Position=projectTile(a_pos+u_fill_translate,a_pos);}`),fillOutline:bn(`in vec2 v_pos;
263
+ #ifdef GLOBE
264
+ in float v_depth;
265
+ #endif
266
+ #pragma mapbox: define highp vec4 outline_color
267
+ #pragma mapbox: define lowp float opacity
268
+ void main() {
269
+ #pragma mapbox: initialize highp vec4 outline_color
270
+ #pragma mapbox: initialize lowp float opacity
271
+ float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=outline_color*(alpha*opacity);
272
+ #ifdef GLOBE
273
+ if (v_depth > 1.0) {discard;}
274
+ #endif
275
+ #ifdef OVERDRAW_INSPECTOR
276
+ fragColor=vec4(1.0);
277
+ #endif
278
+ }`,`uniform vec2 u_world;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos;
279
+ #ifdef GLOBE
280
+ out float v_depth;
281
+ #endif
282
+ #pragma mapbox: define highp vec4 outline_color
283
+ #pragma mapbox: define lowp float opacity
284
+ void main() {
285
+ #pragma mapbox: initialize highp vec4 outline_color
286
+ #pragma mapbox: initialize lowp float opacity
287
+ gl_Position=projectTile(a_pos+u_fill_translate,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;
288
+ #ifdef GLOBE
289
+ v_depth=gl_Position.z/gl_Position.w;
290
+ #endif
291
+ }`),fillOutlinePattern:bn(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;in vec2 v_pos_a;in vec2 v_pos_b;in vec2 v_pos;
292
+ #ifdef GLOBE
293
+ in float v_depth;
294
+ #endif
295
+ #pragma mapbox: define lowp float opacity
296
+ #pragma mapbox: define lowp vec4 pattern_from
297
+ #pragma mapbox: define lowp vec4 pattern_to
298
+ void main() {
299
+ #pragma mapbox: initialize lowp float opacity
300
+ #pragma mapbox: initialize mediump vec4 pattern_from
301
+ #pragma mapbox: initialize mediump vec4 pattern_to
302
+ 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=texture(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=texture(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=mix(color1,color2,u_fade)*alpha*opacity;
303
+ #ifdef GLOBE
304
+ if (v_depth > 1.0) {discard;}
305
+ #endif
306
+ #ifdef OVERDRAW_INSPECTOR
307
+ fragColor=vec4(1.0);
308
+ #endif
309
+ }`,`uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;out vec2 v_pos;
310
+ #ifdef GLOBE
311
+ out float v_depth;
312
+ #endif
313
+ #pragma mapbox: define lowp float opacity
314
+ #pragma mapbox: define lowp vec4 pattern_from
315
+ #pragma mapbox: define lowp vec4 pattern_to
316
+ #pragma mapbox: define lowp float pixel_ratio_from
317
+ #pragma mapbox: define lowp float pixel_ratio_to
318
+ void main() {
319
+ #pragma mapbox: initialize lowp float opacity
320
+ #pragma mapbox: initialize mediump vec4 pattern_from
321
+ #pragma mapbox: initialize mediump vec4 pattern_to
322
+ #pragma mapbox: initialize lowp float pixel_ratio_from
323
+ #pragma mapbox: initialize lowp float pixel_ratio_to
324
+ 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=projectTile(a_pos+u_fill_translate,a_pos);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;
325
+ #ifdef GLOBE
326
+ v_depth=gl_Position.z/gl_Position.w;
327
+ #endif
328
+ }`),fillPattern:bn(`#ifdef GL_ES
329
+ precision highp float;
330
+ #endif
331
+ uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;
332
+ #pragma mapbox: define lowp float opacity
333
+ #pragma mapbox: define lowp vec4 pattern_from
334
+ #pragma mapbox: define lowp vec4 pattern_to
335
+ void main() {
336
+ #pragma mapbox: initialize lowp float opacity
337
+ #pragma mapbox: initialize mediump vec4 pattern_from
338
+ #pragma mapbox: initialize mediump vec4 pattern_to
339
+ 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=texture(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=texture(u_image,pos2);fragColor=mix(color1,color2,u_fade)*opacity;
340
+ #ifdef OVERDRAW_INSPECTOR
341
+ fragColor=vec4(1.0);
342
+ #endif
343
+ }`,`uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;
344
+ #pragma mapbox: define lowp float opacity
345
+ #pragma mapbox: define lowp vec4 pattern_from
346
+ #pragma mapbox: define lowp vec4 pattern_to
347
+ #pragma mapbox: define lowp float pixel_ratio_from
348
+ #pragma mapbox: define lowp float pixel_ratio_to
349
+ void main() {
350
+ #pragma mapbox: initialize lowp float opacity
351
+ #pragma mapbox: initialize mediump vec4 pattern_from
352
+ #pragma mapbox: initialize mediump vec4 pattern_to
353
+ #pragma mapbox: initialize lowp float pixel_ratio_from
354
+ #pragma mapbox: initialize lowp float pixel_ratio_to
355
+ 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=projectTile(a_pos+u_fill_translate,a_pos);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:bn(`in vec4 v_color;void main() {fragColor=v_color;
356
+ #ifdef OVERDRAW_INSPECTOR
357
+ fragColor=vec4(1.0);
358
+ #endif
359
+ }`,`uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp vec3 u_lightpos_globe;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec2 u_fill_translate;in vec2 a_pos;in vec4 a_normal_ed;
360
+ #ifdef TERRAIN3D
361
+ in vec2 a_centroid;
362
+ #endif
363
+ out vec4 v_color;
364
+ #pragma mapbox: define highp float base
365
+ #pragma mapbox: define highp float height
366
+ #pragma mapbox: define highp vec4 color
367
+ void main() {
368
+ #pragma mapbox: initialize highp float base
369
+ #pragma mapbox: initialize highp float height
370
+ #pragma mapbox: initialize highp vec4 color
371
+ vec3 normal=a_normal_ed.xyz;
372
+ #ifdef TERRAIN3D
373
+ float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);
374
+ #else
375
+ float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;
376
+ #endif
377
+ base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate;
378
+ #ifdef GLOBE
379
+ vec3 spherePos=projectToSphere(posInTile,a_pos);gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);
380
+ #else
381
+ gl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);
382
+ #endif
383
+ 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;vec3 normalForLighting=normal/16384.0;float directional=clamp(dot(normalForLighting,u_lightpos),0.0,1.0);
384
+ #ifdef GLOBE
385
+ mat3 rotMatrix=globeGetRotationMatrix(spherePos);normalForLighting=rotMatrix*normalForLighting;directional=mix(directional,clamp(dot(normalForLighting,u_lightpos_globe),0.0,1.0),u_projection_transition);
386
+ #endif
387
+ 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:bn(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;in vec4 v_lighting;
388
+ #pragma mapbox: define lowp float base
389
+ #pragma mapbox: define lowp float height
390
+ #pragma mapbox: define lowp vec4 pattern_from
391
+ #pragma mapbox: define lowp vec4 pattern_to
392
+ #pragma mapbox: define lowp float pixel_ratio_from
393
+ #pragma mapbox: define lowp float pixel_ratio_to
394
+ void main() {
395
+ #pragma mapbox: initialize lowp float base
396
+ #pragma mapbox: initialize lowp float height
397
+ #pragma mapbox: initialize mediump vec4 pattern_from
398
+ #pragma mapbox: initialize mediump vec4 pattern_to
399
+ #pragma mapbox: initialize lowp float pixel_ratio_from
400
+ #pragma mapbox: initialize lowp float pixel_ratio_to
401
+ 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=texture(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=texture(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);fragColor=mixedColor*v_lighting;
402
+ #ifdef OVERDRAW_INSPECTOR
403
+ fragColor=vec4(1.0);
404
+ #endif
405
+ }`,`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 vec2 u_fill_translate;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp vec3 u_lightpos_globe;uniform lowp float u_lightintensity;in vec2 a_pos;in vec4 a_normal_ed;
406
+ #ifdef TERRAIN3D
407
+ in vec2 a_centroid;
408
+ #endif
409
+ #ifdef GLOBE
410
+ out vec3 v_sphere_pos;
411
+ #endif
412
+ out vec2 v_pos_a;out vec2 v_pos_b;out vec4 v_lighting;
413
+ #pragma mapbox: define lowp float base
414
+ #pragma mapbox: define lowp float height
415
+ #pragma mapbox: define lowp vec4 pattern_from
416
+ #pragma mapbox: define lowp vec4 pattern_to
417
+ #pragma mapbox: define lowp float pixel_ratio_from
418
+ #pragma mapbox: define lowp float pixel_ratio_to
419
+ void main() {
420
+ #pragma mapbox: initialize lowp float base
421
+ #pragma mapbox: initialize lowp float height
422
+ #pragma mapbox: initialize mediump vec4 pattern_from
423
+ #pragma mapbox: initialize mediump vec4 pattern_to
424
+ #pragma mapbox: initialize lowp float pixel_ratio_from
425
+ #pragma mapbox: initialize lowp float pixel_ratio_to
426
+ 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;
427
+ #ifdef TERRAIN3D
428
+ float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);
429
+ #else
430
+ float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;
431
+ #endif
432
+ base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate;
433
+ #ifdef GLOBE
434
+ vec3 spherePos=projectToSphere(posInTile,a_pos);vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);v_sphere_pos=elevatedPos;gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);
435
+ #else
436
+ gl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);
437
+ #endif
438
+ vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0
439
+ ? a_pos
440
+ : vec2(edgedistance,elevation*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:bn(`#ifdef GL_ES
441
+ precision highp float;
442
+ #endif
443
+ uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack);}void main() {vec2 epsilon=1.0/u_dimension;float tileSize=u_dimension.x-2.0;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))*tileSize/pow(2.0,exaggeration+(28.2562-u_zoom));fragColor=clamp(vec4(deriv.x/8.0+0.5,deriv.y/8.0+0.5,1.0,1.0),0.0,1.0);
444
+ #ifdef OVERDRAW_INSPECTOR
445
+ fragColor=vec4(1.0);
446
+ #endif
447
+ }`,"uniform mat4 u_matrix;uniform vec2 u_dimension;in vec2 a_pos;in vec2 a_texture_pos;out 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:bn(`uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_latrange;uniform float u_exaggeration;uniform vec4 u_accent;uniform int u_method;uniform float u_altitudes[NUM_ILLUMINATION_SOURCES];uniform float u_azimuths[NUM_ILLUMINATION_SOURCES];uniform vec4 u_shadows[NUM_ILLUMINATION_SOURCES];uniform vec4 u_highlights[NUM_ILLUMINATION_SOURCES];
448
+ #define PI 3.141592653589793
449
+ #define STANDARD 0
450
+ #define COMBINED 1
451
+ #define IGOR 2
452
+ #define MULTIDIRECTIONAL 3
453
+ #define BASIC 4
454
+ float get_aspect(vec2 deriv){return deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);}void igor_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float aspect=get_aspect(deriv);float azimuth=u_azimuths[0]+PI;float slope_stength=atan(length(deriv))*2.0/PI;float aspect_strength=1.0-abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);float shadow_strength=slope_stength*aspect_strength;float highlight_strength=slope_stength*(1.0-aspect_strength);fragColor=u_shadows[0]*shadow_strength+u_highlights[0]*highlight_strength;}void standard_hillshade(vec2 deriv){float azimuth=u_azimuths[0]+PI;float slope=atan(0.625*length(deriv));float aspect=get_aspect(deriv);float intensity=u_exaggeration;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_shadows[0],u_highlights[0],shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);fragColor=accent_color*(1.0-shade_color.a)+shade_color;}void basic_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float azimuth=u_azimuths[0]+PI;float cos_az=cos(azimuth);float sin_az=sin(azimuth);float cos_alt=cos(u_altitudes[0]);float sin_alt=sin(u_altitudes[0]);float cang=(sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv));float shade=clamp(cang,0.0,1.0);if(shade > 0.5){fragColor=u_highlights[0]*(2.0*shade-1.0);}else
455
+ {fragColor=u_shadows[0]*(1.0-2.0*shade);}}void multidirectional_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;fragColor=vec4(0,0,0,0);for(int i=0; i < NUM_ILLUMINATION_SOURCES; i++){float cos_alt=cos(u_altitudes[i]);float sin_alt=sin(u_altitudes[i]);float cos_az=-cos(u_azimuths[i]);float sin_az=-sin(u_azimuths[i]);float cang=(sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv));float shade=clamp(cang,0.0,1.0);if(shade > 0.5){fragColor+=u_highlights[i]*(2.0*shade-1.0)/float(NUM_ILLUMINATION_SOURCES);}else
456
+ {fragColor+=u_shadows[i]*(1.0-2.0*shade)/float(NUM_ILLUMINATION_SOURCES);}}}void combined_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float azimuth=u_azimuths[0]+PI;float cos_az=cos(azimuth);float sin_az=sin(azimuth);float cos_alt=cos(u_altitudes[0]);float sin_alt=sin(u_altitudes[0]);float cang=acos((sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv)));cang=clamp(cang,0.0,PI/2.0);float shade=cang*atan(length(deriv))*4.0/PI/PI;float highlight=(PI/2.0-cang)*atan(length(deriv))*4.0/PI/PI;fragColor=u_shadows[0]*shade+u_highlights[0]*highlight;}void main() {vec4 pixel=texture(u_image,v_pos);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));vec2 deriv=((pixel.rg*8.0)-4.0)/scaleFactor;if (u_method==BASIC) {basic_hillshade(deriv);} else if (u_method==COMBINED) {combined_hillshade(deriv);} else if (u_method==IGOR) {igor_hillshade(deriv);} else if (u_method==MULTIDIRECTIONAL) {multidirectional_hillshade(deriv);} else if (u_method==STANDARD) {standard_hillshade(deriv);} else {standard_hillshade(deriv);}
457
+ #ifdef OVERDRAW_INSPECTOR
458
+ fragColor=vec4(1.0);
459
+ #endif
460
+ }`,"uniform mat4 u_matrix;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=projectTile(a_pos,a_pos);v_pos=a_pos/8192.0;if (a_pos.y <-32767.5) {v_pos.y=0.0;}if (a_pos.y > 32766.5) {v_pos.y=1.0;}}"),line:bn(`uniform lowp float u_device_pixel_ratio;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;
461
+ #ifdef GLOBE
462
+ in float v_depth;
463
+ #endif
464
+ #pragma mapbox: define highp vec4 color
465
+ #pragma mapbox: define lowp float blur
466
+ #pragma mapbox: define lowp float opacity
467
+ void main() {
468
+ #pragma mapbox: initialize highp vec4 color
469
+ #pragma mapbox: initialize lowp float blur
470
+ #pragma mapbox: initialize lowp float opacity
471
+ 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);fragColor=color*(alpha*opacity);
472
+ #ifdef GLOBE
473
+ if (v_depth > 1.0) {discard;}
474
+ #endif
475
+ #ifdef OVERDRAW_INSPECTOR
476
+ fragColor=vec4(1.0);
477
+ #endif
478
+ }`,`
479
+ #define scale 0.015873016
480
+ in vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp float v_linesofar;
481
+ #ifdef GLOBE
482
+ out float v_depth;
483
+ #endif
484
+ #pragma mapbox: define highp vec4 color
485
+ #pragma mapbox: define lowp float blur
486
+ #pragma mapbox: define lowp float opacity
487
+ #pragma mapbox: define mediump float gapwidth
488
+ #pragma mapbox: define lowp float offset
489
+ #pragma mapbox: define mediump float width
490
+ void main() {
491
+ #pragma mapbox: initialize highp vec4 color
492
+ #pragma mapbox: initialize lowp float blur
493
+ #pragma mapbox: initialize lowp float opacity
494
+ #pragma mapbox: initialize mediump float gapwidth
495
+ #pragma mapbox: initialize lowp float offset
496
+ #pragma mapbox: initialize mediump float width
497
+ 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);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;
498
+ #ifdef GLOBE
499
+ v_depth=gl_Position.z/gl_Position.w;
500
+ #endif
501
+ #ifdef TERRAIN3D
502
+ v_gamma_scale=1.0;
503
+ #else
504
+ float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
505
+ #endif
506
+ v_width2=vec2(outset,inset);}`),lineGradient:bn(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;in highp vec2 v_uv;
507
+ #ifdef GLOBE
508
+ in float v_depth;
509
+ #endif
510
+ #pragma mapbox: define lowp float blur
511
+ #pragma mapbox: define lowp float opacity
512
+ void main() {
513
+ #pragma mapbox: initialize lowp float blur
514
+ #pragma mapbox: initialize lowp float opacity
515
+ 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=texture(u_image,v_uv);fragColor=color*(alpha*opacity);
516
+ #ifdef GLOBE
517
+ if (v_depth > 1.0) {discard;}
518
+ #endif
519
+ #ifdef OVERDRAW_INSPECTOR
520
+ fragColor=vec4(1.0);
521
+ #endif
522
+ }`,`
523
+ #define scale 0.015873016
524
+ in vec2 a_pos_normal;in vec4 a_data;in float a_uv_x;in float a_split_index;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp vec2 v_uv;
525
+ #ifdef GLOBE
526
+ out float v_depth;
527
+ #endif
528
+ #pragma mapbox: define lowp float blur
529
+ #pragma mapbox: define lowp float opacity
530
+ #pragma mapbox: define mediump float gapwidth
531
+ #pragma mapbox: define lowp float offset
532
+ #pragma mapbox: define mediump float width
533
+ void main() {
534
+ #pragma mapbox: initialize lowp float blur
535
+ #pragma mapbox: initialize lowp float opacity
536
+ #pragma mapbox: initialize mediump float gapwidth
537
+ #pragma mapbox: initialize lowp float offset
538
+ #pragma mapbox: initialize mediump float width
539
+ 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);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;
540
+ #ifdef GLOBE
541
+ v_depth=gl_Position.z/gl_Position.w;
542
+ #endif
543
+ #ifdef TERRAIN3D
544
+ v_gamma_scale=1.0;
545
+ #else
546
+ float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
547
+ #endif
548
+ v_width2=vec2(outset,inset);}`),linePattern:bn(`#ifdef GL_ES
549
+ precision highp float;
550
+ #endif
551
+ uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;in vec2 v_normal;in vec2 v_width2;in float v_linesofar;in float v_gamma_scale;in float v_width;
552
+ #ifdef GLOBE
553
+ in float v_depth;
554
+ #endif
555
+ #pragma mapbox: define lowp vec4 pattern_from
556
+ #pragma mapbox: define lowp vec4 pattern_to
557
+ #pragma mapbox: define lowp float pixel_ratio_from
558
+ #pragma mapbox: define lowp float pixel_ratio_to
559
+ #pragma mapbox: define lowp float blur
560
+ #pragma mapbox: define lowp float opacity
561
+ void main() {
562
+ #pragma mapbox: initialize mediump vec4 pattern_from
563
+ #pragma mapbox: initialize mediump vec4 pattern_to
564
+ #pragma mapbox: initialize lowp float pixel_ratio_from
565
+ #pragma mapbox: initialize lowp float pixel_ratio_to
566
+ #pragma mapbox: initialize lowp float blur
567
+ #pragma mapbox: initialize lowp float opacity
568
+ 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(texture(u_image,pos_a),texture(u_image,pos_b),u_fade);fragColor=color*alpha*opacity;
569
+ #ifdef GLOBE
570
+ if (v_depth > 1.0) {discard;}
571
+ #endif
572
+ #ifdef OVERDRAW_INSPECTOR
573
+ fragColor=vec4(1.0);
574
+ #endif
575
+ }`,`
576
+ #define scale 0.015873016
577
+ #define LINE_DISTANCE_SCALE 2.0
578
+ in vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;out vec2 v_normal;out vec2 v_width2;out float v_linesofar;out float v_gamma_scale;out float v_width;
579
+ #ifdef GLOBE
580
+ out float v_depth;
581
+ #endif
582
+ #pragma mapbox: define lowp float blur
583
+ #pragma mapbox: define lowp float opacity
584
+ #pragma mapbox: define lowp float offset
585
+ #pragma mapbox: define mediump float gapwidth
586
+ #pragma mapbox: define mediump float width
587
+ #pragma mapbox: define lowp float floorwidth
588
+ #pragma mapbox: define lowp vec4 pattern_from
589
+ #pragma mapbox: define lowp vec4 pattern_to
590
+ #pragma mapbox: define lowp float pixel_ratio_from
591
+ #pragma mapbox: define lowp float pixel_ratio_to
592
+ void main() {
593
+ #pragma mapbox: initialize lowp float blur
594
+ #pragma mapbox: initialize lowp float opacity
595
+ #pragma mapbox: initialize lowp float offset
596
+ #pragma mapbox: initialize mediump float gapwidth
597
+ #pragma mapbox: initialize mediump float width
598
+ #pragma mapbox: initialize lowp float floorwidth
599
+ #pragma mapbox: initialize mediump vec4 pattern_from
600
+ #pragma mapbox: initialize mediump vec4 pattern_to
601
+ #pragma mapbox: initialize lowp float pixel_ratio_from
602
+ #pragma mapbox: initialize lowp float pixel_ratio_to
603
+ 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);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;
604
+ #ifdef GLOBE
605
+ v_depth=gl_Position.z/gl_Position.w;
606
+ #endif
607
+ #ifdef TERRAIN3D
608
+ v_gamma_scale=1.0;
609
+ #else
610
+ float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
611
+ #endif
612
+ v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:bn(`uniform lowp float u_device_pixel_ratio;uniform lowp float u_lineatlas_width;uniform sampler2D u_image;uniform float u_mix;in vec2 v_normal;in vec2 v_width2;in vec2 v_tex_a;in vec2 v_tex_b;in float v_gamma_scale;
613
+ #ifdef GLOBE
614
+ in float v_depth;
615
+ #endif
616
+ #pragma mapbox: define highp vec4 color
617
+ #pragma mapbox: define lowp float blur
618
+ #pragma mapbox: define lowp float opacity
619
+ #pragma mapbox: define mediump float width
620
+ #pragma mapbox: define lowp float floorwidth
621
+ #pragma mapbox: define mediump vec4 dasharray_from
622
+ #pragma mapbox: define mediump vec4 dasharray_to
623
+ void main() {
624
+ #pragma mapbox: initialize highp vec4 color
625
+ #pragma mapbox: initialize lowp float blur
626
+ #pragma mapbox: initialize lowp float opacity
627
+ #pragma mapbox: initialize mediump float width
628
+ #pragma mapbox: initialize lowp float floorwidth
629
+ #pragma mapbox: initialize mediump vec4 dasharray_from
630
+ #pragma mapbox: initialize mediump vec4 dasharray_to
631
+ 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=texture(u_image,v_tex_a).a;float sdfdist_b=texture(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);float sdfgamma=(u_lineatlas_width/256.0)/min(dasharray_from.w,dasharray_to.w);alpha*=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);fragColor=color*(alpha*opacity);
632
+ #ifdef GLOBE
633
+ if (v_depth > 1.0) {discard;}
634
+ #endif
635
+ #ifdef OVERDRAW_INSPECTOR
636
+ fragColor=vec4(1.0);
637
+ #endif
638
+ }`,`
639
+ #define scale 0.015873016
640
+ #define LINE_DISTANCE_SCALE 2.0
641
+ in vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_tileratio;uniform float u_crossfade_from;uniform float u_crossfade_to;uniform float u_lineatlas_height;out vec2 v_normal;out vec2 v_width2;out vec2 v_tex_a;out vec2 v_tex_b;out float v_gamma_scale;
642
+ #ifdef GLOBE
643
+ out float v_depth;
644
+ #endif
645
+ #pragma mapbox: define highp vec4 color
646
+ #pragma mapbox: define lowp float blur
647
+ #pragma mapbox: define lowp float opacity
648
+ #pragma mapbox: define mediump float gapwidth
649
+ #pragma mapbox: define lowp float offset
650
+ #pragma mapbox: define mediump float width
651
+ #pragma mapbox: define lowp float floorwidth
652
+ #pragma mapbox: define mediump vec4 dasharray_from
653
+ #pragma mapbox: define mediump vec4 dasharray_to
654
+ void main() {
655
+ #pragma mapbox: initialize highp vec4 color
656
+ #pragma mapbox: initialize lowp float blur
657
+ #pragma mapbox: initialize lowp float opacity
658
+ #pragma mapbox: initialize mediump float gapwidth
659
+ #pragma mapbox: initialize lowp float offset
660
+ #pragma mapbox: initialize mediump float width
661
+ #pragma mapbox: initialize lowp float floorwidth
662
+ #pragma mapbox: initialize mediump vec4 dasharray_from
663
+ #pragma mapbox: initialize mediump vec4 dasharray_to
664
+ 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);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;
665
+ #ifdef GLOBE
666
+ v_depth=gl_Position.z/gl_Position.w;
667
+ #endif
668
+ #ifdef TERRAIN3D
669
+ v_gamma_scale=1.0;
670
+ #else
671
+ float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
672
+ #endif
673
+ float u_patternscale_a_x=u_tileratio/dasharray_from.w/u_crossfade_from;float u_patternscale_a_y=-dasharray_from.z/2.0/u_lineatlas_height;float u_patternscale_b_x=u_tileratio/dasharray_to.w/u_crossfade_to;float u_patternscale_b_y=-dasharray_to.z/2.0/u_lineatlas_height;v_tex_a=vec2(a_linesofar*u_patternscale_a_x/floorwidth,normal.y*u_patternscale_a_y+(float(dasharray_from.y)+0.5)/u_lineatlas_height);v_tex_b=vec2(a_linesofar*u_patternscale_b_x/floorwidth,normal.y*u_patternscale_b_y+(float(dasharray_to.y)+0.5)/u_lineatlas_height);v_width2=vec2(outset,inset);}`),lineGradientSDF:bn(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform sampler2D u_image_dash;uniform float u_mix;uniform lowp float u_lineatlas_width;in vec2 v_normal;in vec2 v_width2;in vec2 v_tex_a;in vec2 v_tex_b;in float v_gamma_scale;in highp vec2 v_uv;
674
+ #ifdef GLOBE
675
+ in float v_depth;
676
+ #endif
677
+ #pragma mapbox: define lowp float blur
678
+ #pragma mapbox: define lowp float opacity
679
+ #pragma mapbox: define mediump float width
680
+ #pragma mapbox: define lowp float floorwidth
681
+ #pragma mapbox: define mediump vec4 dasharray_from
682
+ #pragma mapbox: define mediump vec4 dasharray_to
683
+ void main() {
684
+ #pragma mapbox: initialize lowp float blur
685
+ #pragma mapbox: initialize lowp float opacity
686
+ #pragma mapbox: initialize mediump float width
687
+ #pragma mapbox: initialize lowp float floorwidth
688
+ #pragma mapbox: initialize mediump vec4 dasharray_from
689
+ #pragma mapbox: initialize mediump vec4 dasharray_to
690
+ 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=texture(u_image,v_uv);float sdfdist_a=texture(u_image_dash,v_tex_a).a;float sdfdist_b=texture(u_image_dash,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);float sdfgamma=(u_lineatlas_width/256.0)/min(dasharray_from.w,dasharray_to.w);float dash_alpha=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);fragColor=color*(alpha*dash_alpha*opacity);
691
+ #ifdef GLOBE
692
+ if (v_depth > 1.0) {discard;}
693
+ #endif
694
+ #ifdef OVERDRAW_INSPECTOR
695
+ fragColor=vec4(1.0);
696
+ #endif
697
+ }`,`
698
+ #define scale 0.015873016
699
+ #define LINE_DISTANCE_SCALE 2.0
700
+ in vec2 a_pos_normal;in vec4 a_data;in float a_uv_x;in float a_split_index;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;uniform float u_tileratio;uniform float u_crossfade_from;uniform float u_crossfade_to;uniform float u_lineatlas_height;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp vec2 v_uv;out vec2 v_tex_a;out vec2 v_tex_b;
701
+ #ifdef GLOBE
702
+ out float v_depth;
703
+ #endif
704
+ #pragma mapbox: define lowp float blur
705
+ #pragma mapbox: define lowp float opacity
706
+ #pragma mapbox: define mediump float gapwidth
707
+ #pragma mapbox: define lowp float offset
708
+ #pragma mapbox: define mediump float width
709
+ #pragma mapbox: define lowp float floorwidth
710
+ #pragma mapbox: define mediump vec4 dasharray_from
711
+ #pragma mapbox: define mediump vec4 dasharray_to
712
+ void main() {
713
+ #pragma mapbox: initialize lowp float blur
714
+ #pragma mapbox: initialize lowp float opacity
715
+ #pragma mapbox: initialize mediump float gapwidth
716
+ #pragma mapbox: initialize lowp float offset
717
+ #pragma mapbox: initialize mediump float width
718
+ #pragma mapbox: initialize lowp float floorwidth
719
+ #pragma mapbox: initialize mediump vec4 dasharray_from
720
+ #pragma mapbox: initialize mediump vec4 dasharray_to
721
+ 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;float texel_height=1.0/u_image_height;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);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;
722
+ #ifdef GLOBE
723
+ v_depth=gl_Position.z/gl_Position.w;
724
+ #endif
725
+ #ifdef TERRAIN3D
726
+ v_gamma_scale=1.0;
727
+ #else
728
+ float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
729
+ #endif
730
+ float u_patternscale_a_x=u_tileratio/dasharray_from.w/u_crossfade_from;float u_patternscale_a_y=-dasharray_from.z/2.0/u_lineatlas_height;float u_patternscale_b_x=u_tileratio/dasharray_to.w/u_crossfade_to;float u_patternscale_b_y=-dasharray_to.z/2.0/u_lineatlas_height;v_tex_a=vec2(a_linesofar*u_patternscale_a_x/floorwidth,normal.y*u_patternscale_a_y+(float(dasharray_from.y)+0.5)/u_lineatlas_height);v_tex_b=vec2(a_linesofar*u_patternscale_b_x/floorwidth,normal.y*u_patternscale_b_y+(float(dasharray_to.y)+0.5)/u_lineatlas_height);v_width2=vec2(outset,inset);}`),raster:bn(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;in vec2 v_pos0;in 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=texture(u_image0,v_pos0);vec4 color1=texture(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);fragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);
731
+ #ifdef OVERDRAW_INSPECTOR
732
+ fragColor=vec4(1.0);
733
+ #endif
734
+ }`,`uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;uniform vec4 u_coords_top;uniform vec4 u_coords_bottom;in vec2 a_pos;out vec2 v_pos0;out vec2 v_pos1;void main() {vec2 fractionalPos=a_pos/8192.0;vec2 position=mix(mix(u_coords_top.xy,u_coords_top.zw,fractionalPos.x),mix(u_coords_bottom.xy,u_coords_bottom.zw,fractionalPos.x),fractionalPos.y);gl_Position=projectTile(position,position);v_pos0=((fractionalPos-0.5)/u_buffer_scale)+0.5;
735
+ #ifdef GLOBE
736
+ if (a_pos.y <-32767.5) {v_pos0.y=0.0;}if (a_pos.y > 32766.5) {v_pos0.y=1.0;}
737
+ #endif
738
+ v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}`),symbolIcon:bn(`uniform sampler2D u_texture;in vec2 v_tex;in float v_fade_opacity;
739
+ #pragma mapbox: define lowp float opacity
740
+ void main() {
741
+ #pragma mapbox: initialize lowp float opacity
742
+ lowp float alpha=opacity*v_fade_opacity;fragColor=texture(u_texture,v_tex)*alpha;
743
+ #ifdef OVERDRAW_INSPECTOR
744
+ fragColor=vec4(1.0);
745
+ #endif
746
+ }`,`in vec4 a_pos_offset;in vec4 a_data;in vec4 a_pixeloffset;in vec3 a_projected_pos;in 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_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;out vec2 v_tex;out float v_fade_opacity;
747
+ #pragma mapbox: define lowp float opacity
748
+ void main() {
749
+ #pragma mapbox: initialize lowp float opacity
750
+ 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;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
751
+ camera_to_anchor_distance/u_camera_to_center_distance :
752
+ 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=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;
753
+ #ifdef GLOBE
754
+ if(u_pitch_with_map) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}
755
+ #endif
756
+ vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:bn(`#define SDF_PX 8.0
757
+ 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;in vec2 v_data0;in vec3 v_data1;
758
+ #pragma mapbox: define highp vec4 fill_color
759
+ #pragma mapbox: define highp vec4 halo_color
760
+ #pragma mapbox: define lowp float opacity
761
+ #pragma mapbox: define lowp float halo_width
762
+ #pragma mapbox: define lowp float halo_blur
763
+ void main() {
764
+ #pragma mapbox: initialize highp vec4 fill_color
765
+ #pragma mapbox: initialize highp vec4 halo_color
766
+ #pragma mapbox: initialize lowp float opacity
767
+ #pragma mapbox: initialize lowp float halo_width
768
+ #pragma mapbox: initialize lowp float halo_blur
769
+ 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 inner_edge=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}fragColor=color*(alpha*opacity*fade_opacity);
770
+ #ifdef OVERDRAW_INSPECTOR
771
+ fragColor=vec4(1.0);
772
+ #endif
773
+ }`,`in vec4 a_pos_offset;in vec4 a_data;in vec4 a_pixeloffset;in vec3 a_projected_pos;in 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_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_translation;uniform float u_pitched_scale;out vec2 v_data0;out vec3 v_data1;
774
+ #pragma mapbox: define highp vec4 fill_color
775
+ #pragma mapbox: define highp vec4 halo_color
776
+ #pragma mapbox: define lowp float opacity
777
+ #pragma mapbox: define lowp float halo_width
778
+ #pragma mapbox: define lowp float halo_blur
779
+ void main() {
780
+ #pragma mapbox: initialize highp vec4 fill_color
781
+ #pragma mapbox: initialize highp vec4 halo_color
782
+ #pragma mapbox: initialize lowp float opacity
783
+ #pragma mapbox: initialize lowp float halo_width
784
+ #pragma mapbox: initialize lowp float halo_blur
785
+ 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;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
786
+ camera_to_anchor_distance/u_camera_to_center_distance :
787
+ 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=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;
788
+ #ifdef GLOBE
789
+ if(u_pitch_with_map) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}
790
+ #endif
791
+ vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:bn(`#define SDF_PX 8.0
792
+ #define SDF 1.0
793
+ #define ICON 0.0
794
+ 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;in vec4 v_data0;in vec4 v_data1;
795
+ #pragma mapbox: define highp vec4 fill_color
796
+ #pragma mapbox: define highp vec4 halo_color
797
+ #pragma mapbox: define lowp float opacity
798
+ #pragma mapbox: define lowp float halo_width
799
+ #pragma mapbox: define lowp float halo_blur
800
+ void main() {
801
+ #pragma mapbox: initialize highp vec4 fill_color
802
+ #pragma mapbox: initialize highp vec4 halo_color
803
+ #pragma mapbox: initialize lowp float opacity
804
+ #pragma mapbox: initialize lowp float halo_width
805
+ #pragma mapbox: initialize lowp float halo_blur
806
+ float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;fragColor=texture(u_texture_icon,tex_icon)*alpha;
807
+ #ifdef OVERDRAW_INSPECTOR
808
+ fragColor=vec4(1.0);
809
+ #endif
810
+ 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=texture(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);fragColor=color*(alpha*opacity*fade_opacity);
811
+ #ifdef OVERDRAW_INSPECTOR
812
+ fragColor=vec4(1.0);
813
+ #endif
814
+ }`,`in vec4 a_pos_offset;in vec4 a_data;in vec3 a_projected_pos;in 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_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;out vec4 v_data0;out vec4 v_data1;
815
+ #pragma mapbox: define highp vec4 fill_color
816
+ #pragma mapbox: define highp vec4 halo_color
817
+ #pragma mapbox: define lowp float opacity
818
+ #pragma mapbox: define lowp float halo_width
819
+ #pragma mapbox: define lowp float halo_blur
820
+ void main() {
821
+ #pragma mapbox: initialize highp vec4 fill_color
822
+ #pragma mapbox: initialize highp vec4 halo_color
823
+ #pragma mapbox: initialize lowp float opacity
824
+ #pragma mapbox: initialize lowp float halo_width
825
+ #pragma mapbox: initialize lowp float halo_blur
826
+ 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;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
827
+ camera_to_anchor_distance/u_camera_to_center_distance :
828
+ 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=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;
829
+ #ifdef GLOBE
830
+ if(u_pitch_with_map && !u_is_along_line) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}
831
+ #endif
832
+ vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`),terrain:bn("uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;uniform bool u_is_globe_mode;in vec2 v_texture_pos;in float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture(u_texture,vec2(v_texture_pos.x,1.0-v_texture_pos.y));if (!u_is_globe_mode && v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);fragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {fragColor=surface_color;}}","in vec3 a_pos3d;uniform mat4 u_fog_matrix;uniform float u_ele_delta;out vec2 v_texture_pos;out float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=projectTileFor3D(a_pos3d.xy,get_elevation(a_pos3d.xy)-ele_delta);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:bn("in float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {fragColor=pack(v_depth);}","in vec3 a_pos3d;uniform float u_ele_delta;out float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=projectTileFor3D(a_pos3d.xy,ele-ele_delta);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:bn("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;in vec2 v_texture_pos;void main() {vec4 rgba=texture(u_texture,v_texture_pos);fragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}","in vec3 a_pos3d;uniform float u_ele_delta;out vec2 v_texture_pos;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=projectTileFor3D(a_pos3d.xy,ele-ele_delta);}"),projectionErrorMeasurement:bn("in vec4 v_output_error_encoded;void main() {fragColor=v_output_error_encoded;}","in vec2 a_pos;uniform highp float u_input;uniform highp float u_output_expected;out vec4 v_output_error_encoded;void main() {float real_output=2.0*atan(exp(PI-(u_input*PI*2.0)))-PI*0.5;float error=real_output-u_output_expected;float abs_error=abs(error)*128.0;v_output_error_encoded.x=min(floor(abs_error*256.0),255.0)/255.0;abs_error-=v_output_error_encoded.x;v_output_error_encoded.y=min(floor(abs_error*65536.0),255.0)/255.0;abs_error-=v_output_error_encoded.x/255.0;v_output_error_encoded.z=min(floor(abs_error*16777216.0),255.0)/255.0;v_output_error_encoded.w=error >=0.0 ? 1.0 : 0.0;gl_Position=vec4(a_pos,0.0,1.0);}"),atmosphere:bn(`in vec3 view_direction;uniform vec3 u_sun_pos;uniform vec3 u_globe_position;uniform float u_globe_radius;uniform float u_atmosphere_blend;/**Shader use from https:*Made some change to adapt to MapLibre Globe geometry*/const float PI=3.141592653589793;const int iSteps=5;const int jSteps=3;/*radius of the planet*/const float EARTH_RADIUS=6371e3;/*radius of the atmosphere*/const float ATMOS_RADIUS=6471e3;vec2 rsi(vec3 r0,vec3 rd,float sr) {float a=dot(rd,rd);float b=2.0*dot(rd,r0);float c=dot(r0,r0)-(sr*sr);float d=(b*b)-4.0*a*c;if (d < 0.0) return vec2(1e5,-1e5);return vec2((-b-sqrt(d))/(2.0*a),(-b+sqrt(d))/(2.0*a));}vec4 atmosphere(vec3 r,vec3 r0,vec3 pSun,float iSun,float rPlanet,float rAtmos,vec3 kRlh,float kMie,float shRlh,float shMie,float g) {pSun=normalize(pSun);r=normalize(r);vec2 p=rsi(r0,r,rAtmos);if (p.x > p.y) {return vec4(0.0,0.0,0.0,1.0);}if (p.x < 0.0) {p.x=0.0;}vec3 pos=r0+r*p.x;vec2 p2=rsi(r0,r,rPlanet);if (p2.x <=p2.y && p2.x > 0.0) {p.y=min(p.y,p2.x);}float iStepSize=(p.y-p.x)/float(iSteps);float iTime=p.x+iStepSize*0.5;vec3 totalRlh=vec3(0,0,0);vec3 totalMie=vec3(0,0,0);float iOdRlh=0.0;float iOdMie=0.0;float mu=dot(r,pSun);float mumu=mu*mu;float gg=g*g;float pRlh=3.0/(16.0*PI)*(1.0+mumu);float pMie=3.0/(8.0*PI)*((1.0-gg)*(mumu+1.0))/(pow(1.0+gg-2.0*mu*g,1.5)*(2.0+gg));for (int i=0; i < iSteps; i++) {vec3 iPos=r0+r*iTime;float iHeight=length(iPos)-rPlanet;float odStepRlh=exp(-iHeight/shRlh)*iStepSize;float odStepMie=exp(-iHeight/shMie)*iStepSize;iOdRlh+=odStepRlh;iOdMie+=odStepMie;float jStepSize=rsi(iPos,pSun,rAtmos).y/float(jSteps);float jTime=jStepSize*0.5;float jOdRlh=0.0;float jOdMie=0.0;for (int j=0; j < jSteps; j++) {vec3 jPos=iPos+pSun*jTime;float jHeight=length(jPos)-rPlanet;jOdRlh+=exp(-jHeight/shRlh)*jStepSize;jOdMie+=exp(-jHeight/shMie)*jStepSize;jTime+=jStepSize;}vec3 attn=exp(-(kMie*(iOdMie+jOdMie)+kRlh*(iOdRlh+jOdRlh)));totalRlh+=odStepRlh*attn;totalMie+=odStepMie*attn;iTime+=iStepSize;}float opacity=exp(-(length(kRlh)*length(totalRlh)+kMie*length(totalMie)));vec3 color=iSun*(pRlh*kRlh*totalRlh+pMie*kMie*totalMie);return vec4(color,opacity);}void main() {vec3 scale_camera_pos=-u_globe_position*EARTH_RADIUS/u_globe_radius;vec4 color=atmosphere(normalize(view_direction),scale_camera_pos,u_sun_pos,22.0,EARTH_RADIUS,ATMOS_RADIUS,vec3(5.5e-6,13.0e-6,22.4e-6),21e-6,8e3,1.2e3,0.758
833
+ );color.rgb=1.0-exp(-1.0*color.rgb);color=pow(color,vec4(1.0/2.2));fragColor=vec4(color.rgb,1.0-color.a)*u_atmosphere_blend;}`,"in vec2 a_pos;uniform mat4 u_inv_proj_matrix;out vec3 view_direction;void main() {view_direction=(u_inv_proj_matrix*vec4(a_pos,0.0,1.0)).xyz;gl_Position=vec4(a_pos,0.0,1.0);}"),sky:bn("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform vec2 u_horizon;uniform vec2 u_horizon_normal;uniform float u_sky_horizon_blend;uniform float u_sky_blend;void main() {float x=gl_FragCoord.x;float y=gl_FragCoord.y;float blend=(y-u_horizon.y)*u_horizon_normal.y+(x-u_horizon.x)*u_horizon_normal.x;if (blend > 0.0) {if (blend < u_sky_horizon_blend) {fragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {fragColor=u_sky_color;}}fragColor=mix(fragColor,vec4(vec3(0.0),0.0),u_sky_blend);}","in vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}")};function bn(y,e){const s=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,d=e.match(/in ([\w]+) ([\w]+)/g),g=y.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),_=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),S=_?_.concat(g):g,L={};return{fragmentSource:y=y.replace(s,((P,O,k,$,N)=>(L[N]=!0,O==="define"?`
834
+ #ifndef HAS_UNIFORM_u_${N}
835
+ in ${k} ${$} ${N};
836
+ #else
837
+ uniform ${k} ${$} u_${N};
838
+ #endif
839
+ `:`
840
+ #ifdef HAS_UNIFORM_u_${N}
841
+ ${k} ${$} ${N} = u_${N};
842
+ #endif
843
+ `))),vertexSource:e=e.replace(s,((P,O,k,$,N)=>{const q=$==="float"?"vec2":"vec4",K=N.match(/color/)?"color":q;return L[N]?O==="define"?`
844
+ #ifndef HAS_UNIFORM_u_${N}
845
+ uniform lowp float u_${N}_t;
846
+ in ${k} ${q} a_${N};
847
+ out ${k} ${$} ${N};
848
+ #else
849
+ uniform ${k} ${$} u_${N};
850
+ #endif
851
+ `:K==="vec4"?`
852
+ #ifndef HAS_UNIFORM_u_${N}
853
+ ${N} = a_${N};
854
+ #else
855
+ ${k} ${$} ${N} = u_${N};
856
+ #endif
857
+ `:`
858
+ #ifndef HAS_UNIFORM_u_${N}
859
+ ${N} = unpack_mix_${K}(a_${N}, u_${N}_t);
860
+ #else
861
+ ${k} ${$} ${N} = u_${N};
862
+ #endif
863
+ `:O==="define"?`
864
+ #ifndef HAS_UNIFORM_u_${N}
865
+ uniform lowp float u_${N}_t;
866
+ in ${k} ${q} a_${N};
867
+ #else
868
+ uniform ${k} ${$} u_${N};
869
+ #endif
870
+ `:K==="vec4"?`
871
+ #ifndef HAS_UNIFORM_u_${N}
872
+ ${k} ${$} ${N} = a_${N};
873
+ #else
874
+ ${k} ${$} ${N} = u_${N};
875
+ #endif
876
+ `:`
877
+ #ifndef HAS_UNIFORM_u_${N}
878
+ ${k} ${$} ${N} = unpack_mix_${K}(a_${N}, u_${N}_t);
879
+ #else
880
+ ${k} ${$} ${N} = u_${N};
881
+ #endif
882
+ `})),staticAttributes:d,staticUniforms:S}}class No{constructor(e,s,d){this.vertexBuffer=e,this.indexBuffer=s,this.segments=d}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}var Nr=c.aJ([{name:"a_pos",type:"Int16",components:2}]);const Cl="#define PROJECTION_MERCATOR",dn="mercator";class da{constructor(){this._cachedMesh=null}get name(){return"mercator"}get useSubdivision(){return!1}get shaderVariantName(){return dn}get shaderDefine(){return Cl}get shaderPreludeCode(){return Lr.projectionMercator}get vertexShaderPreludeCode(){return Lr.projectionMercator.vertexSource}get subdivisionGranularity(){return c.aK.noSubdivision}get useGlobeControls(){return!1}get transitionState(){return 0}get latitudeErrorCorrectionRadians(){return 0}destroy(){}updateGPUdependent(e){}getMeshFromTileID(e,s,d,g,_){if(this._cachedMesh)return this._cachedMesh;const S=new c.aL;S.emplaceBack(0,0),S.emplaceBack(c.$,0),S.emplaceBack(0,c.$),S.emplaceBack(c.$,c.$);const L=e.createVertexBuffer(S,Nr.members),P=c.aM.simpleSegment(0,0,4,2),O=new c.aN;O.emplaceBack(1,0,2),O.emplaceBack(1,2,3);const k=e.createIndexBuffer(O);return this._cachedMesh=new No(L,k,P),this._cachedMesh}recalculate(){}hasTransition(){return!1}setErrorQueryLatitudeDegrees(e){}}class Tl{constructor(e=0,s=0,d=0,g=0){if(isNaN(e)||e<0||isNaN(s)||s<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=e,this.bottom=s,this.left=d,this.right=g}interpolate(e,s,d){return s.top!=null&&e.top!=null&&(this.top=c.C.number(e.top,s.top,d)),s.bottom!=null&&e.bottom!=null&&(this.bottom=c.C.number(e.bottom,s.bottom,d)),s.left!=null&&e.left!=null&&(this.left=c.C.number(e.left,s.left,d)),s.right!=null&&e.right!=null&&(this.right=c.C.number(e.right,s.right,d)),this}getCenter(e,s){const d=c.ah((this.left+e-this.right)/2,0,e),g=c.ah((this.top+s-this.bottom)/2,0,s);return new c.P(d,g)}equals(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right}clone(){return new Tl(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function Uo(y,e){if(!y.renderWorldCopies||y.lngRange)return;const s=e.lng-y.center.lng;e.lng+=s>180?-360:s<-180?360:0}function er(y){return Math.max(0,Math.floor(y))}class Ri{constructor(e,s,d,g,_,S){this._callbacks=e,this._tileSize=512,this._renderWorldCopies=S===void 0||!!S,this._minZoom=s||0,this._maxZoom=d||22,this._minPitch=g??0,this._maxPitch=_??60,this.setMaxBounds(),this._width=0,this._height=0,this._center=new c.S(0,0),this._elevation=0,this._zoom=0,this._tileZoom=er(this._zoom),this._scale=c.af(this._zoom),this._bearingInRadians=0,this._fovInRadians=.6435011087932844,this._pitchInRadians=0,this._rollInRadians=0,this._unmodified=!0,this._edgeInsets=new Tl,this._minElevationForCurrentTile=0,this._autoCalculateNearFarZ=!0}apply(e,s,d){this._latRange=e.latRange,this._lngRange=e.lngRange,this._width=e.width,this._height=e.height,this._center=e.center,this._elevation=e.elevation,this._minElevationForCurrentTile=e.minElevationForCurrentTile,this._zoom=e.zoom,this._tileZoom=er(this._zoom),this._scale=c.af(this._zoom),this._bearingInRadians=e.bearingInRadians,this._fovInRadians=e.fovInRadians,this._pitchInRadians=e.pitchInRadians,this._rollInRadians=e.rollInRadians,this._unmodified=e.unmodified,this._edgeInsets=new Tl(e.padding.top,e.padding.bottom,e.padding.left,e.padding.right),this._minZoom=e.minZoom,this._maxZoom=e.maxZoom,this._minPitch=e.minPitch,this._maxPitch=e.maxPitch,this._renderWorldCopies=e.renderWorldCopies,this._cameraToCenterDistance=e.cameraToCenterDistance,this._nearZ=e.nearZ,this._farZ=e.farZ,this._autoCalculateNearFarZ=!d&&e.autoCalculateNearFarZ,s&&this._constrain(),this._calcMatrices()}get pixelsToClipSpaceMatrix(){return this._pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._clipSpaceToPixelsMatrix}get minElevationForCurrentTile(){return this._minElevationForCurrentTile}setMinElevationForCurrentTile(e){this._minElevationForCurrentTile=e}get tileSize(){return this._tileSize}get tileZoom(){return this._tileZoom}get scale(){return this._scale}get width(){return this._width}get height(){return this._height}get bearingInRadians(){return this._bearingInRadians}get lngRange(){return this._lngRange}get latRange(){return this._latRange}get pixelsToGLUnits(){return this._pixelsToGLUnits}get minZoom(){return this._minZoom}setMinZoom(e){this._minZoom!==e&&(this._minZoom=e,this.setZoom(this.getConstrained(this._center,this.zoom).zoom))}get maxZoom(){return this._maxZoom}setMaxZoom(e){this._maxZoom!==e&&(this._maxZoom=e,this.setZoom(this.getConstrained(this._center,this.zoom).zoom))}get minPitch(){return this._minPitch}setMinPitch(e){this._minPitch!==e&&(this._minPitch=e,this.setPitch(Math.max(this.pitch,e)))}get maxPitch(){return this._maxPitch}setMaxPitch(e){this._maxPitch!==e&&(this._maxPitch=e,this.setPitch(Math.min(this.pitch,e)))}get renderWorldCopies(){return this._renderWorldCopies}setRenderWorldCopies(e){e===void 0?e=!0:e===null&&(e=!1),this._renderWorldCopies=e}get worldSize(){return this._tileSize*this._scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new c.P(this._width,this._height)}get bearing(){return this._bearingInRadians/Math.PI*180}setBearing(e){const s=c.aO(e,-180,180)*Math.PI/180;var d,g,_,S,L,P,O,k,$;this._bearingInRadians!==s&&(this._unmodified=!1,this._bearingInRadians=s,this._calcMatrices(),this._rotationMatrix=B(),d=this._rotationMatrix,_=-this._bearingInRadians,S=(g=this._rotationMatrix)[0],L=g[1],P=g[2],O=g[3],k=Math.sin(_),$=Math.cos(_),d[0]=S*$+P*k,d[1]=L*$+O*k,d[2]=S*-k+P*$,d[3]=L*-k+O*$)}get rotationMatrix(){return this._rotationMatrix}get pitchInRadians(){return this._pitchInRadians}get pitch(){return this._pitchInRadians/Math.PI*180}setPitch(e){const s=c.ah(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitchInRadians!==s&&(this._unmodified=!1,this._pitchInRadians=s,this._calcMatrices())}get rollInRadians(){return this._rollInRadians}get roll(){return this._rollInRadians/Math.PI*180}setRoll(e){const s=e/180*Math.PI;this._rollInRadians!==s&&(this._unmodified=!1,this._rollInRadians=s,this._calcMatrices())}get fovInRadians(){return this._fovInRadians}get fov(){return c.aP(this._fovInRadians)}setFov(e){e=c.ah(e,.1,150),this.fov!==e&&(this._unmodified=!1,this._fovInRadians=c.ae(e),this._calcMatrices())}get zoom(){return this._zoom}setZoom(e){const s=this.getConstrained(this._center,e).zoom;this._zoom!==s&&(this._unmodified=!1,this._zoom=s,this._tileZoom=Math.max(0,Math.floor(s)),this._scale=c.af(s),this._constrain(),this._calcMatrices())}get center(){return this._center}setCenter(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}setElevation(e){e!==this._elevation&&(this._elevation=e,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}setPadding(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this._width,this._height)}get pixelsPerMeter(){return this._pixelPerMeter}get unmodified(){return this._unmodified}get cameraToCenterDistance(){return this._cameraToCenterDistance}get nearZ(){return this._nearZ}get farZ(){return this._farZ}get autoCalculateNearFarZ(){return this._autoCalculateNearFarZ}overrideNearFarZ(e,s){this._autoCalculateNearFarZ=!1,this._nearZ=e,this._farZ=s,this._calcMatrices()}clearNearFarZOverride(){this._autoCalculateNearFarZ=!0,this._calcMatrices()}isPaddingEqual(e){return this._edgeInsets.equals(e)}interpolatePadding(e,s,d){this._unmodified=!1,this._edgeInsets.interpolate(e,s,d),this._constrain(),this._calcMatrices()}resize(e,s,d=!0){this._width=e,this._height=s,d&&this._constrain(),this._calcMatrices()}getMaxBounds(){return this._latRange&&this._latRange.length===2&&this._lngRange&&this._lngRange.length===2?new Mi([this._lngRange[0],this._latRange[0]],[this._lngRange[1],this._latRange[1]]):null}setMaxBounds(e){e?(this._lngRange=[e.getWest(),e.getEast()],this._latRange=[e.getSouth(),e.getNorth()],this._constrain()):(this._lngRange=null,this._latRange=[-c.ai,c.ai])}getConstrained(e,s){return this._callbacks.getConstrained(e,s)}getCameraQueryGeometry(e,s){if(s.length===1)return[s[0],e];{const{minX:d,minY:g,maxX:_,maxY:S}=c.a2.fromPoints(s).extend(e);return[new c.P(d,g),new c.P(_,g),new c.P(_,S),new c.P(d,S),new c.P(d,g)]}}_constrain(){if(!this.center||!this._width||!this._height||this._constraining)return;this._constraining=!0;const e=this._unmodified,{center:s,zoom:d}=this.getConstrained(this.center,this.zoom);this.setCenter(s),this.setZoom(d),this._unmodified=e,this._constraining=!1}_calcMatrices(){if(this._width&&this._height){this._pixelsToGLUnits=[2/this._width,-2/this._height];let e=c.ag(new Float64Array(16));c.N(e,e,[this._width/2,-this._height/2,1]),c.M(e,e,[1,-1,0]),this._clipSpaceToPixelsMatrix=e,e=c.ag(new Float64Array(16)),c.N(e,e,[1,-1,1]),c.M(e,e,[-1,-1,0]),c.N(e,e,[2/this._width,2/this._height,1]),this._pixelsToClipSpaceMatrix=e,this._cameraToCenterDistance=.5/Math.tan(this.fovInRadians/2)*this._height}this._callbacks.calcMatrices()}calculateCenterFromCameraLngLatAlt(e,s,d,g){const _=d!==void 0?d:this.bearing,S=g=g!==void 0?g:this.pitch,L=c.a1.fromLngLat(e,s),P=-Math.cos(c.ae(S)),O=Math.sin(c.ae(S)),k=O*Math.sin(c.ae(_)),$=-O*Math.cos(c.ae(_));let N=this.elevation;const q=s-N;let K;P*q>=0||Math.abs(P)<.1?(K=1e4,N=s+K*P):K=-q/P;let re,ae,se=c.aQ(1,L.y),ce=0;do{if(ce+=1,ce>10)break;ae=K/se,re=new c.a1(L.x+k*ae,L.y+$*ae),se=1/re.meterInMercatorCoordinateUnits()}while(Math.abs(K-ae*se)>1e-12);return{center:re.toLngLat(),elevation:N,zoom:c.ak(this.height/2/Math.tan(this.fovInRadians/2)/ae/this.tileSize)}}recalculateZoomAndCenter(e){if(this.elevation-e==0)return;const s=c.aj(1,this.center.lat)*this.worldSize,d=this.cameraToCenterDistance/s,g=c.a1.fromLngLat(this.center,this.elevation),_=Xe(this.center,this.elevation,this.pitch,this.bearing,d);this._elevation=e;const S=this.calculateCenterFromCameraLngLatAlt(_.toLngLat(),c.aQ(_.z,g.y),this.bearing,this.pitch);this._elevation=S.elevation,this._center=S.center,this.setZoom(S.zoom)}getCameraPoint(){const e=Math.tan(this.pitchInRadians)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new c.P(e*Math.sin(this.rollInRadians),e*Math.cos(this.rollInRadians)))}getCameraAltitude(){return Math.cos(this.pitchInRadians)*this._cameraToCenterDistance/this._pixelPerMeter+this.elevation}getCameraLngLat(){const e=c.aj(1,this.center.lat)*this.worldSize;return Xe(this.center,this.elevation,this.pitch,this.bearing,this.cameraToCenterDistance/e).toLngLat()}getMercatorTileCoordinates(e){if(!e)return[0,0,1,1];const s=e.canonical.z>=0?1<<e.canonical.z:Math.pow(2,e.canonical.z);return[e.canonical.x/s,e.canonical.y/s,1/s/c.$,1/s/c.$]}}class tr{constructor(e,s){this.min=e,this.max=s,this.center=c.aR([],c.aS([],this.min,this.max),.5)}quadrant(e){const s=[e%2==0,e<2],d=c.aT(this.min),g=c.aT(this.max);for(let _=0;_<s.length;_++)d[_]=s[_]?this.min[_]:this.center[_],g[_]=s[_]?this.center[_]:this.max[_];return g[2]=this.max[2],new tr(d,g)}distanceX(e){return Math.max(Math.min(this.max[0],e[0]),this.min[0])-e[0]}distanceY(e){return Math.max(Math.min(this.max[1],e[1]),this.min[1])-e[1]}intersectsFrustum(e){let s=!0;for(let d=0;d<e.planes.length;d++){const g=this.intersectsPlane(e.planes[d]);if(g===0)return 0;g===1&&(s=!1)}return s?2:e.aabb.min[0]>this.max[0]||e.aabb.min[1]>this.max[1]||e.aabb.min[2]>this.max[2]||e.aabb.max[0]<this.min[0]||e.aabb.max[1]<this.min[1]||e.aabb.max[2]<this.min[2]?0:1}intersectsPlane(e){let s=e[3],d=e[3];for(let g=0;g<3;g++)e[g]>0?(s+=e[g]*this.min[g],d+=e[g]*this.max[g]):(d+=e[g]*this.min[g],s+=e[g]*this.max[g]);return s>=0?2:d<0?0:1}}class nr{distanceToTile2d(e,s,d,g){const _=g.distanceX([e,s]),S=g.distanceY([e,s]);return Math.hypot(_,S)}getWrap(e,s,d){return d}getTileBoundingVolume(e,s,d,g){var _,S;let L=0,P=0;if(g!=null&&g.terrain){const k=new c.Z(e.z,s,e.z,e.x,e.y),$=g.terrain.getMinMaxElevation(k);L=(_=$.minElevation)!==null&&_!==void 0?_:Math.min(0,d),P=(S=$.maxElevation)!==null&&S!==void 0?S:Math.max(0,d)}const O=1<<e.z;return new tr([s+e.x/O,e.y/O,L],[s+(e.x+1)/O,(e.y+1)/O,P])}allowVariableZoom(e,s){const d=e.fov*(Math.abs(Math.cos(e.rollInRadians))*e.height+Math.abs(Math.sin(e.rollInRadians))*e.width)/e.height,g=c.ah(78.5-d/2,0,60);return!!s.terrain||e.pitch>g}allowWorldCopies(){return!0}prepareNextFrame(){}}class oi{constructor(e,s,d){this.points=e,this.planes=s,this.aabb=d}static fromInvProjectionMatrix(e,s=1,d=0,g,_){const S=_?[[6,5,4],[0,1,2],[0,3,7],[2,1,5],[3,2,6],[0,4,5]]:[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],L=Math.pow(2,d),P=[[-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((N=>(function(q,K,re,ae){const se=c.aw([],q,K),ce=1/se[3]/re*ae;return c.aY(se,se,[ce,ce,1/se[3],ce])})(N,e,s,L)));g&&(function(N,q,K,re){const ae=re?4:0,se=re?0:4;let ce=0;const de=[],ue=[];for(let fe=0;fe<4;fe++){const Ee=c.aU([],N[fe+se],N[fe+ae]),Ve=c.aZ(Ee);c.aR(Ee,Ee,1/Ve),de.push(Ve),ue.push(Ee)}for(let fe=0;fe<4;fe++){const Ee=c.a_(N[fe+ae],ue[fe],K);ce=Ee!==null&&Ee>=0?Math.max(ce,Ee):Math.max(ce,de[fe])}const _e=(function(fe,Ee){const Ve=c.aU([],fe[Ee[0]],fe[Ee[1]]),ke=c.aU([],fe[Ee[2]],fe[Ee[1]]),Ne=[0,0,0,0];return c.aV(Ne,c.aW([],Ve,ke)),Ne[3]=-c.aX(Ne,fe[Ee[0]]),Ne})(N,q),be=(function(fe,Ee){const Ve=c.a$(fe),ke=c.b0([],fe,1/Ve),Ne=c.aU([],Ee,c.aR([],ke,c.aX(Ee,ke))),Ue=c.a$(Ne);if(Ue>0){const ht=Math.sqrt(1-ke[3]*ke[3]),dt=c.aR([],ke,-ke[3]),tt=c.aS([],dt,c.aR([],Ne,ht/Ue));return c.b1(Ee,tt)}return null})(K,_e);if(be!==null){const fe=be/c.aX(ue[0],_e);ce=Math.min(ce,fe)}for(let fe=0;fe<4;fe++){const Ee=Math.min(ce,de[fe]);N[fe+se]=[N[fe+ae][0]+ue[fe][0]*Ee,N[fe+ae][1]+ue[fe][1]*Ee,N[fe+ae][2]+ue[fe][2]*Ee,1]}})(P,S[0],g,_);const O=S.map((N=>{const q=c.aU([],P[N[0]],P[N[1]]),K=c.aU([],P[N[2]],P[N[1]]),re=c.aV([],c.aW([],q,K)),ae=-c.aX(re,P[N[1]]);return re.concat(ae)})),k=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY],$=[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY];for(const N of P)for(let q=0;q<3;q++)k[q]=Math.min(k[q],N[q]),$[q]=Math.max($[q],N[q]);return new oi(P,O,new tr(k,$))}}class Ls{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(e){this._helper.setMinZoom(e)}setMaxZoom(e){this._helper.setMaxZoom(e)}setMinPitch(e){this._helper.setMinPitch(e)}setMaxPitch(e){this._helper.setMaxPitch(e)}setRenderWorldCopies(e){this._helper.setRenderWorldCopies(e)}setBearing(e){this._helper.setBearing(e)}setPitch(e){this._helper.setPitch(e)}setRoll(e){this._helper.setRoll(e)}setFov(e){this._helper.setFov(e)}setZoom(e){this._helper.setZoom(e)}setCenter(e){this._helper.setCenter(e)}setElevation(e){this._helper.setElevation(e)}setMinElevationForCurrentTile(e){this._helper.setMinElevationForCurrentTile(e)}setPadding(e){this._helper.setPadding(e)}interpolatePadding(e,s,d){return this._helper.interpolatePadding(e,s,d)}isPaddingEqual(e){return this._helper.isPaddingEqual(e)}resize(e,s,d=!0){this._helper.resize(e,s,d)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(e){this._helper.setMaxBounds(e)}overrideNearFarZ(e,s){this._helper.overrideNearFarZ(e,s)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(e){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),e)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}setTransitionState(e,s){}constructor(e,s,d,g,_){this._posMatrixCache=new Map,this._alignedPosMatrixCache=new Map,this._fogMatrixCacheF32=new Map,this._helper=new Ri({calcMatrices:()=>{this._calcMatrices()},getConstrained:(S,L)=>this.getConstrained(S,L)},e,s,d,g,_),this._coveringTilesDetailsProvider=new nr}clone(){const e=new Ls;return e.apply(this),e}apply(e,s,d){this._helper.apply(e,s,d)}get cameraPosition(){return this._cameraPosition}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._viewProjMatrix}get inverseProjectionMatrix(){return this._invProjMatrix}get mercatorMatrix(){return this._mercatorMatrix}getVisibleUnwrappedCoordinates(e){const s=[new c.b2(0,e)];if(this._helper._renderWorldCopies){const d=this.screenPointToMercatorCoordinate(new c.P(0,0)),g=this.screenPointToMercatorCoordinate(new c.P(this._helper._width,0)),_=this.screenPointToMercatorCoordinate(new c.P(this._helper._width,this._helper._height)),S=this.screenPointToMercatorCoordinate(new c.P(0,this._helper._height)),L=Math.floor(Math.min(d.x,g.x,_.x,S.x)),P=Math.floor(Math.max(d.x,g.x,_.x,S.x)),O=1;for(let k=L-O;k<=P+O;k++)k!==0&&s.push(new c.b2(k,e))}return s}getCameraFrustum(){return oi.fromInvProjectionMatrix(this._invViewProjMatrix,this.worldSize)}getClippingPlane(){return null}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(e){const s=this.screenPointToLocation(this.centerPoint,e),d=e?e.getElevationForLngLatZoom(s,this._helper._tileZoom):0;this._helper.recalculateZoomAndCenter(d)}setLocationAtPoint(e,s){const d=c.aj(this.elevation,this.center.lat),g=this.screenPointToMercatorCoordinateAtZ(s,d),_=this.screenPointToMercatorCoordinateAtZ(this.centerPoint,d),S=c.a1.fromLngLat(e),L=new c.a1(S.x-(g.x-_.x),S.y-(g.y-_.y));this.setCenter(L==null?void 0:L.toLngLat()),this._helper._renderWorldCopies&&this.setCenter(this.center.wrap())}locationToScreenPoint(e,s){return s?this.coordinatePoint(c.a1.fromLngLat(e),s.getElevationForLngLatZoom(e,this._helper._tileZoom),this._pixelMatrix3D):this.coordinatePoint(c.a1.fromLngLat(e))}screenPointToLocation(e,s){var d;return(d=this.screenPointToMercatorCoordinate(e,s))===null||d===void 0?void 0:d.toLngLat()}screenPointToMercatorCoordinate(e,s){if(s){const d=s.pointCoordinate(e);if(d!=null)return d}return this.screenPointToMercatorCoordinateAtZ(e)}screenPointToMercatorCoordinateAtZ(e,s){const d=s||0,g=[e.x,e.y,0,1],_=[e.x,e.y,1,1];c.aw(g,g,this._pixelMatrixInverse),c.aw(_,_,this._pixelMatrixInverse);const S=g[3],L=_[3],P=g[1]/S,O=_[1]/L,k=g[2]/S,$=_[2]/L,N=k===$?0:(d-k)/($-k);return new c.a1(c.C.number(g[0]/S,_[0]/L,N)/this.worldSize,c.C.number(P,O,N)/this.worldSize,d)}coordinatePoint(e,s=0,d=this._pixelMatrix){const g=[e.x*this.worldSize,e.y*this.worldSize,s,1];return c.aw(g,g,d),new c.P(g[0]/g[3],g[1]/g[3])}getBounds(){const e=Math.max(0,this._helper._height/2-De(this));return new Mi().extend(this.screenPointToLocation(new c.P(0,e))).extend(this.screenPointToLocation(new c.P(this._helper._width,e))).extend(this.screenPointToLocation(new c.P(this._helper._width,this._helper._height))).extend(this.screenPointToLocation(new c.P(0,this._helper._height)))}isPointOnMapSurface(e,s){return s?s.pointCoordinate(e)!=null:e.y>this.height/2-De(this)}calculatePosMatrix(e,s=!1,d){var g;const _=(g=e.key)!==null&&g!==void 0?g:c.b3(e.wrap,e.canonical.z,e.canonical.z,e.canonical.x,e.canonical.y),S=s?this._alignedPosMatrixCache:this._posMatrixCache;if(S.has(_)){const O=S.get(_);return d?O.f32:O.f64}const L=Le(e,this.worldSize);c.O(L,s?this._alignedProjMatrix:this._viewProjMatrix,L);const P={f64:L,f32:new Float32Array(L)};return S.set(_,P),d?P.f32:P.f64}calculateFogMatrix(e){const s=e.key,d=this._fogMatrixCacheF32;if(d.has(s))return d.get(s);const g=Le(e,this.worldSize);return c.O(g,this._fogMatrix,g),d.set(s,new Float32Array(g)),d.get(s)}getConstrained(e,s){s=c.ah(+s,this.minZoom,this.maxZoom);const d={center:new c.S(e.lng,e.lat),zoom:s};let g=this._helper._lngRange;if(!this._helper._renderWorldCopies&&g===null){const de=179.9999999999;g=[-de,de]}const _=this.tileSize*c.af(d.zoom);let S=0,L=_,P=0,O=_,k=0,$=0;const{x:N,y:q}=this.size;if(this._helper._latRange){const de=this._helper._latRange;S=c.U(de[1])*_,L=c.U(de[0])*_,L-S<q&&(k=q/(L-S))}g&&(P=c.aO(c.V(g[0])*_,0,_),O=c.aO(c.V(g[1])*_,0,_),O<P&&(O+=_),O-P<N&&($=N/(O-P)));const{x:K,y:re}=me(_,e);let ae,se;const ce=Math.max($||0,k||0);if(ce){const de=new c.P($?(O+P)/2:K,k?(L+S)/2:re);return d.center=Te(_,de).wrap(),d.zoom+=c.ak(ce),d}if(this._helper._latRange){const de=q/2;re-de<S&&(se=S+de),re+de>L&&(se=L-de)}if(g){const de=(P+O)/2;let ue=K;this._helper._renderWorldCopies&&(ue=c.aO(K,de-_/2,de+_/2));const _e=N/2;ue-_e<P&&(ae=P+_e),ue+_e>O&&(ae=O-_e)}if(ae!==void 0||se!==void 0){const de=new c.P(ae??K,se??re);d.center=Te(_,de).wrap()}return d}calculateCenterFromCameraLngLatAlt(e,s,d,g){return this._helper.calculateCenterFromCameraLngLatAlt(e,s,d,g)}_calculateNearFarZIfNeeded(e,s,d){if(!this._helper.autoCalculateNearFarZ)return;const g=Math.min(this.elevation,this.minElevationForCurrentTile,this.getCameraAltitude()-100),_=e-g*this._helper._pixelPerMeter/Math.cos(s),S=g<0?_:e,L=Math.PI/2+this.pitchInRadians,P=c.ae(this.fov)*(Math.abs(Math.cos(c.ae(this.roll)))*this.height+Math.abs(Math.sin(c.ae(this.roll)))*this.width)/this.height*(.5+d.y/this.height),O=Math.sin(P)*S/Math.sin(c.ah(Math.PI-L-P,.01,Math.PI-.01)),k=De(this),$=Math.atan(k/this._helper.cameraToCenterDistance),N=c.ae(.75),q=$>N?2*$*(.5+d.y/(2*k)):N,K=Math.sin(q)*S/Math.sin(c.ah(Math.PI-L-q,.01,Math.PI-.01)),re=Math.min(O,K);this._helper._farZ=1.01*(Math.cos(Math.PI/2-s)*re+S),this._helper._nearZ=this._helper._height/50}_calcMatrices(){if(!this._helper._height)return;const e=this.centerOffset,s=me(this.worldSize,this.center),d=s.x,g=s.y;this._helper._pixelPerMeter=c.aj(1,this.center.lat)*this.worldSize;const _=c.ae(Math.min(this.pitch,he)),S=Math.max(this._helper.cameraToCenterDistance/2,this._helper.cameraToCenterDistance+this._helper._elevation*this._helper._pixelPerMeter/Math.cos(_));let L;this._calculateNearFarZIfNeeded(S,_,e),L=new Float64Array(16),c.b4(L,this.fovInRadians,this._helper._width/this._helper._height,this._helper._nearZ,this._helper._farZ),this._invProjMatrix=new Float64Array(16),c.aq(this._invProjMatrix,L),L[8]=2*-e.x/this._helper._width,L[9]=2*e.y/this._helper._height,this._projectionMatrix=c.b5(L),c.N(L,L,[1,-1,1]),c.M(L,L,[0,0,-this._helper.cameraToCenterDistance]),c.b6(L,L,-this.rollInRadians),c.b7(L,L,this.pitchInRadians),c.b6(L,L,-this.bearingInRadians),c.M(L,L,[-d,-g,0]),this._mercatorMatrix=c.N([],L,[this.worldSize,this.worldSize,this.worldSize]),c.N(L,L,[1,1,this._helper._pixelPerMeter]),this._pixelMatrix=c.O(new Float64Array(16),this.clipSpaceToPixelsMatrix,L),c.M(L,L,[0,0,-this.elevation]),this._viewProjMatrix=L,this._invViewProjMatrix=c.aq([],L);const P=[0,0,-1,1];c.aw(P,P,this._invViewProjMatrix),this._cameraPosition=[P[0]/P[3],P[1]/P[3],P[2]/P[3]],this._fogMatrix=new Float64Array(16),c.b4(this._fogMatrix,this.fovInRadians,this.width/this.height,S,this._helper._farZ),this._fogMatrix[8]=2*-e.x/this.width,this._fogMatrix[9]=2*e.y/this.height,c.N(this._fogMatrix,this._fogMatrix,[1,-1,1]),c.M(this._fogMatrix,this._fogMatrix,[0,0,-this.cameraToCenterDistance]),c.b6(this._fogMatrix,this._fogMatrix,-this.rollInRadians),c.b7(this._fogMatrix,this._fogMatrix,this.pitchInRadians),c.b6(this._fogMatrix,this._fogMatrix,-this.bearingInRadians),c.M(this._fogMatrix,this._fogMatrix,[-d,-g,0]),c.N(this._fogMatrix,this._fogMatrix,[1,1,this._helper._pixelPerMeter]),c.M(this._fogMatrix,this._fogMatrix,[0,0,-this.elevation]),this._pixelMatrix3D=c.O(new Float64Array(16),this.clipSpaceToPixelsMatrix,L);const O=this._helper._width%2/2,k=this._helper._height%2/2,$=Math.cos(this.bearingInRadians),N=Math.sin(-this.bearingInRadians),q=d-Math.round(d)+$*O+N*k,K=g-Math.round(g)+$*k+N*O,re=new Float64Array(L);if(c.M(re,re,[q>.5?q-1:q,K>.5?K-1:K,0]),this._alignedProjMatrix=re,L=c.aq(new Float64Array(16),this._pixelMatrix),!L)throw new Error("failed to invert matrix");this._pixelMatrixInverse=L,this._clearMatrixCaches()}_clearMatrixCaches(){this._posMatrixCache.clear(),this._alignedPosMatrixCache.clear(),this._fogMatrixCacheF32.clear()}maxPitchScaleFactor(){if(!this._pixelMatrixInverse)return 1;const e=this.screenPointToMercatorCoordinate(new c.P(0,0)),s=[e.x*this.worldSize,e.y*this.worldSize,0,1];return c.aw(s,s,this._pixelMatrix)[3]/this._helper.cameraToCenterDistance}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){const e=c.aj(1,this.center.lat)*this.worldSize;return Xe(this.center,this.elevation,this.pitch,this.bearing,this._helper.cameraToCenterDistance/e).toLngLat()}lngLatToCameraDepth(e,s){const d=c.a1.fromLngLat(e),g=[d.x*this.worldSize,d.y*this.worldSize,s,1];return c.aw(g,g,this._viewProjMatrix),g[2]/g[3]}getProjectionData(e){const{overscaledTileID:s,aligned:d,applyTerrainMatrix:g}=e,_=this._helper.getMercatorTileCoordinates(s),S=s?this.calculatePosMatrix(s,d,!0):null;let L;return L=s&&s.terrainRttPosMatrix32f&&g?s.terrainRttPosMatrix32f:S||c.b8(),{mainMatrix:L,tileMercatorCoords:_,clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:L}}isLocationOccluded(e){return!1}getPixelScale(){return 1}getCircleRadiusCorrection(){return 1}getPitchedTextCorrection(e,s,d){return 1}transformLightDirection(e){return c.aT(e)}getRayDirectionFromPixel(e){throw new Error("Not implemented.")}projectTileCoordinates(e,s,d,g){const _=this.calculatePosMatrix(d);let S;g?(S=[e,s,g(e,s),1],c.aw(S,S,_)):(S=[e,s,0,1],bi(S,S,_));const L=S[3];return{point:new c.P(S[0]/L,S[1]/L),signedDistanceFromCamera:L,isOccluded:!1}}populateCache(e){for(const s of e)this.calculatePosMatrix(s)}getMatrixForModel(e,s){const d=c.a1.fromLngLat(e,s),g=d.meterInMercatorCoordinateUnits(),_=c.b9();return c.M(_,_,[d.x,d.y,d.z]),c.b6(_,_,Math.PI),c.b7(_,_,Math.PI/2),c.N(_,_,[-g,g,g]),_}getProjectionDataForCustomLayer(e=!0){const s=new c.Z(0,0,0,0,0),d=this.getProjectionData({overscaledTileID:s,applyGlobeMatrix:e}),g=Le(s,this.worldSize);c.O(g,this._viewProjMatrix,g),d.tileMercatorCoords=[0,0,1,1];const _=[c.$,c.$,this.worldSize/this._helper.pixelsPerMeter],S=c.ba();return c.N(S,g,_),d.fallbackMatrix=S,d.mainMatrix=S,d}getFastPathSimpleProjectionMatrix(e){return this.calculatePosMatrix(e)}}function Li(){c.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.")}function Ur(y){if(y.useSlerp)if(y.k<1){const e=c.bb(y.startEulerAngles.roll,y.startEulerAngles.pitch,y.startEulerAngles.bearing),s=c.bb(y.endEulerAngles.roll,y.endEulerAngles.pitch,y.endEulerAngles.bearing),d=new Float64Array(4);c.bc(d,e,s,y.k);const g=c.bd(d);y.tr.setRoll(g.roll),y.tr.setPitch(g.pitch),y.tr.setBearing(g.bearing)}else y.tr.setRoll(y.endEulerAngles.roll),y.tr.setPitch(y.endEulerAngles.pitch),y.tr.setBearing(y.endEulerAngles.bearing);else y.tr.setRoll(c.C.number(y.startEulerAngles.roll,y.endEulerAngles.roll,y.k)),y.tr.setPitch(c.C.number(y.startEulerAngles.pitch,y.endEulerAngles.pitch,y.k)),y.tr.setBearing(c.C.number(y.startEulerAngles.bearing,y.endEulerAngles.bearing,y.k))}function dr(y,e,s,d,g){const _=g.padding,S=me(g.worldSize,s.getNorthWest()),L=me(g.worldSize,s.getNorthEast()),P=me(g.worldSize,s.getSouthEast()),O=me(g.worldSize,s.getSouthWest()),k=c.ae(-d),$=S.rotate(k),N=L.rotate(k),q=P.rotate(k),K=O.rotate(k),re=new c.P(Math.max($.x,N.x,K.x,q.x),Math.max($.y,N.y,K.y,q.y)),ae=new c.P(Math.min($.x,N.x,K.x,q.x),Math.min($.y,N.y,K.y,q.y)),se=re.sub(ae),ce=(g.width-(_.left+_.right+e.left+e.right))/se.x,de=(g.height-(_.top+_.bottom+e.top+e.bottom))/se.y;if(de<0||ce<0)return void Li();const ue=Math.min(c.ak(g.scale*Math.min(ce,de)),y.maxZoom),_e=c.P.convert(y.offset),be=new c.P((e.left-e.right)/2,(e.top-e.bottom)/2).rotate(c.ae(d)),fe=_e.add(be).mult(g.scale/c.af(ue));return{center:Te(g.worldSize,S.add(P).div(2).sub(fe)),zoom:ue,bearing:d}}class Na{get useGlobeControls(){return!1}handlePanInertia(e,s){const d=e.mag(),g=Math.abs(De(s));return{easingOffset:e.mult(Math.min(.75*g/d,1)),easingCenter:s.center}}handleMapControlsRollPitchBearingZoom(e,s){e.bearingDelta&&s.setBearing(s.bearing+e.bearingDelta),e.pitchDelta&&s.setPitch(s.pitch+e.pitchDelta),e.rollDelta&&s.setRoll(s.roll+e.rollDelta),e.zoomDelta&&s.setZoom(s.zoom+e.zoomDelta)}handleMapControlsPan(e,s,d){e.around.distSqr(s.centerPoint)<.01||s.setLocationAtPoint(d,e.around)}cameraForBoxAndBearing(e,s,d,g,_){return dr(e,s,d,g,_)}handleJumpToCenterZoom(e,s){e.zoom!==(s.zoom!==void 0?+s.zoom:e.zoom)&&e.setZoom(+s.zoom),s.center!==void 0&&e.setCenter(c.S.convert(s.center))}handleEaseTo(e,s){const d=e.zoom,g=e.padding,_={roll:e.roll,pitch:e.pitch,bearing:e.bearing},S={roll:s.roll===void 0?e.roll:s.roll,pitch:s.pitch===void 0?e.pitch:s.pitch,bearing:s.bearing===void 0?e.bearing:s.bearing},L=s.zoom!==void 0,P=!e.isPaddingEqual(s.padding);let O=!1;const k=L?+s.zoom:e.zoom;let $=e.centerPoint.add(s.offsetAsPoint);const N=e.screenPointToLocation($),{center:q,zoom:K}=e.getConstrained(c.S.convert(s.center||N),k??d);Uo(e,q);const re=me(e.worldSize,N),ae=me(e.worldSize,q).sub(re),se=c.af(K-d);return O=K!==d,{easeFunc:ce=>{if(O&&e.setZoom(c.C.number(d,K,ce)),c.be(_,S)||Ur({startEulerAngles:_,endEulerAngles:S,tr:e,k:ce,useSlerp:_.roll!=S.roll}),P&&(e.interpolatePadding(g,s.padding,ce),$=e.centerPoint.add(s.offsetAsPoint)),s.around)e.setLocationAtPoint(s.around,s.aroundPoint);else{const de=c.af(e.zoom-d),ue=K>d?Math.min(2,se):Math.max(.5,se),_e=Math.pow(ue,1-ce),be=Te(e.worldSize,re.add(ae.mult(ce*_e)).mult(de));e.setLocationAtPoint(e.renderWorldCopies?be.wrap():be,$)}},isZooming:O,elevationCenter:q}}handleFlyTo(e,s){const d=s.zoom!==void 0,g=e.zoom,_=e.getConstrained(c.S.convert(s.center||s.locationAtOffset),d?+s.zoom:g),S=_.center,L=_.zoom;Uo(e,S);const P=me(e.worldSize,s.locationAtOffset),O=me(e.worldSize,S).sub(P),k=O.mag(),$=c.af(L-g);let N;if(s.minZoom!==void 0){const q=Math.min(+s.minZoom,g,L),K=e.getConstrained(S,q).zoom;N=c.af(K-g)}return{easeFunc:(q,K,re,ae)=>{e.setZoom(q===1?L:g+c.ak(K));const se=q===1?S:Te(e.worldSize,P.add(O.mult(re)).mult(K));e.setLocationAtPoint(e.renderWorldCopies?se.wrap():se,ae)},scaleOfZoom:$,targetCenter:S,scaleOfMinZoom:N,pixelPathLength:k}}}class Zn{constructor(e,s,d){this.blendFunction=e,this.blendColor=s,this.mask=d}}Zn.Replace=[1,0],Zn.disabled=new Zn(Zn.Replace,c.bf.transparent,[!1,!1,!1,!1]),Zn.unblended=new Zn(Zn.Replace,c.bf.transparent,[!0,!0,!0,!0]),Zn.alphaBlended=new Zn([1,771],c.bf.transparent,[!0,!0,!0,!0]);const pi=2305;class gn{constructor(e,s,d){this.enable=e,this.mode=s,this.frontFace=d}}gn.disabled=new gn(!1,1029,pi),gn.backCCW=new gn(!0,1029,pi),gn.frontCCW=new gn(!0,1028,pi);class Yt{constructor(e,s,d){this.func=e,this.mask=s,this.range=d}}Yt.ReadOnly=!1,Yt.ReadWrite=!0,Yt.disabled=new Yt(519,Yt.ReadOnly,[0,1]);const Ws=7680;class un{constructor(e,s,d,g,_,S){this.test=e,this.ref=s,this.mask=d,this.fail=g,this.depthFail=_,this.pass=S}}un.disabled=new un({func:519,mask:0},0,0,Ws,Ws,Ws);const wr=new WeakMap;function Ii(y){var e;if(wr.has(y))return wr.get(y);{const s=(e=y.getParameter(y.VERSION))===null||e===void 0?void 0:e.startsWith("WebGL 2.0");return wr.set(y,s),s}}class Sc{get awaitingQuery(){return!!this._readbackQueue}constructor(e){this._readbackWaitFrames=4,this._measureWaitFrames=6,this._texWidth=1,this._texHeight=1,this._measuredError=0,this._updateCount=0,this._lastReadbackFrame=-1e3,this._readbackQueue=null,this._cachedRenderContext=e;const s=e.context,d=s.gl;this._texFormat=d.RGBA,this._texType=d.UNSIGNED_BYTE;const g=new c.aL;g.emplaceBack(-1,-1),g.emplaceBack(2,-1),g.emplaceBack(-1,2);const _=new c.aN;_.emplaceBack(0,1,2),this._fullscreenTriangle=new No(s.createVertexBuffer(g,Nr.members),s.createIndexBuffer(_),c.aM.simpleSegment(0,0,g.length,_.length)),this._resultBuffer=new Uint8Array(4),s.activeTexture.set(d.TEXTURE1);const S=d.createTexture();d.bindTexture(d.TEXTURE_2D,S),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,d.NEAREST),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,d.NEAREST),d.texImage2D(d.TEXTURE_2D,0,this._texFormat,this._texWidth,this._texHeight,0,this._texFormat,this._texType,null),this._fbo=s.createFramebuffer(this._texWidth,this._texHeight,!1,!1),this._fbo.colorAttachment.set(S),Ii(d)&&(this._pbo=d.createBuffer(),d.bindBuffer(d.PIXEL_PACK_BUFFER,this._pbo),d.bufferData(d.PIXEL_PACK_BUFFER,4,d.STREAM_READ),d.bindBuffer(d.PIXEL_PACK_BUFFER,null))}destroy(){const e=this._cachedRenderContext.context.gl;this._fullscreenTriangle.destroy(),this._fbo.destroy(),e.deleteBuffer(this._pbo),this._fullscreenTriangle=null,this._fbo=null,this._pbo=null,this._resultBuffer=null}updateErrorLoop(e,s){const d=this._updateCount;return this._readbackQueue?d>=this._readbackQueue.frameNumberIssued+this._readbackWaitFrames&&this._tryReadback():d>=this._lastReadbackFrame+this._measureWaitFrames&&this._renderErrorTexture(e,s),this._updateCount++,this._measuredError}_bindFramebuffer(){const e=this._cachedRenderContext.context,s=e.gl;e.activeTexture.set(s.TEXTURE1),s.bindTexture(s.TEXTURE_2D,this._fbo.colorAttachment.get()),e.bindFramebuffer.set(this._fbo.framebuffer)}_renderErrorTexture(e,s){const d=this._cachedRenderContext.context,g=d.gl;if(this._bindFramebuffer(),d.viewport.set([0,0,this._texWidth,this._texHeight]),d.clear({color:c.bf.transparent}),this._cachedRenderContext.useProgram("projectionErrorMeasurement").draw(d,g.TRIANGLES,Yt.disabled,un.disabled,Zn.unblended,gn.disabled,((_,S)=>({u_input:_,u_output_expected:S}))(e,s),null,null,"$clipping",this._fullscreenTriangle.vertexBuffer,this._fullscreenTriangle.indexBuffer,this._fullscreenTriangle.segments),this._pbo&&Ii(g)){g.bindBuffer(g.PIXEL_PACK_BUFFER,this._pbo),g.readBuffer(g.COLOR_ATTACHMENT0),g.readPixels(0,0,this._texWidth,this._texHeight,this._texFormat,this._texType,0),g.bindBuffer(g.PIXEL_PACK_BUFFER,null);const _=g.fenceSync(g.SYNC_GPU_COMMANDS_COMPLETE,0);g.flush(),this._readbackQueue={frameNumberIssued:this._updateCount,sync:_}}else this._readbackQueue={frameNumberIssued:this._updateCount,sync:null}}_tryReadback(){const e=this._cachedRenderContext.context.gl;if(this._pbo&&this._readbackQueue&&Ii(e)){const s=e.clientWaitSync(this._readbackQueue.sync,0,0);if(s===e.WAIT_FAILED)return c.w("WebGL2 clientWaitSync failed."),this._readbackQueue=null,void(this._lastReadbackFrame=this._updateCount);if(s===e.TIMEOUT_EXPIRED)return;e.bindBuffer(e.PIXEL_PACK_BUFFER,this._pbo),e.getBufferSubData(e.PIXEL_PACK_BUFFER,0,this._resultBuffer,0,4),e.bindBuffer(e.PIXEL_PACK_BUFFER,null)}else this._bindFramebuffer(),e.readPixels(0,0,this._texWidth,this._texHeight,this._texFormat,this._texType,this._resultBuffer);this._readbackQueue=null,this._measuredError=Sc._parseRGBA8float(this._resultBuffer),this._lastReadbackFrame=this._updateCount}static _parseRGBA8float(e){let s=0;return s+=e[0]/256,s+=e[1]/65536,s+=e[2]/16777216,e[3]<127&&(s=-s),s/128}}const Ks=c.$/128;function mu(y,e){const s=y.granularity!==void 0?Math.max(y.granularity,1):1,d=s+(y.generateBorders?2:0),g=s+(y.extendToNorthPole||y.generateBorders?1:0)+(y.extendToSouthPole||y.generateBorders?1:0),_=d+1,S=g+1,L=y.generateBorders?-1:0,P=y.generateBorders||y.extendToNorthPole?-1:0,O=s+(y.generateBorders?1:0),k=s+(y.generateBorders||y.extendToSouthPole?1:0),$=_*S,N=d*g*6,q=_*S>65536;if(q&&e==="16bit")throw new Error("Granularity is too large and meshes would not fit inside 16 bit vertex indices.");const K=q||e==="32bit",re=new Int16Array(2*$);let ae=0;for(let de=P;de<=k;de++)for(let ue=L;ue<=O;ue++){let _e=ue/s*c.$;ue===-1&&(_e=-Ks),ue===s+1&&(_e=c.$+Ks);let be=de/s*c.$;de===-1&&(be=y.extendToNorthPole?c.bh:-Ks),de===s+1&&(be=y.extendToSouthPole?c.bi:c.$+Ks),re[ae++]=_e,re[ae++]=be}const se=K?new Uint32Array(N):new Uint16Array(N);let ce=0;for(let de=0;de<g;de++)for(let ue=0;ue<d;ue++){const _e=ue+1+de*_,be=ue+(de+1)*_,fe=ue+1+(de+1)*_;se[ce++]=ue+de*_,se[ce++]=be,se[ce++]=_e,se[ce++]=_e,se[ce++]=be,se[ce++]=fe}return{vertices:re.buffer.slice(0),indices:se.buffer.slice(0),uses32bitIndices:K}}const $o=new c.aK({fill:new c.bj(128,2),line:new c.bj(512,0),tile:new c.bj(128,32),stencil:new c.bj(128,1),circle:3});class El{constructor(){this._tileMeshCache={},this._errorCorrectionUsable=0,this._errorMeasurementLastValue=0,this._errorCorrectionPreviousValue=0,this._errorMeasurementLastChangeTime=-1e3}get name(){return"vertical-perspective"}get transitionState(){return 1}get useSubdivision(){return!0}get shaderVariantName(){return"globe"}get shaderDefine(){return"#define GLOBE"}get shaderPreludeCode(){return Lr.projectionGlobe}get vertexShaderPreludeCode(){return Lr.projectionMercator.vertexSource}get subdivisionGranularity(){return $o}get useGlobeControls(){return!0}get latitudeErrorCorrectionRadians(){return this._errorCorrectionUsable}destroy(){this._errorMeasurement&&this._errorMeasurement.destroy()}updateGPUdependent(e){this._errorMeasurement||(this._errorMeasurement=new Sc(e));const s=c.U(this._errorQueryLatitudeDegrees),d=2*Math.atan(Math.exp(Math.PI-s*Math.PI*2))-.5*Math.PI,g=this._errorMeasurement.updateErrorLoop(s,d),_=Y.now();g!==this._errorMeasurementLastValue&&(this._errorCorrectionPreviousValue=this._errorCorrectionUsable,this._errorMeasurementLastValue=g,this._errorMeasurementLastChangeTime=_);const S=Math.min(Math.max((_-this._errorMeasurementLastChangeTime)/1e3/.5,0),1);this._errorCorrectionUsable=c.bk(this._errorCorrectionPreviousValue,-this._errorMeasurementLastValue,c.bl(S))}_getMeshKey(e){return`${e.granularity.toString(36)}_${e.generateBorders?"b":""}${e.extendToNorthPole?"n":""}${e.extendToSouthPole?"s":""}`}getMeshFromTileID(e,s,d,g,_){const S=(_==="stencil"?$o.stencil:$o.tile).getGranularityForZoomLevel(s.z);return this._getMesh(e,{granularity:S,generateBorders:d,extendToNorthPole:s.y===0&&g,extendToSouthPole:s.y===(1<<s.z)-1&&g})}_getMesh(e,s){const d=this._getMeshKey(s);if(d in this._tileMeshCache)return this._tileMeshCache[d];const g=(function(_,S){const L=mu(S,"16bit"),P=c.aL.deserialize({arrayBuffer:L.vertices,length:L.vertices.byteLength/2/2}),O=c.aN.deserialize({arrayBuffer:L.indices,length:L.indices.byteLength/2/3});return new No(_.createVertexBuffer(P,Nr.members),_.createIndexBuffer(O),c.aM.simpleSegment(0,0,P.length,O.length))})(e,s);return this._tileMeshCache[d]=g,g}recalculate(e){}hasTransition(){const e=Y.now();let s=!1;return s=s||(e-this._errorMeasurementLastChangeTime)/1e3<.7,s=s||this._errorMeasurement&&this._errorMeasurement.awaitingQuery,s}setErrorQueryLatitudeDegrees(e){this._errorQueryLatitudeDegrees=e}}const Ml=new c.r({type:new c.D(c.v.projection.type)});class Al extends c.E{constructor(e){super(),this._transitionable=new c.t(Ml,void 0),this.setProjection(e),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new c.F(0)),this._mercatorProjection=new da,this._verticalPerspectiveProjection=new El}get transitionState(){const e=this.properties.get("type");if(typeof e=="string"&&e==="mercator")return 0;if(typeof e=="string"&&e==="vertical-perspective")return 1;if(e instanceof c.bm){if(e.from==="vertical-perspective"&&e.to==="mercator")return 1-e.transition;if(e.from==="mercator"&&e.to==="vertical-perspective")return e.transition}return 1}get useGlobeRendering(){return this.transitionState>0}get latitudeErrorCorrectionRadians(){return this._verticalPerspectiveProjection.latitudeErrorCorrectionRadians}get currentProjection(){return this.useGlobeRendering?this._verticalPerspectiveProjection:this._mercatorProjection}get name(){return"globe"}get useSubdivision(){return this.currentProjection.useSubdivision}get shaderVariantName(){return this.currentProjection.shaderVariantName}get shaderDefine(){return this.currentProjection.shaderDefine}get shaderPreludeCode(){return this.currentProjection.shaderPreludeCode}get vertexShaderPreludeCode(){return this.currentProjection.vertexShaderPreludeCode}get subdivisionGranularity(){return this.currentProjection.subdivisionGranularity}get useGlobeControls(){return this.transitionState>0}destroy(){this._mercatorProjection.destroy(),this._verticalPerspectiveProjection.destroy()}updateGPUdependent(e){this._mercatorProjection.updateGPUdependent(e),this._verticalPerspectiveProjection.updateGPUdependent(e)}getMeshFromTileID(e,s,d,g,_){return this.currentProjection.getMeshFromTileID(e,s,d,g,_)}setProjection(e){this._transitionable.setValue("type",(e==null?void 0:e.type)||"mercator")}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()||this.currentProjection.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}setErrorQueryLatitudeDegrees(e){this._verticalPerspectiveProjection.setErrorQueryLatitudeDegrees(e),this._mercatorProjection.setErrorQueryLatitudeDegrees(e)}}function Cc(y){const e=Ll(y.worldSize,y.center.lat);return 2*Math.PI*e}function Ps(y,e,s,d,g){const _=1/(1<<g),S=e/c.$*_+d*_,L=c.bo((y/c.$*_+s*_)*Math.PI*2+Math.PI,2*Math.PI),P=2*Math.atan(Math.exp(Math.PI-S*Math.PI*2))-.5*Math.PI,O=Math.cos(P),k=new Float64Array(3);return k[0]=Math.sin(L)*O,k[1]=Math.sin(P),k[2]=Math.cos(L)*O,k}function fr(y){return(function(e,s){const d=Math.cos(s),g=new Float64Array(3);return g[0]=Math.sin(e)*d,g[1]=Math.sin(s),g[2]=Math.cos(e)*d,g})(y.lng*Math.PI/180,y.lat*Math.PI/180)}function Ll(y,e){return y/(2*Math.PI)/Math.cos(e*Math.PI/180)}function Pl(y){const e=Math.asin(y[1])/Math.PI*180,s=Math.sqrt(y[0]*y[0]+y[2]*y[2]);if(s>1e-6){const d=y[0]/s,g=Math.acos(y[2]/s),_=(d>0?g:-g)/Math.PI*180;return new c.S(c.aO(_,-180,180),e)}return new c.S(0,e)}function Vo(y){return Math.cos(y*Math.PI/180)}function pr(y,e){const s=Vo(y),d=Vo(e);return c.ak(d/s)}function Ah(y,e){const s=y.rotate(e.bearingInRadians),d=e.zoom+pr(e.center.lat,0),g=c.bk(1/Vo(e.center.lat),1/Vo(Math.min(Math.abs(e.center.lat),60)),c.bn(d,7,3,0,1)),_=360/Cc({worldSize:e.worldSize,center:{lat:e.center.lat}});return new c.S(e.center.lng-s.x*_*g,c.ah(e.center.lat+s.y*_,-c.ai,c.ai))}function Lh(y){const e=.5*y,s=Math.sin(e),d=Math.cos(e);return Math.log(s+d)-Math.log(d-s)}function Pp(y,e,s,d){const g=y.lat+s*d;if(Math.abs(s)>1){const _=(Math.sign(y.lat+s)!==Math.sign(y.lat)?-Math.abs(y.lat):Math.abs(y.lat))*Math.PI/180,S=Math.abs(y.lat+s)*Math.PI/180,L=Lh(_+d*(S-_)),P=Lh(_),O=Lh(S);return new c.S(y.lng+e*((L-P)/(O-P)),g)}return new c.S(y.lng+e*d,g)}class Rp{constructor(e){this._cachePrevious=new Map,this._cache=new Map,this._hadAnyChanges=!1,this._boundingVolumeFactory=e}swapBuffers(){if(!this._hadAnyChanges)return;const e=this._cachePrevious;this._cachePrevious=this._cache,this._cache=e,this._cache.clear(),this._hadAnyChanges=!1}getTileBoundingVolume(e,s,d,g){const _=`${e.z}_${e.x}_${e.y}_${g!=null&&g.terrain?"t":""}`,S=this._cache.get(_);if(S)return S;const L=this._cachePrevious.get(_);if(L)return this._cache.set(_,L),L;const P=this._boundingVolumeFactory(e,s,d,g);return this._cache.set(_,P),this._hadAnyChanges=!0,P}}class ir{constructor(e,s,d,g){this.min=d,this.max=g,this.points=e,this.planes=s}static fromAabb(e,s){const d=[];for(let g=0;g<8;g++)d.push([1&~g?e[0]:s[0],(g>>1&1)==1?s[1]:e[1],(g>>2&1)==1?s[2]:e[2]]);return new ir(d,[[-1,0,0,s[0]],[1,0,0,-e[0]],[0,-1,0,s[1]],[0,1,0,-e[1]],[0,0,-1,s[2]],[0,0,1,-e[2]]],e,s)}static fromCenterSizeAngles(e,s,d){const g=c.br([],d[0],d[1],d[2]),_=c.bs([],[s[0],0,0],g),S=c.bs([],[0,s[1],0],g),L=c.bs([],[0,0,s[2]],g),P=[...e],O=[...e];for(let $=0;$<8;$++)for(let N=0;N<3;N++){const q=e[N]+_[N]*(1&~$?-1:1)+S[N]*(($>>1&1)==1?1:-1)+L[N]*(($>>2&1)==1?1:-1);P[N]=Math.min(P[N],q),O[N]=Math.max(O[N],q)}const k=[];for(let $=0;$<8;$++){const N=[...e];c.aS(N,N,c.aR([],_,1&~$?-1:1)),c.aS(N,N,c.aR([],S,($>>1&1)==1?1:-1)),c.aS(N,N,c.aR([],L,($>>2&1)==1?1:-1)),k.push(N)}return new ir(k,[[..._,-c.aX(_,k[0])],[...S,-c.aX(S,k[0])],[...L,-c.aX(L,k[0])],[-_[0],-_[1],-_[2],-c.aX(_,k[7])],[-S[0],-S[1],-S[2],-c.aX(S,k[7])],[-L[0],-L[1],-L[2],-c.aX(L,k[7])]],P,O)}intersectsFrustum(e){let s=!0;const d=this.points.length,g=this.planes.length,_=e.planes.length,S=e.points.length;for(let L=0;L<_;L++){const P=e.planes[L];let O=0;for(let k=0;k<d;k++){const $=this.points[k];P[0]*$[0]+P[1]*$[1]+P[2]*$[2]+P[3]>=0&&O++}if(O===0)return 0;O<d&&(s=!1)}if(s)return 2;for(let L=0;L<g;L++){const P=this.planes[L];let O=0;for(let k=0;k<S;k++){const $=e.points[k];P[0]*$[0]+P[1]*$[1]+P[2]*$[2]+P[3]>=0&&O++}if(O===0)return 0}return 1}intersectsPlane(e){const s=this.points.length;let d=0;for(let g=0;g<s;g++){const _=this.points[g];e[0]*_[0]+e[1]*_[1]+e[2]*_[2]+e[3]>=0&&d++}return d===s?2:d===0?0:1}}function Tc(y,e,s){const d=y-e;return d<0?-d:Math.max(0,d-s)}function Ua(y,e,s,d,g){const _=y-s;let S;return S=_<0?Math.min(-_,1+_-g):_>1?Math.min(Math.max(_-g,0),1-_):0,Math.max(S,Tc(e,d,g))}class Ph{constructor(){this._boundingVolumeCache=new Rp(this._computeTileBoundingVolume)}prepareNextFrame(){this._boundingVolumeCache.swapBuffers()}distanceToTile2d(e,s,d,g){const _=1<<d.z,S=1/_,L=d.x/_,P=d.y/_;let O=2;return O=Math.min(O,Ua(e,s,L,P,S)),O=Math.min(O,Ua(e,s,L+.5,-P-S,S)),O=Math.min(O,Ua(e,s,L+.5,2-P-S,S)),O}getWrap(e,s,d){const g=1<<s.z,_=1/g,S=s.x/g,L=Tc(e.x,S,_),P=Tc(e.x,S-1,_),O=Tc(e.x,S+1,_),k=Math.min(L,P,O);return k===O?1:k===P?-1:0}allowVariableZoom(e,s){return Ie(e,s)>4}allowWorldCopies(){return!1}getTileBoundingVolume(e,s,d,g){return this._boundingVolumeCache.getTileBoundingVolume(e,s,d,g)}_computeTileBoundingVolume(e,s,d,g){var _,S;let L=0,P=0;if(g!=null&&g.terrain){const O=new c.Z(e.z,s,e.z,e.x,e.y),k=g.terrain.getMinMaxElevation(O);L=(_=k.minElevation)!==null&&_!==void 0?_:Math.min(0,d),P=(S=k.maxElevation)!==null&&S!==void 0?S:Math.max(0,d)}if(L/=c.bu,P/=c.bu,L+=1,P+=1,e.z<=0)return ir.fromAabb([-P,-P,-P],[P,P,P]);if(e.z===1)return ir.fromAabb([e.x===0?-P:0,e.y===0?0:-P,-P],[e.x===0?0:P,e.y===0?P:0,P]);{const O=[Ps(0,0,e.x,e.y,e.z),Ps(c.$,0,e.x,e.y,e.z),Ps(c.$,c.$,e.x,e.y,e.z),Ps(0,c.$,e.x,e.y,e.z)],k=[];for(const Ne of O)k.push(c.aR([],Ne,P));if(P!==L)for(const Ne of O)k.push(c.aR([],Ne,L));e.y===0&&k.push([0,1,0]),e.y===(1<<e.z)-1&&k.push([0,-1,0]);const $=[1,1,1],N=[-1,-1,-1];for(const Ne of k)for(let Ue=0;Ue<3;Ue++)$[Ue]=Math.min($[Ue],Ne[Ue]),N[Ue]=Math.max(N[Ue],Ne[Ue]);const q=Ps(c.$/2,c.$/2,e.x,e.y,e.z),K=c.aW([],[0,1,0],q);c.aV(K,K);const re=c.aW([],q,K);c.aV(re,re);const ae=c.aW([],O[2],O[1]);c.aV(ae,ae);const se=c.aW([],O[0],O[3]);c.aV(se,se),k.push(c.aR([],q,P)),e.y>=(1<<e.z)/2&&k.push(c.aR([],Ps(c.$/2,0,e.x,e.y,e.z),P)),e.y<(1<<e.z)/2&&k.push(c.aR([],Ps(c.$/2,c.$,e.x,e.y,e.z),P));const ce=gu(q,k),de=gu(re,k),ue=[-q[0],-q[1],-q[2],ce.max],_e=[q[0],q[1],q[2],-ce.min],be=[-re[0],-re[1],-re[2],de.max],fe=[re[0],re[1],re[2],-de.min],Ee=[...ae,0],Ve=[...se,0],ke=[];return e.y===0?ke.push(c.bt(Ve,Ee,ue),c.bt(Ve,Ee,_e)):ke.push(c.bt(be,Ee,ue),c.bt(be,Ee,_e),c.bt(be,Ve,ue),c.bt(be,Ve,_e)),e.y===(1<<e.z)-1?ke.push(c.bt(Ve,Ee,ue),c.bt(Ve,Ee,_e)):ke.push(c.bt(fe,Ee,ue),c.bt(fe,Ee,_e),c.bt(fe,Ve,ue),c.bt(fe,Ve,_e)),new ir(ke,[ue,_e,be,fe,Ee,Ve],$,N)}}}function gu(y,e){let s=1/0,d=-1/0;for(const g of e){const _=c.aX(y,g);s=Math.min(s,_),d=Math.max(d,_)}return{min:s,max:d}}class yu{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(e){this._helper.setMinZoom(e)}setMaxZoom(e){this._helper.setMaxZoom(e)}setMinPitch(e){this._helper.setMinPitch(e)}setMaxPitch(e){this._helper.setMaxPitch(e)}setRenderWorldCopies(e){this._helper.setRenderWorldCopies(e)}setBearing(e){this._helper.setBearing(e)}setPitch(e){this._helper.setPitch(e)}setRoll(e){this._helper.setRoll(e)}setFov(e){this._helper.setFov(e)}setZoom(e){this._helper.setZoom(e)}setCenter(e){this._helper.setCenter(e)}setElevation(e){this._helper.setElevation(e)}setMinElevationForCurrentTile(e){this._helper.setMinElevationForCurrentTile(e)}setPadding(e){this._helper.setPadding(e)}interpolatePadding(e,s,d){return this._helper.interpolatePadding(e,s,d)}isPaddingEqual(e){return this._helper.isPaddingEqual(e)}resize(e,s){this._helper.resize(e,s)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(e){this._helper.setMaxBounds(e)}overrideNearFarZ(e,s){this._helper.overrideNearFarZ(e,s)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(e){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),e)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}setTransitionState(e){}constructor(){this._cachedClippingPlane=c.bv(),this._projectionMatrix=c.b9(),this._globeViewProjMatrix32f=c.b8(),this._globeViewProjMatrixNoCorrection=c.b9(),this._globeViewProjMatrixNoCorrectionInverted=c.b9(),this._globeProjMatrixInverted=c.b9(),this._cameraPosition=c.bp(),this._globeLatitudeErrorCorrectionRadians=0,this._helper=new Ri({calcMatrices:()=>{this._calcMatrices()},getConstrained:(e,s)=>this.getConstrained(e,s)}),this._coveringTilesDetailsProvider=new Ph}clone(){const e=new yu;return e.apply(this),e}apply(e,s){this._globeLatitudeErrorCorrectionRadians=s||0,this._helper.apply(e)}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._globeViewProjMatrixNoCorrection}get inverseProjectionMatrix(){return this._globeProjMatrixInverted}get cameraPosition(){const e=c.bp();return e[0]=this._cameraPosition[0],e[1]=this._cameraPosition[1],e[2]=this._cameraPosition[2],e}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}getProjectionData(e){const{overscaledTileID:s,applyGlobeMatrix:d}=e,g=this._helper.getMercatorTileCoordinates(s);return{mainMatrix:this._globeViewProjMatrix32f,tileMercatorCoords:g,clippingPlane:this._cachedClippingPlane,projectionTransition:d?1:0,fallbackMatrix:this._globeViewProjMatrix32f}}_computeClippingPlane(e){const s=this.pitchInRadians,d=this.cameraToCenterDistance/e,g=Math.sin(s)*d,_=Math.cos(s)*d+1,S=1/Math.sqrt(g*g+_*_)*1;let L=-g,P=_;const O=Math.sqrt(L*L+P*P);L/=O,P/=O;const k=[0,L,P];c.bw(k,k,[0,0,0],-this.bearingInRadians),c.bx(k,k,[0,0,0],-1*this.center.lat*Math.PI/180),c.by(k,k,[0,0,0],this.center.lng*Math.PI/180);const $=1/c.aZ(k);return c.aR(k,k,$),[...k,-S*$]}isLocationOccluded(e){return!this.isSurfacePointVisible(fr(e))}transformLightDirection(e){const s=this._helper._center.lng*Math.PI/180,d=this._helper._center.lat*Math.PI/180,g=Math.cos(d),_=[Math.sin(s)*g,Math.sin(d),Math.cos(s)*g],S=[_[2],0,-_[0]],L=[0,0,0];c.aW(L,S,_),c.aV(S,S),c.aV(L,L);const P=[0,0,0];return c.aV(P,[S[0]*e[0]+L[0]*e[1]+_[0]*e[2],S[1]*e[0]+L[1]*e[1]+_[1]*e[2],S[2]*e[0]+L[2]*e[1]+_[2]*e[2]]),P}getPixelScale(){return 1/Math.cos(this._helper._center.lat*Math.PI/180)}getCircleRadiusCorrection(){return Math.cos(this._helper._center.lat*Math.PI/180)}getPitchedTextCorrection(e,s,d){const g=(function(L,P,O){const k=1/(1<<O.z);return new c.a1(L/c.$*k+O.x*k,P/c.$*k+O.y*k)})(e,s,d.canonical),_=(S=g.y,[c.bo(g.x*Math.PI*2+Math.PI,2*Math.PI),2*Math.atan(Math.exp(Math.PI-S*Math.PI*2))-.5*Math.PI]);var S;return this.getCircleRadiusCorrection()/Math.cos(_[1])}projectTileCoordinates(e,s,d,g){const _=d.canonical,S=Ps(e,s,_.x,_.y,_.z),L=1+(g?g(e,s):0)/c.bu,P=[S[0]*L,S[1]*L,S[2]*L,1];c.aw(P,P,this._globeViewProjMatrixNoCorrection);const O=this._cachedClippingPlane,k=O[0]*S[0]+O[1]*S[1]+O[2]*S[2]+O[3]<0;return{point:new c.P(P[0]/P[3],P[1]/P[3]),signedDistanceFromCamera:P[3],isOccluded:k}}_calcMatrices(){if(!this._helper._width||!this._helper._height)return;const e=Ll(this.worldSize,this.center.lat),s=c.ba(),d=c.ba();this._helper.autoCalculateNearFarZ&&(this._helper._nearZ=.5,this._helper._farZ=this.cameraToCenterDistance+2*e),c.b4(s,this.fovInRadians,this.width/this.height,this._helper._nearZ,this._helper._farZ);const g=this.centerOffset;s[8]=2*-g.x/this._helper._width,s[9]=2*g.y/this._helper._height,this._projectionMatrix=c.b5(s),this._globeProjMatrixInverted=c.ba(),c.aq(this._globeProjMatrixInverted,s),c.M(s,s,[0,0,-this.cameraToCenterDistance]),c.b6(s,s,this.rollInRadians),c.b7(s,s,-this.pitchInRadians),c.b6(s,s,this.bearingInRadians),c.M(s,s,[0,0,-e]);const _=c.bp();_[0]=e,_[1]=e,_[2]=e,c.b7(d,s,this.center.lat*Math.PI/180),c.bz(d,d,-this.center.lng*Math.PI/180),c.N(d,d,_),this._globeViewProjMatrixNoCorrection=d,c.b7(s,s,this.center.lat*Math.PI/180-this._globeLatitudeErrorCorrectionRadians),c.bz(s,s,-this.center.lng*Math.PI/180),c.N(s,s,_),this._globeViewProjMatrix32f=new Float32Array(s),this._globeViewProjMatrixNoCorrectionInverted=c.ba(),c.aq(this._globeViewProjMatrixNoCorrectionInverted,d);const S=c.bp();this._cameraPosition=c.bp(),this._cameraPosition[2]=this.cameraToCenterDistance/e,c.bw(this._cameraPosition,this._cameraPosition,S,-this.rollInRadians),c.bx(this._cameraPosition,this._cameraPosition,S,this.pitchInRadians),c.bw(this._cameraPosition,this._cameraPosition,S,-this.bearingInRadians),c.aS(this._cameraPosition,this._cameraPosition,[0,0,1]),c.bx(this._cameraPosition,this._cameraPosition,S,-this.center.lat*Math.PI/180),c.by(this._cameraPosition,this._cameraPosition,S,this.center.lng*Math.PI/180),this._cachedClippingPlane=this._computeClippingPlane(e);const L=c.b5(this._globeViewProjMatrixNoCorrectionInverted);c.N(L,L,[1,1,-1]),this._cachedFrustum=oi.fromInvProjectionMatrix(L,1,0,this._cachedClippingPlane,!0)}calculateFogMatrix(e){c.w("calculateFogMatrix is not supported on globe projection.");const s=c.ba();return c.ag(s),s}getVisibleUnwrappedCoordinates(e){return[new c.b2(0,e)]}getCameraFrustum(){return this._cachedFrustum}getClippingPlane(){return this._cachedClippingPlane}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(e){e&&c.w("terrain is not fully supported on vertical perspective projection."),this._helper.recalculateZoomAndCenter(0)}maxPitchScaleFactor(){return 1}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){return this._helper.getCameraLngLat()}lngLatToCameraDepth(e,s){if(!this._globeViewProjMatrixNoCorrection)return 1;const d=fr(e);c.aR(d,d,1+s/c.bu);const g=c.bv();return c.aw(g,[d[0],d[1],d[2],1],this._globeViewProjMatrixNoCorrection),g[2]/g[3]}populateCache(e){}getBounds(){const e=.5*this.width,s=.5*this.height,d=[new c.P(0,0),new c.P(e,0),new c.P(this.width,0),new c.P(this.width,s),new c.P(this.width,this.height),new c.P(e,this.height),new c.P(0,this.height),new c.P(0,s)],g=[];for(const $ of d)g.push(this.unprojectScreenPoint($));let _=0,S=0,L=0,P=0;const O=this.center;for(const $ of g){const N=c.bA(O.lng,$.lng),q=c.bA(O.lat,$.lat);N<S&&(S=N),N>_&&(_=N),q<P&&(P=q),q>L&&(L=q)}const k=[O.lng+S,O.lat+P,O.lng+_,O.lat+L];return this.isSurfacePointOnScreen([0,1,0])&&(k[3]=90,k[0]=-180,k[2]=180),this.isSurfacePointOnScreen([0,-1,0])&&(k[1]=-90,k[0]=-180,k[2]=180),new Mi(k)}getConstrained(e,s){const d=c.ah(e.lat,-c.ai,c.ai),g=c.ah(+s,this.minZoom+pr(0,d),this.maxZoom);return{center:new c.S(e.lng,d),zoom:g}}calculateCenterFromCameraLngLatAlt(e,s,d,g){return this._helper.calculateCenterFromCameraLngLatAlt(e,s,d,g)}setLocationAtPoint(e,s){const d=fr(this.unprojectScreenPoint(s)),g=fr(e),_=c.bp();c.bB(_);const S=c.bp();c.by(S,d,_,-this.center.lng*Math.PI/180),c.bx(S,S,_,this.center.lat*Math.PI/180);const L=g[0]*g[0]+g[2]*g[2],P=S[0]*S[0];if(L<P)return;const O=Math.sqrt(L-P),k=-O,$=c.bC(g[0],g[2],S[0],O),N=c.bC(g[0],g[2],S[0],k),q=c.bp();c.by(q,g,_,-$);const K=c.bC(q[1],q[2],S[1],S[2]),re=c.bp();c.by(re,g,_,-N);const ae=c.bC(re[1],re[2],S[1],S[2]),se=.5*Math.PI,ce=K>=-se&&K<=se,de=ae>=-se&&ae<=se;let ue,_e;if(ce&&de){const Ve=this.center.lng*Math.PI/180,ke=this.center.lat*Math.PI/180;c.bD($,Ve)+c.bD(K,ke)<c.bD(N,Ve)+c.bD(ae,ke)?(ue=$,_e=K):(ue=N,_e=ae)}else if(ce)ue=$,_e=K;else{if(!de)return;ue=N,_e=ae}const be=ue/Math.PI*180,fe=_e/Math.PI*180,Ee=this.center.lat;this.setCenter(new c.S(be,c.ah(fe,-90,90))),this.setZoom(this.zoom+pr(Ee,this.center.lat))}locationToScreenPoint(e,s){const d=fr(e);if(s){const g=s.getElevationForLngLatZoom(e,this._helper._tileZoom);c.aR(d,d,1+g/c.bu)}return this._projectSurfacePointToScreen(d)}_projectSurfacePointToScreen(e){const s=c.bv();return c.aw(s,[...e,1],this._globeViewProjMatrixNoCorrection),s[0]/=s[3],s[1]/=s[3],new c.P((.5*s[0]+.5)*this.width,(.5*-s[1]+.5)*this.height)}screenPointToMercatorCoordinate(e,s){if(s){const d=s.pointCoordinate(e);if(d)return d}return c.a1.fromLngLat(this.unprojectScreenPoint(e))}screenPointToLocation(e,s){var d;return(d=this.screenPointToMercatorCoordinate(e,s))===null||d===void 0?void 0:d.toLngLat()}isPointOnMapSurface(e,s){const d=this._cameraPosition,g=this.getRayDirectionFromPixel(e);return!!this.rayPlanetIntersection(d,g)}getRayDirectionFromPixel(e){const s=c.bv();s[0]=e.x/this.width*2-1,s[1]=-1*(e.y/this.height*2-1),s[2]=1,s[3]=1,c.aw(s,s,this._globeViewProjMatrixNoCorrectionInverted),s[0]/=s[3],s[1]/=s[3],s[2]/=s[3];const d=c.bp();d[0]=s[0]-this._cameraPosition[0],d[1]=s[1]-this._cameraPosition[1],d[2]=s[2]-this._cameraPosition[2];const g=c.bp();return c.aV(g,d),g}isSurfacePointVisible(e){const s=this._cachedClippingPlane;return s[0]*e[0]+s[1]*e[1]+s[2]*e[2]+s[3]>=0}isSurfacePointOnScreen(e){if(!this.isSurfacePointVisible(e))return!1;const s=c.bv();return c.aw(s,[...e,1],this._globeViewProjMatrixNoCorrection),s[0]/=s[3],s[1]/=s[3],s[2]/=s[3],s[0]>-1&&s[0]<1&&s[1]>-1&&s[1]<1&&s[2]>-1&&s[2]<1}rayPlanetIntersection(e,s){const d=c.aX(e,s),g=c.bp(),_=c.bp();c.aR(_,s,d),c.aU(g,e,_);const S=1-c.aX(g,g);if(S<0)return null;const L=c.aX(e,e)-1,P=-d+(d<0?1:-1)*Math.sqrt(S),O=L/P,k=P;return{tMin:Math.min(O,k),tMax:Math.max(O,k)}}unprojectScreenPoint(e){const s=this._cameraPosition,d=this.getRayDirectionFromPixel(e),g=this.rayPlanetIntersection(s,d);if(g){const k=c.bp();c.aS(k,s,[d[0]*g.tMin,d[1]*g.tMin,d[2]*g.tMin]);const $=c.bp();return c.aV($,k),Pl($)}const _=this._cachedClippingPlane,S=_[0]*d[0]+_[1]*d[1]+_[2]*d[2],L=-c.b1(_,s)/S,P=c.bp();if(L>0)c.aS(P,s,[d[0]*L,d[1]*L,d[2]*L]);else{const k=c.bp();c.aS(k,s,[2*d[0],2*d[1],2*d[2]]);const $=c.b1(this._cachedClippingPlane,k);c.aU(P,k,[this._cachedClippingPlane[0]*$,this._cachedClippingPlane[1]*$,this._cachedClippingPlane[2]*$])}const O=(function(k){const $=c.bp();return $[0]=k[0]*-k[3],$[1]=k[1]*-k[3],$[2]=k[2]*-k[3],{center:$,radius:Math.sqrt(1-k[3]*k[3])}})(_);return Pl((function(k,$,N){const q=c.bp();c.aU(q,N,k);const K=c.bp();return c.bq(K,k,q,$/c.a$(q)),K})(O.center,O.radius,P))}getMatrixForModel(e,s){const d=c.S.convert(e),g=1/c.bu,_=c.b9();return c.bz(_,_,d.lng/180*Math.PI),c.b7(_,_,-d.lat/180*Math.PI),c.M(_,_,[0,0,1+s/c.bu]),c.b7(_,_,.5*Math.PI),c.N(_,_,[g,g,g]),_}getProjectionDataForCustomLayer(e=!0){const s=this.getProjectionData({overscaledTileID:new c.Z(0,0,0,0,0),applyGlobeMatrix:e});return s.tileMercatorCoords=[0,0,1,1],s}getFastPathSimpleProjectionMatrix(e){}}class Js{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(e){this._helper.setMinZoom(e)}setMaxZoom(e){this._helper.setMaxZoom(e)}setMinPitch(e){this._helper.setMinPitch(e)}setMaxPitch(e){this._helper.setMaxPitch(e)}setRenderWorldCopies(e){this._helper.setRenderWorldCopies(e)}setBearing(e){this._helper.setBearing(e)}setPitch(e){this._helper.setPitch(e)}setRoll(e){this._helper.setRoll(e)}setFov(e){this._helper.setFov(e)}setZoom(e){this._helper.setZoom(e)}setCenter(e){this._helper.setCenter(e)}setElevation(e){this._helper.setElevation(e)}setMinElevationForCurrentTile(e){this._helper.setMinElevationForCurrentTile(e)}setPadding(e){this._helper.setPadding(e)}interpolatePadding(e,s,d){return this._helper.interpolatePadding(e,s,d)}isPaddingEqual(e){return this._helper.isPaddingEqual(e)}resize(e,s,d=!0){this._helper.resize(e,s,d)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(e){this._helper.setMaxBounds(e)}overrideNearFarZ(e,s){this._helper.overrideNearFarZ(e,s)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(e){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),e)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}get isGlobeRendering(){return this._globeness>0}setTransitionState(e,s){this._globeness=e,this._globeLatitudeErrorCorrectionRadians=s,this._calcMatrices(),this._verticalPerspectiveTransform.getCoveringTilesDetailsProvider().prepareNextFrame(),this._mercatorTransform.getCoveringTilesDetailsProvider().prepareNextFrame()}get currentTransform(){return this.isGlobeRendering?this._verticalPerspectiveTransform:this._mercatorTransform}constructor(){this._globeLatitudeErrorCorrectionRadians=0,this._globeness=1,this._helper=new Ri({calcMatrices:()=>{this._calcMatrices()},getConstrained:(e,s)=>this.getConstrained(e,s)}),this._globeness=1,this._mercatorTransform=new Ls,this._verticalPerspectiveTransform=new yu}clone(){const e=new Js;return e._globeness=this._globeness,e._globeLatitudeErrorCorrectionRadians=this._globeLatitudeErrorCorrectionRadians,e.apply(this),e}apply(e){this._helper.apply(e),this._mercatorTransform.apply(this),this._verticalPerspectiveTransform.apply(this,this._globeLatitudeErrorCorrectionRadians)}get projectionMatrix(){return this.currentTransform.projectionMatrix}get modelViewProjectionMatrix(){return this.currentTransform.modelViewProjectionMatrix}get inverseProjectionMatrix(){return this.currentTransform.inverseProjectionMatrix}get cameraPosition(){return this.currentTransform.cameraPosition}getProjectionData(e){const s=this._mercatorTransform.getProjectionData(e),d=this._verticalPerspectiveTransform.getProjectionData(e);return{mainMatrix:this.isGlobeRendering?d.mainMatrix:s.mainMatrix,clippingPlane:d.clippingPlane,tileMercatorCoords:d.tileMercatorCoords,projectionTransition:e.applyGlobeMatrix?this._globeness:0,fallbackMatrix:s.fallbackMatrix}}isLocationOccluded(e){return this.currentTransform.isLocationOccluded(e)}transformLightDirection(e){return this.currentTransform.transformLightDirection(e)}getPixelScale(){return c.bk(this._mercatorTransform.getPixelScale(),this._verticalPerspectiveTransform.getPixelScale(),this._globeness)}getCircleRadiusCorrection(){return c.bk(this._mercatorTransform.getCircleRadiusCorrection(),this._verticalPerspectiveTransform.getCircleRadiusCorrection(),this._globeness)}getPitchedTextCorrection(e,s,d){const g=this._mercatorTransform.getPitchedTextCorrection(e,s,d),_=this._verticalPerspectiveTransform.getPitchedTextCorrection(e,s,d);return c.bk(g,_,this._globeness)}projectTileCoordinates(e,s,d,g){return this.currentTransform.projectTileCoordinates(e,s,d,g)}_calcMatrices(){this._helper._width&&this._helper._height&&(this._verticalPerspectiveTransform.apply(this,this._globeLatitudeErrorCorrectionRadians),this._helper._nearZ=this._verticalPerspectiveTransform.nearZ,this._helper._farZ=this._verticalPerspectiveTransform.farZ,this._mercatorTransform.apply(this,!0,this.isGlobeRendering),this._helper._nearZ=this._mercatorTransform.nearZ,this._helper._farZ=this._mercatorTransform.farZ)}calculateFogMatrix(e){return this.currentTransform.calculateFogMatrix(e)}getVisibleUnwrappedCoordinates(e){return this.currentTransform.getVisibleUnwrappedCoordinates(e)}getCameraFrustum(){return this.currentTransform.getCameraFrustum()}getClippingPlane(){return this.currentTransform.getClippingPlane()}getCoveringTilesDetailsProvider(){return this.currentTransform.getCoveringTilesDetailsProvider()}recalculateZoomAndCenter(e){this._mercatorTransform.recalculateZoomAndCenter(e),this._verticalPerspectiveTransform.recalculateZoomAndCenter(e)}maxPitchScaleFactor(){return this._mercatorTransform.maxPitchScaleFactor()}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){return this._helper.getCameraLngLat()}lngLatToCameraDepth(e,s){return this.currentTransform.lngLatToCameraDepth(e,s)}populateCache(e){this._mercatorTransform.populateCache(e),this._verticalPerspectiveTransform.populateCache(e)}getBounds(){return this.currentTransform.getBounds()}getConstrained(e,s){return this.currentTransform.getConstrained(e,s)}calculateCenterFromCameraLngLatAlt(e,s,d,g){return this._helper.calculateCenterFromCameraLngLatAlt(e,s,d,g)}setLocationAtPoint(e,s){if(!this.isGlobeRendering)return this._mercatorTransform.setLocationAtPoint(e,s),void this.apply(this._mercatorTransform);this._verticalPerspectiveTransform.setLocationAtPoint(e,s),this.apply(this._verticalPerspectiveTransform)}locationToScreenPoint(e,s){return this.currentTransform.locationToScreenPoint(e,s)}screenPointToMercatorCoordinate(e,s){return this.currentTransform.screenPointToMercatorCoordinate(e,s)}screenPointToLocation(e,s){return this.currentTransform.screenPointToLocation(e,s)}isPointOnMapSurface(e,s){return this.currentTransform.isPointOnMapSurface(e,s)}getRayDirectionFromPixel(e){return this._verticalPerspectiveTransform.getRayDirectionFromPixel(e)}getMatrixForModel(e,s){return this.currentTransform.getMatrixForModel(e,s)}getProjectionDataForCustomLayer(e=!0){const s=this._mercatorTransform.getProjectionDataForCustomLayer(e);if(!this.isGlobeRendering)return s;const d=this._verticalPerspectiveTransform.getProjectionDataForCustomLayer(e);return d.fallbackMatrix=s.mainMatrix,d}getFastPathSimpleProjectionMatrix(e){return this.currentTransform.getFastPathSimpleProjectionMatrix(e)}}class as{get useGlobeControls(){return!0}handlePanInertia(e,s){const d=Ah(e,s);return Math.abs(d.lng-s.center.lng)>180&&(d.lng=s.center.lng+179.5*Math.sign(d.lng-s.center.lng)),{easingCenter:d,easingOffset:new c.P(0,0)}}handleMapControlsRollPitchBearingZoom(e,s){const d=e.around,g=s.screenPointToLocation(d);e.bearingDelta&&s.setBearing(s.bearing+e.bearingDelta),e.pitchDelta&&s.setPitch(s.pitch+e.pitchDelta),e.rollDelta&&s.setRoll(s.roll+e.rollDelta);const _=s.zoom;e.zoomDelta&&s.setZoom(s.zoom+e.zoomDelta);const S=s.zoom-_;if(S===0)return;const L=c.bA(s.center.lng,g.lng),P=L/(Math.abs(L/180)+1),O=c.bA(s.center.lat,g.lat),k=s.getRayDirectionFromPixel(d),$=s.cameraPosition,N=-1*c.aX($,k),q=c.bp();c.aS(q,$,[k[0]*N,k[1]*N,k[2]*N]);const K=c.aZ(q)-1,re=Math.exp(.5*-Math.max(K-.3,0)),ae=Ll(s.worldSize,s.center.lat)/Math.min(s.width,s.height),se=c.bn(ae,.9,.5,1,.25),ce=(1-c.af(-S))*Math.min(re,se),de=s.center.lat,ue=s.zoom,_e=new c.S(s.center.lng+P*ce,c.ah(s.center.lat+O*ce,-c.ai,c.ai));s.setLocationAtPoint(g,d);const be=s.center,fe=c.bn(Math.abs(L),45,85,0,1),Ee=c.bn(ae,.75,.35,0,1),Ve=Math.pow(Math.max(fe,Ee),.25),ke=c.bA(be.lng,_e.lng),Ne=c.bA(be.lat,_e.lat);s.setCenter(new c.S(be.lng+ke*Ve,be.lat+Ne*Ve).wrap()),s.setZoom(ue+pr(de,s.center.lat))}handleMapControlsPan(e,s,d){if(!e.panDelta)return;const g=s.center.lat,_=s.zoom;s.setCenter(Ah(e.panDelta,s).wrap()),s.setZoom(_+pr(g,s.center.lat))}cameraForBoxAndBearing(e,s,d,g,_){const S=dr(e,s,d,g,_),L=s.left/_.width*2-1,P=(_.width-s.right)/_.width*2-1,O=s.top/_.height*-2+1,k=(_.height-s.bottom)/_.height*-2+1,$=c.bA(d.getWest(),d.getEast())<0,N=$?d.getEast():d.getWest(),q=$?d.getWest():d.getEast(),K=Math.max(d.getNorth(),d.getSouth()),re=Math.min(d.getNorth(),d.getSouth()),ae=N+.5*c.bA(N,q),se=K+.5*c.bA(K,re),ce=_.clone();ce.setCenter(S.center),ce.setBearing(S.bearing),ce.setPitch(0),ce.setRoll(0),ce.setZoom(S.zoom);const de=ce.modelViewProjectionMatrix,ue=[fr(d.getNorthWest()),fr(d.getNorthEast()),fr(d.getSouthWest()),fr(d.getSouthEast()),fr(new c.S(q,se)),fr(new c.S(N,se)),fr(new c.S(ae,K)),fr(new c.S(ae,re))],_e=fr(S.center);let be=Number.POSITIVE_INFINITY;for(const fe of ue)L<0&&(be=as.getLesserNonNegativeNonNull(be,as.solveVectorScale(fe,_e,de,"x",L))),P>0&&(be=as.getLesserNonNegativeNonNull(be,as.solveVectorScale(fe,_e,de,"x",P))),O>0&&(be=as.getLesserNonNegativeNonNull(be,as.solveVectorScale(fe,_e,de,"y",O))),k<0&&(be=as.getLesserNonNegativeNonNull(be,as.solveVectorScale(fe,_e,de,"y",k)));if(Number.isFinite(be)&&be!==0)return S.zoom=ce.zoom+c.ak(be),S;Li()}handleJumpToCenterZoom(e,s){const d=e.center.lat,g=e.getConstrained(s.center?c.S.convert(s.center):e.center,e.zoom).center;e.setCenter(g.wrap());const _=s.zoom!==void 0?+s.zoom:e.zoom+pr(d,g.lat);e.zoom!==_&&e.setZoom(_)}handleEaseTo(e,s){const d=e.zoom,g=e.center,_=e.padding,S={roll:e.roll,pitch:e.pitch,bearing:e.bearing},L={roll:s.roll===void 0?e.roll:s.roll,pitch:s.pitch===void 0?e.pitch:s.pitch,bearing:s.bearing===void 0?e.bearing:s.bearing},P=s.zoom!==void 0,O=!e.isPaddingEqual(s.padding);let k=!1;const $=s.center?c.S.convert(s.center):g,N=e.getConstrained($,d).center;Uo(e,N);const q=e.clone();q.setCenter(N),q.setZoom(P?+s.zoom:d+pr(g.lat,$.lat)),q.setBearing(s.bearing);const K=new c.P(c.ah(e.centerPoint.x+s.offsetAsPoint.x,0,e.width),c.ah(e.centerPoint.y+s.offsetAsPoint.y,0,e.height));q.setLocationAtPoint(N,K);const re=(s.offset&&s.offsetAsPoint.mag())>0?q.center:N,ae=P?+s.zoom:d+pr(g.lat,re.lat),se=d+pr(g.lat,0),ce=ae+pr(re.lat,0),de=c.bA(g.lng,re.lng),ue=c.bA(g.lat,re.lat),_e=c.af(ce-se);return k=ae!==d,{easeFunc:be=>{if(c.be(S,L)||Ur({startEulerAngles:S,endEulerAngles:L,tr:e,k:be,useSlerp:S.roll!=L.roll}),O&&e.interpolatePadding(_,s.padding,be),s.around)c.w("Easing around a point is not supported under globe projection."),e.setLocationAtPoint(s.around,s.aroundPoint);else{const fe=ce>se?Math.min(2,_e):Math.max(.5,_e),Ee=Math.pow(fe,1-be),Ve=Pp(g,de,ue,be*Ee);e.setCenter(Ve.wrap())}if(k){const fe=c.C.number(se,ce,be)+pr(0,e.center.lat);e.setZoom(fe)}},isZooming:k,elevationCenter:re}}handleFlyTo(e,s){const d=s.zoom!==void 0,g=e.center,_=e.zoom,S=e.padding,L=!e.isPaddingEqual(s.padding),P=e.getConstrained(c.S.convert(s.center||s.locationAtOffset),_).center,O=d?+s.zoom:e.zoom+pr(e.center.lat,P.lat),k=e.clone();k.setCenter(P),k.setZoom(O),k.setBearing(s.bearing);const $=new c.P(c.ah(e.centerPoint.x+s.offsetAsPoint.x,0,e.width),c.ah(e.centerPoint.y+s.offsetAsPoint.y,0,e.height));k.setLocationAtPoint(P,$);const N=k.center;Uo(e,N);const q=(function(ue,_e,be){const fe=fr(_e),Ee=fr(be),Ve=c.aX(fe,Ee),ke=Math.acos(Ve),Ne=Cc(ue);return ke/(2*Math.PI)*Ne})(e,g,N),K=_+pr(g.lat,0),re=O+pr(N.lat,0),ae=c.af(re-K);let se;if(typeof s.minZoom=="number"){const ue=+s.minZoom+pr(N.lat,0),_e=Math.min(ue,K,re)+pr(0,N.lat),be=e.getConstrained(N,_e).zoom+pr(N.lat,0);se=c.af(be-K)}const ce=c.bA(g.lng,N.lng),de=c.bA(g.lat,N.lat);return{easeFunc:(ue,_e,be,fe)=>{const Ee=Pp(g,ce,de,be);L&&e.interpolatePadding(S,s.padding,ue);const Ve=ue===1?N:Ee;e.setCenter(Ve.wrap());const ke=K+c.ak(_e);e.setZoom(ue===1?O:ke+pr(0,Ve.lat))},scaleOfZoom:ae,targetCenter:N,scaleOfMinZoom:se,pixelPathLength:q}}static solveVectorScale(e,s,d,g,_){const S=g==="x"?[d[0],d[4],d[8],d[12]]:[d[1],d[5],d[9],d[13]],L=[d[3],d[7],d[11],d[15]],P=e[0]*S[0]+e[1]*S[1]+e[2]*S[2],O=e[0]*L[0]+e[1]*L[1]+e[2]*L[2],k=s[0]*S[0]+s[1]*S[1]+s[2]*S[2],$=s[0]*L[0]+s[1]*L[1]+s[2]*L[2];return k+_*O===P+_*$||L[3]*(P-k)+S[3]*($-O)+P*$==k*O?null:(k+S[3]-_*$-_*L[3])/(k-P-_*$+_*O)}static getLesserNonNegativeNonNull(e,s){return s!==null&&s>=0&&s<e?s:e}}class Kd{constructor(e){this._globe=e,this._mercatorCameraHelper=new Na,this._verticalPerspectiveCameraHelper=new as}get useGlobeControls(){return this._globe.useGlobeRendering}get currentHelper(){return this.useGlobeControls?this._verticalPerspectiveCameraHelper:this._mercatorCameraHelper}handlePanInertia(e,s){return this.currentHelper.handlePanInertia(e,s)}handleMapControlsRollPitchBearingZoom(e,s){return this.currentHelper.handleMapControlsRollPitchBearingZoom(e,s)}handleMapControlsPan(e,s,d){this.currentHelper.handleMapControlsPan(e,s,d)}cameraForBoxAndBearing(e,s,d,g,_){return this.currentHelper.cameraForBoxAndBearing(e,s,d,g,_)}handleJumpToCenterZoom(e,s){this.currentHelper.handleJumpToCenterZoom(e,s)}handleEaseTo(e,s){return this.currentHelper.handleEaseTo(e,s)}handleFlyTo(e,s){return this.currentHelper.handleFlyTo(e,s)}}const Rh=(y,e)=>c.y(y,e&&e.filter((s=>s.identifier!=="source.canvas"))),mm=c.bE();class Jd extends c.E{constructor(e,s={}){var d,g;super(),this._rtlPluginLoaded=()=>{for(const S in this.sourceCaches){const L=this.sourceCaches[S].getSource().type;L!=="vector"&&L!=="geojson"||this.sourceCaches[S].reload()}},this.map=e,this.dispatcher=new Lt(Bt(),e._getMapId()),this.dispatcher.registerMessageHandler("GG",((S,L)=>this.getGlyphs(S,L))),this.dispatcher.registerMessageHandler("GI",((S,L)=>this.getImages(S,L))),this.dispatcher.registerMessageHandler("GDA",((S,L)=>this.getDashes(S,L))),this.imageManager=new Gt,this.imageManager.setEventedParent(this);const _=((d=e._container)===null||d===void 0?void 0:d.lang)||typeof document<"u"&&((g=document.documentElement)===null||g===void 0?void 0:g.lang)||void 0;this.glyphManager=new Qt(e._requestManager,s.localIdeographFontFamily,_),this.lineAtlas=new St(256,512),this.crossTileSymbolIndex=new As,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new c.bF,this._loaded=!1,this._availableImages=[],this._globalState={},this._resetUpdates(),this.dispatcher.broadcast("SR",c.bG()),Hs().on(Ji,this._rtlPluginLoaded),this.on("data",(S=>{if(S.dataType!=="source"||S.sourceDataType!=="metadata")return;const L=this.sourceCaches[S.sourceId];if(!L)return;const P=L.getSource();if(P&&P.vectorLayerIds)for(const O in this._layers){const k=this._layers[O];k.source===P.id&&this._validateLayer(k)}}))}setGlobalStateProperty(e,s){var d,g,_;this._checkLoaded();const S=s===null?(_=(g=(d=this.stylesheet.state)===null||d===void 0?void 0:d[e])===null||g===void 0?void 0:g.default)!==null&&_!==void 0?_:null:s;if(c.bH(S,this._globalState[e]))return this;this._globalState[e]=S,this._applyGlobalStateChanges([e])}getGlobalState(){return this._globalState}setGlobalState(e){this._checkLoaded();const s=[];for(const d in e)!c.bH(this._globalState[d],e[d].default)&&(s.push(d),this._globalState[d]=e[d].default);this._applyGlobalStateChanges(s)}_applyGlobalStateChanges(e){if(e.length===0)return;const s=new Set,d={};for(const g of e){d[g]=this._globalState[g];for(const _ in this._layers){const S=this._layers[_],L=S.getLayoutAffectingGlobalStateRefs(),P=S.getPaintAffectingGlobalStateRefs();if(L.has(g)&&s.add(S.source),P.has(g))for(const{name:O,value:k}of P.get(g))this._updatePaintProperty(S,O,k)}}this.dispatcher.broadcast("UGS",d);for(const g in this.sourceCaches)s.has(g)&&(this._reloadSource(g),this._changed=!0)}loadURL(e,s={},d){this.fire(new c.l("dataloading",{dataType:"style"})),s.validate=typeof s.validate!="boolean"||s.validate;const g=this.map._requestManager.transformRequest(e,"Style");this._loadStyleRequest=new AbortController;const _=this._loadStyleRequest;c.j(g,this._loadStyleRequest).then((S=>{this._loadStyleRequest=null,this._load(S.data,s,d)})).catch((S=>{this._loadStyleRequest=null,S&&!_.signal.aborted&&this.fire(new c.k(S))}))}loadJSON(e,s={},d){this.fire(new c.l("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,Y.frameAsync(this._frameRequest).then((()=>{this._frameRequest=null,s.validate=s.validate!==!1,this._load(e,s,d)})).catch((()=>{}))}loadEmpty(){this.fire(new c.l("dataloading",{dataType:"style"})),this._load(mm,{validate:!1})}_load(e,s,d){var g,_;let S=s.transformStyle?s.transformStyle(d,e):e;if(!s.validate||!Rh(this,c.z(S))){S=Object.assign({},S),this._loaded=!0,this.stylesheet=S;for(const L in S.sources)this.addSource(L,S.sources[L],{validate:!1});S.sprite?this._loadSprite(S.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(S.glyphs),this._createLayers(),this.light=new $e(this.stylesheet.light),this._setProjectionInternal(((g=this.stylesheet.projection)===null||g===void 0?void 0:g.type)||"mercator"),this.sky=new wt(this.stylesheet.sky),this.map.setTerrain((_=this.stylesheet.terrain)!==null&&_!==void 0?_:null),this.fire(new c.l("data",{dataType:"style"})),this.fire(new c.l("style.load"))}}_createLayers(){var e,s,d;const g=c.bI(this.stylesheet.layers);this.setGlobalState((e=this.stylesheet.state)!==null&&e!==void 0?e:null),this.dispatcher.broadcast("SL",g),this._order=g.map((_=>_.id)),this._layers={},this._serializedLayers=null;for(const _ of g){const S=c.bJ(_,this._globalState);if(S.setEventedParent(this,{layer:{id:_.id}}),this._layers[_.id]=S,c.bK(S)&&this.sourceCaches[S.source]){const L=(d=(s=_.paint)===null||s===void 0?void 0:s["raster-fade-duration"])!==null&&d!==void 0?d:S.paint.get("raster-fade-duration");this.sourceCaches[S.source].setRasterFadeDuration(L)}}}_loadSprite(e,s=!1,d=void 0){let g;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,(function(_,S,L,P){return c._(this,void 0,void 0,(function*(){const O=et(_),k=L>1?"@2x":"",$={},N={};for(const{id:q,url:K}of O){const re=S.transformRequest(ot(K,k,".json"),"SpriteJSON");$[q]=c.j(re,P);const ae=S.transformRequest(ot(K,k,".png"),"SpriteImage");N[q]=Oe.getImage(ae,P)}return yield Promise.all([...Object.values($),...Object.values(N)]),(function(q,K){return c._(this,void 0,void 0,(function*(){const re={};for(const ae in q){re[ae]={};const se=Y.getImageCanvasContext((yield K[ae]).data),ce=(yield q[ae]).data;for(const de in ce){const{width:ue,height:_e,x:be,y:fe,sdf:Ee,pixelRatio:Ve,stretchX:ke,stretchY:Ne,content:Ue,textFitWidth:ht,textFitHeight:dt}=ce[de];re[ae][de]={data:null,pixelRatio:Ve,sdf:Ee,stretchX:ke,stretchY:Ne,content:Ue,textFitWidth:ht,textFitHeight:dt,spriteData:{width:ue,height:_e,x:be,y:fe,context:se}}}}return re}))})($,N)}))})(e,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then((_=>{if(this._spriteRequest=null,_)for(const S in _){this._spritesImagesIds[S]=[];const L=this._spritesImagesIds[S]?this._spritesImagesIds[S].filter((P=>!(P in _))):[];for(const P of L)this.imageManager.removeImage(P),this._changedImages[P]=!0;for(const P in _[S]){const O=S==="default"?P:`${S}:${P}`;this._spritesImagesIds[S].push(O),O in this.imageManager.images?this.imageManager.updateImage(O,_[S][P],!1):this.imageManager.addImage(O,_[S][P]),s&&(this._changedImages[O]=!0)}}})).catch((_=>{this._spriteRequest=null,g=_,this.fire(new c.k(g))})).finally((()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),s&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new c.l("data",{dataType:"style"})),d&&d(g)}))}_unloadSprite(){for(const e of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(e),this._changedImages[e]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new c.l("data",{dataType:"style"}))}_validateLayer(e){const s=this.sourceCaches[e.source];if(!s)return;const d=e.sourceLayer;if(!d)return;const g=s.getSource();(g.type==="geojson"||g.vectorLayerIds&&g.vectorLayerIds.indexOf(d)===-1)&&this.fire(new c.k(new Error(`Source layer "${d}" does not exist on source "${g.id}" as specified by style layer "${e.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const e in this.sourceCaches)if(!this.sourceCaches[e].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(e,s=!1){const d=this._serializedAllLayers();if(!e||e.length===0)return Object.values(s?c.bL(d):d);const g=[];for(const _ of e)if(d[_]){const S=s?c.bL(d[_]):d[_];g.push(S)}return g}_serializedAllLayers(){let e=this._serializedLayers;if(e)return e;e=this._serializedLayers={};const s=Object.keys(this._layers);for(const d of s){const g=this._layers[d];g.type!=="custom"&&(e[d]=g.serialize())}return e}hasTransitions(){var e,s,d;if(!((e=this.light)===null||e===void 0)&&e.hasTransition()||!((s=this.sky)===null||s===void 0)&&s.hasTransition()||!((d=this.projection)===null||d===void 0)&&d.hasTransition())return!0;for(const g in this.sourceCaches)if(this.sourceCaches[g].hasTransition())return!0;for(const g in this._layers)if(this._layers[g].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(e){if(!this._loaded)return;const s=this._changed;if(s){const g=Object.keys(this._updatedLayers),_=Object.keys(this._removedLayers);(g.length||_.length)&&this._updateWorkerLayers(g,_);for(const S in this._updatedSources){const L=this._updatedSources[S];if(L==="reload")this._reloadSource(S);else{if(L!=="clear")throw new Error(`Invalid action ${L}`);this._clearSource(S)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const S in this._updatedPaintProps)this._layers[S].updateTransitions(e);this.light.updateTransitions(e),this.sky.updateTransitions(e),this._resetUpdates()}const d={};for(const g in this.sourceCaches){const _=this.sourceCaches[g];d[g]=_.used,_.used=!1}for(const g of this._order){const _=this._layers[g];_.recalculate(e,this._availableImages),!_.isHidden(e.zoom)&&_.source&&(this.sourceCaches[_.source].used=!0)}for(const g in d){const _=this.sourceCaches[g];!!d[g]!=!!_.used&&_.fire(new c.l("data",{sourceDataType:"visibility",dataType:"source",sourceId:g}))}this.light.recalculate(e),this.sky.recalculate(e),this.projection.recalculate(e),this.z=e.zoom,s&&this.fire(new c.l("data",{dataType:"style"}))}_updateTilesForChangedImages(){const e=Object.keys(this._changedImages);if(e.length){for(const s in this.sourceCaches)this.sourceCaches[s].reloadTilesForDependencies(["icons","patterns"],e);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const e in this.sourceCaches)this.sourceCaches[e].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(e,s){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(e,!1),removedIds:s})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(e,s={}){var d;this._checkLoaded();const g=this.serialize();if(e=s.transformStyle?s.transformStyle(g,e):e,((d=s.validate)===null||d===void 0||d)&&Rh(this,c.z(e)))return!1;(e=c.bL(e)).layers=c.bI(e.layers);const _=c.bM(g,e),S=this._getOperationsToPerform(_);if(S.unimplemented.length>0)throw new Error(`Unimplemented: ${S.unimplemented.join(", ")}.`);if(S.operations.length===0)return!1;for(const L of S.operations)L();return this.stylesheet=e,this._serializedLayers=null,!0}_getOperationsToPerform(e){const s=[],d=[];for(const g of e)switch(g.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":case"setRoll":continue;case"addLayer":s.push((()=>this.addLayer.apply(this,g.args)));break;case"removeLayer":s.push((()=>this.removeLayer.apply(this,g.args)));break;case"setPaintProperty":s.push((()=>this.setPaintProperty.apply(this,g.args)));break;case"setLayoutProperty":s.push((()=>this.setLayoutProperty.apply(this,g.args)));break;case"setFilter":s.push((()=>this.setFilter.apply(this,g.args)));break;case"addSource":s.push((()=>this.addSource.apply(this,g.args)));break;case"removeSource":s.push((()=>this.removeSource.apply(this,g.args)));break;case"setLayerZoomRange":s.push((()=>this.setLayerZoomRange.apply(this,g.args)));break;case"setLight":s.push((()=>this.setLight.apply(this,g.args)));break;case"setGeoJSONSourceData":s.push((()=>this.setGeoJSONSourceData.apply(this,g.args)));break;case"setGlyphs":s.push((()=>this.setGlyphs.apply(this,g.args)));break;case"setSprite":s.push((()=>this.setSprite.apply(this,g.args)));break;case"setTerrain":s.push((()=>this.map.setTerrain.apply(this,g.args)));break;case"setSky":s.push((()=>this.setSky.apply(this,g.args)));break;case"setProjection":this.setProjection.apply(this,g.args);break;case"setGlobalState":s.push((()=>this.setGlobalState.apply(this,g.args)));break;case"setTransition":s.push((()=>{}));break;default:d.push(g.command)}return{operations:s,unimplemented:d}}addImage(e,s){if(this.getImage(e))return this.fire(new c.k(new Error(`An image named "${e}" already exists.`)));this.imageManager.addImage(e,s),this._afterImageUpdated(e)}updateImage(e,s){this.imageManager.updateImage(e,s)}getImage(e){return this.imageManager.getImage(e)}removeImage(e){if(!this.getImage(e))return this.fire(new c.k(new Error(`An image named "${e}" does not exist.`)));this.imageManager.removeImage(e),this._afterImageUpdated(e)}_afterImageUpdated(e){this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new c.l("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(e,s,d={}){if(this._checkLoaded(),this.sourceCaches[e]!==void 0)throw new Error(`Source "${e}" already exists.`);if(!s.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(s).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(s.type)>=0&&this._validate(c.z.source,`sources.${e}`,s,null,d))return;this.map&&this.map._collectResourceTiming&&(s.collectResourceTiming=!0);const g=this.sourceCaches[e]=new Dt(e,s,this.dispatcher);g.style=this,g.setEventedParent(this,(()=>({isSourceLoaded:g.loaded(),source:g.serialize(),sourceId:e}))),g.onAdd(this.map),this._changed=!0}removeSource(e){if(this._checkLoaded(),this.sourceCaches[e]===void 0)throw new Error("There is no source with this ID");for(const d in this._layers)if(this._layers[d].source===e)return this.fire(new c.k(new Error(`Source "${e}" cannot be removed while layer "${d}" is using it.`)));const s=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],s.fire(new c.l("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),s.setEventedParent(null),s.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(e,s){if(this._checkLoaded(),this.sourceCaches[e]===void 0)throw new Error(`There is no source with this ID=${e}`);const d=this.sourceCaches[e].getSource();if(d.type!=="geojson")throw new Error(`geojsonSource.type is ${d.type}, which is !== 'geojson`);d.setData(s),this._changed=!0}getSource(e){return this.sourceCaches[e]&&this.sourceCaches[e].getSource()}addLayer(e,s,d={}){this._checkLoaded();const g=e.id;if(this.getLayer(g))return void this.fire(new c.k(new Error(`Layer "${g}" already exists on this map.`)));let _;if(e.type==="custom"){if(Rh(this,c.bN(e)))return;_=c.bJ(e,this._globalState)}else{if("source"in e&&typeof e.source=="object"&&(this.addSource(g,e.source),e=c.bL(e),e=c.e(e,{source:g})),this._validate(c.z.layer,`layers.${g}`,e,{arrayIndex:-1},d))return;_=c.bJ(e,this._globalState),this._validateLayer(_),_.setEventedParent(this,{layer:{id:g}})}const S=s?this._order.indexOf(s):this._order.length;if(s&&S===-1)this.fire(new c.k(new Error(`Cannot add layer "${g}" before non-existing layer "${s}".`)));else{if(this._order.splice(S,0,g),this._layerOrderChanged=!0,this._layers[g]=_,this._removedLayers[g]&&_.source&&_.type!=="custom"){const L=this._removedLayers[g];delete this._removedLayers[g],L.type!==_.type?this._updatedSources[_.source]="clear":(this._updatedSources[_.source]="reload",this.sourceCaches[_.source].pause())}this._updateLayer(_),_.onAdd&&_.onAdd(this.map)}}moveLayer(e,s){if(this._checkLoaded(),this._changed=!0,!this._layers[e])return void this.fire(new c.k(new Error(`The layer '${e}' does not exist in the map's style and cannot be moved.`)));if(e===s)return;const d=this._order.indexOf(e);this._order.splice(d,1);const g=s?this._order.indexOf(s):this._order.length;s&&g===-1?this.fire(new c.k(new Error(`Cannot move layer "${e}" before non-existing layer "${s}".`))):(this._order.splice(g,0,e),this._layerOrderChanged=!0)}removeLayer(e){this._checkLoaded();const s=this._layers[e];if(!s)return void this.fire(new c.k(new Error(`Cannot remove non-existing layer "${e}".`)));s.setEventedParent(null);const d=this._order.indexOf(e);this._order.splice(d,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=s,delete this._layers[e],this._serializedLayers&&delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],s.onRemove&&s.onRemove(this.map)}getLayer(e){return this._layers[e]}getLayersOrder(){return[...this._order]}hasLayer(e){return e in this._layers}setLayerZoomRange(e,s,d){this._checkLoaded();const g=this.getLayer(e);g?g.minzoom===s&&g.maxzoom===d||(s!=null&&(g.minzoom=s),d!=null&&(g.maxzoom=d),this._updateLayer(g)):this.fire(new c.k(new Error(`Cannot set the zoom range of non-existing layer "${e}".`)))}setFilter(e,s,d={}){this._checkLoaded();const g=this.getLayer(e);if(g){if(!c.bH(g.filter,s))return s==null?(g.setFilter(void 0),void this._updateLayer(g)):void(this._validate(c.z.filter,`layers.${g.id}.filter`,s,null,d)||(g.setFilter(c.bL(s)),this._updateLayer(g)))}else this.fire(new c.k(new Error(`Cannot filter non-existing layer "${e}".`)))}getFilter(e){return c.bL(this.getLayer(e).filter)}setLayoutProperty(e,s,d,g={}){this._checkLoaded();const _=this.getLayer(e);_?c.bH(_.getLayoutProperty(s),d)||(_.setLayoutProperty(s,d,g),this._updateLayer(_)):this.fire(new c.k(new Error(`Cannot style non-existing layer "${e}".`)))}getLayoutProperty(e,s){const d=this.getLayer(e);if(d)return d.getLayoutProperty(s);this.fire(new c.k(new Error(`Cannot get style of non-existing layer "${e}".`)))}setPaintProperty(e,s,d,g={}){this._checkLoaded();const _=this.getLayer(e);_?c.bH(_.getPaintProperty(s),d)||this._updatePaintProperty(_,s,d,g):this.fire(new c.k(new Error(`Cannot style non-existing layer "${e}".`)))}_updatePaintProperty(e,s,d,g={}){e.setPaintProperty(s,d,g)&&this._updateLayer(e),c.bK(e)&&s==="raster-fade-duration"&&this.sourceCaches[e.source].setRasterFadeDuration(d),this._changed=!0,this._updatedPaintProps[e.id]=!0,this._serializedLayers=null}getPaintProperty(e,s){return this.getLayer(e).getPaintProperty(s)}setFeatureState(e,s){this._checkLoaded();const d=e.source,g=e.sourceLayer,_=this.sourceCaches[d];if(_===void 0)return void this.fire(new c.k(new Error(`The source '${d}' does not exist in the map's style.`)));const S=_.getSource().type;S==="geojson"&&g?this.fire(new c.k(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):S!=="vector"||g?(e.id===void 0&&this.fire(new c.k(new Error("The feature id parameter must be provided."))),_.setFeatureState(g,e.id,s)):this.fire(new c.k(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(e,s){this._checkLoaded();const d=e.source,g=this.sourceCaches[d];if(g===void 0)return void this.fire(new c.k(new Error(`The source '${d}' does not exist in the map's style.`)));const _=g.getSource().type,S=_==="vector"?e.sourceLayer:void 0;_!=="vector"||S?s&&typeof e.id!="string"&&typeof e.id!="number"?this.fire(new c.k(new Error("A feature id is required to remove its specific state property."))):g.removeFeatureState(S,e.id,s):this.fire(new c.k(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(e){this._checkLoaded();const s=e.source,d=e.sourceLayer,g=this.sourceCaches[s];if(g!==void 0)return g.getSource().type!=="vector"||d?(e.id===void 0&&this.fire(new c.k(new Error("The feature id parameter must be provided."))),g.getFeatureState(d,e.id)):void this.fire(new c.k(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new c.k(new Error(`The source '${s}' does not exist in the map's style.`)))}getTransition(){return c.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const e=c.bO(this.sourceCaches,(_=>_.serialize())),s=this._serializeByIds(this._order,!0),d=this.map.getTerrain()||void 0,g=this.stylesheet;return c.bP({version:g.version,name:g.name,metadata:g.metadata,light:g.light,sky:g.sky,center:g.center,zoom:g.zoom,bearing:g.bearing,pitch:g.pitch,sprite:g.sprite,glyphs:g.glyphs,transition:g.transition,projection:g.projection,sources:e,layers:s,terrain:d},(_=>_!==void 0))}_updateLayer(e){this._updatedLayers[e.id]=!0,e.source&&!this._updatedSources[e.source]&&this.sourceCaches[e.source].getSource().type!=="raster"&&(this._updatedSources[e.source]="reload",this.sourceCaches[e.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(e){const s=S=>this._layers[S].type==="fill-extrusion",d={},g=[];for(let S=this._order.length-1;S>=0;S--){const L=this._order[S];if(s(L)){d[L]=S;for(const P of e){const O=P[L];if(O)for(const k of O)g.push(k)}}}g.sort(((S,L)=>L.intersectionZ-S.intersectionZ));const _=[];for(let S=this._order.length-1;S>=0;S--){const L=this._order[S];if(s(L))for(let P=g.length-1;P>=0;P--){const O=g[P].feature;if(d[O.layer.id]<S)break;_.push(O),g.pop()}else for(const P of e){const O=P[L];if(O)for(const k of O)_.push(k.feature)}}return _}queryRenderedFeatures(e,s,d){s&&s.filter&&this._validate(c.z.filter,"queryRenderedFeatures.filter",s.filter,null,s);const g={};if(s&&s.layers){if(!(Array.isArray(s.layers)||s.layers instanceof Set))return this.fire(new c.k(new Error("parameters.layers must be an Array or a Set of strings"))),[];for(const O of s.layers){const k=this._layers[O];if(!k)return this.fire(new c.k(new Error(`The layer '${O}' does not exist in the map's style and cannot be queried for features.`))),[];g[k.source]=!0}}const _=[];s.availableImages=this._availableImages;const S=this._serializedAllLayers(),L=s.layers instanceof Set?s.layers:Array.isArray(s.layers)?new Set(s.layers):null,P=Object.assign(Object.assign({},s),{layers:L,globalState:this._globalState});for(const O in this.sourceCaches)s.layers&&!g[O]||_.push(xn(this.sourceCaches[O],this._layers,S,e,P,d,this.map.terrain?(k,$,N)=>this.map.terrain.getElevation(k,$,N):void 0));return this.placement&&_.push((function(O,k,$,N,q,K,re){const ae={},se=K.queryRenderedSymbols(N),ce=[];for(const de of Object.keys(se).map(Number))ce.push(re[de]);ce.sort(ka);for(const de of ce){const ue=de.featureIndex.lookupSymbolFeatures(se[de.bucketInstanceId],k,de.bucketIndex,de.sourceLayerIndex,{filterSpec:q.filter,globalState:q.globalState},q.layers,q.availableImages,O);for(const _e in ue){const be=ae[_e]=ae[_e]||[],fe=ue[_e];fe.sort(((Ee,Ve)=>{const ke=de.featureSortOrder;if(ke){const Ne=ke.indexOf(Ee.featureIndex);return ke.indexOf(Ve.featureIndex)-Ne}return Ve.featureIndex-Ee.featureIndex}));for(const Ee of fe)be.push(Ee)}}return(function(de,ue,_e){for(const be in de)for(const fe of de[be])ai(fe,_e[ue[be].source]);return de})(ae,O,$)})(this._layers,S,this.sourceCaches,e,P,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(_)}querySourceFeatures(e,s){s!=null&&s.filter&&this._validate(c.z.filter,"querySourceFeatures.filter",s.filter,null,s);const d=this.sourceCaches[e];return d?(function(g,_){const S=g.getRenderableIds().map((O=>g.getTileByID(O))),L=[],P={};for(let O=0;O<S.length;O++){const k=S[O],$=k.tileID.canonical.key;P[$]||(P[$]=!0,k.querySourceFeatures(L,_))}return L})(d,s?Object.assign(Object.assign({},s),{globalState:this._globalState}):{globalState:this._globalState}):[]}getLight(){return this.light.getLight()}setLight(e,s={}){this._checkLoaded();const d=this.light.getLight();let g=!1;for(const S in e)if(!c.bH(e[S],d[S])){g=!0;break}if(!g)return;const _={now:Y.now(),transition:c.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(e,s),this.light.updateTransitions(_)}getProjection(){var e;return(e=this.stylesheet)===null||e===void 0?void 0:e.projection}setProjection(e){if(this._checkLoaded(),this.projection){if(this.projection.name===e.type)return;this.projection.destroy(),delete this.projection}this.stylesheet.projection=e,this._setProjectionInternal(e.type)}getSky(){var e;return(e=this.stylesheet)===null||e===void 0?void 0:e.sky}setSky(e,s={}){this._checkLoaded();const d=this.getSky();let g=!1;if(!e&&!d)return;if(e&&!d)g=!0;else if(!e&&d)g=!0;else for(const S in e)if(!c.bH(e[S],d[S])){g=!0;break}if(!g)return;const _={now:Y.now(),transition:c.e({duration:300,delay:0},this.stylesheet.transition)};this.stylesheet.sky=e,this.sky.setSky(e,s),this.sky.updateTransitions(_)}_setProjectionInternal(e){const s=(function(d){if(Array.isArray(d)){const g=new Al({type:d});return{projection:g,transform:new Js,cameraHelper:new Kd(g)}}switch(d){case"mercator":return{projection:new da,transform:new Ls,cameraHelper:new Na};case"globe":{const g=new Al({type:["interpolate",["linear"],["zoom"],11,"vertical-perspective",12,"mercator"]});return{projection:g,transform:new Js,cameraHelper:new Kd(g)}}case"vertical-perspective":return{projection:new El,transform:new yu,cameraHelper:new as};default:return c.w(`Unknown projection name: ${d}. Falling back to mercator projection.`),{projection:new da,transform:new Ls,cameraHelper:new Na}}})(e);this.projection=s.projection,this.map.migrateProjection(s.transform,s.cameraHelper);for(const d in this.sourceCaches)this.sourceCaches[d].reload()}_validate(e,s,d,g,_={}){return(!_||_.validate!==!1)&&Rh(this,e.call(c.z,c.e({key:s,style:this.serialize(),value:d,styleSpec:c.v},g)))}_remove(e=!0){this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._loadStyleRequest&&(this._loadStyleRequest.abort(),this._loadStyleRequest=null),this._spriteRequest&&(this._spriteRequest.abort(),this._spriteRequest=null),Hs().off(Ji,this._rtlPluginLoaded);for(const s in this._layers)this._layers[s].setEventedParent(null);for(const s in this.sourceCaches){const d=this.sourceCaches[s];d.setEventedParent(null),d.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),e&&this.dispatcher.broadcast("RM",void 0),this.dispatcher.remove(e)}_clearSource(e){this.sourceCaches[e].clearTiles()}_reloadSource(e){this.sourceCaches[e].resume(),this.sourceCaches[e].reload()}_updateSources(e){for(const s in this.sourceCaches)this.sourceCaches[s].update(e,this.map.terrain)}_generateCollisionBoxes(){for(const e in this.sourceCaches)this._reloadSource(e)}_updatePlacement(e,s,d,g,_=!1){let S=!1,L=!1;const P={};for(const O of this._order){const k=this._layers[O];if(k.type!=="symbol")continue;if(!P[k.source]){const N=this.sourceCaches[k.source];P[k.source]=N.getRenderableIds(!0).map((q=>N.getTileByID(q))).sort(((q,K)=>K.tileID.overscaledZ-q.tileID.overscaledZ||(q.tileID.isLessThan(K.tileID)?-1:1)))}const $=this.crossTileSymbolIndex.addLayer(k,P[k.source],e.center.lng);S=S||$}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((_=_||this._layerOrderChanged||d===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(Y.now(),e.zoom))&&(this.pauseablePlacement=new Qd(e,this.map.terrain,this._order,_,s,d,g,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,P),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(Y.now()),L=!0),S&&this.pauseablePlacement.placement.setStale()),L||S)for(const O of this._order){const k=this._layers[O];k.type==="symbol"&&this.placement.updateLayerOpacities(k,P[k.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(Y.now())}_releaseSymbolFadeTiles(){for(const e in this.sourceCaches)this.sourceCaches[e].releaseSymbolFadeTiles()}getImages(e,s){return c._(this,void 0,void 0,(function*(){const d=yield this.imageManager.getImages(s.icons);this._updateTilesForChangedImages();const g=this.sourceCaches[s.source];return g&&g.setDependencies(s.tileID.key,s.type,s.icons),d}))}getGlyphs(e,s){return c._(this,void 0,void 0,(function*(){const d=yield this.glyphManager.getGlyphs(s.stacks),g=this.sourceCaches[s.source];return g&&g.setDependencies(s.tileID.key,s.type,[""]),d}))}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(e,s={}){this._checkLoaded(),e&&this._validate(c.z.glyphs,"glyphs",e,null,s)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=e,this.glyphManager.entries={},this.glyphManager.setURL(e))}getDashes(e,s){return c._(this,void 0,void 0,(function*(){const d={};for(const[g,_]of Object.entries(s.dashes))d[g]=this.lineAtlas.getDash(_.dasharray,_.round);return d}))}addSprite(e,s,d={},g){this._checkLoaded();const _=[{id:e,url:s}],S=[...et(this.stylesheet.sprite),..._];this._validate(c.z.sprite,"sprite",S,null,d)||(this.stylesheet.sprite=S,this._loadSprite(_,!0,g))}removeSprite(e){this._checkLoaded();const s=et(this.stylesheet.sprite);if(s.find((d=>d.id===e))){if(this._spritesImagesIds[e])for(const d of this._spritesImagesIds[e])this.imageManager.removeImage(d),this._changedImages[d]=!0;s.splice(s.findIndex((d=>d.id===e)),1),this.stylesheet.sprite=s.length>0?s:void 0,delete this._spritesImagesIds[e],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new c.l("data",{dataType:"style"}))}else this.fire(new c.k(new Error(`Sprite "${e}" doesn't exists on this map.`)))}getSprite(){return et(this.stylesheet.sprite)}setSprite(e,s={},d){this._checkLoaded(),e&&this._validate(c.z.sprite,"sprite",e,null,s)||(this.stylesheet.sprite=e,e?this._loadSprite(e,!0,d):(this._unloadSprite(),d&&d(null)))}}var gm=c.aJ([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Ih{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(e,s,d,g,_,S,L,P,O){this.context=e;let k=this.boundPaintVertexBuffers.length!==g.length;for(let $=0;!k&&$<g.length;$++)this.boundPaintVertexBuffers[$]!==g[$]&&(k=!0);!this.vao||this.boundProgram!==s||this.boundLayoutVertexBuffer!==d||k||this.boundIndexBuffer!==_||this.boundVertexOffset!==S||this.boundDynamicVertexBuffer!==L||this.boundDynamicVertexBuffer2!==P||this.boundDynamicVertexBuffer3!==O?this.freshBind(s,d,g,_,S,L,P,O):(e.bindVertexArray.set(this.vao),L&&L.bind(),_&&_.dynamicDraw&&_.bind(),P&&P.bind(),O&&O.bind())}freshBind(e,s,d,g,_,S,L,P){const O=e.numAttributes,k=this.context,$=k.gl;this.vao&&this.destroy(),this.vao=k.createVertexArray(),k.bindVertexArray.set(this.vao),this.boundProgram=e,this.boundLayoutVertexBuffer=s,this.boundPaintVertexBuffers=d,this.boundIndexBuffer=g,this.boundVertexOffset=_,this.boundDynamicVertexBuffer=S,this.boundDynamicVertexBuffer2=L,this.boundDynamicVertexBuffer3=P,s.enableAttributes($,e);for(const N of d)N.enableAttributes($,e);S&&S.enableAttributes($,e),L&&L.enableAttributes($,e),P&&P.enableAttributes($,e),s.bind(),s.setVertexAttribPointers($,e,_);for(const N of d)N.bind(),N.setVertexAttribPointers($,e,_);S&&(S.bind(),S.setVertexAttribPointers($,e,_)),g&&g.bind(),L&&(L.bind(),L.setVertexAttribPointers($,e,_)),P&&(P.bind(),P.setVertexAttribPointers($,e,_)),k.currentNumAttributes=O}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}const ef=(y,e,s,d,g)=>({u_texture:0,u_ele_delta:y,u_fog_matrix:e,u_fog_color:s?s.properties.get("fog-color"):c.bf.white,u_fog_ground_blend:s?s.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:g?0:s?s.calculateFogBlendOpacity(d):0,u_horizon_color:s?s.properties.get("horizon-color"):c.bf.white,u_horizon_fog_blend:s?s.properties.get("horizon-fog-blend"):1,u_is_globe_mode:g?1:0}),zh={mainMatrix:"u_projection_matrix",tileMercatorCoords:"u_projection_tile_mercator_coords",clippingPlane:"u_projection_clipping_plane",projectionTransition:"u_projection_transition",fallbackMatrix:"u_projection_fallback_matrix"};function Ec(y){const e=[];for(let s=0;s<y.length;s++){if(y[s]===null)continue;const d=y[s].split(" ");e.push(d.pop())}return e}class tf{constructor(e,s,d,g,_,S,L,P,O=[]){const k=e.gl;this.program=k.createProgram();const $=Ec(s.staticAttributes),N=d?d.getBinderAttributes():[],q=$.concat(N),K=Lr.prelude.staticUniforms?Ec(Lr.prelude.staticUniforms):[],re=L.staticUniforms?Ec(L.staticUniforms):[],ae=s.staticUniforms?Ec(s.staticUniforms):[],se=d?d.getBinderUniforms():[],ce=K.concat(re).concat(ae).concat(se),de=[];for(const ke of ce)de.indexOf(ke)<0&&de.push(ke);const ue=d?d.defines():[];Ii(k)&&ue.unshift("#version 300 es"),_&&ue.push("#define OVERDRAW_INSPECTOR;"),S&&ue.push("#define TERRAIN3D;"),P&&ue.push(P),O&&ue.push(...O);let _e=ue.concat(Lr.prelude.fragmentSource,L.fragmentSource,s.fragmentSource).join(`
883
+ `),be=ue.concat(Lr.prelude.vertexSource,L.vertexSource,s.vertexSource).join(`
884
+ `);Ii(k)||(_e=(function(ke){return ke.replace(/\bin\s/g,"varying ").replace("out highp vec4 fragColor;","").replace(/fragColor/g,"gl_FragColor").replace(/texture\(/g,"texture2D(")})(_e),be=(function(ke){return ke.replace(/\bin\s/g,"attribute ").replace(/\bout\s/g,"varying ").replace(/texture\(/g,"texture2D(")})(be));const fe=k.createShader(k.FRAGMENT_SHADER);if(k.isContextLost())return void(this.failedToCreate=!0);if(k.shaderSource(fe,_e),k.compileShader(fe),!k.getShaderParameter(fe,k.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${k.getShaderInfoLog(fe)}`);k.attachShader(this.program,fe);const Ee=k.createShader(k.VERTEX_SHADER);if(k.isContextLost())return void(this.failedToCreate=!0);if(k.shaderSource(Ee,be),k.compileShader(Ee),!k.getShaderParameter(Ee,k.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${k.getShaderInfoLog(Ee)}`);k.attachShader(this.program,Ee),this.attributes={};const Ve={};this.numAttributes=q.length;for(let ke=0;ke<this.numAttributes;ke++)q[ke]&&(k.bindAttribLocation(this.program,ke,q[ke]),this.attributes[q[ke]]=ke);if(k.linkProgram(this.program),!k.getProgramParameter(this.program,k.LINK_STATUS))throw new Error(`Program failed to link: ${k.getProgramInfoLog(this.program)}`);k.deleteShader(Ee),k.deleteShader(fe);for(let ke=0;ke<de.length;ke++){const Ne=de[ke];if(Ne&&!Ve[Ne]){const Ue=k.getUniformLocation(this.program,Ne);Ue&&(Ve[Ne]=Ue)}}this.fixedUniforms=g(e,Ve),this.terrainUniforms=((ke,Ne)=>({u_depth:new c.bQ(ke,Ne.u_depth),u_terrain:new c.bQ(ke,Ne.u_terrain),u_terrain_dim:new c.bg(ke,Ne.u_terrain_dim),u_terrain_matrix:new c.bS(ke,Ne.u_terrain_matrix),u_terrain_unpack:new c.bT(ke,Ne.u_terrain_unpack),u_terrain_exaggeration:new c.bg(ke,Ne.u_terrain_exaggeration)}))(e,Ve),this.projectionUniforms=((ke,Ne)=>({u_projection_matrix:new c.bS(ke,Ne.u_projection_matrix),u_projection_tile_mercator_coords:new c.bT(ke,Ne.u_projection_tile_mercator_coords),u_projection_clipping_plane:new c.bT(ke,Ne.u_projection_clipping_plane),u_projection_transition:new c.bg(ke,Ne.u_projection_transition),u_projection_fallback_matrix:new c.bS(ke,Ne.u_projection_fallback_matrix)}))(e,Ve),this.binderUniforms=d?d.getUniforms(e,Ve):[]}draw(e,s,d,g,_,S,L,P,O,k,$,N,q,K,re,ae,se,ce,de){const ue=e.gl;if(this.failedToCreate)return;if(e.program.set(this.program),e.setDepthMode(d),e.setStencilMode(g),e.setColorMode(_),e.setCullFace(S),P){e.activeTexture.set(ue.TEXTURE2),ue.bindTexture(ue.TEXTURE_2D,P.depthTexture),e.activeTexture.set(ue.TEXTURE3),ue.bindTexture(ue.TEXTURE_2D,P.texture);for(const be in this.terrainUniforms)this.terrainUniforms[be].set(P[be])}if(O)for(const be in O)this.projectionUniforms[zh[be]].set(O[be]);if(L)for(const be in this.fixedUniforms)this.fixedUniforms[be].set(L[be]);ae&&ae.setUniforms(e,this.binderUniforms,K,{zoom:re});let _e=0;switch(s){case ue.LINES:_e=2;break;case ue.TRIANGLES:_e=3;break;case ue.LINE_STRIP:_e=1}for(const be of q.get()){const fe=be.vaos||(be.vaos={});(fe[k]||(fe[k]=new Ih)).bind(e,this,$,ae?ae.getPaintVertexBuffers():[],N,be.vertexOffset,se,ce,de),ue.drawElements(s,be.primitiveLength*_e,ue.UNSIGNED_SHORT,be.primitiveOffset*_e*2)}}}function fa(y,e,s){const d=1/c.aC(s,1,e.transform.tileZoom),g=Math.pow(2,s.tileID.overscaledZ),_=s.tileSize*Math.pow(2,e.transform.tileZoom)/g,S=_*(s.tileID.canonical.x+s.tileID.wrap*g),L=_*s.tileID.canonical.y;return{u_image:0,u_texsize:s.imageAtlasTexture.size,u_scale:[d,y.fromScale,y.toScale],u_fade:y.t,u_pixel_coord_upper:[S>>16,L>>16],u_pixel_coord_lower:[65535&S,65535&L]}}const Mc=(y,e,s,d)=>{const g=y.style.light,_=g.properties.get("position"),S=[_.x,_.y,_.z],L=c.bW();g.properties.get("anchor")==="viewport"&&c.bX(L,y.transform.bearingInRadians),c.bY(S,S,L);const P=y.transform.transformLightDirection(S),O=g.properties.get("color");return{u_lightpos:S,u_lightpos_globe:P,u_lightintensity:g.properties.get("intensity"),u_lightcolor:[O.r,O.g,O.b],u_vertical_gradient:+e,u_opacity:s,u_fill_translate:d}},nf=(y,e,s,d,g,_,S)=>c.e(Mc(y,e,s,d),fa(_,y,S),{u_height_factor:-Math.pow(2,g.overscaledZ)/S.tileSize/8}),Rl=(y,e,s,d)=>c.e(fa(e,y,s),{u_fill_translate:d}),Ac=(y,e)=>({u_world:y,u_fill_translate:e}),Ip=(y,e,s,d,g)=>c.e(Rl(y,e,s,g),{u_world:d}),_u=(y,e,s,d,g)=>{const _=y.transform;let S,L,P=0;if(s.paint.get("circle-pitch-alignment")==="map"){const O=c.aC(e,1,_.zoom);S=!0,L=[O,O],P=O/(c.$*Math.pow(2,e.tileID.overscaledZ))*2*Math.PI*g}else S=!1,L=_.pixelsToGLUnits;return{u_camera_to_center_distance:_.cameraToCenterDistance,u_scale_with_map:+(s.paint.get("circle-pitch-scale")==="map"),u_pitch_with_map:+S,u_device_pixel_ratio:y.pixelRatio,u_extrude_scale:L,u_globe_extrude_scale:P,u_translate:d}},zp=y=>({u_pixel_extrude_scale:[1/y.width,1/y.height]}),ss=y=>({u_viewport_size:[y.width,y.height]}),Dp=(y,e=1)=>({u_color:y,u_overlay:0,u_overlay_scale:e}),rf=(y,e,s,d)=>{const g=c.aC(y,1,e)/(c.$*Math.pow(2,y.tileID.overscaledZ))*2*Math.PI*d;return{u_extrude_scale:c.aC(y,1,e),u_intensity:s,u_globe_extrude_scale:g}},Op=(y,e,s,d)=>{const g=c.L();c.bZ(g,0,y.width,y.height,0,0,1);const _=y.context.gl;return{u_matrix:g,u_world:[_.drawingBufferWidth,_.drawingBufferHeight],u_image:s,u_color_ramp:d,u_opacity:e.paint.get("heatmap-opacity")}},af=(y,e,s)=>{const d=s.paint.get("hillshade-accent-color");let g;switch(s.paint.get("hillshade-method")){case"basic":g=4;break;case"combined":g=1;break;case"igor":g=2;break;case"multidirectional":g=3;break;default:g=0}const _=s.getIlluminationProperties();for(let S=0;S<_.directionRadians.length;S++)s.paint.get("hillshade-illumination-anchor")==="viewport"&&(_.directionRadians[S]+=y.transform.bearingInRadians);return{u_image:0,u_latrange:Lc(0,e.tileID),u_exaggeration:s.paint.get("hillshade-exaggeration"),u_altitudes:_.altitudeRadians,u_azimuths:_.directionRadians,u_accent:d,u_method:g,u_highlights:_.highlightColor,u_shadows:_.shadowColor}},Dh=(y,e)=>{const s=e.stride,d=c.L();return c.bZ(d,0,c.$,-c.$,0,0,1),c.M(d,d,[0,-c.$,0]),{u_matrix:d,u_image:1,u_dimension:[s,s],u_zoom:y.overscaledZ,u_unpack:e.getUnpackVector()}};function Lc(y,e){const s=Math.pow(2,e.canonical.z),d=e.canonical.y;return[new c.a1(0,d/s).toLngLat().lat,new c.a1(0,(d+1)/s).toLngLat().lat]}const Pc=(y,e,s=0)=>({u_image:0,u_unpack:e.getUnpackVector(),u_dimension:[e.stride,e.stride],u_elevation_stops:1,u_color_stops:4,u_color_ramp_size:s,u_opacity:y.paint.get("color-relief-opacity")}),vu=(y,e,s,d)=>{const g=y.transform;return{u_translation:of(y,e,s),u_ratio:d/c.aC(e,1,g.zoom),u_device_pixel_ratio:y.pixelRatio,u_units_to_pixels:[1/g.pixelsToGLUnits[0],1/g.pixelsToGLUnits[1]]}},xu=(y,e,s,d,g)=>c.e(vu(y,e,s,d),{u_image:0,u_image_height:g}),jo=(y,e,s,d,g)=>{const _=y.transform,S=eo(e,_);return{u_translation:of(y,e,s),u_texsize:e.imageAtlasTexture.size,u_ratio:d/c.aC(e,1,_.zoom),u_device_pixel_ratio:y.pixelRatio,u_image:0,u_scale:[S,g.fromScale,g.toScale],u_fade:g.t,u_units_to_pixels:[1/_.pixelsToGLUnits[0],1/_.pixelsToGLUnits[1]]}},sf=(y,e,s,d,g)=>{const _=eo(e,y.transform);return c.e(vu(y,e,s,d),{u_tileratio:_,u_crossfade_from:g.fromScale,u_crossfade_to:g.toScale,u_image:0,u_mix:g.t,u_lineatlas_width:y.lineAtlas.width,u_lineatlas_height:y.lineAtlas.height})},Oh=(y,e,s,d,g,_)=>{const S=eo(e,y.transform);return c.e(vu(y,e,s,d),{u_image:0,u_image_height:_,u_tileratio:S,u_crossfade_from:g.fromScale,u_crossfade_to:g.toScale,u_image_dash:1,u_mix:g.t,u_lineatlas_width:y.lineAtlas.width,u_lineatlas_height:y.lineAtlas.height})};function eo(y,e){return 1/c.aC(y,1,e.tileZoom)}function of(y,e,s){return c.aD(y.transform,e,s.paint.get("line-translate"),s.paint.get("line-translate-anchor"))}const bu=(y,e,s,d,g)=>{return{u_tl_parent:y,u_scale_parent:e,u_buffer_scale:1,u_fade_t:s.mix,u_opacity:s.opacity*d.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:d.paint.get("raster-brightness-min"),u_brightness_high:d.paint.get("raster-brightness-max"),u_saturation_factor:(S=d.paint.get("raster-saturation"),S>0?1-1/(1.001-S):-S),u_contrast_factor:(_=d.paint.get("raster-contrast"),_>0?1/(1-_):1+_),u_spin_weights:kp(d.paint.get("raster-hue-rotate")),u_coords_top:[g[0].x,g[0].y,g[1].x,g[1].y],u_coords_bottom:[g[3].x,g[3].y,g[2].x,g[2].y]};var _,S};function kp(y){y*=Math.PI/180;const e=Math.sin(y),s=Math.cos(y);return[(2*s+1)/3,(-Math.sqrt(3)*e-s+1)/3,(Math.sqrt(3)*e-s+1)/3]}const Bp=(y,e,s,d,g,_,S,L,P,O,k,$,N)=>{const q=S.transform;return{u_is_size_zoom_constant:+(y==="constant"||y==="source"),u_is_size_feature_constant:+(y==="constant"||y==="camera"),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:q.cameraToCenterDistance,u_pitch:q.pitch/360*2*Math.PI,u_rotate_symbol:+s,u_aspect_ratio:q.width/q.height,u_fade_change:S.options.fadeDuration?S.symbolFadeChange:1,u_label_plane_matrix:L,u_coord_matrix:P,u_is_text:+k,u_pitch_with_map:+d,u_is_along_line:g,u_is_variable_anchor:_,u_texsize:$,u_texture:0,u_translation:O,u_pitched_scale:N}},lf=(y,e,s,d,g,_,S,L,P,O,k,$,N,q)=>{const K=S.transform;return c.e(Bp(y,e,s,d,g,_,S,L,P,O,k,$,q),{u_gamma_scale:d?Math.cos(K.pitch*Math.PI/180)*K.cameraToCenterDistance:1,u_device_pixel_ratio:S.pixelRatio,u_is_halo:1})},Fp=(y,e,s,d,g,_,S,L,P,O,k,$,N)=>c.e(lf(y,e,s,d,g,_,S,L,P,O,!0,k,0,N),{u_texsize_icon:$,u_texture_icon:1}),Np=(y,e)=>({u_opacity:y,u_color:e}),cf=(y,e,s,d,g)=>c.e((function(_,S,L,P){const O=L.imageManager.getPattern(_.from.toString()),k=L.imageManager.getPattern(_.to.toString()),{width:$,height:N}=L.imageManager.getPixelSize(),q=Math.pow(2,P.tileID.overscaledZ),K=P.tileSize*Math.pow(2,L.transform.tileZoom)/q,re=K*(P.tileID.canonical.x+P.tileID.wrap*q),ae=K*P.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:O.tl,u_pattern_br_a:O.br,u_pattern_tl_b:k.tl,u_pattern_br_b:k.br,u_texsize:[$,N],u_mix:S.t,u_pattern_size_a:O.displaySize,u_pattern_size_b:k.displaySize,u_scale_a:S.fromScale,u_scale_b:S.toScale,u_tile_units_to_pixels:1/c.aC(P,1,L.transform.tileZoom),u_pixel_coord_upper:[re>>16,ae>>16],u_pixel_coord_lower:[65535&re,65535&ae]}})(s,g,e,d),{u_opacity:y}),$r=(y,e)=>{},Zo={fillExtrusion:(y,e)=>({u_lightpos:new c.bU(y,e.u_lightpos),u_lightpos_globe:new c.bU(y,e.u_lightpos_globe),u_lightintensity:new c.bg(y,e.u_lightintensity),u_lightcolor:new c.bU(y,e.u_lightcolor),u_vertical_gradient:new c.bg(y,e.u_vertical_gradient),u_opacity:new c.bg(y,e.u_opacity),u_fill_translate:new c.bV(y,e.u_fill_translate)}),fillExtrusionPattern:(y,e)=>({u_lightpos:new c.bU(y,e.u_lightpos),u_lightpos_globe:new c.bU(y,e.u_lightpos_globe),u_lightintensity:new c.bg(y,e.u_lightintensity),u_lightcolor:new c.bU(y,e.u_lightcolor),u_vertical_gradient:new c.bg(y,e.u_vertical_gradient),u_height_factor:new c.bg(y,e.u_height_factor),u_opacity:new c.bg(y,e.u_opacity),u_fill_translate:new c.bV(y,e.u_fill_translate),u_image:new c.bQ(y,e.u_image),u_texsize:new c.bV(y,e.u_texsize),u_pixel_coord_upper:new c.bV(y,e.u_pixel_coord_upper),u_pixel_coord_lower:new c.bV(y,e.u_pixel_coord_lower),u_scale:new c.bU(y,e.u_scale),u_fade:new c.bg(y,e.u_fade)}),fill:(y,e)=>({u_fill_translate:new c.bV(y,e.u_fill_translate)}),fillPattern:(y,e)=>({u_image:new c.bQ(y,e.u_image),u_texsize:new c.bV(y,e.u_texsize),u_pixel_coord_upper:new c.bV(y,e.u_pixel_coord_upper),u_pixel_coord_lower:new c.bV(y,e.u_pixel_coord_lower),u_scale:new c.bU(y,e.u_scale),u_fade:new c.bg(y,e.u_fade),u_fill_translate:new c.bV(y,e.u_fill_translate)}),fillOutline:(y,e)=>({u_world:new c.bV(y,e.u_world),u_fill_translate:new c.bV(y,e.u_fill_translate)}),fillOutlinePattern:(y,e)=>({u_world:new c.bV(y,e.u_world),u_image:new c.bQ(y,e.u_image),u_texsize:new c.bV(y,e.u_texsize),u_pixel_coord_upper:new c.bV(y,e.u_pixel_coord_upper),u_pixel_coord_lower:new c.bV(y,e.u_pixel_coord_lower),u_scale:new c.bU(y,e.u_scale),u_fade:new c.bg(y,e.u_fade),u_fill_translate:new c.bV(y,e.u_fill_translate)}),circle:(y,e)=>({u_camera_to_center_distance:new c.bg(y,e.u_camera_to_center_distance),u_scale_with_map:new c.bQ(y,e.u_scale_with_map),u_pitch_with_map:new c.bQ(y,e.u_pitch_with_map),u_extrude_scale:new c.bV(y,e.u_extrude_scale),u_device_pixel_ratio:new c.bg(y,e.u_device_pixel_ratio),u_globe_extrude_scale:new c.bg(y,e.u_globe_extrude_scale),u_translate:new c.bV(y,e.u_translate)}),collisionBox:(y,e)=>({u_pixel_extrude_scale:new c.bV(y,e.u_pixel_extrude_scale)}),collisionCircle:(y,e)=>({u_viewport_size:new c.bV(y,e.u_viewport_size)}),debug:(y,e)=>({u_color:new c.bR(y,e.u_color),u_overlay:new c.bQ(y,e.u_overlay),u_overlay_scale:new c.bg(y,e.u_overlay_scale)}),depth:$r,clippingMask:$r,heatmap:(y,e)=>({u_extrude_scale:new c.bg(y,e.u_extrude_scale),u_intensity:new c.bg(y,e.u_intensity),u_globe_extrude_scale:new c.bg(y,e.u_globe_extrude_scale)}),heatmapTexture:(y,e)=>({u_matrix:new c.bS(y,e.u_matrix),u_world:new c.bV(y,e.u_world),u_image:new c.bQ(y,e.u_image),u_color_ramp:new c.bQ(y,e.u_color_ramp),u_opacity:new c.bg(y,e.u_opacity)}),hillshade:(y,e)=>({u_image:new c.bQ(y,e.u_image),u_latrange:new c.bV(y,e.u_latrange),u_exaggeration:new c.bg(y,e.u_exaggeration),u_altitudes:new c.b$(y,e.u_altitudes),u_azimuths:new c.b$(y,e.u_azimuths),u_accent:new c.bR(y,e.u_accent),u_method:new c.bQ(y,e.u_method),u_shadows:new c.b_(y,e.u_shadows),u_highlights:new c.b_(y,e.u_highlights)}),hillshadePrepare:(y,e)=>({u_matrix:new c.bS(y,e.u_matrix),u_image:new c.bQ(y,e.u_image),u_dimension:new c.bV(y,e.u_dimension),u_zoom:new c.bg(y,e.u_zoom),u_unpack:new c.bT(y,e.u_unpack)}),colorRelief:(y,e)=>({u_image:new c.bQ(y,e.u_image),u_unpack:new c.bT(y,e.u_unpack),u_dimension:new c.bV(y,e.u_dimension),u_elevation_stops:new c.bQ(y,e.u_elevation_stops),u_color_stops:new c.bQ(y,e.u_color_stops),u_color_ramp_size:new c.bQ(y,e.u_color_ramp_size),u_opacity:new c.bg(y,e.u_opacity)}),line:(y,e)=>({u_translation:new c.bV(y,e.u_translation),u_ratio:new c.bg(y,e.u_ratio),u_device_pixel_ratio:new c.bg(y,e.u_device_pixel_ratio),u_units_to_pixels:new c.bV(y,e.u_units_to_pixels)}),lineGradient:(y,e)=>({u_translation:new c.bV(y,e.u_translation),u_ratio:new c.bg(y,e.u_ratio),u_device_pixel_ratio:new c.bg(y,e.u_device_pixel_ratio),u_units_to_pixels:new c.bV(y,e.u_units_to_pixels),u_image:new c.bQ(y,e.u_image),u_image_height:new c.bg(y,e.u_image_height)}),linePattern:(y,e)=>({u_translation:new c.bV(y,e.u_translation),u_texsize:new c.bV(y,e.u_texsize),u_ratio:new c.bg(y,e.u_ratio),u_device_pixel_ratio:new c.bg(y,e.u_device_pixel_ratio),u_image:new c.bQ(y,e.u_image),u_units_to_pixels:new c.bV(y,e.u_units_to_pixels),u_scale:new c.bU(y,e.u_scale),u_fade:new c.bg(y,e.u_fade)}),lineSDF:(y,e)=>({u_translation:new c.bV(y,e.u_translation),u_ratio:new c.bg(y,e.u_ratio),u_device_pixel_ratio:new c.bg(y,e.u_device_pixel_ratio),u_units_to_pixels:new c.bV(y,e.u_units_to_pixels),u_image:new c.bQ(y,e.u_image),u_mix:new c.bg(y,e.u_mix),u_tileratio:new c.bg(y,e.u_tileratio),u_crossfade_from:new c.bg(y,e.u_crossfade_from),u_crossfade_to:new c.bg(y,e.u_crossfade_to),u_lineatlas_width:new c.bg(y,e.u_lineatlas_width),u_lineatlas_height:new c.bg(y,e.u_lineatlas_height)}),lineGradientSDF:(y,e)=>({u_translation:new c.bV(y,e.u_translation),u_ratio:new c.bg(y,e.u_ratio),u_device_pixel_ratio:new c.bg(y,e.u_device_pixel_ratio),u_units_to_pixels:new c.bV(y,e.u_units_to_pixels),u_image:new c.bQ(y,e.u_image),u_image_height:new c.bg(y,e.u_image_height),u_tileratio:new c.bg(y,e.u_tileratio),u_crossfade_from:new c.bg(y,e.u_crossfade_from),u_crossfade_to:new c.bg(y,e.u_crossfade_to),u_image_dash:new c.bQ(y,e.u_image_dash),u_mix:new c.bg(y,e.u_mix),u_lineatlas_width:new c.bg(y,e.u_lineatlas_width),u_lineatlas_height:new c.bg(y,e.u_lineatlas_height)}),raster:(y,e)=>({u_tl_parent:new c.bV(y,e.u_tl_parent),u_scale_parent:new c.bg(y,e.u_scale_parent),u_buffer_scale:new c.bg(y,e.u_buffer_scale),u_fade_t:new c.bg(y,e.u_fade_t),u_opacity:new c.bg(y,e.u_opacity),u_image0:new c.bQ(y,e.u_image0),u_image1:new c.bQ(y,e.u_image1),u_brightness_low:new c.bg(y,e.u_brightness_low),u_brightness_high:new c.bg(y,e.u_brightness_high),u_saturation_factor:new c.bg(y,e.u_saturation_factor),u_contrast_factor:new c.bg(y,e.u_contrast_factor),u_spin_weights:new c.bU(y,e.u_spin_weights),u_coords_top:new c.bT(y,e.u_coords_top),u_coords_bottom:new c.bT(y,e.u_coords_bottom)}),symbolIcon:(y,e)=>({u_is_size_zoom_constant:new c.bQ(y,e.u_is_size_zoom_constant),u_is_size_feature_constant:new c.bQ(y,e.u_is_size_feature_constant),u_size_t:new c.bg(y,e.u_size_t),u_size:new c.bg(y,e.u_size),u_camera_to_center_distance:new c.bg(y,e.u_camera_to_center_distance),u_pitch:new c.bg(y,e.u_pitch),u_rotate_symbol:new c.bQ(y,e.u_rotate_symbol),u_aspect_ratio:new c.bg(y,e.u_aspect_ratio),u_fade_change:new c.bg(y,e.u_fade_change),u_label_plane_matrix:new c.bS(y,e.u_label_plane_matrix),u_coord_matrix:new c.bS(y,e.u_coord_matrix),u_is_text:new c.bQ(y,e.u_is_text),u_pitch_with_map:new c.bQ(y,e.u_pitch_with_map),u_is_along_line:new c.bQ(y,e.u_is_along_line),u_is_variable_anchor:new c.bQ(y,e.u_is_variable_anchor),u_texsize:new c.bV(y,e.u_texsize),u_texture:new c.bQ(y,e.u_texture),u_translation:new c.bV(y,e.u_translation),u_pitched_scale:new c.bg(y,e.u_pitched_scale)}),symbolSDF:(y,e)=>({u_is_size_zoom_constant:new c.bQ(y,e.u_is_size_zoom_constant),u_is_size_feature_constant:new c.bQ(y,e.u_is_size_feature_constant),u_size_t:new c.bg(y,e.u_size_t),u_size:new c.bg(y,e.u_size),u_camera_to_center_distance:new c.bg(y,e.u_camera_to_center_distance),u_pitch:new c.bg(y,e.u_pitch),u_rotate_symbol:new c.bQ(y,e.u_rotate_symbol),u_aspect_ratio:new c.bg(y,e.u_aspect_ratio),u_fade_change:new c.bg(y,e.u_fade_change),u_label_plane_matrix:new c.bS(y,e.u_label_plane_matrix),u_coord_matrix:new c.bS(y,e.u_coord_matrix),u_is_text:new c.bQ(y,e.u_is_text),u_pitch_with_map:new c.bQ(y,e.u_pitch_with_map),u_is_along_line:new c.bQ(y,e.u_is_along_line),u_is_variable_anchor:new c.bQ(y,e.u_is_variable_anchor),u_texsize:new c.bV(y,e.u_texsize),u_texture:new c.bQ(y,e.u_texture),u_gamma_scale:new c.bg(y,e.u_gamma_scale),u_device_pixel_ratio:new c.bg(y,e.u_device_pixel_ratio),u_is_halo:new c.bQ(y,e.u_is_halo),u_translation:new c.bV(y,e.u_translation),u_pitched_scale:new c.bg(y,e.u_pitched_scale)}),symbolTextAndIcon:(y,e)=>({u_is_size_zoom_constant:new c.bQ(y,e.u_is_size_zoom_constant),u_is_size_feature_constant:new c.bQ(y,e.u_is_size_feature_constant),u_size_t:new c.bg(y,e.u_size_t),u_size:new c.bg(y,e.u_size),u_camera_to_center_distance:new c.bg(y,e.u_camera_to_center_distance),u_pitch:new c.bg(y,e.u_pitch),u_rotate_symbol:new c.bQ(y,e.u_rotate_symbol),u_aspect_ratio:new c.bg(y,e.u_aspect_ratio),u_fade_change:new c.bg(y,e.u_fade_change),u_label_plane_matrix:new c.bS(y,e.u_label_plane_matrix),u_coord_matrix:new c.bS(y,e.u_coord_matrix),u_is_text:new c.bQ(y,e.u_is_text),u_pitch_with_map:new c.bQ(y,e.u_pitch_with_map),u_is_along_line:new c.bQ(y,e.u_is_along_line),u_is_variable_anchor:new c.bQ(y,e.u_is_variable_anchor),u_texsize:new c.bV(y,e.u_texsize),u_texsize_icon:new c.bV(y,e.u_texsize_icon),u_texture:new c.bQ(y,e.u_texture),u_texture_icon:new c.bQ(y,e.u_texture_icon),u_gamma_scale:new c.bg(y,e.u_gamma_scale),u_device_pixel_ratio:new c.bg(y,e.u_device_pixel_ratio),u_is_halo:new c.bQ(y,e.u_is_halo),u_translation:new c.bV(y,e.u_translation),u_pitched_scale:new c.bg(y,e.u_pitched_scale)}),background:(y,e)=>({u_opacity:new c.bg(y,e.u_opacity),u_color:new c.bR(y,e.u_color)}),backgroundPattern:(y,e)=>({u_opacity:new c.bg(y,e.u_opacity),u_image:new c.bQ(y,e.u_image),u_pattern_tl_a:new c.bV(y,e.u_pattern_tl_a),u_pattern_br_a:new c.bV(y,e.u_pattern_br_a),u_pattern_tl_b:new c.bV(y,e.u_pattern_tl_b),u_pattern_br_b:new c.bV(y,e.u_pattern_br_b),u_texsize:new c.bV(y,e.u_texsize),u_mix:new c.bg(y,e.u_mix),u_pattern_size_a:new c.bV(y,e.u_pattern_size_a),u_pattern_size_b:new c.bV(y,e.u_pattern_size_b),u_scale_a:new c.bg(y,e.u_scale_a),u_scale_b:new c.bg(y,e.u_scale_b),u_pixel_coord_upper:new c.bV(y,e.u_pixel_coord_upper),u_pixel_coord_lower:new c.bV(y,e.u_pixel_coord_lower),u_tile_units_to_pixels:new c.bg(y,e.u_tile_units_to_pixels)}),terrain:(y,e)=>({u_texture:new c.bQ(y,e.u_texture),u_ele_delta:new c.bg(y,e.u_ele_delta),u_fog_matrix:new c.bS(y,e.u_fog_matrix),u_fog_color:new c.bR(y,e.u_fog_color),u_fog_ground_blend:new c.bg(y,e.u_fog_ground_blend),u_fog_ground_blend_opacity:new c.bg(y,e.u_fog_ground_blend_opacity),u_horizon_color:new c.bR(y,e.u_horizon_color),u_horizon_fog_blend:new c.bg(y,e.u_horizon_fog_blend),u_is_globe_mode:new c.bg(y,e.u_is_globe_mode)}),terrainDepth:(y,e)=>({u_ele_delta:new c.bg(y,e.u_ele_delta)}),terrainCoords:(y,e)=>({u_texture:new c.bQ(y,e.u_texture),u_terrain_coords_id:new c.bg(y,e.u_terrain_coords_id),u_ele_delta:new c.bg(y,e.u_ele_delta)}),projectionErrorMeasurement:(y,e)=>({u_input:new c.bg(y,e.u_input),u_output_expected:new c.bg(y,e.u_output_expected)}),atmosphere:(y,e)=>({u_sun_pos:new c.bU(y,e.u_sun_pos),u_atmosphere_blend:new c.bg(y,e.u_atmosphere_blend),u_globe_position:new c.bU(y,e.u_globe_position),u_globe_radius:new c.bg(y,e.u_globe_radius),u_inv_proj_matrix:new c.bS(y,e.u_inv_proj_matrix)}),sky:(y,e)=>({u_sky_color:new c.bR(y,e.u_sky_color),u_horizon_color:new c.bR(y,e.u_horizon_color),u_horizon:new c.bV(y,e.u_horizon),u_horizon_normal:new c.bV(y,e.u_horizon_normal),u_sky_horizon_blend:new c.bg(y,e.u_sky_horizon_blend),u_sky_blend:new c.bg(y,e.u_sky_blend)})};class Rs{constructor(e,s,d){this.context=e;const g=e.gl;this.buffer=g.createBuffer(),this.dynamicDraw=!!d,this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),g.bufferData(g.ELEMENT_ARRAY_BUFFER,s.arrayBuffer,this.dynamicDraw?g.DYNAMIC_DRAW:g.STATIC_DRAW),this.dynamicDraw||delete s.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(e){const s=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),s.bufferSubData(s.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const kh={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Bh{constructor(e,s,d,g){this.length=s.length,this.attributes=d,this.itemSize=s.bytesPerElement,this.dynamicDraw=g,this.context=e;const _=e.gl;this.buffer=_.createBuffer(),e.bindVertexBuffer.set(this.buffer),_.bufferData(_.ARRAY_BUFFER,s.arrayBuffer,this.dynamicDraw?_.DYNAMIC_DRAW:_.STATIC_DRAW),this.dynamicDraw||delete s.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(e){if(e.length!==this.length)throw new Error(`Length of new data is ${e.length}, which doesn't match current length of ${this.length}`);const s=this.context.gl;this.bind(),s.bufferSubData(s.ARRAY_BUFFER,0,e.arrayBuffer)}enableAttributes(e,s){for(let d=0;d<this.attributes.length;d++){const g=s.attributes[this.attributes[d].name];g!==void 0&&e.enableVertexAttribArray(g)}}setVertexAttribPointers(e,s,d){for(let g=0;g<this.attributes.length;g++){const _=this.attributes[g],S=s.attributes[_.name];S!==void 0&&e.vertexAttribPointer(S,_.components,e[kh[_.type]],!1,this.itemSize,_.offset+this.itemSize*(d||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class Ln{constructor(e){this.gl=e.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(e){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class Fh extends Ln{getDefault(){return c.bf.transparent}set(e){const s=this.current;(e.r!==s.r||e.g!==s.g||e.b!==s.b||e.a!==s.a||this.dirty)&&(this.gl.clearColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class uf extends Ln{getDefault(){return 1}set(e){(e!==this.current||this.dirty)&&(this.gl.clearDepth(e),this.current=e,this.dirty=!1)}}class $a extends Ln{getDefault(){return 0}set(e){(e!==this.current||this.dirty)&&(this.gl.clearStencil(e),this.current=e,this.dirty=!1)}}class wu extends Ln{getDefault(){return[!0,!0,!0,!0]}set(e){const s=this.current;(e[0]!==s[0]||e[1]!==s[1]||e[2]!==s[2]||e[3]!==s[3]||this.dirty)&&(this.gl.colorMask(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class Su extends Ln{getDefault(){return!0}set(e){(e!==this.current||this.dirty)&&(this.gl.depthMask(e),this.current=e,this.dirty=!1)}}class hf extends Ln{getDefault(){return 255}set(e){(e!==this.current||this.dirty)&&(this.gl.stencilMask(e),this.current=e,this.dirty=!1)}}class Up extends Ln{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(e){const s=this.current;(e.func!==s.func||e.ref!==s.ref||e.mask!==s.mask||this.dirty)&&(this.gl.stencilFunc(e.func,e.ref,e.mask),this.current=e,this.dirty=!1)}}class Il extends Ln{getDefault(){const e=this.gl;return[e.KEEP,e.KEEP,e.KEEP]}set(e){const s=this.current;(e[0]!==s[0]||e[1]!==s[1]||e[2]!==s[2]||this.dirty)&&(this.gl.stencilOp(e[0],e[1],e[2]),this.current=e,this.dirty=!1)}}class zl extends Ln{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const s=this.gl;e?s.enable(s.STENCIL_TEST):s.disable(s.STENCIL_TEST),this.current=e,this.dirty=!1}}class df extends Ln{getDefault(){return[0,1]}set(e){const s=this.current;(e[0]!==s[0]||e[1]!==s[1]||this.dirty)&&(this.gl.depthRange(e[0],e[1]),this.current=e,this.dirty=!1)}}class ff extends Ln{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const s=this.gl;e?s.enable(s.DEPTH_TEST):s.disable(s.DEPTH_TEST),this.current=e,this.dirty=!1}}class Is extends Ln{getDefault(){return this.gl.LESS}set(e){(e!==this.current||this.dirty)&&(this.gl.depthFunc(e),this.current=e,this.dirty=!1)}}class Cu extends Ln{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const s=this.gl;e?s.enable(s.BLEND):s.disable(s.BLEND),this.current=e,this.dirty=!1}}class Tu extends Ln{getDefault(){const e=this.gl;return[e.ONE,e.ZERO]}set(e){const s=this.current;(e[0]!==s[0]||e[1]!==s[1]||this.dirty)&&(this.gl.blendFunc(e[0],e[1]),this.current=e,this.dirty=!1)}}class Nh extends Ln{getDefault(){return c.bf.transparent}set(e){const s=this.current;(e.r!==s.r||e.g!==s.g||e.b!==s.b||e.a!==s.a||this.dirty)&&(this.gl.blendColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class Dl extends Ln{getDefault(){return this.gl.FUNC_ADD}set(e){(e!==this.current||this.dirty)&&(this.gl.blendEquation(e),this.current=e,this.dirty=!1)}}class Eu extends Ln{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const s=this.gl;e?s.enable(s.CULL_FACE):s.disable(s.CULL_FACE),this.current=e,this.dirty=!1}}class Rc extends Ln{getDefault(){return this.gl.BACK}set(e){(e!==this.current||this.dirty)&&(this.gl.cullFace(e),this.current=e,this.dirty=!1)}}class pa extends Ln{getDefault(){return this.gl.CCW}set(e){(e!==this.current||this.dirty)&&(this.gl.frontFace(e),this.current=e,this.dirty=!1)}}class pf extends Ln{getDefault(){return null}set(e){(e!==this.current||this.dirty)&&(this.gl.useProgram(e),this.current=e,this.dirty=!1)}}class Uh extends Ln{getDefault(){return this.gl.TEXTURE0}set(e){(e!==this.current||this.dirty)&&(this.gl.activeTexture(e),this.current=e,this.dirty=!1)}}class ma extends Ln{getDefault(){const e=this.gl;return[0,0,e.drawingBufferWidth,e.drawingBufferHeight]}set(e){const s=this.current;(e[0]!==s[0]||e[1]!==s[1]||e[2]!==s[2]||e[3]!==s[3]||this.dirty)&&(this.gl.viewport(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class zs extends Ln{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const s=this.gl;s.bindFramebuffer(s.FRAMEBUFFER,e),this.current=e,this.dirty=!1}}class Vr extends Ln{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const s=this.gl;s.bindRenderbuffer(s.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class to extends Ln{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const s=this.gl;s.bindTexture(s.TEXTURE_2D,e),this.current=e,this.dirty=!1}}class Ol extends Ln{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const s=this.gl;s.bindBuffer(s.ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class kl extends Ln{getDefault(){return null}set(e){const s=this.gl;s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class Mu extends Ln{getDefault(){return null}set(e){var s;if(e===this.current&&!this.dirty)return;const d=this.gl;Ii(d)?d.bindVertexArray(e):(s=d.getExtension("OES_vertex_array_object"))===null||s===void 0||s.bindVertexArrayOES(e),this.current=e,this.dirty=!1}}class Go extends Ln{getDefault(){return 4}set(e){if(e===this.current&&!this.dirty)return;const s=this.gl;s.pixelStorei(s.UNPACK_ALIGNMENT,e),this.current=e,this.dirty=!1}}class Va extends Ln{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const s=this.gl;s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e),this.current=e,this.dirty=!1}}class mf extends Ln{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const s=this.gl;s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,e),this.current=e,this.dirty=!1}}class qo extends Ln{constructor(e,s){super(e),this.context=e,this.parent=s}getDefault(){return null}}class hn extends qo{setDirty(){this.dirty=!0}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const s=this.gl;s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}}class $h extends qo{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const s=this.gl;s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class ga extends qo{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const s=this.gl;s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,e),this.current=e,this.dirty=!1}}const Au="Framebuffer is not complete";class ya{constructor(e,s,d,g,_){this.context=e,this.width=s,this.height=d;const S=e.gl,L=this.framebuffer=S.createFramebuffer();if(this.colorAttachment=new hn(e,L),g)this.depthAttachment=_?new ga(e,L):new $h(e,L);else if(_)throw new Error("Stencil cannot be set without depth");if(S.checkFramebufferStatus(S.FRAMEBUFFER)!==S.FRAMEBUFFER_COMPLETE)throw new Error(Au)}destroy(){const e=this.context.gl,s=this.colorAttachment.get();if(s&&e.deleteTexture(s),this.depthAttachment){const d=this.depthAttachment.get();d&&e.deleteRenderbuffer(d)}e.deleteFramebuffer(this.framebuffer)}}class $p{constructor(e){var s,d;if(this.gl=e,this.clearColor=new Fh(this),this.clearDepth=new uf(this),this.clearStencil=new $a(this),this.colorMask=new wu(this),this.depthMask=new Su(this),this.stencilMask=new hf(this),this.stencilFunc=new Up(this),this.stencilOp=new Il(this),this.stencilTest=new zl(this),this.depthRange=new df(this),this.depthTest=new ff(this),this.depthFunc=new Is(this),this.blend=new Cu(this),this.blendFunc=new Tu(this),this.blendColor=new Nh(this),this.blendEquation=new Dl(this),this.cullFace=new Eu(this),this.cullFaceSide=new Rc(this),this.frontFace=new pa(this),this.program=new pf(this),this.activeTexture=new Uh(this),this.viewport=new ma(this),this.bindFramebuffer=new zs(this),this.bindRenderbuffer=new Vr(this),this.bindTexture=new to(this),this.bindVertexBuffer=new Ol(this),this.bindElementBuffer=new kl(this),this.bindVertexArray=new Mu(this),this.pixelStoreUnpack=new Go(this),this.pixelStoreUnpackPremultiplyAlpha=new Va(this),this.pixelStoreUnpackFlipY=new mf(this),this.extTextureFilterAnisotropic=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=e.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),Ii(e)){this.HALF_FLOAT=e.HALF_FLOAT;const g=e.getExtension("EXT_color_buffer_half_float");this.RGBA16F=(s=e.RGBA16F)!==null&&s!==void 0?s:g==null?void 0:g.RGBA16F_EXT,this.RGB16F=(d=e.RGB16F)!==null&&d!==void 0?d:g==null?void 0:g.RGB16F_EXT,e.getExtension("EXT_color_buffer_float")}else{e.getExtension("EXT_color_buffer_half_float"),e.getExtension("OES_texture_half_float_linear");const g=e.getExtension("OES_texture_half_float");this.HALF_FLOAT=g==null?void 0:g.HALF_FLOAT_OES}}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(e,s){return new Rs(this,e,s)}createVertexBuffer(e,s,d){return new Bh(this,e,s,d)}createRenderbuffer(e,s,d){const g=this.gl,_=g.createRenderbuffer();return this.bindRenderbuffer.set(_),g.renderbufferStorage(g.RENDERBUFFER,e,s,d),this.bindRenderbuffer.set(null),_}createFramebuffer(e,s,d,g){return new ya(this,e,s,d,g)}clear({color:e,depth:s,stencil:d}){const g=this.gl;let _=0;e&&(_|=g.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),s!==void 0&&(_|=g.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(s),this.depthMask.set(!0)),d!==void 0&&(_|=g.STENCIL_BUFFER_BIT,this.clearStencil.set(d),this.stencilMask.set(255)),g.clear(_)}setCullFace(e){e.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(e.mode),this.frontFace.set(e.frontFace))}setDepthMode(e){e.func!==this.gl.ALWAYS||e.mask?(this.depthTest.set(!0),this.depthFunc.set(e.func),this.depthMask.set(e.mask),this.depthRange.set(e.range)):this.depthTest.set(!1)}setStencilMode(e){e.test.func!==this.gl.ALWAYS||e.mask?(this.stencilTest.set(!0),this.stencilMask.set(e.mask),this.stencilOp.set([e.fail,e.depthFail,e.pass]),this.stencilFunc.set({func:e.test.func,ref:e.ref,mask:e.test.mask})):this.stencilTest.set(!1)}setColorMode(e){c.bH(e.blendFunction,Zn.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)}createVertexArray(){var e;return Ii(this.gl)?this.gl.createVertexArray():(e=this.gl.getExtension("OES_vertex_array_object"))===null||e===void 0?void 0:e.createVertexArrayOES()}deleteVertexArray(e){var s;return Ii(this.gl)?this.gl.deleteVertexArray(e):(s=this.gl.getExtension("OES_vertex_array_object"))===null||s===void 0?void 0:s.deleteVertexArrayOES(e)}unbindVAO(){this.bindVertexArray.set(null)}}let Bl;function no(y,e,s,d,g){const _=y.context,S=y.transform,L=_.gl,P=y.useProgram("collisionBox"),O=[];let k=0,$=0;for(let se=0;se<d.length;se++){const ce=d[se],de=e.getTile(ce).getBucket(s);if(!de)continue;const ue=g?de.textCollisionBox:de.iconCollisionBox,_e=de.collisionCircleArray;_e.length>0&&(O.push({circleArray:_e,circleOffset:$,coord:ce}),k+=_e.length/4,$=k),ue&&P.draw(_,L.LINES,Yt.disabled,un.disabled,y.colorModeForRenderPass(),gn.disabled,zp(y.transform),y.style.map.terrain&&y.style.map.terrain.getTerrainData(ce),S.getProjectionData({overscaledTileID:ce,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),s.id,ue.layoutVertexBuffer,ue.indexBuffer,ue.segments,null,y.transform.zoom,null,null,ue.collisionVertexBuffer)}if(!g||!O.length)return;const N=y.useProgram("collisionCircle"),q=new c.c0;q.resize(4*k),q._trim();let K=0;for(const se of O)for(let ce=0;ce<se.circleArray.length/4;ce++){const de=4*ce,ue=se.circleArray[de+0],_e=se.circleArray[de+1],be=se.circleArray[de+2],fe=se.circleArray[de+3];q.emplace(K++,ue,_e,be,fe,0),q.emplace(K++,ue,_e,be,fe,1),q.emplace(K++,ue,_e,be,fe,2),q.emplace(K++,ue,_e,be,fe,3)}(!Bl||Bl.length<2*k)&&(Bl=(function(se){const ce=2*se,de=new c.c2;de.resize(ce),de._trim();for(let ue=0;ue<ce;ue++){const _e=6*ue;de.uint16[_e+0]=4*ue+0,de.uint16[_e+1]=4*ue+1,de.uint16[_e+2]=4*ue+2,de.uint16[_e+3]=4*ue+2,de.uint16[_e+4]=4*ue+3,de.uint16[_e+5]=4*ue+0}return de})(k));const re=_.createIndexBuffer(Bl,!0),ae=_.createVertexBuffer(q,c.c1.members,!0);for(const se of O){const ce=ss(y.transform);N.draw(_,L.TRIANGLES,Yt.disabled,un.disabled,y.colorModeForRenderPass(),gn.disabled,ce,y.style.map.terrain&&y.style.map.terrain.getTerrainData(se.coord),null,s.id,ae,re,c.aM.simpleSegment(0,2*se.circleOffset,se.circleArray.length,se.circleArray.length/2),null,y.transform.zoom,null,null,null)}ae.destroy(),re.destroy()}const gf=c.ag(new Float32Array(16));function Vh(y,e,s,d,g,_){const{horizontalAlign:S,verticalAlign:L}=c.aH(y);return new c.P((-(S-.5)*e/g+d[0])*_,(-(L-.5)*s/g+d[1])*_)}function Ic(y,e,s,d,g,_){const S=e.tileAnchorPoint.add(new c.P(e.translation[0],e.translation[1]));if(e.pitchWithMap){let L=d.mult(_);s||(L=L.rotate(-g));const P=S.add(L);return rt(P.x,P.y,e.pitchedLabelPlaneMatrix,e.getElevation).point}if(s){const L=Cs(e.tileAnchorPoint.x+1,e.tileAnchorPoint.y,e).point.sub(y),P=Math.atan(L.y/L.x)+(L.x<0?Math.PI:0);return y.add(d.rotate(P))}return y.add(d)}function Lu(y,e,s,d,g,_,S,L,P,O,k,$){const N=y.text.placedSymbolArray,q=y.text.dynamicLayoutVertexArray,K=y.icon.dynamicLayoutVertexArray,re={};q.clear();for(let ae=0;ae<N.length;ae++){const se=N.get(ae),ce=se.hidden||!se.crossTileID||y.allowVerticalPlacement&&!se.placedOrientation?null:d[se.crossTileID];if(ce){const de=new c.P(se.anchorX,se.anchorY),ue={getElevation:$,width:g.width,height:g.height,pitchedLabelPlaneMatrix:_,pitchWithMap:s,transform:g,tileAnchorPoint:de,translation:O,unwrappedTileID:k},_e=s?rn(de.x,de.y,ue):Cs(de.x,de.y,ue),be=is(g.cameraToCenterDistance,_e.signedDistanceFromCamera);let fe=c.ap(y.textSizeData,L,se)*be/c.aB;s&&(fe*=y.tilePixelRatio/S);const{width:Ee,height:Ve,anchor:ke,textOffset:Ne,textBoxScale:Ue}=ce,ht=Vh(ke,Ee,Ve,Ne,Ue,fe),dt=g.getPitchedTextCorrection(de.x+O[0],de.y+O[1],k),tt=Ic(_e.point,ue,e,ht,-g.bearingInRadians,dt),It=y.allowVerticalPlacement&&se.placedOrientation===c.ao.vertical?Math.PI/2:0;for(let en=0;en<se.numGlyphs;en++)c.av(q,tt,It);P&&se.associatedIconIndex>=0&&(re[se.associatedIconIndex]={shiftedAnchor:tt,angle:It})}else Qr(se.numGlyphs,q)}if(P){K.clear();const ae=y.icon.placedSymbolArray;for(let se=0;se<ae.length;se++){const ce=ae.get(se);if(ce.hidden)Qr(ce.numGlyphs,K);else{const de=re[se];if(de)for(let ue=0;ue<ce.numGlyphs;ue++)c.av(K,de.shiftedAnchor,de.angle);else Qr(ce.numGlyphs,K)}}y.icon.dynamicLayoutVertexBuffer.updateData(K)}y.text.dynamicLayoutVertexBuffer.updateData(q)}function jr(y,e,s){return s.iconsInText&&e?"symbolTextAndIcon":y?"symbolSDF":"symbolIcon"}function io(y,e,s,d,g,_,S,L,P,O,k,$,N){const q=y.context,K=q.gl,re=y.transform,ae=L==="map",se=P==="map",ce=L!=="viewport"&&s.layout.get("symbol-placement")!=="point",de=ae&&!se&&!ce,ue=!s.layout.get("symbol-sort-key").isConstant();let _e=!1;const be=y.getDepthModeForSublayer(0,Yt.ReadOnly),fe=s._unevaluatedLayout.hasValue("text-variable-anchor")||s._unevaluatedLayout.hasValue("text-variable-anchor-offset"),Ee=[],Ve=re.getCircleRadiusCorrection();for(const ke of d){const Ne=e.getTile(ke),Ue=Ne.getBucket(s);if(!Ue)continue;const ht=g?Ue.text:Ue.icon;if(!ht||!ht.segments.get().length||!ht.hasVisibleVertices)continue;const dt=ht.programConfigurations.get(s.id),tt=g||Ue.sdfIcons,It=g?Ue.textSizeData:Ue.iconSizeData,en=se||re.pitch!==0,Mn=y.useProgram(jr(tt,g,Ue),dt),Nn=c.an(It,re.zoom),Un=y.style.map.terrain&&y.style.map.terrain.getTerrainData(ke);let hi,ii,yn,vi,_r=[0,0],zi=null;if(g)ii=Ne.glyphAtlasTexture,yn=K.LINEAR,hi=Ne.glyphAtlasTexture.size,Ue.iconsInText&&(_r=Ne.imageAtlasTexture.size,zi=Ne.imageAtlasTexture,vi=en||y.options.rotating||y.options.zooming||It.kind==="composite"||It.kind==="camera"?K.LINEAR:K.NEAREST);else{const Si=s.layout.get("icon-size").constantOr(0)!==1||Ue.iconsNeedLinear;ii=Ne.imageAtlasTexture,yn=tt||y.options.rotating||y.options.zooming||Si||en?K.LINEAR:K.NEAREST,hi=Ne.imageAtlasTexture.size}const Di=c.aC(Ne,1,y.transform.zoom),Ir=Kn(ae,y.transform,Di),po=c.L();c.aq(po,Ir);const Sa=Gi(se,ae,y.transform,Di),mo=c.aD(re,Ne,_,S),ll=re.getProjectionData({overscaledTileID:ke,applyGlobeMatrix:!N,applyTerrainMatrix:!0}),Uc=fe&&Ue.hasTextData(),Xl=s.layout.get("icon-text-fit")!=="none"&&Uc&&Ue.hasIconData();if(ce){const Si=y.style.map.terrain?(na,vr)=>y.style.map.terrain.getElevation(ke,na,vr):null,Xi=s.layout.get("text-rotation-alignment")==="map";qi(Ue,y,g,Ir,po,se,O,Xi,ke.toUnwrapped(),re.width,re.height,mo,Si)}const Us=g&&fe||Xl,Ca=ce||Us?gf:se?Ir:y.transform.clipSpaceToPixelsMatrix,qa=tt&&s.paint.get(g?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let ps;ps=tt?Ue.iconsInText?Fp(It.kind,Nn,de,se,ce,Us,y,Ca,Sa,mo,hi,_r,Ve):lf(It.kind,Nn,de,se,ce,Us,y,Ca,Sa,mo,g,hi,0,Ve):Bp(It.kind,Nn,de,se,ce,Us,y,Ca,Sa,mo,g,hi,Ve);const ta={program:Mn,buffers:ht,uniformValues:ps,projectionData:ll,atlasTexture:ii,atlasTextureIcon:zi,atlasInterpolation:yn,atlasInterpolationIcon:vi,isSDF:tt,hasHalo:qa};if(ue&&Ue.canOverlap){_e=!0;const Si=ht.segments.get();for(const Xi of Si)Ee.push({segments:new c.aM([Xi]),sortKey:Xi.sortKey,state:ta,terrainData:Un})}else Ee.push({segments:ht.segments,sortKey:0,state:ta,terrainData:Un})}_e&&Ee.sort(((ke,Ne)=>ke.sortKey-Ne.sortKey));for(const ke of Ee){const Ne=ke.state;if(q.activeTexture.set(K.TEXTURE0),Ne.atlasTexture.bind(Ne.atlasInterpolation,K.CLAMP_TO_EDGE),Ne.atlasTextureIcon&&(q.activeTexture.set(K.TEXTURE1),Ne.atlasTextureIcon&&Ne.atlasTextureIcon.bind(Ne.atlasInterpolationIcon,K.CLAMP_TO_EDGE)),Ne.isSDF){const Ue=Ne.uniformValues;Ne.hasHalo&&(Ue.u_is_halo=1,Ho(Ne.buffers,ke.segments,s,y,Ne.program,be,k,$,Ue,Ne.projectionData,ke.terrainData)),Ue.u_is_halo=0}Ho(Ne.buffers,ke.segments,s,y,Ne.program,be,k,$,Ne.uniformValues,Ne.projectionData,ke.terrainData)}}function Ho(y,e,s,d,g,_,S,L,P,O,k){const $=d.context;g.draw($,$.gl.TRIANGLES,_,S,L,gn.backCCW,P,k,O,s.id,y.layoutVertexBuffer,y.indexBuffer,e,s.paint,d.transform.zoom,y.programConfigurations.get(s.id),y.dynamicLayoutVertexBuffer,y.opacityVertexBuffer)}function Fl(y,e,s,d,g){const _=y.context,S=_.gl,L=un.disabled,P=new Zn([S.ONE,S.ONE],c.bf.transparent,[!0,!0,!0,!0]),O=e.getBucket(s);if(!O)return;const k=d.key;let $=s.heatmapFbos.get(k);$||($=Pr(_,e.tileSize,e.tileSize),s.heatmapFbos.set(k,$)),_.bindFramebuffer.set($.framebuffer),_.viewport.set([0,0,e.tileSize,e.tileSize]),_.clear({color:c.bf.transparent});const N=O.programConfigurations.get(s.id),q=y.useProgram("heatmap",N,!g),K=y.transform.getProjectionData({overscaledTileID:e.tileID,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),re=y.style.map.terrain.getTerrainData(d);q.draw(_,S.TRIANGLES,Yt.disabled,L,P,gn.disabled,rf(e,y.transform.zoom,s.paint.get("heatmap-intensity"),1),re,K,s.id,O.layoutVertexBuffer,O.indexBuffer,O.segments,s.paint,y.transform.zoom,N)}function Xo(y,e,s,d,g){const _=y.context,S=_.gl,L=y.transform;_.setColorMode(y.colorModeForRenderPass());const P=mr(_,e),O=s.key,k=e.heatmapFbos.get(O);if(!k)return;_.activeTexture.set(S.TEXTURE0),S.bindTexture(S.TEXTURE_2D,k.colorAttachment.get()),_.activeTexture.set(S.TEXTURE1),P.bind(S.LINEAR,S.CLAMP_TO_EDGE);const $=L.getProjectionData({overscaledTileID:s,applyTerrainMatrix:g,applyGlobeMatrix:!d});y.useProgram("heatmapTexture").draw(_,S.TRIANGLES,Yt.disabled,un.disabled,y.colorModeForRenderPass(),gn.disabled,Op(y,e,0,1),null,$,e.id,y.rasterBoundsBuffer,y.quadTriangleIndexBuffer,y.rasterBoundsSegments,e.paint,L.zoom),k.destroy(),e.heatmapFbos.delete(O)}function Pr(y,e,s){var d,g;const _=y.gl,S=_.createTexture();_.bindTexture(_.TEXTURE_2D,S),_.texParameteri(_.TEXTURE_2D,_.TEXTURE_WRAP_S,_.CLAMP_TO_EDGE),_.texParameteri(_.TEXTURE_2D,_.TEXTURE_WRAP_T,_.CLAMP_TO_EDGE),_.texParameteri(_.TEXTURE_2D,_.TEXTURE_MIN_FILTER,_.LINEAR),_.texParameteri(_.TEXTURE_2D,_.TEXTURE_MAG_FILTER,_.LINEAR);const L=(d=y.HALF_FLOAT)!==null&&d!==void 0?d:_.UNSIGNED_BYTE,P=(g=y.RGBA16F)!==null&&g!==void 0?g:_.RGBA;_.texImage2D(_.TEXTURE_2D,0,P,e,s,0,_.RGBA,L,null);const O=y.createFramebuffer(e,s,!1,!1);return O.colorAttachment.set(S),O}function mr(y,e){return e.colorRampTexture||(e.colorRampTexture=new c.T(y,e.colorRamp,y.gl.RGBA)),e.colorRampTexture}function os(y,e,s,d,g,_,S,L){let P=256;if(g.stepInterpolant){const O=e.getSource().maxzoom,k=S.canonical.z===O?Math.ceil(1<<y.transform.maxZoom-S.canonical.z):1;P=c.ah(c.c4(_.maxLineLength/c.$*1024*k),256,s.maxTextureSize)}return L.gradient=c.c5({expression:g.gradientExpression(),evaluationKey:"lineProgress",resolution:P,image:L.gradient||void 0,clips:_.lineClipsArray}),L.texture?L.texture.update(L.gradient):L.texture=new c.T(s,L.gradient,d.RGBA),L.version=g.gradientVersion,L.texture}function Ds(y,e,s,d,g){y.activeTexture.set(e.TEXTURE0),s.imageAtlasTexture.bind(e.LINEAR,e.CLAMP_TO_EDGE),d.updatePaintBuffers(g)}function Kr(y,e,s,d,g,_){(g||y.lineAtlas.dirty)&&(e.activeTexture.set(s.TEXTURE0),y.lineAtlas.bind(e)),d.updatePaintBuffers(_)}function ro(y,e,s,d,g,_,S){const L=_.gradients[g.id];let P=L.texture;g.gradientVersion!==L.version&&(P=os(y,e,s,d,g,_,S,L)),s.activeTexture.set(d.TEXTURE0),P.bind(g.stepInterpolant?d.NEAREST:d.LINEAR,d.CLAMP_TO_EDGE)}function yf(y,e,s,d,g,_,S,L,P){const O=_.gradients[g.id];let k=O.texture;g.gradientVersion!==O.version&&(k=os(y,e,s,d,g,_,S,O)),s.activeTexture.set(d.TEXTURE0),k.bind(g.stepInterpolant?d.NEAREST:d.LINEAR,d.CLAMP_TO_EDGE),s.activeTexture.set(d.TEXTURE1),y.lineAtlas.bind(s),L.updatePaintBuffers(P)}function Nl(y,e,s,d,g){if(!s||!d||!d.imageAtlas)return;const _=d.imageAtlas.patternPositions;let S=_[s.to.toString()],L=_[s.from.toString()];if(!S&&L&&(S=L),!L&&S&&(L=S),!S||!L){const P=g.getPaintProperty(e);S=_[P],L=_[P]}S&&L&&y.setConstantPatternPositions(S,L)}function zc(y,e,s,d,g,_,S,L){const P=y.context.gl,O="fill-pattern",k=s.paint.get(O),$=k&&k.constantOr(1),N=s.getCrossfadeParameters();let q,K,re,ae,se;const ce=y.transform,de=s.paint.get("fill-translate"),ue=s.paint.get("fill-translate-anchor");S?(K=$&&!s.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",q=P.LINES):(K=$?"fillPattern":"fill",q=P.TRIANGLES);const _e=k.constantOr(null);for(const be of d){const fe=e.getTile(be);if($&&!fe.patternsLoaded())continue;const Ee=fe.getBucket(s);if(!Ee)continue;const Ve=Ee.programConfigurations.get(s.id),ke=y.useProgram(K,Ve),Ne=y.style.map.terrain&&y.style.map.terrain.getTerrainData(be);$&&(y.context.activeTexture.set(P.TEXTURE0),fe.imageAtlasTexture.bind(P.LINEAR,P.CLAMP_TO_EDGE),Ve.updatePaintBuffers(N)),Nl(Ve,O,_e,fe,s);const Ue=ce.getProjectionData({overscaledTileID:be,applyGlobeMatrix:!L,applyTerrainMatrix:!0}),ht=c.aD(ce,fe,de,ue);if(S){ae=Ee.indexBuffer2,se=Ee.segments2;const tt=[P.drawingBufferWidth,P.drawingBufferHeight];re=K==="fillOutlinePattern"&&$?Ip(y,N,fe,tt,ht):Ac(tt,ht)}else ae=Ee.indexBuffer,se=Ee.segments,re=$?Rl(y,N,fe,ht):{u_fill_translate:ht};const dt=y.stencilModeForClipping(be);ke.draw(y.context,q,g,dt,_,gn.backCCW,re,Ne,Ue,s.id,Ee.layoutVertexBuffer,ae,se,s.paint,y.transform.zoom,Ve)}}function Pu(y,e,s,d,g,_,S,L){const P=y.context,O=P.gl,k="fill-extrusion-pattern",$=s.paint.get(k),N=$.constantOr(1),q=s.getCrossfadeParameters(),K=s.paint.get("fill-extrusion-opacity"),re=$.constantOr(null),ae=y.transform;for(const se of d){const ce=e.getTile(se),de=ce.getBucket(s);if(!de)continue;const ue=y.style.map.terrain&&y.style.map.terrain.getTerrainData(se),_e=de.programConfigurations.get(s.id),be=y.useProgram(N?"fillExtrusionPattern":"fillExtrusion",_e);N&&(y.context.activeTexture.set(O.TEXTURE0),ce.imageAtlasTexture.bind(O.LINEAR,O.CLAMP_TO_EDGE),_e.updatePaintBuffers(q));const fe=ae.getProjectionData({overscaledTileID:se,applyGlobeMatrix:!L,applyTerrainMatrix:!0});Nl(_e,k,re,ce,s);const Ee=c.aD(ae,ce,s.paint.get("fill-extrusion-translate"),s.paint.get("fill-extrusion-translate-anchor")),Ve=s.paint.get("fill-extrusion-vertical-gradient"),ke=N?nf(y,Ve,K,Ee,se,q,ce):Mc(y,Ve,K,Ee);be.draw(P,P.gl.TRIANGLES,g,_,S,gn.backCCW,ke,ue,fe,s.id,de.layoutVertexBuffer,de.indexBuffer,de.segments,s.paint,y.transform.zoom,_e,y.style.map.terrain&&de.centroidVertexBuffer)}}function Hi(y,e,s,d,g,_,S,L,P){var O;const k=y.style.projection,$=y.context,N=y.transform,q=$.gl,K=[`#define NUM_ILLUMINATION_SOURCES ${s.paint.get("hillshade-highlight-color").values.length}`],re=y.useProgram("hillshade",null,!1,K),ae=!y.options.moving;for(const se of d){const ce=e.getTile(se),de=ce.fbo;if(!de)continue;const ue=k.getMeshFromTileID($,se.canonical,L,!0,"raster"),_e=(O=y.style.map.terrain)===null||O===void 0?void 0:O.getTerrainData(se);$.activeTexture.set(q.TEXTURE0),q.bindTexture(q.TEXTURE_2D,de.colorAttachment.get());const be=N.getProjectionData({overscaledTileID:se,aligned:ae,applyGlobeMatrix:!P,applyTerrainMatrix:!0});re.draw($,q.TRIANGLES,_,g[se.overscaledZ],S,gn.backCCW,af(y,ce,s),_e,be,s.id,ue.vertexBuffer,ue.indexBuffer,ue.segments)}}function Hn(y,e,s,d,g,_,S,L,P){var O;const k=y.style.projection,$=y.context,N=y.transform,q=$.gl,K=y.useProgram("colorRelief"),re=!y.options.moving;let ae=!0,se=0;for(const ce of d){const de=e.getTile(ce),ue=de.dem;if(ae){const ke=q.getParameter(q.MAX_TEXTURE_SIZE),{elevationTexture:Ne,colorTexture:Ue}=s.getColorRampTextures($,ke,ue.getUnpackVector());$.activeTexture.set(q.TEXTURE1),Ne.bind(q.NEAREST,q.CLAMP_TO_EDGE),$.activeTexture.set(q.TEXTURE4),Ue.bind(q.LINEAR,q.CLAMP_TO_EDGE),ae=!1,se=Ne.size[0]}if(!ue||!ue.data)continue;const _e=ue.stride,be=ue.getPixels();if($.activeTexture.set(q.TEXTURE0),$.pixelStoreUnpackPremultiplyAlpha.set(!1),de.demTexture=de.demTexture||y.getTileTexture(_e),de.demTexture){const ke=de.demTexture;ke.update(be,{premultiply:!1}),ke.bind(q.LINEAR,q.CLAMP_TO_EDGE)}else de.demTexture=new c.T($,be,q.RGBA,{premultiply:!1}),de.demTexture.bind(q.LINEAR,q.CLAMP_TO_EDGE);const fe=k.getMeshFromTileID($,ce.canonical,L,!0,"raster"),Ee=(O=y.style.map.terrain)===null||O===void 0?void 0:O.getTerrainData(ce),Ve=N.getProjectionData({overscaledTileID:ce,aligned:re,applyGlobeMatrix:!P,applyTerrainMatrix:!0});K.draw($,q.TRIANGLES,_,g[ce.overscaledZ],S,gn.backCCW,Pc(s,de.dem,se),Ee,Ve,s.id,fe.vertexBuffer,fe.indexBuffer,fe.segments)}}const wn=[new c.P(0,0),new c.P(c.$,0),new c.P(c.$,c.$),new c.P(0,c.$)];function ls(y,e,s,d,g,_,S,L,P=!1,O=!1){const k=d[d.length-1].overscaledZ,$=y.context,N=$.gl,q=y.useProgram("raster"),K=y.transform,re=y.style.projection,ae=y.colorModeForRenderPass(),se=!y.options.moving,ce=s.paint.get("raster-opacity"),de=s.paint.get("raster-resampling"),ue=s.paint.get("raster-fade-duration"),_e=!!y.style.map.terrain;for(const be of d){const fe=y.getDepthModeForSublayer(be.overscaledZ-k,ce===1?Yt.ReadWrite:Yt.ReadOnly,N.LESS),Ee=e.getTile(be),Ve=de==="nearest"?N.NEAREST:N.LINEAR;$.activeTexture.set(N.TEXTURE0),Ee.texture.bind(Ve,N.CLAMP_TO_EDGE,N.LINEAR_MIPMAP_NEAREST),$.activeTexture.set(N.TEXTURE1);const{parentTile:ke,parentScaleBy:Ne,parentTopLeft:Ue,fadeValues:ht}=_a(Ee,e,ue,_e);Ee.fadeOpacity=ht.tileOpacity,ke?(ke.fadeOpacity=ht.parentTileOpacity,ke.texture.bind(Ve,N.CLAMP_TO_EDGE,N.LINEAR_MIPMAP_NEAREST)):Ee.texture.bind(Ve,N.CLAMP_TO_EDGE,N.LINEAR_MIPMAP_NEAREST),Ee.texture.useMipmap&&$.extTextureFilterAnisotropic&&y.transform.pitch>20&&N.texParameterf(N.TEXTURE_2D,$.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,$.extTextureFilterAnisotropicMax);const dt=y.style.map.terrain&&y.style.map.terrain.getTerrainData(be),tt=K.getProjectionData({overscaledTileID:be,aligned:se,applyGlobeMatrix:!O,applyTerrainMatrix:!0}),It=bu(Ue,Ne,ht.fadeMix,s,L),en=re.getMeshFromTileID($,be.canonical,_,S,"raster");q.draw($,N.TRIANGLES,fe,g?g[be.overscaledZ]:un.disabled,ae,P?gn.frontCCW:gn.backCCW,It,dt,tt,s.id,en.vertexBuffer,en.indexBuffer,en.segments)}}function _a(y,e,s,d){const g={parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:{tileOpacity:1,parentTileOpacity:1,fadeMix:{opacity:1,mix:0}}};if(s===0||d)return g;if(y.fadingParentID){const _=e._getLoadedTile(y.fadingParentID);if(!_)return g;const S=Math.pow(2,_.tileID.overscaledZ-y.tileID.overscaledZ),L=[y.tileID.canonical.x*S%1,y.tileID.canonical.y*S%1],P=(function(O,k,$){const N=Y.now(),q=(N-k.timeAdded)/$,K=O.fadingDirection===Ce.Incoming,re=c.ah((N-O.timeAdded)/$,0,1),ae=c.ah(1-q,0,1),se=K?re:ae;return{tileOpacity:se,parentTileOpacity:K?ae:re,fadeMix:{opacity:1,mix:1-se}}})(y,_,s);return{parentTile:_,parentScaleBy:S,parentTopLeft:L,fadeValues:P}}if(y.selfFading){const _=(function(S,L){const P=Y.now(),O=c.ah((P-S.timeAdded)/L,0,1);return{tileOpacity:O,fadeMix:{opacity:O,mix:0}}})(y,s);return{parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:_}}return g}const wi=new c.bf(1,0,0,1),Jr=new c.bf(0,1,0,1),va=new c.bf(0,0,1,1),jh=new c.bf(1,0,1,1),ao=new c.bf(0,1,1,1);function so(y,e,s,d){Os(y,0,e+s/2,y.transform.width,s,d)}function oo(y,e,s,d){Os(y,e-s/2,0,s,y.transform.height,d)}function Os(y,e,s,d,g,_){const S=y.context,L=S.gl;L.enable(L.SCISSOR_TEST),L.scissor(e*y.pixelRatio,s*y.pixelRatio,d*y.pixelRatio,g*y.pixelRatio),S.clear({color:_}),L.disable(L.SCISSOR_TEST)}function Ul(y,e,s){const d=y.context,g=d.gl,_=y.useProgram("debug"),S=Yt.disabled,L=un.disabled,P=y.colorModeForRenderPass(),O="$debug",k=y.style.map.terrain&&y.style.map.terrain.getTerrainData(s);d.activeTexture.set(g.TEXTURE0);const $=e.getTileByID(s.key).latestRawTileData,N=Math.floor(($&&$.byteLength||0)/1024),q=e.getTile(s).tileSize,K=512/Math.min(q,512)*(s.overscaledZ/y.transform.zoom)*.5;let re=s.canonical.toString();s.overscaledZ!==s.canonical.z&&(re+=` => ${s.overscaledZ}`),(function(se,ce){se.initDebugOverlayCanvas();const de=se.debugOverlayCanvas,ue=se.context.gl,_e=se.debugOverlayCanvas.getContext("2d");_e.clearRect(0,0,de.width,de.height),_e.shadowColor="white",_e.shadowBlur=2,_e.lineWidth=1.5,_e.strokeStyle="white",_e.textBaseline="top",_e.font="bold 36px Open Sans, sans-serif",_e.fillText(ce,5,5),_e.strokeText(ce,5,5),se.debugOverlayTexture.update(de),se.debugOverlayTexture.bind(ue.LINEAR,ue.CLAMP_TO_EDGE)})(y,`${re} ${N}kB`);const ae=y.transform.getProjectionData({overscaledTileID:s,applyGlobeMatrix:!0,applyTerrainMatrix:!0});_.draw(d,g.TRIANGLES,S,L,Zn.alphaBlended,gn.disabled,Dp(c.bf.transparent,K),null,ae,O,y.debugBuffer,y.quadTriangleIndexBuffer,y.debugSegments),_.draw(d,g.LINE_STRIP,S,L,P,gn.disabled,Dp(c.bf.red),k,ae,O,y.debugBuffer,y.tileBorderIndexBuffer,y.debugSegments)}function ks(y,e,s,d){const{isRenderingGlobe:g}=d,_=y.context,S=_.gl,L=y.transform,P=y.colorModeForRenderPass(),O=y.getDepthModeFor3D(),k=y.useProgram("terrain");_.bindFramebuffer.set(null),_.viewport.set([0,0,y.width,y.height]);for(const $ of s){const N=e.getTerrainMesh($.tileID),q=y.renderToTexture.getTexture($),K=e.getTerrainData($.tileID);_.activeTexture.set(S.TEXTURE0),S.bindTexture(S.TEXTURE_2D,q.texture);const re=e.getMeshFrameDelta(L.zoom),ae=L.calculateFogMatrix($.tileID.toUnwrapped()),se=ef(re,ae,y.style.sky,L.pitch,g),ce=L.getProjectionData({overscaledTileID:$.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});k.draw(_,S.TRIANGLES,O,un.disabled,P,gn.backCCW,se,K,ce,"terrain",N.vertexBuffer,N.indexBuffer,N.segments)}}function cs(y,e){if(!e.mesh){const s=new c.aL;s.emplaceBack(-1,-1),s.emplaceBack(1,-1),s.emplaceBack(1,1),s.emplaceBack(-1,1);const d=new c.aN;d.emplaceBack(0,1,2),d.emplaceBack(0,2,3),e.mesh=new No(y.createVertexBuffer(s,Nr.members),y.createIndexBuffer(d),c.aM.simpleSegment(0,0,s.length,d.length))}return e.mesh}class lo{constructor(e,s){this.context=new $p(e),this.transform=s,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:c.ag(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=Dt.maxUnderzooming+Dt.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new As}resize(e,s,d){if(this.width=Math.floor(e*d),this.height=Math.floor(s*d),this.pixelRatio=d,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const g of this.style._order)this.style._layers[g].resize()}setup(){const e=this.context,s=new c.aL;s.emplaceBack(0,0),s.emplaceBack(c.$,0),s.emplaceBack(0,c.$),s.emplaceBack(c.$,c.$),this.tileExtentBuffer=e.createVertexBuffer(s,Nr.members),this.tileExtentSegments=c.aM.simpleSegment(0,0,4,2);const d=new c.aL;d.emplaceBack(0,0),d.emplaceBack(c.$,0),d.emplaceBack(0,c.$),d.emplaceBack(c.$,c.$),this.debugBuffer=e.createVertexBuffer(d,Nr.members),this.debugSegments=c.aM.simpleSegment(0,0,4,5);const g=new c.c7;g.emplaceBack(0,0,0,0),g.emplaceBack(c.$,0,c.$,0),g.emplaceBack(0,c.$,0,c.$),g.emplaceBack(c.$,c.$,c.$,c.$),this.rasterBoundsBuffer=e.createVertexBuffer(g,gm.members),this.rasterBoundsSegments=c.aM.simpleSegment(0,0,4,2);const _=new c.aL;_.emplaceBack(0,0),_.emplaceBack(c.$,0),_.emplaceBack(0,c.$),_.emplaceBack(c.$,c.$),this.rasterBoundsBufferPosOnly=e.createVertexBuffer(_,Nr.members),this.rasterBoundsSegmentsPosOnly=c.aM.simpleSegment(0,0,4,5);const S=new c.aL;S.emplaceBack(0,0),S.emplaceBack(1,0),S.emplaceBack(0,1),S.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(S,Nr.members),this.viewportSegments=c.aM.simpleSegment(0,0,4,2);const L=new c.c8;L.emplaceBack(0),L.emplaceBack(1),L.emplaceBack(3),L.emplaceBack(2),L.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(L);const P=new c.aN;P.emplaceBack(1,0,2),P.emplaceBack(1,2,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(P);const O=this.context.gl;this.stencilClearMode=new un({func:O.ALWAYS,mask:0},0,255,O.ZERO,O.ZERO,O.ZERO),this.tileExtentMesh=new No(this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}clearStencil(){const e=this.context,s=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const d=c.L();c.bZ(d,0,this.width,this.height,0,0,1),c.N(d,d,[s.drawingBufferWidth,s.drawingBufferHeight,0]);const g={mainMatrix:d,tileMercatorCoords:[0,0,1,1],clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:d};this.useProgram("clippingMask",null,!0).draw(e,s.TRIANGLES,Yt.disabled,this.stencilClearMode,Zn.disabled,gn.disabled,null,null,g,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(e,s,d){if(this.currentStencilSource===e.source||!e.isTileClipped()||!s||!s.length)return;this.currentStencilSource=e.source,this.nextStencilID+s.length>256&&this.clearStencil();const g=this.context;g.setColorMode(Zn.disabled),g.setDepthMode(Yt.disabled);const _={};for(const S of s)_[S.key]=this.nextStencilID++;this._renderTileMasks(_,s,d,!0),this._renderTileMasks(_,s,d,!1),this._tileClippingMaskIDs=_}_renderTileMasks(e,s,d,g){const _=this.context,S=_.gl,L=this.style.projection,P=this.transform,O=this.useProgram("clippingMask");for(const k of s){const $=e[k.key],N=this.style.map.terrain&&this.style.map.terrain.getTerrainData(k),q=L.getMeshFromTileID(this.context,k.canonical,g,!0,"stencil"),K=P.getProjectionData({overscaledTileID:k,applyGlobeMatrix:!d,applyTerrainMatrix:!0});O.draw(_,S.TRIANGLES,Yt.disabled,new un({func:S.ALWAYS,mask:0},$,255,S.KEEP,S.KEEP,S.REPLACE),Zn.disabled,d?gn.disabled:gn.backCCW,null,N,K,"$clipping",q.vertexBuffer,q.indexBuffer,q.segments)}}_renderTilesDepthBuffer(){const e=this.context,s=e.gl,d=this.style.projection,g=this.transform,_=this.useProgram("depth"),S=this.getDepthModeFor3D(),L=mn(g,{tileSize:g.tileSize});for(const P of L){const O=this.style.map.terrain&&this.style.map.terrain.getTerrainData(P),k=d.getMeshFromTileID(this.context,P.canonical,!0,!0,"raster"),$=g.getProjectionData({overscaledTileID:P,applyGlobeMatrix:!0,applyTerrainMatrix:!0});_.draw(e,s.TRIANGLES,S,un.disabled,Zn.disabled,gn.backCCW,null,O,$,"$clipping",k.vertexBuffer,k.indexBuffer,k.segments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const e=this.nextStencilID++,s=this.context.gl;return new un({func:s.NOTEQUAL,mask:255},e,255,s.KEEP,s.KEEP,s.REPLACE)}stencilModeForClipping(e){const s=this.context.gl;return new un({func:s.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,s.KEEP,s.KEEP,s.REPLACE)}getStencilConfigForOverlapAndUpdateStencilID(e){const s=this.context.gl,d=e.sort(((S,L)=>L.overscaledZ-S.overscaledZ)),g=d[d.length-1].overscaledZ,_=d[0].overscaledZ-g+1;if(_>1){this.currentStencilSource=void 0,this.nextStencilID+_>256&&this.clearStencil();const S={};for(let L=0;L<_;L++)S[L+g]=new un({func:s.GEQUAL,mask:255},L+this.nextStencilID,255,s.KEEP,s.KEEP,s.REPLACE);return this.nextStencilID+=_,[S,d]}return[{[g]:un.disabled},d]}stencilConfigForOverlapTwoPass(e){const s=this.context.gl,d=e.sort(((S,L)=>L.overscaledZ-S.overscaledZ)),g=d[d.length-1].overscaledZ,_=d[0].overscaledZ-g+1;if(this.clearStencil(),_>1){const S={},L={};for(let P=0;P<_;P++)S[P+g]=new un({func:s.GREATER,mask:255},_+1+P,255,s.KEEP,s.KEEP,s.REPLACE),L[P+g]=new un({func:s.GREATER,mask:255},1+P,255,s.KEEP,s.KEEP,s.REPLACE);return this.nextStencilID=2*_+1,[S,L,d]}return this.nextStencilID=3,[{[g]:new un({func:s.GREATER,mask:255},2,255,s.KEEP,s.KEEP,s.REPLACE)},{[g]:new un({func:s.GREATER,mask:255},1,255,s.KEEP,s.KEEP,s.REPLACE)},d]}colorModeForRenderPass(){const e=this.context.gl;return this._showOverdrawInspector?new Zn([e.CONSTANT_COLOR,e.ONE],new c.bf(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?Zn.unblended:Zn.alphaBlended}getDepthModeForSublayer(e,s,d){if(!this.opaquePassEnabledForLayer())return Yt.disabled;const g=1-((1+this.currentLayer)*this.numSublayers+e)*this.depthEpsilon;return new Yt(d||this.context.gl.LEQUAL,s,[g,g])}getDepthModeFor3D(){return new Yt(this.context.gl.LEQUAL,Yt.ReadWrite,this.depthRangeFor3D)}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(e,s){var d,g;this.style=e,this.options=s,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(Y.now()),this.imageManager.beginFrame();const _=this.style._order,S=this.style.sourceCaches,L={},P={},O={},k={isRenderingToTexture:!1,isRenderingGlobe:((d=e.projection)===null||d===void 0?void 0:d.transitionState)>0};for(const N in S){const q=S[N];q.used&&q.prepare(this.context),L[N]=q.getVisibleCoordinates(!1),P[N]=L[N].slice().reverse(),O[N]=q.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let N=0;N<_.length;N++)if(this.style._layers[_[N]].is3D()){this.opaquePassCutoff=N;break}this.maybeDrawDepthAndCoords(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen";for(const N of _){const q=this.style._layers[N];if(!q.hasOffscreenPass()||q.isHidden(this.transform.zoom))continue;const K=P[q.source];(q.type==="custom"||K.length)&&this.renderLayer(this,S[q.source],q,K,k)}if((g=this.style.projection)===null||g===void 0||g.updateGPUdependent({context:this.context,useProgram:N=>this.useProgram(N)}),this.context.viewport.set([0,0,this.width,this.height]),this.context.bindFramebuffer.set(null),this.context.clear({color:s.showOverdrawInspector?c.bf.black:c.bf.transparent,depth:1}),this.clearStencil(),this.style.sky&&(function(N,q){const K=N.context,re=K.gl,ae=((be,fe,Ee)=>{const Ve=Math.cos(fe.rollInRadians),ke=Math.sin(fe.rollInRadians),Ne=De(fe),Ue=fe.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}).projectionTransition;return{u_sky_color:be.properties.get("sky-color"),u_horizon_color:be.properties.get("horizon-color"),u_horizon:[(fe.width/2-Ne*ke)*Ee,(fe.height/2+Ne*Ve)*Ee],u_horizon_normal:[-ke,Ve],u_sky_horizon_blend:be.properties.get("sky-horizon-blend")*fe.height/2*Ee,u_sky_blend:Ue}})(q,N.style.map.transform,N.pixelRatio),se=new Yt(re.LEQUAL,Yt.ReadWrite,[0,1]),ce=un.disabled,de=N.colorModeForRenderPass(),ue=N.useProgram("sky"),_e=cs(K,q);ue.draw(K,re.TRIANGLES,se,ce,de,gn.disabled,ae,null,void 0,"sky",_e.vertexBuffer,_e.indexBuffer,_e.segments)})(this,this.style.sky),this._showOverdrawInspector=s.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=_.length-1;this.currentLayer>=0;this.currentLayer--){const N=this.style._layers[_[this.currentLayer]],q=S[N.source],K=L[N.source];this._renderTileClippingMasks(N,K,!1),this.renderLayer(this,q,N,K,k)}this.renderPass="translucent";let $=!1;for(this.currentLayer=0;this.currentLayer<_.length;this.currentLayer++){const N=this.style._layers[_[this.currentLayer]],q=S[N.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(N,k))continue;this.opaquePassEnabledForLayer()||$||($=!0,k.isRenderingGlobe&&!this.style.map.terrain&&this._renderTilesDepthBuffer());const K=(N.type==="symbol"?O:P)[N.source];this._renderTileClippingMasks(N,L[N.source],!!this.renderToTexture),this.renderLayer(this,q,N,K,k)}if(k.isRenderingGlobe&&(function(N,q,K){const re=N.context,ae=re.gl,se=N.useProgram("atmosphere"),ce=new Yt(ae.LEQUAL,Yt.ReadOnly,[0,1]),de=N.transform,ue=(function(Ue,ht){const dt=Ue.properties.get("position"),tt=[-dt.x,-dt.y,-dt.z],It=c.ag(new Float64Array(16));return Ue.properties.get("anchor")==="map"&&(c.b6(It,It,ht.rollInRadians),c.b7(It,It,-ht.pitchInRadians),c.b6(It,It,ht.bearingInRadians),c.b7(It,It,ht.center.lat*Math.PI/180),c.bz(It,It,-ht.center.lng*Math.PI/180)),c.c6(tt,tt,It),tt})(K,N.transform),_e=de.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),be=q.properties.get("atmosphere-blend")*_e.projectionTransition;if(be===0)return;const fe=Ll(de.worldSize,de.center.lat),Ee=de.inverseProjectionMatrix,Ve=new Float64Array(4);Ve[3]=1,c.aw(Ve,Ve,de.modelViewProjectionMatrix),Ve[0]/=Ve[3],Ve[1]/=Ve[3],Ve[2]/=Ve[3],Ve[3]=1,c.aw(Ve,Ve,Ee),Ve[0]/=Ve[3],Ve[1]/=Ve[3],Ve[2]/=Ve[3],Ve[3]=1;const ke=((Ue,ht,dt,tt,It)=>({u_sun_pos:Ue,u_atmosphere_blend:ht,u_globe_position:dt,u_globe_radius:tt,u_inv_proj_matrix:It}))(ue,be,[Ve[0],Ve[1],Ve[2]],fe,Ee),Ne=cs(re,q);se.draw(re,ae.TRIANGLES,ce,un.disabled,Zn.alphaBlended,gn.disabled,ke,null,null,"atmosphere",Ne.vertexBuffer,Ne.indexBuffer,Ne.segments)})(this,this.style.sky,this.style.light),this.options.showTileBoundaries){const N=(function(q,K){let re=null;const ae=Object.values(q._layers).flatMap((ue=>ue.source&&!ue.isHidden(K)?[q.sourceCaches[ue.source]]:[])),se=ae.filter((ue=>ue.getSource().type==="vector")),ce=ae.filter((ue=>ue.getSource().type!=="vector")),de=ue=>{(!re||re.getSource().maxzoom<ue.getSource().maxzoom)&&(re=ue)};return se.forEach((ue=>de(ue))),re||ce.forEach((ue=>de(ue))),re})(this.style,this.transform.zoom);N&&(function(q,K,re){for(let ae=0;ae<re.length;ae++)Ul(q,K,re[ae])})(this,N,N.getVisibleCoordinates())}this.options.showPadding&&(function(N){const q=N.transform.padding;so(N,N.transform.height-(q.top||0),3,wi),so(N,q.bottom||0,3,Jr),oo(N,q.left||0,3,va),oo(N,N.transform.width-(q.right||0),3,jh);const K=N.transform.centerPoint;(function(re,ae,se,ce){Os(re,ae-1,se-10,2,20,ce),Os(re,ae-10,se-1,20,2,ce)})(N,K.x,N.transform.height-K.y,ao)})(this),this.context.setDefault()}maybeDrawDepthAndCoords(e){if(!this.style||!this.style.map||!this.style.map.terrain)return;const s=this.terrainFacilitator.matrix,d=this.transform.modelViewProjectionMatrix;let g=this.terrainFacilitator.dirty;g||(g=e?!c.c9(s,d):!c.ca(s,d)),g||(g=this.style.map.terrain.sourceCache.anyTilesAfterTime(this.terrainFacilitator.renderTime)),g&&(c.cb(s,d),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,(function(_,S){const L=_.context,P=L.gl,O=_.transform,k=Zn.unblended,$=new Yt(P.LEQUAL,Yt.ReadWrite,[0,1]),N=S.sourceCache.getRenderableTiles(),q=_.useProgram("terrainDepth");L.bindFramebuffer.set(S.getFramebuffer("depth").framebuffer),L.viewport.set([0,0,_.width/devicePixelRatio,_.height/devicePixelRatio]),L.clear({color:c.bf.transparent,depth:1});for(const K of N){const re=S.getTerrainMesh(K.tileID),ae=S.getTerrainData(K.tileID),se=O.getProjectionData({overscaledTileID:K.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0}),ce={u_ele_delta:S.getMeshFrameDelta(O.zoom)};q.draw(L,P.TRIANGLES,$,un.disabled,k,gn.backCCW,ce,ae,se,"terrain",re.vertexBuffer,re.indexBuffer,re.segments)}L.bindFramebuffer.set(null),L.viewport.set([0,0,_.width,_.height])})(this,this.style.map.terrain),(function(_,S){const L=_.context,P=L.gl,O=_.transform,k=Zn.unblended,$=new Yt(P.LEQUAL,Yt.ReadWrite,[0,1]),N=S.getCoordsTexture(),q=S.sourceCache.getRenderableTiles(),K=_.useProgram("terrainCoords");L.bindFramebuffer.set(S.getFramebuffer("coords").framebuffer),L.viewport.set([0,0,_.width/devicePixelRatio,_.height/devicePixelRatio]),L.clear({color:c.bf.transparent,depth:1}),S.coordsIndex=[];for(const re of q){const ae=S.getTerrainMesh(re.tileID),se=S.getTerrainData(re.tileID);L.activeTexture.set(P.TEXTURE0),P.bindTexture(P.TEXTURE_2D,N.texture);const ce={u_terrain_coords_id:(255-S.coordsIndex.length)/255,u_texture:0,u_ele_delta:S.getMeshFrameDelta(O.zoom)},de=O.getProjectionData({overscaledTileID:re.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});K.draw(L,P.TRIANGLES,$,un.disabled,k,gn.backCCW,ce,se,de,"terrain",ae.vertexBuffer,ae.indexBuffer,ae.segments),S.coordsIndex.push(re.tileID.key)}L.bindFramebuffer.set(null),L.viewport.set([0,0,_.width,_.height])})(this,this.style.map.terrain))}renderLayer(e,s,d,g,_){d.isHidden(this.transform.zoom)||(d.type==="background"||d.type==="custom"||(g||[]).length)&&(this.id=d.id,c.cc(d)?(function(S,L,P,O,k,$){if(S.renderPass!=="translucent")return;const{isRenderingToTexture:N}=$,q=un.disabled,K=S.colorModeForRenderPass();(P._unevaluatedLayout.hasValue("text-variable-anchor")||P._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&(function(re,ae,se,ce,de,ue,_e,be,fe){const Ee=ae.transform,Ve=ae.style.map.terrain,ke=de==="map",Ne=ue==="map";for(const Ue of re){const ht=ce.getTile(Ue),dt=ht.getBucket(se);if(!dt||!dt.text||!dt.text.segments.get().length)continue;const tt=c.an(dt.textSizeData,Ee.zoom),It=c.aC(ht,1,ae.transform.zoom),en=Kn(ke,ae.transform,It),Mn=se.layout.get("icon-text-fit")!=="none"&&dt.hasIconData();if(tt){const Nn=Math.pow(2,Ee.zoom-ht.tileID.overscaledZ),Un=Ve?(hi,ii)=>Ve.getElevation(Ue,hi,ii):null;Lu(dt,ke,Ne,fe,Ee,en,Nn,tt,Mn,c.aD(Ee,ht,_e,be),Ue.toUnwrapped(),Un)}}})(O,S,P,L,P.layout.get("text-rotation-alignment"),P.layout.get("text-pitch-alignment"),P.paint.get("text-translate"),P.paint.get("text-translate-anchor"),k),P.paint.get("icon-opacity").constantOr(1)!==0&&io(S,L,P,O,!1,P.paint.get("icon-translate"),P.paint.get("icon-translate-anchor"),P.layout.get("icon-rotation-alignment"),P.layout.get("icon-pitch-alignment"),P.layout.get("icon-keep-upright"),q,K,N),P.paint.get("text-opacity").constantOr(1)!==0&&io(S,L,P,O,!0,P.paint.get("text-translate"),P.paint.get("text-translate-anchor"),P.layout.get("text-rotation-alignment"),P.layout.get("text-pitch-alignment"),P.layout.get("text-keep-upright"),q,K,N),L.map.showCollisionBoxes&&(no(S,L,P,O,!0),no(S,L,P,O,!1))})(e,s,d,g,this.style.placement.variableOffsets,_):c.cd(d)?(function(S,L,P,O,k){if(S.renderPass!=="translucent")return;const{isRenderingToTexture:$}=k,N=P.paint.get("circle-opacity"),q=P.paint.get("circle-stroke-width"),K=P.paint.get("circle-stroke-opacity"),re=!P.layout.get("circle-sort-key").isConstant();if(N.constantOr(1)===0&&(q.constantOr(1)===0||K.constantOr(1)===0))return;const ae=S.context,se=ae.gl,ce=S.transform,de=S.getDepthModeForSublayer(0,Yt.ReadOnly),ue=un.disabled,_e=S.colorModeForRenderPass(),be=[],fe=ce.getCircleRadiusCorrection();for(let Ee=0;Ee<O.length;Ee++){const Ve=O[Ee],ke=L.getTile(Ve),Ne=ke.getBucket(P);if(!Ne)continue;const Ue=P.paint.get("circle-translate"),ht=P.paint.get("circle-translate-anchor"),dt=c.aD(ce,ke,Ue,ht),tt=Ne.programConfigurations.get(P.id),It=S.useProgram("circle",tt),en=Ne.layoutVertexBuffer,Mn=Ne.indexBuffer,Nn=S.style.map.terrain&&S.style.map.terrain.getTerrainData(Ve),Un={programConfiguration:tt,program:It,layoutVertexBuffer:en,indexBuffer:Mn,uniformValues:_u(S,ke,P,dt,fe),terrainData:Nn,projectionData:ce.getProjectionData({overscaledTileID:Ve,applyGlobeMatrix:!$,applyTerrainMatrix:!0})};if(re){const hi=Ne.segments.get();for(const ii of hi)be.push({segments:new c.aM([ii]),sortKey:ii.sortKey,state:Un})}else be.push({segments:Ne.segments,sortKey:0,state:Un})}re&&be.sort(((Ee,Ve)=>Ee.sortKey-Ve.sortKey));for(const Ee of be){const{programConfiguration:Ve,program:ke,layoutVertexBuffer:Ne,indexBuffer:Ue,uniformValues:ht,terrainData:dt,projectionData:tt}=Ee.state;ke.draw(ae,se.TRIANGLES,de,ue,_e,gn.backCCW,ht,dt,tt,P.id,Ne,Ue,Ee.segments,P.paint,S.transform.zoom,Ve)}})(e,s,d,g,_):c.ce(d)?(function(S,L,P,O,k){if(P.paint.get("heatmap-opacity")===0)return;const $=S.context,{isRenderingToTexture:N,isRenderingGlobe:q}=k;if(S.style.map.terrain){for(const K of O){const re=L.getTile(K);L.hasRenderableParent(K)||(S.renderPass==="offscreen"?Fl(S,re,P,K,q):S.renderPass==="translucent"&&Xo(S,P,K,N,q))}$.viewport.set([0,0,S.width,S.height])}else S.renderPass==="offscreen"?(function(K,re,ae,se){const ce=K.context,de=ce.gl,ue=K.transform,_e=un.disabled,be=new Zn([de.ONE,de.ONE],c.bf.transparent,[!0,!0,!0,!0]);(function(fe,Ee,Ve){const ke=fe.gl;fe.activeTexture.set(ke.TEXTURE1),fe.viewport.set([0,0,Ee.width/4,Ee.height/4]);let Ne=Ve.heatmapFbos.get(c.c3);Ne?(ke.bindTexture(ke.TEXTURE_2D,Ne.colorAttachment.get()),fe.bindFramebuffer.set(Ne.framebuffer)):(Ne=Pr(fe,Ee.width/4,Ee.height/4),Ve.heatmapFbos.set(c.c3,Ne))})(ce,K,ae),ce.clear({color:c.bf.transparent});for(let fe=0;fe<se.length;fe++){const Ee=se[fe];if(re.hasRenderableParent(Ee))continue;const Ve=re.getTile(Ee),ke=Ve.getBucket(ae);if(!ke)continue;const Ne=ke.programConfigurations.get(ae.id),Ue=K.useProgram("heatmap",Ne),ht=ue.getProjectionData({overscaledTileID:Ee,applyGlobeMatrix:!0,applyTerrainMatrix:!1}),dt=ue.getCircleRadiusCorrection();Ue.draw(ce,de.TRIANGLES,Yt.disabled,_e,be,gn.backCCW,rf(Ve,ue.zoom,ae.paint.get("heatmap-intensity"),dt),null,ht,ae.id,ke.layoutVertexBuffer,ke.indexBuffer,ke.segments,ae.paint,ue.zoom,Ne)}ce.viewport.set([0,0,K.width,K.height])})(S,L,P,O):S.renderPass==="translucent"&&(function(K,re){const ae=K.context,se=ae.gl;ae.setColorMode(K.colorModeForRenderPass());const ce=re.heatmapFbos.get(c.c3);ce&&(ae.activeTexture.set(se.TEXTURE0),se.bindTexture(se.TEXTURE_2D,ce.colorAttachment.get()),ae.activeTexture.set(se.TEXTURE1),mr(ae,re).bind(se.LINEAR,se.CLAMP_TO_EDGE),K.useProgram("heatmapTexture").draw(ae,se.TRIANGLES,Yt.disabled,un.disabled,K.colorModeForRenderPass(),gn.disabled,Op(K,re,0,1),null,null,re.id,K.viewportBuffer,K.quadTriangleIndexBuffer,K.viewportSegments,re.paint,K.transform.zoom))})(S,P)})(e,s,d,g,_):c.cf(d)?(function(S,L,P,O,k){if(S.renderPass!=="translucent")return;const{isRenderingToTexture:$}=k,N=P.paint.get("line-opacity"),q=P.paint.get("line-width");if(N.constantOr(1)===0||q.constantOr(1)===0)return;const K=S.getDepthModeForSublayer(0,Yt.ReadOnly),re=S.colorModeForRenderPass(),ae=P.paint.get("line-dasharray"),se=ae.constantOr(1),ce=P.paint.get("line-pattern"),de=ce.constantOr(1),ue=P.paint.get("line-gradient"),_e=P.getCrossfadeParameters();let be;be=de?"linePattern":se&&ue?"lineGradientSDF":se?"lineSDF":ue?"lineGradient":"line";const fe=S.context,Ee=fe.gl,Ve=S.transform;let ke=!0;for(const Ne of O){const Ue=L.getTile(Ne);if(de&&!Ue.patternsLoaded())continue;const ht=Ue.getBucket(P);if(!ht)continue;const dt=ht.programConfigurations.get(P.id),tt=S.context.program.get(),It=S.useProgram(be,dt),en=ke||It.program!==tt,Mn=S.style.map.terrain&&S.style.map.terrain.getTerrainData(Ne),Nn=ce.constantOr(null),Un=ae&&ae.constantOr(null);if(Nn&&Ue.imageAtlas){const _r=Ue.imageAtlas,zi=_r.patternPositions[Nn.to.toString()],Di=_r.patternPositions[Nn.from.toString()];zi&&Di&&dt.setConstantPatternPositions(zi,Di)}else if(Un){const _r=P.layout.get("line-cap")==="round",zi=S.lineAtlas.getDash(Un.to,_r),Di=S.lineAtlas.getDash(Un.from,_r);dt.setConstantDashPositions(zi,Di)}const hi=Ve.getProjectionData({overscaledTileID:Ne,applyGlobeMatrix:!$,applyTerrainMatrix:!0}),ii=Ve.getPixelScale();let yn;de?(yn=jo(S,Ue,P,ii,_e),Ds(fe,Ee,Ue,dt,_e)):se&&ue?(yn=Oh(S,Ue,P,ii,_e,ht.lineClipsArray.length),yf(S,L,fe,Ee,P,ht,Ne,dt,_e)):se?(yn=sf(S,Ue,P,ii,_e),Kr(S,fe,Ee,dt,en,_e)):ue?(yn=xu(S,Ue,P,ii,ht.lineClipsArray.length),ro(S,L,fe,Ee,P,ht,Ne)):yn=vu(S,Ue,P,ii);const vi=S.stencilModeForClipping(Ne);It.draw(fe,Ee.TRIANGLES,K,vi,re,gn.disabled,yn,Mn,hi,P.id,ht.layoutVertexBuffer,ht.indexBuffer,ht.segments,P.paint,S.transform.zoom,dt,ht.layoutVertexBuffer2),ke=!1}})(e,s,d,g,_):c.cg(d)?(function(S,L,P,O,k){const $=P.paint.get("fill-color"),N=P.paint.get("fill-opacity");if(N.constantOr(1)===0)return;const{isRenderingToTexture:q}=k,K=S.colorModeForRenderPass(),re=P.paint.get("fill-pattern"),ae=S.opaquePassEnabledForLayer()&&!re.constantOr(1)&&$.constantOr(c.bf.transparent).a===1&&N.constantOr(0)===1?"opaque":"translucent";if(S.renderPass===ae){const se=S.getDepthModeForSublayer(1,S.renderPass==="opaque"?Yt.ReadWrite:Yt.ReadOnly);zc(S,L,P,O,se,K,!1,q)}if(S.renderPass==="translucent"&&P.paint.get("fill-antialias")){const se=S.getDepthModeForSublayer(P.getPaintProperty("fill-outline-color")?2:0,Yt.ReadOnly);zc(S,L,P,O,se,K,!0,q)}})(e,s,d,g,_):c.ch(d)?(function(S,L,P,O,k){const $=P.paint.get("fill-extrusion-opacity");if($===0)return;const{isRenderingToTexture:N}=k;if(S.renderPass==="translucent"){const q=new Yt(S.context.gl.LEQUAL,Yt.ReadWrite,S.depthRangeFor3D);if($!==1||P.paint.get("fill-extrusion-pattern").constantOr(1))Pu(S,L,P,O,q,un.disabled,Zn.disabled,N),Pu(S,L,P,O,q,S.stencilModeFor3D(),S.colorModeForRenderPass(),N);else{const K=S.colorModeForRenderPass();Pu(S,L,P,O,q,un.disabled,K,N)}}})(e,s,d,g,_):c.ci(d)?(function(S,L,P,O,k){if(S.renderPass!=="offscreen"&&S.renderPass!=="translucent")return;const{isRenderingToTexture:$}=k,N=S.context,q=S.style.projection.useSubdivision,K=S.getDepthModeForSublayer(0,Yt.ReadOnly),re=S.colorModeForRenderPass();if(S.renderPass==="offscreen")(function(ae,se,ce,de,ue,_e,be){const fe=ae.context,Ee=fe.gl;for(const Ve of ce){const ke=se.getTile(Ve),Ne=ke.dem;if(!Ne||!Ne.data||!ke.needsHillshadePrepare)continue;const Ue=Ne.dim,ht=Ne.stride,dt=Ne.getPixels();if(fe.activeTexture.set(Ee.TEXTURE1),fe.pixelStoreUnpackPremultiplyAlpha.set(!1),ke.demTexture=ke.demTexture||ae.getTileTexture(ht),ke.demTexture){const It=ke.demTexture;It.update(dt,{premultiply:!1}),It.bind(Ee.NEAREST,Ee.CLAMP_TO_EDGE)}else ke.demTexture=new c.T(fe,dt,Ee.RGBA,{premultiply:!1}),ke.demTexture.bind(Ee.NEAREST,Ee.CLAMP_TO_EDGE);fe.activeTexture.set(Ee.TEXTURE0);let tt=ke.fbo;if(!tt){const It=new c.T(fe,{width:Ue,height:Ue,data:null},Ee.RGBA);It.bind(Ee.LINEAR,Ee.CLAMP_TO_EDGE),tt=ke.fbo=fe.createFramebuffer(Ue,Ue,!0,!1),tt.colorAttachment.set(It.texture)}fe.bindFramebuffer.set(tt.framebuffer),fe.viewport.set([0,0,Ue,Ue]),ae.useProgram("hillshadePrepare").draw(fe,Ee.TRIANGLES,ue,_e,be,gn.disabled,Dh(ke.tileID,Ne),null,null,de.id,ae.rasterBoundsBuffer,ae.quadTriangleIndexBuffer,ae.rasterBoundsSegments),ke.needsHillshadePrepare=!1}})(S,L,O,P,K,un.disabled,re),N.viewport.set([0,0,S.width,S.height]);else if(S.renderPass==="translucent")if(q){const[ae,se,ce]=S.stencilConfigForOverlapTwoPass(O);Hi(S,L,P,ce,ae,K,re,!1,$),Hi(S,L,P,ce,se,K,re,!0,$)}else{const[ae,se]=S.getStencilConfigForOverlapAndUpdateStencilID(O);Hi(S,L,P,se,ae,K,re,!1,$)}})(e,s,d,g,_):c.cj(d)?(function(S,L,P,O,k){if(S.renderPass!=="translucent"||!O.length)return;const{isRenderingToTexture:$}=k,N=S.style.projection.useSubdivision,q=S.getDepthModeForSublayer(0,Yt.ReadOnly),K=S.colorModeForRenderPass();if(N){const[re,ae,se]=S.stencilConfigForOverlapTwoPass(O);Hn(S,L,P,se,re,q,K,!1,$),Hn(S,L,P,se,ae,q,K,!0,$)}else{const[re,ae]=S.getStencilConfigForOverlapAndUpdateStencilID(O);Hn(S,L,P,ae,re,q,K,!1,$)}})(e,s,d,g,_):c.bK(d)?(function(S,L,P,O,k){if(S.renderPass!=="translucent"||P.paint.get("raster-opacity")===0||!O.length)return;const{isRenderingToTexture:$}=k,N=L.getSource(),q=S.style.projection.useSubdivision;if(N instanceof Br)ls(S,L,P,O,null,!1,!1,N.tileCoords,N.flippedWindingOrder,$);else if(q){const[K,re,ae]=S.stencilConfigForOverlapTwoPass(O);ls(S,L,P,ae,K,!1,!0,wn,!1,$),ls(S,L,P,ae,re,!0,!0,wn,!1,$)}else{const[K,re]=S.getStencilConfigForOverlapAndUpdateStencilID(O);ls(S,L,P,re,K,!1,!0,wn,!1,$)}})(e,s,d,g,_):c.ck(d)?(function(S,L,P,O,k){const $=P.paint.get("background-color"),N=P.paint.get("background-opacity");if(N===0)return;const{isRenderingToTexture:q}=k,K=S.context,re=K.gl,ae=S.style.projection,se=S.transform,ce=se.tileSize,de=P.paint.get("background-pattern");if(S.isPatternMissing(de))return;const ue=!de&&$.a===1&&N===1&&S.opaquePassEnabledForLayer()?"opaque":"translucent";if(S.renderPass!==ue)return;const _e=un.disabled,be=S.getDepthModeForSublayer(0,ue==="opaque"?Yt.ReadWrite:Yt.ReadOnly),fe=S.colorModeForRenderPass(),Ee=S.useProgram(de?"backgroundPattern":"background"),Ve=O||mn(se,{tileSize:ce,terrain:S.style.map.terrain});de&&(K.activeTexture.set(re.TEXTURE0),S.imageManager.bind(S.context));const ke=P.getCrossfadeParameters();for(const Ne of Ve){const Ue=se.getProjectionData({overscaledTileID:Ne,applyGlobeMatrix:!q,applyTerrainMatrix:!0}),ht=de?cf(N,S,de,{tileID:Ne,tileSize:ce},ke):Np(N,$),dt=S.style.map.terrain&&S.style.map.terrain.getTerrainData(Ne),tt=ae.getMeshFromTileID(K,Ne.canonical,!1,!0,"raster");Ee.draw(K,re.TRIANGLES,be,_e,fe,gn.backCCW,ht,dt,Ue,P.id,tt.vertexBuffer,tt.indexBuffer,tt.segments)}})(e,0,d,g,_):c.cl(d)&&(function(S,L,P,O){const{isRenderingGlobe:k}=O,$=S.context,N=P.implementation,q=S.style.projection,K=S.transform,re=K.getProjectionDataForCustomLayer(k),ae={farZ:K.farZ,nearZ:K.nearZ,fov:K.fov*Math.PI/180,modelViewProjectionMatrix:K.modelViewProjectionMatrix,projectionMatrix:K.projectionMatrix,shaderData:{variantName:q.shaderVariantName,vertexShaderPrelude:`const float PI = 3.141592653589793;
885
+ uniform mat4 u_projection_matrix;
886
+ ${q.shaderPreludeCode.vertexSource}`,define:q.shaderDefine},defaultProjectionData:re},se=N.renderingMode?N.renderingMode:"2d";if(S.renderPass==="offscreen"){const ce=N.prerender;ce&&(S.setCustomLayerDefaults(),$.setColorMode(S.colorModeForRenderPass()),ce.call(N,$.gl,ae),$.setDirty(),S.setBaseState())}else if(S.renderPass==="translucent"){S.setCustomLayerDefaults(),$.setColorMode(S.colorModeForRenderPass()),$.setStencilMode(un.disabled);const ce=se==="3d"?S.getDepthModeFor3D():S.getDepthModeForSublayer(0,Yt.ReadOnly);$.setDepthMode(ce),N.render($.gl,ae),$.setDirty(),S.setBaseState(),$.bindFramebuffer.set(null)}})(e,0,d,_))}saveTileTexture(e){const s=this._tileTextures[e.size[0]];s?s.push(e):this._tileTextures[e.size[0]]=[e]}getTileTexture(e){const s=this._tileTextures[e];return s&&s.length>0?s.pop():null}isPatternMissing(e){if(!e)return!1;if(!e.from||!e.to)return!0;const s=this.imageManager.getPattern(e.from.toString()),d=this.imageManager.getPattern(e.to.toString());return!s||!d}useProgram(e,s,d=!1,g=[]){this.cache=this.cache||{};const _=!!this.style.map.terrain,S=this.style.projection,L=d?Lr.projectionMercator:S.shaderPreludeCode,P=d?Cl:S.shaderDefine,O=e+(s?s.cacheKey:"")+`/${d?dn:S.shaderVariantName}`+(this._showOverdrawInspector?"/overdraw":"")+(_?"/terrain":"")+(g?`/${g.join("/")}`:"");return this.cache[O]||(this.cache[O]=new tf(this.context,Lr[e],s,Zo[e],this._showOverdrawInspector,_,L,P,g)),this.cache[O]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new c.T(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:e,drawingBufferHeight:s}=this.context.gl;return this.width!==e||this.height!==s}}function us(y,e){let s,d=!1,g=null,_=null;const S=()=>{g=null,d&&(y.apply(_,s),g=setTimeout(S,e),d=!1)};return(...L)=>(d=!0,_=this,s=L,g||S(),g)}class Ru{constructor(e){this._getCurrentHash=()=>{const s=window.location.hash.replace("#","");if(this._hashName){let d;return s.split("&").map((g=>g.split("="))).forEach((g=>{g[0]===this._hashName&&(d=g)})),(d&&d[1]||"").split("/")}return s.split("/")},this._onHashChange=()=>{const s=this._getCurrentHash();if(!this._isValidHash(s))return!1;const d=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(s[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+s[2],+s[1]],zoom:+s[0],bearing:d,pitch:+(s[4]||0)}),!0},this._updateHashUnthrottled=()=>{const s=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,s)},this._removeHash=()=>{const s=this._getCurrentHash();if(s.length===0)return;const d=s.join("/");let g=d;g.split("&").length>0&&(g=g.split("&")[0]),this._hashName&&(g=`${this._hashName}=${d}`);let _=window.location.hash.replace(g,"");_.startsWith("#&")?_=_.slice(0,1)+_.slice(2):_==="#"&&(_="");let S=window.location.href.replace(/(#.+)?$/,_);S=S.replace("&&","&"),window.history.replaceState(window.history.state,null,S)},this._updateHash=us(this._updateHashUnthrottled,300),this._hashName=e&&encodeURIComponent(e)}addTo(e){return this._map=e,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(e){const s=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),S=Math.round(s.lng*_)/_,L=Math.round(s.lat*_)/_,P=this._map.getBearing(),O=this._map.getPitch();let k="";if(k+=e?`/${S}/${L}/${d}`:`${d}/${L}/${S}`,(P||O)&&(k+="/"+Math.round(10*P)/10),O&&(k+=`/${Math.round(O)}`),this._hashName){const $=this._hashName;let N=!1;const q=window.location.hash.slice(1).split("&").map((K=>{const re=K.split("=")[0];return re===$?(N=!0,`${re}=${k}`):K})).filter((K=>K));return N||q.push(`${$}=${k}`),`#${q.join("&")}`}return`#${k}`}_isValidHash(e){if(e.length<3||e.some(isNaN))return!1;try{new c.S(+e[2],+e[1])}catch{return!1}const s=+e[0],d=+(e[3]||0),g=+(e[4]||0);return s>=this._map.getMinZoom()&&s<=this._map.getMaxZoom()&&d>=-180&&d<=180&&g>=this._map.getMinPitch()&&g<=this._map.getMaxPitch()}}const Yo={linearity:.3,easing:c.cm(0,0,.3,1)},ja=c.e({deceleration:2500,maxSpeed:1400},Yo),Iu=c.e({deceleration:20,maxSpeed:1400},Yo),Qo=c.e({deceleration:1e3,maxSpeed:360},Yo),gr=c.e({deceleration:1e3,maxSpeed:90},Yo),zu=c.e({deceleration:1e3,maxSpeed:360},Yo);class _f{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:Y.now(),settings:e})}_drainInertiaBuffer(){const e=this._inertiaBuffer,s=Y.now();for(;e.length>0&&s-e[0].time>160;)e.shift()}_onMoveEnd(e){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const s={zoom:0,bearing:0,pitch:0,roll:0,pan:new c.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:_}of this._inertiaBuffer)s.zoom+=_.zoomDelta||0,s.bearing+=_.bearingDelta||0,s.pitch+=_.pitchDelta||0,s.roll+=_.rollDelta||0,_.panDelta&&s.pan._add(_.panDelta),_.around&&(s.around=_.around),_.pinchAround&&(s.pinchAround=_.pinchAround);const d=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,g={};if(s.pan.mag()){const _=Oc(s.pan.mag(),d,c.e({},ja,e||{})),S=s.pan.mult(_.amount/s.pan.mag()),L=this._map.cameraHelper.handlePanInertia(S,this._map.transform);g.center=L.easingCenter,g.offset=L.easingOffset,Dc(g,_)}if(s.zoom){const _=Oc(s.zoom,d,Iu);g.zoom=this._map.transform.zoom+_.amount,Dc(g,_)}if(s.bearing){const _=Oc(s.bearing,d,Qo);g.bearing=this._map.transform.bearing+c.ah(_.amount,-179,179),Dc(g,_)}if(s.pitch){const _=Oc(s.pitch,d,gr);g.pitch=this._map.transform.pitch+_.amount,Dc(g,_)}if(s.roll){const _=Oc(s.roll,d,zu);g.roll=this._map.transform.roll+c.ah(_.amount,-179,179),Dc(g,_)}if(g.zoom||g.bearing){const _=s.pinchAround===void 0?s.around:s.pinchAround;g.around=_?this._map.unproject(_):this._map.getCenter()}return this.clear(),c.e(g,{noMoveStart:!0})}}function Dc(y,e){(!y.duration||y.duration<e.duration)&&(y.duration=e.duration,y.easing=e.easing)}function Oc(y,e,s){const{maxSpeed:d,linearity:g,deceleration:_}=s,S=c.ah(y*g/(e/1e3),-d,d),L=Math.abs(S)/(_*g);return{easing:s.easing,duration:1e3*L,amount:S*(L/2)}}class ea extends c.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,s,d,g={}){d=d instanceof MouseEvent?d:new MouseEvent(e,d);const _=U.mousePos(s.getCanvas(),d),S=s.unproject(_);super(e,c.e({point:_,lngLat:S,originalEvent:d},g)),this._defaultPrevented=!1,this.target=s}}class li extends c.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,s,d){const g=e==="touchend"?d.changedTouches:d.touches,_=U.touchPos(s.getCanvasContainer(),g),S=_.map((P=>s.unproject(P))),L=_.reduce(((P,O,k,$)=>P.add(O.div($.length))),new c.P(0,0));super(e,{points:_,point:L,lngLats:S,lngLat:s.unproject(L),originalEvent:d}),this._defaultPrevented=!1}}class Du extends c.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,s,d){super(e,{originalEvent:d}),this._defaultPrevented=!1}}class Rr{constructor(e,s){this._map=e,this._clickTolerance=s.clickTolerance}reset(){delete this._mousedownPos}wheel(e){return this._firePreventable(new Du(e.type,this._map,e))}mousedown(e,s){return this._mousedownPos=s,this._firePreventable(new ea(e.type,this._map,e))}mouseup(e){this._map.fire(new ea(e.type,this._map,e))}click(e,s){this._mousedownPos&&this._mousedownPos.dist(s)>=this._clickTolerance||this._map.fire(new ea(e.type,this._map,e))}dblclick(e){return this._firePreventable(new ea(e.type,this._map,e))}mouseover(e){this._map.fire(new ea(e.type,this._map,e))}mouseout(e){this._map.fire(new ea(e.type,this._map,e))}touchstart(e){return this._firePreventable(new li(e.type,this._map,e))}touchmove(e){this._map.fire(new li(e.type,this._map,e))}touchend(e){this._map.fire(new li(e.type,this._map,e))}touchcancel(e){this._map.fire(new li(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Zr{constructor(e){this._map=e}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(e){this._map.fire(new ea(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new ea("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._ignoreContextMenu||this._map.fire(new ea(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Wo{constructor(e){this._map=e}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(e){return this.transform.screenPointToLocation(c.P.convert(e),this._map.terrain)}}class Sr{constructor(e,s){this._map=e,this._tr=new Wo(e),this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=s.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,s){this.isEnabled()&&e.shiftKey&&e.button===0&&(U.disableDrag(),this._startPos=this._lastPos=s,this._active=!0)}mousemoveWindow(e,s){if(!this._active)return;const d=s;if(this._lastPos.equals(d)||!this._box&&d.dist(this._startPos)<this._clickTolerance)return;const g=this._startPos;this._lastPos=d,this._box||(this._box=U.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",e));const _=Math.min(g.x,d.x),S=Math.max(g.x,d.x),L=Math.min(g.y,d.y),P=Math.max(g.y,d.y);U.setTransform(this._box,`translate(${_}px,${L}px)`),this._box.style.width=S-_+"px",this._box.style.height=P-L+"px"}mouseupWindow(e,s){if(!this._active||e.button!==0)return;const d=this._startPos,g=s;if(this.reset(),U.suppressClick(),d.x!==g.x||d.y!==g.y)return this._map.fire(new c.l("boxzoomend",{originalEvent:e})),{cameraAnimation:_=>_.fitScreenCoordinates(d,g,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",e)}keydown(e){this._active&&e.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",e))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(U.remove(this._box),this._box=null),U.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(e,s){return this._map.fire(new c.l(e,{originalEvent:s}))}}function xa(y,e){if(y.length!==e.length)throw new Error(`The number of touches and points are not equal - touches ${y.length}, points ${e.length}`);const s={};for(let d=0;d<y.length;d++)s[y[d].identifier]=e[d];return s}class ym{constructor(e){this.reset(),this.numTouches=e.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(e,s,d){(this.centroid||d.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=e.timeStamp),d.length===this.numTouches&&(this.centroid=(function(g){const _=new c.P(0,0);for(const S of g)_._add(S);return _.div(g.length)})(s),this.touches=xa(d,s)))}touchmove(e,s,d){if(this.aborted||!this.centroid)return;const g=xa(d,s);for(const _ in this.touches){const S=g[_];(!S||S.dist(this.touches[_])>30)&&(this.aborted=!0)}}touchend(e,s,d){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),d.length===0){const g=!this.aborted&&this.centroid;if(this.reset(),g)return g}}}class Zh{constructor(e){this.singleTap=new ym(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(e,s,d){this.singleTap.touchstart(e,s,d)}touchmove(e,s,d){this.singleTap.touchmove(e,s,d)}touchend(e,s,d){const g=this.singleTap.touchend(e,s,d);if(g){const _=e.timeStamp-this.lastTime<500,S=!this.lastTap||this.lastTap.dist(g)<30;if(_&&S||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=g,this.count===this.numTaps)return this.reset(),g}}}class _m{constructor(e){this._tr=new Wo(e),this._zoomIn=new Zh({numTouches:1,numTaps:2}),this._zoomOut=new Zh({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,s,d){this._zoomIn.touchstart(e,s,d),this._zoomOut.touchstart(e,s,d)}touchmove(e,s,d){this._zoomIn.touchmove(e,s,d),this._zoomOut.touchmove(e,s,d)}touchend(e,s,d){const g=this._zoomIn.touchend(e,s,d),_=this._zoomOut.touchend(e,s,d),S=this._tr;return g?(this._active=!0,e.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:L=>L.easeTo({duration:300,zoom:S.zoom+1,around:S.unproject(g)},{originalEvent:e})}):_?(this._active=!0,e.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:L=>L.easeTo({duration:300,zoom:S.zoom-1,around:S.unproject(_)},{originalEvent:e})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class kc{constructor(e){this._enabled=!!e.enable,this._moveStateManager=e.moveStateManager,this._clickTolerance=e.clickTolerance||1,this._moveFunction=e.move,this._activateOnStart=!!e.activateOnStart,e.assignEvents(this),this.reset()}reset(e){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(e)}_move(...e){const s=this._moveFunction(...e);if(s.bearingDelta||s.pitchDelta||s.rollDelta||s.around||s.panDelta)return this._active=!0,s}dragStart(e,s){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(e)&&(this._moveStateManager.startMove(e),this._lastPoint=Array.isArray(s)?s[0]:s,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(e,s){if(!this.isEnabled())return;const d=this._lastPoint;if(!d)return;if(e.preventDefault(),!this._moveStateManager.isValidMoveEvent(e))return void this.reset(e);const g=Array.isArray(s)?s[0]:s;return!this._moved&&g.dist(d)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=g,this._move(d,g))}dragEnd(e){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(e)&&(this._moved&&U.suppressClick(),this.reset(e))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}const Ko=0,$l=2,Za={[Ko]:1,[$l]:2};class Ct{constructor(e){this._correctEvent=e.checkCorrectEvent}startMove(e){const s=U.mouseButton(e);this._eventButton=s}endMove(e){delete this._eventButton}isValidStartEvent(e){return this._correctEvent(e)}isValidMoveEvent(e){return!(function(s,d){const g=Za[d];return s.buttons===void 0||(s.buttons&g)!==g})(e,this._eventButton)}isValidEndEvent(e){return U.mouseButton(e)===this._eventButton}}class Vl{constructor(){this._firstTouch=void 0}_isOneFingerTouch(e){return e.targetTouches.length===1}_isSameTouchEvent(e){return e.targetTouches[0].identifier===this._firstTouch}startMove(e){this._firstTouch=e.targetTouches[0].identifier}endMove(e){delete this._firstTouch}isValidStartEvent(e){return this._isOneFingerTouch(e)}isValidMoveEvent(e){return this._isOneFingerTouch(e)&&this._isSameTouchEvent(e)}isValidEndEvent(e){return this._isOneFingerTouch(e)&&this._isSameTouchEvent(e)}}class Ou{constructor(e=new Ct({checkCorrectEvent:()=>!0}),s=new Vl){this.mouseMoveStateManager=e,this.oneFingerTouchMoveStateManager=s}_executeRelevantHandler(e,s,d){return e instanceof MouseEvent?s(e):typeof TouchEvent<"u"&&e instanceof TouchEvent?d(e):void 0}startMove(e){this._executeRelevantHandler(e,(s=>this.mouseMoveStateManager.startMove(s)),(s=>this.oneFingerTouchMoveStateManager.startMove(s)))}endMove(e){this._executeRelevantHandler(e,(s=>this.mouseMoveStateManager.endMove(s)),(s=>this.oneFingerTouchMoveStateManager.endMove(s)))}isValidStartEvent(e){return this._executeRelevantHandler(e,(s=>this.mouseMoveStateManager.isValidStartEvent(s)),(s=>this.oneFingerTouchMoveStateManager.isValidStartEvent(s)))}isValidMoveEvent(e){return this._executeRelevantHandler(e,(s=>this.mouseMoveStateManager.isValidMoveEvent(s)),(s=>this.oneFingerTouchMoveStateManager.isValidMoveEvent(s)))}isValidEndEvent(e){return this._executeRelevantHandler(e,(s=>this.mouseMoveStateManager.isValidEndEvent(s)),(s=>this.oneFingerTouchMoveStateManager.isValidEndEvent(s)))}}const Jo=y=>{y.mousedown=y.dragStart,y.mousemoveWindow=y.dragMove,y.mouseup=y.dragEnd,y.contextmenu=e=>{e.preventDefault()}};class el{constructor(e,s){this._clickTolerance=e.clickTolerance||1,this._map=s,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new c.P(0,0)}_shouldBePrevented(e){return e<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(e,s,d){return this._calculateTransform(e,s,d)}touchmove(e,s,d){if(this._active){if(!this._shouldBePrevented(d.length))return e.preventDefault(),this._calculateTransform(e,s,d);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",e)}}touchend(e,s,d){this._calculateTransform(e,s,d),this._active&&this._shouldBePrevented(d.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(e,s,d){d.length>0&&(this._active=!0);const g=xa(d,s),_=new c.P(0,0),S=new c.P(0,0);let L=0;for(const O in g){const k=g[O],$=this._touches[O];$&&(_._add(k),S._add(k.sub($)),L++,g[O]=k)}if(this._touches=g,this._shouldBePrevented(L)||!S.mag())return;const P=S.div(L);return this._sum._add(P),this._sum.mag()<this._clickTolerance?void 0:{around:_.div(L),panDelta:P}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class tl{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(e,s,d){this._firstTwoTouches||d.length<2||(this._firstTwoTouches=[d[0].identifier,d[1].identifier],this._start([s[0],s[1]]))}touchmove(e,s,d){if(!this._firstTwoTouches)return;e.preventDefault();const[g,_]=this._firstTwoTouches,S=jl(d,s,g),L=jl(d,s,_);if(!S||!L)return;const P=this._aroundCenter?null:S.add(L).div(2);return this._move([S,L],P,e)}touchend(e,s,d){if(!this._firstTwoTouches)return;const[g,_]=this._firstTwoTouches,S=jl(d,s,g),L=jl(d,s,_);S&&L||(this._active&&U.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(e){this._enabled=!0,this._aroundCenter=!!e&&e.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function jl(y,e,s){for(let d=0;d<y.length;d++)if(y[d].identifier===s)return e[d]}function ln(y,e){return Math.log(y/e)/Math.LN2}class Bs extends tl{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(e){this._startDistance=this._distance=e[0].dist(e[1])}_move(e,s){const d=this._distance;if(this._distance=e[0].dist(e[1]),this._active||!(Math.abs(ln(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:ln(this._distance,d),pinchAround:s}}}function vf(y,e){return 180*y.angleWith(e)/Math.PI}class ku extends tl{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(e){this._startVector=this._vector=e[0].sub(e[1]),this._minDiameter=e[0].dist(e[1])}_move(e,s,d){const g=this._vector;if(this._vector=e[0].sub(e[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:vf(this._vector,g),pinchAround:s}}_isBelowThreshold(e){this._minDiameter=Math.min(this._minDiameter,e.mag());const s=25/(Math.PI*this._minDiameter)*360,d=vf(e,this._startVector);return Math.abs(d)<s}}function nl(y){return Math.abs(y.y)>Math.abs(y.x)}class Bc extends tl{constructor(e){super(),this._currentTouchCount=0,this._map=e}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(e,s,d){super.touchstart(e,s,d),this._currentTouchCount=d.length}_start(e){this._lastPoints=e,nl(e[0].sub(e[1]))&&(this._valid=!1)}_move(e,s,d){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const g=e[0].sub(this._lastPoints[0]),_=e[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(g,_,d.timeStamp),this._valid?(this._lastPoints=e,this._active=!0,{pitchDelta:(g.y+_.y)/2*-.5}):void 0}gestureBeginsVertically(e,s,d){if(this._valid!==void 0)return this._valid;const g=e.mag()>=2,_=s.mag()>=2;if(!g&&!_)return;if(!g||!_)return this._firstMove===void 0&&(this._firstMove=d),d-this._firstMove<100&&void 0;const S=e.y>0==s.y>0;return nl(e)&&nl(s)&&S}}const Bu={panStep:100,bearingStep:15,pitchStep:10};class il{constructor(e){this._tr=new Wo(e);const s=Bu;this._panStep=s.panStep,this._bearingStep=s.bearingStep,this._pitchStep=s.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let s=0,d=0,g=0,_=0,S=0;switch(e.keyCode){case 61:case 107:case 171:case 187:s=1;break;case 189:case 109:case 173:s=-1;break;case 37:e.shiftKey?d=-1:(e.preventDefault(),_=-1);break;case 39:e.shiftKey?d=1:(e.preventDefault(),_=1);break;case 38:e.shiftKey?g=1:(e.preventDefault(),S=-1);break;case 40:e.shiftKey?g=-1:(e.preventDefault(),S=1);break;default:return}return this._rotationDisabled&&(d=0,g=0),{cameraAnimation:L=>{const P=this._tr;L.easeTo({duration:300,easeId:"keyboardHandler",easing:Fu,zoom:s?Math.round(P.zoom)+s*(e.shiftKey?2:1):P.zoom,bearing:P.bearing+d*this._bearingStep,pitch:P.pitch+g*this._pitchStep,offset:[-_*this._panStep,-S*this._panStep],center:P.center},{originalEvent:e})}}}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 Fu(y){return y*(2-y)}const xf=4.000244140625,rl=1/450;class bf{constructor(e,s){this._onTimeout=d=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(d)},this._map=e,this._tr=new Wo(e),this._triggerRenderFrame=s,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=rl}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&e.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(e){return!!this._map.cooperativeGestures.isEnabled()&&!(e.ctrlKey||this._map.cooperativeGestures.isBypassed(e))}wheel(e){if(!this.isEnabled())return;if(this._shouldBePrevented(e))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",e);let s=e.deltaMode===WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY;const d=Y.now(),g=d-(this._lastWheelEventTime||0);this._lastWheelEventTime=d,s!==0&&s%xf==0?this._type="wheel":s!==0&&Math.abs(s)<4?this._type="trackpad":g>400?(this._type=null,this._lastValue=s,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(g*s)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,s+=this._lastValue)),e.shiftKey&&s&&(s/=4),this._type&&(this._lastWheelEvent=e,this._delta-=s,this._active||this._start(e)),e.preventDefault()}_start(e){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const s=U.mousePos(this._map.getCanvas(),e),d=this._tr;this._aroundPoint=this._aroundCenter?d.transform.locationToScreenPoint(c.S.convert(d.center)):s,this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const e=this._tr.transform;if(typeof this._lastExpectedZoom=="number"){const L=e.zoom-this._lastExpectedZoom;typeof this._startZoom=="number"&&(this._startZoom+=L),typeof this._targetZoom=="number"&&(this._targetZoom+=L)}if(this._delta!==0){const L=this._type==="wheel"&&Math.abs(this._delta)>xf?this._wheelZoomRate:this._defaultZoomRate;let P=2/(1+Math.exp(-Math.abs(this._delta*L)));this._delta<0&&P!==0&&(P=1/P);const O=typeof this._targetZoom!="number"?e.scale:c.af(this._targetZoom);this._targetZoom=e.getConstrained(e.getCameraLngLat(),c.ak(O*P)).zoom,this._type==="wheel"&&(this._startZoom=e.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const s=typeof this._targetZoom!="number"?e.zoom:this._targetZoom,d=this._startZoom,g=this._easing;let _,S=!1;if(this._type==="wheel"&&d&&g){const L=Y.now()-this._lastWheelEventTime,P=Math.min((L+5)/200,1),O=g(P);_=c.C.number(d,s,O),P<1?this._frameId||(this._frameId=!0):S=!0}else _=s,S=!0;return this._active=!0,S&&(this._active=!1,this._finishTimeout=setTimeout((()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._lastExpectedZoom,delete this._finishTimeout}),200)),this._lastExpectedZoom=_,{noInertia:!0,needsRenderFrame:!S,zoomDelta:_-e.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(e){let s=c.co;if(this._prevEase){const d=this._prevEase,g=(Y.now()-d.start)/d.duration,_=d.easing(g+.01)-d.easing(g),S=.27/Math.sqrt(_*_+1e-4)*.01,L=Math.sqrt(.0729-S*S);s=c.cm(S,L,.25,1)}return this._prevEase={start:Y.now(),duration:e,easing:s},s}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,delete this._lastExpectedZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class co{constructor(e,s){this._clickZoom=e,this._tapZoom=s}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 Fs{constructor(e){this._tr=new Wo(e),this.reset()}reset(){this._active=!1}dblclick(e,s){return e.preventDefault(),{cameraAnimation:d=>{d.easeTo({duration:300,zoom:this._tr.zoom+(e.shiftKey?-1:1),around:this._tr.unproject(s)},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Xn{constructor(){this._tap=new Zh({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(e,s,d){if(!this._swipePoint)if(this._tapTime){const g=s[0],_=e.timeStamp-this._tapTime<500,S=this._tapPoint.dist(g)<30;_&&S?d.length>0&&(this._swipePoint=g,this._swipeTouch=d[0].identifier):this.reset()}else this._tap.touchstart(e,s,d)}touchmove(e,s,d){if(this._tapTime){if(this._swipePoint){if(d[0].identifier!==this._swipeTouch)return;const g=s[0],_=g.y-this._swipePoint.y;return this._swipePoint=g,e.preventDefault(),this._active=!0,{zoomDelta:_/128}}}else this._tap.touchmove(e,s,d)}touchend(e,s,d){if(this._tapTime)this._swipePoint&&d.length===0&&this.reset();else{const g=this._tap.touchend(e,s,d);g&&(this._tapTime=e.timeStamp,this._tapPoint=g)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class uo{constructor(e,s,d){this._el=e,this._mousePan=s,this._touchPan=d}enable(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class Ga{constructor(e,s,d,g){this._pitchWithRotate=e.pitchWithRotate,this._rollEnabled=e.rollEnabled,this._mouseRotate=s,this._mousePitch=d,this._mouseRoll=g}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable(),this._rollEnabled&&this._mouseRoll.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable(),this._mouseRoll.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())&&(!this._rollEnabled||this._mouseRoll.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()||this._mouseRoll.isActive()}}class al{constructor(e,s,d,g){this._el=e,this._touchZoom=s,this._touchRotate=d,this._tapDragZoom=g,this._rotationDisabled=!1,this._enabled=!0}enable(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class Nu{constructor(e,s){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=e,this._options=s,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const e=this._map.getCanvasContainer();e.classList.add("maplibregl-cooperative-gestures"),this._container=U.create("div","maplibregl-cooperative-gesture-screen",e);let s=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(s=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const d=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),g=document.createElement("div");g.className="maplibregl-desktop-message",g.textContent=s,this._container.appendChild(g);const _=document.createElement("div");_.className="maplibregl-mobile-message",_.textContent=d,this._container.appendChild(_),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(U.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(e){return e[this._bypassKey]}notifyGestureBlocked(e,s){this._enabled&&(this._map.fire(new c.l("cooperativegestureprevented",{gestureType:e,originalEvent:s})),this._container.classList.add("maplibregl-show"),setTimeout((()=>{this._container.classList.remove("maplibregl-show")}),100))}}const Zl=y=>y.zoom||y.drag||y.roll||y.pitch||y.rotate;class Fc extends c.l{}function Gl(y){return y.panDelta&&y.panDelta.mag()||y.zoomDelta||y.bearingDelta||y.pitchDelta||y.rollDelta}class hs{constructor(e,s){this.handleWindowEvent=g=>{this.handleEvent(g,`${g.type}Window`)},this.handleEvent=(g,_)=>{if(g.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const S=g.type==="renderFrame"?void 0:g,L={needsRenderFrame:!1},P={},O={};for(const{handlerName:N,handler:q,allowed:K}of this._handlers){if(!q.isEnabled())continue;let re;if(this._blockedByActive(O,K,N))q.reset();else if(q[_||g.type]){if(c.cp(g,_||g.type)){const ae=U.mousePos(this._map.getCanvas(),g);re=q[_||g.type](g,ae)}else if(c.cq(g,_||g.type)){const ae=this._getMapTouches(g.touches),se=U.touchPos(this._map.getCanvas(),ae);re=q[_||g.type](g,se,ae)}else c.cr(_||g.type)||(re=q[_||g.type](g));this.mergeHandlerResult(L,P,re,N,S),re&&re.needsRenderFrame&&this._triggerRenderFrame()}(re||q.isActive())&&(O[N]=q)}const k={};for(const N in this._previousActiveHandlers)O[N]||(k[N]=S);this._previousActiveHandlers=O,(Object.keys(k).length||Gl(L))&&(this._changes.push([L,P,k]),this._triggerRenderFrame()),(Object.keys(O).length||Gl(L))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:$}=L;$&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],$(this._map))},this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new _f(e),this._bearingSnap=s.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(s);const 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(const[g,_,S]of this._listeners)U.addEventListener(g,_,g===document?this.handleWindowEvent:this.handleEvent,S)}destroy(){for(const[e,s,d]of this._listeners)U.removeEventListener(e,s,e===document?this.handleWindowEvent:this.handleEvent,d)}_addDefaultHandlers(e){const s=this._map,d=s.getCanvasContainer();this._add("mapEvent",new Rr(s,e));const g=s.boxZoom=new Sr(s,e);this._add("boxZoom",g),e.interactive&&e.boxZoom&&g.enable();const _=s.cooperativeGestures=new Nu(s,e.cooperativeGestures);this._add("cooperativeGestures",_),e.cooperativeGestures&&_.enable();const S=new _m(s),L=new Fs(s);s.doubleClickZoom=new co(L,S),this._add("tapZoom",S),this._add("clickZoom",L),e.interactive&&e.doubleClickZoom&&s.doubleClickZoom.enable();const P=new Xn;this._add("tapDragZoom",P);const O=s.touchPitch=new Bc(s);this._add("touchPitch",O),e.interactive&&e.touchPitch&&s.touchPitch.enable(e.touchPitch);const k=()=>s.project(s.getCenter()),$=(function({enable:ue,clickTolerance:_e,aroundCenter:be=!0,minPixelCenterThreshold:fe=100,rotateDegreesPerPixelMoved:Ee=.8},Ve){const ke=new Ct({checkCorrectEvent:Ne=>U.mouseButton(Ne)===0&&Ne.ctrlKey||U.mouseButton(Ne)===2&&!Ne.ctrlKey});return new kc({clickTolerance:_e,move:(Ne,Ue)=>{const ht=Ve();if(be&&Math.abs(ht.y-Ne.y)>fe)return{bearingDelta:c.cn(new c.P(Ne.x,Ue.y),Ue,ht)};let dt=(Ue.x-Ne.x)*Ee;return be&&Ue.y<ht.y&&(dt=-dt),{bearingDelta:dt}},moveStateManager:ke,enable:ue,assignEvents:Jo})})(e,k),N=(function({enable:ue,clickTolerance:_e,pitchDegreesPerPixelMoved:be=-.5}){const fe=new Ct({checkCorrectEvent:Ee=>U.mouseButton(Ee)===0&&Ee.ctrlKey||U.mouseButton(Ee)===2});return new kc({clickTolerance:_e,move:(Ee,Ve)=>({pitchDelta:(Ve.y-Ee.y)*be}),moveStateManager:fe,enable:ue,assignEvents:Jo})})(e),q=(function({enable:ue,clickTolerance:_e,rollDegreesPerPixelMoved:be=.3},fe){const Ee=new Ct({checkCorrectEvent:Ve=>U.mouseButton(Ve)===2&&Ve.ctrlKey});return new kc({clickTolerance:_e,move:(Ve,ke)=>{const Ne=fe();let Ue=(ke.x-Ve.x)*be;return ke.y<Ne.y&&(Ue=-Ue),{rollDelta:Ue}},moveStateManager:Ee,enable:ue,assignEvents:Jo})})(e,k);s.dragRotate=new Ga(e,$,N,q),this._add("mouseRotate",$,["mousePitch"]),this._add("mousePitch",N,["mouseRotate","mouseRoll"]),this._add("mouseRoll",q,["mousePitch"]),e.interactive&&e.dragRotate&&s.dragRotate.enable();const K=(function({enable:ue,clickTolerance:_e}){const be=new Ct({checkCorrectEvent:fe=>U.mouseButton(fe)===0&&!fe.ctrlKey});return new kc({clickTolerance:_e,move:(fe,Ee)=>({around:Ee,panDelta:Ee.sub(fe)}),activateOnStart:!0,moveStateManager:be,enable:ue,assignEvents:Jo})})(e),re=new el(e,s);s.dragPan=new uo(d,K,re),this._add("mousePan",K),this._add("touchPan",re,["touchZoom","touchRotate"]),e.interactive&&e.dragPan&&s.dragPan.enable(e.dragPan);const ae=new ku,se=new Bs;s.touchZoomRotate=new al(d,se,ae,P),this._add("touchRotate",ae,["touchPan","touchZoom"]),this._add("touchZoom",se,["touchPan","touchRotate"]),e.interactive&&e.touchZoomRotate&&s.touchZoomRotate.enable(e.touchZoomRotate);const ce=s.scrollZoom=new bf(s,(()=>this._triggerRenderFrame()));this._add("scrollZoom",ce,["mousePan"]),e.interactive&&e.scrollZoom&&s.scrollZoom.enable(e.scrollZoom);const de=s.keyboard=new il(s);this._add("keyboard",de),e.interactive&&e.keyboard&&s.keyboard.enable(),this._add("blockableMapEvent",new Zr(s))}_add(e,s,d){this._handlers.push({handlerName:e,handler:s,allowed:d}),this._handlersById[e]=s}stop(e){if(!this._updatingCamera){for(const{handler:s}of this._handlers)s.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[]}}isActive(){for(const{handler:e}of this._handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Zl(this._eventsInProgress)||this.isZooming()}_blockedByActive(e,s,d){for(const g in e)if(g!==d&&(!s||s.indexOf(g)<0))return!0;return!1}_getMapTouches(e){const s=[];for(const d of e)this._el.contains(d.target)&&s.push(d);return s}mergeHandlerResult(e,s,d,g,_){if(!d)return;c.e(e,d);const S={handlerName:g,originalEvent:d.originalEvent||_};d.zoomDelta!==void 0&&(s.zoom=S),d.panDelta!==void 0&&(s.drag=S),d.rollDelta!==void 0&&(s.roll=S),d.pitchDelta!==void 0&&(s.pitch=S),d.bearingDelta!==void 0&&(s.rotate=S)}_applyChanges(){const e={},s={},d={};for(const[g,_,S]of this._changes)g.panDelta&&(e.panDelta=(e.panDelta||new c.P(0,0))._add(g.panDelta)),g.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+g.zoomDelta),g.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+g.bearingDelta),g.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+g.pitchDelta),g.rollDelta&&(e.rollDelta=(e.rollDelta||0)+g.rollDelta),g.around!==void 0&&(e.around=g.around),g.pinchAround!==void 0&&(e.pinchAround=g.pinchAround),g.noInertia&&(e.noInertia=g.noInertia),c.e(s,_),c.e(d,S);this._updateMapTransform(e,s,d),this._changes=[]}_updateMapTransform(e,s,d){const g=this._map,_=g._getTransformForUpdate(),S=g.terrain;if(!(Gl(e)||S&&this._terrainMovement))return this._fireEvents(s,d,!0);g._stop(!0);let{panDelta:L,zoomDelta:P,bearingDelta:O,pitchDelta:k,rollDelta:$,around:N,pinchAround:q}=e;q!==void 0&&(N=q),N=N||g.transform.centerPoint,S&&!_.isPointOnMapSurface(N)&&(N=_.centerPoint);const K={panDelta:L,zoomDelta:P,rollDelta:$,pitchDelta:k,bearingDelta:O,around:N};this._map.cameraHelper.useGlobeControls&&!_.isPointOnMapSurface(N)&&(N=_.centerPoint);const re=N.distSqr(_.centerPoint)<.01?_.center:_.screenPointToLocation(L?N.sub(L):N);this._handleMapControls({terrain:S,tr:_,deltasForHelper:K,preZoomAroundLoc:re,combinedEventsInProgress:s,panDelta:L}),g._applyUpdatedTransform(_),this._map._update(),e.noInertia||this._inertia.record(e),this._fireEvents(s,d,!0)}_handleMapControls({terrain:e,tr:s,deltasForHelper:d,preZoomAroundLoc:g,combinedEventsInProgress:_,panDelta:S}){const L=this._map.cameraHelper;if(L.handleMapControlsRollPitchBearingZoom(d,s),e)return L.useGlobeControls?(this._terrainMovement||!_.drag&&!_.zoom||(this._terrainMovement=!0,this._map._elevationFreeze=!0),void L.handleMapControlsPan(d,s,g)):this._terrainMovement||!_.drag&&!_.zoom?void(_.drag&&this._terrainMovement&&S?s.setCenter(s.screenPointToLocation(s.centerPoint.sub(S))):L.handleMapControlsPan(d,s,g)):(this._terrainMovement=!0,this._map._elevationFreeze=!0,void L.handleMapControlsPan(d,s,g));L.handleMapControlsPan(d,s,g)}_fireEvents(e,s,d){const g=Zl(this._eventsInProgress),_=Zl(e),S={};for(const $ in e){const{originalEvent:N}=e[$];this._eventsInProgress[$]||(S[`${$}start`]=N),this._eventsInProgress[$]=e[$]}!g&&_&&this._fireEvent("movestart",_.originalEvent);for(const $ in S)this._fireEvent($,S[$]);_&&this._fireEvent("move",_.originalEvent);for(const $ in e){const{originalEvent:N}=e[$];this._fireEvent($,N)}const L={};let P;for(const $ in this._eventsInProgress){const{handlerName:N,originalEvent:q}=this._eventsInProgress[$];this._handlersById[N].isActive()||(delete this._eventsInProgress[$],P=s[N]||q,L[`${$}end`]=P)}for(const $ in L)this._fireEvent($,L[$]);const O=Zl(this._eventsInProgress),k=(g||_)&&!O;if(k&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const $=this._map._getTransformForUpdate();this._map.getCenterClampedToGround()&&$.recalculateZoomAndCenter(this._map.terrain),this._map._applyUpdatedTransform($)}if(d&&k){this._updatingCamera=!0;const $=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),N=q=>q!==0&&-this._bearingSnap<q&&q<this._bearingSnap;!$||!$.essential&&Y.prefersReducedMotion?(this._map.fire(new c.l("moveend",{originalEvent:P})),N(this._map.getBearing())&&this._map.resetNorth()):(N($.bearing||this._map.getBearing())&&($.bearing=0),$.freezeElevation=!0,this._map.easeTo($,{originalEvent:P})),this._updatingCamera=!1}}_fireEvent(e,s){this._map.fire(new c.l(e,s?{originalEvent:s}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add((e=>{delete this._frameId,this.handleEvent(new Fc("renderFrame",{timeStamp:e})),this._applyChanges()}))}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class Uu extends c.E{constructor(e,s,d){super(),this._renderFrameCallback=()=>{const g=Math.min((Y.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(g)),g<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=e,this._bearingSnap=d.bearingSnap,this.cameraHelper=s,this.on("moveend",(()=>{delete this._requestedCameraState}))}migrateProjection(e,s){e.apply(this.transform),this.transform=e,this.cameraHelper=s}getCenter(){return new c.S(this.transform.center.lng,this.transform.center.lat)}setCenter(e,s){return this.jumpTo({center:e},s)}getCenterElevation(){return this.transform.elevation}setCenterElevation(e,s){return this.jumpTo({elevation:e},s),this}getCenterClampedToGround(){return this._centerClampedToGround}setCenterClampedToGround(e){this._centerClampedToGround=e}panBy(e,s,d){return e=c.P.convert(e).mult(-1),this.panTo(this.transform.center,c.e({offset:e},s),d)}panTo(e,s,d){return this.easeTo(c.e({center:e},s),d)}getZoom(){return this.transform.zoom}setZoom(e,s){return this.jumpTo({zoom:e},s),this}zoomTo(e,s,d){return this.easeTo(c.e({zoom:e},s),d)}zoomIn(e,s){return this.zoomTo(this.getZoom()+1,e,s),this}zoomOut(e,s){return this.zoomTo(this.getZoom()-1,e,s),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(e,s){return e!=this.transform.fov&&(this.transform.setFov(e),this.fire(new c.l("movestart",s)).fire(new c.l("move",s)).fire(new c.l("moveend",s))),this}getBearing(){return this.transform.bearing}setBearing(e,s){return this.jumpTo({bearing:e},s),this}getPadding(){return this.transform.padding}setPadding(e,s){return this.jumpTo({padding:e},s),this}rotateTo(e,s,d){return this.easeTo(c.e({bearing:e},s),d)}resetNorth(e,s){return this.rotateTo(0,c.e({duration:1e3},e),s),this}resetNorthPitch(e,s){return this.easeTo(c.e({bearing:0,pitch:0,roll:0,duration:1e3},e),s),this}snapToNorth(e,s){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(e,s):this}getPitch(){return this.transform.pitch}setPitch(e,s){return this.jumpTo({pitch:e},s),this}getRoll(){return this.transform.roll}setRoll(e,s){return this.jumpTo({roll:e},s),this}cameraForBounds(e,s){e=Mi.convert(e).adjustAntiMeridian();const d=s&&s.bearing||0;return this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),d,s)}_cameraForBoxAndBearing(e,s,d,g){const _={top:0,bottom:0,right:0,left:0};if(typeof(g=c.e({padding:_,offset:[0,0],maxZoom:this.transform.maxZoom},g)).padding=="number"){const O=g.padding;g.padding={top:O,bottom:O,right:O,left:O}}const S=c.e(_,g.padding);g.padding=S;const L=this.transform,P=new Mi(e,s);return this.cameraHelper.cameraForBoxAndBearing(g,S,P,d,L)}fitBounds(e,s,d){return this._fitInternal(this.cameraForBounds(e,s),s,d)}fitScreenCoordinates(e,s,d,g,_){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.screenPointToLocation(c.P.convert(e)),this.transform.screenPointToLocation(c.P.convert(s)),d,g),g,_)}_fitInternal(e,s,d){return e?(delete(s=c.e(e,s)).padding,s.linear?this.easeTo(s,d):this.flyTo(s,d)):this}jumpTo(e,s){this.stop();const d=this._getTransformForUpdate();let g=!1,_=!1,S=!1;const L=d.zoom;this.cameraHelper.handleJumpToCenterZoom(d,e);const P=d.zoom!==L;return"elevation"in e&&d.elevation!==+e.elevation&&d.setElevation(+e.elevation),"bearing"in e&&d.bearing!==+e.bearing&&(g=!0,d.setBearing(+e.bearing)),"pitch"in e&&d.pitch!==+e.pitch&&(_=!0,d.setPitch(+e.pitch)),"roll"in e&&d.roll!==+e.roll&&(S=!0,d.setRoll(+e.roll)),e.padding==null||d.isPaddingEqual(e.padding)||d.setPadding(e.padding),this._applyUpdatedTransform(d),this.fire(new c.l("movestart",s)).fire(new c.l("move",s)),P&&this.fire(new c.l("zoomstart",s)).fire(new c.l("zoom",s)).fire(new c.l("zoomend",s)),g&&this.fire(new c.l("rotatestart",s)).fire(new c.l("rotate",s)).fire(new c.l("rotateend",s)),_&&this.fire(new c.l("pitchstart",s)).fire(new c.l("pitch",s)).fire(new c.l("pitchend",s)),S&&this.fire(new c.l("rollstart",s)).fire(new c.l("roll",s)).fire(new c.l("rollend",s)),this.fire(new c.l("moveend",s))}calculateCameraOptionsFromTo(e,s,d,g=0){const _=c.a1.fromLngLat(e,s),S=c.a1.fromLngLat(d,g),L=S.x-_.x,P=S.y-_.y,O=S.z-_.z,k=Math.hypot(L,P,O);if(k===0)throw new Error("Can't calculate camera options with same From and To");const $=Math.hypot(L,P),N=c.ak(this.transform.cameraToCenterDistance/k/this.transform.tileSize),q=180*Math.atan2(L,-P)/Math.PI;let K=180*Math.acos($/k)/Math.PI;return K=O<0?90-K:90+K,{center:S.toLngLat(),elevation:g,zoom:N,pitch:K,bearing:q}}calculateCameraOptionsFromCameraLngLatAltRotation(e,s,d,g,_){const S=this.transform.calculateCenterFromCameraLngLatAlt(e,s,d,g);return{center:S.center,elevation:S.elevation,zoom:S.zoom,bearing:d,pitch:g,roll:_}}easeTo(e,s){this._stop(!1,e.easeId),((e=c.e({offset:[0,0],duration:500,easing:c.co},e)).animate===!1||!e.essential&&Y.prefersReducedMotion)&&(e.duration=0);const d=this._getTransformForUpdate(),g=this.getBearing(),_=d.pitch,S=d.roll,L="bearing"in e?this._normalizeBearing(e.bearing,g):g,P="pitch"in e?+e.pitch:_,O="roll"in e?this._normalizeBearing(e.roll,S):S,k="padding"in e?e.padding:d.padding,$=c.P.convert(e.offset);let N,q;e.around&&(N=c.S.convert(e.around),q=d.locationToScreenPoint(N));const K={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching,rolling:this._rolling},re=this.cameraHelper.handleEaseTo(d,{bearing:L,pitch:P,roll:O,padding:k,around:N,aroundPoint:q,offsetAsPoint:$,offset:e.offset,zoom:e.zoom,center:e.center});return this._rotating=this._rotating||g!==L,this._pitching=this._pitching||P!==_,this._rolling=this._rolling||O!==S,this._padding=!d.isPaddingEqual(k),this._zooming=this._zooming||re.isZooming,this._easeId=e.easeId,this._prepareEase(s,e.noMoveStart,K),this.terrain&&this._prepareElevation(re.elevationCenter),this._ease((ae=>{re.easeFunc(ae),this.terrain&&!e.freezeElevation&&this._updateElevation(ae),this._applyUpdatedTransform(d),this._fireMoveEvents(s)}),(ae=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(s,ae)}),e),this}_prepareEase(e,s,d={}){this._moving=!0,s||d.moving||this.fire(new c.l("movestart",e)),this._zooming&&!d.zooming&&this.fire(new c.l("zoomstart",e)),this._rotating&&!d.rotating&&this.fire(new c.l("rotatestart",e)),this._pitching&&!d.pitching&&this.fire(new c.l("pitchstart",e)),this._rolling&&!d.rolling&&this.fire(new c.l("rollstart",e))}_prepareElevation(e){this._elevationCenter=e,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(e,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(e){this._elevationStart!==void 0&&this._elevationCenter!==void 0||this._prepareElevation(this.transform.center),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom));const s=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(e<1&&s!==this._elevationTarget){const d=this._elevationTarget-this._elevationStart;this._elevationStart+=e*(d-(s-(d*e+this._elevationStart))/(1-e)),this._elevationTarget=s}this.transform.setElevation(c.C.number(this._elevationStart,this._elevationTarget,e))}_finalizeElevation(){this._elevationFreeze=!1,this.getCenterClampedToGround()&&this.transform.recalculateZoomAndCenter(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(e){if(!this.terrain&&e.elevation>=0&&e.pitch<=90)return{};const s=e.getCameraLngLat(),d=e.getCameraAltitude(),g=this.terrain?this.terrain.getElevationForLngLatZoom(s,e.zoom):0;if(d<g){const _=this.calculateCameraOptionsFromTo(s,g,e.center,e.elevation);return{pitch:_.pitch,zoom:_.zoom}}return{}}_applyUpdatedTransform(e){const s=[];if(s.push((g=>this._elevateCameraIfInsideTerrain(g))),this.transformCameraUpdate&&s.push((g=>this.transformCameraUpdate(g))),!s.length)return;const d=e.clone();for(const g of s){const _=d.clone(),{center:S,zoom:L,roll:P,pitch:O,bearing:k,elevation:$}=g(_);S&&_.setCenter(S),$!==void 0&&_.setElevation($),L!==void 0&&_.setZoom(L),P!==void 0&&_.setRoll(P),O!==void 0&&_.setPitch(O),k!==void 0&&_.setBearing(k),d.apply(_)}this.transform.apply(d)}_fireMoveEvents(e){this.fire(new c.l("move",e)),this._zooming&&this.fire(new c.l("zoom",e)),this._rotating&&this.fire(new c.l("rotate",e)),this._pitching&&this.fire(new c.l("pitch",e)),this._rolling&&this.fire(new c.l("roll",e))}_afterEase(e,s){if(this._easeId&&s&&this._easeId===s)return;delete this._easeId;const d=this._zooming,g=this._rotating,_=this._pitching,S=this._rolling;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._rolling=!1,this._padding=!1,d&&this.fire(new c.l("zoomend",e)),g&&this.fire(new c.l("rotateend",e)),_&&this.fire(new c.l("pitchend",e)),S&&this.fire(new c.l("rollend",e)),this.fire(new c.l("moveend",e))}flyTo(e,s){if(!e.essential&&Y.prefersReducedMotion){const Ue=c.Q(e,["center","zoom","bearing","pitch","roll","elevation"]);return this.jumpTo(Ue,s)}this.stop(),e=c.e({offset:[0,0],speed:1.2,curve:1.42,easing:c.co},e);const d=this._getTransformForUpdate(),g=d.bearing,_=d.pitch,S=d.roll,L=d.padding,P="bearing"in e?this._normalizeBearing(e.bearing,g):g,O="pitch"in e?+e.pitch:_,k="roll"in e?this._normalizeBearing(e.roll,S):S,$="padding"in e?e.padding:d.padding,N=c.P.convert(e.offset);let q=d.centerPoint.add(N);const K=d.screenPointToLocation(q),re=this.cameraHelper.handleFlyTo(d,{bearing:P,pitch:O,roll:k,padding:$,locationAtOffset:K,offsetAsPoint:N,center:e.center,minZoom:e.minZoom,zoom:e.zoom});let ae=e.curve;const se=Math.max(d.width,d.height),ce=se/re.scaleOfZoom,de=re.pixelPathLength;typeof re.scaleOfMinZoom=="number"&&(ae=Math.sqrt(se/re.scaleOfMinZoom/de*2));const ue=ae*ae;function _e(Ue){const ht=(ce*ce-se*se+(Ue?-1:1)*ue*ue*de*de)/(2*(Ue?ce:se)*ue*de);return Math.log(Math.sqrt(ht*ht+1)-ht)}function be(Ue){return(Math.exp(Ue)-Math.exp(-Ue))/2}function fe(Ue){return(Math.exp(Ue)+Math.exp(-Ue))/2}const Ee=_e(!1);let Ve=function(Ue){return fe(Ee)/fe(Ee+ae*Ue)},ke=function(Ue){return se*((fe(Ee)*(be(ht=Ee+ae*Ue)/fe(ht))-be(Ee))/ue)/de;var ht},Ne=(_e(!0)-Ee)/ae;if(Math.abs(de)<2e-6||!isFinite(Ne)){if(Math.abs(se-ce)<1e-6)return this.easeTo(e,s);const Ue=ce<se?-1:1;Ne=Math.abs(Math.log(ce/se))/ae,ke=()=>0,Ve=ht=>Math.exp(Ue*ae*ht)}return e.duration="duration"in e?+e.duration:1e3*Ne/("screenSpeed"in e?+e.screenSpeed/ae:+e.speed),e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=g!==P,this._pitching=O!==_,this._rolling=k!==S,this._padding=!d.isPaddingEqual($),this._prepareEase(s,!1),this.terrain&&this._prepareElevation(re.targetCenter),this._ease((Ue=>{const ht=Ue*Ne,dt=1/Ve(ht),tt=ke(ht);this._rotating&&d.setBearing(c.C.number(g,P,Ue)),this._pitching&&d.setPitch(c.C.number(_,O,Ue)),this._rolling&&d.setRoll(c.C.number(S,k,Ue)),this._padding&&(d.interpolatePadding(L,$,Ue),q=d.centerPoint.add(N)),re.easeFunc(Ue,dt,tt,q),this.terrain&&!e.freezeElevation&&this._updateElevation(Ue),this._applyUpdatedTransform(d),this._fireMoveEvents(s)}),(()=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(s)}),e),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(e,s){var d;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const g=this._onEaseEnd;delete this._onEaseEnd,g.call(this,s)}return e||(d=this.handlers)===null||d===void 0||d.stop(!1),this}_ease(e,s,d){d.animate===!1||d.duration===0?(e(1),s()):(this._easeStart=Y.now(),this._easeOptions=d,this._onEaseFrame=e,this._onEaseEnd=s,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(e,s){e=c.aO(e,-180,180);const d=Math.abs(e-s);return Math.abs(e-360-s)<d&&(e-=360),Math.abs(e+360-s)<d&&(e+=360),e}queryTerrainElevation(e){return this.terrain?this.terrain.getElevationForLngLatZoom(c.S.convert(e),this.transform.tileZoom):null}}const Mt={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class $t{constructor(e=Mt){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=s=>{!s||s.sourceDataType!=="metadata"&&s.sourceDataType!=="visibility"&&s.dataType!=="style"&&s.type!=="terrain"||this._updateAttributions()},this._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","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=e}getDefaultPosition(){return"bottom-right"}onAdd(e){return this._map=e,this._compact=this.options.compact,this._container=U.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=U.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=U.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){U.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(e,s){const d=this._map._getUIString(`AttributionControl.${s}`);e.title=d,e.setAttribute("aria-label",d)}_updateAttributions(){if(!this._map.style)return;let e=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=e.concat(this.options.customAttribution.map((g=>typeof g!="string"?"":g))):typeof this.options.customAttribution=="string"&&e.push(this.options.customAttribution)),this._map.style.stylesheet){const g=this._map.style.stylesheet;this.styleOwner=g.owner,this.styleId=g.id}const s=this._map.style.sourceCaches;for(const g in s){const _=s[g];if(_.used||_.usedForTerrain){const S=_.getSource();S.attribution&&e.indexOf(S.attribution)<0&&e.push(S.attribution)}}e=e.filter((g=>String(g).trim())),e.sort(((g,_)=>g.length-_.length)),e=e.filter(((g,_)=>{for(let S=_+1;S<e.length;S++)if(e[S].indexOf(g)>=0)return!1;return!0}));const d=e.join(" | ");d!==this._attribHTML&&(this._attribHTML=d,e.length?(this._innerContainer.innerHTML=U.sanitize(d),this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class ql{constructor(e={}){this._updateCompact=()=>{const s=this._container.children;if(s.length){const d=s[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&d.classList.add("maplibregl-compact"):d.classList.remove("maplibregl-compact")}},this.options=e}getDefaultPosition(){return"bottom-left"}onAdd(e){this._map=e,this._compact=this.options&&this.options.compact,this._container=U.create("div","maplibregl-ctrl");const s=U.create("a","maplibregl-ctrl-logo");return s.target="_blank",s.rel="noopener nofollow",s.href="https://maplibre.org/",s.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),s.setAttribute("rel","noopener nofollow"),this._container.appendChild(s),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){U.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class Gh{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){const s=++this._id;return this._queue.push({callback:e,id:s,cancelled:!1}),s}remove(e){const s=this._currentlyRunning,d=s?this._queue.concat(s):this._queue;for(const g of d)if(g.id===e)return void(g.cancelled=!0)}run(e=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const s=this._currentlyRunning=this._queue;this._queue=[];for(const d of s)if(!d.cancelled&&(d.callback(e),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var Nc=c.aJ([{name:"a_pos3d",type:"Int16",components:3}]);class ci extends c.E{constructor(e){super(),this._lastTilesetChange=Y.now(),this.sourceCache=e,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.deltaZoom=1,this.tileSize=e._source.tileSize*2**this.deltaZoom,e.usedForTerrain=!0,e.tileSize=this.tileSize}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(e,s){this.sourceCache.update(e,s),this._renderableTilesKeys=[];const d={};for(const g of mn(e,{tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:s,calculateTileZoom:this.sourceCache._source.calculateTileZoom}))d[g.key]=!0,this._renderableTilesKeys.push(g.key),this._tiles[g.key]||(g.terrainRttPosMatrix32f=new Float64Array(16),c.bZ(g.terrainRttPosMatrix32f,0,c.$,c.$,0,0,1),this._tiles[g.key]=new Q(g,this.tileSize),this._lastTilesetChange=Y.now());for(const g in this._tiles)d[g]||delete this._tiles[g]}freeRtt(e){for(const s in this._tiles){const d=this._tiles[s];(!e||d.tileID.equals(e)||d.tileID.isChildOf(e)||e.isChildOf(d.tileID))&&(d.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map((e=>this.getTileByID(e)))}getTileByID(e){return this._tiles[e]}getTerrainCoords(e,s){return s?this._getTerrainCoordsForTileRanges(e,s):this._getTerrainCoordsForRegularTile(e)}_getTerrainCoordsForRegularTile(e){const s={};for(const d of this._renderableTilesKeys){const g=this._tiles[d].tileID,_=e.clone(),S=c.ba();if(g.canonical.equals(e.canonical))c.bZ(S,0,c.$,c.$,0,0,1);else if(g.canonical.isChildOf(e.canonical)){const L=g.canonical.z-e.canonical.z,P=g.canonical.x-(g.canonical.x>>L<<L),O=g.canonical.y-(g.canonical.y>>L<<L),k=c.$>>L;c.bZ(S,0,k,k,0,0,1),c.M(S,S,[-P*k,-O*k,0])}else{if(!e.canonical.isChildOf(g.canonical))continue;{const L=e.canonical.z-g.canonical.z,P=e.canonical.x-(e.canonical.x>>L<<L),O=e.canonical.y-(e.canonical.y>>L<<L),k=c.$>>L;c.bZ(S,0,c.$,c.$,0,0,1),c.M(S,S,[P*k,O*k,0]),c.N(S,S,[1/2**L,1/2**L,0])}}_.terrainRttPosMatrix32f=new Float32Array(S),s[d]=_}return s}_getTerrainCoordsForTileRanges(e,s){const d={};for(const g of this._renderableTilesKeys){const _=this._tiles[g].tileID;if(!this._isWithinTileRanges(_,s))continue;const S=e.clone(),L=c.ba();if(_.canonical.z===e.canonical.z){const P=e.canonical.x-_.canonical.x,O=e.canonical.y-_.canonical.y;c.bZ(L,0,c.$,c.$,0,0,1),c.M(L,L,[P*c.$,O*c.$,0])}else if(_.canonical.z>e.canonical.z){const P=_.canonical.z-e.canonical.z,O=_.canonical.x-(_.canonical.x>>P<<P),k=_.canonical.y-(_.canonical.y>>P<<P),$=e.canonical.x-(_.canonical.x>>P),N=e.canonical.y-(_.canonical.y>>P),q=c.$>>P;c.bZ(L,0,q,q,0,0,1),c.M(L,L,[-O*q+$*c.$,-k*q+N*c.$,0])}else{const P=e.canonical.z-_.canonical.z,O=e.canonical.x-(e.canonical.x>>P<<P),k=e.canonical.y-(e.canonical.y>>P<<P),$=(e.canonical.x>>P)-_.canonical.x,N=(e.canonical.y>>P)-_.canonical.y,q=c.$<<P;c.bZ(L,0,q,q,0,0,1),c.M(L,L,[O*c.$+$*q,k*c.$+N*q,0])}S.terrainRttPosMatrix32f=new Float32Array(L),d[g]=S}return d}getSourceTile(e,s){const d=this.sourceCache._source;let g=e.overscaledZ-this.deltaZoom;if(g>d.maxzoom&&(g=d.maxzoom),g<d.minzoom)return null;this._sourceTileCache[e.key]||(this._sourceTileCache[e.key]=e.scaledTo(g).key);let _=this.sourceCache.getTileByID(this._sourceTileCache[e.key]);if((!_||!_.dem)&&s)for(;g>=d.minzoom&&(!_||!_.dem);)_=this.sourceCache.getTileByID(e.scaledTo(g--).key);return _}anyTilesAfterTime(e=Date.now()){return this._lastTilesetChange>=e}_isWithinTileRanges(e,s){return s[e.canonical.z]&&e.canonical.x>=s[e.canonical.z].minTileX&&e.canonical.x<=s[e.canonical.z].maxTileX&&e.canonical.y>=s[e.canonical.z].minTileY&&e.canonical.y<=s[e.canonical.z].maxTileY}}class ba{constructor(e,s,d){this._meshCache={},this.painter=e,this.sourceCache=new ci(s),this.options=d,this.exaggeration=typeof d.exaggeration=="number"?d.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(e,s,d,g=c.$){var _;if(!(s>=0&&s<g&&d>=0&&d<g))return 0;const S=this.getTerrainData(e),L=(_=S.tile)===null||_===void 0?void 0:_.dem;if(!L)return 0;const P=c.cs([],[s/g*c.$,d/g*c.$],S.u_terrain_matrix),O=[P[0]*L.dim,P[1]*L.dim],k=Math.floor(O[0]),$=Math.floor(O[1]),N=O[0]-k,q=O[1]-$;return L.get(k,$)*(1-N)*(1-q)+L.get(k+1,$)*N*(1-q)+L.get(k,$+1)*(1-N)*q+L.get(k+1,$+1)*N*q}getElevationForLngLatZoom(e,s){if(!c.ct(s,e.wrap()))return 0;const{tileID:d,mercatorX:g,mercatorY:_}=this._getOverscaledTileIDFromLngLatZoom(e,s);return this.getElevation(d,g%c.$,_%c.$,c.$)}getElevation(e,s,d,g=c.$){return this.getDEMElevation(e,s,d,g)*this.exaggeration}getTerrainData(e){if(!this._emptyDemTexture){const g=this.painter.context,_=new c.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new c.T(g,_,g.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new c.T(g,new c.R({width:1,height:1}),g.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(g.gl.NEAREST,g.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=c.ag([])}const s=this.sourceCache.getSourceTile(e,!0);if(s&&s.dem&&(!s.demTexture||s.needsTerrainPrepare)){const g=this.painter.context;s.demTexture=this.painter.getTileTexture(s.dem.stride),s.demTexture?s.demTexture.update(s.dem.getPixels(),{premultiply:!1}):s.demTexture=new c.T(g,s.dem.getPixels(),g.gl.RGBA,{premultiply:!1}),s.demTexture.bind(g.gl.NEAREST,g.gl.CLAMP_TO_EDGE),s.needsTerrainPrepare=!1}const d=s&&s+s.tileID.key+e.key;if(d&&!this._demMatrixCache[d]){const g=this.sourceCache.sourceCache._source.maxzoom;let _=e.canonical.z-s.tileID.canonical.z;e.overscaledZ>e.canonical.z&&(e.canonical.z>=g?_=e.canonical.z-g:c.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const S=e.canonical.x-(e.canonical.x>>_<<_),L=e.canonical.y-(e.canonical.y>>_<<_),P=c.cu(new Float64Array(16),[1/(c.$<<_),1/(c.$<<_),0]);c.M(P,P,[S*c.$,L*c.$,0]),this._demMatrixCache[e.key]={matrix:P,coord:e}}return{u_depth:2,u_terrain:3,u_terrain_dim:s&&s.dem&&s.dem.dim||1,u_terrain_matrix:d?this._demMatrixCache[e.key].matrix:this._emptyDemMatrix,u_terrain_unpack:s&&s.dem&&s.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(s&&s.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:s}}getFramebuffer(e){const s=this.painter,d=s.width/devicePixelRatio,g=s.height/devicePixelRatio;return!this._fbo||this._fbo.width===d&&this._fbo.height===g||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new c.T(s.context,{width:d,height:g,data:null},s.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(s.context.gl.NEAREST,s.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new c.T(s.context,{width:d,height:g,data:null},s.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(s.context.gl.NEAREST,s.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=s.context.createFramebuffer(d,g,!0,!1),this._fbo.depthAttachment.set(s.context.createRenderbuffer(s.context.gl.DEPTH_COMPONENT16,d,g))),this._fbo.colorAttachment.set(e==="coords"?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){const e=this.painter.context;if(this._coordsTexture)return this._coordsTexture;const s=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let _=0,S=0;_<this._coordsTextureSize;_++)for(let L=0;L<this._coordsTextureSize;L++,S+=4)s[S+0]=255&L,s[S+1]=255&_,s[S+2]=L>>8<<4|_>>8,s[S+3]=0;const d=new c.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(s.buffer)),g=new c.T(e,d,e.gl.RGBA,{premultiply:!1});return g.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),this._coordsTexture=g,g}pointCoordinate(e){this.painter.maybeDrawDepthAndCoords(!0);const s=new Uint8Array(4),d=this.painter.context,g=d.gl,_=Math.round(e.x*this.painter.pixelRatio/devicePixelRatio),S=Math.round(e.y*this.painter.pixelRatio/devicePixelRatio),L=Math.round(this.painter.height/devicePixelRatio);d.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),g.readPixels(_,L-S-1,1,1,g.RGBA,g.UNSIGNED_BYTE,s),d.bindFramebuffer.set(null);const P=s[0]+(s[2]>>4<<8),O=s[1]+((15&s[2])<<8),k=this.coordsIndex[255-s[3]],$=k&&this.sourceCache.getTileByID(k);if(!$)return null;const N=this._coordsTextureSize,q=(1<<$.tileID.canonical.z)*N;return new c.a1(($.tileID.canonical.x*N+P)/q+$.tileID.wrap,($.tileID.canonical.y*N+O)/q,this.getElevation($.tileID,P,O,N))}depthAtPoint(e){const s=new Uint8Array(4),d=this.painter.context,g=d.gl;return d.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),g.readPixels(e.x,this.painter.height/devicePixelRatio-e.y-1,1,1,g.RGBA,g.UNSIGNED_BYTE,s),d.bindFramebuffer.set(null),(s[0]/16777216+s[1]/65536+s[2]/256+s[3])/256}getTerrainMesh(e){var s;const d=((s=this.painter.style.projection)===null||s===void 0?void 0:s.transitionState)>0,g=d&&e.canonical.y===0,_=d&&e.canonical.y===(1<<e.canonical.z)-1,S=`m_${g?"n":""}_${_?"s":""}`;if(this._meshCache[S])return this._meshCache[S];const L=this.painter.context,P=new c.cv,O=new c.aN,k=this.meshSize,$=c.$/k,N=k*k;for(let fe=0;fe<=k;fe++)for(let Ee=0;Ee<=k;Ee++)P.emplaceBack(Ee*$,fe*$,0);for(let fe=0;fe<N;fe+=k+1)for(let Ee=0;Ee<k;Ee++)O.emplaceBack(Ee+fe,k+Ee+fe+1,k+Ee+fe+2),O.emplaceBack(Ee+fe,k+Ee+fe+2,Ee+fe+1);const q=P.length,K=q+(k+1),re=(k+1)*k,ae=g?c.bh:0,se=g?0:1,ce=_?c.bi:c.$,de=_?0:1;for(let fe=0;fe<=k;fe++)P.emplaceBack(fe*$,ae,se);for(let fe=0;fe<=k;fe++)P.emplaceBack(fe*$,ce,de);for(let fe=0;fe<k;fe++)O.emplaceBack(re+fe,K+fe,K+fe+1),O.emplaceBack(re+fe,K+fe+1,re+fe+1),O.emplaceBack(0+fe,q+fe+1,q+fe),O.emplaceBack(0+fe,0+fe+1,q+fe+1);const ue=P.length,_e=ue+2*(k+1);for(const fe of[0,1])for(let Ee=0;Ee<=k;Ee++)for(const Ve of[0,1])P.emplaceBack(fe*c.$,Ee*$,Ve);for(let fe=0;fe<2*k;fe+=2)O.emplaceBack(ue+fe,ue+fe+1,ue+fe+3),O.emplaceBack(ue+fe,ue+fe+3,ue+fe+2),O.emplaceBack(_e+fe,_e+fe+3,_e+fe+1),O.emplaceBack(_e+fe,_e+fe+2,_e+fe+3);const be=new No(L.createVertexBuffer(P,Nc.members),L.createIndexBuffer(O),c.aM.simpleSegment(0,0,P.length,O.length));return this._meshCache[S]=be,be}getMeshFrameDelta(e){return 2*Math.PI*c.bu/Math.pow(2,Math.max(e,0))/5}getMinTileElevationForLngLatZoom(e,s){var d;const{tileID:g}=this._getOverscaledTileIDFromLngLatZoom(e,s);return(d=this.getMinMaxElevation(g).minElevation)!==null&&d!==void 0?d:0}getMinMaxElevation(e){const s=this.getTerrainData(e).tile,d={minElevation:null,maxElevation:null};return s&&s.dem&&(d.minElevation=s.dem.min*this.exaggeration,d.maxElevation=s.dem.max*this.exaggeration),d}_getOverscaledTileIDFromLngLatZoom(e,s){const d=c.a1.fromLngLat(e.wrap()),g=(1<<s)*c.$,_=d.x*g,S=d.y*g,L=Math.floor(_/c.$),P=Math.floor(S/c.$);return{tileID:new c.Z(s,0,s,L,P),mercatorX:_,mercatorY:S}}}class yr{constructor(e,s,d){this._context=e,this._size=s,this._tileSize=d,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(const e of this._objects)e.texture.destroy(),e.fbo.destroy()}_createObject(e){const s=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),d=new c.T(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return d.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),this._context.extTextureFilterAnisotropic&&this._context.gl.texParameterf(this._context.gl.TEXTURE_2D,this._context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this._context.extTextureFilterAnisotropicMax),s.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),s.colorAttachment.set(d.texture),{id:e,fbo:s,texture:d,stamp:-1,inUse:!1}}getObjectForId(e){return this._objects[e]}useObject(e){e.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter((s=>e.id!==s)),this._recentlyUsed.push(e.id)}stampObject(e){e.stamp=++this._stamp}getOrCreateFreeObject(){for(const s of this._recentlyUsed)if(!this._objects[s].inUse)return this._objects[s];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const e=this._createObject(this._objects.length);return this._objects.push(e),e}freeObject(e){e.inUse=!1}freeAllObjects(){for(const e of this._objects)this.freeObject(e)}isFull(){return!(this._objects.length<this._size)&&this._objects.some((e=>!e.inUse))===!1}}const ho={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0,"color-relief":!0};class Vp{constructor(e,s){this.painter=e,this.terrain=s,this.pool=new yr(e.context,30,s.sourceCache.tileSize*s.qualityFactor)}destruct(){this.pool.destruct()}getTexture(e){return this.pool.getObjectForId(e.rtt[this._stacks.length-1].id).texture}prepareForRender(e,s){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=e._order.filter((d=>!e._layers[d].isHidden(s))),this._coordsAscending={};for(const d in e.sourceCaches){this._coordsAscending[d]={};const g=e.sourceCaches[d].getVisibleCoordinates(),_=e.sourceCaches[d].getSource(),S=_ instanceof Br?_.terrainTileRanges:null;for(const L of g){const P=this.terrain.sourceCache.getTerrainCoords(L,S);for(const O in P)this._coordsAscending[d][O]||(this._coordsAscending[d][O]=[]),this._coordsAscending[d][O].push(P[O])}}this._coordsAscendingStr={};for(const d of e._order){const g=e._layers[d],_=g.source;if(ho[g.type]&&!this._coordsAscendingStr[_]){this._coordsAscendingStr[_]={};for(const S in this._coordsAscending[_])this._coordsAscendingStr[_][S]=this._coordsAscending[_][S].map((L=>L.key)).sort().join()}}for(const d of this._renderableTiles)for(const g in this._coordsAscendingStr){const _=this._coordsAscendingStr[g][d.tileID.key];_&&_!==d.rttCoords[g]&&(d.rtt=[])}}renderLayer(e,s){if(e.isHidden(this.painter.transform.zoom))return!1;const d=Object.assign(Object.assign({},s),{isRenderingToTexture:!0}),g=e.type,_=this.painter,S=this._renderableLayerIds[this._renderableLayerIds.length-1]===e.id;if(ho[g]&&(this._prevType&&ho[this._prevType]||this._stacks.push([]),this._prevType=g,this._stacks[this._stacks.length-1].push(e.id),!S))return!0;if(ho[this._prevType]||ho[g]&&S){this._prevType=g;const L=this._stacks.length-1,P=this._stacks[L]||[];for(const O of this._renderableTiles){if(this.pool.isFull()&&(ks(this.painter,this.terrain,this._rttTiles,d),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(O),O.rtt[L]){const $=this.pool.getObjectForId(O.rtt[L].id);if($.stamp===O.rtt[L].stamp){this.pool.useObject($);continue}}const k=this.pool.getOrCreateFreeObject();this.pool.useObject(k),this.pool.stampObject(k),O.rtt[L]={id:k.id,stamp:k.stamp},_.context.bindFramebuffer.set(k.fbo.framebuffer),_.context.clear({color:c.bf.transparent,stencil:0}),_.currentStencilSource=void 0;for(let $=0;$<P.length;$++){const N=_.style._layers[P[$]],q=N.source?this._coordsAscending[N.source][O.tileID.key]:[O.tileID];_.context.viewport.set([0,0,k.fbo.width,k.fbo.height]),_._renderTileClippingMasks(N,q,!0),_.renderLayer(_,_.style.sourceCaches[N.source],N,q,d),N.source&&(O.rttCoords[N.source]=this._coordsAscendingStr[N.source][O.tileID.key])}}return ks(this.painter,this.terrain,this._rttTiles,d),this._rttTiles=[],this.pool.freeAllObjects(),ho[g]}return!1}}const sl={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"MapLibre logo","Map.Title":"Map","Marker.Title":"Map marker","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","Popup.Close":"Close popup","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","GlobeControl.Enable":"Enable globe","GlobeControl.Disable":"Disable globe","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use ⌘ + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},wa=D,mi={hash:!1,interactive:!0,bearingSnap:7,attributionControl:Mt,maplibreLogo:!1,refreshExpiredTiles:!0,canvasContextAttributes:{antialias:!1,preserveDrawingBuffer:!1,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,desynchronized:!1,contextType:void 0},scrollZoom:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],elevation:0,zoom:0,bearing:0,pitch:0,roll:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:c.a.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,rollEnabled:!1,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0,centerClampedToGround:!0},ui={showCompass:!0,showZoom:!0,visualizePitch:!1,visualizeRoll:!0};class Yn{constructor(e,s,d=!1){this.mousedown=_=>{this.startMove(_,U.mousePos(this.element,_)),U.addEventListener(window,"mousemove",this.mousemove),U.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=_=>{this.move(_,U.mousePos(this.element,_))},this.mouseup=_=>{this._rotatePitchHandler.dragEnd(_),this.offTemp()},this.touchstart=_=>{_.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=U.touchPos(this.element,_.targetTouches)[0],this.startMove(_,this._startPos),U.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),U.addEventListener(window,"touchend",this.touchend))},this.touchmove=_=>{_.targetTouches.length!==1?this.reset():(this._lastPos=U.touchPos(this.element,_.targetTouches)[0],this.move(_,this._lastPos))},this.touchend=_=>{_.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this._rotatePitchHandler.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10,this.element=s;const g=new Ou;this._rotatePitchHandler=new kc({clickTolerance:3,move:(_,S)=>{const L=s.getBoundingClientRect(),P=new c.P((L.bottom-L.top)/2,(L.right-L.left)/2);return{bearingDelta:c.cn(new c.P(_.x,S.y),S,P),pitchDelta:d?-.5*(S.y-_.y):void 0}},moveStateManager:g,enable:!0,assignEvents:()=>{}}),this.map=e,U.addEventListener(s,"mousedown",this.mousedown),U.addEventListener(s,"touchstart",this.touchstart,{passive:!1}),U.addEventListener(s,"touchcancel",this.reset)}startMove(e,s){this._rotatePitchHandler.dragStart(e,s),U.disableDrag()}move(e,s){const d=this.map,{bearingDelta:g,pitchDelta:_}=this._rotatePitchHandler.dragMove(e,s)||{};g&&d.setBearing(d.getBearing()+g),_&&d.setPitch(d.getPitch()+_)}off(){const e=this.element;U.removeEventListener(e,"mousedown",this.mousedown),U.removeEventListener(e,"touchstart",this.touchstart,{passive:!1}),U.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),U.removeEventListener(window,"touchend",this.touchend),U.removeEventListener(e,"touchcancel",this.reset),this.offTemp()}offTemp(){U.enableDrag(),U.removeEventListener(window,"mousemove",this.mousemove),U.removeEventListener(window,"mouseup",this.mouseup),U.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),U.removeEventListener(window,"touchend",this.touchend)}}let tn;function kn(y,e,s,d=!1){if(d||!s.getCoveringTilesDetailsProvider().allowWorldCopies())return y==null?void 0:y.wrap();const g=new c.S(y.lng,y.lat);if(y=new c.S(y.lng,y.lat),e){const _=new c.S(y.lng-360,y.lat),S=new c.S(y.lng+360,y.lat),L=s.locationToScreenPoint(y).distSqr(e);s.locationToScreenPoint(_).distSqr(e)<L?y=_:s.locationToScreenPoint(S).distSqr(e)<L&&(y=S)}for(;Math.abs(y.lng-s.center.lng)>180;){const _=s.locationToScreenPoint(y);if(_.x>=0&&_.y>=0&&_.x<=s.width&&_.y<=s.height)break;y.lng>s.center.lng?y.lng-=360:y.lng+=360}return y.lng!==g.lng&&s.isPointOnMapSurface(s.locationToScreenPoint(y))?y:g}const _i={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 Hl(y,e,s){const d=y.classList;for(const g in _i)d.remove(`maplibregl-${s}-anchor-${g}`);d.add(`maplibregl-${s}-anchor-${e}`)}class Ns extends c.E{constructor(e){if(super(),this._onKeyPress=s=>{const d=s.code,g=s.charCode||s.keyCode;d!=="Space"&&d!=="Enter"&&g!==32&&g!==13||this.togglePopup()},this._onMapClick=s=>{const d=s.originalEvent.target,g=this._element;this._popup&&(d===g||g.contains(d))&&this.togglePopup()},this._update=s=>{if(!this._map)return;const d=this._map.loaded()&&!this._map.isMoving();((s==null?void 0:s.type)==="terrain"||(s==null?void 0:s.type)==="render"&&!d)&&this._map.once("render",this._update),this._lngLat=kn(this._lngLat,this._flatPos,this._map.transform),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationToScreenPoint(this._lngLat)._add(this._offset));let g="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?g=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(g=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let _="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?_="rotateX(0deg)":this._pitchAlignment==="map"&&(_=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||s&&s.type!=="moveend"||(this._pos=this._pos.round()),U.setTransform(this._element,`${_i[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${_} ${g}`),Y.frameAsync(new AbortController).then((()=>{this._updateOpacity(s&&s.type==="moveend")})).catch((()=>{}))},this._onMove=s=>{if(!this._isDragging){const d=this._clickTolerance||this._map._clickTolerance;this._isDragging=s.point.dist(this._pointerdownPos)>=d}this._isDragging&&(this._pos=s.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 c.l("dragstart"))),this.fire(new c.l("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new c.l("dragend")),this._state="inactive"},this._addDragHandler=s=>{this._element.contains(s.originalEvent.target)&&(s.preventDefault(),this._positionDelta=s.point.sub(this._pos).add(this._offset),this._pointerdownPos=s.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=e&&e.anchor||"center",this._color=e&&e.color||"#3FB1CE",this._scale=e&&e.scale||1,this._draggable=e&&e.draggable||!1,this._clickTolerance=e&&e.clickTolerance||0,this._subpixelPositioning=e&&e.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=e&&e.rotation||0,this._rotationAlignment=e&&e.rotationAlignment||"auto",this._pitchAlignment=e&&e.pitchAlignment&&e.pitchAlignment!=="auto"?e.pitchAlignment:this._rotationAlignment,this.setOpacity(e==null?void 0:e.opacity,e==null?void 0:e.opacityWhenCovered),e&&e.element)this._element=e.element,this._offset=c.P.convert(e&&e.offset||[0,0]);else{this._defaultMarker=!0,this._element=U.create("div");const s=U.createNS("http://www.w3.org/2000/svg","svg"),d=41,g=27;s.setAttributeNS(null,"display","block"),s.setAttributeNS(null,"height",`${d}px`),s.setAttributeNS(null,"width",`${g}px`),s.setAttributeNS(null,"viewBox",`0 0 ${g} ${d}`);const _=U.createNS("http://www.w3.org/2000/svg","g");_.setAttributeNS(null,"stroke","none"),_.setAttributeNS(null,"stroke-width","1"),_.setAttributeNS(null,"fill","none"),_.setAttributeNS(null,"fill-rule","evenodd");const S=U.createNS("http://www.w3.org/2000/svg","g");S.setAttributeNS(null,"fill-rule","nonzero");const L=U.createNS("http://www.w3.org/2000/svg","g");L.setAttributeNS(null,"transform","translate(3.0, 29.0)"),L.setAttributeNS(null,"fill","#000000");const P=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const se of P){const ce=U.createNS("http://www.w3.org/2000/svg","ellipse");ce.setAttributeNS(null,"opacity","0.04"),ce.setAttributeNS(null,"cx","10.5"),ce.setAttributeNS(null,"cy","5.80029008"),ce.setAttributeNS(null,"rx",se.rx),ce.setAttributeNS(null,"ry",se.ry),L.appendChild(ce)}const O=U.createNS("http://www.w3.org/2000/svg","g");O.setAttributeNS(null,"fill",this._color);const k=U.createNS("http://www.w3.org/2000/svg","path");k.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"),O.appendChild(k);const $=U.createNS("http://www.w3.org/2000/svg","g");$.setAttributeNS(null,"opacity","0.25"),$.setAttributeNS(null,"fill","#000000");const N=U.createNS("http://www.w3.org/2000/svg","path");N.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"),$.appendChild(N);const q=U.createNS("http://www.w3.org/2000/svg","g");q.setAttributeNS(null,"transform","translate(6.0, 7.0)"),q.setAttributeNS(null,"fill","#FFFFFF");const K=U.createNS("http://www.w3.org/2000/svg","g");K.setAttributeNS(null,"transform","translate(8.0, 8.0)");const re=U.createNS("http://www.w3.org/2000/svg","circle");re.setAttributeNS(null,"fill","#000000"),re.setAttributeNS(null,"opacity","0.25"),re.setAttributeNS(null,"cx","5.5"),re.setAttributeNS(null,"cy","5.5"),re.setAttributeNS(null,"r","5.4999962");const ae=U.createNS("http://www.w3.org/2000/svg","circle");ae.setAttributeNS(null,"fill","#FFFFFF"),ae.setAttributeNS(null,"cx","5.5"),ae.setAttributeNS(null,"cy","5.5"),ae.setAttributeNS(null,"r","5.4999962"),K.appendChild(re),K.appendChild(ae),S.appendChild(L),S.appendChild(O),S.appendChild($),S.appendChild(q),S.appendChild(K),s.appendChild(S),s.setAttributeNS(null,"height",d*this._scale+"px"),s.setAttributeNS(null,"width",g*this._scale+"px"),this._element.appendChild(s),this._offset=c.P.convert(e&&e.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",(s=>{s.preventDefault()})),this._element.addEventListener("mousedown",(s=>{s.preventDefault()})),Hl(this._element,this._anchor,"marker"),e&&e.className)for(const s of e.className.split(" "))this._element.classList.add(s);this._popup=null}addTo(e){return this.remove(),this._map=e,this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label",e._getUIString("Marker.Title")),this._element.hasAttribute("role")||this._element.setAttribute("role","button"),e.getCanvasContainer().appendChild(this._element),e.on("move",this._update),e.on("moveend",this._update),e.on("terrain",this._update),e.on("projectiontransition",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("projectiontransition",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),U.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=c.S.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),e){if(!("offset"in e.options)){const g=Math.abs(13.5)/Math.SQRT2;e.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=e,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(e){return this._subpixelPositioning=e,this}getPopup(){return this._popup}togglePopup(){const e=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:e?(e.isOpen()?e.remove():(e.setLngLat(this._lngLat),e.addTo(this._map)),this):this}_updateOpacity(e=!1){var s,d;const g=(s=this._map)===null||s===void 0?void 0:s.terrain,_=this._map.transform.isLocationOccluded(this._lngLat);if(!g||_){const q=_?this._opacityWhenCovered:this._opacity;return void(this._element.style.opacity!==q&&(this._element.style.opacity=q))}if(e)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout((()=>{this._opacityTimeout=null}),100)}const S=this._map,L=S.terrain.depthAtPoint(this._pos),P=S.terrain.getElevationForLngLatZoom(this._lngLat,S.transform.tileZoom);if(S.transform.lngLatToCameraDepth(this._lngLat,P)-L<.006)return void(this._element.style.opacity=this._opacity);const O=-this._offset.y/S.transform.pixelsPerMeter,k=Math.sin(S.getPitch()*Math.PI/180)*O,$=S.terrain.depthAtPoint(new c.P(this._pos.x,this._pos.y-this._offset.y)),N=S.transform.lngLatToCameraDepth(this._lngLat,P+k)-$>.006;!((d=this._popup)===null||d===void 0)&&d.isOpen()&&N&&this._popup.remove(),this._element.style.opacity=N?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(e){return this._offset=c.P.convert(e),this._update(),this}addClassName(e){this._element.classList.add(e)}removeClassName(e){this._element.classList.remove(e)}toggleClassName(e){return this._element.classList.toggle(e)}setDraggable(e){return this._draggable=!!e,this._map&&(e?(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(e){return this._rotation=e||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(e){return this._pitchAlignment=e&&e!=="auto"?e:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(e,s){return(this._opacity===void 0||e===void 0&&s===void 0)&&(this._opacity="1",this._opacityWhenCovered="0.2"),e!==void 0&&(this._opacity=e),s!==void 0&&(this._opacityWhenCovered=s),this._map&&this._updateOpacity(!0),this}}const fo={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let ds=0,fs=!1;const ol={maxWidth:100,unit:"metric"};function qh(y,e,s){const d=s&&s.maxWidth||100,g=y._container.clientHeight/2,_=y._container.clientWidth/2,S=y.unproject([_-d/2,g]),L=y.unproject([_+d/2,g]),P=Math.round(y.project(L).x-y.project(S).x),O=Math.min(d,P,y._container.clientWidth),k=S.distanceTo(L);if(s&&s.unit==="imperial"){const $=3.2808*k;$>5280?ni(e,O,$/5280,y._getUIString("ScaleControl.Miles")):ni(e,O,$,y._getUIString("ScaleControl.Feet"))}else s&&s.unit==="nautical"?ni(e,O,k/1852,y._getUIString("ScaleControl.NauticalMiles")):k>=1e3?ni(e,O,k/1e3,y._getUIString("ScaleControl.Kilometers")):ni(e,O,k,y._getUIString("ScaleControl.Meters"))}function ni(y,e,s,d){const g=(function(_){const S=Math.pow(10,`${Math.floor(_)}`.length-1);let L=_/S;return L=L>=10?10:L>=5?5:L>=3?3:L>=2?2:L>=1?1:(function(P){const O=Math.pow(10,Math.ceil(-Math.log(P)/Math.LN10));return Math.round(P*O)/O})(L),S*L})(s);y.style.width=e*(g/s)+"px",y.innerHTML=`${g}&nbsp;${d}`}const $u={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1,locationOccludedOpacity:void 0},Vu=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function ju(y){if(y){if(typeof y=="number"){const e=Math.round(Math.abs(y)/Math.SQRT2);return{center:new c.P(0,0),top:new c.P(0,y),"top-left":new c.P(e,e),"top-right":new c.P(-e,e),bottom:new c.P(0,-y),"bottom-left":new c.P(e,-e),"bottom-right":new c.P(-e,-e),left:new c.P(y,0),right:new c.P(-y,0)}}if(y instanceof c.P||Array.isArray(y)){const e=c.P.convert(y);return{center:e,top:e,"top-left":e,"top-right":e,bottom:e,"bottom-left":e,"bottom-right":e,left:e,right:e}}return{center:c.P.convert(y.center||[0,0]),top:c.P.convert(y.top||[0,0]),"top-left":c.P.convert(y["top-left"]||[0,0]),"top-right":c.P.convert(y["top-right"]||[0,0]),bottom:c.P.convert(y.bottom||[0,0]),"bottom-left":c.P.convert(y["bottom-left"]||[0,0]),"bottom-right":c.P.convert(y["bottom-right"]||[0,0]),left:c.P.convert(y.left||[0,0]),right:c.P.convert(y.right||[0,0])}}return ju(new c.P(0,0))}const Hh=D;C.AJAXError=c.cz,C.Event=c.l,C.Evented=c.E,C.LngLat=c.S,C.MercatorCoordinate=c.a1,C.Point=c.P,C.addProtocol=c.cA,C.config=c.a,C.removeProtocol=c.cB,C.AttributionControl=$t,C.BoxZoomHandler=Sr,C.CanvasSource=Sl,C.CooperativeGesturesHandler=Nu,C.DoubleClickZoomHandler=co,C.DragPanHandler=uo,C.DragRotateHandler=Ga,C.EdgeInsets=Tl,C.FullscreenControl=class extends c.E{constructor(y={}){super(),this._onFullscreenChange=()=>{var e;let s=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((e=s==null?void 0:s.shadowRoot)===null||e===void 0)&&e.fullscreenElement;)s=s.shadowRoot.fullscreenElement;s===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,y&&y.container&&(y.container instanceof HTMLElement?this._container=y.container:c.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(y){return this._map=y,this._container||(this._container=this._map.getContainer()),this._controlContainer=U.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){U.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const y=this._fullscreenButton=U.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);U.create("span","maplibregl-ctrl-icon",y).setAttribute("aria-hidden","true"),y.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const y=this._getTitle();this._fullscreenButton.setAttribute("aria-label",y),this._fullscreenButton.title=y}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new c.l("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new c.l("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},C.GeoJSONSource=zo,C.GeolocateControl=class extends c.E{constructor(y){super(),this._onSuccess=e=>{if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new c.l("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(e),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new c.l("geolocate",e)),this._finish()}},this._updateCamera=e=>{const s=new c.S(e.coords.longitude,e.coords.latitude),d=e.coords.accuracy,g=this._map.getBearing(),_=c.e({bearing:g},this.options.fitBoundsOptions),S=Mi.fromLngLat(s,d);this._map.fitBounds(S,_,{geolocateSource:!0})},this._updateMarker=e=>{if(e){const s=new c.S(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(s).addTo(this._map),this._userLocationDotMarker.setLngLat(s).addTo(this._map),this._accuracy=e.coords.accuracy,this._updateCircleRadiusIfNeeded()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onUpdate=()=>{this._updateCircleRadiusIfNeeded()},this._onError=e=>{if(this._map){if(e.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const s=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=s,this._geolocateButton.setAttribute("aria-label",s),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(e.code===3&&fs)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new c.l("error",e)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",(e=>e.preventDefault())),this._geolocateButton=U.create("button","maplibregl-ctrl-geolocate",this._container),U.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=e=>{if(this._map){if(e===!1){c.w("Geolocation support is not available so the GeolocateControl will be disabled.");const s=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=s,this._geolocateButton.setAttribute("aria-label",s)}else{const s=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=s,this._geolocateButton.setAttribute("aria-label",s)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=U.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Ns({element:this._dotElement}),this._circleElement=U.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Ns({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onUpdate),this._map.on("move",this._onUpdate),this._map.on("rotate",this._onUpdate),this._map.on("pitch",this._onUpdate)),this._geolocateButton.addEventListener("click",(()=>this.trigger())),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(s=>{const d=(s==null?void 0:s[0])instanceof ResizeObserverEntry;s.geolocateSource||this._watchState!=="ACTIVE_LOCK"||d||this._map.isZooming()||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new c.l("trackuserlocationend")),this.fire(new c.l("userlocationlostfocus")))}))}},this.options=c.e({},fo,y)}onAdd(y){return this._map=y,this._container=U.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),(function(){return c._(this,arguments,void 0,(function*(e=!1){if(tn!==void 0&&!e)return tn;if(window.navigator.permissions===void 0)return tn=!!window.navigator.geolocation,tn;try{tn=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{tn=!!window.navigator.geolocation}return tn}))})().then((e=>this._finishSetupUI(e))),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(),U.remove(this._container),this._map.off("zoom",this._onUpdate),this._map.off("move",this._onUpdate),this._map.off("rotate",this._onUpdate),this._map.off("pitch",this._onUpdate),this._map=void 0,ds=0,fs=!1}_isOutOfMapMaxBounds(y){const e=this._map.getMaxBounds(),s=y.coords;return e&&(s.longitude<e.getWest()||s.longitude>e.getEast()||s.latitude<e.getSouth()||s.latitude>e.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":case"BACKGROUND_ERROR":case"OFF":case void 0:break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadiusIfNeeded(){const y=this._userLocationDotMarker.getLngLat();if(!(this.options.showUserLocation&&this.options.showAccuracyCircle&&this._accuracy&&y))return;const e=this._map.project(y),s=this._map.unproject([e.x+100,e.y]),d=y.distanceTo(s)/100,g=2*this._accuracy/d;this._circleElement.style.width=`${g.toFixed(2)}px`,this._circleElement.style.height=`${g.toFixed(2)}px`}trigger(){if(!this._setup)return c.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new c.l("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":ds--,fs=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new c.l("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new c.l("trackuserlocationstart")),this.fire(new c.l("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let y;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),ds++,ds>1?(y={maximumAge:6e5,timeout:0},fs=!0):(y=this.options.positionOptions,fs=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,y)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},C.GlobeControl=class{constructor(){this._toggleProjection=()=>{var y;const e=(y=this._map.getProjection())===null||y===void 0?void 0:y.type;this._map.setProjection(e!=="mercator"&&e?{type:"mercator"}:{type:"globe"}),this._updateGlobeIcon()},this._updateGlobeIcon=()=>{var y;this._globeButton.classList.remove("maplibregl-ctrl-globe"),this._globeButton.classList.remove("maplibregl-ctrl-globe-enabled"),((y=this._map.getProjection())===null||y===void 0?void 0:y.type)==="globe"?(this._globeButton.classList.add("maplibregl-ctrl-globe-enabled"),this._globeButton.title=this._map._getUIString("GlobeControl.Disable")):(this._globeButton.classList.add("maplibregl-ctrl-globe"),this._globeButton.title=this._map._getUIString("GlobeControl.Enable"))}}onAdd(y){return this._map=y,this._container=U.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._globeButton=U.create("button","maplibregl-ctrl-globe",this._container),U.create("span","maplibregl-ctrl-icon",this._globeButton).setAttribute("aria-hidden","true"),this._globeButton.type="button",this._globeButton.addEventListener("click",this._toggleProjection),this._updateGlobeIcon(),this._map.on("styledata",this._updateGlobeIcon),this._container}onRemove(){U.remove(this._container),this._map.off("styledata",this._updateGlobeIcon),this._globeButton.removeEventListener("click",this._toggleProjection),this._map=void 0}},C.Hash=Ru,C.ImageSource=Br,C.KeyboardHandler=il,C.LngLatBounds=Mi,C.LogoControl=ql,C.Map=class extends Uu{constructor(y){var e,s;c.cw.mark(c.cx.create);const d=Object.assign(Object.assign(Object.assign({},mi),y),{canvasContextAttributes:Object.assign(Object.assign({},mi.canvasContextAttributes),y.canvasContextAttributes)});if(d.minZoom!=null&&d.maxZoom!=null&&d.minZoom>d.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(d.minPitch!=null&&d.maxPitch!=null&&d.minPitch>d.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(d.minPitch!=null&&d.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(d.maxPitch!=null&&d.maxPitch>180)throw new Error("maxPitch must be less than or equal to 180");const g=new Ls,_=new Na;if(d.minZoom!==void 0&&g.setMinZoom(d.minZoom),d.maxZoom!==void 0&&g.setMaxZoom(d.maxZoom),d.minPitch!==void 0&&g.setMinPitch(d.minPitch),d.maxPitch!==void 0&&g.setMaxPitch(d.maxPitch),d.renderWorldCopies!==void 0&&g.setRenderWorldCopies(d.renderWorldCopies),super(g,_,{bearingSnap:d.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new Gh,this._controls=[],this._mapId=c.a7(),this._contextLost=L=>{L.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new c.l("webglcontextlost",{originalEvent:L}))},this._contextRestored=L=>{this._setupPainter(),this.resize(),this._update(),this.fire(new c.l("webglcontextrestored",{originalEvent:L}))},this._onMapScroll=L=>{if(L.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=d.interactive,this._maxTileCacheSize=d.maxTileCacheSize,this._maxTileCacheZoomLevels=d.maxTileCacheZoomLevels,this._canvasContextAttributes=Object.assign({},d.canvasContextAttributes),this._trackResize=d.trackResize===!0,this._bearingSnap=d.bearingSnap,this._centerClampedToGround=d.centerClampedToGround,this._refreshExpiredTiles=d.refreshExpiredTiles===!0,this._fadeDuration=d.fadeDuration,this._crossSourceCollisions=d.crossSourceCollisions===!0,this._collectResourceTiming=d.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},sl),d.locale),this._clickTolerance=d.clickTolerance,this._overridePixelRatio=d.pixelRatio,this._maxCanvasSize=d.maxCanvasSize,this.transformCameraUpdate=d.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=d.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=Oe.addThrottleControl((()=>this.isMoving())),this._requestManager=new Je(d.transformRequest),typeof d.container=="string"){if(this._container=document.getElementById(d.container),!this._container)throw new Error(`Container '${d.container}' not found.`)}else{if(!(d.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=d.container}if(d.maxBounds&&this.setMaxBounds(d.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",(()=>this._update(!1))),this.on("moveend",(()=>this._update(!1))),this.on("zoom",(()=>this._update(!0))),this.on("terrain",(()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)})),this.once("idle",(()=>{this._idleTriggered=!0})),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let L=!1;const P=us((O=>{this._trackResize&&!this._removed&&(this.resize(O),this.redraw())}),50);this._resizeObserver=new ResizeObserver((O=>{L?P(O):L=!0})),this._resizeObserver.observe(this._container)}this.handlers=new hs(this,d),this._hash=d.hash&&new Ru(typeof d.hash=="string"&&d.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:d.center,elevation:d.elevation,zoom:d.zoom,bearing:d.bearing,pitch:d.pitch,roll:d.roll}),d.bounds&&(this.resize(),this.fitBounds(d.bounds,c.e({},d.fitBoundsOptions,{duration:0}))));const S=typeof d.style=="string"||((s=(e=d.style)===null||e===void 0?void 0:e.projection)===null||s===void 0?void 0:s.type)!=="globe";this.resize(null,S),this._localIdeographFontFamily=d.localIdeographFontFamily,this._validateStyle=d.validateStyle,d.style&&this.setStyle(d.style,{localIdeographFontFamily:d.localIdeographFontFamily}),d.attributionControl&&this.addControl(new $t(typeof d.attributionControl=="boolean"?void 0:d.attributionControl)),d.maplibreLogo&&this.addControl(new ql,d.logoPosition),this.on("style.load",(()=>{if(S||this._resizeTransform(),this.transform.unmodified){const L=c.Q(this.style.stylesheet,["center","zoom","bearing","pitch","roll"]);this.jumpTo(L)}})),this.on("data",(L=>{this._update(L.dataType==="style"),this.fire(new c.l(`${L.dataType}data`,L))})),this.on("dataloading",(L=>{this.fire(new c.l(`${L.dataType}dataloading`,L))})),this.on("dataabort",(L=>{this.fire(new c.l("sourcedataabort",L))}))}_getMapId(){return this._mapId}setGlobalStateProperty(y,e){return this.style.setGlobalStateProperty(y,e),this._update(!0)}getGlobalState(){return this.style.getGlobalState()}addControl(y,e){if(e===void 0&&(e=y.getDefaultPosition?y.getDefaultPosition():"top-right"),!y||!y.onAdd)return this.fire(new c.k(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const s=y.onAdd(this);this._controls.push(y);const d=this._controlPositions[e];return e.indexOf("bottom")!==-1?d.insertBefore(s,d.firstChild):d.appendChild(s),this}removeControl(y){if(!y||!y.onRemove)return this.fire(new c.k(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const e=this._controls.indexOf(y);return e>-1&&this._controls.splice(e,1),y.onRemove(this),this}hasControl(y){return this._controls.indexOf(y)>-1}coveringTiles(y){return mn(this.transform,y)}calculateCameraOptionsFromTo(y,e,s,d){return d==null&&this.terrain&&(d=this.terrain.getElevationForLngLatZoom(s,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(y,e,s,d)}resize(y,e=!0){const[s,d]=this._containerDimensions(),g=this._getClampedPixelRatio(s,d);if(this._resizeCanvas(s,d,g),this.painter.resize(s,d,g),this.painter.overLimit()){const S=this.painter.context.gl;this._maxCanvasSize=[S.drawingBufferWidth,S.drawingBufferHeight];const L=this._getClampedPixelRatio(s,d);this._resizeCanvas(s,d,L),this.painter.resize(s,d,L)}this._resizeTransform(e);const _=!this._moving;return _&&(this.stop(),this.fire(new c.l("movestart",y)).fire(new c.l("move",y))),this.fire(new c.l("resize",y)),_&&this.fire(new c.l("moveend",y)),this}_resizeTransform(y=!0){var e;const[s,d]=this._containerDimensions();this.transform.resize(s,d,y),(e=this._requestedCameraState)===null||e===void 0||e.resize(s,d,y)}_getClampedPixelRatio(y,e){const{0:s,1:d}=this._maxCanvasSize,g=this.getPixelRatio(),_=y*g,S=e*g;return Math.min(_>s?s/_:1,S>d?d/S:1)*g}getPixelRatio(){var y;return(y=this._overridePixelRatio)!==null&&y!==void 0?y:devicePixelRatio}setPixelRatio(y){this._overridePixelRatio=y,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(y){return this.transform.setMaxBounds(Mi.convert(y)),this._update()}setMinZoom(y){if((y=y??-2)>=-2&&y<=this.transform.maxZoom)return this.transform.setMinZoom(y),this._update(),this.getZoom()<y&&this.setZoom(y),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(y){if((y=y??22)>=this.transform.minZoom)return this.transform.setMaxZoom(y),this._update(),this.getZoom()>y&&this.setZoom(y),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(y){if((y=y??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(y>=0&&y<=this.transform.maxPitch)return this.transform.setMinPitch(y),this._update(),this.getPitch()<y&&this.setPitch(y),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(y){if((y=y??60)>180)throw new Error("maxPitch must be less than or equal to 180");if(y>=this.transform.minPitch)return this.transform.setMaxPitch(y),this._update(),this.getPitch()>y&&this.setPitch(y),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(y){return this.transform.setRenderWorldCopies(y),this._update()}project(y){return this.transform.locationToScreenPoint(c.S.convert(y),this.style&&this.terrain)}unproject(y){return this.transform.screenPointToLocation(c.P.convert(y),this.terrain)}isMoving(){var y;return this._moving||((y=this.handlers)===null||y===void 0?void 0:y.isMoving())}isZooming(){var y;return this._zooming||((y=this.handlers)===null||y===void 0?void 0:y.isZooming())}isRotating(){var y;return this._rotating||((y=this.handlers)===null||y===void 0?void 0:y.isRotating())}_createDelegatedListener(y,e,s){if(y==="mouseenter"||y==="mouseover"){let d=!1;return{layers:e,listener:s,delegates:{mousemove:_=>{const S=e.filter((P=>this.getLayer(P))),L=S.length!==0?this.queryRenderedFeatures(_.point,{layers:S}):[];L.length?d||(d=!0,s.call(this,new ea(y,this,_.originalEvent,{features:L}))):d=!1},mouseout:()=>{d=!1}}}}if(y==="mouseleave"||y==="mouseout"){let d=!1;return{layers:e,listener:s,delegates:{mousemove:S=>{const L=e.filter((P=>this.getLayer(P)));(L.length!==0?this.queryRenderedFeatures(S.point,{layers:L}):[]).length?d=!0:d&&(d=!1,s.call(this,new ea(y,this,S.originalEvent)))},mouseout:S=>{d&&(d=!1,s.call(this,new ea(y,this,S.originalEvent)))}}}}{const d=g=>{const _=e.filter((L=>this.getLayer(L))),S=_.length!==0?this.queryRenderedFeatures(g.point,{layers:_}):[];S.length&&(g.features=S,s.call(this,g),delete g.features)};return{layers:e,listener:s,delegates:{[y]:d}}}}_saveDelegatedListener(y,e){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[y]=this._delegatedListeners[y]||[],this._delegatedListeners[y].push(e)}_removeDelegatedListener(y,e,s){if(!this._delegatedListeners||!this._delegatedListeners[y])return;const d=this._delegatedListeners[y];for(let g=0;g<d.length;g++){const _=d[g];if(_.listener===s&&_.layers.length===e.length&&_.layers.every((S=>e.includes(S)))){for(const S in _.delegates)this.off(S,_.delegates[S]);return void d.splice(g,1)}}}on(y,e,s){if(s===void 0)return super.on(y,e);const d=typeof e=="string"?[e]:e,g=this._createDelegatedListener(y,d,s);this._saveDelegatedListener(y,g);for(const _ in g.delegates)this.on(_,g.delegates[_]);return{unsubscribe:()=>{this._removeDelegatedListener(y,d,s)}}}once(y,e,s){if(s===void 0)return super.once(y,e);const d=typeof e=="string"?[e]:e,g=this._createDelegatedListener(y,d,s);for(const _ in g.delegates){const S=g.delegates[_];g.delegates[_]=(...L)=>{this._removeDelegatedListener(y,d,s),S(...L)}}this._saveDelegatedListener(y,g);for(const _ in g.delegates)this.once(_,g.delegates[_]);return this}off(y,e,s){return s===void 0?super.off(y,e):(this._removeDelegatedListener(y,typeof e=="string"?[e]:e,s),this)}queryRenderedFeatures(y,e){if(!this.style)return[];let s;const d=y instanceof c.P||Array.isArray(y),g=d?y:[[0,0],[this.transform.width,this.transform.height]];if(e=e||(d?{}:y)||{},g instanceof c.P||typeof g[0]=="number")s=[c.P.convert(g)];else{const _=c.P.convert(g[0]),S=c.P.convert(g[1]);s=[_,new c.P(S.x,_.y),S,new c.P(_.x,S.y),_]}return this.style.queryRenderedFeatures(s,e,this.transform)}querySourceFeatures(y,e){return this.style.querySourceFeatures(y,e)}setStyle(y,e){return(e=c.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},e)).diff!==!1&&e.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&y?(this._diffStyle(y,e),this):(this._localIdeographFontFamily=e.localIdeographFontFamily,this._updateStyle(y,e))}setTransformRequest(y){return this._requestManager.setTransformRequest(y),this}_getUIString(y){const e=this._locale[y];if(e==null)throw new Error(`Missing UI string '${y}'`);return e}_updateStyle(y,e){var s,d;if(e.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",(()=>this._updateStyle(y,e)));const g=this.style&&e.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!y)),y?(this.style=new Jd(this,e||{}),this.style.setEventedParent(this,{style:this.style}),typeof y=="string"?this.style.loadURL(y,e,g):this.style.loadJSON(y,e,g),this):((d=(s=this.style)===null||s===void 0?void 0:s.projection)===null||d===void 0||d.destroy(),delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Jd(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(y,e){if(typeof y=="string"){const s=this._requestManager.transformRequest(y,"Style");c.j(s,new AbortController).then((d=>{this._updateDiff(d.data,e)})).catch((d=>{d&&this.fire(new c.k(d))}))}else typeof y=="object"&&this._updateDiff(y,e)}_updateDiff(y,e){try{this.style.setState(y,e)&&this._update(!0)}catch(s){c.w(`Unable to perform style diff: ${s.message||s.error||s}. Rebuilding the style from scratch.`),this._updateStyle(y,e)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():c.w("There is no style added to the map.")}addSource(y,e){return this._lazyInitEmptyStyle(),this.style.addSource(y,e),this._update(!0)}isSourceLoaded(y){const e=this.style&&this.style.sourceCaches[y];if(e!==void 0)return e.loaded();this.fire(new c.k(new Error(`There is no source with ID '${y}'`)))}setTerrain(y){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),y){const e=this.style.sourceCaches[y.source];if(!e)throw new Error(`cannot load terrain, because there exists no source with ID: ${y.source}`);this.terrain===null&&e.reload();for(const s in this.style._layers){const d=this.style._layers[s];d.type==="hillshade"&&d.source===y.source&&c.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality."),d.type==="color-relief"&&d.source===y.source&&c.w("You are using the same source for a color-relief layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new ba(this.painter,e,y),this.painter.renderToTexture=new Vp(this.painter,this.terrain),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this._terrainDataCallback=s=>{var d;s.dataType==="style"?this.terrain.sourceCache.freeRtt():s.dataType==="source"&&s.tile&&(s.sourceId!==y.source||this._elevationFreeze||(this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this._centerClampedToGround&&this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))),((d=s.source)===null||d===void 0?void 0:d.type)==="image"?this.terrain.sourceCache.freeRtt():this.terrain.sourceCache.freeRtt(s.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.setMinElevationForCurrentTile(0),this._centerClampedToGround&&this.transform.setElevation(0);return this.fire(new c.l("terrain",{terrain:y})),this}getTerrain(){var y,e;return(e=(y=this.terrain)===null||y===void 0?void 0:y.options)!==null&&e!==void 0?e:null}areTilesLoaded(){const y=this.style&&this.style.sourceCaches;for(const e in y){const s=y[e]._tiles;for(const d in s){const g=s[d];if(g.state!=="loaded"&&g.state!=="errored")return!1}}return!0}removeSource(y){return this.style.removeSource(y),this._update(!0)}getSource(y){return this.style.getSource(y)}setSourceTileLodParams(y,e,s){if(s){const d=this.getSource(s);if(!d)throw new Error(`There is no source with ID "${s}", cannot set LOD parameters`);d.calculateTileZoom=Pt(Math.max(1,y),Math.max(1,e))}else for(const d in this.style.sourceCaches)this.style.sourceCaches[d].getSource().calculateTileZoom=Pt(Math.max(1,y),Math.max(1,e));return this._update(!0),this}refreshTiles(y,e){const s=this.style.sourceCaches[y];if(!s)throw new Error(`There is no source cache with ID "${y}", cannot refresh tile`);e===void 0?s.reload(!0):s.refreshTiles(e.map((d=>new c.a4(d.z,d.x,d.y))))}addImage(y,e,s={}){const{pixelRatio:d=1,sdf:g=!1,stretchX:_,stretchY:S,content:L,textFitWidth:P,textFitHeight:O}=s;if(this._lazyInitEmptyStyle(),!(e instanceof HTMLImageElement||c.b(e))){if(e.width===void 0||e.height===void 0)return this.fire(new c.k(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:k,height:$,data:N}=e,q=e;return this.style.addImage(y,{data:new c.R({width:k,height:$},new Uint8Array(N)),pixelRatio:d,stretchX:_,stretchY:S,content:L,textFitWidth:P,textFitHeight:O,sdf:g,version:0,userImage:q}),q.onAdd&&q.onAdd(this,y),this}}{const{width:k,height:$,data:N}=Y.getImageData(e);this.style.addImage(y,{data:new c.R({width:k,height:$},N),pixelRatio:d,stretchX:_,stretchY:S,content:L,textFitWidth:P,textFitHeight:O,sdf:g,version:0})}}updateImage(y,e){const s=this.style.getImage(y);if(!s)return this.fire(new c.k(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const d=e instanceof HTMLImageElement||c.b(e)?Y.getImageData(e):e,{width:g,height:_,data:S}=d;if(g===void 0||_===void 0)return this.fire(new c.k(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!==s.data.width||_!==s.data.height)return this.fire(new c.k(new Error("The width and height of the updated image must be that same as the previous version of the image")));const L=!(e instanceof HTMLImageElement||c.b(e));return s.data.replace(S,L),this.style.updateImage(y,s),this}getImage(y){return this.style.getImage(y)}hasImage(y){return y?!!this.style.getImage(y):(this.fire(new c.k(new Error("Missing required image id"))),!1)}removeImage(y){this.style.removeImage(y)}loadImage(y){return Oe.getImage(this._requestManager.transformRequest(y,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(y,e){return this._lazyInitEmptyStyle(),this.style.addLayer(y,e),this._update(!0)}moveLayer(y,e){return this.style.moveLayer(y,e),this._update(!0)}removeLayer(y){return this.style.removeLayer(y),this._update(!0)}getLayer(y){return this.style.getLayer(y)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(y,e,s){return this.style.setLayerZoomRange(y,e,s),this._update(!0)}setFilter(y,e,s={}){return this.style.setFilter(y,e,s),this._update(!0)}getFilter(y){return this.style.getFilter(y)}setPaintProperty(y,e,s,d={}){return this.style.setPaintProperty(y,e,s,d),this._update(!0)}getPaintProperty(y,e){return this.style.getPaintProperty(y,e)}setLayoutProperty(y,e,s,d={}){return this.style.setLayoutProperty(y,e,s,d),this._update(!0)}getLayoutProperty(y,e){return this.style.getLayoutProperty(y,e)}setGlyphs(y,e={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(y,e),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(y,e,s={}){return this._lazyInitEmptyStyle(),this.style.addSprite(y,e,s,(d=>{d||this._update(!0)})),this}removeSprite(y){return this._lazyInitEmptyStyle(),this.style.removeSprite(y),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(y,e={}){return this._lazyInitEmptyStyle(),this.style.setSprite(y,e,(s=>{s||this._update(!0)})),this}setLight(y,e={}){return this._lazyInitEmptyStyle(),this.style.setLight(y,e),this._update(!0)}getLight(){return this.style.getLight()}setSky(y,e={}){return this._lazyInitEmptyStyle(),this.style.setSky(y,e),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(y,e){return this.style.setFeatureState(y,e),this._update()}removeFeatureState(y,e){return this.style.removeFeatureState(y,e),this._update()}getFeatureState(y){return this.style.getFeatureState(y)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let y=0,e=0;return this._container&&(y=this._container.clientWidth||400,e=this._container.clientHeight||300),[y,e]}_setupContainer(){const y=this._container;y.classList.add("maplibregl-map");const e=this._canvasContainer=U.create("div","maplibregl-canvas-container",y);this._interactive&&e.classList.add("maplibregl-interactive"),this._canvas=U.create("canvas","maplibregl-canvas",e),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");const s=this._containerDimensions(),d=this._getClampedPixelRatio(s[0],s[1]);this._resizeCanvas(s[0],s[1],d);const g=this._controlContainer=U.create("div","maplibregl-control-container",y),_=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((S=>{_[S]=U.create("div",`maplibregl-ctrl-${S} `,g)})),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(y,e,s){this._canvas.width=Math.floor(s*y),this._canvas.height=Math.floor(s*e),this._canvas.style.width=`${y}px`,this._canvas.style.height=`${e}px`}_setupPainter(){const y=Object.assign(Object.assign({},this._canvasContextAttributes),{alpha:!0,depth:!0,stencil:!0,premultipliedAlpha:!0});let e=null;this._canvas.addEventListener("webglcontextcreationerror",(d=>{e={requestedAttributes:y},d&&(e.statusMessage=d.statusMessage,e.type=d.type)}),{once:!0});let s=null;if(s=this._canvasContextAttributes.contextType?this._canvas.getContext(this._canvasContextAttributes.contextType,y):this._canvas.getContext("webgl2",y)||this._canvas.getContext("webgl",y),!s){const d="Failed to initialize WebGL";throw e?(e.message=d,new Error(JSON.stringify(e))):new Error(d)}this.painter=new lo(s,this.transform),oe.testSupport(s)}migrateProjection(y,e){super.migrateProjection(y,e),this.painter.transform=y,this.fire(new c.l("projectiontransition",{newProjection:this.style.projection.name}))}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(y){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||y,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(y){return this._update(),this._renderTaskQueue.add(y)}_cancelRenderFrame(y){this._renderTaskQueue.remove(y)}_render(y){var e,s,d,g,_;const S=this._idleTriggered?this._fadeDuration:0,L=((e=this.style.projection)===null||e===void 0?void 0:e.transitionState)>0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(y),this._removed)return;let P=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const $=this.transform.zoom,N=Y.now();this.style.zoomHistory.update($,N);const q=new c.F($,{now:N,fadeDuration:S,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),K=q.crossFadingFactor();K===1&&K===this._crossFadingFactor||(P=!0,this._crossFadingFactor=K),this.style.update(q)}const O=((s=this.style.projection)===null||s===void 0?void 0:s.transitionState)>0!==L;(d=this.style.projection)===null||d===void 0||d.setErrorQueryLatitudeDegrees(this.transform.center.lat),this.transform.setTransitionState((g=this.style.projection)===null||g===void 0?void 0:g.transitionState,(_=this.style.projection)===null||_===void 0?void 0:_.latitudeErrorCorrectionRadians),this.style&&(this._sourcesDirty||O)&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),!this._elevationFreeze&&this._centerClampedToGround&&this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.setMinElevationForCurrentTile(0),this._centerClampedToGround&&this.transform.setElevation(0)),this._placementDirty=this.style&&this.style._updatePlacement(this.transform,this.showCollisionBoxes,S,this._crossSourceCollisions,O),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:S,showPadding:this.showPadding}),this.fire(new c.l("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,c.cw.mark(c.cx.load),this.fire(new c.l("load"))),this.style&&(this.style.hasTransitions()||P)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const k=this._sourcesDirty||this._styleDirty||this._placementDirty;return k||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new c.l("idle")),!this._loaded||this._fullyLoaded||k||(this._fullyLoaded=!0,c.cw.mark(c.cx.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var y;this._hash&&this._hash.remove();for(const s of this._controls)s.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),Oe.removeThrottleControl(this._imageQueueHandle),(y=this._resizeObserver)===null||y===void 0||y.disconnect();const e=this.painter.context.gl.getExtension("WEBGL_lose_context");e!=null&&e.loseContext&&e.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),U.remove(this._canvasContainer),U.remove(this._controlContainer),this._container.removeEventListener("scroll",this._onMapScroll,!1),this._container.classList.remove("maplibregl-map"),c.cw.clearMetrics(),this._removed=!0,this.fire(new c.l("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,Y.frame(this._frameRequest,(y=>{c.cw.frame(y),this._frameRequest=null;try{this._render(y)}catch(e){if(!c.cy(e)&&!(function(s){return s.message===Au})(e))throw e}}),(()=>{})))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(y){this._showTileBoundaries!==y&&(this._showTileBoundaries=y,this._update())}get showPadding(){return!!this._showPadding}set showPadding(y){this._showPadding!==y&&(this._showPadding=y,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(y){this._showCollisionBoxes!==y&&(this._showCollisionBoxes=y,y?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(y){this._showOverdrawInspector!==y&&(this._showOverdrawInspector=y,this._update())}get repaint(){return!!this._repaint}set repaint(y){this._repaint!==y&&(this._repaint=y,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(y){this._vertices=y,this._update()}get version(){return wa}getCameraTargetElevation(){return this.transform.elevation}getProjection(){return this.style.getProjection()}setProjection(y){return this._lazyInitEmptyStyle(),this.style.setProjection(y),this._update(!0)}},C.MapMouseEvent=ea,C.MapTouchEvent=li,C.MapWheelEvent=Du,C.Marker=Ns,C.NavigationControl=class{constructor(y){this._updateZoomButtons=()=>{const e=this._map.getZoom(),s=e===this._map.getMaxZoom(),d=e===this._map.getMinZoom();this._zoomInButton.disabled=s,this._zoomOutButton.disabled=d,this._zoomInButton.setAttribute("aria-disabled",s.toString()),this._zoomOutButton.setAttribute("aria-disabled",d.toString())},this._rotateCompassArrow=()=>{this._compassIcon.style.transform=this.options.visualizePitch&&this.options.visualizeRoll?`scale(${1/Math.pow(Math.cos(this._map.transform.pitchInRadians),.5)}) rotateZ(${-this._map.transform.roll}deg) rotateX(${this._map.transform.pitch}deg) rotateZ(${-this._map.transform.bearing}deg)`:this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitchInRadians),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${-this._map.transform.bearing}deg)`:this.options.visualizeRoll?`rotate(${-this._map.transform.bearing-this._map.transform.roll}deg)`:`rotate(${-this._map.transform.bearing}deg)`},this._setButtonTitle=(e,s)=>{const d=this._map._getUIString(`NavigationControl.${s}`);e.title=d,e.setAttribute("aria-label",d)},this.options=c.e({},ui,y),this._container=U.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",(e=>e.preventDefault())),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",(e=>this._map.zoomIn({},{originalEvent:e}))),U.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",(e=>this._map.zoomOut({},{originalEvent:e}))),U.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",(e=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:e}):this._map.resetNorth({},{originalEvent:e})})),this._compassIcon=U.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(y){return this._map=y,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.options.visualizeRoll&&this._map.on("roll",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Yn(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){U.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.options.visualizeRoll&&this._map.off("roll",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(y,e){const s=U.create("button",y,this._container);return s.type="button",s.addEventListener("click",e),s}},C.Popup=class extends c.E{constructor(y){super(),this._updateOpacity=()=>{this.options.locationOccludedOpacity!==void 0&&(this._container.style.opacity=this._map.transform.isLocationOccluded(this.getLngLat())?`${this.options.locationOccludedOpacity}`:"")},this.remove=()=>(this._content&&U.remove(this._content),this._container&&(U.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new c.l("close"))),this),this._onMouseUp=e=>{this._update(e.point)},this._onMouseMove=e=>{this._update(e.point)},this._onDrag=e=>{this._update(e.point)},this._update=e=>{if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=U.create("div","maplibregl-popup",this._map.getContainer()),this._tip=U.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const S of this.options.className.split(" "))this._container.classList.add(S);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=kn(this._lngLat,this._flatPos,this._map.transform,this._trackPointer),this._trackPointer&&!e)return;const s=this._flatPos=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&e?e:this._map.transform.locationToScreenPoint(this._lngLat));let d=this.options.anchor;const g=ju(this.options.offset);if(!d){const S=this._container.offsetWidth,L=this._container.offsetHeight;let P;P=s.y+g.bottom.y<L?["top"]:s.y>this._map.transform.height-L?["bottom"]:[],s.x<S/2?P.push("left"):s.x>this._map.transform.width-S/2&&P.push("right"),d=P.length===0?"bottom":P.join("-")}let _=s.add(g[d]);this.options.subpixelPositioning||(_=_.round()),U.setTransform(this._container,`${_i[d]} translate(${_.x}px,${_.y}px)`),Hl(this._container,d,"popup"),this._updateOpacity()},this._onClose=()=>{this.remove()},this.options=c.e(Object.create($u),y)}addTo(y){return this._map&&this.remove(),this._map=y,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new c.l("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(y){return this._lngLat=c.S.convert(y),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(y){return this.setDOMContent(document.createTextNode(y))}setHTML(y){const e=document.createDocumentFragment(),s=document.createElement("body");let d;for(s.innerHTML=y;d=s.firstChild,d;)e.appendChild(d);return this.setDOMContent(e)}getMaxWidth(){var y;return(y=this._container)===null||y===void 0?void 0:y.style.maxWidth}setMaxWidth(y){return this.options.maxWidth=y,this._update(),this}setDOMContent(y){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=U.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(y),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(y){return this._container&&this._container.classList.add(y),this}removeClassName(y){return this._container&&this._container.classList.remove(y),this}setOffset(y){return this.options.offset=y,this._update(),this}toggleClassName(y){if(this._container)return this._container.classList.toggle(y)}setSubpixelPositioning(y){this.options.subpixelPositioning=y}_createCloseButton(){this.options.closeButton&&(this._closeButton=U.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const y=this._container.querySelector(Vu);y&&y.focus()}},C.RasterDEMTileSource=wl,C.RasterTileSource=Ba,C.ScaleControl=class{constructor(y){this._onMove=()=>{qh(this._map,this._container,this.options)},this.setUnit=e=>{this.options.unit=e,qh(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},ol),y)}getDefaultPosition(){return"bottom-left"}onAdd(y){return this._map=y,this._container=U.create("div","maplibregl-ctrl maplibregl-ctrl-scale",y.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){U.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},C.ScrollZoomHandler=bf,C.Style=Jd,C.TerrainControl=class{constructor(y){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=y}onAdd(y){return this._map=y,this._container=U.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=U.create("button","maplibregl-ctrl-terrain",this._container),U.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){U.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},C.TwoFingersTouchPitchHandler=Bc,C.TwoFingersTouchRotateHandler=ku,C.TwoFingersTouchZoomHandler=Bs,C.TwoFingersTouchZoomRotateHandler=al,C.VectorTileSource=ca,C.VideoSource=Do,C.addSourceType=(y,e)=>c._(void 0,void 0,void 0,(function*(){if(Ss(y))throw new Error(`A source type called "${y}" already exists.`);((s,d)=>{Oo[s]=d})(y,e)})),C.clearPrewarmedResources=function(){const y=pt;y&&(y.isPreloaded()&&y.numActive()===1?(y.release(Zt),pt=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()"))},C.createTileMesh=mu,C.getMaxParallelImageRequests=function(){return c.a.MAX_PARALLEL_IMAGE_REQUESTS},C.getRTLTextPluginStatus=function(){return Hs().getRTLTextPluginStatus()},C.getVersion=function(){return Hh},C.getWorkerCount=function(){return we.workerCount},C.getWorkerUrl=function(){return c.a.WORKER_URL},C.importScriptInWorkers=function(y){return Wt().broadcast("IS",y)},C.prewarm=function(){Bt().acquire(Zt)},C.setMaxParallelImageRequests=function(y){c.a.MAX_PARALLEL_IMAGE_REQUESTS=y},C.setRTLTextPlugin=function(y,e){return Hs().setRTLTextPlugin(y,e)},C.setWorkerCount=function(y){we.workerCount=y},C.setWorkerUrl=function(y){c.a.WORKER_URL=y}}));var E=h;return E}))})(y0)),y0.exports}var q5=tA();const nA=ti({__proto__:null,default:lr(q5)},[q5]);Wn.render=WM,Object.defineProperty(Wn,Symbol.toStringTag,{value:"Module"})}));